vendor: 40,399 bytes, lines 1-9
1var US=Object.defineProperty;var d0=o=>{throw TypeError(o)};var $S=(o,t,e)=>t in o?US(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var k=(o,t,e)=>$S(o,typeof t!="symbol"?t+"":t,e),pm=(o,t,e)=>t.has(o)||d0("Cannot "+e);var s=(o,t,e)=>(pm(o,t,"read from private field"),e?e.call(o):t.get(o)),A=(o,t,e)=>t.has(o)?d0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(o):t.set(o,e),p=(o,t,e,i)=>(pm(o,t,"write to private field"),i?i.call(o,e):t.set(o,e),e),w=(o,t,e)=>(pm(o,t,"access private method"),e);var ce=(o,t,e,i)=>({set _(n){p(o,t,n,e)},get _(){return s(o,t,i)}});function LA(o,t){return function(){return o.apply(t,arguments)}}const{toString:HS}=Object.prototype,{getPrototypeOf:hg}=Object,{iterator:ug,toStringTag:kA}=Symbol,dg=(o=>t=>{const e=HS.call(t);return o[e]||(o[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Rn=o=>(o=o.toLowerCase(),t=>dg(t)===o),fg=o=>t=>typeof t===o,{isArray:sh}=Array,th=fg("undefined");function zd(o){return o!==null&&!th(o)&&o.constructor!==null&&!th(o.constructor)&&wi(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const IA=Rn("ArrayBuffer");function jS(o){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(o):t=o&&o.buffer&&IA(o.buffer),t}const zS=fg("string"),wi=fg("function"),FA=fg("number"),Gd=o=>o!==null&&typeof o=="object",GS=o=>o===!0||o===!1,Uf=o=>{if(dg(o)!=="object")return!1;const t=hg(o);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(kA in o)&&!(ug in o)},WS=o=>{if(!Gd(o)||zd(o))return!1;try{return Object.keys(o).length===0&&Object.getPrototypeOf(o)===Object.prototype}catch{return!1}},VS=Rn("Date"),qS=Rn("File"),XS=o=>!!(o&&typeof o.uri<"u"),YS=o=>o&&typeof o.getParts<"u",KS=Rn("Blob"),JS=Rn("FileList"),QS=o=>Gd(o)&&wi(o.pipe);function ZS(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const f0=ZS(),p0=typeof f0.FormData<"u"?f0.FormData:void 0,t_=o=>{if(!o)return!1;if(p0&&o instanceof p0)return!0;const t=hg(o);if(!t||t===Object.prototype||!wi(o.append))return!1;const e=dg(o);return e==="formdata"||e==="object"&&wi(o.toString)&&o.toString()==="[object FormData]"},e_=Rn("URLSearchParams"),[i_,n_,s_,r_]=["ReadableStream","Request","Response","Headers"].map(Rn),a_=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Wd(o,t,{allOwnKeys:e=!1}={}){if(o===null||typeof o>"u")return;let i,n;if(typeof o!="object"&&(o=[o]),sh(o))for(i=0,n=o.length;i<n;i++)t.call(null,o[i],i,o);else{if(zd(o))return;const r=e?Object.getOwnPropertyNames(o):Object.keys(o),a=r.length;let l;for(i=0;i<a;i++)l=r[i],t.call(null,o[l],l,o)}}function NA(o,t){if(zd(o))return null;t=t.toLowerCase();const e=Object.keys(o);let i=e.length,n;for(;i-- >0;)if(n=e[i],t===n.toLowerCase())return n;return null}const Pa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,BA=o=>!th(o)&&o!==Pa;function Xm(...o){const{caseless:t,skipUndefined:e}=BA(this)&&this||{},i={},n=(r,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const l=t&&NA(i,a)||a,c=Ym(i,l)?i[l]:void 0;Uf(c)&&Uf(r)?i[l]=Xm(c,r):Uf(r)?i[l]=Xm({},r):sh(r)?i[l]=r.slice():(!e||!th(r))&&(i[l]=r)};for(let r=0,a=o.length;r<a;r++)o[r]&&Wd(o[r],n);return i}const o_=(o,t,e,{allOwnKeys:i}={})=>(Wd(t,(n,r)=>{e&&wi(n)?Object.defineProperty(o,r,{__proto__:null,value:LA(n,e),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(o,r,{__proto__:null,value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),o),l_=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),c_=(o,t,e,i)=>{o.prototype=Object.create(t.prototype,i),Object.defineProperty(o.prototype,"constructor",{__proto__:null,value:o,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(o,"super",{__proto__:null,value:t.prototype}),e&&Object.assign(o.prototype,e)},h_=(o,t,e,i)=>{let n,r,a;const l={};if(t=t||{},o==null)return t;do{for(n=Object.getOwnPropertyNames(o),r=n.length;r-- >0;)a=n[r],(!i||i(a,o,t))&&!l[a]&&(t[a]=o[a],l[a]=!0);o=e!==!1&&hg(o)}while(o&&(!e||e(o,t))&&o!==Object.prototype);return t},u_=(o,t,e)=>{o=String(o),(e===void 0||e>o.length)&&(e=o.length),e-=t.length;const i=o.indexOf(t,e);return i!==-1&&i===e},d_=o=>{if(!o)return null;if(sh(o))return o;let t=o.length;if(!FA(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=o[t];return e},f_=(o=>t=>o&&t instanceof o)(typeof Uint8Array<"u"&&hg(Uint8Array)),p_=(o,t)=>{const i=(o&&o[ug]).call(o);let n;for(;(n=i.next())&&!n.done;){const r=n.value;t.call(o,r[0],r[1])}},g_=(o,t)=>{let e;const i=[];for(;(e=o.exec(t))!==null;)i.push(e);return i},m_=Rn("HTMLFormElement"),y_=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,i,n){return i.toUpperCase()+n}),Ym=(({hasOwnProperty:o})=>(t,e)=>o.call(t,e))(Object.prototype),b_=Rn("RegExp"),UA=(o,t)=>{const e=Object.getOwnPropertyDescriptors(o),i={};Wd(e,(n,r)=>{let a;(a=t(n,r,o))!==!1&&(i[r]=a||n)}),Object.defineProperties(o,i)},A_=o=>{UA(o,(t,e)=>{if(wi(o)&&["arguments","caller","callee"].includes(e))return!1;const i=o[e];if(wi(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},w_=(o,t)=>{const e={},i=n=>{n.forEach(r=>{e[r]=!0})};return sh(o)?i(o):i(String(o).split(t)),e},v_=()=>{},S_=(o,t)=>o!=null&&Number.isFinite(o=+o)?o:t;function __(o){return!!(o&&wi(o.append)&&o[kA]==="FormData"&&o[ug])}const E_=o=>{const t=new WeakSet,e=i=>{if(Gd(i)){if(t.has(i))return;if(zd(i))return i;if(!("toJSON"in i)){t.add(i);const n=sh(i)?[]:{};return Wd(i,(r,a)=>{const l=e(r);!th(l)&&(n[a]=l)}),t.delete(i),n}}return i};return e(o)},x_=Rn("AsyncFunction"),C_=o=>o&&(Gd(o)||wi(o))&&wi(o.then)&&wi(o.catch),$A=((o,t)=>o?setImmediate:t?((e,i)=>(Pa.addEventListener("message",({source:n,data:r})=>{n===Pa&&r===e&&i.length&&i.shift()()},!1),n=>{i.push(n),Pa.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",wi(Pa.postMessage)),T_=typeof queueMicrotask<"u"?queueMicrotask.bind(Pa):typeof process<"u"&&process.nextTick||$A,P_=o=>o!=null&&wi(o[ug]),M={isArray:sh,isArrayBuffer:IA,isBuffer:zd,isFormData:t_,isArrayBufferView:jS,isString:zS,isNumber:FA,isBoolean:GS,isObject:Gd,isPlainObject:Uf,isEmptyObject:WS,isReadableStream:i_,isRequest:n_,isResponse:s_,isHeaders:r_,isUndefined:th,isDate:VS,isFile:qS,isReactNativeBlob:XS,isReactNative:YS,isBlob:KS,isRegExp:b_,isFunction:wi,isStream:QS,isURLSearchParams:e_,isTypedArray:f_,isFileList:JS,forEach:Wd,merge:Xm,extend:o_,trim:a_,stripBOM:l_,inherits:c_,toFlatObject:h_,kindOf:dg,kindOfTest:Rn,endsWith:u_,toArray:d_,forEachEntry:p_,matchAll:g_,isHTMLForm:m_,hasOwnProperty:Ym,hasOwnProp:Ym,reduceDescriptors:UA,freezeMethods:A_,toObjectSet:w_,toCamelCase:y_,noop:v_,toFiniteNumber:S_,findKey:NA,global:Pa,isContextDefined:BA,isSpecCompliantForm:__,toJSONObject:E_,isAsyncFn:x_,isThenable:C_,setImmediate:$A,asap:T_,isIterable:P_},R_=M.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),M_=o=>{const t={};let e,i,n;return o&&o.split(` 2`).forEach(function(a){n=a.indexOf(":"),e=a.substring(0,n).trim().toLowerCase(),i=a.substring(n+1).trim(),!(!e||t[e]&&R_[e])&&(e==="set-cookie"?t[e]?t[e].push(i):t[e]=[i]:t[e]=t[e]?t[e]+", "+i:i)}),t};function D_(o){let t=0,e=o.length;for(;t<e;){const i=o.charCodeAt(t);if(i!==9&&i!==32)break;t+=1}for(;e>t;){const i=o.charCodeAt(e-1);if(i!==9&&i!==32)break;e-=1}return t===0&&e===o.length?o:o.slice(t,e)}const O_=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),L_=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Ib(o,t){return M.isArray(o)?o.map(e=>Ib(e,t)):D_(String(o).replace(t,""))}const k_=o=>Ib(o,O_),I_=o=>Ib(o,L_);function HA(o){const t=Object.create(null);return M.forEach(o.toJSON(),(e,i)=>{t[i]=I_(e)}),t}const g0=Symbol("internals");function _h(o){return o&&String(o).trim().toLowerCase()}function $f(o){return o===!1||o==null?o:M.isArray(o)?o.map($f):k_(String(o))}function F_(o){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=e.exec(o);)t[i[1]]=i[2];return t}const N_=o=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());function gm(o,t,e,i,n){if(M.isFunction(i))return i.call(this,t,e);if(n&&(t=e),!!M.isString(t)){if(M.isString(i))return t.indexOf(i)!==-1;if(M.isRegExp(i))return i.test(t)}}function B_(o){return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,i)=>e.toUpperCase()+i)}function U_(o,t){const e=M.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(o,i+e,{__proto__:null,value:function(n,r,a){return this[i].call(this,t,n,r,a)},configurable:!0})})}let ai=class{constructor(t){t&&this.set(t)}set(t,e,i){const n=this;function r(l,c,h){const u=_h(c);if(!u)throw new Error("header name must be a non-empty string");const d=M.findKey(n,u);(!d||n[d]===void 0||h===!0||h===void 0&&n[d]!==!1)&&(n[d||c]=$f(l))}const a=(l,c)=>M.forEach(l,(h,u)=>r(h,u,c));if(M.isPlainObject(t)||t instanceof this.constructor)a(t,e);else if(M.isString(t)&&(t=t.trim())&&!N_(t))a(M_(t),e);else if(M.isObject(t)&&M.isIterable(t)){let l={},c,h;for(const u of t){if(!M.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[h=u[0]]=(c=l[h])?M.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}a(l,e)}else t!=null&&r(e,t,i);return this}get(t,e){if(t=_h(t),t){const i=M.findKey(this,t);if(i){const n=this[i];if(!e)return n;if(e===!0)return F_(n);if(M.isFunction(e))return e.call(this,n,i);if(M.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=_h(t),t){const i=M.findKey(this,t);return!!(i&&this[i]!==void 0&&(!e||gm(this,this[i],i,e)))}return!1}delete(t,e){const i=this;let n=!1;function r(a){if(a=_h(a),a){const l=M.findKey(i,a);l&&(!e||gm(i,i[l],l,e))&&(delete i[l],n=!0)}}return M.isArray(t)?t.forEach(r):r(t),n}clear(t){const e=Object.keys(this);let i=e.length,n=!1;for(;i--;){const r=e[i];(!t||gm(this,this[r],r,t,!0))&&(delete this[r],n=!0)}return n}normalize(t){const e=this,i={};return M.forEach(this,(n,r)=>{const a=M.findKey(i,r);if(a){e[a]=$f(n),delete e[r];return}const l=t?B_(r):String(r).trim();l!==r&&delete e[r],e[l]=$f(n),i[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return M.forEach(this,(i,n)=>{i!=null&&i!==!1&&(e[n]=t&&M.isArray(i)?i.join(", "):i)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(` 3`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const i=new this(t);return e.forEach(n=>i.set(n)),i}static accessor(t){const i=(this[g0]=this[g0]={accessors:{}}).accessors,n=this.prototype;function r(a){const l=_h(a);i[l]||(U_(n,a),i[l]=!0)}return M.isArray(t)?t.forEach(r):r(t),this}};ai.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);M.reduceDescriptors(ai.prototype,({value:o},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>o,set(i){this[e]=i}}});M.freezeMethods(ai);const $_="[REDACTED ****]";function H_(o){if(M.hasOwnProp(o,"toJSON"))return!0;let t=Object.getPrototypeOf(o);for(;t&&t!==Object.prototype;){if(M.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function j_(o,t){const e=new Set(t.map(r=>String(r).toLowerCase())),i=[],n=r=>{if(r===null||typeof r!="object"||M.isBuffer(r))return r;if(i.indexOf(r)!==-1)return;r instanceof ai&&(r=r.toJSON()),i.push(r);let a;if(M.isArray(r))a=[],r.forEach((l,c)=>{const h=n(l);M.isUndefined(h)||(a[c]=h)});else{if(!M.isPlainObject(r)&&H_(r))return i.pop(),r;a=Object.create(null);for(const[l,c]of Object.entries(r)){const h=e.has(l.toLowerCase())?$_:n(c);M.isUndefined(h)||(a[l]=h)}}return i.pop(),a};return n(o)}let q=class jA extends Error{static from(t,e,i,n,r,a){const l=new jA(t.message,e||t.code,i,n,r);return l.cause=t,l.name=t.name,t.status!=null&&l.status==null&&(l.status=t.status),a&&Object.assign(l,a),l}constructor(t,e,i,n,r){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,e&&(this.code=e),i&&(this.config=i),n&&(this.request=n),r&&(this.response=r,this.status=r.status)}toJSON(){const t=this.config,e=t&&M.hasOwnProp(t,"redact")?t.redact:void 0,i=M.isArray(e)&&e.length>0?j_(t,e):M.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:i,code:this.code,status:this.status}}};q.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";q.ERR_BAD_OPTION="ERR_BAD_OPTION";q.ECONNABORTED="ECONNABORTED";q.ETIMEDOUT="ETIMEDOUT";q.ECONNREFUSED="ECONNREFUSED";q.ERR_NETWORK="ERR_NETWORK";q.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";q.ERR_DEPRECATED="ERR_DEPRECATED";q.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";q.ERR_BAD_REQUEST="ERR_BAD_REQUEST";q.ERR_CANCELED="ERR_CANCELED";q.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";q.ERR_INVALID_URL="ERR_INVALID_URL";q.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const z_=null;function Km(o){return M.isPlainObject(o)||M.isArray(o)}function zA(o){return M.endsWith(o,"[]")?o.slice(0,-2):o}function mm(o,t,e){return o?o.concat(t).map(function(n,r){return n=zA(n),!e&&r?"["+n+"]":n}).join(e?".":""):t}function G_(o){return M.isArray(o)&&!o.some(Km)}const W_=M.toFlatObject(M,{},null,function(t){return/^is[A-Z]/.test(t)});function pg(o,t,e){if(!M.isObject(o))throw new TypeError("target must be an object");t=t||new FormData,e=M.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,S){return!M.isUndefined(S[v])});const i=e.metaTokens,n=e.visitor||d,r=e.dots,a=e.indexes,l=e.Blob||typeof Blob<"u"&&Blob,c=e.maxDepth===void 0?100:e.maxDepth,h=l&&M.isSpecCompliantForm(t);if(!M.isFunction(n))throw new TypeError("visitor must be a function");function u(y){if(y===null)return"";if(M.isDate(y))return y.toISOString();if(M.isBoolean(y))return y.toString();if(!h&&M.isBlob(y))throw new q("Blob is not supported. Use a Buffer instead.");return M.isArrayBuffer(y)||M.isTypedArray(y)?h&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function d(y,v,S){let x=y;if(M.isReactNative(t)&&M.isReactNativeBlob(y))return t.append(mm(S,v,r),u(y)),!1;if(y&&!S&&typeof y=="object"){if(M.endsWith(v,"{}"))v=i?v:v.slice(0,-2),y=JSON.stringify(y);else if(M.isArray(y)&&G_(y)||(M.isFileList(y)||M.endsWith(v,"[]"))&&(x=M.toArray(y)))return v=zA(v),x.forEach(function(C,T){!(M.isUndefined(C)||C===null)&&t.append(a===!0?mm([v],T,r):a===null?v:v+"[]",u(C))}),!1}return Km(y)?!0:(t.append(mm(S,v,r),u(y)),!1)}const f=[],m=Object.assign(W_,{defaultVisitor:d,convertValue:u,isVisitable:Km});function b(y,v,S=0){if(!M.isUndefined(y)){if(S>c)throw new q("Object is too deeply nested ("+S+" levels). Max depth: "+c,q.ERR_FORM_DATA_DEPTH_EXCEEDED);if(f.indexOf(y)!==-1)throw Error("Circular reference detected in "+v.join("."));f.push(y),M.forEach(y,function(E,C){(!(M.isUndefined(E)||E===null)&&n.call(t,E,M.isString(C)?C.trim():C,v,m))===!0&&b(E,v?v.concat(C):[C],S+1)}),f.pop()}}if(!M.isObject(o))throw new TypeError("data must be an object");return b(o),t}function m0(o){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(o).replace(/[!'()~]|%20/g,function(i){return t[i]})}function Fb(o,t){this._pairs=[],o&&pg(o,this,t)}const GA=Fb.prototype;GA.append=function(t,e){this._pairs.push([t,e])};GA.toString=function(t){const e=t?function(i){return t.call(this,i,m0)}:m0;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function V_(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function WA(o,t,e){if(!t)return o;const i=e&&e.encode||V_,n=M.isFunction(e)?{serialize:e}:e,r=n&&n.serialize;let a;if(r?a=r(t,n):a=M.isURLSearchParams(t)?t.toString():new Fb(t,n).toString(i),a){const l=o.indexOf("#");l!==-1&&(o=o.slice(0,l)),o+=(o.indexOf("?")===-1?"?":"&")+a}return o}class y0{constructor(){this.handlers=[]}use(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){M.forEach(this.handlers,function(i){i!==null&&t(i)})}}const Nb={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},q_=typeof URLSearchParams<"u"?URLSearchParams:Fb,X_=typeof FormData<"u"?FormData:null,Y_=typeof Blob<"u"?Blob:null,K_={isBrowser:!0,classes:{URLSearchParams:q_,FormData:X_,Blob:Y_},protocols:["http","https","file","blob","url","data"]},Bb=typeof window<"u"&&typeof document<"u",Jm=typeof navigator=="object"&&navigator||void 0,J_=Bb&&(!Jm||["ReactNative","NativeScript","NS"].indexOf(Jm.product)<0),Q_=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Z_=Bb&&window.location.href||"http://localhost",tE=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Bb,hasStandardBrowserEnv:J_,hasStandardBrowserWebWorkerEnv:Q_,navigator:Jm,origin:Z_},Symbol.toStringTag,{value:"Module"})),Xe={...tE,...K_};function eE(o,t){return pg(o,new Xe.classes.URLSearchParams,{visitor:function(e,i,n,r){return Xe.isNode&&M.isBuffer(e)?(this.append(i,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}function iE(o){return M.matchAll(/\w+|\[(\w*)]/g,o).map(t=>t[0]==="[]"?"":t[1]||t[0])}function nE(o){const t={},e=Object.keys(o);let i;const n=e.length;let r;for(i=0;i<n;i++)r=e[i],t[r]=o[r];return t}function VA(o){function t(e,i,n,r){let a=e[r++];if(a==="__proto__")return!0;const l=Number.isFinite(+a),c=r>=e.length;return a=!a&&M.isArray(n)?n.length:a,c?(M.hasOwnProp(n,a)?n[a]=M.isArray(n[a])?n[a].concat(i):[n[a],i]:n[a]=i,!l):((!M.hasOwnProp(n,a)||!M.isObject(n[a]))&&(n[a]=[]),t(e,i,n[a],r)&&M.isArray(n[a])&&(n[a]=nE(n[a])),!l)}if(M.isFormData(o)&&M.isFunction(o.entries)){const e={};return M.forEachEntry(o,(i,n)=>{t(iE(i),n,e,0)}),e}return null}const ll=(o,t)=>o!=null&&M.hasOwnProp(o,t)?o[t]:void 0;function sE(o,t,e){if(M.isString(o))try{return(t||JSON.parse)(o),M.trim(o)}catch(i){if(i.name!=="SyntaxError")throw i}return(e||JSON.stringify)(o)}const Vd={transitional:Nb,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const i=e.getContentType()||"",n=i.indexOf("application/json")>-1,r=M.isObject(t);if(r&&M.isHTMLForm(t)&&(t=new FormData(t)),M.isFormData(t))return n?JSON.stringify(VA(t)):t;if(M.isArrayBuffer(t)||M.isBuffer(t)||M.isStream(t)||M.isFile(t)||M.isBlob(t)||M.isReadableStream(t))return t;if(M.isArrayBufferView(t))return t.buffer;if(M.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(r){const c=ll(this,"formSerializer");if(i.indexOf("application/x-www-form-urlencoded")>-1)return eE(t,c).toString();if((l=M.isFileList(t))||i.indexOf("multipart/form-data")>-1){const h=ll(this,"env"),u=h&&h.FormData;return pg(l?{"files[]":t}:t,u&&new u,c)}}return r||n?(e.setContentType("application/json",!1),sE(t)):t}],transformResponse:[function(t){const e=ll(this,"transitional")||Vd.transitional,i=e&&e.forcedJSONParsing,n=ll(this,"responseType"),r=n==="json";if(M.isResponse(t)||M.isReadableStream(t))return t;if(t&&M.isString(t)&&(i&&!n||r)){const l=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t,ll(this,"parseReviver"))}catch(c){if(l)throw c.name==="SyntaxError"?q.from(c,q.ERR_BAD_RESPONSE,this,null,ll(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Xe.classes.FormData,Blob:Xe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};M.forEach(["delete","get","head","post","put","patch","query"],o=>{Vd.headers[o]={}});function ym(o,t){const e=this||Vd,i=t||e,n=ai.from(i.headers);let r=i.data;return M.forEach(o,function(l){r=l.call(e,r,n.normalize(),t?t.status:void 0)}),n.normalize(),r}function qA(o){return!!(o&&o.__CANCEL__)}let qd=class extends q{constructor(t,e,i){super(t??"canceled",q.ERR_CANCELED,e,i),this.name="CanceledError",this.__CANCEL__=!0}};function XA(o,t,e){const i=e.config.validateStatus;!e.status||!i||i(e.status)?o(e):t(new q("Request failed with status code "+e.status,e.status>=400&&e.status<500?q.ERR_BAD_REQUEST:q.ERR_BAD_RESPONSE,e.config,e.request,e))}function rE(o){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(o);return t&&t[1]||""}function aE(o,t){o=o||10;const e=new Array(o),i=new Array(o);let n=0,r=0,a;return t=t!==void 0?t:1e3,function(c){const h=Date.now(),u=i[r];a||(a=h),e[n]=c,i[n]=h;let d=r,f=0;for(;d!==n;)f+=e[d++],d=d%o;if(n=(n+1)%o,n===r&&(r=(r+1)%o),h-a<t)return;const m=u&&h-u;return m?Math.round(f*1e3/m):void 0}}function oE(o,t){let e=0,i=1e3/t,n,r;const a=(h,u=Date.now())=>{e=u,n=null,r&&(clearTimeout(r),r=null),o(...h)};return[(...h)=>{const u=Date.now(),d=u-e;d>=i?a(h,u):(n=h,r||(r=setTimeout(()=>{r=null,a(n)},i-d)))},()=>n&&a(n)]}const xp=(o,t,e=3)=>{let i=0;const n=aE(50,250);return oE(r=>{if(!r||typeof r.loaded!="number")return;const a=r.loaded,l=r.lengthComputable?r.total:void 0,c=l!=null?Math.min(a,l):a,h=Math.max(0,c-i),u=n(h);i=Math.max(i,c);const d={loaded:c,total:l,progress:l?c/l:void 0,bytes:h,rate:u||void 0,estimated:u&&l?(l-c)/u:void 0,event:r,lengthComputable:l!=null,[t?"download":"upload"]:!0};o(d)},e)},b0=(o,t)=>{const e=o!=null;return[i=>t[0]({lengthComputable:e,total:o,loaded:i}),t[1]]},A0=o=>(...t)=>M.asap(()=>o(...t)),lE=Xe.hasStandardBrowserEnv?((o,t)=>e=>(e=new URL(e,Xe.origin),o.protocol===e.protocol&&o.host===e.host&&(t||o.port===e.port)))(new URL(Xe.origin),Xe.navigator&&/(msie|trident)/i.test(Xe.navigator.userAgent)):()=>!0,cE=Xe.hasStandardBrowserEnv?{write(o,t,e,i,n,r,a){if(typeof document>"u")return;const l=[`${o}=${encodeURIComponent(t)}`];M.isNumber(e)&&l.push(`expires=${new Date(e).toUTCString()}`),M.isString(i)&&l.push(`path=${i}`),M.isString(n)&&l.push(`domain=${n}`),r===!0&&l.push("secure"),M.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.join("; ")},read(o){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let e=0;e<t.length;e++){const i=t[e].replace(/^\s+/,""),n=i.indexOf("=");if(n!==-1&&i.slice(0,n)===o)return decodeURIComponent(i.slice(n+1))}return null},remove(o){this.write(o,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function hE(o){return typeof o!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function uE(o,t){return t?o.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):o}function YA(o,t,e){let i=!hE(t);return o&&(i||e===!1)?uE(o,t):t}const w0=o=>o instanceof ai?{...o}:o;function Go(o,t){t=t||{};const e=Object.create(null);Object.defineProperty(e,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function i(h,u,d,f){return M.isPlainObject(h)&&M.isPlainObject(u)?M.merge.call({caseless:f},h,u):M.isPlainObject(u)?M.merge({},u):M.isArray(u)?u.slice():u}function n(h,u,d,f){if(M.isUndefined(u)){if(!M.isUndefined(h))return i(void 0,h,d,f)}else return i(h,u,d,f)}function r(h,u){if(!M.isUndefined(u))return i(void 0,u)}function a(h,u){if(M.isUndefined(u)){if(!M.isUndefined(h))return i(void 0,h)}else return i(void 0,u)}function l(h,u,d){if(M.hasOwnProp(t,d))return i(h,u);if(M.hasOwnProp(o,d))return i(void 0,h)}const c={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:l,headers:(h,u,d)=>n(w0(h),w0(u),d,!0)};return M.forEach(Object.keys({...o,...t}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const d=M.hasOwnProp(c,u)?c[u]:n,f=M.hasOwnProp(o,u)?o[u]:void 0,m=M.hasOwnProp(t,u)?t[u]:void 0,b=d(f,m,u);M.isUndefined(b)&&d!==l||(e[u]=b)}),e}const dE=["content-type","content-length"];function fE(o,t,e){if(e!=="content-only"){o.set(t);return}Object.entries(t).forEach(([i,n])=>{dE.includes(i.toLowerCase())&&o.set(i,n)})}const pE=o=>encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(t,e)=>String.fromCharCode(parseInt(e,16))),KA=o=>{const t=Go({},o),e=f=>M.hasOwnProp(t,f)?t[f]:void 0,i=e("data");let n=e("withXSRFToken");const r=e("xsrfHeaderName"),a=e("xsrfCookieName");let l=e("headers");const c=e("auth"),h=e("baseURL"),u=e("allowAbsoluteUrls"),d=e("url");if(t.headers=l=ai.from(l),t.url=WA(YA(h,d,u),o.params,o.paramsSerializer),c&&l.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?pE(c.password):""))),M.isFormData(i)&&(Xe.hasStandardBrowserEnv||Xe.hasStandardBrowserWebWorkerEnv?l.setContentType(void 0):M.isFunction(i.getHeaders)&&fE(l,i.getHeaders(),e("formDataHeaderPolicy"))),Xe.hasStandardBrowserEnv&&(M.isFunction(n)&&(n=n(t)),n===!0||n==null&&lE(t.url))){const m=r&&a&&cE.read(a);m&&l.set(r,m)}return t},gE=typeof XMLHttpRequest<"u",mE=gE&&function(o){return new Promise(function(e,i){const n=KA(o);let r=n.data;const a=ai.from(n.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:h}=n,u,d,f,m,b;function y(){m&&m(),b&&b(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(n.method.toUpperCase(),n.url,!0),v.timeout=n.timeout;function S(){if(!v)return;const E=ai.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),T={data:!l||l==="text"||l==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:E,config:o,request:v};XA(function(D){e(D),y()},function(D){i(D),y()},T),v=null}"onloadend"in v?v.onloadend=S:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.startsWith("file:"))||setTimeout(S)},v.onabort=function(){v&&(i(new q("Request aborted",q.ECONNABORTED,o,v)),y(),v=null)},v.onerror=function(C){const T=C&&C.message?C.message:"Network Error",R=new q(T,q.ERR_NETWORK,o,v);R.event=C||null,i(R),y(),v=null},v.ontimeout=function(){let C=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const T=n.transitional||Nb;n.timeoutErrorMessage&&(C=n.timeoutErrorMessage),i(new q(C,T.clarifyTimeoutError?q.ETIMEDOUT:q.ECONNABORTED,o,v)),y(),v=null},r===void 0&&a.setContentType(null),"setRequestHeader"in v&&M.forEach(HA(a),function(C,T){v.setRequestHeader(T,C)}),M.isUndefined(n.withCredentials)||(v.withCredentials=!!n.withCredentials),l&&l!=="json"&&(v.responseType=n.responseType),h&&([f,b]=xp(h,!0),v.addEventListener("progress",f)),c&&v.upload&&([d,m]=xp(c),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",m)),(n.cancelToken||n.signal)&&(u=E=>{v&&(i(!E||E.type?new qd(null,o,v):E),v.abort(),y(),v=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));const x=rE(n.url);if(x&&!Xe.protocols.includes(x)){i(new q("Unsupported protocol "+x+":",q.ERR_BAD_REQUEST,o));return}v.send(r||null)})},yE=(o,t)=>{if(o=o?o.filter(Boolean):[],!t&&!o.length)return;const e=new AbortController;let i=!1;const n=function(c){if(!i){i=!0,a();const h=c instanceof Error?c:this.reason;e.abort(h instanceof q?h:new qd(h instanceof Error?h.message:h))}};let r=t&&setTimeout(()=>{r=null,n(new q(`timeout of ${t}ms exceeded`,q.ETIMEDOUT))},t);const a=()=>{o&&(r&&clearTimeout(r),r=null,o.forEach(c=>{c.unsubscribe?c.unsubscribe(n):c.removeEventListener("abort",n)}),o=null)};o.forEach(c=>c.addEventListener("abort",n));const{signal:l}=e;return l.unsubscribe=()=>M.asap(a),l},bE=function*(o,t){let e=o.byteLength;if(e<t){yield o;return}let i=0,n;for(;i<e;)n=i+t,yield o.slice(i,n),i=n},AE=async function*(o,t){for await(const e of wE(o))yield*bE(e,t)},wE=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}const t=o.getReader();try{for(;;){const{done:e,value:i}=await t.read();if(e)break;yield i}}finally{await t.cancel()}},v0=(o,t,e,i)=>{const n=AE(o,t);let r=0,a,l=c=>{a||(a=!0,i&&i(c))};return new ReadableStream({async pull(c){try{const{done:h,value:u}=await n.next();if(h){l(),c.close();return}let d=u.byteLength;if(e){let f=r+=d;e(f)}c.enqueue(new Uint8Array(u))}catch(h){throw l(h),h}},cancel(c){return l(c),n.return()}},{highWaterMark:2})};function vE(o){if(!o||typeof o!="string"||!o.startsWith("data:"))return 0;const t=o.indexOf(",");if(t<0)return 0;const e=o.slice(5,t),i=o.slice(t+1);if(/;base64/i.test(e)){let a=i.length;const l=i.length;for(let m=0;m<l;m++)if(i.charCodeAt(m)===37&&m+2<l){const b=i.charCodeAt(m+1),y=i.charCodeAt(m+2);(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102)&&(y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102)&&(a-=2,m+=2)}let c=0,h=l-1;const u=m=>m>=2&&i.charCodeAt(m-2)===37&&i.charCodeAt(m-1)===51&&(i.charCodeAt(m)===68||i.charCodeAt(m)===100);h>=0&&(i.charCodeAt(h)===61?(c++,h--):u(h)&&(c++,h-=3)),c===1&&h>=0&&(i.charCodeAt(h)===61||u(h))&&c++;const f=Math.floor(a/4)*3-(c||0);return f>0?f:0}if(typeof Buffer<"u"&&typeof Buffer.byteLength=="function")return Buffer.byteLength(i,"utf8");let r=0;for(let a=0,l=i.length;a<l;a++){const c=i.charCodeAt(a);if(c<128)r+=1;else if(c<2048)r+=2;else if(c>=55296&&c<=56319&&a+1<l){const h=i.charCodeAt(a+1);h>=56320&&h<=57343?(r+=4,a++):r+=3}else r+=3}return r}const Ub="1.16.1",S0=64*1024,{isFunction:Cf}=M,_0=(o,...t)=>{try{return!!o(...t)}catch{return!1}},SE=o=>{const t=M.global!==void 0&&M.global!==null?M.global:globalThis,{ReadableStream:e,TextEncoder:i}=t;o=M.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},o);const{fetch:n,Request:r,Response:a}=o,l=n?Cf(n):typeof fetch=="function",c=Cf(r),h=Cf(a);if(!l)return!1;const u=l&&Cf(e),d=l&&(typeof i=="function"?(S=>x=>S.encode(x))(new i):async S=>new Uint8Array(await new r(S).arrayBuffer())),f=c&&u&&_0(()=>{let S=!1;const x=new r(Xe.origin,{body:new e,method:"POST",get duplex(){return S=!0,"half"}}),E=x.headers.has("Content-Type");return x.body!=null&&x.body.cancel(),S&&!E}),m=h&&u&&_0(()=>M.isReadableStream(new a("").body)),b={stream:m&&(S=>S.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!b[S]&&(b[S]=(x,E)=>{let C=x&&x[S];if(C)return C.call(x);throw new q(`Response type '${S}' is not supported`,q.ERR_NOT_SUPPORT,E)})});const y=async S=>{if(S==null)return 0;if(M.isBlob(S))return S.size;if(M.isSpecCompliantForm(S))return(await new r(Xe.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(M.isArrayBufferView(S)||M.isArrayBuffer(S))return S.byteLength;if(M.isURLSearchParams(S)&&(S=S+""),M.isString(S))return(await d(S)).byteLength},v=async(S,x)=>{const E=M.toFiniteNumber(S.getContentLength());return E??y(x)};return async S=>{let{url:x,method:E,data:C,signal:T,cancelToken:R,timeout:D,onDownloadProgress:L,onUploadProgress:I,responseType:N,headers:F,withCredentials:U="same-origin",fetchOptions:Y,maxContentLength:$,maxBodyLength:Z}=KA(S);const H=M.isNumber($)&&$>-1,G=M.isNumber(Z)&&Z>-1;let pt=n||fetch;N=N?(N+"").toLowerCase():"text";let ft=yE([T,R&&R.toAbortSignal()],D),X=null;const Zt=ft&&ft.unsubscribe&&(()=>{ft.unsubscribe()});let gt;try{if(H&&typeof x=="string"&&x.startsWith("data:")&&vE(x)>$)throw new q("maxContentLength size of "+$+" exceeded",q.ERR_BAD_RESPONSE,S,X);if(G&&E!=="get"&&E!=="head"){const at=await v(F,C);if(typeof at=="number"&&isFinite(at)&&at>Z)throw new q("Request body larger than maxBodyLength limit",q.ERR_BAD_REQUEST,S,X)}if(I&&f&&E!=="get"&&E!=="head"&&(gt=await v(F,C))!==0){let at=new r(x,{method:"POST",body:C,duplex:"half"}),Ye;if(M.isFormData(C)&&(Ye=at.headers.get("content-type"))&&F.setContentType(Ye),at.body){const[Ke,ye]=b0(gt,xp(A0(I)));C=v0(at.body,S0,Ke,ye)}}M.isString(U)||(U=U?"include":"omit");const J=c&&"credentials"in r.prototype;if(M.isFormData(C)){const at=F.getContentType();at&&/^multipart\/form-data/i.test(at)&&!/boundary=/i.test(at)&&F.delete("content-type")}F.set("User-Agent","axios/"+Ub,!1);const Ut={...Y,signal:ft,method:E.toUpperCase(),headers:HA(F.normalize()),body:C,duplex:"half",credentials:J?U:void 0};X=c&&new r(x,Ut);let tt=await(c?pt(X,Y):pt(x,Ut));if(H){const at=M.toFiniteNumber(tt.headers.get("content-length"));if(at!=null&&at>$)throw new q("maxContentLength size of "+$+" exceeded",q.ERR_BAD_RESPONSE,S,X)}const me=m&&(N==="stream"||N==="response");if(m&&tt.body&&(L||H||me&&Zt)){const at={};["status","statusText","headers"].forEach(vi=>{at[vi]=tt[vi]});const Ye=M.toFiniteNumber(tt.headers.get("content-length")),[Ke,ye]=L&&b0(Ye,xp(A0(L),!0))||[];let Gi=0;const ds=vi=>{if(H&&(Gi=vi,Gi>$))throw new q("maxContentLength size of "+$+" exceeded",q.ERR_BAD_RESPONSE,S,X);Ke&&Ke(vi)};tt=new a(v0(tt.body,S0,ds,()=>{ye&&ye(),Zt&&Zt()}),at)}N=N||"text";let bt=await b[M.findKey(b,N)||"text"](tt,S);if(H&&!m&&!me){let at;if(bt!=null&&(typeof bt.byteLength=="number"?at=bt.byteLength:typeof bt.size=="number"?at=bt.size:typeof bt=="string"&&(at=typeof i=="function"?new i().encode(bt).byteLength:bt.length)),typeof at=="number"&&at>$)throw new q("maxContentLength size of "+$+" exceeded",q.ERR_BAD_RESPONSE,S,X)}return!me&&Zt&&Zt(),await new Promise((at,Ye)=>{XA(at,Ye,{data:bt,headers:ai.from(tt.headers),status:tt.status,statusText:tt.statusText,config:S,request:X})})}catch(J){if(Zt&&Zt(),ft&&ft.aborted&&ft.reason instanceof q){const Ut=ft.reason;throw Ut.config=S,X&&(Ut.request=X),J!==Ut&&(Ut.cause=J),Ut}throw J&&J.name==="TypeError"&&/Load failed|fetch/i.test(J.message)?Object.assign(new q("Network Error",q.ERR_NETWORK,S,X,J&&J.response),{cause:J.cause||J}):q.from(J,J&&J.code,S,X,J&&J.response)}}},_E=new Map,JA=o=>{let t=o&&o.env||{};const{fetch:e,Request:i,Response:n}=t,r=[i,n,e];let a=r.length,l=a,c,h,u=_E;for(;l--;)c=r[l],h=u.get(c),h===void 0&&u.set(c,h=l?new Map:SE(t)),u=h;return h};JA();const $b={http:z_,xhr:mE,fetch:{get:JA}};M.forEach($b,(o,t)=>{if(o){try{Object.defineProperty(o,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(o,"adapterName",{__proto__:null,value:t})}});const E0=o=>`- ${o}`,EE=o=>M.isFunction(o)||o===null||o===!1;function xE(o,t){o=M.isArray(o)?o:[o];const{length:e}=o;let i,n;const r={};for(let a=0;a<e;a++){i=o[a];let l;if(n=i,!EE(i)&&(n=$b[(l=String(i)).toLowerCase()],n===void 0))throw new q(`Unknown adapter '${l}'`);if(n&&(M.isFunction(n)||(n=n.get(t))))break;r[l||"#"+a]=n}if(!n){const a=Object.entries(r).map(([c,h])=>`adapter ${c} `+(h===!1?"is not supported by the environment":"is not available in the build"));let l=e?a.length>1?`since : 4`+a.map(E0).join(` 5`):" "+E0(a[0]):"as no adapter specified";throw new q("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return n}const QA={getAdapter:xE,adapters:$b};function bm(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new qd(null,o)}function x0(o){return bm(o),o.headers=ai.from(o.headers),o.data=ym.call(o,o.transformRequest),["post","put","patch"].indexOf(o.method)!==-1&&o.headers.setContentType("application/x-www-form-urlencoded",!1),QA.getAdapter(o.adapter||Vd.adapter,o)(o).then(function(i){bm(o),o.response=i;try{i.data=ym.call(o,o.transformResponse,i)}finally{delete o.response}return i.headers=ai.from(i.headers),i},function(i){if(!qA(i)&&(bm(o),i&&i.response)){o.response=i.response;try{i.response.data=ym.call(o,o.transformResponse,i.response)}finally{delete o.response}i.response.headers=ai.from(i.response.headers)}return Promise.reject(i)})}const gg={};["object","boolean","number","function","string","symbol"].forEach((o,t)=>{gg[o]=function(i){return typeof i===o||"a"+(t<1?"n ":" ")+o}});const C0={};gg.transitional=function(t,e,i){function n(r,a){return"[Axios v"+Ub+"] Transitional option '"+r+"'"+a+(i?". "+i:"")}return(r,a,l)=>{if(t===!1)throw new q(n(a," has been removed"+(e?" in "+e:"")),q.ERR_DEPRECATED);return e&&!C0[a]&&(C0[a]=!0,console.warn(n(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,l):!0}};gg.spelling=function(t){return(e,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function CE(o,t,e){if(typeof o!="object")throw new q("options must be an object",q.ERR_BAD_OPTION_VALUE);const i=Object.keys(o);let n=i.length;for(;n-- >0;){const r=i[n],a=Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(a){const l=o[r],c=l===void 0||a(l,r,o);if(c!==!0)throw new q("option "+r+" must be "+c,q.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new q("Unknown option "+r,q.ERR_BAD_OPTION)}}const Hf={assertOptions:CE,validators:gg},Vi=Hf.validators;let jo=class{constructor(t){this.defaults=t||{},this.interceptors={request:new y0,response:new y0}}async request(t,e){try{return await this._request(t,e)}catch(i){if(i instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const r=(()=>{if(!n.stack)return"";const a=n.stack.indexOf(` 6`);return a===-1?"":n.stack.slice(a+1)})();try{if(!i.stack)i.stack=r;else if(r){const a=r.indexOf(` 7`),l=a===-1?-1:r.indexOf(` 8`,a+1),c=l===-1?"":r.slice(l+1);String(i.stack).endsWith(c)||(i.stack+=` 9`+r)}}catch{}}throw i}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Go(this.defaults,e);const{transitional:i,paramsSerializer:n,headers:r}=e;i!==void 0&&Hf.assertOptions(i,{silentJSONParsing:Vi.transitional(Vi.boolean),forcedJSONParsing:Vi.transitional(Vi.boolean),clarifyTimeoutError:Vi.transitional(Vi.boolean),legacyInterceptorReqResOrdering:Vi.transitional(Vi.boolean)},!1),n!=null&&(M.isFunction(n)?e.paramsSerializer={serialize:n}:Hf.assertOptions(n,{encode:Vi.function,serialize:Vi.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Hf.assertOptions(e,{baseUrl:Vi.spelling("baseURL"),withXsrfToken:Vi.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&M.merge(r.common,r[e.method]);r&&M.forEach(["delete","get","head","post","put","patch","query","common"],b=>{delete r[b]}),e.headers=ai.concat(a,r);const l=[];let c=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(e)===!1)return;c=c&&y.synchronous;const v=e.transitional||Nb;v&&v.legacyInterceptorReqResOrdering?l.unshift(y.fulfilled,y.rejected):l.push(y.fulfilled,y.rejected)});const h=[];this.interceptors.response.forEach(function(y){h.push(y.fulfilled,y.rejected)});let u,d=0,f;if(!c){const b=[x0.bind(this),void 0];for(b.unshift(...l),b.push(...h),f=b.length,u=Promise.resolve(e);d<f;)u=u.then(b[d++],b[d++]);return u}f=l.length;let m=e;for(;d<f;){const b=l[d++],y=l[d++];try{m=b(m)}catch(v){y.call(this,v);break}}try{u=x0.call(this,m)}catch(b){return Promise.reject(b)}for(d=0,f=h.length;d<f;)u=u.then(h[d++],h[d++]);return u}getUri(t){t=Go(this.defaults,t);const e=YA(t.baseURL,t.url,t.allowAbsoluteUrls);return WA(e,t.params,t.paramsSerializer)}};M.forEach(["delete","get","head","options"],function(t){jo.prototype[t]=function(e,i){return this.request(Go(i||{},{method:t,url:e,data:(i||{}).data}))}});M.forEach(["post","put","patch","query"],function(t){function e(i){return function(r,a,l){return this.request(Go(l||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}jo.prototype[t]=e(),t!=="query"&&(jo.prototype[t+"Form"]=e(!0))});let TE=class ZA{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const i=this;this.promise.then(n=>{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](n);i._listeners=null}),this.promise.then=n=>{let r;const a=new Promise(l=>{i.subscribe(l),r=l}).then(n);return a.cancel=function(){i.unsubscribe(r)},a},t(function(r,a,l){i.reason||(i.reason=new qd(r,a,l),e(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}
9subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=i=>{t.abort(i)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new ZA(function(n){t=n}),cancel:t}}};function PE(o){return function(e){return o.apply(null,e)}}function RE(o){return M.isObject(o)&&o.isAxiosError===!0}const Qm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Qm).forEach(([o,t])=>{Qm[t]=o});function tw(o){const t=new jo(o),e=LA(jo.prototype.request,t);return M.extend(e,jo.prototype,t,{allOwnKeys:!0}),M.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return tw(Go(o,n))},e}const oe=tw(Vd);oe.Axios=jo;oe.CanceledError=qd;oe.CancelToken=TE;oe.isCancel=qA;oe.VERSION=Ub;oe.toFormData=pg;oe.AxiosError=q;oe.Cancel=oe.CanceledError;oe.all=function(t){return Promise.all(t)};oe.spread=PE;oe.isAxiosError=RE;oe.mergeConfig=Go;oe.AxiosHeaders=ai;oe.formToJSON=o=>VA(M.isHTMLForm(o)?new FormData(o):o);oe.getAdapter=QA.getAdapter;oe.HttpStatusCode=Qm;oe.default=oe;const{Axios:nR,AxiosError:sR,CanceledError:rR,isCancel:aR,CancelToken:oR,VERSION:lR,all:cR,Cancel:hR,isAxiosError:uR,spread:dR,toFormData:fR,AxiosHeaders:pR,HttpStatusCode:gR,formToJSON:mR,getAdapter:yR,mergeConfig:bR,create:AR}=oe;var Cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xd(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function ME(o){if(o.__esModule)return o;var t=o.default;if(typeof t=="function"){var e=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(o).forEach(function(i){var n=Object.getOwnPropertyDescriptor(o,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return o[i]}})}),e}var DE=function(t){return OE(t)&&!LE(t)};function OE(o){return!!o&&typeof o=="object"}function LE(o){var t=Object.prototype.toString.call(o);return t==="[object RegExp]"||t==="[object Date]"||FE(o)}var kE=typeof Symbol=="function"&&Symbol.for,IE=kE?Symbol.for("react.element"):60103;function FE(o){return o.$$typeof===IE}function NE(o){return Array.isArray(o)?[]:{}}function iu(o,t){return t.clone!==!1&&t.isMergeableObject(o)?eh(NE(o),o,t):o}function BE(o,t,e){return o.concat(t).map(function(i){return iu(i,e)})}function UE(o,t){if(!t.customMerge)return eh;var e=t.customMerge(o);return typeof e=="function"?e:eh}function $E(o){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(o).filter(function(t){return Object.propertyIsEnumerable.call(o,t)}
vendor: 7,367 bytes, line 9
9):[]}function T0(o){return Object.keys(o).concat($E(o))}function ew(o,t){try{return t in o}catch{return!1}}function HE(o,t){return ew(o,t)&&!(Object.hasOwnProperty.call(o,t)&&Object.propertyIsEnumerable.call(o,t))}function jE(o,t,e){var i={};return e.isMergeableObject(o)&&T0(o).forEach(function(n){i[n]=iu(o[n],e)}),T0(t).forEach(function(n){HE(o,n)||(ew(o,n)&&e.isMergeableObject(t[n])?i[n]=UE(n,e)(o[n],t[n],e):i[n]=iu(t[n],e))}),i}function eh(o,t,e){e=e||{},e.arrayMerge=e.arrayMerge||BE,e.isMergeableObject=e.isMergeableObject||DE,e.cloneUnlessOtherwiseSpecified=iu;var i=Array.isArray(t),n=Array.isArray(o),r=i===n;return r?i?e.arrayMerge(o,t,e):jE(o,t,e):iu(t,e)}eh.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(i,n){return eh(i,n,e)},{})};var zE=eh,GE=zE;const wR=Xd(GE);var rh=TypeError;const WE={},VE=Object.freeze(Object.defineProperty({__proto__:null,default:WE},Symbol.toStringTag,{value:"Module"})),qE=ME(VE);var Hb=typeof Map=="function"&&Map.prototype,Am=Object.getOwnPropertyDescriptor&&Hb?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Cp=Hb&&Am&&typeof Am.get=="function"?Am.get:null,P0=Hb&&Map.prototype.forEach,jb=typeof Set=="function"&&Set.prototype,wm=Object.getOwnPropertyDescriptor&&jb?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Tp=jb&&wm&&typeof wm.get=="function"?wm.get:null,R0=jb&&Set.prototype.forEach,XE=typeof WeakMap=="function"&&WeakMap.prototype,Jh=XE?WeakMap.prototype.has:null,YE=typeof WeakSet=="function"&&WeakSet.prototype,Qh=YE?WeakSet.prototype.has:null,KE=typeof WeakRef=="function"&&WeakRef.prototype,M0=KE?WeakRef.prototype.deref:null,JE=Boolean.prototype.valueOf,QE=Object.prototype.toString,ZE=Function.prototype.toString,tx=String.prototype.match,zb=String.prototype.slice,oa=String.prototype.replace,ex=String.prototype.toUpperCase,D0=String.prototype.toLowerCase,iw=RegExp.prototype.test,O0=Array.prototype.concat,ls=Array.prototype.join,ix=Array.prototype.slice,L0=Math.floor,Zm=typeof BigInt=="function"?BigInt.prototype.valueOf:null,vm=Object.getOwnPropertySymbols,ty=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ih=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Zh=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ih||!0)?Symbol.toStringTag:null,nw=Object.prototype.propertyIsEnumerable,k0=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(o){return o.__proto__}:null);function I0(o,t){if(o===1/0||o===-1/0||o!==o||o&&o>-1e3&&o<1e3||iw.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof o=="number"){var i=o<0?-L0(-o):L0(o);if(i!==o){var n=String(i),r=zb.call(t,n.length+1);return oa.call(n,e,"$&_")+"."+oa.call(oa.call(r,/([0-9]{3})/g,"$&_"),/_$/,"")}}return oa.call(t,e,"$&_")}var ey=qE,F0=ey.custom,N0=aw(F0)?F0:null,sw={__proto__:null,double:'"',single:"'"},nx={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},mg=function o(t,e,i,n){var r=e||{};if(ws(r,"quoteStyle")&&!ws(sw,r.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ws(r,"maxStringLength")&&(typeof r.maxStringLength=="number"?r.maxStringLength<0&&r.maxStringLength!==1/0:r.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=ws(r,"customInspect")?r.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ws(r,"indent")&&r.indent!==null&&r.indent!==" "&&!(parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ws(r,"numericSeparator")&&typeof r.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=r.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return lw(t,r);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return l?I0(t,c):c}if(typeof t=="bigint"){var h=String(t)+"n";return l?I0(t,h):h}var u=typeof r.depth>"u"?5:r.depth;if(typeof i>"u"&&(i=0),i>=u&&u>0&&typeof t=="object")return iy(t)?"[Array]":"[Object]";var d=vx(r,i);if(typeof n>"u")n=[];else if(ow(n,t)>=0)return"[Circular]";function f(Y,$,Z){if($&&(n=ix.call(n),n.push($)),Z){var H={depth:r.depth};return ws(r,"quoteStyle")&&(H.quoteStyle=r.quoteStyle),o(Y,H,i+1,n)}return o(Y,r,i+1,n)}if(typeof t=="function"&&!B0(t)){var m=dx(t),b=Tf(t,f);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(b.length>0?" { "+ls.call(b,", ")+" }":"")}if(aw(t)){var y=ih?oa.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):ty.call(t);return typeof t=="object"&&!ih?Eh(y):y}if(bx(t)){for(var v="<"+D0.call(String(t.nodeName)),S=t.attributes||[],x=0;x<S.length;x++)v+=" "+S[x].name+"="+rw(sx(S[x].value),"double",r);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+D0.call(String(t.nodeName))+">",v}if(iy(t)){if(t.length===0)return"[]";var E=Tf(t,f);return d&&!wx(E)?"["+ny(E,d)+"]":"[ "+ls.call(E,", ")+" ]"}if(ax(t)){var C=Tf(t,f);return!("cause"in Error.prototype)&&"cause"in t&&!nw.call(t,"cause")?"{ ["+String(t)+"] "+ls.call(O0.call("[cause]: "+f(t.cause),C),", ")+" }":C.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+ls.call(C,", ")+" }"}if(typeof t=="object"&&a){if(N0&&typeof t[N0]=="function"&&ey)return ey(t,{depth:u-i});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(fx(t)){var T=[];return P0&&P0.call(t,function(Y,$){T.push(f($,t,!0)+" => "+f(Y,t))}),U0("Map",Cp.call(t),T,d)}if(mx(t)){var R=[];return R0&&R0.call(t,function(Y){R.push(f(Y,t))}),U0("Set",Tp.call(t),R,d)}if(px(t))return Sm("WeakMap");if(yx(t))return Sm("WeakSet");if(gx(t))return Sm("WeakRef");if(lx(t))return Eh(f(Number(t)));if(hx(t))return Eh(f(Zm.call(t)));if(cx(t))return Eh(JE.call(t));if(ox(t))return Eh(f(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof Cn<"u"&&t===Cn)return"{ [object globalThis] }";if(!rx(t)&&!B0(t)){var D=Tf(t,f),L=k0?k0(t)===Object.prototype:t instanceof Object||t.constructor===Object,I=t instanceof Object?"":"null prototype",N=!L&&Zh&&Object(t)===t&&Zh in t?zb.call(da(t),8,-1):I?"Object":"",F=L||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",U=F+(N||I?"["+ls.call(O0.call([],N||[],I||[]),": ")+"] ":"");return D.length===0?U+"{}":d?U+"{"+ny(D,d)+"}":U+"{ "+ls.call(D,", ")+" }"}return String(t)};function rw(o,t,e){var i=e.quoteStyle||t,n=sw[i];return n+o+n}function sx(o){return oa.call(String(o),/"/g,""")}function Xo(o){return!Zh||!(typeof o=="object"&&(Zh in o||typeof o[Zh]<"u"))}function iy(o){return da(o)==="[object Array]"&&Xo(o)}function rx(o){return da(o)==="[object Date]"&&Xo(o)}function B0(o){return da(o)==="[object RegExp]"&&Xo(o)}function ax(o){return da(o)==="[object Error]"&&Xo(o)}function ox(o){return da(o)==="[object String]"&&Xo(o)}function lx(o){return da(o)==="[object Number]"&&Xo(o)}function cx(o){return da(o)==="[object Boolean]"&&Xo(o)}function aw(o){if(ih)return o&&typeof o=="object"&&o instanceof Symbol;if(typeof o=="symbol")return!0;
vendor: 31,240 bytes, lines 9-12
9if(!o||typeof o!="object"||!ty)return!1;try{return ty.call(o),!0}catch{}return!1}function hx(o){if(!o||typeof o!="object"||!Zm)return!1;try{return Zm.call(o),!0}catch{}return!1}var ux=Object.prototype.hasOwnProperty||function(o){return o in this};function ws(o,t){return ux.call(o,t)}function da(o){return QE.call(o)}function dx(o){if(o.name)return o.name;var t=tx.call(ZE.call(o),/^function\s*([\w$]+)/);return t?t[1]:null}function ow(o,t){if(o.indexOf)return o.indexOf(t);for(var e=0,i=o.length;e<i;e++)if(o[e]===t)return e;return-1}function fx(o){if(!Cp||!o||typeof o!="object")return!1;try{Cp.call(o);try{Tp.call(o)}catch{return!0}return o instanceof Map}catch{}return!1}function px(o){if(!Jh||!o||typeof o!="object")return!1;try{Jh.call(o,Jh);try{Qh.call(o,Qh)}catch{return!0}return o instanceof WeakMap}catch{}return!1}function gx(o){if(!M0||!o||typeof o!="object")return!1;try{return M0.call(o),!0}catch{}return!1}function mx(o){if(!Tp||!o||typeof o!="object")return!1;try{Tp.call(o);try{Cp.call(o)}catch{return!0}return o instanceof Set}catch{}return!1}function yx(o){if(!Qh||!o||typeof o!="object")return!1;try{Qh.call(o,Qh);try{Jh.call(o,Jh)}catch{return!0}return o instanceof WeakSet}catch{}return!1}function bx(o){return!o||typeof o!="object"?!1:typeof HTMLElement<"u"&&o instanceof HTMLElement?!0:typeof o.nodeName=="string"&&typeof o.getAttribute=="function"}function lw(o,t){if(o.length>t.maxStringLength){var e=o.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return lw(zb.call(o,0,t.maxStringLength),t)+i}var n=nx[t.quoteStyle||"single"];n.lastIndex=0;var r=oa.call(oa.call(o,n,"\\$1"),/[\x00-\x1f]/g,Ax);return rw(r,"single",t)}function Ax(o){var t=o.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+ex.call(t.toString(16))}function Eh(o){return"Object("+o+")"}function Sm(o){return o+" { ? }"}function U0(o,t,e,i){var n=i?ny(e,i):ls.call(e,", ");return o+" ("+t+") {"+n+"}"}function wx(o){for(var t=0;t<o.length;t++)if(ow(o[t],` 10`)>=0)return!1;return!0}function vx(o,t){var e;if(o.indent===" ")e=" ";else if(typeof o.indent=="number"&&o.indent>0)e=ls.call(Array(o.indent+1)," ");else return null;return{base:e,prev:ls.call(Array(t+1),e)}}function ny(o,t){if(o.length===0)return"";var e=` 11`+t.prev+t.base;return e+ls.call(o,","+e)+` 12`+t.prev}function Tf(o,t){var e=iy(o),i=[];if(e){i.length=o.length;for(var n=0;n<o.length;n++)i[n]=ws(o,n)?t(o[n],o):""}var r=typeof vm=="function"?vm(o):[],a;if(ih){a={};for(var l=0;l<r.length;l++)a["$"+r[l]]=r[l]}for(var c in o)ws(o,c)&&(e&&String(Number(c))===c&&c<o.length||ih&&a["$"+c]instanceof Symbol||(iw.call(/[^\w$]/,c)?i.push(t(c,o)+": "+t(o[c],o)):i.push(c+": "+t(o[c],o))));if(typeof vm=="function")for(var h=0;h<r.length;h++)nw.call(o,r[h])&&i.push("["+t(r[h])+"]: "+t(o[r[h]],o));return i}var Sx=mg,_x=rh,yg=function(o,t,e){for(var i=o,n;(n=i.next)!=null;i=n)if(n.key===t)return i.next=n.next,e||(n.next=o.next,o.next=n),n},Ex=function(o,t){if(o){var e=yg(o,t);return e&&e.value}},xx=function(o,t,e){var i=yg(o,t);i?i.value=e:o.next={key:t,next:o.next,value:e}},Cx=function(o,t){return o?!!yg(o,t):!1},Tx=function(o,t){if(o)return yg(o,t,!0)},Px=function(){var t,e={assert:function(i){if(!e.has(i))throw new _x("Side channel does not contain "+Sx(i))},delete:function(i){var n=Tx(t,i);return n&&t&&!t.next&&(t=void 0),!!n},get:function(i){return Ex(t,i)},has:function(i){return Cx(t,i)},set:function(i,n){t||(t={next:void 0}),xx(t,i,n)}};return e},cw=Object,Rx=Error,Mx=EvalError,Dx=RangeError,Ox=ReferenceError,Lx=SyntaxError,kx=URIError,Ix=Math.abs,Fx=Math.floor,Nx=Math.max,Bx=Math.min,Ux=Math.pow,$x=Math.round,Hx=Number.isNaN||function(t){return t!==t},jx=Hx,zx=function(t){return jx(t)||t===0?t:t<0?-1:1},Gx=Object.getOwnPropertyDescriptor,jf=Gx;if(jf)try{jf([],"length")}catch{jf=null}var hw=jf,zf=Object.defineProperty||!1;if(zf)try{zf({},"a",{value:1})}catch{zf=!1}var Wx=zf,_m,$0;function Vx(){return $0||($0=1,_m=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;t[e]=n;for(var r 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 a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,e);if(l.value!==n||l.enumerable!==!0)return!1}return!0}),_m}var Em,H0;function qx(){if(H0)return Em;H0=1;var o=typeof Symbol<"u"&&Symbol,t=Vx();return Em=function(){return typeof o!="function"||typeof Symbol!="function"||typeof o("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Em}var xm,j0;function uw(){return j0||(j0=1,xm=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),xm}var Cm,z0;function dw(){if(z0)return Cm;z0=1;var o=cw;return Cm=o.getPrototypeOf||null,Cm}var Tm,G0;function Xx(){if(G0)return Tm;G0=1;var o="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,e=Math.max,i="[object Function]",n=function(c,h){for(var u=[],d=0;d<c.length;d+=1)u[d]=c[d];for(var f=0;f<h.length;f+=1)u[f+c.length]=h[f];return u},r=function(c,h){for(var u=[],d=h,f=0;d<c.length;d+=1,f+=1)u[f]=c[d];return u},a=function(l,c){for(var h="",u=0;u<l.length;u+=1)h+=l[u],u+1<l.length&&(h+=c);return h};return Tm=function(c){var h=this;if(typeof h!="function"||t.apply(h)!==i)throw new TypeError(o+h);for(var u=r(arguments,1),d,f=function(){if(this instanceof d){var S=h.apply(this,n(u,arguments));return Object(S)===S?S:this}return h.apply(c,n(u,arguments))},m=e(0,h.length-u.length),b=[],y=0;y<m;y++)b[y]="$"+y;if(d=Function("binder","return function ("+a(b,",")+"){ return binder.apply(this,arguments); }")(f),h.prototype){var v=function(){};v.prototype=h.prototype,d.prototype=new v,v.prototype=null}return d},Tm}var Pm,W0;function bg(){if(W0)return Pm;W0=1;var o=Xx();return Pm=Function.prototype.bind||o,Pm}var Rm,V0;function Gb(){return V0||(V0=1,Rm=Function.prototype.call),Rm}var Mm,q0;function fw(){return q0||(q0=1,Mm=Function.prototype.apply),Mm}var Yx=typeof Reflect<"u"&&Reflect&&Reflect.apply,Kx=bg(),Jx=fw(),Qx=Gb(),Zx=Yx,tC=Zx||Kx.call(Qx,Jx),eC=bg(),iC=rh,nC=Gb(),sC=tC,pw=function(t){if(t.length<1||typeof t[0]!="function")throw new iC("a function is required");return sC(eC,nC,t)},Dm,X0;function rC(){if(X0)return Dm;X0=1;var o=pw,t=hw,e;try{e=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var i=!!e&&t&&t(Object.prototype,"__proto__"),n=Object,r=n.getPrototypeOf;return Dm=i&&typeof i.get=="function"?o([i.get]):typeof r=="function"?function(l){return r(l==null?l:n(l))}:!1,Dm}var Om,Y0;function aC(){if(Y0)return Om;Y0=1;var o=uw(),t=dw(),e=rC();return Om=o?function(n){return o(n)}:t?function(n){if(!n||typeof n!="object"&&typeof n!="function")throw new TypeError("getProto: not an object");return t(n)}:e?function(n){return e(n)}:null,Om}var Lm,K0;function oC(){if(K0)return Lm;K0=1;var o=Function.prototype.call,t=Object.prototype.hasOwnProperty,e=bg();return Lm=e.call(o,t),Lm}var dt,lC=cw,cC=Rx,hC=Mx,uC=Dx,dC=Ox,nh=Lx,Tl=rh,fC=kx,pC=Ix,gC=Fx,mC=Nx,yC=Bx,bC=Ux,AC=$x,wC=zx,gw=Function,km=function(o){try{return gw('"use strict"; return ('+o+").constructor;")()}catch{}},nu=hw,vC=Wx,Im=function(){throw new Tl},SC=nu?function(){try{return arguments.callee,Im}catch{try{return nu(arguments,"callee").get}catch{return Im}}}():Im,cl=qx()(),xe=aC(),_C=dw(),EC=uw(),mw=fw(),Yd=Gb(),dl={},xC=typeof Uint8Array>"u"||!xe?dt:xe(Uint8Array),zo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?dt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?dt:ArrayBuffer,"%ArrayIteratorPrototype%":cl&&xe?xe([][Symbol.iterator]()):dt,"%AsyncFromSyncIteratorPrototype%":dt,"%AsyncFunction%":dl,"%AsyncGenerator%":dl,"%AsyncGeneratorFunction%":dl,"%AsyncIteratorPrototype%":dl,"%Atomics%":typeof Atomics>"u"?dt:Atomics,"%BigInt%":typeof BigInt>"u"?dt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?dt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?dt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?dt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":cC,"%eval%":eval,"%EvalError%":hC,"%Float16Array%":typeof Float16Array>"u"?dt:Float16Array,"%Float32Array%":typeof Float32Array>"u"?dt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?dt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?dt:FinalizationRegistry,"%Function%":gw,"%GeneratorFunction%":dl,"%Int8Array%":typeof Int8Array>"u"?dt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?dt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?dt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":cl&&xe?xe(xe([][Symbol.iterator]())):dt,"%JSON%":typeof JSON=="object"?JSON:dt,"%Map%":typeof Map>"u"?dt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!cl||!xe?dt:xe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":lC,"%Object.getOwnPropertyDescriptor%":nu,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?dt:Promise,"%Proxy%":typeof Proxy>"u"?dt:Proxy,"%RangeError%":uC,"%ReferenceError%":dC,"%Reflect%":typeof Reflect>"u"?dt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?dt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!cl||!xe?dt:xe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?dt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":cl&&xe?xe(""[Symbol.iterator]()):dt,"%Symbol%":cl?Symbol:dt,"%SyntaxError%":nh,"%ThrowTypeError%":SC,"%TypedArray%":xC,"%TypeError%":Tl,"%Uint8Array%":typeof Uint8Array>"u"?dt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?dt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?dt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?dt:Uint32Array,"%URIError%":fC,"%WeakMap%":typeof WeakMap>"u"?dt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?dt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?dt:WeakSet,"%Function.prototype.call%":Yd,"%Function.prototype.apply%":mw,"%Object.defineProperty%":vC,"%Object.getPrototypeOf%":_C,"%Math.abs%":pC,"%Math.floor%":gC,"%Math.max%":mC,"%Math.min%":yC,"%Math.pow%":bC,"%Math.round%":AC,"%Math.sign%":wC,"%Reflect.getPrototypeOf%":EC};if(xe)try{null.error}catch(o){var CC=xe(xe(o));zo["%Error.prototype%"]=CC}var TC=function o(t){var e;if(t==="%AsyncFunction%")e=km("async function () {}");else if(t==="%GeneratorFunction%")e=km("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=km("async function* () {}");else if(t==="%AsyncGenerator%"){var i=o("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=o("%AsyncGenerator%");n&&xe&&(e=xe(n.prototype))}return zo[t]=e,e},J0={__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"]},Kd=bg(),Pp=oC(),PC=Kd.call(Yd,Array.prototype.concat),RC=Kd.call(mw,Array.prototype.splice),Q0=Kd.call(Yd,String.prototype.replace),Rp=Kd.call(Yd,String.prototype.slice),MC=Kd.call(Yd,RegExp.prototype.exec),DC=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,OC=/\\(\\)?/g,LC=function(t){var e=Rp(t,0,1),i=Rp(t,-1);if(e==="%"&&i!=="%")throw new nh("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new nh("invalid intrinsic syntax, expected opening `%`");var n=[];return Q0(t,DC,function(r,a,l,c){n[n.length]=l?Q0(c,OC,"$1"):a||r}),n},kC=function(t,e){var i=t,n;if(Pp(J0,i)&&(n=J0[i],i="%"+n[0]+"%"),Pp(zo,i)){var r=zo[i];if(r===dl&&(r=TC(i)),typeof r>"u"&&!e)throw new Tl("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:r}}throw new nh("intrinsic "+t+" does not exist!")},Wb=function(t,e){if(typeof t!="string"||t.length===0)throw new Tl("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Tl('"allowMissing" argument must be a boolean');if(MC(/^%?[^%]*%?$/,t)===null)throw new nh("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=LC(t),n=i.length>0?i[0]:"",r=kC("%"+n+"%",e),a=r.name,l=r.value,c=!1,h=r.alias;h&&(n=h[0],RC(i,PC([0,1],h)));for(var u=1,d=!0;u<i.length;u+=1){var f=i[u],m=Rp(f,0,1),b=Rp(f,-1);if((m==='"'||m==="'"||m==="`"||b==='"'||b==="'"||b==="`")&&m!==b)throw new nh("property names with quotes must have matching quotes");if((f==="constructor"||!d)&&(c=!0),n+="."+f,a="%"+n+"%",Pp(zo,a))l=zo[a];else if(l!=null){if(!(f in l)){if(!e)throw new Tl("base intrinsic for "+t+" exists, but the property is not available.");return}if(nu&&u+1>=i.length){var y=nu(l,f);d=!!y,d&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[f]}else d=Pp(l,f),l=l[f];d&&!c&&(zo[a]=l)}}return l},yw=Wb,bw=pw,IC=bw([yw("%String.prototype.indexOf%")]),Aw=function(t,e){var i=yw(t,!!e);return typeof i=="function"&&IC(t,".prototype.")>-1?bw([i]):i},FC=Wb,Jd=Aw,NC=mg,BC=rh,Z0=FC("%Map%",!0),UC=Jd("Map.prototype.get",!0),$C=Jd("Map.prototype.set",!0),HC=Jd("Map.prototype.has",!0),jC=Jd("Map.prototype.delete",!0),zC=Jd("Map.prototype.size",!0),ww=!!Z0&&function(){var t,e={assert:function(i){if(!e.has(i))throw new BC("Side channel does not contain "+NC(i))},delete:function(i){if(t){var n=jC(t,i);return zC(t)===0&&(t=void 0),n}return!1},get:function(i){if(t)return UC(t,i)},has:function(i){return t?HC(t,i):!1},set:function(i,n){t||(t=new Z0),$C(t,i,n)}};return e},GC=Wb,Ag=Aw,WC=mg,Pf=ww,VC=rh,hl=GC("%WeakMap%",!0),qC=Ag("WeakMap.prototype.get",!0),XC=Ag("WeakMap.prototype.set",!0),YC=Ag("WeakMap.prototype.has",!0),KC=Ag("WeakMap.prototype.delete",!0),JC=hl?function(){var t,e,i={assert:function(n){if(!i.has(n))throw new VC("Side channel does not contain "+WC(n))},delete:function(n){if(hl&&n&&(typeof n=="object"||typeof n=="function")){if(t)return KC(t,n)}else if(Pf&&e)return e.delete(n);return!1},get:function(n){return hl&&n&&(typeof n=="object"||typeof n=="function")&&t?qC(t,n):e&&e.get(n)},has:function(n){return hl&&n&&(typeof n=="object"||typeof n=="function")&&t?YC(t,n):!!e&&e.has(n)},set:function(n,r){hl&&n&&(typeof n=="object"||typeof n=="function")?(t||(t=new hl),XC(t,n,r)):Pf&&(e||(e=Pf()),e.set(n,r))}};return i}:Pf,QC=rh,ZC=mg,tT=Px,eT=ww,iT=JC,nT=iT||eT||tT,vw=function(){var t,e={assert:function(i){if(!e.has(i))throw new QC("Side channel does not contain "+ZC(i))},delete:function(i){return!!t&&t.delete(i)},get:function(i){return t&&t.get(i)},has:function(i){return!!t&&t.has(i)},set:function(i,n){t||(t=nT()),t.set(i,n)}};return e},sT=String.prototype.replace,rT=/%20/g,tA={RFC1738:"RFC1738",RFC3986:"RFC3986"},Sw={default:tA.RFC3986,formatters:{RFC1738:function(o){return sT.call(o,rT,"+")},RFC3986:function(o){return String(o)}},RFC1738:tA.RFC1738},aT=Sw,oT=vw,Fm=Object.prototype.hasOwnProperty,_a=Array.isArray,wg=oT(),vl=function(t,e){return wg.set(t,e),t},Ea=function(t){return wg.has(t)},Rh=function(t){return wg.get(t)},sy=function(t,e){wg.set(t,e)},kn=function(){for(var o=[],t=0;t<256;++t)o[o.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return o}(),lT=function(t){for(;t.length>1;){var e=t.pop(),i=e.obj[e.prop];if(_a(i)){for(var n=[],r=0;r<i.length;++r)typeof i[r]<"u"&&(n[n.length]=i[r]);e.obj[e.prop]=n}}},tu=function(t,e){for(var i=e&&e.plainObjects?{__proto__:null}:{},n=0;n<t.length;++n)typeof t[n]<"u"&&(i[n]=t[n]);return i},cT=function o(t,e,i){if(!e)return t;if(typeof e!="object"&&typeof e!="function"){if(_a(t)){var n=t.length;if(i&&typeof i.arrayLimit=="number"&&n>i.arrayLimit)return vl(tu(t.concat(e),i),n);t[n]=e}else if(t&&typeof t=="object")if(Ea(t)){var r=Rh(t)+1;t[r]=e,sy(t,r)}else{if(i&&i.strictMerge)return[t,e];(i&&(i.plainObjects||i.allowPrototypes)||!Fm.call(Object.prototype,e))&&(t[e]=!0)}else return[t,e];return t}if(!t||typeof t!="object"){if(Ea(e)){for(var a=Object.keys(e),l=i&&i.plainObjects?{__proto__:null,0:t}:{0:t},c=0;c<a.length;c++){var h=parseInt(a[c],10);l[h+1]=e[a[c]]}return vl(l,Rh(e)+1)}var u=[t].concat(e);return i&&typeof i.arrayLimit=="number"&&u.length>i.arrayLimit?vl(tu(u,i),u.length-1):u}var d=t;return _a(t)&&!_a(e)&&(d=tu(t,i)),_a(t)&&_a(e)?(e.forEach(function(f,m){if(Fm.call(t,m)){var b=t[m];b&&typeof b=="object"&&f&&typeof f=="object"?t[m]=o(b,f,i):t[t.length]=f}else t[m]=f}),t):Object.keys(e).reduce(function(f,m){var b=e[m];if(Fm.call(f,m)?f[m]=o(f[m],b,i):f[m]=b,Ea(e)&&!Ea(f)&&vl(f,Rh(e)),Ea(f)){var y=parseInt(m,10);String(y)===m&&y>=0&&y>Rh(f)&&sy(f,y)}return f},d)},hT=function(t,e){return Object.keys(e).reduce(function(i,n){return i[n]=e[n],i},t)},uT=function(o,t,e){var i=o.replace(/\+/g," ");if(e==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},Nm=1024,dT=function(t,e,i,n,r){if(t.length===0)return t;var a=t;if(typeof t=="symbol"?a=Symbol.prototype.toString.call(t):typeof t!="string"&&(a=String(t)),i==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(m){return"%26%23"+parseInt(m.slice(2),16)+"%3B"});for(var l="",c=0;c<a.length;c+=Nm){for(var h=a.length>=Nm?a.slice(c,c+Nm):a,u=[],d=0;d<h.length;++d){var f=h.charCodeAt(d);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||r===aT.RFC1738&&(f===40||f===41)){u[u.length]=h.charAt(d);continue}if(f<128){u[u.length]=kn[f];continue}if(f<2048){u[u.length]=kn[192|f>>6]+kn[128|f&63];continue}if(f<55296||f>=57344){u[u.length]=kn[224|f>>12]+kn[128|f>>6&63]+kn[128|f&63];continue}d+=1,f=65536+((f&1023)<<10|h.charCodeAt(d)&1023),u[u.length]=kn[240|f>>18]+kn[128|f>>12&63]+kn[128|f>>6&63]+kn[128|f&63]}l+=u.join("")}return l},fT=function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],n=0;n<e.length;++n)for(var r=e[n],a=r.obj[r.prop],l=Object.keys(a),c=0;c<l.length;++c){var h=l[c],u=a[h];typeof u=="object"&&u!==null&&i.indexOf(u)===-1&&(e[e.length]={obj:a,prop:h},i[i.length]=u)}return lT(e),t},pT=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},gT=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},mT=function(t,e,i,n){if(Ea(t)){var r=Rh(t)+1;return t[r]=e,sy(t,r),t}var a=[].concat(t,e);return a.length>i?vl(tu(a,{plainObjects:n}),a.length-1):a},yT=function(t,e){if(_a(t)){for(var i=[],n=0;n<t.length;n+=1)i[i.length]=e(t[n]);return i}return e(t)},_w={arrayToObject:tu,assign:hT,combine:mT,compact:fT,decode:uT,encode:dT,isBuffer:gT,isOverflow:Ea,isRegExp:pT,markOverflow:vl,maybeMap:yT,merge:cT},Ew=vw,Gf=_w,eu=Sw,bT=Object.prototype.hasOwnProperty,xw={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},Bn=Array.isArray,AT=Array.prototype.push,Cw=function(o,t){AT.apply(o,Bn(t)?t:[t])},wT=Date.prototype.toISOString,eA=eu.default,de={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Gf.encode,encodeValuesOnly:!1,filter:void 0,format:eA,formatter:eu.formatters[eA],indices:!1,serializeDate:function(t){return wT.call(t)},skipNulls:!1,strictNullHandling:!1},vT=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Bm={},ST=function o(t,e,i,n,r,a,l,c,h,u,d,f,m,b,y,v,S,x){for(var E=t,C=x,T=0,R=!1;(C=C.get(Bm))!==void 0&&!R;){var D=C.get(t);if(T+=1,typeof D<"u"){if(D===T)throw new RangeError("Cyclic object value");R=!0}typeof C.get(Bm)>"u"&&(T=0)}if(typeof u=="function"?E=u(e,E):E instanceof Date?E=m(E):i==="comma"&&Bn(E)&&(E=Gf.maybeMap(E,function(X){return X instanceof Date?m(X):X})),E===null){if(a)return y(h&&!v?h(e,de.encoder,S,"key",b):e);E=""}if(vT(E)||Gf.isBuffer(E)){if(h){var L=v?e:h(e,de.encoder,S,"key",b);return[y(L)+"="+y(h(E,de.encoder,S,"value",b))]}return[y(e)+"="+y(String(E))]}var I=[];if(typeof E>"u")return I;var N;if(i==="comma"&&Bn(E))v&&h&&(E=Gf.maybeMap(E,function(X){return X==null?X:h(X)})),N=[{value:E.length>0?E.join(",")||null:void 0}];else if(Bn(u))N=u;else{var F=Object.keys(E);N=d?F.sort(d):F}var U=c?String(e).replace(/\./g,"%2E"):String(e),Y=n&&Bn(E)&&E.length===1?U+"[]":U;if(r&&Bn(E)&&E.length===0)return Y+"[]";for(var $=0;$<N.length;++$){var Z=N[$],H=typeof Z=="object"&&Z&&typeof Z.value<"u"?Z.value:E[Z];if(!(l&&H===null)){var G=f&&c?String(Z).replace(/\./g,"%2E"):String(Z),pt=Bn(E)?typeof i=="function"?i(Y,G):Y:Y+(f?"."+G:"["+G+"]");x.set(t,T);var ft=Ew();ft.set(Bm,x),Cw(I,o(H,pt,i,n,r,a,l,c,i==="comma"&&v&&Bn(E)?null:h,u,d,f,m,b,y,v,S,ft))}}return I},_T=function(t){if(!t)return de;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var e=t.charset||de.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=eu.default;if(typeof t.format<"u"){if(!bT.call(eu.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var n=eu.formatters[i],r=de.filter;(typeof t.filter=="function"||Bn(t.filter))&&(r=t.filter);var a;if(t.arrayFormat in xw?a=t.arrayFormat:"indices"in t?a=t.indices?"indices":"repeat":a=de.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:de.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:de.addQueryPrefix,allowDots:l,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:de.allowEmptyArrays,arrayFormat:a,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:de.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?de.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:de.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:de.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:de.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:de.encodeValuesOnly,filter:r,format:i,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:de.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:de.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:de.strictNullHandling}},ET=function(o,t){var e=o,i=_T(t),n,r;typeof i.filter=="function"?(r=i.filter,e=r("",e)):Bn(i.filter)&&(r=i.filter,n=r);var a=[];if(typeof e!="object"||e===null)return"";var l=xw[i.arrayFormat],c=l==="comma"&&i.commaRoundTrip;n||(n=Object.keys(e)),i.sort&&n.sort(i.sort);for(var h=Ew(),u=0;u<n.length;++u){var d=n[u];if(!(typeof d>"u"||d===null)){var f=e[d];i.skipNulls&&f===null||Cw(a,ST(f,d,l,c,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,h))}}var m=a.join(i.delimiter),b=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?b+="utf8=%26%2310003%3B"+i.delimiter:b+="utf8=%E2%9C%93"+i.delimiter),m.length>0?b+m:""},cs=_w,Wf=Object.prototype.hasOwnProperty,Um=Array.isArray,Gt={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:cs.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},xT=function(o){return o.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},Tw=function(o,t,e){if(o&&typeof o=="string"&&t.comma&&o.indexOf(",")>-1)return o.split(",");if(t.throwOnLimitExceeded&&e>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return o},CT="utf8=%26%2310003%3B",TT="utf8=%E2%9C%93",PT=function(t,e){var i={__proto__:null},n=e.ignoreQueryPrefix?t.replace(/^\?/,""):t;n=n.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var r=e.parameterLimit===1/0?void 0:e.parameterLimit,a=n.split(e.delimiter,e.throwOnLimitExceeded&&typeof r<"u"?r+1:r);if(e.throwOnLimitExceeded&&typeof r<"u"&&a.length>r)throw new RangeError("Parameter limit exceeded. Only "+r+" parameter"+(r===1?"":"s")+" allowed.");var l=-1,c,h=e.charset;if(e.charsetSentinel)for(c=0;c<a.length;++c)a[c].indexOf("utf8=")===0&&(a[c]===TT?h="utf-8":a[c]===CT&&(h="iso-8859-1"),l=c,c=a.length);for(c=0;c<a.length;++c)if(c!==l){var u=a[c],d=u.indexOf("]="),f=d===-1?u.indexOf("="):d+1,m,b;if(f===-1?(m=e.decoder(u,Gt.decoder,h,"key"),b=e.strictNullHandling?null:""):(m=e.decoder(u.slice(0,f),Gt.decoder,h,"key"),m!==null&&(b=cs.maybeMap(Tw(u.slice(f+1),e,Um(i[m])?i[m].length:0),function(v){return e.decoder(v,Gt.decoder,h,"value")}))),b&&e.interpretNumericEntities&&h==="iso-8859-1"&&(b=xT(String(b))),u.indexOf("[]=")>-1&&(b=Um(b)?[b]:b),e.comma&&Um(b)&&b.length>e.arrayLimit){if(e.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");b=cs.combine([],b,e.arrayLimit,e.plainObjects)}if(m!==null){var y=Wf.call(i,m);y&&(e.duplicates==="combine"||u.indexOf("[]=")>-1)?i[m]=cs.combine(i[m],b,e.arrayLimit,e.plainObjects):(!y||e.duplicates==="last")&&(i[m]=b)}}return i},RT=function(o,t,e,i){var n=0;if(o.length>0&&o[o.length-1]==="[]"){var r=o.slice(0,-1).join("");n=Array.isArray(t)&&t[r]?t[r].length:0}for(var a=i?t:Tw(t,e,n),l=o.length-1;l>=0;--l){var c,h=o[l];if(h==="[]"&&e.parseArrays)cs.isOverflow(a)?c=a:c=e.allowEmptyArrays&&(a===""||e.strictNullHandling&&a===null)?[]:cs.combine([],a,e.arrayLimit,e.plainObjects);else{c=e.plainObjects?{__proto__:null}:{};var u=h.charAt(0)==="["&&h.charAt(h.length-1)==="]"?h.slice(1,-1):h,d=e.decodeDotInKeys?u.replace(/%2E/g,"."):u,f=parseInt(d,10),m=!isNaN(f)&&h!==d&&String(f)===d&&f>=0&&e.parseArrays;if(!e.parseArrays&&d==="")c={0:a};else if(m&&f<e.arrayLimit)c=[],c[f]=a;else{if(m&&e.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");m?(c[f]=a,cs.markOverflow(c,f)):d!=="__proto__"&&(c[d]=a)}}a=c}return a},MT=function(t,e){var i=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(e.depth<=0)return!e.plainObjects&&Wf.call(Object.prototype,i)&&!e.allowPrototypes?void 0:[i];var n=[],r=i.indexOf("["),a=r>=0?i.slice(0,r):i;if(a){if(!e.plainObjects&&Wf.call(Object.prototype,a)&&!e.allowPrototypes)return;n[n.length]=a}for(var l=i.length,c=r,h=0;c>=0&&h<e.depth;){for(var u=1,d=c+1,f=-1;d<l&&f<0;){var m=i.charCodeAt(d);m===91?u+=1:m===93&&(u-=1,u===0&&(f=d)),d+=1}if(f<0)return n[n.length]="["+i.slice(c)+"]",n;var b=i.slice(c,f+1),y=b.slice(1,-1);if(!e.plainObjects&&Wf.call(Object.prototype,y)&&!e.allowPrototypes)return;n[n.length]=b,h+=1,c=i.indexOf("[",f+1)}if(c>=0){if(e.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+e.depth+" and strictDepth is true");n[n.length]="["+i.slice(c)+"]"}return n},DT=function(t,e,i,n){if(t){var r=MT(t,i);if(r)return RT(r,e,i,n)}},OT=function(t){if(!t)return Gt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var e=typeof t.charset>
12"u"?Gt.charset:t.charset,i=typeof t.duplicates>"u"?Gt.duplicates:t.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var n=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:Gt.allowDots:!!t.allowDots;return{allowDots:n,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Gt.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Gt.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Gt.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Gt.arrayLimit,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Gt.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Gt.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:Gt.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:Gt.decoder,delimiter:typeof t.delimiter=="string"||cs.isRegExp(t.delimiter)?t.delimiter:Gt.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Gt.depth,duplicates:i,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Gt.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Gt.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Gt.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:Gt.strictDepth,strictMerge:typeof t.strictMerge=="boolean"?!!t.strictMerge:Gt.strictMerge,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Gt.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}},LT=function(o,t){var e=OT(t);if(o===""||o===null||typeof o>"u")return e.plainObjects?{__proto__:null}:{};for(var i=typeof o=="string"?PT(o,e):o,n=e.plainObjects?{__proto__:null}:{},r=Object.keys(i),a=0;a<r.length;++a){var l=r[a],c=DT(l,i[l],e,typeof o=="string");n=cs.merge(n,c,e)}return e.allowSparse===!0?n:cs.compact(n)},kT=ET,IT=LT,vR={parse:IT,stringify:kT},Pw={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress 13 * @license MIT */(function(o,t){(function(e,i){o.exports=i()})(Cn,function(){var e={};e.version="0.2.0";var i=e.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};e.configure=function(b){var y,v;for(y in b)v=b[y],v!==void 0&&b.hasOwnProperty(y)&&(i[y]=v);return this},e.status=null,e.set=function(b){var y=e.isStarted();b=n(b,i.minimum,1),e.status=b===1?null:b;var v=e.render(!y),S=v.querySelector(i.barSelector),x=i.speed,E=i.easing;return v.offsetWidth,l(function(C){i.positionUsing===""&&(i.positionUsing=e.getPositioningCSS()),c(S,a(b,x,E)),b===1?(c(v,{transition:"none",opacity:1}),v.offsetWidth,setTimeout(function(){c(v,{transition:"all "+x+"ms linear",opacity:0}),setTimeout(function(){e.remove(),C()},x)},x)):setTimeout(C,x)}),this},e.isStarted=function(){return typeof e.status=="number"},e.start=function(){e.status||e.set(0);var b=function(){setTimeout(function(){e.status&&(e.trickle(),b())},i.trickleSpeed)};return i.trickle&&b(),this},e.done=function(b){return!b&&!e.status?this:e.inc(.3+.5*Math.random()).set(1)},e.inc=function(b){var y=e.status;return y?(typeof b!="number"&&(b=(1-y)*n(Math.random()*y,.1,.95)),y=n(y+b,0,.994),e.set(y)):e.start()},e.trickle=function(){return e.inc(Math.random()*i.trickleRate)},function(){var b=0,y=0;e.promise=function(v){return!v||v.state()==="resolved"?this:(y===0&&e.start(),b++,y++,v.always(function(){y--,y===0?(b=0,e.done()):e.set((b-y)/b)}),this)}}(),e.render=function(b){if(e.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var y=document.createElement("div");y.id="nprogress",y.innerHTML=i.template;var v=y.querySelector(i.barSelector),S=b?"-100":r(e.status||0),x=document.querySelector(i.parent),E;return c(v,{transition:"all 0 linear",transform:"translate3d("+S+"%,0,0)"}),i.showSpinner||(E=y.querySelector(i.spinnerSelector),E&&m(E)),x!=document.body&&u(x,"nprogress-custom-parent"),x.appendChild(y),y},e.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(i.parent),"nprogress-custom-parent");var b=document.getElementById("nprogress");b&&m(b)},e.isRendered=function(){return!!document.getElementById("nprogress")},e.getPositioningCSS=function(){var b=document.body.style,y="WebkitTransform"in b?"Webkit":"MozTransform"in b?"Moz":"msTransform"in b?"ms":"OTransform"in b?"O":"";return y+"Perspective"in b?"translate3d":y+"Transform"in b?"translate":"margin"};function n(b,y,v){return b<y?y:b>v?v:b}function r(b){return(-1+b)*100}function a(b,y,v){var S;return i.positionUsing==="translate3d"?S={transform:"translate3d("+r(b)+"%,0,0)"}:i.positionUsing==="translate"?S={transform:"translate("+r(b)+"%,0)"}:S={"margin-left":r(b)+"%"},S.transition="all "+y+"ms "+v,S}var l=function(){var b=[];function y(){var v=b.shift();v&&v(y)}return function(v){b.push(v),b.length==1&&y()}}(),c=function(){var b=["Webkit","O","Moz","ms"],y={};function v(C){return C.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(T,R){return R.toUpperCase()})}function S(C){var T=document.body.style;if(C in T)return C;for(var R=b.length,D=C.charAt(0).toUpperCase()+C.slice(1),L;R--;)if(L=b[R]+D,L in T)return L;return C}function x(C){return C=v(C),y[C]||(y[C]=S(C))}function E(C,T,R){T=x(T),C.style[T]=R}return function(C,T){var R=arguments,D,L;if(R.length==2)for(D in T)L=T[D],L!==void 0&&T.hasOwnProperty(D)&&E(C,D,L);else E(C,R[1],R[2])}}();function h(b,y){var v=typeof b=="string"?b:f(b);return v.indexOf(" "+y+" ")>=0}function u(b,y){var v=f(b),S=v+y;h(v,y)||(b.className=S.substring(1))}function d(b,y){var v=f(b),S;h(b,y)&&(S=v.replace(" "+y+" "," "),b.className=S.substring(1,S.length-1))}function f(b){return(" "+(b.className||"")+" ").replace(/\s+/gi," ")}function m(b){b&&b.parentNode&&b.parentNode.removeChild(b)}return e})})(Pw);var FT=Pw.exports;const SR=Xd(FT);var Mp={exports:{}};Mp.exports;(function(o,t){var e=200,i="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",a="[object Array]",l="[object Boolean]",c="[object Date]",h="[object Error]",u="[object Function]",d="[object GeneratorFunction]",f="[object Map]",m="[object Number]",b="[object Object]",y="[object Promise]",v="[object RegExp]",S="[object Set]",x="[object String]",E="[object Symbol]",C="[object WeakMap]",T="[object ArrayBuffer]",R="[object DataView]",D="[object Float32Array]",L="[object Float64Array
13]",I="[object Int8Array]",N="[object Int16Array]",F="[object Int32Array]",U="[object Uint8Array]",Y="[object Uint8ClampedArray]",$="[object Uint16Array]",Z="[object Uint32Array]",H=/[\\^$.*+?()[\]{}|]/g,G=/\w*$/,pt=/^\[object .+?Constructor\]$/,ft=/^(?:0|[1-9]\d*)$/,X={};X[r]=X[a]=X[T]=X[R]=X[l]=X[c]=X[D]=X[L]=X[I]=X[N]=X[F]=X[f]=X[m]=X[b]=X[v]=X[S]=X[x]=X[E]=X[U]=X[Y]=X[$]=X[Z]=!0,X[h]=X[u]=X[C]=!1;var Zt=typeof Cn=="object"&&Cn&&Cn.Object===Object&&Cn,gt=typeof self=="object"&&self&&self.Object===Object&&self,J=Zt||gt||Function("return this")(),Ut=t&&!t.nodeType&&t,tt=Ut&&!0&&o&&!o.nodeType&&o,me=tt&&tt.exports===Ut;function bt(g,_){return g.set(_[0],_[1]),g}function at(g,_){return g.add(_),g}function Ye(g,_){for(var P=-1,O=g?g.length:0;++P<O&&_(g[P],P,g)!==!1;);return g}function Ke(g,_){for(var P=-1,O=_.length,nt=g.length;++P<O;)g[nt+P]=_[P];return g}function ye(g,_,P,O){for(var nt=-1,Q=g?g.length:0;++nt<Q;)P=_(P,g[nt],nt,g);return P}function Gi(g,_){for(var P=-1,O=Array(g);++P<g;)O[P]=_(P);return O}function ds(g,_){return g==null?void 0:g[_]}function vi(g){var _=!1;if(g!=null&&typeof g.toString!="function")try{_=!!(g+"")}catch{}return _}function af(g){var _=-1,P=Array(g.size);return g.forEach(function(O,nt){P[++_]=[nt,O]}),P}function oh(g,_){return function(P){return g(_(P))}}function of(g){var _=-1,P=Array(g.size);return g.forEach(function(O){P[++_]=O}),P}var Tg=Array.prototype,Pg=Function.prototype,Jo=Object.prototype,lh=J["__core-js_shared__"],lf=function(){var g=/[^.]+$/.exec(lh&&lh.keys&&lh.keys.IE_PROTO||"");return g?"Symbol(src)_1."+g:""}(),cf=Pg.toString,Mn=Jo.hasOwnProperty,Qo=Jo.toString,Rg=RegExp("^"+cf.call(Mn).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fa=me?J.Buffer:void 0,Zo=J.Symbol,ch=J.Uint8Array,Wi=oh(Object.getPrototypeOf,Object),hf=Object.create,uf=Jo.propertyIsEnumerable,Mg=Tg.splice,hh=Object.getOwnPropertySymbols,tl=fa?fa.isBuffer:void 0,df=oh(Object.keys,Object),el=un(J,"DataView"),pa=un(J,"Map"),hn=un(J,"Promise"),il=un(J,"Set"),uh=un(J,"WeakMap"),ga=un(Object,"create"),dh=Je(el),ma=Je(pa),fh=Je(hn),ph=Je(il),gh=Je(uh),cr=Zo?Zo.prototype:void 0,ff=cr?cr.valueOf:void 0;function fs(g){var _=-1,P=g?g.length:0;for(this.clear();++_<P;){var O=g[_];this.set(O[0],O[1])}}function Dg(){this.__data__=ga?ga(null):{}}function Og(g){return this.has(g)&&delete this.__data__[g]}function Lg(g){var _=this.__data__;if(ga){var P=_[g];return P===i?void 0:P}return Mn.call(_,g)?_[g]:void 0}function pf(g){var _=this.__data__;return ga?_[g]!==void 0:Mn.call(_,g)}function mh(g,_){var P=this.__data__;return P[g]=ga&&_===void 0?i:_,this}fs.prototype.clear=Dg,fs.prototype.delete=Og,fs.prototype.get=Lg,fs.prototype.has=pf,fs.prototype.set=mh;function Ce(g){var _=-1,P=g?g.length:0;for(this.clear();++_<P;){var O=g[_];this.set(O[0],O[1])}}function kg(){this.__data__=[]}function Ig(g){var _=this.__data__,P=sl(_,g);if(P<0)return!1;var O=_.length-1;return P==O?_.pop():Mg.call(_,P,1),!0}function Fg(g){var _=this.__data__,P=sl(_,g);return P<0?void 0:_[P][1]}function Ng(g){return sl(this.__data__,g)>-1}function Bg(g,_){var P=this.__data__,O=sl(P,g);return O<0?P.push([g,_]):P[O][1]=_,this}Ce.prototype.clear=kg,Ce.prototype.delete=Ig,Ce.prototype.get=Fg,Ce.prototype.has=Ng,Ce.prototype.set=Bg;function Be(g){var _=-1,P=g?g.length:0;for(this.clear();++_<P;){var O=g[_];this.set(O[0],O[1])}}function Ug(){this.__data__={hash:new fs,map:new(pa||Ce),string:new fs}}function $g(g){return ba(this,g).delete(g)}function Hg(g){return ba(this,g).get(g)}function jg(g){return ba(this,g).has(g)}function zg(g,_){return ba(this,g).set(g,_),this}Be.prototype.clear=Ug,Be.prototype.delete=$g,Be.prototype.get=Hg,Be.prototype.has=jg,Be.prototype.set=zg;function li(g){this.__data__=new Ce(g)}function Gg(){this.__data__=new Ce}function Wg(g){return this.__data__.delete(g)}function Vg(g){return this.__data__.get(g)}function qg(g){return this.__data__.has(g)}function Xg(g,_){var P=this.__data__;if(P instanceof Ce){var O=P.__data__;if(!pa||O.length<e-1)return O.push([g,_]),this;P=this.__data__=new Be(O)}return P.set(g,_),this}li.prototype.clear=Gg,li.prototype.delete=Wg,li.prototype.get=Vg,li.prototype.has=qg,li.prototype.set=Xg;function nl(g,_){var P=wh(g)||al(g)?Gi(g.length,String):[],O=P.length,nt=!!O;for(var Q in g)Mn.call(g,Q)&&!(nt&&(Q=="length"||lm(Q,O)))&&P.push(Q);return P}function gf(g,_,P){var O=g[_];(!(Mn.call(g,_)&&wf(O,P))||P===void 0&&!(_ in g))&&(g[_]=P)}function sl(g,_){for(var P=g.length;P--;)if(wf(g[P][0],_))return P;return-1}function Dn(g,_){return g&&Ah(_,Sh(_),g)}function yh(g,_,P,O,nt,Q,St){var At;if(O&&(At=Q?O(g,nt,Q,St):O(g)),At!==void 0)return At;if(!Ln(g))return g;var ie=wh(g);if(ie){if(At=am(g),!_)return nm(g,At)}else{var Et=gs(g),Ue=Et==u||Et==d;if(vf(g))return rl(g,_);if(Et==b||Et==r||Ue&&!Q){if(vi(g))return Q?g:{};if(At=On(Ue?{}:g),!_)return sm(g,Dn(At,g))}else{if(!X[Et])return Q?g:{};At=om(g,Et,yh,_)}}St||(St=new li);var ci=St.get(g);if(ci)return ci;if(St.set(g,At),!ie)var le=P?rm(g):Sh(g);return Ye(le||g,function($e,Te){le&&(Te=$e,$e=g[Te]),gf(At,Te,yh($e,_,P,O,Te,g,St))}),At}function Yg(g){return Ln(g)?hf(g):{}}function Kg(g,_,P){var O=_(g);return wh(g)?O:Ke(O,P(g))}function Jg(g){return Qo.call(g)}function Qg(g){if(!Ln(g)||hm(g))return!1;var _=vh(g)||vi(g)?Rg:pt;return _.test(Je(g))}function Zg(g){if(!bf(g))return df(g);var _=[];for(var P in Object(g))Mn.call(g,P)&&P!="constructor"&&_.push(P);return _}function rl(g,_){if(_)return g.slice();var P=new g.constructor(g.length);return g.copy(P),P}function bh(g){var _=new g.constructor(g.byteLength);return new ch(_).set(new ch(g)),_}function ya(g,_){var P=_?bh(g.buffer):g.buffer;return new g.constructor(P,g.byteOffset,g.byteLength)}function mf(g,_,P){var O=_?P(af(g),!0):af(g);return ye(O,bt,new g.constructor)}function yf(g){var _=new g.constructor(g.source,G.exec(g));return _.lastIndex=g.lastIndex,_}function tm(g,_,P){var O=_?P(of(g),!0):of(g);return ye(O,at,new g.constructor)}function em(g){return ff?Object(ff.call(g)):{}}function im(g,_){var P=_?bh(g.buffer):g.buffer;return new g.constructor(P,g.byteOffset,g.length)}function nm(g,_){var P=-1,O=g.length;for(_||(_=Array(O));++P<O;)_[P]=g[P];return _}function Ah(g,_,P,O){P||(P={});for(var nt=-1,Q=_.length;++nt<Q;){var St=_[nt],At=void 0;gf(P,St,At===void 0?g[St]:At)}return P}function sm(g,_){return Ah(g,ps(g),_)}function rm(g){return Kg(g,Sh,ps)}function ba(g,_){var P=g.__data__;return cm(_)?P[typeof _=="string"?"string":"hash"]:P.map}function un(g,_){var P=ds(g,_);return Qg(P)?P:void 0}var ps=hh?oh(hh,Object):dm,gs=Jg;(el&&gs(new el(new ArrayBuffer(1)))!=R||pa&&gs(new pa)!=f||hn&&gs(hn.resolve())!=y||il&&gs(new il)!=S||uh&&gs(new uh)!=C)&&(gs=function(g){var _=Qo.call(g),P=_==b?g.constructor:void 0,O=P?Je(P):void 0;if(O)switch(O){case dh:return R;case ma:return f;case fh:return y;case ph:return S;case gh:return C}return _});function am(g){var _=g.length,P=g.constructor(_);return _&&typeof g[0]=="string"&&Mn.call(g,"index")&&(P.index=g.index,P.input=g.input),P}function On(g){return typeof g.constructor=="function"&&!bf(g)?Yg(Wi(g)):{}}function om(g,_,P,O){var nt=g.constructor;switch(_){case T:return bh(g);case l:case c:return new nt(+g);case R:return ya(g,O);case D:case L:case I:case N:case F:case U:case Y:case $:case Z:return im(g,O);case f:return mf(g,O,P);case m:case x:return new nt(g);case v:return yf(g);case S:return tm(g,O,P);case E:return em(g)}}function lm(g,_){return _=_??n,!!_&&(typeof g=="number"||ft.test(g))&&g>-1&&g%1==0&&g<_}function cm(g){var _=typeof g;return _=="string"||_=="number"||_=="symbol"||_=="boolean"?g!=="__proto__":g===null}function hm(g){return!!lf&&lf in g}function bf(g){var _=g&&g.constructor,P=typeof _=="function"&&_.prototype||Jo;return g===P}function Je(g){if(g!=null){try{return cf.call(g)}catch{}try{return g+""}catch{}}return""}function Af(g){return yh(g,!0,!0)}function wf(g,_){return g===_||g!==g&&_!==_}function al(g){return um(g)&&Mn.call(g,"callee")&&(!uf.call(g,"callee")||Qo.call(g)==r)}var wh=Array.isArray;function ol(g){return g!=null&&Sf(g.length)&&!vh(g)}function um(g){return _f(g)&&ol(g)}var vf=tl||fm;function vh(g){var _=Ln(g)?Qo.call(g):"";return _==u||_==d}function Sf(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=n}function Ln(g){var _=typeof g;return!!g&&(_=="object"||_=="function")}function _f(g){return!!g&&typeof g=="object"}function Sh(g){return ol(g)?nl(g):Zg(g)}function dm(){return[]}function fm(){return!1}o.exports=Af}
vendor: 5,262 bytes, line 13
13)(Mp,Mp.exports);var NT=Mp.exports;const _R=Xd(NT);var Dp={exports:{}};Dp.exports;(function(o,t){var e=200,i="__lodash_hash_undefined__",n=1,r=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",h="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",f="[object Error]",m="[object Function]",b="[object GeneratorFunction]",y="[object Map]",v="[object Number]",S="[object Null]",x="[object Object]",E="[object Promise]",C="[object Proxy]",T="[object RegExp]",R="[object Set]",D="[object String]",L="[object Symbol]",I="[object Undefined]",N="[object WeakMap]",F="[object ArrayBuffer]",U="[object DataView]",Y="[object Float32Array]",$="[object Float64Array]",Z="[object Int8Array]",H="[object Int16Array]",G="[object Int32Array]",pt="[object Uint8Array]",ft="[object Uint8ClampedArray]",X="[object Uint16Array]",Zt="[object Uint32Array]",gt=/[\\^$.*+?()[\]{}|]/g,J=/^\[object .+?Constructor\]$/,Ut=/^(?:0|[1-9]\d*)$/,tt={};tt[Y]=tt[$]=tt[Z]=tt[H]=tt[G]=tt[pt]=tt[ft]=tt[X]=tt[Zt]=!0,tt[l]=tt[c]=tt[F]=tt[u]=tt[U]=tt[d]=tt[f]=tt[m]=tt[y]=tt[v]=tt[x]=tt[T]=tt[R]=tt[D]=tt[N]=!1;var me=typeof Cn=="object"&&Cn&&Cn.Object===Object&&Cn,bt=typeof self=="object"&&self&&self.Object===Object&&self,at=me||bt||Function("return this")(),Ye=t&&!t.nodeType&&t,Ke=Ye&&!0&&o&&!o.nodeType&&o,ye=Ke&&Ke.exports===Ye,Gi=ye&&me.process,ds=function(){try{return Gi&&Gi.binding&&Gi.binding("util")}catch{}}(),vi=ds&&ds.isTypedArray;function af(g,_){for(var P=-1,O=g==null?0:g.length,nt=0,Q=[];++P<O;){var St=g[P];_(St,P,g)&&(Q[nt++]=St)}return Q}function oh(g,_){for(var P=-1,O=_.length,nt=g.length;++P<O;)g[nt+P]=_[P];return g}function of(g,_){for(var P=-1,O=g==null?0:g.length;++P<O;)if(_(g[P],P,g))return!0;return!1}function Tg(g,_){for(var P=-1,O=Array(g);++P<g;)O[P]=_(P);return O}function Pg(g){return function(_){return g(_)}}function Jo(g,_){return g.has(_)}function lh(g,_){return g==null?void 0:g[_]}function lf(g){var _=-1,P=Array(g.size);return g.forEach(function(O,nt){P[++_]=[nt,O]}),P}function cf(g,_){return function(P){return g(_(P))}}function Mn(g){var _=-1,P=Array(g.size);return g.forEach(function(O){P[++_]=O}),P}var Qo=Array.prototype,Rg=Function.prototype,fa=Object.prototype,Zo=at["__core-js_shared__"],ch=Rg.toString,Wi=fa.hasOwnProperty,hf=function(){var g=/[^.]+$/.exec(Zo&&Zo.keys&&Zo.keys.IE_PROTO||"");return g?"Symbol(src)_1."+g:""}(),uf=fa.toString,Mg=RegExp("^"+ch.call(Wi).replace(gt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),hh=ye?at.Buffer:void 0,tl=at.Symbol,df=at.Uint8Array,el=fa.propertyIsEnumerable,pa=Qo.splice,hn=tl?tl.toStringTag:void 0,il=Object.getOwnPropertySymbols,uh=hh?hh.isBuffer:void 0,ga=cf(Object.keys,Object),dh=ps(at,"DataView"),ma=ps(at,"Map"),fh=ps(at,"Promise"),ph=ps(at,"Set"),gh=ps(at,"WeakMap"),cr=ps(Object,"create"),ff=Je(dh),fs=Je(ma),Dg=Je(fh),Og=Je(ph),Lg=Je(gh),pf=tl?tl.prototype:void 0,mh=pf?pf.valueOf:void 0;function Ce(g){var _=-1,P=g==null?0:g.length;for(this.clear();++_<P;){var O=g[_];this.set(O[0],O[1])}}function kg(){this.__data__=cr?cr(null):{},this.size=0}function Ig(g){var _=this.has(g)&&delete this.__data__[g];return this.size-=_?1:0,_}function Fg(g){var _=this.__data__;if(cr){var P=_[g];return P===i?void 0:P}return Wi.call(_,g)?_[g]:void 0}function Ng(g){var _=this.__data__;return cr?_[g]!==void 0:Wi.call(_,g)}function Bg(g,_){var P=this.__data__;return this.size+=this.has(g)?0:1,P[g]=cr&&_===void 0?i:_,this}Ce.prototype.clear=kg,Ce.prototype.delete=Ig,Ce.prototype.get=Fg,Ce.prototype.has=Ng,Ce.prototype.set=Bg;function Be(g){var _=-1,P=g==null?0:g.length;for(this.clear();++_<P;){var O=g[_];this.set(O[0],O[1])}}function Ug(){this.__data__=[],this.size=0}function $g(g){var _=this.__data__,P=rl(_,g);if(P<0)return!1;var O=_.length-1;return P==O?_.pop():pa.call(_,P,1),--this.size,!0}function Hg(g){var _=this.__data__,P=rl(_,g);return P<0?void 0:_[P][1]}function jg(g){return rl(this.__data__,g)>-1}function zg(g,_){var P=this.__data__,O=rl(P,g);return O<0?(++this.size,P.push([g,_])):P[O][1]=_,this}Be.prototype.clear=Ug,Be.prototype.delete=$g,Be.prototype.get=Hg,Be.prototype.has=jg,Be.prototype.set=zg;function li(g){var _=-1,P=g==null?0:g.length;for(this.clear();++_<P;){var O=g[_];this.set(O[0],O[1])}}function Gg(){this.size=0,this.__data__={hash:new Ce,map:new(ma||Be),string:new Ce}}function Wg(g){var _=un(this,g).delete(g);return this.size-=_?1:0,_}function Vg(g){return un(this,g).get(g)}function qg(g){return un(this,g).has(g)}function Xg(g,_){var P=un(this,g),O=P.size;return P.set(g,_),this.size+=P.size==O?0:1,this}li.prototype.clear=Gg,li.prototype.delete=Wg,li.prototype.get=Vg,li.prototype.has=qg,li.prototype.set=Xg;function nl(g){var _=-1,P=g==null?0:g.length;for(this.__data__=new li;++_<P;)this.add(g[_])}function gf(g){return this.__data__.set(g,i),this}function sl(g){return this.__data__.has(g)}nl.prototype.add=nl.prototype.push=gf,nl.prototype.has=sl;function Dn(g){var _=this.__data__=new Be(g);this.size=_.size}function yh(){this.__data__=new Be,this.size=0}function Yg(g){var _=this.__data__,P=_.delete(g);return this.size=_.size,P}function Kg(g){return this.__data__.get(g)}function Jg(g){return this.__data__.has(g)}function Qg(g,_){var P=this.__data__;if(P instanceof Be){var O=P.__data__;
vendor: 1,239 bytes, line 13
13if(!ma||O.length<e-1)return O.push([g,_]),this.size=++P.size,this;P=this.__data__=new li(O)}return P.set(g,_),this.size=P.size,this}Dn.prototype.clear=yh,Dn.prototype.delete=Yg,Dn.prototype.get=Kg,Dn.prototype.has=Jg,Dn.prototype.set=Qg;function Zg(g,_){var P=al(g),O=!P&&wf(g),nt=!P&&!O&&ol(g),Q=!P&&!O&&!nt&&_f(g),St=P||O||nt||Q,At=St?Tg(g.length,String):[],ie=At.length;for(var Et in g)Wi.call(g,Et)&&!(St&&(Et=="length"||nt&&(Et=="offset"||Et=="parent")||Q&&(Et=="buffer"||Et=="byteLength"||Et=="byteOffset")||om(Et,ie)))&&At.push(Et);return At}function rl(g,_){for(var P=g.length;P--;)if(Af(g[P][0],_))return P;return-1}function bh(g,_,P){var O=_(g);return al(g)?O:oh(O,P(g))}function ya(g){return g==null?g===void 0?I:S:hn&&hn in Object(g)?gs(g):bf(g)}function mf(g){return Ln(g)&&ya(g)==l}function yf(g,_,P,O,nt){return g===_?!0:g==null||_==null||!Ln(g)&&!Ln(_)?g!==g&&_!==_:tm(g,_,P,O,yf,nt)}function tm(g,_,P,O,nt,Q){var St=al(g),At=al(_),ie=St?c:On(g),Et=At?c:On(_);ie=ie==l?x:ie,Et=Et==l?x:Et;var Ue=ie==x,ci=Et==x,le=ie==Et;if(le&&ol(g)){if(!ol(_))return!1;St=!0,Ue=!1}if(le&&!Ue)return Q||(Q=new Dn),St||_f(g)?Ah(g,_,P,O,nt,Q):sm(g,_,ie,P,O,nt,Q);if(!(P&n)){var $e=Ue&&Wi.call(g,"__wrapped__"),Te=ci&&Wi.call(_,"__wrapped__");
vendor: 4,787 bytes, line 13
13if($e||Te){var hr=$e?g.value():g,ms=Te?_.value():_;return Q||(Q=new Dn),nt(hr,ms,P,O,Q)}}return le?(Q||(Q=new Dn),rm(g,_,P,O,nt,Q)):!1}function em(g){if(!Sf(g)||cm(g))return!1;var _=vf(g)?Mg:J;return _.test(Je(g))}function im(g){return Ln(g)&&vh(g.length)&&!!tt[ya(g)]}function nm(g){if(!hm(g))return ga(g);var _=[];for(var P in Object(g))Wi.call(g,P)&&P!="constructor"&&_.push(P);return _}function Ah(g,_,P,O,nt,Q){var St=P&n,At=g.length,ie=_.length;if(At!=ie&&!(St&&ie>At))return!1;var Et=Q.get(g);if(Et&&Q.get(_))return Et==_;var Ue=-1,ci=!0,le=P&r?new nl:void 0;for(Q.set(g,_),Q.set(_,g);++Ue<At;){var $e=g[Ue],Te=_[Ue];if(O)var hr=St?O(Te,$e,Ue,_,g,Q):O($e,Te,Ue,g,_,Q);if(hr!==void 0){if(hr)continue;ci=!1;break}if(le){if(!of(_,function(ms,Aa){if(!Jo(le,Aa)&&($e===ms||nt($e,ms,P,O,Q)))return le.push(Aa)})){ci=!1;break}}else if(!($e===Te||nt($e,Te,P,O,Q))){ci=!1;break}}return Q.delete(g),Q.delete(_),ci}function sm(g,_,P,O,nt,Q,St){switch(P){case U:if(g.byteLength!=_.byteLength||g.byteOffset!=_.byteOffset)return!1;g=g.buffer,_=_.buffer;case F:return!(g.byteLength!=_.byteLength||!Q(new df(g),new df(_)));case u:case d:case v:return Af(+g,+_);case f:return g.name==_.name&&g.message==_.message;case T:case D:return g==_+"";case y:var At=lf;case R:var ie=O&n;if(At||(At=Mn),g.size!=_.size&&!ie)return!1;var Et=St.get(g);if(Et)return Et==_;O|=r,St.set(g,_);var Ue=Ah(At(g),At(_),O,nt,Q,St);return St.delete(g),Ue;case L:if(mh)return mh.call(g)==mh.call(_)}return!1}function rm(g,_,P,O,nt,Q){var St=P&n,At=ba(g),ie=At.length,Et=ba(_),Ue=Et.length;if(ie!=Ue&&!St)return!1;for(var ci=ie;ci--;){var le=At[ci];if(!(St?le in _:Wi.call(_,le)))return!1}var $e=Q.get(g);if($e&&Q.get(_))return $e==_;var Te=!0;Q.set(g,_),Q.set(_,g);for(var hr=St;++ci<ie;){le=At[ci];var ms=g[le],Aa=_[le];if(O)var u0=St?O(Aa,ms,le,_,g,Q):O(ms,Aa,le,g,_,Q);if(!(u0===void 0?ms===Aa||nt(ms,Aa,P,O,Q):u0)){Te=!1;break}hr||(hr=le=="constructor")}if(Te&&!hr){var Ef=g.constructor,xf=_.constructor;Ef!=xf&&"constructor"in g&&"constructor"in _&&!(typeof Ef=="function"&&Ef instanceof Ef&&typeof xf=="function"&&xf instanceof xf)&&(Te=!1)}return Q.delete(g),Q.delete(_),Te}function ba(g){return bh(g,Sh,am)}function un(g,_){var P=g.__data__;return lm(_)?P[typeof _=="string"?"string":"hash"]:P.map}function ps(g,_){var P=lh(g,_);return em(P)?P:void 0}function gs(g){var _=Wi.call(g,hn),P=g[hn];try{g[hn]=void 0;var O=!0}catch{}var nt=uf.call(g);return O&&(_?g[hn]=P:delete g[hn]),nt}var am=il?function(g){return g==null?[]:(g=Object(g),af(il(g),function(_){return el.call(g,_)}))}:dm,On=ya;(dh&&On(new dh(new ArrayBuffer(1)))!=U||ma&&On(new ma)!=y||fh&&On(fh.resolve())!=E||ph&&On(new ph)!=R||gh&&On(new gh)!=N)&&(On=function(g){var _=ya(g),P=_==x?g.constructor:void 0,O=P?Je(P):"";if(O)switch(O){case ff:return U;case fs:return y;case Dg:return E;case Og:return R;case Lg:return N}return _});function om(g,_){return _=_??a,!!_&&(typeof g=="number"||Ut.test(g))&&g>-1&&g%1==0&&g<_}function lm(g){var _=typeof g;return _=="string"||_=="number"||_=="symbol"||_=="boolean"?g!=="__proto__":g===null}function cm(g){return!!hf&&hf in g}function hm(g){var _=g&&g.constructor,P=typeof _=="function"&&_.prototype||fa;return g===P}function bf(g){return uf.call(g)}function Je(g){if(g!=null){try{return ch.call(g)}catch{}try{return g+""}catch{}}return""}function Af(g,_){return g===_||g!==g&&_!==_}var wf=mf(function(){return arguments}())?mf:function(g){return Ln(g)&&Wi.call(g,"callee")&&!el.call(g,"callee")},al=Array.isArray;function wh(g){return g!=null&&vh(g.length)&&!vf(g)}var ol=uh||fm;function um(g,_){return yf(g,_)}function vf(g){if(!Sf(g))return!1;var _=ya(g);return _==m||_==b||_==h||_==C}function vh(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=a}function Sf(g){var _=typeof g;return g!=null&&(_=="object"||_=="function")}function Ln(g){return g!=null&&typeof g=="object"}var _f=vi?Pg(vi):im;function Sh(g){return wh(g)?Zg(g):nm(g)}function dm(){return[]}function fm(){return!1}o.exports=um})(Dp,Dp.exports);var BT=Dp.exports;const ER=Xd(BT);function ah(o){this._maxSize=o,this.clear()}ah.prototype.clear=function(){this._size=0,this._values=Object.create(null)};ah.prototype.get=function(o){return this._values[o]};ah.prototype.set=function(o,t){return this._size>=this._maxSize&&this.clear(),o in this._values||this._size++,this._values[o]=t};var UT=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Rw=/^\d+$/,$T=/^\d/,HT=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,jT=/^\s*(['"]?)(.*?)(\1)\s*$/,Vb=512,iA=new ah(Vb);new ah(Vb);var nA=new ah(Vb),xR={split:ry,normalizePath:sA,getter:function(o,t){var e=sA(o);return nA.get(o)||nA.set(o,function(n){for(var r=0,a=e.length;r<a;)if(n!=null||!t)n=n[e[r++]];else return;return n})},join:function(o){return o.reduce(function(t,e){return t+(qb(e)||Rw.test(e)?"["+e+"]":(t?".":"")+e)},"")}
vendor: 4,375 bytes, line 13
13,forEach:function(o,t,e){zT(Array.isArray(o)?o:ry(o),t,e)}};function sA(o){return iA.get(o)||iA.set(o,ry(o).map(function(t){return t.replace(jT,"$2")}))}function ry(o){return o.match(UT)||[""]}function zT(o,t,e){var i=o.length,n,r,a,l;for(r=0;r<i;r++)n=o[r],n&&(VT(n)&&(n='"'+n+'"'),l=qb(n),a=!l&&/^\d+$/.test(n),t.call(e,n,l,a,r,o))}function qb(o){return typeof o=="string"&&o&&["'",'"'].indexOf(o.charAt(0))!==-1}function GT(o){return o.match($T)&&!o.match(Rw)}function WT(o){return HT.test(o)}function VT(o){return!qb(o)&&(GT(o)||WT(o))}const qT=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Mw=o=>o.match(qT)||[],XT=(o,t)=>Mw(o).join(t).toLowerCase(),YT=o=>Mw(o).reduce((t,e)=>`${t}${t?e[0].toUpperCase()+e.slice(1).toLowerCase():e.toLowerCase()}`,""),KT=o=>XT(o,"_");var CR={camelCase:YT,snakeCase:KT},Xb={exports:{}};Xb.exports=function(o){return Dw(JT(o),o)};Xb.exports.array=Dw;function Dw(o,t){var e=o.length,i=new Array(e),n={},r=e,a=QT(t),l=ZT(o);for(t.forEach(function(h){if(!l.has(h[0])||!l.has(h[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});r--;)n[r]||c(o[r],r,new Set);return i;function c(h,u,d){if(d.has(h)){var f;try{f=", node was:"+JSON.stringify(h)}catch{f=""}throw new Error("Cyclic dependency"+f)}if(!l.has(h))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(h));if(!n[u]){n[u]=!0;var m=a.get(h)||new Set;if(m=Array.from(m),u=m.length){d.add(h);do{var b=m[--u];c(b,l.get(b),d)}while(u);d.delete(h)}i[--e]=h}}}function JT(o){for(var t=new Set,e=0,i=o.length;e<i;e++){var n=o[e];t.add(n[0]),t.add(n[1])}return Array.from(t)}function QT(o){for(var t=new Map,e=0,i=o.length;e<i;e++){var n=o[e];t.has(n[0])||t.set(n[0],new Set),t.has(n[1])||t.set(n[1],new Set),t.get(n[0]).add(n[1])}return t}function ZT(o){for(var t=new Map,e=0,i=o.length;e<i;e++)t.set(o[e],e);return t}var t1=Xb.exports;const TR=Xd(t1),ni=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),ay=[.001,0,0,.001,0,0],$m=1.35,$i={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},dr={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},su="pdfjs_internal_editor_",rt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102}
13,mt={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},e1={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Pe={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Vf={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},se={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},fl={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},vg={ERRORS:0,WARNINGS:1,INFOS:5},ru={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},Rf={moveTo:0,lineTo:1,curveTo:2,closePath:3},i1={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Sg=vg.WARNINGS;function n1(o){Number.isInteger(o)&&(Sg=o)}function s1(){return Sg}function _g(o){Sg>=vg.INFOS&&console.info(`Info: ${o}`)}function it(o){Sg>=vg.WARNINGS&&console.warn(`Warning: ${o}`)}function Ft(o){throw new Error(o)}function yt(o,t){o||Ft(t)}function r1(o){switch(o==null?void 0:o.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Ow(o,t=null,e=null){if(!o)return null;if(e&&typeof o=="string"){if(e.addDefaultProtocol&&o.startsWith("www.")){const n=o.match(/\./g);(n==null?void 0:n.length)>=2&&(o=`http://${o}`)}if(e.tryConvertEncoding)try{o=h1(o)}catch{}}const i=t?URL.parse(o,t):URL.parse(o);return r1(i)?i:null}function Lw(o,t,e=!1){const i=URL.parse(o);return i?(i.hash=t,i.href):e&&Ow(o,"http://example.com")?o.split("#",1)[0]+`${t?`#${t}`:""}`:""}function ht(o,t,e,i=!1){return Object.defineProperty(o,t,{value:e,enumerable:!i,configurable:!0,writable:!1}),e}const Yo=function(){function t(e,i){this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class rA extends Yo{constructor(t,e){super(t,"PasswordException"),this.code=e}}class Hm extends Yo{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class oy extends Yo{constructor(t){super(t,"InvalidPDFException")}}class Op extends Yo{constructor(t,e,i){super(t,"ResponseException"),this.status=e,this.missing=i}}class a1 extends Yo{constructor(t){super(t,"FormatError")}}class la extends Yo{constructor(t){super(t,"AbortException")}}function kw(o){(typeof o!="object"||(o==null?void 0:o.length)===void 0)&&Ft("Invalid argument for bytesToString");const t=o.length,e=8192;if(t<e)return String.fromCharCode.apply(null,o);const i=[];for(let n=0;n<t;n+=e){const r=Math.min(n+e,t),a=o.subarray(n,r);i.push(String.fromCharCode.apply(null,a))}return i.join("")}function Qd(o){typeof o!="string"&&Ft("Invalid argument for stringToBytes");const t=o.length,e=new Uint8Array(t);for(let i=0;i<t;
13++i)e[i]=o.charCodeAt(i)&255;return e}function o1(o){return String.fromCharCode(o>>24&255,o>>16&255,o>>8&255,o&255)}function l1(){const o=new Uint8Array(4);return o[0]=1,new Uint32Array(o.buffer,0,1)[0]===1}function c1(){try{return new Function(""),!0}catch{return!1}}class Ne{static get isLittleEndian(){return ht(this,"isLittleEndian",l1())}static get isEvalSupported(){return ht(this,"isEvalSupported",c1())}static get isOffscreenCanvasSupported(){return ht(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return ht(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:t,userAgent:e}=navigator;return ht(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(){var t,e;return ht(this,"isCSSRoundSupported",(e=(t=globalThis.CSS)==null?void 0:t.supports)==null?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const jm=Array.from(Array(256).keys(),o=>o.toString(16).padStart(2,"0"));var rr,qf,ly;class W{static makeHexColor(t,e,i){return`#${jm[t]}${jm[e]}${jm[i]}`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),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,i=0){const n=t[i],r=t[i+1];t[i]=n*e[0]+r*e[2]+e[4],t[i+1]=n*e[1]+r*e[3]+e[5]}static applyTransformToBezier(t,e,i=0){const n=e[0],r=e[1],a=e[2],l=e[3],c=e[4],h=e[5];for(let u=0;u<6;u+=2){const d=t[i+u],f=t[i+u+1];t[i+u]=d*n+f*a+c,t[i+u+1]=d*r+f*l+h}}static applyInverseTransform(t,e){const i=t[0],n=t[1],r=e[0]*e[3]-e[1]*e[2];t[0]=(i*e[3]-n*e[2]+e[2]*e[5]-e[4]*e[3])/r,t[1]=(-i*e[1]+n*e[0]+e[4]*e[1]-e[5]*e[0])/r}static axialAlignedBoundingBox(t,e,i){const n=e[0],r=e[1],a=e[2],l=e[3],c=e[4],h=e[5],u=t[0],d=t[1],f=t[2],m=t[3];let b=n*u+c,y=b,v=n*f+c,S=v,x=l*d+h,E=x,C=l*m+h,T=C;if(r!==0||a!==0){const R=r*u,D=r*f,L=a*d,I=a*m;b+=L,S+=L,v+=I,y+=I,x+=R,T+=R,C+=D,E+=D}i[0]=Math.min(i[0],b,v,y,S),i[1]=Math.min(i[1],x,C,E,T),i[2]=Math.max(i[2],b,v,y,S),i[3]=Math.max(i[3],x,C,E,T)}static inverseTransform(t){const 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){const i=t[0],n=t[1],r=t[2],a=t[3],l=i**2+n**2,c=i*r+n*a,h=r**2+a**2,u=(l+h)/2,d=Math.sqrt(u**2-(l*h-c**2));e[0]=Math.sqrt(u+d||1),e[1]=Math.sqrt(u-d||1)}static normalizeRect(t){const 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){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>n)return null;const r=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 r>a?null:[i,r,n,a]}static pointBoundingBox(t,e,i){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}static rectBoundingBox(t,e,i,n,r){r[0]=Math.min(r[0],t,i),r[1]=Math.min(r[1],e,n),r[2]=Math.max(r[2],t,i),r[3]=Math.max(r[3],e,n)}static bezierBoundingBox(t,e,i,n,r,a,l,c,h){h[0]=Math.min(h[0],t,l),h[1]=Math.min(h[1],e,c),h[2]=Math.max(h[2],t,l),h[3]=Math.max(h[3],e,c),w(this,rr,ly).call(this,t,i,r,l,e,n,a,c,3*(-t+3*(i-r)+l),6*(t-2*i+r),3*(i-t),h),w(this,rr,ly).call(this,t,i,r,l,e,n,a,c,3*(-e+3*(n-a)+c),6*(e-2*n+a),3*(n-e),h)}}rr=new WeakSet,qf=function(t,e,i,n,r,a,l,c,h,u){if(h<=0||h>=1)return;const d=1-h,f=h*h,m=f*h,b=d*(d*(d*t+3*h*e)+3*f*i)+m*n,y=d*(d*(d*r+3*h*a)+3*f*l)+m*c;u[0]=Math.min(u[0],b),u[1]=Math.min(u[1],y),u[2]=Math.max(u[2],b),u[3]=Math.max(u[3],y)}
13,ly=function(t,e,i,n,r,a,l,c,h,u,d,f){if(Math.abs(h)<1e-12){Math.abs(u)>=1e-12&&w(this,rr,qf).call(this,t,e,i,n,r,a,l,c,-d/u,f);return}const m=u**2-4*d*h;if(m<0)return;const b=Math.sqrt(m),y=2*h;w(this,rr,qf).call(this,t,e,i,n,r,a,l,c,(-u+b)/y,f),w(this,rr,qf).call(this,t,e,i,n,r,a,l,c,(-u-b)/y,f)},A(W,rr);function h1(o){return decodeURIComponent(escape(o))}let zm=null,aA=null;function u1(o){return zm||(zm=/([\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,aA=new Map([["ſt","ſt"]])),o.replaceAll(zm,(t,e,i)=>e?e.normalize("NFKC"):aA.get(i))}function Iw(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const o=new Uint8Array(32);return crypto.getRandomValues(o),kw(o)}const Yb="pdfjs_internal_id_";function d1(o,t,e){if(!Array.isArray(e)||e.length<2)return!1;const[i,n,...r]=e;if(!o(i)&&!Number.isInteger(i)||!t(n))return!1;const a=r.length;let l=!0;switch(n.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;l=!1;break;default:return!1}for(const c of r)if(!(typeof c=="number"||l&&c===null))return!1;return!0}function si(o,t,e){return Math.min(Math.max(o,t),e)}function Fw(o){return Uint8Array.prototype.toBase64?o.toBase64():btoa(kw(o))}function f1(o){return Uint8Array.fromBase64?Uint8Array.fromBase64(o):Qd(atob(o))}typeof Promise.try!="function"&&(Promise.try=function(o,...t){return new Promise(e=>{e(o(...t))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(o){return o.reduce((t,e)=>t+e,0)});class au{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};function n(r){var c;if(!r)return;let a=null;const l=r.name;if(l==="#text")a=r.value;else if(au.shouldBuildText(l))(c=r==null?void 0:r.attributes)!=null&&c.textContent?a=r.attributes.textContent:r.value&&(a=r.value);else return;if(a!==null&&e.push({str:a}),!!r.children)for(const h of r.children)n(h)}return n(t),i}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}class Nw{static setupStorage(t,e,i,n,r){const a=n.getValue(e,{value:null});switch(i.name){case"textarea":if(a.value!==null&&(t.textContent=a.value),r==="print")break;t.addEventListener("input",l=>{n.setValue(e,{value:l.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(a.value===i.attributes.xfaOn?t.setAttribute("checked",!0):a.value===i.attributes.xfaOff&&t.removeAttribute("checked"),r==="print")break;t.addEventListener("change",l=>{n.setValue(e,{value:l.target.checked?l.target.getAttribute("xfaOn"):l.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&t.setAttribute("value",a.value),r==="print")break;t.addEventListener("input",l=>{n.setValue(e,{value:l.target.value})})}break;case"select":if(a.value!==null){t.setAttribute("value",a.value);for(const l of i.children)l.attributes.value===a.value?l.attributes.selected=!0:l.attributes.hasOwnProperty("selected")&&delete l.attributes.selected}t.addEventListener("input",l=>{const c=l.target.options,h=c.selectedIndex===-1?"":c[c.selectedIndex].value;n.setValue(e,{value:h})});break}}static setAttributes({html:t,element:e,storage:i=null,intent:n,linkService:r}){const{attributes:a}=e,l=t instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${n}`);for(const[c,h]of Object.entries(a))if(h!=null)switch(c){case"class":h.length&&t.setAttribute(c,h.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",h);break;case"style":Object.assign(t.style,h);break;case"textContent":t.textContent=h;break;default:(!l||c!=="href"&&c!=="newWindow")&&t.setAttribute(c,h)}l&&r.addLinkAttributes(t,a.href,a.newWindow),i&&a.dataId&&this.setupStorage(t,a.dataId,e,i)}static render(t){var d,f;const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,r=t.intent||"display",a=document.createElement(n.name);n.attributes&&this.setAttributes({html:a,element:n,intent:r,linkService:i});const l=r!=="richText",c=t.div;if(c.append(a),t.viewport){const m=`matrix(${t.viewport.transform.join(",")})`;c.style.transform=m}l&&c.setAttribute("class","xfaLayer xfaFont");const h=[];
13if(n.children.length===0){if(n.value){const m=document.createTextNode(n.value);a.append(m),l&&au.shouldBuildText(n.name)&&h.push(m)}return{textDivs:h}}const u=[[n,-1,a]];for(;u.length>0;){const[m,b,y]=u.at(-1);if(b+1===m.children.length){u.pop();continue}const v=m.children[++u.at(-1)[1]];if(v===null)continue;const{name:S}=v;if(S==="#text"){const E=document.createTextNode(v.value);h.push(E),y.append(E);continue}const x=(d=v==null?void 0:v.attributes)!=null&&d.xmlns?document.createElementNS(v.attributes.xmlns,S):document.createElement(S);if(y.append(x),v.attributes&&this.setAttributes({html:x,element:v,storage:e,intent:r,linkService:i}),((f=v.children)==null?void 0:f.length)>0)u.push([v,-1,x]);else if(v.value){const E=document.createTextNode(v.value);l&&au.shouldBuildText(S)&&h.push(E),x.append(E)}}for(const m of c.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:h}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const ys="http://www.w3.org/2000/svg",xa=class xa{};k(xa,"CSS",96),k(xa,"PDF",72),k(xa,"PDF_TO_CSS_UNITS",xa.CSS/xa.PDF);let ca=xa;async function Zd(o,t="text"){if(Mh(o,document.baseURI)){const e=await fetch(o);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,i)=>{const n=new XMLHttpRequest;n.open("GET",o,!0),n.responseType=t,n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE){if(n.status===200||n.status===0){switch(t){case"arraybuffer":case"blob":case"json":e(n.response);return}e(n.responseText);return}i(new Error(n.statusText))}},n.send(null)})}class tf{constructor({viewBox:t,userUnit:e,scale:i,rotation:n,offsetX:r=0,offsetY:a=0,dontFlip:l=!1}){this.viewBox=t,this.userUnit=e,this.scale=i,this.rotation=n,this.offsetX=r,this.offsetY=a,i*=e;const c=(t[2]+t[0])/2,h=(t[3]+t[1])/2;let u,d,f,m;switch(n%=360,n<0&&(n+=360),n){case 180:u=-1,d=0,f=0,m=1;break;case 90:u=0,d=1,f=1,m=0;break;case 270:u=0,d=-1,f=-1,m=0;break;case 0:u=1,d=0,f=0,m=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}l&&(f=-f,m=-m);let b,y,v,S;u===0?(b=Math.abs(h-t[1])*i+r,y=Math.abs(c-t[0])*i+a,v=(t[3]-t[1])*i,S=(t[2]-t[0])*i):(b=Math.abs(c-t[0])*i+r,y=Math.abs(h-t[1])*i+a,v=(t[2]-t[0])*i,S=(t[3]-t[1])*i),this.transform=[u*i,d*i,f*i,m*i,b-u*i*c-f*i*h,y-d*i*c-m*i*h],this.width=v,this.height=S}get rawDims(){const t=this.viewBox;return ht(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:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:r=!1}={}){return new tf({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:r})}convertToViewportPoint(t,e){const i=[t,e];return W.applyTransform(i,this.transform),i}convertToViewportRectangle(t){const e=[t[0],t[1]];W.applyTransform(e,this.transform);const i=[t[2],t[3]];return W.applyTransform(i,this.transform),[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){const i=[t,e];return W.applyInverseTransform(i,this.transform),i}}class Kb extends Yo{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}function Eg(o){const t=o.length;let e=0;for(;e<t&&o[e].trim()==="";)e++;return o.substring(e,e+5).toLowerCase()==="data:"}function Jb(o){return typeof o=="string"&&/\.pdf$/i.test(o)}function p1(o){return[o]=o.split(/[#?]/,1),o.substring(o.lastIndexOf("/")+1)}function g1(o,t="document.pdf"){if(typeof o!="string")return t;if(Eg(o))return it('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const i=(l=>{try{return new URL(l)}catch{try{return new URL(decodeURIComponent(l))}catch{try{return new URL(l,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(l),"https://foo.bar")}catch{return null}}}}})(o);if(!i)return t;const n=l=>{try{let c=decodeURIComponent(l);return c.includes("/")?(c=c.split("/").at(-1),c.test(/^\.pdf$/i)?c:l):c}catch{return l}}
13,r=/\.pdf$/i,a=i.pathname.split("/").at(-1);if(r.test(a))return n(a);if(i.searchParams.size>0){const l=Array.from(i.searchParams.values()).reverse();for(const h of l)if(r.test(h))return n(h);const c=Array.from(i.searchParams.keys()).reverse();for(const h of c)if(r.test(h))return n(h)}if(i.hash){const c=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(i.hash);if(c)return n(c[0])}return t}class oA{constructor(){k(this,"started",Object.create(null));k(this,"times",[])}time(t){t in this.started&&it(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||it(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:i}of this.times)e=Math.max(i.length,e);for(const{name:i,start:n,end:r}of this.times)t.push(`${i.padEnd(e)} ${r-n}ms 14`);return t.join("")}}function Mh(o,t){const e=t?URL.parse(o,t):URL.parse(o);return(e==null?void 0:e.protocol)==="http:"||(e==null?void 0:e.protocol)==="https:"}function cn(o){o.preventDefault()}function Qt(o){o.preventDefault(),o.stopPropagation()}function m1(o){console.log("Deprecated API usage: "+o)}var cu;class Lp{static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;s(this,cu)||p(this,cu,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=s(this,cu).exec(t);if(!e)return null;const i=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let r=parseInt(e[3],10);r=r>=1&&r<=31?r:1;let a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let l=parseInt(e[5],10);l=l>=0&&l<=59?l:0;let c=parseInt(e[6],10);c=c>=0&&c<=59?c:0;const h=e[7]||"Z";let u=parseInt(e[8],10);u=u>=0&&u<=23?u:0;let d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,h==="-"?(a+=u,l+=d):h==="+"&&(a-=u,l-=d),new Date(Date.UTC(i,n,r,a,l,c))}}cu=new WeakMap,A(Lp,cu);function y1(o,{scale:t=1,rotation:e=0}){const{width:i,height:n}=o.attributes.style,r=[0,0,parseInt(i),parseInt(n)];return new tf({viewBox:r,userUnit:1,scale:t,rotation:e})}function ef(o){if(o.startsWith("#")){const t=parseInt(o.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return o.startsWith("rgb(")?o.slice(4,-1).split(",").map(t=>parseInt(t)):o.startsWith("rgba(")?o.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(it(`Not a valid color format: "${o}"`),[0,0,0])}function b1(o){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const e of o.keys()){t.style.color=e;const i=window.getComputedStyle(t).color;o.set(e,ef(i))}t.remove()}function Vt(o){const{a:t,b:e,c:i,d:n,e:r,f:a}=o.getTransform();return[t,e,i,n,r,a]}function In(o){const{a:t,b:e,c:i,d:n,e:r,f:a}=o.getTransform().invertSelf();return[t,e,i,n,r,a]}function Wo(o,t,e=!1,i=!0){if(t instanceof tf){const{pageWidth:n,pageHeight:r}=t.rawDims,{style:a}=o,l=Ne.isCSSRoundSupported,c=`var(--total-scale-factor) * ${n}px`,h=`var(--total-scale-factor) * ${r}px`,u=l?`round(down, ${c}, var(--scale-round-x))`:`calc(${c})`,d=l?`round(down, ${h}, var(--scale-round-y))`:`calc(${h})`;!e||t.rotation%180===0?(a.width=u,a.height=d):(a.width=d,a.height=u)}i&&o.setAttribute("data-main-rotation",t.rotation)}class hs{constructor(){const{pixelRatio:t}=hs;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,i,n,r=-1){let a=1/0,l=1/0,c=1/0;i=hs.capPixels(i,r),i>0&&(a=Math.sqrt(i/(t*e))),n!==-1&&(l=n/t,c=n/e);const h=Math.min(a,l,c);return this.sx>h||this.sy>h?(this.sx=h,this.sy=h,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,i):i}return t}}const cy=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class A1{static get isDarkMode(){var t;return ht(this,"isDarkMode",!!((t=window==null?void 0:window.matchMedia)!=null&&t.call(window,"(prefers-color-scheme: dark)").matches))}}class w1{static get commentForegroundColor(){const t=document.createElement("span");t.classList.add("comment","sidebar");const{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);const{color:i}=window.getComputedStyle(t);return t.remove(),ht(this,"commentForegroundColor",ef(i))}}function v1(o,t,e,i){i=Math.min(Math.max(i??1,0),1);const n=255*(1-i);return o=Math.round(o*i+n),t=Math.round(t*i+n),e=Math.round(e*i+n),[o,t,e]}function lA(o,t){const e=o[0]/255,i=o[1]/255,n=o[2]/255,r=Math.max(e,i,n),a=Math.min(e,i,n),l=(r+a)/2;if(r===a)t[0]=t[1]=0;else{const c=r-a;switch(t[1]=l<.5?c/(r+a):c/(2-r-a),r){case e:t[0]=((i-n)/c+(i<n?6:0))*60;break;case i:t[0]=((n-e)/c+2)*60;break;case n:t[0]=((e-i)/c+4)*60;break}}t[2]=l}function hy(o,t){const e=o[0],i=o[1],n=o[2],r=(1-Math.abs(2*n-1))*i,a=r*(1-Math.abs(e/60%2-1)),l=n-r/2;switch(Math.floor(e/60)){case 0:t[0]=r+l,t[1]=a+l,t[2]=l;break;case 1:t[0]=a+l,t[1]=r+l,t[2]=l;break;case 2:t[0]=l,t[1]=r+l,t[2]=a+l;break;case 3:t[0]=l,t[1]=a+l,t[2]=r+l;break;case 4:t[0]=a+l,t[1]=l,t[2]=r+l;break;
14case 5:case 6:t[0]=r+l,t[1]=l,t[2]=a+l;break}}function cA(o){return o<=.03928?o/12.92:((o+.055)/1.055)**2.4}function hA(o,t,e){hy(o,e),e.map(cA);const i=.2126*e[0]+.7152*e[1]+.0722*e[2];hy(t,e),e.map(cA);const n=.2126*e[0]+.7152*e[1]+.0722*e[2];return i>n?(i+.05)/(n+.05):(n+.05)/(i+.05)}const uA=new Map;function S1(o,t){const e=o[0]+o[1]*256+o[2]*65536+t[0]*16777216+t[1]*4294967296+t[2]*1099511627776;let i=uA.get(e);if(i)return i;const n=new Float32Array(9),r=n.subarray(0,3),a=n.subarray(3,6);lA(o,a);const l=n.subarray(6,9);lA(t,l);const c=l[2]<.5,h=c?12:4.5;if(a[2]=c?Math.sqrt(a[2]):1-Math.sqrt(1-a[2]),hA(a,l,r)<h){let u,d;c?(u=a[2],d=1):(u=0,d=a[2]);const f=.005;for(;d-u>f;){const m=a[2]=(u+d)/2;c===hA(a,l,r)<h?u=m:d=m}a[2]=c?d:u}return hy(a,r),i=W.makeHexColor(Math.round(r[0]*255),Math.round(r[1]*255),Math.round(r[2]*255)),uA.set(e,i),i}function Bw({html:o,dir:t,className:e},i){const n=document.createDocumentFragment();if(typeof o=="string"){const r=document.createElement("p");r.dir=t||"auto";const a=o.split(/(?:\r\n?|\n)/);for(let l=0,c=a.length;l<c;++l){const h=a[l];r.append(document.createTextNode(h)),l<c-1&&r.append(document.createElement("br"))}n.append(r)}else Nw.render({xfaHtml:o,div:n,intent:"richText"});n.firstChild.classList.add("richText",e),i.append(n)}var fr,pr,Yi,Ki,hu,gr,Rl,Ml,uu,Wp,Uw,Fe,$w,Hw,pl,Dh;const vs=class vs{constructor(t){A(this,Fe);A(this,fr,null);A(this,pr,null);A(this,Yi);A(this,Ki,null);A(this,hu,null);A(this,gr,null);A(this,Rl,null);A(this,Ml,null);p(this,Yi,t),s(vs,uu)||p(vs,uu,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(){const t=p(this,fr,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=s(this,Yi)._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",cn,{signal:e}),t.addEventListener("pointerdown",w(vs,Wp,Uw),{signal:e}));const i=p(this,Ki,document.createElement("div"));i.className="buttons",t.append(i);const n=s(this,Yi).toolbarPosition;if(n){const{style:r}=t,a=s(this,Yi)._uiManager.direction==="ltr"?1-n[0]:n[0];r.insetInlineEnd=`${100*a}%`,r.top=`calc(${100*n[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return s(this,fr)}hide(){var t;s(this,fr).classList.add("hidden"),(t=s(this,pr))==null||t.hideDropdown()}show(){var t,e;s(this,fr).classList.remove("hidden"),(t=s(this,hu))==null||t.shown(),(e=s(this,gr))==null||e.shown()}addDeleteButton(){const{editorType:t,_uiManager:e}=s(this,Yi),i=document.createElement("button");i.classList.add("basic","deleteButton"),i.tabIndex=0,i.setAttribute("data-l10n-id",s(vs,uu)[t]),w(this,Fe,pl).call(this,i)&&i.addEventListener("click",n=>{e.delete()},{signal:e._signal}),s(this,Ki).append(i)}async addAltText(t){const e=await t.render();w(this,Fe,pl).call(this,e),s(this,Ki).append(e,s(this,Fe,Dh)),p(this,hu,t)}addComment(t,e=null){if(s(this,gr))return;const i=t.renderForToolbar();if(!i)return;w(this,Fe,pl).call(this,i);const n=p(this,Rl,s(this,Fe,Dh));e?(s(this,Ki).insertBefore(i,e),s(this,Ki).insertBefore(n,e)):s(this,Ki).append(i,n),p(this,gr,t),t.toolbar=this}addColorPicker(t){if(s(this,pr))return;p(this,pr,t);const e=t.renderButton();w(this,Fe,pl).call(this,e),s(this,Ki).append(e,s(this,Fe,Dh))}async addEditSignatureButton(t){const e=p(this,Ml,await t.renderEditButton(s(this,Yi)));w(this,Fe,pl).call(this,e),s(this,Ki).append(e,s(this,Fe,Dh))}removeButton(t){var e,i;switch(t){case"comment":(e=s(this,gr))==null||e.removeToolbarCommentButton(),p(this,gr,null),(i=s(this,Rl))==null||i.remove(),p(this,Rl,null);break}}async addButton(t,e){switch(t){case"colorPicker":this.addColorPicker(e);break;case"altText":await this.addAltText(e);break;case"editSignature":await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(e);break}}async addButtonBefore(t,e,i){const n=s(this,Ki).querySelector(i);n&&t==="comment"&&this.addComment(e,n)}updateEditSignatureButton(t){s(this,Ml)&&(s(this,Ml).title=t)}remove(){var t;s(this,fr).remove(),(t=s(this,pr))==null||t.destroy(),p(this,pr,null)}};
14fr=new WeakMap,pr=new WeakMap,Yi=new WeakMap,Ki=new WeakMap,hu=new WeakMap,gr=new WeakMap,Rl=new WeakMap,Ml=new WeakMap,uu=new WeakMap,Wp=new WeakSet,Uw=function(t){t.stopPropagation()},Fe=new WeakSet,$w=function(t){s(this,Yi)._focusEventsAllowed=!1,Qt(t)},Hw=function(t){s(this,Yi)._focusEventsAllowed=!0,Qt(t)},pl=function(t){const e=s(this,Yi)._uiManager._signal;return!(e instanceof AbortSignal)||e.aborted?!1:(t.addEventListener("focusin",w(this,Fe,$w).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",w(this,Fe,Hw).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",cn,{signal:e}),!0)},Dh=function(){const t=document.createElement("div");return t.className="divider",t},A(vs,Wp),A(vs,uu,null);let uy=vs;var du,Ra,_s,or,jw,zw,dy;class _1{constructor(t){A(this,or);A(this,du,null);A(this,Ra,null);A(this,_s);p(this,_s,t)}show(t,e,i){const[n,r]=w(this,or,zw).call(this,e,i),{style:a}=s(this,Ra)||p(this,Ra,w(this,or,jw).call(this));t.append(s(this,Ra)),a.insetInlineEnd=`${100*n}%`,a.top=`calc(${100*r}% + var(--editor-toolbar-vert-offset))`}hide(){s(this,Ra).remove()}}du=new WeakMap,Ra=new WeakMap,_s=new WeakMap,or=new WeakSet,jw=function(){const t=p(this,Ra,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const e=s(this,_s)._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",cn,{signal:e});const i=p(this,du,document.createElement("div"));return i.className="buttons",t.append(i),s(this,_s).hasCommentManager()&&w(this,or,dy).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{s(this,_s).commentSelection("floating_button")}),w(this,or,dy).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{s(this,_s).highlightSelection("floating_button")}),t},zw=function(t,e){let i=0,n=0;for(const r of t){const a=r.y+r.height;if(a<i)continue;const l=r.x+(e?r.width:0);if(a>i){n=l,i=a;continue}e?l>n&&(n=l):l<n&&(n=l)}return[e?1-n:n,i]},dy=function(t,e,i,n){const r=document.createElement("button");r.classList.add("basic",t),r.tabIndex=0,r.setAttribute("data-l10n-id",e);const a=document.createElement("span");r.append(a),a.className="visuallyHidden",a.setAttribute("data-l10n-id",i);const l=s(this,_s)._signal;l instanceof AbortSignal&&!l.aborted&&(r.addEventListener("contextmenu",cn,{signal:l}),r.addEventListener("click",n,{signal:l})),s(this,du).append(r)};function Gw(o,t,e){for(const i of e)t.addEventListener(i,o[i].bind(o))}var Vp;class E1{constructor(){A(this,Vp,0)}get id(){return`${su}${ce(this,Vp)._++}`}}Vp=new WeakMap;var Dl,fu,je,Ol,Xf;const r0=class r0{constructor(){A(this,Ol);A(this,Dl,Iw());A(this,fu,0);A(this,je,null)}static get _isSVGFittingCanvas(){const 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>',i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),n=new Image;n.src=t;const r=n.decode().then(()=>(i.drawImage(n,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return ht(this,"_isSVGFittingCanvas",r)}async getFromFile(t){const{lastModified:e,name:i,size:n,type:r}=t;return w(this,Ol,Xf).call(this,`${e}_${i}_${n}_${r}`,t)}async getFromUrl(t){return w(this,Ol,Xf).call(this,t,t)}async getFromBlob(t,e){const i=await e;return w(this,Ol,Xf).call(this,t,i)}async getFromId(t){s(this,je)||p(this,je,new Map);const e=s(this,je).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){const{blobPromise:i}=e;return delete e.blobPromise,this.getFromBlob(e.id,i)}return this.getFromUrl(e.url)}getFromCanvas(t,e){s(this,je)||p(this,je,new Map);let i=s(this,je).get(t);if(i!=null&&i.bitmap)return i.refCounter+=1,i;const n=new OffscreenCanvas(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),i={bitmap:n.transferToImageBitmap(),id:`image_${s(this,Dl)}_${ce(this,fu)._++}`,refCounter:1,isSvg:!1},s(this,je).set(t,i),s(this,je).set(i.id,i),i}getSvgUrl(t){const e=s(this,je).get(t);return e!=null&&e.isSvg?e.svgUrl:null}deleteId(t){var n;s(this,je)||p(this,je,new Map);const e=s(this,je).get(t);if(!e||(e.refCounter-=1,e.refCounter!==0))return;const{bitmap:i}=e;if(!e.url&&!e.file){const r=new OffscreenCanvas(i.width,i.height);r.getContext("bitmaprenderer").transferFromImageBitmap(i),e.blobPromise=r.convertToBlob()}(n=i.close)==null||n.call(i),e.bitmap=null}isValidId(t){return t.startsWith(`image_${s(this,Dl)}_`)}};Dl=new WeakMap,fu=new WeakMap,je=new WeakMap,Ol=new WeakSet,Xf=async function(t,e){s(this,je)||p(this,je,new Map);let i=s(this,je).get(t);if(i===null)return null;if(i!=null&&i.bitmap)return i.refCounter+=1,i;try{i||(i={bitmap:null,id:`image_${s(this,Dl)}_${ce(this,fu)._++}`,refCounter:0,isSvg:!1});let n;if(typeof e=="string"?(i.url=e,n=await Zd(e,"blob")):e instanceof File?n=i.file=e:e instanceof Blob&&(n=e),n.type==="image/svg+xml"){const r=r0._isSVGFittingCanvas,a=new FileReader,l=new Image,c=new Promise((h,u)=>{l.onload=()=>{i.bitmap=l,i.isSvg=!0,h()},a.onload=async()=>{const d=i.svgUrl=a.result;l.src=await r?`${d}#svgView(preserveAspectRatio(none))`:d},l.onerror=a.onerror=u});a.readAsDataURL(n),await c}else i.bitmap=await createImageBitmap(n);i.refCounter=1}catch(n){it(n),i=null}return s(this,je).set(t,i),i&&s(this,je).set(i.id,i),i};let fy=r0;var te,mr,pu,Wt;class x1{constructor(t=128){A(this,te,[]);A(this,mr,!1);A(this,pu);A(this,Wt,-1);p(this,pu,t)}add({cmd:t,undo:e,post:i,mustExec:n,type:r=NaN,overwriteIfSameType:a=!1,keepUndo:l=!1}){if(n&&t(),s(this,mr))return;const c={cmd:t,undo:e,post:i,type:r};if(s(this,Wt)===-1){s(this,te).length>0&&(s(this,te).length=0),p(this,Wt,0),s(this,te).push(c);return}if(a&&s(this,te)[s(this,Wt)].type===r){l&&(c.undo=s(this,te)[s(this,Wt)].undo),s(this,te)[s(this,Wt)]=c;return}const h=s(this,Wt)+1;h===s(this,pu)?s(this,te).splice(0,1):(p(this,Wt,h),h<s(this,te).length&&s(this,te).splice(h)),s(this,te).push(c)}undo(){if(s(this,Wt)===-1)return;p(this,mr,!0);const{undo:t,post:e}=s(this,te)[s(this,Wt)];t(),e==null||e(),p(this,mr,!1),p(this,Wt,s(this,Wt)-1)}redo(){if(s(this,Wt)<s(this,te).length-1){p(this,Wt,s(this,Wt)+1),p(this,mr,!0);const{cmd:t,post:e}=s(this,te)[s(this,Wt)];t(),e==null||e(),p(this,mr,!1)}}hasSomethingToUndo(){return s(this,Wt)!==-1}hasSomethingToRedo(){return s(this,Wt)<s(this,te).length-1}cleanType(t){if(s(this,Wt)!==-1){for(let e=s(this,Wt);e>=0;e--)if(s(this,te)[e].type!==t){s(this,te).splice(e+1,s(this,Wt)-e),p(this,Wt,e);return}s(this,te).length=0,p(this,Wt,-1)}}destroy(){p(this,te,null)}}te=new WeakMap,mr=new WeakMap,pu=new WeakMap,Wt=new WeakMap;var qp,Ww;
14class nf{constructor(t){A(this,qp);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=Ne.platform;for(const[i,n,r={}]of t)for(const a of i){const l=a.startsWith("mac+");e&&l?(this.callbacks.set(a.slice(4),{callback:n,options:r}),this.allKeys.add(a.split("+").at(-1))):!e&&!l&&(this.callbacks.set(a,{callback:n,options:r}),this.allKeys.add(a.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(w(this,qp,Ww).call(this,e));if(!i)return;const{callback:n,options:{bubbles:r=!1,args:a=[],checker:l=null}}=i;l&&!l(t,e)||(n.bind(t,...a,e)(),r||Qt(e))}}qp=new WeakSet,Ww=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);const e=this.buffer.join("+");return this.buffer.length=0,e};const Xp=class Xp{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return b1(t),ht(this,"_colors",t)}convert(t){const e=ef(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,n]of this._colors)if(n.every((r,a)=>r===e[a]))return Xp._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?W.makeHexColor(...e):t}};k(Xp,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let py=Xp;var Ll,_i,kl,Xt,fe,Il,Ji,Fl,Qi,ze,yr,br,Nl,Ar,Un,Zi,Ma,gu,mu,Bl,yu,$n,wr,Ul,vr,Hn,Yp,Sr,$l,bu,_r,Da,Hl,Er,Au,re,Ct,Es,xr,Cr,wu,jl,vu,Tr,jn,xs,Su,_u,tn,B,Yf,gy,Vw,qw,Oh,Xw,Yw,Kw,my,Jw,yy,by,Qw,Qe,bs,Zw,tv,Ay,ev,Lh,wy;const _l=class _l{constructor(t,e,i,n,r,a,l,c,h,u,d,f,m,b,y,v){A(this,B);A(this,Ll,new AbortController);A(this,_i,null);A(this,kl,null);A(this,Xt,new Map);A(this,fe,new Map);A(this,Il,null);A(this,Ji,null);A(this,Fl,null);A(this,Qi,new x1);A(this,ze,null);A(this,yr,null);A(this,br,null);A(this,Nl,0);A(this,Ar,new Set);A(this,Un,null);A(this,Zi,null);A(this,Ma,new Set);k(this,"_editorUndoBar",null);A(this,gu,!1);A(this,mu,!1);A(this,Bl,!1);A(this,yu,null);A(this,$n,null);A(this,wr,null);A(this,Ul,null);A(this,vr,!1);A(this,Hn,null);A(this,Yp,new E1);A(this,Sr,!1);A(this,$l,!1);A(this,bu,!1);A(this,_r,null);A(this,Da,null);A(this,Hl,null);A(this,Er,null);A(this,Au,null);A(this,re,rt.NONE);A(this,Ct,new Set);A(this,Es,null);A(this,xr,null);A(this,Cr,null);A(this,wu,null);A(this,jl,null);A(this,vu,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});A(this,Tr,[0,0]);A(this,jn,null);A(this,xs,null);A(this,Su,null);A(this,_u,null);A(this,tn,null);const S=this._signal=s(this,Ll).signal;p(this,xs,t),p(this,Su,e),p(this,_u,i),p(this,Il,n),p(this,ze,r),p(this,xr,a),p(this,jl,c),this._eventBus=l,l._on("editingaction",this.onEditingAction.bind(this),{signal:S}),l._on("pagechanging",this.onPageChanging.bind(this),{signal:S}),l._on("scalechanging",this.onScaleChanging.bind(this),{signal:S}),l._on("rotationchanging",this.onRotationChanging.bind(this),{signal:S}),l._on("setpreference",this.onSetPreference.bind(this),{signal:S}),l._on("switchannotationeditorparams",x=>this.updateParams(x.type,x.value),{signal:S}),window.addEventListener("pointerdown",()=>{p(this,$l,!0)},{capture:!0,signal:S}),window.addEventListener("pointerup",()=>{p(this,$l,!1)},{capture:!0,signal:S}),w(this,B,Xw).call(this),w(this,B,Qw).call(this),w(this,B,my).call(this),p(this,Ji,c.annotationStorage),p(this,yu,c.filterFactory),p(this,Cr,h),p(this,Ul,u||null),p(this,gu,d),p(this,mu,f),p(this,Bl,m),p(this,Au,b||null),this.viewParameters={realScale:ca.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=y||null,this._supportsPinchToZoom=v!==!1,r==null||r.setSidebarUiManager(this)}static get _keyboardManager(){const t=_l.prototype,e=a=>s(a,xs).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),i=(a,{target:l})=>{if(l instanceof HTMLInputElement){const{type:c}=l;return c!=="text"&&c!=="number"}return!0},n=this.TRANSLATE_SMALL,r=this.TRANSLATE_BIG;return ht(this,"_keyboardManager",new nf([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["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:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(a,{target:l})=>!(l instanceof HTMLButtonElement)&&s(a,xs).contains(l)&&!a.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(a,{target:l})=>!(l instanceof HTMLButtonElement)&&s(a,xs).contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:e}]]))}destroy(){var t,e,i,n,r,a,l,c,h;(t=s(this,tn))==null||t.resolve(),p(this,tn,null),(e=s(this,Ll))==null||e.abort(),p(this,Ll,null),this._signal=null;for(const u of s(this,fe).values())u.destroy();s(this,fe).clear(),s(this,Xt).clear(),s(this,Ma).clear(),(i=s(this,Er))==null||i.clear(),p(this,_i,null),s(this,Ct).clear(),s(this,Qi).destroy(),(n=s(this,Il))==null||n.destroy(),(r=s(this,ze))==null||r.destroy(),(a=s(this,xr))==null||a.destroy(),(l=s(this,Hn))==null||l.hide(),p(this,Hn,null),(c=s(this,Hl))==null||c.destroy(),p(this,Hl,null),p(this,kl,null),s(this,$n)&&(clearTimeout(s(this,$n)),p(this,$n,null)),s(this,jn)&&(clearTimeout(s(this,jn)),p(this,jn,null)),(h=this._editorUndoBar)==null||h.destroy(),p(this,jl,null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return s(this,Au)}get useNewAltTextFlow(){return s(this,mu)}get useNewAltTextWhenAddingImage(){return s(this,Bl)}get hcmFilter(){return ht(this,"hcmFilter",s(this,Cr)?s(this,yu).addHCMFilter(s(this,Cr).foreground,s(this,Cr).background):"none")}get direction(){return ht(this,"direction",getComputedStyle(s(this,xs)).direction)}get _highlightColors(){return ht(this,"_highlightColors",s(this,Ul)?new Map(s(this,Ul).split(",").map(t=>(t=t.split("=").map(e=>e.trim()),t[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return ht(this,"highlightColors",null);const e=new Map,i=!!s(this,Cr);for(const[n,r]of t){const a=n.endsWith("_HCM");if(i&&a){e.set(n.replace("_HCM",""),r);continue}!i&&!a&&e.set(n,r)}return ht(this,"highlightColors",e)}get highlightColorNames(){return ht(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const 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),p(this,br,t)}setMainHighlightColorPicker(t){p(this,Hl,t)}editAltText(t,e=!1){var i;(i=s(this,Il))==null||i.editAltText(this,t,e)}hasCommentManager(){return!!s(this,ze)}editComment(t,e,i,n){var r;(r=s(this,ze))==null||r.showDialog(this,t,e,i,n)}selectComment(t,e){const i=s(this,fe).get(t),n=i==null?void 0:i.getEditorByUID(e);n==null||n.toggleComment(!0,!0)}updateComment(t){var e;(e=s(this,ze))==null||e.updateComment(t.getData())}updatePopupColor(t){var e;(e=s(this,ze))==null||e.updatePopupColor(t)}
14removeComment(t){var e;(e=s(this,ze))==null||e.removeComments([t.uid])}toggleComment(t,e,i=void 0){var n;(n=s(this,ze))==null||n.toggleCommentPopup(t,e,i)}makeCommentColor(t,e){var i;return t&&((i=s(this,ze))==null?void 0:i.makeCommentColor(t,e))||null}getCommentDialogElement(){var t;return((t=s(this,ze))==null?void 0:t.dialogElement)||null}async waitForEditorsRendered(t){if(s(this,fe).has(t-1))return;const{resolve:e,promise:i}=Promise.withResolvers(),n=r=>{r.pageNumber===t&&(this._eventBus._off("editorsrendered",n),e())};this._eventBus.on("editorsrendered",n),await i}getSignature(t){var e;(e=s(this,xr))==null||e.getSignature({uiManager:this,editor:t})}get signatureManager(){return s(this,xr)}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":p(this,Bl,e);break}}onPageChanging({pageNumber:t}){p(this,Nl,t-1)}focusMainContainer(){s(this,xs).focus()}findParent(t,e){for(const i of s(this,fe).values()){const{x:n,y:r,width:a,height:l}=i.div.getBoundingClientRect();if(t>=n&&t<=n+a&&e>=r&&e<=r+l)return i}return null}disableUserSelect(t=!1){s(this,Su).classList.toggle("noUserSelect",t)}addShouldRescale(t){s(this,Ma).add(t)}removeShouldRescale(t){s(this,Ma).delete(t)}onScaleChanging({scale:t}){var e;this.commitOrRemove(),this.viewParameters.realScale=t*ca.PDF_TO_CSS_UNITS;for(const i of s(this,Ma))i.onScaleChanging();(e=s(this,br))==null||e.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t="",e=!1){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:n,anchorOffset:r,focusNode:a,focusOffset:l}=i,c=i.toString(),u=w(this,B,Yf).call(this,i).closest(".textLayer"),d=this.getSelectionBoxes(u);if(!d)return;i.empty();const f=w(this,B,gy).call(this,u),m=s(this,re)===rt.NONE,b=()=>{const y=f==null?void 0:f.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:d,anchorNode:n,anchorOffset:r,focusNode:a,focusOffset:l,text:c});m&&this.showAllEditors("highlight",!0,!0),e&&(y==null||y.editComment())};if(m){this.switchToMode(rt.HIGHLIGHT,b);return}b()}commentSelection(t=""){this.highlightSelection(t,!0)}getAndRemoveDataFromAnnotationStorage(t){if(!s(this,Ji))return null;const e=`${su}${t}`,i=s(this,Ji).getRawValue(e);return i&&s(this,Ji).remove(e),i}addToAnnotationStorage(t){!t.isEmpty()&&s(this,Ji)&&!s(this,Ji).has(t.id)&&s(this,Ji).setValue(t.id,t)}a11yAlert(t,e=null){const i=s(this,_u);i&&(i.setAttribute("data-l10n-id",t),e?i.setAttribute("data-l10n-args",JSON.stringify(e)):i.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,s(this,vr)&&(p(this,vr,!1),w(this,B,Oh).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of s(this,Ct))if(e.div.contains(t)){p(this,Da,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!s(this,Da))return;const[t,e]=s(this,Da);p(this,Da,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){w(this,B,my).call(this),w(this,B,yy).call(this)}removeEditListeners(){w(this,B,Jw).call(this),w(this,B,by).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of s(this,Zi))if(i.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const e of t.dataTransfer.items)for(const i of s(this,Zi))if(i.isHandlingMimeForPasting(e.type)){i.paste(e,this.currentLayer),t.preventDefault();return}}copy(t){var i;if(t.preventDefault(),(i=s(this,_i))==null||i.commitOrRemove(),!this.hasSelection)return;const e=[];for(const n of s(this,Ct)){const r=n.serialize(!0);r&&e.push(r)}e.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const r of e.items)for(const a of s(this,Zi))if(a.isHandlingMimeForPasting(r.type)){a.paste(r,this.currentLayer);return}let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(r){it(`paste: "${r.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const r=[];for(const c of i){const h=await n.deserialize(c);if(!h)return;r.push(h)}const a=()=>{for(const c of r)w(this,B,Ay).call(this,c);w(this,B,wy).call(this,r)},l=()=>{for(const c of r)c.remove()};this.addCommands({cmd:a,undo:l,mustExec:!0})}catch(r){it(`paste: "${r.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),s(this,re)!==rt.NONE&&!this.isEditorHandlingKeyboard&&_l._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,s(this,vr)&&(p(this,vr,!1),w(this,B,Oh).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?(w(this,B,Yw).call(this),w(this,B,yy).call(this),w(this,B,Qe).call(this,{isEditing:s(this,re)!==rt.NONE,isEmpty:w(this,B,Lh).call(this),hasSomethingToUndo:s(this,Qi).hasSomethingToUndo(),hasSomethingToRedo:s(this,Qi).hasSomethingToRedo(),hasSelectedEditor:!1}
14)):(w(this,B,Kw).call(this),w(this,B,by).call(this),w(this,B,Qe).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!s(this,Zi)){p(this,Zi,t);for(const e of s(this,Zi))w(this,B,bs).call(this,e.defaultPropertiesToUpdate)}}getId(){return s(this,Yp).id}get currentLayer(){return s(this,fe).get(s(this,Nl))}getLayer(t){return s(this,fe).get(t)}get currentPageIndex(){return s(this,Nl)}addLayer(t){s(this,fe).set(t.pageIndex,t),s(this,Sr)?t.enable():t.disable()}removeLayer(t){s(this,fe).delete(t.pageIndex)}async updateMode(t,e=null,i=!1,n=!1,r=!1){var a,l,c,h,u,d;if(s(this,re)!==t&&!(s(this,tn)&&(await s(this,tn).promise,!s(this,tn)))){if(p(this,tn,Promise.withResolvers()),(a=s(this,br))==null||a.commitOrRemove(),s(this,re)===rt.POPUP&&((l=s(this,ze))==null||l.hideSidebar()),(c=s(this,ze))==null||c.destroyPopup(),p(this,re,t),t===rt.NONE){this.setEditingState(!1),w(this,B,tv).call(this);for(const f of s(this,Xt).values())f.hideStandaloneCommentButton();(h=this._editorUndoBar)==null||h.hide(),this.toggleComment(null),s(this,tn).resolve();return}for(const f of s(this,Xt).values())f.addStandaloneCommentButton();t===rt.SIGNATURE&&await((u=s(this,xr))==null?void 0:u.loadSignatures()),this.setEditingState(!0),await w(this,B,Zw).call(this),this.unselectAll();for(const f of s(this,fe).values())f.updateMode(t);if(t===rt.POPUP){s(this,kl)||p(this,kl,await s(this,jl).getAnnotationsByType(new Set(s(this,Zi).map(b=>b._editorType))));const f=new Set,m=[];for(const b of s(this,Xt).values()){const{annotationElementId:y,hasComment:v,deleted:S}=b;y&&f.add(y),v&&!S&&m.push(b.getData())}for(const b of s(this,kl)){const{id:y,popupRef:v,contentsObj:S}=b;v&&(S!=null&&S.str)&&!f.has(y)&&!s(this,Ar).has(y)&&m.push(b)}(d=s(this,ze))==null||d.showSidebar(m)}if(!e){i&&this.addNewEditorFromKeyboard(),s(this,tn).resolve();return}for(const f of s(this,Xt).values())f.uid===e?(this.setSelected(f),r?f.editComment():n?f.enterInEditMode():f.focus()):f.unselect();s(this,tn).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==s(this,re)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(s(this,Zi)){switch(t){case mt.CREATE:this.currentLayer.addNewEditor(e);return;case mt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(s(this,wu)||p(this,wu,new Map)).set(t,e),this.showAllEditors("highlight",e);break}if(this.hasSelection)for(const i of s(this,Ct))i.updateParams(t,e);else for(const i of s(this,Zi))i.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){var r;for(const a of s(this,Xt).values())a.editorType===t&&a.show(e);(((r=s(this,wu))==null?void 0:r.get(mt.HIGHLIGHT_SHOW_ALL))??!0)!==e&&w(this,B,bs).call(this,[[mt.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(s(this,bu)!==t){p(this,bu,t);for(const e of s(this,fe).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}*getEditors(t){for(const e of s(this,Xt).values())e.pageIndex===t&&(yield e)}getEditor(t){return s(this,Xt).get(t)}addEditor(t){s(this,Xt).set(t.id,t)}removeEditor(t){var e,i;t.div.contains(document.activeElement)&&(s(this,$n)&&clearTimeout(s(this,$n)),p(this,$n,setTimeout(()=>{this.focusMainContainer(),p(this,$n,null)},0))),s(this,Xt).delete(t.id),t.annotationElementId&&((e=s(this,Er))==null||e.delete(t.annotationElementId)),this.unselect(t),(!t.annotationElementId||!s(this,Ar).has(t.annotationElementId))&&((i=s(this,Ji))==null||i.remove(t.id))}addDeletedAnnotationElement(t){s(this,Ar).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return s(this,Ar).has(t)}removeDeletedAnnotationElement(t){s(this,Ar).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){s(this,_i)!==t&&(p(this,_i,t),t&&w(this,B,bs).call(this,t.propertiesToUpdate))}updateUI(t){s(this,B,ev)===t&&w(this,B,bs).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){w(this,B,bs).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(s(this,Ct).has(t)){s(this,Ct).delete(t),t.unselect(),w(this,B,Qe).call(this,{hasSelectedEditor:this.hasSelection});return}s(this,Ct).add(t),t.select(),w(this,B,bs).call(this,t.propertiesToUpdate),w(this,B,Qe).call(this,{hasSelectedEditor:!0})}setSelected(t){var e;this.updateToolbar({mode:t.mode,editId:t.id}),(e=s(this,br))==null||e.commitOrRemove();for(const i of s(this,Ct))i!==t&&i.unselect();s(this,Ct).clear(),s(this,Ct).add(t),t.select(),w(this,B,bs).call(this,t.propertiesToUpdate),w(this,B,Qe).call(this,{hasSelectedEditor:!0})}isSelected(t){return s(this,Ct).has(t)}get firstSelectedEditor(){return s(this,Ct).values().next().value}unselect(t){t.unselect(),s(this,Ct).delete(t),w(this,B,Qe).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return s(this,Ct).size!==0}get isEnterHandled(){return s(this,Ct).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var t;
14s(this,Qi).undo(),w(this,B,Qe).call(this,{hasSomethingToUndo:s(this,Qi).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:w(this,B,Lh).call(this)}),(t=this._editorUndoBar)==null||t.hide()}redo(){s(this,Qi).redo(),w(this,B,Qe).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:s(this,Qi).hasSomethingToRedo(),isEmpty:w(this,B,Lh).call(this)})}addCommands(t){s(this,Qi).add(t),w(this,B,Qe).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:w(this,B,Lh).call(this)})}cleanUndoStack(t){s(this,Qi).cleanType(t)}delete(){var r;this.commitOrRemove();const t=(r=this.currentLayer)==null?void 0:r.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const e=t?[t]:[...s(this,Ct)],i=()=>{var a;(a=this._editorUndoBar)==null||a.show(n,e.length===1?e[0].editorType:e.length);for(const l of e)l.remove()},n=()=>{for(const a of e)w(this,B,Ay).call(this,a)};this.addCommands({cmd:i,undo:n,mustExec:!0})}commitOrRemove(){var t;(t=s(this,_i))==null||t.commitOrRemove()}hasSomethingToControl(){return s(this,_i)||this.hasSelection}selectAll(){for(const t of s(this,Ct))t.commit();w(this,B,wy).call(this,s(this,Xt).values())}unselectAll(){var t;if(!(s(this,_i)&&(s(this,_i).commitOrRemove(),s(this,re)!==rt.NONE))&&!((t=s(this,br))!=null&&t.commitOrRemove())&&this.hasSelection){for(const e of s(this,Ct))e.unselect();s(this,Ct).clear(),w(this,B,Qe).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;s(this,Tr)[0]+=t,s(this,Tr)[1]+=e;const[n,r]=s(this,Tr),a=[...s(this,Ct)],l=1e3;s(this,jn)&&clearTimeout(s(this,jn)),p(this,jn,setTimeout(()=>{p(this,jn,null),s(this,Tr)[0]=s(this,Tr)[1]=0,this.addCommands({cmd:()=>{for(const c of a)s(this,Xt).has(c.id)&&(c.translateInPage(n,r),c.translationDone())},undo:()=>{for(const c of a)s(this,Xt).has(c.id)&&(c.translateInPage(-n,-r),c.translationDone())},mustExec:!1})},l));for(const c of a)c.translateInPage(t,e),c.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),p(this,Un,new Map);for(const t of s(this,Ct))s(this,Un).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!s(this,Un))return!1;this.disableUserSelect(!1);const t=s(this,Un);p(this,Un,null);let e=!1;for(const[{x:n,y:r,pageIndex:a},l]of t)l.newX=n,l.newY=r,l.newPageIndex=a,e||(e=n!==l.savedX||r!==l.savedY||a!==l.savedPageIndex);if(!e)return!1;const i=(n,r,a,l)=>{if(s(this,Xt).has(n.id)){const c=s(this,fe).get(l);c?n._setParentAndPosition(c,r,a):(n.pageIndex=l,n.x=r,n.y=a)}};return this.addCommands({cmd:()=>{for(const[n,{newX:r,newY:a,newPageIndex:l}]of t)i(n,r,a,l)},undo:()=>{for(const[n,{savedX:r,savedY:a,savedPageIndex:l}]of t)i(n,r,a,l)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(s(this,Un))for(const i of s(this,Un).keys())i.drag(t,e)}rebuild(t){if(t.parent===null){const 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(){var t;return((t=this.getActive())==null?void 0:t.shouldGetKeyboardEvents())||s(this,Ct).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return s(this,_i)===t}getActive(){return s(this,_i)}getMode(){return s(this,re)}isEditingMode(){return s(this,re)!==rt.NONE}get imageManager(){return ht(this,"imageManager",new fy)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let h=0,u=e.rangeCount;h<u;h++)if(!t.contains(e.getRangeAt(h).commonAncestorContainer))return null;const{x:i,y:n,width:r,height:a}=t.getBoundingClientRect();let l;switch(t.getAttribute("data-main-rotation")){case"90":l=(h,u,d,f)=>({x:(u-n)/a,y:1-(h+d-i)/r,width:f/a,height:d/r});break;case"180":l=(h,u,d,f)=>({x:1-(h+d-i)/r,y:1-(u+f-n)/a,width:d/r,height:f/a});break;case"270":l=(h,u,d,f)=>({x:1-(u+f-n)/a,y:(h-i)/r,width:f/a,height:d/r});break;default:l=(h,u,d,f)=>({x:(h-i)/r,y:(u-n)/a,width:d/r,height:f/a});break}const c=[];for(let h=0,u=e.rangeCount;h<u;h++){const d=e.getRangeAt(h);if(!d.collapsed)for(const{x:f,y:m,width:b,height:y}of d.getClientRects())b===0||y===0||c.push(l(f,m,b,y))}return c.length===0?null:c}addChangedExistingAnnotation({annotationElementId:t,id:e}){(s(this,Fl)||p(this,Fl,new Map)).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){var e;(e=s(this,Fl))==null||e.delete(t)}renderAnnotationElement(t){var n;const e=(n=s(this,Fl))==null?void 0:n.get(t.data.id);if(!e)return;const i=s(this,Ji).getRawValue(e);
14i&&(s(this,re)===rt.NONE&&!i.hasBeenModified||i.renderAnnotationElement(t))}setMissingCanvas(t,e,i){var r;const n=(r=s(this,Er))==null?void 0:r.get(t);n&&(n.setCanvas(e,i),s(this,Er).delete(t))}addMissingCanvas(t,e){(s(this,Er)||p(this,Er,new Map)).set(t,e)}};Ll=new WeakMap,_i=new WeakMap,kl=new WeakMap,Xt=new WeakMap,fe=new WeakMap,Il=new WeakMap,Ji=new WeakMap,Fl=new WeakMap,Qi=new WeakMap,ze=new WeakMap,yr=new WeakMap,br=new WeakMap,Nl=new WeakMap,Ar=new WeakMap,Un=new WeakMap,Zi=new WeakMap,Ma=new WeakMap,gu=new WeakMap,mu=new WeakMap,Bl=new WeakMap,yu=new WeakMap,$n=new WeakMap,wr=new WeakMap,Ul=new WeakMap,vr=new WeakMap,Hn=new WeakMap,Yp=new WeakMap,Sr=new WeakMap,$l=new WeakMap,bu=new WeakMap,_r=new WeakMap,Da=new WeakMap,Hl=new WeakMap,Er=new WeakMap,Au=new WeakMap,re=new WeakMap,Ct=new WeakMap,Es=new WeakMap,xr=new WeakMap,Cr=new WeakMap,wu=new WeakMap,jl=new WeakMap,vu=new WeakMap,Tr=new WeakMap,jn=new WeakMap,xs=new WeakMap,Su=new WeakMap,_u=new WeakMap,tn=new WeakMap,B=new WeakSet,Yf=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},gy=function(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of s(this,fe).values())if(i.hasTextLayer(t))return i;return null},Vw=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const i=w(this,B,Yf).call(this,t).closest(".textLayer"),n=this.getSelectionBoxes(i);n&&(s(this,Hn)||p(this,Hn,new _1(this)),s(this,Hn).show(i,n,this.direction==="ltr"))},qw=function(){var r,a,l;const t=document.getSelection();if(!t||t.isCollapsed){s(this,Es)&&((r=s(this,Hn))==null||r.hide(),p(this,Es,null),w(this,B,Qe).call(this,{hasSelectedText:!1}));return}const{anchorNode:e}=t;if(e===s(this,Es))return;const n=w(this,B,Yf).call(this,t).closest(".textLayer");if(!n){s(this,Es)&&((a=s(this,Hn))==null||a.hide(),p(this,Es,null),w(this,B,Qe).call(this,{hasSelectedText:!1}));return}if((l=s(this,Hn))==null||l.hide(),p(this,Es,e),w(this,B,Qe).call(this,{hasSelectedText:!0}),!(s(this,re)!==rt.HIGHLIGHT&&s(this,re)!==rt.NONE)&&(s(this,re)===rt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),p(this,vr,this.isShiftKeyDown),!this.isShiftKeyDown)){const c=s(this,re)===rt.HIGHLIGHT?w(this,B,gy).call(this,n):null;if(c==null||c.toggleDrawing(),s(this,$l)){const h=new AbortController,u=this.combinedSignal(h),d=f=>{f.type==="pointerup"&&f.button!==0||(h.abort(),c==null||c.toggleDrawing(!0),f.type==="pointerup"&&w(this,B,Oh).call(this,"main_toolbar"))};window.addEventListener("pointerup",d,{signal:u}),window.addEventListener("blur",d,{signal:u})}else c==null||c.toggleDrawing(!0),w(this,B,Oh).call(this,"main_toolbar")}},Oh=function(t=""){s(this,re)===rt.HIGHLIGHT?this.highlightSelection(t):s(this,gu)&&w(this,B,Vw).call(this)},Xw=function(){document.addEventListener("selectionchange",w(this,B,qw).bind(this),{signal:this._signal})},Yw=function(){if(s(this,wr))return;p(this,wr,new AbortController);const t=this.combinedSignal(s(this,wr));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},Kw=function(){var t;(t=s(this,wr))==null||t.abort(),p(this,wr,null)},my=function(){if(s(this,_r))return;p(this,_r,new AbortController);const t=this.combinedSignal(s(this,_r));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},Jw=function(){var t;(t=s(this,_r))==null||t.abort(),p(this,_r,null)},yy=function(){if(s(this,yr))return;p(this,yr,new AbortController);const t=this.combinedSignal(s(this,yr));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})},by=function(){var t;(t=s(this,yr))==null||t.abort(),p(this,yr,null)},Qw=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},Qe=function(t){Object.entries(t).some(([i,n])=>s(this,vu)[i]!==n)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(s(this,vu),t)}),s(this,re)===rt.HIGHLIGHT&&t.hasSelectedEditor===!1&&w(this,B,bs).call(this,[[mt.HIGHLIGHT_FREE,!0]]))},bs=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},Zw=async function(){if(!s(this,Sr)){p(this,Sr,!0);const t=[];for(const e of s(this,fe).values())t.push(e.enable());await Promise.all(t);for(const e of s(this,Xt).values())e.enable()}},tv=function(){if(this.unselectAll(),s(this,Sr)){p(this,Sr,!1);for(const t of s(this,fe).values())t.disable();for(const t of s(this,Xt).values())t.disable()}},Ay=function(t){const e=s(this,fe).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},ev=function(){let t=null;for(t of s(this,Ct));return t},Lh=function(){if(s(this,Xt).size===0)return!0;
14if(s(this,Xt).size===1)for(const t of s(this,Xt).values())return t.isEmpty();return!1},wy=function(t){for(const e of s(this,Ct))e.unselect();s(this,Ct).clear();for(const e of t)e.isEmpty()||(s(this,Ct).add(e),e.select());w(this,B,Qe).call(this,{hasSelectedEditor:this.hasSelection})},k(_l,"TRANSLATE_SMALL",1),k(_l,"TRANSLATE_BIG",10);let Vo=_l;var be,zn,pn,zl,Gn,Ei,Gl,Wn,di,Cs,Oa,Vn,Pr,Tn,kh,Kf;const Ze=class Ze{constructor(t){A(this,Tn);A(this,be,null);A(this,zn,!1);A(this,pn,null);A(this,zl,null);A(this,Gn,null);A(this,Ei,null);A(this,Gl,!1);A(this,Wn,null);A(this,di,null);A(this,Cs,null);A(this,Oa,null);A(this,Vn,!1);p(this,di,t),p(this,Vn,t._uiManager.useNewAltTextFlow),s(Ze,Pr)||p(Ze,Pr,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){Ze._l10n??(Ze._l10n=t)}async render(){const t=p(this,pn,document.createElement("button"));t.className="altText",t.tabIndex="0";const e=p(this,zl,document.createElement("span"));t.append(e),s(this,Vn)?(t.classList.add("new"),t.setAttribute("data-l10n-id",s(Ze,Pr).missing),e.setAttribute("data-l10n-id",s(Ze,Pr)["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=s(this,di)._uiManager._signal;t.addEventListener("contextmenu",cn,{signal:i}),t.addEventListener("pointerdown",r=>r.stopPropagation(),{signal:i});const n=r=>{r.preventDefault(),s(this,di)._uiManager.editAltText(s(this,di)),s(this,Vn)&&s(this,di)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:s(this,Tn,kh)}})};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",r=>{r.target===t&&r.key==="Enter"&&(p(this,Gl,!0),n(r))},{signal:i}),await w(this,Tn,Kf).call(this),t}finish(){s(this,pn)&&(s(this,pn).focus({focusVisible:s(this,Gl)}),p(this,Gl,!1))}isEmpty(){return s(this,Vn)?s(this,be)===null:!s(this,be)&&!s(this,zn)}hasData(){return s(this,Vn)?s(this,be)!==null||!!s(this,Cs):this.isEmpty()}get guessedText(){return s(this,Cs)}async setGuessedText(t){s(this,be)===null&&(p(this,Cs,t),p(this,Oa,await Ze._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),w(this,Tn,Kf).call(this))}toggleAltTextBadge(t=!1){var e;if(!s(this,Vn)||s(this,be)){(e=s(this,Wn))==null||e.remove(),p(this,Wn,null);return}if(!s(this,Wn)){const i=p(this,Wn,document.createElement("div"));i.className="noAltTextBadge",s(this,di).div.append(i)}s(this,Wn).classList.toggle("hidden",!t)}serialize(t){let e=s(this,be);return!t&&s(this,Cs)===e&&(e=s(this,Oa)),{altText:e,decorative:s(this,zn),guessedText:s(this,Cs),textWithDisclaimer:s(this,Oa)}}get data(){return{altText:s(this,be),decorative:s(this,zn)}}set data({altText:t,decorative:e,guessedText:i,textWithDisclaimer:n,cancel:r=!1}){i&&(p(this,Cs,i),p(this,Oa,n)),!(s(this,be)===t&&s(this,zn)===e)&&(r||(p(this,be,t),p(this,zn,e)),w(this,Tn,Kf).call(this))}toggle(t=!1){s(this,pn)&&(!t&&s(this,Ei)&&(clearTimeout(s(this,Ei)),p(this,Ei,null)),s(this,pn).disabled=!t)}shown(){s(this,di)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:s(this,Tn,kh)}})}destroy(){var t,e;(t=s(this,pn))==null||t.remove(),p(this,pn,null),p(this,zl,null),p(this,Gn,null),(e=s(this,Wn))==null||e.remove(),p(this,Wn,null)}};be=new WeakMap,zn=new WeakMap,pn=new WeakMap,zl=new WeakMap,Gn=new WeakMap,Ei=new WeakMap,Gl=new WeakMap,Wn=new WeakMap,di=new WeakMap,Cs=new WeakMap,Oa=new WeakMap,Vn=new WeakMap,Pr=new WeakMap,Tn=new WeakSet,kh=function(){return s(this,be)&&"added"||s(this,be)===null&&this.guessedText&&"review"||"missing"},Kf=async function(){var n,r,a;const t=s(this,pn);if(!t)return;if(s(this,Vn)){if(t.classList.toggle("done",!!s(this,be)),t.setAttribute("data-l10n-id",s(Ze,Pr)[s(this,Tn,kh)]),(n=s(this,zl))==null||n.setAttribute("data-l10n-id",s(Ze,Pr)[`${s(this,Tn,kh)}-label`]),!s(this,be)){(r=s(this,Gn))==null||r.remove();return}}else{if(!s(this,be)&&!s(this,zn)){t.classList.remove("done"),(a=s(this,Gn))==null||a.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=s(this,Gn);if(!e){p(this,Gn,e=document.createElement("span")),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=`alt-text-tooltip-${s(this,di).id}`;const l=100,c=s(this,di)._uiManager._signal;c.addEventListener("abort",()=>{clearTimeout(s(this,Ei)),p(this,Ei,null)},{once:!0}),t.addEventListener("mouseenter",()=>{p(this,Ei,setTimeout(()=>{p(this,Ei,null),s(this,Gn).classList.add("show"),s(this,di)._reportTelemetry({action:"alt_text_tooltip"})},l))},{signal:c}),t.addEventListener("mouseleave",()=>{var h;
14s(this,Ei)&&(clearTimeout(s(this,Ei)),p(this,Ei,null)),(h=s(this,Gn))==null||h.classList.remove("show")},{signal:c})}s(this,zn)?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=s(this,be)),e.parentNode||t.append(e);const i=s(this,di).getElementForAltText();i==null||i.setAttribute("aria-describedby",e.id)},A(Ze,Pr,null),k(Ze,"_l10n",null);let kp=Ze;var Re,en,La,Nt,Eu,ka,gn,Ia,Fa,Na,xu,vy;class Mf{constructor(t){A(this,xu);A(this,Re,null);A(this,en,null);A(this,La,!1);A(this,Nt,null);A(this,Eu,null);A(this,ka,null);A(this,gn,null);A(this,Ia,null);A(this,Fa,!1);A(this,Na,null);p(this,Nt,t)}renderForToolbar(){const t=p(this,en,document.createElement("button"));return t.className="comment",w(this,xu,vy).call(this,t,!1)}renderForStandalone(){const t=p(this,Re,document.createElement("button"));t.className="annotationCommentButton";const e=s(this,Nt).commentButtonPosition;if(e){const{style:i}=t;i.insetInlineEnd=`calc(${100*(s(this,Nt)._uiManager.direction==="ltr"?1-e[0]:e[0])}% - var(--comment-button-dim))`,i.top=`calc(${100*e[1]}% - var(--comment-button-dim))`;const n=s(this,Nt).commentButtonColor;n&&(i.backgroundColor=n)}return w(this,xu,vy).call(this,t,!0)}focusButton(){setTimeout(()=>{var t;(t=s(this,Re)??s(this,en))==null||t.focus()},0)}onUpdatedColor(){if(!s(this,Re))return;const t=s(this,Nt).commentButtonColor;t&&(s(this,Re).style.backgroundColor=t),s(this,Nt)._uiManager.updatePopupColor(s(this,Nt))}get commentButtonWidth(){var t;return(((t=s(this,Re))==null?void 0:t.getBoundingClientRect().width)??0)/s(this,Nt).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(s(this,Na))return s(this,Na);if(!s(this,Re))return null;const{x:t,y:e,height:i}=s(this,Re).getBoundingClientRect(),{x:n,y:r,width:a,height:l}=s(this,Nt).parent.boundingClientRect;return[(t-n)/a,(e+i-r)/l]}set commentPopupPositionInLayer(t){p(this,Na,t)}hasDefaultPopupPosition(){return s(this,Na)===null}removeStandaloneCommentButton(){var t;(t=s(this,Re))==null||t.remove(),p(this,Re,null)}removeToolbarCommentButton(){var t;(t=s(this,en))==null||t.remove(),p(this,en,null)}setCommentButtonStates({selected:t,hasPopup:e}){s(this,Re)&&(s(this,Re).classList.toggle("selected",t),s(this,Re).ariaExpanded=e)}edit(t){const e=this.commentPopupPositionInLayer;let i,n;if(e)[i,n]=e;else{[i,n]=s(this,Nt).commentButtonPosition;const{width:u,height:d,x:f,y:m}=s(this,Nt);i=f+i*u,n=m+n*d}const r=s(this,Nt).parent.boundingClientRect,{x:a,y:l,width:c,height:h}=r;s(this,Nt)._uiManager.editComment(s(this,Nt),a+i*c,l+n*h,{...t,parentDimensions:r})}finish(){s(this,en)&&(s(this,en).focus({focusVisible:s(this,La)}),p(this,La,!1))}isDeleted(){return s(this,Fa)||s(this,gn)===""}isEmpty(){return s(this,gn)===null}hasBeenEdited(){return this.isDeleted()||s(this,gn)!==s(this,Eu)}serialize(){return this.data}get data(){return{text:s(this,gn),richText:s(this,ka),date:s(this,Ia),deleted:this.isDeleted()}}set data(t){if(t!==s(this,gn)&&p(this,ka,null),t===null){p(this,gn,""),p(this,Fa,!0);return}p(this,gn,t),p(this,Ia,new Date),p(this,Fa,!1)}setInitialText(t,e=null){p(this,Eu,t),this.data=t,p(this,Ia,null),p(this,ka,e)}shown(){}destroy(){var t,e;(t=s(this,en))==null||t.remove(),p(this,en,null),(e=s(this,Re))==null||e.remove(),p(this,Re,null),p(this,gn,""),p(this,ka,null),p(this,Ia,null),p(this,Nt,null),p(this,La,!1),p(this,Fa,!1)}}Re=new WeakMap,en=new WeakMap,La=new WeakMap,Nt=new WeakMap,Eu=new WeakMap,ka=new WeakMap,gn=new WeakMap,Ia=new WeakMap,Fa=new WeakMap,Na=new WeakMap,xu=new WeakSet,vy=function(t,e){if(!s(this,Nt)._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=[s(this,Nt)._uiManager.getCommentDialogElement()],t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button"));const i=s(this,Nt)._uiManager._signal;if(!(i instanceof AbortSignal)||i.aborted)return t;t.addEventListener("contextmenu",cn,{signal:i}),e&&(t.addEventListener("focusin",r=>{s(this,Nt)._focusEventsAllowed=!1,Qt(r)},{capture:!0,signal:i}),t.addEventListener("focusout",r=>{s(this,Nt)._focusEventsAllowed=!0,Qt(r)},{capture:!0,signal:i})),t.addEventListener("pointerdown",r=>r.stopPropagation(),{signal:i});const n=r=>{r.preventDefault(),t===s(this,en)?this.edit():s(this,Nt).toggleComment(!0)};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",r=>{r.target===t&&r.key==="Enter"&&(p(this,La,!0),n(r))},{signal:i}),t.addEventListener("pointerenter",()=>{s(this,Nt).toggleComment(!1,!0)},{signal:i}),t.addEventListener("pointerleave",()=>{s(this,Nt).toggleComment(!1,!1)},{signal:i}),t};var Wl,Ba,Cu,Tu,Pu,Ru,Mu,Ts,Ua,Ps,$a,Rs,ha,iv,nv,sv;const a0=class a0{constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:i=null,onPinchStart:n=null,onPinching:r=null,onPinchEnd:a=null,signal:l}){A(this,ha);A(this,Wl);A(this,Ba,!1);A(this,Cu,null);A(this,Tu);A(this,Pu);A(this,Ru);A(this,Mu);A(this,Ts,null);
14A(this,Ua);A(this,Ps,null);A(this,$a);A(this,Rs,null);p(this,Wl,t),p(this,Cu,i),p(this,Tu,e),p(this,Pu,n),p(this,Ru,r),p(this,Mu,a),p(this,$a,new AbortController),p(this,Ua,AbortSignal.any([l,s(this,$a).signal])),t.addEventListener("touchstart",w(this,ha,iv).bind(this),{passive:!1,signal:s(this,Ua)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/hs.pixelRatio}destroy(){var t,e;(t=s(this,$a))==null||t.abort(),p(this,$a,null),(e=s(this,Ts))==null||e.abort(),p(this,Ts,null)}};Wl=new WeakMap,Ba=new WeakMap,Cu=new WeakMap,Tu=new WeakMap,Pu=new WeakMap,Ru=new WeakMap,Mu=new WeakMap,Ts=new WeakMap,Ua=new WeakMap,Ps=new WeakMap,$a=new WeakMap,Rs=new WeakMap,ha=new WeakSet,iv=function(t){var n,r,a;if((n=s(this,Tu))!=null&&n.call(this))return;if(t.touches.length===1){if(s(this,Ts))return;const l=p(this,Ts,new AbortController),c=AbortSignal.any([s(this,Ua),l.signal]),h=s(this,Wl),u={capture:!0,signal:c,passive:!1},d=f=>{var m;f.pointerType==="touch"&&((m=s(this,Ts))==null||m.abort(),p(this,Ts,null))};h.addEventListener("pointerdown",f=>{f.pointerType==="touch"&&(Qt(f),d(f))},u),h.addEventListener("pointerup",d,u),h.addEventListener("pointercancel",d,u);return}if(!s(this,Rs)){p(this,Rs,new AbortController);const l=AbortSignal.any([s(this,Ua),s(this,Rs).signal]),c=s(this,Wl),h={signal:l,capture:!1,passive:!1};c.addEventListener("touchmove",w(this,ha,nv).bind(this),h);const u=w(this,ha,sv).bind(this);c.addEventListener("touchend",u,h),c.addEventListener("touchcancel",u,h),h.capture=!0,c.addEventListener("pointerdown",Qt,h),c.addEventListener("pointermove",Qt,h),c.addEventListener("pointercancel",Qt,h),c.addEventListener("pointerup",Qt,h),(r=s(this,Pu))==null||r.call(this)}if(Qt(t),t.touches.length!==2||(a=s(this,Cu))!=null&&a.call(this)){p(this,Ps,null);return}let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]),p(this,Ps,{touch0X:e.screenX,touch0Y:e.screenY,touch1X:i.screenX,touch1Y:i.screenY})},nv=function(t){var C;if(!s(this,Ps)||t.touches.length!==2)return;Qt(t);let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]);const{screenX:n,screenY:r}=e,{screenX:a,screenY:l}=i,c=s(this,Ps),{touch0X:h,touch0Y:u,touch1X:d,touch1Y:f}=c,m=d-h,b=f-u,y=a-n,v=l-r,S=Math.hypot(y,v)||1,x=Math.hypot(m,b)||1;if(!s(this,Ba)&&Math.abs(x-S)<=a0.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(c.touch0X=n,c.touch0Y=r,c.touch1X=a,c.touch1Y=l,!s(this,Ba)){p(this,Ba,!0);return}const E=[(n+a)/2,(r+l)/2];(C=s(this,Ru))==null||C.call(this,E,x,S)},sv=function(t){var e;t.touches.length>=2||(s(this,Rs)&&(s(this,Rs).abort(),p(this,Rs,null),(e=s(this,Mu))==null||e.call(this)),s(this,Ps)&&(Qt(t),p(this,Ps,null),p(this,Ba,!1)))};let Ip=a0;var Ha,mn,jt,Lt,Ms,Vl,Rr,Du,Me,ja,Ds,qn,Mr,Ou,za,xi,Lu,Ga,Os,Xn,ql,Xl,nn,Wa,ku,Kp,et,Sy,Iu,_y,Jf,rv,av,Ey,Qf,xy,ov,lv,cv,Cy,hv,Ty,uv,dv,fv,Py,Ih;const st=class st{constructor(t){A(this,et);A(this,Ha,null);A(this,mn,null);A(this,jt,null);A(this,Lt,null);A(this,Ms,null);A(this,Vl,!1);A(this,Rr,null);A(this,Du,"");A(this,Me,null);A(this,ja,null);A(this,Ds,null);A(this,qn,null);A(this,Mr,null);A(this,Ou,"");A(this,za,!1);A(this,xi,null);A(this,Lu,!1);A(this,Ga,!1);A(this,Os,!1);A(this,Xn,null);A(this,ql,0);A(this,Xl,0);A(this,nn,null);A(this,Wa,null);k(this,"isSelected",!1);k(this,"_isCopy",!1);k(this,"_editToolbar",null);k(this,"_initialOptions",Object.create(null));k(this,"_initialData",null);k(this,"_isVisible",!0);k(this,"_uiManager",null);k(this,"_focusEventsAllowed",!0);A(this,ku,!1);A(this,Kp,st._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;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:r,pageY:a}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[r,a];const[l,c]=this.parentDimensions;this.x=t.x/l,this.y=t.y/c,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const t=st.prototype._resizeWithKeyboard,e=Vo.TRANSLATE_SMALL,i=Vo.TRANSLATE_BIG;return ht(this,"_resizerKeyboardManager",new nf([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],st.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 ht(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new C1({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(st._l10n??(st._l10n=t),st._l10nResizer||(st._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),st._borderLineWidth!==-1)return;const i=getComputedStyle(document.documentElement);st._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Ft("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return s(this,ku)}set _isDraggable(t){var e;p(this,ku,t),(e=this.div)==null||e.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[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}
14setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=s(this,Kp)}setParent(t){var e;t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(w(this,et,Ih).call(this),(e=s(this,qn))==null||e.remove(),p(this,qn,null)),this.parent=t}focusin(t){this._focusEventsAllowed&&(s(this,za)?p(this,za,!1):this.parent.setSelected(this))}focusout(t){var i;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const e=t.relatedTarget;e!=null&&e.closest(`#${this.id}`)||(t.preventDefault(),(i=this.parent)!=null&&i.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,n){const[r,a]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(t+i)/r,this.y=(e+n)/a,this.fixAndSetPosition()}_moveAfterPaste(t,e){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n),this._onTranslated()}translate(t,e){w(this,et,Sy).call(this,this.parentDimensions,t,e)}translateInPage(t,e){s(this,xi)||p(this,xi,[this.x,this.y,this.width,this.height]),w(this,et,Sy).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){s(this,xi)||p(this,xi,[this.x,this.y,this.width,this.height]);const{div:i,parentDimensions:[n,r]}=this;if(this.x+=t/n,this.y+=e/r,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:d,y:f}=this.div.getBoundingClientRect();this.parent.findNewParent(this,d,f)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:l}=this;const[c,h]=this.getBaseTranslation();a+=c,l+=h;const{style:u}=i;u.left=`${(100*a).toFixed(2)}%`,u.top=`${(100*l).toFixed(2)}%`,this._onTranslating(a,l),i.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!s(this,xi)&&(s(this,xi)[0]!==this.x||s(this,xi)[1]!==this.y)}get _hasBeenResized(){return!!s(this,xi)&&(s(this,xi)[2]!==this.width||s(this,xi)[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=st,n=i/t,r=i/e;switch(this.rotation){case 90:return[-n,r];case 180:return[n,r];case 270:return[n,-r];default:return[-n,-r]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:e},pageDimensions:[i,n]}=this;let{x:r,y:a,width:l,height:c}=this;if(l*=i,c*=n,r*=i,a*=n,this._mustFixPosition)switch(t){case 0:r=si(r,0,i-l),a=si(a,0,n-c);break;case 90:r=si(r,0,i-c),a=si(a,l,n);break;case 180:r=si(r,l,i),a=si(a,c,n);break;case 270:r=si(r,c,i),a=si(a,0,n-l);break}this.x=r/=i,this.y=a/=n;const[h,u]=this.getBaseTranslation();r+=h,a+=u,e.left=`${(100*r).toFixed(2)}%`,e.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(t,e){var i;return w(i=st,Iu,_y).call(i,t,e,this.parentRotation)}pageTranslationToScreen(t,e){var i;return w(i=st,Iu,_y).call(i,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this;return[e*t,i*t]}setDims(){const{div:{style:t},width:e,height:i}=this;t.width=`${(100*e).toFixed(2)}%`,t.height=`${(100*i).toFixed(2)}%`}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(t*1e4)/1e4}_onResizing(){}altTextFinish(){var t;(t=s(this,jt))==null||t.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||s(this,Ga))return this._editToolbar;this._editToolbar=new uy(this),this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[e,i]of t)await this._editToolbar.addButton(e,i);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){var t;(t=this._editToolbar)==null||t.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}
14removeCommentButtonFromToolbar(){var t;(t=this._editToolbar)==null||t.removeButton("comment")}removeEditToolbar(){var t,e;(t=this._editToolbar)==null||t.remove(),this._editToolbar=null,(e=s(this,jt))==null||e.destroy()}addContainer(t){var i;const e=(i=this._editToolbar)==null?void 0:i.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return s(this,jt)||(kp.initialize(st._l10n),p(this,jt,new kp(this)),s(this,Ha)&&(s(this,jt).data=s(this,Ha),p(this,Ha,null))),s(this,jt)}get altTextData(){var t;return(t=s(this,jt))==null?void 0:t.data}set altTextData(t){s(this,jt)&&(s(this,jt).data=t)}get guessedAltText(){var t;return(t=s(this,jt))==null?void 0:t.guessedText}async setGuessedAltText(t){var e;await((e=s(this,jt))==null?void 0:e.setGuessedText(t))}serializeAltText(t){var e;return(e=s(this,jt))==null?void 0:e.serialize(t)}hasAltText(){return!!s(this,jt)&&!s(this,jt).isEmpty()}hasAltTextData(){var t;return((t=s(this,jt))==null?void 0:t.hasData())??!1}focusCommentButton(){var t;(t=s(this,Lt))==null||t.focusButton()}addCommentButton(){return s(this,Lt)||p(this,Lt,new Mf(this))}addStandaloneCommentButton(){if(s(this,Ms)){this._uiManager.isEditingMode()&&s(this,Ms).classList.remove("hidden");return}this.hasComment&&(p(this,Ms,s(this,Lt).renderForStandalone()),this.div.append(s(this,Ms)))}removeStandaloneCommentButton(){s(this,Lt).removeStandaloneCommentButton(),p(this,Ms,null)}hideStandaloneCommentButton(){var t;(t=s(this,Ms))==null||t.classList.add("hidden")}get comment(){const{data:{richText:t,text:e,date:i,deleted:n}}=s(this,Lt);return{text:e,richText:t,date:i,deleted:n,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(t){s(this,Lt)||p(this,Lt,new Mf(this)),s(this,Lt).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:i}){if(!e||(s(this,Lt)||p(this,Lt,new Mf(this)),s(this,Lt).setInitialText(t,i),!this.annotationElementId))return;const n=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);n&&this.updateFromAnnotationLayer(n)}get hasEditedComment(){var t;return(t=s(this,Lt))==null?void 0:t.hasBeenEdited()}get hasDeletedComment(){var t;return(t=s(this,Lt))==null?void 0:t.isDeleted()}get hasComment(){return!!s(this,Lt)&&!s(this,Lt).isEmpty()&&!s(this,Lt).isDeleted()}async editComment(t){s(this,Lt)||p(this,Lt,new Mf(this)),s(this,Lt).edit(t)}toggleComment(t,e=void 0){this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){s(this,Lt).setSelectedButton(t)}addComment(t){if(this.hasEditedComment){const[,,,n]=t.rect,[r]=this.pageDimensions,[a]=this.pageTranslation,l=a+r+1,c=n-100,h=l+180;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[l,c,h,n]}}}updateFromAnnotationLayer({popup:{contents:t,deleted:e}}){s(this,Lt).data=e?null:t}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){var a;const 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=s(this,Vl)?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),w(this,et,Ty).call(this);const[e,i]=this.parentDimensions;this.parentRotation%180!==0&&(t.style.maxWidth=`${(100*i/e).toFixed(2)}%`,t.style.maxHeight=`${(100*e/i).toFixed(2)}%`);const[n,r]=this.getInitialTranslation();return this.translate(n,r),Gw(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(s(this,Wa)||p(this,Wa,new Ip({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:w(this,et,ov).bind(this),onPinching:w(this,et,lv).bind(this),onPinchEnd:w(this,et,cv).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),(a=this._uiManager._editorUndoBar)==null||a.hide(),t}pointerdown(t){const{isMac:e}=Ne.platform;if(t.button!==0||t.ctrlKey&&e){t.preventDefault();return}if(p(this,za,!0),this._isDraggable){w(this,et,hv).call(this,t);return}w(this,et,Cy).call(this,t)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){s(this,Xn)&&clearTimeout(s(this,Xn)),p(this,Xn,setTimeout(()=>{var t;p(this,Xn,null),(t=this.parent)==null||t.moveEditorInDOM(this)},0))}
14_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e,i=this.rotation){const n=this.parentScale,[r,a]=this.pageDimensions,[l,c]=this.pageTranslation,h=t/n,u=e/n,d=this.x*r,f=this.y*a,m=this.width*r,b=this.height*a;switch(i){case 0:return[d+h+l,a-f-u-b+c,d+h+m+l,a-f-u+c];case 90:return[d+u+l,a-f+h+c,d+u+b+l,a-f+h+m+c];case 180:return[d-h-m+l,a-f+u+c,d-h+l,a-f+u+b+c];case 270:return[d-u-b+l,a-f-h-m+c,d-u+l,a-f-h+c];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,r,a]=t,l=r-i,c=a-n;switch(this.rotation){case 0:return[i,e-a,l,c];case 90:return[i,e-n,c,l];case 180:return[r,e-n,l,c];case 270:return[r,e-a,c,l];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&st._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){var t;(t=s(this,Lt))==null||t.onUpdatedColor()}getData(){const{comment:{text:t,color:e,date:i,opacity:n,deleted:r,richText:a},uid:l,pageIndex:c,creationDate:h,modificationDate:u}=this;return{id:l,pageIndex:c,rect:this.getPDFRect(),richText:a,contentsObj:{str:t},creationDate:h,modificationDate:i||u,popupRef:!r,color:e,opacity:n}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),p(this,Ga,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),p(this,Ga,!1),!0):!1}isInEditMode(){return s(this,Ga)}shouldGetKeyboardEvents(){return s(this,Os)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:i,right:n}=this.getClientDimensions(),{innerHeight:r,innerWidth:a}=window;return e<a&&n>0&&t<r&&i>0}rebuild(){w(this,et,Ty).call(this)}rotate(t){}resize(){}serializeDeleted(){var t;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:((t=this._initialData)==null?void 0:t.popupRef)||""}}serialize(t=!1,e=null){var i;return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:((i=this._initialData)==null?void 0:i.popupRef)||""}}static async deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});n.rotation=t.rotation,p(n,Ha,t.accessibilityData),n._isCopy=t.isCopy||!1;const[r,a]=n.pageDimensions,[l,c,h,u]=n.getRectInCurrentCoords(t.rect,a);return n.x=l/r,n.y=c/a,n.width=h/r,n.height=u/a,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var t,e;if((t=s(this,Mr))==null||t.abort(),p(this,Mr,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),s(this,Xn)&&(clearTimeout(s(this,Xn)),p(this,Xn,null)),w(this,et,Ih).call(this),this.removeEditToolbar(),s(this,nn)){for(const i of s(this,nn).values())clearTimeout(i);p(this,nn,null)}this.parent=null,(e=s(this,Wa))==null||e.destroy(),p(this,Wa,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(w(this,et,rv).call(this),s(this,Me).classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[t,e]}=this,[i,n,r,a]=this.getPDFRect();return[st._round(i+(r-i)*t),st._round(n+(a-n)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return s(this,Lt).commentPopupPositionInLayer}set commentPopupPosition(t){s(this,Lt).commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return s(this,Lt).hasDefaultPopupPosition()}get commentButtonWidth(){return s(this,Lt).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){s(this,Lt).setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),p(this,Ds,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=s(this,Me).children;if(!s(this,mn)){p(this,mn,Array.from(e));const a=w(this,et,uv).bind(this),l=w(this,et,dv).bind(this),c=this._uiManager._signal;for(const h of s(this,mn)){const u=h.getAttribute("data-resizer-name");h.setAttribute("role","spinbutton"),h.addEventListener("keydown",a,{signal:c}),h.addEventListener("blur",l,{signal:c}),h.addEventListener("focus",w(this,et,fv).bind(this,u),{signal:c}),h.setAttribute("data-l10n-id",st._l10nResizer[u])}}const i=s(this,mn)[0];let n=0;for(const a of e){if(a===i)break;n++}const r=(360-this.rotation+this.parentRotation)%360/90*(s(this,mn).length/4);if(r!==n){if(r<n)for(let l=0;l<n-r;l++)s(this,Me).append(s(this,Me).firstChild);else if(r>n)for(let l=0;l<r-n;l++)s(this,Me).firstChild.before(s(this,Me).lastChild);let a=0;for(const l of e){const h=s(this,mn)[a++].getAttribute("data-resizer-name");l.setAttribute("data-l10n-id",st._l10nResizer[h])}}w(this,et,Py).call(this,0),p(this,Os,!0),s(this,Me).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){s(this,Os)&&w(this,et,xy).call(this,s(this,Ou),{deltaX:t,deltaY:e,fromKeyboard:!0})}_stopResizingWithKeyboard(){w(this,et,Ih).call(this),this.div.focus()}select(){var t,e,i;if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),(t=this.div)==null||t.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var n,r;(n=this.div)!=null&&n.classList.contains("selectedEditor")&&((r=this._editToolbar)==null||r.show())});return}(e=this._editToolbar)==null||e.show(),(i=s(this,jt))==null||i.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>{var t;return(t=this.div)==null?void 0:t.focus({preventScroll:!0})},0)}unselect(){var t,e,i,n,r;this.isSelected&&(this.isSelected=!1,(t=s(this,Me))==null||t.classList.add("hidden"),(e=this.div)==null||e.classList.remove("selectedEditor"),(i=this.div)!=null&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(n=this._editToolbar)==null||n.hide(),(r=s(this,jt))==null||r.toggleAltTextBadge(!0),this.hasComment&&this._uiManager.toggleComment(this,!1,
14!1))}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.id}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return s(this,Lu)}set isEditing(t){p(this,Lu,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){s(this,nn)||p(this,nn,new Map);const{action:i}=t;let n=s(this,nn).get(i);n&&clearTimeout(n),n=setTimeout(()=>{this._reportTelemetry(t),s(this,nn).delete(i),s(this,nn).size===0&&p(this,nn,null)},st._telemetryTimeout),s(this,nn).set(i,n);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),p(this,Vl,!1)}disable(){this.div&&(this.div.tabIndex=-1),p(this,Vl,!0)}updateFakeAnnotationElement(t){if(!s(this,qn)&&!this.deleted){p(this,qn,t.addFakeAnnotation(this));return}if(this.deleted){s(this,qn).remove(),p(this,qn,null);return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&s(this,qn).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"){const i=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),i.before(e)}return e}resetAnnotationElement(t){const{firstChild:e}=t.container;(e==null?void 0:e.nodeName)==="DIV"&&e.classList.contains("annotationContent")&&e.remove()}};Ha=new WeakMap,mn=new WeakMap,jt=new WeakMap,Lt=new WeakMap,Ms=new WeakMap,Vl=new WeakMap,Rr=new WeakMap,Du=new WeakMap,Me=new WeakMap,ja=new WeakMap,Ds=new WeakMap,qn=new WeakMap,Mr=new WeakMap,Ou=new WeakMap,za=new WeakMap,xi=new WeakMap,Lu=new WeakMap,Ga=new WeakMap,Os=new WeakMap,Xn=new WeakMap,ql=new WeakMap,Xl=new WeakMap,nn=new WeakMap,Wa=new WeakMap,ku=new WeakMap,Kp=new WeakMap,et=new WeakSet,Sy=function([t,e],i,n){[i,n]=this.screenToPageTranslation(i,n),this.x+=i/t,this.y+=n/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},Iu=new WeakSet,_y=function(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}},Jf=function(t){switch(t){case 90:{const[e,i]=this.pageDimensions;return[0,-e/i,i/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,i]=this.pageDimensions;return[0,e/i,-i/e,0]}default:return[1,0,0,1]}},rv=function(){if(s(this,Me))return;p(this,Me,document.createElement("div")),s(this,Me).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const n=document.createElement("div");s(this,Me).append(n),n.classList.add("resizer",i),n.setAttribute("data-resizer-name",i),n.addEventListener("pointerdown",w(this,et,av).bind(this,i),{signal:e}),n.addEventListener("contextmenu",cn,{signal:e}),n.tabIndex=-1}this.div.prepend(s(this,Me))},av=function(t,e){var u;e.preventDefault();const{isMac:i}=Ne.platform;if(e.button!==0||e.ctrlKey&&i)return;(u=s(this,jt))==null||u.toggle(!1);const n=this._isDraggable;this._isDraggable=!1,p(this,ja,[e.screenX,e.screenY]);const r=new AbortController,a=this._uiManager.combinedSignal(r);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",w(this,et,xy).bind(this,t),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",Qt,{passive:!1,signal:a}),window.addEventListener("contextmenu",cn,{signal:a}),p(this,Ds,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const l=this.parent.div.style.cursor,c=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const h=()=>{var d;r.abort(),this.parent.togglePointerEvents(!0),(d=s(this,jt))==null||d.toggle(!0),this._isDraggable=n,this.parent.div.style.cursor=l,this.div.style.cursor=c,w(this,et,Qf).call(this)};window.addEventListener("pointerup",h,{signal:a}),window.addEventListener("blur",h,{signal:a})}
vendor: 4,361 bytes, line 14
14,Ey=function(t,e,i,n){this.width=i,this.height=n,this.x=t,this.y=e,this.setDims(),this.fixAndSetPosition(),this._onResized()},Qf=function(){if(!s(this,Ds))return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=s(this,Ds);p(this,Ds,null);const r=this.x,a=this.y,l=this.width,c=this.height;r===t&&a===e&&l===i&&c===n||this.addCommands({cmd:w(this,et,Ey).bind(this,r,a,l,c),undo:w(this,et,Ey).bind(this,t,e,i,n),mustExec:!0})},xy=function(t,e){const[i,n]=this.parentDimensions,r=this.x,a=this.y,l=this.width,c=this.height,h=st.MIN_SIZE/i,u=st.MIN_SIZE/n,d=w(this,et,Jf).call(this,this.rotation),f=(H,G)=>[d[0]*H+d[2]*G,d[1]*H+d[3]*G],m=w(this,et,Jf).call(this,360-this.rotation),b=(H,G)=>[m[0]*H+m[2]*G,m[1]*H+m[3]*G];let y,v,S=!1,x=!1;switch(t){case"topLeft":S=!0,y=(H,G)=>[0,0],v=(H,G)=>[H,G];break;case"topMiddle":y=(H,G)=>[H/2,0],v=(H,G)=>[H/2,G];break;case"topRight":S=!0,y=(H,G)=>[H,0],v=(H,G)=>[0,G];break;case"middleRight":x=!0,y=(H,G)=>[H,G/2],v=(H,G)=>[0,G/2];break;case"bottomRight":S=!0,y=(H,G)=>[H,G],v=(H,G)=>[0,0];break;case"bottomMiddle":y=(H,G)=>[H/2,G],v=(H,G)=>[H/2,0];break;case"bottomLeft":S=!0,y=(H,G)=>[0,G],v=(H,G)=>[H,0];break;case"middleLeft":x=!0,y=(H,G)=>[0,G/2],v=(H,G)=>[H,G/2];break}const E=y(l,c),C=v(l,c);let T=f(...C);const R=st._round(r+T[0]),D=st._round(a+T[1]);let L=1,I=1,N,F;if(e.fromKeyboard)({deltaX:N,deltaY:F}=e);else{const{screenX:H,screenY:G}=e,[pt,ft]=s(this,ja);[N,F]=this.screenToPageTranslation(H-pt,G-ft),s(this,ja)[0]=H,s(this,ja)[1]=G}if([N,F]=b(N/i,F/n),S){const H=Math.hypot(l,c);L=I=Math.max(Math.min(Math.hypot(C[0]-E[0]-N,C[1]-E[1]-F)/H,1/l,1/c),h/l,u/c)}else x?L=si(Math.abs(C[0]-E[0]-N),h,1)/l:I=si(Math.abs(C[1]-E[1]-F),u,1)/c;const U=st._round(l*L),Y=st._round(c*I);T=f(...v(U,Y));const $=R-T[0],Z=D-T[1];s(this,xi)||p(this,xi,[this.x,this.y,this.width,this.height]),this.width=U,this.height=Y,this.x=$,this.y=Z,this.setDims(),this.fixAndSetPosition(),this._onResizing()},ov=function(){var t;p(this,Ds,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(t=s(this,jt))==null||t.toggle(!1),this.parent.togglePointerEvents(!1)},lv=function(t,e,i){let r=.7*(i/e)+1-.7;if(r===1)return;const a=w(this,et,Jf).call(this,this.rotation),l=(R,D)=>[a[0]*R+a[2]*D,a[1]*R+a[3]*D],[c,h]=this.parentDimensions,u=this.x,d=this.y,f=this.width,m=this.height,b=st.MIN_SIZE/c,y=st.MIN_SIZE/h;r=Math.max(Math.min(r,1/f,1/m),b/f,y/m);const v=st._round(f*r),S=st._round(m*r);if(v===f&&S===m)return;s(this,xi)||p(this,xi,[u,d,f,m]);const x=l(f/2,m/2),E=st._round(u+x[0]),C=st._round(d+x[1]),T=l(v/2,S/2);this.x=E-T[0],this.y=C-T[1],this.width=v,this.height=S,this.setDims(),this.fixAndSetPosition(),this._onResizing()},cv=function(){var t;(t=s(this,jt))==null||t.toggle(!0),this.parent.togglePointerEvents(!0),w(this,et,Qf).call(this)},Cy=function(t){const{isMac:e}=Ne.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},hv=function(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const n=new AbortController,r=this._uiManager.combinedSignal(n),a={capture:!0,passive:!1,signal:r},l=h=>{n.abort(),p(this,Rr,null),p(this,za,!1),this._uiManager.endDragSession()||w(this,et,Cy).call(this,h),i&&this._onStopDragging()};e&&(p(this,ql,t.clientX),p(this,Xl,t.clientY),p(this,Rr,t.pointerId),p(this,Du,t.pointerType),window.addEventListener("pointermove",h=>{i||(i=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:u,clientY:d,pointerId:f}=h;if(f!==s(this,Rr)){Qt(h);return}const[m,b]=this.screenToPageTranslation(u-s(this,ql),d-s(this,Xl));p(this,ql,u),p(this,Xl,d),this._uiManager.dragSelectedEditors(m,b)},a),window.addEventListener("touchmove",Qt,a),window.addEventListener("pointerdown",h=>{h.pointerType===s(this,Du)&&(s(this,Wa)||h.isPrimary)&&l(h),Qt(h)},a));const c=h=>{if(!s(this,Rr)||s(this,Rr)===h.pointerId){l(h);return}Qt(h)};window.addEventListener("pointerup",c,{signal:r}),window.addEventListener("blur",c,{signal:r})},Ty=function(){if(s(this,Mr)||!this.div)return;p(this,Mr,new AbortController);const t=this._uiManager.combinedSignal(s(this,Mr));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},uv=function(t){st._resizerKeyboardManager.exec(this,t)},dv=function(t){var e;
14s(this,Os)&&((e=t.relatedTarget)==null?void 0:e.parentNode)!==s(this,Me)&&w(this,et,Ih).call(this)},fv=function(t){p(this,Ou,s(this,Os)?t:"")},Py=function(t){if(s(this,mn))for(const e of s(this,mn))e.tabIndex=t},Ih=function(){p(this,Os,!1),w(this,et,Py).call(this,-1),w(this,et,Qf).call(this)},A(st,Iu),k(st,"_l10n",null),k(st,"_l10nResizer",null),k(st,"_borderLineWidth",-1),k(st,"_colorManager",new py),k(st,"_zIndex",1),k(st,"_telemetryTimeout",1e3);let Bt=st;class C1 extends Bt{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const dA=3285377520,qi=4294901760,Fn=65535;class pv{constructor(t){this.h1=t?t&4294967295:dA,this.h2=t?t&4294967295:dA}update(t){let e,i;if(typeof t=="string"){e=new Uint8Array(t.length*2),i=0;for(let y=0,v=t.length;y<v;y++){const S=t.charCodeAt(y);S<=255?e[i++]=S:(e[i++]=S>>>8,e[i++]=S&255)}}else if(ArrayBuffer.isView(t))e=t.slice(),i=e.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const n=i>>2,r=i-n*4,a=new Uint32Array(e.buffer,0,n);let l=0,c=0,h=this.h1,u=this.h2;const d=3432918353,f=461845907,m=d&Fn,b=f&Fn;for(let y=0;y<n;y++)y&1?(l=a[y],l=l*d&qi|l*m&Fn,l=l<<15|l>>>17,l=l*f&qi|l*b&Fn,h^=l,h=h<<13|h>>>19,h=h*5+3864292196):(c=a[y],c=c*d&qi|c*m&Fn,c=c<<15|c>>>17,c=c*f&qi|c*b&Fn,u^=c,u=u<<13|u>>>19,u=u*5+3864292196);switch(l=0,r){case 3:l^=e[n*4+2]<<16;case 2:l^=e[n*4+1]<<8;case 1:l^=e[n*4],l=l*d&qi|l*m&Fn,l=l<<15|l>>>17,l=l*f&qi|l*b&Fn,n&1?h^=l:u^=l}this.h1=h,this.h2=u}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&qi|t*36045&Fn,e=e*4283543511&qi|((e<<16|t>>>16)*2950163797&qi)>>>16,t^=e>>>1,t=t*444984403&qi|t*60499&Fn,e=e*3301882366&qi|((e<<16|t>>>16)*3120437893&qi)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const Ry=Object.freeze({map:null,hash:"",transfer:void 0});var Va,qa,Ls,De,Jp,gv;class Qb{constructor(){A(this,Jp);A(this,Va,!1);A(this,qa,null);A(this,Ls,null);A(this,De,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=s(this,De).get(t);return i===void 0?e:Object.assign(e,i)}getRawValue(t){return s(this,De).get(t)}remove(t){const e=s(this,De).get(t);if(e!==void 0&&(e instanceof Bt&&s(this,Ls).delete(e.annotationElementId),s(this,De).delete(t),s(this,De).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(const i of s(this,De).values())if(i instanceof Bt)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=s(this,De).get(t);let n=!1;if(i!==void 0)for(const[r,a]of Object.entries(e))i[r]!==a&&(n=!0,i[r]=a);else n=!0,s(this,De).set(t,e);n&&w(this,Jp,gv).call(this),e instanceof Bt&&((s(this,Ls)||p(this,Ls,new Map)).set(e.annotationElementId,e),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(e.constructor._type))}has(t){return s(this,De).has(t)}get size(){return s(this,De).size}resetModified(){s(this,Va)&&(p(this,Va,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new mv(this)}get serializable(){if(s(this,De).size===0)return Ry;const t=new Map,e=new pv,i=[],n=Object.create(null);let r=!1;for(const[a,l]of s(this,De)){const c=l instanceof Bt?l.serialize(!1,n):l;c&&(t.set(a,c),e.update(`${a}:${JSON.stringify(c)}`),r||(r=!!c.bitmap))}if(r)for(const a of t.values())a.bitmap&&i.push(a.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:Ry}get editorStats(){let t=null;const e=new Map;let i=0,n=0;for(const r of s(this,De).values()){if(!(r instanceof Bt)){r.popup&&(r.popup.deleted?n+=1:i+=1);continue}r.isCommentDeleted?n+=1:r.hasEditedComment&&(i+=1);const a=r.telemetryFinalData;if(!a)continue;const{type:l}=a;e.has(l)||e.set(l,Object.getPrototypeOf(r).constructor),t||(t=Object.create(null));const c=t[l]||(t[l]=new Map);for(const[h,u]of Object.entries(a)){if(h==="type")continue;let d=c.get(h);d||(d=new Map,c.set(h,d));const f=d.get(u)??0;d.set(u,f+1)}}if((n>0||i>0)&&(t||(t=Object.create(null)),t.comments={deleted:n,edited:i}),!t)return null;for(const[r,a]of e)t[r]=a.computeTelemetryFinalData(t[r]);return t}resetModifiedIds(){p(this,qa,null)}updateEditor(t,e){var n;const i=(n=s(this,Ls))==null?void 0:n.get(t);return i?(i.updateFromAnnotationLayer(e),!0):!1}getEditor(t){var e;return((e=s(this,Ls))==null?void 0:e.get(t))||null}get modifiedIds(){if(s(this,qa))return s(this,qa);const t=[];if(s(this,Ls))for(const e of s(this,Ls).values())e.serialize()&&t.pu
14sh(e.annotationElementId);return p(this,qa,{ids:new Set(t),hash:t.join(",")})}[Symbol.iterator](){return s(this,De).entries()}}Va=new WeakMap,qa=new WeakMap,Ls=new WeakMap,De=new WeakMap,Jp=new WeakSet,gv=function(){s(this,Va)||(p(this,Va,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var Fu;class mv extends Qb{constructor(e){super();A(this,Fu);const{map:i,hash:n,transfer:r}=e.serializable,a=structuredClone(i,r?{transfer:r}:null);p(this,Fu,{map:a,hash:n,transfer:r})}get print(){Ft("Should not call PrintAnnotationStorage.print")}get serializable(){return s(this,Fu)}get modifiedIds(){return ht(this,"modifiedIds",{ids:new Set,hash:""})}}Fu=new WeakMap;var Yl;class T1{constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){A(this,Yl,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));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),s(this,Yl).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:i}){if(!(!t||s(this,Yl).has(t.loadedName))){if(yt(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:n,src:r,style:a}=t,l=new FontFace(n,r,a);this.addNativeFontFace(l);try{await l.load(),s(this,Yl).add(n),i==null||i(t)}catch{it(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(l)}return}Ft("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){const i=t.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(n){throw it(`Failed to load font '${i.family}': '${n}'.`),t.disableFontFace=!0,n}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(i=>{const n=this._queueLoadingCallback(i);this._prepareFontLoadEvent(t,n)})}}get isFontLoadingAPISupported(){var e;const t=!!((e=this._document)!=null&&e.fonts);return ht(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){return ht(this,"isSyncFontLoadingSupported",ni||Ne.platform.isFirefox)}_queueLoadingCallback(t){function e(){for(yt(!n.done,"completeRequest() cannot be called twice."),n.done=!0;i.length>0&&i[0].done;){const r=i.shift();setTimeout(r.callback,0)}}const{loadingRequests:i}=this,n={done:!1,complete:e,callback:t};return i.push(n),n}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return ht(this,"_loadTestFont",t)}
14_prepareFontLoadEvent(t,e){function i(C,T){return C.charCodeAt(T)<<24|C.charCodeAt(T+1)<<16|C.charCodeAt(T+2)<<8|C.charCodeAt(T+3)&255}function n(C,T,R,D){const L=C.substring(0,T),I=C.substring(T+R);return L+D+I}let r,a;const l=this._document.createElement("canvas");l.width=1,l.height=1;const c=l.getContext("2d");let h=0;function u(C,T){if(++h>30){it("Load test font never loaded."),T();return}if(c.font="30px "+C,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0){T();return}setTimeout(u.bind(null,C,T))}const d=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=n(f,976,d.length,d);const b=16,y=1482184792;let v=i(f,b);for(r=0,a=d.length-3;r<a;r+=4)v=v-y+i(d,r)|0;r<d.length&&(v=v-y+i(d+"XXX",r)|0),f=n(f,b,4,o1(v));const S=`url(data:font/opentype;base64,${btoa(f)});`,x=`@font-face {font-family:"${d}";src:${S}}`;this.insertRule(x);const E=this._document.createElement("div");E.style.visibility="hidden",E.style.width=E.style.height="10px",E.style.position="absolute",E.style.top=E.style.left="0px";for(const C of[t.loadedName,d]){const T=this._document.createElement("span");T.textContent="Hi",T.style.fontFamily=C,E.append(T)}this._document.body.append(E),u(d,()=>{E.remove(),e.complete()})}}Yl=new WeakMap;var Pt;class P1{constructor(t,e=null,i,n){A(this,Pt);this.compiledGlyphs=Object.create(null),p(this,Pt,t),this._inspectFont=e,i&&Object.assign(this,i),n&&(this.charProcOperatorList=n)}createNativeFontFace(){var e;if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const i={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(i.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,i)}return(e=this._inspectFont)==null||e.call(this,this),t}createFontFaceRule(){var i;if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${Fw(this.data)});`;let e;if(!this.cssFontInfo)e=`@font-face {font-family:"${this.loadedName}";src:${t}}`;else{let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),e=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${t}}`}return(i=this._inspectFont)==null||i.call(this,this,t),e}getPathGenerator(t,e){if(this.compiledGlyphs[e]!==void 0)return this.compiledGlyphs[e];const i=this.loadedName+"_path_"+e;let n;try{n=t.get(i)}catch(a){it(`getPathGenerator - ignoring character: "${a}".`)}const r=new Path2D(n||"");return this.fontExtraProperties||t.delete(i),this.compiledGlyphs[e]=r}get black(){return s(this,Pt).black}get bold(){return s(this,Pt).bold}get disableFontFace(){return s(this,Pt).disableFontFace??!1}get fontExtraProperties(){return s(this,Pt).fontExtraProperties??!1}get isInvalidPDFjsFont(){return s(this,Pt).isInvalidPDFjsFont}get isType3Font(){return s(this,Pt).isType3Font}get italic(){return s(this,Pt).italic}get missingFile(){return s(this,Pt).missingFile}get remeasure(){return s(this,Pt).remeasure}get vertical(){return s(this,Pt).vertical}get ascent(){return s(this,Pt).ascent}get defaultWidth(){return s(this,Pt).defaultWidth}get descent(){return s(this,Pt).descent}get bbox(){return s(this,Pt).bbox}get fontMatrix(){return s(this,Pt).fontMatrix}get fallbackName(){return s(this,Pt).fallbackName}get loadedName(){return s(this,Pt).loadedName}get mimetype(){return s(this,Pt).mimetype}get name(){return s(this,Pt).name}get data(){return s(this,Pt).data}clearData(){s(this,Pt).clearData()}get cssFontInfo(){return s(this,Pt).cssFontInfo}get systemFontInfo(){return s(this,Pt).systemFontInfo}get defaultVMetrics(){return s(this,Pt).defaultVMetrics}}Pt=new WeakMap;function R1(o){if(o instanceof URL)return o.href;if(typeof o=="string"){if(ni)return o;const t=URL.parse(o,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 M1(o){if(ni&&typeof Buffer<"u"&&o instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(o instanceof Uint8Array&&o.byteLength===o.buffer.byteLength)return o;
14if(typeof o=="string")return Qd(o);if(o instanceof ArrayBuffer||ArrayBuffer.isView(o)||typeof o=="object"&&!isNaN(o==null?void 0:o.length))return new Uint8Array(o);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function Df(o){if(typeof o!="string")return null;if(o.endsWith("/"))return o;throw new Error(`Invalid factory url: "${o}" must include trailing slash.`)}const My=o=>typeof o=="object"&&Number.isInteger(o==null?void 0:o.num)&&o.num>=0&&Number.isInteger(o==null?void 0:o.gen)&&o.gen>=0,D1=o=>typeof o=="object"&&typeof(o==null?void 0:o.name)=="string",O1=d1.bind(null,My,D1);var ks,Qp;class L1{constructor(){A(this,ks,new Map);A(this,Qp,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};s(this,Qp).then(()=>{for(const[n]of s(this,ks))n.call(this,i)})}addEventListener(t,e,i=null){let n=null;if((i==null?void 0:i.signal)instanceof AbortSignal){const{signal:r}=i;if(r.aborted){it("LoopbackPort - cannot use an `aborted` signal.");return}const a=()=>this.removeEventListener(t,e);n=()=>r.removeEventListener("abort",a),r.addEventListener("abort",a)}s(this,ks).set(e,n)}removeEventListener(t,e){const i=s(this,ks).get(e);i==null||i(),s(this,ks).delete(e)}terminate(){for(const[,t]of s(this,ks))t==null||t();s(this,ks).clear()}}ks=new WeakMap,Qp=new WeakMap;const Of={DATA:1,ERROR:2},ne={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function fA(){}function hi(o){if(o instanceof la||o instanceof oy||o instanceof rA||o instanceof Op||o instanceof Hm)return o;switch(o instanceof Error||typeof o=="object"&&o!==null||Ft('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),o.name){case"AbortException":return new la(o.message);case"InvalidPDFException":return new oy(o.message);case"PasswordException":return new rA(o.message,o.code);case"ResponseException":return new Op(o.message,o.status,o.missing);case"UnknownErrorException":return new Hm(o.message,o.details)}return new Hm(o.message,o.toString())}var Kl,ln,yv,bv,Av,Zf;class Fh{constructor(t,e,i){A(this,ln);A(this,Kl,new AbortController);this.sourceName=t,this.targetName=e,this.comObj=i,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),i.addEventListener("message",w(this,ln,yv).bind(this),{signal:s(this,Kl).signal})}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const n=this.callbackId++,r=Promise.withResolvers();this.callbackCapabilities[n]=r;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},i)}catch(a){r.reject(a)}return r.promise}sendWithStream(t,e,i,n){const r=this.streamId++,a=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:h=>{const u=Promise.withResolvers();return this.streamControllers[r]={controller:h,startCall:u,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:a,targetName:l,action:t,streamId:r,data:e,desiredSize:h.desiredSize},n),u.promise},pull:h=>{const u=Promise.withResolvers();return this.streamControllers[r].pullCall=u,c.postMessage({sourceName:a,targetName:l,stream:ne.PULL,streamId:r,desiredSize:h.desiredSize}),u.promise},cancel:h=>{yt(h instanceof Error,"cancel must have a valid reason");const u=Promise.withResolvers();return this.streamControllers[r].cancelCall=u,this.streamControllers[r].isClosed=!0,c.postMessage({sourceName:a,targetName:l,stream:ne.CANCEL,streamId:r,reason:hi(h)}),u.promise}},i)}destroy(){var t;(t=s(this,Kl))==null||t.abort(),p(this,Kl,null)}}Kl=new WeakMap,ln=new WeakSet,yv=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){w(this,ln,Av).call(this,t);return}if(t.callback){const i=t.callbackId,n=this.callbackCapabilities[i];if(!n)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],t.callback===Of.DATA)n.resolve(t.data);else if(t.callback===Of.ERROR)n.reject(hi(t.reason));else throw new Error("Unexpected callback case");return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const i=this.sourceName,n=t.sourceName,r=this.comObj;Promise.try(e,t.data).then(function(a){r.postMessage({sourceName:i,targetName:n,callback:Of.DATA,callbackId:t.callbackId,data:a})},function(a){r.postMessage({sourceName:i,targetName:n,callback:Of.ERROR,callbackId:t.callbackId,reason:hi(a)})});return}if(t.streamId){w(this,ln,bv).call(this,t);return}e(t.data)},bv=function(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,r=this.comObj,a=this,l=this.actionHandler[t.action],c={enqueue(h,u=1,d){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=u,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),r.postMessage({sourceName:i,targetName:n,stream:ne.ENQUEUE,streamId:e,chunk:h},d)},close(){this.isCancelled||(this.isCancelled=!0,r.postMessage({sourceName:i,targetName:n,stream:ne.CLOSE,streamId:e}),delete a.streamSinks[e])},error(h){yt(h instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,r.postMessage({sourceName:i,targetName:n,stream:ne.ERROR,streamId:e,reason:hi(h)}))},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(l,t.data,c).then(function(){r.postMessage({sourceName:i,targetName:n,stream:ne.START_COMPLETE,streamId:e,success:!0})},function(h){r.postMessage({sourceName:i,targetName:n,stream:ne.START_COMPLETE,streamId:e,reason:hi(h)})})},Av=function(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,r=this.comObj,a=this.streamControllers[e],l=this.streamSinks[e];switch(t.stream){case ne.START_COMPLETE:t.success?a.startCall.resolve():a.startCall.reject(hi(t.reason));break;case ne.PULL_COMPLETE:t.success?a.pullCall.resolve():a.pullCall.reject(hi(t.reason));break;case ne.PULL:if(!l){r.postMessage({sourceName:i,targetName:n,stream:ne.PULL_COMPLETE,streamId:e,success:!0});break}l.desiredSize<=0&&t.desiredSize>0&&l.sinkCapability.resolve(),l.desiredSize=t.desiredSize,Promise.try(l.onPull||fA).then(function(){r.postMessage({sourceName:i,targetName:n,stream:ne.PULL_COMPLETE,streamId:e,success:!0})},function(h){r.postMessage({sourceName:i,targetName:n,stream:ne.PULL_COMPLETE,streamId:e,reason:hi(h)})});break;case ne.ENQUEUE:if(yt(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(t.chunk);break;case ne.CLOSE:if(yt(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),w(this,ln,Zf).call(this,a,e);break;case ne.ERROR:yt(a,"error should have stream controller"),a.controller.error(hi(t.reason)),w(this,ln,Zf).call(this,a,e);break;case ne.CANCEL_COMPLETE:t.success?a.cancelCall.resolve():a.cancelCall.reject(hi(t.reason)),w(this,ln,Zf).call(this,a,e);break;case ne.CANCEL:if(!l)break;const c=hi(t.reason);Promise.try(l.onCancel||fA,c).then(function(){r.postMessage({sourceName:i,targetName:n,stream:ne.CANCEL_COMPLETE,streamId:e,success:!0})},function(h){r.postMessage({sourceName:i,targetName:n,stream:ne.CANCEL_COMPLETE,streamId:e,reason:hi(h)})}),l.sinkCapability.reject(c),l.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},Zf=async function(t,e){var i,n,r;await Promise.allSettled([(i=t.startCall)==null?void 0:i.promise,(n=t.pullCall)==null?void 0:n.promise,(r=t.cancelCall)==null?void 0:r.promise]),delete this.streamControllers[e]};var Nu;class wv{constructor({enableHWA:t=!1}){A(this,Nu,!1);p(this,Nu,t)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!s(this,Nu)})}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}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){Ft("Abstract method `_createCanvas` called.")}}Nu=new WeakMap;class k1 extends wv{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}}class vv{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.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(e).then(i=>({cMapData:i,isCompressed:this.isCompressed})).catch(i=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)})}async _fetch(t){Ft("Abstract method `_fetch` called.")}}class pA extends vv{async _fetch(t){const e=await Zd(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):Qd(e)}}class Sv{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,n,r){return"none"}destroy(t=!1){}}var Xa,Jl,Is,Fs,Ge,Ya,Ka,j,He,Nh,gl,tp,ml,_v,Dy,yl,Bh,Uh,Oy,$h;class I1 extends Sv{constructor({docId:e,ownerDocument:i=globalThis.document}){super();A(this,j);A(this,Xa);A(this,Jl);A(this,Is);A(this,Fs);A(this,Ge);A(this,Ya);A(this,Ka,0);p(this,Fs,e),p(this,Ge,i)}addFilter(e){if(!e)return"none";let i=s(this,j,He).get(e);if(i)return i;const[n,r,a]=w(this,j,tp).call(this,e),l=e.length===1?n:`${n}${r}${a}`;if(i=s(this,j,He).get(l),i)return s(this,j,He).set(e,i),i;const c=`g_${s(this,Fs)}_transfer_map_${ce(this,Ka)._++}`,h=w(this,j,ml).call(this,c);s(this,j,He).set(e,h),s(this,j,He).set(l,h);const u=w(this,j,yl).call(this,c);return w(this,j,Uh).call(this,n,r,a,u),h}addHCMFilter(e,i){var b;const n=`${e}-${i}`,r="base";let a=s(this,j,Nh).get(r);if((a==null?void 0:a.key)===n||(a?((b=a.filter)==null||b.remove(),a.key=n,a.url="none",a.filter=null):(a={key:n,url:"none",filter:null},s(this,j,Nh).set(r,a)),!e||!i))return a.url;const l=w(this,j,$h).call(this,e);e=W.makeHexColor(...l);const c=w(this,j,$h).call(this,i);if(i=W.makeHexColor(...c),s(this,j,gl).style.color="",e==="#000000"&&i==="#ffffff"||e===i)return a.url;const h=new Array(256);for(let y=0;y<=255;y++){const v=y/255;h[y]=v<=.03928?v/12.92:((v+.055)/1.055)**2.4}const u=h.join(","),d=`g_${s(this,Fs)}_hcm_filter`,f=a.filter=w(this,j,yl).call(this,d);w(this,j,Uh).call(this,u,u,u,f),w(this,j,Dy).call(this,f);const m=(y,v)=>{const S=l[y]/255,x=c[y]/255,E=new Array(v+1);for(let C=0;C<=v;C++)E[C]=S+C/v*(x-S);return E.join(",")};return w(this,j,Uh).call(this,m(0,5),m(1,5),m(2,5),f),a.url=w(this,j,ml).call(this,d),a.url}addAlphaFilter(e){let i=s(this,j,He).get(e);if(i)return i;const[n]=w(this,j,tp).call(this,[e]),r=`alpha_${n}`;if(i=s(this,j,He).get(r),i)return s(this,j,He).set(e,i),i;const a=`g_${s(this,Fs)}_alpha_map_${ce(this,Ka)._++}`,l=w(this,j,ml).call(this,a);s(this,j,He).set(e,l),s(this,j,He).set(r,l);const c=w(this,j,yl).call(this,a);return w(this,j,Oy).call(this,n,c),l}addLuminosityFilter(e){let i=s(this,j,He).get(e||"luminosity");if(i)return i;let n,r;if(e?([n]=w(this,j,tp).call(this,[e]),r=`luminosity_${n}`):r="luminosity",i=s(this,j,He).get(r),i)return s(this,j,He).set(e,i),i;const a=`g_${s(this,Fs)}_luminosity_map_${ce(this,Ka)._++}`,l=w(this,j,ml).call(this,a);s(this,j,He).set(e,l),s(this,j,He).set(r,l);const c=w(this,j,yl).call(this,a);return w(this,j,_v).call(this,c),e&&w(this,j,Oy).call(this,n,c),l}addHighlightHCMFilter(e,i,n,r,a){var x;const l=`${i}-${n}-${r}-${a}`;let c=s(this,j,Nh).get(e);if((c==null?void 0:c.key)===l||(c?((x=c.filter)==null||x.remove(),c.key=l,c.url="none",c.filter=null):(c={key:l,url:"none",filter:null},s(this,j,Nh).set(e,c)),!i||!n))return c.url;const[h,u]=[i,n].map(w(this,j,$h).bind(this));let d=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),f=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),[m,b]=[r,a].map(w(this,j,$h).bind(this));f<d&&([d,f,m,b]=[f,d,b,m]),s(this,j,gl).style.color="";const y=(E,C,T)=>
14{const R=new Array(256),D=(f-d)/T,L=E/255,I=(C-E)/(255*T);let N=0;for(let F=0;F<=T;F++){const U=Math.round(d+F*D),Y=L+F*I;for(let $=N;$<=U;$++)R[$]=Y;N=U+1}for(let F=N;F<256;F++)R[F]=R[N-1];return R.join(",")},v=`g_${s(this,Fs)}_hcm_${e}_filter`,S=c.filter=w(this,j,yl).call(this,v);return w(this,j,Dy).call(this,S),w(this,j,Uh).call(this,y(m[0],b[0],5),y(m[1],b[1],5),y(m[2],b[2],5),S),c.url=w(this,j,ml).call(this,v),c.url}destroy(e=!1){var i,n,r,a;e&&((i=s(this,Ya))!=null&&i.size)||((n=s(this,Is))==null||n.parentNode.parentNode.remove(),p(this,Is,null),(r=s(this,Jl))==null||r.clear(),p(this,Jl,null),(a=s(this,Ya))==null||a.clear(),p(this,Ya,null),p(this,Ka,0))}}Xa=new WeakMap,Jl=new WeakMap,Is=new WeakMap,Fs=new WeakMap,Ge=new WeakMap,Ya=new WeakMap,Ka=new WeakMap,j=new WeakSet,He=function(){return s(this,Jl)||p(this,Jl,new Map)},Nh=function(){return s(this,Ya)||p(this,Ya,new Map)},gl=function(){if(!s(this,Is)){const e=s(this,Ge).createElement("div"),{style:i}=e;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const n=s(this,Ge).createElementNS(ys,"svg");n.setAttribute("width",0),n.setAttribute("height",0),p(this,Is,s(this,Ge).createElementNS(ys,"defs")),e.append(n),n.append(s(this,Is)),s(this,Ge).body.append(e)}return s(this,Is)},tp=function(e){if(e.length===1){const h=e[0],u=new Array(256);for(let f=0;f<256;f++)u[f]=h[f]/255;const d=u.join(",");return[d,d,d]}const[i,n,r]=e,a=new Array(256),l=new Array(256),c=new Array(256);for(let h=0;h<256;h++)a[h]=i[h]/255,l[h]=n[h]/255,c[h]=r[h]/255;return[a.join(","),l.join(","),c.join(",")]},ml=function(e){if(s(this,Xa)===void 0){p(this,Xa,"");const i=s(this,Ge).URL;i!==s(this,Ge).baseURI&&(Eg(i)?it('#createUrl: ignore "data:"-URL for performance reasons.'):p(this,Xa,Lw(i,"")))}return`url(${s(this,Xa)}#${e})`},_v=function(e){const i=s(this,Ge).createElementNS(ys,"feColorMatrix");i.setAttribute("type","matrix"),i.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(i)},Dy=function(e){const i=s(this,Ge).createElementNS(ys,"feColorMatrix");i.setAttribute("type","matrix"),i.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(i)},yl=function(e){const i=s(this,Ge).createElementNS(ys,"filter");return i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("id",e),s(this,j,gl).append(i),i},Bh=function(e,i,n){const r=s(this,Ge).createElementNS(ys,i);r.setAttribute("type","discrete"),r.setAttribute("tableValues",n),e.append(r)},Uh=function(e,i,n,r){const a=s(this,Ge).createElementNS(ys,"feComponentTransfer");r.append(a),w(this,j,Bh).call(this,a,"feFuncR",e),w(this,j,Bh).call(this,a,"feFuncG",i),w(this,j,Bh).call(this,a,"feFuncB",n)},Oy=function(e,i){const n=s(this,Ge).createElementNS(ys,"feComponentTransfer");i.append(n),w(this,j,Bh).call(this,n,"feFuncA",e)},$h=function(e){return s(this,j,gl).style.color=e,ef(getComputedStyle(s(this,j,gl)).getPropertyValue("color"))};class Ev{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.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(i=>{throw new Error(`Unable to load font data at: ${e}`)})}async _fetch(t){Ft("Abstract method `_fetch` called.")}}class gA extends Ev{async _fetch(t){const e=await Zd(t,"arraybuffer");return new Uint8Array(e)}}class xv{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.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(i=>{throw new Error(`Unable to load wasm data at: ${e}`)})}async _fetch(t){Ft("Abstract method `_fetch` called.")}}class mA extends xv{async _fetch(t){const e=await Zd(t,"arraybuffer");return new Uint8Array(e)}}ni&&it("Please use the `legacy` build in Node.js environments.");async function Zb(o){const e=await process.getBuiltinModule("fs").promises.readFile(o);return new Uint8Array(e)}class F1 extends Sv{}class N1 extends wv{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t,e)}}class B1 extends vv{async _fetch(t){return Zb(t)}}
14class U1 extends Ev{async _fetch(t){return Zb(t)}}class $1 extends xv{async _fetch(t){return Zb(t)}}const ul="__forcedDependency",{floor:yA,ceil:bA}=Math;function Lf(o,t,e,i,n,r){o[t*4+0]=Math.min(o[t*4+0],e),o[t*4+1]=Math.min(o[t*4+1],i),o[t*4+2]=Math.max(o[t*4+2],n),o[t*4+3]=Math.max(o[t*4+3],r)}const Ly=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];var Ql,Dr;class H1{constructor(t,e){A(this,Ql);A(this,Dr);p(this,Ql,t),p(this,Dr,e)}get length(){return s(this,Ql).length}isEmpty(t){return s(this,Ql)[t]===Ly}minX(t){return s(this,Dr)[t*4+0]/256}minY(t){return s(this,Dr)[t*4+1]/256}maxX(t){return(s(this,Dr)[t*4+2]+1)/256}maxY(t){return(s(this,Dr)[t*4+3]+1)/256}}Ql=new WeakMap,Dr=new WeakMap;const kf=(o,t)=>{if(!o)return;let e=o.get(t);return e||(e={dependencies:new Set,isRenderingOperation:!1},o.set(t,e)),e};var fi,pi,Ja,yn,Qa,Ns,Tt,Rt,Bs,gi,Bu,Zl,Za,to,Us,We,Yn,Uu,ky;class j1{constructor(t,e,i=!1){A(this,Uu);A(this,fi,{__proto__:null});A(this,pi,{__proto__:null,transform:[],moveText:[],sameLineText:[],[ul]:[]});A(this,Ja,new Map);A(this,yn,[]);A(this,Qa,[]);A(this,Ns,[[1,0,0,1,0,0]]);A(this,Tt,[-1/0,-1/0,1/0,1/0]);A(this,Rt,new Float64Array([1/0,1/0,-1/0,-1/0]));A(this,Bs,-1);A(this,gi,new Set);A(this,Bu,new Map);A(this,Zl,new Map);A(this,Za);A(this,to);A(this,Us);A(this,We);A(this,Yn);p(this,Za,t.width),p(this,to,t.height),w(this,Uu,ky).call(this,e),i&&p(this,Yn,new Map)}growOperationsCount(t){t>=s(this,We).length&&w(this,Uu,ky).call(this,t,s(this,We))}save(t){return p(this,fi,{__proto__:s(this,fi)}),p(this,pi,{__proto__:s(this,pi),transform:{__proto__:s(this,pi).transform},moveText:{__proto__:s(this,pi).moveText},sameLineText:{__proto__:s(this,pi).sameLineText},[ul]:{__proto__:s(this,pi)[ul]}}),p(this,Tt,{__proto__:s(this,Tt)}),s(this,yn).push(t),this}restore(t){var n;const e=Object.getPrototypeOf(s(this,fi));if(e===null)return this;p(this,fi,e),p(this,pi,Object.getPrototypeOf(s(this,pi))),p(this,Tt,Object.getPrototypeOf(s(this,Tt)));const i=s(this,yn).pop();return i!==void 0&&((n=kf(s(this,Yn),t))==null||n.dependencies.add(i),s(this,We)[t]=s(this,We)[i]),this}recordOpenMarker(t){return s(this,yn).push(t),this}getOpenMarker(){return s(this,yn).length===0?null:s(this,yn).at(-1)}recordCloseMarker(t){var i;const e=s(this,yn).pop();return e!==void 0&&((i=kf(s(this,Yn),t))==null||i.dependencies.add(e),s(this,We)[t]=s(this,We)[e]),this}beginMarkedContent(t){return s(this,Qa).push(t),this}endMarkedContent(t){var i;const e=s(this,Qa).pop();return e!==void 0&&((i=kf(s(this,Yn),t))==null||i.dependencies.add(e),s(this,We)[t]=s(this,We)[e]),this}pushBaseTransform(t){return s(this,Ns).push(W.multiplyByDOMMatrix(s(this,Ns).at(-1),t.getTransform())),this}popBaseTransform(){return s(this,Ns).length>1&&s(this,Ns).pop(),this}recordSimpleData(t,e){return s(this,fi)[t]=e,this}recordIncrementalData(t,e){return s(this,pi)[t].push(e),this}resetIncrementalData(t,e){return s(this,pi)[t].length=0,this}recordNamedData(t,e){return s(this,Ja).set(t,e),this}recordSimpleDataFromNamed(t,e,i){s(this,fi)[t]=s(this,Ja).get(e)??i}recordFutureForcedDependency(t,e){return this.recordIncrementalData(ul,e),this}inheritSimpleDataAsFutureForcedDependencies(t){for(const e of t)e in s(this,fi)&&this.recordFutureForcedDependency(e,s(this,fi)[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of s(this,gi))this.recordFutureForcedDependency(ul,t);return this}resetBBox(t){return s(this,Bs)!==t&&(p(this,Bs,t),s(this,Rt)[0]=1/0,s(this,Rt)[1]=1/0,s(this,Rt)[2]=-1/0,s(this,Rt)[3]=-1/0),this}recordClipBox(t,e,i,n,r,a){const l=W.multiplyByDOMMatrix(s(this,Ns).at(-1),e.getTransform()),c=[1/0,1/0,-1/0,-1/0];W.axialAlignedBoundingBox([i,r,n,a],l,c);const h=W.intersect(s(this,Tt),c);return h?(s(this,Tt)[0]=h[0],s(this,Tt)[1]=h[1],s(this,Tt)[2]=h[2],s(this,Tt)[3]=h[3]):(s(this,Tt)[0]=s(this,Tt)[1]=1/0,s(this,Tt)[2]=s(this,Tt)[3]=-1/0),this}recordBBox(t,e,i,n,r,a){const l=s(this,Tt);if(l[0]===1/0)return this;const c=W.multiplyByDOMMatrix(s(this,Ns).at(-1),e.getTransform());if(l[0]===-1/0)return W.axialAlignedBoundingBox([i,r,n,a],c,s(this,Rt)),this;const h=[1/0,1/0,-1/0,-1/0];return W.axialAlignedBoundingBox([i,r,n,a],c,h),s(this,Rt)[0]=Math.min(s(this,Rt)[0],Math.max(h[0],l[0])),s(this,Rt)[1]=Math.min(s(this,Rt)[1],Math.max(h[1],l[1])),s(this,Rt)[2]=Math.max(s(this,Rt)[2],Math.min(h[2],l[2])),s(this,Rt)[3]=Math.max(s(this,Rt)[3],Math.min(h[3],l[3])),this}recordCharacterBBox(t,e,i,n=1,r=0,a=0,l){const c=i.bbox;let h,u;if(c&&(h=c[2]!==c[0]&&c[3]!==c[1]&&s(this,Zl).get(i),h!==!1&&(u=[0,0,0,0],W.axialAlignedBoundingBox(c,i.fontMatrix,u),(n!==1||r!==0||a!==0)&&W.scaleMinMax([n,0,0,-n,r,a
14],u),h)))return this.recordBBox(t,e,u[0],u[2],u[1],u[3]);if(!l)return this.recordFullPageBBox(t);const d=l();return c&&u&&h===void 0&&(h=u[0]<=r-d.actualBoundingBoxLeft&&u[2]>=r+d.actualBoundingBoxRight&&u[1]<=a-d.actualBoundingBoxAscent&&u[3]>=a+d.actualBoundingBoxDescent,s(this,Zl).set(i,h),h)?this.recordBBox(t,e,u[0],u[2],u[1],u[3]):this.recordBBox(t,e,r-d.actualBoundingBoxLeft,r+d.actualBoundingBoxRight,a-d.actualBoundingBoxAscent,a+d.actualBoundingBoxDescent)}recordFullPageBBox(t){return s(this,Rt)[0]=Math.max(0,s(this,Tt)[0]),s(this,Rt)[1]=Math.max(0,s(this,Tt)[1]),s(this,Rt)[2]=Math.min(s(this,Za),s(this,Tt)[2]),s(this,Rt)[3]=Math.min(s(this,to),s(this,Tt)[3]),this}getSimpleIndex(t){return s(this,fi)[t]}recordDependencies(t,e){const i=s(this,gi),n=s(this,fi),r=s(this,pi);for(const a of e)a in s(this,fi)?i.add(n[a]):a in r&&r[a].forEach(i.add,i);return this}recordNamedDependency(t,e){return s(this,Ja).has(e)&&s(this,gi).add(s(this,Ja).get(e)),this}recordOperation(t,e=!1){if(this.recordDependencies(t,[ul]),s(this,Yn)){const i=kf(s(this,Yn),t),{dependencies:n}=i;s(this,gi).forEach(n.add,n),s(this,yn).forEach(n.add,n),s(this,Qa).forEach(n.add,n),n.delete(t),i.isRenderingOperation=!0}if(s(this,Bs)===t){const i=yA(s(this,Rt)[0]*256/s(this,Za)),n=yA(s(this,Rt)[1]*256/s(this,to)),r=bA(s(this,Rt)[2]*256/s(this,Za)),a=bA(s(this,Rt)[3]*256/s(this,to));Lf(s(this,Us),t,i,n,r,a);for(const l of s(this,gi))l!==t&&Lf(s(this,Us),l,i,n,r,a);for(const l of s(this,yn))l!==t&&Lf(s(this,Us),l,i,n,r,a);for(const l of s(this,Qa))l!==t&&Lf(s(this,Us),l,i,n,r,a);e||(s(this,gi).clear(),p(this,Bs,-1))}return this}recordShowTextOperation(t,e=!1){const i=Array.from(s(this,gi));this.recordOperation(t,e),this.recordIncrementalData("sameLineText",t);for(const n of i)this.recordIncrementalData("sameLineText",n);return this}bboxToClipBoxDropOperation(t,e=!1){return s(this,Bs)===t&&(p(this,Bs,-1),s(this,Tt)[0]=Math.max(s(this,Tt)[0],s(this,Rt)[0]),s(this,Tt)[1]=Math.max(s(this,Tt)[1],s(this,Rt)[1]),s(this,Tt)[2]=Math.min(s(this,Tt)[2],s(this,Rt)[2]),s(this,Tt)[3]=Math.min(s(this,Tt)[3],s(this,Rt)[3]),e||s(this,gi).clear()),this}_takePendingDependencies(){const t=s(this,gi);return p(this,gi,new Set),t}_extractOperation(t){const e=s(this,Bu).get(t);return s(this,Bu).delete(t),e}_pushPendingDependencies(t){for(const e of t)s(this,gi).add(e)}take(){return s(this,Zl).clear(),new H1(s(this,We),s(this,Us))}takeDebugMetadata(){return s(this,Yn)}}fi=new WeakMap,pi=new WeakMap,Ja=new WeakMap,yn=new WeakMap,Qa=new WeakMap,Ns=new WeakMap,Tt=new WeakMap,Rt=new WeakMap,Bs=new WeakMap,gi=new WeakMap,Bu=new WeakMap,Zl=new WeakMap,Za=new WeakMap,to=new WeakMap,Us=new WeakMap,We=new WeakMap,Yn=new WeakMap,Uu=new WeakSet,ky=function(t,e){const i=new ArrayBuffer(t*4);p(this,Us,new Uint8ClampedArray(i)),p(this,We,new Uint32Array(i)),e&&e.length>0?(s(this,We).set(e),s(this,We).fill(Ly,e.length)):s(this,We).fill(Ly)};var kt,Yt,bn,tc,ec;const o0=class o0{constructor(t,e,i){A(this,kt);A(this,Yt);A(this,bn);A(this,tc,0);A(this,ec,0);if(t instanceof o0&&s(t,bn)===!!i)return t;p(this,kt,t),p(this,Yt,e),p(this,bn,!!i)}growOperationsCount(){throw new Error("Unreachable")}save(t){return ce(this,ec)._++,s(this,kt).save(s(this,Yt)),this}restore(t){return s(this,ec)>0&&(s(this,kt).restore(s(this,Yt)),ce(this,ec)._--),this}recordOpenMarker(t){return ce(this,tc)._++,this}getOpenMarker(){return s(this,tc)>0?s(this,Yt):s(this,kt).getOpenMarker()}recordCloseMarker(t){return ce(this,tc)._--,this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return s(this,kt).pushBaseTransform(t),this}popBaseTransform(){return s(this,kt).popBaseTransform(),this}recordSimpleData(t,e){return s(this,kt).recordSimpleData(t,s(this,Yt)),this}recordIncrementalData(t,e){return s(this,kt).recordIncrementalData(t,s(this,Yt)),this}resetIncrementalData(t,e){return s(this,kt).resetIncrementalData(t,s(this,Yt)),this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,i){return s(this,kt).recordSimpleDataFromNamed(t,e,s(this,Yt)),this}recordFutureForcedDependency(t,e){return s(this,kt).recordFutureForcedDependency(t,s(this,Yt)),this}inheritSimpleDataAsFutureForcedDependencies(t){return s(this,kt).inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return s(this,kt).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return s(this,bn)||s(this,kt).resetBBox(s(this,Yt)),this}recordClipBox(t,e,i,n,r,a){return s(this,bn)||s(this,kt).recordClipBox(s(this,Yt),e,i,n,r,a),this}recordBBox(t,e,i,n,r,a){return s(this,bn)||s(this,kt).recordBBox(s(this,Yt),e,i,n,r,a),this}recordCharacterBBox(t,e,i,n,r,a,l){return s(this,bn)||s(this,kt).recordCharacterBBox(s(this,Yt),e,i,n,r,a,l),this}recordFullPageBBox(t){return s(this,bn)||s(this,kt).recordFullPageBBox(s(this,Yt)),this}getSimpleIndex(t){return s(this,kt).getSimpleIndex(t)}recordDependencies(t,e){return s(this,kt).recordDependencies(s(this,Yt),e),this}recordNamedDependency(t,e){return s(this,kt).recordNamedDependency(s(this,Yt),e),this}recordOperation(t){return s(this,kt).recordOperation(s(this,Yt),!0),this}recordShowTextOperation(t){return s(this,kt).recordShowTextOperation(s(this,Yt),!0),this}bboxToClipBoxDropOperation(t){return s(this,bn)||s(this,kt).bboxToClipBoxDropOperation(s(this,Yt),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}};kt=new WeakMap,Yt=new WeakMap,bn=new WeakMap,tc=new WeakMap,ec=new WeakMap;let Fp=o0;const Xi={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:["f
14ilter","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"]},ke={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function Iy(o,t){if(!t)return;const e=t[2]-t[0],i=t[3]-t[1],n=new Path2D;n.rect(t[0],t[1],e,i),o.clip(n)}class t0{isModifyingCurrentTransform(){return!1}getPattern(){Ft("Abstract method `getPattern` called.")}}class z1 extends t0{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}_createGradient(t){let e;this._type==="axial"?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,n){let r;if(n===ke.STROKE||n===ke.FILL){const a=e.current.getClippedPathBoundingBox(n,Vt(t))||[0,0,0,0],l=Math.ceil(a[2]-a[0])||1,c=Math.ceil(a[3]-a[1])||1,h=e.cachedCanvases.getCanvas("pattern",l,c),u=h.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-a[0],-a[1]),i=W.transform(i,[1,0,0,1,a[0],a[1]]),u.transform(...e.baseTransform),this.matrix&&u.transform(...this.matrix),Iy(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),r=t.createPattern(h.canvas,"no-repeat");const d=new DOMMatrix(i);r.setTransform(d)}else Iy(t,this._bbox),r=this._createGradient(t);return r}}function Gm(o,t,e,i,n,r,a,l){const c=t.coords,h=t.colors,u=o.data,d=o.width*4;let f;c[e+1]>c[i+1]&&(f=e,e=i,i=f,f=r,r=a,a=f),c[i+1]>c[n+1]&&(f=i,i=n,n=f,f=a,a=l,l=f),c[e+1]>c[i+1]&&(f=e,e=i,i=f,f=r,r=a,a=f);const m=(c[e]+t.offsetX)*t.scaleX,b=(c[e+1]+t.offsetY)*t.scaleY,y=(c[i]+t.offsetX)*t.scaleX,v=(c[i+1]+t.offsetY)*t.scaleY,S=(c[n]+t.offsetX)*t.scaleX,x=(c[n+1]+t.offsetY)*t.scaleY;if(b>=x)return;const E=h[r],C=h[r+1],T=h[r+2],R=h[a],D=h[a+1],L=h[a+2],I=h[l],N=h[l+1],F=h[l+2],U=Math.round(b),Y=Math.round(x);let $,Z,H,G,pt,ft,X,Zt;for(let gt=U;gt<=Y;gt++){if(gt<v){const bt=gt<b?0:(b-gt)/(b-v);$=m-(m-y)*bt,Z=E-(E-R)*bt,H=C-(C-D)*bt,G=T-(T-L)*bt}else{let bt;gt>x?bt=1:v===x?bt=0:bt=(v-gt)/(v-x),$=y-(y-S)*bt,Z=R-(R-I)*bt,H=D-(D-N)*bt,G=L-(L-F)*bt}let J;gt<b?J=0:gt>x?J=1:J=(b-gt)/(b-x),pt=m-(m-S)*J,ft=E-(E-I)*J,X=C-(C-N)*J,Zt=T-(T-F)*J;const Ut=Math.round(Math.min($,pt)),tt=Math.round(Math.max($,pt));let me=d*gt+Ut*4;for(let bt=Ut;bt<=tt;bt++)J=($-bt)/($-pt),J<0?J=0:J>1&&(J=1),u[me++]=Z-(Z-ft)*J|0,u[me++]=H-(H-X)*J|0,u[me++]=G-(G-Zt)*J|0,u[me++]=255}}function G1(o,t,e){const i=t.coords,n=t.colors;let r,a;switch(t.type){case"lattice":const l=t.verticesPerRow,c=Math.floor(i.length/l)-1,h=l-1;for(r=0;r<c;r++){let u=r*l;for(let d=0;d<h;d++,u++)Gm(o,e,i[u],i[u+1],i[u+l],n[u],n[u+1],n[u+l]),Gm(o,e,i[u+l+1],i[u+1],i[u+l],n[u+l+1],n[u+1],n[u+l])}break;case"triangles":for(r=0,a=i.length;r<a;r+=3)Gm(o,e,i[r],i[r+1],i[r+2],n[r],n[r+1],n[r+2]);break;default:throw new Error("illegal figure")}}class W1 extends t0{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,i){const l=Math.floor(this._bounds[0]),c=Math.floor(this._bounds[1]),h=Math.ceil(this._bounds[2])-l,u=Math.ceil(this._bounds[3])-c,d=Math.min(Math.ceil(Math.abs(h*t[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(u*t[1]*1.1)),3e3),m=h/d,b=u/f,y={coords:this._coords,colors:this._colors,offsetX:-l,offsetY:-c,scaleX:1/m,scaleY:1/b},v=d+2*2,S=f+2*2,x=i.getCanvas("mesh",v,S),E=x.context,C=E.createImageData(d,f);if(e){const R=C.data;for(let D=0,L=R.length;D<L;D+=4)R[D]=e[0],R[D+1]=e[1],R[D+2]=e[2],R[D+3]=255}for(const R of this._figures)G1(C,R,y);return E.putImageData(C,2,2),{canvas:x.canvas,offsetX:l-2*m,offsetY:c-2*b,scaleX:m,scaleY:b}}isModifyingCurrentTransform(){return!0}getPattern(t,e,i,n){Iy(t,this._bbox);const r=new Float32Array(2);if(n===ke.SHADING)W.singularValueDecompose2dScale(Vt(t),r);
14else if(this.matrix){W.singularValueDecompose2dScale(this.matrix,r);const[l,c]=r;W.singularValueDecompose2dScale(e.baseTransform,r),r[0]*=l,r[1]*=c}else W.singularValueDecompose2dScale(e.baseTransform,r);const a=this._createMeshCanvas(r,n===ke.SHADING?null:this._background,e.cachedCanvases);return n!==ke.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")}}class V1 extends t0{getPattern(){return"hotpink"}}function q1(o){switch(o[0]){case"RadialAxial":return new z1(o);case"Mesh":return new W1(o);case"Dummy":return new V1}throw new Error(`Unknown IR type: ${o[0]}`)}const AA={COLORED:1,UNCOLORED:2},Zp=class Zp{constructor(t,e,i,n){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=i,this.baseTransform=n}createPatternCanvas(t,e){var ft,X;const{bbox:i,operatorList:n,paintType:r,tilingType:a,color:l,canvasGraphicsFactory:c}=this;let{xstep:h,ystep:u}=this;h=Math.abs(h),u=Math.abs(u),_g("TilingType: "+a);const d=i[0],f=i[1],m=i[2],b=i[3],y=m-d,v=b-f,S=new Float32Array(2);W.singularValueDecompose2dScale(this.matrix,S);const[x,E]=S;
14W.singularValueDecompose2dScale(this.baseTransform,S);const C=x*S[0],T=E*S[1];let R=y,D=v,L=!1,I=!1;const N=Math.ceil(h*C),F=Math.ceil(u*T),U=Math.ceil(y*C),Y=Math.ceil(v*T);N>=U?R=h:L=!0,F>=Y?D=u:I=!0;const $=this.getSizeAndScale(R,this.ctx.canvas.width,C),Z=this.getSizeAndScale(D,this.ctx.canvas.height,T),H=t.cachedCanvases.getCanvas("pattern",$.size,Z.size),G=H.context,pt=c.createCanvasGraphics(G,e);if(pt.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(pt,r,l),G.translate(-$.scale*d,-Z.scale*f),pt.transform(0,$.scale,0,0,Z.scale,0,0),G.save(),(ft=pt.dependencyTracker)==null||ft.save(),this.clipBbox(pt,d,f,m,b),pt.baseTransform=Vt(pt.ctx),pt.executeOperatorList(n),pt.endDrawing(),(X=pt.dependencyTracker)==null||X.restore(),G.restore(),L||I){const Zt=H.canvas;L&&(R=h),I&&(D=u);const gt=this.getSizeAndScale(R,this.ctx.canvas.width,C),J=this.getSizeAndScale(D,this.ctx.canvas.height,T),Ut=gt.size,tt=J.size,me=t.cachedCanvases.getCanvas("pattern-workaround",Ut,tt),bt=me.context,at=L?Math.floor(y/h):0,Ye=I?Math.floor(v/u):0;for(let Ke=0;Ke<=at;Ke++)for(let ye=0;ye<=Ye;ye++)bt.drawImage(Zt,Ut*Ke,tt*ye,Ut,tt,0,0,Ut,tt);return{canvas:me.canvas,scaleX:gt.scale,scaleY:J.scale,offsetX:d,offsetY:f}}return{canvas:H.canvas,scaleX:$.scale,scaleY:Z.scale,offsetX:d,offsetY:f}}getSizeAndScale(t,e,i){const n=Math.max(Zp.MAX_PATTERN_SIZE,e);let r=Math.ceil(t*i);return r>=n?r=n:i=r/t,{scale:i,size:r}}clipBbox(t,e,i,n,r){const a=n-e,l=r-i;t.ctx.rect(e,i,a,l),W.axialAlignedBoundingBox([e,i,n,r],Vt(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,r=t.current;switch(e){case AA.COLORED:const{fillStyle:a,strokeStyle:l}=this.ctx;n.fillStyle=r.fillColor=a,n.strokeStyle=r.strokeColor=l;break;case AA.UNCOLORED:n.fillStyle=n.strokeStyle=i,r.fillColor=r.strokeColor=i;break;default:throw new a1(`Unsupported paint type: ${e}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,e,i,n,r){let a=i;n!==ke.SHADING&&(a=W.transform(a,e.baseTransform),this.matrix&&(a=W.transform(a,this.matrix)));const l=this.createPatternCanvas(e,r);let c=new DOMMatrix(a);c=c.translate(l.offsetX,l.offsetY),c=c.scale(1/l.scaleX,1/l.scaleY);const h=t.createPattern(l.canvas,"repeat");return h.setTransform(c),h}};k(Zp,"MAX_PATTERN_SIZE",3e3);let Fy=Zp;function X1({src:o,srcPos:t=0,dest:e,width:i,height:n,nonBlackColor:r=4294967295,inverseDecode:a=!1}){const l=Ne.isLittleEndian?4278190080:255,[c,h]=a?[r,l]:[l,r],u=i>>3,d=i&7,f=o.length;e=new Uint32Array(e.buffer);let m=0;for(let b=0;b<n;b++){for(const v=t+u;t<v;t++){const S=t<f?o[t]:255;e[m++]=S&128?h:c,e[m++]=S&64?h:c,e[m++]=S&32?h:c,e[m++]=S&16?h:c,e[m++]=S&8?h:c,e[m++]=S&4?h:c,e[m++]=S&2?h:c,e[m++]=S&1?h:c}if(d===0)continue;const y=t<f?o[t++]:255;for(let v=0;v<d;v++)e[m++]=y&1<<7-v?h:c}return{srcPos:t,destPos:m}}const wA=16,vA=100,Y1=15,SA=10,Ai=16,Wm=new DOMMatrix,Hi=new Float32Array(2),Sl=new Float32Array([1/0,1/0,-1/0,-1/0]);function K1(o,t){if(o._removeMirroring)throw new Error("Context is already forwarding operations.");o.__originalSave=o.save,o.__originalRestore=o.restore,o.__originalRotate=o.rotate,o.__originalScale=o.scale,o.__originalTranslate=o.translate,o.__originalTransform=o.transform,o.__originalSetTransform=o.setTransform,o.__originalResetTransform=o.resetTransform,o.__originalClip=o.clip,o.__originalMoveTo=o.moveTo,o.__originalLineTo=o.lineTo,o.__originalBezierCurveTo=o.bezierCurveTo,o.__originalRect=o.rect,o.__originalClosePath=o.closePath,o.__originalBeginPath=o.beginPath,o._removeMirroring=()=>{o.save=o.__originalSave,o.restore=o.__originalRestore,o.rotate=o.__originalRotate,o.scale=o.__originalScale,o.translate=o.__originalTranslate,o.transform=o.__originalTransform,o.setTransform=o.__originalSetTransform,o.resetTransform=o.__originalResetTransform,o.clip=o.__originalClip,o.moveTo=o.__originalMoveTo,o.lineTo=o.__originalLineTo,o.bezierCurveTo=o.__originalBezierCurveTo,o.rect=o.__originalRect,o.closePath=o.__originalClosePath,o.beginPath=o.__originalBeginPath,delete o._removeMirroring},o.save=function(){t.save(),this.__originalSave()}
14,o.restore=function(){t.restore(),this.__originalRestore()},o.translate=function(e,i){t.translate(e,i),this.__originalTranslate(e,i)},o.scale=function(e,i){t.scale(e,i),this.__originalScale(e,i)},o.transform=function(e,i,n,r,a,l){t.transform(e,i,n,r,a,l),this.__originalTransform(e,i,n,r,a,l)},o.setTransform=function(e,i,n,r,a,l){t.setTransform(e,i,n,r,a,l),this.__originalSetTransform(e,i,n,r,a,l)},o.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},o.rotate=function(e){t.rotate(e),this.__originalRotate(e)},o.clip=function(e){t.clip(e),this.__originalClip(e)},o.moveTo=function(e,i){t.moveTo(e,i),this.__originalMoveTo(e,i)},o.lineTo=function(e,i){t.lineTo(e,i),this.__originalLineTo(e,i)},o.bezierCurveTo=function(e,i,n,r,a,l){t.bezierCurveTo(e,i,n,r,a,l),this.__originalBezierCurveTo(e,i,n,r,a,l)},o.rect=function(e,i,n,r){t.rect(e,i,n,r),this.__originalRect(e,i,n,r)},o.closePath=function(){t.closePath(),this.__originalClosePath()},o.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class J1{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let n;return this.cache[t]!==void 0?(n=this.cache[t],this.canvasFactory.reset(n,e,i)):(n=this.canvasFactory.create(e,i),this.cache[t]=n),n}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function If(o,t,e,i,n,r,a,l,c,h){const[u,d,f,m,b,y]=Vt(o);if(d===0&&f===0){const x=a*u+b,E=Math.round(x),C=l*m+y,T=Math.round(C),R=(a+c)*u+b,D=Math.abs(Math.round(R)-E)||1,L=(l+h)*m+y,I=Math.abs(Math.round(L)-T)||1;return o.setTransform(Math.sign(u),0,0,Math.sign(m),E,T),o.drawImage(t,e,i,n,r,0,0,D,I),o.setTransform(u,d,f,m,b,y),[D,I]}if(u===0&&m===0){const x=l*f+b,E=Math.round(x),C=a*d+y,T=Math.round(C),R=(l+h)*f+b,D=Math.abs(Math.round(R)-E)||1,L=(a+c)*d+y,I=Math.abs(Math.round(L)-T)||1;return o.setTransform(0,Math.sign(d),Math.sign(f),0,E,T),o.drawImage(t,e,i,n,r,0,0,I,D),o.setTransform(u,d,f,m,b,y),[I,D]}o.drawImage(t,e,i,n,r,a,l,c,h);const v=Math.hypot(u,d),S=Math.hypot(f,m);return[v*c,S*h]}class _A{constructor(t,e,i){k(this,"alphaIsShape",!1);k(this,"fontSize",0);k(this,"fontSizeScale",1);k(this,"textMatrix",null);k(this,"textMatrixScale",1);k(this,"fontMatrix",ay);k(this,"leading",0);k(this,"x",0);k(this,"y",0);k(this,"lineX",0);k(this,"lineY",0);k(this,"charSpacing",0);k(this,"wordSpacing",0);k(this,"textHScale",1);k(this,"textRenderingMode",Pe.FILL);k(this,"textRise",0);k(this,"fillColor","#000000");k(this,"strokeColor","#000000");k(this,"patternFill",!1);k(this,"patternStroke",!1);k(this,"fillAlpha",1);k(this,"strokeAlpha",1);k(this,"lineWidth",1);k(this,"activeSMask",null);k(this,"transferMaps","none");i==null||i(this),this.clipBox=new Float32Array([0,0,t,e]),this.minMax=Sl.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=ke.FILL,e=null){const i=this.minMax.slice();if(t===ke.STROKE){e||Ft("Stroke bounding box must include transform."),W.singularValueDecompose2dScale(e,Hi);const n=Hi[0]*this.lineWidth/2,r=Hi[1]*this.lineWidth/2;i[0]-=n,i[1]-=r,i[2]+=n,i[3]+=r}return i}updateClipFromPath(){const t=W.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(Sl,0)}getClippedPathBoundingBox(t=ke.FILL,e=null){return W.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function EA(o,t){if(t instanceof ImageData){o.putImageData(t,0,0);return}const e=t.height,i=t.width,n=e%Ai,r=(e-n)/Ai,a=n===0?r:r+1,l=o.createImageData(i,Ai);let c=0,h;const u=t.data,d=l.data;let f,m,b,y;if(t.kind===Vf.GRAYSCALE_1BPP){const v=u.byteLength,S=new Uint32Array(d.buffer,0,d.byteLength>>2),x=S.length,E=i+7>>3,C=4294967295,T=Ne.isLittleEndian?4278190080:255;for(f=0;f<a;f++){for(b=f<r?Ai:n,h=0,m=0;m<b;m++){const R=v-c;let D=0;const L=R>E?i:R*8-7,I=L&-8;let N=0,F=0;for(;D<I;D+=8)F=u[c++],S[h++]=F&128?C:T,S[h++]=F&64?C:T,S[h++]=F&32?C:T,S[h++]=F&16?C:T,S[h++]=F&8?C:T,S[h++]=F&4?C:T,S[h++]=F&2?C:T,S[h++]=F&1?C:T;for(;D<L;D++)N===0&&(F=u[c++],N=128),S[h++]=F&N?C:T,N>>=1}for(;h<x;)S[h++]=0;o.putImageData(l,0,f*Ai)}}else if(t.kind===Vf.RGBA_32BPP){for(m=0,y=i*Ai*4,f=0;f<r;f++)d.set(u.subarray(c,c+y)),c+=y,o.putImageData(l,0,m),m+=Ai;f<a&&(y=i*n*4,d.set(u.subarray(c,c+y)),o.putImageData(l,0,m))}else if(t.kind===Vf.RGB_24BPP)for(b=Ai,y=i*b,f=0;f<a;f++){for(f>=r&&(b=n,y=i*b),h=0,m=y;m--;)d[h++]=u[c++],d[h++]=u[c++],d[h++]=u[c++],d[h++]=255;o.putImageData(l,0,f*Ai)}else throw new Error(`bad image kind: ${t.kind}`)}function xA(o,t){if(t.bitmap){o.drawImage(t.bitmap,0,0);return}const e=t.height,i=t.width,n=e%Ai,r=(e-n)/Ai,a=n===0?r:r+1,l=o.createImageData(i,Ai);let c=0;const h=t.data,u=l.data;for(let d=0;d<a;d++){const f=d<r?Ai:n;({srcPos:c}=X1({src:h,srcPos:c,dest:u,width:i,height:f,nonBlackColor:0})),o.putImageData(l,0,d*Ai)}}function xh(o,t){const e=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of e)o[i]!==void 0&&(t[i]=o[i]);o.setLineDash!==void 0&&(t.setLineDash(o.getLineDash()),t.lineDashOffset=o.lineDashOffset)}function Ff(o){o.strokeStyle=o.fillStyle="#000000",o.fillRule="nonzero",o.globalAlpha=1,o.lineWidth=1,o.lineCap="butt",o.lineJoin="miter",o.miterLimit=10,o.globalCompositeOperation="source-over",o.font="10px sans-serif",o.setLineDash!==void 0&&(o.setLineDash([]),o.lineDashOffset=0);const{filter:t}=o;t!=="none"&&t!==""&&(o.filter="none")}function CA(o,t){if(t)return!0;W.singularValueDecompose2dScale(o,Hi);const e=Math.fround(hs.pixelRatio*ca.PDF_TO_CSS_UNITS);return Hi[0]<=e&&Hi[1]<=e}const Q1=["butt","round","square"],Z1=["miter","round","bevel"],tP={},TA={};var Pn,Ny,By,Uy;const l0=class l0{constructor(t,e,i,n,r,{optionalContentConfig:a,markedContentStack:l=null},c,h,u){A(this,Pn);
14this.ctx=t,this.current=new _A(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=i,this.canvasFactory=n,this.filterFactory=r,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=l||[],this.optionalContentConfig=a,this.cachedCanvases=new J1(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=c,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=h,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=u??null}getObject(t,e,i=null){var n;return typeof e=="string"?((n=this.dependencyTracker)==null||n.recordNamedDependency(t,e),e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e)):i}beginDrawing({transform:t,viewport:e,transparency:i=!1,background:n=null}){const r=this.ctx.canvas.width,a=this.ctx.canvas.height,l=this.ctx.fillStyle;if(this.ctx.fillStyle=n||"#ffffff",this.ctx.fillRect(0,0,r,a),this.ctx.fillStyle=l,i){const c=this.cachedCanvases.getCanvas("transparent",r,a);this.compositeCtx=this.ctx,this.transparentCanvas=c.canvas,this.ctx=c.context,this.ctx.save(),this.ctx.transform(...Vt(this.compositeCtx))}this.ctx.save(),Ff(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=Vt(this.ctx)}executeOperatorList(t,e,i,n,r){var S;const a=t.argsArray,l=t.fnArray;let c=e||0;const h=a.length;if(h===c)return c;const u=h-c>SA&&typeof i=="function",d=u?Date.now()+Y1:0;let f=0;const m=this.commonObjs,b=this.objs;let y,v;for(;;){if(n!==void 0&&c===n.nextBreakPoint)return n.breakIt(c,i),c;if(!r||r(c))if(y=l[c],v=a[c]??null,y!==ru.dependency)v===null?this[y](c):this[y](c,...v);else for(const x of v){(S=this.dependencyTracker)==null||S.recordNamedData(x,c);const E=x.startsWith("g_")?m:b;if(!E.has(x))return E.get(x,i),c}if(c++,c===h)return c;if(u&&++f>SA){if(Date.now()>d)return i(),c;f=0}}}endDrawing(){w(this,Pn,Ny).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),w(this,Pn,By).call(this)}
vendor: 5,054 bytes, line 14
14_scaleImage(t,e){const i=t.width??t.displayWidth,n=t.height??t.displayHeight;let r=Math.max(Math.hypot(e[0],e[1]),1),a=Math.max(Math.hypot(e[2],e[3]),1),l=i,c=n,h="prescale1",u,d;for(;r>2&&l>1||a>2&&c>1;){let f=l,m=c;r>2&&l>1&&(f=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),r/=l/f),a>2&&c>1&&(m=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,a/=c/m),u=this.cachedCanvases.getCanvas(h,f,m),d=u.context,d.clearRect(0,0,f,m),d.drawImage(t,0,0,l,c,0,0,f,m),t=u.canvas,l=f,c=m,h=h==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t,e){var N,F;const i=this.ctx,{width:n,height:r}=e,a=this.current.fillColor,l=this.current.patternFill,c=Vt(i);let h,u,d,f;if((e.bitmap||e.data)&&e.count>1){const U=e.bitmap||e.data.buffer;u=JSON.stringify(l?c:[c.slice(0,4),a]),h=this._cachedBitmapsMap.get(U),h||(h=new Map,this._cachedBitmapsMap.set(U,h));const Y=h.get(u);if(Y&&!l){const $=Math.round(Math.min(c[0],c[2])+c[4]),Z=Math.round(Math.min(c[1],c[3])+c[5]);return(N=this.dependencyTracker)==null||N.recordDependencies(t,Xi.transformAndFill),{canvas:Y,offsetX:$,offsetY:Z}}d=Y}d||(f=this.cachedCanvases.getCanvas("maskCanvas",n,r),xA(f.context,e));let m=W.transform(c,[1/n,0,0,-1/r,0,0]);m=W.transform(m,[1,0,0,1,0,-r]);const b=Sl.slice();W.axialAlignedBoundingBox([0,0,n,r],m,b);const[y,v,S,x]=b,E=Math.round(S-y)||1,C=Math.round(x-v)||1,T=this.cachedCanvases.getCanvas("fillCanvas",E,C),R=T.context,D=y,L=v;R.translate(-D,-L),R.transform(...m),d||(d=this._scaleImage(f.canvas,In(R)),d=d.img,h&&l&&h.set(u,d)),R.imageSmoothingEnabled=CA(Vt(R),e.interpolate),If(R,d,0,0,d.width,d.height,0,0,n,r),R.globalCompositeOperation="source-in";const I=W.transform(In(R),[1,0,0,1,-D,-L]);return R.fillStyle=l?a.getPattern(i,this,I,ke.FILL,t):a,R.fillRect(0,0,n,r),h&&!l&&(this.cachedCanvases.delete("fillCanvas"),h.set(u,T.canvas)),(F=this.dependencyTracker)==null||F.recordDependencies(t,Xi.transformAndFill),{canvas:T.canvas,offsetX:Math.round(D),offsetY:Math.round(L)}}setLineWidth(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("lineWidth",t),e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("lineCap",t),this.ctx.lineCap=Q1[e]}setLineJoin(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("lineJoin",t),this.ctx.lineJoin=Z1[e]}setMiterLimit(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("miterLimit",t),this.ctx.miterLimit=e}setDash(t,e,i){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("dash",t);const n=this.ctx;n.setLineDash!==void 0&&(n.setLineDash(e),n.lineDashOffset=i)}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){var i,n,r,a,l;for(const[c,h]of e)switch(c){case"LW":this.setLineWidth(t,h);break;case"LC":this.setLineCap(t,h);break;case"LJ":this.setLineJoin(t,h);break;case"ML":this.setMiterLimit(t,h);break;case"D":this.setDash(t,h[0],h[1]);break;case"RI":this.setRenderingIntent(t,h);break;case"FL":this.setFlatness(t,h);break;case"Font":this.setFont(t,h[0],h[1]);break;case"CA":(i=this.dependencyTracker)==null||i.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=h;break;case"ca":(n=this.dependencyTracker)==null||n.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=h;break;case"BM":(r=this.dependencyTracker)==null||r.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=h;break;case"SMask":(a=this.dependencyTracker)==null||a.recordSimpleData("SMask",t),this.current.activeSMask=h?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":(l=this.dependencyTracker)==null||l.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(h);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const 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");const e=this.ctx.canvas.width,i=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(n,e,i);this.suspendedCtx=this.ctx;const a=this.ctx=r.context;a.setTransform(this.suspendedCtx.getTransform()),xh(this.suspendedCtx,a),K1(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(),xh(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];const e=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,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(
14)}composeSMask(t,e,i,n){const r=n[0],a=n[1],l=n[2]-r,c=n[3]-a;l===0||c===0||(this.genericComposeSMask(e.context,i,l,c,e.subtype,e.backdrop,e.transferMap,r,a,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,e,i,n,r,a,l,c,h,u,d){let f=t.canvas,m=c-u,b=h-d;if(a)if(m<0||b<0||m+i>f.width||b+n>f.height){const v=this.cachedCanvases.getCanvas("maskExtension",i,n),S=v.context;S.drawImage(f,-m,-b),S.globalCompositeOperation="destination-atop",S.fillStyle=a,S.fillRect(0,0,i,n),S.globalCompositeOperation="source-over",f=v.canvas,m=b=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const v=new Path2D;v.rect(m,b,i,n),t.clip(v),t.globalCompositeOperation="destination-atop",t.fillStyle=a,t.fillRect(m,b,i,n),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),r==="Alpha"&&l?e.filter=this.filterFactory.addAlphaFilter(l):r==="Luminosity"&&(e.filter=this.filterFactory.addLuminosityFilter(l));const y=new Path2D;y.rect(c,h,i,n),e.clip(y),e.globalCompositeOperation="destination-in",e.drawImage(f,m,b,i,n,c,h,i,n),e.restore()}save(t){var i;this.inSMaskMode&&xh(this.ctx,this.suspendedCtx),this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone(),(i=this.dependencyTracker)==null||i.save(t)}restore(t){var e;if((e=this.dependencyTracker)==null||e.restore(t),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&xh(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(t,e,i,n,r,a,l){var c;(c=this.dependencyTracker)==null||c.recordIncrementalData("transform",t),this.ctx.transform(e,i,n,r,a,l),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i,n){let[r]=i;if(!n){r||(r=i[0]=new Path2D),this[e](t,r);return}if(this.dependencyTracker!==null){const a=e===ru.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,n[0]-a,n[2]+a,n[1]-a,n[3]+a).recordDependencies(t,["transform"])}if(!(r instanceof Path2D)){const a=i[0]=new Path2D;for(let l=0,c=r.length;l<c;)switch(r[l++]){case Rf.moveTo:a.moveTo(r[l++],r[l++]);break;case Rf.lineTo:a.lineTo(r[l++],r[l++]);break;case Rf.curveTo:a.bezierCurveTo(r[l++],r[l++],r[l++],r[l++],r[l++],r[l++]);break;case Rf.closePath:a.closePath();break;default:it(`Unrecognized drawing path operator: ${r[l-1]}`);break}r=a}W.axialAlignedBoundingBox(n,Vt(this.ctx),this.current.minMax),this[e](t,r),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,e,i=!0){var a;const n=this.ctx,r=this.current.strokeColor;if(n.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof r=="object"&&(r!=null&&r.getPattern)){const l=r.isModifyingCurrentTransform()?n.getTransform():null;if(n.save(),n.strokeStyle=r.getPattern(n,this,In(n),ke.STROKE,t),l){const c=new Path2D;c.addPath(e,n.getTransform().invertSelf().multiplySelf(l)),e=c}this.rescaleAndStroke(e,!1),n.restore()}else this.rescaleAndStroke(e,!0);(a=this.dependencyTracker)==null||a.recordDependencies(t,Xi.stroke),i&&this.consumePath(t,e,this.current.getClippedPathBoundingBox(ke.STROKE,Vt(this.ctx))),n.globalAlpha=this.current.fillAlpha}closeStroke(t,e){this.stroke(t,e)}fill(t,e,i=!0){var h,u,d;const n=this.ctx,r=this.current.fillColor,a=this.current.patternFill;let l=!1;if(a){const f=r.isModifyingCurrentTransform()?n.getTransform():null;if((h=this.dependencyTracker)==null||h.save(t),n.save(),n.fillStyle=r.getPattern(n,this,In(n),ke.FILL,t),f){const m=new Path2D;m.addPath(e,n.getTransform().invertSelf().multiplySelf(f)),e=m}l=!0}const c=this.current.getClippedPathBoundingBox();this.contentVisible&&c!==null&&(this.pendingEOFill?(n.fill(e,"evenodd"),this.pendingEOFill=!1):n.fill(e)),(u=this.dependencyTracker)==null||u.recordDependencies(t,Xi.fill),l&&(n.restore(),(d=this.dependencyTracker)==null||d.restore(t)),i&&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){var i;this.ctx.fill(e),(i=this.dependencyTracker)==null||i.recordDependencies(t,Xi.rawFillPath).recordOperation(t)}clip(t){var e;(e=this.dependencyTracker)==null||e.recordFutureForcedDependency("clipMode",t),this.pendingClip=tP}eoClip(t){var e;(e=this.dependencyTracker)==null||e.recordFutureForcedDependency("clipMode",t),this.pendingClip=TA}beginText(t){var e;this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,
14(e=this.dependencyTracker)==null||e.recordOpenMarker(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){const e=this.pendingTextPaths,i=this.ctx;if(this.dependencyTracker){const{dependencyTracker:n}=this;e!==void 0&&n.recordFutureForcedDependency("textClip",n.getOpenMarker()).recordFutureForcedDependency("textClip",t),n.recordCloseMarker(t)}if(e!==void 0){const n=new Path2D,r=i.getTransform().invertSelf();for(const{transform:a,x:l,y:c,fontSize:h,path:u}of e)u&&n.addPath(u,new DOMMatrix(a).preMultiplySelf(r).translate(l,c).scale(h,-h));i.clip(n)}delete this.pendingTextPaths}setCharSpacing(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("charSpacing",t),this.current.charSpacing=e}setWordSpacing(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("wordSpacing",t),this.current.wordSpacing=e}setHScale(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("hScale",t),this.current.textHScale=e/100}setLeading(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("leading",t),this.current.leading=-e}setFont(t,e,i){var d,f;(d=this.dependencyTracker)==null||d.recordSimpleData("font",t).recordSimpleDataFromNamed("fontObj",e,t);const n=this.commonObjs.get(e),r=this.current;if(!n)throw new Error(`Can't find font for ${e}`);if(r.fontMatrix=n.fontMatrix||ay,(r.fontMatrix[0]===0||r.fontMatrix[3]===0)&&it("Invalid font matrix for font "+e),i<0?(i=-i,r.fontDirection=-1):r.fontDirection=1,this.current.font=n,this.current.fontSize=i,n.isType3Font)return;const a=n.loadedName||"sans-serif",l=((f=n.systemFontInfo)==null?void 0:f.css)||`"${a}", ${n.fallbackName}`;let c="normal";n.black?c="900":n.bold&&(c="bold");const h=n.italic?"italic":"normal";let u=i;i<wA?u=wA:i>vA&&(u=vA),this.current.fontSizeScale=i/u,this.ctx.font=`${h} ${c} ${u}px ${l}`}setTextRenderingMode(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=e}setTextRise(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("textRise",t),this.current.textRise=e}moveText(t,e,i){var n;(n=this.dependencyTracker)==null||n.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=i}setLeadingMoveText(t,e,i){this.setLeading(t,-i),this.moveText(t,e,i)}setTextMatrix(t,e){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("textMatrix",t);const{current:i}=this;i.textMatrix=e,i.textMatrixScale=Math.hypot(e[0],e[1]),i.x=i.lineX=0,i.y=i.lineY=0}nextLine(t){var e;this.moveText(t,0,this.current.leading),(e=this.dependencyTracker)==null||e.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??t)}paintChar(t,e,i,n,r,a){var S,x,E,C;const l=this.ctx,c=this.current,h=c.font,u=c.textRenderingMode,d=c.fontSize/c.fontSizeScale,f=u&Pe.FILL_STROKE_MASK,m=!!(u&Pe.ADD_TO_PATH_FLAG),b=c.patternFill&&!h.missingFile,y=c.patternStroke&&!h.missingFile;let v;if((h.disableFontFace||m||b||y)&&!h.missingFile&&(v=h.getPathGenerator(this.commonObjs,e)),v&&(h.disableFontFace||b||y)){l.save(),l.translate(i,n),l.scale(d,-d),(S=this.dependencyTracker)==null||S.recordCharacterBBox(t,l,h);let T;if(f===Pe.FILL||f===Pe.FILL_STROKE)if(r){T=l.getTransform(),l.setTransform(...r);const R=w(this,Pn,Uy).call(this,v,T,r);l.fill(R)}else l.fill(v);
14if(f===Pe.STROKE||f===Pe.FILL_STROKE)if(a){T||(T=l.getTransform()),l.setTransform(...a);const{a:R,b:D,c:L,d:I}=T,N=W.inverseTransform(a),F=W.transform([R,D,L,I,0,0],N);W.singularValueDecompose2dScale(F,Hi),l.lineWidth*=Math.max(Hi[0],Hi[1])/d,l.stroke(w(this,Pn,Uy).call(this,v,T,a))}else l.lineWidth/=d,l.stroke(v);l.restore()}else(f===Pe.FILL||f===Pe.FILL_STROKE)&&(l.fillText(e,i,n),(x=this.dependencyTracker)==null||x.recordCharacterBBox(t,l,h,d,i,n,()=>l.measureText(e))),(f===Pe.STROKE||f===Pe.FILL_STROKE)&&(this.dependencyTracker&&((E=this.dependencyTracker)==null||E.recordCharacterBBox(t,l,h,d,i,n,()=>l.measureText(e)).recordDependencies(t,Xi.stroke)),l.strokeText(e,i,n));m&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Vt(l),x:i,y:n,fontSize:d,path:v}),(C=this.dependencyTracker)==null||C.recordCharacterBBox(t,l,h,d,i,n))}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let n=3;n<e.length;n+=4)if(e[n]>0&&e[n]<255){i=!0;break}return ht(this,"isFontSubpixelAAEnabled",i)}showText(t,e){var L,I,N,F;this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,Xi.showText).resetBBox(t),this.current.textRenderingMode&Pe.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());const i=this.current,n=i.font;if(n.isType3Font){this.showType3Text(t,e),(L=this.dependencyTracker)==null||L.recordShowTextOperation(t);return}const r=i.fontSize;if(r===0){(I=this.dependencyTracker)==null||I.recordOperation(t);return}const a=this.ctx,l=i.fontSizeScale,c=i.charSpacing,h=i.wordSpacing,u=i.fontDirection,d=i.textHScale*u,f=e.length,m=n.vertical,b=m?1:-1,y=n.defaultVMetrics,v=r*i.fontMatrix[0],S=i.textRenderingMode===Pe.FILL&&!n.disableFontFace&&!i.patternFill;a.save(),i.textMatrix&&a.transform(...i.textMatrix),a.translate(i.x,i.y+i.textRise),u>0?a.scale(d,-1):a.scale(d,1);let x,E;if(i.patternFill){a.save();const U=i.fillColor.getPattern(a,this,In(a),ke.FILL,t);x=Vt(a),a.restore(),a.fillStyle=U}if(i.patternStroke){a.save();const U=i.strokeColor.getPattern(a,this,In(a),ke.STROKE,t);E=Vt(a),a.restore(),a.strokeStyle=U}let C=i.lineWidth;const T=i.textMatrixScale;if(T===0||C===0){const U=i.textRenderingMode&Pe.FILL_STROKE_MASK;(U===Pe.STROKE||U===Pe.FILL_STROKE)&&(C=this.getSinglePixelWidth())}else C/=T;if(l!==1&&(a.scale(l,l),C/=l),a.lineWidth=C,n.isInvalidPDFjsFont){const U=[];let Y=0;for(const Z of e)U.push(Z.unicode),Y+=Z.width;const $=U.join("");if(a.fillText($,0,0),this.dependencyTracker!==null){const Z=a.measureText($);this.dependencyTracker.recordBBox(t,this.ctx,-Z.actualBoundingBoxLeft,Z.actualBoundingBoxRight,-Z.actualBoundingBoxAscent,Z.actualBoundingBoxDescent).recordShowTextOperation(t)}i.x+=Y*v*d,a.restore(),this.compose();return}let R=0,D;for(D=0;D<f;++D){const U=e[D];if(typeof U=="number"){R+=b*U*r/1e3;continue}let Y=!1;const $=(U.isSpace?h:0)+c,Z=U.fontChar,H=U.accent;let G,pt,ft=U.width;if(m){const gt=U.vmetric||y,J=-(U.vmetric?gt[1]:ft*.5)*v,Ut=gt[2]*v;ft=gt?-gt[0]:ft,G=J/l,pt=(R+Ut)/l}else G=R/l,pt=0;let X;if(n.remeasure&&ft>0){X=a.measureText(Z);const gt=X.width*1e3/r*l;if(ft<gt&&this.isFontSubpixelAAEnabled){const J=ft/gt;Y=!0,a.save(),a.scale(J,1),G/=J}else ft!==gt&&(G+=(ft-gt)/2e3*r/l)}if(this.contentVisible&&(U.isInFont||n.missingFile)){if(S&&!H)a.fillText(Z,G,pt),(N=this.dependencyTracker)==null||N.recordCharacterBBox(t,a,X?{bbox:null}:n,r/l,G,pt,()=>X??a.measureText(Z));else if(this.paintChar(t,Z,G,pt,x,E),H){const gt=G+r*H.offset.x/l,J=pt-r*H.offset.y/l;this.paintChar(t,H.fontChar,gt,J,x,E)}}
14const Zt=m?ft*v-$*u:ft*v+$*u;R+=Zt,Y&&a.restore()}m?i.y-=R:i.x+=R*d,a.restore(),this.compose(),(F=this.dependencyTracker)==null||F.recordShowTextOperation(t)}showType3Text(t,e){const i=this.ctx,n=this.current,r=n.font,a=n.fontSize,l=n.fontDirection,c=r.vertical?1:-1,h=n.charSpacing,u=n.wordSpacing,d=n.textHScale*l,f=n.fontMatrix||ay,m=e.length,b=n.textRenderingMode===Pe.INVISIBLE;let y,v,S,x;if(b||a===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),n.textMatrix&&i.transform(...n.textMatrix),i.translate(n.x,n.y+n.textRise),i.scale(d,l);const E=this.dependencyTracker;for(this.dependencyTracker=E?new Fp(E,t):null,y=0;y<m;++y){if(v=e[y],typeof v=="number"){x=c*v*a/1e3,this.ctx.translate(x,0),n.x+=x*d;continue}const C=(v.isSpace?u:0)+h,T=r.charProcOperatorList[v.operatorListId];T?this.contentVisible&&(this.save(),i.scale(a,a),i.transform(...f),this.executeOperatorList(T),this.restore()):it(`Type3 character "${v.operatorListId}" is not available.`);const R=[v.width,0];W.applyTransform(R,f),S=R[0]*a+C,i.translate(S,0),n.x+=S*d}i.restore(),E&&(this.dependencyTracker=E)}setCharWidth(t,e,i){}
14setCharWidthAndBounds(t,e,i,n,r,a,l){var h;const c=new Path2D;c.rect(n,r,a-n,l-r),this.ctx.clip(c),(h=this.dependencyTracker)==null||h.recordBBox(t,this.ctx,n,a,r,l).recordClipBox(t,this.ctx,n,a,r,l),this.endPath(t)}getColorN_Pattern(t,e){let i;if(e[0]==="TilingPattern"){const n=this.baseTransform||Vt(this.ctx),r={createCanvasGraphics:(a,l)=>new l0(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new Fp(this.dependencyTracker,l,!0):null)};i=new Fy(e,this.ctx,r,n)}else i=this._getPattern(t,e[1],e[2]);return i}setStrokeColorN(t,...e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("strokeColor",t),this.current.strokeColor=this.getColorN_Pattern(t,e),this.current.patternStroke=!0}setFillColorN(t,...e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("fillColor",t),this.current.fillColor=this.getColorN_Pattern(t,e),this.current.patternFill=!0}setStrokeRGBColor(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}
14setStrokeTransparent(t){var e;(e=this.dependencyTracker)==null||e.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1}setFillTransparent(t){var e;(e=this.dependencyTracker)==null||e.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e,i=null){let n;return this.cachedPatterns.has(e)?n=this.cachedPatterns.get(e):(n=q1(this.getObject(t,e)),this.cachedPatterns.set(e,n)),i&&(n.matrix=i),n}shadingFill(t,e){var a;if(!this.contentVisible)return;const i=this.ctx;this.save(t);const n=this._getPattern(t,e);i.fillStyle=n.getPattern(i,this,In(i),ke.SHADING,t);const r=In(i);if(r){const{width:l,height:c}=i.canvas,h=Sl.slice();W.axialAlignedBoundingBox([0,0,l,c],r,h);const[u,d,f,m]=h;this.ctx.fillRect(u,d,f-u,m-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);(a=this.dependencyTracker)==null||a.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,Xi.transform).recordDependencies(t,Xi.fill).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t)}beginInlineImage(){Ft("Should not call beginInlineImage")}beginImageData(){Ft("Should not call beginImageData")}
14paintFormXObjectBegin(t,e,i){var n;if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),e&&this.transform(t,...e),this.baseTransform=Vt(this.ctx),i)){W.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[r,a,l,c]=i,h=new Path2D;h.rect(r,a,l-r,c-a),this.ctx.clip(h),(n=this.dependencyTracker)==null||n.recordClipBox(t,this.ctx,r,l,a,c),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,e){var E;if(!this.contentVisible)return;this.save(t),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const i=this.ctx;e.isolated||_g("TODO: Support non-isolated groups."),e.knockout&&it("Knockout groups not supported.");const n=Vt(i);if(e.matrix&&i.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let r=Sl.slice();W.axialAlignedBoundingBox(e.bbox,Vt(i),r);const a=[0,0,i.canvas.width,i.canvas.height];r=W.intersect(r,a)||[0,0,0,0];const l=Math.floor(r[0]),c=Math.floor(r[1]),h=Math.max(Math.ceil(r[2])-l,1),u=Math.max(Math.ceil(r[3])-c,1);this.current.startNewPathAndClipBox([0,0,h,u]);let d="groupAt"+this.groupLevel;e.smask&&(d+="_smask_"+this.smaskCounter++%2);const f=this.cachedCanvases.getCanvas(d,h,u),m=f.context;m.translate(-l,-c),m.transform(...n);let b=new Path2D;const[y,v,S,x]=e.bbox;if(b.rect(y,v,S-y,x-v),e.matrix){const C=new Path2D;C.addPath(b,new DOMMatrix(e.matrix)),b=C}m.clip(b),e.smask&&this.smaskStack.push({canvas:f.canvas,context:m,offsetX:l,offsetY:c,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}),(!e.smask||this.dependencyTracker)&&(i.setTransform(1,0,0,1,0,0),i.translate(l,c),i.save()),xh(i,m),this.ctx=m,(E=this.dependencyTracker)==null||E.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(i),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(i),this.groupLevel++}endGroup(t,e){var r;if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,(r=this.dependencyTracker)==null||r.popBaseTransform(),e.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const a=Vt(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...a);const l=Sl.slice();W.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],a,l),this.ctx.drawImage(i.canvas,0,0),this.ctx.restore(),this.compose(l)}}beginAnnotation(t,e,i,n,r,a){if(w(this,Pn,Ny).call(this),Ff(this.ctx),this.ctx.save(),this.save(t),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const l=i[2]-i[0],c=i[3]-i[1];if(a&&this.annotationCanvasMap){n=n.slice(),n[4]-=i[0],n[5]-=i[1],i=i.slice(),i[0]=i[1]=0,i[2]=l,i[3]=c,W.singularValueDecompose2dScale(Vt(this.ctx),Hi);const{viewportScale:h}=this,u=Math.ceil(l*this.outputScaleX*h),d=Math.ceil(c*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(u,d);const{canvas:f,context:m}=this.annotationCanvas;this.annotationCanvasMap.set(e,f),this.annotationCanvas.savedCtx=this.ctx,this.ctx=m,this.ctx.save(),this.ctx.setTransform(Hi[0],0,0,-Hi[1],0,c*Hi[1]),Ff(this.ctx)}else{Ff(this.ctx),this.endPath(t);const h=new Path2D;h.rect(i[0],i[1],l,c),this.ctx.clip(h)}}this.current=new _A(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(t,...n),this.transform(t,...r)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),w(this,Pn,By).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t,e){var l;if(!this.contentVisible)return;const i=e.count;e=this.getObject(t,e.data,e),e.count=i;const n=this.ctx,r=this._createMaskCanvas(t,e),a=r.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(a,r.offsetX,r.offsetY),(l=this.dependencyTracker)==null||l.resetBBox(t).recordBBox(t,this.ctx,r.offsetX,r.offsetX+a.width,r.offsetY,r.offsetY+a.height).recordOperation(t),n.restore(
14),this.compose()}paintImageMaskXObjectRepeat(t,e,i,n=0,r=0,a,l){var d,f,m;if(!this.contentVisible)return;e=this.getObject(t,e.data,e);const c=this.ctx;c.save();const h=Vt(c);c.transform(i,n,r,a,0,0);const u=this._createMaskCanvas(t,e);c.setTransform(1,0,0,1,u.offsetX-h[4],u.offsetY-h[5]),(d=this.dependencyTracker)==null||d.resetBBox(t);for(let b=0,y=l.length;b<y;b+=2){const v=W.transform(h,[i,n,r,a,l[b],l[b+1]]);c.drawImage(u.canvas,v[4],v[5]),(f=this.dependencyTracker)==null||f.recordBBox(t,this.ctx,v[4],v[4]+u.canvas.width,v[5],v[5]+u.canvas.height)}c.restore(),this.compose(),(m=this.dependencyTracker)==null||m.recordOperation(t)}paintImageMaskXObjectGroup(t,e){var a,l,c;if(!this.contentVisible)return;const i=this.ctx,n=this.current.fillColor,r=this.current.patternFill;(a=this.dependencyTracker)==null||a.resetBBox(t).recordDependencies(t,Xi.transformAndFill);for(const h of e){const{data:u,width:d,height:f,transform:m}=h,b=this.cachedCanvases.getCanvas("maskCanvas",d,f),y=b.context;y.save();const v=this.getObject(t,u,h);xA(y,v),y.globalCompositeOperation="source-in",y.fillStyle=r?n.getPattern(y,this,In(i),ke.FILL,t):n,y.fillRect(0,0,d,f),y.restore(),i.save(),i.transform(...m),i.scale(1,-1),If(i,b.canvas,0,0,d,f,0,-1,1,1),(l=this.dependencyTracker)==null||l.recordBBox(t,i,0,d,0,f),i.restore()}this.compose(),(c=this.dependencyTracker)==null||c.recordOperation(t)}paintImageXObject(t,e){if(!this.contentVisible)return;const i=this.getObject(t,e);if(!i){it("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t,i)}paintImageXObjectRepeat(t,e,i,n,r){if(!this.contentVisible)return;const a=this.getObject(t,e);if(!a){it("Dependent image isn't ready yet");return}const l=a.width,c=a.height,h=[];for(let u=0,d=r.length;u<d;u+=2)h.push({transform:[i,0,0,n,r[u],r[u+1]],x:0,y:0,w:l,h:c});this.paintInlineImageXObjectGroup(t,a,h)}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;const{bitmap:e,width:i,height:n}=t,r=this.cachedCanvases.getCanvas("inlineImage",i,n),a=r.context;return a.filter=this.current.transferMaps,a.drawImage(e,0,0),a.filter="none",r.canvas}paintInlineImageXObject(t,e){var h;if(!this.contentVisible)return;const i=e.width,n=e.height,r=this.ctx;this.save(t);const{filter:a}=r;a!=="none"&&a!==""&&(r.filter="none"),r.scale(1/i,-1/n);let l;if(e.bitmap)l=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)l=e;else{const d=this.cachedCanvases.getCanvas("inlineImage",i,n).context;EA(d,e),l=this.applyTransferMapsToCanvas(d)}const c=this._scaleImage(l,In(r));r.imageSmoothingEnabled=CA(Vt(r),e.interpolate),(h=this.dependencyTracker)==null||h.resetBBox(t).recordBBox(t,r,0,i,-n,0).recordDependencies(t,Xi.imageXObject).recordOperation(t),If(r,c.img,0,0,c.paintWidth,c.paintHeight,0,-n,i,n),this.compose(),this.restore(t)}paintInlineImageXObjectGroup(t,e,i){var a,l,c;if(!this.contentVisible)return;const n=this.ctx;let r;if(e.bitmap)r=e.bitmap;else{const h=e.width,u=e.height,f=this.cachedCanvases.getCanvas("inlineImage",h,u).context;EA(f,e),r=this.applyTransferMapsToCanvas(f)}(a=this.dependencyTracker)==null||a.resetBBox(t);for(const h of i)n.save(),n.transform(...h.transform),n.scale(1,-1),If(n,r,h.x,h.y,h.w,h.h,0,-1,1,1),(l=this.dependencyTracker)==null||l.recordBBox(t,n,0,1,-1,0),n.restore();(c=this.dependencyTracker)==null||c.recordOperation(t),this.compose()}paintSolidColorImageMask(t){var e;this.contentVisible&&((e=this.dependencyTracker)==null||e.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,Xi.fill).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t,e){}
14markPointProps(t,e,i){}beginMarkedContent(t,e){var i;(i=this.dependencyTracker)==null||i.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e,i){var n;(n=this.dependencyTracker)==null||n.beginMarkedContent(t),e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){var e;(e=this.dependencyTracker)==null||e.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,e,i){var a,l;const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const r=this.ctx;this.pendingClip?(n||(this.pendingClip===TA?r.clip(e,"evenodd"):r.clip(e)),this.pendingClip=null,(a=this.dependencyTracker)==null||a.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):(l=this.dependencyTracker)==null||l.recordOperation(t),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Vt(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),n=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,n)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:e,b:i,c:n,d:r}=this.ctx.getTransform();let a,l;if(i===0&&n===0){const c=Math.abs(e),h=Math.abs(r);if(c===h)if(t===0)a=l=1/c;else{const u=c*t;a=l=u<1?1/u:1}else if(t===0)a=1/c,l=1/h;else{const u=c*t,d=h*t;a=u<1?1/u:1,l=d<1?1/d:1}}else{const c=Math.abs(e*r-i*n),h=Math.hypot(e,i),u=Math.hypot(n,r);if(t===0)a=u/c,l=h/c;else{const d=t*c;a=u>d?u/d:1,l=h>d?h/d:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=l}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:i,current:{lineWidth:n}}=this,[r,a]=this.getScaleForStroking();if(r===a){i.lineWidth=(n||1)*r,i.stroke(t);return}const l=i.getLineDash();e&&i.save(),i.scale(r,a),Wm.a=1/r,Wm.d=1/a;const c=new Path2D;if(c.addPath(t,Wm),l.length>0){const h=Math.max(r,a);i.setLineDash(l.map(u=>u/h)),i.lineDashOffset/=h}i.lineWidth=n||1,i.stroke(c),e&&i.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};Pn=new WeakSet,Ny=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)},By=function(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}},Uy=function(t,e,i){const n=new Path2D;return n.addPath(t,new DOMMatrix(i).invertSelf().multiplySelf(e)),n};let Pl=l0;for(const o in ru)Pl.prototype[o]!==void 0&&(Pl.prototype[ru[o]]=Pl.prototype[o]);var ic,nc,$u,sc,ep;const El=class El{constructor(t){A(this,sc);A(this,ic);A(this,nc);A(this,$u);p(this,ic,t),p(this,nc,new DataView(s(this,ic))),p(this,$u,new TextDecoder)}static write(t){const e=new TextEncoder,i={};let n=0;for(const h of El.strings){const u=e.encode(t[h]);i[h]=u,n+=4+u.length}const r=new ArrayBuffer(n),a=new Uint8Array(r),l=new DataView(r);let c=0;for(const h of El.strings){const u=i[h],d=u.length;l.setUint32(c,d),a.set(u,c+4),c+=4+d}return yt(c===r.byteLength,"CssFontInfo.write: Buffer overflow"),r}get fontFamily(){return w(this,sc,ep).call(this,0)}get fontWeight(){return w(this,sc,ep).call(this,1)}get italicAngle(){return w(this,sc,ep).call(this,2)}};ic=new WeakMap,nc=new WeakMap,$u=new WeakMap,sc=new WeakSet,ep=function(t){yt(t<El.strings.length,"Invalid string index");let e=0;for(let n=0;n<t;n++)e+=s(this,nc).getUint32(e)+4;const i=s(this,nc).getUint32(e);return s(this,$u).decode(new Uint8Array(s(this,ic),e+4,i))},k(El,"strings",["fontFamily","fontWeight","italicAngle"]);let Np=El;var Or,Kn,eo,io,Hh;const xl=class xl{constructor(t){A(this,io);A(this,Or);A(this,Kn);A(this,eo);p(this,Or,t),p(this,Kn,new DataView(s(this,Or))),p(this,eo,new TextDecoder)}static write(t){const e=new TextEncoder,i={};let n=0;for(const f of xl.strings){const m=e.encode(t[f]);i[f]=m,n+=4+m.length}n+=4;let r,a,l=1+n;t.style&&(r=e.encode(t.style.style),a=e.encode(t.style.weight),l+=4+r.length+4+a.length);const c=new ArrayBuffer(l),h=new Uint8Array(c),u=new DataView(c);let d=0;u.setUint8(d++,t.guessFallback?1:0),u.setUint32(d,0),d+=4,n=0;for(const f of xl.strings){const m=i[f],b=m.length;n+=4+b,u.setUint32(d,b),h.set(m,d+4),d+=4+b}return u.setUint32(d-n-4,n),t.style&&(u.setUint32(d,r.length),h.set(r,d+4),d+=4+r.length,u.setUint32(d,a.length),h.set(a,d+4),d+=4+a.length),yt(d<=c.byteLength,"SubstitionInfo.write: Buffer overflow"),c.transferTo
14FixedLength(d)}get guessFallback(){return s(this,Kn).getUint8(0)!==0}get css(){return w(this,io,Hh).call(this,0)}get loadedName(){return w(this,io,Hh).call(this,1)}get baseFontName(){return w(this,io,Hh).call(this,2)}get src(){return w(this,io,Hh).call(this,3)}get style(){let t=1;t+=4+s(this,Kn).getUint32(t);const e=s(this,Kn).getUint32(t),i=s(this,eo).decode(new Uint8Array(s(this,Or),t+4,e));t+=4+e;const n=s(this,Kn).getUint32(t),r=s(this,eo).decode(new Uint8Array(s(this,Or),t+4,n));return{style:i,weight:r}}};Or=new WeakMap,Kn=new WeakMap,eo=new WeakMap,io=new WeakSet,Hh=function(t){yt(t<xl.strings.length,"Invalid string index");let e=5;for(let n=0;n<t;n++)e+=s(this,Kn).getUint32(e)+4;const i=s(this,Kn).getUint32(e);return s(this,eo).decode(new Uint8Array(s(this,Or),e+4,i))},k(xl,"strings",["css","loadedName","baseFontName","src"]);let Bp=xl;var rc,ac,oc,lc,Ci,Jn,Hu,Mt,Jt,dn,ip,jh;const ot=class ot{constructor({data:t,extra:e}){A(this,Jt);A(this,Jn);A(this,Hu);A(this,Mt);p(this,Jn,t),p(this,Hu,new TextDecoder),p(this,Mt,new DataView(s(this,Jn))),e&&Object.assign(this,e)}get black(){return w(this,Jt,dn).call(this,0)}get bold(){return w(this,Jt,dn).call(this,1)}get disableFontFace(){return w(this,Jt,dn).call(this,2)}get fontExtraProperties(){return w(this,Jt,dn).call(this,3)}get isInvalidPDFjsFont(){return w(this,Jt,dn).call(this,4)}get isType3Font(){return w(this,Jt,dn).call(this,5)}get italic(){return w(this,Jt,dn).call(this,6)}get missingFile(){return w(this,Jt,dn).call(this,7)}get remeasure(){return w(this,Jt,dn).call(this,8)}get vertical(){return w(this,Jt,dn).call(this,9)}get ascent(){return w(this,Jt,ip).call(this,0)}get defaultWidth(){return w(this,Jt,ip).call(this,1)}get descent(){return w(this,Jt,ip).call(this,2)}get bbox(){let t=s(ot,ac);if(s(this,Mt).getUint8(t)===0)return;t+=1;const i=[];for(let n=0;n<4;n++)i.push(s(this,Mt).getInt16(t,!0)),t+=2;return i}get fontMatrix(){let t=s(ot,oc);if(s(this,Mt).getUint8(t)===0)return;t+=1;const i=[];for(let n=0;n<6;n++)i.push(s(this,Mt).getFloat64(t,!0)),t+=8;return i}get defaultVMetrics(){let t=s(ot,lc);if(s(this,Mt).getUint8(t)===0)return;t+=1;const i=[];for(let n=0;n<3;n++)i.push(s(this,Mt).getInt16(t,!0)),t+=2;return i}get fallbackName(){return w(this,Jt,jh).call(this,0)}get loadedName(){return w(this,Jt,jh).call(this,1)}get mimetype(){return w(this,Jt,jh).call(this,2)}get name(){return w(this,Jt,jh).call(this,3)}get data(){let t=s(ot,Ci);const e=s(this,Mt).getUint32(t);t+=4+e;const i=s(this,Mt).getUint32(t);t+=4+i;const n=s(this,Mt).getUint32(t);t+=4+n;const r=s(this,Mt).getUint32(t);if(r!==0)return new Uint8Array(s(this,Jn),t+4,r)}clearData(){let t=s(ot,Ci);const e=s(this,Mt).getUint32(t);t+=4+e;const i=s(this,Mt).getUint32(t);t+=4+i;const n=s(this,Mt).getUint32(t);t+=4+n;const r=s(this,Mt).getUint32(t);new Uint8Array(s(this,Jn),t+4,r).fill(0),s(this,Mt).setUint32(t,0)}get cssFontInfo(){let t=s(ot,Ci);const e=s(this,Mt).getUint32(t);t+=4+e;const i=s(this,Mt).getUint32(t);t+=4+i;const n=s(this,Mt).getUint32(t);if(n===0)return null;const r=new Uint8Array(n);return r.set(new Uint8Array(s(this,Jn),t+4,n)),new Np(r.buffer)}get systemFontInfo(){let t=s(ot,Ci);const e=s(this,Mt).getUint32(t);t+=4+e;const i=s(this,Mt).getUint32(t);if(i===0)return null;const n=new Uint8Array(i);return n.set(new Uint8Array(s(this,Jn),t+4,i)),new Bp(n.buffer)}static write(t){const e=t.systemFontInfo?Bp.write(t.systemFontInfo):null,i=t.cssFontInfo?Np.write(t.cssFontInfo):null,n=new TextEncoder,r={};let a=0;for(const y of ot.strings)r[y]=n.encode(t[y]),a+=4+r[y].length;const l=s(ot,Ci)+4+a+4+(e?e.byteLength:0)+4+(i?i.byteLength:0)+4+(t.data?t.data.length:0),c=new ArrayBuffer(l),h=new Uint8Array(c),u=new DataView(c);let d=0;const f=ot.bools.length;let m=0,b=0;for(let y=0;y<f;y++){const v=t[ot.bools[y]];m|=(v===void 0?0:v?2:1)<<b,b+=2,(b===8||y===f-1)&&(u.setUint8(d++,m),m=0,b=0)}yt(d===s(ot,rc),"FontInfo.write: Boolean properties offset mismatch");for(const y of ot.numbers)u.setFloat64(d,t[y]),d+=8;if(yt(d===s(ot,ac),"FontInfo.write: Number properties offset mismatch"),t.bbox){u.setUint8(d++,4);for(const y of t.bbox)u.setInt16(d,y,!0),d+=2}else u.setUint8(d++,0),d+=2*4;if(yt(d===s(ot,oc),"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){u.setUint8(d++,6);for(const y of t.fontMatrix)u.setFloat64(d,y,!0),d+=8}else u.setUint8(d++,0),d+=8*6;if(yt(d===s(ot,lc),"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){u.setUint8(d++,1);for(const y of t.defaultVMetrics)u.setInt16(d,y,!0),d+=2}else u.setUint8(d++,0),d+=3*2;yt(d===s(ot,Ci),"FontInfo.write: DefaultVMetrics properties offset mismatch"),u.setUint32(s(ot,Ci),0),d+=4;for(const y of ot.strings){const v=r[y],S=v.length;u.setUint32(d,S),h.set(v,d+4),d+=4+S}if(u.setUint32(s(ot,Ci),d-s(ot,Ci)-4),!e)u.setUint32(d,0),d+=4;else{const y=e.byteLength;u.setUint32(d,y),yt(d+4+y<=c.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),h.set(new Uint8Array(e),d+4),d+=4+y}if(!i)u.setUint32(d,0),d+=4;else{const y=i.byteLength;u.setUint32(d,y),yt(d+4+y<=c.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),h.set(new Uint8Array(i),d+4),d+=4+y}return t.data===void 0?(u.setUint32(d,0),d+=4):(u.setUint32(d,t.data.length),h.set(t.data,d+4),d+=4+t.data.length),yt(d<=c.byteLength,"FontInfo.write: Buffer overflow"),c.transferTo
14FixedLength(d)}};rc=new WeakMap,ac=new WeakMap,oc=new WeakMap,lc=new WeakMap,Ci=new WeakMap,Jn=new WeakMap,Hu=new WeakMap,Mt=new WeakMap,Jt=new WeakSet,dn=function(t){yt(t<ot.bools.length,"Invalid boolean index");const e=Math.floor(t/4),i=t*2%8,n=s(this,Mt).getUint8(e)>>i&3;return n===0?void 0:n===2},ip=function(t){return yt(t<ot.numbers.length,"Invalid number index"),s(this,Mt).getFloat64(s(ot,rc)+t*8)},jh=function(t){yt(t<ot.strings.length,"Invalid string index");let e=s(ot,Ci)+4;for(let r=0;r<t;r++)e+=s(this,Mt).getUint32(e)+4;const i=s(this,Mt).getUint32(e),n=new Uint8Array(i);return n.set(new Uint8Array(s(this,Jn),e+4,i)),s(this,Hu).decode(n)},k(ot,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),k(ot,"numbers",["ascent","defaultWidth","descent"]),k(ot,"strings",["fallbackName","loadedName","mimetype","name"]),A(ot,rc,Math.ceil(ot.bools.length*2/8)),A(ot,ac,s(ot,rc)+ot.numbers.length*8),A(ot,oc,s(ot,ac)+1+2*4),A(ot,lc,s(ot,oc)+1+8*6),A(ot,Ci,s(ot,lc)+1+2*3);let $y=ot;var ju,zu;class nr{static get workerPort(){return s(this,ju)}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");p(this,ju,t)}static get workerSrc(){return s(this,zu)}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");p(this,zu,t)}}ju=new WeakMap,zu=new WeakMap,A(nr,ju,null),A(nr,zu,"");var cc,Gu;class eP{constructor({parsedData:t,rawData:e}){A(this,cc);A(this,Gu);p(this,cc,t),p(this,Gu,e)}getRaw(){return s(this,Gu)}get(t){return s(this,cc).get(t)??null}[Symbol.iterator](){return s(this,cc).entries()}}cc=new WeakMap,Gu=new WeakMap;const bl=Symbol("INTERNAL");var Wu,Vu,qu,hc;class iP{constructor(t,{name:e,intent:i,usage:n,rbGroups:r}){A(this,Wu,!1);A(this,Vu,!1);A(this,qu,!1);A(this,hc,!0);p(this,Wu,!!(t&$i.DISPLAY)),p(this,Vu,!!(t&$i.PRINT)),this.name=e,this.intent=i,this.usage=n,this.rbGroups=r}get visible(){if(s(this,qu))return s(this,hc);if(!s(this,hc))return!1;const{print:t,view:e}=this.usage;return s(this,Wu)?(e==null?void 0:e.viewState)!=="OFF":s(this,Vu)?(t==null?void 0:t.printState)!=="OFF":!0}_setVisible(t,e,i=!1){t!==bl&&Ft("Internal method `_setVisible` called."),p(this,qu,i),p(this,hc,e)}}Wu=new WeakMap,Vu=new WeakMap,qu=new WeakMap,hc=new WeakMap;var Lr,Dt,uc,dc,Xu,Hy;class nP{constructor(t,e=$i.DISPLAY){A(this,Xu);A(this,Lr,null);A(this,Dt,new Map);A(this,uc,null);A(this,dc,null);if(this.renderingIntent=e,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,p(this,dc,t.order);for(const i of t.groups)s(this,Dt).set(i.id,new iP(e,i));if(t.baseState==="OFF")for(const i of s(this,Dt).values())i._setVisible(bl,!1);for(const i of t.on)s(this,Dt).get(i)._setVisible(bl,!0);for(const i of t.off)s(this,Dt).get(i)._setVisible(bl,!1);p(this,uc,this.getHash())}}isVisible(t){if(s(this,Dt).size===0)return!0;if(!t)return _g("Optional content group not defined."),!0;if(t.type==="OCG")return s(this,Dt).has(t.id)?s(this,Dt).get(t.id).visible:(it(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return w(this,Xu,Hy).call(this,t.expression);if(!t.policy||t.policy==="AnyOn"){for(const e of t.ids){if(!s(this,Dt).has(e))return it(`Optional content group not found: ${e}`),!0;if(s(this,Dt).get(e).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const e of t.ids){if(!s(this,Dt).has(e))return it(`Optional content group not found: ${e}`),!0;if(!s(this,Dt).get(e).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const e of t.ids){if(!s(this,Dt).has(e))return it(`Optional content group not found: ${e}`),!0;if(!s(this,Dt).get(e).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const e of t.ids){if(!s(this,Dt).has(e))return it(`Optional content group not found: ${e}`),!0;if(s(this,Dt).get(e).visible)return!1}return!0}return it(`Unknown optional content policy ${t.policy}.`),!0}return it(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0,i=!0){var r;const n=s(this,Dt).get(t);
14if(!n){it(`Optional content group not found: ${t}`);return}if(i&&e&&n.rbGroups.length)for(const a of n.rbGroups)for(const l of a)l!==t&&((r=s(this,Dt).get(l))==null||r._setVisible(bl,!1,!0));n._setVisible(bl,!!e,!0),p(this,Lr,null)}setOCGState({state:t,preserveRB:e}){let i;for(const n of t){switch(n){case"ON":case"OFF":case"Toggle":i=n;continue}const r=s(this,Dt).get(n);if(r)switch(i){case"ON":this.setVisibility(n,!0,e);break;case"OFF":this.setVisibility(n,!1,e);break;case"Toggle":this.setVisibility(n,!r.visible,e);break}}p(this,Lr,null)}get hasInitialVisibility(){return s(this,uc)===null||this.getHash()===s(this,uc)}getOrder(){return s(this,Dt).size?s(this,dc)?s(this,dc).slice():[...s(this,Dt).keys()]:null}getGroup(t){return s(this,Dt).get(t)||null}getHash(){if(s(this,Lr)!==null)return s(this,Lr);const t=new pv;for(const[e,i]of s(this,Dt))t.update(`${e}:${i.visible}`);return p(this,Lr,t.hexdigest())}[Symbol.iterator](){return s(this,Dt).entries()}}Lr=new WeakMap,Dt=new WeakMap,uc=new WeakMap,dc=new WeakMap,Xu=new WeakSet,Hy=function(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;n<e;n++){const r=t[n];let a;if(Array.isArray(r))a=w(this,Xu,Hy).call(this,r);else if(s(this,Dt).has(r))a=s(this,Dt).get(r).visible;else return it(`Optional content group not found: ${r}`),!0;switch(i){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return i==="And"};class sP{constructor(t,{disableRange:e=!1,disableStream:i=!1}){yt(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:n,initialData:r,progressiveDone:a,contentDispositionFilename:l}=t;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=l,(r==null?void 0:r.length)>0){const c=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(c)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!e,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((c,h)=>{this._onReceiveData({begin:c,chunk:h})}),t.addProgressListener((c,h)=>{this._onProgress({loaded:c,total:h})}),t.addProgressiveReadListener(c=>{this._onReceiveData({chunk:c})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:e}){const i=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{const n=this._rangeReaders.some(function(r){return r._begin!==t?!1:(r._enqueue(i),!0)});yt(n,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}_onProgress(t){var e,i,n,r;t.total===void 0?(i=(e=this._rangeReaders[0])==null?void 0:e.onProgress)==null||i.call(e,{loaded:t.loaded}):(r=(n=this._fullRequestReader)==null?void 0:n.onProgress)==null||r.call(n,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;(t=this._fullRequestReader)==null||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){yt(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new rP(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new aP(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class rP{constructor(t,e,i=!1,n=null){this._stream=t,this._done=i||!1,this._filename=Jb(n)?n:null,this._queuedChunks=e||[],this._loaded=0;for(const r of this._queuedChunks)this._loaded+=r.byteLength;
14this._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};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class aP{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,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(const i of this._requests)i.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){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function oP(o){let t=!0,e=i("filename\\*","i").exec(o);if(e){e=e[1];let u=l(e);return u=unescape(u),u=c(u),u=h(u),r(u)}if(e=a(o),e){const u=h(e);return r(u)}if(e=i("filename","i").exec(o),e){e=e[1];let u=l(e);return u=h(u),r(u)}function i(u,d){return new RegExp("(?:^|;)\\s*"+u+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function n(u,d){if(u){if(!/^[\x00-\xFF]+$/.test(d))return d;try{const f=new TextDecoder(u,{fatal:!0}),m=Qd(d);d=f.decode(m),t=!1}catch{}}return d}function r(u){return t&&/[\x80-\xff]/.test(u)&&(u=n("utf-8",u),t&&(u=n("iso-8859-1",u))),u}function a(u){const d=[];let f;const m=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=m.exec(u))!==null;){let[,y,v,S]=f;if(y=parseInt(y,10),y in d){if(y===0)break;continue}d[y]=[v,S]}const b=[];for(let y=0;y<d.length&&y in d;++y){let[v,S]=d[y];S=l(S),v&&(S=unescape(S),y===0&&(S=c(S))),b.push(S)}return b.join("")}function l(u){if(u.startsWith('"')){const d=u.slice(1).split('\\"');for(let f=0;f<d.length;++f){const m=d[f].indexOf('"');m!==-1&&(d[f]=d[f].slice(0,m),d.length=f+1),d[f]=d[f].replaceAll(/\\(.)/g,"$1")}u=d.join('"')}return u}function c(u){const d=u.indexOf("'");if(d===-1)return u;const f=u.slice(0,d),b=u.slice(d+1).replace(/^[^']*'/,"");return n(f,b)}function h(u){return!u.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(u)?u:u.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,f,m,b){if(m==="q"||m==="Q")return b=b.replaceAll("_"," "),b=b.replaceAll(/=([0-9a-fA-F]{2})/g,function(y,v){return String.fromCharCode(parseInt(v,16))}),n(f,b);try{b=atob(b)}catch{}return n(f,b)})}return""}function Cv(o,t){const e=new Headers;if(!o||!t||typeof t!="object")return e;for(const i in t){const n=t[i];n!==void 0&&e.append(i,n)}return e}function xg(o){var t;return((t=URL.parse(o))==null?void 0:t.origin)??null}function Tv({responseHeaders:o,isHttp:t,rangeChunkSize:e,disableRange:i}){const n={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(o.get("Content-Length"),10);return!Number.isInteger(r)||(n.suggestedLength=r,r<=2*e)||i||!t||o.get("Accept-Ranges")!=="bytes"||(o.get("Content-Encoding")||"identity")!=="identity"||(n.allowRangeRequests=!0),n}function Pv(o){const t=o.get("Content-Disposition");if(t){let e=oP(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if(Jb(e))return e}return null}function sf(o,t){return new Op(`Unexpected server response (${o}) while retrieving PDF "${t}".`,o,o===404||o===0&&t.startsWith("file:"))}function Rv(o){return o===200||o===206}function Mv(o,t,e){return{method:"GET",headers:o,signal:e.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function Dv(o){return o instanceof Uint8Array?o.buffer:o instanceof ArrayBuffer?o:(it(`getArrayBuffer - unexpected data format: ${o}`),new Uint8Array(o).buffer)}class lP{constructor(t){k(this,"_responseOrigin",null);this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=Cv(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return yt(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new cP(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new hP(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class cP{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const 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;const i=new Headers(t.headers),n=e.url;fetch(n,Mv(i,this._withCredentials,this._abortController)).then(r=>{if(t._responseOrigin=xg(r.url),!Rv(r.status))throw sf(r.status,n);this._reader=r.body.getReader(),this._headersCapability.resolve();const a=r.headers,{allowRangeRequests:l,suggestedLength:c}=Tv({responseHeaders:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=l,this._contentLength=c||this._contentLength,this._filename=Pv(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new la("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(){var i;await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded,total:this._contentLength}),{value:Dv(t),done:!1})}cancel(t){var e;(e=this._reader)==null||e.cancel(t),this._abortController.abort()}}class hP{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const n=t.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController;const r=new Headers(t.headers);r.append("Range",`bytes=${e}-${i-1}`);const a=n.url;fetch(a,Mv(r,this._withCredentials,this._abortController)).then(l=>{const c=xg(l.url);if(c!==t._responseOrigin)throw new Error(`Expected range response-origin "${c}" to match "${t._responseOrigin}".`);if(!Rv(l.status))throw sf(l.status,a);this._readCapability.resolve(),this._reader=l.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded}),{value:Dv(t),done:!1})}cancel(t){var e;(e=this._reader)==null||e.cancel(t),this._abortController.abort()}}const Vm=200,qm=206;function uP(o){const t=o.response;return typeof t!="string"?t:Qd(t).buffer}class dP{constructor({url:t,httpHeaders:e,withCredentials:i}){k(this,"_responseOrigin",null);this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=Cv(this.isHttp,e),this.withCredentials=i||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const[r,a]of this.headers)e.setRequestHeader(r,a);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),n.expectedStatus=qm):n.expectedStatus=Vm,e.responseType="arraybuffer",yt(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>{t.onError(e.status)},e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=t.onHeadersReceived,n.onDone=t.onDone,n.onError=t.onError,n.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){var n;const i=this.pendingRequests[t];i&&((n=i.onProgress)==null||n.call(i,e))}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const n=i.xhr;if(n.readyState>
14=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),n.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],n.status===0&&this.isHttp){i.onError(n.status);return}const r=n.status||Vm;if(!(r===Vm&&i.expectedStatus===qm)&&r!==i.expectedStatus){i.onError(n.status);return}const l=uP(n);if(r===qm){const c=n.getResponseHeader("Content-Range"),h=/bytes (\d+)-(\d+)\/(\d+)/.exec(c);h?i.onDone({begin:parseInt(h[1],10),chunk:l}):(it('Missing or invalid "Content-Range" header.'),i.onError(0))}else l?i.onDone({begin:0,chunk:l}):i.onError(n.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class fP{constructor(t){this._source=t,this._manager=new dP(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return yt(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new pP(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new gP(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class pP{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(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t);this._manager._responseOrigin=xg(e.responseURL);const i=e.getAllResponseHeaders(),n=new Headers(i?i.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(l=>{const[c,...h]=l.split(": ");return[c,h.join(": ")]}):[]),{allowRangeRequests:r,suggestedLength:a}=Tv({responseHeaders:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=Pv(n),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(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=sf(t,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;(e=this.onProgress)==null||e.call(this,{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};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest
14(this._fullRequestId),this._fullRequestReader=null}}class gP{constructor(t,e,i){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,end:i,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(){var e;const t=xg((e=this._manager.getRequestXhr(this._requestId))==null?void 0:e.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){var t;(t=this.onClosed)==null||t.call(this,this)}_onDone(t){const e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??(this._storedError=sf(t,this._url));for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||(e=this.onProgress)==null||e.call(this,{loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const 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()}}const mP=/^[a-z][a-z0-9\-+.]+:/i;function yP(o){if(mP.test(o))return new URL(o);const t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(o))}class bP{constructor(t){this.source=t,this.url=yP(t.url),yt(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return yt(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new AP(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new wP(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class AP{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const 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();const i=process.getBuiltinModule("fs");i.promises.lstat(this._url).then(n=>{this._contentLength=n.size,this._setReadableStream(i.createReadStream(this._url)),this._headersCapability.resolve()},n=>{n.code==="ENOENT"&&(n=sf(0,this._url.href)),this._storedError=n,this._headersCapability.reject(n)})}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(){var i;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,(i=this.onProgress)==null||i.call(this,{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 la("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class wP{constructor(t,e,i){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const n=t.source;this._isStreamingSupported=!n.disableStream;const r=process.getBuiltinModule("fs");this._setReadableStream(r.createReadStream(this._url,{start:e,end:i-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,(i=this.onProgress)==null||i.call(this,{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)}}const Ch=Symbol("INITIAL_DATA");var Ti,Yu,jy;class Ov{constructor(){A(this,Yu);
14A(this,Ti,Object.create(null))}get(t,e=null){if(e){const n=w(this,Yu,jy).call(this,t);return n.promise.then(()=>e(n.data)),null}const i=s(this,Ti)[t];if(!i||i.data===Ch)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const e=s(this,Ti)[t];return!!e&&e.data!==Ch}delete(t){const e=s(this,Ti)[t];return!e||e.data===Ch?!1:(delete s(this,Ti)[t],!0)}resolve(t,e=null){const i=w(this,Yu,jy).call(this,t);i.data=e,i.resolve()}clear(){var t;for(const e in s(this,Ti)){const{data:i}=s(this,Ti)[e];(t=i==null?void 0:i.bitmap)==null||t.close()}p(this,Ti,Object.create(null))}*[Symbol.iterator](){for(const t in s(this,Ti)){const{data:e}=s(this,Ti)[t];e!==Ch&&(yield[t,e])}}}Ti=new WeakMap,Yu=new WeakSet,jy=function(t){var e;return(e=s(this,Ti))[t]||(e[t]={...Promise.withResolvers(),data:Ch})};const vP=1e5,PA=30;var OA,kr,mi,Ku,Ju,no,$s,Qu,Zu,so,fc,pc,Ir,gc,td,mc,ro,ed,id,yc,ao,nd,Fr,bc,lr,Lv,kv,zy,zi,np,Gy,Iv,Fv;const he=class he{constructor({textContentSource:t,container:e,viewport:i}){A(this,lr);A(this,kr,Promise.withResolvers());A(this,mi,null);A(this,Ku,!1);A(this,Ju,!!((OA=globalThis.FontInspector)!=null&&OA.enabled));A(this,no,null);A(this,$s,null);A(this,Qu,0);A(this,Zu,0);A(this,so,null);A(this,fc,null);A(this,pc,0);A(this,Ir,0);A(this,gc,Object.create(null));A(this,td,[]);A(this,mc,null);A(this,ro,[]);A(this,ed,new WeakMap);A(this,id,null);var c;if(t instanceof ReadableStream)p(this,mc,t);else if(typeof t=="object")p(this,mc,new ReadableStream({start(h){h.enqueue(t),h.close()}}));else throw new Error('No "textContentSource" parameter specified.');p(this,mi,p(this,fc,e)),p(this,Ir,i.scale*hs.pixelRatio),p(this,pc,i.rotation),p(this,$s,{div:null,properties:null,ctx:null});const{pageWidth:n,pageHeight:r,pageX:a,pageY:l}=i.rawDims;p(this,id,[1,0,0,-1,-a,l+r]),p(this,Zu,n),p(this,Qu,r),w(c=he,zi,Iv).call(c),Wo(e,i),s(this,kr).promise.finally(()=>{s(he,bc).delete(this),p(this,$s,null),p(this,gc,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=Ne.platform;return ht(this,"fontFamilyMap",new Map([["sans-serif",`${t&&e?"Calibri, ":""}sans-serif`],["monospace",`${t&&e?"Lucida Console, ":""}monospace`]]))}render(){const t=()=>{s(this,so).read().then(({value:e,done:i})=>{if(i){s(this,kr).resolve();return}s(this,no)??p(this,no,e.lang),Object.assign(s(this,gc),e.styles),w(this,lr,Lv).call(this,e.items),t()},s(this,kr).reject)};return p(this,so,s(this,mc).getReader()),s(he,bc).add(this),t(),s(this,kr).promise}update({viewport:t,onBefore:e=null}){var r;const i=t.scale*hs.pixelRatio,n=t.rotation;if(n!==s(this,pc)&&(e==null||e(),p(this,pc,n),Wo(s(this,fc),{rotation:n})),i!==s(this,Ir)){e==null||e(),p(this,Ir,i);const a={div:null,properties:null,ctx:w(r=he,zi,np).call(r,s(this,no))};for(const l of s(this,ro))a.properties=s(this,ed).get(l),a.div=l,w(this,lr,zy).call(this,a)}}cancel(){var e;const t=new la("TextLayer task cancelled.");(e=s(this,so))==null||e.cancel(t).catch(()=>{}),p(this,so,null),s(this,kr).reject(t)}get textDivs(){return s(this,ro)}get textContentItemsStr(){return s(this,td)}static cleanup(){if(!(s(this,bc).size>0)){s(this,yc).clear();for(const{canvas:t}of s(this,ao).values())t.remove();s(this,ao).clear()}}};kr=new WeakMap,mi=new WeakMap,Ku=new WeakMap,Ju=new WeakMap,no=new WeakMap,$s=new WeakMap,Qu=new WeakMap,Zu=new WeakMap,so=new WeakMap,fc=new WeakMap,pc=new WeakMap,Ir=new WeakMap,gc=new WeakMap,td=new WeakMap,mc=new WeakMap,ro=new WeakMap,ed=new WeakMap,id=new WeakMap,yc=new WeakMap,ao=new WeakMap,nd=new WeakMap,Fr=new WeakMap,bc=new WeakMap,lr=new WeakSet,Lv=function(t){var n,r;if(s(this,Ku))return;(r=s(this,$s)).ctx??(r.ctx=w(n=he,zi,np).call(n,s(this,no)));const e=s(this,ro),i=s(this,td);for(const a of t){if(e.length>vP){it("Ignoring additional textDivs for performance reasons."),p(this,Ku,!0);return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const l=s(this,mi);p(this,mi,document.createElement("span")),s(this,mi).classList.add("markedContent"),a.id&&s(this,mi).setAttribute("id",`${a.id}`),l.append(s(this,mi))}else a.type==="endMarkedContent"&&p(this,mi,s(this,mi).parentNode);continue}i.push(a.str),w(this,lr,kv).call(this,a)}},kv=function(t){var y;const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};s(this,ro).push(e);const n=W.transform(s(this,id),t.transform);let r=Math.atan2(n[1],n[0]);const a=s(this,gc)[t.fontName];a.vertical&&(r+=Math.PI/2);let l=s(this,Ju)&&a.fontSubstitution||a.fontFamily;l=he.fontFamilyMap.get(l)||l;const c=Math.hypot(n[2],n[3]),h=c*w(y=he,zi,Fv).call(y,l,a,s(this,no));let u,d;
vendor: 1,228 bytes, line 14
14r===0?(u=n[4],d=n[5]-h):(u=n[4]+h*Math.sin(r),d=n[5]-h*Math.cos(r));const f="calc(var(--total-scale-factor) *",m=e.style;s(this,mi)===s(this,fc)?(m.left=`${(100*u/s(this,Zu)).toFixed(2)}%`,m.top=`${(100*d/s(this,Qu)).toFixed(2)}%`):(m.left=`${f}${u.toFixed(2)}px)`,m.top=`${f}${d.toFixed(2)}px)`),m.fontSize=`${f}${(s(he,Fr)*c).toFixed(2)}px)`,m.fontFamily=l,i.fontSize=c,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,s(this,Ju)&&(e.dataset.fontName=a.fontSubstitutionLoadedName||t.fontName),r!==0&&(i.angle=r*(180/Math.PI));let b=!1;if(t.str.length>1)b=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const v=Math.abs(t.transform[0]),S=Math.abs(t.transform[3]);v!==S&&Math.max(v,S)/Math.min(v,S)>1.5&&(b=!0)}if(b&&(i.canvasWidth=a.vertical?t.height:t.width),s(this,ed).set(e,i),s(this,$s).div=e,s(this,$s).properties=i,w(this,lr,zy).call(this,s(this,$s)),i.hasText&&s(this,mi).append(e),i.hasEOL){const v=document.createElement("br");v.setAttribute("role","presentation"),s(this,mi).append(v)}},zy=function(t){var l;const{div:e,properties:i,ctx:n}=t,{style:r}=e;let a="";if(s(he,Fr)>1&&(a=`scale(${1/s(he,Fr)})`),i.canvasWidth!==0&&i.hasText){const{fontFamily:c}=r,{canvasWidth:h,fontSize:u}=i;
14w(l=he,zi,Gy).call(l,n,u*s(this,Ir),c);const{width:d}=n.measureText(e.textContent);d>0&&(a=`scaleX(${h*s(this,Ir)/d}) ${a}`)}i.angle!==0&&(a=`rotate(${i.angle}deg) ${a}`),a.length>0&&(r.transform=a)},zi=new WeakSet,np=function(t=null){let e=s(this,ao).get(t||(t=""));if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),s(this,ao).set(t,e),s(this,nd).set(e,{size:0,family:""})}return e},Gy=function(t,e,i){const n=s(this,nd).get(t);e===n.size&&i===n.family||(t.font=`${e}px ${i}`,n.size=e,n.family=i)},Iv=function(){if(s(this,Fr)!==null)return;const 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),p(this,Fr,t.getBoundingClientRect().height),t.remove()},Fv=function(t,e,i){const n=s(this,yc).get(t);if(n)return n;const r=w(this,zi,np).call(this,i);r.canvas.width=r.canvas.height=PA,w(this,zi,Gy).call(this,r,PA,t);const a=r.measureText(""),l=a.fontBoundingBoxAscent,c=Math.abs(a.fontBoundingBoxDescent);r.canvas.width=r.canvas.height=0;let h=.8;return l?h=l/(l+c):(Ne.platform.isFirefox&&it("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?h=e.ascent:e.descent&&(h=1+e.descent)),s(this,yc).set(t,h),h},A(he,zi),A(he,yc,new Map),A(he,ao,new Map),A(he,nd,new WeakMap),A(he,Fr,null),A(he,bc,new Set);let ou=he;const SP=100;function _P(o={}){typeof o=="string"||o instanceof URL?o={url:o}:(o instanceof ArrayBuffer||ArrayBuffer.isView(o))&&(o={data:o});const t=new Wy,{docId:e}=t,i=o.url?R1(o.url):null,n=o.data?M1(o.data):null,r=o.httpHeaders||null,a=o.withCredentials===!0,l=o.password??null,c=o.range instanceof Nv?o.range:null,h=Number.isInteger(o.rangeChunkSize)&&o.rangeChunkSize>0?o.rangeChunkSize:2**16;let u=o.worker instanceof lu?o.worker:null;const d=o.verbosity,f=typeof o.docBaseUrl=="string"&&!Eg(o.docBaseUrl)?o.docBaseUrl:null,m=Df(o.cMapUrl),b=o.cMapPacked!==!1,y=o.CMapReaderFactory||(ni?B1:pA),v=Df(o.iccUrl),S=Df(o.standardFontDataUrl),x=o.StandardFontDataFactory||(ni?U1:gA),E=Df(o.wasmUrl),C=o.WasmFactory||(ni?$1:mA),T=o.stopAtErrors!==!0,R=Number.isInteger(o.maxImageSize)&&o.maxImageSize>-1?o.maxImageSize:-1,D=o.isEvalSupported!==!1,L=typeof o.isOffscreenCanvasSupported=="boolean"?o.isOffscreenCanvasSupported:!ni,I=typeof o.isImageDecoderSupported=="boolean"?o.isImageDecoderSupported:!ni&&(Ne.platform.isFirefox||!globalThis.chrome),N=Number.isInteger(o.canvasMaxAreaInBytes)?o.canvasMaxAreaInBytes:-1,F=typeof o.disableFontFace=="boolean"?o.disableFontFace:ni,U=o.fontExtraProperties===!0,Y=o.enableXfa===!0,$=o.ownerDocument||globalThis.document,Z=o.disableRange===!0,H=o.disableStream===!0,G=o.disableAutoFetch===!0,pt=o.pdfBug===!0,ft=o.CanvasFactory||(ni?N1:k1),X=o.FilterFactory||(ni?F1:I1),Zt=o.enableHWA===!0,gt=o.useWasm!==!1,J=c?c.length:o.length??NaN,Ut=typeof o.useSystemFonts=="boolean"?o.useSystemFonts:!ni&&!F,tt=typeof o.useWorkerFetch=="boolean"?o.useWorkerFetch:!!(y===pA&&x===gA&&C===mA&&m&&S&&E&&Mh(m,document.baseURI)&&Mh(S,document.baseURI)&&Mh(E,document.baseURI)),me=null;n1(d);const bt={canvasFactory:new ft({ownerDocument:$,enableHWA:Zt}),filterFactory:new X({docId:e,ownerDocument:$}),cMapReaderFactory:tt?null:new y({baseUrl:m,isCompressed:b}),standardFontDataFactory:tt?null:new x({baseUrl:S}),wasmFactory:tt?null:new C({baseUrl:E})};u||(u=lu.create({verbosity:d,port:nr.workerPort}),t._worker=u);const at={docId:e,apiVersion:"5.4.296",data:n,password:l,disableAutoFetch:G,rangeChunkSize:h,length:J,docBaseUrl:f,enableXfa:Y,evaluatorOptions:{maxImageSize:R,disableFontFace:F,ignoreErrors:T,isEvalSupported:D,isOffscreenCanvasSupported:L,isImageDecoderSupported:I,canvasMaxAreaInBytes:N,fontExtraProperties:U,useSystemFonts:Ut,useWasm:gt,useWorkerFetch:tt,cMapUrl:m,iccUrl:v,standardFontDataUrl:S,wasmUrl:E}},Ye={ownerDocument:$,pdfBug:pt,styleElement:me,loadingParams:{disableAutoFetch:G,enableXfa:Y}};return u.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");
14const Ke=u.messageHandler.sendWithPromise("GetDocRequest",at,n?[n.buffer]:null);let ye;if(c)ye=new sP(c,{disableRange:Z,disableStream:H});else if(!n){if(!i)throw new Error("getDocument - no `url` parameter provided.");const Gi=Mh(i)?lP:ni?bP:fP;ye=new Gi({url:i,length:J,httpHeaders:r,withCredentials:a,rangeChunkSize:h,disableRange:Z,disableStream:H})}return Ke.then(Gi=>{if(t.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const ds=new Fh(e,Gi,u.port),vi=new CP(ds,t,ye,Ye,bt,Zt);t._transport=vi,ds.send("Ready",null)})}).catch(t._capability.reject),t}var tg;const eg=class eg{constructor(){k(this,"_capability",Promise.withResolvers());k(this,"_transport",null);k(this,"_worker",null);k(this,"docId",`d${ce(eg,tg)._++}`);k(this,"destroyed",!1);k(this,"onPassword",null);k(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var t,e,i,n;this.destroyed=!0;try{(t=this._worker)!=null&&t.port&&(this._worker._pendingDestroy=!0),await((e=this._transport)==null?void 0:e.destroy())}catch(r){throw(i=this._worker)!=null&&i.port&&delete this._worker._pendingDestroy,r}this._transport=null,(n=this._worker)==null||n.destroy(),this._worker=null}async getData(){return this._transport.getData()}};tg=new WeakMap,A(eg,tg,0);let Wy=eg;var oo,sd,rd,ad,od;class Nv{constructor(t,e,i=!1,n=null){A(this,oo,Promise.withResolvers());A(this,sd,[]);A(this,rd,[]);A(this,ad,[]);A(this,od,[]);this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n}addRangeListener(t){s(this,od).push(t)}addProgressListener(t){s(this,ad).push(t)}addProgressiveReadListener(t){s(this,rd).push(t)}addProgressiveDoneListener(t){s(this,sd).push(t)}onDataRange(t,e){for(const i of s(this,od))i(t,e)}onDataProgress(t,e){s(this,oo).promise.then(()=>{for(const i of s(this,ad))i(t,e)})}onDataProgressiveRead(t){s(this,oo).promise.then(()=>{for(const e of s(this,rd))e(t)})}onDataProgressiveDone(){s(this,oo).promise.then(()=>{for(const t of s(this,sd))t()})}transportReady(){s(this,oo).resolve()}requestDataRange(t,e){Ft("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}oo=new WeakMap,sd=new WeakMap,rd=new WeakMap,ad=new WeakMap,od=new WeakMap;class EP{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 ht(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"}={}){const{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()}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()}}var Hs,lo,zh;
14class xP{constructor(t,e,i,n=!1){A(this,lo);A(this,Hs,!1);this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new oA:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new Ov,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:i=0,offsetY:n=0,dontFlip:r=!1}={}){return new tf({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:r})}getAnnotations({intent:t="display"}={}){const{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 ht(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return((t=this._transport._htmlForXfa)==null?void 0:t.children[this._pageIndex])||null}
14render({canvasContext:t,canvas:e=t.canvas,viewport:i,intent:n="display",annotationMode:r=dr.ENABLE,transform:a=null,background:l=null,optionalContentConfigPromise:c=null,annotationCanvasMap:h=null,pageColors:u=null,printAnnotationStorage:d=null,isEditing:f=!1,recordOperations:m=!1,operationsFilter:b=null}){var I,N,F;(I=this._stats)==null||I.time("Overall");const y=this._transport.getRenderingIntent(n,r,d,f),{renderingIntent:v,cacheKey:S}=y;p(this,Hs,!1),c||(c=this._transport.getOptionalContentConfig(v));let x=this._intentStates.get(S);x||(x=Object.create(null),this._intentStates.set(S,x)),x.streamReaderCancelTimeout&&(clearTimeout(x.streamReaderCancelTimeout),x.streamReaderCancelTimeout=null);const E=!!(v&$i.PRINT);x.displayReadyCapability||(x.displayReadyCapability=Promise.withResolvers(),x.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(N=this._stats)==null||N.time("Page Request"),this._pumpOperatorList(y));const C=!!(this._pdfBug&&((F=globalThis.StepperManager)!=null&&F.enabled)),T=!this.recordedBBoxes&&(m||C),R=U=>{var Y,$;if(x.renderTasks.delete(D),T){const Z=(Y=D.gfx)==null?void 0:Y.dependencyTracker.take();Z&&(D.stepper&&D.stepper.setOperatorBBoxes(Z,D.gfx.dependencyTracker.takeDebugMetadata()),m&&(this.recordedBBoxes=Z))}E&&p(this,Hs,!0),w(this,lo,zh).call(this),U?(D.capability.reject(U),this._abortOperatorList({intentState:x,reason:U instanceof Error?U:new Error(U)})):D.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),($=globalThis.Stats)!=null&&$.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},D=new Vy({callback:R,params:{canvas:e,canvasContext:t,dependencyTracker:T?new j1(e,x.operatorList.length,C):null,viewport:i,transform:a,background:l},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:x.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!E,pdfBug:this._pdfBug,pageColors:u,enableHWA:this._transport.enableHWA,operationsFilter:b});(x.renderTasks||(x.renderTasks=new Set)).add(D);const L=D.task;return Promise.all([x.displayReadyCapability.promise,c]).then(([U,Y])=>{var $;if(this.destroyed){R();return}if(($=this._stats)==null||$.time("Rendering"),!(Y.renderingIntent&v))throw new Error("Mu
14st use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");D.initializeGraphics({transparency:U,optionalContentConfig:Y}),D.operatorListChanged()}).catch(R),L}getOperatorList({intent:t="display",annotationMode:e=dr.ENABLE,printAnnotationStorage:i=null,isEditing:n=!1}={}){var h;function r(){l.operatorList.lastChunk&&(l.opListReadCapability.resolve(l.operatorList),l.renderTasks.delete(c))}const a=this._transport.getRenderingIntent(t,e,i,n,!0);let l=this._intentStates.get(a.cacheKey);l||(l=Object.create(null),this._intentStates.set(a.cacheKey,l));let c;return l.opListReadCapability||(c=Object.create(null),c.operatorListChanged=r,l.opListReadCapability=Promise.withResolvers(),(l.renderTasks||(l.renderTasks=new Set)).add(c),l.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(h=this._stats)==null||h.time("Page Request"),this._pumpOperatorList(a)),l.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(n){return n.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>au.textContent(i));const e=this.streamTextContent(t);return new Promise(function(i,n){function r(){a.read().then(function({value:c,done:h}){if(h){i(l);return}l.lang??(l.lang=c.lang),Object.assign(l.styles,c.styles),l.items.push(...c.items),r()},n)}const a=e.getReader(),l={items:[],styles:Object.create(null),lang:null};r()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),p(this,Hs,!1),Promise.all(t)}cleanup(t=!1){p(this,Hs,!0);const e=w(this,lo,zh).call(this);return t&&e&&this._stats&&(this._stats=new oA),e}_startRenderPage(t,e){var n,r;const i=this._intentStates.get(e);i&&((n=this._stats)==null||n.timeEnd("Page Request"),(r=i.displayReadyCapability)==null||r.resolve(t))}_renderPageChunk(t,e){for(let i=0,n=t.length;i<n;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const i of e.renderTasks)i.operatorListChanged();t.lastChunk&&w(this,lo,zh).call(this)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:i,modifiedIds:n}){const{map:r,transfer:a}=i,c=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:r,modifiedIds:n},a).getReader(),h=this._intentStates.get(e);h.streamReader=c;const u=()=>{c.read().then(({value:d,done:f})=>{if(f){h.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,h),u())},d=>{if(h.streamReader=null,!this._transport.destroyed){if(h.operatorList){h.operatorList.lastChunk=!0;for(const f of h.renderTasks)f.operatorListChanged();w(this,lo,zh).call(this)}if(h.displayReadyCapability)h.displayReadyCapability.reject(d);else if(h.opListReadCapability)h.opListReadCapability.reject(d);else throw d}})};u()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(e instanceof Kb){let n=SP;e.extraDelay>0&&e.extraDelay<1e3&&(n+=e.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},n);return}}if(t.streamReader.cancel(new la(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[n,r]of this._intentStates)if(r===t){this._intentStates.delete(n);break}this.cleanup()}}}get stats(){return this._stats}}Hs=new WeakMap,lo=new WeakSet,zh=function(){if(!s(this,Hs)||this.destroyed)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),p(this,Hs,!1),!0};var Nr,An,js,co,ig,ho,uo,ri,sp,Bv,Uv,Gh,Ac,rp;const Ht=class Ht{constructor({name:t=null,port:e=null,verbosity:i=s1()}={}){A(this,ri);A(this,Nr,Promise.withResolvers());A(this,An,null);A(this,js,null);A(this,co,null);if(this.name=t,this.destroyed=!1,this.verbosity=i,e){if(s(Ht,uo).has(e))throw new Error("Cannot use more than one PDFWorker per port.");s(Ht,uo).set(e,this),w(this,ri,Bv).call(this,e)}
14else w(this,ri,Uv).call(this)}get promise(){return s(this,Nr).promise}get port(){return s(this,js)}get messageHandler(){return s(this,An)}destroy(){var t,e;this.destroyed=!0,(t=s(this,co))==null||t.terminate(),p(this,co,null),s(Ht,uo).delete(s(this,js)),p(this,js,null),(e=s(this,An))==null||e.destroy(),p(this,An,null)}static create(t){const e=s(this,uo).get(t==null?void 0: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 Ht(t)}static get workerSrc(){if(nr.workerSrc)return nr.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return ht(this,"_setupFakeWorkerGlobal",(async()=>s(this,Ac,rp)?s(this,Ac,rp):(await import(this.workerSrc)).WorkerMessageHandler)())}};Nr=new WeakMap,An=new WeakMap,js=new WeakMap,co=new WeakMap,ig=new WeakMap,ho=new WeakMap,uo=new WeakMap,ri=new WeakSet,sp=function(){s(this,Nr).resolve(),s(this,An).send("configure",{verbosity:this.verbosity})},Bv=function(t){p(this,js,t),p(this,An,new Fh("main","worker",t)),s(this,An).on("ready",()=>{}),w(this,ri,sp).call(this)},Uv=function(){if(s(Ht,ho)||s(Ht,Ac,rp)){w(this,ri,Gh).call(this);return}let{workerSrc:t}=Ht;try{Ht._isSameOrigin(window.location,t)||(t=Ht._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new Fh("main","worker",e),n=()=>{r.abort(),i.destroy(),e.terminate(),this.destroyed?s(this,Nr).reject(new Error("Worker was destroyed")):w(this,ri,Gh).call(this)},r=new AbortController;e.addEventListener("error",()=>{s(this,co)||n()},{signal:r.signal}),i.on("test",l=>{if(r.abort(),this.destroyed||!l){n();return}p(this,An,i),p(this,js,e),p(this,co,e),w(this,ri,sp).call(this)}),i.on("ready",l=>{if(r.abort(),this.destroyed){n();return}try{a()}catch{w(this,ri,Gh).call(this)}});const a=()=>{const l=new Uint8Array;i.send("test",l,[l.buffer])};a();return}catch{_g("The worker has been disabled.")}w(this,ri,Gh).call(this)},Gh=function(){s(Ht,ho)||(it("Setting up fake worker."),p(Ht,ho,!0)),Ht._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){s(this,Nr).reject(new Error("Worker was destroyed"));return}const e=new L1;p(this,js,e);const i=`fake${ce(Ht,ig)._++}`,n=new Fh(i+"_worker",i,e);t.setup(n,e),p(this,An,new Fh(i,i+"_worker",e)),w(this,ri,sp).call(this)}).catch(t=>{s(this,Nr).reject(new Error(`Setting up fake worker failed: "${t.message}".`))})},Ac=new WeakSet,rp=function(){var t;try{return((t=globalThis.pdfjsWorker)==null?void 0:t.WorkerMessageHandler)||null}catch{return null}},A(Ht,Ac),A(Ht,ig,0),A(Ht,ho,!1),A(Ht,uo,new WeakMap),ni&&(p(Ht,ho,!0),nr.workerSrc||(nr.workerSrc="./pdf.worker.mjs")),Ht._isSameOrigin=(t,e)=>{const i=URL.parse(t);if(!(i!=null&&i.origin)||i.origin==="null")return!1;const n=new URL(e,i);return i.origin===n.origin},Ht._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},Ht.fromPort=t=>{if(m1("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!(t!=null&&t.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return Ht.create(t)};let lu=Ht;var zs,Qn,wc,vc,Gs,fo,Wh;class CP{constructor(t,e,i,n,r,a){A(this,fo);A(this,zs,new Map);A(this,Qn,new Map);A(this,wc,new Map);A(this,vc,new Map);A(this,Gs,null);this.messageHandler=t,this.loadingTask=e,this.commonObjs=new Ov,this.fontLoader=new T1({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.cMapReaderFactory=r.cMapReaderFactory,this.standardFontDataFactory=r.standardFontDataFactory,this.wasmFactory=r.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=a,this.setupMessageHandler()}get annotationStorage(){return ht(this,"annotationStorage",new Qb)}getRenderingIntent(t,e=dr.ENABLE,i=null,n=!1,r=!1){let a=$i.DISPLAY,l=Ry;switch(t){case"any":a=$i.ANY;break;case"display":break;case"print":a=$i.PRINT;break;default:it(`getRenderingIntent - invalid intent: ${t}`)}const c=a&$i.PRINT&&i instanceof mv?i:this.annotationStorage;switch(e){case dr.DISABLE:a+=$i.ANNOTATIONS_DISABLE;break;case dr.ENABLE:break;case dr.ENABLE_FORMS:a+=$i.ANNOTATIONS_FORMS;break;case dr.ENABLE_STORAGE:a+=$i.ANNOTATIONS_STORAGE,l=c.serializable;break;default:it(`getRenderingIntent - invalid annotationMode: ${e}`)}n&&(a+=$i.IS_EDITING),r&&(a+=$i.OPLIST);const{ids:h,hash:u}=c.modifiedIds,d=[a,l.hash,u];return{renderingIntent:a,cacheKey:d.join("_"),annotationStorageSerializable:l,modifiedIds:h}}destroy(){var i;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(i=s(this,Gs))==null||i.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const n of s(this,Qn).values())t.push(n._destroy());s(this,Qn).clear(),s(this,wc).clear(),s(this,vc).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();
14const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{var n,r;this.commonObjs.clear(),this.fontLoader.clear(),s(this,zs).clear(),this.filterFactory.destroy(),ou.cleanup(),(n=this._networkStream)==null||n.cancelAllRequests(new la("Worker was terminated.")),(r=this.messageHandler)==null||r.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(i,n)=>{yt(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=r=>{this._lastProgress={loaded:r.loaded,total:r.total}},n.onPull=()=>{this._fullReader.read().then(function({value:r,done:a}){if(a){n.close();return}yt(r instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(r),1,[r])}).catch(r=>{n.error(r)})},n.onCancel=r=>{this._fullReader.cancel(r),n.ready.catch(a=>{if(!this.destroyed)throw a})}}),t.on("ReaderHeadersReady",async i=>{var l;await this._fullReader.headersReady;const{isStreamingSupported:n,isRangeSupported:r,contentLength:a}=this._fullReader;return(!n||!r)&&(this._lastProgress&&((l=e.onProgress)==null||l.call(e,this._lastProgress)),this._fullReader.onProgress=c=>{var h;(h=e.onProgress)==null||h.call(e,{loaded:c.loaded,total:c.total})}),{isStreamingSupported:n,isRangeSupported:r,contentLength:a}}),t.on("GetRangeReader",(i,n)=>{yt(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(i.begin,i.end);if(!r){n.close();return}n.onPull=()=>{r.read().then(function({value:a,done:l}){if(l){n.close();return}yt(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{n.error(a)})},n.onCancel=a=>{r.cancel(a),n.ready.catch(l=>{if(!this.destroyed)throw l})}}),t.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,e._capability.resolve(new EP(i,this))}),t.on("DocException",i=>{e._capability.reject(hi(i))}),t.on("PasswordRequest",i=>{p(this,Gs,Promise.withResolvers());try{if(!e.onPassword)throw hi(i);const n=r=>{r instanceof Error?s(this,Gs).reject(r):s(this,Gs).resolve({password:r})};e.onPassword(n,i.code)}catch(n){s(this,Gs).reject(n)}return s(this,Gs).promise}),t.on("DataLoaded",i=>{var n;(n=e.onProgress)==null||n.call(e,{loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),t.on("StartRenderPage",i=>{if(this.destroyed)return;s(this,Qn).get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),t.on("commonobj",([i,n,r])=>{var a;if(this.destroyed||this.commonObjs.has(i))return null;switch(n){case"Font":if("error"in r){const d=r.error;it(`Error during font loading: ${d}`),this.commonObjs.resolve(i,d);break}const l=new $y(r),c=this._params.pdfBug&&((a=globalThis.FontInspector)!=null&&a.enabled)?(d,f)=>globalThis.FontInspector.fontAdded(d,f):null,h=new P1(l,c,r.extra,r.charProcOperatorList);this.fontLoader.bind(h).catch(()=>t.sendWithPromise("FontFallback",{id:i})).finally(()=>{!h.fontExtraProperties&&h.data&&h.clearData(),this.commonObjs.resolve(i,h)});break;case"CopyLocalImage":const{imageRef:u}=r;yt(u,"The imageRef must be defined.");for(const d of s(this,Qn).values())for(const[,f]of d.objs)if((f==null?void 0:f.ref)===u)return f.dataLen?(this.commonObjs.resolve(i,structuredClone(f)),f.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,r);break;default:throw new Error(`Got unknown common object type ${n}`)}return null}),t.on("obj",([i,n,r,a])=>{var c;if(this.destroyed)return;const l=s(this,Qn).get(n);if(!l.objs.has(i)){if(l._intentStates.size===0){(c=a==null?void 0:a.bitmap)==null||c.close();return}switch(r){case"Image":case"Pattern":l.objs.resolve(i,a);break;default:throw new Error(`Got unknown object type ${r}`)}}}),t.on("DocProgress",i=>{var n;this.destroyed||(n=e.onProgress)==null||n.call(e,{loaded:i.loaded,total:i.total})}),t.on("FetchBinaryData",async i=>{if(this.destroyed)throw new Error("Worker was destroyed.");const n=this[i.type];if(!n)throw new Error(`${i.type} not initialized, see the \`useWorkerFetch\` parameter.`);return n.fetch(i)})}
14getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var i;this.annotationStorage.size<=0&&it("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:((i=this._fullReader)==null?void 0:i.filename)??null},e).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=s(this,wc).get(e);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(r=>{if(this.destroyed)throw new Error("Transport destroyed");r.refStr&&s(this,vc).set(r.refStr,t);const a=new xP(e,r,this,this._params.pdfBug);return s(this,Qn).set(e,a),a});return s(this,wc).set(e,n),n}getPageIndex(t){return My(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 w(this,fo,Wh).call(this,"GetFieldObjects")}hasJSActions(){return w(this,fo,Wh).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 w(this,fo,Wh).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 w(this,fo,Wh).call(this,"GetOptionalContentConfig").then(e=>new nP(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=s(this,zs).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(n=>{var r,a;return{info:n[0],metadata:n[1]?new eP(n[1]):null,contentDispositionFilename:((r=this._fullReader)==null?void 0:r.filename)??null,contentLength:((a=this._fullReader)==null?void 0:a.contentLength)??null}});return s(this,zs).set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of s(this,Qn).values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),s(this,zs).clear(),this.filterFactory.destroy(!0),ou.cleanup()}}cachedPageNumber(t){if(!My(t))return null;const e=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return s(this,vc).get(e)??null}}zs=new WeakMap,Qn=new WeakMap,wc=new WeakMap,vc=new WeakMap,Gs=new WeakMap,fo=new WeakSet,Wh=function(t,e=null){const i=s(this,zs).get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return s(this,zs).set(t,n),n};var Br;class TP{constructor(t){A(this,Br,null);k(this,"onContinue",null);k(this,"onError",null);p(this,Br,t)}get promise(){return s(this,Br).capability.promise}cancel(t=0){s(this,Br).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=s(this,Br).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=s(this,Br);return t.form||t.canvas&&(e==null?void 0:e.size)>0}}Br=new WeakMap;var Ur,po;const Ca=class Ca{constructor({callback:t,params:e,objs:i,commonObjs:n,annotationCanvasMap:r,operatorList:a,pageIndex:l,canvasFactory:c,filterFactory:h,useRequestAnimationFrame:u=!1,pdfBug:d=!1,pageColors:f=null,enableHWA:m=!1,operationsFilter:b=null}){A(this,Ur,null);this.callback=t,this.params=e,this.objs=i,this.commonObjs=n,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=l,this.canvasFactory=c,this.filterFactory=h,this._pdfBug=d,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=u===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new TP(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=m,this._dependencyTracker=e.depen
14dencyTracker,this._operationsFilter=b}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){var c,h;if(this.cancelled)return;if(this._canvas){if(s(Ca,po).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.");s(Ca,po).add(this._canvas)}this._pdfBug&&((c=globalThis.StepperManager)!=null&&c.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:i,transform:n,background:r,dependencyTracker:a}=this.params,l=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new Pl(l,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors,a),this.gfx.beginDrawing({transform:n,viewport:i,transparency:t,background:r}),this.operatorListIdx=0,this.graphicsReady=!0,(h=this.graphicsReadyCallback)==null||h.call(this)}cancel(t=null,e=0){var i,n,r;this.running=!1,this.cancelled=!0,(i=this.gfx)==null||i.endDrawing(),s(this,Ur)&&(window.cancelAnimationFrame(s(this,Ur)),p(this,Ur,null)),s(Ca,po).delete(this._canvas),t||(t=new Kb(`Rendering cancelled, page ${this._pageIndex+1}`,e)),this.callback(t),(r=(n=this.task).onError)==null||r.call(n,t)}operatorListChanged(){var t,e;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(t=this.gfx.dependencyTracker)==null||t.growOperationsCount(this.operatorList.fnArray.length),(e=this.stepper)==null||e.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?p(this,Ur,window.requestAnimationFrame(()=>{p(this,Ur,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(),s(Ca,po).delete(this._canvas),this.callback())))}};Ur=new WeakMap,po=new WeakMap,A(Ca,po,new WeakSet);let Vy=Ca;const PP="5.4.296",RP="f56dc8601";var Pi,go,Sc,pe,ld,_c,Ws,cd,$r,wn,hd,Ot,qy,Xy,Yy,wa,$v,ur;const ui=class ui{constructor({editor:t=null,uiManager:e=null}){A(this,Ot);A(this,Pi,null);A(this,go,null);A(this,Sc);A(this,pe,null);A(this,ld,!1);A(this,_c,!1);A(this,Ws,null);A(this,cd);A(this,$r,null);A(this,wn,null);var i,n;t?(p(this,_c,!1),p(this,Ws,t)):p(this,_c,!0),p(this,wn,(t==null?void 0:t._uiManager)||e),p(this,cd,s(this,wn)._eventBus),p(this,Sc,((i=t==null?void 0:t.color)==null?void 0:i.toUpperCase())||((n=s(this,wn))==null?void 0:n.highlightColors.values().next().value)||"#FFFF98"),s(ui,hd)||p(ui,hd,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 ht(this,"_keyboardManager",new nf([[["Escape","mac+Escape"],ui.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],ui.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],ui.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],ui.prototype._moveToPrevious],[["Home","mac+Home"],ui.prototype._moveToBeginning],[["End","mac+End"],ui.prototype._moveToEnd]]))}renderButton(){const t=p(this,Pi,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",s(this,Ws)&&(t.ariaControls=`${s(this,Ws).id}_colorpicker_dropdown`);const e=s(this,wn)._signal;t.addEventListener("click",w(this,Ot,wa).bind(this),{signal:e}),t.addEventListener("keydown",w(this,Ot,Yy).bind(this),{signal:e});const i=p(this,go,document.createElement("span"));return i.className="swatch",i.ariaHidden="true",i.style.backgroundColor=s(this,Sc),t.append(i),t}renderMainDropdown(){const t=p(this,pe,w(this,Ot,qy).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===s(this,Pi)){w(this,Ot,wa).call(this,t);return}const e=t.target.getAttribute("data-color");e&&w(this,Ot,Xy).call(this,e,t)}_moveToNext(t){var e,i;if(!s(this,Ot,ur)){w(this,Ot,wa).call(this,t);return}if(t.target===s(this,Pi)){(e=s(this,pe).firstChild)==null||e.focus();return}(i=t.target.nextSibling)==null||i.focus()}_moveToPrevious(t){var e,i;if(t.target===((e=s(this,pe))==null?void 0:e.firstChild)||t.target===s(this,Pi)){s(this,Ot,ur)&&this._hideDropdownFromKeyboard();return}s(this,Ot,ur)||w(this,Ot,wa).call(this,t),(i=t.target.previousSibling)==null||i.focus()}_moveToBeginning(t){var e;if(!s(this,Ot,ur)){w(this,Ot,wa).call(this,t);return}(e=s(this,pe).firstChild)==null||e.focus()}_moveToEnd(t){var e;if(!s(this,Ot,ur)){w(this,Ot,wa).call(this,t);return}(e=s(this,pe).lastChild)==null||e.focus()}hideDropdown(){var t,e;(t=s(this,pe))==null||t.classList.add("hidden"),s(this,Pi).ariaExpanded="false",(e=s(this,$r))==null||e.abort(),p(this,$r,null)}_hideDropdownFromKeyboard(){var t;if(!s(this,_c)){if(!s(this,Ot,ur)){(t=s(this,Ws))==null||t.unselect();return}this.hideDropdown(),s(this,Pi).focus({preventScroll:!0,focusVisible:s(this,ld)})}}updateColor(t){if(s(this,go)&&(s(this,go).style.backgroundColor=t),!s(this,pe))return;const e=s(this,wn).highlightColors.values();for(const i of s(this,pe).children)i.ariaSelected=e.next().value===t.toUpperCase()}destroy(){var t,e;(t=s(this,Pi))==null||t.remove(),p(this,Pi,null),p(this,go,null),(e=s(this,pe))==null||e.remove(),p(this,pe,null)}};Pi=new WeakMap,go=new WeakMap,Sc=new WeakMap,pe=new WeakMap,ld=new WeakMap,_c=new WeakMap,Ws=new WeakMap,cd=new WeakMap,$r=new WeakMap,wn=new WeakMap,hd=new WeakMap,Ot=new WeakSet,qy=function(){const t=document.createElement("div"),e=s(this,wn)._signal;t.addEventListener("contextmenu",cn,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),s(this,Ws)&&(t.id=`${s(this,Ws).id}_colorpicker_dropdown`);for(const[i,n]of s(this,wn).highlightColors){const r=document.createElement("button");r.tabIndex="0",r.role="option",r.setAttribute("data-color",n),r.title=i,r.setAttribute("data-l10n-id",s(ui,hd)[i]);const a=document.createElement("span");r.append(a),a.className="swatch",a.style.backgroundColor=n,r.ariaSelected=n===s(this,Sc),r.addEventListener("click",w(this,Ot,Xy).bind(this,n),{signal:e}),t.append(r)}return t.addEventListener("keydown",w(this,Ot,Yy).bind(this),{signal:e}),t},Xy=function(t,e){e.stopPropagation(),s(this,cd).dispatch("switchannotationeditorparams",{source:this,type:mt.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)}
14,Yy=function(t){ui._keyboardManager.exec(this,t)},wa=function(t){if(s(this,Ot,ur)){this.hideDropdown();return}if(p(this,ld,t.detail===0),s(this,$r)||(p(this,$r,new AbortController),window.addEventListener("pointerdown",w(this,Ot,$v).bind(this),{signal:s(this,wn).combinedSignal(s(this,$r))})),s(this,Pi).ariaExpanded="true",s(this,pe)){s(this,pe).classList.remove("hidden");return}const e=p(this,pe,w(this,Ot,qy).call(this));s(this,Pi).append(e)},$v=function(t){var e;(e=s(this,pe))!=null&&e.contains(t.target)||this.hideDropdown()},ur=function(){return s(this,pe)&&!s(this,pe).classList.contains("hidden")},A(ui,hd,null);let Up=ui;var Zn,ud,Ec,dd;const Ta=class Ta{constructor(t){A(this,Zn,null);A(this,ud,null);A(this,Ec,null);p(this,ud,t),p(this,Ec,t._uiManager),s(Ta,dd)||p(Ta,dd,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(s(this,Zn))return s(this,Zn);const{editorType:t,colorType:e,colorValue:i}=s(this,ud),n=p(this,Zn,document.createElement("input"));return n.type="color",n.value=i||"#000000",n.className="basicColorPicker",n.tabIndex=0,n.setAttribute("data-l10n-id",s(Ta,dd)[t]),n.addEventListener("input",()=>{s(this,Ec).updateParams(e,n.value)},{signal:s(this,Ec)._signal}),n}update(t){s(this,Zn)&&(s(this,Zn).value=t)}destroy(){var t;(t=s(this,Zn))==null||t.remove(),p(this,Zn,null)}hideDropdown(){}};Zn=new WeakMap,ud=new WeakMap,Ec=new WeakMap,dd=new WeakMap,A(Ta,dd,null);let $p=Ta;function RA(o){return Math.floor(Math.max(0,Math.min(1,o))*255).toString(16).padStart(2,"0")}function Th(o){return Math.max(0,Math.min(255,255*o))}class MA{static CMYK_G([t,e,i,n]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+n)]}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=Th(t),[t,t,t]}static G_HTML([t]){const e=RA(t);return`#${e}${e}${e}`}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_rgb(t){return t.map(Th)}static RGB_HTML(t){return`#${t.map(RA).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,i,n]){return["RGB",1-Math.min(1,t+n),1-Math.min(1,i+n),1-Math.min(1,e+n)]}static CMYK_rgb([t,e,i,n]){return[Th(1-Math.min(1,t+n)),Th(1-Math.min(1,i+n)),Th(1-Math.min(1,e+n))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,i]){const n=1-t,r=1-e,a=1-i,l=Math.min(n,r,a);return["CMYK",n,r,a,l]}}class MP{create(t,e,i=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width",`${t}px`),n.setAttribute("height",`${e}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${t} ${e}`),n}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Ft("Abstract method `_createSVG` called.")}}class Hp extends MP{_createSVG(t){return document.createElementNS(ys,t)}}const DP=9,qo=new WeakSet,OP=new Date().getTimezoneOffset()*60*1e3;class DA{static create(t){switch(t.data.annotationType){case se.LINK:return new e0(t);case se.TEXT:return new kP(t);case se.WIDGET:switch(t.data.fieldType){case"Tx":return new IP(t);case"Btn":return t.data.radioButton?new zv(t):t.data.checkBox?new NP(t):new BP(t);case"Ch":return new UP(t);case"Sig":return new FP(t)}return new Ko(t);case se.POPUP:return new Jy(t);case se.FREETEXT:return new Xv(t);case se.LINE:return new HP(t);case se.SQUARE:return new jP(t);case se.CIRCLE:return new zP(t);case se.POLYLINE:return new Yv(t);case se.CARET:return new WP(t);case se.INK:return new i0(t);case se.POLYGON:return new GP(t);case se.HIGHLIGHT:return new Kv(t);case se.UNDERLINE:return new VP(t);case se.SQUIGGLY:return new qP(t);case se.STRIKEOUT:return new XP(t);case se.STAMP:return new Jv(t);case se.FILEATTACHMENT:return new YP(t);default:return new qt(t)}}}var mo,xc,sn,fd,Ky;const c0=class c0{constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}={}){A(this,fd);A(this,mo,null);A(this,xc,!1);A(this,sn,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,e&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:e}){return!!(t!=null&&t.str||e!=null&&e.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return c0._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){var i;const{data:t}=this,e=(i=this.annotationStorage)==null?void 0:i.getEditor(t.id);return e?e.getData():t}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}
14get commentButtonPosition(){var l;const t=(l=this.annotationStorage)==null?void 0:l.getEditor(this.data.id);if(t)return t.commentButtonPositionInPage;const{quadPoints:e,inkLists:i,rect:n}=this.data;let r=-1/0,a=-1/0;if((e==null?void 0:e.length)>=8){for(let c=0;c<e.length;c+=8)e[c+1]>a?(a=e[c+1],r=e[c+2]):e[c+1]===a&&(r=Math.max(r,e[c+2]));return[r,a]}if((i==null?void 0:i.length)>=1){for(const c of i)for(let h=0,u=c.length;h<u;h+=2)c[h+1]>a?(a=c[h+1],r=c[h]):c[h+1]===a&&(r=Math.max(r,c[h]));if(r!==1/0)return[r,a]}return n?[n[2],n[3]]:null}_normalizePoint(t){const{page:{view:e},viewport:{rawDims:{pageWidth:i,pageHeight:n,pageX:r,pageY:a}}}=this.parent;return t[1]=e[3]-t[1]+e[1],t[0]=100*(t[0]-r)/i,t[1]=100*(t[1]-a)/n,t}get commentText(){var e,i,n;const{data:t}=this;return((i=(e=this.annotationStorage.getRawValue(`${su}${t.id}`))==null?void 0:e.popup)==null?void 0:i.contents)||((n=t.contentsObj)==null?void 0:n.str)||""}set commentText(t){const{data:e}=this,i={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(e.id,{popup:i})||this.annotationStorage.setValue(`${su}${e.id}`,{id:e.id,annotationType:e.annotationType,pageIndex:this.parent.page._pageIndex,popup:i,popupRef:e.popupRef,modificationDate:new Date}),t||this.removePopup()}removePopup(){var t,e;(e=((t=s(this,sn))==null?void 0:t.popup)||this.popup)==null||e.remove(),p(this,sn,this.popup=null)}updateEdited(t){var r;if(!this.container)return;t.rect&&(s(this,mo)||p(this,mo,{rect:this.data.rect.slice(0)}));const{rect:e,popup:i}=t;e&&w(this,fd,Ky).call(this,e);let n=((r=s(this,sn))==null?void 0:r.popup)||this.popup;!n&&(i!=null&&i.text)&&(this._createPopup(i),n=s(this,sn).popup),n&&(n.updateEdited(t),i!=null&&i.deleted&&(n.remove(),p(this,sn,null),this.popup=null))}resetEdited(){var t;s(this,mo)&&(w(this,fd,Ky).call(this,s(this,mo).rect),(t=s(this,sn))==null||t.popup.resetEdited(),p(this,mo,null))}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,r=document.createElement("section");r.setAttribute("data-annotation-id",e.id),!(this instanceof Ko)&&!(this instanceof e0)&&(r.tabIndex=0);const{style:a}=r;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,e.alternativeText&&(r.title=e.alternativeText),e.noRotate&&r.classList.add("norotate"),!e.rect||this instanceof Jy){const{rotation:y}=e;return!e.hasOwnCanvas&&y!==0&&this.setRotation(y,r),r}const{width:l,height:c}=this;if(!t&&e.borderStyle.width>0){a.borderWidth=`${e.borderStyle.width}px`;const y=e.borderStyle.horizontalCornerRadius,v=e.borderStyle.verticalCornerRadius;if(y>0||v>0){const x=`calc(${y}px * var(--total-scale-factor)) / calc(${v}px * var(--total-scale-factor))`;a.borderRadius=x}else if(this instanceof zv){const x=`calc(${l}px * var(--total-scale-factor)) / calc(${c}px * var(--total-scale-factor))`;a.borderRadius=x}switch(e.borderStyle.style){case fl.SOLID:a.borderStyle="solid";break;case fl.DASHED:a.borderStyle="dashed";break;case fl.BEVELED:it("Unimplemented border style: beveled");break;case fl.INSET:it("Unimplemented border style: inset");break;case fl.UNDERLINE:a.borderBottomStyle="solid";break}const S=e.borderColor||null;S?(p(this,xc,!0),a.borderColor=W.makeHexColor(S[0]|0,S[1]|0,S[2]|0)):a.borderWidth=0}const h=W.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:u,pageHeight:d,pageX:f,pageY:m}=n.rawDims;a.left=`${100*(h[0]-f)/u}%`,a.top=`${100*(h[1]-m)/d}%`;const{rotation:b}=e;return e.hasOwnCanvas||b===0?(a.width=`${100*l/u}%`,a.height=`${100*c/d}%`):this.setRotation(b,r),r}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims;let{width:r,height:a}=this;t%180!==0&&([r,a]=[a,r]),e.style.width=`${100*r/i}%`,e.style.height=`${100*a/n}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(e,i,n)=>{const r=n.detail[e],a=r[0],l=r.slice(1);n.target.style[i]=MA[`${a}_HTML`](l),this.annotationStorage.setValue(this.data.id,{[i]:MA[`${a}_rgb`](l)})};return ht(this,"_commonActions",{display:e=>{const{display:i}=e.detail,n=i%2===1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:i===1||i===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:i}=e.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:e=>{setTimeout(()=>
14e.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=>{const i=e.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const n of Object.keys(e.detail)){const r=t[n]||i[n];r==null||r(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[n,r]of Object.entries(e)){const a=i[n];if(a){const l={detail:{[n]:r},target:t};a(l),delete e[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,n,r]=this.data.rect.map(y=>Math.fround(y));if(t.length===8){const[y,v,S,x]=t.subarray(2,6);if(n===y&&r===v&&e===S&&i===x)return}const{style:a}=this.container;let l;if(s(this,xc)){const{borderColor:y,borderWidth:v}=a;a.borderWidth=0,l=["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="${v}">`],this.container.classList.add("hasBorder")}const c=n-e,h=r-i,{svgFactory:u}=this,d=u.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0),d.role="none";const f=u.createElement("defs");d.append(f);const m=u.createElement("clipPath"),b=`clippath_${this.data.id}`;m.setAttribute("id",b),m.setAttribute("clipPathUnits","objectBoundingBox"),f.append(m);for(let y=2,v=t.length;y<v;y+=8){const S=t[y],x=t[y+1],E=t[y+2],C=t[y+3],T=u.createElement("rect"),R=(E-e)/c,D=(r-x)/h,L=(S-E)/c,I=(x-C)/h;T.setAttribute("x",R),T.setAttribute("y",D),T.setAttribute("width",L),T.setAttribute("height",I),m.append(T),l==null||l.push(`<rect vector-effect="non-scaling-stroke" x="${R}" y="${D}" width="${L}" height="${I}"/>`)}s(this,xc)&&(l.push("</g></svg>')"),a.backgroundImage=l.join("")),this.container.append(d),this.container.style.clipPath=`url(#${b})`}_createPopup(t=null){const{data:e}=this;let i,n;t?(i={str:t.text},n=t.date):(i=e.contentsObj,n=e.modificationDate);const r=p(this,sn,new Jy({data:{color:e.color,titleObj:e.titleObj,modificationDate:n,contentsObj:i,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]}));this.parent._commentManager||this.parent.div.append(r.render())}get hasPopupElement(){return!!(s(this,sn)||this.popup||this.data.popupRef)}get extraPopupElement(){return s(this,sn)}render(){Ft("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const i=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:r,id:a,exportValues:l}of n){if(r===-1||a===e)continue;const c=typeof l=="string"?l:null,h=document.querySelector(`[data-element-id="${a}"]`);if(h&&!qo.has(h)){it(`_getElementsByName - element not allowed: ${a}`);continue}i.push({id:a,exportValue:c,domElement:h})}return i}for(const n of document.getElementsByName(t)){const{exportValue:r}=n,a=n.getAttribute("data-element-id");a!==e&&qo.has(n)&&i.push({id:a,exportValue:r,domElement:n})}return i}show(){var t;this.container&&(this.container.hidden=!1),(t=this.popup)==null||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),(t=this.popup)==null||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{var i;(i=this.linkService.eventBus)==null||i.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]}};mo=new WeakMap,xc=new WeakMap,sn=new WeakMap,fd=new WeakSet,Ky=function(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:r,pageHeight:a,pageX:l,pageY:c}}}}=this;i==null||i.splice(0,4,...t),e.left=`${100*(t[0]-l)/r}
14%`,e.top=`${100*(a-t[3]+c)/a}%`,n===0?(e.width=`${100*(t[2]-t[0])/r}%`,e.height=`${100*(t[3]-t[1])/a}%`):this.setRotation(n)};let qt=c0;class LP extends qt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.editor=t.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:t}=this;t.hasComment&&(this._createPopup(t.comment),this.extraPopupElement.popup.renderCommentButton())}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.container.remove(),this.container=null,this.removePopup()}}var ji,va,Hv,jv;class e0 extends qt{constructor(e,i=null){super(e,{isRenderable:!0,ignoreBorder:!!(i!=null&&i.ignoreBorder),createQuadrilaterals:!0});A(this,ji);this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:i}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let r=!1;return e.url?(i.addLinkAttributes(n,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(n,e.action,e.overlaidText),r=!0):e.attachment?(w(this,ji,Hv).call(this,n,e.attachment,e.overlaidText,e.attachmentDest),r=!0):e.setOCGState?(w(this,ji,jv).call(this,n,e.setOCGState,e.overlaidText),r=!0):e.dest?(this._bindLink(n,e.dest,e.overlaidText),r=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),r=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,""),r=!0)),this.container.classList.add("linkAnnotation"),r&&this.container.append(n),this.container}_bindLink(e,i,n=""){e.href=this.linkService.getDestinationHash(i),e.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||i==="")&&w(this,ji,va).call(this),n&&(e.title=n)}_bindNamedAction(e,i,n=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(i),!1),n&&(e.title=n),w(this,ji,va).call(this)}_bindJSAction(e,i){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(i.actions)){const a=n.get(r);a&&(e[a]=()=>{var l;return(l=this.linkService.eventBus)==null||l.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:r}}),!1})}i.overlaidText&&(e.title=i.overlaidText),e.onclick||(e.onclick=()=>!1),w(this,ji,va).call(this)}_bindResetFormAction(e,i){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),w(this,ji,va).call(this),!this._fieldObjects){it('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(e.onclick=()=>!1);return}e.onclick=()=>{var d;n==null||n();const{fields:r,refs:a,include:l}=i,c=[];if(r.length!==0||a.length!==0){const f=new Set(a);for(const m of r){const b=this._fieldObjects[m]||[];for(const{id:y}of b)f.add(y)}for(const m of Object.values(this._fieldObjects))for(const b of m)f.has(b.id)===l&&c.push(b)}else for(const f of Object.values(this._fieldObjects))c.push(...f);const h=this.annotationStorage,u=[];for(const f of c){const{id:m}=f;switch(u.push(m),f.type){case"text":{const y=f.defaultValue||"";h.setValue(m,{value:y});break}case"checkbox":case"radiobutton":{const y=f.defaultValue===f.exportValues;h.setValue(m,{value:y});break}case"combobox":case"listbox":{const y=f.defaultValue||"";h.setValue(m,{value:y});break}default:continue}const b=document.querySelector(`[data-element-id="${m}"]`);if(b){if(!qo.has(b)){it(`_bindResetFormAction - element not allowed: ${m}`);continue}}else continue;b.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((d=this.linkService.eventBus)==null||d.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:u,name:"ResetForm"}})),!1}}}ji=new WeakSet,va=function(){this.container.setAttribute("data-internal-link","")},Hv=function(e,i,n="",r=null){e.href=this.linkService.getAnchorUrl(""),i.description?e.title=i.description:n&&(e.title=n),e.onclick=()=>{var a;return(a=this.downloadManager)==null||a.openOrDownloadData(i.content,i.filename,r),!1},w(this,ji,va).call(this)},jv=function(e,i,n=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(i),!1),n&&(e.title=n),w(this,ji,va).call(this)};class kP extends qt{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const 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._createPopup(),this.container.append(t),this.container}}
14class Ko extends qt{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&(((e=t.previousSibling)==null?void 0:e.nodeName)==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Ne.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,r){i.includes("mouse")?t.addEventListener(i,a=>{var l;(l=this.linkService.eventBus)==null||l.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):t.addEventListener(i,a=>{var l;if(i==="blur"){if(!e.focused||!a.relatedTarget)return;e.focused=!1}else if(i==="focus"){if(e.focused)return;e.focused=!0}r&&((l=this.linkService.eventBus)==null||l.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(a)}}))})}_setEventListeners(t,e,i,n){var r,a,l;for(const[c,h]of i)(h==="Action"||(r=this.data.actions)!=null&&r[h])&&((h==="Focus"||h==="Blur")&&(e||(e={focused:!1})),this._setEventListener(t,e,c,h,n),h==="Focus"&&!((a=this.data.actions)!=null&&a.Blur)?this._setEventListener(t,e,"blur","Blur",null):h==="Blur"&&!((l=this.data.actions)!=null&&l.Focus)&&this._setEventListener(t,e,"focus","Focus",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=e===null?"transparent":W.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||DP,r=t.style;let a;const l=2,c=h=>Math.round(10*h)/10;if(this.data.multiLine){const h=Math.abs(this.data.rect[3]-this.data.rect[1]-l),u=Math.round(h/($m*n))||1,d=h/u;a=Math.min(n,c(d/$m))}else{const h=Math.abs(this.data.rect[3]-this.data.rect[1]-l);a=Math.min(n,c(h/$m))}r.fontSize=`calc(${a}px * var(--total-scale-factor))`,r.color=W.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(r.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class IP extends Ko{constructor(t){const e=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:e})}setPropertyOnSiblings(t,e,i,n){const r=this.annotationStorage;
14for(const a of this._getElementsByName(t.name,t.id))a.domElement&&(a.domElement[e]=i),r.setValue(a.id,{[n]:i})}render(){var n,r;const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const a=t.getValue(e,{value:this.data.fieldValue});let l=a.value||"";const c=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;c&&l.length>c&&(l=l.slice(0,c));let h=a.formattedValue||((n=this.data.textContent)==null?void 0:n.join(` 15`))||null;h&&this.data.comb&&(h=h.replaceAll(/\s+/g,""));const u={userValue:l,formattedValue:h,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=h??l,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type=this.data.password?"password":"text",i.setAttribute("value",h??l),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),qo.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=0;const{datetimeFormat:d,datetimeType:f,timeStep:m}=this.data,b=!!f&&this.enableScripting;d&&(i.title=d),this._setRequired(i,this.data.required),c&&(i.maxLength=c),i.addEventListener("input",v=>{t.setValue(e,{value:v.target.value}),this.setPropertyOnSiblings(i,"value",v.target.value,"value"),u.formattedValue=null}),i.addEventListener("resetform",v=>{const S=this.data.defaultFieldValue??"";i.value=u.userValue=S,u.formattedValue=null});let y=v=>{const{formattedValue:S}=u;S!=null&&(v.target.value=S),v.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",S=>{var E;if(u.focused)return;const{target:x}=S;if(b&&(x.type=f,m&&(x.step=m)),u.userValue){const C=u.userValue;if(b)if(f==="time"){const T=new Date(C),R=[T.getHours(),T.getMinutes(),T.getSeconds()];x.value=R.map(D=>D.toString().padStart(2,"0")).join(":")}else x.value=new Date(C-OP).toISOString().split(f==="date"?"T":".",1)[0];else x.value=C}u.lastCommittedValue=x.value,u.commitKey=1,(E=this.data.actions)!=null&&E.Focus||(u.focused=!0)}),i.addEventListener("updatefromsandbox",S=>{this.showElementAndHideCanvas(S.target);const x={value(E){u.userValue=E.detail.value??"",b||t.setValue(e,{value:u.userValue.toString()}),E.target.value=u.userValue},formattedValue(E){const{formattedValue:C}=E.detail;u.formattedValue=C,C!=null&&E.target!==document.activeElement&&(E.target.value=C);const T={formattedValue:C};b&&(T.value=C),t.setValue(e,T)},selRange(E){E.target.setSelectionRange(...E.detail.selRange)},charLimit:E=>{var D;const{charLimit:C}=E.detail,{target:T}=E;if(C===0){T.removeAttribute("maxLength");return}T.setAttribute("maxLength",C);let R=u.userValue;!R||R.length<=C||(R=R.slice(0,C),T.value=u.userValue=R,t.setValue(e,{value:R}),(D=this.linkService.eventBus)==null||D.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:R,willCommit:!0,commitKey:1,selStart:T.selectionStart,selEnd:T.selectionEnd}}))}};this._dispatchEventFromSandbox(x,S)}),i.addEventListener("keydown",S=>{var C;u.commitKey=1;let x=-1;if(S.key==="Escape"?x=0:S.key==="Enter"&&!this.data.multiLine?x=2:S.key==="Tab"&&(u.commitKey=3),x===-1)return;const{value:E}=S.target;u.lastCommittedValue!==E&&(u.lastCommittedValue=E,u.userValue=E,(C=this.linkService.eventBus)==null||C.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:E,willCommit:!0,commitKey:x,selStart:S.target.selectionStart,selEnd:S.target.selectionEnd}}))});const v=y;y=null,i.addEventListener("blur",S=>{var C,T;if(!u.focused||!S.relatedTarget)return;(C=this.data.actions)!=null&&C.Blur||(u.focused=!1);const{target:x}=S;let{value:E}=x;if(b){if(E&&f==="time"){const R=E.split(":").map(D=>parseInt(D,10));E=new Date(2e3,0,1,R[0],R[1],R[2]||0).valueOf(),x.step=""}else E.includes("T")||(E=`${E}T00:00`),E=new Date(E).valueOf();x.type="text"}u.userValue=E,u.lastCommittedValue!==E&&((T=this.linkService.eventBus)==null||T.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:E,willCommit:!0,
vendor: 4,564 bytes, line 15
15commitKey:u.commitKey,selStart:S.target.selectionStart,selEnd:S.target.selectionEnd}})),v(S)}),(r=this.data.actions)!=null&&r.Keystroke&&i.addEventListener("beforeinput",S=>{var I;u.lastCommittedValue=null;const{data:x,target:E}=S,{value:C,selectionStart:T,selectionEnd:R}=E;let D=T,L=R;switch(S.inputType){case"deleteWordBackward":{const N=C.substring(0,T).match(/\w*[^\w]*$/);N&&(D-=N[0].length);break}case"deleteWordForward":{const N=C.substring(T).match(/^[^\w]*\w*/);N&&(L+=N[0].length);break}case"deleteContentBackward":T===R&&(D-=1);break;case"deleteContentForward":T===R&&(L+=1);break}S.preventDefault(),(I=this.linkService.eventBus)==null||I.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:C,change:x||"",willCommit:!1,selStart:D,selEnd:L}})}),this._setEventListeners(i,u,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],S=>S.target.value)}if(y&&i.addEventListener("blur",y),this.data.comb){const S=(this.data.rect[2]-this.data.rect[0])/c;i.classList.add("comb"),i.style.letterSpacing=`calc(${S}px * var(--total-scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class FP extends Ko{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class NP extends Ko{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;typeof n=="string"&&(n=n!=="Off",t.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");return qo.add(r),r.setAttribute("data-element-id",i),r.disabled=e.readOnly,this._setRequired(r,this.data.required),r.type="checkbox",r.name=e.fieldName,n&&r.setAttribute("checked",!0),r.setAttribute("exportValue",e.exportValue),r.tabIndex=0,r.addEventListener("change",a=>{const{name:l,checked:c}=a.target;for(const h of this._getElementsByName(l,i)){const u=c&&h.exportValue===e.exportValue;h.domElement&&(h.domElement.checked=u),t.setValue(h.id,{value:u})}t.setValue(i,{value:c})}),r.addEventListener("resetform",a=>{const l=e.defaultFieldValue||"Off";a.target.checked=l===e.exportValue}),this.enableScripting&&this.hasJSActions&&(r.addEventListener("updatefromsandbox",a=>{const l={value(c){c.target.checked=c.detail.value!=="Off",t.setValue(i,{value:c.target.checked})}};this._dispatchEventFromSandbox(l,a)}),this._setEventListeners(r,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(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class zv extends Ko{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if(typeof n=="string"&&(n=n!==e.buttonValue,t.setValue(i,{value:n})),n)for(const a of this._getElementsByName(e.fieldName,i))t.setValue(a.id,{value:!1});const r=document.createElement("input");if(qo.add(r),r.setAttribute("data-element-id",i),r.disabled=e.readOnly,this._setRequired(r,this.data.required),r.type="radio",r.name=e.fieldName,n&&r.setAttribute("checked",!0),r.tabIndex=0,r.addEventListener("change",a=>{const{name:l,checked:c}=a.target;for(const h of this._getElementsByName(l,i))t.setValue(h.id,{value:!1});t.setValue(i,{value:c})}),r.addEventListener("resetform",a=>{const l=e.defaultFieldValue;a.target.checked=l!=null&&l===e.buttonValue}),this.enableScripting&&this.hasJSActions){const a=e.buttonValue;r.addEventListener("updatefromsandbox",l=>{const c={value:h=>{const u=a===h.detail.value;for(const d of this._getElementsByName(h.target.name)){const f=u&&d.id===i;d.domElement&&(d.domElement.checked=f),t.setValue(d.id,{value:f})}}};this._dispatchEventFromSandbox(c,l)}),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],l=>l.target.checked)}
15return this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class BP extends e0{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",i=>{this._dispatchEventFromSandbox({},i)})),t}}class UP extends Ko{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");qo.add(n),n.setAttribute("data-element-id",e),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=0;let r=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",u=>{const d=this.data.defaultFieldValue;for(const f of n.options)f.selected=f.value===d});for(const u of this.data.options){const d=document.createElement("option");d.textContent=u.displayValue,d.value=u.exportValue,i.value.includes(u.exportValue)&&(d.setAttribute("selected",!0),r=!1),n.append(d)}let a=null;if(r){const u=document.createElement("option");u.value=" ",u.setAttribute("hidden",!0),u.setAttribute("selected",!0),n.prepend(u),a=()=>{u.remove(),n.removeEventListener("input",a),a=null},n.addEventListener("input",a)}const l=u=>{const d=u?"value":"textContent",{options:f,multiple:m}=n;return m?Array.prototype.filter.call(f,b=>b.selected).map(b=>b[d]):f.selectedIndex===-1?null:f[f.selectedIndex][d]};let c=l(!1);const h=u=>{const d=u.target.options;return Array.prototype.map.call(d,f=>({displayValue:f.textContent,exportValue:f.value}))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",u=>{const d={value(f){a==null||a();const m=f.detail.value,b=new Set(Array.isArray(m)?m:[m]);for(const y of n.options)y.selected=b.has(y.value);t.setValue(e,{value:l(!0)}),c=l(!1)},multipleSelection(f){n.multiple=!0},remove(f){const m=n.options,b=f.detail.remove;m[b].selected=!1,n.remove(b),m.length>0&&Array.prototype.findIndex.call(m,v=>v.selected)===-1&&(m[0].selected=!0),t.setValue(e,{value:l(!0),items:h(f)}),c=l(!1)},clear(f){for(;n.length!==0;)n.remove(0);t.setValue(e,{value:null,items:[]}),c=l(!1)},insert(f){const{index:m,displayValue:b,exportValue:y}=f.detail.insert,v=n.children[m],S=document.createElement("option");S.textContent=b,S.value=y,v?v.before(S):n.append(S),t.setValue(e,{value:l(!0),items:h(f)}),c=l(!1)},items(f){const{items:m}=f.detail;for(;n.length!==0;)n.remove(0);for(const b of m){const{displayValue:y,exportValue:v}=b,S=document.createElement("option");S.textContent=y,S.value=v,n.append(S)}n.options.length>0&&(n.options[0].selected=!0),t.setValue(e,{value:l(!0),items:h(f)}),c=l(!1)},indices(f){const m=new Set(f.detail.indices);for(const b of f.target.options)b.selected=m.has(b.index);t.setValue(e,{value:l(!0)}),c=l(!1)},editable(f){f.target.disabled=!f.detail.editable}};this._dispatchEventFromSandbox(d,u)}),n.addEventListener("input",u=>{var m;const d=l(!0),f=l(!1);t.setValue(e,{value:d}),u.preventDefault(),(m=this.linkService.eventBus)==null||m.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:c,change:f,changeEx:d,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],u=>u.target.value)):n.addEventListener("input",function(u){t.setValue(e,{value:l(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}var pd,Qy;class Jy extends qt{constructor(e){const{data:i,elements:n,parent:r}=e,a=!!r._commentManager;super(e,{isRenderable:!a&&qt._hasPopupData(i)});A(this,pd);if(this.elements=n,a&&qt._hasPopupData(i)){const l=this.popup=w(this,pd,Qy).call(this);for(const c of n)c.popup=l}else this.popup=null}render(){const{container:e}=this;e.classList.add("popupAnnotation"),e.role="comment";
15const i=this.popup=w(this,pd,Qy).call(this),n=[];for(const r of this.elements)r.popup=i,r.container.ariaHasPopup="dialog",n.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",n.map(r=>`${Yb}${r}`).join(",")),this.container}}pd=new WeakSet,Qy=function(){return new $P({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})};var Ri,Hr,ng,sg,Cc,Tc,Kt,ts,jr,yo,Pc,Rc,es,Mi,Vs,qs,Ae,Xs,zr,gd,Ys,Mc,bo,Gr,Ve,Wr,ct,ap,Zy,tb,eb,op,ib,Gv,Wv,Vv,qv,lp,cp,nb;class $P{constructor({container:t,color:e,elements:i,titleObj:n,modificationDate:r,contentsObj:a,richText:l,parent:c,rect:h,parentRect:u,open:d,commentManager:f=null}){A(this,ct);A(this,Ri,null);A(this,Hr,w(this,ct,Vv).bind(this));A(this,ng,w(this,ct,nb).bind(this));A(this,sg,w(this,ct,cp).bind(this));A(this,Cc,w(this,ct,lp).bind(this));A(this,Tc,null);A(this,Kt,null);A(this,ts,null);A(this,jr,null);A(this,yo,null);A(this,Pc,null);A(this,Rc,null);A(this,es,!1);A(this,Mi,null);A(this,Vs,null);A(this,qs,null);A(this,Ae,null);A(this,Xs,null);A(this,zr,null);A(this,gd,null);A(this,Ys,null);A(this,Mc,null);A(this,bo,null);A(this,Gr,!1);A(this,Ve,null);A(this,Wr,null);p(this,Kt,t),p(this,Mc,n),p(this,ts,a),p(this,Ys,l),p(this,Pc,c),p(this,Tc,e),p(this,gd,h),p(this,Rc,u),p(this,yo,i),p(this,Ri,f),p(this,Ve,i[0]),p(this,jr,Lp.toDateObject(r)),this.trigger=i.flatMap(m=>m.getElementsToTriggerPopup()),f?this.renderCommentButton():(w(this,ct,ap).call(this),s(this,Kt).hidden=!0,d&&w(this,ct,lp).call(this))}renderCommentButton(){if(s(this,Ae)||(s(this,Xs)||w(this,ct,Zy).call(this),!s(this,Xs)))return;const{signal:t}=p(this,Vs,new AbortController),e=!!s(this,Ve).extraPopupElement,i=()=>{s(this,Ri).toggleCommentPopup(this,!0,void 0,!e)},n=()=>{s(this,Ri).toggleCommentPopup(this,!1,!0,!e)},r=()=>{s(this,Ri).toggleCommentPopup(this,!1,!1)};if(e){p(this,Ae,s(this,Ve).container);for(const a of this.trigger)a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.addEventListener("keydown",s(this,Hr),{signal:t}),a.addEventListener("click",i,{signal:t}),a.addEventListener("pointerenter",n,{signal:t}),a.addEventListener("pointerleave",r,{signal:t}),a.classList.add("popupTriggerArea")}else{const a=p(this,Ae,document.createElement("button"));a.className="annotationCommentButton";const l=s(this,Ve).container;a.style.zIndex=l.style.zIndex+1,a.tabIndex=0,a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.setAttribute("data-l10n-id","pdfjs-show-comment-button"),w(this,ct,eb).call(this),w(this,ct,tb).call(this),a.addEventListener("keydown",s(this,Hr),{signal:t}),a.addEventListener("click",i,{signal:t}),a.addEventListener("pointerenter",n,{signal:t}),a.addEventListener("pointerleave",r,{signal:t}),l.after(a)}}get commentButtonColor(){const{color:t,opacity:e}=s(this,Ve).commentData;return t?s(this,Pc)._commentManager.makeCommentColor(t,e):null}focusCommentButton(){setTimeout(()=>{var t;(t=s(this,Ae))==null||t.focus()},0)}getData(){const{richText:t,color:e,opacity:i,creationDate:n,modificationDate:r}=s(this,Ve).commentData;return{contentsObj:{str:this.comment},richText:t,color:e,opacity:i,creationDate:n,modificationDate:r}}get elementBeforePopup(){return s(this,Ae)}get comment(){return s(this,Wr)||p(this,Wr,s(this,Ve).commentText),s(this,Wr)}set comment(t){t!==this.comment&&(s(this,Ve).commentText=p(this,Wr,t))}get parentBoundingClientRect(){return s(this,Ve).layer.getBoundingClientRect()}setCommentButtonStates({selected:t,hasPopup:e}){s(this,Ae)&&(s(this,Ae).classList.toggle("selected",t),s(this,Ae).ariaExpanded=e)}setSelectedCommentButton(t){s(this,Ae).classList.toggle("selected",t)}get commentPopupPosition(){if(s(this,zr))return s(this,zr);const{x:t,y:e,height:i}=s(this,Ae).getBoundingClientRect(),{x:n,y:r,width:a,height:l}=s(this,Ve).layer.getBoundingClientRect();return[(t-n)/a,(e+i-r)/l]}set commentPopupPosition(t){p(this,zr,t)}hasDefaultPopupPosition(){return s(this,zr)===null}get commentButtonPosition(){return s(this,Xs)}get commentButtonWidth(){return s(this,Ae).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(t){const[e,i]=s(this,zr)||this.commentButtonPosition.map(h=>h/100),n=this.parentBoundingClientRect,{x:r,y:a,width:l,height:c}=n;s(this,Ri).showDialog(null,this,r+e*l,a+i*c,{...t,parentDimensions:n})}render(){var i,n;if(s(this,Mi))return;const t=p(this,Mi,document.createElement("div"));if(t.className="popup",s(this,Tc)){const r=t.style.outlineColor=W.makeHexColor(...s(this,Tc));t.style.backgroundColor=`color-mix(in srgb, ${r} 30%, white)`}const e=document.createElement("span");if(e.className="header",(i=s(this,Mc))!=null&&i.str){const r=document.createElement("span");r.className="title",e.append(r),{dir:r.dir,str:r.textContent}=s(this,Mc)}if(t.append(e),s(this,jr)){const 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:s(this,jr).valueOf()})),r.dateTime=s(this,jr).toISOString(),e.append(r)}Bw({html:s(this,ct,op)||s(this,ts).str,dir:(n=s(this,ts))==null?void 0:n.dir,className:"popupContent"},t),s(this,Kt).append(t)}updateEdited({rect:t,popup:e,deleted:i}){var n;if(s(this,Ri)){i?(this.remove(),p(this,Wr,null)):e&&(e.deleted?this.remove():(w(this,ct,eb).call(this),p(this,Wr,e.text))),t&&(p(this,Xs,null),w(this,ct,Zy).call(this),w(this,ct,tb).call(this));return}if(i||e!=null&&e.deleted){this.remove();return}w(this,ct,ap).call(this),s(this,bo)||p(this,bo,{contentsObj:s(this,ts),richText:s(this,Ys)}),t&&p(this,qs,null),e&&e.text&&(p(this,Ys,w(this,ct,Wv).call(this,e.text)),p(this,jr,Lp.toDateObject(e.date)),p(this,ts,null)),(n=s(this,Mi))==null||n.remove(),p(this,Mi,null)}resetEdited(){var t;s(this,bo)&&({contentsObj:ce(this,ts)._,richText:ce(this,Ys)._}=s(this,bo),p(this,bo,null),(t=s(this,Mi))==null||t.remove(),p(this,Mi,null),p(this,qs,null))}remove(){var t,e,i;if((t=s(this,Vs))==null||t.abort(),p(this,Vs,null),(e=s(this,Mi))==null||e.remove(),p(this,Mi,null),p(this,Gr,!1),p(this,es,!1),(i=s(this,Ae))==null||i.remove(),p(this,Ae,null),this.trigger)for(const n of this.trigger)n.classList.remove("popupTriggerArea")}forceHide(){p(this,Gr,this.isVisible),s(this,Gr)&&(s(this,Kt).hidden=!0)}maybeShow(){s(this,Ri)||(w(this,ct,ap).call(this),s(this,Gr)&&(s(this,Mi)||w(this,ct,cp).call(this),p(this,Gr,!1),s(this,Kt).hidden=!1))}get isVisible(){return s(this,Ri)?!1:s(this,Kt).hidden===!1}}Ri=new WeakMap,Hr=new WeakMap,ng=new WeakMap,sg=new WeakMap,Cc=new WeakMap,Tc=new WeakMap,Kt=ne
15w WeakMap,ts=new WeakMap,jr=new WeakMap,yo=new WeakMap,Pc=new WeakMap,Rc=new WeakMap,es=new WeakMap,Mi=new WeakMap,Vs=new WeakMap,qs=new WeakMap,Ae=new WeakMap,Xs=new WeakMap,zr=new WeakMap,gd=new WeakMap,Ys=new WeakMap,Mc=new WeakMap,bo=new WeakMap,Gr=new WeakMap,Ve=new WeakMap,Wr=new WeakMap,ct=new WeakSet,ap=function(){var e;if(s(this,Vs))return;p(this,Vs,new AbortController);const{signal:t}=s(this,Vs);for(const i of this.trigger)i.addEventListener("click",s(this,Cc),{signal:t}),i.addEventListener("pointerenter",s(this,sg),{signal:t}),i.addEventListener("pointerleave",s(this,ng),{signal:t}),i.classList.add("popupTriggerArea");for(const i of s(this,yo))(e=i.container)==null||e.addEventListener("keydown",s(this,Hr),{signal:t})},Zy=function(){const t=s(this,yo).find(e=>e.hasCommentButton);t&&p(this,Xs,t._normalizePoint(t.commentButtonPosition))},tb=function(){if(s(this,Ve).extraPopupElement&&!s(this,Ve).editor)return;this.renderCommentButton();const[t,e]=s(this,Xs),{style:i}=s(this,Ae);i.left=`calc(${t}%)`,i.top=`calc(${e}% - var(--comment-button-dim))`},eb=function(){s(this,Ve).extraPopupElement||(this.renderCommentButton(),s(this,Ae).style.backgroundColor=this.commentButtonColor||"")},op=function(){const t=s(this,Ys),e=s(this,ts);return t!=null&&t.str&&(!(e!=null&&e.str)||e.str===t.str)&&s(this,Ys).html||null},ib=function(){var t,e,i;return((i=(e=(t=s(this,ct,op))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.fontSize)||0},Gv=function(){var t,e,i;return((i=(e=(t=s(this,ct,op))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.color)||null},Wv=function(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:s(this,ct,Gv),fontSize:s(this,ct,ib)?`calc(${s(this,ct,ib)}px * var(--total-scale-factor))`:""}};for(const r of t.split(` 16`))e.push({name:"span",value:r,attributes:n});return i},Vv=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&s(this,es))&&w(this,ct,lp).call(this)},qv=function(){if(s(this,qs)!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:r}}}=s(this,Pc);let a=!!s(this,Rc),l=a?s(this,Rc):s(this,gd);for(const b of s(this,yo))if(!l||W.intersect(b.data.rect,l)!==null){l=b.data.rect,a=!0;break}const c=W.normalizeRect([l[0],t[3]-l[1]+t[1],l[2],t[3]-l[3]+t[1]]),u=a?l[2]-l[0]+5:0,d=c[0]+u,f=c[1];p(this,qs,[100*(d-n)/e,100*(f-r)/i]);const{style:m}=s(this,Kt);m.left=`${s(this,qs)[0]}%`,m.top=`${s(this,qs)[1]}%`},lp=function(){if(s(this,Ri)){s(this,Ri).toggleCommentPopup(this,!1);return}p(this,es,!s(this,es)),s(this,es)?(w(this,ct,cp).call(this),s(this,Kt).addEventListener("click",s(this,Cc)),s(this,Kt).addEventListener("keydown",s(this,Hr))):(w(this,ct,nb).call(this),s(this,Kt).removeEventListener("click",s(this,Cc)),s(this,Kt).removeEventListener("keydown",s(this,Hr)))},cp=function(){s(this,Mi)||this.render(),this.isVisible?s(this,es)&&s(this,Kt).classList.add("focused"):(w(this,ct,qv).call(this),s(this,Kt).hidden=!1,s(this,Kt).style.zIndex=parseInt(s(this,Kt).style.zIndex)+1e3)},nb=function(){s(this,Kt).classList.remove("focused"),!(s(this,es)||!this.isVisible)&&(s(this,Kt).hidden=!0,s(this,Kt).style.zIndex=parseInt(s(this,Kt).style.zIndex)-1e3)};class Xv extends qt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=rt.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var md;class HP extends qt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});A(this,md,null)}render(){this.container.classList.add("lineAnnotation");const{data:e,width:i,height:n}=this,r=this.svgFactory.create(i,n,!0),a=p(this,md,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.re
16ct[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"),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return s(this,md)}addHighlightArea(){this.container.classList.add("highlightArea")}}md=new WeakMap;var yd;class jP extends qt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});A(this,yd,null)}render(){this.container.classList.add("squareAnnotation");const{data:e,width:i,height:n}=this,r=this.svgFactory.create(i,n,!0),a=e.borderStyle.width,l=p(this,yd,this.svgFactory.createElement("svg:rect"));return l.setAttribute("x",a/2),l.setAttribute("y",a/2),l.setAttribute("width",i-a),l.setAttribute("height",n-a),l.setAttribute("stroke-width",a||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),r.append(l),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return s(this,yd)}addHighlightArea(){this.container.classList.add("highlightArea")}}yd=new WeakMap;var bd;class zP extends qt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});A(this,bd,null)}render(){this.container.classList.add("circleAnnotation");const{data:e,width:i,height:n}=this,r=this.svgFactory.create(i,n,!0),a=e.borderStyle.width,l=p(this,bd,this.svgFactory.createElement("svg:ellipse"));return l.setAttribute("cx",i/2),l.setAttribute("cy",n/2),l.setAttribute("rx",i/2-a/2),l.setAttribute("ry",n/2-a/2),l.setAttribute("stroke-width",a||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),r.append(l),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return s(this,bd)}addHighlightArea(){this.container.classList.add("highlightArea")}}bd=new WeakMap;var Ad;class Yv extends qt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});A(this,Ad,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,vertices:i,borderStyle:n,popupRef:r},width:a,height:l}=this;if(!i)return this.container;const c=this.svgFactory.create(a,l,!0);let h=[];for(let d=0,f=i.length;d<f;d+=2){const m=i[d]-e[0],b=e[3]-i[d+1];h.push(`${m},${b}`)}h=h.join(" ");const u=p(this,Ad,this.svgFactory.createElement(this.svgElementName));return u.setAttribute("points",h),u.setAttribute("stroke-width",n.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),c.append(u),this.container.append(c),!r&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return s(this,Ad)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ad=new WeakMap;class GP extends Yv{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class WP extends qt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var wd,Ao,vd,sb;class i0 extends qt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});A(this,vd);A(this,wd,null);A(this,Ao,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?rt.HIGHLIGHT:rt.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,rotation:i,inkLists:n,borderStyle:r,popupRef:a}}=this,{transform:l,width:c,height:h}=w(this,vd,sb).call(this,i,e),u=this.svgFactory.create(c,h,!0),d=p(this,wd,this.svgFactory.createElement("svg:g"));u.append(d),d.setAttribute("stroke-width",r.width||1),d.setAttribute("stroke-linecap","round"),d.setAttribute("stroke-linejoin","round"),d.setAttribute("stroke-miterlimit",10),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),d.setAttribute("transform",l);for(let f=0,m=n.length;f<m;f++){const b=this.svgFactory.createElement(this.svgElementName);s(this,Ao).push(b),b.setAttribute("points",n[f].join(",")),d.append(b)}return!a&&this.hasPopupData&&this._createPopup(),this.container.append(u),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);const{thickness:i,points:n,rect:r}=e,a=s(this,wd);if(i>=0&&a.setAttribute("stroke-width",i||1),n)for(let l=0,c=s(this,Ao).length;l<c;l++)s(this,Ao)[l].setAttribute("points",n[l].join(","));if(r){const{transform:l,width:c,height:h}=w(this,vd,sb).call(this,this.data.rotation,r);a.parentElement.setAttribute("viewBox",`0 0 ${c} ${h}`),a.setAttribute("transform",l)}}getElementsToTriggerPopup(){return s(this,Ao)}
16addHighlightArea(){this.container.classList.add("highlightArea")}}wd=new WeakMap,Ao=new WeakMap,vd=new WeakSet,sb=function(e,i){switch(e){case 90:return{transform:`rotate(90) translate(${-i[0]},${i[1]}) scale(1,-1)`,width:i[3]-i[1],height:i[2]-i[0]};case 180:return{transform:`rotate(180) translate(${-i[2]},${i[1]}) scale(1,-1)`,width:i[2]-i[0],height:i[3]-i[1]};case 270:return{transform:`rotate(270) translate(${-i[2]},${i[3]}) scale(1,-1)`,width:i[3]-i[1],height:i[2]-i[0]};default:return{transform:`translate(${-i[0]},${i[3]}) scale(1,-1)`,width:i[2]-i[0],height:i[3]-i[1]}}};class Kv extends qt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=rt.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const i=document.createElement("mark");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class VP extends qt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),t){const i=document.createElement("u");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class qP extends qt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),t){const i=document.createElement("u");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class XP extends qt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),t){const i=document.createElement("s");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class Jv extends qt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=rt.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var Sd,_d,rb;class YP extends qt{constructor(e){var n;super(e,{isRenderable:!0});A(this,_d);A(this,Sd,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,(n=this.linkService.eventBus)==null||n.dispatch("fileattachmentannotation",{source:this,...i})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:i}=this;let n;i.hasAppearance||i.fillAlpha===0?n=document.createElement("div"):(n=document.createElement("img"),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(i.name)?"paperclip":"pushpin"}.svg`,i.fillAlpha&&i.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(i.fillAlpha*100)}%);`)),n.addEventListener("dblclick",w(this,_d,rb).bind(this)),p(this,Sd,n);const{isMac:r}=Ne.platform;return e.addEventListener("keydown",a=>{a.key==="Enter"&&(r?a.metaKey:a.ctrlKey)&&w(this,_d,rb).call(this)}),!i.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea"),e.append(n),e}getElementsToTriggerPopup(){return s(this,Sd)}addHighlightArea(){this.container.classList.add("highlightArea")}}Sd=new WeakMap,_d=new WeakSet,rb=function(){var e;(e=this.downloadManager)==null||e.openOrDownloadData(this.content,this.filename)};var Dc,wo,Oc,Vr,Ed,vo,ua,ob,lb;const h0=class h0{constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:n,page:r,viewport:
16a,structTreeLayer:l,commentManager:c,linkService:h,annotationStorage:u}){A(this,ua);A(this,Dc,null);A(this,wo,null);A(this,Oc,null);A(this,Vr,new Map);A(this,Ed,null);A(this,vo,null);this.div=t,p(this,Dc,e),p(this,wo,i),p(this,Ed,l||null),p(this,vo,h||null),p(this,Oc,u||new Qb),this.page=r,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=n,this._commentManager=c||null}hasEditableAnnotations(){return s(this,Vr).size>0}async render(t){var a,l,c;const{annotations:e}=t,i=this.div;Wo(i,this.viewport);const n=new Map,r={data:null,layer:i,linkService:s(this,vo),downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new Hp,annotationStorage:s(this,Oc),enableComment:t.enableComment===!0,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const h of e){if(h.noHTML)continue;const u=h.annotationType===se.POPUP;if(u){const m=n.get(h.id);if(!m)continue;r.elements=m}else if(h.rect[2]===h.rect[0]||h.rect[3]===h.rect[1])continue;r.data=h;const d=DA.create(r);if(!d.isRenderable)continue;if(!u&&h.popupRef){const m=n.get(h.popupRef);m?m.push(d):n.set(h.popupRef,[d])}const f=d.render();h.hidden&&(f.style.visibility="hidden"),await w(this,ua,ob).call(this,f,h.id,r.elements),(l=(a=d.extraPopupElement)==null?void 0:a.popup)==null||l.renderCommentButton(),d._isEditable&&(s(this,Vr).set(d.data.id,d),(c=this._annotationEditorUIManager)==null||c.renderAnnotationElement(d))}w(this,ua,lb).call(this)}async addLinkAnnotations(t){const e={data:null,layer:this.div,linkService:s(this,vo),svgFactory:new Hp,parent:this};for(const i of t){i.borderStyle||(i.borderStyle=h0._defaultBorderStyle),e.data=i;const n=DA.create(e);if(!n.isRenderable)continue;const r=n.render();await w(this,ua,ob).call(this,r,i.id,null)}}update({viewport:t}){const e=this.div;this.viewport=t,Wo(e,{rotation:t.rotation}),w(this,ua,lb).call(this),e.hidden=!1}getEditableAnnotations(){return Array.from(s(this,Vr).values())}getEditableAnnotation(t){return s(this,Vr).get(t)}addFakeAnnotation(t){var l;const{div:e}=this,{id:i,rotation:n}=t,r=new LP({data:{id:i,rect:t.getPDFRect(),rotation:n},editor:t,layer:e,parent:this,enableComment:!!this._commentManager,linkService:s(this,vo),annotationStorage:s(this,Oc)}),a=r.render();return e.append(a),(l=s(this,Dc))==null||l.moveElementInDOM(e,a,a,!1),r.createOrUpdatePopup(),r}static get _defaultBorderStyle(){return ht(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:fl.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}};Dc=new WeakMap,wo=new WeakMap,Oc=new WeakMap,Vr=new WeakMap,Ed=new WeakMap,vo=new WeakMap,ua=new WeakSet,ob=async function(t,e,i){var l,c;const n=t.firstChild||t,r=n.id=`${Yb}${e}`,a=await((l=s(this,Ed))==null?void 0:l.getAriaAttributes(r));if(a)for(const[h,u]of a)n.setAttribute(h,u);i?i.at(-1).container.after(t):(this.div.append(t),(c=s(this,Dc))==null||c.moveElementInDOM(this.div,t,n,!1))},lb=function(){var e;if(!s(this,wo))return;const t=this.div;for(const[i,n]of s(this,wo)){const r=t.querySelector(`[data-annotation-id="${i}"]`);if(!r)continue;n.className="annotationContent";const{firstChild:a}=r;a?a.nodeName==="CANVAS"?a.replaceWith(n):a.classList.contains("annotationContent")?a.after(n):a.before(n):r.append(n);const l=s(this,Vr).get(i);l&&(l._hasNoCanvas?((e=this._annotationEditorUIManager)==null||e.setMissingCanvas(i,r.id,n),l._hasNoCanvas=!1):l.canvas=n)}s(this,wo).clear()};let ab=h0;const Nf=/\r\n?|\n/g;var Di,xd,So,Oi,ae,Qv,Zv,tS,hp,ar,up,dp,eS,hb,iS;const $t=class $t extends Bt{constructor(e){super({...e,name:"freeTextEditor"});A(this,ae);A(this,Di,"");A(this,xd,`${this.id}-editor`);A(this,So,null);A(this,Oi);k(this,"_colorPicker",null);this.color=e.color||$t._defaultColor||Bt._defaultLineColor,p(this,Oi,e.fontSize||$t._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static get _keyboardManager(){const e=$t.prototype,i=a=>a.isEmpty(),n=Vo.TRANSLATE_SMALL,r=Vo.TRANSLATE_BIG;return ht(this,"_keyboardManager",new nf([[["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:[-n,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-r,0],checker:i}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[n,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[r,0],checker:i}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-r],checker:i}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,n],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,r],checker:i}]]))}static initialize(e,i){Bt.initialize(e,i);const n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue("--freetext-padding"))}
16static updateDefaultParams(e,i){switch(e){case mt.FREETEXT_SIZE:$t._defaultFontSize=i;break;case mt.FREETEXT_COLOR:$t._defaultColor=i;break}}updateParams(e,i){switch(e){case mt.FREETEXT_SIZE:w(this,ae,Qv).call(this,i);break;case mt.FREETEXT_COLOR:w(this,ae,Zv).call(this,i);break}}static get defaultPropertiesToUpdate(){return[[mt.FREETEXT_SIZE,$t._defaultFontSize],[mt.FREETEXT_COLOR,$t._defaultColor||Bt._defaultLineColor]]}get propertiesToUpdate(){return[[mt.FREETEXT_SIZE,s(this,Oi)],[mt.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new $p(this)),[["colorPicker",this._colorPicker]]}get colorType(){return mt.FREETEXT_COLOR}onUpdatedColor(){var e;this.editorDiv.style.color=this.color,(e=this._colorPicker)==null||e.update(this.color),super.onUpdatedColor()}_translateEmpty(e,i){this._uiManager.translateSelectedEditors(e,i,!0)}getInitialTranslation(){const e=this.parentScale;return[-$t._internalPadding*e,-($t._internalPadding+s(this,Oi))*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"),p(this,So,new AbortController);const e=this._uiManager.combinedSignal(s(this,So));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(){var e;return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",s(this,xd)),this._isDraggable=!0,(e=s(this,So))==null||e.abort(),p(this,So,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){var i;this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),(i=this._initialOptions)!=null&&i.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();const e=s(this,Di),i=p(this,Di,w(this,ae,tS).call(this).trimEnd());if(e===i)return;const n=r=>{if(p(this,Di,r),!r){this.remove();return}w(this,ae,dp).call(this),this._uiManager.rebuild(this),w(this,ae,hp).call(this)};this.addCommands({cmd:()=>{n(i)},undo:()=>{n(e)},mustExec:!1}),w(this,ae,hp).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){$t._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,i;(this._isCopy||this.annotationElementId)&&(e=this.x,i=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",s(this,xd)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${s(this,Oi)}px * var(--total-scale-factor))`,n.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){const[r,a]=this.parentDimensions;
16if(this.annotationElementId){const{position:l}=this._initialData;let[c,h]=this.getInitialTranslation();[c,h]=this.pageTranslationToScreen(c,h);const[u,d]=this.pageDimensions,[f,m]=this.pageTranslation;let b,y;switch(this.rotation){case 0:b=e+(l[0]-f)/u,y=i+this.height-(l[1]-m)/d;break;case 90:b=e+(l[0]-f)/u,y=i-(l[1]-m)/d,[c,h]=[h,-c];break;case 180:b=e-this.width+(l[0]-f)/u,y=i-(l[1]-m)/d,[c,h]=[-c,-h];break;case 270:b=e+(l[0]-f-this.height*d)/u,y=i+(l[1]-m-this.width*u)/d,[c,h]=[-h,c];break}this.setAt(b*r,y*a,c,h)}else this._moveAfterPaste(e,i);w(this,ae,dp).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(e){var b,y,v;const i=e.clipboardData||window.clipboardData,{types:n}=i;if(n.length===1&&n[0]==="text/plain")return;e.preventDefault();const r=w(b=$t,ar,hb).call(b,i.getData("text")||"").replaceAll(Nf,` 17`);if(!r)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const l=a.getRangeAt(0);if(!r.includes(` 18`)){l.insertNode(document.createTextNode(r)),this.editorDiv.normalize(),a.collapseToStart();return}const{startContainer:c,startOffset:h}=l,u=[],d=[];if(c.nodeType===Node.TEXT_NODE){const S=c.parentElement;if(d.push(c.nodeValue.slice(h).replaceAll(Nf,"")),S!==this.editorDiv){let x=u;for(const E of this.editorDiv.childNodes){if(E===S){x=d;continue}x.push(w(y=$t,ar,up).call(y,E))}}u.push(c.nodeValue.slice(0,h).replaceAll(Nf,""))}else if(c===this.editorDiv){let S=u,x=0;for(const E of this.editorDiv.childNodes)x++===h&&(S=d),S.push(w(v=$t,ar,up).call(v,E))}p(this,Di,`${u.join(` 19`)}${r}${d.join(` 20`)}`),w(this,ae,dp).call(this);const f=new Range;let m=Math.sumPrecise(u.map(S=>S.length));for(const{firstChild:S}of this.editorDiv.childNodes)if(S.nodeType===Node.TEXT_NODE){const x=S.nodeValue.length;if(m<=x){f.setStart(S,m),f.setEnd(S,m);break}m-=x}a.removeAllRanges(),a.addRange(f)}get contentDiv(){return this.editorDiv}getPDFRect(){const e=$t._internalPadding*this.parentScale;return this.getRect(e,e)}static async deserialize(e,i,n){var l;let r=null;if(e instanceof Xv){const{data:{defaultAppearanceData:{fontSize:c,fontColor:h},rect:u,rotation:d,id:f,popupRef:m,richText:b,contentsObj:y,creationDate:v,modificationDate:S},textContent:x,textPosition:E,parent:{page:{pageNumber:C}}}=e;if(!x||x.length===0)return null;r=e={annotationType:rt.FREETEXT,color:Array.from(h),fontSize:c,value:x.join(` 21`),position:E,pageIndex:C-1,rect:u.slice(0),rotation:d,annotationElementId:f,id:f,deleted:!1,popupRef:m,comment:(y==null?void 0:y.str)||null,richText:b,creationDate:v,modificationDate:S}}const a=await super.deserialize(e,i,n);return p(a,Oi,e.fontSize),a.color=W.makeHexColor(...e.color),p(a,Di,w(l=$t,ar,hb).call(l,e.value)),a._initialData=r,e.comment&&a.setCommentData(e),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=Bt._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),n=Object.assign(super.serialize(e),{color:i,fontSize:s(this,Oi),value:w(this,ae,eS).call(this)});return this.addComment(n),e?(n.isCopy=!0,n):this.annotationElementId&&!w(this,ae,iS).call(this,n)?null:(n.id=this.annotationElementId,n)}renderAnnotationElement(e){const i=super.renderAnnotationElement(e);if(!i)return null;const{style:n}=i;n.fontSize=`calc(${s(this,Oi)}px * var(--total-scale-factor))`,n.color=this.color,i.replaceChildren();for(const r of s(this,Di).split(` 22`)){const a=document.createElement("div");a.append(r?document.createTextNode(r):document.createElement("br")),i.append(a)}return e.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:s(this,Di)}}),i}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}};Di=new WeakMap,xd=new WeakMap,So=new WeakMap,Oi=new WeakMap,ae=new WeakSet,Qv=function(e){const i=r=>{this.editorDiv.style.fontSize=`calc(${r}px * var(--total-scale-factor))`,this.translate(0,-(r-s(this,Oi))*this.parentScale),p(this,Oi,r),w(this,ae,hp).call(this)},n=s(this,Oi);this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:mt.FREETEXT_S
22IZE,overwriteIfSameType:!0,keepUndo:!0})},Zv=function(e){const i=r=>{this.color=r,this.onUpdatedColor()},n=this.color;this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:mt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},tS=function(){var n;const e=[];this.editorDiv.normalize();let i=null;for(const r of this.editorDiv.childNodes)(i==null?void 0:i.nodeType)===Node.TEXT_NODE&&r.nodeName==="BR"||(e.push(w(n=$t,ar,up).call(n,r)),i=r);return e.join(` 23`)},hp=function(){const[e,i]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:r,div:a}=this,l=a.style.display,c=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",r.div.append(this.div),n=a.getBoundingClientRect(),a.remove(),a.style.display=l,a.classList.toggle("hidden",c)}this.rotation%180===this.parentRotation%180?(this.width=n.width/e,this.height=n.height/i):(this.width=n.height/e,this.height=n.width/i),this.fixAndSetPosition()},ar=new WeakSet,up=function(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(Nf,"")},dp=function(){if(this.editorDiv.replaceChildren(),!!s(this,Di))for(const e of s(this,Di).split(` 24`)){const i=document.createElement("div");i.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(i)}},eS=function(){return s(this,Di).replaceAll(" "," ")},hb=function(e){return e.replaceAll(" "," ")},iS=function(e){const{value:i,fontSize:n,color:r,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==i||e.fontSize!==n||e.color.some((l,c)=>l!==r[c])||e.pageIndex!==a},A($t,ar),k($t,"_freeTextDefaultContent",""),k($t,"_internalPadding",0),k($t,"_defaultColor",null),k($t,"_defaultFontSize",10),k($t,"_type","freetext"),k($t,"_editorType",rt.FREETEXT);let cb=$t;class z{toSVGPath(){Ft("Abstract method `toSVGPath` must be implemented.")}get box(){Ft("Abstract getter `box` must be implemented.")}serialize(t,e){Ft("Abstract method `serialize` must be implemented.")}static _rescale(t,e,i,n,r,a){a||(a=new Float32Array(t.length));for(let l=0,c=t.length;l<c;l+=2)a[l]=e+t[l]*n,a[l+1]=i+t[l+1]*r;return a}static _rescaleAndSwap(t,e,i,n,r,a){a||(a=new Float32Array(t.length));for(let l=0,c=t.length;l<c;l+=2)a[l]=e+t[l+1]*n,a[l+1]=i+t[l]*r;return a}static _translate(t,e,i,n){n||(n=new Float32Array(t.length));for(let r=0,a=t.length;r<a;r+=2)n[r]=e+t[r],n[r+1]=i+t[r+1];return n}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,e,i,n,r){switch(r){case 90:return[1-e/i,t/n];case 180:return[1-t/i,1-e/n];case 270:return[e/i,1-t/n];default:return[t/i,e/n]}}static _normalizePagePoint(t,e,i){switch(i){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,i,n,r,a){return[(t+5*i)/6,(e+5*n)/6,(5*i+r)/6,(5*n+a)/6,(i+r)/2,(n+a)/2]}}k(z,"PRECISION",1e-4);var Li,vn,Lc,kc,is,ut,_o,Eo,Cd,Td,Ic,Fc,qr,Pd,rg,ag,ge,Vh,nS,sS,rS,aS,oS,lS;const Ss=class Ss{constructor({x:t,y:e},i,n,r,a,l=0){A(this,ge);A(this,Li);A(this,vn,[]);A(this,Lc);A(this,kc);A(this,is,[]);A(this,ut,new Float32Array(18));A(this,_o);A(this,Eo);A(this,Cd);A(this,Td);A(this,Ic);A(this,Fc);A(this,qr,[]);p(this,Li,i),p(this,Fc,r*n),p(this,kc,a),s(this,ut).set([NaN,NaN,NaN,NaN,t,e],6),p(this,Lc,l),p(this,Td,s(Ss,Pd)*n),p(this,Cd,s(Ss,ag)*n),p(this,Ic,n),s(this,qr).push(t,e)}isEmpty(){return isNaN(s(this,ut)[8])}add({x:t,y:e}){var I;p(this,_o,t),p(this,Eo,e);const[i,n,r,a]=s(this,Li);let[l,c,h,u]=s(this,ut).subarray(8,12);const d=t-h,f=e-u,m=Math.hypot(d,f);if(m<s(this,Cd))return!1;const b=m-s(this,Td),y=b/m,v=y*d,S=y*f;let x=l,E=c;l=h,c=u,h+=v,u+=S,(I=s(this,qr))==null||I.push(t,e);const C=-S/b,T=v/b,R=C*s(this,Fc),D=T*s(this,Fc);return s(this,ut).set(s(this,ut).subarray(2,8),0),s(this,ut).set([h+R,u+D],4),s(this,ut).set(s(this,ut).subarray(14,18),12),s(this,ut).set([h-R,u-D],16),isNaN(s(this,ut)[6])?(s(this,is).length===0&&(s(this,ut).set([l+R,c+D],2),s(this,is).push(NaN,NaN,NaN,NaN,(l+R-i)/r,(c+D-n)/a),s(this,ut).set([l-R,c-D],14),s(this,vn).push(NaN,NaN,NaN,NaN,(l-R-i)/r,(c-D-n)/a)),s(this,ut).set([x,E,l,c,h,u],
vendor: 5,177 bytes, line 24
246),!this.isEmpty()):(s(this,ut).set([x,E,l,c,h,u],6),Math.abs(Math.atan2(E-c,x-l)-Math.atan2(S,v))<Math.PI/2?([l,c,h,u]=s(this,ut).subarray(2,6),s(this,is).push(NaN,NaN,NaN,NaN,((l+h)/2-i)/r,((c+u)/2-n)/a),[l,c,x,E]=s(this,ut).subarray(14,18),s(this,vn).push(NaN,NaN,NaN,NaN,((x+l)/2-i)/r,((E+c)/2-n)/a),!0):([x,E,l,c,h,u]=s(this,ut).subarray(0,6),s(this,is).push(((x+5*l)/6-i)/r,((E+5*c)/6-n)/a,((5*l+h)/6-i)/r,((5*c+u)/6-n)/a,((l+h)/2-i)/r,((c+u)/2-n)/a),[h,u,l,c,x,E]=s(this,ut).subarray(12,18),s(this,vn).push(((x+5*l)/6-i)/r,((E+5*c)/6-n)/a,((5*l+h)/6-i)/r,((5*c+u)/6-n)/a,((l+h)/2-i)/r,((c+u)/2-n)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const t=s(this,is),e=s(this,vn);if(isNaN(s(this,ut)[6])&&!this.isEmpty())return w(this,ge,nS).call(this);const i=[];i.push(`M${t[4]} ${t[5]}`);for(let n=6;n<t.length;n+=6)isNaN(t[n])?i.push(`L${t[n+4]} ${t[n+5]}`):i.push(`C${t[n]} ${t[n+1]} ${t[n+2]} ${t[n+3]} ${t[n+4]} ${t[n+5]}`);w(this,ge,rS).call(this,i);for(let n=e.length-6;n>=6;n-=6)isNaN(e[n])?i.push(`L${e[n+4]} ${e[n+5]}`):i.push(`C${e[n]} ${e[n+1]} ${e[n+2]} ${e[n+3]} ${e[n+4]} ${e[n+5]}`);return w(this,ge,sS).call(this,i),i.join(" ")}newFreeDrawOutline(t,e,i,n,r,a){return new cS(t,e,i,n,r,a)}getOutlines(){var d;const t=s(this,is),e=s(this,vn),i=s(this,ut),[n,r,a,l]=s(this,Li),c=new Float32Array((((d=s(this,qr))==null?void 0:d.length)??0)+2);for(let f=0,m=c.length-2;f<m;f+=2)c[f]=(s(this,qr)[f]-n)/a,c[f+1]=(s(this,qr)[f+1]-r)/l;if(c[c.length-2]=(s(this,_o)-n)/a,c[c.length-1]=(s(this,Eo)-r)/l,isNaN(i[6])&&!this.isEmpty())return w(this,ge,aS).call(this,c);const h=new Float32Array(s(this,is).length+24+s(this,vn).length);let u=t.length;for(let f=0;f<u;f+=2){if(isNaN(t[f])){h[f]=h[f+1]=NaN;continue}h[f]=t[f],h[f+1]=t[f+1]}u=w(this,ge,lS).call(this,h,u);for(let f=e.length-6;f>=6;f-=6)for(let m=0;m<6;m+=2){if(isNaN(e[f+m])){h[u]=h[u+1]=NaN,u+=2;continue}h[u]=e[f+m],h[u+1]=e[f+m+1],u+=2}return w(this,ge,oS).call(this,h,u),this.newFreeDrawOutline(h,c,s(this,Li),s(this,Ic),s(this,Lc),s(this,kc))}};Li=new WeakMap,vn=new WeakMap,Lc=new WeakMap,kc=new WeakMap,is=new WeakMap,ut=new WeakMap,_o=new WeakMap,Eo=new WeakMap,Cd=new WeakMap,Td=new WeakMap,Ic=new WeakMap,Fc=new WeakMap,qr=new WeakMap,Pd=new WeakMap,rg=new WeakMap,ag=new WeakMap,ge=new WeakSet,Vh=function(){const t=s(this,ut).subarray(4,6),e=s(this,ut).subarray(16,18),[i,n,r,a]=s(this,Li);return[(s(this,_o)+(t[0]-e[0])/2-i)/r,(s(this,Eo)+(t[1]-e[1])/2-n)/a,(s(this,_o)+(e[0]-t[0])/2-i)/r,(s(this,Eo)+(e[1]-t[1])/2-n)/a]},nS=function(){const[t,e,i,n]=s(this,Li),[r,a,l,c]=w(this,ge,Vh).call(this);return`M${(s(this,ut)[2]-t)/i} ${(s(this,ut)[3]-e)/n} L${(s(this,ut)[4]-t)/i} ${(s(this,ut)[5]-e)/n} L${r} ${a} L${l} ${c} L${(s(this,ut)[16]-t)/i} ${(s(this,ut)[17]-e)/n} L${(s(this,ut)[14]-t)/i} ${(s(this,ut)[15]-e)/n} Z`},sS=function(t){const e=s(this,vn);t.push(`L${e[4]} ${e[5]} Z`)},rS=function(t){const[e,i,n,r]=s(this,Li),a=s(this,ut).subarray(4,6),l=s(this,ut).subarray(16,18),[c,h,u,d]=w(this,ge,Vh).call(this);t.push(`L${(a[0]-e)/n} ${(a[1]-i)/r} L${c} ${h} L${u} ${d} L${(l[0]-e)/n} ${(l[1]-i)/r}`)},aS=function(t){const e=s(this,ut),[i,n,r,a]=s(this,Li),[l,c,h,u]=w(this,ge,Vh).call(this),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(e[2]-i)/r,(e[3]-n)/a,NaN,NaN,NaN,NaN,(e[4]-i)/r,(e[5]-n)/a,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,h,u,NaN,NaN,NaN,NaN,(e[16]-i)/r,(e[17]-n)/a,NaN,NaN,NaN,NaN,(e[14]-i)/r,(e[15]-n)/a],0),this.newFreeDrawOutline(d,t,s(this,Li),s(this,Ic),s(this,Lc),s(this,kc))},oS=function(t,e){const i=s(this,vn);return t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e),e+=6},lS=function(t,e){const i=s(this,ut).subarray(4,6),n=s(this,ut).subarray(16,18),[r,a,l,c]=s(this,Li),[h,u,d,f]=w(this,ge,Vh).call(this);return t.set([NaN,NaN,NaN,NaN,(i[0]-r)/l,(i[1]-a)/c,NaN,NaN,NaN,NaN,h,u,NaN,NaN,NaN,NaN,d,f,NaN,NaN,NaN,NaN,(n[0]-r)/l,(n[1]-a)/c],e),e+=24},A(Ss,Pd,8),A(Ss,rg,2),A(Ss,ag,s(Ss,Pd)+s(Ss,rg));let jp=Ss;var Nc,xo,Ks,Rd,ki,Md,ee,og,hS;class cS extends z{constructor(e,i,n,r,a,l){super();A(this,og);A(this,Nc);A(this,xo,new Float32Array(4));A(this,Ks);A(this,Rd);A(this,ki);A(this,Md);A(this,ee);p(this,ee,e),p(this,ki,i),p(this,Nc,n),p(this,Md,r),p(this,Ks,a),p(this,Rd,l),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],w(this,og,hS).call(this,l);const[c,h,u,d]=s(this,xo);for(let f=0,m=e.length;f<m;f+=2)e[f]=(e[f]-c)/u,e[f+1]=(e[f+1]-h)/d;for(let f=0,m=i.length;f<m;f+=2)i[f]=(i[f]-c)/u,i[f+1]=(i[f+1]-h)/d}toSVGPath(){const e=[`M${s(this,ee)[4]} ${s(this,ee)[5]}`];for(let i=6,n=s(this,ee).length;i<n;i+=6){if(isNaN(s(this,ee)[i])){e.push(`L${s(this,ee)[i+4]} ${s(this,ee)[i+5]}`);continue}e.push(`C${s(this,ee)[i]} ${s(this,ee)[i+1]} ${s(this,ee)[i+2]} ${s(this,ee)[i+3]} ${s(this,ee)[i+4]} ${s(this,ee)[i+5]}`)}return e.push("Z"),e.join(" ")}serialize([e,i,n,r],a){const l=n-e,c=r-i;let h,u;switch(a){case 0:h=z._rescale(s(this,ee),e,r,l,-c),u=z._rescale(s(this,ki),e,r,l,-c);break;case 90:h=z._rescaleAndSwap(s(this,ee),e,i,l,c),u=z._rescaleAndSwap(s(this,ki),e,i,l,c);break;case 180:h=z._rescale(s(this,ee),n,i,-l,c),u=z._rescale(s(this,ki),n,i,-l,c);break;case 270:h=z._rescaleAndSwap(s(this,ee),n,r,-l,-c),u=z._rescaleAndSwap(s(this,ki),n,r,-l,-c);break}
24return{outline:Array.from(h),points:[Array.from(u)]}}get box(){return s(this,xo)}newOutliner(e,i,n,r,a,l=0){return new jp(e,i,n,r,a,l)}getNewOutline(e,i){const[n,r,a,l]=s(this,xo),[c,h,u,d]=s(this,Nc),f=a*u,m=l*d,b=n*u+c,y=r*d+h,v=this.newOutliner({x:s(this,ki)[0]*f+b,y:s(this,ki)[1]*m+y},s(this,Nc),s(this,Md),e,s(this,Rd),i??s(this,Ks));for(let S=2;S<s(this,ki).length;S+=2)v.add({x:s(this,ki)[S]*f+b,y:s(this,ki)[S+1]*m+y});return v.getOutlines()}}Nc=new WeakMap,xo=new WeakMap,Ks=new WeakMap,Rd=new WeakMap,ki=new WeakMap,Md=new WeakMap,ee=new WeakMap,og=new WeakSet,hS=function(e){const i=s(this,ee);let n=i[4],r=i[5];const a=[n,r,n,r];let l=n,c=r,h=n,u=r;const d=e?Math.max:Math.min,f=new Float32Array(4);for(let b=6,y=i.length;b<y;b+=6){const v=i[b+4],S=i[b+5];isNaN(i[b])?(W.pointBoundingBox(v,S,a),c>S?(l=v,c=S):c===S&&(l=d(l,v)),u<S?(h=v,u=S):u===S&&(h=d(h,v))):(f[0]=f[1]=1/0,f[2]=f[3]=-1/0,W.bezierBoundingBox(n,r,...i.slice(b,b+6),f),W.rectBoundingBox(f[0],f[1],f[2],f[3],a),c>f[1]?(l=f[0],c=f[1]):c===f[1]&&(l=d(l,f[0])),u<f[3]?(h=f[2],u=f[3]):u===f[3]&&(h=d(h,f[2]))),n=v,r=S}const m=s(this,xo);m[0]=a[0]-s(this,Ks),m[1]=a[1]-s(this,Ks),m[2]=a[2]-a[0]+2*s(this,Ks),m[3]=a[3]-a[1]+2*s(this,Ks),this.firstPoint=[l,c],this.lastPoint=[h,u]};var Dd,Od,Ld,Xr,Sn,oi,uS,fp,dS,fS,db;class ub{constructor(t,e=0,i=0,n=!0){A(this,oi);A(this,Dd);A(this,Od);A(this,Ld);A(this,Xr,[]);A(this,Sn,[]);const r=[1/0,1/0,-1/0,-1/0],a=10**-4;for(const{x:y,y:v,width:S,height:x}of t){const E=Math.floor((y-e)/a)*a,C=Math.ceil((y+S+e)/a)*a,T=Math.floor((v-e)/a)*a,R=Math.ceil((v+x+e)/a)*a,D=[E,T,R,!0],L=[C,T,R,!1];s(this,Xr).push(D,L),W.rectBoundingBox(E,T,C,R,r)}const l=r[2]-r[0]+2*i,c=r[3]-r[1]+2*i,h=r[0]-i,u=r[1]-i;let d=n?-1/0:1/0,f=1/0;const m=s(this,Xr).at(n?-1:-2),b=[m[0],m[2]];for(const y of s(this,Xr)){const[v,S,x,E]=y;!E&&n?S<f?(f=S,d=v):S===f&&(d=Math.max(d,v)):E&&!n&&(S<f?(f=S,d=v):S===f&&(d=Math.min(d,v))),y[0]=(v-h)/l,y[1]=(S-u)/c,y[2]=(x-u)/c}p(this,Dd,new Float32Array([h,u,l,c])),p(this,Od,[d,f]),p(this,Ld,b)}getOutlines(){s(this,Xr).sort((e,i)=>e[0]-i[0]||e[1]-i[1]||e[2]-i[2]);const t=[];for(const e of s(this,Xr))e[3]?(t.push(...w(this,oi,db).call(this,e)),w(this,oi,dS).call(this,e)):(w(this,oi,fS).call(this,e),t.push(...w(this,oi,db).call(this,e)));return w(this,oi,uS).call(this,t)}}Dd=new WeakMap,Od=new WeakMap,Ld=new WeakMap,Xr=new WeakMap,Sn=new WeakMap,oi=new WeakSet,uS=function(t){const e=[],i=new Set;for(const a of t){const[l,c,h]=a;e.push([l,c,a],[l,h,a])}e.sort((a,l)=>a[1]-l[1]||a[0]-l[0]);for(let a=0,l=e.length;a<l;a+=2){const c=e[a][2],h=e[a+1][2];c.push(h),h.push(c),i.add(c),i.add(h)}const n=[];let r;for(;i.size>0;){const a=i.values().next().value;let[l,c,h,u,d]=a;i.delete(a);let f=l,m=c;for(r=[l,h],n.push(r);;){let b;if(i.has(u))b=u;else if(i.has(d))b=d;else break;i.delete(b),[l,c,h,u,d]=b,f!==l&&(r.push(f,m,l,m===c?c:h),f=l),m=m===c?h:c}r.push(f,m)}return new KP(n,s(this,Dd),s(this,Od),s(this,Ld))},fp=function(t){const e=s(this,Sn);let i=0,n=e.length-1;for(;i<=n;){const r=i+n>>1,a=e[r][0];if(a===t)return r;a<t?i=r+1:n=r-1}return n+1},dS=function([,t,e]){const i=w(this,oi,fp).call(this,t);s(this,Sn).splice(i,0,[t,e])},fS=function([,t,e]){const i=w(this,oi,fp).call(this,t);for(let n=i;n<s(this,Sn).length;n++){const[r,a]=s(this,Sn)[n];if(r!==t)break;if(r===t&&a===e){s(this,Sn).splice(n,1);return}}for(let n=i-1;n>=0;n--){const[r,a]=s(this,Sn)[n];if(r!==t)break;if(r===t&&a===e){s(this,Sn).splice(n,1);return}}},db=function(t){const[e,i,n]=t,r=[[e,i,n]],a=w(this,oi,fp).call(this,n);for(let l=0;l<a;l++){const[c,h]=s(this,Sn)[l];for(let u=0,d=r.length;u<d;u++){const[,f,m]=r[u];if(!(h<=f||m<=c)){if(f>=c){if(m>h)r[u][1]=h;else{if(d===1)return[];r.splice(u,1),u--,d--}continue}r[u][2]=c,m>h&&r.push([e,h,m])}}}return r};var kd,Bc;class KP extends z{constructor(e,i,n,r){super();A(this,kd);A(this,Bc);p(this,Bc,e),p(this,kd,i),this.firstPoint=n,this.lastPoint=r}toSVGPath(){const e=[];for(const i of s(this,Bc)){let[n,r]=i;e.push(`M${n} ${r}`);for(let a=2;a<i.length;a+=2){const l=i[a],c=i[a+1];l===n?(e.push(`V${c}`),r=c):c===r&&(e.push(`H${l}`),n=l)}e.push("Z")}return e.join(" ")}serialize([e,i,n,r],a){const l=[],c=n-e,h=r-i;for(const u of s(this,Bc)){const d=new Array(u.length);for(let f=0;f<u.length;f+=2)d[f]=e+u[f]*c,d[f+1]=r-u[f+1]*h;l.push(d)}return l}get box(){return s(this,kd)}get classNamesForOutlining(){return["highlightOutline"]}}kd=new WeakMap,Bc=new WeakMap;class fb extends jp{newFreeDrawOutline(t,e,i,n,r,a){return new JP(t,e,i,n,r,a)}}class JP extends cS{newOutliner(t,e,i,n,r,a=0){return new fb(t,e,i,n,r,a)}}var Uc,Id,Js,Co,Fd,yi,Nd,Bd,To,Ii,Fi,Oe,$c,Hc,qe,jc,rn,Ud,lt,pb,pp,pS,gS,mS,gb,Sa,on,Al,yS,gp,mp,bS,AS,wS,vS,SS;const _t=class _t extends Bt{constructor(e){super({...e,name:"highlightEditor"});A(this,lt);A(this,Uc,null);A(this,Id,0);A(this,Js);A(this,Co,null);A(this,Fd,null);A(this,yi,null);A(this,Nd,null);A(this,Bd,0);A(this,To,null);A(this,Ii,null);A(this,Fi,null);A(this,Oe,!1);A(this,$c,null);A(this,Hc,null);A(this,qe,null);A(this,jc,"");A(this,rn);A(this,Ud,"");this.color=e.color||_t._defaultColor,p(this,rn,e.thickness||_t._defaultThickness),this.opacity=e.opacity||_t._defaultOpacity,p(this,Js,e.boxes||null),p(this,Ud,e.methodOfCreation||""),p(this,jc,e.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",e.highlightId>
24-1?(p(this,Oe,!0),w(this,lt,pp).call(this,e),w(this,lt,Sa).call(this)):s(this,Js)&&(p(this,Uc,e.anchorNode),p(this,Id,e.anchorOffset),p(this,Nd,e.focusNode),p(this,Bd,e.focusOffset),w(this,lt,pb).call(this),w(this,lt,Sa).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){const e=_t.prototype;return ht(this,"_keyboardManager",new nf([[["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:s(this,Oe)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:s(this,rn),methodOfCreation:s(this,Ud)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}static initialize(e,i){var n;Bt.initialize(e,i),_t._defaultColor||(_t._defaultColor=((n=i.highlightColors)==null?void 0:n.values().next().value)||"#fff066")}static updateDefaultParams(e,i){switch(e){case mt.HIGHLIGHT_COLOR:_t._defaultColor=i;break;case mt.HIGHLIGHT_THICKNESS:_t._defaultThickness=i;break}}translateInPage(e,i){}get toolbarPosition(){return s(this,Hc)}get commentButtonPosition(){return s(this,$c)}updateParams(e,i){switch(e){case mt.HIGHLIGHT_COLOR:w(this,lt,pS).call(this,i);break;case mt.HIGHLIGHT_THICKNESS:w(this,lt,gS).call(this,i);break}}static get defaultPropertiesToUpdate(){return[[mt.HIGHLIGHT_COLOR,_t._defaultColor],[mt.HIGHLIGHT_THICKNESS,_t._defaultThickness]]}get propertiesToUpdate(){return[[mt.HIGHLIGHT_COLOR,this.color||_t._defaultColor],[mt.HIGHLIGHT_THICKNESS,s(this,rn)||_t._defaultThickness],[mt.HIGHLIGHT_FREE,s(this,Oe)]]}onUpdatedColor(){var e,i;(e=this.parent)==null||e.drawLayer.updateProperties(s(this,Fi),{root:{fill:this.color,"fill-opacity":this.opacity}}),(i=s(this,Fd))==null||i.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",p(this,Fd,new Up({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(w(this,lt,mp).call(this))}getBaseTranslation(){return[0,0]}getRect(e,i){return super.getRect(e,i,w(this,lt,mp).call(this))}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){w(this,lt,gb).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(w(this,lt,Sa).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){var n;let i=!1;this.parent&&!e?w(this,lt,gb).call(this):e&&(w(this,lt,Sa).call(this,e),i=!this.parent&&((n=this.div)==null?void 0:n.classList.contains("selectedEditor"))),super.setParent(e),this.show(this._isVisible),i&&this.select()}rotate(e){var r,a,l;const{drawLayer:i}=this.parent;let n;s(this,Oe)?(e=(e-this.rotation+360)%360,n=w(r=_t,on,Al).call(r,s(this,Ii).box,e)):n=w(a=_t,on,Al).call(a,[this.x,this.y,this.width,this.height],e),i.updateProperties(s(this,Fi),{bbox:n,root:{"data-main-rotation":e}}),i.updateProperties(s(this,qe),{bbox:w(l=_t,on,Al).call(l,s(this,yi).box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;const e=super.render();s(this,jc)&&(e.setAttribute("aria-label",s(this,jc)),e.setAttribute("role","mark")),s(this,Oe)?e.classList.add("free"):this.div.addEventListener("keydown",w(this,lt,yS).bind(this),{signal:this._uiManager._signal});const i=p(this,To,document.createElement("div"));return e.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",i.style.clipPath=s(this,Co),this.setDims(this.width,this.height),Gw(this,s(this,To),["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){var e;this.isSelected||(e=this.parent)==null||e.drawLayer.updateProperties(s(this,qe),{rootClass:{hovered:!0}})}pointerleave(){var e;this.isSelected||(e=this.parent)==null||e.drawLayer.updateProperties(s(this,qe),{rootClass:{hovered:!1}})}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:w(this,lt,gp).call(this,!0);break;case 1:case 3:w(this,lt,gp).call(this,!1);break}}select(){var e;super.select(),s(this,qe)&&((e=this.parent)==null||e.drawLayer.updateProperties(s(this,qe),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var e;super.unselect(),s(this,qe)&&((e=this.parent)==null||e.drawLayer.updateProperties(s(this,qe),{rootClass:{selected:!1}}),s(this,Oe)||w(this,lt,gp).call(this,!1))}get _mustFixPosition(){return!s(this,Oe)}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(s(this,Fi),{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(s(this,qe),{rootClass:{hidden:!e}}))}static startHighlighting(e,i,{target:n,x:r,y:a}){const{x:l,y:c,width:h,height:u}=n.getBoundingClientRect(),d=new AbortController,f=e.combinedSignal(d),m=b=>{d.abort(),w(this,on,vS).call(this,e,b)};window.addEventListener("blur",m,{signal:f}),window.addEventListener("pointerup",m,{signal:f}),window.addEventListener("pointerdown",Qt,{capture:!0,passive:!1,signal:f}),window.addEventListener("contextmenu",cn,{signal:f}),n.addEventListener("pointermove",w(this,on,wS).bind(this,e),{signal:f}),this._freeHighlight=new fb({x:r,y:a},[l,c,h,u],e.scale,this._defaultThickness/2,i,.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,i,n){var y,v,S,x;let r=null;if(e instanceof Kv){const{data:{quadPoints:E,rect:C,rotation:T,id:R,color:D,opacity:L,popupRef:I,richText:N,contentsObj:F,creationDate:U,modificationDate:Y},parent:{page:{pageNumber:$}}}=e;r=e={annotationType:rt.HIGHLIGHT,color:Array.from(D),opacity:L,quadPoints:E,boxes:null,pageIndex:$-1,rect:C.slice(0),rotation:T,annotationElementId:R,id:R,deleted:!1,popupRef:I,richText:N,comment:(F==null?void 0:F.str)||null,creationDate:U,modificationDate:Y}}else if(e instanceof i0){const{data:{inkLists:E,rect:C,rotation:T,id:R,color:D,borderStyle:{rawWidth:L},popupRef:I,richText:N,contentsObj:F,creationDate:U,modificationDate:Y},parent:{page:{pageNumber:$}}}=e;r=e={annotationType:rt.HIGHLIGHT,color:Array.from(D),thickness:L,inkLists:E,boxes:null,pageIndex:$-1,rect:C.slice(0),rotation:T,annotationElementId:R,id:R,deleted:!1,popupRef:I,richText:N,comment:(F==null?void 0:F.str)||null,creationDate:U,modificationDate:Y}}const{color:a,quadPoints:l,inkLists:c,opacity:h}=e,u=await super.deserialize(e,i,n);u.color=W.makeHexColor(...a),u.opacity=h||1,c&&p(u,rn,e.thickness),u._initialData=r,e.comment&&u.setCommentData(e);const[d,f]=u.pageDimensions,[m,b]=u.pageTranslation;if(l){const E=p(u,Js,[]);for(let C=0;C<l.length;C+=8)E.push({x:(l[C]-m)/d,y:1-(l[C+1]-b)/f,width:(l[C+2]-l[C])/d,height:(l[C+1]-l[C+5])/f});
24w(y=u,lt,pb).call(y),w(v=u,lt,Sa).call(v),u.rotate(u.rotation)}else if(c){p(u,Oe,!0);const E=c[0],C={x:E[0]-m,y:f-(E[1]-b)},T=new fb(C,[0,0,d,f],1,s(u,rn)/2,!0,.001);for(let L=0,I=E.length;L<I;L+=2)C.x=E[L]-m,C.y=f-(E[L+1]-b),T.add(C);const{id:R,clipPathId:D}=i.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:u.color,"fill-opacity":u._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:T.toSVGPath()}},!0,!0);w(S=u,lt,pp).call(S,{highlightOutlines:T.getOutlines(),highlightId:R,clipPathId:D}),w(x=u,lt,Sa).call(x),u.rotate(u.parentRotation)}return u}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();const i=Bt._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),n=super.serialize(e);return Object.assign(n,{color:i,opacity:this.opacity,thickness:s(this,rn),quadPoints:w(this,lt,bS).call(this),outlines:w(this,lt,AS).call(this,n.rect)}),this.addComment(n),this.annotationElementId&&!w(this,lt,SS).call(this,n)?null:(n.id=this.annotationElementId,n)}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}};Uc=new WeakMap,Id=new WeakMap,Js=new WeakMap,Co=new WeakMap,Fd=new WeakMap,yi=new WeakMap,Nd=new WeakMap,Bd=new WeakMap,To=new WeakMap,Ii=new WeakMap,Fi=new WeakMap,Oe=new WeakMap,$c=new WeakMap,Hc=new WeakMap,qe=new WeakMap,jc=new WeakMap,rn=new WeakMap,Ud=new WeakMap,lt=new WeakSet,pb=function(){const e=new ub(s(this,Js),.001);p(this,Ii,e.getOutlines()),[this.x,this.y,this.width,this.height]=s(this,Ii).box;const i=new ub(s(this,Js),.0025,.001,this._uiManager.direction==="ltr");p(this,yi,i.getOutlines());const{firstPoint:n}=s(this,Ii);p(this,$c,[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height]);const{lastPoint:r}=s(this,yi);p(this,Hc,[(r[0]-this.x)/this.width,(r[1]-this.y)/this.height])},pp=function({highlightOutlines:e,highlightId:i,clipPathId:n}){var f,m;if(p(this,Ii,e),p(this,yi,e.getNewOutline(s(this,rn)/2+1.5,.0025)),i>=0)p(this,Fi,i),p(this,Co,n),this.parent.drawLayer.finalizeDraw(i,{bbox:e.box,path:{d:e.toSVGPath()}}),p(this,qe,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:s(this,yi).box,path:{d:s(this,yi).toSVGPath()}},!0));else if(this.parent){const b=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(s(this,Fi),{bbox:w(f=_t,on,Al).call(f,s(this,Ii).box,(b-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(s(this,qe),{bbox:w(m=_t,on,Al).call(m,s(this,yi).box,b),path:{d:s(this,yi).toSVGPath()}})}const[a,l,c,h]=e.box;switch(this.rotation){case 0:this.x=a,this.y=l,this.width=c,this.height=h;break;case 90:{const[b,y]=this.parentDimensions;this.x=l,this.y=1-a,this.width=c*y/b,this.height=h*b/y;break}case 180:this.x=1-a,this.y=1-l,this.width=c,this.height=h;break;case 270:{const[b,y]=this.parentDimensions;this.x=1-l,this.y=a,this.width=c*y/b,this.height=h*b/y;break}}const{firstPoint:u}=e;p(this,$c,[(u[0]-a)/c,(u[1]-l)/h]);const{lastPoint:d}=s(this,yi);p(this,Hc,[(d[0]-a)/c,(d[1]-l)/h])},pS=function(e){const i=(a,l)=>{this.color=a,this.opacity=l,this.onUpdatedColor()},n=this.color,r=this.opacity;this.addCommands({cmd:i.bind(this,e,_t._defaultOpacity),undo:i.bind(this,n,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:mt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(e)},!0)},gS=function(e){const i=s(this,rn),n=r=>{p(this,rn,r),w(this,lt,mS).call(this,r)};this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:mt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)},mS=function(e){s(this,Oe)&&(w(this,lt,pp).call(this,{highlightOutlines:s(this,Ii).getNewOutline(e/2)}),this.fixAndSetPosition(),this.setDims(this.width,this.height))},gb=function(){s(this,Fi)===null||!this.parent||(this.parent.drawLayer.remove(s(this,Fi)),p(this,Fi,null),this.parent.drawLayer.remove(s(this,qe)),p(this,qe,null))},Sa=function(e=this.parent){s(this,Fi)===null&&({id:ce(this,Fi)._,clipPathId:ce(this,Co)._}=e.drawLayer.draw({bbox:s(this,Ii).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:s(this,Oe)},path:{d:s(this,Ii).toSVGPath()}},!1,!0),p(this,qe,e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:s(this,Oe)},bbox:s(this,yi).box,path:{d:s(this,yi).toSVGPath()}},s(this,Oe))),s(this,To)&&(s(this,To).style.clipPath=s(this,Co)))},on=new WeakSet,Al=function([e,i,n,r],a){switch(a){case 90:return[1-i-r,e,r,n];case 180:return[1-e-n,1-i-r,n,r];case 270:return[i,1-e-n,r,n]}return[e,i,n,r]},yS=function(e){_t._keyboardManager.exec(this,e)},gp=function(e){if(!s(this,Uc))return;const i=window.getSelection();e?i.setPosition(s(this,Uc),s(this,Id)):i.setPosition(s(this,Nd),s(this,Bd))},mp=function(){return s(this,Oe)?this.rotation:0},bS=function(){if(s(this,Oe))return null;const[e,i]=this.pageDimensions,[n,r]=this.pageTranslation,a=s(this,Js),l=new Float32Array(a.length*8);let c=0;for(const{x:h,y:u,width:d,height:f}of a){const m=h*e+n,b=(1-u)*i+r;l[c]=l[c+4]=m,l[c+1]=l[c+3]=b,l[c+2]=l[c+6]=m+d*e,l[c+5]=l[c+7]=b-f*i,c+=8}return l},AS=function(e){return s(this,Ii).serialize(e,w(this,lt,mp).call(this))},wS=function(e,i){this._freeHighlight.add(i)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},vS=function(e,i){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(i,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},SS=function(e){const{color:i}=this._initialData;return this.hasEditedComment||e.color.some((n,r)=>n!==i[r])},A(_t,on),k(_t,"_defaultColor",null),k(_t,"_defaultOpacity",1),k(_t,"_defaultThickness",12),k(_t,"_type","highlight"),k(_t,"_editorType",rt.HIGHLIGHT),k(_t,"_freeHighlightId",-1),
24k(_t,"_freeHighlight",null),k(_t,"_freeHighlightClipId","");let zp=_t;var Po;class _S{constructor(){A(this,Po,Object.create(null))}updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(const[e,i]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,i)}updateSVGProperty(t,e){s(this,Po)[t]=e}toSVGProperties(){const t=s(this,Po);return p(this,Po,Object.create(null)),{root:t}}reset(){p(this,Po,Object.create(null))}updateAll(t=this){this.updateProperties(t)}clone(){Ft("Not implemented")}}Po=new WeakMap;var Ni,zc,we,Ro,Mo,Yr,Kr,Jr,Do,wt,mb,yb,bb,qh,ES,yp,Xh,wl;const V=class V extends Bt{constructor(e){super(e);A(this,wt);A(this,Ni,null);A(this,zc);k(this,"_colorPicker",null);k(this,"_drawId",null);p(this,zc,e.mustBeCommitted||!1),this._addOutlines(e)}onUpdatedColor(){var e;(e=this._colorPicker)==null||e.update(this.color),super.onUpdatedColor()}_addOutlines(e){e.drawOutlines&&(w(this,wt,mb).call(this,e),w(this,wt,qh).call(this))}static _mergeSVGProperties(e,i){const n=new Set(Object.keys(e));for(const[r,a]of Object.entries(i))n.has(r)?Object.assign(e[r],a):e[r]=a;return e}static getDefaultDrawingOptions(e){Ft("Not implemented")}static get typesMap(){Ft("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(e,i){const n=this.typesMap.get(e);n&&this._defaultDrawingOptions.updateProperty(n,i),this._currentParent&&(s(V,we).updateProperty(n,i),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,i){const n=this.constructor.typesMap.get(e);n&&this._updateProperty(e,n,i)}static get defaultPropertiesToUpdate(){const e=[],i=this._defaultDrawingOptions;for(const[n,r]of this.typesMap)e.push([n,i[r]]);return e}get propertiesToUpdate(){const e=[],{_drawingOptions:i}=this;for(const[n,r]of this.constructor.typesMap)e.push([n,i[r]]);return e}_updateProperty(e,i,n){const r=this._drawingOptions,a=r[i],l=c=>{var u;r.updateProperty(i,c);const h=s(this,Ni).updateProperty(i,c);h&&w(this,wt,Xh).call(this,h),(u=this.parent)==null||u.drawLayer.updateProperties(this._drawId,r.toSVGProperties()),e===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:l.bind(this,n),undo:l.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,V._mergeSVGProperties(s(this,Ni).getPathResizingSVGProperties(w(this,wt,yp).call(this)),{bbox:w(this,wt,wl).call(this)}))}_onResized(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,V._mergeSVGProperties(s(this,Ni).getPathResizedSVGProperties(w(this,wt,yp).call(this)),{bbox:w(this,wt,wl).call(this)}))}_onTranslating(e,i){var n;(n=this.parent)==null||n.drawLayer.updateProperties(this._drawId,{bbox:w(this,wt,wl).call(this)})}_onTranslated(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,V._mergeSVGProperties(s(this,Ni).getPathTranslatedSVGProperties(w(this,wt,yp).call(this),this.parentDimensions),{bbox:w(this,wt,wl).call(this)}))}_onStartDragging(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var e;(e=this.parent)==null||e.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,s(this,zc)&&(p(this,zc,!1),this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){w(this,wt,bb).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(w(this,wt,qh).call(this),w(this,wt,Xh).call(this,s(this,Ni).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){var n;let i=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),w(this,wt,bb).call(this)):e&&(this._uiManager.addShouldRescale(this),w(this,wt,qh).call(this,e),i=!this.parent&&((n=this.div)==null?void 0:n.classList.contains("selectedEditor"))),super.setParent(e),i&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,V._mergeSVGProperties({bbox:w(this,wt,wl).call(this)},s(this,Ni).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&w(this,wt,Xh).call(this,s(this,Ni).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}
24render(){if(this.div)return this.div;let e,i;this._isCopy&&(e=this.x,i=this.y);const n=super.render();n.classList.add("draw");const r=document.createElement("div");return n.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,i),n}static createDrawerInstance(e,i,n,r,a){Ft("Not implemented")}static startDrawing(e,i,n,r){var v;const{target:a,offsetX:l,offsetY:c,pointerId:h,pointerType:u}=r;if(s(V,Kr)&&s(V,Kr)!==u)return;const{viewport:{rotation:d}}=e,{width:f,height:m}=a.getBoundingClientRect(),b=p(V,Ro,new AbortController),y=e.combinedSignal(b);if(s(V,Yr)||p(V,Yr,h),s(V,Kr)??p(V,Kr,u),window.addEventListener("pointerup",S=>{var x;s(V,Yr)===S.pointerId?this._endDraw(S):(x=s(V,Jr))==null||x.delete(S.pointerId)},{signal:y}),window.addEventListener("pointercancel",S=>{var x;s(V,Yr)===S.pointerId?this._currentParent.endDrawingSession():(x=s(V,Jr))==null||x.delete(S.pointerId)},{signal:y}),window.addEventListener("pointerdown",S=>{s(V,Kr)===S.pointerType&&((s(V,Jr)||p(V,Jr,new Set)).add(S.pointerId),s(V,we).isCancellable()&&(s(V,we).removeLastElement(),s(V,we).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:y}),window.addEventListener("contextmenu",cn,{signal:y}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:y}),a.addEventListener("touchmove",S=>{S.timeStamp===s(V,Do)&&Qt(S)},{signal:y}),e.toggleDrawing(),(v=i._editorUndoBar)==null||v.hide(),s(V,we)){e.drawLayer.updateProperties(this._currentDrawId,s(V,we).startNew(l,c,f,m,d));return}i.updateUIForDefaultProperties(this),p(V,we,this.createDrawerInstance(l,c,f,m,d)),p(V,Mo,this.getDefaultDrawingOptions()),this._currentParent=e,{id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(s(V,Mo).toSVGProperties(),s(V,we).defaultSVGProperties),!0,!1)}static _drawMove(e){var a;if(p(V,Do,-1),!s(V,we))return;const{offsetX:i,offsetY:n,pointerId:r}=e;if(s(V,Yr)===r){if(((a=s(V,Jr))==null?void 0:a.size)>=1){this._endDraw(e);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,s(V,we).add(i,n)),p(V,Do,e.timeStamp),Qt(e)}}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,p(V,we,null),p(V,Mo,null),p(V,Kr,null),p(V,Do,NaN)),s(V,Ro)&&(s(V,Ro).abort(),p(V,Ro,null),p(V,Yr,NaN),p(V,Jr,null))}static _endDraw(e){const i=this._currentParent;if(i){if(i.toggleDrawing(!0),this._cleanup(!1),(e==null?void 0:e.target)===i.div&&i.drawLayer.updateProperties(this._currentDrawId,s(V,we).end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){const n=s(V,we),r=this._currentDrawId,a=n.getLastElement();i.addCommands({cmd:()=>{i.drawLayer.updateProperties(r,n.setLastElement(a))},undo:()=>{i.drawLayer.updateProperties(r,n.removeLastElement())},mustExec:!1,type:mt.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(e){const i=this._currentParent;if(!i)return null;if(i.toggleDrawing(!0),i.cleanUndoStack(mt.DRAW_STEP),!s(V,we).isEmpty()){const{pageDimensions:[n,r],scale:a}=i,l=i.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:s(V,we).getOutlines(n*a,r*a,a,this._INNER_MARGIN),drawingOptions:s(V,Mo),mustBeCommitted:!e});return this._cleanup(!0),l}return i.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,i,n,r,a,l){Ft("Not implemented")}static async deserialize(e,i,n){var d,f;const{rawDims:{pageWidth:r,pageHeight:a,pageX:l,pageY:c}}=i.viewport,h=this.deserializeDraw(l,c,r,a,this._INNER_MARGIN,e),u=await super.deserialize(e,i,n);return u.createDrawingOptions(e),w(d=u,wt,mb).call(d,{drawOutlines:h}),w(f=u,wt,qh).call(f),u.onScaleChanging(),u.rotate(),u}serializeDraw(e){const[i,n]=this.pageTranslation,[r,a]=this.pageDimensions;return s(this,Ni).serialize([i,n,r,a],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}};Ni=new WeakMap,zc=new WeakMap,we=new WeakMap,Ro=new WeakMap,Mo=new WeakMap,Yr=new WeakMap,Kr=new WeakMap,Jr=new WeakMap,Do=new WeakMap,wt=new WeakSet,mb=function({drawOutlines:e,drawId:i,drawingOptions:n}){p(this,Ni,e),this._drawingOptions||(this._drawingOptions=n),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),i>=0?(this._drawId=i,this.parent.drawLayer.finalizeDraw(i,e.defaultProperties)):this._drawId=w(this,wt,yb).call(this,e,this.parent),w(this,wt,Xh).call(this,e.box)},yb=function(e,i){const{id:n}=i.drawLayer.draw(V._mergeSVGProperties(this._drawingOptions.toSVGProperties(),e.defaultSVGProperties),!1,!1);return n},bb=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},qh=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=w(this,wt,yb).call(this,s(this,Ni),e)}},ES=function([e,i,n,r]){const{parentDimensions:[a,l],rotation:c}=this;switch(c){case 90:return[i,1-e,n*(l/a),r*(a/l)];case 180:return[1-e,1-i,n,r];case 270:return[1-i,e,n*(l/a),r*(a/l)];default:return[e,i,n,r]}},yp=function(){const{x:e,y:i,width:n,height:r,parentDimensions:[a,l],rotation:c}=this;switch(c){case 90:return[1-i,e,n*(a/l),r*(l/a)];case 180:return[1-e,1-i,n,r];case 270:return[i,1-e,n*(a/l),r*(l/a)];default:return[e,i,n,r]}},Xh=function(e){[this.x,this.y,this.width,this.height]=w(this,wt,ES).call(this,e),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()},wl=function(){const{x:e,y:i,width:n,height:r,rotation:a,parentRotation:l,parentDimensions:[c,h]}=this;switch((a*4+l)/90){case 1:return[1-i-r,e,r,n];case 2:return[1-e-n,1-i-r,n,r];case 3:return[i,1-e-n,r,n];case 4:return[e,i-n*(c/h),r*(h/c),n*(c/h)];case 5:return[1-i,e,n*(c/h),r*(h/c)];case 6:return[1-e-r*(h/c),1-i,r*(h/c),n*(c/h)];case 7:return[i-n*(c/h),1-e-r*(h/c),n*(c/h),r*(h/c)];case 8:return[e-n,i-r,n,r];case 9:return[1-i,e-n,r,n];case 10:return[1-e,1-i,n,r];case 11:return[i-r,1-e,r,n];case 12:return[e-r*(h/c),i,r*(h/c),n*(c/h)];case 13:return[1-i-n*(c/h),e-r*(h/c),n*(c/h),r*(h/c)];case 14:return[1-e,1-i-n*(c/h),r*(h/c),n*(c/h)];case 15:return[i,1-e,n*(c/h),r*(h/c)];default:return[e,i,n,r]}},k(V,"_currentDrawId",-1),k(V,"_currentParent",null),A(V,we,null),A(V,Ro,null),A(V,Mo,null),A(V,Yr,NaN),A(V,Kr,null),A(V,Jr,null),A(V,Do,NaN),k(V,"_INNER_MARGIN",3);let Gp=V;var ns,ve,Se,Oo,Gc,ti,Le,an,Lo,ko,Io,Wc,bp;class QP{constructor(t,e,i,n,r,a){A(this,Wc);A(this,ns,new Float64Array(6));A(this,ve);A(this,Se);A(this,Oo);A(this,Gc);A(this,ti);A(this,Le,"");A(this,an,0);A(this,Lo,new rf);A(this,ko);A(this,Io);p(this,ko,i),p(this,Io,n),p(this,Oo,r),p(this,Gc,a),[t,e]=w(this,Wc,bp).call(this,t,e);const l=p(this,ve,[NaN,NaN,NaN,NaN,t,e]);p(this,ti,[t,e]),p(this,Se,[{line:l,points:s(this,ti)}]),s(this,ns).set(l,0)}updateProperty(t,e){t==="stroke-width"&&p(this,Gc,e)}isEmpty(){return!s(this,Se)||s(this,Se).length===0}isCancellable(){return s(this,ti).length<=10}add(t,e){[t,e]=w(this,Wc,bp).call(this,t,e);const[i,n,r,a]=s(this,ns).subarray(2,6),l=t-r,c=e-a;return Math.hypot(s(this,ko)*l,s(this,Io)*c)<=2?null:(s(this,ti).push(t,e),isNaN(i)?(s(this,ns).set([r,a,t,e],2),s(this,ve).push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(s(this,ns)[0])&&s(this,ve).splice(6,6),s(this,ns).set([i,n,r,a,t,e],0),s(this,ve).push(...z.createBezierPoints(i,n,r,a,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){const i=this.add(t,e);
24return i||(s(this,ti).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,i,n,r){p(this,ko,i),p(this,Io,n),p(this,Oo,r),[t,e]=w(this,Wc,bp).call(this,t,e);const a=p(this,ve,[NaN,NaN,NaN,NaN,t,e]);p(this,ti,[t,e]);const l=s(this,Se).at(-1);return l&&(l.line=new Float32Array(l.line),l.points=new Float32Array(l.points)),s(this,Se).push({line:a,points:s(this,ti)}),s(this,ns).set(a,0),p(this,an,0),this.toSVGPath(),null}getLastElement(){return s(this,Se).at(-1)}setLastElement(t){return s(this,Se)?(s(this,Se).push(t),p(this,ve,t.line),p(this,ti,t.points),p(this,an,0),{path:{d:this.toSVGPath()}}):s(this,Lo).setLastElement(t)}removeLastElement(){if(!s(this,Se))return s(this,Lo).removeLastElement();s(this,Se).pop(),p(this,Le,"");for(let t=0,e=s(this,Se).length;t<e;t++){const{line:i,points:n}=s(this,Se)[t];p(this,ve,i),p(this,ti,n),p(this,an,0),this.toSVGPath()}return{path:{d:s(this,Le)}}}toSVGPath(){const t=z.svgRound(s(this,ve)[4]),e=z.svgRound(s(this,ve)[5]);if(s(this,ti).length===2)return p(this,Le,`${s(this,Le)} M ${t} ${e} Z`),s(this,Le);if(s(this,ti).length<=6){const n=s(this,Le).lastIndexOf("M");p(this,Le,`${s(this,Le).slice(0,n)} M ${t} ${e}`),p(this,an,6)}if(s(this,ti).length===4){const n=z.svgRound(s(this,ve)[10]),r=z.svgRound(s(this,ve)[11]);return p(this,Le,`${s(this,Le)} L ${n} ${r}`),p(this,an,12),s(this,Le)}const i=[];s(this,an)===0&&(i.push(`M ${t} ${e}`),p(this,an,6));for(let n=s(this,an),r=s(this,ve).length;n<r;n+=6){const[a,l,c,h,u,d]=s(this,ve).slice(n,n+6).map(z.svgRound);i.push(`C${a} ${l} ${c} ${h} ${u} ${d}`)}return p(this,Le,s(this,Le)+i.join(" ")),p(this,an,s(this,ve).length),s(this,Le)}getOutlines(t,e,i,n){const r=s(this,Se).at(-1);return r.line=new Float32Array(r.line),r.points=new Float32Array(r.points),s(this,Lo).build(s(this,Se),t,e,i,s(this,Oo),s(this,Gc),n),p(this,ns,null),p(this,ve,null),p(this,Se,null),p(this,Le,null),s(this,Lo)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}ns=new WeakMap,ve=new WeakMap,Se=new WeakMap,Oo=new WeakMap,Gc=new WeakMap,ti=new WeakMap,Le=new WeakMap,an=new WeakMap,Lo=new WeakMap,ko=new WeakMap,Io=new WeakMap,Wc=new WeakSet,bp=function(t,e){return z._normalizePoint(t,e,s(this,ko),s(this,Io),s(this,Oo))};var ei,$d,Hd,Bi,ss,rs,Vc,qc,Fo,Ie,As,xS,CS,TS;class rf extends z{constructor(){super(...arguments);A(this,Ie);A(this,ei);A(this,$d,0);A(this,Hd);A(this,Bi);A(this,ss);A(this,rs);A(this,Vc);A(this,qc);A(this,Fo)}build(e,i,n,r,a,l,c){p(this,ss,i),p(this,rs,n),p(this,Vc,r),p(this,qc,a),p(this,Fo,l),p(this,Hd,c??0),p(this,Bi,e),w(this,Ie,CS).call(this)}get thickness(){return s(this,Fo)}setLastElement(e){return s(this,Bi).push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return s(this,Bi).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const e=[];for(const{line:i}of s(this,Bi)){if(e.push(`M${z.svgRound(i[4])} ${z.svgRound(i[5])}`),i.length===6){e.push("Z");continue}if(i.length===12&&isNaN(i[6])){e.push(`L${z.svgRound(i[10])} ${z.svgRound(i[11])}`);continue}for(let n=6,r=i.length;n<r;n+=6){const[a,l,c,h,u,d]=i.subarray(n,n+6).map(z.svgRound);e.push(`C${a} ${l} ${c} ${h} ${u} ${d}`)}}return e.join("")}serialize([e,i,n,r],a){const l=[],c=[],[h,u,d,f]=w(this,Ie,xS).call(this);let m,b,y,v,S,x,E,C,T;switch(s(this,qc)){case 0:T=z._rescale,m=e,b=i+r,y=n,v=-r,S=e+h*n,x=i+(1-u-f)*r,E=e+(h+d)*n,C=i+(1-u)*r;break;case 90:T=z._rescaleAndSwap,m=e,b=i,y=n,v=r,S=e+u*n,x=i+h*r,E=e+(u+f)*n,C=i+(h+d)*r;break;case 180:T=z._rescale,m=e+n,b=i,y=-n,v=r,S=e+(1-h-d)*n,x=i+u*r,E=e+(1-h)*n,C=i+(u+f)*r;break;case 270:T=z._rescaleAndSwap,m=e+n,b=i+r,y=-n,v=-r,S=e+(1-u-f)*n,x=i+(1-h-d)*r,E=e+(1-u)*n,C=i+(1-h)*r;break}for(const{line:R,points:D}of s(this,Bi))l.push(T(R,m,b,y,v,a?new Array(R.length):null)),c.push(T(D,m,b,y,v,a?new Array(D.length):null));return{lines:l,points:c,rect:[S,x,E,C]}}static deserialize(e,i,n,r,a,{paths:{lines:l,points:c},rotation:h,thickness:u}){const d=[];let f,m,b,y,v;switch(h){case 0:v=z._rescale,f=-e/n,m=i/r+1,b=1/n,y=-1/r;break;case 90:v=z._rescaleAndSwap,f=-i/r,m=-e/n,b=1/r,y=1/n;break;case 180:v=z._rescale,f=e/n+1,m=-i/r,b=-1/n,y=1/r;break;case 270:v=z._rescaleAndSwap,f=i/r+1,m=e/n+1,b=-1/r,y=-1/n;break}if(!l){l=[];for(const x of c){const E=x.length;if(E===2){l.push(new Float32Array([NaN,NaN,NaN,NaN,x[0],x[1]]));continue}if(E===4){l.push(new Float32Array([NaN,NaN,NaN,NaN,x[0],x[1],NaN,NaN,NaN,NaN,x[2],x[3]]));continue}const C=new Float32Array(3*(E-2));l.push(C);let[T,R,D,L]=x.subarray(0,4);C.set([NaN,NaN,NaN,NaN,T,R],0);for(let I=4;I<E;I+=2){const N=x[I],F=x[I+1];C.set(z.createBezierPoints(T,R,D,L,N,F),(I-2)*3),[T,R,D,L]=[D,L,N,F]}}}for(let x=0,E=l.length;x<E;x++)d.push({line:v(l[x].map(C=>C??NaN),f,m,b,y),points:v(c[x].map(C=>C??NaN),f,m,b,y)});const S=new this.prototype.constructor;return S.build(d,n,r,1,h,u,a),S}get box(){return s(this,ei)}updateProperty(e,i){return e==="stroke-width"?w(this,Ie,TS).call(this,i):null}updateParentDimensions([e,i],n){const[r,a]=w(this,Ie,As).call(this);p(this,ss,e),p(this,rs,i),p(this,Vc,n);const[l,c]=w(this,Ie,As).call(this),h=l-r,u=c-a,d=s(this,ei);return d[0]-=h,d[1]-=u,d[2]+=2*h,d[3]+=2*u,d}updateRotation(e){return p(this,$d,e),{path:{transform:this.rotationTransform}}}get viewBox(){return s(this,ei).map(z.svgRound).join(" ")}get defaultProperties(){const[e,i]=s(this,ei);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${z.svgRound(e)} ${z.svgRound(i)}`}}}get rotationTransform(){const[,,e,i]=s(this,ei);let n=0,r=0,a=0,l=0,c=0,h=0;switch(s(this,$d)){case 90:r=i/e,a=-e/i,c=e;break;case 180:n=-1,l=-1,c=e,h=i;break;case 270:r=-i/e,a=e/i,h=i;break;default:return""}return`matrix(${n} ${r} ${a} ${l} ${z.svgRound(c)} ${z.svgRound(h)})`}getPathResizingSVGProperties([e,i,n,r]){const[a,l]=w(this,Ie,As).call(this),[c,h,u,d]=s(this,ei);if(Math.abs(u-a)<=z.PRECISION||Math.abs(d-l)<=z.PRECISION){const v=e+n/2-(c+u/2),S=i+r/2-(h+d/2);return{path:{"transform-origin":`${z.svgRound(e)} ${z.svgRound(i)}`,transform:`${this.rotationTransform} translate(${v} ${S})`}}}const f=(n-2*a)/(u-2*a),m=(r-2*l)/(d-2*l),b=u/n,y=d/r;return{path:{"transform-origin":`${z.svgRound(c)} ${z.svgRound(h)}`,transform:`${this.rotationTransform} scale(${b} ${y}) translate(${z.svgRound(a)} ${z.svgRound(l)}) scale(${f} ${m}) translate(${z.svgRound(-a)} ${z.svgRound(-l)})`}}}getPathResizedSVGProperties([e,i,n,r]){const[a,l]=w(this,Ie,As).call(this),c=s(this,ei),[h,u,d,f]=c;if(c[0]=e,c[1]=i,c[2]=n,c[3]=r,Math.abs(d-a)<=z.PRECISION||Math.abs(f-l)<=z.PRECISION){const S=e+n/2-(h+d/2),x=i+r/2-(u+f/2);for(const{line:E,points:C}of s(this,Bi))z._translate(E,S,x,E),z._translate(C,S,x,C);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${z.svgRound(e)} ${z.svgRound(i)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const m=(n-2*a)/(d-2*a),b=(r-2*l)/(f-2*l),y=-m*(h+a)+e+a,v=-b*(u+l)+i+l;if(m!==1||b!==1||y!==0||v!==0)for(const{line:S,points:x}of s(this,Bi))z._rescale(S,y,v,m,b,S),z._rescale(x,y,v,m,b,x);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${z.svgRound(e)} ${z.svgRound(i)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,i],n){const[r,a]=n,l=s(this,ei),c=e-l[0],h=i-l[1];if(s(this,ss)===r&&s(this,rs)===a)for(const{line:u,points:d}of s(this,Bi))z._translate(u,c,h,u),z._translate(d,c,h,d);else{const u=s(this,ss)/r,d=s(this,rs)/a;p(this,ss,r),p(this,rs,a);for(const{line:f,points:m}of s(this,Bi))z._rescale(f,c,h,u,d,f),z._rescale(m,c,h,u,d,m);l[2]*=u,l[3]*=d}return l[0]=e,l[1]=i,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${z.svgRound(e)} ${z.svgRound(i)}`}}}get defaultSVGProperties(){const e=s(this,ei);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${z.svgRound(e[0])} ${z.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}}ei=new WeakMap,$d=new WeakMap,Hd=new WeakMap,Bi=new WeakMap,ss=new WeakMap,rs=new WeakMap,Vc=new WeakMap,qc=new WeakMap,Fo=new WeakMap,Ie=new WeakSet,As=function(e=s(this,Fo)){const i=s(this,Hd)+e/2*s(this,Vc);return s(this,qc)%180===0?[i/s(this,ss),i/s(this,rs)]:[i/s(this,rs),i/s(this,ss)]},xS=function(){const[e,i,n,r]=s(this,ei),[a,l]=w(this,Ie,As).call(this,0);return[e+a,i+l,n-2*a,r-2*l]},CS=function(){const e=p(this,ei,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:r}of s(this,Bi)){if(r.length<=12){for(let c=4,h=r.length;c<h;c+=6)W.pointBoundingBox(r[c],r[c+1],e);continue}let a=r[4],l=r[5];for(let c=6,h=r.length;c<h;c+=6){const[u,d,f,m,b,y]=r.subarray(c,c+6);W.bezierBoundingBox(a,l,u,d,f,m,b,y,e),a=b,l=y}}const[i,n]=w(this,Ie,As).call(this);e[0]=si(e[0]-i,0,1),e[1]=si(e[1]-n,0,1),e[2]=si(e[2]+i,0,1),e[3]=si(e[3]+n,0,1),e[2]-=e[0],e[3]-=e[1]},TS=function(e){const[i,n]=w(this,Ie,As).call(this);p(this,Fo,e);const[r,a]=w(this,Ie,As).call(this),[l,c]=[r-i,a-n],h=s(this,ei);return h[0]-=l,h[1]-=c,h[2]+=2*l,h[3]+=2*c,h};class Cg extends _S{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:Bt._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(){const t=new Cg(this._viewParameters);return t.updateAll(this),t}}var lg,PS;const Cl=class Cl extends Gp{constructor(e){super({...e,name:"inkEditor"});A(this,lg);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(e,i){Bt.initialize(e,i),this._defaultDrawingOptions=new Cg(i.viewParameters)}static getDefaultDrawingOptions(e){const i=this._defaultDrawingOptions.clone();return i.updateProperties(e),i}static get supportMultipleDrawings(){return!0}static get typesMap(){return ht(this,"typesMap",new Map([[mt.INK_THICKNESS,"stroke-width"],[mt.INK_COLOR,"stroke"],[mt.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,i,n,r,a){return new QP(e,i,n,r,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,i,n,r,a,l){return rf.deserialize(e,i,n,r,a,l)}static async deserialize(e,i,n){let r=null;if(e instanceof i0){const{data:{inkLists:l,rect:c,rotation:h,id:u,color:d,opacity:f,borderStyle:{rawWidth:m},popupRef:b,richText:y,contentsObj:v,creationDate:S,modificationDate:x},parent:{page:{pageNumber:E}}}=e;r=e={annotationType:rt.INK,color:Array.from(d),thickness:m,opacity:f,paths:{points:l},boxes:null,pageIndex:E-1,rect:c.slice(0),rotation:h,annotationElementId:u,id:u,deleted:!1,popupRef:b,richText:y,comment:(v==null?void 0:v.str)||null,creationDate:S,modificationDate:x}}const a=await super.deserialize(e,i,n);return a._initialData=r,e.comment&&a.setCommentData(e),a}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new $p(this)),[["colorPicker",this._colorPicker]]}get colorType(){return mt.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:e,_drawingOptions:i,parent:n}=this;i.updateSVGProperty("stroke-width"),n.drawLayer.updateProperties(e,i.toSVGProperties())}static onScaleChangingWhenDrawing(){const e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:i,opacity:n}
24){this._drawingOptions=Cl.getDefaultDrawingOptions({stroke:W.makeHexColor(...e),"stroke-width":i,"stroke-opacity":n})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:i,points:n}=this.serializeDraw(e),{_drawingOptions:{stroke:r,"stroke-opacity":a,"stroke-width":l}}=this,c=Object.assign(super.serialize(e),{color:Bt._colorManager.convert(r),opacity:a,thickness:l,paths:{lines:i,points:n}});return this.addComment(c),e?(c.isCopy=!0,c):this.annotationElementId&&!w(this,lg,PS).call(this,c)?null:(c.id=this.annotationElementId,c)}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;const{points:i,rect:n}=this.serializeDraw(!1);return e.updateEdited({rect:n,thickness:this._drawingOptions["stroke-width"],points:i,popup:this.comment}),null}};lg=new WeakSet,PS=function(e){const{color:i,thickness:n,opacity:r,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((l,c)=>l!==i[c])||e.thickness!==n||e.opacity!==r||e.pageIndex!==a},k(Cl,"_type","ink"),k(Cl,"_editorType",rt.INK),k(Cl,"_defaultDrawingOptions",null);let Ab=Cl;class wb extends rf{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}const Bf=8,Ph=3;var No,xt,vb,_n,RS,MS,Sb,Ap,DS,OS,LS,_b,Eb,kS;class sr{static extractContoursFromText(t,{fontFamily:e,fontStyle:i,fontWeight:n},r,a,l,c){let h=new OffscreenCanvas(1,1),u=h.getContext("2d",{alpha:!1});const d=200,f=u.font=`${i} ${n} ${d}px ${e}`,{actualBoundingBoxLeft:m,actualBoundingBoxRight:b,actualBoundingBoxAscent:y,actualBoundingBoxDescent:v,fontBoundingBoxAscent:S,fontBoundingBoxDescent:x,width:E}=u.measureText(t),C=1.5,T=Math.ceil(Math.max(Math.abs(m)+Math.abs(b)||0,E)*C),R=Math.ceil(Math.max(Math.abs(y)+Math.abs(v)||d,Math.abs(S)+Math.abs(x)||d)*C);h=new OffscreenCanvas(T,R),u=h.getContext("2d",{alpha:!0,willReadFrequently:!0}),u.font=f,u.filter="grayscale(1)",u.fillStyle="white",u.fillRect(0,0,T,R),u.fillStyle="black",u.fillText(t,T*(C-1)/2,R*(3-C)/2);const D=w(this,xt,_b).call(this,u.getImageData(0,0,T,R).data),L=w(this,xt,LS).call(this,D),I=w(this,xt,Eb).call(this,L),N=w(this,xt,Sb).call(this,D,T,R,I);return this.processDrawnLines({lines:{curves:N,width:T,height:R},pageWidth:r,pageHeight:a,rotation:l,innerMargin:c,mustSmooth:!0,areContours:!0})}static process(t,e,i,n,r){const[a,l,c]=w(this,xt,kS).call(this,t),[h,u]=w(this,xt,OS).call(this,a,l,c,Math.hypot(l,c)*s(this,No).sigmaSFactor,s(this,No).sigmaR,s(this,No).kernelSize),d=w(this,xt,Eb).call(this,u),f=w(this,xt,Sb).call(this,h,l,c,d);return this.processDrawnLines({lines:{curves:f,width:l,height:c},pageWidth:e,pageHeight:i,rotation:n,innerMargin:r,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:e,pageHeight:i,rotation:n,innerMargin:r,mustSmooth:a,areContours:l}){n%180!==0&&([e,i]=[i,e]);const{curves:c,width:h,height:u}=t,d=t.thickness??0,f=[],m=Math.min(e/h,i/u),b=m/e,y=m/i,v=[];for(const{points:x}of c){const E=a?w(this,xt,DS).call(this,x):x;if(!E)continue;v.push(E);const C=E.length,T=new Float32Array(C),R=new Float32Array(3*(C===2?2:C-2));if(f.push({line:R,points:T}),C===2){T[0]=E[0]*b,T[1]=E[1]*y,R.set([NaN,NaN,NaN,NaN,T[0],T[1]],0);continue}let[D,L,I,N]=E;D*=b,L*=y,I*=b,N*=y,T.set([D,L,I,N],0),R.set([NaN,NaN,NaN,NaN,D,L],0);for(let F=4;F<C;F+=2){const U=T[F]=E[F]*b,Y=T[F+1]=E[F+1]*y;R.set(z.createBezierPoints(D,L,I,N,U,Y),(F-2)*3),[D,L,I,N]=[I,N,U,Y]}}if(f.length===0)return null;const S=l?new wb:new rf;return S.build(f,e,i,1,n,l?0:d,r),{outline:S,newCurves:v,areContours:l,thickness:d,width:h,height:u}}static async compressSignature({outlines:t,areContours:e,thickness:i,width:n,height:r}){let a=1/0,l=-1/0,c=0;for(const E of t){c+=E.length;for(let C=2,T=E.length;C<T;C++){const R=E[C]-E[C-2];a=Math.min(a,R),l=Math.max(l,R)}}let h;a>=-128&&l<=127?h=Int8Array:a>=-32768&&l<=32767?h=Int16Array:h=Int32Array;const u=t.length,d=Bf+Ph*u,f=new Uint32Array(d);let m=0;f[m++]=d*Uint32Array.BYTES_PER_ELEMENT+(c-2*u)*h.BYTES_PER_ELEMENT,f[m++]=0,f[m++]=n,f[m++]=r,f[m++]=e?0:1,f[m++]=Math.max(0,Math.floor(i??0)),f[m++
24]=u,f[m++]=h.BYTES_PER_ELEMENT;for(const E of t)f[m++]=E.length-2,f[m++]=E[0],f[m++]=E[1];const b=new CompressionStream("deflate-raw"),y=b.writable.getWriter();await y.ready,y.write(f);const v=h.prototype.constructor;for(const E of t){const C=new v(E.length-2);for(let T=2,R=E.length;T<R;T++)C[T-2]=E[T]-E[T-2];y.write(C)}y.close();const S=await new Response(b.readable).arrayBuffer(),x=new Uint8Array(S);return Fw(x)}static async decompressSignature(t){try{const e=f1(t),{readable:i,writable:n}=new DecompressionStream("deflate-raw"),r=n.getWriter();await r.ready,r.write(e).then(async()=>{await r.ready,await r.close()}).catch(()=>{});let a=null,l=0;for await(const E of i)a||(a=new Uint8Array(new Uint32Array(E.buffer,0,4)[0])),a.set(E,l),l+=E.length;const c=new Uint32Array(a.buffer,0,a.length>>2),h=c[1];if(h!==0)throw new Error(`Invalid version: ${h}`);const u=c[2],d=c[3],f=c[4]===0,m=c[5],b=c[6],y=c[7],v=[],S=(Bf+Ph*b)*Uint32Array.BYTES_PER_ELEMENT;let x;switch(y){case Int8Array.BYTES_PER_ELEMENT:x=new Int8Array(a.buffer,S);break;case Int16Array.BYTES_PER_ELEMENT:x=new Int16Array(a.buffer,S);break;case Int32Array.BYTES_PER_ELEMENT:x=new Int32Array(a.buffer,S);break}l=0;for(let E=0;E<b;E++){const C=c[Ph*E+Bf],T=new Float32Array(C+2);v.push(T);for(let R=0;R<Ph-1;R++)T[R]=c[Ph*E+Bf+R+1];for(let R=0;R<C;R++)T[R+2]=T[R]+x[l++]}return{areContours:f,thickness:m,outlines:v,width:u,height:d}}catch(e){return it(`decompressSignature: ${e}`),null}}}No=new WeakMap,xt=new WeakSet,vb=function(t,e,i,n){return i-=t,n-=e,i===0?n>0?0:4:i===1?n+6:2-n},_n=new WeakMap,RS=function(t,e,i,n,r,a,l){const c=w(this,xt,vb).call(this,i,n,r,a);for(let h=0;h<8;h++){const u=(-h+c-l+16)%8,d=s(this,_n)[2*u],f=s(this,_n)[2*u+1];if(t[(i+d)*e+(n+f)]!==0)return u}return-1},MS=function(t,e,i,n,r,a,l){const c=w(this,xt,vb).call(this,i,n,r,a);for(let h=0;h<8;h++){const u=(h+c+l+16)%8,d=s(this,_n)[2*u],f=s(this,_n)[2*u+1];if(t[(i+d)*e+(n+f)]!==0)return u}return-1},Sb=function(t,e,i,n){const r=t.length,a=new Int32Array(r);for(let u=0;u<r;u++)a[u]=t[u]<=n?1:0;for(let u=1;u<i-1;u++)a[u*e]=a[u*e+e-1]=0;for(let u=0;u<e;u++)a[u]=a[e*i-1-u]=0;let l=1,c;const h=[];for(let u=1;u<i-1;u++){c=1;for(let d=1;d<e-1;d++){const f=u*e+d,m=a[f];if(m===0)continue;let b=u,y=d;if(m===1&&a[f-1]===0)l+=1,y-=1;else if(m>=1&&a[f+1]===0)l+=1,y+=1,m>1&&(c=m);else{m!==1&&(c=Math.abs(m));continue}const v=[d,u],S=y===d+1,x={isHole:S,points:v,id:l,parent:0};h.push(x);let E;for(const F of h)if(F.id===c){E=F;break}E?E.isHole?x.parent=S?E.parent:c:x.parent=S?c:E.parent:x.parent=S?c:0;const C=w(this,xt,RS).call(this,a,e,u,d,b,y,0);if(C===-1){a[f]=-l,a[f]!==1&&(c=Math.abs(a[f]));continue}let T=s(this,_n)[2*C],R=s(this,_n)[2*C+1];const D=u+T,L=d+R;b=D,y=L;let I=u,N=d;for(;;){const F=w(this,xt,MS).call(this,a,e,I,N,b,y,1);T=s(this,_n)[2*F],R=s(this,_n)[2*F+1];const U=I+T,Y=N+R;v.push(Y,U);const $=I*e+N;if(a[$+1]===0?a[$]=-l:a[$]===1&&(a[$]=l),U===u&&Y===d&&I===D&&N===L){a[f]!==1&&(c=Math.abs(a[f]));break}else b=I,y=N,I=U,N=Y}}}return h},Ap=function(t,e,i,n){if(i-e<=4){for(let D=e;D<i-2;D+=2)n.push(t[D],t[D+1]);return}const r=t[e],a=t[e+1],l=t[i-4]-r,c=t[i-3]-a,h=Math.hypot(l,c),u=l/h,d=c/h,f=u*a-d*r,m=c/l,b=1/h,y=Math.atan(m),v=Math.cos(y),S=Math.sin(y),x=b*(Math.abs(v)+Math.abs(S)),E=b*(1-x+x**2),C=Math.max(Math.atan(Math.abs(S+v)*E),Math.atan(Math.abs(S-v)*E));let T=0,R=e;for(let D=e+2;D<i-2;D+=2){const L=Math.abs(f-u*t[D+1]+d*t[D]);L>T&&(R=D,T=L)}T>(h*C)**2?(w(this,xt,Ap).call(this,t,e,R+2,n),w(this,xt,Ap).call(this,t,R,i,n)):n.push(r,a)},DS=function(t){const e=[],i=t.length;return w(this,xt,Ap).call(this,t,0,i,e),e.push(t[i-2],t[i-1]),e.length<=4?null:e},OS=function(t,e,i,n,r,a){const l=new Float32Array(a**2),c=-2*n**2,h=a>>1;for(let y=0;y<a;y++){const v=(y-h)**2;for(let S=0;S<a;S++)l[y*a+S]=Math.exp((v+(S-h)**2)/c)}const u=new Float32Array(256),d=-2*r**2;for(let y=0;y<256;y++)u[y]=Math.exp(y**2/d);const f=t.length,m=new Uint8Array(f),b=new Uint32Array(256);for(let y=0;y<i;y++)for(let v=0;v<e;v++){const S=y*e+v,x=t[S];let E=0,C=0;for(let R=0;R<a;R++){const D=y+R-h;if(!(D<0||D>=i))for(let L=0;L<a;L++){const I=v+L-h;if(I<0||I>=e)continue;const N=t[D*e+I],F=l[R*a+L]*u[Math.abs(N-x)];E+=N*F,C+=F}}const T=m[S]=Math.round(E/C);b[T]++}return[m,b]},LS=function(t){const e=new Uint32Array(256);for(const i of t)e[i]++;return e},_b=function(t){const e=t.length,i=new Uint8ClampedArray(e>>2);let n=-1/0,r=1/0;for(let l=0,c=i.length;l<c;l++){const h=i[l]=t[l<<2];n=Math.max(n,h),r=Math.min(r,h)}const a=255/(n-r);for(let l=0,c=i.length;l<c;l++)i[l]=(i[l]-r)*a;return i},Eb=function(t){let e,i=-1/0,n=-1/0;const r=t.findIndex(c=>c!==0);let a=r,l=r;for(e=r;e<256;e++){const c=t[e];c>i&&(e-a>n&&(n=e-a,l=e-1),i=c,a=e)}for(e=l-1;e>=0&&!(t[e]>t[e+1]);e--);return e},kS=function(t){const e=t,{width:i,height:n}=t,{maxDim:r}=s(this,No);let a=i,l=n;if(i>r||n>r){let f=i,m=n,b=Math.log2(Math.max(i,n)/r);const y=Math.floor(b);b=b===y?y-1:y;for(let S=0;S<b;S++){a=Math.ceil(f/2),l=Math.ceil(m/2);const x=new OffscreenCanvas(a,l);x.getContext("2d").drawImage(t,0,0,f,m,0,0,a,l),f=a,m=l,t!==e&&t.close(),t=x.transferToImageBitmap()}const v=Math.min(r/a,r/l);a=Math.round(a*v),l=Math.round(l*v)}const h=new OffscreenCanvas(a,l).getContext("2d",{willReadFrequently:!0});h.fillStyle="white",h.fillRect(0,0,a,l),h.filter="grayscale(1)",h.drawImage(t,0,0,t.width,t.height,0,0,a,l);const u=h.getImageData(0,0,a,l).data;return[w(this,xt,_b).call(this,u),a,l]},A(sr,xt),A(sr,No,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),A(sr,_n,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));
24class n0 extends _S{constructor(){super(),super.updateProperties({fill:Bt._defaultLineColor,"stroke-width":0})}clone(){const t=new n0;return t.updateAll(this),t}}class s0 extends Cg{constructor(t){super(t),super.updateProperties({stroke:Bt._defaultLineColor,"stroke-width":1})}clone(){const t=new s0(this._viewParameters);return t.updateAll(this),t}}var Qr,as,Zr,Bo;const Si=class Si extends Gp{constructor(e){super({...e,mustBeCommitted:!0,name:"signatureEditor"});A(this,Qr,!1);A(this,as,null);A(this,Zr,null);A(this,Bo,null);this._willKeepAspectRatio=!0,p(this,Zr,e.signatureData||null),p(this,as,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(e,i){Bt.initialize(e,i),this._defaultDrawingOptions=new n0,this._defaultDrawnSignatureOptions=new s0(i.viewParameters)}static getDefaultDrawingOptions(e){const i=this._defaultDrawingOptions.clone();return i.updateProperties(e),i}static get supportMultipleDrawings(){return!1}static get typesMap(){return ht(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!s(this,as)}}static computeTelemetryFinalData(e){const i=e.get("hasDescription");return{hasAltText:i.get(!0)??0,hasNoAltText:i.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let e,i;const{_isCopy:n}=this;if(n&&(this._isCopy=!1,e=this.x,i=this.y),super.render(),this._drawId===null)if(s(this,Zr)){const{lines:r,mustSmooth:a,areContours:l,description:c,uuid:h,heightInPage:u}=s(this,Zr),{rawDims:{pageWidth:d,pageHeight:f},rotation:m}=this.parent.viewport,b=sr.processDrawnLines({lines:r,pageWidth:d,pageHeight:f,rotation:m,innerMargin:Si._INNER_MARGIN,mustSmooth:a,areContours:l});this.addSignature(b,u,c,h)}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:s(this,as)||""}));return n&&(this._isCopy=!0,this._moveAfterPaste(e,i)),this.div}setUuid(e){p(this,Bo,e),this.addEditToolbar()}getUuid(){return s(this,Bo)}get description(){return s(this,as)}set description(e){p(this,as,e),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:e})),super.addEditToolbar().then(i=>{i==null||i.updateEditSignatureButton(e)}))}getSignaturePreview(){const{newCurves:e,areContours:i,thickness:n,width:r,height:a}=s(this,Zr),l=Math.max(r,a),c=sr.processDrawnLines({lines:{curves:e.map(h=>({points:h})),thickness:n,width:r,height:a},pageWidth:l,pageHeight:l,rotation:0,innerMargin:0,mustSmooth:!1,areContours:i});return{areContours:i,outline:c.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(e,i,n,r){const{x:a,y:l}=this,{outline:c}=p(this,Zr,e);p(this,Qr,c instanceof wb),this.description=n;let h;s(this,Qr)?h=Si.getDefaultDrawingOptions():(h=Si._defaultDrawnSignatureOptions.clone(),h.updateProperties({"stroke-width":c.thickness})),this._addOutlines({drawOutlines:c,drawingOptions:h});const[,u]=this.pageDimensions;let d=i/u;d=d>=1?.5:d,this.width*=d/this.height,this.width>=1&&(d*=.9/this.width,this.width=.9),this.height=d,this.setDims(),this.x=a,this.y=l,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(r),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!r,hasDescription:!!n}}),this.div.hidden=!1}getFromImage(e){const{rawDims:{pageWidth:i,pageHeight:n},rotation:r}=this.parent.viewport;return sr.process(e,i,n,r,Si._INNER_MARGIN)}getFromText(e,i){const{rawDims:{pageWidth:n,pageHeight:r},rotation:a}=this.parent.viewport;return sr.extractContoursFromText(e,i,n,r,a,Si._INNER_MARGIN)}getDrawnSignature(e){const{rawDims:{pageWidth:i,pageHeight:n},rotation:r}=this.parent.viewport;return sr.processDrawnLines({lines:e,pageWidth:i,pageHeight:n,rotation:r,innerMargin:Si._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:e,thickness:i}){e?this._drawingOptions=Si.getDefaultDrawingOptions():(this._drawingOptions=Si._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":i}))}serialize(e=!1){if(this.isEmpty())return null;const{lines:i,points:n}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":r}}=this,a=Object.assign(super.serialize(e),{isSignature:!0,areContours:s(this,Qr),color:[0,0,0],thickness:s(this,Qr)?0:r});return this.addComment(a),e?(a.paths={lines:i,points:n},a.uuid=s(this,Bo),a.isCopy=!0):a.lines=i,s(this,as)&&(a.accessibilityData={type:"Figure",alt:s(this,as)}),a}static deserializeDraw(e,i,n,r,a,l){return l.areContours?wb.deserialize(e,i,n,r,a,l):rf.deserialize(e,i,n,r,a,l)}static async deserialize(e,i,n){var a;const r=await super.deserialize(e,i,n);return p(r,Qr,e.areContours),r.description=((a=e.accessibilityData)==null?void 0:a.alt)||"",p(r,Bo,e.uuid),r}};
24Qr=new WeakMap,as=new WeakMap,Zr=new WeakMap,Bo=new WeakMap,k(Si,"_type","signature"),k(Si,"_editorType",rt.SIGNATURE),k(Si,"_defaultDrawingOptions",null);let xb=Si;var zt,_e,ta,Qs,ea,Xc,Zs,Uo,os,Ui,Yc,vt,Yh,Kh,wp,vp,Sp,Tb,_p,IS;class Cb extends Bt{constructor(e){super({...e,name:"stampEditor"});A(this,vt);A(this,zt,null);A(this,_e,null);A(this,ta,null);A(this,Qs,null);A(this,ea,null);A(this,Xc,"");A(this,Zs,null);A(this,Uo,!1);A(this,os,null);A(this,Ui,!1);A(this,Yc,!1);p(this,Qs,e.bitmapUrl),p(this,ea,e.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(e,i){Bt.initialize(e,i)}static isHandlingMimeForPasting(e){return cy.includes(e)}static paste(e,i){i.pasteEditor({mode:rt.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var e;return{type:"stamp",hasAltText:!!((e=this.altTextData)!=null&&e.altText)}}static computeTelemetryFinalData(e){const i=e.get("hasAltText");return{hasAltText:i.get(!0)??0,hasNoAltText:i.get(!1)??0}}async mlGuessAltText(e=null,i=!0){if(this.hasAltTextData())return null;const{mlManager:n}=this._uiManager;if(!n)throw new Error("No ML.");if(!await n.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:r,width:a,height:l}=e||this.copyCanvas(null,null,!0).imageData,c=await n.guess({name:"altText",request:{data:r,width:a,height:l,channels:r.length/(a*l)}});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.");const h=c.output;return await this.setGuessedAltText(h),i&&!this.hasAltTextData()&&(this.altTextData={alt:h,decorative:!1}),h}remove(){var e;s(this,_e)&&(p(this,zt,null),this._uiManager.imageManager.deleteId(s(this,_e)),(e=s(this,Zs))==null||e.remove(),p(this,Zs,null),s(this,os)&&(clearTimeout(s(this,os)),p(this,os,null))),super.remove()}rebuild(){if(!this.parent){s(this,_e)&&w(this,vt,wp).call(this);return}super.rebuild(),this.div!==null&&(s(this,_e)&&s(this,Zs)===null&&w(this,vt,wp).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(s(this,ta)||s(this,zt)||s(this,Qs)||s(this,ea)||s(this,_e)||s(this,Uo))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,i;return this._isCopy&&(e=this.x,i=this.y),super.render(),this.div.hidden=!0,this.createAltText(),s(this,Uo)||(s(this,zt)?w(this,vt,vp).call(this):w(this,vt,wp).call(this)),this._isCopy&&this._moveAfterPaste(e,i),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,i){const{id:n,bitmap:r}=this._uiManager.imageManager.getFromCanvas(e,i);i.remove(),n&&this._uiManager.imageManager.isValidId(n)&&(p(this,_e,n),r&&p(this,zt,r),p(this,Uo,!1),w(this,vt,vp).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;s(this,os)!==null&&clearTimeout(s(this,os)),p(this,os,setTimeout(()=>{p(this,os,null),w(this,vt,Tb).call(this)},200))}copyCanvas(e,i,n=!1){e||(e=224);const{width:r,height:a}=s(this,zt),l=new hs;let c=s(this,zt),h=r,u=a,d=null;if(i){if(r>i||a>i){const D=Math.min(i/r,i/a);h=Math.floor(r*D),u=Math.floor(a*D)}d=document.createElement("canvas");const m=d.width=Math.ceil(h*l.sx),b=d.height=Math.ceil(u*l.sy);s(this,Ui)||(c=w(this,vt,Sp).call(this,m,b));const y=d.getContext("2d");y.filter=this._uiManager.hcmFilter;let v="white",S="#cfcfd8";this._uiManager.hcmFilter!=="none"?S="black":A1.isDarkMode&&(v="#8f8f9d",S="#42414d");const x=15,E=x*l.sx,C=x*l.sy,T=new OffscreenCanvas(E*2,C*2),R=T.getContext("2d");R.fillStyle=v,R.fillRect(0,0,E*2,C*2),R.fillStyle=S,R.fillRect(0,0,E,C),R.fillRect(E,C,E,C),y.fillStyle=y.createPattern(T,"repeat"),y.fillRect(0,0,m,b),y.drawImage(c,0,0,c.width,c.height,0,0,m,b)}let f=null;if(n){let m,b;if(l.symmetric&&c.width<e&&c.height<e)m=c.width,b=c.height;else if(c=s(this,zt),r>e||a>e){const S=Math.min(e/r,e/a);m=Math.floor(r*S),b=Math.floor(a*S),s(this,Ui)||(c=w(this,vt,Sp).call(this,m,b))}const v=new OffscreenCanvas(m,b).getContext("2d",{willReadFrequently:!0});v.drawImage(c,0,0,c.width,c.height,0,0,m,b),f={width:m,height:b,data:v.getImageData(0,0,m,b).data}}return{canvas:d,width:h,height:u,imageData:f}}static async deserialize(e,i,n){var v;let r=null,a=!1;if(e instanceof Jv){const{data:{rect:S,rotation:x,id:E,structParent:C,popupRef:T,richText:R,contentsObj:D,creationDate:L,modificationDate:
24I},container:N,parent:{page:{pageNumber:F}},canvas:U}=e;let Y,$;U?(delete e.canvas,{id:Y,bitmap:$}=n.imageManager.getFromCanvas(N.id,U),U.remove()):(a=!0,e._hasNoCanvas=!0);const Z=((v=await i._structTree.getAriaAttributes(`${Yb}${E}`))==null?void 0:v.get("aria-label"))||"";r=e={annotationType:rt.STAMP,bitmapId:Y,bitmap:$,pageIndex:F-1,rect:S.slice(0),rotation:x,annotationElementId:E,id:E,deleted:!1,accessibilityData:{decorative:!1,altText:Z},isSvg:!1,structParent:C,popupRef:T,richText:R,comment:(D==null?void 0:D.str)||null,creationDate:L,modificationDate:I}}const l=await super.deserialize(e,i,n),{rect:c,bitmap:h,bitmapUrl:u,bitmapId:d,isSvg:f,accessibilityData:m}=e;a?(n.addMissingCanvas(e.id,l),p(l,Uo,!0)):d&&n.imageManager.isValidId(d)?(p(l,_e,d),h&&p(l,zt,h)):p(l,Qs,u),p(l,Ui,f);const[b,y]=l.pageDimensions;return l.width=(c[2]-c[0])/b,l.height=(c[3]-c[1])/y,m&&(l.altTextData=m),l._initialData=r,e.comment&&l.setCommentData(e),p(l,Yc,!!r),l}serialize(e=!1,i=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const n=Object.assign(super.serialize(e),{bitmapId:s(this,_e),isSvg:s(this,Ui)});if(this.addComment(n),e)return n.bitmapUrl=w(this,vt,_p).call(this,!0),n.accessibilityData=this.serializeAltText(!0),n.isCopy=!0,n;const{decorative:r,altText:a}=this.serializeAltText(!1);if(!r&&a&&(n.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){const c=w(this,vt,IS).call(this,n);return c.isSame?null:(c.isSameAltText?delete n.accessibilityData:n.accessibilityData.structParent=this._initialData.structParent??-1,n.id=this.annotationElementId,delete n.bitmapId,n)}if(i===null)return n;i.stamps||(i.stamps=new Map);const l=s(this,Ui)?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(!i.stamps.has(s(this,_e)))i.stamps.set(s(this,_e),{area:l,serialized:n}),n.bitmap=w(this,vt,_p).call(this,!1);else if(s(this,Ui)){const c=i.stamps.get(s(this,_e));l>c.area&&(c.area=l,c.serialized.bitmap.close(),c.serialized.bitmap=w(this,vt,_p).call(this,!1))}return n}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}zt=new WeakMap,_e=new WeakMap,ta=new WeakMap,Qs=new WeakMap,ea=new WeakMap,Xc=new WeakMap,Zs=new WeakMap,Uo=new WeakMap,os=new WeakMap,Ui=new WeakMap,Yc=new WeakMap,vt=new WeakSet,Yh=function(e,i=!1){if(!e){this.remove();return}p(this,zt,e.bitmap),i||(p(this,_e,e.id),p(this,Ui,e.isSvg)),e.file&&p(this,Xc,e.file.name),w(this,vt,vp).call(this)},Kh=function(){if(p(this,ta,null),this._uiManager.enableWaiting(!1),!!s(this,Zs)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&s(this,zt)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&s(this,zt)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},wp=function(){if(s(this,_e)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(s(this,_e)).then(n=>w(this,vt,Yh).call(this,n,!0)).finally(()=>w(this,vt,Kh).call(this));return}if(s(this,Qs)){const n=s(this,Qs);p(this,Qs,null),this._uiManager.enableWaiting(!0),p(this,ta,this._uiManager.imageManager.getFromUrl(n).then(r=>w(this,vt,Yh).call(this,r)).finally(()=>w(this,vt,Kh).call(this)));return}if(s(this,ea)){const n=s(this,ea);p(this,ea,null),this._uiManager.enableWaiting(!0),p(this,ta,this._uiManager.imageManager.getFromFile(n).then(r=>w(this,vt,Yh).call(this,r)).finally(()=>w(this,vt,Kh).call(this)));return}const e=document.createElement("input");e.type="file",e.accept=cy.join(",");const i=this._uiManager._signal;p(this,ta,new Promise(n=>{e.addEventListener("change",async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const r=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),w(this,vt,Yh).call(this,r)}n()},{signal:i}),e.addEventListener("cancel",()=>{this.remove(),n()},{signal:i})}).finally(()=>w(this,vt,Kh).call(this))),e.click()},vp=function(){var h;const{div:e}=this;let{width:i,height:n}=s(this,zt);const[r,a]=this.pageDimensions,l=.75;if(this.width)i=this.width*r,n=this.height*a;else if(i>l*r||n>l*a){const u=Math.min(l*r/i,l*a/n);i*=u,n*=u}this._uiManager.enableWaiting(!1);const c=p(this,Zs,document.createElement("canvas"));c.setAttribute("role","img"),this.addContainer(c),this.width=i/r,this.height=n/a,this.setDims(),(h=this._initialOptions)!=null&&h.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),w(this,vt,Tb).call(this),s(this,Yc)||(this.parent.addUndoableEditor(this),p(this,Yc,!0)),this._reportTelemetry({action:"inserted_image"}),s(this,Xc)&&this.div.setAttribute("aria-description",s(this,Xc)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},Sp=function(e,i){const{width:n,height:r}=s(this,zt);let a=n,l=r,c=s(this,zt);for(;a>2*e||l>2*i;){const h=a,u=l;a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),l>2*i&&(l=l>=16384?Math.floor(l/2)-1:Math.ceil(l/2));const d=new OffscreenCanvas(a,l);d.getContext("2d").drawImage(c,0,0,h,u,0,0,a,l),c=d.transferToImageBitmap()}return c},Tb=function(){const[e,i]=this.parentDimensions,{width:n,height:r}=this,a=new hs,l=Math.ceil(n*e*a.sx),c=Math.ceil(r*i*a.sy),h=s(this,Zs);if(!h||h.width===l&&h.height===c)return;h.width=l,h.height=c;const u=s(this,Ui)?s(this,zt):w(this,vt,Sp).call(this,l,c),d=h.getContext("2d");d.filter=this._uiManager.hcmFilter,d.drawImage(u,0,0,u.width,u.height,0,0,l,c)},_p=function(e){if(e){if(s(this,Ui)){const r=this._uiManager.imageManager.getSvgUrl(s(this,_e));if(r)return r}const i=document.createElement("canvas");return{width:i.width,height:i.height}=s(this,zt),i.getContext("2d").drawImage(s(this,zt),0,0),i.toDataURL()}if(s(this,Ui)){const[i,n]=this.pageDimensions,r=Math.round(this.width*i*ca.PDF_TO_CSS_UNITS),a=Math.round(this.height*n*ca.PDF_TO_CSS_UNITS),l=new OffscreenCanvas(r,a);return l.getContext("2d").drawImage(s(this,zt),0,0,s(this,zt).width,s(this,zt).height,0,0,r,a),l.transferToImageBitmap()}return structuredClone(s(this,zt))},IS=function(e){var l;const{pageIndex:i,accessibilityData:{altText:n}}=this._initialData,r=e.pageIndex===i,a=(((l=e.accessibilityData)==null?void 0:l.alt)||"")===n;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&r&&a,isSameAltText:a}},k(Cb,"_type","stamp"),k(Cb,"_editorType",rt.STAMP);var $o,Kc,ia,na,tr,bi,sa,Jc,Qc,En,er,Ee,ir,ra,Zc,K,aa,It,Rb,FS,Nn,Mb,Db,Ep;const fn=class fn{constructor({uiManager:t,pageIndex:e,div:i,structTreeLayer:n,accessibilityManager:r,annotationLayer:a,drawLayer:l,textLayer:c,viewport:h,l10n:u}){A(this,It);A(this,$o);A(this,Kc,!1);A(this,ia,null);A(this,na,null);A(this,tr,null);A(this,bi,new Map);A(this,sa,!1);A(this,Jc,!1);A(this,Qc,!1);A(this,En,null);A(this,er,null);A(this,Ee,null);A(this,ir,null);A(this,ra,null);A(this,Zc,-1);A(this,K);const d=[...s(fn,aa).values()];if(!fn._initialized){fn._initialized=!0;for(const f of d)f.initialize(u,t)}
24t.registerEditorTypes(d),p(this,K,t),this.pageIndex=e,this.div=i,p(this,$o,r),p(this,ia,a),this.viewport=h,p(this,Ee,c),this.drawLayer=l,this._structTree=n,s(this,K).addLayer(this)}get isEmpty(){return s(this,bi).size===0}get isInvisible(){return this.isEmpty&&s(this,K).getMode()===rt.NONE}updateToolbar(t){s(this,K).updateToolbar(t)}updateMode(t=s(this,K).getMode()){switch(w(this,It,Ep).call(this),t){case rt.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case rt.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case rt.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;if(e.toggle("nonEditing",!1),t===rt.POPUP)e.toggle("commentEditing",!0);else{e.toggle("commentEditing",!1);for(const i of s(fn,aa).values())e.toggle(`${i._type}Editing`,t===i._editorType)}this.div.hidden=!1}hasTextLayer(t){var e;return t===((e=s(this,Ee))==null?void 0:e.div)}setEditingState(t){s(this,K).setEditingState(t)}addCommands(t){s(this,K).addCommands(t)}cleanUndoStack(t){s(this,K).cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){var e;(e=s(this,ia))==null||e.div.classList.toggle("disabled",!t)}async enable(){var i;p(this,Qc,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),(i=s(this,ra))==null||i.abort(),p(this,ra,null);const t=new Set;for(const n of s(this,It,Rb))n.enableEditing(),n.show(!0),n.annotationElementId&&(s(this,K).removeChangedExistingAnnotation(n),t.add(n.annotationElementId));const e=s(this,ia);if(e)for(const n of e.getEditableAnnotations()){if(n.hide(),s(this,K).isDeletedAnnotationElement(n.data.id)||t.has(n.data.id))continue;const r=await this.deserialize(n);r&&(this.addOrRebuild(r),r.enableEditing())}p(this,Qc,!1),s(this,K)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){var i;if(p(this,Jc,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),s(this,Ee)&&!s(this,ra)){p(this,ra,new AbortController);const n=s(this,K).combinedSignal(s(this,ra));s(this,Ee).div.addEventListener("pointerdown",r=>{const{clientX:l,clientY:c,timeStamp:h}=r,u=s(this,Zc);if(h-u>500){p(this,Zc,h);return}p(this,Zc,-1);const{classList:d}=this.div;d.toggle("getElements",!0);const f=document.elementsFromPoint(l,c);if(d.toggle("getElements",!1),!this.div.contains(f[0]))return;let m;const b=new RegExp(`^${su}[0-9]+$`);for(const v of f)if(b.test(v.id)){m=v.id;break}if(!m)return;const y=s(this,bi).get(m);(y==null?void 0:y.annotationElementId)===null&&(r.stopPropagation(),r.preventDefault(),y.dblclick(r))},{signal:n,capture:!0})}const t=s(this,ia);if(t){const n=new Map,r=new Map;for(const l of s(this,It,Rb)){if(l.disableEditing(),!l.annotationElementId){l.updateFakeAnnotationElement(t);continue}if(l.serialize()!==null){n.set(l.annotationElementId,l);continue}else r.set(l.annotationElementId,l);(i=this.getEditableAnnotation(l.annotationElementId))==null||i.show(),l.remove()}const a=t.getEditableAnnotations();for(const l of a){const{id:c}=l.data;if(s(this,K).isDeletedAnnotationElement(c)){l.updateEdited({deleted:!0});continue}let h=r.get(c);if(h){h.resetAnnotationElement(l),h.show(!1),l.show();continue}h=n.get(c),h&&(s(this,K).addChangedExistingAnnotation(h),h.renderAnnotationElement(l)&&h.show(!1)),l.show()}}w(this,It,Ep).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:e}=this.div;for(const n of s(fn,aa).values())e.remove(`${n._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),p(this,Jc,!1)}getEditableAnnotation(t){var e;return((e=s(this,ia))==null?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){s(this,K).getActive()!==t&&s(this,K).setActiveEditor(t)}enableTextSelection(){var t;if(this.div.tabIndex=-1,(t=s(this,Ee))!=null&&t.div&&!s(this,ir)){p(this,ir,new AbortController);const e=s(this,K).combinedSignal(s(this,ir));s(this,Ee).div.addEventListener("pointerdown",w(this,It,FS).bind(this),{signal:e}),s(this,Ee).div.classList.add("highlighting")}}disableTextSelection(){var t;this.div.tabIndex=0,(t=s(this,Ee))!=null&&t.div&&s(this,ir)&&(s(this,ir).abort(),p(this,ir,null),s(this,Ee).div.classList.remove("highlighting"))}enableClick(){if(s(this,na))return;p(this,na,new AbortController);const t=s(this,K).combinedSignal(s(this,na));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){var t;(t=s(this,na))==null||t.abort(),p(this,na,null)}attach(t){s(this,bi).set(t.id,t);const{annotationElementId:e}=t;e&&s(this,K).isDeletedAnnotationElement(e)&&s(this,K).removeDeletedAnnotationElement(t)}detach(t){var e;s(this,bi).delete(t.id),(e=s(this,$o))==null||e.removePointerInTextLayer(t.contentDiv),!s(this,Jc)&&t.annotationElementId&&s(this,K).addDeletedAnnotationElement(t)}remove(t){this.detach(t),s(this,K).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(s(this,K).addDeletedAnnotationElement(t.annotationElementId),Bt.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),(e=t.parent)==null||e.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}
24add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),s(this,K).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!s(this,Qc)),s(this,K).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var i;if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&!s(this,tr)&&(t._focusEventsAllowed=!1,p(this,tr,setTimeout(()=>{p(this,tr,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:s(this,K)._signal}),e.focus())},0))),t._structTreeParentId=(i=s(this,$o))==null?void 0:i.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){const e=()=>t._uiManager.rebuild(t),i=()=>{t.remove()};this.addCommands({cmd:e,undo:i,mustExec:!1})}getEditorByUID(t){for(const e of s(this,bi).values())if(e.uid===t)return e;return null}getNextId(){return s(this,K).getId()}combinedSignal(t){return s(this,K).combinedSignal(t)}canCreateNewEmptyEditor(){var t;return(t=s(this,It,Nn))==null?void 0:t.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await s(this,K).updateMode(t.mode);const{offsetX:i,offsetY:n}=w(this,It,Db).call(this),r=this.getNextId(),a=w(this,It,Mb).call(this,{parent:this,id:r,x:i,y:n,uiManager:s(this,K),isCentered:!0,...e});a&&this.add(a)}async deserialize(t){var e;return await((e=s(fn,aa).get(t.annotationType??t.annotationEditorType))==null?void 0:e.deserialize(t,this,s(this,K)))||null}createAndAddNewEditor(t,e,i={}){const n=this.getNextId(),r=w(this,It,Mb).call(this,{parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:s(this,K),isCentered:e,...i});return r&&this.add(r),r}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(t={}){this.createAndAddNewEditor(w(this,It,Db).call(this),!0,t)}setSelected(t){s(this,K).setSelected(t)}toggleSelected(t){s(this,K).toggleSelected(t)}unselect(t){s(this,K).unselect(t)}pointerup(t){var n;const{isMac:e}=Ne.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div||!s(this,sa)||(p(this,sa,!1),(n=s(this,It,Nn))!=null&&n.isDrawer&&s(this,It,Nn).supportMultipleDrawings))return;if(!s(this,Kc)){p(this,Kc,!0);return}const i=s(this,K).getMode();if(i===rt.STAMP||i===rt.SIGNATURE){s(this,K).unselectAll();return}this.createAndAddNewEditor(t,!1)}pointerdown(t){var n;if(s(this,K).getMode()===rt.HIGHLIGHT&&this.enableTextSelection(),s(this,sa)){p(this,sa,!1);return}const{isMac:e}=Ne.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div)return;if(p(this,sa,!0),(n=s(this,It,Nn))!=null&&n.isDrawer){this.startDrawingSession(t);return}const i=s(this,K).getActive();p(this,Kc,!i||i.isEmpty())}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),s(this,En)){s(this,It,Nn).startDrawing(this,s(this,K),!1,t);return}s(this,K).setCurrentDrawingSession(this),p(this,En,new AbortController);const e=s(this,K).combinedSignal(s(this,En));this.div.addEventListener("blur",({relatedTarget:i})=>{i&&!this.div.contains(i)&&(p(this,er,null),this.commitOrRemove())},{signal:e}),s(this,It,Nn).startDrawing(this,s(this,K),!1,t)}pause(t){if(t){const{activeElement:e}=document;this.div.contains(e)&&p(this,er,e);return}s(this,er)&&setTimeout(()=>{var e;(e=s(this,er))==null||e.focus(),p(this,er,null)},0)}endDrawingSession(t=!1){return s(this,En)?(s(this,K).setCurrentDrawingSession(null),s(this,En).abort(),p(this,En,null),p(this,er,null),s(this,It,Nn).endDrawing(t)):null}findNewParent(t,e,i){const n=s(this,K).findParent(e,i);return n===null||n===this?!1:(n.changeParent(t),!0)}commitOrRemove(){return s(this,En)?(this.endDrawingSession(),!0):!1}onScaleChanging(){s(this,En)&&s(this,It,Nn).onScaleChangingWhenDrawing(this)}destroy(){var t,e;this.commitOrRemove(),((t=s(this,K).getActive())==null?void 0:t.parent)===this&&(s(this,K).commitOrRemove(),s(this,K).setActiveEditor(null)),s(this,tr)&&(clearTimeout(s(this,tr)),p(this,tr,null));for(const i of s(this,bi).values())(e=s(this,$o))==null||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove();this.div=null,s(this,bi).clear(),s(this,K).removeLayer(this)}render({viewport:t}){this.viewport=t,Wo(this.div,t);for(const e of s(this,K).getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:t}){s(this,K).commitOrRemove(),w(this,It,Ep).call(this);const e=this.viewport.rotation,i=t.rotation;if(this.viewport=t,Wo(this.div,{rotation:i}),e!==i)for(const n of s(this,bi).values())n.rotate(i)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return s(this,K).viewParameters.realScale}};$o=new WeakMap,Kc=new WeakMap,ia=new WeakMap,na=new WeakMap,tr=new WeakMap,bi=new WeakMap,sa=new WeakMap,Jc=new WeakMap,Qc=new WeakMap,En=new WeakMap,er=new WeakMap,Ee=new WeakMap,ir=new WeakMap,ra=new WeakMap,Zc=new WeakMap,K=new WeakMap,aa=new WeakMap,It=new WeakSet,Rb=function(){return s(this,bi).size!==0?s(this,bi).values():s(this,K).getEditors(this.pageIndex)},FS=function(t){s(this,K).unselectAll();const{target:e}=t;if(e===s(this,Ee).div||(e.getAttribute("role")==="img"||e.classList.contains("endOfContent"))&&s(this,Ee).div.contains(e)){const{isMac:i}=Ne.platform;if(t.button!==0||t.ctrlKey&&i)return;s(this,K).showAllEditors("highlight",!0,!0),s(this,Ee).div.classList.add("free"),this.toggleDrawing(),zp.startHighlighting(this,s(this,K).direction==="ltr",{target:s(this,Ee).div,x:t.x,y:t.y}),s(this,Ee).div.addEventListener("pointerup",()=>{s(this,Ee).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:s(this,K)._signal}),t.preventDefault()}},Nn=function(){return s(fn,aa).get(s(this,K).getMode())},Mb=function(t){const e=s(this,It,Nn);return e?new e.prototype.constructor(t):null},Db=function(){const{x:t,y:e,width:i,height:n}=this.boundingClientRect,r=Math.max(0,t),a=Math.max(0,e),l=Math.min(window.innerWidth,t+i),c=Math.min(window.innerHeight,e+n),h=(r+l)/2-t,u=(a+c)/2-e,[d,f]=this.viewport.rotation%180===0?[h,u]:[u,h];return{offsetX:d,offsetY:f}},Ep=function(){for(const t of s(this,bi).values())t.isEmpty()&&t.remove()},k(fn,"_initialized",!1),A(fn,aa,new Map([cb,Ab,Cb,zp,xb].map(t=>[t._editorType,t])));let Pb=fn;var xn,ii,Ho,jd,cg,NS,us,Lb,BS,kb;const ue=class ue{constructor({pageIndex:t}){A(this,us);A(this,xn,null);A(this,ii,new Map);A(this,Ho,new Map);this.pageIndex=t}setParent(t){if(!s(this,xn)){p(this,xn,t);return}if(s(this,xn)!==t){if(s(this,ii).size>0)for(const e of s(this,ii).values())e.remove(),t.append(e);p(this,xn,t)}}static get _svgFactory(){return ht(this,"_svgFactory",new Hp)}draw(t,e=!1,i=!1){const n=ce(ue,jd)._++,r=w(this,us,Lb).call(this),a=ue._svgFactory.createElement("defs");r.append(a);const l=ue._svgFactory.createElement("path");a.append(l);const c=`path_p${this.pageIndex}_${n}`;l.setAttribute("id",c),l.setAttribute("vector-effect","non-scaling-stroke"),e&&s(this,Ho).set(n,l);const h=i?w(this,us,BS).call(this,a,c):null,u=ue._svgFactory.createElement("use");return r.append(u),u.setAttribute("href",`#${c}`),this.updateProperties(r,t),s(this,ii).set(n,r),{id:n,clipPathId:`url(#${h})`}}drawOutline(t,e){const i=ce(ue,jd)._++,n=w(this,us,Lb).call(this),r=ue._svgFactory.createElement("defs");n.append(r);const a=ue._svgFactory.createElement("path");r.append(a);const l=`path_p${this.pageIndex}_${i}`;a.setAttribute("id",l),a.setAttribute("vector-effect","non-scaling-stroke");let c;if(e){const d=ue._svgFactory.createElement("mask");r.append(d),c=`mask_p${this.pageIndex}_${i}`,d.setAttribute("id",c),d.setAttribute("maskUnits","objectBoundingBox");const f=ue._svgFactory.createElement("rect");d.append(f),f.setAttribute("width","1"),f.setAttribute("height","1"),f.setAttribute("fill","white");const m=ue._svgFactory.createElement("use");d.append(m),m.setAttribute("href",`#${l}`),m.setAttribute("stroke","none"),m.setAttribute("fill","black"),m.setAttribute("fill-rule","nonzero"),m.classList.add("mask")}const h=ue._svgFactory.createElement("use");n.append(h),h.setAttribute("href",`#${l}`),c&&h.setAttribute("mask",`url(#${c})`);const u=h.cloneNode();return n.append(u),h.classList.add("mainOutline"),u.classList.add("secondaryOutline"),this.updateProperties(n,t),s(this,ii).set(i,n),i}finalizeDraw(t,e){s(this,Ho).delete(t),this.updateProperties(t,e)}updateProperties(t,e){var c;if(!e)return;const{root:i,bbox:n,rootClass:r,path:a}=e,l=typeof t=="number"?s(this,ii).get(t):t;if(l){if(i&&w(this,us,kb).call(this,l,i),n&&w(c=ue,cg,NS).call(c,l,n),r){const{classList:h}=l;for(const[u,d]of Object.entries(r))h.toggle(u,d)}if(a){const u=l.firstChild.firstChild;w(this,us,kb).call(this,u,a)}}}updateParent(t,e){if(e===this)return;const i=s(this,ii).get(t);i&&(s(e,xn).append(i),s(this,ii).delete(t),s(e,ii).set(t,i))}remove(t){s(this,Ho).delete(t),s(this,xn)!==null&&(s(this,ii).get(t).remove(),s(this,ii).delete(t))}destroy(){p(this,xn,null);for(const t of s(this,ii).values())t.remove();s(this,ii).clear(),s(this,Ho).clear()}};xn=new WeakMap,ii=new WeakMap,Ho=new WeakMap,jd=new WeakMap,cg=new WeakSet,NS=function(t,[e,i,n,r]){const{style:a}=t;a.top=`${100*i}%`,a.left=`${100*e}%`,a.width=`${100*n}%`,a.height=`${100*r}%`},us=new WeakSet,Lb=function(){const t=ue._svgFactory.create(1,1,!0);return s(this,xn).append(t),t.setAttribute("aria-hidden",!0),t},BS=function(t,e){const i=ue._svgFactory.createElement("clipPath");t.append(i);const n=`clip_${e}`;i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const r=ue._svgFactory.createElement("use");return i.append(r),r.setAttribute("href",`#${e}`),r.classList.add("clip"),n},kb=function(t,e){for(const[i,n]of Object.entries(e))n===null?t.removeAttribute(i):t.setAttribute(i,n)},A(ue,cg),A(ue,jd,0);let Ob=ue;globalThis._pdfjsTestingUtils={HighlightOutliner:ub};globalThis.pdfjsLib={AbortException:la,AnnotationEditorLayer:Pb,AnnotationEditorParamsType:mt,AnnotationEditorType:rt,AnnotationEditorUIManager:Vo,AnnotationLayer:ab,AnnotationMode:dr,AnnotationType:se,applyOpacity:v1,build:RP,ColorPicker:Up,createValidAbsoluteUrl:Ow,CSSConstants:w1,DOMSVGFactory:Hp,DrawLayer:Ob,FeatureTest:Ne,fetchData:Zd,findContrastColor:S1,getDocument:_P,getFilenameFromUrl:p1,getPdfFilenameFromUrl:g1,getRGB:ef,getUuid:Iw,getXfaPageViewport:y1,GlobalWorkerOptions:nr,ImageKind:Vf,InvalidPDFException:oy,isDataScheme:Eg,isPdfFile:Jb,isValidExplicitDest:O1,MathClamp:si,noContextMenu:cn,normalizeUnicode:u1,OPS:ru,OutputScale:hs,PasswordResponses:i1,PDFDataRangeTransport:Nv,PDFD
24ateString:Lp,PDFWorker:lu,PermissionFlag:e1,PixelsPerInch:ca,RenderingCancelledException:Kb,renderRichText:Bw,ResponseException:Op,setLayerDimensions:Wo,shadow:ht,SignatureExtractor:sr,stopEvent:Qt,SupportedImageMimeTypes:cy,TextLayer:ou,TouchManager:Ip,updateUrlHash:Lw,Util:W,VerbosityLevel:vg,version:PP,XfaLayer:Nw};export{ab as A,nr as G,ER as R,ou as T,Nw as X,dr as a,_R as b,oe as c,Cn as d,Xd as e,_P as f,ME as g,TR as h,vR as l,wR as o,xR as p,CR as t,SR as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.