officeparser 5.2.2 → 6.0.1

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.
@@ -0,0 +1,165 @@
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 pZ=Object.create;var cE=Object.defineProperty;var gZ=Object.getOwnPropertyDescriptor;var mZ=Object.getOwnPropertyNames;var yZ=Object.getPrototypeOf,bZ=Object.prototype.hasOwnProperty;var q5=n=>{throw TypeError(n)};var vZ=(n,t,e)=>t in n?cE(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Up=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var br=(n,t)=>()=>(n&&(t=n(n=0)),t);var ae=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),tc=(n,t)=>{for(var e in t)cE(n,e,{get:t[e],enumerable:!0})},Y5=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of mZ(t))!bZ.call(n,i)&&i!==e&&cE(n,i,{get:()=>t[i],enumerable:!(r=gZ(t,i))||r.enumerable});return n};var jp=(n,t,e)=>(e=n!=null?pZ(yZ(n)):{},Y5(t||!n||!n.__esModule?cE(e,"default",{value:n,enumerable:!0}):e,n)),xn=n=>Y5(cE({},"__esModule",{value:!0}),n);var Lt=(n,t,e)=>vZ(n,typeof t!="symbol"?t+"":t,e),IP=(n,t,e)=>t.has(n)||q5("Cannot "+e);var l=(n,t,e)=>(IP(n,t,"read from private field"),e?e.call(n):t.get(n)),T=(n,t,e)=>t.has(n)?q5("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),x=(n,t,e,r)=>(IP(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),R=(n,t,e)=>(IP(n,t,"access private method"),e);var ze=(n,t,e,r)=>({set _(i){x(n,t,i,e)},get _(){return l(n,t,r)}});var Tt=br(()=>{});var process={};tc(process,{_debugEnd:()=>B8,_debugProcess:()=>F8,_events:()=>tU,_eventsCount:()=>eU,_exiting:()=>b8,_fatalExceptions:()=>N8,_getActiveHandles:()=>E8,_getActiveRequests:()=>A8,_kill:()=>S8,_linkedBinding:()=>m8,_maxListeners:()=>Q8,_preload_modules:()=>K8,_rawDebug:()=>p8,_startProfilerIdleNotifier:()=>U8,_stopProfilerIdleNotifier:()=>j8,_tickCallback:()=>M8,abort:()=>W8,addListener:()=>rU,allowedNodeEnvironmentFlags:()=>D8,arch:()=>t8,argv:()=>n8,argv0:()=>Y8,assert:()=>O8,binding:()=>l8,browser:()=>d8,chdir:()=>h8,config:()=>v8,cpuUsage:()=>$T,cwd:()=>u8,debugPort:()=>q8,default:()=>hU,dlopen:()=>w8,domain:()=>y8,emit:()=>oU,emitWarning:()=>o8,env:()=>r8,execArgv:()=>i8,execPath:()=>X8,exit:()=>R8,features:()=>P8,hasUncaughtExceptionCaptureCallback:()=>k8,hrtime:()=>jT,kill:()=>C8,listeners:()=>uU,memoryUsage:()=>T8,moduleLoadList:()=>g8,nextTick:()=>Z5,off:()=>iU,on:()=>gu,once:()=>nU,openStdin:()=>I8,pid:()=>G8,platform:()=>e8,ppid:()=>V8,prependListener:()=>lU,prependOnceListener:()=>cU,reallyExit:()=>x8,release:()=>f8,removeAllListeners:()=>aU,removeListener:()=>sU,resourceUsage:()=>_8,setSourceMapsEnabled:()=>Z8,setUncaughtExceptionCaptureCallback:()=>L8,stderr:()=>H8,stdin:()=>z8,stdout:()=>$8,title:()=>Q5,umask:()=>c8,uptime:()=>J8,version:()=>s8,versions:()=>a8});function PP(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}function wZ(){!T0||!$p||(T0=!1,$p.length?pu=$p.concat(pu):UT=-1,pu.length&&K5())}function K5(){if(!T0){var n=setTimeout(wZ,0);T0=!0;for(var t=pu.length;t;){for($p=pu,pu=[];++UT<t;)$p&&$p[UT].run();UT=-1,t=pu.length}$p=null,T0=!1,clearTimeout(n)}}function Z5(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];pu.push(new J5(n,t)),pu.length===1&&!T0&&setTimeout(K5,0)}function J5(n,t){this.fun=n,this.array=t}function rs(){}function m8(n){PP("_linkedBinding")}function w8(n){PP("dlopen")}function A8(){return[]}function E8(){return[]}function O8(n,t){if(!n)throw new Error(t||"assertion error")}function k8(){return!1}function J8(){return Cf.now()/1e3}function jT(n){var t=Math.floor((Date.now()-Cf.now())*.001),e=Cf.now()*.001,r=Math.floor(e)+t,i=Math.floor(e%1*1e9);return n&&(r=r-n[0],i=i-n[1],i<0&&(r--,i+=OP)),[r,i]}function gu(){return hU}function uU(n){return[]}var pu,T0,$p,UT,Q5,t8,e8,r8,n8,i8,s8,a8,o8,l8,c8,u8,h8,f8,d8,p8,g8,y8,b8,v8,x8,S8,$T,_8,T8,C8,R8,I8,D8,P8,N8,L8,M8,F8,B8,U8,j8,$8,H8,z8,W8,G8,V8,X8,q8,Y8,K8,Z8,Cf,DP,OP,Q8,tU,eU,rU,nU,iU,sU,aU,oU,lU,cU,hU,fU=br(()=>{Tt();Rt();Ct();pu=[],T0=!1,UT=-1;J5.prototype.run=function(){this.fun.apply(null,this.array)};Q5="browser",t8="x64",e8="browser",r8={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},n8=["/usr/bin/node"],i8=[],s8="v16.8.0",a8={},o8=function(n,t){console.warn((t?t+": ":"")+n)},l8=function(n){PP("binding")},c8=function(n){return 0},u8=function(){return"/"},h8=function(n){},f8={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};d8=!0,p8=rs,g8=[];y8={},b8=!1,v8={};x8=rs,S8=rs,$T=function(){return{}},_8=$T,T8=$T,C8=rs,R8=rs,I8=rs,D8={};P8={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},N8=rs,L8=rs;M8=rs,F8=rs,B8=rs,U8=rs,j8=rs,$8=void 0,H8=void 0,z8=void 0,W8=rs,G8=2,V8=1,X8="/bin/usr/node",q8=9229,Y8="node",K8=[],Z8=rs,Cf={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Cf.now===void 0&&(DP=Date.now(),Cf.timing&&Cf.timing.navigationStart&&(DP=Cf.timing.navigationStart),Cf.now=()=>Date.now()-DP);OP=1e9;jT.bigint=function(n){var t=jT(n);return typeof BigInt>"u"?t[0]*OP+t[1]:BigInt(t[0]*OP)+BigInt(t[1])};Q8=10,tU={},eU=0;rU=gu,nU=gu,iU=gu,sU=gu,aU=gu,oU=rs,lU=gu,cU=gu;hU={version:s8,versions:a8,arch:t8,platform:e8,browser:d8,release:f8,_rawDebug:p8,moduleLoadList:g8,binding:l8,_linkedBinding:m8,_events:tU,_eventsCount:eU,_maxListeners:Q8,on:gu,addListener:rU,once:nU,off:iU,removeListener:sU,removeAllListeners:aU,emit:oU,prependListener:lU,prependOnceListener:cU,listeners:uU,domain:y8,_exiting:b8,config:v8,dlopen:w8,uptime:J8,_getActiveRequests:A8,_getActiveHandles:E8,reallyExit:x8,_kill:S8,cpuUsage:$T,resourceUsage:_8,memoryUsage:T8,kill:C8,exit:R8,openStdin:I8,allowedNodeEnvironmentFlags:D8,assert:O8,features:P8,_fatalExceptions:N8,setUncaughtExceptionCaptureCallback:L8,hasUncaughtExceptionCaptureCallback:k8,emitWarning:o8,nextTick:Z5,_tickCallback:M8,_debugProcess:F8,_debugEnd:B8,_startProfilerIdleNotifier:U8,_stopProfilerIdleNotifier:j8,stdout:$8,stdin:z8,stderr:H8,abort:W8,umask:c8,chdir:h8,cwd:u8,env:r8,title:Q5,argv:n8,execArgv:i8,pid:G8,ppid:V8,execPath:X8,debugPort:q8,hrtime:jT,argv0:Y8,_preload_modules:K8,setSourceMapsEnabled:Z8}});var Ct=br(()=>{fU()});function AZ(){if(dU)return uE;dU=!0,uE.byteLength=o,uE.toByteArray=u,uE.fromByteArray=d;for(var n=[],t=[],e=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=r.length;i<s;++i)n[i]=r[i],t[r.charCodeAt(i)]=i;t[45]=62,t[95]=63;function a(p){var g=p.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=p.indexOf("=");y===-1&&(y=g);var b=y===g?0:4-y%4;return[y,b]}function o(p){var g=a(p),y=g[0],b=g[1];return(y+b)*3/4-b}function c(p,g,y){return(g+y)*3/4-y}function u(p){var g,y=a(p),b=y[0],m=y[1],w=new e(c(p,b,m)),A=0,_=m>0?b-4:b,S;for(S=0;S<_;S+=4)g=t[p.charCodeAt(S)]<<18|t[p.charCodeAt(S+1)]<<12|t[p.charCodeAt(S+2)]<<6|t[p.charCodeAt(S+3)],w[A++]=g>>16&255,w[A++]=g>>8&255,w[A++]=g&255;return m===2&&(g=t[p.charCodeAt(S)]<<2|t[p.charCodeAt(S+1)]>>4,w[A++]=g&255),m===1&&(g=t[p.charCodeAt(S)]<<10|t[p.charCodeAt(S+1)]<<4|t[p.charCodeAt(S+2)]>>2,w[A++]=g>>8&255,w[A++]=g&255),w}function h(p){return n[p>>18&63]+n[p>>12&63]+n[p>>6&63]+n[p&63]}function f(p,g,y){for(var b,m=[],w=g;w<y;w+=3)b=(p[w]<<16&16711680)+(p[w+1]<<8&65280)+(p[w+2]&255),m.push(h(b));return m.join("")}function d(p){for(var g,y=p.length,b=y%3,m=[],w=16383,A=0,_=y-b;A<_;A+=w)m.push(f(p,A,A+w>_?_:A+w));return b===1?(g=p[y-1],m.push(n[g>>2]+n[g<<4&63]+"==")):b===2&&(g=(p[y-2]<<8)+p[y-1],m.push(n[g>>10]+n[g>>4&63]+n[g<<2&63]+"=")),m.join("")}return uE}function EZ(){if(pU)return HT;pU=!0;return HT.read=function(n,t,e,r,i){var s,a,o=i*8-r-1,c=(1<<o)-1,u=c>>1,h=-7,f=e?i-1:0,d=e?-1:1,p=n[t+f];for(f+=d,s=p&(1<<-h)-1,p>>=-h,h+=o;h>0;s=s*256+n[t+f],f+=d,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=r;h>0;a=a*256+n[t+f],f+=d,h-=8);if(s===0)s=1-u;else{if(s===c)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,r),s=s-u}return(p?-1:1)*a*Math.pow(2,s-r)},HT.write=function(n,t,e,r,i,s){var a,o,c,u=s*8-i-1,h=(1<<u)-1,f=h>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,g=r?1:-1,y=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+f>=1?t+=d/c:t+=d*Math.pow(2,1-f),t*c>=2&&(a++,c/=2),a+f>=h?(o=0,a=h):a+f>=1?(o=(t*c-1)*Math.pow(2,i),a=a+f):(o=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;n[e+p]=o&255,p+=g,o/=256,i-=8);for(a=a<<i|o,u+=i;u>0;n[e+p]=a&255,p+=g,a/=256,u-=8);n[e+p-g]|=y*128},HT}function vi(){if(gU)return Hp;gU=!0;let n=AZ(),t=EZ(),e=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Hp.Buffer=a,Hp.SlowBuffer=m,Hp.INSPECT_MAX_BYTES=50;let r=2147483647;Hp.kMaxLength=r,a.TYPED_ARRAY_SUPPORT=i(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{let O=new Uint8Array(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,Uint8Array.prototype),Object.setPrototypeOf(O,v),O.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(O){if(O>r)throw new RangeError('The value "'+O+'" is invalid for option "size"');let v=new Uint8Array(O);return Object.setPrototypeOf(v,a.prototype),v}function a(O,v,E){if(typeof O=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(O)}return o(O,v,E)}a.poolSize=8192;function o(O,v,E){if(typeof O=="string")return f(O,v);if(ArrayBuffer.isView(O))return p(O);if(O==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O);if(Nt(O,ArrayBuffer)||O&&Nt(O.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Nt(O,SharedArrayBuffer)||O&&Nt(O.buffer,SharedArrayBuffer)))return g(O,v,E);if(typeof O=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let B=O.valueOf&&O.valueOf();if(B!=null&&B!==O)return a.from(B,v,E);let it=y(O);if(it)return it;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof O[Symbol.toPrimitive]=="function")return a.from(O[Symbol.toPrimitive]("string"),v,E);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O)}a.from=function(O,v,E){return o(O,v,E)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function c(O){if(typeof O!="number")throw new TypeError('"size" argument must be of type number');if(O<0)throw new RangeError('The value "'+O+'" is invalid for option "size"')}function u(O,v,E){return c(O),O<=0?s(O):v!==void 0?typeof E=="string"?s(O).fill(v,E):s(O).fill(v):s(O)}a.alloc=function(O,v,E){return u(O,v,E)};function h(O){return c(O),s(O<0?0:b(O)|0)}a.allocUnsafe=function(O){return h(O)},a.allocUnsafeSlow=function(O){return h(O)};function f(O,v){if((typeof v!="string"||v==="")&&(v="utf8"),!a.isEncoding(v))throw new TypeError("Unknown encoding: "+v);let E=w(O,v)|0,B=s(E),it=B.write(O,v);return it!==E&&(B=B.slice(0,it)),B}function d(O){let v=O.length<0?0:b(O.length)|0,E=s(v);for(let B=0;B<v;B+=1)E[B]=O[B]&255;return E}function p(O){if(Nt(O,Uint8Array)){let v=new Uint8Array(O);return g(v.buffer,v.byteOffset,v.byteLength)}return d(O)}function g(O,v,E){if(v<0||O.byteLength<v)throw new RangeError('"offset" is outside of buffer bounds');if(O.byteLength<v+(E||0))throw new RangeError('"length" is outside of buffer bounds');let B;return v===void 0&&E===void 0?B=new Uint8Array(O):E===void 0?B=new Uint8Array(O,v):B=new Uint8Array(O,v,E),Object.setPrototypeOf(B,a.prototype),B}function y(O){if(a.isBuffer(O)){let v=b(O.length)|0,E=s(v);return E.length===0||O.copy(E,0,0,v),E}if(O.length!==void 0)return typeof O.length!="number"||Ot(O.length)?s(0):d(O);if(O.type==="Buffer"&&Array.isArray(O.data))return d(O.data)}function b(O){if(O>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return O|0}function m(O){return+O!=O&&(O=0),a.alloc(+O)}a.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==a.prototype},a.compare=function(v,E){if(Nt(v,Uint8Array)&&(v=a.from(v,v.offset,v.byteLength)),Nt(E,Uint8Array)&&(E=a.from(E,E.offset,E.byteLength)),!a.isBuffer(v)||!a.isBuffer(E))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===E)return 0;let B=v.length,it=E.length;for(let k=0,ct=Math.min(B,it);k<ct;++k)if(v[k]!==E[k]){B=v[k],it=E[k];break}return B<it?-1:it<B?1:0},a.isEncoding=function(v){switch(String(v).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(v,E){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return a.alloc(0);let B;if(E===void 0)for(E=0,B=0;B<v.length;++B)E+=v[B].length;let it=a.allocUnsafe(E),k=0;for(B=0;B<v.length;++B){let ct=v[B];if(Nt(ct,Uint8Array))k+ct.length>it.length?(a.isBuffer(ct)||(ct=a.from(ct)),ct.copy(it,k)):Uint8Array.prototype.set.call(it,ct,k);else if(a.isBuffer(ct))ct.copy(it,k);else throw new TypeError('"list" argument must be an Array of Buffers');k+=ct.length}return it};function w(O,v){if(a.isBuffer(O))return O.length;if(ArrayBuffer.isView(O)||Nt(O,ArrayBuffer))return O.byteLength;if(typeof O!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof O);let E=O.length,B=arguments.length>2&&arguments[2]===!0;if(!B&&E===0)return 0;let it=!1;for(;;)switch(v){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return _t(O).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return xt(O).length;default:if(it)return B?-1:_t(O).length;v=(""+v).toLowerCase(),it=!0}}a.byteLength=w;function A(O,v,E){let B=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((E===void 0||E>this.length)&&(E=this.length),E<=0)||(E>>>=0,v>>>=0,E<=v))return"";for(O||(O="utf8");;)switch(O){case"hex":return D(this,v,E);case"utf8":case"utf-8":return j(this,v,E);case"ascii":return J(this,v,E);case"latin1":case"binary":return N(this,v,E);case"base64":return L(this,v,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,v,E);default:if(B)throw new TypeError("Unknown encoding: "+O);O=(O+"").toLowerCase(),B=!0}}a.prototype._isBuffer=!0;function _(O,v,E){let B=O[v];O[v]=O[E],O[E]=B}a.prototype.swap16=function(){let v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let E=0;E<v;E+=2)_(this,E,E+1);return this},a.prototype.swap32=function(){let v=this.length;if(v%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let E=0;E<v;E+=4)_(this,E,E+3),_(this,E+1,E+2);return this},a.prototype.swap64=function(){let v=this.length;if(v%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let E=0;E<v;E+=8)_(this,E,E+7),_(this,E+1,E+6),_(this,E+2,E+5),_(this,E+3,E+4);return this},a.prototype.toString=function(){let v=this.length;return v===0?"":arguments.length===0?j(this,0,v):A.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(v){if(!a.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v?!0:a.compare(this,v)===0},a.prototype.inspect=function(){let v="",E=Hp.INSPECT_MAX_BYTES;return v=this.toString("hex",0,E).replace(/(.{2})/g,"$1 ").trim(),this.length>E&&(v+=" ... "),"<Buffer "+v+">"},e&&(a.prototype[e]=a.prototype.inspect),a.prototype.compare=function(v,E,B,it,k){if(Nt(v,Uint8Array)&&(v=a.from(v,v.offset,v.byteLength)),!a.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(E===void 0&&(E=0),B===void 0&&(B=v?v.length:0),it===void 0&&(it=0),k===void 0&&(k=this.length),E<0||B>v.length||it<0||k>this.length)throw new RangeError("out of range index");if(it>=k&&E>=B)return 0;if(it>=k)return-1;if(E>=B)return 1;if(E>>>=0,B>>>=0,it>>>=0,k>>>=0,this===v)return 0;let ct=k-it,mt=B-E,St=Math.min(ct,mt),Et=this.slice(it,k),Dt=v.slice(E,B);for(let et=0;et<St;++et)if(Et[et]!==Dt[et]){ct=Et[et],mt=Dt[et];break}return ct<mt?-1:mt<ct?1:0};function S(O,v,E,B,it){if(O.length===0)return-1;if(typeof E=="string"?(B=E,E=0):E>2147483647?E=2147483647:E<-2147483648&&(E=-2147483648),E=+E,Ot(E)&&(E=it?0:O.length-1),E<0&&(E=O.length+E),E>=O.length){if(it)return-1;E=O.length-1}else if(E<0)if(it)E=0;else return-1;if(typeof v=="string"&&(v=a.from(v,B)),a.isBuffer(v))return v.length===0?-1:I(O,v,E,B,it);if(typeof v=="number")return v=v&255,typeof Uint8Array.prototype.indexOf=="function"?it?Uint8Array.prototype.indexOf.call(O,v,E):Uint8Array.prototype.lastIndexOf.call(O,v,E):I(O,[v],E,B,it);throw new TypeError("val must be string, number or Buffer")}function I(O,v,E,B,it){let k=1,ct=O.length,mt=v.length;if(B!==void 0&&(B=String(B).toLowerCase(),B==="ucs2"||B==="ucs-2"||B==="utf16le"||B==="utf-16le")){if(O.length<2||v.length<2)return-1;k=2,ct/=2,mt/=2,E/=2}function St(Dt,et){return k===1?Dt[et]:Dt.readUInt16BE(et*k)}let Et;if(it){let Dt=-1;for(Et=E;Et<ct;Et++)if(St(O,Et)===St(v,Dt===-1?0:Et-Dt)){if(Dt===-1&&(Dt=Et),Et-Dt+1===mt)return Dt*k}else Dt!==-1&&(Et-=Et-Dt),Dt=-1}else for(E+mt>ct&&(E=ct-mt),Et=E;Et>=0;Et--){let Dt=!0;for(let et=0;et<mt;et++)if(St(O,Et+et)!==St(v,et)){Dt=!1;break}if(Dt)return Et}return-1}a.prototype.includes=function(v,E,B){return this.indexOf(v,E,B)!==-1},a.prototype.indexOf=function(v,E,B){return S(this,v,E,B,!0)},a.prototype.lastIndexOf=function(v,E,B){return S(this,v,E,B,!1)};function C(O,v,E,B){E=Number(E)||0;let it=O.length-E;B?(B=Number(B),B>it&&(B=it)):B=it;let k=v.length;B>k/2&&(B=k/2);let ct;for(ct=0;ct<B;++ct){let mt=parseInt(v.substr(ct*2,2),16);if(Ot(mt))return ct;O[E+ct]=mt}return ct}function M(O,v,E,B){return $t(_t(v,O.length-E),O,E,B)}function z(O,v,E,B){return $t(At(v),O,E,B)}function G(O,v,E,B){return $t(xt(v),O,E,B)}function Y(O,v,E,B){return $t(gt(v,O.length-E),O,E,B)}a.prototype.write=function(v,E,B,it){if(E===void 0)it="utf8",B=this.length,E=0;else if(B===void 0&&typeof E=="string")it=E,B=this.length,E=0;else if(isFinite(E))E=E>>>0,isFinite(B)?(B=B>>>0,it===void 0&&(it="utf8")):(it=B,B=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let k=this.length-E;if((B===void 0||B>k)&&(B=k),v.length>0&&(B<0||E<0)||E>this.length)throw new RangeError("Attempt to write outside buffer bounds");it||(it="utf8");let ct=!1;for(;;)switch(it){case"hex":return C(this,v,E,B);case"utf8":case"utf-8":return M(this,v,E,B);case"ascii":case"latin1":case"binary":return z(this,v,E,B);case"base64":return G(this,v,E,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,v,E,B);default:if(ct)throw new TypeError("Unknown encoding: "+it);it=(""+it).toLowerCase(),ct=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(O,v,E){return v===0&&E===O.length?n.fromByteArray(O):n.fromByteArray(O.slice(v,E))}function j(O,v,E){E=Math.min(O.length,E);let B=[],it=v;for(;it<E;){let k=O[it],ct=null,mt=k>239?4:k>223?3:k>191?2:1;if(it+mt<=E){let St,Et,Dt,et;switch(mt){case 1:k<128&&(ct=k);break;case 2:St=O[it+1],(St&192)===128&&(et=(k&31)<<6|St&63,et>127&&(ct=et));break;case 3:St=O[it+1],Et=O[it+2],(St&192)===128&&(Et&192)===128&&(et=(k&15)<<12|(St&63)<<6|Et&63,et>2047&&(et<55296||et>57343)&&(ct=et));break;case 4:St=O[it+1],Et=O[it+2],Dt=O[it+3],(St&192)===128&&(Et&192)===128&&(Dt&192)===128&&(et=(k&15)<<18|(St&63)<<12|(Et&63)<<6|Dt&63,et>65535&&et<1114112&&(ct=et))}}ct===null?(ct=65533,mt=1):ct>65535&&(ct-=65536,B.push(ct>>>10&1023|55296),ct=56320|ct&1023),B.push(ct),it+=mt}return nt(B)}let q=4096;function nt(O){let v=O.length;if(v<=q)return String.fromCharCode.apply(String,O);let E="",B=0;for(;B<v;)E+=String.fromCharCode.apply(String,O.slice(B,B+=q));return E}function J(O,v,E){let B="";E=Math.min(O.length,E);for(let it=v;it<E;++it)B+=String.fromCharCode(O[it]&127);return B}function N(O,v,E){let B="";E=Math.min(O.length,E);for(let it=v;it<E;++it)B+=String.fromCharCode(O[it]);return B}function D(O,v,E){let B=O.length;(!v||v<0)&&(v=0),(!E||E<0||E>B)&&(E=B);let it="";for(let k=v;k<E;++k)it+=qt[O[k]];return it}function F(O,v,E){let B=O.slice(v,E),it="";for(let k=0;k<B.length-1;k+=2)it+=String.fromCharCode(B[k]+B[k+1]*256);return it}a.prototype.slice=function(v,E){let B=this.length;v=~~v,E=E===void 0?B:~~E,v<0?(v+=B,v<0&&(v=0)):v>B&&(v=B),E<0?(E+=B,E<0&&(E=0)):E>B&&(E=B),E<v&&(E=v);let it=this.subarray(v,E);return Object.setPrototypeOf(it,a.prototype),it};function P(O,v,E){if(O%1!==0||O<0)throw new RangeError("offset is not uint");if(O+v>E)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(v,E,B){v=v>>>0,E=E>>>0,B||P(v,E,this.length);let it=this[v],k=1,ct=0;for(;++ct<E&&(k*=256);)it+=this[v+ct]*k;return it},a.prototype.readUintBE=a.prototype.readUIntBE=function(v,E,B){v=v>>>0,E=E>>>0,B||P(v,E,this.length);let it=this[v+--E],k=1;for(;E>0&&(k*=256);)it+=this[v+--E]*k;return it},a.prototype.readUint8=a.prototype.readUInt8=function(v,E){return v=v>>>0,E||P(v,1,this.length),this[v]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(v,E){return v=v>>>0,E||P(v,2,this.length),this[v]|this[v+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(v,E){return v=v>>>0,E||P(v,2,this.length),this[v]<<8|this[v+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(v,E){return v=v>>>0,E||P(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(v,E){return v=v>>>0,E||P(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},a.prototype.readBigUInt64LE=Jt(function(v){v=v>>>0,Q(v,"offset");let E=this[v],B=this[v+7];(E===void 0||B===void 0)&&W(v,this.length-8);let it=E+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24,k=this[++v]+this[++v]*2**8+this[++v]*2**16+B*2**24;return BigInt(it)+(BigInt(k)<<BigInt(32))}),a.prototype.readBigUInt64BE=Jt(function(v){v=v>>>0,Q(v,"offset");let E=this[v],B=this[v+7];(E===void 0||B===void 0)&&W(v,this.length-8);let it=E*2**24+this[++v]*2**16+this[++v]*2**8+this[++v],k=this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+B;return(BigInt(it)<<BigInt(32))+BigInt(k)}),a.prototype.readIntLE=function(v,E,B){v=v>>>0,E=E>>>0,B||P(v,E,this.length);let it=this[v],k=1,ct=0;for(;++ct<E&&(k*=256);)it+=this[v+ct]*k;return k*=128,it>=k&&(it-=Math.pow(2,8*E)),it},a.prototype.readIntBE=function(v,E,B){v=v>>>0,E=E>>>0,B||P(v,E,this.length);let it=E,k=1,ct=this[v+--it];for(;it>0&&(k*=256);)ct+=this[v+--it]*k;return k*=128,ct>=k&&(ct-=Math.pow(2,8*E)),ct},a.prototype.readInt8=function(v,E){return v=v>>>0,E||P(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},a.prototype.readInt16LE=function(v,E){v=v>>>0,E||P(v,2,this.length);let B=this[v]|this[v+1]<<8;return B&32768?B|4294901760:B},a.prototype.readInt16BE=function(v,E){v=v>>>0,E||P(v,2,this.length);let B=this[v+1]|this[v]<<8;return B&32768?B|4294901760:B},a.prototype.readInt32LE=function(v,E){return v=v>>>0,E||P(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},a.prototype.readInt32BE=function(v,E){return v=v>>>0,E||P(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},a.prototype.readBigInt64LE=Jt(function(v){v=v>>>0,Q(v,"offset");let E=this[v],B=this[v+7];(E===void 0||B===void 0)&&W(v,this.length-8);let it=this[v+4]+this[v+5]*2**8+this[v+6]*2**16+(B<<24);return(BigInt(it)<<BigInt(32))+BigInt(E+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24)}),a.prototype.readBigInt64BE=Jt(function(v){v=v>>>0,Q(v,"offset");let E=this[v],B=this[v+7];(E===void 0||B===void 0)&&W(v,this.length-8);let it=(E<<24)+this[++v]*2**16+this[++v]*2**8+this[++v];return(BigInt(it)<<BigInt(32))+BigInt(this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+B)}),a.prototype.readFloatLE=function(v,E){return v=v>>>0,E||P(v,4,this.length),t.read(this,v,!0,23,4)},a.prototype.readFloatBE=function(v,E){return v=v>>>0,E||P(v,4,this.length),t.read(this,v,!1,23,4)},a.prototype.readDoubleLE=function(v,E){return v=v>>>0,E||P(v,8,this.length),t.read(this,v,!0,52,8)},a.prototype.readDoubleBE=function(v,E){return v=v>>>0,E||P(v,8,this.length),t.read(this,v,!1,52,8)};function V(O,v,E,B,it,k){if(!a.isBuffer(O))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>it||v<k)throw new RangeError('"value" argument is out of bounds');if(E+B>O.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(v,E,B,it){if(v=+v,E=E>>>0,B=B>>>0,!it){let mt=Math.pow(2,8*B)-1;V(this,v,E,B,mt,0)}let k=1,ct=0;for(this[E]=v&255;++ct<B&&(k*=256);)this[E+ct]=v/k&255;return E+B},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(v,E,B,it){if(v=+v,E=E>>>0,B=B>>>0,!it){let mt=Math.pow(2,8*B)-1;V(this,v,E,B,mt,0)}let k=B-1,ct=1;for(this[E+k]=v&255;--k>=0&&(ct*=256);)this[E+k]=v/ct&255;return E+B},a.prototype.writeUint8=a.prototype.writeUInt8=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,1,255,0),this[E]=v&255,E+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,2,65535,0),this[E]=v&255,this[E+1]=v>>>8,E+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,2,65535,0),this[E]=v>>>8,this[E+1]=v&255,E+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,4,4294967295,0),this[E+3]=v>>>24,this[E+2]=v>>>16,this[E+1]=v>>>8,this[E]=v&255,E+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,4,4294967295,0),this[E]=v>>>24,this[E+1]=v>>>16,this[E+2]=v>>>8,this[E+3]=v&255,E+4};function $(O,v,E,B,it){wt(v,B,it,O,E,7);let k=Number(v&BigInt(4294967295));O[E++]=k,k=k>>8,O[E++]=k,k=k>>8,O[E++]=k,k=k>>8,O[E++]=k;let ct=Number(v>>BigInt(32)&BigInt(4294967295));return O[E++]=ct,ct=ct>>8,O[E++]=ct,ct=ct>>8,O[E++]=ct,ct=ct>>8,O[E++]=ct,E}function H(O,v,E,B,it){wt(v,B,it,O,E,7);let k=Number(v&BigInt(4294967295));O[E+7]=k,k=k>>8,O[E+6]=k,k=k>>8,O[E+5]=k,k=k>>8,O[E+4]=k;let ct=Number(v>>BigInt(32)&BigInt(4294967295));return O[E+3]=ct,ct=ct>>8,O[E+2]=ct,ct=ct>>8,O[E+1]=ct,ct=ct>>8,O[E]=ct,E+8}a.prototype.writeBigUInt64LE=Jt(function(v,E=0){return $(this,v,E,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Jt(function(v,E=0){return H(this,v,E,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(v,E,B,it){if(v=+v,E=E>>>0,!it){let St=Math.pow(2,8*B-1);V(this,v,E,B,St-1,-St)}let k=0,ct=1,mt=0;for(this[E]=v&255;++k<B&&(ct*=256);)v<0&&mt===0&&this[E+k-1]!==0&&(mt=1),this[E+k]=(v/ct>>0)-mt&255;return E+B},a.prototype.writeIntBE=function(v,E,B,it){if(v=+v,E=E>>>0,!it){let St=Math.pow(2,8*B-1);V(this,v,E,B,St-1,-St)}let k=B-1,ct=1,mt=0;for(this[E+k]=v&255;--k>=0&&(ct*=256);)v<0&&mt===0&&this[E+k+1]!==0&&(mt=1),this[E+k]=(v/ct>>0)-mt&255;return E+B},a.prototype.writeInt8=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,1,127,-128),v<0&&(v=255+v+1),this[E]=v&255,E+1},a.prototype.writeInt16LE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,2,32767,-32768),this[E]=v&255,this[E+1]=v>>>8,E+2},a.prototype.writeInt16BE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,2,32767,-32768),this[E]=v>>>8,this[E+1]=v&255,E+2},a.prototype.writeInt32LE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,4,2147483647,-2147483648),this[E]=v&255,this[E+1]=v>>>8,this[E+2]=v>>>16,this[E+3]=v>>>24,E+4},a.prototype.writeInt32BE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[E]=v>>>24,this[E+1]=v>>>16,this[E+2]=v>>>8,this[E+3]=v&255,E+4},a.prototype.writeBigInt64LE=Jt(function(v,E=0){return $(this,v,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Jt(function(v,E=0){return H(this,v,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function rt(O,v,E,B,it,k){if(E+B>O.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function lt(O,v,E,B,it){return v=+v,E=E>>>0,it||rt(O,v,E,4),t.write(O,v,E,B,23,4),E+4}a.prototype.writeFloatLE=function(v,E,B){return lt(this,v,E,!0,B)},a.prototype.writeFloatBE=function(v,E,B){return lt(this,v,E,!1,B)};function ft(O,v,E,B,it){return v=+v,E=E>>>0,it||rt(O,v,E,8),t.write(O,v,E,B,52,8),E+8}a.prototype.writeDoubleLE=function(v,E,B){return ft(this,v,E,!0,B)},a.prototype.writeDoubleBE=function(v,E,B){return ft(this,v,E,!1,B)},a.prototype.copy=function(v,E,B,it){if(!a.isBuffer(v))throw new TypeError("argument should be a Buffer");if(B||(B=0),!it&&it!==0&&(it=this.length),E>=v.length&&(E=v.length),E||(E=0),it>0&&it<B&&(it=B),it===B||v.length===0||this.length===0)return 0;if(E<0)throw new RangeError("targetStart out of bounds");if(B<0||B>=this.length)throw new RangeError("Index out of range");if(it<0)throw new RangeError("sourceEnd out of bounds");it>this.length&&(it=this.length),v.length-E<it-B&&(it=v.length-E+B);let k=it-B;return this===v&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(E,B,it):Uint8Array.prototype.set.call(v,this.subarray(B,it),E),k},a.prototype.fill=function(v,E,B,it){if(typeof v=="string"){if(typeof E=="string"?(it=E,E=0,B=this.length):typeof B=="string"&&(it=B,B=this.length),it!==void 0&&typeof it!="string")throw new TypeError("encoding must be a string");if(typeof it=="string"&&!a.isEncoding(it))throw new TypeError("Unknown encoding: "+it);if(v.length===1){let ct=v.charCodeAt(0);(it==="utf8"&&ct<128||it==="latin1")&&(v=ct)}}else typeof v=="number"?v=v&255:typeof v=="boolean"&&(v=Number(v));if(E<0||this.length<E||this.length<B)throw new RangeError("Out of range index");if(B<=E)return this;E=E>>>0,B=B===void 0?this.length:B>>>0,v||(v=0);let k;if(typeof v=="number")for(k=E;k<B;++k)this[k]=v;else{let ct=a.isBuffer(v)?v:a.from(v,it),mt=ct.length;if(mt===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(k=0;k<B-E;++k)this[k+E]=ct[k%mt]}return this};let K={};function X(O,v,E){K[O]=class extends E{constructor(){super(),Object.defineProperty(this,"message",{value:v.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${O}]`,this.stack,delete this.name}get code(){return O}set code(it){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:it,writable:!0})}toString(){return`${this.name} [${O}]: ${this.message}`}}}X("ERR_BUFFER_OUT_OF_BOUNDS",function(O){return O?`${O} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),X("ERR_INVALID_ARG_TYPE",function(O,v){return`The "${O}" argument must be of type number. Received type ${typeof v}`},TypeError),X("ERR_OUT_OF_RANGE",function(O,v,E){let B=`The value of "${O}" is out of range.`,it=E;return Number.isInteger(E)&&Math.abs(E)>2**32?it=st(String(E)):typeof E=="bigint"&&(it=String(E),(E>BigInt(2)**BigInt(32)||E<-(BigInt(2)**BigInt(32)))&&(it=st(it)),it+="n"),B+=` It must be ${v}. Received ${it}`,B},RangeError);function st(O){let v="",E=O.length,B=O[0]==="-"?1:0;for(;E>=B+4;E-=3)v=`_${O.slice(E-3,E)}${v}`;return`${O.slice(0,E)}${v}`}function bt(O,v,E){Q(v,"offset"),(O[v]===void 0||O[v+E]===void 0)&&W(v,O.length-(E+1))}function wt(O,v,E,B,it,k){if(O>E||O<v){let ct=typeof v=="bigint"?"n":"",mt;throw v===0||v===BigInt(0)?mt=`>= 0${ct} and < 2${ct} ** ${(k+1)*8}${ct}`:mt=`>= -(2${ct} ** ${(k+1)*8-1}${ct}) and < 2 ** ${(k+1)*8-1}${ct}`,new K.ERR_OUT_OF_RANGE("value",mt,O)}bt(B,it,k)}function Q(O,v){if(typeof O!="number")throw new K.ERR_INVALID_ARG_TYPE(v,"number",O)}function W(O,v,E){throw Math.floor(O)!==O?(Q(O,E),new K.ERR_OUT_OF_RANGE("offset","an integer",O)):v<0?new K.ERR_BUFFER_OUT_OF_BOUNDS:new K.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${v}`,O)}let at=/[^+/0-9A-Za-z-_]/g;function pt(O){if(O=O.split("=")[0],O=O.trim().replace(at,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function _t(O,v){v=v||1/0;let E,B=O.length,it=null,k=[];for(let ct=0;ct<B;++ct){if(E=O.charCodeAt(ct),E>55295&&E<57344){if(!it){if(E>56319){(v-=3)>-1&&k.push(239,191,189);continue}else if(ct+1===B){(v-=3)>-1&&k.push(239,191,189);continue}it=E;continue}if(E<56320){(v-=3)>-1&&k.push(239,191,189),it=E;continue}E=(it-55296<<10|E-56320)+65536}else it&&(v-=3)>-1&&k.push(239,191,189);if(it=null,E<128){if((v-=1)<0)break;k.push(E)}else if(E<2048){if((v-=2)<0)break;k.push(E>>6|192,E&63|128)}else if(E<65536){if((v-=3)<0)break;k.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((v-=4)<0)break;k.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return k}function At(O){let v=[];for(let E=0;E<O.length;++E)v.push(O.charCodeAt(E)&255);return v}function gt(O,v){let E,B,it,k=[];for(let ct=0;ct<O.length&&!((v-=2)<0);++ct)E=O.charCodeAt(ct),B=E>>8,it=E%256,k.push(it),k.push(B);return k}function xt(O){return n.toByteArray(pt(O))}function $t(O,v,E,B){let it;for(it=0;it<B&&!(it+E>=v.length||it>=O.length);++it)v[it+E]=O[it];return it}function Nt(O,v){return O instanceof v||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===v.name}function Ot(O){return O!==O}let qt=(function(){let O="0123456789abcdef",v=new Array(256);for(let E=0;E<16;++E){let B=E*16;for(let it=0;it<16;++it)v[B+it]=O[E]+O[it]}return v})();function Jt(O){return typeof BigInt>"u"?te:O}function te(){throw new Error("BigInt not supported")}return Hp}var uE,dU,HT,pU,Hp,gU,C0=br(()=>{Tt();Rt();Ct();uE={},dU=!1;HT={},pU=!1;Hp={},gU=!1});var R0={};tc(R0,{Buffer:()=>Buffer,INSPECT_MAX_BYTES:()=>xZ,default:()=>Rf,kMaxLength:()=>SZ});var Rf,Buffer,xZ,SZ,If=br(()=>{Tt();Rt();Ct();C0();Rf=vi();Rf.Buffer;Rf.SlowBuffer;Rf.INSPECT_MAX_BYTES;Rf.kMaxLength;Buffer=Rf.Buffer,xZ=Rf.INSPECT_MAX_BYTES,SZ=Rf.kMaxLength});var Rt=br(()=>{If()});function FP(){throw new Error("setTimeout has not been defined")}function BP(){throw new Error("clearTimeout has not been defined")}function IU(n){if(yu===setTimeout)return setTimeout(n,0);if((yu===FP||!yu)&&setTimeout)return yu=setTimeout,setTimeout(n,0);try{return yu(n,0)}catch{try{return yu.call(null,n,0)}catch{return yu.call(this||D0,n,0)}}}function _Z(){I0&&Wp&&(I0=!1,Wp.length?vu=Wp.concat(vu):qT=-1,vu.length&&DU())}function DU(){if(!I0){var n=IU(_Z);I0=!0;for(var t=vu.length;t;){for(Wp=vu,vu=[];++qT<t;)Wp&&Wp[qT].run();qT=-1,t=vu.length}Wp=null,I0=!1,(function(e){if(bu===clearTimeout)return clearTimeout(e);if((bu===BP||!bu)&&clearTimeout)return bu=clearTimeout,clearTimeout(e);try{bu(e)}catch{try{return bu.call(null,e)}catch{return bu.call(this||D0,e)}}})(n)}}function mU(n,t){(this||D0).fun=n,(this||D0).array=t}function mu(){}function Vp(n){return n.call.bind(n)}function pE(n,t){if(typeof n!="object")return!1;try{return t(n),!0}catch{return!1}}function bU(n){return Hs&&ya?Ao(n)!==void 0:MU(n)||FU(n)||BU(n)||UU(n)||jU(n)||$U(n)||HU(n)||zU(n)||WU(n)||GU(n)||VU(n)}function MU(n){return Hs&&ya?Ao(n)==="Uint8Array":dn(n)==="[object Uint8Array]"||kZ(n)&&n.buffer!==void 0}function FU(n){return Hs&&ya?Ao(n)==="Uint8ClampedArray":dn(n)==="[object Uint8ClampedArray]"}function BU(n){return Hs&&ya?Ao(n)==="Uint16Array":dn(n)==="[object Uint16Array]"}function UU(n){return Hs&&ya?Ao(n)==="Uint32Array":dn(n)==="[object Uint32Array]"}function jU(n){return Hs&&ya?Ao(n)==="Int8Array":dn(n)==="[object Int8Array]"}function $U(n){return Hs&&ya?Ao(n)==="Int16Array":dn(n)==="[object Int16Array]"}function HU(n){return Hs&&ya?Ao(n)==="Int32Array":dn(n)==="[object Int32Array]"}function zU(n){return Hs&&ya?Ao(n)==="Float32Array":dn(n)==="[object Float32Array]"}function WU(n){return Hs&&ya?Ao(n)==="Float64Array":dn(n)==="[object Float64Array]"}function GU(n){return Hs&&ya?Ao(n)==="BigInt64Array":dn(n)==="[object BigInt64Array]"}function VU(n){return Hs&&ya?Ao(n)==="BigUint64Array":dn(n)==="[object BigUint64Array]"}function zT(n){return dn(n)==="[object Map]"}function WT(n){return dn(n)==="[object Set]"}function GT(n){return dn(n)==="[object WeakMap]"}function NP(n){return dn(n)==="[object WeakSet]"}function KT(n){return dn(n)==="[object ArrayBuffer]"}function vU(n){return typeof ArrayBuffer<"u"&&(KT.working?KT(n):n instanceof ArrayBuffer)}function ZT(n){return dn(n)==="[object DataView]"}function wU(n){return typeof DataView<"u"&&(ZT.working?ZT(n):n instanceof DataView)}function JT(n){return dn(n)==="[object SharedArrayBuffer]"}function AU(n){return typeof SharedArrayBuffer<"u"&&(JT.working?JT(n):n instanceof SharedArrayBuffer)}function EU(n){return pE(n,jZ)}function xU(n){return pE(n,$Z)}function SU(n){return pE(n,HZ)}function _U(n){return kU&&pE(n,zZ)}function TU(n){return jP&&pE(n,WZ)}function Df(n,t){var e={seen:[],stylize:XZ};return arguments.length>=3&&(e.depth=arguments[2]),arguments.length>=4&&(e.colors=arguments[3]),$P(t)?e.showHidden=t:t&&zt._extend(e,t),Gp(e.showHidden)&&(e.showHidden=!1),Gp(e.depth)&&(e.depth=2),Gp(e.colors)&&(e.colors=!1),Gp(e.customInspect)&&(e.customInspect=!0),e.colors&&(e.stylize=VZ),QT(e,n,e.depth)}function VZ(n,t){var e=Df.styles[t];return e?"\x1B["+Df.colors[e][0]+"m"+n+"\x1B["+Df.colors[e][1]+"m":n}function XZ(n,t){return n}function QT(n,t,e){if(n.customInspect&&t&&YT(t.inspect)&&t.inspect!==zt.inspect&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(e,n);return tC(r)||(r=QT(n,r,e)),r}var i=(function(d,p){if(Gp(p))return d.stylize("undefined","undefined");if(tC(p)){var g="'"+JSON.stringify(p).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return d.stylize(g,"string")}if(YU(p))return d.stylize(""+p,"number");if($P(p))return d.stylize(""+p,"boolean");if(nC(p))return d.stylize("null","null")})(n,t);if(i)return i;var s=Object.keys(t),a=(function(d){var p={};return d.forEach((function(g,y){p[g]=!0})),p})(s);if(n.showHidden&&(s=Object.getOwnPropertyNames(t)),dE(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return LP(t);if(s.length===0){if(YT(t)){var o=t.name?": "+t.name:"";return n.stylize("[Function"+o+"]","special")}if(fE(t))return n.stylize(RegExp.prototype.toString.call(t),"regexp");if(eC(t))return n.stylize(Date.prototype.toString.call(t),"date");if(dE(t))return LP(t)}var c,u="",h=!1,f=["{","}"];return qU(t)&&(h=!0,f=["[","]"]),YT(t)&&(u=" [Function"+(t.name?": "+t.name:"")+"]"),fE(t)&&(u=" "+RegExp.prototype.toString.call(t)),eC(t)&&(u=" "+Date.prototype.toUTCString.call(t)),dE(t)&&(u=" "+LP(t)),s.length!==0||h&&t.length!=0?e<0?fE(t)?n.stylize(RegExp.prototype.toString.call(t),"regexp"):n.stylize("[Object]","special"):(n.seen.push(t),c=h?(function(d,p,g,y,b){for(var m=[],w=0,A=p.length;w<A;++w)KU(p,String(w))?m.push(kP(d,p,g,y,String(w),!0)):m.push("");return b.forEach((function(_){_.match(/^\d+$/)||m.push(kP(d,p,g,y,_,!0))})),m})(n,t,e,a,s):s.map((function(d){return kP(n,t,e,a,d,h)})),n.seen.pop(),(function(d,p,g){var y=0;return d.reduce((function(b,m){return y++,m.indexOf(`
11
+ `)>=0&&y++,b+m.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?g[0]+(p===""?"":p+`
12
+ `)+" "+d.join(`,
13
+ `)+" "+g[1]:g[0]+p+" "+d.join(", ")+" "+g[1]})(c,u,f)):f[0]+u+f[1]}function LP(n){return"["+Error.prototype.toString.call(n)+"]"}function kP(n,t,e,r,i,s){var a,o,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?o=c.set?n.stylize("[Getter/Setter]","special"):n.stylize("[Getter]","special"):c.set&&(o=n.stylize("[Setter]","special")),KU(r,i)||(a="["+i+"]"),o||(n.seen.indexOf(c.value)<0?(o=nC(e)?QT(n,c.value,null):QT(n,c.value,e-1)).indexOf(`
14
+ `)>-1&&(o=s?o.split(`
15
+ `).map((function(u){return" "+u})).join(`
16
+ `).substr(2):`
17
+ `+o.split(`
18
+ `).map((function(u){return" "+u})).join(`
19
+ `)):o=n.stylize("[Circular]","special")),Gp(a)){if(s&&i.match(/^\d+$/))return o;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=n.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=n.stylize(a,"string"))}return a+": "+o}function qU(n){return Array.isArray(n)}function $P(n){return typeof n=="boolean"}function nC(n){return n===null}function YU(n){return typeof n=="number"}function tC(n){return typeof n=="string"}function Gp(n){return n===void 0}function fE(n){return O0(n)&&HP(n)==="[object RegExp]"}function O0(n){return typeof n=="object"&&n!==null}function eC(n){return O0(n)&&HP(n)==="[object Date]"}function dE(n){return O0(n)&&(HP(n)==="[object Error]"||n instanceof Error)}function YT(n){return typeof n=="function"}function HP(n){return Object.prototype.toString.call(n)}function MP(n){return n<10?"0"+n.toString(10):n.toString(10)}function YZ(){var n=new Date,t=[MP(n.getHours()),MP(n.getMinutes()),MP(n.getSeconds())].join(":");return[n.getDate(),qZ[n.getMonth()],t].join(" ")}function KU(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function KZ(n,t){if(!n){var e=new Error("Promise was rejected with a falsy value");e.reason=n,n=e}return t(n)}var RU,yu,bu,D0,jn,Wp,vu,I0,qT,Ur,TZ,UP,rC,OU,CZ,RZ,IZ,DZ,OZ,PU,NU,yU,PZ,NZ,LZ,LU,Ye,kZ,MZ,FZ,kU,jP,ya,Hs,BZ,dn,jZ,$Z,HZ,hE,zt,ec,CU,GZ,VT,XU,XT,qZ,zp,hdt,Of=br(()=>{Tt();Rt();Ct();D0=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,jn=RU={};(function(){try{yu=typeof setTimeout=="function"?setTimeout:FP}catch{yu=FP}try{bu=typeof clearTimeout=="function"?clearTimeout:BP}catch{bu=BP}})();vu=[],I0=!1,qT=-1;jn.nextTick=function(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];vu.push(new mU(n,t)),vu.length!==1||I0||IU(DU)},mU.prototype.run=function(){(this||D0).fun.apply(null,(this||D0).array)},jn.title="browser",jn.browser=!0,jn.env={},jn.argv=[],jn.version="",jn.versions={},jn.on=mu,jn.addListener=mu,jn.once=mu,jn.off=mu,jn.removeListener=mu,jn.removeAllListeners=mu,jn.emit=mu,jn.prependListener=mu,jn.prependOnceListener=mu,jn.listeners=function(n){return[]},jn.binding=function(n){throw new Error("process.binding is not supported")},jn.cwd=function(){return"/"},jn.chdir=function(n){throw new Error("process.chdir is not supported")},jn.umask=function(){return 0};Ur=RU;Ur.addListener;Ur.argv;Ur.binding;Ur.browser;Ur.chdir;Ur.cwd;Ur.emit;Ur.env;Ur.listeners;Ur.nextTick;Ur.off;Ur.on;Ur.once;Ur.prependListener;Ur.prependOnceListener;Ur.removeAllListeners;Ur.removeListener;Ur.title;Ur.umask;Ur.version;Ur.versions;TZ=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",UP=Object.prototype.toString,rC=function(n){return!(TZ&&n&&typeof n=="object"&&Symbol.toStringTag in n)&&UP.call(n)==="[object Arguments]"},OU=function(n){return!!rC(n)||n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&UP.call(n)!=="[object Array]"&&UP.call(n.callee)==="[object Function]"},CZ=(function(){return rC(arguments)})();rC.isLegacyArguments=OU;RZ=CZ?rC:OU,IZ=Object.prototype.toString,DZ=Function.prototype.toString,OZ=/^\s*(?:function)?\*/,PU=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",NU=Object.getPrototypeOf,yU=(function(){if(!PU)return!1;try{return Function("return function*() {}")()}catch{}})(),PZ=yU?NU(yU):{},NZ=function(n){return typeof n=="function"&&(!!OZ.test(DZ.call(n))||(PU?NU(n)===PZ:IZ.call(n)==="[object GeneratorFunction]"))},LZ=typeof Object.create=="function"?function(n,t){t&&(n.super_=t,n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:function(n,t){if(t){n.super_=t;var e=function(){};e.prototype=t.prototype,n.prototype=new e,n.prototype.constructor=n}},LU=function(n){return n&&typeof n=="object"&&typeof n.copy=="function"&&typeof n.fill=="function"&&typeof n.readUInt8=="function"},Ye={},kZ=LU,MZ=RZ,FZ=NZ;kU=typeof BigInt<"u",jP=typeof Symbol<"u",ya=jP&&Symbol.toStringTag!==void 0,Hs=typeof Uint8Array<"u",BZ=typeof ArrayBuffer<"u";if(Hs&&ya)var UZ=Object.getPrototypeOf(Uint8Array.prototype),Ao=Vp(Object.getOwnPropertyDescriptor(UZ,Symbol.toStringTag).get);dn=Vp(Object.prototype.toString),jZ=Vp(Number.prototype.valueOf),$Z=Vp(String.prototype.valueOf),HZ=Vp(Boolean.prototype.valueOf);if(kU)var zZ=Vp(BigInt.prototype.valueOf);if(jP)var WZ=Vp(Symbol.prototype.valueOf);Ye.isArgumentsObject=MZ,Ye.isGeneratorFunction=FZ,Ye.isPromise=function(n){return typeof Promise<"u"&&n instanceof Promise||n!==null&&typeof n=="object"&&typeof n.then=="function"&&typeof n.catch=="function"},Ye.isArrayBufferView=function(n){return BZ&&ArrayBuffer.isView?ArrayBuffer.isView(n):bU(n)||wU(n)},Ye.isTypedArray=bU,Ye.isUint8Array=MU,Ye.isUint8ClampedArray=FU,Ye.isUint16Array=BU,Ye.isUint32Array=UU,Ye.isInt8Array=jU,Ye.isInt16Array=$U,Ye.isInt32Array=HU,Ye.isFloat32Array=zU,Ye.isFloat64Array=WU,Ye.isBigInt64Array=GU,Ye.isBigUint64Array=VU,zT.working=typeof Map<"u"&&zT(new Map),Ye.isMap=function(n){return typeof Map<"u"&&(zT.working?zT(n):n instanceof Map)},WT.working=typeof Set<"u"&&WT(new Set),Ye.isSet=function(n){return typeof Set<"u"&&(WT.working?WT(n):n instanceof Set)},GT.working=typeof WeakMap<"u"&&GT(new WeakMap),Ye.isWeakMap=function(n){return typeof WeakMap<"u"&&(GT.working?GT(n):n instanceof WeakMap)},NP.working=typeof WeakSet<"u"&&NP(new WeakSet),Ye.isWeakSet=function(n){return NP(n)},KT.working=typeof ArrayBuffer<"u"&&KT(new ArrayBuffer),Ye.isArrayBuffer=vU,ZT.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&ZT(new DataView(new ArrayBuffer(1),0,1)),Ye.isDataView=wU,JT.working=typeof SharedArrayBuffer<"u"&&JT(new SharedArrayBuffer),Ye.isSharedArrayBuffer=AU,Ye.isAsyncFunction=function(n){return dn(n)==="[object AsyncFunction]"},Ye.isMapIterator=function(n){return dn(n)==="[object Map Iterator]"},Ye.isSetIterator=function(n){return dn(n)==="[object Set Iterator]"},Ye.isGeneratorObject=function(n){return dn(n)==="[object Generator]"},Ye.isWebAssemblyCompiledModule=function(n){return dn(n)==="[object WebAssembly.Module]"},Ye.isNumberObject=EU,Ye.isStringObject=xU,Ye.isBooleanObject=SU,Ye.isBigIntObject=_U,Ye.isSymbolObject=TU,Ye.isBoxedPrimitive=function(n){return EU(n)||xU(n)||SU(n)||_U(n)||TU(n)},Ye.isAnyArrayBuffer=function(n){return Hs&&(vU(n)||AU(n))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(n){Object.defineProperty(Ye,n,{enumerable:!1,value:function(){throw new Error(n+" is not supported in userland")}})}));hE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,zt={},ec=Ur,CU=Object.getOwnPropertyDescriptors||function(n){for(var t=Object.keys(n),e={},r=0;r<t.length;r++)e[t[r]]=Object.getOwnPropertyDescriptor(n,t[r]);return e},GZ=/%[sdj%]/g;zt.format=function(n){if(!tC(n)){for(var t=[],e=0;e<arguments.length;e++)t.push(Df(arguments[e]));return t.join(" ")}e=1;for(var r=arguments,i=r.length,s=String(n).replace(GZ,(function(o){if(o==="%%")return"%";if(e>=i)return o;switch(o){case"%s":return String(r[e++]);case"%d":return Number(r[e++]);case"%j":try{return JSON.stringify(r[e++])}catch{return"[Circular]"}default:return o}})),a=r[e];e<i;a=r[++e])nC(a)||!O0(a)?s+=" "+a:s+=" "+Df(a);return s},zt.deprecate=function(n,t){if(ec!==void 0&&ec.noDeprecation===!0)return n;if(ec===void 0)return function(){return zt.deprecate(n,t).apply(this||hE,arguments)};var e=!1;return function(){if(!e){if(ec.throwDeprecation)throw new Error(t);ec.traceDeprecation?console.trace(t):console.error(t),e=!0}return n.apply(this||hE,arguments)}};VT={},XU=/^$/;ec.env.NODE_DEBUG&&(XT=ec.env.NODE_DEBUG,XT=XT.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),XU=new RegExp("^"+XT+"$","i"));zt.debuglog=function(n){if(n=n.toUpperCase(),!VT[n])if(XU.test(n)){var t=ec.pid;VT[n]=function(){var e=zt.format.apply(zt,arguments);console.error("%s %d: %s",n,t,e)}}else VT[n]=function(){};return VT[n]},zt.inspect=Df,Df.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]},Df.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},zt.types=Ye,zt.isArray=qU,zt.isBoolean=$P,zt.isNull=nC,zt.isNullOrUndefined=function(n){return n==null},zt.isNumber=YU,zt.isString=tC,zt.isSymbol=function(n){return typeof n=="symbol"},zt.isUndefined=Gp,zt.isRegExp=fE,zt.types.isRegExp=fE,zt.isObject=O0,zt.isDate=eC,zt.types.isDate=eC,zt.isError=dE,zt.types.isNativeError=dE,zt.isFunction=YT,zt.isPrimitive=function(n){return n===null||typeof n=="boolean"||typeof n=="number"||typeof n=="string"||typeof n=="symbol"||n===void 0},zt.isBuffer=LU;qZ=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];zt.log=function(){console.log("%s - %s",YZ(),zt.format.apply(zt,arguments))},zt.inherits=LZ,zt._extend=function(n,t){if(!t||!O0(t))return n;for(var e=Object.keys(t),r=e.length;r--;)n[e[r]]=t[e[r]];return n};zp=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;zt.promisify=function(n){if(typeof n!="function")throw new TypeError('The "original" argument must be of type Function');if(zp&&n[zp]){var t;if(typeof(t=n[zp])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,zp,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var e,r,i=new Promise((function(o,c){e=o,r=c})),s=[],a=0;a<arguments.length;a++)s.push(arguments[a]);s.push((function(o,c){o?r(o):e(c)}));try{n.apply(this||hE,s)}catch(o){r(o)}return i}return Object.setPrototypeOf(t,Object.getPrototypeOf(n)),zp&&Object.defineProperty(t,zp,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,CU(n))},zt.promisify.custom=zp,zt.callbackify=function(n){if(typeof n!="function")throw new TypeError('The "original" argument must be of type Function');function t(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var i=e.pop();if(typeof i!="function")throw new TypeError("The last argument must be of type Function");var s=this||hE,a=function(){return i.apply(s,arguments)};n.apply(this||hE,e).then((function(o){ec.nextTick(a.bind(null,null,o))}),(function(o){ec.nextTick(KZ.bind(null,o,a))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(n)),Object.defineProperties(t,CU(n)),t};zt._extend;zt.callbackify;zt.debuglog;zt.deprecate;zt.format;zt.inherits;zt.inspect;zt.isArray;zt.isBoolean;zt.isBuffer;zt.isDate;zt.isError;zt.isFunction;zt.isNull;zt.isNullOrUndefined;zt.isNumber;zt.isObject;zt.isPrimitive;zt.isRegExp;zt.isString;zt.isSymbol;zt.isUndefined;zt.log;zt.promisify;zt._extend;zt.callbackify;zt.debuglog;zt.deprecate;zt.format;zt.inherits;zt.inspect;zt.isArray;zt.isBoolean;zt.isBuffer;zt.isDate;zt.isError;zt.isFunction;zt.isNull;zt.isNullOrUndefined;zt.isNumber;zt.isObject;zt.isPrimitive;zt.isRegExp;zt.isString;zt.isSymbol;zt.isUndefined;zt.log;hdt=zt.promisify;zt.types});function ZU(n,t){if(n==null)throw new TypeError("Cannot convert first argument to object");for(var e=Object(n),r=1;r<arguments.length;r++){var i=arguments[r];if(i!=null)for(var s=Object.keys(Object(i)),a=0,o=s.length;a<o;a++){var c=s[a],u=Object.getOwnPropertyDescriptor(i,c);u!==void 0&&u.enumerable&&(e[c]=i[c])}}return e}function $j(){if(uj)return YP;function n(u){return(n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h})(u)}function t(u,h){return!h||n(h)!=="object"&&typeof h!="function"?(function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f})(u):h}function e(u){return(e=Object.setPrototypeOf?Object.getPrototypeOf:function(h){return h.__proto__||Object.getPrototypeOf(h)})(u)}function r(u,h){return(r=Object.setPrototypeOf||function(f,d){return f.__proto__=d,f})(u,h)}uj=!0;var i,s,a={};function o(u,h,f){f||(f=Error);var d=(function(p){function g(y,b,m){var w;return(function(A,_){if(!(A instanceof _))throw new TypeError("Cannot call a class as a function")})(this,g),(w=t(this,e(g).call(this,(function(A,_,S){return typeof h=="string"?h:h(A,_,S)})(y,b,m)))).code=u,w}return(function(y,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(b&&b.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),b&&r(y,b)})(g,p),g})(f);a[u]=d}function c(u,h){if(Array.isArray(u)){var f=u.length;return u=u.map((function(d){return String(d)})),f>2?"one of ".concat(h," ").concat(u.slice(0,f-1).join(", "),", or ")+u[f-1]:f===2?"one of ".concat(h," ").concat(u[0]," or ").concat(u[1]):"of ".concat(h," ").concat(u[0])}return"of ".concat(h," ").concat(String(u))}return o("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),o("ERR_INVALID_ARG_TYPE",(function(u,h,f){var d,p,g;if(i===void 0&&(i=eN()),i(typeof u=="string","'name' must be a string"),typeof h=="string"&&(p="not ",h.substr(0,p.length)===p)?(d="must not be",h=h.replace(/^not /,"")):d="must be",(function(b,m,w){return(w===void 0||w>b.length)&&(w=b.length),b.substring(w-m.length,w)===m})(u," argument"))g="The ".concat(u," ").concat(d," ").concat(c(h,"type"));else{var y=(function(b,m,w){return typeof w!="number"&&(w=0),!(w+m.length>b.length)&&b.indexOf(m,w)!==-1})(u,".")?"property":"argument";g='The "'.concat(u,'" ').concat(y," ").concat(d," ").concat(c(h,"type"))}return g+=". Received type ".concat(n(f))}),TypeError),o("ERR_INVALID_ARG_VALUE",(function(u,h){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";s===void 0&&(s=zt);var d=s.inspect(h);return d.length>128&&(d="".concat(d.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(f,". Received ").concat(d)}),TypeError),o("ERR_INVALID_RETURN_VALUE",(function(u,h,f){var d;return d=f&&f.constructor&&f.constructor.name?"instance of ".concat(f.constructor.name):"type ".concat(n(f)),"Expected ".concat(u,' to be returned from the "').concat(h,'"')+" function but got ".concat(d,".")}),TypeError),o("ERR_MISSING_ARGS",(function(){for(var u=arguments.length,h=new Array(u),f=0;f<u;f++)h[f]=arguments[f];i===void 0&&(i=eN()),i(h.length>0,"At least one arg needs to be specified");var d="The ",p=h.length;switch(h=h.map((function(g){return'"'.concat(g,'"')})),p){case 1:d+="".concat(h[0]," argument");break;case 2:d+="".concat(h[0]," and ").concat(h[1]," arguments");break;default:d+=h.slice(0,p-1).join(", "),d+=", and ".concat(h[p-1]," arguments")}return"".concat(d," must be specified")}),TypeError),YP.codes=a,YP}function kJ(){if(fj)return hj;fj=!0;var n=Ur;function t(C,M,z){return M in C?Object.defineProperty(C,M,{value:z,enumerable:!0,configurable:!0,writable:!0}):C[M]=z,C}function e(C,M){for(var z=0;z<M.length;z++){var G=M[z];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(C,G.key,G)}}function r(C,M){return!M||h(M)!=="object"&&typeof M!="function"?i(C):M}function i(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function s(C){var M=typeof Map=="function"?new Map:void 0;return(s=function(z){if(z===null||(G=z,Function.toString.call(G).indexOf("[native code]")===-1))return z;var G;if(typeof z!="function")throw new TypeError("Super expression must either be null or a function");if(M!==void 0){if(M.has(z))return M.get(z);M.set(z,Y)}function Y(){return o(z,arguments,u(this).constructor)}return Y.prototype=Object.create(z.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}}),c(Y,z)})(C)}function a(){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 o(C,M,z){return(o=a()?Reflect.construct:function(G,Y,L){var j=[null];j.push.apply(j,Y);var q=new(Function.bind.apply(G,j));return L&&c(q,L.prototype),q}).apply(null,arguments)}function c(C,M){return(c=Object.setPrototypeOf||function(z,G){return z.__proto__=G,z})(C,M)}function u(C){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(M){return M.__proto__||Object.getPrototypeOf(M)})(C)}function h(C){return(h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M})(C)}var f=zt.inspect,d=$j().codes.ERR_INVALID_ARG_TYPE;function p(C,M,z){return(z===void 0||z>C.length)&&(z=C.length),C.substring(z-M.length,z)===M}var g="",y="",b="",m="",w={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 A(C){var M=Object.keys(C),z=Object.create(Object.getPrototypeOf(C));return M.forEach((function(G){z[G]=C[G]})),Object.defineProperty(z,"message",{value:C.message}),z}function _(C){return f(C,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function S(C,M,z){var G="",Y="",L=0,j="",q=!1,nt=_(C),J=nt.split(`
20
+ `),N=_(M).split(`
21
+ `),D=0,F="";if(z==="strictEqual"&&h(C)==="object"&&h(M)==="object"&&C!==null&&M!==null&&(z="strictEqualObject"),J.length===1&&N.length===1&&J[0]!==N[0]){var P=J[0].length+N[0].length;if(P<=10){if(!(h(C)==="object"&&C!==null||h(M)==="object"&&M!==null||C===0&&M===0))return"".concat(w[z],`
22
+
23
+ `)+"".concat(J[0]," !== ").concat(N[0],`
24
+ `)}else if(z!=="strictEqualObject"&&P<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;J[0][D]===N[0][D];)D++;D>2&&(F=`
25
+ `.concat((function(Q,W){if(W=Math.floor(W),Q.length==0||W==0)return"";var at=Q.length*W;for(W=Math.floor(Math.log(W)/Math.log(2));W;)Q+=Q,W--;return Q+=Q.substring(0,at-Q.length)})(" ",D),"^"),D=0)}}for(var V=J[J.length-1],$=N[N.length-1];V===$&&(D++<2?j=`
26
+ `.concat(V).concat(j):G=V,J.pop(),N.pop(),J.length!==0&&N.length!==0);)V=J[J.length-1],$=N[N.length-1];var H=Math.max(J.length,N.length);if(H===0){var rt=nt.split(`
27
+ `);if(rt.length>30)for(rt[26]="".concat(g,"...").concat(m);rt.length>27;)rt.pop();return"".concat(w.notIdentical,`
28
+
29
+ `).concat(rt.join(`
30
+ `),`
31
+ `)}D>3&&(j=`
32
+ `.concat(g,"...").concat(m).concat(j),q=!0),G!==""&&(j=`
33
+ `.concat(G).concat(j),G="");var lt=0,ft=w[z]+`
34
+ `.concat(y,"+ actual").concat(m," ").concat(b,"- expected").concat(m),K=" ".concat(g,"...").concat(m," Lines skipped");for(D=0;D<H;D++){var X=D-L;if(J.length<D+1)X>1&&D>2&&(X>4?(Y+=`
35
+ `.concat(g,"...").concat(m),q=!0):X>3&&(Y+=`
36
+ `.concat(N[D-2]),lt++),Y+=`
37
+ `.concat(N[D-1]),lt++),L=D,G+=`
38
+ `.concat(b,"-").concat(m," ").concat(N[D]),lt++;else if(N.length<D+1)X>1&&D>2&&(X>4?(Y+=`
39
+ `.concat(g,"...").concat(m),q=!0):X>3&&(Y+=`
40
+ `.concat(J[D-2]),lt++),Y+=`
41
+ `.concat(J[D-1]),lt++),L=D,Y+=`
42
+ `.concat(y,"+").concat(m," ").concat(J[D]),lt++;else{var st=N[D],bt=J[D],wt=bt!==st&&(!p(bt,",")||bt.slice(0,-1)!==st);wt&&p(st,",")&&st.slice(0,-1)===bt&&(wt=!1,bt+=","),wt?(X>1&&D>2&&(X>4?(Y+=`
43
+ `.concat(g,"...").concat(m),q=!0):X>3&&(Y+=`
44
+ `.concat(J[D-2]),lt++),Y+=`
45
+ `.concat(J[D-1]),lt++),L=D,Y+=`
46
+ `.concat(y,"+").concat(m," ").concat(bt),G+=`
47
+ `.concat(b,"-").concat(m," ").concat(st),lt+=2):(Y+=G,G="",X!==1&&D!==0||(Y+=`
48
+ `.concat(bt),lt++))}if(lt>20&&D<H-2)return"".concat(ft).concat(K,`
49
+ `).concat(Y,`
50
+ `).concat(g,"...").concat(m).concat(G,`
51
+ `)+"".concat(g,"...").concat(m)}return"".concat(ft).concat(q?K:"",`
52
+ `).concat(Y).concat(G).concat(j).concat(F)}var I=(function(C){function M(Y){var L;if((function(rt,lt){if(!(rt instanceof lt))throw new TypeError("Cannot call a class as a function")})(this,M),h(Y)!=="object"||Y===null)throw new d("options","Object",Y);var j=Y.message,q=Y.operator,nt=Y.stackStartFn,J=Y.actual,N=Y.expected,D=Error.stackTraceLimit;if(Error.stackTraceLimit=0,j!=null)L=r(this,u(M).call(this,String(j)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&n.stderr.getColorDepth()!==1?(g="\x1B[34m",y="\x1B[32m",m="\x1B[39m",b="\x1B[31m"):(g="",y="",m="",b="")),h(J)==="object"&&J!==null&&h(N)==="object"&&N!==null&&"stack"in J&&J instanceof Error&&"stack"in N&&N instanceof Error&&(J=A(J),N=A(N)),q==="deepStrictEqual"||q==="strictEqual")L=r(this,u(M).call(this,S(J,N,q)));else if(q==="notDeepStrictEqual"||q==="notStrictEqual"){var F=w[q],P=_(J).split(`
53
+ `);if(q==="notStrictEqual"&&h(J)==="object"&&J!==null&&(F=w.notStrictEqualObject),P.length>30)for(P[26]="".concat(g,"...").concat(m);P.length>27;)P.pop();L=P.length===1?r(this,u(M).call(this,"".concat(F," ").concat(P[0]))):r(this,u(M).call(this,"".concat(F,`
54
+
55
+ `).concat(P.join(`
56
+ `),`
57
+ `)))}else{var V=_(J),$="",H=w[q];q==="notDeepEqual"||q==="notEqual"?(V="".concat(w[q],`
58
+
59
+ `).concat(V)).length>1024&&(V="".concat(V.slice(0,1021),"...")):($="".concat(_(N)),V.length>512&&(V="".concat(V.slice(0,509),"...")),$.length>512&&($="".concat($.slice(0,509),"...")),q==="deepEqual"||q==="equal"?V="".concat(H,`
60
+
61
+ `).concat(V,`
62
+
63
+ should equal
64
+
65
+ `):$=" ".concat(q," ").concat($)),L=r(this,u(M).call(this,"".concat(V).concat($)))}return Error.stackTraceLimit=D,L.generatedMessage=!j,Object.defineProperty(i(L),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),L.code="ERR_ASSERTION",L.actual=J,L.expected=N,L.operator=q,Error.captureStackTrace&&Error.captureStackTrace(i(L),nt),L.stack,L.name="AssertionError",r(L)}var z,G;return(function(Y,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function");Y.prototype=Object.create(L&&L.prototype,{constructor:{value:Y,writable:!0,configurable:!0}}),L&&c(Y,L)})(M,C),z=M,(G=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:f.custom,value:function(Y,L){return f(this,(function(j){for(var q=1;q<arguments.length;q++){var nt=arguments[q]!=null?arguments[q]:{},J=Object.keys(nt);typeof Object.getOwnPropertySymbols=="function"&&(J=J.concat(Object.getOwnPropertySymbols(nt).filter((function(N){return Object.getOwnPropertyDescriptor(nt,N).enumerable})))),J.forEach((function(N){t(j,N,nt[N])}))}return j})({},L,{customInspect:!1,depth:0}))}}])&&e(z.prototype,G),M})(s(Error));return hj=I}function dj(n,t){return(function(e){if(Array.isArray(e))return e})(n)||(function(e,r){var i=[],s=!0,a=!1,o=void 0;try{for(var c,u=e[Symbol.iterator]();!(s=(c=u.next()).done)&&(i.push(c.value),!r||i.length!==r);s=!0);}catch(h){a=!0,o=h}finally{try{s||u.return==null||u.return()}finally{if(a)throw o}}return i})(n,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")})()}function hl(n){return(hl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(n)}function iN(n){return n.call.bind(n)}function WJ(n){if(n.length===0||n.length>10)return!0;for(var t=0;t<n.length;t++){var e=n.charCodeAt(t);if(e<48||e>57)return!0}return n.length===10&&n>=Math.pow(2,32)}function oC(n){return Object.keys(n).filter(WJ).concat(cC(n).filter(Object.prototype.propertyIsEnumerable.bind(n)))}function xj(n,t){if(n===t)return 0;for(var e=n.length,r=t.length,i=0,s=Math.min(e,r);i<s;++i)if(n[i]!==t[i]){e=n[i],r=t[i];break}return e<r?-1:r<e?1:0}function Eo(n,t,e,r){if(n===t)return n!==0||!e||gj(n,t);if(e){if(hl(n)!=="object")return typeof n=="number"&&tN(n)&&tN(t);if(hl(t)!=="object"||n===null||t===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(t))return!1}else{if(n===null||hl(n)!=="object")return(t===null||hl(t)!=="object")&&n==t;if(t===null||hl(t)!=="object")return!1}var i,s,a,o,c=mj(n);if(c!==mj(t))return!1;if(Array.isArray(n)){if(n.length!==t.length)return!1;var u=oC(n),h=oC(t);return u.length===h.length&&yE(n,t,e,r,1,u)}if(c==="[object Object]"&&(!sC(n)&&sC(t)||!aC(n)&&aC(t)))return!1;if(yj(n)){if(!yj(t)||Date.prototype.getTime.call(n)!==Date.prototype.getTime.call(t))return!1}else if(bj(n)){if(!bj(t)||(a=n,o=t,!(MJ?a.source===o.source&&a.flags===o.flags:RegExp.prototype.toString.call(a)===RegExp.prototype.toString.call(o))))return!1}else if(UJ(n)||n instanceof Error){if(n.message!==t.message||n.name!==t.name)return!1}else{if(BJ(n)){if(e||!HJ(n)&&!zJ(n)){if(!(function(p,g){return p.byteLength===g.byteLength&&xj(new Uint8Array(p.buffer,p.byteOffset,p.byteLength),new Uint8Array(g.buffer,g.byteOffset,g.byteLength))===0})(n,t))return!1}else if(!(function(p,g){if(p.byteLength!==g.byteLength)return!1;for(var y=0;y<p.byteLength;y++)if(p[y]!==g[y])return!1;return!0})(n,t))return!1;var f=oC(n),d=oC(t);return f.length===d.length&&yE(n,t,e,r,0,f)}if(aC(n))return!(!aC(t)||n.size!==t.size)&&yE(n,t,e,r,2);if(sC(n))return!(!sC(t)||n.size!==t.size)&&yE(n,t,e,r,3);if(FJ(n)){if(s=t,(i=n).byteLength!==s.byteLength||xj(new Uint8Array(i),new Uint8Array(s))!==0)return!1}else if(jJ(n)&&!(function(p,g){return vj(p)?vj(g)&&gj(Number.prototype.valueOf.call(p),Number.prototype.valueOf.call(g)):wj(p)?wj(g)&&String.prototype.valueOf.call(p)===String.prototype.valueOf.call(g):Aj(p)?Aj(g)&&Boolean.prototype.valueOf.call(p)===Boolean.prototype.valueOf.call(g):Ej(p)?Ej(g)&&BigInt.prototype.valueOf.call(p)===BigInt.prototype.valueOf.call(g):$J(g)&&Symbol.prototype.valueOf.call(p)===Symbol.prototype.valueOf.call(g)})(n,t))return!1}return yE(n,t,e,r,0)}function Sj(n,t){return t.filter((function(e){return uC(n,e)}))}function yE(n,t,e,r,i,s){if(arguments.length===5){s=Object.keys(n);var a=Object.keys(t);if(s.length!==a.length)return!1}for(var o=0;o<s.length;o++)if(!bE(t,s[o]))return!1;if(e&&arguments.length===5){var c=cC(n);if(c.length!==0){var u=0;for(o=0;o<c.length;o++){var h=c[o];if(uC(n,h)){if(!uC(t,h))return!1;s.push(h),u++}else if(uC(t,h))return!1}var f=cC(t);if(c.length!==f.length&&Sj(t,f).length!==u)return!1}else{var d=cC(t);if(d.length!==0&&Sj(t,d).length!==0)return!1}}if(s.length===0&&(i===0||i===1&&n.length===0||n.size===0))return!0;if(r===void 0)r={val1:new Map,val2:new Map,position:0};else{var p=r.val1.get(n);if(p!==void 0){var g=r.val2.get(t);if(g!==void 0)return p===g}r.position++}r.val1.set(n,r.position),r.val2.set(t,r.position);var y=XJ(n,t,e,s,r,i);return r.val1.delete(n),r.val2.delete(t),y}function _j(n,t,e,r){for(var i=hC(n),s=0;s<i.length;s++){var a=i[s];if(Eo(t,a,e,r))return n.delete(a),!0}return!1}function Hj(n){switch(hl(n)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":n=+n;case"number":if(tN(n))return!1}return!0}function GJ(n,t,e){var r=Hj(e);return r??(t.has(r)&&!n.has(r))}function VJ(n,t,e,r,i){var s=Hj(e);if(s!=null)return s;var a=t.get(s);return!(a===void 0&&!t.has(s)||!Eo(r,a,!1,i))&&!n.has(s)&&Eo(r,a,!1,i)}function Tj(n,t,e,r,i,s){for(var a=hC(n),o=0;o<a.length;o++){var c=a[o];if(Eo(e,c,i,s)&&Eo(r,t.get(c),i,s))return n.delete(c),!0}return!1}function XJ(n,t,e,r,i,s){var a=0;if(s===2){if(!(function(h,f,d,p){for(var g=null,y=hC(h),b=0;b<y.length;b++){var m=y[b];if(hl(m)==="object"&&m!==null)g===null&&(g=new Set),g.add(m);else if(!f.has(m)){if(d||!GJ(h,f,m))return!1;g===null&&(g=new Set),g.add(m)}}if(g!==null){for(var w=hC(f),A=0;A<w.length;A++){var _=w[A];if(hl(_)==="object"&&_!==null){if(!_j(g,_,d,p))return!1}else if(!d&&!h.has(_)&&!_j(g,_,d,p))return!1}return g.size===0}return!0})(n,t,e,i))return!1}else if(s===3){if(!(function(h,f,d,p){for(var g=null,y=pj(h),b=0;b<y.length;b++){var m=dj(y[b],2),w=m[0],A=m[1];if(hl(w)==="object"&&w!==null)g===null&&(g=new Set),g.add(w);else{var _=f.get(w);if(_===void 0&&!f.has(w)||!Eo(A,_,d,p)){if(d||!VJ(h,f,w,A,p))return!1;g===null&&(g=new Set),g.add(w)}}}if(g!==null){for(var S=pj(f),I=0;I<S.length;I++){var C=dj(S[I],2),M=(w=C[0],C[1]);if(hl(w)==="object"&&w!==null){if(!Tj(g,h,w,M,d,p))return!1}else if(!(d||h.has(w)&&Eo(h.get(w),M,!1,p)||Tj(g,h,w,M,!1,p)))return!1}return g.size===0}return!0})(n,t,e,i))return!1}else if(s===1)for(;a<n.length;a++){if(!bE(n,a)){if(bE(t,a))return!1;for(var o=Object.keys(n);a<o.length;a++){var c=o[a];if(!bE(t,c)||!Eo(n[c],t[c],e,i))return!1}return o.length===Object.keys(t).length}if(!bE(t,a)||!Eo(n[a],t[a],e,i))return!1}for(a=0;a<r.length;a++){var u=r[a];if(!Eo(n[u],t[u],e,i))return!1}return!0}function eN(){if(Rj)return KP;Rj=!0;var n=Ur;function t(N){return(t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D})(N)}var e,r,i=$j().codes,s=i.ERR_AMBIGUOUS_ARGUMENT,a=i.ERR_INVALID_ARG_TYPE,o=i.ERR_INVALID_ARG_VALUE,c=i.ERR_INVALID_RETURN_VALUE,u=i.ERR_MISSING_ARGS,h=kJ(),f=zt.inspect,d=zt.types,p=d.isPromise,g=d.isRegExp,y=Object.assign?Object.assign:ZZ.assign,b=Object.is?Object.is:Bj;function m(){e=Cj.isDeepEqual,r=Cj.isDeepStrictEqual}var w=!1,A=KP=C,_={};function S(N){throw N.message instanceof Error?N.message:new h(N)}function I(N,D,F,P){if(!F){var V=!1;if(D===0)V=!0,P="No value argument passed to `assert.ok()`";else if(P instanceof Error)throw P;var $=new h({actual:F,expected:!0,message:P,operator:"==",stackStartFn:N});throw $.generatedMessage=V,$}}function C(){for(var N=arguments.length,D=new Array(N),F=0;F<N;F++)D[F]=arguments[F];I.apply(void 0,[C,D.length].concat(D))}A.fail=function N(D,F,P,V,$){var H,rt=arguments.length;if(rt===0)H="Failed";else if(rt===1)P=D,D=void 0;else{if(w===!1){w=!0;var lt=n.emitWarning?n.emitWarning:console.warn.bind(console);lt("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}rt===2&&(V="!=")}if(P instanceof Error)throw P;var ft={actual:D,expected:F,operator:V===void 0?"fail":V,stackStartFn:$||N};P!==void 0&&(ft.message=P);var K=new h(ft);throw H&&(K.message=H,K.generatedMessage=!0),K},A.AssertionError=h,A.ok=C,A.equal=function N(D,F,P){if(arguments.length<2)throw new u("actual","expected");D!=F&&S({actual:D,expected:F,message:P,operator:"==",stackStartFn:N})},A.notEqual=function N(D,F,P){if(arguments.length<2)throw new u("actual","expected");D==F&&S({actual:D,expected:F,message:P,operator:"!=",stackStartFn:N})},A.deepEqual=function N(D,F,P){if(arguments.length<2)throw new u("actual","expected");e===void 0&&m(),e(D,F)||S({actual:D,expected:F,message:P,operator:"deepEqual",stackStartFn:N})},A.notDeepEqual=function N(D,F,P){if(arguments.length<2)throw new u("actual","expected");e===void 0&&m(),e(D,F)&&S({actual:D,expected:F,message:P,operator:"notDeepEqual",stackStartFn:N})},A.deepStrictEqual=function N(D,F,P){if(arguments.length<2)throw new u("actual","expected");e===void 0&&m(),r(D,F)||S({actual:D,expected:F,message:P,operator:"deepStrictEqual",stackStartFn:N})},A.notDeepStrictEqual=function N(D,F,P){if(arguments.length<2)throw new u("actual","expected");e===void 0&&m(),r(D,F)&&S({actual:D,expected:F,message:P,operator:"notDeepStrictEqual",stackStartFn:N})},A.strictEqual=function N(D,F,P){if(arguments.length<2)throw new u("actual","expected");b(D,F)||S({actual:D,expected:F,message:P,operator:"strictEqual",stackStartFn:N})},A.notStrictEqual=function N(D,F,P){if(arguments.length<2)throw new u("actual","expected");b(D,F)&&S({actual:D,expected:F,message:P,operator:"notStrictEqual",stackStartFn:N})};var M=function N(D,F,P){var V=this;(function($,H){if(!($ instanceof H))throw new TypeError("Cannot call a class as a function")})(this,N),F.forEach((function($){$ in D&&(P!==void 0&&typeof P[$]=="string"&&g(D[$])&&D[$].test(P[$])?V[$]=P[$]:V[$]=D[$])}))};function z(N,D,F,P,V,$){if(!(F in N)||!r(N[F],D[F])){if(!P){var H=new M(N,V),rt=new M(D,V,N),lt=new h({actual:H,expected:rt,operator:"deepStrictEqual",stackStartFn:$});throw lt.actual=N,lt.expected=D,lt.operator=$.name,lt}S({actual:N,expected:D,message:P,operator:$.name,stackStartFn:$})}}function G(N,D,F,P){if(typeof D!="function"){if(g(D))return D.test(N);if(arguments.length===2)throw new a("expected",["Function","RegExp"],D);if(t(N)!=="object"||N===null){var V=new h({actual:N,expected:D,message:F,operator:"deepStrictEqual",stackStartFn:P});throw V.operator=P.name,V}var $=Object.keys(D);if(D instanceof Error)$.push("name","message");else if($.length===0)throw new o("error",D,"may not be an empty object");return e===void 0&&m(),$.forEach((function(H){typeof N[H]=="string"&&g(D[H])&&D[H].test(N[H])||z(N,D,H,F,$,P)})),!0}return D.prototype!==void 0&&N instanceof D||!Error.isPrototypeOf(D)&&D.call({},N)===!0}function Y(N){if(typeof N!="function")throw new a("fn","Function",N);try{N()}catch(D){return D}return _}function L(N){return p(N)||N!==null&&t(N)==="object"&&typeof N.then=="function"&&typeof N.catch=="function"}function j(N){return Promise.resolve().then((function(){var D;if(typeof N=="function"){if(!L(D=N()))throw new c("instance of Promise","promiseFn",D)}else{if(!L(N))throw new a("promiseFn",["Function","Promise"],N);D=N}return Promise.resolve().then((function(){return D})).then((function(){return _})).catch((function(F){return F}))}))}function q(N,D,F,P){if(typeof F=="string"){if(arguments.length===4)throw new a("error",["Object","Error","Function","RegExp"],F);if(t(D)==="object"&&D!==null){if(D.message===F)throw new s("error/message",'The error message "'.concat(D.message,'" is identical to the message.'))}else if(D===F)throw new s("error/message",'The error "'.concat(D,'" is identical to the message.'));P=F,F=void 0}else if(F!=null&&t(F)!=="object"&&typeof F!="function")throw new a("error",["Object","Error","Function","RegExp"],F);if(D===_){var V="";F&&F.name&&(V+=" (".concat(F.name,")")),V+=P?": ".concat(P):".";var $=N.name==="rejects"?"rejection":"exception";S({actual:void 0,expected:F,operator:N.name,message:"Missing expected ".concat($).concat(V),stackStartFn:N})}if(F&&!G(D,F,P,N))throw D}function nt(N,D,F,P){if(D!==_){if(typeof F=="string"&&(P=F,F=void 0),!F||G(D,F)){var V=P?": ".concat(P):".",$=N.name==="doesNotReject"?"rejection":"exception";S({actual:D,expected:F,operator:N.name,message:"Got unwanted ".concat($).concat(V,`
66
+ `)+'Actual message: "'.concat(D&&D.message,'"'),stackStartFn:N})}throw D}}function J(){for(var N=arguments.length,D=new Array(N),F=0;F<N;F++)D[F]=arguments[F];I.apply(void 0,[J,D.length].concat(D))}return A.throws=function N(D){for(var F=arguments.length,P=new Array(F>1?F-1:0),V=1;V<F;V++)P[V-1]=arguments[V];q.apply(void 0,[N,Y(D)].concat(P))},A.rejects=function N(D){for(var F=arguments.length,P=new Array(F>1?F-1:0),V=1;V<F;V++)P[V-1]=arguments[V];return j(D).then((function($){return q.apply(void 0,[N,$].concat(P))}))},A.doesNotThrow=function N(D){for(var F=arguments.length,P=new Array(F>1?F-1:0),V=1;V<F;V++)P[V-1]=arguments[V];nt.apply(void 0,[N,Y(D)].concat(P))},A.doesNotReject=function N(D){for(var F=arguments.length,P=new Array(F>1?F-1:0),V=1;V<F;V++)P[V-1]=arguments[V];return j(D).then((function($){return nt.apply(void 0,[N,$].concat(P))}))},A.ifError=function N(D){if(D!=null){var F="ifError got unwanted exception: ";t(D)==="object"&&typeof D.message=="string"?D.message.length===0&&D.constructor?F+=D.constructor.name:F+=D.message:F+=f(D);var P=new h({actual:D,expected:null,operator:"ifError",message:F,stackStartFn:N}),V=D.stack;if(typeof V=="string"){var $=V.split(`
67
+ `);$.shift();for(var H=P.stack.split(`
68
+ `),rt=0;rt<$.length;rt++){var lt=H.indexOf($[rt]);if(lt!==-1){H=H.slice(0,lt);break}}P.stack="".concat(H.join(`
69
+ `),`
70
+ `).concat($.join(`
71
+ `))}throw P}},A.strict=y(J,A,{equal:A.strictEqual,deepEqual:A.deepStrictEqual,notEqual:A.notStrictEqual,notDeepEqual:A.notDeepStrictEqual}),A.strict.strict=A.strict,KP}var ZZ,Ij,JU,Dj,gE,zP,QU,WP,tj,ej,mE,iC,rj,nj,JZ,QZ,tJ,ij,lC,sj,eJ,rJ,nJ,iJ,sJ,ZP,Oj,aJ,Pj,fC,oJ,aj,lJ,cJ,uJ,GP,hJ,fJ,Nj,vE,Yp,VP,dJ,Xp,qp,XP,qP,oj,pJ,gJ,mJ,yJ,bJ,Lj,lj,kj,vJ,wJ,AJ,JP,QP,cj,EJ,xJ,SJ,_J,TJ,Mj,CJ,Fj,Bj,rN,nN,RJ,IJ,DJ,OJ,PJ,Uj,NJ,jj,LJ,YP,uj,hj,fj,MJ,hC,pj,gj,cC,tN,bE,uC,mj,xs,FJ,BJ,yj,sC,bj,aC,UJ,jJ,vj,wj,Aj,Ej,$J,HJ,zJ,Cj,KP,Rj,ve,sN=br(()=>{Tt();Rt();Ct();Of();ZZ={assign:ZU,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:ZU})}},JU=Object.prototype.toString,Dj=function(n){var t=JU.call(n),e=t==="[object Arguments]";return e||(e=t!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&JU.call(n.callee)==="[object Function]"),e};Object.keys||(gE=Object.prototype.hasOwnProperty,zP=Object.prototype.toString,QU=Dj,WP=Object.prototype.propertyIsEnumerable,tj=!WP.call({toString:null},"toString"),ej=WP.call((function(){}),"prototype"),mE=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],iC=function(n){var t=n.constructor;return t&&t.prototype===n},rj={$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},nj=(function(){if(typeof window>"u")return!1;for(var n in window)try{if(!rj["$"+n]&&gE.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{iC(window[n])}catch{return!0}}catch{return!0}return!1})(),Ij=function(n){var t=n!==null&&typeof n=="object",e=zP.call(n)==="[object Function]",r=QU(n),i=t&&zP.call(n)==="[object String]",s=[];if(!t&&!e&&!r)throw new TypeError("Object.keys called on a non-object");var a=ej&&e;if(i&&n.length>0&&!gE.call(n,0))for(var o=0;o<n.length;++o)s.push(String(o));if(r&&n.length>0)for(var c=0;c<n.length;++c)s.push(String(c));else for(var u in n)a&&u==="prototype"||!gE.call(n,u)||s.push(String(u));if(tj)for(var h=(function(d){if(typeof window>"u"||!nj)return iC(d);try{return iC(d)}catch{return!1}})(n),f=0;f<mE.length;++f)h&&mE[f]==="constructor"||!gE.call(n,mE[f])||s.push(mE[f]);return s});JZ=Ij,QZ=Array.prototype.slice,tJ=Dj,ij=Object.keys,lC=ij?function(n){return ij(n)}:JZ,sj=Object.keys;lC.shim=function(){return Object.keys?(function(){var n=Object.keys(arguments);return n&&n.length===arguments.length})(1,2)||(Object.keys=function(n){return tJ(n)?sj(QZ.call(n)):sj(n)}):Object.keys=lC,Object.keys||lC};eJ=lC,rJ=eJ,nJ=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",iJ=Object.prototype.toString,sJ=Array.prototype.concat,ZP=Object.defineProperty,Oj=ZP&&(function(){var n={};try{for(var t in ZP(n,"x",{enumerable:!1,value:n}),n)return!1;return n.x===n}catch{return!1}})(),aJ=function(n,t,e,r){var i;(!(t in n)||typeof(i=r)=="function"&&iJ.call(i)==="[object Function]"&&r())&&(Oj?ZP(n,t,{configurable:!0,enumerable:!1,value:e,writable:!0}):n[t]=e)},Pj=function(n,t){var e=arguments.length>2?arguments[2]:{},r=rJ(t);nJ&&(r=sJ.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)aJ(n,r[i],t[r[i]],e[r[i]])};Pj.supportsDescriptors=!!Oj;fC=Pj,oJ=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},t=Symbol("test"),e=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(e)!=="[object Symbol]")return!1;for(t in n[t]=42,n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var r=Object.getOwnPropertySymbols(n);if(r.length!==1||r[0]!==t||!Object.prototype.propertyIsEnumerable.call(n,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(n,t);if(i.value!==42||i.enumerable!==!0)return!1}return!0},aj=(typeof globalThis<"u"?globalThis:typeof self<"u"?self:window).Symbol,lJ=oJ,cJ=function(){return typeof aj=="function"&&typeof Symbol=="function"&&typeof aj("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&lJ()},uJ="Function.prototype.bind called on incompatible ",GP=Array.prototype.slice,hJ=Object.prototype.toString,fJ=function(n){var t=this;if(typeof t!="function"||hJ.call(t)!=="[object Function]")throw new TypeError(uJ+t);for(var e,r=GP.call(arguments,1),i=function(){if(this instanceof e){var u=t.apply(this,r.concat(GP.call(arguments)));return Object(u)===u?u:this}return t.apply(n,r.concat(GP.call(arguments)))},s=Math.max(0,t.length-r.length),a=[],o=0;o<s;o++)a.push("$"+o);if(e=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(i),t.prototype){var c=function(){};c.prototype=t.prototype,e.prototype=new c,c.prototype=null}return e},Nj=Function.prototype.bind||fJ,vE=TypeError,Yp=Object.getOwnPropertyDescriptor;if(Yp)try{Yp({},"")}catch{Yp=null}VP=function(){throw new vE},dJ=Yp?(function(){try{return arguments.callee,VP}catch{try{return Yp(arguments,"callee").get}catch{return VP}}})():VP,Xp=cJ(),qp=Object.getPrototypeOf||function(n){return n.__proto__},XP=typeof Uint8Array>"u"?void 0:qp(Uint8Array),qP={"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayBufferPrototype%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":Xp?qp([][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%":Xp?qp(qp([][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"&&Xp?qp(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"&&Xp?qp(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%":Xp?qp(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":Xp?Symbol:void 0,"%SymbolPrototype%":Xp?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":dJ,"%TypedArray%":XP,"%TypedArrayPrototype%":XP?XP.prototype:void 0,"%TypeError%":vE,"%TypeErrorPrototype%":vE.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},oj=Nj.call(Function.call,String.prototype.replace),pJ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,gJ=/\\(\\)?/g,mJ=function(n){var t=[];return oj(n,pJ,(function(e,r,i,s){t[t.length]=i?oj(s,gJ,"$1"):r||e})),t},yJ=function(n,t){if(!(n in qP))throw new SyntaxError("intrinsic "+n+" does not exist!");if(qP[n]===void 0&&!t)throw new vE("intrinsic "+n+" exists, but is not available. Please file an issue!");return qP[n]},bJ=function(n,t){if(n.length===0)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new TypeError('"allowMissing" argument must be a boolean');for(var e=mJ(n),r=yJ("%"+(e.length>0?e[0]:"")+"%",t),i=1;i<e.length;i+=1)if(r!=null)if(Yp&&i+1>=e.length){var s=Yp(r,e[i]);if(!(e[i]in r))throw new vE("base intrinsic for "+n+" exists, but the property is not available.");r=s?s.get||s.value:r[e[i]]}else r=r[e[i]];return r},lj=Nj,kj=bJ("%Function%"),vJ=kj.apply,wJ=kj.call;(Lj=function(){return lj.apply(wJ,arguments)}).apply=function(){return lj.apply(vJ,arguments)};AJ=Lj,cj=function(n){return n!=n},EJ=(JP=function(n,t){return n===0&&t===0?1/n==1/t:n===t||!(!cj(n)||!cj(t))},JP),xJ=(QP=function(){return typeof Object.is=="function"?Object.is:EJ},QP),SJ=fC,_J=fC,TJ=JP,Mj=QP,CJ=function(){var n=xJ();return SJ(Object,{is:n},{is:function(){return Object.is!==n}}),n},Fj=AJ(Mj(),Object);_J(Fj,{getPolyfill:Mj,implementation:TJ,shim:CJ});Bj=Fj;rN=function(n){return n!=n};RJ=rN,IJ=(nN=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:RJ},fC),DJ=nN,OJ=fC,PJ=rN,Uj=nN,NJ=function(){var n=DJ();return IJ(Number,{isNaN:n},{isNaN:function(){return Number.isNaN!==n}}),n},jj=Uj();OJ(jj,{getPolyfill:Uj,implementation:PJ,shim:NJ});LJ=jj,YP={},uj=!1;hj={},fj=!1;MJ=/a/g.flags!==void 0,hC=function(n){var t=[];return n.forEach((function(e){return t.push(e)})),t},pj=function(n){var t=[];return n.forEach((function(e,r){return t.push([r,e])})),t},gj=Object.is?Object.is:Bj,cC=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},tN=Number.isNaN?Number.isNaN:LJ;bE=iN(Object.prototype.hasOwnProperty),uC=iN(Object.prototype.propertyIsEnumerable),mj=iN(Object.prototype.toString),xs=zt.types,FJ=xs.isAnyArrayBuffer,BJ=xs.isArrayBufferView,yj=xs.isDate,sC=xs.isMap,bj=xs.isRegExp,aC=xs.isSet,UJ=xs.isNativeError,jJ=xs.isBoxedPrimitive,vj=xs.isNumberObject,wj=xs.isStringObject,Aj=xs.isBooleanObject,Ej=xs.isBigIntObject,$J=xs.isSymbolObject,HJ=xs.isFloat32Array,zJ=xs.isFloat64Array;Cj={isDeepEqual:function(n,t){return Eo(n,t,!1)},isDeepStrictEqual:function(n,t){return Eo(n,t,!0)}},KP={},Rj=!1;ve=eN();ve.AssertionError;ve.deepEqual;ve.deepStrictEqual;ve.doesNotReject;ve.doesNotThrow;ve.equal;ve.fail;ve.ifError;ve.notDeepEqual;ve.notDeepStrictEqual;ve.notEqual;ve.notStrictEqual;ve.ok;ve.rejects;ve.strict;ve.strictEqual;ve.throws;ve.AssertionError;ve.deepEqual;ve.deepStrictEqual;ve.doesNotReject;ve.doesNotThrow;ve.equal;ve.fail;ve.ifError;ve.notDeepEqual;ve.notDeepStrictEqual;ve.notEqual;ve.notStrictEqual;ve.ok;ve.rejects;ve.strict;ve.strictEqual;ve.throws;ve.AssertionError;ve.deepEqual;ve.deepStrictEqual;ve.doesNotReject;ve.doesNotThrow;ve.equal;ve.fail;ve.ifError;ve.notDeepEqual;ve.notDeepStrictEqual;ve.notEqual;ve.notStrictEqual;ve.ok;ve.rejects;ve.strict;ve.strictEqual;ve.throws});var aN,dC=br(()=>{Tt();Rt();Ct();Of();zt._extend;zt.callbackify;zt.debuglog;zt.deprecate;zt.format;zt.inherits;zt.inspect;zt.isArray;zt.isBoolean;zt.isBuffer;zt.isDate;zt.isError;zt.isFunction;zt.isNull;zt.isNullOrUndefined;zt.isNumber;zt.isObject;zt.isPrimitive;zt.isRegExp;zt.isString;zt.isSymbol;zt.isUndefined;zt.log;aN=zt.promisify;zt.types;zt.TextEncoder=globalThis.TextEncoder;zt.TextDecoder=globalThis.TextDecoder});function qJ(){if(zj)return oN;zj=!0;var n=oN={},t,e;function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?t=setTimeout:t=r}catch{t=r}try{typeof clearTimeout=="function"?e=clearTimeout:e=i}catch{e=i}})();function s(y){if(t===setTimeout)return setTimeout(y,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(y,0);try{return t(y,0)}catch{try{return t.call(null,y,0)}catch{return t.call(this||P0,y,0)}}}function a(y){if(e===clearTimeout)return clearTimeout(y);if((e===i||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(y);try{return e(y)}catch{try{return e.call(null,y)}catch{return e.call(this||P0,y)}}}var o=[],c=!1,u,h=-1;function f(){!c||!u||(c=!1,u.length?o=u.concat(o):h=-1,o.length&&d())}function d(){if(!c){var y=s(f);c=!0;for(var b=o.length;b;){for(u=o,o=[];++h<b;)u&&u[h].run();h=-1,b=o.length}u=null,c=!1,a(y)}}n.nextTick=function(y){var b=new Array(arguments.length-1);if(arguments.length>1)for(var m=1;m<arguments.length;m++)b[m-1]=arguments[m];o.push(new p(y,b)),o.length===1&&!c&&s(d)};function p(y,b){(this||P0).fun=y,(this||P0).array=b}p.prototype.run=function(){(this||P0).fun.apply(null,(this||P0).array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={};function g(){}return n.on=g,n.addListener=g,n.once=g,n.off=g,n.removeListener=g,n.removeAllListeners=g,n.emit=g,n.prependListener=g,n.prependOnceListener=g,n.listeners=function(y){return[]},n.binding=function(y){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(y){throw new Error("process.chdir is not supported")},n.umask=function(){return 0},oN}var oN,zj,P0,pr,N0=br(()=>{Tt();Rt();Ct();oN={},zj=!1,P0=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;pr=qJ();pr.platform="browser";pr.addListener;pr.argv;pr.binding;pr.browser;pr.chdir;pr.cwd;pr.emit;pr.env;pr.listeners;pr.nextTick;pr.off;pr.on;pr.once;pr.prependListener;pr.prependOnceListener;pr.removeAllListeners;pr.removeListener;pr.title;pr.umask;pr.version;pr.versions});function YJ(){if(Wj)return lN;Wj=!0;var n=pr;function t(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function e(s,a){for(var o="",c=0,u=-1,h=0,f,d=0;d<=s.length;++d){if(d<s.length)f=s.charCodeAt(d);else{if(f===47)break;f=47}if(f===47){if(!(u===d-1||h===1))if(u!==d-1&&h===2){if(o.length<2||c!==2||o.charCodeAt(o.length-1)!==46||o.charCodeAt(o.length-2)!==46){if(o.length>2){var p=o.lastIndexOf("/");if(p!==o.length-1){p===-1?(o="",c=0):(o=o.slice(0,p),c=o.length-1-o.lastIndexOf("/")),u=d,h=0;continue}}else if(o.length===2||o.length===1){o="",c=0,u=d,h=0;continue}}a&&(o.length>0?o+="/..":o="..",c=2)}else o.length>0?o+="/"+s.slice(u+1,d):o=s.slice(u+1,d),c=d-u-1;u=d,h=0}else f===46&&h!==-1?++h:h=-1}return o}function r(s,a){var o=a.dir||a.root,c=a.base||(a.name||"")+(a.ext||"");return o?o===a.root?o+c:o+s+c:c}var i={resolve:function(){for(var a="",o=!1,c,u=arguments.length-1;u>=-1&&!o;u--){var h;u>=0?h=arguments[u]:(c===void 0&&(c=n.cwd()),h=c),t(h),h.length!==0&&(a=h+"/"+a,o=h.charCodeAt(0)===47)}return a=e(a,!o),o?a.length>0?"/"+a:"/":a.length>0?a:"."},normalize:function(a){if(t(a),a.length===0)return".";var o=a.charCodeAt(0)===47,c=a.charCodeAt(a.length-1)===47;return a=e(a,!o),a.length===0&&!o&&(a="."),a.length>0&&c&&(a+="/"),o?"/"+a:a},isAbsolute:function(a){return t(a),a.length>0&&a.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var a,o=0;o<arguments.length;++o){var c=arguments[o];t(c),c.length>0&&(a===void 0?a=c:a+="/"+c)}return a===void 0?".":i.normalize(a)},relative:function(a,o){if(t(a),t(o),a===o||(a=i.resolve(a),o=i.resolve(o),a===o))return"";for(var c=1;c<a.length&&a.charCodeAt(c)===47;++c);for(var u=a.length,h=u-c,f=1;f<o.length&&o.charCodeAt(f)===47;++f);for(var d=o.length,p=d-f,g=h<p?h:p,y=-1,b=0;b<=g;++b){if(b===g){if(p>g){if(o.charCodeAt(f+b)===47)return o.slice(f+b+1);if(b===0)return o.slice(f+b)}else h>g&&(a.charCodeAt(c+b)===47?y=b:b===0&&(y=0));break}var m=a.charCodeAt(c+b),w=o.charCodeAt(f+b);if(m!==w)break;m===47&&(y=b)}var A="";for(b=c+y+1;b<=u;++b)(b===u||a.charCodeAt(b)===47)&&(A.length===0?A+="..":A+="/..");return A.length>0?A+o.slice(f+y):(f+=y,o.charCodeAt(f)===47&&++f,o.slice(f))},_makeLong:function(a){return a},dirname:function(a){if(t(a),a.length===0)return".";for(var o=a.charCodeAt(0),c=o===47,u=-1,h=!0,f=a.length-1;f>=1;--f)if(o=a.charCodeAt(f),o===47){if(!h){u=f;break}}else h=!1;return u===-1?c?"/":".":c&&u===1?"//":a.slice(0,u)},basename:function(a,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');t(a);var c=0,u=-1,h=!0,f;if(o!==void 0&&o.length>0&&o.length<=a.length){if(o.length===a.length&&o===a)return"";var d=o.length-1,p=-1;for(f=a.length-1;f>=0;--f){var g=a.charCodeAt(f);if(g===47){if(!h){c=f+1;break}}else p===-1&&(h=!1,p=f+1),d>=0&&(g===o.charCodeAt(d)?--d===-1&&(u=f):(d=-1,u=p))}return c===u?u=p:u===-1&&(u=a.length),a.slice(c,u)}else{for(f=a.length-1;f>=0;--f)if(a.charCodeAt(f)===47){if(!h){c=f+1;break}}else u===-1&&(h=!1,u=f+1);return u===-1?"":a.slice(c,u)}},extname:function(a){t(a);for(var o=-1,c=0,u=-1,h=!0,f=0,d=a.length-1;d>=0;--d){var p=a.charCodeAt(d);if(p===47){if(!h){c=d+1;break}continue}u===-1&&(h=!1,u=d+1),p===46?o===-1?o=d:f!==1&&(f=1):o!==-1&&(f=-1)}return o===-1||u===-1||f===0||f===1&&o===u-1&&o===c+1?"":a.slice(o,u)},format:function(a){if(a===null||typeof a!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof a);return r("/",a)},parse:function(a){t(a);var o={root:"",dir:"",base:"",ext:"",name:""};if(a.length===0)return o;var c=a.charCodeAt(0),u=c===47,h;u?(o.root="/",h=1):h=0;for(var f=-1,d=0,p=-1,g=!0,y=a.length-1,b=0;y>=h;--y){if(c=a.charCodeAt(y),c===47){if(!g){d=y+1;break}continue}p===-1&&(g=!1,p=y+1),c===46?f===-1?f=y:b!==1&&(b=1):f!==-1&&(b=-1)}return f===-1||p===-1||b===0||b===1&&f===p-1&&f===d+1?p!==-1&&(d===0&&u?o.base=o.name=a.slice(1,p):o.base=o.name=a.slice(d,p)):(d===0&&u?(o.name=a.slice(1,f),o.base=a.slice(1,p)):(o.name=a.slice(d,f),o.base=a.slice(d,p)),o.ext=a.slice(f,p)),d>0?o.dir=a.slice(0,d-1):u&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,lN=i,lN}function Kp(n){throw new RangeError(QJ[n])}function Gj(n,t){let e=n.split("@"),r="";e.length>1&&(r=e[0]+"@",n=e[1]);let i=(function(s,a){let o=[],c=s.length;for(;c--;)o[c]=a(s[c]);return o})((n=n.replace(JJ,".")).split("."),t).join(".");return r+i}function t$(n){let t=[],e=0,r=n.length;for(;e<r;){let i=n.charCodeAt(e++);if(i>=55296&&i<=56319&&e<r){let s=n.charCodeAt(e++);(64512&s)==56320?t.push(((1023&i)<<10)+(1023&s)+65536):(t.push(i),e--)}else t.push(i)}return t}function eQ(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function xo(){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 AE(n,t,e){if(n&&rc.isObject(n)&&n instanceof xo)return n;var r=new xo;return r.parse(n,t,e),r}function hQ(){if(Jj)return fN;Jj=!0;var n=Ur;function t(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function e(s,a){for(var o="",c=0,u=-1,h=0,f,d=0;d<=s.length;++d){if(d<s.length)f=s.charCodeAt(d);else{if(f===47)break;f=47}if(f===47){if(!(u===d-1||h===1))if(u!==d-1&&h===2){if(o.length<2||c!==2||o.charCodeAt(o.length-1)!==46||o.charCodeAt(o.length-2)!==46){if(o.length>2){var p=o.lastIndexOf("/");if(p!==o.length-1){p===-1?(o="",c=0):(o=o.slice(0,p),c=o.length-1-o.lastIndexOf("/")),u=d,h=0;continue}}else if(o.length===2||o.length===1){o="",c=0,u=d,h=0;continue}}a&&(o.length>0?o+="/..":o="..",c=2)}else o.length>0?o+="/"+s.slice(u+1,d):o=s.slice(u+1,d),c=d-u-1;u=d,h=0}else f===46&&h!==-1?++h:h=-1}return o}function r(s,a){var o=a.dir||a.root,c=a.base||(a.name||"")+(a.ext||"");return o?o===a.root?o+c:o+s+c:c}var i={resolve:function(){for(var a="",o=!1,c,u=arguments.length-1;u>=-1&&!o;u--){var h;u>=0?h=arguments[u]:(c===void 0&&(c=n.cwd()),h=c),t(h),h.length!==0&&(a=h+"/"+a,o=h.charCodeAt(0)===47)}return a=e(a,!o),o?a.length>0?"/"+a:"/":a.length>0?a:"."},normalize:function(a){if(t(a),a.length===0)return".";var o=a.charCodeAt(0)===47,c=a.charCodeAt(a.length-1)===47;return a=e(a,!o),a.length===0&&!o&&(a="."),a.length>0&&c&&(a+="/"),o?"/"+a:a},isAbsolute:function(a){return t(a),a.length>0&&a.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var a,o=0;o<arguments.length;++o){var c=arguments[o];t(c),c.length>0&&(a===void 0?a=c:a+="/"+c)}return a===void 0?".":i.normalize(a)},relative:function(a,o){if(t(a),t(o),a===o||(a=i.resolve(a),o=i.resolve(o),a===o))return"";for(var c=1;c<a.length&&a.charCodeAt(c)===47;++c);for(var u=a.length,h=u-c,f=1;f<o.length&&o.charCodeAt(f)===47;++f);for(var d=o.length,p=d-f,g=h<p?h:p,y=-1,b=0;b<=g;++b){if(b===g){if(p>g){if(o.charCodeAt(f+b)===47)return o.slice(f+b+1);if(b===0)return o.slice(f+b)}else h>g&&(a.charCodeAt(c+b)===47?y=b:b===0&&(y=0));break}var m=a.charCodeAt(c+b),w=o.charCodeAt(f+b);if(m!==w)break;m===47&&(y=b)}var A="";for(b=c+y+1;b<=u;++b)(b===u||a.charCodeAt(b)===47)&&(A.length===0?A+="..":A+="/..");return A.length>0?A+o.slice(f+y):(f+=y,o.charCodeAt(f)===47&&++f,o.slice(f))},_makeLong:function(a){return a},dirname:function(a){if(t(a),a.length===0)return".";for(var o=a.charCodeAt(0),c=o===47,u=-1,h=!0,f=a.length-1;f>=1;--f)if(o=a.charCodeAt(f),o===47){if(!h){u=f;break}}else h=!1;return u===-1?c?"/":".":c&&u===1?"//":a.slice(0,u)},basename:function(a,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');t(a);var c=0,u=-1,h=!0,f;if(o!==void 0&&o.length>0&&o.length<=a.length){if(o.length===a.length&&o===a)return"";var d=o.length-1,p=-1;for(f=a.length-1;f>=0;--f){var g=a.charCodeAt(f);if(g===47){if(!h){c=f+1;break}}else p===-1&&(h=!1,p=f+1),d>=0&&(g===o.charCodeAt(d)?--d===-1&&(u=f):(d=-1,u=p))}return c===u?u=p:u===-1&&(u=a.length),a.slice(c,u)}else{for(f=a.length-1;f>=0;--f)if(a.charCodeAt(f)===47){if(!h){c=f+1;break}}else u===-1&&(h=!1,u=f+1);return u===-1?"":a.slice(c,u)}},extname:function(a){t(a);for(var o=-1,c=0,u=-1,h=!0,f=0,d=a.length-1;d>=0;--d){var p=a.charCodeAt(d);if(p===47){if(!h){c=d+1;break}continue}u===-1&&(h=!1,u=d+1),p===46?o===-1?o=d:f!==1&&(f=1):o!==-1&&(f=-1)}return o===-1||u===-1||f===0||f===1&&o===u-1&&o===c+1?"":a.slice(o,u)},format:function(a){if(a===null||typeof a!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof a);return r("/",a)},parse:function(a){t(a);var o={root:"",dir:"",base:"",ext:"",name:""};if(a.length===0)return o;var c=a.charCodeAt(0),u=c===47,h;u?(o.root="/",h=1):h=0;for(var f=-1,d=0,p=-1,g=!0,y=a.length-1,b=0;y>=h;--y){if(c=a.charCodeAt(y),c===47){if(!g){d=y+1;break}continue}p===-1&&(g=!1,p=y+1),c===46?f===-1?f=y:b!==1&&(b=1):f!==-1&&(b=-1)}return f===-1||p===-1||b===0||b===1&&f===p-1&&f===d+1?p!==-1&&(d===0&&u?o.base=o.name=a.slice(1,p):o.base=o.name=a.slice(d,p)):(d===0&&u?(o.name=a.slice(1,f),o.base=a.slice(1,p)):(o.name=a.slice(d,f),o.base=a.slice(d,p)),o.ext=a.slice(f,p)),d>0?o.dir=a.slice(0,d-1):u&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,fN=i,fN}function xQ(n){if(typeof n=="string")n=new URL(n);else if(!(n instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(n.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return pN?SQ(n):_Q(n)}function SQ(n){let t=n.hostname,e=n.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let i=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&i===102||e[r+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(e=e.replace(yQ,"\\"),e=decodeURIComponent(e),t!=="")return`\\\\${t}${e}`;{let r=e.codePointAt(1)|32,i=e[2];if(r<gQ||r>mQ||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return e.slice(1)}}function _Q(n){if(n.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let t=n.pathname;for(let e=0;e<t.length;e++)if(t[e]==="%"){let r=t.codePointAt(e+2)||32;if(t[e+1]==="2"&&r===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}function TQ(n){let t=Qj.resolve(n),e=n.charCodeAt(n.length-1);(e===pQ||pN&&e===dQ)&&t[t.length-1]!==Qj.sep&&(t+="/");let r=new URL("file://");return t.includes("%")&&(t=t.replace(bQ,"%25")),!pN&&t.includes("\\")&&(t=t.replace(vQ,"%5C")),t.includes(`
72
+ `)&&(t=t.replace(wQ,"%0A")),t.includes("\r")&&(t=t.replace(AQ,"%0D")),t.includes(" ")&&(t=t.replace(EQ,"%09")),r.pathname=t,r}function BQ(n){if(typeof n=="string")n=new URL(n);else if(!(n instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(n.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return gN?UQ(n):jQ(n)}function UQ(n){let t=n.hostname,e=n.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let i=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&i===102||e[r+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(e=e.replace(PQ,"\\"),e=decodeURIComponent(e),t!=="")return`\\\\${t}${e}`;{let r=e.codePointAt(1)|32,i=e[2];if(r<DQ||r>OQ||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return e.slice(1)}}function jQ(n){if(n.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let t=n.pathname;for(let e=0;e<t.length;e++)if(t[e]==="%"){let r=t.codePointAt(e+2)||32;if(t[e+1]==="2"&&r===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}function $Q(n){let t=ai.resolve(n),e=n.charCodeAt(n.length-1);(e===IQ||gN&&e===RQ)&&t[t.length-1]!==ai.sep&&(t+="/");let r=new URL("file://");return t.includes("%")&&(t=t.replace(NQ,"%25")),!gN&&t.includes("\\")&&(t=t.replace(LQ,"%5C")),t.includes(`
73
+ `)&&(t=t.replace(kQ,"%0A")),t.includes("\r")&&(t=t.replace(MQ,"%0D")),t.includes(" ")&&(t=t.replace(FQ,"%09")),r.pathname=t,r}var lN,Wj,ai,k0,KJ,ZJ,JJ,QJ,nc,cN,Vj,e$,Xj,qj,tQ,rQ,wE,nQ,wu,Sr,iQ,rc,sQ,aQ,oQ,lQ,dN,Yj,Kj,Zj,cQ,uQ,uN,L0,hN,fN,Jj,Qj,fQ,dQ,pQ,gQ,mQ,pN,yQ,bQ,vQ,wQ,AQ,EQ,CQ,RQ,IQ,DQ,OQ,gN,PQ,NQ,LQ,kQ,MQ,FQ,r$=br(()=>{Tt();Rt();Ct();Of();N0();lN={},Wj=!1;ai=YJ(),k0=2147483647,KJ=/^xn--/,ZJ=/[^\0-\x7E]/,JJ=/[\x2E\u3002\uFF0E\uFF61]/g,QJ={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},nc=Math.floor,cN=String.fromCharCode;Vj=function(n,t){return n+22+75*(n<26)-((t!=0)<<5)},e$=function(n,t,e){let r=0;for(n=e?nc(n/700):n>>1,n+=nc(n/t);n>455;r+=36)n=nc(n/35);return nc(r+36*n/(n+38))},Xj=function(n){let t=[],e=n.length,r=0,i=128,s=72,a=n.lastIndexOf("-");a<0&&(a=0);for(let c=0;c<a;++c)n.charCodeAt(c)>=128&&Kp("not-basic"),t.push(n.charCodeAt(c));for(let c=a>0?a+1:0;c<e;){let u=r;for(let f=1,d=36;;d+=36){c>=e&&Kp("invalid-input");let p=(o=n.charCodeAt(c++))-48<10?o-22:o-65<26?o-65:o-97<26?o-97:36;(p>=36||p>nc((k0-r)/f))&&Kp("overflow"),r+=p*f;let g=d<=s?1:d>=s+26?26:d-s;if(p<g)break;let y=36-g;f>nc(k0/y)&&Kp("overflow"),f*=y}let h=t.length+1;s=e$(r-u,h,u==0),nc(r/h)>k0-i&&Kp("overflow"),i+=nc(r/h),r%=h,t.splice(r++,0,i)}var o;return String.fromCodePoint(...t)},qj=function(n){let t=[],e=(n=t$(n)).length,r=128,i=0,s=72;for(let c of n)c<128&&t.push(cN(c));let a=t.length,o=a;for(a&&t.push("-");o<e;){let c=k0;for(let h of n)h>=r&&h<c&&(c=h);let u=o+1;c-r>nc((k0-i)/u)&&Kp("overflow"),i+=(c-r)*u,r=c;for(let h of n)if(h<r&&++i>k0&&Kp("overflow"),h==r){let f=i;for(let d=36;;d+=36){let p=d<=s?1:d>=s+26?26:d-s;if(f<p)break;let g=f-p,y=36-p;t.push(cN(Vj(p+g%y,0))),f=nc(g/y)}t.push(cN(Vj(f,0))),s=e$(i,u,o==a),i=0,++o}++i,++r}return t.join("")},tQ={version:"2.1.0",ucs2:{decode:t$,encode:n=>String.fromCodePoint(...n)},decode:Xj,encode:qj,toASCII:function(n){return Gj(n,(function(t){return ZJ.test(t)?"xn--"+qj(t):t}))},toUnicode:function(n){return Gj(n,(function(t){return KJ.test(t)?Xj(t.slice(4).toLowerCase()):t}))}};rQ=function(n,t,e,r){t=t||"&",e=e||"=";var i={};if(typeof n!="string"||n.length===0)return i;var s=/\+/g;n=n.split(t);var a=1e3;r&&typeof r.maxKeys=="number"&&(a=r.maxKeys);var o=n.length;a>0&&o>a&&(o=a);for(var c=0;c<o;++c){var u,h,f,d,p=n[c].replace(s,"%20"),g=p.indexOf(e);g>=0?(u=p.substr(0,g),h=p.substr(g+1)):(u=p,h=""),f=decodeURIComponent(u),d=decodeURIComponent(h),eQ(i,f)?Array.isArray(i[f])?i[f].push(d):i[f]=[i[f],d]:i[f]=d}return i},wE=function(n){switch(typeof n){case"string":return n;case"boolean":return n?"true":"false";case"number":return isFinite(n)?n:"";default:return""}},nQ=function(n,t,e,r){return t=t||"&",e=e||"=",n===null&&(n=void 0),typeof n=="object"?Object.keys(n).map((function(i){var s=encodeURIComponent(wE(i))+e;return Array.isArray(n[i])?n[i].map((function(a){return s+encodeURIComponent(wE(a))})).join(t):s+encodeURIComponent(wE(n[i]))})).join(t):r?encodeURIComponent(wE(r))+e+encodeURIComponent(wE(n)):""},wu={};wu.decode=wu.parse=rQ,wu.encode=wu.stringify=nQ;wu.decode;wu.encode;wu.parse;wu.stringify;Sr={},iQ=tQ,rc={isString:function(n){return typeof n=="string"},isObject:function(n){return typeof n=="object"&&n!==null},isNull:function(n){return n===null},isNullOrUndefined:function(n){return n==null}};Sr.parse=AE,Sr.resolve=function(n,t){return AE(n,!1,!0).resolve(t)},Sr.resolveObject=function(n,t){return n?AE(n,!1,!0).resolveObject(t):t},Sr.format=function(n){return rc.isString(n)&&(n=AE(n)),n instanceof xo?n.format():xo.prototype.format.call(n)},Sr.Url=xo;sQ=/^([a-z0-9.+-]+:)/i,aQ=/:[0-9]*$/,oQ=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,lQ=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
74
+ `," "]),dN=["'"].concat(lQ),Yj=["%","/","?",";","#"].concat(dN),Kj=["/","?","#"],Zj=/^[+a-z0-9A-Z_-]{0,63}$/,cQ=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,uQ={javascript:!0,"javascript:":!0},uN={javascript:!0,"javascript:":!0},L0={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},hN=wu;xo.prototype.parse=function(n,t,e){if(!rc.isString(n))throw new TypeError("Parameter 'url' must be a string, not "+typeof n);var r=n.indexOf("?"),i=r!==-1&&r<n.indexOf("#")?"?":"#",s=n.split(i);s[0]=s[0].replace(/\\/g,"/");var a=n=s.join(i);if(a=a.trim(),!e&&n.split("#").length===1){var o=oQ.exec(a);if(o)return this.path=a,this.href=a,this.pathname=o[1],o[2]?(this.search=o[2],this.query=t?hN.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var c=sQ.exec(a);if(c){var u=(c=c[0]).toLowerCase();this.protocol=u,a=a.substr(c.length)}if(e||c||a.match(/^\/\/[^@\/]+@[^@\/]+/)){var h=a.substr(0,2)==="//";!h||c&&uN[c]||(a=a.substr(2),this.slashes=!0)}if(!uN[c]&&(h||c&&!L0[c])){for(var f,d,p=-1,g=0;g<Kj.length;g++)(y=a.indexOf(Kj[g]))!==-1&&(p===-1||y<p)&&(p=y);for((d=p===-1?a.lastIndexOf("@"):a.lastIndexOf("@",p))!==-1&&(f=a.slice(0,d),a=a.slice(d+1),this.auth=decodeURIComponent(f)),p=-1,g=0;g<Yj.length;g++){var y;(y=a.indexOf(Yj[g]))!==-1&&(p===-1||y<p)&&(p=y)}p===-1&&(p=a.length),this.host=a.slice(0,p),a=a.slice(p),this.parseHost(),this.hostname=this.hostname||"";var b=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!b)for(var m=this.hostname.split(/\./),w=(g=0,m.length);g<w;g++){var A=m[g];if(A&&!A.match(Zj)){for(var _="",S=0,I=A.length;S<I;S++)A.charCodeAt(S)>127?_+="x":_+=A[S];if(!_.match(Zj)){var C=m.slice(0,g),M=m.slice(g+1),z=A.match(cQ);z&&(C.push(z[1]),M.unshift(z[2])),M.length&&(a="/"+M.join(".")+a),this.hostname=C.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),b||(this.hostname=iQ.toASCII(this.hostname));var G=this.port?":"+this.port:"",Y=this.hostname||"";this.host=Y+G,this.href+=this.host,b&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),a[0]!=="/"&&(a="/"+a))}if(!uQ[u])for(g=0,w=dN.length;g<w;g++){var L=dN[g];if(a.indexOf(L)!==-1){var j=encodeURIComponent(L);j===L&&(j=escape(L)),a=a.split(L).join(j)}}var q=a.indexOf("#");q!==-1&&(this.hash=a.substr(q),a=a.slice(0,q));var nt=a.indexOf("?");if(nt!==-1?(this.search=a.substr(nt),this.query=a.substr(nt+1),t&&(this.query=hN.parse(this.query)),a=a.slice(0,nt)):t&&(this.search="",this.query={}),a&&(this.pathname=a),L0[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){G=this.pathname||"";var J=this.search||"";this.path=G+J}return this.href=this.format(),this},xo.prototype.format=function(){var n=this.auth||"";n&&(n=(n=encodeURIComponent(n)).replace(/%3A/i,":"),n+="@");var t=this.protocol||"",e=this.pathname||"",r=this.hash||"",i=!1,s="";this.host?i=n+this.host:this.hostname&&(i=n+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&rc.isObject(this.query)&&Object.keys(this.query).length&&(s=hN.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&t.substr(-1)!==":"&&(t+=":"),this.slashes||(!t||L0[t])&&i!==!1?(i="//"+(i||""),e&&e.charAt(0)!=="/"&&(e="/"+e)):i||(i=""),r&&r.charAt(0)!=="#"&&(r="#"+r),a&&a.charAt(0)!=="?"&&(a="?"+a),t+i+(e=e.replace(/[?#]/g,(function(o){return encodeURIComponent(o)})))+(a=a.replace("#","%23"))+r},xo.prototype.resolve=function(n){return this.resolveObject(AE(n,!1,!0)).format()},xo.prototype.resolveObject=function(n){if(rc.isString(n)){var t=new xo;t.parse(n,!1,!0),n=t}for(var e=new xo,r=Object.keys(this),i=0;i<r.length;i++){var s=r[i];e[s]=this[s]}if(e.hash=n.hash,n.href==="")return e.href=e.format(),e;if(n.slashes&&!n.protocol){for(var a=Object.keys(n),o=0;o<a.length;o++){var c=a[o];c!=="protocol"&&(e[c]=n[c])}return L0[e.protocol]&&e.hostname&&!e.pathname&&(e.path=e.pathname="/"),e.href=e.format(),e}if(n.protocol&&n.protocol!==e.protocol){if(!L0[n.protocol]){for(var u=Object.keys(n),h=0;h<u.length;h++){var f=u[h];e[f]=n[f]}return e.href=e.format(),e}if(e.protocol=n.protocol,n.host||uN[n.protocol])e.pathname=n.pathname;else{for(var d=(n.pathname||"").split("/");d.length&&!(n.host=d.shift()););n.host||(n.host=""),n.hostname||(n.hostname=""),d[0]!==""&&d.unshift(""),d.length<2&&d.unshift(""),e.pathname=d.join("/")}if(e.search=n.search,e.query=n.query,e.host=n.host||"",e.auth=n.auth,e.hostname=n.hostname||n.host,e.port=n.port,e.pathname||e.search){var p=e.pathname||"",g=e.search||"";e.path=p+g}return e.slashes=e.slashes||n.slashes,e.href=e.format(),e}var y=e.pathname&&e.pathname.charAt(0)==="/",b=n.host||n.pathname&&n.pathname.charAt(0)==="/",m=b||y||e.host&&n.pathname,w=m,A=e.pathname&&e.pathname.split("/")||[],_=(d=n.pathname&&n.pathname.split("/")||[],e.protocol&&!L0[e.protocol]);if(_&&(e.hostname="",e.port=null,e.host&&(A[0]===""?A[0]=e.host:A.unshift(e.host)),e.host="",n.protocol&&(n.hostname=null,n.port=null,n.host&&(d[0]===""?d[0]=n.host:d.unshift(n.host)),n.host=null),m=m&&(d[0]===""||A[0]==="")),b)e.host=n.host||n.host===""?n.host:e.host,e.hostname=n.hostname||n.hostname===""?n.hostname:e.hostname,e.search=n.search,e.query=n.query,A=d;else if(d.length)A||(A=[]),A.pop(),A=A.concat(d),e.search=n.search,e.query=n.query;else if(!rc.isNullOrUndefined(n.search))return _&&(e.hostname=e.host=A.shift(),(z=!!(e.host&&e.host.indexOf("@")>0)&&e.host.split("@"))&&(e.auth=z.shift(),e.host=e.hostname=z.shift())),e.search=n.search,e.query=n.query,rc.isNull(e.pathname)&&rc.isNull(e.search)||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.href=e.format(),e;if(!A.length)return e.pathname=null,e.search?e.path="/"+e.search:e.path=null,e.href=e.format(),e;for(var S=A.slice(-1)[0],I=(e.host||n.host||A.length>1)&&(S==="."||S==="..")||S==="",C=0,M=A.length;M>=0;M--)(S=A[M])==="."?A.splice(M,1):S===".."?(A.splice(M,1),C++):C&&(A.splice(M,1),C--);if(!m&&!w)for(;C--;C)A.unshift("..");!m||A[0]===""||A[0]&&A[0].charAt(0)==="/"||A.unshift(""),I&&A.join("/").substr(-1)!=="/"&&A.push("");var z,G=A[0]===""||A[0]&&A[0].charAt(0)==="/";return _&&(e.hostname=e.host=G?"":A.length?A.shift():"",(z=!!(e.host&&e.host.indexOf("@")>0)&&e.host.split("@"))&&(e.auth=z.shift(),e.host=e.hostname=z.shift())),(m=m||e.host&&A.length)&&!G&&A.unshift(""),A.length?e.pathname=A.join("/"):(e.pathname=null,e.path=null),rc.isNull(e.pathname)&&rc.isNull(e.search)||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.auth=n.auth||e.auth,e.slashes=e.slashes||n.slashes,e.href=e.format(),e},xo.prototype.parseHost=function(){var n=this.host,t=aQ.exec(n);t&&((t=t[0])!==":"&&(this.port=t.substr(1)),n=n.substr(0,n.length-t.length)),n&&(this.hostname=n)};Sr.Url;Sr.format;Sr.resolve;Sr.resolveObject;fN={},Jj=!1;Qj=hQ(),fQ=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;Sr.URL=typeof URL<"u"?URL:null;Sr.pathToFileURL=TQ;Sr.fileURLToPath=xQ;Sr.Url;Sr.format;Sr.resolve;Sr.resolveObject;Sr.URL;dQ=92,pQ=47,gQ=97,mQ=122,pN=fQ==="win32",yQ=/\//g,bQ=/%/g,vQ=/\\/g,wQ=/\n/g,AQ=/\r/g,EQ=/\t/g;CQ=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;Sr.URL=typeof URL<"u"?URL:null;Sr.pathToFileURL=$Q;Sr.fileURLToPath=BQ;Sr.Url;Sr.format;Sr.resolve;Sr.resolveObject;Sr.parse;Sr.URL;RQ=92,IQ=47,DQ=97,OQ=122,gN=CQ==="win32",PQ=/\//g,NQ=/%/g,LQ=/\\/g,kQ=/\n/g,MQ=/\r/g,FQ=/\t/g});function vN(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}function HQ(){!M0||!Zp||(M0=!1,Zp.length?Au=Zp.concat(Au):pC=-1,Au.length&&n$())}function n$(){if(!M0){var n=setTimeout(HQ,0);M0=!0;for(var t=Au.length;t;){for(Zp=Au,Au=[];++pC<t;)Zp&&Zp[pC].run();pC=-1,t=Au.length}Zp=null,M0=!1,clearTimeout(n)}}function zQ(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];Au.push(new i$(n,t)),Au.length===1&&!M0&&setTimeout(n$,0)}function i$(n,t){this.fun=n,this.array=t}function ns(){}function att(n){vN("_linkedBinding")}function utt(n){vN("dlopen")}function htt(){return[]}function ftt(){return[]}function Att(n,t){if(!n)throw new Error(t||"assertion error")}function _tt(){return!1}function Htt(){return Pf.now()/1e3}function bN(n){var t=Math.floor((Date.now()-Pf.now())*.001),e=Pf.now()*.001,r=Math.floor(e)+t,i=Math.floor(e%1*1e9);return n&&(r=r-n[0],i=i-n[1],i<0&&(r--,i+=yN)),[r,i]}function Nf(){return $n}function tet(n){return[]}var Au,M0,Zp,pC,WQ,GQ,VQ,XQ,qQ,YQ,KQ,ZQ,JQ,QQ,ttt,ett,rtt,ntt,itt,stt,ott,ltt,ctt,dtt,ptt,wN,gtt,mtt,ytt,btt,vtt,wtt,Ett,xtt,Stt,Ttt,Ctt,Rtt,Itt,Dtt,Ott,Ptt,Ntt,Ltt,ktt,Mtt,Ftt,Btt,Utt,jtt,$tt,Pf,mN,yN,ztt,Wtt,Gtt,Vtt,Xtt,qtt,Ytt,Ktt,Ztt,Jtt,Qtt,$n,Jp=br(()=>{Tt();Rt();Ct();Au=[],M0=!1,pC=-1;i$.prototype.run=function(){this.fun.apply(null,this.array)};WQ="browser",GQ="x64",VQ="browser",XQ={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},qQ=["/usr/bin/node"],YQ=[],KQ="v16.8.0",ZQ={},JQ=function(n,t){console.warn((t?t+": ":"")+n)},QQ=function(n){vN("binding")},ttt=function(n){return 0},ett=function(){return"/"},rtt=function(n){},ntt={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};itt=ns,stt=[];ott={},ltt=!1,ctt={};dtt=ns,ptt=ns,wN=function(){return{}},gtt=wN,mtt=wN,ytt=ns,btt=ns,vtt=ns,wtt={};Ett={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},xtt=ns,Stt=ns;Ttt=ns,Ctt=ns,Rtt=ns,Itt=ns,Dtt=ns,Ott=void 0,Ptt=void 0,Ntt=void 0,Ltt=ns,ktt=2,Mtt=1,Ftt="/bin/usr/node",Btt=9229,Utt="node",jtt=[],$tt=ns,Pf={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Pf.now===void 0&&(mN=Date.now(),Pf.timing&&Pf.timing.navigationStart&&(mN=Pf.timing.navigationStart),Pf.now=()=>Date.now()-mN);yN=1e9;bN.bigint=function(n){var t=bN(n);return typeof BigInt>"u"?t[0]*yN+t[1]:BigInt(t[0]*yN)+BigInt(t[1])};ztt=10,Wtt={},Gtt=0;Vtt=Nf,Xtt=Nf,qtt=Nf,Ytt=Nf,Ktt=Nf,Ztt=ns,Jtt=Nf,Qtt=Nf;$n={version:KQ,versions:ZQ,arch:GQ,platform:VQ,release:ntt,_rawDebug:itt,moduleLoadList:stt,binding:QQ,_linkedBinding:att,_events:Wtt,_eventsCount:Gtt,_maxListeners:ztt,on:Nf,addListener:Vtt,once:Xtt,off:qtt,removeListener:Ytt,removeAllListeners:Ktt,emit:Ztt,prependListener:Jtt,prependOnceListener:Qtt,listeners:tet,domain:ott,_exiting:ltt,config:ctt,dlopen:utt,uptime:Htt,_getActiveRequests:htt,_getActiveHandles:ftt,reallyExit:dtt,_kill:ptt,cpuUsage:wN,resourceUsage:gtt,memoryUsage:mtt,kill:ytt,exit:btt,openStdin:vtt,allowedNodeEnvironmentFlags:wtt,assert:Att,features:Ett,_fatalExceptions:xtt,setUncaughtExceptionCaptureCallback:Stt,hasUncaughtExceptionCaptureCallback:_tt,emitWarning:JQ,nextTick:zQ,_tickCallback:Ttt,_debugProcess:Ctt,_debugEnd:Rtt,_startProfilerIdleNotifier:Itt,_stopProfilerIdleNotifier:Dtt,stdout:Ott,stdin:Ntt,stderr:Ptt,abort:Ltt,umask:ttt,chdir:rtt,cwd:ett,env:XQ,title:WQ,argv:qQ,execArgv:YQ,pid:ktt,ppid:Mtt,execPath:Ftt,debugPort:Btt,hrtime:bN,argv0:Utt,_preload_modules:jtt,setSourceMapsEnabled:$tt}});function _r(){_r.init.call(this)}function gC(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}function p$(n){return n._maxListeners===void 0?_r.defaultMaxListeners:n._maxListeners}function l$(n,t,e,r){var i,s,a,o;if(gC(e),(s=n._events)===void 0?(s=n._events=Object.create(null),n._eventsCount=0):(s.newListener!==void 0&&(n.emit("newListener",t,e.listener?e.listener:e),s=n._events),a=s[t]),a===void 0)a=s[t]=e,++n._eventsCount;else if(typeof a=="function"?a=s[t]=r?[e,a]:[a,e]:r?a.unshift(e):a.push(e),(i=p$(n))>0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=n,c.type=t,c.count=a.length,o=c,console&&console.warn&&console.warn(o)}return n}function eet(){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 c$(n,t,e){var r={fired:!1,wrapFn:void 0,target:n,type:t,listener:e},i=eet.bind(r);return i.listener=e,r.wrapFn=i,i}function u$(n,t,e){var r=n._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i=="function"?e?[i.listener||i]:[i]:e?(function(s){for(var a=new Array(s.length),o=0;o<a.length;++o)a[o]=s[o].listener||s[o];return a})(i):g$(i,i.length)}function h$(n){var t=this._events;if(t!==void 0){var e=t[n];if(typeof e=="function")return 1;if(e!==void 0)return e.length}return 0}function g$(n,t){for(var e=new Array(t),r=0;r<t;++r)e[r]=n[r];return e}var f$,d$,F0,s$,a$,o$,oi,B0=br(()=>{Tt();Rt();Ct();F0=typeof Reflect=="object"?Reflect:null,s$=F0&&typeof F0.apply=="function"?F0.apply:function(n,t,e){return Function.prototype.apply.call(n,t,e)};d$=F0&&typeof F0.ownKeys=="function"?F0.ownKeys:Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:function(n){return Object.getOwnPropertyNames(n)};a$=Number.isNaN||function(n){return n!=n};f$=_r,_r.EventEmitter=_r,_r.prototype._events=void 0,_r.prototype._eventsCount=0,_r.prototype._maxListeners=void 0;o$=10;Object.defineProperty(_r,"defaultMaxListeners",{enumerable:!0,get:function(){return o$},set:function(n){if(typeof n!="number"||n<0||a$(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");o$=n}}),_r.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},_r.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||a$(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this},_r.prototype.getMaxListeners=function(){return p$(this)},_r.prototype.emit=function(n){for(var t=[],e=1;e<arguments.length;e++)t.push(arguments[e]);var r=n==="error",i=this._events;if(i!==void 0)r=r&&i.error===void 0;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var o=i[n];if(o===void 0)return!1;if(typeof o=="function")s$(o,this,t);else{var c=o.length,u=g$(o,c);for(e=0;e<c;++e)s$(u[e],this,t)}return!0},_r.prototype.addListener=function(n,t){return l$(this,n,t,!1)},_r.prototype.on=_r.prototype.addListener,_r.prototype.prependListener=function(n,t){return l$(this,n,t,!0)},_r.prototype.once=function(n,t){return gC(t),this.on(n,c$(this,n,t)),this},_r.prototype.prependOnceListener=function(n,t){return gC(t),this.prependListener(n,c$(this,n,t)),this},_r.prototype.removeListener=function(n,t){var e,r,i,s,a;if(gC(t),(r=this._events)===void 0)return this;if((e=r[n])===void 0)return this;if(e===t||e.listener===t)--this._eventsCount==0?this._events=Object.create(null):(delete r[n],r.removeListener&&this.emit("removeListener",n,e.listener||t));else if(typeof e!="function"){for(i=-1,s=e.length-1;s>=0;s--)if(e[s]===t||e[s].listener===t){a=e[s].listener,i=s;break}if(i<0)return this;i===0?e.shift():(function(o,c){for(;c+1<o.length;c++)o[c]=o[c+1];o.pop()})(e,i),e.length===1&&(r[n]=e[0]),r.removeListener!==void 0&&this.emit("removeListener",n,a||t)}return this},_r.prototype.off=_r.prototype.removeListener,_r.prototype.removeAllListeners=function(n){var t,e,r;if((e=this._events)===void 0)return this;if(e.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):e[n]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete e[n]),this;if(arguments.length===0){var i,s=Object.keys(e);for(r=0;r<s.length;++r)(i=s[r])!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(t=e[n])=="function")this.removeListener(n,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(n,t[r]);return this},_r.prototype.listeners=function(n){return u$(this,n,!0)},_r.prototype.rawListeners=function(n){return u$(this,n,!1)},_r.listenerCount=function(n,t){return typeof n.listenerCount=="function"?n.listenerCount(t):h$.call(n,t)},_r.prototype.listenerCount=h$,_r.prototype.eventNames=function(){return this._eventsCount>0?d$(this._events):[]};oi=f$;oi.EventEmitter;oi.defaultMaxListeners;oi.init;oi.listenerCount;oi.EventEmitter;oi.defaultMaxListeners;oi.init;oi.listenerCount});var mC=br(()=>{Tt();Rt();Ct();B0();oi.once=function(n,t){return new Promise((e,r)=>{function i(...a){s!==void 0&&n.removeListener("error",s),e(a)}let s;t!=="error"&&(s=a=>{n.removeListener(name,i),r(a)},n.once("error",s)),n.once(t,i)})};oi.on=function(n,t){let e=[],r=[],i=null,s=!1,a={async next(){let u=e.shift();if(u)return createIterResult(u,!1);if(i){let h=Promise.reject(i);return i=null,h}return s?createIterResult(void 0,!0):new Promise((h,f)=>r.push({resolve:h,reject:f}))},async return(){n.removeListener(t,o),n.removeListener("error",c),s=!0;for(let u of r)u.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(u){i=u,n.removeListener(t,o),n.removeListener("error",c)},[Symbol.asyncIterator](){return this}};return n.on(t,o),n.on("error",c),a;function o(...u){let h=r.shift();h?h.resolve(createIterResult(u,!1)):e.push(u)}function c(u){s=!0;let h=r.shift();h?h.reject(u):i=u,a.return()}}});function b$(n){var t=n.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=n.indexOf("=");return e===-1&&(e=t),[e,e===t?0:4-e%4]}function ret(n,t,e){for(var r,i,s=[],a=t;a<e;a+=3)r=(n[a]<<16&16711680)+(n[a+1]<<8&65280)+(255&n[a+2]),s.push(fl[(i=r)>>18&63]+fl[i>>12&63]+fl[i>>6&63]+fl[63&i]);return s.join("")}function Eu(n){if(n>2147483647)throw new RangeError('The value "'+n+'" is invalid for option "size"');var t=new Uint8Array(n);return Object.setPrototypeOf(t,Xt.prototype),t}function Xt(n,t,e){if(typeof n=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return jN(n)}return X$(n,t,e)}function X$(n,t,e){if(typeof n=="string")return(function(s,a){if(typeof a=="string"&&a!==""||(a="utf8"),!Xt.isEncoding(a))throw new TypeError("Unknown encoding: "+a);var o=0|Y$(s,a),c=Eu(o),u=c.write(s,a);return u!==o&&(c=c.slice(0,u)),c})(n,t);if(ArrayBuffer.isView(n))return AN(n);if(n==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n);if(xu(n,ArrayBuffer)||n&&xu(n.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xu(n,SharedArrayBuffer)||n&&xu(n.buffer,SharedArrayBuffer)))return w$(n,t,e);if(typeof n=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var r=n.valueOf&&n.valueOf();if(r!=null&&r!==n)return Xt.from(r,t,e);var i=(function(s){if(Xt.isBuffer(s)){var a=0|WN(s.length),o=Eu(a);return o.length===0||s.copy(o,0,0,a),o}if(s.length!==void 0)return typeof s.length!="number"||GN(s.length)?Eu(0):AN(s);if(s.type==="Buffer"&&Array.isArray(s.data))return AN(s.data)})(n);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof n[Symbol.toPrimitive]=="function")return Xt.from(n[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}function q$(n){if(typeof n!="number")throw new TypeError('"size" argument must be of type number');if(n<0)throw new RangeError('The value "'+n+'" is invalid for option "size"')}function jN(n){return q$(n),Eu(n<0?0:0|WN(n))}function AN(n){for(var t=n.length<0?0:0|WN(n.length),e=Eu(t),r=0;r<t;r+=1)e[r]=255&n[r];return e}function w$(n,t,e){if(t<0||n.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(n.byteLength<t+(e||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=t===void 0&&e===void 0?new Uint8Array(n):e===void 0?new Uint8Array(n,t):new Uint8Array(n,t,e),Object.setPrototypeOf(r,Xt.prototype),r}function WN(n){if(n>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|n}function Y$(n,t){if(Xt.isBuffer(n))return n.length;if(ArrayBuffer.isView(n)||xu(n,ArrayBuffer))return n.byteLength;if(typeof n!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof n);var e=n.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&e===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return $N(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return Q$(n).length;default:if(i)return r?-1:$N(n).length;t=(""+t).toLowerCase(),i=!0}}function iet(n,t,e){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0)<=(t>>>=0))return"";for(n||(n="utf8");;)switch(n){case"hex":return pet(this,t,e);case"utf8":case"utf-8":return Z$(this,t,e);case"ascii":return fet(this,t,e);case"latin1":case"binary":return det(this,t,e);case"base64":return het(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return get(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function tg(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function A$(n,t,e,r,i){if(n.length===0)return-1;if(typeof e=="string"?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),GN(e=+e)&&(e=i?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(i)return-1;e=n.length-1}else if(e<0){if(!i)return-1;e=0}if(typeof t=="string"&&(t=Xt.from(t,r)),Xt.isBuffer(t))return t.length===0?-1:E$(n,t,e,r,i);if(typeof t=="number")return t&=255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):E$(n,[t],e,r,i);throw new TypeError("val must be string, number or Buffer")}function E$(n,t,e,r,i){var s,a=1,o=n.length,c=t.length;if(r!==void 0&&((r=String(r).toLowerCase())==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||t.length<2)return-1;a=2,o/=2,c/=2,e/=2}function u(p,g){return a===1?p[g]:p.readUInt16BE(g*a)}if(i){var h=-1;for(s=e;s<o;s++)if(u(n,s)===u(t,h===-1?0:s-h)){if(h===-1&&(h=s),s-h+1===c)return h*a}else h!==-1&&(s-=s-h),h=-1}else for(e+c>o&&(e=o-c),s=e;s>=0;s--){for(var f=!0,d=0;d<c;d++)if(u(n,s+d)!==u(t,d)){f=!1;break}if(f)return s}return-1}function set(n,t,e,r){e=Number(e)||0;var i=n.length-e;r?(r=Number(r))>i&&(r=i):r=i;var s=t.length;r>s/2&&(r=s/2);for(var a=0;a<r;++a){var o=parseInt(t.substr(2*a,2),16);if(GN(o))return a;n[e+a]=o}return a}function aet(n,t,e,r){return EC($N(t,n.length-e),n,e,r)}function K$(n,t,e,r){return EC((function(i){for(var s=[],a=0;a<i.length;++a)s.push(255&i.charCodeAt(a));return s})(t),n,e,r)}function oet(n,t,e,r){return K$(n,t,e,r)}function cet(n,t,e,r){return EC(Q$(t),n,e,r)}function uet(n,t,e,r){return EC((function(i,s){for(var a,o,c,u=[],h=0;h<i.length&&!((s-=2)<0);++h)a=i.charCodeAt(h),o=a>>8,c=a%256,u.push(c),u.push(o);return u})(t,n.length-e),n,e,r)}function het(n,t,e){return t===0&&e===n.length?UN.fromByteArray(n):UN.fromByteArray(n.slice(t,e))}function Z$(n,t,e){e=Math.min(n.length,e);for(var r=[],i=t;i<e;){var s,a,o,c,u=n[i],h=null,f=u>239?4:u>223?3:u>191?2:1;if(i+f<=e)switch(f){case 1:u<128&&(h=u);break;case 2:(192&(s=n[i+1]))==128&&(c=(31&u)<<6|63&s)>127&&(h=c);break;case 3:s=n[i+1],a=n[i+2],(192&s)==128&&(192&a)==128&&(c=(15&u)<<12|(63&s)<<6|63&a)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:s=n[i+1],a=n[i+2],o=n[i+3],(192&s)==128&&(192&a)==128&&(192&o)==128&&(c=(15&u)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&c<1114112&&(h=c)}h===null?(h=65533,f=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),i+=f}return(function(d){var p=d.length;if(p<=4096)return String.fromCharCode.apply(String,d);for(var g="",y=0;y<p;)g+=String.fromCharCode.apply(String,d.slice(y,y+=4096));return g})(r)}function fet(n,t,e){var r="";e=Math.min(n.length,e);for(var i=t;i<e;++i)r+=String.fromCharCode(127&n[i]);return r}function det(n,t,e){var r="";e=Math.min(n.length,e);for(var i=t;i<e;++i)r+=String.fromCharCode(n[i]);return r}function pet(n,t,e){var r=n.length;(!t||t<0)&&(t=0),(!e||e<0||e>r)&&(e=r);for(var i="",s=t;s<e;++s)i+=yet[n[s]];return i}function get(n,t,e){for(var r=n.slice(t,e),i="",s=0;s<r.length;s+=2)i+=String.fromCharCode(r[s]+256*r[s+1]);return i}function wi(n,t,e){if(n%1!=0||n<0)throw new RangeError("offset is not uint");if(n+t>e)throw new RangeError("Trying to access beyond buffer length")}function zs(n,t,e,r,i,s){if(!Xt.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(e+r>n.length)throw new RangeError("Index out of range")}function J$(n,t,e,r,i,s){if(e+r>n.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function x$(n,t,e,r,i){return t=+t,e>>>=0,i||J$(n,0,e,4),U0.write(n,t,e,r,23,4),e+4}function S$(n,t,e,r,i){return t=+t,e>>>=0,i||J$(n,0,e,8),U0.write(n,t,e,r,52,8),e+8}function $N(n,t){var e;t=t||1/0;for(var r=n.length,i=null,s=[],a=0;a<r;++a){if((e=n.charCodeAt(a))>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&s.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;s.push(e)}else if(e<2048){if((t-=2)<0)break;s.push(e>>6|192,63&e|128)}else if(e<65536){if((t-=3)<0)break;s.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return s}function Q$(n){return UN.toByteArray((function(t){if((t=(t=t.split("=")[0]).trim().replace(met,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t})(n))}function EC(n,t,e,r){for(var i=0;i<r&&!(i+e>=t.length||i>=n.length);++i)t[i+e]=n[i];return i}function xu(n,t){return n instanceof t||n!=null&&n.constructor!=null&&n.constructor.name!=null&&n.constructor.name===t.name}function GN(n){return n!=n}function _$(n,t){for(var e in n)t[e]=n[e]}function eg(n,t,e){return ic(n,t,e)}function EE(n){var t;switch(this.encoding=(function(e){var r=(function(i){if(!i)return"utf8";for(var s;;)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(s)return;i=(""+i).toLowerCase(),s=!0}})(e);if(typeof r!="string"&&(zN.isEncoding===T$||!T$(e)))throw new Error("Unknown encoding: "+e);return r||e})(n),this.encoding){case"utf16le":this.text=wet,this.end=Aet,t=4;break;case"utf8":this.fillLast=vet,t=4;break;case"base64":this.text=Eet,this.end=xet,t=3;break;default:return this.write=_et,this.end=Tet,void 0}this.lastNeed=0,this.lastTotal=0,this.lastChar=zN.allocUnsafe(t)}function EN(n){return n<=127?0:n>>5==6?2:n>>4==14?3:n>>3==30?4:n>>6==2?-1:-2}function vet(n){var t=this.lastTotal-this.lastNeed,e=(function(r,i,s){if((192&i[0])!=128)return r.lastNeed=0,"\uFFFD";if(r.lastNeed>1&&i.length>1){if((192&i[1])!=128)return r.lastNeed=1,"\uFFFD";if(r.lastNeed>2&&i.length>2&&(192&i[2])!=128)return r.lastNeed=2,"\uFFFD"}})(this,n);return e!==void 0?e:this.lastNeed<=n.length?(n.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(n.copy(this.lastChar,t,0,n.length),this.lastNeed-=n.length,void 0)}function wet(n,t){if((n.length-t)%2==0){var e=n.toString("utf16le",t);if(e){var r=e.charCodeAt(e.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],e.slice(0,-1)}return e}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",t,n.length-1)}function Aet(n){var t=n&&n.length?this.write(n):"";if(this.lastNeed){var e=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,e)}return t}function Eet(n,t){var e=(n.length-t)%3;return e===0?n.toString("base64",t):(this.lastNeed=3-e,this.lastTotal=3,e===1?this.lastChar[0]=n[n.length-1]:(this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1]),n.toString("base64",t,n.length-e))}function xet(n){var t=n&&n.length?this.write(n):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function _et(n){return n.toString(this.encoding)}function Tet(n){return n&&n.length?this.write(n):""}function Cet(){if(C$)return xE;C$=!0,xE.byteLength=o,xE.toByteArray=u,xE.fromByteArray=d;for(var n=[],t=[],e=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=r.length;i<s;++i)n[i]=r[i],t[r.charCodeAt(i)]=i;t[45]=62,t[95]=63;function a(p){var g=p.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=p.indexOf("=");y===-1&&(y=g);var b=y===g?0:4-y%4;return[y,b]}function o(p){var g=a(p),y=g[0],b=g[1];return(y+b)*3/4-b}function c(p,g,y){return(g+y)*3/4-y}function u(p){var g,y=a(p),b=y[0],m=y[1],w=new e(c(p,b,m)),A=0,_=m>0?b-4:b,S;for(S=0;S<_;S+=4)g=t[p.charCodeAt(S)]<<18|t[p.charCodeAt(S+1)]<<12|t[p.charCodeAt(S+2)]<<6|t[p.charCodeAt(S+3)],w[A++]=g>>16&255,w[A++]=g>>8&255,w[A++]=g&255;return m===2&&(g=t[p.charCodeAt(S)]<<2|t[p.charCodeAt(S+1)]>>4,w[A++]=g&255),m===1&&(g=t[p.charCodeAt(S)]<<10|t[p.charCodeAt(S+1)]<<4|t[p.charCodeAt(S+2)]>>2,w[A++]=g>>8&255,w[A++]=g&255),w}function h(p){return n[p>>18&63]+n[p>>12&63]+n[p>>6&63]+n[p&63]}function f(p,g,y){for(var b,m=[],w=g;w<y;w+=3)b=(p[w]<<16&16711680)+(p[w+1]<<8&65280)+(p[w+2]&255),m.push(h(b));return m.join("")}function d(p){for(var g,y=p.length,b=y%3,m=[],w=16383,A=0,_=y-b;A<_;A+=w)m.push(f(p,A,A+w>_?_:A+w));return b===1?(g=p[y-1],m.push(n[g>>2]+n[g<<4&63]+"==")):b===2&&(g=(p[y-2]<<8)+p[y-1],m.push(n[g>>10]+n[g>>4&63]+n[g<<2&63]+"=")),m.join("")}return xE}function Ret(){if(R$)return bC;R$=!0;return bC.read=function(n,t,e,r,i){var s,a,o=i*8-r-1,c=(1<<o)-1,u=c>>1,h=-7,f=e?i-1:0,d=e?-1:1,p=n[t+f];for(f+=d,s=p&(1<<-h)-1,p>>=-h,h+=o;h>0;s=s*256+n[t+f],f+=d,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=r;h>0;a=a*256+n[t+f],f+=d,h-=8);if(s===0)s=1-u;else{if(s===c)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,r),s=s-u}return(p?-1:1)*a*Math.pow(2,s-r)},bC.write=function(n,t,e,r,i,s){var a,o,c,u=s*8-i-1,h=(1<<u)-1,f=h>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,g=r?1:-1,y=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+f>=1?t+=d/c:t+=d*Math.pow(2,1-f),t*c>=2&&(a++,c/=2),a+f>=h?(o=0,a=h):a+f>=1?(o=(t*c-1)*Math.pow(2,i),a=a+f):(o=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;n[e+p]=o&255,p+=g,o/=256,i-=8);for(a=a<<i|o,u+=i;u>0;n[e+p]=a&255,p+=g,a/=256,u-=8);n[e+p-g]|=y*128},bC}function Iet(){if(I$)return rg;I$=!0;let n=Cet(),t=Ret(),e=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;rg.Buffer=a,rg.SlowBuffer=m,rg.INSPECT_MAX_BYTES=50;let r=2147483647;rg.kMaxLength=r,a.TYPED_ARRAY_SUPPORT=i(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{let O=new Uint8Array(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,Uint8Array.prototype),Object.setPrototypeOf(O,v),O.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(O){if(O>r)throw new RangeError('The value "'+O+'" is invalid for option "size"');let v=new Uint8Array(O);return Object.setPrototypeOf(v,a.prototype),v}function a(O,v,E){if(typeof O=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(O)}return o(O,v,E)}a.poolSize=8192;function o(O,v,E){if(typeof O=="string")return f(O,v);if(ArrayBuffer.isView(O))return p(O);if(O==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O);if(Nt(O,ArrayBuffer)||O&&Nt(O.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Nt(O,SharedArrayBuffer)||O&&Nt(O.buffer,SharedArrayBuffer)))return g(O,v,E);if(typeof O=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let B=O.valueOf&&O.valueOf();if(B!=null&&B!==O)return a.from(B,v,E);let it=y(O);if(it)return it;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof O[Symbol.toPrimitive]=="function")return a.from(O[Symbol.toPrimitive]("string"),v,E);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O)}a.from=function(O,v,E){return o(O,v,E)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function c(O){if(typeof O!="number")throw new TypeError('"size" argument must be of type number');if(O<0)throw new RangeError('The value "'+O+'" is invalid for option "size"')}function u(O,v,E){return c(O),O<=0?s(O):v!==void 0?typeof E=="string"?s(O).fill(v,E):s(O).fill(v):s(O)}a.alloc=function(O,v,E){return u(O,v,E)};function h(O){return c(O),s(O<0?0:b(O)|0)}a.allocUnsafe=function(O){return h(O)},a.allocUnsafeSlow=function(O){return h(O)};function f(O,v){if((typeof v!="string"||v==="")&&(v="utf8"),!a.isEncoding(v))throw new TypeError("Unknown encoding: "+v);let E=w(O,v)|0,B=s(E),it=B.write(O,v);return it!==E&&(B=B.slice(0,it)),B}function d(O){let v=O.length<0?0:b(O.length)|0,E=s(v);for(let B=0;B<v;B+=1)E[B]=O[B]&255;return E}function p(O){if(Nt(O,Uint8Array)){let v=new Uint8Array(O);return g(v.buffer,v.byteOffset,v.byteLength)}return d(O)}function g(O,v,E){if(v<0||O.byteLength<v)throw new RangeError('"offset" is outside of buffer bounds');if(O.byteLength<v+(E||0))throw new RangeError('"length" is outside of buffer bounds');let B;return v===void 0&&E===void 0?B=new Uint8Array(O):E===void 0?B=new Uint8Array(O,v):B=new Uint8Array(O,v,E),Object.setPrototypeOf(B,a.prototype),B}function y(O){if(a.isBuffer(O)){let v=b(O.length)|0,E=s(v);return E.length===0||O.copy(E,0,0,v),E}if(O.length!==void 0)return typeof O.length!="number"||Ot(O.length)?s(0):d(O);if(O.type==="Buffer"&&Array.isArray(O.data))return d(O.data)}function b(O){if(O>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return O|0}function m(O){return+O!=O&&(O=0),a.alloc(+O)}a.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==a.prototype},a.compare=function(v,E){if(Nt(v,Uint8Array)&&(v=a.from(v,v.offset,v.byteLength)),Nt(E,Uint8Array)&&(E=a.from(E,E.offset,E.byteLength)),!a.isBuffer(v)||!a.isBuffer(E))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===E)return 0;let B=v.length,it=E.length;for(let k=0,ct=Math.min(B,it);k<ct;++k)if(v[k]!==E[k]){B=v[k],it=E[k];break}return B<it?-1:it<B?1:0},a.isEncoding=function(v){switch(String(v).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(v,E){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return a.alloc(0);let B;if(E===void 0)for(E=0,B=0;B<v.length;++B)E+=v[B].length;let it=a.allocUnsafe(E),k=0;for(B=0;B<v.length;++B){let ct=v[B];if(Nt(ct,Uint8Array))k+ct.length>it.length?(a.isBuffer(ct)||(ct=a.from(ct)),ct.copy(it,k)):Uint8Array.prototype.set.call(it,ct,k);else if(a.isBuffer(ct))ct.copy(it,k);else throw new TypeError('"list" argument must be an Array of Buffers');k+=ct.length}return it};function w(O,v){if(a.isBuffer(O))return O.length;if(ArrayBuffer.isView(O)||Nt(O,ArrayBuffer))return O.byteLength;if(typeof O!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof O);let E=O.length,B=arguments.length>2&&arguments[2]===!0;if(!B&&E===0)return 0;let it=!1;for(;;)switch(v){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return _t(O).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return xt(O).length;default:if(it)return B?-1:_t(O).length;v=(""+v).toLowerCase(),it=!0}}a.byteLength=w;function A(O,v,E){let B=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((E===void 0||E>this.length)&&(E=this.length),E<=0)||(E>>>=0,v>>>=0,E<=v))return"";for(O||(O="utf8");;)switch(O){case"hex":return D(this,v,E);case"utf8":case"utf-8":return j(this,v,E);case"ascii":return J(this,v,E);case"latin1":case"binary":return N(this,v,E);case"base64":return L(this,v,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,v,E);default:if(B)throw new TypeError("Unknown encoding: "+O);O=(O+"").toLowerCase(),B=!0}}a.prototype._isBuffer=!0;function _(O,v,E){let B=O[v];O[v]=O[E],O[E]=B}a.prototype.swap16=function(){let v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let E=0;E<v;E+=2)_(this,E,E+1);return this},a.prototype.swap32=function(){let v=this.length;if(v%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let E=0;E<v;E+=4)_(this,E,E+3),_(this,E+1,E+2);return this},a.prototype.swap64=function(){let v=this.length;if(v%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let E=0;E<v;E+=8)_(this,E,E+7),_(this,E+1,E+6),_(this,E+2,E+5),_(this,E+3,E+4);return this},a.prototype.toString=function(){let v=this.length;return v===0?"":arguments.length===0?j(this,0,v):A.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(v){if(!a.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v?!0:a.compare(this,v)===0},a.prototype.inspect=function(){let v="",E=rg.INSPECT_MAX_BYTES;return v=this.toString("hex",0,E).replace(/(.{2})/g,"$1 ").trim(),this.length>E&&(v+=" ... "),"<Buffer "+v+">"},e&&(a.prototype[e]=a.prototype.inspect),a.prototype.compare=function(v,E,B,it,k){if(Nt(v,Uint8Array)&&(v=a.from(v,v.offset,v.byteLength)),!a.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(E===void 0&&(E=0),B===void 0&&(B=v?v.length:0),it===void 0&&(it=0),k===void 0&&(k=this.length),E<0||B>v.length||it<0||k>this.length)throw new RangeError("out of range index");if(it>=k&&E>=B)return 0;if(it>=k)return-1;if(E>=B)return 1;if(E>>>=0,B>>>=0,it>>>=0,k>>>=0,this===v)return 0;let ct=k-it,mt=B-E,St=Math.min(ct,mt),Et=this.slice(it,k),Dt=v.slice(E,B);for(let et=0;et<St;++et)if(Et[et]!==Dt[et]){ct=Et[et],mt=Dt[et];break}return ct<mt?-1:mt<ct?1:0};function S(O,v,E,B,it){if(O.length===0)return-1;if(typeof E=="string"?(B=E,E=0):E>2147483647?E=2147483647:E<-2147483648&&(E=-2147483648),E=+E,Ot(E)&&(E=it?0:O.length-1),E<0&&(E=O.length+E),E>=O.length){if(it)return-1;E=O.length-1}else if(E<0)if(it)E=0;else return-1;if(typeof v=="string"&&(v=a.from(v,B)),a.isBuffer(v))return v.length===0?-1:I(O,v,E,B,it);if(typeof v=="number")return v=v&255,typeof Uint8Array.prototype.indexOf=="function"?it?Uint8Array.prototype.indexOf.call(O,v,E):Uint8Array.prototype.lastIndexOf.call(O,v,E):I(O,[v],E,B,it);throw new TypeError("val must be string, number or Buffer")}function I(O,v,E,B,it){let k=1,ct=O.length,mt=v.length;if(B!==void 0&&(B=String(B).toLowerCase(),B==="ucs2"||B==="ucs-2"||B==="utf16le"||B==="utf-16le")){if(O.length<2||v.length<2)return-1;k=2,ct/=2,mt/=2,E/=2}function St(Dt,et){return k===1?Dt[et]:Dt.readUInt16BE(et*k)}let Et;if(it){let Dt=-1;for(Et=E;Et<ct;Et++)if(St(O,Et)===St(v,Dt===-1?0:Et-Dt)){if(Dt===-1&&(Dt=Et),Et-Dt+1===mt)return Dt*k}else Dt!==-1&&(Et-=Et-Dt),Dt=-1}else for(E+mt>ct&&(E=ct-mt),Et=E;Et>=0;Et--){let Dt=!0;for(let et=0;et<mt;et++)if(St(O,Et+et)!==St(v,et)){Dt=!1;break}if(Dt)return Et}return-1}a.prototype.includes=function(v,E,B){return this.indexOf(v,E,B)!==-1},a.prototype.indexOf=function(v,E,B){return S(this,v,E,B,!0)},a.prototype.lastIndexOf=function(v,E,B){return S(this,v,E,B,!1)};function C(O,v,E,B){E=Number(E)||0;let it=O.length-E;B?(B=Number(B),B>it&&(B=it)):B=it;let k=v.length;B>k/2&&(B=k/2);let ct;for(ct=0;ct<B;++ct){let mt=parseInt(v.substr(ct*2,2),16);if(Ot(mt))return ct;O[E+ct]=mt}return ct}function M(O,v,E,B){return $t(_t(v,O.length-E),O,E,B)}function z(O,v,E,B){return $t(At(v),O,E,B)}function G(O,v,E,B){return $t(xt(v),O,E,B)}function Y(O,v,E,B){return $t(gt(v,O.length-E),O,E,B)}a.prototype.write=function(v,E,B,it){if(E===void 0)it="utf8",B=this.length,E=0;else if(B===void 0&&typeof E=="string")it=E,B=this.length,E=0;else if(isFinite(E))E=E>>>0,isFinite(B)?(B=B>>>0,it===void 0&&(it="utf8")):(it=B,B=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let k=this.length-E;if((B===void 0||B>k)&&(B=k),v.length>0&&(B<0||E<0)||E>this.length)throw new RangeError("Attempt to write outside buffer bounds");it||(it="utf8");let ct=!1;for(;;)switch(it){case"hex":return C(this,v,E,B);case"utf8":case"utf-8":return M(this,v,E,B);case"ascii":case"latin1":case"binary":return z(this,v,E,B);case"base64":return G(this,v,E,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,v,E,B);default:if(ct)throw new TypeError("Unknown encoding: "+it);it=(""+it).toLowerCase(),ct=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(O,v,E){return v===0&&E===O.length?n.fromByteArray(O):n.fromByteArray(O.slice(v,E))}function j(O,v,E){E=Math.min(O.length,E);let B=[],it=v;for(;it<E;){let k=O[it],ct=null,mt=k>239?4:k>223?3:k>191?2:1;if(it+mt<=E){let St,Et,Dt,et;switch(mt){case 1:k<128&&(ct=k);break;case 2:St=O[it+1],(St&192)===128&&(et=(k&31)<<6|St&63,et>127&&(ct=et));break;case 3:St=O[it+1],Et=O[it+2],(St&192)===128&&(Et&192)===128&&(et=(k&15)<<12|(St&63)<<6|Et&63,et>2047&&(et<55296||et>57343)&&(ct=et));break;case 4:St=O[it+1],Et=O[it+2],Dt=O[it+3],(St&192)===128&&(Et&192)===128&&(Dt&192)===128&&(et=(k&15)<<18|(St&63)<<12|(Et&63)<<6|Dt&63,et>65535&&et<1114112&&(ct=et))}}ct===null?(ct=65533,mt=1):ct>65535&&(ct-=65536,B.push(ct>>>10&1023|55296),ct=56320|ct&1023),B.push(ct),it+=mt}return nt(B)}let q=4096;function nt(O){let v=O.length;if(v<=q)return String.fromCharCode.apply(String,O);let E="",B=0;for(;B<v;)E+=String.fromCharCode.apply(String,O.slice(B,B+=q));return E}function J(O,v,E){let B="";E=Math.min(O.length,E);for(let it=v;it<E;++it)B+=String.fromCharCode(O[it]&127);return B}function N(O,v,E){let B="";E=Math.min(O.length,E);for(let it=v;it<E;++it)B+=String.fromCharCode(O[it]);return B}function D(O,v,E){let B=O.length;(!v||v<0)&&(v=0),(!E||E<0||E>B)&&(E=B);let it="";for(let k=v;k<E;++k)it+=qt[O[k]];return it}function F(O,v,E){let B=O.slice(v,E),it="";for(let k=0;k<B.length-1;k+=2)it+=String.fromCharCode(B[k]+B[k+1]*256);return it}a.prototype.slice=function(v,E){let B=this.length;v=~~v,E=E===void 0?B:~~E,v<0?(v+=B,v<0&&(v=0)):v>B&&(v=B),E<0?(E+=B,E<0&&(E=0)):E>B&&(E=B),E<v&&(E=v);let it=this.subarray(v,E);return Object.setPrototypeOf(it,a.prototype),it};function P(O,v,E){if(O%1!==0||O<0)throw new RangeError("offset is not uint");if(O+v>E)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(v,E,B){v=v>>>0,E=E>>>0,B||P(v,E,this.length);let it=this[v],k=1,ct=0;for(;++ct<E&&(k*=256);)it+=this[v+ct]*k;return it},a.prototype.readUintBE=a.prototype.readUIntBE=function(v,E,B){v=v>>>0,E=E>>>0,B||P(v,E,this.length);let it=this[v+--E],k=1;for(;E>0&&(k*=256);)it+=this[v+--E]*k;return it},a.prototype.readUint8=a.prototype.readUInt8=function(v,E){return v=v>>>0,E||P(v,1,this.length),this[v]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(v,E){return v=v>>>0,E||P(v,2,this.length),this[v]|this[v+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(v,E){return v=v>>>0,E||P(v,2,this.length),this[v]<<8|this[v+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(v,E){return v=v>>>0,E||P(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(v,E){return v=v>>>0,E||P(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},a.prototype.readBigUInt64LE=Jt(function(v){v=v>>>0,Q(v,"offset");let E=this[v],B=this[v+7];(E===void 0||B===void 0)&&W(v,this.length-8);let it=E+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24,k=this[++v]+this[++v]*2**8+this[++v]*2**16+B*2**24;return BigInt(it)+(BigInt(k)<<BigInt(32))}),a.prototype.readBigUInt64BE=Jt(function(v){v=v>>>0,Q(v,"offset");let E=this[v],B=this[v+7];(E===void 0||B===void 0)&&W(v,this.length-8);let it=E*2**24+this[++v]*2**16+this[++v]*2**8+this[++v],k=this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+B;return(BigInt(it)<<BigInt(32))+BigInt(k)}),a.prototype.readIntLE=function(v,E,B){v=v>>>0,E=E>>>0,B||P(v,E,this.length);let it=this[v],k=1,ct=0;for(;++ct<E&&(k*=256);)it+=this[v+ct]*k;return k*=128,it>=k&&(it-=Math.pow(2,8*E)),it},a.prototype.readIntBE=function(v,E,B){v=v>>>0,E=E>>>0,B||P(v,E,this.length);let it=E,k=1,ct=this[v+--it];for(;it>0&&(k*=256);)ct+=this[v+--it]*k;return k*=128,ct>=k&&(ct-=Math.pow(2,8*E)),ct},a.prototype.readInt8=function(v,E){return v=v>>>0,E||P(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},a.prototype.readInt16LE=function(v,E){v=v>>>0,E||P(v,2,this.length);let B=this[v]|this[v+1]<<8;return B&32768?B|4294901760:B},a.prototype.readInt16BE=function(v,E){v=v>>>0,E||P(v,2,this.length);let B=this[v+1]|this[v]<<8;return B&32768?B|4294901760:B},a.prototype.readInt32LE=function(v,E){return v=v>>>0,E||P(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},a.prototype.readInt32BE=function(v,E){return v=v>>>0,E||P(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},a.prototype.readBigInt64LE=Jt(function(v){v=v>>>0,Q(v,"offset");let E=this[v],B=this[v+7];(E===void 0||B===void 0)&&W(v,this.length-8);let it=this[v+4]+this[v+5]*2**8+this[v+6]*2**16+(B<<24);return(BigInt(it)<<BigInt(32))+BigInt(E+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24)}),a.prototype.readBigInt64BE=Jt(function(v){v=v>>>0,Q(v,"offset");let E=this[v],B=this[v+7];(E===void 0||B===void 0)&&W(v,this.length-8);let it=(E<<24)+this[++v]*2**16+this[++v]*2**8+this[++v];return(BigInt(it)<<BigInt(32))+BigInt(this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+B)}),a.prototype.readFloatLE=function(v,E){return v=v>>>0,E||P(v,4,this.length),t.read(this,v,!0,23,4)},a.prototype.readFloatBE=function(v,E){return v=v>>>0,E||P(v,4,this.length),t.read(this,v,!1,23,4)},a.prototype.readDoubleLE=function(v,E){return v=v>>>0,E||P(v,8,this.length),t.read(this,v,!0,52,8)},a.prototype.readDoubleBE=function(v,E){return v=v>>>0,E||P(v,8,this.length),t.read(this,v,!1,52,8)};function V(O,v,E,B,it,k){if(!a.isBuffer(O))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>it||v<k)throw new RangeError('"value" argument is out of bounds');if(E+B>O.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(v,E,B,it){if(v=+v,E=E>>>0,B=B>>>0,!it){let mt=Math.pow(2,8*B)-1;V(this,v,E,B,mt,0)}let k=1,ct=0;for(this[E]=v&255;++ct<B&&(k*=256);)this[E+ct]=v/k&255;return E+B},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(v,E,B,it){if(v=+v,E=E>>>0,B=B>>>0,!it){let mt=Math.pow(2,8*B)-1;V(this,v,E,B,mt,0)}let k=B-1,ct=1;for(this[E+k]=v&255;--k>=0&&(ct*=256);)this[E+k]=v/ct&255;return E+B},a.prototype.writeUint8=a.prototype.writeUInt8=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,1,255,0),this[E]=v&255,E+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,2,65535,0),this[E]=v&255,this[E+1]=v>>>8,E+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,2,65535,0),this[E]=v>>>8,this[E+1]=v&255,E+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,4,4294967295,0),this[E+3]=v>>>24,this[E+2]=v>>>16,this[E+1]=v>>>8,this[E]=v&255,E+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,4,4294967295,0),this[E]=v>>>24,this[E+1]=v>>>16,this[E+2]=v>>>8,this[E+3]=v&255,E+4};function $(O,v,E,B,it){wt(v,B,it,O,E,7);let k=Number(v&BigInt(4294967295));O[E++]=k,k=k>>8,O[E++]=k,k=k>>8,O[E++]=k,k=k>>8,O[E++]=k;let ct=Number(v>>BigInt(32)&BigInt(4294967295));return O[E++]=ct,ct=ct>>8,O[E++]=ct,ct=ct>>8,O[E++]=ct,ct=ct>>8,O[E++]=ct,E}function H(O,v,E,B,it){wt(v,B,it,O,E,7);let k=Number(v&BigInt(4294967295));O[E+7]=k,k=k>>8,O[E+6]=k,k=k>>8,O[E+5]=k,k=k>>8,O[E+4]=k;let ct=Number(v>>BigInt(32)&BigInt(4294967295));return O[E+3]=ct,ct=ct>>8,O[E+2]=ct,ct=ct>>8,O[E+1]=ct,ct=ct>>8,O[E]=ct,E+8}a.prototype.writeBigUInt64LE=Jt(function(v,E=0){return $(this,v,E,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Jt(function(v,E=0){return H(this,v,E,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(v,E,B,it){if(v=+v,E=E>>>0,!it){let St=Math.pow(2,8*B-1);V(this,v,E,B,St-1,-St)}let k=0,ct=1,mt=0;for(this[E]=v&255;++k<B&&(ct*=256);)v<0&&mt===0&&this[E+k-1]!==0&&(mt=1),this[E+k]=(v/ct>>0)-mt&255;return E+B},a.prototype.writeIntBE=function(v,E,B,it){if(v=+v,E=E>>>0,!it){let St=Math.pow(2,8*B-1);V(this,v,E,B,St-1,-St)}let k=B-1,ct=1,mt=0;for(this[E+k]=v&255;--k>=0&&(ct*=256);)v<0&&mt===0&&this[E+k+1]!==0&&(mt=1),this[E+k]=(v/ct>>0)-mt&255;return E+B},a.prototype.writeInt8=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,1,127,-128),v<0&&(v=255+v+1),this[E]=v&255,E+1},a.prototype.writeInt16LE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,2,32767,-32768),this[E]=v&255,this[E+1]=v>>>8,E+2},a.prototype.writeInt16BE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,2,32767,-32768),this[E]=v>>>8,this[E+1]=v&255,E+2},a.prototype.writeInt32LE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,4,2147483647,-2147483648),this[E]=v&255,this[E+1]=v>>>8,this[E+2]=v>>>16,this[E+3]=v>>>24,E+4},a.prototype.writeInt32BE=function(v,E,B){return v=+v,E=E>>>0,B||V(this,v,E,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[E]=v>>>24,this[E+1]=v>>>16,this[E+2]=v>>>8,this[E+3]=v&255,E+4},a.prototype.writeBigInt64LE=Jt(function(v,E=0){return $(this,v,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Jt(function(v,E=0){return H(this,v,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function rt(O,v,E,B,it,k){if(E+B>O.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function lt(O,v,E,B,it){return v=+v,E=E>>>0,it||rt(O,v,E,4),t.write(O,v,E,B,23,4),E+4}a.prototype.writeFloatLE=function(v,E,B){return lt(this,v,E,!0,B)},a.prototype.writeFloatBE=function(v,E,B){return lt(this,v,E,!1,B)};function ft(O,v,E,B,it){return v=+v,E=E>>>0,it||rt(O,v,E,8),t.write(O,v,E,B,52,8),E+8}a.prototype.writeDoubleLE=function(v,E,B){return ft(this,v,E,!0,B)},a.prototype.writeDoubleBE=function(v,E,B){return ft(this,v,E,!1,B)},a.prototype.copy=function(v,E,B,it){if(!a.isBuffer(v))throw new TypeError("argument should be a Buffer");if(B||(B=0),!it&&it!==0&&(it=this.length),E>=v.length&&(E=v.length),E||(E=0),it>0&&it<B&&(it=B),it===B||v.length===0||this.length===0)return 0;if(E<0)throw new RangeError("targetStart out of bounds");if(B<0||B>=this.length)throw new RangeError("Index out of range");if(it<0)throw new RangeError("sourceEnd out of bounds");it>this.length&&(it=this.length),v.length-E<it-B&&(it=v.length-E+B);let k=it-B;return this===v&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(E,B,it):Uint8Array.prototype.set.call(v,this.subarray(B,it),E),k},a.prototype.fill=function(v,E,B,it){if(typeof v=="string"){if(typeof E=="string"?(it=E,E=0,B=this.length):typeof B=="string"&&(it=B,B=this.length),it!==void 0&&typeof it!="string")throw new TypeError("encoding must be a string");if(typeof it=="string"&&!a.isEncoding(it))throw new TypeError("Unknown encoding: "+it);if(v.length===1){let ct=v.charCodeAt(0);(it==="utf8"&&ct<128||it==="latin1")&&(v=ct)}}else typeof v=="number"?v=v&255:typeof v=="boolean"&&(v=Number(v));if(E<0||this.length<E||this.length<B)throw new RangeError("Out of range index");if(B<=E)return this;E=E>>>0,B=B===void 0?this.length:B>>>0,v||(v=0);let k;if(typeof v=="number")for(k=E;k<B;++k)this[k]=v;else{let ct=a.isBuffer(v)?v:a.from(v,it),mt=ct.length;if(mt===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(k=0;k<B-E;++k)this[k+E]=ct[k%mt]}return this};let K={};function X(O,v,E){K[O]=class extends E{constructor(){super(),Object.defineProperty(this,"message",{value:v.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${O}]`,this.stack,delete this.name}get code(){return O}set code(it){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:it,writable:!0})}toString(){return`${this.name} [${O}]: ${this.message}`}}}X("ERR_BUFFER_OUT_OF_BOUNDS",function(O){return O?`${O} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),X("ERR_INVALID_ARG_TYPE",function(O,v){return`The "${O}" argument must be of type number. Received type ${typeof v}`},TypeError),X("ERR_OUT_OF_RANGE",function(O,v,E){let B=`The value of "${O}" is out of range.`,it=E;return Number.isInteger(E)&&Math.abs(E)>2**32?it=st(String(E)):typeof E=="bigint"&&(it=String(E),(E>BigInt(2)**BigInt(32)||E<-(BigInt(2)**BigInt(32)))&&(it=st(it)),it+="n"),B+=` It must be ${v}. Received ${it}`,B},RangeError);function st(O){let v="",E=O.length,B=O[0]==="-"?1:0;for(;E>=B+4;E-=3)v=`_${O.slice(E-3,E)}${v}`;return`${O.slice(0,E)}${v}`}function bt(O,v,E){Q(v,"offset"),(O[v]===void 0||O[v+E]===void 0)&&W(v,O.length-(E+1))}function wt(O,v,E,B,it,k){if(O>E||O<v){let ct=typeof v=="bigint"?"n":"",mt;throw v===0||v===BigInt(0)?mt=`>= 0${ct} and < 2${ct} ** ${(k+1)*8}${ct}`:mt=`>= -(2${ct} ** ${(k+1)*8-1}${ct}) and < 2 ** ${(k+1)*8-1}${ct}`,new K.ERR_OUT_OF_RANGE("value",mt,O)}bt(B,it,k)}function Q(O,v){if(typeof O!="number")throw new K.ERR_INVALID_ARG_TYPE(v,"number",O)}function W(O,v,E){throw Math.floor(O)!==O?(Q(O,E),new K.ERR_OUT_OF_RANGE("offset","an integer",O)):v<0?new K.ERR_BUFFER_OUT_OF_BOUNDS:new K.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${v}`,O)}let at=/[^+/0-9A-Za-z-_]/g;function pt(O){if(O=O.split("=")[0],O=O.trim().replace(at,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function _t(O,v){v=v||1/0;let E,B=O.length,it=null,k=[];for(let ct=0;ct<B;++ct){if(E=O.charCodeAt(ct),E>55295&&E<57344){if(!it){if(E>56319){(v-=3)>-1&&k.push(239,191,189);continue}else if(ct+1===B){(v-=3)>-1&&k.push(239,191,189);continue}it=E;continue}if(E<56320){(v-=3)>-1&&k.push(239,191,189),it=E;continue}E=(it-55296<<10|E-56320)+65536}else it&&(v-=3)>-1&&k.push(239,191,189);if(it=null,E<128){if((v-=1)<0)break;k.push(E)}else if(E<2048){if((v-=2)<0)break;k.push(E>>6|192,E&63|128)}else if(E<65536){if((v-=3)<0)break;k.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((v-=4)<0)break;k.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return k}function At(O){let v=[];for(let E=0;E<O.length;++E)v.push(O.charCodeAt(E)&255);return v}function gt(O,v){let E,B,it,k=[];for(let ct=0;ct<O.length&&!((v-=2)<0);++ct)E=O.charCodeAt(ct),B=E>>8,it=E%256,k.push(it),k.push(B);return k}function xt(O){return n.toByteArray(pt(O))}function $t(O,v,E,B){let it;for(it=0;it<B&&!(it+E>=v.length||it>=O.length);++it)v[it+E]=O[it];return it}function Nt(O,v){return O instanceof v||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===v.name}function Ot(O){return O!==O}let qt=(function(){let O="0123456789abcdef",v=new Array(256);for(let E=0;E<16;++E){let B=E*16;for(let it=0;it<16;++it)v[B+it]=O[E]+O[it]}return v})();function Jt(O){return typeof BigInt>"u"?te:O}function te(){throw new Error("BigInt not supported")}return rg}function ig(){return D$||(D$=!0,typeof Object.create=="function"?vC=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:vC=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}),vC}function t9(){return O$||(O$=!0,xN=oi.EventEmitter),xN}function Det(){if(P$)return SN;P$=!0;function n(d,p){var g=Object.keys(d);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(d);p&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(d,b).enumerable})),g.push.apply(g,y)}return g}function t(d){for(var p=1;p<arguments.length;p++){var g=arguments[p]!=null?arguments[p]:{};p%2?n(Object(g),!0).forEach(function(y){e(d,y,g[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(g)):n(Object(g)).forEach(function(y){Object.defineProperty(d,y,Object.getOwnPropertyDescriptor(g,y))})}return d}function e(d,p,g){return p in d?Object.defineProperty(d,p,{value:g,enumerable:!0,configurable:!0,writable:!0}):d[p]=g,d}function r(d,p){if(!(d instanceof p))throw new TypeError("Cannot call a class as a function")}function i(d,p){for(var g=0;g<p.length;g++){var y=p[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(d,y.key,y)}}function s(d,p,g){return p&&i(d.prototype,p),d}var a=j0,o=a.Buffer,c=zt,u=c.inspect,h=u&&u.custom||"inspect";function f(d,p,g){o.prototype.copy.call(d,p,g)}return SN=(function(){function d(){r(this,d),this.head=null,this.tail=null,this.length=0}return s(d,[{key:"push",value:function(g){var y={data:g,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}},{key:"unshift",value:function(g){var y={data:g,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}},{key:"shift",value:function(){if(this.length!==0){var g=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,g}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(g){if(this.length===0)return"";for(var y=this.head,b=""+y.data;y=y.next;)b+=g+y.data;return b}},{key:"concat",value:function(g){if(this.length===0)return o.alloc(0);for(var y=o.allocUnsafe(g>>>0),b=this.head,m=0;b;)f(b.data,y,m),m+=b.data.length,b=b.next;return y}},{key:"consume",value:function(g,y){var b;return g<this.head.data.length?(b=this.head.data.slice(0,g),this.head.data=this.head.data.slice(g)):g===this.head.data.length?b=this.shift():b=y?this._getString(g):this._getBuffer(g),b}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(g){var y=this.head,b=1,m=y.data;for(g-=m.length;y=y.next;){var w=y.data,A=g>w.length?w.length:g;if(A===w.length?m+=w:m+=w.slice(0,g),g-=A,g===0){A===w.length?(++b,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=w.slice(A));break}++b}return this.length-=b,m}},{key:"_getBuffer",value:function(g){var y=o.allocUnsafe(g),b=this.head,m=1;for(b.data.copy(y),g-=b.data.length;b=b.next;){var w=b.data,A=g>w.length?w.length:g;if(w.copy(y,y.length-g,0,A),g-=A,g===0){A===w.length?(++m,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=w.slice(A));break}++m}return this.length-=m,y}},{key:h,value:function(g,y){return u(this,t({},y,{depth:0,customInspect:!1}))}}]),d})(),SN}function e9(){if(N$)return _N;N$=!0;var n=pr;function t(o,c){var u=this,h=this._readableState&&this._readableState.destroyed,f=this._writableState&&this._writableState.destroyed;return h||f?(c?c(o):o&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,o)):n.nextTick(s,this,o)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(o||null,function(d){!c&&d?u._writableState?u._writableState.errorEmitted?n.nextTick(r,u):(u._writableState.errorEmitted=!0,n.nextTick(e,u,d)):n.nextTick(e,u,d):c?(n.nextTick(r,u),c(d)):n.nextTick(r,u)}),this)}function e(o,c){s(o,c),r(o)}function r(o){o._writableState&&!o._writableState.emitClose||o._readableState&&!o._readableState.emitClose||o.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 s(o,c){o.emit("error",c)}function a(o,c){var u=o._readableState,h=o._writableState;u&&u.autoDestroy||h&&h.autoDestroy?o.destroy(c):o.emit("error",c)}return _N={destroy:t,undestroy:i,errorOrDestroy:a},_N}function $0(){if(L$)return TN;L$=!0;let n={};function t(a,o,c){c||(c=Error);function u(f,d,p){return typeof o=="string"?o:o(f,d,p)}class h extends c{constructor(d,p,g){super(u(d,p,g))}}h.prototype.name=c.name,h.prototype.code=a,n[a]=h}function e(a,o){if(Array.isArray(a)){let c=a.length;return a=a.map(u=>String(u)),c>2?`one of ${o} ${a.slice(0,c-1).join(", ")}, or `+a[c-1]:c===2?`one of ${o} ${a[0]} or ${a[1]}`:`of ${o} ${a[0]}`}else return`of ${o} ${String(a)}`}function r(a,o,c){return a.substr(0,o.length)===o}function i(a,o,c){return(c===void 0||c>a.length)&&(c=a.length),a.substring(c-o.length,c)===o}function s(a,o,c){return typeof c!="number"&&(c=0),c+o.length>a.length?!1:a.indexOf(o,c)!==-1}return t("ERR_INVALID_OPT_VALUE",function(a,o){return'The value "'+o+'" is invalid for option "'+a+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(a,o,c){let u;typeof o=="string"&&r(o,"not ")?(u="must not be",o=o.replace(/^not /,"")):u="must be";let h;if(i(a," argument"))h=`The ${a} ${u} ${e(o,"type")}`;else{let f=s(a,".")?"property":"argument";h=`The "${a}" ${f} ${u} ${e(o,"type")}`}return h+=`. Received type ${typeof c}`,h},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),TN.codes=n,TN}function r9(){if(k$)return CN;k$=!0;var n=$0().codes.ERR_INVALID_OPT_VALUE;function t(r,i,s){return r.highWaterMark!=null?r.highWaterMark:i?r[s]:null}function e(r,i,s,a){var o=t(i,a,s);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var c=a?s:"highWaterMark";throw new n(c,o)}return Math.floor(o)}return r.objectMode?16:16*1024}return CN={getHighWaterMark:e},CN}function Oet(){if(M$)return RN;M$=!0,RN=n;function n(e,r){if(t("noDeprecation"))return e;var i=!1;function s(){if(!i){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),i=!0}return e.apply(this||IN,arguments)}return s}function t(e){try{if(!IN.localStorage)return!1}catch{return!1}var r=IN.localStorage[e];return r==null?!1:String(r).toLowerCase()==="true"}return RN}function VN(){if(F$)return DN;F$=!0;var n=pr;DN=z;function t(K){var X=this;this.next=null,this.entry=null,this.finish=function(){ft(X,K)}}var e;z.WritableState=C;var r={deprecate:Oet()},i=t9(),s=j0.Buffer,a=Pet.Uint8Array||function(){};function o(K){return s.from(K)}function c(K){return s.isBuffer(K)||K instanceof a}var u=e9(),h=r9(),f=h.getHighWaterMark,d=$0().codes,p=d.ERR_INVALID_ARG_TYPE,g=d.ERR_METHOD_NOT_IMPLEMENTED,y=d.ERR_MULTIPLE_CALLBACK,b=d.ERR_STREAM_CANNOT_PIPE,m=d.ERR_STREAM_DESTROYED,w=d.ERR_STREAM_NULL_VALUES,A=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,S=u.errorOrDestroy;ig()(z,i);function I(){}function C(K,X,st){e=e||ng(),K=K||{},typeof st!="boolean"&&(st=X instanceof e),this.objectMode=!!K.objectMode,st&&(this.objectMode=this.objectMode||!!K.writableObjectMode),this.highWaterMark=f(this,K,"writableHighWaterMark",st),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var bt=K.decodeStrings===!1;this.decodeStrings=!bt,this.defaultEncoding=K.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(wt){N(X,wt)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=K.emitClose!==!1,this.autoDestroy=!!K.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}C.prototype.getBuffer=function(){for(var X=this.bufferedRequest,st=[];X;)st.push(X),X=X.next;return st},(function(){try{Object.defineProperty(C.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var M;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(M=Function.prototype[Symbol.hasInstance],Object.defineProperty(z,Symbol.hasInstance,{value:function(X){return M.call(this,X)?!0:this!==z?!1:X&&X._writableState instanceof C}})):M=function(X){return X instanceof this};function z(K){e=e||ng();var X=this instanceof e;if(!X&&!M.call(z,this))return new z(K);this._writableState=new C(K,this,X),this.writable=!0,K&&(typeof K.write=="function"&&(this._write=K.write),typeof K.writev=="function"&&(this._writev=K.writev),typeof K.destroy=="function"&&(this._destroy=K.destroy),typeof K.final=="function"&&(this._final=K.final)),i.call(this)}z.prototype.pipe=function(){S(this,new b)};function G(K,X){var st=new A;S(K,st),n.nextTick(X,st)}function Y(K,X,st,bt){var wt;return st===null?wt=new w:typeof st!="string"&&!X.objectMode&&(wt=new p("chunk",["string","Buffer"],st)),wt?(S(K,wt),n.nextTick(bt,wt),!1):!0}z.prototype.write=function(K,X,st){var bt=this._writableState,wt=!1,Q=!bt.objectMode&&c(K);return Q&&!s.isBuffer(K)&&(K=o(K)),typeof X=="function"&&(st=X,X=null),Q?X="buffer":X||(X=bt.defaultEncoding),typeof st!="function"&&(st=I),bt.ending?G(this,st):(Q||Y(this,bt,K,st))&&(bt.pendingcb++,wt=j(this,bt,Q,K,X,st)),wt},z.prototype.cork=function(){this._writableState.corked++},z.prototype.uncork=function(){var K=this._writableState;K.corked&&(K.corked--,!K.writing&&!K.corked&&!K.bufferProcessing&&K.bufferedRequest&&P(this,K))},z.prototype.setDefaultEncoding=function(X){if(typeof X=="string"&&(X=X.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((X+"").toLowerCase())>-1))throw new _(X);return this._writableState.defaultEncoding=X,this},Object.defineProperty(z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function L(K,X,st){return!K.objectMode&&K.decodeStrings!==!1&&typeof X=="string"&&(X=s.from(X,st)),X}Object.defineProperty(z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function j(K,X,st,bt,wt,Q){if(!st){var W=L(X,bt,wt);bt!==W&&(st=!0,wt="buffer",bt=W)}var at=X.objectMode?1:bt.length;X.length+=at;var pt=X.length<X.highWaterMark;if(pt||(X.needDrain=!0),X.writing||X.corked){var _t=X.lastBufferedRequest;X.lastBufferedRequest={chunk:bt,encoding:wt,isBuf:st,callback:Q,next:null},_t?_t.next=X.lastBufferedRequest:X.bufferedRequest=X.lastBufferedRequest,X.bufferedRequestCount+=1}else q(K,X,!1,at,bt,wt,Q);return pt}function q(K,X,st,bt,wt,Q,W){X.writelen=bt,X.writecb=W,X.writing=!0,X.sync=!0,X.destroyed?X.onwrite(new m("write")):st?K._writev(wt,X.onwrite):K._write(wt,Q,X.onwrite),X.sync=!1}function nt(K,X,st,bt,wt){--X.pendingcb,st?(n.nextTick(wt,bt),n.nextTick(rt,K,X),K._writableState.errorEmitted=!0,S(K,bt)):(wt(bt),K._writableState.errorEmitted=!0,S(K,bt),rt(K,X))}function J(K){K.writing=!1,K.writecb=null,K.length-=K.writelen,K.writelen=0}function N(K,X){var st=K._writableState,bt=st.sync,wt=st.writecb;if(typeof wt!="function")throw new y;if(J(st),X)nt(K,st,bt,X,wt);else{var Q=V(st)||K.destroyed;!Q&&!st.corked&&!st.bufferProcessing&&st.bufferedRequest&&P(K,st),bt?n.nextTick(D,K,st,Q,wt):D(K,st,Q,wt)}}function D(K,X,st,bt){st||F(K,X),X.pendingcb--,bt(),rt(K,X)}function F(K,X){X.length===0&&X.needDrain&&(X.needDrain=!1,K.emit("drain"))}function P(K,X){X.bufferProcessing=!0;var st=X.bufferedRequest;if(K._writev&&st&&st.next){var bt=X.bufferedRequestCount,wt=new Array(bt),Q=X.corkedRequestsFree;Q.entry=st;for(var W=0,at=!0;st;)wt[W]=st,st.isBuf||(at=!1),st=st.next,W+=1;wt.allBuffers=at,q(K,X,!0,X.length,wt,"",Q.finish),X.pendingcb++,X.lastBufferedRequest=null,Q.next?(X.corkedRequestsFree=Q.next,Q.next=null):X.corkedRequestsFree=new t(X),X.bufferedRequestCount=0}else{for(;st;){var pt=st.chunk,_t=st.encoding,At=st.callback,gt=X.objectMode?1:pt.length;if(q(K,X,!1,gt,pt,_t,At),st=st.next,X.bufferedRequestCount--,X.writing)break}st===null&&(X.lastBufferedRequest=null)}X.bufferedRequest=st,X.bufferProcessing=!1}z.prototype._write=function(K,X,st){st(new g("_write()"))},z.prototype._writev=null,z.prototype.end=function(K,X,st){var bt=this._writableState;return typeof K=="function"?(st=K,K=null,X=null):typeof X=="function"&&(st=X,X=null),K!=null&&this.write(K,X),bt.corked&&(bt.corked=1,this.uncork()),bt.ending||lt(this,bt,st),this},Object.defineProperty(z.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function V(K){return K.ending&&K.length===0&&K.bufferedRequest===null&&!K.finished&&!K.writing}function $(K,X){K._final(function(st){X.pendingcb--,st&&S(K,st),X.prefinished=!0,K.emit("prefinish"),rt(K,X)})}function H(K,X){!X.prefinished&&!X.finalCalled&&(typeof K._final=="function"&&!X.destroyed?(X.pendingcb++,X.finalCalled=!0,n.nextTick($,K,X)):(X.prefinished=!0,K.emit("prefinish")))}function rt(K,X){var st=V(X);if(st&&(H(K,X),X.pendingcb===0&&(X.finished=!0,K.emit("finish"),X.autoDestroy))){var bt=K._readableState;(!bt||bt.autoDestroy&&bt.endEmitted)&&K.destroy()}return st}function lt(K,X,st){X.ending=!0,rt(K,X),st&&(X.finished?n.nextTick(st):K.once("finish",st)),X.ended=!0,K.writable=!1}function ft(K,X,st){var bt=K.entry;for(K.entry=null;bt;){var wt=bt.callback;X.pendingcb--,wt(st),bt=bt.next}X.corkedRequestsFree.next=K}return Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(X){this._writableState&&(this._writableState.destroyed=X)}}),z.prototype.destroy=u.destroy,z.prototype._undestroy=u.undestroy,z.prototype._destroy=function(K,X){X(K)},DN}function ng(){if(B$)return ON;B$=!0;var n=pr,t=Object.keys||function(h){var f=[];for(var d in h)f.push(d);return f};ON=o;var e=XN(),r=VN();ig()(o,e);for(var i=t(r.prototype),s=0;s<i.length;s++){var a=i[s];o.prototype[a]||(o.prototype[a]=r.prototype[a])}function o(h){if(!(this instanceof o))return new o(h);e.call(this,h),r.call(this,h),this.allowHalfOpen=!0,h&&(h.readable===!1&&(this.readable=!1),h.writable===!1&&(this.writable=!1),h.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",c)))}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 c(){this._writableState.ended||n.nextTick(u,this)}function u(h){h.end()}return 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(f){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=f,this._writableState.destroyed=f)}}),ON}function xC(){if(U$)return PN;U$=!0;var n=$0().codes.ERR_STREAM_PREMATURE_CLOSE;function t(s){var a=!1;return function(){if(!a){a=!0;for(var o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];s.apply(this,c)}}}function e(){}function r(s){return s.setHeader&&typeof s.abort=="function"}function i(s,a,o){if(typeof a=="function")return i(s,null,a);a||(a={}),o=t(o||e);var c=a.readable||a.readable!==!1&&s.readable,u=a.writable||a.writable!==!1&&s.writable,h=function(){s.writable||d()},f=s._writableState&&s._writableState.finished,d=function(){u=!1,f=!0,c||o.call(s)},p=s._readableState&&s._readableState.endEmitted,g=function(){c=!1,p=!0,u||o.call(s)},y=function(A){o.call(s,A)},b=function(){var A;if(c&&!p)return(!s._readableState||!s._readableState.ended)&&(A=new n),o.call(s,A);if(u&&!f)return(!s._writableState||!s._writableState.ended)&&(A=new n),o.call(s,A)},m=function(){s.req.on("finish",d)};return r(s)?(s.on("complete",d),s.on("abort",b),s.req?m():s.on("request",m)):u&&!s._writableState&&(s.on("end",h),s.on("close",h)),s.on("end",g),s.on("finish",d),a.error!==!1&&s.on("error",y),s.on("close",b),function(){s.removeListener("complete",d),s.removeListener("abort",b),s.removeListener("request",m),s.req&&s.req.removeListener("finish",d),s.removeListener("end",h),s.removeListener("close",h),s.removeListener("finish",d),s.removeListener("end",g),s.removeListener("error",y),s.removeListener("close",b)}}return PN=i,PN}function Net(){if(j$)return NN;j$=!0;var n=pr,t;function e(w,A,_){return A in w?Object.defineProperty(w,A,{value:_,enumerable:!0,configurable:!0,writable:!0}):w[A]=_,w}var r=xC(),i=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),o=Symbol("ended"),c=Symbol("lastPromise"),u=Symbol("handlePromise"),h=Symbol("stream");function f(w,A){return{value:w,done:A}}function d(w){var A=w[i];if(A!==null){var _=w[h].read();_!==null&&(w[c]=null,w[i]=null,w[s]=null,A(f(_,!1)))}}function p(w){n.nextTick(d,w)}function g(w,A){return function(_,S){w.then(function(){if(A[o]){_(f(void 0,!0));return}A[u](_,S)},S)}}var y=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((t={get stream(){return this[h]},next:function(){var A=this,_=this[a];if(_!==null)return Promise.reject(_);if(this[o])return Promise.resolve(f(void 0,!0));if(this[h].destroyed)return new Promise(function(M,z){n.nextTick(function(){A[a]?z(A[a]):M(f(void 0,!0))})});var S=this[c],I;if(S)I=new Promise(g(S,this));else{var C=this[h].read();if(C!==null)return Promise.resolve(f(C,!1));I=new Promise(this[u])}return this[c]=I,I}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var A=this;return new Promise(function(_,S){A[h].destroy(null,function(I){if(I){S(I);return}_(f(void 0,!0))})})}),t),y),m=function(A){var _,S=Object.create(b,(_={},e(_,h,{value:A,writable:!0}),e(_,i,{value:null,writable:!0}),e(_,s,{value:null,writable:!0}),e(_,a,{value:null,writable:!0}),e(_,o,{value:A._readableState.endEmitted,writable:!0}),e(_,u,{value:function(C,M){var z=S[h].read();z?(S[c]=null,S[i]=null,S[s]=null,C(f(z,!1))):(S[i]=C,S[s]=M)},writable:!0}),_));return S[c]=null,r(A,function(I){if(I&&I.code!=="ERR_STREAM_PREMATURE_CLOSE"){var C=S[s];C!==null&&(S[c]=null,S[i]=null,S[s]=null,C(I)),S[a]=I;return}var M=S[i];M!==null&&(S[c]=null,S[i]=null,S[s]=null,M(f(void 0,!0))),S[o]=!0}),A.on("readable",p.bind(null,S)),S};return NN=m,NN}function Let(){return $$||($$=!0,LN=function(){throw new Error("Readable.from is not available in the browser")}),LN}function XN(){if(H$)return kN;H$=!0;var n=pr;kN=G;var t;G.ReadableState=z,oi.EventEmitter;var e=function(W,at){return W.listeners(at).length},r=t9(),i=j0.Buffer,s=ket.Uint8Array||function(){};function a(Q){return i.from(Q)}function o(Q){return i.isBuffer(Q)||Q instanceof s}var c=zt,u;c&&c.debuglog?u=c.debuglog("stream"):u=function(){};var h=Det(),f=e9(),d=r9(),p=d.getHighWaterMark,g=$0().codes,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,m=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,A,_,S;ig()(G,r);var I=f.errorOrDestroy,C=["error","close","destroy","pause","resume"];function M(Q,W,at){if(typeof Q.prependListener=="function")return Q.prependListener(W,at);!Q._events||!Q._events[W]?Q.on(W,at):Array.isArray(Q._events[W])?Q._events[W].unshift(at):Q._events[W]=[at,Q._events[W]]}function z(Q,W,at){t=t||ng(),Q=Q||{},typeof at!="boolean"&&(at=W instanceof t),this.objectMode=!!Q.objectMode,at&&(this.objectMode=this.objectMode||!!Q.readableObjectMode),this.highWaterMark=p(this,Q,"readableHighWaterMark",at),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=Q.emitClose!==!1,this.autoDestroy=!!Q.autoDestroy,this.destroyed=!1,this.defaultEncoding=Q.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Q.encoding&&(A||(A=HN.StringDecoder),this.decoder=new A(Q.encoding),this.encoding=Q.encoding)}function G(Q){if(t=t||ng(),!(this instanceof G))return new G(Q);var W=this instanceof t;this._readableState=new z(Q,this,W),this.readable=!0,Q&&(typeof Q.read=="function"&&(this._read=Q.read),typeof Q.destroy=="function"&&(this._destroy=Q.destroy)),r.call(this)}Object.defineProperty(G.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(W){this._readableState&&(this._readableState.destroyed=W)}}),G.prototype.destroy=f.destroy,G.prototype._undestroy=f.undestroy,G.prototype._destroy=function(Q,W){W(Q)},G.prototype.push=function(Q,W){var at=this._readableState,pt;return at.objectMode?pt=!0:typeof Q=="string"&&(W=W||at.defaultEncoding,W!==at.encoding&&(Q=i.from(Q,W),W=""),pt=!0),Y(this,Q,W,!1,pt)},G.prototype.unshift=function(Q){return Y(this,Q,null,!0,!1)};function Y(Q,W,at,pt,_t){u("readableAddChunk",W);var At=Q._readableState;if(W===null)At.reading=!1,N(Q,At);else{var gt;if(_t||(gt=j(At,W)),gt)I(Q,gt);else if(At.objectMode||W&&W.length>0)if(typeof W!="string"&&!At.objectMode&&Object.getPrototypeOf(W)!==i.prototype&&(W=a(W)),pt)At.endEmitted?I(Q,new w):L(Q,At,W,!0);else if(At.ended)I(Q,new b);else{if(At.destroyed)return!1;At.reading=!1,At.decoder&&!at?(W=At.decoder.write(W),At.objectMode||W.length!==0?L(Q,At,W,!1):P(Q,At)):L(Q,At,W,!1)}else pt||(At.reading=!1,P(Q,At))}return!At.ended&&(At.length<At.highWaterMark||At.length===0)}function L(Q,W,at,pt){W.flowing&&W.length===0&&!W.sync?(W.awaitDrain=0,Q.emit("data",at)):(W.length+=W.objectMode?1:at.length,pt?W.buffer.unshift(at):W.buffer.push(at),W.needReadable&&D(Q)),P(Q,W)}function j(Q,W){var at;return!o(W)&&typeof W!="string"&&W!==void 0&&!Q.objectMode&&(at=new y("chunk",["string","Buffer","Uint8Array"],W)),at}G.prototype.isPaused=function(){return this._readableState.flowing===!1},G.prototype.setEncoding=function(Q){A||(A=HN.StringDecoder);var W=new A(Q);this._readableState.decoder=W,this._readableState.encoding=this._readableState.decoder.encoding;for(var at=this._readableState.buffer.head,pt="";at!==null;)pt+=W.write(at.data),at=at.next;return this._readableState.buffer.clear(),pt!==""&&this._readableState.buffer.push(pt),this._readableState.length=pt.length,this};var q=1073741824;function nt(Q){return Q>=q?Q=q:(Q--,Q|=Q>>>1,Q|=Q>>>2,Q|=Q>>>4,Q|=Q>>>8,Q|=Q>>>16,Q++),Q}function J(Q,W){return Q<=0||W.length===0&&W.ended?0:W.objectMode?1:Q!==Q?W.flowing&&W.length?W.buffer.head.data.length:W.length:(Q>W.highWaterMark&&(W.highWaterMark=nt(Q)),Q<=W.length?Q:W.ended?W.length:(W.needReadable=!0,0))}G.prototype.read=function(Q){u("read",Q),Q=parseInt(Q,10);var W=this._readableState,at=Q;if(Q!==0&&(W.emittedReadable=!1),Q===0&&W.needReadable&&((W.highWaterMark!==0?W.length>=W.highWaterMark:W.length>0)||W.ended))return u("read: emitReadable",W.length,W.ended),W.length===0&&W.ended?st(this):D(this),null;if(Q=J(Q,W),Q===0&&W.ended)return W.length===0&&st(this),null;var pt=W.needReadable;u("need readable",pt),(W.length===0||W.length-Q<W.highWaterMark)&&(pt=!0,u("length less than watermark",pt)),W.ended||W.reading?(pt=!1,u("reading or ended",pt)):pt&&(u("do read"),W.reading=!0,W.sync=!0,W.length===0&&(W.needReadable=!0),this._read(W.highWaterMark),W.sync=!1,W.reading||(Q=J(at,W)));var _t;return Q>0?_t=X(Q,W):_t=null,_t===null?(W.needReadable=W.length<=W.highWaterMark,Q=0):(W.length-=Q,W.awaitDrain=0),W.length===0&&(W.ended||(W.needReadable=!0),at!==Q&&W.ended&&st(this)),_t!==null&&this.emit("data",_t),_t};function N(Q,W){if(u("onEofChunk"),!W.ended){if(W.decoder){var at=W.decoder.end();at&&at.length&&(W.buffer.push(at),W.length+=W.objectMode?1:at.length)}W.ended=!0,W.sync?D(Q):(W.needReadable=!1,W.emittedReadable||(W.emittedReadable=!0,F(Q)))}}function D(Q){var W=Q._readableState;u("emitReadable",W.needReadable,W.emittedReadable),W.needReadable=!1,W.emittedReadable||(u("emitReadable",W.flowing),W.emittedReadable=!0,n.nextTick(F,Q))}function F(Q){var W=Q._readableState;u("emitReadable_",W.destroyed,W.length,W.ended),!W.destroyed&&(W.length||W.ended)&&(Q.emit("readable"),W.emittedReadable=!1),W.needReadable=!W.flowing&&!W.ended&&W.length<=W.highWaterMark,K(Q)}function P(Q,W){W.readingMore||(W.readingMore=!0,n.nextTick(V,Q,W))}function V(Q,W){for(;!W.reading&&!W.ended&&(W.length<W.highWaterMark||W.flowing&&W.length===0);){var at=W.length;if(u("maybeReadMore read 0"),Q.read(0),at===W.length)break}W.readingMore=!1}G.prototype._read=function(Q){I(this,new m("_read()"))},G.prototype.pipe=function(Q,W){var at=this,pt=this._readableState;switch(pt.pipesCount){case 0:pt.pipes=Q;break;case 1:pt.pipes=[pt.pipes,Q];break;default:pt.pipes.push(Q);break}pt.pipesCount+=1,u("pipe count=%d opts=%j",pt.pipesCount,W);var _t=(!W||W.end!==!1)&&Q!==n.stdout&&Q!==n.stderr,At=_t?xt:v;pt.endEmitted?n.nextTick(At):at.once("end",At),Q.on("unpipe",gt);function gt(E,B){u("onunpipe"),E===at&&B&&B.hasUnpiped===!1&&(B.hasUnpiped=!0,Ot())}function xt(){u("onend"),Q.end()}var $t=$(at);Q.on("drain",$t);var Nt=!1;function Ot(){u("cleanup"),Q.removeListener("close",te),Q.removeListener("finish",O),Q.removeListener("drain",$t),Q.removeListener("error",Jt),Q.removeListener("unpipe",gt),at.removeListener("end",xt),at.removeListener("end",v),at.removeListener("data",qt),Nt=!0,pt.awaitDrain&&(!Q._writableState||Q._writableState.needDrain)&&$t()}at.on("data",qt);function qt(E){u("ondata");var B=Q.write(E);u("dest.write",B),B===!1&&((pt.pipesCount===1&&pt.pipes===Q||pt.pipesCount>1&&wt(pt.pipes,Q)!==-1)&&!Nt&&(u("false write response, pause",pt.awaitDrain),pt.awaitDrain++),at.pause())}function Jt(E){u("onerror",E),v(),Q.removeListener("error",Jt),e(Q,"error")===0&&I(Q,E)}M(Q,"error",Jt);function te(){Q.removeListener("finish",O),v()}Q.once("close",te);function O(){u("onfinish"),Q.removeListener("close",te),v()}Q.once("finish",O);function v(){u("unpipe"),at.unpipe(Q)}return Q.emit("pipe",at),pt.flowing||(u("pipe resume"),at.resume()),Q};function $(Q){return function(){var at=Q._readableState;u("pipeOnDrain",at.awaitDrain),at.awaitDrain&&at.awaitDrain--,at.awaitDrain===0&&e(Q,"data")&&(at.flowing=!0,K(Q))}}G.prototype.unpipe=function(Q){var W=this._readableState,at={hasUnpiped:!1};if(W.pipesCount===0)return this;if(W.pipesCount===1)return Q&&Q!==W.pipes?this:(Q||(Q=W.pipes),W.pipes=null,W.pipesCount=0,W.flowing=!1,Q&&Q.emit("unpipe",this,at),this);if(!Q){var pt=W.pipes,_t=W.pipesCount;W.pipes=null,W.pipesCount=0,W.flowing=!1;for(var At=0;At<_t;At++)pt[At].emit("unpipe",this,{hasUnpiped:!1});return this}var gt=wt(W.pipes,Q);return gt===-1?this:(W.pipes.splice(gt,1),W.pipesCount-=1,W.pipesCount===1&&(W.pipes=W.pipes[0]),Q.emit("unpipe",this,at),this)},G.prototype.on=function(Q,W){var at=r.prototype.on.call(this,Q,W),pt=this._readableState;return Q==="data"?(pt.readableListening=this.listenerCount("readable")>0,pt.flowing!==!1&&this.resume()):Q==="readable"&&!pt.endEmitted&&!pt.readableListening&&(pt.readableListening=pt.needReadable=!0,pt.flowing=!1,pt.emittedReadable=!1,u("on readable",pt.length,pt.reading),pt.length?D(this):pt.reading||n.nextTick(rt,this)),at},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(Q,W){var at=r.prototype.removeListener.call(this,Q,W);return Q==="readable"&&n.nextTick(H,this),at},G.prototype.removeAllListeners=function(Q){var W=r.prototype.removeAllListeners.apply(this,arguments);return(Q==="readable"||Q===void 0)&&n.nextTick(H,this),W};function H(Q){var W=Q._readableState;W.readableListening=Q.listenerCount("readable")>0,W.resumeScheduled&&!W.paused?W.flowing=!0:Q.listenerCount("data")>0&&Q.resume()}function rt(Q){u("readable nexttick read 0"),Q.read(0)}G.prototype.resume=function(){var Q=this._readableState;return Q.flowing||(u("resume"),Q.flowing=!Q.readableListening,lt(this,Q)),Q.paused=!1,this};function lt(Q,W){W.resumeScheduled||(W.resumeScheduled=!0,n.nextTick(ft,Q,W))}function ft(Q,W){u("resume",W.reading),W.reading||Q.read(0),W.resumeScheduled=!1,Q.emit("resume"),K(Q),W.flowing&&!W.reading&&Q.read(0)}G.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function K(Q){var W=Q._readableState;for(u("flow",W.flowing);W.flowing&&Q.read()!==null;);}G.prototype.wrap=function(Q){var W=this,at=this._readableState,pt=!1;Q.on("end",function(){if(u("wrapped end"),at.decoder&&!at.ended){var gt=at.decoder.end();gt&&gt.length&&W.push(gt)}W.push(null)}),Q.on("data",function(gt){if(u("wrapped data"),at.decoder&&(gt=at.decoder.write(gt)),!(at.objectMode&&gt==null)&&!(!at.objectMode&&(!gt||!gt.length))){var xt=W.push(gt);xt||(pt=!0,Q.pause())}});for(var _t in Q)this[_t]===void 0&&typeof Q[_t]=="function"&&(this[_t]=(function(xt){return function(){return Q[xt].apply(Q,arguments)}})(_t));for(var At=0;At<C.length;At++)Q.on(C[At],this.emit.bind(this,C[At]));return this._read=function(gt){u("wrapped _read",gt),pt&&(pt=!1,Q.resume())},this},typeof Symbol=="function"&&(G.prototype[Symbol.asyncIterator]=function(){return _===void 0&&(_=Net()),_(this)}),Object.defineProperty(G.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(G.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(G.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(W){this._readableState&&(this._readableState.flowing=W)}}),G._fromList=X,Object.defineProperty(G.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function X(Q,W){if(W.length===0)return null;var at;return W.objectMode?at=W.buffer.shift():!Q||Q>=W.length?(W.decoder?at=W.buffer.join(""):W.buffer.length===1?at=W.buffer.first():at=W.buffer.concat(W.length),W.buffer.clear()):at=W.buffer.consume(Q,W.decoder),at}function st(Q){var W=Q._readableState;u("endReadable",W.endEmitted),W.endEmitted||(W.ended=!0,n.nextTick(bt,W,Q))}function bt(Q,W){if(u("endReadableNT",Q.endEmitted,Q.length),!Q.endEmitted&&Q.length===0&&(Q.endEmitted=!0,W.readable=!1,W.emit("end"),Q.autoDestroy)){var at=W._writableState;(!at||at.autoDestroy&&at.finished)&&W.destroy()}}typeof Symbol=="function"&&(G.from=function(Q,W){return S===void 0&&(S=Let()),S(G,Q,W)});function wt(Q,W){for(var at=0,pt=Q.length;at<pt;at++)if(Q[at]===W)return at;return-1}return kN}function qN(){if(z$)return MN;z$=!0,MN=o;var n=$0().codes,t=n.ERR_METHOD_NOT_IMPLEMENTED,e=n.ERR_MULTIPLE_CALLBACK,r=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=n.ERR_TRANSFORM_WITH_LENGTH_0,s=ng();ig()(o,s);function a(h,f){var d=this._transformState;d.transforming=!1;var p=d.writecb;if(p===null)return this.emit("error",new e);d.writechunk=null,d.writecb=null,f!=null&&this.push(f),p(h);var g=this._readableState;g.reading=!1,(g.needReadable||g.length<g.highWaterMark)&&this._read(g.highWaterMark)}function o(h){if(!(this instanceof o))return new o(h);s.call(this,h),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",c)}function c(){var h=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(f,d){u(h,f,d)}):u(this,null,null)}o.prototype.push=function(h,f){return this._transformState.needTransform=!1,s.prototype.push.call(this,h,f)},o.prototype._transform=function(h,f,d){d(new t("_transform()"))},o.prototype._write=function(h,f,d){var p=this._transformState;if(p.writecb=d,p.writechunk=h,p.writeencoding=f,!p.transforming){var g=this._readableState;(p.needTransform||g.needReadable||g.length<g.highWaterMark)&&this._read(g.highWaterMark)}},o.prototype._read=function(h){var f=this._transformState;f.writechunk!==null&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},o.prototype._destroy=function(h,f){s.prototype._destroy.call(this,h,function(d){f(d)})};function u(h,f,d){if(f)return h.emit("error",f);if(d!=null&&h.push(d),h._writableState.length)throw new i;if(h._transformState.transforming)throw new r;return h.push(null)}return MN}function n9(){if(W$)return FN;W$=!0,FN=t;var n=qN();ig()(t,n);function t(e){if(!(this instanceof t))return new t(e);n.call(this,e)}return t.prototype._transform=function(e,r,i){i(null,e)},FN}function i9(){if(G$)return BN;G$=!0;var n;function t(d){var p=!1;return function(){p||(p=!0,d.apply(void 0,arguments))}}var e=$0().codes,r=e.ERR_MISSING_ARGS,i=e.ERR_STREAM_DESTROYED;function s(d){if(d)throw d}function a(d){return d.setHeader&&typeof d.abort=="function"}function o(d,p,g,y){y=t(y);var b=!1;d.on("close",function(){b=!0}),n===void 0&&(n=xC()),n(d,{readable:p,writable:g},function(w){if(w)return y(w);b=!0,y()});var m=!1;return function(w){if(!b&&!m){if(m=!0,a(d))return d.abort();if(typeof d.destroy=="function")return d.destroy();y(w||new i("pipe"))}}}function c(d){d()}function u(d,p){return d.pipe(p)}function h(d){return!d.length||typeof d[d.length-1]!="function"?s:d.pop()}function f(){for(var d=arguments.length,p=new Array(d),g=0;g<d;g++)p[g]=arguments[g];var y=h(p);if(Array.isArray(p[0])&&(p=p[0]),p.length<2)throw new r("streams");var b,m=p.map(function(w,A){var _=A<p.length-1,S=A>0;return o(w,_,S,function(I){b||(b=I),I&&m.forEach(c),!_&&(m.forEach(c),y(b))})});return p.reduce(u)}return BN=f,BN}var V$,fl,ba,m$,yC,Qp,y$,net,Su,UN,U0,v$,met,yet,wC,AC,ic,bet,HN,zN,T$,xE,C$,bC,R$,rg,I$,j0,vC,D$,xN,O$,SN,P$,_N,N$,TN,L$,CN,k$,RN,M$,IN,DN,F$,Pet,ON,B$,PN,U$,NN,j$,LN,$$,kN,H$,ket,MN,z$,FN,W$,BN,G$,SC=br(()=>{Tt();Rt();Ct();B0();Of();N0();for(V$={byteLength:function(n){var t=b$(n),e=t[0],r=t[1];return 3*(e+r)/4-r},toByteArray:function(n){var t,e,r=b$(n),i=r[0],s=r[1],a=new m$((function(u,h,f){return 3*(h+f)/4-f})(0,i,s)),o=0,c=s>0?i-4:i;for(e=0;e<c;e+=4)t=ba[n.charCodeAt(e)]<<18|ba[n.charCodeAt(e+1)]<<12|ba[n.charCodeAt(e+2)]<<6|ba[n.charCodeAt(e+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=255&t;return s===2&&(t=ba[n.charCodeAt(e)]<<2|ba[n.charCodeAt(e+1)]>>4,a[o++]=255&t),s===1&&(t=ba[n.charCodeAt(e)]<<10|ba[n.charCodeAt(e+1)]<<4|ba[n.charCodeAt(e+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t),a},fromByteArray:function(n){for(var t,e=n.length,r=e%3,i=[],s=0,a=e-r;s<a;s+=16383)i.push(ret(n,s,s+16383>a?a:s+16383));return r===1?(t=n[e-1],i.push(fl[t>>2]+fl[t<<4&63]+"==")):r===2&&(t=(n[e-2]<<8)+n[e-1],i.push(fl[t>>10]+fl[t>>4&63]+fl[t<<2&63]+"=")),i.join("")}},fl=[],ba=[],m$=typeof Uint8Array<"u"?Uint8Array:Array,yC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qp=0,y$=yC.length;Qp<y$;++Qp)fl[Qp]=yC[Qp],ba[yC.charCodeAt(Qp)]=Qp;ba[45]=62,ba[95]=63;net={read:function(n,t,e,r,i){var s,a,o=8*i-r-1,c=(1<<o)-1,u=c>>1,h=-7,f=e?i-1:0,d=e?-1:1,p=n[t+f];for(f+=d,s=p&(1<<-h)-1,p>>=-h,h+=o;h>0;s=256*s+n[t+f],f+=d,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=r;h>0;a=256*a+n[t+f],f+=d,h-=8);if(s===0)s=1-u;else{if(s===c)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),s-=u}return(p?-1:1)*a*Math.pow(2,s-r)},write:function(n,t,e,r,i,s){var a,o,c,u=8*s-i-1,h=(1<<u)-1,f=h>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,g=r?1:-1,y=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?d/c:d*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=h?(o=0,a=h):a+f>=1?(o=(t*c-1)*Math.pow(2,i),a+=f):(o=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;n[e+p]=255&o,p+=g,o/=256,i-=8);for(a=a<<i|o,u+=i;u>0;n[e+p]=255&a,p+=g,a/=256,u-=8);n[e+p-g]|=128*y}},Su={},UN=V$,U0=net,v$=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Su.Buffer=Xt,Su.SlowBuffer=function(n){return+n!=n&&(n=0),Xt.alloc(+n)},Su.INSPECT_MAX_BYTES=50;Su.kMaxLength=2147483647,Xt.TYPED_ARRAY_SUPPORT=(function(){try{var n=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(n,t),n.foo()===42}catch{return!1}})(),Xt.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(Xt.prototype,"parent",{enumerable:!0,get:function(){if(Xt.isBuffer(this))return this.buffer}}),Object.defineProperty(Xt.prototype,"offset",{enumerable:!0,get:function(){if(Xt.isBuffer(this))return this.byteOffset}}),Xt.poolSize=8192,Xt.from=function(n,t,e){return X$(n,t,e)},Object.setPrototypeOf(Xt.prototype,Uint8Array.prototype),Object.setPrototypeOf(Xt,Uint8Array),Xt.alloc=function(n,t,e){return(function(r,i,s){return q$(r),r<=0?Eu(r):i!==void 0?typeof s=="string"?Eu(r).fill(i,s):Eu(r).fill(i):Eu(r)})(n,t,e)},Xt.allocUnsafe=function(n){return jN(n)},Xt.allocUnsafeSlow=function(n){return jN(n)},Xt.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==Xt.prototype},Xt.compare=function(n,t){if(xu(n,Uint8Array)&&(n=Xt.from(n,n.offset,n.byteLength)),xu(t,Uint8Array)&&(t=Xt.from(t,t.offset,t.byteLength)),!Xt.isBuffer(n)||!Xt.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===t)return 0;for(var e=n.length,r=t.length,i=0,s=Math.min(e,r);i<s;++i)if(n[i]!==t[i]){e=n[i],r=t[i];break}return e<r?-1:r<e?1:0},Xt.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Xt.concat=function(n,t){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return Xt.alloc(0);var e;if(t===void 0)for(t=0,e=0;e<n.length;++e)t+=n[e].length;var r=Xt.allocUnsafe(t),i=0;for(e=0;e<n.length;++e){var s=n[e];if(xu(s,Uint8Array)&&(s=Xt.from(s)),!Xt.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},Xt.byteLength=Y$,Xt.prototype._isBuffer=!0,Xt.prototype.swap16=function(){var n=this.length;if(n%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<n;t+=2)tg(this,t,t+1);return this},Xt.prototype.swap32=function(){var n=this.length;if(n%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<n;t+=4)tg(this,t,t+3),tg(this,t+1,t+2);return this},Xt.prototype.swap64=function(){var n=this.length;if(n%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<n;t+=8)tg(this,t,t+7),tg(this,t+1,t+6),tg(this,t+2,t+5),tg(this,t+3,t+4);return this},Xt.prototype.toString=function(){var n=this.length;return n===0?"":arguments.length===0?Z$(this,0,n):iet.apply(this,arguments)},Xt.prototype.toLocaleString=Xt.prototype.toString,Xt.prototype.equals=function(n){if(!Xt.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n||Xt.compare(this,n)===0},Xt.prototype.inspect=function(){var n="",t=Su.INSPECT_MAX_BYTES;return n=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(n+=" ... "),"<Buffer "+n+">"},v$&&(Xt.prototype[v$]=Xt.prototype.inspect),Xt.prototype.compare=function(n,t,e,r,i){if(xu(n,Uint8Array)&&(n=Xt.from(n,n.offset,n.byteLength)),!Xt.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(t===void 0&&(t=0),e===void 0&&(e=n?n.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||e>n.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=e)return 0;if(r>=i)return-1;if(t>=e)return 1;if(this===n)return 0;for(var s=(i>>>=0)-(r>>>=0),a=(e>>>=0)-(t>>>=0),o=Math.min(s,a),c=this.slice(r,i),u=n.slice(t,e),h=0;h<o;++h)if(c[h]!==u[h]){s=c[h],a=u[h];break}return s<a?-1:a<s?1:0},Xt.prototype.includes=function(n,t,e){return this.indexOf(n,t,e)!==-1},Xt.prototype.indexOf=function(n,t,e){return A$(this,n,t,e,!0)},Xt.prototype.lastIndexOf=function(n,t,e){return A$(this,n,t,e,!1)},Xt.prototype.write=function(n,t,e,r){if(t===void 0)r="utf8",e=this.length,t=0;else if(e===void 0&&typeof t=="string")r=t,e=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(e)?(e>>>=0,r===void 0&&(r="utf8")):(r=e,e=void 0)}var i=this.length-t;if((e===void 0||e>i)&&(e=i),n.length>0&&(e<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return set(this,n,t,e);case"utf8":case"utf-8":return aet(this,n,t,e);case"ascii":return K$(this,n,t,e);case"latin1":case"binary":return oet(this,n,t,e);case"base64":return cet(this,n,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return uet(this,n,t,e);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},Xt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Xt.prototype.slice=function(n,t){var e=this.length;(n=~~n)<0?(n+=e)<0&&(n=0):n>e&&(n=e),(t=t===void 0?e:~~t)<0?(t+=e)<0&&(t=0):t>e&&(t=e),t<n&&(t=n);var r=this.subarray(n,t);return Object.setPrototypeOf(r,Xt.prototype),r},Xt.prototype.readUIntLE=function(n,t,e){n>>>=0,t>>>=0,e||wi(n,t,this.length);for(var r=this[n],i=1,s=0;++s<t&&(i*=256);)r+=this[n+s]*i;return r},Xt.prototype.readUIntBE=function(n,t,e){n>>>=0,t>>>=0,e||wi(n,t,this.length);for(var r=this[n+--t],i=1;t>0&&(i*=256);)r+=this[n+--t]*i;return r},Xt.prototype.readUInt8=function(n,t){return n>>>=0,t||wi(n,1,this.length),this[n]},Xt.prototype.readUInt16LE=function(n,t){return n>>>=0,t||wi(n,2,this.length),this[n]|this[n+1]<<8},Xt.prototype.readUInt16BE=function(n,t){return n>>>=0,t||wi(n,2,this.length),this[n]<<8|this[n+1]},Xt.prototype.readUInt32LE=function(n,t){return n>>>=0,t||wi(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+16777216*this[n+3]},Xt.prototype.readUInt32BE=function(n,t){return n>>>=0,t||wi(n,4,this.length),16777216*this[n]+(this[n+1]<<16|this[n+2]<<8|this[n+3])},Xt.prototype.readIntLE=function(n,t,e){n>>>=0,t>>>=0,e||wi(n,t,this.length);for(var r=this[n],i=1,s=0;++s<t&&(i*=256);)r+=this[n+s]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},Xt.prototype.readIntBE=function(n,t,e){n>>>=0,t>>>=0,e||wi(n,t,this.length);for(var r=t,i=1,s=this[n+--r];r>0&&(i*=256);)s+=this[n+--r]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},Xt.prototype.readInt8=function(n,t){return n>>>=0,t||wi(n,1,this.length),128&this[n]?-1*(255-this[n]+1):this[n]},Xt.prototype.readInt16LE=function(n,t){n>>>=0,t||wi(n,2,this.length);var e=this[n]|this[n+1]<<8;return 32768&e?4294901760|e:e},Xt.prototype.readInt16BE=function(n,t){n>>>=0,t||wi(n,2,this.length);var e=this[n+1]|this[n]<<8;return 32768&e?4294901760|e:e},Xt.prototype.readInt32LE=function(n,t){return n>>>=0,t||wi(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},Xt.prototype.readInt32BE=function(n,t){return n>>>=0,t||wi(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},Xt.prototype.readFloatLE=function(n,t){return n>>>=0,t||wi(n,4,this.length),U0.read(this,n,!0,23,4)},Xt.prototype.readFloatBE=function(n,t){return n>>>=0,t||wi(n,4,this.length),U0.read(this,n,!1,23,4)},Xt.prototype.readDoubleLE=function(n,t){return n>>>=0,t||wi(n,8,this.length),U0.read(this,n,!0,52,8)},Xt.prototype.readDoubleBE=function(n,t){return n>>>=0,t||wi(n,8,this.length),U0.read(this,n,!1,52,8)},Xt.prototype.writeUIntLE=function(n,t,e,r){n=+n,t>>>=0,e>>>=0,r||zs(this,n,t,e,Math.pow(2,8*e)-1,0);var i=1,s=0;for(this[t]=255&n;++s<e&&(i*=256);)this[t+s]=n/i&255;return t+e},Xt.prototype.writeUIntBE=function(n,t,e,r){n=+n,t>>>=0,e>>>=0,r||zs(this,n,t,e,Math.pow(2,8*e)-1,0);var i=e-1,s=1;for(this[t+i]=255&n;--i>=0&&(s*=256);)this[t+i]=n/s&255;return t+e},Xt.prototype.writeUInt8=function(n,t,e){return n=+n,t>>>=0,e||zs(this,n,t,1,255,0),this[t]=255&n,t+1},Xt.prototype.writeUInt16LE=function(n,t,e){return n=+n,t>>>=0,e||zs(this,n,t,2,65535,0),this[t]=255&n,this[t+1]=n>>>8,t+2},Xt.prototype.writeUInt16BE=function(n,t,e){return n=+n,t>>>=0,e||zs(this,n,t,2,65535,0),this[t]=n>>>8,this[t+1]=255&n,t+2},Xt.prototype.writeUInt32LE=function(n,t,e){return n=+n,t>>>=0,e||zs(this,n,t,4,4294967295,0),this[t+3]=n>>>24,this[t+2]=n>>>16,this[t+1]=n>>>8,this[t]=255&n,t+4},Xt.prototype.writeUInt32BE=function(n,t,e){return n=+n,t>>>=0,e||zs(this,n,t,4,4294967295,0),this[t]=n>>>24,this[t+1]=n>>>16,this[t+2]=n>>>8,this[t+3]=255&n,t+4},Xt.prototype.writeIntLE=function(n,t,e,r){if(n=+n,t>>>=0,!r){var i=Math.pow(2,8*e-1);zs(this,n,t,e,i-1,-i)}var s=0,a=1,o=0;for(this[t]=255&n;++s<e&&(a*=256);)n<0&&o===0&&this[t+s-1]!==0&&(o=1),this[t+s]=(n/a>>0)-o&255;return t+e},Xt.prototype.writeIntBE=function(n,t,e,r){if(n=+n,t>>>=0,!r){var i=Math.pow(2,8*e-1);zs(this,n,t,e,i-1,-i)}var s=e-1,a=1,o=0;for(this[t+s]=255&n;--s>=0&&(a*=256);)n<0&&o===0&&this[t+s+1]!==0&&(o=1),this[t+s]=(n/a>>0)-o&255;return t+e},Xt.prototype.writeInt8=function(n,t,e){return n=+n,t>>>=0,e||zs(this,n,t,1,127,-128),n<0&&(n=255+n+1),this[t]=255&n,t+1},Xt.prototype.writeInt16LE=function(n,t,e){return n=+n,t>>>=0,e||zs(this,n,t,2,32767,-32768),this[t]=255&n,this[t+1]=n>>>8,t+2},Xt.prototype.writeInt16BE=function(n,t,e){return n=+n,t>>>=0,e||zs(this,n,t,2,32767,-32768),this[t]=n>>>8,this[t+1]=255&n,t+2},Xt.prototype.writeInt32LE=function(n,t,e){return n=+n,t>>>=0,e||zs(this,n,t,4,2147483647,-2147483648),this[t]=255&n,this[t+1]=n>>>8,this[t+2]=n>>>16,this[t+3]=n>>>24,t+4},Xt.prototype.writeInt32BE=function(n,t,e){return n=+n,t>>>=0,e||zs(this,n,t,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[t]=n>>>24,this[t+1]=n>>>16,this[t+2]=n>>>8,this[t+3]=255&n,t+4},Xt.prototype.writeFloatLE=function(n,t,e){return x$(this,n,t,!0,e)},Xt.prototype.writeFloatBE=function(n,t,e){return x$(this,n,t,!1,e)},Xt.prototype.writeDoubleLE=function(n,t,e){return S$(this,n,t,!0,e)},Xt.prototype.writeDoubleBE=function(n,t,e){return S$(this,n,t,!1,e)},Xt.prototype.copy=function(n,t,e,r){if(!Xt.isBuffer(n))throw new TypeError("argument should be a Buffer");if(e||(e=0),r||r===0||(r=this.length),t>=n.length&&(t=n.length),t||(t=0),r>0&&r<e&&(r=e),r===e||n.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),n.length-t<r-e&&(r=n.length-t+e);var i=r-e;if(this===n&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(t,e,r);else if(this===n&&e<t&&t<r)for(var s=i-1;s>=0;--s)n[s+t]=this[s+e];else Uint8Array.prototype.set.call(n,this.subarray(e,r),t);return i},Xt.prototype.fill=function(n,t,e,r){if(typeof n=="string"){if(typeof t=="string"?(r=t,t=0,e=this.length):typeof e=="string"&&(r=e,e=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!Xt.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(n.length===1){var i=n.charCodeAt(0);(r==="utf8"&&i<128||r==="latin1")&&(n=i)}}else typeof n=="number"?n&=255:typeof n=="boolean"&&(n=Number(n));if(t<0||this.length<t||this.length<e)throw new RangeError("Out of range index");if(e<=t)return this;var s;if(t>>>=0,e=e===void 0?this.length:e>>>0,n||(n=0),typeof n=="number")for(s=t;s<e;++s)this[s]=n;else{var a=Xt.isBuffer(n)?n:Xt.from(n,r),o=a.length;if(o===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(s=0;s<e-t;++s)this[s+t]=a[s%o]}return this};met=/[^+/0-9A-Za-z-_]/g;yet=(function(){for(var n=new Array(256),t=0;t<16;++t)for(var e=16*t,r=0;r<16;++r)n[e+r]="0123456789abcdef"[t]+"0123456789abcdef"[r];return n})();Su.Buffer;Su.INSPECT_MAX_BYTES;Su.kMaxLength;wC={},AC=Su,ic=AC.Buffer;ic.from&&ic.alloc&&ic.allocUnsafe&&ic.allocUnsafeSlow?wC=AC:(_$(AC,wC),wC.Buffer=eg),eg.prototype=Object.create(ic.prototype),_$(ic,eg),eg.from=function(n,t,e){if(typeof n=="number")throw new TypeError("Argument must not be a number");return ic(n,t,e)},eg.alloc=function(n,t,e){if(typeof n!="number")throw new TypeError("Argument must be a number");var r=ic(n);return t!==void 0?typeof e=="string"?r.fill(t,e):r.fill(t):r.fill(0),r},eg.allocUnsafe=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return ic(n)},eg.allocUnsafeSlow=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return AC.SlowBuffer(n)};bet=wC,HN={},zN=bet.Buffer,T$=zN.isEncoding||function(n){switch((n=""+n)&&n.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}};HN.StringDecoder=EE,EE.prototype.write=function(n){if(n.length===0)return"";var t,e;if(this.lastNeed){if((t=this.fillLast(n))===void 0)return"";e=this.lastNeed,this.lastNeed=0}else e=0;return e<n.length?t?t+this.text(n,e):this.text(n,e):t||""},EE.prototype.end=function(n){var t=n&&n.length?this.write(n):"";return this.lastNeed?t+"\uFFFD":t},EE.prototype.text=function(n,t){var e=(function(i,s,a){var o=s.length-1;if(o<a)return 0;var c=EN(s[o]);return c>=0?(c>0&&(i.lastNeed=c-1),c):--o<a||c===-2?0:(c=EN(s[o]))>=0?(c>0&&(i.lastNeed=c-2),c):--o<a||c===-2?0:(c=EN(s[o]))>=0?(c>0&&(c===2?c=0:i.lastNeed=c-3),c):0})(this,n,t);if(!this.lastNeed)return n.toString("utf8",t);this.lastTotal=e;var r=n.length-(e-this.lastNeed);return n.copy(this.lastChar,0,r),n.toString("utf8",t,r)},EE.prototype.fillLast=function(n){if(this.lastNeed<=n.length)return n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,n.length),this.lastNeed-=n.length};xE={},C$=!1;bC={},R$=!1;rg={},I$=!1;j0=Iet();j0.Buffer;j0.INSPECT_MAX_BYTES;j0.kMaxLength;vC={},D$=!1;xN={},O$=!1;SN={},P$=!1;_N={},N$=!1;TN={},L$=!1;CN={},k$=!1;RN={},M$=!1,IN=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;DN={},F$=!1,Pet=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;ON={},B$=!1;PN={},U$=!1;NN={},j$=!1;LN={},$$=!1;kN={},H$=!1,ket=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;MN={},z$=!1;FN={},W$=!1;BN={},G$=!1});function Met(){if(s9)return YN;s9=!0,YN=e;var n=oi.EventEmitter,t=ig();t(e,n),e.Readable=XN(),e.Writable=VN(),e.Duplex=ng(),e.Transform=qN(),e.PassThrough=n9(),e.finished=xC(),e.pipeline=i9(),e.Stream=e;function e(){n.call(this||KN)}return e.prototype.pipe=function(r,i){var s=this||KN;function a(p){r.writable&&r.write(p)===!1&&s.pause&&s.pause()}s.on("data",a);function o(){s.readable&&s.resume&&s.resume()}r.on("drain",o),!r._isStdio&&(!i||i.end!==!1)&&(s.on("end",u),s.on("close",h));var c=!1;function u(){c||(c=!0,r.end())}function h(){c||(c=!0,typeof r.destroy=="function"&&r.destroy())}function f(p){if(d(),n.listenerCount(this||KN,"error")===0)throw p}s.on("error",f),r.on("error",f);function d(){s.removeListener("data",a),r.removeListener("drain",o),s.removeListener("end",u),s.removeListener("close",h),s.removeListener("error",f),r.removeListener("error",f),s.removeListener("end",d),s.removeListener("close",d),r.removeListener("close",d)}return s.on("end",d),s.on("close",d),r.on("close",d),r.emit("pipe",s),r},YN}var YN,s9,KN,Ws,a9,ZN=br(()=>{Tt();Rt();Ct();mC();SC();B0();dC();Of();N0();YN={},s9=!1,KN=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;Ws=Met(),a9=Ws.Readable;a9.wrap=function(n,t){return t=Object.assign({objectMode:n.readableObjectMode!=null||n.objectMode!=null||!0},t),t.destroy=function(e,r){n.destroy(e),r(e)},new a9(t).wrap(n)};Ws.Writable;Ws.Duplex;Ws.Transform;Ws.PassThrough;Ws.finished;Ws.pipeline;Ws.Stream;aN(Ws.finished),aN(Ws.pipeline)});function Fet(){if(o9)return JN;o9=!0;let n=2147483647,t=36,e=1,r=26,i=38,s=700,a=72,o=128,c="-",u=/^xn--/,h=/[^\0-\x7F]/,f=/[\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"},p=t-e,g=Math.floor,y=String.fromCharCode;function b(j){throw new RangeError(d[j])}function m(j,q){let nt=[],J=j.length;for(;J--;)nt[J]=q(j[J]);return nt}function w(j,q){let nt=j.split("@"),J="";nt.length>1&&(J=nt[0]+"@",j=nt[1]),j=j.replace(f,".");let N=j.split("."),D=m(N,q).join(".");return J+D}function A(j){let q=[],nt=0,J=j.length;for(;nt<J;){let N=j.charCodeAt(nt++);if(N>=55296&&N<=56319&&nt<J){let D=j.charCodeAt(nt++);(D&64512)==56320?q.push(((N&1023)<<10)+(D&1023)+65536):(q.push(N),nt--)}else q.push(N)}return q}let _=j=>String.fromCodePoint(...j),S=function(j){return j>=48&&j<58?26+(j-48):j>=65&&j<91?j-65:j>=97&&j<123?j-97:t},I=function(j,q){return j+22+75*(j<26)-((q!=0)<<5)},C=function(j,q,nt){let J=0;for(j=nt?g(j/s):j>>1,j+=g(j/q);j>p*r>>1;J+=t)j=g(j/p);return g(J+(p+1)*j/(j+i))},M=function(j){let q=[],nt=j.length,J=0,N=o,D=a,F=j.lastIndexOf(c);F<0&&(F=0);for(let P=0;P<F;++P)j.charCodeAt(P)>=128&&b("not-basic"),q.push(j.charCodeAt(P));for(let P=F>0?F+1:0;P<nt;){let V=J;for(let H=1,rt=t;;rt+=t){P>=nt&&b("invalid-input");let lt=S(j.charCodeAt(P++));lt>=t&&b("invalid-input"),lt>g((n-J)/H)&&b("overflow"),J+=lt*H;let ft=rt<=D?e:rt>=D+r?r:rt-D;if(lt<ft)break;let K=t-ft;H>g(n/K)&&b("overflow"),H*=K}let $=q.length+1;D=C(J-V,$,V==0),g(J/$)>n-N&&b("overflow"),N+=g(J/$),J%=$,q.splice(J++,0,N)}return String.fromCodePoint(...q)},z=function(j){let q=[];j=A(j);let nt=j.length,J=o,N=0,D=a;for(let V of j)V<128&&q.push(y(V));let F=q.length,P=F;for(F&&q.push(c);P<nt;){let V=n;for(let H of j)H>=J&&H<V&&(V=H);let $=P+1;V-J>g((n-N)/$)&&b("overflow"),N+=(V-J)*$,J=V;for(let H of j)if(H<J&&++N>n&&b("overflow"),H===J){let rt=N;for(let lt=t;;lt+=t){let ft=lt<=D?e:lt>=D+r?r:lt-D;if(rt<ft)break;let K=rt-ft,X=t-ft;q.push(y(I(ft+K%X,0))),rt=g(K/X)}q.push(y(I(rt,0))),D=C(N,$,P===F),N=0,++P}++N,++J}return q.join("")};return JN={version:"2.3.1",ucs2:{decode:A,encode:_},decode:M,encode:z,toASCII:function(j){return w(j,function(q){return h.test(q)?"xn--"+z(q):q})},toUnicode:function(j){return w(j,function(q){return u.test(q)?M(q.slice(4).toLowerCase()):q})}},JN}var JN,o9,Lf,fpt,dpt,ppt,gpt,mpt,ypt,QN=br(()=>{Tt();Rt();Ct();JN={},o9=!1;Lf=Fet(),fpt=Lf.decode,dpt=Lf.encode,ppt=Lf.toASCII,gpt=Lf.toUnicode,mpt=Lf.ucs2,ypt=Lf.version});function wL(){return l9||(l9=!0,tL=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),r=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[e]=i;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,e);if(a.value!==i||a.enumerable!==!0)return!1}return!0}),tL}function Bet(){return c9||(c9=!0,eL=Error),eL}function Uet(){return u9||(u9=!0,rL=EvalError),rL}function jet(){return h9||(h9=!0,nL=RangeError),nL}function $et(){return f9||(f9=!0,iL=ReferenceError),iL}function I9(){return d9||(d9=!0,sL=SyntaxError),sL}function H0(){return p9||(p9=!0,aL=TypeError),aL}function Het(){return g9||(g9=!0,oL=URIError),oL}function zet(){if(m9)return lL;m9=!0;var n=typeof Symbol<"u"&&Symbol,t=wL();return lL=function(){return typeof n!="function"||typeof Symbol!="function"||typeof n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},lL}function Wet(){if(y9)return cL;y9=!0;var n={__proto__:null,foo:{}},t=Object;return cL=function(){return{__proto__:n}.foo===n.foo&&!(n instanceof t)},cL}function Get(){if(b9)return uL;b9=!0;var n="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,e=Math.max,r="[object Function]",i=function(c,u){for(var h=[],f=0;f<c.length;f+=1)h[f]=c[f];for(var d=0;d<u.length;d+=1)h[d+c.length]=u[d];return h},s=function(c,u){for(var h=[],f=u,d=0;f<c.length;f+=1,d+=1)h[d]=c[f];return h},a=function(o,c){for(var u="",h=0;h<o.length;h+=1)u+=o[h],h+1<o.length&&(u+=c);return u};return uL=function(c){var u=this;if(typeof u!="function"||t.apply(u)!==r)throw new TypeError(n+u);for(var h=s(arguments,1),f,d=function(){if(this instanceof f){var m=u.apply(this,i(h,arguments));return Object(m)===m?m:this}return u.apply(c,i(h,arguments))},p=e(0,u.length-h.length),g=[],y=0;y<p;y++)g[y]="$"+y;if(f=Function("binder","return function ("+a(g,",")+"){ return binder.apply(this,arguments); }")(d),u.prototype){var b=function(){};b.prototype=u.prototype,f.prototype=new b,b.prototype=null}return f},uL}function AL(){if(v9)return hL;v9=!0;var n=Get();return hL=Function.prototype.bind||n,hL}function Vet(){if(w9)return fL;w9=!0;var n=Function.prototype.call,t=Object.prototype.hasOwnProperty,e=AL();return fL=e.call(n,t),fL}function sg(){if(A9)return dL;A9=!0;var n,t=Bet(),e=Uet(),r=jet(),i=$et(),s=I9(),a=H0(),o=Het(),c=Function,u=function(N){try{return c('"use strict"; return ('+N+").constructor;")()}catch{}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch{h=null}var f=function(){throw new a},d=h?(function(){try{return arguments.callee,f}catch{try{return h(arguments,"callee").get}catch{return f}}})():f,p=zet()(),g=Wet()(),y=Object.getPrototypeOf||(g?function(N){return N.__proto__}:null),b={},m=typeof Uint8Array>"u"||!y?n:y(Uint8Array),w={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":p&&y?y([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":e,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":c,"%GeneratorFunction%":b,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p&&y?y(y([][Symbol.iterator]())):n,"%JSON%":typeof JSON=="object"?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!p||!y?n:y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":r,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!p||!y?n:y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p&&y?y(""[Symbol.iterator]()):n,"%Symbol%":p?Symbol:n,"%SyntaxError%":s,"%ThrowTypeError%":d,"%TypedArray%":m,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":o,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet};if(y)try{null.error}catch(N){var A=y(y(N));w["%Error.prototype%"]=A}var _=function N(D){var F;if(D==="%AsyncFunction%")F=u("async function () {}");else if(D==="%GeneratorFunction%")F=u("function* () {}");else if(D==="%AsyncGeneratorFunction%")F=u("async function* () {}");else if(D==="%AsyncGenerator%"){var P=N("%AsyncGeneratorFunction%");P&&(F=P.prototype)}else if(D==="%AsyncIteratorPrototype%"){var V=N("%AsyncGenerator%");V&&y&&(F=y(V.prototype))}return w[D]=F,F},S={__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"]},I=AL(),C=Vet(),M=I.call(Function.call,Array.prototype.concat),z=I.call(Function.apply,Array.prototype.splice),G=I.call(Function.call,String.prototype.replace),Y=I.call(Function.call,String.prototype.slice),L=I.call(Function.call,RegExp.prototype.exec),j=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q=/\\(\\)?/g,nt=function(D){var F=Y(D,0,1),P=Y(D,-1);if(F==="%"&&P!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(P==="%"&&F!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var V=[];return G(D,j,function($,H,rt,lt){V[V.length]=rt?G(lt,q,"$1"):H||$}),V},J=function(D,F){var P=D,V;if(C(S,P)&&(V=S[P],P="%"+V[0]+"%"),C(w,P)){var $=w[P];if($===b&&($=_(P)),typeof $>"u"&&!F)throw new a("intrinsic "+D+" exists, but is not available. Please file an issue!");return{alias:V,name:P,value:$}}throw new s("intrinsic "+D+" does not exist!")};return dL=function(D,F){if(typeof D!="string"||D.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof F!="boolean")throw new a('"allowMissing" argument must be a boolean');if(L(/^%?[^%]*%?$/,D)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var P=nt(D),V=P.length>0?P[0]:"",$=J("%"+V+"%",F),H=$.name,rt=$.value,lt=!1,ft=$.alias;ft&&(V=ft[0],z(P,M([0,1],ft)));for(var K=1,X=!0;K<P.length;K+=1){var st=P[K],bt=Y(st,0,1),wt=Y(st,-1);if((bt==='"'||bt==="'"||bt==="`"||wt==='"'||wt==="'"||wt==="`")&&bt!==wt)throw new s("property names with quotes must have matching quotes");if((st==="constructor"||!X)&&(lt=!0),V+="."+st,H="%"+V+"%",C(w,H))rt=w[H];else if(rt!=null){if(!(st in rt)){if(!F)throw new a("base intrinsic for "+D+" exists, but the property is not available.");return}if(h&&K+1>=P.length){var Q=h(rt,st);X=!!Q,X&&"get"in Q&&!("originalValue"in Q.get)?rt=Q.get:rt=rt[st]}else X=C(rt,st),rt=rt[st];X&&!lt&&(w[H]=rt)}}return rt},dL}function EL(){if(E9)return pL;E9=!0;var n=sg(),t=n("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return pL=t,pL}function _C(){if(x9)return gL;x9=!0;var n=sg(),t=n("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return gL=t,gL}function Xet(){if(S9)return mL;S9=!0;var n=EL(),t=I9(),e=H0(),r=_C();return mL=function(s,a,o){if(!s||typeof s!="object"&&typeof s!="function")throw new e("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new e("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,d=!!r&&r(s,a);if(n)n(s,a,{configurable:h===null&&d?d.configurable:!h,enumerable:c===null&&d?d.enumerable:!c,value:o,writable:u===null&&d?d.writable:!u});else if(f||!c&&!u&&!h)s[a]=o;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},mL}function qet(){if(_9)return yL;_9=!0;var n=EL(),t=function(){return!!n};return t.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],"length",{value:1}).length!==1}catch{return!0}},yL=t,yL}function Yet(){if(T9)return bL;T9=!0;var n=sg(),t=Xet(),e=qet()(),r=_C(),i=H0(),s=n("%Math.floor%");return bL=function(o,c){if(typeof o!="function")throw new i("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||s(c)!==c)throw new i("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],h=!0,f=!0;if("length"in o&&r){var d=r(o,"length");d&&!d.configurable&&(h=!1),d&&!d.writable&&(f=!1)}return(h||f||!u)&&(e?t(o,"length",c,!0,!0):t(o,"length",c)),o},bL}function xL(){if(C9)return SE;C9=!0;var n=AL(),t=sg(),e=Yet(),r=H0(),i=t("%Function.prototype.apply%"),s=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||n.call(s,i),o=EL(),c=t("%Math.max%");SE=function(f){if(typeof f!="function")throw new r("a function is required");var d=a(n,s,arguments);return e(d,1+c(0,f.length-(arguments.length-1)),!0)};var u=function(){return a(n,i,arguments)};return o?o(SE,"apply",{value:u}):SE.apply=u,SE}function _E(){if(R9)return vL;R9=!0;var n=sg(),t=xL(),e=t(n("String.prototype.indexOf"));return vL=function(i,s){var a=n(i,!!s);return typeof a=="function"&&e(i,".prototype.")>-1?t(a):a},vL}var tL,l9,eL,c9,rL,u9,nL,h9,iL,f9,sL,d9,aL,p9,oL,g9,lL,m9,cL,y9,uL,b9,hL,v9,fL,w9,dL,A9,pL,E9,gL,x9,mL,S9,yL,_9,bL,T9,SE,C9,vL,R9,TE=br(()=>{Tt();Rt();Ct();tL={},l9=!1;eL={},c9=!1;rL={},u9=!1;nL={},h9=!1;iL={},f9=!1;sL={},d9=!1;aL={},p9=!1;oL={},g9=!1;lL={},m9=!1;cL={},y9=!1;uL={},b9=!1;hL={},v9=!1;fL={},w9=!1;dL={},A9=!1;pL={},E9=!1;gL={},x9=!1;mL={},S9=!1;yL={},_9=!1;bL={},T9=!1;SE={},C9=!1;vL={},R9=!1});function Ket(){if(D9)return SL;D9=!0;var n=$n;function t(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function e(s,a){for(var o="",c=0,u=-1,h=0,f,d=0;d<=s.length;++d){if(d<s.length)f=s.charCodeAt(d);else{if(f===47)break;f=47}if(f===47){if(!(u===d-1||h===1))if(u!==d-1&&h===2){if(o.length<2||c!==2||o.charCodeAt(o.length-1)!==46||o.charCodeAt(o.length-2)!==46){if(o.length>2){var p=o.lastIndexOf("/");if(p!==o.length-1){p===-1?(o="",c=0):(o=o.slice(0,p),c=o.length-1-o.lastIndexOf("/")),u=d,h=0;continue}}else if(o.length===2||o.length===1){o="",c=0,u=d,h=0;continue}}a&&(o.length>0?o+="/..":o="..",c=2)}else o.length>0?o+="/"+s.slice(u+1,d):o=s.slice(u+1,d),c=d-u-1;u=d,h=0}else f===46&&h!==-1?++h:h=-1}return o}function r(s,a){var o=a.dir||a.root,c=a.base||(a.name||"")+(a.ext||"");return o?o===a.root?o+c:o+s+c:c}var i={resolve:function(){for(var a="",o=!1,c,u=arguments.length-1;u>=-1&&!o;u--){var h;u>=0?h=arguments[u]:(c===void 0&&(c=n.cwd()),h=c),t(h),h.length!==0&&(a=h+"/"+a,o=h.charCodeAt(0)===47)}return a=e(a,!o),o?a.length>0?"/"+a:"/":a.length>0?a:"."},normalize:function(a){if(t(a),a.length===0)return".";var o=a.charCodeAt(0)===47,c=a.charCodeAt(a.length-1)===47;return a=e(a,!o),a.length===0&&!o&&(a="."),a.length>0&&c&&(a+="/"),o?"/"+a:a},isAbsolute:function(a){return t(a),a.length>0&&a.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var a,o=0;o<arguments.length;++o){var c=arguments[o];t(c),c.length>0&&(a===void 0?a=c:a+="/"+c)}return a===void 0?".":i.normalize(a)},relative:function(a,o){if(t(a),t(o),a===o||(a=i.resolve(a),o=i.resolve(o),a===o))return"";for(var c=1;c<a.length&&a.charCodeAt(c)===47;++c);for(var u=a.length,h=u-c,f=1;f<o.length&&o.charCodeAt(f)===47;++f);for(var d=o.length,p=d-f,g=h<p?h:p,y=-1,b=0;b<=g;++b){if(b===g){if(p>g){if(o.charCodeAt(f+b)===47)return o.slice(f+b+1);if(b===0)return o.slice(f+b)}else h>g&&(a.charCodeAt(c+b)===47?y=b:b===0&&(y=0));break}var m=a.charCodeAt(c+b),w=o.charCodeAt(f+b);if(m!==w)break;m===47&&(y=b)}var A="";for(b=c+y+1;b<=u;++b)(b===u||a.charCodeAt(b)===47)&&(A.length===0?A+="..":A+="/..");return A.length>0?A+o.slice(f+y):(f+=y,o.charCodeAt(f)===47&&++f,o.slice(f))},_makeLong:function(a){return a},dirname:function(a){if(t(a),a.length===0)return".";for(var o=a.charCodeAt(0),c=o===47,u=-1,h=!0,f=a.length-1;f>=1;--f)if(o=a.charCodeAt(f),o===47){if(!h){u=f;break}}else h=!1;return u===-1?c?"/":".":c&&u===1?"//":a.slice(0,u)},basename:function(a,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');t(a);var c=0,u=-1,h=!0,f;if(o!==void 0&&o.length>0&&o.length<=a.length){if(o.length===a.length&&o===a)return"";var d=o.length-1,p=-1;for(f=a.length-1;f>=0;--f){var g=a.charCodeAt(f);if(g===47){if(!h){c=f+1;break}}else p===-1&&(h=!1,p=f+1),d>=0&&(g===o.charCodeAt(d)?--d===-1&&(u=f):(d=-1,u=p))}return c===u?u=p:u===-1&&(u=a.length),a.slice(c,u)}else{for(f=a.length-1;f>=0;--f)if(a.charCodeAt(f)===47){if(!h){c=f+1;break}}else u===-1&&(h=!1,u=f+1);return u===-1?"":a.slice(c,u)}},extname:function(a){t(a);for(var o=-1,c=0,u=-1,h=!0,f=0,d=a.length-1;d>=0;--d){var p=a.charCodeAt(d);if(p===47){if(!h){c=d+1;break}continue}u===-1&&(h=!1,u=d+1),p===46?o===-1?o=d:f!==1&&(f=1):o!==-1&&(f=-1)}return o===-1||u===-1||f===0||f===1&&o===u-1&&o===c+1?"":a.slice(o,u)},format:function(a){if(a===null||typeof a!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof a);return r("/",a)},parse:function(a){t(a);var o={root:"",dir:"",base:"",ext:"",name:""};if(a.length===0)return o;var c=a.charCodeAt(0),u=c===47,h;u?(o.root="/",h=1):h=0;for(var f=-1,d=0,p=-1,g=!0,y=a.length-1,b=0;y>=h;--y){if(c=a.charCodeAt(y),c===47){if(!g){d=y+1;break}continue}p===-1&&(g=!1,p=y+1),c===46?f===-1?f=y:b!==1&&(b=1):f!==-1&&(b=-1)}return f===-1||p===-1||b===0||b===1&&f===p-1&&f===d+1?p!==-1&&(d===0&&u?o.base=o.name=a.slice(1,p):o.base=o.name=a.slice(d,p)):(d===0&&u?(o.name=a.slice(1,f),o.base=a.slice(1,p)):(o.name=a.slice(d,f),o.base=a.slice(d,p)),o.ext=a.slice(f,p)),d>0?o.dir=a.slice(0,d-1):u&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,SL=i,SL}var SL,D9,_L,TL=br(()=>{Tt();Rt();Ct();Jp();SL={},D9=!1;_L=Ket()});function Jet(){if(O9)return CL;O9=!0;var n=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,e=n&&t&&typeof t.get=="function"?t.get:null,r=n&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,s=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,a=i&&s&&typeof s.get=="function"?s.get:null,o=i&&Set.prototype.forEach,c=typeof WeakMap=="function"&&WeakMap.prototype,u=c?WeakMap.prototype.has:null,h=typeof WeakSet=="function"&&WeakSet.prototype,f=h?WeakSet.prototype.has:null,d=typeof WeakRef=="function"&&WeakRef.prototype,p=d?WeakRef.prototype.deref:null,g=Boolean.prototype.valueOf,y=Object.prototype.toString,b=Function.prototype.toString,m=String.prototype.match,w=String.prototype.slice,A=String.prototype.replace,_=String.prototype.toUpperCase,S=String.prototype.toLowerCase,I=RegExp.prototype.test,C=Array.prototype.concat,M=Array.prototype.join,z=Array.prototype.slice,G=Math.floor,Y=typeof BigInt=="function"?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,q=typeof Symbol=="function"&&typeof Symbol.iterator=="object",nt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===q||!0)?Symbol.toStringTag:null,J=Object.prototype.propertyIsEnumerable,N=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(mt){return mt.__proto__}:null);function D(mt,St){if(mt===1/0||mt===-1/0||mt!==mt||mt&&mt>-1e3&&mt<1e3||I.call(/e/,St))return St;var Et=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof mt=="number"){var Dt=mt<0?-G(-mt):G(mt);if(Dt!==mt){var et=String(Dt),Ut=w.call(St,et.length+1);return A.call(et,Et,"$&_")+"."+A.call(A.call(Ut,/([0-9]{3})/g,"$&_"),/_$/,"")}}return A.call(St,Et,"$&_")}var F=Zet,P=F.custom,V=wt(P)?P:null;CL=function mt(St,Et,Dt,et){var Ut=Et||{};if(at(Ut,"quoteStyle")&&Ut.quoteStyle!=="single"&&Ut.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(at(Ut,"maxStringLength")&&(typeof Ut.maxStringLength=="number"?Ut.maxStringLength<0&&Ut.maxStringLength!==1/0:Ut.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var oe=at(Ut,"customInspect")?Ut.customInspect:!0;if(typeof oe!="boolean"&&oe!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(at(Ut,"indent")&&Ut.indent!==null&&Ut.indent!==" "&&!(parseInt(Ut.indent,10)===Ut.indent&&Ut.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(at(Ut,"numericSeparator")&&typeof Ut.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var U=Ut.numericSeparator;if(typeof St>"u")return"undefined";if(St===null)return"null";if(typeof St=="boolean")return St?"true":"false";if(typeof St=="string")return Jt(St,Ut);if(typeof St=="number"){if(St===0)return 1/0/St>0?"0":"-0";var Mt=String(St);return U?D(St,Mt):Mt}if(typeof St=="bigint"){var Ht=String(St)+"n";return U?D(St,Ht):Ht}var dt=typeof Ut.depth>"u"?5:Ut.depth;if(typeof Dt>"u"&&(Dt=0),Dt>=dt&&dt>0&&typeof St=="object")return rt(St)?"[Array]":"[Object]";var It=it(Ut,Dt);if(typeof et>"u")et=[];else if(At(et,St)>=0)return"[Circular]";function Ft(yr,ri,ni){if(ri&&(et=z.call(et),et.push(ri)),ni){var ii={depth:Ut.depth};return at(Ut,"quoteStyle")&&(ii.quoteStyle=Ut.quoteStyle),mt(yr,ii,Dt+1,et)}return mt(yr,Ut,Dt+1,et)}if(typeof St=="function"&&!ft(St)){var de=_t(St),ut=ct(St,Ft);return"[Function"+(de?": "+de:" (anonymous)")+"]"+(ut.length>0?" { "+M.call(ut,", ")+" }":"")}if(wt(St)){var yt=q?A.call(String(St),/^(Symbol\(.*\))_[^)]*$/,"$1"):j.call(St);return typeof St=="object"&&!q?O(yt):yt}if(qt(St)){for(var Wt="<"+S.call(String(St.nodeName)),jt=St.attributes||[],Zt=0;Zt<jt.length;Zt++)Wt+=" "+jt[Zt].name+"="+$(H(jt[Zt].value),"double",Ut);return Wt+=">",St.childNodes&&St.childNodes.length&&(Wt+="..."),Wt+="</"+S.call(String(St.nodeName))+">",Wt}if(rt(St)){if(St.length===0)return"[]";var be=ct(St,Ft);return It&&!B(be)?"["+k(be,It)+"]":"[ "+M.call(be,", ")+" ]"}if(K(St)){var He=ct(St,Ft);return!("cause"in Error.prototype)&&"cause"in St&&!J.call(St,"cause")?"{ ["+String(St)+"] "+M.call(C.call("[cause]: "+Ft(St.cause),He),", ")+" }":He.length===0?"["+String(St)+"]":"{ ["+String(St)+"] "+M.call(He,", ")+" }"}if(typeof St=="object"&&oe){if(V&&typeof St[V]=="function"&&F)return F(St,{depth:dt-Dt});if(oe!=="symbol"&&typeof St.inspect=="function")return St.inspect()}if(gt(St)){var Oe=[];return r&&r.call(St,function(yr,ri){Oe.push(Ft(ri,St,!0)+" => "+Ft(yr,St))}),E("Map",e.call(St),Oe,It)}if(Nt(St)){var Br=[];return o&&o.call(St,function(yr){Br.push(Ft(yr,St))}),E("Set",a.call(St),Br,It)}if(xt(St))return v("WeakMap");if(Ot(St))return v("WeakSet");if($t(St))return v("WeakRef");if(st(St))return O(Ft(Number(St)));if(Q(St))return O(Ft(Y.call(St)));if(bt(St))return O(g.call(St));if(X(St))return O(Ft(String(St)));if(typeof window<"u"&&St===window)return"{ [object Window] }";if(typeof globalThis<"u"&&St===globalThis||typeof RL<"u"&&St===RL)return"{ [object globalThis] }";if(!lt(St)&&!ft(St)){var ma=ct(St,Ft),Es=N?N(St)===Object.prototype:St instanceof Object||St.constructor===Object,dr=St instanceof Object?"":"null prototype",En=!Es&&nt&&Object(St)===St&&nt in St?w.call(pt(St),8,-1):dr?"Object":"",en=Es||typeof St.constructor!="function"?"":St.constructor.name?St.constructor.name+" ":"",cr=en+(En||dr?"["+M.call(C.call([],En||[],dr||[]),": ")+"] ":"");return ma.length===0?cr+"{}":It?cr+"{"+k(ma,It)+"}":cr+"{ "+M.call(ma,", ")+" }"}return String(St)};function $(mt,St,Et){var Dt=(Et.quoteStyle||St)==="double"?'"':"'";return Dt+mt+Dt}function H(mt){return A.call(String(mt),/"/g,"&quot;")}function rt(mt){return pt(mt)==="[object Array]"&&(!nt||!(typeof mt=="object"&&nt in mt))}function lt(mt){return pt(mt)==="[object Date]"&&(!nt||!(typeof mt=="object"&&nt in mt))}function ft(mt){return pt(mt)==="[object RegExp]"&&(!nt||!(typeof mt=="object"&&nt in mt))}function K(mt){return pt(mt)==="[object Error]"&&(!nt||!(typeof mt=="object"&&nt in mt))}function X(mt){return pt(mt)==="[object String]"&&(!nt||!(typeof mt=="object"&&nt in mt))}function st(mt){return pt(mt)==="[object Number]"&&(!nt||!(typeof mt=="object"&&nt in mt))}function bt(mt){return pt(mt)==="[object Boolean]"&&(!nt||!(typeof mt=="object"&&nt in mt))}function wt(mt){if(q)return mt&&typeof mt=="object"&&mt instanceof Symbol;if(typeof mt=="symbol")return!0;if(!mt||typeof mt!="object"||!j)return!1;try{return j.call(mt),!0}catch{}return!1}function Q(mt){if(!mt||typeof mt!="object"||!Y)return!1;try{return Y.call(mt),!0}catch{}return!1}var W=Object.prototype.hasOwnProperty||function(mt){return mt in(this||RL)};function at(mt,St){return W.call(mt,St)}function pt(mt){return y.call(mt)}function _t(mt){if(mt.name)return mt.name;var St=m.call(b.call(mt),/^function\s*([\w$]+)/);return St?St[1]:null}function At(mt,St){if(mt.indexOf)return mt.indexOf(St);for(var Et=0,Dt=mt.length;Et<Dt;Et++)if(mt[Et]===St)return Et;return-1}function gt(mt){if(!e||!mt||typeof mt!="object")return!1;try{e.call(mt);try{a.call(mt)}catch{return!0}return mt instanceof Map}catch{}return!1}function xt(mt){if(!u||!mt||typeof mt!="object")return!1;try{u.call(mt,u);try{f.call(mt,f)}catch{return!0}return mt instanceof WeakMap}catch{}return!1}function $t(mt){if(!p||!mt||typeof mt!="object")return!1;try{return p.call(mt),!0}catch{}return!1}function Nt(mt){if(!a||!mt||typeof mt!="object")return!1;try{a.call(mt);try{e.call(mt)}catch{return!0}return mt instanceof Set}catch{}return!1}function Ot(mt){if(!f||!mt||typeof mt!="object")return!1;try{f.call(mt,f);try{u.call(mt,u)}catch{return!0}return mt instanceof WeakSet}catch{}return!1}function qt(mt){return!mt||typeof mt!="object"?!1:typeof HTMLElement<"u"&&mt instanceof HTMLElement?!0:typeof mt.nodeName=="string"&&typeof mt.getAttribute=="function"}function Jt(mt,St){if(mt.length>St.maxStringLength){var Et=mt.length-St.maxStringLength,Dt="... "+Et+" more character"+(Et>1?"s":"");return Jt(w.call(mt,0,St.maxStringLength),St)+Dt}var et=A.call(A.call(mt,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,te);return $(et,"single",St)}function te(mt){var St=mt.charCodeAt(0),Et={8:"b",9:"t",10:"n",12:"f",13:"r"}[St];return Et?"\\"+Et:"\\x"+(St<16?"0":"")+_.call(St.toString(16))}function O(mt){return"Object("+mt+")"}function v(mt){return mt+" { ? }"}function E(mt,St,Et,Dt){var et=Dt?k(Et,Dt):M.call(Et,", ");return mt+" ("+St+") {"+et+"}"}function B(mt){for(var St=0;St<mt.length;St++)if(At(mt[St],`
75
+ `)>=0)return!1;return!0}function it(mt,St){var Et;if(mt.indent===" ")Et=" ";else if(typeof mt.indent=="number"&&mt.indent>0)Et=M.call(Array(mt.indent+1)," ");else return null;return{base:Et,prev:M.call(Array(St+1),Et)}}function k(mt,St){if(mt.length===0)return"";var Et=`
76
+ `+St.prev+St.base;return Et+M.call(mt,","+Et)+`
77
+ `+St.prev}function ct(mt,St){var Et=rt(mt),Dt=[];if(Et){Dt.length=mt.length;for(var et=0;et<mt.length;et++)Dt[et]=at(mt,et)?St(mt[et],mt):""}var Ut=typeof L=="function"?L(mt):[],oe;if(q){oe={};for(var U=0;U<Ut.length;U++)oe["$"+Ut[U]]=Ut[U]}for(var Mt in mt)at(mt,Mt)&&(Et&&String(Number(Mt))===Mt&&Mt<mt.length||q&&oe["$"+Mt]instanceof Symbol||(I.call(/[^\w$]/,Mt)?Dt.push(St(Mt,mt)+": "+St(mt[Mt],mt)):Dt.push(Mt+": "+St(mt[Mt],mt))));if(typeof L=="function")for(var Ht=0;Ht<Ut.length;Ht++)J.call(mt,Ut[Ht])&&Dt.push("["+St(Ut[Ht])+"]: "+St(mt[Ut[Ht]],mt));return Dt}return CL}function Qet(){if(P9)return IL;P9=!0;var n=sg(),t=_E(),e=Jet(),r=H0(),i=n("%WeakMap%",!0),s=n("%Map%",!0),a=t("WeakMap.prototype.get",!0),o=t("WeakMap.prototype.set",!0),c=t("WeakMap.prototype.has",!0),u=t("Map.prototype.get",!0),h=t("Map.prototype.set",!0),f=t("Map.prototype.has",!0),d=function(b,m){for(var w=b,A;(A=w.next)!==null;w=A)if(A.key===m)return w.next=A.next,A.next=b.next,b.next=A,A},p=function(b,m){var w=d(b,m);return w&&w.value},g=function(b,m,w){var A=d(b,m);A?A.value=w:b.next={key:m,next:b.next,value:w}},y=function(b,m){return!!d(b,m)};return IL=function(){var m,w,A,_={assert:function(S){if(!_.has(S))throw new r("Side channel does not contain "+e(S))},get:function(S){if(i&&S&&(typeof S=="object"||typeof S=="function")){if(m)return a(m,S)}else if(s){if(w)return u(w,S)}else if(A)return p(A,S)},has:function(S){if(i&&S&&(typeof S=="object"||typeof S=="function")){if(m)return c(m,S)}else if(s){if(w)return f(w,S)}else if(A)return y(A,S);return!1},set:function(S,I){i&&S&&(typeof S=="object"||typeof S=="function")?(m||(m=new i),o(m,S,I)):s?(w||(w=new s),h(w,S,I)):(A||(A={key:{},next:null}),g(A,S,I))}};return _},IL}function ML(){if(N9)return DL;N9=!0;var n=String.prototype.replace,t=/%20/g,e={RFC1738:"RFC1738",RFC3986:"RFC3986"};return DL={default:e.RFC3986,formatters:{RFC1738:function(r){return n.call(r,t,"+")},RFC3986:function(r){return String(r)}},RFC1738:e.RFC1738,RFC3986:e.RFC3986},DL}function U9(){if(L9)return OL;L9=!0;var n=ML(),t=Object.prototype.hasOwnProperty,e=Array.isArray,r=(function(){for(var b=[],m=0;m<256;++m)b.push("%"+((m<16?"0":"")+m.toString(16)).toUpperCase());return b})(),i=function(m){for(;m.length>1;){var w=m.pop(),A=w.obj[w.prop];if(e(A)){for(var _=[],S=0;S<A.length;++S)typeof A[S]<"u"&&_.push(A[S]);w.obj[w.prop]=_}}},s=function(m,w){for(var A=w&&w.plainObjects?Object.create(null):{},_=0;_<m.length;++_)typeof m[_]<"u"&&(A[_]=m[_]);return A},a=function b(m,w,A){if(!w)return m;if(typeof w!="object"){if(e(m))m.push(w);else if(m&&typeof m=="object")(A&&(A.plainObjects||A.allowPrototypes)||!t.call(Object.prototype,w))&&(m[w]=!0);else return[m,w];return m}if(!m||typeof m!="object")return[m].concat(w);var _=m;return e(m)&&!e(w)&&(_=s(m,A)),e(m)&&e(w)?(w.forEach(function(S,I){if(t.call(m,I)){var C=m[I];C&&typeof C=="object"&&S&&typeof S=="object"?m[I]=b(C,S,A):m.push(S)}else m[I]=S}),m):Object.keys(w).reduce(function(S,I){var C=w[I];return t.call(S,I)?S[I]=b(S[I],C,A):S[I]=C,S},_)},o=function(m,w){return Object.keys(w).reduce(function(A,_){return A[_]=w[_],A},m)},c=function(b,m,w){var A=b.replace(/\+/g," ");if(w==="iso-8859-1")return A.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(A)}catch{return A}},u=1024,h=function(m,w,A,_,S){if(m.length===0)return m;var I=m;if(typeof m=="symbol"?I=Symbol.prototype.toString.call(m):typeof m!="string"&&(I=String(m)),A==="iso-8859-1")return escape(I).replace(/%u[0-9a-f]{4}/gi,function(j){return"%26%23"+parseInt(j.slice(2),16)+"%3B"});for(var C="",M=0;M<I.length;M+=u){for(var z=I.length>=u?I.slice(M,M+u):I,G=[],Y=0;Y<z.length;++Y){var L=z.charCodeAt(Y);if(L===45||L===46||L===95||L===126||L>=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||S===n.RFC1738&&(L===40||L===41)){G[G.length]=z.charAt(Y);continue}if(L<128){G[G.length]=r[L];continue}if(L<2048){G[G.length]=r[192|L>>6]+r[128|L&63];continue}if(L<55296||L>=57344){G[G.length]=r[224|L>>12]+r[128|L>>6&63]+r[128|L&63];continue}Y+=1,L=65536+((L&1023)<<10|z.charCodeAt(Y)&1023),G[G.length]=r[240|L>>18]+r[128|L>>12&63]+r[128|L>>6&63]+r[128|L&63]}C+=G.join("")}return C},f=function(m){for(var w=[{obj:{o:m},prop:"o"}],A=[],_=0;_<w.length;++_)for(var S=w[_],I=S.obj[S.prop],C=Object.keys(I),M=0;M<C.length;++M){var z=C[M],G=I[z];typeof G=="object"&&G!==null&&A.indexOf(G)===-1&&(w.push({obj:I,prop:z}),A.push(G))}return i(w),m},d=function(m){return Object.prototype.toString.call(m)==="[object RegExp]"},p=function(m){return!m||typeof m!="object"?!1:!!(m.constructor&&m.constructor.isBuffer&&m.constructor.isBuffer(m))},g=function(m,w){return[].concat(m,w)},y=function(m,w){if(e(m)){for(var A=[],_=0;_<m.length;_+=1)A.push(w(m[_]));return A}return w(m)};return OL={arrayToObject:s,assign:o,combine:g,compact:f,decode:c,encode:h,isBuffer:p,isRegExp:d,maybeMap:y,merge:a},OL}function trt(){if(k9)return PL;k9=!0;var n=Qet(),t=U9(),e=ML(),r=Object.prototype.hasOwnProperty,i={brackets:function(b){return b+"[]"},comma:"comma",indices:function(b,m){return b+"["+m+"]"},repeat:function(b){return b}},s=Array.isArray,a=Array.prototype.push,o=function(y,b){a.apply(y,s(b)?b:[b])},c=Date.prototype.toISOString,u=e.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:u,formatter:e.formatters[u],indices:!1,serializeDate:function(b){return c.call(b)},skipNulls:!1,strictNullHandling:!1},f=function(b){return typeof b=="string"||typeof b=="number"||typeof b=="boolean"||typeof b=="symbol"||typeof b=="bigint"},d={},p=function y(b,m,w,A,_,S,I,C,M,z,G,Y,L,j,q,nt,J,N){for(var D=b,F=N,P=0,V=!1;(F=F.get(d))!==void 0&&!V;){var $=F.get(b);if(P+=1,typeof $<"u"){if($===P)throw new RangeError("Cyclic object value");V=!0}typeof F.get(d)>"u"&&(P=0)}if(typeof z=="function"?D=z(m,D):D instanceof Date?D=L(D):w==="comma"&&s(D)&&(D=t.maybeMap(D,function(pt){return pt instanceof Date?L(pt):pt})),D===null){if(S)return M&&!nt?M(m,h.encoder,J,"key",j):m;D=""}if(f(D)||t.isBuffer(D)){if(M){var H=nt?m:M(m,h.encoder,J,"key",j);return[q(H)+"="+q(M(D,h.encoder,J,"value",j))]}return[q(m)+"="+q(String(D))]}var rt=[];if(typeof D>"u")return rt;var lt;if(w==="comma"&&s(D))nt&&M&&(D=t.maybeMap(D,M)),lt=[{value:D.length>0?D.join(",")||null:void 0}];else if(s(z))lt=z;else{var ft=Object.keys(D);lt=G?ft.sort(G):ft}var K=C?m.replace(/\./g,"%2E"):m,X=A&&s(D)&&D.length===1?K+"[]":K;if(_&&s(D)&&D.length===0)return X+"[]";for(var st=0;st<lt.length;++st){var bt=lt[st],wt=typeof bt=="object"&&typeof bt.value<"u"?bt.value:D[bt];if(!(I&&wt===null)){var Q=Y&&C?bt.replace(/\./g,"%2E"):bt,W=s(D)?typeof w=="function"?w(X,Q):X:X+(Y?"."+Q:"["+Q+"]");N.set(b,P);var at=n();at.set(d,N),o(rt,y(wt,W,w,A,_,S,I,C,w==="comma"&&nt&&s(D)?null:M,z,G,Y,L,j,q,nt,J,at))}}return rt},g=function(b){if(!b)return h;if(typeof b.allowEmptyArrays<"u"&&typeof b.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof b.encodeDotInKeys<"u"&&typeof b.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(b.encoder!==null&&typeof b.encoder<"u"&&typeof b.encoder!="function")throw new TypeError("Encoder has to be a function.");var m=b.charset||h.charset;if(typeof b.charset<"u"&&b.charset!=="utf-8"&&b.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var w=e.default;if(typeof b.format<"u"){if(!r.call(e.formatters,b.format))throw new TypeError("Unknown format option provided.");w=b.format}var A=e.formatters[w],_=h.filter;(typeof b.filter=="function"||s(b.filter))&&(_=b.filter);var S;if(b.arrayFormat in i?S=b.arrayFormat:"indices"in b?S=b.indices?"indices":"repeat":S=h.arrayFormat,"commaRoundTrip"in b&&typeof b.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var I=typeof b.allowDots>"u"?b.encodeDotInKeys===!0?!0:h.allowDots:!!b.allowDots;return{addQueryPrefix:typeof b.addQueryPrefix=="boolean"?b.addQueryPrefix:h.addQueryPrefix,allowDots:I,allowEmptyArrays:typeof b.allowEmptyArrays=="boolean"?!!b.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:S,charset:m,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:h.charsetSentinel,commaRoundTrip:b.commaRoundTrip,delimiter:typeof b.delimiter>"u"?h.delimiter:b.delimiter,encode:typeof b.encode=="boolean"?b.encode:h.encode,encodeDotInKeys:typeof b.encodeDotInKeys=="boolean"?b.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof b.encoder=="function"?b.encoder:h.encoder,encodeValuesOnly:typeof b.encodeValuesOnly=="boolean"?b.encodeValuesOnly:h.encodeValuesOnly,filter:_,format:w,formatter:A,serializeDate:typeof b.serializeDate=="function"?b.serializeDate:h.serializeDate,skipNulls:typeof b.skipNulls=="boolean"?b.skipNulls:h.skipNulls,sort:typeof b.sort=="function"?b.sort:null,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:h.strictNullHandling}};return PL=function(y,b){var m=y,w=g(b),A,_;typeof w.filter=="function"?(_=w.filter,m=_("",m)):s(w.filter)&&(_=w.filter,A=_);var S=[];if(typeof m!="object"||m===null)return"";var I=i[w.arrayFormat],C=I==="comma"&&w.commaRoundTrip;A||(A=Object.keys(m)),w.sort&&A.sort(w.sort);for(var M=n(),z=0;z<A.length;++z){var G=A[z];w.skipNulls&&m[G]===null||o(S,p(m[G],G,I,C,w.allowEmptyArrays,w.strictNullHandling,w.skipNulls,w.encodeDotInKeys,w.encode?w.encoder:null,w.filter,w.sort,w.allowDots,w.serializeDate,w.format,w.formatter,w.encodeValuesOnly,w.charset,M))}var Y=S.join(w.delimiter),L=w.addQueryPrefix===!0?"?":"";return w.charsetSentinel&&(w.charset==="iso-8859-1"?L+="utf8=%26%2310003%3B&":L+="utf8=%E2%9C%93&"),Y.length>0?L+Y:""},PL}function ert(){if(M9)return NL;M9=!0;var n=U9(),t=Object.prototype.hasOwnProperty,e=Array.isArray,r={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.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(p,g){return String.fromCharCode(parseInt(g,10))})},s=function(d,p){return d&&typeof d=="string"&&p.comma&&d.indexOf(",")>-1?d.split(","):d},a="utf8=%26%2310003%3B",o="utf8=%E2%9C%93",c=function(p,g){var y={__proto__:null},b=g.ignoreQueryPrefix?p.replace(/^\?/,""):p;b=b.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var m=g.parameterLimit===1/0?void 0:g.parameterLimit,w=b.split(g.delimiter,m),A=-1,_,S=g.charset;if(g.charsetSentinel)for(_=0;_<w.length;++_)w[_].indexOf("utf8=")===0&&(w[_]===o?S="utf-8":w[_]===a&&(S="iso-8859-1"),A=_,_=w.length);for(_=0;_<w.length;++_)if(_!==A){var I=w[_],C=I.indexOf("]="),M=C===-1?I.indexOf("="):C+1,z,G;M===-1?(z=g.decoder(I,r.decoder,S,"key"),G=g.strictNullHandling?null:""):(z=g.decoder(I.slice(0,M),r.decoder,S,"key"),G=n.maybeMap(s(I.slice(M+1),g),function(L){return g.decoder(L,r.decoder,S,"value")})),G&&g.interpretNumericEntities&&S==="iso-8859-1"&&(G=i(G)),I.indexOf("[]=")>-1&&(G=e(G)?[G]:G);var Y=t.call(y,z);Y&&g.duplicates==="combine"?y[z]=n.combine(y[z],G):(!Y||g.duplicates==="last")&&(y[z]=G)}return y},u=function(d,p,g,y){for(var b=y?p:s(p,g),m=d.length-1;m>=0;--m){var w,A=d[m];if(A==="[]"&&g.parseArrays)w=g.allowEmptyArrays&&(b===""||g.strictNullHandling&&b===null)?[]:[].concat(b);else{w=g.plainObjects?Object.create(null):{};var _=A.charAt(0)==="["&&A.charAt(A.length-1)==="]"?A.slice(1,-1):A,S=g.decodeDotInKeys?_.replace(/%2E/g,"."):_,I=parseInt(S,10);!g.parseArrays&&S===""?w={0:b}:!isNaN(I)&&A!==S&&String(I)===S&&I>=0&&g.parseArrays&&I<=g.arrayLimit?(w=[],w[I]=b):S!=="__proto__"&&(w[S]=b)}b=w}return b},h=function(p,g,y,b){if(p){var m=y.allowDots?p.replace(/\.([^.[]+)/g,"[$1]"):p,w=/(\[[^[\]]*])/,A=/(\[[^[\]]*])/g,_=y.depth>0&&w.exec(m),S=_?m.slice(0,_.index):m,I=[];if(S){if(!y.plainObjects&&t.call(Object.prototype,S)&&!y.allowPrototypes)return;I.push(S)}for(var C=0;y.depth>0&&(_=A.exec(m))!==null&&C<y.depth;){if(C+=1,!y.plainObjects&&t.call(Object.prototype,_[1].slice(1,-1))&&!y.allowPrototypes)return;I.push(_[1])}if(_){if(y.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+y.depth+" and strictDepth is true");I.push("["+m.slice(_.index)+"]")}return u(I,g,y,b)}},f=function(p){if(!p)return r;if(typeof p.allowEmptyArrays<"u"&&typeof p.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof p.decodeDotInKeys<"u"&&typeof p.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(p.decoder!==null&&typeof p.decoder<"u"&&typeof p.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof p.charset<"u"&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var g=typeof p.charset>"u"?r.charset:p.charset,y=typeof p.duplicates>"u"?r.duplicates:p.duplicates;if(y!=="combine"&&y!=="first"&&y!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var b=typeof p.allowDots>"u"?p.decodeDotInKeys===!0?!0:r.allowDots:!!p.allowDots;return{allowDots:b,allowEmptyArrays:typeof p.allowEmptyArrays=="boolean"?!!p.allowEmptyArrays:r.allowEmptyArrays,allowPrototypes:typeof p.allowPrototypes=="boolean"?p.allowPrototypes:r.allowPrototypes,allowSparse:typeof p.allowSparse=="boolean"?p.allowSparse:r.allowSparse,arrayLimit:typeof p.arrayLimit=="number"?p.arrayLimit:r.arrayLimit,charset:g,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:r.charsetSentinel,comma:typeof p.comma=="boolean"?p.comma:r.comma,decodeDotInKeys:typeof p.decodeDotInKeys=="boolean"?p.decodeDotInKeys:r.decodeDotInKeys,decoder:typeof p.decoder=="function"?p.decoder:r.decoder,delimiter:typeof p.delimiter=="string"||n.isRegExp(p.delimiter)?p.delimiter:r.delimiter,depth:typeof p.depth=="number"||p.depth===!1?+p.depth:r.depth,duplicates:y,ignoreQueryPrefix:p.ignoreQueryPrefix===!0,interpretNumericEntities:typeof p.interpretNumericEntities=="boolean"?p.interpretNumericEntities:r.interpretNumericEntities,parameterLimit:typeof p.parameterLimit=="number"?p.parameterLimit:r.parameterLimit,parseArrays:p.parseArrays!==!1,plainObjects:typeof p.plainObjects=="boolean"?p.plainObjects:r.plainObjects,strictDepth:typeof p.strictDepth=="boolean"?!!p.strictDepth:r.strictDepth,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:r.strictNullHandling}};return NL=function(d,p){var g=f(p);if(d===""||d===null||typeof d>"u")return g.plainObjects?Object.create(null):{};for(var y=typeof d=="string"?c(d,g):d,b=g.plainObjects?Object.create(null):{},m=Object.keys(y),w=0;w<m.length;++w){var A=m[w],_=h(A,y[A],g,typeof d=="string");b=n.merge(b,_,g)}return g.allowSparse===!0?b:n.compact(b)},NL}function rrt(){if(F9)return LL;F9=!0;var n=trt(),t=ert(),e=ML();return LL={formats:e,parse:t,stringify:n},LL}function nrt(){if(B9)return ag;B9=!0;var n=Lf;function t(){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 e=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,s=["<",">",'"',"`"," ","\r",`
78
+ `," "],a=["{","}","|","\\","^","`"].concat(s),o=["'"].concat(a),c=["%","/","?",";","#"].concat(o),u=["/","?","#"],h=255,f=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=rrt();function m(S,I,C){if(S&&typeof S=="object"&&S instanceof t)return S;var M=new t;return M.parse(S,I,C),M}t.prototype.parse=function(S,I,C){if(typeof S!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof S);var M=S.indexOf("?"),z=M!==-1&&M<S.indexOf("#")?"?":"#",G=S.split(z),Y=/\\/g;G[0]=G[0].replace(Y,"/"),S=G.join(z);var L=S;if(L=L.trim(),!C&&S.split("#").length===1){var j=i.exec(L);if(j)return this.path=L,this.href=L,this.pathname=j[1],j[2]?(this.search=j[2],I?this.query=b.parse(this.search.substr(1)):this.query=this.search.substr(1)):I&&(this.search="",this.query={}),this}var q=e.exec(L);if(q){q=q[0];var nt=q.toLowerCase();this.protocol=nt,L=L.substr(q.length)}if(C||q||L.match(/^\/\/[^@/]+@[^@/]+/)){var J=L.substr(0,2)==="//";J&&!(q&&g[q])&&(L=L.substr(2),this.slashes=!0)}if(!g[q]&&(J||q&&!y[q])){for(var N=-1,D=0;D<u.length;D++){var F=L.indexOf(u[D]);F!==-1&&(N===-1||F<N)&&(N=F)}var P,V;N===-1?V=L.lastIndexOf("@"):V=L.lastIndexOf("@",N),V!==-1&&(P=L.slice(0,V),L=L.slice(V+1),this.auth=decodeURIComponent(P)),N=-1;for(var D=0;D<c.length;D++){var F=L.indexOf(c[D]);F!==-1&&(N===-1||F<N)&&(N=F)}N===-1&&(N=L.length),this.host=L.slice(0,N),L=L.slice(N),this.parseHost(),this.hostname=this.hostname||"";var $=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!$)for(var H=this.hostname.split(/\./),D=0,rt=H.length;D<rt;D++){var lt=H[D];if(lt&&!lt.match(f)){for(var ft="",K=0,X=lt.length;K<X;K++)lt.charCodeAt(K)>127?ft+="x":ft+=lt[K];if(!ft.match(f)){var st=H.slice(0,D),bt=H.slice(D+1),wt=lt.match(d);wt&&(st.push(wt[1]),bt.unshift(wt[2])),bt.length&&(L="/"+bt.join(".")+L),this.hostname=st.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),$||(this.hostname=n.toASCII(this.hostname));var Q=this.port?":"+this.port:"",W=this.hostname||"";this.host=W+Q,this.href+=this.host,$&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),L[0]!=="/"&&(L="/"+L))}if(!p[nt])for(var D=0,rt=o.length;D<rt;D++){var at=o[D];if(L.indexOf(at)!==-1){var pt=encodeURIComponent(at);pt===at&&(pt=escape(at)),L=L.split(at).join(pt)}}var _t=L.indexOf("#");_t!==-1&&(this.hash=L.substr(_t),L=L.slice(0,_t));var At=L.indexOf("?");if(At!==-1?(this.search=L.substr(At),this.query=L.substr(At+1),I&&(this.query=b.parse(this.query)),L=L.slice(0,At)):I&&(this.search="",this.query={}),L&&(this.pathname=L),y[nt]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var Q=this.pathname||"",gt=this.search||"";this.path=Q+gt}return this.href=this.format(),this};function w(S){return typeof S=="string"&&(S=m(S)),S instanceof t?S.format():t.prototype.format.call(S)}t.prototype.format=function(){var S=this.auth||"";S&&(S=encodeURIComponent(S),S=S.replace(/%3A/i,":"),S+="@");var I=this.protocol||"",C=this.pathname||"",M=this.hash||"",z=!1,G="";this.host?z=S+this.host:this.hostname&&(z=S+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(z+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(G=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var Y=this.search||G&&"?"+G||"";return I&&I.substr(-1)!==":"&&(I+=":"),this.slashes||(!I||y[I])&&z!==!1?(z="//"+(z||""),C&&C.charAt(0)!=="/"&&(C="/"+C)):z||(z=""),M&&M.charAt(0)!=="#"&&(M="#"+M),Y&&Y.charAt(0)!=="?"&&(Y="?"+Y),C=C.replace(/[?#]/g,function(L){return encodeURIComponent(L)}),Y=Y.replace("#","%23"),I+z+C+Y+M};function A(S,I){return m(S,!1,!0).resolve(I)}t.prototype.resolve=function(S){return this.resolveObject(m(S,!1,!0)).format()};function _(S,I){return S?m(S,!1,!0).resolveObject(I):I}return t.prototype.resolveObject=function(S){if(typeof S=="string"){var I=new t;I.parse(S,!1,!0),S=I}for(var C=new t,M=Object.keys(this),z=0;z<M.length;z++){var G=M[z];C[G]=this[G]}if(C.hash=S.hash,S.href==="")return C.href=C.format(),C;if(S.slashes&&!S.protocol){for(var Y=Object.keys(S),L=0;L<Y.length;L++){var j=Y[L];j!=="protocol"&&(C[j]=S[j])}return y[C.protocol]&&C.hostname&&!C.pathname&&(C.pathname="/",C.path=C.pathname),C.href=C.format(),C}if(S.protocol&&S.protocol!==C.protocol){if(!y[S.protocol]){for(var q=Object.keys(S),nt=0;nt<q.length;nt++){var J=q[nt];C[J]=S[J]}return C.href=C.format(),C}if(C.protocol=S.protocol,!S.host&&!g[S.protocol]){for(var rt=(S.pathname||"").split("/");rt.length&&!(S.host=rt.shift()););S.host||(S.host=""),S.hostname||(S.hostname=""),rt[0]!==""&&rt.unshift(""),rt.length<2&&rt.unshift(""),C.pathname=rt.join("/")}else C.pathname=S.pathname;if(C.search=S.search,C.query=S.query,C.host=S.host||"",C.auth=S.auth,C.hostname=S.hostname||S.host,C.port=S.port,C.pathname||C.search){var N=C.pathname||"",D=C.search||"";C.path=N+D}return C.slashes=C.slashes||S.slashes,C.href=C.format(),C}var F=C.pathname&&C.pathname.charAt(0)==="/",P=S.host||S.pathname&&S.pathname.charAt(0)==="/",V=P||F||C.host&&S.pathname,$=V,H=C.pathname&&C.pathname.split("/")||[],rt=S.pathname&&S.pathname.split("/")||[],lt=C.protocol&&!y[C.protocol];if(lt&&(C.hostname="",C.port=null,C.host&&(H[0]===""?H[0]=C.host:H.unshift(C.host)),C.host="",S.protocol&&(S.hostname=null,S.port=null,S.host&&(rt[0]===""?rt[0]=S.host:rt.unshift(S.host)),S.host=null),V=V&&(rt[0]===""||H[0]==="")),P)C.host=S.host||S.host===""?S.host:C.host,C.hostname=S.hostname||S.hostname===""?S.hostname:C.hostname,C.search=S.search,C.query=S.query,H=rt;else if(rt.length)H||(H=[]),H.pop(),H=H.concat(rt),C.search=S.search,C.query=S.query;else if(S.search!=null){if(lt){C.host=H.shift(),C.hostname=C.host;var ft=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;ft&&(C.auth=ft.shift(),C.hostname=ft.shift(),C.host=C.hostname)}return C.search=S.search,C.query=S.query,(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.href=C.format(),C}if(!H.length)return C.pathname=null,C.search?C.path="/"+C.search:C.path=null,C.href=C.format(),C;for(var K=H.slice(-1)[0],X=(C.host||S.host||H.length>1)&&(K==="."||K==="..")||K==="",st=0,bt=H.length;bt>=0;bt--)K=H[bt],K==="."?H.splice(bt,1):K===".."?(H.splice(bt,1),st++):st&&(H.splice(bt,1),st--);if(!V&&!$)for(;st--;st)H.unshift("..");V&&H[0]!==""&&(!H[0]||H[0].charAt(0)!=="/")&&H.unshift(""),X&&H.join("/").substr(-1)!=="/"&&H.push("");var wt=H[0]===""||H[0]&&H[0].charAt(0)==="/";if(lt){C.hostname=wt?"":H.length?H.shift():"",C.host=C.hostname;var ft=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;ft&&(C.auth=ft.shift(),C.hostname=ft.shift(),C.host=C.hostname)}return V=V||C.host&&H.length,V&&!wt&&H.unshift(""),H.length>0?C.pathname=H.join("/"):(C.pathname=null,C.path=null),(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.auth=S.auth||C.auth,C.slashes=C.slashes||S.slashes,C.href=C.format(),C},t.prototype.parseHost=function(){var S=this.host,I=r.exec(S);I&&(I=I[0],I!==":"&&(this.port=I.substr(1)),S=S.substr(0,S.length-I.length)),S&&(this.hostname=S)},ag.parse=m,ag.resolve=A,ag.resolveObject=_,ag.format=w,ag.Url=t,ag}function FL(n){if(typeof n=="string")n=new URL(n);else if(!(n instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(n.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return kL?grt(n):mrt(n)}function grt(n){let t=n.hostname,e=n.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let i=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&i===102||e[r+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(e=e.replace(crt,"\\"),e=decodeURIComponent(e),t!=="")return`\\\\${t}${e}`;{let r=e.codePointAt(1)|32,i=e[2];if(r<ort||r>lrt||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return e.slice(1)}}function mrt(n){if(n.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let t=n.pathname;for(let e=0;e<t.length;e++)if(t[e]==="%"){let r=t.codePointAt(e+2)||32;if(t[e+1]==="2"&&r===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}function yrt(n){let t=_L.resolve(n),e=n.charCodeAt(n.length-1);(e===art||kL&&e===srt)&&t[t.length-1]!==_L.sep&&(t+="/");let r=new URL("file://");return t.includes("%")&&(t=t.replace(urt,"%25")),!kL&&t.includes("\\")&&(t=t.replace(hrt,"%5C")),t.includes(`
79
+ `)&&(t=t.replace(frt,"%0A")),t.includes("\r")&&(t=t.replace(drt,"%0D")),t.includes(" ")&&(t=t.replace(prt,"%09")),r.pathname=t,r}var Zet,CL,O9,RL,IL,P9,DL,N9,OL,L9,PL,k9,NL,M9,LL,F9,ag,B9,Gs,irt,kpt,Mpt,Fpt,Bpt,Upt,jpt,srt,art,ort,lrt,kL,crt,urt,hrt,frt,drt,prt,j9=br(()=>{Tt();Rt();Ct();QN();TE();TL();Jp();Zet=Object.freeze(Object.create(null)),CL={},O9=!1,RL=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;IL={},P9=!1;DL={},N9=!1;OL={},L9=!1;PL={},k9=!1;NL={},M9=!1;LL={},F9=!1;ag={},B9=!1;Gs=nrt();Gs.parse;Gs.resolve;Gs.resolveObject;Gs.format;Gs.Url;irt=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;Gs.URL=typeof URL<"u"?URL:null;Gs.pathToFileURL=yrt;Gs.fileURLToPath=FL;kpt=Gs.Url,Mpt=Gs.format,Fpt=Gs.resolve,Bpt=Gs.resolveObject,Upt=Gs.parse,jpt=Gs.URL,srt=92,art=47,ort=97,lrt=122,kL=irt==="win32",crt=/\//g,urt=/%/g,hrt=/\\/g,frt=/\n/g,drt=/\r/g,prt=/\t/g});var DE={};tc(DE,{Dir:()=>sit,Dirent:()=>ait,F_OK:()=>dit,FileReadStream:()=>uit,FileWriteStream:()=>hit,R_OK:()=>pit,ReadStream:()=>lit,Stats:()=>oit,W_OK:()=>git,WriteStream:()=>cit,X_OK:()=>mit,_toUnixTimestamp:()=>fit,access:()=>Lrt,accessSync:()=>krt,appendFile:()=>Prt,appendFileSync:()=>Nrt,chmod:()=>Brt,chmodSync:()=>Urt,chown:()=>Mrt,chownSync:()=>Frt,close:()=>jrt,closeSync:()=>$rt,constants:()=>yit,copyFile:()=>Hrt,copyFileSync:()=>zrt,cp:()=>Wrt,cpSync:()=>Grt,createReadStream:()=>Vrt,createWriteStream:()=>Xrt,default:()=>rn,exists:()=>qrt,existsSync:()=>IC,fchmod:()=>Zrt,fchmodSync:()=>Jrt,fchown:()=>Yrt,fchownSync:()=>Krt,fdatasync:()=>Qrt,fdatasyncSync:()=>tnt,fstat:()=>ent,fstatSync:()=>rnt,fsync:()=>nnt,fsyncSync:()=>int,ftruncate:()=>snt,ftruncateSync:()=>ant,futimes:()=>ont,futimesSync:()=>lnt,lchmod:()=>hnt,lchmodSync:()=>fnt,lchown:()=>cnt,lchownSync:()=>unt,link:()=>dnt,linkSync:()=>pnt,lstat:()=>gnt,lstatSync:()=>$L,mkdir:()=>mnt,mkdirSync:()=>ynt,mkdtemp:()=>bnt,mkdtempSync:()=>vnt,open:()=>wnt,openSync:()=>Ant,opendir:()=>Ent,opendirSync:()=>xnt,promises:()=>bit,read:()=>Tnt,readFile:()=>Dnt,readFileSync:()=>HL,readSync:()=>Cnt,readdir:()=>Snt,readdirSync:()=>_nt,readlink:()=>Ont,readlinkSync:()=>Pnt,readv:()=>Rnt,readvSync:()=>Int,realpath:()=>Nnt,realpathSync:()=>Lnt,rename:()=>knt,renameSync:()=>Mnt,rm:()=>Fnt,rmSync:()=>Bnt,rmdir:()=>Unt,rmdirSync:()=>jnt,stat:()=>$nt,statSync:()=>Hnt,symlink:()=>znt,symlinkSync:()=>Wnt,truncate:()=>Gnt,truncateSync:()=>Vnt,unlink:()=>qnt,unlinkSync:()=>Ynt,unwatchFile:()=>Xnt,utimes:()=>Knt,utimesSync:()=>Znt,watch:()=>Jnt,watchFile:()=>Qnt,write:()=>eit,writeFile:()=>tit,writeFileSync:()=>h7,writeSync:()=>rit,writev:()=>nit,writevSync:()=>iit});function IE(){return $9||($9=!0,Object.defineProperty(CE,"__esModule",{value:!0}),CE.constants=void 0,CE.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}),CE}function brt(){return H9||(H9=!0,typeof BigInt=="function"?TC.default=BigInt:TC.default=function(){throw new Error("BigInt is not supported in this environment.")}),TC}function BL(){if(z9)return z0;z9=!0,Object.defineProperty(z0,"__esModule",{value:!0}),z0.Stats=void 0;var n=IE(),t=brt(),e=n.constants.S_IFMT,r=n.constants.S_IFDIR,i=n.constants.S_IFREG,s=n.constants.S_IFBLK,a=n.constants.S_IFCHR,o=n.constants.S_IFLNK,c=n.constants.S_IFIFO,u=n.constants.S_IFSOCK,h=(function(){function f(){}return f.build=function(d,p){p===void 0&&(p=!1);var g=new f,y=d.uid,b=d.gid,m=d.atime,w=d.mtime,A=d.ctime,_=p?t.default:function(I){return I};g.uid=_(y),g.gid=_(b),g.rdev=_(0),g.blksize=_(4096),g.ino=_(d.ino),g.size=_(d.getSize()),g.blocks=_(1),g.atime=m,g.mtime=w,g.ctime=A,g.birthtime=A,g.atimeMs=_(m.getTime()),g.mtimeMs=_(w.getTime());var S=_(A.getTime());return g.ctimeMs=S,g.birthtimeMs=S,g.dev=_(0),g.mode=_(d.mode),g.nlink=_(d.nlink),g},f.prototype._checkModeProperty=function(d){return(Number(this.mode)&e)===d},f.prototype.isDirectory=function(){return this._checkModeProperty(r)},f.prototype.isFile=function(){return this._checkModeProperty(i)},f.prototype.isBlockDevice=function(){return this._checkModeProperty(s)},f.prototype.isCharacterDevice=function(){return this._checkModeProperty(a)},f.prototype.isSymbolicLink=function(){return this._checkModeProperty(o)},f.prototype.isFIFO=function(){return this._checkModeProperty(c)},f.prototype.isSocket=function(){return this._checkModeProperty(u)},f})();return z0.Stats=h,z0.default=h,z0}function UL(){if(W9)return dl;W9=!0;var n=dl&&dl.__spreadArray||function(s,a,o){if(o||arguments.length===2)for(var c=0,u=a.length,h;c<u;c++)(h||!(c in a))&&(h||(h=Array.prototype.slice.call(a,0,c)),h[c]=a[c]);return s.concat(h||Array.prototype.slice.call(a))};Object.defineProperty(dl,"__esModule",{value:!0}),dl.bufferFrom=dl.bufferAllocUnsafe=dl.Buffer=void 0;var t=vi();Object.defineProperty(dl,"Buffer",{enumerable:!0,get:function(){return t.Buffer}});function e(s){for(var a=[],o=1;o<arguments.length;o++)a[o-1]=arguments[o];return new(t.Buffer.bind.apply(t.Buffer,n([void 0,s],a,!1)))}var r=t.Buffer.allocUnsafe||e;dl.bufferAllocUnsafe=r;var i=t.Buffer.from||e;return dl.bufferFrom=i,dl}function i7(){if(G9)return li;G9=!0;var n=li&&li.__extends||(function(){var g=function(y,b){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,w){m.__proto__=w}||function(m,w){for(var A in w)Object.prototype.hasOwnProperty.call(w,A)&&(m[A]=w[A])},g(y,b)};return function(y,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");g(y,b);function m(){this.constructor=y}y.prototype=b===null?Object.create(b):(m.prototype=b.prototype,new m)}})();Object.defineProperty(li,"__esModule",{value:!0}),li.E=li.AssertionError=li.message=li.RangeError=li.TypeError=li.Error=void 0;var t=ve,e=zt,r=typeof Symbol>"u"?"_kCode":Symbol("code"),i={};function s(g){return(function(y){n(b,y);function b(m){for(var w=[],A=1;A<arguments.length;A++)w[A-1]=arguments[A];var _=y.call(this,c(m,w))||this;return _.code=m,_[r]=m,_.name="".concat(y.prototype.name," [").concat(_[r],"]"),_}return b})(g)}var a=typeof globalThis<"u"?globalThis:vrt,o=(function(g){n(y,g);function y(b){var m=this;if(typeof b!="object"||b===null)throw new li.TypeError("ERR_INVALID_ARG_TYPE","options","object");return b.message?m=g.call(this,b.message)||this:m=g.call(this,"".concat(e.inspect(b.actual).slice(0,128)," ")+"".concat(b.operator," ").concat(e.inspect(b.expected).slice(0,128)))||this,m.generatedMessage=!b.message,m.name="AssertionError [ERR_ASSERTION]",m.code="ERR_ASSERTION",m.actual=b.actual,m.expected=b.expected,m.operator=b.operator,li.Error.captureStackTrace(m,b.stackStartFunction),m}return y})(a.Error);li.AssertionError=o;function c(g,y){t.strictEqual(typeof g,"string");var b=i[g];t(b,"An invalid error message key was used: ".concat(g,"."));var m;if(typeof b=="function")m=b;else{if(m=e.format,y===void 0||y.length===0)return b;y.unshift(b)}return String(m.apply(null,y))}li.message=c;function u(g,y){i[g]=typeof y=="function"?y:String(y)}li.E=u,li.Error=s(a.Error),li.TypeError=s(a.TypeError),li.RangeError=s(a.RangeError),u("ERR_ARG_NOT_ITERABLE","%s must be iterable"),u("ERR_ASSERTION","%s"),u("ERR_BUFFER_OUT_OF_BOUNDS",p),u("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),u("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),u("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),u("ERR_DNS_SET_SERVERS_FAILED",function(g,y){return'c-ares failed to set servers: "'.concat(g,'" [').concat(y,"]")}),u("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),u("ERR_ENCODING_NOT_SUPPORTED",function(g){return'The "'.concat(g,'" encoding is not supported')}),u("ERR_ENCODING_INVALID_ENCODED_DATA",function(g){return"The encoded data was not valid for encoding ".concat(g)}),u("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),u("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),u("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),u("ERR_INDEX_OUT_OF_RANGE","Index out of range"),u("ERR_INVALID_ARG_TYPE",h),u("ERR_INVALID_ARRAY_LENGTH",function(g,y,b){return t.strictEqual(typeof b,"number"),'The array "'.concat(g,'" (length ').concat(b,") must be of length ").concat(y,".")}),u("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),u("ERR_INVALID_CALLBACK","Callback must be a function"),u("ERR_INVALID_CHAR","Invalid character in %s"),u("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),u("ERR_INVALID_FD",'"fd" must be a positive integer: %s'),u("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s'),u("ERR_INVALID_FILE_URL_PATH","File URL path %s"),u("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),u("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),u("ERR_INVALID_OPT_VALUE",function(g,y){return'The value "'.concat(String(y),'" is invalid for option "').concat(g,'"')}),u("ERR_INVALID_OPT_VALUE_ENCODING",function(g){return'The value "'.concat(String(g),'" is invalid for option "encoding"')}),u("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'),u("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),u("ERR_INVALID_THIS",'Value of "this" must be of type %s'),u("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),u("ERR_INVALID_URL","Invalid URL: %s"),u("ERR_INVALID_URL_SCHEME",function(g){return"The URL must be ".concat(d(g,"scheme"))}),u("ERR_IPC_CHANNEL_CLOSED","Channel closed"),u("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),u("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),u("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),u("ERR_MISSING_ARGS",f),u("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),u("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),u("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),u("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),u("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),u("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),u("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),u("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),u("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),u("ERR_SOCKET_CANNOT_SEND","Unable to send data"),u("ERR_SOCKET_CLOSED","Socket is closed"),u("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),u("ERR_STDERR_CLOSE","process.stderr cannot be closed"),u("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),u("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),u("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),u("ERR_TLS_DH_PARAM_SIZE",function(g){return"DH parameter size ".concat(g," is less than 2048")}),u("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),u("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),u("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),u("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),u("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),u("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),u("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),u("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),u("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),u("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),u("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");function h(g,y,b){t(g,"name is required");var m;y.includes("not ")?(m="must not be",y=y.split("not ")[1]):m="must be";var w;if(Array.isArray(g)){var A=g.map(function(S){return'"'.concat(S,'"')}).join(", ");w="The ".concat(A," arguments ").concat(m," ").concat(d(y,"type"))}else if(g.includes(" argument"))w="The ".concat(g," ").concat(m," ").concat(d(y,"type"));else{var _=g.includes(".")?"property":"argument";w='The "'.concat(g,'" ').concat(_," ").concat(m," ").concat(d(y,"type"))}return arguments.length>=3&&(w+=". Received type ".concat(b!==null?typeof b:"null")),w}function f(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];t(g.length>0,"At least one arg needs to be specified");var b="The ",m=g.length;switch(g=g.map(function(w){return'"'.concat(w,'"')}),m){case 1:b+="".concat(g[0]," argument");break;case 2:b+="".concat(g[0]," and ").concat(g[1]," arguments");break;default:b+=g.slice(0,m-1).join(", "),b+=", and ".concat(g[m-1]," arguments");break}return"".concat(b," must be specified")}function d(g,y){if(t(g,"expected is required"),t(typeof y=="string","thing is required"),Array.isArray(g)){var b=g.length;return t(b>0,"At least one expected value needs to be specified"),g=g.map(function(m){return String(m)}),b>2?"one of ".concat(y," ").concat(g.slice(0,b-1).join(", "),", or ")+g[b-1]:b===2?"one of ".concat(y," ").concat(g[0]," or ").concat(g[1]):"of ".concat(y," ").concat(g[0])}else return"of ".concat(y," ").concat(String(g))}function p(g,y){return y?"Attempt to write outside buffer bounds":'"'.concat(g,'" is outside of buffer bounds')}return li}function s7(){if(V9)return sc;V9=!0,Object.defineProperty(sc,"__esModule",{value:!0}),sc.strToEncoding=sc.assertEncoding=sc.ENCODING_UTF8=void 0;var n=UL(),t=i7();sc.ENCODING_UTF8="utf8";function e(i){if(i&&!n.Buffer.isEncoding(i))throw new t.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",i)}sc.assertEncoding=e;function r(i,s){return!s||s===sc.ENCODING_UTF8?i:s==="buffer"?new n.Buffer(i):new n.Buffer(i).toString(s)}return sc.strToEncoding=r,sc}function a7(){if(X9)return W0;X9=!0,Object.defineProperty(W0,"__esModule",{value:!0}),W0.Dirent=void 0;var n=IE(),t=s7(),e=n.constants.S_IFMT,r=n.constants.S_IFDIR,i=n.constants.S_IFREG,s=n.constants.S_IFBLK,a=n.constants.S_IFCHR,o=n.constants.S_IFLNK,c=n.constants.S_IFIFO,u=n.constants.S_IFSOCK,h=(function(){function f(){this.name="",this.mode=0}return f.build=function(d,p){var g=new f,y=d.getNode().mode;return g.name=(0,t.strToEncoding)(d.getName(),p),g.mode=y,g},f.prototype._checkModeProperty=function(d){return(this.mode&e)===d},f.prototype.isDirectory=function(){return this._checkModeProperty(r)},f.prototype.isFile=function(){return this._checkModeProperty(i)},f.prototype.isBlockDevice=function(){return this._checkModeProperty(s)},f.prototype.isCharacterDevice=function(){return this._checkModeProperty(a)},f.prototype.isSymbolicLink=function(){return this._checkModeProperty(o)},f.prototype.isFIFO=function(){return this._checkModeProperty(c)},f.prototype.isSocket=function(){return this._checkModeProperty(u)},f})();return W0.Dirent=h,W0.default=h,W0}function o7(){if(q9)return CC;q9=!0;var n=$n;Object.defineProperty(CC,"__esModule",{value:!0});var t;return typeof n.nextTick=="function"?t=n.nextTick.bind(typeof globalThis<"u"?globalThis:Y9):t=setTimeout.bind(typeof globalThis<"u"?globalThis:Y9),CC.default=t,CC}function l7(){if(K9)return G0;K9=!0;var n=$n;Object.defineProperty(G0,"__esModule",{value:!0}),G0.createProcess=void 0;var t=function(){if(typeof n<"u")return n;try{return $n}catch{return}};function e(){var r=t()||{};return r.cwd||(r.cwd=function(){return"/"}),r.nextTick||(r.nextTick=o7().default),r.emitWarning||(r.emitWarning=function(i,s){console.warn("".concat(s).concat(s?": ":"").concat(i))}),r.env||(r.env={}),r}return G0.createProcess=e,G0.default=e(),G0}function wrt(){if(Z9)return Vs;Z9=!0;var n=Vs&&Vs.__extends||(function(){var b=function(m,w){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,_){A.__proto__=_}||function(A,_){for(var S in _)Object.prototype.hasOwnProperty.call(_,S)&&(A[S]=_[S])},b(m,w)};return function(m,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");b(m,w);function A(){this.constructor=m}m.prototype=w===null?Object.create(w):(A.prototype=w.prototype,new A)}})();Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.File=Vs.Link=Vs.Node=Vs.SEP=void 0;var t=l7(),e=UL(),r=IE(),i=oi,s=BL(),a=r.constants.S_IFMT,o=r.constants.S_IFDIR,c=r.constants.S_IFREG,u=r.constants.S_IFLNK,h=r.constants.O_APPEND,f=function(){var b,m;return(m=(b=t.default.getuid)===null||b===void 0?void 0:b.call(t.default))!==null&&m!==void 0?m:0},d=function(){var b,m;return(m=(b=t.default.getgid)===null||b===void 0?void 0:b.call(t.default))!==null&&m!==void 0?m:0};Vs.SEP="/";var p=(function(b){n(m,b);function m(w,A){A===void 0&&(A=438);var _=b.call(this)||this;return _._uid=f(),_._gid=d(),_._atime=new Date,_._mtime=new Date,_._ctime=new Date,_._perm=438,_.mode=c,_._nlink=1,_._perm=A,_.mode|=A,_.ino=w,_}return Object.defineProperty(m.prototype,"ctime",{get:function(){return this._ctime},set:function(w){this._ctime=w},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"uid",{get:function(){return this._uid},set:function(w){this._uid=w,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"gid",{get:function(){return this._gid},set:function(w){this._gid=w,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"atime",{get:function(){return this._atime},set:function(w){this._atime=w,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"mtime",{get:function(){return this._mtime},set:function(w){this._mtime=w,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"perm",{get:function(){return this._perm},set:function(w){this._perm=w,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"nlink",{get:function(){return this._nlink},set:function(w){this._nlink=w,this.ctime=new Date},enumerable:!1,configurable:!0}),m.prototype.getString=function(w){return w===void 0&&(w="utf8"),this.atime=new Date,this.getBuffer().toString(w)},m.prototype.setString=function(w){this.buf=(0,e.bufferFrom)(w,"utf8"),this.touch()},m.prototype.getBuffer=function(){return this.atime=new Date,this.buf||this.setBuffer((0,e.bufferAllocUnsafe)(0)),(0,e.bufferFrom)(this.buf)},m.prototype.setBuffer=function(w){this.buf=(0,e.bufferFrom)(w),this.touch()},m.prototype.getSize=function(){return this.buf?this.buf.length:0},m.prototype.setModeProperty=function(w){this.mode=this.mode&~a|w},m.prototype.setIsFile=function(){this.setModeProperty(c)},m.prototype.setIsDirectory=function(){this.setModeProperty(o)},m.prototype.setIsSymlink=function(){this.setModeProperty(u)},m.prototype.isFile=function(){return(this.mode&a)===c},m.prototype.isDirectory=function(){return(this.mode&a)===o},m.prototype.isSymlink=function(){return(this.mode&a)===u},m.prototype.makeSymlink=function(w){this.symlink=w,this.setIsSymlink()},m.prototype.write=function(w,A,_,S){if(A===void 0&&(A=0),_===void 0&&(_=w.length),S===void 0&&(S=0),this.buf||(this.buf=(0,e.bufferAllocUnsafe)(0)),S+_>this.buf.length){var I=(0,e.bufferAllocUnsafe)(S+_);this.buf.copy(I,0,0,this.buf.length),this.buf=I}return w.copy(this.buf,S,A,A+_),this.touch(),_},m.prototype.read=function(w,A,_,S){A===void 0&&(A=0),_===void 0&&(_=w.byteLength),S===void 0&&(S=0),this.atime=new Date,this.buf||(this.buf=(0,e.bufferAllocUnsafe)(0));var I=_;return I>w.byteLength&&(I=w.byteLength),I+S>this.buf.length&&(I=this.buf.length-S),this.buf.copy(w,A,S,S+I),I},m.prototype.truncate=function(w){if(w===void 0&&(w=0),!w)this.buf=(0,e.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,e.bufferAllocUnsafe)(0)),w<=this.buf.length)this.buf=this.buf.slice(0,w);else{var A=(0,e.bufferAllocUnsafe)(w);this.buf.copy(A),A.fill(0,this.buf.length),this.buf=A}this.touch()},m.prototype.chmod=function(w){this.perm=w,this.mode=this.mode&-512|w,this.touch()},m.prototype.chown=function(w,A){this.uid=w,this.gid=A,this.touch()},m.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},m.prototype.canRead=function(w,A){return w===void 0&&(w=f()),A===void 0&&(A=d()),!!(this.perm&4||A===this.gid&&this.perm&32||w===this.uid&&this.perm&256)},m.prototype.canWrite=function(w,A){return w===void 0&&(w=f()),A===void 0&&(A=d()),!!(this.perm&2||A===this.gid&&this.perm&16||w===this.uid&&this.perm&128)},m.prototype.del=function(){this.emit("delete",this)},m.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()}},m})(i.EventEmitter);Vs.Node=p;var g=(function(b){n(m,b);function m(w,A,_){var S=b.call(this)||this;return S.children={},S._steps=[],S.ino=0,S.length=0,S.vol=w,S.parent=A,S.name=_,S.syncSteps(),S}return Object.defineProperty(m.prototype,"steps",{get:function(){return this._steps},set:function(w){this._steps=w;for(var A=0,_=Object.entries(this.children);A<_.length;A++){var S=_[A],I=S[0],C=S[1];I==="."||I===".."||C?.syncSteps()}},enumerable:!1,configurable:!0}),m.prototype.setNode=function(w){this.node=w,this.ino=w.ino},m.prototype.getNode=function(){return this.node},m.prototype.createChild=function(w,A){A===void 0&&(A=this.vol.createNode());var _=new m(this.vol,this,w);return _.setNode(A),A.isDirectory()&&(_.children["."]=_,_.getNode().nlink++),this.setChild(w,_),_},m.prototype.setChild=function(w,A){A===void 0&&(A=new m(this.vol,this,w)),this.children[w]=A,A.parent=this,this.length++;var _=A.getNode();return _.isDirectory()&&(A.children[".."]=this,this.getNode().nlink++),this.getNode().mtime=new Date,this.emit("child:add",A,this),A},m.prototype.deleteChild=function(w){var A=w.getNode();A.isDirectory()&&(delete w.children[".."],this.getNode().nlink--),delete this.children[w.getName()],this.length--,this.getNode().mtime=new Date,this.emit("child:delete",w,this)},m.prototype.getChild=function(w){if(this.getNode().mtime=new Date,Object.hasOwnProperty.call(this.children,w))return this.children[w]},m.prototype.getPath=function(){return this.steps.join(Vs.SEP)},m.prototype.getName=function(){return this.steps[this.steps.length-1]},m.prototype.walk=function(w,A,_){if(A===void 0&&(A=w.length),_===void 0&&(_=0),_>=w.length)return this;if(_>=A)return this;var S=w[_],I=this.getChild(S);return I?I.walk(w,A,_+1):null},m.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},m.prototype.syncSteps=function(){this.steps=this.parent?this.parent.steps.concat([this.name]):[this.name]},m})(i.EventEmitter);Vs.Link=g;var y=(function(){function b(m,w,A,_){this.position=0,this.link=m,this.node=w,this.flags=A,this.fd=_}return b.prototype.getString=function(m){return this.node.getString()},b.prototype.setString=function(m){this.node.setString(m)},b.prototype.getBuffer=function(){return this.node.getBuffer()},b.prototype.setBuffer=function(m){this.node.setBuffer(m)},b.prototype.getSize=function(){return this.node.getSize()},b.prototype.truncate=function(m){this.node.truncate(m)},b.prototype.seekTo=function(m){this.position=m},b.prototype.stats=function(){return s.default.build(this.node)},b.prototype.write=function(m,w,A,_){w===void 0&&(w=0),A===void 0&&(A=m.length),typeof _!="number"&&(_=this.position),this.flags&h&&(_=this.getSize());var S=this.node.write(m,w,A,_);return this.position=_+S,S},b.prototype.read=function(m,w,A,_){w===void 0&&(w=0),A===void 0&&(A=m.byteLength),typeof _!="number"&&(_=this.position);var S=this.node.read(m,w,A,_);return this.position=_+S,S},b.prototype.chmod=function(m){this.node.chmod(m)},b.prototype.chown=function(m,w){this.node.chown(m,w)},b})();return Vs.File=y,Vs}function Ert(){if(J9)return RC;J9=!0,Object.defineProperty(RC,"__esModule",{value:!0});function n(t,e,r){var i=setTimeout.apply(typeof globalThis<"u"?globalThis:Art,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}return RC.default=n,RC}function xrt(){if(Q9)return kf;Q9=!0;var n=kf&&kf.__spreadArray||function(i,s,a){if(a||arguments.length===2)for(var o=0,c=s.length,u;o<c;o++)(u||!(o in s))&&(u||(u=Array.prototype.slice.call(s,0,o)),u[o]=s[o]);return i.concat(u||Array.prototype.slice.call(s))};Object.defineProperty(kf,"__esModule",{value:!0}),kf.FileHandle=void 0;function t(i,s,a){return a===void 0&&(a=function(o){return o}),function(){for(var o=[],c=0;c<arguments.length;c++)o[c]=arguments[c];return new Promise(function(u,h){i[s].bind(i).apply(void 0,n(n([],o,!1),[function(f,d){return f?h(f):u(a(d))}],!1))})}}var e=(function(){function i(s,a){this.vol=s,this.fd=a}return i.prototype.appendFile=function(s,a){return t(this.vol,"appendFile")(this.fd,s,a)},i.prototype.chmod=function(s){return t(this.vol,"fchmod")(this.fd,s)},i.prototype.chown=function(s,a){return t(this.vol,"fchown")(this.fd,s,a)},i.prototype.close=function(){return t(this.vol,"close")(this.fd)},i.prototype.datasync=function(){return t(this.vol,"fdatasync")(this.fd)},i.prototype.read=function(s,a,o,c){return t(this.vol,"read",function(u){return{bytesRead:u,buffer:s}})(this.fd,s,a,o,c)},i.prototype.readFile=function(s){return t(this.vol,"readFile")(this.fd,s)},i.prototype.stat=function(s){return t(this.vol,"fstat")(this.fd,s)},i.prototype.sync=function(){return t(this.vol,"fsync")(this.fd)},i.prototype.truncate=function(s){return t(this.vol,"ftruncate")(this.fd,s)},i.prototype.utimes=function(s,a){return t(this.vol,"futimes")(this.fd,s,a)},i.prototype.write=function(s,a,o,c){return t(this.vol,"write",function(u){return{bytesWritten:u,buffer:s}})(this.fd,s,a,o,c)},i.prototype.writeFile=function(s,a){return t(this.vol,"writeFile")(this.fd,s,a)},i})();kf.FileHandle=e;function r(i){return typeof Promise>"u"?null:{FileHandle:e,access:function(s,a){return t(i,"access")(s,a)},appendFile:function(s,a,o){return t(i,"appendFile")(s instanceof e?s.fd:s,a,o)},chmod:function(s,a){return t(i,"chmod")(s,a)},chown:function(s,a,o){return t(i,"chown")(s,a,o)},copyFile:function(s,a,o){return t(i,"copyFile")(s,a,o)},lchmod:function(s,a){return t(i,"lchmod")(s,a)},lchown:function(s,a,o){return t(i,"lchown")(s,a,o)},link:function(s,a){return t(i,"link")(s,a)},lstat:function(s,a){return t(i,"lstat")(s,a)},mkdir:function(s,a){return t(i,"mkdir")(s,a)},mkdtemp:function(s,a){return t(i,"mkdtemp")(s,a)},open:function(s,a,o){return t(i,"open",function(c){return new e(i,c)})(s,a,o)},readdir:function(s,a){return t(i,"readdir")(s,a)},readFile:function(s,a){return t(i,"readFile")(s instanceof e?s.fd:s,a)},readlink:function(s,a){return t(i,"readlink")(s,a)},realpath:function(s,a){return t(i,"realpath")(s,a)},rename:function(s,a){return t(i,"rename")(s,a)},rmdir:function(s){return t(i,"rmdir")(s)},rm:function(s,a){return t(i,"rm")(s,a)},stat:function(s,a){return t(i,"stat")(s,a)},symlink:function(s,a,o){return t(i,"symlink")(s,a,o)},truncate:function(s,a){return t(i,"truncate")(s,a)},unlink:function(s){return t(i,"unlink")(s)},utimes:function(s,a,o){return t(i,"utimes")(s,a,o)},writeFile:function(s,a,o){return t(i,"writeFile")(s instanceof e?s.fd:s,a,o)}}}return kf.default=r,kf}function Srt(){if(t7)return RE;t7=!0;var n=$n;Object.defineProperty(RE,"__esModule",{value:!0}),RE.correctPath=a,RE.unixify=s;var t=n.platform==="win32";function e(o){var c=o.length-1;if(c<2)return o;for(;r(o,c);)c--;return o.substr(0,c+1)}function r(o,c){var u=o[c];return c>0&&(u==="/"||t&&u==="\\")}function i(o,c){if(typeof o!="string")throw new TypeError("expected a string");return o=o.replace(/[\\\/]+/g,"/"),c!==!1&&(o=e(o)),o}function s(o){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t?(o=i(o,c),o.replace(/^([a-zA-Z]+:|\.\/)/,"")):o}function a(o){return s(o.replace(/^\\\\\?\\.:\\/,"\\"))}return RE}function c7(){if(e7)return nr;e7=!0;var n=nr&&nr.__extends||(function(){var ht=function(Z,tt){return ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ot,vt){ot.__proto__=vt}||function(ot,vt){for(var Pt in vt)Object.prototype.hasOwnProperty.call(vt,Pt)&&(ot[Pt]=vt[Pt])},ht(Z,tt)};return function(Z,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Class extends value "+String(tt)+" is not a constructor or null");ht(Z,tt);function ot(){this.constructor=Z}Z.prototype=tt===null?Object.create(tt):(ot.prototype=tt.prototype,new ot)}})(),t=nr&&nr.__spreadArray||function(ht,Z,tt){if(tt||arguments.length===2)for(var ot=0,vt=Z.length,Pt;ot<vt;ot++)(Pt||!(ot in Z))&&(Pt||(Pt=Array.prototype.slice.call(Z,0,ot)),Pt[ot]=Z[ot]);return ht.concat(Pt||Array.prototype.slice.call(Z))};Object.defineProperty(nr,"__esModule",{value:!0}),nr.FSWatcher=nr.StatWatcher=nr.Volume=nr.toUnixTimestamp=nr.bufferToEncoding=nr.dataToBuffer=nr.dataToStr=nr.pathToSteps=nr.filenameToSteps=nr.pathToFilename=nr.flagsToNumber=nr.FLAGS=void 0;var e=ai,r=wrt(),i=BL(),s=a7(),a=UL(),o=o7(),c=l7(),u=Ert(),h=Ws,f=IE(),d=oi,p=s7(),g=i7(),y=zt,b=xrt(),m=e.resolve,w=f.constants.O_RDONLY,A=f.constants.O_WRONLY,_=f.constants.O_RDWR,S=f.constants.O_CREAT,I=f.constants.O_EXCL,C=f.constants.O_TRUNC,M=f.constants.O_APPEND,z=f.constants.O_SYNC,G=f.constants.O_DIRECTORY,Y=f.constants.F_OK,L=f.constants.COPYFILE_EXCL,j=f.constants.COPYFILE_FICLONE_FORCE,q=e.posix?e.posix:e,nt=q.sep,J=q.relative,N=q.join,D=q.dirname,F=c.default.platform==="win32",P=128,V={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"},$=function(ht){return"Expected options to be either an object or a string, but got ".concat(ht," instead")},H="ENOENT",rt="EBADF",lt="EINVAL",ft="EPERM",K="EPROTO",X="EEXIST",st="ENOTDIR",bt="EMFILE",wt="EACCES",Q="EISDIR",W="ENOTEMPTY",at="ENOSYS",pt="ERR_FS_EISDIR";function _t(ht,Z,tt,ot){Z===void 0&&(Z=""),tt===void 0&&(tt=""),ot===void 0&&(ot="");var vt="";switch(tt&&(vt=" '".concat(tt,"'")),ot&&(vt+=" -> '".concat(ot,"'")),ht){case H:return"ENOENT: no such file or directory, ".concat(Z).concat(vt);case rt:return"EBADF: bad file descriptor, ".concat(Z).concat(vt);case lt:return"EINVAL: invalid argument, ".concat(Z).concat(vt);case ft:return"EPERM: operation not permitted, ".concat(Z).concat(vt);case K:return"EPROTO: protocol error, ".concat(Z).concat(vt);case X:return"EEXIST: file already exists, ".concat(Z).concat(vt);case st:return"ENOTDIR: not a directory, ".concat(Z).concat(vt);case Q:return"EISDIR: illegal operation on a directory, ".concat(Z).concat(vt);case wt:return"EACCES: permission denied, ".concat(Z).concat(vt);case W:return"ENOTEMPTY: directory not empty, ".concat(Z).concat(vt);case bt:return"EMFILE: too many open files, ".concat(Z).concat(vt);case at:return"ENOSYS: function not implemented, ".concat(Z).concat(vt);case pt:return"[ERR_FS_EISDIR]: Path is a directory: ".concat(Z," returned EISDIR (is a directory) ").concat(tt);default:return"".concat(ht,": error occurred, ").concat(Z).concat(vt)}}function At(ht,Z,tt,ot,vt){Z===void 0&&(Z=""),tt===void 0&&(tt=""),ot===void 0&&(ot=""),vt===void 0&&(vt=Error);var Pt=new vt(_t(ht,Z,tt,ot));return Pt.code=ht,tt&&(Pt.path=tt),Pt}var gt;(function(ht){ht[ht.r=w]="r",ht[ht["r+"]=_]="r+",ht[ht.rs=w|z]="rs",ht[ht.sr=ht.rs]="sr",ht[ht["rs+"]=_|z]="rs+",ht[ht["sr+"]=ht["rs+"]]="sr+",ht[ht.w=A|S|C]="w",ht[ht.wx=A|S|C|I]="wx",ht[ht.xw=ht.wx]="xw",ht[ht["w+"]=_|S|C]="w+",ht[ht["wx+"]=_|S|C|I]="wx+",ht[ht["xw+"]=ht["wx+"]]="xw+",ht[ht.a=A|M|S]="a",ht[ht.ax=A|M|S|I]="ax",ht[ht.xa=ht.ax]="xa",ht[ht["a+"]=_|M|S]="a+",ht[ht["ax+"]=_|M|S|I]="ax+",ht[ht["xa+"]=ht["ax+"]]="xa+"})(gt=nr.FLAGS||(nr.FLAGS={}));function xt(ht){if(typeof ht=="number")return ht;if(typeof ht=="string"){var Z=gt[ht];if(typeof Z<"u")return Z}throw new g.TypeError("ERR_INVALID_OPT_VALUE","flags",ht)}nr.flagsToNumber=xt;function $t(ht,Z){var tt;if(Z){var ot=typeof Z;switch(ot){case"string":tt=Object.assign({},ht,{encoding:Z});break;case"object":tt=Object.assign({},ht,Z);break;default:throw TypeError($(ot))}}else return ht;return tt.encoding!=="buffer"&&(0,p.assertEncoding)(tt.encoding),tt}function Nt(ht){return function(Z){return $t(ht,Z)}}function Ot(ht){if(typeof ht!="function")throw TypeError(V.CB);return ht}function qt(ht){return function(Z,tt){return typeof Z=="function"?[ht(),Z]:[ht(Z),Ot(tt)]}}var Jt={encoding:"utf8"},te=Nt(Jt),O=qt(te),v={flag:"r"},E=Nt(v),B={encoding:"utf8",mode:438,flag:gt[gt.w]},it=Nt(B),k={encoding:"utf8",mode:438,flag:gt[gt.a]},ct=Nt(k),mt=qt(ct),St=Jt,Et=Nt(St),Dt=qt(Et),et={mode:511,recursive:!1},Ut=function(ht){return typeof ht=="number"?Object.assign({},et,{mode:ht}):Object.assign({},et,ht)},oe={recursive:!1},U=function(ht){return Object.assign({},oe,ht)},Mt=Nt(Jt),Ht=qt(Mt),dt={encoding:"utf8",withFileTypes:!1},It=Nt(dt),Ft=qt(It),de={bigint:!1},ut=function(ht){return ht===void 0&&(ht={}),Object.assign({},de,ht)},yt=function(ht,Z){return typeof ht=="function"?[ut(),ht]:[ut(ht),Ot(Z)]};function Wt(ht){if(ht.hostname!=="")throw new g.TypeError("ERR_INVALID_FILE_URL_HOST",c.default.platform);for(var Z=ht.pathname,tt=0;tt<Z.length;tt++)if(Z[tt]==="%"){var ot=Z.codePointAt(tt+2)|32;if(Z[tt+1]==="2"&&ot===102)throw new g.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(Z)}function jt(ht){if(typeof ht!="string"&&!a.Buffer.isBuffer(ht)){try{if(!(ht instanceof Sr.URL))throw new TypeError(V.PATH_STR)}catch{throw new TypeError(V.PATH_STR)}ht=Wt(ht)}var Z=String(ht);return En(Z),Z}nr.pathToFilename=jt;var Zt=function(ht,Z){return Z===void 0&&(Z=c.default.cwd()),m(Z,ht)};if(F){var be=Zt,He=Srt().unixify;Zt=function(ht,Z){return He(be(ht,Z))}}function Oe(ht,Z){var tt=Zt(ht,Z),ot=tt.substring(1);return ot?ot.split(nt):[]}nr.filenameToSteps=Oe;function Br(ht){return Oe(jt(ht))}nr.pathToSteps=Br;function ma(ht,Z){return Z===void 0&&(Z=p.ENCODING_UTF8),a.Buffer.isBuffer(ht)?ht.toString(Z):ht instanceof Uint8Array?(0,a.bufferFrom)(ht).toString(Z):String(ht)}nr.dataToStr=ma;function Es(ht,Z){return Z===void 0&&(Z=p.ENCODING_UTF8),a.Buffer.isBuffer(ht)?ht:ht instanceof Uint8Array?(0,a.bufferFrom)(ht):(0,a.bufferFrom)(String(ht),Z)}nr.dataToBuffer=Es;function dr(ht,Z){return!Z||Z==="buffer"?ht:ht.toString(Z)}nr.bufferToEncoding=dr;function En(ht,Z){if((""+ht).indexOf("\0")!==-1){var tt=new Error("Path must be a string without null bytes");throw tt.code=H,tt}return!0}function en(ht,Z){if(typeof ht=="number")return ht;if(typeof ht=="string")return parseInt(ht,8);if(Z)return cr(Z)}function cr(ht,Z){var tt=en(ht,Z);if(typeof tt!="number"||isNaN(tt))throw new TypeError(V.MODE_INT);return tt}function yr(ht){return ht>>>0===ht}function ri(ht){if(!yr(ht))throw TypeError(V.FD)}function ni(ht){if(typeof ht=="string"&&+ht==ht)return+ht;if(ht instanceof Date)return ht.getTime()/1e3;if(isFinite(ht))return ht<0?Date.now()/1e3:ht;throw new Error("Cannot parse time: "+ht)}nr.toUnixTimestamp=ni;function ii(ht){if(typeof ht!="number")throw TypeError(V.UID)}function _0(ht){if(typeof ht!="number")throw TypeError(V.GID)}function uZ(ht){var Z={};function tt(ot,vt){for(var Pt in vt){var Bt=vt[Pt],Vt=N(ot,Pt);typeof Bt=="string"?Z[Vt]=Bt:typeof Bt=="object"&&Bt!==null&&Object.keys(Bt).length>0?tt(Vt,Bt):Z[Vt]=null}}return tt("",ht),Z}var hZ=(function(){function ht(Z){Z===void 0&&(Z={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=(0,b.default)(this),this.statWatchers={},this.props=Object.assign({Node:r.Node,Link:r.Link,File:r.File},Z);var tt=this.createLink();tt.setNode(this.createNode(!0));var ot=this;this.StatWatcher=(function(Bt){n(Vt,Bt);function Vt(){return Bt.call(this,ot)||this}return Vt})(W5);var vt=Jl;this.ReadStream=(function(Bt){n(Vt,Bt);function Vt(){for(var ee=[],le=0;le<arguments.length;le++)ee[le]=arguments[le];return Bt.apply(this,t([ot],ee,!1))||this}return Vt})(vt);var Pt=vo;this.WriteStream=(function(Bt){n(Vt,Bt);function Vt(){for(var ee=[],le=0;le<arguments.length;le++)ee[le]=arguments[le];return Bt.apply(this,t([ot],ee,!1))||this}return Vt})(Pt),this.FSWatcher=(function(Bt){n(Vt,Bt);function Vt(){return Bt.call(this,ot)||this}return Vt})(V5),tt.setChild(".",tt),tt.getNode().nlink++,tt.setChild("..",tt),tt.getNode().nlink++,this.root=tt}return ht.fromJSON=function(Z,tt){var ot=new ht;return ot.fromJSON(Z,tt),ot},ht.fromNestedJSON=function(Z,tt){var ot=new ht;return ot.fromNestedJSON(Z,tt),ot},Object.defineProperty(ht.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}),ht.prototype.createLink=function(Z,tt,ot,vt){if(ot===void 0&&(ot=!1),!Z)return new this.props.Link(this,null,"");if(!tt)throw new Error("createLink: name cannot be empty");return Z.createChild(tt,this.createNode(ot,vt))},ht.prototype.deleteLink=function(Z){var tt=Z.parent;return tt?(tt.deleteChild(Z),!0):!1},ht.prototype.newInoNumber=function(){var Z=this.releasedInos.pop();return Z||(this.ino=(this.ino+1)%4294967295,this.ino)},ht.prototype.newFdNumber=function(){var Z=this.releasedFds.pop();return typeof Z=="number"?Z:ht.fd--},ht.prototype.createNode=function(Z,tt){Z===void 0&&(Z=!1);var ot=new this.props.Node(this.newInoNumber(),tt);return Z&&ot.setIsDirectory(),this.inodes[ot.ino]=ot,ot},ht.prototype.getNode=function(Z){return this.inodes[Z]},ht.prototype.deleteNode=function(Z){Z.del(),delete this.inodes[Z.ino],this.releasedInos.push(Z.ino)},ht.prototype.genRndStr=function(){var Z=(Math.random()+1).toString(36).substring(2,8);return Z.length===6?Z:this.genRndStr()},ht.prototype.getLink=function(Z){return this.root.walk(Z)},ht.prototype.getLinkOrThrow=function(Z,tt){var ot=Oe(Z),vt=this.getLink(ot);if(!vt)throw At(H,tt,Z);return vt},ht.prototype.getResolvedLink=function(Z){for(var tt=typeof Z=="string"?Oe(Z):Z,ot=this.root,vt=0;vt<tt.length;){var Pt=tt[vt];if(ot=ot.getChild(Pt),!ot)return null;var Bt=ot.getNode();if(Bt.isSymlink()){tt=Bt.symlink.concat(tt.slice(vt+1)),ot=this.root,vt=0;continue}vt++}return ot},ht.prototype.getResolvedLinkOrThrow=function(Z,tt){var ot=this.getResolvedLink(Z);if(!ot)throw At(H,tt,Z);return ot},ht.prototype.resolveSymlinks=function(Z){return this.getResolvedLink(Z.steps.slice(1))},ht.prototype.getLinkAsDirOrThrow=function(Z,tt){var ot=this.getLinkOrThrow(Z,tt);if(!ot.getNode().isDirectory())throw At(st,tt,Z);return ot},ht.prototype.getLinkParent=function(Z){return this.root.walk(Z,Z.length-1)},ht.prototype.getLinkParentAsDirOrThrow=function(Z,tt){var ot=Z instanceof Array?Z:Oe(Z),vt=this.getLinkParent(ot);if(!vt)throw At(H,tt,nt+ot.join(nt));if(!vt.getNode().isDirectory())throw At(st,tt,nt+ot.join(nt));return vt},ht.prototype.getFileByFd=function(Z){return this.fds[String(Z)]},ht.prototype.getFileByFdOrThrow=function(Z,tt){if(!yr(Z))throw TypeError(V.FD);var ot=this.getFileByFd(Z);if(!ot)throw At(rt,tt);return ot},ht.prototype.wrapAsync=function(Z,tt,ot){var vt=this;Ot(ot),(0,o.default)(function(){var Pt;try{Pt=Z.apply(vt,tt)}catch(Bt){ot(Bt);return}ot(null,Pt)})},ht.prototype._toJSON=function(Z,tt,ot){var vt;Z===void 0&&(Z=this.root),tt===void 0&&(tt={});var Pt=!0,Bt=Z.children;Z.getNode().isFile()&&(Bt=(vt={},vt[Z.getName()]=Z.parent.getChild(Z.getName()),vt),Z=Z.parent);for(var Vt in Bt)if(!(Vt==="."||Vt==="..")){Pt=!1;var ee=Z.getChild(Vt);if(!ee)throw new Error("_toJSON: unexpected undefined");var le=ee.getNode();if(le.isFile()){var xe=ee.getPath();ot&&(xe=J(ot,xe)),tt[xe]=le.getString()}else le.isDirectory()&&this._toJSON(ee,tt,ot)}var Ke=Z.getPath();return ot&&(Ke=J(ot,Ke)),Ke&&Pt&&(tt[Ke]=null),tt},ht.prototype.toJSON=function(Z,tt,ot){tt===void 0&&(tt={}),ot===void 0&&(ot=!1);var vt=[];if(Z){Z instanceof Array||(Z=[Z]);for(var Pt=0,Bt=Z;Pt<Bt.length;Pt++){var Vt=Bt[Pt],ee=jt(Vt),le=this.getResolvedLink(ee);le&&vt.push(le)}}else vt.push(this.root);if(!vt.length)return tt;for(var xe=0,Ke=vt;xe<Ke.length;xe++){var le=Ke[xe];this._toJSON(le,tt,ot?le.getPath():"")}return tt},ht.prototype.fromJSON=function(Z,tt){tt===void 0&&(tt=c.default.cwd());for(var ot in Z){var vt=Z[ot];if(ot=Zt(ot,tt),typeof vt=="string"){var Pt=D(ot);this.mkdirpBase(Pt,511),this.writeFileSync(ot,vt)}else this.mkdirpBase(ot,511)}},ht.prototype.fromNestedJSON=function(Z,tt){this.fromJSON(uZ(Z),tt)},ht.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))},ht.prototype.mountSync=function(Z,tt){this.fromJSON(tt,Z)},ht.prototype.openLink=function(Z,tt,ot){if(ot===void 0&&(ot=!0),this.openFiles>=this.maxFiles)throw At(bt,"open",Z.getPath());var vt=Z;if(ot&&(vt=this.resolveSymlinks(Z)),!vt)throw At(H,"open",Z.getPath());var Pt=vt.getNode();if(Pt.isDirectory()){if((tt&(w|_|A))!==w)throw At(Q,"open",Z.getPath())}else if(tt&G)throw At(st,"open",Z.getPath());if(!(tt&A)&&!Pt.canRead())throw At(wt,"open",Z.getPath());var Bt=new this.props.File(Z,Pt,tt,this.newFdNumber());return this.fds[Bt.fd]=Bt,this.openFiles++,tt&C&&Bt.truncate(),Bt},ht.prototype.openFile=function(Z,tt,ot,vt){vt===void 0&&(vt=!0);var Pt=Oe(Z),Bt=vt?this.getResolvedLink(Pt):this.getLink(Pt);if(Bt&&tt&I)throw At(X,"open",Z);if(!Bt&&tt&S){var Vt=this.getResolvedLink(Pt.slice(0,Pt.length-1));if(!Vt)throw At(H,"open",nt+Pt.join(nt));tt&S&&typeof ot=="number"&&(Bt=this.createLink(Vt,Pt[Pt.length-1],!1,ot))}if(Bt)return this.openLink(Bt,tt,vt);throw At(H,"open",Z)},ht.prototype.openBase=function(Z,tt,ot,vt){vt===void 0&&(vt=!0);var Pt=this.openFile(Z,tt,ot,vt);if(!Pt)throw At(H,"open",Z);return Pt.fd},ht.prototype.openSync=function(Z,tt,ot){ot===void 0&&(ot=438);var vt=cr(ot),Pt=jt(Z),Bt=xt(tt);return this.openBase(Pt,Bt,vt)},ht.prototype.open=function(Z,tt,ot,vt){var Pt=ot,Bt=vt;typeof ot=="function"&&(Pt=438,Bt=ot),Pt=Pt||438;var Vt=cr(Pt),ee=jt(Z),le=xt(tt);this.wrapAsync(this.openBase,[ee,le,Vt],Bt)},ht.prototype.closeFile=function(Z){this.fds[Z.fd]&&(this.openFiles--,delete this.fds[Z.fd],this.releasedFds.push(Z.fd))},ht.prototype.closeSync=function(Z){ri(Z);var tt=this.getFileByFdOrThrow(Z,"close");this.closeFile(tt)},ht.prototype.close=function(Z,tt){ri(Z),this.wrapAsync(this.closeSync,[Z],tt)},ht.prototype.openFileOrGetById=function(Z,tt,ot){if(typeof Z=="number"){var vt=this.fds[Z];if(!vt)throw At(H);return vt}else return this.openFile(jt(Z),tt,ot)},ht.prototype.readBase=function(Z,tt,ot,vt,Pt){var Bt=this.getFileByFdOrThrow(Z);return Bt.read(tt,Number(ot),Number(vt),Pt)},ht.prototype.readSync=function(Z,tt,ot,vt,Pt){return ri(Z),this.readBase(Z,tt,ot,vt,Pt)},ht.prototype.read=function(Z,tt,ot,vt,Pt,Bt){var Vt=this;if(Ot(Bt),vt===0)return c.default.nextTick(function(){Bt&&Bt(null,0,tt)});(0,o.default)(function(){try{var ee=Vt.readBase(Z,tt,ot,vt,Pt);Bt(null,ee,tt)}catch(le){Bt(le)}})},ht.prototype.readFileBase=function(Z,tt,ot){var vt,Pt=typeof Z=="number",Bt=Pt&&yr(Z),Vt;if(Bt)Vt=Z;else{var ee=jt(Z),le=Oe(ee),xe=this.getResolvedLink(le);if(xe){var Ke=xe.getNode();if(Ke.isDirectory())throw At(Q,"open",xe.getPath())}Vt=this.openSync(Z,tt)}try{vt=dr(this.getFileByFdOrThrow(Vt).getBuffer(),ot)}finally{Bt||this.closeSync(Vt)}return vt},ht.prototype.readFileSync=function(Z,tt){var ot=E(tt),vt=xt(ot.flag);return this.readFileBase(Z,vt,ot.encoding)},ht.prototype.readFile=function(Z,tt,ot){var vt=qt(E)(tt,ot),Pt=vt[0],Bt=vt[1],Vt=xt(Pt.flag);this.wrapAsync(this.readFileBase,[Z,Vt,Pt.encoding],Bt)},ht.prototype.writeBase=function(Z,tt,ot,vt,Pt){var Bt=this.getFileByFdOrThrow(Z,"write");return Bt.write(tt,ot,vt,Pt)},ht.prototype.writeSync=function(Z,tt,ot,vt,Pt){ri(Z);var Bt,Vt,ee,le,xe=typeof tt!="string";xe?(Vt=(ot||0)|0,ee=vt,le=Pt):(le=ot,Bt=vt);var Ke=Es(tt,Bt);return xe?typeof ee>"u"&&(ee=Ke.length):(Vt=0,ee=Ke.length),this.writeBase(Z,Ke,Vt,ee,le)},ht.prototype.write=function(Z,tt,ot,vt,Pt,Bt){var Vt=this;ri(Z);var ee,le,xe,Ke,si,Fp=typeof tt,Ql=typeof ot,Tf=typeof vt,Bp=typeof Pt;Fp!=="string"?Ql==="function"?si=ot:Tf==="function"?(ee=ot|0,si=vt):Bp==="function"?(ee=ot|0,le=vt,si=Pt):(ee=ot|0,le=vt,xe=Pt,si=Bt):Ql==="function"?si=ot:Tf==="function"?(xe=ot,si=vt):Bp==="function"&&(xe=ot,Ke=vt,si=Pt);var Un=Es(tt,Ke);Fp!=="string"?typeof le>"u"&&(le=Un.length):(ee=0,le=Un.length);var wo=Ot(si);(0,o.default)(function(){try{var ul=Vt.writeBase(Z,Un,ee,le,xe);Fp!=="string"?wo(null,ul,Un):wo(null,ul,tt)}catch(FT){wo(FT)}})},ht.prototype.writeFileBase=function(Z,tt,ot,vt){var Pt=typeof Z=="number",Bt;Pt?Bt=Z:Bt=this.openBase(jt(Z),ot,vt);var Vt=0,ee=tt.length,le=ot&M?void 0:0;try{for(;ee>0;){var xe=this.writeSync(Bt,tt,Vt,ee,le);Vt+=xe,ee-=xe,le!==void 0&&(le+=xe)}}finally{Pt||this.closeSync(Bt)}},ht.prototype.writeFileSync=function(Z,tt,ot){var vt=it(ot),Pt=xt(vt.flag),Bt=cr(vt.mode),Vt=Es(tt,vt.encoding);this.writeFileBase(Z,Vt,Pt,Bt)},ht.prototype.writeFile=function(Z,tt,ot,vt){var Pt=ot,Bt=vt;typeof ot=="function"&&(Pt=B,Bt=ot);var Vt=Ot(Bt),ee=it(Pt),le=xt(ee.flag),xe=cr(ee.mode),Ke=Es(tt,ee.encoding);this.wrapAsync(this.writeFileBase,[Z,Ke,le,xe],Vt)},ht.prototype.linkBase=function(Z,tt){var ot=Oe(Z),vt=this.getLink(ot);if(!vt)throw At(H,"link",Z,tt);var Pt=Oe(tt),Bt=this.getLinkParent(Pt);if(!Bt)throw At(H,"link",Z,tt);var Vt=Pt[Pt.length-1];if(Bt.getChild(Vt))throw At(X,"link",Z,tt);var ee=vt.getNode();ee.nlink++,Bt.createChild(Vt,ee)},ht.prototype.copyFileBase=function(Z,tt,ot){var vt=this.readFileSync(Z);if(ot&L&&this.existsSync(tt))throw At(X,"copyFile",Z,tt);if(ot&j)throw At(at,"copyFile",Z,tt);this.writeFileBase(tt,vt,gt.w,438)},ht.prototype.copyFileSync=function(Z,tt,ot){var vt=jt(Z),Pt=jt(tt);return this.copyFileBase(vt,Pt,(ot||0)|0)},ht.prototype.copyFile=function(Z,tt,ot,vt){var Pt=jt(Z),Bt=jt(tt),Vt,ee;typeof ot=="function"?(Vt=0,ee=ot):(Vt=ot,ee=vt),Ot(ee),this.wrapAsync(this.copyFileBase,[Pt,Bt,Vt],ee)},ht.prototype.linkSync=function(Z,tt){var ot=jt(Z),vt=jt(tt);this.linkBase(ot,vt)},ht.prototype.link=function(Z,tt,ot){var vt=jt(Z),Pt=jt(tt);this.wrapAsync(this.linkBase,[vt,Pt],ot)},ht.prototype.unlinkBase=function(Z){var tt=Oe(Z),ot=this.getLink(tt);if(!ot)throw At(H,"unlink",Z);if(ot.length)throw Error("Dir not empty...");this.deleteLink(ot);var vt=ot.getNode();vt.nlink--,vt.nlink<=0&&this.deleteNode(vt)},ht.prototype.unlinkSync=function(Z){var tt=jt(Z);this.unlinkBase(tt)},ht.prototype.unlink=function(Z,tt){var ot=jt(Z);this.wrapAsync(this.unlinkBase,[ot],tt)},ht.prototype.symlinkBase=function(Z,tt){var ot=Oe(tt),vt=this.getLinkParent(ot);if(!vt)throw At(H,"symlink",Z,tt);var Pt=ot[ot.length-1];if(vt.getChild(Pt))throw At(X,"symlink",Z,tt);var Bt=vt.createChild(Pt);return Bt.getNode().makeSymlink(Oe(Z)),Bt},ht.prototype.symlinkSync=function(Z,tt,ot){var vt=jt(Z),Pt=jt(tt);this.symlinkBase(vt,Pt)},ht.prototype.symlink=function(Z,tt,ot,vt){var Pt=Ot(typeof ot=="function"?ot:vt),Bt=jt(Z),Vt=jt(tt);this.wrapAsync(this.symlinkBase,[Bt,Vt],Pt)},ht.prototype.realpathBase=function(Z,tt){var ot=Oe(Z),vt=this.getResolvedLink(ot);if(!vt)throw At(H,"realpath",Z);return(0,p.strToEncoding)(vt.getPath()||"/",tt)},ht.prototype.realpathSync=function(Z,tt){return this.realpathBase(jt(Z),Et(tt).encoding)},ht.prototype.realpath=function(Z,tt,ot){var vt=Dt(tt,ot),Pt=vt[0],Bt=vt[1],Vt=jt(Z);this.wrapAsync(this.realpathBase,[Vt,Pt.encoding],Bt)},ht.prototype.lstatBase=function(Z,tt,ot){tt===void 0&&(tt=!1),ot===void 0&&(ot=!1);var vt=this.getLink(Oe(Z));if(vt)return i.default.build(vt.getNode(),tt);if(ot)throw At(H,"lstat",Z)},ht.prototype.lstatSync=function(Z,tt){var ot=ut(tt),vt=ot.throwIfNoEntry,Pt=vt===void 0?!0:vt,Bt=ot.bigint,Vt=Bt===void 0?!1:Bt;return this.lstatBase(jt(Z),Vt,Pt)},ht.prototype.lstat=function(Z,tt,ot){var vt=yt(tt,ot),Pt=vt[0],Bt=Pt.throwIfNoEntry,Vt=Bt===void 0?!0:Bt,ee=Pt.bigint,le=ee===void 0?!1:ee,xe=vt[1];this.wrapAsync(this.lstatBase,[jt(Z),le,Vt],xe)},ht.prototype.statBase=function(Z,tt,ot){tt===void 0&&(tt=!1),ot===void 0&&(ot=!0);var vt=this.getResolvedLink(Oe(Z));if(vt)return i.default.build(vt.getNode(),tt);if(ot)throw At(H,"stat",Z)},ht.prototype.statSync=function(Z,tt){var ot=ut(tt),vt=ot.bigint,Pt=vt===void 0?!0:vt,Bt=ot.throwIfNoEntry,Vt=Bt===void 0?!0:Bt;return this.statBase(jt(Z),Pt,Vt)},ht.prototype.stat=function(Z,tt,ot){var vt=yt(tt,ot),Pt=vt[0],Bt=Pt.bigint,Vt=Bt===void 0?!1:Bt,ee=Pt.throwIfNoEntry,le=ee===void 0?!0:ee,xe=vt[1];this.wrapAsync(this.statBase,[jt(Z),Vt,le],xe)},ht.prototype.fstatBase=function(Z,tt){tt===void 0&&(tt=!1);var ot=this.getFileByFd(Z);if(!ot)throw At(rt,"fstat");return i.default.build(ot.node,tt)},ht.prototype.fstatSync=function(Z,tt){return this.fstatBase(Z,ut(tt).bigint)},ht.prototype.fstat=function(Z,tt,ot){var vt=yt(tt,ot),Pt=vt[0],Bt=vt[1];this.wrapAsync(this.fstatBase,[Z,Pt.bigint],Bt)},ht.prototype.renameBase=function(Z,tt){var ot=this.getLink(Oe(Z));if(!ot)throw At(H,"rename",Z,tt);var vt=Oe(tt),Pt=this.getLinkParent(vt);if(!Pt)throw At(H,"rename",Z,tt);var Bt=ot.parent;Bt&&Bt.deleteChild(ot);var Vt=vt[vt.length-1];ot.name=Vt,ot.steps=t(t([],Pt.steps,!0),[Vt],!1),Pt.setChild(ot.getName(),ot)},ht.prototype.renameSync=function(Z,tt){var ot=jt(Z),vt=jt(tt);this.renameBase(ot,vt)},ht.prototype.rename=function(Z,tt,ot){var vt=jt(Z),Pt=jt(tt);this.wrapAsync(this.renameBase,[vt,Pt],ot)},ht.prototype.existsBase=function(Z){return!!this.statBase(Z)},ht.prototype.existsSync=function(Z){try{return this.existsBase(jt(Z))}catch{return!1}},ht.prototype.exists=function(Z,tt){var ot=this,vt=jt(Z);if(typeof tt!="function")throw Error(V.CB);(0,o.default)(function(){try{tt(ot.existsBase(vt))}catch{tt(!1)}})},ht.prototype.accessBase=function(Z,tt){this.getLinkOrThrow(Z,"access")},ht.prototype.accessSync=function(Z,tt){tt===void 0&&(tt=Y);var ot=jt(Z);tt=tt|0,this.accessBase(ot,tt)},ht.prototype.access=function(Z,tt,ot){var vt=Y,Pt;typeof tt!="function"?(vt=tt|0,Pt=Ot(ot)):Pt=tt;var Bt=jt(Z);this.wrapAsync(this.accessBase,[Bt,vt],Pt)},ht.prototype.appendFileSync=function(Z,tt,ot){ot===void 0&&(ot=k);var vt=ct(ot);(!vt.flag||yr(Z))&&(vt.flag="a"),this.writeFileSync(Z,tt,vt)},ht.prototype.appendFile=function(Z,tt,ot,vt){var Pt=mt(ot,vt),Bt=Pt[0],Vt=Pt[1];(!Bt.flag||yr(Z))&&(Bt.flag="a"),this.writeFile(Z,tt,Bt,Vt)},ht.prototype.readdirBase=function(Z,tt){var ot=Oe(Z),vt=this.getResolvedLink(ot);if(!vt)throw At(H,"readdir",Z);var Pt=vt.getNode();if(!Pt.isDirectory())throw At(st,"scandir",Z);if(tt.withFileTypes){var Bt=[];for(var Vt in vt.children){var ee=vt.getChild(Vt);!ee||Vt==="."||Vt===".."||Bt.push(s.default.build(ee,tt.encoding))}return!F&&tt.encoding!=="buffer"&&Bt.sort(function(Ke,si){return Ke.name<si.name?-1:Ke.name>si.name?1:0}),Bt}var le=[];for(var xe in vt.children)xe==="."||xe===".."||le.push((0,p.strToEncoding)(xe,tt.encoding));return!F&&tt.encoding!=="buffer"&&le.sort(),le},ht.prototype.readdirSync=function(Z,tt){var ot=It(tt),vt=jt(Z);return this.readdirBase(vt,ot)},ht.prototype.readdir=function(Z,tt,ot){var vt=Ft(tt,ot),Pt=vt[0],Bt=vt[1],Vt=jt(Z);this.wrapAsync(this.readdirBase,[Vt,Pt],Bt)},ht.prototype.readlinkBase=function(Z,tt){var ot=this.getLinkOrThrow(Z,"readlink"),vt=ot.getNode();if(!vt.isSymlink())throw At(lt,"readlink",Z);var Pt=nt+vt.symlink.join(nt);return(0,p.strToEncoding)(Pt,tt)},ht.prototype.readlinkSync=function(Z,tt){var ot=te(tt),vt=jt(Z);return this.readlinkBase(vt,ot.encoding)},ht.prototype.readlink=function(Z,tt,ot){var vt=O(tt,ot),Pt=vt[0],Bt=vt[1],Vt=jt(Z);this.wrapAsync(this.readlinkBase,[Vt,Pt.encoding],Bt)},ht.prototype.fsyncBase=function(Z){this.getFileByFdOrThrow(Z,"fsync")},ht.prototype.fsyncSync=function(Z){this.fsyncBase(Z)},ht.prototype.fsync=function(Z,tt){this.wrapAsync(this.fsyncBase,[Z],tt)},ht.prototype.fdatasyncBase=function(Z){this.getFileByFdOrThrow(Z,"fdatasync")},ht.prototype.fdatasyncSync=function(Z){this.fdatasyncBase(Z)},ht.prototype.fdatasync=function(Z,tt){this.wrapAsync(this.fdatasyncBase,[Z],tt)},ht.prototype.ftruncateBase=function(Z,tt){var ot=this.getFileByFdOrThrow(Z,"ftruncate");ot.truncate(tt)},ht.prototype.ftruncateSync=function(Z,tt){this.ftruncateBase(Z,tt)},ht.prototype.ftruncate=function(Z,tt,ot){var vt=typeof tt=="number"?tt:0,Pt=Ot(typeof tt=="number"?ot:tt);this.wrapAsync(this.ftruncateBase,[Z,vt],Pt)},ht.prototype.truncateBase=function(Z,tt){var ot=this.openSync(Z,"r+");try{this.ftruncateSync(ot,tt)}finally{this.closeSync(ot)}},ht.prototype.truncateSync=function(Z,tt){if(yr(Z))return this.ftruncateSync(Z,tt);this.truncateBase(Z,tt)},ht.prototype.truncate=function(Z,tt,ot){var vt=typeof tt=="number"?tt:0,Pt=Ot(typeof tt=="number"?ot:tt);if(yr(Z))return this.ftruncate(Z,vt,Pt);this.wrapAsync(this.truncateBase,[Z,vt],Pt)},ht.prototype.futimesBase=function(Z,tt,ot){var vt=this.getFileByFdOrThrow(Z,"futimes"),Pt=vt.node;Pt.atime=new Date(tt*1e3),Pt.mtime=new Date(ot*1e3)},ht.prototype.futimesSync=function(Z,tt,ot){this.futimesBase(Z,ni(tt),ni(ot))},ht.prototype.futimes=function(Z,tt,ot,vt){this.wrapAsync(this.futimesBase,[Z,ni(tt),ni(ot)],vt)},ht.prototype.utimesBase=function(Z,tt,ot){var vt=this.openSync(Z,"r");try{this.futimesBase(vt,tt,ot)}finally{this.closeSync(vt)}},ht.prototype.utimesSync=function(Z,tt,ot){this.utimesBase(jt(Z),ni(tt),ni(ot))},ht.prototype.utimes=function(Z,tt,ot,vt){this.wrapAsync(this.utimesBase,[jt(Z),ni(tt),ni(ot)],vt)},ht.prototype.mkdirBase=function(Z,tt){var ot=Oe(Z);if(!ot.length)throw At(X,"mkdir",Z);var vt=this.getLinkParentAsDirOrThrow(Z,"mkdir"),Pt=ot[ot.length-1];if(vt.getChild(Pt))throw At(X,"mkdir",Z);vt.createChild(Pt,this.createNode(!0,tt))},ht.prototype.mkdirpBase=function(Z,tt){for(var ot=Zt(Z),vt=ot.substring(1),Pt=vt?vt.split(nt):[],Bt=this.root,Vt=!1,ee=0;ee<Pt.length;ee++){var le=Pt[ee];if(!Bt.getNode().isDirectory())throw At(st,"mkdir",Bt.getPath());var xe=Bt.getChild(le);if(xe)if(xe.getNode().isDirectory())Bt=xe;else throw At(st,"mkdir",xe.getPath());else Bt=Bt.createChild(le,this.createNode(!0,tt)),Vt=!0}return Vt?ot:void 0},ht.prototype.mkdirSync=function(Z,tt){var ot=Ut(tt),vt=cr(ot.mode,511),Pt=jt(Z);if(ot.recursive)return this.mkdirpBase(Pt,vt);this.mkdirBase(Pt,vt)},ht.prototype.mkdir=function(Z,tt,ot){var vt=Ut(tt),Pt=Ot(typeof tt=="function"?tt:ot),Bt=cr(vt.mode,511),Vt=jt(Z);vt.recursive?this.wrapAsync(this.mkdirpBase,[Vt,Bt],Pt):this.wrapAsync(this.mkdirBase,[Vt,Bt],Pt)},ht.prototype.mkdirpSync=function(Z,tt){return this.mkdirSync(Z,{mode:tt,recursive:!0})},ht.prototype.mkdirp=function(Z,tt,ot){var vt=typeof tt=="function"?void 0:tt,Pt=Ot(typeof tt=="function"?tt:ot);this.mkdir(Z,{mode:vt,recursive:!0},Pt)},ht.prototype.mkdtempBase=function(Z,tt,ot){ot===void 0&&(ot=5);var vt=Z+this.genRndStr();try{return this.mkdirBase(vt,511),(0,p.strToEncoding)(vt,tt)}catch(Pt){if(Pt.code===X){if(ot>1)return this.mkdtempBase(Z,tt,ot-1);throw Error("Could not create temp dir.")}else throw Pt}},ht.prototype.mkdtempSync=function(Z,tt){var ot=te(tt).encoding;if(!Z||typeof Z!="string")throw new TypeError("filename prefix is required");return En(Z),this.mkdtempBase(Z,ot)},ht.prototype.mkdtemp=function(Z,tt,ot){var vt=O(tt,ot),Pt=vt[0].encoding,Bt=vt[1];if(!Z||typeof Z!="string")throw new TypeError("filename prefix is required");En(Z)&&this.wrapAsync(this.mkdtempBase,[Z,Pt],Bt)},ht.prototype.rmdirBase=function(Z,tt){var ot=U(tt),vt=this.getLinkAsDirOrThrow(Z,"rmdir");if(vt.length&&!ot.recursive)throw At(W,"rmdir",Z);this.deleteLink(vt)},ht.prototype.rmdirSync=function(Z,tt){this.rmdirBase(jt(Z),tt)},ht.prototype.rmdir=function(Z,tt,ot){var vt=U(tt),Pt=Ot(typeof tt=="function"?tt:ot);this.wrapAsync(this.rmdirBase,[jt(Z),vt],Pt)},ht.prototype.rmBase=function(Z,tt){tt===void 0&&(tt={});var ot=this.getResolvedLink(Z);if(!ot){if(!tt.force)throw At(H,"stat",Z);return}if(ot.getNode().isDirectory()&&!tt.recursive)throw At(pt,"rm",Z);this.deleteLink(ot)},ht.prototype.rmSync=function(Z,tt){this.rmBase(jt(Z),tt)},ht.prototype.rm=function(Z,tt,ot){var vt=Ht(tt,ot),Pt=vt[0],Bt=vt[1];this.wrapAsync(this.rmBase,[jt(Z),Pt],Bt)},ht.prototype.fchmodBase=function(Z,tt){var ot=this.getFileByFdOrThrow(Z,"fchmod");ot.chmod(tt)},ht.prototype.fchmodSync=function(Z,tt){this.fchmodBase(Z,cr(tt))},ht.prototype.fchmod=function(Z,tt,ot){this.wrapAsync(this.fchmodBase,[Z,cr(tt)],ot)},ht.prototype.chmodBase=function(Z,tt){var ot=this.openSync(Z,"r");try{this.fchmodBase(ot,tt)}finally{this.closeSync(ot)}},ht.prototype.chmodSync=function(Z,tt){var ot=cr(tt),vt=jt(Z);this.chmodBase(vt,ot)},ht.prototype.chmod=function(Z,tt,ot){var vt=cr(tt),Pt=jt(Z);this.wrapAsync(this.chmodBase,[Pt,vt],ot)},ht.prototype.lchmodBase=function(Z,tt){var ot=this.openBase(Z,_,0,!1);try{this.fchmodBase(ot,tt)}finally{this.closeSync(ot)}},ht.prototype.lchmodSync=function(Z,tt){var ot=cr(tt),vt=jt(Z);this.lchmodBase(vt,ot)},ht.prototype.lchmod=function(Z,tt,ot){var vt=cr(tt),Pt=jt(Z);this.wrapAsync(this.lchmodBase,[Pt,vt],ot)},ht.prototype.fchownBase=function(Z,tt,ot){this.getFileByFdOrThrow(Z,"fchown").chown(tt,ot)},ht.prototype.fchownSync=function(Z,tt,ot){ii(tt),_0(ot),this.fchownBase(Z,tt,ot)},ht.prototype.fchown=function(Z,tt,ot,vt){ii(tt),_0(ot),this.wrapAsync(this.fchownBase,[Z,tt,ot],vt)},ht.prototype.chownBase=function(Z,tt,ot){var vt=this.getResolvedLinkOrThrow(Z,"chown"),Pt=vt.getNode();Pt.chown(tt,ot)},ht.prototype.chownSync=function(Z,tt,ot){ii(tt),_0(ot),this.chownBase(jt(Z),tt,ot)},ht.prototype.chown=function(Z,tt,ot,vt){ii(tt),_0(ot),this.wrapAsync(this.chownBase,[jt(Z),tt,ot],vt)},ht.prototype.lchownBase=function(Z,tt,ot){this.getLinkOrThrow(Z,"lchown").getNode().chown(tt,ot)},ht.prototype.lchownSync=function(Z,tt,ot){ii(tt),_0(ot),this.lchownBase(jt(Z),tt,ot)},ht.prototype.lchown=function(Z,tt,ot,vt){ii(tt),_0(ot),this.wrapAsync(this.lchownBase,[jt(Z),tt,ot],vt)},ht.prototype.watchFile=function(Z,tt,ot){var vt=jt(Z),Pt=tt,Bt=ot;if(typeof Pt=="function"&&(Bt=tt,Pt=null),typeof Bt!="function")throw Error('"watchFile()" requires a listener function');var Vt=5007,ee=!0;Pt&&typeof Pt=="object"&&(typeof Pt.interval=="number"&&(Vt=Pt.interval),typeof Pt.persistent=="boolean"&&(ee=Pt.persistent));var le=this.statWatchers[vt];return le||(le=new this.StatWatcher,le.start(vt,ee,Vt),this.statWatchers[vt]=le),le.addListener("change",Bt),le},ht.prototype.unwatchFile=function(Z,tt){var ot=jt(Z),vt=this.statWatchers[ot];vt&&(typeof tt=="function"?vt.removeListener("change",tt):vt.removeAllListeners("change"),vt.listenerCount("change")===0&&(vt.stop(),delete this.statWatchers[ot]))},ht.prototype.createReadStream=function(Z,tt){return new this.ReadStream(Z,tt)},ht.prototype.createWriteStream=function(Z,tt){return new this.WriteStream(Z,tt)},ht.prototype.watch=function(Z,tt,ot){var vt=jt(Z),Pt=tt;typeof tt=="function"&&(ot=tt,Pt=null);var Bt=te(Pt),Vt=Bt.persistent,ee=Bt.recursive,le=Bt.encoding;Vt===void 0&&(Vt=!0),ee===void 0&&(ee=!1);var xe=new this.FSWatcher;return xe.start(vt,Vt,ee,le),ot&&xe.addListener("change",ot),xe},ht.fd=2147483647,ht})();nr.Volume=hZ;function fZ(ht){ht.emit("stop")}var W5=(function(ht){n(Z,ht);function Z(tt){var ot=ht.call(this)||this;return ot.onInterval=function(){try{var vt=ot.vol.statSync(ot.filename);ot.hasChanged(vt)&&(ot.emit("change",vt,ot.prev),ot.prev=vt)}finally{ot.loop()}},ot.vol=tt,ot}return Z.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},Z.prototype.hasChanged=function(tt){return tt.mtimeMs>this.prev.mtimeMs||tt.nlink!==this.prev.nlink},Z.prototype.start=function(tt,ot,vt){ot===void 0&&(ot=!0),vt===void 0&&(vt=5007),this.filename=jt(tt),this.setTimeout=ot?setTimeout.bind(typeof globalThis<"u"?globalThis:_rt):u.default,this.interval=vt,this.prev=this.vol.statSync(this.filename),this.loop()},Z.prototype.stop=function(){clearTimeout(this.timeoutRef),c.default.nextTick(fZ,this)},Z})(d.EventEmitter);nr.StatWatcher=W5;var bo;function dZ(ht){bo=(0,a.bufferAllocUnsafe)(ht),bo.used=0}y.inherits(Jl,h.Readable),nr.ReadStream=Jl;function Jl(ht,Z,tt){if(!(this instanceof Jl))return new Jl(ht,Z,tt);if(this._vol=ht,tt=Object.assign({},$t(tt,{})),tt.highWaterMark===void 0&&(tt.highWaterMark=64*1024),h.Readable.call(this,tt),this.path=jt(Z),this.fd=tt.fd===void 0?null:tt.fd,this.flags=tt.flags===void 0?"r":tt.flags,this.mode=tt.mode===void 0?438:tt.mode,this.start=tt.start,this.end=tt.end,this.autoClose=tt.autoClose===void 0?!0:tt.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()})}Jl.prototype.open=function(){var ht=this;this._vol.open(this.path,this.flags,this.mode,function(Z,tt){if(Z){ht.autoClose&&ht.destroy&&ht.destroy(),ht.emit("error",Z);return}ht.fd=tt,ht.emit("open",tt),ht.read()})},Jl.prototype._read=function(ht){if(typeof this.fd!="number")return this.once("open",function(){this._read(ht)});if(this.destroyed)return;(!bo||bo.length-bo.used<P)&&dZ(this._readableState.highWaterMark);var Z=bo,tt=Math.min(bo.length-bo.used,ht),ot=bo.used;if(this.pos!==void 0&&(tt=Math.min(this.end-this.pos+1,tt)),tt<=0)return this.push(null);var vt=this;this._vol.read(this.fd,bo,bo.used,tt,this.pos,Pt),this.pos!==void 0&&(this.pos+=tt),bo.used+=tt;function Pt(Bt,Vt){if(Bt)vt.autoClose&&vt.destroy&&vt.destroy(),vt.emit("error",Bt);else{var ee=null;Vt>0&&(vt.bytesRead+=Vt,ee=Z.slice(ot,ot+Vt)),vt.push(ee)}}},Jl.prototype._destroy=function(ht,Z){this.close(function(tt){Z(ht||tt)})},Jl.prototype.close=function(ht){var Z=this,tt;if(ht&&this.once("close",ht),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",G5);return}return c.default.nextTick(function(){return Z.emit("close")})}typeof((tt=this._readableState)===null||tt===void 0?void 0:tt.closed)=="boolean"?this._readableState.closed=!0:this.closed=!0,this._vol.close(this.fd,function(ot){ot?Z.emit("error",ot):Z.emit("close")}),this.fd=null};function G5(ht){this.close()}y.inherits(vo,h.Writable),nr.WriteStream=vo;function vo(ht,Z,tt){if(!(this instanceof vo))return new vo(ht,Z,tt);if(this._vol=ht,tt=Object.assign({},$t(tt,{})),h.Writable.call(this,tt),this.path=jt(Z),this.fd=tt.fd===void 0?null:tt.fd,this.flags=tt.flags===void 0?"w":tt.flags,this.mode=tt.mode===void 0?438:tt.mode,this.start=tt.start,this.autoClose=tt.autoClose===void 0?!0:!!tt.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}tt.encoding&&this.setDefaultEncoding(tt.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}vo.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(ht,Z){if(ht){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",ht);return}this.fd=Z,this.emit("open",Z)}.bind(this))},vo.prototype._write=function(ht,Z,tt){if(!(ht instanceof a.Buffer||ht instanceof Uint8Array))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(ht,Z,tt)});var ot=this;this._vol.write(this.fd,ht,0,ht.length,this.pos,function(vt,Pt){if(vt)return ot.autoClose&&ot.destroy&&ot.destroy(),tt(vt);ot.bytesWritten+=Pt,tt()}),this.pos!==void 0&&(this.pos+=ht.length)},vo.prototype._writev=function(ht,Z){if(typeof this.fd!="number")return this.once("open",function(){this._writev(ht,Z)});for(var tt=this,ot=ht.length,vt=new Array(ot),Pt=0,Bt=0;Bt<ot;Bt++){var Vt=ht[Bt].chunk;vt[Bt]=Vt,Pt+=Vt.length}var ee=a.Buffer.concat(vt);this._vol.write(this.fd,ee,0,ee.length,this.pos,function(le,xe){if(le)return tt.destroy&&tt.destroy(),Z(le);tt.bytesWritten+=xe,Z()}),this.pos!==void 0&&(this.pos+=Pt)},vo.prototype.close=function(ht){var Z=this,tt;if(ht&&this.once("close",ht),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",G5);return}return c.default.nextTick(function(){return Z.emit("close")})}typeof((tt=this._writableState)===null||tt===void 0?void 0:tt.closed)=="boolean"?this._writableState.closed=!0:this.closed=!0,this._vol.close(this.fd,function(ot){ot?Z.emit("error",ot):Z.emit("close")}),this.fd=null},vo.prototype._destroy=Jl.prototype._destroy,vo.prototype.destroySoon=vo.prototype.end;var V5=(function(ht){n(Z,ht);function Z(tt){var ot=ht.call(this)||this;return ot._filename="",ot._filenameEncoded="",ot._recursive=!1,ot._encoding=p.ENCODING_UTF8,ot._listenerRemovers=new Map,ot._onParentChild=function(vt){vt.getName()===ot._getName()&&ot._emit("rename")},ot._emit=function(vt){ot.emit("change",vt,ot._filenameEncoded)},ot._persist=function(){ot._timer=setTimeout(ot._persist,1e6)},ot._vol=tt,ot}return Z.prototype._getName=function(){return this._steps[this._steps.length-1]},Z.prototype.start=function(tt,ot,vt,Pt){var Bt=this;ot===void 0&&(ot=!0),vt===void 0&&(vt=!1),Pt===void 0&&(Pt=p.ENCODING_UTF8),this._filename=jt(tt),this._steps=Oe(this._filename),this._filenameEncoded=(0,p.strToEncoding)(this._filename),this._recursive=vt,this._encoding=Pt;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(Ke){var Vt=new Error("watch ".concat(this._filename," ").concat(Ke.code));throw Vt.code=Ke.code,Vt.errno=Ke.code,Vt}var ee=function(Ke){var si,Fp=Ke.getPath(),Ql=Ke.getNode(),Tf=function(){var Un=J(Bt._filename,Fp);return Un||(Un=Bt._getName()),Bt.emit("change","change",Un)};Ql.on("change",Tf);var Bp=(si=Bt._listenerRemovers.get(Ql.ino))!==null&&si!==void 0?si:[];Bp.push(function(){return Ql.removeListener("change",Tf)}),Bt._listenerRemovers.set(Ql.ino,Bp)},le=function(Ke){var si,Fp=Ke.getNode(),Ql=function(Un){Bt.emit("change","rename",J(Bt._filename,Un.getPath())),setTimeout(function(){ee(Un),le(Un)})},Tf=function(Un){var wo=function(ul){var FT=ul.getNode().ino,X5=Bt._listenerRemovers.get(FT);X5&&(X5.forEach(function(BT){return BT()}),Bt._listenerRemovers.delete(FT)),Object.values(ul.children).forEach(function(BT){BT&&wo(BT)})};wo(Un),Bt.emit("change","rename",J(Bt._filename,Un.getPath()))};Object.entries(Ke.children).forEach(function(Un){var wo=Un[0],ul=Un[1];ul&&wo!=="."&&wo!==".."&&ee(ul)}),Ke.on("child:add",Ql),Ke.on("child:delete",Tf);var Bp=(si=Bt._listenerRemovers.get(Fp.ino))!==null&&si!==void 0?si:[];Bp.push(function(){Ke.removeListener("child:add",Ql),Ke.removeListener("child:delete",Tf)}),vt&&Object.entries(Ke.children).forEach(function(Un){var wo=Un[0],ul=Un[1];ul&&wo!=="."&&wo!==".."&&le(ul)})};ee(this._link),le(this._link);var xe=this._link.parent;xe&&(xe.setMaxListeners(xe.getMaxListeners()+1),xe.on("child:delete",this._onParentChild)),ot&&this._persist()},Z.prototype.close=function(){clearTimeout(this._timer),this._listenerRemovers.forEach(function(ot){ot.forEach(function(vt){return vt()})}),this._listenerRemovers.clear();var tt=this._link.parent;tt&&tt.removeListener("child:delete",this._onParentChild)},Z})(d.EventEmitter);return nr.FSWatcher=V5,nr}function Trt(){return r7||(r7=!0,Object.defineProperty(_u,"__esModule",{value:!0}),_u.fsSyncMethods=_u.fsProps=_u.fsAsyncMethods=void 0,_u.fsProps=["constants","F_OK","R_OK","W_OK","X_OK","Stats"],_u.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"],_u.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"]),_u}function Crt(){if(n7)return Ai;n7=!0;var n=Ai&&Ai.__assign||function(){return n=Object.assign||function(p){for(var g,y=1,b=arguments.length;y<b;y++){g=arguments[y];for(var m in g)Object.prototype.hasOwnProperty.call(g,m)&&(p[m]=g[m])}return p},n.apply(this,arguments)};Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.fs=Ai.createFsFromVolume=Ai.vol=Ai.Volume=void 0;var t=BL(),e=a7(),r=c7(),i=Trt(),s=i.fsSyncMethods,a=i.fsAsyncMethods,o=IE(),c=o.constants.F_OK,u=o.constants.R_OK,h=o.constants.W_OK,f=o.constants.X_OK;Ai.Volume=r.Volume,Ai.vol=new r.Volume;function d(p){for(var g={F_OK:c,R_OK:u,W_OK:h,X_OK:f,constants:o.constants,Stats:t.default,Dirent:e.default},y=0,b=s;y<b.length;y++){var m=b[y];typeof p[m]=="function"&&(g[m]=p[m].bind(p))}for(var w=0,A=a;w<A.length;w++){var m=A[w];typeof p[m]=="function"&&(g[m]=p[m].bind(p))}return g.StatWatcher=p.StatWatcher,g.FSWatcher=p.FSWatcher,g.WriteStream=p.WriteStream,g.ReadStream=p.ReadStream,g.promises=p.promises,g._toUnixTimestamp=r.toUnixTimestamp,g}return Ai.createFsFromVolume=d,Ai.fs=d(Ai.vol),Ai=n(n({},Ai),Ai.fs),Ai.semantic=!0,Ai}function va(n){throw new Error(`Node.js fs ${n} is not supported by JSPM core in the browser`)}function u7(n,t,e){let r=0,i=new TextDecoder;Tu.watch(n,"utf8",()=>{let{size:s}=Tu.fstatSync(t),a=Buffer.alloc(s-r);Tu.readSync(t,a,0,a.length,r),r=s,e(i.decode(a,{stream:!0}))})}function jL(n,t){if(n.protocol==="file:")return FL(n);if(n.protocol==="https:"||n.protocol==="http:"){let e="\\\\url\\"+n.href.replaceAll(/\//g,"\\\\");if(IC(e))return e;if(t)throw new Error(`Cannot sync request URL ${n} 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 r=await fetch(n);if(!r.ok)throw new Error(`Unable to fetch ${n.href}, ${r.status}`);let i=await r.arrayBuffer();return h7(e,Buffer.from(i)),e})()}throw new Error("URL "+n+" not supported in JSPM FS implementation.")}function Irt(n){return function(t,...e){return t instanceof URL?n(jL(t,!0),...e):n(t,...e)}}function Drt(n){return async function(t,...e){return t instanceof URL?n(await jL(t),...e):n(t,...e)}}function Ort(n){return function(t,...e){let r=e[e.length-1];t instanceof URL&&typeof r=="function"?jL(t).then(i=>{n(i,...e)},r):n(t,...e)}}var CE,$9,TC,H9,z0,z9,dl,W9,li,G9,vrt,sc,V9,W0,X9,CC,q9,Y9,G0,K9,Vs,Z9,RC,J9,Art,kf,Q9,RE,t7,nr,e7,_rt,_u,r7,Ai,n7,og,Ss,Tu,Rrt,rn,Prt,Nrt,Lrt,krt,Mrt,Frt,Brt,Urt,jrt,$rt,Hrt,zrt,Wrt,Grt,Vrt,Xrt,qrt,IC,Yrt,Krt,Zrt,Jrt,Qrt,tnt,ent,rnt,nnt,int,snt,ant,ont,lnt,cnt,unt,hnt,fnt,dnt,pnt,gnt,$L,mnt,ynt,bnt,vnt,wnt,Ant,Ent,xnt,Snt,_nt,Tnt,Cnt,Rnt,Int,Dnt,HL,Ont,Pnt,Nnt,Lnt,knt,Mnt,Fnt,Bnt,Unt,jnt,$nt,Hnt,znt,Wnt,Gnt,Vnt,Xnt,qnt,Ynt,Knt,Znt,Jnt,Qnt,tit,h7,eit,rit,nit,iit,sit,ait,oit,lit,cit,uit,hit,fit,dit,pit,git,mit,yit,bit,OE=br(()=>{Tt();Rt();Ct();C0();sN();dC();Of();r$();N0();Jp();mC();B0();ZN();If();j9();SC();QN();TE();TL();CE={},$9=!1;TC={},H9=!1;z0={},z9=!1;dl={},W9=!1;li={},G9=!1,vrt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;sc={},V9=!1;W0={},X9=!1;ai._makeLong;ai.basename;ai.delimiter;ai.dirname;ai.extname;ai.format;ai.isAbsolute;ai.join;ai.normalize;ai.parse;ai.posix;ai.relative;ai.resolve;ai.sep;ai.win32;CC={},q9=!1,Y9=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;G0={},K9=!1;Vs={},Z9=!1;RC={},J9=!1,Art=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;kf={},Q9=!1;RE={},t7=!1;nr={},e7=!1,_rt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;_u={},r7=!1;Ai={},n7=!1;og=Crt();og.__esModule;og.fs;og.createFsFromVolume;og.vol;og.Volume;og.semantic;Ss=c7();Ss.__esModule;Ss.FSWatcher;Ss.StatWatcher;Ss.Volume;Ss.toUnixTimestamp;Ss.bufferToEncoding;Ss.dataToBuffer;Ss.dataToStr;Ss.pathToSteps;Ss.filenameToSteps;Ss.pathToFilename;Ss.flagsToNumber;Ss.FLAGS;Ss.ReadStream;Ss.WriteStream;({vol:Tu,createFsFromVolume:Rrt}=og);Tu.fromNestedJSON({"/dev":{stdin:"",stdout:"",stderr:""},"/usr/bin":{},"/home":{},"/tmp":{}});Tu.releasedFds=[2,1,0];Tu.openSync("/dev/stdin","w");Tu.openSync("/dev/stdout","r");Tu.openSync("/dev/stderr","r");u7("/dev/stdout",1,console.log);u7("/dev/stderr",2,console.error);rn=Rrt(Tu);rn.opendir=()=>va("opendir");rn.opendirSync=()=>va("opendirSync");rn.promises.opendir=()=>va("promises.opendir");rn.cp=()=>va("cp");rn.cpSync=()=>va("cpSync");rn.promises.cp=()=>va("promises.cp");rn.readv=()=>va("readv");rn.readvSync=()=>va("readvSync");rn.rm=()=>va("rm");rn.rmSync=()=>va("rmSync");rn.promises.rm=()=>va("promises.rm");rn.Dir=()=>va("Dir");rn.promises.watch=()=>va("promises.watch");rn.FileReadStream=rn.ReadStream;rn.FileWriteStream=rn.WriteStream;rn.promises.readFile=Drt(rn.promises.readFile);rn.readFile=Ort(rn.readFile);rn.readFileSync=Irt(rn.readFileSync);({appendFile:Prt,appendFileSync:Nrt,access:Lrt,accessSync:krt,chown:Mrt,chownSync:Frt,chmod:Brt,chmodSync:Urt,close:jrt,closeSync:$rt,copyFile:Hrt,copyFileSync:zrt,cp:Wrt,cpSync:Grt,createReadStream:Vrt,createWriteStream:Xrt,exists:qrt,existsSync:IC,fchown:Yrt,fchownSync:Krt,fchmod:Zrt,fchmodSync:Jrt,fdatasync:Qrt,fdatasyncSync:tnt,fstat:ent,fstatSync:rnt,fsync:nnt,fsyncSync:int,ftruncate:snt,ftruncateSync:ant,futimes:ont,futimesSync:lnt,lchown:cnt,lchownSync:unt,lchmod:hnt,lchmodSync:fnt,link:dnt,linkSync:pnt,lstat:gnt,lstatSync:$L,mkdir:mnt,mkdirSync:ynt,mkdtemp:bnt,mkdtempSync:vnt,open:wnt,openSync:Ant,opendir:Ent,opendirSync:xnt,readdir:Snt,readdirSync:_nt,read:Tnt,readSync:Cnt,readv:Rnt,readvSync:Int,readFile:Dnt,readFileSync:HL,readlink:Ont,readlinkSync:Pnt,realpath:Nnt,realpathSync:Lnt,rename:knt,renameSync:Mnt,rm:Fnt,rmSync:Bnt,rmdir:Unt,rmdirSync:jnt,stat:$nt,statSync:Hnt,symlink:znt,symlinkSync:Wnt,truncate:Gnt,truncateSync:Vnt,unwatchFile:Xnt,unlink:qnt,unlinkSync:Ynt,utimes:Knt,utimesSync:Znt,watch:Jnt,watchFile:Qnt,writeFile:tit,writeFileSync:h7,write:eit,writeSync:rit,writev:nit,writevSync:iit,Dir:sit,Dirent:ait,Stats:oit,ReadStream:lit,WriteStream:cit,FileReadStream:uit,FileWriteStream:hit,_toUnixTimestamp:fit,constants:{F_OK:dit,R_OK:pit,W_OK:git,X_OK:mit},constants:yit,promises:bit}=rn)});var zL=ae(Yn=>{"use strict";Tt();Rt();Ct();Object.defineProperty(Yn,"__esModule",{value:!0});Yn.readFile=Yn.writeFileSync=Yn.writeFile=Yn.read=Yn.open=Yn.close=Yn.stat=Yn.createReadStream=Yn.pathExists=void 0;var Cu=(OE(),xn(DE));Yn.pathExists=Cu.existsSync;Yn.createReadStream=Cu.createReadStream;async function vit(n){return new Promise((t,e)=>{Cu.stat(n,(r,i)=>{r?e(r):t(i)})})}Yn.stat=vit;async function wit(n){return new Promise((t,e)=>{Cu.close(n,r=>{r?e(r):t()})})}Yn.close=wit;async function Ait(n,t){return new Promise((e,r)=>{Cu.open(n,t,(i,s)=>{i?r(i):e(s)})})}Yn.open=Ait;async function Eit(n,t,e,r,i){return new Promise((s,a)=>{Cu.read(n,t,e,r,i,(o,c,u)=>{o?a(o):s({bytesRead:c,buffer:u})})})}Yn.read=Eit;async function xit(n,t){return new Promise((e,r)=>{Cu.writeFile(n,t,i=>{i?r(i):e()})})}Yn.writeFile=xit;function Sit(n,t){Cu.writeFileSync(n,t)}Yn.writeFileSync=Sit;async function _it(n){return new Promise((t,e)=>{Cu.readFile(n,(r,i)=>{r?e(r):t(i)})})}Yn.readFile=_it});var DC=ae(lg=>{"use strict";Tt();Rt();Ct();Object.defineProperty(lg,"__esModule",{value:!0});lg.EndOfStreamError=lg.defaultMessages=void 0;lg.defaultMessages="End-Of-Stream";var WL=class extends Error{constructor(){super(lg.defaultMessages)}};lg.EndOfStreamError=WL});var f7=ae(OC=>{"use strict";Tt();Rt();Ct();Object.defineProperty(OC,"__esModule",{value:!0});OC.Deferred=void 0;var GL=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise((t,e)=>{this.reject=e,this.resolve=t})}};OC.Deferred=GL});var p7=ae(V0=>{"use strict";Tt();Rt();Ct();Object.defineProperty(V0,"__esModule",{value:!0});V0.StreamReader=V0.EndOfStreamError=void 0;var d7=DC(),Tit=f7(),Cit=DC();Object.defineProperty(V0,"EndOfStreamError",{enumerable:!0,get:function(){return Cit.EndOfStreamError}});var Rit=1*1024*1024,VL=class{constructor(t){if(this.s=t,this.deferred=null,this.endOfStream=!1,this.peekQueue=[],!t.read||!t.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",()=>this.reject(new d7.EndOfStreamError)),this.s.once("error",e=>this.reject(e)),this.s.once("close",()=>this.reject(new Error("Stream closed")))}async peek(t,e,r){let i=await this.read(t,e,r);return this.peekQueue.push(t.subarray(e,e+i)),i}async read(t,e,r){if(r===0)return 0;if(this.peekQueue.length===0&&this.endOfStream)throw new d7.EndOfStreamError;let i=r,s=0;for(;this.peekQueue.length>0&&i>0;){let a=this.peekQueue.pop();if(!a)throw new Error("peekData should be defined");let o=Math.min(a.length,i);t.set(a.subarray(0,o),e+s),s+=o,i-=o,o<a.length&&this.peekQueue.push(a.subarray(o))}for(;i>0&&!this.endOfStream;){let a=Math.min(i,Rit),o=await this.readFromStream(t,e+s,a);if(s+=o,o<a)break;i-=o}return s}async readFromStream(t,e,r){let i=this.s.read(r);if(i)return t.set(i,e),i.length;{let s={buffer:t,offset:e,length:r,deferred:new Tit.Deferred};return this.deferred=s.deferred,this.s.once("readable",()=>{this.readDeferred(s)}),s.deferred.promise}}readDeferred(t){let e=this.s.read(t.length);e?(t.buffer.set(e,t.offset),t.deferred.resolve(e.length),this.deferred=null):this.s.once("readable",()=>{this.readDeferred(t)})}reject(t){this.endOfStream=!0,this.deferred&&(this.deferred.reject(t),this.deferred=null)}};V0.StreamReader=VL});var q0=ae(X0=>{"use strict";Tt();Rt();Ct();Object.defineProperty(X0,"__esModule",{value:!0});X0.StreamReader=X0.EndOfStreamError=void 0;var Iit=DC();Object.defineProperty(X0,"EndOfStreamError",{enumerable:!0,get:function(){return Iit.EndOfStreamError}});var Dit=p7();Object.defineProperty(X0,"StreamReader",{enumerable:!0,get:function(){return Dit.StreamReader}})});var LC=ae(NC=>{"use strict";Tt();Rt();Ct();Object.defineProperty(NC,"__esModule",{value:!0});NC.AbstractTokenizer=void 0;var PC=q0(),XL=class{constructor(t){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=t||{}}async readToken(t,e=this.position){let r=Buffer.alloc(t.len);if(await this.readBuffer(r,{position:e})<t.len)throw new PC.EndOfStreamError;return t.get(r,0)}async peekToken(t,e=this.position){let r=Buffer.alloc(t.len);if(await this.peekBuffer(r,{position:e})<t.len)throw new PC.EndOfStreamError;return t.get(r,0)}async readNumber(t){if(await this.readBuffer(this.numBuffer,{length:t.len})<t.len)throw new PC.EndOfStreamError;return t.get(this.numBuffer,0)}async peekNumber(t){if(await this.peekBuffer(this.numBuffer,{length:t.len})<t.len)throw new PC.EndOfStreamError;return t.get(this.numBuffer,0)}async ignore(t){if(this.fileInfo.size!==void 0){let e=this.fileInfo.size-this.position;if(t>e)return this.position+=e,e}return this.position+=t,t}async close(){}normalizeOptions(t,e){if(e&&e.position!==void 0&&e.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return e?{mayBeLess:e.mayBeLess===!0,offset:e.offset?e.offset:0,length:e.length?e.length:t.length-(e.offset?e.offset:0),position:e.position?e.position:this.position}:{mayBeLess:!1,offset:0,length:t.length,position:this.position}}};NC.AbstractTokenizer=XL});var g7=ae(MC=>{"use strict";Tt();Rt();Ct();Object.defineProperty(MC,"__esModule",{value:!0});MC.ReadStreamTokenizer=void 0;var Oit=LC(),kC=q0(),Pit=256e3,qL=class extends Oit.AbstractTokenizer{constructor(t,e){super(e),this.streamReader=new kC.StreamReader(t)}async getFileInfo(){return this.fileInfo}async readBuffer(t,e){let r=this.normalizeOptions(t,e),i=r.position-this.position;if(i>0)return await this.ignore(i),this.readBuffer(t,e);if(i<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(r.length===0)return 0;let s=await this.streamReader.read(t,r.offset,r.length);if(this.position+=s,(!e||!e.mayBeLess)&&s<r.length)throw new kC.EndOfStreamError;return s}async peekBuffer(t,e){let r=this.normalizeOptions(t,e),i=0;if(r.position){let s=r.position-this.position;if(s>0){let a=new Uint8Array(r.length+s);return i=await this.peekBuffer(a,{mayBeLess:r.mayBeLess}),t.set(a.subarray(s),r.offset),i-s}else if(s<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{i=await this.streamReader.peek(t,r.offset,r.length)}catch(s){if(e&&e.mayBeLess&&s instanceof kC.EndOfStreamError)return 0;throw s}if(!r.mayBeLess&&i<r.length)throw new kC.EndOfStreamError}return i}async ignore(t){let e=Math.min(Pit,t),r=new Uint8Array(e),i=0;for(;i<t;){let s=t-i,a=await this.readBuffer(r,{length:Math.min(e,s)});if(a<0)return a;i+=a}return i}};MC.ReadStreamTokenizer=qL});var m7=ae(FC=>{"use strict";Tt();Rt();Ct();Object.defineProperty(FC,"__esModule",{value:!0});FC.BufferTokenizer=void 0;var Nit=q0(),Lit=LC(),YL=class extends Lit.AbstractTokenizer{constructor(t,e){super(e),this.uint8Array=t,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:t.length}async readBuffer(t,e){if(e&&e.position){if(e.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=e.position}let r=await this.peekBuffer(t,e);return this.position+=r,r}async peekBuffer(t,e){let r=this.normalizeOptions(t,e),i=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&i<r.length)throw new Nit.EndOfStreamError;return t.set(this.uint8Array.subarray(r.position,r.position+i),r.offset),i}async close(){}};FC.BufferTokenizer=YL});var BC=ae(Mf=>{"use strict";Tt();Rt();Ct();Object.defineProperty(Mf,"__esModule",{value:!0});Mf.fromBuffer=Mf.fromStream=Mf.EndOfStreamError=void 0;var kit=g7(),Mit=m7(),Fit=q0();Object.defineProperty(Mf,"EndOfStreamError",{enumerable:!0,get:function(){return Fit.EndOfStreamError}});function Bit(n,t){return t=t||{},new kit.ReadStreamTokenizer(n,t)}Mf.fromStream=Bit;function Uit(n,t){return new Mit.BufferTokenizer(n,t)}Mf.fromBuffer=Uit});var b7=ae(Y0=>{"use strict";Tt();Rt();Ct();Object.defineProperty(Y0,"__esModule",{value:!0});Y0.fromFile=Y0.FileTokenizer=void 0;var jit=LC(),y7=q0(),PE=zL(),UC=class extends jit.AbstractTokenizer{constructor(t,e){super(e),this.fd=t}async readBuffer(t,e){let r=this.normalizeOptions(t,e);this.position=r.position;let i=await PE.read(this.fd,t,r.offset,r.length,r.position);if(this.position+=i.bytesRead,i.bytesRead<r.length&&(!e||!e.mayBeLess))throw new y7.EndOfStreamError;return i.bytesRead}async peekBuffer(t,e){let r=this.normalizeOptions(t,e),i=await PE.read(this.fd,t,r.offset,r.length,r.position);if(!r.mayBeLess&&i.bytesRead<r.length)throw new y7.EndOfStreamError;return i.bytesRead}async close(){return PE.close(this.fd)}};Y0.FileTokenizer=UC;async function $it(n){let t=await PE.stat(n);if(!t.isFile)throw new Error(`File not a file: ${n}`);let e=await PE.open(n,"r");return new UC(e,{path:n,size:t.size})}Y0.fromFile=$it});var w7=ae(ac=>{"use strict";Tt();Rt();Ct();Object.defineProperty(ac,"__esModule",{value:!0});ac.fromStream=ac.fromBuffer=ac.EndOfStreamError=ac.fromFile=void 0;var Hit=zL(),zit=BC(),Wit=b7();Object.defineProperty(ac,"fromFile",{enumerable:!0,get:function(){return Wit.fromFile}});var v7=BC();Object.defineProperty(ac,"EndOfStreamError",{enumerable:!0,get:function(){return v7.EndOfStreamError}});Object.defineProperty(ac,"fromBuffer",{enumerable:!0,get:function(){return v7.fromBuffer}});async function Git(n,t){if(t=t||{},n.path){let e=await Hit.stat(n.path);t.path=n.path,t.size=e.size}return zit.fromStream(n,t)}ac.fromStream=Git});var A7=ae(KL=>{Tt();Rt();Ct();KL.read=function(n,t,e,r,i){var s,a,o=i*8-r-1,c=(1<<o)-1,u=c>>1,h=-7,f=e?i-1:0,d=e?-1:1,p=n[t+f];for(f+=d,s=p&(1<<-h)-1,p>>=-h,h+=o;h>0;s=s*256+n[t+f],f+=d,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=r;h>0;a=a*256+n[t+f],f+=d,h-=8);if(s===0)s=1-u;else{if(s===c)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,r),s=s-u}return(p?-1:1)*a*Math.pow(2,s-r)};KL.write=function(n,t,e,r,i,s){var a,o,c,u=s*8-i-1,h=(1<<u)-1,f=h>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,g=r?1:-1,y=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+f>=1?t+=d/c:t+=d*Math.pow(2,1-f),t*c>=2&&(a++,c/=2),a+f>=h?(o=0,a=h):a+f>=1?(o=(t*c-1)*Math.pow(2,i),a=a+f):(o=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;n[e+p]=o&255,p+=g,o/=256,i-=8);for(a=a<<i|o,u+=i;u>0;n[e+p]=a&255,p+=g,a/=256,u-=8);n[e+p-g]|=y*128}});var E7=ae(pe=>{"use strict";Tt();Rt();Ct();Object.defineProperty(pe,"__esModule",{value:!0});pe.AnsiStringType=pe.StringType=pe.BufferType=pe.Uint8ArrayType=pe.IgnoreType=pe.Float80_LE=pe.Float80_BE=pe.Float64_LE=pe.Float64_BE=pe.Float32_LE=pe.Float32_BE=pe.Float16_LE=pe.Float16_BE=pe.INT64_BE=pe.UINT64_BE=pe.INT64_LE=pe.UINT64_LE=pe.INT32_LE=pe.INT32_BE=pe.INT24_BE=pe.INT24_LE=pe.INT16_LE=pe.INT16_BE=pe.INT8=pe.UINT32_BE=pe.UINT32_LE=pe.UINT24_BE=pe.UINT24_LE=pe.UINT16_BE=pe.UINT16_LE=pe.UINT8=void 0;var Ff=A7();function Le(n){return new DataView(n.buffer,n.byteOffset)}pe.UINT8={len:1,get(n,t){return Le(n).getUint8(t)},put(n,t,e){return Le(n).setUint8(t,e),t+1}};pe.UINT16_LE={len:2,get(n,t){return Le(n).getUint16(t,!0)},put(n,t,e){return Le(n).setUint16(t,e,!0),t+2}};pe.UINT16_BE={len:2,get(n,t){return Le(n).getUint16(t)},put(n,t,e){return Le(n).setUint16(t,e),t+2}};pe.UINT24_LE={len:3,get(n,t){let e=Le(n);return e.getUint8(t)+(e.getUint16(t+1,!0)<<8)},put(n,t,e){let r=Le(n);return r.setUint8(t,e&255),r.setUint16(t+1,e>>8,!0),t+3}};pe.UINT24_BE={len:3,get(n,t){let e=Le(n);return(e.getUint16(t)<<8)+e.getUint8(t+2)},put(n,t,e){let r=Le(n);return r.setUint16(t,e>>8),r.setUint8(t+2,e&255),t+3}};pe.UINT32_LE={len:4,get(n,t){return Le(n).getUint32(t,!0)},put(n,t,e){return Le(n).setUint32(t,e,!0),t+4}};pe.UINT32_BE={len:4,get(n,t){return Le(n).getUint32(t)},put(n,t,e){return Le(n).setUint32(t,e),t+4}};pe.INT8={len:1,get(n,t){return Le(n).getInt8(t)},put(n,t,e){return Le(n).setInt8(t,e),t+1}};pe.INT16_BE={len:2,get(n,t){return Le(n).getInt16(t)},put(n,t,e){return Le(n).setInt16(t,e),t+2}};pe.INT16_LE={len:2,get(n,t){return Le(n).getInt16(t,!0)},put(n,t,e){return Le(n).setInt16(t,e,!0),t+2}};pe.INT24_LE={len:3,get(n,t){let e=pe.UINT24_LE.get(n,t);return e>8388607?e-16777216:e},put(n,t,e){let r=Le(n);return r.setUint8(t,e&255),r.setUint16(t+1,e>>8,!0),t+3}};pe.INT24_BE={len:3,get(n,t){let e=pe.UINT24_BE.get(n,t);return e>8388607?e-16777216:e},put(n,t,e){let r=Le(n);return r.setUint16(t,e>>8),r.setUint8(t+2,e&255),t+3}};pe.INT32_BE={len:4,get(n,t){return Le(n).getInt32(t)},put(n,t,e){return Le(n).setInt32(t,e),t+4}};pe.INT32_LE={len:4,get(n,t){return Le(n).getInt32(t,!0)},put(n,t,e){return Le(n).setInt32(t,e,!0),t+4}};pe.UINT64_LE={len:8,get(n,t){return Le(n).getBigUint64(t,!0)},put(n,t,e){return Le(n).setBigUint64(t,e,!0),t+8}};pe.INT64_LE={len:8,get(n,t){return Le(n).getBigInt64(t,!0)},put(n,t,e){return Le(n).setBigInt64(t,e,!0),t+8}};pe.UINT64_BE={len:8,get(n,t){return Le(n).getBigUint64(t)},put(n,t,e){return Le(n).setBigUint64(t,e),t+8}};pe.INT64_BE={len:8,get(n,t){return Le(n).getBigInt64(t)},put(n,t,e){return Le(n).setBigInt64(t,e),t+8}};pe.Float16_BE={len:2,get(n,t){return Ff.read(n,t,!1,10,this.len)},put(n,t,e){return Ff.write(n,e,t,!1,10,this.len),t+this.len}};pe.Float16_LE={len:2,get(n,t){return Ff.read(n,t,!0,10,this.len)},put(n,t,e){return Ff.write(n,e,t,!0,10,this.len),t+this.len}};pe.Float32_BE={len:4,get(n,t){return Le(n).getFloat32(t)},put(n,t,e){return Le(n).setFloat32(t,e),t+4}};pe.Float32_LE={len:4,get(n,t){return Le(n).getFloat32(t,!0)},put(n,t,e){return Le(n).setFloat32(t,e,!0),t+4}};pe.Float64_BE={len:8,get(n,t){return Le(n).getFloat64(t)},put(n,t,e){return Le(n).setFloat64(t,e),t+8}};pe.Float64_LE={len:8,get(n,t){return Le(n).getFloat64(t,!0)},put(n,t,e){return Le(n).setFloat64(t,e,!0),t+8}};pe.Float80_BE={len:10,get(n,t){return Ff.read(n,t,!1,63,this.len)},put(n,t,e){return Ff.write(n,e,t,!1,63,this.len),t+this.len}};pe.Float80_LE={len:10,get(n,t){return Ff.read(n,t,!0,63,this.len)},put(n,t,e){return Ff.write(n,e,t,!0,63,this.len),t+this.len}};var ZL=class{constructor(t){this.len=t}get(t,e){}};pe.IgnoreType=ZL;var JL=class{constructor(t){this.len=t}get(t,e){return t.subarray(e,e+this.len)}};pe.Uint8ArrayType=JL;var QL=class{constructor(t){this.len=t}get(t,e){return Buffer.from(t.subarray(e,e+this.len))}};pe.BufferType=QL;var tk=class{constructor(t,e){this.len=t,this.encoding=e}get(t,e){return Buffer.from(t).toString(this.encoding,e,e+this.len)}};pe.StringType=tk;var jC=class n{constructor(t){this.len=t}static decode(t,e,r){let i="";for(let s=e;s<r;++s)i+=n.codePointToString(n.singleByteDecoder(t[s]));return i}static inRange(t,e,r){return e<=t&&t<=r}static codePointToString(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}static singleByteDecoder(t){if(n.inRange(t,0,127))return t;let e=n.windows1252[t-128];if(e===null)throw Error("invaliding encoding");return e}get(t,e=0){return n.decode(t,e,e+this.len)}};pe.AnsiStringType=jC;jC.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]});var x7=ae($C=>{"use strict";Tt();Rt();Ct();$C.stringToBytes=n=>[...n].map(t=>t.charCodeAt(0));$C.tarHeaderChecksumMatches=(n,t=0)=>{let e=parseInt(n.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(isNaN(e))return!1;let r=256;for(let i=t;i<t+148;i++)r+=n[i];for(let i=t+156;i<t+512;i++)r+=n[i];return e===r};$C.uint32SyncSafeToken={get:(n,t)=>n[t+3]&127|n[t+2]<<7|n[t+1]<<14|n[t]<<21,len:4}});var _7=ae((fmt,S7)=>{"use strict";Tt();Rt();Ct();S7.exports={extensions:["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","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","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"],mimeTypes:["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/vnd.wave","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","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/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","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"]}});var T7=ae((exports,module)=>{"use strict";Tt();Rt();Ct();var Token=E7(),strtok3=BC(),{stringToBytes,tarHeaderChecksumMatches,uint32SyncSafeToken}=x7(),supported=_7(),minimumBytes=4100;async function fromStream(n){let t=await strtok3.fromStream(n);try{return await fromTokenizer(t)}finally{await t.close()}}async function fromBuffer(n){if(!(n instanceof Uint8Array||n instanceof ArrayBuffer||Buffer.isBuffer(n)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof n}\``);let t=n instanceof Buffer?n:Buffer.from(n);if(!(t&&t.length>1))return;let e=strtok3.fromBuffer(t);return fromTokenizer(e)}function _check(n,t,e){e={offset:0,...e};for(let[r,i]of t.entries())if(e.mask){if(i!==(e.mask[r]&n[r+e.offset]))return!1}else if(i!==n[r+e.offset])return!1;return!0}async function fromTokenizer(n){try{return _fromTokenizer(n)}catch(t){if(!(t instanceof strtok3.EndOfStreamError))throw t}}async function _fromTokenizer(n){let t=Buffer.alloc(minimumBytes),e=12,r=(s,a)=>_check(t,s,a),i=(s,a)=>r(stringToBytes(s),a);if(n.fileInfo.size||(n.fileInfo.size=Number.MAX_SAFE_INTEGER),await n.peekBuffer(t,{length:e,mayBeLess:!0}),r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(r([37,33]))return await n.peekBuffer(t,{length:24,mayBeLess:!0}),i("PS-Adobe-",{offset:2})&&i(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(r([31,160])||r([31,157]))return{ext:"Z",mime:"application/x-compress"};if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(i("ID3")){await n.ignore(6);let s=await n.readToken(uint32SyncSafeToken);return n.position+s>n.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await n.ignore(s),fromTokenizer(n))}if(i("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((t[0]===67||t[0]===70)&&r([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(i("FLIF"))return{ext:"flif",mime:"image/flif"};if(i("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(i("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(i("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(i("FORM"))return{ext:"aif",mime:"audio/aiff"};if(i("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(r([80,75,3,4])){try{for(;n.position+30<n.fileInfo.size;){await n.readBuffer(t,{length:30});let s={compressedSize:t.readUInt32LE(18),uncompressedSize:t.readUInt32LE(22),filenameLength:t.readUInt16LE(26),extraFieldLength:t.readUInt16LE(28)};if(s.filename=await n.readToken(new Token.StringType(s.filenameLength,"utf-8")),await n.ignore(s.extraFieldLength),s.filename==="META-INF/mozilla.rsa")return{ext:"xpi",mime:"application/x-xpinstall"};if(s.filename.endsWith(".rels")||s.filename.endsWith(".xml"))switch(s.filename.split("/")[0]){case"_rels":break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};default:break}if(s.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(s.filename.startsWith("3D/")&&s.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if(s.filename==="mimetype"&&s.compressedSize===s.uncompressedSize)switch(await n.readToken(new Token.StringType(s.compressedSize,"utf-8"))){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(s.compressedSize===0){let a=-1;for(;a<0&&n.position<n.fileInfo.size;)await n.peekBuffer(t,{mayBeLess:!0}),a=t.indexOf("504B0304",0,"hex"),await n.ignore(a>=0?a:t.length)}else await n.ignore(s.compressedSize)}}catch(s){if(!(s instanceof strtok3.EndOfStreamError))throw s}return{ext:"zip",mime:"application/zip"}}if(i("OggS")){await n.ignore(28);let s=Buffer.alloc(8);return await n.readBuffer(s),_check(s,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:_check(s,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:_check(s,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:_check(s,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:_check(s,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:_check(s,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(r([80,75])&&(t[2]===3||t[2]===5||t[2]===7)&&(t[3]===4||t[3]===6||t[3]===8))return{ext:"zip",mime:"application/zip"};if(i("ftyp",{offset:4})&&(t[8]&96)!==0){let s=t.toString("binary",8,12).replace("\0"," ").trim();switch(s){case"avif":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 s.startsWith("3g")?s.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(i("MThd"))return{ext:"mid",mime:"audio/midi"};if(i("wOFF")&&(r([0,1,0,0],{offset:4})||i("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(i("wOF2")&&(r([0,1,0,0],{offset:4})||i("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(r([212,195,178,161])||r([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(i("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(i("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(i("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(r([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(i("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(i("%PDF")){await n.ignore(1350);let s=10*1024*1024,a=Buffer.alloc(Math.min(s,n.fileInfo.size));return await n.readBuffer(a,{mayBeLess:!0}),a.includes(Buffer.from("AIPrivateData"))?{ext:"ai",mime:"application/postscript"}:{ext:"pdf",mime:"application/pdf"}}if(r([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(r([73,73,42,0]))return i("CR",{offset:8})?{ext:"cr2",mime:"image/x-canon-cr2"}:r([28,0,254,0],{offset:8})||r([31,0,11,0],{offset:8})?{ext:"nef",mime:"image/x-nikon-nef"}:r([8,0,0,0],{offset:4})&&(r([45,0,254,0],{offset:8})||r([39,0,254,0],{offset:8}))?{ext:"dng",mime:"image/x-adobe-dng"}:(t=Buffer.alloc(24),await n.peekBuffer(t),(r([16,251,134,1],{offset:4})||r([8,0,0,0],{offset:4}))&&r([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9})?{ext:"arw",mime:"image/x-sony-arw"}:{ext:"tif",mime:"image/tiff"});if(r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(i("MAC "))return{ext:"ape",mime:"audio/ape"};if(r([26,69,223,163])){async function s(){let h=await n.peekNumber(Token.UINT8),f=128,d=0;for(;(h&f)===0&&f!==0;)++d,f>>=1;let p=Buffer.alloc(d+1);return await n.readBuffer(p),p}async function a(){let h=await s(),f=await s();f[0]^=128>>f.length-1;let d=Math.min(6,f.length);return{id:h.readUIntBE(0,h.length),len:f.readUIntBE(f.length-d,d)}}async function o(h,f){for(;f>0;){let d=await a();if(d.id===17026)return n.readToken(new Token.StringType(d.len,"utf-8"));await n.ignore(d.len),--f}}let c=await a();switch(await o(1,c.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(r([82,73,70,70])){if(r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(r([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(r([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(i("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(r([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(i("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(i("MSCF")||i("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(r([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(r([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(r([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(r([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(i("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(i("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(r([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(i("IMPM"))return{ext:"it",mime:"audio/x-it"};if(i("-lh0-",{offset:2})||i("-lh1-",{offset:2})||i("-lh2-",{offset:2})||i("-lh3-",{offset:2})||i("-lh4-",{offset:2})||i("-lh5-",{offset:2})||i("-lh6-",{offset:2})||i("-lh7-",{offset:2})||i("-lzs-",{offset:2})||i("-lz4-",{offset:2})||i("-lz5-",{offset:2})||i("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(r([0,0,1,186])){if(r([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(r([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(i("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(r([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(i("<?xml "))return{ext:"xml",mime:"application/xml"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([82,97,114,33,26,7])&&(t[6]===0||t[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(i("solid "))return{ext:"stl",mime:"model/stl"};if(i("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(i("!<arch>"))return await n.ignore(8),await n.readToken(new Token.StringType(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(r([137,80,78,71,13,10,26,10])){await n.ignore(8);async function s(){return{length:await n.readToken(Token.INT32_BE),type:await n.readToken(new Token.StringType(4,"binary"))}}do{let a=await s();if(a.length<0)return;switch(a.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await n.ignore(a.length+4)}}while(n.position+8<n.fileInfo.size);return{ext:"png",mime:"image/png"}}if(r([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(r([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(r([102,114,101,101],{offset:4})||r([109,100,97,116],{offset:4})||r([109,111,111,118],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(r([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(i("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(r([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(r([48,38,178,117,142,102,207,17,166,217])){async function s(){let a=Buffer.alloc(16);return await n.readBuffer(a),{id:a,size:Number(await n.readToken(Token.UINT64_LE))}}for(await n.ignore(30);n.position+24<n.fileInfo.size;){let a=await s(),o=a.size-24;if(_check(a.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let c=Buffer.alloc(16);if(o-=await n.readBuffer(c),_check(c,[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(_check(c,[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 n.ignore(o)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(r([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((r([126,16,4])||r([126,24,4]))&&r([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(r([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(r([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await n.ignore(20),await n.readToken(new Token.StringType(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(r([255,10])||r([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(r([0,0,1,186])||r([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(r([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(r([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(r([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(r([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await n.peekBuffer(t,{length:Math.min(256,n.fileInfo.size),mayBeLess:!0}),i("BEGIN:")){if(i("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(i("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(i("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(i("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(i("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(r([4,0,0,0])&&t.length>=16){let s=t.readUInt32LE(12);if(s>12&&t.length>=s+16)try{let a=t.slice(16,s+16).toString();if(JSON.parse(a).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(r([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(i("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196})))return{ext:"mts",mime:"video/mp2t"};if(r([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(r([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(r([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(r([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(r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(r([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 n.peekBuffer(t,{length:Math.min(512,n.fileInfo.size),mayBeLess:!0}),tarHeaderChecksumMatches(t))return{ext:"tar",mime:"application/x-tar"};if(r([255,254,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]))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(i("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(t.length>=2&&r([255,224],{offset:0,mask:[255,224]})){if(r([16],{offset:1,mask:[22]}))return r([8],{offset:1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(r([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(r([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(r([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}var stream=readableStream=>new Promise((resolve,reject)=>{let stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",async()=>{let n=new stream.PassThrough,t;stream.pipeline?t=stream.pipeline(readableStream,n,()=>{}):t=readableStream.pipe(n);let e=readableStream.read(minimumBytes)||readableStream.read()||Buffer.alloc(0);try{let r=await fromBuffer(e);n.fileType=r}catch(r){reject(r)}resolve(t)})}),fileType={fromStream,fromTokenizer,fromBuffer,stream};Object.defineProperty(fileType,"extensions",{get(){return new Set(supported.extensions)}});Object.defineProperty(fileType,"mimeTypes",{get(){return new Set(supported.mimeTypes)}});module.exports=fileType});var R7=ae((vmt,C7)=>{"use strict";Tt();Rt();Ct();var Vit=w7(),HC=T7();async function Xit(n){let t=await Vit.fromFile(n);try{return await HC.fromTokenizer(t)}finally{await t.close()}}var zC={fromFile:Xit};Object.assign(zC,HC);Object.defineProperty(zC,"extensions",{get(){return HC.extensions}});Object.defineProperty(zC,"mimeTypes",{get(){return HC.mimeTypes}});C7.exports=zC});var NE=ae(K0=>{"use strict";Tt();Rt();Ct();function qit(n,t,e){if(e===void 0&&(e=Array.prototype),n&&typeof e.find=="function")return e.find.call(n,t);for(var r=0;r<n.length;r++)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];if(t.call(void 0,i,r,n))return i}}function ek(n,t){return t===void 0&&(t=Object),t&&typeof t.freeze=="function"?t.freeze(n):n}function Yit(n,t){if(n===null||typeof n!="object")throw new TypeError("target is not an object");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}var I7=ek({HTML:"text/html",isHTML:function(n){return n===I7.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),D7=ek({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(n){return n===D7.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});K0.assign=Yit;K0.find=qit;K0.freeze=ek;K0.MIME_TYPE=I7;K0.NAMESPACE=D7});var fk=ae(Bf=>{Tt();Rt();Ct();var B7=NE(),oc=B7.find,LE=B7.NAMESPACE;function Kit(n){return n!==""}function Zit(n){return n?n.split(/[\t\n\f\r ]+/).filter(Kit):[]}function Jit(n,t){return n.hasOwnProperty(t)||(n[t]=!0),n}function O7(n){if(!n)return[];var t=Zit(n);return Object.keys(t.reduce(Jit,{}))}function Qit(n){return function(t){return n&&n.indexOf(t)!==-1}}function ME(n,t){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}function qs(n,t){var e=n.prototype;if(!(e instanceof t)){let i=function(){};var r=i;i.prototype=t.prototype,i=new i,ME(e,i),n.prototype=e=i}e.constructor!=n&&(typeof n!="function"&&console.error("unknown Class:"+n),e.constructor=n)}var Ys={},pl=Ys.ELEMENT_NODE=1,J0=Ys.ATTRIBUTE_NODE=2,WC=Ys.TEXT_NODE=3,U7=Ys.CDATA_SECTION_NODE=4,j7=Ys.ENTITY_REFERENCE_NODE=5,tst=Ys.ENTITY_NODE=6,$7=Ys.PROCESSING_INSTRUCTION_NODE=7,H7=Ys.COMMENT_NODE=8,z7=Ys.DOCUMENT_NODE=9,W7=Ys.DOCUMENT_TYPE_NODE=10,Iu=Ys.DOCUMENT_FRAGMENT_NODE=11,est=Ys.NOTATION_NODE=12,is={},Ei={},Cmt=is.INDEX_SIZE_ERR=(Ei[1]="Index size error",1),Rmt=is.DOMSTRING_SIZE_ERR=(Ei[2]="DOMString size error",2),Xs=is.HIERARCHY_REQUEST_ERR=(Ei[3]="Hierarchy request error",3),Imt=is.WRONG_DOCUMENT_ERR=(Ei[4]="Wrong document",4),Dmt=is.INVALID_CHARACTER_ERR=(Ei[5]="Invalid character",5),Omt=is.NO_DATA_ALLOWED_ERR=(Ei[6]="No data allowed",6),Pmt=is.NO_MODIFICATION_ALLOWED_ERR=(Ei[7]="No modification allowed",7),G7=is.NOT_FOUND_ERR=(Ei[8]="Not found",8),Nmt=is.NOT_SUPPORTED_ERR=(Ei[9]="Not supported",9),P7=is.INUSE_ATTRIBUTE_ERR=(Ei[10]="Attribute in use",10),Lmt=is.INVALID_STATE_ERR=(Ei[11]="Invalid state",11),kmt=is.SYNTAX_ERR=(Ei[12]="Syntax error",12),Mmt=is.INVALID_MODIFICATION_ERR=(Ei[13]="Invalid modification",13),Fmt=is.NAMESPACE_ERR=(Ei[14]="Invalid namespace",14),Bmt=is.INVALID_ACCESS_ERR=(Ei[15]="Invalid access",15);function Hn(n,t){if(t instanceof Error)var e=t;else e=this,Error.call(this,Ei[n]),this.message=Ei[n],Error.captureStackTrace&&Error.captureStackTrace(this,Hn);return e.code=n,t&&(this.message=this.message+": "+t),e}Hn.prototype=Error.prototype;ME(is,Hn);function Ru(){}Ru.prototype={length:0,item:function(n){return n>=0&&n<this.length?this[n]:null},toString:function(n,t){for(var e=[],r=0;r<this.length;r++)Z0(this[r],e,n,t);return e.join("")},filter:function(n){return Array.prototype.filter.call(this,n)},indexOf:function(n){return Array.prototype.indexOf.call(this,n)}};function Q0(n,t){this._node=n,this._refresh=t,ik(this)}function ik(n){var t=n._node._inc||n._node.ownerDocument._inc;if(n._inc!==t){var e=n._refresh(n._node);if(nH(n,"length",e.length),!n.$$length||e.length<n.$$length)for(var r=e.length;r in n;r++)Object.prototype.hasOwnProperty.call(n,r)&&delete n[r];ME(e,n),n._inc=t}}Q0.prototype.item=function(n){return ik(this),this[n]||null};qs(Q0,Ru);function GC(){}function V7(n,t){for(var e=n.length;e--;)if(n[e]===t)return e}function N7(n,t,e,r){if(r?t[V7(t,r)]=e:t[t.length++]=e,n){e.ownerElement=n;var i=n.ownerDocument;i&&(r&&Y7(i,n,r),rst(i,n,e))}}function L7(n,t,e){var r=V7(t,e);if(r>=0){for(var i=t.length-1;r<i;)t[r]=t[++r];if(t.length=i,n){var s=n.ownerDocument;s&&(Y7(s,n,e),e.ownerElement=null)}}else throw new Hn(G7,new Error(n.tagName+"@"+e))}GC.prototype={length:0,item:Ru.prototype.item,getNamedItem:function(n){for(var t=this.length;t--;){var e=this[t];if(e.nodeName==n)return e}},setNamedItem:function(n){var t=n.ownerElement;if(t&&t!=this._ownerElement)throw new Hn(P7);var e=this.getNamedItem(n.nodeName);return N7(this._ownerElement,this,n,e),e},setNamedItemNS:function(n){var t=n.ownerElement,e;if(t&&t!=this._ownerElement)throw new Hn(P7);return e=this.getNamedItemNS(n.namespaceURI,n.localName),N7(this._ownerElement,this,n,e),e},removeNamedItem:function(n){var t=this.getNamedItem(n);return L7(this._ownerElement,this,t),t},removeNamedItemNS:function(n,t){var e=this.getNamedItemNS(n,t);return L7(this._ownerElement,this,e),e},getNamedItemNS:function(n,t){for(var e=this.length;e--;){var r=this[e];if(r.localName==t&&r.namespaceURI==n)return r}return null}};function X7(){}X7.prototype={hasFeature:function(n,t){return!0},createDocument:function(n,t,e){var r=new FE;if(r.implementation=this,r.childNodes=new Ru,r.doctype=e||null,e&&r.appendChild(e),t){var i=r.createElementNS(n,t);r.appendChild(i)}return r},createDocumentType:function(n,t,e){var r=new qC;return r.name=n,r.nodeName=n,r.publicId=t||"",r.systemId=e||"",r}};function vr(){}vr.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(n,t){return VC(this,n,t)},replaceChild:function(n,t){VC(this,n,t,Z7),t&&this.removeChild(t)},removeChild:function(n){return K7(this,n)},appendChild:function(n){return this.insertBefore(n,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(n){return nk(this.ownerDocument||this,this,n)},normalize:function(){for(var n=this.firstChild;n;){var t=n.nextSibling;t&&t.nodeType==WC&&n.nodeType==WC?(this.removeChild(t),n.appendData(t.data)):(n.normalize(),n=t)}},isSupported:function(n,t){return this.ownerDocument.implementation.hasFeature(n,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(n){for(var t=this;t;){var e=t._nsMap;if(e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&e[r]===n)return r}t=t.nodeType==J0?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(n){for(var t=this;t;){var e=t._nsMap;if(e&&Object.prototype.hasOwnProperty.call(e,n))return e[n];t=t.nodeType==J0?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(n){var t=this.lookupPrefix(n);return t==null}};function q7(n){return n=="<"&&"&lt;"||n==">"&&"&gt;"||n=="&"&&"&amp;"||n=='"'&&"&quot;"||"&#"+n.charCodeAt()+";"}ME(Ys,vr);ME(Ys,vr.prototype);function kE(n,t){if(t(n))return!0;if(n=n.firstChild)do if(kE(n,t))return!0;while(n=n.nextSibling)}function FE(){this.ownerDocument=this}function rst(n,t,e){n&&n._inc++;var r=e.namespaceURI;r===LE.XMLNS&&(t._nsMap[e.prefix?e.localName:""]=e.value)}function Y7(n,t,e,r){n&&n._inc++;var i=e.namespaceURI;i===LE.XMLNS&&delete t._nsMap[e.prefix?e.localName:""]}function sk(n,t,e){if(n&&n._inc){n._inc++;var r=t.childNodes;if(e)r[r.length++]=e;else{for(var i=t.firstChild,s=0;i;)r[s++]=i,i=i.nextSibling;r.length=s,delete r[r.length]}}}function K7(n,t){var e=t.previousSibling,r=t.nextSibling;return e?e.nextSibling=r:n.firstChild=r,r?r.previousSibling=e:n.lastChild=e,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,sk(n.ownerDocument,n),t}function nst(n){return n&&(n.nodeType===vr.DOCUMENT_NODE||n.nodeType===vr.DOCUMENT_FRAGMENT_NODE||n.nodeType===vr.ELEMENT_NODE)}function ist(n){return n&&(lc(n)||ak(n)||Du(n)||n.nodeType===vr.DOCUMENT_FRAGMENT_NODE||n.nodeType===vr.COMMENT_NODE||n.nodeType===vr.PROCESSING_INSTRUCTION_NODE)}function Du(n){return n&&n.nodeType===vr.DOCUMENT_TYPE_NODE}function lc(n){return n&&n.nodeType===vr.ELEMENT_NODE}function ak(n){return n&&n.nodeType===vr.TEXT_NODE}function k7(n,t){var e=n.childNodes||[];if(oc(e,lc)||Du(t))return!1;var r=oc(e,Du);return!(t&&r&&e.indexOf(r)>e.indexOf(t))}function M7(n,t){var e=n.childNodes||[];function r(s){return lc(s)&&s!==t}if(oc(e,r))return!1;var i=oc(e,Du);return!(t&&i&&e.indexOf(i)>e.indexOf(t))}function sst(n,t,e){if(!nst(n))throw new Hn(Xs,"Unexpected parent node type "+n.nodeType);if(e&&e.parentNode!==n)throw new Hn(G7,"child not in parent");if(!ist(t)||Du(t)&&n.nodeType!==vr.DOCUMENT_NODE)throw new Hn(Xs,"Unexpected node type "+t.nodeType+" for parent node type "+n.nodeType)}function ast(n,t,e){var r=n.childNodes||[],i=t.childNodes||[];if(t.nodeType===vr.DOCUMENT_FRAGMENT_NODE){var s=i.filter(lc);if(s.length>1||oc(i,ak))throw new Hn(Xs,"More than one element or text in fragment");if(s.length===1&&!k7(n,e))throw new Hn(Xs,"Element in fragment can not be inserted before doctype")}if(lc(t)&&!k7(n,e))throw new Hn(Xs,"Only one element can be added and only after doctype");if(Du(t)){if(oc(r,Du))throw new Hn(Xs,"Only one doctype is allowed");var a=oc(r,lc);if(e&&r.indexOf(a)<r.indexOf(e))throw new Hn(Xs,"Doctype can only be inserted before an element");if(!e&&a)throw new Hn(Xs,"Doctype can not be appended since element is present")}}function Z7(n,t,e){var r=n.childNodes||[],i=t.childNodes||[];if(t.nodeType===vr.DOCUMENT_FRAGMENT_NODE){var s=i.filter(lc);if(s.length>1||oc(i,ak))throw new Hn(Xs,"More than one element or text in fragment");if(s.length===1&&!M7(n,e))throw new Hn(Xs,"Element in fragment can not be inserted before doctype")}if(lc(t)&&!M7(n,e))throw new Hn(Xs,"Only one element can be added and only after doctype");if(Du(t)){let c=function(u){return Du(u)&&u!==e};var o=c;if(oc(r,c))throw new Hn(Xs,"Only one doctype is allowed");var a=oc(r,lc);if(e&&r.indexOf(a)<r.indexOf(e))throw new Hn(Xs,"Doctype can only be inserted before an element")}}function VC(n,t,e,r){sst(n,t,e),n.nodeType===vr.DOCUMENT_NODE&&(r||ast)(n,t,e);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===Iu){var s=t.firstChild;if(s==null)return t;var a=t.lastChild}else s=a=t;var o=e?e.previousSibling:n.lastChild;s.previousSibling=o,a.nextSibling=e,o?o.nextSibling=s:n.firstChild=s,e==null?n.lastChild=a:e.previousSibling=a;do s.parentNode=n;while(s!==a&&(s=s.nextSibling));return sk(n.ownerDocument||n,n),t.nodeType==Iu&&(t.firstChild=t.lastChild=null),t}function ost(n,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=n,t.previousSibling=n.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:n.firstChild=t,n.lastChild=t,sk(n.ownerDocument,n,t),t}FE.prototype={nodeName:"#document",nodeType:z7,doctype:null,documentElement:null,_inc:1,insertBefore:function(n,t){if(n.nodeType==Iu){for(var e=n.firstChild;e;){var r=e.nextSibling;this.insertBefore(e,t),e=r}return n}return VC(this,n,t),n.ownerDocument=this,this.documentElement===null&&n.nodeType===pl&&(this.documentElement=n),n},removeChild:function(n){return this.documentElement==n&&(this.documentElement=null),K7(this,n)},replaceChild:function(n,t){VC(this,n,t,Z7),n.ownerDocument=this,t&&this.removeChild(t),lc(n)&&(this.documentElement=n)},importNode:function(n,t){return rH(this,n,t)},getElementById:function(n){var t=null;return kE(this.documentElement,function(e){if(e.nodeType==pl&&e.getAttribute("id")==n)return t=e,!0}),t},getElementsByClassName:function(n){var t=O7(n);return new Q0(this,function(e){var r=[];return t.length>0&&kE(e.documentElement,function(i){if(i!==e&&i.nodeType===pl){var s=i.getAttribute("class");if(s){var a=n===s;if(!a){var o=O7(s);a=t.every(Qit(o))}a&&r.push(i)}}}),r})},createElement:function(n){var t=new cg;t.ownerDocument=this,t.nodeName=n,t.tagName=n,t.localName=n,t.childNodes=new Ru;var e=t.attributes=new GC;return e._ownerElement=t,t},createDocumentFragment:function(){var n=new YC;return n.ownerDocument=this,n.childNodes=new Ru,n},createTextNode:function(n){var t=new ok;return t.ownerDocument=this,t.appendData(n),t},createComment:function(n){var t=new lk;return t.ownerDocument=this,t.appendData(n),t},createCDATASection:function(n){var t=new ck;return t.ownerDocument=this,t.appendData(n),t},createProcessingInstruction:function(n,t){var e=new hk;return e.ownerDocument=this,e.tagName=e.nodeName=e.target=n,e.nodeValue=e.data=t,e},createAttribute:function(n){var t=new XC;return t.ownerDocument=this,t.name=n,t.nodeName=n,t.localName=n,t.specified=!0,t},createEntityReference:function(n){var t=new uk;return t.ownerDocument=this,t.nodeName=n,t},createElementNS:function(n,t){var e=new cg,r=t.split(":"),i=e.attributes=new GC;return e.childNodes=new Ru,e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.namespaceURI=n,r.length==2?(e.prefix=r[0],e.localName=r[1]):e.localName=t,i._ownerElement=e,e},createAttributeNS:function(n,t){var e=new XC,r=t.split(":");return e.ownerDocument=this,e.nodeName=t,e.name=t,e.namespaceURI=n,e.specified=!0,r.length==2?(e.prefix=r[0],e.localName=r[1]):e.localName=t,e}};qs(FE,vr);function cg(){this._nsMap={}}cg.prototype={nodeType:pl,hasAttribute:function(n){return this.getAttributeNode(n)!=null},getAttribute:function(n){var t=this.getAttributeNode(n);return t&&t.value||""},getAttributeNode:function(n){return this.attributes.getNamedItem(n)},setAttribute:function(n,t){var e=this.ownerDocument.createAttribute(n);e.value=e.nodeValue=""+t,this.setAttributeNode(e)},removeAttribute:function(n){var t=this.getAttributeNode(n);t&&this.removeAttributeNode(t)},appendChild:function(n){return n.nodeType===Iu?this.insertBefore(n,null):ost(this,n)},setAttributeNode:function(n){return this.attributes.setNamedItem(n)},setAttributeNodeNS:function(n){return this.attributes.setNamedItemNS(n)},removeAttributeNode:function(n){return this.attributes.removeNamedItem(n.nodeName)},removeAttributeNS:function(n,t){var e=this.getAttributeNodeNS(n,t);e&&this.removeAttributeNode(e)},hasAttributeNS:function(n,t){return this.getAttributeNodeNS(n,t)!=null},getAttributeNS:function(n,t){var e=this.getAttributeNodeNS(n,t);return e&&e.value||""},setAttributeNS:function(n,t,e){var r=this.ownerDocument.createAttributeNS(n,t);r.value=r.nodeValue=""+e,this.setAttributeNode(r)},getAttributeNodeNS:function(n,t){return this.attributes.getNamedItemNS(n,t)},getElementsByTagName:function(n){return new Q0(this,function(t){var e=[];return kE(t,function(r){r!==t&&r.nodeType==pl&&(n==="*"||r.tagName==n)&&e.push(r)}),e})},getElementsByTagNameNS:function(n,t){return new Q0(this,function(e){var r=[];return kE(e,function(i){i!==e&&i.nodeType===pl&&(n==="*"||i.namespaceURI===n)&&(t==="*"||i.localName==t)&&r.push(i)}),r})}};FE.prototype.getElementsByTagName=cg.prototype.getElementsByTagName;FE.prototype.getElementsByTagNameNS=cg.prototype.getElementsByTagNameNS;qs(cg,vr);function XC(){}XC.prototype.nodeType=J0;qs(XC,vr);function BE(){}BE.prototype={data:"",substringData:function(n,t){return this.data.substring(n,n+t)},appendData:function(n){n=this.data+n,this.nodeValue=this.data=n,this.length=n.length},insertData:function(n,t){this.replaceData(n,0,t)},appendChild:function(n){throw new Error(Ei[Xs])},deleteData:function(n,t){this.replaceData(n,t,"")},replaceData:function(n,t,e){var r=this.data.substring(0,n),i=this.data.substring(n+t);e=r+e+i,this.nodeValue=this.data=e,this.length=e.length}};qs(BE,vr);function ok(){}ok.prototype={nodeName:"#text",nodeType:WC,splitText:function(n){var t=this.data,e=t.substring(n);t=t.substring(0,n),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(e);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}};qs(ok,BE);function lk(){}lk.prototype={nodeName:"#comment",nodeType:H7};qs(lk,BE);function ck(){}ck.prototype={nodeName:"#cdata-section",nodeType:U7};qs(ck,BE);function qC(){}qC.prototype.nodeType=W7;qs(qC,vr);function J7(){}J7.prototype.nodeType=est;qs(J7,vr);function Q7(){}Q7.prototype.nodeType=tst;qs(Q7,vr);function uk(){}uk.prototype.nodeType=j7;qs(uk,vr);function YC(){}YC.prototype.nodeName="#document-fragment";YC.prototype.nodeType=Iu;qs(YC,vr);function hk(){}hk.prototype.nodeType=$7;qs(hk,vr);function tH(){}tH.prototype.serializeToString=function(n,t,e){return eH.call(n,t,e)};vr.prototype.toString=eH;function eH(n,t){var e=[],r=this.nodeType==9&&this.documentElement||this,i=r.prefix,s=r.namespaceURI;if(s&&i==null){var i=r.lookupPrefix(s);if(i==null)var a=[{namespace:s,prefix:null}]}return Z0(this,e,n,t,a),e.join("")}function F7(n,t,e){var r=n.prefix||"",i=n.namespaceURI;if(!i||r==="xml"&&i===LE.XML||i===LE.XMLNS)return!1;for(var s=e.length;s--;){var a=e[s];if(a.prefix===r)return a.namespace!==i}return!0}function rk(n,t,e){n.push(" ",t,'="',e.replace(/[<>&"\t\n\r]/g,q7),'"')}function Z0(n,t,e,r,i){if(i||(i=[]),r)if(n=r(n),n){if(typeof n=="string"){t.push(n);return}}else return;switch(n.nodeType){case pl:var s=n.attributes,a=s.length,m=n.firstChild,o=n.tagName;e=LE.isHTML(n.namespaceURI)||e;var c=o;if(!e&&!n.prefix&&n.namespaceURI){for(var u,h=0;h<s.length;h++)if(s.item(h).name==="xmlns"){u=s.item(h).value;break}if(!u)for(var f=i.length-1;f>=0;f--){var d=i[f];if(d.prefix===""&&d.namespace===n.namespaceURI){u=d.namespace;break}}if(u!==n.namespaceURI)for(var f=i.length-1;f>=0;f--){var d=i[f];if(d.namespace===n.namespaceURI){d.prefix&&(c=d.prefix+":"+o);break}}}t.push("<",c);for(var p=0;p<a;p++){var g=s.item(p);g.prefix=="xmlns"?i.push({prefix:g.localName,namespace:g.value}):g.nodeName=="xmlns"&&i.push({prefix:"",namespace:g.value})}for(var p=0;p<a;p++){var g=s.item(p);if(F7(g,e,i)){var y=g.prefix||"",b=g.namespaceURI;rk(t,y?"xmlns:"+y:"xmlns",b),i.push({prefix:y,namespace:b})}Z0(g,t,e,r,i)}if(o===c&&F7(n,e,i)){var y=n.prefix||"",b=n.namespaceURI;rk(t,y?"xmlns:"+y:"xmlns",b),i.push({prefix:y,namespace:b})}if(m||e&&!/^(?:meta|link|img|br|hr|input)$/i.test(o)){if(t.push(">"),e&&/^script$/i.test(o))for(;m;)m.data?t.push(m.data):Z0(m,t,e,r,i.slice()),m=m.nextSibling;else for(;m;)Z0(m,t,e,r,i.slice()),m=m.nextSibling;t.push("</",c,">")}else t.push("/>");return;case z7:case Iu:for(var m=n.firstChild;m;)Z0(m,t,e,r,i.slice()),m=m.nextSibling;return;case J0:return rk(t,n.name,n.value);case WC:return t.push(n.data.replace(/[<&>]/g,q7));case U7:return t.push("<![CDATA[",n.data,"]]>");case H7:return t.push("<!--",n.data,"-->");case W7:var w=n.publicId,A=n.systemId;if(t.push("<!DOCTYPE ",n.name),w)t.push(" PUBLIC ",w),A&&A!="."&&t.push(" ",A),t.push(">");else if(A&&A!=".")t.push(" SYSTEM ",A,">");else{var _=n.internalSubset;_&&t.push(" [",_,"]"),t.push(">")}return;case $7:return t.push("<?",n.target," ",n.data,"?>");case j7:return t.push("&",n.nodeName,";");default:t.push("??",n.nodeName)}}function rH(n,t,e){var r;switch(t.nodeType){case pl:r=t.cloneNode(!1),r.ownerDocument=n;case Iu:break;case J0:e=!0;break}if(r||(r=t.cloneNode(!1)),r.ownerDocument=n,r.parentNode=null,e)for(var i=t.firstChild;i;)r.appendChild(rH(n,i,e)),i=i.nextSibling;return r}function nk(n,t,e){var r=new t.constructor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s!="object"&&s!=r[i]&&(r[i]=s)}switch(t.childNodes&&(r.childNodes=new Ru),r.ownerDocument=n,r.nodeType){case pl:var a=t.attributes,o=r.attributes=new GC,c=a.length;o._ownerElement=r;for(var u=0;u<c;u++)r.setAttributeNode(nk(n,a.item(u),!0));break;case J0:e=!0}if(e)for(var h=t.firstChild;h;)r.appendChild(nk(n,h,e)),h=h.nextSibling;return r}function nH(n,t,e){n[t]=e}try{if(Object.defineProperty){let n=function(t){switch(t.nodeType){case pl:case Iu:var e=[];for(t=t.firstChild;t;)t.nodeType!==7&&t.nodeType!==8&&e.push(n(t)),t=t.nextSibling;return e.join("");default:return t.nodeValue}};lst=n,Object.defineProperty(Q0.prototype,"length",{get:function(){return ik(this),this.$$length}}),Object.defineProperty(vr.prototype,"textContent",{get:function(){return n(this)},set:function(t){switch(this.nodeType){case pl:case Iu:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),nH=function(t,e,r){t["$$"+e]=r}}}catch{}var lst;Bf.DocumentType=qC;Bf.DOMException=Hn;Bf.DOMImplementation=X7;Bf.Element=cg;Bf.Node=vr;Bf.NodeList=Ru;Bf.XMLSerializer=tH});var sH=ae(UE=>{"use strict";Tt();Rt();Ct();var iH=NE().freeze;UE.XML_ENTITIES=iH({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});UE.HTML_ENTITIES=iH({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"});UE.entityMap=UE.HTML_ENTITIES});var dH=ae(pk=>{Tt();Rt();Ct();var zE=NE().NAMESPACE,dk=/[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]/,aH=new RegExp("[\\-\\.0-9"+dk.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),oH=new RegExp("^"+dk.source+aH.source+"*(?::"+dk.source+aH.source+"*)?$"),jE=0,Uf=1,tb=2,$E=3,eb=4,rb=5,HE=6,KC=7;function nb(n,t){this.message=n,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,nb)}nb.prototype=new Error;nb.prototype.name=nb.name;function uH(){}uH.prototype={parse:function(n,t,e){var r=this.domBuilder;r.startDocument(),hH(t,t={}),cst(n,t,e,r,this.errorHandler),r.endDocument()}};function cst(n,t,e,r,i){function s(J){if(J>65535){J-=65536;var N=55296+(J>>10),D=56320+(J&1023);return String.fromCharCode(N,D)}else return String.fromCharCode(J)}function a(J){var N=J.slice(1,-1);return Object.hasOwnProperty.call(e,N)?e[N]:N.charAt(0)==="#"?s(parseInt(N.substr(1).replace("x","0x"))):(i.error("entity not found:"+J),J)}function o(J){if(J>y){var N=n.substring(y,J).replace(/&#?\w+;/g,a);d&&c(y),r.characters(N,0,J-y),y=J}}function c(J,N){for(;J>=h&&(N=f.exec(n));)u=N.index,h=u+N[0].length,d.lineNumber++;d.columnNumber=J-u+1}for(var u=0,h=0,f=/.*(?:\r\n?|\n)|.*$/g,d=r.locator,p=[{currentNSMap:t}],g={},y=0;;){try{var b=n.indexOf("<",y);if(b<0){if(!n.substr(y).match(/^\s*$/)){var m=r.doc,w=m.createTextNode(n.substr(y));m.appendChild(w),r.currentElement=w}return}switch(b>y&&o(b),n.charAt(b+1)){case"/":var Y=n.indexOf(">",b+3),A=n.substring(b+2,Y).replace(/[ \t\n\r]+$/g,""),_=p.pop();Y<0?(A=n.substring(b+2).replace(/[\s<].*/,""),i.error("end tag name: "+A+" is not complete:"+_.tagName),Y=b+1+A.length):A.match(/\s</)&&(A=A.replace(/[\s<].*/,""),i.error("end tag name: "+A+" maybe not complete"),Y=b+1+A.length);var S=_.localNSMap,I=_.tagName==A,C=I||_.tagName&&_.tagName.toLowerCase()==A.toLowerCase();if(C){if(r.endElement(_.uri,_.localName,A),S)for(var M in S)Object.prototype.hasOwnProperty.call(S,M)&&r.endPrefixMapping(M);I||i.fatalError("end tag name: "+A+" is not match the current start tagName:"+_.tagName)}else p.push(_);Y++;break;case"?":d&&c(b),Y=pst(n,b,r);break;case"!":d&&c(b),Y=dst(n,b,r,i);break;default:d&&c(b);var z=new fH,G=p[p.length-1].currentNSMap,Y=ust(n,b,z,G,a,i),L=z.length;if(!z.closed&&fst(n,Y,z.tagName,g)&&(z.closed=!0,e.nbsp||i.warning("unclosed xml attribute")),d&&L){for(var j=lH(d,{}),q=0;q<L;q++){var nt=z[q];c(nt.offset),nt.locator=lH(d,{})}r.locator=j,cH(z,r,G)&&p.push(z),r.locator=d}else cH(z,r,G)&&p.push(z);zE.isHTML(z.uri)&&!z.closed?Y=hst(n,Y,z.tagName,a,r):Y++}}catch(J){if(J instanceof nb)throw J;i.error("element parse error: "+J),Y=-1}Y>y?y=Y:o(Math.max(b,y)+1)}}function lH(n,t){return t.lineNumber=n.lineNumber,t.columnNumber=n.columnNumber,t}function ust(n,t,e,r,i,s){function a(p,g,y){e.attributeNames.hasOwnProperty(p)&&s.fatalError("Attribute "+p+" redefined"),e.addValue(p,g.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,i),y)}for(var o,c,u=++t,h=jE;;){var f=n.charAt(u);switch(f){case"=":if(h===Uf)o=n.slice(t,u),h=$E;else if(h===tb)h=$E;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(h===$E||h===Uf)if(h===Uf&&(s.warning('attribute value must after "="'),o=n.slice(t,u)),t=u+1,u=n.indexOf(f,t),u>0)c=n.slice(t,u),a(o,c,t-1),h=rb;else throw new Error("attribute value no end '"+f+"' match");else if(h==eb)c=n.slice(t,u),a(o,c,t),s.warning('attribute "'+o+'" missed start quot('+f+")!!"),t=u+1,h=rb;else throw new Error('attribute value must after "="');break;case"/":switch(h){case jE:e.setTagName(n.slice(t,u));case rb:case HE:case KC:h=KC,e.closed=!0;case eb:case Uf:break;case tb:e.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),h==jE&&e.setTagName(n.slice(t,u)),u;case">":switch(h){case jE:e.setTagName(n.slice(t,u));case rb:case HE:case KC:break;case eb:case Uf:c=n.slice(t,u),c.slice(-1)==="/"&&(e.closed=!0,c=c.slice(0,-1));case tb:h===tb&&(c=o),h==eb?(s.warning('attribute "'+c+'" missed quot(")!'),a(o,c,t)):((!zE.isHTML(r[""])||!c.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),a(c,c,t));break;case $E:throw new Error("attribute value missed!!")}return u;case"\x80":f=" ";default:if(f<=" ")switch(h){case jE:e.setTagName(n.slice(t,u)),h=HE;break;case Uf:o=n.slice(t,u),h=tb;break;case eb:var c=n.slice(t,u);s.warning('attribute "'+c+'" missed quot(")!!'),a(o,c,t);case rb:h=HE;break}else switch(h){case tb:var d=e.tagName;(!zE.isHTML(r[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,t),t=u,h=Uf;break;case rb:s.warning('attribute space is required"'+o+'"!!');case HE:h=Uf,t=u;break;case $E:h=eb,t=u;break;case KC:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function cH(n,t,e){for(var r=n.tagName,i=null,f=n.length;f--;){var s=n[f],a=s.qName,o=s.value,d=a.indexOf(":");if(d>0)var c=s.prefix=a.slice(0,d),u=a.slice(d+1),h=c==="xmlns"&&u;else u=a,c=null,h=a==="xmlns"&&"";s.localName=u,h!==!1&&(i==null&&(i={},hH(e,e={})),e[h]=i[h]=o,s.uri=zE.XMLNS,t.startPrefixMapping(h,o))}for(var f=n.length;f--;){s=n[f];var c=s.prefix;c&&(c==="xml"&&(s.uri=zE.XML),c!=="xmlns"&&(s.uri=e[c||""]))}var d=r.indexOf(":");d>0?(c=n.prefix=r.slice(0,d),u=n.localName=r.slice(d+1)):(c=null,u=n.localName=r);var p=n.uri=e[c||""];if(t.startElement(p,u,r,n),n.closed){if(t.endElement(p,u,r),i)for(c in i)Object.prototype.hasOwnProperty.call(i,c)&&t.endPrefixMapping(c)}else return n.currentNSMap=e,n.localNSMap=i,!0}function hst(n,t,e,r,i){if(/^(?:script|textarea)$/i.test(e)){var s=n.indexOf("</"+e+">",t),a=n.substring(t+1,s);if(/[&<]/.test(a))return/^script$/i.test(e)?(i.characters(a,0,a.length),s):(a=a.replace(/&#?\w+;/g,r),i.characters(a,0,a.length),s)}return t+1}function fst(n,t,e,r){var i=r[e];return i==null&&(i=n.lastIndexOf("</"+e+">"),i<t&&(i=n.lastIndexOf("</"+e)),r[e]=i),i<t}function hH(n,t){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}function dst(n,t,e,r){var i=n.charAt(t+2);switch(i){case"-":if(n.charAt(t+3)==="-"){var s=n.indexOf("-->",t+4);return s>t?(e.comment(n,t+4,s-t-4),s+3):(r.error("Unclosed comment"),-1)}else return-1;default:if(n.substr(t+3,6)=="CDATA["){var s=n.indexOf("]]>",t+9);return e.startCDATA(),e.characters(n,t+9,s-t-9),e.endCDATA(),s+3}var a=gst(n,t),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var c=a[1][0],u=!1,h=!1;o>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],h=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(h=a[3][0]));var f=a[o-1];return e.startDTD(c,u,h),e.endDTD(),f.index+f[0].length}}return-1}function pst(n,t,e){var r=n.indexOf("?>",t);if(r){var i=n.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(i){var s=i[0].length;return e.processingInstruction(i[1],i[2]),r+2}else return-1}return-1}function fH(){this.attributeNames={}}fH.prototype={setTagName:function(n){if(!oH.test(n))throw new Error("invalid tagName:"+n);this.tagName=n},addValue:function(n,t,e){if(!oH.test(n))throw new Error("invalid attribute:"+n);this.attributeNames[n]=this.length,this[this.length++]={qName:n,value:t,offset:e}},length:0,getLocalName:function(n){return this[n].localName},getLocator:function(n){return this[n].locator},getQName:function(n){return this[n].qName},getURI:function(n){return this[n].uri},getValue:function(n){return this[n].value}};function gst(n,t){var e,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(n);e=i.exec(n);)if(r.push(e),e[1])return r}pk.XMLReader=uH;pk.ParseError=nb});var wH=ae(JC=>{Tt();Rt();Ct();var mst=NE(),yst=fk(),pH=sH(),yH=dH(),bst=yst.DOMImplementation,gH=mst.NAMESPACE,vst=yH.ParseError,wst=yH.XMLReader;function bH(n){return n.replace(/\r[\n\u0085]/g,`
81
+ `).replace(/[\r\u0085\u2028]/g,`
82
+ `)}function vH(n){this.options=n||{locator:{}}}vH.prototype.parseFromString=function(n,t){var e=this.options,r=new wst,i=e.domBuilder||new WE,s=e.errorHandler,a=e.locator,o=e.xmlns||{},c=/\/x?html?$/.test(t),u=c?pH.HTML_ENTITIES:pH.XML_ENTITIES;a&&i.setDocumentLocator(a),r.errorHandler=Ast(s,i,a),r.domBuilder=e.domBuilder||i,c&&(o[""]=gH.HTML),o.xml=o.xml||gH.XML;var h=e.normalizeLineEndings||bH;return n&&typeof n=="string"?r.parse(h(n),o,u):r.errorHandler.error("invalid doc source"),i.doc};function Ast(n,t,e){if(!n){if(t instanceof WE)return t;n=t}var r={},i=n instanceof Function;e=e||{};function s(a){var o=n[a];!o&&i&&(o=n.length==2?function(c){n(a,c)}:n),r[a]=o&&function(c){o("[xmldom "+a+"] "+c+gk(e))}||function(){}}return s("warning"),s("error"),s("fatalError"),r}function WE(){this.cdata=!1}function ib(n,t){t.lineNumber=n.lineNumber,t.columnNumber=n.columnNumber}WE.prototype={startDocument:function(){this.doc=new bst().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(n,t,e,r){var i=this.doc,s=i.createElementNS(n,e||t),a=r.length;ZC(this,s),this.currentElement=s,this.locator&&ib(this.locator,s);for(var o=0;o<a;o++){var n=r.getURI(o),c=r.getValue(o),e=r.getQName(o),u=i.createAttributeNS(n,e);this.locator&&ib(r.getLocator(o),u),u.value=u.nodeValue=c,s.setAttributeNode(u)}},endElement:function(n,t,e){var r=this.currentElement,i=r.tagName;this.currentElement=r.parentNode},startPrefixMapping:function(n,t){},endPrefixMapping:function(n){},processingInstruction:function(n,t){var e=this.doc.createProcessingInstruction(n,t);this.locator&&ib(this.locator,e),ZC(this,e)},ignorableWhitespace:function(n,t,e){},characters:function(n,t,e){if(n=mH.apply(this,arguments),n){if(this.cdata)var r=this.doc.createCDATASection(n);else var r=this.doc.createTextNode(n);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(n)&&this.doc.appendChild(r),this.locator&&ib(this.locator,r)}},skippedEntity:function(n){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(n){(this.locator=n)&&(n.lineNumber=0)},comment:function(n,t,e){n=mH.apply(this,arguments);var r=this.doc.createComment(n);this.locator&&ib(this.locator,r),ZC(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(n,t,e){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(n,t,e);this.locator&&ib(this.locator,i),ZC(this,i),this.doc.doctype=i}},warning:function(n){console.warn("[xmldom warning] "+n,gk(this.locator))},error:function(n){console.error("[xmldom error] "+n,gk(this.locator))},fatalError:function(n){throw new vst(n,this.locator)}};function gk(n){if(n)return`
83
+ @`+(n.systemId||"")+"#[line:"+n.lineNumber+",col:"+n.columnNumber+"]"}function mH(n,t,e){return typeof n=="string"?n.substr(t,e):n.length>=t+e||t?new java.lang.String(n,t,e)+"":n}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(n){WE.prototype[n]=function(){return null}});function ZC(n,t){n.currentElement?n.currentElement.appendChild(t):n.doc.appendChild(t)}JC.__DOMHandler=WE;JC.normalizeLineEndings=bH;JC.DOMParser=vH});var tR=ae(QC=>{Tt();Rt();Ct();var AH=fk();QC.DOMImplementation=AH.DOMImplementation;QC.XMLSerializer=AH.XMLSerializer;QC.DOMParser=wH().DOMParser});var _H=ae((Eyt,yk)=>{Tt();Rt();Ct();var mk=(function(n){"use strict";var t=Object.prototype,e=t.hasOwnProperty,r=Object.defineProperty||function(N,D,F){N[D]=F.value},i,s=typeof Symbol=="function"?Symbol:{},a=s.iterator||"@@iterator",o=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function u(N,D,F){return Object.defineProperty(N,D,{value:F,enumerable:!0,configurable:!0,writable:!0}),N[D]}try{u({},"")}catch{u=function(D,F,P){return D[F]=P}}function h(N,D,F,P){var V=D&&D.prototype instanceof m?D:m,$=Object.create(V.prototype),H=new q(P||[]);return r($,"_invoke",{value:G(N,F,H)}),$}n.wrap=h;function f(N,D,F){try{return{type:"normal",arg:N.call(D,F)}}catch(P){return{type:"throw",arg:P}}}var d="suspendedStart",p="suspendedYield",g="executing",y="completed",b={};function m(){}function w(){}function A(){}var _={};u(_,a,function(){return this});var S=Object.getPrototypeOf,I=S&&S(S(nt([])));I&&I!==t&&e.call(I,a)&&(_=I);var C=A.prototype=m.prototype=Object.create(_);w.prototype=A,r(C,"constructor",{value:A,configurable:!0}),r(A,"constructor",{value:w,configurable:!0}),w.displayName=u(A,c,"GeneratorFunction");function M(N){["next","throw","return"].forEach(function(D){u(N,D,function(F){return this._invoke(D,F)})})}n.isGeneratorFunction=function(N){var D=typeof N=="function"&&N.constructor;return D?D===w||(D.displayName||D.name)==="GeneratorFunction":!1},n.mark=function(N){return Object.setPrototypeOf?Object.setPrototypeOf(N,A):(N.__proto__=A,u(N,c,"GeneratorFunction")),N.prototype=Object.create(C),N},n.awrap=function(N){return{__await:N}};function z(N,D){function F($,H,rt,lt){var ft=f(N[$],N,H);if(ft.type==="throw")lt(ft.arg);else{var K=ft.arg,X=K.value;return X&&typeof X=="object"&&e.call(X,"__await")?D.resolve(X.__await).then(function(st){F("next",st,rt,lt)},function(st){F("throw",st,rt,lt)}):D.resolve(X).then(function(st){K.value=st,rt(K)},function(st){return F("throw",st,rt,lt)})}}var P;function V($,H){function rt(){return new D(function(lt,ft){F($,H,lt,ft)})}return P=P?P.then(rt,rt):rt()}r(this,"_invoke",{value:V})}M(z.prototype),u(z.prototype,o,function(){return this}),n.AsyncIterator=z,n.async=function(N,D,F,P,V){V===void 0&&(V=Promise);var $=new z(h(N,D,F,P),V);return n.isGeneratorFunction(D)?$:$.next().then(function(H){return H.done?H.value:$.next()})};function G(N,D,F){var P=d;return function($,H){if(P===g)throw new Error("Generator is already running");if(P===y){if($==="throw")throw H;return J()}for(F.method=$,F.arg=H;;){var rt=F.delegate;if(rt){var lt=Y(rt,F);if(lt){if(lt===b)continue;return lt}}if(F.method==="next")F.sent=F._sent=F.arg;else if(F.method==="throw"){if(P===d)throw P=y,F.arg;F.dispatchException(F.arg)}else F.method==="return"&&F.abrupt("return",F.arg);P=g;var ft=f(N,D,F);if(ft.type==="normal"){if(P=F.done?y:p,ft.arg===b)continue;return{value:ft.arg,done:F.done}}else ft.type==="throw"&&(P=y,F.method="throw",F.arg=ft.arg)}}}function Y(N,D){var F=D.method,P=N.iterator[F];if(P===i)return D.delegate=null,F==="throw"&&N.iterator.return&&(D.method="return",D.arg=i,Y(N,D),D.method==="throw")||F!=="return"&&(D.method="throw",D.arg=new TypeError("The iterator does not provide a '"+F+"' method")),b;var V=f(P,N.iterator,D.arg);if(V.type==="throw")return D.method="throw",D.arg=V.arg,D.delegate=null,b;var $=V.arg;if(!$)return D.method="throw",D.arg=new TypeError("iterator result is not an object"),D.delegate=null,b;if($.done)D[N.resultName]=$.value,D.next=N.nextLoc,D.method!=="return"&&(D.method="next",D.arg=i);else return $;return D.delegate=null,b}M(C),u(C,c,"Generator"),u(C,a,function(){return this}),u(C,"toString",function(){return"[object Generator]"});function L(N){var D={tryLoc:N[0]};1 in N&&(D.catchLoc=N[1]),2 in N&&(D.finallyLoc=N[2],D.afterLoc=N[3]),this.tryEntries.push(D)}function j(N){var D=N.completion||{};D.type="normal",delete D.arg,N.completion=D}function q(N){this.tryEntries=[{tryLoc:"root"}],N.forEach(L,this),this.reset(!0)}n.keys=function(N){var D=Object(N),F=[];for(var P in D)F.push(P);return F.reverse(),function V(){for(;F.length;){var $=F.pop();if($ in D)return V.value=$,V.done=!1,V}return V.done=!0,V}};function nt(N){if(N){var D=N[a];if(D)return D.call(N);if(typeof N.next=="function")return N;if(!isNaN(N.length)){var F=-1,P=function V(){for(;++F<N.length;)if(e.call(N,F))return V.value=N[F],V.done=!1,V;return V.value=i,V.done=!0,V};return P.next=P}}return{next:J}}n.values=nt;function J(){return{value:i,done:!0}}return q.prototype={constructor:q,reset:function(N){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(j),!N)for(var D in this)D.charAt(0)==="t"&&e.call(this,D)&&!isNaN(+D.slice(1))&&(this[D]=i)},stop:function(){this.done=!0;var N=this.tryEntries[0],D=N.completion;if(D.type==="throw")throw D.arg;return this.rval},dispatchException:function(N){if(this.done)throw N;var D=this;function F(lt,ft){return $.type="throw",$.arg=N,D.next=lt,ft&&(D.method="next",D.arg=i),!!ft}for(var P=this.tryEntries.length-1;P>=0;--P){var V=this.tryEntries[P],$=V.completion;if(V.tryLoc==="root")return F("end");if(V.tryLoc<=this.prev){var H=e.call(V,"catchLoc"),rt=e.call(V,"finallyLoc");if(H&&rt){if(this.prev<V.catchLoc)return F(V.catchLoc,!0);if(this.prev<V.finallyLoc)return F(V.finallyLoc)}else if(H){if(this.prev<V.catchLoc)return F(V.catchLoc,!0)}else if(rt){if(this.prev<V.finallyLoc)return F(V.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(N,D){for(var F=this.tryEntries.length-1;F>=0;--F){var P=this.tryEntries[F];if(P.tryLoc<=this.prev&&e.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var V=P;break}}V&&(N==="break"||N==="continue")&&V.tryLoc<=D&&D<=V.finallyLoc&&(V=null);var $=V?V.completion:{};return $.type=N,$.arg=D,V?(this.method="next",this.next=V.finallyLoc,b):this.complete($)},complete:function(N,D){if(N.type==="throw")throw N.arg;return N.type==="break"||N.type==="continue"?this.next=N.arg:N.type==="return"?(this.rval=this.arg=N.arg,this.method="return",this.next="end"):N.type==="normal"&&D&&(this.next=D),b},finish:function(N){for(var D=this.tryEntries.length-1;D>=0;--D){var F=this.tryEntries[D];if(F.finallyLoc===N)return this.complete(F.completion,F.afterLoc),j(F),b}},catch:function(N){for(var D=this.tryEntries.length-1;D>=0;--D){var F=this.tryEntries[D];if(F.tryLoc===N){var P=F.completion;if(P.type==="throw"){var V=P.arg;j(F)}return V}}throw new Error("illegal catch attempt")},delegateYield:function(N,D,F){return this.delegate={iterator:nt(N),resultName:D,nextLoc:F},this.method==="next"&&(this.arg=i),b}},n})(typeof yk=="object"?yk.exports:{});try{regeneratorRuntime=mk}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=mk:Function("r","regeneratorRuntime = r")(mk)}});var eR=ae((Tyt,TH)=>{"use strict";Tt();Rt();Ct();TH.exports=(n,t)=>`${n}-${t}-${Math.random().toString(16).slice(3,8)}`});var bk=ae((Dyt,RH)=>{"use strict";Tt();Rt();Ct();var Cst=eR(),CH=0;RH.exports=({id:n,action:t,payload:e={}})=>{let r=n;return typeof r>"u"&&(r=Cst("Job",CH),CH+=1),{id:r,action:t,payload:e}}});var rR=ae(VE=>{"use strict";Tt();Rt();Ct();var vk=!1;VE.logging=vk;VE.setLogging=n=>{vk=n};VE.log=(...n)=>vk?console.log.apply(VE,n):null});var PH=ae((DH,OH)=>{"use strict";Tt();Rt();Ct();var Rst=bk(),{log:nR}=rR(),Ist=eR(),IH=0;OH.exports=()=>{let n=Ist("Scheduler",IH),t={},e={},r=[];IH+=1;let i=()=>r.length,s=()=>Object.keys(t).length,a=()=>{if(r.length!==0){let f=Object.keys(t);for(let d=0;d<f.length;d+=1)if(typeof e[f[d]]>"u"){r[0](t[f[d]]);break}}},o=(f,d)=>new Promise((p,g)=>{let y=Rst({action:f,payload:d});r.push(async b=>{r.shift(),e[b.id]=y;try{p(await b[f].apply(DH,[...d,y.id]))}catch(m){g(m)}finally{delete e[b.id],a()}}),nR(`[${n}]: Add ${y.id} to JobQueue`),nR(`[${n}]: JobQueue length=${r.length}`),a()});return{addWorker:f=>(t[f.id]=f,nR(`[${n}]: Add ${f.id}`),nR(`[${n}]: Number of workers=${s()}`),a(),f.id),addJob:async(f,...d)=>{if(s()===0)throw Error(`[${n}]: You need to have at least one worker before adding jobs`);return o(f,d)},terminate:async()=>{Object.keys(t).forEach(async f=>{await t[f].terminate()}),r=[]},getQueueLen:i,getNumWorkers:s}}});var LH=ae(($yt,NH)=>{"use strict";Tt();Rt();Ct();NH.exports=n=>{let t={};return typeof WorkerGlobalScope<"u"?t.type="webworker":typeof document=="object"?t.type="browser":typeof process=="object"&&typeof Up=="function"&&(t.type="node"),typeof n>"u"?t:t[n]}});var MH=ae((Vyt,kH)=>{"use strict";Tt();Rt();Ct();var Dst=LH()("type")==="browser",Ost=Dst?n=>new URL(n,window.location.href).href:n=>n;kH.exports=n=>{let t={...n};return["corePath","workerPath","langPath"].forEach(e=>{n[e]&&(t[e]=Ost(t[e]))}),t}});var wk=ae((Kyt,FH)=>{"use strict";Tt();Rt();Ct();FH.exports={TESSERACT_ONLY:0,LSTM_ONLY:1,TESSERACT_LSTM_COMBINED:2,DEFAULT:3}});var BH=ae((t0t,Pst)=>{Pst.exports={name:"tesseract.js",version:"6.0.1",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":"^6.0.0","wasm-feature-detect":"^1.2.11",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 jH=ae((e0t,UH)=>{"use strict";Tt();Rt();Ct();UH.exports={workerBlobURL:!0,logger:()=>{}}});var HH=ae((s0t,$H)=>{"use strict";Tt();Rt();Ct();var Nst=BH().version,Lst=jH();$H.exports={...Lst,workerPath:`https://cdn.jsdelivr.net/npm/tesseract.js@v${Nst}/dist/worker.min.js`}});var WH=ae((c0t,zH)=>{"use strict";Tt();Rt();Ct();zH.exports=({workerPath:n,workerBlobURL:t})=>{let e;if(Blob&&URL&&t){let r=new Blob([`importScripts("${n}");`],{type:"application/javascript"});e=new Worker(URL.createObjectURL(r))}else e=new Worker(n);return e}});var VH=ae((d0t,GH)=>{"use strict";Tt();Rt();Ct();GH.exports=n=>{n.terminate()}});var qH=ae((y0t,XH)=>{"use strict";Tt();Rt();Ct();XH.exports=(n,t)=>{n.onmessage=({data:e})=>{t(e)}}});var KH=ae((A0t,YH)=>{"use strict";Tt();Rt();Ct();YH.exports=async(n,t)=>{n.postMessage(t)}});var JH=ae((_0t,ZH)=>{"use strict";Tt();Rt();Ct();var Ak=n=>new Promise((t,e)=>{let r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=({target:{error:{code:i}}})=>{e(Error(`File could not be read! Code=${i}`))},r.readAsArrayBuffer(n)}),Ek=async n=>{let t=n;if(typeof n>"u")return"undefined";if(typeof n=="string")/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(n)?t=atob(n.split(",")[1]).split("").map(e=>e.charCodeAt(0)):t=await(await fetch(n)).arrayBuffer();else if(typeof HTMLElement<"u"&&n instanceof HTMLElement)n.tagName==="IMG"&&(t=await Ek(n.src)),n.tagName==="VIDEO"&&(t=await Ek(n.poster)),n.tagName==="CANVAS"&&await new Promise(e=>{n.toBlob(async r=>{t=await Ak(r),e()})});else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas){let e=await n.convertToBlob();t=await Ak(e)}else(n instanceof File||n instanceof Blob)&&(t=await Ak(n));return new Uint8Array(t)};ZH.exports=Ek});var tz=ae((I0t,QH)=>{"use strict";Tt();Rt();Ct();var kst=HH(),Mst=WH(),Fst=VH(),Bst=qH(),Ust=KH(),jst=JH();QH.exports={defaultOptions:kst,spawnWorker:Mst,terminateWorker:Fst,onMessage:Bst,send:Ust,loadImage:jst}});var xk=ae((N0t,iz)=>{"use strict";Tt();Rt();Ct();var $st=MH(),cc=bk(),{log:ez}=rR(),Hst=eR(),hg=wk(),{defaultOptions:zst,spawnWorker:Wst,terminateWorker:Gst,onMessage:Vst,loadImage:rz,send:Xst}=tz(),nz=0;iz.exports=async(n="eng",t=hg.LSTM_ONLY,e={},r={})=>{let i=Hst("Worker",nz),{logger:s,errorHandler:a,...o}=$st({...zst,...e}),c={},u=typeof n=="string"?n.split("+"):n,h=t,f=r,d=[hg.DEFAULT,hg.LSTM_ONLY].includes(t)&&!o.legacyCore,p,g,y=new Promise((N,D)=>{g=N,p=D}),b=N=>{p(N.message)},m=Wst(o);m.onerror=b,nz+=1;let w=({id:N,action:D,payload:F})=>new Promise((P,V)=>{ez(`[${i}]: Start ${N}, action=${D}`);let $=`${D}-${N}`;c[$]={resolve:P,reject:V},Xst(m,{workerId:i,jobId:N,action:D,payload:F})}),A=()=>console.warn("`load` is depreciated and should be removed from code (workers now come pre-loaded)"),_=N=>w(cc({id:N,action:"load",payload:{options:{lstmOnly:d,corePath:o.corePath,logging:o.logging}}})),S=(N,D,F)=>w(cc({id:F,action:"FS",payload:{method:"writeFile",args:[N,D]}})),I=(N,D)=>w(cc({id:D,action:"FS",payload:{method:"readFile",args:[N,{encoding:"utf8"}]}})),C=(N,D)=>w(cc({id:D,action:"FS",payload:{method:"unlink",args:[N]}})),M=(N,D,F)=>w(cc({id:F,action:"FS",payload:{method:N,args:D}})),z=(N,D)=>w(cc({id:D,action:"loadLanguage",payload:{langs:N,options:{langPath:o.langPath,dataPath:o.dataPath,cachePath:o.cachePath,cacheMethod:o.cacheMethod,gzip:o.gzip,lstmOnly:[hg.DEFAULT,hg.LSTM_ONLY].includes(h)&&!o.legacyLang}}})),G=(N,D,F,P)=>w(cc({id:P,action:"initialize",payload:{langs:N,oem:D,config:F}})),Y=(N="eng",D,F,P)=>{if(d&&[hg.TESSERACT_ONLY,hg.TESSERACT_LSTM_COMBINED].includes(D))throw Error("Legacy model requested but code missing.");let V=D||h;h=V;let $=F||f;f=$;let rt=(typeof N=="string"?N.split("+"):N).filter(lt=>!u.includes(lt));return u.push(...rt),rt.length>0?z(rt,P).then(()=>G(N,V,$,P)):G(N,V,$,P)},L=(N={},D)=>w(cc({id:D,action:"setParameters",payload:{params:N}})),j=async(N,D={},F={text:!0},P)=>w(cc({id:P,action:"recognize",payload:{image:await rz(N),options:D,output:F}})),q=async(N,D)=>{if(d)throw Error("`worker.detect` requires Legacy model, which was not loaded.");return w(cc({id:D,action:"detect",payload:{image:await rz(N)}}))},nt=async()=>(m!==null&&(Gst(m),m=null),Promise.resolve());Vst(m,({workerId:N,jobId:D,status:F,action:P,data:V})=>{let $=`${P}-${D}`;if(F==="resolve")ez(`[${N}]: Complete ${D}`),c[$].resolve({jobId:D,data:V}),delete c[$];else if(F==="reject")if(c[$].reject(V),delete c[$],P==="load"&&p(V),a)a(V);else throw Error(V);else F==="progress"&&s({...V,userJobId:D})});let J={id:i,worker:m,load:A,writeText:S,readText:I,removeFile:C,FS:M,reinitialize:Y,setParameters:L,recognize:j,detect:q,terminate:nt};return _().then(()=>z(n)).then(()=>G(n,t,r)).then(()=>g(J)).catch(()=>{}),y}});var oz=ae((F0t,az)=>{"use strict";Tt();Rt();Ct();var sz=xk(),qst=async(n,t,e)=>{let r=await sz(t,1,e);return r.recognize(n).finally(async()=>{await r.terminate()})},Yst=async(n,t)=>{let e=await sz("osd",0,t);return e.detect(n).finally(async()=>{await e.terminate()})};az.exports={recognize:qst,detect:Yst}});var cz=ae(($0t,lz)=>{"use strict";Tt();Rt();Ct();lz.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 hz=ae((G0t,uz)=>{"use strict";Tt();Rt();Ct();uz.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 dz=ae((Y0t,fz)=>{"use strict";Tt();Rt();Ct();_H();var Kst=PH(),Zst=xk(),Jst=oz(),Qst=cz(),tat=wk(),eat=hz(),{setLogging:rat}=rR();fz.exports={languages:Qst,OEM:tat,PSM:eat,createScheduler:Kst,createWorker:Zst,setLogging:rat,...Jst}});var Dz={};tc(Dz,{Deflate:()=>dat,DeflateRaw:()=>pat,Gunzip:()=>gat,Gzip:()=>mat,Inflate:()=>yat,InflateRaw:()=>bat,Unzip:()=>vat,Z_BEST_COMPRESSION:()=>wat,Z_BEST_SPEED:()=>Aat,Z_BINARY:()=>Eat,Z_BLOCK:()=>xat,Z_BUF_ERROR:()=>Sat,Z_DATA_ERROR:()=>_at,Z_DEFAULT_CHUNK:()=>Tat,Z_DEFAULT_COMPRESSION:()=>Cat,Z_DEFAULT_LEVEL:()=>Rat,Z_DEFAULT_MEMLEVEL:()=>Iat,Z_DEFAULT_STRATEGY:()=>Dat,Z_DEFAULT_WINDOWBITS:()=>Oat,Z_DEFLATED:()=>Pat,Z_ERRNO:()=>Nat,Z_FILTERED:()=>Lat,Z_FINISH:()=>kat,Z_FIXED:()=>Mat,Z_FULL_FLUSH:()=>Fat,Z_HUFFMAN_ONLY:()=>Bat,Z_MAX_CHUNK:()=>Uat,Z_MAX_LEVEL:()=>jat,Z_MAX_MEMLEVEL:()=>$at,Z_MAX_WINDOWBITS:()=>Hat,Z_MIN_CHUNK:()=>zat,Z_MIN_LEVEL:()=>Wat,Z_MIN_MEMLEVEL:()=>Gat,Z_MIN_WINDOWBITS:()=>Vat,Z_NEED_DICT:()=>Xat,Z_NO_COMPRESSION:()=>qat,Z_NO_FLUSH:()=>Yat,Z_OK:()=>Kat,Z_PARTIAL_FLUSH:()=>Zat,Z_RLE:()=>Jat,Z_STREAM_END:()=>Qat,Z_STREAM_ERROR:()=>tot,Z_SYNC_FLUSH:()=>eot,Z_TEXT:()=>rot,Z_TREES:()=>not,Z_UNKNOWN:()=>iot,Zlib:()=>sot,codes:()=>aot,createDeflate:()=>oot,createDeflateRaw:()=>lot,createGunzip:()=>cot,createGzip:()=>uot,createInflate:()=>hot,createInflateRaw:()=>fot,createUnzip:()=>dot,default:()=>Yt,deflate:()=>pot,deflateRaw:()=>got,deflateRawSync:()=>mot,deflateSync:()=>yot,gunzip:()=>bot,gunzipSync:()=>vot,gzip:()=>wot,gzipSync:()=>Aot,inflate:()=>Eot,inflateRaw:()=>xot,inflateRawSync:()=>Sot,inflateSync:()=>_ot,unzip:()=>Tot,unzipSync:()=>Cot});function nat(){if(gz)return Sk;gz=!0;function n(){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 Sk=n,Sk}function iR(){if(mz)return ss;mz=!0;var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function t(i,s){return Object.prototype.hasOwnProperty.call(i,s)}ss.assign=function(i){for(var s=Array.prototype.slice.call(arguments,1);s.length;){var a=s.shift();if(a){if(typeof a!="object")throw new TypeError(a+"must be non-object");for(var o in a)t(a,o)&&(i[o]=a[o])}}return i},ss.shrinkBuf=function(i,s){return i.length===s?i:i.subarray?i.subarray(0,s):(i.length=s,i)};var e={arraySet:function(i,s,a,o,c){if(s.subarray&&i.subarray){i.set(s.subarray(a,a+o),c);return}for(var u=0;u<o;u++)i[c+u]=s[a+u]},flattenChunks:function(i){var s,a,o,c,u,h;for(o=0,s=0,a=i.length;s<a;s++)o+=i[s].length;for(h=new Uint8Array(o),c=0,s=0,a=i.length;s<a;s++)u=i[s],h.set(u,c),c+=u.length;return h}},r={arraySet:function(i,s,a,o,c){for(var u=0;u<o;u++)i[c+u]=s[a+u]},flattenChunks:function(i){return[].concat.apply([],i)}};return ss.setTyped=function(i){i?(ss.Buf8=Uint8Array,ss.Buf16=Uint16Array,ss.Buf32=Int32Array,ss.assign(ss,e)):(ss.Buf8=Array,ss.Buf16=Array,ss.Buf32=Array,ss.assign(ss,r))},ss.setTyped(n),ss}function iat(){if(yz)return fg;yz=!0;var n=iR(),t=4,e=0,r=1,i=2;function s(k){for(var ct=k.length;--ct>=0;)k[ct]=0}var a=0,o=1,c=2,u=3,h=258,f=29,d=256,p=d+1+f,g=30,y=19,b=2*p+1,m=15,w=16,A=7,_=256,S=16,I=17,C=18,M=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],z=[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],G=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Y=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],L=512,j=new Array((p+2)*2);s(j);var q=new Array(g*2);s(q);var nt=new Array(L);s(nt);var J=new Array(h-u+1);s(J);var N=new Array(f);s(N);var D=new Array(g);s(D);function F(k,ct,mt,St,Et){this.static_tree=k,this.extra_bits=ct,this.extra_base=mt,this.elems=St,this.max_length=Et,this.has_stree=k&&k.length}var P,V,$;function H(k,ct){this.dyn_tree=k,this.max_code=0,this.stat_desc=ct}function rt(k){return k<256?nt[k]:nt[256+(k>>>7)]}function lt(k,ct){k.pending_buf[k.pending++]=ct&255,k.pending_buf[k.pending++]=ct>>>8&255}function ft(k,ct,mt){k.bi_valid>w-mt?(k.bi_buf|=ct<<k.bi_valid&65535,lt(k,k.bi_buf),k.bi_buf=ct>>w-k.bi_valid,k.bi_valid+=mt-w):(k.bi_buf|=ct<<k.bi_valid&65535,k.bi_valid+=mt)}function K(k,ct,mt){ft(k,mt[ct*2],mt[ct*2+1])}function X(k,ct){var mt=0;do mt|=k&1,k>>>=1,mt<<=1;while(--ct>0);return mt>>>1}function st(k){k.bi_valid===16?(lt(k,k.bi_buf),k.bi_buf=0,k.bi_valid=0):k.bi_valid>=8&&(k.pending_buf[k.pending++]=k.bi_buf&255,k.bi_buf>>=8,k.bi_valid-=8)}function bt(k,ct){var mt=ct.dyn_tree,St=ct.max_code,Et=ct.stat_desc.static_tree,Dt=ct.stat_desc.has_stree,et=ct.stat_desc.extra_bits,Ut=ct.stat_desc.extra_base,oe=ct.stat_desc.max_length,U,Mt,Ht,dt,It,Ft,de=0;for(dt=0;dt<=m;dt++)k.bl_count[dt]=0;for(mt[k.heap[k.heap_max]*2+1]=0,U=k.heap_max+1;U<b;U++)Mt=k.heap[U],dt=mt[mt[Mt*2+1]*2+1]+1,dt>oe&&(dt=oe,de++),mt[Mt*2+1]=dt,!(Mt>St)&&(k.bl_count[dt]++,It=0,Mt>=Ut&&(It=et[Mt-Ut]),Ft=mt[Mt*2],k.opt_len+=Ft*(dt+It),Dt&&(k.static_len+=Ft*(Et[Mt*2+1]+It)));if(de!==0){do{for(dt=oe-1;k.bl_count[dt]===0;)dt--;k.bl_count[dt]--,k.bl_count[dt+1]+=2,k.bl_count[oe]--,de-=2}while(de>0);for(dt=oe;dt!==0;dt--)for(Mt=k.bl_count[dt];Mt!==0;)Ht=k.heap[--U],!(Ht>St)&&(mt[Ht*2+1]!==dt&&(k.opt_len+=(dt-mt[Ht*2+1])*mt[Ht*2],mt[Ht*2+1]=dt),Mt--)}}function wt(k,ct,mt){var St=new Array(m+1),Et=0,Dt,et;for(Dt=1;Dt<=m;Dt++)St[Dt]=Et=Et+mt[Dt-1]<<1;for(et=0;et<=ct;et++){var Ut=k[et*2+1];Ut!==0&&(k[et*2]=X(St[Ut]++,Ut))}}function Q(){var k,ct,mt,St,Et,Dt=new Array(m+1);for(mt=0,St=0;St<f-1;St++)for(N[St]=mt,k=0;k<1<<M[St];k++)J[mt++]=St;for(J[mt-1]=St,Et=0,St=0;St<16;St++)for(D[St]=Et,k=0;k<1<<z[St];k++)nt[Et++]=St;for(Et>>=7;St<g;St++)for(D[St]=Et<<7,k=0;k<1<<z[St]-7;k++)nt[256+Et++]=St;for(ct=0;ct<=m;ct++)Dt[ct]=0;for(k=0;k<=143;)j[k*2+1]=8,k++,Dt[8]++;for(;k<=255;)j[k*2+1]=9,k++,Dt[9]++;for(;k<=279;)j[k*2+1]=7,k++,Dt[7]++;for(;k<=287;)j[k*2+1]=8,k++,Dt[8]++;for(wt(j,p+1,Dt),k=0;k<g;k++)q[k*2+1]=5,q[k*2]=X(k,5);P=new F(j,M,d+1,p,m),V=new F(q,z,0,g,m),$=new F(new Array(0),G,0,y,A)}function W(k){var ct;for(ct=0;ct<p;ct++)k.dyn_ltree[ct*2]=0;for(ct=0;ct<g;ct++)k.dyn_dtree[ct*2]=0;for(ct=0;ct<y;ct++)k.bl_tree[ct*2]=0;k.dyn_ltree[_*2]=1,k.opt_len=k.static_len=0,k.last_lit=k.matches=0}function at(k){k.bi_valid>8?lt(k,k.bi_buf):k.bi_valid>0&&(k.pending_buf[k.pending++]=k.bi_buf),k.bi_buf=0,k.bi_valid=0}function pt(k,ct,mt,St){at(k),lt(k,mt),lt(k,~mt),n.arraySet(k.pending_buf,k.window,ct,mt,k.pending),k.pending+=mt}function _t(k,ct,mt,St){var Et=ct*2,Dt=mt*2;return k[Et]<k[Dt]||k[Et]===k[Dt]&&St[ct]<=St[mt]}function At(k,ct,mt){for(var St=k.heap[mt],Et=mt<<1;Et<=k.heap_len&&(Et<k.heap_len&&_t(ct,k.heap[Et+1],k.heap[Et],k.depth)&&Et++,!_t(ct,St,k.heap[Et],k.depth));)k.heap[mt]=k.heap[Et],mt=Et,Et<<=1;k.heap[mt]=St}function gt(k,ct,mt){var St,Et,Dt=0,et,Ut;if(k.last_lit!==0)do St=k.pending_buf[k.d_buf+Dt*2]<<8|k.pending_buf[k.d_buf+Dt*2+1],Et=k.pending_buf[k.l_buf+Dt],Dt++,St===0?K(k,Et,ct):(et=J[Et],K(k,et+d+1,ct),Ut=M[et],Ut!==0&&(Et-=N[et],ft(k,Et,Ut)),St--,et=rt(St),K(k,et,mt),Ut=z[et],Ut!==0&&(St-=D[et],ft(k,St,Ut)));while(Dt<k.last_lit);K(k,_,ct)}function xt(k,ct){var mt=ct.dyn_tree,St=ct.stat_desc.static_tree,Et=ct.stat_desc.has_stree,Dt=ct.stat_desc.elems,et,Ut,oe=-1,U;for(k.heap_len=0,k.heap_max=b,et=0;et<Dt;et++)mt[et*2]!==0?(k.heap[++k.heap_len]=oe=et,k.depth[et]=0):mt[et*2+1]=0;for(;k.heap_len<2;)U=k.heap[++k.heap_len]=oe<2?++oe:0,mt[U*2]=1,k.depth[U]=0,k.opt_len--,Et&&(k.static_len-=St[U*2+1]);for(ct.max_code=oe,et=k.heap_len>>1;et>=1;et--)At(k,mt,et);U=Dt;do et=k.heap[1],k.heap[1]=k.heap[k.heap_len--],At(k,mt,1),Ut=k.heap[1],k.heap[--k.heap_max]=et,k.heap[--k.heap_max]=Ut,mt[U*2]=mt[et*2]+mt[Ut*2],k.depth[U]=(k.depth[et]>=k.depth[Ut]?k.depth[et]:k.depth[Ut])+1,mt[et*2+1]=mt[Ut*2+1]=U,k.heap[1]=U++,At(k,mt,1);while(k.heap_len>=2);k.heap[--k.heap_max]=k.heap[1],bt(k,ct),wt(mt,oe,k.bl_count)}function $t(k,ct,mt){var St,Et=-1,Dt,et=ct[1],Ut=0,oe=7,U=4;for(et===0&&(oe=138,U=3),ct[(mt+1)*2+1]=65535,St=0;St<=mt;St++)Dt=et,et=ct[(St+1)*2+1],!(++Ut<oe&&Dt===et)&&(Ut<U?k.bl_tree[Dt*2]+=Ut:Dt!==0?(Dt!==Et&&k.bl_tree[Dt*2]++,k.bl_tree[S*2]++):Ut<=10?k.bl_tree[I*2]++:k.bl_tree[C*2]++,Ut=0,Et=Dt,et===0?(oe=138,U=3):Dt===et?(oe=6,U=3):(oe=7,U=4))}function Nt(k,ct,mt){var St,Et=-1,Dt,et=ct[1],Ut=0,oe=7,U=4;for(et===0&&(oe=138,U=3),St=0;St<=mt;St++)if(Dt=et,et=ct[(St+1)*2+1],!(++Ut<oe&&Dt===et)){if(Ut<U)do K(k,Dt,k.bl_tree);while(--Ut!==0);else Dt!==0?(Dt!==Et&&(K(k,Dt,k.bl_tree),Ut--),K(k,S,k.bl_tree),ft(k,Ut-3,2)):Ut<=10?(K(k,I,k.bl_tree),ft(k,Ut-3,3)):(K(k,C,k.bl_tree),ft(k,Ut-11,7));Ut=0,Et=Dt,et===0?(oe=138,U=3):Dt===et?(oe=6,U=3):(oe=7,U=4)}}function Ot(k){var ct;for($t(k,k.dyn_ltree,k.l_desc.max_code),$t(k,k.dyn_dtree,k.d_desc.max_code),xt(k,k.bl_desc),ct=y-1;ct>=3&&k.bl_tree[Y[ct]*2+1]===0;ct--);return k.opt_len+=3*(ct+1)+5+5+4,ct}function qt(k,ct,mt,St){var Et;for(ft(k,ct-257,5),ft(k,mt-1,5),ft(k,St-4,4),Et=0;Et<St;Et++)ft(k,k.bl_tree[Y[Et]*2+1],3);Nt(k,k.dyn_ltree,ct-1),Nt(k,k.dyn_dtree,mt-1)}function Jt(k){var ct=4093624447,mt;for(mt=0;mt<=31;mt++,ct>>>=1)if(ct&1&&k.dyn_ltree[mt*2]!==0)return e;if(k.dyn_ltree[18]!==0||k.dyn_ltree[20]!==0||k.dyn_ltree[26]!==0)return r;for(mt=32;mt<d;mt++)if(k.dyn_ltree[mt*2]!==0)return r;return e}var te=!1;function O(k){te||(Q(),te=!0),k.l_desc=new H(k.dyn_ltree,P),k.d_desc=new H(k.dyn_dtree,V),k.bl_desc=new H(k.bl_tree,$),k.bi_buf=0,k.bi_valid=0,W(k)}function v(k,ct,mt,St){ft(k,(a<<1)+(St?1:0),3),pt(k,ct,mt)}function E(k){ft(k,o<<1,3),K(k,_,j),st(k)}function B(k,ct,mt,St){var Et,Dt,et=0;k.level>0?(k.strm.data_type===i&&(k.strm.data_type=Jt(k)),xt(k,k.l_desc),xt(k,k.d_desc),et=Ot(k),Et=k.opt_len+3+7>>>3,Dt=k.static_len+3+7>>>3,Dt<=Et&&(Et=Dt)):Et=Dt=mt+5,mt+4<=Et&&ct!==-1?v(k,ct,mt,St):k.strategy===t||Dt===Et?(ft(k,(o<<1)+(St?1:0),3),gt(k,j,q)):(ft(k,(c<<1)+(St?1:0),3),qt(k,k.l_desc.max_code+1,k.d_desc.max_code+1,et+1),gt(k,k.dyn_ltree,k.dyn_dtree)),W(k),St&&at(k)}function it(k,ct,mt){return k.pending_buf[k.d_buf+k.last_lit*2]=ct>>>8&255,k.pending_buf[k.d_buf+k.last_lit*2+1]=ct&255,k.pending_buf[k.l_buf+k.last_lit]=mt&255,k.last_lit++,ct===0?k.dyn_ltree[mt*2]++:(k.matches++,ct--,k.dyn_ltree[(J[mt]+d+1)*2]++,k.dyn_dtree[rt(ct)*2]++),k.last_lit===k.lit_bufsize-1}return fg._tr_init=O,fg._tr_stored_block=v,fg._tr_flush_block=B,fg._tr_tally=it,fg._tr_align=E,fg}function Rz(){if(bz)return _k;bz=!0;function n(t,e,r,i){for(var s=t&65535|0,a=t>>>16&65535|0,o=0;r!==0;){o=r>2e3?2e3:r,r-=o;do s=s+e[i++]|0,a=a+s|0;while(--o);s%=65521,a%=65521}return s|a<<16|0}return _k=n,_k}function Iz(){if(vz)return Tk;vz=!0;function n(){for(var r,i=[],s=0;s<256;s++){r=s;for(var a=0;a<8;a++)r=r&1?3988292384^r>>>1:r>>>1;i[s]=r}return i}var t=n();function e(r,i,s,a){var o=t,c=a+s;r^=-1;for(var u=a;u<c;u++)r=r>>>8^o[(r^i[u])&255];return r^-1}return Tk=e,Tk}function sat(){return wz||(wz=!0,Ck={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"}),Ck}function aat(){if(Az)return ml;Az=!0;var n=iR(),t=iat(),e=Rz(),r=Iz(),i=sat(),s=0,a=1,o=3,c=4,u=5,h=0,f=1,d=-2,p=-3,g=-5,y=-1,b=1,m=2,w=3,A=4,_=0,S=2,I=8,C=9,M=15,z=8,G=29,Y=256,L=Y+1+G,j=30,q=19,nt=2*L+1,J=15,N=3,D=258,F=D+N+1,P=32,V=42,$=69,H=73,rt=91,lt=103,ft=113,K=666,X=1,st=2,bt=3,wt=4,Q=3;function W(U,Mt){return U.msg=i[Mt],Mt}function at(U){return(U<<1)-(U>4?9:0)}function pt(U){for(var Mt=U.length;--Mt>=0;)U[Mt]=0}function _t(U){var Mt=U.state,Ht=Mt.pending;Ht>U.avail_out&&(Ht=U.avail_out),Ht!==0&&(n.arraySet(U.output,Mt.pending_buf,Mt.pending_out,Ht,U.next_out),U.next_out+=Ht,Mt.pending_out+=Ht,U.total_out+=Ht,U.avail_out-=Ht,Mt.pending-=Ht,Mt.pending===0&&(Mt.pending_out=0))}function At(U,Mt){t._tr_flush_block(U,U.block_start>=0?U.block_start:-1,U.strstart-U.block_start,Mt),U.block_start=U.strstart,_t(U.strm)}function gt(U,Mt){U.pending_buf[U.pending++]=Mt}function xt(U,Mt){U.pending_buf[U.pending++]=Mt>>>8&255,U.pending_buf[U.pending++]=Mt&255}function $t(U,Mt,Ht,dt){var It=U.avail_in;return It>dt&&(It=dt),It===0?0:(U.avail_in-=It,n.arraySet(Mt,U.input,U.next_in,It,Ht),U.state.wrap===1?U.adler=e(U.adler,Mt,It,Ht):U.state.wrap===2&&(U.adler=r(U.adler,Mt,It,Ht)),U.next_in+=It,U.total_in+=It,It)}function Nt(U,Mt){var Ht=U.max_chain_length,dt=U.strstart,It,Ft,de=U.prev_length,ut=U.nice_match,yt=U.strstart>U.w_size-F?U.strstart-(U.w_size-F):0,Wt=U.window,jt=U.w_mask,Zt=U.prev,be=U.strstart+D,He=Wt[dt+de-1],Oe=Wt[dt+de];U.prev_length>=U.good_match&&(Ht>>=2),ut>U.lookahead&&(ut=U.lookahead);do if(It=Mt,!(Wt[It+de]!==Oe||Wt[It+de-1]!==He||Wt[It]!==Wt[dt]||Wt[++It]!==Wt[dt+1])){dt+=2,It++;do;while(Wt[++dt]===Wt[++It]&&Wt[++dt]===Wt[++It]&&Wt[++dt]===Wt[++It]&&Wt[++dt]===Wt[++It]&&Wt[++dt]===Wt[++It]&&Wt[++dt]===Wt[++It]&&Wt[++dt]===Wt[++It]&&Wt[++dt]===Wt[++It]&&dt<be);if(Ft=D-(be-dt),dt=be-D,Ft>de){if(U.match_start=Mt,de=Ft,Ft>=ut)break;He=Wt[dt+de-1],Oe=Wt[dt+de]}}while((Mt=Zt[Mt&jt])>yt&&--Ht!==0);return de<=U.lookahead?de:U.lookahead}function Ot(U){var Mt=U.w_size,Ht,dt,It,Ft,de;do{if(Ft=U.window_size-U.lookahead-U.strstart,U.strstart>=Mt+(Mt-F)){n.arraySet(U.window,U.window,Mt,Mt,0),U.match_start-=Mt,U.strstart-=Mt,U.block_start-=Mt,dt=U.hash_size,Ht=dt;do It=U.head[--Ht],U.head[Ht]=It>=Mt?It-Mt:0;while(--dt);dt=Mt,Ht=dt;do It=U.prev[--Ht],U.prev[Ht]=It>=Mt?It-Mt:0;while(--dt);Ft+=Mt}if(U.strm.avail_in===0)break;if(dt=$t(U.strm,U.window,U.strstart+U.lookahead,Ft),U.lookahead+=dt,U.lookahead+U.insert>=N)for(de=U.strstart-U.insert,U.ins_h=U.window[de],U.ins_h=(U.ins_h<<U.hash_shift^U.window[de+1])&U.hash_mask;U.insert&&(U.ins_h=(U.ins_h<<U.hash_shift^U.window[de+N-1])&U.hash_mask,U.prev[de&U.w_mask]=U.head[U.ins_h],U.head[U.ins_h]=de,de++,U.insert--,!(U.lookahead+U.insert<N)););}while(U.lookahead<F&&U.strm.avail_in!==0)}function qt(U,Mt){var Ht=65535;for(Ht>U.pending_buf_size-5&&(Ht=U.pending_buf_size-5);;){if(U.lookahead<=1){if(Ot(U),U.lookahead===0&&Mt===s)return X;if(U.lookahead===0)break}U.strstart+=U.lookahead,U.lookahead=0;var dt=U.block_start+Ht;if((U.strstart===0||U.strstart>=dt)&&(U.lookahead=U.strstart-dt,U.strstart=dt,At(U,!1),U.strm.avail_out===0)||U.strstart-U.block_start>=U.w_size-F&&(At(U,!1),U.strm.avail_out===0))return X}return U.insert=0,Mt===c?(At(U,!0),U.strm.avail_out===0?bt:wt):(U.strstart>U.block_start&&(At(U,!1),U.strm.avail_out===0),X)}function Jt(U,Mt){for(var Ht,dt;;){if(U.lookahead<F){if(Ot(U),U.lookahead<F&&Mt===s)return X;if(U.lookahead===0)break}if(Ht=0,U.lookahead>=N&&(U.ins_h=(U.ins_h<<U.hash_shift^U.window[U.strstart+N-1])&U.hash_mask,Ht=U.prev[U.strstart&U.w_mask]=U.head[U.ins_h],U.head[U.ins_h]=U.strstart),Ht!==0&&U.strstart-Ht<=U.w_size-F&&(U.match_length=Nt(U,Ht)),U.match_length>=N)if(dt=t._tr_tally(U,U.strstart-U.match_start,U.match_length-N),U.lookahead-=U.match_length,U.match_length<=U.max_lazy_match&&U.lookahead>=N){U.match_length--;do U.strstart++,U.ins_h=(U.ins_h<<U.hash_shift^U.window[U.strstart+N-1])&U.hash_mask,Ht=U.prev[U.strstart&U.w_mask]=U.head[U.ins_h],U.head[U.ins_h]=U.strstart;while(--U.match_length!==0);U.strstart++}else U.strstart+=U.match_length,U.match_length=0,U.ins_h=U.window[U.strstart],U.ins_h=(U.ins_h<<U.hash_shift^U.window[U.strstart+1])&U.hash_mask;else dt=t._tr_tally(U,0,U.window[U.strstart]),U.lookahead--,U.strstart++;if(dt&&(At(U,!1),U.strm.avail_out===0))return X}return U.insert=U.strstart<N-1?U.strstart:N-1,Mt===c?(At(U,!0),U.strm.avail_out===0?bt:wt):U.last_lit&&(At(U,!1),U.strm.avail_out===0)?X:st}function te(U,Mt){for(var Ht,dt,It;;){if(U.lookahead<F){if(Ot(U),U.lookahead<F&&Mt===s)return X;if(U.lookahead===0)break}if(Ht=0,U.lookahead>=N&&(U.ins_h=(U.ins_h<<U.hash_shift^U.window[U.strstart+N-1])&U.hash_mask,Ht=U.prev[U.strstart&U.w_mask]=U.head[U.ins_h],U.head[U.ins_h]=U.strstart),U.prev_length=U.match_length,U.prev_match=U.match_start,U.match_length=N-1,Ht!==0&&U.prev_length<U.max_lazy_match&&U.strstart-Ht<=U.w_size-F&&(U.match_length=Nt(U,Ht),U.match_length<=5&&(U.strategy===b||U.match_length===N&&U.strstart-U.match_start>4096)&&(U.match_length=N-1)),U.prev_length>=N&&U.match_length<=U.prev_length){It=U.strstart+U.lookahead-N,dt=t._tr_tally(U,U.strstart-1-U.prev_match,U.prev_length-N),U.lookahead-=U.prev_length-1,U.prev_length-=2;do++U.strstart<=It&&(U.ins_h=(U.ins_h<<U.hash_shift^U.window[U.strstart+N-1])&U.hash_mask,Ht=U.prev[U.strstart&U.w_mask]=U.head[U.ins_h],U.head[U.ins_h]=U.strstart);while(--U.prev_length!==0);if(U.match_available=0,U.match_length=N-1,U.strstart++,dt&&(At(U,!1),U.strm.avail_out===0))return X}else if(U.match_available){if(dt=t._tr_tally(U,0,U.window[U.strstart-1]),dt&&At(U,!1),U.strstart++,U.lookahead--,U.strm.avail_out===0)return X}else U.match_available=1,U.strstart++,U.lookahead--}return U.match_available&&(dt=t._tr_tally(U,0,U.window[U.strstart-1]),U.match_available=0),U.insert=U.strstart<N-1?U.strstart:N-1,Mt===c?(At(U,!0),U.strm.avail_out===0?bt:wt):U.last_lit&&(At(U,!1),U.strm.avail_out===0)?X:st}function O(U,Mt){for(var Ht,dt,It,Ft,de=U.window;;){if(U.lookahead<=D){if(Ot(U),U.lookahead<=D&&Mt===s)return X;if(U.lookahead===0)break}if(U.match_length=0,U.lookahead>=N&&U.strstart>0&&(It=U.strstart-1,dt=de[It],dt===de[++It]&&dt===de[++It]&&dt===de[++It])){Ft=U.strstart+D;do;while(dt===de[++It]&&dt===de[++It]&&dt===de[++It]&&dt===de[++It]&&dt===de[++It]&&dt===de[++It]&&dt===de[++It]&&dt===de[++It]&&It<Ft);U.match_length=D-(Ft-It),U.match_length>U.lookahead&&(U.match_length=U.lookahead)}if(U.match_length>=N?(Ht=t._tr_tally(U,1,U.match_length-N),U.lookahead-=U.match_length,U.strstart+=U.match_length,U.match_length=0):(Ht=t._tr_tally(U,0,U.window[U.strstart]),U.lookahead--,U.strstart++),Ht&&(At(U,!1),U.strm.avail_out===0))return X}return U.insert=0,Mt===c?(At(U,!0),U.strm.avail_out===0?bt:wt):U.last_lit&&(At(U,!1),U.strm.avail_out===0)?X:st}function v(U,Mt){for(var Ht;;){if(U.lookahead===0&&(Ot(U),U.lookahead===0)){if(Mt===s)return X;break}if(U.match_length=0,Ht=t._tr_tally(U,0,U.window[U.strstart]),U.lookahead--,U.strstart++,Ht&&(At(U,!1),U.strm.avail_out===0))return X}return U.insert=0,Mt===c?(At(U,!0),U.strm.avail_out===0?bt:wt):U.last_lit&&(At(U,!1),U.strm.avail_out===0)?X:st}function E(U,Mt,Ht,dt,It){this.good_length=U,this.max_lazy=Mt,this.nice_length=Ht,this.max_chain=dt,this.func=It}var B;B=[new E(0,0,0,0,qt),new E(4,4,8,4,Jt),new E(4,5,16,8,Jt),new E(4,6,32,32,Jt),new E(4,4,16,16,te),new E(8,16,32,32,te),new E(8,16,128,128,te),new E(8,32,128,256,te),new E(32,128,258,1024,te),new E(32,258,258,4096,te)];function it(U){U.window_size=2*U.w_size,pt(U.head),U.max_lazy_match=B[U.level].max_lazy,U.good_match=B[U.level].good_length,U.nice_match=B[U.level].nice_length,U.max_chain_length=B[U.level].max_chain,U.strstart=0,U.block_start=0,U.lookahead=0,U.insert=0,U.match_length=U.prev_length=N-1,U.match_available=0,U.ins_h=0}function k(){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=I,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 n.Buf16(nt*2),this.dyn_dtree=new n.Buf16((2*j+1)*2),this.bl_tree=new n.Buf16((2*q+1)*2),pt(this.dyn_ltree),pt(this.dyn_dtree),pt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(J+1),this.heap=new n.Buf16(2*L+1),pt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(2*L+1),pt(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 ct(U){var Mt;return!U||!U.state?W(U,d):(U.total_in=U.total_out=0,U.data_type=S,Mt=U.state,Mt.pending=0,Mt.pending_out=0,Mt.wrap<0&&(Mt.wrap=-Mt.wrap),Mt.status=Mt.wrap?V:ft,U.adler=Mt.wrap===2?0:1,Mt.last_flush=s,t._tr_init(Mt),h)}function mt(U){var Mt=ct(U);return Mt===h&&it(U.state),Mt}function St(U,Mt){return!U||!U.state||U.state.wrap!==2?d:(U.state.gzhead=Mt,h)}function Et(U,Mt,Ht,dt,It,Ft){if(!U)return d;var de=1;if(Mt===y&&(Mt=6),dt<0?(de=0,dt=-dt):dt>15&&(de=2,dt-=16),It<1||It>C||Ht!==I||dt<8||dt>15||Mt<0||Mt>9||Ft<0||Ft>A)return W(U,d);dt===8&&(dt=9);var ut=new k;return U.state=ut,ut.strm=U,ut.wrap=de,ut.gzhead=null,ut.w_bits=dt,ut.w_size=1<<ut.w_bits,ut.w_mask=ut.w_size-1,ut.hash_bits=It+7,ut.hash_size=1<<ut.hash_bits,ut.hash_mask=ut.hash_size-1,ut.hash_shift=~~((ut.hash_bits+N-1)/N),ut.window=new n.Buf8(ut.w_size*2),ut.head=new n.Buf16(ut.hash_size),ut.prev=new n.Buf16(ut.w_size),ut.lit_bufsize=1<<It+6,ut.pending_buf_size=ut.lit_bufsize*4,ut.pending_buf=new n.Buf8(ut.pending_buf_size),ut.d_buf=1*ut.lit_bufsize,ut.l_buf=3*ut.lit_bufsize,ut.level=Mt,ut.strategy=Ft,ut.method=Ht,mt(U)}function Dt(U,Mt){return Et(U,Mt,I,M,z,_)}function et(U,Mt){var Ht,dt,It,Ft;if(!U||!U.state||Mt>u||Mt<0)return U?W(U,d):d;if(dt=U.state,!U.output||!U.input&&U.avail_in!==0||dt.status===K&&Mt!==c)return W(U,U.avail_out===0?g:d);if(dt.strm=U,Ht=dt.last_flush,dt.last_flush=Mt,dt.status===V)if(dt.wrap===2)U.adler=0,gt(dt,31),gt(dt,139),gt(dt,8),dt.gzhead?(gt(dt,(dt.gzhead.text?1:0)+(dt.gzhead.hcrc?2:0)+(dt.gzhead.extra?4:0)+(dt.gzhead.name?8:0)+(dt.gzhead.comment?16:0)),gt(dt,dt.gzhead.time&255),gt(dt,dt.gzhead.time>>8&255),gt(dt,dt.gzhead.time>>16&255),gt(dt,dt.gzhead.time>>24&255),gt(dt,dt.level===9?2:dt.strategy>=m||dt.level<2?4:0),gt(dt,dt.gzhead.os&255),dt.gzhead.extra&&dt.gzhead.extra.length&&(gt(dt,dt.gzhead.extra.length&255),gt(dt,dt.gzhead.extra.length>>8&255)),dt.gzhead.hcrc&&(U.adler=r(U.adler,dt.pending_buf,dt.pending,0)),dt.gzindex=0,dt.status=$):(gt(dt,0),gt(dt,0),gt(dt,0),gt(dt,0),gt(dt,0),gt(dt,dt.level===9?2:dt.strategy>=m||dt.level<2?4:0),gt(dt,Q),dt.status=ft);else{var de=I+(dt.w_bits-8<<4)<<8,ut=-1;dt.strategy>=m||dt.level<2?ut=0:dt.level<6?ut=1:dt.level===6?ut=2:ut=3,de|=ut<<6,dt.strstart!==0&&(de|=P),de+=31-de%31,dt.status=ft,xt(dt,de),dt.strstart!==0&&(xt(dt,U.adler>>>16),xt(dt,U.adler&65535)),U.adler=1}if(dt.status===$)if(dt.gzhead.extra){for(It=dt.pending;dt.gzindex<(dt.gzhead.extra.length&65535)&&!(dt.pending===dt.pending_buf_size&&(dt.gzhead.hcrc&&dt.pending>It&&(U.adler=r(U.adler,dt.pending_buf,dt.pending-It,It)),_t(U),It=dt.pending,dt.pending===dt.pending_buf_size));)gt(dt,dt.gzhead.extra[dt.gzindex]&255),dt.gzindex++;dt.gzhead.hcrc&&dt.pending>It&&(U.adler=r(U.adler,dt.pending_buf,dt.pending-It,It)),dt.gzindex===dt.gzhead.extra.length&&(dt.gzindex=0,dt.status=H)}else dt.status=H;if(dt.status===H)if(dt.gzhead.name){It=dt.pending;do{if(dt.pending===dt.pending_buf_size&&(dt.gzhead.hcrc&&dt.pending>It&&(U.adler=r(U.adler,dt.pending_buf,dt.pending-It,It)),_t(U),It=dt.pending,dt.pending===dt.pending_buf_size)){Ft=1;break}dt.gzindex<dt.gzhead.name.length?Ft=dt.gzhead.name.charCodeAt(dt.gzindex++)&255:Ft=0,gt(dt,Ft)}while(Ft!==0);dt.gzhead.hcrc&&dt.pending>It&&(U.adler=r(U.adler,dt.pending_buf,dt.pending-It,It)),Ft===0&&(dt.gzindex=0,dt.status=rt)}else dt.status=rt;if(dt.status===rt)if(dt.gzhead.comment){It=dt.pending;do{if(dt.pending===dt.pending_buf_size&&(dt.gzhead.hcrc&&dt.pending>It&&(U.adler=r(U.adler,dt.pending_buf,dt.pending-It,It)),_t(U),It=dt.pending,dt.pending===dt.pending_buf_size)){Ft=1;break}dt.gzindex<dt.gzhead.comment.length?Ft=dt.gzhead.comment.charCodeAt(dt.gzindex++)&255:Ft=0,gt(dt,Ft)}while(Ft!==0);dt.gzhead.hcrc&&dt.pending>It&&(U.adler=r(U.adler,dt.pending_buf,dt.pending-It,It)),Ft===0&&(dt.status=lt)}else dt.status=lt;if(dt.status===lt&&(dt.gzhead.hcrc?(dt.pending+2>dt.pending_buf_size&&_t(U),dt.pending+2<=dt.pending_buf_size&&(gt(dt,U.adler&255),gt(dt,U.adler>>8&255),U.adler=0,dt.status=ft)):dt.status=ft),dt.pending!==0){if(_t(U),U.avail_out===0)return dt.last_flush=-1,h}else if(U.avail_in===0&&at(Mt)<=at(Ht)&&Mt!==c)return W(U,g);if(dt.status===K&&U.avail_in!==0)return W(U,g);if(U.avail_in!==0||dt.lookahead!==0||Mt!==s&&dt.status!==K){var yt=dt.strategy===m?v(dt,Mt):dt.strategy===w?O(dt,Mt):B[dt.level].func(dt,Mt);if((yt===bt||yt===wt)&&(dt.status=K),yt===X||yt===bt)return U.avail_out===0&&(dt.last_flush=-1),h;if(yt===st&&(Mt===a?t._tr_align(dt):Mt!==u&&(t._tr_stored_block(dt,0,0,!1),Mt===o&&(pt(dt.head),dt.lookahead===0&&(dt.strstart=0,dt.block_start=0,dt.insert=0))),_t(U),U.avail_out===0))return dt.last_flush=-1,h}return Mt!==c?h:dt.wrap<=0?f:(dt.wrap===2?(gt(dt,U.adler&255),gt(dt,U.adler>>8&255),gt(dt,U.adler>>16&255),gt(dt,U.adler>>24&255),gt(dt,U.total_in&255),gt(dt,U.total_in>>8&255),gt(dt,U.total_in>>16&255),gt(dt,U.total_in>>24&255)):(xt(dt,U.adler>>>16),xt(dt,U.adler&65535)),_t(U),dt.wrap>0&&(dt.wrap=-dt.wrap),dt.pending!==0?h:f)}function Ut(U){var Mt;return!U||!U.state?d:(Mt=U.state.status,Mt!==V&&Mt!==$&&Mt!==H&&Mt!==rt&&Mt!==lt&&Mt!==ft&&Mt!==K?W(U,d):(U.state=null,Mt===ft?W(U,p):h))}function oe(U,Mt){var Ht=Mt.length,dt,It,Ft,de,ut,yt,Wt,jt;if(!U||!U.state||(dt=U.state,de=dt.wrap,de===2||de===1&&dt.status!==V||dt.lookahead))return d;for(de===1&&(U.adler=e(U.adler,Mt,Ht,0)),dt.wrap=0,Ht>=dt.w_size&&(de===0&&(pt(dt.head),dt.strstart=0,dt.block_start=0,dt.insert=0),jt=new n.Buf8(dt.w_size),n.arraySet(jt,Mt,Ht-dt.w_size,dt.w_size,0),Mt=jt,Ht=dt.w_size),ut=U.avail_in,yt=U.next_in,Wt=U.input,U.avail_in=Ht,U.next_in=0,U.input=Mt,Ot(dt);dt.lookahead>=N;){It=dt.strstart,Ft=dt.lookahead-(N-1);do dt.ins_h=(dt.ins_h<<dt.hash_shift^dt.window[It+N-1])&dt.hash_mask,dt.prev[It&dt.w_mask]=dt.head[dt.ins_h],dt.head[dt.ins_h]=It,It++;while(--Ft);dt.strstart=It,dt.lookahead=N-1,Ot(dt)}return dt.strstart+=dt.lookahead,dt.block_start=dt.strstart,dt.insert=dt.lookahead,dt.lookahead=0,dt.match_length=dt.prev_length=N-1,dt.match_available=0,U.next_in=yt,U.input=Wt,U.avail_in=ut,dt.wrap=de,h}return ml.deflateInit=Dt,ml.deflateInit2=Et,ml.deflateReset=mt,ml.deflateResetKeep=ct,ml.deflateSetHeader=St,ml.deflate=et,ml.deflateEnd=Ut,ml.deflateSetDictionary=oe,ml.deflateInfo="pako deflate (from Nodeca project)",ml}function oat(){if(Ez)return Rk;Ez=!0;var n=30,t=12;return Rk=function(r,i){var s,a,o,c,u,h,f,d,p,g,y,b,m,w,A,_,S,I,C,M,z,G,Y,L,j;s=r.state,a=r.next_in,L=r.input,o=a+(r.avail_in-5),c=r.next_out,j=r.output,u=c-(i-r.avail_out),h=c+(r.avail_out-257),f=s.dmax,d=s.wsize,p=s.whave,g=s.wnext,y=s.window,b=s.hold,m=s.bits,w=s.lencode,A=s.distcode,_=(1<<s.lenbits)-1,S=(1<<s.distbits)-1;t:do{m<15&&(b+=L[a++]<<m,m+=8,b+=L[a++]<<m,m+=8),I=w[b&_];e:for(;;){if(C=I>>>24,b>>>=C,m-=C,C=I>>>16&255,C===0)j[c++]=I&65535;else if(C&16){M=I&65535,C&=15,C&&(m<C&&(b+=L[a++]<<m,m+=8),M+=b&(1<<C)-1,b>>>=C,m-=C),m<15&&(b+=L[a++]<<m,m+=8,b+=L[a++]<<m,m+=8),I=A[b&S];r:for(;;){if(C=I>>>24,b>>>=C,m-=C,C=I>>>16&255,C&16){if(z=I&65535,C&=15,m<C&&(b+=L[a++]<<m,m+=8,m<C&&(b+=L[a++]<<m,m+=8)),z+=b&(1<<C)-1,z>f){r.msg="invalid distance too far back",s.mode=n;break t}if(b>>>=C,m-=C,C=c-u,z>C){if(C=z-C,C>p&&s.sane){r.msg="invalid distance too far back",s.mode=n;break t}if(G=0,Y=y,g===0){if(G+=d-C,C<M){M-=C;do j[c++]=y[G++];while(--C);G=c-z,Y=j}}else if(g<C){if(G+=d+g-C,C-=g,C<M){M-=C;do j[c++]=y[G++];while(--C);if(G=0,g<M){C=g,M-=C;do j[c++]=y[G++];while(--C);G=c-z,Y=j}}}else if(G+=g-C,C<M){M-=C;do j[c++]=y[G++];while(--C);G=c-z,Y=j}for(;M>2;)j[c++]=Y[G++],j[c++]=Y[G++],j[c++]=Y[G++],M-=3;M&&(j[c++]=Y[G++],M>1&&(j[c++]=Y[G++]))}else{G=c-z;do j[c++]=j[G++],j[c++]=j[G++],j[c++]=j[G++],M-=3;while(M>2);M&&(j[c++]=j[G++],M>1&&(j[c++]=j[G++]))}}else if((C&64)===0){I=A[(I&65535)+(b&(1<<C)-1)];continue r}else{r.msg="invalid distance code",s.mode=n;break t}break}}else if((C&64)===0){I=w[(I&65535)+(b&(1<<C)-1)];continue e}else if(C&32){s.mode=t;break t}else{r.msg="invalid literal/length code",s.mode=n;break t}break}}while(a<o&&c<h);M=m>>3,a-=M,m-=M<<3,b&=(1<<m)-1,r.next_in=a,r.next_out=c,r.avail_in=a<o?5+(o-a):5-(a-o),r.avail_out=c<h?257+(h-c):257-(c-h),s.hold=b,s.bits=m},Rk}function lat(){if(xz)return Ik;xz=!0;var n=iR(),t=15,e=852,r=592,i=0,s=1,a=2,o=[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],c=[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],u=[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],h=[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 Ik=function(d,p,g,y,b,m,w,A){var _=A.bits,S=0,I=0,C=0,M=0,z=0,G=0,Y=0,L=0,j=0,q=0,nt,J,N,D,F,P=null,V=0,$,H=new n.Buf16(t+1),rt=new n.Buf16(t+1),lt=null,ft=0,K,X,st;for(S=0;S<=t;S++)H[S]=0;for(I=0;I<y;I++)H[p[g+I]]++;for(z=_,M=t;M>=1&&H[M]===0;M--);if(z>M&&(z=M),M===0)return b[m++]=1<<24|64<<16|0,b[m++]=1<<24|64<<16|0,A.bits=1,0;for(C=1;C<M&&H[C]===0;C++);for(z<C&&(z=C),L=1,S=1;S<=t;S++)if(L<<=1,L-=H[S],L<0)return-1;if(L>0&&(d===i||M!==1))return-1;for(rt[1]=0,S=1;S<t;S++)rt[S+1]=rt[S]+H[S];for(I=0;I<y;I++)p[g+I]!==0&&(w[rt[p[g+I]]++]=I);if(d===i?(P=lt=w,$=19):d===s?(P=o,V-=257,lt=c,ft-=257,$=256):(P=u,lt=h,$=-1),q=0,I=0,S=C,F=m,G=z,Y=0,N=-1,j=1<<z,D=j-1,d===s&&j>e||d===a&&j>r)return 1;for(;;){K=S-Y,w[I]<$?(X=0,st=w[I]):w[I]>$?(X=lt[ft+w[I]],st=P[V+w[I]]):(X=96,st=0),nt=1<<S-Y,J=1<<G,C=J;do J-=nt,b[F+(q>>Y)+J]=K<<24|X<<16|st|0;while(J!==0);for(nt=1<<S-1;q&nt;)nt>>=1;if(nt!==0?(q&=nt-1,q+=nt):q=0,I++,--H[S]===0){if(S===M)break;S=p[g+w[I]]}if(S>z&&(q&D)!==N){for(Y===0&&(Y=z),F+=C,G=S-Y,L=1<<G;G+Y<M&&(L-=H[G+Y],!(L<=0));)G++,L<<=1;if(j+=1<<G,d===s&&j>e||d===a&&j>r)return 1;N=q&D,b[N]=z<<24|G<<16|F-m|0}}return q!==0&&(b[F+q]=S-Y<<24|64<<16|0),A.bits=z,0},Ik}function cat(){if(Sz)return _o;Sz=!0;var n=iR(),t=Rz(),e=Iz(),r=oat(),i=lat(),s=0,a=1,o=2,c=4,u=5,h=6,f=0,d=1,p=2,g=-2,y=-3,b=-4,m=-5,w=8,A=1,_=2,S=3,I=4,C=5,M=6,z=7,G=8,Y=9,L=10,j=11,q=12,nt=13,J=14,N=15,D=16,F=17,P=18,V=19,$=20,H=21,rt=22,lt=23,ft=24,K=25,X=26,st=27,bt=28,wt=29,Q=30,W=31,at=32,pt=852,_t=592,At=15,gt=At;function xt(Et){return(Et>>>24&255)+(Et>>>8&65280)+((Et&65280)<<8)+((Et&255)<<24)}function $t(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Nt(Et){var Dt;return!Et||!Et.state?g:(Dt=Et.state,Et.total_in=Et.total_out=Dt.total=0,Et.msg="",Dt.wrap&&(Et.adler=Dt.wrap&1),Dt.mode=A,Dt.last=0,Dt.havedict=0,Dt.dmax=32768,Dt.head=null,Dt.hold=0,Dt.bits=0,Dt.lencode=Dt.lendyn=new n.Buf32(pt),Dt.distcode=Dt.distdyn=new n.Buf32(_t),Dt.sane=1,Dt.back=-1,f)}function Ot(Et){var Dt;return!Et||!Et.state?g:(Dt=Et.state,Dt.wsize=0,Dt.whave=0,Dt.wnext=0,Nt(Et))}function qt(Et,Dt){var et,Ut;return!Et||!Et.state||(Ut=Et.state,Dt<0?(et=0,Dt=-Dt):(et=(Dt>>4)+1,Dt<48&&(Dt&=15)),Dt&&(Dt<8||Dt>15))?g:(Ut.window!==null&&Ut.wbits!==Dt&&(Ut.window=null),Ut.wrap=et,Ut.wbits=Dt,Ot(Et))}function Jt(Et,Dt){var et,Ut;return Et?(Ut=new $t,Et.state=Ut,Ut.window=null,et=qt(Et,Dt),et!==f&&(Et.state=null),et):g}function te(Et){return Jt(Et,gt)}var O=!0,v,E;function B(Et){if(O){var Dt;for(v=new n.Buf32(512),E=new n.Buf32(32),Dt=0;Dt<144;)Et.lens[Dt++]=8;for(;Dt<256;)Et.lens[Dt++]=9;for(;Dt<280;)Et.lens[Dt++]=7;for(;Dt<288;)Et.lens[Dt++]=8;for(i(a,Et.lens,0,288,v,0,Et.work,{bits:9}),Dt=0;Dt<32;)Et.lens[Dt++]=5;i(o,Et.lens,0,32,E,0,Et.work,{bits:5}),O=!1}Et.lencode=v,Et.lenbits=9,Et.distcode=E,Et.distbits=5}function it(Et,Dt,et,Ut){var oe,U=Et.state;return U.window===null&&(U.wsize=1<<U.wbits,U.wnext=0,U.whave=0,U.window=new n.Buf8(U.wsize)),Ut>=U.wsize?(n.arraySet(U.window,Dt,et-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(oe=U.wsize-U.wnext,oe>Ut&&(oe=Ut),n.arraySet(U.window,Dt,et-Ut,oe,U.wnext),Ut-=oe,Ut?(n.arraySet(U.window,Dt,et-Ut,Ut,0),U.wnext=Ut,U.whave=U.wsize):(U.wnext+=oe,U.wnext===U.wsize&&(U.wnext=0),U.whave<U.wsize&&(U.whave+=oe))),0}function k(Et,Dt){var et,Ut,oe,U,Mt,Ht,dt,It,Ft,de,ut,yt,Wt,jt,Zt=0,be,He,Oe,Br,ma,Es,dr,En,en=new n.Buf8(4),cr,yr,ri=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Et||!Et.state||!Et.output||!Et.input&&Et.avail_in!==0)return g;et=Et.state,et.mode===q&&(et.mode=nt),Mt=Et.next_out,oe=Et.output,dt=Et.avail_out,U=Et.next_in,Ut=Et.input,Ht=Et.avail_in,It=et.hold,Ft=et.bits,de=Ht,ut=dt,En=f;t:for(;;)switch(et.mode){case A:if(et.wrap===0){et.mode=nt;break}for(;Ft<16;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}if(et.wrap&2&&It===35615){et.check=0,en[0]=It&255,en[1]=It>>>8&255,et.check=e(et.check,en,2,0),It=0,Ft=0,et.mode=_;break}if(et.flags=0,et.head&&(et.head.done=!1),!(et.wrap&1)||(((It&255)<<8)+(It>>8))%31){Et.msg="incorrect header check",et.mode=Q;break}if((It&15)!==w){Et.msg="unknown compression method",et.mode=Q;break}if(It>>>=4,Ft-=4,dr=(It&15)+8,et.wbits===0)et.wbits=dr;else if(dr>et.wbits){Et.msg="invalid window size",et.mode=Q;break}et.dmax=1<<dr,Et.adler=et.check=1,et.mode=It&512?L:q,It=0,Ft=0;break;case _:for(;Ft<16;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}if(et.flags=It,(et.flags&255)!==w){Et.msg="unknown compression method",et.mode=Q;break}if(et.flags&57344){Et.msg="unknown header flags set",et.mode=Q;break}et.head&&(et.head.text=It>>8&1),et.flags&512&&(en[0]=It&255,en[1]=It>>>8&255,et.check=e(et.check,en,2,0)),It=0,Ft=0,et.mode=S;case S:for(;Ft<32;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}et.head&&(et.head.time=It),et.flags&512&&(en[0]=It&255,en[1]=It>>>8&255,en[2]=It>>>16&255,en[3]=It>>>24&255,et.check=e(et.check,en,4,0)),It=0,Ft=0,et.mode=I;case I:for(;Ft<16;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}et.head&&(et.head.xflags=It&255,et.head.os=It>>8),et.flags&512&&(en[0]=It&255,en[1]=It>>>8&255,et.check=e(et.check,en,2,0)),It=0,Ft=0,et.mode=C;case C:if(et.flags&1024){for(;Ft<16;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}et.length=It,et.head&&(et.head.extra_len=It),et.flags&512&&(en[0]=It&255,en[1]=It>>>8&255,et.check=e(et.check,en,2,0)),It=0,Ft=0}else et.head&&(et.head.extra=null);et.mode=M;case M:if(et.flags&1024&&(yt=et.length,yt>Ht&&(yt=Ht),yt&&(et.head&&(dr=et.head.extra_len-et.length,et.head.extra||(et.head.extra=new Array(et.head.extra_len)),n.arraySet(et.head.extra,Ut,U,yt,dr)),et.flags&512&&(et.check=e(et.check,Ut,yt,U)),Ht-=yt,U+=yt,et.length-=yt),et.length))break t;et.length=0,et.mode=z;case z:if(et.flags&2048){if(Ht===0)break t;yt=0;do dr=Ut[U+yt++],et.head&&dr&&et.length<65536&&(et.head.name+=String.fromCharCode(dr));while(dr&&yt<Ht);if(et.flags&512&&(et.check=e(et.check,Ut,yt,U)),Ht-=yt,U+=yt,dr)break t}else et.head&&(et.head.name=null);et.length=0,et.mode=G;case G:if(et.flags&4096){if(Ht===0)break t;yt=0;do dr=Ut[U+yt++],et.head&&dr&&et.length<65536&&(et.head.comment+=String.fromCharCode(dr));while(dr&&yt<Ht);if(et.flags&512&&(et.check=e(et.check,Ut,yt,U)),Ht-=yt,U+=yt,dr)break t}else et.head&&(et.head.comment=null);et.mode=Y;case Y:if(et.flags&512){for(;Ft<16;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}if(It!==(et.check&65535)){Et.msg="header crc mismatch",et.mode=Q;break}It=0,Ft=0}et.head&&(et.head.hcrc=et.flags>>9&1,et.head.done=!0),Et.adler=et.check=0,et.mode=q;break;case L:for(;Ft<32;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}Et.adler=et.check=xt(It),It=0,Ft=0,et.mode=j;case j:if(et.havedict===0)return Et.next_out=Mt,Et.avail_out=dt,Et.next_in=U,Et.avail_in=Ht,et.hold=It,et.bits=Ft,p;Et.adler=et.check=1,et.mode=q;case q:if(Dt===u||Dt===h)break t;case nt:if(et.last){It>>>=Ft&7,Ft-=Ft&7,et.mode=st;break}for(;Ft<3;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}switch(et.last=It&1,It>>>=1,Ft-=1,It&3){case 0:et.mode=J;break;case 1:if(B(et),et.mode=$,Dt===h){It>>>=2,Ft-=2;break t}break;case 2:et.mode=F;break;case 3:Et.msg="invalid block type",et.mode=Q}It>>>=2,Ft-=2;break;case J:for(It>>>=Ft&7,Ft-=Ft&7;Ft<32;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}if((It&65535)!==(It>>>16^65535)){Et.msg="invalid stored block lengths",et.mode=Q;break}if(et.length=It&65535,It=0,Ft=0,et.mode=N,Dt===h)break t;case N:et.mode=D;case D:if(yt=et.length,yt){if(yt>Ht&&(yt=Ht),yt>dt&&(yt=dt),yt===0)break t;n.arraySet(oe,Ut,U,yt,Mt),Ht-=yt,U+=yt,dt-=yt,Mt+=yt,et.length-=yt;break}et.mode=q;break;case F:for(;Ft<14;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}if(et.nlen=(It&31)+257,It>>>=5,Ft-=5,et.ndist=(It&31)+1,It>>>=5,Ft-=5,et.ncode=(It&15)+4,It>>>=4,Ft-=4,et.nlen>286||et.ndist>30){Et.msg="too many length or distance symbols",et.mode=Q;break}et.have=0,et.mode=P;case P:for(;et.have<et.ncode;){for(;Ft<3;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}et.lens[ri[et.have++]]=It&7,It>>>=3,Ft-=3}for(;et.have<19;)et.lens[ri[et.have++]]=0;if(et.lencode=et.lendyn,et.lenbits=7,cr={bits:et.lenbits},En=i(s,et.lens,0,19,et.lencode,0,et.work,cr),et.lenbits=cr.bits,En){Et.msg="invalid code lengths set",et.mode=Q;break}et.have=0,et.mode=V;case V:for(;et.have<et.nlen+et.ndist;){for(;Zt=et.lencode[It&(1<<et.lenbits)-1],be=Zt>>>24,He=Zt>>>16&255,Oe=Zt&65535,!(be<=Ft);){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}if(Oe<16)It>>>=be,Ft-=be,et.lens[et.have++]=Oe;else{if(Oe===16){for(yr=be+2;Ft<yr;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}if(It>>>=be,Ft-=be,et.have===0){Et.msg="invalid bit length repeat",et.mode=Q;break}dr=et.lens[et.have-1],yt=3+(It&3),It>>>=2,Ft-=2}else if(Oe===17){for(yr=be+3;Ft<yr;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}It>>>=be,Ft-=be,dr=0,yt=3+(It&7),It>>>=3,Ft-=3}else{for(yr=be+7;Ft<yr;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}It>>>=be,Ft-=be,dr=0,yt=11+(It&127),It>>>=7,Ft-=7}if(et.have+yt>et.nlen+et.ndist){Et.msg="invalid bit length repeat",et.mode=Q;break}for(;yt--;)et.lens[et.have++]=dr}}if(et.mode===Q)break;if(et.lens[256]===0){Et.msg="invalid code -- missing end-of-block",et.mode=Q;break}if(et.lenbits=9,cr={bits:et.lenbits},En=i(a,et.lens,0,et.nlen,et.lencode,0,et.work,cr),et.lenbits=cr.bits,En){Et.msg="invalid literal/lengths set",et.mode=Q;break}if(et.distbits=6,et.distcode=et.distdyn,cr={bits:et.distbits},En=i(o,et.lens,et.nlen,et.ndist,et.distcode,0,et.work,cr),et.distbits=cr.bits,En){Et.msg="invalid distances set",et.mode=Q;break}if(et.mode=$,Dt===h)break t;case $:et.mode=H;case H:if(Ht>=6&&dt>=258){Et.next_out=Mt,Et.avail_out=dt,Et.next_in=U,Et.avail_in=Ht,et.hold=It,et.bits=Ft,r(Et,ut),Mt=Et.next_out,oe=Et.output,dt=Et.avail_out,U=Et.next_in,Ut=Et.input,Ht=Et.avail_in,It=et.hold,Ft=et.bits,et.mode===q&&(et.back=-1);break}for(et.back=0;Zt=et.lencode[It&(1<<et.lenbits)-1],be=Zt>>>24,He=Zt>>>16&255,Oe=Zt&65535,!(be<=Ft);){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}if(He&&(He&240)===0){for(Br=be,ma=He,Es=Oe;Zt=et.lencode[Es+((It&(1<<Br+ma)-1)>>Br)],be=Zt>>>24,He=Zt>>>16&255,Oe=Zt&65535,!(Br+be<=Ft);){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}It>>>=Br,Ft-=Br,et.back+=Br}if(It>>>=be,Ft-=be,et.back+=be,et.length=Oe,He===0){et.mode=X;break}if(He&32){et.back=-1,et.mode=q;break}if(He&64){Et.msg="invalid literal/length code",et.mode=Q;break}et.extra=He&15,et.mode=rt;case rt:if(et.extra){for(yr=et.extra;Ft<yr;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}et.length+=It&(1<<et.extra)-1,It>>>=et.extra,Ft-=et.extra,et.back+=et.extra}et.was=et.length,et.mode=lt;case lt:for(;Zt=et.distcode[It&(1<<et.distbits)-1],be=Zt>>>24,He=Zt>>>16&255,Oe=Zt&65535,!(be<=Ft);){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}if((He&240)===0){for(Br=be,ma=He,Es=Oe;Zt=et.distcode[Es+((It&(1<<Br+ma)-1)>>Br)],be=Zt>>>24,He=Zt>>>16&255,Oe=Zt&65535,!(Br+be<=Ft);){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}It>>>=Br,Ft-=Br,et.back+=Br}if(It>>>=be,Ft-=be,et.back+=be,He&64){Et.msg="invalid distance code",et.mode=Q;break}et.offset=Oe,et.extra=He&15,et.mode=ft;case ft:if(et.extra){for(yr=et.extra;Ft<yr;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}et.offset+=It&(1<<et.extra)-1,It>>>=et.extra,Ft-=et.extra,et.back+=et.extra}if(et.offset>et.dmax){Et.msg="invalid distance too far back",et.mode=Q;break}et.mode=K;case K:if(dt===0)break t;if(yt=ut-dt,et.offset>yt){if(yt=et.offset-yt,yt>et.whave&&et.sane){Et.msg="invalid distance too far back",et.mode=Q;break}yt>et.wnext?(yt-=et.wnext,Wt=et.wsize-yt):Wt=et.wnext-yt,yt>et.length&&(yt=et.length),jt=et.window}else jt=oe,Wt=Mt-et.offset,yt=et.length;yt>dt&&(yt=dt),dt-=yt,et.length-=yt;do oe[Mt++]=jt[Wt++];while(--yt);et.length===0&&(et.mode=H);break;case X:if(dt===0)break t;oe[Mt++]=et.length,dt--,et.mode=H;break;case st:if(et.wrap){for(;Ft<32;){if(Ht===0)break t;Ht--,It|=Ut[U++]<<Ft,Ft+=8}if(ut-=dt,Et.total_out+=ut,et.total+=ut,ut&&(Et.adler=et.check=et.flags?e(et.check,oe,ut,Mt-ut):t(et.check,oe,ut,Mt-ut)),ut=dt,(et.flags?It:xt(It))!==et.check){Et.msg="incorrect data check",et.mode=Q;break}It=0,Ft=0}et.mode=bt;case bt:if(et.wrap&&et.flags){for(;Ft<32;){if(Ht===0)break t;Ht--,It+=Ut[U++]<<Ft,Ft+=8}if(It!==(et.total&4294967295)){Et.msg="incorrect length check",et.mode=Q;break}It=0,Ft=0}et.mode=wt;case wt:En=d;break t;case Q:En=y;break t;case W:return b;case at:default:return g}return Et.next_out=Mt,Et.avail_out=dt,Et.next_in=U,Et.avail_in=Ht,et.hold=It,et.bits=Ft,(et.wsize||ut!==Et.avail_out&&et.mode<Q&&(et.mode<st||Dt!==c))&&it(Et,Et.output,Et.next_out,ut-Et.avail_out),de-=Et.avail_in,ut-=Et.avail_out,Et.total_in+=de,Et.total_out+=ut,et.total+=ut,et.wrap&&ut&&(Et.adler=et.check=et.flags?e(et.check,oe,ut,Et.next_out-ut):t(et.check,oe,ut,Et.next_out-ut)),Et.data_type=et.bits+(et.last?64:0)+(et.mode===q?128:0)+(et.mode===$||et.mode===N?256:0),(de===0&&ut===0||Dt===c)&&En===f&&(En=m),En}function ct(Et){if(!Et||!Et.state)return g;var Dt=Et.state;return Dt.window&&(Dt.window=null),Et.state=null,f}function mt(Et,Dt){var et;return!Et||!Et.state||(et=Et.state,(et.wrap&2)===0)?g:(et.head=Dt,Dt.done=!1,f)}function St(Et,Dt){var et=Dt.length,Ut,oe,U;return!Et||!Et.state||(Ut=Et.state,Ut.wrap!==0&&Ut.mode!==j)?g:Ut.mode===j&&(oe=1,oe=t(oe,Dt,et,0),oe!==Ut.check)?y:(U=it(Et,Dt,et,et),U?(Ut.mode=W,b):(Ut.havedict=1,f))}return _o.inflateReset=Ot,_o.inflateReset2=qt,_o.inflateResetKeep=Nt,_o.inflateInit=te,_o.inflateInit2=Jt,_o.inflate=k,_o.inflateEnd=ct,_o.inflateGetHeader=mt,_o.inflateSetDictionary=St,_o.inflateInfo="pako inflate (from Nodeca project)",_o}function uat(){return _z||(_z=!0,Dk={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}),Dk}function hat(){if(Tz)return Qt;Tz=!0;var n=vi().Buffer,t=$n,e=ve,r=nat(),i=aat(),s=cat(),a=uat();for(var o in a)Qt[o]=a[o];Qt.NONE=0,Qt.DEFLATE=1,Qt.INFLATE=2,Qt.GZIP=3,Qt.GUNZIP=4,Qt.DEFLATERAW=5,Qt.INFLATERAW=6,Qt.UNZIP=7;var c=31,u=139;function h(f){if(typeof f!="number"||f<Qt.DEFLATE||f>Qt.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=f,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}return h.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,e(this.init_done,"close before init"),e(this.mode<=Qt.UNZIP),this.mode===Qt.DEFLATE||this.mode===Qt.GZIP||this.mode===Qt.DEFLATERAW?i.deflateEnd(this.strm):(this.mode===Qt.INFLATE||this.mode===Qt.GUNZIP||this.mode===Qt.INFLATERAW||this.mode===Qt.UNZIP)&&s.inflateEnd(this.strm),this.mode=Qt.NONE,this.dictionary=null},h.prototype.write=function(f,d,p,g,y,b,m){return this._write(!0,f,d,p,g,y,b,m)},h.prototype.writeSync=function(f,d,p,g,y,b,m){return this._write(!1,f,d,p,g,y,b,m)},h.prototype._write=function(f,d,p,g,y,b,m,w){if(e.equal(arguments.length,8),e(this.init_done,"write before init"),e(this.mode!==Qt.NONE,"already finalized"),e.equal(!1,this.write_in_progress,"write already in progress"),e.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,e.equal(!1,d===void 0,"must provide flush value"),this.write_in_progress=!0,d!==Qt.Z_NO_FLUSH&&d!==Qt.Z_PARTIAL_FLUSH&&d!==Qt.Z_SYNC_FLUSH&&d!==Qt.Z_FULL_FLUSH&&d!==Qt.Z_FINISH&&d!==Qt.Z_BLOCK)throw new Error("Invalid flush value");if(p==null&&(p=n.alloc(0),y=0,g=0),this.strm.avail_in=y,this.strm.input=p,this.strm.next_in=g,this.strm.avail_out=w,this.strm.output=b,this.strm.next_out=m,this.flush=d,!f)return this._process(),this._checkError()?this._afterSync():void 0;var A=this;return t.nextTick(function(){A._process(),A._after()}),this},h.prototype._afterSync=function(){var f=this.strm.avail_out,d=this.strm.avail_in;return this.write_in_progress=!1,[d,f]},h.prototype._process=function(){var f=null;switch(this.mode){case Qt.DEFLATE:case Qt.GZIP:case Qt.DEFLATERAW:this.err=i.deflate(this.strm,this.flush);break;case Qt.UNZIP:switch(this.strm.avail_in>0&&(f=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(f===null)break;if(this.strm.input[f]===c){if(this.gzip_id_bytes_read=1,f++,this.strm.avail_in===1)break}else{this.mode=Qt.INFLATE;break}case 1:if(f===null)break;this.strm.input[f]===u?(this.gzip_id_bytes_read=2,this.mode=Qt.GUNZIP):this.mode=Qt.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case Qt.INFLATE:case Qt.GUNZIP:case Qt.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===Qt.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===Qt.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===Qt.Z_DATA_ERROR&&(this.err=Qt.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===Qt.GUNZIP&&this.err===Qt.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},h.prototype._checkError=function(){switch(this.err){case Qt.Z_OK:case Qt.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===Qt.Z_FINISH)return this._error("unexpected end of file"),!1;break;case Qt.Z_STREAM_END:break;case Qt.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},h.prototype._after=function(){if(this._checkError()){var f=this.strm.avail_out,d=this.strm.avail_in;this.write_in_progress=!1,this.callback(d,f),this.pending_close&&this.close()}},h.prototype._error=function(f){this.strm.msg&&(f=this.strm.msg),this.onerror(f,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},h.prototype.init=function(f,d,p,g,y){e(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),e(f>=8&&f<=15,"invalid windowBits"),e(d>=-1&&d<=9,"invalid compression level"),e(p>=1&&p<=9,"invalid memlevel"),e(g===Qt.Z_FILTERED||g===Qt.Z_HUFFMAN_ONLY||g===Qt.Z_RLE||g===Qt.Z_FIXED||g===Qt.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(d,f,p,g,y),this._setDictionary()},h.prototype.params=function(){throw new Error("deflateParams Not supported")},h.prototype.reset=function(){this._reset(),this._setDictionary()},h.prototype._init=function(f,d,p,g,y){switch(this.level=f,this.windowBits=d,this.memLevel=p,this.strategy=g,this.flush=Qt.Z_NO_FLUSH,this.err=Qt.Z_OK,(this.mode===Qt.GZIP||this.mode===Qt.GUNZIP)&&(this.windowBits+=16),this.mode===Qt.UNZIP&&(this.windowBits+=32),(this.mode===Qt.DEFLATERAW||this.mode===Qt.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new r,this.mode){case Qt.DEFLATE:case Qt.GZIP:case Qt.DEFLATERAW:this.err=i.deflateInit2(this.strm,this.level,Qt.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case Qt.INFLATE:case Qt.GUNZIP:case Qt.INFLATERAW:case Qt.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==Qt.Z_OK&&this._error("Init error"),this.dictionary=y,this.write_in_progress=!1,this.init_done=!0},h.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=Qt.Z_OK,this.mode){case Qt.DEFLATE:case Qt.DEFLATERAW:this.err=i.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==Qt.Z_OK&&this._error("Failed to set dictionary")}},h.prototype._reset=function(){switch(this.err=Qt.Z_OK,this.mode){case Qt.DEFLATE:case Qt.DEFLATERAW:case Qt.GZIP:this.err=i.deflateReset(this.strm);break;case Qt.INFLATE:case Qt.INFLATERAW:case Qt.GUNZIP:this.err=s.inflateReset(this.strm);break}this.err!==Qt.Z_OK&&this._error("Failed to reset stream")},Qt.Zlib=h,Qt}function fat(){if(Cz)return ye;Cz=!0;var n=$n,t=vi().Buffer,e=Ws.Transform,r=hat(),i=zt,s=ve.ok,a=vi().kMaxLength,o="Cannot create final Buffer. It would be larger than 0x"+a.toString(16)+" bytes";r.Z_MIN_WINDOWBITS=8,r.Z_MAX_WINDOWBITS=15,r.Z_DEFAULT_WINDOWBITS=15,r.Z_MIN_CHUNK=64,r.Z_MAX_CHUNK=1/0,r.Z_DEFAULT_CHUNK=16*1024,r.Z_MIN_MEMLEVEL=1,r.Z_MAX_MEMLEVEL=9,r.Z_DEFAULT_MEMLEVEL=8,r.Z_MIN_LEVEL=-1,r.Z_MAX_LEVEL=9,r.Z_DEFAULT_LEVEL=r.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(r),u=0;u<c.length;u++){var h=c[u];h.match(/^Z/)&&Object.defineProperty(ye,h,{enumerable:!0,value:r[h],writable:!1})}for(var f={Z_OK:r.Z_OK,Z_STREAM_END:r.Z_STREAM_END,Z_NEED_DICT:r.Z_NEED_DICT,Z_ERRNO:r.Z_ERRNO,Z_STREAM_ERROR:r.Z_STREAM_ERROR,Z_DATA_ERROR:r.Z_DATA_ERROR,Z_MEM_ERROR:r.Z_MEM_ERROR,Z_BUF_ERROR:r.Z_BUF_ERROR,Z_VERSION_ERROR:r.Z_VERSION_ERROR},d=Object.keys(f),p=0;p<d.length;p++){var g=d[p];f[f[g]]=g}Object.defineProperty(ye,"codes",{enumerable:!0,value:Object.freeze(f),writable:!1}),ye.Deflate=m,ye.Inflate=w,ye.Gzip=A,ye.Gunzip=_,ye.DeflateRaw=S,ye.InflateRaw=I,ye.Unzip=C,ye.createDeflate=function(L){return new m(L)},ye.createInflate=function(L){return new w(L)},ye.createDeflateRaw=function(L){return new S(L)},ye.createInflateRaw=function(L){return new I(L)},ye.createGzip=function(L){return new A(L)},ye.createGunzip=function(L){return new _(L)},ye.createUnzip=function(L){return new C(L)},ye.deflate=function(L,j,q){return typeof j=="function"&&(q=j,j={}),y(new m(j),L,q)},ye.deflateSync=function(L,j){return b(new m(j),L)},ye.gzip=function(L,j,q){return typeof j=="function"&&(q=j,j={}),y(new A(j),L,q)},ye.gzipSync=function(L,j){return b(new A(j),L)},ye.deflateRaw=function(L,j,q){return typeof j=="function"&&(q=j,j={}),y(new S(j),L,q)},ye.deflateRawSync=function(L,j){return b(new S(j),L)},ye.unzip=function(L,j,q){return typeof j=="function"&&(q=j,j={}),y(new C(j),L,q)},ye.unzipSync=function(L,j){return b(new C(j),L)},ye.inflate=function(L,j,q){return typeof j=="function"&&(q=j,j={}),y(new w(j),L,q)},ye.inflateSync=function(L,j){return b(new w(j),L)},ye.gunzip=function(L,j,q){return typeof j=="function"&&(q=j,j={}),y(new _(j),L,q)},ye.gunzipSync=function(L,j){return b(new _(j),L)},ye.inflateRaw=function(L,j,q){return typeof j=="function"&&(q=j,j={}),y(new I(j),L,q)},ye.inflateRawSync=function(L,j){return b(new I(j),L)};function y(L,j,q){var nt=[],J=0;L.on("error",D),L.on("end",F),L.end(j),N();function N(){for(var P;(P=L.read())!==null;)nt.push(P),J+=P.length;L.once("readable",N)}function D(P){L.removeListener("end",F),L.removeListener("readable",N),q(P)}function F(){var P,V=null;J>=a?V=new RangeError(o):P=t.concat(nt,J),nt=[],L.close(),q(V,P)}}function b(L,j){if(typeof j=="string"&&(j=t.from(j)),!t.isBuffer(j))throw new TypeError("Not a string or buffer");var q=L._finishFlushFlag;return L._processChunk(j,q)}function m(L){if(!(this instanceof m))return new m(L);z.call(this,L,r.DEFLATE)}function w(L){if(!(this instanceof w))return new w(L);z.call(this,L,r.INFLATE)}function A(L){if(!(this instanceof A))return new A(L);z.call(this,L,r.GZIP)}function _(L){if(!(this instanceof _))return new _(L);z.call(this,L,r.GUNZIP)}function S(L){if(!(this instanceof S))return new S(L);z.call(this,L,r.DEFLATERAW)}function I(L){if(!(this instanceof I))return new I(L);z.call(this,L,r.INFLATERAW)}function C(L){if(!(this instanceof C))return new C(L);z.call(this,L,r.UNZIP)}function M(L){return L===r.Z_NO_FLUSH||L===r.Z_PARTIAL_FLUSH||L===r.Z_SYNC_FLUSH||L===r.Z_FULL_FLUSH||L===r.Z_FINISH||L===r.Z_BLOCK}function z(L,j){var q=this;if(this._opts=L=L||{},this._chunkSize=L.chunkSize||ye.Z_DEFAULT_CHUNK,e.call(this,L),L.flush&&!M(L.flush))throw new Error("Invalid flush flag: "+L.flush);if(L.finishFlush&&!M(L.finishFlush))throw new Error("Invalid flush flag: "+L.finishFlush);if(this._flushFlag=L.flush||r.Z_NO_FLUSH,this._finishFlushFlag=typeof L.finishFlush<"u"?L.finishFlush:r.Z_FINISH,L.chunkSize&&(L.chunkSize<ye.Z_MIN_CHUNK||L.chunkSize>ye.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+L.chunkSize);if(L.windowBits&&(L.windowBits<ye.Z_MIN_WINDOWBITS||L.windowBits>ye.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+L.windowBits);if(L.level&&(L.level<ye.Z_MIN_LEVEL||L.level>ye.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+L.level);if(L.memLevel&&(L.memLevel<ye.Z_MIN_MEMLEVEL||L.memLevel>ye.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+L.memLevel);if(L.strategy&&L.strategy!=ye.Z_FILTERED&&L.strategy!=ye.Z_HUFFMAN_ONLY&&L.strategy!=ye.Z_RLE&&L.strategy!=ye.Z_FIXED&&L.strategy!=ye.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+L.strategy);if(L.dictionary&&!t.isBuffer(L.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new r.Zlib(j);var nt=this;this._hadError=!1,this._handle.onerror=function(D,F){G(nt),nt._hadError=!0;var P=new Error(D);P.errno=F,P.code=ye.codes[F],nt.emit("error",P)};var J=ye.Z_DEFAULT_COMPRESSION;typeof L.level=="number"&&(J=L.level);var N=ye.Z_DEFAULT_STRATEGY;typeof L.strategy=="number"&&(N=L.strategy),this._handle.init(L.windowBits||ye.Z_DEFAULT_WINDOWBITS,J,L.memLevel||ye.Z_DEFAULT_MEMLEVEL,N,L.dictionary),this._buffer=t.allocUnsafe(this._chunkSize),this._offset=0,this._level=J,this._strategy=N,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!q._handle},configurable:!0,enumerable:!0})}i.inherits(z,e),z.prototype.params=function(L,j,q){if(L<ye.Z_MIN_LEVEL||L>ye.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+L);if(j!=ye.Z_FILTERED&&j!=ye.Z_HUFFMAN_ONLY&&j!=ye.Z_RLE&&j!=ye.Z_FIXED&&j!=ye.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+j);if(this._level!==L||this._strategy!==j){var nt=this;this.flush(r.Z_SYNC_FLUSH,function(){s(nt._handle,"zlib binding closed"),nt._handle.params(L,j),nt._hadError||(nt._level=L,nt._strategy=j,q&&q())})}else n.nextTick(q)},z.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},z.prototype._flush=function(L){this._transform(t.alloc(0),"",L)},z.prototype.flush=function(L,j){var q=this,nt=this._writableState;(typeof L=="function"||L===void 0&&!j)&&(j=L,L=r.Z_FULL_FLUSH),nt.ended?j&&n.nextTick(j):nt.ending?j&&this.once("end",j):nt.needDrain?j&&this.once("drain",function(){return q.flush(L,j)}):(this._flushFlag=L,this.write(t.alloc(0),"",j))},z.prototype.close=function(L){G(this,L),n.nextTick(Y,this)};function G(L,j){j&&n.nextTick(j),L._handle&&(L._handle.close(),L._handle=null)}function Y(L){L.emit("close")}return z.prototype._transform=function(L,j,q){var nt,J=this._writableState,N=J.ending||J.ended,D=N&&(!L||J.length===L.length);if(L!==null&&!t.isBuffer(L))return q(new Error("invalid input"));if(!this._handle)return q(new Error("zlib binding closed"));D?nt=this._finishFlushFlag:(nt=this._flushFlag,L.length>=J.length&&(this._flushFlag=this._opts.flush||r.Z_NO_FLUSH)),this._processChunk(L,nt,q)},z.prototype._processChunk=function(L,j,q){var nt=L&&L.length,J=this._chunkSize-this._offset,N=0,D=this,F=typeof q=="function";if(!F){var P=[],V=0,$;this.on("error",function(K){$=K}),s(this._handle,"zlib binding closed");do var H=this._handle.writeSync(j,L,N,nt,this._buffer,this._offset,J);while(!this._hadError&&ft(H[0],H[1]));if(this._hadError)throw $;if(V>=a)throw G(this),new RangeError(o);var rt=t.concat(P,V);return G(this),rt}s(this._handle,"zlib binding closed");var lt=this._handle.write(j,L,N,nt,this._buffer,this._offset,J);lt.buffer=L,lt.callback=ft;function ft(K,X){if(this&&(this.buffer=null,this.callback=null),!D._hadError){var st=J-X;if(s(st>=0,"have should not go down"),st>0){var bt=D._buffer.slice(D._offset,D._offset+st);D._offset+=st,F?D.push(bt):(P.push(bt),V+=bt.length)}if((X===0||D._offset>=D._chunkSize)&&(J=D._chunkSize,D._offset=0,D._buffer=t.allocUnsafe(D._chunkSize)),X===0){if(N+=nt-K,nt=K,!F)return!0;var wt=D._handle.write(j,L,N,nt,D._buffer,D._offset,D._chunkSize);wt.callback=ft,wt.buffer=L;return}if(!F)return!1;q()}}},i.inherits(m,z),i.inherits(w,z),i.inherits(A,z),i.inherits(_,z),i.inherits(S,z),i.inherits(I,z),i.inherits(C,z),ye}var Sk,gz,ss,mz,fg,yz,_k,bz,Tk,vz,Ck,wz,ml,Az,Rk,Ez,Ik,xz,_o,Sz,Dk,_z,Qt,Tz,ye,Cz,Yt,dat,pat,gat,mat,yat,bat,vat,wat,Aat,Eat,xat,Sat,_at,Tat,Cat,Rat,Iat,Dat,Oat,Pat,Nat,Lat,kat,Mat,Fat,Bat,Uat,jat,$at,Hat,zat,Wat,Gat,Vat,Xat,qat,Yat,Kat,Zat,Jat,Qat,tot,eot,rot,not,iot,sot,aot,oot,lot,cot,uot,hot,fot,dot,pot,got,mot,yot,bot,vot,wot,Aot,Eot,xot,Sot,_ot,Tot,Cot,Oz=br(()=>{Tt();Rt();Ct();C0();ZN();sN();Jp();dC();Of();mC();B0();SC();N0();Sk={},gz=!1;ss={},mz=!1;fg={},yz=!1;_k={},bz=!1;Tk={},vz=!1;Ck={},wz=!1;ml={},Az=!1;Rk={},Ez=!1;Ik={},xz=!1;_o={},Sz=!1;Dk={},_z=!1;Qt={},Tz=!1;ye={},Cz=!1;Yt=fat();Yt.codes;Yt.Deflate;Yt.Inflate;Yt.Gzip;Yt.Gunzip;Yt.DeflateRaw;Yt.InflateRaw;Yt.Unzip;Yt.createDeflate;Yt.createInflate;Yt.createDeflateRaw;Yt.createInflateRaw;Yt.createGzip;Yt.createGunzip;Yt.createUnzip;Yt.deflate;Yt.deflateSync;Yt.gzip;Yt.gzipSync;Yt.deflateRaw;Yt.deflateRawSync;Yt.unzip;Yt.unzipSync;Yt.inflate;Yt.inflateSync;Yt.gunzip;Yt.gunzipSync;Yt.inflateRaw;Yt.inflateRawSync;dat=Yt.Deflate,pat=Yt.DeflateRaw,gat=Yt.Gunzip,mat=Yt.Gzip,yat=Yt.Inflate,bat=Yt.InflateRaw,vat=Yt.Unzip,wat=Yt.Z_BEST_COMPRESSION,Aat=Yt.Z_BEST_SPEED,Eat=Yt.Z_BINARY,xat=Yt.Z_BLOCK,Sat=Yt.Z_BUF_ERROR,_at=Yt.Z_DATA_ERROR,Tat=Yt.Z_DEFAULT_CHUNK,Cat=Yt.Z_DEFAULT_COMPRESSION,Rat=Yt.Z_DEFAULT_LEVEL,Iat=Yt.Z_DEFAULT_MEMLEVEL,Dat=Yt.Z_DEFAULT_STRATEGY,Oat=Yt.Z_DEFAULT_WINDOWBITS,Pat=Yt.Z_DEFLATED,Nat=Yt.Z_ERRNO,Lat=Yt.Z_FILTERED,kat=Yt.Z_FINISH,Mat=Yt.Z_FIXED,Fat=Yt.Z_FULL_FLUSH,Bat=Yt.Z_HUFFMAN_ONLY,Uat=Yt.Z_MAX_CHUNK,jat=Yt.Z_MAX_LEVEL,$at=Yt.Z_MAX_MEMLEVEL,Hat=Yt.Z_MAX_WINDOWBITS,zat=Yt.Z_MIN_CHUNK,Wat=Yt.Z_MIN_LEVEL,Gat=Yt.Z_MIN_MEMLEVEL,Vat=Yt.Z_MIN_WINDOWBITS,Xat=Yt.Z_NEED_DICT,qat=Yt.Z_NO_COMPRESSION,Yat=Yt.Z_NO_FLUSH,Kat=Yt.Z_OK,Zat=Yt.Z_PARTIAL_FLUSH,Jat=Yt.Z_RLE,Qat=Yt.Z_STREAM_END,tot=Yt.Z_STREAM_ERROR,eot=Yt.Z_SYNC_FLUSH,rot=Yt.Z_TEXT,not=Yt.Z_TREES,iot=Yt.Z_UNKNOWN,sot=Yt.Zlib,aot=Yt.codes,oot=Yt.createDeflate,lot=Yt.createDeflateRaw,cot=Yt.createGunzip,uot=Yt.createGzip,hot=Yt.createInflate,fot=Yt.createInflateRaw,dot=Yt.createUnzip,pot=Yt.deflate,got=Yt.deflateRaw,mot=Yt.deflateRawSync,yot=Yt.deflateSync,bot=Yt.gunzip,vot=Yt.gunzipSync,wot=Yt.gzip,Aot=Yt.gzipSync,Eot=Yt.inflate,xot=Yt.inflateRaw,Sot=Yt.inflateRawSync,_ot=Yt.inflateSync,Tot=Yt.unzip,Cot=Yt.unzipSync});function Nz(){return Pz||(Pz=!0,typeof Object.create=="function"?sR=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:sR=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}),sR}var sR,Pz,Ok=br(()=>{Tt();Rt();Ct();sR={},Pz=!1});var qE={};tc(qE,{TextDecoder:()=>hlt,TextEncoder:()=>ult,_extend:()=>jot,callbackify:()=>$ot,debuglog:()=>Hot,default:()=>we,deprecate:()=>zot,format:()=>Wot,inherits:()=>Got,inspect:()=>Vot,isArray:()=>Xot,isBoolean:()=>qot,isBuffer:()=>Yot,isDate:()=>Kot,isError:()=>Zot,isFunction:()=>Jot,isNull:()=>Qot,isNullOrUndefined:()=>tlt,isNumber:()=>elt,isObject:()=>rlt,isPrimitive:()=>nlt,isRegExp:()=>ilt,isString:()=>slt,isSymbol:()=>alt,isUndefined:()=>olt,log:()=>llt,promisify:()=>aR,types:()=>clt});function Hk(){if(Lz)return Pk;Lz=!0;var n=wL();return Pk=function(){return n()&&!!Symbol.toStringTag},Pk}function Rot(){if(kz)return Nk;kz=!0;var n=Hk()(),t=_E(),e=t("Object.prototype.toString"),r=function(o){return n&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:e(o)==="[object Arguments]"},i=function(o){return r(o)?!0:o!==null&&typeof o=="object"&&typeof o.length=="number"&&o.length>=0&&e(o)!=="[object Array]"&&e(o.callee)==="[object Function]"},s=(function(){return r(arguments)})();return r.isLegacyArguments=i,Nk=s?r:i,Nk}function Iot(){if(Mz)return Lk;Mz=!0;var n=Object.prototype.toString,t=Function.prototype.toString,e=/^\s*(?:function)?\*/,r=Hk()(),i=Object.getPrototypeOf,s=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},a;return Lk=function(c){if(typeof c!="function")return!1;if(e.test(t.call(c)))return!0;if(!r){var u=n.call(c);return u==="[object GeneratorFunction]"}if(!i)return!1;if(typeof a>"u"){var h=s();a=h?i(h):!1}return i(c)===a},Lk}function Dot(){if(Fz)return kk;Fz=!0;var n=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,e,r;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},t(function(){throw 42},null,e)}catch(w){w!==r&&(t=null)}else t=null;var i=/^\s*class\b/,s=function(A){try{var _=n.call(A);return i.test(_)}catch{return!1}},a=function(A){try{return s(A)?!1:(n.call(A),!0)}catch{return!1}},o=Object.prototype.toString,c="[object Object]",u="[object Function]",h="[object GeneratorFunction]",f="[object HTMLAllCollection]",d="[object HTML document.all class]",p="[object HTMLCollection]",g=typeof Symbol=="function"&&!!Symbol.toStringTag,y=!(0 in[,]),b=function(){return!1};if(typeof document=="object"){var m=document.all;o.call(m)===o.call(document.all)&&(b=function(A){if((y||!A)&&(typeof A>"u"||typeof A=="object"))try{var _=o.call(A);return(_===f||_===d||_===p||_===c)&&A("")==null}catch{}return!1})}return kk=t?function(A){if(b(A))return!0;if(!A||typeof A!="function"&&typeof A!="object")return!1;try{t(A,null,e)}catch(_){if(_!==r)return!1}return!s(A)&&a(A)}:function(A){if(b(A))return!0;if(!A||typeof A!="function"&&typeof A!="object")return!1;if(g)return a(A);if(s(A))return!1;var _=o.call(A);return _!==u&&_!==h&&!/^\[object HTML/.test(_)?!1:a(A)},kk}function Oot(){if(Bz)return Mk;Bz=!0;var n=Dot(),t=Object.prototype.toString,e=Object.prototype.hasOwnProperty,r=function(c,u,h){for(var f=0,d=c.length;f<d;f++)e.call(c,f)&&(h==null?u(c[f],f,c):u.call(h,c[f],f,c))},i=function(c,u,h){for(var f=0,d=c.length;f<d;f++)h==null?u(c.charAt(f),f,c):u.call(h,c.charAt(f),f,c)},s=function(c,u,h){for(var f in c)e.call(c,f)&&(h==null?u(c[f],f,c):u.call(h,c[f],f,c))},a=function(c,u,h){if(!n(u))throw new TypeError("iterator must be a function");var f;arguments.length>=3&&(f=h),t.call(c)==="[object Array]"?r(c,u,f):typeof c=="string"?i(c,u,f):s(c,u,f)};return Mk=a,Mk}function Pot(){return Uz||(Uz=!0,Fk=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Fk}function Lot(){if(jz)return Bk;jz=!0;var n=Pot(),t=typeof globalThis>"u"?Not:globalThis;return Bk=function(){for(var r=[],i=0;i<n.length;i++)typeof t[n[i]]=="function"&&(r[r.length]=n[i]);return r},Bk}function Vz(){if($z)return Uk;$z=!0;var n=Oot(),t=Lot(),e=xL(),r=_E(),i=_C(),s=r("Object.prototype.toString"),a=Hk()(),o=typeof globalThis>"u"?kot:globalThis,c=t(),u=r("String.prototype.slice"),h=Object.getPrototypeOf,f=r("Array.prototype.indexOf",!0)||function(b,m){for(var w=0;w<b.length;w+=1)if(b[w]===m)return w;return-1},d={__proto__:null};a&&i&&h?n(c,function(y){var b=new o[y];if(Symbol.toStringTag in b){var m=h(b),w=i(m,Symbol.toStringTag);if(!w){var A=h(m);w=i(A,Symbol.toStringTag)}d["$"+y]=e(w.get)}}):n(c,function(y){var b=new o[y],m=b.slice||b.set;m&&(d["$"+y]=e(m))});var p=function(b){var m=!1;return n(d,function(w,A){if(!m)try{"$"+w(b)===A&&(m=u(A,1))}catch{}}),m},g=function(b){var m=!1;return n(d,function(w,A){if(!m)try{w(b),m=u(A,1)}catch{}}),m};return Uk=function(b){if(!b||typeof b!="object")return!1;if(!a){var m=u(s(b),8,-1);return f(c,m)>-1?m:m!=="Object"?!1:g(b)}return i?p(b):null},Uk}function Mot(){if(Hz)return jk;Hz=!0;var n=Vz();return jk=function(e){return!!n(e)},jk}function Fot(){if(zz)return We;zz=!0;var n=Rot(),t=Iot(),e=Vz(),r=Mot();function i(gt){return gt.call.bind(gt)}var s=typeof BigInt<"u",a=typeof Symbol<"u",o=i(Object.prototype.toString),c=i(Number.prototype.valueOf),u=i(String.prototype.valueOf),h=i(Boolean.prototype.valueOf);if(s)var f=i(BigInt.prototype.valueOf);if(a)var d=i(Symbol.prototype.valueOf);function p(gt,xt){if(typeof gt!="object")return!1;try{return xt(gt),!0}catch{return!1}}We.isArgumentsObject=n,We.isGeneratorFunction=t,We.isTypedArray=r;function g(gt){return typeof Promise<"u"&&gt instanceof Promise||gt!==null&&typeof gt=="object"&&typeof gt.then=="function"&&typeof gt.catch=="function"}We.isPromise=g;function y(gt){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(gt):r(gt)||$(gt)}We.isArrayBufferView=y;function b(gt){return e(gt)==="Uint8Array"}We.isUint8Array=b;function m(gt){return e(gt)==="Uint8ClampedArray"}We.isUint8ClampedArray=m;function w(gt){return e(gt)==="Uint16Array"}We.isUint16Array=w;function A(gt){return e(gt)==="Uint32Array"}We.isUint32Array=A;function _(gt){return e(gt)==="Int8Array"}We.isInt8Array=_;function S(gt){return e(gt)==="Int16Array"}We.isInt16Array=S;function I(gt){return e(gt)==="Int32Array"}We.isInt32Array=I;function C(gt){return e(gt)==="Float32Array"}We.isFloat32Array=C;function M(gt){return e(gt)==="Float64Array"}We.isFloat64Array=M;function z(gt){return e(gt)==="BigInt64Array"}We.isBigInt64Array=z;function G(gt){return e(gt)==="BigUint64Array"}We.isBigUint64Array=G;function Y(gt){return o(gt)==="[object Map]"}Y.working=typeof Map<"u"&&Y(new Map);function L(gt){return typeof Map>"u"?!1:Y.working?Y(gt):gt instanceof Map}We.isMap=L;function j(gt){return o(gt)==="[object Set]"}j.working=typeof Set<"u"&&j(new Set);function q(gt){return typeof Set>"u"?!1:j.working?j(gt):gt instanceof Set}We.isSet=q;function nt(gt){return o(gt)==="[object WeakMap]"}nt.working=typeof WeakMap<"u"&&nt(new WeakMap);function J(gt){return typeof WeakMap>"u"?!1:nt.working?nt(gt):gt instanceof WeakMap}We.isWeakMap=J;function N(gt){return o(gt)==="[object WeakSet]"}N.working=typeof WeakSet<"u"&&N(new WeakSet);function D(gt){return N(gt)}We.isWeakSet=D;function F(gt){return o(gt)==="[object ArrayBuffer]"}F.working=typeof ArrayBuffer<"u"&&F(new ArrayBuffer);function P(gt){return typeof ArrayBuffer>"u"?!1:F.working?F(gt):gt instanceof ArrayBuffer}We.isArrayBuffer=P;function V(gt){return o(gt)==="[object DataView]"}V.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&V(new DataView(new ArrayBuffer(1),0,1));function $(gt){return typeof DataView>"u"?!1:V.working?V(gt):gt instanceof DataView}We.isDataView=$;var H=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function rt(gt){return o(gt)==="[object SharedArrayBuffer]"}function lt(gt){return typeof H>"u"?!1:(typeof rt.working>"u"&&(rt.working=rt(new H)),rt.working?rt(gt):gt instanceof H)}We.isSharedArrayBuffer=lt;function ft(gt){return o(gt)==="[object AsyncFunction]"}We.isAsyncFunction=ft;function K(gt){return o(gt)==="[object Map Iterator]"}We.isMapIterator=K;function X(gt){return o(gt)==="[object Set Iterator]"}We.isSetIterator=X;function st(gt){return o(gt)==="[object Generator]"}We.isGeneratorObject=st;function bt(gt){return o(gt)==="[object WebAssembly.Module]"}We.isWebAssemblyCompiledModule=bt;function wt(gt){return p(gt,c)}We.isNumberObject=wt;function Q(gt){return p(gt,u)}We.isStringObject=Q;function W(gt){return p(gt,h)}We.isBooleanObject=W;function at(gt){return s&&p(gt,f)}We.isBigIntObject=at;function pt(gt){return a&&p(gt,d)}We.isSymbolObject=pt;function _t(gt){return wt(gt)||Q(gt)||W(gt)||at(gt)||pt(gt)}We.isBoxedPrimitive=_t;function At(gt){return typeof Uint8Array<"u"&&(P(gt)||lt(gt))}return We.isAnyArrayBuffer=At,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(gt){Object.defineProperty(We,gt,{enumerable:!1,value:function(){throw new Error(gt+" is not supported in userland")}})}),We}function Bot(){return Wz||(Wz=!0,$k=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),$k}function Uot(){if(Gz)return Ge;Gz=!0;var n=$n,t=Object.getOwnPropertyDescriptors||function(H){for(var rt=Object.keys(H),lt={},ft=0;ft<rt.length;ft++)lt[rt[ft]]=Object.getOwnPropertyDescriptor(H,rt[ft]);return lt},e=/%[sdj%]/g;Ge.format=function($){if(!S($)){for(var H=[],rt=0;rt<arguments.length;rt++)H.push(a(arguments[rt]));return H.join(" ")}for(var rt=1,lt=arguments,ft=lt.length,K=String($).replace(e,function(st){if(st==="%%")return"%";if(rt>=ft)return st;switch(st){case"%s":return String(lt[rt++]);case"%d":return Number(lt[rt++]);case"%j":try{return JSON.stringify(lt[rt++])}catch{return"[Circular]"}default:return st}}),X=lt[rt];rt<ft;X=lt[++rt])w(X)||!z(X)?K+=" "+X:K+=" "+a(X);return K},Ge.deprecate=function($,H){if(typeof n<"u"&&n.noDeprecation===!0)return $;if(typeof n>"u")return function(){return Ge.deprecate($,H).apply(this||XE,arguments)};var rt=!1;function lt(){if(!rt){if(n.throwDeprecation)throw new Error(H);n.traceDeprecation?console.trace(H):console.error(H),rt=!0}return $.apply(this||XE,arguments)}return lt};var r={},i=/^$/;if(n.env.NODE_DEBUG){var s=n.env.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+s+"$","i")}Ge.debuglog=function($){if($=$.toUpperCase(),!r[$])if(i.test($)){var H=n.pid;r[$]=function(){var rt=Ge.format.apply(Ge,arguments);console.error("%s %d: %s",$,H,rt)}}else r[$]=function(){};return r[$]};function a($,H){var rt={seen:[],stylize:c};return arguments.length>=3&&(rt.depth=arguments[2]),arguments.length>=4&&(rt.colors=arguments[3]),m(H)?rt.showHidden=H:H&&Ge._extend(rt,H),C(rt.showHidden)&&(rt.showHidden=!1),C(rt.depth)&&(rt.depth=2),C(rt.colors)&&(rt.colors=!1),C(rt.customInspect)&&(rt.customInspect=!0),rt.colors&&(rt.stylize=o),h(rt,$,rt.depth)}Ge.inspect=a,a.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]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function o($,H){var rt=a.styles[H];return rt?"\x1B["+a.colors[rt][0]+"m"+$+"\x1B["+a.colors[rt][1]+"m":$}function c($,H){return $}function u($){var H={};return $.forEach(function(rt,lt){H[rt]=!0}),H}function h($,H,rt){if($.customInspect&&H&&L(H.inspect)&&H.inspect!==Ge.inspect&&!(H.constructor&&H.constructor.prototype===H)){var lt=H.inspect(rt,$);return S(lt)||(lt=h($,lt,rt)),lt}var ft=f($,H);if(ft)return ft;var K=Object.keys(H),X=u(K);if($.showHidden&&(K=Object.getOwnPropertyNames(H)),Y(H)&&(K.indexOf("message")>=0||K.indexOf("description")>=0))return d(H);if(K.length===0){if(L(H)){var st=H.name?": "+H.name:"";return $.stylize("[Function"+st+"]","special")}if(M(H))return $.stylize(RegExp.prototype.toString.call(H),"regexp");if(G(H))return $.stylize(Date.prototype.toString.call(H),"date");if(Y(H))return d(H)}var bt="",wt=!1,Q=["{","}"];if(b(H)&&(wt=!0,Q=["[","]"]),L(H)){var W=H.name?": "+H.name:"";bt=" [Function"+W+"]"}if(M(H)&&(bt=" "+RegExp.prototype.toString.call(H)),G(H)&&(bt=" "+Date.prototype.toUTCString.call(H)),Y(H)&&(bt=" "+d(H)),K.length===0&&(!wt||H.length==0))return Q[0]+bt+Q[1];if(rt<0)return M(H)?$.stylize(RegExp.prototype.toString.call(H),"regexp"):$.stylize("[Object]","special");$.seen.push(H);var at;return wt?at=p($,H,rt,X,K):at=K.map(function(pt){return g($,H,rt,X,pt,wt)}),$.seen.pop(),y(at,bt,Q)}function f($,H){if(C(H))return $.stylize("undefined","undefined");if(S(H)){var rt="'"+JSON.stringify(H).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(rt,"string")}if(_(H))return $.stylize(""+H,"number");if(m(H))return $.stylize(""+H,"boolean");if(w(H))return $.stylize("null","null")}function d($){return"["+Error.prototype.toString.call($)+"]"}function p($,H,rt,lt,ft){for(var K=[],X=0,st=H.length;X<st;++X)D(H,String(X))?K.push(g($,H,rt,lt,String(X),!0)):K.push("");return ft.forEach(function(bt){bt.match(/^\d+$/)||K.push(g($,H,rt,lt,bt,!0))}),K}function g($,H,rt,lt,ft,K){var X,st,bt;if(bt=Object.getOwnPropertyDescriptor(H,ft)||{value:H[ft]},bt.get?bt.set?st=$.stylize("[Getter/Setter]","special"):st=$.stylize("[Getter]","special"):bt.set&&(st=$.stylize("[Setter]","special")),D(lt,ft)||(X="["+ft+"]"),st||($.seen.indexOf(bt.value)<0?(w(rt)?st=h($,bt.value,null):st=h($,bt.value,rt-1),st.indexOf(`
84
+ `)>-1&&(K?st=st.split(`
85
+ `).map(function(wt){return" "+wt}).join(`
86
+ `).slice(2):st=`
87
+ `+st.split(`
88
+ `).map(function(wt){return" "+wt}).join(`
89
+ `))):st=$.stylize("[Circular]","special")),C(X)){if(K&&ft.match(/^\d+$/))return st;X=JSON.stringify(""+ft),X.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(X=X.slice(1,-1),X=$.stylize(X,"name")):(X=X.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),X=$.stylize(X,"string"))}return X+": "+st}function y($,H,rt){var lt=$.reduce(function(ft,K){return K.indexOf(`
90
+ `)>=0,ft+K.replace(/\u001b\[\d\d?m/g,"").length+1},0);return lt>60?rt[0]+(H===""?"":H+`
91
+ `)+" "+$.join(`,
92
+ `)+" "+rt[1]:rt[0]+H+" "+$.join(", ")+" "+rt[1]}Ge.types=Fot();function b($){return Array.isArray($)}Ge.isArray=b;function m($){return typeof $=="boolean"}Ge.isBoolean=m;function w($){return $===null}Ge.isNull=w;function A($){return $==null}Ge.isNullOrUndefined=A;function _($){return typeof $=="number"}Ge.isNumber=_;function S($){return typeof $=="string"}Ge.isString=S;function I($){return typeof $=="symbol"}Ge.isSymbol=I;function C($){return $===void 0}Ge.isUndefined=C;function M($){return z($)&&q($)==="[object RegExp]"}Ge.isRegExp=M,Ge.types.isRegExp=M;function z($){return typeof $=="object"&&$!==null}Ge.isObject=z;function G($){return z($)&&q($)==="[object Date]"}Ge.isDate=G,Ge.types.isDate=G;function Y($){return z($)&&(q($)==="[object Error]"||$ instanceof Error)}Ge.isError=Y,Ge.types.isNativeError=Y;function L($){return typeof $=="function"}Ge.isFunction=L;function j($){return $===null||typeof $=="boolean"||typeof $=="number"||typeof $=="string"||typeof $=="symbol"||typeof $>"u"}Ge.isPrimitive=j,Ge.isBuffer=Bot();function q($){return Object.prototype.toString.call($)}function nt($){return $<10?"0"+$.toString(10):$.toString(10)}var J=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(){var $=new Date,H=[nt($.getHours()),nt($.getMinutes()),nt($.getSeconds())].join(":");return[$.getDate(),J[$.getMonth()],H].join(" ")}Ge.log=function(){console.log("%s - %s",N(),Ge.format.apply(Ge,arguments))},Ge.inherits=Nz(),Ge._extend=function($,H){if(!H||!z(H))return $;for(var rt=Object.keys(H),lt=rt.length;lt--;)$[rt[lt]]=H[rt[lt]];return $};function D($,H){return Object.prototype.hasOwnProperty.call($,H)}var F=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Ge.promisify=function(H){if(typeof H!="function")throw new TypeError('The "original" argument must be of type Function');if(F&&H[F]){if(rt=H[F],typeof rt!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(rt,F,{value:rt,enumerable:!1,writable:!1,configurable:!0}),rt}function rt(){for(var lt,ft,K=new Promise(function(bt,wt){lt=bt,ft=wt}),X=[],st=0;st<arguments.length;st++)X.push(arguments[st]);X.push(function(bt,wt){bt?ft(bt):lt(wt)});try{H.apply(this||XE,X)}catch(bt){ft(bt)}return K}return Object.setPrototypeOf(rt,Object.getPrototypeOf(H)),F&&Object.defineProperty(rt,F,{value:rt,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(rt,t(H))},Ge.promisify.custom=F;function P($,H){if(!$){var rt=new Error("Promise was rejected with a falsy value");rt.reason=$,$=rt}return H($)}function V($){if(typeof $!="function")throw new TypeError('The "original" argument must be of type Function');function H(){for(var rt=[],lt=0;lt<arguments.length;lt++)rt.push(arguments[lt]);var ft=rt.pop();if(typeof ft!="function")throw new TypeError("The last argument must be of type Function");var K=this||XE,X=function(){return ft.apply(K,arguments)};$.apply(this||XE,rt).then(function(st){n.nextTick(X.bind(null,null,st))},function(st){n.nextTick(P.bind(null,st,X))})}return Object.setPrototypeOf(H,Object.getPrototypeOf($)),Object.defineProperties(H,t($)),H}return Ge.callbackify=V,Ge}var Pk,Lz,Nk,kz,Lk,Mz,kk,Fz,Mk,Bz,Fk,Uz,Bk,jz,Not,Uk,$z,kot,jk,Hz,We,zz,$k,Wz,Ge,Gz,XE,we,jot,$ot,Hot,zot,Wot,Got,Vot,Xot,qot,Yot,Kot,Zot,Jot,Qot,tlt,elt,rlt,nlt,ilt,slt,alt,olt,llt,aR,clt,ult,hlt,ab=br(()=>{Tt();Rt();Ct();TE();Ok();Jp();Pk={},Lz=!1;Nk={},kz=!1;Lk={},Mz=!1;kk={},Fz=!1;Mk={},Bz=!1;Fk={},Uz=!1;Bk={},jz=!1,Not=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;Uk={},$z=!1,kot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;jk={},Hz=!1;We={},zz=!1;$k={},Wz=!1;Ge={},Gz=!1,XE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;we=Uot();we.format;we.deprecate;we.debuglog;we.inspect;we.types;we.isArray;we.isBoolean;we.isNull;we.isNullOrUndefined;we.isNumber;we.isString;we.isSymbol;we.isUndefined;we.isRegExp;we.isObject;we.isDate;we.isError;we.isFunction;we.isPrimitive;we.isBuffer;we.log;we.inherits;we._extend;we.promisify;we.callbackify;jot=we._extend,$ot=we.callbackify,Hot=we.debuglog,zot=we.deprecate,Wot=we.format,Got=we.inherits,Vot=we.inspect,Xot=we.isArray,qot=we.isBoolean,Yot=we.isBuffer,Kot=we.isDate,Zot=we.isError,Jot=we.isFunction,Qot=we.isNull,tlt=we.isNullOrUndefined,elt=we.isNumber,rlt=we.isObject,nlt=we.isPrimitive,ilt=we.isRegExp,slt=we.isString,alt=we.isSymbol,olt=we.isUndefined,llt=we.log,aR=we.promisify,clt=we.types,ult=we.TextEncoder=globalThis.TextEncoder,hlt=we.TextDecoder=globalThis.TextDecoder});var YE={};tc(YE,{EventEmitter:()=>dlt,default:()=>uc,defaultMaxListeners:()=>plt,init:()=>glt,listenerCount:()=>mlt,on:()=>ylt,once:()=>blt});function flt(){if(Xz)return oR;Xz=!0;var n=typeof Reflect=="object"?Reflect:null,t=n&&typeof n.apply=="function"?n.apply:function(S,I,C){return Function.prototype.apply.call(S,I,C)},e;n&&typeof n.ownKeys=="function"?e=n.ownKeys:Object.getOwnPropertySymbols?e=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:e=function(S){return Object.getOwnPropertyNames(S)};function r(_){console&&console.warn&&console.warn(_)}var i=Number.isNaN||function(S){return S!==S};function s(){s.init.call(this)}oR=s,oR.once=m,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(_){if(typeof _!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof _)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(_){if(typeof _!="number"||_<0||i(_))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+_+".");a=_}}),s.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},s.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||i(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function c(_){return _._maxListeners===void 0?s.defaultMaxListeners:_._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(S){for(var I=[],C=1;C<arguments.length;C++)I.push(arguments[C]);var M=S==="error",z=this._events;if(z!==void 0)M=M&&z.error===void 0;else if(!M)return!1;if(M){var G;if(I.length>0&&(G=I[0]),G instanceof Error)throw G;var Y=new Error("Unhandled error."+(G?" ("+G.message+")":""));throw Y.context=G,Y}var L=z[S];if(L===void 0)return!1;if(typeof L=="function")t(L,this,I);else for(var j=L.length,q=g(L,j),C=0;C<j;++C)t(q[C],this,I);return!0};function u(_,S,I,C){var M,z,G;if(o(I),z=_._events,z===void 0?(z=_._events=Object.create(null),_._eventsCount=0):(z.newListener!==void 0&&(_.emit("newListener",S,I.listener?I.listener:I),z=_._events),G=z[S]),G===void 0)G=z[S]=I,++_._eventsCount;else if(typeof G=="function"?G=z[S]=C?[I,G]:[G,I]:C?G.unshift(I):G.push(I),M=c(_),M>0&&G.length>M&&!G.warned){G.warned=!0;var Y=new Error("Possible EventEmitter memory leak detected. "+G.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");Y.name="MaxListenersExceededWarning",Y.emitter=_,Y.type=S,Y.count=G.length,r(Y)}return _}s.prototype.addListener=function(S,I){return u(this,S,I,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(S,I){return u(this,S,I,!0)};function h(){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 f(_,S,I){var C={fired:!1,wrapFn:void 0,target:_,type:S,listener:I},M=h.bind(C);return M.listener=I,C.wrapFn=M,M}s.prototype.once=function(S,I){return o(I),this.on(S,f(this,S,I)),this},s.prototype.prependOnceListener=function(S,I){return o(I),this.prependListener(S,f(this,S,I)),this},s.prototype.removeListener=function(S,I){var C,M,z,G,Y;if(o(I),M=this._events,M===void 0)return this;if(C=M[S],C===void 0)return this;if(C===I||C.listener===I)--this._eventsCount===0?this._events=Object.create(null):(delete M[S],M.removeListener&&this.emit("removeListener",S,C.listener||I));else if(typeof C!="function"){for(z=-1,G=C.length-1;G>=0;G--)if(C[G]===I||C[G].listener===I){Y=C[G].listener,z=G;break}if(z<0)return this;z===0?C.shift():y(C,z),C.length===1&&(M[S]=C[0]),M.removeListener!==void 0&&this.emit("removeListener",S,Y||I)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(S){var I,C,M;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[S]),this;if(arguments.length===0){var z=Object.keys(C),G;for(M=0;M<z.length;++M)G=z[M],G!=="removeListener"&&this.removeAllListeners(G);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(I=C[S],typeof I=="function")this.removeListener(S,I);else if(I!==void 0)for(M=I.length-1;M>=0;M--)this.removeListener(S,I[M]);return this};function d(_,S,I){var C=_._events;if(C===void 0)return[];var M=C[S];return M===void 0?[]:typeof M=="function"?I?[M.listener||M]:[M]:I?b(M):g(M,M.length)}s.prototype.listeners=function(S){return d(this,S,!0)},s.prototype.rawListeners=function(S){return d(this,S,!1)},s.listenerCount=function(_,S){return typeof _.listenerCount=="function"?_.listenerCount(S):p.call(_,S)},s.prototype.listenerCount=p;function p(_){var S=this._events;if(S!==void 0){var I=S[_];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]};function g(_,S){for(var I=new Array(S),C=0;C<S;++C)I[C]=_[C];return I}function y(_,S){for(;S+1<_.length;S++)_[S]=_[S+1];_.pop()}function b(_){for(var S=new Array(_.length),I=0;I<S.length;++I)S[I]=_[I].listener||_[I];return S}function m(_,S){return new Promise(function(I,C){function M(G){_.removeListener(S,z),C(G)}function z(){typeof _.removeListener=="function"&&_.removeListener("error",M),I([].slice.call(arguments))}A(_,S,z,{once:!0}),S!=="error"&&w(_,M,{once:!0})})}function w(_,S,I){typeof _.on=="function"&&A(_,"error",S,I)}function A(_,S,I,C){if(typeof _.on=="function")C.once?_.once(S,I):_.on(S,I);else if(typeof _.addEventListener=="function")_.addEventListener(S,function M(z){C.once&&_.removeEventListener(S,M),I(z)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof _)}return oR}var oR,Xz,uc,dlt,plt,glt,mlt,ylt,blt,ob=br(()=>{Tt();Rt();Ct();oR={},Xz=!1;uc=flt();uc.once;uc.once=function(n,t){return new Promise((e,r)=>{function i(...a){s!==void 0&&n.removeListener("error",s),e(a)}let s;t!=="error"&&(s=a=>{n.removeListener(name,i),r(a)},n.once("error",s)),n.once(t,i)})};uc.on=function(n,t){let e=[],r=[],i=null,s=!1,a={async next(){let u=e.shift();if(u)return createIterResult(u,!1);if(i){let h=Promise.reject(i);return i=null,h}return s?createIterResult(void 0,!0):new Promise((h,f)=>r.push({resolve:h,reject:f}))},async return(){n.removeListener(t,o),n.removeListener("error",c),s=!0;for(let u of r)u.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(u){i=u,n.removeListener(t,o),n.removeListener("error",c)},[Symbol.asyncIterator](){return this}};return n.on(t,o),n.on("error",c),a;function o(...u){let h=r.shift();h?h.resolve(createIterResult(u,!1)):e.push(u)}function c(u){s=!0;let h=r.shift();h?h.reject(u):i=u,a.return()}};({EventEmitter:dlt,defaultMaxListeners:plt,init:glt,listenerCount:mlt,on:ylt,once:blt}=uc)});function vlt(){if(qz)return KE;qz=!0;var n=vi(),t=n.Buffer;function e(i,s){for(var a in i)s[a]=i[a]}t.from&&t.alloc&&t.allocUnsafe&&t.allocUnsafeSlow?KE=n:(e(n,KE),KE.Buffer=r);function r(i,s,a){return t(i,s,a)}return r.prototype=Object.create(t.prototype),e(t,r),r.from=function(i,s,a){if(typeof i=="number")throw new TypeError("Argument must not be a number");return t(i,s,a)},r.alloc=function(i,s,a){if(typeof i!="number")throw new TypeError("Argument must be a number");var o=t(i);return s!==void 0?typeof a=="string"?o.fill(s,a):o.fill(s):o.fill(0),o},r.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return t(i)},r.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(i)},KE}function wlt(){if(Yz)return zk;Yz=!0;var n=vlt().Buffer,t=n.isEncoding||function(m){switch(m=""+m,m&&m.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function e(m){if(!m)return"utf8";for(var w;;)switch(m){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 m;default:if(w)return;m=(""+m).toLowerCase(),w=!0}}function r(m){var w=e(m);if(typeof w!="string"&&(n.isEncoding===t||!t(m)))throw new Error("Unknown encoding: "+m);return w||m}zk.StringDecoder=i;function i(m){this.encoding=r(m);var w;switch(this.encoding){case"utf16le":this.text=f,this.end=d,w=4;break;case"utf8":this.fillLast=c,w=4;break;case"base64":this.text=p,this.end=g,w=3;break;default:this.write=y,this.end=b;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(w)}i.prototype.write=function(m){if(m.length===0)return"";var w,A;if(this.lastNeed){if(w=this.fillLast(m),w===void 0)return"";A=this.lastNeed,this.lastNeed=0}else A=0;return A<m.length?w?w+this.text(m,A):this.text(m,A):w||""},i.prototype.end=h,i.prototype.text=u,i.prototype.fillLast=function(m){if(this.lastNeed<=m.length)return m.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);m.copy(this.lastChar,this.lastTotal-this.lastNeed,0,m.length),this.lastNeed-=m.length};function s(m){return m<=127?0:m>>5===6?2:m>>4===14?3:m>>3===30?4:m>>6===2?-1:-2}function a(m,w,A){var _=w.length-1;if(_<A)return 0;var S=s(w[_]);return S>=0?(S>0&&(m.lastNeed=S-1),S):--_<A||S===-2?0:(S=s(w[_]),S>=0?(S>0&&(m.lastNeed=S-2),S):--_<A||S===-2?0:(S=s(w[_]),S>=0?(S>0&&(S===2?S=0:m.lastNeed=S-3),S):0))}function o(m,w,A){if((w[0]&192)!==128)return m.lastNeed=0,"\uFFFD";if(m.lastNeed>1&&w.length>1){if((w[1]&192)!==128)return m.lastNeed=1,"\uFFFD";if(m.lastNeed>2&&w.length>2&&(w[2]&192)!==128)return m.lastNeed=2,"\uFFFD"}}function c(m){var w=this.lastTotal-this.lastNeed,A=o(this,m);if(A!==void 0)return A;if(this.lastNeed<=m.length)return m.copy(this.lastChar,w,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);m.copy(this.lastChar,w,0,m.length),this.lastNeed-=m.length}function u(m,w){var A=a(this,m,w);if(!this.lastNeed)return m.toString("utf8",w);this.lastTotal=A;var _=m.length-(A-this.lastNeed);return m.copy(this.lastChar,0,_),m.toString("utf8",w,_)}function h(m){var w=m&&m.length?this.write(m):"";return this.lastNeed?w+"\uFFFD":w}function f(m,w){if((m.length-w)%2===0){var A=m.toString("utf16le",w);if(A){var _=A.charCodeAt(A.length-1);if(_>=55296&&_<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=m[m.length-2],this.lastChar[1]=m[m.length-1],A.slice(0,-1)}return A}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=m[m.length-1],m.toString("utf16le",w,m.length-1)}function d(m){var w=m&&m.length?this.write(m):"";if(this.lastNeed){var A=this.lastTotal-this.lastNeed;return w+this.lastChar.toString("utf16le",0,A)}return w}function p(m,w){var A=(m.length-w)%3;return A===0?m.toString("base64",w):(this.lastNeed=3-A,this.lastTotal=3,A===1?this.lastChar[0]=m[m.length-1]:(this.lastChar[0]=m[m.length-2],this.lastChar[1]=m[m.length-1]),m.toString("base64",w,m.length-A))}function g(m){var w=m&&m.length?this.write(m):"";return this.lastNeed?w+this.lastChar.toString("base64",0,3-this.lastNeed):w}function y(m){return m.toString(this.encoding)}function b(m){return m&&m.length?this.write(m):""}return zk}var KE,qz,zk,Yz,lR,Dbt,Kz=br(()=>{Tt();Rt();Ct();C0();KE={},qz=!1;zk={},Yz=!1;lR=wlt();lR.StringDecoder;Dbt=lR.StringDecoder});var e1={};tc(e1,{Duplex:()=>Tlt,PassThrough:()=>Rlt,Readable:()=>cM,Stream:()=>Olt,Transform:()=>Clt,Writable:()=>_lt,default:()=>jr,finished:()=>Ilt,pipeline:()=>Dlt,promises:()=>Plt});function _n(){return Zz||(Zz=!0,Wk={ArrayIsArray(n){return Array.isArray(n)},ArrayPrototypeIncludes(n,t){return n.includes(t)},ArrayPrototypeIndexOf(n,t){return n.indexOf(t)},ArrayPrototypeJoin(n,t){return n.join(t)},ArrayPrototypeMap(n,t){return n.map(t)},ArrayPrototypePop(n,t){return n.pop(t)},ArrayPrototypePush(n,t){return n.push(t)},ArrayPrototypeSlice(n,t,e){return n.slice(t,e)},Error,FunctionPrototypeCall(n,t,...e){return n.call(t,...e)},FunctionPrototypeSymbolHasInstance(n,t){return Function.prototype[Symbol.hasInstance].call(n,t)},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(n,t){return Object.defineProperties(n,t)},ObjectDefineProperty(n,t,e){return Object.defineProperty(n,t,e)},ObjectGetOwnPropertyDescriptor(n,t){return Object.getOwnPropertyDescriptor(n,t)},ObjectKeys(n){return Object.keys(n)},ObjectSetPrototypeOf(n,t){return Object.setPrototypeOf(n,t)},Promise,PromisePrototypeCatch(n,t){return n.catch(t)},PromisePrototypeThen(n,t,e){return n.then(t,e)},PromiseReject(n){return Promise.reject(n)},PromiseResolve(n){return Promise.resolve(n)},ReflectApply:Reflect.apply,RegExpPrototypeTest(n,t){return n.test(t)},SafeSet:Set,String,StringPrototypeSlice(n,t,e){return n.slice(t,e)},StringPrototypeToLowerCase(n){return n.toLowerCase()},StringPrototypeToUpperCase(n){return n.toUpperCase()},StringPrototypeTrim(n){return n.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(n,t,e){return n.set(t,e)},Boolean,Uint8Array}),Wk}function QE(){if(Jz)return ZE;Jz=!0;let{AbortController:n,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;return ZE=n,ZE.AbortSignal=t,ZE.default=n,ZE}function _s(){if(Qz)return cR;Qz=!0;let n=vi(),{kResistStopPropagation:t,SymbolDispose:e}=_n(),r=globalThis.AbortSignal||QE().AbortSignal,i=globalThis.AbortController||QE().AbortController,s=Object.getPrototypeOf(async function(){}).constructor,a=globalThis.Blob||n.Blob,o=typeof a<"u"?function(d){return d instanceof a}:function(d){return!1},c=(f,d)=>{if(f!==void 0&&(f===null||typeof f!="object"||!("aborted"in f)))throw new ERR_INVALID_ARG_TYPE(d,"AbortSignal",f)},u=(f,d)=>{if(typeof f!="function")throw new ERR_INVALID_ARG_TYPE(d,"Function",f)};class h extends Error{constructor(d){if(!Array.isArray(d))throw new TypeError(`Expected input to be an Array, got ${typeof d}`);let p="";for(let g=0;g<d.length;g++)p+=` ${d[g].stack}
93
+ `;super(p),this.name="AggregateError",this.errors=d}}return cR={AggregateError:h,kEmptyObject:Object.freeze({}),once(f){let d=!1;return function(...p){d||(d=!0,f.apply(this,p))}},createDeferredPromise:function(){let f,d;return{promise:new Promise((g,y)=>{f=g,d=y}),resolve:f,reject:d}},promisify(f){return new Promise((d,p)=>{f((g,...y)=>g?p(g):d(...y))})},debuglog(){return function(){}},format(f,...d){return f.replace(/%([sdifj])/g,function(...[p,g]){let y=d.shift();return g==="f"?y.toFixed(6):g==="j"?JSON.stringify(y):g==="s"&&typeof y=="object"?`${y.constructor!==Object?y.constructor.name:""} {}`.trim():y.toString()})},inspect(f){switch(typeof f){case"string":if(f.includes("'"))if(f.includes('"')){if(!f.includes("`")&&!f.includes("${"))return`\`${f}\``}else return`"${f}"`;return`'${f}'`;case"number":return isNaN(f)?"NaN":Object.is(f,-0)?String(f):f;case"bigint":return`${String(f)}n`;case"boolean":case"undefined":return String(f);case"object":return"{}"}},types:{isAsyncFunction(f){return f instanceof s},isArrayBufferView(f){return ArrayBuffer.isView(f)}},isBlob:o,deprecate(f,d){return f},addAbortListener:uc.addAbortListener||function(d,p){if(d===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",d);c(d,"signal"),u(p,"listener");let g;return d.aborted?queueMicrotask(()=>p()):(d.addEventListener("abort",p,{__proto__:null,once:!0,[t]:!0}),g=()=>{d.removeEventListener("abort",p)}),{__proto__:null,[e](){var y;(y=g)===null||y===void 0||y()}}},AbortSignalAny:r.any||function(d){if(d.length===1)return d[0];let p=new i,g=()=>p.abort();return d.forEach(y=>{c(y,"signals"),y.addEventListener("abort",g,{once:!0})}),p.signal.addEventListener("abort",()=>{d.forEach(y=>y.removeEventListener("abort",g))},{once:!0}),p.signal}},cR.promisify.custom=Symbol.for("nodejs.util.promisify.custom"),cR}function Zs(){if(tW)return Gk;tW=!0;let{format:n,inspect:t,AggregateError:e}=_s(),r=globalThis.AggregateError||e,i=Symbol("kIsNodeError"),s=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,o="__node_internal_",c={};function u(b,m){if(!b)throw new c.ERR_INTERNAL_ASSERTION(m)}function h(b){let m="",w=b.length,A=b[0]==="-"?1:0;for(;w>=A+4;w-=3)m=`_${b.slice(w-3,w)}${m}`;return`${b.slice(0,w)}${m}`}function f(b,m,w){if(typeof m=="function")return u(m.length<=w.length,`Code: ${b}; The provided arguments length (${w.length}) does not match the required ones (${m.length}).`),m(...w);let A=(m.match(/%[dfijoOs]/g)||[]).length;return u(A===w.length,`Code: ${b}; The provided arguments length (${w.length}) does not match the required ones (${A}).`),w.length===0?m:n(m,...w)}function d(b,m,w){w||(w=Error);class A extends w{constructor(...S){super(f(b,m,S))}toString(){return`${this.name} [${b}]: ${this.message}`}}Object.defineProperties(A.prototype,{name:{value:w.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${b}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),A.prototype.code=b,A.prototype[i]=!0,c[b]=A}function p(b){let m=o+b.name;return Object.defineProperty(b,"name",{value:m}),b}function g(b,m){if(b&&m&&b!==m){if(Array.isArray(m.errors))return m.errors.push(b),m;let w=new r([m,b],m.message);return w.code=m.code,w}return b||m}class y extends Error{constructor(m="The operation was aborted",w=void 0){if(w!==void 0&&typeof w!="object")throw new c.ERR_INVALID_ARG_TYPE("options","Object",w);super(m,w),this.code="ABORT_ERR",this.name="AbortError"}}return d("ERR_ASSERTION","%s",Error),d("ERR_INVALID_ARG_TYPE",(b,m,w)=>{u(typeof b=="string","'name' must be a string"),Array.isArray(m)||(m=[m]);let A="The ";b.endsWith(" argument")?A+=`${b} `:A+=`"${b}" ${b.includes(".")?"property":"argument"} `,A+="must be ";let _=[],S=[],I=[];for(let M of m)u(typeof M=="string","All expected entries have to be of type string"),s.includes(M)?_.push(M.toLowerCase()):a.test(M)?S.push(M):(u(M!=="object",'The value "object" should be written as "Object"'),I.push(M));if(S.length>0){let M=_.indexOf("object");M!==-1&&(_.splice(_,M,1),S.push("Object"))}if(_.length>0){switch(_.length){case 1:A+=`of type ${_[0]}`;break;case 2:A+=`one of type ${_[0]} or ${_[1]}`;break;default:{let M=_.pop();A+=`one of type ${_.join(", ")}, or ${M}`}}(S.length>0||I.length>0)&&(A+=" or ")}if(S.length>0){switch(S.length){case 1:A+=`an instance of ${S[0]}`;break;case 2:A+=`an instance of ${S[0]} or ${S[1]}`;break;default:{let M=S.pop();A+=`an instance of ${S.join(", ")}, or ${M}`}}I.length>0&&(A+=" or ")}switch(I.length){case 0:break;case 1:I[0].toLowerCase()!==I[0]&&(A+="an "),A+=`${I[0]}`;break;case 2:A+=`one of ${I[0]} or ${I[1]}`;break;default:{let M=I.pop();A+=`one of ${I.join(", ")}, or ${M}`}}if(w==null)A+=`. Received ${w}`;else if(typeof w=="function"&&w.name)A+=`. Received function ${w.name}`;else if(typeof w=="object"){var C;if((C=w.constructor)!==null&&C!==void 0&&C.name)A+=`. Received an instance of ${w.constructor.name}`;else{let M=t(w,{depth:-1});A+=`. Received ${M}`}}else{let M=t(w,{colors:!1});M.length>25&&(M=`${M.slice(0,25)}...`),A+=`. Received type ${typeof w} (${M})`}return A},TypeError),d("ERR_INVALID_ARG_VALUE",(b,m,w="is invalid")=>{let A=t(m);return A.length>128&&(A=A.slice(0,128)+"..."),`The ${b.includes(".")?"property":"argument"} '${b}' ${w}. Received ${A}`},TypeError),d("ERR_INVALID_RETURN_VALUE",(b,m,w)=>{var A;let _=w!=null&&(A=w.constructor)!==null&&A!==void 0&&A.name?`instance of ${w.constructor.name}`:`type ${typeof w}`;return`Expected ${b} to be returned from the "${m}" function but got ${_}.`},TypeError),d("ERR_MISSING_ARGS",(...b)=>{u(b.length>0,"At least one arg needs to be specified");let m,w=b.length;switch(b=(Array.isArray(b)?b:[b]).map(A=>`"${A}"`).join(" or "),w){case 1:m+=`The ${b[0]} argument`;break;case 2:m+=`The ${b[0]} and ${b[1]} arguments`;break;default:{let A=b.pop();m+=`The ${b.join(", ")}, and ${A} arguments`}break}return`${m} must be specified`},TypeError),d("ERR_OUT_OF_RANGE",(b,m,w)=>{u(m,'Missing "range" argument');let A;return Number.isInteger(w)&&Math.abs(w)>2**32?A=h(String(w)):typeof w=="bigint"?(A=String(w),(w>2n**32n||w<-(2n**32n))&&(A=h(A)),A+="n"):A=t(w),`The value of "${b}" is out of range. It must be ${m}. Received ${A}`},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),Gk={AbortError:y,aggregateTwoErrors:p(g),hideStackFrames:p,codes:c},Gk}function t1(){if(eW)return Vk;eW=!0;let{ArrayIsArray:n,ArrayPrototypeIncludes:t,ArrayPrototypeJoin:e,ArrayPrototypeMap:r,NumberIsInteger:i,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:o,NumberParseInt:c,ObjectPrototypeHasOwnProperty:u,RegExpPrototypeExec:h,String:f,StringPrototypeToUpperCase:d,StringPrototypeTrim:p}=_n(),{hideStackFrames:g,codes:{ERR_SOCKET_BAD_PORT:y,ERR_INVALID_ARG_TYPE:b,ERR_INVALID_ARG_VALUE:m,ERR_OUT_OF_RANGE:w,ERR_UNKNOWN_SIGNAL:A}}=Zs(),{normalizeEncoding:_}=_s(),{isAsyncFunction:S,isArrayBufferView:I}=_s().types,C={};function M(xt){return xt===(xt|0)}function z(xt){return xt===xt>>>0}let G=/^[0-7]+$/,Y="must be a 32-bit unsigned integer or an octal string";function L(xt,$t,Nt){if(typeof xt>"u"&&(xt=Nt),typeof xt=="string"){if(h(G,xt)===null)throw new m($t,xt,Y);xt=c(xt,8)}return nt(xt,$t),xt}let j=g((xt,$t,Nt=o,Ot=a)=>{if(typeof xt!="number")throw new b($t,"number",xt);if(!i(xt))throw new w($t,"an integer",xt);if(xt<Nt||xt>Ot)throw new w($t,`>= ${Nt} && <= ${Ot}`,xt)}),q=g((xt,$t,Nt=-2147483648,Ot=2147483647)=>{if(typeof xt!="number")throw new b($t,"number",xt);if(!i(xt))throw new w($t,"an integer",xt);if(xt<Nt||xt>Ot)throw new w($t,`>= ${Nt} && <= ${Ot}`,xt)}),nt=g((xt,$t,Nt=!1)=>{if(typeof xt!="number")throw new b($t,"number",xt);if(!i(xt))throw new w($t,"an integer",xt);let Ot=Nt?1:0,qt=4294967295;if(xt<Ot||xt>qt)throw new w($t,`>= ${Ot} && <= ${qt}`,xt)});function J(xt,$t){if(typeof xt!="string")throw new b($t,"string",xt)}function N(xt,$t,Nt=void 0,Ot){if(typeof xt!="number")throw new b($t,"number",xt);if(Nt!=null&&xt<Nt||Ot!=null&&xt>Ot||(Nt!=null||Ot!=null)&&s(xt))throw new w($t,`${Nt!=null?`>= ${Nt}`:""}${Nt!=null&&Ot!=null?" && ":""}${Ot!=null?`<= ${Ot}`:""}`,xt)}let D=g((xt,$t,Nt)=>{if(!t(Nt,xt)){let qt="must be one of: "+e(r(Nt,Jt=>typeof Jt=="string"?`'${Jt}'`:f(Jt)),", ");throw new m($t,xt,qt)}});function F(xt,$t){if(typeof xt!="boolean")throw new b($t,"boolean",xt)}function P(xt,$t,Nt){return xt==null||!u(xt,$t)?Nt:xt[$t]}let V=g((xt,$t,Nt=null)=>{let Ot=P(Nt,"allowArray",!1),qt=P(Nt,"allowFunction",!1);if(!P(Nt,"nullable",!1)&&xt===null||!Ot&&n(xt)||typeof xt!="object"&&(!qt||typeof xt!="function"))throw new b($t,"Object",xt)}),$=g((xt,$t)=>{if(xt!=null&&typeof xt!="object"&&typeof xt!="function")throw new b($t,"a dictionary",xt)}),H=g((xt,$t,Nt=0)=>{if(!n(xt))throw new b($t,"Array",xt);if(xt.length<Nt){let Ot=`must be longer than ${Nt}`;throw new m($t,xt,Ot)}});function rt(xt,$t){H(xt,$t);for(let Nt=0;Nt<xt.length;Nt++)J(xt[Nt],`${$t}[${Nt}]`)}function lt(xt,$t){H(xt,$t);for(let Nt=0;Nt<xt.length;Nt++)F(xt[Nt],`${$t}[${Nt}]`)}function ft(xt,$t){H(xt,$t);for(let Nt=0;Nt<xt.length;Nt++){let Ot=xt[Nt],qt=`${$t}[${Nt}]`;if(Ot==null)throw new b(qt,"AbortSignal",Ot);wt(Ot,qt)}}function K(xt,$t="signal"){if(J(xt,$t),C[xt]===void 0)throw C[d(xt)]!==void 0?new A(xt+" (signals must use all capital letters)"):new A(xt)}let X=g((xt,$t="buffer")=>{if(!I(xt))throw new b($t,["Buffer","TypedArray","DataView"],xt)});function st(xt,$t){let Nt=_($t),Ot=xt.length;if(Nt==="hex"&&Ot%2!==0)throw new m("encoding",$t,`is invalid for data of length ${Ot}`)}function bt(xt,$t="Port",Nt=!0){if(typeof xt!="number"&&typeof xt!="string"||typeof xt=="string"&&p(xt).length===0||+xt!==+xt>>>0||xt>65535||xt===0&&!Nt)throw new y($t,xt,Nt);return xt|0}let wt=g((xt,$t)=>{if(xt!==void 0&&(xt===null||typeof xt!="object"||!("aborted"in xt)))throw new b($t,"AbortSignal",xt)}),Q=g((xt,$t)=>{if(typeof xt!="function")throw new b($t,"Function",xt)}),W=g((xt,$t)=>{if(typeof xt!="function"||S(xt))throw new b($t,"Function",xt)}),at=g((xt,$t)=>{if(xt!==void 0)throw new b($t,"undefined",xt)});function pt(xt,$t,Nt){if(!t(Nt,xt))throw new b($t,`('${e(Nt,"|")}')`,xt)}let _t=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function At(xt,$t){if(typeof xt>"u"||!h(_t,xt))throw new m($t,xt,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function gt(xt){if(typeof xt=="string")return At(xt,"hints"),xt;if(n(xt)){let $t=xt.length,Nt="";if($t===0)return Nt;for(let Ot=0;Ot<$t;Ot++){let qt=xt[Ot];At(qt,"hints"),Nt+=qt,Ot!==$t-1&&(Nt+=", ")}return Nt}throw new m("hints",xt,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return Vk={isInt32:M,isUint32:z,parseFileMode:L,validateArray:H,validateStringArray:rt,validateBooleanArray:lt,validateAbortSignalArray:ft,validateBoolean:F,validateBuffer:X,validateDictionary:$,validateEncoding:st,validateFunction:Q,validateInt32:q,validateInteger:j,validateNumber:N,validateObject:V,validateOneOf:D,validatePlainFunction:W,validatePort:bt,validateSignalName:K,validateString:J,validateUint32:nt,validateUndefined:at,validateUnion:pt,validateAbortSignal:wt,validateLinkHeaderValue:gt},Vk}function Nu(){if(rW)return Xk;rW=!0;let{SymbolAsyncIterator:n,SymbolIterator:t,SymbolFor:e}=_n(),r=e("nodejs.stream.destroyed"),i=e("nodejs.stream.errored"),s=e("nodejs.stream.readable"),a=e("nodejs.stream.writable"),o=e("nodejs.stream.disturbed"),c=e("nodejs.webstream.isClosedPromise"),u=e("nodejs.webstream.controllerErrorFunction");function h(P,V=!1){var $;return!!(P&&typeof P.pipe=="function"&&typeof P.on=="function"&&(!V||typeof P.pause=="function"&&typeof P.resume=="function")&&(!P._writableState||(($=P._readableState)===null||$===void 0?void 0:$.readable)!==!1)&&(!P._writableState||P._readableState))}function f(P){var V;return!!(P&&typeof P.write=="function"&&typeof P.on=="function"&&(!P._readableState||((V=P._writableState)===null||V===void 0?void 0:V.writable)!==!1))}function d(P){return!!(P&&typeof P.pipe=="function"&&P._readableState&&typeof P.on=="function"&&typeof P.write=="function")}function p(P){return P&&(P._readableState||P._writableState||typeof P.write=="function"&&typeof P.on=="function"||typeof P.pipe=="function"&&typeof P.on=="function")}function g(P){return!!(P&&!p(P)&&typeof P.pipeThrough=="function"&&typeof P.getReader=="function"&&typeof P.cancel=="function")}function y(P){return!!(P&&!p(P)&&typeof P.getWriter=="function"&&typeof P.abort=="function")}function b(P){return!!(P&&!p(P)&&typeof P.readable=="object"&&typeof P.writable=="object")}function m(P){return g(P)||y(P)||b(P)}function w(P,V){return P==null?!1:V===!0?typeof P[n]=="function":V===!1?typeof P[t]=="function":typeof P[n]=="function"||typeof P[t]=="function"}function A(P){if(!p(P))return null;let V=P._writableState,$=P._readableState,H=V||$;return!!(P.destroyed||P[r]||H!=null&&H.destroyed)}function _(P){if(!f(P))return null;if(P.writableEnded===!0)return!0;let V=P._writableState;return V!=null&&V.errored?!1:typeof V?.ended!="boolean"?null:V.ended}function S(P,V){if(!f(P))return null;if(P.writableFinished===!0)return!0;let $=P._writableState;return $!=null&&$.errored?!1:typeof $?.finished!="boolean"?null:!!($.finished||V===!1&&$.ended===!0&&$.length===0)}function I(P){if(!h(P))return null;if(P.readableEnded===!0)return!0;let V=P._readableState;return!V||V.errored?!1:typeof V?.ended!="boolean"?null:V.ended}function C(P,V){if(!h(P))return null;let $=P._readableState;return $!=null&&$.errored?!1:typeof $?.endEmitted!="boolean"?null:!!($.endEmitted||V===!1&&$.ended===!0&&$.length===0)}function M(P){return P&&P[s]!=null?P[s]:typeof P?.readable!="boolean"?null:A(P)?!1:h(P)&&P.readable&&!C(P)}function z(P){return P&&P[a]!=null?P[a]:typeof P?.writable!="boolean"?null:A(P)?!1:f(P)&&P.writable&&!_(P)}function G(P,V){return p(P)?A(P)?!0:!(V?.readable!==!1&&M(P)||V?.writable!==!1&&z(P)):null}function Y(P){var V,$;return p(P)?P.writableErrored?P.writableErrored:(V=($=P._writableState)===null||$===void 0?void 0:$.errored)!==null&&V!==void 0?V:null:null}function L(P){var V,$;return p(P)?P.readableErrored?P.readableErrored:(V=($=P._readableState)===null||$===void 0?void 0:$.errored)!==null&&V!==void 0?V:null:null}function j(P){if(!p(P))return null;if(typeof P.closed=="boolean")return P.closed;let V=P._writableState,$=P._readableState;return typeof V?.closed=="boolean"||typeof $?.closed=="boolean"?V?.closed||$?.closed:typeof P._closed=="boolean"&&q(P)?P._closed:null}function q(P){return typeof P._closed=="boolean"&&typeof P._defaultKeepAlive=="boolean"&&typeof P._removedConnection=="boolean"&&typeof P._removedContLen=="boolean"}function nt(P){return typeof P._sent100=="boolean"&&q(P)}function J(P){var V;return typeof P._consuming=="boolean"&&typeof P._dumped=="boolean"&&((V=P.req)===null||V===void 0?void 0:V.upgradeOrConnect)===void 0}function N(P){if(!p(P))return null;let V=P._writableState,$=P._readableState,H=V||$;return!H&&nt(P)||!!(H&&H.autoDestroy&&H.emitClose&&H.closed===!1)}function D(P){var V;return!!(P&&((V=P[o])!==null&&V!==void 0?V:P.readableDidRead||P.readableAborted))}function F(P){var V,$,H,rt,lt,ft,K,X,st,bt;return!!(P&&((V=($=(H=(rt=(lt=(ft=P[i])!==null&&ft!==void 0?ft:P.readableErrored)!==null&&lt!==void 0?lt:P.writableErrored)!==null&&rt!==void 0?rt:(K=P._readableState)===null||K===void 0?void 0:K.errorEmitted)!==null&&H!==void 0?H:(X=P._writableState)===null||X===void 0?void 0:X.errorEmitted)!==null&&$!==void 0?$:(st=P._readableState)===null||st===void 0?void 0:st.errored)!==null&&V!==void 0?V:!((bt=P._writableState)===null||bt===void 0)&&bt.errored))}return Xk={isDestroyed:A,kIsDestroyed:r,isDisturbed:D,kIsDisturbed:o,isErrored:F,kIsErrored:i,isReadable:M,kIsReadable:s,kIsClosedPromise:c,kControllerErrorFunction:u,kIsWritable:a,isClosed:j,isDuplexNodeStream:d,isFinished:G,isIterable:w,isReadableNodeStream:h,isReadableStream:g,isReadableEnded:I,isReadableFinished:C,isReadableErrored:L,isNodeStream:p,isWebStream:m,isWritable:z,isWritableNodeStream:f,isWritableStream:y,isWritableEnded:_,isWritableFinished:S,isWritableErrored:Y,isServerRequest:J,isServerResponse:nt,willEmitClose:N,isTransformStream:b},Xk}function $f(){if(nW)return uR;nW=!0;let n=$n,{AbortError:t,codes:e}=Zs(),{ERR_INVALID_ARG_TYPE:r,ERR_STREAM_PREMATURE_CLOSE:i}=e,{kEmptyObject:s,once:a}=_s(),{validateAbortSignal:o,validateFunction:c,validateObject:u,validateBoolean:h}=t1(),{Promise:f,PromisePrototypeThen:d,SymbolDispose:p}=_n(),{isClosed:g,isReadable:y,isReadableNodeStream:b,isReadableStream:m,isReadableFinished:w,isReadableErrored:A,isWritable:_,isWritableNodeStream:S,isWritableStream:I,isWritableFinished:C,isWritableErrored:M,isNodeStream:z,willEmitClose:G,kIsClosedPromise:Y}=Nu(),L;function j(D){return D.setHeader&&typeof D.abort=="function"}let q=()=>{};function nt(D,F,P){var V,$;if(arguments.length===2?(P=F,F=s):F==null?F=s:u(F,"options"),c(P,"callback"),o(F.signal,"options.signal"),P=a(P),m(D)||I(D))return J(D,F,P);if(!z(D))throw new r("stream",["ReadableStream","WritableStream","Stream"],D);let H=(V=F.readable)!==null&&V!==void 0?V:b(D),rt=($=F.writable)!==null&&$!==void 0?$:S(D),lt=D._writableState,ft=D._readableState,K=()=>{D.writable||bt()},X=G(D)&&b(D)===H&&S(D)===rt,st=C(D,!1),bt=()=>{st=!0,D.destroyed&&(X=!1),!(X&&(!D.readable||H))&&(!H||wt)&&P.call(D)},wt=w(D,!1),Q=()=>{wt=!0,D.destroyed&&(X=!1),!(X&&(!D.writable||rt))&&(!rt||st)&&P.call(D)},W=xt=>{P.call(D,xt)},at=g(D),pt=()=>{at=!0;let xt=M(D)||A(D);if(xt&&typeof xt!="boolean")return P.call(D,xt);if(H&&!wt&&b(D,!0)&&!w(D,!1))return P.call(D,new i);if(rt&&!st&&!C(D,!1))return P.call(D,new i);P.call(D)},_t=()=>{at=!0;let xt=M(D)||A(D);if(xt&&typeof xt!="boolean")return P.call(D,xt);P.call(D)},At=()=>{D.req.on("finish",bt)};j(D)?(D.on("complete",bt),X||D.on("abort",pt),D.req?At():D.on("request",At)):rt&&!lt&&(D.on("end",K),D.on("close",K)),!X&&typeof D.aborted=="boolean"&&D.on("aborted",pt),D.on("end",Q),D.on("finish",bt),F.error!==!1&&D.on("error",W),D.on("close",pt),at?n.nextTick(pt):lt!=null&&lt.errorEmitted||ft!=null&&ft.errorEmitted?X||n.nextTick(_t):(!H&&(!X||y(D))&&(st||_(D)===!1)||!rt&&(!X||_(D))&&(wt||y(D)===!1)||ft&&D.req&&D.aborted)&&n.nextTick(_t);let gt=()=>{P=q,D.removeListener("aborted",pt),D.removeListener("complete",bt),D.removeListener("abort",pt),D.removeListener("request",At),D.req&&D.req.removeListener("finish",bt),D.removeListener("end",K),D.removeListener("close",K),D.removeListener("finish",bt),D.removeListener("end",Q),D.removeListener("error",W),D.removeListener("close",pt)};if(F.signal&&!at){let xt=()=>{let $t=P;gt(),$t.call(D,new t(void 0,{cause:F.signal.reason}))};if(F.signal.aborted)n.nextTick(xt);else{L=L||_s().addAbortListener;let $t=L(F.signal,xt),Nt=P;P=a((...Ot)=>{$t[p](),Nt.apply(D,Ot)})}}return gt}function J(D,F,P){let V=!1,$=q;if(F.signal)if($=()=>{V=!0,P.call(D,new t(void 0,{cause:F.signal.reason}))},F.signal.aborted)n.nextTick($);else{L=L||_s().addAbortListener;let rt=L(F.signal,$),lt=P;P=a((...ft)=>{rt[p](),lt.apply(D,ft)})}let H=(...rt)=>{V||n.nextTick(()=>P.apply(D,rt))};return d(D[Y].promise,H,H),q}function N(D,F){var P;let V=!1;return F===null&&(F=s),(P=F)!==null&&P!==void 0&&P.cleanup&&(h(F.cleanup,"cleanup"),V=F.cleanup),new f(($,H)=>{let rt=nt(D,F,lt=>{V&&rt(),lt?H(lt):$()})})}return uR=nt,uR.finished=N,uR}function lb(){if(iW)return qk;iW=!0;let n=$n,{aggregateTwoErrors:t,codes:{ERR_MULTIPLE_CALLBACK:e},AbortError:r}=Zs(),{Symbol:i}=_n(),{kIsDestroyed:s,isDestroyed:a,isFinished:o,isServerRequest:c}=Nu(),u=i("kDestroy"),h=i("kConstruct");function f(G,Y,L){G&&(G.stack,Y&&!Y.errored&&(Y.errored=G),L&&!L.errored&&(L.errored=G))}function d(G,Y){let L=this._readableState,j=this._writableState,q=j||L;return j!=null&&j.destroyed||L!=null&&L.destroyed?(typeof Y=="function"&&Y(),this):(f(G,j,L),j&&(j.destroyed=!0),L&&(L.destroyed=!0),q.constructed?p(this,G,Y):this.once(u,function(nt){p(this,t(nt,G),Y)}),this)}function p(G,Y,L){let j=!1;function q(nt){if(j)return;j=!0;let J=G._readableState,N=G._writableState;f(nt,N,J),N&&(N.closed=!0),J&&(J.closed=!0),typeof L=="function"&&L(nt),nt?n.nextTick(g,G,nt):n.nextTick(y,G)}try{G._destroy(Y||null,q)}catch(nt){q(nt)}}function g(G,Y){b(G,Y),y(G)}function y(G){let Y=G._readableState,L=G._writableState;L&&(L.closeEmitted=!0),Y&&(Y.closeEmitted=!0),(L!=null&&L.emitClose||Y!=null&&Y.emitClose)&&G.emit("close")}function b(G,Y){let L=G._readableState,j=G._writableState;j!=null&&j.errorEmitted||L!=null&&L.errorEmitted||(j&&(j.errorEmitted=!0),L&&(L.errorEmitted=!0),G.emit("error",Y))}function m(){let G=this._readableState,Y=this._writableState;G&&(G.constructed=!0,G.closed=!1,G.closeEmitted=!1,G.destroyed=!1,G.errored=null,G.errorEmitted=!1,G.reading=!1,G.ended=G.readable===!1,G.endEmitted=G.readable===!1),Y&&(Y.constructed=!0,Y.destroyed=!1,Y.closed=!1,Y.closeEmitted=!1,Y.errored=null,Y.errorEmitted=!1,Y.finalCalled=!1,Y.prefinished=!1,Y.ended=Y.writable===!1,Y.ending=Y.writable===!1,Y.finished=Y.writable===!1)}function w(G,Y,L){let j=G._readableState,q=G._writableState;if(q!=null&&q.destroyed||j!=null&&j.destroyed)return this;j!=null&&j.autoDestroy||q!=null&&q.autoDestroy?G.destroy(Y):Y&&(Y.stack,q&&!q.errored&&(q.errored=Y),j&&!j.errored&&(j.errored=Y),L?n.nextTick(b,G,Y):b(G,Y))}function A(G,Y){if(typeof G._construct!="function")return;let L=G._readableState,j=G._writableState;L&&(L.constructed=!1),j&&(j.constructed=!1),G.once(h,Y),!(G.listenerCount(h)>1)&&n.nextTick(_,G)}function _(G){let Y=!1;function L(j){if(Y){w(G,j??new e);return}Y=!0;let q=G._readableState,nt=G._writableState,J=nt||q;q&&(q.constructed=!0),nt&&(nt.constructed=!0),J.destroyed?G.emit(u,j):j?w(G,j,!0):n.nextTick(S,G)}try{G._construct(j=>{n.nextTick(L,j)})}catch(j){n.nextTick(L,j)}}function S(G){G.emit(h)}function I(G){return G?.setHeader&&typeof G.abort=="function"}function C(G){G.emit("close")}function M(G,Y){G.emit("error",Y),n.nextTick(C,G)}function z(G,Y){!G||a(G)||(!Y&&!o(G)&&(Y=new r),c(G)?(G.socket=null,G.destroy(Y)):I(G)?G.abort():I(G.req)?G.req.abort():typeof G.destroy=="function"?G.destroy(Y):typeof G.close=="function"?G.close():Y?n.nextTick(M,G,Y):n.nextTick(C,G),G.destroyed||(G[s]=!0))}return qk={construct:A,destroyer:z,destroy:d,undestroy:m,errorOrDestroy:w},qk}function uM(){if(sW)return Yk;sW=!0;let{ArrayIsArray:n,ObjectSetPrototypeOf:t}=_n(),{EventEmitter:e}=uc;function r(s){e.call(this,s)}t(r.prototype,e.prototype),t(r,e),r.prototype.pipe=function(s,a){let o=this;function c(y){s.writable&&s.write(y)===!1&&o.pause&&o.pause()}o.on("data",c);function u(){o.readable&&o.resume&&o.resume()}s.on("drain",u),!s._isStdio&&(!a||a.end!==!1)&&(o.on("end",f),o.on("close",d));let h=!1;function f(){h||(h=!0,s.end())}function d(){h||(h=!0,typeof s.destroy=="function"&&s.destroy())}function p(y){g(),e.listenerCount(this,"error")===0&&this.emit("error",y)}i(o,"error",p),i(s,"error",p);function g(){o.removeListener("data",c),s.removeListener("drain",u),o.removeListener("end",f),o.removeListener("close",d),o.removeListener("error",p),s.removeListener("error",p),o.removeListener("end",g),o.removeListener("close",g),s.removeListener("close",g)}return o.on("end",g),o.on("close",g),s.on("close",g),s.emit("pipe",o),s};function i(s,a,o){if(typeof s.prependListener=="function")return s.prependListener(a,o);!s._events||!s._events[a]?s.on(a,o):n(s._events[a])?s._events[a].unshift(o):s._events[a]=[o,s._events[a]]}return Yk={Stream:r,prependListener:i},Yk}function fR(){if(aW)return JE;aW=!0;let{SymbolDispose:n}=_n(),{AbortError:t,codes:e}=Zs(),{isNodeStream:r,isWebStream:i,kControllerErrorFunction:s}=Nu(),a=$f(),{ERR_INVALID_ARG_TYPE:o}=e,c,u=(h,f)=>{if(typeof h!="object"||!("aborted"in h))throw new o(f,"AbortSignal",h)};return JE.addAbortSignal=function(f,d){if(u(f,"signal"),!r(d)&&!i(d))throw new o("stream",["ReadableStream","WritableStream","Stream"],d);return JE.addAbortSignalNoValidate(f,d)},JE.addAbortSignalNoValidate=function(h,f){if(typeof h!="object"||!("aborted"in h))return f;let d=r(f)?()=>{f.destroy(new t(void 0,{cause:h.reason}))}:()=>{f[s](new t(void 0,{cause:h.reason}))};if(h.aborted)d();else{c=c||_s().addAbortListener;let p=c(h,d);a(f,p[n])}return f},JE}function Alt(){if(oW)return Kk;oW=!0;let{StringPrototypeSlice:n,SymbolIterator:t,TypedArrayPrototypeSet:e,Uint8Array:r}=_n(),{Buffer:i}=vi(),{inspect:s}=_s();return Kk=class{constructor(){this.head=null,this.tail=null,this.length=0}push(o){let c={data:o,next:null};this.length>0?this.tail.next=c:this.head=c,this.tail=c,++this.length}unshift(o){let c={data:o,next:this.head};this.length===0&&(this.tail=c),this.head=c,++this.length}shift(){if(this.length===0)return;let o=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,o}clear(){this.head=this.tail=null,this.length=0}join(o){if(this.length===0)return"";let c=this.head,u=""+c.data;for(;(c=c.next)!==null;)u+=o+c.data;return u}concat(o){if(this.length===0)return i.alloc(0);let c=i.allocUnsafe(o>>>0),u=this.head,h=0;for(;u;)e(c,u.data,h),h+=u.data.length,u=u.next;return c}consume(o,c){let u=this.head.data;if(o<u.length){let h=u.slice(0,o);return this.head.data=u.slice(o),h}return o===u.length?this.shift():c?this._getString(o):this._getBuffer(o)}first(){return this.head.data}*[t](){for(let o=this.head;o;o=o.next)yield o.data}_getString(o){let c="",u=this.head,h=0;do{let f=u.data;if(o>f.length)c+=f,o-=f.length;else{o===f.length?(c+=f,++h,u.next?this.head=u.next:this.head=this.tail=null):(c+=n(f,0,o),this.head=u,u.data=n(f,o));break}++h}while((u=u.next)!==null);return this.length-=h,c}_getBuffer(o){let c=i.allocUnsafe(o),u=o,h=this.head,f=0;do{let d=h.data;if(o>d.length)e(c,d,u-o),o-=d.length;else{o===d.length?(e(c,d,u-o),++f,h.next?this.head=h.next:this.head=this.tail=null):(e(c,new r(d.buffer,d.byteOffset,o),u-o),this.head=h,h.data=d.slice(o));break}++f}while((h=h.next)!==null);return this.length-=f,c}[Symbol.for("nodejs.util.inspect.custom")](o,c){return s(this,{...c,depth:0,customInspect:!1})}},Kk}function dR(){if(lW)return Zk;lW=!0;let{MathFloor:n,NumberIsInteger:t}=_n(),{validateInteger:e}=t1(),{ERR_INVALID_ARG_VALUE:r}=Zs().codes,i=16*1024,s=16;function a(h,f,d){return h.highWaterMark!=null?h.highWaterMark:f?h[d]:null}function o(h){return h?s:i}function c(h,f){e(f,"value",0),h?s=f:i=f}function u(h,f,d,p){let g=a(f,p,d);if(g!=null){if(!t(g)||g<0){let y=p?`options.${d}`:"options.highWaterMark";throw new r(y,g)}return n(g)}return o(h.objectMode)}return Zk={getHighWaterMark:u,getDefaultHighWaterMark:o,setDefaultHighWaterMark:c},Zk}function xW(){if(cW)return Jk;cW=!0;let n=$n,{PromisePrototypeThen:t,SymbolAsyncIterator:e,SymbolIterator:r}=_n(),{Buffer:i}=vi(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:a}=Zs().codes;function o(c,u,h){let f;if(typeof u=="string"||u instanceof i)return new c({objectMode:!0,...h,read(){this.push(u),this.push(null)}});let d;if(u&&u[e])d=!0,f=u[e]();else if(u&&u[r])d=!1,f=u[r]();else throw new s("iterable",["Iterable"],u);let p=new c({objectMode:!0,highWaterMark:1,...h}),g=!1;p._read=function(){g||(g=!0,b())},p._destroy=function(m,w){t(y(m),()=>n.nextTick(w,m),A=>n.nextTick(w,A||m))};async function y(m){let w=m!=null,A=typeof f.throw=="function";if(w&&A){let{value:_,done:S}=await f.throw(m);if(await _,S)return}if(typeof f.return=="function"){let{value:_}=await f.return();await _}}async function b(){for(;;){try{let{value:m,done:w}=d?await f.next():f.next();if(w)p.push(null);else{let A=m&&typeof m.then=="function"?await m:m;if(A===null)throw g=!1,new a;if(p.push(A))continue;g=!1}}catch(m){p.destroy(m)}break}}return p}return Jk=o,Jk}function pR(){if(uW)return Qk;uW=!0;let n=$n,{ArrayPrototypeIndexOf:t,NumberIsInteger:e,NumberIsNaN:r,NumberParseInt:i,ObjectDefineProperties:s,ObjectKeys:a,ObjectSetPrototypeOf:o,Promise:c,SafeSet:u,SymbolAsyncDispose:h,SymbolAsyncIterator:f,Symbol:d}=_n();Qk=Ot,Ot.ReadableState=Nt;let{EventEmitter:p}=uc,{Stream:g,prependListener:y}=uM(),{Buffer:b}=vi(),{addAbortSignal:m}=fR(),w=$f(),A=_s().debuglog("stream",ut=>{A=ut}),_=Alt(),S=lb(),{getHighWaterMark:I,getDefaultHighWaterMark:C}=dR(),{aggregateTwoErrors:M,codes:{ERR_INVALID_ARG_TYPE:z,ERR_METHOD_NOT_IMPLEMENTED:G,ERR_OUT_OF_RANGE:Y,ERR_STREAM_PUSH_AFTER_EOF:L,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:j},AbortError:q}=Zs(),{validateObject:nt}=t1(),J=d("kPaused"),{StringDecoder:N}=lR,D=xW();o(Ot.prototype,g.prototype),o(Ot,g);let F=()=>{},{errorOrDestroy:P}=S,V=1,$=2,H=4,rt=8,lt=16,ft=32,K=64,X=128,st=256,bt=512,wt=1024,Q=2048,W=4096,at=8192,pt=16384,_t=32768,At=65536,gt=1<<17,xt=1<<18;function $t(ut){return{enumerable:!1,get(){return((this||Gt).state&ut)!==0},set(yt){yt?(this||Gt).state|=ut:(this||Gt).state&=~ut}}}s(Nt.prototype,{objectMode:$t(V),ended:$t($),endEmitted:$t(H),reading:$t(rt),constructed:$t(lt),sync:$t(ft),needReadable:$t(K),emittedReadable:$t(X),readableListening:$t(st),resumeScheduled:$t(bt),errorEmitted:$t(wt),emitClose:$t(Q),autoDestroy:$t(W),destroyed:$t(at),closed:$t(pt),closeEmitted:$t(_t),multiAwaitDrain:$t(At),readingMore:$t(gt),dataEmitted:$t(xt)});function Nt(ut,yt,Wt){typeof Wt!="boolean"&&(Wt=yt instanceof Pu()),(this||Gt).state=Q|W|lt|ft,ut&&ut.objectMode&&((this||Gt).state|=V),Wt&&ut&&ut.readableObjectMode&&((this||Gt).state|=V),(this||Gt).highWaterMark=ut?I(this||Gt,ut,"readableHighWaterMark",Wt):C(!1),(this||Gt).buffer=new _,(this||Gt).length=0,(this||Gt).pipes=[],(this||Gt).flowing=null,(this||Gt)[J]=null,ut&&ut.emitClose===!1&&((this||Gt).state&=~Q),ut&&ut.autoDestroy===!1&&((this||Gt).state&=~W),(this||Gt).errored=null,(this||Gt).defaultEncoding=ut&&ut.defaultEncoding||"utf8",(this||Gt).awaitDrainWriters=null,(this||Gt).decoder=null,(this||Gt).encoding=null,ut&&ut.encoding&&((this||Gt).decoder=new N(ut.encoding),(this||Gt).encoding=ut.encoding)}function Ot(ut){if(!((this||Gt)instanceof Ot))return new Ot(ut);let yt=(this||Gt)instanceof Pu();(this||Gt)._readableState=new Nt(ut,this||Gt,yt),ut&&(typeof ut.read=="function"&&((this||Gt)._read=ut.read),typeof ut.destroy=="function"&&((this||Gt)._destroy=ut.destroy),typeof ut.construct=="function"&&((this||Gt)._construct=ut.construct),ut.signal&&!yt&&m(ut.signal,this||Gt)),g.call(this||Gt,ut),S.construct(this||Gt,()=>{(this||Gt)._readableState.needReadable&&k(this||Gt,(this||Gt)._readableState)})}Ot.prototype.destroy=S.destroy,Ot.prototype._undestroy=S.undestroy,Ot.prototype._destroy=function(ut,yt){yt(ut)},Ot.prototype[p.captureRejectionSymbol]=function(ut){this.destroy(ut)},Ot.prototype[h]=function(){let ut;return(this||Gt).destroyed||(ut=(this||Gt).readableEnded?null:new q,this.destroy(ut)),new c((yt,Wt)=>w(this||Gt,jt=>jt&&jt!==ut?Wt(jt):yt(null)))},Ot.prototype.push=function(ut,yt){return qt(this||Gt,ut,yt,!1)},Ot.prototype.unshift=function(ut,yt){return qt(this||Gt,ut,yt,!0)};function qt(ut,yt,Wt,jt){A("readableAddChunk",yt);let Zt=ut._readableState,be;if((Zt.state&V)===0&&(typeof yt=="string"?(Wt=Wt||Zt.defaultEncoding,Zt.encoding!==Wt&&(jt&&Zt.encoding?yt=b.from(yt,Wt).toString(Zt.encoding):(yt=b.from(yt,Wt),Wt=""))):yt instanceof b?Wt="":g._isUint8Array(yt)?(yt=g._uint8ArrayToBuffer(yt),Wt=""):yt!=null&&(be=new z("chunk",["string","Buffer","Uint8Array"],yt))),be)P(ut,be);else if(yt===null)Zt.state&=~rt,E(ut,Zt);else if((Zt.state&V)!==0||yt&&yt.length>0)if(jt)if((Zt.state&H)!==0)P(ut,new j);else{if(Zt.destroyed||Zt.errored)return!1;Jt(ut,Zt,yt,!0)}else if(Zt.ended)P(ut,new L);else{if(Zt.destroyed||Zt.errored)return!1;Zt.state&=~rt,Zt.decoder&&!Wt?(yt=Zt.decoder.write(yt),Zt.objectMode||yt.length!==0?Jt(ut,Zt,yt,!1):k(ut,Zt)):Jt(ut,Zt,yt,!1)}else jt||(Zt.state&=~rt,k(ut,Zt));return!Zt.ended&&(Zt.length<Zt.highWaterMark||Zt.length===0)}function Jt(ut,yt,Wt,jt){yt.flowing&&yt.length===0&&!yt.sync&&ut.listenerCount("data")>0?((yt.state&At)!==0?yt.awaitDrainWriters.clear():yt.awaitDrainWriters=null,yt.dataEmitted=!0,ut.emit("data",Wt)):(yt.length+=yt.objectMode?1:Wt.length,jt?yt.buffer.unshift(Wt):yt.buffer.push(Wt),(yt.state&K)!==0&&B(ut)),k(ut,yt)}Ot.prototype.isPaused=function(){let ut=(this||Gt)._readableState;return ut[J]===!0||ut.flowing===!1},Ot.prototype.setEncoding=function(ut){let yt=new N(ut);(this||Gt)._readableState.decoder=yt,(this||Gt)._readableState.encoding=(this||Gt)._readableState.decoder.encoding;let Wt=(this||Gt)._readableState.buffer,jt="";for(let Zt of Wt)jt+=yt.write(Zt);return Wt.clear(),jt!==""&&Wt.push(jt),(this||Gt)._readableState.length=jt.length,this||Gt};let te=1073741824;function O(ut){if(ut>te)throw new Y("size","<= 1GiB",ut);return ut--,ut|=ut>>>1,ut|=ut>>>2,ut|=ut>>>4,ut|=ut>>>8,ut|=ut>>>16,ut++,ut}function v(ut,yt){return ut<=0||yt.length===0&&yt.ended?0:(yt.state&V)!==0?1:r(ut)?yt.flowing&&yt.length?yt.buffer.first().length:yt.length:ut<=yt.length?ut:yt.ended?yt.length:0}Ot.prototype.read=function(ut){A("read",ut),ut===void 0?ut=NaN:e(ut)||(ut=i(ut,10));let yt=(this||Gt)._readableState,Wt=ut;if(ut>yt.highWaterMark&&(yt.highWaterMark=O(ut)),ut!==0&&(yt.state&=~X),ut===0&&yt.needReadable&&((yt.highWaterMark!==0?yt.length>=yt.highWaterMark:yt.length>0)||yt.ended))return A("read: emitReadable",yt.length,yt.ended),yt.length===0&&yt.ended?Ht(this||Gt):B(this||Gt),null;if(ut=v(ut,yt),ut===0&&yt.ended)return yt.length===0&&Ht(this||Gt),null;let jt=(yt.state&K)!==0;if(A("need readable",jt),(yt.length===0||yt.length-ut<yt.highWaterMark)&&(jt=!0,A("length less than watermark",jt)),yt.ended||yt.reading||yt.destroyed||yt.errored||!yt.constructed)jt=!1,A("reading, ended or constructing",jt);else if(jt){A("do read"),yt.state|=rt|ft,yt.length===0&&(yt.state|=K);try{this._read(yt.highWaterMark)}catch(be){P(this||Gt,be)}yt.state&=~ft,yt.reading||(ut=v(Wt,yt))}let Zt;return ut>0?Zt=Mt(ut,yt):Zt=null,Zt===null?(yt.needReadable=yt.length<=yt.highWaterMark,ut=0):(yt.length-=ut,yt.multiAwaitDrain?yt.awaitDrainWriters.clear():yt.awaitDrainWriters=null),yt.length===0&&(yt.ended||(yt.needReadable=!0),Wt!==ut&&yt.ended&&Ht(this||Gt)),Zt!==null&&!yt.errorEmitted&&!yt.closeEmitted&&(yt.dataEmitted=!0,this.emit("data",Zt)),Zt};function E(ut,yt){if(A("onEofChunk"),!yt.ended){if(yt.decoder){let Wt=yt.decoder.end();Wt&&Wt.length&&(yt.buffer.push(Wt),yt.length+=yt.objectMode?1:Wt.length)}yt.ended=!0,yt.sync?B(ut):(yt.needReadable=!1,yt.emittedReadable=!0,it(ut))}}function B(ut){let yt=ut._readableState;A("emitReadable",yt.needReadable,yt.emittedReadable),yt.needReadable=!1,yt.emittedReadable||(A("emitReadable",yt.flowing),yt.emittedReadable=!0,n.nextTick(it,ut))}function it(ut){let yt=ut._readableState;A("emitReadable_",yt.destroyed,yt.length,yt.ended),!yt.destroyed&&!yt.errored&&(yt.length||yt.ended)&&(ut.emit("readable"),yt.emittedReadable=!1),yt.needReadable=!yt.flowing&&!yt.ended&&yt.length<=yt.highWaterMark,Ut(ut)}function k(ut,yt){!yt.readingMore&&yt.constructed&&(yt.readingMore=!0,n.nextTick(ct,ut,yt))}function ct(ut,yt){for(;!yt.reading&&!yt.ended&&(yt.length<yt.highWaterMark||yt.flowing&&yt.length===0);){let Wt=yt.length;if(A("maybeReadMore read 0"),ut.read(0),Wt===yt.length)break}yt.readingMore=!1}Ot.prototype._read=function(ut){throw new G("_read()")},Ot.prototype.pipe=function(ut,yt){let Wt=this||Gt,jt=(this||Gt)._readableState;jt.pipes.length===1&&(jt.multiAwaitDrain||(jt.multiAwaitDrain=!0,jt.awaitDrainWriters=new u(jt.awaitDrainWriters?[jt.awaitDrainWriters]:[]))),jt.pipes.push(ut),A("pipe count=%d opts=%j",jt.pipes.length,yt);let be=(!yt||yt.end!==!1)&&ut!==n.stdout&&ut!==n.stderr?Oe:ri;jt.endEmitted?n.nextTick(be):Wt.once("end",be),ut.on("unpipe",He);function He(ni,ii){A("onunpipe"),ni===Wt&&ii&&ii.hasUnpiped===!1&&(ii.hasUnpiped=!0,Es())}function Oe(){A("onend"),ut.end()}let Br,ma=!1;function Es(){A("cleanup"),ut.removeListener("close",cr),ut.removeListener("finish",yr),Br&&ut.removeListener("drain",Br),ut.removeListener("error",en),ut.removeListener("unpipe",He),Wt.removeListener("end",Oe),Wt.removeListener("end",ri),Wt.removeListener("data",En),ma=!0,Br&&jt.awaitDrainWriters&&(!ut._writableState||ut._writableState.needDrain)&&Br()}function dr(){ma||(jt.pipes.length===1&&jt.pipes[0]===ut?(A("false write response, pause",0),jt.awaitDrainWriters=ut,jt.multiAwaitDrain=!1):jt.pipes.length>1&&jt.pipes.includes(ut)&&(A("false write response, pause",jt.awaitDrainWriters.size),jt.awaitDrainWriters.add(ut)),Wt.pause()),Br||(Br=mt(Wt,ut),ut.on("drain",Br))}Wt.on("data",En);function En(ni){A("ondata");let ii=ut.write(ni);A("dest.write",ii),ii===!1&&dr()}function en(ni){if(A("onerror",ni),ri(),ut.removeListener("error",en),ut.listenerCount("error")===0){let ii=ut._writableState||ut._readableState;ii&&!ii.errorEmitted?P(ut,ni):ut.emit("error",ni)}}y(ut,"error",en);function cr(){ut.removeListener("finish",yr),ri()}ut.once("close",cr);function yr(){A("onfinish"),ut.removeListener("close",cr),ri()}ut.once("finish",yr);function ri(){A("unpipe"),Wt.unpipe(ut)}return ut.emit("pipe",Wt),ut.writableNeedDrain===!0?dr():jt.flowing||(A("pipe resume"),Wt.resume()),ut};function mt(ut,yt){return function(){let jt=ut._readableState;jt.awaitDrainWriters===yt?(A("pipeOnDrain",1),jt.awaitDrainWriters=null):jt.multiAwaitDrain&&(A("pipeOnDrain",jt.awaitDrainWriters.size),jt.awaitDrainWriters.delete(yt)),(!jt.awaitDrainWriters||jt.awaitDrainWriters.size===0)&&ut.listenerCount("data")&&ut.resume()}}Ot.prototype.unpipe=function(ut){let yt=(this||Gt)._readableState,Wt={hasUnpiped:!1};if(yt.pipes.length===0)return this||Gt;if(!ut){let Zt=yt.pipes;yt.pipes=[],this.pause();for(let be=0;be<Zt.length;be++)Zt[be].emit("unpipe",this||Gt,{hasUnpiped:!1});return this||Gt}let jt=t(yt.pipes,ut);return jt===-1?this||Gt:(yt.pipes.splice(jt,1),yt.pipes.length===0&&this.pause(),ut.emit("unpipe",this||Gt,Wt),this||Gt)},Ot.prototype.on=function(ut,yt){let Wt=g.prototype.on.call(this||Gt,ut,yt),jt=(this||Gt)._readableState;return ut==="data"?(jt.readableListening=this.listenerCount("readable")>0,jt.flowing!==!1&&this.resume()):ut==="readable"&&!jt.endEmitted&&!jt.readableListening&&(jt.readableListening=jt.needReadable=!0,jt.flowing=!1,jt.emittedReadable=!1,A("on readable",jt.length,jt.reading),jt.length?B(this||Gt):jt.reading||n.nextTick(Et,this||Gt)),Wt},Ot.prototype.addListener=Ot.prototype.on,Ot.prototype.removeListener=function(ut,yt){let Wt=g.prototype.removeListener.call(this||Gt,ut,yt);return ut==="readable"&&n.nextTick(St,this||Gt),Wt},Ot.prototype.off=Ot.prototype.removeListener,Ot.prototype.removeAllListeners=function(ut){let yt=g.prototype.removeAllListeners.apply(this||Gt,arguments);return(ut==="readable"||ut===void 0)&&n.nextTick(St,this||Gt),yt};function St(ut){let yt=ut._readableState;yt.readableListening=ut.listenerCount("readable")>0,yt.resumeScheduled&&yt[J]===!1?yt.flowing=!0:ut.listenerCount("data")>0?ut.resume():yt.readableListening||(yt.flowing=null)}function Et(ut){A("readable nexttick read 0"),ut.read(0)}Ot.prototype.resume=function(){let ut=(this||Gt)._readableState;return ut.flowing||(A("resume"),ut.flowing=!ut.readableListening,Dt(this||Gt,ut)),ut[J]=!1,this||Gt};function Dt(ut,yt){yt.resumeScheduled||(yt.resumeScheduled=!0,n.nextTick(et,ut,yt))}function et(ut,yt){A("resume",yt.reading),yt.reading||ut.read(0),yt.resumeScheduled=!1,ut.emit("resume"),Ut(ut),yt.flowing&&!yt.reading&&ut.read(0)}Ot.prototype.pause=function(){return A("call pause flowing=%j",(this||Gt)._readableState.flowing),(this||Gt)._readableState.flowing!==!1&&(A("pause"),(this||Gt)._readableState.flowing=!1,this.emit("pause")),(this||Gt)._readableState[J]=!0,this||Gt};function Ut(ut){let yt=ut._readableState;for(A("flow",yt.flowing);yt.flowing&&ut.read()!==null;);}Ot.prototype.wrap=function(ut){let yt=!1;ut.on("data",jt=>{!this.push(jt)&&ut.pause&&(yt=!0,ut.pause())}),ut.on("end",()=>{this.push(null)}),ut.on("error",jt=>{P(this||Gt,jt)}),ut.on("close",()=>{this.destroy()}),ut.on("destroy",()=>{this.destroy()}),(this||Gt)._read=()=>{yt&&ut.resume&&(yt=!1,ut.resume())};let Wt=a(ut);for(let jt=1;jt<Wt.length;jt++){let Zt=Wt[jt];(this||Gt)[Zt]===void 0&&typeof ut[Zt]=="function"&&((this||Gt)[Zt]=ut[Zt].bind(ut))}return this||Gt},Ot.prototype[f]=function(){return oe(this||Gt)},Ot.prototype.iterator=function(ut){return ut!==void 0&&nt(ut,"options"),oe(this||Gt,ut)};function oe(ut,yt){typeof ut.read!="function"&&(ut=Ot.wrap(ut,{objectMode:!0}));let Wt=U(ut,yt);return Wt.stream=ut,Wt}async function*U(ut,yt){let Wt=F;function jt(He){(this||Gt)===ut?(Wt(),Wt=F):Wt=He}ut.on("readable",jt);let Zt,be=w(ut,{writable:!1},He=>{Zt=He?M(Zt,He):null,Wt(),Wt=F});try{for(;;){let He=ut.destroyed?null:ut.read();if(He!==null)yield He;else{if(Zt)throw Zt;if(Zt===null)return;await new c(jt)}}}catch(He){throw Zt=M(Zt,He),Zt}finally{(Zt||yt?.destroyOnReturn!==!1)&&(Zt===void 0||ut._readableState.autoDestroy)?S.destroyer(ut,null):(ut.off("readable",jt),be())}}s(Ot.prototype,{readable:{__proto__:null,get(){let ut=(this||Gt)._readableState;return!!ut&&ut.readable!==!1&&!ut.destroyed&&!ut.errorEmitted&&!ut.endEmitted},set(ut){(this||Gt)._readableState&&((this||Gt)._readableState.readable=!!ut)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return(this||Gt)._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!((this||Gt)._readableState.readable!==!1&&((this||Gt)._readableState.destroyed||(this||Gt)._readableState.errored)&&!(this||Gt)._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return(this||Gt)._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return(this||Gt)._readableState&&(this||Gt)._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return(this||Gt)._readableState.flowing},set:function(ut){(this||Gt)._readableState&&((this||Gt)._readableState.flowing=ut)}},readableLength:{__proto__:null,enumerable:!1,get(){return(this||Gt)._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return(this||Gt)._readableState?(this||Gt)._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return(this||Gt)._readableState?(this||Gt)._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return(this||Gt)._readableState?(this||Gt)._readableState.errored:null}},closed:{__proto__:null,get(){return(this||Gt)._readableState?(this||Gt)._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return(this||Gt)._readableState?(this||Gt)._readableState.destroyed:!1},set(ut){(this||Gt)._readableState&&((this||Gt)._readableState.destroyed=ut)}},readableEnded:{__proto__:null,enumerable:!1,get(){return(this||Gt)._readableState?(this||Gt)._readableState.endEmitted:!1}}}),s(Nt.prototype,{pipesCount:{__proto__:null,get(){return(this||Gt).pipes.length}},paused:{__proto__:null,get(){return(this||Gt)[J]!==!1},set(ut){(this||Gt)[J]=!!ut}}}),Ot._fromList=Mt;function Mt(ut,yt){if(yt.length===0)return null;let Wt;return yt.objectMode?Wt=yt.buffer.shift():!ut||ut>=yt.length?(yt.decoder?Wt=yt.buffer.join(""):yt.buffer.length===1?Wt=yt.buffer.first():Wt=yt.buffer.concat(yt.length),yt.buffer.clear()):Wt=yt.buffer.consume(ut,yt.decoder),Wt}function Ht(ut){let yt=ut._readableState;A("endReadable",yt.endEmitted),yt.endEmitted||(yt.ended=!0,n.nextTick(dt,yt,ut))}function dt(ut,yt){if(A("endReadableNT",ut.endEmitted,ut.length),!ut.errored&&!ut.closeEmitted&&!ut.endEmitted&&ut.length===0){if(ut.endEmitted=!0,yt.emit("end"),yt.writable&&yt.allowHalfOpen===!1)n.nextTick(It,yt);else if(ut.autoDestroy){let Wt=yt._writableState;(!Wt||Wt.autoDestroy&&(Wt.finished||Wt.writable===!1))&&yt.destroy()}}}function It(ut){ut.writable&&!ut.writableEnded&&!ut.destroyed&&ut.end()}Ot.from=function(ut,yt){return D(Ot,ut,yt)};let Ft;function de(){return Ft===void 0&&(Ft={}),Ft}return Ot.fromWeb=function(ut,yt){return de().newStreamReadableFromReadableStream(ut,yt)},Ot.toWeb=function(ut,yt){return de().newReadableStreamFromStreamReadable(ut,yt)},Ot.wrap=function(ut,yt){var Wt,jt;return new Ot({objectMode:(Wt=(jt=ut.readableObjectMode)!==null&&jt!==void 0?jt:ut.objectMode)!==null&&Wt!==void 0?Wt:!0,...yt,destroy(Zt,be){S.destroyer(ut,Zt),be(Zt)}}).wrap(ut)},Qk}function hM(){if(hW)return tM;hW=!0;let n=$n,{ArrayPrototypeSlice:t,Error:e,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:i,ObjectDefineProperties:s,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:o,Symbol:c,SymbolHasInstance:u}=_n();tM=nt,nt.WritableState=j;let{EventEmitter:h}=uc,f=uM().Stream,{Buffer:d}=vi(),p=lb(),{addAbortSignal:g}=fR(),{getHighWaterMark:y,getDefaultHighWaterMark:b}=dR(),{ERR_INVALID_ARG_TYPE:m,ERR_METHOD_NOT_IMPLEMENTED:w,ERR_MULTIPLE_CALLBACK:A,ERR_STREAM_CANNOT_PIPE:_,ERR_STREAM_DESTROYED:S,ERR_STREAM_ALREADY_FINISHED:I,ERR_STREAM_NULL_VALUES:C,ERR_STREAM_WRITE_AFTER_END:M,ERR_UNKNOWN_ENCODING:z}=Zs().codes,{errorOrDestroy:G}=p;a(nt.prototype,f.prototype),a(nt,f);function Y(){}let L=c("kOnFinished");function j(W,at,pt){typeof pt!="boolean"&&(pt=at instanceof Pu()),(this||Kt).objectMode=!!(W&&W.objectMode),pt&&((this||Kt).objectMode=(this||Kt).objectMode||!!(W&&W.writableObjectMode)),(this||Kt).highWaterMark=W?y(this||Kt,W,"writableHighWaterMark",pt):b(!1),(this||Kt).finalCalled=!1,(this||Kt).needDrain=!1,(this||Kt).ending=!1,(this||Kt).ended=!1,(this||Kt).finished=!1,(this||Kt).destroyed=!1;let _t=!!(W&&W.decodeStrings===!1);(this||Kt).decodeStrings=!_t,(this||Kt).defaultEncoding=W&&W.defaultEncoding||"utf8",(this||Kt).length=0,(this||Kt).writing=!1,(this||Kt).corked=0,(this||Kt).sync=!0,(this||Kt).bufferProcessing=!1,(this||Kt).onwrite=P.bind(void 0,at),(this||Kt).writecb=null,(this||Kt).writelen=0,(this||Kt).afterWriteTickInfo=null,q(this||Kt),(this||Kt).pendingcb=0,(this||Kt).constructed=!0,(this||Kt).prefinished=!1,(this||Kt).errorEmitted=!1,(this||Kt).emitClose=!W||W.emitClose!==!1,(this||Kt).autoDestroy=!W||W.autoDestroy!==!1,(this||Kt).errored=null,(this||Kt).closed=!1,(this||Kt).closeEmitted=!1,(this||Kt)[L]=[]}function q(W){W.buffered=[],W.bufferedIndex=0,W.allBuffers=!0,W.allNoop=!0}j.prototype.getBuffer=function(){return t((this||Kt).buffered,(this||Kt).bufferedIndex)},i(j.prototype,"bufferedRequestCount",{__proto__:null,get(){return(this||Kt).buffered.length-(this||Kt).bufferedIndex}});function nt(W){let at=(this||Kt)instanceof Pu();if(!at&&!r(nt,this||Kt))return new nt(W);(this||Kt)._writableState=new j(W,this||Kt,at),W&&(typeof W.write=="function"&&((this||Kt)._write=W.write),typeof W.writev=="function"&&((this||Kt)._writev=W.writev),typeof W.destroy=="function"&&((this||Kt)._destroy=W.destroy),typeof W.final=="function"&&((this||Kt)._final=W.final),typeof W.construct=="function"&&((this||Kt)._construct=W.construct),W.signal&&g(W.signal,this||Kt)),f.call(this||Kt,W),p.construct(this||Kt,()=>{let pt=(this||Kt)._writableState;pt.writing||rt(this||Kt,pt),X(this||Kt,pt)})}i(nt,u,{__proto__:null,value:function(W){return r(this||Kt,W)?!0:(this||Kt)!==nt?!1:W&&W._writableState instanceof j}}),nt.prototype.pipe=function(){G(this||Kt,new _)};function J(W,at,pt,_t){let At=W._writableState;if(typeof pt=="function")_t=pt,pt=At.defaultEncoding;else{if(!pt)pt=At.defaultEncoding;else if(pt!=="buffer"&&!d.isEncoding(pt))throw new z(pt);typeof _t!="function"&&(_t=Y)}if(at===null)throw new C;if(!At.objectMode)if(typeof at=="string")At.decodeStrings!==!1&&(at=d.from(at,pt),pt="buffer");else if(at instanceof d)pt="buffer";else if(f._isUint8Array(at))at=f._uint8ArrayToBuffer(at),pt="buffer";else throw new m("chunk",["string","Buffer","Uint8Array"],at);let gt;return At.ending?gt=new M:At.destroyed&&(gt=new S("write")),gt?(n.nextTick(_t,gt),G(W,gt,!0),gt):(At.pendingcb++,N(W,At,at,pt,_t))}nt.prototype.write=function(W,at,pt){return J(this||Kt,W,at,pt)===!0},nt.prototype.cork=function(){(this||Kt)._writableState.corked++},nt.prototype.uncork=function(){let W=(this||Kt)._writableState;W.corked&&(W.corked--,W.writing||rt(this||Kt,W))},nt.prototype.setDefaultEncoding=function(at){if(typeof at=="string"&&(at=o(at)),!d.isEncoding(at))throw new z(at);return(this||Kt)._writableState.defaultEncoding=at,this||Kt};function N(W,at,pt,_t,At){let gt=at.objectMode?1:pt.length;at.length+=gt;let xt=at.length<at.highWaterMark;return xt||(at.needDrain=!0),at.writing||at.corked||at.errored||!at.constructed?(at.buffered.push({chunk:pt,encoding:_t,callback:At}),at.allBuffers&&_t!=="buffer"&&(at.allBuffers=!1),at.allNoop&&At!==Y&&(at.allNoop=!1)):(at.writelen=gt,at.writecb=At,at.writing=!0,at.sync=!0,W._write(pt,_t,at.onwrite),at.sync=!1),xt&&!at.errored&&!at.destroyed}function D(W,at,pt,_t,At,gt,xt){at.writelen=_t,at.writecb=xt,at.writing=!0,at.sync=!0,at.destroyed?at.onwrite(new S("write")):pt?W._writev(At,at.onwrite):W._write(At,gt,at.onwrite),at.sync=!1}function F(W,at,pt,_t){--at.pendingcb,_t(pt),H(at),G(W,pt)}function P(W,at){let pt=W._writableState,_t=pt.sync,At=pt.writecb;if(typeof At!="function"){G(W,new A);return}pt.writing=!1,pt.writecb=null,pt.length-=pt.writelen,pt.writelen=0,at?(at.stack,pt.errored||(pt.errored=at),W._readableState&&!W._readableState.errored&&(W._readableState.errored=at),_t?n.nextTick(F,W,pt,at,At):F(W,pt,at,At)):(pt.buffered.length>pt.bufferedIndex&&rt(W,pt),_t?pt.afterWriteTickInfo!==null&&pt.afterWriteTickInfo.cb===At?pt.afterWriteTickInfo.count++:(pt.afterWriteTickInfo={count:1,cb:At,stream:W,state:pt},n.nextTick(V,pt.afterWriteTickInfo)):$(W,pt,1,At))}function V({stream:W,state:at,count:pt,cb:_t}){return at.afterWriteTickInfo=null,$(W,at,pt,_t)}function $(W,at,pt,_t){for(!at.ending&&!W.destroyed&&at.length===0&&at.needDrain&&(at.needDrain=!1,W.emit("drain"));pt-- >0;)at.pendingcb--,_t();at.destroyed&&H(at),X(W,at)}function H(W){if(W.writing)return;for(let At=W.bufferedIndex;At<W.buffered.length;++At){var at;let{chunk:gt,callback:xt}=W.buffered[At],$t=W.objectMode?1:gt.length;W.length-=$t,xt((at=W.errored)!==null&&at!==void 0?at:new S("write"))}let pt=W[L].splice(0);for(let At=0;At<pt.length;At++){var _t;pt[At]((_t=W.errored)!==null&&_t!==void 0?_t:new S("end"))}q(W)}function rt(W,at){if(at.corked||at.bufferProcessing||at.destroyed||!at.constructed)return;let{buffered:pt,bufferedIndex:_t,objectMode:At}=at,gt=pt.length-_t;if(!gt)return;let xt=_t;if(at.bufferProcessing=!0,gt>1&&W._writev){at.pendingcb-=gt-1;let $t=at.allNoop?Y:Ot=>{for(let qt=xt;qt<pt.length;++qt)pt[qt].callback(Ot)},Nt=at.allNoop&&xt===0?pt:t(pt,xt);Nt.allBuffers=at.allBuffers,D(W,at,!0,at.length,Nt,"",$t),q(at)}else{do{let{chunk:$t,encoding:Nt,callback:Ot}=pt[xt];pt[xt++]=null;let qt=At?1:$t.length;D(W,at,!1,qt,$t,Nt,Ot)}while(xt<pt.length&&!at.writing);xt===pt.length?q(at):xt>256?(pt.splice(0,xt),at.bufferedIndex=0):at.bufferedIndex=xt}at.bufferProcessing=!1}nt.prototype._write=function(W,at,pt){if((this||Kt)._writev)this._writev([{chunk:W,encoding:at}],pt);else throw new w("_write()")},nt.prototype._writev=null,nt.prototype.end=function(W,at,pt){let _t=(this||Kt)._writableState;typeof W=="function"?(pt=W,W=null,at=null):typeof at=="function"&&(pt=at,at=null);let At;if(W!=null){let gt=J(this||Kt,W,at);gt instanceof e&&(At=gt)}return _t.corked&&(_t.corked=1,this.uncork()),At||(!_t.errored&&!_t.ending?(_t.ending=!0,X(this||Kt,_t,!0),_t.ended=!0):_t.finished?At=new I("end"):_t.destroyed&&(At=new S("end"))),typeof pt=="function"&&(At||_t.finished?n.nextTick(pt,At):_t[L].push(pt)),this||Kt};function lt(W){return W.ending&&!W.destroyed&&W.constructed&&W.length===0&&!W.errored&&W.buffered.length===0&&!W.finished&&!W.writing&&!W.errorEmitted&&!W.closeEmitted}function ft(W,at){let pt=!1;function _t(At){if(pt){G(W,At??A());return}if(pt=!0,at.pendingcb--,At){let gt=at[L].splice(0);for(let xt=0;xt<gt.length;xt++)gt[xt](At);G(W,At,at.sync)}else lt(at)&&(at.prefinished=!0,W.emit("prefinish"),at.pendingcb++,n.nextTick(st,W,at))}at.sync=!0,at.pendingcb++;try{W._final(_t)}catch(At){_t(At)}at.sync=!1}function K(W,at){!at.prefinished&&!at.finalCalled&&(typeof W._final=="function"&&!at.destroyed?(at.finalCalled=!0,ft(W,at)):(at.prefinished=!0,W.emit("prefinish")))}function X(W,at,pt){lt(at)&&(K(W,at),at.pendingcb===0&&(pt?(at.pendingcb++,n.nextTick((_t,At)=>{lt(At)?st(_t,At):At.pendingcb--},W,at)):lt(at)&&(at.pendingcb++,st(W,at))))}function st(W,at){at.pendingcb--,at.finished=!0;let pt=at[L].splice(0);for(let _t=0;_t<pt.length;_t++)pt[_t]();if(W.emit("finish"),at.autoDestroy){let _t=W._readableState;(!_t||_t.autoDestroy&&(_t.endEmitted||_t.readable===!1))&&W.destroy()}}s(nt.prototype,{closed:{__proto__:null,get(){return(this||Kt)._writableState?(this||Kt)._writableState.closed:!1}},destroyed:{__proto__:null,get(){return(this||Kt)._writableState?(this||Kt)._writableState.destroyed:!1},set(W){(this||Kt)._writableState&&((this||Kt)._writableState.destroyed=W)}},writable:{__proto__:null,get(){let W=(this||Kt)._writableState;return!!W&&W.writable!==!1&&!W.destroyed&&!W.errored&&!W.ending&&!W.ended},set(W){(this||Kt)._writableState&&((this||Kt)._writableState.writable=!!W)}},writableFinished:{__proto__:null,get(){return(this||Kt)._writableState?(this||Kt)._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return(this||Kt)._writableState?(this||Kt)._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return(this||Kt)._writableState&&(this||Kt)._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return(this||Kt)._writableState?(this||Kt)._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let W=(this||Kt)._writableState;return W?!W.destroyed&&!W.ending&&W.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return(this||Kt)._writableState&&(this||Kt)._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return(this||Kt)._writableState?(this||Kt)._writableState.corked:0}},writableLength:{__proto__:null,get(){return(this||Kt)._writableState&&(this||Kt)._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return(this||Kt)._writableState?(this||Kt)._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!((this||Kt)._writableState.writable!==!1&&((this||Kt)._writableState.destroyed||(this||Kt)._writableState.errored)&&!(this||Kt)._writableState.finished)}}});let bt=p.destroy;nt.prototype.destroy=function(W,at){let pt=(this||Kt)._writableState;return!pt.destroyed&&(pt.bufferedIndex<pt.buffered.length||pt[L].length)&&n.nextTick(H,pt),bt.call(this||Kt,W,at),this||Kt},nt.prototype._undestroy=p.undestroy,nt.prototype._destroy=function(W,at){at(W)},nt.prototype[h.captureRejectionSymbol]=function(W){this.destroy(W)};let wt;function Q(){return wt===void 0&&(wt={}),wt}return nt.fromWeb=function(W,at){return Q().newStreamWritableFromWritableStream(W,at)},nt.toWeb=function(W){return Q().newWritableStreamFromStreamWritable(W)},tM}function Elt(){if(fW)return eM;fW=!0;let n=$n,t=vi(),{isReadable:e,isWritable:r,isIterable:i,isNodeStream:s,isReadableNodeStream:a,isWritableNodeStream:o,isDuplexNodeStream:c,isReadableStream:u,isWritableStream:h}=Nu(),f=$f(),{AbortError:d,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g}}=Zs(),{destroyer:y}=lb(),b=Pu(),m=pR(),w=hM(),{createDeferredPromise:A}=_s(),_=xW(),S=globalThis.Blob||t.Blob,I=typeof S<"u"?function(j){return j instanceof S}:function(j){return!1},C=globalThis.AbortController||QE().AbortController,{FunctionPrototypeCall:M}=_n();class z extends b{constructor(j){super(j),j?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),j?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}eM=function L(j,q){if(c(j))return j;if(a(j))return Y({readable:j});if(o(j))return Y({writable:j});if(s(j))return Y({writable:!1,readable:!1});if(u(j))return Y({readable:m.fromWeb(j)});if(h(j))return Y({writable:w.fromWeb(j)});if(typeof j=="function"){let{value:J,write:N,final:D,destroy:F}=G(j);if(i(J))return _(z,J,{objectMode:!0,write:N,final:D,destroy:F});let P=J?.then;if(typeof P=="function"){let V,$=M(P,J,H=>{if(H!=null)throw new g("nully","body",H)},H=>{y(V,H)});return V=new z({objectMode:!0,readable:!1,write:N,final(H){D(async()=>{try{await $,n.nextTick(H,null)}catch(rt){n.nextTick(H,rt)}})},destroy:F})}throw new g("Iterable, AsyncIterable or AsyncFunction",q,J)}if(I(j))return L(j.arrayBuffer());if(i(j))return _(z,j,{objectMode:!0,writable:!1});if(u(j?.readable)&&h(j?.writable))return z.fromWeb(j);if(typeof j?.writable=="object"||typeof j?.readable=="object"){let J=j!=null&&j.readable?a(j?.readable)?j?.readable:L(j.readable):void 0,N=j!=null&&j.writable?o(j?.writable)?j?.writable:L(j.writable):void 0;return Y({readable:J,writable:N})}let nt=j?.then;if(typeof nt=="function"){let J;return M(nt,j,N=>{N!=null&&J.push(N),J.push(null)},N=>{y(J,N)}),J=new z({objectMode:!0,writable:!1,read(){}})}throw new p(q,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],j)};function G(L){let{promise:j,resolve:q}=A(),nt=new C,J=nt.signal;return{value:L((async function*(){for(;;){let D=j;j=null;let{chunk:F,done:P,cb:V}=await D;if(n.nextTick(V),P)return;if(J.aborted)throw new d(void 0,{cause:J.reason});({promise:j,resolve:q}=A()),yield F}})(),{signal:J}),write(D,F,P){let V=q;q=null,V({chunk:D,done:!1,cb:P})},final(D){let F=q;q=null,F({done:!0,cb:D})},destroy(D,F){nt.abort(),F(D)}}}function Y(L){let j=L.readable&&typeof L.readable.read!="function"?m.wrap(L.readable):L.readable,q=L.writable,nt=!!e(j),J=!!r(q),N,D,F,P,V;function $(H){let rt=P;P=null,rt?rt(H):H&&V.destroy(H)}return V=new z({readableObjectMode:!!(j!=null&&j.readableObjectMode),writableObjectMode:!!(q!=null&&q.writableObjectMode),readable:nt,writable:J}),J&&(f(q,H=>{J=!1,H&&y(j,H),$(H)}),V._write=function(H,rt,lt){q.write(H,rt)?lt():N=lt},V._final=function(H){q.end(),D=H},q.on("drain",function(){if(N){let H=N;N=null,H()}}),q.on("finish",function(){if(D){let H=D;D=null,H()}})),nt&&(f(j,H=>{nt=!1,H&&y(j,H),$(H)}),j.on("readable",function(){if(F){let H=F;F=null,H()}}),j.on("end",function(){V.push(null)}),V._read=function(){for(;;){let H=j.read();if(H===null){F=V._read;return}if(!V.push(H))return}}),V._destroy=function(H,rt){!H&&P!==null&&(H=new d),F=null,N=null,D=null,P===null?rt(H):(P=rt,y(q,H),y(j,H))},V}return eM}function Pu(){if(dW)return rM;dW=!0;let{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:e,ObjectSetPrototypeOf:r}=_n();rM=a;let i=pR(),s=hM();r(a.prototype,i.prototype),r(a,i);{let h=e(s.prototype);for(let f=0;f<h.length;f++){let d=h[f];a.prototype[d]||(a.prototype[d]=s.prototype[d])}}function a(h){if(!(this instanceof a))return new a(h);i.call(this,h),s.call(this,h),h?(this.allowHalfOpen=h.allowHalfOpen!==!1,h.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),h.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}n(a.prototype,{writable:{__proto__:null,...t(s.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(s.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(s.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(s.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(s.prototype,"writableLength")},writableFinished:{__proto__:null,...t(s.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(s.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(s.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(s.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(h){this._readableState&&this._writableState&&(this._readableState.destroyed=h,this._writableState.destroyed=h)}}});let o;function c(){return o===void 0&&(o={}),o}a.fromWeb=function(h,f){return c().newStreamDuplexFromReadableWritablePair(h,f)},a.toWeb=function(h){return c().newReadableWritablePairFromDuplex(h)};let u;return a.from=function(h){return u||(u=Elt()),u(h,"body")},rM}function SW(){if(pW)return nM;pW=!0;let{ObjectSetPrototypeOf:n,Symbol:t}=_n();nM=a;let{ERR_METHOD_NOT_IMPLEMENTED:e}=Zs().codes,r=Pu(),{getHighWaterMark:i}=dR();n(a.prototype,r.prototype),n(a,r);let s=t("kCallback");function a(u){if(!(this instanceof a))return new a(u);let h=u?i(this,u,"readableHighWaterMark",!0):null;h===0&&(u={...u,highWaterMark:null,readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark||0}),r.call(this,u),this._readableState.sync=!1,this[s]=null,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",c)}function o(u){typeof this._flush=="function"&&!this.destroyed?this._flush((h,f)=>{if(h){u?u(h):this.destroy(h);return}f!=null&&this.push(f),this.push(null),u&&u()}):(this.push(null),u&&u())}function c(){this._final!==o&&o.call(this)}return a.prototype._final=o,a.prototype._transform=function(u,h,f){throw new e("_transform()")},a.prototype._write=function(u,h,f){let d=this._readableState,p=this._writableState,g=d.length;this._transform(u,h,(y,b)=>{if(y){f(y);return}b!=null&&this.push(b),p.ended||g===d.length||d.length<d.highWaterMark?f():this[s]=f})},a.prototype._read=function(){if(this[s]){let u=this[s];this[s]=null,u()}},nM}function _W(){if(gW)return iM;gW=!0;let{ObjectSetPrototypeOf:n}=_n();iM=e;let t=SW();n(e.prototype,t.prototype),n(e,t);function e(r){if(!(this instanceof e))return new e(r);t.call(this,r)}return e.prototype._transform=function(r,i,s){s(null,r)},iM}function fM(){if(mW)return sM;mW=!0;let n=$n,{ArrayIsArray:t,Promise:e,SymbolAsyncIterator:r,SymbolDispose:i}=_n(),s=$f(),{once:a}=_s(),o=lb(),c=Pu(),{aggregateTwoErrors:u,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:f,ERR_MISSING_ARGS:d,ERR_STREAM_DESTROYED:p,ERR_STREAM_PREMATURE_CLOSE:g},AbortError:y}=Zs(),{validateFunction:b,validateAbortSignal:m}=t1(),{isIterable:w,isReadable:A,isReadableNodeStream:_,isNodeStream:S,isTransformStream:I,isWebStream:C,isReadableStream:M,isReadableFinished:z}=Nu(),G=globalThis.AbortController||QE().AbortController,Y,L,j;function q(H,rt,lt){let ft=!1;H.on("close",()=>{ft=!0});let K=s(H,{readable:rt,writable:lt},X=>{ft=!X});return{destroy:X=>{ft||(ft=!0,o.destroyer(H,X||new p("pipe")))},cleanup:K}}function nt(H){return b(H[H.length-1],"streams[stream.length - 1]"),H.pop()}function J(H){if(w(H))return H;if(_(H))return N(H);throw new h("val",["Readable","Iterable","AsyncIterable"],H)}async function*N(H){L||(L=pR()),yield*L.prototype[r].call(H)}async function D(H,rt,lt,{end:ft}){let K,X=null,st=Q=>{if(Q&&(K=Q),X){let W=X;X=null,W()}},bt=()=>new e((Q,W)=>{K?W(K):X=()=>{K?W(K):Q()}});rt.on("drain",st);let wt=s(rt,{readable:!1},st);try{rt.writableNeedDrain&&await bt();for await(let Q of H)rt.write(Q)||await bt();ft&&(rt.end(),await bt()),lt()}catch(Q){lt(K!==Q?u(K,Q):Q)}finally{wt(),rt.off("drain",st)}}async function F(H,rt,lt,{end:ft}){I(rt)&&(rt=rt.writable);let K=rt.getWriter();try{for await(let X of H)await K.ready,K.write(X).catch(()=>{});await K.ready,ft&&await K.close(),lt()}catch(X){try{await K.abort(X),lt(X)}catch(st){lt(st)}}}function P(...H){return V(H,a(nt(H)))}function V(H,rt,lt){if(H.length===1&&t(H[0])&&(H=H[0]),H.length<2)throw new d("streams");let ft=new G,K=ft.signal,X=lt?.signal,st=[];m(X,"options.signal");function bt(){At(new y)}j=j||_s().addAbortListener;let wt;X&&(wt=j(X,bt));let Q,W,at=[],pt=0;function _t(Nt){At(Nt,--pt===0)}function At(Nt,Ot){var qt;if(Nt&&(!Q||Q.code==="ERR_STREAM_PREMATURE_CLOSE")&&(Q=Nt),!(!Q&&!Ot)){for(;at.length;)at.shift()(Q);(qt=wt)===null||qt===void 0||qt[i](),ft.abort(),Ot&&(Q||st.forEach(Jt=>Jt()),n.nextTick(rt,Q,W))}}let gt;for(let Nt=0;Nt<H.length;Nt++){let Ot=H[Nt],qt=Nt<H.length-1,Jt=Nt>0,te=qt||lt?.end!==!1,O=Nt===H.length-1;if(S(Ot)){let v=function(E){E&&E.name!=="AbortError"&&E.code!=="ERR_STREAM_PREMATURE_CLOSE"&&_t(E)};if(te){let{destroy:E,cleanup:B}=q(Ot,qt,Jt);at.push(E),A(Ot)&&O&&st.push(B)}Ot.on("error",v),A(Ot)&&O&&st.push(()=>{Ot.removeListener("error",v)})}if(Nt===0)if(typeof Ot=="function"){if(gt=Ot({signal:K}),!w(gt))throw new f("Iterable, AsyncIterable or Stream","source",gt)}else w(Ot)||_(Ot)||I(Ot)?gt=Ot:gt=c.from(Ot);else if(typeof Ot=="function"){if(I(gt)){var xt;gt=J((xt=gt)===null||xt===void 0?void 0:xt.readable)}else gt=J(gt);if(gt=Ot(gt,{signal:K}),qt){if(!w(gt,!0))throw new f("AsyncIterable",`transform[${Nt-1}]`,gt)}else{var $t;Y||(Y=_W());let v=new Y({objectMode:!0}),E=($t=gt)===null||$t===void 0?void 0:$t.then;if(typeof E=="function")pt++,E.call(gt,k=>{W=k,k!=null&&v.write(k),te&&v.end(),n.nextTick(_t)},k=>{v.destroy(k),n.nextTick(_t,k)});else if(w(gt,!0))pt++,D(gt,v,_t,{end:te});else if(M(gt)||I(gt)){let k=gt.readable||gt;pt++,D(k,v,_t,{end:te})}else throw new f("AsyncIterable or Promise","destination",gt);gt=v;let{destroy:B,cleanup:it}=q(gt,!1,!0);at.push(B),O&&st.push(it)}}else if(S(Ot)){if(_(gt)){pt+=2;let v=$(gt,Ot,_t,{end:te});A(Ot)&&O&&st.push(v)}else if(I(gt)||M(gt)){let v=gt.readable||gt;pt++,D(v,Ot,_t,{end:te})}else if(w(gt))pt++,D(gt,Ot,_t,{end:te});else throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],gt);gt=Ot}else if(C(Ot)){if(_(gt))pt++,F(J(gt),Ot,_t,{end:te});else if(M(gt)||w(gt))pt++,F(gt,Ot,_t,{end:te});else if(I(gt))pt++,F(gt.readable,Ot,_t,{end:te});else throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],gt);gt=Ot}else gt=c.from(Ot)}return(K!=null&&K.aborted||X!=null&&X.aborted)&&n.nextTick(bt),gt}function $(H,rt,lt,{end:ft}){let K=!1;if(rt.on("close",()=>{K||lt(new g)}),H.pipe(rt,{end:!1}),ft){let X=function(){K=!0,rt.end()};z(H)?n.nextTick(X):H.once("end",X)}else lt();return s(H,{readable:!0,writable:!1},X=>{let st=H._readableState;X&&X.code==="ERR_STREAM_PREMATURE_CLOSE"&&st&&st.ended&&!st.errored&&!st.errorEmitted?H.once("end",lt).once("error",lt):lt(X)}),s(rt,{readable:!1,writable:!0},lt)}return sM={pipelineImpl:V,pipeline:P},sM}function TW(){if(yW)return aM;yW=!0;let{pipeline:n}=fM(),t=Pu(),{destroyer:e}=lb(),{isNodeStream:r,isReadable:i,isWritable:s,isWebStream:a,isTransformStream:o,isWritableStream:c,isReadableStream:u}=Nu(),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:f,ERR_MISSING_ARGS:d}}=Zs(),p=$f();return aM=function(...y){if(y.length===0)throw new d("streams");if(y.length===1)return t.from(y[0]);let b=[...y];if(typeof y[0]=="function"&&(y[0]=t.from(y[0])),typeof y[y.length-1]=="function"){let Y=y.length-1;y[Y]=t.from(y[Y])}for(let Y=0;Y<y.length;++Y)if(!(!r(y[Y])&&!a(y[Y]))){if(Y<y.length-1&&!(i(y[Y])||u(y[Y])||o(y[Y])))throw new f(`streams[${Y}]`,b[Y],"must be readable");if(Y>0&&!(s(y[Y])||c(y[Y])||o(y[Y])))throw new f(`streams[${Y}]`,b[Y],"must be writable")}let m,w,A,_,S;function I(Y){let L=_;_=null,L?L(Y):Y?S.destroy(Y):!G&&!z&&S.destroy()}let C=y[0],M=n(y,I),z=!!(s(C)||c(C)||o(C)),G=!!(i(M)||u(M)||o(M));if(S=new t({writableObjectMode:!!(C!=null&&C.writableObjectMode),readableObjectMode:!!(M!=null&&M.readableObjectMode),writable:z,readable:G}),z){if(r(C))S._write=function(L,j,q){C.write(L,j)?q():m=q},S._final=function(L){C.end(),w=L},C.on("drain",function(){if(m){let L=m;m=null,L()}});else if(a(C)){let j=(o(C)?C.writable:C).getWriter();S._write=async function(q,nt,J){try{await j.ready,j.write(q).catch(()=>{}),J()}catch(N){J(N)}},S._final=async function(q){try{await j.ready,j.close().catch(()=>{}),w=q}catch(nt){q(nt)}}}let Y=o(M)?M.readable:M;p(Y,()=>{if(w){let L=w;w=null,L()}})}if(G){if(r(M))M.on("readable",function(){if(A){let Y=A;A=null,Y()}}),M.on("end",function(){S.push(null)}),S._read=function(){for(;;){let Y=M.read();if(Y===null){A=S._read;return}if(!S.push(Y))return}};else if(a(M)){let L=(o(M)?M.readable:M).getReader();S._read=async function(){for(;;)try{let{value:j,done:q}=await L.read();if(!S.push(j))return;if(q){S.push(null);return}}catch{return}}}}return S._destroy=function(Y,L){!Y&&_!==null&&(Y=new h),A=null,m=null,w=null,_===null?L(Y):(_=L,r(M)&&e(M,Y))},S},aM}function xlt(){if(bW)return hR;bW=!0;let n=globalThis.AbortController||QE().AbortController,{codes:{ERR_INVALID_ARG_VALUE:t,ERR_INVALID_ARG_TYPE:e,ERR_MISSING_ARGS:r,ERR_OUT_OF_RANGE:i},AbortError:s}=Zs(),{validateAbortSignal:a,validateInteger:o,validateObject:c}=t1(),u=_n().Symbol("kWeak"),h=_n().Symbol("kResistStopPropagation"),{finished:f}=$f(),d=TW(),{addAbortSignalNoValidate:p}=fR(),{isWritable:g,isNodeStream:y}=Nu(),{deprecate:b}=_s(),{ArrayPrototypePush:m,Boolean:w,MathFloor:A,Number:_,NumberIsNaN:S,Promise:I,PromiseReject:C,PromiseResolve:M,PromisePrototypeThen:z,Symbol:G}=_n(),Y=G("kEmpty"),L=G("kEof");function j(X,st){if(st!=null&&c(st,"options"),st?.signal!=null&&a(st.signal,"options.signal"),y(X)&&!g(X))throw new t("stream",X,"must be writable");let bt=d(this,X);return st!=null&&st.signal&&p(st.signal,bt),bt}function q(X,st){if(typeof X!="function")throw new e("fn",["Function","AsyncFunction"],X);st!=null&&c(st,"options"),st?.signal!=null&&a(st.signal,"options.signal");let bt=1;st?.concurrency!=null&&(bt=A(st.concurrency));let wt=bt-1;return st?.highWaterMark!=null&&(wt=A(st.highWaterMark)),o(bt,"options.concurrency",1),o(wt,"options.highWaterMark",0),wt+=bt,async function*(){let W=_s().AbortSignalAny([st?.signal].filter(w)),at=this,pt=[],_t={signal:W},At,gt,xt=!1,$t=0;function Nt(){xt=!0,Ot()}function Ot(){$t-=1,qt()}function qt(){gt&&!xt&&$t<bt&&pt.length<wt&&(gt(),gt=null)}async function Jt(){try{for await(let te of at){if(xt)return;if(W.aborted)throw new s;try{if(te=X(te,_t),te===Y)continue;te=M(te)}catch(O){te=C(O)}$t+=1,z(te,Ot,Nt),pt.push(te),At&&(At(),At=null),!xt&&(pt.length>=wt||$t>=bt)&&await new I(O=>{gt=O})}pt.push(L)}catch(te){let O=C(te);z(O,Ot,Nt),pt.push(O)}finally{xt=!0,At&&(At(),At=null)}}Jt();try{for(;;){for(;pt.length>0;){let te=await pt[0];if(te===L)return;if(W.aborted)throw new s;te!==Y&&(yield te),pt.shift(),qt()}await new I(te=>{At=te})}}finally{xt=!0,gt&&(gt(),gt=null)}}.call(this)}function nt(X=void 0){return X!=null&&c(X,"options"),X?.signal!=null&&a(X.signal,"options.signal"),async function*(){let bt=0;for await(let Q of this){var wt;if(X!=null&&(wt=X.signal)!==null&&wt!==void 0&&wt.aborted)throw new s({cause:X.signal.reason});yield[bt++,Q]}}.call(this)}async function J(X,st=void 0){for await(let bt of P.call(this,X,st))return!0;return!1}async function N(X,st=void 0){if(typeof X!="function")throw new e("fn",["Function","AsyncFunction"],X);return!await J.call(this,async(...bt)=>!await X(...bt),st)}async function D(X,st){for await(let bt of P.call(this,X,st))return bt}async function F(X,st){if(typeof X!="function")throw new e("fn",["Function","AsyncFunction"],X);async function bt(wt,Q){return await X(wt,Q),Y}for await(let wt of q.call(this,bt,st));}function P(X,st){if(typeof X!="function")throw new e("fn",["Function","AsyncFunction"],X);async function bt(wt,Q){return await X(wt,Q)?wt:Y}return q.call(this,bt,st)}class V extends r{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function $(X,st,bt){var wt;if(typeof X!="function")throw new e("reducer",["Function","AsyncFunction"],X);bt!=null&&c(bt,"options"),bt?.signal!=null&&a(bt.signal,"options.signal");let Q=arguments.length>1;if(bt!=null&&(wt=bt.signal)!==null&&wt!==void 0&&wt.aborted){let At=new s(void 0,{cause:bt.signal.reason});throw this.once("error",()=>{}),await f(this.destroy(At)),At}let W=new n,at=W.signal;if(bt!=null&&bt.signal){let At={once:!0,[u]:this,[h]:!0};bt.signal.addEventListener("abort",()=>W.abort(),At)}let pt=!1;try{for await(let At of this){var _t;if(pt=!0,bt!=null&&(_t=bt.signal)!==null&&_t!==void 0&&_t.aborted)throw new s;Q?st=await X(st,At,{signal:at}):(st=At,Q=!0)}if(!pt&&!Q)throw new V}finally{W.abort()}return st}async function H(X){X!=null&&c(X,"options"),X?.signal!=null&&a(X.signal,"options.signal");let st=[];for await(let wt of this){var bt;if(X!=null&&(bt=X.signal)!==null&&bt!==void 0&&bt.aborted)throw new s(void 0,{cause:X.signal.reason});m(st,wt)}return st}function rt(X,st){let bt=q.call(this,X,st);return async function*(){for await(let Q of bt)yield*Q}.call(this)}function lt(X){if(X=_(X),S(X))return 0;if(X<0)throw new i("number",">= 0",X);return X}function ft(X,st=void 0){return st!=null&&c(st,"options"),st?.signal!=null&&a(st.signal,"options.signal"),X=lt(X),async function*(){var wt;if(st!=null&&(wt=st.signal)!==null&&wt!==void 0&&wt.aborted)throw new s;for await(let W of this){var Q;if(st!=null&&(Q=st.signal)!==null&&Q!==void 0&&Q.aborted)throw new s;X--<=0&&(yield W)}}.call(this)}function K(X,st=void 0){return st!=null&&c(st,"options"),st?.signal!=null&&a(st.signal,"options.signal"),X=lt(X),async function*(){var wt;if(st!=null&&(wt=st.signal)!==null&&wt!==void 0&&wt.aborted)throw new s;for await(let W of this){var Q;if(st!=null&&(Q=st.signal)!==null&&Q!==void 0&&Q.aborted)throw new s;if(X-- >0&&(yield W),X<=0)return}}.call(this)}return hR.streamReturningOperators={asIndexedPairs:b(nt,"readable.asIndexedPairs will be removed in a future version."),drop:ft,filter:P,flatMap:rt,map:q,take:K,compose:j},hR.promiseReturningOperators={every:N,forEach:F,reduce:$,toArray:H,some:J,find:D},hR}function CW(){if(vW)return oM;vW=!0;let{ArrayPrototypePop:n,Promise:t}=_n(),{isIterable:e,isNodeStream:r,isWebStream:i}=Nu(),{pipelineImpl:s}=fM(),{finished:a}=$f();RW();function o(...c){return new t((u,h)=>{let f,d,p=c[c.length-1];if(p&&typeof p=="object"&&!r(p)&&!e(p)&&!i(p)){let g=n(c);f=g.signal,d=g.end}s(c,(g,y)=>{g?h(g):u(y)},{signal:f,end:d})})}return oM={finished:a,pipeline:o},oM}function RW(){if(wW)return lM;wW=!0;let{Buffer:n}=vi(),{ObjectDefineProperty:t,ObjectKeys:e,ReflectApply:r}=_n(),{promisify:{custom:i}}=_s(),{streamReturningOperators:s,promiseReturningOperators:a}=xlt(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:o}}=Zs(),c=TW(),{setDefaultHighWaterMark:u,getDefaultHighWaterMark:h}=dR(),{pipeline:f}=fM(),{destroyer:d}=lb(),p=$f(),g=CW(),y=Nu(),b=lM=uM().Stream;b.isDestroyed=y.isDestroyed,b.isDisturbed=y.isDisturbed,b.isErrored=y.isErrored,b.isReadable=y.isReadable,b.isWritable=y.isWritable,b.Readable=pR();for(let w of e(s)){let _=function(...S){if(new.target)throw o();return b.Readable.from(r(A,this||AW,S))},A=s[w];t(_,"name",{__proto__:null,value:A.name}),t(_,"length",{__proto__:null,value:A.length}),t(b.Readable.prototype,w,{__proto__:null,value:_,enumerable:!1,configurable:!0,writable:!0})}for(let w of e(a)){let _=function(...S){if(new.target)throw o();return r(A,this||AW,S)},A=a[w];t(_,"name",{__proto__:null,value:A.name}),t(_,"length",{__proto__:null,value:A.length}),t(b.Readable.prototype,w,{__proto__:null,value:_,enumerable:!1,configurable:!0,writable:!0})}b.Writable=hM(),b.Duplex=Pu(),b.Transform=SW(),b.PassThrough=_W(),b.pipeline=f;let{addAbortSignal:m}=fR();return b.addAbortSignal=m,b.finished=p,b.destroy=d,b.compose=c,b.setDefaultHighWaterMark=u,b.getDefaultHighWaterMark=h,t(b,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return g}}),t(f,i,{__proto__:null,enumerable:!0,get(){return g.pipeline}}),t(p,i,{__proto__:null,enumerable:!0,get(){return g.finished}}),b.Stream=b,b._isUint8Array=function(A){return A instanceof Uint8Array},b._uint8ArrayToBuffer=function(A){return n.from(A.buffer,A.byteOffset,A.byteLength)},lM}function Slt(){if(EW)return Sn;EW=!0;let n=RW(),t=CW(),e=n.Readable.destroy;return Sn=n.Readable,Sn._uint8ArrayToBuffer=n._uint8ArrayToBuffer,Sn._isUint8Array=n._isUint8Array,Sn.isDisturbed=n.isDisturbed,Sn.isErrored=n.isErrored,Sn.isReadable=n.isReadable,Sn.Readable=n.Readable,Sn.Writable=n.Writable,Sn.Duplex=n.Duplex,Sn.Transform=n.Transform,Sn.PassThrough=n.PassThrough,Sn.addAbortSignal=n.addAbortSignal,Sn.finished=n.finished,Sn.destroy=n.destroy,Sn.destroy=e,Sn.pipeline=n.pipeline,Sn.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get(){return t}}),Sn.Stream=n.Stream,Sn.default=Sn,Sn}var Wk,Zz,ZE,Jz,cR,Qz,Gk,tW,Vk,eW,Xk,rW,uR,nW,qk,iW,Yk,sW,JE,aW,Kk,oW,Zk,lW,Jk,cW,Qk,uW,Gt,tM,hW,Kt,eM,fW,rM,dW,nM,pW,iM,gW,sM,mW,aM,yW,hR,bW,oM,vW,lM,wW,AW,Sn,EW,jr,cM,_lt,Tlt,Clt,Rlt,Ilt,Dlt,Olt,Plt,r1=br(()=>{Tt();Rt();Ct();C0();ob();Jp();Kz();ab();TE();Ok();Wk={},Zz=!1;ZE={},Jz=!1;cR={},Qz=!1;Gk={},tW=!1;Vk={},eW=!1;Xk={},rW=!1;uR={},nW=!1;qk={},iW=!1;Yk={},sW=!1;JE={},aW=!1;Kk={},oW=!1;Zk={},lW=!1;Jk={},cW=!1;Qk={},uW=!1,Gt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;tM={},hW=!1,Kt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;eM={},fW=!1;rM={},dW=!1;nM={},pW=!1;iM={},gW=!1;sM={},mW=!1;aM={},yW=!1;hR={},bW=!1;oM={},vW=!1;lM={},wW=!1,AW=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;Sn={},EW=!1;jr=Slt();jr._uint8ArrayToBuffer;jr._isUint8Array;jr.isDisturbed;jr.isErrored;jr.isReadable;jr.Readable;jr.Writable;jr.Duplex;jr.Transform;jr.PassThrough;jr.addAbortSignal;jr.finished;jr.destroy;jr.pipeline;jr.compose;jr.Stream;cM=jr.Readable;cM.wrap=function(n,t){return t=Object.assign({objectMode:n.readableObjectMode!=null||n.objectMode!=null||!0},t),t.destroy=function(e,r){n.destroy(e),r(e)},new cM(t).wrap(n)};_lt=jr.Writable,Tlt=jr.Duplex,Clt=jr.Transform,Rlt=jr.PassThrough,Ilt=jr.finished,Dlt=jr.pipeline,Olt=jr.Stream,Plt={finished:aR(jr.finished),pipeline:aR(jr.pipeline)}});var PW=ae((Vbt,OW)=>{Tt();Rt();Ct();OW.exports=gR;function gR(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}gR.prototype.go=function(n){this.pending<this.max?DW(this,n):this.waiting.push(n)};gR.prototype.wait=function(n){this.pending===0?n(this.error):this.listeners.push(n)};gR.prototype.hold=function(){return IW(this)};function IW(n){n.pending+=1;var t=!1;return e;function e(i){if(t)throw new Error("callback called twice");if(t=!0,n.error=n.error||i,n.pending-=1,n.waiting.length>0&&n.pending<n.max)DW(n,n.waiting.shift());else if(n.pending===0){var s=n.listeners;n.listeners=[],s.forEach(r)}}function r(i){i(n.error)}}function DW(n,t){t(IW(n))}});var LW=ae(i1=>{Tt();Rt();Ct();var n1=(OE(),xn(DE)),mR=(ab(),xn(qE)),dM=(r1(),xn(e1)),NW=dM.Readable,pM=dM.Writable,Nlt=dM.PassThrough,Llt=PW(),yR=(ob(),xn(YE)).EventEmitter;i1.createFromBuffer=klt;i1.createFromFd=Mlt;i1.BufferSlicer=ku;i1.FdSlicer=Lu;mR.inherits(Lu,yR);function Lu(n,t){t=t||{},yR.call(this),this.fd=n,this.pend=new Llt,this.pend.max=1,this.refCount=0,this.autoClose=!!t.autoClose}Lu.prototype.read=function(n,t,e,r,i){var s=this;s.pend.go(function(a){n1.read(s.fd,n,t,e,r,function(o,c,u){a(),i(o,c,u)})})};Lu.prototype.write=function(n,t,e,r,i){var s=this;s.pend.go(function(a){n1.write(s.fd,n,t,e,r,function(o,c,u){a(),i(o,c,u)})})};Lu.prototype.createReadStream=function(n){return new bR(this,n)};Lu.prototype.createWriteStream=function(n){return new vR(this,n)};Lu.prototype.ref=function(){this.refCount+=1};Lu.prototype.unref=function(){var n=this;if(n.refCount-=1,n.refCount>0)return;if(n.refCount<0)throw new Error("invalid unref");n.autoClose&&n1.close(n.fd,t);function t(e){e?n.emit("error",e):n.emit("close")}};mR.inherits(bR,NW);function bR(n,t){t=t||{},NW.call(this,t),this.context=n,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start,this.destroyed=!1}bR.prototype._read=function(n){var t=this;if(!t.destroyed){var e=Math.min(t._readableState.highWaterMark,n);if(t.endOffset!=null&&(e=Math.min(e,t.endOffset-t.pos)),e<=0){t.destroyed=!0,t.push(null),t.context.unref();return}t.context.pend.go(function(r){if(t.destroyed)return r();var i=Buffer.allocUnsafe(e);n1.read(t.context.fd,i,0,e,t.pos,function(s,a){s?t.destroy(s):a===0?(t.destroyed=!0,t.push(null),t.context.unref()):(t.pos+=a,t.push(i.slice(0,a))),r()})})}};bR.prototype.destroy=function(n){this.destroyed||(n=n||new Error("stream destroyed"),this.destroyed=!0,this.emit("error",n),this.context.unref())};mR.inherits(vR,pM);function vR(n,t){t=t||{},pM.call(this,t),this.context=n,this.context.ref(),this.start=t.start||0,this.endOffset=t.end==null?1/0:+t.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}vR.prototype._write=function(n,t,e){var r=this;if(!r.destroyed){if(r.pos+n.length>r.endOffset){var i=new Error("maximum file length exceeded");i.code="ETOOBIG",r.destroy(),e(i);return}r.context.pend.go(function(s){if(r.destroyed)return s();n1.write(r.context.fd,n,0,n.length,r.pos,function(a,o){a?(r.destroy(),s(),e(a)):(r.bytesWritten+=o,r.pos+=o,r.emit("progress"),s(),e())})})}};vR.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.context.unref())};mR.inherits(ku,yR);function ku(n,t){yR.call(this),t=t||{},this.refCount=0,this.buffer=n,this.maxChunkSize=t.maxChunkSize||Number.MAX_SAFE_INTEGER}ku.prototype.read=function(n,t,e,r,i){if(!(0<=t&&t<=n.length))throw new RangeError("offset outside buffer: 0 <= "+t+" <= "+n.length);if(r<0)throw new RangeError("position is negative: "+r);if(t+e>n.length&&(e=n.length-t),r+e>this.buffer.length&&(e=this.buffer.length-r),e<=0){setImmediate(function(){i(null,0)});return}this.buffer.copy(n,t,r,r+e),setImmediate(function(){i(null,e)})};ku.prototype.write=function(n,t,e,r,i){n.copy(this.buffer,r,t,t+e),setImmediate(function(){i(null,e,n)})};ku.prototype.createReadStream=function(n){n=n||{};var t=new Nlt(n);t.destroyed=!1,t.start=n.start||0,t.endOffset=n.end,t.pos=t.endOffset||this.buffer.length;for(var e=this.buffer.slice(t.start,t.pos),r=0;;){var i=r+this.maxChunkSize;if(i>=e.length){r<e.length&&t.write(e.slice(r,e.length));break}t.write(e.slice(r,i)),r=i}return t.end(),t.destroy=function(){t.destroyed=!0},t};ku.prototype.createWriteStream=function(n){var t=this;n=n||{};var e=new pM(n);return e.start=n.start||0,e.endOffset=n.end==null?this.buffer.length:+n.end,e.bytesWritten=0,e.pos=e.start,e.destroyed=!1,e._write=function(r,i,s){if(!e.destroyed){var a=e.pos+r.length;if(a>e.endOffset){var o=new Error("maximum file length exceeded");o.code="ETOOBIG",e.destroyed=!0,s(o);return}r.copy(t.buffer,e.pos,0,r.length),e.bytesWritten+=r.length,e.pos=a,e.emit("progress"),s()}},e.destroy=function(){e.destroyed=!0},e};ku.prototype.ref=function(){this.refCount+=1};ku.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw new Error("invalid unref")};function klt(n,t){return new ku(n,t)}function Mlt(n,t){return new Lu(n,t)}});var FW=ae((tvt,MW)=>{Tt();Rt();Ct();var Hf=(If(),xn(R0)).Buffer,gM=[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"&&(gM=new Int32Array(gM));function kW(n){if(Hf.isBuffer(n))return n;var t=typeof Hf.alloc=="function"&&typeof Hf.from=="function";if(typeof n=="number")return t?Hf.alloc(n):new Hf(n);if(typeof n=="string")return t?Hf.from(n):new Hf(n);throw new Error("input must be buffer, number, or string, received "+typeof n)}function Flt(n){var t=kW(4);return t.writeInt32BE(n,0),t}function mM(n,t){n=kW(n),Hf.isBuffer(t)&&(t=t.readUInt32BE(0));for(var e=~~t^-1,r=0;r<n.length;r++)e=gM[(e^n[r])&255]^e>>>8;return e^-1}function yM(){return Flt(mM.apply(null,arguments))}yM.signed=function(){return mM.apply(null,arguments)};yM.unsigned=function(){return mM.apply(null,arguments)>>>0};MW.exports=yM});var XW=ae(wa=>{Tt();Rt();Ct();var bM=(OE(),xn(DE)),Blt=(Oz(),xn(Dz)),BW=LW(),Ult=FW(),ER=(ab(),xn(qE)),xR=(ob(),xn(YE)).EventEmitter,UW=(r1(),xn(e1)).Transform,wM=(r1(),xn(e1)).PassThrough,jlt=(r1(),xn(e1)).Writable;wa.open=$lt;wa.fromFd=jW;wa.fromBuffer=Hlt;wa.fromRandomAccessReader=AM;wa.dosDateTimeToDate=zW;wa.getFileNameLowLevel=WW;wa.validateFileName=GW;wa.parseExtraFields=VW;wa.ZipFile=fc;wa.Entry=s1;wa.LocalFileHeader=HW;wa.RandomAccessReader=zf;function $lt(n,t,e){typeof t=="function"&&(e=t,t=null),t==null&&(t={}),t.autoClose==null&&(t.autoClose=!0),t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0),t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1),e==null&&(e=AR),bM.open(n,"r",function(r,i){if(r)return e(r);jW(i,t,function(s,a){s&&bM.close(i,AR),e(s,a)})})}function jW(n,t,e){typeof t=="function"&&(e=t,t=null),t==null&&(t={}),t.autoClose==null&&(t.autoClose=!1),t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0),t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1),e==null&&(e=AR),bM.fstat(n,function(r,i){if(r)return e(r);var s=BW.createFromFd(n,{autoClose:!0});AM(s,i.size,t,e)})}function Hlt(n,t,e){typeof t=="function"&&(e=t,t=null),t==null&&(t={}),t.autoClose=!1,t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0),t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1);var r=BW.createFromBuffer(n,{maxChunkSize:65536});AM(r,n.length,t,e)}function AM(n,t,e,r){typeof e=="function"&&(r=e,e=null),e==null&&(e={}),e.autoClose==null&&(e.autoClose=!0),e.lazyEntries==null&&(e.lazyEntries=!1),e.decodeStrings==null&&(e.decodeStrings=!0);var i=!!e.decodeStrings;if(e.validateEntrySizes==null&&(e.validateEntrySizes=!0),e.strictFileNames==null&&(e.strictFileNames=!1),r==null&&(r=AR),typeof t!="number")throw new Error("expected totalSize parameter to be a number");if(t>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.");n.ref();var s=22,a=20,o=65535,c=Math.min(a+s+o,t),u=Mu(c),h=t-u.length;ub(n,u,0,c,h,function(f){if(f)return r(f);for(var d=c-s;d>=0;d-=1)if(u.readUInt32LE(d)===101010256){var p=u.subarray(d),g=p.readUInt16LE(4),y=p.readUInt16LE(10),b=p.readUInt32LE(16),m=p.readUInt16LE(20),w=p.length-s;if(m!==w)return r(new Error("Invalid comment length. Expected: "+w+". Found: "+m+". 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 A=i?wR(p.subarray(22),!1):p.subarray(22);if(d-a>=0&&u.readUInt32LE(d-a)===117853008){var _=u.subarray(d-a,d-a+a),S=cb(_,8),I=Mu(56);return ub(n,I,0,I.length,S,function(C){return C?r(C):I.readUInt32LE(0)!==101075792?r(new Error("invalid zip64 end of central directory record signature")):(g=I.readUInt32LE(16),g!==0?r(new Error("multi-disk zip files are not supported: found disk number: "+g)):(y=cb(I,32),b=cb(I,48),r(null,new fc(n,b,t,y,A,e.autoClose,e.lazyEntries,i,e.validateEntrySizes,e.strictFileNames))))})}return g!==0?r(new Error("multi-disk zip files are not supported: found disk number: "+g)):r(null,new fc(n,b,t,y,A,e.autoClose,e.lazyEntries,i,e.validateEntrySizes,e.strictFileNames))}r(new Error("End of central directory record signature not found. Either not a zip file, or file is truncated."))})}ER.inherits(fc,xR);function fc(n,t,e,r,i,s,a,o,c,u){var h=this;xR.call(h),h.reader=n,h.reader.on("error",function(f){$W(h,f)}),h.reader.once("close",function(){h.emit("close")}),h.readEntryCursor=t,h.fileSize=e,h.entryCount=r,h.comment=i,h.entriesRead=0,h.autoClose=!!s,h.lazyEntries=!!a,h.decodeStrings=!!o,h.validateEntrySizes=!!c,h.strictFileNames=!!u,h.isOpen=!0,h.emittedError=!1,h.lazyEntries||h._readEntry()}fc.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())};function hc(n,t){n.autoClose&&n.close(),$W(n,t)}function $W(n,t){n.emittedError||(n.emittedError=!0,n.emit("error",t))}fc.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};fc.prototype._readEntry=function(){var n=this;if(n.entryCount===n.entriesRead){setImmediate(function(){n.autoClose&&n.close(),!n.emittedError&&n.emit("end")});return}if(!n.emittedError){var t=Mu(46);ub(n.reader,t,0,t.length,n.readEntryCursor,function(e){if(e)return hc(n,e);if(!n.emittedError){var r=new s1,i=t.readUInt32LE(0);if(i!==33639248)return hc(n,new Error("invalid central directory file header signature: 0x"+i.toString(16)));if(r.versionMadeBy=t.readUInt16LE(4),r.versionNeededToExtract=t.readUInt16LE(6),r.generalPurposeBitFlag=t.readUInt16LE(8),r.compressionMethod=t.readUInt16LE(10),r.lastModFileTime=t.readUInt16LE(12),r.lastModFileDate=t.readUInt16LE(14),r.crc32=t.readUInt32LE(16),r.compressedSize=t.readUInt32LE(20),r.uncompressedSize=t.readUInt32LE(24),r.fileNameLength=t.readUInt16LE(28),r.extraFieldLength=t.readUInt16LE(30),r.fileCommentLength=t.readUInt16LE(32),r.internalFileAttributes=t.readUInt16LE(36),r.externalFileAttributes=t.readUInt32LE(38),r.relativeOffsetOfLocalHeader=t.readUInt32LE(42),r.generalPurposeBitFlag&64)return hc(n,new Error("strong encryption is not supported"));n.readEntryCursor+=46,t=Mu(r.fileNameLength+r.extraFieldLength+r.fileCommentLength),ub(n.reader,t,0,t.length,n.readEntryCursor,function(s){if(s)return hc(n,s);if(!n.emittedError){r.fileNameRaw=t.subarray(0,r.fileNameLength);var a=r.fileNameLength+r.extraFieldLength;r.extraFieldRaw=t.subarray(r.fileNameLength,a),r.fileCommentRaw=t.subarray(a,a+r.fileCommentLength);try{r.extraFields=VW(r.extraFieldRaw)}catch(y){return hc(n,y)}if(n.decodeStrings){var o=(r.generalPurposeBitFlag&2048)!==0;r.fileComment=wR(r.fileCommentRaw,o),r.fileName=WW(r.generalPurposeBitFlag,r.fileNameRaw,r.extraFields,n.strictFileNames);var c=GW(r.fileName);if(c!=null)return hc(n,new Error(c))}else r.fileComment=r.fileCommentRaw,r.fileName=r.fileNameRaw;r.comment=r.fileComment,n.readEntryCursor+=t.length,n.entriesRead+=1;for(var u=0;u<r.extraFields.length;u++){var h=r.extraFields[u];if(h.id===1){var f=h.data,d=0;if(r.uncompressedSize===4294967295){if(d+8>f.length)return hc(n,new Error("zip64 extended information extra field does not include uncompressed size"));r.uncompressedSize=cb(f,d),d+=8}if(r.compressedSize===4294967295){if(d+8>f.length)return hc(n,new Error("zip64 extended information extra field does not include compressed size"));r.compressedSize=cb(f,d),d+=8}if(r.relativeOffsetOfLocalHeader===4294967295){if(d+8>f.length)return hc(n,new Error("zip64 extended information extra field does not include relative header offset"));r.relativeOffsetOfLocalHeader=cb(f,d),d+=8}break}}if(n.validateEntrySizes&&r.compressionMethod===0){var p=r.uncompressedSize;if(r.isEncrypted()&&(p+=12),r.compressedSize!==p){var g="compressed/uncompressed size mismatch for stored file: "+r.compressedSize+" != "+r.uncompressedSize;return hc(n,new Error(g))}}n.emit("entry",r),n.lazyEntries||n._readEntry()}})}})}};fc.prototype.openReadStream=function(n,t,e){var r=this,i=0,s=n.compressedSize;if(e==null&&(e=t,t=null),t==null)t={};else{if(t.decrypt!=null){if(!n.isEncrypted())throw new Error("options.decrypt can only be specified for encrypted entries");if(t.decrypt!==!1)throw new Error("invalid options.decrypt value: "+t.decrypt);if(n.isCompressed()&&t.decompress!==!1)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}if(t.decompress!=null){if(!n.isCompressed())throw new Error("options.decompress can only be specified for compressed entries");if(!(t.decompress===!1||t.decompress===!0))throw new Error("invalid options.decompress value: "+t.decompress)}if(t.start!=null||t.end!=null){if(n.isCompressed()&&t.decompress!==!1)throw new Error("start/end range not allowed for compressed entry without options.decompress === false");if(n.isEncrypted()&&t.decrypt!==!1)throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(t.start!=null){if(i=t.start,i<0)throw new Error("options.start < 0");if(i>n.compressedSize)throw new Error("options.start > entry.compressedSize")}if(t.end!=null){if(s=t.end,s<0)throw new Error("options.end < 0");if(s>n.compressedSize)throw new Error("options.end > entry.compressedSize");if(s<i)throw new Error("options.end < options.start")}}if(!r.isOpen)return e(new Error("closed"));if(n.isEncrypted()&&t.decrypt!==!1)return e(new Error("entry is encrypted, and options.decrypt !== false"));var a;if(n.compressionMethod===0)a=!1;else if(n.compressionMethod===8)a=t.decompress!=null?t.decompress:!0;else return e(new Error("unsupported compression method: "+n.compressionMethod));r.readLocalFileHeader(n,{minimal:!0},function(o,c){if(o)return e(o);r.openReadStreamLowLevel(c.fileDataStart,n.compressedSize,i,s,a,n.uncompressedSize,e)})};fc.prototype.openReadStreamLowLevel=function(n,t,e,r,i,s,a){var o=this,c=n+t,u=o.reader.createReadStream({start:n+e,end:n+r}),h=u;if(i){var f=!1,d=Blt.createInflateRaw();u.on("error",function(p){setImmediate(function(){f||d.emit("error",p)})}),u.pipe(d),o.validateEntrySizes?(h=new a1(s),d.on("error",function(p){setImmediate(function(){f||h.emit("error",p)})}),d.pipe(h)):h=d,vM(h,function(){f=!0,d!==h&&d.unpipe(h),u.unpipe(d),u.destroy()})}a(null,h)};fc.prototype.readLocalFileHeader=function(n,t,e){var r=this;e==null&&(e=t,t=null),t==null&&(t={}),r.reader.ref();var i=Mu(30);ub(r.reader,i,0,i.length,n.relativeOffsetOfLocalHeader,function(s){try{if(s)return e(s);var a=i.readUInt32LE(0);if(a!==67324752)return e(new Error("invalid local file header signature: 0x"+a.toString(16)));var o=i.readUInt16LE(26),c=i.readUInt16LE(28),u=n.relativeOffsetOfLocalHeader+30+o+c;if(u+n.compressedSize>r.fileSize)return e(new Error("file data overflows file bounds: "+u+" + "+n.compressedSize+" > "+r.fileSize));if(t.minimal)return e(null,{fileDataStart:u});var h=new HW;h.fileDataStart=u,h.versionNeededToExtract=i.readUInt16LE(4),h.generalPurposeBitFlag=i.readUInt16LE(6),h.compressionMethod=i.readUInt16LE(8),h.lastModFileTime=i.readUInt16LE(10),h.lastModFileDate=i.readUInt16LE(12),h.crc32=i.readUInt32LE(14),h.compressedSize=i.readUInt32LE(18),h.uncompressedSize=i.readUInt32LE(22),h.fileNameLength=o,h.extraFieldLength=c,i=Mu(o+c),r.reader.ref(),ub(r.reader,i,0,i.length,n.relativeOffsetOfLocalHeader+30,function(f){try{return f?e(f):(h.fileName=i.subarray(0,o),h.extraField=i.subarray(o),e(null,h))}finally{r.reader.unref()}})}finally{r.reader.unref()}})};function s1(){}s1.prototype.getLastModDate=function(){return zW(this.lastModFileDate,this.lastModFileTime)};s1.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};s1.prototype.isCompressed=function(){return this.compressionMethod===8};function HW(){}function zW(n,t){var e=n&31,r=(n>>5&15)-1,i=(n>>9&127)+1980,s=0,a=(t&31)*2,o=t>>5&63,c=t>>11&31;return new Date(i,r,e,c,o,a,s)}function WW(n,t,e,r){for(var i=null,s=0;s<e.length;s++){var a=e[s];if(a.id===28789){if(a.data.length<6||a.data.readUInt8(0)!==1)continue;var o=a.data.readUInt32LE(1);if(Ult.unsigned(t)!==o)continue;i=wR(a.data.subarray(5),!0);break}}if(i==null){var c=(n&2048)!==0;i=wR(t,c)}return r||(i=i.replace(/\\/g,"/")),i}function GW(n){return n.indexOf("\\")!==-1?"invalid characters in fileName: "+n:/^[a-zA-Z]:/.test(n)||/^\//.test(n)?"absolute path: "+n:n.split("/").indexOf("..")!==-1?"invalid relative path: "+n:null}function VW(n){for(var t=[],e=0;e<n.length-3;){var r=n.readUInt16LE(e+0),i=n.readUInt16LE(e+2),s=e+4,a=s+i;if(a>n.length)throw new Error("extra field length exceeds extra field buffer size");var o=n.subarray(s,a);t.push({id:r,data:o}),e=a}return t}function ub(n,t,e,r,i,s){if(r===0)return setImmediate(function(){s(null,Mu(0))});n.read(t,e,r,i,function(a,o){if(a)return s(a);if(o<r)return s(new Error("unexpected EOF"));s()})}ER.inherits(a1,UW);function a1(n){UW.call(this),this.actualByteCount=0,this.expectedByteCount=n}a1.prototype._transform=function(n,t,e){if(this.actualByteCount+=n.length,this.actualByteCount>this.expectedByteCount){var r="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return e(new Error(r))}e(null,n)};a1.prototype._flush=function(n){if(this.actualByteCount<this.expectedByteCount){var t="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return n(new Error(t))}n()};ER.inherits(zf,xR);function zf(){xR.call(this),this.refCount=0}zf.prototype.ref=function(){this.refCount+=1};zf.prototype.unref=function(){var n=this;if(n.refCount-=1,n.refCount>0)return;if(n.refCount<0)throw new Error("invalid unref");n.close(t);function t(e){if(e)return n.emit("error",e);n.emit("close")}};zf.prototype.createReadStream=function(n){n==null&&(n={});var t=n.start,e=n.end;if(t===e){var r=new wM;return setImmediate(function(){r.end()}),r}var i=this._readStreamForRange(t,e),s=!1,a=new SR(this);i.on("error",function(c){setImmediate(function(){s||a.emit("error",c)})}),vM(a,function(){i.unpipe(a),a.unref(),i.destroy()});var o=new a1(e-t);return a.on("error",function(c){setImmediate(function(){s||o.emit("error",c)})}),vM(o,function(){s=!0,a.unpipe(o),a.destroy()}),i.pipe(a).pipe(o)};zf.prototype._readStreamForRange=function(n,t){throw new Error("not implemented")};zf.prototype.read=function(n,t,e,r,i){var s=this.createReadStream({start:r,end:r+e}),a=new jlt,o=0;a._write=function(c,u,h){c.copy(n,t+o,0,c.length),o+=c.length,h()},a.on("finish",i),s.on("error",function(c){i(c)}),s.pipe(a)};zf.prototype.close=function(n){setImmediate(n)};ER.inherits(SR,wM);function SR(n){wM.call(this),this.context=n,this.context.ref(),this.unreffedYet=!1}SR.prototype._flush=function(n){this.unref(),n()};SR.prototype.unref=function(n){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var zlt="\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 wR(n,t){if(t)return n.toString("utf8");for(var e="",r=0;r<n.length;r++)e+=zlt[n[r]];return e}function cb(n,t){var e=n.readUInt32LE(t),r=n.readUInt32LE(t+4);return r*4294967296+e}var Mu;typeof Buffer.allocUnsafe=="function"?Mu=function(n){return Buffer.allocUnsafe(n)}:Mu=function(n){return new Buffer(n)};function vM(n,t){typeof n.destroy=="function"?n._destroy=function(e,r){t(),r?.(e)}:n.destroy=t}function AR(n){if(n)throw n}});var EM=ae((lvt,qW)=>{Tt();Rt();Ct();qW.exports=(ob(),xn(YE)).EventEmitter});var tG=ae((fvt,QW)=>{"use strict";Tt();Rt();Ct();function YW(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),e.push.apply(e,r)}return e}function KW(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?YW(Object(e),!0).forEach(function(r){Wlt(n,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):YW(Object(e)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))})}return n}function Wlt(n,t,e){return t=JW(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function Glt(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function ZW(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,JW(r.key),r)}}function Vlt(n,t,e){return t&&ZW(n.prototype,t),e&&ZW(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function JW(n){var t=Xlt(n,"string");return typeof t=="symbol"?t:String(t)}function Xlt(n,t){if(typeof n!="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var r=e.call(n,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var qlt=(If(),xn(R0)),_R=qlt.Buffer,Ylt=(ab(),xn(qE)),xM=Ylt.inspect,Klt=xM&&xM.custom||"inspect";function Zlt(n,t,e){_R.prototype.copy.call(n,t,e)}QW.exports=(function(){function n(){Glt(this,n),this.head=null,this.tail=null,this.length=0}return Vlt(n,[{key:"push",value:function(e){var r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}},{key:"unshift",value:function(e){var r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}},{key:"shift",value:function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(this.length===0)return"";for(var r=this.head,i=""+r.data;r=r.next;)i+=e+r.data;return i}},{key:"concat",value:function(e){if(this.length===0)return _R.alloc(0);for(var r=_R.allocUnsafe(e>>>0),i=this.head,s=0;i;)Zlt(i.data,r,s),s+=i.data.length,i=i.next;return r}},{key:"consume",value:function(e,r){var i;return e<this.head.data.length?(i=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):e===this.head.data.length?i=this.shift():i=r?this._getString(e):this._getBuffer(e),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var r=this.head,i=1,s=r.data;for(e-=s.length;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(o===a.length?s+=a:s+=a.slice(0,e),e-=o,e===0){o===a.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=a.slice(o));break}++i}return this.length-=i,s}},{key:"_getBuffer",value:function(e){var r=_R.allocUnsafe(e),i=this.head,s=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),e-=o,e===0){o===a.length?(++s,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(o));break}++s}return this.length-=s,r}},{key:Klt,value:function(e,r){return xM(this,KW(KW({},r),{},{depth:0,customInspect:!1}))}}]),n})()});var _M=ae((mvt,rG)=>{"use strict";Tt();Rt();Ct();function Jlt(n,t){var e=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return r||i?(t?t(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(SM,this,n)):process.nextTick(SM,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,function(s){!t&&s?e._writableState?e._writableState.errorEmitted?process.nextTick(TR,e):(e._writableState.errorEmitted=!0,process.nextTick(eG,e,s)):process.nextTick(eG,e,s):t?(process.nextTick(TR,e),t(s)):process.nextTick(TR,e)}),this)}function eG(n,t){SM(n,t),TR(n)}function TR(n){n._writableState&&!n._writableState.emitClose||n._readableState&&!n._readableState.emitClose||n.emit("close")}function Qlt(){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 SM(n,t){n.emit("error",t)}function tct(n,t){var e=n._readableState,r=n._writableState;e&&e.autoDestroy||r&&r.autoDestroy?n.destroy(t):n.emit("error",t)}rG.exports={destroy:Jlt,undestroy:Qlt,errorOrDestroy:tct}});var dg=ae((wvt,sG)=>{"use strict";Tt();Rt();Ct();function ect(n,t){n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n.__proto__=t}var iG={};function To(n,t,e){e||(e=Error);function r(s,a,o){return typeof t=="string"?t:t(s,a,o)}var i=(function(s){ect(a,s);function a(o,c,u){return s.call(this,r(o,c,u))||this}return a})(e);i.prototype.name=e.name,i.prototype.code=n,iG[n]=i}function nG(n,t){if(Array.isArray(n)){var e=n.length;return n=n.map(function(r){return String(r)}),e>2?"one of ".concat(t," ").concat(n.slice(0,e-1).join(", "),", or ")+n[e-1]:e===2?"one of ".concat(t," ").concat(n[0]," or ").concat(n[1]):"of ".concat(t," ").concat(n[0])}else return"of ".concat(t," ").concat(String(n))}function rct(n,t,e){return n.substr(!e||e<0?0:+e,t.length)===t}function nct(n,t,e){return(e===void 0||e>n.length)&&(e=n.length),n.substring(e-t.length,e)===t}function ict(n,t,e){return typeof e!="number"&&(e=0),e+t.length>n.length?!1:n.indexOf(t,e)!==-1}To("ERR_INVALID_OPT_VALUE",function(n,t){return'The value "'+t+'" is invalid for option "'+n+'"'},TypeError);To("ERR_INVALID_ARG_TYPE",function(n,t,e){var r;typeof t=="string"&&rct(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be";var i;if(nct(n," argument"))i="The ".concat(n," ").concat(r," ").concat(nG(t,"type"));else{var s=ict(n,".")?"property":"argument";i='The "'.concat(n,'" ').concat(s," ").concat(r," ").concat(nG(t,"type"))}return i+=". Received type ".concat(typeof e),i},TypeError);To("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");To("ERR_METHOD_NOT_IMPLEMENTED",function(n){return"The "+n+" method is not implemented"});To("ERR_STREAM_PREMATURE_CLOSE","Premature close");To("ERR_STREAM_DESTROYED",function(n){return"Cannot call "+n+" after a stream was destroyed"});To("ERR_MULTIPLE_CALLBACK","Callback called multiple times");To("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");To("ERR_STREAM_WRITE_AFTER_END","write after end");To("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);To("ERR_UNKNOWN_ENCODING",function(n){return"Unknown encoding: "+n},TypeError);To("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");sG.exports.codes=iG});var TM=ae((Svt,aG)=>{"use strict";Tt();Rt();Ct();var sct=dg().codes.ERR_INVALID_OPT_VALUE;function act(n,t,e){return n.highWaterMark!=null?n.highWaterMark:t?n[e]:null}function oct(n,t,e,r){var i=act(t,r,e);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=r?e:"highWaterMark";throw new sct(s,i)}return Math.floor(i)}return n.objectMode?16:16*1024}aG.exports={getHighWaterMark:oct}});var pg=ae((Rvt,CM)=>{Tt();Rt();Ct();typeof Object.create=="function"?CM.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:CM.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}});var lG=ae((Pvt,oG)=>{Tt();Rt();Ct();oG.exports=lct;function lct(n,t){if(RM("noDeprecation"))return n;var e=!1;function r(){if(!e){if(RM("throwDeprecation"))throw new Error(t);RM("traceDeprecation")?console.trace(t):console.warn(t),e=!0}return n.apply(this,arguments)}return r}function RM(n){try{if(!window.localStorage)return!1}catch{return!1}var t=window.localStorage[n];return t==null?!1:String(t).toLowerCase()==="true"}});var OM=ae((Mvt,pG)=>{"use strict";Tt();Rt();Ct();pG.exports=Tn;function uG(n){var t=this;this.next=null,this.entry=null,this.finish=function(){kct(t,n)}}var hb;Tn.WritableState=l1;var cct={deprecate:lG()},hG=EM(),RR=(If(),xn(R0)).Buffer,uct=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function hct(n){return RR.from(n)}function fct(n){return RR.isBuffer(n)||n instanceof uct}var DM=_M(),dct=TM(),pct=dct.getHighWaterMark,Wf=dg().codes,gct=Wf.ERR_INVALID_ARG_TYPE,mct=Wf.ERR_METHOD_NOT_IMPLEMENTED,yct=Wf.ERR_MULTIPLE_CALLBACK,bct=Wf.ERR_STREAM_CANNOT_PIPE,vct=Wf.ERR_STREAM_DESTROYED,wct=Wf.ERR_STREAM_NULL_VALUES,Act=Wf.ERR_STREAM_WRITE_AFTER_END,Ect=Wf.ERR_UNKNOWN_ENCODING,fb=DM.errorOrDestroy;pg()(Tn,hG);function xct(){}function l1(n,t,e){hb=hb||gg(),n=n||{},typeof e!="boolean"&&(e=t instanceof hb),this.objectMode=!!n.objectMode,e&&(this.objectMode=this.objectMode||!!n.writableObjectMode),this.highWaterMark=pct(this,n,"writableHighWaterMark",e),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var r=n.decodeStrings===!1;this.decodeStrings=!r,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){Dct(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=n.emitClose!==!1,this.autoDestroy=!!n.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new uG(this)}l1.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e};(function(){try{Object.defineProperty(l1.prototype,"buffer",{get:cct.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var CR;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(CR=Function.prototype[Symbol.hasInstance],Object.defineProperty(Tn,Symbol.hasInstance,{value:function(t){return CR.call(this,t)?!0:this!==Tn?!1:t&&t._writableState instanceof l1}})):CR=function(t){return t instanceof this};function Tn(n){hb=hb||gg();var t=this instanceof hb;if(!t&&!CR.call(Tn,this))return new Tn(n);this._writableState=new l1(n,this,t),this.writable=!0,n&&(typeof n.write=="function"&&(this._write=n.write),typeof n.writev=="function"&&(this._writev=n.writev),typeof n.destroy=="function"&&(this._destroy=n.destroy),typeof n.final=="function"&&(this._final=n.final)),hG.call(this)}Tn.prototype.pipe=function(){fb(this,new bct)};function Sct(n,t){var e=new Act;fb(n,e),process.nextTick(t,e)}function _ct(n,t,e,r){var i;return e===null?i=new wct:typeof e!="string"&&!t.objectMode&&(i=new gct("chunk",["string","Buffer"],e)),i?(fb(n,i),process.nextTick(r,i),!1):!0}Tn.prototype.write=function(n,t,e){var r=this._writableState,i=!1,s=!r.objectMode&&fct(n);return s&&!RR.isBuffer(n)&&(n=hct(n)),typeof t=="function"&&(e=t,t=null),s?t="buffer":t||(t=r.defaultEncoding),typeof e!="function"&&(e=xct),r.ending?Sct(this,e):(s||_ct(this,r,n,e))&&(r.pendingcb++,i=Cct(this,r,s,n,t,e)),i};Tn.prototype.cork=function(){this._writableState.corked++};Tn.prototype.uncork=function(){var n=this._writableState;n.corked&&(n.corked--,!n.writing&&!n.corked&&!n.bufferProcessing&&n.bufferedRequest&&fG(this,n))};Tn.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new Ect(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(Tn.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Tct(n,t,e){return!n.objectMode&&n.decodeStrings!==!1&&typeof t=="string"&&(t=RR.from(t,e)),t}Object.defineProperty(Tn.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Cct(n,t,e,r,i,s){if(!e){var a=Tct(t,r,i);r!==a&&(e=!0,i="buffer",r=a)}var o=t.objectMode?1:r.length;t.length+=o;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:e,callback:s,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else IM(n,t,!1,o,r,i,s);return c}function IM(n,t,e,r,i,s,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new vct("write")):e?n._writev(i,t.onwrite):n._write(i,s,t.onwrite),t.sync=!1}function Rct(n,t,e,r,i){--t.pendingcb,e?(process.nextTick(i,r),process.nextTick(o1,n,t),n._writableState.errorEmitted=!0,fb(n,r)):(i(r),n._writableState.errorEmitted=!0,fb(n,r),o1(n,t))}function Ict(n){n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0}function Dct(n,t){var e=n._writableState,r=e.sync,i=e.writecb;if(typeof i!="function")throw new yct;if(Ict(e),t)Rct(n,e,r,t,i);else{var s=dG(e)||n.destroyed;!s&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&fG(n,e),r?process.nextTick(cG,n,e,s,i):cG(n,e,s,i)}}function cG(n,t,e,r){e||Oct(n,t),t.pendingcb--,r(),o1(n,t)}function Oct(n,t){t.length===0&&t.needDrain&&(t.needDrain=!1,n.emit("drain"))}function fG(n,t){t.bufferProcessing=!0;var e=t.bufferedRequest;if(n._writev&&e&&e.next){var r=t.bufferedRequestCount,i=new Array(r),s=t.corkedRequestsFree;s.entry=e;for(var a=0,o=!0;e;)i[a]=e,e.isBuf||(o=!1),e=e.next,a+=1;i.allBuffers=o,IM(n,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new uG(t),t.bufferedRequestCount=0}else{for(;e;){var c=e.chunk,u=e.encoding,h=e.callback,f=t.objectMode?1:c.length;if(IM(n,t,!1,f,c,u,h),e=e.next,t.bufferedRequestCount--,t.writing)break}e===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=e,t.bufferProcessing=!1}Tn.prototype._write=function(n,t,e){e(new mct("_write()"))};Tn.prototype._writev=null;Tn.prototype.end=function(n,t,e){var r=this._writableState;return typeof n=="function"?(e=n,n=null,t=null):typeof t=="function"&&(e=t,t=null),n!=null&&this.write(n,t),r.corked&&(r.corked=1,this.uncork()),r.ending||Lct(this,r,e),this};Object.defineProperty(Tn.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function dG(n){return n.ending&&n.length===0&&n.bufferedRequest===null&&!n.finished&&!n.writing}function Pct(n,t){n._final(function(e){t.pendingcb--,e&&fb(n,e),t.prefinished=!0,n.emit("prefinish"),o1(n,t)})}function Nct(n,t){!t.prefinished&&!t.finalCalled&&(typeof n._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(Pct,n,t)):(t.prefinished=!0,n.emit("prefinish")))}function o1(n,t){var e=dG(t);if(e&&(Nct(n,t),t.pendingcb===0&&(t.finished=!0,n.emit("finish"),t.autoDestroy))){var r=n._readableState;(!r||r.autoDestroy&&r.endEmitted)&&n.destroy()}return e}function Lct(n,t,e){t.ending=!0,o1(n,t),e&&(t.finished?process.nextTick(e):n.once("finish",e)),t.ended=!0,n.writable=!1}function kct(n,t,e){var r=n.entry;for(n.entry=null;r;){var i=r.callback;t.pendingcb--,i(e),r=r.next}t.corkedRequestsFree.next=n}Object.defineProperty(Tn.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});Tn.prototype.destroy=DM.destroy;Tn.prototype._undestroy=DM.undestroy;Tn.prototype._destroy=function(n,t){t(n)}});var gg=ae((jvt,mG)=>{"use strict";Tt();Rt();Ct();var Mct=Object.keys||function(n){var t=[];for(var e in n)t.push(e);return t};mG.exports=dc;var gG=LM(),NM=OM();pg()(dc,gG);for(PM=Mct(NM.prototype),IR=0;IR<PM.length;IR++)DR=PM[IR],dc.prototype[DR]||(dc.prototype[DR]=NM.prototype[DR]);var PM,DR,IR;function dc(n){if(!(this instanceof dc))return new dc(n);gG.call(this,n),NM.call(this,n),this.allowHalfOpen=!0,n&&(n.readable===!1&&(this.readable=!1),n.writable===!1&&(this.writable=!1),n.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Fct)))}Object.defineProperty(dc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(dc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(dc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Fct(){this._writableState.ended||process.nextTick(Bct,this)}function Bct(n){n.end()}Object.defineProperty(dc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var vG=ae((kM,bG)=>{Tt();Rt();Ct();var OR=(If(),xn(R0)),Fu=OR.Buffer;function yG(n,t){for(var e in n)t[e]=n[e]}Fu.from&&Fu.alloc&&Fu.allocUnsafe&&Fu.allocUnsafeSlow?bG.exports=OR:(yG(OR,kM),kM.Buffer=db);function db(n,t,e){return Fu(n,t,e)}yG(Fu,db);db.from=function(n,t,e){if(typeof n=="number")throw new TypeError("Argument must not be a number");return Fu(n,t,e)};db.alloc=function(n,t,e){if(typeof n!="number")throw new TypeError("Argument must be a number");var r=Fu(n);return t!==void 0?typeof e=="string"?r.fill(t,e):r.fill(t):r.fill(0),r};db.allocUnsafe=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return Fu(n)};db.allocUnsafeSlow=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return OR.SlowBuffer(n)}});var BM=ae(AG=>{"use strict";Tt();Rt();Ct();var FM=vG().Buffer,wG=FM.isEncoding||function(n){switch(n=""+n,n&&n.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 Uct(n){if(!n)return"utf8";for(var t;;)switch(n){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 n;default:if(t)return;n=(""+n).toLowerCase(),t=!0}}function jct(n){var t=Uct(n);if(typeof t!="string"&&(FM.isEncoding===wG||!wG(n)))throw new Error("Unknown encoding: "+n);return t||n}AG.StringDecoder=c1;function c1(n){this.encoding=jct(n);var t;switch(this.encoding){case"utf16le":this.text=Vct,this.end=Xct,t=4;break;case"utf8":this.fillLast=zct,t=4;break;case"base64":this.text=qct,this.end=Yct,t=3;break;default:this.write=Kct,this.end=Zct;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=FM.allocUnsafe(t)}c1.prototype.write=function(n){if(n.length===0)return"";var t,e;if(this.lastNeed){if(t=this.fillLast(n),t===void 0)return"";e=this.lastNeed,this.lastNeed=0}else e=0;return e<n.length?t?t+this.text(n,e):this.text(n,e):t||""};c1.prototype.end=Gct;c1.prototype.text=Wct;c1.prototype.fillLast=function(n){if(this.lastNeed<=n.length)return n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,n.length),this.lastNeed-=n.length};function MM(n){return n<=127?0:n>>5===6?2:n>>4===14?3:n>>3===30?4:n>>6===2?-1:-2}function $ct(n,t,e){var r=t.length-1;if(r<e)return 0;var i=MM(t[r]);return i>=0?(i>0&&(n.lastNeed=i-1),i):--r<e||i===-2?0:(i=MM(t[r]),i>=0?(i>0&&(n.lastNeed=i-2),i):--r<e||i===-2?0:(i=MM(t[r]),i>=0?(i>0&&(i===2?i=0:n.lastNeed=i-3),i):0))}function Hct(n,t,e){if((t[0]&192)!==128)return n.lastNeed=0,"\uFFFD";if(n.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return n.lastNeed=1,"\uFFFD";if(n.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return n.lastNeed=2,"\uFFFD"}}function zct(n){var t=this.lastTotal-this.lastNeed,e=Hct(this,n,t);if(e!==void 0)return e;if(this.lastNeed<=n.length)return n.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,t,0,n.length),this.lastNeed-=n.length}function Wct(n,t){var e=$ct(this,n,t);if(!this.lastNeed)return n.toString("utf8",t);this.lastTotal=e;var r=n.length-(e-this.lastNeed);return n.copy(this.lastChar,0,r),n.toString("utf8",t,r)}function Gct(n){var t=n&&n.length?this.write(n):"";return this.lastNeed?t+"\uFFFD":t}function Vct(n,t){if((n.length-t)%2===0){var e=n.toString("utf16le",t);if(e){var r=e.charCodeAt(e.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],e.slice(0,-1)}return e}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",t,n.length-1)}function Xct(n){var t=n&&n.length?this.write(n):"";if(this.lastNeed){var e=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,e)}return t}function qct(n,t){var e=(n.length-t)%3;return e===0?n.toString("base64",t):(this.lastNeed=3-e,this.lastTotal=3,e===1?this.lastChar[0]=n[n.length-1]:(this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1]),n.toString("base64",t,n.length-e))}function Yct(n){var t=n&&n.length?this.write(n):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Kct(n){return n.toString(this.encoding)}function Zct(n){return n&&n.length?this.write(n):""}});var PR=ae((Zvt,SG)=>{"use strict";Tt();Rt();Ct();var EG=dg().codes.ERR_STREAM_PREMATURE_CLOSE;function Jct(n){var t=!1;return function(){if(!t){t=!0;for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];n.apply(this,r)}}}function Qct(){}function tut(n){return n.setHeader&&typeof n.abort=="function"}function xG(n,t,e){if(typeof t=="function")return xG(n,null,t);t||(t={}),e=Jct(e||Qct);var r=t.readable||t.readable!==!1&&n.readable,i=t.writable||t.writable!==!1&&n.writable,s=function(){n.writable||o()},a=n._writableState&&n._writableState.finished,o=function(){i=!1,a=!0,r||e.call(n)},c=n._readableState&&n._readableState.endEmitted,u=function(){r=!1,c=!0,i||e.call(n)},h=function(g){e.call(n,g)},f=function(){var g;if(r&&!c)return(!n._readableState||!n._readableState.ended)&&(g=new EG),e.call(n,g);if(i&&!a)return(!n._writableState||!n._writableState.ended)&&(g=new EG),e.call(n,g)},d=function(){n.req.on("finish",o)};return tut(n)?(n.on("complete",o),n.on("abort",f),n.req?d():n.on("request",d)):i&&!n._writableState&&(n.on("end",s),n.on("close",s)),n.on("end",u),n.on("finish",o),t.error!==!1&&n.on("error",h),n.on("close",f),function(){n.removeListener("complete",o),n.removeListener("abort",f),n.removeListener("request",d),n.req&&n.req.removeListener("finish",o),n.removeListener("end",s),n.removeListener("close",s),n.removeListener("finish",o),n.removeListener("end",u),n.removeListener("error",h),n.removeListener("close",f)}}SG.exports=xG});var TG=ae((ewt,_G)=>{"use strict";Tt();Rt();Ct();var NR;function Gf(n,t,e){return t=eut(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function eut(n){var t=rut(n,"string");return typeof t=="symbol"?t:String(t)}function rut(n,t){if(typeof n!="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var r=e.call(n,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var nut=PR(),Vf=Symbol("lastResolve"),mg=Symbol("lastReject"),u1=Symbol("error"),LR=Symbol("ended"),yg=Symbol("lastPromise"),UM=Symbol("handlePromise"),bg=Symbol("stream");function Xf(n,t){return{value:n,done:t}}function iut(n){var t=n[Vf];if(t!==null){var e=n[bg].read();e!==null&&(n[yg]=null,n[Vf]=null,n[mg]=null,t(Xf(e,!1)))}}function sut(n){process.nextTick(iut,n)}function aut(n,t){return function(e,r){n.then(function(){if(t[LR]){e(Xf(void 0,!0));return}t[UM](e,r)},r)}}var out=Object.getPrototypeOf(function(){}),lut=Object.setPrototypeOf((NR={get stream(){return this[bg]},next:function(){var t=this,e=this[u1];if(e!==null)return Promise.reject(e);if(this[LR])return Promise.resolve(Xf(void 0,!0));if(this[bg].destroyed)return new Promise(function(a,o){process.nextTick(function(){t[u1]?o(t[u1]):a(Xf(void 0,!0))})});var r=this[yg],i;if(r)i=new Promise(aut(r,this));else{var s=this[bg].read();if(s!==null)return Promise.resolve(Xf(s,!1));i=new Promise(this[UM])}return this[yg]=i,i}},Gf(NR,Symbol.asyncIterator,function(){return this}),Gf(NR,"return",function(){var t=this;return new Promise(function(e,r){t[bg].destroy(null,function(i){if(i){r(i);return}e(Xf(void 0,!0))})})}),NR),out),cut=function(t){var e,r=Object.create(lut,(e={},Gf(e,bg,{value:t,writable:!0}),Gf(e,Vf,{value:null,writable:!0}),Gf(e,mg,{value:null,writable:!0}),Gf(e,u1,{value:null,writable:!0}),Gf(e,LR,{value:t._readableState.endEmitted,writable:!0}),Gf(e,UM,{value:function(s,a){var o=r[bg].read();o?(r[yg]=null,r[Vf]=null,r[mg]=null,s(Xf(o,!1))):(r[Vf]=s,r[mg]=a)},writable:!0}),e));return r[yg]=null,nut(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=r[mg];s!==null&&(r[yg]=null,r[Vf]=null,r[mg]=null,s(i)),r[u1]=i;return}var a=r[Vf];a!==null&&(r[yg]=null,r[Vf]=null,r[mg]=null,a(Xf(void 0,!0))),r[LR]=!0}),t.on("readable",sut.bind(null,r)),r};_G.exports=cut});var RG=ae((swt,CG)=>{Tt();Rt();Ct();CG.exports=function(){throw new Error("Readable.from is not available in the browser")}});var LM=ae((uwt,BG)=>{"use strict";Tt();Rt();Ct();BG.exports=ir;var pb;ir.ReadableState=PG;var cwt=(ob(),xn(YE)).EventEmitter,OG=function(t,e){return t.listeners(e).length},f1=EM(),kR=(If(),xn(R0)).Buffer,uut=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function hut(n){return kR.from(n)}function fut(n){return kR.isBuffer(n)||n instanceof uut}var jM=(ab(),xn(qE)),Ve;jM&&jM.debuglog?Ve=jM.debuglog("stream"):Ve=function(){};var dut=tG(),XM=_M(),put=TM(),gut=put.getHighWaterMark,MR=dg().codes,mut=MR.ERR_INVALID_ARG_TYPE,yut=MR.ERR_STREAM_PUSH_AFTER_EOF,but=MR.ERR_METHOD_NOT_IMPLEMENTED,vut=MR.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,gb,$M,HM;pg()(ir,f1);var h1=XM.errorOrDestroy,zM=["error","close","destroy","pause","resume"];function wut(n,t,e){if(typeof n.prependListener=="function")return n.prependListener(t,e);!n._events||!n._events[t]?n.on(t,e):Array.isArray(n._events[t])?n._events[t].unshift(e):n._events[t]=[e,n._events[t]]}function PG(n,t,e){pb=pb||gg(),n=n||{},typeof e!="boolean"&&(e=t instanceof pb),this.objectMode=!!n.objectMode,e&&(this.objectMode=this.objectMode||!!n.readableObjectMode),this.highWaterMark=gut(this,n,"readableHighWaterMark",e),this.buffer=new dut,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=n.emitClose!==!1,this.autoDestroy=!!n.autoDestroy,this.destroyed=!1,this.defaultEncoding=n.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,n.encoding&&(gb||(gb=BM().StringDecoder),this.decoder=new gb(n.encoding),this.encoding=n.encoding)}function ir(n){if(pb=pb||gg(),!(this instanceof ir))return new ir(n);var t=this instanceof pb;this._readableState=new PG(n,this,t),this.readable=!0,n&&(typeof n.read=="function"&&(this._read=n.read),typeof n.destroy=="function"&&(this._destroy=n.destroy)),f1.call(this)}Object.defineProperty(ir.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});ir.prototype.destroy=XM.destroy;ir.prototype._undestroy=XM.undestroy;ir.prototype._destroy=function(n,t){t(n)};ir.prototype.push=function(n,t){var e=this._readableState,r;return e.objectMode?r=!0:typeof n=="string"&&(t=t||e.defaultEncoding,t!==e.encoding&&(n=kR.from(n,t),t=""),r=!0),NG(this,n,t,!1,r)};ir.prototype.unshift=function(n){return NG(this,n,null,!0,!1)};function NG(n,t,e,r,i){Ve("readableAddChunk",t);var s=n._readableState;if(t===null)s.reading=!1,xut(n,s);else{var a;if(i||(a=Aut(s,t)),a)h1(n,a);else if(s.objectMode||t&&t.length>0)if(typeof t!="string"&&!s.objectMode&&Object.getPrototypeOf(t)!==kR.prototype&&(t=hut(t)),r)s.endEmitted?h1(n,new vut):WM(n,s,t,!0);else if(s.ended)h1(n,new yut);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!e?(t=s.decoder.write(t),s.objectMode||t.length!==0?WM(n,s,t,!1):VM(n,s)):WM(n,s,t,!1)}else r||(s.reading=!1,VM(n,s))}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}function WM(n,t,e,r){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,n.emit("data",e)):(t.length+=t.objectMode?1:e.length,r?t.buffer.unshift(e):t.buffer.push(e),t.needReadable&&FR(n)),VM(n,t)}function Aut(n,t){var e;return!fut(t)&&typeof t!="string"&&t!==void 0&&!n.objectMode&&(e=new mut("chunk",["string","Buffer","Uint8Array"],t)),e}ir.prototype.isPaused=function(){return this._readableState.flowing===!1};ir.prototype.setEncoding=function(n){gb||(gb=BM().StringDecoder);var t=new gb(n);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var e=this._readableState.buffer.head,r="";e!==null;)r+=t.write(e.data),e=e.next;return this._readableState.buffer.clear(),r!==""&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var IG=1073741824;function Eut(n){return n>=IG?n=IG:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function DG(n,t){return n<=0||t.length===0&&t.ended?0:t.objectMode?1:n!==n?t.flowing&&t.length?t.buffer.head.data.length:t.length:(n>t.highWaterMark&&(t.highWaterMark=Eut(n)),n<=t.length?n:t.ended?t.length:(t.needReadable=!0,0))}ir.prototype.read=function(n){Ve("read",n),n=parseInt(n,10);var t=this._readableState,e=n;if(n!==0&&(t.emittedReadable=!1),n===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return Ve("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?GM(this):FR(this),null;if(n=DG(n,t),n===0&&t.ended)return t.length===0&&GM(this),null;var r=t.needReadable;Ve("need readable",r),(t.length===0||t.length-n<t.highWaterMark)&&(r=!0,Ve("length less than watermark",r)),t.ended||t.reading?(r=!1,Ve("reading or ended",r)):r&&(Ve("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(n=DG(e,t)));var i;return n>0?i=MG(n,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,n=0):(t.length-=n,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),e!==n&&t.ended&&GM(this)),i!==null&&this.emit("data",i),i};function xut(n,t){if(Ve("onEofChunk"),!t.ended){if(t.decoder){var e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?FR(n):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,LG(n)))}}function FR(n){var t=n._readableState;Ve("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(Ve("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(LG,n))}function LG(n){var t=n._readableState;Ve("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(n.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,qM(n)}function VM(n,t){t.readingMore||(t.readingMore=!0,process.nextTick(Sut,n,t))}function Sut(n,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var e=t.length;if(Ve("maybeReadMore read 0"),n.read(0),e===t.length)break}t.readingMore=!1}ir.prototype._read=function(n){h1(this,new but("_read()"))};ir.prototype.pipe=function(n,t){var e=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=n;break;case 1:r.pipes=[r.pipes,n];break;default:r.pipes.push(n);break}r.pipesCount+=1,Ve("pipe count=%d opts=%j",r.pipesCount,t);var i=(!t||t.end!==!1)&&n!==process.stdout&&n!==process.stderr,s=i?o:y;r.endEmitted?process.nextTick(s):e.once("end",s),n.on("unpipe",a);function a(b,m){Ve("onunpipe"),b===e&&m&&m.hasUnpiped===!1&&(m.hasUnpiped=!0,h())}function o(){Ve("onend"),n.end()}var c=_ut(e);n.on("drain",c);var u=!1;function h(){Ve("cleanup"),n.removeListener("close",p),n.removeListener("finish",g),n.removeListener("drain",c),n.removeListener("error",d),n.removeListener("unpipe",a),e.removeListener("end",o),e.removeListener("end",y),e.removeListener("data",f),u=!0,r.awaitDrain&&(!n._writableState||n._writableState.needDrain)&&c()}e.on("data",f);function f(b){Ve("ondata");var m=n.write(b);Ve("dest.write",m),m===!1&&((r.pipesCount===1&&r.pipes===n||r.pipesCount>1&&FG(r.pipes,n)!==-1)&&!u&&(Ve("false write response, pause",r.awaitDrain),r.awaitDrain++),e.pause())}function d(b){Ve("onerror",b),y(),n.removeListener("error",d),OG(n,"error")===0&&h1(n,b)}wut(n,"error",d);function p(){n.removeListener("finish",g),y()}n.once("close",p);function g(){Ve("onfinish"),n.removeListener("close",p),y()}n.once("finish",g);function y(){Ve("unpipe"),e.unpipe(n)}return n.emit("pipe",e),r.flowing||(Ve("pipe resume"),e.resume()),n};function _ut(n){return function(){var e=n._readableState;Ve("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,e.awaitDrain===0&&OG(n,"data")&&(e.flowing=!0,qM(n))}}ir.prototype.unpipe=function(n){var t=this._readableState,e={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return n&&n!==t.pipes?this:(n||(n=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,n&&n.emit("unpipe",this,e),this);if(!n){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)r[s].emit("unpipe",this,{hasUnpiped:!1});return this}var a=FG(t.pipes,n);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),n.emit("unpipe",this,e),this)};ir.prototype.on=function(n,t){var e=f1.prototype.on.call(this,n,t),r=this._readableState;return n==="data"?(r.readableListening=this.listenerCount("readable")>0,r.flowing!==!1&&this.resume()):n==="readable"&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,Ve("on readable",r.length,r.reading),r.length?FR(this):r.reading||process.nextTick(Tut,this)),e};ir.prototype.addListener=ir.prototype.on;ir.prototype.removeListener=function(n,t){var e=f1.prototype.removeListener.call(this,n,t);return n==="readable"&&process.nextTick(kG,this),e};ir.prototype.removeAllListeners=function(n){var t=f1.prototype.removeAllListeners.apply(this,arguments);return(n==="readable"||n===void 0)&&process.nextTick(kG,this),t};function kG(n){var t=n._readableState;t.readableListening=n.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:n.listenerCount("data")>0&&n.resume()}function Tut(n){Ve("readable nexttick read 0"),n.read(0)}ir.prototype.resume=function(){var n=this._readableState;return n.flowing||(Ve("resume"),n.flowing=!n.readableListening,Cut(this,n)),n.paused=!1,this};function Cut(n,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(Rut,n,t))}function Rut(n,t){Ve("resume",t.reading),t.reading||n.read(0),t.resumeScheduled=!1,n.emit("resume"),qM(n),t.flowing&&!t.reading&&n.read(0)}ir.prototype.pause=function(){return Ve("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Ve("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function qM(n){var t=n._readableState;for(Ve("flow",t.flowing);t.flowing&&n.read()!==null;);}ir.prototype.wrap=function(n){var t=this,e=this._readableState,r=!1;n.on("end",function(){if(Ve("wrapped end"),e.decoder&&!e.ended){var a=e.decoder.end();a&&a.length&&t.push(a)}t.push(null)}),n.on("data",function(a){if(Ve("wrapped data"),e.decoder&&(a=e.decoder.write(a)),!(e.objectMode&&a==null)&&!(!e.objectMode&&(!a||!a.length))){var o=t.push(a);o||(r=!0,n.pause())}});for(var i in n)this[i]===void 0&&typeof n[i]=="function"&&(this[i]=(function(o){return function(){return n[o].apply(n,arguments)}})(i));for(var s=0;s<zM.length;s++)n.on(zM[s],this.emit.bind(this,zM[s]));return this._read=function(a){Ve("wrapped _read",a),r&&(r=!1,n.resume())},this};typeof Symbol=="function"&&(ir.prototype[Symbol.asyncIterator]=function(){return $M===void 0&&($M=TG()),$M(this)});Object.defineProperty(ir.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(ir.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(ir.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});ir._fromList=MG;Object.defineProperty(ir.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function MG(n,t){if(t.length===0)return null;var e;return t.objectMode?e=t.buffer.shift():!n||n>=t.length?(t.decoder?e=t.buffer.join(""):t.buffer.length===1?e=t.buffer.first():e=t.buffer.concat(t.length),t.buffer.clear()):e=t.buffer.consume(n,t.decoder),e}function GM(n){var t=n._readableState;Ve("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(Iut,t,n))}function Iut(n,t){if(Ve("endReadableNT",n.endEmitted,n.length),!n.endEmitted&&n.length===0&&(n.endEmitted=!0,t.readable=!1,t.emit("end"),n.autoDestroy)){var e=t._writableState;(!e||e.autoDestroy&&e.finished)&&t.destroy()}}typeof Symbol=="function"&&(ir.from=function(n,t){return HM===void 0&&(HM=RG()),HM(ir,n,t)});function FG(n,t){for(var e=0,r=n.length;e<r;e++)if(n[e]===t)return e;return-1}});var YM=ae((pwt,jG)=>{"use strict";Tt();Rt();Ct();jG.exports=Bu;var BR=dg().codes,Dut=BR.ERR_METHOD_NOT_IMPLEMENTED,Out=BR.ERR_MULTIPLE_CALLBACK,Put=BR.ERR_TRANSFORM_ALREADY_TRANSFORMING,Nut=BR.ERR_TRANSFORM_WITH_LENGTH_0,UR=gg();pg()(Bu,UR);function Lut(n,t){var e=this._transformState;e.transforming=!1;var r=e.writecb;if(r===null)return this.emit("error",new Out);e.writechunk=null,e.writecb=null,t!=null&&this.push(t),r(n);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Bu(n){if(!(this instanceof Bu))return new Bu(n);UR.call(this,n),this._transformState={afterTransform:Lut.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,n&&(typeof n.transform=="function"&&(this._transform=n.transform),typeof n.flush=="function"&&(this._flush=n.flush)),this.on("prefinish",kut)}function kut(){var n=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,e){UG(n,t,e)}):UG(this,null,null)}Bu.prototype.push=function(n,t){return this._transformState.needTransform=!1,UR.prototype.push.call(this,n,t)};Bu.prototype._transform=function(n,t,e){e(new Dut("_transform()"))};Bu.prototype._write=function(n,t,e){var r=this._transformState;if(r.writecb=e,r.writechunk=n,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Bu.prototype._read=function(n){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Bu.prototype._destroy=function(n,t){UR.prototype._destroy.call(this,n,function(e){t(e)})};function UG(n,t,e){if(t)return n.emit("error",t);if(e!=null&&n.push(e),n._writableState.length)throw new Nut;if(n._transformState.transforming)throw new Put;return n.push(null)}});var zG=ae((bwt,HG)=>{"use strict";Tt();Rt();Ct();HG.exports=d1;var $G=YM();pg()(d1,$G);function d1(n){if(!(this instanceof d1))return new d1(n);$G.call(this,n)}d1.prototype._transform=function(n,t,e){e(null,n)}});var qG=ae((Ewt,XG)=>{"use strict";Tt();Rt();Ct();var KM;function Mut(n){var t=!1;return function(){t||(t=!0,n.apply(void 0,arguments))}}var VG=dg().codes,Fut=VG.ERR_MISSING_ARGS,But=VG.ERR_STREAM_DESTROYED;function WG(n){if(n)throw n}function Uut(n){return n.setHeader&&typeof n.abort=="function"}function jut(n,t,e,r){r=Mut(r);var i=!1;n.on("close",function(){i=!0}),KM===void 0&&(KM=PR()),KM(n,{readable:t,writable:e},function(a){if(a)return r(a);i=!0,r()});var s=!1;return function(a){if(!i&&!s){if(s=!0,Uut(n))return n.abort();if(typeof n.destroy=="function")return n.destroy();r(a||new But("pipe"))}}}function GG(n){n()}function $ut(n,t){return n.pipe(t)}function Hut(n){return!n.length||typeof n[n.length-1]!="function"?WG:n.pop()}function zut(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];var r=Hut(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Fut("streams");var i,s=t.map(function(a,o){var c=o<t.length-1,u=o>0;return jut(a,c,u,function(h){i||(i=h),h&&s.forEach(GG),!c&&(s.forEach(GG),r(i))})});return t.reduce($ut)}XG.exports=zut});var KG=ae((Co,YG)=>{Tt();Rt();Ct();Co=YG.exports=LM();Co.Stream=Co;Co.Readable=Co;Co.Writable=OM();Co.Duplex=gg();Co.Transform=YM();Co.PassThrough=zG();Co.finished=PR();Co.pipeline=qG()});var JG=ae((Iwt,ZG)=>{Tt();Rt();Ct();var Wut=Object.prototype.toString,ZM=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Gut(n){return Wut.call(n).slice(8,-1)==="ArrayBuffer"}function Vut(n,t,e){t>>>=0;var r=n.byteLength-t;if(r<0)throw new RangeError("'offset' is out of bounds");if(e===void 0)e=r;else if(e>>>=0,e>r)throw new RangeError("'length' is out of bounds");return ZM?Buffer.from(n.slice(t,t+e)):new Buffer(new Uint8Array(n.slice(t,t+e)))}function Xut(n,t){if((typeof t!="string"||t==="")&&(t="utf8"),!Buffer.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return ZM?Buffer.from(n,t):new Buffer(n,t)}function qut(n,t,e){if(typeof n=="number")throw new TypeError('"value" argument must not be a number');return Gut(n)?Vut(n,t,e):typeof n=="string"?Xut(n,t):ZM?Buffer.from(n):new Buffer(n)}ZG.exports=qut});var iV=ae(Se=>{Tt();Rt();Ct();var QG=void 0,Yut=1e5,an=(function(){var n=Object.prototype.toString,t=Object.prototype.hasOwnProperty;return{Class:function(e){return n.call(e).replace(/^\[object *|\]$/g,"")},HasProperty:function(e,r){return r in e},HasOwnProperty:function(e,r){return t.call(e,r)},IsCallable:function(e){return typeof e=="function"},ToInt32:function(e){return e>>0},ToUint32:function(e){return e>>>0}}})(),Kut=Math.LN2,Zut=Math.abs,jR=Math.floor,Jut=Math.log,Qut=Math.min,yl=Math.pow,tht=Math.round;function JM(n){if(tV&&mb){var t=tV(n),e;for(e=0;e<t.length;e+=1)mb(n,t[e],{value:n[t[e]],writable:!1,enumerable:!1,configurable:!1})}}var mb;Object.defineProperty&&(function(){try{return Object.defineProperty({},"x",{}),!0}catch{return!1}})()?mb=Object.defineProperty:mb=function(n,t,e){if(!n===Object(n))throw new TypeError("Object.defineProperty called on non-object");return an.HasProperty(e,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(n,t,e.get),an.HasProperty(e,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(n,t,e.set),an.HasProperty(e,"value")&&(n[t]=e.value),n};var tV=Object.getOwnPropertyNames||function(n){if(n!==Object(n))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t=[],e;for(e in n)an.HasOwnProperty(n,e)&&t.push(e);return t};function eht(n){if(!mb)return;if(n.length>Yut)throw new RangeError("Array too large for polyfill");function t(r){mb(n,r,{get:function(){return n._getter(r)},set:function(i){n._setter(r,i)},enumerable:!0,configurable:!1})}var e;for(e=0;e<n.length;e+=1)t(e)}function QM(n,t){var e=32-t;return n<<e>>e}function tF(n,t){var e=32-t;return n<<e>>>e}function rht(n){return[n&255]}function nht(n){return QM(n[0],8)}function iht(n){return[n&255]}function eV(n){return tF(n[0],8)}function sht(n){return n=tht(Number(n)),[n<0?0:n>255?255:n&255]}function aht(n){return[n>>8&255,n&255]}function oht(n){return QM(n[0]<<8|n[1],16)}function lht(n){return[n>>8&255,n&255]}function cht(n){return tF(n[0]<<8|n[1],16)}function uht(n){return[n>>24&255,n>>16&255,n>>8&255,n&255]}function hht(n){return QM(n[0]<<24|n[1]<<16|n[2]<<8|n[3],32)}function fht(n){return[n>>24&255,n>>16&255,n>>8&255,n&255]}function dht(n){return tF(n[0]<<24|n[1]<<16|n[2]<<8|n[3],32)}function rV(n,t,e){var r=(1<<t-1)-1,i,s,a,o,c,u,h,f;function d(p){var g=jR(p),y=p-g;return y<.5?g:y>.5||g%2?g+1:g}for(n!==n?(s=(1<<t)-1,a=yl(2,e-1),i=0):n===1/0||n===-1/0?(s=(1<<t)-1,a=0,i=n<0?1:0):n===0?(s=0,a=0,i=1/n===-1/0?1:0):(i=n<0,n=Zut(n),n>=yl(2,1-r)?(s=Qut(jR(Jut(n)/Kut),1023),a=d(n/yl(2,s)*yl(2,e)),a/yl(2,e)>=2&&(s=s+1,a=1),s>r?(s=(1<<t)-1,a=0):(s=s+r,a=a-yl(2,e))):(s=0,a=d(n/yl(2,1-r-e)))),u=[],c=e;c;c-=1)u.push(a%2?1:0),a=jR(a/2);for(c=t;c;c-=1)u.push(s%2?1:0),s=jR(s/2);for(u.push(i?1:0),u.reverse(),h=u.join(""),f=[];h.length;)f.push(parseInt(h.substring(0,8),2)),h=h.substring(8);return f}function nV(n,t,e){var r=[],i,s,a,o,c,u,h,f;for(i=n.length;i;i-=1)for(a=n[i-1],s=8;s;s-=1)r.push(a%2?1:0),a=a>>1;return r.reverse(),o=r.join(""),c=(1<<t-1)-1,u=parseInt(o.substring(0,1),2)?-1:1,h=parseInt(o.substring(1,1+t),2),f=parseInt(o.substring(1+t),2),h===(1<<t)-1?f!==0?NaN:u*(1/0):h>0?u*yl(2,h-c)*(1+f/yl(2,e)):f!==0?u*yl(2,-(c-1))*(f/yl(2,e)):u<0?-0:0}function pht(n){return nV(n,11,52)}function ght(n){return rV(n,11,52)}function mht(n){return nV(n,8,23)}function yht(n){return rV(n,8,23)}(function(){var n=function(p){if(p=an.ToInt32(p),p<0)throw new RangeError("ArrayBuffer size is not a small enough positive integer");this.byteLength=p,this._bytes=[],this._bytes.length=p;var g;for(g=0;g<this.byteLength;g+=1)this._bytes[g]=0;JM(this)};Se.ArrayBuffer=Se.ArrayBuffer||n;var t=function(){};function e(d,p,g){var y;return y=function(b,m,w){var A,_,S,I;if(!arguments.length||typeof arguments[0]=="number"){if(this.length=an.ToInt32(arguments[0]),w<0)throw new RangeError("ArrayBufferView size is not a small enough positive integer");this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new n(this.byteLength),this.byteOffset=0}else if(typeof arguments[0]=="object"&&arguments[0].constructor===y)for(A=arguments[0],this.length=A.length,this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new n(this.byteLength),this.byteOffset=0,S=0;S<this.length;S+=1)this._setter(S,A._getter(S));else if(typeof arguments[0]=="object"&&!(arguments[0]instanceof n||an.Class(arguments[0])==="ArrayBuffer"))for(_=arguments[0],this.length=an.ToUint32(_.length),this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new n(this.byteLength),this.byteOffset=0,S=0;S<this.length;S+=1)I=_[S],this._setter(S,Number(I));else if(typeof arguments[0]=="object"&&(arguments[0]instanceof n||an.Class(arguments[0])==="ArrayBuffer")){if(this.buffer=b,this.byteOffset=an.ToUint32(m),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=an.ToUint32(w),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=y,JM(this),eht(this)},y.prototype=new t,y.prototype.BYTES_PER_ELEMENT=d,y.prototype._pack=p,y.prototype._unpack=g,y.BYTES_PER_ELEMENT=d,y.prototype._getter=function(b){if(arguments.length<1)throw new SyntaxError("Not enough arguments");if(b=an.ToUint32(b),b>=this.length)return QG;var m=[],w,A;for(w=0,A=this.byteOffset+b*this.BYTES_PER_ELEMENT;w<this.BYTES_PER_ELEMENT;w+=1,A+=1)m.push(this.buffer._bytes[A]);return this._unpack(m)},y.prototype.get=y.prototype._getter,y.prototype._setter=function(b,m){if(arguments.length<2)throw new SyntaxError("Not enough arguments");if(b=an.ToUint32(b),b>=this.length)return QG;var w=this._pack(m),A,_;for(A=0,_=this.byteOffset+b*this.BYTES_PER_ELEMENT;A<this.BYTES_PER_ELEMENT;A+=1,_+=1)this.buffer._bytes[_]=w[A]},y.prototype.set=function(b,m){if(arguments.length<1)throw new SyntaxError("Not enough arguments");var w,A,_,S,I,C,M,z,G,Y;if(typeof arguments[0]=="object"&&arguments[0].constructor===this.constructor){if(w=arguments[0],_=an.ToUint32(arguments[1]),_+w.length>this.length)throw new RangeError("Offset plus length of array is out of range");if(z=this.byteOffset+_*this.BYTES_PER_ELEMENT,G=w.length*this.BYTES_PER_ELEMENT,w.buffer===this.buffer){for(Y=[],I=0,C=w.byteOffset;I<G;I+=1,C+=1)Y[I]=w.buffer._bytes[C];for(I=0,M=z;I<G;I+=1,M+=1)this.buffer._bytes[M]=Y[I]}else for(I=0,C=w.byteOffset,M=z;I<G;I+=1,C+=1,M+=1)this.buffer._bytes[M]=w.buffer._bytes[C]}else if(typeof arguments[0]=="object"&&typeof arguments[0].length<"u"){if(A=arguments[0],S=an.ToUint32(A.length),_=an.ToUint32(arguments[1]),_+S>this.length)throw new RangeError("Offset plus length of array is out of range");for(I=0;I<S;I+=1)C=A[I],this._setter(_+I,Number(C))}else throw new TypeError("Unexpected argument type(s)")},y.prototype.subarray=function(b,m){function w(_,S,I){return _<S?S:_>I?I:_}b=an.ToInt32(b),m=an.ToInt32(m),arguments.length<1&&(b=0),arguments.length<2&&(m=this.length),b<0&&(b=this.length+b),m<0&&(m=this.length+m),b=w(b,0,this.length),m=w(m,0,this.length);var A=m-b;return A<0&&(A=0),new this.constructor(this.buffer,this.byteOffset+b*this.BYTES_PER_ELEMENT,A)},y}var r=e(1,rht,nht),i=e(1,iht,eV),s=e(1,sht,eV),a=e(2,aht,oht),o=e(2,lht,cht),c=e(4,uht,hht),u=e(4,fht,dht),h=e(4,yht,mht),f=e(8,ght,pht);Se.Int8Array=Se.Int8Array||r,Se.Uint8Array=Se.Uint8Array||i,Se.Uint8ClampedArray=Se.Uint8ClampedArray||s,Se.Int16Array=Se.Int16Array||a,Se.Uint16Array=Se.Uint16Array||o,Se.Int32Array=Se.Int32Array||c,Se.Uint32Array=Se.Uint32Array||u,Se.Float32Array=Se.Float32Array||h,Se.Float64Array=Se.Float64Array||f})();(function(){function n(s,a){return an.IsCallable(s.get)?s.get(a):s[a]}var t=(function(){var s=new Se.Uint16Array([4660]),a=new Se.Uint8Array(s.buffer);return n(a,0)===18})(),e=function(a,o,c){if(arguments.length===0)a=new Se.ArrayBuffer(0);else if(!(a instanceof Se.ArrayBuffer||an.Class(a)==="ArrayBuffer"))throw new TypeError("TypeError");if(this.buffer=a||new Se.ArrayBuffer(0),this.byteOffset=an.ToUint32(o),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=an.ToUint32(c),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");JM(this)};function r(s){return function(a,o){if(a=an.ToUint32(a),a+s.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");a+=this.byteOffset;var c=new Se.Uint8Array(this.buffer,a,s.BYTES_PER_ELEMENT),u=[],h;for(h=0;h<s.BYTES_PER_ELEMENT;h+=1)u.push(n(c,h));return!!o==!!t&&u.reverse(),n(new s(new Se.Uint8Array(u).buffer),0)}}e.prototype.getUint8=r(Se.Uint8Array),e.prototype.getInt8=r(Se.Int8Array),e.prototype.getUint16=r(Se.Uint16Array),e.prototype.getInt16=r(Se.Int16Array),e.prototype.getUint32=r(Se.Uint32Array),e.prototype.getInt32=r(Se.Int32Array),e.prototype.getFloat32=r(Se.Float32Array),e.prototype.getFloat64=r(Se.Float64Array);function i(s){return function(a,o,c){if(a=an.ToUint32(a),a+s.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");var u=new s([o]),h=new Se.Uint8Array(u.buffer),f=[],d,p;for(d=0;d<s.BYTES_PER_ELEMENT;d+=1)f.push(n(h,d));!!c==!!t&&f.reverse(),p=new Se.Uint8Array(this.buffer,a,s.BYTES_PER_ELEMENT),p.set(f)}}e.prototype.setUint8=i(Se.Uint8Array),e.prototype.setInt8=i(Se.Int8Array),e.prototype.setUint16=i(Se.Uint16Array),e.prototype.setInt16=i(Se.Int16Array),e.prototype.setUint32=i(Se.Uint32Array),e.prototype.setInt32=i(Se.Int32Array),e.prototype.setFloat32=i(Se.Float32Array),e.prototype.setFloat64=i(Se.Float64Array),Se.DataView=Se.DataView||e})()});var lV=ae((Fwt,oV)=>{Tt();Rt();Ct();var sV=KG().Writable,bht=pg(),p1=JG();typeof Uint8Array>"u"?$R=iV().Uint8Array:$R=Uint8Array;var $R;function vg(n,t){if(!(this instanceof vg))return new vg(n,t);typeof n=="function"&&(t=n,n={}),n||(n={});var e=n.encoding,r=!1;e?(e=String(e).toLowerCase(),(e==="u8"||e==="uint8")&&(e="uint8array")):r=!0,sV.call(this,{objectMode:!0}),this.encoding=e,this.shouldInferEncoding=r,t&&this.on("finish",function(){t(this.getBody())}),this.body=[]}oV.exports=vg;bht(vg,sV);vg.prototype._write=function(n,t,e){this.body.push(n),e()};vg.prototype.inferEncoding=function(n){var t=n===void 0?this.body[0]:n;return Buffer.isBuffer(t)?"buffer":typeof Uint8Array<"u"&&t instanceof Uint8Array?"uint8array":Array.isArray(t)?"array":typeof t=="string"?"string":Object.prototype.toString.call(t)==="[object Object]"?"object":"buffer"};vg.prototype.getBody=function(){return!this.encoding&&this.body.length===0?[]:(this.shouldInferEncoding&&(this.encoding=this.inferEncoding()),this.encoding==="array"?Eht(this.body):this.encoding==="string"?wht(this.body):this.encoding==="buffer"?Aht(this.body):this.encoding==="uint8array"?xht(this.body):this.body)};function vht(n){return/Array\]$/.test(Object.prototype.toString.call(n))}function aV(n){return typeof n=="string"||vht(n)||n&&typeof n.subarray=="function"}function wht(n){for(var t=[],e=!1,r=0;r<n.length;r++){var i=n[r];typeof i=="string"||Buffer.isBuffer(i)?t.push(i):aV(i)?t.push(p1(i)):t.push(p1(String(i)))}return Buffer.isBuffer(n[0])?(t=Buffer.concat(t),t=t.toString("utf8")):t=t.join(""),t}function Aht(n){for(var t=[],e=0;e<n.length;e++){var r=n[e];Buffer.isBuffer(r)?t.push(r):aV(r)?t.push(p1(r)):t.push(p1(String(r)))}return Buffer.concat(t)}function Eht(n){for(var t=[],e=0;e<n.length;e++)t.push.apply(t,n[e]);return t}function xht(n){for(var t=0,e=0;e<n.length;e++)typeof n[e]=="string"&&(n[e]=p1(n[e])),t+=n[e].length;for(var r=new $R(t),e=0,i=0;e<n.length;e++)for(var s=n[e],a=0;a<s.length;a++)r[i++]=s[a];return r}});var Lq={};tc(Lq,{AbortException:()=>Nl,AnnotationEditorLayer:()=>uD,AnnotationEditorParamsType:()=>Je,AnnotationEditorType:()=>Re,AnnotationEditorUIManager:()=>$d,AnnotationLayer:()=>nD,AnnotationMode:()=>Sh,AnnotationType:()=>zn,CSSConstants:()=>NI,ColorPicker:()=>J1,DOMSVGFactory:()=>Gm,DrawLayer:()=>hD,FeatureTest:()=>Pn,GlobalWorkerOptions:()=>Ho,ImageKind:()=>$1,InvalidPDFException:()=>ow,MathClamp:()=>ds,OPS:()=>aw,OutputScale:()=>Uc,PDFDataRangeTransport:()=>Z1,PDFDateString:()=>Hm,PDFWorker:()=>uw,PasswordResponses:()=>LV,PermissionFlag:()=>NV,PixelsPerInch:()=>Rh,RenderingCancelledException:()=>lw,ResponseException:()=>zm,SignatureExtractor:()=>zo,SupportedImageMimeTypes:()=>PI,TextLayer:()=>cw,TouchManager:()=>q1,Util:()=>ie,VerbosityLevel:()=>Yx,XfaLayer:()=>V1,applyOpacity:()=>$V,build:()=>$X,createValidAbsoluteUrl:()=>F3,fetchData:()=>hw,findContrastColor:()=>HV,getDocument:()=>FX,getFilenameFromUrl:()=>BV,getPdfFilenameFromUrl:()=>UV,getRGB:()=>fw,getUuid:()=>U3,getXfaPageViewport:()=>jV,isDataScheme:()=>Zx,isPdfFile:()=>ND,isValidExplicitDest:()=>EX,noContextMenu:()=>Ga,normalizeUnicode:()=>MV,renderRichText:()=>j3,setLayerDimensions:()=>jd,shadow:()=>Te,stopEvent:()=>mn,updateUrlHash:()=>B3,version:()=>jX});function Me(n){var t=dV[n];if(t!==void 0)return t.exports;var e=dV[n]={exports:{}};return Sht[n].call(e.exports,e,e.exports,Me),e.exports}function Tht(n){Number.isInteger(n)&&(OD=n)}function Cht(){return OD}function PD(n){OD>=Yx.INFOS&&console.info(`Info: ${n}`)}function _e(n){OD>=Yx.WARNINGS&&console.warn(`Warning: ${n}`)}function Wr(n){throw new Error(n)}function er(n,t){n||Wr(t)}function Rht(n){switch(n?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function F3(n,t=null,e=null){if(!n)return null;if(e&&typeof n=="string"&&(e.addDefaultProtocol&&n.startsWith("www.")&&n.match(/\./g)?.length>=2&&(n=`http://${n}`),e.tryConvertEncoding))try{n=Pht(n)}catch{}let r=t?URL.parse(n,t):URL.parse(n);return Rht(r)?r:null}function B3(n,t,e=!1){let r=URL.parse(n);return r?(r.hash=t,r.href):e&&F3(n,"http://example.com")?n.split("#",1)[0]+`${t?`#${t}`:""}`:""}function Te(n,t,e,r=!1){return Object.defineProperty(n,t,{value:e,enumerable:!r,configurable:!0,writable:!1}),e}function kV(n){(typeof n!="object"||n?.length===void 0)&&Wr("Invalid argument for bytesToString");let t=n.length,e=8192;if(t<e)return String.fromCharCode.apply(null,n);let r=[];for(let i=0;i<t;i+=e){let s=Math.min(i+e,t),a=n.subarray(i,s);r.push(String.fromCharCode.apply(null,a))}return r.join("")}function Kx(n){typeof n!="string"&&Wr("Invalid argument for stringToBytes");let t=n.length,e=new Uint8Array(t);for(let r=0;r<t;++r)e[r]=n.charCodeAt(r)&255;return e}function Iht(n){return String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,n&255)}function Dht(){let n=new Uint8Array(4);return n[0]=1,new Uint32Array(n.buffer,0,1)[0]===1}function Oht(){try{return new Function(""),!0}catch{return!1}}function Pht(n){return decodeURIComponent(escape(n))}function MV(n){return rF||(rF=/([\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,pV=new Map([["\uFB05","\u017Ft"]])),n.replaceAll(rF,(t,e,r)=>e?e.normalize("NFKC"):pV.get(r))}function U3(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();let n=new Uint8Array(32);return crypto.getRandomValues(n),kV(n)}function Nht(n,t,e){if(!Array.isArray(e)||e.length<2)return!1;let[r,i,...s]=e;if(!n(r)&&!Number.isInteger(r)||!t(i))return!1;let a=s.length,o=!0;switch(i.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return a===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(a!==4)return!1;o=!1;break;default:return!1}for(let c of s)if(!(typeof c=="number"||o&&c===null))return!1;return!0}function ds(n,t,e){return Math.min(Math.max(n,t),e)}function FV(n){return Uint8Array.prototype.toBase64?n.toBase64():btoa(kV(n))}function Lht(n){return Uint8Array.fromBase64?Uint8Array.fromBase64(n):Kx(atob(n))}async function hw(n,t="text"){if(w1(n,document.baseURI)){let e=await fetch(n);if(!e.ok)throw new Error(e.statusText);switch(t){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"json":return e.json()}return e.text()}return new Promise((e,r)=>{let i=new XMLHttpRequest;i.open("GET",n,!0),i.responseType=t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(t){case"arraybuffer":case"blob":case"json":e(i.response);return}e(i.responseText);return}r(new Error(i.statusText))}},i.send(null)})}function Zx(n){let t=n.length,e=0;for(;e<t&&n[e].trim()==="";)e++;return n.substring(e,e+5).toLowerCase()==="data:"}function ND(n){return typeof n=="string"&&/\.pdf$/i.test(n)}function BV(n){return[n]=n.split(/[#?]/,1),n.substring(n.lastIndexOf("/")+1)}function UV(n,t="document.pdf"){if(typeof n!="string")return t;if(Zx(n))return _e('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;let r=(o=>{try{return new URL(o)}catch{try{return new URL(decodeURIComponent(o))}catch{try{return new URL(o,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(o),"https://foo.bar")}catch{return null}}}}})(n);if(!r)return t;let i=o=>{try{let c=decodeURIComponent(o);return c.includes("/")?(c=c.split("/").at(-1),c.test(/^\.pdf$/i)?c:o):c}catch{return o}},s=/\.pdf$/i,a=r.pathname.split("/").at(-1);if(s.test(a))return i(a);if(r.searchParams.size>0){let o=Array.from(r.searchParams.values()).reverse();for(let u of o)if(s.test(u))return i(u);let c=Array.from(r.searchParams.keys()).reverse();for(let u of c)if(s.test(u))return i(u)}if(r.hash){let c=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(r.hash);if(c)return i(c[0])}return t}function w1(n,t){let e=t?URL.parse(n,t):URL.parse(n);return e?.protocol==="http:"||e?.protocol==="https:"}function Ga(n){n.preventDefault()}function mn(n){n.preventDefault(),n.stopPropagation()}function kht(n){console.log("Deprecated API usage: "+n)}function jV(n,{scale:t=1,rotation:e=0}){let{width:r,height:i}=n.attributes.style,s=[0,0,parseInt(r),parseInt(i)];return new X1({viewBox:s,userUnit:1,scale:t,rotation:e})}function fw(n){if(n.startsWith("#")){let t=parseInt(n.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return n.startsWith("rgb(")?n.slice(4,-1).split(",").map(t=>parseInt(t)):n.startsWith("rgba(")?n.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(_e(`Not a valid color format: "${n}"`),[0,0,0])}function Mht(n){let t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(let e of n.keys()){t.style.color=e;let r=window.getComputedStyle(t).color;n.set(e,fw(r))}t.remove()}function gn(n){let{a:t,b:e,c:r,d:i,e:s,f:a}=n.getTransform();return[t,e,r,i,s,a]}function pc(n){let{a:t,b:e,c:r,d:i,e:s,f:a}=n.getTransform().invertSelf();return[t,e,r,i,s,a]}function jd(n,t,e=!1,r=!0){if(t instanceof X1){let{pageWidth:i,pageHeight:s}=t.rawDims,{style:a}=n,o=Pn.isCSSRoundSupported,c=`var(--total-scale-factor) * ${i}px`,u=`var(--total-scale-factor) * ${s}px`,h=o?`round(down, ${c}, var(--scale-round-x))`:`calc(${c})`,f=o?`round(down, ${u}, var(--scale-round-y))`:`calc(${u})`;!e||t.rotation%180===0?(a.width=h,a.height=f):(a.width=f,a.height=h)}r&&n.setAttribute("data-main-rotation",t.rotation)}function $V(n,t,e,r){r=Math.min(Math.max(r??1,0),1);let i=255*(1-r);return n=Math.round(n*r+i),t=Math.round(t*r+i),e=Math.round(e*r+i),[n,t,e]}function gV(n,t){let e=n[0]/255,r=n[1]/255,i=n[2]/255,s=Math.max(e,r,i),a=Math.min(e,r,i),o=(s+a)/2;if(s===a)t[0]=t[1]=0;else{let c=s-a;switch(t[1]=o<.5?c/(s+a):c/(2-s-a),s){case e:t[0]=((r-i)/c+(r<i?6:0))*60;break;case r:t[0]=((i-e)/c+2)*60;break;case i:t[0]=((e-r)/c+4)*60;break}}t[2]=o}function fF(n,t){let e=n[0],r=n[1],i=n[2],s=(1-Math.abs(2*i-1))*r,a=s*(1-Math.abs(e/60%2-1)),o=i-s/2;switch(Math.floor(e/60)){case 0:t[0]=s+o,t[1]=a+o,t[2]=o;break;case 1:t[0]=a+o,t[1]=s+o,t[2]=o;break;case 2:t[0]=o,t[1]=s+o,t[2]=a+o;break;case 3:t[0]=o,t[1]=a+o,t[2]=s+o;break;case 4:t[0]=a+o,t[1]=o,t[2]=s+o;break;case 5:case 6:t[0]=s+o,t[1]=o,t[2]=a+o;break}}function mV(n){return n<=.03928?n/12.92:((n+.055)/1.055)**2.4}function yV(n,t,e){fF(n,e),e.map(mV);let r=.2126*e[0]+.7152*e[1]+.0722*e[2];fF(t,e),e.map(mV);let i=.2126*e[0]+.7152*e[1]+.0722*e[2];return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)}function HV(n,t){let e=n[0]+n[1]*256+n[2]*65536+t[0]*16777216+t[1]*4294967296+t[2]*1099511627776,r=bV.get(e);if(r)return r;let i=new Float32Array(9),s=i.subarray(0,3),a=i.subarray(3,6);gV(n,a);let o=i.subarray(6,9);gV(t,o);let c=o[2]<.5,u=c?12:4.5;if(a[2]=c?Math.sqrt(a[2]):1-Math.sqrt(1-a[2]),yV(a,o,s)<u){let h,f;c?(h=a[2],f=1):(h=0,f=a[2]);let d=.005;for(;f-h>d;){let p=a[2]=(h+f)/2;c===yV(a,o,s)<u?h=p:f=p}a[2]=c?f:h}return fF(a,s),r=ie.makeHexColor(Math.round(s[0]*255),Math.round(s[1]*255),Math.round(s[2]*255)),bV.set(e,r),r}function j3({html:n,dir:t,className:e},r){let i=document.createDocumentFragment();if(typeof n=="string"){let s=document.createElement("p");s.dir=t||"auto";let a=n.split(/(?:\r\n?|\n)/);for(let o=0,c=a.length;o<c;++o){let u=a[o];s.append(document.createTextNode(u)),o<c-1&&s.append(document.createElement("br"))}i.append(s)}else V1.render({xfaHtml:n,div:i,intent:"richText"});i.firstElementChild.classList.add("richText",e),r.append(i)}function zV(n){let t=new Path2D;if(!n)return t;for(let e=0,r=n.length;e<r;)switch(n[e++]){case g1.moveTo:t.moveTo(n[e++],n[e++]);break;case g1.lineTo:t.lineTo(n[e++],n[e++]);break;case g1.curveTo:t.bezierCurveTo(n[e++],n[e++],n[e++],n[e++],n[e++],n[e++]);break;case g1.quadraticCurveTo:t.quadraticCurveTo(n[e++],n[e++],n[e++],n[e++]);break;case g1.closePath:t.closePath();break;default:_e(`Unrecognized drawing path operator: ${n[e-1]}`);break}return t}function YV(n,t,e){for(let r of e)t.addEventListener(r,n[r].bind(n))}function Fht(n){if(n instanceof URL)return n.href;if(typeof n=="string"){if(Os)return n;let t=URL.parse(n,window.location);if(t)return t.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function Bht(n){if(Os&&typeof Buffer<"u"&&n instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength)return n;if(typeof n=="string")return Kx(n);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n)||typeof n=="object"&&!isNaN(n?.length))return new Uint8Array(n);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function HR(n){if(typeof n!="string")return null;if(n.endsWith("/"))return n;throw new Error(`Invalid factory url: "${n}" must include trailing slash.`)}function wV(){}function Js(n){if(n instanceof Nl||n instanceof ow||n instanceof DI||n instanceof zm||n instanceof H1)return n;switch(n instanceof Error||typeof n=="object"&&n!==null||Wr('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),n.name){case"AbortException":return new Nl(n.message);case"InvalidPDFException":return new ow(n.message);case"PasswordException":return new DI(n.message,n.code);case"ResponseException":return new zm(n.message,n.status,n.missing);case"UnknownErrorException":return new H1(n.message,n.details)}return new H1(n.message,n.toString())}async function $3(n){let e=await process.getBuiltinModule("fs").promises.readFile(n);return new Uint8Array(e)}function WR(n,t,e,r,i,s){n[t*4+0]=Math.min(n[t*4+0],e),n[t*4+1]=Math.min(n[t*4+1],r),n[t*4+2]=Math.max(n[t*4+2],i),n[t*4+3]=Math.max(n[t*4+3],s)}function tB(n,t){if(!t)return;let e=t[2]-t[0],r=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],e,r),n.clip(i)}function nF(n,t,e,r,i,s,a,o){let c=t.coords,u=t.colors,h=n.data,f=n.width*4,d;c[e+1]>c[r+1]&&(d=e,e=r,r=d,d=s,s=a,a=d),c[r+1]>c[i+1]&&(d=r,r=i,i=d,d=a,a=o,o=d),c[e+1]>c[r+1]&&(d=e,e=r,r=d,d=s,s=a,a=d);let p=(c[e]+t.offsetX)*t.scaleX,g=(c[e+1]+t.offsetY)*t.scaleY,y=(c[r]+t.offsetX)*t.scaleX,b=(c[r+1]+t.offsetY)*t.scaleY,m=(c[i]+t.offsetX)*t.scaleX,w=(c[i+1]+t.offsetY)*t.scaleY;if(g>=w)return;let A=u[s],_=u[s+1],S=u[s+2],I=u[a],C=u[a+1],M=u[a+2],z=u[o],G=u[o+1],Y=u[o+2],L=Math.round(g),j=Math.round(w),q,nt,J,N,D,F,P,V;for(let $=L;$<=j;$++){if($<b){let K=$<g?0:(g-$)/(g-b);q=p-(p-y)*K,nt=A-(A-I)*K,J=_-(_-C)*K,N=S-(S-M)*K}else{let K;$>w?K=1:b===w?K=0:K=(b-$)/(b-w),q=y-(y-m)*K,nt=I-(I-z)*K,J=C-(C-G)*K,N=M-(M-Y)*K}let H;$<g?H=0:$>w?H=1:H=(g-$)/(g-w),D=p-(p-m)*H,F=A-(A-z)*H,P=_-(_-G)*H,V=S-(S-Y)*H;let rt=Math.round(Math.min(q,D)),lt=Math.round(Math.max(q,D)),ft=f*$+rt*4;for(let K=rt;K<=lt;K++)H=(q-K)/(q-D),H<0?H=0:H>1&&(H=1),h[ft++]=nt-(nt-F)*H|0,h[ft++]=J-(J-P)*H|0,h[ft++]=N-(N-V)*H|0,h[ft++]=255}}function jht(n,t,e){let r=t.coords,i=t.colors,s,a;switch(t.type){case lF.LATTICE:let o=t.verticesPerRow,c=Math.floor(r.length/o)-1,u=o-1;for(s=0;s<c;s++){let h=s*o;for(let f=0;f<u;f++,h++)nF(n,e,r[h],r[h+1],r[h+o],i[h],i[h+1],i[h+o]),nF(n,e,r[h+o+1],r[h+1],r[h+o],i[h+o+1],i[h+1],i[h+o])}break;case lF.TRIANGLES:for(s=0,a=r.length;s<a;s+=3)nF(n,e,r[s],r[s+1],r[s+2],i[s],i[s+1],i[s+2]);break;default:throw new Error("illegal figure")}}function $ht(n){switch(n[0]){case"RadialAxial":return new eB(n);case"Mesh":return new rB(n);case"Dummy":return new nB}throw new Error(`Unknown IR type: ${n[0]}`)}function Hht({src:n,srcPos:t=0,dest:e,width:r,height:i,nonBlackColor:s=4294967295,inverseDecode:a=!1}){let o=Pn.isLittleEndian?4278190080:255,[c,u]=a?[s,o]:[o,s],h=r>>3,f=r&7,d=n.length;e=new Uint32Array(e.buffer);let p=0;for(let g=0;g<i;g++){for(let b=t+h;t<b;t++){let m=t<d?n[t]:255;e[p++]=m&128?u:c,e[p++]=m&64?u:c,e[p++]=m&32?u:c,e[p++]=m&16?u:c,e[p++]=m&8?u:c,e[p++]=m&4?u:c,e[p++]=m&2?u:c,e[p++]=m&1?u:c}if(f===0)continue;let y=t<d?n[t++]:255;for(let b=0;b<f;b++)e[p++]=y&1<<7-b?u:c}return{srcPos:t,destPos:p}}function Wht(n,t){if(n._removeMirroring)throw new Error("Context is already forwarding operations.");n.__originalSave=n.save,n.__originalRestore=n.restore,n.__originalRotate=n.rotate,n.__originalScale=n.scale,n.__originalTranslate=n.translate,n.__originalTransform=n.transform,n.__originalSetTransform=n.setTransform,n.__originalResetTransform=n.resetTransform,n.__originalClip=n.clip,n.__originalMoveTo=n.moveTo,n.__originalLineTo=n.lineTo,n.__originalBezierCurveTo=n.bezierCurveTo,n.__originalRect=n.rect,n.__originalClosePath=n.closePath,n.__originalBeginPath=n.beginPath,n._removeMirroring=()=>{n.save=n.__originalSave,n.restore=n.__originalRestore,n.rotate=n.__originalRotate,n.scale=n.__originalScale,n.translate=n.__originalTranslate,n.transform=n.__originalTransform,n.setTransform=n.__originalSetTransform,n.resetTransform=n.__originalResetTransform,n.clip=n.__originalClip,n.moveTo=n.__originalMoveTo,n.lineTo=n.__originalLineTo,n.bezierCurveTo=n.__originalBezierCurveTo,n.rect=n.__originalRect,n.closePath=n.__originalClosePath,n.beginPath=n.__originalBeginPath,delete n._removeMirroring},n.save=function(){t.save(),this.__originalSave()},n.restore=function(){t.restore(),this.__originalRestore()},n.translate=function(e,r){t.translate(e,r),this.__originalTranslate(e,r)},n.scale=function(e,r){t.scale(e,r),this.__originalScale(e,r)},n.transform=function(e,r,i,s,a,o){t.transform(e,r,i,s,a,o),this.__originalTransform(e,r,i,s,a,o)},n.setTransform=function(e,r,i,s,a,o){t.setTransform(e,r,i,s,a,o),this.__originalSetTransform(e,r,i,s,a,o)},n.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},n.rotate=function(e){t.rotate(e),this.__originalRotate(e)},n.clip=function(e){t.clip(e),this.__originalClip(e)},n.moveTo=function(e,r){t.moveTo(e,r),this.__originalMoveTo(e,r)},n.lineTo=function(e,r){t.lineTo(e,r),this.__originalLineTo(e,r)},n.bezierCurveTo=function(e,r,i,s,a,o){t.bezierCurveTo(e,r,i,s,a,o),this.__originalBezierCurveTo(e,r,i,s,a,o)},n.rect=function(e,r,i,s){t.rect(e,r,i,s),this.__originalRect(e,r,i,s)},n.closePath=function(){t.closePath(),this.__originalClosePath()},n.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}function VR(n,t,e,r,i,s,a,o,c,u){let[h,f,d,p,g,y]=gn(n);if(f===0&&d===0){let w=a*h+g,A=Math.round(w),_=o*p+y,S=Math.round(_),I=(a+c)*h+g,C=Math.abs(Math.round(I)-A)||1,M=(o+u)*p+y,z=Math.abs(Math.round(M)-S)||1;return n.setTransform(Math.sign(h),0,0,Math.sign(p),A,S),n.drawImage(t,e,r,i,s,0,0,C,z),n.setTransform(h,f,d,p,g,y),[C,z]}if(h===0&&p===0){let w=o*d+g,A=Math.round(w),_=a*f+y,S=Math.round(_),I=(o+u)*d+g,C=Math.abs(Math.round(I)-A)||1,M=(a+c)*f+y,z=Math.abs(Math.round(M)-S)||1;return n.setTransform(0,Math.sign(f),Math.sign(d),0,A,S),n.drawImage(t,e,r,i,s,0,0,z,C),n.setTransform(h,f,d,p,g,y),[z,C]}n.drawImage(t,e,r,i,s,a,o,c,u);let b=Math.hypot(h,f),m=Math.hypot(d,p);return[b*c,m*u]}function CV(n,t){if(t instanceof ImageData){n.putImageData(t,0,0);return}let e=t.height,r=t.width,i=e%aa,s=(e-i)/aa,a=i===0?s:s+1,o=n.createImageData(r,aa),c=0,u,h=t.data,f=o.data,d,p,g,y;if(t.kind===$1.GRAYSCALE_1BPP){let b=h.byteLength,m=new Uint32Array(f.buffer,0,f.byteLength>>2),w=m.length,A=r+7>>3,_=4294967295,S=Pn.isLittleEndian?4278190080:255;for(d=0;d<a;d++){for(g=d<s?aa:i,u=0,p=0;p<g;p++){let I=b-c,C=0,M=I>A?r:I*8-7,z=M&-8,G=0,Y=0;for(;C<z;C+=8)Y=h[c++],m[u++]=Y&128?_:S,m[u++]=Y&64?_:S,m[u++]=Y&32?_:S,m[u++]=Y&16?_:S,m[u++]=Y&8?_:S,m[u++]=Y&4?_:S,m[u++]=Y&2?_:S,m[u++]=Y&1?_:S;for(;C<M;C++)G===0&&(Y=h[c++],G=128),m[u++]=Y&G?_:S,G>>=1}for(;u<w;)m[u++]=0;n.putImageData(o,0,d*aa)}}else if(t.kind===$1.RGBA_32BPP){for(p=0,y=r*aa*4,d=0;d<s;d++)f.set(h.subarray(c,c+y)),c+=y,n.putImageData(o,0,p),p+=aa;d<a&&(y=r*i*4,f.set(h.subarray(c,c+y)),n.putImageData(o,0,p))}else if(t.kind===$1.RGB_24BPP)for(g=aa,y=r*g,d=0;d<a;d++){for(d>=s&&(g=i,y=r*g),u=0,p=y;p--;)f[u++]=h[c++],f[u++]=h[c++],f[u++]=h[c++],f[u++]=255;n.putImageData(o,0,d*aa)}else throw new Error(`bad image kind: ${t.kind}`)}function RV(n,t){if(t.bitmap){n.drawImage(t.bitmap,0,0);return}let e=t.height,r=t.width,i=e%aa,s=(e-i)/aa,a=i===0?s:s+1,o=n.createImageData(r,aa),c=0,u=t.data,h=o.data;for(let f=0;f<a;f++){let d=f<s?aa:i;({srcPos:c}=Hht({src:u,srcPos:c,dest:h,width:r,height:d,nonBlackColor:0})),n.putImageData(o,0,f*aa)}}function m1(n,t){let e=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(let r of e)n[r]!==void 0&&(t[r]=n[r]);n.setLineDash!==void 0&&(t.setLineDash(n.getLineDash()),t.lineDashOffset=n.lineDashOffset)}function XR(n){n.strokeStyle=n.fillStyle="#000000",n.fillRule="nonzero",n.globalAlpha=1,n.lineWidth=1,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=10,n.globalCompositeOperation="source-over",n.font="10px sans-serif",n.setLineDash!==void 0&&(n.setLineDash([]),n.lineDashOffset=0);let{filter:t}=n;t!=="none"&&t!==""&&(n.filter="none")}function IV(n,t){if(t)return!0;ie.singularValueDecompose2dScale(n,Ha);let e=Math.fround(Uc.pixelRatio*Rh.PDF_TO_CSS_UNITS);return Ha[0]<=e&&Ha[1]<=e}function qht(n){let t=!0,e=r("filename\\*","i").exec(n);if(e){e=e[1];let h=o(e);return h=unescape(h),h=c(h),h=u(h),s(h)}if(e=a(n),e){let h=u(e);return s(h)}if(e=r("filename","i").exec(n),e){e=e[1];let h=o(e);return h=u(h),s(h)}function r(h,f){return new RegExp("(?:^|;)\\s*"+h+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',f)}function i(h,f){if(h){if(!/^[\x00-\xFF]+$/.test(f))return f;try{let d=new TextDecoder(h,{fatal:!0}),p=Kx(f);f=d.decode(p),t=!1}catch{}}return f}function s(h){return t&&/[\x80-\xff]/.test(h)&&(h=i("utf-8",h),t&&(h=i("iso-8859-1",h))),h}function a(h){let f=[],d,p=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(d=p.exec(h))!==null;){let[,y,b,m]=d;if(y=parseInt(y,10),y in f){if(y===0)break;continue}f[y]=[b,m]}let g=[];for(let y=0;y<f.length&&y in f;++y){let[b,m]=f[y];m=o(m),b&&(m=unescape(m),y===0&&(m=c(m))),g.push(m)}return g.join("")}function o(h){if(h.startsWith('"')){let f=h.slice(1).split('\\"');for(let d=0;d<f.length;++d){let p=f[d].indexOf('"');p!==-1&&(f[d]=f[d].slice(0,p),f.length=d+1),f[d]=f[d].replaceAll(/\\(.)/g,"$1")}h=f.join('"')}return h}function c(h){let f=h.indexOf("'");if(f===-1)return h;let d=h.slice(0,f),g=h.slice(f+1).replace(/^[^']*'/,"");return i(d,g)}function u(h){return!h.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(h)?h:h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(f,d,p,g){if(p==="q"||p==="Q")return g=g.replaceAll("_"," "),g=g.replaceAll(/=([0-9a-fA-F]{2})/g,function(y,b){return String.fromCharCode(parseInt(b,16))}),i(d,g);try{g=atob(g)}catch{}return i(d,g)})}return""}function CX(n,t){let e=new Headers;if(!n||!t||typeof t!="object")return e;for(let r in t){let i=t[r];i!==void 0&&e.append(r,i)}return e}function LD(n){return URL.parse(n)?.origin??null}function RX({responseHeaders:n,isHttp:t,rangeChunkSize:e,disableRange:r}){let i={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(n.get("Content-Length"),10);return!Number.isInteger(s)||(i.suggestedLength=s,s<=2*e)||r||!t||n.get("Accept-Ranges")!=="bytes"||(n.get("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function IX(n){let t=n.get("Content-Disposition");if(t){let e=qht(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if(ND(e))return e}return null}function Jx(n,t){return new zm(`Unexpected server response (${n}) while retrieving PDF "${t}".`,n,n===404||n===0&&t.startsWith("file:"))}function DX(n){return n===200||n===206}function OX(n,t,e){return{method:"GET",headers:n,signal:e.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function PX(n){return n instanceof Uint8Array?n.buffer:n instanceof ArrayBuffer?n:(_e(`getArrayBuffer - unexpected data format: ${n}`),new Uint8Array(n).buffer)}function Yht(n){let t=n.response;return typeof t!="string"?t:Kx(t).buffer}function Zht(n){if(Kht.test(n))return new URL(n);let t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(n))}function FX(n={}){typeof n=="string"||n instanceof URL?n={url:n}:(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});let t=new IB,{docId:e}=t,r=n.url?Fht(n.url):null,i=n.data?Bht(n.data):null,s=n.httpHeaders||null,a=n.withCredentials===!0,o=n.password??null,c=n.range instanceof Z1?n.range:null,u=Number.isInteger(n.rangeChunkSize)&&n.rangeChunkSize>0?n.rangeChunkSize:2**16,h=n.worker instanceof uw?n.worker:null,f=n.verbosity,d=typeof n.docBaseUrl=="string"&&!Zx(n.docBaseUrl)?n.docBaseUrl:null,p=HR(n.cMapUrl),g=n.cMapPacked!==!1,y=n.CMapReaderFactory||(Os?XF:$I),b=HR(n.iccUrl),m=HR(n.standardFontDataUrl),w=n.StandardFontDataFactory||(Os?qF:WI),A=HR(n.wasmUrl),_=n.WasmFactory||(Os?YF:VI),S=n.stopAtErrors!==!0,I=Number.isInteger(n.maxImageSize)&&n.maxImageSize>-1?n.maxImageSize:-1,C=n.isEvalSupported!==!1,M=typeof n.isOffscreenCanvasSupported=="boolean"?n.isOffscreenCanvasSupported:!Os,z=typeof n.isImageDecoderSupported=="boolean"?n.isImageDecoderSupported:!Os&&(Pn.platform.isFirefox||!globalThis.chrome),G=Number.isInteger(n.canvasMaxAreaInBytes)?n.canvasMaxAreaInBytes:-1,Y=typeof n.disableFontFace=="boolean"?n.disableFontFace:Os,L=n.fontExtraProperties===!0,j=n.enableXfa===!0,q=n.ownerDocument||globalThis.document,nt=n.disableRange===!0,J=n.disableStream===!0,N=n.disableAutoFetch===!0,D=n.pdfBug===!0,F=n.CanvasFactory||(Os?VF:$F),P=n.FilterFactory||(Os?GF:HF),V=n.enableHWA===!0,$=n.useWasm!==!1,H=c?c.length:n.length??NaN,rt=typeof n.useSystemFonts=="boolean"?n.useSystemFonts:!Os&&!Y,lt=typeof n.useWorkerFetch=="boolean"?n.useWorkerFetch:!!(y===$I&&w===WI&&_===VI&&p&&m&&A&&w1(p,document.baseURI)&&w1(m,document.baseURI)&&w1(A,document.baseURI)),ft=null;Tht(f);let K={canvasFactory:new F({ownerDocument:q,enableHWA:V}),filterFactory:new P({docId:e,ownerDocument:q}),cMapReaderFactory:lt?null:new y({baseUrl:p,isCompressed:g}),standardFontDataFactory:lt?null:new w({baseUrl:m}),wasmFactory:lt?null:new _({baseUrl:A})};h||(h=uw.create({verbosity:f,port:Ho.workerPort}),t._worker=h);let X={docId:e,apiVersion:"5.4.530",data:i,password:o,disableAutoFetch:N,rangeChunkSize:u,length:H,docBaseUrl:d,enableXfa:j,evaluatorOptions:{maxImageSize:I,disableFontFace:Y,ignoreErrors:S,isEvalSupported:C,isOffscreenCanvasSupported:M,isImageDecoderSupported:z,canvasMaxAreaInBytes:G,fontExtraProperties:L,useSystemFonts:rt,useWasm:$,useWorkerFetch:lt,cMapUrl:p,iccUrl:b,standardFontDataUrl:m,wasmUrl:A}},st={ownerDocument:q,pdfBug:D,styleElement:ft,loadingParams:{disableAutoFetch:N,enableXfa:j}};return h.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");let bt=h.messageHandler.sendWithPromise("GetDocRequest",X,i?[i.buffer]:null),wt;if(c)wt=new dB(c,{disableRange:nt,disableStream:J});else if(!i){if(!r)throw new Error("getDocument - no `url` parameter provided.");let Q=w1(r)?mB:Os?xB:wB;wt=new Q({url:r,length:H,httpHeaders:s,withCredentials:a,rangeChunkSize:u,disableRange:nt,disableStream:J})}return bt.then(Q=>{if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");let W=new Tg(e,Q,h.port),at=new PB(W,t,wt,st,K,V);t._transport=at,W.send("Ready",null)})}).catch(t._capability.reject),t}function PV(n){return Math.floor(Math.max(0,Math.min(1,n))*255).toString(16).padStart(2,"0")}function b1(n){return Math.max(0,Math.min(255,255*n))}var Sht,dV,hAt,fAt,dAt,pAt,gAt,mAt,yAt,bAt,vAt,wAt,AAt,EAt,xAt,SAt,_At,TAt,Os,oF,KR,_ht,CAt,$a,Sh,W1,Re,Je,NV,lF,ci,$1,zn,bb,Yx,aw,g1,LV,OD,qm,DI,H1,ow,zm,cF,Nl,Pn,eF,_h,ZR,uF,ie,rF,pV,Tb,RAt,IAt,DAt,OAt,G1,V1,Uu,xg,Rh,X1,lw,OI,s2,Hm,Uc,PI,hF,NI,bV,PAt,NAt,LAt,kAt,MAt,FAt,BAt,UAt,jAt,$At,HAt,zAt,WAt,Kf,Zf,Do,Oo,a2,Jf,Lb,kb,o2,fD,WV,Vi,GV,VV,vb,A1,Hu,dF,l2,Cg,Wu,Dh,XV,qV,gF,pF,Rg,Ig,Mb,Dg,Tr,os,dD,mF,Fb,c2,ls,Bb,JR,H3,yF,Wn,Qf,u2,pn,bF,pD,KV,Wm,gD,vF,Ub,Ea,jb,Cn,hi,$b,Po,Hb,No,cs,td,ed,zb,rd,yc,Lo,Og,h2,f2,Wb,d2,bc,nd,Gb,id,vc,mD,sd,Vb,p2,ad,Pg,Xb,od,g2,Zn,wr,Gu,ld,cd,m2,qb,y2,ud,wc,Vu,b2,v2,ko,re,QR,wF,ZV,JV,E1,QV,tX,eX,AF,rX,nX,iX,sX,Ts,ju,aX,oX,EF,lX,x1,xF,Ib,$d,xi,Ac,wl,Yb,Ec,xa,Kb,xc,ta,Xu,Ng,Sc,hd,Pl,S1,tI,Cs,LI,Ui,Mo,Lg,Kr,w2,kg,Al,Mg,Fg,Bg,A2,SF,Cb,Zb,Ug,E2,x2,S2,_2,T2,qu,jg,Yu,$g,Ku,Hd,cX,uX,hX,z3,q1,Hg,El,ln,$r,Zu,Jb,fd,C2,ji,zg,Ju,Fo,dd,R2,Wg,Sa,I2,Gg,Qu,_c,Qb,tv,Bo,Vg,D2,yD,Ae,_F,O2,TF,eI,fX,dX,CF,rI,RF,pX,gX,mX,IF,yX,DF,bX,vX,wX,OF,_1,Pe,Zr,PF,vV,Ro,gc,kI,NF,Xg,qg,th,$i,bD,AX,Y1,P2,MI,ev,LF,Cr,kF,rv,nv,N2,iv,nI,Db,FI,pd,Tc,Yg,Kg,T1,Ob,BI,sv,av,ov,lv,_a,Cc,L2,Rr,On,bl,iI,C1,ke,MF,k2,M2,F2,B2,U2,j2,$2,H2,Yr,FF,cv,BF,UF,Uht,EX,eh,vD,jF,zR,Kn,uv,Go,xX,SX,_X,sI,Tg,z2,UI,$F,jI,$I,GAt,HI,Zg,hv,rh,nh,us,Jg,Qg,he,as,R1,wb,aI,Ab,TX,zF,Eb,I1,D1,WF,O1,HF,zI,WI,GI,VI,GF,VF,XF,qF,YF,VAt,yb,AV,EV,KF,fv,gd,ZF,GR,ea,ra,tm,xl,em,ih,Ar,Ir,sh,na,W2,dv,rm,nm,ah,hs,Rc,G2,QF,JF,Hr,Rn,Sl,pv,gv,W3,XI,Io,Wi,K1,eB,rB,nB,xV,wD,iB,SV,_V,zht,TV,aa,iF,Ha,Rb,sB,qI,Ght,Vht,Xht,DV,Ll,aB,oB,lB,G3,Nb,V2,X2,Ho,mv,q2,cB,xb,Y2,K2,Z2,yv,uB,md,Dr,bv,vv,J2,fB,hB,dB,pB,gB,mB,yB,bB,sF,aF,vB,wB,AB,EB,Kht,xB,SB,_B,y1,Ta,Q2,TB,YI,Jht,OV,yd,Ca,tx,ex,im,oh,rx,nx,sm,ix,wv,bd,Av,sx,Ev,am,ax,ox,xv,om,lx,Sv,_v,Oh,NX,LX,CB,Wa,oI,RB,kX,MX,Bi,cw,Qht,AD,ED,IB,lm,cx,ux,hx,fx,Z1,DB,lh,cm,P1,OB,vd,_l,ch,um,xD,hm,fm,Ps,lI,BX,UX,N1,Tv,cI,on,uw,uh,Ic,Cv,Rv,hh,dm,L1,PB,wd,NB,Ad,pm,Sg,LB,jX,$X,Ra,gm,Iv,fi,dx,Dv,fh,px,Ed,Tl,gx,Or,kB,MB,FB,wg,HX,Yf,Qs,J1,Dc,mx,Ov,yx,_g,KI,XAt,qAt,ZI,BB,Gm,tft,Vm,eft,z1,mm,Pv,Uo,bx,UB,V3,yn,jB,za,Ag,zX,WX,Q1,$B,Ih,HB,zB,WB,JI,GB,VB,vx,XB,t2,Ia,xd,SD,_D,Nv,Lv,In,Oc,Sd,ym,kv,Mv,Pc,Da,dh,ph,Dn,gh,_d,wx,mh,Fv,bm,Td,Si,Cd,Ue,uI,YB,KB,ZB,hI,JB,GX,VX,XX,qX,fI,dI,QB,qB,QI,Ax,t3,Ex,e3,xx,r3,Sx,tD,n3,i3,_x,vm,Tx,s3,e2,eD,a3,o3,l3,rD,Cx,Rx,u3,c3,wm,Am,Bv,Rd,Ix,Em,Oa,Dx,Th,pI,h3,X3,nD,qR,Pa,Ox,xm,Na,Jn,YX,KX,ZX,gI,Ch,mI,yI,JX,d3,QX,nn,f3,ce,La,Cl,Uv,jv,Nc,Xe,Sm,_m,Px,Nx,$v,Hv,Id,Lx,TD,CD,di,k1,tq,eq,rq,nq,iq,sq,zu,iD,zv,Tm,yh,kx,ka,Mx,Gn,RD,aq,sD,Fx,Bx,Ux,Dd,Rl,Ns,oq,bI,lq,cq,p3,r2,jx,Wv,g3,n2,m3,Gv,$x,bh,Cm,Hx,ia,zx,Wx,Rm,Ma,Fa,Hi,Vv,Xv,fs,qv,jo,Gx,Be,y3,vI,uq,hq,fq,b3,Eg,Wo,Sb,dq,wI,AI,pq,gq,mq,yq,bq,hr,aD,Im,oD,Ba,Yv,_i,Dm,Om,sr,v3,w3,A3,M1,vq,EI,F1,_b,Ze,lD,Lc,Ti,Ci,Pm,Kv,Rs,zi,$o,Nm,Lm,km,Zv,xI,E3,Is,Vx,Xx,Ua,kc,Mc,Jv,Qv,Mm,Gi,$u,wq,Aq,Eq,Xm,cD,ID,xq,Pb,x3,i2,YR,v1,Fm,gr,S3,Il,Sq,_q,_3,SI,Tq,Cq,Rq,T3,C3,Iq,zo,R3,I3,Od,Fc,Pd,Bm,Aa,D3,cn,Ri,Nd,vh,Ld,tw,wh,Um,Bc,ja,ew,ar,U1,j1,_I,TI,CI,O3,RI,Dq,B1,jm,rw,kd,Md,Ah,sa,Fd,nw,iw,Dl,Eh,Ii,xh,Bd,sw,ge,Ud,zr,P3,Oq,mc,N3,L3,II,vl,uD,Ol,Ds,$m,qx,DD,Pq,jc,k3,Nq,M3,ui,hD,kq=br(()=>{Tt();Rt();Ct();Sht={34:((n,t,e)=>{var r=e(4901);n.exports=function(i){return typeof i=="object"?i!==null:r(i)}}),81:((n,t,e)=>{var r=e(9565),i=e(9306),s=e(8551),a=e(6823),o=e(851),c=TypeError;n.exports=function(u,h){var f=arguments.length<2?o(u):h;if(i(f))return s(r(f,u));throw new c(a(u)+" is not iterable")}}),116:((n,t,e)=>{var r=e(6518),i=e(9565),s=e(2652),a=e(9306),o=e(8551),c=e(1767),u=e(9539),h=e(4549),f=h("find",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:f},{find:function(p){o(this);try{a(p)}catch(b){u(this,"throw",b)}if(f)return i(f,this,p);var g=c(this),y=0;return s(g,function(b,m){if(p(b,y++))return m(b)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})}),283:((n,t,e)=>{var r=e(9504),i=e(9039),s=e(4901),a=e(9297),o=e(3724),c=e(350).CONFIGURABLE,u=e(3706),h=e(1181),f=h.enforce,d=h.get,p=String,g=Object.defineProperty,y=r("".slice),b=r("".replace),m=r([].join),w=o&&!i(function(){return g(function(){},"length",{value:8}).length!==8}),A=String(String).split("String"),_=n.exports=function(S,I,C){y(p(I),0,7)==="Symbol("&&(I="["+b(p(I),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),C&&C.getter&&(I="get "+I),C&&C.setter&&(I="set "+I),(!a(S,"name")||c&&S.name!==I)&&(o?g(S,"name",{value:I,configurable:!0}):S.name=I),w&&C&&a(C,"arity")&&S.length!==C.arity&&g(S,"length",{value:C.arity});try{C&&a(C,"constructor")&&C.constructor?o&&g(S,"prototype",{writable:!1}):S.prototype&&(S.prototype=void 0)}catch{}var M=f(S);return a(M,"source")||(M.source=m(A,typeof I=="string"?I:"")),S};Function.prototype.toString=_(function(){return s(this)&&d(this).source||u(this)},"toString")}),350:((n,t,e)=>{var r=e(3724),i=e(9297),s=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,o=i(s,"name"),c=o&&(function(){}).name==="something",u=o&&(!r||r&&a(s,"name").configurable);n.exports={EXISTS:o,PROPER:c,CONFIGURABLE:u}}),397:((n,t,e)=>{var r=e(7751);n.exports=r("document","documentElement")}),421:(n=>{n.exports={}}),456:((n,t,e)=>{var r=e(6518),i=e(4576),s=e(9504),a=e(4154),o=e(5169),c=s(1.1.toString),u=i.Uint8Array,h=!u||!u.prototype.toHex||!(function(){try{var f=new u([255,255,255,255,255,255,255,255]);return f.toHex()==="ffffffffffffffff"}catch{return!1}})();u&&r({target:"Uint8Array",proto:!0,forced:h},{toHex:function(){a(this),o(this.buffer);for(var d="",p=0,g=this.length;p<g;p++){var y=c(this[p],16);d+=y.length===1?"0"+y:y}return d}})}),507:((n,t,e)=>{var r=e(9565);n.exports=function(i,s,a){for(var o=a?i:i.iterator,c=i.next,u,h;!(u=r(c,o)).done;)if(h=s(u.value),h!==void 0)return h}}),531:((n,t,e)=>{var r=e(6518),i=e(9565),s=e(9306),a=e(8551),o=e(1767),c=e(8646),u=e(9462),h=e(9539),f=e(6395),d=e(684),p=e(4549),g=!f&&!d("flatMap",function(){}),y=!f&&!g&&p("flatMap",TypeError),b=f||g||y,m=u(function(){for(var w=this.iterator,A=this.mapper,_,S;;){if(S=this.inner)try{if(_=a(i(S.next,S.iterator)),!_.done)return _.value;this.inner=null}catch(I){h(w,"throw",I)}if(_=a(i(this.next,w)),this.done=!!_.done)return;try{this.inner=c(A(_.value,this.counter++),!1)}catch(I){h(w,"throw",I)}}});r({target:"Iterator",proto:!0,real:!0,forced:b},{flatMap:function(A){a(this);try{s(A)}catch(_){h(this,"throw",_)}return y?i(y,this,A):new m(o(this),{mapper:A,inner:null})}})}),616:((n,t,e)=>{var r=e(9039);n.exports=!r(function(){var i=(function(){}).bind();return typeof i!="function"||i.hasOwnProperty("prototype")})}),655:((n,t,e)=>{var r=e(6955),i=String;n.exports=function(s){if(r(s)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return i(s)}}),679:((n,t,e)=>{var r=e(1625),i=TypeError;n.exports=function(s,a){if(r(a,s))return s;throw new i("Incorrect invocation")}}),684:(n=>{n.exports=function(t,e){var r=typeof Iterator=="function"&&Iterator.prototype[t];if(r)try{r.call({next:null},e).next()}catch{return!0}}}),741:(n=>{var t=Math.ceil,e=Math.floor;n.exports=Math.trunc||function(i){var s=+i;return(s>0?e:t)(s)}}),757:((n,t,e)=>{var r=e(7751),i=e(4901),s=e(1625),a=e(7040),o=Object;n.exports=a?function(c){return typeof c=="symbol"}:function(c){var u=r("Symbol");return i(u)&&s(u.prototype,o(c))}}),851:((n,t,e)=>{var r=e(6955),i=e(5966),s=e(4117),a=e(6269),o=e(8227),c=o("iterator");n.exports=function(u){if(!s(u))return i(u,c)||i(u,"@@iterator")||a[r(u)]}}),944:(n=>{var t=TypeError;n.exports=function(e){var r=e&&e.alphabet;if(r===void 0||r==="base64"||r==="base64url")return r||"base64";throw new t("Incorrect `alphabet` option")}}),1072:((n,t,e)=>{var r=e(1828),i=e(8727);n.exports=Object.keys||function(a){return r(a,i)}}),1103:(n=>{n.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}}),1108:((n,t,e)=>{var r=e(6955);n.exports=function(i){var s=r(i);return s==="BigInt64Array"||s==="BigUint64Array"}}),1148:((n,t,e)=>{var r=e(6518),i=e(9565),s=e(2652),a=e(9306),o=e(8551),c=e(1767),u=e(9539),h=e(4549),f=h("every",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:f},{every:function(p){o(this);try{a(p)}catch(b){u(this,"throw",b)}if(f)return i(f,this,p);var g=c(this),y=0;return!s(g,function(b,m){if(!p(b,y++))return m()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}),1181:((n,t,e)=>{var r=e(8622),i=e(4576),s=e(34),a=e(6699),o=e(9297),c=e(7629),u=e(6119),h=e(421),f="Object already initialized",d=i.TypeError,p=i.WeakMap,g,y,b,m=function(S){return b(S)?y(S):g(S,{})},w=function(S){return function(I){var C;if(!s(I)||(C=y(I)).type!==S)throw new d("Incompatible receiver, "+S+" required");return C}};if(r||c.state){var A=c.state||(c.state=new p);A.get=A.get,A.has=A.has,A.set=A.set,g=function(S,I){if(A.has(S))throw new d(f);return I.facade=S,A.set(S,I),I},y=function(S){return A.get(S)||{}},b=function(S){return A.has(S)}}else{var _=u("state");h[_]=!0,g=function(S,I){if(o(S,_))throw new d(f);return I.facade=S,a(S,_,I),I},y=function(S){return o(S,_)?S[_]:{}},b=function(S){return o(S,_)}}n.exports={set:g,get:y,has:b,enforce:m,getterFor:w}}),1291:((n,t,e)=>{var r=e(741);n.exports=function(i){var s=+i;return s!==s||s===0?0:r(s)}}),1385:((n,t,e)=>{var r=e(9539);n.exports=function(i,s,a){for(var o=i.length-1;o>=0;o--)if(i[o]!==void 0)try{a=r(i[o].iterator,s,a)}catch(c){s="throw",a=c}if(s==="throw")throw a;return a}}),1548:((n,t,e)=>{var r=e(4576),i=e(9039),s=e(9519),a=e(4215),o=r.structuredClone;n.exports=!!o&&!i(function(){if(a==="DENO"&&s>92||a==="NODE"&&s>94||a==="BROWSER"&&s>97)return!1;var c=new ArrayBuffer(8),u=o(c,{transfer:[c]});return c.byteLength!==0||u.byteLength!==8})}),1549:((n,t,e)=>{e(6632)}),1625:((n,t,e)=>{var r=e(9504);n.exports=r({}.isPrototypeOf)}),1689:((n,t,e)=>{var r=e(6518),i=e(4576),s=e(8745),a=e(7680),o=e(6043),c=e(9306),u=e(1103),h=i.Promise,f=!1,d=!h||!h.try||u(function(){h.try(function(p){f=p===8},8)}).error||!f;r({target:"Promise",stat:!0,forced:d},{try:function(p){var g=arguments.length>1?a(arguments,1):[],y=o.f(this),b=u(function(){return s(c(p),void 0,g)});return(b.error?y.reject:y.resolve)(b.value),y.promise}})}),1698:((n,t,e)=>{var r=e(6518),i=e(4204),s=e(9835),a=e(4916),o=!a("union")||!s("union");r({target:"Set",proto:!0,real:!0,forced:o},{union:i})}),1701:((n,t,e)=>{var r=e(6518),i=e(9565),s=e(9306),a=e(8551),o=e(1767),c=e(9462),u=e(6319),h=e(9539),f=e(684),d=e(4549),p=e(6395),g=!p&&!f("map",function(){}),y=!p&&!g&&d("map",TypeError),b=p||g||y,m=c(function(){var w=this.iterator,A=a(i(this.next,w)),_=this.done=!!A.done;if(!_)return u(w,this.mapper,[A.value,this.counter++],!0)});r({target:"Iterator",proto:!0,real:!0,forced:b},{map:function(A){a(this);try{s(A)}catch(_){h(this,"throw",_)}return y?i(y,this,A):new m(o(this),{mapper:A})}})}),1767:(n=>{n.exports=function(t){return{iterator:t,next:t.next,done:!1}}}),1828:((n,t,e)=>{var r=e(9504),i=e(9297),s=e(5397),a=e(9617).indexOf,o=e(421),c=r([].push);n.exports=function(u,h){var f=s(u),d=0,p=[],g;for(g in f)!i(o,g)&&i(f,g)&&c(p,g);for(;h.length>d;)i(f,g=h[d++])&&(~a(p,g)||c(p,g));return p}}),2106:((n,t,e)=>{var r=e(283),i=e(4913);n.exports=function(s,a,o){return o.get&&r(o.get,a,{getter:!0}),o.set&&r(o.set,a,{setter:!0}),i.f(s,a,o)}}),2140:((n,t,e)=>{var r=e(8227),i=r("toStringTag"),s={};s[i]="z",n.exports=String(s)==="[object z]"}),2195:((n,t,e)=>{var r=e(9504),i=r({}.toString),s=r("".slice);n.exports=function(a){return s(i(a),8,-1)}}),2211:((n,t,e)=>{var r=e(9039);n.exports=!r(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype})}),2303:((n,t,e)=>{var r=e(4576),i=e(9504),s=r.Uint8Array,a=r.SyntaxError,o=r.parseInt,c=Math.min,u=/[^\da-f]/i,h=i(u.exec),f=i("".slice);n.exports=function(d,p){var g=d.length;if(g%2!==0)throw new a("String should be an even number of characters");for(var y=p?c(p.length,g/2):g/2,b=p||new s(y),m=0,w=0;w<y;){var A=f(d,m,m+=2);if(h(u,A))throw new a("String should only contain hex characters");b[w++]=o(A,16)}return{bytes:b,read:m}}}),2360:((n,t,e)=>{var r=e(8551),i=e(6801),s=e(8727),a=e(421),o=e(397),c=e(4055),u=e(6119),h=">",f="<",d="prototype",p="script",g=u("IE_PROTO"),y=function(){},b=function(S){return f+p+h+S+f+"/"+p+h},m=function(S){S.write(b("")),S.close();var I=S.parentWindow.Object;return S=null,I},w=function(){var S=c("iframe"),I="java"+p+":",C;return S.style.display="none",o.appendChild(S),S.src=String(I),C=S.contentWindow.document,C.open(),C.write(b("document.F=Object")),C.close(),C.F},A,_=function(){try{A=new ActiveXObject("htmlfile")}catch{}_=typeof document<"u"?document.domain&&A?m(A):w():m(A);for(var S=s.length;S--;)delete _[d][s[S]];return _()};a[g]=!0,n.exports=Object.create||function(I,C){var M;return I!==null?(y[d]=r(I),M=new y,y[d]=null,M[g]=I):M=_(),C===void 0?M:i.f(M,C)}}),2475:((n,t,e)=>{var r=e(6518),i=e(8527),s=e(4916),a=!s("isSupersetOf",function(o){return!o});r({target:"Set",proto:!0,real:!0,forced:a},{isSupersetOf:i})}),2489:((n,t,e)=>{var r=e(6518),i=e(9565),s=e(9306),a=e(8551),o=e(1767),c=e(9462),u=e(6319),h=e(6395),f=e(9539),d=e(684),p=e(4549),g=!h&&!d("filter",function(){}),y=!h&&!g&&p("filter",TypeError),b=h||g||y,m=c(function(){for(var w=this.iterator,A=this.predicate,_=this.next,S,I,C;;){if(S=a(i(_,w)),I=this.done=!!S.done,I)return;if(C=S.value,u(w,A,[C,this.counter++],!0))return C}});r({target:"Iterator",proto:!0,real:!0,forced:b},{filter:function(A){a(this);try{s(A)}catch(_){f(this,"throw",_)}return y?i(y,this,A):new m(o(this),{predicate:A})}})}),2529:(n=>{n.exports=function(t,e){return{value:t,done:e}}}),2603:((n,t,e)=>{var r=e(655);n.exports=function(i,s){return i===void 0?arguments.length<2?"":s:r(i)}}),2652:((n,t,e)=>{var r=e(6080),i=e(9565),s=e(8551),a=e(6823),o=e(4209),c=e(6198),u=e(1625),h=e(81),f=e(851),d=e(9539),p=TypeError,g=function(b,m){this.stopped=b,this.result=m},y=g.prototype;n.exports=function(b,m,w){var A=w&&w.that,_=!!(w&&w.AS_ENTRIES),S=!!(w&&w.IS_RECORD),I=!!(w&&w.IS_ITERATOR),C=!!(w&&w.INTERRUPTED),M=r(m,A),z,G,Y,L,j,q,nt,J=function(D){return z&&d(z,"normal"),new g(!0,D)},N=function(D){return _?(s(D),C?M(D[0],D[1],J):M(D[0],D[1])):C?M(D,J):M(D)};if(S)z=b.iterator;else if(I)z=b;else{if(G=f(b),!G)throw new p(a(b)+" is not iterable");if(o(G)){for(Y=0,L=c(b);L>Y;Y++)if(j=N(b[Y]),j&&u(y,j))return j;return new g(!1)}z=h(b,G)}for(q=S?b.next:z.next;!(nt=i(q,z)).done;){try{j=N(nt.value)}catch(D){d(z,"throw",D)}if(typeof j=="object"&&j&&u(y,j))return j}return new g(!1)}}),2777:((n,t,e)=>{var r=e(9565),i=e(34),s=e(757),a=e(5966),o=e(4270),c=e(8227),u=TypeError,h=c("toPrimitive");n.exports=function(f,d){if(!i(f)||s(f))return f;var p=a(f,h),g;if(p){if(d===void 0&&(d="default"),g=r(p,f,d),!i(g)||s(g))return g;throw new u("Can't convert object to primitive value")}return d===void 0&&(d="number"),o(f,d)}}),2787:((n,t,e)=>{var r=e(9297),i=e(4901),s=e(8981),a=e(6119),o=e(2211),c=a("IE_PROTO"),u=Object,h=u.prototype;n.exports=o?u.getPrototypeOf:function(f){var d=s(f);if(r(d,c))return d[c];var p=d.constructor;return i(p)&&d instanceof p?p.prototype:d instanceof u?h:null}}),2796:((n,t,e)=>{var r=e(9039),i=e(4901),s=/#|\.prototype\./,a=function(f,d){var p=c[o(f)];return p===h?!0:p===u?!1:i(d)?r(d):!!d},o=a.normalize=function(f){return String(f).replace(s,".").toLowerCase()},c=a.data={},u=a.NATIVE="N",h=a.POLYFILL="P";n.exports=a}),2804:(n=>{var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=t+"+/",r=t+"-_",i=function(s){for(var a={},o=0;o<64;o++)a[s.charAt(o)]=o;return a};n.exports={i2c:e,c2i:i(e),i2cUrl:r,c2iUrl:i(r)}}),2812:(n=>{var t=TypeError;n.exports=function(e,r){if(e<r)throw new t("Not enough arguments");return e}}),2839:((n,t,e)=>{var r=e(4576),i=r.navigator,s=i&&i.userAgent;n.exports=s?String(s):""}),2967:((n,t,e)=>{var r=e(6706),i=e(34),s=e(7750),a=e(3506);n.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var o=!1,c={},u;try{u=r(Object.prototype,"__proto__","set"),u(c,[]),o=c instanceof Array}catch{}return function(f,d){return s(f),a(d),i(f)&&(o?u(f,d):f.__proto__=d),f}})():void 0)}),3068:((n,t,e)=>{var r=e(6518),i=e(9504),s=e(2652),a=RangeError,o=TypeError,c=1/0,u=NaN,h=Math.abs,f=Math.pow,d=i([].push),p=f(2,1023),g=f(2,53)-1,y=Number.MAX_VALUE,b=f(2,971),m={},w={},A={},_={},S={},I=function(C,M){var z=C+M,G=M-(z-C);return{hi:z,lo:G}};r({target:"Math",stat:!0},{sumPrecise:function(M){var z=[],G=0,Y=_;switch(s(M,function(ft){if(++G>=g)throw new a("Maximum allowed index exceeded");if(typeof ft!="number")throw new o("Value is not a number");Y!==m&&(ft!==ft?Y=m:ft===c?Y=Y===w?m:A:ft===-c?Y=Y===A?m:w:(ft!==0||1/ft===c)&&(Y===_||Y===S)&&(Y=S,d(z,ft)))}),Y){case m:return u;case w:return-c;case A:return c;case _:return-0}for(var L=[],j=0,q,nt,J,N,D,F,P=0;P<z.length;P++){q=z[P];for(var V=0,$=0;$<L.length;$++){if(nt=L[$],h(q)<h(nt)&&(F=q,q=nt,nt=F),J=I(q,nt),N=J.hi,D=J.lo,h(N)===c){var H=N===c?1:-1;j+=H,q=q-H*p-H*p,h(q)<h(nt)&&(F=q,q=nt,nt=F),J=I(q,nt),N=J.hi,D=J.lo}D!==0&&(L[V++]=D),q=N}L.length=V,q!==0&&d(L,q)}var rt=L.length-1;if(N=0,D=0,j!==0){var lt=rt>=0?L[rt]:0;if(rt--,h(j)>1||j>0&&lt>0||j<0&&lt<0)return j>0?c:-c;if(J=I(j*p,lt/2),N=J.hi,D=J.lo,D*=2,h(2*N)===c)return N>0?N===p&&D===-(b/2)&&rt>=0&&L[rt]<0?y:c:N===-p&&D===b/2&&rt>=0&&L[rt]>0?-y:-c;D!==0&&(L[++rt]=D,D=0),N*=2}for(;rt>=0&&(J=I(N,L[rt--]),N=J.hi,D=J.lo,D===0););return rt>=0&&(D<0&&L[rt]<0||D>0&&L[rt]>0)&&(nt=D*2,q=N+nt,nt===q-N&&(N=q)),N}})}),3167:((n,t,e)=>{var r=e(4901),i=e(34),s=e(2967);n.exports=function(a,o,c){var u,h;return s&&r(u=o.constructor)&&u!==c&&i(h=u.prototype)&&h!==c.prototype&&s(a,h),a}}),3238:((n,t,e)=>{var r=e(4576),i=e(7811),s=e(7394),a=r.DataView;n.exports=function(o){if(!i||s(o)!==0)return!1;try{return new a(o),!1}catch{return!0}}}),3392:((n,t,e)=>{var r=e(9504),i=0,s=Math.random(),a=r(1.1.toString);n.exports=function(o){return"Symbol("+(o===void 0?"":o)+")_"+a(++i+s,36)}}),3440:((n,t,e)=>{var r=e(7080),i=e(4402),s=e(9286),a=e(5170),o=e(3789),c=e(8469),u=e(507),h=i.has,f=i.remove;n.exports=function(p){var g=r(this),y=o(p),b=s(g);return a(g)<=y.size?c(g,function(m){y.includes(m)&&f(b,m)}):u(y.getIterator(),function(m){h(b,m)&&f(b,m)}),b}}),3463:(n=>{var t=TypeError;n.exports=function(e){if(typeof e=="string")return e;throw new t("Argument is not a string")}}),3506:((n,t,e)=>{var r=e(3925),i=String,s=TypeError;n.exports=function(a){if(r(a))return a;throw new s("Can't set "+i(a)+" as a prototype")}}),3579:((n,t,e)=>{var r=e(6518),i=e(9565),s=e(2652),a=e(9306),o=e(8551),c=e(1767),u=e(9539),h=e(4549),f=h("some",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:f},{some:function(p){o(this);try{a(p)}catch(b){u(this,"throw",b)}if(f)return i(f,this,p);var g=c(this),y=0;return s(g,function(b,m){if(p(b,y++))return m()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}),3650:((n,t,e)=>{var r=e(7080),i=e(4402),s=e(9286),a=e(3789),o=e(507),c=i.add,u=i.has,h=i.remove;n.exports=function(d){var p=r(this),g=a(d).getIterator(),y=s(p);return o(g,function(b){u(p,b)?h(y,b):c(y,b)}),y}}),3706:((n,t,e)=>{var r=e(9504),i=e(4901),s=e(7629),a=r(Function.toString);i(s.inspectSource)||(s.inspectSource=function(o){return a(o)}),n.exports=s.inspectSource}),3717:((n,t)=>{t.f=Object.getOwnPropertySymbols}),3724:((n,t,e)=>{var r=e(9039);n.exports=!r(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})}),3789:((n,t,e)=>{var r=e(9306),i=e(8551),s=e(9565),a=e(1291),o=e(1767),c="Invalid size",u=RangeError,h=TypeError,f=Math.max,d=function(p,g){this.set=p,this.size=f(g,0),this.has=r(p.has),this.keys=r(p.keys)};d.prototype={getIterator:function(){return o(i(s(this.keys,this.set)))},includes:function(p){return s(this.has,this.set,p)}},n.exports=function(p){i(p);var g=+p.size;if(g!==g)throw new h(c);var y=a(g);if(y<0)throw new u(c);return new d(p,y)}}),3838:((n,t,e)=>{var r=e(7080),i=e(5170),s=e(8469),a=e(3789);n.exports=function(c){var u=r(this),h=a(c);return i(u)>h.size?!1:s(u,function(f){if(!h.includes(f))return!1},!0)!==!1}}),3853:((n,t,e)=>{var r=e(6518),i=e(4449),s=e(4916),a=!s("isDisjointFrom",function(o){return!o});r({target:"Set",proto:!0,real:!0,forced:a},{isDisjointFrom:i})}),3925:((n,t,e)=>{var r=e(34);n.exports=function(i){return r(i)||i===null}}),3972:((n,t,e)=>{var r=e(34),i=String,s=TypeError;n.exports=function(a){if(a===void 0||r(a))return a;throw new s(i(a)+" is not an object or undefined")}}),4055:((n,t,e)=>{var r=e(4576),i=e(34),s=r.document,a=i(s)&&i(s.createElement);n.exports=function(o){return a?s.createElement(o):{}}}),4114:((n,t,e)=>{var r=e(6518),i=e(8981),s=e(6198),a=e(4527),o=e(6837),c=e(9039),u=c(function(){return[].push.call({length:4294967296},1)!==4294967297}),h=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(d){return d instanceof TypeError}},f=u||!h();r({target:"Array",proto:!0,arity:1,forced:f},{push:function(p){var g=i(this),y=s(g),b=arguments.length;o(y+b);for(var m=0;m<b;m++)g[y]=arguments[m],y++;return a(g,y),y}})}),4117:(n=>{n.exports=function(t){return t==null}}),4149:(n=>{var t=RangeError;n.exports=function(e){if(e===e)return e;throw new t("NaN is not allowed")}}),4154:((n,t,e)=>{var r=e(6955),i=TypeError;n.exports=function(s){if(r(s)==="Uint8Array")return s;throw new i("Argument is not an Uint8Array")}}),4204:((n,t,e)=>{var r=e(7080),i=e(4402).add,s=e(9286),a=e(3789),o=e(507);n.exports=function(u){var h=r(this),f=a(u).getIterator(),d=s(h);return o(f,function(p){i(d,p)}),d}}),4209:((n,t,e)=>{var r=e(8227),i=e(6269),s=r("iterator"),a=Array.prototype;n.exports=function(o){return o!==void 0&&(i.Array===o||a[s]===o)}}),4215:((n,t,e)=>{var r=e(4576),i=e(2839),s=e(2195),a=function(o){return i.slice(0,o.length)===o};n.exports=(function(){return a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":r.Bun&&typeof Bun.version=="string"?"BUN":r.Deno&&typeof Deno.version=="object"?"DENO":s(r.process)==="process"?"NODE":r.window&&r.document?"BROWSER":"REST"})()}),4226:((n,t,e)=>{var r=e(6518),i=e(4576),s=e(3463),a=e(4154),o=e(5169),c=e(2303);i.Uint8Array&&r({target:"Uint8Array",proto:!0},{setFromHex:function(h){a(this),s(h),o(this.buffer);var f=c(h,this).read;return{read:f,written:f/2}}})}),4235:((n,t,e)=>{e(3068)}),4270:((n,t,e)=>{var r=e(9565),i=e(4901),s=e(34),a=TypeError;n.exports=function(o,c){var u,h;if(c==="string"&&i(u=o.toString)&&!s(h=r(u,o))||i(u=o.valueOf)&&!s(h=r(u,o))||c!=="string"&&i(u=o.toString)&&!s(h=r(u,o)))return h;throw new a("Can't convert object to primitive value")}}),4376:((n,t,e)=>{var r=e(2195);n.exports=Array.isArray||function(s){return r(s)==="Array"}}),4402:((n,t,e)=>{var r=e(9504),i=Set.prototype;n.exports={Set,add:r(i.add),has:r(i.has),remove:r(i.delete),proto:i}}),4449:((n,t,e)=>{var r=e(7080),i=e(4402).has,s=e(5170),a=e(3789),o=e(8469),c=e(507),u=e(9539);n.exports=function(f){var d=r(this),p=a(f);if(s(d)<=p.size)return o(d,function(y){if(p.includes(y))return!1},!0)!==!1;var g=p.getIterator();return c(g,function(y){if(i(d,y))return u(g,"normal",!1)})!==!1}}),4483:((n,t,e)=>{var r=e(4576),i=e(9429),s=e(1548),a=r.structuredClone,o=r.ArrayBuffer,c=r.MessageChannel,u=!1,h,f,d,p;if(s)u=function(g){a(g,{transfer:[g]})};else if(o)try{c||(h=i("worker_threads"),h&&(c=h.MessageChannel)),c&&(f=new c,d=new o(2),p=function(g){f.port1.postMessage(null,[g])},d.byteLength===2&&(p(d),d.byteLength===0&&(u=p)))}catch{}n.exports=u}),4495:((n,t,e)=>{var r=e(9519),i=e(9039),s=e(4576),a=s.String;n.exports=!!Object.getOwnPropertySymbols&&!i(function(){var o=Symbol("symbol detection");return!a(o)||!(Object(o)instanceof Symbol)||!Symbol.sham&&r&&r<41})}),4527:((n,t,e)=>{var r=e(3724),i=e(4376),s=TypeError,a=Object.getOwnPropertyDescriptor,o=r&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(c){return c instanceof TypeError}})();n.exports=o?function(c,u){if(i(c)&&!a(c,"length").writable)throw new s("Cannot set read only .length");return c.length=u}:function(c,u){return c.length=u}}),4549:((n,t,e)=>{var r=e(4576);n.exports=function(i,s){var a=r.Iterator,o=a&&a.prototype,c=o&&o[i],u=!1;if(c)try{c.call({next:function(){return{done:!0}},return:function(){u=!0}},-1)}catch(h){h instanceof s||(u=!1)}if(!u)return c}}),4576:(function(n){var t=function(e){return e&&e.Math===Math&&e};n.exports=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof window=="object"&&window)||t(typeof this=="object"&&this)||(function(){return this})()||Function("return this")()}),4603:((n,t,e)=>{var r=e(6840),i=e(9504),s=e(655),a=e(2812),o=URLSearchParams,c=o.prototype,u=i(c.append),h=i(c.delete),f=i(c.forEach),d=i([].push),p=new o("a=1&a=2&b=3");p.delete("a",1),p.delete("b",void 0),p+""!="a=2"&&r(c,"delete",function(g){var y=arguments.length,b=y<2?void 0:arguments[1];if(y&&b===void 0)return h(this,g);var m=[];f(this,function(z,G){d(m,{key:G,value:z})}),a(y,1);for(var w=s(g),A=s(b),_=0,S=0,I=!1,C=m.length,M;_<C;)M=m[_++],I||M.key===w?(I=!0,h(this,M.key)):S++;for(;S<C;)M=m[S++],M.key===w&&M.value===A||u(this,M.key,M.value)},{enumerable:!0,unsafe:!0})}),4628:((n,t,e)=>{var r=e(6518),i=e(6043);r({target:"Promise",stat:!0},{withResolvers:function(){var a=i.f(this);return{promise:a.promise,resolve:a.resolve,reject:a.reject}}})}),4644:((n,t,e)=>{var r=e(7811),i=e(3724),s=e(4576),a=e(4901),o=e(34),c=e(9297),u=e(6955),h=e(6823),f=e(6699),d=e(6840),p=e(2106),g=e(1625),y=e(2787),b=e(2967),m=e(8227),w=e(3392),A=e(1181),_=A.enforce,S=A.get,I=s.Int8Array,C=I&&I.prototype,M=s.Uint8ClampedArray,z=M&&M.prototype,G=I&&y(I),Y=C&&y(C),L=Object.prototype,j=s.TypeError,q=m("toStringTag"),nt=w("TYPED_ARRAY_TAG"),J="TypedArrayConstructor",N=r&&!!b&&u(s.opera)!=="Opera",D=!1,F,P,V,$={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},H={BigInt64Array:8,BigUint64Array:8},rt=function(Q){if(!o(Q))return!1;var W=u(Q);return W==="DataView"||c($,W)||c(H,W)},lt=function(wt){var Q=y(wt);if(o(Q)){var W=S(Q);return W&&c(W,J)?W[J]:lt(Q)}},ft=function(wt){if(!o(wt))return!1;var Q=u(wt);return c($,Q)||c(H,Q)},K=function(wt){if(ft(wt))return wt;throw new j("Target is not a typed array")},X=function(wt){if(a(wt)&&(!b||g(G,wt)))return wt;throw new j(h(wt)+" is not a typed array constructor")},st=function(wt,Q,W,at){if(i){if(W)for(var pt in $){var _t=s[pt];if(_t&&c(_t.prototype,wt))try{delete _t.prototype[wt]}catch{try{_t.prototype[wt]=Q}catch{}}}(!Y[wt]||W)&&d(Y,wt,W?Q:N&&C[wt]||Q,at)}},bt=function(wt,Q,W){var at,pt;if(i){if(b){if(W){for(at in $)if(pt=s[at],pt&&c(pt,wt))try{delete pt[wt]}catch{}}if(!G[wt]||W)try{return d(G,wt,W?Q:N&&G[wt]||Q)}catch{}else return}for(at in $)pt=s[at],pt&&(!pt[wt]||W)&&d(pt,wt,Q)}};for(F in $)P=s[F],V=P&&P.prototype,V?_(V)[J]=P:N=!1;for(F in H)P=s[F],V=P&&P.prototype,V&&(_(V)[J]=P);if((!N||!a(G)||G===Function.prototype)&&(G=function(){throw new j("Incorrect invocation")},N))for(F in $)s[F]&&b(s[F],G);if((!N||!Y||Y===L)&&(Y=G.prototype,N))for(F in $)s[F]&&b(s[F].prototype,Y);if(N&&y(z)!==Y&&b(z,Y),i&&!c(Y,q)){D=!0,p(Y,q,{configurable:!0,get:function(){return o(this)?this[nt]:void 0}});for(F in $)s[F]&&f(s[F],nt,F)}n.exports={NATIVE_ARRAY_BUFFER_VIEWS:N,TYPED_ARRAY_TAG:D&&nt,aTypedArray:K,aTypedArrayConstructor:X,exportTypedArrayMethod:st,exportTypedArrayStaticMethod:bt,getTypedArrayConstructor:lt,isView:rt,isTypedArray:ft,TypedArray:G,TypedArrayPrototype:Y}}),4659:((n,t,e)=>{var r=e(3724),i=e(4913),s=e(6980);n.exports=function(a,o,c){r?i.f(a,o,s(0,c)):a[o]=c}}),4901:(n=>{var t=typeof document=="object"&&document.all;n.exports=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"}}),4913:((n,t,e)=>{var r=e(3724),i=e(5917),s=e(8686),a=e(8551),o=e(6969),c=TypeError,u=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f="enumerable",d="configurable",p="writable";t.f=r?s?function(y,b,m){if(a(y),b=o(b),a(m),typeof y=="function"&&b==="prototype"&&"value"in m&&p in m&&!m[p]){var w=h(y,b);w&&w[p]&&(y[b]=m.value,m={configurable:d in m?m[d]:w[d],enumerable:f in m?m[f]:w[f],writable:!1})}return u(y,b,m)}:u:function(y,b,m){if(a(y),b=o(b),a(m),i)try{return u(y,b,m)}catch{}if("get"in m||"set"in m)throw new c("Accessors not supported");return"value"in m&&(y[b]=m.value),y}}),4916:((n,t,e)=>{var r=e(7751),i=function(a){return{size:a,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},s=function(a){return{size:a,has:function(){return!0},keys:function(){throw new Error("e")}}};n.exports=function(a,o){var c=r("Set");try{new c()[a](i(0));try{return new c()[a](i(-1)),!1}catch{if(!o)return!0;try{return new c()[a](s(-1/0)),!1}catch{var u=new c([1,2]);return o(u[a](s(1/0)))}}}catch{return!1}}}),4972:((n,t,e)=>{var r=e(6518),i=e(9565),s=e(8551),a=e(1767),o=e(4149),c=e(9590),u=e(9462),h=e(9539),f=e(4549),d=e(6395),p=!d&&f("take",RangeError),g=u(function(){var y=this.iterator;if(!this.remaining--)return this.done=!0,h(y,"normal",void 0);var b=s(i(this.next,y)),m=this.done=!!b.done;if(!m)return b.value});r({target:"Iterator",proto:!0,real:!0,forced:d||p},{take:function(b){s(this);var m;try{m=c(o(+b))}catch(w){h(this,"throw",w)}return p?i(p,this,m):new g(a(this),{remaining:m})}})}),4979:((n,t,e)=>{var r=e(6518),i=e(4576),s=e(7751),a=e(6980),o=e(4913).f,c=e(9297),u=e(679),h=e(3167),f=e(2603),d=e(5002),p=e(8574),g=e(3724),y=e(6395),b="DOMException",m=s("Error"),w=s(b),A=function(){u(this,_);var J=arguments.length,N=f(J<1?void 0:arguments[0]),D=f(J<2?void 0:arguments[1],"Error"),F=new w(N,D),P=new m(N);return P.name=b,o(F,"stack",a(1,p(P.stack,1))),h(F,this,A),F},_=A.prototype=w.prototype,S="stack"in new m(b),I="stack"in new w(1,2),C=w&&g&&Object.getOwnPropertyDescriptor(i,b),M=!!C&&!(C.writable&&C.configurable),z=S&&!M&&!I;r({global:!0,constructor:!0,forced:y||z},{DOMException:z?A:w});var G=s(b),Y=G.prototype;if(Y.constructor!==G){y||o(Y,"constructor",a(1,G));for(var L in d)if(c(d,L)){var j=d[L],q=j.s;c(G,q)||o(G,q,a(6,j.c))}}}),5002:(n=>{n.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}}),5024:((n,t,e)=>{var r=e(6518),i=e(3650),s=e(9835),a=e(4916),o=!a("symmetricDifference")||!s("symmetricDifference");r({target:"Set",proto:!0,real:!0,forced:o},{symmetricDifference:i})}),5031:((n,t,e)=>{var r=e(7751),i=e(9504),s=e(8480),a=e(3717),o=e(8551),c=i([].concat);n.exports=r("Reflect","ownKeys")||function(h){var f=s.f(o(h)),d=a.f;return d?c(f,d(h)):f}}),5169:((n,t,e)=>{var r=e(3238),i=TypeError;n.exports=function(s){if(r(s))throw new i("ArrayBuffer is detached");return s}}),5170:((n,t,e)=>{var r=e(6706),i=e(4402);n.exports=r(i.proto,"size","get")||function(s){return s.size}}),5213:((n,t,e)=>{var r=e(6518),i=e(4576),s=e(5370),a=e(9143),o=i.Uint8Array,c=!o||!o.fromBase64||!(function(){try{o.fromBase64("a");return}catch{}try{o.fromBase64("",null)}catch{return!0}})();o&&r({target:"Uint8Array",stat:!0,forced:c},{fromBase64:function(h){var f=a(h,arguments.length>1?arguments[1]:void 0,null,9007199254740991);return s(o,f.bytes)}})}),5370:((n,t,e)=>{var r=e(6198);n.exports=function(i,s,a){for(var o=0,c=arguments.length>2?a:r(s),u=new i(c);c>o;)u[o]=s[o++];return u}}),5397:((n,t,e)=>{var r=e(7055),i=e(7750);n.exports=function(s){return r(i(s))}}),5610:((n,t,e)=>{var r=e(1291),i=Math.max,s=Math.min;n.exports=function(a,o){var c=r(a);return c<0?i(c+o,0):s(c,o)}}),5623:((n,t,e)=>{e(456)}),5636:((n,t,e)=>{var r=e(4576),i=e(9504),s=e(6706),a=e(7696),o=e(5169),c=e(7394),u=e(4483),h=e(1548),f=r.structuredClone,d=r.ArrayBuffer,p=r.DataView,g=Math.min,y=d.prototype,b=p.prototype,m=i(y.slice),w=s(y,"resizable","get"),A=s(y,"maxByteLength","get"),_=i(b.getInt8),S=i(b.setInt8);n.exports=(h||u)&&function(I,C,M){var z=c(I),G=C===void 0?z:a(C),Y=!w||!w(I),L;if(o(I),h&&(I=f(I,{transfer:[I]}),z===G&&(M||Y)))return I;if(z>=G&&(!M||Y))L=m(I,0,G);else{var j=M&&!Y&&A?{maxByteLength:A(I)}:void 0;L=new d(G,j);for(var q=new p(I),nt=new p(L),J=g(G,z),N=0;N<J;N++)S(nt,N,_(q,N))}return h||u(I),L}}),5745:((n,t,e)=>{var r=e(7629);n.exports=function(i,s){return r[i]||(r[i]=s||{})}}),5781:((n,t,e)=>{var r=e(6518),i=e(7751),s=e(2812),a=e(655),o=e(7416),c=i("URL");r({target:"URL",stat:!0,forced:!o},{parse:function(h){var f=s(arguments.length,1),d=a(h),p=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return new c(d,p)}catch{return null}}})}),5854:((n,t,e)=>{var r=e(2777),i=TypeError;n.exports=function(s){var a=r(s,"number");if(typeof a=="number")throw new i("Can't convert number to bigint");return BigInt(a)}}),5876:((n,t,e)=>{var r=e(6518),i=e(3838),s=e(4916),a=!s("isSubsetOf",function(o){return o});r({target:"Set",proto:!0,real:!0,forced:a},{isSubsetOf:i})}),5917:((n,t,e)=>{var r=e(3724),i=e(9039),s=e(4055);n.exports=!r&&!i(function(){return Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a!==7})}),5966:((n,t,e)=>{var r=e(9306),i=e(4117);n.exports=function(s,a){var o=s[a];return i(o)?void 0:r(o)}}),6043:((n,t,e)=>{var r=e(9306),i=TypeError,s=function(a){var o,c;this.promise=new a(function(u,h){if(o!==void 0||c!==void 0)throw new i("Bad Promise constructor");o=u,c=h}),this.resolve=r(o),this.reject=r(c)};n.exports.f=function(a){return new s(a)}}),6080:((n,t,e)=>{var r=e(7476),i=e(9306),s=e(616),a=r(r.bind);n.exports=function(o,c){return i(o),c===void 0?o:s?a(o,c):function(){return o.apply(c,arguments)}}}),6119:((n,t,e)=>{var r=e(5745),i=e(3392),s=r("keys");n.exports=function(a){return s[a]||(s[a]=i(a))}}),6193:((n,t,e)=>{var r=e(4215);n.exports=r==="NODE"}),6198:((n,t,e)=>{var r=e(8014);n.exports=function(i){return r(i.length)}}),6269:(n=>{n.exports={}}),6279:((n,t,e)=>{var r=e(6840);n.exports=function(i,s,a){for(var o in s)r(i,o,s[o],a);return i}}),6319:((n,t,e)=>{var r=e(8551),i=e(9539);n.exports=function(s,a,o,c){try{return c?a(r(o)[0],o[1]):a(o)}catch(u){i(s,"throw",u)}}}),6395:(n=>{n.exports=!1}),6518:((n,t,e)=>{var r=e(4576),i=e(7347).f,s=e(6699),a=e(6840),o=e(9433),c=e(7740),u=e(2796);n.exports=function(h,f){var d=h.target,p=h.global,g=h.stat,y,b,m,w,A,_;if(p?b=r:g?b=r[d]||o(d,{}):b=r[d]&&r[d].prototype,b)for(m in f){if(A=f[m],h.dontCallGetSet?(_=i(b,m),w=_&&_.value):w=b[m],y=u(p?m:d+(g?".":"#")+m,h.forced),!y&&w!==void 0){if(typeof A==typeof w)continue;c(A,w)}(h.sham||w&&w.sham)&&s(A,"sham",!0),a(b,m,A,h)}}}),6573:((n,t,e)=>{var r=e(3724),i=e(2106),s=e(3238),a=ArrayBuffer.prototype;r&&!("detached"in a)&&i(a,"detached",{configurable:!0,get:function(){return s(this)}})}),6632:((n,t,e)=>{var r=e(6518),i=e(4576),s=e(9143),a=e(4154),o=i.Uint8Array,c=!o||!o.prototype.setFromBase64||!(function(){var u=new o([255,255,255,255,255]);try{u.setFromBase64("",null);return}catch{}try{u.setFromBase64("a");return}catch{}try{u.setFromBase64("MjYyZg===")}catch{return u[0]===50&&u[1]===54&&u[2]===50&&u[3]===255&&u[4]===255}})();o&&r({target:"Uint8Array",proto:!0,forced:c},{setFromBase64:function(h){a(this);var f=s(h,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:f.read,written:f.written}}})}),6699:((n,t,e)=>{var r=e(3724),i=e(4913),s=e(6980);n.exports=r?function(a,o,c){return i.f(a,o,s(1,c))}:function(a,o,c){return a[o]=c,a}}),6706:((n,t,e)=>{var r=e(9504),i=e(9306);n.exports=function(s,a,o){try{return r(i(Object.getOwnPropertyDescriptor(s,a)[o]))}catch{}}}),6801:((n,t,e)=>{var r=e(3724),i=e(8686),s=e(4913),a=e(8551),o=e(5397),c=e(1072);t.f=r&&!i?Object.defineProperties:function(h,f){a(h);for(var d=o(f),p=c(f),g=p.length,y=0,b;g>y;)s.f(h,b=p[y++],d[b]);return h}}),6823:(n=>{var t=String;n.exports=function(e){try{return t(e)}catch{return"Object"}}}),6837:(n=>{var t=TypeError,e=9007199254740991;n.exports=function(r){if(r>e)throw t("Maximum allowed index exceeded");return r}}),6840:((n,t,e)=>{var r=e(4901),i=e(4913),s=e(283),a=e(9433);n.exports=function(o,c,u,h){h||(h={});var f=h.enumerable,d=h.name!==void 0?h.name:c;if(r(u)&&s(u,d,h),h.global)f?o[c]=u:a(c,u);else{try{h.unsafe?o[c]&&(f=!0):delete o[c]}catch{}f?o[c]=u:i.f(o,c,{value:u,enumerable:!1,configurable:!h.nonConfigurable,writable:!h.nonWritable})}return o}}),6955:((n,t,e)=>{var r=e(2140),i=e(4901),s=e(2195),a=e(8227),o=a("toStringTag"),c=Object,u=s((function(){return arguments})())==="Arguments",h=function(f,d){try{return f[d]}catch{}};n.exports=r?s:function(f){var d,p,g;return f===void 0?"Undefined":f===null?"Null":typeof(p=h(d=c(f),o))=="string"?p:u?s(d):(g=s(d))==="Object"&&i(d.callee)?"Arguments":g}}),6969:((n,t,e)=>{var r=e(2777),i=e(757);n.exports=function(s){var a=r(s,"string");return i(a)?a:a+""}}),6980:(n=>{n.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}}),7040:((n,t,e)=>{var r=e(4495);n.exports=r&&!Symbol.sham&&typeof Symbol.iterator=="symbol"}),7055:((n,t,e)=>{var r=e(9504),i=e(9039),s=e(2195),a=Object,o=r("".split);n.exports=i(function(){return!a("z").propertyIsEnumerable(0)})?function(c){return s(c)==="String"?o(c,""):a(c)}:a}),7080:((n,t,e)=>{var r=e(4402).has;n.exports=function(i){return r(i),i}}),7347:((n,t,e)=>{var r=e(3724),i=e(9565),s=e(8773),a=e(6980),o=e(5397),c=e(6969),u=e(9297),h=e(5917),f=Object.getOwnPropertyDescriptor;t.f=r?f:function(p,g){if(p=o(p),g=c(g),h)try{return f(p,g)}catch{}if(u(p,g))return a(!i(s.f,p,g),p[g])}}),7394:((n,t,e)=>{var r=e(4576),i=e(6706),s=e(2195),a=r.ArrayBuffer,o=r.TypeError;n.exports=a&&i(a.prototype,"byteLength","get")||function(c){if(s(c)!=="ArrayBuffer")throw new o("ArrayBuffer expected");return c.byteLength}}),7416:((n,t,e)=>{var r=e(9039),i=e(8227),s=e(3724),a=e(6395),o=i("iterator");n.exports=!r(function(){var c=new URL("b?a=1&b=2&c=3","https://a"),u=c.searchParams,h=new URLSearchParams("a=1&a=2&b=3"),f="";return c.pathname="c%20d",u.forEach(function(d,p){u.delete("b"),f+=p+d}),h.delete("a",2),h.delete("b",void 0),a&&(!c.toJSON||!h.has("a",1)||h.has("a",2)||!h.has("a",void 0)||h.has("b"))||!u.size&&(a||!s)||!u.sort||c.href!=="https://a/c%20d?a=1&c=3"||u.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!u[o]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("https://a#\u0431").hash!=="#%D0%B1"||f!=="a1c3"||new URL("https://x",void 0).host!=="x"})}),7476:((n,t,e)=>{var r=e(2195),i=e(9504);n.exports=function(s){if(r(s)==="Function")return i(s)}}),7566:((n,t,e)=>{var r=e(6840),i=e(9504),s=e(655),a=e(2812),o=URLSearchParams,c=o.prototype,u=i(c.getAll),h=i(c.has),f=new o("a=1");(f.has("a",2)||!f.has("a",void 0))&&r(c,"has",function(p){var g=arguments.length,y=g<2?void 0:arguments[1];if(g&&y===void 0)return h(this,p);var b=u(this,p);a(g,1);for(var m=s(y),w=0;w<b.length;)if(b[w++]===m)return!0;return!1},{enumerable:!0,unsafe:!0})}),7588:((n,t,e)=>{var r=e(6518),i=e(9565),s=e(2652),a=e(9306),o=e(8551),c=e(1767),u=e(9539),h=e(4549),f=h("forEach",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:f},{forEach:function(p){o(this);try{a(p)}catch(b){u(this,"throw",b)}if(f)return i(f,this,p);var g=c(this),y=0;s(g,function(b){p(b,y++)},{IS_RECORD:!0})}})}),7629:((n,t,e)=>{var r=e(6395),i=e(4576),s=e(9433),a="__core-js_shared__",o=n.exports=i[a]||s(a,{});(o.versions||(o.versions=[])).push({version:"3.47.0",mode:r?"pure":"global",copyright:"\xA9 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),7642:((n,t,e)=>{var r=e(6518),i=e(3440),s=e(9039),a=e(4916),o=!a("difference",function(u){return u.size===0}),c=o||s(function(){var u={size:1,has:function(){return!0},keys:function(){var f=0;return{next:function(){var d=f++>1;return h.has(1)&&h.clear(),{done:d,value:2}}}}},h=new Set([1,2,3,4]);return h.difference(u).size!==3});r({target:"Set",proto:!0,real:!0,forced:c},{difference:i})}),7657:((n,t,e)=>{var r=e(9039),i=e(4901),s=e(34),a=e(2360),o=e(2787),c=e(6840),u=e(8227),h=e(6395),f=u("iterator"),d=!1,p,g,y;[].keys&&(y=[].keys(),"next"in y?(g=o(o(y)),g!==Object.prototype&&(p=g)):d=!0);var b=!s(p)||r(function(){var m={};return p[f].call(m)!==m});b?p={}:h&&(p=a(p)),i(p[f])||c(p,f,function(){return this}),n.exports={IteratorPrototype:p,BUGGY_SAFARI_ITERATORS:d}}),7680:((n,t,e)=>{var r=e(9504);n.exports=r([].slice)}),7696:((n,t,e)=>{var r=e(1291),i=e(8014),s=RangeError;n.exports=function(a){if(a===void 0)return 0;var o=r(a),c=i(o);if(o!==c)throw new s("Wrong length or index");return c}}),7740:((n,t,e)=>{var r=e(9297),i=e(5031),s=e(7347),a=e(4913);n.exports=function(o,c,u){for(var h=i(c),f=a.f,d=s.f,p=0;p<h.length;p++){var g=h[p];!r(o,g)&&!(u&&r(u,g))&&f(o,g,d(c,g))}}}),7750:((n,t,e)=>{var r=e(4117),i=TypeError;n.exports=function(s){if(r(s))throw new i("Can't call method on "+s);return s}}),7751:((n,t,e)=>{var r=e(4576),i=e(4901),s=function(a){return i(a)?a:void 0};n.exports=function(a,o){return arguments.length<2?s(r[a]):r[a]&&r[a][o]}}),7811:(n=>{n.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"}),7936:((n,t,e)=>{var r=e(6518),i=e(5636);i&&r({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return i(this,arguments.length?arguments[0]:void 0,!1)}})}),8004:((n,t,e)=>{var r=e(6518),i=e(9039),s=e(8750),a=e(4916),o=!a("intersection",function(c){return c.size===2&&c.has(1)&&c.has(2)})||i(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});r({target:"Set",proto:!0,real:!0,forced:o},{intersection:s})}),8014:((n,t,e)=>{var r=e(1291),i=Math.min;n.exports=function(s){var a=r(s);return a>0?i(a,9007199254740991):0}}),8100:((n,t,e)=>{var r=e(6518),i=e(5636);i&&r({target:"ArrayBuffer",proto:!0},{transfer:function(){return i(this,arguments.length?arguments[0]:void 0,!0)}})}),8111:((n,t,e)=>{var r=e(6518),i=e(4576),s=e(679),a=e(8551),o=e(4901),c=e(2787),u=e(2106),h=e(4659),f=e(9039),d=e(9297),p=e(8227),g=e(7657).IteratorPrototype,y=e(3724),b=e(6395),m="constructor",w="Iterator",A=p("toStringTag"),_=TypeError,S=i[w],I=b||!o(S)||S.prototype!==g||!f(function(){S({})}),C=function(){if(s(this,g),c(this)===g)throw new _("Abstract class Iterator not directly constructable")},M=function(z,G){y?u(g,z,{configurable:!0,get:function(){return G},set:function(Y){if(a(this),this===g)throw new _("You can't redefine this property");d(this,z)?this[z]=Y:h(this,z,Y)}}):g[z]=G};d(g,A)||M(A,w),(I||!d(g,m)||g[m]===Object)&&M(m,C),C.prototype=g,r({global:!0,constructor:!0,forced:I},{Iterator:C})}),8227:((n,t,e)=>{var r=e(4576),i=e(5745),s=e(9297),a=e(3392),o=e(4495),c=e(7040),u=r.Symbol,h=i("wks"),f=c?u.for||u:u&&u.withoutSetter||a;n.exports=function(d){return s(h,d)||(h[d]=o&&s(u,d)?u[d]:f("Symbol."+d)),h[d]}}),8235:((n,t,e)=>{var r=e(9504),i=e(9297),s=SyntaxError,a=parseInt,o=String.fromCharCode,c=r("".charAt),u=r("".slice),h=r(/./.exec),f={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
94
+ `,"\\r":"\r","\\t":" "},d=/^[\da-f]{4}$/i,p=/^[\u0000-\u001F]$/;n.exports=function(g,y){for(var b=!0,m="";y<g.length;){var w=c(g,y);if(w==="\\"){var A=u(g,y,y+2);if(i(f,A))m+=f[A],y+=2;else if(A==="\\u"){y+=2;var _=u(g,y,y+4);if(!h(d,_))throw new s("Bad Unicode escape at: "+y);m+=o(a(_,16)),y+=4}else throw new s('Unknown escape sequence: "'+A+'"')}else if(w==='"'){b=!1,y++;break}else{if(h(p,w))throw new s("Bad control character in string literal at: "+y);m+=w,y++}}if(b)throw new s("Unterminated string at: "+y);return{value:m,end:y}}}),8237:((n,t,e)=>{var r=e(6518),i=e(2652),s=e(9306),a=e(8551),o=e(1767),c=e(9539),u=e(4549),h=e(8745),f=e(9039),d=TypeError,p=f(function(){[].keys().reduce(function(){},void 0)}),g=!p&&u("reduce",d);r({target:"Iterator",proto:!0,real:!0,forced:p||g},{reduce:function(b){a(this);try{s(b)}catch(S){c(this,"throw",S)}var m=arguments.length<2,w=m?void 0:arguments[1];if(g)return h(g,this,m?[b]:[b,w]);var A=o(this),_=0;if(i(A,function(S){m?(m=!1,w=S):w=b(w,S,_),_++},{IS_RECORD:!0}),m)throw new d("Reduce of empty iterator with no initial value");return w}})}),8335:((n,t,e)=>{e(9112)}),8469:((n,t,e)=>{var r=e(9504),i=e(507),s=e(4402),a=s.Set,o=s.proto,c=r(o.forEach),u=r(o.keys),h=u(new a).next;n.exports=function(f,d,p){return p?i({iterator:u(f),next:h},d):c(f,d)}}),8480:((n,t,e)=>{var r=e(1828),i=e(8727),s=i.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(o){return r(o,s)}}),8527:((n,t,e)=>{var r=e(7080),i=e(4402).has,s=e(5170),a=e(3789),o=e(507),c=e(9539);n.exports=function(h){var f=r(this),d=a(h);if(s(f)<d.size)return!1;var p=d.getIterator();return o(p,function(g){if(!i(f,g))return c(p,"normal",!1)})!==!1}}),8551:((n,t,e)=>{var r=e(34),i=String,s=TypeError;n.exports=function(a){if(r(a))return a;throw new s(i(a)+" is not an object")}}),8574:((n,t,e)=>{var r=e(9504),i=Error,s=r("".replace),a=(function(u){return String(new i(u).stack)})("zxcasd"),o=/\n\s*at [^:]*:[^\n]*/,c=o.test(a);n.exports=function(u,h){if(c&&typeof u=="string"&&!i.prepareStackTrace)for(;h--;)u=s(u,o,"");return u}}),8622:((n,t,e)=>{var r=e(4576),i=e(4901),s=r.WeakMap;n.exports=i(s)&&/native code/.test(String(s))}),8646:((n,t,e)=>{var r=e(9565),i=e(8551),s=e(1767),a=e(851);n.exports=function(o,c){(!c||typeof o!="string")&&i(o);var u=a(o);return s(i(u!==void 0?r(u,o):o))}}),8686:((n,t,e)=>{var r=e(3724),i=e(9039);n.exports=r&&i(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})}),8721:((n,t,e)=>{var r=e(3724),i=e(9504),s=e(2106),a=URLSearchParams.prototype,o=i(a.forEach);r&&!("size"in a)&&s(a,"size",{get:function(){var u=0;return o(this,function(){u++}),u},configurable:!0,enumerable:!0})}),8727:(n=>{n.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),8745:((n,t,e)=>{var r=e(616),i=Function.prototype,s=i.apply,a=i.call;n.exports=typeof Reflect=="object"&&Reflect.apply||(r?a.bind(s):function(){return a.apply(s,arguments)})}),8750:((n,t,e)=>{var r=e(7080),i=e(4402),s=e(5170),a=e(3789),o=e(8469),c=e(507),u=i.Set,h=i.add,f=i.has;n.exports=function(p){var g=r(this),y=a(p),b=new u;return s(g)>y.size?c(y.getIterator(),function(m){f(g,m)&&h(b,m)}):o(g,function(m){y.includes(m)&&h(b,m)}),b}}),8773:((n,t)=>{var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!e.call({1:2},1);t.f=i?function(a){var o=r(this,a);return!!o&&o.enumerable}:e}),8981:((n,t,e)=>{var r=e(7750),i=Object;n.exports=function(s){return i(r(s))}}),9039:(n=>{n.exports=function(t){try{return!!t()}catch{return!0}}}),9112:((n,t,e)=>{var r=e(6518),i=e(3724),s=e(4576),a=e(7751),o=e(9504),c=e(9565),u=e(4901),h=e(34),f=e(4376),d=e(9297),p=e(655),g=e(6198),y=e(4659),b=e(9039),m=e(8235),w=e(4495),A=s.JSON,_=s.Number,S=s.SyntaxError,I=A&&A.parse,C=a("Object","keys"),M=Object.getOwnPropertyDescriptor,z=o("".charAt),G=o("".slice),Y=o(/./.exec),L=o([].push),j=/^\d$/,q=/^[1-9]$/,nt=/^[\d-]$/,J=/^[\t\n\r ]$/,N=0,D=1,F=function(ft,K){ft=p(ft);var X=new H(ft,0,""),st=X.parse(),bt=st.value,wt=X.skip(J,st.end);if(wt<ft.length)throw new S('Unexpected extra character: "'+z(ft,wt)+'" after the parsed data at: '+wt);return u(K)?P({"":bt},"",K,st):bt},P=function(ft,K,X,st){var bt=ft[K],wt=st&&bt===st.value,Q=wt&&typeof st.source=="string"?{source:st.source}:{},W,at,pt,_t,At;if(h(bt)){var gt=f(bt),xt=wt?st.nodes:gt?[]:{};if(gt)for(W=xt.length,pt=g(bt),_t=0;_t<pt;_t++)V(bt,_t,P(bt,""+_t,X,_t<W?xt[_t]:void 0));else for(at=C(bt),pt=g(at),_t=0;_t<pt;_t++)At=at[_t],V(bt,At,P(bt,At,X,d(xt,At)?xt[At]:void 0))}return c(X,ft,K,bt,Q)},V=function(ft,K,X){if(i){var st=M(ft,K);if(st&&!st.configurable)return}X===void 0?delete ft[K]:y(ft,K,X)},$=function(ft,K,X,st){this.value=ft,this.end=K,this.source=X,this.nodes=st},H=function(ft,K){this.source=ft,this.index=K};H.prototype={fork:function(ft){return new H(this.source,ft)},parse:function(){var ft=this.source,K=this.skip(J,this.index),X=this.fork(K),st=z(ft,K);if(Y(nt,st))return X.number();switch(st){case"{":return X.object();case"[":return X.array();case'"':return X.string();case"t":return X.keyword(!0);case"f":return X.keyword(!1);case"n":return X.keyword(null)}throw new S('Unexpected character: "'+st+'" at: '+K)},node:function(ft,K,X,st,bt){return new $(K,st,ft?null:G(this.source,X,st),bt)},object:function(){for(var ft=this.source,K=this.index+1,X=!1,st={},bt={};K<ft.length;){if(K=this.until(['"',"}"],K),z(ft,K)==="}"&&!X){K++;break}var wt=this.fork(K).string(),Q=wt.value;K=wt.end,K=this.until([":"],K)+1,K=this.skip(J,K),wt=this.fork(K).parse(),y(bt,Q,wt),y(st,Q,wt.value),K=this.until([",","}"],wt.end);var W=z(ft,K);if(W===",")X=!0,K++;else if(W==="}"){K++;break}}return this.node(D,st,this.index,K,bt)},array:function(){for(var ft=this.source,K=this.index+1,X=!1,st=[],bt=[];K<ft.length;){if(K=this.skip(J,K),z(ft,K)==="]"&&!X){K++;break}var wt=this.fork(K).parse();if(L(bt,wt),L(st,wt.value),K=this.until([",","]"],wt.end),z(ft,K)===",")X=!0,K++;else if(z(ft,K)==="]"){K++;break}}return this.node(D,st,this.index,K,bt)},string:function(){var ft=this.index,K=m(this.source,this.index+1);return this.node(N,K.value,ft,K.end)},number:function(){var ft=this.source,K=this.index,X=K;if(z(ft,X)==="-"&&X++,z(ft,X)==="0")X++;else if(Y(q,z(ft,X)))X=this.skip(j,X+1);else throw new S("Failed to parse number at: "+X);if(z(ft,X)==="."&&(X=this.skip(j,X+1)),z(ft,X)==="e"||z(ft,X)==="E"){X++,(z(ft,X)==="+"||z(ft,X)==="-")&&X++;var st=X;if(X=this.skip(j,X),st===X)throw new S("Failed to parse number's exponent value at: "+X)}return this.node(N,_(G(ft,K,X)),K,X)},keyword:function(ft){var K=""+ft,X=this.index,st=X+K.length;if(G(this.source,X,st)!==K)throw new S("Failed to parse value at: "+X);return this.node(N,ft,X,st)},skip:function(ft,K){for(var X=this.source;K<X.length&&Y(ft,z(X,K));K++);return K},until:function(ft,K){K=this.skip(J,K);for(var X=z(this.source,K),st=0;st<ft.length;st++)if(ft[st]===X)return K;throw new S('Unexpected character: "'+X+'" at: '+K)}};var rt=b(function(){var ft="9007199254740993",K;return I(ft,function(X,st,bt){K=bt.source}),K!==ft}),lt=w&&!b(function(){return 1/I("-0 ")!==-1/0});r({target:"JSON",stat:!0,forced:rt},{parse:function(K,X){return lt&&!u(X)?I(K):F(K,X)}})}),9143:((n,t,e)=>{var r=e(4576),i=e(9504),s=e(3972),a=e(3463),o=e(9297),c=e(2804),u=e(944),h=e(5169),f=c.c2i,d=c.c2iUrl,p=r.SyntaxError,g=r.TypeError,y=i("".charAt),b=function(A,_){for(var S=A.length;_<S;_++){var I=y(A,_);if(I!==" "&&I!==" "&&I!==`
95
+ `&&I!=="\f"&&I!=="\r")break}return _},m=function(A,_,S){var I=A.length;I<4&&(A+=I===2?"AA":"A");var C=(_[y(A,0)]<<18)+(_[y(A,1)]<<12)+(_[y(A,2)]<<6)+_[y(A,3)],M=[C>>16&255,C>>8&255,C&255];if(I===2){if(S&&M[1]!==0)throw new p("Extra bits");return[M[0]]}if(I===3){if(S&&M[2]!==0)throw new p("Extra bits");return[M[0],M[1]]}return M},w=function(A,_,S){for(var I=_.length,C=0;C<I;C++)A[S+C]=_[C];return S+I};n.exports=function(A,_,S,I){a(A),s(_);var C=u(_)==="base64"?f:d,M=_?_.lastChunkHandling:void 0;if(M===void 0&&(M="loose"),M!=="loose"&&M!=="strict"&&M!=="stop-before-partial")throw new g("Incorrect `lastChunkHandling` option");S&&h(S.buffer);var z=A.length,G=S||[],Y=0,L=0,j="",q=0;if(I)for(;;){if(q=b(A,q),q===z){if(j.length>0){if(M==="stop-before-partial")break;if(M==="loose"){if(j.length===1)throw new p("Malformed padding: exactly one additional character");Y=w(G,m(j,C,!1),Y)}else throw new p("Missing padding")}L=z;break}var nt=y(A,q);if(++q,nt==="="){if(j.length<2)throw new p("Padding is too early");if(q=b(A,q),j.length===2){if(q===z){if(M==="stop-before-partial")break;throw new p("Malformed padding: only one =")}y(A,q)==="="&&(++q,q=b(A,q))}if(q<z)throw new p("Unexpected character after padding");Y=w(G,m(j,C,M==="strict"),Y),L=z;break}if(!o(C,nt))throw new p("Unexpected character");var J=I-Y;if(J===1&&j.length===2||J===2&&j.length===3||(j+=nt,j.length===4&&(Y=w(G,m(j,C,!1),Y),j="",L=q,Y===I)))break}return{bytes:G,read:L,written:Y}}}),9286:((n,t,e)=>{var r=e(4402),i=e(8469),s=r.Set,a=r.add;n.exports=function(o){var c=new s;return i(o,function(u){a(c,u)}),c}}),9297:((n,t,e)=>{var r=e(9504),i=e(8981),s=r({}.hasOwnProperty);n.exports=Object.hasOwn||function(o,c){return s(i(o),c)}}),9306:((n,t,e)=>{var r=e(4901),i=e(6823),s=TypeError;n.exports=function(a){if(r(a))return a;throw new s(i(a)+" is not a function")}}),9314:((n,t,e)=>{var r=e(6518),i=e(9565),s=e(8551),a=e(1767),o=e(4149),c=e(9590),u=e(9539),h=e(9462),f=e(684),d=e(4549),p=e(6395),g=!p&&!f("drop",0),y=!p&&!g&&d("drop",RangeError),b=p||g||y,m=h(function(){for(var w=this.iterator,A=this.next,_,S;this.remaining;)if(this.remaining--,_=s(i(A,w)),S=this.done=!!_.done,S)return;if(_=s(i(A,w)),S=this.done=!!_.done,!S)return _.value});r({target:"Iterator",proto:!0,real:!0,forced:b},{drop:function(A){s(this);var _;try{_=c(o(+A))}catch(S){u(this,"throw",S)}return y?i(y,this,_):new m(a(this),{remaining:_})}})}),9429:((n,t,e)=>{var r=e(4576),i=e(6193);n.exports=function(s){if(i){try{return r.process.getBuiltinModule(s)}catch{}try{return Function('return require("'+s+'")')()}catch{}}}}),9432:((n,t,e)=>{e(5213)}),9433:((n,t,e)=>{var r=e(4576),i=Object.defineProperty;n.exports=function(s,a){try{i(r,s,{value:a,configurable:!0,writable:!0})}catch{r[s]=a}return a}}),9462:((n,t,e)=>{var r=e(9565),i=e(2360),s=e(6699),a=e(6279),o=e(8227),c=e(1181),u=e(5966),h=e(7657).IteratorPrototype,f=e(2529),d=e(9539),p=e(1385),g=o("toStringTag"),y="IteratorHelper",b="WrapForValidIterator",m="normal",w="throw",A=c.set,_=function(C){var M=c.getterFor(C?b:y);return a(i(h),{next:function(){var G=M(this);if(C)return G.nextHandler();if(G.done)return f(void 0,!0);try{var Y=G.nextHandler();return G.returnHandlerResult?Y:f(Y,G.done)}catch(L){throw G.done=!0,L}},return:function(){var z=M(this),G=z.iterator;if(z.done=!0,C){var Y=u(G,"return");return Y?r(Y,G):f(void 0,!0)}if(z.inner)try{d(z.inner.iterator,m)}catch(L){return d(G,w,L)}if(z.openIters)try{p(z.openIters,m)}catch(L){return d(G,w,L)}return G&&d(G,m),f(void 0,!0)}})},S=_(!0),I=_(!1);s(I,g,"Iterator Helper"),n.exports=function(C,M,z){var G=function(L,j){j?(j.iterator=L.iterator,j.next=L.next):j=L,j.type=M?b:y,j.returnHandlerResult=!!z,j.nextHandler=C,j.counter=0,j.done=!1,A(this,j)};return G.prototype=M?S:I,G}}),9486:((n,t,e)=>{var r=e(6518),i=e(4576),s=e(9504),a=e(3972),o=e(4154),c=e(5169),u=e(2804),h=e(944),f=u.i2c,d=u.i2cUrl,p=s("".charAt),g=i.Uint8Array,y=!g||!g.prototype.toBase64||!(function(){try{var b=new g;b.toBase64(null)}catch{return!0}})();g&&r({target:"Uint8Array",proto:!0,forced:y},{toBase64:function(){var m=o(this),w=arguments.length?a(arguments[0]):void 0,A=h(w)==="base64"?f:d,_=!!w&&!!w.omitPadding;c(this.buffer);for(var S="",I=0,C=m.length,M,z=function(G){return p(A,M>>6*G&63)};I+2<C;I+=3)M=(m[I]<<16)+(m[I+1]<<8)+m[I+2],S+=z(3)+z(2)+z(1)+z(0);return I+2===C?(M=(m[I]<<16)+(m[I+1]<<8),S+=z(3)+z(2)+z(1)+(_?"":"=")):I+1===C&&(M=m[I]<<16,S+=z(3)+z(2)+(_?"":"==")),S}})}),9504:((n,t,e)=>{var r=e(616),i=Function.prototype,s=i.call,a=r&&i.bind.bind(s,s);n.exports=r?a:function(o){return function(){return s.apply(o,arguments)}}}),9519:((n,t,e)=>{var r=e(4576),i=e(2839),s=r.process,a=r.Deno,o=s&&s.versions||a&&a.version,c=o&&o.v8,u,h;c&&(u=c.split("."),h=u[0]>0&&u[0]<4?1:+(u[0]+u[1])),!h&&i&&(u=i.match(/Edge\/(\d+)/),(!u||u[1]>=74)&&(u=i.match(/Chrome\/(\d+)/),u&&(h=+u[1]))),n.exports=h}),9539:((n,t,e)=>{var r=e(9565),i=e(8551),s=e(5966);n.exports=function(a,o,c){var u,h;i(a);try{if(u=s(a,"return"),!u){if(o==="throw")throw c;return c}u=r(u,a)}catch(f){h=!0,u=f}if(o==="throw")throw c;if(h)throw u;return i(u),c}}),9565:((n,t,e)=>{var r=e(616),i=Function.prototype.call;n.exports=r?i.bind(i):function(){return i.apply(i,arguments)}}),9577:((n,t,e)=>{var r=e(9928),i=e(4644),s=e(1108),a=e(1291),o=e(5854),c=i.aTypedArray,u=i.getTypedArrayConstructor,h=i.exportTypedArrayMethod,f=(function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(p){return p===8}})(),d=f&&(function(){try{new Int8Array(1).with(-.5,1)}catch{return!0}})();h("with",function(p,g){var y=c(this),b=a(p),m=s(y)?o(g):+g;return r(y,u(y),b,m)},!f||d)}),9590:((n,t,e)=>{var r=e(1291),i=RangeError;n.exports=function(s){var a=r(s);if(a<0)throw new i("The argument can't be less than 0");return a}}),9617:((n,t,e)=>{var r=e(5397),i=e(5610),s=e(6198),a=function(o){return function(c,u,h){var f=r(c),d=s(f);if(d===0)return!o&&-1;var p=i(h,d),g;if(o&&u!==u){for(;d>p;)if(g=f[p++],g!==g)return!0}else for(;d>p;p++)if((o||p in f)&&f[p]===u)return o||p||0;return!o&&-1}};n.exports={includes:a(!0),indexOf:a(!1)}}),9631:((n,t,e)=>{e(9486)}),9797:((n,t,e)=>{e(4226)}),9835:(n=>{n.exports=function(t){try{var e=new Set,r={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}},i=e[t](r);return i.size===1&&i.values().next().value===4}catch{return!1}}}),9928:((n,t,e)=>{var r=e(6198),i=e(1291),s=RangeError;n.exports=function(a,o,c,u){var h=r(a),f=i(c),d=f<0?h+f:f;if(d>=h||d<0)throw new s("Incorrect index");for(var p=new o(h),g=0;g<h;g++)p[g]=g===d?u:a[g];return p}})},dV={};Me.d=(n,t)=>{for(var e in t)Me.o(t,e)&&!Me.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})};Me.o=(n,t)=>Object.prototype.hasOwnProperty.call(n,t);hAt=Me(4114),fAt=Me(6573),dAt=Me(8100),pAt=Me(7936),gAt=Me(8111),mAt=Me(8237),yAt=Me(1689),bAt=Me(9577),vAt=Me(4235),wAt=Me(9432),AAt=Me(1549),EAt=Me(9797),xAt=Me(9631),SAt=Me(5623),_At=Me(4979),TAt=Me(5781),Os=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),oF=[.001,0,0,.001,0,0],KR=1.35,_ht=.35,CAt=_ht/KR,$a={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Sh={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},W1="pdfjs_internal_editor_",Re={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},Je={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},NV={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},lF={TRIANGLES:1,LATTICE:2,PATCH:3},ci={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},$1={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},zn={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},bb={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},Yx={ERRORS:0,WARNINGS:1,INFOS:5},aw={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},g1={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},LV={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},OD=Yx.WARNINGS;qm=(function(){function t(e,r){this.message=e,this.name=r}return t.prototype=new Error,t.constructor=t,t})(),DI=class extends qm{constructor(t,e){super(t,"PasswordException"),this.code=e}},H1=class extends qm{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},ow=class extends qm{constructor(t){super(t,"InvalidPDFException")}},zm=class extends qm{constructor(t,e,r){super(t,"ResponseException"),this.status=e,this.missing=r}},cF=class extends qm{constructor(t){super(t,"FormatError")}},Nl=class extends qm{constructor(t){super(t,"AbortException")}};Pn=class{static get isLittleEndian(){return Te(this,"isLittleEndian",Dht())}static get isEvalSupported(){return Te(this,"isEvalSupported",Oht())}static get isOffscreenCanvasSupported(){return Te(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Te(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return Te(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return Te(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){let{platform:t,userAgent:e}=navigator;return Te(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){return Te(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}},eF=Array.from(Array(256).keys(),n=>n.toString(16).padStart(2,"0")),ie=class{static makeHexColor(t,e,r){return`#${eF[t]}${eF[e]}${eF[r]}`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,e){let r;t[0]?(t[0]<0&&(r=e[0],e[0]=e[2],e[2]=r),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(r=e[1],e[1]=e[3],e[3]=r),e[1]*=t[3],e[3]*=t[3]):(r=e[0],e[0]=e[1],e[1]=r,r=e[2],e[2]=e[3],e[3]=r,t[1]<0&&(r=e[1],e[1]=e[3],e[3]=r),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(r=e[0],e[0]=e[2],e[2]=r),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,r=0){let i=t[r],s=t[r+1];t[r]=i*e[0]+s*e[2]+e[4],t[r+1]=i*e[1]+s*e[3]+e[5]}static applyTransformToBezier(t,e,r=0){let i=e[0],s=e[1],a=e[2],o=e[3],c=e[4],u=e[5];for(let h=0;h<6;h+=2){let f=t[r+h],d=t[r+h+1];t[r+h]=f*i+d*a+c,t[r+h+1]=f*s+d*o+u}}static applyInverseTransform(t,e){let r=t[0],i=t[1],s=e[0]*e[3]-e[1]*e[2];t[0]=(r*e[3]-i*e[2]+e[2]*e[5]-e[4]*e[3])/s,t[1]=(-r*e[1]+i*e[0]+e[4]*e[1]-e[5]*e[0])/s}static axialAlignedBoundingBox(t,e,r){let i=e[0],s=e[1],a=e[2],o=e[3],c=e[4],u=e[5],h=t[0],f=t[1],d=t[2],p=t[3],g=i*h+c,y=g,b=i*d+c,m=b,w=o*f+u,A=w,_=o*p+u,S=_;if(s!==0||a!==0){let I=s*h,C=s*d,M=a*f,z=a*p;g+=M,m+=M,b+=z,y+=z,w+=I,S+=I,_+=C,A+=C}r[0]=Math.min(r[0],g,b,y,m),r[1]=Math.min(r[1],w,_,A,S),r[2]=Math.max(r[2],g,b,y,m),r[3]=Math.max(r[3],w,_,A,S)}static inverseTransform(t){let e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){let r=t[0],i=t[1],s=t[2],a=t[3],o=r**2+i**2,c=r*s+i*a,u=s**2+a**2,h=(o+u)/2,f=Math.sqrt(h**2-(o*u-c**2));e[0]=Math.sqrt(h+f||1),e[1]=Math.sqrt(h-f||1)}static normalizeRect(t){let e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){let r=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(r>i)return null;let s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>a?null:[r,s,i,a]}static pointBoundingBox(t,e,r){r[0]=Math.min(r[0],t),r[1]=Math.min(r[1],e),r[2]=Math.max(r[2],t),r[3]=Math.max(r[3],e)}static rectBoundingBox(t,e,r,i,s){s[0]=Math.min(s[0],t,r),s[1]=Math.min(s[1],e,i),s[2]=Math.max(s[2],t,r),s[3]=Math.max(s[3],e,i)}static bezierBoundingBox(t,e,r,i,s,a,o,c,u){u[0]=Math.min(u[0],t,o),u[1]=Math.min(u[1],e,c),u[2]=Math.max(u[2],t,o),u[3]=Math.max(u[3],e,c),R(this,_h,uF).call(this,t,r,s,o,e,i,a,c,3*(-t+3*(r-s)+o),6*(t-2*r+s),3*(r-t),u),R(this,_h,uF).call(this,t,r,s,o,e,i,a,c,3*(-e+3*(i-a)+c),6*(e-2*i+a),3*(i-e),u)}};_h=new WeakSet,ZR=function(t,e,r,i,s,a,o,c,u,h){if(u<=0||u>=1)return;let f=1-u,d=u*u,p=d*u,g=f*(f*(f*t+3*u*e)+3*d*r)+p*i,y=f*(f*(f*s+3*u*a)+3*d*o)+p*c;h[0]=Math.min(h[0],g),h[1]=Math.min(h[1],y),h[2]=Math.max(h[2],g),h[3]=Math.max(h[3],y)},uF=function(t,e,r,i,s,a,o,c,u,h,f,d){if(Math.abs(u)<1e-12){Math.abs(h)>=1e-12&&R(this,_h,ZR).call(this,t,e,r,i,s,a,o,c,-f/h,d);return}let p=h**2-4*f*u;if(p<0)return;let g=Math.sqrt(p),y=2*u;R(this,_h,ZR).call(this,t,e,r,i,s,a,o,c,(-h+g)/y,d),R(this,_h,ZR).call(this,t,e,r,i,s,a,o,c,(-h-g)/y,d)},T(ie,_h);rF=null,pV=null;Tb="pdfjs_internal_id_";typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(n){return n.reduce((t,e)=>t+e,0)});typeof AbortSignal.any!="function"&&(AbortSignal.any=function(n){let t=new AbortController,{signal:e}=t;for(let r of n)if(r.aborted)return t.abort(r.reason),e;for(let r of n)r.addEventListener("abort",()=>{t.abort(r.reason)},{signal:e});return e});RAt=Me(1701),IAt=Me(4603),DAt=Me(7566),OAt=Me(8721),G1=class n{static textContent(t){let e=[],r={items:e,styles:Object.create(null)};function i(s){if(!s)return;let a=null,o=s.name;if(o==="#text")a=s.value;else if(n.shouldBuildText(o))s?.attributes?.textContent?a=s.attributes.textContent:s.value&&(a=s.value);else return;if(a!==null&&e.push({str:a}),!!s.children)for(let c of s.children)i(c)}return i(t),r}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}},V1=class{static setupStorage(t,e,r,i,s){let a=i.getValue(e,{value:null});switch(r.name){case"textarea":if(a.value!==null&&(t.textContent=a.value),s==="print")break;t.addEventListener("input",o=>{i.setValue(e,{value:o.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(a.value===r.attributes.xfaOn?t.setAttribute("checked",!0):a.value===r.attributes.xfaOff&&t.removeAttribute("checked"),s==="print")break;t.addEventListener("change",o=>{i.setValue(e,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&t.setAttribute("value",a.value),s==="print")break;t.addEventListener("input",o=>{i.setValue(e,{value:o.target.value})})}break;case"select":if(a.value!==null){t.setAttribute("value",a.value);for(let o of r.children)o.attributes.value===a.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}t.addEventListener("input",o=>{let c=o.target.options,u=c.selectedIndex===-1?"":c[c.selectedIndex].value;i.setValue(e,{value:u})});break}}static setAttributes({html:t,element:e,storage:r=null,intent:i,linkService:s}){let{attributes:a}=e,o=t instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${i}`);for(let[c,u]of Object.entries(a))if(u!=null)switch(c){case"class":u.length&&t.setAttribute(c,u.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",u);break;case"style":Object.assign(t.style,u);break;case"textContent":t.textContent=u;break;default:(!o||c!=="href"&&c!=="newWindow")&&t.setAttribute(c,u)}o&&s.addLinkAttributes(t,a.href,a.newWindow),r&&a.dataId&&this.setupStorage(t,a.dataId,e,r)}static render(t){let e=t.annotationStorage,r=t.linkService,i=t.xfaHtml,s=t.intent||"display",a=document.createElement(i.name);i.attributes&&this.setAttributes({html:a,element:i,intent:s,linkService:r});let o=s!=="richText",c=t.div;if(c.append(a),t.viewport){let f=`matrix(${t.viewport.transform.join(",")})`;c.style.transform=f}o&&c.setAttribute("class","xfaLayer xfaFont");let u=[];if(i.children.length===0){if(i.value){let f=document.createTextNode(i.value);a.append(f),o&&G1.shouldBuildText(i.name)&&u.push(f)}return{textDivs:u}}let h=[[i,-1,a]];for(;h.length>0;){let[f,d,p]=h.at(-1);if(d+1===f.children.length){h.pop();continue}let g=f.children[++h.at(-1)[1]];if(g===null)continue;let{name:y}=g;if(y==="#text"){let m=document.createTextNode(g.value);u.push(m),p.append(m);continue}let b=g?.attributes?.xmlns?document.createElementNS(g.attributes.xmlns,y):document.createElement(y);if(p.append(b),g.attributes&&this.setAttributes({html:b,element:g,storage:e,intent:s,linkService:r}),g.children?.length>0)h.push([g,-1,b]);else if(g.value){let m=document.createTextNode(g.value);o&&G1.shouldBuildText(y)&&u.push(m),b.append(m)}}for(let f of c.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))f.setAttribute("readOnly",!0);return{textDivs:u}}static update(t){let e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}},Uu="http://www.w3.org/2000/svg",xg=class xg{};Lt(xg,"CSS",96),Lt(xg,"PDF",72),Lt(xg,"PDF_TO_CSS_UNITS",xg.CSS/xg.PDF);Rh=xg;X1=class n{constructor({viewBox:t,userUnit:e,scale:r,rotation:i,offsetX:s=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=t,this.userUnit=e,this.scale=r,this.rotation=i,this.offsetX=s,this.offsetY=a,r*=e;let c=(t[2]+t[0])/2,u=(t[3]+t[1])/2,h,f,d,p;switch(i%=360,i<0&&(i+=360),i){case 180:h=-1,f=0,d=0,p=1;break;case 90:h=0,f=1,d=1,p=0;break;case 270:h=0,f=-1,d=-1,p=0;break;case 0:h=1,f=0,d=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(d=-d,p=-p);let g,y,b,m;h===0?(g=Math.abs(u-t[1])*r+s,y=Math.abs(c-t[0])*r+a,b=(t[3]-t[1])*r,m=(t[2]-t[0])*r):(g=Math.abs(c-t[0])*r+s,y=Math.abs(u-t[1])*r+a,b=(t[2]-t[0])*r,m=(t[3]-t[1])*r),this.transform=[h*r,f*r,d*r,p*r,g-h*r*c-d*r*u,y-f*r*c-p*r*u],this.width=b,this.height=m}get rawDims(){let t=this.viewBox;return Te(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:s=!1}={}){return new n({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:s})}convertToViewportPoint(t,e){let r=[t,e];return ie.applyTransform(r,this.transform),r}convertToViewportRectangle(t){let e=[t[0],t[1]];ie.applyTransform(e,this.transform);let r=[t[2],t[3]];return ie.applyTransform(r,this.transform),[e[0],e[1],r[0],r[1]]}convertToPdfPoint(t,e){let r=[t,e];return ie.applyInverseTransform(r,this.transform),r}},lw=class extends qm{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}};OI=class{constructor(){Lt(this,"started",Object.create(null));Lt(this,"times",[])}time(t){t in this.started&&_e(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||_e(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){let t=[],e=0;for(let{name:r}of this.times)e=Math.max(r.length,e);for(let{name:r,start:i,end:s}of this.times)t.push(`${r.padEnd(e)} ${s-i}ms
96
+ `);return t.join("")}};Hm=class{static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;l(this,s2)||x(this,s2,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));let e=l(this,s2).exec(t);if(!e)return null;let r=parseInt(e[1],10),i=parseInt(e[2],10);i=i>=1&&i<=12?i-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let c=parseInt(e[6],10);c=c>=0&&c<=59?c:0;let u=e[7]||"Z",h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let f=parseInt(e[9],10)||0;return f=f>=0&&f<=59?f:0,u==="-"?(a+=h,o+=f):u==="+"&&(a-=h,o-=f),new Date(Date.UTC(r,i,s,a,o,c))}};s2=new WeakMap,T(Hm,s2);Uc=class n{constructor(){let{pixelRatio:t}=n;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,r,i,s=-1){let a=1/0,o=1/0,c=1/0;r=n.capPixels(r,s),r>0&&(a=Math.sqrt(r/(t*e))),i!==-1&&(o=i/t,c=i/e);let u=Math.min(a,o,c);return this.sx>u||this.sy>u?(this.sx=u,this.sy=u,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){let r=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,r):r}return t}},PI=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"],hF=class{static get isDarkMode(){return Te(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}},NI=class{static get commentForegroundColor(){let t=document.createElement("span");t.classList.add("comment","sidebar");let{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);let{color:r}=window.getComputedStyle(t);return t.remove(),Te(this,"commentForegroundColor",fw(r))}};bV=new Map;PAt=Me(4972),NAt=Me(4628),LAt=Me(7642),kAt=Me(8004),MAt=Me(3853),FAt=Me(5876),BAt=Me(2475),UAt=Me(5024),jAt=Me(1698),$At=Me(9314),HAt=Me(1148),zAt=Me(3579),WAt=Me(8335),Hu=class Hu{constructor(t){T(this,Vi);T(this,Kf,null);T(this,Zf,null);T(this,Do);T(this,Oo,null);T(this,a2,null);T(this,Jf,null);T(this,Lb,null);T(this,kb,null);x(this,Do,t),l(Hu,o2)||x(Hu,o2,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 t=x(this,Kf,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");let e=l(this,Do)._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",Ga,{signal:e}),t.addEventListener("pointerdown",R(Hu,fD,WV),{signal:e}));let r=x(this,Oo,document.createElement("div"));r.className="buttons",t.append(r);let i=l(this,Do).toolbarPosition;if(i){let{style:s}=t,a=l(this,Do)._uiManager.direction==="ltr"?1-i[0]:i[0];s.insetInlineEnd=`${100*a}%`,s.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return l(this,Kf)}hide(){l(this,Kf).classList.add("hidden"),l(this,Zf)?.hideDropdown()}show(){l(this,Kf).classList.remove("hidden"),l(this,a2)?.shown(),l(this,Jf)?.shown()}addDeleteButton(){let{editorType:t,_uiManager:e}=l(this,Do),r=document.createElement("button");r.classList.add("basic","deleteButton"),r.tabIndex=0,r.setAttribute("data-l10n-id",l(Hu,o2)[t]),R(this,Vi,vb).call(this,r)&&r.addEventListener("click",i=>{e.delete()},{signal:e._signal}),l(this,Oo).append(r)}async addAltText(t){let e=await t.render();R(this,Vi,vb).call(this,e),l(this,Oo).append(e,l(this,Vi,A1)),x(this,a2,t)}addComment(t,e=null){if(l(this,Jf))return;let r=t.renderForToolbar();if(!r)return;R(this,Vi,vb).call(this,r);let i=x(this,Lb,l(this,Vi,A1));e?(l(this,Oo).insertBefore(r,e),l(this,Oo).insertBefore(i,e)):l(this,Oo).append(r,i),x(this,Jf,t),t.toolbar=this}addColorPicker(t){if(l(this,Zf))return;x(this,Zf,t);let e=t.renderButton();R(this,Vi,vb).call(this,e),l(this,Oo).append(e,l(this,Vi,A1))}async addEditSignatureButton(t){let e=x(this,kb,await t.renderEditButton(l(this,Do)));R(this,Vi,vb).call(this,e),l(this,Oo).append(e,l(this,Vi,A1))}removeButton(t){switch(t){case"comment":l(this,Jf)?.removeToolbarCommentButton(),x(this,Jf,null),l(this,Lb)?.remove(),x(this,Lb,null);break}}async addButton(t,e){switch(t){case"colorPicker":e&&this.addColorPicker(e);break;case"altText":e&&await this.addAltText(e);break;case"editSignature":e&&await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":e&&this.addComment(e);break}}async addButtonBefore(t,e,r){if(!e&&t==="comment")return;let i=l(this,Oo).querySelector(r);i&&t==="comment"&&this.addComment(e,i)}updateEditSignatureButton(t){l(this,kb)&&(l(this,kb).title=t)}remove(){l(this,Kf).remove(),l(this,Zf)?.destroy(),x(this,Zf,null)}};Kf=new WeakMap,Zf=new WeakMap,Do=new WeakMap,Oo=new WeakMap,a2=new WeakMap,Jf=new WeakMap,Lb=new WeakMap,kb=new WeakMap,o2=new WeakMap,fD=new WeakSet,WV=function(t){t.stopPropagation()},Vi=new WeakSet,GV=function(t){l(this,Do)._focusEventsAllowed=!1,mn(t)},VV=function(t){l(this,Do)._focusEventsAllowed=!0,mn(t)},vb=function(t){let e=l(this,Do)._uiManager._signal;return!(e instanceof AbortSignal)||e.aborted?!1:(t.addEventListener("focusin",R(this,Vi,GV).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",R(this,Vi,VV).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",Ga,{signal:e}),!0)},A1=function(){let t=document.createElement("div");return t.className="divider",t},T(Hu,fD),T(Hu,o2,null);dF=Hu,pF=class{constructor(t){T(this,Dh);T(this,l2,null);T(this,Cg,null);T(this,Wu);x(this,Wu,t)}show(t,e,r){let[i,s]=R(this,Dh,qV).call(this,e,r),{style:a}=l(this,Cg)||x(this,Cg,R(this,Dh,XV).call(this));t.append(l(this,Cg)),a.insetInlineEnd=`${100*i}%`,a.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){l(this,Cg).remove()}};l2=new WeakMap,Cg=new WeakMap,Wu=new WeakMap,Dh=new WeakSet,XV=function(){let t=x(this,Cg,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");let e=l(this,Wu)._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",Ga,{signal:e});let r=x(this,l2,document.createElement("div"));return r.className="buttons",t.append(r),l(this,Wu).hasCommentManager()&&R(this,Dh,gF).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{l(this,Wu).commentSelection("floating_button")}),R(this,Dh,gF).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{l(this,Wu).highlightSelection("floating_button")}),t},qV=function(t,e){let r=0,i=0;for(let s of t){let a=s.y+s.height;if(a<r)continue;let o=s.x+(e?s.width:0);if(a>r){i=o,r=a;continue}e?o>i&&(i=o):o<i&&(i=o)}return[e?1-i:i,r]},gF=function(t,e,r,i){let s=document.createElement("button");s.classList.add("basic",t),s.tabIndex=0,s.setAttribute("data-l10n-id",e);let a=document.createElement("span");s.append(a),a.className="visuallyHidden",a.setAttribute("data-l10n-id",r);let o=l(this,Wu)._signal;o instanceof AbortSignal&&!o.aborted&&(s.addEventListener("contextmenu",Ga,{signal:o}),s.addEventListener("click",i,{signal:o})),l(this,l2).append(s)};Tr=class Tr{static initializeAndAddPointerId(t){(l(Tr,Ig)||x(Tr,Ig,new Set)).add(t)}static setPointer(t,e){l(Tr,Rg)||x(Tr,Rg,e),l(Tr,Dg)??x(Tr,Dg,t)}static setTimeStamp(t){x(Tr,Mb,t)}static isSamePointerId(t){return l(Tr,Rg)===t}static isSamePointerIdOrRemove(t){return l(Tr,Rg)===t?!0:(l(Tr,Ig)?.delete(t),!1)}static isSamePointerType(t){return l(Tr,Dg)===t}static isInitializedAndDifferentPointerType(t){return l(Tr,Dg)!==null&&!Tr.isSamePointerType(t)}static isSameTimeStamp(t){return l(Tr,Mb)===t}static isUsingMultiplePointers(){return l(Tr,Ig)?.size>=1}static clearPointerType(){x(Tr,Dg,null)}static clearPointerIds(){x(Tr,Rg,NaN),x(Tr,Ig,null)}static clearTimeStamp(){x(Tr,Mb,NaN)}};Rg=new WeakMap,Ig=new WeakMap,Mb=new WeakMap,Dg=new WeakMap,T(Tr,Rg,NaN),T(Tr,Ig,null),T(Tr,Mb,NaN),T(Tr,Dg,null);os=Tr,mF=class{constructor(){T(this,dD,0)}get id(){return`${W1}${ze(this,dD)._++}`}};dD=new WeakMap;H3=class H3{constructor(){T(this,Bb);T(this,Fb,U3());T(this,c2,0);T(this,ls,null)}static get _isSVGFittingCanvas(){let t='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>',r=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=t;let s=i.decode().then(()=>(r.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(r.getImageData(0,0,1,1).data.buffer)[0]===0));return Te(this,"_isSVGFittingCanvas",s)}async getFromFile(t){let{lastModified:e,name:r,size:i,type:s}=t;return R(this,Bb,JR).call(this,`${e}_${r}_${i}_${s}`,t)}async getFromUrl(t){return R(this,Bb,JR).call(this,t,t)}async getFromBlob(t,e){let r=await e;return R(this,Bb,JR).call(this,t,r)}async getFromId(t){l(this,ls)||x(this,ls,new Map);let e=l(this,ls).get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){let{blobPromise:r}=e;return delete e.blobPromise,this.getFromBlob(e.id,r)}return this.getFromUrl(e.url)}getFromCanvas(t,e){l(this,ls)||x(this,ls,new Map);let r=l(this,ls).get(t);if(r?.bitmap)return r.refCounter+=1,r;let i=new OffscreenCanvas(e.width,e.height);return i.getContext("2d").drawImage(e,0,0),r={bitmap:i.transferToImageBitmap(),id:`image_${l(this,Fb)}_${ze(this,c2)._++}`,refCounter:1,isSvg:!1},l(this,ls).set(t,r),l(this,ls).set(r.id,r),r}getSvgUrl(t){let e=l(this,ls).get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){l(this,ls)||x(this,ls,new Map);let e=l(this,ls).get(t);if(!e||(e.refCounter-=1,e.refCounter!==0))return;let{bitmap:r}=e;if(!e.url&&!e.file){let i=new OffscreenCanvas(r.width,r.height);i.getContext("bitmaprenderer").transferFromImageBitmap(r),e.blobPromise=i.convertToBlob()}r.close?.(),e.bitmap=null}isValidId(t){return t.startsWith(`image_${l(this,Fb)}_`)}};Fb=new WeakMap,c2=new WeakMap,ls=new WeakMap,Bb=new WeakSet,JR=async function(t,e){l(this,ls)||x(this,ls,new Map);let r=l(this,ls).get(t);if(r===null)return null;if(r?.bitmap)return r.refCounter+=1,r;try{r||(r={bitmap:null,id:`image_${l(this,Fb)}_${ze(this,c2)._++}`,refCounter:0,isSvg:!1});let i;if(typeof e=="string"?(r.url=e,i=await hw(e,"blob")):e instanceof File?i=r.file=e:e instanceof Blob&&(i=e),i.type==="image/svg+xml"){let s=H3._isSVGFittingCanvas,a=new FileReader,o=new Image,c=new Promise((u,h)=>{o.onload=()=>{r.bitmap=o,r.isSvg=!0,u()},a.onload=async()=>{let f=r.svgUrl=a.result;o.src=await s?`${f}#svgView(preserveAspectRatio(none))`:f},o.onerror=a.onerror=h});a.readAsDataURL(i),await c}else r.bitmap=await createImageBitmap(i);r.refCounter=1}catch(i){_e(i),r=null}return l(this,ls).set(t,r),r&&l(this,ls).set(r.id,r),r};yF=H3,bF=class{constructor(t=128){T(this,Wn,[]);T(this,Qf,!1);T(this,u2);T(this,pn,-1);x(this,u2,t)}add({cmd:t,undo:e,post:r,mustExec:i,type:s=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(i&&t(),l(this,Qf))return;let c={cmd:t,undo:e,post:r,type:s};if(l(this,pn)===-1){l(this,Wn).length>0&&(l(this,Wn).length=0),x(this,pn,0),l(this,Wn).push(c);return}if(a&&l(this,Wn)[l(this,pn)].type===s){o&&(c.undo=l(this,Wn)[l(this,pn)].undo),l(this,Wn)[l(this,pn)]=c;return}let u=l(this,pn)+1;u===l(this,u2)?l(this,Wn).splice(0,1):(x(this,pn,u),u<l(this,Wn).length&&l(this,Wn).splice(u)),l(this,Wn).push(c)}undo(){if(l(this,pn)===-1)return;x(this,Qf,!0);let{undo:t,post:e}=l(this,Wn)[l(this,pn)];t(),e?.(),x(this,Qf,!1),x(this,pn,l(this,pn)-1)}redo(){if(l(this,pn)<l(this,Wn).length-1){x(this,pn,l(this,pn)+1),x(this,Qf,!0);let{cmd:t,post:e}=l(this,Wn)[l(this,pn)];t(),e?.(),x(this,Qf,!1)}}hasSomethingToUndo(){return l(this,pn)!==-1}hasSomethingToRedo(){return l(this,pn)<l(this,Wn).length-1}cleanType(t){if(l(this,pn)!==-1){for(let e=l(this,pn);e>=0;e--)if(l(this,Wn)[e].type!==t){l(this,Wn).splice(e+1,l(this,pn)-e),x(this,pn,e);return}l(this,Wn).length=0,x(this,pn,-1)}}destroy(){x(this,Wn,null)}};Wn=new WeakMap,Qf=new WeakMap,u2=new WeakMap,pn=new WeakMap;Wm=class{constructor(t){T(this,pD);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:e}=Pn.platform;for(let[r,i,s={}]of t)for(let a of r){let o=a.startsWith("mac+");e&&o?(this.callbacks.set(a.slice(4),{callback:i,options:s}),this.allKeys.add(a.split("+").at(-1))):!e&&!o&&(this.callbacks.set(a,{callback:i,options:s}),this.allKeys.add(a.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;let r=this.callbacks.get(R(this,pD,KV).call(this,e));if(!r)return;let{callback:i,options:{bubbles:s=!1,args:a=[],checker:o=null}}=r;o&&!o(t,e)||(i.bind(t,...a,e)(),s||mn(e))}};pD=new WeakSet,KV=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);let e=this.buffer.join("+");return this.buffer.length=0,e};gD=class gD{get _colors(){let t=new Map([["CanvasText",null],["Canvas",null]]);return Mht(t),Te(this,"_colors",t)}convert(t){let e=fw(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(let[r,i]of this._colors)if(i.every((s,a)=>s===e[a]))return gD._colorsMapping.get(r);return e}getHexCode(t){let e=this._colors.get(t);return e?ie.makeHexColor(...e):t}};Lt(gD,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));vF=gD,Ib=class Ib{constructor(t,e,r,i,s,a,o,c,u,h,f,d,p,g,y,b){T(this,re);T(this,Ub,new AbortController);T(this,Ea,null);T(this,jb,null);T(this,Cn,new Map);T(this,hi,new Map);T(this,$b,null);T(this,Po,null);T(this,Hb,null);T(this,No,new bF);T(this,cs,null);T(this,td,null);T(this,ed,null);T(this,zb,0);T(this,rd,new Set);T(this,yc,null);T(this,Lo,null);T(this,Og,new Set);Lt(this,"_editorUndoBar",null);T(this,h2,!1);T(this,f2,!1);T(this,Wb,!1);T(this,d2,null);T(this,bc,null);T(this,nd,null);T(this,Gb,null);T(this,id,!1);T(this,vc,null);T(this,mD,new mF);T(this,sd,!1);T(this,Vb,!1);T(this,p2,!1);T(this,ad,null);T(this,Pg,null);T(this,Xb,null);T(this,od,null);T(this,g2,null);T(this,Zn,Re.NONE);T(this,wr,new Set);T(this,Gu,null);T(this,ld,null);T(this,cd,null);T(this,m2,null);T(this,qb,null);T(this,y2,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});T(this,ud,[0,0]);T(this,wc,null);T(this,Vu,null);T(this,b2,null);T(this,v2,null);T(this,ko,null);let m=this._signal=l(this,Ub).signal;x(this,Vu,t),x(this,b2,e),x(this,v2,r),x(this,$b,i),x(this,cs,s),x(this,ld,a),x(this,qb,c),this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:m}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:m}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:m}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:m}),o._on("setpreference",this.onSetPreference.bind(this),{signal:m}),o._on("switchannotationeditorparams",w=>this.updateParams(w.type,w.value),{signal:m}),window.addEventListener("pointerdown",()=>{x(this,Vb,!0)},{capture:!0,signal:m}),window.addEventListener("pointerup",()=>{x(this,Vb,!1)},{capture:!0,signal:m}),R(this,re,QV).call(this),R(this,re,sX).call(this),R(this,re,AF).call(this),x(this,Po,c.annotationStorage),x(this,d2,c.filterFactory),x(this,cd,u),x(this,Gb,h||null),x(this,h2,f),x(this,f2,d),x(this,Wb,p),x(this,g2,g||null),this.viewParameters={realScale:Rh.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=y||null,this._supportsPinchToZoom=b!==!1,s?.setSidebarUiManager(this)}static get _keyboardManager(){let t=Ib.prototype,e=a=>l(a,Vu).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),r=(a,{target:o})=>{if(o instanceof HTMLInputElement){let{type:c}=o;return c!=="text"&&c!=="number"}return!0},i=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return Te(this,"_keyboardManager",new Wm([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],t.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:r}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&l(a,Vu).contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&l(a,Vu).contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}]]))}destroy(){l(this,ko)?.resolve(),x(this,ko,null),l(this,Ub)?.abort(),x(this,Ub,null),this._signal=null;for(let t of l(this,hi).values())t.destroy();l(this,hi).clear(),l(this,Cn).clear(),l(this,Og).clear(),l(this,od)?.clear(),x(this,Ea,null),l(this,wr).clear(),l(this,No).destroy(),l(this,$b)?.destroy(),l(this,cs)?.destroy(),l(this,ld)?.destroy(),l(this,vc)?.hide(),x(this,vc,null),l(this,Xb)?.destroy(),x(this,Xb,null),x(this,jb,null),l(this,bc)&&(clearTimeout(l(this,bc)),x(this,bc,null)),l(this,wc)&&(clearTimeout(l(this,wc)),x(this,wc,null)),this._editorUndoBar?.destroy(),x(this,qb,null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return l(this,g2)}get useNewAltTextFlow(){return l(this,f2)}get useNewAltTextWhenAddingImage(){return l(this,Wb)}get hcmFilter(){return Te(this,"hcmFilter",l(this,cd)?l(this,d2).addHCMFilter(l(this,cd).foreground,l(this,cd).background):"none")}get direction(){return Te(this,"direction",getComputedStyle(l(this,Vu)).direction)}get _highlightColors(){return Te(this,"_highlightColors",l(this,Gb)?new Map(l(this,Gb).split(",").map(t=>(t=t.split("=").map(e=>e.trim()),t[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){let{_highlightColors:t}=this;if(!t)return Te(this,"highlightColors",null);let e=new Map,r=!!l(this,cd);for(let[i,s]of t){let a=i.endsWith("_HCM");if(r&&a){e.set(i.replace("_HCM",""),s);continue}!r&&!a&&e.set(i,s)}return Te(this,"highlightColors",e)}get highlightColorNames(){return Te(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;let e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),x(this,ed,t)}setMainHighlightColorPicker(t){x(this,Xb,t)}editAltText(t,e=!1){l(this,$b)?.editAltText(this,t,e)}hasCommentManager(){return!!l(this,cs)}editComment(t,e,r,i){l(this,cs)?.showDialog(this,t,e,r,i)}selectComment(t,e){l(this,hi).get(t)?.getEditorByUID(e)?.toggleComment(!0,!0)}updateComment(t){l(this,cs)?.updateComment(t.getData())}updatePopupColor(t){l(this,cs)?.updatePopupColor(t)}removeComment(t){l(this,cs)?.removeComments([t.uid])}toggleComment(t,e,r=void 0){l(this,cs)?.toggleCommentPopup(t,e,r)}makeCommentColor(t,e){return t&&l(this,cs)?.makeCommentColor(t,e)||null}getCommentDialogElement(){return l(this,cs)?.dialogElement||null}async waitForEditorsRendered(t){if(l(this,hi).has(t-1))return;let{resolve:e,promise:r}=Promise.withResolvers(),i=s=>{s.pageNumber===t&&(this._eventBus._off("editorsrendered",i),e())};this._eventBus.on("editorsrendered",i),await r}getSignature(t){l(this,ld)?.getSignature({uiManager:this,editor:t})}get signatureManager(){return l(this,ld)}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){switch(t){case"enableNewAltTextWhenAddingImage":x(this,Wb,e);break}}onPageChanging({pageNumber:t}){x(this,zb,t-1)}focusMainContainer(){l(this,Vu).focus()}findParent(t,e){for(let r of l(this,hi).values()){let{x:i,y:s,width:a,height:o}=r.div.getBoundingClientRect();if(t>=i&&t<=i+a&&e>=s&&e<=s+o)return r}return null}disableUserSelect(t=!1){l(this,b2).classList.toggle("noUserSelect",t)}addShouldRescale(t){l(this,Og).add(t)}removeShouldRescale(t){l(this,Og).delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*Rh.PDF_TO_CSS_UNITS;for(let e of l(this,Og))e.onScaleChanging();l(this,ed)?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t="",e=!1){let r=document.getSelection();if(!r||r.isCollapsed)return;let{anchorNode:i,anchorOffset:s,focusNode:a,focusOffset:o}=r,c=r.toString(),h=R(this,re,QR).call(this,r).closest(".textLayer"),f=this.getSelectionBoxes(h);if(!f)return;r.empty();let d=R(this,re,wF).call(this,h),p=l(this,Zn)===Re.NONE,g=()=>{let y=d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:f,anchorNode:i,anchorOffset:s,focusNode:a,focusOffset:o,text:c});p&&this.showAllEditors("highlight",!0,!0),e&&y?.editComment()};if(p){this.switchToMode(Re.HIGHLIGHT,g);return}g()}commentSelection(t=""){this.highlightSelection(t,!0)}getAndRemoveDataFromAnnotationStorage(t){if(!l(this,Po))return null;let e=`${W1}${t}`,r=l(this,Po).getRawValue(e);return r&&l(this,Po).remove(e),r}addToAnnotationStorage(t){!t.isEmpty()&&l(this,Po)&&!l(this,Po).has(t.id)&&l(this,Po).setValue(t.id,t)}a11yAlert(t,e=null){let r=l(this,v2);r&&(r.setAttribute("data-l10n-id",t),e?r.setAttribute("data-l10n-args",JSON.stringify(e)):r.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,l(this,id)&&(x(this,id,!1),R(this,re,E1).call(this,"main_toolbar")),!this.hasSelection)return;let{activeElement:t}=document;for(let e of l(this,wr))if(e.div.contains(t)){x(this,Pg,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!l(this,Pg))return;let[t,e]=l(this,Pg);x(this,Pg,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){R(this,re,AF).call(this),this.setEditingState(!0)}removeEditListeners(){R(this,re,rX).call(this),this.setEditingState(!1)}dragOver(t){for(let{type:e}of t.dataTransfer.items)for(let r of l(this,Lo))if(r.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(let e of t.dataTransfer.items)for(let r of l(this,Lo))if(r.isHandlingMimeForPasting(e.type)){r.paste(e,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),l(this,Ea)?.commitOrRemove(),!this.hasSelection)return;let e=[];for(let r of l(this,wr)){let i=r.serialize(!0);i&&e.push(i)}e.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();let{clipboardData:e}=t;for(let s of e.items)for(let a of l(this,Lo))if(a.isHandlingMimeForPasting(s.type)){a.paste(s,this.currentLayer);return}let r=e.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(s){_e(`paste: "${s.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();let i=this.currentLayer;try{let s=[];for(let c of r){let u=await i.deserialize(c);if(!u)return;s.push(u)}let a=()=>{for(let c of s)R(this,re,EF).call(this,c);R(this,re,xF).call(this,s)},o=()=>{for(let c of s)c.remove()};this.addCommands({cmd:a,undo:o,mustExec:!0})}catch(s){_e(`paste: "${s.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),l(this,Zn)!==Re.NONE&&!this.isEditorHandlingKeyboard&&Ib._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,l(this,id)&&(x(this,id,!1),R(this,re,E1).call(this,"main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}setEditingState(t){t?(R(this,re,tX).call(this),R(this,re,nX).call(this),R(this,re,Ts).call(this,{isEditing:l(this,Zn)!==Re.NONE,isEmpty:R(this,re,x1).call(this),hasSomethingToUndo:l(this,No).hasSomethingToUndo(),hasSomethingToRedo:l(this,No).hasSomethingToRedo(),hasSelectedEditor:!1})):(R(this,re,eX).call(this),R(this,re,iX).call(this),R(this,re,Ts).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!l(this,Lo)){x(this,Lo,t);for(let e of l(this,Lo))R(this,re,ju).call(this,e.defaultPropertiesToUpdate)}}getId(){return l(this,mD).id}get currentLayer(){return l(this,hi).get(l(this,zb))}getLayer(t){return l(this,hi).get(t)}get currentPageIndex(){return l(this,zb)}addLayer(t){l(this,hi).set(t.pageIndex,t),l(this,sd)?t.enable():t.disable()}removeLayer(t){l(this,hi).delete(t.pageIndex)}async updateMode(t,e=null,r=!1,i=!1,s=!1,a=!1){if(l(this,Zn)!==t&&!(l(this,ko)&&(await l(this,ko).promise,!l(this,ko)))){if(x(this,ko,Promise.withResolvers()),l(this,ed)?.commitOrRemove(),l(this,Zn)===Re.POPUP&&l(this,cs)?.hideSidebar(),l(this,cs)?.destroyPopup(),x(this,Zn,t),t===Re.NONE){this.setEditingState(!1),R(this,re,oX).call(this);for(let o of l(this,Cn).values())o.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),l(this,ko).resolve();return}for(let o of l(this,Cn).values())o.addStandaloneCommentButton();t===Re.SIGNATURE&&await l(this,ld)?.loadSignatures(),r&&os.clearPointerType(),this.setEditingState(!0),await R(this,re,aX).call(this),this.unselectAll();for(let o of l(this,hi).values())o.updateMode(t);if(t===Re.POPUP){l(this,jb)||x(this,jb,await l(this,qb).getAnnotationsByType(new Set(l(this,Lo).map(u=>u._editorType))));let o=new Set,c=[];for(let u of l(this,Cn).values()){let{annotationElementId:h,hasComment:f,deleted:d}=u;h&&o.add(h),f&&!d&&c.push(u.getData())}for(let u of l(this,jb)){let{id:h,popupRef:f,contentsObj:d}=u;f&&d?.str&&!o.has(h)&&!l(this,rd).has(h)&&c.push(u)}l(this,cs)?.showSidebar(c)}if(!e){i&&this.addNewEditorFromKeyboard(),l(this,ko).resolve();return}for(let o of l(this,Cn).values())o.uid===e?(this.setSelected(o),a?o.editComment():s?o.enterInEditMode():o.focus()):o.unselect();l(this,ko).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==l(this,Zn)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(l(this,Lo)){switch(t){case Je.CREATE:this.currentLayer.addNewEditor(e);return;case Je.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(l(this,m2)||x(this,m2,new Map)).set(t,e),this.showAllEditors("highlight",e);break}if(this.hasSelection)for(let r of l(this,wr))r.updateParams(t,e);else for(let r of l(this,Lo))r.updateDefaultParams(t,e)}}showAllEditors(t,e,r=!1){for(let s of l(this,Cn).values())s.editorType===t&&s.show(e);(l(this,m2)?.get(Je.HIGHLIGHT_SHOW_ALL)??!0)!==e&&R(this,re,ju).call(this,[[Je.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(l(this,p2)!==t){x(this,p2,t);for(let e of l(this,hi).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}*getEditors(t){for(let e of l(this,Cn).values())e.pageIndex===t&&(yield e)}getEditor(t){return l(this,Cn).get(t)}addEditor(t){l(this,Cn).set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(l(this,bc)&&clearTimeout(l(this,bc)),x(this,bc,setTimeout(()=>{this.focusMainContainer(),x(this,bc,null)},0))),l(this,Cn).delete(t.id),t.annotationElementId&&l(this,od)?.delete(t.annotationElementId),this.unselect(t),(!t.annotationElementId||!l(this,rd).has(t.annotationElementId))&&l(this,Po)?.remove(t.id)}addDeletedAnnotationElement(t){l(this,rd).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return l(this,rd).has(t)}removeDeletedAnnotationElement(t){l(this,rd).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){l(this,Ea)!==t&&(x(this,Ea,t),t&&R(this,re,ju).call(this,t.propertiesToUpdate))}updateUI(t){l(this,re,lX)===t&&R(this,re,ju).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){R(this,re,ju).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(l(this,wr).has(t)){l(this,wr).delete(t),t.unselect(),R(this,re,Ts).call(this,{hasSelectedEditor:this.hasSelection});return}l(this,wr).add(t),t.select(),R(this,re,ju).call(this,t.propertiesToUpdate),R(this,re,Ts).call(this,{hasSelectedEditor:!0})}setSelected(t){this.updateToolbar({mode:t.mode,editId:t.uid}),l(this,ed)?.commitOrRemove();for(let e of l(this,wr))e!==t&&e.unselect();l(this,wr).clear(),l(this,wr).add(t),t.select(),R(this,re,ju).call(this,t.propertiesToUpdate),R(this,re,Ts).call(this,{hasSelectedEditor:!0})}isSelected(t){return l(this,wr).has(t)}get firstSelectedEditor(){return l(this,wr).values().next().value}unselect(t){t.unselect(),l(this,wr).delete(t),R(this,re,Ts).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return l(this,wr).size!==0}get isEnterHandled(){return l(this,wr).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){l(this,No).undo(),R(this,re,Ts).call(this,{hasSomethingToUndo:l(this,No).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:R(this,re,x1).call(this)}),this._editorUndoBar?.hide()}redo(){l(this,No).redo(),R(this,re,Ts).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:l(this,No).hasSomethingToRedo(),isEmpty:R(this,re,x1).call(this)})}addCommands(t){l(this,No).add(t),R(this,re,Ts).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:R(this,re,x1).call(this)})}cleanUndoStack(t){l(this,No).cleanType(t)}delete(){this.commitOrRemove();let t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;let e=t?[t]:[...l(this,wr)],r=()=>{this._editorUndoBar?.show(i,e.length===1?e[0].editorType:e.length);for(let s of e)s.remove()},i=()=>{for(let s of e)R(this,re,EF).call(this,s)};this.addCommands({cmd:r,undo:i,mustExec:!0})}commitOrRemove(){l(this,Ea)?.commitOrRemove()}hasSomethingToControl(){return l(this,Ea)||this.hasSelection}selectAll(){for(let t of l(this,wr))t.commit();R(this,re,xF).call(this,l(this,Cn).values())}unselectAll(){if(!(l(this,Ea)&&(l(this,Ea).commitOrRemove(),l(this,Zn)!==Re.NONE))&&!l(this,ed)?.commitOrRemove()&&this.hasSelection){for(let t of l(this,wr))t.unselect();l(this,wr).clear(),R(this,re,Ts).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;l(this,ud)[0]+=t,l(this,ud)[1]+=e;let[i,s]=l(this,ud),a=[...l(this,wr)],o=1e3;l(this,wc)&&clearTimeout(l(this,wc)),x(this,wc,setTimeout(()=>{x(this,wc,null),l(this,ud)[0]=l(this,ud)[1]=0,this.addCommands({cmd:()=>{for(let c of a)l(this,Cn).has(c.id)&&(c.translateInPage(i,s),c.translationDone())},undo:()=>{for(let c of a)l(this,Cn).has(c.id)&&(c.translateInPage(-i,-s),c.translationDone())},mustExec:!1})},o));for(let c of a)c.translateInPage(t,e),c.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),x(this,yc,new Map);for(let t of l(this,wr))l(this,yc).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!l(this,yc))return!1;this.disableUserSelect(!1);let t=l(this,yc);x(this,yc,null);let e=!1;for(let[{x:i,y:s,pageIndex:a},o]of t)o.newX=i,o.newY=s,o.newPageIndex=a,e||(e=i!==o.savedX||s!==o.savedY||a!==o.savedPageIndex);if(!e)return!1;let r=(i,s,a,o)=>{if(l(this,Cn).has(i.id)){let c=l(this,hi).get(o);c?i._setParentAndPosition(c,s,a):(i.pageIndex=o,i.x=s,i.y=a)}};return this.addCommands({cmd:()=>{for(let[i,{newX:s,newY:a,newPageIndex:o}]of t)r(i,s,a,o)},undo:()=>{for(let[i,{savedX:s,savedY:a,savedPageIndex:o}]of t)r(i,s,a,o)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(l(this,yc))for(let r of l(this,yc).keys())r.drag(t,e)}rebuild(t){if(t.parent===null){let e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||l(this,wr).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return l(this,Ea)===t}getActive(){return l(this,Ea)}getMode(){return l(this,Zn)}isEditingMode(){return l(this,Zn)!==Re.NONE}get imageManager(){return Te(this,"imageManager",new yF)}getSelectionBoxes(t){if(!t)return null;let e=document.getSelection();for(let u=0,h=e.rangeCount;u<h;u++)if(!t.contains(e.getRangeAt(u).commonAncestorContainer))return null;let{x:r,y:i,width:s,height:a}=t.getBoundingClientRect(),o;switch(t.getAttribute("data-main-rotation")){case"90":o=(u,h,f,d)=>({x:(h-i)/a,y:1-(u+f-r)/s,width:d/a,height:f/s});break;case"180":o=(u,h,f,d)=>({x:1-(u+f-r)/s,y:1-(h+d-i)/a,width:f/s,height:d/a});break;case"270":o=(u,h,f,d)=>({x:1-(h+d-i)/a,y:(u-r)/s,width:d/a,height:f/s});break;default:o=(u,h,f,d)=>({x:(u-r)/s,y:(h-i)/a,width:f/s,height:d/a});break}let c=[];for(let u=0,h=e.rangeCount;u<h;u++){let f=e.getRangeAt(u);if(!f.collapsed)for(let{x:d,y:p,width:g,height:y}of f.getClientRects())g===0||y===0||c.push(o(d,p,g,y))}return c.length===0?null:c}addChangedExistingAnnotation({annotationElementId:t,id:e}){(l(this,Hb)||x(this,Hb,new Map)).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){l(this,Hb)?.delete(t)}renderAnnotationElement(t){let e=l(this,Hb)?.get(t.data.id);if(!e)return;let r=l(this,Po).getRawValue(e);r&&(l(this,Zn)===Re.NONE&&!r.hasBeenModified||r.renderAnnotationElement(t))}setMissingCanvas(t,e,r){let i=l(this,od)?.get(t);i&&(i.setCanvas(e,r),l(this,od).delete(t))}addMissingCanvas(t,e){(l(this,od)||x(this,od,new Map)).set(t,e)}};Ub=new WeakMap,Ea=new WeakMap,jb=new WeakMap,Cn=new WeakMap,hi=new WeakMap,$b=new WeakMap,Po=new WeakMap,Hb=new WeakMap,No=new WeakMap,cs=new WeakMap,td=new WeakMap,ed=new WeakMap,zb=new WeakMap,rd=new WeakMap,yc=new WeakMap,Lo=new WeakMap,Og=new WeakMap,h2=new WeakMap,f2=new WeakMap,Wb=new WeakMap,d2=new WeakMap,bc=new WeakMap,nd=new WeakMap,Gb=new WeakMap,id=new WeakMap,vc=new WeakMap,mD=new WeakMap,sd=new WeakMap,Vb=new WeakMap,p2=new WeakMap,ad=new WeakMap,Pg=new WeakMap,Xb=new WeakMap,od=new WeakMap,g2=new WeakMap,Zn=new WeakMap,wr=new WeakMap,Gu=new WeakMap,ld=new WeakMap,cd=new WeakMap,m2=new WeakMap,qb=new WeakMap,y2=new WeakMap,ud=new WeakMap,wc=new WeakMap,Vu=new WeakMap,b2=new WeakMap,v2=new WeakMap,ko=new WeakMap,re=new WeakSet,QR=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},wF=function(t){let{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(let r of l(this,hi).values())if(r.hasTextLayer(t))return r;return null},ZV=function(){let t=document.getSelection();if(!t||t.isCollapsed)return;let r=R(this,re,QR).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(r);i&&(l(this,vc)||x(this,vc,new pF(this)),l(this,vc).show(r,i,this.direction==="ltr"))},JV=function(){let t=document.getSelection();if(!t||t.isCollapsed){l(this,Gu)&&(l(this,vc)?.hide(),x(this,Gu,null),R(this,re,Ts).call(this,{hasSelectedText:!1}));return}let{anchorNode:e}=t;if(e===l(this,Gu))return;let i=R(this,re,QR).call(this,t).closest(".textLayer");if(!i){l(this,Gu)&&(l(this,vc)?.hide(),x(this,Gu,null),R(this,re,Ts).call(this,{hasSelectedText:!1}));return}if(l(this,vc)?.hide(),x(this,Gu,e),R(this,re,Ts).call(this,{hasSelectedText:!0}),!(l(this,Zn)!==Re.HIGHLIGHT&&l(this,Zn)!==Re.NONE)&&(l(this,Zn)===Re.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),x(this,id,this.isShiftKeyDown),!this.isShiftKeyDown)){let s=l(this,Zn)===Re.HIGHLIGHT?R(this,re,wF).call(this,i):null;if(s?.toggleDrawing(),l(this,Vb)){let a=new AbortController,o=this.combinedSignal(a),c=u=>{u.type==="pointerup"&&u.button!==0||(a.abort(),s?.toggleDrawing(!0),u.type==="pointerup"&&R(this,re,E1).call(this,"main_toolbar"))};window.addEventListener("pointerup",c,{signal:o}),window.addEventListener("blur",c,{signal:o})}else s?.toggleDrawing(!0),R(this,re,E1).call(this,"main_toolbar")}},E1=function(t=""){l(this,Zn)===Re.HIGHLIGHT?this.highlightSelection(t):l(this,h2)&&R(this,re,ZV).call(this)},QV=function(){document.addEventListener("selectionchange",R(this,re,JV).bind(this),{signal:this._signal})},tX=function(){if(l(this,nd))return;x(this,nd,new AbortController);let t=this.combinedSignal(l(this,nd));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},eX=function(){l(this,nd)?.abort(),x(this,nd,null)},AF=function(){if(l(this,ad))return;x(this,ad,new AbortController);let t=this.combinedSignal(l(this,ad));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},rX=function(){l(this,ad)?.abort(),x(this,ad,null)},nX=function(){if(l(this,td))return;x(this,td,new AbortController);let t=this.combinedSignal(l(this,td));document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})},iX=function(){l(this,td)?.abort(),x(this,td,null)},sX=function(){let t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},Ts=function(t){Object.entries(t).some(([r,i])=>l(this,y2)[r]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(l(this,y2),t)}),l(this,Zn)===Re.HIGHLIGHT&&t.hasSelectedEditor===!1&&R(this,re,ju).call(this,[[Je.HIGHLIGHT_FREE,!0]]))},ju=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},aX=async function(){if(!l(this,sd)){x(this,sd,!0);let t=[];for(let e of l(this,hi).values())t.push(e.enable());await Promise.all(t);for(let e of l(this,Cn).values())e.enable()}},oX=function(){if(this.unselectAll(),l(this,sd)){x(this,sd,!1);for(let t of l(this,hi).values())t.disable();for(let t of l(this,Cn).values())t.disable()}},EF=function(t){let e=l(this,hi).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},lX=function(){let t=null;for(t of l(this,wr));return t},x1=function(){if(l(this,Cn).size===0)return!0;if(l(this,Cn).size===1)for(let t of l(this,Cn).values())return t.isEmpty();return!1},xF=function(t){for(let e of l(this,wr))e.unselect();l(this,wr).clear();for(let e of t)e.isEmpty()||(l(this,wr).add(e),e.select());R(this,re,Ts).call(this,{hasSelectedEditor:this.hasSelection})},Lt(Ib,"TRANSLATE_SMALL",1),Lt(Ib,"TRANSLATE_BIG",10);$d=Ib,Cs=class Cs{constructor(t){T(this,Pl);T(this,xi,null);T(this,Ac,!1);T(this,wl,null);T(this,Yb,null);T(this,Ec,null);T(this,xa,null);T(this,Kb,!1);T(this,xc,null);T(this,ta,null);T(this,Xu,null);T(this,Ng,null);T(this,Sc,!1);x(this,ta,t),x(this,Sc,t._uiManager.useNewAltTextFlow),l(Cs,hd)||x(Cs,hd,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(t){Cs._l10n??(Cs._l10n=t)}async render(){let t=x(this,wl,document.createElement("button"));t.className="altText",t.tabIndex="0";let e=x(this,Yb,document.createElement("span"));t.append(e),l(this,Sc)?(t.classList.add("new"),t.setAttribute("data-l10n-id",l(Cs,hd).missing),e.setAttribute("data-l10n-id",l(Cs,hd)["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));let r=l(this,ta)._uiManager._signal;t.addEventListener("contextmenu",Ga,{signal:r}),t.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:r});let i=s=>{s.preventDefault(),l(this,ta)._uiManager.editAltText(l(this,ta)),l(this,Sc)&&l(this,ta)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:l(this,Pl,S1)}})};return t.addEventListener("click",i,{capture:!0,signal:r}),t.addEventListener("keydown",s=>{s.target===t&&s.key==="Enter"&&(x(this,Kb,!0),i(s))},{signal:r}),await R(this,Pl,tI).call(this),t}finish(){l(this,wl)&&(l(this,wl).focus({focusVisible:l(this,Kb)}),x(this,Kb,!1))}isEmpty(){return l(this,Sc)?l(this,xi)===null:!l(this,xi)&&!l(this,Ac)}hasData(){return l(this,Sc)?l(this,xi)!==null||!!l(this,Xu):this.isEmpty()}get guessedText(){return l(this,Xu)}async setGuessedText(t){l(this,xi)===null&&(x(this,Xu,t),x(this,Ng,await Cs._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),R(this,Pl,tI).call(this))}toggleAltTextBadge(t=!1){if(!l(this,Sc)||l(this,xi)){l(this,xc)?.remove(),x(this,xc,null);return}if(!l(this,xc)){let e=x(this,xc,document.createElement("div"));e.className="noAltTextBadge",l(this,ta).div.append(e)}l(this,xc).classList.toggle("hidden",!t)}serialize(t){let e=l(this,xi);return!t&&l(this,Xu)===e&&(e=l(this,Ng)),{altText:e,decorative:l(this,Ac),guessedText:l(this,Xu),textWithDisclaimer:l(this,Ng)}}get data(){return{altText:l(this,xi),decorative:l(this,Ac)}}set data({altText:t,decorative:e,guessedText:r,textWithDisclaimer:i,cancel:s=!1}){r&&(x(this,Xu,r),x(this,Ng,i)),!(l(this,xi)===t&&l(this,Ac)===e)&&(s||(x(this,xi,t),x(this,Ac,e)),R(this,Pl,tI).call(this))}toggle(t=!1){l(this,wl)&&(!t&&l(this,xa)&&(clearTimeout(l(this,xa)),x(this,xa,null)),l(this,wl).disabled=!t)}shown(){l(this,ta)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:l(this,Pl,S1)}})}destroy(){l(this,wl)?.remove(),x(this,wl,null),x(this,Yb,null),x(this,Ec,null),l(this,xc)?.remove(),x(this,xc,null)}};xi=new WeakMap,Ac=new WeakMap,wl=new WeakMap,Yb=new WeakMap,Ec=new WeakMap,xa=new WeakMap,Kb=new WeakMap,xc=new WeakMap,ta=new WeakMap,Xu=new WeakMap,Ng=new WeakMap,Sc=new WeakMap,hd=new WeakMap,Pl=new WeakSet,S1=function(){return l(this,xi)&&"added"||l(this,xi)===null&&this.guessedText&&"review"||"missing"},tI=async function(){let t=l(this,wl);if(!t)return;if(l(this,Sc)){if(t.classList.toggle("done",!!l(this,xi)),t.setAttribute("data-l10n-id",l(Cs,hd)[l(this,Pl,S1)]),l(this,Yb)?.setAttribute("data-l10n-id",l(Cs,hd)[`${l(this,Pl,S1)}-label`]),!l(this,xi)){l(this,Ec)?.remove();return}}else{if(!l(this,xi)&&!l(this,Ac)){t.classList.remove("done"),l(this,Ec)?.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=l(this,Ec);if(!e){x(this,Ec,e=document.createElement("span")),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=`alt-text-tooltip-${l(this,ta).id}`;let i=100,s=l(this,ta)._uiManager._signal;s.addEventListener("abort",()=>{clearTimeout(l(this,xa)),x(this,xa,null)},{once:!0}),t.addEventListener("mouseenter",()=>{x(this,xa,setTimeout(()=>{x(this,xa,null),l(this,Ec).classList.add("show"),l(this,ta)._reportTelemetry({action:"alt_text_tooltip"})},i))},{signal:s}),t.addEventListener("mouseleave",()=>{l(this,xa)&&(clearTimeout(l(this,xa)),x(this,xa,null)),l(this,Ec)?.classList.remove("show")},{signal:s})}l(this,Ac)?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=l(this,xi)),e.parentNode||t.append(e),l(this,ta).getElementForAltText()?.setAttribute("aria-describedby",e.id)},T(Cs,hd,null),Lt(Cs,"_l10n",null);LI=Cs,Cb=class{constructor(t){T(this,A2);T(this,Ui,null);T(this,Mo,null);T(this,Lg,!1);T(this,Kr,null);T(this,w2,null);T(this,kg,null);T(this,Al,null);T(this,Mg,null);T(this,Fg,!1);T(this,Bg,null);x(this,Kr,t)}renderForToolbar(){let t=x(this,Mo,document.createElement("button"));return t.className="comment",R(this,A2,SF).call(this,t,!1)}renderForStandalone(){let t=x(this,Ui,document.createElement("button"));t.className="annotationCommentButton";let e=l(this,Kr).commentButtonPosition;if(e){let{style:r}=t;r.insetInlineEnd=`calc(${100*(l(this,Kr)._uiManager.direction==="ltr"?1-e[0]:e[0])}% - var(--comment-button-dim))`,r.top=`calc(${100*e[1]}% - var(--comment-button-dim))`;let i=l(this,Kr).commentButtonColor;i&&(r.backgroundColor=i)}return R(this,A2,SF).call(this,t,!0)}focusButton(){setTimeout(()=>{(l(this,Ui)??l(this,Mo))?.focus()},0)}onUpdatedColor(){if(!l(this,Ui))return;let t=l(this,Kr).commentButtonColor;t&&(l(this,Ui).style.backgroundColor=t),l(this,Kr)._uiManager.updatePopupColor(l(this,Kr))}get commentButtonWidth(){return(l(this,Ui)?.getBoundingClientRect().width??0)/l(this,Kr).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(l(this,Bg))return l(this,Bg);if(!l(this,Ui))return null;let{x:t,y:e,height:r}=l(this,Ui).getBoundingClientRect(),{x:i,y:s,width:a,height:o}=l(this,Kr).parent.boundingClientRect;return[(t-i)/a,(e+r-s)/o]}set commentPopupPositionInLayer(t){x(this,Bg,t)}hasDefaultPopupPosition(){return l(this,Bg)===null}removeStandaloneCommentButton(){l(this,Ui)?.remove(),x(this,Ui,null)}removeToolbarCommentButton(){l(this,Mo)?.remove(),x(this,Mo,null)}setCommentButtonStates({selected:t,hasPopup:e}){l(this,Ui)&&(l(this,Ui).classList.toggle("selected",t),l(this,Ui).ariaExpanded=e)}edit(t){let e=this.commentPopupPositionInLayer,r,i;if(e)[r,i]=e;else{[r,i]=l(this,Kr).commentButtonPosition;let{width:h,height:f,x:d,y:p}=l(this,Kr);r=d+r*h,i=p+i*f}let s=l(this,Kr).parent.boundingClientRect,{x:a,y:o,width:c,height:u}=s;l(this,Kr)._uiManager.editComment(l(this,Kr),a+r*c,o+i*u,{...t,parentDimensions:s})}finish(){l(this,Mo)&&(l(this,Mo).focus({focusVisible:l(this,Lg)}),x(this,Lg,!1))}isDeleted(){return l(this,Fg)||l(this,Al)===""}isEmpty(){return l(this,Al)===null}hasBeenEdited(){return this.isDeleted()||l(this,Al)!==l(this,w2)}serialize(){return this.data}get data(){return{text:l(this,Al),richText:l(this,kg),date:l(this,Mg),deleted:this.isDeleted()}}set data(t){if(t!==l(this,Al)&&x(this,kg,null),t===null){x(this,Al,""),x(this,Fg,!0);return}x(this,Al,t),x(this,Mg,new Date),x(this,Fg,!1)}setInitialText(t,e=null){x(this,w2,t),this.data=t,x(this,Mg,null),x(this,kg,e)}shown(){}destroy(){l(this,Mo)?.remove(),x(this,Mo,null),l(this,Ui)?.remove(),x(this,Ui,null),x(this,Al,""),x(this,kg,null),x(this,Mg,null),x(this,Kr,null),x(this,Lg,!1),x(this,Fg,!1)}};Ui=new WeakMap,Mo=new WeakMap,Lg=new WeakMap,Kr=new WeakMap,w2=new WeakMap,kg=new WeakMap,Al=new WeakMap,Mg=new WeakMap,Fg=new WeakMap,Bg=new WeakMap,A2=new WeakSet,SF=function(t,e){if(!l(this,Kr)._uiManager.hasCommentManager())return null;t.tabIndex="0",t.ariaHasPopup="dialog",e?(t.ariaControls="commentPopup",t.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(t.ariaControlsElements=[l(this,Kr)._uiManager.getCommentDialogElement()],t.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));let r=l(this,Kr)._uiManager._signal;if(!(r instanceof AbortSignal)||r.aborted)return t;t.addEventListener("contextmenu",Ga,{signal:r}),e&&(t.addEventListener("focusin",s=>{l(this,Kr)._focusEventsAllowed=!1,mn(s)},{capture:!0,signal:r}),t.addEventListener("focusout",s=>{l(this,Kr)._focusEventsAllowed=!0,mn(s)},{capture:!0,signal:r})),t.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:r});let i=s=>{s.preventDefault(),t===l(this,Mo)?this.edit():l(this,Kr).toggleComment(!0)};return t.addEventListener("click",i,{capture:!0,signal:r}),t.addEventListener("keydown",s=>{s.target===t&&s.key==="Enter"&&(x(this,Lg,!0),i(s))},{signal:r}),t.addEventListener("pointerenter",()=>{l(this,Kr).toggleComment(!1,!0)},{signal:r}),t.addEventListener("pointerleave",()=>{l(this,Kr).toggleComment(!1,!1)},{signal:r}),t};z3=class z3{constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:r=null,onPinchStart:i=null,onPinching:s=null,onPinchEnd:a=null,signal:o}){T(this,Hd);T(this,Zb);T(this,Ug,!1);T(this,E2,null);T(this,x2);T(this,S2);T(this,_2);T(this,T2);T(this,qu,null);T(this,jg);T(this,Yu,null);T(this,$g);T(this,Ku,null);x(this,Zb,t),x(this,E2,r),x(this,x2,e),x(this,S2,i),x(this,_2,s),x(this,T2,a),x(this,$g,new AbortController),x(this,jg,AbortSignal.any([o,l(this,$g).signal])),t.addEventListener("touchstart",R(this,Hd,cX).bind(this),{passive:!1,signal:l(this,jg)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Uc.pixelRatio}destroy(){l(this,$g)?.abort(),x(this,$g,null),l(this,qu)?.abort(),x(this,qu,null)}};Zb=new WeakMap,Ug=new WeakMap,E2=new WeakMap,x2=new WeakMap,S2=new WeakMap,_2=new WeakMap,T2=new WeakMap,qu=new WeakMap,jg=new WeakMap,Yu=new WeakMap,$g=new WeakMap,Ku=new WeakMap,Hd=new WeakSet,cX=function(t){var i,s,a;if((i=l(this,x2))!=null&&i.call(this))return;if(t.touches.length===1){if(l(this,qu))return;let o=x(this,qu,new AbortController),c=AbortSignal.any([l(this,jg),o.signal]),u=l(this,Zb),h={capture:!0,signal:c,passive:!1},f=d=>{d.pointerType==="touch"&&(l(this,qu)?.abort(),x(this,qu,null))};u.addEventListener("pointerdown",d=>{d.pointerType==="touch"&&(mn(d),f(d))},h),u.addEventListener("pointerup",f,h),u.addEventListener("pointercancel",f,h);return}if(!l(this,Ku)){x(this,Ku,new AbortController);let o=AbortSignal.any([l(this,jg),l(this,Ku).signal]),c=l(this,Zb),u={signal:o,capture:!1,passive:!1};c.addEventListener("touchmove",R(this,Hd,uX).bind(this),u);let h=R(this,Hd,hX).bind(this);c.addEventListener("touchend",h,u),c.addEventListener("touchcancel",h,u),u.capture=!0,c.addEventListener("pointerdown",mn,u),c.addEventListener("pointermove",mn,u),c.addEventListener("pointercancel",mn,u),c.addEventListener("pointerup",mn,u),(s=l(this,S2))==null||s.call(this)}if(mn(t),t.touches.length!==2||(a=l(this,E2))!=null&&a.call(this)){x(this,Yu,null);return}let[e,r]=t.touches;e.identifier>r.identifier&&([e,r]=[r,e]),x(this,Yu,{touch0X:e.screenX,touch0Y:e.screenY,touch1X:r.screenX,touch1Y:r.screenY})},uX=function(t){var _;if(!l(this,Yu)||t.touches.length!==2)return;mn(t);let[e,r]=t.touches;e.identifier>r.identifier&&([e,r]=[r,e]);let{screenX:i,screenY:s}=e,{screenX:a,screenY:o}=r,c=l(this,Yu),{touch0X:u,touch0Y:h,touch1X:f,touch1Y:d}=c,p=f-u,g=d-h,y=a-i,b=o-s,m=Math.hypot(y,b)||1,w=Math.hypot(p,g)||1;if(!l(this,Ug)&&Math.abs(w-m)<=z3.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(c.touch0X=i,c.touch0Y=s,c.touch1X=a,c.touch1Y=o,!l(this,Ug)){x(this,Ug,!0);return}let A=[(i+a)/2,(s+o)/2];(_=l(this,_2))==null||_.call(this,A,w,m)},hX=function(t){var e;t.touches.length>=2||(l(this,Ku)&&(l(this,Ku).abort(),x(this,Ku,null),(e=l(this,T2))==null||e.call(this)),l(this,Yu)&&(mn(t),x(this,Yu,null),x(this,Ug,!1)))};q1=z3,Pe=class Pe{constructor(t){T(this,Ae);T(this,Hg,null);T(this,El,null);T(this,ln,null);T(this,$r,null);T(this,Zu,null);T(this,Jb,!1);T(this,fd,null);T(this,C2,"");T(this,ji,null);T(this,zg,null);T(this,Ju,null);T(this,Fo,null);T(this,dd,null);T(this,R2,"");T(this,Wg,!1);T(this,Sa,null);T(this,I2,!1);T(this,Gg,!1);T(this,Qu,!1);T(this,_c,null);T(this,Qb,0);T(this,tv,0);T(this,Bo,null);T(this,Vg,null);Lt(this,"isSelected",!1);Lt(this,"_isCopy",!1);Lt(this,"_editToolbar",null);Lt(this,"_initialOptions",Object.create(null));Lt(this,"_initialData",null);Lt(this,"_isVisible",!0);Lt(this,"_uiManager",null);Lt(this,"_focusEventsAllowed",!0);T(this,D2,!1);T(this,yD,Pe._zIndex++);this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null,this.annotationElementId=t.annotationElementId||null,this.creationDate=t.creationDate||new Date,this.modificationDate=t.modificationDate||null,this.canAddComment=!0;let{rotation:e,rawDims:{pageWidth:r,pageHeight:i,pageX:s,pageY:a}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,i],this.pageTranslation=[s,a];let[o,c]=this.parentDimensions;this.x=t.x/o,this.y=t.y/c,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){let t=Pe.prototype._resizeWithKeyboard,e=$d.TRANSLATE_SMALL,r=$d.TRANSLATE_BIG;return Te(this,"_resizerKeyboardManager",new Wm([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,r]}],[["Escape","mac+Escape"],Pe.prototype._stopResizingWithKeyboard]]))}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 Te(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){let e=new PF({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(Pe._l10n??(Pe._l10n=t),Pe._l10nResizer||(Pe._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"})),Pe._borderLineWidth!==-1)return;let r=getComputedStyle(document.documentElement);Pe._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Wr("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return l(this,D2)}set _isDraggable(t){x(this,D2,t),this.div?.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){let[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(t*2),this.y+=this.width*t/(e*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(t*2),this.y-=this.width*t/(e*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=l(this,yD)}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(R(this,Ae,_1).call(this),l(this,Fo)?.remove(),x(this,Fo,null)),this.parent=t}focusin(t){this._focusEventsAllowed&&(l(this,Wg)?x(this,Wg,!1):this.parent.setSelected(this))}focusout(t){!this._focusEventsAllowed||!this.isAttachedToDOM||t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,r,i){let[s,a]=this.parentDimensions;[r,i]=this.screenToPageTranslation(r,i),this.x=(t+r)/s,this.y=(e+i)/a,this.fixAndSetPosition()}_moveAfterPaste(t,e){let[r,i]=this.parentDimensions;this.setAt(t*r,e*i,this.width*r,this.height*i),this._onTranslated()}translate(t,e){R(this,Ae,_F).call(this,this.parentDimensions,t,e)}translateInPage(t,e){l(this,Sa)||x(this,Sa,[this.x,this.y,this.width,this.height]),R(this,Ae,_F).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){l(this,Sa)||x(this,Sa,[this.x,this.y,this.width,this.height]);let{div:r,parentDimensions:[i,s]}=this;if(this.x+=t/i,this.y+=e/s,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:f,y:d}=this.div.getBoundingClientRect();this.parent.findNewParent(this,f,d)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this,[c,u]=this.getBaseTranslation();a+=c,o+=u;let{style:h}=r;h.left=`${(100*a).toFixed(2)}%`,h.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o),r.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!l(this,Sa)&&(l(this,Sa)[0]!==this.x||l(this,Sa)[1]!==this.y)}get _hasBeenResized(){return!!l(this,Sa)&&(l(this,Sa)[2]!==this.width||l(this,Sa)[3]!==this.height)}getBaseTranslation(){let[t,e]=this.parentDimensions,{_borderLineWidth:r}=Pe,i=r/t,s=r/e;switch(this.rotation){case 90:return[-i,s];case 180:return[i,s];case 270:return[i,-s];default:return[-i,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){let{div:{style:e},pageDimensions:[r,i]}=this,{x:s,y:a,width:o,height:c}=this;if(o*=r,c*=i,s*=r,a*=i,this._mustFixPosition)switch(t){case 0:s=ds(s,0,r-o),a=ds(a,0,i-c);break;case 90:s=ds(s,0,r-c),a=ds(a,o,i);break;case 180:s=ds(s,o,r),a=ds(a,c,i);break;case 270:s=ds(s,c,r),a=ds(a,0,i-o);break}this.x=s/=r,this.y=a/=i;let[u,h]=this.getBaseTranslation();s+=u,a+=h,e.left=`${(100*s).toFixed(2)}%`,e.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(t,e){var r;return R(r=Pe,O2,TF).call(r,t,e,this.parentRotation)}pageTranslationToScreen(t,e){var r;return R(r=Pe,O2,TF).call(r,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:t,pageDimensions:[e,r]}=this;return[e*t,r*t]}setDims(){let{div:{style:t},width:e,height:r}=this;t.width=`${(100*e).toFixed(2)}%`,t.height=`${(100*r).toFixed(2)}%`}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(t*1e4)/1e4}_onResizing(){}altTextFinish(){l(this,ln)?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||l(this,Gg))return this._editToolbar;this._editToolbar=new dF(this),this.div.append(this._editToolbar.render());let{toolbarButtons:t}=this;if(t)for(let[e,r]of t)await this._editToolbar.addButton(e,r);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,ln)?.destroy()}addContainer(t){let e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return l(this,ln)||(LI.initialize(Pe._l10n),x(this,ln,new LI(this)),l(this,Hg)&&(l(this,ln).data=l(this,Hg),x(this,Hg,null))),l(this,ln)}get altTextData(){return l(this,ln)?.data}set altTextData(t){l(this,ln)&&(l(this,ln).data=t)}get guessedAltText(){return l(this,ln)?.guessedText}async setGuessedAltText(t){await l(this,ln)?.setGuessedText(t)}serializeAltText(t){return l(this,ln)?.serialize(t)}hasAltText(){return!!l(this,ln)&&!l(this,ln).isEmpty()}hasAltTextData(){return l(this,ln)?.hasData()??!1}focusCommentButton(){l(this,$r)?.focusButton()}addCommentButton(){return this.canAddComment?l(this,$r)||x(this,$r,new Cb(this)):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(l(this,Zu)){this._uiManager.isEditingMode()&&l(this,Zu).classList.remove("hidden");return}this.hasComment&&(x(this,Zu,l(this,$r).renderForStandalone()),this.div.append(l(this,Zu)))}}removeStandaloneCommentButton(){l(this,$r).removeStandaloneCommentButton(),x(this,Zu,null)}hideStandaloneCommentButton(){l(this,Zu)?.classList.add("hidden")}get comment(){let{data:{richText:t,text:e,date:r,deleted:i}}=l(this,$r);return{text:e,richText:t,date:r,deleted:i,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(t){l(this,$r)||x(this,$r,new Cb(this)),l(this,$r).data=t,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:t,popupRef:e,richText:r}){if(!e||(l(this,$r)||x(this,$r,new Cb(this)),l(this,$r).setInitialText(t,r),!this.annotationElementId))return;let i=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);i&&this.updateFromAnnotationLayer(i)}get hasEditedComment(){return l(this,$r)?.hasBeenEdited()}get hasDeletedComment(){return l(this,$r)?.isDeleted()}get hasComment(){return!!l(this,$r)&&!l(this,$r).isEmpty()&&!l(this,$r).isDeleted()}async editComment(t){l(this,$r)||x(this,$r,new Cb(this)),l(this,$r).edit(t)}toggleComment(t,e=void 0){this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){l(this,$r).setSelectedButton(t)}addComment(t){if(this.hasEditedComment){let[,,,i]=t.rect,[s]=this.pageDimensions,[a]=this.pageTranslation,o=a+s+1,c=i-100,u=o+180;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[o,c,u,i]}}}updateFromAnnotationLayer({popup:{contents:t,deleted:e}}){l(this,$r).data=e?null:t}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){let t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=l(this,Jb)?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),R(this,Ae,DF).call(this);let[e,r]=this.parentDimensions;this.parentRotation%180!==0&&(t.style.maxWidth=`${(100*r/e).toFixed(2)}%`,t.style.maxHeight=`${(100*e/r).toFixed(2)}%`);let[i,s]=this.getInitialTranslation();return this.translate(i,s),YV(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(l(this,Vg)||x(this,Vg,new q1({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:R(this,Ae,pX).bind(this),onPinching:R(this,Ae,gX).bind(this),onPinchEnd:R(this,Ae,mX).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),t}pointerdown(t){let{isMac:e}=Pn.platform;if(t.button!==0||t.ctrlKey&&e){t.preventDefault();return}if(x(this,Wg,!0),this._isDraggable){R(this,Ae,yX).call(this,t);return}R(this,Ae,IF).call(this,t)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){l(this,_c)&&clearTimeout(l(this,_c)),x(this,_c,setTimeout(()=>{x(this,_c,null),this.parent?.moveEditorInDOM(this)},0))}_setParentAndPosition(t,e,r){t.changeParent(this),this.x=e,this.y=r,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e,r=this.rotation){let i=this.parentScale,[s,a]=this.pageDimensions,[o,c]=this.pageTranslation,u=t/i,h=e/i,f=this.x*s,d=this.y*a,p=this.width*s,g=this.height*a;switch(r){case 0:return[f+u+o,a-d-h-g+c,f+u+p+o,a-d-h+c];case 90:return[f+h+o,a-d+u+c,f+h+g+o,a-d+u+p+c];case 180:return[f-u-p+o,a-d+h+c,f-u+o,a-d+h+g+c];case 270:return[f-h-g+o,a-d-u-p+c,f-h+o,a-d-u+c];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){let[r,i,s,a]=t,o=s-r,c=a-i;switch(this.rotation){case 0:return[r,e-a,o,c];case 90:return[r,e-i,c,o];case 180:return[s,e-i,o,c];case 270:return[s,e-a,c,o];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&Pe._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){l(this,$r)?.onUpdatedColor()}getData(){let{comment:{text:t,color:e,date:r,opacity:i,deleted:s,richText:a},uid:o,pageIndex:c,creationDate:u,modificationDate:h}=this;return{id:o,pageIndex:c,rect:this.getPDFRect(),richText:a,contentsObj:{str:t},creationDate:u,modificationDate:r||h,popupRef:!s,color:e,opacity:i}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),x(this,Gg,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),x(this,Gg,!1),!0):!1}isInEditMode(){return l(this,Gg)}shouldGetKeyboardEvents(){return l(this,Qu)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:t,left:e,bottom:r,right:i}=this.getClientDimensions(),{innerHeight:s,innerWidth:a}=window;return e<a&&i>0&&t<s&&r>0}rebuild(){R(this,Ae,DF).call(this)}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,e=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(t,e,r){let i=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:r,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});i.rotation=t.rotation,x(i,Hg,t.accessibilityData),i._isCopy=t.isCopy||!1;let[s,a]=i.pageDimensions,[o,c,u,h]=i.getRectInCurrentCoords(t.rect,a);return i.x=o/s,i.y=c/a,i.width=u/s,i.height=h/a,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(l(this,dd)?.abort(),x(this,dd,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),l(this,_c)&&(clearTimeout(l(this,_c)),x(this,_c,null)),R(this,Ae,_1).call(this),this.removeEditToolbar(),l(this,Bo)){for(let t of l(this,Bo).values())clearTimeout(t);x(this,Bo,null)}this.parent=null,l(this,Vg)?.destroy(),x(this,Vg,null),l(this,Fo)?.remove(),x(this,Fo,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(R(this,Ae,fX).call(this),l(this,ji).classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){let{commentButtonPosition:[t,e]}=this,[r,i,s,a]=this.getPDFRect();return[Pe._round(r+(s-r)*t),Pe._round(i+(a-i)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return l(this,$r).commentPopupPositionInLayer}set commentPopupPosition(t){l(this,$r).commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return l(this,$r).hasDefaultPopupPosition()}get commentButtonWidth(){return l(this,$r).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){l(this,$r)?.setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),x(this,Ju,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});let e=l(this,ji).children;if(!l(this,El)){x(this,El,Array.from(e));let a=R(this,Ae,bX).bind(this),o=R(this,Ae,vX).bind(this),c=this._uiManager._signal;for(let u of l(this,El)){let h=u.getAttribute("data-resizer-name");u.setAttribute("role","spinbutton"),u.addEventListener("keydown",a,{signal:c}),u.addEventListener("blur",o,{signal:c}),u.addEventListener("focus",R(this,Ae,wX).bind(this,h),{signal:c}),u.setAttribute("data-l10n-id",Pe._l10nResizer[h])}}let r=l(this,El)[0],i=0;for(let a of e){if(a===r)break;i++}let s=(360-this.rotation+this.parentRotation)%360/90*(l(this,El).length/4);if(s!==i){if(s<i)for(let o=0;o<i-s;o++)l(this,ji).append(l(this,ji).firstElementChild);else if(s>i)for(let o=0;o<s-i;o++)l(this,ji).firstElementChild.before(l(this,ji).lastElementChild);let a=0;for(let o of e){let u=l(this,El)[a++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",Pe._l10nResizer[u])}}R(this,Ae,OF).call(this,0),x(this,Qu,!0),l(this,ji).firstElementChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){l(this,Qu)&&R(this,Ae,RF).call(this,l(this,R2),{deltaX:t,deltaY:e,fromKeyboard:!0})}_stopResizingWithKeyboard(){R(this,Ae,_1).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,ln)?.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,ji)?.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,ln)?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){t.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,I2)}set isEditing(t){x(this,I2,t),this.parent&&(t?(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(t,e=!1){if(e){l(this,Bo)||x(this,Bo,new Map);let{action:r}=t,i=l(this,Bo).get(r);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),l(this,Bo).delete(r),l(this,Bo).size===0&&x(this,Bo,null)},Pe._telemetryTimeout),l(this,Bo).set(r,i);return}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),x(this,Jb,!1)}disable(){this.div&&(this.div.tabIndex=-1),x(this,Jb,!0)}updateFakeAnnotationElement(t){if(!l(this,Fo)&&!this.deleted){x(this,Fo,t.addFakeAnnotation(this));return}if(this.deleted){l(this,Fo).remove(),x(this,Fo,null);return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&l(this,Fo).updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let e=t.container.querySelector(".annotationContent");if(!e)e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);else if(e.nodeName==="CANVAS"){let r=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),r.before(e)}return e}resetAnnotationElement(t){let{firstElementChild:e}=t.container;e?.nodeName==="DIV"&&e.classList.contains("annotationContent")&&e.remove()}};Hg=new WeakMap,El=new WeakMap,ln=new WeakMap,$r=new WeakMap,Zu=new WeakMap,Jb=new WeakMap,fd=new WeakMap,C2=new WeakMap,ji=new WeakMap,zg=new WeakMap,Ju=new WeakMap,Fo=new WeakMap,dd=new WeakMap,R2=new WeakMap,Wg=new WeakMap,Sa=new WeakMap,I2=new WeakMap,Gg=new WeakMap,Qu=new WeakMap,_c=new WeakMap,Qb=new WeakMap,tv=new WeakMap,Bo=new WeakMap,Vg=new WeakMap,D2=new WeakMap,yD=new WeakMap,Ae=new WeakSet,_F=function([t,e],r,i){[r,i]=this.screenToPageTranslation(r,i),this.x+=r/t,this.y+=i/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},O2=new WeakSet,TF=function(t,e,r){switch(r){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}},eI=function(t){switch(t){case 90:{let[e,r]=this.pageDimensions;return[0,-e/r,r/e,0]}case 180:return[-1,0,0,-1];case 270:{let[e,r]=this.pageDimensions;return[0,e/r,-r/e,0]}default:return[1,0,0,1]}},fX=function(){if(l(this,ji))return;x(this,ji,document.createElement("div")),l(this,ji).classList.add("resizers");let t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(let r of t){let i=document.createElement("div");l(this,ji).append(i),i.classList.add("resizer",r),i.setAttribute("data-resizer-name",r),i.addEventListener("pointerdown",R(this,Ae,dX).bind(this,r),{signal:e}),i.addEventListener("contextmenu",Ga,{signal:e}),i.tabIndex=-1}this.div.prepend(l(this,ji))},dX=function(t,e){e.preventDefault();let{isMac:r}=Pn.platform;if(e.button!==0||e.ctrlKey&&r)return;l(this,ln)?.toggle(!1);let i=this._isDraggable;this._isDraggable=!1,x(this,zg,[e.screenX,e.screenY]);let s=new AbortController,a=this._uiManager.combinedSignal(s);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",R(this,Ae,RF).bind(this,t),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",mn,{passive:!1,signal:a}),window.addEventListener("contextmenu",Ga,{signal:a}),x(this,Ju,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});let o=this.parent.div.style.cursor,c=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;let u=()=>{s.abort(),this.parent.togglePointerEvents(!0),l(this,ln)?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=o,this.div.style.cursor=c,R(this,Ae,rI).call(this)};window.addEventListener("pointerup",u,{signal:a}),window.addEventListener("blur",u,{signal:a})},CF=function(t,e,r,i){this.width=r,this.height=i,this.x=t,this.y=e,this.setDims(),this.fixAndSetPosition(),this._onResized()},rI=function(){if(!l(this,Ju))return;let{savedX:t,savedY:e,savedWidth:r,savedHeight:i}=l(this,Ju);x(this,Ju,null);let s=this.x,a=this.y,o=this.width,c=this.height;s===t&&a===e&&o===r&&c===i||this.addCommands({cmd:R(this,Ae,CF).bind(this,s,a,o,c),undo:R(this,Ae,CF).bind(this,t,e,r,i),mustExec:!0})},RF=function(t,e){let[r,i]=this.parentDimensions,s=this.x,a=this.y,o=this.width,c=this.height,u=Pe.MIN_SIZE/r,h=Pe.MIN_SIZE/i,f=R(this,Ae,eI).call(this,this.rotation),d=(J,N)=>[f[0]*J+f[2]*N,f[1]*J+f[3]*N],p=R(this,Ae,eI).call(this,360-this.rotation),g=(J,N)=>[p[0]*J+p[2]*N,p[1]*J+p[3]*N],y,b,m=!1,w=!1;switch(t){case"topLeft":m=!0,y=(J,N)=>[0,0],b=(J,N)=>[J,N];break;case"topMiddle":y=(J,N)=>[J/2,0],b=(J,N)=>[J/2,N];break;case"topRight":m=!0,y=(J,N)=>[J,0],b=(J,N)=>[0,N];break;case"middleRight":w=!0,y=(J,N)=>[J,N/2],b=(J,N)=>[0,N/2];break;case"bottomRight":m=!0,y=(J,N)=>[J,N],b=(J,N)=>[0,0];break;case"bottomMiddle":y=(J,N)=>[J/2,N],b=(J,N)=>[J/2,0];break;case"bottomLeft":m=!0,y=(J,N)=>[0,N],b=(J,N)=>[J,0];break;case"middleLeft":w=!0,y=(J,N)=>[0,N/2],b=(J,N)=>[J,N/2];break}let A=y(o,c),_=b(o,c),S=d(..._),I=Pe._round(s+S[0]),C=Pe._round(a+S[1]),M=1,z=1,G,Y;if(e.fromKeyboard)({deltaX:G,deltaY:Y}=e);else{let{screenX:J,screenY:N}=e,[D,F]=l(this,zg);[G,Y]=this.screenToPageTranslation(J-D,N-F),l(this,zg)[0]=J,l(this,zg)[1]=N}if([G,Y]=g(G/r,Y/i),m){let J=Math.hypot(o,c);M=z=Math.max(Math.min(Math.hypot(_[0]-A[0]-G,_[1]-A[1]-Y)/J,1/o,1/c),u/o,h/c)}else w?M=ds(Math.abs(_[0]-A[0]-G),u,1)/o:z=ds(Math.abs(_[1]-A[1]-Y),h,1)/c;let L=Pe._round(o*M),j=Pe._round(c*z);S=d(...b(L,j));let q=I-S[0],nt=C-S[1];l(this,Sa)||x(this,Sa,[this.x,this.y,this.width,this.height]),this.width=L,this.height=j,this.x=q,this.y=nt,this.setDims(),this.fixAndSetPosition(),this._onResizing()},pX=function(){x(this,Ju,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),l(this,ln)?.toggle(!1),this.parent.togglePointerEvents(!1)},gX=function(t,e,r){let s=.7*(r/e)+1-.7;if(s===1)return;let a=R(this,Ae,eI).call(this,this.rotation),o=(I,C)=>[a[0]*I+a[2]*C,a[1]*I+a[3]*C],[c,u]=this.parentDimensions,h=this.x,f=this.y,d=this.width,p=this.height,g=Pe.MIN_SIZE/c,y=Pe.MIN_SIZE/u;s=Math.max(Math.min(s,1/d,1/p),g/d,y/p);let b=Pe._round(d*s),m=Pe._round(p*s);if(b===d&&m===p)return;l(this,Sa)||x(this,Sa,[h,f,d,p]);let w=o(d/2,p/2),A=Pe._round(h+w[0]),_=Pe._round(f+w[1]),S=o(b/2,m/2);this.x=A-S[0],this.y=_-S[1],this.width=b,this.height=m,this.setDims(),this.fixAndSetPosition(),this._onResizing()},mX=function(){l(this,ln)?.toggle(!0),this.parent.togglePointerEvents(!0),R(this,Ae,rI).call(this)},IF=function(t){let{isMac:e}=Pn.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},yX=function(t){let{isSelected:e}=this;this._uiManager.setUpDragSession();let r=!1,i=new AbortController,s=this._uiManager.combinedSignal(i),a={capture:!0,passive:!1,signal:s},o=u=>{i.abort(),x(this,fd,null),x(this,Wg,!1),this._uiManager.endDragSession()||R(this,Ae,IF).call(this,u),r&&this._onStopDragging()};e&&(x(this,Qb,t.clientX),x(this,tv,t.clientY),x(this,fd,t.pointerId),x(this,C2,t.pointerType),window.addEventListener("pointermove",u=>{r||(r=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:h,clientY:f,pointerId:d}=u;if(d!==l(this,fd)){mn(u);return}let[p,g]=this.screenToPageTranslation(h-l(this,Qb),f-l(this,tv));x(this,Qb,h),x(this,tv,f),this._uiManager.dragSelectedEditors(p,g)},a),window.addEventListener("touchmove",mn,a),window.addEventListener("pointerdown",u=>{u.pointerType===l(this,C2)&&(l(this,Vg)||u.isPrimary)&&o(u),mn(u)},a));let c=u=>{if(!l(this,fd)||l(this,fd)===u.pointerId){o(u);return}mn(u)};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})},DF=function(){if(l(this,dd)||!this.div)return;x(this,dd,new AbortController);let t=this._uiManager.combinedSignal(l(this,dd));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},bX=function(t){Pe._resizerKeyboardManager.exec(this,t)},vX=function(t){l(this,Qu)&&t.relatedTarget?.parentNode!==l(this,ji)&&R(this,Ae,_1).call(this)},wX=function(t){x(this,R2,l(this,Qu)?t:"")},OF=function(t){if(l(this,El))for(let e of l(this,El))e.tabIndex=t},_1=function(){x(this,Qu,!1),R(this,Ae,OF).call(this,-1),R(this,Ae,rI).call(this)},T(Pe,O2),Lt(Pe,"_l10n",null),Lt(Pe,"_l10nResizer",null),Lt(Pe,"_borderLineWidth",-1),Lt(Pe,"_colorManager",new vF),Lt(Pe,"_zIndex",1),Lt(Pe,"_telemetryTimeout",1e3);Zr=Pe,PF=class extends Zr{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},vV=3285377520,Ro=4294901760,gc=65535,kI=class{constructor(t){this.h1=t?t&4294967295:vV,this.h2=t?t&4294967295:vV}update(t){let e,r;if(typeof t=="string"){e=new Uint8Array(t.length*2),r=0;for(let y=0,b=t.length;y<b;y++){let m=t.charCodeAt(y);m<=255?e[r++]=m:(e[r++]=m>>>8,e[r++]=m&255)}}else if(ArrayBuffer.isView(t))e=t.slice(),r=e.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");let i=r>>2,s=r-i*4,a=new Uint32Array(e.buffer,0,i),o=0,c=0,u=this.h1,h=this.h2,f=3432918353,d=461845907,p=f&gc,g=d&gc;for(let y=0;y<i;y++)y&1?(o=a[y],o=o*f&Ro|o*p&gc,o=o<<15|o>>>17,o=o*d&Ro|o*g&gc,u^=o,u=u<<13|u>>>19,u=u*5+3864292196):(c=a[y],c=c*f&Ro|c*p&gc,c=c<<15|c>>>17,c=c*d&Ro|c*g&gc,h^=c,h=h<<13|h>>>19,h=h*5+3864292196);switch(o=0,s){case 3:o^=e[i*4+2]<<16;case 2:o^=e[i*4+1]<<8;case 1:o^=e[i*4],o=o*f&Ro|o*p&gc,o=o<<15|o>>>17,o=o*d&Ro|o*g&gc,i&1?u^=o:h^=o}this.h1=u,this.h2=h}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&Ro|t*36045&gc,e=e*4283543511&Ro|((e<<16|t>>>16)*2950163797&Ro)>>>16,t^=e>>>1,t=t*444984403&Ro|t*60499&gc,e=e*3301882366&Ro|((e<<16|t>>>16)*3120437893&Ro)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}},NF=Object.freeze({map:null,hash:"",transfer:void 0}),Y1=class{constructor(){T(this,bD);T(this,Xg,!1);T(this,qg,null);T(this,th,null);T(this,$i,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){let r=l(this,$i).get(t);return r===void 0?e:Object.assign(e,r)}getRawValue(t){return l(this,$i).get(t)}remove(t){let e=l(this,$i).get(t);if(e!==void 0&&(e instanceof Zr&&l(this,th).delete(e.annotationElementId),l(this,$i).delete(t),l(this,$i).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(let r of l(this,$i).values())if(r instanceof Zr)return;this.onAnnotationEditor(null)}}setValue(t,e){let r=l(this,$i).get(t),i=!1;if(r!==void 0)for(let[s,a]of Object.entries(e))r[s]!==a&&(i=!0,r[s]=a);else i=!0,l(this,$i).set(t,e);i&&R(this,bD,AX).call(this),e instanceof Zr&&((l(this,th)||x(this,th,new Map)).set(e.annotationElementId,e),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(e.constructor._type))}has(t){return l(this,$i).has(t)}get size(){return l(this,$i).size}resetModified(){l(this,Xg)&&(x(this,Xg,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new MI(this)}get serializable(){if(l(this,$i).size===0)return NF;let t=new Map,e=new kI,r=[],i=Object.create(null),s=!1;for(let[a,o]of l(this,$i)){let c=o instanceof Zr?o.serialize(!1,i):o;c&&(t.set(a,c),e.update(`${a}:${JSON.stringify(c)}`),s||(s=!!c.bitmap))}if(s)for(let a of t.values())a.bitmap&&r.push(a.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:r}:NF}get editorStats(){let t=null,e=new Map,r=0,i=0;for(let s of l(this,$i).values()){if(!(s instanceof Zr)){s.popup&&(s.popup.deleted?i+=1:r+=1);continue}s.isCommentDeleted?i+=1:s.hasEditedComment&&(r+=1);let a=s.telemetryFinalData;if(!a)continue;let{type:o}=a;e.has(o)||e.set(o,Object.getPrototypeOf(s).constructor),t||(t=Object.create(null));let c=t[o]||(t[o]=new Map);for(let[u,h]of Object.entries(a)){if(u==="type")continue;let f=c.get(u);f||(f=new Map,c.set(u,f));let d=f.get(h)??0;f.set(h,d+1)}}if((i>0||r>0)&&(t||(t=Object.create(null)),t.comments={deleted:i,edited:r}),!t)return null;for(let[s,a]of e)t[s]=a.computeTelemetryFinalData(t[s]);return t}resetModifiedIds(){x(this,qg,null)}updateEditor(t,e){let r=l(this,th)?.get(t);return r?(r.updateFromAnnotationLayer(e),!0):!1}getEditor(t){return l(this,th)?.get(t)||null}get modifiedIds(){if(l(this,qg))return l(this,qg);let t=[];if(l(this,th))for(let e of l(this,th).values())e.serialize()&&t.push(e.annotationElementId);return x(this,qg,{ids:new Set(t),hash:t.join(",")})}[Symbol.iterator](){return l(this,$i).entries()}};Xg=new WeakMap,qg=new WeakMap,th=new WeakMap,$i=new WeakMap,bD=new WeakSet,AX=function(){l(this,Xg)||(x(this,Xg,!0),typeof this.onSetModified=="function"&&this.onSetModified())};MI=class extends Y1{constructor(e){super();T(this,P2);let{map:r,hash:i,transfer:s}=e.serializable,a=structuredClone(r,s?{transfer:s}:null);x(this,P2,{map:a,hash:i,transfer:s})}get print(){Wr("Should not call PrintAnnotationStorage.print")}get serializable(){return l(this,P2)}get modifiedIds(){return Te(this,"modifiedIds",{ids:new Set,hash:""})}};P2=new WeakMap;LF=class{constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){T(this,ev,new Set);this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));let e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(let t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),l(this,ev).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:r}){if(!(!t||l(this,ev).has(t.loadedName))){if(er(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:i,src:s,style:a}=t,o=new FontFace(i,s,a);this.addNativeFontFace(o);try{await o.load(),l(this,ev).add(i),r?.(t)}catch{_e(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}Wr("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){let r=t.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(i){throw _e(`Failed to load font '${r.family}': '${i}'.`),t.disableFontFace=!0,i}}return}let e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(r=>{let i=this._queueLoadingCallback(r);this._prepareFontLoadEvent(t,i)})}}get isFontLoadingAPISupported(){let t=!!this._document?.fonts;return Te(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){return Te(this,"isSyncFontLoadingSupported",Os||Pn.platform.isFirefox)}_queueLoadingCallback(t){function e(){for(er(!i.done,"completeRequest() cannot be called twice."),i.done=!0;r.length>0&&r[0].done;){let s=r.shift();setTimeout(s.callback,0)}}let{loadingRequests:r}=this,i={done:!1,complete:e,callback:t};return r.push(i),i}get _loadTestFont(){let t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Te(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function r(_,S){return _.charCodeAt(S)<<24|_.charCodeAt(S+1)<<16|_.charCodeAt(S+2)<<8|_.charCodeAt(S+3)&255}function i(_,S,I,C){let M=_.substring(0,S),z=_.substring(S+I);return M+C+z}let s,a,o=this._document.createElement("canvas");o.width=1,o.height=1;let c=o.getContext("2d"),u=0;function h(_,S){if(++u>30){_e("Load test font never loaded."),S();return}if(c.font="30px "+_,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0){S();return}setTimeout(h.bind(null,_,S))}let f=`lt${Date.now()}${this.loadTestFontId++}`,d=this._loadTestFont;d=i(d,976,f.length,f);let g=16,y=1482184792,b=r(d,g);for(s=0,a=f.length-3;s<a;s+=4)b=b-y+r(f,s)|0;s<f.length&&(b=b-y+r(f+"XXX",s)|0),d=i(d,g,4,Iht(b));let m=`url(data:font/opentype;base64,${btoa(d)});`,w=`@font-face {font-family:"${f}";src:${m}}`;this.insertRule(w);let A=this._document.createElement("div");A.style.visibility="hidden",A.style.width=A.style.height="10px",A.style.position="absolute",A.style.top=A.style.left="0px";for(let _ of[t.loadedName,f]){let S=this._document.createElement("span");S.textContent="Hi",S.style.fontFamily=_,A.append(S)}this._document.body.append(A),h(f,()=>{A.remove(),e.complete()})}};ev=new WeakMap;kF=class{constructor(t,e=null,r,i){T(this,Cr);this.compiledGlyphs=Object.create(null),x(this,Cr,t),this._inspectFont=e,r&&Object.assign(this,r),i&&(this.charProcOperatorList=i)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{let e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let t=`url(data:${this.mimetype};base64,${FV(this.data)});`,e;if(!this.cssFontInfo)e=`@font-face {font-family:"${this.loadedName}";src:${t}}`;else{let r=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(r+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),e=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${r}src:${t}}`}return this._inspectFont?.(this,t),e}getPathGenerator(t,e){if(this.compiledGlyphs[e]!==void 0)return this.compiledGlyphs[e];let r=this.loadedName+"_path_"+e,i;try{i=t.get(r)}catch(a){_e(`getPathGenerator - ignoring character: "${a}".`)}let s=zV(i?.path);return this.fontExtraProperties||t.delete(r),this.compiledGlyphs[e]=s}get black(){return l(this,Cr).black}get bold(){return l(this,Cr).bold}get disableFontFace(){return l(this,Cr).disableFontFace??!1}set disableFontFace(t){Te(this,"disableFontFace",!!t)}get fontExtraProperties(){return l(this,Cr).fontExtraProperties??!1}get isInvalidPDFjsFont(){return l(this,Cr).isInvalidPDFjsFont}get isType3Font(){return l(this,Cr).isType3Font}get italic(){return l(this,Cr).italic}get missingFile(){return l(this,Cr).missingFile}get remeasure(){return l(this,Cr).remeasure}get vertical(){return l(this,Cr).vertical}get ascent(){return l(this,Cr).ascent}get defaultWidth(){return l(this,Cr).defaultWidth}get descent(){return l(this,Cr).descent}get bbox(){return l(this,Cr).bbox}set bbox(t){Te(this,"bbox",t)}get fontMatrix(){return l(this,Cr).fontMatrix}get fallbackName(){return l(this,Cr).fallbackName}get loadedName(){return l(this,Cr).loadedName}get mimetype(){return l(this,Cr).mimetype}get name(){return l(this,Cr).name}get data(){return l(this,Cr).data}clearData(){l(this,Cr).clearData()}get cssFontInfo(){return l(this,Cr).cssFontInfo}get systemFontInfo(){return l(this,Cr).systemFontInfo}get defaultVMetrics(){return l(this,Cr).defaultVMetrics}};Cr=new WeakMap;Db=class Db{constructor(t){T(this,iv);T(this,rv);T(this,nv);T(this,N2);x(this,rv,t),x(this,nv,new DataView(l(this,rv))),x(this,N2,new TextDecoder)}static write(t){let e=new TextEncoder,r={},i=0;for(let u of Db.strings){let h=e.encode(t[u]);r[u]=h,i+=4+h.length}let s=new ArrayBuffer(i),a=new Uint8Array(s),o=new DataView(s),c=0;for(let u of Db.strings){let h=r[u],f=h.length;o.setUint32(c,f),a.set(h,c+4),c+=4+f}return er(c===s.byteLength,"CssFontInfo.write: Buffer overflow"),s}get fontFamily(){return R(this,iv,nI).call(this,0)}get fontWeight(){return R(this,iv,nI).call(this,1)}get italicAngle(){return R(this,iv,nI).call(this,2)}};rv=new WeakMap,nv=new WeakMap,N2=new WeakMap,iv=new WeakSet,nI=function(t){er(t<Db.strings.length,"Invalid string index");let e=0;for(let i=0;i<t;i++)e+=l(this,nv).getUint32(e)+4;let r=l(this,nv).getUint32(e);return l(this,N2).decode(new Uint8Array(l(this,rv),e+4,r))},Lt(Db,"strings",["fontFamily","fontWeight","italicAngle"]);FI=Db,Ob=class Ob{constructor(t){T(this,Kg);T(this,pd);T(this,Tc);T(this,Yg);x(this,pd,t),x(this,Tc,new DataView(l(this,pd))),x(this,Yg,new TextDecoder)}static write(t){let e=new TextEncoder,r={},i=0;for(let d of Ob.strings){let p=e.encode(t[d]);r[d]=p,i+=4+p.length}i+=4;let s,a,o=1+i;t.style&&(s=e.encode(t.style.style),a=e.encode(t.style.weight),o+=4+s.length+4+a.length);let c=new ArrayBuffer(o),u=new Uint8Array(c),h=new DataView(c),f=0;h.setUint8(f++,t.guessFallback?1:0),h.setUint32(f,0),f+=4,i=0;for(let d of Ob.strings){let p=r[d],g=p.length;i+=4+g,h.setUint32(f,g),u.set(p,f+4),f+=4+g}return h.setUint32(f-i-4,i),t.style&&(h.setUint32(f,s.length),u.set(s,f+4),f+=4+s.length,h.setUint32(f,a.length),u.set(a,f+4),f+=4+a.length),er(f<=c.byteLength,"SubstitionInfo.write: Buffer overflow"),c.transferToFixedLength(f)}get guessFallback(){return l(this,Tc).getUint8(0)!==0}get css(){return R(this,Kg,T1).call(this,0)}get loadedName(){return R(this,Kg,T1).call(this,1)}get baseFontName(){return R(this,Kg,T1).call(this,2)}get src(){return R(this,Kg,T1).call(this,3)}get style(){let t=1;t+=4+l(this,Tc).getUint32(t);let e=l(this,Tc).getUint32(t),r=l(this,Yg).decode(new Uint8Array(l(this,pd),t+4,e));t+=4+e;let i=l(this,Tc).getUint32(t),s=l(this,Yg).decode(new Uint8Array(l(this,pd),t+4,i));return{style:r,weight:s}}};pd=new WeakMap,Tc=new WeakMap,Yg=new WeakMap,Kg=new WeakSet,T1=function(t){er(t<Ob.strings.length,"Invalid string index");let e=5;for(let i=0;i<t;i++)e+=l(this,Tc).getUint32(e)+4;let r=l(this,Tc).getUint32(e);return l(this,Yg).decode(new Uint8Array(l(this,pd),e+4,r))},Lt(Ob,"strings",["css","loadedName","baseFontName","src"]);BI=Ob,ke=class ke{constructor({data:t,extra:e}){T(this,On);T(this,Cc);T(this,L2);T(this,Rr);x(this,Cc,t),x(this,L2,new TextDecoder),x(this,Rr,new DataView(l(this,Cc))),e&&Object.assign(this,e)}get black(){return R(this,On,bl).call(this,0)}get bold(){return R(this,On,bl).call(this,1)}get disableFontFace(){return R(this,On,bl).call(this,2)}get fontExtraProperties(){return R(this,On,bl).call(this,3)}get isInvalidPDFjsFont(){return R(this,On,bl).call(this,4)}get isType3Font(){return R(this,On,bl).call(this,5)}get italic(){return R(this,On,bl).call(this,6)}get missingFile(){return R(this,On,bl).call(this,7)}get remeasure(){return R(this,On,bl).call(this,8)}get vertical(){return R(this,On,bl).call(this,9)}get ascent(){return R(this,On,iI).call(this,0)}get defaultWidth(){return R(this,On,iI).call(this,1)}get descent(){return R(this,On,iI).call(this,2)}get bbox(){let t=l(ke,av);if(l(this,Rr).getUint8(t)===0)return;t+=1;let r=[];for(let i=0;i<4;i++)r.push(l(this,Rr).getInt16(t,!0)),t+=2;return r}get fontMatrix(){let t=l(ke,ov);if(l(this,Rr).getUint8(t)===0)return;t+=1;let r=[];for(let i=0;i<6;i++)r.push(l(this,Rr).getFloat64(t,!0)),t+=8;return r}get defaultVMetrics(){let t=l(ke,lv);if(l(this,Rr).getUint8(t)===0)return;t+=1;let r=[];for(let i=0;i<3;i++)r.push(l(this,Rr).getInt16(t,!0)),t+=2;return r}get fallbackName(){return R(this,On,C1).call(this,0)}get loadedName(){return R(this,On,C1).call(this,1)}get mimetype(){return R(this,On,C1).call(this,2)}get name(){return R(this,On,C1).call(this,3)}get data(){let t=l(ke,_a),e=l(this,Rr).getUint32(t);t+=4+e;let r=l(this,Rr).getUint32(t);t+=4+r;let i=l(this,Rr).getUint32(t);t+=4+i;let s=l(this,Rr).getUint32(t);if(s!==0)return new Uint8Array(l(this,Cc),t+4,s)}clearData(){let t=l(ke,_a),e=l(this,Rr).getUint32(t);t+=4+e;let r=l(this,Rr).getUint32(t);t+=4+r;let i=l(this,Rr).getUint32(t);t+=4+i;let s=l(this,Rr).getUint32(t);new Uint8Array(l(this,Cc),t+4,s).fill(0),l(this,Rr).setUint32(t,0)}get cssFontInfo(){let t=l(ke,_a),e=l(this,Rr).getUint32(t);t+=4+e;let r=l(this,Rr).getUint32(t);t+=4+r;let i=l(this,Rr).getUint32(t);if(i===0)return null;let s=new Uint8Array(i);return s.set(new Uint8Array(l(this,Cc),t+4,i)),new FI(s.buffer)}get systemFontInfo(){let t=l(ke,_a),e=l(this,Rr).getUint32(t);t+=4+e;let r=l(this,Rr).getUint32(t);if(r===0)return null;let i=new Uint8Array(r);return i.set(new Uint8Array(l(this,Cc),t+4,r)),new BI(i.buffer)}static write(t){let e=t.systemFontInfo?BI.write(t.systemFontInfo):null,r=t.cssFontInfo?FI.write(t.cssFontInfo):null,i=new TextEncoder,s={},a=0;for(let y of ke.strings)s[y]=i.encode(t[y]),a+=4+s[y].length;let o=l(ke,_a)+4+a+4+(e?e.byteLength:0)+4+(r?r.byteLength:0)+4+(t.data?t.data.length:0),c=new ArrayBuffer(o),u=new Uint8Array(c),h=new DataView(c),f=0,d=ke.bools.length,p=0,g=0;for(let y=0;y<d;y++){let b=t[ke.bools[y]];p|=(b===void 0?0:b?2:1)<<g,g+=2,(g===8||y===d-1)&&(h.setUint8(f++,p),p=0,g=0)}er(f===l(ke,sv),"FontInfo.write: Boolean properties offset mismatch");for(let y of ke.numbers)h.setFloat64(f,t[y]),f+=8;if(er(f===l(ke,av),"FontInfo.write: Number properties offset mismatch"),t.bbox){h.setUint8(f++,4);for(let y of t.bbox)h.setInt16(f,y,!0),f+=2}else h.setUint8(f++,0),f+=8;if(er(f===l(ke,ov),"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){h.setUint8(f++,6);for(let y of t.fontMatrix)h.setFloat64(f,y,!0),f+=8}else h.setUint8(f++,0),f+=48;if(er(f===l(ke,lv),"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){h.setUint8(f++,1);for(let y of t.defaultVMetrics)h.setInt16(f,y,!0),f+=2}else h.setUint8(f++,0),f+=6;er(f===l(ke,_a),"FontInfo.write: DefaultVMetrics properties offset mismatch"),h.setUint32(l(ke,_a),0),f+=4;for(let y of ke.strings){let b=s[y],m=b.length;h.setUint32(f,m),u.set(b,f+4),f+=4+m}if(h.setUint32(l(ke,_a),f-l(ke,_a)-4),!e)h.setUint32(f,0),f+=4;else{let y=e.byteLength;h.setUint32(f,y),er(f+4+y<=c.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),u.set(new Uint8Array(e),f+4),f+=4+y}if(!r)h.setUint32(f,0),f+=4;else{let y=r.byteLength;h.setUint32(f,y),er(f+4+y<=c.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),u.set(new Uint8Array(r),f+4),f+=4+y}return t.data===void 0?(h.setUint32(f,0),f+=4):(h.setUint32(f,t.data.length),u.set(t.data,f+4),f+=4+t.data.length),er(f<=c.byteLength,"FontInfo.write: Buffer overflow"),c.transferToFixedLength(f)}};sv=new WeakMap,av=new WeakMap,ov=new WeakMap,lv=new WeakMap,_a=new WeakMap,Cc=new WeakMap,L2=new WeakMap,Rr=new WeakMap,On=new WeakSet,bl=function(t){er(t<ke.bools.length,"Invalid boolean index");let e=Math.floor(t/4),r=t*2%8,i=l(this,Rr).getUint8(e)>>r&3;return i===0?void 0:i===2},iI=function(t){return er(t<ke.numbers.length,"Invalid number index"),l(this,Rr).getFloat64(l(ke,sv)+t*8)},C1=function(t){er(t<ke.strings.length,"Invalid string index");let e=l(ke,_a)+4;for(let s=0;s<t;s++)e+=l(this,Rr).getUint32(e)+4;let r=l(this,Rr).getUint32(e),i=new Uint8Array(r);return i.set(new Uint8Array(l(this,Cc),e+4,r)),l(this,L2).decode(i)},Lt(ke,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),Lt(ke,"numbers",["ascent","defaultWidth","descent"]),Lt(ke,"strings",["fallbackName","loadedName","mimetype","name"]),T(ke,sv,Math.ceil(ke.bools.length*2/8)),T(ke,av,l(ke,sv)+ke.numbers.length*8),T(ke,ov,l(ke,av)+1+8),T(ke,lv,l(ke,ov)+1+48),T(ke,_a,l(ke,lv)+1+6);MF=ke,Yr=class Yr{constructor(t){this.buffer=t,this.view=new DataView(t),this.data=new Uint8Array(t)}static write(t){let e,r=null,i=[],s=[],a=[],o=[],c=null,u=null;switch(t[0]){case"RadialAxial":e=t[1]==="axial"?1:2,r=t[2],a=t[3],e===1?i.push(...t[4],...t[5]):i.push(t[4][0],t[4][1],t[6],t[5][0],t[5][1],t[7]);break;case"Mesh":e=3,c=t[1],i=t[2],s=t[3],o=t[4]||[],r=t[6],u=t[7];break;default:throw new Error(`Unsupported pattern type: ${t[0]}`)}let h=Math.floor(i.length/2),f=Math.floor(s.length/3),d=a.length,p=o.length,g=0;for(let S of o)g+=1,g=Math.ceil(g/4)*4,g+=4+S.coords.length*4,g+=4+S.colors.length*4,S.verticesPerRow!==void 0&&(g+=4);let y=20+h*8+f*3+d*8+(r?16:0)+(u?3:0)+g,b=new ArrayBuffer(y),m=new DataView(b),w=new Uint8Array(b);m.setUint8(l(Yr,k2),e),m.setUint8(l(Yr,M2),r?1:0),m.setUint8(l(Yr,F2),u?1:0),m.setUint8(l(Yr,B2),c),m.setUint32(l(Yr,U2),h,!0),m.setUint32(l(Yr,j2),f,!0),m.setUint32(l(Yr,$2),d,!0),m.setUint32(l(Yr,H2),p,!0);let A=20;new Float32Array(b,A,h*2).set(i),A+=h*8,w.set(s,A),A+=f*3;for(let[S,I]of a)m.setFloat32(A,S,!0),A+=4,m.setUint32(A,parseInt(I.slice(1),16),!0),A+=4;if(r)for(let S of r)m.setFloat32(A,S,!0),A+=4;u&&(w.set(u,A),A+=3);for(let S=0;S<o.length;S++){let I=o[S];m.setUint8(A,I.type),A+=1,A=Math.ceil(A/4)*4,m.setUint32(A,I.coords.length,!0),A+=4,new Int32Array(b,A,I.coords.length).set(I.coords),A+=I.coords.length*4,m.setUint32(A,I.colors.length,!0),A+=4,new Int32Array(b,A,I.colors.length).set(I.colors),A+=I.colors.length*4,I.verticesPerRow!==void 0&&(m.setUint32(A,I.verticesPerRow,!0),A+=4)}return b}getIR(){let t=this.view,e=this.data[l(Yr,k2)],r=!!this.data[l(Yr,M2)],i=!!this.data[l(Yr,F2)],s=t.getUint32(l(Yr,U2),!0),a=t.getUint32(l(Yr,j2),!0),o=t.getUint32(l(Yr,$2),!0),c=t.getUint32(l(Yr,H2),!0),u=20,h=new Float32Array(this.buffer,u,s*2);u+=s*8;let f=new Uint8Array(this.buffer,u,a*3);u+=a*3;let d=[];for(let b=0;b<o;++b){let m=t.getFloat32(u,!0);u+=4;let w=t.getUint32(u,!0);u+=4,d.push([m,`#${w.toString(16).padStart(6,"0")}`])}let p=null;if(r){p=[];for(let b=0;b<4;++b)p.push(t.getFloat32(u,!0)),u+=4}let g=null;i&&(g=new Uint8Array(this.buffer,u,3),u+=3);let y=[];for(let b=0;b<c;++b){let m=t.getUint8(u);u+=1,u=Math.ceil(u/4)*4;let w=t.getUint32(u,!0);u+=4;let A=new Int32Array(this.buffer,u,w);u+=w*4;let _=t.getUint32(u,!0);u+=4;let S=new Int32Array(this.buffer,u,_);u+=_*4;let I={type:m,coords:A,colors:S};m===lF.LATTICE&&(I.verticesPerRow=t.getUint32(u,!0),u+=4),y.push(I)}if(e===1)return["RadialAxial","axial",p,d,Array.from(h.slice(0,2)),Array.from(h.slice(2,4)),null,null];if(e===2)return["RadialAxial","radial",p,d,[h[0],h[1]],[h[3],h[4]],h[2],h[5]];if(e===3){let b=this.data[l(Yr,B2)],m=null;if(h.length>0){let w=h[0],A=h[0],_=h[1],S=h[1];for(let I=0;I<h.length;I+=2){let C=h[I],M=h[I+1];w=w>C?C:w,_=_>M?M:_,A=A<C?C:A,S=S<M?M:S}m=[w,_,A,S]}return["Mesh",b,h,f,y,m,p,g]}throw new Error(`Unsupported pattern kind: ${e}`)}};k2=new WeakMap,M2=new WeakMap,F2=new WeakMap,B2=new WeakMap,U2=new WeakMap,j2=new WeakMap,$2=new WeakMap,H2=new WeakMap,T(Yr,k2,0),T(Yr,M2,1),T(Yr,F2,2),T(Yr,B2,3),T(Yr,U2,4),T(Yr,j2,8),T(Yr,$2,12),T(Yr,H2,16);FF=Yr,BF=class{constructor(t){T(this,cv);x(this,cv,t)}static write(t){let e,r;return Pn.isFloat16ArraySupported?(r=new ArrayBuffer(t.length*2),e=new Float16Array(r)):(r=new ArrayBuffer(t.length*4),e=new Float32Array(r)),e.set(t),r}get path(){return Pn.isFloat16ArraySupported?new Float16Array(l(this,cv)):new Float32Array(l(this,cv))}};cv=new WeakMap;UF=n=>typeof n=="object"&&Number.isInteger(n?.num)&&n.num>=0&&Number.isInteger(n?.gen)&&n.gen>=0,Uht=n=>typeof n=="object"&&typeof n?.name=="string",EX=Nht.bind(null,UF,Uht),jF=class{constructor(){T(this,eh,new Map);T(this,vD,Promise.resolve())}postMessage(t,e){let r={data:structuredClone(t,e?{transfer:e}:null)};l(this,vD).then(()=>{for(let[i]of l(this,eh))i.call(this,r)})}addEventListener(t,e,r=null){let i=null;if(r?.signal instanceof AbortSignal){let{signal:s}=r;if(s.aborted){_e("LoopbackPort - cannot use an `aborted` signal.");return}let a=()=>this.removeEventListener(t,e);i=()=>s.removeEventListener("abort",a),s.addEventListener("abort",a)}l(this,eh).set(e,i)}removeEventListener(t,e){l(this,eh).get(e)?.(),l(this,eh).delete(e)}terminate(){for(let[,t]of l(this,eh))t?.();l(this,eh).clear()}};eh=new WeakMap,vD=new WeakMap;zR={DATA:1,ERROR:2},Kn={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};Tg=class{constructor(t,e,r){T(this,Go);T(this,uv,new AbortController);this.sourceName=t,this.targetName=e,this.comObj=r,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),r.addEventListener("message",R(this,Go,xX).bind(this),{signal:l(this,uv).signal})}on(t,e){let r=this.actionHandler;if(r[t])throw new Error(`There is already an actionName called "${t}"`);r[t]=e}send(t,e,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},r)}sendWithPromise(t,e,r){let i=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[i]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:e},r)}catch(a){s.reject(a)}return s.promise}sendWithStream(t,e,r,i){let s=this.streamId++,a=this.sourceName,o=this.targetName,c=this.comObj;return new ReadableStream({start:u=>{let h=Promise.withResolvers();return this.streamControllers[s]={controller:u,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:a,targetName:o,action:t,streamId:s,data:e,desiredSize:u.desiredSize},i),h.promise},pull:u=>{let h=Promise.withResolvers();return this.streamControllers[s].pullCall=h,c.postMessage({sourceName:a,targetName:o,stream:Kn.PULL,streamId:s,desiredSize:u.desiredSize}),h.promise},cancel:u=>{er(u instanceof Error,"cancel must have a valid reason");let h=Promise.withResolvers();return this.streamControllers[s].cancelCall=h,this.streamControllers[s].isClosed=!0,c.postMessage({sourceName:a,targetName:o,stream:Kn.CANCEL,streamId:s,reason:Js(u)}),h.promise}},r)}destroy(){l(this,uv)?.abort(),x(this,uv,null)}};uv=new WeakMap,Go=new WeakSet,xX=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){R(this,Go,_X).call(this,t);return}if(t.callback){let r=t.callbackId,i=this.callbackCapabilities[r];if(!i)throw new Error(`Cannot resolve callback ${r}`);if(delete this.callbackCapabilities[r],t.callback===zR.DATA)i.resolve(t.data);else if(t.callback===zR.ERROR)i.reject(Js(t.reason));else throw new Error("Unexpected callback case");return}let e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){let r=this.sourceName,i=t.sourceName,s=this.comObj;Promise.try(e,t.data).then(function(a){s.postMessage({sourceName:r,targetName:i,callback:zR.DATA,callbackId:t.callbackId,data:a})},function(a){s.postMessage({sourceName:r,targetName:i,callback:zR.ERROR,callbackId:t.callbackId,reason:Js(a)})});return}if(t.streamId){R(this,Go,SX).call(this,t);return}e(t.data)},SX=function(t){let e=t.streamId,r=this.sourceName,i=t.sourceName,s=this.comObj,a=this,o=this.actionHandler[t.action],c={enqueue(u,h=1,f){if(this.isCancelled)return;let d=this.desiredSize;this.desiredSize-=h,d>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:r,targetName:i,stream:Kn.ENQUEUE,streamId:e,chunk:u},f)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:r,targetName:i,stream:Kn.CLOSE,streamId:e}),delete a.streamSinks[e])},error(u){er(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,s.postMessage({sourceName:r,targetName:i,stream:Kn.ERROR,streamId:e,reason:Js(u)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[e]=c,Promise.try(o,t.data,c).then(function(){s.postMessage({sourceName:r,targetName:i,stream:Kn.START_COMPLETE,streamId:e,success:!0})},function(u){s.postMessage({sourceName:r,targetName:i,stream:Kn.START_COMPLETE,streamId:e,reason:Js(u)})})},_X=function(t){let e=t.streamId,r=this.sourceName,i=t.sourceName,s=this.comObj,a=this.streamControllers[e],o=this.streamSinks[e];switch(t.stream){case Kn.START_COMPLETE:t.success?a.startCall.resolve():a.startCall.reject(Js(t.reason));break;case Kn.PULL_COMPLETE:t.success?a.pullCall.resolve():a.pullCall.reject(Js(t.reason));break;case Kn.PULL:if(!o){s.postMessage({sourceName:r,targetName:i,stream:Kn.PULL_COMPLETE,streamId:e,success:!0});break}o.desiredSize<=0&&t.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=t.desiredSize,Promise.try(o.onPull||wV).then(function(){s.postMessage({sourceName:r,targetName:i,stream:Kn.PULL_COMPLETE,streamId:e,success:!0})},function(u){s.postMessage({sourceName:r,targetName:i,stream:Kn.PULL_COMPLETE,streamId:e,reason:Js(u)})});break;case Kn.ENQUEUE:if(er(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(t.chunk);break;case Kn.CLOSE:if(er(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),R(this,Go,sI).call(this,a,e);break;case Kn.ERROR:er(a,"error should have stream controller"),a.controller.error(Js(t.reason)),R(this,Go,sI).call(this,a,e);break;case Kn.CANCEL_COMPLETE:t.success?a.cancelCall.resolve():a.cancelCall.reject(Js(t.reason)),R(this,Go,sI).call(this,a,e);break;case Kn.CANCEL:if(!o)break;let c=Js(t.reason);Promise.try(o.onCancel||wV,c).then(function(){s.postMessage({sourceName:r,targetName:i,stream:Kn.CANCEL_COMPLETE,streamId:e,success:!0})},function(u){s.postMessage({sourceName:r,targetName:i,stream:Kn.CANCEL_COMPLETE,streamId:e,reason:Js(u)})}),o.sinkCapability.reject(c),o.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},sI=async function(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]};UI=class{constructor({enableHWA:t=!1}){T(this,z2,!1);x(this,z2,t)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");let r=this._createCanvas(t,e);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!l(this,z2)})}}reset(t,e,r){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||r<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=r}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){Wr("Abstract method `_createCanvas` called.")}};z2=new WeakMap;$F=class extends UI{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){let r=this._document.createElement("canvas");return r.width=t,r.height=e,r}},jI=class{constructor({baseUrl:t=null,isCompressed:e=!0}){this.baseUrl=t,this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");let e=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(e).then(r=>({cMapData:r,isCompressed:this.isCompressed})).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)})}async _fetch(t){Wr("Abstract method `_fetch` called.")}},$I=class extends jI{async _fetch(t){let e=await hw(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):Kx(e)}},GAt=Me(2489),HI=class{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,r,i,s){return"none"}destroy(t=!1){}},HF=class extends HI{constructor({docId:e,ownerDocument:r=globalThis.document}){super();T(this,he);T(this,Zg);T(this,hv);T(this,rh);T(this,nh);T(this,us);T(this,Jg);T(this,Qg,0);x(this,nh,e),x(this,us,r)}addFilter(e){if(!e)return"none";let r=l(this,he,as).get(e);if(r)return r;let[i,s,a]=R(this,he,aI).call(this,e),o=e.length===1?i:`${i}${s}${a}`;if(r=l(this,he,as).get(o),r)return l(this,he,as).set(e,r),r;let c=`g_${l(this,nh)}_transfer_map_${ze(this,Qg)._++}`,u=R(this,he,Ab).call(this,c);l(this,he,as).set(e,u),l(this,he,as).set(o,u);let h=R(this,he,Eb).call(this,c);return R(this,he,D1).call(this,i,s,a,h),u}addHCMFilter(e,r){let i=`${e}-${r}`,s="base",a=l(this,he,R1).get(s);if(a?.key===i||(a?(a.filter?.remove(),a.key=i,a.url="none",a.filter=null):(a={key:i,url:"none",filter:null},l(this,he,R1).set(s,a)),!e||!r))return a.url;let o=R(this,he,O1).call(this,e);e=ie.makeHexColor(...o);let c=R(this,he,O1).call(this,r);if(r=ie.makeHexColor(...c),l(this,he,wb).style.color="",e==="#000000"&&r==="#ffffff"||e===r)return a.url;let u=new Array(256);for(let g=0;g<=255;g++){let y=g/255;u[g]=y<=.03928?y/12.92:((y+.055)/1.055)**2.4}let h=u.join(","),f=`g_${l(this,nh)}_hcm_filter`,d=a.filter=R(this,he,Eb).call(this,f);R(this,he,D1).call(this,h,h,h,d),R(this,he,zF).call(this,d);let p=(g,y)=>{let b=o[g]/255,m=c[g]/255,w=new Array(y+1);for(let A=0;A<=y;A++)w[A]=b+A/y*(m-b);return w.join(",")};return R(this,he,D1).call(this,p(0,5),p(1,5),p(2,5),d),a.url=R(this,he,Ab).call(this,f),a.url}addAlphaFilter(e){let r=l(this,he,as).get(e);if(r)return r;let[i]=R(this,he,aI).call(this,[e]),s=`alpha_${i}`;if(r=l(this,he,as).get(s),r)return l(this,he,as).set(e,r),r;let a=`g_${l(this,nh)}_alpha_map_${ze(this,Qg)._++}`,o=R(this,he,Ab).call(this,a);l(this,he,as).set(e,o),l(this,he,as).set(s,o);let c=R(this,he,Eb).call(this,a);return R(this,he,WF).call(this,i,c),o}addLuminosityFilter(e){let r=l(this,he,as).get(e||"luminosity");if(r)return r;let i,s;if(e?([i]=R(this,he,aI).call(this,[e]),s=`luminosity_${i}`):s="luminosity",r=l(this,he,as).get(s),r)return l(this,he,as).set(e,r),r;let a=`g_${l(this,nh)}_luminosity_map_${ze(this,Qg)._++}`,o=R(this,he,Ab).call(this,a);l(this,he,as).set(e,o),l(this,he,as).set(s,o);let c=R(this,he,Eb).call(this,a);return R(this,he,TX).call(this,c),e&&R(this,he,WF).call(this,i,c),o}addHighlightHCMFilter(e,r,i,s,a){let o=`${r}-${i}-${s}-${a}`,c=l(this,he,R1).get(e);if(c?.key===o||(c?(c.filter?.remove(),c.key=o,c.url="none",c.filter=null):(c={key:o,url:"none",filter:null},l(this,he,R1).set(e,c)),!r||!i))return c.url;let[u,h]=[r,i].map(R(this,he,O1).bind(this)),f=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),d=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[p,g]=[s,a].map(R(this,he,O1).bind(this));d<f&&([f,d,p,g]=[d,f,g,p]),l(this,he,wb).style.color="";let y=(w,A,_)=>{let S=new Array(256),I=(d-f)/_,C=w/255,M=(A-w)/(255*_),z=0;for(let G=0;G<=_;G++){let Y=Math.round(f+G*I),L=C+G*M;for(let j=z;j<=Y;j++)S[j]=L;z=Y+1}for(let G=z;G<256;G++)S[G]=S[z-1];return S.join(",")},b=`g_${l(this,nh)}_hcm_${e}_filter`,m=c.filter=R(this,he,Eb).call(this,b);return R(this,he,zF).call(this,m),R(this,he,D1).call(this,y(p[0],g[0],5),y(p[1],g[1],5),y(p[2],g[2],5),m),c.url=R(this,he,Ab).call(this,b),c.url}destroy(e=!1){e&&l(this,Jg)?.size||(l(this,rh)?.parentNode.parentNode.remove(),x(this,rh,null),l(this,hv)?.clear(),x(this,hv,null),l(this,Jg)?.clear(),x(this,Jg,null),x(this,Qg,0))}};Zg=new WeakMap,hv=new WeakMap,rh=new WeakMap,nh=new WeakMap,us=new WeakMap,Jg=new WeakMap,Qg=new WeakMap,he=new WeakSet,as=function(){return l(this,hv)||x(this,hv,new Map)},R1=function(){return l(this,Jg)||x(this,Jg,new Map)},wb=function(){if(!l(this,rh)){let e=l(this,us).createElement("div"),{style:r}=e;r.visibility="hidden",r.contain="strict",r.width=r.height=0,r.position="absolute",r.top=r.left=0,r.zIndex=-1;let i=l(this,us).createElementNS(Uu,"svg");i.setAttribute("width",0),i.setAttribute("height",0),x(this,rh,l(this,us).createElementNS(Uu,"defs")),e.append(i),i.append(l(this,rh)),l(this,us).body.append(e)}return l(this,rh)},aI=function(e){if(e.length===1){let u=e[0],h=new Array(256);for(let d=0;d<256;d++)h[d]=u[d]/255;let f=h.join(",");return[f,f,f]}let[r,i,s]=e,a=new Array(256),o=new Array(256),c=new Array(256);for(let u=0;u<256;u++)a[u]=r[u]/255,o[u]=i[u]/255,c[u]=s[u]/255;return[a.join(","),o.join(","),c.join(",")]},Ab=function(e){if(l(this,Zg)===void 0){x(this,Zg,"");let r=l(this,us).URL;r!==l(this,us).baseURI&&(Zx(r)?_e('#createUrl: ignore "data:"-URL for performance reasons.'):x(this,Zg,B3(r,"")))}return`url(${l(this,Zg)}#${e})`},TX=function(e){let r=l(this,us).createElementNS(Uu,"feColorMatrix");r.setAttribute("type","matrix"),r.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"),e.append(r)},zF=function(e){let r=l(this,us).createElementNS(Uu,"feColorMatrix");r.setAttribute("type","matrix"),r.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"),e.append(r)},Eb=function(e){let r=l(this,us).createElementNS(Uu,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",e),l(this,he,wb).append(r),r},I1=function(e,r,i){let s=l(this,us).createElementNS(Uu,r);s.setAttribute("type","discrete"),s.setAttribute("tableValues",i),e.append(s)},D1=function(e,r,i,s){let a=l(this,us).createElementNS(Uu,"feComponentTransfer");s.append(a),R(this,he,I1).call(this,a,"feFuncR",e),R(this,he,I1).call(this,a,"feFuncG",r),R(this,he,I1).call(this,a,"feFuncB",i)},WF=function(e,r){let i=l(this,us).createElementNS(Uu,"feComponentTransfer");r.append(i),R(this,he,I1).call(this,i,"feFuncA",e)},O1=function(e){return l(this,he,wb).style.color=e,fw(getComputedStyle(l(this,he,wb)).getPropertyValue("color"))};zI=class{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");let e=`${this.baseUrl}${t}`;return this._fetch(e).catch(r=>{throw new Error(`Unable to load font data at: ${e}`)})}async _fetch(t){Wr("Abstract method `_fetch` called.")}},WI=class extends zI{async _fetch(t){let e=await hw(t,"arraybuffer");return new Uint8Array(e)}},GI=class{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!t)throw new Error("Wasm filename must be specified.");let e=`${this.baseUrl}${t}`;return this._fetch(e).catch(r=>{throw new Error(`Unable to load wasm data at: ${e}`)})}async _fetch(t){Wr("Abstract method `_fetch` called.")}},VI=class extends GI{async _fetch(t){let e=await hw(t,"arraybuffer");return new Uint8Array(e)}};if(Os){let n;try{let t=process.getBuiltinModule("module").createRequire("");try{n=t("@napi-rs/canvas")}catch(e){_e(`Cannot load "@napi-rs/canvas" package: "${e}".`)}}catch(t){_e(`Cannot access the \`require\` function: "${t}".`)}globalThis.DOMMatrix||(n?.DOMMatrix?globalThis.DOMMatrix=n.DOMMatrix:_e("Cannot polyfill `DOMMatrix`, rendering may be broken.")),globalThis.ImageData||(n?.ImageData?globalThis.ImageData=n.ImageData:_e("Cannot polyfill `ImageData`, rendering may be broken.")),globalThis.Path2D||(n?.Path2D?globalThis.Path2D=n.Path2D:_e("Cannot polyfill `Path2D`, rendering may be broken.")),globalThis.navigator?.language||(globalThis.navigator={language:"en-US",platform:"",userAgent:""})}GF=class extends HI{},VF=class extends UI{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire("")("@napi-rs/canvas").createCanvas(t,e)}},XF=class extends jI{async _fetch(t){return $3(t)}},qF=class extends zI{async _fetch(t){return $3(t)}},YF=class extends GI{async _fetch(t){return $3(t)}},VAt=Me(7588),yb="__forcedDependency",{floor:AV,ceil:EV}=Math;KF=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],ZF=class{constructor(t,e){T(this,fv);T(this,gd);x(this,fv,t),x(this,gd,e)}get length(){return l(this,fv).length}isEmpty(t){return l(this,fv)[t]===KF}minX(t){return l(this,gd)[t*4+0]/256}minY(t){return l(this,gd)[t*4+1]/256}maxX(t){return(l(this,gd)[t*4+2]+1)/256}maxY(t){return(l(this,gd)[t*4+3]+1)/256}};fv=new WeakMap,gd=new WeakMap;GR=(n,t)=>{if(!n)return;let e=n.get(t);return e||(e={dependencies:new Set,isRenderingOperation:!1},n.set(t,e)),e},JF=class{constructor(t,e,r=!1){T(this,G2);T(this,ea,{__proto__:null});T(this,ra,{__proto__:null,transform:[],moveText:[],sameLineText:[],[yb]:[]});T(this,tm,new Map);T(this,xl,[]);T(this,em,[]);T(this,ih,[[1,0,0,1,0,0]]);T(this,Ar,[-1/0,-1/0,1/0,1/0]);T(this,Ir,new Float64Array([1/0,1/0,-1/0,-1/0]));T(this,sh,-1);T(this,na,new Set);T(this,W2,new Map);T(this,dv,new Map);T(this,rm);T(this,nm);T(this,ah);T(this,hs);T(this,Rc);x(this,rm,t.width),x(this,nm,t.height),R(this,G2,QF).call(this,e),r&&x(this,Rc,new Map)}growOperationsCount(t){t>=l(this,hs).length&&R(this,G2,QF).call(this,t,l(this,hs))}save(t){return x(this,ea,{__proto__:l(this,ea)}),x(this,ra,{__proto__:l(this,ra),transform:{__proto__:l(this,ra).transform},moveText:{__proto__:l(this,ra).moveText},sameLineText:{__proto__:l(this,ra).sameLineText},[yb]:{__proto__:l(this,ra)[yb]}}),x(this,Ar,{__proto__:l(this,Ar)}),l(this,xl).push(t),this}restore(t){let e=Object.getPrototypeOf(l(this,ea));if(e===null)return this;x(this,ea,e),x(this,ra,Object.getPrototypeOf(l(this,ra))),x(this,Ar,Object.getPrototypeOf(l(this,Ar)));let r=l(this,xl).pop();return r!==void 0&&(GR(l(this,Rc),t)?.dependencies.add(r),l(this,hs)[t]=l(this,hs)[r]),this}recordOpenMarker(t){return l(this,xl).push(t),this}getOpenMarker(){return l(this,xl).length===0?null:l(this,xl).at(-1)}recordCloseMarker(t){let e=l(this,xl).pop();return e!==void 0&&(GR(l(this,Rc),t)?.dependencies.add(e),l(this,hs)[t]=l(this,hs)[e]),this}beginMarkedContent(t){return l(this,em).push(t),this}endMarkedContent(t){let e=l(this,em).pop();return e!==void 0&&(GR(l(this,Rc),t)?.dependencies.add(e),l(this,hs)[t]=l(this,hs)[e]),this}pushBaseTransform(t){return l(this,ih).push(ie.multiplyByDOMMatrix(l(this,ih).at(-1),t.getTransform())),this}popBaseTransform(){return l(this,ih).length>1&&l(this,ih).pop(),this}recordSimpleData(t,e){return l(this,ea)[t]=e,this}recordIncrementalData(t,e){return l(this,ra)[t].push(e),this}resetIncrementalData(t,e){return l(this,ra)[t].length=0,this}recordNamedData(t,e){return l(this,tm).set(t,e),this}recordSimpleDataFromNamed(t,e,r){l(this,ea)[t]=l(this,tm).get(e)??r}recordFutureForcedDependency(t,e){return this.recordIncrementalData(yb,e),this}inheritSimpleDataAsFutureForcedDependencies(t){for(let e of t)e in l(this,ea)&&this.recordFutureForcedDependency(e,l(this,ea)[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let t of l(this,na))this.recordFutureForcedDependency(yb,t);return this}resetBBox(t){return l(this,sh)!==t&&(x(this,sh,t),l(this,Ir)[0]=1/0,l(this,Ir)[1]=1/0,l(this,Ir)[2]=-1/0,l(this,Ir)[3]=-1/0),this}recordClipBox(t,e,r,i,s,a){let o=ie.multiplyByDOMMatrix(l(this,ih).at(-1),e.getTransform()),c=[1/0,1/0,-1/0,-1/0];ie.axialAlignedBoundingBox([r,s,i,a],o,c);let u=ie.intersect(l(this,Ar),c);return u?(l(this,Ar)[0]=u[0],l(this,Ar)[1]=u[1],l(this,Ar)[2]=u[2],l(this,Ar)[3]=u[3]):(l(this,Ar)[0]=l(this,Ar)[1]=1/0,l(this,Ar)[2]=l(this,Ar)[3]=-1/0),this}recordBBox(t,e,r,i,s,a){let o=l(this,Ar);if(o[0]===1/0)return this;let c=ie.multiplyByDOMMatrix(l(this,ih).at(-1),e.getTransform());if(o[0]===-1/0)return ie.axialAlignedBoundingBox([r,s,i,a],c,l(this,Ir)),this;let u=[1/0,1/0,-1/0,-1/0];return ie.axialAlignedBoundingBox([r,s,i,a],c,u),l(this,Ir)[0]=Math.min(l(this,Ir)[0],Math.max(u[0],o[0])),l(this,Ir)[1]=Math.min(l(this,Ir)[1],Math.max(u[1],o[1])),l(this,Ir)[2]=Math.max(l(this,Ir)[2],Math.min(u[2],o[2])),l(this,Ir)[3]=Math.max(l(this,Ir)[3],Math.min(u[3],o[3])),this}recordCharacterBBox(t,e,r,i=1,s=0,a=0,o){let c=r.bbox,u,h;if(c&&(u=c[2]!==c[0]&&c[3]!==c[1]&&l(this,dv).get(r),u!==!1&&(h=[0,0,0,0],ie.axialAlignedBoundingBox(c,r.fontMatrix,h),(i!==1||s!==0||a!==0)&&ie.scaleMinMax([i,0,0,-i,s,a],h),u)))return this.recordBBox(t,e,h[0],h[2],h[1],h[3]);if(!o)return this.recordFullPageBBox(t);let f=o();return c&&h&&u===void 0&&(u=h[0]<=s-f.actualBoundingBoxLeft&&h[2]>=s+f.actualBoundingBoxRight&&h[1]<=a-f.actualBoundingBoxAscent&&h[3]>=a+f.actualBoundingBoxDescent,l(this,dv).set(r,u),u)?this.recordBBox(t,e,h[0],h[2],h[1],h[3]):this.recordBBox(t,e,s-f.actualBoundingBoxLeft,s+f.actualBoundingBoxRight,a-f.actualBoundingBoxAscent,a+f.actualBoundingBoxDescent)}recordFullPageBBox(t){return l(this,Ir)[0]=Math.max(0,l(this,Ar)[0]),l(this,Ir)[1]=Math.max(0,l(this,Ar)[1]),l(this,Ir)[2]=Math.min(l(this,rm),l(this,Ar)[2]),l(this,Ir)[3]=Math.min(l(this,nm),l(this,Ar)[3]),this}getSimpleIndex(t){return l(this,ea)[t]}recordDependencies(t,e){let r=l(this,na),i=l(this,ea),s=l(this,ra);for(let a of e)a in l(this,ea)?r.add(i[a]):a in s&&s[a].forEach(r.add,r);return this}recordNamedDependency(t,e){return l(this,tm).has(e)&&l(this,na).add(l(this,tm).get(e)),this}recordOperation(t,e=!1){if(this.recordDependencies(t,[yb]),l(this,Rc)){let r=GR(l(this,Rc),t),{dependencies:i}=r;l(this,na).forEach(i.add,i),l(this,xl).forEach(i.add,i),l(this,em).forEach(i.add,i),i.delete(t),r.isRenderingOperation=!0}if(l(this,sh)===t){let r=AV(l(this,Ir)[0]*256/l(this,rm)),i=AV(l(this,Ir)[1]*256/l(this,nm)),s=EV(l(this,Ir)[2]*256/l(this,rm)),a=EV(l(this,Ir)[3]*256/l(this,nm));WR(l(this,ah),t,r,i,s,a);for(let o of l(this,na))o!==t&&WR(l(this,ah),o,r,i,s,a);for(let o of l(this,xl))o!==t&&WR(l(this,ah),o,r,i,s,a);for(let o of l(this,em))o!==t&&WR(l(this,ah),o,r,i,s,a);e||(l(this,na).clear(),x(this,sh,-1))}return this}recordShowTextOperation(t,e=!1){let r=Array.from(l(this,na));this.recordOperation(t,e),this.recordIncrementalData("sameLineText",t);for(let i of r)this.recordIncrementalData("sameLineText",i);return this}bboxToClipBoxDropOperation(t,e=!1){return l(this,sh)===t&&(x(this,sh,-1),l(this,Ar)[0]=Math.max(l(this,Ar)[0],l(this,Ir)[0]),l(this,Ar)[1]=Math.max(l(this,Ar)[1],l(this,Ir)[1]),l(this,Ar)[2]=Math.min(l(this,Ar)[2],l(this,Ir)[2]),l(this,Ar)[3]=Math.min(l(this,Ar)[3],l(this,Ir)[3]),e||l(this,na).clear()),this}_takePendingDependencies(){let t=l(this,na);return x(this,na,new Set),t}_extractOperation(t){let e=l(this,W2).get(t);return l(this,W2).delete(t),e}_pushPendingDependencies(t){for(let e of t)l(this,na).add(e)}take(){return l(this,dv).clear(),new ZF(l(this,hs),l(this,ah))}takeDebugMetadata(){return l(this,Rc)}};ea=new WeakMap,ra=new WeakMap,tm=new WeakMap,xl=new WeakMap,em=new WeakMap,ih=new WeakMap,Ar=new WeakMap,Ir=new WeakMap,sh=new WeakMap,na=new WeakMap,W2=new WeakMap,dv=new WeakMap,rm=new WeakMap,nm=new WeakMap,ah=new WeakMap,hs=new WeakMap,Rc=new WeakMap,G2=new WeakSet,QF=function(t,e){let r=new ArrayBuffer(t*4);x(this,ah,new Uint8ClampedArray(r)),x(this,hs,new Uint32Array(r)),e&&e.length>0?(l(this,hs).set(e),l(this,hs).fill(KF,e.length)):l(this,hs).fill(KF)};W3=class W3{constructor(t,e,r){T(this,Hr);T(this,Rn);T(this,Sl);T(this,pv,0);T(this,gv,0);if(t instanceof W3&&l(t,Sl)===!!r)return t;x(this,Hr,t),x(this,Rn,e),x(this,Sl,!!r)}growOperationsCount(){throw new Error("Unreachable")}save(t){return ze(this,gv)._++,l(this,Hr).save(l(this,Rn)),this}restore(t){return l(this,gv)>0&&(l(this,Hr).restore(l(this,Rn)),ze(this,gv)._--),this}recordOpenMarker(t){return ze(this,pv)._++,this}getOpenMarker(){return l(this,pv)>0?l(this,Rn):l(this,Hr).getOpenMarker()}recordCloseMarker(t){return ze(this,pv)._--,this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return l(this,Hr).pushBaseTransform(t),this}popBaseTransform(){return l(this,Hr).popBaseTransform(),this}recordSimpleData(t,e){return l(this,Hr).recordSimpleData(t,l(this,Rn)),this}recordIncrementalData(t,e){return l(this,Hr).recordIncrementalData(t,l(this,Rn)),this}resetIncrementalData(t,e){return l(this,Hr).resetIncrementalData(t,l(this,Rn)),this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,r){return l(this,Hr).recordSimpleDataFromNamed(t,e,l(this,Rn)),this}recordFutureForcedDependency(t,e){return l(this,Hr).recordFutureForcedDependency(t,l(this,Rn)),this}inheritSimpleDataAsFutureForcedDependencies(t){return l(this,Hr).inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return l(this,Hr).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return l(this,Sl)||l(this,Hr).resetBBox(l(this,Rn)),this}recordClipBox(t,e,r,i,s,a){return l(this,Sl)||l(this,Hr).recordClipBox(l(this,Rn),e,r,i,s,a),this}recordBBox(t,e,r,i,s,a){return l(this,Sl)||l(this,Hr).recordBBox(l(this,Rn),e,r,i,s,a),this}recordCharacterBBox(t,e,r,i,s,a,o){return l(this,Sl)||l(this,Hr).recordCharacterBBox(l(this,Rn),e,r,i,s,a,o),this}recordFullPageBBox(t){return l(this,Sl)||l(this,Hr).recordFullPageBBox(l(this,Rn)),this}getSimpleIndex(t){return l(this,Hr).getSimpleIndex(t)}recordDependencies(t,e){return l(this,Hr).recordDependencies(l(this,Rn),e),this}recordNamedDependency(t,e){return l(this,Hr).recordNamedDependency(l(this,Rn),e),this}recordOperation(t){return l(this,Hr).recordOperation(l(this,Rn),!0),this}recordShowTextOperation(t){return l(this,Hr).recordShowTextOperation(l(this,Rn),!0),this}bboxToClipBoxDropOperation(t){return l(this,Sl)||l(this,Hr).bboxToClipBoxDropOperation(l(this,Rn),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}};Hr=new WeakMap,Rn=new WeakMap,Sl=new WeakMap,pv=new WeakMap,gv=new WeakMap;XI=W3,Io={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"]},Wi={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};K1=class{isModifyingCurrentTransform(){return!1}getPattern(){Wr("Abstract method `getPattern` called.")}},eB=class extends K1{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[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(t,e=null){let r,i=this._p0,s=this._p1;if(e&&(i=i.slice(),s=s.slice(),ie.applyTransform(i,e),ie.applyTransform(s,e)),this._type==="axial")r=t.createLinearGradient(i[0],i[1],s[0],s[1]);else if(this._type==="radial"){let a=this._r0,o=this._r1;if(e){let c=new Float32Array(2);ie.singularValueDecompose2dScale(e,c),a*=c[0],o*=c[0]}r=t.createRadialGradient(i[0],i[1],a,s[0],s[1],o)}for(let a of this._colorStops)r.addColorStop(a[0],a[1]);return r}getPattern(t,e,r,i){let s;if(i===Wi.STROKE||i===Wi.FILL){if(this.isOriginBased()){let d=ie.transform(r,e.baseTransform);this.matrix&&(d=ie.transform(d,this.matrix));let p=.001,g=Math.hypot(d[0],d[1]),y=Math.hypot(d[2],d[3]),b=(d[0]*d[2]+d[1]*d[3])/(g*y);if(Math.abs(b)<p)if(this.isRadial()){if(Math.abs(g-y)<p)return this._createGradient(t,d)}else return this._createGradient(t,d)}let a=e.current.getClippedPathBoundingBox(i,gn(t))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,c=Math.ceil(a[3]-a[1])||1,u=e.cachedCanvases.getCanvas("pattern",o,c),h=u.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-a[0],-a[1]),r=ie.transform(r,[1,0,0,1,a[0],a[1]]),h.transform(...e.baseTransform),this.matrix&&h.transform(...this.matrix),tB(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),s=t.createPattern(u.canvas,"no-repeat");let f=new DOMMatrix(r);s.setTransform(f)}else tB(t,this._bbox),s=this._createGradient(t);return s}};rB=class extends K1{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null}_createMeshCanvas(t,e,r){let o=Math.floor(this._bounds[0]),c=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-o,h=Math.ceil(this._bounds[3])-c,f=Math.min(Math.ceil(Math.abs(u*t[0]*1.1)),3e3),d=Math.min(Math.ceil(Math.abs(h*t[1]*1.1)),3e3),p=u/f,g=h/d,y={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-c,scaleX:1/p,scaleY:1/g},b=f+4,m=d+4,w=r.getCanvas("mesh",b,m),A=w.context,_=A.createImageData(f,d);if(e){let I=_.data;for(let C=0,M=I.length;C<M;C+=4)I[C]=e[0],I[C+1]=e[1],I[C+2]=e[2],I[C+3]=255}for(let I of this._figures)jht(_,I,y);return A.putImageData(_,2,2),{canvas:w.canvas,offsetX:o-2*p,offsetY:c-2*g,scaleX:p,scaleY:g}}isModifyingCurrentTransform(){return!0}getPattern(t,e,r,i){tB(t,this._bbox);let s=new Float32Array(2);if(i===Wi.SHADING)ie.singularValueDecompose2dScale(gn(t),s);else if(this.matrix){ie.singularValueDecompose2dScale(this.matrix,s);let[o,c]=s;ie.singularValueDecompose2dScale(e.baseTransform,s),s[0]*=o,s[1]*=c}else ie.singularValueDecompose2dScale(e.baseTransform,s);let a=this._createMeshCanvas(s,i===Wi.SHADING?null:this._background,e.cachedCanvases);return i!==Wi.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(a.offsetX,a.offsetY),t.scale(a.scaleX,a.scaleY),t.createPattern(a.canvas,"no-repeat")}},nB=class extends K1{getPattern(){return"hotpink"}};xV={COLORED:1,UNCOLORED:2},wD=class wD{constructor(t,e,r,i){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=e,this.canvasGraphicsFactory=r,this.baseTransform=i}createPatternCanvas(t,e){let{bbox:r,operatorList:i,paintType:s,tilingType:a,color:o,canvasGraphicsFactory:c}=this,{xstep:u,ystep:h}=this;u=Math.abs(u),h=Math.abs(h),PD("TilingType: "+a);let f=r[0],d=r[1],p=r[2],g=r[3],y=p-f,b=g-d,m=new Float32Array(2);ie.singularValueDecompose2dScale(this.matrix,m);let[w,A]=m;ie.singularValueDecompose2dScale(this.baseTransform,m);let _=w*m[0],S=A*m[1],I=y,C=b,M=!1,z=!1,G=Math.ceil(u*_),Y=Math.ceil(h*S),L=Math.ceil(y*_),j=Math.ceil(b*S);G>=L?I=u:M=!0,Y>=j?C=h:z=!0;let q=this.getSizeAndScale(I,this.ctx.canvas.width,_),nt=this.getSizeAndScale(C,this.ctx.canvas.height,S),J=t.cachedCanvases.getCanvas("pattern",q.size,nt.size),N=J.context,D=c.createCanvasGraphics(N,e);if(D.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(D,s,o),N.translate(-q.scale*f,-nt.scale*d),D.transform(0,q.scale,0,0,nt.scale,0,0),N.save(),D.dependencyTracker?.save(),this.clipBbox(D,f,d,p,g),D.baseTransform=gn(D.ctx),D.executeOperatorList(i),D.endDrawing(),D.dependencyTracker?.restore(),N.restore(),M||z){let F=J.canvas;M&&(I=u),z&&(C=h);let P=this.getSizeAndScale(I,this.ctx.canvas.width,_),V=this.getSizeAndScale(C,this.ctx.canvas.height,S),$=P.size,H=V.size,rt=t.cachedCanvases.getCanvas("pattern-workaround",$,H),lt=rt.context,ft=M?Math.floor(y/u):0,K=z?Math.floor(b/h):0;for(let X=0;X<=ft;X++)for(let st=0;st<=K;st++)lt.drawImage(F,$*X,H*st,$,H,0,0,$,H);return{canvas:rt.canvas,scaleX:P.scale,scaleY:V.scale,offsetX:f,offsetY:d}}return{canvas:J.canvas,scaleX:q.scale,scaleY:nt.scale,offsetX:f,offsetY:d}}getSizeAndScale(t,e,r){let i=Math.max(wD.MAX_PATTERN_SIZE,e),s=Math.ceil(t*r);return s>=i?s=i:r=s/t,{scale:r,size:s}}clipBbox(t,e,r,i,s){let a=i-e,o=s-r;t.ctx.rect(e,r,a,o),ie.axialAlignedBoundingBox([e,r,i,s],gn(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,r){let i=t.ctx,s=t.current;switch(e){case xV.COLORED:let{fillStyle:a,strokeStyle:o}=this.ctx;i.fillStyle=s.fillColor=a,i.strokeStyle=s.strokeColor=o;break;case xV.UNCOLORED:i.fillStyle=i.strokeStyle=r,s.fillColor=s.strokeColor=r;break;default:throw new cF(`Unsupported paint type: ${e}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,e,r,i,s){let a=r;i!==Wi.SHADING&&(a=ie.transform(a,e.baseTransform),this.matrix&&(a=ie.transform(a,this.matrix)));let o=this.createPatternCanvas(e,s),c=new DOMMatrix(a);c=c.translate(o.offsetX,o.offsetY),c=c.scale(1/o.scaleX,1/o.scaleY);let u=t.createPattern(o.canvas,"repeat");return u.setTransform(c),u}};Lt(wD,"MAX_PATTERN_SIZE",3e3);iB=wD;SV=16,_V=100,zht=15,TV=10,aa=16,iF=new DOMMatrix,Ha=new Float32Array(2),Rb=new Float32Array([1/0,1/0,-1/0,-1/0]);sB=class{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,r){let i;return this.cache[t]!==void 0?(i=this.cache[t],this.canvasFactory.reset(i,e,r)):(i=this.canvasFactory.create(e,r),this.cache[t]=i),i}delete(t){delete this.cache[t]}clear(){for(let t in this.cache){let e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}};qI=class{constructor(t,e,r){Lt(this,"alphaIsShape",!1);Lt(this,"fontSize",0);Lt(this,"fontSizeScale",1);Lt(this,"textMatrix",null);Lt(this,"textMatrixScale",1);Lt(this,"fontMatrix",oF);Lt(this,"leading",0);Lt(this,"x",0);Lt(this,"y",0);Lt(this,"lineX",0);Lt(this,"lineY",0);Lt(this,"charSpacing",0);Lt(this,"wordSpacing",0);Lt(this,"textHScale",1);Lt(this,"textRenderingMode",ci.FILL);Lt(this,"textRise",0);Lt(this,"fillColor","#000000");Lt(this,"strokeColor","#000000");Lt(this,"patternFill",!1);Lt(this,"patternStroke",!1);Lt(this,"fillAlpha",1);Lt(this,"strokeAlpha",1);Lt(this,"lineWidth",1);Lt(this,"activeSMask",null);Lt(this,"transferMaps","none");r?.(this),this.clipBox=new Float32Array([0,0,t,e]),this.minMax=Rb.slice()}clone(){let t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=Wi.FILL,e=null){let r=this.minMax.slice();if(t===Wi.STROKE){e||Wr("Stroke bounding box must include transform."),ie.singularValueDecompose2dScale(e,Ha);let i=Ha[0]*this.lineWidth/2,s=Ha[1]*this.lineWidth/2;r[0]-=i,r[1]-=s,r[2]+=i,r[3]+=s}return r}updateClipFromPath(){let t=ie.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(Rb,0)}getClippedPathBoundingBox(t=Wi.FILL,e=null){return ie.intersect(this.clipBox,this.getPathBoundingBox(t,e))}};Ght=["butt","round","square"],Vht=["miter","round","bevel"],Xht={},DV={},G3=class G3{constructor(t,e,r,i,s,{optionalContentConfig:a,markedContentStack:o=null},c,u,h){T(this,Ll);this.ctx=t,this.current=new qI(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=r,this.canvasFactory=i,this.filterFactory=s,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=o||[],this.optionalContentConfig=a,this.cachedCanvases=new sB(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=c,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=u,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=h??null}getObject(t,e,r=null){return typeof e=="string"?(this.dependencyTracker?.recordNamedDependency(t,e),e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e)):r}beginDrawing({transform:t,viewport:e,transparency:r=!1,background:i=null}){let s=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,s,a),this.ctx.fillStyle=o,r){let c=this.cachedCanvases.getCanvas("transparent",s,a);this.compositeCtx=this.ctx,this.transparentCanvas=c.canvas,this.ctx=c.context,this.ctx.save(),this.ctx.transform(...gn(this.compositeCtx))}this.ctx.save(),XR(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=gn(this.ctx)}executeOperatorList(t,e,r,i,s){let a=t.argsArray,o=t.fnArray,c=e||0,u=a.length;if(u===c)return c;let h=u-c>TV&&typeof r=="function",f=h?Date.now()+zht:0,d=0,p=this.commonObjs,g=this.objs,y,b;for(;;){if(i!==void 0&&c===i.nextBreakPoint)return i.breakIt(c,r),c;if(!s||s(c))if(y=o[c],b=a[c]??null,y!==aw.dependency)b===null?this[y](c):this[y](c,...b);else for(let m of b){this.dependencyTracker?.recordNamedData(m,c);let w=m.startsWith("g_")?p:g;if(!w.has(m))return w.get(m,r),c}if(c++,c===u)return c;if(h&&++d>TV){if(Date.now()>f)return r(),c;d=0}}}endDrawing(){R(this,Ll,aB).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(let t of this._cachedBitmapsMap.values()){for(let e of t.values())typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),R(this,Ll,oB).call(this)}_scaleImage(t,e){let r=t.width??t.displayWidth,i=t.height??t.displayHeight,s=Math.max(Math.hypot(e[0],e[1]),1),a=Math.max(Math.hypot(e[2],e[3]),1),o=r,c=i,u="prescale1",h,f;for(;s>2&&o>1||a>2&&c>1;){let d=o,p=c;s>2&&o>1&&(d=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),s/=o/d),a>2&&c>1&&(p=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,a/=c/p),h=this.cachedCanvases.getCanvas(u,d,p),f=h.context,f.clearRect(0,0,d,p),f.drawImage(t,0,0,o,c,0,0,d,p),t=h.canvas,o=d,c=p,u=u==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:o,paintHeight:c}}_createMaskCanvas(t,e){let r=this.ctx,{width:i,height:s}=e,a=this.current.fillColor,o=this.current.patternFill,c=gn(r),u,h,f,d;if((e.bitmap||e.data)&&e.count>1){let G=e.bitmap||e.data.buffer;h=JSON.stringify(o?c:[c.slice(0,4),a]),u=this._cachedBitmapsMap.get(G),u||(u=new Map,this._cachedBitmapsMap.set(G,u));let Y=u.get(h);if(Y&&!o){let L=Math.round(Math.min(c[0],c[2])+c[4]),j=Math.round(Math.min(c[1],c[3])+c[5]);return this.dependencyTracker?.recordDependencies(t,Io.transformAndFill),{canvas:Y,offsetX:L,offsetY:j}}f=Y}f||(d=this.cachedCanvases.getCanvas("maskCanvas",i,s),RV(d.context,e));let p=ie.transform(c,[1/i,0,0,-1/s,0,0]);p=ie.transform(p,[1,0,0,1,0,-s]);let g=Rb.slice();ie.axialAlignedBoundingBox([0,0,i,s],p,g);let[y,b,m,w]=g,A=Math.round(m-y)||1,_=Math.round(w-b)||1,S=this.cachedCanvases.getCanvas("fillCanvas",A,_),I=S.context,C=y,M=b;I.translate(-C,-M),I.transform(...p),f||(f=this._scaleImage(d.canvas,pc(I)),f=f.img,u&&o&&u.set(h,f)),I.imageSmoothingEnabled=IV(gn(I),e.interpolate),VR(I,f,0,0,f.width,f.height,0,0,i,s),I.globalCompositeOperation="source-in";let z=ie.transform(pc(I),[1,0,0,1,-C,-M]);return I.fillStyle=o?a.getPattern(r,this,z,Wi.FILL,t):a,I.fillRect(0,0,i,s),u&&!o&&(this.cachedCanvases.delete("fillCanvas"),u.set(h,S.canvas)),this.dependencyTracker?.recordDependencies(t,Io.transformAndFill),{canvas:S.canvas,offsetX:Math.round(C),offsetY:Math.round(M)}}setLineWidth(t,e){this.dependencyTracker?.recordSimpleData("lineWidth",t),e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(t,e){this.dependencyTracker?.recordSimpleData("lineCap",t),this.ctx.lineCap=Ght[e]}setLineJoin(t,e){this.dependencyTracker?.recordSimpleData("lineJoin",t),this.ctx.lineJoin=Vht[e]}setMiterLimit(t,e){this.dependencyTracker?.recordSimpleData("miterLimit",t),this.ctx.miterLimit=e}setDash(t,e,r){this.dependencyTracker?.recordSimpleData("dash",t);let i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(e),i.lineDashOffset=r)}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){for(let[r,i]of e)switch(r){case"LW":this.setLineWidth(t,i);break;case"LC":this.setLineCap(t,i);break;case"LJ":this.setLineJoin(t,i);break;case"ML":this.setMiterLimit(t,i);break;case"D":this.setDash(t,i[0],i[1]);break;case"RI":this.setRenderingIntent(t,i);break;case"FL":this.setFlatness(t,i);break;case"Font":this.setFont(t,i[0],i[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=i;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=i;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=i;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",t),this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.dependencyTracker?.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(t){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");let e=this.ctx.canvas.width,r=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(i,e,r);this.suspendedCtx=this.ctx;let a=this.ctx=s.context;a.setTransform(this.suspendedCtx.getTransform()),m1(this.suspendedCtx,a),Wht(a,this.suspendedCtx),this.setGState(t,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),m1(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let e=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,e,this.ctx,t),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(t,e,r,i){let s=i[0],a=i[1],o=i[2]-s,c=i[3]-a;o===0||c===0||(this.genericComposeSMask(e.context,r,o,c,e.subtype,e.backdrop,e.transferMap,s,a,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(r.canvas,0,0),t.restore())}genericComposeSMask(t,e,r,i,s,a,o,c,u,h,f){let d=t.canvas,p=c-h,g=u-f;if(a)if(p<0||g<0||p+r>d.width||g+i>d.height){let b=this.cachedCanvases.getCanvas("maskExtension",r,i),m=b.context;m.drawImage(d,-p,-g),m.globalCompositeOperation="destination-atop",m.fillStyle=a,m.fillRect(0,0,r,i),m.globalCompositeOperation="source-over",d=b.canvas,p=g=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);let b=new Path2D;b.rect(p,g,r,i),t.clip(b),t.globalCompositeOperation="destination-atop",t.fillStyle=a,t.fillRect(p,g,r,i),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),s==="Alpha"&&o?e.filter=this.filterFactory.addAlphaFilter(o):s==="Luminosity"&&(e.filter=this.filterFactory.addLuminosityFilter(o));let y=new Path2D;y.rect(c,u,r,i),e.clip(y),e.globalCompositeOperation="destination-in",e.drawImage(d,p,g,r,i,c,u,r,i),e.restore()}save(t){this.inSMaskMode&&m1(this.ctx,this.suspendedCtx),this.ctx.save();let e=this.current;this.stateStack.push(e),this.current=e.clone(),this.dependencyTracker?.save(t)}restore(t){if(this.dependencyTracker?.restore(t),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&m1(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(t,e,r,i,s,a,o){this.dependencyTracker?.recordIncrementalData("transform",t),this.ctx.transform(e,r,i,s,a,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,r,i){let[s]=r;if(!i){s||(s=r[0]=new Path2D),this[e](t,s);return}if(this.dependencyTracker!==null){let a=e===aw.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,i[0]-a,i[2]+a,i[1]-a,i[3]+a).recordDependencies(t,["transform"])}s instanceof Path2D||(s=r[0]=zV(s)),ie.axialAlignedBoundingBox(i,gn(this.ctx),this.current.minMax),this[e](t,s),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,e,r=!0){let i=this.ctx,s=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof s=="object"&&s?.getPattern){let a=s.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=s.getPattern(i,this,pc(i),Wi.STROKE,t),a){let o=new Path2D;o.addPath(e,i.getTransform().invertSelf().multiplySelf(a)),e=o}this.rescaleAndStroke(e,!1),i.restore()}else this.rescaleAndStroke(e,!0);this.dependencyTracker?.recordDependencies(t,Io.stroke),r&&this.consumePath(t,e,this.current.getClippedPathBoundingBox(Wi.STROKE,gn(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(t,e){this.stroke(t,e)}fill(t,e,r=!0){let i=this.ctx,s=this.current.fillColor,a=this.current.patternFill,o=!1;if(a){let u=s.isModifyingCurrentTransform()?i.getTransform():null;if(this.dependencyTracker?.save(t),i.save(),i.fillStyle=s.getPattern(i,this,pc(i),Wi.FILL,t),u){let h=new Path2D;h.addPath(e,i.getTransform().invertSelf().multiplySelf(u)),e=h}o=!0}let c=this.current.getClippedPathBoundingBox();this.contentVisible&&c!==null&&(this.pendingEOFill?(i.fill(e,"evenodd"),this.pendingEOFill=!1):i.fill(e)),this.dependencyTracker?.recordDependencies(t,Io.fill),o&&(i.restore(),this.dependencyTracker?.restore(t)),r&&this.consumePath(t,e,c)}eoFill(t,e){this.pendingEOFill=!0,this.fill(t,e)}fillStroke(t,e){this.fill(t,e,!1),this.stroke(t,e,!1),this.consumePath(t,e)}eoFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}closeFillStroke(t,e){this.fillStroke(t,e)}closeEOFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}endPath(t,e){this.consumePath(t,e)}rawFillPath(t,e){this.ctx.fill(e),this.dependencyTracker?.recordDependencies(t,Io.rawFillPath).recordOperation(t)}clip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=Xht}eoClip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=DV}beginText(t){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(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){let e=this.pendingTextPaths,r=this.ctx;if(this.dependencyTracker){let{dependencyTracker:i}=this;e!==void 0&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",t),i.recordCloseMarker(t)}if(e!==void 0){let i=new Path2D,s=r.getTransform().invertSelf();for(let{transform:a,x:o,y:c,fontSize:u,path:h}of e)h&&i.addPath(h,new DOMMatrix(a).preMultiplySelf(s).translate(o,c).scale(u,-u));r.clip(i)}delete this.pendingTextPaths}setCharSpacing(t,e){this.dependencyTracker?.recordSimpleData("charSpacing",t),this.current.charSpacing=e}setWordSpacing(t,e){this.dependencyTracker?.recordSimpleData("wordSpacing",t),this.current.wordSpacing=e}setHScale(t,e){this.dependencyTracker?.recordSimpleData("hScale",t),this.current.textHScale=e/100}setLeading(t,e){this.dependencyTracker?.recordSimpleData("leading",t),this.current.leading=-e}setFont(t,e,r){this.dependencyTracker?.recordSimpleData("font",t).recordSimpleDataFromNamed("fontObj",e,t);let i=this.commonObjs.get(e),s=this.current;if(!i)throw new Error(`Can't find font for ${e}`);if(s.fontMatrix=i.fontMatrix||oF,(s.fontMatrix[0]===0||s.fontMatrix[3]===0)&&_e("Invalid font matrix for font "+e),r<0?(r=-r,s.fontDirection=-1):s.fontDirection=1,this.current.font=i,this.current.fontSize=r,i.isType3Font)return;let a=i.loadedName||"sans-serif",o=i.systemFontInfo?.css||`"${a}", ${i.fallbackName}`,c="normal";i.black?c="900":i.bold&&(c="bold");let u=i.italic?"italic":"normal",h=r;r<SV?h=SV:r>_V&&(h=_V),this.current.fontSizeScale=r/h,this.ctx.font=`${u} ${c} ${h}px ${o}`}setTextRenderingMode(t,e){this.dependencyTracker?.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=e}setTextRise(t,e){this.dependencyTracker?.recordSimpleData("textRise",t),this.current.textRise=e}moveText(t,e,r){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=r}setLeadingMoveText(t,e,r){this.setLeading(t,-r),this.moveText(t,e,r)}setTextMatrix(t,e){this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",t);let{current:r}=this;r.textMatrix=e,r.textMatrixScale=Math.hypot(e[0],e[1]),r.x=r.lineX=0,r.y=r.lineY=0}nextLine(t){this.moveText(t,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??t)}paintChar(t,e,r,i,s,a){let o=this.ctx,c=this.current,u=c.font,h=c.textRenderingMode,f=c.fontSize/c.fontSizeScale,d=h&ci.FILL_STROKE_MASK,p=!!(h&ci.ADD_TO_PATH_FLAG),g=c.patternFill&&!u.missingFile,y=c.patternStroke&&!u.missingFile,b;if((u.disableFontFace||p||g||y)&&!u.missingFile&&(b=u.getPathGenerator(this.commonObjs,e)),b&&(u.disableFontFace||g||y)){o.save(),o.translate(r,i),o.scale(f,-f),this.dependencyTracker?.recordCharacterBBox(t,o,u);let m;if(d===ci.FILL||d===ci.FILL_STROKE)if(s){m=o.getTransform(),o.setTransform(...s);let w=R(this,Ll,lB).call(this,b,m,s);o.fill(w)}else o.fill(b);if(d===ci.STROKE||d===ci.FILL_STROKE)if(a){m||(m=o.getTransform()),o.setTransform(...a);let{a:w,b:A,c:_,d:S}=m,I=ie.inverseTransform(a),C=ie.transform([w,A,_,S,0,0],I);ie.singularValueDecompose2dScale(C,Ha),o.lineWidth*=Math.max(Ha[0],Ha[1])/f,o.stroke(R(this,Ll,lB).call(this,b,m,a))}else o.lineWidth/=f,o.stroke(b);o.restore()}else(d===ci.FILL||d===ci.FILL_STROKE)&&(o.fillText(e,r,i),this.dependencyTracker?.recordCharacterBBox(t,o,u,f,r,i,()=>o.measureText(e))),(d===ci.STROKE||d===ci.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(t,o,u,f,r,i,()=>o.measureText(e)).recordDependencies(t,Io.stroke),o.strokeText(e,r,i));p&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:gn(o),x:r,y:i,fontSize:f,path:b}),this.dependencyTracker?.recordCharacterBBox(t,o,u,f,r,i))}get isFontSubpixelAAEnabled(){let{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);let e=t.getImageData(0,0,10,10).data,r=!1;for(let i=3;i<e.length;i+=4)if(e[i]>0&&e[i]<255){r=!0;break}return Te(this,"isFontSubpixelAAEnabled",r)}showText(t,e){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,Io.showText).resetBBox(t),this.current.textRenderingMode&ci.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());let r=this.current,i=r.font;if(i.isType3Font){this.showType3Text(t,e),this.dependencyTracker?.recordShowTextOperation(t);return}let s=r.fontSize;if(s===0){this.dependencyTracker?.recordOperation(t);return}let a=this.ctx,o=r.fontSizeScale,c=r.charSpacing,u=r.wordSpacing,h=r.fontDirection,f=r.textHScale*h,d=e.length,p=i.vertical,g=p?1:-1,y=i.defaultVMetrics,b=s*r.fontMatrix[0],m=r.textRenderingMode===ci.FILL&&!i.disableFontFace&&!r.patternFill;a.save(),r.textMatrix&&a.transform(...r.textMatrix),a.translate(r.x,r.y+r.textRise),h>0?a.scale(f,-1):a.scale(f,1);let w,A,_=r.textRenderingMode&ci.FILL_STROKE_MASK,S=_===ci.FILL||_===ci.FILL_STROKE,I=_===ci.STROKE||_===ci.FILL_STROKE;if(S&&r.patternFill){a.save();let Y=r.fillColor.getPattern(a,this,pc(a),Wi.FILL,t);w=gn(a),a.restore(),a.fillStyle=Y}if(I&&r.patternStroke){a.save();let Y=r.strokeColor.getPattern(a,this,pc(a),Wi.STROKE,t);A=gn(a),a.restore(),a.strokeStyle=Y}let C=r.lineWidth,M=r.textMatrixScale;if(M===0||C===0?I&&(C=this.getSinglePixelWidth()):C/=M,o!==1&&(a.scale(o,o),C/=o),a.lineWidth=C,i.isInvalidPDFjsFont){let Y=[],L=0;for(let q of e)Y.push(q.unicode),L+=q.width;let j=Y.join("");if(a.fillText(j,0,0),this.dependencyTracker!==null){let q=a.measureText(j);this.dependencyTracker.recordBBox(t,this.ctx,-q.actualBoundingBoxLeft,q.actualBoundingBoxRight,-q.actualBoundingBoxAscent,q.actualBoundingBoxDescent).recordShowTextOperation(t)}r.x+=L*b*f,a.restore(),this.compose();return}let z=0,G;for(G=0;G<d;++G){let Y=e[G];if(typeof Y=="number"){z+=g*Y*s/1e3;continue}let L=!1,j=(Y.isSpace?u:0)+c,q=Y.fontChar,nt=Y.accent,J,N,D=Y.width;if(p){let V=Y.vmetric||y,$=-(Y.vmetric?V[1]:D*.5)*b,H=V[2]*b;D=V?-V[0]:D,J=$/o,N=(z+H)/o}else J=z/o,N=0;let F;if(i.remeasure&&D>0){F=a.measureText(q);let V=F.width*1e3/s*o;if(D<V&&this.isFontSubpixelAAEnabled){let $=D/V;L=!0,a.save(),a.scale($,1),J/=$}else D!==V&&(J+=(D-V)/2e3*s/o)}if(this.contentVisible&&(Y.isInFont||i.missingFile)){if(m&&!nt)a.fillText(q,J,N),this.dependencyTracker?.recordCharacterBBox(t,a,F?{bbox:null}:i,s/o,J,N,()=>F??a.measureText(q));else if(this.paintChar(t,q,J,N,w,A),nt){let V=J+s*nt.offset.x/o,$=N-s*nt.offset.y/o;this.paintChar(t,nt.fontChar,V,$,w,A)}}let P=p?D*b-j*h:D*b+j*h;z+=P,L&&a.restore()}p?r.y-=z:r.x+=z*f,a.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(t)}showType3Text(t,e){let r=this.ctx,i=this.current,s=i.font,a=i.fontSize,o=i.fontDirection,c=s.vertical?1:-1,u=i.charSpacing,h=i.wordSpacing,f=i.textHScale*o,d=i.fontMatrix||oF,p=e.length,g=i.textRenderingMode===ci.INVISIBLE,y,b,m,w;if(g||a===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,r.save(),i.textMatrix&&r.transform(...i.textMatrix),r.translate(i.x,i.y+i.textRise),r.scale(f,o);let A=this.dependencyTracker;for(this.dependencyTracker=A?new XI(A,t):null,y=0;y<p;++y){if(b=e[y],typeof b=="number"){w=c*b*a/1e3,this.ctx.translate(w,0),i.x+=w*f;continue}let _=(b.isSpace?h:0)+u,S=s.charProcOperatorList[b.operatorListId];S?this.contentVisible&&(this.save(),r.scale(a,a),r.transform(...d),this.executeOperatorList(S),this.restore()):_e(`Type3 character "${b.operatorListId}" is not available.`);let I=[b.width,0];ie.applyTransform(I,d),m=I[0]*a+_,r.translate(m,0),i.x+=m*f}r.restore(),A&&(this.dependencyTracker=A)}setCharWidth(t,e,r){}setCharWidthAndBounds(t,e,r,i,s,a,o){let c=new Path2D;c.rect(i,s,a-i,o-s),this.ctx.clip(c),this.dependencyTracker?.recordBBox(t,this.ctx,i,a,s,o).recordClipBox(t,this.ctx,i,a,s,o),this.endPath(t)}getColorN_Pattern(t,e){let r;if(e[0]==="TilingPattern"){let i=this.baseTransform||gn(this.ctx),s={createCanvasGraphics:(a,o)=>new G3(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new XI(this.dependencyTracker,o,!0):null)};r=new iB(e,this.ctx,s,i)}else r=this._getPattern(t,e[1],e[2]);return r}setStrokeColorN(t,...e){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.current.strokeColor=this.getColorN_Pattern(t,e),this.current.patternStroke=!0}setFillColorN(t,...e){this.dependencyTracker?.recordSimpleData("fillColor",t),this.current.fillColor=this.getColorN_Pattern(t,e),this.current.patternFill=!0}setStrokeRGBColor(t,e){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}setStrokeTransparent(t){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,e){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1}setFillTransparent(t){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e,r=null){let i;return this.cachedPatterns.has(e)?i=this.cachedPatterns.get(e):(i=$ht(this.getObject(t,e)),this.cachedPatterns.set(e,i)),r&&(i.matrix=r),i}shadingFill(t,e){if(!this.contentVisible)return;let r=this.ctx;this.save(t);let i=this._getPattern(t,e);r.fillStyle=i.getPattern(r,this,pc(r),Wi.SHADING,t);let s=pc(r);if(s){let{width:a,height:o}=r.canvas,c=Rb.slice();ie.axialAlignedBoundingBox([0,0,a,o],s,c);let[u,h,f,d]=c;this.ctx.fillRect(u,h,f-u,d-h)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,Io.transform).recordDependencies(t,Io.fill).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t)}beginInlineImage(){Wr("Should not call beginInlineImage")}beginImageData(){Wr("Should not call beginImageData")}paintFormXObjectBegin(t,e,r){if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),e&&this.transform(t,...e),this.baseTransform=gn(this.ctx),r)){ie.axialAlignedBoundingBox(r,this.baseTransform,this.current.minMax);let[i,s,a,o]=r,c=new Path2D;c.rect(i,s,a-i,o-s),this.ctx.clip(c),this.dependencyTracker?.recordClipBox(t,this.ctx,i,a,s,o),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,e){if(!this.contentVisible)return;this.save(t),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let r=this.ctx;e.isolated||PD("TODO: Support non-isolated groups."),e.knockout&&_e("Knockout groups not supported.");let i=gn(r);if(e.matrix&&r.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let s=Rb.slice();ie.axialAlignedBoundingBox(e.bbox,gn(r),s);let a=[0,0,r.canvas.width,r.canvas.height];s=ie.intersect(s,a)||[0,0,0,0];let o=Math.floor(s[0]),c=Math.floor(s[1]),u=Math.max(Math.ceil(s[2])-o,1),h=Math.max(Math.ceil(s[3])-c,1);this.current.startNewPathAndClipBox([0,0,u,h]);let f="groupAt"+this.groupLevel;e.smask&&(f+="_smask_"+this.smaskCounter++%2);let d=this.cachedCanvases.getCanvas(f,u,h),p=d.context;p.translate(-o,-c),p.transform(...i);let g=new Path2D,[y,b,m,w]=e.bbox;if(g.rect(y,b,m-y,w-b),e.matrix){let A=new Path2D;A.addPath(g,new DOMMatrix(e.matrix)),g=A}p.clip(g),e.smask&&this.smaskStack.push({canvas:d.canvas,context:p,offsetX:o,offsetY:c,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}),(!e.smask||this.dependencyTracker)&&(r.setTransform(1,0,0,1,0,0),r.translate(o,c),r.save()),m1(r,p),this.ctx=p,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(r),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(r),this.groupLevel++}endGroup(t,e){if(!this.contentVisible)return;this.groupLevel--;let r=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),e.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();let s=gn(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...s);let a=Rb.slice();ie.axialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],s,a),this.ctx.drawImage(r.canvas,0,0),this.ctx.restore(),this.compose(a)}}beginAnnotation(t,e,r,i,s,a){if(R(this,Ll,aB).call(this),XR(this.ctx),this.ctx.save(),this.save(t),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),r){let o=r[2]-r[0],c=r[3]-r[1];if(a&&this.annotationCanvasMap){i=i.slice(),i[4]-=r[0],i[5]-=r[1],r=r.slice(),r[0]=r[1]=0,r[2]=o,r[3]=c,ie.singularValueDecompose2dScale(gn(this.ctx),Ha);let{viewportScale:u}=this,h=Math.ceil(o*this.outputScaleX*u),f=Math.ceil(c*this.outputScaleY*u);this.annotationCanvas=this.canvasFactory.create(h,f);let{canvas:d,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(e,d),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(Ha[0],0,0,-Ha[1],0,c*Ha[1]),XR(this.ctx)}else{XR(this.ctx),this.endPath(t);let u=new Path2D;u.rect(r[0],r[1],o,c),this.ctx.clip(u)}}this.current=new qI(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(t,...i),this.transform(t,...s)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),R(this,Ll,oB).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t,e){if(!this.contentVisible)return;let r=e.count;e=this.getObject(t,e.data,e),e.count=r;let i=this.ctx,s=this._createMaskCanvas(t,e),a=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(a,s.offsetX,s.offsetY),this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,s.offsetX,s.offsetX+a.width,s.offsetY,s.offsetY+a.height).recordOperation(t),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,r,i=0,s=0,a,o){if(!this.contentVisible)return;e=this.getObject(t,e.data,e);let c=this.ctx;c.save();let u=gn(c);c.transform(r,i,s,a,0,0);let h=this._createMaskCanvas(t,e);c.setTransform(1,0,0,1,h.offsetX-u[4],h.offsetY-u[5]),this.dependencyTracker?.resetBBox(t);for(let f=0,d=o.length;f<d;f+=2){let p=ie.transform(u,[r,i,s,a,o[f],o[f+1]]);c.drawImage(h.canvas,p[4],p[5]),this.dependencyTracker?.recordBBox(t,this.ctx,p[4],p[4]+h.canvas.width,p[5],p[5]+h.canvas.height)}c.restore(),this.compose(),this.dependencyTracker?.recordOperation(t)}paintImageMaskXObjectGroup(t,e){if(!this.contentVisible)return;let r=this.ctx,i=this.current.fillColor,s=this.current.patternFill;this.dependencyTracker?.resetBBox(t).recordDependencies(t,Io.transformAndFill);for(let a of e){let{data:o,width:c,height:u,transform:h}=a,f=this.cachedCanvases.getCanvas("maskCanvas",c,u),d=f.context;d.save();let p=this.getObject(t,o,a);RV(d,p),d.globalCompositeOperation="source-in",d.fillStyle=s?i.getPattern(d,this,pc(r),Wi.FILL,t):i,d.fillRect(0,0,c,u),d.restore(),r.save(),r.transform(...h),r.scale(1,-1),VR(r,f.canvas,0,0,c,u,0,-1,1,1),this.dependencyTracker?.recordBBox(t,r,0,c,0,u),r.restore()}this.compose(),this.dependencyTracker?.recordOperation(t)}paintImageXObject(t,e){if(!this.contentVisible)return;let r=this.getObject(t,e);if(!r){_e("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t,r)}paintImageXObjectRepeat(t,e,r,i,s){if(!this.contentVisible)return;let a=this.getObject(t,e);if(!a){_e("Dependent image isn't ready yet");return}let o=a.width,c=a.height,u=[];for(let h=0,f=s.length;h<f;h+=2)u.push({transform:[r,0,0,i,s[h],s[h+1]],x:0,y:0,w:o,h:c});this.paintInlineImageXObjectGroup(t,a,u)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;let{bitmap:e,width:r,height:i}=t,s=this.cachedCanvases.getCanvas("inlineImage",r,i),a=s.context;return a.filter=this.current.transferMaps,a.drawImage(e,0,0),a.filter="none",s.canvas}paintInlineImageXObject(t,e){if(!this.contentVisible)return;let r=e.width,i=e.height,s=this.ctx;this.save(t);let{filter:a}=s;a!=="none"&&a!==""&&(s.filter="none"),s.scale(1/r,-1/i);let o;if(e.bitmap)o=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)o=e;else{let h=this.cachedCanvases.getCanvas("inlineImage",r,i).context;CV(h,e),o=this.applyTransferMapsToCanvas(h)}let c=this._scaleImage(o,pc(s));s.imageSmoothingEnabled=IV(gn(s),e.interpolate),this.dependencyTracker?.resetBBox(t).recordBBox(t,s,0,r,-i,0).recordDependencies(t,Io.imageXObject).recordOperation(t),VR(s,c.img,0,0,c.paintWidth,c.paintHeight,0,-i,r,i),this.compose(),this.restore(t)}paintInlineImageXObjectGroup(t,e,r){if(!this.contentVisible)return;let i=this.ctx,s;if(e.bitmap)s=e.bitmap;else{let a=e.width,o=e.height,u=this.cachedCanvases.getCanvas("inlineImage",a,o).context;CV(u,e),s=this.applyTransferMapsToCanvas(u)}this.dependencyTracker?.resetBBox(t);for(let a of r)i.save(),i.transform(...a.transform),i.scale(1,-1),VR(i,s,a.x,a.y,a.w,a.h,0,-1,1,1),this.dependencyTracker?.recordBBox(t,i,0,1,-1,0),i.restore();this.dependencyTracker?.recordOperation(t),this.compose()}paintSolidColorImageMask(t){this.contentVisible&&(this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,Io.fill).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t,e){}markPointProps(t,e,r){}beginMarkedContent(t,e){this.dependencyTracker?.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e,r){this.dependencyTracker?.beginMarkedContent(t),e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){this.dependencyTracker?.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,e,r){let i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(r);let s=this.ctx;this.pendingClip?(i||(this.pendingClip===DV?s.clip(e,"evenodd"):s.clip(e)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):this.dependencyTracker?.recordOperation(t),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let t=gn(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{let e=Math.abs(t[0]*t[3]-t[2]*t[1]),r=Math.hypot(t[0],t[2]),i=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(r,i)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){let{lineWidth:t}=this.current,{a:e,b:r,c:i,d:s}=this.ctx.getTransform(),a,o;if(r===0&&i===0){let c=Math.abs(e),u=Math.abs(s);if(c===u)if(t===0)a=o=1/c;else{let h=c*t;a=o=h<1?1/h:1}else if(t===0)a=1/c,o=1/u;else{let h=c*t,f=u*t;a=h<1?1/h:1,o=f<1?1/f:1}}else{let c=Math.abs(e*s-r*i),u=Math.hypot(e,r),h=Math.hypot(i,s);if(t===0)a=h/c,o=u/c;else{let f=t*c;a=h>f?h/f:1,o=u>f?u/f:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(t,e){let{ctx:r,current:{lineWidth:i}}=this,[s,a]=this.getScaleForStroking();if(s===a){r.lineWidth=(i||1)*s,r.stroke(t);return}let o=r.getLineDash();e&&r.save(),r.scale(s,a),iF.a=1/s,iF.d=1/a;let c=new Path2D;if(c.addPath(t,iF),o.length>0){let u=Math.max(s,a);r.setLineDash(o.map(h=>h/u)),r.lineDashOffset/=u}r.lineWidth=i||1,r.stroke(c),e&&r.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};Ll=new WeakSet,aB=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)},oB=function(){if(this.pageColors){let t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){let e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}},lB=function(t,e,r){let i=new Path2D;return i.addPath(t,new DOMMatrix(r).invertSelf().multiplySelf(e)),i};Nb=G3;for(let n in aw)Nb.prototype[n]!==void 0&&(Nb.prototype[aw[n]]=Nb.prototype[n]);Ho=class{static get workerPort(){return l(this,V2)}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");x(this,V2,t)}static get workerSrc(){return l(this,X2)}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");x(this,X2,t)}};V2=new WeakMap,X2=new WeakMap,T(Ho,V2,null),T(Ho,X2,"");cB=class{constructor({parsedData:t,rawData:e}){T(this,mv);T(this,q2);x(this,mv,t),x(this,q2,e)}getRaw(){return l(this,q2)}get(t){return l(this,mv).get(t)??null}[Symbol.iterator](){return l(this,mv).entries()}};mv=new WeakMap,q2=new WeakMap;xb=Symbol("INTERNAL"),uB=class{constructor(t,{name:e,intent:r,usage:i,rbGroups:s}){T(this,Y2,!1);T(this,K2,!1);T(this,Z2,!1);T(this,yv,!0);x(this,Y2,!!(t&$a.DISPLAY)),x(this,K2,!!(t&$a.PRINT)),this.name=e,this.intent=r,this.usage=i,this.rbGroups=s}get visible(){if(l(this,Z2))return l(this,yv);if(!l(this,yv))return!1;let{print:t,view:e}=this.usage;return l(this,Y2)?e?.viewState!=="OFF":l(this,K2)?t?.printState!=="OFF":!0}_setVisible(t,e,r=!1){t!==xb&&Wr("Internal method `_setVisible` called."),x(this,Z2,r),x(this,yv,e)}};Y2=new WeakMap,K2=new WeakMap,Z2=new WeakMap,yv=new WeakMap;hB=class{constructor(t,e=$a.DISPLAY){T(this,J2);T(this,md,null);T(this,Dr,new Map);T(this,bv,null);T(this,vv,null);if(this.renderingIntent=e,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,x(this,vv,t.order);for(let r of t.groups)l(this,Dr).set(r.id,new uB(e,r));if(t.baseState==="OFF")for(let r of l(this,Dr).values())r._setVisible(xb,!1);for(let r of t.on)l(this,Dr).get(r)._setVisible(xb,!0);for(let r of t.off)l(this,Dr).get(r)._setVisible(xb,!1);x(this,bv,this.getHash())}}isVisible(t){if(l(this,Dr).size===0)return!0;if(!t)return PD("Optional content group not defined."),!0;if(t.type==="OCG")return l(this,Dr).has(t.id)?l(this,Dr).get(t.id).visible:(_e(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return R(this,J2,fB).call(this,t.expression);if(!t.policy||t.policy==="AnyOn"){for(let e of t.ids){if(!l(this,Dr).has(e))return _e(`Optional content group not found: ${e}`),!0;if(l(this,Dr).get(e).visible)return!0}return!1}else if(t.policy==="AllOn"){for(let e of t.ids){if(!l(this,Dr).has(e))return _e(`Optional content group not found: ${e}`),!0;if(!l(this,Dr).get(e).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(let e of t.ids){if(!l(this,Dr).has(e))return _e(`Optional content group not found: ${e}`),!0;if(!l(this,Dr).get(e).visible)return!0}return!1}else if(t.policy==="AllOff"){for(let e of t.ids){if(!l(this,Dr).has(e))return _e(`Optional content group not found: ${e}`),!0;if(l(this,Dr).get(e).visible)return!1}return!0}return _e(`Unknown optional content policy ${t.policy}.`),!0}return _e(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0,r=!0){let i=l(this,Dr).get(t);if(!i){_e(`Optional content group not found: ${t}`);return}if(r&&e&&i.rbGroups.length)for(let s of i.rbGroups)for(let a of s)a!==t&&l(this,Dr).get(a)?._setVisible(xb,!1,!0);i._setVisible(xb,!!e,!0),x(this,md,null)}setOCGState({state:t,preserveRB:e}){let r;for(let i of t){switch(i){case"ON":case"OFF":case"Toggle":r=i;continue}let s=l(this,Dr).get(i);if(s)switch(r){case"ON":this.setVisibility(i,!0,e);break;case"OFF":this.setVisibility(i,!1,e);break;case"Toggle":this.setVisibility(i,!s.visible,e);break}}x(this,md,null)}get hasInitialVisibility(){return l(this,bv)===null||this.getHash()===l(this,bv)}getOrder(){return l(this,Dr).size?l(this,vv)?l(this,vv).slice():[...l(this,Dr).keys()]:null}getGroup(t){return l(this,Dr).get(t)||null}getHash(){if(l(this,md)!==null)return l(this,md);let t=new kI;for(let[e,r]of l(this,Dr))t.update(`${e}:${r.visible}`);return x(this,md,t.hexdigest())}[Symbol.iterator](){return l(this,Dr).entries()}};md=new WeakMap,Dr=new WeakMap,bv=new WeakMap,vv=new WeakMap,J2=new WeakSet,fB=function(t){let e=t.length;if(e<2)return!0;let r=t[0];for(let i=1;i<e;i++){let s=t[i],a;if(Array.isArray(s))a=R(this,J2,fB).call(this,s);else if(l(this,Dr).has(s))a=l(this,Dr).get(s).visible;else return _e(`Optional content group not found: ${s}`),!0;switch(r){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return r==="And"};dB=class{constructor(t,{disableRange:e=!1,disableStream:r=!1}){er(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');let{length:i,initialData:s,progressiveDone:a,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,s?.length>0){let c=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(c)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!r,this._isRangeSupported=!e,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((c,u)=>{this._onReceiveData({begin:c,chunk:u})}),t.addProgressListener((c,u)=>{this._onProgress({loaded:c,total:u})}),t.addProgressiveReadListener(c=>{this._onReceiveData({chunk:c})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:e}){let r=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{let i=this._rangeReaders.some(function(s){return s._begin!==t?!1:(s._enqueue(r),!0)});er(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){t.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){let e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){er(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let t=this._queuedChunks;return this._queuedChunks=null,new pB(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let r=new gB(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(r),r}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(let e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}},pB=class{constructor(t,e,r=!1,i=null){this._stream=t,this._done=r||!1,this._filename=ND(i)?i:null,this._queuedChunks=e||[],this._loaded=0;for(let s of this._queuedChunks)this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}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;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}},gB=class{constructor(t,e,r){this._stream=t,this._begin=e,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(let r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,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;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}};mB=class{constructor(t){Lt(this,"_responseOrigin",null);this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=CX(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return er(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new yB(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let r=new bB(this,t,e);return this._rangeRequestReaders.push(r),r}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(let e of this._rangeRequestReaders.slice(0))e.cancel(t)}},yB=class{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;let e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange;let r=new Headers(t.headers),i=e.url;fetch(i,OX(r,this._withCredentials,this._abortController)).then(s=>{if(t._responseOrigin=LD(s.url),!DX(s.status))throw Jx(s.status,i);this._reader=s.body.getReader(),this._headersCapability.resolve();let a=s.headers,{allowRangeRequests:o,suggestedLength:c}=RX({responseHeaders:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=c||this._contentLength,this._filename=IX(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Nl("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}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(){await this._headersCapability.promise;let{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:PX(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}},bB=class{constructor(t,e,r){this._stream=t,this._reader=null,this._loaded=0;let i=t.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;let s=new Headers(t.headers);s.append("Range",`bytes=${e}-${r-1}`);let a=i.url;fetch(a,OX(s,this._withCredentials,this._abortController)).then(o=>{let c=LD(o.url);if(c!==t._responseOrigin)throw new Error(`Expected range response-origin "${c}" to match "${t._responseOrigin}".`);if(!DX(o.status))throw Jx(o.status,a);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;let{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:PX(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}},sF=200,aF=206;vB=class{constructor({url:t,httpHeaders:e,withCredentials:r}){Lt(this,"_responseOrigin",null);this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=CX(this.isHttp,e),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){let e=new XMLHttpRequest,r=this.currXhrId++,i=this.pendingRequests[r]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(let[s,a]of this.headers)e.setRequestHeader(s,a);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),i.expectedStatus=aF):i.expectedStatus=sF,e.responseType="arraybuffer",er(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>{t.onError(e.status)},e.onreadystatechange=this.onStateChange.bind(this,r),e.onprogress=this.onProgress.bind(this,r),i.onHeadersReceived=t.onHeadersReceived,i.onDone=t.onDone,i.onError=t.onError,i.onProgress=t.onProgress,e.send(null),r}onProgress(t,e){let r=this.pendingRequests[t];r&&r.onProgress?.(e)}onStateChange(t,e){let r=this.pendingRequests[t];if(!r)return;let i=r.xhr;if(i.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),i.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],i.status===0&&this.isHttp){r.onError(i.status);return}let s=i.status||sF;if(!(s===sF&&r.expectedStatus===aF)&&s!==r.expectedStatus){r.onError(i.status);return}let o=Yht(i);if(s===aF){let c=i.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(c);u?r.onDone({begin:parseInt(u[1],10),chunk:o}):(_e('Missing or invalid "Content-Range" header.'),r.onError(0))}else o?r.onDone({begin:0,chunk:o}):r.onError(i.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){let e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}},wB=class{constructor(t){this._source=t,this._manager=new vB(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){let e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return er(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new AB(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){let r=new EB(this._manager,t,e);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(let e of this._rangeRequestReaders.slice(0))e.cancel(t)}},AB=class{constructor(t,e){this._manager=t,this._url=e.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let t=this._fullRequestId,e=this._manager.getRequestXhr(t);this._manager._responseOrigin=LD(e.responseURL);let r=e.getAllResponseHeaders(),i=new Headers(r?r.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(o=>{let[c,...u]=o.split(": ");return[c,u.join(": ")]}):[]),{allowRangeRequests:s,suggestedLength:a}=RX({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=IX(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=Jx(t,this._url),this._headersCapability.reject(this._storedError);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}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);for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}},EB=class{constructor(t,e,r){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,end:r,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){let t=LD(this._manager.getRequestXhr(this._requestId)?.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(t){let e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(let r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??(this._storedError=Jx(t,this._url));for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,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;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}},Kht=/^[a-z][a-z0-9\-+.]+:/i;xB=class{constructor(t){this.source=t,this.url=Zht(t.url),er(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return er(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new SB(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let r=new _B(this,t,e);return this._rangeRequestReaders.push(r),r}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(let e of this._rangeRequestReaders.slice(0))e.cancel(t)}},SB=class{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;let e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();let r=process.getBuiltinModule("fs");r.promises.lstat(this._url).then(i=>{this._contentLength=i.size,this._setReadableStream(r.createReadStream(this._url)),this._headersCapability.resolve()},i=>{i.code==="ENOENT"&&(i=Jx(0,this._url.href)),this._storedError=i,this._headersCapability.reject(i)})}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(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Nl("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}},_B=class{constructor(t,e,r){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();let i=t.source;this._isStreamingSupported=!i.disableStream;let s=process.getBuiltinModule("fs");this._setReadableStream(s.createReadStream(this._url,{start:e,end:r-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}},y1=Symbol("INITIAL_DATA"),YI=class{constructor(){T(this,Q2);T(this,Ta,Object.create(null))}get(t,e=null){if(e){let i=R(this,Q2,TB).call(this,t);return i.promise.then(()=>e(i.data)),null}let r=l(this,Ta)[t];if(!r||r.data===y1)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return r.data}has(t){let e=l(this,Ta)[t];return!!e&&e.data!==y1}delete(t){let e=l(this,Ta)[t];return!e||e.data===y1?!1:(delete l(this,Ta)[t],!0)}resolve(t,e=null){let r=R(this,Q2,TB).call(this,t);r.data=e,r.resolve()}clear(){for(let t in l(this,Ta)){let{data:e}=l(this,Ta)[t];e?.bitmap?.close()}x(this,Ta,Object.create(null))}*[Symbol.iterator](){for(let t in l(this,Ta)){let{data:e}=l(this,Ta)[t];e!==y1&&(yield[t,e])}}};Ta=new WeakMap,Q2=new WeakSet,TB=function(t){var e;return(e=l(this,Ta))[t]||(e[t]={...Promise.withResolvers(),data:y1})};Jht=1e5,OV=30,Bi=class Bi{constructor({textContentSource:t,container:e,viewport:r}){T(this,Oh);T(this,yd,Promise.withResolvers());T(this,Ca,null);T(this,tx,!1);T(this,ex,!!globalThis.FontInspector?.enabled);T(this,im,null);T(this,oh,null);T(this,rx,0);T(this,nx,0);T(this,sm,null);T(this,ix,null);T(this,wv,0);T(this,bd,0);T(this,Av,Object.create(null));T(this,sx,[]);T(this,Ev,null);T(this,am,[]);T(this,ax,new WeakMap);T(this,ox,null);var c;if(t instanceof ReadableStream)x(this,Ev,t);else if(typeof t=="object")x(this,Ev,new ReadableStream({start(u){u.enqueue(t),u.close()}}));else throw new Error('No "textContentSource" parameter specified.');x(this,Ca,x(this,ix,e)),x(this,bd,r.scale*Uc.pixelRatio),x(this,wv,r.rotation),x(this,oh,{div:null,properties:null,ctx:null});let{pageWidth:i,pageHeight:s,pageX:a,pageY:o}=r.rawDims;x(this,ox,[1,0,0,-1,-a,o+s]),x(this,nx,i),x(this,rx,s),R(c=Bi,Wa,kX).call(c),e.style.setProperty("--min-font-size",l(Bi,Sv)),jd(e,r),l(this,yd).promise.finally(()=>{l(Bi,_v).delete(this),x(this,oh,null),x(this,Av,null)}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:t,isFirefox:e}=Pn.platform;return Te(this,"fontFamilyMap",new Map([["sans-serif",`${t&&e?"Calibri, ":""}sans-serif`],["monospace",`${t&&e?"Lucida Console, ":""}monospace`]]))}render(){let t=()=>{l(this,sm).read().then(({value:e,done:r})=>{if(r){l(this,yd).resolve();return}l(this,im)??x(this,im,e.lang),Object.assign(l(this,Av),e.styles),R(this,Oh,NX).call(this,e.items),t()},l(this,yd).reject)};return x(this,sm,l(this,Ev).getReader()),l(Bi,_v).add(this),t(),l(this,yd).promise}update({viewport:t,onBefore:e=null}){var s;let r=t.scale*Uc.pixelRatio,i=t.rotation;if(i!==l(this,wv)&&(e?.(),x(this,wv,i),jd(l(this,ix),{rotation:i})),r!==l(this,bd)){e?.(),x(this,bd,r);let a={div:null,properties:null,ctx:R(s=Bi,Wa,oI).call(s,l(this,im))};for(let o of l(this,am))a.properties=l(this,ax).get(o),a.div=o,R(this,Oh,CB).call(this,a)}}cancel(){let t=new Nl("TextLayer task cancelled.");l(this,sm)?.cancel(t).catch(()=>{}),x(this,sm,null),l(this,yd).reject(t)}get textDivs(){return l(this,am)}get textContentItemsStr(){return l(this,sx)}static cleanup(){if(!(l(this,_v).size>0)){l(this,xv).clear();for(let{canvas:t}of l(this,om).values())t.remove();l(this,om).clear()}}};yd=new WeakMap,Ca=new WeakMap,tx=new WeakMap,ex=new WeakMap,im=new WeakMap,oh=new WeakMap,rx=new WeakMap,nx=new WeakMap,sm=new WeakMap,ix=new WeakMap,wv=new WeakMap,bd=new WeakMap,Av=new WeakMap,sx=new WeakMap,Ev=new WeakMap,am=new WeakMap,ax=new WeakMap,ox=new WeakMap,xv=new WeakMap,om=new WeakMap,lx=new WeakMap,Sv=new WeakMap,_v=new WeakMap,Oh=new WeakSet,NX=function(t){var i,s;if(l(this,tx))return;(s=l(this,oh)).ctx??(s.ctx=R(i=Bi,Wa,oI).call(i,l(this,im)));let e=l(this,am),r=l(this,sx);for(let a of t){if(e.length>Jht){_e("Ignoring additional textDivs for performance reasons."),x(this,tx,!0);return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){let o=l(this,Ca);x(this,Ca,document.createElement("span")),l(this,Ca).classList.add("markedContent"),a.id&&l(this,Ca).setAttribute("id",`${a.id}`),o.append(l(this,Ca))}else a.type==="endMarkedContent"&&x(this,Ca,l(this,Ca).parentNode);continue}r.push(a.str),R(this,Oh,LX).call(this,a)}},LX=function(t){var g;let e=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};l(this,am).push(e);let i=ie.transform(l(this,ox),t.transform),s=Math.atan2(i[1],i[0]),a=l(this,Av)[t.fontName];a.vertical&&(s+=Math.PI/2);let o=l(this,ex)&&a.fontSubstitution||a.fontFamily;o=Bi.fontFamilyMap.get(o)||o;let c=Math.hypot(i[2],i[3]),u=c*R(g=Bi,Wa,MX).call(g,o,a,l(this,im)),h,f;s===0?(h=i[4],f=i[5]-u):(h=i[4]+u*Math.sin(s),f=i[5]-u*Math.cos(s));let d=e.style;d.left=`${(100*h/l(this,nx)).toFixed(2)}%`,d.top=`${(100*f/l(this,rx)).toFixed(2)}%`,d.setProperty("--font-height",`${c.toFixed(2)}px`),d.fontFamily=o,r.fontSize=c,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,l(this,ex)&&(e.dataset.fontName=a.fontSubstitutionLoadedName||t.fontName),s!==0&&(r.angle=s*(180/Math.PI));let p=!1;if(t.str.length>1)p=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){let y=Math.abs(t.transform[0]),b=Math.abs(t.transform[3]);y!==b&&Math.max(y,b)/Math.min(y,b)>1.5&&(p=!0)}if(p&&(r.canvasWidth=a.vertical?t.height:t.width),l(this,ax).set(e,r),l(this,oh).div=e,l(this,oh).properties=r,R(this,Oh,CB).call(this,l(this,oh)),r.hasText&&l(this,Ca).append(e),r.hasEOL){let y=document.createElement("br");y.setAttribute("role","presentation"),l(this,Ca).append(y)}},CB=function(t){var a;let{div:e,properties:r,ctx:i}=t,{style:s}=e;if(r.canvasWidth!==0&&r.hasText){let{fontFamily:o}=s,{canvasWidth:c,fontSize:u}=r;R(a=Bi,Wa,RB).call(a,i,u*l(this,bd),o);let{width:h}=i.measureText(e.textContent);h>0&&s.setProperty("--scale-x",c*l(this,bd)/h)}r.angle!==0&&s.setProperty("--rotate",`${r.angle}deg`)},Wa=new WeakSet,oI=function(t=null){let e=l(this,om).get(t||(t=""));if(!e){let r=document.createElement("canvas");r.className="hiddenCanvasElement",r.lang=t,document.body.append(r),e=r.getContext("2d",{alpha:!1,willReadFrequently:!0}),l(this,om).set(t,e),l(this,lx).set(e,{size:0,family:""})}return e},RB=function(t,e,r){let i=l(this,lx).get(t);e===i.size&&r===i.family||(t.font=`${e}px ${r}`,i.size=e,i.family=r)},kX=function(){if(l(this,Sv)!==null)return;let t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),x(this,Sv,t.getBoundingClientRect().height),t.remove()},MX=function(t,e,r){let i=l(this,xv).get(t);if(i)return i;let s=R(this,Wa,oI).call(this,r);s.canvas.width=s.canvas.height=OV,R(this,Wa,RB).call(this,s,OV,t);let a=s.measureText(""),o=a.fontBoundingBoxAscent,c=Math.abs(a.fontBoundingBoxDescent);s.canvas.width=s.canvas.height=0;let u=.8;return o?u=o/(o+c):(Pn.platform.isFirefox&&_e("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?u=e.ascent:e.descent&&(u=1+e.descent)),l(this,xv).set(t,u),u},T(Bi,Wa),T(Bi,xv,new Map),T(Bi,om,new Map),T(Bi,lx,new WeakMap),T(Bi,Sv,null),T(Bi,_v,new Set);cw=Bi,Qht=100;ED=class ED{constructor(){Lt(this,"_capability",Promise.withResolvers());Lt(this,"_transport",null);Lt(this,"_worker",null);Lt(this,"docId",`d${ze(ED,AD)._++}`);Lt(this,"destroyed",!1);Lt(this,"onPassword",null);Lt(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(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}};AD=new WeakMap,T(ED,AD,0);IB=ED,Z1=class{constructor(t,e,r=!1,i=null){T(this,lm,Promise.withResolvers());T(this,cx,[]);T(this,ux,[]);T(this,hx,[]);T(this,fx,[]);this.length=t,this.initialData=e,this.progressiveDone=r,this.contentDispositionFilename=i}addRangeListener(t){l(this,fx).push(t)}addProgressListener(t){l(this,hx).push(t)}addProgressiveReadListener(t){l(this,ux).push(t)}addProgressiveDoneListener(t){l(this,cx).push(t)}onDataRange(t,e){for(let r of l(this,fx))r(t,e)}onDataProgress(t,e){l(this,lm).promise.then(()=>{for(let r of l(this,hx))r(t,e)})}onDataProgressiveRead(t){l(this,lm).promise.then(()=>{for(let e of l(this,ux))e(t)})}onDataProgressiveDone(){l(this,lm).promise.then(()=>{for(let t of l(this,cx))t()})}transportReady(){l(this,lm).resolve()}requestDataRange(t,e){Wr("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};lm=new WeakMap,cx=new WeakMap,ux=new WeakMap,hx=new WeakMap,fx=new WeakMap;DB=class{constructor(t,e){this._pdfInfo=t,this._transport=e}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 Te(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}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(t,e){return this._transport.getAnnotationsByType(t,e)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){let{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}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(t){return this._transport.extractPages(t)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}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()}},OB=class{constructor(t,e,r,i=!1){T(this,cm);T(this,lh,!1);this._pageIndex=t,this._pageInfo=e,this._transport=r,this._stats=i?new OI:null,this._pdfBug=i,this.commonObjs=r.commonObjs,this.objs=new YI,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}get pageNumber(){return this._pageIndex+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:t,rotation:e=this.rotate,offsetX:r=0,offsetY:i=0,dontFlip:s=!1}={}){return new X1({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:s})}getAnnotations({intent:t="display"}={}){let{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Te(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,canvas:e=t.canvas,viewport:r,intent:i="display",annotationMode:s=Sh.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:c=null,annotationCanvasMap:u=null,pageColors:h=null,printAnnotationStorage:f=null,isEditing:d=!1,recordOperations:p=!1,operationsFilter:g=null}){this._stats?.time("Overall");let y=this._transport.getRenderingIntent(i,s,f,d),{renderingIntent:b,cacheKey:m}=y;x(this,lh,!1),c||(c=this._transport.getOptionalContentConfig(b));let w=this._intentStates.get(m);w||(w=Object.create(null),this._intentStates.set(m,w)),w.streamReaderCancelTimeout&&(clearTimeout(w.streamReaderCancelTimeout),w.streamReaderCancelTimeout=null);let A=!!(b&$a.PRINT);w.displayReadyCapability||(w.displayReadyCapability=Promise.withResolvers(),w.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(y));let _=!!(this._pdfBug&&globalThis.StepperManager?.enabled),S=!this.recordedBBoxes&&(p||_),I=z=>{if(w.renderTasks.delete(C),S){let G=C.gfx?.dependencyTracker.take();G&&(C.stepper&&C.stepper.setOperatorBBoxes(G,C.gfx.dependencyTracker.takeDebugMetadata()),p&&(this.recordedBBoxes=G))}A&&x(this,lh,!0),R(this,cm,P1).call(this),z?(C.capability.reject(z),this._abortOperatorList({intentState:w,reason:z instanceof Error?z:new Error(z)})):C.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},C=new LB({callback:I,params:{canvas:e,canvasContext:t,dependencyTracker:S?new JF(e,w.operatorList.length,_):null,viewport:r,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:u,operatorList:w.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!A,pdfBug:this._pdfBug,pageColors:h,enableHWA:this._transport.enableHWA,operationsFilter:g});(w.renderTasks||(w.renderTasks=new Set)).add(C);let M=C.task;return Promise.all([w.displayReadyCapability.promise,c]).then(([z,G])=>{if(this.destroyed){I();return}if(this._stats?.time("Rendering"),!(G.renderingIntent&b))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");C.initializeGraphics({transparency:z,optionalContentConfig:G}),C.operatorListChanged()}).catch(I),M}getOperatorList({intent:t="display",annotationMode:e=Sh.ENABLE,printAnnotationStorage:r=null,isEditing:i=!1}={}){function s(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(c))}let a=this._transport.getRenderingIntent(t,e,r,i,!0),o=this._intentStates.get(a.cacheKey);o||(o=Object.create(null),this._intentStates.set(a.cacheKey,o));let c;return o.opListReadCapability||(c=Object.create(null),c.operatorListChanged=s,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||(o.renderTasks=new Set)).add(c),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:e===!0},{highWaterMark:100,size(i){return i.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>G1.textContent(r));let e=this.streamTextContent(t);return new Promise(function(r,i){function s(){a.read().then(function({value:c,done:u}){if(u){r(o);return}o.lang??(o.lang=c.lang),Object.assign(o.styles,c.styles),o.items.push(...c.items),s()},i)}let a=e.getReader(),o={items:[],styles:Object.create(null),lang:null};s()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let t=[];for(let e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(let r of e.renderTasks)t.push(r.completed),r.cancel();return this.objs.clear(),x(this,lh,!1),Promise.all(t)}cleanup(t=!1){x(this,lh,!0);let e=R(this,cm,P1).call(this);return t&&e&&this._stats&&(this._stats=new OI),e}_startRenderPage(t,e){let r=this._intentStates.get(e);r&&(this._stats?.timeEnd("Page Request"),r.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let r=0,i=t.length;r<i;r++)e.operatorList.fnArray.push(t.fnArray[r]),e.operatorList.argsArray.push(t.argsArray[r]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(let r of e.renderTasks)r.operatorListChanged();t.lastChunk&&R(this,cm,P1).call(this)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:r,modifiedIds:i}){let{map:s,transfer:a}=r,c=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:s,modifiedIds:i},a).getReader(),u=this._intentStates.get(e);u.streamReader=c;let h=()=>{c.read().then(({value:f,done:d})=>{if(d){u.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(f,u),h())},f=>{if(u.streamReader=null,!this._transport.destroyed){if(u.operatorList){u.operatorList.lastChunk=!0;for(let d of u.renderTasks)d.operatorListChanged();R(this,cm,P1).call(this)}if(u.displayReadyCapability)u.displayReadyCapability.reject(f);else if(u.opListReadCapability)u.opListReadCapability.reject(f);else throw f}})};h()}_abortOperatorList({intentState:t,reason:e,force:r=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!r){if(t.renderTasks.size>0)return;if(e instanceof lw){let i=Qht;e.extraDelay>0&&e.extraDelay<1e3&&(i+=e.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},i);return}}if(t.streamReader.cancel(new Nl(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(let[i,s]of this._intentStates)if(s===t){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}};lh=new WeakMap,cm=new WeakSet,P1=function(){if(!l(this,lh)||this.destroyed)return!1;for(let{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),x(this,lh,!1),!0};on=class on{constructor({name:t=null,port:e=null,verbosity:r=Cht()}={}){T(this,Ps);T(this,vd,Promise.withResolvers());T(this,_l,null);T(this,ch,null);T(this,um,null);if(this.name=t,this.destroyed=!1,this.verbosity=r,e){if(l(on,fm).has(e))throw new Error("Cannot use more than one PDFWorker per port.");l(on,fm).set(e,this),R(this,Ps,BX).call(this,e)}else R(this,Ps,UX).call(this)}get promise(){return l(this,vd).promise}get port(){return l(this,ch)}get messageHandler(){return l(this,_l)}destroy(){this.destroyed=!0,l(this,um)?.terminate(),x(this,um,null),l(on,fm).delete(l(this,ch)),x(this,ch,null),l(this,_l)?.destroy(),x(this,_l,null)}static create(t){let e=l(this,fm).get(t?.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new on(t)}static get workerSrc(){if(Ho.workerSrc)return Ho.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Te(this,"_setupFakeWorkerGlobal",(async()=>l(this,Tv,cI)?l(this,Tv,cI):(await import(this.workerSrc)).WorkerMessageHandler)())}};vd=new WeakMap,_l=new WeakMap,ch=new WeakMap,um=new WeakMap,xD=new WeakMap,hm=new WeakMap,fm=new WeakMap,Ps=new WeakSet,lI=function(){l(this,vd).resolve(),l(this,_l).send("configure",{verbosity:this.verbosity})},BX=function(t){x(this,ch,t),x(this,_l,new Tg("main","worker",t)),l(this,_l).on("ready",()=>{}),R(this,Ps,lI).call(this)},UX=function(){if(l(on,hm)||l(on,Tv,cI)){R(this,Ps,N1).call(this);return}let{workerSrc:t}=on;try{on._isSameOrigin(window.location,t)||(t=on._createCDNWrapper(new URL(t,window.location).href));let e=new Worker(t,{type:"module"}),r=new Tg("main","worker",e),i=()=>{s.abort(),r.destroy(),e.terminate(),this.destroyed?l(this,vd).reject(new Error("Worker was destroyed")):R(this,Ps,N1).call(this)},s=new AbortController;e.addEventListener("error",()=>{l(this,um)||i()},{signal:s.signal}),r.on("test",o=>{if(s.abort(),this.destroyed||!o){i();return}x(this,_l,r),x(this,ch,e),x(this,um,e),R(this,Ps,lI).call(this)}),r.on("ready",o=>{if(s.abort(),this.destroyed){i();return}try{a()}catch{R(this,Ps,N1).call(this)}});let a=()=>{let o=new Uint8Array;r.send("test",o,[o.buffer])};a();return}catch{PD("The worker has been disabled.")}R(this,Ps,N1).call(this)},N1=function(){l(on,hm)||(_e("Setting up fake worker."),x(on,hm,!0)),on._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){l(this,vd).reject(new Error("Worker was destroyed"));return}let e=new jF;x(this,ch,e);let r=`fake${ze(on,xD)._++}`,i=new Tg(r+"_worker",r,e);t.setup(i,e),x(this,_l,new Tg(r,r+"_worker",e)),R(this,Ps,lI).call(this)}).catch(t=>{l(this,vd).reject(new Error(`Setting up fake worker failed: "${t.message}".`))})},Tv=new WeakSet,cI=function(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}},T(on,Tv),T(on,xD,0),T(on,hm,!1),T(on,fm,new WeakMap),Os&&(x(on,hm,!0),Ho.workerSrc||(Ho.workerSrc="./pdf.worker.mjs")),on._isSameOrigin=(t,e)=>{let r=URL.parse(t);if(!r?.origin||r.origin==="null")return!1;let i=new URL(e,r);return r.origin===i.origin},on._createCDNWrapper=t=>{let e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},on.fromPort=t=>{if(kht("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return on.create(t)};uw=on,PB=class{constructor(t,e,r,i,s,a){T(this,dm);T(this,uh,new Map);T(this,Ic,new Map);T(this,Cv,new Map);T(this,Rv,new Map);T(this,hh,null);this.messageHandler=t,this.loadingTask=e,this.commonObjs=new YI,this.fontLoader=new LF({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.wasmFactory=s.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=a,this.setupMessageHandler()}get annotationStorage(){return Te(this,"annotationStorage",new Y1)}getRenderingIntent(t,e=Sh.ENABLE,r=null,i=!1,s=!1){let a=$a.DISPLAY,o=NF;switch(t){case"any":a=$a.ANY;break;case"display":break;case"print":a=$a.PRINT;break;default:_e(`getRenderingIntent - invalid intent: ${t}`)}let c=a&$a.PRINT&&r instanceof MI?r:this.annotationStorage;switch(e){case Sh.DISABLE:a+=$a.ANNOTATIONS_DISABLE;break;case Sh.ENABLE:break;case Sh.ENABLE_FORMS:a+=$a.ANNOTATIONS_FORMS;break;case Sh.ENABLE_STORAGE:a+=$a.ANNOTATIONS_STORAGE,o=c.serializable;break;default:_e(`getRenderingIntent - invalid annotationMode: ${e}`)}i&&(a+=$a.IS_EDITING),s&&(a+=$a.OPLIST);let{ids:u,hash:h}=c.modifiedIds,f=[a,o.hash,h];return{renderingIntent:a,cacheKey:f.join("_"),annotationStorageSerializable:o,modifiedIds:u}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),l(this,hh)?.reject(new Error("Worker was destroyed during onPassword callback"));let t=[];for(let r of l(this,Ic).values())t.push(r._destroy());l(this,Ic).clear(),l(this,Cv).clear(),l(this,Rv).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),l(this,uh).clear(),this.filterFactory.destroy(),cw.cleanup(),this._networkStream?.cancelAllRequests(new Nl("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(r,i)=>{er(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=s=>{this._lastProgress={loaded:s.loaded,total:s.total}},i.onPull=()=>{this._fullReader.read().then(function({value:s,done:a}){if(a){i.close();return}er(s instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{i.error(s)})},i.onCancel=s=>{this._fullReader.cancel(s),i.ready.catch(a=>{if(!this.destroyed)throw a})}}),t.on("ReaderHeadersReady",async r=>{await this._fullReader.headersReady;let{isStreamingSupported:i,isRangeSupported:s,contentLength:a}=this._fullReader;return(!i||!s)&&(this._lastProgress&&e.onProgress?.(this._lastProgress),this._fullReader.onProgress=o=>{e.onProgress?.({loaded:o.loaded,total:o.total})}),{isStreamingSupported:i,isRangeSupported:s,contentLength:a}}),t.on("GetRangeReader",(r,i)=>{er(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let s=this._networkStream.getRangeReader(r.begin,r.end);if(!s){i.close();return}i.onPull=()=>{s.read().then(function({value:a,done:o}){if(o){i.close();return}er(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{i.error(a)})},i.onCancel=a=>{s.cancel(a),i.ready.catch(o=>{if(!this.destroyed)throw o})}}),t.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,e._capability.resolve(new DB(r,this))}),t.on("DocException",r=>{e._capability.reject(Js(r))}),t.on("PasswordRequest",r=>{x(this,hh,Promise.withResolvers());try{if(!e.onPassword)throw Js(r);let i=s=>{s instanceof Error?l(this,hh).reject(s):l(this,hh).resolve({password:s})};e.onPassword(i,r.code)}catch(i){l(this,hh).reject(i)}return l(this,hh).promise}),t.on("DataLoaded",r=>{e.onProgress?.({loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),t.on("StartRenderPage",r=>{if(this.destroyed)return;l(this,Ic).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),t.on("commonobj",([r,i,s])=>{if(this.destroyed||this.commonObjs.has(r))return null;switch(i){case"Font":if("error"in s){let f=s.error;_e(`Error during font loading: ${f}`),this.commonObjs.resolve(r,f);break}let a=new MF(s),o=this._params.pdfBug&&globalThis.FontInspector?.enabled?(f,d)=>globalThis.FontInspector.fontAdded(f,d):null,c=new kF(a,o,s.extra,s.charProcOperatorList);this.fontLoader.bind(c).catch(()=>t.sendWithPromise("FontFallback",{id:r})).finally(()=>{!c.fontExtraProperties&&c.data&&c.clearData(),this.commonObjs.resolve(r,c)});break;case"CopyLocalImage":let{imageRef:u}=s;er(u,"The imageRef must be defined.");for(let f of l(this,Ic).values())for(let[,d]of f.objs)if(d?.ref===u)return d.dataLen?(this.commonObjs.resolve(r,structuredClone(d)),d.dataLen):null;break;case"FontPath":this.commonObjs.resolve(r,new BF(s));break;case"Image":this.commonObjs.resolve(r,s);break;case"Pattern":let h=new FF(s);this.commonObjs.resolve(r,h.getIR());break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),t.on("obj",([r,i,s,a])=>{if(this.destroyed)return;let o=l(this,Ic).get(i);if(!o.objs.has(r)){if(o._intentStates.size===0){a?.bitmap?.close();return}switch(s){case"Image":case"Pattern":o.objs.resolve(r,a);break;default:throw new Error(`Got unknown object type ${s}`)}}}),t.on("DocProgress",r=>{this.destroyed||e.onProgress?.({loaded:r.loaded,total:r.total})}),t.on("FetchBinaryData",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");let i=this[r.type];if(!i)throw new Error(`${r.type} not initialized, see the \`useWorkerFetch\` parameter.`);return i.fetch(r)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&_e("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally(()=>{this.annotationStorage.resetModified()})}extractPages(t){return this.messageHandler.sendWithPromise("ExtractPages",{pageInfos:t})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));let e=t-1,r=l(this,Cv).get(e);if(r)return r;let i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(s=>{if(this.destroyed)throw new Error("Transport destroyed");s.refStr&&l(this,Rv).set(s.refStr,t);let a=new OB(e,s,this,this._params.pdfBug);return l(this,Ic).set(e,a),a});return l(this,Cv).set(e,i),i}getPageIndex(t){return UF(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return R(this,dm,L1).call(this,"GetFieldObjects")}hasJSActions(){return R(this,dm,L1).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}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(t,e){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:e})}getDocJSActions(){return R(this,dm,L1).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return R(this,dm,L1).call(this,"GetOptionalContentConfig").then(e=>new hB(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let t="GetMetadata",e=l(this,uh).get(t);if(e)return e;let r=this.messageHandler.sendWithPromise(t,null).then(i=>({info:i[0],metadata:i[1]?new cB(i[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null,hasStructTree:i[2]}));return l(this,uh).set(t,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(let e of l(this,Ic).values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),l(this,uh).clear(),this.filterFactory.destroy(!0),cw.cleanup()}}cachedPageNumber(t){if(!UF(t))return null;let e=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return l(this,Rv).get(e)??null}};uh=new WeakMap,Ic=new WeakMap,Cv=new WeakMap,Rv=new WeakMap,hh=new WeakMap,dm=new WeakSet,L1=function(t,e=null){let r=l(this,uh).get(t);if(r)return r;let i=this.messageHandler.sendWithPromise(t,e);return l(this,uh).set(t,i),i};NB=class{constructor(t){T(this,wd,null);Lt(this,"onContinue",null);Lt(this,"onError",null);x(this,wd,t)}get promise(){return l(this,wd).capability.promise}cancel(t=0){l(this,wd).cancel(null,t)}get separateAnnots(){let{separateAnnots:t}=l(this,wd).operatorList;if(!t)return!1;let{annotationCanvasMap:e}=l(this,wd);return t.form||t.canvas&&e?.size>0}};wd=new WeakMap;Sg=class Sg{constructor({callback:t,params:e,objs:r,commonObjs:i,annotationCanvasMap:s,operatorList:a,pageIndex:o,canvasFactory:c,filterFactory:u,useRequestAnimationFrame:h=!1,pdfBug:f=!1,pageColors:d=null,enableHWA:p=!1,operationsFilter:g=null}){T(this,Ad,null);this.callback=t,this.params=e,this.objs=r,this.commonObjs=i,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=c,this.filterFactory=u,this._pdfBug=f,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=h===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new NB(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=e.canvas,this._canvasContext=e.canvas?null:e.canvasContext,this._enableHWA=p,this._dependencyTracker=e.dependencyTracker,this._operationsFilter=g}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(l(Sg,pm).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(Sg,pm).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:r,transform:i,background:s,dependencyTracker:a}=this.params,o=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new Nb(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors,a),this.gfx.beginDrawing({transform:i,viewport:r,transparency:t,background:s}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,e=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),l(this,Ad)&&(window.cancelAnimationFrame(l(this,Ad)),x(this,Ad,null)),l(Sg,pm).delete(this._canvas),t||(t=new lw(`Rendering cancelled, page ${this._pageIndex+1}`,e)),this.callback(t),this.task.onError?.(t)}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?x(this,Ad,window.requestAnimationFrame(()=>{x(this,Ad,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(Sg,pm).delete(this._canvas),this.callback())))}};Ad=new WeakMap,pm=new WeakMap,T(Sg,pm,new WeakSet);LB=Sg,jX="5.4.530",$X="50cc4adac",Qs=class Qs{constructor({editor:t=null,uiManager:e=null}){T(this,Or);T(this,Ra,null);T(this,gm,null);T(this,Iv);T(this,fi,null);T(this,dx,!1);T(this,Dv,!1);T(this,fh,null);T(this,px);T(this,Ed,null);T(this,Tl,null);t?(x(this,Dv,!1),x(this,fh,t)):x(this,Dv,!0),x(this,Tl,t?._uiManager||e),x(this,px,l(this,Tl)._eventBus),x(this,Iv,t?.color?.toUpperCase()||l(this,Tl)?.highlightColors.values().next().value||"#FFFF98"),l(Qs,gx)||x(Qs,gx,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 Te(this,"_keyboardManager",new Wm([[["Escape","mac+Escape"],Qs.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Qs.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Qs.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Qs.prototype._moveToPrevious],[["Home","mac+Home"],Qs.prototype._moveToBeginning],[["End","mac+End"],Qs.prototype._moveToEnd]]))}renderButton(){let t=x(this,Ra,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",l(this,fh)&&(t.ariaControls=`${l(this,fh).id}_colorpicker_dropdown`);let e=l(this,Tl)._signal;t.addEventListener("click",R(this,Or,wg).bind(this),{signal:e}),t.addEventListener("keydown",R(this,Or,FB).bind(this),{signal:e});let r=x(this,gm,document.createElement("span"));return r.className="swatch",r.ariaHidden="true",r.style.backgroundColor=l(this,Iv),t.append(r),t}renderMainDropdown(){let t=x(this,fi,R(this,Or,kB).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===l(this,Ra)){R(this,Or,wg).call(this,t);return}let e=t.target.getAttribute("data-color");e&&R(this,Or,MB).call(this,e,t)}_moveToNext(t){if(!l(this,Or,Yf)){R(this,Or,wg).call(this,t);return}if(t.target===l(this,Ra)){l(this,fi).firstElementChild?.focus();return}t.target.nextSibling?.focus()}_moveToPrevious(t){if(t.target===l(this,fi)?.firstElementChild||t.target===l(this,Ra)){l(this,Or,Yf)&&this._hideDropdownFromKeyboard();return}l(this,Or,Yf)||R(this,Or,wg).call(this,t),t.target.previousSibling?.focus()}_moveToBeginning(t){if(!l(this,Or,Yf)){R(this,Or,wg).call(this,t);return}l(this,fi).firstElementChild?.focus()}_moveToEnd(t){if(!l(this,Or,Yf)){R(this,Or,wg).call(this,t);return}l(this,fi).lastElementChild?.focus()}hideDropdown(){l(this,fi)?.classList.add("hidden"),l(this,Ra).ariaExpanded="false",l(this,Ed)?.abort(),x(this,Ed,null)}_hideDropdownFromKeyboard(){if(!l(this,Dv)){if(!l(this,Or,Yf)){l(this,fh)?.unselect();return}this.hideDropdown(),l(this,Ra).focus({preventScroll:!0,focusVisible:l(this,dx)})}}updateColor(t){if(l(this,gm)&&(l(this,gm).style.backgroundColor=t),!l(this,fi))return;let e=l(this,Tl).highlightColors.values();for(let r of l(this,fi).children)r.ariaSelected=e.next().value===t.toUpperCase()}destroy(){l(this,Ra)?.remove(),x(this,Ra,null),x(this,gm,null),l(this,fi)?.remove(),x(this,fi,null)}};Ra=new WeakMap,gm=new WeakMap,Iv=new WeakMap,fi=new WeakMap,dx=new WeakMap,Dv=new WeakMap,fh=new WeakMap,px=new WeakMap,Ed=new WeakMap,Tl=new WeakMap,gx=new WeakMap,Or=new WeakSet,kB=function(){let t=document.createElement("div"),e=l(this,Tl)._signal;t.addEventListener("contextmenu",Ga,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),l(this,fh)&&(t.id=`${l(this,fh).id}_colorpicker_dropdown`);for(let[r,i]of l(this,Tl).highlightColors){let s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",i),s.title=r,s.setAttribute("data-l10n-id",l(Qs,gx)[r]);let a=document.createElement("span");s.append(a),a.className="swatch",a.style.backgroundColor=i,s.ariaSelected=i===l(this,Iv),s.addEventListener("click",R(this,Or,MB).bind(this,i),{signal:e}),t.append(s)}return t.addEventListener("keydown",R(this,Or,FB).bind(this),{signal:e}),t},MB=function(t,e){e.stopPropagation(),l(this,px).dispatch("switchannotationeditorparams",{source:this,type:Je.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)},FB=function(t){Qs._keyboardManager.exec(this,t)},wg=function(t){if(l(this,Or,Yf)){this.hideDropdown();return}if(x(this,dx,t.detail===0),l(this,Ed)||(x(this,Ed,new AbortController),window.addEventListener("pointerdown",R(this,Or,HX).bind(this),{signal:l(this,Tl).combinedSignal(l(this,Ed))})),l(this,Ra).ariaExpanded="true",l(this,fi)){l(this,fi).classList.remove("hidden");return}let e=x(this,fi,R(this,Or,kB).call(this));l(this,Ra).append(e)},HX=function(t){l(this,fi)?.contains(t.target)||this.hideDropdown()},Yf=function(){return l(this,fi)&&!l(this,fi).classList.contains("hidden")},T(Qs,gx,null);J1=Qs,_g=class _g{constructor(t){T(this,Dc,null);T(this,mx,null);T(this,Ov,null);x(this,mx,t),x(this,Ov,t._uiManager),l(_g,yx)||x(_g,yx,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(l(this,Dc))return l(this,Dc);let{editorType:t,colorType:e,color:r}=l(this,mx),i=x(this,Dc,document.createElement("input"));return i.type="color",i.value=r||"#000000",i.className="basicColorPicker",i.tabIndex=0,i.setAttribute("data-l10n-id",l(_g,yx)[t]),i.addEventListener("input",()=>{l(this,Ov).updateParams(e,i.value)},{signal:l(this,Ov)._signal}),i}update(t){l(this,Dc)&&(l(this,Dc).value=t)}destroy(){l(this,Dc)?.remove(),x(this,Dc,null)}hideDropdown(){}};Dc=new WeakMap,mx=new WeakMap,Ov=new WeakMap,yx=new WeakMap,T(_g,yx,null);KI=_g,XAt=Me(116),qAt=Me(531);ZI=class{static CMYK_G([t,e,r,i]){return["G",1-Math.min(1,.3*t+.59*r+.11*e+i)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=b1(t),[t,t,t]}static G_HTML([t]){let e=PV(t);return`#${e}${e}${e}`}static RGB_G([t,e,r]){return["G",.3*t+.59*e+.11*r]}static RGB_rgb(t){return t.map(b1)}static RGB_HTML(t){return`#${t.map(PV).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,r,i]){return["RGB",1-Math.min(1,t+i),1-Math.min(1,r+i),1-Math.min(1,e+i)]}static CMYK_rgb([t,e,r,i]){return[b1(1-Math.min(1,t+i)),b1(1-Math.min(1,r+i)),b1(1-Math.min(1,e+i))]}static CMYK_HTML(t){let e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,r]){let i=1-t,s=1-e,a=1-r,o=Math.min(i,s,a);return["CMYK",i,s,a,o]}},BB=class{create(t,e,r=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");let i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),r||(i.setAttribute("width",`${t}px`),i.setAttribute("height",`${e}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${t} ${e}`),i}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Wr("Abstract method `_createSVG` called.")}},Gm=class extends BB{_createSVG(t){return document.createElementNS(Uu,t)}},tft=9,Vm=new WeakSet,eft=new Date().getTimezoneOffset()*60*1e3,z1=class{static create(t){switch(t.data.annotationType){case zn.LINK:return new Q1(t);case zn.TEXT:return new $B(t);case zn.WIDGET:switch(t.data.fieldType){case"Tx":return new HB(t);case"Btn":return t.data.radioButton?new JI(t):t.data.checkBox?new WB(t):new GB(t);case"Ch":return new VB(t);case"Sig":return new zB(t)}return new Ih(t);case zn.POPUP:return new t2(t);case zn.FREETEXT:return new QI(t);case zn.LINE:return new t3(t);case zn.SQUARE:return new e3(t);case zn.CIRCLE:return new r3(t);case zn.POLYLINE:return new tD(t);case zn.CARET:return new i3(t);case zn.INK:return new e2(t);case zn.POLYGON:return new n3(t);case zn.HIGHLIGHT:return new eD(t);case zn.UNDERLINE:return new a3(t);case zn.SQUIGGLY:return new o3(t);case zn.STRIKEOUT:return new l3(t);case zn.STAMP:return new rD(t);case zn.FILEATTACHMENT:return new c3(t);default:return new yn(t)}}},V3=class V3{constructor(t,{isRenderable:e=!1,ignoreBorder:r=!1,createQuadrilaterals:i=!1}={}){T(this,bx);T(this,mm,null);T(this,Pv,!1);T(this,Uo,null);this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableComment=t.enableComment,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,this.hasOwnCommentButton=!1,e&&(this.contentElement=this.container=this._createContainer(r)),i&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:e}){return!!(t?.str||e?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return V3._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){let{data:t}=this,e=this.annotationStorage?.getEditor(t.id);return e?e.getData():t}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){let t=this.annotationStorage?.getEditor(this.data.id);if(t)return t.commentButtonPositionInPage;let{quadPoints:e,inkLists:r,rect:i}=this.data,s=-1/0,a=-1/0;if(e?.length>=8){for(let o=0;o<e.length;o+=8)e[o+1]>a?(a=e[o+1],s=e[o+2]):e[o+1]===a&&(s=Math.max(s,e[o+2]));return[s,a]}if(r?.length>=1){for(let o of r)for(let c=0,u=o.length;c<u;c+=2)o[c+1]>a?(a=o[c+1],s=o[c]):o[c+1]===a&&(s=Math.max(s,o[c]));if(s!==1/0)return[s,a]}return i?[i[2],i[3]]:null}_normalizePoint(t){let{page:{view:e},viewport:{rawDims:{pageWidth:r,pageHeight:i,pageX:s,pageY:a}}}=this.parent;return t[1]=e[3]-t[1]+e[1],t[0]=100*(t[0]-s)/r,t[1]=100*(t[1]-a)/i,t}get commentText(){let{data:t}=this;return this.annotationStorage.getRawValue(`${W1}${t.id}`)?.popup?.contents||t.contentsObj?.str||""}set commentText(t){let{data:e}=this,r={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(e.id,{popup:r})||this.annotationStorage.setValue(`${W1}${e.id}`,{id:e.id,annotationType:e.annotationType,pageIndex:this.parent.page._pageIndex,popup:r,popupRef:e.popupRef,modificationDate:new Date}),t||this.removePopup()}removePopup(){(l(this,Uo)?.popup||this.popup)?.remove(),x(this,Uo,this.popup=null)}updateEdited(t){if(!this.container)return;t.rect&&(l(this,mm)||x(this,mm,{rect:this.data.rect.slice(0)}));let{rect:e,popup:r}=t;e&&R(this,bx,UB).call(this,e);let i=l(this,Uo)?.popup||this.popup;!i&&r?.text&&(this._createPopup(r),i=l(this,Uo).popup),i&&(i.updateEdited(t),r?.deleted&&(i.remove(),x(this,Uo,null),this.popup=null))}resetEdited(){l(this,mm)&&(R(this,bx,UB).call(this,l(this,mm).rect),l(this,Uo)?.popup.resetEdited(),x(this,mm,null))}_createContainer(t){let{data:e,parent:{page:r,viewport:i}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),!(this instanceof Ih)&&!(this instanceof Q1)&&(s.tabIndex=0);let{style:a}=s;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof t2){let{rotation:y}=e;return!e.hasOwnCanvas&&y!==0&&this.setRotation(y,s),s}let{width:o,height:c}=this;if(!t&&e.borderStyle.width>0){a.borderWidth=`${e.borderStyle.width}px`;let y=e.borderStyle.horizontalCornerRadius,b=e.borderStyle.verticalCornerRadius;if(y>0||b>0){let w=`calc(${y}px * var(--total-scale-factor)) / calc(${b}px * var(--total-scale-factor))`;a.borderRadius=w}else if(this instanceof JI){let w=`calc(${o}px * var(--total-scale-factor)) / calc(${c}px * var(--total-scale-factor))`;a.borderRadius=w}switch(e.borderStyle.style){case bb.SOLID:a.borderStyle="solid";break;case bb.DASHED:a.borderStyle="dashed";break;case bb.BEVELED:_e("Unimplemented border style: beveled");break;case bb.INSET:_e("Unimplemented border style: inset");break;case bb.UNDERLINE:a.borderBottomStyle="solid";break;default:break}let m=e.borderColor||null;m?(x(this,Pv,!0),a.borderColor=ie.makeHexColor(m[0]|0,m[1]|0,m[2]|0)):a.borderWidth=0}let u=ie.normalizeRect([e.rect[0],r.view[3]-e.rect[1]+r.view[1],e.rect[2],r.view[3]-e.rect[3]+r.view[1]]),{pageWidth:h,pageHeight:f,pageX:d,pageY:p}=i.rawDims;a.left=`${100*(u[0]-d)/h}%`,a.top=`${100*(u[1]-p)/f}%`;let{rotation:g}=e;return e.hasOwnCanvas||g===0?(a.width=`${100*o/h}%`,a.height=`${100*c/f}%`):this.setRotation(g,s),s}setRotation(t,e=this.container){if(!this.data.rect)return;let{pageWidth:r,pageHeight:i}=this.parent.viewport.rawDims,{width:s,height:a}=this;t%180!==0&&([s,a]=[a,s]),e.style.width=`${100*s/r}%`,e.style.height=`${100*a/i}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){let t=(e,r,i)=>{let s=i.detail[e],a=s[0],o=s.slice(1);i.target.style[r]=ZI[`${a}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[r]:ZI[`${a}_rgb`](o)})};return Te(this,"_commonActions",{display:e=>{let{display:r}=e.detail,i=r%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:r===1||r===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{let{hidden:r}=e.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:e=>{let r=e.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(t,e){let r=this._commonActions;for(let i of Object.keys(e.detail))(t[i]||r[i])?.(e)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;let e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;let r=this._commonActions;for(let[i,s]of Object.entries(e)){let a=r[i];if(a){let o={detail:{[i]:s},target:t};a(o),delete e[i]}}}_createQuadrilaterals(){if(!this.container)return;let{quadPoints:t}=this.data;if(!t)return;let[e,r,i,s]=this.data.rect.map(y=>Math.fround(y));if(t.length===8){let[y,b,m,w]=t.subarray(2,6);if(i===y&&s===b&&e===m&&r===w)return}let{style:a}=this.container,o;if(l(this,Pv)){let{borderColor:y,borderWidth:b}=a;a.borderWidth=0,o=["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="${y}" stroke-width="${b}">`],this.container.classList.add("hasBorder")}let c=i-e,u=s-r,{svgFactory:h}=this,f=h.createElement("svg");f.classList.add("quadrilateralsContainer"),f.setAttribute("width",0),f.setAttribute("height",0),f.role="none";let d=h.createElement("defs");f.append(d);let p=h.createElement("clipPath"),g=`clippath_${this.data.id}`;p.setAttribute("id",g),p.setAttribute("clipPathUnits","objectBoundingBox"),d.append(p);for(let y=2,b=t.length;y<b;y+=8){let m=t[y],w=t[y+1],A=t[y+2],_=t[y+3],S=h.createElement("rect"),I=(A-e)/c,C=(s-w)/u,M=(m-A)/c,z=(w-_)/u;S.setAttribute("x",I),S.setAttribute("y",C),S.setAttribute("width",M),S.setAttribute("height",z),p.append(S),o?.push(`<rect vector-effect="non-scaling-stroke" x="${I}" y="${C}" width="${M}" height="${z}"/>`)}l(this,Pv)&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(f),this.container.style.clipPath=`url(#${g})`}_createPopup(t=null){let{data:e}=this,r,i;t?(r={str:t.text},i=t.date):(r=e.contentsObj,i=e.modificationDate),x(this,Uo,new t2({data:{color:e.color,titleObj:e.titleObj,modificationDate:i,contentsObj:r,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}))}get hasPopupElement(){return!!(l(this,Uo)||this.popup||this.data.popupRef)}get extraPopupElement(){return l(this,Uo)}render(){Wr("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){let r=[];if(this._fieldObjects){let i=this._fieldObjects[t];if(i)for(let{page:s,id:a,exportValues:o}of i){if(s===-1||a===e)continue;let c=typeof o=="string"?o:null,u=document.querySelector(`[data-element-id="${a}"]`);if(u&&!Vm.has(u)){_e(`_getElementsByName - element not allowed: ${a}`);continue}r.push({id:a,exportValue:c,domElement:u})}return r}for(let i of document.getElementsByName(t)){let{exportValue:s}=i,a=i.getAttribute("data-element-id");a!==e&&Vm.has(i)&&r.push({id:a,exportValue:s,domElement:i})}return r}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 t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(let e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};mm=new WeakMap,Pv=new WeakMap,Uo=new WeakMap,bx=new WeakSet,UB=function(t){let{container:{style:e},data:{rect:r,rotation:i},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:c}}}}=this;r?.splice(0,4,...t),e.left=`${100*(t[0]-o)/s}%`,e.top=`${100*(a-t[3]+c)/a}%`,i===0?(e.width=`${100*(t[2]-t[0])/s}%`,e.height=`${100*(t[3]-t[1])/a}%`):this.setRotation(i)};yn=V3,jB=class extends yn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.editor=t.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){let{editor:t}=this;t.hasComment&&this._createPopup(t.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(t){this.editor.comment=t,t||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}},Q1=class extends yn{constructor(e,r=null){super(e,{isRenderable:!0,ignoreBorder:!!r?.ignoreBorder,createQuadrilaterals:!0});T(this,za);this.isTooltipOnly=e.data.isTooltipOnly}render(){let{data:e,linkService:r}=this,i=document.createElement("a");i.setAttribute("data-element-id",e.id);let s=!1;return e.url?(r.addLinkAttributes(i,e.url,e.newWindow),s=!0):e.action?(this._bindNamedAction(i,e.action,e.overlaidText),s=!0):e.attachment?(R(this,za,zX).call(this,i,e.attachment,e.overlaidText,e.attachmentDest),s=!0):e.setOCGState?(R(this,za,WX).call(this,i,e.setOCGState,e.overlaidText),s=!0):e.dest?(this._bindLink(i,e.dest,e.overlaidText),s=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,e),s=!0),e.resetForm?(this._bindResetFormAction(i,e.resetForm),s=!0):this.isTooltipOnly&&!s&&(this._bindLink(i,""),s=!0)),this.container.classList.add("linkAnnotation"),s&&(this.contentElement=i,this.container.append(i)),this.container}_bindLink(e,r,i=""){e.href=this.linkService.getDestinationHash(r),e.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||r==="")&&R(this,za,Ag).call(this),i&&(e.title=i)}_bindNamedAction(e,r,i=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(r),!1),i&&(e.title=i),R(this,za,Ag).call(this)}_bindJSAction(e,r){e.href=this.linkService.getAnchorUrl("");let i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let s of Object.keys(r.actions)){let a=i.get(s);a&&(e[a]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:s}}),!1))}r.overlaidText&&(e.title=r.overlaidText),e.onclick||(e.onclick=()=>!1),R(this,za,Ag).call(this)}_bindResetFormAction(e,r){let i=e.onclick;if(i||(e.href=this.linkService.getAnchorUrl("")),R(this,za,Ag).call(this),!this._fieldObjects){_e('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(e.onclick=()=>!1);return}e.onclick=()=>{i?.();let{fields:s,refs:a,include:o}=r,c=[];if(s.length!==0||a.length!==0){let f=new Set(a);for(let d of s){let p=this._fieldObjects[d]||[];for(let{id:g}of p)f.add(g)}for(let d of Object.values(this._fieldObjects))for(let p of d)f.has(p.id)===o&&c.push(p)}else for(let f of Object.values(this._fieldObjects))c.push(...f);let u=this.annotationStorage,h=[];for(let f of c){let{id:d}=f;switch(h.push(d),f.type){case"text":{let g=f.defaultValue||"";u.setValue(d,{value:g});break}case"checkbox":case"radiobutton":{let g=f.defaultValue===f.exportValues;u.setValue(d,{value:g});break}case"combobox":case"listbox":{let g=f.defaultValue||"";u.setValue(d,{value:g});break}default:continue}let p=document.querySelector(`[data-element-id="${d}"]`);if(p){if(!Vm.has(p)){_e(`_bindResetFormAction - element not allowed: ${d}`);continue}}else continue;p.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:h,name:"ResetForm"}}),!1}}};za=new WeakSet,Ag=function(){this.container.setAttribute("data-internal-link","")},zX=function(e,r,i="",s=null){e.href=this.linkService.getAnchorUrl(""),r.description?e.title=r.description:i&&(e.title=i),e.onclick=()=>(this.downloadManager?.openOrDownloadData(r.content,r.filename,s),!1),R(this,za,Ag).call(this)},WX=function(e,r,i=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(r),!1),i&&(e.title=i),R(this,za,Ag).call(this)};$B=class extends yn{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");let t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(t),this.container}},Ih=class extends yn{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Pn.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,r,i,s){r.includes("mouse")?t.addEventListener(r,a=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):t.addEventListener(r,a=>{if(r==="blur"){if(!e.focused||!a.relatedTarget)return;e.focused=!1}else if(r==="focus"){if(e.focused)return;e.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(a)}})})}_setEventListeners(t,e,r,i){for(let[s,a]of r)(a==="Action"||this.data.actions?.[a])&&((a==="Focus"||a==="Blur")&&(e||(e={focused:!1})),this._setEventListener(t,e,s,a,i),a==="Focus"&&!this.data.actions?.Blur?this._setEventListener(t,e,"blur","Blur",null):a==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(t,e,"focus","Focus",null))}_setBackgroundColor(t){let e=this.data.backgroundColor||null;t.style.backgroundColor=e===null?"transparent":ie.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){let e=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||tft,s=t.style,a,o=2,c=u=>Math.round(10*u)/10;if(this.data.multiLine){let u=Math.abs(this.data.rect[3]-this.data.rect[1]-o),h=Math.round(u/(KR*i))||1,f=u/h;a=Math.min(i,c(f/KR))}else{let u=Math.abs(this.data.rect[3]-this.data.rect[1]-o);a=Math.min(i,c(u/KR))}s.fontSize=`calc(${a}px * var(--total-scale-factor))`,s.color=ie.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(s.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}},HB=class extends Ih{constructor(t){let e=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:e})}setPropertyOnSiblings(t,e,r,i){let s=this.annotationStorage;for(let a of this._getElementsByName(t.name,t.id))a.domElement&&(a.domElement[e]=r),s.setValue(a.id,{[i]:r})}render(){let t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){let i=t.getValue(e,{value:this.data.fieldValue}),s=i.value||"",a=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;a&&s.length>a&&(s=s.slice(0,a));let o=i.formattedValue||this.data.textContent?.join(`
97
+ `)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));let c={userValue:s,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=o??s,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type=this.data.password?"password":"text",r.setAttribute("value",o??s),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),Vm.add(r),this.contentElement=r,r.setAttribute("data-element-id",e),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=0;let{datetimeFormat:u,datetimeType:h,timeStep:f}=this.data,d=!!h&&this.enableScripting;u&&(r.title=u),this._setRequired(r,this.data.required),a&&(r.maxLength=a),r.addEventListener("input",g=>{t.setValue(e,{value:g.target.value}),this.setPropertyOnSiblings(r,"value",g.target.value,"value"),c.formattedValue=null}),r.addEventListener("resetform",g=>{let y=this.data.defaultFieldValue??"";r.value=c.userValue=y,c.formattedValue=null});let p=g=>{let{formattedValue:y}=c;y!=null&&(g.target.value=y),g.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",y=>{if(c.focused)return;let{target:b}=y;if(d&&(b.type=h,f&&(b.step=f)),c.userValue){let m=c.userValue;if(d)if(h==="time"){let w=new Date(m),A=[w.getHours(),w.getMinutes(),w.getSeconds()];b.value=A.map(_=>_.toString().padStart(2,"0")).join(":")}else b.value=new Date(m-eft).toISOString().split(h==="date"?"T":".",1)[0];else b.value=m}c.lastCommittedValue=b.value,c.commitKey=1,this.data.actions?.Focus||(c.focused=!0)}),r.addEventListener("updatefromsandbox",y=>{this.showElementAndHideCanvas(y.target);let b={value(m){c.userValue=m.detail.value??"",d||t.setValue(e,{value:c.userValue.toString()}),m.target.value=c.userValue},formattedValue(m){let{formattedValue:w}=m.detail;c.formattedValue=w,w!=null&&m.target!==document.activeElement&&(m.target.value=w);let A={formattedValue:w};d&&(A.value=w),t.setValue(e,A)},selRange(m){m.target.setSelectionRange(...m.detail.selRange)},charLimit:m=>{let{charLimit:w}=m.detail,{target:A}=m;if(w===0){A.removeAttribute("maxLength");return}A.setAttribute("maxLength",w);let _=c.userValue;!_||_.length<=w||(_=_.slice(0,w),A.value=c.userValue=_,t.setValue(e,{value:_}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:_,willCommit:!0,commitKey:1,selStart:A.selectionStart,selEnd:A.selectionEnd}}))}};this._dispatchEventFromSandbox(b,y)}),r.addEventListener("keydown",y=>{c.commitKey=1;let b=-1;if(y.key==="Escape"?b=0:y.key==="Enter"&&!this.data.multiLine?b=2:y.key==="Tab"&&(c.commitKey=3),b===-1)return;let{value:m}=y.target;c.lastCommittedValue!==m&&(c.lastCommittedValue=m,c.userValue=m,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:m,willCommit:!0,commitKey:b,selStart:y.target.selectionStart,selEnd:y.target.selectionEnd}}))});let g=p;p=null,r.addEventListener("blur",y=>{if(!c.focused||!y.relatedTarget)return;this.data.actions?.Blur||(c.focused=!1);let{target:b}=y,{value:m}=b;if(d){if(m&&h==="time"){let w=m.split(":").map(A=>parseInt(A,10));m=new Date(2e3,0,1,w[0],w[1],w[2]||0).valueOf(),b.step=""}else m.includes("T")||(m=`${m}T00:00`),m=new Date(m).valueOf();b.type="text"}c.userValue=m,c.lastCommittedValue!==m&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:m,willCommit:!0,commitKey:c.commitKey,selStart:y.target.selectionStart,selEnd:y.target.selectionEnd}}),g(y)}),this.data.actions?.Keystroke&&r.addEventListener("beforeinput",y=>{c.lastCommittedValue=null;let{data:b,target:m}=y,{value:w,selectionStart:A,selectionEnd:_}=m,S=A,I=_;switch(y.inputType){case"deleteWordBackward":{let C=w.substring(0,A).match(/\w*[^\w]*$/);C&&(S-=C[0].length);break}case"deleteWordForward":{let C=w.substring(A).match(/^[^\w]*\w*/);C&&(I+=C[0].length);break}case"deleteContentBackward":A===_&&(S-=1);break;case"deleteContentForward":A===_&&(I+=1);break}y.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:w,change:b||"",willCommit:!1,selStart:S,selEnd:I}})}),this._setEventListeners(r,c,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],y=>y.target.value)}if(p&&r.addEventListener("blur",p),this.data.comb){let y=(this.data.rect[2]-this.data.rect[0])/a;r.classList.add("comb"),r.style.letterSpacing=`calc(${y}px * var(--total-scale-factor) - 1ch)`}}else r=document.createElement("div"),r.textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell",this.data.hasOwnCanvas&&(r.hidden=!0);return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}},zB=class extends Ih{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}},WB=class extends Ih{constructor(t){super(t,{isRenderable:t.renderForms})}render(){let t=this.annotationStorage,e=this.data,r=e.id,i=t.getValue(r,{value:e.exportValue===e.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",t.setValue(r,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let s=document.createElement("input");return Vm.add(s),s.setAttribute("data-element-id",r),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=e.fieldName,i&&s.setAttribute("checked",!0),s.setAttribute("exportValue",e.exportValue),s.tabIndex=0,s.addEventListener("change",a=>{let{name:o,checked:c}=a.target;for(let u of this._getElementsByName(o,r)){let h=c&&u.exportValue===e.exportValue;u.domElement&&(u.domElement.checked=h),t.setValue(u.id,{value:h})}t.setValue(r,{value:c})}),s.addEventListener("resetform",a=>{let o=e.defaultFieldValue||"Off";a.target.checked=o===e.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",a=>{let o={value(c){c.target.checked=c.detail.value!=="Off",t.setValue(r,{value:c.target.checked})}};this._dispatchEventFromSandbox(o,a)}),this._setEventListeners(s,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)),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}},JI=class extends Ih{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let t=this.annotationStorage,e=this.data,r=e.id,i=t.getValue(r,{value:e.fieldValue===e.buttonValue}).value;if(typeof i=="string"&&(i=i!==e.buttonValue,t.setValue(r,{value:i})),i)for(let a of this._getElementsByName(e.fieldName,r))t.setValue(a.id,{value:!1});let s=document.createElement("input");if(Vm.add(s),s.setAttribute("data-element-id",r),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=e.fieldName,i&&s.setAttribute("checked",!0),s.tabIndex=0,s.addEventListener("change",a=>{let{name:o,checked:c}=a.target;for(let u of this._getElementsByName(o,r))t.setValue(u.id,{value:!1});t.setValue(r,{value:c})}),s.addEventListener("resetform",a=>{let o=e.defaultFieldValue;a.target.checked=o!=null&&o===e.buttonValue}),this.enableScripting&&this.hasJSActions){let a=e.buttonValue;s.addEventListener("updatefromsandbox",o=>{let c={value:u=>{let h=a===u.detail.value;for(let f of this._getElementsByName(u.target.name)){let d=h&&f.id===r;f.domElement&&(f.domElement.checked=d),t.setValue(f.id,{value:d})}}};this._dispatchEventFromSandbox(c,o)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}},GB=class extends Q1{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){let t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");let e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({},r)})),t}},VB=class extends Ih{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let t=this.annotationStorage,e=this.data.id,r=t.getValue(e,{value:this.data.fieldValue}),i=document.createElement("select");Vm.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=0;let s=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",h=>{let f=this.data.defaultFieldValue;for(let d of i.options)d.selected=d.value===f});for(let h of this.data.options){let f=document.createElement("option");f.textContent=h.displayValue,f.value=h.exportValue,r.value.includes(h.exportValue)&&(f.setAttribute("selected",!0),s=!1),i.append(f)}let a=null;if(s){let h=document.createElement("option");h.value=" ",h.setAttribute("hidden",!0),h.setAttribute("selected",!0),i.prepend(h),a=()=>{h.remove(),i.removeEventListener("input",a),a=null},i.addEventListener("input",a)}let o=h=>{let f=h?"value":"textContent",{options:d,multiple:p}=i;return p?Array.prototype.filter.call(d,g=>g.selected).map(g=>g[f]):d.selectedIndex===-1?null:d[d.selectedIndex][f]},c=o(!1),u=h=>{let f=h.target.options;return Array.prototype.map.call(f,d=>({displayValue:d.textContent,exportValue:d.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",h=>{let f={value(d){a?.();let p=d.detail.value,g=new Set(Array.isArray(p)?p:[p]);for(let y of i.options)y.selected=g.has(y.value);t.setValue(e,{value:o(!0)}),c=o(!1)},multipleSelection(d){i.multiple=!0},remove(d){let p=i.options,g=d.detail.remove;p[g].selected=!1,i.remove(g),p.length>0&&Array.prototype.findIndex.call(p,b=>b.selected)===-1&&(p[0].selected=!0),t.setValue(e,{value:o(!0),items:u(d)}),c=o(!1)},clear(d){for(;i.length!==0;)i.remove(0);t.setValue(e,{value:null,items:[]}),c=o(!1)},insert(d){let{index:p,displayValue:g,exportValue:y}=d.detail.insert,b=i.children[p],m=document.createElement("option");m.textContent=g,m.value=y,b?b.before(m):i.append(m),t.setValue(e,{value:o(!0),items:u(d)}),c=o(!1)},items(d){let{items:p}=d.detail;for(;i.length!==0;)i.remove(0);for(let g of p){let{displayValue:y,exportValue:b}=g,m=document.createElement("option");m.textContent=y,m.value=b,i.append(m)}i.options.length>0&&(i.options[0].selected=!0),t.setValue(e,{value:o(!0),items:u(d)}),c=o(!1)},indices(d){let p=new Set(d.detail.indices);for(let g of d.target.options)g.selected=p.has(g.index);t.setValue(e,{value:o(!0)}),c=o(!1)},editable(d){d.target.disabled=!d.detail.editable}};this._dispatchEventFromSandbox(f,h)}),i.addEventListener("input",h=>{let f=o(!0),d=o(!1);t.setValue(e,{value:f}),h.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:c,change:d,changeEx:f,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"]],h=>h.target.value)):i.addEventListener("input",function(h){t.setValue(e,{value:o(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},t2=class extends yn{constructor(e){let{data:r,elements:i,parent:s}=e,a=!!s._commentManager;super(e,{isRenderable:!a&&yn._hasPopupData(r)});T(this,vx);if(this.elements=i,a&&yn._hasPopupData(r)){let o=this.popup=R(this,vx,XB).call(this);for(let c of i)c.popup=o}else this.popup=null}render(){let{container:e}=this;e.classList.add("popupAnnotation"),e.role="comment";let r=this.popup=R(this,vx,XB).call(this),i=[];for(let s of this.elements)s.popup=r,s.container.ariaHasPopup="dialog",i.push(s.data.id),s.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(s=>`${Tb}${s}`).join(",")),this.container}};vx=new WeakSet,XB=function(){return new qB({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})};qB=class{constructor({container:t,color:e,elements:r,titleObj:i,modificationDate:s,contentsObj:a,richText:o,parent:c,rect:u,parentRect:h,open:f,commentManager:d=null}){T(this,Ue);T(this,Ia,null);T(this,xd,R(this,Ue,XX).bind(this));T(this,SD,R(this,Ue,QB).bind(this));T(this,_D,R(this,Ue,dI).bind(this));T(this,Nv,R(this,Ue,fI).bind(this));T(this,Lv,null);T(this,In,null);T(this,Oc,null);T(this,Sd,null);T(this,ym,null);T(this,kv,null);T(this,Mv,null);T(this,Pc,!1);T(this,Da,null);T(this,dh,null);T(this,ph,null);T(this,Dn,null);T(this,gh,null);T(this,_d,null);T(this,wx,null);T(this,mh,null);T(this,Fv,null);T(this,bm,null);T(this,Td,!1);T(this,Si,null);T(this,Cd,null);x(this,In,t),x(this,Fv,i),x(this,Oc,a),x(this,mh,o),x(this,kv,c),x(this,Lv,e),x(this,wx,u),x(this,Mv,h),x(this,ym,r),x(this,Ia,d),x(this,Si,r[0]),x(this,Sd,Hm.toDateObject(s)),this.trigger=r.flatMap(p=>p.getElementsToTriggerPopup()),d||(R(this,Ue,uI).call(this),l(this,In).hidden=!0,f&&R(this,Ue,fI).call(this))}renderCommentButton(){if(l(this,Dn)){l(this,Dn).parentNode||l(this,Si).container.after(l(this,Dn));return}if(l(this,gh)||R(this,Ue,YB).call(this),!l(this,gh))return;let{signal:t}=x(this,dh,new AbortController),e=l(this,Si).hasOwnCommentButton,r=()=>{l(this,Ia).toggleCommentPopup(this,!0,void 0,!e)},i=()=>{l(this,Ia).toggleCommentPopup(this,!1,!0,!e)},s=()=>{l(this,Ia).toggleCommentPopup(this,!1,!1)};if(e){x(this,Dn,l(this,Si).container);for(let a of this.trigger)a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.addEventListener("keydown",l(this,xd),{signal:t}),a.addEventListener("click",r,{signal:t}),a.addEventListener("pointerenter",i,{signal:t}),a.addEventListener("pointerleave",s,{signal:t}),a.classList.add("popupTriggerArea")}else{let a=x(this,Dn,document.createElement("button"));a.className="annotationCommentButton";let o=l(this,Si).container;a.style.zIndex=o.style.zIndex+1,a.tabIndex=0,a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.setAttribute("data-l10n-id","pdfjs-show-comment-button"),R(this,Ue,ZB).call(this),R(this,Ue,KB).call(this),a.addEventListener("keydown",l(this,xd),{signal:t}),a.addEventListener("click",r,{signal:t}),a.addEventListener("pointerenter",i,{signal:t}),a.addEventListener("pointerleave",s,{signal:t}),o.after(a)}}get commentButtonColor(){let{color:t,opacity:e}=l(this,Si).commentData;return t?l(this,kv)._commentManager.makeCommentColor(t,e):null}focusCommentButton(){setTimeout(()=>{l(this,Dn)?.focus()},0)}getData(){let{richText:t,color:e,opacity:r,creationDate:i,modificationDate:s}=l(this,Si).commentData;return{contentsObj:{str:this.comment},richText:t,color:e,opacity:r,creationDate:i,modificationDate:s}}get elementBeforePopup(){return l(this,Dn)}get comment(){return l(this,Cd)||x(this,Cd,l(this,Si).commentText),l(this,Cd)}set comment(t){t!==this.comment&&(l(this,Si).commentText=x(this,Cd,t))}focus(){l(this,Si).container?.focus()}get parentBoundingClientRect(){return l(this,Si).layer.getBoundingClientRect()}setCommentButtonStates({selected:t,hasPopup:e}){l(this,Dn)&&(l(this,Dn).classList.toggle("selected",t),l(this,Dn).ariaExpanded=e)}setSelectedCommentButton(t){l(this,Dn).classList.toggle("selected",t)}get commentPopupPosition(){if(l(this,_d))return l(this,_d);let{x:t,y:e,height:r}=l(this,Dn).getBoundingClientRect(),{x:i,y:s,width:a,height:o}=l(this,Si).layer.getBoundingClientRect();return[(t-i)/a,(e+r-s)/o]}set commentPopupPosition(t){x(this,_d,t)}hasDefaultPopupPosition(){return l(this,_d)===null}get commentButtonPosition(){return l(this,gh)}get commentButtonWidth(){return l(this,Dn).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(t){let[e,r]=l(this,_d)||this.commentButtonPosition.map(u=>u/100),i=this.parentBoundingClientRect,{x:s,y:a,width:o,height:c}=i;l(this,Ia).showDialog(null,this,s+e*o,a+r*c,{...t,parentDimensions:i})}render(){if(l(this,Da))return;let t=x(this,Da,document.createElement("div"));if(t.className="popup",l(this,Lv)){let r=t.style.outlineColor=ie.makeHexColor(...l(this,Lv));t.style.backgroundColor=`color-mix(in srgb, ${r} 30%, white)`}let e=document.createElement("span");if(e.className="header",l(this,Fv)?.str){let r=document.createElement("span");r.className="title",e.append(r),{dir:r.dir,str:r.textContent}=l(this,Fv)}if(t.append(e),l(this,Sd)){let r=document.createElement("time");r.className="popupDate",r.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),r.setAttribute("data-l10n-args",JSON.stringify({dateObj:l(this,Sd).valueOf()})),r.dateTime=l(this,Sd).toISOString(),e.append(r)}j3({html:l(this,Ue,hI)||l(this,Oc).str,dir:l(this,Oc)?.dir,className:"popupContent"},t),l(this,In).append(t)}updateEdited({rect:t,popup:e,deleted:r}){if(l(this,Ia)){r?(this.remove(),x(this,Cd,null)):e&&(e.deleted?this.remove():(R(this,Ue,ZB).call(this),x(this,Cd,e.text))),t&&(x(this,gh,null),R(this,Ue,YB).call(this),R(this,Ue,KB).call(this));return}if(r||e?.deleted){this.remove();return}R(this,Ue,uI).call(this),l(this,bm)||x(this,bm,{contentsObj:l(this,Oc),richText:l(this,mh)}),t&&x(this,ph,null),e&&e.text&&(x(this,mh,R(this,Ue,VX).call(this,e.text)),x(this,Sd,Hm.toDateObject(e.date)),x(this,Oc,null)),l(this,Da)?.remove(),x(this,Da,null)}resetEdited(){l(this,bm)&&({contentsObj:ze(this,Oc)._,richText:ze(this,mh)._}=l(this,bm),x(this,bm,null),l(this,Da)?.remove(),x(this,Da,null),x(this,ph,null))}remove(){if(l(this,dh)?.abort(),x(this,dh,null),l(this,Da)?.remove(),x(this,Da,null),x(this,Td,!1),x(this,Pc,!1),l(this,Dn)?.remove(),x(this,Dn,null),this.trigger)for(let t of this.trigger)t.classList.remove("popupTriggerArea")}forceHide(){x(this,Td,this.isVisible),l(this,Td)&&(l(this,In).hidden=!0)}maybeShow(){l(this,Ia)||(R(this,Ue,uI).call(this),l(this,Td)&&(l(this,Da)||R(this,Ue,dI).call(this),x(this,Td,!1),l(this,In).hidden=!1))}get isVisible(){return l(this,Ia)?!1:l(this,In).hidden===!1}};Ia=new WeakMap,xd=new WeakMap,SD=new WeakMap,_D=new WeakMap,Nv=new WeakMap,Lv=new WeakMap,In=new WeakMap,Oc=new WeakMap,Sd=new WeakMap,ym=new WeakMap,kv=new WeakMap,Mv=new WeakMap,Pc=new WeakMap,Da=new WeakMap,dh=new WeakMap,ph=new WeakMap,Dn=new WeakMap,gh=new WeakMap,_d=new WeakMap,wx=new WeakMap,mh=new WeakMap,Fv=new WeakMap,bm=new WeakMap,Td=new WeakMap,Si=new WeakMap,Cd=new WeakMap,Ue=new WeakSet,uI=function(){if(l(this,dh))return;x(this,dh,new AbortController);let{signal:t}=l(this,dh);for(let e of this.trigger)e.addEventListener("click",l(this,Nv),{signal:t}),e.addEventListener("pointerenter",l(this,_D),{signal:t}),e.addEventListener("pointerleave",l(this,SD),{signal:t}),e.classList.add("popupTriggerArea");for(let e of l(this,ym))e.container?.addEventListener("keydown",l(this,xd),{signal:t})},YB=function(){let t=l(this,ym).find(e=>e.hasCommentButton);t&&x(this,gh,t._normalizePoint(t.commentButtonPosition))},KB=function(){if(l(this,Si).extraPopupElement&&!l(this,Si).editor)return;l(this,Dn)||this.renderCommentButton();let[t,e]=l(this,gh),{style:r}=l(this,Dn);r.left=`calc(${t}%)`,r.top=`calc(${e}% - var(--comment-button-dim))`},ZB=function(){l(this,Si).extraPopupElement||(l(this,Dn)||this.renderCommentButton(),l(this,Dn).style.backgroundColor=this.commentButtonColor||"")},hI=function(){let t=l(this,mh),e=l(this,Oc);return t?.str&&(!e?.str||e.str===t.str)&&l(this,mh).html||null},JB=function(){return l(this,Ue,hI)?.attributes?.style?.fontSize||0},GX=function(){return l(this,Ue,hI)?.attributes?.style?.color||null},VX=function(t){let e=[],r={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},i={style:{color:l(this,Ue,GX),fontSize:l(this,Ue,JB)?`calc(${l(this,Ue,JB)}px * var(--total-scale-factor))`:""}};for(let s of t.split(`
98
+ `))e.push({name:"span",value:s,attributes:i});return r},XX=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&l(this,Pc))&&R(this,Ue,fI).call(this)},qX=function(){if(l(this,ph)!==null)return;let{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:r,pageX:i,pageY:s}}}=l(this,kv),a=!!l(this,Mv),o=a?l(this,Mv):l(this,wx);for(let g of l(this,ym))if(!o||ie.intersect(g.data.rect,o)!==null){o=g.data.rect,a=!0;break}let c=ie.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]),h=a?o[2]-o[0]+5:0,f=c[0]+h,d=c[1];x(this,ph,[100*(f-i)/e,100*(d-s)/r]);let{style:p}=l(this,In);p.left=`${l(this,ph)[0]}%`,p.top=`${l(this,ph)[1]}%`},fI=function(){if(l(this,Ia)){l(this,Ia).toggleCommentPopup(this,!1);return}x(this,Pc,!l(this,Pc)),l(this,Pc)?(R(this,Ue,dI).call(this),l(this,In).addEventListener("click",l(this,Nv)),l(this,In).addEventListener("keydown",l(this,xd))):(R(this,Ue,QB).call(this),l(this,In).removeEventListener("click",l(this,Nv)),l(this,In).removeEventListener("keydown",l(this,xd)))},dI=function(){l(this,Da)||this.render(),this.isVisible?l(this,Pc)&&l(this,In).classList.add("focused"):(R(this,Ue,qX).call(this),l(this,In).hidden=!1,l(this,In).style.zIndex=parseInt(l(this,In).style.zIndex)+1e3)},QB=function(){l(this,In).classList.remove("focused"),!(l(this,Pc)||!this.isVisible)&&(l(this,In).hidden=!0,l(this,In).style.zIndex=parseInt(l(this,In).style.zIndex)-1e3)};QI=class extends yn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Re.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){let t=this.contentElement=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(let e of this.textContent){let r=document.createElement("span");r.textContent=e,t.append(r)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},t3=class extends yn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});T(this,Ax,null)}render(){this.container.classList.add("lineAnnotation");let{data:e,width:r,height:i}=this,s=this.svgFactory.create(r,i,!0),a=x(this,Ax,this.svgFactory.createElement("svg:line"));return a.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),a.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),a.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),a.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),a.setAttribute("stroke-width",e.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),s.append(a),this.container.append(s),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,Ax)}addHighlightArea(){this.container.classList.add("highlightArea")}};Ax=new WeakMap;e3=class extends yn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});T(this,Ex,null)}render(){this.container.classList.add("squareAnnotation");let{data:e,width:r,height:i}=this,s=this.svgFactory.create(r,i,!0),a=e.borderStyle.width,o=x(this,Ex,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",r-a),o.setAttribute("height",i-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,Ex)}addHighlightArea(){this.container.classList.add("highlightArea")}};Ex=new WeakMap;r3=class extends yn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});T(this,xx,null)}render(){this.container.classList.add("circleAnnotation");let{data:e,width:r,height:i}=this,s=this.svgFactory.create(r,i,!0),a=e.borderStyle.width,o=x(this,xx,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",r/2),o.setAttribute("cy",i/2),o.setAttribute("rx",r/2-a/2),o.setAttribute("ry",i/2-a/2),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,xx)}addHighlightArea(){this.container.classList.add("highlightArea")}};xx=new WeakMap;tD=class extends yn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});T(this,Sx,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,vertices:r,borderStyle:i,popupRef:s},width:a,height:o}=this;if(!r)return this.container;let c=this.svgFactory.create(a,o,!0),u=[];for(let f=0,d=r.length;f<d;f+=2){let p=r[f]-e[0],g=e[3]-r[f+1];u.push(`${p},${g}`)}u=u.join(" ");let h=x(this,Sx,this.svgFactory.createElement(this.svgElementName));return h.setAttribute("points",u),h.setAttribute("stroke-width",i.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),c.append(h),this.container.append(c),!s&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,Sx)}addHighlightArea(){this.container.classList.add("highlightArea")}};Sx=new WeakMap;n3=class extends tD{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}},i3=class extends yn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}},e2=class extends yn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});T(this,Tx);T(this,_x,null);T(this,vm,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?Re.HIGHLIGHT:Re.INK}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,rotation:r,inkLists:i,borderStyle:s,popupRef:a}}=this,{transform:o,width:c,height:u}=R(this,Tx,s3).call(this,r,e),h=this.svgFactory.create(c,u,!0),f=x(this,_x,this.svgFactory.createElement("svg:g"));h.append(f),f.setAttribute("stroke-width",s.width||1),f.setAttribute("stroke-linecap","round"),f.setAttribute("stroke-linejoin","round"),f.setAttribute("stroke-miterlimit",10),f.setAttribute("stroke","transparent"),f.setAttribute("fill","transparent"),f.setAttribute("transform",o);for(let d=0,p=i.length;d<p;d++){let g=this.svgFactory.createElement(this.svgElementName);l(this,vm).push(g),g.setAttribute("points",i[d].join(",")),f.append(g)}return!a&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(h),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);let{thickness:r,points:i,rect:s}=e,a=l(this,_x);if(r>=0&&a.setAttribute("stroke-width",r||1),i)for(let o=0,c=l(this,vm).length;o<c;o++)l(this,vm)[o].setAttribute("points",i[o].join(","));if(s){let{transform:o,width:c,height:u}=R(this,Tx,s3).call(this,this.data.rotation,s);a.parentElement.setAttribute("viewBox",`0 0 ${c} ${u}`),a.setAttribute("transform",o)}}getElementsToTriggerPopup(){return l(this,vm)}addHighlightArea(){this.container.classList.add("highlightArea")}};_x=new WeakMap,vm=new WeakMap,Tx=new WeakSet,s3=function(e,r){switch(e){case 90:return{transform:`rotate(90) translate(${-r[0]},${r[1]}) scale(1,-1)`,width:r[3]-r[1],height:r[2]-r[0]};case 180:return{transform:`rotate(180) translate(${-r[2]},${r[1]}) scale(1,-1)`,width:r[2]-r[0],height:r[3]-r[1]};case 270:return{transform:`rotate(270) translate(${-r[2]},${r[3]}) scale(1,-1)`,width:r[3]-r[1],height:r[2]-r[0]};default:return{transform:`translate(${-r[0]},${r[3]}) scale(1,-1)`,width:r[2]-r[0],height:r[3]-r[1]}}};eD=class extends yn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Re.HIGHLIGHT}render(){let{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){let r=document.createElement("mark");r.classList.add("overlaidText"),r.textContent=t,this.container.append(r)}return this.container}},a3=class extends yn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("underlineAnnotation"),t){let r=document.createElement("u");r.classList.add("overlaidText"),r.textContent=t,this.container.append(r)}return this.container}},o3=class extends yn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("squigglyAnnotation"),t){let r=document.createElement("u");r.classList.add("overlaidText"),r.textContent=t,this.container.append(r)}return this.container}},l3=class extends yn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("strikeoutAnnotation"),t){let r=document.createElement("s");r.classList.add("overlaidText"),r.textContent=t,this.container.append(r)}return this.container}},rD=class extends yn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Re.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}},c3=class extends yn{constructor(e){super(e,{isRenderable:!0});T(this,Rx);T(this,Cx,null);let{file:r}=this.data;this.filename=r.filename,this.content=r.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...r})}render(){this.container.classList.add("fileAttachmentAnnotation");let{container:e,data:r}=this,i;r.hasAppearance||r.fillAlpha===0?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(r.name)?"paperclip":"pushpin"}.svg`,r.fillAlpha&&r.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(r.fillAlpha*100)}%);`)),i.addEventListener("dblclick",R(this,Rx,u3).bind(this)),x(this,Cx,i);let{isMac:s}=Pn.platform;return e.addEventListener("keydown",a=>{a.key==="Enter"&&(s?a.metaKey:a.ctrlKey)&&R(this,Rx,u3).call(this)}),!r.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):i.classList.add("popupTriggerArea"),e.append(i),e}getElementsToTriggerPopup(){return l(this,Cx)}addHighlightArea(){this.container.classList.add("highlightArea")}};Cx=new WeakMap,Rx=new WeakSet,u3=function(){this.downloadManager?.openOrDownloadData(this.content,this.filename)};X3=class X3{constructor({div:t,accessibilityManager:e,annotationCanvasMap:r,annotationEditorUIManager:i,page:s,viewport:a,structTreeLayer:o,commentManager:c,linkService:u,annotationStorage:h}){T(this,Th);T(this,wm,null);T(this,Am,null);T(this,Bv,null);T(this,Rd,new Map);T(this,Ix,null);T(this,Em,null);T(this,Oa,[]);T(this,Dx,!1);this.div=t,x(this,wm,e),x(this,Am,r),x(this,Ix,o||null),x(this,Em,u||null),x(this,Bv,h||new Y1),this.page=s,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=i,this._commentManager=c||null}hasEditableAnnotations(){return l(this,Rd).size>0}async render(t){let{annotations:e}=t,r=this.div;jd(r,this.viewport);let i=new Map,s=[],a={data:null,layer:r,linkService:l(this,Em),downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new Gm,annotationStorage:l(this,Bv),enableComment:t.enableComment===!0,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(let o of e){if(o.noHTML)continue;let c=o.annotationType===zn.POPUP;if(c){let f=i.get(o.id);if(!f)continue;if(!this._commentManager){s.push(o);continue}a.elements=f}else if(o.rect[2]===o.rect[0]||o.rect[3]===o.rect[1])continue;a.data=o;let u=z1.create(a);if(!u.isRenderable)continue;if(!c&&(l(this,Oa).push(u),o.popupRef)){let f=i.get(o.popupRef);f?f.push(u):i.set(o.popupRef,[u])}let h=u.render();o.hidden&&(h.style.visibility="hidden"),u._isEditable&&(l(this,Rd).set(u.data.id,u),this._annotationEditorUIManager?.renderAnnotationElement(u))}await R(this,Th,pI).call(this);for(let o of s){let c=a.elements=i.get(o.id);a.data=o;let u=z1.create(a);if(!u.isRenderable)continue;let h=u.render();u.contentElement.id=`${Tb}${o.id}`,o.hidden&&(h.style.visibility="hidden"),c.at(-1).container.after(h)}R(this,Th,h3).call(this)}async addLinkAnnotations(t){let e={data:null,layer:this.div,linkService:l(this,Em),svgFactory:new Gm,parent:this};for(let r of t){r.borderStyle||(r.borderStyle=X3._defaultBorderStyle),e.data=r;let i=z1.create(e);i.isRenderable&&(i.render(),i.contentElement.id=`${Tb}${r.id}`,l(this,Oa).push(i))}await R(this,Th,pI).call(this)}update({viewport:t}){let e=this.div;this.viewport=t,jd(e,{rotation:t.rotation}),R(this,Th,h3).call(this),e.hidden=!1}getEditableAnnotations(){return Array.from(l(this,Rd).values())}getEditableAnnotation(t){return l(this,Rd).get(t)}addFakeAnnotation(t){let{div:e}=this,{id:r,rotation:i}=t,s=new jB({data:{id:r,rect:t.getPDFRect(),rotation:i},editor:t,layer:e,parent:this,enableComment:!!this._commentManager,linkService:l(this,Em),annotationStorage:l(this,Bv)});return s.render(),s.contentElement.id=`${Tb}${r}`,s.createOrUpdatePopup(),l(this,Oa).push(s),s}removeAnnotation(t){let e=l(this,Oa).findIndex(i=>i.data.id===t);if(e<0)return;let[r]=l(this,Oa).splice(e,1);l(this,wm)?.removePointerInTextLayer(r.contentElement)}updateFakeAnnotations(t){if(t.length!==0){for(let e of t)e.updateFakeAnnotationElement(this);R(this,Th,pI).call(this)}}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}static get _defaultBorderStyle(){return Te(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:bb.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}};wm=new WeakMap,Am=new WeakMap,Bv=new WeakMap,Rd=new WeakMap,Ix=new WeakMap,Em=new WeakMap,Oa=new WeakMap,Dx=new WeakMap,Th=new WeakSet,pI=async function(){if(l(this,Oa).length===0)return;this.div.replaceChildren();let t=[];if(!l(this,Dx)){x(this,Dx,!0);for(let{contentElement:r,data:{id:i}}of l(this,Oa)){let s=r.id=`${Tb}${i}`;t.push(l(this,Ix)?.getAriaAttributes(s).then(a=>{if(a)for(let[o,c]of a)r.setAttribute(o,c)}))}}l(this,Oa).sort(({data:{rect:[r,i,s,a]}},{data:{rect:[o,c,u,h]}})=>{if(r===s&&i===a)return 1;if(o===u&&c===h)return-1;let f=a,d=i,p=(i+a)/2,g=h,y=c,b=(c+h)/2;if(p>=g&&b<=d)return-1;if(b>=f&&p<=y)return 1;let m=(r+s)/2,w=(o+u)/2;return m-w});let e=document.createDocumentFragment();for(let r of l(this,Oa))e.append(r.container),this._commentManager?(r.extraPopupElement?.popup||r.popup)?.renderCommentButton():r.extraPopupElement&&e.append(r.extraPopupElement.render());if(this.div.append(e),await Promise.all(t),l(this,wm))for(let r of l(this,Oa))l(this,wm).addPointerInTextLayer(r.contentElement,!1)},h3=function(){if(!l(this,Am))return;let t=this.div;for(let[e,r]of l(this,Am)){let i=t.querySelector(`[data-annotation-id="${e}"]`);if(!i)continue;r.className="annotationContent";let{firstChild:s}=i;s?s.nodeName==="CANVAS"?s.replaceWith(r):s.classList.contains("annotationContent")?s.after(r):s.before(r):i.append(r);let a=l(this,Rd).get(e);a&&(a._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(e,i.id,r),a._hasNoCanvas=!1):a.canvas=r)}l(this,Am).clear()};nD=X3,qR=/\r\n?|\n/g,nn=class nn extends Zr{constructor(e){super({...e,name:"freeTextEditor"});T(this,Jn);T(this,Pa,"");T(this,Ox,`${this.id}-editor`);T(this,xm,null);T(this,Na);Lt(this,"_colorPicker",null);this.color=e.color||nn._defaultColor||Zr._defaultLineColor,x(this,Na,e.fontSize||nn._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert"),this.canAddComment=!1}static get _keyboardManager(){let e=nn.prototype,r=a=>a.isEmpty(),i=$d.TRANSLATE_SMALL,s=$d.TRANSLATE_BIG;return Te(this,"_keyboardManager",new Wm([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-s,0],checker:r}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[i,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[s,0],checker:r}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-s],checker:r}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,i],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,s],checker:r}]]))}static initialize(e,r){Zr.initialize(e,r);let i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,r){switch(e){case Je.FREETEXT_SIZE:nn._defaultFontSize=r;break;case Je.FREETEXT_COLOR:nn._defaultColor=r;break}}updateParams(e,r){switch(e){case Je.FREETEXT_SIZE:R(this,Jn,YX).call(this,r);break;case Je.FREETEXT_COLOR:R(this,Jn,KX).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[Je.FREETEXT_SIZE,nn._defaultFontSize],[Je.FREETEXT_COLOR,nn._defaultColor||Zr._defaultLineColor]]}get propertiesToUpdate(){return[[Je.FREETEXT_SIZE,l(this,Na)],[Je.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new KI(this)),[["colorPicker",this._colorPicker]]}get colorType(){return Je.FREETEXT_COLOR}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}_translateEmpty(e,r){this._uiManager.translateSelectedEditors(e,r,!0)}getInitialTranslation(){let e=this.parentScale;return[-nn._internalPadding*e,-(nn._internalPadding+l(this,Na))*e]}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"),x(this,xm,new AbortController);let e=this._uiManager.combinedSignal(l(this,xm));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",l(this,Ox)),this._isDraggable=!0,l(this,xm)?.abort(),x(this,xm,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&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 e=l(this,Pa),r=x(this,Pa,R(this,Jn,ZX).call(this).trimEnd());if(e===r)return;let i=s=>{if(x(this,Pa,s),!s){this.remove();return}R(this,Jn,yI).call(this),this._uiManager.rebuild(this),R(this,Jn,gI).call(this)};this.addCommands({cmd:()=>{i(r)},undo:()=>{i(e)},mustExec:!1}),R(this,Jn,gI).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){nn._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){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 e,r;(this._isCopy||this.annotationElementId)&&(e=this.x,r=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",l(this,Ox)),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,Na)}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[s,a]=this.parentDimensions;if(this.annotationElementId){let{position:o}=this._initialData,[c,u]=this.getInitialTranslation();[c,u]=this.pageTranslationToScreen(c,u);let[h,f]=this.pageDimensions,[d,p]=this.pageTranslation,g,y;switch(this.rotation){case 0:g=e+(o[0]-d)/h,y=r+this.height-(o[1]-p)/f;break;case 90:g=e+(o[0]-d)/h,y=r-(o[1]-p)/f,[c,u]=[u,-c];break;case 180:g=e-this.width+(o[0]-d)/h,y=r-(o[1]-p)/f,[c,u]=[-c,-u];break;case 270:g=e+(o[0]-d-this.height*f)/h,y=r+(o[1]-p-this.width*h)/f,[c,u]=[-u,c];break}this.setAt(g*s,y*a,c,u)}else this._moveAfterPaste(e,r);R(this,Jn,yI).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(e){var g,y,b;let r=e.clipboardData||window.clipboardData,{types:i}=r;if(i.length===1&&i[0]==="text/plain")return;e.preventDefault();let s=R(g=nn,Ch,d3).call(g,r.getData("text")||"").replaceAll(qR,`
99
+ `);if(!s)return;let a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();let o=a.getRangeAt(0);if(!s.includes(`
100
+ `)){o.insertNode(document.createTextNode(s)),this.editorDiv.normalize(),a.collapseToStart();return}let{startContainer:c,startOffset:u}=o,h=[],f=[];if(c.nodeType===Node.TEXT_NODE){let m=c.parentElement;if(f.push(c.nodeValue.slice(u).replaceAll(qR,"")),m!==this.editorDiv){let w=h;for(let A of this.editorDiv.childNodes){if(A===m){w=f;continue}w.push(R(y=nn,Ch,mI).call(y,A))}}h.push(c.nodeValue.slice(0,u).replaceAll(qR,""))}else if(c===this.editorDiv){let m=h,w=0;for(let A of this.editorDiv.childNodes)w++===u&&(m=f),m.push(R(b=nn,Ch,mI).call(b,A))}x(this,Pa,`${h.join(`
101
+ `)}${s}${f.join(`
102
+ `)}`),R(this,Jn,yI).call(this);let d=new Range,p=Math.sumPrecise(h.map(m=>m.length));for(let{firstChild:m}of this.editorDiv.childNodes)if(m.nodeType===Node.TEXT_NODE){let w=m.nodeValue.length;if(p<=w){d.setStart(m,p),d.setEnd(m,p);break}p-=w}a.removeAllRanges(),a.addRange(d)}get contentDiv(){return this.editorDiv}getPDFRect(){let e=nn._internalPadding*this.parentScale;return this.getRect(e,e)}static async deserialize(e,r,i){var o;let s=null;if(e instanceof QI){let{data:{defaultAppearanceData:{fontSize:c,fontColor:u},rect:h,rotation:f,id:d,popupRef:p,richText:g,contentsObj:y,creationDate:b,modificationDate:m},textContent:w,textPosition:A,parent:{page:{pageNumber:_}}}=e;if(!w||w.length===0)return null;s=e={annotationType:Re.FREETEXT,color:Array.from(u),fontSize:c,value:w.join(`
103
+ `),position:A,pageIndex:_-1,rect:h.slice(0),rotation:f,annotationElementId:d,id:d,deleted:!1,popupRef:p,comment:y?.str||null,richText:g,creationDate:b,modificationDate:m}}let a=await super.deserialize(e,r,i);return x(a,Na,e.fontSize),a.color=ie.makeHexColor(...e.color),x(a,Pa,R(o=nn,Ch,d3).call(o,e.value)),a._initialData=s,e.comment&&a.setCommentData(e),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let r=Zr._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(e),{color:r,fontSize:l(this,Na),value:R(this,Jn,JX).call(this)});return this.addComment(i),e?(i.isCopy=!0,i):this.annotationElementId&&!R(this,Jn,QX).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(e){let r=super.renderAnnotationElement(e);if(!r)return null;let{style:i}=r;i.fontSize=`calc(${l(this,Na)}px * var(--total-scale-factor))`,i.color=this.color,r.replaceChildren();for(let s of l(this,Pa).split(`
104
+ `)){let a=document.createElement("div");a.append(s?document.createTextNode(s):document.createElement("br")),r.append(a)}return e.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:l(this,Pa)}}),r}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}};Pa=new WeakMap,Ox=new WeakMap,xm=new WeakMap,Na=new WeakMap,Jn=new WeakSet,YX=function(e){let r=s=>{this.editorDiv.style.fontSize=`calc(${s}px * var(--total-scale-factor))`,this.translate(0,-(s-l(this,Na))*this.parentScale),x(this,Na,s),R(this,Jn,gI).call(this)},i=l(this,Na);this.addCommands({cmd:r.bind(this,e),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Je.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},KX=function(e){let r=s=>{this.color=s,this.onUpdatedColor()},i=this.color;this.addCommands({cmd:r.bind(this,e),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Je.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},ZX=function(){var i;let e=[];this.editorDiv.normalize();let r=null;for(let s of this.editorDiv.childNodes)r?.nodeType===Node.TEXT_NODE&&s.nodeName==="BR"||(e.push(R(i=nn,Ch,mI).call(i,s)),r=s);return e.join(`
105
+ `)},gI=function(){let[e,r]=this.parentDimensions,i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{let{currentLayer:s,div:a}=this,o=a.style.display,c=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",s.div.append(this.div),i=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",c)}this.rotation%180===this.parentRotation%180?(this.width=i.width/e,this.height=i.height/r):(this.width=i.height/e,this.height=i.width/r),this.fixAndSetPosition()},Ch=new WeakSet,mI=function(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(qR,"")},yI=function(){if(this.editorDiv.replaceChildren(),!!l(this,Pa))for(let e of l(this,Pa).split(`
106
+ `)){let r=document.createElement("div");r.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(r)}},JX=function(){return l(this,Pa).replaceAll("\xA0"," ")},d3=function(e){return e.replaceAll(" ","\xA0")},QX=function(e){let{value:r,fontSize:i,color:s,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==r||e.fontSize!==i||e.color.some((o,c)=>o!==s[c])||e.pageIndex!==a},T(nn,Ch),Lt(nn,"_freeTextDefaultContent",""),Lt(nn,"_internalPadding",0),Lt(nn,"_defaultColor",null),Lt(nn,"_defaultFontSize",10),Lt(nn,"_type","freetext"),Lt(nn,"_editorType",Re.FREETEXT);f3=nn,ce=class{toSVGPath(){Wr("Abstract method `toSVGPath` must be implemented.")}get box(){Wr("Abstract getter `box` must be implemented.")}serialize(t,e){Wr("Abstract method `serialize` must be implemented.")}static _rescale(t,e,r,i,s,a){a||(a=new Float32Array(t.length));for(let o=0,c=t.length;o<c;o+=2)a[o]=e+t[o]*i,a[o+1]=r+t[o+1]*s;return a}static _rescaleAndSwap(t,e,r,i,s,a){a||(a=new Float32Array(t.length));for(let o=0,c=t.length;o<c;o+=2)a[o]=e+t[o+1]*i,a[o+1]=r+t[o]*s;return a}static _translate(t,e,r,i){i||(i=new Float32Array(t.length));for(let s=0,a=t.length;s<a;s+=2)i[s]=e+t[s],i[s+1]=r+t[s+1];return i}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,e,r,i,s){switch(s){case 90:return[1-e/r,t/i];case 180:return[1-t/r,1-e/i];case 270:return[e/r,1-t/i];default:return[t/r,e/i]}}static _normalizePagePoint(t,e,r){switch(r){case 90:return[1-e,t];case 180:return[1-t,1-e];case 270:return[e,1-t];default:return[t,e]}}static createBezierPoints(t,e,r,i,s,a){return[(t+5*r)/6,(e+5*i)/6,(5*r+s)/6,(5*i+a)/6,(r+s)/2,(i+a)/2]}};Lt(ce,"PRECISION",1e-4);zu=class zu{constructor({x:t,y:e},r,i,s,a,o=0){T(this,di);T(this,La);T(this,Cl,[]);T(this,Uv);T(this,jv);T(this,Nc,[]);T(this,Xe,new Float32Array(18));T(this,Sm);T(this,_m);T(this,Px);T(this,Nx);T(this,$v);T(this,Hv);T(this,Id,[]);x(this,La,r),x(this,Hv,s*i),x(this,jv,a),l(this,Xe).set([NaN,NaN,NaN,NaN,t,e],6),x(this,Uv,o),x(this,Nx,l(zu,Lx)*i),x(this,Px,l(zu,CD)*i),x(this,$v,i),l(this,Id).push(t,e)}isEmpty(){return isNaN(l(this,Xe)[8])}add({x:t,y:e}){x(this,Sm,t),x(this,_m,e);let[r,i,s,a]=l(this,La),[o,c,u,h]=l(this,Xe).subarray(8,12),f=t-u,d=e-h,p=Math.hypot(f,d);if(p<l(this,Px))return!1;let g=p-l(this,Nx),y=g/p,b=y*f,m=y*d,w=o,A=c;o=u,c=h,u+=b,h+=m,l(this,Id)?.push(t,e);let _=-m/g,S=b/g,I=_*l(this,Hv),C=S*l(this,Hv);return l(this,Xe).set(l(this,Xe).subarray(2,8),0),l(this,Xe).set([u+I,h+C],4),l(this,Xe).set(l(this,Xe).subarray(14,18),12),l(this,Xe).set([u-I,h-C],16),isNaN(l(this,Xe)[6])?(l(this,Nc).length===0&&(l(this,Xe).set([o+I,c+C],2),l(this,Nc).push(NaN,NaN,NaN,NaN,(o+I-r)/s,(c+C-i)/a),l(this,Xe).set([o-I,c-C],14),l(this,Cl).push(NaN,NaN,NaN,NaN,(o-I-r)/s,(c-C-i)/a)),l(this,Xe).set([w,A,o,c,u,h],6),!this.isEmpty()):(l(this,Xe).set([w,A,o,c,u,h],6),Math.abs(Math.atan2(A-c,w-o)-Math.atan2(m,b))<Math.PI/2?([o,c,u,h]=l(this,Xe).subarray(2,6),l(this,Nc).push(NaN,NaN,NaN,NaN,((o+u)/2-r)/s,((c+h)/2-i)/a),[o,c,w,A]=l(this,Xe).subarray(14,18),l(this,Cl).push(NaN,NaN,NaN,NaN,((w+o)/2-r)/s,((A+c)/2-i)/a),!0):([w,A,o,c,u,h]=l(this,Xe).subarray(0,6),l(this,Nc).push(((w+5*o)/6-r)/s,((A+5*c)/6-i)/a,((5*o+u)/6-r)/s,((5*c+h)/6-i)/a,((o+u)/2-r)/s,((c+h)/2-i)/a),[u,h,o,c,w,A]=l(this,Xe).subarray(12,18),l(this,Cl).push(((w+5*o)/6-r)/s,((A+5*c)/6-i)/a,((5*o+u)/6-r)/s,((5*c+h)/6-i)/a,((o+u)/2-r)/s,((c+h)/2-i)/a),!0))}toSVGPath(){if(this.isEmpty())return"";let t=l(this,Nc),e=l(this,Cl);if(isNaN(l(this,Xe)[6])&&!this.isEmpty())return R(this,di,tq).call(this);let r=[];r.push(`M${t[4]} ${t[5]}`);for(let i=6;i<t.length;i+=6)isNaN(t[i])?r.push(`L${t[i+4]} ${t[i+5]}`):r.push(`C${t[i]} ${t[i+1]} ${t[i+2]} ${t[i+3]} ${t[i+4]} ${t[i+5]}`);R(this,di,rq).call(this,r);for(let i=e.length-6;i>=6;i-=6)isNaN(e[i])?r.push(`L${e[i+4]} ${e[i+5]}`):r.push(`C${e[i]} ${e[i+1]} ${e[i+2]} ${e[i+3]} ${e[i+4]} ${e[i+5]}`);return R(this,di,eq).call(this,r),r.join(" ")}newFreeDrawOutline(t,e,r,i,s,a){return new sD(t,e,r,i,s,a)}getOutlines(){let t=l(this,Nc),e=l(this,Cl),r=l(this,Xe),[i,s,a,o]=l(this,La),c=new Float32Array((l(this,Id)?.length??0)+2);for(let f=0,d=c.length-2;f<d;f+=2)c[f]=(l(this,Id)[f]-i)/a,c[f+1]=(l(this,Id)[f+1]-s)/o;if(c[c.length-2]=(l(this,Sm)-i)/a,c[c.length-1]=(l(this,_m)-s)/o,isNaN(r[6])&&!this.isEmpty())return R(this,di,nq).call(this,c);let u=new Float32Array(l(this,Nc).length+24+l(this,Cl).length),h=t.length;for(let f=0;f<h;f+=2){if(isNaN(t[f])){u[f]=u[f+1]=NaN;continue}u[f]=t[f],u[f+1]=t[f+1]}h=R(this,di,sq).call(this,u,h);for(let f=e.length-6;f>=6;f-=6)for(let d=0;d<6;d+=2){if(isNaN(e[f+d])){u[h]=u[h+1]=NaN,h+=2;continue}u[h]=e[f+d],u[h+1]=e[f+d+1],h+=2}return R(this,di,iq).call(this,u,h),this.newFreeDrawOutline(u,c,l(this,La),l(this,$v),l(this,Uv),l(this,jv))}};La=new WeakMap,Cl=new WeakMap,Uv=new WeakMap,jv=new WeakMap,Nc=new WeakMap,Xe=new WeakMap,Sm=new WeakMap,_m=new WeakMap,Px=new WeakMap,Nx=new WeakMap,$v=new WeakMap,Hv=new WeakMap,Id=new WeakMap,Lx=new WeakMap,TD=new WeakMap,CD=new WeakMap,di=new WeakSet,k1=function(){let t=l(this,Xe).subarray(4,6),e=l(this,Xe).subarray(16,18),[r,i,s,a]=l(this,La);return[(l(this,Sm)+(t[0]-e[0])/2-r)/s,(l(this,_m)+(t[1]-e[1])/2-i)/a,(l(this,Sm)+(e[0]-t[0])/2-r)/s,(l(this,_m)+(e[1]-t[1])/2-i)/a]},tq=function(){let[t,e,r,i]=l(this,La),[s,a,o,c]=R(this,di,k1).call(this);return`M${(l(this,Xe)[2]-t)/r} ${(l(this,Xe)[3]-e)/i} L${(l(this,Xe)[4]-t)/r} ${(l(this,Xe)[5]-e)/i} L${s} ${a} L${o} ${c} L${(l(this,Xe)[16]-t)/r} ${(l(this,Xe)[17]-e)/i} L${(l(this,Xe)[14]-t)/r} ${(l(this,Xe)[15]-e)/i} Z`},eq=function(t){let e=l(this,Cl);t.push(`L${e[4]} ${e[5]} Z`)},rq=function(t){let[e,r,i,s]=l(this,La),a=l(this,Xe).subarray(4,6),o=l(this,Xe).subarray(16,18),[c,u,h,f]=R(this,di,k1).call(this);t.push(`L${(a[0]-e)/i} ${(a[1]-r)/s} L${c} ${u} L${h} ${f} L${(o[0]-e)/i} ${(o[1]-r)/s}`)},nq=function(t){let e=l(this,Xe),[r,i,s,a]=l(this,La),[o,c,u,h]=R(this,di,k1).call(this),f=new Float32Array(36);return f.set([NaN,NaN,NaN,NaN,(e[2]-r)/s,(e[3]-i)/a,NaN,NaN,NaN,NaN,(e[4]-r)/s,(e[5]-i)/a,NaN,NaN,NaN,NaN,o,c,NaN,NaN,NaN,NaN,u,h,NaN,NaN,NaN,NaN,(e[16]-r)/s,(e[17]-i)/a,NaN,NaN,NaN,NaN,(e[14]-r)/s,(e[15]-i)/a],0),this.newFreeDrawOutline(f,t,l(this,La),l(this,$v),l(this,Uv),l(this,jv))},iq=function(t,e){let r=l(this,Cl);return t.set([NaN,NaN,NaN,NaN,r[4],r[5]],e),e+=6},sq=function(t,e){let r=l(this,Xe).subarray(4,6),i=l(this,Xe).subarray(16,18),[s,a,o,c]=l(this,La),[u,h,f,d]=R(this,di,k1).call(this);return t.set([NaN,NaN,NaN,NaN,(r[0]-s)/o,(r[1]-a)/c,NaN,NaN,NaN,NaN,u,h,NaN,NaN,NaN,NaN,f,d,NaN,NaN,NaN,NaN,(i[0]-s)/o,(i[1]-a)/c],e),e+=24},T(zu,Lx,8),T(zu,TD,2),T(zu,CD,l(zu,Lx)+l(zu,TD));iD=zu,sD=class extends ce{constructor(e,r,i,s,a,o){super();T(this,RD);T(this,zv);T(this,Tm,new Float32Array(4));T(this,yh);T(this,kx);T(this,ka);T(this,Mx);T(this,Gn);x(this,Gn,e),x(this,ka,r),x(this,zv,i),x(this,Mx,s),x(this,yh,a),x(this,kx,o),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],R(this,RD,aq).call(this,o);let[c,u,h,f]=l(this,Tm);for(let d=0,p=e.length;d<p;d+=2)e[d]=(e[d]-c)/h,e[d+1]=(e[d+1]-u)/f;for(let d=0,p=r.length;d<p;d+=2)r[d]=(r[d]-c)/h,r[d+1]=(r[d+1]-u)/f}toSVGPath(){let e=[`M${l(this,Gn)[4]} ${l(this,Gn)[5]}`];for(let r=6,i=l(this,Gn).length;r<i;r+=6){if(isNaN(l(this,Gn)[r])){e.push(`L${l(this,Gn)[r+4]} ${l(this,Gn)[r+5]}`);continue}e.push(`C${l(this,Gn)[r]} ${l(this,Gn)[r+1]} ${l(this,Gn)[r+2]} ${l(this,Gn)[r+3]} ${l(this,Gn)[r+4]} ${l(this,Gn)[r+5]}`)}return e.push("Z"),e.join(" ")}serialize([e,r,i,s],a){let o=i-e,c=s-r,u,h;switch(a){case 0:u=ce._rescale(l(this,Gn),e,s,o,-c),h=ce._rescale(l(this,ka),e,s,o,-c);break;case 90:u=ce._rescaleAndSwap(l(this,Gn),e,r,o,c),h=ce._rescaleAndSwap(l(this,ka),e,r,o,c);break;case 180:u=ce._rescale(l(this,Gn),i,r,-o,c),h=ce._rescale(l(this,ka),i,r,-o,c);break;case 270:u=ce._rescaleAndSwap(l(this,Gn),i,s,-o,-c),h=ce._rescaleAndSwap(l(this,ka),i,s,-o,-c);break}return{outline:Array.from(u),points:[Array.from(h)]}}get box(){return l(this,Tm)}newOutliner(e,r,i,s,a,o=0){return new iD(e,r,i,s,a,o)}getNewOutline(e,r){let[i,s,a,o]=l(this,Tm),[c,u,h,f]=l(this,zv),d=a*h,p=o*f,g=i*h+c,y=s*f+u,b=this.newOutliner({x:l(this,ka)[0]*d+g,y:l(this,ka)[1]*p+y},l(this,zv),l(this,Mx),e,l(this,kx),r??l(this,yh));for(let m=2;m<l(this,ka).length;m+=2)b.add({x:l(this,ka)[m]*d+g,y:l(this,ka)[m+1]*p+y});return b.getOutlines()}};zv=new WeakMap,Tm=new WeakMap,yh=new WeakMap,kx=new WeakMap,ka=new WeakMap,Mx=new WeakMap,Gn=new WeakMap,RD=new WeakSet,aq=function(e){let r=l(this,Gn),i=r[4],s=r[5],a=[i,s,i,s],o=i,c=s,u=i,h=s,f=e?Math.max:Math.min,d=new Float32Array(4);for(let g=6,y=r.length;g<y;g+=6){let b=r[g+4],m=r[g+5];isNaN(r[g])?(ie.pointBoundingBox(b,m,a),c>m?(o=b,c=m):c===m&&(o=f(o,b)),h<m?(u=b,h=m):h===m&&(u=f(u,b))):(d[0]=d[1]=1/0,d[2]=d[3]=-1/0,ie.bezierBoundingBox(i,s,...r.slice(g,g+6),d),ie.rectBoundingBox(d[0],d[1],d[2],d[3],a),c>d[1]?(o=d[0],c=d[1]):c===d[1]&&(o=f(o,d[0])),h<d[3]?(u=d[2],h=d[3]):h===d[3]&&(u=f(u,d[2]))),i=b,s=m}let p=l(this,Tm);p[0]=a[0]-l(this,yh),p[1]=a[1]-l(this,yh),p[2]=a[2]-a[0]+2*l(this,yh),p[3]=a[3]-a[1]+2*l(this,yh),this.firstPoint=[o,c],this.lastPoint=[u,h]};r2=class{constructor(t,e=0,r=0,i=!0){T(this,Ns);T(this,Fx);T(this,Bx);T(this,Ux);T(this,Dd,[]);T(this,Rl,[]);let s=[1/0,1/0,-1/0,-1/0],o=10**-4;for(let{x:b,y:m,width:w,height:A}of t){let _=Math.floor((b-e)/o)*o,S=Math.ceil((b+w+e)/o)*o,I=Math.floor((m-e)/o)*o,C=Math.ceil((m+A+e)/o)*o,M=[_,I,C,!0],z=[S,I,C,!1];l(this,Dd).push(M,z),ie.rectBoundingBox(_,I,S,C,s)}let c=s[2]-s[0]+2*r,u=s[3]-s[1]+2*r,h=s[0]-r,f=s[1]-r,d=i?-1/0:1/0,p=1/0,g=l(this,Dd).at(i?-1:-2),y=[g[0],g[2]];for(let b of l(this,Dd)){let[m,w,A,_]=b;!_&&i?w<p?(p=w,d=m):w===p&&(d=Math.max(d,m)):_&&!i&&(w<p?(p=w,d=m):w===p&&(d=Math.min(d,m))),b[0]=(m-h)/c,b[1]=(w-f)/u,b[2]=(A-f)/u}x(this,Fx,new Float32Array([h,f,c,u])),x(this,Bx,[d,p]),x(this,Ux,y)}getOutlines(){l(this,Dd).sort((e,r)=>e[0]-r[0]||e[1]-r[1]||e[2]-r[2]);let t=[];for(let e of l(this,Dd))e[3]?(t.push(...R(this,Ns,p3).call(this,e)),R(this,Ns,lq).call(this,e)):(R(this,Ns,cq).call(this,e),t.push(...R(this,Ns,p3).call(this,e)));return R(this,Ns,oq).call(this,t)}};Fx=new WeakMap,Bx=new WeakMap,Ux=new WeakMap,Dd=new WeakMap,Rl=new WeakMap,Ns=new WeakSet,oq=function(t){let e=[],r=new Set;for(let a of t){let[o,c,u]=a;e.push([o,c,a],[o,u,a])}e.sort((a,o)=>a[1]-o[1]||a[0]-o[0]);for(let a=0,o=e.length;a<o;a+=2){let c=e[a][2],u=e[a+1][2];c.push(u),u.push(c),r.add(c),r.add(u)}let i=[],s;for(;r.size>0;){let a=r.values().next().value,[o,c,u,h,f]=a;r.delete(a);let d=o,p=c;for(s=[o,u],i.push(s);;){let g;if(r.has(h))g=h;else if(r.has(f))g=f;else break;r.delete(g),[o,c,u,h,f]=g,d!==o&&(s.push(d,p,o,p===c?c:u),d=o),p=p===c?u:c}s.push(d,p)}return new g3(i,l(this,Fx),l(this,Bx),l(this,Ux))},bI=function(t){let e=l(this,Rl),r=0,i=e.length-1;for(;r<=i;){let s=r+i>>1,a=e[s][0];if(a===t)return s;a<t?r=s+1:i=s-1}return i+1},lq=function([,t,e]){let r=R(this,Ns,bI).call(this,t);l(this,Rl).splice(r,0,[t,e])},cq=function([,t,e]){let r=R(this,Ns,bI).call(this,t);for(let i=r;i<l(this,Rl).length;i++){let[s,a]=l(this,Rl)[i];if(s!==t)break;if(s===t&&a===e){l(this,Rl).splice(i,1);return}}for(let i=r-1;i>=0;i--){let[s,a]=l(this,Rl)[i];if(s!==t)break;if(s===t&&a===e){l(this,Rl).splice(i,1);return}}},p3=function(t){let[e,r,i]=t,s=[[e,r,i]],a=R(this,Ns,bI).call(this,i);for(let o=0;o<a;o++){let[c,u]=l(this,Rl)[o];for(let h=0,f=s.length;h<f;h++){let[,d,p]=s[h];if(!(u<=d||p<=c)){if(d>=c){if(p>u)s[h][1]=u;else{if(f===1)return[];s.splice(h,1),h--,f--}continue}s[h][2]=c,p>u&&s.push([e,u,p])}}}return s};g3=class extends ce{constructor(e,r,i,s){super();T(this,jx);T(this,Wv);x(this,Wv,e),x(this,jx,r),this.firstPoint=i,this.lastPoint=s}toSVGPath(){let e=[];for(let r of l(this,Wv)){let[i,s]=r;e.push(`M${i} ${s}`);for(let a=2;a<r.length;a+=2){let o=r[a],c=r[a+1];o===i?(e.push(`V${c}`),s=c):c===s&&(e.push(`H${o}`),i=o)}e.push("Z")}return e.join(" ")}serialize([e,r,i,s],a){let o=[],c=i-e,u=s-r;for(let h of l(this,Wv)){let f=new Array(h.length);for(let d=0;d<h.length;d+=2)f[d]=e+h[d]*c,f[d+1]=s-h[d+1]*u;o.push(f)}return o}get box(){return l(this,jx)}get classNamesForOutlining(){return["highlightOutline"]}};jx=new WeakMap,Wv=new WeakMap;n2=class extends iD{newFreeDrawOutline(t,e,r,i,s,a){return new m3(t,e,r,i,s,a)}},m3=class extends sD{newOutliner(t,e,r,i,s,a=0){return new n2(t,e,r,i,s,a)}},hr=class hr extends Zr{constructor(e){super({...e,name:"highlightEditor"});T(this,Be);T(this,Gv,null);T(this,$x,0);T(this,bh);T(this,Cm,null);T(this,Hx,null);T(this,ia,null);T(this,zx,null);T(this,Wx,0);T(this,Rm,null);T(this,Ma,null);T(this,Fa,null);T(this,Hi,!1);T(this,Vv,null);T(this,Xv,null);T(this,fs,null);T(this,qv,"");T(this,jo);T(this,Gx,"");this.color=e.color||hr._defaultColor,x(this,jo,e.thickness||hr._defaultThickness),this.opacity=e.opacity||hr._defaultOpacity,x(this,bh,e.boxes||null),x(this,Gx,e.methodOfCreation||""),x(this,qv,e.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",e.highlightId>-1?(x(this,Hi,!0),R(this,Be,vI).call(this,e),R(this,Be,Eg).call(this)):l(this,bh)&&(x(this,Gv,e.anchorNode),x(this,$x,e.anchorOffset),x(this,zx,e.focusNode),x(this,Wx,e.focusOffset),R(this,Be,y3).call(this),R(this,Be,Eg).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){let e=hr.prototype;return Te(this,"_keyboardManager",new Wm([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:l(this,Hi)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:l(this,jo),methodOfCreation:l(this,Gx)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}static initialize(e,r){Zr.initialize(e,r),hr._defaultColor||(hr._defaultColor=r.highlightColors?.values().next().value||"#fff066")}static updateDefaultParams(e,r){switch(e){case Je.HIGHLIGHT_COLOR:hr._defaultColor=r;break;case Je.HIGHLIGHT_THICKNESS:hr._defaultThickness=r;break}}translateInPage(e,r){}get toolbarPosition(){return l(this,Xv)}get commentButtonPosition(){return l(this,Vv)}updateParams(e,r){switch(e){case Je.HIGHLIGHT_COLOR:R(this,Be,uq).call(this,r);break;case Je.HIGHLIGHT_THICKNESS:R(this,Be,hq).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[Je.HIGHLIGHT_COLOR,hr._defaultColor],[Je.HIGHLIGHT_THICKNESS,hr._defaultThickness]]}get propertiesToUpdate(){return[[Je.HIGHLIGHT_COLOR,this.color||hr._defaultColor],[Je.HIGHLIGHT_THICKNESS,l(this,jo)||hr._defaultThickness],[Je.HIGHLIGHT_FREE,l(this,Hi)]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(l(this,Fa),{root:{fill:this.color,"fill-opacity":this.opacity}}),l(this,Hx)?.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",x(this,Hx,new J1({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(R(this,Be,AI).call(this))}getBaseTranslation(){return[0,0]}getRect(e,r){return super.getRect(e,r,R(this,Be,AI).call(this))}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){R(this,Be,b3).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(R(this,Be,Eg).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let r=!1;this.parent&&!e?R(this,Be,b3).call(this):e&&(R(this,Be,Eg).call(this,e),r=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),r&&this.select()}rotate(e){var s,a,o;let{drawLayer:r}=this.parent,i;l(this,Hi)?(e=(e-this.rotation+360)%360,i=R(s=hr,Wo,Sb).call(s,l(this,Ma).box,e)):i=R(a=hr,Wo,Sb).call(a,[this.x,this.y,this.width,this.height],e),r.updateProperties(l(this,Fa),{bbox:i,root:{"data-main-rotation":e}}),r.updateProperties(l(this,fs),{bbox:R(o=hr,Wo,Sb).call(o,l(this,ia).box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;let e=super.render();l(this,qv)&&(e.setAttribute("aria-label",l(this,qv)),e.setAttribute("role","mark")),l(this,Hi)?e.classList.add("free"):this.div.addEventListener("keydown",R(this,Be,dq).bind(this),{signal:this._uiManager._signal});let r=x(this,Rm,document.createElement("div"));return e.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=l(this,Cm),this.setDims(),YV(this,l(this,Rm),["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(l(this,fs),{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(l(this,fs),{rootClass:{hovered:!1}})}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:R(this,Be,wI).call(this,!0);break;case 1:case 3:R(this,Be,wI).call(this,!1);break}}select(){super.select(),l(this,fs)&&this.parent?.drawLayer.updateProperties(l(this,fs),{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),l(this,fs)&&(this.parent?.drawLayer.updateProperties(l(this,fs),{rootClass:{selected:!1}}),l(this,Hi)||R(this,Be,wI).call(this,!1))}get _mustFixPosition(){return!l(this,Hi)}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(l(this,Fa),{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(l(this,fs),{rootClass:{hidden:!e}}))}static startHighlighting(e,r,{target:i,x:s,y:a}){let{x:o,y:c,width:u,height:h}=i.getBoundingClientRect(),f=new AbortController,d=e.combinedSignal(f),p=g=>{f.abort(),R(this,Wo,yq).call(this,e,g)};window.addEventListener("blur",p,{signal:d}),window.addEventListener("pointerup",p,{signal:d}),window.addEventListener("pointerdown",mn,{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",Ga,{signal:d}),i.addEventListener("pointermove",R(this,Wo,mq).bind(this,e),{signal:d}),this._freeHighlight=new n2({x:s,y:a},[o,c,u,h],e.scale,this._defaultThickness/2,r,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.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(e,r,i){var y,b,m,w;let s=null;if(e instanceof eD){let{data:{quadPoints:A,rect:_,rotation:S,id:I,color:C,opacity:M,popupRef:z,richText:G,contentsObj:Y,creationDate:L,modificationDate:j},parent:{page:{pageNumber:q}}}=e;s=e={annotationType:Re.HIGHLIGHT,color:Array.from(C),opacity:M,quadPoints:A,boxes:null,pageIndex:q-1,rect:_.slice(0),rotation:S,annotationElementId:I,id:I,deleted:!1,popupRef:z,richText:G,comment:Y?.str||null,creationDate:L,modificationDate:j}}else if(e instanceof e2){let{data:{inkLists:A,rect:_,rotation:S,id:I,color:C,borderStyle:{rawWidth:M},popupRef:z,richText:G,contentsObj:Y,creationDate:L,modificationDate:j},parent:{page:{pageNumber:q}}}=e;s=e={annotationType:Re.HIGHLIGHT,color:Array.from(C),thickness:M,inkLists:A,boxes:null,pageIndex:q-1,rect:_.slice(0),rotation:S,annotationElementId:I,id:I,deleted:!1,popupRef:z,richText:G,comment:Y?.str||null,creationDate:L,modificationDate:j}}let{color:a,quadPoints:o,inkLists:c,opacity:u}=e,h=await super.deserialize(e,r,i);h.color=ie.makeHexColor(...a),h.opacity=u||1,c&&x(h,jo,e.thickness),h._initialData=s,e.comment&&h.setCommentData(e);let[f,d]=h.pageDimensions,[p,g]=h.pageTranslation;if(o){let A=x(h,bh,[]);for(let _=0;_<o.length;_+=8)A.push({x:(o[_]-p)/f,y:1-(o[_+1]-g)/d,width:(o[_+2]-o[_])/f,height:(o[_+1]-o[_+5])/d});R(y=h,Be,y3).call(y),R(b=h,Be,Eg).call(b),h.rotate(h.rotation)}else if(c){x(h,Hi,!0);let A=c[0],_={x:A[0]-p,y:d-(A[1]-g)},S=new n2(_,[0,0,f,d],1,l(h,jo)/2,!0,.001);for(let M=0,z=A.length;M<z;M+=2)_.x=A[M]-p,_.y=d-(A[M+1]-g),S.add(_);let{id:I,clipPathId:C}=r.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:h.color,"fill-opacity":h._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:S.toSVGPath()}},!0,!0);R(m=h,Be,vI).call(m,{highlightOutlines:S.getOutlines(),highlightId:I,clipPathId:C}),R(w=h,Be,Eg).call(w),h.rotate(h.parentRotation)}return h}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();let r=Zr._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i=super.serialize(e);return Object.assign(i,{color:r,opacity:this.opacity,thickness:l(this,jo),quadPoints:R(this,Be,pq).call(this),outlines:R(this,Be,gq).call(this,i.rect)}),this.addComment(i),this.annotationElementId&&!R(this,Be,bq).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}};Gv=new WeakMap,$x=new WeakMap,bh=new WeakMap,Cm=new WeakMap,Hx=new WeakMap,ia=new WeakMap,zx=new WeakMap,Wx=new WeakMap,Rm=new WeakMap,Ma=new WeakMap,Fa=new WeakMap,Hi=new WeakMap,Vv=new WeakMap,Xv=new WeakMap,fs=new WeakMap,qv=new WeakMap,jo=new WeakMap,Gx=new WeakMap,Be=new WeakSet,y3=function(){let e=new r2(l(this,bh),.001);x(this,Ma,e.getOutlines()),[this.x,this.y,this.width,this.height]=l(this,Ma).box;let r=new r2(l(this,bh),.0025,.001,this._uiManager.direction==="ltr");x(this,ia,r.getOutlines());let{firstPoint:i}=l(this,Ma);x(this,Vv,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]);let{lastPoint:s}=l(this,ia);x(this,Xv,[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height])},vI=function({highlightOutlines:e,highlightId:r,clipPathId:i}){var d,p;if(x(this,Ma,e),x(this,ia,e.getNewOutline(l(this,jo)/2+1.5,.0025)),r>=0)x(this,Fa,r),x(this,Cm,i),this.parent.drawLayer.finalizeDraw(r,{bbox:e.box,path:{d:e.toSVGPath()}}),x(this,fs,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:l(this,ia).box,path:{d:l(this,ia).toSVGPath()}},!0));else if(this.parent){let g=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(l(this,Fa),{bbox:R(d=hr,Wo,Sb).call(d,l(this,Ma).box,(g-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(l(this,fs),{bbox:R(p=hr,Wo,Sb).call(p,l(this,ia).box,g),path:{d:l(this,ia).toSVGPath()}})}let[a,o,c,u]=e.box;switch(this.rotation){case 0:this.x=a,this.y=o,this.width=c,this.height=u;break;case 90:{let[g,y]=this.parentDimensions;this.x=o,this.y=1-a,this.width=c*y/g,this.height=u*g/y;break}case 180:this.x=1-a,this.y=1-o,this.width=c,this.height=u;break;case 270:{let[g,y]=this.parentDimensions;this.x=1-o,this.y=a,this.width=c*y/g,this.height=u*g/y;break}}let{firstPoint:h}=e;x(this,Vv,[(h[0]-a)/c,(h[1]-o)/u]);let{lastPoint:f}=l(this,ia);x(this,Xv,[(f[0]-a)/c,(f[1]-o)/u])},uq=function(e){let r=(a,o)=>{this.color=a,this.opacity=o,this.onUpdatedColor()},i=this.color,s=this.opacity;this.addCommands({cmd:r.bind(this,e,hr._defaultOpacity),undo:r.bind(this,i,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Je.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(e)},!0)},hq=function(e){let r=l(this,jo),i=s=>{x(this,jo,s),R(this,Be,fq).call(this,s)};this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Je.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)},fq=function(e){l(this,Hi)&&(R(this,Be,vI).call(this,{highlightOutlines:l(this,Ma).getNewOutline(e/2)}),this.fixAndSetPosition(),this.setDims())},b3=function(){l(this,Fa)===null||!this.parent||(this.parent.drawLayer.remove(l(this,Fa)),x(this,Fa,null),this.parent.drawLayer.remove(l(this,fs)),x(this,fs,null))},Eg=function(e=this.parent){l(this,Fa)===null&&({id:ze(this,Fa)._,clipPathId:ze(this,Cm)._}=e.drawLayer.draw({bbox:l(this,Ma).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:l(this,Hi)},path:{d:l(this,Ma).toSVGPath()}},!1,!0),x(this,fs,e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:l(this,Hi)},bbox:l(this,ia).box,path:{d:l(this,ia).toSVGPath()}},l(this,Hi))),l(this,Rm)&&(l(this,Rm).style.clipPath=l(this,Cm)))},Wo=new WeakSet,Sb=function([e,r,i,s],a){switch(a){case 90:return[1-r-s,e,s,i];case 180:return[1-e-i,1-r-s,i,s];case 270:return[r,1-e-i,s,i]}return[e,r,i,s]},dq=function(e){hr._keyboardManager.exec(this,e)},wI=function(e){if(!l(this,Gv))return;let r=window.getSelection();e?r.setPosition(l(this,Gv),l(this,$x)):r.setPosition(l(this,zx),l(this,Wx))},AI=function(){return l(this,Hi)?this.rotation:0},pq=function(){if(l(this,Hi))return null;let[e,r]=this.pageDimensions,[i,s]=this.pageTranslation,a=l(this,bh),o=new Float32Array(a.length*8),c=0;for(let{x:u,y:h,width:f,height:d}of a){let p=u*e+i,g=(1-h)*r+s;o[c]=o[c+4]=p,o[c+1]=o[c+3]=g,o[c+2]=o[c+6]=p+f*e,o[c+5]=o[c+7]=g-d*r,c+=8}return o},gq=function(e){return l(this,Ma).serialize(e,R(this,Be,AI).call(this))},mq=function(e,r){this._freeHighlight.add(r)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},yq=function(e,r){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(r,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},bq=function(e){let{color:r}=this._initialData;return this.hasEditedComment||e.color.some((i,s)=>i!==r[s])},T(hr,Wo),Lt(hr,"_defaultColor",null),Lt(hr,"_defaultOpacity",1),Lt(hr,"_defaultThickness",12),Lt(hr,"_type","highlight"),Lt(hr,"_editorType",Re.HIGHLIGHT),Lt(hr,"_freeHighlightId",-1),Lt(hr,"_freeHighlight",null),Lt(hr,"_freeHighlightClipId","");aD=hr,oD=class{constructor(){T(this,Im,Object.create(null))}updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(let[e,r]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,r)}updateSVGProperty(t,e){l(this,Im)[t]=e}toSVGProperties(){let t=l(this,Im);return x(this,Im,Object.create(null)),{root:t}}reset(){x(this,Im,Object.create(null))}updateAll(t=this){this.updateProperties(t)}clone(){Wr("Not implemented")}};Im=new WeakMap;Ze=class Ze extends Zr{constructor(e){super(e);T(this,sr);T(this,Ba,null);T(this,Yv);Lt(this,"_colorPicker",null);Lt(this,"_drawId",null);x(this,Yv,e.mustBeCommitted||!1),this._addOutlines(e)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}_addOutlines(e){e.drawOutlines&&(R(this,sr,v3).call(this,e),R(this,sr,M1).call(this))}static _mergeSVGProperties(e,r){let i=new Set(Object.keys(e));for(let[s,a]of Object.entries(r))i.has(s)?Object.assign(e[s],a):e[s]=a;return e}static getDefaultDrawingOptions(e){Wr("Not implemented")}static get typesMap(){Wr("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(e,r){let i=this.typesMap.get(e);i&&this._defaultDrawingOptions.updateProperty(i,r),this._currentParent&&(l(Ze,_i).updateProperty(i,r),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,r){let i=this.constructor.typesMap.get(e);i&&this._updateProperty(e,i,r)}static get defaultPropertiesToUpdate(){let e=[],r=this._defaultDrawingOptions;for(let[i,s]of this.typesMap)e.push([i,r[s]]);return e}get propertiesToUpdate(){let e=[],{_drawingOptions:r}=this;for(let[i,s]of this.constructor.typesMap)e.push([i,r[s]]);return e}_updateProperty(e,r,i){let s=this._drawingOptions,a=s[r],o=c=>{s.updateProperty(r,c);let u=l(this,Ba).updateProperty(r,c);u&&R(this,sr,F1).call(this,u),this.parent?.drawLayer.updateProperties(this._drawId,s.toSVGProperties()),e===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:o.bind(this,i),undo:o.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,Ze._mergeSVGProperties(l(this,Ba).getPathResizingSVGProperties(R(this,sr,EI).call(this)),{bbox:R(this,sr,_b).call(this)}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,Ze._mergeSVGProperties(l(this,Ba).getPathResizedSVGProperties(R(this,sr,EI).call(this)),{bbox:R(this,sr,_b).call(this)}))}_onTranslating(e,r){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:R(this,sr,_b).call(this)})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,Ze._mergeSVGProperties(l(this,Ba).getPathTranslatedSVGProperties(R(this,sr,EI).call(this),this.parentDimensions),{bbox:R(this,sr,_b).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(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,l(this,Yv)&&(x(this,Yv,!1),this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){R(this,sr,A3).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(R(this,sr,M1).call(this),R(this,sr,F1).call(this,l(this,Ba).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let r=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),R(this,sr,A3).call(this)):e&&(this._uiManager.addShouldRescale(this),R(this,sr,M1).call(this,e),r=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),r&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Ze._mergeSVGProperties({bbox:R(this,sr,_b).call(this)},l(this,Ba).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&R(this,sr,F1).call(this,l(this,Ba).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e,r;this._isCopy&&(e=this.x,r=this.y);let i=super.render();i.classList.add("draw");let s=document.createElement("div");return i.append(s),s.setAttribute("aria-hidden","true"),s.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,r),i}static createDrawerInstance(e,r,i,s,a){Wr("Not implemented")}static startDrawing(e,r,i,s){let{target:a,offsetX:o,offsetY:c,pointerId:u,pointerType:h}=s;if(os.isInitializedAndDifferentPointerType(h))return;let{viewport:{rotation:f}}=e,{width:d,height:p}=a.getBoundingClientRect(),g=x(Ze,Dm,new AbortController),y=e.combinedSignal(g);if(os.setPointer(h,u),window.addEventListener("pointerup",b=>{os.isSamePointerIdOrRemove(b.pointerId)&&this._endDraw(b)},{signal:y}),window.addEventListener("pointercancel",b=>{os.isSamePointerIdOrRemove(b.pointerId)&&this._currentParent.endDrawingSession()},{signal:y}),window.addEventListener("pointerdown",b=>{os.isSamePointerType(b.pointerType)&&(os.initializeAndAddPointerId(b.pointerId),l(Ze,_i).isCancellable()&&(l(Ze,_i).removeLastElement(),l(Ze,_i).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:y}),window.addEventListener("contextmenu",Ga,{signal:y}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:y}),a.addEventListener("touchmove",b=>{os.isSameTimeStamp(b.timeStamp)&&mn(b)},{signal:y}),e.toggleDrawing(),r._editorUndoBar?.hide(),l(Ze,_i)){e.drawLayer.updateProperties(this._currentDrawId,l(Ze,_i).startNew(o,c,d,p,f));return}r.updateUIForDefaultProperties(this),x(Ze,_i,this.createDrawerInstance(o,c,d,p,f)),x(Ze,Om,this.getDefaultDrawingOptions()),this._currentParent=e,{id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(l(Ze,Om).toSVGProperties(),l(Ze,_i).defaultSVGProperties),!0,!1)}static _drawMove(e){if(os.isSameTimeStamp(e.timeStamp),!l(Ze,_i))return;let{offsetX:r,offsetY:i,pointerId:s}=e;if(os.isSamePointerId(s)){if(os.isUsingMultiplePointers()){this._endDraw(e);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,l(Ze,_i).add(r,i)),os.setTimeStamp(e.timeStamp),mn(e)}}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,x(Ze,_i,null),x(Ze,Om,null),os.clearTimeStamp()),l(Ze,Dm)&&(l(Ze,Dm).abort(),x(Ze,Dm,null),os.clearPointerIds())}static _endDraw(e){let r=this._currentParent;if(r){if(r.toggleDrawing(!0),this._cleanup(!1),e?.target===r.div&&r.drawLayer.updateProperties(this._currentDrawId,l(Ze,_i).end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){let i=l(Ze,_i),s=this._currentDrawId,a=i.getLastElement();r.addCommands({cmd:()=>{r.drawLayer.updateProperties(s,i.setLastElement(a))},undo:()=>{r.drawLayer.updateProperties(s,i.removeLastElement())},mustExec:!1,type:Je.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(e){let r=this._currentParent;if(!r)return null;if(r.toggleDrawing(!0),r.cleanUndoStack(Je.DRAW_STEP),!l(Ze,_i).isEmpty()){let{pageDimensions:[i,s],scale:a}=r,o=r.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:l(Ze,_i).getOutlines(i*a,s*a,a,this._INNER_MARGIN),drawingOptions:l(Ze,Om),mustBeCommitted:!e});return this._cleanup(!0),o}return r.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,r,i,s,a,o){Wr("Not implemented")}static async deserialize(e,r,i){var f,d;let{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:c}}=r.viewport,u=this.deserializeDraw(o,c,s,a,this._INNER_MARGIN,e),h=await super.deserialize(e,r,i);return h.createDrawingOptions(e),R(f=h,sr,v3).call(f,{drawOutlines:u}),R(d=h,sr,M1).call(d),h.onScaleChanging(),h.rotate(),h}serializeDraw(e){let[r,i]=this.pageTranslation,[s,a]=this.pageDimensions;return l(this,Ba).serialize([r,i,s,a],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}};Ba=new WeakMap,Yv=new WeakMap,_i=new WeakMap,Dm=new WeakMap,Om=new WeakMap,sr=new WeakSet,v3=function({drawOutlines:e,drawId:r,drawingOptions:i}){x(this,Ba,e),this._drawingOptions||(this._drawingOptions=i),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),r>=0?(this._drawId=r,this.parent.drawLayer.finalizeDraw(r,e.defaultProperties)):this._drawId=R(this,sr,w3).call(this,e,this.parent),R(this,sr,F1).call(this,e.box)},w3=function(e,r){let{id:i}=r.drawLayer.draw(Ze._mergeSVGProperties(this._drawingOptions.toSVGProperties(),e.defaultSVGProperties),!1,!1);return i},A3=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},M1=function(e=this.parent){if(!(this._drawId!==null&&this.parent===e)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,e.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=R(this,sr,w3).call(this,l(this,Ba),e)}},vq=function([e,r,i,s]){let{parentDimensions:[a,o],rotation:c}=this;switch(c){case 90:return[r,1-e,i*(o/a),s*(a/o)];case 180:return[1-e,1-r,i,s];case 270:return[1-r,e,i*(o/a),s*(a/o)];default:return[e,r,i,s]}},EI=function(){let{x:e,y:r,width:i,height:s,parentDimensions:[a,o],rotation:c}=this;switch(c){case 90:return[1-r,e,i*(a/o),s*(o/a)];case 180:return[1-e,1-r,i,s];case 270:return[r,1-e,i*(a/o),s*(o/a)];default:return[e,r,i,s]}},F1=function(e){[this.x,this.y,this.width,this.height]=R(this,sr,vq).call(this,e),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()},_b=function(){let{x:e,y:r,width:i,height:s,rotation:a,parentRotation:o,parentDimensions:[c,u]}=this;switch((a*4+o)/90){case 1:return[1-r-s,e,s,i];case 2:return[1-e-i,1-r-s,i,s];case 3:return[r,1-e-i,s,i];case 4:return[e,r-i*(c/u),s*(u/c),i*(c/u)];case 5:return[1-r,e,i*(c/u),s*(u/c)];case 6:return[1-e-s*(u/c),1-r,s*(u/c),i*(c/u)];case 7:return[r-i*(c/u),1-e-s*(u/c),i*(c/u),s*(u/c)];case 8:return[e-i,r-s,i,s];case 9:return[1-r,e-i,s,i];case 10:return[1-e,1-r,i,s];case 11:return[r-s,1-e,s,i];case 12:return[e-s*(u/c),r,s*(u/c),i*(c/u)];case 13:return[1-r-i*(c/u),e-s*(u/c),i*(c/u),s*(u/c)];case 14:return[1-e,1-r-i*(c/u),s*(u/c),i*(c/u)];case 15:return[r,1-e,i*(c/u),s*(u/c)];default:return[e,r,i,s]}},Lt(Ze,"_currentDrawId",-1),Lt(Ze,"_currentParent",null),T(Ze,_i,null),T(Ze,Dm,null),T(Ze,Om,null),Lt(Ze,"_INNER_MARGIN",3);lD=Ze,E3=class{constructor(t,e,r,i,s,a){T(this,Zv);T(this,Lc,new Float64Array(6));T(this,Ti);T(this,Ci);T(this,Pm);T(this,Kv);T(this,Rs);T(this,zi,"");T(this,$o,0);T(this,Nm,new Xm);T(this,Lm);T(this,km);x(this,Lm,r),x(this,km,i),x(this,Pm,s),x(this,Kv,a),[t,e]=R(this,Zv,xI).call(this,t,e);let o=x(this,Ti,[NaN,NaN,NaN,NaN,t,e]);x(this,Rs,[t,e]),x(this,Ci,[{line:o,points:l(this,Rs)}]),l(this,Lc).set(o,0)}updateProperty(t,e){t==="stroke-width"&&x(this,Kv,e)}isEmpty(){return!l(this,Ci)||l(this,Ci).length===0}isCancellable(){return l(this,Rs).length<=10}add(t,e){[t,e]=R(this,Zv,xI).call(this,t,e);let[r,i,s,a]=l(this,Lc).subarray(2,6),o=t-s,c=e-a;return Math.hypot(l(this,Lm)*o,l(this,km)*c)<=2?null:(l(this,Rs).push(t,e),isNaN(r)?(l(this,Lc).set([s,a,t,e],2),l(this,Ti).push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(l(this,Lc)[0])&&l(this,Ti).splice(6,6),l(this,Lc).set([r,i,s,a,t,e],0),l(this,Ti).push(...ce.createBezierPoints(r,i,s,a,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){let r=this.add(t,e);return r||(l(this,Rs).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,r,i,s){x(this,Lm,r),x(this,km,i),x(this,Pm,s),[t,e]=R(this,Zv,xI).call(this,t,e);let a=x(this,Ti,[NaN,NaN,NaN,NaN,t,e]);x(this,Rs,[t,e]);let o=l(this,Ci).at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),l(this,Ci).push({line:a,points:l(this,Rs)}),l(this,Lc).set(a,0),x(this,$o,0),this.toSVGPath(),null}getLastElement(){return l(this,Ci).at(-1)}setLastElement(t){return l(this,Ci)?(l(this,Ci).push(t),x(this,Ti,t.line),x(this,Rs,t.points),x(this,$o,0),{path:{d:this.toSVGPath()}}):l(this,Nm).setLastElement(t)}removeLastElement(){if(!l(this,Ci))return l(this,Nm).removeLastElement();l(this,Ci).pop(),x(this,zi,"");for(let t=0,e=l(this,Ci).length;t<e;t++){let{line:r,points:i}=l(this,Ci)[t];x(this,Ti,r),x(this,Rs,i),x(this,$o,0),this.toSVGPath()}return{path:{d:l(this,zi)}}}toSVGPath(){let t=ce.svgRound(l(this,Ti)[4]),e=ce.svgRound(l(this,Ti)[5]);if(l(this,Rs).length===2)return x(this,zi,`${l(this,zi)} M ${t} ${e} Z`),l(this,zi);if(l(this,Rs).length<=6){let i=l(this,zi).lastIndexOf("M");x(this,zi,`${l(this,zi).slice(0,i)} M ${t} ${e}`),x(this,$o,6)}if(l(this,Rs).length===4){let i=ce.svgRound(l(this,Ti)[10]),s=ce.svgRound(l(this,Ti)[11]);return x(this,zi,`${l(this,zi)} L ${i} ${s}`),x(this,$o,12),l(this,zi)}let r=[];l(this,$o)===0&&(r.push(`M ${t} ${e}`),x(this,$o,6));for(let i=l(this,$o),s=l(this,Ti).length;i<s;i+=6){let[a,o,c,u,h,f]=l(this,Ti).slice(i,i+6).map(ce.svgRound);r.push(`C${a} ${o} ${c} ${u} ${h} ${f}`)}return x(this,zi,l(this,zi)+r.join(" ")),x(this,$o,l(this,Ti).length),l(this,zi)}getOutlines(t,e,r,i){let s=l(this,Ci).at(-1);return s.line=new Float32Array(s.line),s.points=new Float32Array(s.points),l(this,Nm).build(l(this,Ci),t,e,r,l(this,Pm),l(this,Kv),i),x(this,Lc,null),x(this,Ti,null),x(this,Ci,null),x(this,zi,null),l(this,Nm)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}};Lc=new WeakMap,Ti=new WeakMap,Ci=new WeakMap,Pm=new WeakMap,Kv=new WeakMap,Rs=new WeakMap,zi=new WeakMap,$o=new WeakMap,Nm=new WeakMap,Lm=new WeakMap,km=new WeakMap,Zv=new WeakSet,xI=function(t,e){return ce._normalizePoint(t,e,l(this,Lm),l(this,km),l(this,Pm))};Xm=class extends ce{constructor(){super(...arguments);T(this,Gi);T(this,Is);T(this,Vx,0);T(this,Xx);T(this,Ua);T(this,kc);T(this,Mc);T(this,Jv);T(this,Qv);T(this,Mm)}build(e,r,i,s,a,o,c){x(this,kc,r),x(this,Mc,i),x(this,Jv,s),x(this,Qv,a),x(this,Mm,o),x(this,Xx,c??0),x(this,Ua,e),R(this,Gi,Aq).call(this)}get thickness(){return l(this,Mm)}setLastElement(e){return l(this,Ua).push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return l(this,Ua).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){let e=[];for(let{line:r}of l(this,Ua)){if(e.push(`M${ce.svgRound(r[4])} ${ce.svgRound(r[5])}`),r.length===6){e.push("Z");continue}if(r.length===12&&isNaN(r[6])){e.push(`L${ce.svgRound(r[10])} ${ce.svgRound(r[11])}`);continue}for(let i=6,s=r.length;i<s;i+=6){let[a,o,c,u,h,f]=r.subarray(i,i+6).map(ce.svgRound);e.push(`C${a} ${o} ${c} ${u} ${h} ${f}`)}}return e.join("")}serialize([e,r,i,s],a){let o=[],c=[],[u,h,f,d]=R(this,Gi,wq).call(this),p,g,y,b,m,w,A,_,S;switch(l(this,Qv)){case 0:S=ce._rescale,p=e,g=r+s,y=i,b=-s,m=e+u*i,w=r+(1-h-d)*s,A=e+(u+f)*i,_=r+(1-h)*s;break;case 90:S=ce._rescaleAndSwap,p=e,g=r,y=i,b=s,m=e+h*i,w=r+u*s,A=e+(h+d)*i,_=r+(u+f)*s;break;case 180:S=ce._rescale,p=e+i,g=r,y=-i,b=s,m=e+(1-u-f)*i,w=r+h*s,A=e+(1-u)*i,_=r+(h+d)*s;break;case 270:S=ce._rescaleAndSwap,p=e+i,g=r+s,y=-i,b=-s,m=e+(1-h-d)*i,w=r+(1-u-f)*s,A=e+(1-h)*i,_=r+(1-u)*s;break}for(let{line:I,points:C}of l(this,Ua))o.push(S(I,p,g,y,b,a?new Array(I.length):null)),c.push(S(C,p,g,y,b,a?new Array(C.length):null));return{lines:o,points:c,rect:[m,w,A,_]}}static deserialize(e,r,i,s,a,{paths:{lines:o,points:c},rotation:u,thickness:h}){let f=[],d,p,g,y,b;switch(u){case 0:b=ce._rescale,d=-e/i,p=r/s+1,g=1/i,y=-1/s;break;case 90:b=ce._rescaleAndSwap,d=-r/s,p=-e/i,g=1/s,y=1/i;break;case 180:b=ce._rescale,d=e/i+1,p=-r/s,g=-1/i,y=1/s;break;case 270:b=ce._rescaleAndSwap,d=r/s+1,p=e/i+1,g=-1/s,y=-1/i;break}if(!o){o=[];for(let w of c){let A=w.length;if(A===2){o.push(new Float32Array([NaN,NaN,NaN,NaN,w[0],w[1]]));continue}if(A===4){o.push(new Float32Array([NaN,NaN,NaN,NaN,w[0],w[1],NaN,NaN,NaN,NaN,w[2],w[3]]));continue}let _=new Float32Array(3*(A-2));o.push(_);let[S,I,C,M]=w.subarray(0,4);_.set([NaN,NaN,NaN,NaN,S,I],0);for(let z=4;z<A;z+=2){let G=w[z],Y=w[z+1];_.set(ce.createBezierPoints(S,I,C,M,G,Y),(z-2)*3),[S,I,C,M]=[C,M,G,Y]}}}for(let w=0,A=o.length;w<A;w++)f.push({line:b(o[w].map(_=>_??NaN),d,p,g,y),points:b(c[w].map(_=>_??NaN),d,p,g,y)});let m=new this.prototype.constructor;return m.build(f,i,s,1,u,h,a),m}get box(){return l(this,Is)}updateProperty(e,r){return e==="stroke-width"?R(this,Gi,Eq).call(this,r):null}updateParentDimensions([e,r],i){let[s,a]=R(this,Gi,$u).call(this);x(this,kc,e),x(this,Mc,r),x(this,Jv,i);let[o,c]=R(this,Gi,$u).call(this),u=o-s,h=c-a,f=l(this,Is);return f[0]-=u,f[1]-=h,f[2]+=2*u,f[3]+=2*h,f}updateRotation(e){return x(this,Vx,e),{path:{transform:this.rotationTransform}}}get viewBox(){return l(this,Is).map(ce.svgRound).join(" ")}get defaultProperties(){let[e,r]=l(this,Is);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ce.svgRound(e)} ${ce.svgRound(r)}`}}}get rotationTransform(){let[,,e,r]=l(this,Is),i=0,s=0,a=0,o=0,c=0,u=0;switch(l(this,Vx)){case 90:s=r/e,a=-e/r,c=e;break;case 180:i=-1,o=-1,c=e,u=r;break;case 270:s=-r/e,a=e/r,u=r;break;default:return""}return`matrix(${i} ${s} ${a} ${o} ${ce.svgRound(c)} ${ce.svgRound(u)})`}getPathResizingSVGProperties([e,r,i,s]){let[a,o]=R(this,Gi,$u).call(this),[c,u,h,f]=l(this,Is);if(Math.abs(h-a)<=ce.PRECISION||Math.abs(f-o)<=ce.PRECISION){let b=e+i/2-(c+h/2),m=r+s/2-(u+f/2);return{path:{"transform-origin":`${ce.svgRound(e)} ${ce.svgRound(r)}`,transform:`${this.rotationTransform} translate(${b} ${m})`}}}let d=(i-2*a)/(h-2*a),p=(s-2*o)/(f-2*o),g=h/i,y=f/s;return{path:{"transform-origin":`${ce.svgRound(c)} ${ce.svgRound(u)}`,transform:`${this.rotationTransform} scale(${g} ${y}) translate(${ce.svgRound(a)} ${ce.svgRound(o)}) scale(${d} ${p}) translate(${ce.svgRound(-a)} ${ce.svgRound(-o)})`}}}getPathResizedSVGProperties([e,r,i,s]){let[a,o]=R(this,Gi,$u).call(this),c=l(this,Is),[u,h,f,d]=c;if(c[0]=e,c[1]=r,c[2]=i,c[3]=s,Math.abs(f-a)<=ce.PRECISION||Math.abs(d-o)<=ce.PRECISION){let m=e+i/2-(u+f/2),w=r+s/2-(h+d/2);for(let{line:A,points:_}of l(this,Ua))ce._translate(A,m,w,A),ce._translate(_,m,w,_);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ce.svgRound(e)} ${ce.svgRound(r)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}let p=(i-2*a)/(f-2*a),g=(s-2*o)/(d-2*o),y=-p*(u+a)+e+a,b=-g*(h+o)+r+o;if(p!==1||g!==1||y!==0||b!==0)for(let{line:m,points:w}of l(this,Ua))ce._rescale(m,y,b,p,g,m),ce._rescale(w,y,b,p,g,w);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ce.svgRound(e)} ${ce.svgRound(r)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,r],i){let[s,a]=i,o=l(this,Is),c=e-o[0],u=r-o[1];if(l(this,kc)===s&&l(this,Mc)===a)for(let{line:h,points:f}of l(this,Ua))ce._translate(h,c,u,h),ce._translate(f,c,u,f);else{let h=l(this,kc)/s,f=l(this,Mc)/a;x(this,kc,s),x(this,Mc,a);for(let{line:d,points:p}of l(this,Ua))ce._rescale(d,c,u,h,f,d),ce._rescale(p,c,u,h,f,p);o[2]*=h,o[3]*=f}return o[0]=e,o[1]=r,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${ce.svgRound(e)} ${ce.svgRound(r)}`}}}get defaultSVGProperties(){let e=l(this,Is);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${ce.svgRound(e[0])} ${ce.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}};Is=new WeakMap,Vx=new WeakMap,Xx=new WeakMap,Ua=new WeakMap,kc=new WeakMap,Mc=new WeakMap,Jv=new WeakMap,Qv=new WeakMap,Mm=new WeakMap,Gi=new WeakSet,$u=function(e=l(this,Mm)){let r=l(this,Xx)+e/2*l(this,Jv);return l(this,Qv)%180===0?[r/l(this,kc),r/l(this,Mc)]:[r/l(this,Mc),r/l(this,kc)]},wq=function(){let[e,r,i,s]=l(this,Is),[a,o]=R(this,Gi,$u).call(this,0);return[e+a,r+o,i-2*a,s-2*o]},Aq=function(){let e=x(this,Is,new Float32Array([1/0,1/0,-1/0,-1/0]));for(let{line:s}of l(this,Ua)){if(s.length<=12){for(let c=4,u=s.length;c<u;c+=6)ie.pointBoundingBox(s[c],s[c+1],e);continue}let a=s[4],o=s[5];for(let c=6,u=s.length;c<u;c+=6){let[h,f,d,p,g,y]=s.subarray(c,c+6);ie.bezierBoundingBox(a,o,h,f,d,p,g,y,e),a=g,o=y}}let[r,i]=R(this,Gi,$u).call(this);e[0]=ds(e[0]-r,0,1),e[1]=ds(e[1]-i,0,1),e[2]=ds(e[2]+r,0,1),e[3]=ds(e[3]+i,0,1),e[2]-=e[0],e[3]-=e[1]},Eq=function(e){let[r,i]=R(this,Gi,$u).call(this);x(this,Mm,e);let[s,a]=R(this,Gi,$u).call(this),[o,c]=[s-r,a-i],u=l(this,Is);return u[0]-=o,u[1]-=c,u[2]+=2*o,u[3]+=2*c,u};cD=class n extends oD{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:Zr._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,e){t==="stroke-width"&&(e??(e=this["stroke-width"]),e*=this._viewParameters.realScale),super.updateSVGProperty(t,e)}clone(){let t=new n(this._viewParameters);return t.updateAll(this),t}},Pb=class Pb extends lD{constructor(e){super({...e,name:"inkEditor"});T(this,ID);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(e,r){Zr.initialize(e,r),this._defaultDrawingOptions=new cD(r.viewParameters)}static getDefaultDrawingOptions(e){let r=this._defaultDrawingOptions.clone();return r.updateProperties(e),r}static get supportMultipleDrawings(){return!0}static get typesMap(){return Te(this,"typesMap",new Map([[Je.INK_THICKNESS,"stroke-width"],[Je.INK_COLOR,"stroke"],[Je.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,r,i,s,a){return new E3(e,r,i,s,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,r,i,s,a,o){return Xm.deserialize(e,r,i,s,a,o)}static async deserialize(e,r,i){let s=null;if(e instanceof e2){let{data:{inkLists:o,rect:c,rotation:u,id:h,color:f,opacity:d,borderStyle:{rawWidth:p},popupRef:g,richText:y,contentsObj:b,creationDate:m,modificationDate:w},parent:{page:{pageNumber:A}}}=e;s=e={annotationType:Re.INK,color:Array.from(f),thickness:p,opacity:d,paths:{points:o},boxes:null,pageIndex:A-1,rect:c.slice(0),rotation:u,annotationElementId:h,id:h,deleted:!1,popupRef:g,richText:y,comment:b?.str||null,creationDate:m,modificationDate:w}}let a=await super.deserialize(e,r,i);return a._initialData=s,e.comment&&a.setCommentData(e),a}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new KI(this)),[["colorPicker",this._colorPicker]]}get colorType(){return Je.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();let{_drawId:e,_drawingOptions:r,parent:i}=this;r.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(e,r.toSVGProperties())}static onScaleChangingWhenDrawing(){let e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:r,opacity:i}){this._drawingOptions=Pb.getDefaultDrawingOptions({stroke:ie.makeHexColor(...e),"stroke-width":r,"stroke-opacity":i})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let{lines:r,points:i}=this.serializeDraw(e),{_drawingOptions:{stroke:s,"stroke-opacity":a,"stroke-width":o}}=this,c=Object.assign(super.serialize(e),{color:Zr._colorManager.convert(s),opacity:a,thickness:o,paths:{lines:r,points:i}});return this.addComment(c),e?(c.isCopy=!0,c):this.annotationElementId&&!R(this,ID,xq).call(this,c)?null:(c.id=this.annotationElementId,c)}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let{points:r,rect:i}=this.serializeDraw(!1);return e.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:r,popup:this.comment}),null}};ID=new WeakSet,xq=function(e){let{color:r,thickness:i,opacity:s,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((o,c)=>o!==r[c])||e.thickness!==i||e.opacity!==s||e.pageIndex!==a},Lt(Pb,"_type","ink"),Lt(Pb,"_editorType",Re.INK),Lt(Pb,"_defaultDrawingOptions",null);x3=Pb,i2=class extends Xm{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}},YR=8,v1=3,zo=class{static extractContoursFromText(t,{fontFamily:e,fontStyle:r,fontWeight:i},s,a,o,c){let u=new OffscreenCanvas(1,1),h=u.getContext("2d",{alpha:!1}),f=200,d=h.font=`${r} ${i} ${f}px ${e}`,{actualBoundingBoxLeft:p,actualBoundingBoxRight:g,actualBoundingBoxAscent:y,actualBoundingBoxDescent:b,fontBoundingBoxAscent:m,fontBoundingBoxDescent:w,width:A}=h.measureText(t),_=1.5,S=Math.ceil(Math.max(Math.abs(p)+Math.abs(g)||0,A)*_),I=Math.ceil(Math.max(Math.abs(y)+Math.abs(b)||f,Math.abs(m)+Math.abs(w)||f)*_);u=new OffscreenCanvas(S,I),h=u.getContext("2d",{alpha:!0,willReadFrequently:!0}),h.font=d,h.filter="grayscale(1)",h.fillStyle="white",h.fillRect(0,0,S,I),h.fillStyle="black",h.fillText(t,S*(_-1)/2,I*(3-_)/2);let C=R(this,gr,T3).call(this,h.getImageData(0,0,S,I).data),M=R(this,gr,Rq).call(this,C),z=R(this,gr,C3).call(this,M),G=R(this,gr,_3).call(this,C,S,I,z);return this.processDrawnLines({lines:{curves:G,width:S,height:I},pageWidth:s,pageHeight:a,rotation:o,innerMargin:c,mustSmooth:!0,areContours:!0})}static process(t,e,r,i,s){let[a,o,c]=R(this,gr,Iq).call(this,t),[u,h]=R(this,gr,Cq).call(this,a,o,c,Math.hypot(o,c)*l(this,Fm).sigmaSFactor,l(this,Fm).sigmaR,l(this,Fm).kernelSize),f=R(this,gr,C3).call(this,h),d=R(this,gr,_3).call(this,u,o,c,f);return this.processDrawnLines({lines:{curves:d,width:o,height:c},pageWidth:e,pageHeight:r,rotation:i,innerMargin:s,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:e,pageHeight:r,rotation:i,innerMargin:s,mustSmooth:a,areContours:o}){i%180!==0&&([e,r]=[r,e]);let{curves:c,width:u,height:h}=t,f=t.thickness??0,d=[],p=Math.min(e/u,r/h),g=p/e,y=p/r,b=[];for(let{points:w}of c){let A=a?R(this,gr,Tq).call(this,w):w;if(!A)continue;b.push(A);let _=A.length,S=new Float32Array(_),I=new Float32Array(3*(_===2?2:_-2));if(d.push({line:I,points:S}),_===2){S[0]=A[0]*g,S[1]=A[1]*y,I.set([NaN,NaN,NaN,NaN,S[0],S[1]],0);continue}let[C,M,z,G]=A;C*=g,M*=y,z*=g,G*=y,S.set([C,M,z,G],0),I.set([NaN,NaN,NaN,NaN,C,M],0);for(let Y=4;Y<_;Y+=2){let L=S[Y]=A[Y]*g,j=S[Y+1]=A[Y+1]*y;I.set(ce.createBezierPoints(C,M,z,G,L,j),(Y-2)*3),[C,M,z,G]=[z,G,L,j]}}if(d.length===0)return null;let m=o?new i2:new Xm;return m.build(d,e,r,1,i,o?0:f,s),{outline:m,newCurves:b,areContours:o,thickness:f,width:u,height:h}}static async compressSignature({outlines:t,areContours:e,thickness:r,width:i,height:s}){let a=1/0,o=-1/0,c=0;for(let A of t){c+=A.length;for(let _=2,S=A.length;_<S;_++){let I=A[_]-A[_-2];a=Math.min(a,I),o=Math.max(o,I)}}let u;a>=-128&&o<=127?u=Int8Array:a>=-32768&&o<=32767?u=Int16Array:u=Int32Array;let h=t.length,f=YR+v1*h,d=new Uint32Array(f),p=0;d[p++]=f*Uint32Array.BYTES_PER_ELEMENT+(c-2*h)*u.BYTES_PER_ELEMENT,d[p++]=0,d[p++]=i,d[p++]=s,d[p++]=e?0:1,d[p++]=Math.max(0,Math.floor(r??0)),d[p++]=h,d[p++]=u.BYTES_PER_ELEMENT;for(let A of t)d[p++]=A.length-2,d[p++]=A[0],d[p++]=A[1];let g=new CompressionStream("deflate-raw"),y=g.writable.getWriter();await y.ready,y.write(d);let b=u.prototype.constructor;for(let A of t){let _=new b(A.length-2);for(let S=2,I=A.length;S<I;S++)_[S-2]=A[S]-A[S-2];y.write(_)}y.close();let m=await new Response(g.readable).arrayBuffer(),w=new Uint8Array(m);return FV(w)}static async decompressSignature(t){try{let e=Lht(t),{readable:r,writable:i}=new DecompressionStream("deflate-raw"),s=i.getWriter();await s.ready,s.write(e).then(async()=>{await s.ready,await s.close()}).catch(()=>{});let a=null,o=0;for await(let A of r)a||(a=new Uint8Array(new Uint32Array(A.buffer,0,4)[0])),a.set(A,o),o+=A.length;let c=new Uint32Array(a.buffer,0,a.length>>2),u=c[1];if(u!==0)throw new Error(`Invalid version: ${u}`);let h=c[2],f=c[3],d=c[4]===0,p=c[5],g=c[6],y=c[7],b=[],m=(YR+v1*g)*Uint32Array.BYTES_PER_ELEMENT,w;switch(y){case Int8Array.BYTES_PER_ELEMENT:w=new Int8Array(a.buffer,m);break;case Int16Array.BYTES_PER_ELEMENT:w=new Int16Array(a.buffer,m);break;case Int32Array.BYTES_PER_ELEMENT:w=new Int32Array(a.buffer,m);break}o=0;for(let A=0;A<g;A++){let _=c[v1*A+YR],S=new Float32Array(_+2);b.push(S);for(let I=0;I<v1-1;I++)S[I]=c[v1*A+YR+I+1];for(let I=0;I<_;I++)S[I+2]=S[I]+w[o++]}return{areContours:d,thickness:p,outlines:b,width:h,height:f}}catch(e){return _e(`decompressSignature: ${e}`),null}}};Fm=new WeakMap,gr=new WeakSet,S3=function(t,e,r,i){return r-=t,i-=e,r===0?i>0?0:4:r===1?i+6:2-i},Il=new WeakMap,Sq=function(t,e,r,i,s,a,o){let c=R(this,gr,S3).call(this,r,i,s,a);for(let u=0;u<8;u++){let h=(-u+c-o+16)%8,f=l(this,Il)[2*h],d=l(this,Il)[2*h+1];if(t[(r+f)*e+(i+d)]!==0)return h}return-1},_q=function(t,e,r,i,s,a,o){let c=R(this,gr,S3).call(this,r,i,s,a);for(let u=0;u<8;u++){let h=(u+c+o+16)%8,f=l(this,Il)[2*h],d=l(this,Il)[2*h+1];if(t[(r+f)*e+(i+d)]!==0)return h}return-1},_3=function(t,e,r,i){let s=t.length,a=new Int32Array(s);for(let h=0;h<s;h++)a[h]=t[h]<=i?1:0;for(let h=1;h<r-1;h++)a[h*e]=a[h*e+e-1]=0;for(let h=0;h<e;h++)a[h]=a[e*r-1-h]=0;let o=1,c,u=[];for(let h=1;h<r-1;h++){c=1;for(let f=1;f<e-1;f++){let d=h*e+f,p=a[d];if(p===0)continue;let g=h,y=f;if(p===1&&a[d-1]===0)o+=1,y-=1;else if(p>=1&&a[d+1]===0)o+=1,y+=1,p>1&&(c=p);else{p!==1&&(c=Math.abs(p));continue}let b=[f,h],m=y===f+1,w={isHole:m,points:b,id:o,parent:0};u.push(w);let A;for(let Y of u)if(Y.id===c){A=Y;break}A?A.isHole?w.parent=m?A.parent:c:w.parent=m?c:A.parent:w.parent=m?c:0;let _=R(this,gr,Sq).call(this,a,e,h,f,g,y,0);if(_===-1){a[d]=-o,a[d]!==1&&(c=Math.abs(a[d]));continue}let S=l(this,Il)[2*_],I=l(this,Il)[2*_+1],C=h+S,M=f+I;g=C,y=M;let z=h,G=f;for(;;){let Y=R(this,gr,_q).call(this,a,e,z,G,g,y,1);S=l(this,Il)[2*Y],I=l(this,Il)[2*Y+1];let L=z+S,j=G+I;b.push(j,L);let q=z*e+G;if(a[q+1]===0?a[q]=-o:a[q]===1&&(a[q]=o),L===h&&j===f&&z===C&&G===M){a[d]!==1&&(c=Math.abs(a[d]));break}else g=z,y=G,z=L,G=j}}}return u},SI=function(t,e,r,i){if(r-e<=4){for(let C=e;C<r-2;C+=2)i.push(t[C],t[C+1]);return}let s=t[e],a=t[e+1],o=t[r-4]-s,c=t[r-3]-a,u=Math.hypot(o,c),h=o/u,f=c/u,d=h*a-f*s,p=c/o,g=1/u,y=Math.atan(p),b=Math.cos(y),m=Math.sin(y),w=g*(Math.abs(b)+Math.abs(m)),A=g*(1-w+w**2),_=Math.max(Math.atan(Math.abs(m+b)*A),Math.atan(Math.abs(m-b)*A)),S=0,I=e;for(let C=e+2;C<r-2;C+=2){let M=Math.abs(d-h*t[C+1]+f*t[C]);M>S&&(I=C,S=M)}S>(u*_)**2?(R(this,gr,SI).call(this,t,e,I+2,i),R(this,gr,SI).call(this,t,I,r,i)):i.push(s,a)},Tq=function(t){let e=[],r=t.length;return R(this,gr,SI).call(this,t,0,r,e),e.push(t[r-2],t[r-1]),e.length<=4?null:e},Cq=function(t,e,r,i,s,a){let o=new Float32Array(a**2),c=-2*i**2,u=a>>1;for(let y=0;y<a;y++){let b=(y-u)**2;for(let m=0;m<a;m++)o[y*a+m]=Math.exp((b+(m-u)**2)/c)}let h=new Float32Array(256),f=-2*s**2;for(let y=0;y<256;y++)h[y]=Math.exp(y**2/f);let d=t.length,p=new Uint8Array(d),g=new Uint32Array(256);for(let y=0;y<r;y++)for(let b=0;b<e;b++){let m=y*e+b,w=t[m],A=0,_=0;for(let I=0;I<a;I++){let C=y+I-u;if(!(C<0||C>=r))for(let M=0;M<a;M++){let z=b+M-u;if(z<0||z>=e)continue;let G=t[C*e+z],Y=o[I*a+M]*h[Math.abs(G-w)];A+=G*Y,_+=Y}}let S=p[m]=Math.round(A/_);g[S]++}return[p,g]},Rq=function(t){let e=new Uint32Array(256);for(let r of t)e[r]++;return e},T3=function(t){let e=t.length,r=new Uint8ClampedArray(e>>2),i=-1/0,s=1/0;for(let o=0,c=r.length;o<c;o++){let u=r[o]=t[o<<2];i=Math.max(i,u),s=Math.min(s,u)}let a=255/(i-s);for(let o=0,c=r.length;o<c;o++)r[o]=(r[o]-s)*a;return r},C3=function(t){let e,r=-1/0,i=-1/0,s=t.findIndex(c=>c!==0),a=s,o=s;for(e=s;e<256;e++){let c=t[e];c>r&&(e-a>i&&(i=e-a,o=e-1),r=c,a=e)}for(e=o-1;e>=0&&!(t[e]>t[e+1]);e--);return e},Iq=function(t){let e=t,{width:r,height:i}=t,{maxDim:s}=l(this,Fm),a=r,o=i;if(r>s||i>s){let d=r,p=i,g=Math.log2(Math.max(r,i)/s),y=Math.floor(g);g=g===y?y-1:y;for(let m=0;m<g;m++){a=Math.ceil(d/2),o=Math.ceil(p/2);let w=new OffscreenCanvas(a,o);w.getContext("2d").drawImage(t,0,0,d,p,0,0,a,o),d=a,p=o,t!==e&&t.close(),t=w.transferToImageBitmap()}let b=Math.min(s/a,s/o);a=Math.round(a*b),o=Math.round(o*b)}let u=new OffscreenCanvas(a,o).getContext("2d",{willReadFrequently:!0});u.fillStyle="white",u.fillRect(0,0,a,o),u.filter="grayscale(1)",u.drawImage(t,0,0,t.width,t.height,0,0,a,o);let h=u.getImageData(0,0,a,o).data;return[R(this,gr,T3).call(this,h),a,o]},T(zo,gr),T(zo,Fm,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),T(zo,Il,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));R3=class n extends oD{constructor(){super(),super.updateProperties({fill:Zr._defaultLineColor,"stroke-width":0})}clone(){let t=new n;return t.updateAll(this),t}},I3=class n extends cD{constructor(t){super(t),super.updateProperties({stroke:Zr._defaultLineColor,"stroke-width":1})}clone(){let t=new n(this._viewParameters);return t.updateAll(this),t}},Aa=class Aa extends lD{constructor(e){super({...e,mustBeCommitted:!0,name:"signatureEditor"});T(this,Od,!1);T(this,Fc,null);T(this,Pd,null);T(this,Bm,null);this._willKeepAspectRatio=!0,x(this,Pd,e.signatureData||null),x(this,Fc,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(e,r){Zr.initialize(e,r),this._defaultDrawingOptions=new R3,this._defaultDrawnSignatureOptions=new I3(r.viewParameters)}static getDefaultDrawingOptions(e){let r=this._defaultDrawingOptions.clone();return r.updateProperties(e),r}static get supportMultipleDrawings(){return!1}static get typesMap(){return Te(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!l(this,Fc)}}static computeTelemetryFinalData(e){let r=e.get("hasDescription");return{hasAltText:r.get(!0)??0,hasNoAltText:r.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let e,r,{_isCopy:i}=this;if(i&&(this._isCopy=!1,e=this.x,r=this.y),super.render(),this._drawId===null)if(l(this,Pd)){let{lines:s,mustSmooth:a,areContours:o,description:c,uuid:u,heightInPage:h}=l(this,Pd),{rawDims:{pageWidth:f,pageHeight:d},rotation:p}=this.parent.viewport,g=zo.processDrawnLines({lines:s,pageWidth:f,pageHeight:d,rotation:p,innerMargin:Aa._INNER_MARGIN,mustSmooth:a,areContours:o});this.addSignature(g,h,c,u)}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,Fc)||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(e,r)),this.div}setUuid(e){x(this,Bm,e),this.addEditToolbar()}getUuid(){return l(this,Bm)}get description(){return l(this,Fc)}set description(e){x(this,Fc,e),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:e})),super.addEditToolbar().then(r=>{r?.updateEditSignatureButton(e)}))}getSignaturePreview(){let{newCurves:e,areContours:r,thickness:i,width:s,height:a}=l(this,Pd),o=Math.max(s,a),c=zo.processDrawnLines({lines:{curves:e.map(u=>({points:u})),thickness:i,width:s,height:a},pageWidth:o,pageHeight:o,rotation:0,innerMargin:0,mustSmooth:!1,areContours:r});return{areContours:r,outline:c.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(e,r,i,s){let{x:a,y:o}=this,{outline:c}=x(this,Pd,e);x(this,Od,c instanceof i2),this.description=i;let u;l(this,Od)?u=Aa.getDefaultDrawingOptions():(u=Aa._defaultDrawnSignatureOptions.clone(),u.updateProperties({"stroke-width":c.thickness})),this._addOutlines({drawOutlines:c,drawingOptions:u});let[,h]=this.pageDimensions,f=r/h;f=f>=1?.5:f,this.width*=f/this.height,this.width>=1&&(f*=.9/this.width,this.width=.9),this.height=f,this.setDims(),this.x=a,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(s),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!s,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(e){let{rawDims:{pageWidth:r,pageHeight:i},rotation:s}=this.parent.viewport;return zo.process(e,r,i,s,Aa._INNER_MARGIN)}getFromText(e,r){let{rawDims:{pageWidth:i,pageHeight:s},rotation:a}=this.parent.viewport;return zo.extractContoursFromText(e,r,i,s,a,Aa._INNER_MARGIN)}getDrawnSignature(e){let{rawDims:{pageWidth:r,pageHeight:i},rotation:s}=this.parent.viewport;return zo.processDrawnLines({lines:e,pageWidth:r,pageHeight:i,rotation:s,innerMargin:Aa._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:e,thickness:r}){e?this._drawingOptions=Aa.getDefaultDrawingOptions():(this._drawingOptions=Aa._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":r}))}serialize(e=!1){if(this.isEmpty())return null;let{lines:r,points:i}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":s}}=this,a=Object.assign(super.serialize(e),{isSignature:!0,areContours:l(this,Od),color:[0,0,0],thickness:l(this,Od)?0:s});return this.addComment(a),e?(a.paths={lines:r,points:i},a.uuid=l(this,Bm),a.isCopy=!0):a.lines=r,l(this,Fc)&&(a.accessibilityData={type:"Figure",alt:l(this,Fc)}),a}static deserializeDraw(e,r,i,s,a,o){return o.areContours?i2.deserialize(e,r,i,s,a,o):Xm.deserialize(e,r,i,s,a,o)}static async deserialize(e,r,i){let s=await super.deserialize(e,r,i);return x(s,Od,e.areContours),s.description=e.accessibilityData?.alt||"",x(s,Bm,e.uuid),s}};Od=new WeakMap,Fc=new WeakMap,Pd=new WeakMap,Bm=new WeakMap,Lt(Aa,"_type","signature"),Lt(Aa,"_editorType",Re.SIGNATURE),Lt(Aa,"_defaultDrawingOptions",null);D3=Aa,B1=class extends Zr{constructor(e){super({...e,name:"stampEditor"});T(this,ar);T(this,cn,null);T(this,Ri,null);T(this,Nd,null);T(this,vh,null);T(this,Ld,null);T(this,tw,"");T(this,wh,null);T(this,Um,!1);T(this,Bc,null);T(this,ja,!1);T(this,ew,!1);x(this,vh,e.bitmapUrl),x(this,Ld,e.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(e,r){Zr.initialize(e,r)}static isHandlingMimeForPasting(e){return PI.includes(e)}static paste(e,r){r.pasteEditor({mode:Re.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){let r=e.get("hasAltText");return{hasAltText:r.get(!0)??0,hasNoAltText:r.get(!1)??0}}async mlGuessAltText(e=null,r=!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:s,width:a,height:o}=e||this.copyCanvas(null,null,!0).imageData,c=await i.guess({name:"altText",request:{data:s,width:a,height:o,channels:s.length/(a*o)}});if(!c)throw new Error("No response from the AI service.");if(c.error)throw new Error("Error from the AI service.");if(c.cancel)return null;if(!c.output)throw new Error("No valid response from the AI service.");let u=c.output;return await this.setGuessedAltText(u),r&&!this.hasAltTextData()&&(this.altTextData={alt:u,decorative:!1}),u}remove(){l(this,Ri)&&(x(this,cn,null),this._uiManager.imageManager.deleteId(l(this,Ri)),l(this,wh)?.remove(),x(this,wh,null),l(this,Bc)&&(clearTimeout(l(this,Bc)),x(this,Bc,null))),super.remove()}rebuild(){if(!this.parent){l(this,Ri)&&R(this,ar,_I).call(this);return}super.rebuild(),this.div!==null&&(l(this,Ri)&&l(this,wh)===null&&R(this,ar,_I).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(l(this,Nd)||l(this,cn)||l(this,vh)||l(this,Ld)||l(this,Ri)||l(this,Um))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,r;return this._isCopy&&(e=this.x,r=this.y),super.render(),this.div.hidden=!0,this.createAltText(),l(this,Um)||(l(this,cn)?R(this,ar,TI).call(this):R(this,ar,_I).call(this)),this._isCopy&&this._moveAfterPaste(e,r),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,r){let{id:i,bitmap:s}=this._uiManager.imageManager.getFromCanvas(e,r);r.remove(),i&&this._uiManager.imageManager.isValidId(i)&&(x(this,Ri,i),s&&x(this,cn,s),x(this,Um,!1),R(this,ar,TI).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;l(this,Bc)!==null&&clearTimeout(l(this,Bc)),x(this,Bc,setTimeout(()=>{x(this,Bc,null),R(this,ar,O3).call(this)},200))}copyCanvas(e,r,i=!1){e||(e=224);let{width:s,height:a}=l(this,cn),o=new Uc,c=l(this,cn),u=s,h=a,f=null;if(r){if(s>r||a>r){let C=Math.min(r/s,r/a);u=Math.floor(s*C),h=Math.floor(a*C)}f=document.createElement("canvas");let p=f.width=Math.ceil(u*o.sx),g=f.height=Math.ceil(h*o.sy);l(this,ja)||(c=R(this,ar,CI).call(this,p,g));let y=f.getContext("2d");y.filter=this._uiManager.hcmFilter;let b="white",m="#cfcfd8";this._uiManager.hcmFilter!=="none"?m="black":hF.isDarkMode&&(b="#8f8f9d",m="#42414d");let w=15,A=w*o.sx,_=w*o.sy,S=new OffscreenCanvas(A*2,_*2),I=S.getContext("2d");I.fillStyle=b,I.fillRect(0,0,A*2,_*2),I.fillStyle=m,I.fillRect(0,0,A,_),I.fillRect(A,_,A,_),y.fillStyle=y.createPattern(S,"repeat"),y.fillRect(0,0,p,g),y.drawImage(c,0,0,c.width,c.height,0,0,p,g)}let d=null;if(i){let p,g;if(o.symmetric&&c.width<e&&c.height<e)p=c.width,g=c.height;else if(c=l(this,cn),s>e||a>e){let m=Math.min(e/s,e/a);p=Math.floor(s*m),g=Math.floor(a*m),l(this,ja)||(c=R(this,ar,CI).call(this,p,g))}let b=new OffscreenCanvas(p,g).getContext("2d",{willReadFrequently:!0});b.drawImage(c,0,0,c.width,c.height,0,0,p,g),d={width:p,height:g,data:b.getImageData(0,0,p,g).data}}return{canvas:f,width:u,height:h,imageData:d}}static async deserialize(e,r,i){let s=null,a=!1;if(e instanceof rD){let{data:{rect:b,rotation:m,id:w,structParent:A,popupRef:_,richText:S,contentsObj:I,creationDate:C,modificationDate:M},container:z,parent:{page:{pageNumber:G}},canvas:Y}=e,L,j;Y?(delete e.canvas,{id:L,bitmap:j}=i.imageManager.getFromCanvas(z.id,Y),Y.remove()):(a=!0,e._hasNoCanvas=!0);let q=(await r._structTree.getAriaAttributes(`${Tb}${w}`))?.get("aria-label")||"";s=e={annotationType:Re.STAMP,bitmapId:L,bitmap:j,pageIndex:G-1,rect:b.slice(0),rotation:m,annotationElementId:w,id:w,deleted:!1,accessibilityData:{decorative:!1,altText:q},isSvg:!1,structParent:A,popupRef:_,richText:S,comment:I?.str||null,creationDate:C,modificationDate:M}}let o=await super.deserialize(e,r,i),{rect:c,bitmap:u,bitmapUrl:h,bitmapId:f,isSvg:d,accessibilityData:p}=e;a?(i.addMissingCanvas(e.id,o),x(o,Um,!0)):f&&i.imageManager.isValidId(f)?(x(o,Ri,f),u&&x(o,cn,u)):x(o,vh,h),x(o,ja,d);let[g,y]=o.pageDimensions;return o.width=(c[2]-c[0])/g,o.height=(c[3]-c[1])/y,p&&(o.altTextData=p),o._initialData=s,e.comment&&o.setCommentData(e),x(o,ew,!!s),o}serialize(e=!1,r=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let i=Object.assign(super.serialize(e),{bitmapId:l(this,Ri),isSvg:l(this,ja)});if(this.addComment(i),e)return i.bitmapUrl=R(this,ar,RI).call(this,!0),i.accessibilityData=this.serializeAltText(!0),i.isCopy=!0,i;let{decorative:s,altText:a}=this.serializeAltText(!1);if(!s&&a&&(i.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){let c=R(this,ar,Dq).call(this,i);return c.isSame?null:(c.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1,i.id=this.annotationElementId,delete i.bitmapId,i)}if(r===null)return i;r.stamps||(r.stamps=new Map);let o=l(this,ja)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(!r.stamps.has(l(this,Ri)))r.stamps.set(l(this,Ri),{area:o,serialized:i}),i.bitmap=R(this,ar,RI).call(this,!1);else if(l(this,ja)){let c=r.stamps.get(l(this,Ri));o>c.area&&(c.area=o,c.serialized.bitmap.close(),c.serialized.bitmap=R(this,ar,RI).call(this,!1))}return i}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}};cn=new WeakMap,Ri=new WeakMap,Nd=new WeakMap,vh=new WeakMap,Ld=new WeakMap,tw=new WeakMap,wh=new WeakMap,Um=new WeakMap,Bc=new WeakMap,ja=new WeakMap,ew=new WeakMap,ar=new WeakSet,U1=function(e,r=!1){if(!e){this.remove();return}x(this,cn,e.bitmap),r||(x(this,Ri,e.id),x(this,ja,e.isSvg)),e.file&&x(this,tw,e.file.name),R(this,ar,TI).call(this)},j1=function(){if(x(this,Nd,null),this._uiManager.enableWaiting(!1),!!l(this,wh)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&l(this,cn)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&l(this,cn)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},_I=function(){if(l(this,Ri)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(l(this,Ri)).then(i=>R(this,ar,U1).call(this,i,!0)).finally(()=>R(this,ar,j1).call(this));return}if(l(this,vh)){let i=l(this,vh);x(this,vh,null),this._uiManager.enableWaiting(!0),x(this,Nd,this._uiManager.imageManager.getFromUrl(i).then(s=>R(this,ar,U1).call(this,s)).finally(()=>R(this,ar,j1).call(this)));return}if(l(this,Ld)){let i=l(this,Ld);x(this,Ld,null),this._uiManager.enableWaiting(!0),x(this,Nd,this._uiManager.imageManager.getFromFile(i).then(s=>R(this,ar,U1).call(this,s)).finally(()=>R(this,ar,j1).call(this)));return}let e=document.createElement("input");e.type="file",e.accept=PI.join(",");let r=this._uiManager._signal;x(this,Nd,new Promise(i=>{e.addEventListener("change",async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);let s=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),R(this,ar,U1).call(this,s)}i()},{signal:r}),e.addEventListener("cancel",()=>{this.remove(),i()},{signal:r})}).finally(()=>R(this,ar,j1).call(this))),e.click()},TI=function(){let{div:e}=this,{width:r,height:i}=l(this,cn),[s,a]=this.pageDimensions,o=.75;if(this.width)r=this.width*s,i=this.height*a;else if(r>o*s||i>o*a){let u=Math.min(o*s/r,o*a/i);r*=u,i*=u}this._uiManager.enableWaiting(!1);let c=x(this,wh,document.createElement("canvas"));c.setAttribute("role","img"),this.addContainer(c),this.width=r/s,this.height=i/a,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),R(this,ar,O3).call(this),l(this,ew)||(this.parent.addUndoableEditor(this),x(this,ew,!0)),this._reportTelemetry({action:"inserted_image"}),l(this,tw)&&this.div.setAttribute("aria-description",l(this,tw)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},CI=function(e,r){let{width:i,height:s}=l(this,cn),a=i,o=s,c=l(this,cn);for(;a>2*e||o>2*r;){let u=a,h=o;a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),o>2*r&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));let f=new OffscreenCanvas(a,o);f.getContext("2d").drawImage(c,0,0,u,h,0,0,a,o),c=f.transferToImageBitmap()}return c},O3=function(){let[e,r]=this.parentDimensions,{width:i,height:s}=this,a=new Uc,o=Math.ceil(i*e*a.sx),c=Math.ceil(s*r*a.sy),u=l(this,wh);if(!u||u.width===o&&u.height===c)return;u.width=o,u.height=c;let h=l(this,ja)?l(this,cn):R(this,ar,CI).call(this,o,c),f=u.getContext("2d");f.filter=this._uiManager.hcmFilter,f.drawImage(h,0,0,h.width,h.height,0,0,o,c)},RI=function(e){if(e){if(l(this,ja)){let s=this._uiManager.imageManager.getSvgUrl(l(this,Ri));if(s)return s}let r=document.createElement("canvas");return{width:r.width,height:r.height}=l(this,cn),r.getContext("2d").drawImage(l(this,cn),0,0),r.toDataURL()}if(l(this,ja)){let[r,i]=this.pageDimensions,s=Math.round(this.width*r*Rh.PDF_TO_CSS_UNITS),a=Math.round(this.height*i*Rh.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(s,a);return o.getContext("2d").drawImage(l(this,cn),0,0,l(this,cn).width,l(this,cn).height,0,0,s,a),o.transferToImageBitmap()}return structuredClone(l(this,cn))},Dq=function(e){let{pageIndex:r,accessibilityData:{altText:i}}=this._initialData,s=e.pageIndex===r,a=(e.accessibilityData?.alt||"")===i;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&s&&a,isSameAltText:a}},Lt(B1,"_type","stamp"),Lt(B1,"_editorType",Re.STAMP);vl=class vl{constructor({uiManager:t,pageIndex:e,div:r,structTreeLayer:i,accessibilityManager:s,annotationLayer:a,drawLayer:o,textLayer:c,viewport:u,l10n:h}){T(this,zr);T(this,jm);T(this,rw,!1);T(this,kd,null);T(this,Md,null);T(this,Ah,null);T(this,sa,new Map);T(this,Fd,!1);T(this,nw,!1);T(this,iw,!1);T(this,Dl,null);T(this,Eh,null);T(this,Ii,null);T(this,xh,null);T(this,Bd,null);T(this,sw,-1);T(this,ge);let f=[...l(vl,Ud).values()];if(!vl._initialized){vl._initialized=!0;for(let d of f)d.initialize(h,t)}t.registerEditorTypes(f),x(this,ge,t),this.pageIndex=e,this.div=r,x(this,jm,s),x(this,kd,a),this.viewport=u,x(this,Ii,c),this.drawLayer=o,this._structTree=i,l(this,ge).addLayer(this)}get isEmpty(){return l(this,sa).size===0}get isInvisible(){return this.isEmpty&&l(this,ge).getMode()===Re.NONE}updateToolbar(t){l(this,ge).updateToolbar(t)}updateMode(t=l(this,ge).getMode()){switch(R(this,zr,II).call(this),t){case Re.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Re.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Re.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:e}=this.div;if(e.toggle("nonEditing",!1),t===Re.POPUP)e.toggle("commentEditing",!0);else{e.toggle("commentEditing",!1);for(let r of l(vl,Ud).values())e.toggle(`${r._type}Editing`,t===r._editorType)}this.div.hidden=!1}hasTextLayer(t){return t===l(this,Ii)?.div}setEditingState(t){l(this,ge).setEditingState(t)}addCommands(t){l(this,ge).addCommands(t)}cleanUndoStack(t){l(this,ge).cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){l(this,kd)?.togglePointerEvents(t)}async enable(){x(this,iw,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),l(this,Bd)?.abort(),x(this,Bd,null);let t=new Set;for(let r of l(this,zr,P3))r.enableEditing(),r.show(!0),r.annotationElementId&&(l(this,ge).removeChangedExistingAnnotation(r),t.add(r.annotationElementId));let e=l(this,kd);if(e)for(let r of e.getEditableAnnotations()){if(r.hide(),l(this,ge).isDeletedAnnotationElement(r.data.id)||t.has(r.data.id))continue;let i=await this.deserialize(r);i&&(this.addOrRebuild(i),i.enableEditing())}x(this,iw,!1),l(this,ge)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(x(this,nw,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),l(this,Ii)&&!l(this,Bd)){x(this,Bd,new AbortController);let i=l(this,ge).combinedSignal(l(this,Bd));l(this,Ii).div.addEventListener("pointerdown",s=>{let{clientX:o,clientY:c,timeStamp:u}=s,h=l(this,sw);if(u-h>500){x(this,sw,u);return}x(this,sw,-1);let{classList:f}=this.div;f.toggle("getElements",!0);let d=document.elementsFromPoint(o,c);if(f.toggle("getElements",!1),!this.div.contains(d[0]))return;let p,g=new RegExp(`^${W1}[0-9]+$`);for(let b of d)if(g.test(b.id)){p=b.id;break}if(!p)return;let y=l(this,sa).get(p);y?.annotationElementId===null&&(s.stopPropagation(),s.preventDefault(),y.dblclick(s))},{signal:i,capture:!0})}let t=l(this,kd),e=[];if(t){let i=new Map,s=new Map;for(let o of l(this,zr,P3)){if(o.disableEditing(),!o.annotationElementId){e.push(o);continue}if(o.serialize()!==null){i.set(o.annotationElementId,o);continue}else s.set(o.annotationElementId,o);this.getEditableAnnotation(o.annotationElementId)?.show(),o.remove()}let a=t.getEditableAnnotations();for(let o of a){let{id:c}=o.data;if(l(this,ge).isDeletedAnnotationElement(c)){o.updateEdited({deleted:!0});continue}let u=s.get(c);if(u){u.resetAnnotationElement(o),u.show(!1),o.show();continue}u=i.get(c),u&&(l(this,ge).addChangedExistingAnnotation(u),u.renderAnnotationElement(o)&&u.show(!1)),o.show()}}R(this,zr,II).call(this),this.isEmpty&&(this.div.hidden=!0);let{classList:r}=this.div;for(let i of l(vl,Ud).values())r.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),t?.updateFakeAnnotations(e),x(this,nw,!1)}getEditableAnnotation(t){return l(this,kd)?.getEditableAnnotation(t)||null}setActiveEditor(t){l(this,ge).getActive()!==t&&l(this,ge).setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,l(this,Ii)?.div&&!l(this,xh)){x(this,xh,new AbortController);let t=l(this,ge).combinedSignal(l(this,xh));l(this,Ii).div.addEventListener("pointerdown",R(this,zr,Oq).bind(this),{signal:t}),l(this,Ii).div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,l(this,Ii)?.div&&l(this,xh)&&(l(this,xh).abort(),x(this,xh,null),l(this,Ii).div.classList.remove("highlighting"))}enableClick(){if(l(this,Md))return;x(this,Md,new AbortController);let t=l(this,ge).combinedSignal(l(this,Md));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});let e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){l(this,Md)?.abort(),x(this,Md,null)}attach(t){l(this,sa).set(t.id,t);let{annotationElementId:e}=t;e&&l(this,ge).isDeletedAnnotationElement(e)&&l(this,ge).removeDeletedAnnotationElement(t)}detach(t){l(this,sa).delete(t.id),l(this,jm)?.removePointerInTextLayer(t.contentDiv),!l(this,nw)&&t.annotationElementId&&l(this,ge).addDeletedAnnotationElement(t)}remove(t){this.detach(t),l(this,ge).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(l(this,ge).addDeletedAnnotationElement(t),Zr.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),l(this,ge).addEditor(t),this.attach(t),!t.isAttachedToDOM){let e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!l(this,iw)),l(this,ge).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;let{activeElement:e}=document;t.div.contains(e)&&!l(this,Ah)&&(t._focusEventsAllowed=!1,x(this,Ah,setTimeout(()=>{x(this,Ah,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:l(this,ge)._signal}),e.focus())},0))),t._structTreeParentId=l(this,jm)?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){let e=()=>t._uiManager.rebuild(t),r=()=>{t.remove()};this.addCommands({cmd:e,undo:r,mustExec:!1})}getEditorByUID(t){for(let e of l(this,sa).values())if(e.uid===t)return e;return null}getNextId(){return l(this,ge).getId()}combinedSignal(t){return l(this,ge).combinedSignal(t)}canCreateNewEmptyEditor(){return l(this,zr,mc)?.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await l(this,ge).updateMode(t.mode);let{offsetX:r,offsetY:i}=R(this,zr,L3).call(this),s=this.getNextId(),a=R(this,zr,N3).call(this,{parent:this,id:s,x:r,y:i,uiManager:l(this,ge),isCentered:!0,...e});a&&this.add(a)}async deserialize(t){return await l(vl,Ud).get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,l(this,ge))||null}createAndAddNewEditor(t,e,r={}){let i=this.getNextId(),s=R(this,zr,N3).call(this,{parent:this,id:i,x:t.offsetX,y:t.offsetY,uiManager:l(this,ge),isCentered:e,...r});return s&&this.add(s),s}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(t={}){this.createAndAddNewEditor(R(this,zr,L3).call(this),!0,t)}setSelected(t){l(this,ge).setSelected(t)}toggleSelected(t){l(this,ge).toggleSelected(t)}unselect(t){l(this,ge).unselect(t)}pointerup(t){let{isMac:e}=Pn.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div||!l(this,Fd)||(x(this,Fd,!1),l(this,zr,mc)?.isDrawer&&l(this,zr,mc).supportMultipleDrawings))return;if(!l(this,rw)){x(this,rw,!0);return}let r=l(this,ge).getMode();if(r===Re.STAMP||r===Re.SIGNATURE){l(this,ge).unselectAll();return}this.createAndAddNewEditor(t,!1)}pointerdown(t){if(l(this,ge).getMode()===Re.HIGHLIGHT&&this.enableTextSelection(),l(this,Fd)){x(this,Fd,!1);return}let{isMac:e}=Pn.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div)return;if(x(this,Fd,!0),l(this,zr,mc)?.isDrawer){this.startDrawingSession(t);return}let r=l(this,ge).getActive();x(this,rw,!r||r.isEmpty())}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),l(this,Dl)){l(this,zr,mc).startDrawing(this,l(this,ge),!1,t);return}l(this,ge).setCurrentDrawingSession(this),x(this,Dl,new AbortController);let e=l(this,ge).combinedSignal(l(this,Dl));this.div.addEventListener("blur",({relatedTarget:r})=>{r&&!this.div.contains(r)&&(x(this,Eh,null),this.commitOrRemove())},{signal:e}),l(this,zr,mc).startDrawing(this,l(this,ge),!1,t)}pause(t){if(t){let{activeElement:e}=document;this.div.contains(e)&&x(this,Eh,e);return}l(this,Eh)&&setTimeout(()=>{l(this,Eh)?.focus(),x(this,Eh,null)},0)}endDrawingSession(t=!1){return l(this,Dl)?(l(this,ge).setCurrentDrawingSession(null),l(this,Dl).abort(),x(this,Dl,null),x(this,Eh,null),l(this,zr,mc).endDrawing(t)):null}findNewParent(t,e,r){let i=l(this,ge).findParent(e,r);return i===null||i===this?!1:(i.changeParent(t),!0)}commitOrRemove(){return l(this,Dl)?(this.endDrawingSession(),!0):!1}onScaleChanging(){l(this,Dl)&&l(this,zr,mc).onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),l(this,ge).getActive()?.parent===this&&(l(this,ge).commitOrRemove(),l(this,ge).setActiveEditor(null)),l(this,Ah)&&(clearTimeout(l(this,Ah)),x(this,Ah,null));for(let t of l(this,sa).values())l(this,jm)?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,l(this,sa).clear(),l(this,ge).removeLayer(this)}render({viewport:t}){this.viewport=t,jd(this.div,t);for(let e of l(this,ge).getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:t}){l(this,ge).commitOrRemove(),R(this,zr,II).call(this);let e=this.viewport.rotation,r=t.rotation;if(this.viewport=t,jd(this.div,{rotation:r}),e!==r)for(let i of l(this,sa).values())i.rotate(r)}get pageDimensions(){let{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return l(this,ge).viewParameters.realScale}};jm=new WeakMap,rw=new WeakMap,kd=new WeakMap,Md=new WeakMap,Ah=new WeakMap,sa=new WeakMap,Fd=new WeakMap,nw=new WeakMap,iw=new WeakMap,Dl=new WeakMap,Eh=new WeakMap,Ii=new WeakMap,xh=new WeakMap,Bd=new WeakMap,sw=new WeakMap,ge=new WeakMap,Ud=new WeakMap,zr=new WeakSet,P3=function(){return l(this,sa).size!==0?l(this,sa).values():l(this,ge).getEditors(this.pageIndex)},Oq=function(t){l(this,ge).unselectAll();let{target:e}=t;if(e===l(this,Ii).div||(e.getAttribute("role")==="img"||e.classList.contains("endOfContent"))&&l(this,Ii).div.contains(e)){let{isMac:r}=Pn.platform;if(t.button!==0||t.ctrlKey&&r)return;l(this,ge).showAllEditors("highlight",!0,!0),l(this,Ii).div.classList.add("free"),this.toggleDrawing(),aD.startHighlighting(this,l(this,ge).direction==="ltr",{target:l(this,Ii).div,x:t.x,y:t.y}),l(this,Ii).div.addEventListener("pointerup",()=>{l(this,Ii).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:l(this,ge)._signal}),t.preventDefault()}},mc=function(){return l(vl,Ud).get(l(this,ge).getMode())},N3=function(t){let e=l(this,zr,mc);return e?new e.prototype.constructor(t):null},L3=function(){let{x:t,y:e,width:r,height:i}=this.boundingClientRect,s=Math.max(0,t),a=Math.max(0,e),o=Math.min(window.innerWidth,t+r),c=Math.min(window.innerHeight,e+i),u=(s+o)/2-t,h=(a+c)/2-e,[f,d]=this.viewport.rotation%180===0?[u,h]:[h,u];return{offsetX:f,offsetY:d}},II=function(){for(let t of l(this,sa).values())t.isEmpty()&&t.remove()},Lt(vl,"_initialized",!1),T(vl,Ud,new Map([f3,x3,B1,aD,D3].map(t=>[t._editorType,t])));uD=vl,ui=class ui{constructor({pageIndex:t}){T(this,jc);T(this,Ol,null);T(this,Ds,new Map);T(this,$m,new Map);this.pageIndex=t}setParent(t){if(!l(this,Ol)){x(this,Ol,t);return}if(l(this,Ol)!==t){if(l(this,Ds).size>0)for(let e of l(this,Ds).values())e.remove(),t.append(e);x(this,Ol,t)}}static get _svgFactory(){return Te(this,"_svgFactory",new Gm)}draw(t,e=!1,r=!1){let i=ze(ui,qx)._++,s=R(this,jc,k3).call(this),a=ui._svgFactory.createElement("defs");s.append(a);let o=ui._svgFactory.createElement("path");a.append(o);let c=`path_p${this.pageIndex}_${i}`;o.setAttribute("id",c),o.setAttribute("vector-effect","non-scaling-stroke"),e&&l(this,$m).set(i,o);let u=r?R(this,jc,Nq).call(this,a,c):null,h=ui._svgFactory.createElement("use");return s.append(h),h.setAttribute("href",`#${c}`),this.updateProperties(s,t),l(this,Ds).set(i,s),{id:i,clipPathId:`url(#${u})`}}drawOutline(t,e){let r=ze(ui,qx)._++,i=R(this,jc,k3).call(this),s=ui._svgFactory.createElement("defs");i.append(s);let a=ui._svgFactory.createElement("path");s.append(a);let o=`path_p${this.pageIndex}_${r}`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke");let c;if(e){let f=ui._svgFactory.createElement("mask");s.append(f),c=`mask_p${this.pageIndex}_${r}`,f.setAttribute("id",c),f.setAttribute("maskUnits","objectBoundingBox");let d=ui._svgFactory.createElement("rect");f.append(d),d.setAttribute("width","1"),d.setAttribute("height","1"),d.setAttribute("fill","white");let p=ui._svgFactory.createElement("use");f.append(p),p.setAttribute("href",`#${o}`),p.setAttribute("stroke","none"),p.setAttribute("fill","black"),p.setAttribute("fill-rule","nonzero"),p.classList.add("mask")}let u=ui._svgFactory.createElement("use");i.append(u),u.setAttribute("href",`#${o}`),c&&u.setAttribute("mask",`url(#${c})`);let h=u.cloneNode();return i.append(h),u.classList.add("mainOutline"),h.classList.add("secondaryOutline"),this.updateProperties(i,t),l(this,Ds).set(r,i),r}finalizeDraw(t,e){l(this,$m).delete(t),this.updateProperties(t,e)}updateProperties(t,e){var c;if(!e)return;let{root:r,bbox:i,rootClass:s,path:a}=e,o=typeof t=="number"?l(this,Ds).get(t):t;if(o){if(r&&R(this,jc,M3).call(this,o,r),i&&R(c=ui,DD,Pq).call(c,o,i),s){let{classList:u}=o;for(let[h,f]of Object.entries(s))u.toggle(h,f)}if(a){let h=o.firstElementChild.firstElementChild;R(this,jc,M3).call(this,h,a)}}}updateParent(t,e){if(e===this)return;let r=l(this,Ds).get(t);r&&(l(e,Ol).append(r),l(this,Ds).delete(t),l(e,Ds).set(t,r))}remove(t){l(this,$m).delete(t),l(this,Ol)!==null&&(l(this,Ds).get(t).remove(),l(this,Ds).delete(t))}destroy(){x(this,Ol,null);for(let t of l(this,Ds).values())t.remove();l(this,Ds).clear(),l(this,$m).clear()}};Ol=new WeakMap,Ds=new WeakMap,$m=new WeakMap,qx=new WeakMap,DD=new WeakSet,Pq=function(t,[e,r,i,s]){let{style:a}=t;a.top=`${100*r}%`,a.left=`${100*e}%`,a.width=`${100*i}%`,a.height=`${100*s}%`},jc=new WeakSet,k3=function(){let t=ui._svgFactory.create(1,1,!0);return l(this,Ol).append(t),t.setAttribute("aria-hidden",!0),t},Nq=function(t,e){let r=ui._svgFactory.createElement("clipPath");t.append(r);let i=`clip_${e}`;r.setAttribute("id",i),r.setAttribute("clipPathUnits","objectBoundingBox");let s=ui._svgFactory.createElement("use");return r.append(s),s.setAttribute("href",`#${e}`),s.classList.add("clip"),i},M3=function(t,e){for(let[r,i]of Object.entries(e))i===null?t.removeAttribute(r):t.setAttribute(r,i)},T(ui,DD),T(ui,qx,0);hD=ui;globalThis._pdfjsTestingUtils={HighlightOutliner:r2};globalThis.pdfjsLib={AbortException:Nl,AnnotationEditorLayer:uD,AnnotationEditorParamsType:Je,AnnotationEditorType:Re,AnnotationEditorUIManager:$d,AnnotationLayer:nD,AnnotationMode:Sh,AnnotationType:zn,applyOpacity:$V,build:$X,ColorPicker:J1,createValidAbsoluteUrl:F3,CSSConstants:NI,DOMSVGFactory:Gm,DrawLayer:hD,FeatureTest:Pn,fetchData:hw,findContrastColor:HV,getDocument:FX,getFilenameFromUrl:BV,getPdfFilenameFromUrl:UV,getRGB:fw,getUuid:U3,getXfaPageViewport:jV,GlobalWorkerOptions:Ho,ImageKind:$1,InvalidPDFException:ow,isDataScheme:Zx,isPdfFile:ND,isValidExplicitDest:EX,MathClamp:ds,noContextMenu:Ga,normalizeUnicode:MV,OPS:aw,OutputScale:Uc,PasswordResponses:LV,PDFDataRangeTransport:Z1,PDFDateString:Hm,PDFWorker:uw,PermissionFlag:NV,PixelsPerInch:Rh,RenderingCancelledException:lw,renderRichText:j3,ResponseException:zm,setLayerDimensions:jd,shadow:Te,SignatureExtractor:zo,stopEvent:mn,SupportedImageMimeTypes:PI,TextLayer:cw,TouchManager:q1,updateUrlHash:B3,Util:ie,VerbosityLevel:Yx,version:jX,XfaLayer:V1}});var k5={};tc(k5,{AbortException:()=>Kl,AnnotationEditorLayer:()=>iP,AnnotationEditorParamsType:()=>tr,AnnotationEditorType:()=>Ie,AnnotationEditorUIManager:()=>kp,AnnotationLayer:()=>ZO,AnnotationMode:()=>bf,AnnotationType:()=>Vn,CSSConstants:()=>CO,ColorPicker:()=>MS,DOMSVGFactory:()=>w0,DrawLayer:()=>sP,FeatureTest:()=>Bn,GlobalWorkerOptions:()=>al,ImageKind:()=>_S,InvalidPDFException:()=>nE,MathClamp:()=>As,OPS:()=>rE,OutputScale:()=>fu,PDFDataRangeTransport:()=>kS,PDFDateString:()=>y0,PDFWorker:()=>aE,PasswordResponses:()=>rY,PermissionFlag:()=>eY,PixelsPerInch:()=>Ef,RenderingCancelledException:()=>iE,ResponseException:()=>b0,SignatureExtractor:()=>ol,SupportedImageMimeTypes:()=>TO,TextLayer:()=>sE,TouchManager:()=>PS,Util:()=>se,VerbosityLevel:()=>NT,XfaLayer:()=>DS,applyOpacity:()=>cY,build:()=>cK,createValidAbsoluteUrl:()=>D5,fetchData:()=>oE,findContrastColor:()=>uY,getDocument:()=>sK,getFilenameFromUrl:()=>aY,getPdfFilenameFromUrl:()=>oY,getRGB:()=>lE,getUuid:()=>P5,getXfaPageViewport:()=>lY,isDataScheme:()=>kT,isPdfFile:()=>CP,isValidExplicitDest:()=>WY,noContextMenu:()=>yo,normalizeUnicode:()=>iY,renderRichText:()=>N5,setLayerDimensions:()=>Lp,shadow:()=>Ce,stopEvent:()=>wn,updateUrlHash:()=>O5,version:()=>lK});function nft(n){Number.isInteger(n)&&(_P=n)}function ift(){return _P}function TP(n){_P>=NT.INFOS&&console.info(`Info: ${n}`)}function De(n){_P>=NT.WARNINGS&&console.warn(`Warning: ${n}`)}function qr(n){throw new Error(n)}function rr(n,t){n||qr(t)}function sft(n){switch(n?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function D5(n,t=null,e=null){if(!n)return null;if(e&&typeof n=="string"&&(e.addDefaultProtocol&&n.startsWith("www.")&&n.match(/\./g)?.length>=2&&(n=`http://${n}`),e.tryConvertEncoding))try{n=cft(n)}catch{}let r=t?URL.parse(n,t):URL.parse(n);return sft(r)?r:null}function O5(n,t,e=!1){let r=URL.parse(n);return r?(r.hash=t,r.href):e&&D5(n,"http://example.com")?n.split("#",1)[0]+`${t?`#${t}`:""}`:""}function Ce(n,t,e,r=!1){return Object.defineProperty(n,t,{value:e,enumerable:!r,configurable:!0,writable:!1}),e}function nY(n){(typeof n!="object"||n?.length===void 0)&&qr("Invalid argument for bytesToString");let t=n.length,e=8192;if(t<e)return String.fromCharCode.apply(null,n);let r=[];for(let i=0;i<t;i+=e){let s=Math.min(i+e,t),a=n.subarray(i,s);r.push(String.fromCharCode.apply(null,a))}return r.join("")}function LT(n){typeof n!="string"&&qr("Invalid argument for stringToBytes");let t=n.length,e=new Uint8Array(t);for(let r=0;r<t;++r)e[r]=n.charCodeAt(r)&255;return e}function aft(n){return String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,n&255)}function oft(){let n=new Uint8Array(4);return n[0]=1,new Uint32Array(n.buffer,0,1)[0]===1}function lft(){try{return new Function(""),!0}catch{return!1}}function cft(n){return decodeURIComponent(escape(n))}function iY(n){return Y3||(Y3=/([\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,Mq=new Map([["\uFB05","\u017Ft"]])),n.replaceAll(Y3,(t,e,r)=>e?e.normalize("NFKC"):Mq.get(r))}function P5(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();let n=new Uint8Array(32);return crypto.getRandomValues(n),nY(n)}function uft(n,t,e){if(!Array.isArray(e)||e.length<2)return!1;let[r,i,...s]=e;if(!n(r)&&!Number.isInteger(r)||!t(i))return!1;let a=s.length,o=!0;switch(i.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return a===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(a!==4)return!1;o=!1;break;default:return!1}for(let c of s)if(!(typeof c=="number"||o&&c===null))return!1;return!0}function As(n,t,e){return Math.min(Math.max(n,t),e)}function sY(n){return Uint8Array.prototype.toBase64?n.toBase64():btoa(nY(n))}function hft(n){return Uint8Array.fromBase64?Uint8Array.fromBase64(n):LT(atob(n))}async function oE(n,t="text"){if(iS(n,document.baseURI)){let e=await fetch(n);if(!e.ok)throw new Error(e.statusText);switch(t){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"json":return e.json()}return e.text()}return new Promise((e,r)=>{let i=new XMLHttpRequest;i.open("GET",n,!0),i.responseType=t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(t){case"arraybuffer":case"blob":case"json":e(i.response);return}e(i.responseText);return}r(new Error(i.statusText))}},i.send(null)})}function kT(n){let t=n.length,e=0;for(;e<t&&n[e].trim()==="";)e++;return n.substring(e,e+5).toLowerCase()==="data:"}function CP(n){return typeof n=="string"&&/\.pdf$/i.test(n)}function aY(n){return[n]=n.split(/[#?]/,1),n.substring(n.lastIndexOf("/")+1)}function oY(n,t="document.pdf"){if(typeof n!="string")return t;if(kT(n))return De('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;let r=(o=>{try{return new URL(o)}catch{try{return new URL(decodeURIComponent(o))}catch{try{return new URL(o,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(o),"https://foo.bar")}catch{return null}}}}})(n);if(!r)return t;let i=o=>{try{let c=decodeURIComponent(o);return c.includes("/")?(c=c.split("/").at(-1),c.test(/^\.pdf$/i)?c:o):c}catch{return o}},s=/\.pdf$/i,a=r.pathname.split("/").at(-1);if(s.test(a))return i(a);if(r.searchParams.size>0){let o=Array.from(r.searchParams.values()).reverse();for(let u of o)if(s.test(u))return i(u);let c=Array.from(r.searchParams.keys()).reverse();for(let u of c)if(s.test(u))return i(u)}if(r.hash){let c=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(r.hash);if(c)return i(c[0])}return t}function iS(n,t){let e=t?URL.parse(n,t):URL.parse(n);return e?.protocol==="http:"||e?.protocol==="https:"}function yo(n){n.preventDefault()}function wn(n){n.preventDefault(),n.stopPropagation()}function fft(n){console.log("Deprecated API usage: "+n)}function lY(n,{scale:t=1,rotation:e=0}){let{width:r,height:i}=n.attributes.style,s=[0,0,parseInt(r),parseInt(i)];return new OS({viewBox:s,userUnit:1,scale:t,rotation:e})}function lE(n){if(n.startsWith("#")){let t=parseInt(n.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return n.startsWith("rgb(")?n.slice(4,-1).split(",").map(t=>parseInt(t)):n.startsWith("rgba(")?n.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(De(`Not a valid color format: "${n}"`),[0,0,0])}function dft(n){let t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(let e of n.keys()){t.style.color=e;let r=window.getComputedStyle(t).color;n.set(e,lE(r))}t.remove()}function vn(n){let{a:t,b:e,c:r,d:i,e:s,f:a}=n.getTransform();return[t,e,r,i,s,a]}function $c(n){let{a:t,b:e,c:r,d:i,e:s,f:a}=n.getTransform().invertSelf();return[t,e,r,i,s,a]}function Lp(n,t,e=!1,r=!0){if(t instanceof OS){let{pageWidth:i,pageHeight:s}=t.rawDims,{style:a}=n,o=Bn.isCSSRoundSupported,c=`var(--total-scale-factor) * ${i}px`,u=`var(--total-scale-factor) * ${s}px`,h=o?`round(down, ${c}, var(--scale-round-x))`:`calc(${c})`,f=o?`round(down, ${u}, var(--scale-round-y))`:`calc(${u})`;!e||t.rotation%180===0?(a.width=h,a.height=f):(a.width=f,a.height=h)}r&&n.setAttribute("data-main-rotation",t.rotation)}function cY(n,t,e,r){r=Math.min(Math.max(r??1,0),1);let i=255*(1-r);return n=Math.round(n*r+i),t=Math.round(t*r+i),e=Math.round(e*r+i),[n,t,e]}function Fq(n,t){let e=n[0]/255,r=n[1]/255,i=n[2]/255,s=Math.max(e,r,i),a=Math.min(e,r,i),o=(s+a)/2;if(s===a)t[0]=t[1]=0;else{let c=s-a;switch(t[1]=o<.5?c/(s+a):c/(2-s-a),s){case e:t[0]=((r-i)/c+(r<i?6:0))*60;break;case r:t[0]=((i-e)/c+2)*60;break;case i:t[0]=((e-r)/c+4)*60;break}}t[2]=o}function s4(n,t){let e=n[0],r=n[1],i=n[2],s=(1-Math.abs(2*i-1))*r,a=s*(1-Math.abs(e/60%2-1)),o=i-s/2;switch(Math.floor(e/60)){case 0:t[0]=s+o,t[1]=a+o,t[2]=o;break;case 1:t[0]=a+o,t[1]=s+o,t[2]=o;break;case 2:t[0]=o,t[1]=s+o,t[2]=a+o;break;case 3:t[0]=o,t[1]=a+o,t[2]=s+o;break;case 4:t[0]=a+o,t[1]=o,t[2]=s+o;break;case 5:case 6:t[0]=s+o,t[1]=o,t[2]=a+o;break}}function Bq(n){return n<=.03928?n/12.92:((n+.055)/1.055)**2.4}function Uq(n,t,e){s4(n,e),e.map(Bq);let r=.2126*e[0]+.7152*e[1]+.0722*e[2];s4(t,e),e.map(Bq);let i=.2126*e[0]+.7152*e[1]+.0722*e[2];return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)}function uY(n,t){let e=n[0]+n[1]*256+n[2]*65536+t[0]*16777216+t[1]*4294967296+t[2]*1099511627776,r=jq.get(e);if(r)return r;let i=new Float32Array(9),s=i.subarray(0,3),a=i.subarray(3,6);Fq(n,a);let o=i.subarray(6,9);Fq(t,o);let c=o[2]<.5,u=c?12:4.5;if(a[2]=c?Math.sqrt(a[2]):1-Math.sqrt(1-a[2]),Uq(a,o,s)<u){let h,f;c?(h=a[2],f=1):(h=0,f=a[2]);let d=.005;for(;f-h>d;){let p=a[2]=(h+f)/2;c===Uq(a,o,s)<u?h=p:f=p}a[2]=c?f:h}return s4(a,s),r=se.makeHexColor(Math.round(s[0]*255),Math.round(s[1]*255),Math.round(s[2]*255)),jq.set(e,r),r}function N5({html:n,dir:t,className:e},r){let i=document.createDocumentFragment();if(typeof n=="string"){let s=document.createElement("p");s.dir=t||"auto";let a=n.split(/(?:\r\n?|\n)/);for(let o=0,c=a.length;o<c;++o){let u=a[o];s.append(document.createTextNode(u)),o<c-1&&s.append(document.createElement("br"))}i.append(s)}else DS.render({xfaHtml:n,div:i,intent:"richText"});i.firstElementChild.classList.add("richText",e),r.append(i)}function hY(n){let t=new Path2D;if(!n)return t;for(let e=0,r=n.length;e<r;)switch(n[e++]){case Qx.moveTo:t.moveTo(n[e++],n[e++]);break;case Qx.lineTo:t.lineTo(n[e++],n[e++]);break;case Qx.curveTo:t.bezierCurveTo(n[e++],n[e++],n[e++],n[e++],n[e++],n[e++]);break;case Qx.quadraticCurveTo:t.quadraticCurveTo(n[e++],n[e++],n[e++],n[e++]);break;case Qx.closePath:t.closePath();break;default:De(`Unrecognized drawing path operator: ${n[e-1]}`);break}return t}function yY(n,t,e){for(let r of e)t.addEventListener(r,n[r].bind(n))}function pft(n){if(n instanceof URL)return n.href;if(typeof n=="string"){if(Us)return n;let t=URL.parse(n,window.location);if(t)return t.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function gft(n){if(Us&&typeof Buffer<"u"&&n instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength)return n;if(typeof n=="string")return LT(n);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n)||typeof n=="object"&&!isNaN(n?.length))return new Uint8Array(n);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function kD(n){if(typeof n!="string")return null;if(n.endsWith("/"))return n;throw new Error(`Invalid factory url: "${n}" must include trailing slash.`)}function Hq(){}function oa(n){if(n instanceof Kl||n instanceof nE||n instanceof SO||n instanceof b0||n instanceof TS)return n;switch(n instanceof Error||typeof n=="object"&&n!==null||qr('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),n.name){case"AbortException":return new Kl(n.message);case"InvalidPDFException":return new nE(n.message);case"PasswordException":return new SO(n.message,n.code);case"ResponseException":return new b0(n.message,n.status,n.missing);case"UnknownErrorException":return new TS(n.message,n.details)}return new TS(n.message,n.toString())}async function L5(n){let e=await process.getBuiltinModule("fs").promises.readFile(n);return new Uint8Array(e)}function FD(n,t,e,r,i,s){n[t*4+0]=Math.min(n[t*4+0],e),n[t*4+1]=Math.min(n[t*4+1],r),n[t*4+2]=Math.max(n[t*4+2],i),n[t*4+3]=Math.max(n[t*4+3],s)}function X4(n,t){if(!t)return;let e=t[2]-t[0],r=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],e,r),n.clip(i)}function K3(n,t,e,r,i,s,a,o){let c=t.coords,u=t.colors,h=n.data,f=n.width*4,d;c[e+1]>c[r+1]&&(d=e,e=r,r=d,d=s,s=a,a=d),c[r+1]>c[i+1]&&(d=r,r=i,i=d,d=a,a=o,o=d),c[e+1]>c[r+1]&&(d=e,e=r,r=d,d=s,s=a,a=d);let p=(c[e]+t.offsetX)*t.scaleX,g=(c[e+1]+t.offsetY)*t.scaleY,y=(c[r]+t.offsetX)*t.scaleX,b=(c[r+1]+t.offsetY)*t.scaleY,m=(c[i]+t.offsetX)*t.scaleX,w=(c[i+1]+t.offsetY)*t.scaleY;if(g>=w)return;let A=u[s],_=u[s+1],S=u[s+2],I=u[a],C=u[a+1],M=u[a+2],z=u[o],G=u[o+1],Y=u[o+2],L=Math.round(g),j=Math.round(w),q,nt,J,N,D,F,P,V;for(let $=L;$<=j;$++){if($<b){let K=$<g?0:(g-$)/(g-b);q=p-(p-y)*K,nt=A-(A-I)*K,J=_-(_-C)*K,N=S-(S-M)*K}else{let K;$>w?K=1:b===w?K=0:K=(b-$)/(b-w),q=y-(y-m)*K,nt=I-(I-z)*K,J=C-(C-G)*K,N=M-(M-Y)*K}let H;$<g?H=0:$>w?H=1:H=(g-$)/(g-w),D=p-(p-m)*H,F=A-(A-z)*H,P=_-(_-G)*H,V=S-(S-Y)*H;let rt=Math.round(Math.min(q,D)),lt=Math.round(Math.max(q,D)),ft=f*$+rt*4;for(let K=rt;K<=lt;K++)H=(q-K)/(q-D),H<0?H=0:H>1&&(H=1),h[ft++]=nt-(nt-F)*H|0,h[ft++]=J-(J-P)*H|0,h[ft++]=N-(N-V)*H|0,h[ft++]=255}}function yft(n,t,e){let r=t.coords,i=t.colors,s,a;switch(t.type){case e4.LATTICE:let o=t.verticesPerRow,c=Math.floor(r.length/o)-1,u=o-1;for(s=0;s<c;s++){let h=s*o;for(let f=0;f<u;f++,h++)K3(n,e,r[h],r[h+1],r[h+o],i[h],i[h+1],i[h+o]),K3(n,e,r[h+o+1],r[h+1],r[h+o],i[h+o+1],i[h+1],i[h+o])}break;case e4.TRIANGLES:for(s=0,a=r.length;s<a;s+=3)K3(n,e,r[s],r[s+1],r[s+2],i[s],i[s+1],i[s+2]);break;default:throw new Error("illegal figure")}}function bft(n){switch(n[0]){case"RadialAxial":return new q4(n);case"Mesh":return new Y4(n);case"Dummy":return new K4}throw new Error(`Unknown IR type: ${n[0]}`)}function vft({src:n,srcPos:t=0,dest:e,width:r,height:i,nonBlackColor:s=4294967295,inverseDecode:a=!1}){let o=Bn.isLittleEndian?4278190080:255,[c,u]=a?[s,o]:[o,s],h=r>>3,f=r&7,d=n.length;e=new Uint32Array(e.buffer);let p=0;for(let g=0;g<i;g++){for(let b=t+h;t<b;t++){let m=t<d?n[t]:255;e[p++]=m&128?u:c,e[p++]=m&64?u:c,e[p++]=m&32?u:c,e[p++]=m&16?u:c,e[p++]=m&8?u:c,e[p++]=m&4?u:c,e[p++]=m&2?u:c,e[p++]=m&1?u:c}if(f===0)continue;let y=t<d?n[t++]:255;for(let b=0;b<f;b++)e[p++]=y&1<<7-b?u:c}return{srcPos:t,destPos:p}}function Aft(n,t){if(n._removeMirroring)throw new Error("Context is already forwarding operations.");n.__originalSave=n.save,n.__originalRestore=n.restore,n.__originalRotate=n.rotate,n.__originalScale=n.scale,n.__originalTranslate=n.translate,n.__originalTransform=n.transform,n.__originalSetTransform=n.setTransform,n.__originalResetTransform=n.resetTransform,n.__originalClip=n.clip,n.__originalMoveTo=n.moveTo,n.__originalLineTo=n.lineTo,n.__originalBezierCurveTo=n.bezierCurveTo,n.__originalRect=n.rect,n.__originalClosePath=n.closePath,n.__originalBeginPath=n.beginPath,n._removeMirroring=()=>{n.save=n.__originalSave,n.restore=n.__originalRestore,n.rotate=n.__originalRotate,n.scale=n.__originalScale,n.translate=n.__originalTranslate,n.transform=n.__originalTransform,n.setTransform=n.__originalSetTransform,n.resetTransform=n.__originalResetTransform,n.clip=n.__originalClip,n.moveTo=n.__originalMoveTo,n.lineTo=n.__originalLineTo,n.bezierCurveTo=n.__originalBezierCurveTo,n.rect=n.__originalRect,n.closePath=n.__originalClosePath,n.beginPath=n.__originalBeginPath,delete n._removeMirroring},n.save=function(){t.save(),this.__originalSave()},n.restore=function(){t.restore(),this.__originalRestore()},n.translate=function(e,r){t.translate(e,r),this.__originalTranslate(e,r)},n.scale=function(e,r){t.scale(e,r),this.__originalScale(e,r)},n.transform=function(e,r,i,s,a,o){t.transform(e,r,i,s,a,o),this.__originalTransform(e,r,i,s,a,o)},n.setTransform=function(e,r,i,s,a,o){t.setTransform(e,r,i,s,a,o),this.__originalSetTransform(e,r,i,s,a,o)},n.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},n.rotate=function(e){t.rotate(e),this.__originalRotate(e)},n.clip=function(e){t.clip(e),this.__originalClip(e)},n.moveTo=function(e,r){t.moveTo(e,r),this.__originalMoveTo(e,r)},n.lineTo=function(e,r){t.lineTo(e,r),this.__originalLineTo(e,r)},n.bezierCurveTo=function(e,r,i,s,a,o){t.bezierCurveTo(e,r,i,s,a,o),this.__originalBezierCurveTo(e,r,i,s,a,o)},n.rect=function(e,r,i,s){t.rect(e,r,i,s),this.__originalRect(e,r,i,s)},n.closePath=function(){t.closePath(),this.__originalClosePath()},n.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}function UD(n,t,e,r,i,s,a,o,c,u){let[h,f,d,p,g,y]=vn(n);if(f===0&&d===0){let w=a*h+g,A=Math.round(w),_=o*p+y,S=Math.round(_),I=(a+c)*h+g,C=Math.abs(Math.round(I)-A)||1,M=(o+u)*p+y,z=Math.abs(Math.round(M)-S)||1;return n.setTransform(Math.sign(h),0,0,Math.sign(p),A,S),n.drawImage(t,e,r,i,s,0,0,C,z),n.setTransform(h,f,d,p,g,y),[C,z]}if(h===0&&p===0){let w=o*d+g,A=Math.round(w),_=a*f+y,S=Math.round(_),I=(o+u)*d+g,C=Math.abs(Math.round(I)-A)||1,M=(a+c)*f+y,z=Math.abs(Math.round(M)-S)||1;return n.setTransform(0,Math.sign(f),Math.sign(d),0,A,S),n.drawImage(t,e,r,i,s,0,0,z,C),n.setTransform(h,f,d,p,g,y),[z,C]}n.drawImage(t,e,r,i,s,a,o,c,u);let b=Math.hypot(h,f),m=Math.hypot(d,p);return[b*c,m*u]}function Yq(n,t){if(t instanceof ImageData){n.putImageData(t,0,0);return}let e=t.height,r=t.width,i=e%ga,s=(e-i)/ga,a=i===0?s:s+1,o=n.createImageData(r,ga),c=0,u,h=t.data,f=o.data,d,p,g,y;if(t.kind===_S.GRAYSCALE_1BPP){let b=h.byteLength,m=new Uint32Array(f.buffer,0,f.byteLength>>2),w=m.length,A=r+7>>3,_=4294967295,S=Bn.isLittleEndian?4278190080:255;for(d=0;d<a;d++){for(g=d<s?ga:i,u=0,p=0;p<g;p++){let I=b-c,C=0,M=I>A?r:I*8-7,z=M&-8,G=0,Y=0;for(;C<z;C+=8)Y=h[c++],m[u++]=Y&128?_:S,m[u++]=Y&64?_:S,m[u++]=Y&32?_:S,m[u++]=Y&16?_:S,m[u++]=Y&8?_:S,m[u++]=Y&4?_:S,m[u++]=Y&2?_:S,m[u++]=Y&1?_:S;for(;C<M;C++)G===0&&(Y=h[c++],G=128),m[u++]=Y&G?_:S,G>>=1}for(;u<w;)m[u++]=0;n.putImageData(o,0,d*ga)}}else if(t.kind===_S.RGBA_32BPP){for(p=0,y=r*ga*4,d=0;d<s;d++)f.set(h.subarray(c,c+y)),c+=y,n.putImageData(o,0,p),p+=ga;d<a&&(y=r*i*4,f.set(h.subarray(c,c+y)),n.putImageData(o,0,p))}else if(t.kind===_S.RGB_24BPP)for(g=ga,y=r*g,d=0;d<a;d++){for(d>=s&&(g=i,y=r*g),u=0,p=y;p--;)f[u++]=h[c++],f[u++]=h[c++],f[u++]=h[c++],f[u++]=255;n.putImageData(o,0,d*ga)}else throw new Error(`bad image kind: ${t.kind}`)}function Kq(n,t){if(t.bitmap){n.drawImage(t.bitmap,0,0);return}let e=t.height,r=t.width,i=e%ga,s=(e-i)/ga,a=i===0?s:s+1,o=n.createImageData(r,ga),c=0,u=t.data,h=o.data;for(let f=0;f<a;f++){let d=f<s?ga:i;({srcPos:c}=vft({src:u,srcPos:c,dest:h,width:r,height:d,nonBlackColor:0})),n.putImageData(o,0,f*ga)}}function tS(n,t){let e=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(let r of e)n[r]!==void 0&&(t[r]=n[r]);n.setLineDash!==void 0&&(t.setLineDash(n.getLineDash()),t.lineDashOffset=n.lineDashOffset)}function jD(n){n.strokeStyle=n.fillStyle="#000000",n.fillRule="nonzero",n.globalAlpha=1,n.lineWidth=1,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=10,n.globalCompositeOperation="source-over",n.font="10px sans-serif",n.setLineDash!==void 0&&(n.setLineDash([]),n.lineDashOffset=0);let{filter:t}=n;t!=="none"&&t!==""&&(n.filter="none")}function Zq(n,t){if(t)return!0;se.singularValueDecompose2dScale(n,po);let e=Math.fround(fu.pixelRatio*Ef.PDF_TO_CSS_UNITS);return po[0]<=e&&po[1]<=e}function _ft(n){let t=!0,e=r("filename\\*","i").exec(n);if(e){e=e[1];let h=o(e);return h=unescape(h),h=c(h),h=u(h),s(h)}if(e=a(n),e){let h=u(e);return s(h)}if(e=r("filename","i").exec(n),e){e=e[1];let h=o(e);return h=u(h),s(h)}function r(h,f){return new RegExp("(?:^|;)\\s*"+h+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',f)}function i(h,f){if(h){if(!/^[\x00-\xFF]+$/.test(f))return f;try{let d=new TextDecoder(h,{fatal:!0}),p=LT(f);f=d.decode(p),t=!1}catch{}}return f}function s(h){return t&&/[\x80-\xff]/.test(h)&&(h=i("utf-8",h),t&&(h=i("iso-8859-1",h))),h}function a(h){let f=[],d,p=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(d=p.exec(h))!==null;){let[,y,b,m]=d;if(y=parseInt(y,10),y in f){if(y===0)break;continue}f[y]=[b,m]}let g=[];for(let y=0;y<f.length&&y in f;++y){let[b,m]=f[y];m=o(m),b&&(m=unescape(m),y===0&&(m=c(m))),g.push(m)}return g.join("")}function o(h){if(h.startsWith('"')){let f=h.slice(1).split('\\"');for(let d=0;d<f.length;++d){let p=f[d].indexOf('"');p!==-1&&(f[d]=f[d].slice(0,p),f.length=d+1),f[d]=f[d].replaceAll(/\\(.)/g,"$1")}h=f.join('"')}return h}function c(h){let f=h.indexOf("'");if(f===-1)return h;let d=h.slice(0,f),g=h.slice(f+1).replace(/^[^']*'/,"");return i(d,g)}function u(h){return!h.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(h)?h:h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(f,d,p,g){if(p==="q"||p==="Q")return g=g.replaceAll("_"," "),g=g.replaceAll(/=([0-9a-fA-F]{2})/g,function(y,b){return String.fromCharCode(parseInt(b,16))}),i(d,g);try{g=atob(g)}catch{}return i(d,g)})}return""}function YY(n,t){let e=new Headers;if(!n||!t||typeof t!="object")return e;for(let r in t){let i=t[r];i!==void 0&&e.append(r,i)}return e}function RP(n){return URL.parse(n)?.origin??null}function KY({responseHeaders:n,isHttp:t,rangeChunkSize:e,disableRange:r}){let i={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(n.get("Content-Length"),10);return!Number.isInteger(s)||(i.suggestedLength=s,s<=2*e)||r||!t||n.get("Accept-Ranges")!=="bytes"||(n.get("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function ZY(n){let t=n.get("Content-Disposition");if(t){let e=_ft(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if(CP(e))return e}return null}function MT(n,t){return new b0(`Unexpected server response (${n}) while retrieving PDF "${t}".`,n,n===404||n===0&&t.startsWith("file:"))}function JY(n){return n===200||n===206}function QY(n,t,e){return{method:"GET",headers:n,signal:e.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function tK(n){return n instanceof Uint8Array?n.buffer:n instanceof ArrayBuffer?n:(De(`getArrayBuffer - unexpected data format: ${n}`),new Uint8Array(n).buffer)}function Tft(n){let t=n.response;return typeof t!="string"?t:LT(t).buffer}function Rft(n){if(Cft.test(n))return new URL(n);let t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(n))}function sK(n={}){typeof n=="string"||n instanceof URL?n={url:n}:(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});let t=new E6,{docId:e}=t,r=n.url?pft(n.url):null,i=n.data?gft(n.data):null,s=n.httpHeaders||null,a=n.withCredentials===!0,o=n.password??null,c=n.range instanceof kS?n.range:null,u=Number.isInteger(n.rangeChunkSize)&&n.rangeChunkSize>0?n.rangeChunkSize:2**16,h=n.worker instanceof aE?n.worker:null,f=n.verbosity,d=typeof n.docBaseUrl=="string"&&!kT(n.docBaseUrl)?n.docBaseUrl:null,p=kD(n.cMapUrl),g=n.cMapPacked!==!1,y=n.CMapReaderFactory||(Us?j4:kO),b=kD(n.iccUrl),m=kD(n.standardFontDataUrl),w=n.StandardFontDataFactory||(Us?$4:BO),A=kD(n.wasmUrl),_=n.WasmFactory||(Us?H4:jO),S=n.stopAtErrors!==!0,I=Number.isInteger(n.maxImageSize)&&n.maxImageSize>-1?n.maxImageSize:-1,C=n.isEvalSupported!==!1,M=typeof n.isOffscreenCanvasSupported=="boolean"?n.isOffscreenCanvasSupported:!Us,z=typeof n.isImageDecoderSupported=="boolean"?n.isImageDecoderSupported:!Us&&(Bn.platform.isFirefox||!globalThis.chrome),G=Number.isInteger(n.canvasMaxAreaInBytes)?n.canvasMaxAreaInBytes:-1,Y=typeof n.disableFontFace=="boolean"?n.disableFontFace:Us,L=n.fontExtraProperties===!0,j=n.enableXfa===!0,q=n.ownerDocument||globalThis.document,nt=n.disableRange===!0,J=n.disableStream===!0,N=n.disableAutoFetch===!0,D=n.pdfBug===!0,F=n.CanvasFactory||(Us?U4:L4),P=n.FilterFactory||(Us?B4:k4),V=n.enableHWA===!0,$=n.useWasm!==!1,H=c?c.length:n.length??NaN,rt=typeof n.useSystemFonts=="boolean"?n.useSystemFonts:!Us&&!Y,lt=typeof n.useWorkerFetch=="boolean"?n.useWorkerFetch:!!(y===kO&&w===BO&&_===jO&&p&&m&&A&&iS(p,document.baseURI)&&iS(m,document.baseURI)&&iS(A,document.baseURI)),ft=null;nft(f);let K={canvasFactory:new F({ownerDocument:q,enableHWA:V}),filterFactory:new P({docId:e,ownerDocument:q}),cMapReaderFactory:lt?null:new y({baseUrl:p,isCompressed:g}),standardFontDataFactory:lt?null:new w({baseUrl:m}),wasmFactory:lt?null:new _({baseUrl:A})};h||(h=aE.create({verbosity:f,port:al.workerPort}),t._worker=h);let X={docId:e,apiVersion:"5.4.530",data:i,password:o,disableAutoFetch:N,rangeChunkSize:u,length:H,docBaseUrl:d,enableXfa:j,evaluatorOptions:{maxImageSize:I,disableFontFace:Y,ignoreErrors:S,isEvalSupported:C,isOffscreenCanvasSupported:M,isImageDecoderSupported:z,canvasMaxAreaInBytes:G,fontExtraProperties:L,useSystemFonts:rt,useWasm:$,useWorkerFetch:lt,cMapUrl:p,iccUrl:b,standardFontDataUrl:m,wasmUrl:A}},st={ownerDocument:q,pdfBug:D,styleElement:ft,loadingParams:{disableAutoFetch:N,enableXfa:j}};return h.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");let bt=h.messageHandler.sendWithPromise("GetDocRequest",X,i?[i.buffer]:null),wt;if(c)wt=new a6(c,{disableRange:nt,disableStream:J});else if(!i){if(!r)throw new Error("getDocument - no `url` parameter provided.");let Q=iS(r)?c6:Us?m6:d6;wt=new Q({url:r,length:H,httpHeaders:s,withCredentials:a,rangeChunkSize:u,disableRange:nt,disableStream:J})}return bt.then(Q=>{if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");let W=new ey(e,Q,h.port),at=new _6(W,t,wt,st,K,V);t._transport=at,W.send("Ready",null)})}).catch(t._capability.reject),t}function tY(n){return Math.floor(Math.max(0,Math.min(1,n))*255).toString(16).padStart(2,"0")}function rS(n){return Math.max(0,Math.min(255,255*n))}var zD,Us,t4,WD,rft,QAt,fo,bf,RS,Ie,tr,eY,e4,pi,_S,Vn,pw,NT,rE,Qx,rY,_P,x0,SO,TS,nE,b0,r4,Kl,Bn,q3,vf,GD,n4,se,Y3,Mq,Ew,IS,DS,Ph,Jm,Ef,OS,iE,_O,zS,y0,fu,TO,i4,CO,jq,Wd,Gd,qo,Yo,WS,Vd,Dw,Ow,GS,aP,fY,es,dY,pY,gw,sS,kh,a4,VS,ry,Fh,Sf,gY,mY,l4,o4,ny,iy,Pw,sy,Pr,gs,oP,c4,Nw,XS,ms,Lw,VD,M5,u4,Xn,Xd,qS,bn,h4,lP,bY,v0,cP,f4,kw,Xa,Mw,Nn,mi,Fw,Ko,Bw,Zo,ys,qd,Yd,Uw,Kd,Wc,Jo,ay,YS,KS,jw,ZS,Gc,Zd,$w,Jd,Vc,uP,Qd,Hw,JS,tp,oy,zw,ep,QS,ti,Er,Bh,rp,np,t_,Ww,e_,ip,Xc,Uh,r_,n_,Qo,ne,XD,d4,vY,wY,aS,AY,EY,xY,p4,SY,_Y,TY,CY,Ls,Nh,RY,IY,g4,DY,oS,m4,_w,kp,Di,qc,Fl,Gw,Yc,qa,Vw,Kc,ca,jh,ly,Zc,sp,Yl,lS,qD,ks,RO,qi,tl,cy,Qr,i_,uy,Bl,hy,fy,dy,s_,y4,xw,Xw,py,a_,o_,l_,c_,u_,$h,gy,Hh,my,zh,Mp,OY,PY,NY,F5,PS,yy,Ul,hn,Gr,Wh,qw,ap,h_,Yi,by,Gh,el,op,f_,vy,Ya,d_,wy,Vh,Jc,Yw,Kw,rl,Ay,p_,hP,Ee,b4,g_,v4,YD,LY,kY,w4,KD,A4,MY,FY,BY,E4,UY,x4,jY,$Y,HY,S4,cS,Ne,tn,_4,$q,Vo,Hc,IO,T4,Ey,xy,Xh,Ki,fP,zY,NS,m_,DO,Zw,C4,Nr,R4,Jw,Qw,y_,tA,ZD,Tw,OO,lp,Qc,Sy,_y,uS,Cw,PO,eA,rA,nA,iA,Ka,tu,b_,Lr,Fn,kl,JD,hS,Fe,I4,v_,w_,A_,E_,x_,S_,__,T_,Jr,D4,sA,O4,P4,mft,WY,qh,dP,N4,MD,Qn,aA,cl,GY,VY,XY,QD,ey,C_,NO,L4,LO,kO,MO,Ty,oA,Yh,Kh,bs,Cy,Ry,fe,ps,fS,mw,tO,yw,qY,M4,bw,dS,pS,F4,gS,k4,FO,BO,UO,jO,B4,U4,j4,$4,H4,dw,zq,Wq,z4,lA,cp,W4,BD,ua,ha,Iy,jl,Dy,Zh,xr,kr,Jh,fa,R_,cA,Oy,Py,Qh,vs,eu,I_,V4,G4,Vr,Ln,$l,uA,hA,B5,$O,Xo,Qi,LS,q4,Y4,K4,Gq,pP,Z4,Vq,Xq,wft,qq,ga,Z3,po,Sw,J4,HO,Eft,xft,Sft,Jq,Zl,Q4,t6,e6,U5,Iw,D_,O_,al,fA,P_,r6,vw,N_,L_,k_,dA,n6,up,Mr,pA,gA,M_,s6,i6,a6,o6,l6,c6,u6,h6,J3,Q3,f6,d6,p6,g6,Cft,m6,y6,b6,eS,Za,F_,v6,zO,Ift,Qq,hp,Ja,B_,U_,Ny,tf,j_,$_,Ly,H_,mA,fp,yA,z_,bA,ky,W_,G_,vA,My,V_,wA,AA,_f,eK,rK,w6,mo,eO,A6,nK,iK,Xi,sE,Dft,gP,mP,E6,Fy,X_,q_,Y_,K_,kS,x6,ef,By,mS,S6,dp,Hl,rf,Uy,yP,jy,$y,js,rO,aK,oK,yS,EA,nO,un,aE,nf,ru,xA,SA,sf,Hy,bS,_6,pp,T6,gp,zy,Qm,C6,lK,cK,Qa,Wy,_A,yi,Z_,TA,af,J_,mp,zl,Q_,Fr,R6,I6,D6,Ym,uK,zd,la,MS,nu,tT,CA,eT,ty,WO,GO,O6,w0,Oft,A0,Pft,CS,Gy,RA,nl,rT,P6,j5,An,N6,go,Km,hK,fK,FS,L6,xf,k6,M6,F6,VO,B6,U6,nT,j6,BS,to,yp,bP,vP,IA,DA,kn,iu,bp,Vy,OA,PA,su,eo,of,lf,Mn,cf,vp,iT,uf,NA,Xy,wp,Oi,Ap,$e,iO,H6,z6,W6,sO,G6,dK,pK,gK,mK,aO,oO,V6,$6,XO,sT,X6,aT,q6,oT,Y6,lT,qO,K6,Z6,cT,qy,uT,J6,US,YO,Q6,t5,e5,KO,hT,fT,n5,r5,Yy,Ky,LA,Ep,dT,Zy,ro,pT,wf,lO,i5,$5,ZO,$D,no,gT,Jy,io,ei,yK,bK,vK,cO,Af,uO,hO,wK,a5,AK,sn,s5,ue,so,Wl,kA,MA,au,qe,Qy,t0,mT,yT,FA,BA,xp,bT,wP,AP,bi,vS,EK,xK,SK,_K,TK,CK,Mh,JO,UA,e0,hf,vT,ao,wT,qn,EP,RK,QO,AT,ET,xT,Sp,Gl,$s,IK,fO,DK,OK,o5,jS,ST,jA,l5,$S,c5,$A,_T,ff,r0,TT,da,CT,RT,n0,oo,lo,Zi,HA,zA,ws,WA,il,IT,je,u5,dO,PK,NK,LK,h5,Zm,ll,ww,kK,pO,gO,MK,FK,BK,UK,jK,fr,tP,i0,eP,co,GA,Pi,s0,a0,or,f5,d5,p5,wS,$K,mO,AS,Aw,Qe,rP,ou,Ni,Li,o0,VA,Ms,Ji,sl,l0,c0,u0,XA,yO,g5,Fs,DT,OT,uo,lu,cu,qA,YA,h0,ts,Lh,HK,zK,WK,E0,nP,xP,GK,Rw,m5,HS,HD,nS,f0,mr,y5,Vl,VK,XK,b5,bO,qK,YK,KK,v5,w5,ZK,ol,A5,E5,_p,uu,Tp,d0,Va,x5,fn,ki,Cp,df,Rp,KA,pf,p0,hu,ho,ZA,lr,xS,SS,vO,wO,AO,S5,EO,JK,ES,g0,JA,Ip,Dp,gf,pa,Op,QA,tE,Xl,mf,Mi,yf,Pp,eE,me,Np,Xr,_5,QK,zc,T5,C5,xO,Ml,iP,ql,Bs,m0,PT,SP,tZ,du,R5,eZ,I5,gi,sP,H5=br(()=>{Tt();Rt();Ct();zD={};zD.d=(n,t)=>{for(var e in t)zD.o(t,e)&&!zD.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})};zD.o=(n,t)=>Object.prototype.hasOwnProperty.call(n,t);Us=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),t4=[.001,0,0,.001,0,0],WD=1.35,rft=.35,QAt=rft/WD,fo={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},bf={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},RS="pdfjs_internal_editor_",Ie={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},tr={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},eY={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},e4={TRIANGLES:1,LATTICE:2,PATCH:3},pi={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},_S={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Vn={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},pw={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},NT={ERRORS:0,WARNINGS:1,INFOS:5},rE={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},Qx={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},rY={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},_P=NT.WARNINGS;x0=(function(){function t(e,r){this.message=e,this.name=r}return t.prototype=new Error,t.constructor=t,t})(),SO=class extends x0{constructor(t,e){super(t,"PasswordException"),this.code=e}},TS=class extends x0{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},nE=class extends x0{constructor(t){super(t,"InvalidPDFException")}},b0=class extends x0{constructor(t,e,r){super(t,"ResponseException"),this.status=e,this.missing=r}},r4=class extends x0{constructor(t){super(t,"FormatError")}},Kl=class extends x0{constructor(t){super(t,"AbortException")}};Bn=class{static get isLittleEndian(){return Ce(this,"isLittleEndian",oft())}static get isEvalSupported(){return Ce(this,"isEvalSupported",lft())}static get isOffscreenCanvasSupported(){return Ce(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Ce(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return Ce(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return Ce(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){let{platform:t,userAgent:e}=navigator;return Ce(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){return Ce(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}},q3=Array.from(Array(256).keys(),n=>n.toString(16).padStart(2,"0")),se=class{static makeHexColor(t,e,r){return`#${q3[t]}${q3[e]}${q3[r]}`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,e){let r;t[0]?(t[0]<0&&(r=e[0],e[0]=e[2],e[2]=r),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(r=e[1],e[1]=e[3],e[3]=r),e[1]*=t[3],e[3]*=t[3]):(r=e[0],e[0]=e[1],e[1]=r,r=e[2],e[2]=e[3],e[3]=r,t[1]<0&&(r=e[1],e[1]=e[3],e[3]=r),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(r=e[0],e[0]=e[2],e[2]=r),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,r=0){let i=t[r],s=t[r+1];t[r]=i*e[0]+s*e[2]+e[4],t[r+1]=i*e[1]+s*e[3]+e[5]}static applyTransformToBezier(t,e,r=0){let i=e[0],s=e[1],a=e[2],o=e[3],c=e[4],u=e[5];for(let h=0;h<6;h+=2){let f=t[r+h],d=t[r+h+1];t[r+h]=f*i+d*a+c,t[r+h+1]=f*s+d*o+u}}static applyInverseTransform(t,e){let r=t[0],i=t[1],s=e[0]*e[3]-e[1]*e[2];t[0]=(r*e[3]-i*e[2]+e[2]*e[5]-e[4]*e[3])/s,t[1]=(-r*e[1]+i*e[0]+e[4]*e[1]-e[5]*e[0])/s}static axialAlignedBoundingBox(t,e,r){let i=e[0],s=e[1],a=e[2],o=e[3],c=e[4],u=e[5],h=t[0],f=t[1],d=t[2],p=t[3],g=i*h+c,y=g,b=i*d+c,m=b,w=o*f+u,A=w,_=o*p+u,S=_;if(s!==0||a!==0){let I=s*h,C=s*d,M=a*f,z=a*p;g+=M,m+=M,b+=z,y+=z,w+=I,S+=I,_+=C,A+=C}r[0]=Math.min(r[0],g,b,y,m),r[1]=Math.min(r[1],w,_,A,S),r[2]=Math.max(r[2],g,b,y,m),r[3]=Math.max(r[3],w,_,A,S)}static inverseTransform(t){let e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){let r=t[0],i=t[1],s=t[2],a=t[3],o=r**2+i**2,c=r*s+i*a,u=s**2+a**2,h=(o+u)/2,f=Math.sqrt(h**2-(o*u-c**2));e[0]=Math.sqrt(h+f||1),e[1]=Math.sqrt(h-f||1)}static normalizeRect(t){let e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){let r=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(r>i)return null;let s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>a?null:[r,s,i,a]}static pointBoundingBox(t,e,r){r[0]=Math.min(r[0],t),r[1]=Math.min(r[1],e),r[2]=Math.max(r[2],t),r[3]=Math.max(r[3],e)}static rectBoundingBox(t,e,r,i,s){s[0]=Math.min(s[0],t,r),s[1]=Math.min(s[1],e,i),s[2]=Math.max(s[2],t,r),s[3]=Math.max(s[3],e,i)}static bezierBoundingBox(t,e,r,i,s,a,o,c,u){u[0]=Math.min(u[0],t,o),u[1]=Math.min(u[1],e,c),u[2]=Math.max(u[2],t,o),u[3]=Math.max(u[3],e,c),R(this,vf,n4).call(this,t,r,s,o,e,i,a,c,3*(-t+3*(r-s)+o),6*(t-2*r+s),3*(r-t),u),R(this,vf,n4).call(this,t,r,s,o,e,i,a,c,3*(-e+3*(i-a)+c),6*(e-2*i+a),3*(i-e),u)}};vf=new WeakSet,GD=function(t,e,r,i,s,a,o,c,u,h){if(u<=0||u>=1)return;let f=1-u,d=u*u,p=d*u,g=f*(f*(f*t+3*u*e)+3*d*r)+p*i,y=f*(f*(f*s+3*u*a)+3*d*o)+p*c;h[0]=Math.min(h[0],g),h[1]=Math.min(h[1],y),h[2]=Math.max(h[2],g),h[3]=Math.max(h[3],y)},n4=function(t,e,r,i,s,a,o,c,u,h,f,d){if(Math.abs(u)<1e-12){Math.abs(h)>=1e-12&&R(this,vf,GD).call(this,t,e,r,i,s,a,o,c,-f/h,d);return}let p=h**2-4*f*u;if(p<0)return;let g=Math.sqrt(p),y=2*u;R(this,vf,GD).call(this,t,e,r,i,s,a,o,c,(-h+g)/y,d),R(this,vf,GD).call(this,t,e,r,i,s,a,o,c,(-h-g)/y,d)},T(se,vf);Y3=null,Mq=null;Ew="pdfjs_internal_id_";typeof Promise.try!="function"&&(Promise.try=function(n,...t){return new Promise(e=>{e(n(...t))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(n){return n.reduce((t,e)=>t+e,0)});IS=class n{static textContent(t){let e=[],r={items:e,styles:Object.create(null)};function i(s){if(!s)return;let a=null,o=s.name;if(o==="#text")a=s.value;else if(n.shouldBuildText(o))s?.attributes?.textContent?a=s.attributes.textContent:s.value&&(a=s.value);else return;if(a!==null&&e.push({str:a}),!!s.children)for(let c of s.children)i(c)}return i(t),r}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}},DS=class{static setupStorage(t,e,r,i,s){let a=i.getValue(e,{value:null});switch(r.name){case"textarea":if(a.value!==null&&(t.textContent=a.value),s==="print")break;t.addEventListener("input",o=>{i.setValue(e,{value:o.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(a.value===r.attributes.xfaOn?t.setAttribute("checked",!0):a.value===r.attributes.xfaOff&&t.removeAttribute("checked"),s==="print")break;t.addEventListener("change",o=>{i.setValue(e,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&t.setAttribute("value",a.value),s==="print")break;t.addEventListener("input",o=>{i.setValue(e,{value:o.target.value})})}break;case"select":if(a.value!==null){t.setAttribute("value",a.value);for(let o of r.children)o.attributes.value===a.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}t.addEventListener("input",o=>{let c=o.target.options,u=c.selectedIndex===-1?"":c[c.selectedIndex].value;i.setValue(e,{value:u})});break}}static setAttributes({html:t,element:e,storage:r=null,intent:i,linkService:s}){let{attributes:a}=e,o=t instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${i}`);for(let[c,u]of Object.entries(a))if(u!=null)switch(c){case"class":u.length&&t.setAttribute(c,u.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",u);break;case"style":Object.assign(t.style,u);break;case"textContent":t.textContent=u;break;default:(!o||c!=="href"&&c!=="newWindow")&&t.setAttribute(c,u)}o&&s.addLinkAttributes(t,a.href,a.newWindow),r&&a.dataId&&this.setupStorage(t,a.dataId,e,r)}static render(t){let e=t.annotationStorage,r=t.linkService,i=t.xfaHtml,s=t.intent||"display",a=document.createElement(i.name);i.attributes&&this.setAttributes({html:a,element:i,intent:s,linkService:r});let o=s!=="richText",c=t.div;if(c.append(a),t.viewport){let f=`matrix(${t.viewport.transform.join(",")})`;c.style.transform=f}o&&c.setAttribute("class","xfaLayer xfaFont");let u=[];if(i.children.length===0){if(i.value){let f=document.createTextNode(i.value);a.append(f),o&&IS.shouldBuildText(i.name)&&u.push(f)}return{textDivs:u}}let h=[[i,-1,a]];for(;h.length>0;){let[f,d,p]=h.at(-1);if(d+1===f.children.length){h.pop();continue}let g=f.children[++h.at(-1)[1]];if(g===null)continue;let{name:y}=g;if(y==="#text"){let m=document.createTextNode(g.value);u.push(m),p.append(m);continue}let b=g?.attributes?.xmlns?document.createElementNS(g.attributes.xmlns,y):document.createElement(y);if(p.append(b),g.attributes&&this.setAttributes({html:b,element:g,storage:e,intent:s,linkService:r}),g.children?.length>0)h.push([g,-1,b]);else if(g.value){let m=document.createTextNode(g.value);o&&IS.shouldBuildText(y)&&u.push(m),b.append(m)}}for(let f of c.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))f.setAttribute("readOnly",!0);return{textDivs:u}}static update(t){let e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}},Ph="http://www.w3.org/2000/svg",Jm=class Jm{};Lt(Jm,"CSS",96),Lt(Jm,"PDF",72),Lt(Jm,"PDF_TO_CSS_UNITS",Jm.CSS/Jm.PDF);Ef=Jm;OS=class n{constructor({viewBox:t,userUnit:e,scale:r,rotation:i,offsetX:s=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=t,this.userUnit=e,this.scale=r,this.rotation=i,this.offsetX=s,this.offsetY=a,r*=e;let c=(t[2]+t[0])/2,u=(t[3]+t[1])/2,h,f,d,p;switch(i%=360,i<0&&(i+=360),i){case 180:h=-1,f=0,d=0,p=1;break;case 90:h=0,f=1,d=1,p=0;break;case 270:h=0,f=-1,d=-1,p=0;break;case 0:h=1,f=0,d=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(d=-d,p=-p);let g,y,b,m;h===0?(g=Math.abs(u-t[1])*r+s,y=Math.abs(c-t[0])*r+a,b=(t[3]-t[1])*r,m=(t[2]-t[0])*r):(g=Math.abs(c-t[0])*r+s,y=Math.abs(u-t[1])*r+a,b=(t[2]-t[0])*r,m=(t[3]-t[1])*r),this.transform=[h*r,f*r,d*r,p*r,g-h*r*c-d*r*u,y-f*r*c-p*r*u],this.width=b,this.height=m}get rawDims(){let t=this.viewBox;return Ce(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:s=!1}={}){return new n({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:s})}convertToViewportPoint(t,e){let r=[t,e];return se.applyTransform(r,this.transform),r}convertToViewportRectangle(t){let e=[t[0],t[1]];se.applyTransform(e,this.transform);let r=[t[2],t[3]];return se.applyTransform(r,this.transform),[e[0],e[1],r[0],r[1]]}convertToPdfPoint(t,e){let r=[t,e];return se.applyInverseTransform(r,this.transform),r}},iE=class extends x0{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}};_O=class{constructor(){Lt(this,"started",Object.create(null));Lt(this,"times",[])}time(t){t in this.started&&De(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||De(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){let t=[],e=0;for(let{name:r}of this.times)e=Math.max(r.length,e);for(let{name:r,start:i,end:s}of this.times)t.push(`${r.padEnd(e)} ${s-i}ms
107
+ `);return t.join("")}};y0=class{static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;l(this,zS)||x(this,zS,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));let e=l(this,zS).exec(t);if(!e)return null;let r=parseInt(e[1],10),i=parseInt(e[2],10);i=i>=1&&i<=12?i-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let c=parseInt(e[6],10);c=c>=0&&c<=59?c:0;let u=e[7]||"Z",h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let f=parseInt(e[9],10)||0;return f=f>=0&&f<=59?f:0,u==="-"?(a+=h,o+=f):u==="+"&&(a-=h,o-=f),new Date(Date.UTC(r,i,s,a,o,c))}};zS=new WeakMap,T(y0,zS);fu=class n{constructor(){let{pixelRatio:t}=n;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,r,i,s=-1){let a=1/0,o=1/0,c=1/0;r=n.capPixels(r,s),r>0&&(a=Math.sqrt(r/(t*e))),i!==-1&&(o=i/t,c=i/e);let u=Math.min(a,o,c);return this.sx>u||this.sy>u?(this.sx=u,this.sy=u,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){let r=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,r):r}return t}},TO=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"],i4=class{static get isDarkMode(){return Ce(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}},CO=class{static get commentForegroundColor(){let t=document.createElement("span");t.classList.add("comment","sidebar");let{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);let{color:r}=window.getComputedStyle(t);return t.remove(),Ce(this,"commentForegroundColor",lE(r))}};jq=new Map;kh=class kh{constructor(t){T(this,es);T(this,Wd,null);T(this,Gd,null);T(this,qo);T(this,Yo,null);T(this,WS,null);T(this,Vd,null);T(this,Dw,null);T(this,Ow,null);x(this,qo,t),l(kh,GS)||x(kh,GS,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 t=x(this,Wd,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");let e=l(this,qo)._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",yo,{signal:e}),t.addEventListener("pointerdown",R(kh,aP,fY),{signal:e}));let r=x(this,Yo,document.createElement("div"));r.className="buttons",t.append(r);let i=l(this,qo).toolbarPosition;if(i){let{style:s}=t,a=l(this,qo)._uiManager.direction==="ltr"?1-i[0]:i[0];s.insetInlineEnd=`${100*a}%`,s.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return l(this,Wd)}hide(){l(this,Wd).classList.add("hidden"),l(this,Gd)?.hideDropdown()}show(){l(this,Wd).classList.remove("hidden"),l(this,WS)?.shown(),l(this,Vd)?.shown()}addDeleteButton(){let{editorType:t,_uiManager:e}=l(this,qo),r=document.createElement("button");r.classList.add("basic","deleteButton"),r.tabIndex=0,r.setAttribute("data-l10n-id",l(kh,GS)[t]),R(this,es,gw).call(this,r)&&r.addEventListener("click",i=>{e.delete()},{signal:e._signal}),l(this,Yo).append(r)}async addAltText(t){let e=await t.render();R(this,es,gw).call(this,e),l(this,Yo).append(e,l(this,es,sS)),x(this,WS,t)}addComment(t,e=null){if(l(this,Vd))return;let r=t.renderForToolbar();if(!r)return;R(this,es,gw).call(this,r);let i=x(this,Dw,l(this,es,sS));e?(l(this,Yo).insertBefore(r,e),l(this,Yo).insertBefore(i,e)):l(this,Yo).append(r,i),x(this,Vd,t),t.toolbar=this}addColorPicker(t){if(l(this,Gd))return;x(this,Gd,t);let e=t.renderButton();R(this,es,gw).call(this,e),l(this,Yo).append(e,l(this,es,sS))}async addEditSignatureButton(t){let e=x(this,Ow,await t.renderEditButton(l(this,qo)));R(this,es,gw).call(this,e),l(this,Yo).append(e,l(this,es,sS))}removeButton(t){switch(t){case"comment":l(this,Vd)?.removeToolbarCommentButton(),x(this,Vd,null),l(this,Dw)?.remove(),x(this,Dw,null);break}}async addButton(t,e){switch(t){case"colorPicker":e&&this.addColorPicker(e);break;case"altText":e&&await this.addAltText(e);break;case"editSignature":e&&await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":e&&this.addComment(e);break}}async addButtonBefore(t,e,r){if(!e&&t==="comment")return;let i=l(this,Yo).querySelector(r);i&&t==="comment"&&this.addComment(e,i)}updateEditSignatureButton(t){l(this,Ow)&&(l(this,Ow).title=t)}remove(){l(this,Wd).remove(),l(this,Gd)?.destroy(),x(this,Gd,null)}};Wd=new WeakMap,Gd=new WeakMap,qo=new WeakMap,Yo=new WeakMap,WS=new WeakMap,Vd=new WeakMap,Dw=new WeakMap,Ow=new WeakMap,GS=new WeakMap,aP=new WeakSet,fY=function(t){t.stopPropagation()},es=new WeakSet,dY=function(t){l(this,qo)._focusEventsAllowed=!1,wn(t)},pY=function(t){l(this,qo)._focusEventsAllowed=!0,wn(t)},gw=function(t){let e=l(this,qo)._uiManager._signal;return!(e instanceof AbortSignal)||e.aborted?!1:(t.addEventListener("focusin",R(this,es,dY).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",R(this,es,pY).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",yo,{signal:e}),!0)},sS=function(){let t=document.createElement("div");return t.className="divider",t},T(kh,aP),T(kh,GS,null);a4=kh,o4=class{constructor(t){T(this,Sf);T(this,VS,null);T(this,ry,null);T(this,Fh);x(this,Fh,t)}show(t,e,r){let[i,s]=R(this,Sf,mY).call(this,e,r),{style:a}=l(this,ry)||x(this,ry,R(this,Sf,gY).call(this));t.append(l(this,ry)),a.insetInlineEnd=`${100*i}%`,a.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){l(this,ry).remove()}};VS=new WeakMap,ry=new WeakMap,Fh=new WeakMap,Sf=new WeakSet,gY=function(){let t=x(this,ry,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");let e=l(this,Fh)._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",yo,{signal:e});let r=x(this,VS,document.createElement("div"));return r.className="buttons",t.append(r),l(this,Fh).hasCommentManager()&&R(this,Sf,l4).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{l(this,Fh).commentSelection("floating_button")}),R(this,Sf,l4).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{l(this,Fh).highlightSelection("floating_button")}),t},mY=function(t,e){let r=0,i=0;for(let s of t){let a=s.y+s.height;if(a<r)continue;let o=s.x+(e?s.width:0);if(a>r){i=o,r=a;continue}e?o>i&&(i=o):o<i&&(i=o)}return[e?1-i:i,r]},l4=function(t,e,r,i){let s=document.createElement("button");s.classList.add("basic",t),s.tabIndex=0,s.setAttribute("data-l10n-id",e);let a=document.createElement("span");s.append(a),a.className="visuallyHidden",a.setAttribute("data-l10n-id",r);let o=l(this,Fh)._signal;o instanceof AbortSignal&&!o.aborted&&(s.addEventListener("contextmenu",yo,{signal:o}),s.addEventListener("click",i,{signal:o})),l(this,VS).append(s)};Pr=class Pr{static initializeAndAddPointerId(t){(l(Pr,iy)||x(Pr,iy,new Set)).add(t)}static setPointer(t,e){l(Pr,ny)||x(Pr,ny,e),l(Pr,sy)??x(Pr,sy,t)}static setTimeStamp(t){x(Pr,Pw,t)}static isSamePointerId(t){return l(Pr,ny)===t}static isSamePointerIdOrRemove(t){return l(Pr,ny)===t?!0:(l(Pr,iy)?.delete(t),!1)}static isSamePointerType(t){return l(Pr,sy)===t}static isInitializedAndDifferentPointerType(t){return l(Pr,sy)!==null&&!Pr.isSamePointerType(t)}static isSameTimeStamp(t){return l(Pr,Pw)===t}static isUsingMultiplePointers(){return l(Pr,iy)?.size>=1}static clearPointerType(){x(Pr,sy,null)}static clearPointerIds(){x(Pr,ny,NaN),x(Pr,iy,null)}static clearTimeStamp(){x(Pr,Pw,NaN)}};ny=new WeakMap,iy=new WeakMap,Pw=new WeakMap,sy=new WeakMap,T(Pr,ny,NaN),T(Pr,iy,null),T(Pr,Pw,NaN),T(Pr,sy,null);gs=Pr,c4=class{constructor(){T(this,oP,0)}get id(){return`${RS}${ze(this,oP)._++}`}};oP=new WeakMap;M5=class M5{constructor(){T(this,Lw);T(this,Nw,P5());T(this,XS,0);T(this,ms,null)}static get _isSVGFittingCanvas(){let t='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>',r=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=t;let s=i.decode().then(()=>(r.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(r.getImageData(0,0,1,1).data.buffer)[0]===0));return Ce(this,"_isSVGFittingCanvas",s)}async getFromFile(t){let{lastModified:e,name:r,size:i,type:s}=t;return R(this,Lw,VD).call(this,`${e}_${r}_${i}_${s}`,t)}async getFromUrl(t){return R(this,Lw,VD).call(this,t,t)}async getFromBlob(t,e){let r=await e;return R(this,Lw,VD).call(this,t,r)}async getFromId(t){l(this,ms)||x(this,ms,new Map);let e=l(this,ms).get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){let{blobPromise:r}=e;return delete e.blobPromise,this.getFromBlob(e.id,r)}return this.getFromUrl(e.url)}getFromCanvas(t,e){l(this,ms)||x(this,ms,new Map);let r=l(this,ms).get(t);if(r?.bitmap)return r.refCounter+=1,r;let i=new OffscreenCanvas(e.width,e.height);return i.getContext("2d").drawImage(e,0,0),r={bitmap:i.transferToImageBitmap(),id:`image_${l(this,Nw)}_${ze(this,XS)._++}`,refCounter:1,isSvg:!1},l(this,ms).set(t,r),l(this,ms).set(r.id,r),r}getSvgUrl(t){let e=l(this,ms).get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){l(this,ms)||x(this,ms,new Map);let e=l(this,ms).get(t);if(!e||(e.refCounter-=1,e.refCounter!==0))return;let{bitmap:r}=e;if(!e.url&&!e.file){let i=new OffscreenCanvas(r.width,r.height);i.getContext("bitmaprenderer").transferFromImageBitmap(r),e.blobPromise=i.convertToBlob()}r.close?.(),e.bitmap=null}isValidId(t){return t.startsWith(`image_${l(this,Nw)}_`)}};Nw=new WeakMap,XS=new WeakMap,ms=new WeakMap,Lw=new WeakSet,VD=async function(t,e){l(this,ms)||x(this,ms,new Map);let r=l(this,ms).get(t);if(r===null)return null;if(r?.bitmap)return r.refCounter+=1,r;try{r||(r={bitmap:null,id:`image_${l(this,Nw)}_${ze(this,XS)._++}`,refCounter:0,isSvg:!1});let i;if(typeof e=="string"?(r.url=e,i=await oE(e,"blob")):e instanceof File?i=r.file=e:e instanceof Blob&&(i=e),i.type==="image/svg+xml"){let s=M5._isSVGFittingCanvas,a=new FileReader,o=new Image,c=new Promise((u,h)=>{o.onload=()=>{r.bitmap=o,r.isSvg=!0,u()},a.onload=async()=>{let f=r.svgUrl=a.result;o.src=await s?`${f}#svgView(preserveAspectRatio(none))`:f},o.onerror=a.onerror=h});a.readAsDataURL(i),await c}else r.bitmap=await createImageBitmap(i);r.refCounter=1}catch(i){De(i),r=null}return l(this,ms).set(t,r),r&&l(this,ms).set(r.id,r),r};u4=M5,h4=class{constructor(t=128){T(this,Xn,[]);T(this,Xd,!1);T(this,qS);T(this,bn,-1);x(this,qS,t)}add({cmd:t,undo:e,post:r,mustExec:i,type:s=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(i&&t(),l(this,Xd))return;let c={cmd:t,undo:e,post:r,type:s};if(l(this,bn)===-1){l(this,Xn).length>0&&(l(this,Xn).length=0),x(this,bn,0),l(this,Xn).push(c);return}if(a&&l(this,Xn)[l(this,bn)].type===s){o&&(c.undo=l(this,Xn)[l(this,bn)].undo),l(this,Xn)[l(this,bn)]=c;return}let u=l(this,bn)+1;u===l(this,qS)?l(this,Xn).splice(0,1):(x(this,bn,u),u<l(this,Xn).length&&l(this,Xn).splice(u)),l(this,Xn).push(c)}undo(){if(l(this,bn)===-1)return;x(this,Xd,!0);let{undo:t,post:e}=l(this,Xn)[l(this,bn)];t(),e?.(),x(this,Xd,!1),x(this,bn,l(this,bn)-1)}redo(){if(l(this,bn)<l(this,Xn).length-1){x(this,bn,l(this,bn)+1),x(this,Xd,!0);let{cmd:t,post:e}=l(this,Xn)[l(this,bn)];t(),e?.(),x(this,Xd,!1)}}hasSomethingToUndo(){return l(this,bn)!==-1}hasSomethingToRedo(){return l(this,bn)<l(this,Xn).length-1}cleanType(t){if(l(this,bn)!==-1){for(let e=l(this,bn);e>=0;e--)if(l(this,Xn)[e].type!==t){l(this,Xn).splice(e+1,l(this,bn)-e),x(this,bn,e);return}l(this,Xn).length=0,x(this,bn,-1)}}destroy(){x(this,Xn,null)}};Xn=new WeakMap,Xd=new WeakMap,qS=new WeakMap,bn=new WeakMap;v0=class{constructor(t){T(this,lP);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:e}=Bn.platform;for(let[r,i,s={}]of t)for(let a of r){let o=a.startsWith("mac+");e&&o?(this.callbacks.set(a.slice(4),{callback:i,options:s}),this.allKeys.add(a.split("+").at(-1))):!e&&!o&&(this.callbacks.set(a,{callback:i,options:s}),this.allKeys.add(a.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;let r=this.callbacks.get(R(this,lP,bY).call(this,e));if(!r)return;let{callback:i,options:{bubbles:s=!1,args:a=[],checker:o=null}}=r;o&&!o(t,e)||(i.bind(t,...a,e)(),s||wn(e))}};lP=new WeakSet,bY=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);let e=this.buffer.join("+");return this.buffer.length=0,e};cP=class cP{get _colors(){let t=new Map([["CanvasText",null],["Canvas",null]]);return dft(t),Ce(this,"_colors",t)}convert(t){let e=lE(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(let[r,i]of this._colors)if(i.every((s,a)=>s===e[a]))return cP._colorsMapping.get(r);return e}getHexCode(t){let e=this._colors.get(t);return e?se.makeHexColor(...e):t}};Lt(cP,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));f4=cP,_w=class _w{constructor(t,e,r,i,s,a,o,c,u,h,f,d,p,g,y,b){T(this,ne);T(this,kw,new AbortController);T(this,Xa,null);T(this,Mw,null);T(this,Nn,new Map);T(this,mi,new Map);T(this,Fw,null);T(this,Ko,null);T(this,Bw,null);T(this,Zo,new h4);T(this,ys,null);T(this,qd,null);T(this,Yd,null);T(this,Uw,0);T(this,Kd,new Set);T(this,Wc,null);T(this,Jo,null);T(this,ay,new Set);Lt(this,"_editorUndoBar",null);T(this,YS,!1);T(this,KS,!1);T(this,jw,!1);T(this,ZS,null);T(this,Gc,null);T(this,Zd,null);T(this,$w,null);T(this,Jd,!1);T(this,Vc,null);T(this,uP,new c4);T(this,Qd,!1);T(this,Hw,!1);T(this,JS,!1);T(this,tp,null);T(this,oy,null);T(this,zw,null);T(this,ep,null);T(this,QS,null);T(this,ti,Ie.NONE);T(this,Er,new Set);T(this,Bh,null);T(this,rp,null);T(this,np,null);T(this,t_,null);T(this,Ww,null);T(this,e_,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});T(this,ip,[0,0]);T(this,Xc,null);T(this,Uh,null);T(this,r_,null);T(this,n_,null);T(this,Qo,null);let m=this._signal=l(this,kw).signal;x(this,Uh,t),x(this,r_,e),x(this,n_,r),x(this,Fw,i),x(this,ys,s),x(this,rp,a),x(this,Ww,c),this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:m}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:m}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:m}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:m}),o._on("setpreference",this.onSetPreference.bind(this),{signal:m}),o._on("switchannotationeditorparams",w=>this.updateParams(w.type,w.value),{signal:m}),window.addEventListener("pointerdown",()=>{x(this,Hw,!0)},{capture:!0,signal:m}),window.addEventListener("pointerup",()=>{x(this,Hw,!1)},{capture:!0,signal:m}),R(this,ne,AY).call(this),R(this,ne,CY).call(this),R(this,ne,p4).call(this),x(this,Ko,c.annotationStorage),x(this,ZS,c.filterFactory),x(this,np,u),x(this,$w,h||null),x(this,YS,f),x(this,KS,d),x(this,jw,p),x(this,QS,g||null),this.viewParameters={realScale:Ef.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=y||null,this._supportsPinchToZoom=b!==!1,s?.setSidebarUiManager(this)}static get _keyboardManager(){let t=_w.prototype,e=a=>l(a,Uh).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),r=(a,{target:o})=>{if(o instanceof HTMLInputElement){let{type:c}=o;return c!=="text"&&c!=="number"}return!0},i=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return Ce(this,"_keyboardManager",new v0([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],t.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:r}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&l(a,Uh).contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&l(a,Uh).contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}]]))}destroy(){l(this,Qo)?.resolve(),x(this,Qo,null),l(this,kw)?.abort(),x(this,kw,null),this._signal=null;for(let t of l(this,mi).values())t.destroy();l(this,mi).clear(),l(this,Nn).clear(),l(this,ay).clear(),l(this,ep)?.clear(),x(this,Xa,null),l(this,Er).clear(),l(this,Zo).destroy(),l(this,Fw)?.destroy(),l(this,ys)?.destroy(),l(this,rp)?.destroy(),l(this,Vc)?.hide(),x(this,Vc,null),l(this,zw)?.destroy(),x(this,zw,null),x(this,Mw,null),l(this,Gc)&&(clearTimeout(l(this,Gc)),x(this,Gc,null)),l(this,Xc)&&(clearTimeout(l(this,Xc)),x(this,Xc,null)),this._editorUndoBar?.destroy(),x(this,Ww,null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return l(this,QS)}get useNewAltTextFlow(){return l(this,KS)}get useNewAltTextWhenAddingImage(){return l(this,jw)}get hcmFilter(){return Ce(this,"hcmFilter",l(this,np)?l(this,ZS).addHCMFilter(l(this,np).foreground,l(this,np).background):"none")}get direction(){return Ce(this,"direction",getComputedStyle(l(this,Uh)).direction)}get _highlightColors(){return Ce(this,"_highlightColors",l(this,$w)?new Map(l(this,$w).split(",").map(t=>(t=t.split("=").map(e=>e.trim()),t[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){let{_highlightColors:t}=this;if(!t)return Ce(this,"highlightColors",null);let e=new Map,r=!!l(this,np);for(let[i,s]of t){let a=i.endsWith("_HCM");if(r&&a){e.set(i.replace("_HCM",""),s);continue}!r&&!a&&e.set(i,s)}return Ce(this,"highlightColors",e)}get highlightColorNames(){return Ce(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;let e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),x(this,Yd,t)}setMainHighlightColorPicker(t){x(this,zw,t)}editAltText(t,e=!1){l(this,Fw)?.editAltText(this,t,e)}hasCommentManager(){return!!l(this,ys)}editComment(t,e,r,i){l(this,ys)?.showDialog(this,t,e,r,i)}selectComment(t,e){l(this,mi).get(t)?.getEditorByUID(e)?.toggleComment(!0,!0)}updateComment(t){l(this,ys)?.updateComment(t.getData())}updatePopupColor(t){l(this,ys)?.updatePopupColor(t)}removeComment(t){l(this,ys)?.removeComments([t.uid])}toggleComment(t,e,r=void 0){l(this,ys)?.toggleCommentPopup(t,e,r)}makeCommentColor(t,e){return t&&l(this,ys)?.makeCommentColor(t,e)||null}getCommentDialogElement(){return l(this,ys)?.dialogElement||null}async waitForEditorsRendered(t){if(l(this,mi).has(t-1))return;let{resolve:e,promise:r}=Promise.withResolvers(),i=s=>{s.pageNumber===t&&(this._eventBus._off("editorsrendered",i),e())};this._eventBus.on("editorsrendered",i),await r}getSignature(t){l(this,rp)?.getSignature({uiManager:this,editor:t})}get signatureManager(){return l(this,rp)}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){switch(t){case"enableNewAltTextWhenAddingImage":x(this,jw,e);break}}onPageChanging({pageNumber:t}){x(this,Uw,t-1)}focusMainContainer(){l(this,Uh).focus()}findParent(t,e){for(let r of l(this,mi).values()){let{x:i,y:s,width:a,height:o}=r.div.getBoundingClientRect();if(t>=i&&t<=i+a&&e>=s&&e<=s+o)return r}return null}disableUserSelect(t=!1){l(this,r_).classList.toggle("noUserSelect",t)}addShouldRescale(t){l(this,ay).add(t)}removeShouldRescale(t){l(this,ay).delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*Ef.PDF_TO_CSS_UNITS;for(let e of l(this,ay))e.onScaleChanging();l(this,Yd)?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t="",e=!1){let r=document.getSelection();if(!r||r.isCollapsed)return;let{anchorNode:i,anchorOffset:s,focusNode:a,focusOffset:o}=r,c=r.toString(),h=R(this,ne,XD).call(this,r).closest(".textLayer"),f=this.getSelectionBoxes(h);if(!f)return;r.empty();let d=R(this,ne,d4).call(this,h),p=l(this,ti)===Ie.NONE,g=()=>{let y=d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:f,anchorNode:i,anchorOffset:s,focusNode:a,focusOffset:o,text:c});p&&this.showAllEditors("highlight",!0,!0),e&&y?.editComment()};if(p){this.switchToMode(Ie.HIGHLIGHT,g);return}g()}commentSelection(t=""){this.highlightSelection(t,!0)}getAndRemoveDataFromAnnotationStorage(t){if(!l(this,Ko))return null;let e=`${RS}${t}`,r=l(this,Ko).getRawValue(e);return r&&l(this,Ko).remove(e),r}addToAnnotationStorage(t){!t.isEmpty()&&l(this,Ko)&&!l(this,Ko).has(t.id)&&l(this,Ko).setValue(t.id,t)}a11yAlert(t,e=null){let r=l(this,n_);r&&(r.setAttribute("data-l10n-id",t),e?r.setAttribute("data-l10n-args",JSON.stringify(e)):r.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,l(this,Jd)&&(x(this,Jd,!1),R(this,ne,aS).call(this,"main_toolbar")),!this.hasSelection)return;let{activeElement:t}=document;for(let e of l(this,Er))if(e.div.contains(t)){x(this,oy,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!l(this,oy))return;let[t,e]=l(this,oy);x(this,oy,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){R(this,ne,p4).call(this),this.setEditingState(!0)}removeEditListeners(){R(this,ne,SY).call(this),this.setEditingState(!1)}dragOver(t){for(let{type:e}of t.dataTransfer.items)for(let r of l(this,Jo))if(r.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(let e of t.dataTransfer.items)for(let r of l(this,Jo))if(r.isHandlingMimeForPasting(e.type)){r.paste(e,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),l(this,Xa)?.commitOrRemove(),!this.hasSelection)return;let e=[];for(let r of l(this,Er)){let i=r.serialize(!0);i&&e.push(i)}e.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();let{clipboardData:e}=t;for(let s of e.items)for(let a of l(this,Jo))if(a.isHandlingMimeForPasting(s.type)){a.paste(s,this.currentLayer);return}let r=e.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(s){De(`paste: "${s.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();let i=this.currentLayer;try{let s=[];for(let c of r){let u=await i.deserialize(c);if(!u)return;s.push(u)}let a=()=>{for(let c of s)R(this,ne,g4).call(this,c);R(this,ne,m4).call(this,s)},o=()=>{for(let c of s)c.remove()};this.addCommands({cmd:a,undo:o,mustExec:!0})}catch(s){De(`paste: "${s.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),l(this,ti)!==Ie.NONE&&!this.isEditorHandlingKeyboard&&_w._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,l(this,Jd)&&(x(this,Jd,!1),R(this,ne,aS).call(this,"main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}setEditingState(t){t?(R(this,ne,EY).call(this),R(this,ne,_Y).call(this),R(this,ne,Ls).call(this,{isEditing:l(this,ti)!==Ie.NONE,isEmpty:R(this,ne,oS).call(this),hasSomethingToUndo:l(this,Zo).hasSomethingToUndo(),hasSomethingToRedo:l(this,Zo).hasSomethingToRedo(),hasSelectedEditor:!1})):(R(this,ne,xY).call(this),R(this,ne,TY).call(this),R(this,ne,Ls).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!l(this,Jo)){x(this,Jo,t);for(let e of l(this,Jo))R(this,ne,Nh).call(this,e.defaultPropertiesToUpdate)}}getId(){return l(this,uP).id}get currentLayer(){return l(this,mi).get(l(this,Uw))}getLayer(t){return l(this,mi).get(t)}get currentPageIndex(){return l(this,Uw)}addLayer(t){l(this,mi).set(t.pageIndex,t),l(this,Qd)?t.enable():t.disable()}removeLayer(t){l(this,mi).delete(t.pageIndex)}async updateMode(t,e=null,r=!1,i=!1,s=!1,a=!1){if(l(this,ti)!==t&&!(l(this,Qo)&&(await l(this,Qo).promise,!l(this,Qo)))){if(x(this,Qo,Promise.withResolvers()),l(this,Yd)?.commitOrRemove(),l(this,ti)===Ie.POPUP&&l(this,ys)?.hideSidebar(),l(this,ys)?.destroyPopup(),x(this,ti,t),t===Ie.NONE){this.setEditingState(!1),R(this,ne,IY).call(this);for(let o of l(this,Nn).values())o.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),l(this,Qo).resolve();return}for(let o of l(this,Nn).values())o.addStandaloneCommentButton();t===Ie.SIGNATURE&&await l(this,rp)?.loadSignatures(),r&&gs.clearPointerType(),this.setEditingState(!0),await R(this,ne,RY).call(this),this.unselectAll();for(let o of l(this,mi).values())o.updateMode(t);if(t===Ie.POPUP){l(this,Mw)||x(this,Mw,await l(this,Ww).getAnnotationsByType(new Set(l(this,Jo).map(u=>u._editorType))));let o=new Set,c=[];for(let u of l(this,Nn).values()){let{annotationElementId:h,hasComment:f,deleted:d}=u;h&&o.add(h),f&&!d&&c.push(u.getData())}for(let u of l(this,Mw)){let{id:h,popupRef:f,contentsObj:d}=u;f&&d?.str&&!o.has(h)&&!l(this,Kd).has(h)&&c.push(u)}l(this,ys)?.showSidebar(c)}if(!e){i&&this.addNewEditorFromKeyboard(),l(this,Qo).resolve();return}for(let o of l(this,Nn).values())o.uid===e?(this.setSelected(o),a?o.editComment():s?o.enterInEditMode():o.focus()):o.unselect();l(this,Qo).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==l(this,ti)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(l(this,Jo)){switch(t){case tr.CREATE:this.currentLayer.addNewEditor(e);return;case tr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(l(this,t_)||x(this,t_,new Map)).set(t,e),this.showAllEditors("highlight",e);break}if(this.hasSelection)for(let r of l(this,Er))r.updateParams(t,e);else for(let r of l(this,Jo))r.updateDefaultParams(t,e)}}showAllEditors(t,e,r=!1){for(let s of l(this,Nn).values())s.editorType===t&&s.show(e);(l(this,t_)?.get(tr.HIGHLIGHT_SHOW_ALL)??!0)!==e&&R(this,ne,Nh).call(this,[[tr.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(l(this,JS)!==t){x(this,JS,t);for(let e of l(this,mi).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}*getEditors(t){for(let e of l(this,Nn).values())e.pageIndex===t&&(yield e)}getEditor(t){return l(this,Nn).get(t)}addEditor(t){l(this,Nn).set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(l(this,Gc)&&clearTimeout(l(this,Gc)),x(this,Gc,setTimeout(()=>{this.focusMainContainer(),x(this,Gc,null)},0))),l(this,Nn).delete(t.id),t.annotationElementId&&l(this,ep)?.delete(t.annotationElementId),this.unselect(t),(!t.annotationElementId||!l(this,Kd).has(t.annotationElementId))&&l(this,Ko)?.remove(t.id)}addDeletedAnnotationElement(t){l(this,Kd).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return l(this,Kd).has(t)}removeDeletedAnnotationElement(t){l(this,Kd).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){l(this,Xa)!==t&&(x(this,Xa,t),t&&R(this,ne,Nh).call(this,t.propertiesToUpdate))}updateUI(t){l(this,ne,DY)===t&&R(this,ne,Nh).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){R(this,ne,Nh).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(l(this,Er).has(t)){l(this,Er).delete(t),t.unselect(),R(this,ne,Ls).call(this,{hasSelectedEditor:this.hasSelection});return}l(this,Er).add(t),t.select(),R(this,ne,Nh).call(this,t.propertiesToUpdate),R(this,ne,Ls).call(this,{hasSelectedEditor:!0})}setSelected(t){this.updateToolbar({mode:t.mode,editId:t.uid}),l(this,Yd)?.commitOrRemove();for(let e of l(this,Er))e!==t&&e.unselect();l(this,Er).clear(),l(this,Er).add(t),t.select(),R(this,ne,Nh).call(this,t.propertiesToUpdate),R(this,ne,Ls).call(this,{hasSelectedEditor:!0})}isSelected(t){return l(this,Er).has(t)}get firstSelectedEditor(){return l(this,Er).values().next().value}unselect(t){t.unselect(),l(this,Er).delete(t),R(this,ne,Ls).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return l(this,Er).size!==0}get isEnterHandled(){return l(this,Er).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){l(this,Zo).undo(),R(this,ne,Ls).call(this,{hasSomethingToUndo:l(this,Zo).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:R(this,ne,oS).call(this)}),this._editorUndoBar?.hide()}redo(){l(this,Zo).redo(),R(this,ne,Ls).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:l(this,Zo).hasSomethingToRedo(),isEmpty:R(this,ne,oS).call(this)})}addCommands(t){l(this,Zo).add(t),R(this,ne,Ls).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:R(this,ne,oS).call(this)})}cleanUndoStack(t){l(this,Zo).cleanType(t)}delete(){this.commitOrRemove();let t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;let e=t?[t]:[...l(this,Er)],r=()=>{this._editorUndoBar?.show(i,e.length===1?e[0].editorType:e.length);for(let s of e)s.remove()},i=()=>{for(let s of e)R(this,ne,g4).call(this,s)};this.addCommands({cmd:r,undo:i,mustExec:!0})}commitOrRemove(){l(this,Xa)?.commitOrRemove()}hasSomethingToControl(){return l(this,Xa)||this.hasSelection}selectAll(){for(let t of l(this,Er))t.commit();R(this,ne,m4).call(this,l(this,Nn).values())}unselectAll(){if(!(l(this,Xa)&&(l(this,Xa).commitOrRemove(),l(this,ti)!==Ie.NONE))&&!l(this,Yd)?.commitOrRemove()&&this.hasSelection){for(let t of l(this,Er))t.unselect();l(this,Er).clear(),R(this,ne,Ls).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;l(this,ip)[0]+=t,l(this,ip)[1]+=e;let[i,s]=l(this,ip),a=[...l(this,Er)],o=1e3;l(this,Xc)&&clearTimeout(l(this,Xc)),x(this,Xc,setTimeout(()=>{x(this,Xc,null),l(this,ip)[0]=l(this,ip)[1]=0,this.addCommands({cmd:()=>{for(let c of a)l(this,Nn).has(c.id)&&(c.translateInPage(i,s),c.translationDone())},undo:()=>{for(let c of a)l(this,Nn).has(c.id)&&(c.translateInPage(-i,-s),c.translationDone())},mustExec:!1})},o));for(let c of a)c.translateInPage(t,e),c.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),x(this,Wc,new Map);for(let t of l(this,Er))l(this,Wc).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!l(this,Wc))return!1;this.disableUserSelect(!1);let t=l(this,Wc);x(this,Wc,null);let e=!1;for(let[{x:i,y:s,pageIndex:a},o]of t)o.newX=i,o.newY=s,o.newPageIndex=a,e||(e=i!==o.savedX||s!==o.savedY||a!==o.savedPageIndex);if(!e)return!1;let r=(i,s,a,o)=>{if(l(this,Nn).has(i.id)){let c=l(this,mi).get(o);c?i._setParentAndPosition(c,s,a):(i.pageIndex=o,i.x=s,i.y=a)}};return this.addCommands({cmd:()=>{for(let[i,{newX:s,newY:a,newPageIndex:o}]of t)r(i,s,a,o)},undo:()=>{for(let[i,{savedX:s,savedY:a,savedPageIndex:o}]of t)r(i,s,a,o)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(l(this,Wc))for(let r of l(this,Wc).keys())r.drag(t,e)}rebuild(t){if(t.parent===null){let e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||l(this,Er).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return l(this,Xa)===t}getActive(){return l(this,Xa)}getMode(){return l(this,ti)}isEditingMode(){return l(this,ti)!==Ie.NONE}get imageManager(){return Ce(this,"imageManager",new u4)}getSelectionBoxes(t){if(!t)return null;let e=document.getSelection();for(let u=0,h=e.rangeCount;u<h;u++)if(!t.contains(e.getRangeAt(u).commonAncestorContainer))return null;let{x:r,y:i,width:s,height:a}=t.getBoundingClientRect(),o;switch(t.getAttribute("data-main-rotation")){case"90":o=(u,h,f,d)=>({x:(h-i)/a,y:1-(u+f-r)/s,width:d/a,height:f/s});break;case"180":o=(u,h,f,d)=>({x:1-(u+f-r)/s,y:1-(h+d-i)/a,width:f/s,height:d/a});break;case"270":o=(u,h,f,d)=>({x:1-(h+d-i)/a,y:(u-r)/s,width:d/a,height:f/s});break;default:o=(u,h,f,d)=>({x:(u-r)/s,y:(h-i)/a,width:f/s,height:d/a});break}let c=[];for(let u=0,h=e.rangeCount;u<h;u++){let f=e.getRangeAt(u);if(!f.collapsed)for(let{x:d,y:p,width:g,height:y}of f.getClientRects())g===0||y===0||c.push(o(d,p,g,y))}return c.length===0?null:c}addChangedExistingAnnotation({annotationElementId:t,id:e}){(l(this,Bw)||x(this,Bw,new Map)).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){l(this,Bw)?.delete(t)}renderAnnotationElement(t){let e=l(this,Bw)?.get(t.data.id);if(!e)return;let r=l(this,Ko).getRawValue(e);r&&(l(this,ti)===Ie.NONE&&!r.hasBeenModified||r.renderAnnotationElement(t))}setMissingCanvas(t,e,r){let i=l(this,ep)?.get(t);i&&(i.setCanvas(e,r),l(this,ep).delete(t))}addMissingCanvas(t,e){(l(this,ep)||x(this,ep,new Map)).set(t,e)}};kw=new WeakMap,Xa=new WeakMap,Mw=new WeakMap,Nn=new WeakMap,mi=new WeakMap,Fw=new WeakMap,Ko=new WeakMap,Bw=new WeakMap,Zo=new WeakMap,ys=new WeakMap,qd=new WeakMap,Yd=new WeakMap,Uw=new WeakMap,Kd=new WeakMap,Wc=new WeakMap,Jo=new WeakMap,ay=new WeakMap,YS=new WeakMap,KS=new WeakMap,jw=new WeakMap,ZS=new WeakMap,Gc=new WeakMap,Zd=new WeakMap,$w=new WeakMap,Jd=new WeakMap,Vc=new WeakMap,uP=new WeakMap,Qd=new WeakMap,Hw=new WeakMap,JS=new WeakMap,tp=new WeakMap,oy=new WeakMap,zw=new WeakMap,ep=new WeakMap,QS=new WeakMap,ti=new WeakMap,Er=new WeakMap,Bh=new WeakMap,rp=new WeakMap,np=new WeakMap,t_=new WeakMap,Ww=new WeakMap,e_=new WeakMap,ip=new WeakMap,Xc=new WeakMap,Uh=new WeakMap,r_=new WeakMap,n_=new WeakMap,Qo=new WeakMap,ne=new WeakSet,XD=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},d4=function(t){let{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(let r of l(this,mi).values())if(r.hasTextLayer(t))return r;return null},vY=function(){let t=document.getSelection();if(!t||t.isCollapsed)return;let r=R(this,ne,XD).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(r);i&&(l(this,Vc)||x(this,Vc,new o4(this)),l(this,Vc).show(r,i,this.direction==="ltr"))},wY=function(){let t=document.getSelection();if(!t||t.isCollapsed){l(this,Bh)&&(l(this,Vc)?.hide(),x(this,Bh,null),R(this,ne,Ls).call(this,{hasSelectedText:!1}));return}let{anchorNode:e}=t;if(e===l(this,Bh))return;let i=R(this,ne,XD).call(this,t).closest(".textLayer");if(!i){l(this,Bh)&&(l(this,Vc)?.hide(),x(this,Bh,null),R(this,ne,Ls).call(this,{hasSelectedText:!1}));return}if(l(this,Vc)?.hide(),x(this,Bh,e),R(this,ne,Ls).call(this,{hasSelectedText:!0}),!(l(this,ti)!==Ie.HIGHLIGHT&&l(this,ti)!==Ie.NONE)&&(l(this,ti)===Ie.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),x(this,Jd,this.isShiftKeyDown),!this.isShiftKeyDown)){let s=l(this,ti)===Ie.HIGHLIGHT?R(this,ne,d4).call(this,i):null;if(s?.toggleDrawing(),l(this,Hw)){let a=new AbortController,o=this.combinedSignal(a),c=u=>{u.type==="pointerup"&&u.button!==0||(a.abort(),s?.toggleDrawing(!0),u.type==="pointerup"&&R(this,ne,aS).call(this,"main_toolbar"))};window.addEventListener("pointerup",c,{signal:o}),window.addEventListener("blur",c,{signal:o})}else s?.toggleDrawing(!0),R(this,ne,aS).call(this,"main_toolbar")}},aS=function(t=""){l(this,ti)===Ie.HIGHLIGHT?this.highlightSelection(t):l(this,YS)&&R(this,ne,vY).call(this)},AY=function(){document.addEventListener("selectionchange",R(this,ne,wY).bind(this),{signal:this._signal})},EY=function(){if(l(this,Zd))return;x(this,Zd,new AbortController);let t=this.combinedSignal(l(this,Zd));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},xY=function(){l(this,Zd)?.abort(),x(this,Zd,null)},p4=function(){if(l(this,tp))return;x(this,tp,new AbortController);let t=this.combinedSignal(l(this,tp));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},SY=function(){l(this,tp)?.abort(),x(this,tp,null)},_Y=function(){if(l(this,qd))return;x(this,qd,new AbortController);let t=this.combinedSignal(l(this,qd));document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})},TY=function(){l(this,qd)?.abort(),x(this,qd,null)},CY=function(){let t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},Ls=function(t){Object.entries(t).some(([r,i])=>l(this,e_)[r]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(l(this,e_),t)}),l(this,ti)===Ie.HIGHLIGHT&&t.hasSelectedEditor===!1&&R(this,ne,Nh).call(this,[[tr.HIGHLIGHT_FREE,!0]]))},Nh=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},RY=async function(){if(!l(this,Qd)){x(this,Qd,!0);let t=[];for(let e of l(this,mi).values())t.push(e.enable());await Promise.all(t);for(let e of l(this,Nn).values())e.enable()}},IY=function(){if(this.unselectAll(),l(this,Qd)){x(this,Qd,!1);for(let t of l(this,mi).values())t.disable();for(let t of l(this,Nn).values())t.disable()}},g4=function(t){let e=l(this,mi).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},DY=function(){let t=null;for(t of l(this,Er));return t},oS=function(){if(l(this,Nn).size===0)return!0;if(l(this,Nn).size===1)for(let t of l(this,Nn).values())return t.isEmpty();return!1},m4=function(t){for(let e of l(this,Er))e.unselect();l(this,Er).clear();for(let e of t)e.isEmpty()||(l(this,Er).add(e),e.select());R(this,ne,Ls).call(this,{hasSelectedEditor:this.hasSelection})},Lt(_w,"TRANSLATE_SMALL",1),Lt(_w,"TRANSLATE_BIG",10);kp=_w,ks=class ks{constructor(t){T(this,Yl);T(this,Di,null);T(this,qc,!1);T(this,Fl,null);T(this,Gw,null);T(this,Yc,null);T(this,qa,null);T(this,Vw,!1);T(this,Kc,null);T(this,ca,null);T(this,jh,null);T(this,ly,null);T(this,Zc,!1);x(this,ca,t),x(this,Zc,t._uiManager.useNewAltTextFlow),l(ks,sp)||x(ks,sp,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(t){ks._l10n??(ks._l10n=t)}async render(){let t=x(this,Fl,document.createElement("button"));t.className="altText",t.tabIndex="0";let e=x(this,Gw,document.createElement("span"));t.append(e),l(this,Zc)?(t.classList.add("new"),t.setAttribute("data-l10n-id",l(ks,sp).missing),e.setAttribute("data-l10n-id",l(ks,sp)["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));let r=l(this,ca)._uiManager._signal;t.addEventListener("contextmenu",yo,{signal:r}),t.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:r});let i=s=>{s.preventDefault(),l(this,ca)._uiManager.editAltText(l(this,ca)),l(this,Zc)&&l(this,ca)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:l(this,Yl,lS)}})};return t.addEventListener("click",i,{capture:!0,signal:r}),t.addEventListener("keydown",s=>{s.target===t&&s.key==="Enter"&&(x(this,Vw,!0),i(s))},{signal:r}),await R(this,Yl,qD).call(this),t}finish(){l(this,Fl)&&(l(this,Fl).focus({focusVisible:l(this,Vw)}),x(this,Vw,!1))}isEmpty(){return l(this,Zc)?l(this,Di)===null:!l(this,Di)&&!l(this,qc)}hasData(){return l(this,Zc)?l(this,Di)!==null||!!l(this,jh):this.isEmpty()}get guessedText(){return l(this,jh)}async setGuessedText(t){l(this,Di)===null&&(x(this,jh,t),x(this,ly,await ks._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),R(this,Yl,qD).call(this))}toggleAltTextBadge(t=!1){if(!l(this,Zc)||l(this,Di)){l(this,Kc)?.remove(),x(this,Kc,null);return}if(!l(this,Kc)){let e=x(this,Kc,document.createElement("div"));e.className="noAltTextBadge",l(this,ca).div.append(e)}l(this,Kc).classList.toggle("hidden",!t)}serialize(t){let e=l(this,Di);return!t&&l(this,jh)===e&&(e=l(this,ly)),{altText:e,decorative:l(this,qc),guessedText:l(this,jh),textWithDisclaimer:l(this,ly)}}get data(){return{altText:l(this,Di),decorative:l(this,qc)}}set data({altText:t,decorative:e,guessedText:r,textWithDisclaimer:i,cancel:s=!1}){r&&(x(this,jh,r),x(this,ly,i)),!(l(this,Di)===t&&l(this,qc)===e)&&(s||(x(this,Di,t),x(this,qc,e)),R(this,Yl,qD).call(this))}toggle(t=!1){l(this,Fl)&&(!t&&l(this,qa)&&(clearTimeout(l(this,qa)),x(this,qa,null)),l(this,Fl).disabled=!t)}shown(){l(this,ca)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:l(this,Yl,lS)}})}destroy(){l(this,Fl)?.remove(),x(this,Fl,null),x(this,Gw,null),x(this,Yc,null),l(this,Kc)?.remove(),x(this,Kc,null)}};Di=new WeakMap,qc=new WeakMap,Fl=new WeakMap,Gw=new WeakMap,Yc=new WeakMap,qa=new WeakMap,Vw=new WeakMap,Kc=new WeakMap,ca=new WeakMap,jh=new WeakMap,ly=new WeakMap,Zc=new WeakMap,sp=new WeakMap,Yl=new WeakSet,lS=function(){return l(this,Di)&&"added"||l(this,Di)===null&&this.guessedText&&"review"||"missing"},qD=async function(){let t=l(this,Fl);if(!t)return;if(l(this,Zc)){if(t.classList.toggle("done",!!l(this,Di)),t.setAttribute("data-l10n-id",l(ks,sp)[l(this,Yl,lS)]),l(this,Gw)?.setAttribute("data-l10n-id",l(ks,sp)[`${l(this,Yl,lS)}-label`]),!l(this,Di)){l(this,Yc)?.remove();return}}else{if(!l(this,Di)&&!l(this,qc)){t.classList.remove("done"),l(this,Yc)?.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=l(this,Yc);if(!e){x(this,Yc,e=document.createElement("span")),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=`alt-text-tooltip-${l(this,ca).id}`;let i=100,s=l(this,ca)._uiManager._signal;s.addEventListener("abort",()=>{clearTimeout(l(this,qa)),x(this,qa,null)},{once:!0}),t.addEventListener("mouseenter",()=>{x(this,qa,setTimeout(()=>{x(this,qa,null),l(this,Yc).classList.add("show"),l(this,ca)._reportTelemetry({action:"alt_text_tooltip"})},i))},{signal:s}),t.addEventListener("mouseleave",()=>{l(this,qa)&&(clearTimeout(l(this,qa)),x(this,qa,null)),l(this,Yc)?.classList.remove("show")},{signal:s})}l(this,qc)?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=l(this,Di)),e.parentNode||t.append(e),l(this,ca).getElementForAltText()?.setAttribute("aria-describedby",e.id)},T(ks,sp,null),Lt(ks,"_l10n",null);RO=ks,xw=class{constructor(t){T(this,s_);T(this,qi,null);T(this,tl,null);T(this,cy,!1);T(this,Qr,null);T(this,i_,null);T(this,uy,null);T(this,Bl,null);T(this,hy,null);T(this,fy,!1);T(this,dy,null);x(this,Qr,t)}renderForToolbar(){let t=x(this,tl,document.createElement("button"));return t.className="comment",R(this,s_,y4).call(this,t,!1)}renderForStandalone(){let t=x(this,qi,document.createElement("button"));t.className="annotationCommentButton";let e=l(this,Qr).commentButtonPosition;if(e){let{style:r}=t;r.insetInlineEnd=`calc(${100*(l(this,Qr)._uiManager.direction==="ltr"?1-e[0]:e[0])}% - var(--comment-button-dim))`,r.top=`calc(${100*e[1]}% - var(--comment-button-dim))`;let i=l(this,Qr).commentButtonColor;i&&(r.backgroundColor=i)}return R(this,s_,y4).call(this,t,!0)}focusButton(){setTimeout(()=>{(l(this,qi)??l(this,tl))?.focus()},0)}onUpdatedColor(){if(!l(this,qi))return;let t=l(this,Qr).commentButtonColor;t&&(l(this,qi).style.backgroundColor=t),l(this,Qr)._uiManager.updatePopupColor(l(this,Qr))}get commentButtonWidth(){return(l(this,qi)?.getBoundingClientRect().width??0)/l(this,Qr).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(l(this,dy))return l(this,dy);if(!l(this,qi))return null;let{x:t,y:e,height:r}=l(this,qi).getBoundingClientRect(),{x:i,y:s,width:a,height:o}=l(this,Qr).parent.boundingClientRect;return[(t-i)/a,(e+r-s)/o]}set commentPopupPositionInLayer(t){x(this,dy,t)}hasDefaultPopupPosition(){return l(this,dy)===null}removeStandaloneCommentButton(){l(this,qi)?.remove(),x(this,qi,null)}removeToolbarCommentButton(){l(this,tl)?.remove(),x(this,tl,null)}setCommentButtonStates({selected:t,hasPopup:e}){l(this,qi)&&(l(this,qi).classList.toggle("selected",t),l(this,qi).ariaExpanded=e)}edit(t){let e=this.commentPopupPositionInLayer,r,i;if(e)[r,i]=e;else{[r,i]=l(this,Qr).commentButtonPosition;let{width:h,height:f,x:d,y:p}=l(this,Qr);r=d+r*h,i=p+i*f}let s=l(this,Qr).parent.boundingClientRect,{x:a,y:o,width:c,height:u}=s;l(this,Qr)._uiManager.editComment(l(this,Qr),a+r*c,o+i*u,{...t,parentDimensions:s})}finish(){l(this,tl)&&(l(this,tl).focus({focusVisible:l(this,cy)}),x(this,cy,!1))}isDeleted(){return l(this,fy)||l(this,Bl)===""}isEmpty(){return l(this,Bl)===null}hasBeenEdited(){return this.isDeleted()||l(this,Bl)!==l(this,i_)}serialize(){return this.data}get data(){return{text:l(this,Bl),richText:l(this,uy),date:l(this,hy),deleted:this.isDeleted()}}set data(t){if(t!==l(this,Bl)&&x(this,uy,null),t===null){x(this,Bl,""),x(this,fy,!0);return}x(this,Bl,t),x(this,hy,new Date),x(this,fy,!1)}setInitialText(t,e=null){x(this,i_,t),this.data=t,x(this,hy,null),x(this,uy,e)}shown(){}destroy(){l(this,tl)?.remove(),x(this,tl,null),l(this,qi)?.remove(),x(this,qi,null),x(this,Bl,""),x(this,uy,null),x(this,hy,null),x(this,Qr,null),x(this,cy,!1),x(this,fy,!1)}};qi=new WeakMap,tl=new WeakMap,cy=new WeakMap,Qr=new WeakMap,i_=new WeakMap,uy=new WeakMap,Bl=new WeakMap,hy=new WeakMap,fy=new WeakMap,dy=new WeakMap,s_=new WeakSet,y4=function(t,e){if(!l(this,Qr)._uiManager.hasCommentManager())return null;t.tabIndex="0",t.ariaHasPopup="dialog",e?(t.ariaControls="commentPopup",t.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(t.ariaControlsElements=[l(this,Qr)._uiManager.getCommentDialogElement()],t.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));let r=l(this,Qr)._uiManager._signal;if(!(r instanceof AbortSignal)||r.aborted)return t;t.addEventListener("contextmenu",yo,{signal:r}),e&&(t.addEventListener("focusin",s=>{l(this,Qr)._focusEventsAllowed=!1,wn(s)},{capture:!0,signal:r}),t.addEventListener("focusout",s=>{l(this,Qr)._focusEventsAllowed=!0,wn(s)},{capture:!0,signal:r})),t.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:r});let i=s=>{s.preventDefault(),t===l(this,tl)?this.edit():l(this,Qr).toggleComment(!0)};return t.addEventListener("click",i,{capture:!0,signal:r}),t.addEventListener("keydown",s=>{s.target===t&&s.key==="Enter"&&(x(this,cy,!0),i(s))},{signal:r}),t.addEventListener("pointerenter",()=>{l(this,Qr).toggleComment(!1,!0)},{signal:r}),t.addEventListener("pointerleave",()=>{l(this,Qr).toggleComment(!1,!1)},{signal:r}),t};F5=class F5{constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:r=null,onPinchStart:i=null,onPinching:s=null,onPinchEnd:a=null,signal:o}){T(this,Mp);T(this,Xw);T(this,py,!1);T(this,a_,null);T(this,o_);T(this,l_);T(this,c_);T(this,u_);T(this,$h,null);T(this,gy);T(this,Hh,null);T(this,my);T(this,zh,null);x(this,Xw,t),x(this,a_,r),x(this,o_,e),x(this,l_,i),x(this,c_,s),x(this,u_,a),x(this,my,new AbortController),x(this,gy,AbortSignal.any([o,l(this,my).signal])),t.addEventListener("touchstart",R(this,Mp,OY).bind(this),{passive:!1,signal:l(this,gy)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/fu.pixelRatio}destroy(){l(this,my)?.abort(),x(this,my,null),l(this,$h)?.abort(),x(this,$h,null)}};Xw=new WeakMap,py=new WeakMap,a_=new WeakMap,o_=new WeakMap,l_=new WeakMap,c_=new WeakMap,u_=new WeakMap,$h=new WeakMap,gy=new WeakMap,Hh=new WeakMap,my=new WeakMap,zh=new WeakMap,Mp=new WeakSet,OY=function(t){var i,s,a;if((i=l(this,o_))!=null&&i.call(this))return;if(t.touches.length===1){if(l(this,$h))return;let o=x(this,$h,new AbortController),c=AbortSignal.any([l(this,gy),o.signal]),u=l(this,Xw),h={capture:!0,signal:c,passive:!1},f=d=>{d.pointerType==="touch"&&(l(this,$h)?.abort(),x(this,$h,null))};u.addEventListener("pointerdown",d=>{d.pointerType==="touch"&&(wn(d),f(d))},h),u.addEventListener("pointerup",f,h),u.addEventListener("pointercancel",f,h);return}if(!l(this,zh)){x(this,zh,new AbortController);let o=AbortSignal.any([l(this,gy),l(this,zh).signal]),c=l(this,Xw),u={signal:o,capture:!1,passive:!1};c.addEventListener("touchmove",R(this,Mp,PY).bind(this),u);let h=R(this,Mp,NY).bind(this);c.addEventListener("touchend",h,u),c.addEventListener("touchcancel",h,u),u.capture=!0,c.addEventListener("pointerdown",wn,u),c.addEventListener("pointermove",wn,u),c.addEventListener("pointercancel",wn,u),c.addEventListener("pointerup",wn,u),(s=l(this,l_))==null||s.call(this)}if(wn(t),t.touches.length!==2||(a=l(this,a_))!=null&&a.call(this)){x(this,Hh,null);return}let[e,r]=t.touches;e.identifier>r.identifier&&([e,r]=[r,e]),x(this,Hh,{touch0X:e.screenX,touch0Y:e.screenY,touch1X:r.screenX,touch1Y:r.screenY})},PY=function(t){var _;if(!l(this,Hh)||t.touches.length!==2)return;wn(t);let[e,r]=t.touches;e.identifier>r.identifier&&([e,r]=[r,e]);let{screenX:i,screenY:s}=e,{screenX:a,screenY:o}=r,c=l(this,Hh),{touch0X:u,touch0Y:h,touch1X:f,touch1Y:d}=c,p=f-u,g=d-h,y=a-i,b=o-s,m=Math.hypot(y,b)||1,w=Math.hypot(p,g)||1;if(!l(this,py)&&Math.abs(w-m)<=F5.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(c.touch0X=i,c.touch0Y=s,c.touch1X=a,c.touch1Y=o,!l(this,py)){x(this,py,!0);return}let A=[(i+a)/2,(s+o)/2];(_=l(this,c_))==null||_.call(this,A,w,m)},NY=function(t){var e;t.touches.length>=2||(l(this,zh)&&(l(this,zh).abort(),x(this,zh,null),(e=l(this,u_))==null||e.call(this)),l(this,Hh)&&(wn(t),x(this,Hh,null),x(this,py,!1)))};PS=F5,Ne=class Ne{constructor(t){T(this,Ee);T(this,yy,null);T(this,Ul,null);T(this,hn,null);T(this,Gr,null);T(this,Wh,null);T(this,qw,!1);T(this,ap,null);T(this,h_,"");T(this,Yi,null);T(this,by,null);T(this,Gh,null);T(this,el,null);T(this,op,null);T(this,f_,"");T(this,vy,!1);T(this,Ya,null);T(this,d_,!1);T(this,wy,!1);T(this,Vh,!1);T(this,Jc,null);T(this,Yw,0);T(this,Kw,0);T(this,rl,null);T(this,Ay,null);Lt(this,"isSelected",!1);Lt(this,"_isCopy",!1);Lt(this,"_editToolbar",null);Lt(this,"_initialOptions",Object.create(null));Lt(this,"_initialData",null);Lt(this,"_isVisible",!0);Lt(this,"_uiManager",null);Lt(this,"_focusEventsAllowed",!0);T(this,p_,!1);T(this,hP,Ne._zIndex++);this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null,this.annotationElementId=t.annotationElementId||null,this.creationDate=t.creationDate||new Date,this.modificationDate=t.modificationDate||null,this.canAddComment=!0;let{rotation:e,rawDims:{pageWidth:r,pageHeight:i,pageX:s,pageY:a}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,i],this.pageTranslation=[s,a];let[o,c]=this.parentDimensions;this.x=t.x/o,this.y=t.y/c,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){let t=Ne.prototype._resizeWithKeyboard,e=kp.TRANSLATE_SMALL,r=kp.TRANSLATE_BIG;return Ce(this,"_resizerKeyboardManager",new v0([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,r]}],[["Escape","mac+Escape"],Ne.prototype._stopResizingWithKeyboard]]))}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 Ce(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){let e=new _4({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(Ne._l10n??(Ne._l10n=t),Ne._l10nResizer||(Ne._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"})),Ne._borderLineWidth!==-1)return;let r=getComputedStyle(document.documentElement);Ne._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){qr("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return l(this,p_)}set _isDraggable(t){x(this,p_,t),this.div?.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){let[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(t*2),this.y+=this.width*t/(e*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(t*2),this.y-=this.width*t/(e*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=l(this,hP)}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(R(this,Ee,cS).call(this),l(this,el)?.remove(),x(this,el,null)),this.parent=t}focusin(t){this._focusEventsAllowed&&(l(this,vy)?x(this,vy,!1):this.parent.setSelected(this))}focusout(t){!this._focusEventsAllowed||!this.isAttachedToDOM||t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,r,i){let[s,a]=this.parentDimensions;[r,i]=this.screenToPageTranslation(r,i),this.x=(t+r)/s,this.y=(e+i)/a,this.fixAndSetPosition()}_moveAfterPaste(t,e){let[r,i]=this.parentDimensions;this.setAt(t*r,e*i,this.width*r,this.height*i),this._onTranslated()}translate(t,e){R(this,Ee,b4).call(this,this.parentDimensions,t,e)}translateInPage(t,e){l(this,Ya)||x(this,Ya,[this.x,this.y,this.width,this.height]),R(this,Ee,b4).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){l(this,Ya)||x(this,Ya,[this.x,this.y,this.width,this.height]);let{div:r,parentDimensions:[i,s]}=this;if(this.x+=t/i,this.y+=e/s,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:f,y:d}=this.div.getBoundingClientRect();this.parent.findNewParent(this,f,d)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this,[c,u]=this.getBaseTranslation();a+=c,o+=u;let{style:h}=r;h.left=`${(100*a).toFixed(2)}%`,h.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o),r.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!l(this,Ya)&&(l(this,Ya)[0]!==this.x||l(this,Ya)[1]!==this.y)}get _hasBeenResized(){return!!l(this,Ya)&&(l(this,Ya)[2]!==this.width||l(this,Ya)[3]!==this.height)}getBaseTranslation(){let[t,e]=this.parentDimensions,{_borderLineWidth:r}=Ne,i=r/t,s=r/e;switch(this.rotation){case 90:return[-i,s];case 180:return[i,s];case 270:return[i,-s];default:return[-i,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){let{div:{style:e},pageDimensions:[r,i]}=this,{x:s,y:a,width:o,height:c}=this;if(o*=r,c*=i,s*=r,a*=i,this._mustFixPosition)switch(t){case 0:s=As(s,0,r-o),a=As(a,0,i-c);break;case 90:s=As(s,0,r-c),a=As(a,o,i);break;case 180:s=As(s,o,r),a=As(a,c,i);break;case 270:s=As(s,c,r),a=As(a,0,i-o);break}this.x=s/=r,this.y=a/=i;let[u,h]=this.getBaseTranslation();s+=u,a+=h,e.left=`${(100*s).toFixed(2)}%`,e.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(t,e){var r;return R(r=Ne,g_,v4).call(r,t,e,this.parentRotation)}pageTranslationToScreen(t,e){var r;return R(r=Ne,g_,v4).call(r,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:t,pageDimensions:[e,r]}=this;return[e*t,r*t]}setDims(){let{div:{style:t},width:e,height:r}=this;t.width=`${(100*e).toFixed(2)}%`,t.height=`${(100*r).toFixed(2)}%`}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(t*1e4)/1e4}_onResizing(){}altTextFinish(){l(this,hn)?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||l(this,wy))return this._editToolbar;this._editToolbar=new a4(this),this.div.append(this._editToolbar.render());let{toolbarButtons:t}=this;if(t)for(let[e,r]of t)await this._editToolbar.addButton(e,r);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,hn)?.destroy()}addContainer(t){let e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return l(this,hn)||(RO.initialize(Ne._l10n),x(this,hn,new RO(this)),l(this,yy)&&(l(this,hn).data=l(this,yy),x(this,yy,null))),l(this,hn)}get altTextData(){return l(this,hn)?.data}set altTextData(t){l(this,hn)&&(l(this,hn).data=t)}get guessedAltText(){return l(this,hn)?.guessedText}async setGuessedAltText(t){await l(this,hn)?.setGuessedText(t)}serializeAltText(t){return l(this,hn)?.serialize(t)}hasAltText(){return!!l(this,hn)&&!l(this,hn).isEmpty()}hasAltTextData(){return l(this,hn)?.hasData()??!1}focusCommentButton(){l(this,Gr)?.focusButton()}addCommentButton(){return this.canAddComment?l(this,Gr)||x(this,Gr,new xw(this)):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(l(this,Wh)){this._uiManager.isEditingMode()&&l(this,Wh).classList.remove("hidden");return}this.hasComment&&(x(this,Wh,l(this,Gr).renderForStandalone()),this.div.append(l(this,Wh)))}}removeStandaloneCommentButton(){l(this,Gr).removeStandaloneCommentButton(),x(this,Wh,null)}hideStandaloneCommentButton(){l(this,Wh)?.classList.add("hidden")}get comment(){let{data:{richText:t,text:e,date:r,deleted:i}}=l(this,Gr);return{text:e,richText:t,date:r,deleted:i,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(t){l(this,Gr)||x(this,Gr,new xw(this)),l(this,Gr).data=t,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:t,popupRef:e,richText:r}){if(!e||(l(this,Gr)||x(this,Gr,new xw(this)),l(this,Gr).setInitialText(t,r),!this.annotationElementId))return;let i=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);i&&this.updateFromAnnotationLayer(i)}get hasEditedComment(){return l(this,Gr)?.hasBeenEdited()}get hasDeletedComment(){return l(this,Gr)?.isDeleted()}get hasComment(){return!!l(this,Gr)&&!l(this,Gr).isEmpty()&&!l(this,Gr).isDeleted()}async editComment(t){l(this,Gr)||x(this,Gr,new xw(this)),l(this,Gr).edit(t)}toggleComment(t,e=void 0){this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){l(this,Gr).setSelectedButton(t)}addComment(t){if(this.hasEditedComment){let[,,,i]=t.rect,[s]=this.pageDimensions,[a]=this.pageTranslation,o=a+s+1,c=i-100,u=o+180;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[o,c,u,i]}}}updateFromAnnotationLayer({popup:{contents:t,deleted:e}}){l(this,Gr).data=e?null:t}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){let t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=l(this,qw)?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),R(this,Ee,x4).call(this);let[e,r]=this.parentDimensions;this.parentRotation%180!==0&&(t.style.maxWidth=`${(100*r/e).toFixed(2)}%`,t.style.maxHeight=`${(100*e/r).toFixed(2)}%`);let[i,s]=this.getInitialTranslation();return this.translate(i,s),yY(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(l(this,Ay)||x(this,Ay,new PS({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:R(this,Ee,MY).bind(this),onPinching:R(this,Ee,FY).bind(this),onPinchEnd:R(this,Ee,BY).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),t}pointerdown(t){let{isMac:e}=Bn.platform;if(t.button!==0||t.ctrlKey&&e){t.preventDefault();return}if(x(this,vy,!0),this._isDraggable){R(this,Ee,UY).call(this,t);return}R(this,Ee,E4).call(this,t)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){l(this,Jc)&&clearTimeout(l(this,Jc)),x(this,Jc,setTimeout(()=>{x(this,Jc,null),this.parent?.moveEditorInDOM(this)},0))}_setParentAndPosition(t,e,r){t.changeParent(this),this.x=e,this.y=r,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e,r=this.rotation){let i=this.parentScale,[s,a]=this.pageDimensions,[o,c]=this.pageTranslation,u=t/i,h=e/i,f=this.x*s,d=this.y*a,p=this.width*s,g=this.height*a;switch(r){case 0:return[f+u+o,a-d-h-g+c,f+u+p+o,a-d-h+c];case 90:return[f+h+o,a-d+u+c,f+h+g+o,a-d+u+p+c];case 180:return[f-u-p+o,a-d+h+c,f-u+o,a-d+h+g+c];case 270:return[f-h-g+o,a-d-u-p+c,f-h+o,a-d-u+c];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){let[r,i,s,a]=t,o=s-r,c=a-i;switch(this.rotation){case 0:return[r,e-a,o,c];case 90:return[r,e-i,c,o];case 180:return[s,e-i,o,c];case 270:return[s,e-a,c,o];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&Ne._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){l(this,Gr)?.onUpdatedColor()}getData(){let{comment:{text:t,color:e,date:r,opacity:i,deleted:s,richText:a},uid:o,pageIndex:c,creationDate:u,modificationDate:h}=this;return{id:o,pageIndex:c,rect:this.getPDFRect(),richText:a,contentsObj:{str:t},creationDate:u,modificationDate:r||h,popupRef:!s,color:e,opacity:i}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),x(this,wy,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),x(this,wy,!1),!0):!1}isInEditMode(){return l(this,wy)}shouldGetKeyboardEvents(){return l(this,Vh)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:t,left:e,bottom:r,right:i}=this.getClientDimensions(),{innerHeight:s,innerWidth:a}=window;return e<a&&i>0&&t<s&&r>0}rebuild(){R(this,Ee,x4).call(this)}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,e=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(t,e,r){let i=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:r,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});i.rotation=t.rotation,x(i,yy,t.accessibilityData),i._isCopy=t.isCopy||!1;let[s,a]=i.pageDimensions,[o,c,u,h]=i.getRectInCurrentCoords(t.rect,a);return i.x=o/s,i.y=c/a,i.width=u/s,i.height=h/a,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(l(this,op)?.abort(),x(this,op,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),l(this,Jc)&&(clearTimeout(l(this,Jc)),x(this,Jc,null)),R(this,Ee,cS).call(this),this.removeEditToolbar(),l(this,rl)){for(let t of l(this,rl).values())clearTimeout(t);x(this,rl,null)}this.parent=null,l(this,Ay)?.destroy(),x(this,Ay,null),l(this,el)?.remove(),x(this,el,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(R(this,Ee,LY).call(this),l(this,Yi).classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){let{commentButtonPosition:[t,e]}=this,[r,i,s,a]=this.getPDFRect();return[Ne._round(r+(s-r)*t),Ne._round(i+(a-i)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return l(this,Gr).commentPopupPositionInLayer}set commentPopupPosition(t){l(this,Gr).commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return l(this,Gr).hasDefaultPopupPosition()}get commentButtonWidth(){return l(this,Gr).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){l(this,Gr)?.setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),x(this,Gh,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});let e=l(this,Yi).children;if(!l(this,Ul)){x(this,Ul,Array.from(e));let a=R(this,Ee,jY).bind(this),o=R(this,Ee,$Y).bind(this),c=this._uiManager._signal;for(let u of l(this,Ul)){let h=u.getAttribute("data-resizer-name");u.setAttribute("role","spinbutton"),u.addEventListener("keydown",a,{signal:c}),u.addEventListener("blur",o,{signal:c}),u.addEventListener("focus",R(this,Ee,HY).bind(this,h),{signal:c}),u.setAttribute("data-l10n-id",Ne._l10nResizer[h])}}let r=l(this,Ul)[0],i=0;for(let a of e){if(a===r)break;i++}let s=(360-this.rotation+this.parentRotation)%360/90*(l(this,Ul).length/4);if(s!==i){if(s<i)for(let o=0;o<i-s;o++)l(this,Yi).append(l(this,Yi).firstElementChild);else if(s>i)for(let o=0;o<s-i;o++)l(this,Yi).firstElementChild.before(l(this,Yi).lastElementChild);let a=0;for(let o of e){let u=l(this,Ul)[a++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",Ne._l10nResizer[u])}}R(this,Ee,S4).call(this,0),x(this,Vh,!0),l(this,Yi).firstElementChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){l(this,Vh)&&R(this,Ee,A4).call(this,l(this,f_),{deltaX:t,deltaY:e,fromKeyboard:!0})}_stopResizingWithKeyboard(){R(this,Ee,cS).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,hn)?.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,Yi)?.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,hn)?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){t.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,d_)}set isEditing(t){x(this,d_,t),this.parent&&(t?(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(t,e=!1){if(e){l(this,rl)||x(this,rl,new Map);let{action:r}=t,i=l(this,rl).get(r);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),l(this,rl).delete(r),l(this,rl).size===0&&x(this,rl,null)},Ne._telemetryTimeout),l(this,rl).set(r,i);return}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),x(this,qw,!1)}disable(){this.div&&(this.div.tabIndex=-1),x(this,qw,!0)}updateFakeAnnotationElement(t){if(!l(this,el)&&!this.deleted){x(this,el,t.addFakeAnnotation(this));return}if(this.deleted){l(this,el).remove(),x(this,el,null);return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&l(this,el).updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let e=t.container.querySelector(".annotationContent");if(!e)e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);else if(e.nodeName==="CANVAS"){let r=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),r.before(e)}return e}resetAnnotationElement(t){let{firstElementChild:e}=t.container;e?.nodeName==="DIV"&&e.classList.contains("annotationContent")&&e.remove()}};yy=new WeakMap,Ul=new WeakMap,hn=new WeakMap,Gr=new WeakMap,Wh=new WeakMap,qw=new WeakMap,ap=new WeakMap,h_=new WeakMap,Yi=new WeakMap,by=new WeakMap,Gh=new WeakMap,el=new WeakMap,op=new WeakMap,f_=new WeakMap,vy=new WeakMap,Ya=new WeakMap,d_=new WeakMap,wy=new WeakMap,Vh=new WeakMap,Jc=new WeakMap,Yw=new WeakMap,Kw=new WeakMap,rl=new WeakMap,Ay=new WeakMap,p_=new WeakMap,hP=new WeakMap,Ee=new WeakSet,b4=function([t,e],r,i){[r,i]=this.screenToPageTranslation(r,i),this.x+=r/t,this.y+=i/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},g_=new WeakSet,v4=function(t,e,r){switch(r){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}},YD=function(t){switch(t){case 90:{let[e,r]=this.pageDimensions;return[0,-e/r,r/e,0]}case 180:return[-1,0,0,-1];case 270:{let[e,r]=this.pageDimensions;return[0,e/r,-r/e,0]}default:return[1,0,0,1]}},LY=function(){if(l(this,Yi))return;x(this,Yi,document.createElement("div")),l(this,Yi).classList.add("resizers");let t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(let r of t){let i=document.createElement("div");l(this,Yi).append(i),i.classList.add("resizer",r),i.setAttribute("data-resizer-name",r),i.addEventListener("pointerdown",R(this,Ee,kY).bind(this,r),{signal:e}),i.addEventListener("contextmenu",yo,{signal:e}),i.tabIndex=-1}this.div.prepend(l(this,Yi))},kY=function(t,e){e.preventDefault();let{isMac:r}=Bn.platform;if(e.button!==0||e.ctrlKey&&r)return;l(this,hn)?.toggle(!1);let i=this._isDraggable;this._isDraggable=!1,x(this,by,[e.screenX,e.screenY]);let s=new AbortController,a=this._uiManager.combinedSignal(s);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",R(this,Ee,A4).bind(this,t),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",wn,{passive:!1,signal:a}),window.addEventListener("contextmenu",yo,{signal:a}),x(this,Gh,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});let o=this.parent.div.style.cursor,c=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;let u=()=>{s.abort(),this.parent.togglePointerEvents(!0),l(this,hn)?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=o,this.div.style.cursor=c,R(this,Ee,KD).call(this)};window.addEventListener("pointerup",u,{signal:a}),window.addEventListener("blur",u,{signal:a})},w4=function(t,e,r,i){this.width=r,this.height=i,this.x=t,this.y=e,this.setDims(),this.fixAndSetPosition(),this._onResized()},KD=function(){if(!l(this,Gh))return;let{savedX:t,savedY:e,savedWidth:r,savedHeight:i}=l(this,Gh);x(this,Gh,null);let s=this.x,a=this.y,o=this.width,c=this.height;s===t&&a===e&&o===r&&c===i||this.addCommands({cmd:R(this,Ee,w4).bind(this,s,a,o,c),undo:R(this,Ee,w4).bind(this,t,e,r,i),mustExec:!0})},A4=function(t,e){let[r,i]=this.parentDimensions,s=this.x,a=this.y,o=this.width,c=this.height,u=Ne.MIN_SIZE/r,h=Ne.MIN_SIZE/i,f=R(this,Ee,YD).call(this,this.rotation),d=(J,N)=>[f[0]*J+f[2]*N,f[1]*J+f[3]*N],p=R(this,Ee,YD).call(this,360-this.rotation),g=(J,N)=>[p[0]*J+p[2]*N,p[1]*J+p[3]*N],y,b,m=!1,w=!1;switch(t){case"topLeft":m=!0,y=(J,N)=>[0,0],b=(J,N)=>[J,N];break;case"topMiddle":y=(J,N)=>[J/2,0],b=(J,N)=>[J/2,N];break;case"topRight":m=!0,y=(J,N)=>[J,0],b=(J,N)=>[0,N];break;case"middleRight":w=!0,y=(J,N)=>[J,N/2],b=(J,N)=>[0,N/2];break;case"bottomRight":m=!0,y=(J,N)=>[J,N],b=(J,N)=>[0,0];break;case"bottomMiddle":y=(J,N)=>[J/2,N],b=(J,N)=>[J/2,0];break;case"bottomLeft":m=!0,y=(J,N)=>[0,N],b=(J,N)=>[J,0];break;case"middleLeft":w=!0,y=(J,N)=>[0,N/2],b=(J,N)=>[J,N/2];break}let A=y(o,c),_=b(o,c),S=d(..._),I=Ne._round(s+S[0]),C=Ne._round(a+S[1]),M=1,z=1,G,Y;if(e.fromKeyboard)({deltaX:G,deltaY:Y}=e);else{let{screenX:J,screenY:N}=e,[D,F]=l(this,by);[G,Y]=this.screenToPageTranslation(J-D,N-F),l(this,by)[0]=J,l(this,by)[1]=N}if([G,Y]=g(G/r,Y/i),m){let J=Math.hypot(o,c);M=z=Math.max(Math.min(Math.hypot(_[0]-A[0]-G,_[1]-A[1]-Y)/J,1/o,1/c),u/o,h/c)}else w?M=As(Math.abs(_[0]-A[0]-G),u,1)/o:z=As(Math.abs(_[1]-A[1]-Y),h,1)/c;let L=Ne._round(o*M),j=Ne._round(c*z);S=d(...b(L,j));let q=I-S[0],nt=C-S[1];l(this,Ya)||x(this,Ya,[this.x,this.y,this.width,this.height]),this.width=L,this.height=j,this.x=q,this.y=nt,this.setDims(),this.fixAndSetPosition(),this._onResizing()},MY=function(){x(this,Gh,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),l(this,hn)?.toggle(!1),this.parent.togglePointerEvents(!1)},FY=function(t,e,r){let s=.7*(r/e)+1-.7;if(s===1)return;let a=R(this,Ee,YD).call(this,this.rotation),o=(I,C)=>[a[0]*I+a[2]*C,a[1]*I+a[3]*C],[c,u]=this.parentDimensions,h=this.x,f=this.y,d=this.width,p=this.height,g=Ne.MIN_SIZE/c,y=Ne.MIN_SIZE/u;s=Math.max(Math.min(s,1/d,1/p),g/d,y/p);let b=Ne._round(d*s),m=Ne._round(p*s);if(b===d&&m===p)return;l(this,Ya)||x(this,Ya,[h,f,d,p]);let w=o(d/2,p/2),A=Ne._round(h+w[0]),_=Ne._round(f+w[1]),S=o(b/2,m/2);this.x=A-S[0],this.y=_-S[1],this.width=b,this.height=m,this.setDims(),this.fixAndSetPosition(),this._onResizing()},BY=function(){l(this,hn)?.toggle(!0),this.parent.togglePointerEvents(!0),R(this,Ee,KD).call(this)},E4=function(t){let{isMac:e}=Bn.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},UY=function(t){let{isSelected:e}=this;this._uiManager.setUpDragSession();let r=!1,i=new AbortController,s=this._uiManager.combinedSignal(i),a={capture:!0,passive:!1,signal:s},o=u=>{i.abort(),x(this,ap,null),x(this,vy,!1),this._uiManager.endDragSession()||R(this,Ee,E4).call(this,u),r&&this._onStopDragging()};e&&(x(this,Yw,t.clientX),x(this,Kw,t.clientY),x(this,ap,t.pointerId),x(this,h_,t.pointerType),window.addEventListener("pointermove",u=>{r||(r=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:h,clientY:f,pointerId:d}=u;if(d!==l(this,ap)){wn(u);return}let[p,g]=this.screenToPageTranslation(h-l(this,Yw),f-l(this,Kw));x(this,Yw,h),x(this,Kw,f),this._uiManager.dragSelectedEditors(p,g)},a),window.addEventListener("touchmove",wn,a),window.addEventListener("pointerdown",u=>{u.pointerType===l(this,h_)&&(l(this,Ay)||u.isPrimary)&&o(u),wn(u)},a));let c=u=>{if(!l(this,ap)||l(this,ap)===u.pointerId){o(u);return}wn(u)};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})},x4=function(){if(l(this,op)||!this.div)return;x(this,op,new AbortController);let t=this._uiManager.combinedSignal(l(this,op));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},jY=function(t){Ne._resizerKeyboardManager.exec(this,t)},$Y=function(t){l(this,Vh)&&t.relatedTarget?.parentNode!==l(this,Yi)&&R(this,Ee,cS).call(this)},HY=function(t){x(this,f_,l(this,Vh)?t:"")},S4=function(t){if(l(this,Ul))for(let e of l(this,Ul))e.tabIndex=t},cS=function(){x(this,Vh,!1),R(this,Ee,S4).call(this,-1),R(this,Ee,KD).call(this)},T(Ne,g_),Lt(Ne,"_l10n",null),Lt(Ne,"_l10nResizer",null),Lt(Ne,"_borderLineWidth",-1),Lt(Ne,"_colorManager",new f4),Lt(Ne,"_zIndex",1),Lt(Ne,"_telemetryTimeout",1e3);tn=Ne,_4=class extends tn{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},$q=3285377520,Vo=4294901760,Hc=65535,IO=class{constructor(t){this.h1=t?t&4294967295:$q,this.h2=t?t&4294967295:$q}update(t){let e,r;if(typeof t=="string"){e=new Uint8Array(t.length*2),r=0;for(let y=0,b=t.length;y<b;y++){let m=t.charCodeAt(y);m<=255?e[r++]=m:(e[r++]=m>>>8,e[r++]=m&255)}}else if(ArrayBuffer.isView(t))e=t.slice(),r=e.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");let i=r>>2,s=r-i*4,a=new Uint32Array(e.buffer,0,i),o=0,c=0,u=this.h1,h=this.h2,f=3432918353,d=461845907,p=f&Hc,g=d&Hc;for(let y=0;y<i;y++)y&1?(o=a[y],o=o*f&Vo|o*p&Hc,o=o<<15|o>>>17,o=o*d&Vo|o*g&Hc,u^=o,u=u<<13|u>>>19,u=u*5+3864292196):(c=a[y],c=c*f&Vo|c*p&Hc,c=c<<15|c>>>17,c=c*d&Vo|c*g&Hc,h^=c,h=h<<13|h>>>19,h=h*5+3864292196);switch(o=0,s){case 3:o^=e[i*4+2]<<16;case 2:o^=e[i*4+1]<<8;case 1:o^=e[i*4],o=o*f&Vo|o*p&Hc,o=o<<15|o>>>17,o=o*d&Vo|o*g&Hc,i&1?u^=o:h^=o}this.h1=u,this.h2=h}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&Vo|t*36045&Hc,e=e*4283543511&Vo|((e<<16|t>>>16)*2950163797&Vo)>>>16,t^=e>>>1,t=t*444984403&Vo|t*60499&Hc,e=e*3301882366&Vo|((e<<16|t>>>16)*3120437893&Vo)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}},T4=Object.freeze({map:null,hash:"",transfer:void 0}),NS=class{constructor(){T(this,fP);T(this,Ey,!1);T(this,xy,null);T(this,Xh,null);T(this,Ki,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){let r=l(this,Ki).get(t);return r===void 0?e:Object.assign(e,r)}getRawValue(t){return l(this,Ki).get(t)}remove(t){let e=l(this,Ki).get(t);if(e!==void 0&&(e instanceof tn&&l(this,Xh).delete(e.annotationElementId),l(this,Ki).delete(t),l(this,Ki).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(let r of l(this,Ki).values())if(r instanceof tn)return;this.onAnnotationEditor(null)}}setValue(t,e){let r=l(this,Ki).get(t),i=!1;if(r!==void 0)for(let[s,a]of Object.entries(e))r[s]!==a&&(i=!0,r[s]=a);else i=!0,l(this,Ki).set(t,e);i&&R(this,fP,zY).call(this),e instanceof tn&&((l(this,Xh)||x(this,Xh,new Map)).set(e.annotationElementId,e),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(e.constructor._type))}has(t){return l(this,Ki).has(t)}get size(){return l(this,Ki).size}resetModified(){l(this,Ey)&&(x(this,Ey,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new DO(this)}get serializable(){if(l(this,Ki).size===0)return T4;let t=new Map,e=new IO,r=[],i=Object.create(null),s=!1;for(let[a,o]of l(this,Ki)){let c=o instanceof tn?o.serialize(!1,i):o;c&&(t.set(a,c),e.update(`${a}:${JSON.stringify(c)}`),s||(s=!!c.bitmap))}if(s)for(let a of t.values())a.bitmap&&r.push(a.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:r}:T4}get editorStats(){let t=null,e=new Map,r=0,i=0;for(let s of l(this,Ki).values()){if(!(s instanceof tn)){s.popup&&(s.popup.deleted?i+=1:r+=1);continue}s.isCommentDeleted?i+=1:s.hasEditedComment&&(r+=1);let a=s.telemetryFinalData;if(!a)continue;let{type:o}=a;e.has(o)||e.set(o,Object.getPrototypeOf(s).constructor),t||(t=Object.create(null));let c=t[o]||(t[o]=new Map);for(let[u,h]of Object.entries(a)){if(u==="type")continue;let f=c.get(u);f||(f=new Map,c.set(u,f));let d=f.get(h)??0;f.set(h,d+1)}}if((i>0||r>0)&&(t||(t=Object.create(null)),t.comments={deleted:i,edited:r}),!t)return null;for(let[s,a]of e)t[s]=a.computeTelemetryFinalData(t[s]);return t}resetModifiedIds(){x(this,xy,null)}updateEditor(t,e){let r=l(this,Xh)?.get(t);return r?(r.updateFromAnnotationLayer(e),!0):!1}getEditor(t){return l(this,Xh)?.get(t)||null}get modifiedIds(){if(l(this,xy))return l(this,xy);let t=[];if(l(this,Xh))for(let e of l(this,Xh).values())e.serialize()&&t.push(e.annotationElementId);return x(this,xy,{ids:new Set(t),hash:t.join(",")})}[Symbol.iterator](){return l(this,Ki).entries()}};Ey=new WeakMap,xy=new WeakMap,Xh=new WeakMap,Ki=new WeakMap,fP=new WeakSet,zY=function(){l(this,Ey)||(x(this,Ey,!0),typeof this.onSetModified=="function"&&this.onSetModified())};DO=class extends NS{constructor(e){super();T(this,m_);let{map:r,hash:i,transfer:s}=e.serializable,a=structuredClone(r,s?{transfer:s}:null);x(this,m_,{map:a,hash:i,transfer:s})}get print(){qr("Should not call PrintAnnotationStorage.print")}get serializable(){return l(this,m_)}get modifiedIds(){return Ce(this,"modifiedIds",{ids:new Set,hash:""})}};m_=new WeakMap;C4=class{constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){T(this,Zw,new Set);this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));let e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(let t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),l(this,Zw).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:r}){if(!(!t||l(this,Zw).has(t.loadedName))){if(rr(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:i,src:s,style:a}=t,o=new FontFace(i,s,a);this.addNativeFontFace(o);try{await o.load(),l(this,Zw).add(i),r?.(t)}catch{De(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}qr("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){let r=t.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(i){throw De(`Failed to load font '${r.family}': '${i}'.`),t.disableFontFace=!0,i}}return}let e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(r=>{let i=this._queueLoadingCallback(r);this._prepareFontLoadEvent(t,i)})}}get isFontLoadingAPISupported(){let t=!!this._document?.fonts;return Ce(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){return Ce(this,"isSyncFontLoadingSupported",Us||Bn.platform.isFirefox)}_queueLoadingCallback(t){function e(){for(rr(!i.done,"completeRequest() cannot be called twice."),i.done=!0;r.length>0&&r[0].done;){let s=r.shift();setTimeout(s.callback,0)}}let{loadingRequests:r}=this,i={done:!1,complete:e,callback:t};return r.push(i),i}get _loadTestFont(){let t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Ce(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function r(_,S){return _.charCodeAt(S)<<24|_.charCodeAt(S+1)<<16|_.charCodeAt(S+2)<<8|_.charCodeAt(S+3)&255}function i(_,S,I,C){let M=_.substring(0,S),z=_.substring(S+I);return M+C+z}let s,a,o=this._document.createElement("canvas");o.width=1,o.height=1;let c=o.getContext("2d"),u=0;function h(_,S){if(++u>30){De("Load test font never loaded."),S();return}if(c.font="30px "+_,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0){S();return}setTimeout(h.bind(null,_,S))}let f=`lt${Date.now()}${this.loadTestFontId++}`,d=this._loadTestFont;d=i(d,976,f.length,f);let g=16,y=1482184792,b=r(d,g);for(s=0,a=f.length-3;s<a;s+=4)b=b-y+r(f,s)|0;s<f.length&&(b=b-y+r(f+"XXX",s)|0),d=i(d,g,4,aft(b));let m=`url(data:font/opentype;base64,${btoa(d)});`,w=`@font-face {font-family:"${f}";src:${m}}`;this.insertRule(w);let A=this._document.createElement("div");A.style.visibility="hidden",A.style.width=A.style.height="10px",A.style.position="absolute",A.style.top=A.style.left="0px";for(let _ of[t.loadedName,f]){let S=this._document.createElement("span");S.textContent="Hi",S.style.fontFamily=_,A.append(S)}this._document.body.append(A),h(f,()=>{A.remove(),e.complete()})}};Zw=new WeakMap;R4=class{constructor(t,e=null,r,i){T(this,Nr);this.compiledGlyphs=Object.create(null),x(this,Nr,t),this._inspectFont=e,r&&Object.assign(this,r),i&&(this.charProcOperatorList=i)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{let e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let t=`url(data:${this.mimetype};base64,${sY(this.data)});`,e;if(!this.cssFontInfo)e=`@font-face {font-family:"${this.loadedName}";src:${t}}`;else{let r=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(r+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),e=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${r}src:${t}}`}return this._inspectFont?.(this,t),e}getPathGenerator(t,e){if(this.compiledGlyphs[e]!==void 0)return this.compiledGlyphs[e];let r=this.loadedName+"_path_"+e,i;try{i=t.get(r)}catch(a){De(`getPathGenerator - ignoring character: "${a}".`)}let s=hY(i?.path);return this.fontExtraProperties||t.delete(r),this.compiledGlyphs[e]=s}get black(){return l(this,Nr).black}get bold(){return l(this,Nr).bold}get disableFontFace(){return l(this,Nr).disableFontFace??!1}set disableFontFace(t){Ce(this,"disableFontFace",!!t)}get fontExtraProperties(){return l(this,Nr).fontExtraProperties??!1}get isInvalidPDFjsFont(){return l(this,Nr).isInvalidPDFjsFont}get isType3Font(){return l(this,Nr).isType3Font}get italic(){return l(this,Nr).italic}get missingFile(){return l(this,Nr).missingFile}get remeasure(){return l(this,Nr).remeasure}get vertical(){return l(this,Nr).vertical}get ascent(){return l(this,Nr).ascent}get defaultWidth(){return l(this,Nr).defaultWidth}get descent(){return l(this,Nr).descent}get bbox(){return l(this,Nr).bbox}set bbox(t){Ce(this,"bbox",t)}get fontMatrix(){return l(this,Nr).fontMatrix}get fallbackName(){return l(this,Nr).fallbackName}get loadedName(){return l(this,Nr).loadedName}get mimetype(){return l(this,Nr).mimetype}get name(){return l(this,Nr).name}get data(){return l(this,Nr).data}clearData(){l(this,Nr).clearData()}get cssFontInfo(){return l(this,Nr).cssFontInfo}get systemFontInfo(){return l(this,Nr).systemFontInfo}get defaultVMetrics(){return l(this,Nr).defaultVMetrics}};Nr=new WeakMap;Tw=class Tw{constructor(t){T(this,tA);T(this,Jw);T(this,Qw);T(this,y_);x(this,Jw,t),x(this,Qw,new DataView(l(this,Jw))),x(this,y_,new TextDecoder)}static write(t){let e=new TextEncoder,r={},i=0;for(let u of Tw.strings){let h=e.encode(t[u]);r[u]=h,i+=4+h.length}let s=new ArrayBuffer(i),a=new Uint8Array(s),o=new DataView(s),c=0;for(let u of Tw.strings){let h=r[u],f=h.length;o.setUint32(c,f),a.set(h,c+4),c+=4+f}return rr(c===s.byteLength,"CssFontInfo.write: Buffer overflow"),s}get fontFamily(){return R(this,tA,ZD).call(this,0)}get fontWeight(){return R(this,tA,ZD).call(this,1)}get italicAngle(){return R(this,tA,ZD).call(this,2)}};Jw=new WeakMap,Qw=new WeakMap,y_=new WeakMap,tA=new WeakSet,ZD=function(t){rr(t<Tw.strings.length,"Invalid string index");let e=0;for(let i=0;i<t;i++)e+=l(this,Qw).getUint32(e)+4;let r=l(this,Qw).getUint32(e);return l(this,y_).decode(new Uint8Array(l(this,Jw),e+4,r))},Lt(Tw,"strings",["fontFamily","fontWeight","italicAngle"]);OO=Tw,Cw=class Cw{constructor(t){T(this,_y);T(this,lp);T(this,Qc);T(this,Sy);x(this,lp,t),x(this,Qc,new DataView(l(this,lp))),x(this,Sy,new TextDecoder)}static write(t){let e=new TextEncoder,r={},i=0;for(let d of Cw.strings){let p=e.encode(t[d]);r[d]=p,i+=4+p.length}i+=4;let s,a,o=1+i;t.style&&(s=e.encode(t.style.style),a=e.encode(t.style.weight),o+=4+s.length+4+a.length);let c=new ArrayBuffer(o),u=new Uint8Array(c),h=new DataView(c),f=0;h.setUint8(f++,t.guessFallback?1:0),h.setUint32(f,0),f+=4,i=0;for(let d of Cw.strings){let p=r[d],g=p.length;i+=4+g,h.setUint32(f,g),u.set(p,f+4),f+=4+g}return h.setUint32(f-i-4,i),t.style&&(h.setUint32(f,s.length),u.set(s,f+4),f+=4+s.length,h.setUint32(f,a.length),u.set(a,f+4),f+=4+a.length),rr(f<=c.byteLength,"SubstitionInfo.write: Buffer overflow"),c.transferToFixedLength(f)}get guessFallback(){return l(this,Qc).getUint8(0)!==0}get css(){return R(this,_y,uS).call(this,0)}get loadedName(){return R(this,_y,uS).call(this,1)}get baseFontName(){return R(this,_y,uS).call(this,2)}get src(){return R(this,_y,uS).call(this,3)}get style(){let t=1;t+=4+l(this,Qc).getUint32(t);let e=l(this,Qc).getUint32(t),r=l(this,Sy).decode(new Uint8Array(l(this,lp),t+4,e));t+=4+e;let i=l(this,Qc).getUint32(t),s=l(this,Sy).decode(new Uint8Array(l(this,lp),t+4,i));return{style:r,weight:s}}};lp=new WeakMap,Qc=new WeakMap,Sy=new WeakMap,_y=new WeakSet,uS=function(t){rr(t<Cw.strings.length,"Invalid string index");let e=5;for(let i=0;i<t;i++)e+=l(this,Qc).getUint32(e)+4;let r=l(this,Qc).getUint32(e);return l(this,Sy).decode(new Uint8Array(l(this,lp),e+4,r))},Lt(Cw,"strings",["css","loadedName","baseFontName","src"]);PO=Cw,Fe=class Fe{constructor({data:t,extra:e}){T(this,Fn);T(this,tu);T(this,b_);T(this,Lr);x(this,tu,t),x(this,b_,new TextDecoder),x(this,Lr,new DataView(l(this,tu))),e&&Object.assign(this,e)}get black(){return R(this,Fn,kl).call(this,0)}get bold(){return R(this,Fn,kl).call(this,1)}get disableFontFace(){return R(this,Fn,kl).call(this,2)}get fontExtraProperties(){return R(this,Fn,kl).call(this,3)}get isInvalidPDFjsFont(){return R(this,Fn,kl).call(this,4)}get isType3Font(){return R(this,Fn,kl).call(this,5)}get italic(){return R(this,Fn,kl).call(this,6)}get missingFile(){return R(this,Fn,kl).call(this,7)}get remeasure(){return R(this,Fn,kl).call(this,8)}get vertical(){return R(this,Fn,kl).call(this,9)}get ascent(){return R(this,Fn,JD).call(this,0)}get defaultWidth(){return R(this,Fn,JD).call(this,1)}get descent(){return R(this,Fn,JD).call(this,2)}get bbox(){let t=l(Fe,rA);if(l(this,Lr).getUint8(t)===0)return;t+=1;let r=[];for(let i=0;i<4;i++)r.push(l(this,Lr).getInt16(t,!0)),t+=2;return r}get fontMatrix(){let t=l(Fe,nA);if(l(this,Lr).getUint8(t)===0)return;t+=1;let r=[];for(let i=0;i<6;i++)r.push(l(this,Lr).getFloat64(t,!0)),t+=8;return r}get defaultVMetrics(){let t=l(Fe,iA);if(l(this,Lr).getUint8(t)===0)return;t+=1;let r=[];for(let i=0;i<3;i++)r.push(l(this,Lr).getInt16(t,!0)),t+=2;return r}get fallbackName(){return R(this,Fn,hS).call(this,0)}get loadedName(){return R(this,Fn,hS).call(this,1)}get mimetype(){return R(this,Fn,hS).call(this,2)}get name(){return R(this,Fn,hS).call(this,3)}get data(){let t=l(Fe,Ka),e=l(this,Lr).getUint32(t);t+=4+e;let r=l(this,Lr).getUint32(t);t+=4+r;let i=l(this,Lr).getUint32(t);t+=4+i;let s=l(this,Lr).getUint32(t);if(s!==0)return new Uint8Array(l(this,tu),t+4,s)}clearData(){let t=l(Fe,Ka),e=l(this,Lr).getUint32(t);t+=4+e;let r=l(this,Lr).getUint32(t);t+=4+r;let i=l(this,Lr).getUint32(t);t+=4+i;let s=l(this,Lr).getUint32(t);new Uint8Array(l(this,tu),t+4,s).fill(0),l(this,Lr).setUint32(t,0)}get cssFontInfo(){let t=l(Fe,Ka),e=l(this,Lr).getUint32(t);t+=4+e;let r=l(this,Lr).getUint32(t);t+=4+r;let i=l(this,Lr).getUint32(t);if(i===0)return null;let s=new Uint8Array(i);return s.set(new Uint8Array(l(this,tu),t+4,i)),new OO(s.buffer)}get systemFontInfo(){let t=l(Fe,Ka),e=l(this,Lr).getUint32(t);t+=4+e;let r=l(this,Lr).getUint32(t);if(r===0)return null;let i=new Uint8Array(r);return i.set(new Uint8Array(l(this,tu),t+4,r)),new PO(i.buffer)}static write(t){let e=t.systemFontInfo?PO.write(t.systemFontInfo):null,r=t.cssFontInfo?OO.write(t.cssFontInfo):null,i=new TextEncoder,s={},a=0;for(let y of Fe.strings)s[y]=i.encode(t[y]),a+=4+s[y].length;let o=l(Fe,Ka)+4+a+4+(e?e.byteLength:0)+4+(r?r.byteLength:0)+4+(t.data?t.data.length:0),c=new ArrayBuffer(o),u=new Uint8Array(c),h=new DataView(c),f=0,d=Fe.bools.length,p=0,g=0;for(let y=0;y<d;y++){let b=t[Fe.bools[y]];p|=(b===void 0?0:b?2:1)<<g,g+=2,(g===8||y===d-1)&&(h.setUint8(f++,p),p=0,g=0)}rr(f===l(Fe,eA),"FontInfo.write: Boolean properties offset mismatch");for(let y of Fe.numbers)h.setFloat64(f,t[y]),f+=8;if(rr(f===l(Fe,rA),"FontInfo.write: Number properties offset mismatch"),t.bbox){h.setUint8(f++,4);for(let y of t.bbox)h.setInt16(f,y,!0),f+=2}else h.setUint8(f++,0),f+=8;if(rr(f===l(Fe,nA),"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){h.setUint8(f++,6);for(let y of t.fontMatrix)h.setFloat64(f,y,!0),f+=8}else h.setUint8(f++,0),f+=48;if(rr(f===l(Fe,iA),"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){h.setUint8(f++,1);for(let y of t.defaultVMetrics)h.setInt16(f,y,!0),f+=2}else h.setUint8(f++,0),f+=6;rr(f===l(Fe,Ka),"FontInfo.write: DefaultVMetrics properties offset mismatch"),h.setUint32(l(Fe,Ka),0),f+=4;for(let y of Fe.strings){let b=s[y],m=b.length;h.setUint32(f,m),u.set(b,f+4),f+=4+m}if(h.setUint32(l(Fe,Ka),f-l(Fe,Ka)-4),!e)h.setUint32(f,0),f+=4;else{let y=e.byteLength;h.setUint32(f,y),rr(f+4+y<=c.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),u.set(new Uint8Array(e),f+4),f+=4+y}if(!r)h.setUint32(f,0),f+=4;else{let y=r.byteLength;h.setUint32(f,y),rr(f+4+y<=c.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),u.set(new Uint8Array(r),f+4),f+=4+y}return t.data===void 0?(h.setUint32(f,0),f+=4):(h.setUint32(f,t.data.length),u.set(t.data,f+4),f+=4+t.data.length),rr(f<=c.byteLength,"FontInfo.write: Buffer overflow"),c.transferToFixedLength(f)}};eA=new WeakMap,rA=new WeakMap,nA=new WeakMap,iA=new WeakMap,Ka=new WeakMap,tu=new WeakMap,b_=new WeakMap,Lr=new WeakMap,Fn=new WeakSet,kl=function(t){rr(t<Fe.bools.length,"Invalid boolean index");let e=Math.floor(t/4),r=t*2%8,i=l(this,Lr).getUint8(e)>>r&3;return i===0?void 0:i===2},JD=function(t){return rr(t<Fe.numbers.length,"Invalid number index"),l(this,Lr).getFloat64(l(Fe,eA)+t*8)},hS=function(t){rr(t<Fe.strings.length,"Invalid string index");let e=l(Fe,Ka)+4;for(let s=0;s<t;s++)e+=l(this,Lr).getUint32(e)+4;let r=l(this,Lr).getUint32(e),i=new Uint8Array(r);return i.set(new Uint8Array(l(this,tu),e+4,r)),l(this,b_).decode(i)},Lt(Fe,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),Lt(Fe,"numbers",["ascent","defaultWidth","descent"]),Lt(Fe,"strings",["fallbackName","loadedName","mimetype","name"]),T(Fe,eA,Math.ceil(Fe.bools.length*2/8)),T(Fe,rA,l(Fe,eA)+Fe.numbers.length*8),T(Fe,nA,l(Fe,rA)+1+8),T(Fe,iA,l(Fe,nA)+1+48),T(Fe,Ka,l(Fe,iA)+1+6);I4=Fe,Jr=class Jr{constructor(t){this.buffer=t,this.view=new DataView(t),this.data=new Uint8Array(t)}static write(t){let e,r=null,i=[],s=[],a=[],o=[],c=null,u=null;switch(t[0]){case"RadialAxial":e=t[1]==="axial"?1:2,r=t[2],a=t[3],e===1?i.push(...t[4],...t[5]):i.push(t[4][0],t[4][1],t[6],t[5][0],t[5][1],t[7]);break;case"Mesh":e=3,c=t[1],i=t[2],s=t[3],o=t[4]||[],r=t[6],u=t[7];break;default:throw new Error(`Unsupported pattern type: ${t[0]}`)}let h=Math.floor(i.length/2),f=Math.floor(s.length/3),d=a.length,p=o.length,g=0;for(let S of o)g+=1,g=Math.ceil(g/4)*4,g+=4+S.coords.length*4,g+=4+S.colors.length*4,S.verticesPerRow!==void 0&&(g+=4);let y=20+h*8+f*3+d*8+(r?16:0)+(u?3:0)+g,b=new ArrayBuffer(y),m=new DataView(b),w=new Uint8Array(b);m.setUint8(l(Jr,v_),e),m.setUint8(l(Jr,w_),r?1:0),m.setUint8(l(Jr,A_),u?1:0),m.setUint8(l(Jr,E_),c),m.setUint32(l(Jr,x_),h,!0),m.setUint32(l(Jr,S_),f,!0),m.setUint32(l(Jr,__),d,!0),m.setUint32(l(Jr,T_),p,!0);let A=20;new Float32Array(b,A,h*2).set(i),A+=h*8,w.set(s,A),A+=f*3;for(let[S,I]of a)m.setFloat32(A,S,!0),A+=4,m.setUint32(A,parseInt(I.slice(1),16),!0),A+=4;if(r)for(let S of r)m.setFloat32(A,S,!0),A+=4;u&&(w.set(u,A),A+=3);for(let S=0;S<o.length;S++){let I=o[S];m.setUint8(A,I.type),A+=1,A=Math.ceil(A/4)*4,m.setUint32(A,I.coords.length,!0),A+=4,new Int32Array(b,A,I.coords.length).set(I.coords),A+=I.coords.length*4,m.setUint32(A,I.colors.length,!0),A+=4,new Int32Array(b,A,I.colors.length).set(I.colors),A+=I.colors.length*4,I.verticesPerRow!==void 0&&(m.setUint32(A,I.verticesPerRow,!0),A+=4)}return b}getIR(){let t=this.view,e=this.data[l(Jr,v_)],r=!!this.data[l(Jr,w_)],i=!!this.data[l(Jr,A_)],s=t.getUint32(l(Jr,x_),!0),a=t.getUint32(l(Jr,S_),!0),o=t.getUint32(l(Jr,__),!0),c=t.getUint32(l(Jr,T_),!0),u=20,h=new Float32Array(this.buffer,u,s*2);u+=s*8;let f=new Uint8Array(this.buffer,u,a*3);u+=a*3;let d=[];for(let b=0;b<o;++b){let m=t.getFloat32(u,!0);u+=4;let w=t.getUint32(u,!0);u+=4,d.push([m,`#${w.toString(16).padStart(6,"0")}`])}let p=null;if(r){p=[];for(let b=0;b<4;++b)p.push(t.getFloat32(u,!0)),u+=4}let g=null;i&&(g=new Uint8Array(this.buffer,u,3),u+=3);let y=[];for(let b=0;b<c;++b){let m=t.getUint8(u);u+=1,u=Math.ceil(u/4)*4;let w=t.getUint32(u,!0);u+=4;let A=new Int32Array(this.buffer,u,w);u+=w*4;let _=t.getUint32(u,!0);u+=4;let S=new Int32Array(this.buffer,u,_);u+=_*4;let I={type:m,coords:A,colors:S};m===e4.LATTICE&&(I.verticesPerRow=t.getUint32(u,!0),u+=4),y.push(I)}if(e===1)return["RadialAxial","axial",p,d,Array.from(h.slice(0,2)),Array.from(h.slice(2,4)),null,null];if(e===2)return["RadialAxial","radial",p,d,[h[0],h[1]],[h[3],h[4]],h[2],h[5]];if(e===3){let b=this.data[l(Jr,E_)],m=null;if(h.length>0){let w=h[0],A=h[0],_=h[1],S=h[1];for(let I=0;I<h.length;I+=2){let C=h[I],M=h[I+1];w=w>C?C:w,_=_>M?M:_,A=A<C?C:A,S=S<M?M:S}m=[w,_,A,S]}return["Mesh",b,h,f,y,m,p,g]}throw new Error(`Unsupported pattern kind: ${e}`)}};v_=new WeakMap,w_=new WeakMap,A_=new WeakMap,E_=new WeakMap,x_=new WeakMap,S_=new WeakMap,__=new WeakMap,T_=new WeakMap,T(Jr,v_,0),T(Jr,w_,1),T(Jr,A_,2),T(Jr,E_,3),T(Jr,x_,4),T(Jr,S_,8),T(Jr,__,12),T(Jr,T_,16);D4=Jr,O4=class{constructor(t){T(this,sA);x(this,sA,t)}static write(t){let e,r;return Bn.isFloat16ArraySupported?(r=new ArrayBuffer(t.length*2),e=new Float16Array(r)):(r=new ArrayBuffer(t.length*4),e=new Float32Array(r)),e.set(t),r}get path(){return Bn.isFloat16ArraySupported?new Float16Array(l(this,sA)):new Float32Array(l(this,sA))}};sA=new WeakMap;P4=n=>typeof n=="object"&&Number.isInteger(n?.num)&&n.num>=0&&Number.isInteger(n?.gen)&&n.gen>=0,mft=n=>typeof n=="object"&&typeof n?.name=="string",WY=uft.bind(null,P4,mft),N4=class{constructor(){T(this,qh,new Map);T(this,dP,Promise.resolve())}postMessage(t,e){let r={data:structuredClone(t,e?{transfer:e}:null)};l(this,dP).then(()=>{for(let[i]of l(this,qh))i.call(this,r)})}addEventListener(t,e,r=null){let i=null;if(r?.signal instanceof AbortSignal){let{signal:s}=r;if(s.aborted){De("LoopbackPort - cannot use an `aborted` signal.");return}let a=()=>this.removeEventListener(t,e);i=()=>s.removeEventListener("abort",a),s.addEventListener("abort",a)}l(this,qh).set(e,i)}removeEventListener(t,e){l(this,qh).get(e)?.(),l(this,qh).delete(e)}terminate(){for(let[,t]of l(this,qh))t?.();l(this,qh).clear()}};qh=new WeakMap,dP=new WeakMap;MD={DATA:1,ERROR:2},Qn={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};ey=class{constructor(t,e,r){T(this,cl);T(this,aA,new AbortController);this.sourceName=t,this.targetName=e,this.comObj=r,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),r.addEventListener("message",R(this,cl,GY).bind(this),{signal:l(this,aA).signal})}on(t,e){let r=this.actionHandler;if(r[t])throw new Error(`There is already an actionName called "${t}"`);r[t]=e}send(t,e,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},r)}sendWithPromise(t,e,r){let i=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[i]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:e},r)}catch(a){s.reject(a)}return s.promise}sendWithStream(t,e,r,i){let s=this.streamId++,a=this.sourceName,o=this.targetName,c=this.comObj;return new ReadableStream({start:u=>{let h=Promise.withResolvers();return this.streamControllers[s]={controller:u,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:a,targetName:o,action:t,streamId:s,data:e,desiredSize:u.desiredSize},i),h.promise},pull:u=>{let h=Promise.withResolvers();return this.streamControllers[s].pullCall=h,c.postMessage({sourceName:a,targetName:o,stream:Qn.PULL,streamId:s,desiredSize:u.desiredSize}),h.promise},cancel:u=>{rr(u instanceof Error,"cancel must have a valid reason");let h=Promise.withResolvers();return this.streamControllers[s].cancelCall=h,this.streamControllers[s].isClosed=!0,c.postMessage({sourceName:a,targetName:o,stream:Qn.CANCEL,streamId:s,reason:oa(u)}),h.promise}},r)}destroy(){l(this,aA)?.abort(),x(this,aA,null)}};aA=new WeakMap,cl=new WeakSet,GY=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){R(this,cl,XY).call(this,t);return}if(t.callback){let r=t.callbackId,i=this.callbackCapabilities[r];if(!i)throw new Error(`Cannot resolve callback ${r}`);if(delete this.callbackCapabilities[r],t.callback===MD.DATA)i.resolve(t.data);else if(t.callback===MD.ERROR)i.reject(oa(t.reason));else throw new Error("Unexpected callback case");return}let e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){let r=this.sourceName,i=t.sourceName,s=this.comObj;Promise.try(e,t.data).then(function(a){s.postMessage({sourceName:r,targetName:i,callback:MD.DATA,callbackId:t.callbackId,data:a})},function(a){s.postMessage({sourceName:r,targetName:i,callback:MD.ERROR,callbackId:t.callbackId,reason:oa(a)})});return}if(t.streamId){R(this,cl,VY).call(this,t);return}e(t.data)},VY=function(t){let e=t.streamId,r=this.sourceName,i=t.sourceName,s=this.comObj,a=this,o=this.actionHandler[t.action],c={enqueue(u,h=1,f){if(this.isCancelled)return;let d=this.desiredSize;this.desiredSize-=h,d>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:r,targetName:i,stream:Qn.ENQUEUE,streamId:e,chunk:u},f)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:r,targetName:i,stream:Qn.CLOSE,streamId:e}),delete a.streamSinks[e])},error(u){rr(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,s.postMessage({sourceName:r,targetName:i,stream:Qn.ERROR,streamId:e,reason:oa(u)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[e]=c,Promise.try(o,t.data,c).then(function(){s.postMessage({sourceName:r,targetName:i,stream:Qn.START_COMPLETE,streamId:e,success:!0})},function(u){s.postMessage({sourceName:r,targetName:i,stream:Qn.START_COMPLETE,streamId:e,reason:oa(u)})})},XY=function(t){let e=t.streamId,r=this.sourceName,i=t.sourceName,s=this.comObj,a=this.streamControllers[e],o=this.streamSinks[e];switch(t.stream){case Qn.START_COMPLETE:t.success?a.startCall.resolve():a.startCall.reject(oa(t.reason));break;case Qn.PULL_COMPLETE:t.success?a.pullCall.resolve():a.pullCall.reject(oa(t.reason));break;case Qn.PULL:if(!o){s.postMessage({sourceName:r,targetName:i,stream:Qn.PULL_COMPLETE,streamId:e,success:!0});break}o.desiredSize<=0&&t.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=t.desiredSize,Promise.try(o.onPull||Hq).then(function(){s.postMessage({sourceName:r,targetName:i,stream:Qn.PULL_COMPLETE,streamId:e,success:!0})},function(u){s.postMessage({sourceName:r,targetName:i,stream:Qn.PULL_COMPLETE,streamId:e,reason:oa(u)})});break;case Qn.ENQUEUE:if(rr(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(t.chunk);break;case Qn.CLOSE:if(rr(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),R(this,cl,QD).call(this,a,e);break;case Qn.ERROR:rr(a,"error should have stream controller"),a.controller.error(oa(t.reason)),R(this,cl,QD).call(this,a,e);break;case Qn.CANCEL_COMPLETE:t.success?a.cancelCall.resolve():a.cancelCall.reject(oa(t.reason)),R(this,cl,QD).call(this,a,e);break;case Qn.CANCEL:if(!o)break;let c=oa(t.reason);Promise.try(o.onCancel||Hq,c).then(function(){s.postMessage({sourceName:r,targetName:i,stream:Qn.CANCEL_COMPLETE,streamId:e,success:!0})},function(u){s.postMessage({sourceName:r,targetName:i,stream:Qn.CANCEL_COMPLETE,streamId:e,reason:oa(u)})}),o.sinkCapability.reject(c),o.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},QD=async function(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]};NO=class{constructor({enableHWA:t=!1}){T(this,C_,!1);x(this,C_,t)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");let r=this._createCanvas(t,e);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!l(this,C_)})}}reset(t,e,r){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||r<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=r}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){qr("Abstract method `_createCanvas` called.")}};C_=new WeakMap;L4=class extends NO{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){let r=this._document.createElement("canvas");return r.width=t,r.height=e,r}},LO=class{constructor({baseUrl:t=null,isCompressed:e=!0}){this.baseUrl=t,this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");let e=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(e).then(r=>({cMapData:r,isCompressed:this.isCompressed})).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)})}async _fetch(t){qr("Abstract method `_fetch` called.")}},kO=class extends LO{async _fetch(t){let e=await oE(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):LT(e)}},MO=class{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,r,i,s){return"none"}destroy(t=!1){}},k4=class extends MO{constructor({docId:e,ownerDocument:r=globalThis.document}){super();T(this,fe);T(this,Ty);T(this,oA);T(this,Yh);T(this,Kh);T(this,bs);T(this,Cy);T(this,Ry,0);x(this,Kh,e),x(this,bs,r)}addFilter(e){if(!e)return"none";let r=l(this,fe,ps).get(e);if(r)return r;let[i,s,a]=R(this,fe,tO).call(this,e),o=e.length===1?i:`${i}${s}${a}`;if(r=l(this,fe,ps).get(o),r)return l(this,fe,ps).set(e,r),r;let c=`g_${l(this,Kh)}_transfer_map_${ze(this,Ry)._++}`,u=R(this,fe,yw).call(this,c);l(this,fe,ps).set(e,u),l(this,fe,ps).set(o,u);let h=R(this,fe,bw).call(this,c);return R(this,fe,pS).call(this,i,s,a,h),u}addHCMFilter(e,r){let i=`${e}-${r}`,s="base",a=l(this,fe,fS).get(s);if(a?.key===i||(a?(a.filter?.remove(),a.key=i,a.url="none",a.filter=null):(a={key:i,url:"none",filter:null},l(this,fe,fS).set(s,a)),!e||!r))return a.url;let o=R(this,fe,gS).call(this,e);e=se.makeHexColor(...o);let c=R(this,fe,gS).call(this,r);if(r=se.makeHexColor(...c),l(this,fe,mw).style.color="",e==="#000000"&&r==="#ffffff"||e===r)return a.url;let u=new Array(256);for(let g=0;g<=255;g++){let y=g/255;u[g]=y<=.03928?y/12.92:((y+.055)/1.055)**2.4}let h=u.join(","),f=`g_${l(this,Kh)}_hcm_filter`,d=a.filter=R(this,fe,bw).call(this,f);R(this,fe,pS).call(this,h,h,h,d),R(this,fe,M4).call(this,d);let p=(g,y)=>{let b=o[g]/255,m=c[g]/255,w=new Array(y+1);for(let A=0;A<=y;A++)w[A]=b+A/y*(m-b);return w.join(",")};return R(this,fe,pS).call(this,p(0,5),p(1,5),p(2,5),d),a.url=R(this,fe,yw).call(this,f),a.url}addAlphaFilter(e){let r=l(this,fe,ps).get(e);if(r)return r;let[i]=R(this,fe,tO).call(this,[e]),s=`alpha_${i}`;if(r=l(this,fe,ps).get(s),r)return l(this,fe,ps).set(e,r),r;let a=`g_${l(this,Kh)}_alpha_map_${ze(this,Ry)._++}`,o=R(this,fe,yw).call(this,a);l(this,fe,ps).set(e,o),l(this,fe,ps).set(s,o);let c=R(this,fe,bw).call(this,a);return R(this,fe,F4).call(this,i,c),o}addLuminosityFilter(e){let r=l(this,fe,ps).get(e||"luminosity");if(r)return r;let i,s;if(e?([i]=R(this,fe,tO).call(this,[e]),s=`luminosity_${i}`):s="luminosity",r=l(this,fe,ps).get(s),r)return l(this,fe,ps).set(e,r),r;let a=`g_${l(this,Kh)}_luminosity_map_${ze(this,Ry)._++}`,o=R(this,fe,yw).call(this,a);l(this,fe,ps).set(e,o),l(this,fe,ps).set(s,o);let c=R(this,fe,bw).call(this,a);return R(this,fe,qY).call(this,c),e&&R(this,fe,F4).call(this,i,c),o}addHighlightHCMFilter(e,r,i,s,a){let o=`${r}-${i}-${s}-${a}`,c=l(this,fe,fS).get(e);if(c?.key===o||(c?(c.filter?.remove(),c.key=o,c.url="none",c.filter=null):(c={key:o,url:"none",filter:null},l(this,fe,fS).set(e,c)),!r||!i))return c.url;let[u,h]=[r,i].map(R(this,fe,gS).bind(this)),f=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),d=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[p,g]=[s,a].map(R(this,fe,gS).bind(this));d<f&&([f,d,p,g]=[d,f,g,p]),l(this,fe,mw).style.color="";let y=(w,A,_)=>{let S=new Array(256),I=(d-f)/_,C=w/255,M=(A-w)/(255*_),z=0;for(let G=0;G<=_;G++){let Y=Math.round(f+G*I),L=C+G*M;for(let j=z;j<=Y;j++)S[j]=L;z=Y+1}for(let G=z;G<256;G++)S[G]=S[z-1];return S.join(",")},b=`g_${l(this,Kh)}_hcm_${e}_filter`,m=c.filter=R(this,fe,bw).call(this,b);return R(this,fe,M4).call(this,m),R(this,fe,pS).call(this,y(p[0],g[0],5),y(p[1],g[1],5),y(p[2],g[2],5),m),c.url=R(this,fe,yw).call(this,b),c.url}destroy(e=!1){e&&l(this,Cy)?.size||(l(this,Yh)?.parentNode.parentNode.remove(),x(this,Yh,null),l(this,oA)?.clear(),x(this,oA,null),l(this,Cy)?.clear(),x(this,Cy,null),x(this,Ry,0))}};Ty=new WeakMap,oA=new WeakMap,Yh=new WeakMap,Kh=new WeakMap,bs=new WeakMap,Cy=new WeakMap,Ry=new WeakMap,fe=new WeakSet,ps=function(){return l(this,oA)||x(this,oA,new Map)},fS=function(){return l(this,Cy)||x(this,Cy,new Map)},mw=function(){if(!l(this,Yh)){let e=l(this,bs).createElement("div"),{style:r}=e;r.visibility="hidden",r.contain="strict",r.width=r.height=0,r.position="absolute",r.top=r.left=0,r.zIndex=-1;let i=l(this,bs).createElementNS(Ph,"svg");i.setAttribute("width",0),i.setAttribute("height",0),x(this,Yh,l(this,bs).createElementNS(Ph,"defs")),e.append(i),i.append(l(this,Yh)),l(this,bs).body.append(e)}return l(this,Yh)},tO=function(e){if(e.length===1){let u=e[0],h=new Array(256);for(let d=0;d<256;d++)h[d]=u[d]/255;let f=h.join(",");return[f,f,f]}let[r,i,s]=e,a=new Array(256),o=new Array(256),c=new Array(256);for(let u=0;u<256;u++)a[u]=r[u]/255,o[u]=i[u]/255,c[u]=s[u]/255;return[a.join(","),o.join(","),c.join(",")]},yw=function(e){if(l(this,Ty)===void 0){x(this,Ty,"");let r=l(this,bs).URL;r!==l(this,bs).baseURI&&(kT(r)?De('#createUrl: ignore "data:"-URL for performance reasons.'):x(this,Ty,O5(r,"")))}return`url(${l(this,Ty)}#${e})`},qY=function(e){let r=l(this,bs).createElementNS(Ph,"feColorMatrix");r.setAttribute("type","matrix"),r.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"),e.append(r)},M4=function(e){let r=l(this,bs).createElementNS(Ph,"feColorMatrix");r.setAttribute("type","matrix"),r.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"),e.append(r)},bw=function(e){let r=l(this,bs).createElementNS(Ph,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",e),l(this,fe,mw).append(r),r},dS=function(e,r,i){let s=l(this,bs).createElementNS(Ph,r);s.setAttribute("type","discrete"),s.setAttribute("tableValues",i),e.append(s)},pS=function(e,r,i,s){let a=l(this,bs).createElementNS(Ph,"feComponentTransfer");s.append(a),R(this,fe,dS).call(this,a,"feFuncR",e),R(this,fe,dS).call(this,a,"feFuncG",r),R(this,fe,dS).call(this,a,"feFuncB",i)},F4=function(e,r){let i=l(this,bs).createElementNS(Ph,"feComponentTransfer");r.append(i),R(this,fe,dS).call(this,i,"feFuncA",e)},gS=function(e){return l(this,fe,mw).style.color=e,lE(getComputedStyle(l(this,fe,mw)).getPropertyValue("color"))};FO=class{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");let e=`${this.baseUrl}${t}`;return this._fetch(e).catch(r=>{throw new Error(`Unable to load font data at: ${e}`)})}async _fetch(t){qr("Abstract method `_fetch` called.")}},BO=class extends FO{async _fetch(t){let e=await oE(t,"arraybuffer");return new Uint8Array(e)}},UO=class{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!t)throw new Error("Wasm filename must be specified.");let e=`${this.baseUrl}${t}`;return this._fetch(e).catch(r=>{throw new Error(`Unable to load wasm data at: ${e}`)})}async _fetch(t){qr("Abstract method `_fetch` called.")}},jO=class extends UO{async _fetch(t){let e=await oE(t,"arraybuffer");return new Uint8Array(e)}};Us&&De("Please use the `legacy` build in Node.js environments.");B4=class extends MO{},U4=class extends NO{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire("")("@napi-rs/canvas").createCanvas(t,e)}},j4=class extends LO{async _fetch(t){return L5(t)}},$4=class extends FO{async _fetch(t){return L5(t)}},H4=class extends UO{async _fetch(t){return L5(t)}},dw="__forcedDependency",{floor:zq,ceil:Wq}=Math;z4=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],W4=class{constructor(t,e){T(this,lA);T(this,cp);x(this,lA,t),x(this,cp,e)}get length(){return l(this,lA).length}isEmpty(t){return l(this,lA)[t]===z4}minX(t){return l(this,cp)[t*4+0]/256}minY(t){return l(this,cp)[t*4+1]/256}maxX(t){return(l(this,cp)[t*4+2]+1)/256}maxY(t){return(l(this,cp)[t*4+3]+1)/256}};lA=new WeakMap,cp=new WeakMap;BD=(n,t)=>{if(!n)return;let e=n.get(t);return e||(e={dependencies:new Set,isRenderingOperation:!1},n.set(t,e)),e},G4=class{constructor(t,e,r=!1){T(this,I_);T(this,ua,{__proto__:null});T(this,ha,{__proto__:null,transform:[],moveText:[],sameLineText:[],[dw]:[]});T(this,Iy,new Map);T(this,jl,[]);T(this,Dy,[]);T(this,Zh,[[1,0,0,1,0,0]]);T(this,xr,[-1/0,-1/0,1/0,1/0]);T(this,kr,new Float64Array([1/0,1/0,-1/0,-1/0]));T(this,Jh,-1);T(this,fa,new Set);T(this,R_,new Map);T(this,cA,new Map);T(this,Oy);T(this,Py);T(this,Qh);T(this,vs);T(this,eu);x(this,Oy,t.width),x(this,Py,t.height),R(this,I_,V4).call(this,e),r&&x(this,eu,new Map)}growOperationsCount(t){t>=l(this,vs).length&&R(this,I_,V4).call(this,t,l(this,vs))}save(t){return x(this,ua,{__proto__:l(this,ua)}),x(this,ha,{__proto__:l(this,ha),transform:{__proto__:l(this,ha).transform},moveText:{__proto__:l(this,ha).moveText},sameLineText:{__proto__:l(this,ha).sameLineText},[dw]:{__proto__:l(this,ha)[dw]}}),x(this,xr,{__proto__:l(this,xr)}),l(this,jl).push(t),this}restore(t){let e=Object.getPrototypeOf(l(this,ua));if(e===null)return this;x(this,ua,e),x(this,ha,Object.getPrototypeOf(l(this,ha))),x(this,xr,Object.getPrototypeOf(l(this,xr)));let r=l(this,jl).pop();return r!==void 0&&(BD(l(this,eu),t)?.dependencies.add(r),l(this,vs)[t]=l(this,vs)[r]),this}recordOpenMarker(t){return l(this,jl).push(t),this}getOpenMarker(){return l(this,jl).length===0?null:l(this,jl).at(-1)}recordCloseMarker(t){let e=l(this,jl).pop();return e!==void 0&&(BD(l(this,eu),t)?.dependencies.add(e),l(this,vs)[t]=l(this,vs)[e]),this}beginMarkedContent(t){return l(this,Dy).push(t),this}endMarkedContent(t){let e=l(this,Dy).pop();return e!==void 0&&(BD(l(this,eu),t)?.dependencies.add(e),l(this,vs)[t]=l(this,vs)[e]),this}pushBaseTransform(t){return l(this,Zh).push(se.multiplyByDOMMatrix(l(this,Zh).at(-1),t.getTransform())),this}popBaseTransform(){return l(this,Zh).length>1&&l(this,Zh).pop(),this}recordSimpleData(t,e){return l(this,ua)[t]=e,this}recordIncrementalData(t,e){return l(this,ha)[t].push(e),this}resetIncrementalData(t,e){return l(this,ha)[t].length=0,this}recordNamedData(t,e){return l(this,Iy).set(t,e),this}recordSimpleDataFromNamed(t,e,r){l(this,ua)[t]=l(this,Iy).get(e)??r}recordFutureForcedDependency(t,e){return this.recordIncrementalData(dw,e),this}inheritSimpleDataAsFutureForcedDependencies(t){for(let e of t)e in l(this,ua)&&this.recordFutureForcedDependency(e,l(this,ua)[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let t of l(this,fa))this.recordFutureForcedDependency(dw,t);return this}resetBBox(t){return l(this,Jh)!==t&&(x(this,Jh,t),l(this,kr)[0]=1/0,l(this,kr)[1]=1/0,l(this,kr)[2]=-1/0,l(this,kr)[3]=-1/0),this}recordClipBox(t,e,r,i,s,a){let o=se.multiplyByDOMMatrix(l(this,Zh).at(-1),e.getTransform()),c=[1/0,1/0,-1/0,-1/0];se.axialAlignedBoundingBox([r,s,i,a],o,c);let u=se.intersect(l(this,xr),c);return u?(l(this,xr)[0]=u[0],l(this,xr)[1]=u[1],l(this,xr)[2]=u[2],l(this,xr)[3]=u[3]):(l(this,xr)[0]=l(this,xr)[1]=1/0,l(this,xr)[2]=l(this,xr)[3]=-1/0),this}recordBBox(t,e,r,i,s,a){let o=l(this,xr);if(o[0]===1/0)return this;let c=se.multiplyByDOMMatrix(l(this,Zh).at(-1),e.getTransform());if(o[0]===-1/0)return se.axialAlignedBoundingBox([r,s,i,a],c,l(this,kr)),this;let u=[1/0,1/0,-1/0,-1/0];return se.axialAlignedBoundingBox([r,s,i,a],c,u),l(this,kr)[0]=Math.min(l(this,kr)[0],Math.max(u[0],o[0])),l(this,kr)[1]=Math.min(l(this,kr)[1],Math.max(u[1],o[1])),l(this,kr)[2]=Math.max(l(this,kr)[2],Math.min(u[2],o[2])),l(this,kr)[3]=Math.max(l(this,kr)[3],Math.min(u[3],o[3])),this}recordCharacterBBox(t,e,r,i=1,s=0,a=0,o){let c=r.bbox,u,h;if(c&&(u=c[2]!==c[0]&&c[3]!==c[1]&&l(this,cA).get(r),u!==!1&&(h=[0,0,0,0],se.axialAlignedBoundingBox(c,r.fontMatrix,h),(i!==1||s!==0||a!==0)&&se.scaleMinMax([i,0,0,-i,s,a],h),u)))return this.recordBBox(t,e,h[0],h[2],h[1],h[3]);if(!o)return this.recordFullPageBBox(t);let f=o();return c&&h&&u===void 0&&(u=h[0]<=s-f.actualBoundingBoxLeft&&h[2]>=s+f.actualBoundingBoxRight&&h[1]<=a-f.actualBoundingBoxAscent&&h[3]>=a+f.actualBoundingBoxDescent,l(this,cA).set(r,u),u)?this.recordBBox(t,e,h[0],h[2],h[1],h[3]):this.recordBBox(t,e,s-f.actualBoundingBoxLeft,s+f.actualBoundingBoxRight,a-f.actualBoundingBoxAscent,a+f.actualBoundingBoxDescent)}recordFullPageBBox(t){return l(this,kr)[0]=Math.max(0,l(this,xr)[0]),l(this,kr)[1]=Math.max(0,l(this,xr)[1]),l(this,kr)[2]=Math.min(l(this,Oy),l(this,xr)[2]),l(this,kr)[3]=Math.min(l(this,Py),l(this,xr)[3]),this}getSimpleIndex(t){return l(this,ua)[t]}recordDependencies(t,e){let r=l(this,fa),i=l(this,ua),s=l(this,ha);for(let a of e)a in l(this,ua)?r.add(i[a]):a in s&&s[a].forEach(r.add,r);return this}recordNamedDependency(t,e){return l(this,Iy).has(e)&&l(this,fa).add(l(this,Iy).get(e)),this}recordOperation(t,e=!1){if(this.recordDependencies(t,[dw]),l(this,eu)){let r=BD(l(this,eu),t),{dependencies:i}=r;l(this,fa).forEach(i.add,i),l(this,jl).forEach(i.add,i),l(this,Dy).forEach(i.add,i),i.delete(t),r.isRenderingOperation=!0}if(l(this,Jh)===t){let r=zq(l(this,kr)[0]*256/l(this,Oy)),i=zq(l(this,kr)[1]*256/l(this,Py)),s=Wq(l(this,kr)[2]*256/l(this,Oy)),a=Wq(l(this,kr)[3]*256/l(this,Py));FD(l(this,Qh),t,r,i,s,a);for(let o of l(this,fa))o!==t&&FD(l(this,Qh),o,r,i,s,a);for(let o of l(this,jl))o!==t&&FD(l(this,Qh),o,r,i,s,a);for(let o of l(this,Dy))o!==t&&FD(l(this,Qh),o,r,i,s,a);e||(l(this,fa).clear(),x(this,Jh,-1))}return this}recordShowTextOperation(t,e=!1){let r=Array.from(l(this,fa));this.recordOperation(t,e),this.recordIncrementalData("sameLineText",t);for(let i of r)this.recordIncrementalData("sameLineText",i);return this}bboxToClipBoxDropOperation(t,e=!1){return l(this,Jh)===t&&(x(this,Jh,-1),l(this,xr)[0]=Math.max(l(this,xr)[0],l(this,kr)[0]),l(this,xr)[1]=Math.max(l(this,xr)[1],l(this,kr)[1]),l(this,xr)[2]=Math.min(l(this,xr)[2],l(this,kr)[2]),l(this,xr)[3]=Math.min(l(this,xr)[3],l(this,kr)[3]),e||l(this,fa).clear()),this}_takePendingDependencies(){let t=l(this,fa);return x(this,fa,new Set),t}_extractOperation(t){let e=l(this,R_).get(t);return l(this,R_).delete(t),e}_pushPendingDependencies(t){for(let e of t)l(this,fa).add(e)}take(){return l(this,cA).clear(),new W4(l(this,vs),l(this,Qh))}takeDebugMetadata(){return l(this,eu)}};ua=new WeakMap,ha=new WeakMap,Iy=new WeakMap,jl=new WeakMap,Dy=new WeakMap,Zh=new WeakMap,xr=new WeakMap,kr=new WeakMap,Jh=new WeakMap,fa=new WeakMap,R_=new WeakMap,cA=new WeakMap,Oy=new WeakMap,Py=new WeakMap,Qh=new WeakMap,vs=new WeakMap,eu=new WeakMap,I_=new WeakSet,V4=function(t,e){let r=new ArrayBuffer(t*4);x(this,Qh,new Uint8ClampedArray(r)),x(this,vs,new Uint32Array(r)),e&&e.length>0?(l(this,vs).set(e),l(this,vs).fill(z4,e.length)):l(this,vs).fill(z4)};B5=class B5{constructor(t,e,r){T(this,Vr);T(this,Ln);T(this,$l);T(this,uA,0);T(this,hA,0);if(t instanceof B5&&l(t,$l)===!!r)return t;x(this,Vr,t),x(this,Ln,e),x(this,$l,!!r)}growOperationsCount(){throw new Error("Unreachable")}save(t){return ze(this,hA)._++,l(this,Vr).save(l(this,Ln)),this}restore(t){return l(this,hA)>0&&(l(this,Vr).restore(l(this,Ln)),ze(this,hA)._--),this}recordOpenMarker(t){return ze(this,uA)._++,this}getOpenMarker(){return l(this,uA)>0?l(this,Ln):l(this,Vr).getOpenMarker()}recordCloseMarker(t){return ze(this,uA)._--,this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return l(this,Vr).pushBaseTransform(t),this}popBaseTransform(){return l(this,Vr).popBaseTransform(),this}recordSimpleData(t,e){return l(this,Vr).recordSimpleData(t,l(this,Ln)),this}recordIncrementalData(t,e){return l(this,Vr).recordIncrementalData(t,l(this,Ln)),this}resetIncrementalData(t,e){return l(this,Vr).resetIncrementalData(t,l(this,Ln)),this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,r){return l(this,Vr).recordSimpleDataFromNamed(t,e,l(this,Ln)),this}recordFutureForcedDependency(t,e){return l(this,Vr).recordFutureForcedDependency(t,l(this,Ln)),this}inheritSimpleDataAsFutureForcedDependencies(t){return l(this,Vr).inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return l(this,Vr).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return l(this,$l)||l(this,Vr).resetBBox(l(this,Ln)),this}recordClipBox(t,e,r,i,s,a){return l(this,$l)||l(this,Vr).recordClipBox(l(this,Ln),e,r,i,s,a),this}recordBBox(t,e,r,i,s,a){return l(this,$l)||l(this,Vr).recordBBox(l(this,Ln),e,r,i,s,a),this}recordCharacterBBox(t,e,r,i,s,a,o){return l(this,$l)||l(this,Vr).recordCharacterBBox(l(this,Ln),e,r,i,s,a,o),this}recordFullPageBBox(t){return l(this,$l)||l(this,Vr).recordFullPageBBox(l(this,Ln)),this}getSimpleIndex(t){return l(this,Vr).getSimpleIndex(t)}recordDependencies(t,e){return l(this,Vr).recordDependencies(l(this,Ln),e),this}recordNamedDependency(t,e){return l(this,Vr).recordNamedDependency(l(this,Ln),e),this}recordOperation(t){return l(this,Vr).recordOperation(l(this,Ln),!0),this}recordShowTextOperation(t){return l(this,Vr).recordShowTextOperation(l(this,Ln),!0),this}bboxToClipBoxDropOperation(t){return l(this,$l)||l(this,Vr).bboxToClipBoxDropOperation(l(this,Ln),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}};Vr=new WeakMap,Ln=new WeakMap,$l=new WeakMap,uA=new WeakMap,hA=new WeakMap;$O=B5,Xo={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"]},Qi={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};LS=class{isModifyingCurrentTransform(){return!1}getPattern(){qr("Abstract method `getPattern` called.")}},q4=class extends LS{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[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(t,e=null){let r,i=this._p0,s=this._p1;if(e&&(i=i.slice(),s=s.slice(),se.applyTransform(i,e),se.applyTransform(s,e)),this._type==="axial")r=t.createLinearGradient(i[0],i[1],s[0],s[1]);else if(this._type==="radial"){let a=this._r0,o=this._r1;if(e){let c=new Float32Array(2);se.singularValueDecompose2dScale(e,c),a*=c[0],o*=c[0]}r=t.createRadialGradient(i[0],i[1],a,s[0],s[1],o)}for(let a of this._colorStops)r.addColorStop(a[0],a[1]);return r}getPattern(t,e,r,i){let s;if(i===Qi.STROKE||i===Qi.FILL){if(this.isOriginBased()){let d=se.transform(r,e.baseTransform);this.matrix&&(d=se.transform(d,this.matrix));let p=.001,g=Math.hypot(d[0],d[1]),y=Math.hypot(d[2],d[3]),b=(d[0]*d[2]+d[1]*d[3])/(g*y);if(Math.abs(b)<p)if(this.isRadial()){if(Math.abs(g-y)<p)return this._createGradient(t,d)}else return this._createGradient(t,d)}let a=e.current.getClippedPathBoundingBox(i,vn(t))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,c=Math.ceil(a[3]-a[1])||1,u=e.cachedCanvases.getCanvas("pattern",o,c),h=u.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-a[0],-a[1]),r=se.transform(r,[1,0,0,1,a[0],a[1]]),h.transform(...e.baseTransform),this.matrix&&h.transform(...this.matrix),X4(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),s=t.createPattern(u.canvas,"no-repeat");let f=new DOMMatrix(r);s.setTransform(f)}else X4(t,this._bbox),s=this._createGradient(t);return s}};Y4=class extends LS{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null}_createMeshCanvas(t,e,r){let o=Math.floor(this._bounds[0]),c=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-o,h=Math.ceil(this._bounds[3])-c,f=Math.min(Math.ceil(Math.abs(u*t[0]*1.1)),3e3),d=Math.min(Math.ceil(Math.abs(h*t[1]*1.1)),3e3),p=u/f,g=h/d,y={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-c,scaleX:1/p,scaleY:1/g},b=f+4,m=d+4,w=r.getCanvas("mesh",b,m),A=w.context,_=A.createImageData(f,d);if(e){let I=_.data;for(let C=0,M=I.length;C<M;C+=4)I[C]=e[0],I[C+1]=e[1],I[C+2]=e[2],I[C+3]=255}for(let I of this._figures)yft(_,I,y);return A.putImageData(_,2,2),{canvas:w.canvas,offsetX:o-2*p,offsetY:c-2*g,scaleX:p,scaleY:g}}isModifyingCurrentTransform(){return!0}getPattern(t,e,r,i){X4(t,this._bbox);let s=new Float32Array(2);if(i===Qi.SHADING)se.singularValueDecompose2dScale(vn(t),s);else if(this.matrix){se.singularValueDecompose2dScale(this.matrix,s);let[o,c]=s;se.singularValueDecompose2dScale(e.baseTransform,s),s[0]*=o,s[1]*=c}else se.singularValueDecompose2dScale(e.baseTransform,s);let a=this._createMeshCanvas(s,i===Qi.SHADING?null:this._background,e.cachedCanvases);return i!==Qi.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(a.offsetX,a.offsetY),t.scale(a.scaleX,a.scaleY),t.createPattern(a.canvas,"no-repeat")}},K4=class extends LS{getPattern(){return"hotpink"}};Gq={COLORED:1,UNCOLORED:2},pP=class pP{constructor(t,e,r,i){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=e,this.canvasGraphicsFactory=r,this.baseTransform=i}createPatternCanvas(t,e){let{bbox:r,operatorList:i,paintType:s,tilingType:a,color:o,canvasGraphicsFactory:c}=this,{xstep:u,ystep:h}=this;u=Math.abs(u),h=Math.abs(h),TP("TilingType: "+a);let f=r[0],d=r[1],p=r[2],g=r[3],y=p-f,b=g-d,m=new Float32Array(2);se.singularValueDecompose2dScale(this.matrix,m);let[w,A]=m;se.singularValueDecompose2dScale(this.baseTransform,m);let _=w*m[0],S=A*m[1],I=y,C=b,M=!1,z=!1,G=Math.ceil(u*_),Y=Math.ceil(h*S),L=Math.ceil(y*_),j=Math.ceil(b*S);G>=L?I=u:M=!0,Y>=j?C=h:z=!0;let q=this.getSizeAndScale(I,this.ctx.canvas.width,_),nt=this.getSizeAndScale(C,this.ctx.canvas.height,S),J=t.cachedCanvases.getCanvas("pattern",q.size,nt.size),N=J.context,D=c.createCanvasGraphics(N,e);if(D.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(D,s,o),N.translate(-q.scale*f,-nt.scale*d),D.transform(0,q.scale,0,0,nt.scale,0,0),N.save(),D.dependencyTracker?.save(),this.clipBbox(D,f,d,p,g),D.baseTransform=vn(D.ctx),D.executeOperatorList(i),D.endDrawing(),D.dependencyTracker?.restore(),N.restore(),M||z){let F=J.canvas;M&&(I=u),z&&(C=h);let P=this.getSizeAndScale(I,this.ctx.canvas.width,_),V=this.getSizeAndScale(C,this.ctx.canvas.height,S),$=P.size,H=V.size,rt=t.cachedCanvases.getCanvas("pattern-workaround",$,H),lt=rt.context,ft=M?Math.floor(y/u):0,K=z?Math.floor(b/h):0;for(let X=0;X<=ft;X++)for(let st=0;st<=K;st++)lt.drawImage(F,$*X,H*st,$,H,0,0,$,H);return{canvas:rt.canvas,scaleX:P.scale,scaleY:V.scale,offsetX:f,offsetY:d}}return{canvas:J.canvas,scaleX:q.scale,scaleY:nt.scale,offsetX:f,offsetY:d}}getSizeAndScale(t,e,r){let i=Math.max(pP.MAX_PATTERN_SIZE,e),s=Math.ceil(t*r);return s>=i?s=i:r=s/t,{scale:r,size:s}}clipBbox(t,e,r,i,s){let a=i-e,o=s-r;t.ctx.rect(e,r,a,o),se.axialAlignedBoundingBox([e,r,i,s],vn(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,r){let i=t.ctx,s=t.current;switch(e){case Gq.COLORED:let{fillStyle:a,strokeStyle:o}=this.ctx;i.fillStyle=s.fillColor=a,i.strokeStyle=s.strokeColor=o;break;case Gq.UNCOLORED:i.fillStyle=i.strokeStyle=r,s.fillColor=s.strokeColor=r;break;default:throw new r4(`Unsupported paint type: ${e}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,e,r,i,s){let a=r;i!==Qi.SHADING&&(a=se.transform(a,e.baseTransform),this.matrix&&(a=se.transform(a,this.matrix)));let o=this.createPatternCanvas(e,s),c=new DOMMatrix(a);c=c.translate(o.offsetX,o.offsetY),c=c.scale(1/o.scaleX,1/o.scaleY);let u=t.createPattern(o.canvas,"repeat");return u.setTransform(c),u}};Lt(pP,"MAX_PATTERN_SIZE",3e3);Z4=pP;Vq=16,Xq=100,wft=15,qq=10,ga=16,Z3=new DOMMatrix,po=new Float32Array(2),Sw=new Float32Array([1/0,1/0,-1/0,-1/0]);J4=class{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,r){let i;return this.cache[t]!==void 0?(i=this.cache[t],this.canvasFactory.reset(i,e,r)):(i=this.canvasFactory.create(e,r),this.cache[t]=i),i}delete(t){delete this.cache[t]}clear(){for(let t in this.cache){let e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}};HO=class{constructor(t,e,r){Lt(this,"alphaIsShape",!1);Lt(this,"fontSize",0);Lt(this,"fontSizeScale",1);Lt(this,"textMatrix",null);Lt(this,"textMatrixScale",1);Lt(this,"fontMatrix",t4);Lt(this,"leading",0);Lt(this,"x",0);Lt(this,"y",0);Lt(this,"lineX",0);Lt(this,"lineY",0);Lt(this,"charSpacing",0);Lt(this,"wordSpacing",0);Lt(this,"textHScale",1);Lt(this,"textRenderingMode",pi.FILL);Lt(this,"textRise",0);Lt(this,"fillColor","#000000");Lt(this,"strokeColor","#000000");Lt(this,"patternFill",!1);Lt(this,"patternStroke",!1);Lt(this,"fillAlpha",1);Lt(this,"strokeAlpha",1);Lt(this,"lineWidth",1);Lt(this,"activeSMask",null);Lt(this,"transferMaps","none");r?.(this),this.clipBox=new Float32Array([0,0,t,e]),this.minMax=Sw.slice()}clone(){let t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=Qi.FILL,e=null){let r=this.minMax.slice();if(t===Qi.STROKE){e||qr("Stroke bounding box must include transform."),se.singularValueDecompose2dScale(e,po);let i=po[0]*this.lineWidth/2,s=po[1]*this.lineWidth/2;r[0]-=i,r[1]-=s,r[2]+=i,r[3]+=s}return r}updateClipFromPath(){let t=se.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(Sw,0)}getClippedPathBoundingBox(t=Qi.FILL,e=null){return se.intersect(this.clipBox,this.getPathBoundingBox(t,e))}};Eft=["butt","round","square"],xft=["miter","round","bevel"],Sft={},Jq={},U5=class U5{constructor(t,e,r,i,s,{optionalContentConfig:a,markedContentStack:o=null},c,u,h){T(this,Zl);this.ctx=t,this.current=new HO(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=r,this.canvasFactory=i,this.filterFactory=s,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=o||[],this.optionalContentConfig=a,this.cachedCanvases=new J4(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=c,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=u,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=h??null}getObject(t,e,r=null){return typeof e=="string"?(this.dependencyTracker?.recordNamedDependency(t,e),e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e)):r}beginDrawing({transform:t,viewport:e,transparency:r=!1,background:i=null}){let s=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,s,a),this.ctx.fillStyle=o,r){let c=this.cachedCanvases.getCanvas("transparent",s,a);this.compositeCtx=this.ctx,this.transparentCanvas=c.canvas,this.ctx=c.context,this.ctx.save(),this.ctx.transform(...vn(this.compositeCtx))}this.ctx.save(),jD(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=vn(this.ctx)}executeOperatorList(t,e,r,i,s){let a=t.argsArray,o=t.fnArray,c=e||0,u=a.length;if(u===c)return c;let h=u-c>qq&&typeof r=="function",f=h?Date.now()+wft:0,d=0,p=this.commonObjs,g=this.objs,y,b;for(;;){if(i!==void 0&&c===i.nextBreakPoint)return i.breakIt(c,r),c;if(!s||s(c))if(y=o[c],b=a[c]??null,y!==rE.dependency)b===null?this[y](c):this[y](c,...b);else for(let m of b){this.dependencyTracker?.recordNamedData(m,c);let w=m.startsWith("g_")?p:g;if(!w.has(m))return w.get(m,r),c}if(c++,c===u)return c;if(h&&++d>qq){if(Date.now()>f)return r(),c;d=0}}}endDrawing(){R(this,Zl,Q4).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(let t of this._cachedBitmapsMap.values()){for(let e of t.values())typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),R(this,Zl,t6).call(this)}_scaleImage(t,e){let r=t.width??t.displayWidth,i=t.height??t.displayHeight,s=Math.max(Math.hypot(e[0],e[1]),1),a=Math.max(Math.hypot(e[2],e[3]),1),o=r,c=i,u="prescale1",h,f;for(;s>2&&o>1||a>2&&c>1;){let d=o,p=c;s>2&&o>1&&(d=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),s/=o/d),a>2&&c>1&&(p=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,a/=c/p),h=this.cachedCanvases.getCanvas(u,d,p),f=h.context,f.clearRect(0,0,d,p),f.drawImage(t,0,0,o,c,0,0,d,p),t=h.canvas,o=d,c=p,u=u==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:o,paintHeight:c}}_createMaskCanvas(t,e){let r=this.ctx,{width:i,height:s}=e,a=this.current.fillColor,o=this.current.patternFill,c=vn(r),u,h,f,d;if((e.bitmap||e.data)&&e.count>1){let G=e.bitmap||e.data.buffer;h=JSON.stringify(o?c:[c.slice(0,4),a]),u=this._cachedBitmapsMap.get(G),u||(u=new Map,this._cachedBitmapsMap.set(G,u));let Y=u.get(h);if(Y&&!o){let L=Math.round(Math.min(c[0],c[2])+c[4]),j=Math.round(Math.min(c[1],c[3])+c[5]);return this.dependencyTracker?.recordDependencies(t,Xo.transformAndFill),{canvas:Y,offsetX:L,offsetY:j}}f=Y}f||(d=this.cachedCanvases.getCanvas("maskCanvas",i,s),Kq(d.context,e));let p=se.transform(c,[1/i,0,0,-1/s,0,0]);p=se.transform(p,[1,0,0,1,0,-s]);let g=Sw.slice();se.axialAlignedBoundingBox([0,0,i,s],p,g);let[y,b,m,w]=g,A=Math.round(m-y)||1,_=Math.round(w-b)||1,S=this.cachedCanvases.getCanvas("fillCanvas",A,_),I=S.context,C=y,M=b;I.translate(-C,-M),I.transform(...p),f||(f=this._scaleImage(d.canvas,$c(I)),f=f.img,u&&o&&u.set(h,f)),I.imageSmoothingEnabled=Zq(vn(I),e.interpolate),UD(I,f,0,0,f.width,f.height,0,0,i,s),I.globalCompositeOperation="source-in";let z=se.transform($c(I),[1,0,0,1,-C,-M]);return I.fillStyle=o?a.getPattern(r,this,z,Qi.FILL,t):a,I.fillRect(0,0,i,s),u&&!o&&(this.cachedCanvases.delete("fillCanvas"),u.set(h,S.canvas)),this.dependencyTracker?.recordDependencies(t,Xo.transformAndFill),{canvas:S.canvas,offsetX:Math.round(C),offsetY:Math.round(M)}}setLineWidth(t,e){this.dependencyTracker?.recordSimpleData("lineWidth",t),e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(t,e){this.dependencyTracker?.recordSimpleData("lineCap",t),this.ctx.lineCap=Eft[e]}setLineJoin(t,e){this.dependencyTracker?.recordSimpleData("lineJoin",t),this.ctx.lineJoin=xft[e]}setMiterLimit(t,e){this.dependencyTracker?.recordSimpleData("miterLimit",t),this.ctx.miterLimit=e}setDash(t,e,r){this.dependencyTracker?.recordSimpleData("dash",t);let i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(e),i.lineDashOffset=r)}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){for(let[r,i]of e)switch(r){case"LW":this.setLineWidth(t,i);break;case"LC":this.setLineCap(t,i);break;case"LJ":this.setLineJoin(t,i);break;case"ML":this.setMiterLimit(t,i);break;case"D":this.setDash(t,i[0],i[1]);break;case"RI":this.setRenderingIntent(t,i);break;case"FL":this.setFlatness(t,i);break;case"Font":this.setFont(t,i[0],i[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=i;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=i;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=i;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",t),this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.dependencyTracker?.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(t){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");let e=this.ctx.canvas.width,r=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(i,e,r);this.suspendedCtx=this.ctx;let a=this.ctx=s.context;a.setTransform(this.suspendedCtx.getTransform()),tS(this.suspendedCtx,a),Aft(a,this.suspendedCtx),this.setGState(t,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),tS(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let e=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,e,this.ctx,t),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(t,e,r,i){let s=i[0],a=i[1],o=i[2]-s,c=i[3]-a;o===0||c===0||(this.genericComposeSMask(e.context,r,o,c,e.subtype,e.backdrop,e.transferMap,s,a,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(r.canvas,0,0),t.restore())}genericComposeSMask(t,e,r,i,s,a,o,c,u,h,f){let d=t.canvas,p=c-h,g=u-f;if(a)if(p<0||g<0||p+r>d.width||g+i>d.height){let b=this.cachedCanvases.getCanvas("maskExtension",r,i),m=b.context;m.drawImage(d,-p,-g),m.globalCompositeOperation="destination-atop",m.fillStyle=a,m.fillRect(0,0,r,i),m.globalCompositeOperation="source-over",d=b.canvas,p=g=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);let b=new Path2D;b.rect(p,g,r,i),t.clip(b),t.globalCompositeOperation="destination-atop",t.fillStyle=a,t.fillRect(p,g,r,i),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),s==="Alpha"&&o?e.filter=this.filterFactory.addAlphaFilter(o):s==="Luminosity"&&(e.filter=this.filterFactory.addLuminosityFilter(o));let y=new Path2D;y.rect(c,u,r,i),e.clip(y),e.globalCompositeOperation="destination-in",e.drawImage(d,p,g,r,i,c,u,r,i),e.restore()}save(t){this.inSMaskMode&&tS(this.ctx,this.suspendedCtx),this.ctx.save();let e=this.current;this.stateStack.push(e),this.current=e.clone(),this.dependencyTracker?.save(t)}restore(t){if(this.dependencyTracker?.restore(t),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&tS(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(t,e,r,i,s,a,o){this.dependencyTracker?.recordIncrementalData("transform",t),this.ctx.transform(e,r,i,s,a,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,r,i){let[s]=r;if(!i){s||(s=r[0]=new Path2D),this[e](t,s);return}if(this.dependencyTracker!==null){let a=e===rE.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,i[0]-a,i[2]+a,i[1]-a,i[3]+a).recordDependencies(t,["transform"])}s instanceof Path2D||(s=r[0]=hY(s)),se.axialAlignedBoundingBox(i,vn(this.ctx),this.current.minMax),this[e](t,s),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,e,r=!0){let i=this.ctx,s=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof s=="object"&&s?.getPattern){let a=s.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=s.getPattern(i,this,$c(i),Qi.STROKE,t),a){let o=new Path2D;o.addPath(e,i.getTransform().invertSelf().multiplySelf(a)),e=o}this.rescaleAndStroke(e,!1),i.restore()}else this.rescaleAndStroke(e,!0);this.dependencyTracker?.recordDependencies(t,Xo.stroke),r&&this.consumePath(t,e,this.current.getClippedPathBoundingBox(Qi.STROKE,vn(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(t,e){this.stroke(t,e)}fill(t,e,r=!0){let i=this.ctx,s=this.current.fillColor,a=this.current.patternFill,o=!1;if(a){let u=s.isModifyingCurrentTransform()?i.getTransform():null;if(this.dependencyTracker?.save(t),i.save(),i.fillStyle=s.getPattern(i,this,$c(i),Qi.FILL,t),u){let h=new Path2D;h.addPath(e,i.getTransform().invertSelf().multiplySelf(u)),e=h}o=!0}let c=this.current.getClippedPathBoundingBox();this.contentVisible&&c!==null&&(this.pendingEOFill?(i.fill(e,"evenodd"),this.pendingEOFill=!1):i.fill(e)),this.dependencyTracker?.recordDependencies(t,Xo.fill),o&&(i.restore(),this.dependencyTracker?.restore(t)),r&&this.consumePath(t,e,c)}eoFill(t,e){this.pendingEOFill=!0,this.fill(t,e)}fillStroke(t,e){this.fill(t,e,!1),this.stroke(t,e,!1),this.consumePath(t,e)}eoFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}closeFillStroke(t,e){this.fillStroke(t,e)}closeEOFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}endPath(t,e){this.consumePath(t,e)}rawFillPath(t,e){this.ctx.fill(e),this.dependencyTracker?.recordDependencies(t,Xo.rawFillPath).recordOperation(t)}clip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=Sft}eoClip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=Jq}beginText(t){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(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){let e=this.pendingTextPaths,r=this.ctx;if(this.dependencyTracker){let{dependencyTracker:i}=this;e!==void 0&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",t),i.recordCloseMarker(t)}if(e!==void 0){let i=new Path2D,s=r.getTransform().invertSelf();for(let{transform:a,x:o,y:c,fontSize:u,path:h}of e)h&&i.addPath(h,new DOMMatrix(a).preMultiplySelf(s).translate(o,c).scale(u,-u));r.clip(i)}delete this.pendingTextPaths}setCharSpacing(t,e){this.dependencyTracker?.recordSimpleData("charSpacing",t),this.current.charSpacing=e}setWordSpacing(t,e){this.dependencyTracker?.recordSimpleData("wordSpacing",t),this.current.wordSpacing=e}setHScale(t,e){this.dependencyTracker?.recordSimpleData("hScale",t),this.current.textHScale=e/100}setLeading(t,e){this.dependencyTracker?.recordSimpleData("leading",t),this.current.leading=-e}setFont(t,e,r){this.dependencyTracker?.recordSimpleData("font",t).recordSimpleDataFromNamed("fontObj",e,t);let i=this.commonObjs.get(e),s=this.current;if(!i)throw new Error(`Can't find font for ${e}`);if(s.fontMatrix=i.fontMatrix||t4,(s.fontMatrix[0]===0||s.fontMatrix[3]===0)&&De("Invalid font matrix for font "+e),r<0?(r=-r,s.fontDirection=-1):s.fontDirection=1,this.current.font=i,this.current.fontSize=r,i.isType3Font)return;let a=i.loadedName||"sans-serif",o=i.systemFontInfo?.css||`"${a}", ${i.fallbackName}`,c="normal";i.black?c="900":i.bold&&(c="bold");let u=i.italic?"italic":"normal",h=r;r<Vq?h=Vq:r>Xq&&(h=Xq),this.current.fontSizeScale=r/h,this.ctx.font=`${u} ${c} ${h}px ${o}`}setTextRenderingMode(t,e){this.dependencyTracker?.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=e}setTextRise(t,e){this.dependencyTracker?.recordSimpleData("textRise",t),this.current.textRise=e}moveText(t,e,r){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=r}setLeadingMoveText(t,e,r){this.setLeading(t,-r),this.moveText(t,e,r)}setTextMatrix(t,e){this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",t);let{current:r}=this;r.textMatrix=e,r.textMatrixScale=Math.hypot(e[0],e[1]),r.x=r.lineX=0,r.y=r.lineY=0}nextLine(t){this.moveText(t,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??t)}paintChar(t,e,r,i,s,a){let o=this.ctx,c=this.current,u=c.font,h=c.textRenderingMode,f=c.fontSize/c.fontSizeScale,d=h&pi.FILL_STROKE_MASK,p=!!(h&pi.ADD_TO_PATH_FLAG),g=c.patternFill&&!u.missingFile,y=c.patternStroke&&!u.missingFile,b;if((u.disableFontFace||p||g||y)&&!u.missingFile&&(b=u.getPathGenerator(this.commonObjs,e)),b&&(u.disableFontFace||g||y)){o.save(),o.translate(r,i),o.scale(f,-f),this.dependencyTracker?.recordCharacterBBox(t,o,u);let m;if(d===pi.FILL||d===pi.FILL_STROKE)if(s){m=o.getTransform(),o.setTransform(...s);let w=R(this,Zl,e6).call(this,b,m,s);o.fill(w)}else o.fill(b);if(d===pi.STROKE||d===pi.FILL_STROKE)if(a){m||(m=o.getTransform()),o.setTransform(...a);let{a:w,b:A,c:_,d:S}=m,I=se.inverseTransform(a),C=se.transform([w,A,_,S,0,0],I);se.singularValueDecompose2dScale(C,po),o.lineWidth*=Math.max(po[0],po[1])/f,o.stroke(R(this,Zl,e6).call(this,b,m,a))}else o.lineWidth/=f,o.stroke(b);o.restore()}else(d===pi.FILL||d===pi.FILL_STROKE)&&(o.fillText(e,r,i),this.dependencyTracker?.recordCharacterBBox(t,o,u,f,r,i,()=>o.measureText(e))),(d===pi.STROKE||d===pi.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(t,o,u,f,r,i,()=>o.measureText(e)).recordDependencies(t,Xo.stroke),o.strokeText(e,r,i));p&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:vn(o),x:r,y:i,fontSize:f,path:b}),this.dependencyTracker?.recordCharacterBBox(t,o,u,f,r,i))}get isFontSubpixelAAEnabled(){let{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);let e=t.getImageData(0,0,10,10).data,r=!1;for(let i=3;i<e.length;i+=4)if(e[i]>0&&e[i]<255){r=!0;break}return Ce(this,"isFontSubpixelAAEnabled",r)}showText(t,e){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,Xo.showText).resetBBox(t),this.current.textRenderingMode&pi.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());let r=this.current,i=r.font;if(i.isType3Font){this.showType3Text(t,e),this.dependencyTracker?.recordShowTextOperation(t);return}let s=r.fontSize;if(s===0){this.dependencyTracker?.recordOperation(t);return}let a=this.ctx,o=r.fontSizeScale,c=r.charSpacing,u=r.wordSpacing,h=r.fontDirection,f=r.textHScale*h,d=e.length,p=i.vertical,g=p?1:-1,y=i.defaultVMetrics,b=s*r.fontMatrix[0],m=r.textRenderingMode===pi.FILL&&!i.disableFontFace&&!r.patternFill;a.save(),r.textMatrix&&a.transform(...r.textMatrix),a.translate(r.x,r.y+r.textRise),h>0?a.scale(f,-1):a.scale(f,1);let w,A,_=r.textRenderingMode&pi.FILL_STROKE_MASK,S=_===pi.FILL||_===pi.FILL_STROKE,I=_===pi.STROKE||_===pi.FILL_STROKE;if(S&&r.patternFill){a.save();let Y=r.fillColor.getPattern(a,this,$c(a),Qi.FILL,t);w=vn(a),a.restore(),a.fillStyle=Y}if(I&&r.patternStroke){a.save();let Y=r.strokeColor.getPattern(a,this,$c(a),Qi.STROKE,t);A=vn(a),a.restore(),a.strokeStyle=Y}let C=r.lineWidth,M=r.textMatrixScale;if(M===0||C===0?I&&(C=this.getSinglePixelWidth()):C/=M,o!==1&&(a.scale(o,o),C/=o),a.lineWidth=C,i.isInvalidPDFjsFont){let Y=[],L=0;for(let q of e)Y.push(q.unicode),L+=q.width;let j=Y.join("");if(a.fillText(j,0,0),this.dependencyTracker!==null){let q=a.measureText(j);this.dependencyTracker.recordBBox(t,this.ctx,-q.actualBoundingBoxLeft,q.actualBoundingBoxRight,-q.actualBoundingBoxAscent,q.actualBoundingBoxDescent).recordShowTextOperation(t)}r.x+=L*b*f,a.restore(),this.compose();return}let z=0,G;for(G=0;G<d;++G){let Y=e[G];if(typeof Y=="number"){z+=g*Y*s/1e3;continue}let L=!1,j=(Y.isSpace?u:0)+c,q=Y.fontChar,nt=Y.accent,J,N,D=Y.width;if(p){let V=Y.vmetric||y,$=-(Y.vmetric?V[1]:D*.5)*b,H=V[2]*b;D=V?-V[0]:D,J=$/o,N=(z+H)/o}else J=z/o,N=0;let F;if(i.remeasure&&D>0){F=a.measureText(q);let V=F.width*1e3/s*o;if(D<V&&this.isFontSubpixelAAEnabled){let $=D/V;L=!0,a.save(),a.scale($,1),J/=$}else D!==V&&(J+=(D-V)/2e3*s/o)}if(this.contentVisible&&(Y.isInFont||i.missingFile)){if(m&&!nt)a.fillText(q,J,N),this.dependencyTracker?.recordCharacterBBox(t,a,F?{bbox:null}:i,s/o,J,N,()=>F??a.measureText(q));else if(this.paintChar(t,q,J,N,w,A),nt){let V=J+s*nt.offset.x/o,$=N-s*nt.offset.y/o;this.paintChar(t,nt.fontChar,V,$,w,A)}}let P=p?D*b-j*h:D*b+j*h;z+=P,L&&a.restore()}p?r.y-=z:r.x+=z*f,a.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(t)}showType3Text(t,e){let r=this.ctx,i=this.current,s=i.font,a=i.fontSize,o=i.fontDirection,c=s.vertical?1:-1,u=i.charSpacing,h=i.wordSpacing,f=i.textHScale*o,d=i.fontMatrix||t4,p=e.length,g=i.textRenderingMode===pi.INVISIBLE,y,b,m,w;if(g||a===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,r.save(),i.textMatrix&&r.transform(...i.textMatrix),r.translate(i.x,i.y+i.textRise),r.scale(f,o);let A=this.dependencyTracker;for(this.dependencyTracker=A?new $O(A,t):null,y=0;y<p;++y){if(b=e[y],typeof b=="number"){w=c*b*a/1e3,this.ctx.translate(w,0),i.x+=w*f;continue}let _=(b.isSpace?h:0)+u,S=s.charProcOperatorList[b.operatorListId];S?this.contentVisible&&(this.save(),r.scale(a,a),r.transform(...d),this.executeOperatorList(S),this.restore()):De(`Type3 character "${b.operatorListId}" is not available.`);let I=[b.width,0];se.applyTransform(I,d),m=I[0]*a+_,r.translate(m,0),i.x+=m*f}r.restore(),A&&(this.dependencyTracker=A)}setCharWidth(t,e,r){}setCharWidthAndBounds(t,e,r,i,s,a,o){let c=new Path2D;c.rect(i,s,a-i,o-s),this.ctx.clip(c),this.dependencyTracker?.recordBBox(t,this.ctx,i,a,s,o).recordClipBox(t,this.ctx,i,a,s,o),this.endPath(t)}getColorN_Pattern(t,e){let r;if(e[0]==="TilingPattern"){let i=this.baseTransform||vn(this.ctx),s={createCanvasGraphics:(a,o)=>new U5(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new $O(this.dependencyTracker,o,!0):null)};r=new Z4(e,this.ctx,s,i)}else r=this._getPattern(t,e[1],e[2]);return r}setStrokeColorN(t,...e){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.current.strokeColor=this.getColorN_Pattern(t,e),this.current.patternStroke=!0}setFillColorN(t,...e){this.dependencyTracker?.recordSimpleData("fillColor",t),this.current.fillColor=this.getColorN_Pattern(t,e),this.current.patternFill=!0}setStrokeRGBColor(t,e){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}setStrokeTransparent(t){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,e){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1}setFillTransparent(t){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e,r=null){let i;return this.cachedPatterns.has(e)?i=this.cachedPatterns.get(e):(i=bft(this.getObject(t,e)),this.cachedPatterns.set(e,i)),r&&(i.matrix=r),i}shadingFill(t,e){if(!this.contentVisible)return;let r=this.ctx;this.save(t);let i=this._getPattern(t,e);r.fillStyle=i.getPattern(r,this,$c(r),Qi.SHADING,t);let s=$c(r);if(s){let{width:a,height:o}=r.canvas,c=Sw.slice();se.axialAlignedBoundingBox([0,0,a,o],s,c);let[u,h,f,d]=c;this.ctx.fillRect(u,h,f-u,d-h)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,Xo.transform).recordDependencies(t,Xo.fill).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t)}beginInlineImage(){qr("Should not call beginInlineImage")}beginImageData(){qr("Should not call beginImageData")}paintFormXObjectBegin(t,e,r){if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),e&&this.transform(t,...e),this.baseTransform=vn(this.ctx),r)){se.axialAlignedBoundingBox(r,this.baseTransform,this.current.minMax);let[i,s,a,o]=r,c=new Path2D;c.rect(i,s,a-i,o-s),this.ctx.clip(c),this.dependencyTracker?.recordClipBox(t,this.ctx,i,a,s,o),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,e){if(!this.contentVisible)return;this.save(t),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let r=this.ctx;e.isolated||TP("TODO: Support non-isolated groups."),e.knockout&&De("Knockout groups not supported.");let i=vn(r);if(e.matrix&&r.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let s=Sw.slice();se.axialAlignedBoundingBox(e.bbox,vn(r),s);let a=[0,0,r.canvas.width,r.canvas.height];s=se.intersect(s,a)||[0,0,0,0];let o=Math.floor(s[0]),c=Math.floor(s[1]),u=Math.max(Math.ceil(s[2])-o,1),h=Math.max(Math.ceil(s[3])-c,1);this.current.startNewPathAndClipBox([0,0,u,h]);let f="groupAt"+this.groupLevel;e.smask&&(f+="_smask_"+this.smaskCounter++%2);let d=this.cachedCanvases.getCanvas(f,u,h),p=d.context;p.translate(-o,-c),p.transform(...i);let g=new Path2D,[y,b,m,w]=e.bbox;if(g.rect(y,b,m-y,w-b),e.matrix){let A=new Path2D;A.addPath(g,new DOMMatrix(e.matrix)),g=A}p.clip(g),e.smask&&this.smaskStack.push({canvas:d.canvas,context:p,offsetX:o,offsetY:c,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}),(!e.smask||this.dependencyTracker)&&(r.setTransform(1,0,0,1,0,0),r.translate(o,c),r.save()),tS(r,p),this.ctx=p,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(r),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(r),this.groupLevel++}endGroup(t,e){if(!this.contentVisible)return;this.groupLevel--;let r=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),e.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();let s=vn(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...s);let a=Sw.slice();se.axialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],s,a),this.ctx.drawImage(r.canvas,0,0),this.ctx.restore(),this.compose(a)}}beginAnnotation(t,e,r,i,s,a){if(R(this,Zl,Q4).call(this),jD(this.ctx),this.ctx.save(),this.save(t),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),r){let o=r[2]-r[0],c=r[3]-r[1];if(a&&this.annotationCanvasMap){i=i.slice(),i[4]-=r[0],i[5]-=r[1],r=r.slice(),r[0]=r[1]=0,r[2]=o,r[3]=c,se.singularValueDecompose2dScale(vn(this.ctx),po);let{viewportScale:u}=this,h=Math.ceil(o*this.outputScaleX*u),f=Math.ceil(c*this.outputScaleY*u);this.annotationCanvas=this.canvasFactory.create(h,f);let{canvas:d,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(e,d),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(po[0],0,0,-po[1],0,c*po[1]),jD(this.ctx)}else{jD(this.ctx),this.endPath(t);let u=new Path2D;u.rect(r[0],r[1],o,c),this.ctx.clip(u)}}this.current=new HO(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(t,...i),this.transform(t,...s)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),R(this,Zl,t6).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t,e){if(!this.contentVisible)return;let r=e.count;e=this.getObject(t,e.data,e),e.count=r;let i=this.ctx,s=this._createMaskCanvas(t,e),a=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(a,s.offsetX,s.offsetY),this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,s.offsetX,s.offsetX+a.width,s.offsetY,s.offsetY+a.height).recordOperation(t),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,r,i=0,s=0,a,o){if(!this.contentVisible)return;e=this.getObject(t,e.data,e);let c=this.ctx;c.save();let u=vn(c);c.transform(r,i,s,a,0,0);let h=this._createMaskCanvas(t,e);c.setTransform(1,0,0,1,h.offsetX-u[4],h.offsetY-u[5]),this.dependencyTracker?.resetBBox(t);for(let f=0,d=o.length;f<d;f+=2){let p=se.transform(u,[r,i,s,a,o[f],o[f+1]]);c.drawImage(h.canvas,p[4],p[5]),this.dependencyTracker?.recordBBox(t,this.ctx,p[4],p[4]+h.canvas.width,p[5],p[5]+h.canvas.height)}c.restore(),this.compose(),this.dependencyTracker?.recordOperation(t)}paintImageMaskXObjectGroup(t,e){if(!this.contentVisible)return;let r=this.ctx,i=this.current.fillColor,s=this.current.patternFill;this.dependencyTracker?.resetBBox(t).recordDependencies(t,Xo.transformAndFill);for(let a of e){let{data:o,width:c,height:u,transform:h}=a,f=this.cachedCanvases.getCanvas("maskCanvas",c,u),d=f.context;d.save();let p=this.getObject(t,o,a);Kq(d,p),d.globalCompositeOperation="source-in",d.fillStyle=s?i.getPattern(d,this,$c(r),Qi.FILL,t):i,d.fillRect(0,0,c,u),d.restore(),r.save(),r.transform(...h),r.scale(1,-1),UD(r,f.canvas,0,0,c,u,0,-1,1,1),this.dependencyTracker?.recordBBox(t,r,0,c,0,u),r.restore()}this.compose(),this.dependencyTracker?.recordOperation(t)}paintImageXObject(t,e){if(!this.contentVisible)return;let r=this.getObject(t,e);if(!r){De("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t,r)}paintImageXObjectRepeat(t,e,r,i,s){if(!this.contentVisible)return;let a=this.getObject(t,e);if(!a){De("Dependent image isn't ready yet");return}let o=a.width,c=a.height,u=[];for(let h=0,f=s.length;h<f;h+=2)u.push({transform:[r,0,0,i,s[h],s[h+1]],x:0,y:0,w:o,h:c});this.paintInlineImageXObjectGroup(t,a,u)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;let{bitmap:e,width:r,height:i}=t,s=this.cachedCanvases.getCanvas("inlineImage",r,i),a=s.context;return a.filter=this.current.transferMaps,a.drawImage(e,0,0),a.filter="none",s.canvas}paintInlineImageXObject(t,e){if(!this.contentVisible)return;let r=e.width,i=e.height,s=this.ctx;this.save(t);let{filter:a}=s;a!=="none"&&a!==""&&(s.filter="none"),s.scale(1/r,-1/i);let o;if(e.bitmap)o=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)o=e;else{let h=this.cachedCanvases.getCanvas("inlineImage",r,i).context;Yq(h,e),o=this.applyTransferMapsToCanvas(h)}let c=this._scaleImage(o,$c(s));s.imageSmoothingEnabled=Zq(vn(s),e.interpolate),this.dependencyTracker?.resetBBox(t).recordBBox(t,s,0,r,-i,0).recordDependencies(t,Xo.imageXObject).recordOperation(t),UD(s,c.img,0,0,c.paintWidth,c.paintHeight,0,-i,r,i),this.compose(),this.restore(t)}paintInlineImageXObjectGroup(t,e,r){if(!this.contentVisible)return;let i=this.ctx,s;if(e.bitmap)s=e.bitmap;else{let a=e.width,o=e.height,u=this.cachedCanvases.getCanvas("inlineImage",a,o).context;Yq(u,e),s=this.applyTransferMapsToCanvas(u)}this.dependencyTracker?.resetBBox(t);for(let a of r)i.save(),i.transform(...a.transform),i.scale(1,-1),UD(i,s,a.x,a.y,a.w,a.h,0,-1,1,1),this.dependencyTracker?.recordBBox(t,i,0,1,-1,0),i.restore();this.dependencyTracker?.recordOperation(t),this.compose()}paintSolidColorImageMask(t){this.contentVisible&&(this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,Xo.fill).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t,e){}markPointProps(t,e,r){}beginMarkedContent(t,e){this.dependencyTracker?.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e,r){this.dependencyTracker?.beginMarkedContent(t),e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){this.dependencyTracker?.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,e,r){let i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(r);let s=this.ctx;this.pendingClip?(i||(this.pendingClip===Jq?s.clip(e,"evenodd"):s.clip(e)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):this.dependencyTracker?.recordOperation(t),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let t=vn(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{let e=Math.abs(t[0]*t[3]-t[2]*t[1]),r=Math.hypot(t[0],t[2]),i=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(r,i)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){let{lineWidth:t}=this.current,{a:e,b:r,c:i,d:s}=this.ctx.getTransform(),a,o;if(r===0&&i===0){let c=Math.abs(e),u=Math.abs(s);if(c===u)if(t===0)a=o=1/c;else{let h=c*t;a=o=h<1?1/h:1}else if(t===0)a=1/c,o=1/u;else{let h=c*t,f=u*t;a=h<1?1/h:1,o=f<1?1/f:1}}else{let c=Math.abs(e*s-r*i),u=Math.hypot(e,r),h=Math.hypot(i,s);if(t===0)a=h/c,o=u/c;else{let f=t*c;a=h>f?h/f:1,o=u>f?u/f:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(t,e){let{ctx:r,current:{lineWidth:i}}=this,[s,a]=this.getScaleForStroking();if(s===a){r.lineWidth=(i||1)*s,r.stroke(t);return}let o=r.getLineDash();e&&r.save(),r.scale(s,a),Z3.a=1/s,Z3.d=1/a;let c=new Path2D;if(c.addPath(t,Z3),o.length>0){let u=Math.max(s,a);r.setLineDash(o.map(h=>h/u)),r.lineDashOffset/=u}r.lineWidth=i||1,r.stroke(c),e&&r.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};Zl=new WeakSet,Q4=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)},t6=function(){if(this.pageColors){let t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){let e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}},e6=function(t,e,r){let i=new Path2D;return i.addPath(t,new DOMMatrix(r).invertSelf().multiplySelf(e)),i};Iw=U5;for(let n in rE)Iw.prototype[n]!==void 0&&(Iw.prototype[rE[n]]=Iw.prototype[n]);al=class{static get workerPort(){return l(this,D_)}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");x(this,D_,t)}static get workerSrc(){return l(this,O_)}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");x(this,O_,t)}};D_=new WeakMap,O_=new WeakMap,T(al,D_,null),T(al,O_,"");r6=class{constructor({parsedData:t,rawData:e}){T(this,fA);T(this,P_);x(this,fA,t),x(this,P_,e)}getRaw(){return l(this,P_)}get(t){return l(this,fA).get(t)??null}[Symbol.iterator](){return l(this,fA).entries()}};fA=new WeakMap,P_=new WeakMap;vw=Symbol("INTERNAL"),n6=class{constructor(t,{name:e,intent:r,usage:i,rbGroups:s}){T(this,N_,!1);T(this,L_,!1);T(this,k_,!1);T(this,dA,!0);x(this,N_,!!(t&fo.DISPLAY)),x(this,L_,!!(t&fo.PRINT)),this.name=e,this.intent=r,this.usage=i,this.rbGroups=s}get visible(){if(l(this,k_))return l(this,dA);if(!l(this,dA))return!1;let{print:t,view:e}=this.usage;return l(this,N_)?e?.viewState!=="OFF":l(this,L_)?t?.printState!=="OFF":!0}_setVisible(t,e,r=!1){t!==vw&&qr("Internal method `_setVisible` called."),x(this,k_,r),x(this,dA,e)}};N_=new WeakMap,L_=new WeakMap,k_=new WeakMap,dA=new WeakMap;i6=class{constructor(t,e=fo.DISPLAY){T(this,M_);T(this,up,null);T(this,Mr,new Map);T(this,pA,null);T(this,gA,null);if(this.renderingIntent=e,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,x(this,gA,t.order);for(let r of t.groups)l(this,Mr).set(r.id,new n6(e,r));if(t.baseState==="OFF")for(let r of l(this,Mr).values())r._setVisible(vw,!1);for(let r of t.on)l(this,Mr).get(r)._setVisible(vw,!0);for(let r of t.off)l(this,Mr).get(r)._setVisible(vw,!1);x(this,pA,this.getHash())}}isVisible(t){if(l(this,Mr).size===0)return!0;if(!t)return TP("Optional content group not defined."),!0;if(t.type==="OCG")return l(this,Mr).has(t.id)?l(this,Mr).get(t.id).visible:(De(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return R(this,M_,s6).call(this,t.expression);if(!t.policy||t.policy==="AnyOn"){for(let e of t.ids){if(!l(this,Mr).has(e))return De(`Optional content group not found: ${e}`),!0;if(l(this,Mr).get(e).visible)return!0}return!1}else if(t.policy==="AllOn"){for(let e of t.ids){if(!l(this,Mr).has(e))return De(`Optional content group not found: ${e}`),!0;if(!l(this,Mr).get(e).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(let e of t.ids){if(!l(this,Mr).has(e))return De(`Optional content group not found: ${e}`),!0;if(!l(this,Mr).get(e).visible)return!0}return!1}else if(t.policy==="AllOff"){for(let e of t.ids){if(!l(this,Mr).has(e))return De(`Optional content group not found: ${e}`),!0;if(l(this,Mr).get(e).visible)return!1}return!0}return De(`Unknown optional content policy ${t.policy}.`),!0}return De(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0,r=!0){let i=l(this,Mr).get(t);if(!i){De(`Optional content group not found: ${t}`);return}if(r&&e&&i.rbGroups.length)for(let s of i.rbGroups)for(let a of s)a!==t&&l(this,Mr).get(a)?._setVisible(vw,!1,!0);i._setVisible(vw,!!e,!0),x(this,up,null)}setOCGState({state:t,preserveRB:e}){let r;for(let i of t){switch(i){case"ON":case"OFF":case"Toggle":r=i;continue}let s=l(this,Mr).get(i);if(s)switch(r){case"ON":this.setVisibility(i,!0,e);break;case"OFF":this.setVisibility(i,!1,e);break;case"Toggle":this.setVisibility(i,!s.visible,e);break}}x(this,up,null)}get hasInitialVisibility(){return l(this,pA)===null||this.getHash()===l(this,pA)}getOrder(){return l(this,Mr).size?l(this,gA)?l(this,gA).slice():[...l(this,Mr).keys()]:null}getGroup(t){return l(this,Mr).get(t)||null}getHash(){if(l(this,up)!==null)return l(this,up);let t=new IO;for(let[e,r]of l(this,Mr))t.update(`${e}:${r.visible}`);return x(this,up,t.hexdigest())}[Symbol.iterator](){return l(this,Mr).entries()}};up=new WeakMap,Mr=new WeakMap,pA=new WeakMap,gA=new WeakMap,M_=new WeakSet,s6=function(t){let e=t.length;if(e<2)return!0;let r=t[0];for(let i=1;i<e;i++){let s=t[i],a;if(Array.isArray(s))a=R(this,M_,s6).call(this,s);else if(l(this,Mr).has(s))a=l(this,Mr).get(s).visible;else return De(`Optional content group not found: ${s}`),!0;switch(r){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return r==="And"};a6=class{constructor(t,{disableRange:e=!1,disableStream:r=!1}){rr(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');let{length:i,initialData:s,progressiveDone:a,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,s?.length>0){let c=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(c)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!r,this._isRangeSupported=!e,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((c,u)=>{this._onReceiveData({begin:c,chunk:u})}),t.addProgressListener((c,u)=>{this._onProgress({loaded:c,total:u})}),t.addProgressiveReadListener(c=>{this._onReceiveData({chunk:c})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:e}){let r=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{let i=this._rangeReaders.some(function(s){return s._begin!==t?!1:(s._enqueue(r),!0)});rr(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){t.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){let e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){rr(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let t=this._queuedChunks;return this._queuedChunks=null,new o6(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let r=new l6(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(r),r}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(let e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}},o6=class{constructor(t,e,r=!1,i=null){this._stream=t,this._done=r||!1,this._filename=CP(i)?i:null,this._queuedChunks=e||[],this._loaded=0;for(let s of this._queuedChunks)this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}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;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}},l6=class{constructor(t,e,r){this._stream=t,this._begin=e,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(let r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,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;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}};c6=class{constructor(t){Lt(this,"_responseOrigin",null);this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=YY(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return rr(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new u6(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let r=new h6(this,t,e);return this._rangeRequestReaders.push(r),r}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(let e of this._rangeRequestReaders.slice(0))e.cancel(t)}},u6=class{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;let e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange;let r=new Headers(t.headers),i=e.url;fetch(i,QY(r,this._withCredentials,this._abortController)).then(s=>{if(t._responseOrigin=RP(s.url),!JY(s.status))throw MT(s.status,i);this._reader=s.body.getReader(),this._headersCapability.resolve();let a=s.headers,{allowRangeRequests:o,suggestedLength:c}=KY({responseHeaders:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=c||this._contentLength,this._filename=ZY(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Kl("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}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(){await this._headersCapability.promise;let{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:tK(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}},h6=class{constructor(t,e,r){this._stream=t,this._reader=null,this._loaded=0;let i=t.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;let s=new Headers(t.headers);s.append("Range",`bytes=${e}-${r-1}`);let a=i.url;fetch(a,QY(s,this._withCredentials,this._abortController)).then(o=>{let c=RP(o.url);if(c!==t._responseOrigin)throw new Error(`Expected range response-origin "${c}" to match "${t._responseOrigin}".`);if(!JY(o.status))throw MT(o.status,a);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;let{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:tK(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}},J3=200,Q3=206;f6=class{constructor({url:t,httpHeaders:e,withCredentials:r}){Lt(this,"_responseOrigin",null);this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=YY(this.isHttp,e),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){let e=new XMLHttpRequest,r=this.currXhrId++,i=this.pendingRequests[r]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(let[s,a]of this.headers)e.setRequestHeader(s,a);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),i.expectedStatus=Q3):i.expectedStatus=J3,e.responseType="arraybuffer",rr(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>{t.onError(e.status)},e.onreadystatechange=this.onStateChange.bind(this,r),e.onprogress=this.onProgress.bind(this,r),i.onHeadersReceived=t.onHeadersReceived,i.onDone=t.onDone,i.onError=t.onError,i.onProgress=t.onProgress,e.send(null),r}onProgress(t,e){let r=this.pendingRequests[t];r&&r.onProgress?.(e)}onStateChange(t,e){let r=this.pendingRequests[t];if(!r)return;let i=r.xhr;if(i.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),i.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],i.status===0&&this.isHttp){r.onError(i.status);return}let s=i.status||J3;if(!(s===J3&&r.expectedStatus===Q3)&&s!==r.expectedStatus){r.onError(i.status);return}let o=Tft(i);if(s===Q3){let c=i.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(c);u?r.onDone({begin:parseInt(u[1],10),chunk:o}):(De('Missing or invalid "Content-Range" header.'),r.onError(0))}else o?r.onDone({begin:0,chunk:o}):r.onError(i.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){let e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}},d6=class{constructor(t){this._source=t,this._manager=new f6(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){let e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return rr(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new p6(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){let r=new g6(this._manager,t,e);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(let e of this._rangeRequestReaders.slice(0))e.cancel(t)}},p6=class{constructor(t,e){this._manager=t,this._url=e.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let t=this._fullRequestId,e=this._manager.getRequestXhr(t);this._manager._responseOrigin=RP(e.responseURL);let r=e.getAllResponseHeaders(),i=new Headers(r?r.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(o=>{let[c,...u]=o.split(": ");return[c,u.join(": ")]}):[]),{allowRangeRequests:s,suggestedLength:a}=KY({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=ZY(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=MT(t,this._url),this._headersCapability.reject(this._storedError);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}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);for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}},g6=class{constructor(t,e,r){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,end:r,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){let t=RP(this._manager.getRequestXhr(this._requestId)?.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(t){let e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(let r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??(this._storedError=MT(t,this._url));for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,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;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}},Cft=/^[a-z][a-z0-9\-+.]+:/i;m6=class{constructor(t){this.source=t,this.url=Rft(t.url),rr(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return rr(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new y6(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let r=new b6(this,t,e);return this._rangeRequestReaders.push(r),r}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(let e of this._rangeRequestReaders.slice(0))e.cancel(t)}},y6=class{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;let e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();let r=process.getBuiltinModule("fs");r.promises.lstat(this._url).then(i=>{this._contentLength=i.size,this._setReadableStream(r.createReadStream(this._url)),this._headersCapability.resolve()},i=>{i.code==="ENOENT"&&(i=MT(0,this._url.href)),this._storedError=i,this._headersCapability.reject(i)})}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(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Kl("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}},b6=class{constructor(t,e,r){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();let i=t.source;this._isStreamingSupported=!i.disableStream;let s=process.getBuiltinModule("fs");this._setReadableStream(s.createReadStream(this._url,{start:e,end:r-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}},eS=Symbol("INITIAL_DATA"),zO=class{constructor(){T(this,F_);T(this,Za,Object.create(null))}get(t,e=null){if(e){let i=R(this,F_,v6).call(this,t);return i.promise.then(()=>e(i.data)),null}let r=l(this,Za)[t];if(!r||r.data===eS)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return r.data}has(t){let e=l(this,Za)[t];return!!e&&e.data!==eS}delete(t){let e=l(this,Za)[t];return!e||e.data===eS?!1:(delete l(this,Za)[t],!0)}resolve(t,e=null){let r=R(this,F_,v6).call(this,t);r.data=e,r.resolve()}clear(){for(let t in l(this,Za)){let{data:e}=l(this,Za)[t];e?.bitmap?.close()}x(this,Za,Object.create(null))}*[Symbol.iterator](){for(let t in l(this,Za)){let{data:e}=l(this,Za)[t];e!==eS&&(yield[t,e])}}};Za=new WeakMap,F_=new WeakSet,v6=function(t){var e;return(e=l(this,Za))[t]||(e[t]={...Promise.withResolvers(),data:eS})};Ift=1e5,Qq=30,Xi=class Xi{constructor({textContentSource:t,container:e,viewport:r}){T(this,_f);T(this,hp,Promise.withResolvers());T(this,Ja,null);T(this,B_,!1);T(this,U_,!!globalThis.FontInspector?.enabled);T(this,Ny,null);T(this,tf,null);T(this,j_,0);T(this,$_,0);T(this,Ly,null);T(this,H_,null);T(this,mA,0);T(this,fp,0);T(this,yA,Object.create(null));T(this,z_,[]);T(this,bA,null);T(this,ky,[]);T(this,W_,new WeakMap);T(this,G_,null);var c;if(t instanceof ReadableStream)x(this,bA,t);else if(typeof t=="object")x(this,bA,new ReadableStream({start(u){u.enqueue(t),u.close()}}));else throw new Error('No "textContentSource" parameter specified.');x(this,Ja,x(this,H_,e)),x(this,fp,r.scale*fu.pixelRatio),x(this,mA,r.rotation),x(this,tf,{div:null,properties:null,ctx:null});let{pageWidth:i,pageHeight:s,pageX:a,pageY:o}=r.rawDims;x(this,G_,[1,0,0,-1,-a,o+s]),x(this,$_,i),x(this,j_,s),R(c=Xi,mo,nK).call(c),e.style.setProperty("--min-font-size",l(Xi,wA)),Lp(e,r),l(this,hp).promise.finally(()=>{l(Xi,AA).delete(this),x(this,tf,null),x(this,yA,null)}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:t,isFirefox:e}=Bn.platform;return Ce(this,"fontFamilyMap",new Map([["sans-serif",`${t&&e?"Calibri, ":""}sans-serif`],["monospace",`${t&&e?"Lucida Console, ":""}monospace`]]))}render(){let t=()=>{l(this,Ly).read().then(({value:e,done:r})=>{if(r){l(this,hp).resolve();return}l(this,Ny)??x(this,Ny,e.lang),Object.assign(l(this,yA),e.styles),R(this,_f,eK).call(this,e.items),t()},l(this,hp).reject)};return x(this,Ly,l(this,bA).getReader()),l(Xi,AA).add(this),t(),l(this,hp).promise}update({viewport:t,onBefore:e=null}){var s;let r=t.scale*fu.pixelRatio,i=t.rotation;if(i!==l(this,mA)&&(e?.(),x(this,mA,i),Lp(l(this,H_),{rotation:i})),r!==l(this,fp)){e?.(),x(this,fp,r);let a={div:null,properties:null,ctx:R(s=Xi,mo,eO).call(s,l(this,Ny))};for(let o of l(this,ky))a.properties=l(this,W_).get(o),a.div=o,R(this,_f,w6).call(this,a)}}cancel(){let t=new Kl("TextLayer task cancelled.");l(this,Ly)?.cancel(t).catch(()=>{}),x(this,Ly,null),l(this,hp).reject(t)}get textDivs(){return l(this,ky)}get textContentItemsStr(){return l(this,z_)}static cleanup(){if(!(l(this,AA).size>0)){l(this,vA).clear();for(let{canvas:t}of l(this,My).values())t.remove();l(this,My).clear()}}};hp=new WeakMap,Ja=new WeakMap,B_=new WeakMap,U_=new WeakMap,Ny=new WeakMap,tf=new WeakMap,j_=new WeakMap,$_=new WeakMap,Ly=new WeakMap,H_=new WeakMap,mA=new WeakMap,fp=new WeakMap,yA=new WeakMap,z_=new WeakMap,bA=new WeakMap,ky=new WeakMap,W_=new WeakMap,G_=new WeakMap,vA=new WeakMap,My=new WeakMap,V_=new WeakMap,wA=new WeakMap,AA=new WeakMap,_f=new WeakSet,eK=function(t){var i,s;if(l(this,B_))return;(s=l(this,tf)).ctx??(s.ctx=R(i=Xi,mo,eO).call(i,l(this,Ny)));let e=l(this,ky),r=l(this,z_);for(let a of t){if(e.length>Ift){De("Ignoring additional textDivs for performance reasons."),x(this,B_,!0);return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){let o=l(this,Ja);x(this,Ja,document.createElement("span")),l(this,Ja).classList.add("markedContent"),a.id&&l(this,Ja).setAttribute("id",`${a.id}`),o.append(l(this,Ja))}else a.type==="endMarkedContent"&&x(this,Ja,l(this,Ja).parentNode);continue}r.push(a.str),R(this,_f,rK).call(this,a)}},rK=function(t){var g;let e=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};l(this,ky).push(e);let i=se.transform(l(this,G_),t.transform),s=Math.atan2(i[1],i[0]),a=l(this,yA)[t.fontName];a.vertical&&(s+=Math.PI/2);let o=l(this,U_)&&a.fontSubstitution||a.fontFamily;o=Xi.fontFamilyMap.get(o)||o;let c=Math.hypot(i[2],i[3]),u=c*R(g=Xi,mo,iK).call(g,o,a,l(this,Ny)),h,f;s===0?(h=i[4],f=i[5]-u):(h=i[4]+u*Math.sin(s),f=i[5]-u*Math.cos(s));let d=e.style;d.left=`${(100*h/l(this,$_)).toFixed(2)}%`,d.top=`${(100*f/l(this,j_)).toFixed(2)}%`,d.setProperty("--font-height",`${c.toFixed(2)}px`),d.fontFamily=o,r.fontSize=c,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,l(this,U_)&&(e.dataset.fontName=a.fontSubstitutionLoadedName||t.fontName),s!==0&&(r.angle=s*(180/Math.PI));let p=!1;if(t.str.length>1)p=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){let y=Math.abs(t.transform[0]),b=Math.abs(t.transform[3]);y!==b&&Math.max(y,b)/Math.min(y,b)>1.5&&(p=!0)}if(p&&(r.canvasWidth=a.vertical?t.height:t.width),l(this,W_).set(e,r),l(this,tf).div=e,l(this,tf).properties=r,R(this,_f,w6).call(this,l(this,tf)),r.hasText&&l(this,Ja).append(e),r.hasEOL){let y=document.createElement("br");y.setAttribute("role","presentation"),l(this,Ja).append(y)}},w6=function(t){var a;let{div:e,properties:r,ctx:i}=t,{style:s}=e;if(r.canvasWidth!==0&&r.hasText){let{fontFamily:o}=s,{canvasWidth:c,fontSize:u}=r;R(a=Xi,mo,A6).call(a,i,u*l(this,fp),o);let{width:h}=i.measureText(e.textContent);h>0&&s.setProperty("--scale-x",c*l(this,fp)/h)}r.angle!==0&&s.setProperty("--rotate",`${r.angle}deg`)},mo=new WeakSet,eO=function(t=null){let e=l(this,My).get(t||(t=""));if(!e){let r=document.createElement("canvas");r.className="hiddenCanvasElement",r.lang=t,document.body.append(r),e=r.getContext("2d",{alpha:!1,willReadFrequently:!0}),l(this,My).set(t,e),l(this,V_).set(e,{size:0,family:""})}return e},A6=function(t,e,r){let i=l(this,V_).get(t);e===i.size&&r===i.family||(t.font=`${e}px ${r}`,i.size=e,i.family=r)},nK=function(){if(l(this,wA)!==null)return;let t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),x(this,wA,t.getBoundingClientRect().height),t.remove()},iK=function(t,e,r){let i=l(this,vA).get(t);if(i)return i;let s=R(this,mo,eO).call(this,r);s.canvas.width=s.canvas.height=Qq,R(this,mo,A6).call(this,s,Qq,t);let a=s.measureText(""),o=a.fontBoundingBoxAscent,c=Math.abs(a.fontBoundingBoxDescent);s.canvas.width=s.canvas.height=0;let u=.8;return o?u=o/(o+c):(Bn.platform.isFirefox&&De("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?u=e.ascent:e.descent&&(u=1+e.descent)),l(this,vA).set(t,u),u},T(Xi,mo),T(Xi,vA,new Map),T(Xi,My,new Map),T(Xi,V_,new WeakMap),T(Xi,wA,null),T(Xi,AA,new Set);sE=Xi,Dft=100;mP=class mP{constructor(){Lt(this,"_capability",Promise.withResolvers());Lt(this,"_transport",null);Lt(this,"_worker",null);Lt(this,"docId",`d${ze(mP,gP)._++}`);Lt(this,"destroyed",!1);Lt(this,"onPassword",null);Lt(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(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}};gP=new WeakMap,T(mP,gP,0);E6=mP,kS=class{constructor(t,e,r=!1,i=null){T(this,Fy,Promise.withResolvers());T(this,X_,[]);T(this,q_,[]);T(this,Y_,[]);T(this,K_,[]);this.length=t,this.initialData=e,this.progressiveDone=r,this.contentDispositionFilename=i}addRangeListener(t){l(this,K_).push(t)}addProgressListener(t){l(this,Y_).push(t)}addProgressiveReadListener(t){l(this,q_).push(t)}addProgressiveDoneListener(t){l(this,X_).push(t)}onDataRange(t,e){for(let r of l(this,K_))r(t,e)}onDataProgress(t,e){l(this,Fy).promise.then(()=>{for(let r of l(this,Y_))r(t,e)})}onDataProgressiveRead(t){l(this,Fy).promise.then(()=>{for(let e of l(this,q_))e(t)})}onDataProgressiveDone(){l(this,Fy).promise.then(()=>{for(let t of l(this,X_))t()})}transportReady(){l(this,Fy).resolve()}requestDataRange(t,e){qr("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};Fy=new WeakMap,X_=new WeakMap,q_=new WeakMap,Y_=new WeakMap,K_=new WeakMap;x6=class{constructor(t,e){this._pdfInfo=t,this._transport=e}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 Ce(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}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(t,e){return this._transport.getAnnotationsByType(t,e)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){let{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}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(t){return this._transport.extractPages(t)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}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()}},S6=class{constructor(t,e,r,i=!1){T(this,By);T(this,ef,!1);this._pageIndex=t,this._pageInfo=e,this._transport=r,this._stats=i?new _O:null,this._pdfBug=i,this.commonObjs=r.commonObjs,this.objs=new zO,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}get pageNumber(){return this._pageIndex+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:t,rotation:e=this.rotate,offsetX:r=0,offsetY:i=0,dontFlip:s=!1}={}){return new OS({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:s})}getAnnotations({intent:t="display"}={}){let{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Ce(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,canvas:e=t.canvas,viewport:r,intent:i="display",annotationMode:s=bf.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:c=null,annotationCanvasMap:u=null,pageColors:h=null,printAnnotationStorage:f=null,isEditing:d=!1,recordOperations:p=!1,operationsFilter:g=null}){this._stats?.time("Overall");let y=this._transport.getRenderingIntent(i,s,f,d),{renderingIntent:b,cacheKey:m}=y;x(this,ef,!1),c||(c=this._transport.getOptionalContentConfig(b));let w=this._intentStates.get(m);w||(w=Object.create(null),this._intentStates.set(m,w)),w.streamReaderCancelTimeout&&(clearTimeout(w.streamReaderCancelTimeout),w.streamReaderCancelTimeout=null);let A=!!(b&fo.PRINT);w.displayReadyCapability||(w.displayReadyCapability=Promise.withResolvers(),w.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(y));let _=!!(this._pdfBug&&globalThis.StepperManager?.enabled),S=!this.recordedBBoxes&&(p||_),I=z=>{if(w.renderTasks.delete(C),S){let G=C.gfx?.dependencyTracker.take();G&&(C.stepper&&C.stepper.setOperatorBBoxes(G,C.gfx.dependencyTracker.takeDebugMetadata()),p&&(this.recordedBBoxes=G))}A&&x(this,ef,!0),R(this,By,mS).call(this),z?(C.capability.reject(z),this._abortOperatorList({intentState:w,reason:z instanceof Error?z:new Error(z)})):C.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},C=new C6({callback:I,params:{canvas:e,canvasContext:t,dependencyTracker:S?new G4(e,w.operatorList.length,_):null,viewport:r,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:u,operatorList:w.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!A,pdfBug:this._pdfBug,pageColors:h,enableHWA:this._transport.enableHWA,operationsFilter:g});(w.renderTasks||(w.renderTasks=new Set)).add(C);let M=C.task;return Promise.all([w.displayReadyCapability.promise,c]).then(([z,G])=>{if(this.destroyed){I();return}if(this._stats?.time("Rendering"),!(G.renderingIntent&b))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");C.initializeGraphics({transparency:z,optionalContentConfig:G}),C.operatorListChanged()}).catch(I),M}getOperatorList({intent:t="display",annotationMode:e=bf.ENABLE,printAnnotationStorage:r=null,isEditing:i=!1}={}){function s(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(c))}let a=this._transport.getRenderingIntent(t,e,r,i,!0),o=this._intentStates.get(a.cacheKey);o||(o=Object.create(null),this._intentStates.set(a.cacheKey,o));let c;return o.opListReadCapability||(c=Object.create(null),c.operatorListChanged=s,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||(o.renderTasks=new Set)).add(c),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:e===!0},{highWaterMark:100,size(i){return i.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>IS.textContent(r));let e=this.streamTextContent(t);return new Promise(function(r,i){function s(){a.read().then(function({value:c,done:u}){if(u){r(o);return}o.lang??(o.lang=c.lang),Object.assign(o.styles,c.styles),o.items.push(...c.items),s()},i)}let a=e.getReader(),o={items:[],styles:Object.create(null),lang:null};s()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let t=[];for(let e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(let r of e.renderTasks)t.push(r.completed),r.cancel();return this.objs.clear(),x(this,ef,!1),Promise.all(t)}cleanup(t=!1){x(this,ef,!0);let e=R(this,By,mS).call(this);return t&&e&&this._stats&&(this._stats=new _O),e}_startRenderPage(t,e){let r=this._intentStates.get(e);r&&(this._stats?.timeEnd("Page Request"),r.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let r=0,i=t.length;r<i;r++)e.operatorList.fnArray.push(t.fnArray[r]),e.operatorList.argsArray.push(t.argsArray[r]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(let r of e.renderTasks)r.operatorListChanged();t.lastChunk&&R(this,By,mS).call(this)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:r,modifiedIds:i}){let{map:s,transfer:a}=r,c=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:s,modifiedIds:i},a).getReader(),u=this._intentStates.get(e);u.streamReader=c;let h=()=>{c.read().then(({value:f,done:d})=>{if(d){u.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(f,u),h())},f=>{if(u.streamReader=null,!this._transport.destroyed){if(u.operatorList){u.operatorList.lastChunk=!0;for(let d of u.renderTasks)d.operatorListChanged();R(this,By,mS).call(this)}if(u.displayReadyCapability)u.displayReadyCapability.reject(f);else if(u.opListReadCapability)u.opListReadCapability.reject(f);else throw f}})};h()}_abortOperatorList({intentState:t,reason:e,force:r=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!r){if(t.renderTasks.size>0)return;if(e instanceof iE){let i=Dft;e.extraDelay>0&&e.extraDelay<1e3&&(i+=e.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},i);return}}if(t.streamReader.cancel(new Kl(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(let[i,s]of this._intentStates)if(s===t){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}};ef=new WeakMap,By=new WeakSet,mS=function(){if(!l(this,ef)||this.destroyed)return!1;for(let{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),x(this,ef,!1),!0};un=class un{constructor({name:t=null,port:e=null,verbosity:r=ift()}={}){T(this,js);T(this,dp,Promise.withResolvers());T(this,Hl,null);T(this,rf,null);T(this,Uy,null);if(this.name=t,this.destroyed=!1,this.verbosity=r,e){if(l(un,$y).has(e))throw new Error("Cannot use more than one PDFWorker per port.");l(un,$y).set(e,this),R(this,js,aK).call(this,e)}else R(this,js,oK).call(this)}get promise(){return l(this,dp).promise}get port(){return l(this,rf)}get messageHandler(){return l(this,Hl)}destroy(){this.destroyed=!0,l(this,Uy)?.terminate(),x(this,Uy,null),l(un,$y).delete(l(this,rf)),x(this,rf,null),l(this,Hl)?.destroy(),x(this,Hl,null)}static create(t){let e=l(this,$y).get(t?.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new un(t)}static get workerSrc(){if(al.workerSrc)return al.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Ce(this,"_setupFakeWorkerGlobal",(async()=>l(this,EA,nO)?l(this,EA,nO):(await import(this.workerSrc)).WorkerMessageHandler)())}};dp=new WeakMap,Hl=new WeakMap,rf=new WeakMap,Uy=new WeakMap,yP=new WeakMap,jy=new WeakMap,$y=new WeakMap,js=new WeakSet,rO=function(){l(this,dp).resolve(),l(this,Hl).send("configure",{verbosity:this.verbosity})},aK=function(t){x(this,rf,t),x(this,Hl,new ey("main","worker",t)),l(this,Hl).on("ready",()=>{}),R(this,js,rO).call(this)},oK=function(){if(l(un,jy)||l(un,EA,nO)){R(this,js,yS).call(this);return}let{workerSrc:t}=un;try{un._isSameOrigin(window.location,t)||(t=un._createCDNWrapper(new URL(t,window.location).href));let e=new Worker(t,{type:"module"}),r=new ey("main","worker",e),i=()=>{s.abort(),r.destroy(),e.terminate(),this.destroyed?l(this,dp).reject(new Error("Worker was destroyed")):R(this,js,yS).call(this)},s=new AbortController;e.addEventListener("error",()=>{l(this,Uy)||i()},{signal:s.signal}),r.on("test",o=>{if(s.abort(),this.destroyed||!o){i();return}x(this,Hl,r),x(this,rf,e),x(this,Uy,e),R(this,js,rO).call(this)}),r.on("ready",o=>{if(s.abort(),this.destroyed){i();return}try{a()}catch{R(this,js,yS).call(this)}});let a=()=>{let o=new Uint8Array;r.send("test",o,[o.buffer])};a();return}catch{TP("The worker has been disabled.")}R(this,js,yS).call(this)},yS=function(){l(un,jy)||(De("Setting up fake worker."),x(un,jy,!0)),un._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){l(this,dp).reject(new Error("Worker was destroyed"));return}let e=new N4;x(this,rf,e);let r=`fake${ze(un,yP)._++}`,i=new ey(r+"_worker",r,e);t.setup(i,e),x(this,Hl,new ey(r,r+"_worker",e)),R(this,js,rO).call(this)}).catch(t=>{l(this,dp).reject(new Error(`Setting up fake worker failed: "${t.message}".`))})},EA=new WeakSet,nO=function(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}},T(un,EA),T(un,yP,0),T(un,jy,!1),T(un,$y,new WeakMap),Us&&(x(un,jy,!0),al.workerSrc||(al.workerSrc="./pdf.worker.mjs")),un._isSameOrigin=(t,e)=>{let r=URL.parse(t);if(!r?.origin||r.origin==="null")return!1;let i=new URL(e,r);return r.origin===i.origin},un._createCDNWrapper=t=>{let e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},un.fromPort=t=>{if(fft("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return un.create(t)};aE=un,_6=class{constructor(t,e,r,i,s,a){T(this,Hy);T(this,nf,new Map);T(this,ru,new Map);T(this,xA,new Map);T(this,SA,new Map);T(this,sf,null);this.messageHandler=t,this.loadingTask=e,this.commonObjs=new zO,this.fontLoader=new C4({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.wasmFactory=s.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=a,this.setupMessageHandler()}get annotationStorage(){return Ce(this,"annotationStorage",new NS)}getRenderingIntent(t,e=bf.ENABLE,r=null,i=!1,s=!1){let a=fo.DISPLAY,o=T4;switch(t){case"any":a=fo.ANY;break;case"display":break;case"print":a=fo.PRINT;break;default:De(`getRenderingIntent - invalid intent: ${t}`)}let c=a&fo.PRINT&&r instanceof DO?r:this.annotationStorage;switch(e){case bf.DISABLE:a+=fo.ANNOTATIONS_DISABLE;break;case bf.ENABLE:break;case bf.ENABLE_FORMS:a+=fo.ANNOTATIONS_FORMS;break;case bf.ENABLE_STORAGE:a+=fo.ANNOTATIONS_STORAGE,o=c.serializable;break;default:De(`getRenderingIntent - invalid annotationMode: ${e}`)}i&&(a+=fo.IS_EDITING),s&&(a+=fo.OPLIST);let{ids:u,hash:h}=c.modifiedIds,f=[a,o.hash,h];return{renderingIntent:a,cacheKey:f.join("_"),annotationStorageSerializable:o,modifiedIds:u}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),l(this,sf)?.reject(new Error("Worker was destroyed during onPassword callback"));let t=[];for(let r of l(this,ru).values())t.push(r._destroy());l(this,ru).clear(),l(this,xA).clear(),l(this,SA).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),l(this,nf).clear(),this.filterFactory.destroy(),sE.cleanup(),this._networkStream?.cancelAllRequests(new Kl("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(r,i)=>{rr(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=s=>{this._lastProgress={loaded:s.loaded,total:s.total}},i.onPull=()=>{this._fullReader.read().then(function({value:s,done:a}){if(a){i.close();return}rr(s instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{i.error(s)})},i.onCancel=s=>{this._fullReader.cancel(s),i.ready.catch(a=>{if(!this.destroyed)throw a})}}),t.on("ReaderHeadersReady",async r=>{await this._fullReader.headersReady;let{isStreamingSupported:i,isRangeSupported:s,contentLength:a}=this._fullReader;return(!i||!s)&&(this._lastProgress&&e.onProgress?.(this._lastProgress),this._fullReader.onProgress=o=>{e.onProgress?.({loaded:o.loaded,total:o.total})}),{isStreamingSupported:i,isRangeSupported:s,contentLength:a}}),t.on("GetRangeReader",(r,i)=>{rr(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let s=this._networkStream.getRangeReader(r.begin,r.end);if(!s){i.close();return}i.onPull=()=>{s.read().then(function({value:a,done:o}){if(o){i.close();return}rr(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{i.error(a)})},i.onCancel=a=>{s.cancel(a),i.ready.catch(o=>{if(!this.destroyed)throw o})}}),t.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,e._capability.resolve(new x6(r,this))}),t.on("DocException",r=>{e._capability.reject(oa(r))}),t.on("PasswordRequest",r=>{x(this,sf,Promise.withResolvers());try{if(!e.onPassword)throw oa(r);let i=s=>{s instanceof Error?l(this,sf).reject(s):l(this,sf).resolve({password:s})};e.onPassword(i,r.code)}catch(i){l(this,sf).reject(i)}return l(this,sf).promise}),t.on("DataLoaded",r=>{e.onProgress?.({loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),t.on("StartRenderPage",r=>{if(this.destroyed)return;l(this,ru).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),t.on("commonobj",([r,i,s])=>{if(this.destroyed||this.commonObjs.has(r))return null;switch(i){case"Font":if("error"in s){let f=s.error;De(`Error during font loading: ${f}`),this.commonObjs.resolve(r,f);break}let a=new I4(s),o=this._params.pdfBug&&globalThis.FontInspector?.enabled?(f,d)=>globalThis.FontInspector.fontAdded(f,d):null,c=new R4(a,o,s.extra,s.charProcOperatorList);this.fontLoader.bind(c).catch(()=>t.sendWithPromise("FontFallback",{id:r})).finally(()=>{!c.fontExtraProperties&&c.data&&c.clearData(),this.commonObjs.resolve(r,c)});break;case"CopyLocalImage":let{imageRef:u}=s;rr(u,"The imageRef must be defined.");for(let f of l(this,ru).values())for(let[,d]of f.objs)if(d?.ref===u)return d.dataLen?(this.commonObjs.resolve(r,structuredClone(d)),d.dataLen):null;break;case"FontPath":this.commonObjs.resolve(r,new O4(s));break;case"Image":this.commonObjs.resolve(r,s);break;case"Pattern":let h=new D4(s);this.commonObjs.resolve(r,h.getIR());break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),t.on("obj",([r,i,s,a])=>{if(this.destroyed)return;let o=l(this,ru).get(i);if(!o.objs.has(r)){if(o._intentStates.size===0){a?.bitmap?.close();return}switch(s){case"Image":case"Pattern":o.objs.resolve(r,a);break;default:throw new Error(`Got unknown object type ${s}`)}}}),t.on("DocProgress",r=>{this.destroyed||e.onProgress?.({loaded:r.loaded,total:r.total})}),t.on("FetchBinaryData",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");let i=this[r.type];if(!i)throw new Error(`${r.type} not initialized, see the \`useWorkerFetch\` parameter.`);return i.fetch(r)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&De("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally(()=>{this.annotationStorage.resetModified()})}extractPages(t){return this.messageHandler.sendWithPromise("ExtractPages",{pageInfos:t})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));let e=t-1,r=l(this,xA).get(e);if(r)return r;let i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(s=>{if(this.destroyed)throw new Error("Transport destroyed");s.refStr&&l(this,SA).set(s.refStr,t);let a=new S6(e,s,this,this._params.pdfBug);return l(this,ru).set(e,a),a});return l(this,xA).set(e,i),i}getPageIndex(t){return P4(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return R(this,Hy,bS).call(this,"GetFieldObjects")}hasJSActions(){return R(this,Hy,bS).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}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(t,e){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:e})}getDocJSActions(){return R(this,Hy,bS).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return R(this,Hy,bS).call(this,"GetOptionalContentConfig").then(e=>new i6(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let t="GetMetadata",e=l(this,nf).get(t);if(e)return e;let r=this.messageHandler.sendWithPromise(t,null).then(i=>({info:i[0],metadata:i[1]?new r6(i[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null,hasStructTree:i[2]}));return l(this,nf).set(t,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(let e of l(this,ru).values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),l(this,nf).clear(),this.filterFactory.destroy(!0),sE.cleanup()}}cachedPageNumber(t){if(!P4(t))return null;let e=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return l(this,SA).get(e)??null}};nf=new WeakMap,ru=new WeakMap,xA=new WeakMap,SA=new WeakMap,sf=new WeakMap,Hy=new WeakSet,bS=function(t,e=null){let r=l(this,nf).get(t);if(r)return r;let i=this.messageHandler.sendWithPromise(t,e);return l(this,nf).set(t,i),i};T6=class{constructor(t){T(this,pp,null);Lt(this,"onContinue",null);Lt(this,"onError",null);x(this,pp,t)}get promise(){return l(this,pp).capability.promise}cancel(t=0){l(this,pp).cancel(null,t)}get separateAnnots(){let{separateAnnots:t}=l(this,pp).operatorList;if(!t)return!1;let{annotationCanvasMap:e}=l(this,pp);return t.form||t.canvas&&e?.size>0}};pp=new WeakMap;Qm=class Qm{constructor({callback:t,params:e,objs:r,commonObjs:i,annotationCanvasMap:s,operatorList:a,pageIndex:o,canvasFactory:c,filterFactory:u,useRequestAnimationFrame:h=!1,pdfBug:f=!1,pageColors:d=null,enableHWA:p=!1,operationsFilter:g=null}){T(this,gp,null);this.callback=t,this.params=e,this.objs=r,this.commonObjs=i,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=c,this.filterFactory=u,this._pdfBug=f,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=h===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new T6(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=e.canvas,this._canvasContext=e.canvas?null:e.canvasContext,this._enableHWA=p,this._dependencyTracker=e.dependencyTracker,this._operationsFilter=g}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(l(Qm,zy).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(Qm,zy).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:r,transform:i,background:s,dependencyTracker:a}=this.params,o=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new Iw(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors,a),this.gfx.beginDrawing({transform:i,viewport:r,transparency:t,background:s}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,e=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),l(this,gp)&&(window.cancelAnimationFrame(l(this,gp)),x(this,gp,null)),l(Qm,zy).delete(this._canvas),t||(t=new iE(`Rendering cancelled, page ${this._pageIndex+1}`,e)),this.callback(t),this.task.onError?.(t)}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?x(this,gp,window.requestAnimationFrame(()=>{x(this,gp,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(Qm,zy).delete(this._canvas),this.callback())))}};gp=new WeakMap,zy=new WeakMap,T(Qm,zy,new WeakSet);C6=Qm,lK="5.4.530",cK="50cc4adac",la=class la{constructor({editor:t=null,uiManager:e=null}){T(this,Fr);T(this,Qa,null);T(this,Wy,null);T(this,_A);T(this,yi,null);T(this,Z_,!1);T(this,TA,!1);T(this,af,null);T(this,J_);T(this,mp,null);T(this,zl,null);t?(x(this,TA,!1),x(this,af,t)):x(this,TA,!0),x(this,zl,t?._uiManager||e),x(this,J_,l(this,zl)._eventBus),x(this,_A,t?.color?.toUpperCase()||l(this,zl)?.highlightColors.values().next().value||"#FFFF98"),l(la,Q_)||x(la,Q_,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 Ce(this,"_keyboardManager",new v0([[["Escape","mac+Escape"],la.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],la.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],la.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],la.prototype._moveToPrevious],[["Home","mac+Home"],la.prototype._moveToBeginning],[["End","mac+End"],la.prototype._moveToEnd]]))}renderButton(){let t=x(this,Qa,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",l(this,af)&&(t.ariaControls=`${l(this,af).id}_colorpicker_dropdown`);let e=l(this,zl)._signal;t.addEventListener("click",R(this,Fr,Ym).bind(this),{signal:e}),t.addEventListener("keydown",R(this,Fr,D6).bind(this),{signal:e});let r=x(this,Wy,document.createElement("span"));return r.className="swatch",r.ariaHidden="true",r.style.backgroundColor=l(this,_A),t.append(r),t}renderMainDropdown(){let t=x(this,yi,R(this,Fr,R6).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===l(this,Qa)){R(this,Fr,Ym).call(this,t);return}let e=t.target.getAttribute("data-color");e&&R(this,Fr,I6).call(this,e,t)}_moveToNext(t){if(!l(this,Fr,zd)){R(this,Fr,Ym).call(this,t);return}if(t.target===l(this,Qa)){l(this,yi).firstElementChild?.focus();return}t.target.nextSibling?.focus()}_moveToPrevious(t){if(t.target===l(this,yi)?.firstElementChild||t.target===l(this,Qa)){l(this,Fr,zd)&&this._hideDropdownFromKeyboard();return}l(this,Fr,zd)||R(this,Fr,Ym).call(this,t),t.target.previousSibling?.focus()}_moveToBeginning(t){if(!l(this,Fr,zd)){R(this,Fr,Ym).call(this,t);return}l(this,yi).firstElementChild?.focus()}_moveToEnd(t){if(!l(this,Fr,zd)){R(this,Fr,Ym).call(this,t);return}l(this,yi).lastElementChild?.focus()}hideDropdown(){l(this,yi)?.classList.add("hidden"),l(this,Qa).ariaExpanded="false",l(this,mp)?.abort(),x(this,mp,null)}_hideDropdownFromKeyboard(){if(!l(this,TA)){if(!l(this,Fr,zd)){l(this,af)?.unselect();return}this.hideDropdown(),l(this,Qa).focus({preventScroll:!0,focusVisible:l(this,Z_)})}}updateColor(t){if(l(this,Wy)&&(l(this,Wy).style.backgroundColor=t),!l(this,yi))return;let e=l(this,zl).highlightColors.values();for(let r of l(this,yi).children)r.ariaSelected=e.next().value===t.toUpperCase()}destroy(){l(this,Qa)?.remove(),x(this,Qa,null),x(this,Wy,null),l(this,yi)?.remove(),x(this,yi,null)}};Qa=new WeakMap,Wy=new WeakMap,_A=new WeakMap,yi=new WeakMap,Z_=new WeakMap,TA=new WeakMap,af=new WeakMap,J_=new WeakMap,mp=new WeakMap,zl=new WeakMap,Q_=new WeakMap,Fr=new WeakSet,R6=function(){let t=document.createElement("div"),e=l(this,zl)._signal;t.addEventListener("contextmenu",yo,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),l(this,af)&&(t.id=`${l(this,af).id}_colorpicker_dropdown`);for(let[r,i]of l(this,zl).highlightColors){let s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",i),s.title=r,s.setAttribute("data-l10n-id",l(la,Q_)[r]);let a=document.createElement("span");s.append(a),a.className="swatch",a.style.backgroundColor=i,s.ariaSelected=i===l(this,_A),s.addEventListener("click",R(this,Fr,I6).bind(this,i),{signal:e}),t.append(s)}return t.addEventListener("keydown",R(this,Fr,D6).bind(this),{signal:e}),t},I6=function(t,e){e.stopPropagation(),l(this,J_).dispatch("switchannotationeditorparams",{source:this,type:tr.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)},D6=function(t){la._keyboardManager.exec(this,t)},Ym=function(t){if(l(this,Fr,zd)){this.hideDropdown();return}if(x(this,Z_,t.detail===0),l(this,mp)||(x(this,mp,new AbortController),window.addEventListener("pointerdown",R(this,Fr,uK).bind(this),{signal:l(this,zl).combinedSignal(l(this,mp))})),l(this,Qa).ariaExpanded="true",l(this,yi)){l(this,yi).classList.remove("hidden");return}let e=x(this,yi,R(this,Fr,R6).call(this));l(this,Qa).append(e)},uK=function(t){l(this,yi)?.contains(t.target)||this.hideDropdown()},zd=function(){return l(this,yi)&&!l(this,yi).classList.contains("hidden")},T(la,Q_,null);MS=la,ty=class ty{constructor(t){T(this,nu,null);T(this,tT,null);T(this,CA,null);x(this,tT,t),x(this,CA,t._uiManager),l(ty,eT)||x(ty,eT,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(l(this,nu))return l(this,nu);let{editorType:t,colorType:e,color:r}=l(this,tT),i=x(this,nu,document.createElement("input"));return i.type="color",i.value=r||"#000000",i.className="basicColorPicker",i.tabIndex=0,i.setAttribute("data-l10n-id",l(ty,eT)[t]),i.addEventListener("input",()=>{l(this,CA).updateParams(e,i.value)},{signal:l(this,CA)._signal}),i}update(t){l(this,nu)&&(l(this,nu).value=t)}destroy(){l(this,nu)?.remove(),x(this,nu,null)}hideDropdown(){}};nu=new WeakMap,tT=new WeakMap,CA=new WeakMap,eT=new WeakMap,T(ty,eT,null);WO=ty;GO=class{static CMYK_G([t,e,r,i]){return["G",1-Math.min(1,.3*t+.59*r+.11*e+i)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=rS(t),[t,t,t]}static G_HTML([t]){let e=tY(t);return`#${e}${e}${e}`}static RGB_G([t,e,r]){return["G",.3*t+.59*e+.11*r]}static RGB_rgb(t){return t.map(rS)}static RGB_HTML(t){return`#${t.map(tY).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,r,i]){return["RGB",1-Math.min(1,t+i),1-Math.min(1,r+i),1-Math.min(1,e+i)]}static CMYK_rgb([t,e,r,i]){return[rS(1-Math.min(1,t+i)),rS(1-Math.min(1,r+i)),rS(1-Math.min(1,e+i))]}static CMYK_HTML(t){let e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,r]){let i=1-t,s=1-e,a=1-r,o=Math.min(i,s,a);return["CMYK",i,s,a,o]}},O6=class{create(t,e,r=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");let i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),r||(i.setAttribute("width",`${t}px`),i.setAttribute("height",`${e}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${t} ${e}`),i}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){qr("Abstract method `_createSVG` called.")}},w0=class extends O6{_createSVG(t){return document.createElementNS(Ph,t)}},Oft=9,A0=new WeakSet,Pft=new Date().getTimezoneOffset()*60*1e3,CS=class{static create(t){switch(t.data.annotationType){case Vn.LINK:return new FS(t);case Vn.TEXT:return new L6(t);case Vn.WIDGET:switch(t.data.fieldType){case"Tx":return new k6(t);case"Btn":return t.data.radioButton?new VO(t):t.data.checkBox?new F6(t):new B6(t);case"Ch":return new U6(t);case"Sig":return new M6(t)}return new xf(t);case Vn.POPUP:return new BS(t);case Vn.FREETEXT:return new XO(t);case Vn.LINE:return new X6(t);case Vn.SQUARE:return new q6(t);case Vn.CIRCLE:return new Y6(t);case Vn.POLYLINE:return new qO(t);case Vn.CARET:return new Z6(t);case Vn.INK:return new US(t);case Vn.POLYGON:return new K6(t);case Vn.HIGHLIGHT:return new YO(t);case Vn.UNDERLINE:return new Q6(t);case Vn.SQUIGGLY:return new t5(t);case Vn.STRIKEOUT:return new e5(t);case Vn.STAMP:return new KO(t);case Vn.FILEATTACHMENT:return new r5(t);default:return new An(t)}}},j5=class j5{constructor(t,{isRenderable:e=!1,ignoreBorder:r=!1,createQuadrilaterals:i=!1}={}){T(this,rT);T(this,Gy,null);T(this,RA,!1);T(this,nl,null);this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableComment=t.enableComment,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,this.hasOwnCommentButton=!1,e&&(this.contentElement=this.container=this._createContainer(r)),i&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:e}){return!!(t?.str||e?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return j5._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){let{data:t}=this,e=this.annotationStorage?.getEditor(t.id);return e?e.getData():t}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){let t=this.annotationStorage?.getEditor(this.data.id);if(t)return t.commentButtonPositionInPage;let{quadPoints:e,inkLists:r,rect:i}=this.data,s=-1/0,a=-1/0;if(e?.length>=8){for(let o=0;o<e.length;o+=8)e[o+1]>a?(a=e[o+1],s=e[o+2]):e[o+1]===a&&(s=Math.max(s,e[o+2]));return[s,a]}if(r?.length>=1){for(let o of r)for(let c=0,u=o.length;c<u;c+=2)o[c+1]>a?(a=o[c+1],s=o[c]):o[c+1]===a&&(s=Math.max(s,o[c]));if(s!==1/0)return[s,a]}return i?[i[2],i[3]]:null}_normalizePoint(t){let{page:{view:e},viewport:{rawDims:{pageWidth:r,pageHeight:i,pageX:s,pageY:a}}}=this.parent;return t[1]=e[3]-t[1]+e[1],t[0]=100*(t[0]-s)/r,t[1]=100*(t[1]-a)/i,t}get commentText(){let{data:t}=this;return this.annotationStorage.getRawValue(`${RS}${t.id}`)?.popup?.contents||t.contentsObj?.str||""}set commentText(t){let{data:e}=this,r={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(e.id,{popup:r})||this.annotationStorage.setValue(`${RS}${e.id}`,{id:e.id,annotationType:e.annotationType,pageIndex:this.parent.page._pageIndex,popup:r,popupRef:e.popupRef,modificationDate:new Date}),t||this.removePopup()}removePopup(){(l(this,nl)?.popup||this.popup)?.remove(),x(this,nl,this.popup=null)}updateEdited(t){if(!this.container)return;t.rect&&(l(this,Gy)||x(this,Gy,{rect:this.data.rect.slice(0)}));let{rect:e,popup:r}=t;e&&R(this,rT,P6).call(this,e);let i=l(this,nl)?.popup||this.popup;!i&&r?.text&&(this._createPopup(r),i=l(this,nl).popup),i&&(i.updateEdited(t),r?.deleted&&(i.remove(),x(this,nl,null),this.popup=null))}resetEdited(){l(this,Gy)&&(R(this,rT,P6).call(this,l(this,Gy).rect),l(this,nl)?.popup.resetEdited(),x(this,Gy,null))}_createContainer(t){let{data:e,parent:{page:r,viewport:i}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),!(this instanceof xf)&&!(this instanceof FS)&&(s.tabIndex=0);let{style:a}=s;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof BS){let{rotation:y}=e;return!e.hasOwnCanvas&&y!==0&&this.setRotation(y,s),s}let{width:o,height:c}=this;if(!t&&e.borderStyle.width>0){a.borderWidth=`${e.borderStyle.width}px`;let y=e.borderStyle.horizontalCornerRadius,b=e.borderStyle.verticalCornerRadius;if(y>0||b>0){let w=`calc(${y}px * var(--total-scale-factor)) / calc(${b}px * var(--total-scale-factor))`;a.borderRadius=w}else if(this instanceof VO){let w=`calc(${o}px * var(--total-scale-factor)) / calc(${c}px * var(--total-scale-factor))`;a.borderRadius=w}switch(e.borderStyle.style){case pw.SOLID:a.borderStyle="solid";break;case pw.DASHED:a.borderStyle="dashed";break;case pw.BEVELED:De("Unimplemented border style: beveled");break;case pw.INSET:De("Unimplemented border style: inset");break;case pw.UNDERLINE:a.borderBottomStyle="solid";break;default:break}let m=e.borderColor||null;m?(x(this,RA,!0),a.borderColor=se.makeHexColor(m[0]|0,m[1]|0,m[2]|0)):a.borderWidth=0}let u=se.normalizeRect([e.rect[0],r.view[3]-e.rect[1]+r.view[1],e.rect[2],r.view[3]-e.rect[3]+r.view[1]]),{pageWidth:h,pageHeight:f,pageX:d,pageY:p}=i.rawDims;a.left=`${100*(u[0]-d)/h}%`,a.top=`${100*(u[1]-p)/f}%`;let{rotation:g}=e;return e.hasOwnCanvas||g===0?(a.width=`${100*o/h}%`,a.height=`${100*c/f}%`):this.setRotation(g,s),s}setRotation(t,e=this.container){if(!this.data.rect)return;let{pageWidth:r,pageHeight:i}=this.parent.viewport.rawDims,{width:s,height:a}=this;t%180!==0&&([s,a]=[a,s]),e.style.width=`${100*s/r}%`,e.style.height=`${100*a/i}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){let t=(e,r,i)=>{let s=i.detail[e],a=s[0],o=s.slice(1);i.target.style[r]=GO[`${a}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[r]:GO[`${a}_rgb`](o)})};return Ce(this,"_commonActions",{display:e=>{let{display:r}=e.detail,i=r%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:r===1||r===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{let{hidden:r}=e.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:e=>{let r=e.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(t,e){let r=this._commonActions;for(let i of Object.keys(e.detail))(t[i]||r[i])?.(e)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;let e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;let r=this._commonActions;for(let[i,s]of Object.entries(e)){let a=r[i];if(a){let o={detail:{[i]:s},target:t};a(o),delete e[i]}}}_createQuadrilaterals(){if(!this.container)return;let{quadPoints:t}=this.data;if(!t)return;let[e,r,i,s]=this.data.rect.map(y=>Math.fround(y));if(t.length===8){let[y,b,m,w]=t.subarray(2,6);if(i===y&&s===b&&e===m&&r===w)return}let{style:a}=this.container,o;if(l(this,RA)){let{borderColor:y,borderWidth:b}=a;a.borderWidth=0,o=["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="${y}" stroke-width="${b}">`],this.container.classList.add("hasBorder")}let c=i-e,u=s-r,{svgFactory:h}=this,f=h.createElement("svg");f.classList.add("quadrilateralsContainer"),f.setAttribute("width",0),f.setAttribute("height",0),f.role="none";let d=h.createElement("defs");f.append(d);let p=h.createElement("clipPath"),g=`clippath_${this.data.id}`;p.setAttribute("id",g),p.setAttribute("clipPathUnits","objectBoundingBox"),d.append(p);for(let y=2,b=t.length;y<b;y+=8){let m=t[y],w=t[y+1],A=t[y+2],_=t[y+3],S=h.createElement("rect"),I=(A-e)/c,C=(s-w)/u,M=(m-A)/c,z=(w-_)/u;S.setAttribute("x",I),S.setAttribute("y",C),S.setAttribute("width",M),S.setAttribute("height",z),p.append(S),o?.push(`<rect vector-effect="non-scaling-stroke" x="${I}" y="${C}" width="${M}" height="${z}"/>`)}l(this,RA)&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(f),this.container.style.clipPath=`url(#${g})`}_createPopup(t=null){let{data:e}=this,r,i;t?(r={str:t.text},i=t.date):(r=e.contentsObj,i=e.modificationDate),x(this,nl,new BS({data:{color:e.color,titleObj:e.titleObj,modificationDate:i,contentsObj:r,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}))}get hasPopupElement(){return!!(l(this,nl)||this.popup||this.data.popupRef)}get extraPopupElement(){return l(this,nl)}render(){qr("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){let r=[];if(this._fieldObjects){let i=this._fieldObjects[t];if(i)for(let{page:s,id:a,exportValues:o}of i){if(s===-1||a===e)continue;let c=typeof o=="string"?o:null,u=document.querySelector(`[data-element-id="${a}"]`);if(u&&!A0.has(u)){De(`_getElementsByName - element not allowed: ${a}`);continue}r.push({id:a,exportValue:c,domElement:u})}return r}for(let i of document.getElementsByName(t)){let{exportValue:s}=i,a=i.getAttribute("data-element-id");a!==e&&A0.has(i)&&r.push({id:a,exportValue:s,domElement:i})}return r}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 t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(let e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};Gy=new WeakMap,RA=new WeakMap,nl=new WeakMap,rT=new WeakSet,P6=function(t){let{container:{style:e},data:{rect:r,rotation:i},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:c}}}}=this;r?.splice(0,4,...t),e.left=`${100*(t[0]-o)/s}%`,e.top=`${100*(a-t[3]+c)/a}%`,i===0?(e.width=`${100*(t[2]-t[0])/s}%`,e.height=`${100*(t[3]-t[1])/a}%`):this.setRotation(i)};An=j5,N6=class extends An{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.editor=t.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){let{editor:t}=this;t.hasComment&&this._createPopup(t.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(t){this.editor.comment=t,t||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}},FS=class extends An{constructor(e,r=null){super(e,{isRenderable:!0,ignoreBorder:!!r?.ignoreBorder,createQuadrilaterals:!0});T(this,go);this.isTooltipOnly=e.data.isTooltipOnly}render(){let{data:e,linkService:r}=this,i=document.createElement("a");i.setAttribute("data-element-id",e.id);let s=!1;return e.url?(r.addLinkAttributes(i,e.url,e.newWindow),s=!0):e.action?(this._bindNamedAction(i,e.action,e.overlaidText),s=!0):e.attachment?(R(this,go,hK).call(this,i,e.attachment,e.overlaidText,e.attachmentDest),s=!0):e.setOCGState?(R(this,go,fK).call(this,i,e.setOCGState,e.overlaidText),s=!0):e.dest?(this._bindLink(i,e.dest,e.overlaidText),s=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,e),s=!0),e.resetForm?(this._bindResetFormAction(i,e.resetForm),s=!0):this.isTooltipOnly&&!s&&(this._bindLink(i,""),s=!0)),this.container.classList.add("linkAnnotation"),s&&(this.contentElement=i,this.container.append(i)),this.container}_bindLink(e,r,i=""){e.href=this.linkService.getDestinationHash(r),e.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||r==="")&&R(this,go,Km).call(this),i&&(e.title=i)}_bindNamedAction(e,r,i=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(r),!1),i&&(e.title=i),R(this,go,Km).call(this)}_bindJSAction(e,r){e.href=this.linkService.getAnchorUrl("");let i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let s of Object.keys(r.actions)){let a=i.get(s);a&&(e[a]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:s}}),!1))}r.overlaidText&&(e.title=r.overlaidText),e.onclick||(e.onclick=()=>!1),R(this,go,Km).call(this)}_bindResetFormAction(e,r){let i=e.onclick;if(i||(e.href=this.linkService.getAnchorUrl("")),R(this,go,Km).call(this),!this._fieldObjects){De('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(e.onclick=()=>!1);return}e.onclick=()=>{i?.();let{fields:s,refs:a,include:o}=r,c=[];if(s.length!==0||a.length!==0){let f=new Set(a);for(let d of s){let p=this._fieldObjects[d]||[];for(let{id:g}of p)f.add(g)}for(let d of Object.values(this._fieldObjects))for(let p of d)f.has(p.id)===o&&c.push(p)}else for(let f of Object.values(this._fieldObjects))c.push(...f);let u=this.annotationStorage,h=[];for(let f of c){let{id:d}=f;switch(h.push(d),f.type){case"text":{let g=f.defaultValue||"";u.setValue(d,{value:g});break}case"checkbox":case"radiobutton":{let g=f.defaultValue===f.exportValues;u.setValue(d,{value:g});break}case"combobox":case"listbox":{let g=f.defaultValue||"";u.setValue(d,{value:g});break}default:continue}let p=document.querySelector(`[data-element-id="${d}"]`);if(p){if(!A0.has(p)){De(`_bindResetFormAction - element not allowed: ${d}`);continue}}else continue;p.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:h,name:"ResetForm"}}),!1}}};go=new WeakSet,Km=function(){this.container.setAttribute("data-internal-link","")},hK=function(e,r,i="",s=null){e.href=this.linkService.getAnchorUrl(""),r.description?e.title=r.description:i&&(e.title=i),e.onclick=()=>(this.downloadManager?.openOrDownloadData(r.content,r.filename,s),!1),R(this,go,Km).call(this)},fK=function(e,r,i=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(r),!1),i&&(e.title=i),R(this,go,Km).call(this)};L6=class extends An{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");let t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(t),this.container}},xf=class extends An{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Bn.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,r,i,s){r.includes("mouse")?t.addEventListener(r,a=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):t.addEventListener(r,a=>{if(r==="blur"){if(!e.focused||!a.relatedTarget)return;e.focused=!1}else if(r==="focus"){if(e.focused)return;e.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(a)}})})}_setEventListeners(t,e,r,i){for(let[s,a]of r)(a==="Action"||this.data.actions?.[a])&&((a==="Focus"||a==="Blur")&&(e||(e={focused:!1})),this._setEventListener(t,e,s,a,i),a==="Focus"&&!this.data.actions?.Blur?this._setEventListener(t,e,"blur","Blur",null):a==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(t,e,"focus","Focus",null))}_setBackgroundColor(t){let e=this.data.backgroundColor||null;t.style.backgroundColor=e===null?"transparent":se.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){let e=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||Oft,s=t.style,a,o=2,c=u=>Math.round(10*u)/10;if(this.data.multiLine){let u=Math.abs(this.data.rect[3]-this.data.rect[1]-o),h=Math.round(u/(WD*i))||1,f=u/h;a=Math.min(i,c(f/WD))}else{let u=Math.abs(this.data.rect[3]-this.data.rect[1]-o);a=Math.min(i,c(u/WD))}s.fontSize=`calc(${a}px * var(--total-scale-factor))`,s.color=se.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(s.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}},k6=class extends xf{constructor(t){let e=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:e})}setPropertyOnSiblings(t,e,r,i){let s=this.annotationStorage;for(let a of this._getElementsByName(t.name,t.id))a.domElement&&(a.domElement[e]=r),s.setValue(a.id,{[i]:r})}render(){let t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){let i=t.getValue(e,{value:this.data.fieldValue}),s=i.value||"",a=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;a&&s.length>a&&(s=s.slice(0,a));let o=i.formattedValue||this.data.textContent?.join(`
108
+ `)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));let c={userValue:s,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=o??s,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type=this.data.password?"password":"text",r.setAttribute("value",o??s),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),A0.add(r),this.contentElement=r,r.setAttribute("data-element-id",e),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=0;let{datetimeFormat:u,datetimeType:h,timeStep:f}=this.data,d=!!h&&this.enableScripting;u&&(r.title=u),this._setRequired(r,this.data.required),a&&(r.maxLength=a),r.addEventListener("input",g=>{t.setValue(e,{value:g.target.value}),this.setPropertyOnSiblings(r,"value",g.target.value,"value"),c.formattedValue=null}),r.addEventListener("resetform",g=>{let y=this.data.defaultFieldValue??"";r.value=c.userValue=y,c.formattedValue=null});let p=g=>{let{formattedValue:y}=c;y!=null&&(g.target.value=y),g.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",y=>{if(c.focused)return;let{target:b}=y;if(d&&(b.type=h,f&&(b.step=f)),c.userValue){let m=c.userValue;if(d)if(h==="time"){let w=new Date(m),A=[w.getHours(),w.getMinutes(),w.getSeconds()];b.value=A.map(_=>_.toString().padStart(2,"0")).join(":")}else b.value=new Date(m-Pft).toISOString().split(h==="date"?"T":".",1)[0];else b.value=m}c.lastCommittedValue=b.value,c.commitKey=1,this.data.actions?.Focus||(c.focused=!0)}),r.addEventListener("updatefromsandbox",y=>{this.showElementAndHideCanvas(y.target);let b={value(m){c.userValue=m.detail.value??"",d||t.setValue(e,{value:c.userValue.toString()}),m.target.value=c.userValue},formattedValue(m){let{formattedValue:w}=m.detail;c.formattedValue=w,w!=null&&m.target!==document.activeElement&&(m.target.value=w);let A={formattedValue:w};d&&(A.value=w),t.setValue(e,A)},selRange(m){m.target.setSelectionRange(...m.detail.selRange)},charLimit:m=>{let{charLimit:w}=m.detail,{target:A}=m;if(w===0){A.removeAttribute("maxLength");return}A.setAttribute("maxLength",w);let _=c.userValue;!_||_.length<=w||(_=_.slice(0,w),A.value=c.userValue=_,t.setValue(e,{value:_}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:_,willCommit:!0,commitKey:1,selStart:A.selectionStart,selEnd:A.selectionEnd}}))}};this._dispatchEventFromSandbox(b,y)}),r.addEventListener("keydown",y=>{c.commitKey=1;let b=-1;if(y.key==="Escape"?b=0:y.key==="Enter"&&!this.data.multiLine?b=2:y.key==="Tab"&&(c.commitKey=3),b===-1)return;let{value:m}=y.target;c.lastCommittedValue!==m&&(c.lastCommittedValue=m,c.userValue=m,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:m,willCommit:!0,commitKey:b,selStart:y.target.selectionStart,selEnd:y.target.selectionEnd}}))});let g=p;p=null,r.addEventListener("blur",y=>{if(!c.focused||!y.relatedTarget)return;this.data.actions?.Blur||(c.focused=!1);let{target:b}=y,{value:m}=b;if(d){if(m&&h==="time"){let w=m.split(":").map(A=>parseInt(A,10));m=new Date(2e3,0,1,w[0],w[1],w[2]||0).valueOf(),b.step=""}else m.includes("T")||(m=`${m}T00:00`),m=new Date(m).valueOf();b.type="text"}c.userValue=m,c.lastCommittedValue!==m&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:m,willCommit:!0,commitKey:c.commitKey,selStart:y.target.selectionStart,selEnd:y.target.selectionEnd}}),g(y)}),this.data.actions?.Keystroke&&r.addEventListener("beforeinput",y=>{c.lastCommittedValue=null;let{data:b,target:m}=y,{value:w,selectionStart:A,selectionEnd:_}=m,S=A,I=_;switch(y.inputType){case"deleteWordBackward":{let C=w.substring(0,A).match(/\w*[^\w]*$/);C&&(S-=C[0].length);break}case"deleteWordForward":{let C=w.substring(A).match(/^[^\w]*\w*/);C&&(I+=C[0].length);break}case"deleteContentBackward":A===_&&(S-=1);break;case"deleteContentForward":A===_&&(I+=1);break}y.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:w,change:b||"",willCommit:!1,selStart:S,selEnd:I}})}),this._setEventListeners(r,c,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],y=>y.target.value)}if(p&&r.addEventListener("blur",p),this.data.comb){let y=(this.data.rect[2]-this.data.rect[0])/a;r.classList.add("comb"),r.style.letterSpacing=`calc(${y}px * var(--total-scale-factor) - 1ch)`}}else r=document.createElement("div"),r.textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell",this.data.hasOwnCanvas&&(r.hidden=!0);return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}},M6=class extends xf{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}},F6=class extends xf{constructor(t){super(t,{isRenderable:t.renderForms})}render(){let t=this.annotationStorage,e=this.data,r=e.id,i=t.getValue(r,{value:e.exportValue===e.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",t.setValue(r,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let s=document.createElement("input");return A0.add(s),s.setAttribute("data-element-id",r),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=e.fieldName,i&&s.setAttribute("checked",!0),s.setAttribute("exportValue",e.exportValue),s.tabIndex=0,s.addEventListener("change",a=>{let{name:o,checked:c}=a.target;for(let u of this._getElementsByName(o,r)){let h=c&&u.exportValue===e.exportValue;u.domElement&&(u.domElement.checked=h),t.setValue(u.id,{value:h})}t.setValue(r,{value:c})}),s.addEventListener("resetform",a=>{let o=e.defaultFieldValue||"Off";a.target.checked=o===e.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",a=>{let o={value(c){c.target.checked=c.detail.value!=="Off",t.setValue(r,{value:c.target.checked})}};this._dispatchEventFromSandbox(o,a)}),this._setEventListeners(s,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)),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}},VO=class extends xf{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let t=this.annotationStorage,e=this.data,r=e.id,i=t.getValue(r,{value:e.fieldValue===e.buttonValue}).value;if(typeof i=="string"&&(i=i!==e.buttonValue,t.setValue(r,{value:i})),i)for(let a of this._getElementsByName(e.fieldName,r))t.setValue(a.id,{value:!1});let s=document.createElement("input");if(A0.add(s),s.setAttribute("data-element-id",r),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=e.fieldName,i&&s.setAttribute("checked",!0),s.tabIndex=0,s.addEventListener("change",a=>{let{name:o,checked:c}=a.target;for(let u of this._getElementsByName(o,r))t.setValue(u.id,{value:!1});t.setValue(r,{value:c})}),s.addEventListener("resetform",a=>{let o=e.defaultFieldValue;a.target.checked=o!=null&&o===e.buttonValue}),this.enableScripting&&this.hasJSActions){let a=e.buttonValue;s.addEventListener("updatefromsandbox",o=>{let c={value:u=>{let h=a===u.detail.value;for(let f of this._getElementsByName(u.target.name)){let d=h&&f.id===r;f.domElement&&(f.domElement.checked=d),t.setValue(f.id,{value:d})}}};this._dispatchEventFromSandbox(c,o)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}},B6=class extends FS{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){let t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");let e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({},r)})),t}},U6=class extends xf{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let t=this.annotationStorage,e=this.data.id,r=t.getValue(e,{value:this.data.fieldValue}),i=document.createElement("select");A0.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=0;let s=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",h=>{let f=this.data.defaultFieldValue;for(let d of i.options)d.selected=d.value===f});for(let h of this.data.options){let f=document.createElement("option");f.textContent=h.displayValue,f.value=h.exportValue,r.value.includes(h.exportValue)&&(f.setAttribute("selected",!0),s=!1),i.append(f)}let a=null;if(s){let h=document.createElement("option");h.value=" ",h.setAttribute("hidden",!0),h.setAttribute("selected",!0),i.prepend(h),a=()=>{h.remove(),i.removeEventListener("input",a),a=null},i.addEventListener("input",a)}let o=h=>{let f=h?"value":"textContent",{options:d,multiple:p}=i;return p?Array.prototype.filter.call(d,g=>g.selected).map(g=>g[f]):d.selectedIndex===-1?null:d[d.selectedIndex][f]},c=o(!1),u=h=>{let f=h.target.options;return Array.prototype.map.call(f,d=>({displayValue:d.textContent,exportValue:d.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",h=>{let f={value(d){a?.();let p=d.detail.value,g=new Set(Array.isArray(p)?p:[p]);for(let y of i.options)y.selected=g.has(y.value);t.setValue(e,{value:o(!0)}),c=o(!1)},multipleSelection(d){i.multiple=!0},remove(d){let p=i.options,g=d.detail.remove;p[g].selected=!1,i.remove(g),p.length>0&&Array.prototype.findIndex.call(p,b=>b.selected)===-1&&(p[0].selected=!0),t.setValue(e,{value:o(!0),items:u(d)}),c=o(!1)},clear(d){for(;i.length!==0;)i.remove(0);t.setValue(e,{value:null,items:[]}),c=o(!1)},insert(d){let{index:p,displayValue:g,exportValue:y}=d.detail.insert,b=i.children[p],m=document.createElement("option");m.textContent=g,m.value=y,b?b.before(m):i.append(m),t.setValue(e,{value:o(!0),items:u(d)}),c=o(!1)},items(d){let{items:p}=d.detail;for(;i.length!==0;)i.remove(0);for(let g of p){let{displayValue:y,exportValue:b}=g,m=document.createElement("option");m.textContent=y,m.value=b,i.append(m)}i.options.length>0&&(i.options[0].selected=!0),t.setValue(e,{value:o(!0),items:u(d)}),c=o(!1)},indices(d){let p=new Set(d.detail.indices);for(let g of d.target.options)g.selected=p.has(g.index);t.setValue(e,{value:o(!0)}),c=o(!1)},editable(d){d.target.disabled=!d.detail.editable}};this._dispatchEventFromSandbox(f,h)}),i.addEventListener("input",h=>{let f=o(!0),d=o(!1);t.setValue(e,{value:f}),h.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:c,change:d,changeEx:f,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"]],h=>h.target.value)):i.addEventListener("input",function(h){t.setValue(e,{value:o(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},BS=class extends An{constructor(e){let{data:r,elements:i,parent:s}=e,a=!!s._commentManager;super(e,{isRenderable:!a&&An._hasPopupData(r)});T(this,nT);if(this.elements=i,a&&An._hasPopupData(r)){let o=this.popup=R(this,nT,j6).call(this);for(let c of i)c.popup=o}else this.popup=null}render(){let{container:e}=this;e.classList.add("popupAnnotation"),e.role="comment";let r=this.popup=R(this,nT,j6).call(this),i=[];for(let s of this.elements)s.popup=r,s.container.ariaHasPopup="dialog",i.push(s.data.id),s.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(s=>`${Ew}${s}`).join(",")),this.container}};nT=new WeakSet,j6=function(){return new $6({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})};$6=class{constructor({container:t,color:e,elements:r,titleObj:i,modificationDate:s,contentsObj:a,richText:o,parent:c,rect:u,parentRect:h,open:f,commentManager:d=null}){T(this,$e);T(this,to,null);T(this,yp,R(this,$e,gK).bind(this));T(this,bP,R(this,$e,V6).bind(this));T(this,vP,R(this,$e,oO).bind(this));T(this,IA,R(this,$e,aO).bind(this));T(this,DA,null);T(this,kn,null);T(this,iu,null);T(this,bp,null);T(this,Vy,null);T(this,OA,null);T(this,PA,null);T(this,su,!1);T(this,eo,null);T(this,of,null);T(this,lf,null);T(this,Mn,null);T(this,cf,null);T(this,vp,null);T(this,iT,null);T(this,uf,null);T(this,NA,null);T(this,Xy,null);T(this,wp,!1);T(this,Oi,null);T(this,Ap,null);x(this,kn,t),x(this,NA,i),x(this,iu,a),x(this,uf,o),x(this,OA,c),x(this,DA,e),x(this,iT,u),x(this,PA,h),x(this,Vy,r),x(this,to,d),x(this,Oi,r[0]),x(this,bp,y0.toDateObject(s)),this.trigger=r.flatMap(p=>p.getElementsToTriggerPopup()),d||(R(this,$e,iO).call(this),l(this,kn).hidden=!0,f&&R(this,$e,aO).call(this))}renderCommentButton(){if(l(this,Mn)){l(this,Mn).parentNode||l(this,Oi).container.after(l(this,Mn));return}if(l(this,cf)||R(this,$e,H6).call(this),!l(this,cf))return;let{signal:t}=x(this,of,new AbortController),e=l(this,Oi).hasOwnCommentButton,r=()=>{l(this,to).toggleCommentPopup(this,!0,void 0,!e)},i=()=>{l(this,to).toggleCommentPopup(this,!1,!0,!e)},s=()=>{l(this,to).toggleCommentPopup(this,!1,!1)};if(e){x(this,Mn,l(this,Oi).container);for(let a of this.trigger)a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.addEventListener("keydown",l(this,yp),{signal:t}),a.addEventListener("click",r,{signal:t}),a.addEventListener("pointerenter",i,{signal:t}),a.addEventListener("pointerleave",s,{signal:t}),a.classList.add("popupTriggerArea")}else{let a=x(this,Mn,document.createElement("button"));a.className="annotationCommentButton";let o=l(this,Oi).container;a.style.zIndex=o.style.zIndex+1,a.tabIndex=0,a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.setAttribute("data-l10n-id","pdfjs-show-comment-button"),R(this,$e,W6).call(this),R(this,$e,z6).call(this),a.addEventListener("keydown",l(this,yp),{signal:t}),a.addEventListener("click",r,{signal:t}),a.addEventListener("pointerenter",i,{signal:t}),a.addEventListener("pointerleave",s,{signal:t}),o.after(a)}}get commentButtonColor(){let{color:t,opacity:e}=l(this,Oi).commentData;return t?l(this,OA)._commentManager.makeCommentColor(t,e):null}focusCommentButton(){setTimeout(()=>{l(this,Mn)?.focus()},0)}getData(){let{richText:t,color:e,opacity:r,creationDate:i,modificationDate:s}=l(this,Oi).commentData;return{contentsObj:{str:this.comment},richText:t,color:e,opacity:r,creationDate:i,modificationDate:s}}get elementBeforePopup(){return l(this,Mn)}get comment(){return l(this,Ap)||x(this,Ap,l(this,Oi).commentText),l(this,Ap)}set comment(t){t!==this.comment&&(l(this,Oi).commentText=x(this,Ap,t))}focus(){l(this,Oi).container?.focus()}get parentBoundingClientRect(){return l(this,Oi).layer.getBoundingClientRect()}setCommentButtonStates({selected:t,hasPopup:e}){l(this,Mn)&&(l(this,Mn).classList.toggle("selected",t),l(this,Mn).ariaExpanded=e)}setSelectedCommentButton(t){l(this,Mn).classList.toggle("selected",t)}get commentPopupPosition(){if(l(this,vp))return l(this,vp);let{x:t,y:e,height:r}=l(this,Mn).getBoundingClientRect(),{x:i,y:s,width:a,height:o}=l(this,Oi).layer.getBoundingClientRect();return[(t-i)/a,(e+r-s)/o]}set commentPopupPosition(t){x(this,vp,t)}hasDefaultPopupPosition(){return l(this,vp)===null}get commentButtonPosition(){return l(this,cf)}get commentButtonWidth(){return l(this,Mn).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(t){let[e,r]=l(this,vp)||this.commentButtonPosition.map(u=>u/100),i=this.parentBoundingClientRect,{x:s,y:a,width:o,height:c}=i;l(this,to).showDialog(null,this,s+e*o,a+r*c,{...t,parentDimensions:i})}render(){if(l(this,eo))return;let t=x(this,eo,document.createElement("div"));if(t.className="popup",l(this,DA)){let r=t.style.outlineColor=se.makeHexColor(...l(this,DA));t.style.backgroundColor=`color-mix(in srgb, ${r} 30%, white)`}let e=document.createElement("span");if(e.className="header",l(this,NA)?.str){let r=document.createElement("span");r.className="title",e.append(r),{dir:r.dir,str:r.textContent}=l(this,NA)}if(t.append(e),l(this,bp)){let r=document.createElement("time");r.className="popupDate",r.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),r.setAttribute("data-l10n-args",JSON.stringify({dateObj:l(this,bp).valueOf()})),r.dateTime=l(this,bp).toISOString(),e.append(r)}N5({html:l(this,$e,sO)||l(this,iu).str,dir:l(this,iu)?.dir,className:"popupContent"},t),l(this,kn).append(t)}updateEdited({rect:t,popup:e,deleted:r}){if(l(this,to)){r?(this.remove(),x(this,Ap,null)):e&&(e.deleted?this.remove():(R(this,$e,W6).call(this),x(this,Ap,e.text))),t&&(x(this,cf,null),R(this,$e,H6).call(this),R(this,$e,z6).call(this));return}if(r||e?.deleted){this.remove();return}R(this,$e,iO).call(this),l(this,Xy)||x(this,Xy,{contentsObj:l(this,iu),richText:l(this,uf)}),t&&x(this,lf,null),e&&e.text&&(x(this,uf,R(this,$e,pK).call(this,e.text)),x(this,bp,y0.toDateObject(e.date)),x(this,iu,null)),l(this,eo)?.remove(),x(this,eo,null)}resetEdited(){l(this,Xy)&&({contentsObj:ze(this,iu)._,richText:ze(this,uf)._}=l(this,Xy),x(this,Xy,null),l(this,eo)?.remove(),x(this,eo,null),x(this,lf,null))}remove(){if(l(this,of)?.abort(),x(this,of,null),l(this,eo)?.remove(),x(this,eo,null),x(this,wp,!1),x(this,su,!1),l(this,Mn)?.remove(),x(this,Mn,null),this.trigger)for(let t of this.trigger)t.classList.remove("popupTriggerArea")}forceHide(){x(this,wp,this.isVisible),l(this,wp)&&(l(this,kn).hidden=!0)}maybeShow(){l(this,to)||(R(this,$e,iO).call(this),l(this,wp)&&(l(this,eo)||R(this,$e,oO).call(this),x(this,wp,!1),l(this,kn).hidden=!1))}get isVisible(){return l(this,to)?!1:l(this,kn).hidden===!1}};to=new WeakMap,yp=new WeakMap,bP=new WeakMap,vP=new WeakMap,IA=new WeakMap,DA=new WeakMap,kn=new WeakMap,iu=new WeakMap,bp=new WeakMap,Vy=new WeakMap,OA=new WeakMap,PA=new WeakMap,su=new WeakMap,eo=new WeakMap,of=new WeakMap,lf=new WeakMap,Mn=new WeakMap,cf=new WeakMap,vp=new WeakMap,iT=new WeakMap,uf=new WeakMap,NA=new WeakMap,Xy=new WeakMap,wp=new WeakMap,Oi=new WeakMap,Ap=new WeakMap,$e=new WeakSet,iO=function(){if(l(this,of))return;x(this,of,new AbortController);let{signal:t}=l(this,of);for(let e of this.trigger)e.addEventListener("click",l(this,IA),{signal:t}),e.addEventListener("pointerenter",l(this,vP),{signal:t}),e.addEventListener("pointerleave",l(this,bP),{signal:t}),e.classList.add("popupTriggerArea");for(let e of l(this,Vy))e.container?.addEventListener("keydown",l(this,yp),{signal:t})},H6=function(){let t=l(this,Vy).find(e=>e.hasCommentButton);t&&x(this,cf,t._normalizePoint(t.commentButtonPosition))},z6=function(){if(l(this,Oi).extraPopupElement&&!l(this,Oi).editor)return;l(this,Mn)||this.renderCommentButton();let[t,e]=l(this,cf),{style:r}=l(this,Mn);r.left=`calc(${t}%)`,r.top=`calc(${e}% - var(--comment-button-dim))`},W6=function(){l(this,Oi).extraPopupElement||(l(this,Mn)||this.renderCommentButton(),l(this,Mn).style.backgroundColor=this.commentButtonColor||"")},sO=function(){let t=l(this,uf),e=l(this,iu);return t?.str&&(!e?.str||e.str===t.str)&&l(this,uf).html||null},G6=function(){return l(this,$e,sO)?.attributes?.style?.fontSize||0},dK=function(){return l(this,$e,sO)?.attributes?.style?.color||null},pK=function(t){let e=[],r={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},i={style:{color:l(this,$e,dK),fontSize:l(this,$e,G6)?`calc(${l(this,$e,G6)}px * var(--total-scale-factor))`:""}};for(let s of t.split(`
109
+ `))e.push({name:"span",value:s,attributes:i});return r},gK=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&l(this,su))&&R(this,$e,aO).call(this)},mK=function(){if(l(this,lf)!==null)return;let{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:r,pageX:i,pageY:s}}}=l(this,OA),a=!!l(this,PA),o=a?l(this,PA):l(this,iT);for(let g of l(this,Vy))if(!o||se.intersect(g.data.rect,o)!==null){o=g.data.rect,a=!0;break}let c=se.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]),h=a?o[2]-o[0]+5:0,f=c[0]+h,d=c[1];x(this,lf,[100*(f-i)/e,100*(d-s)/r]);let{style:p}=l(this,kn);p.left=`${l(this,lf)[0]}%`,p.top=`${l(this,lf)[1]}%`},aO=function(){if(l(this,to)){l(this,to).toggleCommentPopup(this,!1);return}x(this,su,!l(this,su)),l(this,su)?(R(this,$e,oO).call(this),l(this,kn).addEventListener("click",l(this,IA)),l(this,kn).addEventListener("keydown",l(this,yp))):(R(this,$e,V6).call(this),l(this,kn).removeEventListener("click",l(this,IA)),l(this,kn).removeEventListener("keydown",l(this,yp)))},oO=function(){l(this,eo)||this.render(),this.isVisible?l(this,su)&&l(this,kn).classList.add("focused"):(R(this,$e,mK).call(this),l(this,kn).hidden=!1,l(this,kn).style.zIndex=parseInt(l(this,kn).style.zIndex)+1e3)},V6=function(){l(this,kn).classList.remove("focused"),!(l(this,su)||!this.isVisible)&&(l(this,kn).hidden=!0,l(this,kn).style.zIndex=parseInt(l(this,kn).style.zIndex)-1e3)};XO=class extends An{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Ie.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){let t=this.contentElement=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(let e of this.textContent){let r=document.createElement("span");r.textContent=e,t.append(r)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},X6=class extends An{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});T(this,sT,null)}render(){this.container.classList.add("lineAnnotation");let{data:e,width:r,height:i}=this,s=this.svgFactory.create(r,i,!0),a=x(this,sT,this.svgFactory.createElement("svg:line"));return a.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),a.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),a.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),a.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),a.setAttribute("stroke-width",e.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),s.append(a),this.container.append(s),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,sT)}addHighlightArea(){this.container.classList.add("highlightArea")}};sT=new WeakMap;q6=class extends An{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});T(this,aT,null)}render(){this.container.classList.add("squareAnnotation");let{data:e,width:r,height:i}=this,s=this.svgFactory.create(r,i,!0),a=e.borderStyle.width,o=x(this,aT,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",r-a),o.setAttribute("height",i-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,aT)}addHighlightArea(){this.container.classList.add("highlightArea")}};aT=new WeakMap;Y6=class extends An{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});T(this,oT,null)}render(){this.container.classList.add("circleAnnotation");let{data:e,width:r,height:i}=this,s=this.svgFactory.create(r,i,!0),a=e.borderStyle.width,o=x(this,oT,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",r/2),o.setAttribute("cy",i/2),o.setAttribute("rx",r/2-a/2),o.setAttribute("ry",i/2-a/2),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,oT)}addHighlightArea(){this.container.classList.add("highlightArea")}};oT=new WeakMap;qO=class extends An{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});T(this,lT,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,vertices:r,borderStyle:i,popupRef:s},width:a,height:o}=this;if(!r)return this.container;let c=this.svgFactory.create(a,o,!0),u=[];for(let f=0,d=r.length;f<d;f+=2){let p=r[f]-e[0],g=e[3]-r[f+1];u.push(`${p},${g}`)}u=u.join(" ");let h=x(this,lT,this.svgFactory.createElement(this.svgElementName));return h.setAttribute("points",u),h.setAttribute("stroke-width",i.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),c.append(h),this.container.append(c),!s&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,lT)}addHighlightArea(){this.container.classList.add("highlightArea")}};lT=new WeakMap;K6=class extends qO{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}},Z6=class extends An{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}},US=class extends An{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});T(this,uT);T(this,cT,null);T(this,qy,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?Ie.HIGHLIGHT:Ie.INK}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,rotation:r,inkLists:i,borderStyle:s,popupRef:a}}=this,{transform:o,width:c,height:u}=R(this,uT,J6).call(this,r,e),h=this.svgFactory.create(c,u,!0),f=x(this,cT,this.svgFactory.createElement("svg:g"));h.append(f),f.setAttribute("stroke-width",s.width||1),f.setAttribute("stroke-linecap","round"),f.setAttribute("stroke-linejoin","round"),f.setAttribute("stroke-miterlimit",10),f.setAttribute("stroke","transparent"),f.setAttribute("fill","transparent"),f.setAttribute("transform",o);for(let d=0,p=i.length;d<p;d++){let g=this.svgFactory.createElement(this.svgElementName);l(this,qy).push(g),g.setAttribute("points",i[d].join(",")),f.append(g)}return!a&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(h),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);let{thickness:r,points:i,rect:s}=e,a=l(this,cT);if(r>=0&&a.setAttribute("stroke-width",r||1),i)for(let o=0,c=l(this,qy).length;o<c;o++)l(this,qy)[o].setAttribute("points",i[o].join(","));if(s){let{transform:o,width:c,height:u}=R(this,uT,J6).call(this,this.data.rotation,s);a.parentElement.setAttribute("viewBox",`0 0 ${c} ${u}`),a.setAttribute("transform",o)}}getElementsToTriggerPopup(){return l(this,qy)}addHighlightArea(){this.container.classList.add("highlightArea")}};cT=new WeakMap,qy=new WeakMap,uT=new WeakSet,J6=function(e,r){switch(e){case 90:return{transform:`rotate(90) translate(${-r[0]},${r[1]}) scale(1,-1)`,width:r[3]-r[1],height:r[2]-r[0]};case 180:return{transform:`rotate(180) translate(${-r[2]},${r[1]}) scale(1,-1)`,width:r[2]-r[0],height:r[3]-r[1]};case 270:return{transform:`rotate(270) translate(${-r[2]},${r[3]}) scale(1,-1)`,width:r[3]-r[1],height:r[2]-r[0]};default:return{transform:`translate(${-r[0]},${r[3]}) scale(1,-1)`,width:r[2]-r[0],height:r[3]-r[1]}}};YO=class extends An{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Ie.HIGHLIGHT}render(){let{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){let r=document.createElement("mark");r.classList.add("overlaidText"),r.textContent=t,this.container.append(r)}return this.container}},Q6=class extends An{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("underlineAnnotation"),t){let r=document.createElement("u");r.classList.add("overlaidText"),r.textContent=t,this.container.append(r)}return this.container}},t5=class extends An{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("squigglyAnnotation"),t){let r=document.createElement("u");r.classList.add("overlaidText"),r.textContent=t,this.container.append(r)}return this.container}},e5=class extends An{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("strikeoutAnnotation"),t){let r=document.createElement("s");r.classList.add("overlaidText"),r.textContent=t,this.container.append(r)}return this.container}},KO=class extends An{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Ie.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}},r5=class extends An{constructor(e){super(e,{isRenderable:!0});T(this,fT);T(this,hT,null);let{file:r}=this.data;this.filename=r.filename,this.content=r.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...r})}render(){this.container.classList.add("fileAttachmentAnnotation");let{container:e,data:r}=this,i;r.hasAppearance||r.fillAlpha===0?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(r.name)?"paperclip":"pushpin"}.svg`,r.fillAlpha&&r.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(r.fillAlpha*100)}%);`)),i.addEventListener("dblclick",R(this,fT,n5).bind(this)),x(this,hT,i);let{isMac:s}=Bn.platform;return e.addEventListener("keydown",a=>{a.key==="Enter"&&(s?a.metaKey:a.ctrlKey)&&R(this,fT,n5).call(this)}),!r.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):i.classList.add("popupTriggerArea"),e.append(i),e}getElementsToTriggerPopup(){return l(this,hT)}addHighlightArea(){this.container.classList.add("highlightArea")}};hT=new WeakMap,fT=new WeakSet,n5=function(){this.downloadManager?.openOrDownloadData(this.content,this.filename)};$5=class $5{constructor({div:t,accessibilityManager:e,annotationCanvasMap:r,annotationEditorUIManager:i,page:s,viewport:a,structTreeLayer:o,commentManager:c,linkService:u,annotationStorage:h}){T(this,wf);T(this,Yy,null);T(this,Ky,null);T(this,LA,null);T(this,Ep,new Map);T(this,dT,null);T(this,Zy,null);T(this,ro,[]);T(this,pT,!1);this.div=t,x(this,Yy,e),x(this,Ky,r),x(this,dT,o||null),x(this,Zy,u||null),x(this,LA,h||new NS),this.page=s,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=i,this._commentManager=c||null}hasEditableAnnotations(){return l(this,Ep).size>0}async render(t){let{annotations:e}=t,r=this.div;Lp(r,this.viewport);let i=new Map,s=[],a={data:null,layer:r,linkService:l(this,Zy),downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new w0,annotationStorage:l(this,LA),enableComment:t.enableComment===!0,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(let o of e){if(o.noHTML)continue;let c=o.annotationType===Vn.POPUP;if(c){let f=i.get(o.id);if(!f)continue;if(!this._commentManager){s.push(o);continue}a.elements=f}else if(o.rect[2]===o.rect[0]||o.rect[3]===o.rect[1])continue;a.data=o;let u=CS.create(a);if(!u.isRenderable)continue;if(!c&&(l(this,ro).push(u),o.popupRef)){let f=i.get(o.popupRef);f?f.push(u):i.set(o.popupRef,[u])}let h=u.render();o.hidden&&(h.style.visibility="hidden"),u._isEditable&&(l(this,Ep).set(u.data.id,u),this._annotationEditorUIManager?.renderAnnotationElement(u))}await R(this,wf,lO).call(this);for(let o of s){let c=a.elements=i.get(o.id);a.data=o;let u=CS.create(a);if(!u.isRenderable)continue;let h=u.render();u.contentElement.id=`${Ew}${o.id}`,o.hidden&&(h.style.visibility="hidden"),c.at(-1).container.after(h)}R(this,wf,i5).call(this)}async addLinkAnnotations(t){let e={data:null,layer:this.div,linkService:l(this,Zy),svgFactory:new w0,parent:this};for(let r of t){r.borderStyle||(r.borderStyle=$5._defaultBorderStyle),e.data=r;let i=CS.create(e);i.isRenderable&&(i.render(),i.contentElement.id=`${Ew}${r.id}`,l(this,ro).push(i))}await R(this,wf,lO).call(this)}update({viewport:t}){let e=this.div;this.viewport=t,Lp(e,{rotation:t.rotation}),R(this,wf,i5).call(this),e.hidden=!1}getEditableAnnotations(){return Array.from(l(this,Ep).values())}getEditableAnnotation(t){return l(this,Ep).get(t)}addFakeAnnotation(t){let{div:e}=this,{id:r,rotation:i}=t,s=new N6({data:{id:r,rect:t.getPDFRect(),rotation:i},editor:t,layer:e,parent:this,enableComment:!!this._commentManager,linkService:l(this,Zy),annotationStorage:l(this,LA)});return s.render(),s.contentElement.id=`${Ew}${r}`,s.createOrUpdatePopup(),l(this,ro).push(s),s}removeAnnotation(t){let e=l(this,ro).findIndex(i=>i.data.id===t);if(e<0)return;let[r]=l(this,ro).splice(e,1);l(this,Yy)?.removePointerInTextLayer(r.contentElement)}updateFakeAnnotations(t){if(t.length!==0){for(let e of t)e.updateFakeAnnotationElement(this);R(this,wf,lO).call(this)}}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}static get _defaultBorderStyle(){return Ce(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:pw.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}};Yy=new WeakMap,Ky=new WeakMap,LA=new WeakMap,Ep=new WeakMap,dT=new WeakMap,Zy=new WeakMap,ro=new WeakMap,pT=new WeakMap,wf=new WeakSet,lO=async function(){if(l(this,ro).length===0)return;this.div.replaceChildren();let t=[];if(!l(this,pT)){x(this,pT,!0);for(let{contentElement:r,data:{id:i}}of l(this,ro)){let s=r.id=`${Ew}${i}`;t.push(l(this,dT)?.getAriaAttributes(s).then(a=>{if(a)for(let[o,c]of a)r.setAttribute(o,c)}))}}l(this,ro).sort(({data:{rect:[r,i,s,a]}},{data:{rect:[o,c,u,h]}})=>{if(r===s&&i===a)return 1;if(o===u&&c===h)return-1;let f=a,d=i,p=(i+a)/2,g=h,y=c,b=(c+h)/2;if(p>=g&&b<=d)return-1;if(b>=f&&p<=y)return 1;let m=(r+s)/2,w=(o+u)/2;return m-w});let e=document.createDocumentFragment();for(let r of l(this,ro))e.append(r.container),this._commentManager?(r.extraPopupElement?.popup||r.popup)?.renderCommentButton():r.extraPopupElement&&e.append(r.extraPopupElement.render());if(this.div.append(e),await Promise.all(t),l(this,Yy))for(let r of l(this,ro))l(this,Yy).addPointerInTextLayer(r.contentElement,!1)},i5=function(){if(!l(this,Ky))return;let t=this.div;for(let[e,r]of l(this,Ky)){let i=t.querySelector(`[data-annotation-id="${e}"]`);if(!i)continue;r.className="annotationContent";let{firstChild:s}=i;s?s.nodeName==="CANVAS"?s.replaceWith(r):s.classList.contains("annotationContent")?s.after(r):s.before(r):i.append(r);let a=l(this,Ep).get(e);a&&(a._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(e,i.id,r),a._hasNoCanvas=!1):a.canvas=r)}l(this,Ky).clear()};ZO=$5,$D=/\r\n?|\n/g,sn=class sn extends tn{constructor(e){super({...e,name:"freeTextEditor"});T(this,ei);T(this,no,"");T(this,gT,`${this.id}-editor`);T(this,Jy,null);T(this,io);Lt(this,"_colorPicker",null);this.color=e.color||sn._defaultColor||tn._defaultLineColor,x(this,io,e.fontSize||sn._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert"),this.canAddComment=!1}static get _keyboardManager(){let e=sn.prototype,r=a=>a.isEmpty(),i=kp.TRANSLATE_SMALL,s=kp.TRANSLATE_BIG;return Ce(this,"_keyboardManager",new v0([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-s,0],checker:r}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[i,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[s,0],checker:r}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-s],checker:r}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,i],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,s],checker:r}]]))}static initialize(e,r){tn.initialize(e,r);let i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,r){switch(e){case tr.FREETEXT_SIZE:sn._defaultFontSize=r;break;case tr.FREETEXT_COLOR:sn._defaultColor=r;break}}updateParams(e,r){switch(e){case tr.FREETEXT_SIZE:R(this,ei,yK).call(this,r);break;case tr.FREETEXT_COLOR:R(this,ei,bK).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[tr.FREETEXT_SIZE,sn._defaultFontSize],[tr.FREETEXT_COLOR,sn._defaultColor||tn._defaultLineColor]]}get propertiesToUpdate(){return[[tr.FREETEXT_SIZE,l(this,io)],[tr.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new WO(this)),[["colorPicker",this._colorPicker]]}get colorType(){return tr.FREETEXT_COLOR}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}_translateEmpty(e,r){this._uiManager.translateSelectedEditors(e,r,!0)}getInitialTranslation(){let e=this.parentScale;return[-sn._internalPadding*e,-(sn._internalPadding+l(this,io))*e]}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"),x(this,Jy,new AbortController);let e=this._uiManager.combinedSignal(l(this,Jy));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",l(this,gT)),this._isDraggable=!0,l(this,Jy)?.abort(),x(this,Jy,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&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 e=l(this,no),r=x(this,no,R(this,ei,vK).call(this).trimEnd());if(e===r)return;let i=s=>{if(x(this,no,s),!s){this.remove();return}R(this,ei,hO).call(this),this._uiManager.rebuild(this),R(this,ei,cO).call(this)};this.addCommands({cmd:()=>{i(r)},undo:()=>{i(e)},mustExec:!1}),R(this,ei,cO).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){sn._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){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 e,r;(this._isCopy||this.annotationElementId)&&(e=this.x,r=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",l(this,gT)),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,io)}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[s,a]=this.parentDimensions;if(this.annotationElementId){let{position:o}=this._initialData,[c,u]=this.getInitialTranslation();[c,u]=this.pageTranslationToScreen(c,u);let[h,f]=this.pageDimensions,[d,p]=this.pageTranslation,g,y;switch(this.rotation){case 0:g=e+(o[0]-d)/h,y=r+this.height-(o[1]-p)/f;break;case 90:g=e+(o[0]-d)/h,y=r-(o[1]-p)/f,[c,u]=[u,-c];break;case 180:g=e-this.width+(o[0]-d)/h,y=r-(o[1]-p)/f,[c,u]=[-c,-u];break;case 270:g=e+(o[0]-d-this.height*f)/h,y=r+(o[1]-p-this.width*h)/f,[c,u]=[-u,c];break}this.setAt(g*s,y*a,c,u)}else this._moveAfterPaste(e,r);R(this,ei,hO).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(e){var g,y,b;let r=e.clipboardData||window.clipboardData,{types:i}=r;if(i.length===1&&i[0]==="text/plain")return;e.preventDefault();let s=R(g=sn,Af,a5).call(g,r.getData("text")||"").replaceAll($D,`
110
+ `);if(!s)return;let a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();let o=a.getRangeAt(0);if(!s.includes(`
111
+ `)){o.insertNode(document.createTextNode(s)),this.editorDiv.normalize(),a.collapseToStart();return}let{startContainer:c,startOffset:u}=o,h=[],f=[];if(c.nodeType===Node.TEXT_NODE){let m=c.parentElement;if(f.push(c.nodeValue.slice(u).replaceAll($D,"")),m!==this.editorDiv){let w=h;for(let A of this.editorDiv.childNodes){if(A===m){w=f;continue}w.push(R(y=sn,Af,uO).call(y,A))}}h.push(c.nodeValue.slice(0,u).replaceAll($D,""))}else if(c===this.editorDiv){let m=h,w=0;for(let A of this.editorDiv.childNodes)w++===u&&(m=f),m.push(R(b=sn,Af,uO).call(b,A))}x(this,no,`${h.join(`
112
+ `)}${s}${f.join(`
113
+ `)}`),R(this,ei,hO).call(this);let d=new Range,p=Math.sumPrecise(h.map(m=>m.length));for(let{firstChild:m}of this.editorDiv.childNodes)if(m.nodeType===Node.TEXT_NODE){let w=m.nodeValue.length;if(p<=w){d.setStart(m,p),d.setEnd(m,p);break}p-=w}a.removeAllRanges(),a.addRange(d)}get contentDiv(){return this.editorDiv}getPDFRect(){let e=sn._internalPadding*this.parentScale;return this.getRect(e,e)}static async deserialize(e,r,i){var o;let s=null;if(e instanceof XO){let{data:{defaultAppearanceData:{fontSize:c,fontColor:u},rect:h,rotation:f,id:d,popupRef:p,richText:g,contentsObj:y,creationDate:b,modificationDate:m},textContent:w,textPosition:A,parent:{page:{pageNumber:_}}}=e;if(!w||w.length===0)return null;s=e={annotationType:Ie.FREETEXT,color:Array.from(u),fontSize:c,value:w.join(`
114
+ `),position:A,pageIndex:_-1,rect:h.slice(0),rotation:f,annotationElementId:d,id:d,deleted:!1,popupRef:p,comment:y?.str||null,richText:g,creationDate:b,modificationDate:m}}let a=await super.deserialize(e,r,i);return x(a,io,e.fontSize),a.color=se.makeHexColor(...e.color),x(a,no,R(o=sn,Af,a5).call(o,e.value)),a._initialData=s,e.comment&&a.setCommentData(e),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let r=tn._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(e),{color:r,fontSize:l(this,io),value:R(this,ei,wK).call(this)});return this.addComment(i),e?(i.isCopy=!0,i):this.annotationElementId&&!R(this,ei,AK).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(e){let r=super.renderAnnotationElement(e);if(!r)return null;let{style:i}=r;i.fontSize=`calc(${l(this,io)}px * var(--total-scale-factor))`,i.color=this.color,r.replaceChildren();for(let s of l(this,no).split(`
115
+ `)){let a=document.createElement("div");a.append(s?document.createTextNode(s):document.createElement("br")),r.append(a)}return e.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:l(this,no)}}),r}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}};no=new WeakMap,gT=new WeakMap,Jy=new WeakMap,io=new WeakMap,ei=new WeakSet,yK=function(e){let r=s=>{this.editorDiv.style.fontSize=`calc(${s}px * var(--total-scale-factor))`,this.translate(0,-(s-l(this,io))*this.parentScale),x(this,io,s),R(this,ei,cO).call(this)},i=l(this,io);this.addCommands({cmd:r.bind(this,e),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:tr.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},bK=function(e){let r=s=>{this.color=s,this.onUpdatedColor()},i=this.color;this.addCommands({cmd:r.bind(this,e),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:tr.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},vK=function(){var i;let e=[];this.editorDiv.normalize();let r=null;for(let s of this.editorDiv.childNodes)r?.nodeType===Node.TEXT_NODE&&s.nodeName==="BR"||(e.push(R(i=sn,Af,uO).call(i,s)),r=s);return e.join(`
116
+ `)},cO=function(){let[e,r]=this.parentDimensions,i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{let{currentLayer:s,div:a}=this,o=a.style.display,c=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",s.div.append(this.div),i=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",c)}this.rotation%180===this.parentRotation%180?(this.width=i.width/e,this.height=i.height/r):(this.width=i.height/e,this.height=i.width/r),this.fixAndSetPosition()},Af=new WeakSet,uO=function(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll($D,"")},hO=function(){if(this.editorDiv.replaceChildren(),!!l(this,no))for(let e of l(this,no).split(`
117
+ `)){let r=document.createElement("div");r.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(r)}},wK=function(){return l(this,no).replaceAll("\xA0"," ")},a5=function(e){return e.replaceAll(" ","\xA0")},AK=function(e){let{value:r,fontSize:i,color:s,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==r||e.fontSize!==i||e.color.some((o,c)=>o!==s[c])||e.pageIndex!==a},T(sn,Af),Lt(sn,"_freeTextDefaultContent",""),Lt(sn,"_internalPadding",0),Lt(sn,"_defaultColor",null),Lt(sn,"_defaultFontSize",10),Lt(sn,"_type","freetext"),Lt(sn,"_editorType",Ie.FREETEXT);s5=sn,ue=class{toSVGPath(){qr("Abstract method `toSVGPath` must be implemented.")}get box(){qr("Abstract getter `box` must be implemented.")}serialize(t,e){qr("Abstract method `serialize` must be implemented.")}static _rescale(t,e,r,i,s,a){a||(a=new Float32Array(t.length));for(let o=0,c=t.length;o<c;o+=2)a[o]=e+t[o]*i,a[o+1]=r+t[o+1]*s;return a}static _rescaleAndSwap(t,e,r,i,s,a){a||(a=new Float32Array(t.length));for(let o=0,c=t.length;o<c;o+=2)a[o]=e+t[o+1]*i,a[o+1]=r+t[o]*s;return a}static _translate(t,e,r,i){i||(i=new Float32Array(t.length));for(let s=0,a=t.length;s<a;s+=2)i[s]=e+t[s],i[s+1]=r+t[s+1];return i}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,e,r,i,s){switch(s){case 90:return[1-e/r,t/i];case 180:return[1-t/r,1-e/i];case 270:return[e/r,1-t/i];default:return[t/r,e/i]}}static _normalizePagePoint(t,e,r){switch(r){case 90:return[1-e,t];case 180:return[1-t,1-e];case 270:return[e,1-t];default:return[t,e]}}static createBezierPoints(t,e,r,i,s,a){return[(t+5*r)/6,(e+5*i)/6,(5*r+s)/6,(5*i+a)/6,(r+s)/2,(i+a)/2]}};Lt(ue,"PRECISION",1e-4);Mh=class Mh{constructor({x:t,y:e},r,i,s,a,o=0){T(this,bi);T(this,so);T(this,Wl,[]);T(this,kA);T(this,MA);T(this,au,[]);T(this,qe,new Float32Array(18));T(this,Qy);T(this,t0);T(this,mT);T(this,yT);T(this,FA);T(this,BA);T(this,xp,[]);x(this,so,r),x(this,BA,s*i),x(this,MA,a),l(this,qe).set([NaN,NaN,NaN,NaN,t,e],6),x(this,kA,o),x(this,yT,l(Mh,bT)*i),x(this,mT,l(Mh,AP)*i),x(this,FA,i),l(this,xp).push(t,e)}isEmpty(){return isNaN(l(this,qe)[8])}add({x:t,y:e}){x(this,Qy,t),x(this,t0,e);let[r,i,s,a]=l(this,so),[o,c,u,h]=l(this,qe).subarray(8,12),f=t-u,d=e-h,p=Math.hypot(f,d);if(p<l(this,mT))return!1;let g=p-l(this,yT),y=g/p,b=y*f,m=y*d,w=o,A=c;o=u,c=h,u+=b,h+=m,l(this,xp)?.push(t,e);let _=-m/g,S=b/g,I=_*l(this,BA),C=S*l(this,BA);return l(this,qe).set(l(this,qe).subarray(2,8),0),l(this,qe).set([u+I,h+C],4),l(this,qe).set(l(this,qe).subarray(14,18),12),l(this,qe).set([u-I,h-C],16),isNaN(l(this,qe)[6])?(l(this,au).length===0&&(l(this,qe).set([o+I,c+C],2),l(this,au).push(NaN,NaN,NaN,NaN,(o+I-r)/s,(c+C-i)/a),l(this,qe).set([o-I,c-C],14),l(this,Wl).push(NaN,NaN,NaN,NaN,(o-I-r)/s,(c-C-i)/a)),l(this,qe).set([w,A,o,c,u,h],6),!this.isEmpty()):(l(this,qe).set([w,A,o,c,u,h],6),Math.abs(Math.atan2(A-c,w-o)-Math.atan2(m,b))<Math.PI/2?([o,c,u,h]=l(this,qe).subarray(2,6),l(this,au).push(NaN,NaN,NaN,NaN,((o+u)/2-r)/s,((c+h)/2-i)/a),[o,c,w,A]=l(this,qe).subarray(14,18),l(this,Wl).push(NaN,NaN,NaN,NaN,((w+o)/2-r)/s,((A+c)/2-i)/a),!0):([w,A,o,c,u,h]=l(this,qe).subarray(0,6),l(this,au).push(((w+5*o)/6-r)/s,((A+5*c)/6-i)/a,((5*o+u)/6-r)/s,((5*c+h)/6-i)/a,((o+u)/2-r)/s,((c+h)/2-i)/a),[u,h,o,c,w,A]=l(this,qe).subarray(12,18),l(this,Wl).push(((w+5*o)/6-r)/s,((A+5*c)/6-i)/a,((5*o+u)/6-r)/s,((5*c+h)/6-i)/a,((o+u)/2-r)/s,((c+h)/2-i)/a),!0))}toSVGPath(){if(this.isEmpty())return"";let t=l(this,au),e=l(this,Wl);if(isNaN(l(this,qe)[6])&&!this.isEmpty())return R(this,bi,EK).call(this);let r=[];r.push(`M${t[4]} ${t[5]}`);for(let i=6;i<t.length;i+=6)isNaN(t[i])?r.push(`L${t[i+4]} ${t[i+5]}`):r.push(`C${t[i]} ${t[i+1]} ${t[i+2]} ${t[i+3]} ${t[i+4]} ${t[i+5]}`);R(this,bi,SK).call(this,r);for(let i=e.length-6;i>=6;i-=6)isNaN(e[i])?r.push(`L${e[i+4]} ${e[i+5]}`):r.push(`C${e[i]} ${e[i+1]} ${e[i+2]} ${e[i+3]} ${e[i+4]} ${e[i+5]}`);return R(this,bi,xK).call(this,r),r.join(" ")}newFreeDrawOutline(t,e,r,i,s,a){return new QO(t,e,r,i,s,a)}getOutlines(){let t=l(this,au),e=l(this,Wl),r=l(this,qe),[i,s,a,o]=l(this,so),c=new Float32Array((l(this,xp)?.length??0)+2);for(let f=0,d=c.length-2;f<d;f+=2)c[f]=(l(this,xp)[f]-i)/a,c[f+1]=(l(this,xp)[f+1]-s)/o;if(c[c.length-2]=(l(this,Qy)-i)/a,c[c.length-1]=(l(this,t0)-s)/o,isNaN(r[6])&&!this.isEmpty())return R(this,bi,_K).call(this,c);let u=new Float32Array(l(this,au).length+24+l(this,Wl).length),h=t.length;for(let f=0;f<h;f+=2){if(isNaN(t[f])){u[f]=u[f+1]=NaN;continue}u[f]=t[f],u[f+1]=t[f+1]}h=R(this,bi,CK).call(this,u,h);for(let f=e.length-6;f>=6;f-=6)for(let d=0;d<6;d+=2){if(isNaN(e[f+d])){u[h]=u[h+1]=NaN,h+=2;continue}u[h]=e[f+d],u[h+1]=e[f+d+1],h+=2}return R(this,bi,TK).call(this,u,h),this.newFreeDrawOutline(u,c,l(this,so),l(this,FA),l(this,kA),l(this,MA))}};so=new WeakMap,Wl=new WeakMap,kA=new WeakMap,MA=new WeakMap,au=new WeakMap,qe=new WeakMap,Qy=new WeakMap,t0=new WeakMap,mT=new WeakMap,yT=new WeakMap,FA=new WeakMap,BA=new WeakMap,xp=new WeakMap,bT=new WeakMap,wP=new WeakMap,AP=new WeakMap,bi=new WeakSet,vS=function(){let t=l(this,qe).subarray(4,6),e=l(this,qe).subarray(16,18),[r,i,s,a]=l(this,so);return[(l(this,Qy)+(t[0]-e[0])/2-r)/s,(l(this,t0)+(t[1]-e[1])/2-i)/a,(l(this,Qy)+(e[0]-t[0])/2-r)/s,(l(this,t0)+(e[1]-t[1])/2-i)/a]},EK=function(){let[t,e,r,i]=l(this,so),[s,a,o,c]=R(this,bi,vS).call(this);return`M${(l(this,qe)[2]-t)/r} ${(l(this,qe)[3]-e)/i} L${(l(this,qe)[4]-t)/r} ${(l(this,qe)[5]-e)/i} L${s} ${a} L${o} ${c} L${(l(this,qe)[16]-t)/r} ${(l(this,qe)[17]-e)/i} L${(l(this,qe)[14]-t)/r} ${(l(this,qe)[15]-e)/i} Z`},xK=function(t){let e=l(this,Wl);t.push(`L${e[4]} ${e[5]} Z`)},SK=function(t){let[e,r,i,s]=l(this,so),a=l(this,qe).subarray(4,6),o=l(this,qe).subarray(16,18),[c,u,h,f]=R(this,bi,vS).call(this);t.push(`L${(a[0]-e)/i} ${(a[1]-r)/s} L${c} ${u} L${h} ${f} L${(o[0]-e)/i} ${(o[1]-r)/s}`)},_K=function(t){let e=l(this,qe),[r,i,s,a]=l(this,so),[o,c,u,h]=R(this,bi,vS).call(this),f=new Float32Array(36);return f.set([NaN,NaN,NaN,NaN,(e[2]-r)/s,(e[3]-i)/a,NaN,NaN,NaN,NaN,(e[4]-r)/s,(e[5]-i)/a,NaN,NaN,NaN,NaN,o,c,NaN,NaN,NaN,NaN,u,h,NaN,NaN,NaN,NaN,(e[16]-r)/s,(e[17]-i)/a,NaN,NaN,NaN,NaN,(e[14]-r)/s,(e[15]-i)/a],0),this.newFreeDrawOutline(f,t,l(this,so),l(this,FA),l(this,kA),l(this,MA))},TK=function(t,e){let r=l(this,Wl);return t.set([NaN,NaN,NaN,NaN,r[4],r[5]],e),e+=6},CK=function(t,e){let r=l(this,qe).subarray(4,6),i=l(this,qe).subarray(16,18),[s,a,o,c]=l(this,so),[u,h,f,d]=R(this,bi,vS).call(this);return t.set([NaN,NaN,NaN,NaN,(r[0]-s)/o,(r[1]-a)/c,NaN,NaN,NaN,NaN,u,h,NaN,NaN,NaN,NaN,f,d,NaN,NaN,NaN,NaN,(i[0]-s)/o,(i[1]-a)/c],e),e+=24},T(Mh,bT,8),T(Mh,wP,2),T(Mh,AP,l(Mh,bT)+l(Mh,wP));JO=Mh,QO=class extends ue{constructor(e,r,i,s,a,o){super();T(this,EP);T(this,UA);T(this,e0,new Float32Array(4));T(this,hf);T(this,vT);T(this,ao);T(this,wT);T(this,qn);x(this,qn,e),x(this,ao,r),x(this,UA,i),x(this,wT,s),x(this,hf,a),x(this,vT,o),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],R(this,EP,RK).call(this,o);let[c,u,h,f]=l(this,e0);for(let d=0,p=e.length;d<p;d+=2)e[d]=(e[d]-c)/h,e[d+1]=(e[d+1]-u)/f;for(let d=0,p=r.length;d<p;d+=2)r[d]=(r[d]-c)/h,r[d+1]=(r[d+1]-u)/f}toSVGPath(){let e=[`M${l(this,qn)[4]} ${l(this,qn)[5]}`];for(let r=6,i=l(this,qn).length;r<i;r+=6){if(isNaN(l(this,qn)[r])){e.push(`L${l(this,qn)[r+4]} ${l(this,qn)[r+5]}`);continue}e.push(`C${l(this,qn)[r]} ${l(this,qn)[r+1]} ${l(this,qn)[r+2]} ${l(this,qn)[r+3]} ${l(this,qn)[r+4]} ${l(this,qn)[r+5]}`)}return e.push("Z"),e.join(" ")}serialize([e,r,i,s],a){let o=i-e,c=s-r,u,h;switch(a){case 0:u=ue._rescale(l(this,qn),e,s,o,-c),h=ue._rescale(l(this,ao),e,s,o,-c);break;case 90:u=ue._rescaleAndSwap(l(this,qn),e,r,o,c),h=ue._rescaleAndSwap(l(this,ao),e,r,o,c);break;case 180:u=ue._rescale(l(this,qn),i,r,-o,c),h=ue._rescale(l(this,ao),i,r,-o,c);break;case 270:u=ue._rescaleAndSwap(l(this,qn),i,s,-o,-c),h=ue._rescaleAndSwap(l(this,ao),i,s,-o,-c);break}return{outline:Array.from(u),points:[Array.from(h)]}}get box(){return l(this,e0)}newOutliner(e,r,i,s,a,o=0){return new JO(e,r,i,s,a,o)}getNewOutline(e,r){let[i,s,a,o]=l(this,e0),[c,u,h,f]=l(this,UA),d=a*h,p=o*f,g=i*h+c,y=s*f+u,b=this.newOutliner({x:l(this,ao)[0]*d+g,y:l(this,ao)[1]*p+y},l(this,UA),l(this,wT),e,l(this,vT),r??l(this,hf));for(let m=2;m<l(this,ao).length;m+=2)b.add({x:l(this,ao)[m]*d+g,y:l(this,ao)[m+1]*p+y});return b.getOutlines()}};UA=new WeakMap,e0=new WeakMap,hf=new WeakMap,vT=new WeakMap,ao=new WeakMap,wT=new WeakMap,qn=new WeakMap,EP=new WeakSet,RK=function(e){let r=l(this,qn),i=r[4],s=r[5],a=[i,s,i,s],o=i,c=s,u=i,h=s,f=e?Math.max:Math.min,d=new Float32Array(4);for(let g=6,y=r.length;g<y;g+=6){let b=r[g+4],m=r[g+5];isNaN(r[g])?(se.pointBoundingBox(b,m,a),c>m?(o=b,c=m):c===m&&(o=f(o,b)),h<m?(u=b,h=m):h===m&&(u=f(u,b))):(d[0]=d[1]=1/0,d[2]=d[3]=-1/0,se.bezierBoundingBox(i,s,...r.slice(g,g+6),d),se.rectBoundingBox(d[0],d[1],d[2],d[3],a),c>d[1]?(o=d[0],c=d[1]):c===d[1]&&(o=f(o,d[0])),h<d[3]?(u=d[2],h=d[3]):h===d[3]&&(u=f(u,d[2]))),i=b,s=m}let p=l(this,e0);p[0]=a[0]-l(this,hf),p[1]=a[1]-l(this,hf),p[2]=a[2]-a[0]+2*l(this,hf),p[3]=a[3]-a[1]+2*l(this,hf),this.firstPoint=[o,c],this.lastPoint=[u,h]};jS=class{constructor(t,e=0,r=0,i=!0){T(this,$s);T(this,AT);T(this,ET);T(this,xT);T(this,Sp,[]);T(this,Gl,[]);let s=[1/0,1/0,-1/0,-1/0],o=10**-4;for(let{x:b,y:m,width:w,height:A}of t){let _=Math.floor((b-e)/o)*o,S=Math.ceil((b+w+e)/o)*o,I=Math.floor((m-e)/o)*o,C=Math.ceil((m+A+e)/o)*o,M=[_,I,C,!0],z=[S,I,C,!1];l(this,Sp).push(M,z),se.rectBoundingBox(_,I,S,C,s)}let c=s[2]-s[0]+2*r,u=s[3]-s[1]+2*r,h=s[0]-r,f=s[1]-r,d=i?-1/0:1/0,p=1/0,g=l(this,Sp).at(i?-1:-2),y=[g[0],g[2]];for(let b of l(this,Sp)){let[m,w,A,_]=b;!_&&i?w<p?(p=w,d=m):w===p&&(d=Math.max(d,m)):_&&!i&&(w<p?(p=w,d=m):w===p&&(d=Math.min(d,m))),b[0]=(m-h)/c,b[1]=(w-f)/u,b[2]=(A-f)/u}x(this,AT,new Float32Array([h,f,c,u])),x(this,ET,[d,p]),x(this,xT,y)}getOutlines(){l(this,Sp).sort((e,r)=>e[0]-r[0]||e[1]-r[1]||e[2]-r[2]);let t=[];for(let e of l(this,Sp))e[3]?(t.push(...R(this,$s,o5).call(this,e)),R(this,$s,DK).call(this,e)):(R(this,$s,OK).call(this,e),t.push(...R(this,$s,o5).call(this,e)));return R(this,$s,IK).call(this,t)}};AT=new WeakMap,ET=new WeakMap,xT=new WeakMap,Sp=new WeakMap,Gl=new WeakMap,$s=new WeakSet,IK=function(t){let e=[],r=new Set;for(let a of t){let[o,c,u]=a;e.push([o,c,a],[o,u,a])}e.sort((a,o)=>a[1]-o[1]||a[0]-o[0]);for(let a=0,o=e.length;a<o;a+=2){let c=e[a][2],u=e[a+1][2];c.push(u),u.push(c),r.add(c),r.add(u)}let i=[],s;for(;r.size>0;){let a=r.values().next().value,[o,c,u,h,f]=a;r.delete(a);let d=o,p=c;for(s=[o,u],i.push(s);;){let g;if(r.has(h))g=h;else if(r.has(f))g=f;else break;r.delete(g),[o,c,u,h,f]=g,d!==o&&(s.push(d,p,o,p===c?c:u),d=o),p=p===c?u:c}s.push(d,p)}return new l5(i,l(this,AT),l(this,ET),l(this,xT))},fO=function(t){let e=l(this,Gl),r=0,i=e.length-1;for(;r<=i;){let s=r+i>>1,a=e[s][0];if(a===t)return s;a<t?r=s+1:i=s-1}return i+1},DK=function([,t,e]){let r=R(this,$s,fO).call(this,t);l(this,Gl).splice(r,0,[t,e])},OK=function([,t,e]){let r=R(this,$s,fO).call(this,t);for(let i=r;i<l(this,Gl).length;i++){let[s,a]=l(this,Gl)[i];if(s!==t)break;if(s===t&&a===e){l(this,Gl).splice(i,1);return}}for(let i=r-1;i>=0;i--){let[s,a]=l(this,Gl)[i];if(s!==t)break;if(s===t&&a===e){l(this,Gl).splice(i,1);return}}},o5=function(t){let[e,r,i]=t,s=[[e,r,i]],a=R(this,$s,fO).call(this,i);for(let o=0;o<a;o++){let[c,u]=l(this,Gl)[o];for(let h=0,f=s.length;h<f;h++){let[,d,p]=s[h];if(!(u<=d||p<=c)){if(d>=c){if(p>u)s[h][1]=u;else{if(f===1)return[];s.splice(h,1),h--,f--}continue}s[h][2]=c,p>u&&s.push([e,u,p])}}}return s};l5=class extends ue{constructor(e,r,i,s){super();T(this,ST);T(this,jA);x(this,jA,e),x(this,ST,r),this.firstPoint=i,this.lastPoint=s}toSVGPath(){let e=[];for(let r of l(this,jA)){let[i,s]=r;e.push(`M${i} ${s}`);for(let a=2;a<r.length;a+=2){let o=r[a],c=r[a+1];o===i?(e.push(`V${c}`),s=c):c===s&&(e.push(`H${o}`),i=o)}e.push("Z")}return e.join(" ")}serialize([e,r,i,s],a){let o=[],c=i-e,u=s-r;for(let h of l(this,jA)){let f=new Array(h.length);for(let d=0;d<h.length;d+=2)f[d]=e+h[d]*c,f[d+1]=s-h[d+1]*u;o.push(f)}return o}get box(){return l(this,ST)}get classNamesForOutlining(){return["highlightOutline"]}};ST=new WeakMap,jA=new WeakMap;$S=class extends JO{newFreeDrawOutline(t,e,r,i,s,a){return new c5(t,e,r,i,s,a)}},c5=class extends QO{newOutliner(t,e,r,i,s,a=0){return new $S(t,e,r,i,s,a)}},fr=class fr extends tn{constructor(e){super({...e,name:"highlightEditor"});T(this,je);T(this,$A,null);T(this,_T,0);T(this,ff);T(this,r0,null);T(this,TT,null);T(this,da,null);T(this,CT,null);T(this,RT,0);T(this,n0,null);T(this,oo,null);T(this,lo,null);T(this,Zi,!1);T(this,HA,null);T(this,zA,null);T(this,ws,null);T(this,WA,"");T(this,il);T(this,IT,"");this.color=e.color||fr._defaultColor,x(this,il,e.thickness||fr._defaultThickness),this.opacity=e.opacity||fr._defaultOpacity,x(this,ff,e.boxes||null),x(this,IT,e.methodOfCreation||""),x(this,WA,e.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",e.highlightId>-1?(x(this,Zi,!0),R(this,je,dO).call(this,e),R(this,je,Zm).call(this)):l(this,ff)&&(x(this,$A,e.anchorNode),x(this,_T,e.anchorOffset),x(this,CT,e.focusNode),x(this,RT,e.focusOffset),R(this,je,u5).call(this),R(this,je,Zm).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){let e=fr.prototype;return Ce(this,"_keyboardManager",new v0([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:l(this,Zi)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:l(this,il),methodOfCreation:l(this,IT)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}static initialize(e,r){tn.initialize(e,r),fr._defaultColor||(fr._defaultColor=r.highlightColors?.values().next().value||"#fff066")}static updateDefaultParams(e,r){switch(e){case tr.HIGHLIGHT_COLOR:fr._defaultColor=r;break;case tr.HIGHLIGHT_THICKNESS:fr._defaultThickness=r;break}}translateInPage(e,r){}get toolbarPosition(){return l(this,zA)}get commentButtonPosition(){return l(this,HA)}updateParams(e,r){switch(e){case tr.HIGHLIGHT_COLOR:R(this,je,PK).call(this,r);break;case tr.HIGHLIGHT_THICKNESS:R(this,je,NK).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[tr.HIGHLIGHT_COLOR,fr._defaultColor],[tr.HIGHLIGHT_THICKNESS,fr._defaultThickness]]}get propertiesToUpdate(){return[[tr.HIGHLIGHT_COLOR,this.color||fr._defaultColor],[tr.HIGHLIGHT_THICKNESS,l(this,il)||fr._defaultThickness],[tr.HIGHLIGHT_FREE,l(this,Zi)]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(l(this,lo),{root:{fill:this.color,"fill-opacity":this.opacity}}),l(this,TT)?.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",x(this,TT,new MS({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(R(this,je,gO).call(this))}getBaseTranslation(){return[0,0]}getRect(e,r){return super.getRect(e,r,R(this,je,gO).call(this))}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){R(this,je,h5).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(R(this,je,Zm).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let r=!1;this.parent&&!e?R(this,je,h5).call(this):e&&(R(this,je,Zm).call(this,e),r=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),r&&this.select()}rotate(e){var s,a,o;let{drawLayer:r}=this.parent,i;l(this,Zi)?(e=(e-this.rotation+360)%360,i=R(s=fr,ll,ww).call(s,l(this,oo).box,e)):i=R(a=fr,ll,ww).call(a,[this.x,this.y,this.width,this.height],e),r.updateProperties(l(this,lo),{bbox:i,root:{"data-main-rotation":e}}),r.updateProperties(l(this,ws),{bbox:R(o=fr,ll,ww).call(o,l(this,da).box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;let e=super.render();l(this,WA)&&(e.setAttribute("aria-label",l(this,WA)),e.setAttribute("role","mark")),l(this,Zi)?e.classList.add("free"):this.div.addEventListener("keydown",R(this,je,kK).bind(this),{signal:this._uiManager._signal});let r=x(this,n0,document.createElement("div"));return e.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=l(this,r0),this.setDims(),yY(this,l(this,n0),["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(l(this,ws),{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(l(this,ws),{rootClass:{hovered:!1}})}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:R(this,je,pO).call(this,!0);break;case 1:case 3:R(this,je,pO).call(this,!1);break}}select(){super.select(),l(this,ws)&&this.parent?.drawLayer.updateProperties(l(this,ws),{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),l(this,ws)&&(this.parent?.drawLayer.updateProperties(l(this,ws),{rootClass:{selected:!1}}),l(this,Zi)||R(this,je,pO).call(this,!1))}get _mustFixPosition(){return!l(this,Zi)}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(l(this,lo),{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(l(this,ws),{rootClass:{hidden:!e}}))}static startHighlighting(e,r,{target:i,x:s,y:a}){let{x:o,y:c,width:u,height:h}=i.getBoundingClientRect(),f=new AbortController,d=e.combinedSignal(f),p=g=>{f.abort(),R(this,ll,UK).call(this,e,g)};window.addEventListener("blur",p,{signal:d}),window.addEventListener("pointerup",p,{signal:d}),window.addEventListener("pointerdown",wn,{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",yo,{signal:d}),i.addEventListener("pointermove",R(this,ll,BK).bind(this,e),{signal:d}),this._freeHighlight=new $S({x:s,y:a},[o,c,u,h],e.scale,this._defaultThickness/2,r,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.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(e,r,i){var y,b,m,w;let s=null;if(e instanceof YO){let{data:{quadPoints:A,rect:_,rotation:S,id:I,color:C,opacity:M,popupRef:z,richText:G,contentsObj:Y,creationDate:L,modificationDate:j},parent:{page:{pageNumber:q}}}=e;s=e={annotationType:Ie.HIGHLIGHT,color:Array.from(C),opacity:M,quadPoints:A,boxes:null,pageIndex:q-1,rect:_.slice(0),rotation:S,annotationElementId:I,id:I,deleted:!1,popupRef:z,richText:G,comment:Y?.str||null,creationDate:L,modificationDate:j}}else if(e instanceof US){let{data:{inkLists:A,rect:_,rotation:S,id:I,color:C,borderStyle:{rawWidth:M},popupRef:z,richText:G,contentsObj:Y,creationDate:L,modificationDate:j},parent:{page:{pageNumber:q}}}=e;s=e={annotationType:Ie.HIGHLIGHT,color:Array.from(C),thickness:M,inkLists:A,boxes:null,pageIndex:q-1,rect:_.slice(0),rotation:S,annotationElementId:I,id:I,deleted:!1,popupRef:z,richText:G,comment:Y?.str||null,creationDate:L,modificationDate:j}}let{color:a,quadPoints:o,inkLists:c,opacity:u}=e,h=await super.deserialize(e,r,i);h.color=se.makeHexColor(...a),h.opacity=u||1,c&&x(h,il,e.thickness),h._initialData=s,e.comment&&h.setCommentData(e);let[f,d]=h.pageDimensions,[p,g]=h.pageTranslation;if(o){let A=x(h,ff,[]);for(let _=0;_<o.length;_+=8)A.push({x:(o[_]-p)/f,y:1-(o[_+1]-g)/d,width:(o[_+2]-o[_])/f,height:(o[_+1]-o[_+5])/d});R(y=h,je,u5).call(y),R(b=h,je,Zm).call(b),h.rotate(h.rotation)}else if(c){x(h,Zi,!0);let A=c[0],_={x:A[0]-p,y:d-(A[1]-g)},S=new $S(_,[0,0,f,d],1,l(h,il)/2,!0,.001);for(let M=0,z=A.length;M<z;M+=2)_.x=A[M]-p,_.y=d-(A[M+1]-g),S.add(_);let{id:I,clipPathId:C}=r.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:h.color,"fill-opacity":h._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:S.toSVGPath()}},!0,!0);R(m=h,je,dO).call(m,{highlightOutlines:S.getOutlines(),highlightId:I,clipPathId:C}),R(w=h,je,Zm).call(w),h.rotate(h.parentRotation)}return h}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();let r=tn._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i=super.serialize(e);return Object.assign(i,{color:r,opacity:this.opacity,thickness:l(this,il),quadPoints:R(this,je,MK).call(this),outlines:R(this,je,FK).call(this,i.rect)}),this.addComment(i),this.annotationElementId&&!R(this,je,jK).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}};$A=new WeakMap,_T=new WeakMap,ff=new WeakMap,r0=new WeakMap,TT=new WeakMap,da=new WeakMap,CT=new WeakMap,RT=new WeakMap,n0=new WeakMap,oo=new WeakMap,lo=new WeakMap,Zi=new WeakMap,HA=new WeakMap,zA=new WeakMap,ws=new WeakMap,WA=new WeakMap,il=new WeakMap,IT=new WeakMap,je=new WeakSet,u5=function(){let e=new jS(l(this,ff),.001);x(this,oo,e.getOutlines()),[this.x,this.y,this.width,this.height]=l(this,oo).box;let r=new jS(l(this,ff),.0025,.001,this._uiManager.direction==="ltr");x(this,da,r.getOutlines());let{firstPoint:i}=l(this,oo);x(this,HA,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]);let{lastPoint:s}=l(this,da);x(this,zA,[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height])},dO=function({highlightOutlines:e,highlightId:r,clipPathId:i}){var d,p;if(x(this,oo,e),x(this,da,e.getNewOutline(l(this,il)/2+1.5,.0025)),r>=0)x(this,lo,r),x(this,r0,i),this.parent.drawLayer.finalizeDraw(r,{bbox:e.box,path:{d:e.toSVGPath()}}),x(this,ws,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:l(this,da).box,path:{d:l(this,da).toSVGPath()}},!0));else if(this.parent){let g=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(l(this,lo),{bbox:R(d=fr,ll,ww).call(d,l(this,oo).box,(g-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(l(this,ws),{bbox:R(p=fr,ll,ww).call(p,l(this,da).box,g),path:{d:l(this,da).toSVGPath()}})}let[a,o,c,u]=e.box;switch(this.rotation){case 0:this.x=a,this.y=o,this.width=c,this.height=u;break;case 90:{let[g,y]=this.parentDimensions;this.x=o,this.y=1-a,this.width=c*y/g,this.height=u*g/y;break}case 180:this.x=1-a,this.y=1-o,this.width=c,this.height=u;break;case 270:{let[g,y]=this.parentDimensions;this.x=1-o,this.y=a,this.width=c*y/g,this.height=u*g/y;break}}let{firstPoint:h}=e;x(this,HA,[(h[0]-a)/c,(h[1]-o)/u]);let{lastPoint:f}=l(this,da);x(this,zA,[(f[0]-a)/c,(f[1]-o)/u])},PK=function(e){let r=(a,o)=>{this.color=a,this.opacity=o,this.onUpdatedColor()},i=this.color,s=this.opacity;this.addCommands({cmd:r.bind(this,e,fr._defaultOpacity),undo:r.bind(this,i,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:tr.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(e)},!0)},NK=function(e){let r=l(this,il),i=s=>{x(this,il,s),R(this,je,LK).call(this,s)};this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:tr.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)},LK=function(e){l(this,Zi)&&(R(this,je,dO).call(this,{highlightOutlines:l(this,oo).getNewOutline(e/2)}),this.fixAndSetPosition(),this.setDims())},h5=function(){l(this,lo)===null||!this.parent||(this.parent.drawLayer.remove(l(this,lo)),x(this,lo,null),this.parent.drawLayer.remove(l(this,ws)),x(this,ws,null))},Zm=function(e=this.parent){l(this,lo)===null&&({id:ze(this,lo)._,clipPathId:ze(this,r0)._}=e.drawLayer.draw({bbox:l(this,oo).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:l(this,Zi)},path:{d:l(this,oo).toSVGPath()}},!1,!0),x(this,ws,e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:l(this,Zi)},bbox:l(this,da).box,path:{d:l(this,da).toSVGPath()}},l(this,Zi))),l(this,n0)&&(l(this,n0).style.clipPath=l(this,r0)))},ll=new WeakSet,ww=function([e,r,i,s],a){switch(a){case 90:return[1-r-s,e,s,i];case 180:return[1-e-i,1-r-s,i,s];case 270:return[r,1-e-i,s,i]}return[e,r,i,s]},kK=function(e){fr._keyboardManager.exec(this,e)},pO=function(e){if(!l(this,$A))return;let r=window.getSelection();e?r.setPosition(l(this,$A),l(this,_T)):r.setPosition(l(this,CT),l(this,RT))},gO=function(){return l(this,Zi)?this.rotation:0},MK=function(){if(l(this,Zi))return null;let[e,r]=this.pageDimensions,[i,s]=this.pageTranslation,a=l(this,ff),o=new Float32Array(a.length*8),c=0;for(let{x:u,y:h,width:f,height:d}of a){let p=u*e+i,g=(1-h)*r+s;o[c]=o[c+4]=p,o[c+1]=o[c+3]=g,o[c+2]=o[c+6]=p+f*e,o[c+5]=o[c+7]=g-d*r,c+=8}return o},FK=function(e){return l(this,oo).serialize(e,R(this,je,gO).call(this))},BK=function(e,r){this._freeHighlight.add(r)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},UK=function(e,r){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(r,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},jK=function(e){let{color:r}=this._initialData;return this.hasEditedComment||e.color.some((i,s)=>i!==r[s])},T(fr,ll),Lt(fr,"_defaultColor",null),Lt(fr,"_defaultOpacity",1),Lt(fr,"_defaultThickness",12),Lt(fr,"_type","highlight"),Lt(fr,"_editorType",Ie.HIGHLIGHT),Lt(fr,"_freeHighlightId",-1),Lt(fr,"_freeHighlight",null),Lt(fr,"_freeHighlightClipId","");tP=fr,eP=class{constructor(){T(this,i0,Object.create(null))}updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(let[e,r]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,r)}updateSVGProperty(t,e){l(this,i0)[t]=e}toSVGProperties(){let t=l(this,i0);return x(this,i0,Object.create(null)),{root:t}}reset(){x(this,i0,Object.create(null))}updateAll(t=this){this.updateProperties(t)}clone(){qr("Not implemented")}};i0=new WeakMap;Qe=class Qe extends tn{constructor(e){super(e);T(this,or);T(this,co,null);T(this,GA);Lt(this,"_colorPicker",null);Lt(this,"_drawId",null);x(this,GA,e.mustBeCommitted||!1),this._addOutlines(e)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}_addOutlines(e){e.drawOutlines&&(R(this,or,f5).call(this,e),R(this,or,wS).call(this))}static _mergeSVGProperties(e,r){let i=new Set(Object.keys(e));for(let[s,a]of Object.entries(r))i.has(s)?Object.assign(e[s],a):e[s]=a;return e}static getDefaultDrawingOptions(e){qr("Not implemented")}static get typesMap(){qr("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(e,r){let i=this.typesMap.get(e);i&&this._defaultDrawingOptions.updateProperty(i,r),this._currentParent&&(l(Qe,Pi).updateProperty(i,r),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,r){let i=this.constructor.typesMap.get(e);i&&this._updateProperty(e,i,r)}static get defaultPropertiesToUpdate(){let e=[],r=this._defaultDrawingOptions;for(let[i,s]of this.typesMap)e.push([i,r[s]]);return e}get propertiesToUpdate(){let e=[],{_drawingOptions:r}=this;for(let[i,s]of this.constructor.typesMap)e.push([i,r[s]]);return e}_updateProperty(e,r,i){let s=this._drawingOptions,a=s[r],o=c=>{s.updateProperty(r,c);let u=l(this,co).updateProperty(r,c);u&&R(this,or,AS).call(this,u),this.parent?.drawLayer.updateProperties(this._drawId,s.toSVGProperties()),e===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:o.bind(this,i),undo:o.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,Qe._mergeSVGProperties(l(this,co).getPathResizingSVGProperties(R(this,or,mO).call(this)),{bbox:R(this,or,Aw).call(this)}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,Qe._mergeSVGProperties(l(this,co).getPathResizedSVGProperties(R(this,or,mO).call(this)),{bbox:R(this,or,Aw).call(this)}))}_onTranslating(e,r){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:R(this,or,Aw).call(this)})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,Qe._mergeSVGProperties(l(this,co).getPathTranslatedSVGProperties(R(this,or,mO).call(this),this.parentDimensions),{bbox:R(this,or,Aw).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(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,l(this,GA)&&(x(this,GA,!1),this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){R(this,or,p5).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(R(this,or,wS).call(this),R(this,or,AS).call(this,l(this,co).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let r=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),R(this,or,p5).call(this)):e&&(this._uiManager.addShouldRescale(this),R(this,or,wS).call(this,e),r=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),r&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Qe._mergeSVGProperties({bbox:R(this,or,Aw).call(this)},l(this,co).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&R(this,or,AS).call(this,l(this,co).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e,r;this._isCopy&&(e=this.x,r=this.y);let i=super.render();i.classList.add("draw");let s=document.createElement("div");return i.append(s),s.setAttribute("aria-hidden","true"),s.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,r),i}static createDrawerInstance(e,r,i,s,a){qr("Not implemented")}static startDrawing(e,r,i,s){let{target:a,offsetX:o,offsetY:c,pointerId:u,pointerType:h}=s;if(gs.isInitializedAndDifferentPointerType(h))return;let{viewport:{rotation:f}}=e,{width:d,height:p}=a.getBoundingClientRect(),g=x(Qe,s0,new AbortController),y=e.combinedSignal(g);if(gs.setPointer(h,u),window.addEventListener("pointerup",b=>{gs.isSamePointerIdOrRemove(b.pointerId)&&this._endDraw(b)},{signal:y}),window.addEventListener("pointercancel",b=>{gs.isSamePointerIdOrRemove(b.pointerId)&&this._currentParent.endDrawingSession()},{signal:y}),window.addEventListener("pointerdown",b=>{gs.isSamePointerType(b.pointerType)&&(gs.initializeAndAddPointerId(b.pointerId),l(Qe,Pi).isCancellable()&&(l(Qe,Pi).removeLastElement(),l(Qe,Pi).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:y}),window.addEventListener("contextmenu",yo,{signal:y}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:y}),a.addEventListener("touchmove",b=>{gs.isSameTimeStamp(b.timeStamp)&&wn(b)},{signal:y}),e.toggleDrawing(),r._editorUndoBar?.hide(),l(Qe,Pi)){e.drawLayer.updateProperties(this._currentDrawId,l(Qe,Pi).startNew(o,c,d,p,f));return}r.updateUIForDefaultProperties(this),x(Qe,Pi,this.createDrawerInstance(o,c,d,p,f)),x(Qe,a0,this.getDefaultDrawingOptions()),this._currentParent=e,{id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(l(Qe,a0).toSVGProperties(),l(Qe,Pi).defaultSVGProperties),!0,!1)}static _drawMove(e){if(gs.isSameTimeStamp(e.timeStamp),!l(Qe,Pi))return;let{offsetX:r,offsetY:i,pointerId:s}=e;if(gs.isSamePointerId(s)){if(gs.isUsingMultiplePointers()){this._endDraw(e);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,l(Qe,Pi).add(r,i)),gs.setTimeStamp(e.timeStamp),wn(e)}}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,x(Qe,Pi,null),x(Qe,a0,null),gs.clearTimeStamp()),l(Qe,s0)&&(l(Qe,s0).abort(),x(Qe,s0,null),gs.clearPointerIds())}static _endDraw(e){let r=this._currentParent;if(r){if(r.toggleDrawing(!0),this._cleanup(!1),e?.target===r.div&&r.drawLayer.updateProperties(this._currentDrawId,l(Qe,Pi).end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){let i=l(Qe,Pi),s=this._currentDrawId,a=i.getLastElement();r.addCommands({cmd:()=>{r.drawLayer.updateProperties(s,i.setLastElement(a))},undo:()=>{r.drawLayer.updateProperties(s,i.removeLastElement())},mustExec:!1,type:tr.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(e){let r=this._currentParent;if(!r)return null;if(r.toggleDrawing(!0),r.cleanUndoStack(tr.DRAW_STEP),!l(Qe,Pi).isEmpty()){let{pageDimensions:[i,s],scale:a}=r,o=r.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:l(Qe,Pi).getOutlines(i*a,s*a,a,this._INNER_MARGIN),drawingOptions:l(Qe,a0),mustBeCommitted:!e});return this._cleanup(!0),o}return r.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,r,i,s,a,o){qr("Not implemented")}static async deserialize(e,r,i){var f,d;let{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:c}}=r.viewport,u=this.deserializeDraw(o,c,s,a,this._INNER_MARGIN,e),h=await super.deserialize(e,r,i);return h.createDrawingOptions(e),R(f=h,or,f5).call(f,{drawOutlines:u}),R(d=h,or,wS).call(d),h.onScaleChanging(),h.rotate(),h}serializeDraw(e){let[r,i]=this.pageTranslation,[s,a]=this.pageDimensions;return l(this,co).serialize([r,i,s,a],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}};co=new WeakMap,GA=new WeakMap,Pi=new WeakMap,s0=new WeakMap,a0=new WeakMap,or=new WeakSet,f5=function({drawOutlines:e,drawId:r,drawingOptions:i}){x(this,co,e),this._drawingOptions||(this._drawingOptions=i),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),r>=0?(this._drawId=r,this.parent.drawLayer.finalizeDraw(r,e.defaultProperties)):this._drawId=R(this,or,d5).call(this,e,this.parent),R(this,or,AS).call(this,e.box)},d5=function(e,r){let{id:i}=r.drawLayer.draw(Qe._mergeSVGProperties(this._drawingOptions.toSVGProperties(),e.defaultSVGProperties),!1,!1);return i},p5=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},wS=function(e=this.parent){if(!(this._drawId!==null&&this.parent===e)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,e.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=R(this,or,d5).call(this,l(this,co),e)}},$K=function([e,r,i,s]){let{parentDimensions:[a,o],rotation:c}=this;switch(c){case 90:return[r,1-e,i*(o/a),s*(a/o)];case 180:return[1-e,1-r,i,s];case 270:return[1-r,e,i*(o/a),s*(a/o)];default:return[e,r,i,s]}},mO=function(){let{x:e,y:r,width:i,height:s,parentDimensions:[a,o],rotation:c}=this;switch(c){case 90:return[1-r,e,i*(a/o),s*(o/a)];case 180:return[1-e,1-r,i,s];case 270:return[r,1-e,i*(a/o),s*(o/a)];default:return[e,r,i,s]}},AS=function(e){[this.x,this.y,this.width,this.height]=R(this,or,$K).call(this,e),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()},Aw=function(){let{x:e,y:r,width:i,height:s,rotation:a,parentRotation:o,parentDimensions:[c,u]}=this;switch((a*4+o)/90){case 1:return[1-r-s,e,s,i];case 2:return[1-e-i,1-r-s,i,s];case 3:return[r,1-e-i,s,i];case 4:return[e,r-i*(c/u),s*(u/c),i*(c/u)];case 5:return[1-r,e,i*(c/u),s*(u/c)];case 6:return[1-e-s*(u/c),1-r,s*(u/c),i*(c/u)];case 7:return[r-i*(c/u),1-e-s*(u/c),i*(c/u),s*(u/c)];case 8:return[e-i,r-s,i,s];case 9:return[1-r,e-i,s,i];case 10:return[1-e,1-r,i,s];case 11:return[r-s,1-e,s,i];case 12:return[e-s*(u/c),r,s*(u/c),i*(c/u)];case 13:return[1-r-i*(c/u),e-s*(u/c),i*(c/u),s*(u/c)];case 14:return[1-e,1-r-i*(c/u),s*(u/c),i*(c/u)];case 15:return[r,1-e,i*(c/u),s*(u/c)];default:return[e,r,i,s]}},Lt(Qe,"_currentDrawId",-1),Lt(Qe,"_currentParent",null),T(Qe,Pi,null),T(Qe,s0,null),T(Qe,a0,null),Lt(Qe,"_INNER_MARGIN",3);rP=Qe,g5=class{constructor(t,e,r,i,s,a){T(this,XA);T(this,ou,new Float64Array(6));T(this,Ni);T(this,Li);T(this,o0);T(this,VA);T(this,Ms);T(this,Ji,"");T(this,sl,0);T(this,l0,new E0);T(this,c0);T(this,u0);x(this,c0,r),x(this,u0,i),x(this,o0,s),x(this,VA,a),[t,e]=R(this,XA,yO).call(this,t,e);let o=x(this,Ni,[NaN,NaN,NaN,NaN,t,e]);x(this,Ms,[t,e]),x(this,Li,[{line:o,points:l(this,Ms)}]),l(this,ou).set(o,0)}updateProperty(t,e){t==="stroke-width"&&x(this,VA,e)}isEmpty(){return!l(this,Li)||l(this,Li).length===0}isCancellable(){return l(this,Ms).length<=10}add(t,e){[t,e]=R(this,XA,yO).call(this,t,e);let[r,i,s,a]=l(this,ou).subarray(2,6),o=t-s,c=e-a;return Math.hypot(l(this,c0)*o,l(this,u0)*c)<=2?null:(l(this,Ms).push(t,e),isNaN(r)?(l(this,ou).set([s,a,t,e],2),l(this,Ni).push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(l(this,ou)[0])&&l(this,Ni).splice(6,6),l(this,ou).set([r,i,s,a,t,e],0),l(this,Ni).push(...ue.createBezierPoints(r,i,s,a,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){let r=this.add(t,e);return r||(l(this,Ms).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,r,i,s){x(this,c0,r),x(this,u0,i),x(this,o0,s),[t,e]=R(this,XA,yO).call(this,t,e);let a=x(this,Ni,[NaN,NaN,NaN,NaN,t,e]);x(this,Ms,[t,e]);let o=l(this,Li).at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),l(this,Li).push({line:a,points:l(this,Ms)}),l(this,ou).set(a,0),x(this,sl,0),this.toSVGPath(),null}getLastElement(){return l(this,Li).at(-1)}setLastElement(t){return l(this,Li)?(l(this,Li).push(t),x(this,Ni,t.line),x(this,Ms,t.points),x(this,sl,0),{path:{d:this.toSVGPath()}}):l(this,l0).setLastElement(t)}removeLastElement(){if(!l(this,Li))return l(this,l0).removeLastElement();l(this,Li).pop(),x(this,Ji,"");for(let t=0,e=l(this,Li).length;t<e;t++){let{line:r,points:i}=l(this,Li)[t];x(this,Ni,r),x(this,Ms,i),x(this,sl,0),this.toSVGPath()}return{path:{d:l(this,Ji)}}}toSVGPath(){let t=ue.svgRound(l(this,Ni)[4]),e=ue.svgRound(l(this,Ni)[5]);if(l(this,Ms).length===2)return x(this,Ji,`${l(this,Ji)} M ${t} ${e} Z`),l(this,Ji);if(l(this,Ms).length<=6){let i=l(this,Ji).lastIndexOf("M");x(this,Ji,`${l(this,Ji).slice(0,i)} M ${t} ${e}`),x(this,sl,6)}if(l(this,Ms).length===4){let i=ue.svgRound(l(this,Ni)[10]),s=ue.svgRound(l(this,Ni)[11]);return x(this,Ji,`${l(this,Ji)} L ${i} ${s}`),x(this,sl,12),l(this,Ji)}let r=[];l(this,sl)===0&&(r.push(`M ${t} ${e}`),x(this,sl,6));for(let i=l(this,sl),s=l(this,Ni).length;i<s;i+=6){let[a,o,c,u,h,f]=l(this,Ni).slice(i,i+6).map(ue.svgRound);r.push(`C${a} ${o} ${c} ${u} ${h} ${f}`)}return x(this,Ji,l(this,Ji)+r.join(" ")),x(this,sl,l(this,Ni).length),l(this,Ji)}getOutlines(t,e,r,i){let s=l(this,Li).at(-1);return s.line=new Float32Array(s.line),s.points=new Float32Array(s.points),l(this,l0).build(l(this,Li),t,e,r,l(this,o0),l(this,VA),i),x(this,ou,null),x(this,Ni,null),x(this,Li,null),x(this,Ji,null),l(this,l0)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}};ou=new WeakMap,Ni=new WeakMap,Li=new WeakMap,o0=new WeakMap,VA=new WeakMap,Ms=new WeakMap,Ji=new WeakMap,sl=new WeakMap,l0=new WeakMap,c0=new WeakMap,u0=new WeakMap,XA=new WeakSet,yO=function(t,e){return ue._normalizePoint(t,e,l(this,c0),l(this,u0),l(this,o0))};E0=class extends ue{constructor(){super(...arguments);T(this,ts);T(this,Fs);T(this,DT,0);T(this,OT);T(this,uo);T(this,lu);T(this,cu);T(this,qA);T(this,YA);T(this,h0)}build(e,r,i,s,a,o,c){x(this,lu,r),x(this,cu,i),x(this,qA,s),x(this,YA,a),x(this,h0,o),x(this,OT,c??0),x(this,uo,e),R(this,ts,zK).call(this)}get thickness(){return l(this,h0)}setLastElement(e){return l(this,uo).push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return l(this,uo).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){let e=[];for(let{line:r}of l(this,uo)){if(e.push(`M${ue.svgRound(r[4])} ${ue.svgRound(r[5])}`),r.length===6){e.push("Z");continue}if(r.length===12&&isNaN(r[6])){e.push(`L${ue.svgRound(r[10])} ${ue.svgRound(r[11])}`);continue}for(let i=6,s=r.length;i<s;i+=6){let[a,o,c,u,h,f]=r.subarray(i,i+6).map(ue.svgRound);e.push(`C${a} ${o} ${c} ${u} ${h} ${f}`)}}return e.join("")}serialize([e,r,i,s],a){let o=[],c=[],[u,h,f,d]=R(this,ts,HK).call(this),p,g,y,b,m,w,A,_,S;switch(l(this,YA)){case 0:S=ue._rescale,p=e,g=r+s,y=i,b=-s,m=e+u*i,w=r+(1-h-d)*s,A=e+(u+f)*i,_=r+(1-h)*s;break;case 90:S=ue._rescaleAndSwap,p=e,g=r,y=i,b=s,m=e+h*i,w=r+u*s,A=e+(h+d)*i,_=r+(u+f)*s;break;case 180:S=ue._rescale,p=e+i,g=r,y=-i,b=s,m=e+(1-u-f)*i,w=r+h*s,A=e+(1-u)*i,_=r+(h+d)*s;break;case 270:S=ue._rescaleAndSwap,p=e+i,g=r+s,y=-i,b=-s,m=e+(1-h-d)*i,w=r+(1-u-f)*s,A=e+(1-h)*i,_=r+(1-u)*s;break}for(let{line:I,points:C}of l(this,uo))o.push(S(I,p,g,y,b,a?new Array(I.length):null)),c.push(S(C,p,g,y,b,a?new Array(C.length):null));return{lines:o,points:c,rect:[m,w,A,_]}}static deserialize(e,r,i,s,a,{paths:{lines:o,points:c},rotation:u,thickness:h}){let f=[],d,p,g,y,b;switch(u){case 0:b=ue._rescale,d=-e/i,p=r/s+1,g=1/i,y=-1/s;break;case 90:b=ue._rescaleAndSwap,d=-r/s,p=-e/i,g=1/s,y=1/i;break;case 180:b=ue._rescale,d=e/i+1,p=-r/s,g=-1/i,y=1/s;break;case 270:b=ue._rescaleAndSwap,d=r/s+1,p=e/i+1,g=-1/s,y=-1/i;break}if(!o){o=[];for(let w of c){let A=w.length;if(A===2){o.push(new Float32Array([NaN,NaN,NaN,NaN,w[0],w[1]]));continue}if(A===4){o.push(new Float32Array([NaN,NaN,NaN,NaN,w[0],w[1],NaN,NaN,NaN,NaN,w[2],w[3]]));continue}let _=new Float32Array(3*(A-2));o.push(_);let[S,I,C,M]=w.subarray(0,4);_.set([NaN,NaN,NaN,NaN,S,I],0);for(let z=4;z<A;z+=2){let G=w[z],Y=w[z+1];_.set(ue.createBezierPoints(S,I,C,M,G,Y),(z-2)*3),[S,I,C,M]=[C,M,G,Y]}}}for(let w=0,A=o.length;w<A;w++)f.push({line:b(o[w].map(_=>_??NaN),d,p,g,y),points:b(c[w].map(_=>_??NaN),d,p,g,y)});let m=new this.prototype.constructor;return m.build(f,i,s,1,u,h,a),m}get box(){return l(this,Fs)}updateProperty(e,r){return e==="stroke-width"?R(this,ts,WK).call(this,r):null}updateParentDimensions([e,r],i){let[s,a]=R(this,ts,Lh).call(this);x(this,lu,e),x(this,cu,r),x(this,qA,i);let[o,c]=R(this,ts,Lh).call(this),u=o-s,h=c-a,f=l(this,Fs);return f[0]-=u,f[1]-=h,f[2]+=2*u,f[3]+=2*h,f}updateRotation(e){return x(this,DT,e),{path:{transform:this.rotationTransform}}}get viewBox(){return l(this,Fs).map(ue.svgRound).join(" ")}get defaultProperties(){let[e,r]=l(this,Fs);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ue.svgRound(e)} ${ue.svgRound(r)}`}}}get rotationTransform(){let[,,e,r]=l(this,Fs),i=0,s=0,a=0,o=0,c=0,u=0;switch(l(this,DT)){case 90:s=r/e,a=-e/r,c=e;break;case 180:i=-1,o=-1,c=e,u=r;break;case 270:s=-r/e,a=e/r,u=r;break;default:return""}return`matrix(${i} ${s} ${a} ${o} ${ue.svgRound(c)} ${ue.svgRound(u)})`}getPathResizingSVGProperties([e,r,i,s]){let[a,o]=R(this,ts,Lh).call(this),[c,u,h,f]=l(this,Fs);if(Math.abs(h-a)<=ue.PRECISION||Math.abs(f-o)<=ue.PRECISION){let b=e+i/2-(c+h/2),m=r+s/2-(u+f/2);return{path:{"transform-origin":`${ue.svgRound(e)} ${ue.svgRound(r)}`,transform:`${this.rotationTransform} translate(${b} ${m})`}}}let d=(i-2*a)/(h-2*a),p=(s-2*o)/(f-2*o),g=h/i,y=f/s;return{path:{"transform-origin":`${ue.svgRound(c)} ${ue.svgRound(u)}`,transform:`${this.rotationTransform} scale(${g} ${y}) translate(${ue.svgRound(a)} ${ue.svgRound(o)}) scale(${d} ${p}) translate(${ue.svgRound(-a)} ${ue.svgRound(-o)})`}}}getPathResizedSVGProperties([e,r,i,s]){let[a,o]=R(this,ts,Lh).call(this),c=l(this,Fs),[u,h,f,d]=c;if(c[0]=e,c[1]=r,c[2]=i,c[3]=s,Math.abs(f-a)<=ue.PRECISION||Math.abs(d-o)<=ue.PRECISION){let m=e+i/2-(u+f/2),w=r+s/2-(h+d/2);for(let{line:A,points:_}of l(this,uo))ue._translate(A,m,w,A),ue._translate(_,m,w,_);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ue.svgRound(e)} ${ue.svgRound(r)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}let p=(i-2*a)/(f-2*a),g=(s-2*o)/(d-2*o),y=-p*(u+a)+e+a,b=-g*(h+o)+r+o;if(p!==1||g!==1||y!==0||b!==0)for(let{line:m,points:w}of l(this,uo))ue._rescale(m,y,b,p,g,m),ue._rescale(w,y,b,p,g,w);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ue.svgRound(e)} ${ue.svgRound(r)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,r],i){let[s,a]=i,o=l(this,Fs),c=e-o[0],u=r-o[1];if(l(this,lu)===s&&l(this,cu)===a)for(let{line:h,points:f}of l(this,uo))ue._translate(h,c,u,h),ue._translate(f,c,u,f);else{let h=l(this,lu)/s,f=l(this,cu)/a;x(this,lu,s),x(this,cu,a);for(let{line:d,points:p}of l(this,uo))ue._rescale(d,c,u,h,f,d),ue._rescale(p,c,u,h,f,p);o[2]*=h,o[3]*=f}return o[0]=e,o[1]=r,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${ue.svgRound(e)} ${ue.svgRound(r)}`}}}get defaultSVGProperties(){let e=l(this,Fs);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${ue.svgRound(e[0])} ${ue.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}};Fs=new WeakMap,DT=new WeakMap,OT=new WeakMap,uo=new WeakMap,lu=new WeakMap,cu=new WeakMap,qA=new WeakMap,YA=new WeakMap,h0=new WeakMap,ts=new WeakSet,Lh=function(e=l(this,h0)){let r=l(this,OT)+e/2*l(this,qA);return l(this,YA)%180===0?[r/l(this,lu),r/l(this,cu)]:[r/l(this,cu),r/l(this,lu)]},HK=function(){let[e,r,i,s]=l(this,Fs),[a,o]=R(this,ts,Lh).call(this,0);return[e+a,r+o,i-2*a,s-2*o]},zK=function(){let e=x(this,Fs,new Float32Array([1/0,1/0,-1/0,-1/0]));for(let{line:s}of l(this,uo)){if(s.length<=12){for(let c=4,u=s.length;c<u;c+=6)se.pointBoundingBox(s[c],s[c+1],e);continue}let a=s[4],o=s[5];for(let c=6,u=s.length;c<u;c+=6){let[h,f,d,p,g,y]=s.subarray(c,c+6);se.bezierBoundingBox(a,o,h,f,d,p,g,y,e),a=g,o=y}}let[r,i]=R(this,ts,Lh).call(this);e[0]=As(e[0]-r,0,1),e[1]=As(e[1]-i,0,1),e[2]=As(e[2]+r,0,1),e[3]=As(e[3]+i,0,1),e[2]-=e[0],e[3]-=e[1]},WK=function(e){let[r,i]=R(this,ts,Lh).call(this);x(this,h0,e);let[s,a]=R(this,ts,Lh).call(this),[o,c]=[s-r,a-i],u=l(this,Fs);return u[0]-=o,u[1]-=c,u[2]+=2*o,u[3]+=2*c,u};nP=class n extends eP{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:tn._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,e){t==="stroke-width"&&(e??(e=this["stroke-width"]),e*=this._viewParameters.realScale),super.updateSVGProperty(t,e)}clone(){let t=new n(this._viewParameters);return t.updateAll(this),t}},Rw=class Rw extends rP{constructor(e){super({...e,name:"inkEditor"});T(this,xP);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(e,r){tn.initialize(e,r),this._defaultDrawingOptions=new nP(r.viewParameters)}static getDefaultDrawingOptions(e){let r=this._defaultDrawingOptions.clone();return r.updateProperties(e),r}static get supportMultipleDrawings(){return!0}static get typesMap(){return Ce(this,"typesMap",new Map([[tr.INK_THICKNESS,"stroke-width"],[tr.INK_COLOR,"stroke"],[tr.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,r,i,s,a){return new g5(e,r,i,s,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,r,i,s,a,o){return E0.deserialize(e,r,i,s,a,o)}static async deserialize(e,r,i){let s=null;if(e instanceof US){let{data:{inkLists:o,rect:c,rotation:u,id:h,color:f,opacity:d,borderStyle:{rawWidth:p},popupRef:g,richText:y,contentsObj:b,creationDate:m,modificationDate:w},parent:{page:{pageNumber:A}}}=e;s=e={annotationType:Ie.INK,color:Array.from(f),thickness:p,opacity:d,paths:{points:o},boxes:null,pageIndex:A-1,rect:c.slice(0),rotation:u,annotationElementId:h,id:h,deleted:!1,popupRef:g,richText:y,comment:b?.str||null,creationDate:m,modificationDate:w}}let a=await super.deserialize(e,r,i);return a._initialData=s,e.comment&&a.setCommentData(e),a}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new WO(this)),[["colorPicker",this._colorPicker]]}get colorType(){return tr.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();let{_drawId:e,_drawingOptions:r,parent:i}=this;r.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(e,r.toSVGProperties())}static onScaleChangingWhenDrawing(){let e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:r,opacity:i}){this._drawingOptions=Rw.getDefaultDrawingOptions({stroke:se.makeHexColor(...e),"stroke-width":r,"stroke-opacity":i})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let{lines:r,points:i}=this.serializeDraw(e),{_drawingOptions:{stroke:s,"stroke-opacity":a,"stroke-width":o}}=this,c=Object.assign(super.serialize(e),{color:tn._colorManager.convert(s),opacity:a,thickness:o,paths:{lines:r,points:i}});return this.addComment(c),e?(c.isCopy=!0,c):this.annotationElementId&&!R(this,xP,GK).call(this,c)?null:(c.id=this.annotationElementId,c)}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let{points:r,rect:i}=this.serializeDraw(!1);return e.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:r,popup:this.comment}),null}};xP=new WeakSet,GK=function(e){let{color:r,thickness:i,opacity:s,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((o,c)=>o!==r[c])||e.thickness!==i||e.opacity!==s||e.pageIndex!==a},Lt(Rw,"_type","ink"),Lt(Rw,"_editorType",Ie.INK),Lt(Rw,"_defaultDrawingOptions",null);m5=Rw,HS=class extends E0{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}},HD=8,nS=3,ol=class{static extractContoursFromText(t,{fontFamily:e,fontStyle:r,fontWeight:i},s,a,o,c){let u=new OffscreenCanvas(1,1),h=u.getContext("2d",{alpha:!1}),f=200,d=h.font=`${r} ${i} ${f}px ${e}`,{actualBoundingBoxLeft:p,actualBoundingBoxRight:g,actualBoundingBoxAscent:y,actualBoundingBoxDescent:b,fontBoundingBoxAscent:m,fontBoundingBoxDescent:w,width:A}=h.measureText(t),_=1.5,S=Math.ceil(Math.max(Math.abs(p)+Math.abs(g)||0,A)*_),I=Math.ceil(Math.max(Math.abs(y)+Math.abs(b)||f,Math.abs(m)+Math.abs(w)||f)*_);u=new OffscreenCanvas(S,I),h=u.getContext("2d",{alpha:!0,willReadFrequently:!0}),h.font=d,h.filter="grayscale(1)",h.fillStyle="white",h.fillRect(0,0,S,I),h.fillStyle="black",h.fillText(t,S*(_-1)/2,I*(3-_)/2);let C=R(this,mr,v5).call(this,h.getImageData(0,0,S,I).data),M=R(this,mr,KK).call(this,C),z=R(this,mr,w5).call(this,M),G=R(this,mr,b5).call(this,C,S,I,z);return this.processDrawnLines({lines:{curves:G,width:S,height:I},pageWidth:s,pageHeight:a,rotation:o,innerMargin:c,mustSmooth:!0,areContours:!0})}static process(t,e,r,i,s){let[a,o,c]=R(this,mr,ZK).call(this,t),[u,h]=R(this,mr,YK).call(this,a,o,c,Math.hypot(o,c)*l(this,f0).sigmaSFactor,l(this,f0).sigmaR,l(this,f0).kernelSize),f=R(this,mr,w5).call(this,h),d=R(this,mr,b5).call(this,u,o,c,f);return this.processDrawnLines({lines:{curves:d,width:o,height:c},pageWidth:e,pageHeight:r,rotation:i,innerMargin:s,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:e,pageHeight:r,rotation:i,innerMargin:s,mustSmooth:a,areContours:o}){i%180!==0&&([e,r]=[r,e]);let{curves:c,width:u,height:h}=t,f=t.thickness??0,d=[],p=Math.min(e/u,r/h),g=p/e,y=p/r,b=[];for(let{points:w}of c){let A=a?R(this,mr,qK).call(this,w):w;if(!A)continue;b.push(A);let _=A.length,S=new Float32Array(_),I=new Float32Array(3*(_===2?2:_-2));if(d.push({line:I,points:S}),_===2){S[0]=A[0]*g,S[1]=A[1]*y,I.set([NaN,NaN,NaN,NaN,S[0],S[1]],0);continue}let[C,M,z,G]=A;C*=g,M*=y,z*=g,G*=y,S.set([C,M,z,G],0),I.set([NaN,NaN,NaN,NaN,C,M],0);for(let Y=4;Y<_;Y+=2){let L=S[Y]=A[Y]*g,j=S[Y+1]=A[Y+1]*y;I.set(ue.createBezierPoints(C,M,z,G,L,j),(Y-2)*3),[C,M,z,G]=[z,G,L,j]}}if(d.length===0)return null;let m=o?new HS:new E0;return m.build(d,e,r,1,i,o?0:f,s),{outline:m,newCurves:b,areContours:o,thickness:f,width:u,height:h}}static async compressSignature({outlines:t,areContours:e,thickness:r,width:i,height:s}){let a=1/0,o=-1/0,c=0;for(let A of t){c+=A.length;for(let _=2,S=A.length;_<S;_++){let I=A[_]-A[_-2];a=Math.min(a,I),o=Math.max(o,I)}}let u;a>=-128&&o<=127?u=Int8Array:a>=-32768&&o<=32767?u=Int16Array:u=Int32Array;let h=t.length,f=HD+nS*h,d=new Uint32Array(f),p=0;d[p++]=f*Uint32Array.BYTES_PER_ELEMENT+(c-2*h)*u.BYTES_PER_ELEMENT,d[p++]=0,d[p++]=i,d[p++]=s,d[p++]=e?0:1,d[p++]=Math.max(0,Math.floor(r??0)),d[p++]=h,d[p++]=u.BYTES_PER_ELEMENT;for(let A of t)d[p++]=A.length-2,d[p++]=A[0],d[p++]=A[1];let g=new CompressionStream("deflate-raw"),y=g.writable.getWriter();await y.ready,y.write(d);let b=u.prototype.constructor;for(let A of t){let _=new b(A.length-2);for(let S=2,I=A.length;S<I;S++)_[S-2]=A[S]-A[S-2];y.write(_)}y.close();let m=await new Response(g.readable).arrayBuffer(),w=new Uint8Array(m);return sY(w)}static async decompressSignature(t){try{let e=hft(t),{readable:r,writable:i}=new DecompressionStream("deflate-raw"),s=i.getWriter();await s.ready,s.write(e).then(async()=>{await s.ready,await s.close()}).catch(()=>{});let a=null,o=0;for await(let A of r)a||(a=new Uint8Array(new Uint32Array(A.buffer,0,4)[0])),a.set(A,o),o+=A.length;let c=new Uint32Array(a.buffer,0,a.length>>2),u=c[1];if(u!==0)throw new Error(`Invalid version: ${u}`);let h=c[2],f=c[3],d=c[4]===0,p=c[5],g=c[6],y=c[7],b=[],m=(HD+nS*g)*Uint32Array.BYTES_PER_ELEMENT,w;switch(y){case Int8Array.BYTES_PER_ELEMENT:w=new Int8Array(a.buffer,m);break;case Int16Array.BYTES_PER_ELEMENT:w=new Int16Array(a.buffer,m);break;case Int32Array.BYTES_PER_ELEMENT:w=new Int32Array(a.buffer,m);break}o=0;for(let A=0;A<g;A++){let _=c[nS*A+HD],S=new Float32Array(_+2);b.push(S);for(let I=0;I<nS-1;I++)S[I]=c[nS*A+HD+I+1];for(let I=0;I<_;I++)S[I+2]=S[I]+w[o++]}return{areContours:d,thickness:p,outlines:b,width:h,height:f}}catch(e){return De(`decompressSignature: ${e}`),null}}};f0=new WeakMap,mr=new WeakSet,y5=function(t,e,r,i){return r-=t,i-=e,r===0?i>0?0:4:r===1?i+6:2-i},Vl=new WeakMap,VK=function(t,e,r,i,s,a,o){let c=R(this,mr,y5).call(this,r,i,s,a);for(let u=0;u<8;u++){let h=(-u+c-o+16)%8,f=l(this,Vl)[2*h],d=l(this,Vl)[2*h+1];if(t[(r+f)*e+(i+d)]!==0)return h}return-1},XK=function(t,e,r,i,s,a,o){let c=R(this,mr,y5).call(this,r,i,s,a);for(let u=0;u<8;u++){let h=(u+c+o+16)%8,f=l(this,Vl)[2*h],d=l(this,Vl)[2*h+1];if(t[(r+f)*e+(i+d)]!==0)return h}return-1},b5=function(t,e,r,i){let s=t.length,a=new Int32Array(s);for(let h=0;h<s;h++)a[h]=t[h]<=i?1:0;for(let h=1;h<r-1;h++)a[h*e]=a[h*e+e-1]=0;for(let h=0;h<e;h++)a[h]=a[e*r-1-h]=0;let o=1,c,u=[];for(let h=1;h<r-1;h++){c=1;for(let f=1;f<e-1;f++){let d=h*e+f,p=a[d];if(p===0)continue;let g=h,y=f;if(p===1&&a[d-1]===0)o+=1,y-=1;else if(p>=1&&a[d+1]===0)o+=1,y+=1,p>1&&(c=p);else{p!==1&&(c=Math.abs(p));continue}let b=[f,h],m=y===f+1,w={isHole:m,points:b,id:o,parent:0};u.push(w);let A;for(let Y of u)if(Y.id===c){A=Y;break}A?A.isHole?w.parent=m?A.parent:c:w.parent=m?c:A.parent:w.parent=m?c:0;let _=R(this,mr,VK).call(this,a,e,h,f,g,y,0);if(_===-1){a[d]=-o,a[d]!==1&&(c=Math.abs(a[d]));continue}let S=l(this,Vl)[2*_],I=l(this,Vl)[2*_+1],C=h+S,M=f+I;g=C,y=M;let z=h,G=f;for(;;){let Y=R(this,mr,XK).call(this,a,e,z,G,g,y,1);S=l(this,Vl)[2*Y],I=l(this,Vl)[2*Y+1];let L=z+S,j=G+I;b.push(j,L);let q=z*e+G;if(a[q+1]===0?a[q]=-o:a[q]===1&&(a[q]=o),L===h&&j===f&&z===C&&G===M){a[d]!==1&&(c=Math.abs(a[d]));break}else g=z,y=G,z=L,G=j}}}return u},bO=function(t,e,r,i){if(r-e<=4){for(let C=e;C<r-2;C+=2)i.push(t[C],t[C+1]);return}let s=t[e],a=t[e+1],o=t[r-4]-s,c=t[r-3]-a,u=Math.hypot(o,c),h=o/u,f=c/u,d=h*a-f*s,p=c/o,g=1/u,y=Math.atan(p),b=Math.cos(y),m=Math.sin(y),w=g*(Math.abs(b)+Math.abs(m)),A=g*(1-w+w**2),_=Math.max(Math.atan(Math.abs(m+b)*A),Math.atan(Math.abs(m-b)*A)),S=0,I=e;for(let C=e+2;C<r-2;C+=2){let M=Math.abs(d-h*t[C+1]+f*t[C]);M>S&&(I=C,S=M)}S>(u*_)**2?(R(this,mr,bO).call(this,t,e,I+2,i),R(this,mr,bO).call(this,t,I,r,i)):i.push(s,a)},qK=function(t){let e=[],r=t.length;return R(this,mr,bO).call(this,t,0,r,e),e.push(t[r-2],t[r-1]),e.length<=4?null:e},YK=function(t,e,r,i,s,a){let o=new Float32Array(a**2),c=-2*i**2,u=a>>1;for(let y=0;y<a;y++){let b=(y-u)**2;for(let m=0;m<a;m++)o[y*a+m]=Math.exp((b+(m-u)**2)/c)}let h=new Float32Array(256),f=-2*s**2;for(let y=0;y<256;y++)h[y]=Math.exp(y**2/f);let d=t.length,p=new Uint8Array(d),g=new Uint32Array(256);for(let y=0;y<r;y++)for(let b=0;b<e;b++){let m=y*e+b,w=t[m],A=0,_=0;for(let I=0;I<a;I++){let C=y+I-u;if(!(C<0||C>=r))for(let M=0;M<a;M++){let z=b+M-u;if(z<0||z>=e)continue;let G=t[C*e+z],Y=o[I*a+M]*h[Math.abs(G-w)];A+=G*Y,_+=Y}}let S=p[m]=Math.round(A/_);g[S]++}return[p,g]},KK=function(t){let e=new Uint32Array(256);for(let r of t)e[r]++;return e},v5=function(t){let e=t.length,r=new Uint8ClampedArray(e>>2),i=-1/0,s=1/0;for(let o=0,c=r.length;o<c;o++){let u=r[o]=t[o<<2];i=Math.max(i,u),s=Math.min(s,u)}let a=255/(i-s);for(let o=0,c=r.length;o<c;o++)r[o]=(r[o]-s)*a;return r},w5=function(t){let e,r=-1/0,i=-1/0,s=t.findIndex(c=>c!==0),a=s,o=s;for(e=s;e<256;e++){let c=t[e];c>r&&(e-a>i&&(i=e-a,o=e-1),r=c,a=e)}for(e=o-1;e>=0&&!(t[e]>t[e+1]);e--);return e},ZK=function(t){let e=t,{width:r,height:i}=t,{maxDim:s}=l(this,f0),a=r,o=i;if(r>s||i>s){let d=r,p=i,g=Math.log2(Math.max(r,i)/s),y=Math.floor(g);g=g===y?y-1:y;for(let m=0;m<g;m++){a=Math.ceil(d/2),o=Math.ceil(p/2);let w=new OffscreenCanvas(a,o);w.getContext("2d").drawImage(t,0,0,d,p,0,0,a,o),d=a,p=o,t!==e&&t.close(),t=w.transferToImageBitmap()}let b=Math.min(s/a,s/o);a=Math.round(a*b),o=Math.round(o*b)}let u=new OffscreenCanvas(a,o).getContext("2d",{willReadFrequently:!0});u.fillStyle="white",u.fillRect(0,0,a,o),u.filter="grayscale(1)",u.drawImage(t,0,0,t.width,t.height,0,0,a,o);let h=u.getImageData(0,0,a,o).data;return[R(this,mr,v5).call(this,h),a,o]},T(ol,mr),T(ol,f0,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),T(ol,Vl,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));A5=class n extends eP{constructor(){super(),super.updateProperties({fill:tn._defaultLineColor,"stroke-width":0})}clone(){let t=new n;return t.updateAll(this),t}},E5=class n extends nP{constructor(t){super(t),super.updateProperties({stroke:tn._defaultLineColor,"stroke-width":1})}clone(){let t=new n(this._viewParameters);return t.updateAll(this),t}},Va=class Va extends rP{constructor(e){super({...e,mustBeCommitted:!0,name:"signatureEditor"});T(this,_p,!1);T(this,uu,null);T(this,Tp,null);T(this,d0,null);this._willKeepAspectRatio=!0,x(this,Tp,e.signatureData||null),x(this,uu,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(e,r){tn.initialize(e,r),this._defaultDrawingOptions=new A5,this._defaultDrawnSignatureOptions=new E5(r.viewParameters)}static getDefaultDrawingOptions(e){let r=this._defaultDrawingOptions.clone();return r.updateProperties(e),r}static get supportMultipleDrawings(){return!1}static get typesMap(){return Ce(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!l(this,uu)}}static computeTelemetryFinalData(e){let r=e.get("hasDescription");return{hasAltText:r.get(!0)??0,hasNoAltText:r.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let e,r,{_isCopy:i}=this;if(i&&(this._isCopy=!1,e=this.x,r=this.y),super.render(),this._drawId===null)if(l(this,Tp)){let{lines:s,mustSmooth:a,areContours:o,description:c,uuid:u,heightInPage:h}=l(this,Tp),{rawDims:{pageWidth:f,pageHeight:d},rotation:p}=this.parent.viewport,g=ol.processDrawnLines({lines:s,pageWidth:f,pageHeight:d,rotation:p,innerMargin:Va._INNER_MARGIN,mustSmooth:a,areContours:o});this.addSignature(g,h,c,u)}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,uu)||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(e,r)),this.div}setUuid(e){x(this,d0,e),this.addEditToolbar()}getUuid(){return l(this,d0)}get description(){return l(this,uu)}set description(e){x(this,uu,e),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:e})),super.addEditToolbar().then(r=>{r?.updateEditSignatureButton(e)}))}getSignaturePreview(){let{newCurves:e,areContours:r,thickness:i,width:s,height:a}=l(this,Tp),o=Math.max(s,a),c=ol.processDrawnLines({lines:{curves:e.map(u=>({points:u})),thickness:i,width:s,height:a},pageWidth:o,pageHeight:o,rotation:0,innerMargin:0,mustSmooth:!1,areContours:r});return{areContours:r,outline:c.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(e,r,i,s){let{x:a,y:o}=this,{outline:c}=x(this,Tp,e);x(this,_p,c instanceof HS),this.description=i;let u;l(this,_p)?u=Va.getDefaultDrawingOptions():(u=Va._defaultDrawnSignatureOptions.clone(),u.updateProperties({"stroke-width":c.thickness})),this._addOutlines({drawOutlines:c,drawingOptions:u});let[,h]=this.pageDimensions,f=r/h;f=f>=1?.5:f,this.width*=f/this.height,this.width>=1&&(f*=.9/this.width,this.width=.9),this.height=f,this.setDims(),this.x=a,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(s),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!s,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(e){let{rawDims:{pageWidth:r,pageHeight:i},rotation:s}=this.parent.viewport;return ol.process(e,r,i,s,Va._INNER_MARGIN)}getFromText(e,r){let{rawDims:{pageWidth:i,pageHeight:s},rotation:a}=this.parent.viewport;return ol.extractContoursFromText(e,r,i,s,a,Va._INNER_MARGIN)}getDrawnSignature(e){let{rawDims:{pageWidth:r,pageHeight:i},rotation:s}=this.parent.viewport;return ol.processDrawnLines({lines:e,pageWidth:r,pageHeight:i,rotation:s,innerMargin:Va._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:e,thickness:r}){e?this._drawingOptions=Va.getDefaultDrawingOptions():(this._drawingOptions=Va._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":r}))}serialize(e=!1){if(this.isEmpty())return null;let{lines:r,points:i}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":s}}=this,a=Object.assign(super.serialize(e),{isSignature:!0,areContours:l(this,_p),color:[0,0,0],thickness:l(this,_p)?0:s});return this.addComment(a),e?(a.paths={lines:r,points:i},a.uuid=l(this,d0),a.isCopy=!0):a.lines=r,l(this,uu)&&(a.accessibilityData={type:"Figure",alt:l(this,uu)}),a}static deserializeDraw(e,r,i,s,a,o){return o.areContours?HS.deserialize(e,r,i,s,a,o):E0.deserialize(e,r,i,s,a,o)}static async deserialize(e,r,i){let s=await super.deserialize(e,r,i);return x(s,_p,e.areContours),s.description=e.accessibilityData?.alt||"",x(s,d0,e.uuid),s}};_p=new WeakMap,uu=new WeakMap,Tp=new WeakMap,d0=new WeakMap,Lt(Va,"_type","signature"),Lt(Va,"_editorType",Ie.SIGNATURE),Lt(Va,"_defaultDrawingOptions",null);x5=Va,ES=class extends tn{constructor(e){super({...e,name:"stampEditor"});T(this,lr);T(this,fn,null);T(this,ki,null);T(this,Cp,null);T(this,df,null);T(this,Rp,null);T(this,KA,"");T(this,pf,null);T(this,p0,!1);T(this,hu,null);T(this,ho,!1);T(this,ZA,!1);x(this,df,e.bitmapUrl),x(this,Rp,e.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(e,r){tn.initialize(e,r)}static isHandlingMimeForPasting(e){return TO.includes(e)}static paste(e,r){r.pasteEditor({mode:Ie.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){let r=e.get("hasAltText");return{hasAltText:r.get(!0)??0,hasNoAltText:r.get(!1)??0}}async mlGuessAltText(e=null,r=!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:s,width:a,height:o}=e||this.copyCanvas(null,null,!0).imageData,c=await i.guess({name:"altText",request:{data:s,width:a,height:o,channels:s.length/(a*o)}});if(!c)throw new Error("No response from the AI service.");if(c.error)throw new Error("Error from the AI service.");if(c.cancel)return null;if(!c.output)throw new Error("No valid response from the AI service.");let u=c.output;return await this.setGuessedAltText(u),r&&!this.hasAltTextData()&&(this.altTextData={alt:u,decorative:!1}),u}remove(){l(this,ki)&&(x(this,fn,null),this._uiManager.imageManager.deleteId(l(this,ki)),l(this,pf)?.remove(),x(this,pf,null),l(this,hu)&&(clearTimeout(l(this,hu)),x(this,hu,null))),super.remove()}rebuild(){if(!this.parent){l(this,ki)&&R(this,lr,vO).call(this);return}super.rebuild(),this.div!==null&&(l(this,ki)&&l(this,pf)===null&&R(this,lr,vO).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(l(this,Cp)||l(this,fn)||l(this,df)||l(this,Rp)||l(this,ki)||l(this,p0))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,r;return this._isCopy&&(e=this.x,r=this.y),super.render(),this.div.hidden=!0,this.createAltText(),l(this,p0)||(l(this,fn)?R(this,lr,wO).call(this):R(this,lr,vO).call(this)),this._isCopy&&this._moveAfterPaste(e,r),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,r){let{id:i,bitmap:s}=this._uiManager.imageManager.getFromCanvas(e,r);r.remove(),i&&this._uiManager.imageManager.isValidId(i)&&(x(this,ki,i),s&&x(this,fn,s),x(this,p0,!1),R(this,lr,wO).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;l(this,hu)!==null&&clearTimeout(l(this,hu)),x(this,hu,setTimeout(()=>{x(this,hu,null),R(this,lr,S5).call(this)},200))}copyCanvas(e,r,i=!1){e||(e=224);let{width:s,height:a}=l(this,fn),o=new fu,c=l(this,fn),u=s,h=a,f=null;if(r){if(s>r||a>r){let C=Math.min(r/s,r/a);u=Math.floor(s*C),h=Math.floor(a*C)}f=document.createElement("canvas");let p=f.width=Math.ceil(u*o.sx),g=f.height=Math.ceil(h*o.sy);l(this,ho)||(c=R(this,lr,AO).call(this,p,g));let y=f.getContext("2d");y.filter=this._uiManager.hcmFilter;let b="white",m="#cfcfd8";this._uiManager.hcmFilter!=="none"?m="black":i4.isDarkMode&&(b="#8f8f9d",m="#42414d");let w=15,A=w*o.sx,_=w*o.sy,S=new OffscreenCanvas(A*2,_*2),I=S.getContext("2d");I.fillStyle=b,I.fillRect(0,0,A*2,_*2),I.fillStyle=m,I.fillRect(0,0,A,_),I.fillRect(A,_,A,_),y.fillStyle=y.createPattern(S,"repeat"),y.fillRect(0,0,p,g),y.drawImage(c,0,0,c.width,c.height,0,0,p,g)}let d=null;if(i){let p,g;if(o.symmetric&&c.width<e&&c.height<e)p=c.width,g=c.height;else if(c=l(this,fn),s>e||a>e){let m=Math.min(e/s,e/a);p=Math.floor(s*m),g=Math.floor(a*m),l(this,ho)||(c=R(this,lr,AO).call(this,p,g))}let b=new OffscreenCanvas(p,g).getContext("2d",{willReadFrequently:!0});b.drawImage(c,0,0,c.width,c.height,0,0,p,g),d={width:p,height:g,data:b.getImageData(0,0,p,g).data}}return{canvas:f,width:u,height:h,imageData:d}}static async deserialize(e,r,i){let s=null,a=!1;if(e instanceof KO){let{data:{rect:b,rotation:m,id:w,structParent:A,popupRef:_,richText:S,contentsObj:I,creationDate:C,modificationDate:M},container:z,parent:{page:{pageNumber:G}},canvas:Y}=e,L,j;Y?(delete e.canvas,{id:L,bitmap:j}=i.imageManager.getFromCanvas(z.id,Y),Y.remove()):(a=!0,e._hasNoCanvas=!0);let q=(await r._structTree.getAriaAttributes(`${Ew}${w}`))?.get("aria-label")||"";s=e={annotationType:Ie.STAMP,bitmapId:L,bitmap:j,pageIndex:G-1,rect:b.slice(0),rotation:m,annotationElementId:w,id:w,deleted:!1,accessibilityData:{decorative:!1,altText:q},isSvg:!1,structParent:A,popupRef:_,richText:S,comment:I?.str||null,creationDate:C,modificationDate:M}}let o=await super.deserialize(e,r,i),{rect:c,bitmap:u,bitmapUrl:h,bitmapId:f,isSvg:d,accessibilityData:p}=e;a?(i.addMissingCanvas(e.id,o),x(o,p0,!0)):f&&i.imageManager.isValidId(f)?(x(o,ki,f),u&&x(o,fn,u)):x(o,df,h),x(o,ho,d);let[g,y]=o.pageDimensions;return o.width=(c[2]-c[0])/g,o.height=(c[3]-c[1])/y,p&&(o.altTextData=p),o._initialData=s,e.comment&&o.setCommentData(e),x(o,ZA,!!s),o}serialize(e=!1,r=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let i=Object.assign(super.serialize(e),{bitmapId:l(this,ki),isSvg:l(this,ho)});if(this.addComment(i),e)return i.bitmapUrl=R(this,lr,EO).call(this,!0),i.accessibilityData=this.serializeAltText(!0),i.isCopy=!0,i;let{decorative:s,altText:a}=this.serializeAltText(!1);if(!s&&a&&(i.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){let c=R(this,lr,JK).call(this,i);return c.isSame?null:(c.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1,i.id=this.annotationElementId,delete i.bitmapId,i)}if(r===null)return i;r.stamps||(r.stamps=new Map);let o=l(this,ho)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(!r.stamps.has(l(this,ki)))r.stamps.set(l(this,ki),{area:o,serialized:i}),i.bitmap=R(this,lr,EO).call(this,!1);else if(l(this,ho)){let c=r.stamps.get(l(this,ki));o>c.area&&(c.area=o,c.serialized.bitmap.close(),c.serialized.bitmap=R(this,lr,EO).call(this,!1))}return i}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}};fn=new WeakMap,ki=new WeakMap,Cp=new WeakMap,df=new WeakMap,Rp=new WeakMap,KA=new WeakMap,pf=new WeakMap,p0=new WeakMap,hu=new WeakMap,ho=new WeakMap,ZA=new WeakMap,lr=new WeakSet,xS=function(e,r=!1){if(!e){this.remove();return}x(this,fn,e.bitmap),r||(x(this,ki,e.id),x(this,ho,e.isSvg)),e.file&&x(this,KA,e.file.name),R(this,lr,wO).call(this)},SS=function(){if(x(this,Cp,null),this._uiManager.enableWaiting(!1),!!l(this,pf)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&l(this,fn)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&l(this,fn)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},vO=function(){if(l(this,ki)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(l(this,ki)).then(i=>R(this,lr,xS).call(this,i,!0)).finally(()=>R(this,lr,SS).call(this));return}if(l(this,df)){let i=l(this,df);x(this,df,null),this._uiManager.enableWaiting(!0),x(this,Cp,this._uiManager.imageManager.getFromUrl(i).then(s=>R(this,lr,xS).call(this,s)).finally(()=>R(this,lr,SS).call(this)));return}if(l(this,Rp)){let i=l(this,Rp);x(this,Rp,null),this._uiManager.enableWaiting(!0),x(this,Cp,this._uiManager.imageManager.getFromFile(i).then(s=>R(this,lr,xS).call(this,s)).finally(()=>R(this,lr,SS).call(this)));return}let e=document.createElement("input");e.type="file",e.accept=TO.join(",");let r=this._uiManager._signal;x(this,Cp,new Promise(i=>{e.addEventListener("change",async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);let s=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),R(this,lr,xS).call(this,s)}i()},{signal:r}),e.addEventListener("cancel",()=>{this.remove(),i()},{signal:r})}).finally(()=>R(this,lr,SS).call(this))),e.click()},wO=function(){let{div:e}=this,{width:r,height:i}=l(this,fn),[s,a]=this.pageDimensions,o=.75;if(this.width)r=this.width*s,i=this.height*a;else if(r>o*s||i>o*a){let u=Math.min(o*s/r,o*a/i);r*=u,i*=u}this._uiManager.enableWaiting(!1);let c=x(this,pf,document.createElement("canvas"));c.setAttribute("role","img"),this.addContainer(c),this.width=r/s,this.height=i/a,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),R(this,lr,S5).call(this),l(this,ZA)||(this.parent.addUndoableEditor(this),x(this,ZA,!0)),this._reportTelemetry({action:"inserted_image"}),l(this,KA)&&this.div.setAttribute("aria-description",l(this,KA)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},AO=function(e,r){let{width:i,height:s}=l(this,fn),a=i,o=s,c=l(this,fn);for(;a>2*e||o>2*r;){let u=a,h=o;a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),o>2*r&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));let f=new OffscreenCanvas(a,o);f.getContext("2d").drawImage(c,0,0,u,h,0,0,a,o),c=f.transferToImageBitmap()}return c},S5=function(){let[e,r]=this.parentDimensions,{width:i,height:s}=this,a=new fu,o=Math.ceil(i*e*a.sx),c=Math.ceil(s*r*a.sy),u=l(this,pf);if(!u||u.width===o&&u.height===c)return;u.width=o,u.height=c;let h=l(this,ho)?l(this,fn):R(this,lr,AO).call(this,o,c),f=u.getContext("2d");f.filter=this._uiManager.hcmFilter,f.drawImage(h,0,0,h.width,h.height,0,0,o,c)},EO=function(e){if(e){if(l(this,ho)){let s=this._uiManager.imageManager.getSvgUrl(l(this,ki));if(s)return s}let r=document.createElement("canvas");return{width:r.width,height:r.height}=l(this,fn),r.getContext("2d").drawImage(l(this,fn),0,0),r.toDataURL()}if(l(this,ho)){let[r,i]=this.pageDimensions,s=Math.round(this.width*r*Ef.PDF_TO_CSS_UNITS),a=Math.round(this.height*i*Ef.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(s,a);return o.getContext("2d").drawImage(l(this,fn),0,0,l(this,fn).width,l(this,fn).height,0,0,s,a),o.transferToImageBitmap()}return structuredClone(l(this,fn))},JK=function(e){let{pageIndex:r,accessibilityData:{altText:i}}=this._initialData,s=e.pageIndex===r,a=(e.accessibilityData?.alt||"")===i;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&s&&a,isSameAltText:a}},Lt(ES,"_type","stamp"),Lt(ES,"_editorType",Ie.STAMP);Ml=class Ml{constructor({uiManager:t,pageIndex:e,div:r,structTreeLayer:i,accessibilityManager:s,annotationLayer:a,drawLayer:o,textLayer:c,viewport:u,l10n:h}){T(this,Xr);T(this,g0);T(this,JA,!1);T(this,Ip,null);T(this,Dp,null);T(this,gf,null);T(this,pa,new Map);T(this,Op,!1);T(this,QA,!1);T(this,tE,!1);T(this,Xl,null);T(this,mf,null);T(this,Mi,null);T(this,yf,null);T(this,Pp,null);T(this,eE,-1);T(this,me);let f=[...l(Ml,Np).values()];if(!Ml._initialized){Ml._initialized=!0;for(let d of f)d.initialize(h,t)}t.registerEditorTypes(f),x(this,me,t),this.pageIndex=e,this.div=r,x(this,g0,s),x(this,Ip,a),this.viewport=u,x(this,Mi,c),this.drawLayer=o,this._structTree=i,l(this,me).addLayer(this)}get isEmpty(){return l(this,pa).size===0}get isInvisible(){return this.isEmpty&&l(this,me).getMode()===Ie.NONE}updateToolbar(t){l(this,me).updateToolbar(t)}updateMode(t=l(this,me).getMode()){switch(R(this,Xr,xO).call(this),t){case Ie.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Ie.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Ie.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:e}=this.div;if(e.toggle("nonEditing",!1),t===Ie.POPUP)e.toggle("commentEditing",!0);else{e.toggle("commentEditing",!1);for(let r of l(Ml,Np).values())e.toggle(`${r._type}Editing`,t===r._editorType)}this.div.hidden=!1}hasTextLayer(t){return t===l(this,Mi)?.div}setEditingState(t){l(this,me).setEditingState(t)}addCommands(t){l(this,me).addCommands(t)}cleanUndoStack(t){l(this,me).cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){l(this,Ip)?.togglePointerEvents(t)}async enable(){x(this,tE,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),l(this,Pp)?.abort(),x(this,Pp,null);let t=new Set;for(let r of l(this,Xr,_5))r.enableEditing(),r.show(!0),r.annotationElementId&&(l(this,me).removeChangedExistingAnnotation(r),t.add(r.annotationElementId));let e=l(this,Ip);if(e)for(let r of e.getEditableAnnotations()){if(r.hide(),l(this,me).isDeletedAnnotationElement(r.data.id)||t.has(r.data.id))continue;let i=await this.deserialize(r);i&&(this.addOrRebuild(i),i.enableEditing())}x(this,tE,!1),l(this,me)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(x(this,QA,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),l(this,Mi)&&!l(this,Pp)){x(this,Pp,new AbortController);let i=l(this,me).combinedSignal(l(this,Pp));l(this,Mi).div.addEventListener("pointerdown",s=>{let{clientX:o,clientY:c,timeStamp:u}=s,h=l(this,eE);if(u-h>500){x(this,eE,u);return}x(this,eE,-1);let{classList:f}=this.div;f.toggle("getElements",!0);let d=document.elementsFromPoint(o,c);if(f.toggle("getElements",!1),!this.div.contains(d[0]))return;let p,g=new RegExp(`^${RS}[0-9]+$`);for(let b of d)if(g.test(b.id)){p=b.id;break}if(!p)return;let y=l(this,pa).get(p);y?.annotationElementId===null&&(s.stopPropagation(),s.preventDefault(),y.dblclick(s))},{signal:i,capture:!0})}let t=l(this,Ip),e=[];if(t){let i=new Map,s=new Map;for(let o of l(this,Xr,_5)){if(o.disableEditing(),!o.annotationElementId){e.push(o);continue}if(o.serialize()!==null){i.set(o.annotationElementId,o);continue}else s.set(o.annotationElementId,o);this.getEditableAnnotation(o.annotationElementId)?.show(),o.remove()}let a=t.getEditableAnnotations();for(let o of a){let{id:c}=o.data;if(l(this,me).isDeletedAnnotationElement(c)){o.updateEdited({deleted:!0});continue}let u=s.get(c);if(u){u.resetAnnotationElement(o),u.show(!1),o.show();continue}u=i.get(c),u&&(l(this,me).addChangedExistingAnnotation(u),u.renderAnnotationElement(o)&&u.show(!1)),o.show()}}R(this,Xr,xO).call(this),this.isEmpty&&(this.div.hidden=!0);let{classList:r}=this.div;for(let i of l(Ml,Np).values())r.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),t?.updateFakeAnnotations(e),x(this,QA,!1)}getEditableAnnotation(t){return l(this,Ip)?.getEditableAnnotation(t)||null}setActiveEditor(t){l(this,me).getActive()!==t&&l(this,me).setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,l(this,Mi)?.div&&!l(this,yf)){x(this,yf,new AbortController);let t=l(this,me).combinedSignal(l(this,yf));l(this,Mi).div.addEventListener("pointerdown",R(this,Xr,QK).bind(this),{signal:t}),l(this,Mi).div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,l(this,Mi)?.div&&l(this,yf)&&(l(this,yf).abort(),x(this,yf,null),l(this,Mi).div.classList.remove("highlighting"))}enableClick(){if(l(this,Dp))return;x(this,Dp,new AbortController);let t=l(this,me).combinedSignal(l(this,Dp));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});let e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){l(this,Dp)?.abort(),x(this,Dp,null)}attach(t){l(this,pa).set(t.id,t);let{annotationElementId:e}=t;e&&l(this,me).isDeletedAnnotationElement(e)&&l(this,me).removeDeletedAnnotationElement(t)}detach(t){l(this,pa).delete(t.id),l(this,g0)?.removePointerInTextLayer(t.contentDiv),!l(this,QA)&&t.annotationElementId&&l(this,me).addDeletedAnnotationElement(t)}remove(t){this.detach(t),l(this,me).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(l(this,me).addDeletedAnnotationElement(t),tn.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),l(this,me).addEditor(t),this.attach(t),!t.isAttachedToDOM){let e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!l(this,tE)),l(this,me).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;let{activeElement:e}=document;t.div.contains(e)&&!l(this,gf)&&(t._focusEventsAllowed=!1,x(this,gf,setTimeout(()=>{x(this,gf,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:l(this,me)._signal}),e.focus())},0))),t._structTreeParentId=l(this,g0)?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){let e=()=>t._uiManager.rebuild(t),r=()=>{t.remove()};this.addCommands({cmd:e,undo:r,mustExec:!1})}getEditorByUID(t){for(let e of l(this,pa).values())if(e.uid===t)return e;return null}getNextId(){return l(this,me).getId()}combinedSignal(t){return l(this,me).combinedSignal(t)}canCreateNewEmptyEditor(){return l(this,Xr,zc)?.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await l(this,me).updateMode(t.mode);let{offsetX:r,offsetY:i}=R(this,Xr,C5).call(this),s=this.getNextId(),a=R(this,Xr,T5).call(this,{parent:this,id:s,x:r,y:i,uiManager:l(this,me),isCentered:!0,...e});a&&this.add(a)}async deserialize(t){return await l(Ml,Np).get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,l(this,me))||null}createAndAddNewEditor(t,e,r={}){let i=this.getNextId(),s=R(this,Xr,T5).call(this,{parent:this,id:i,x:t.offsetX,y:t.offsetY,uiManager:l(this,me),isCentered:e,...r});return s&&this.add(s),s}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(t={}){this.createAndAddNewEditor(R(this,Xr,C5).call(this),!0,t)}setSelected(t){l(this,me).setSelected(t)}toggleSelected(t){l(this,me).toggleSelected(t)}unselect(t){l(this,me).unselect(t)}pointerup(t){let{isMac:e}=Bn.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div||!l(this,Op)||(x(this,Op,!1),l(this,Xr,zc)?.isDrawer&&l(this,Xr,zc).supportMultipleDrawings))return;if(!l(this,JA)){x(this,JA,!0);return}let r=l(this,me).getMode();if(r===Ie.STAMP||r===Ie.SIGNATURE){l(this,me).unselectAll();return}this.createAndAddNewEditor(t,!1)}pointerdown(t){if(l(this,me).getMode()===Ie.HIGHLIGHT&&this.enableTextSelection(),l(this,Op)){x(this,Op,!1);return}let{isMac:e}=Bn.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div)return;if(x(this,Op,!0),l(this,Xr,zc)?.isDrawer){this.startDrawingSession(t);return}let r=l(this,me).getActive();x(this,JA,!r||r.isEmpty())}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),l(this,Xl)){l(this,Xr,zc).startDrawing(this,l(this,me),!1,t);return}l(this,me).setCurrentDrawingSession(this),x(this,Xl,new AbortController);let e=l(this,me).combinedSignal(l(this,Xl));this.div.addEventListener("blur",({relatedTarget:r})=>{r&&!this.div.contains(r)&&(x(this,mf,null),this.commitOrRemove())},{signal:e}),l(this,Xr,zc).startDrawing(this,l(this,me),!1,t)}pause(t){if(t){let{activeElement:e}=document;this.div.contains(e)&&x(this,mf,e);return}l(this,mf)&&setTimeout(()=>{l(this,mf)?.focus(),x(this,mf,null)},0)}endDrawingSession(t=!1){return l(this,Xl)?(l(this,me).setCurrentDrawingSession(null),l(this,Xl).abort(),x(this,Xl,null),x(this,mf,null),l(this,Xr,zc).endDrawing(t)):null}findNewParent(t,e,r){let i=l(this,me).findParent(e,r);return i===null||i===this?!1:(i.changeParent(t),!0)}commitOrRemove(){return l(this,Xl)?(this.endDrawingSession(),!0):!1}onScaleChanging(){l(this,Xl)&&l(this,Xr,zc).onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),l(this,me).getActive()?.parent===this&&(l(this,me).commitOrRemove(),l(this,me).setActiveEditor(null)),l(this,gf)&&(clearTimeout(l(this,gf)),x(this,gf,null));for(let t of l(this,pa).values())l(this,g0)?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,l(this,pa).clear(),l(this,me).removeLayer(this)}render({viewport:t}){this.viewport=t,Lp(this.div,t);for(let e of l(this,me).getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:t}){l(this,me).commitOrRemove(),R(this,Xr,xO).call(this);let e=this.viewport.rotation,r=t.rotation;if(this.viewport=t,Lp(this.div,{rotation:r}),e!==r)for(let i of l(this,pa).values())i.rotate(r)}get pageDimensions(){let{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return l(this,me).viewParameters.realScale}};g0=new WeakMap,JA=new WeakMap,Ip=new WeakMap,Dp=new WeakMap,gf=new WeakMap,pa=new WeakMap,Op=new WeakMap,QA=new WeakMap,tE=new WeakMap,Xl=new WeakMap,mf=new WeakMap,Mi=new WeakMap,yf=new WeakMap,Pp=new WeakMap,eE=new WeakMap,me=new WeakMap,Np=new WeakMap,Xr=new WeakSet,_5=function(){return l(this,pa).size!==0?l(this,pa).values():l(this,me).getEditors(this.pageIndex)},QK=function(t){l(this,me).unselectAll();let{target:e}=t;if(e===l(this,Mi).div||(e.getAttribute("role")==="img"||e.classList.contains("endOfContent"))&&l(this,Mi).div.contains(e)){let{isMac:r}=Bn.platform;if(t.button!==0||t.ctrlKey&&r)return;l(this,me).showAllEditors("highlight",!0,!0),l(this,Mi).div.classList.add("free"),this.toggleDrawing(),tP.startHighlighting(this,l(this,me).direction==="ltr",{target:l(this,Mi).div,x:t.x,y:t.y}),l(this,Mi).div.addEventListener("pointerup",()=>{l(this,Mi).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:l(this,me)._signal}),t.preventDefault()}},zc=function(){return l(Ml,Np).get(l(this,me).getMode())},T5=function(t){let e=l(this,Xr,zc);return e?new e.prototype.constructor(t):null},C5=function(){let{x:t,y:e,width:r,height:i}=this.boundingClientRect,s=Math.max(0,t),a=Math.max(0,e),o=Math.min(window.innerWidth,t+r),c=Math.min(window.innerHeight,e+i),u=(s+o)/2-t,h=(a+c)/2-e,[f,d]=this.viewport.rotation%180===0?[u,h]:[h,u];return{offsetX:f,offsetY:d}},xO=function(){for(let t of l(this,pa).values())t.isEmpty()&&t.remove()},Lt(Ml,"_initialized",!1),T(Ml,Np,new Map([s5,m5,ES,tP,x5].map(t=>[t._editorType,t])));iP=Ml,gi=class gi{constructor({pageIndex:t}){T(this,du);T(this,ql,null);T(this,Bs,new Map);T(this,m0,new Map);this.pageIndex=t}setParent(t){if(!l(this,ql)){x(this,ql,t);return}if(l(this,ql)!==t){if(l(this,Bs).size>0)for(let e of l(this,Bs).values())e.remove(),t.append(e);x(this,ql,t)}}static get _svgFactory(){return Ce(this,"_svgFactory",new w0)}draw(t,e=!1,r=!1){let i=ze(gi,PT)._++,s=R(this,du,R5).call(this),a=gi._svgFactory.createElement("defs");s.append(a);let o=gi._svgFactory.createElement("path");a.append(o);let c=`path_p${this.pageIndex}_${i}`;o.setAttribute("id",c),o.setAttribute("vector-effect","non-scaling-stroke"),e&&l(this,m0).set(i,o);let u=r?R(this,du,eZ).call(this,a,c):null,h=gi._svgFactory.createElement("use");return s.append(h),h.setAttribute("href",`#${c}`),this.updateProperties(s,t),l(this,Bs).set(i,s),{id:i,clipPathId:`url(#${u})`}}drawOutline(t,e){let r=ze(gi,PT)._++,i=R(this,du,R5).call(this),s=gi._svgFactory.createElement("defs");i.append(s);let a=gi._svgFactory.createElement("path");s.append(a);let o=`path_p${this.pageIndex}_${r}`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke");let c;if(e){let f=gi._svgFactory.createElement("mask");s.append(f),c=`mask_p${this.pageIndex}_${r}`,f.setAttribute("id",c),f.setAttribute("maskUnits","objectBoundingBox");let d=gi._svgFactory.createElement("rect");f.append(d),d.setAttribute("width","1"),d.setAttribute("height","1"),d.setAttribute("fill","white");let p=gi._svgFactory.createElement("use");f.append(p),p.setAttribute("href",`#${o}`),p.setAttribute("stroke","none"),p.setAttribute("fill","black"),p.setAttribute("fill-rule","nonzero"),p.classList.add("mask")}let u=gi._svgFactory.createElement("use");i.append(u),u.setAttribute("href",`#${o}`),c&&u.setAttribute("mask",`url(#${c})`);let h=u.cloneNode();return i.append(h),u.classList.add("mainOutline"),h.classList.add("secondaryOutline"),this.updateProperties(i,t),l(this,Bs).set(r,i),r}finalizeDraw(t,e){l(this,m0).delete(t),this.updateProperties(t,e)}updateProperties(t,e){var c;if(!e)return;let{root:r,bbox:i,rootClass:s,path:a}=e,o=typeof t=="number"?l(this,Bs).get(t):t;if(o){if(r&&R(this,du,I5).call(this,o,r),i&&R(c=gi,SP,tZ).call(c,o,i),s){let{classList:u}=o;for(let[h,f]of Object.entries(s))u.toggle(h,f)}if(a){let h=o.firstElementChild.firstElementChild;R(this,du,I5).call(this,h,a)}}}updateParent(t,e){if(e===this)return;let r=l(this,Bs).get(t);r&&(l(e,ql).append(r),l(this,Bs).delete(t),l(e,Bs).set(t,r))}remove(t){l(this,m0).delete(t),l(this,ql)!==null&&(l(this,Bs).get(t).remove(),l(this,Bs).delete(t))}destroy(){x(this,ql,null);for(let t of l(this,Bs).values())t.remove();l(this,Bs).clear(),l(this,m0).clear()}};ql=new WeakMap,Bs=new WeakMap,m0=new WeakMap,PT=new WeakMap,SP=new WeakSet,tZ=function(t,[e,r,i,s]){let{style:a}=t;a.top=`${100*r}%`,a.left=`${100*e}%`,a.width=`${100*i}%`,a.height=`${100*s}%`},du=new WeakSet,R5=function(){let t=gi._svgFactory.create(1,1,!0);return l(this,ql).append(t),t.setAttribute("aria-hidden",!0),t},eZ=function(t,e){let r=gi._svgFactory.createElement("clipPath");t.append(r);let i=`clip_${e}`;r.setAttribute("id",i),r.setAttribute("clipPathUnits","objectBoundingBox");let s=gi._svgFactory.createElement("use");return r.append(s),s.setAttribute("href",`#${e}`),s.classList.add("clip"),i},I5=function(t,e){for(let[r,i]of Object.entries(e))i===null?t.removeAttribute(r):t.setAttribute(r,i)},T(gi,SP),T(gi,PT,0);sP=gi;globalThis._pdfjsTestingUtils={HighlightOutliner:jS};globalThis.pdfjsLib={AbortException:Kl,AnnotationEditorLayer:iP,AnnotationEditorParamsType:tr,AnnotationEditorType:Ie,AnnotationEditorUIManager:kp,AnnotationLayer:ZO,AnnotationMode:bf,AnnotationType:Vn,applyOpacity:cY,build:cK,ColorPicker:MS,createValidAbsoluteUrl:D5,CSSConstants:CO,DOMSVGFactory:w0,DrawLayer:sP,FeatureTest:Bn,fetchData:oE,findContrastColor:uY,getDocument:sK,getFilenameFromUrl:aY,getPdfFilenameFromUrl:oY,getRGB:lE,getUuid:P5,getXfaPageViewport:lY,GlobalWorkerOptions:al,ImageKind:_S,InvalidPDFException:nE,isDataScheme:kT,isPdfFile:CP,isValidExplicitDest:WY,MathClamp:As,noContextMenu:yo,normalizeUnicode:iY,OPS:rE,OutputScale:fu,PasswordResponses:rY,PDFDataRangeTransport:kS,PDFDateString:y0,PDFWorker:aE,PermissionFlag:eY,PixelsPerInch:Ef,RenderingCancelledException:iE,renderRichText:N5,ResponseException:b0,setLayerDimensions:Lp,shadow:Ce,SignatureExtractor:ol,stopEvent:wn,SupportedImageMimeTypes:TO,TextLayer:sE,TouchManager:PS,updateUrlHash:O5,Util:se,VerbosityLevel:NT,version:lK,XfaLayer:DS}});var Xft={};tc(Xft,{OfficeParser:()=>S0,default:()=>Gft,parseOffice:()=>Wft});Tt();Rt();Ct();Tt();Rt();Ct();var cZ=jp(R7());OE();Tt();Rt();Ct();Tt();Rt();Ct();Tt();Rt();Ct();var EH=jp(tR()),ur=n=>new EH.DOMParser().parseFromString(n,"text/xml"),kt=(n,t)=>Array.from(n.getElementsByTagName(t)),Fi=(n,t)=>{let e=[];if(!n.childNodes)return e;for(let r=0;r<n.childNodes.length;r++){let i=n.childNodes[r];i.nodeType===1&&i.tagName===t&&e.push(i)}return e},jf=n=>{let t=ur(n),e={},r=kt(t,"cp:coreProperties")[0];if(r){let s=kt(r,"dc:title")[0];s&&s.textContent&&(e.title=s.textContent);let a=kt(r,"dc:creator")[0];a&&a.textContent&&(e.author=a.textContent);let o=kt(r,"cp:lastModifiedBy")[0];o&&o.textContent&&(e.lastModifiedBy=o.textContent);let c=kt(r,"dcterms:created")[0];c&&c.textContent&&(e.created=new Date(c.textContent));let u=kt(r,"dcterms:modified")[0];return u&&u.textContent&&(e.modified=new Date(u.textContent)),e}let i=kt(t,"office:meta")[0];if(i){let s=kt(i,"dc:title")[0];s&&s.textContent&&(e.title=s.textContent);let a=kt(i,"dc:creator")[0];a&&a.textContent&&(e.author=a.textContent);let o=kt(i,"dc:description")[0];o&&o.textContent&&(e.description=o.textContent);let c=kt(i,"dc:subject")[0];c&&c.textContent&&(e.subject=c.textContent);let u=kt(i,"meta:creation-date")[0];u&&u.textContent&&(e.created=new Date(u.textContent));let h=kt(i,"dc:date")[0];h&&h.textContent&&(e.modified=new Date(h.textContent))}return e};var GE=(n,t)=>{let e=n.localName===t||n.tagName===t?n:n.getElementsByTagName(t)[0];if(!e)return;let r=e.getElementsByTagName("c:rich"),i=e.getElementsByTagName("a:p"),s=r.length>0?Array.from(r):Array.from(i);if(s.length>0){let o="";for(let c of s){let u=c.getElementsByTagName("a:t");for(let h=0;h<u.length;h++)o+=(u[h].textContent||"")+" "}if(o.trim())return o.trim()}let a=e.getElementsByTagName("c:v")[0];if(a&&a.textContent)return a.textContent.trim()||void 0},Est=n=>{let t=n.toString("utf8"),r=ur(t).documentElement,i=GE(r,"c:title"),s,a,o=r.getElementsByTagName("c:catAx");o.length>0&&(s=GE(o[0],"c:title"));let c=r.getElementsByTagName("c:valAx");c.length>0&&(a=GE(c[0],"c:title"));let u=r.getElementsByTagName("c:ser"),h=[],f=[];for(let p=0;p<u.length;p++){let g=u[p],y=GE(g,"c:tx"),b=[],m=g.getElementsByTagName("c:val")[0]||g.getElementsByTagName("c:yVal")[0];if(m){let S=m.getElementsByTagName("c:v");for(let I=0;I<S.length;I++){let C=S[I].textContent?.trim();C&&b.push(C)}}let w=[],A=g.getElementsByTagName("c:dLbl");for(let S=0;S<A.length;S++){let I=GE(A[S],"c:tx");I&&w.push(I)}let _=g.getElementsByTagName("c:cat")[0]||g.getElementsByTagName("c:xVal")[0];if(_){let S=_.getElementsByTagName("c:v"),I=[];for(let C=0;C<S.length;C++){let M=S[C].textContent?.trim();M&&I.push(M)}I.length>0&&f.length===0&&f.push(...I)}h.push({name:y,values:b,pointLabels:w})}let d=[];for(let p of h)p.name&&d.push(p.name),d.push(...f),d.push(...p.values);return{title:i,xAxisTitle:s,yAxisTitle:a,dataSets:h,labels:f,rawTexts:d}},xst=n=>{let t=n.toString("utf8"),e=ur(t),r=kt(e,"chart:chart")[0]||e.documentElement,i=kt(r,"chart:title")[0],s=i&&kt(i,"text:p")[0]?.textContent||void 0,a=kt(r,"table:table")[0],o=[],c=[],u=[];if(a){let p=[],g=Fi(a,"table:table-header-rows")[0];if(g&&p.push(...Fi(g,"table:table-row")),p.push(...Fi(a,"table:table-row")),p.length>0){let y=Fi(p[0],"table:table-cell");for(let b=1;b<y.length;b++){let m=parseInt(y[b].getAttribute("table:number-columns-repeated")||"1"),w=Fi(y[b],"text:p")[0]?.textContent||void 0;for(let A=0;A<m;A++)o.push({name:w,values:[],pointLabels:[]})}for(let b=1;b<p.length;b++){let m=Fi(p[b],"table:table-cell");if(m.length>0){let w=Fi(m[0],"text:p")[0]?.textContent||void 0;w&&c.push(w);let A=0;for(let _=1;_<m.length;_++){let S=parseInt(m[_].getAttribute("table:number-columns-repeated")||"1"),I=m[_].getAttribute("office:value")||Fi(m[_],"text:p")[0]?.textContent||"";for(let C=0;C<S;C++)o[A]&&o[A].values.push(I),A++}}}}}else{let p=kt(r,"chart:series");for(let y of p){let b=y.getAttribute("chart:label-cell-address"),m=y.getAttribute("chart:values-cell-range-address"),w,A=kt(y,"text:p");A.length>0&&(w=A[0].textContent||void 0),!w&&b&&(w=`Series ${b.split(".").pop()?.replace(/\$/g,"")||b}`);let _={name:w,values:[],pointLabels:[]};m&&_.values.push(`[${m}]`),o.push(_)}let g=kt(r,"chart:categories")[0];if(g){let y=g.getAttribute("table:cell-range-address");y&&c.push(`[${y}]`)}}let h=kt(e,"chart:axis"),f,d;for(let p of h){let g=p.getAttribute("chart:dimension"),y=kt(p,"chart:title")[0],b=y&&kt(y,"text:p")[0]?.textContent||void 0;g==="x"?f=b:g==="y"&&(d=b)}s&&u.push(s);for(let p of o)p.name&&u.push(p.name),u.push(...c),u.push(...p.values);return{title:s,xAxisTitle:f,yAxisTitle:d,dataSets:o,labels:c,rawTexts:u}},ug=n=>n.toString("utf8",0,500).includes("urn:oasis:names:tc:opendocument:xmlns:chart:1.0")?xst(n):Est(n);Tt();Rt();Ct();var sb="[OfficeParser]: ";var Sst={EXTENSION_UNSUPPORTED:n=>`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 ${n} files. Stay tuned for further updates.`,FILE_CORRUPTED:n=>`Your file ${n} 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:n=>`File ${n} 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:n=>`Entered location ${n} 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.'},xH=(n,t)=>{let e=Sst[n];return typeof e=="function"?e(t):e},Ou=(n,t,e)=>{let r=xH(n,e);return t.outputErrorToConsole&&console.error(sb+r),new Error(sb+r)},SH=(n,t,e)=>{let r=n.message||n;return e&&(r.includes("end of central directory record")||r.includes("invalid XML")||r.includes("Failed to open zip file")||r.includes("invalid distance too far back"))&&(r=xH("FILE_CORRUPTED",e)),t.outputErrorToConsole&&console.error(sb+r),new Error(sb+r)},Ks=(n,t,e)=>{t.outputErrorToConsole&&(e?console.warn(sb+n,e):console.warn(sb+n))};Tt();Rt();Ct();var _st=n=>{switch(n.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"}},Tst=n=>{if(!(n.length<4)){if(n[0]===137&&n[1]===80&&n[2]===78&&n[3]===71)return"image/png";if(n[0]===255&&n[1]===216&&n[2]===255)return"image/jpeg";if(n[0]===71&&n[1]===73&&n[2]===70&&n[3]===56)return"image/gif";if(n[0]===66&&n[1]===77)return"image/bmp";if(n[0]===73&&n[1]===73&&n[2]===42&&n[3]===0||n[0]===77&&n[1]===77&&n[2]===0&&n[3]===42)return"image/tiff";if(n.length>=12&&n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&n[8]===87&&n[9]===69&&n[10]===66&&n[11]===80)return"image/webp"}},gl=(n,t)=>{let e=n.split(".").pop()||"",r=Tst(t);return r||(r=_st(e)),{type:"image",mimeType:r,data:t.toString("base64"),name:n,extension:e}};Tt();Rt();Ct();var pz=jp(dz()),So=async(n,t="eng")=>{let e=await(0,pz.createWorker)(t,1,{logger:()=>{}}),r=n;typeof window<"u"&&typeof Blob<"u"&&Buffer.isBuffer(n)&&(r=new Blob([n],{type:"image/bmp"}));let i=await e.recognize(r);return await e.terminate(),i.data.text};Tt();Rt();Ct();var cV=jp(XW()),uV=jp(lV()),qf=(n,t)=>new Promise((e,r)=>{cV.default.fromBuffer(n,{lazyEntries:!0},(i,s)=>{if(i)return r(i);if(!s)return r(new Error("Failed to open zip file"));let a=[];s.readEntry(),s.on("entry",o=>{t(o.fileName)?s.openReadStream(o,(c,u)=>{if(c)return r(c);if(!u)return r(new Error("Failed to open read stream"));u.pipe((0,uV.default)(h=>{a.push({path:o.fileName,content:h}),s.readEntry()}))}):s.readEntry()}),s.on("end",()=>e(a)),s.on("error",r)})});var hV=async(n,t)=>{let e=/xl\/worksheets\/sheet\d+.xml/g,r=/xl\/drawings\/drawing\d+.xml/g,i=/xl\/charts\/chart\d+.xml/g,s="xl/sharedStrings.xml",a=/xl\/media\/.*/,o=/docProps\/core\.xml/,c=/xl\/worksheets\/_rels\/sheet\d+\.xml\.rels/g,u=/xl\/drawings\/_rels\/drawing\d+\.xml\.rels/g,h=await qf(n,L=>!!L.match(e)||!!L.match(r)||!!L.match(i)||L===s||L==="xl/styles.xml"||L==="xl/workbook.xml"||L==="xl/_rels/workbook.xml.rels"||!!L.match(o)||!!t.extractAttachments&&(!!L.match(a)||!!L.match(c)||!!L.match(u))),f=h.find(L=>L.path===s),d=[];if(f){let L=ur(f.content.toString()),j=kt(L,"si");for(let q of j){let nt=kt(q,"r");if(nt.length>0){let J=[];for(let N of nt){let D=kt(N,"t")[0];if(D){let F=D.textContent||"",P=kt(N,"rPr")[0],V={};if(P){kt(P,"b").length>0&&(V.bold=!0),kt(P,"i").length>0&&(V.italic=!0),kt(P,"u").length>0&&(V.underline=!0),kt(P,"strike").length>0&&(V.strikethrough=!0);let $=kt(P,"sz")[0];$&&(V.size=$.getAttribute("val")+"pt");let H=kt(P,"color")[0];if(H){let ft=H.getAttribute("rgb");ft&&(V.color="#"+ft.substring(2))}let rt=kt(P,"rFont")[0];rt&&(V.font=rt.getAttribute("val")||void 0);let lt=kt(P,"vertAlign")[0];if(lt){let ft=lt.getAttribute("val");ft==="subscript"&&(V.subscript=!0),ft==="superscript"&&(V.superscript=!0)}}J.push({type:"text",text:F,formatting:Object.keys(V).length>0?V:void 0})}}d.push(J)}else{let J=kt(q,"t"),N="";for(let D of J)N+=D.textContent||"";d.push(N)}}}let p=h.find(L=>L.path==="xl/styles.xml"),g={};if(p){let L=ur(p.content.toString()),j=kt(L,"fonts")[0],q=[];if(j){let D=kt(j,"font");for(let F of D){let P={};kt(F,"b").length>0&&(P.bold=!0),kt(F,"i").length>0&&(P.italic=!0),kt(F,"u").length>0&&(P.underline=!0),kt(F,"strike").length>0&&(P.strikethrough=!0);let V=kt(F,"sz")[0];if(V){let lt=V.getAttribute("val");lt&&(P.size=lt+"pt")}let $=kt(F,"color")[0];if($){let lt=$.getAttribute("rgb");lt&&(P.color="#"+lt.substring(2))}let H=kt(F,"name")[0];if(H){let lt=H.getAttribute("val");lt&&(P.font=lt)}let rt=kt(F,"vertAlign")[0];if(rt){let lt=rt.getAttribute("val");lt==="subscript"&&(P.subscript=!0),lt==="superscript"&&(P.superscript=!0)}q.push(P)}}let nt=kt(L,"fills")[0],J=[];if(nt){let D=kt(nt,"fill");for(let F of D){let P={},V=kt(F,"patternFill")[0];if(V){let $=kt(V,"fgColor")[0];if($){let H=$.getAttribute("rgb"),rt=$.getAttribute("theme");if(H&&H!=="00000000")P.backgroundColor="#"+H.substring(2);else if(rt){let lt=parseInt(rt);lt===0?P.backgroundColor="#FFFFFF":lt===1?P.backgroundColor="#000000":lt===2?P.backgroundColor="#EEECE1":lt===3&&(P.backgroundColor="#1F497D")}}}J.push(P)}}let N=kt(L,"cellXfs")[0];if(N){let D=kt(N,"xf");for(let F=0;F<D.length;F++){let P=D[F],V={},$=P.getAttribute("fontId");if($){let lt=parseInt($);q[lt]&&Object.assign(V,q[lt])}let H=P.getAttribute("fillId");if(H){let lt=parseInt(H);J[lt]&&J[lt].backgroundColor&&(V.backgroundColor=J[lt].backgroundColor)}let rt=kt(P,"alignment")[0];if(rt){let lt=rt.getAttribute("horizontal");(lt==="center"||lt==="right"||lt==="justify"||lt==="left")&&(V.alignment=lt)}g[F]=V}}}let y=[],b=h.filter(L=>L.path.match(/xl\/media\/.*/)),m=h.filter(L=>L.path.match(i)),w={};if(t.extractAttachments){let L=h.filter(q=>q.path.match(u));for(let q of L){let J=`xl/drawings/${q.path.split("/").pop()?.replace(".rels","")||""}`,N=ur(q.content.toString()),D=kt(N,"Relationship");w[J]||(w[J]={});for(let F of D){let P=F.getAttribute("Id"),V=F.getAttribute("Target");if(P&&V&&V.includes("media/")){let $="xl/"+V.replace("../","");w[J][P]={path:$}}}}let j=h.filter(q=>q.path.match(r));for(let q of j){let nt=ur(q.content.toString()),J=kt(nt,"xdr:pic"),N=w[q.path]||{};for(let D of J){let F=kt(D,"xdr:blipFill")[0],P=F?kt(F,"a:blip")[0]:null,V=P?P.getAttribute("r:embed"):null,$=kt(D,"xdr:nvPicPr")[0],H=$?kt($,"xdr:cNvPr")[0]:null,rt=H?H.getAttribute("descr")||H.getAttribute("name"):void 0;V&&N[V]&&(N[V].altText=rt||"")}}for(let q of b){let nt=gl(q.path.split("/").pop()||"image",q.content),J="";for(let N in w){for(let D in w[N])if(w[N][D].path===q.path){J=w[N][D].altText||"";break}if(J)break}if(J&&(nt.altText=J),y.push(nt),t.ocr&&nt.mimeType.startsWith("image/"))try{let N=await So(q.content,t.ocrLanguage);N.trim()&&(nt.ocrText=N.trim())}catch(N){Ks(`OCR failed for ${nt.name}:`,t,N)}}for(let q of m){let nt={type:"chart",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",data:q.content.toString("base64"),name:q.path.split("/").pop()||"",extension:"xml"};try{let J=ug(q.content);nt.chartData=J}catch(J){Ks(`Failed to extract chart data from ${q.path}:`,t,J)}y.push(nt)}}let A={};if(t.extractAttachments){let L=h.filter(j=>j.path.match(u));for(let j of L){let nt=`xl/drawings/${j.path.split("/").pop()?.replace(".rels","")||""}`,J=ur(j.content.toString()),N=kt(J,"Relationship");A[nt]||(A[nt]={});for(let D of N){let F=D.getAttribute("Id"),P=D.getAttribute("Target"),V=D.getAttribute("Type");if(F&&P&&V&&V.includes("chart")){let $=P.split("/").pop()||"";A[nt][F]=$}}}}let _={},S=h.find(L=>L.path==="xl/workbook.xml"),I=h.find(L=>L.path==="xl/_rels/workbook.xml.rels");if(S&&I){let L=ur(I.content.toString()),j=kt(L,"Relationship"),q={};for(let N of j){let D=N.getAttribute("Id"),F=N.getAttribute("Target");if(D&&F){let P=F.split("/").pop()||"";q[D]=P}}let nt=ur(S.content.toString()),J=kt(nt,"sheet");for(let N of J){let D=N.getAttribute("name"),F=N.getAttribute("r:id");D&&F&&q[F]&&(_[q[F]]=D)}}let C=[],M=[];for(let L of h)if(!L.path.match(a)&&L.path!==s&&L.path!=="xl/styles.xml"&&!L.path.match(r)&&!L.path.match(i)&&!L.path.match(c)&&!L.path.match(u)&&L.path.match(e)){t.includeRawContent&&M.push(L.content.toString());let j=[],q=/<row.*?>[\s\S]*?<\/row>/g,nt=L.content.toString().match(q);if(nt)for(let D of nt){let F=[],P=/<c.*?>[\s\S]*?<\/c>/g,V=D.match(P),$=D.match(/r="(\d+)"/),H=$?parseInt($[1])-1:0;if(V)for(let rt of V){let lt=rt.match(/t="([a-z]+)"/),ft=lt?lt[1]:"n",K=rt.match(/<v>(.*?)<\/v>/),X=rt.match(/<t>(.*?)<\/t>/),st="",bt=[];if(ft==="s"&&K){let at=parseInt(K[1]),pt=d[at];Array.isArray(pt)?(bt=JSON.parse(JSON.stringify(pt)),st=bt.map(_t=>_t.text).join("")):st=pt||""}else ft==="inlineStr"&&X?st=X[1]:K&&(st=K[1]);let wt=rt.match(/r="([A-Z]+)(\d+)"/),W=(wt?wt[1]:"").charCodeAt(0)-65;if(st||bt.length>0){let at=rt.match(/s="(\d+)"/),pt=at?parseInt(at[1]):void 0,_t=pt!==void 0&&g[pt]?g[pt]:{};if(bt.length>0)for(let gt of bt)gt.formatting||(gt.formatting={}),_t.backgroundColor&&(gt.formatting.backgroundColor=_t.backgroundColor),_t.alignment&&(gt.formatting.alignment=_t.alignment),!gt.formatting.font&&_t.font&&(gt.formatting.font=_t.font),!gt.formatting.size&&_t.size&&(gt.formatting.size=_t.size);else bt.push({type:"text",text:st,formatting:_t});let At={type:"cell",text:st,children:bt,metadata:{row:H,col:W}};t.includeRawContent&&(At.rawContent=rt),F.push(At)}}if(F.length>0){let rt={type:"row",children:F,metadata:void 0};t.includeRawContent&&(rt.rawContent=D),j.push(rt)}}if(t.extractAttachments){let F=`xl/worksheets/_rels/${L.path.split("/").pop()||""}.rels`,P=h.find(H=>H.path===F),V={};if(P){let H=ur(P.content.toString()),rt=kt(H,"Relationship");for(let lt of rt){let ft=lt.getAttribute("Id"),K=lt.getAttribute("Target"),X=lt.getAttribute("Type");ft&&K&&X&&X.includes("drawing")&&(V[ft]="xl/drawings/"+K.replace("../drawings/",""))}}let $=L.content.toString().match(/<drawing r:id="(.*?)"/g);if($)for(let H of $){let rt=H.match(/r:id="(.*?)"/),lt=rt?rt[1]:null;if(lt&&V[lt]){let ft=V[lt],K=w[ft];if(K)for(let st in K){let bt=K[st],wt=y.find(Q=>Q.name===bt.path.split("/").pop());if(wt){let Q={type:"image",text:"",children:[],metadata:{attachmentName:wt.name||"unknown",altText:bt.altText||void 0}};j.push(Q)}}let X=A[ft];if(X)for(let st in X){let bt=X[st];if(y.find(Q=>Q.name===bt)){let Q={type:"chart",text:"",children:[],metadata:{attachmentName:bt}};j.push(Q)}}}}}let J=L.path.split("/").pop()||"Sheet",N=_[J]||J;C.push({type:"sheet",children:j,metadata:{sheetName:N},rawContent:t.includeRawContent?L.content.toString():void 0})}let z=h.find(L=>L.path.match(o)),G=z?jf(z.content.toString()):{},Y=L=>{for(let j of L){if("attachmentName"in(j.metadata||{})){let q=j.metadata,nt=y.find(J=>J.name===q.attachmentName);nt&&(j.type==="image"&&(nt.ocrText&&(j.text=nt.ocrText),q.altText&&(nt.altText=q.altText)),j.type==="chart"&&nt.chartData&&(j.text=nt.chartData.rawTexts.join(t.newlineDelimiter||`
118
+ `)))}j.children&&Y(j.children)}};return Y(C),{type:"xlsx",metadata:G,content:C,attachments:y,toText:()=>C.map(L=>{let j=q=>{let nt="";return q.children?nt+=q.children.map(j).filter(J=>J!="").join(q.children[0]?.children?t.newlineDelimiter??`
119
+ `:""):nt+=q.text||"",nt};return j(L)}).filter(L=>L!="").join(t.newlineDelimiter??`
120
+ `)}};Tt();Rt();Ct();var fV=async(n,t)=>{let e=/content\.xml/,r=/Object \d+\/content\.xml/,i=/(Pictures|media)\/.*/,s=/meta\.xml/,a=/styles\.xml/,o=/mimetype/,c=await qf(n,q=>!!q.match(e)||!!q.match(r)||!!q.match(s)||!!q.match(a)||!!q.match(o)||!!t.extractAttachments&&!!q.match(i)),u=c.find(q=>q.path==="mimetype"),h="odt";if(u){let q=u.content.toString().trim();q.includes("spreadsheet")?h="ods":q.includes("presentation")?h="odp":q.includes("text")&&(h="odt")}let f=c.find(q=>q.path==="content.xml")||c.find(q=>q.path.match(e)),d=c.find(q=>q.path==="styles.xml"),p=[],g=[],y={},b={},m={};d&&(q=>{let nt=ur(q),J=kt(nt,"style:style");for(let N of J){let D=N.getAttribute("style:name");if(!D)continue;let F={},P=kt(N,"style:paragraph-properties")[0];if(P){let rt=P.getAttribute("fo:text-align");if(rt){let ft={start:"left",left:"left",center:"center",end:"right",right:"right",justify:"justify"};ft[rt]&&(F.alignment=ft[rt])}kt(P,"style:drop-cap")[0]&&(F.dropCap=!0)}Object.keys(F).length>0&&(b[D]=F);let V=kt(N,"style:text-properties")[0],$=kt(N,"style:table-cell-properties")[0],H={};if($){let rt=$.getAttribute("fo:background-color");rt&&rt!=="transparent"&&(H.backgroundColor=rt)}if(V){(V.getAttribute("fo:font-weight")==="bold"||V.getAttribute("style:font-weight-asian")==="bold")&&(H.bold=!0),(V.getAttribute("fo:font-style")==="italic"||V.getAttribute("style:font-style-asian")==="italic")&&(H.italic=!0),V.getAttribute("style:text-underline-style")==="solid"&&(H.underline=!0),V.getAttribute("style:text-line-through-style")==="solid"&&(H.strikethrough=!0);let rt=V.getAttribute("fo:font-size")||V.getAttribute("style:font-size-asian");rt&&(H.size=rt);let lt=V.getAttribute("fo:color");lt&&(H.color=lt);let ft=V.getAttribute("fo:background-color");ft&&ft!=="transparent"&&(H.backgroundColor=ft);let K=V.getAttribute("style:font-name")||V.getAttribute("fo:font-family");K&&(H.font=K);let X=V.getAttribute("style:text-position");X&&(X.startsWith("sub")&&(H.subscript=!0),X.startsWith("super")&&(H.superscript=!0)),Object.keys(H).length>0&&(y[D]=H)}}})(d.content.toString());let A=(q,nt,J,N,D,F={},P)=>{let V=[],$="";if(!q.childNodes)return{text:"",children:[]};for(let H=0;H<q.childNodes.length;H++){let rt=q.childNodes[H];if(rt.nodeType===3){let lt=rt.textContent||"";lt&&($+=lt,V.push({type:"text",text:lt,formatting:F,metadata:P?{...P}:void 0}))}else if(rt.nodeType===1){let lt=rt,ft=lt.tagName;if(ft==="text:s"){let K=parseInt(lt.getAttribute("text:c")||"1"),X=" ".repeat(K);$+=X,V.push({type:"text",text:X,formatting:F,metadata:P?{...P}:void 0})}else if(ft==="text:tab")$+=" ",V.push({type:"text",text:" ",formatting:F,metadata:P?{...P}:void 0});else if(ft==="text:line-break")$+=`
121
+ `,V.push({type:"text",text:`
122
+ `,formatting:F,metadata:P?{...P}:void 0});else if(ft==="text:span"){let K=lt.getAttribute("text:style-name"),X=K?{...F,...nt[K]}:F,st=A(lt,nt,J,N,D,X,P);$+=st.text,V.push(...st.children)}else if(ft==="text:a"){let K=lt.getAttribute("xlink:href")||"",X=K.startsWith("#")?"internal":"external",bt=A(lt,nt,J,N,D,F,{link:K,linkType:X});$+=bt.text,V.push(...bt.children)}else if(ft==="text:note"&&!J.ignoreNotes){let K=lt.getAttribute("text:note-class")||"footnote",X=lt.getAttribute("text:id")||lt.getAttribute("xml:id")||void 0,st=kt(lt,"text:note-body")[0];if(st){let bt=kt(st,"text:p"),wt=[],Q="";for(let at of bt){let pt=_(at,D,nt,J);Q+=(Q?" ":"")+pt.text;let _t={type:"paragraph",text:pt.text,children:pt.children,metadata:pt.alignment?{alignment:pt.alignment}:void 0};wt.push(_t)}let W={type:"note",text:Q,children:wt,metadata:{noteType:K,noteId:X}};J.putNotesAtLast?N.push(W):V.push(W)}}else if(ft==="draw:frame"){let K=lt,X="",st=kt(K,"svg:title")[0],bt=kt(K,"svg:desc")[0];st&&st.textContent?X=st.textContent:bt&&bt.textContent&&(X=bt.textContent);let wt="",Q=kt(K,"draw:image");if(Q.length>0&&(wt=Q[0].getAttribute("xlink:href")||"",wt)){let at=wt.split("/");wt=at[at.length-1]}let W={type:"image",text:"",children:[],metadata:{attachmentName:wt,...X?{altText:X}:{}}};J.includeRawContent&&(W.rawContent=K.toString()),V.push(W)}}}return{text:$,children:V}},_=(q,nt,J,N)=>{let D=q.getAttribute("text:style-name"),F=D?nt[D]:void 0,P=F?.alignment,V=F?.dropCap,$=A(q,J,N,g,nt);if(D&&$.children.forEach(H=>{if(H.type==="text"){H.metadata||(H.metadata={});let rt=H.metadata;rt.style||(rt.style=D)}}),$.children.length===0&&q.textContent){let H=q.textContent;H.trim()&&($.text=H,$.children.push({type:"text",text:H}))}if(V&&$.children.length>0){let H=$.children[0];if(H.type==="text"&&H.text)if(H.text.length===1)H.formatting={...H.formatting,size:"58.5pt"};else{let rt=H.text[0],lt=H.text.substring(1),ft={type:"text",text:rt,formatting:{...H.formatting,size:"58.5pt"},metadata:H.metadata};H.text=lt,$.children.unshift(ft)}}return{text:$.text,children:$.children,alignment:P,style:D||void 0}},S=(q,nt,J,N)=>{let D=[],F=Fi(q,"table:table-row"),P=0;for(let V of F){let $=[],H=Fi(V,"table:table-cell"),rt=parseInt(V.getAttribute("table:number-rows-repeated")||"1"),lt=0;for(let ft of H){let K=[],X={value:""},st=parseInt(ft.getAttribute("table:number-columns-repeated")||"1"),bt=parseInt(ft.getAttribute("table:number-columns-spanned")||"1"),wt=parseInt(ft.getAttribute("table:number-rows-spanned")||"1"),Q=at=>{if(at.childNodes)for(let pt=0;pt<at.childNodes.length;pt++){let _t=at.childNodes[pt];if(_t.nodeType===1){let At=_t;if(At.tagName==="text:p"||At.tagName==="text:h"){let gt=_(At,nt,J,N),xt={type:At.tagName==="text:h"?"heading":"paragraph",text:gt.text,children:gt.children,metadata:{...gt.alignment?{alignment:gt.alignment}:{},...gt.style?{style:gt.style}:{}}};Object.keys(xt.metadata||{}).length===0&&delete xt.metadata,At.tagName==="text:h"&&(xt.metadata||(xt.metadata={}),xt.metadata.level=parseInt(At.getAttribute("text:outline-level")||"1")),N.includeRawContent&&(xt.rawContent=At.toString()),K.push(xt),X.value+=gt.text,X.value&&!X.value.endsWith(`
123
+ `)&&(X.value+=`
124
+ `)}else if(At.tagName==="table:table"){let gt=S(At,nt,J,N);K.push(gt)}else(At.tagName==="draw:frame"||At.tagName==="draw:text-box")&&Q(At)}}};Q(ft);let W=X.value;W.endsWith(`
125
+ `)&&(W=W.slice(0,-1));for(let at=0;at<st;at++){let pt={type:"cell",text:W,children:K.length>0?at===0?K:JSON.parse(JSON.stringify(K)):[],metadata:{row:P,col:lt}},_t=pt.metadata;bt>1&&(_t.colSpan=bt),wt>1&&(_t.rowSpan=wt),N.includeRawContent&&(pt.rawContent=ft.toString()),$.push(pt),lt++}}for(let ft=0;ft<rt;ft++){let K={type:"row",children:ft===0?$:JSON.parse(JSON.stringify($))};ft>0&&K.children?.forEach(X=>{X.metadata&&"row"in X.metadata&&(X.metadata.row=P)}),N.includeRawContent&&(K.rawContent=V.toString()),D.push(K),P++}}return{type:"table",children:D}};f&&(q=>{let nt=ur(q),J=kt(nt,"office:body")[0],N=kt(nt,"office:automatic-styles")[0];if(N){let F=kt(N,"style:style");for(let P of F){let V=P.getAttribute("style:name");if(!V)continue;let $=kt(P,"style:paragraph-properties")[0],H={};if($){let lt=$.getAttribute("fo:text-align");if(lt){let K={start:"left",left:"left",center:"center",end:"right",right:"right",justify:"justify"};K[lt]&&(H.alignment=K[lt])}kt($,"style:drop-cap")[0]&&(H.dropCap=!0)}Object.keys(H).length>0&&(b[V]=H);let rt=kt(P,"style:text-properties")[0];if(rt){let lt={};(rt.getAttribute("fo:font-weight")==="bold"||rt.getAttribute("style:font-weight-asian")==="bold")&&(lt.bold=!0),(rt.getAttribute("fo:font-style")==="italic"||rt.getAttribute("style:font-style-asian")==="italic")&&(lt.italic=!0),rt.getAttribute("style:text-underline-style")==="solid"&&(lt.underline=!0),rt.getAttribute("style:text-line-through-style")==="solid"&&(lt.strikethrough=!0);let ft=rt.getAttribute("fo:font-size")||rt.getAttribute("style:font-size-asian");ft&&(lt.size=ft);let K=rt.getAttribute("fo:color");K&&(lt.color=K);let X=rt.getAttribute("fo:background-color");X&&X!=="transparent"&&(lt.backgroundColor=X);let st=rt.getAttribute("style:font-name")||rt.getAttribute("fo:font-family");st&&(lt.font=st);let bt=rt.getAttribute("style:text-position");bt&&(bt.startsWith("sub")&&(lt.subscript=!0),bt.startsWith("super")&&(lt.superscript=!0)),Object.keys(lt).length>0&&(y[V]=lt)}}}let D=(F,P,V=!1)=>{if(F.tagName==="text:p"){let $=_(F,b,y,t),H=V||(F.getAttribute("text:style-name")||"").toLowerCase().includes("title")?"heading":"paragraph",rt={type:H,text:$.text,children:$.children,metadata:{...$.alignment?{alignment:$.alignment}:{},...$.style?{style:$.style}:{}}};H==="heading"&&rt.metadata&&(rt.metadata.level=rt.metadata.level||1),Object.keys(rt.metadata||{}).length===0&&delete rt.metadata,t.includeRawContent&&(rt.rawContent=F.toString()),P.push(rt)}else if(F.tagName==="text:h"){let $=parseInt(F.getAttribute("text:outline-level")||"1"),H=_(F,b,y,t),rt={type:"heading",text:H.text,children:H.children,metadata:{level:$,...H.alignment?{alignment:H.alignment}:{},...H.style?{style:H.style}:{}}};t.includeRawContent&&(rt.rawContent=F.toString()),P.push(rt)}else if(F.tagName==="table:table"){let $=S(F,b,y,t);t.includeRawContent&&($.rawContent=F.toString()),P.push($)}else if(F.tagName==="text:list"){let $=Fi(F,"text:list-item"),H=F.getAttribute("text:style-name")||F.getAttribute("xml:id"),rt=H||`list-${P.length}`,lt="unordered",ft=!1,K=H;if(!K){let wt=F.parentNode;for(;wt&&!K&&!(wt.nodeName==="text:list"&&(K=wt.getAttribute("text:style-name"),K));)wt=wt.parentNode}if(K){let wt=kt(ur(f?.content.toString()||""),"office:automatic-styles")[0];if(wt){let Q=kt(wt,"text:list-style");for(let W of Q)if(W.getAttribute("style:name")===K){let at=kt(W,"text:list-level-style-bullet"),pt=kt(W,"text:list-level-style-number"),_t=kt(W,"text:list-level-style-image");pt.length>0?(lt="ordered",ft=pt.some(At=>!!At.getAttribute("style:num-format"))):at.length>0&&(lt="unordered",ft=at.some(At=>!!At.getAttribute("text:bullet-char"))),_t.length>0&&(ft=!0);break}}if(d&&!ft){let Q=ur(d.content.toString()),W=kt(Q,"text:list-style");for(let at of W)if(at.getAttribute("style:name")===K){let pt=kt(at,"text:list-level-style-bullet"),_t=kt(at,"text:list-level-style-number"),At=kt(at,"text:list-level-style-image");_t.length>0?(lt="ordered",ft=_t.some(gt=>!!gt.getAttribute("style:num-format"))):pt.length>0&&(lt="unordered",ft=pt.some(gt=>!!gt.getAttribute("text:bullet-char"))),At.length>0&&(ft=!0);break}}}if(!ft){for(let wt=0;wt<$.length;wt++){let Q=$[wt];if(Q.childNodes)for(let W=0;W<Q.childNodes.length;W++){let at=Q.childNodes[W];at.nodeType===1&&D(at,P,V)}}return}let X=0,st=F.parentNode;for(;st;)st.nodeName==="text:list"&&X++,st=st.parentNode;m[rt]||(m[rt]={});let bt=X.toString();m[rt][bt]===void 0&&(m[rt][bt]=-1);for(let wt=0;wt<$.length;wt++){let Q=$[wt];m[rt][bt]++;let W=m[rt][bt];for(let at=X+1;at<10;at++)m[rt][at.toString()]!==void 0&&(m[rt][at.toString()]=-1);if(Q.childNodes)for(let at=0;at<Q.childNodes.length;at++){let pt=Q.childNodes[at];if(pt.nodeType===1){let _t=pt;if(_t.tagName==="text:p"){let At=_(_t,b,y,t),gt={type:"list",text:At.text,children:At.children,metadata:{listType:lt,indentation:X,itemIndex:W,listId:rt,alignment:At.alignment||"left",style:At.style}};t.includeRawContent&&(gt.rawContent=_t.toString()),P.push(gt)}else if(_t.tagName==="text:h"){let At=parseInt(_t.getAttribute("text:outline-level")||"1"),gt=_(_t,b,y,t),xt={type:"list",text:gt.text,children:gt.children,metadata:{listType:lt,indentation:X,itemIndex:W,listId:rt,...gt.alignment?{alignment:gt.alignment}:{},style:gt.style}};t.includeRawContent&&(xt.rawContent=_t.toString()),P.push(xt)}else _t.tagName==="text:list"&&D(_t,P,V)}}}}else if(F.tagName==="draw:frame"){let $=F.getAttribute("presentation:class"),H=$==="title"||$==="sub-title",rt=kt(F,"draw:text-box")[0],lt=kt(F,"draw:image")[0],ft=kt(F,"table:table")[0],K=kt(F,"draw:object")[0];if(rt)D(rt,P,H||V);else if(ft){let X=S(ft,b,y,t);t.includeRawContent&&(X.rawContent=ft.toString()),P.push(X)}else if(lt){let X="",st=kt(F,"svg:title")[0],bt=kt(F,"svg:desc")[0];st&&st.textContent?X=st.textContent:bt&&bt.textContent&&(X=bt.textContent);let wt=lt.getAttribute("xlink:href")||"";if(wt){let W=wt.split("/");wt=W[W.length-1]}let Q={type:"image",text:"",children:[],metadata:{attachmentName:wt,...X?{altText:X}:{}}};t.includeRawContent&&(Q.rawContent=F.toString()),P.push(Q)}else if(K){let X=K.getAttribute("xlink:href");if(X){let st=X.split("/")[0],bt=`${st}/content.xml`,wt=c.find(Q=>Q.path===bt||Q.path.endsWith(bt));if(wt){let Q=ug(wt.content),W={type:"chart",text:Q.rawTexts.join(" "),metadata:{attachmentName:st,chartData:Q}};t.includeRawContent&&(W.rawContent=F.toString()),P.push(W)}else{let Q={type:"chart",text:"",metadata:{attachmentName:st}};t.includeRawContent&&(Q.rawContent=F.toString()),P.push(Q)}}}}else if(F.childNodes)for(let $=0;$<F.childNodes.length;$++){let H=F.childNodes[$];H.nodeType===1&&D(H,P,V)}};if(h==="ods"){let F=kt(J,"office:spreadsheet")[0];if(F){let P=kt(F,"table:table");for(let V=0;V<P.length;V++){let $=P[V],H=$.getAttribute("table:name")||`Sheet${V+1}`,rt=[],lt=kt($,"table:table-row"),ft=0;for(let X=0;X<lt.length;X++){let st=lt[X],bt=[],wt=kt(st,"table:table-cell"),Q=0,W=parseInt(st.getAttribute("table:number-rows-repeated")||"1");for(let at=0;at<wt.length;at++){let pt=wt[at],_t=parseInt(pt.getAttribute("table:number-columns-repeated")||"1"),At="",gt=[],xt=kt(pt,"text:p");for(let Nt=0;Nt<xt.length;Nt++){let Ot=xt[Nt],qt=kt(Ot,"text:span");if(qt.length>0)for(let Jt of qt){let te=Jt.getAttribute("text:style-name"),O=te?y[te]:{},v=Jt.textContent||"";At+=v;let E={type:"text",text:v,formatting:O};gt.push(E)}else{let Jt=Ot.textContent||"";if(At+=Jt,Jt.trim()){let te={type:"text",text:Jt,formatting:{}};gt.push(te)}}Nt<xt.length-1&&(At+=`
126
+ `)}let $t=kt(pt,"draw:frame");for(let Nt of $t){let Ot="",qt=kt(Nt,"svg:title")[0],Jt=kt(Nt,"svg:desc")[0];qt&&qt.textContent?Ot=qt.textContent:Jt&&Jt.textContent&&(Ot=Jt.textContent);let te="",O=kt(Nt,"draw:image");if(O.length>0){let B=O[0].getAttribute("xlink:href");if(B){let it=B.split("/");te=it[it.length-1]}}let v="",E=kt(Nt,"draw:object");if(E.length>0){let B=E[0].getAttribute("xlink:href");B&&(v=B.split("/")[0])}if(O.length>0){let B={type:"image",text:"",children:[],metadata:{attachmentName:te,...Ot?{altText:Ot}:{}}};t.includeRawContent&&(B.rawContent=Nt.toString()),gt.push(B)}else if(v){let B={type:"chart",text:"",children:[],metadata:{attachmentName:v}};gt.push(B)}}for(let Nt=0;Nt<_t;Nt++){if(At||gt.length>0||h!=="ods"){let Ot={type:"cell",text:At,children:gt,metadata:{row:ft,col:Q}};t.includeRawContent&&(Ot.rawContent=pt.toString()),bt.push(Ot)}Q++}}if(bt.length>0)for(let at=0;at<W;at++){let pt={type:"row",children:JSON.parse(JSON.stringify(bt)),metadata:void 0};at>0&&pt.children?.forEach(_t=>{_t.metadata&&"row"in _t.metadata&&(_t.metadata.row=ft)}),t.includeRawContent&&(pt.rawContent=st.toString()),rt.push(pt),ft++}else ft+=W}let K={type:"sheet",children:rt,metadata:{sheetName:H}};t.includeRawContent&&(K.rawContent=$.toString()),p.push(K)}}}else if(h==="odp"){let F=kt(J,"office:presentation")[0];if(F){let P=Fi(F,"draw:page"),V=[];for(let $=0;$<P.length;$++){let H=P[$],rt={type:"slide",children:[],metadata:{slideNumber:$+1}},lt,ft=H.childNodes;if(ft)for(let K=0;K<ft.length;K++){let X=ft[K];if(X.nodeType===1){let st=X;if(st.tagName==="presentation:notes"){t.ignoreNotes||(lt={type:"note",children:[],metadata:{slideNumber:$+1,noteId:`slide-note-${$+1}`}},D(st,lt.children));continue}D(st,rt.children)}}t.includeRawContent&&(rt.rawContent=H.toString()),p.push(rt),lt&&lt.children&&lt.children.length>0&&(t.putNotesAtLast?V.push(lt):p.push(lt))}V.length>0&&p.push(...V)}}else{let F=kt(J,"office:text")[0];F&&D(F,p)}})(f.content.toString());let C=[],M=c.filter(q=>q.path.match(/(Pictures|media)\/.*/));if(t.extractAttachments){let q=c.filter(nt=>nt.path.match(/Object \d+\/content\.xml/));for(let nt of q){let J=ur(nt.content.toString());if(kt(J,"chart:chart").length>0){let D=nt.path.split("/")[0],F={type:"chart",mimeType:"application/vnd.oasis.opendocument.chart",data:nt.content.toString("base64"),name:D,extension:"xml"},P=ug(nt.content);P.rawTexts.length>0&&(F.chartData=P),C.push(F)}}}if(t.extractAttachments)for(let q of M){let nt=gl(q.path.split("/").pop()||"image",q.content);if(C.push(nt),t.ocr&&nt.mimeType.startsWith("image/"))try{nt.ocrText=(await So(q.content,t.ocrLanguage)).trim()}catch(J){Ks(`OCR failed for ${nt.name}:`,t,J)}}let z=c.find(q=>q.path.match(s)),G=z?jf(z.content.toString()):{},Y=(q,nt)=>{let J=D=>{let F=D.replace(/^\[|\]$/g,""),[P,V]=F.split(":"),$=P.lastIndexOf(".");if($===-1)return[D];let H=P.substring(0,$).replace(/^'|'$/g,""),rt=P.substring($+1).replace(/\$/g,""),lt=rt;if(V)if(V.startsWith("."))lt=V.substring(1).replace(/\$/g,"");else{let wt=V.lastIndexOf(".");lt=V.substring(wt+1).replace(/\$/g,"")}let ft=wt=>{let Q=wt.match(/[A-Z]+/),W=wt.match(/\d+/);if(!Q||!W)return null;let at=Q[0],pt=0;for(let At=0;At<at.length;At++)pt=pt*26+(at.charCodeAt(At)-65+1);return pt-=1,{r:parseInt(W[0])-1,c:pt}},K=ft(rt),X=ft(lt);if(!K||!X)return[D];let st=nt.find(wt=>wt.type==="sheet"&&wt.metadata?.sheetName===H);if(!st||!st.children)return[D];let bt=[];for(let wt of st.children)if(wt.children)for(let Q of wt.children){let W=Q.metadata;W&&W.row>=K.r&&W.row<=X.r&&W.col>=K.c&&W.col<=X.c&&bt.push(Q.text||"")}return bt.length>0?bt:[]};for(let D of q.dataSets){let F=[];for(let P of D.values)P.startsWith("[")?F.push(...J(P)):F.push(P);D.values=F}let N=[];for(let D of q.labels)D.startsWith("[")?N.push(...J(D)):N.push(D);q.labels=N,q.rawTexts=[],q.title&&q.rawTexts.push(q.title);for(let D of q.dataSets)D.name&&q.rawTexts.push(D.name),q.rawTexts.push(...q.labels),q.rawTexts.push(...D.values)};for(let q of C)q.type==="chart"&&q.chartData&&Y(q.chartData,p);(q=>{let nt=new Set,J=P=>{for(let V of P){if(V.metadata&&"attachmentName"in V.metadata){let $=V.metadata.attachmentName;$&&nt.add($)}V.children&&J(V.children)}};J(q);let N=C.filter(P=>P.type==="image"&&P.name&&!nt.has(P.name)),D=0,F=P=>{if((P.type==="image"||P.type==="chart")&&P.metadata&&"attachmentName"in P.metadata){let V=P.metadata.attachmentName;if(!V&&P.type==="image"&&D<N.length&&(V=N[D++].name,P.metadata.attachmentName=V),V){let $=C.find(H=>H.name===V);$&&($.ocrText&&(P.text=$.ocrText),$.chartData&&P.type==="chart"&&(P.text=$.chartData.rawTexts.join(t.newlineDelimiter??`
127
+ `)))}}P.children&&P.children.forEach(F)};q.forEach(F)})(p);let j={};for(let q in y)j[q]={formatting:y[q],alignment:b[q]?.alignment};for(let q in b)j[q]||(j[q]={formatting:{},alignment:b[q]?.alignment});return t.putNotesAtLast&&g.length>0&&p.push(...g),{type:h,metadata:{...G,styleMap:j},content:p,attachments:C,toText:()=>p.map(q=>{let nt=J=>{let N="";if(J.children&&J.children.length>0){let F=J.children.some(P=>P.children&&P.children.length>0)?t.newlineDelimiter??`
128
+ `:"";N+=J.children.map(nt).filter(P=>P!="").join(F)}else N+=J.text||"";return N};return nt(q)}).filter(q=>q!="").join(t.newlineDelimiter??`
129
+ `)}};Tt();Rt();Ct();function rZ(n){if(n)try{let t=n.startsWith("D:")?n.slice(2):n,e=parseInt(t.slice(0,4),10),r=parseInt(t.slice(4,6),10)-1,i=parseInt(t.slice(6,8),10)||1,s=parseInt(t.slice(8,10),10)||0,a=parseInt(t.slice(10,12),10)||0,o=parseInt(t.slice(12,14),10)||0,c=t.slice(14).match(/([+-Z])(\d{2})'?(\d{2})?'?/);if(c){let u=c[1]==="-"?-1:1,h=parseInt(c[2],10)||0,f=parseInt(c[3],10)||0,d=u*(h*60+f),p=Date.UTC(e,r,i,s,a,o);return new Date(p-d*6e4)}return new Date(e,r,i,s,a,o)}catch{try{return new Date(n)}catch{return}}}function Lft(n){let t=[];for(let i of n)for(let s of i)s.type==="text"&&s.height>0&&t.push(s.height);if(t.length===0)return{median:12,max:12};t.sort((i,s)=>i-s);let e=t[Math.floor(t.length/2)],r=t[t.length-1];return{median:e,max:r}}function kft(n,t){if(n<=t.median*1.2)return 0;let e=n/t.median;return e>=2?1:e>=1.7?2:e>=1.5?3:e>=1.35?4:e>=1.2?5:0}function Mft(n,t){let e=n.x+n.width/2,r=n.y+n.height/2;for(let i of t){let[s,a,o,c]=i.rect,u=Math.min(s,o),h=Math.max(s,o),f=Math.min(a,c),d=Math.max(a,c);if(e>=u&&e<=h&&r>=f&&r<=d)return i}}function Fft(n,t,e){let r=Math.floor((24*n+31)/32)*4,i=r-n*3,s=54,a=r*t,o=s+a,c=Buffer.alloc(o);c.write("BM",0),c.writeUInt32LE(o,2),c.writeUInt32LE(0,6),c.writeUInt32LE(s,10),c.writeUInt32LE(40,14),c.writeInt32LE(n,18),c.writeInt32LE(-t,22),c.writeUInt16LE(1,26),c.writeUInt16LE(24,28),c.writeUInt32LE(0,30),c.writeUInt32LE(a,34),c.writeInt32LE(2835,38),c.writeInt32LE(2835,42),c.writeUInt32LE(0,46),c.writeUInt32LE(0,50);let u=s;for(let h=0;h<t;h++){for(let f=0;f<n;f++){let d=(h*n+f)*4,p=e[d+0],g=e[d+1],y=e[d+2],m=e[d+3]/255,w=Math.round(p*m+255*(1-m)),A=Math.round(g*m+255*(1-m)),_=Math.round(y*m+255*(1-m));c[u+0]=_,c[u+1]=A,c[u+2]=w,u+=3}for(let f=0;f<i;f++)c[u]=0,u++}return c}function Bft(n,t,e,r){let i;if(r===1){i=new Uint8ClampedArray(t*e*4);for(let s=0;s<t*e;s++){let a=n[s];i[s*4]=a,i[s*4+1]=a,i[s*4+2]=a,i[s*4+3]=255}}else if(r===2||n.length===t*e*3){i=new Uint8ClampedArray(t*e*4);for(let s=0;s<t*e;s++)i[s*4]=n[s*3],i[s*4+1]=n[s*3+1],i[s*4+2]=n[s*3+2],i[s*4+3]=255}else i=n instanceof Uint8ClampedArray?n:new Uint8ClampedArray(n);return Buffer.from(i.buffer,i.byteOffset,i.byteLength)}var nZ=async(n,t)=>{let e;if(typeof window>"u")try{e=await Promise.resolve().then(()=>(kq(),Lq))}catch{e=await Promise.resolve().then(()=>(H5(),k5))}else e=await Promise.resolve().then(()=>(H5(),k5));if(t.pdfWorkerSrc)e.GlobalWorkerOptions.workerSrc=t.pdfWorkerSrc;else if(typeof window<"u")e.GlobalWorkerOptions.workerSrc="https://unpkg.com/pdfjs-dist@5.4.530/build/pdf.worker.min.mjs";else try{let g=Up.resolve("pdfjs-dist/legacy/build/pdf.worker.mjs");e.GlobalWorkerOptions.workerSrc=g}catch(g){t.outputErrorToConsole&&console.warn("[PdfParser] Could not auto-resolve local worker path:",g)}let r=new Uint8Array(n),i=e.getDocument({data:r,verbosity:0}),s;try{s=await i.promise}catch(g){throw g.message?.includes("workerSrc")||g.message?.includes('No "GlobalWorkerOptions.workerSrc" specified')?Ou("PDF_WORKER_MISSING",t):g}let a=[],o=[],c=s.numPages,u=[],f=(await s.getMetadata().catch(()=>({info:{}}))).info,d={pages:c,title:f?.Title||void 0,author:f?.Author||void 0,subject:f?.Subject||void 0,description:f?.Keywords||void 0,created:rZ(f?.CreationDate),modified:rZ(f?.ModDate)};try{let g=await s.getAttachments();if(g&&t.extractAttachments)for(let y in g){let b=g[y],m=Buffer.from(b.content),w=gl(b.filename,m);o.push(w)}}catch(g){t.outputErrorToConsole&&console.error("Error extracting embedded attachments:",g)}for(let g=1;g<=c;g++){let y,b,m=[];try{y=await s.getPage(g),b=await y.getTextContent()}catch(A){t.outputErrorToConsole&&console.warn(`[PdfParser] Error loading page ${g}:`,A),u.push(m);continue}let w=y.commonObjs;for(let A of b.items){let _=A.transform,S=_[4],I=_[5],C=A.width||0,M=A.height||Math.abs(_[3])||12,z={},G;if(A.fontName&&w)try{if(w.has(A.fontName)){let Y=await new Promise(L=>{w.get(A.fontName,j=>L(j))});if(Y?.name){G=Y.name.replace(/^[A-Z]{6}\+/,""),z.font=G;let L=Y.name.toLowerCase();L.includes("bold")&&(z.bold=!0),(L.includes("italic")||L.includes("oblique"))&&(z.italic=!0)}}}catch{}M>0&&(z.size=Math.round(M).toString()),m.push({type:"text",x:S,y:I,width:C,height:M,text:A.str,fontName:G,formatting:z})}if(t.extractAttachments||t.ocr)try{let A=await y.getOperatorList(),_=A.fnArray,S=A.argsArray;for(let I=0;I<_.length;I++){let C=_[I];if(C===e.OPS.dependency){let M=S[I];for(let z of M)try{if(y.objs.has(z))continue;await new Promise(G=>{let Y=setTimeout(()=>{G()},500);y.objs.get(z,L=>{clearTimeout(Y),G()})})}catch(G){t.outputErrorToConsole&&console.error(`[PdfParser] Failed to load dependency ${z}:`,G)}}if(C===e.OPS.paintImageXObject||C===e.OPS.paintXObject){let M=S[I][0];try{let z=y.objs.has(M),G=y.objs;if(!z&&y.commonObjs.has(M)&&(z=!0,G=y.commonObjs),z){let L=await new Promise(j=>{G.get(M,q=>j(q))});if(typeof window<"u"&&!L.data&&L.bitmap)try{let j=document.createElement("canvas");j.width=L.width,j.height=L.height;let q=j.getContext("2d");q&&(q.drawImage(L.bitmap,0,0),L.data=q.getImageData(0,0,L.width,L.height).data,L.kind=3)}catch(j){t.outputErrorToConsole&&console.error("[PdfParser] Failed to extract from ImageBitmap:",j)}if(L?.data&&L.width>0&&L.height>0){let j=0,q=0;for(let nt=I-1;nt>=0;nt--)if(_[nt]===e.OPS.transform){j=S[nt][4],q=S[nt][5];break}m.push({type:"image",x:j,y:q,name:M,data:L.data,width:L.width,height:L.height,kind:L.kind})}}}catch{}}}}catch(A){t.outputErrorToConsole&&console.error(`Error extracting images from page ${g}:`,A)}u.push(m)}let p=Lft(u);for(let g=0;g<u.length;g++){let y=g+1,b;try{b=await s.getPage(y)}catch(M){t.outputErrorToConsole&&console.warn(`[PdfParser] Error loading page ${y} in second pass:`,M);continue}let m=u[g],w=[],A=[];try{let M=await b.getAnnotations();for(let z of M)z.subtype==="Link"&&z.rect&&A.push({rect:z.rect,url:z.url,dest:z.dest})}catch(M){t.outputErrorToConsole&&console.error(`Error extracting annotations from page ${y}:`,M)}m.sort((M,z)=>Math.abs(z.y-M.y)>5?z.y-M.y:M.x-z.x);let _=null,S=0,I=-1,C=0;for(let M of m)if(M.type==="text"){let z=M.text;if(!z)continue;if(I!==-1&&Math.abs(M.y-I)>5&&_&&((_.text||"").trim().length>0&&w.push(_),_=null),!_&&z.trim().length===0){I=M.y;continue}let Y=kft(M.height,p);if(_||(Y>0?_={type:"heading",text:"",children:[],metadata:{level:Y}}:_={type:"paragraph",text:"",children:[]},S=M.height),z.trim().length===0){if(_.children&&_.children.length>0){let nt=_.children[_.children.length-1];nt.type==="text"&&nt.text&&(nt.text+=z,_.text+=z)}I=M.y;continue}if(_.text&&_.text.length>0&&!_.text.endsWith(" ")&&(_.text+=" ",_.children&&_.children.length>0)){let nt=_.children[_.children.length-1];nt.type==="text"&&nt.text&&(nt.text+=" ")}_.text+=z;let L=Mft(M,A),j;L&&(L.url?j={link:L.url,linkType:L.url.startsWith("#")?"internal":"external"}:L.dest&&(j={link:typeof L.dest=="string"?`#${L.dest}`:"#internal",linkType:"internal"}));let q=!1;if(_.children&&_.children.length>0&&!j){let nt=_.children[_.children.length-1];nt.type==="text"&&Uft(nt.formatting,M.formatting)&&!nt.metadata&&(nt.text=(nt.text||"")+z,q=!0)}if(!q){let nt={type:"text",text:z,formatting:Object.keys(M.formatting).length>0?M.formatting:void 0};j&&(nt.metadata=j),_.children?.push(nt)}I=M.y}else if(M.type==="image"){_&&((_.text||"").trim().length>0&&w.push(_),_=null),C++;let z=`pdf_image_p${y}_${C}.bmp`;if(t.extractAttachments)try{let G=Bft(M.data,M.width,M.height,M.kind),Y=Fft(M.width,M.height,new Uint8Array(G)),L=gl(z,Y);if(L.mimeType="image/bmp",t.ocr)try{M.width>=10&&M.height>=10&&(L.ocrText=(await So(Y,t.ocrLanguage)).trim())}catch(q){t.outputErrorToConsole&&console.error(`OCR failed for ${z}:`,q)}o.push(L);let j={attachmentName:z};w.push({type:"image",text:L.ocrText||"",metadata:{...j}})}catch(G){Ks(`Failed to process image ${z}:`,t,G)}}_&&(_.text||"").trim().length>0&&w.push(_),a.push({type:"page",children:w,text:w.map(M=>M.text).join(t.newlineDelimiter??`
130
+
131
+ `),metadata:{pageNumber:y}})}return{type:"pdf",metadata:d,content:a,attachments:o,toText:()=>a.map(g=>g.text).join(t.newlineDelimiter??`
132
+
133
+ `)}};function Uft(n,t){if(!n&&!t)return!0;if(!n||!t)return!1;let e=Object.keys(n).sort(),r=Object.keys(t).sort();if(e.length!==r.length)return!1;for(let i=0;i<e.length;i++){let s=e[i];if(e[i]!==r[i]||n[s]!==t[s])return!1}return!0}Tt();Rt();Ct();var iZ=jp(tR());var sZ=async(n,t)=>{let e=/ppt\/(notesSlides|slides)\/(notesSlide|slide)\d+.xml/g,r=/ppt\/slides\/slide\d+.xml/g,i=/ppt\/slides\/_rels\/slide\d+\.xml\.rels/,s=/lide(\d+)\.xml/,a=/ppt\/media\/.*/,o=/ppt\/charts\/chart\d+\.xml/,c=/docProps\/core\.xml/,u=new iZ.XMLSerializer,h=await qf(n,nt=>!!nt.match(t.ignoreNotes?r:e)||!!nt.match(c)||!!nt.match(i)||!!t.extractAttachments&&(!!nt.match(a)||!!nt.match(o))),f=h.find(nt=>nt.path.match(c)),d=f?jf(f.content.toString()):{};h.sort((nt,J)=>{let N=nt.path.match(s),D=J.path.match(s),F=N?parseInt(N[1]):0,P=D?parseInt(D[1]):0;return F-P});let p=[],g=[],y={},b=0,m=0,w=!1,A=null,_=0,S={},I=nt=>{let J=[],N=kt(nt,"a:tr");for(let D=0;D<N.length;D++){let F=N[D],P=[],V=kt(F,"a:tc");for(let H=0;H<V.length;H++){let rt=V[H],lt=[],ft="",K=kt(rt,"a:txBody")[0];if(K){let st=kt(K,"a:p");for(let bt of st){let wt={type:"paragraph",text:"",children:[],metadata:{}};t.includeRawContent&&(wt.rawContent=bt.toString());let Q=kt(bt,"a:r");for(let W of Q){let at=kt(W,"a:t")[0];if(at&&at.childNodes[0]){let pt=at.childNodes[0].nodeValue||"";wt.text+=pt;let _t=kt(W,"a:rPr")[0],At={};if(_t){_t.getAttribute("b")==="1"&&(At.bold=!0),_t.getAttribute("i")==="1"&&(At.italic=!0),_t.getAttribute("u")==="sng"&&(At.underline=!0),_t.getAttribute("strike")==="sngStrike"&&(At.strikethrough=!0);let gt=_t.getAttribute("sz");gt&&(At.size=(parseInt(gt)/100).toString()+"pt");let xt=kt(_t,"a:solidFill")[0];if(xt){let Nt=kt(xt,"a:srgbClr")[0];if(Nt){let Ot=Nt.getAttribute("val");Ot&&(At.color="#"+Ot)}}let $t=kt(_t,"a:latin")[0];if($t){let Nt=$t.getAttribute("typeface");Nt&&(At.font=Nt)}}wt.children?.push({type:"text",text:pt,formatting:At})}}lt.push(wt),ft+=wt.text}}let X={type:"cell",text:ft,children:lt,metadata:{row:D,col:H}};P.push(X)}let $={type:"row",children:P};J.push($)}return{type:"table",children:J}},C=(nt,J)=>{let N=kt(nt,"a:blip")[0];if(!N)return null;let D=N.getAttribute("r:embed");if(!D)return null;let F=y[J]?.[D];if(!F||F.type!=="image")return null;let P=F.target,V=kt(nt,"p:nvPicPr")[0],H=(V?kt(V,"p:cNvPr")[0]:null)?.getAttribute("descr")||void 0;return{type:"image",text:"",metadata:{attachmentName:P,altText:H}}},M=(nt,J)=>{let N=kt(nt,"a:graphicData")[0];if(!N||!(N.getAttribute("uri")==="http://schemas.openxmlformats.org/drawingml/2006/chart"))return null;let P=kt(N,"c:chart")[0];if(!P)return null;let V=P.getAttribute("r:id");if(!V)return null;let $=y[J]?.[V];if(!$||$.type!=="chart")return null;let rt={type:"chart",text:"",metadata:{attachmentName:$.target}};return t.includeRawContent&&(rt.rawContent=u.serializeToString(nt)),rt},z=(nt,J)=>{let N=kt(nt,"a:tbl")[0];if(N){let D=I(N);if(t.includeRawContent&&(D.rawContent=u.serializeToString(nt)),D.children&&D.children.length>0)return D}if(nt.getElementsByTagName("c:chart").length>0){let D=M(nt,J);if(D)return D}return null},G=(nt,J)=>{let N=[],D=kt(nt,"p:nvSpPr")[0],F=D?kt(D,"p:nvPr")[0]:null,P=F?kt(F,"p:ph")[0]:null,V=P?P.getAttribute("type"):"body",$=V==="title"||V==="ctrTitle",H=kt(nt,"p:txBody")[0];if(H){let rt=kt(H,"a:p");for(let lt=0;lt<rt.length;lt++){let ft=rt[lt],K={type:$?"heading":"paragraph",text:"",children:[],metadata:$?{level:1}:{}},X=kt(ft,"a:pPr")[0],st=!1,bt="unordered",wt=0;if(X){let W=X.getAttribute("lvl");W&&(wt=parseInt(W));let at=kt(X,"a:buAutoNum")[0],pt=kt(X,"a:buChar")[0],_t=kt(X,"a:buBlip")[0],At=kt(X,"a:bu")[0];at?(st=!0,bt="ordered"):(pt||_t||At)&&(st=!0,bt="unordered");let gt=X.getAttribute("algn");if(gt){let xt={l:"left",ctr:"center",r:"right",just:"justify"};xt[gt]&&(K.metadata.alignment=xt[gt])}}if(st){K.type="list";let W=wt;if(!w||bt!==A){b++;for(let pt in S)delete S[pt];m=0,S[W]=0}else if(W>_)m=0,S[W]=0;else if(W<_){for(let _t in S){let At=parseInt(_t);At>W&&delete S[At]}m=(S[W]||0)+1,S[W]=m}else m=(S[W]||0)+1,S[W]=m;w=!0,A=bt,_=W,K.metadata={...K.metadata,listType:bt,indentation:W,listId:b.toString(),itemIndex:m,alignment:K.metadata?.alignment||"left"}}else w=!1,A=null,_=0;$&&(K.metadata={...K.metadata,level:1}),t.includeRawContent&&(K.rawContent=ft.toString());let Q=kt(ft,"a:r");for(let W=0;W<Q.length;W++){let at=Q[W],pt=kt(at,"a:t")[0];if(pt&&pt.childNodes[0]){let _t=pt.childNodes[0].nodeValue||"";K.text+=_t;let At=kt(at,"a:rPr")[0],gt={};if(At){At.getAttribute("b")==="1"&&(gt.bold=!0),At.getAttribute("i")==="1"&&(gt.italic=!0),At.getAttribute("u")==="sng"&&(gt.underline=!0),At.getAttribute("strike")==="sngStrike"&&(gt.strikethrough=!0);let Nt=At.getAttribute("sz");Nt&&(gt.size=(parseInt(Nt)/100).toString()+"pt");let Ot=kt(At,"a:solidFill")[0];if(Ot){let O=kt(Ot,"a:srgbClr")[0];if(O){let v=O.getAttribute("val");v&&(gt.color="#"+v)}}let qt=kt(At,"a:highlight")[0];if(qt){let O=kt(qt,"a:srgbClr")[0];if(O){let v=O.getAttribute("val");v&&(gt.backgroundColor="#"+v)}}let Jt=kt(At,"a:latin")[0];if(Jt){let O=Jt.getAttribute("typeface");O&&(gt.font=O)}let te=At.getAttribute("baseline");if(te){let O=parseInt(te);O<0&&(gt.subscript=!0),O>0&&(gt.superscript=!0)}}let xt={type:"text",text:_t,formatting:gt},$t=kt(at,"a:hlinkClick")[0];if($t){let Nt=$t.getAttribute("r:id"),Ot=$t.getAttribute("action"),qt,Jt;Nt&&y[J]&&y[J][Nt]&&y[J][Nt].type==="hyperlink"?(qt=y[J][Nt].target,Jt="external"):Nt&&y[J]&&y[J][Nt]&&y[J][Nt].type==="slide"?(qt=y[J][Nt].target,Jt="internal"):Ot&&(qt=Ot,Jt="internal"),qt&&(xt.metadata={link:qt,linkType:Jt})}K.children?.push(xt)}}K.text&&N.push(K)}}return N};function Y(nt,J){let N=[];for(let D of Array.from(nt?.childNodes||[])){if(D.nodeType!==1)continue;let F=D,P=F.tagName;if(P==="p:sp")N.push(...G(F,J));else if(P==="p:pic"){let V=C(F,J);V&&N.push(V)}else if(P==="p:graphicFrame"){let V=z(F,J);V&&N.push(V)}else if(P==="p:grpSp"){let V=F.getElementsByTagName("p:spTree")[0];N.push(...Y(V,J))}}return N}for(let nt of h)if(nt.path.match(i)){let J=nt.path.match(/slide(\d+)\.xml\.rels/);if(J){let N=parseInt(J[1]);y[N]={};let D=ur(nt.content.toString()),F=kt(D,"Relationship");for(let P=0;P<F.length;P++){let V=F[P].getAttribute("Id"),$=F[P].getAttribute("Type"),H=F[P].getAttribute("Target");if(V&&$&&H){let rt="other";$.includes("relationships/image")?rt="image":$.includes("relationships/hyperlink")?rt="hyperlink":$.includes("relationships/chart")?rt="chart":$.includes("relationships/slide")?rt="slide":$.includes("relationships/notesSlide")&&(rt="notes");let lt=H;H.startsWith("http://")||H.startsWith("https://")||(lt=lt.split("/").pop()||""),y[N][V]={type:rt,target:lt}}}}}for(let nt of h){if(nt.path.match(a)||nt.path.match(o)||nt.path.match(i)||nt.path.match(c))continue;let J=nt.content.toString(),N=ur(J);t.includeRawContent&&g.push(J);let D=nt.path.match(s),F=D?parseInt(D[1]):0,P=nt.path.includes("notesSlide"),V={type:P?"note":"slide",children:[],metadata:{slideNumber:F,...P?{noteId:`slide-note-${F}`}:{}}};t.includeRawContent&&(V.rawContent=nt.content.toString());let $=kt(N,"p:spTree")[0];$&&V.children?.push(...Y($,F)),V.children&&V.children.length>0&&p.push(V)}let L=[],j=h.filter(nt=>nt.path.match(/ppt\/media\/.*/)),q=h.filter(nt=>nt.path.match(/ppt\/charts\/chart\d+\.xml/));if(t.extractAttachments){for(let J of j){let N=gl(J.path.split("/").pop()||"image",J.content);if(L.push(N),t.ocr&&N.mimeType.startsWith("image/"))try{N.ocrText=(await So(J.content,t.ocrLanguage)).trim()}catch(D){Ks(`OCR failed for ${N.name}:`,t,D)}}for(let J of q){let N={type:"chart",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",data:J.content.toString("base64"),name:J.path.split("/").pop()||"",extension:"xml"};L.push(N);try{let D=await ug(J.content);N.chartData=D}catch(D){Ks(`Failed to extract text from chart ${J.path}:`,t,D)}}let nt=J=>{for(let N of J){if("attachmentName"in(N.metadata||{})){let D=N.metadata,F=L.find(P=>P.name===D.attachmentName);F&&(N.type==="image"&&(F.altText=D.altText,F.ocrText&&(N.text=F.ocrText)),N.type==="chart"&&(N.text=F.chartData?.rawTexts.join(t.newlineDelimiter||`
134
+ `)))}N.children&&nt(N.children)}};nt(p)}return!t.ignoreNotes&&t.putNotesAtLast&&p.sort((nt,J)=>{let N=nt.type==="note"?1:0,D=J.type==="note"?1:0;return N-D}),{type:"pptx",metadata:d,content:p,attachments:L,toText:()=>p.map(nt=>{let J=N=>{let D="";return N.children?D+=N.children.map(J).filter(F=>F!="").join(N.children[0]?.children?t.newlineDelimiter??`
135
+ `:""):D+=N.text||"",D};return J(nt)}).filter(nt=>nt!="").join(t.newlineDelimiter??`
136
+ `)}};Tt();Rt();Ct();var jft={pngblip:"png",jpegblip:"jpeg",gifblip:"gif",tiffblip:"tiff",dibitmap:"bmp",wbitmap:"bmp"},$ft={png:"image/png",jpeg:"image/jpeg",gif:"image/gif",tiff:"image/tiff",bmp:"image/bmp"},z5=class{constructor(t){this.index=0;this.buffer=t,this.length=t.length}parse(){let t={type:"group",content:[]},e=[t];for(;this.index<this.length;){let r=this.buffer[this.index],i=e[e.length-1];if(r===123){this.index++;let s={type:"group",content:[]};i.content.push(s),e.push(s)}else r===125?(this.index++,e.length>1&&e.pop()):r===92?(this.index++,this.parseControl(i)):r===13||r===10?this.index++:this.parseText(i)}return t}parseControl(t){if(this.index>=this.length)return;let e=this.buffer[this.index];if(e===123||e===125||e===92){t.content.push({type:"text",value:String.fromCharCode(e)}),this.index++;return}if(e===39){if(this.index++,this.index+1<this.length){let o=this.buffer.toString("utf8",this.index,this.index+2),c=parseInt(o,16);if(!isNaN(c)){let h={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}[c]||c;t.content.push({type:"text",value:String.fromCharCode(h)})}this.index+=2}return}if(e===42){t.content.push({type:"control",value:"*"}),this.index++;return}let r="";for(;this.index<this.length;){let o=this.buffer[this.index];if(o>=97&&o<=122||o>=65&&o<=90)r+=String.fromCharCode(o),this.index++;else break}let i,s=!1,a="";for(this.index<this.length&&this.buffer[this.index]===45&&(a+="-",this.index++);this.index<this.length;){let o=this.buffer[this.index];if(o>=48&&o<=57)a+=String.fromCharCode(o),this.index++,s=!0;else break}if(s&&(i=parseInt(a,10)),this.index<this.length&&this.buffer[this.index]===32&&this.index++,r==="bin"&&i!==void 0&&i>0){this.index+=i;return}t.content.push({type:"control",value:r,param:i}),(t.content.length===1&&t.type==="group"||t.content.length===2&&t.content[0].type==="control"&&t.content[0].value==="*")&&(t.destination=r)}parseText(t){let e="";for(;this.index<this.length;){let r=this.buffer[this.index];if(r===123||r===125||r===92||r===13||r===10)break;e+=String.fromCharCode(r),this.index++}e.length>0&&t.content.push({type:"text",value:e})}},aZ=async(n,t)=>{try{let r=new z5(n).parse(),i=Hft(r),s=zft(r),a=[],o=[],c=[],u="",h=[],f="",d="",p={},g=a,y=0,b="left",m=!1,w,A,_,S,I,C=[],M=0,z=()=>C.length>0?C[C.length-1]:void 0,G=()=>{C.length===0&&C.push({rows:[],currentCells:[],currentCellContent:[],rowIndex:0})},Y=!1,L=!1,j=0,q=[],nt={isMergedContinuation:!1},J=0,N=0,D={},F=!1,P=!1,V,$,H={},rt=!1,lt,ft,K={},X={},st,bt=(v,E)=>v.bold!==E.bold||v.italic!==E.italic||v.underline!==E.underline||v.strikethrough!==E.strikethrough||v.size!==E.size||v.font!==E.font||v.color!==E.color||v.backgroundColor!==E.backgroundColor||v.subscript!==E.subscript||v.superscript!==E.superscript,wt=()=>{if(d){let v={type:"text",text:d,formatting:{...p}};st&&(v.metadata={link:st,linkType:gt(st)}),h.push(v),u+=d,d=""}},Q=!1,W=()=>{wt();let v=u||h.length>0;if(Y&&!L&&!Q&&v){let E=u,B=[...h],it=f;u="",h=[],f="",_t(),u=E,h=B,f=it}if(v){let E="paragraph",B;if(A!==void 0&&A>0)E="heading",B={level:A},S=void 0,I=void 0;else if(m){E="list";let k=_||S,ct=w||I||"unordered",mt=0;k&&(X[k]||(X[k]={}),X[k][y]===void 0?X[k][y]=0:X[k][y]++,mt=X[k][y]),B={listType:ct,indentation:y,listId:k||"",itemIndex:mt,alignment:b},k&&(S=k),ct&&(I=ct)}let it={type:E,text:u,children:h,formatting:void 0,metadata:B};t.includeRawContent&&f&&(it.rawContent=f),Y&&L?(G(),z().currentCellContent.push(it)):g.push(it),u="",h=[],f="",y=0,m=!1,w=void 0,A=void 0,_=void 0}},at=v=>{W();let E=v||z();if(!E)return;let B={type:"cell",text:E.currentCellContent.map(it=>it.text).join(`
137
+ `),children:[...E.currentCellContent],metadata:{row:E.rowIndex,col:E.currentCells.length}};return E.currentCellContent=[],B},pt=v=>{let E=v||z();if(!E)return;let B=at(E);if(B&&(B.children&&B.children.length>0||B.text)&&E.currentCells.push(B),E.currentCells.length>0){let it={type:"row",text:E.currentCells.map(k=>k.text).filter(k=>k!=="").join(t.newlineDelimiter??`
138
+ `),children:[...E.currentCells]};E.rows.push(it),E.currentCells=[],E.rowIndex++}},_t=()=>{if(Q)return;Q=!0;let v=z();if(!v){Q=!1;return}if(pt(v),v.rows.length>0){j++;let E={type:"table",text:v.rows.map(B=>B.text).join(`
139
+ `),children:[...v.rows]};C.length>1?C[C.length-2].currentCellContent.push(E):g.push(E)}C.pop(),C.length===0&&(Y=!1,L=!1),Q=!1},At=v=>{let E,B=it=>{if(it.type==="text"){let k=it.value,ct=k.match(/HYPERLINK\s+"([^"]+)"/i);if(ct)return ct[1];let mt=k.match(/"(https?:\/\/[^"]+|mailto:[^"]+|#[^"]+)"/);if(mt)return mt[1]}else if(it.type==="group"){let k=!1,ct;for(let mt of it.content)if(mt.type==="text"){mt.value.toUpperCase().includes("HYPERLINK")&&(k=!0);let Et=mt.value.match(/"([^"]+)"/);Et&&k&&(ct=Et[1])}else if(mt.type==="group"){let St=B(mt);St&&(ct=St)}if(ct)return ct}};for(let it of v.content)if(it.type==="group"){let k=B(it);if(k)return k}return E},gt=v=>{let E=v.trim();return E.startsWith("#")||!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(E)?"internal":"external"},xt=v=>{let E="",B=it=>{if(it.type==="text")E+=it.value;else if(it.type==="group")for(let k of it.content)B(k)};for(let it of v.content)B(it);return E},$t=v=>{let E,B="";for(let k of v.content)if(k.type==="control"){let ct=jft[k.value];ct&&(E=ct)}else k.type==="text"?B+=k.value.replace(/[^0-9a-fA-F]/g,""):k.type;if(!E||B.length===0)return;let it=$ft[E];if(it)try{let k=Buffer.from(B,"hex"),ct=E,mt=`image_${c.length+1}.${ct}`;return{type:"image",mimeType:it,data:k.toString("base64"),name:mt,extension:ct}}catch{return}},Nt=v=>{if(!/^[a-zA-Z]/.test(v.value))return`\\${v.value}`;let E=`\\${v.value}`;return v.param!==void 0&&(E+=v.param),E+=" ",E},Ot=v=>v.value.replace(/([\\{}])/g,"\\$1"),qt=(v,E,B=0)=>{if(v.type==="group"){let it=["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"],k=!1,ct=!1,mt=!1,St=!1;if(v.destination){if(v.destination==="footnote")ct=!0;else if(v.destination==="field"){let et=At(v);et&&(wt(),mt=!0,st=et)}else if(v.destination==="listtable")F=!0;else if(F&&v.destination==="list")P=!0,V=void 0,$=void 0;else if(v.destination==="listoverridetable")rt=!0;else if(rt&&v.destination==="listoverride")lt=void 0,ft=void 0;else if(v.destination==="pict")t.extractAttachments?St=!0:k=!0;else if(it.includes(v.destination))k=!0;else if(v.content.length>0&&v.content[0].type==="control"&&v.content[0].value==="*"){let et=["fldinst","nesttableprops"];t.extractAttachments&&et.push("shppict","listpicture"),et.includes(v.destination||"")||(k=!0)}}if(v.destination==="listtext"||v.destination==="pntext"){m||(y=0),m=!0;let et=xt(v);if(et){let Ut=et.trim();["\xB7","\u2022","o","\xA7","\u25A0","\u25A1","\u25CF","\u25CB","\u25C6","\u25C7","\u25BA","\u25B8","\xB7","\u2022","\u25CF","\u25CB"].some(Mt=>Ut.includes(Mt))||Ut.length===1&&!/[0-9a-zA-Z]/.test(Ut)?w="unordered":(/^[0-9ivxlcdm]+[\.\)]/i.test(Ut)||/^[a-z][\.\)]/i.test(Ut))&&(w="ordered")}k=!0}if(k)return;if(f+="{",St){let et=$t(v);et&&(c.push(et),!F&&!P&&(W(),g.push({type:"image",text:"",metadata:{attachmentName:et.name||`image_${c.length}`}})));for(let Ut of v.content)if(Ut.type==="control")f+=Nt(Ut);else if(Ut.type==="text")f+=Ot(Ut);else if(Ut.type==="group"){let oe=U=>{for(let Mt of U.content)Mt.type==="control"?f+=Nt(Mt):Mt.type==="text"?f+=Ot(Mt):Mt.type==="group"&&(f+="{",oe(Mt),f+="}")};oe(v)}f+="}";return}let Et=g;if(ct){if(t.ignoreNotes)return;W(),M++;let et={type:"note",children:[],metadata:{noteId:M.toString(),noteType:"footnote"}};o.push(et),g=et.children}let Dt={...E};for(let et of v.content){if(et.type==="group"&&et.destination==="fldinst"){f+="{";let Ut=oe=>{for(let U of oe.content)U.type==="control"?f+=Nt(U):U.type==="text"?f+=Ot(U):U.type==="group"&&(f+="{",Ut(U),f+="}")};Ut(et),f+="}";continue}qt(et,Dt,B+1)}v.destination==="listtable"?F=!1:v.destination==="list"?(P=!1,V!==void 0&&$!==void 0&&(H[V]=$)):v.destination==="listoverridetable"?rt=!1:rt&&v.destination==="listoverride"&&ft!==void 0&&lt!==void 0&&(K[ft]=lt),ct&&(W(),g=Et),mt&&(wt(),st=void 0),f+="}"}else if(v.type==="text"){if(F||rt){f+=Ot(v);return}bt(p,E)&&(wt(),p={...E}),d+=v.value,f+=Ot(v)}else if(v.type==="control"){if(f+=Nt(v),F){if(v.value==="listid")V=v.param;else if(v.value==="levelnfc"||v.value==="levelnfcn"){let it=v.param!==void 0&&(v.param===0||v.param>=0&&v.param<=4);(!$||$==="unordered"&&it)&&($=it?"ordered":"unordered")}return}if(rt){v.value==="listid"?lt=v.param:v.value==="ls"&&(ft=v.param);return}if(v.value==="par")W(),p={...E};else if(v.value==="trowd"){let it=z();Y&&it&&it.currentCellContent.length>0?(G(),C.push({rows:[],currentCells:[],currentCellContent:[],rowIndex:0})):Y||(Y=!0,G()),L=!0,q=[],nt={isMergedContinuation:!1},J=0}else if(v.value==="clvmrg")nt.isMergedContinuation=!0;else if(v.value==="clmgf")nt.isMergedContinuation=!1;else if(v.value==="cellx")q.push({...nt}),nt={isMergedContinuation:!1};else if(v.value==="cell"){L=!0;let it=!1;J<q.length&&(it=q[J].isMergedContinuation),J++;let k=at();if(k&&!it){let ct=z();ct&&ct.currentCells.push(k)}p={...E}}else if(v.value==="nestcell"){if(C.length>1){let k=z();k&&(k.rows.length>0||k.currentCells.length>0)&&_t()}L=!0;let it=at();if(it){let k=z();k&&k.currentCells.push(it)}p={...E}}else if(v.value==="row")pt(),p={...E},J=0,L=!1;else if(v.value==="nestrow")C.length>1&&_t(),pt(),p={...E},J=0;else if(v.value==="intbl")Y=!0,L=!0,G();else if(v.value==="pard")L=!1,y=0,b="left",m=!1,w=void 0,A=void 0,_=void 0,E.backgroundColor=void 0;else if(v.value==="tab")bt(p,E)&&(wt(),p={...E}),d+=" ";else if(v.value==="line")bt(p,E)&&(wt(),p={...E}),d+=`
140
+ `;else if(v.value==="lquote")bt(p,E)&&(wt(),p={...E}),d+="\u2018";else if(v.value==="rquote")bt(p,E)&&(wt(),p={...E}),d+="\u2019";else if(v.value==="ldblquote")bt(p,E)&&(wt(),p={...E}),d+="\u201C";else if(v.value==="rdblquote")bt(p,E)&&(wt(),p={...E}),d+="\u201D";else if(v.value==="u"){if(v.param!==void 0){let it=v.param;it<0&&(it+=65536),bt(p,E)&&(wt(),p={...E}),d+=String.fromCharCode(it)}}else if(v.value==="b")E.bold=v.param!==0;else if(v.value==="i")E.italic=v.param!==0;else if(v.value==="ul")E.underline=v.param!==0;else if(v.value==="ulnone")E.underline=!1;else if(v.value==="strike")E.strikethrough=v.param!==0;else if(v.value==="plain")E.bold=!1,E.italic=!1,E.underline=!1,E.strikethrough=!1,E.subscript=!1,E.superscript=!1,E.size=void 0,E.font=void 0,E.color=void 0,E.backgroundColor=void 0;else if(v.value==="fs")v.param!==void 0&&(E.size=(v.param/2).toString()+"pt");else if(v.value==="f")v.param!==void 0&&i[v.param]&&(E.font=i[v.param]);else if(v.value==="cf")v.param!==void 0&&s[v.param]&&(E.color=s[v.param]);else if(v.value==="cb"||v.value==="highlight"||v.value==="chcbpat"||v.value==="cbpat")v.param!==void 0&&s[v.param]&&(E.backgroundColor=s[v.param]);else if(v.value==="sub")E.subscript=!0,E.superscript=!1;else if(v.value==="super")E.superscript=!0,E.subscript=!1;else if(v.value==="nosupersub")E.subscript=!1,E.superscript=!1;else if(v.value==="li")v.param!==void 0&&(y=Math.floor(v.param/360));else if(v.value==="ls"){if(v.param!==void 0){m||(y=0),m=!0,D[v.param]||(N++,D[v.param]=`rtf-list-${N}`),_=D[v.param];let it=K[v.param]!==void 0?K[v.param]:v.param;H[it]&&(w=H[it])}}else v.value==="ilvl"?v.param!==void 0&&(m=!0,y=v.param):v.value==="pnlvl"?(m=!0,v.param!==void 0&&(y=v.param)):v.value==="levelnfc"||v.value==="pnf"?v.param!==void 0&&(m=!0,v.param===23?w="unordered":w="ordered"):v.value==="pndec"||v.value==="pnord"||v.value==="pnlcltr"||v.value==="pnucltr"?(m||(y=0),m=!0,w="ordered"):v.value==="pnbullet"||v.value==="pncard"?(m||(y=0),m=!0,w="unordered"):v.value==="s"?v.param!==void 0&&v.param>=1&&v.param<=9&&(A=v.param):v.value==="ql"?b="left":v.value==="qc"?b="center":v.value==="qr"?b="right":v.value==="qj"&&(b="justify")}};qt(r,{});let Jt=z();if((Y||Jt&&(Jt.rows.length>0||Jt.currentCells.length>0))&&_t(),W(),!t.putNotesAtLast&&o.length>0&&(a.push(...o),o.length=0),t.ocr&&t.extractAttachments){for(let E of c)if(E.mimeType.startsWith("image/"))try{let B=Buffer.from(E.data,"base64");E.ocrText=(await So(B,t.ocrLanguage)).trim()}catch(B){Ks(`OCR failed for ${E.name}:`,t,B)}let v=E=>{for(let B of E){if(B.type==="image"&&B.metadata&&"attachmentName"in B.metadata){let it=B.metadata,k=c.find(ct=>ct.name===it.attachmentName);k&&(k.ocrText&&(B.text=k.ocrText),k.altText&&(it.altText=k.altText))}B.children&&v(B.children)}};v(a)}let te=v=>{for(let E of v){if(E.type==="note"&&E.children){let B=it=>it.children&&it.children.length>0?it.children.map(B).join(""):it.text||"";E.text=E.children.map(B).join("").trim()}E.children&&te(E.children)}};te(a),te(o);let O={type:"rtf",metadata:{},content:a,attachments:c,toText:()=>{let v=a.map(E=>E.text).join(t.newlineDelimiter??`
141
+ `);return t.putNotesAtLast&&o.length>0&&(v+=(t.newlineDelimiter??`
142
+ `)+o.map(E=>E.text).join(t.newlineDelimiter??`
143
+ `)),v}};return t.putNotesAtLast&&o.length>0&&a.push(...o),O}catch(e){throw e}};function Hft(n){let t={},e=r=>{for(let i of r.content)if(i.type==="group"){if(i.destination==="fonttbl"){for(let s of i.content)if(s.type==="group"){let a,o="";for(let c of s.content)c.type==="control"&&c.value==="f"?a=c.param:c.type==="text"&&(o+=c.value);a!==void 0&&o&&(o=o.replace(/;$/,"").trim(),t[a]=o)}return!0}if(e(i))return!0}return!1};return e(n),t}function zft(n){let t={},e=r=>{for(let i of r.content)if(i.type==="group"){if(i.destination==="colortbl"){let s=0,a=0,o=0,c=0;for(let u of i.content)if(u.type==="control")u.value==="red"&&u.param!==void 0?a=u.param:u.value==="green"&&u.param!==void 0?o=u.param:u.value==="blue"&&u.param!==void 0&&(c=u.param);else if(u.type==="text"&&u.value===";"){let h=`#${a.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`;t[s]=h,s++,a=0,o=0,c=0}return!0}if(e(i))return!0}return!1};return e(n),t}Tt();Rt();Ct();var oZ=jp(tR());var lZ=async(n,t)=>{let e=/word\/document[\d+]?.xml/,r=/word\/footnotes[\d+]?.xml/,i=/word\/endnotes[\d+]?.xml/,s=/word\/numbering[\d+]?.xml/,a=/(word\/)?media\/.*/,o=/docProps\/core[\d+]?.xml/,c=/word\/_rels\/document[\d+]?.xml\.rels/,u=/word\/styles[\d+]?.xml/,h=new oZ.XMLSerializer,f=D=>{let F={},P=h.serializeToString(D),V=(W,at)=>{let pt=new RegExp(`<${at}(?:\\s+w:val="([^"]+)")?\\s*\\/?>`),_t=W.match(pt);if(_t){let At=_t[1];return At===void 0?!0:At==="1"||At==="true"||At==="on"}return null},$=V(P,"w:b");$!==null&&(F.bold=$);let H=V(P,"w:i");H!==null&&(F.italic=H);let rt=P.match(/<w:u(?: w:val="([^"]+)")?\/?>/);if(rt){let W=rt[1];(!W||W!=="none")&&(F.underline=!0)}let lt=V(P,"w:strike"),ft=V(P,"w:dstrike");lt!==null?F.strikethrough=lt:ft!==null&&(F.strikethrough=ft);let K=P.match(/<w:sz w:val="(\d+)"/);K&&(F.size=(parseInt(K[1])/2).toString()+"pt");let X=P.match(/<w:color w:val="([^"]+)"/);X&&X[1]!=="auto"&&(F.color="#"+X[1]);let st=P.match(/<w:shd[^>]*w:fill="([^"]+)"/);st&&st[1]!=="auto"&&(F.backgroundColor="#"+st[1]);let bt=P.match(/<w:highlight w:val="([^"]+)"/);if(bt&&bt[1]!=="none"){let W={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"};F.backgroundColor=W[bt[1]]||bt[1]}let wt=P.match(/<w:rFonts[^>]*w:ascii="([^"]+)"/);if(wt)F.font=wt[1];else{let W=P.match(/<w:rFonts[^>]*w:hAnsi="([^"]+)"/);W&&(F.font=W[1])}let Q=P.match(/<w:vertAlign w:val="([^"]+)"/);return Q&&(Q[1]==="subscript"&&(F.subscript=!0),Q[1]==="superscript"&&(F.superscript=!0)),F},d=await qf(n,D=>!!D.match(e)||!!D.match(r)||!!D.match(i)||!!D.match(s)||!!D.match(o)||!!D.match(c)||!!D.match(u)||!!t.extractAttachments&&!!D.match(a)),p=d.find(D=>D.path.match(o)),g=p?jf(p.content.toString()):{},y=new Map,b=new Map,m=[],w=[],A=d.filter(D=>D.path.match(a)),_=d.find(D=>D.path.match(c)),S={};if(_){let D=ur(_.content.toString()),F=kt(D,"Relationship");for(let P=0;P<F.length;P++){let V=F[P].getAttribute("Id"),$=F[P].getAttribute("Target");V&&$&&(S[V]=$)}}let I=d.find(D=>D.path.match(s)),C={};if(I){let D=ur(I.content.toString()),F=kt(D,"w:num"),P=kt(D,"w:abstractNum"),V={};for(let $=0;$<P.length;$++){let H=P[$].getAttribute("w:abstractNumId");H&&(V[H]=P[$])}for(let $=0;$<F.length;$++){let H=F[$].getAttribute("w:numId"),lt=kt(F[$],"w:abstractNumId")[0]?.getAttribute("w:val");if(H&&lt&&V[lt]){C[H]={};let ft=kt(V[lt],"w:lvl");for(let K=0;K<ft.length;K++){let X=ft[K].getAttribute("w:ilvl"),st=kt(ft[K],"w:numFmt")[0],bt=kt(ft[K],"w:lvlText")[0];X&&(C[H][X]={numFmt:st?.getAttribute("w:val")||"decimal",lvlText:bt?.getAttribute("w:val")||""})}}}}let M=d.find(D=>D.path.match(u)),z={};if(M){let D=ur(M.content.toString()),F=kt(D,"w:style");for(let P=0;P<F.length;P++){let V=F[P].getAttribute("w:styleId");if(V){let $=kt(F[P],"w:rPr")[0],H=kt(F[P],"w:pPr")[0],rt=$?f($):{},lt,ft;if(H){let K=kt(H,"w:jc")[0];if(K){let st=K.getAttribute("w:val");(st==="left"||st==="center"||st==="right"||st==="justify")&&(lt=st)}let X=kt(H,"w:shd")[0];if(X){let st=X.getAttribute("w:fill");st&&st!=="auto"&&(ft="#"+st)}}z[V]={formatting:rt,alignment:lt,backgroundColor:ft}}}}let G={};if(M){let D=ur(M.content.toString()),F=kt(D,"w:docDefaults")[0];if(F){let P=kt(F,"w:rPrDefault")[0];if(P){let V=kt(P,"w:rPr")[0];V&&(G=f(V))}}}let Y;if(M){let D=ur(M.content.toString()),F=kt(D,"w:style");for(let P=0;P<F.length;P++){let V=F[P].getAttribute("w:type"),$=F[P].getAttribute("w:default"),H=F[P].getAttribute("w:styleId");if(V==="paragraph"&&$==="1"&&H){Y=H;break}}!Y&&z.Normal&&(Y="Normal")}let L=[],j=[],q={},nt={},J=D=>{let F=h.serializeToString(D),P=kt(D,"w:numPr")[0],V=!!P,$=kt(D,"w:pPr")[0],H=$?kt($,"w:pStyle")[0]:null,rt=H?H.getAttribute("w:val"):null,lt=rt?rt.startsWith("Heading")||rt==="Title":!1,ft=rt&&z[rt]?z[rt]:{formatting:{}},K=ft.alignment;if($){let at=kt($,"w:jc")[0];if(at){let pt=at.getAttribute("w:val");(pt==="left"||pt==="center"||pt==="right"||pt==="justify")&&(K=pt)}}let X=ft.backgroundColor;if($){let at=kt($,"w:shd")[0];if(at){let pt=at.getAttribute("w:fill");pt&&pt!=="auto"&&(X="#"+pt)}}let st={...ft.formatting};if($){let at=kt($,"w:rPr")[0];if(at){let pt=f(at);for(let _t in pt){let At=pt[_t];At===!1?delete st[_t]:At!==void 0&&(st[_t]=At)}}}let bt="",wt=[],Q=at=>{if(at.nodeName==="w:r"){let pt=at,_t=kt(pt,"w:rPr")[0],At={};for(let Nt in st)At[Nt]=st[Nt];let gt=_t?kt(_t,"w:rStyle")[0]:null,xt=gt?gt.getAttribute("w:val"):rt;if(xt&&z[xt])for(let Nt in z[xt].formatting)At[Nt]=z[xt].formatting[Nt];if(_t){let Nt=f(_t);for(let Ot in Nt){let qt=Nt[Ot];qt===!1?delete At[Ot]:qt!==void 0&&(At[Ot]=qt)}}!At.backgroundColor&&X&&(At.backgroundColor=X);let $t=kt(pt,"w:t");for(let Nt of $t){let Ot=Nt.textContent||"";bt+=Ot;let qt={type:"text",text:Ot,formatting:At};t.includeRawContent&&(qt.rawContent=h.serializeToString(Nt));let Jt=xt||rt||Y;Jt&&(qt.metadata={style:Jt}),wt.push(qt)}if(t.extractAttachments){let Nt=kt(pt,"w:drawing"),Ot=kt(pt,"w:pict"),qt=[...Nt,...Ot];for(let Jt of qt){let te=h.serializeToString(Jt),O="",v=kt(Jt,"wp:docPr")[0];v&&(O=v.getAttribute("descr")||v.getAttribute("title")||"");let E="",B=kt(Jt,"a:blip")[0];if(B)E=B.getAttribute("r:embed")||"";else{let it=kt(Jt,"v:imagedata")[0];it&&(E=it.getAttribute("r:id")||"")}if(E&&S[E]){let k=S[E].split("/").pop();if(k){let ct={type:"image",text:"",metadata:{attachmentName:k,altText:O}};t.includeRawContent&&(ct.rawContent=te),wt.push(ct)}}else{let it={type:"image",text:""};t.includeRawContent&&(it.rawContent=te),wt.push(it)}}}if(!t.ignoreNotes){let Nt=kt(pt,"w:footnoteReference")[0];if(Nt){let qt=Nt.getAttribute("w:id");if(qt&&y.has(qt)){let Jt=y.get(qt),te={type:"note",text:Jt.map(O=>O.text).join(" "),children:Jt,metadata:{noteType:"footnote",noteId:qt}};t.putNotesAtLast?m.push(te):wt.push(te)}}let Ot=kt(pt,"w:endnoteReference")[0];if(Ot){let qt=Ot.getAttribute("w:id");if(qt&&b.has(qt)){let Jt=b.get(qt),te={type:"note",text:Jt.map(O=>O.text).join(" "),children:Jt,metadata:{noteType:"endnote",noteId:qt}};t.putNotesAtLast?m.push(te):wt.push(te)}}}}else if(at.nodeName==="w:hyperlink"){let pt=at,_t=pt.getAttribute("r:id"),At=pt.getAttribute("w:anchor"),gt;At?gt={link:"#"+At,linkType:"internal"}:_t&&S[_t]&&(gt={link:S[_t],linkType:"external"});let xt=Array.from(pt.childNodes);for(let $t of xt){let Nt=wt.length;if(Q($t),gt)for(let Ot=Nt;Ot<wt.length;Ot++)wt[Ot].type==="text"&&(wt[Ot].metadata={...wt[Ot].metadata??{},...gt})}}},W=Array.from(D.childNodes);for(let at of W)Q(at);if(V){let at=kt(P,"w:numId")[0],pt=kt(P,"w:ilvl")[0],_t=at&&at.getAttribute("w:val")||"0",At=pt?parseInt(pt.getAttribute("w:val")||"0"):0,gt="ordered",xt=0;if(_t&&C[_t]){let Nt=At.toString();q[_t]||(q[_t]={}),q[_t][Nt]||(q[_t][Nt]=0),q[_t][Nt]++;for(let qt=At+1;qt<10;qt++)q[_t][qt.toString()]&&(q[_t][qt.toString()]=0);gt=(C[_t][Nt]?.numFmt||"decimal")==="bullet"?"unordered":"ordered",nt[_t]||(nt[_t]={}),nt[_t][Nt]===void 0?nt[_t][Nt]=0:nt[_t][Nt]++,xt=nt[_t][Nt]}let $t={type:"list",text:bt,children:wt,metadata:{listType:gt,indentation:At,alignment:K||"left",listId:_t,itemIndex:xt,style:rt}};return t.includeRawContent&&($t.rawContent=F),$t}else if(lt){let at=rt&&parseInt(rt.replace("Heading",""))||1,pt={type:"heading",text:bt,children:wt,metadata:{level:at,alignment:K,style:rt??void 0}};return t.includeRawContent&&(pt.rawContent=F),pt}else{let at={type:"paragraph",text:bt,children:wt,metadata:{alignment:K,style:rt??void 0}};return t.includeRawContent&&(at.rawContent=F),at}},N=D=>{let F=[],P=Fi(D,"w:tr");for(let V=0;V<P.length;V++){let $=P[V],H=[],rt=Fi($,"w:tc");for(let ft=0;ft<rt.length;ft++){let K=rt[ft],X=[],st="",bt=Array.from(K.childNodes);for(let Q of bt)if(Q.nodeName==="w:p"){let W=J(Q);X.push(W),st+=W.text}else if(Q.nodeName==="w:tbl"){let W=N(Q);X.push(W)}let wt={type:"cell",text:st,children:X,metadata:{row:V,col:ft}};H.push(wt)}let lt={type:"row",children:H};F.push(lt)}return{type:"table",children:F}};if(!t.ignoreNotes){let D=d.find(P=>P.path.match(r));if(D){let P=ur(D.content.toString()),V=kt(P,"w:footnote");for(let $ of V){let H=$.getAttribute("w:id");if(!H||H==="-1"||H==="0")continue;let rt=kt($,"w:p");y.set(H,rt.map(lt=>J(lt)))}}let F=d.find(P=>P.path.match(i));if(F){let P=ur(F.content.toString()),V=kt(P,"w:endnote");for(let $ of V){let H=$.getAttribute("w:id");if(!H||H==="-1"||H==="0")continue;let rt=kt($,"w:p");b.set(H,rt.map(lt=>J(lt)))}}}for(let D of d){if(D.path.match(a)||D.path.match(s)||D.path.match(c)||D.path.match(u)||D.path.match(r)||D.path.match(i))continue;let F=D.content.toString();t.includeRawContent&&j.push(F);let P=ur(F),V=kt(P,"w:body")[0];if(V){let $=Array.from(V.childNodes);for(let H of $)H.nodeName==="w:p"?L.push(J(H)):H.nodeName==="w:tbl"&&L.push(N(H))}}if(t.extractAttachments){for(let D of A){let F=gl(D.path.split("/").pop()||"image",D.content);if(w.push(F),t.ocr&&F.mimeType.startsWith("image/"))try{F.ocrText=(await So(D.content,t.ocrLanguage)).trim()}catch(P){Ks(`OCR failed for ${F.name}:`,t,P)}}if(t.ocr){let D=F=>{for(let P of F){if(P.type==="image"&&"attachmentName"in(P.metadata||{})){let V=P.metadata,$=w.find(H=>H.name===V.attachmentName);$&&$.ocrText&&(P.text=$.ocrText,$.altText=V.altText)}P.children&&D(P.children)}};D(L)}}return t.putNotesAtLast&&m.length>0&&L.push(...m),{type:"docx",metadata:{...g,formatting:G,styleMap:z},content:L,attachments:w,toText:()=>L.map(D=>{let F=P=>{let V="";return P.children?V+=P.children.map(F).filter($=>$!="").join(P.children[0]?.children?t.newlineDelimiter??`
144
+ `:""):V+=P.text||"",V};return F(D)}).filter(D=>D!="").join(t.newlineDelimiter??`
145
+ `)}};var S0=class{static async parseOffice(t,e,r){let i,s={};typeof e=="function"?(i=e,s=r||{}):s=e||{};let a={ignoreNotes:!1,newlineDelimiter:`
146
+ `,putNotesAtLast:!1,outputErrorToConsole:!1,extractAttachments:!1,ocr:!1,ocrLanguage:"eng",includeRawContent:!1,pdfWorkerSrc:"",...s},o=Buffer.alloc(0),c="",u;try{if(!t)throw Ou("IMPROPER_ARGUMENTS",a);if(t instanceof ArrayBuffer)o=Buffer.from(t);else if(Buffer.isBuffer(t))o=t;else if(typeof t=="string"){if(u=t,!IC(t))throw Ou("FILE_DOES_NOT_EXIST",a,t);if($L(t).isDirectory())throw Ou("LOCATION_NOT_FOUND",a,t);o=HL(t),c=t.split(".").pop()?.toLowerCase()||""}else throw Ou("INVALID_INPUT",a);if(!c){let f=await cZ.fromBuffer(o);if(f)c=f.ext.toLowerCase();else throw Ou("IMPROPER_BUFFERS",a)}let h;switch(c){case"docx":h=await lZ(o,a);break;case"pptx":h=await sZ(o,a);break;case"xlsx":h=await hV(o,a);break;case"odt":case"odp":case"ods":h=await fV(o,a);break;case"pdf":h=await nZ(o,a);break;case"rtf":h=await aZ(o,a);break;default:throw Ou("EXTENSION_UNSUPPORTED",a,c)}return i&&i(h),h}catch(h){let f=SH(h,a,u);throw i&&i(void 0,f),f}}};var Wft=S0.parseOffice;var Gft=S0;if(typeof Up<"u"&&typeof module<"u"&&Up.main===module){let i=function(s){return s.startsWith("--")&&s.includes("=")};Vft=i;let n=process.argv.slice(2),t,e=!1,r=[];if(n.forEach(s=>{i(s)?r.push(s):t||(t=s)}),t){let s={};r.forEach(a=>{let[o,c]=a.split("="),u=o.replace("--","");u==="toText"?c.toLowerCase()==="true"?e=!0:c.toLowerCase()==="false"?e=!1:console.log(`Invalid value for toText: ${c}`):c.toLowerCase()==="true"?s[u]=!0:c.toLowerCase()==="false"?s[u]=!1:s[u]=c}),S0.parseOffice(t,s).then(a=>{console.log(e?a.toText():JSON.stringify(a,null,2))}).catch(console.error)}else console.log("Usage: node officeparser [file] [--option=value]")}var Vft;return xn(Xft);})();
147
+ /*! Bundled license information:
148
+
149
+ @jspm/core/nodelibs/browser/chunk-DtuTasat.js:
150
+ @jspm/core/nodelibs/browser/chunk-B738Er4n.js:
151
+ ieee754/index.js:
152
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
153
+
154
+ @jspm/core/nodelibs/browser/chunk-CjPlbOtt.js:
155
+ (*!
156
+ * The buffer module from node.js, for the browser.
157
+ *
158
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
159
+ * @license MIT
160
+ *)
161
+
162
+ @jspm/core/nodelibs/browser/chunk-CcCWfKp1.js:
163
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
164
+ */
165
+ //# sourceMappingURL=officeparser.browser.js.map