diff --git a/.gitignore b/.gitignore index 3073d6d..b87d590 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,14 @@ node_modules package-lock.json +pdf +index +git +testPDF +example +fonts +version +test +testPDF +.github .vscode -.github \ No newline at end of file +pdf \ No newline at end of file diff --git a/.npmignore b/.npmignore index e674d85..b87d590 100644 --- a/.npmignore +++ b/.npmignore @@ -10,4 +10,5 @@ version test testPDF .github -.vscode \ No newline at end of file +.vscode +pdf \ No newline at end of file diff --git a/example/react-test/package.json b/example/react-test/package.json index f8e8c23..6c5b4c5 100644 --- a/example/react-test/package.json +++ b/example/react-test/package.json @@ -38,7 +38,7 @@ "jest-watch-typeahead": "0.4.2", "mini-css-extract-plugin": "0.9.0", "optimize-css-assets-webpack-plugin": "5.0.3", - "pdfh5": "^1.4.8", + "pdfh5": "^1.4.9", "pnp-webpack-plugin": "1.6.4", "postcss-flexbugs-fixes": "4.1.0", "postcss-loader": "3.0.0", diff --git a/example/test/build/webpack.dev.conf.js b/example/test/build/webpack.dev.conf.js index 070ae22..d21d197 100644 --- a/example/test/build/webpack.dev.conf.js +++ b/example/test/build/webpack.dev.conf.js @@ -22,6 +22,7 @@ const devWebpackConfig = merge(baseWebpackConfig, { // these devServer options should be customized in /config/index.js devServer: { + useLocalIp: true, clientLogLevel: 'warning', historyApiFallback: { rewrites: [ @@ -31,7 +32,7 @@ const devWebpackConfig = merge(baseWebpackConfig, { hot: true, contentBase: false, // since we use CopyWebpackPlugin. compress: true, - host: HOST || config.dev.host, + host: '0.0.0.0', port: PORT || config.dev.port, open: config.dev.autoOpenBrowser, overlay: config.dev.errorOverlay diff --git a/example/test/package.json b/example/test/package.json index b653fa4..b71a974 100644 --- a/example/test/package.json +++ b/example/test/package.json @@ -5,15 +5,15 @@ "author": "gjTool <305250069@qq.com>", "private": true, "scripts": { - "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --host 0.0.0.0", "start": "npm run dev", - "build": "node build/build2.js" + "build": "node build/build.js" }, "dependencies": { "axios": "^0.19.2", "canvas": "^2.11.2", "dommatrix": "^1.0.3", - "pdfh5": "^1.4.8", + "pdfh5": "^1.4.9", "vue": "^2.5.2", "vue-router": "^3.0.1", "web-streams-polyfill": "^3.2.1" @@ -72,6 +72,10 @@ "webpack-dev-server": "^2.9.1", "webpack-merge": "^4.1.0" }, + "optionalDependencies": { + "canvas": "^2.11.2", + "path2d-polyfill": "^2.0.1" + }, "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" @@ -81,4 +85,4 @@ "last 2 versions", "not ie <= 8" ] -} +} \ No newline at end of file diff --git a/example/vite4vue3/package.json b/example/vite4vue3/package.json index 226f53a..af41db9 100644 --- a/example/vite4vue3/package.json +++ b/example/vite4vue3/package.json @@ -4,13 +4,13 @@ "version": "0.0.0", "type": "module", "scripts": { - "dev": "vite", + "dev": "vite --host", "build": "vue-tsc && vite build", "preview": "vite preview" - }, + }, "dependencies": { "dommatrix": "^1.0.3", - "pdfh5": "^1.4.8", + "pdfh5": "^1.4.9", "vue": "^3.3.4", "web-streams-polyfill": "^3.2.1", "canvas": "^2.11.2", diff --git a/example/vue3demo/package.json b/example/vue3demo/package.json index 5f8d26b..7ccf498 100644 --- a/example/vue3demo/package.json +++ b/example/vue3demo/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "core-js": "^3.8.3", - "pdfh5": "^1.4.8", + "pdfh5": "^1.4.9", "vue": "^3.2.13", "vuetify": "^3.0.0", "web-streams-polyfill": "^3.2.1", diff --git a/js/pdf.js b/js/pdf.js index e717a38..f23920c 100644 --- a/js/pdf.js +++ b/js/pdf.js @@ -1,8 +1,8 @@ /** * @licstart The following is the entire license notice for the - * JavaScript code in this page + * Javascript code in this page * - * Copyright 2023 Mozilla Foundation + * Copyright 2021 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,6 @@ * limitations under the License. * * @licend The above is the entire license notice for the - * JavaScript code in this page + * Javascript code in this page */ -!function webpackUniversalModuleDefinition(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],e):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=e():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=e()}(globalThis,(()=>(()=>{var __webpack_modules__=[,(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.RenderingIntentFlag=e.PromiseCapability=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.MAX_IMAGE_SIZE_TO_CACHE=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.BASELINE_FACTOR=e.AnnotationType=e.AnnotationReplyType=e.AnnotationMode=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0;e.assert=function assert(t,e){t||unreachable(e)};e.bytesToString=bytesToString;e.createValidAbsoluteUrl=function createValidAbsoluteUrl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(n&&"string"==typeof t){if(n.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(n.tryConvertEncoding)try{t=stringToUTF8String(t)}catch{}}const i=e?new URL(t,e):new URL(t);if(function _isValidProtocol(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(i))return i}catch{}return null};e.getModificationDate=function getModificationDate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")};e.getUuid=function getUuid(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(255*Math.random());return bytesToString(t)};e.getVerbosityLevel=function getVerbosityLevel(){return s};e.info=function info(t){s>=i.INFOS&&console.log(`Info: ${t}`)};e.isArrayBuffer=function isArrayBuffer(t){return"object"==typeof t&&void 0!==t?.byteLength};e.isArrayEqual=function isArrayEqual(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;ne?e.normalize("NFKC"):c.get(n)))};e.objectFromMap=function objectFromMap(t){const e=Object.create(null);for(const[n,i]of t)e[n]=i;return e};e.objectSize=function objectSize(t){return Object.keys(t).length};e.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(s=t)};e.shadow=shadow;e.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)};e.stringToBytes=stringToBytes;e.stringToPDFString=function stringToPDFString(t){if(t[0]>="ï"){let e;"þ"===t[0]&&"ÿ"===t[1]?e="utf-16be":"ÿ"===t[0]&&"þ"===t[1]?e="utf-16le":"ï"===t[0]&&"»"===t[1]&&"¿"===t[2]&&(e="utf-8");if(e)try{const n=new TextDecoder(e,{fatal:!0}),i=stringToBytes(t);return n.decode(i)}catch(t){warn(`stringToPDFString: "${t}".`)}}const e=[];for(let n=0,i=t.length;n=i.WARNINGS&&console.log(`Warning: ${t}`)}function unreachable(t){throw new Error(t)}function shadow(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.defineProperty(t,e,{value:n,enumerable:!i,configurable:!0,writable:!1});return n}const r=function BaseExceptionClosure(){function BaseException(t,e){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=e}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();e.BaseException=r;e.PasswordException=class PasswordException extends r{constructor(t,e){super(t,"PasswordException");this.code=e}};e.UnknownErrorException=class UnknownErrorException extends r{constructor(t,e){super(t,"UnknownErrorException");this.details=e}};e.InvalidPDFException=class InvalidPDFException extends r{constructor(t){super(t,"InvalidPDFException")}};e.MissingPDFException=class MissingPDFException extends r{constructor(t){super(t,"MissingPDFException")}};e.UnexpectedResponseException=class UnexpectedResponseException extends r{constructor(t,e){super(t,"UnexpectedResponseException");this.status=e}};e.FormatError=class FormatError extends r{constructor(t){super(t,"FormatError")}};e.AbortException=class AbortException extends r{constructor(t){super(t,"AbortException")}};function bytesToString(t){"object"==typeof t&&void 0!==t?.length||unreachable("Invalid argument for bytesToString");const e=t.length,n=8192;if(et.toString(16).padStart(2,"0")));e.Util=class Util{static makeHexColor(t,e,n){return`#${a[t]}${a[e]}${a[n]}`}static scaleMinMax(t,e){let n;if(t[0]){if(t[0]<0){n=e[0];e[0]=e[1];e[1]=n}e[0]*=t[0];e[1]*=t[0];if(t[3]<0){n=e[2];e[2]=e[3];e[3]=n}e[2]*=t[3];e[3]*=t[3]}else{n=e[0];e[0]=e[2];e[2]=n;n=e[1];e[1]=e[3];e[3]=n;if(t[1]<0){n=e[2];e[2]=e[3];e[3]=n}e[2]*=t[1];e[3]*=t[1];if(t[2]<0){n=e[0];e[0]=e[1];e[1]=n}e[0]*=t[2];e[1]*=t[2]}e[0]+=t[4];e[1]+=t[4];e[2]+=t[5];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 applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const n=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/n,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/n]}static getAxialAlignedBoundingBox(t,e){const n=this.applyTransform(t,e),i=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),r=this.applyTransform([t[2],t[1]],e);return[Math.min(n[0],i[0],s[0],r[0]),Math.min(n[1],i[1],s[1],r[1]),Math.max(n[0],i[0],s[0],r[0]),Math.max(n[1],i[1],s[1],r[1])]}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){const e=[t[0],t[2],t[1],t[3]],n=t[0]*e[0]+t[1]*e[2],i=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],r=t[2]*e[1]+t[3]*e[3],a=(n+r)/2,o=Math.sqrt((n+r)**2-4*(n*r-s*i))/2,l=a+o||1,c=a-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);if(t[0]>t[2]){e[0]=t[2];e[2]=t[0]}if(t[1]>t[3]){e[1]=t[3];e[3]=t[1]}return e}static intersect(t,e){const n=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(n>i)return null;const s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),r=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>r?null:[n,s,i,r]}static bezierBoundingBox(t,e,n,i,s,r,a,o){const l=[],c=[[],[]];let h,d,u,p,f,g,m,b;for(let c=0;c<2;++c){if(0===c){d=6*t-12*n+6*s;h=-3*t+9*n-9*s+3*a;u=3*n-3*t}else{d=6*e-12*i+6*r;h=-3*e+9*i-9*r+3*o;u=3*i-3*e}if(Math.abs(h)<1e-12){if(Math.abs(d)<1e-12)continue;p=-u/d;0{this.resolve=e=>{this.#t=!0;t(e)};this.reject=t=>{this.#t=!0;e(t)}}))}get settled(){return this.#t}};let l=null,c=null},(t,e,n)=>{"use strict";var i=n(3);!function checkDOMMatrix(){!globalThis.DOMMatrix&&i.isNodeJS&&(globalThis.DOMMatrix=require("canvas").DOMMatrix)}();!function checkPath2D(){if(globalThis.Path2D||!i.isNodeJS)return;const{CanvasRenderingContext2D:t}=require("canvas"),{polyfillPath2D:e}=require("path2d-polyfill");globalThis.CanvasRenderingContext2D=t;e(globalThis)}();!function checkStructuredClone(){globalThis.structuredClone||n(4)}()},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.isNodeJS=void 0;const n=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=n},(t,e,n)=>{n(5);n(88);n(92);n(116);n(118);var i=n(130);t.exports=i.structuredClone},(t,e,n)=>{"use strict";var i=n(6),s=n(14),r=n(61),a=n(62),o=n(36).f,l=n(66),c=n(87),h=n(18),d=n(34),u="Array Iterator",p=a.set,f=a.getterFor(u);t.exports=l(Array,"Array",(function(t,e){p(this,{type:u,target:i(t),index:0,kind:e})}),(function(){var t=f(this),e=t.target,n=t.kind,i=t.index++;if(!e||i>=e.length){t.target=void 0;return c(void 0,!0)}return c("keys"==n?i:"values"==n?e[i]:[i,e[i]],!1)}),"values");var g=r.Arguments=r.Array;s("keys");s("values");s("entries");if(!h&&d&&"values"!==g.name)try{o(g,"name",{value:"values"})}catch(t){}},(t,e,n)=>{var i=n(7),s=n(12);t.exports=function(t){return i(s(t))}},(t,e,n)=>{var i=n(8),s=n(10),r=n(11),a=Object,o=i("".split);t.exports=s((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"==r(t)?o(t,""):a(t)}:a},(t,e,n)=>{var i=n(9),s=Function.prototype,r=s.call,a=i&&s.bind.bind(r,r);t.exports=i?a:function(t){return function(){return r.apply(t,arguments)}}},(t,e,n)=>{var i=n(10);t.exports=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},(t,e,n)=>{var i=n(8),s=i({}.toString),r=i("".slice);t.exports=function(t){return r(s(t),8,-1)}},(t,e,n)=>{var i=n(13),s=TypeError;t.exports=function(t){if(i(t))throw s("Can't call method on "+t);return t}},t=>{t.exports=function(t){return null==t}},(t,e,n)=>{var i=n(15),s=n(28),r=n(36).f,a=i("unscopables"),o=Array.prototype;null==o[a]&&r(o,a,{configurable:!0,value:s(null)});t.exports=function(t){o[a][t]=!0}},(t,e,n)=>{var i=n(16),s=n(17),r=n(21),a=n(23),o=n(24),l=n(27),c=i.Symbol,h=s("wks"),d=l?c.for||c:c&&c.withoutSetter||a;t.exports=function(t){r(h,t)||(h[t]=o&&r(c,t)?c[t]:d("Symbol."+t));return h[t]}},function(t){var check=function(t){return t&&t.Math==Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||this||Function("return this")()},(t,e,n)=>{var i=n(18),s=n(19);(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.31.0",mode:i?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,e,n)=>{var i=n(16),s=n(20),r="__core-js_shared__",a=i[r]||s(r,{});t.exports=a},(t,e,n)=>{var i=n(16),s=Object.defineProperty;t.exports=function(t,e){try{s(i,t,{value:e,configurable:!0,writable:!0})}catch(n){i[t]=e}return e}},(t,e,n)=>{var i=n(8),s=n(22),r=i({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,e){return r(s(t),e)}},(t,e,n)=>{var i=n(12),s=Object;t.exports=function(t){return s(i(t))}},(t,e,n)=>{var i=n(8),s=0,r=Math.random(),a=i(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++s+r,36)}},(t,e,n)=>{var i=n(25),s=n(10),r=n(16).String;t.exports=!!Object.getOwnPropertySymbols&&!s((function(){var t=Symbol();return!r(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},(t,e,n)=>{var i,s,r=n(16),a=n(26),o=r.process,l=r.Deno,c=o&&o.versions||l&&l.version,h=c&&c.v8;h&&(s=(i=h.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1]));!s&&a&&(!(i=a.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=a.match(/Chrome\/(\d+)/))&&(s=+i[1]);t.exports=s},t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(t,e,n)=>{var i=n(24);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,e,n)=>{var i,s=n(29),r=n(33),a=n(58),o=n(57),l=n(59),c=n(38),h=n(60),d="prototype",u="script",p=h("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<"+u+">"+t+""},NullProtoObjectViaActiveX=function(t){t.write(scriptTag(""));t.close();var e=t.parentWindow.Object;t=null;return e},NullProtoObject=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}NullProtoObject="undefined"!=typeof document?document.domain&&i?NullProtoObjectViaActiveX(i):function(){var t,e=c("iframe"),n="java"+u+":";e.style.display="none";l.appendChild(e);e.src=String(n);(t=e.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}():NullProtoObjectViaActiveX(i);for(var t=a.length;t--;)delete NullProtoObject[d][a[t]];return NullProtoObject()};o[p]=!0;t.exports=Object.create||function create(t,e){var n;if(null!==t){EmptyConstructor[d]=s(t);n=new EmptyConstructor;EmptyConstructor[d]=null;n[p]=t}else n=NullProtoObject();return void 0===e?n:r.f(n,e)}},(t,e,n)=>{var i=n(30),s=String,r=TypeError;t.exports=function(t){if(i(t))return t;throw r(s(t)+" is not an object")}},(t,e,n)=>{var i=n(31),s=n(32),r=s.all;t.exports=s.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:i(t)||t===r}:function(t){return"object"==typeof t?null!==t:i(t)}},(t,e,n)=>{var i=n(32),s=i.all;t.exports=i.IS_HTMLDDA?function(t){return"function"==typeof t||t===s}:function(t){return"function"==typeof t}},t=>{var e="object"==typeof document&&document.all,n=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:n}},(t,e,n)=>{var i=n(34),s=n(35),r=n(36),a=n(29),o=n(6),l=n(49);e.f=i&&!s?Object.defineProperties:function defineProperties(t,e){a(t);for(var n,i=o(e),s=l(e),c=s.length,h=0;c>h;)r.f(t,n=s[h++],i[n]);return t}},(t,e,n)=>{var i=n(10);t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},(t,e,n)=>{var i=n(34),s=n(10);t.exports=i&&s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(t,e,n)=>{var i=n(34),s=n(37),r=n(35),a=n(29),o=n(39),l=TypeError,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",p="writable";e.f=i?r?function defineProperty(t,e,n){a(t);e=o(e);a(n);if("function"==typeof t&&"prototype"===e&&"value"in n&&p in n&&!n[p]){var i=h(t,e);if(i&&i[p]){t[e]=n.value;n={configurable:u in n?n[u]:i[u],enumerable:d in n?n[d]:i[d],writable:!1}}}return c(t,e,n)}:c:function defineProperty(t,e,n){a(t);e=o(e);a(n);if(s)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw l("Accessors not supported");"value"in n&&(t[e]=n.value);return t}},(t,e,n)=>{var i=n(34),s=n(10),r=n(38);t.exports=!i&&!s((function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},(t,e,n)=>{var i=n(16),s=n(30),r=i.document,a=s(r)&&s(r.createElement);t.exports=function(t){return a?r.createElement(t):{}}},(t,e,n)=>{var i=n(40),s=n(42);t.exports=function(t){var e=i(t,"string");return s(e)?e:e+""}},(t,e,n)=>{var i=n(41),s=n(30),r=n(42),a=n(45),o=n(48),l=n(15),c=TypeError,h=l("toPrimitive");t.exports=function(t,e){if(!s(t)||r(t))return t;var n,l=a(t,h);if(l){void 0===e&&(e="default");n=i(l,t,e);if(!s(n)||r(n))return n;throw c("Can't convert object to primitive value")}void 0===e&&(e="number");return o(t,e)}},(t,e,n)=>{var i=n(9),s=Function.prototype.call;t.exports=i?s.bind(s):function(){return s.apply(s,arguments)}},(t,e,n)=>{var i=n(43),s=n(31),r=n(44),a=n(27),o=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return s(e)&&r(e.prototype,o(t))}},(t,e,n)=>{var i=n(16),s=n(31);t.exports=function(t,e){return arguments.length<2?(n=i[t],s(n)?n:void 0):i[t]&&i[t][e];var n}},(t,e,n)=>{var i=n(8);t.exports=i({}.isPrototypeOf)},(t,e,n)=>{var i=n(46),s=n(13);t.exports=function(t,e){var n=t[e];return s(n)?void 0:i(n)}},(t,e,n)=>{var i=n(31),s=n(47),r=TypeError;t.exports=function(t){if(i(t))return t;throw r(s(t)+" is not a function")}},t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},(t,e,n)=>{var i=n(41),s=n(31),r=n(30),a=TypeError;t.exports=function(t,e){var n,o;if("string"===e&&s(n=t.toString)&&!r(o=i(n,t)))return o;if(s(n=t.valueOf)&&!r(o=i(n,t)))return o;if("string"!==e&&s(n=t.toString)&&!r(o=i(n,t)))return o;throw a("Can't convert object to primitive value")}},(t,e,n)=>{var i=n(50),s=n(58);t.exports=Object.keys||function keys(t){return i(t,s)}},(t,e,n)=>{var i=n(8),s=n(21),r=n(6),a=n(51).indexOf,o=n(57),l=i([].push);t.exports=function(t,e){var n,i=r(t),c=0,h=[];for(n in i)!s(o,n)&&s(i,n)&&l(h,n);for(;e.length>c;)s(i,n=e[c++])&&(~a(h,n)||l(h,n));return h}},(t,e,n)=>{var i=n(6),s=n(52),r=n(55),createMethod=function(t){return function(e,n,a){var o,l=i(e),c=r(l),h=s(a,c);if(t&&n!=n){for(;c>h;)if((o=l[h++])!=o)return!0}else for(;c>h;h++)if((t||h in l)&&l[h]===n)return t||h||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(t,e,n)=>{var i=n(53),s=Math.max,r=Math.min;t.exports=function(t,e){var n=i(t);return n<0?s(n+e,0):r(n,e)}},(t,e,n)=>{var i=n(54);t.exports=function(t){var e=+t;return e!=e||0===e?0:i(e)}},t=>{var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function trunc(t){var i=+t;return(i>0?n:e)(i)}},(t,e,n)=>{var i=n(56);t.exports=function(t){return i(t.length)}},(t,e,n)=>{var i=n(53),s=Math.min;t.exports=function(t){return t>0?s(i(t),9007199254740991):0}},t=>{t.exports={}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,e,n)=>{var i=n(43);t.exports=i("document","documentElement")},(t,e,n)=>{var i=n(17),s=n(23),r=i("keys");t.exports=function(t){return r[t]||(r[t]=s(t))}},t=>{t.exports={}},(t,e,n)=>{var i,s,r,a=n(63),o=n(16),l=n(30),c=n(64),h=n(21),d=n(19),u=n(60),p=n(57),f="Object already initialized",g=o.TypeError,m=o.WeakMap;if(a||d.state){var b=d.state||(d.state=new m);b.get=b.get;b.has=b.has;b.set=b.set;i=function(t,e){if(b.has(t))throw g(f);e.facade=t;b.set(t,e);return e};s=function(t){return b.get(t)||{}};r=function(t){return b.has(t)}}else{var v=u("state");p[v]=!0;i=function(t,e){if(h(t,v))throw g(f);e.facade=t;c(t,v,e);return e};s=function(t){return h(t,v)?t[v]:{}};r=function(t){return h(t,v)}}t.exports={set:i,get:s,has:r,enforce:function(t){return r(t)?s(t):i(t,{})},getterFor:function(t){return function(e){var n;if(!l(e)||(n=s(e)).type!==t)throw g("Incompatible receiver, "+t+" required");return n}}}},(t,e,n)=>{var i=n(16),s=n(31),r=i.WeakMap;t.exports=s(r)&&/native code/.test(String(r))},(t,e,n)=>{var i=n(34),s=n(36),r=n(65);t.exports=i?function(t,e,n){return s.f(t,e,r(1,n))}:function(t,e,n){t[e]=n;return t}},t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},(t,e,n)=>{"use strict";var i=n(67),s=n(41),r=n(18),a=n(72),o=n(31),l=n(79),c=n(81),h=n(84),d=n(83),u=n(64),p=n(70),f=n(15),g=n(61),m=n(80),b=a.PROPER,v=a.CONFIGURABLE,y=m.IteratorPrototype,A=m.BUGGY_SAFARI_ITERATORS,_=f("iterator"),S="keys",x="values",E="entries",returnThis=function(){return this};t.exports=function(t,e,n,a,f,m,C){l(n,e,a);var w,T,P,getIterationMethod=function(t){if(t===f&&D)return D;if(!A&&t in R)return R[t];switch(t){case S:return function keys(){return new n(this,t)};case x:return function values(){return new n(this,t)};case E:return function entries(){return new n(this,t)}}return function(){return new n(this)}},k=e+" Iterator",M=!1,R=t.prototype,I=R[_]||R["@@iterator"]||f&&R[f],D=!A&&I||getIterationMethod(f),O="Array"==e&&R.entries||I;if(O&&(w=c(O.call(new t)))!==Object.prototype&&w.next){r||c(w)===y||(h?h(w,y):o(w[_])||p(w,_,returnThis));d(w,k,!0,!0);r&&(g[k]=returnThis)}if(b&&f==x&&I&&I.name!==x)if(!r&&v)u(R,"name",x);else{M=!0;D=function values(){return s(I,this)}}if(f){T={values:getIterationMethod(x),keys:m?D:getIterationMethod(S),entries:getIterationMethod(E)};if(C)for(P in T)(A||M||!(P in R))&&p(R,P,T[P]);else i({target:e,proto:!0,forced:A||M},T)}r&&!C||R[_]===D||p(R,_,D,{name:f});g[e]=D;return T}},(t,e,n)=>{var i=n(16),s=n(68).f,r=n(64),a=n(70),o=n(20),l=n(74),c=n(78);t.exports=function(t,e){var n,h,d,u,p,f=t.target,g=t.global,m=t.stat;if(n=g?i:m?i[f]||o(f,{}):(i[f]||{}).prototype)for(h in e){u=e[h];d=t.dontCallGetSet?(p=s(n,h))&&p.value:n[h];if(!c(g?h:f+(m?".":"#")+h,t.forced)&&void 0!==d){if(typeof u==typeof d)continue;l(u,d)}(t.sham||d&&d.sham)&&r(u,"sham",!0);a(n,h,u,t)}}},(t,e,n)=>{var i=n(34),s=n(41),r=n(69),a=n(65),o=n(6),l=n(39),c=n(21),h=n(37),d=Object.getOwnPropertyDescriptor;e.f=i?d:function getOwnPropertyDescriptor(t,e){t=o(t);e=l(e);if(h)try{return d(t,e)}catch(t){}if(c(t,e))return a(!s(r.f,t,e),t[e])}},(t,e)=>{"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,s=i&&!n.call({1:2},1);e.f=s?function propertyIsEnumerable(t){var e=i(this,t);return!!e&&e.enumerable}:n},(t,e,n)=>{var i=n(31),s=n(36),r=n(71),a=n(20);t.exports=function(t,e,n,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:e;i(n)&&r(n,c,o);if(o.global)l?t[e]=n:a(e,n);else{try{o.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=n:s.f(t,e,{value:n,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}},(t,e,n)=>{var i=n(8),s=n(10),r=n(31),a=n(21),o=n(34),l=n(72).CONFIGURABLE,c=n(73),h=n(62),d=h.enforce,u=h.get,p=String,f=Object.defineProperty,g=i("".slice),m=i("".replace),b=i([].join),v=o&&!s((function(){return 8!==f((function(){}),"length",{value:8}).length})),y=String(String).split("String"),A=t.exports=function(t,e,n){"Symbol("===g(p(e),0,7)&&(e="["+m(p(e),/^Symbol\(([^)]*)\)/,"$1")+"]");n&&n.getter&&(e="get "+e);n&&n.setter&&(e="set "+e);(!a(t,"name")||l&&t.name!==e)&&(o?f(t,"name",{value:e,configurable:!0}):t.name=e);v&&n&&a(n,"arity")&&t.length!==n.arity&&f(t,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?o&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=d(t);a(i,"source")||(i.source=b(y,"string"==typeof e?e:""));return t};Function.prototype.toString=A((function toString(){return r(this)&&u(this).source||c(this)}),"toString")},(t,e,n)=>{var i=n(34),s=n(21),r=Function.prototype,a=i&&Object.getOwnPropertyDescriptor,o=s(r,"name"),l=o&&"something"===function something(){}.name,c=o&&(!i||i&&a(r,"name").configurable);t.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},(t,e,n)=>{var i=n(8),s=n(31),r=n(19),a=i(Function.toString);s(r.inspectSource)||(r.inspectSource=function(t){return a(t)});t.exports=r.inspectSource},(t,e,n)=>{var i=n(21),s=n(75),r=n(68),a=n(36);t.exports=function(t,e,n){for(var o=s(e),l=a.f,c=r.f,h=0;h{var i=n(43),s=n(8),r=n(76),a=n(77),o=n(29),l=s([].concat);t.exports=i("Reflect","ownKeys")||function ownKeys(t){var e=r.f(o(t)),n=a.f;return n?l(e,n(t)):e}},(t,e,n)=>{var i=n(50),s=n(58).concat("length","prototype");e.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return i(t,s)}},(t,e)=>{e.f=Object.getOwnPropertySymbols},(t,e,n)=>{var i=n(10),s=n(31),r=/#|\.prototype\./,isForced=function(t,e){var n=o[a(t)];return n==c||n!=l&&(s(e)?i(e):!!e)},a=isForced.normalize=function(t){return String(t).replace(r,".").toLowerCase()},o=isForced.data={},l=isForced.NATIVE="N",c=isForced.POLYFILL="P";t.exports=isForced},(t,e,n)=>{"use strict";var i=n(80).IteratorPrototype,s=n(28),r=n(65),a=n(83),o=n(61),returnThis=function(){return this};t.exports=function(t,e,n,l){var c=e+" Iterator";t.prototype=s(i,{next:r(+!l,n)});a(t,c,!1,!0);o[c]=returnThis;return t}},(t,e,n)=>{"use strict";var i,s,r,a=n(10),o=n(31),l=n(30),c=n(28),h=n(81),d=n(70),u=n(15),p=n(18),f=u("iterator"),g=!1;[].keys&&("next"in(r=[].keys())?(s=h(h(r)))!==Object.prototype&&(i=s):g=!0);!l(i)||a((function(){var t={};return i[f].call(t)!==t}))?i={}:p&&(i=c(i));o(i[f])||d(i,f,(function(){return this}));t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:g}},(t,e,n)=>{var i=n(21),s=n(31),r=n(22),a=n(60),o=n(82),l=a("IE_PROTO"),c=Object,h=c.prototype;t.exports=o?c.getPrototypeOf:function(t){var e=r(t);if(i(e,l))return e[l];var n=e.constructor;return s(n)&&e instanceof n?n.prototype:e instanceof c?h:null}},(t,e,n)=>{var i=n(10);t.exports=!i((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(t,e,n)=>{var i=n(36).f,s=n(21),r=n(15)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype);t&&!s(t,r)&&i(t,r,{configurable:!0,value:e})}},(t,e,n)=>{var i=n(85),s=n(29),r=n(86);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=i(Object.prototype,"__proto__","set"))(n,[]);e=n instanceof Array}catch(t){}return function setPrototypeOf(n,i){s(n);r(i);e?t(n,i):n.__proto__=i;return n}}():void 0)},(t,e,n)=>{var i=n(8),s=n(46);t.exports=function(t,e,n){try{return i(s(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}}},(t,e,n)=>{var i=n(31),s=String,r=TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw r("Can't set "+s(t)+" as a prototype")}},t=>{t.exports=function(t,e){return{value:t,done:e}}},(t,e,n)=>{var i=n(89),s=n(70),r=n(90);i||s(Object.prototype,"toString",r,{unsafe:!0})},(t,e,n)=>{var i={};i[n(15)("toStringTag")]="z";t.exports="[object z]"===String(i)},(t,e,n)=>{"use strict";var i=n(89),s=n(91);t.exports=i?{}.toString:function toString(){return"[object "+s(this)+"]"}},(t,e,n)=>{var i=n(89),s=n(31),r=n(11),a=n(15)("toStringTag"),o=Object,l="Arguments"==r(function(){return arguments}());t.exports=i?r:function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=o(t),a))?n:l?r(e):"Object"==(i=r(e))&&s(e.callee)?"Arguments":i}},(t,e,n)=>{n(93)},(t,e,n)=>{"use strict";n(94)("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),n(112))},(t,e,n)=>{"use strict";var i=n(67),s=n(16),r=n(8),a=n(78),o=n(70),l=n(95),c=n(102),h=n(109),d=n(31),u=n(13),p=n(30),f=n(10),g=n(110),m=n(83),b=n(111);t.exports=function(t,e,n){var v=-1!==t.indexOf("Map"),y=-1!==t.indexOf("Weak"),A=v?"set":"add",_=s[t],S=_&&_.prototype,x=_,E={},fixMethod=function(t){var e=r(S[t]);o(S,t,"add"==t?function add(t){e(this,0===t?0:t);return this}:"delete"==t?function(t){return!(y&&!p(t))&&e(this,0===t?0:t)}:"get"==t?function get(t){return y&&!p(t)?void 0:e(this,0===t?0:t)}:"has"==t?function has(t){return!(y&&!p(t))&&e(this,0===t?0:t)}:function set(t,n){e(this,0===t?0:t,n);return this})};if(a(t,!d(_)||!(y||S.forEach&&!f((function(){(new _).entries().next()}))))){x=n.getConstructor(e,t,v,A);l.enable()}else if(a(t,!0)){var C=new x,w=C[A](y?{}:-0,1)!=C,T=f((function(){C.has(1)})),P=g((function(t){new _(t)})),k=!y&&f((function(){for(var t=new _,e=5;e--;)t[A](e,e);return!t.has(-0)}));if(!P){(x=e((function(t,e){h(t,S);var n=b(new _,t,x);u(e)||c(e,n[A],{that:n,AS_ENTRIES:v});return n}))).prototype=S;S.constructor=x}if(T||k){fixMethod("delete");fixMethod("has");v&&fixMethod("get")}(k||w)&&fixMethod(A);y&&S.clear&&delete S.clear}E[t]=x;i({global:!0,constructor:!0,forced:x!=_},E);m(x,t);y||n.setStrong(x,t,v);return x}},(t,e,n)=>{var i=n(67),s=n(8),r=n(57),a=n(30),o=n(21),l=n(36).f,c=n(76),h=n(96),d=n(99),u=n(23),p=n(101),f=!1,g=u("meta"),m=0,setMetadata=function(t){l(t,g,{value:{objectID:"O"+m++,weakData:{}}})},b=t.exports={enable:function(){b.enable=function(){};f=!0;var t=c.f,e=s([].splice),n={};n[g]=1;if(t(n).length){c.f=function(n){for(var i=t(n),s=0,r=i.length;s{var i=n(11),s=n(6),r=n(76).f,a=n(97),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function getOwnPropertyNames(t){return o&&"Window"==i(t)?function(t){try{return r(t)}catch(t){return a(o)}}(t):r(s(t))}},(t,e,n)=>{var i=n(52),s=n(55),r=n(98),a=Array,o=Math.max;t.exports=function(t,e,n){for(var l=s(t),c=i(e,l),h=i(void 0===n?l:n,l),d=a(o(h-c,0)),u=0;c{"use strict";var i=n(39),s=n(36),r=n(65);t.exports=function(t,e,n){var a=i(e);a in t?s.f(t,a,r(0,n)):t[a]=n}},(t,e,n)=>{var i=n(10),s=n(30),r=n(11),a=n(100),o=Object.isExtensible,l=i((function(){o(1)}));t.exports=l||a?function isExtensible(t){return!!s(t)&&((!a||"ArrayBuffer"!=r(t))&&(!o||o(t)))}:o},(t,e,n)=>{var i=n(10);t.exports=i((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},(t,e,n)=>{var i=n(10);t.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},(t,e,n)=>{var i=n(103),s=n(41),r=n(29),a=n(47),o=n(105),l=n(55),c=n(44),h=n(106),d=n(107),u=n(108),p=TypeError,Result=function(t,e){this.stopped=t;this.result=e},f=Result.prototype;t.exports=function(t,e,n){var g,m,b,v,y,A,_,S=n&&n.that,x=!(!n||!n.AS_ENTRIES),E=!(!n||!n.IS_RECORD),C=!(!n||!n.IS_ITERATOR),w=!(!n||!n.INTERRUPTED),T=i(e,S),stop=function(t){g&&u(g,"normal",t);return new Result(!0,t)},callFn=function(t){if(x){r(t);return w?T(t[0],t[1],stop):T(t[0],t[1])}return w?T(t,stop):T(t)};if(E)g=t.iterator;else if(C)g=t;else{if(!(m=d(t)))throw p(a(t)+" is not iterable");if(o(m)){for(b=0,v=l(t);v>b;b++)if((y=callFn(t[b]))&&c(f,y))return y;return new Result(!1)}g=h(t,m)}A=E?t.next:g.next;for(;!(_=s(A,g)).done;){try{y=callFn(_.value)}catch(t){u(g,"throw",t)}if("object"==typeof y&&y&&c(f,y))return y}return new Result(!1)}},(t,e,n)=>{var i=n(104),s=n(46),r=n(9),a=i(i.bind);t.exports=function(t,e){s(t);return void 0===e?t:r?a(t,e):function(){return t.apply(e,arguments)}}},(t,e,n)=>{var i=n(11),s=n(8);t.exports=function(t){if("Function"===i(t))return s(t)}},(t,e,n)=>{var i=n(15),s=n(61),r=i("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(s.Array===t||a[r]===t)}},(t,e,n)=>{var i=n(41),s=n(46),r=n(29),a=n(47),o=n(107),l=TypeError;t.exports=function(t,e){var n=arguments.length<2?o(t):e;if(s(n))return r(i(n,t));throw l(a(t)+" is not iterable")}},(t,e,n)=>{var i=n(91),s=n(45),r=n(13),a=n(61),o=n(15)("iterator");t.exports=function(t){if(!r(t))return s(t,o)||s(t,"@@iterator")||a[i(t)]}},(t,e,n)=>{var i=n(41),s=n(29),r=n(45);t.exports=function(t,e,n){var a,o;s(t);try{if(!(a=r(t,"return"))){if("throw"===e)throw n;return n}a=i(a,t)}catch(t){o=!0;a=t}if("throw"===e)throw n;if(o)throw a;s(a);return n}},(t,e,n)=>{var i=n(44),s=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw s("Incorrect invocation")}},(t,e,n)=>{var i=n(15)("iterator"),s=!1;try{var r=0,a={next:function(){return{done:!!r++}},return:function(){s=!0}};a[i]=function(){return this};Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!s)return!1;var n=!1;try{var r={};r[i]=function(){return{next:function(){return{done:n=!0}}}};t(r)}catch(t){}return n}},(t,e,n)=>{var i=n(31),s=n(30),r=n(84);t.exports=function(t,e,n){var a,o;r&&i(a=e.constructor)&&a!==n&&s(o=a.prototype)&&o!==n.prototype&&r(t,o);return t}},(t,e,n)=>{"use strict";var i=n(28),s=n(113),r=n(114),a=n(103),o=n(109),l=n(13),c=n(102),h=n(66),d=n(87),u=n(115),p=n(34),f=n(95).fastKey,g=n(62),m=g.set,b=g.getterFor;t.exports={getConstructor:function(t,e,n,h){var d=t((function(t,s){o(t,u);m(t,{type:e,index:i(null),first:void 0,last:void 0,size:0});p||(t.size=0);l(s)||c(s,t[h],{that:t,AS_ENTRIES:n})})),u=d.prototype,g=b(e),define=function(t,e,n){var i,s,r=g(t),a=getEntry(t,e);if(a)a.value=n;else{r.last=a={index:s=f(e,!0),key:e,value:n,previous:i=r.last,next:void 0,removed:!1};r.first||(r.first=a);i&&(i.next=a);p?r.size++:t.size++;"F"!==s&&(r.index[s]=a)}return t},getEntry=function(t,e){var n,i=g(t),s=f(e);if("F"!==s)return i.index[s];for(n=i.first;n;n=n.next)if(n.key==e)return n};r(u,{clear:function clear(){for(var t=g(this),e=t.index,n=t.first;n;){n.removed=!0;n.previous&&(n.previous=n.previous.next=void 0);delete e[n.index];n=n.next}t.first=t.last=void 0;p?t.size=0:this.size=0},delete:function(t){var e=this,n=g(e),i=getEntry(e,t);if(i){var s=i.next,r=i.previous;delete n.index[i.index];i.removed=!0;r&&(r.next=s);s&&(s.previous=r);n.first==i&&(n.first=s);n.last==i&&(n.last=r);p?n.size--:e.size--}return!!i},forEach:function forEach(t){for(var e,n=g(this),i=a(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:n.first;){i(e.value,e.key,this);for(;e&&e.removed;)e=e.previous}},has:function has(t){return!!getEntry(this,t)}});r(u,n?{get:function get(t){var e=getEntry(this,t);return e&&e.value},set:function set(t,e){return define(this,0===t?0:t,e)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}});p&&s(u,"size",{configurable:!0,get:function(){return g(this).size}});return d},setStrong:function(t,e,n){var i=e+" Iterator",s=b(e),r=b(i);h(t,e,(function(t,e){m(this,{type:i,target:t,state:s(t),kind:e,last:void 0})}),(function(){for(var t=r(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;if(!t.target||!(t.last=n=n?n.next:t.state.first)){t.target=void 0;return d(void 0,!0)}return d("keys"==e?n.key:"values"==e?n.value:[n.key,n.value],!1)}),n?"entries":"values",!n,!0);u(e)}}},(t,e,n)=>{var i=n(71),s=n(36);t.exports=function(t,e,n){n.get&&i(n.get,e,{getter:!0});n.set&&i(n.set,e,{setter:!0});return s.f(t,e,n)}},(t,e,n)=>{var i=n(70);t.exports=function(t,e,n){for(var s in e)i(t,s,e[s],n);return t}},(t,e,n)=>{"use strict";var i=n(43),s=n(113),r=n(15),a=n(34),o=r("species");t.exports=function(t){var e=i(t);a&&e&&!e[o]&&s(e,o,{configurable:!0,get:function(){return this}})}},(t,e,n)=>{n(117)},(t,e,n)=>{"use strict";n(94)("Set",(function(t){return function Set(){return t(this,arguments.length?arguments[0]:void 0)}}),n(112))},(t,e,n)=>{var i,s=n(18),r=n(67),a=n(16),o=n(43),l=n(8),c=n(10),h=n(23),d=n(31),u=n(119),p=n(13),f=n(30),g=n(42),m=n(102),b=n(29),v=n(91),y=n(21),A=n(98),_=n(64),S=n(55),x=n(120),E=n(121),C=n(123),w=n(124),T=n(125),P=n(126),k=a.Object,M=a.Array,R=a.Date,I=a.Error,D=a.EvalError,O=a.RangeError,L=a.ReferenceError,N=a.SyntaxError,j=a.TypeError,B=a.URIError,U=a.PerformanceMark,H=a.WebAssembly,z=H&&H.CompileError||I,W=H&&H.LinkError||I,q=H&&H.RuntimeError||I,G=o("DOMException"),V=C.Map,X=C.has,$=C.get,K=C.set,Y=w.Set,J=w.add,Q=o("Object","keys"),Z=l([].push),tt=l((!0).valueOf),et=l(1..valueOf),nt=l("".valueOf),it=l(R.prototype.getTime),st=h("structuredClone"),rt="DataCloneError",at="Transferring",checkBasicSemantic=function(t){return!c((function(){var e=new a.Set([7]),n=t(e),i=t(k(7));return n==e||!n.has(7)||"object"!=typeof i||7!=i}))&&t},checkErrorsCloning=function(t,e){return!c((function(){var n=new e,i=t({a:n,b:n});return!(i&&i.a===i.b&&i.a instanceof e&&i.a.stack===n.stack)}))},ot=a.structuredClone,lt=s||!checkErrorsCloning(ot,I)||!checkErrorsCloning(ot,G)||!(i=ot,!c((function(){var t=i(new a.AggregateError([1],st,{cause:3}));return"AggregateError"!=t.name||1!=t.errors[0]||t.message!=st||3!=t.cause}))),ct=!ot&&checkBasicSemantic((function(t){return new U(st,{detail:t}).detail})),ht=checkBasicSemantic(ot)||ct,throwUncloneable=function(t){throw new G("Uncloneable type: "+t,rt)},throwUnpolyfillable=function(t,e){throw new G((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",rt)},tryNativeRestrictedStructuredClone=function(t,e){ht||throwUnpolyfillable(e);return ht(t)},structuredCloneInternal=function(t,e){g(t)&&throwUncloneable("Symbol");if(!f(t))return t;if(e){if(X(e,t))return $(e,t)}else e=new V;var n,i,s,r,l,c,h,u,p,m,b,x=v(t),C=!1;switch(x){case"Array":s=M(S(t));C=!0;break;case"Object":s={};C=!0;break;case"Map":s=new V;C=!0;break;case"Set":s=new Y;C=!0;break;case"RegExp":s=new RegExp(t.source,E(t));break;case"Error":switch(i=t.name){case"AggregateError":s=o("AggregateError")([]);break;case"EvalError":s=D();break;case"RangeError":s=O();break;case"ReferenceError":s=L();break;case"SyntaxError":s=N();break;case"TypeError":s=j();break;case"URIError":s=B();break;case"CompileError":s=z();break;case"LinkError":s=W();break;case"RuntimeError":s=q();break;default:s=I()}C=!0;break;case"DOMException":s=new G(t.message,t.name);C=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":n=a[x];f(n)||throwUnpolyfillable(x);s=new n(structuredCloneInternal(t.buffer,e),t.byteOffset,"DataView"===x?t.byteLength:t.length);break;case"DOMQuad":try{s=new DOMQuad(structuredCloneInternal(t.p1,e),structuredCloneInternal(t.p2,e),structuredCloneInternal(t.p3,e),structuredCloneInternal(t.p4,e))}catch(e){s=tryNativeRestrictedStructuredClone(t,x)}break;case"File":if(ht)try{s=ht(t);v(s)!==x&&(s=void 0)}catch(t){}if(!s)try{s=new File([t],t.name,t)}catch(t){}s||throwUnpolyfillable(x);break;case"FileList":if(r=function(){var t;try{t=new a.DataTransfer}catch(e){try{t=new a.ClipboardEvent("").clipboardData}catch(t){}}return t&&t.items&&t.files?t:null}()){for(l=0,c=S(t);l1&&!p(arguments[1])?b(arguments[1]):void 0,i=n?n.transfer:void 0;void 0!==i&&function(t,e){if(!f(t))throw j("Transfer option cannot be converted to a sequence");var n=[];m(t,(function(t){Z(n,b(t))}));var i,s,r,o,l,c,h=0,p=S(n);if(P){o=ot(n,{transfer:n});for(;h{var i=n(8),s=n(10),r=n(31),a=n(91),o=n(43),l=n(73),noop=function(){},c=[],h=o("Reflect","construct"),d=/^\s*(?:class|function)\b/,u=i(d.exec),p=!d.exec(noop),f=function isConstructor(t){if(!r(t))return!1;try{h(noop,c,t);return!0}catch(t){return!1}},g=function isConstructor(t){if(!r(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!u(d,l(t))}catch(t){return!0}};g.sham=!0;t.exports=!h||s((function(){var t;return f(f.call)||!f(Object)||!f((function(){t=!0}))||t}))?g:f},t=>{var e=TypeError;t.exports=function(t,n){if(t{var i=n(41),s=n(21),r=n(44),a=n(122),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in o||s(t,"flags")||!r(o,t)?e:i(a,t)}},(t,e,n)=>{"use strict";var i=n(29);t.exports=function(){var t=i(this),e="";t.hasIndices&&(e+="d");t.global&&(e+="g");t.ignoreCase&&(e+="i");t.multiline&&(e+="m");t.dotAll&&(e+="s");t.unicode&&(e+="u");t.unicodeSets&&(e+="v");t.sticky&&(e+="y");return e}},(t,e,n)=>{var i=n(8),s=Map.prototype;t.exports={Map:Map,set:i(s.set),get:i(s.get),has:i(s.has),remove:i(s.delete),proto:s}},(t,e,n)=>{var i=n(8),s=Set.prototype;t.exports={Set:Set,add:i(s.add),has:i(s.has),remove:i(s.delete),proto:s}},(t,e,n)=>{var i=n(10),s=n(65);t.exports=!i((function(){var t=Error("a");if(!("stack"in t))return!0;Object.defineProperty(t,"stack",s(1,7));return 7!==t.stack}))},(t,e,n)=>{var i=n(16),s=n(10),r=n(25),a=n(127),o=n(128),l=n(129),c=i.structuredClone;t.exports=!!c&&!s((function(){if(o&&r>92||l&&r>94||a&&r>97)return!1;var t=new ArrayBuffer(8),e=c(t,{transfer:[t]});return 0!=t.byteLength||8!=e.byteLength}))},(t,e,n)=>{var i=n(128),s=n(129);t.exports=!i&&!s&&"object"==typeof window&&"object"==typeof document},t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(t,e,n)=>{var i=n(11);t.exports="undefined"!=typeof process&&"process"==i(process)},(t,e,n)=>{var i=n(16);t.exports=i},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0;exports.getDocument=getDocument;exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(132),_display_utils=__w_pdfjs_require__(135),_font_loader=__w_pdfjs_require__(138),_canvas=__w_pdfjs_require__(139),_worker_options=__w_pdfjs_require__(142),_is_node=__w_pdfjs_require__(3),_message_handler=__w_pdfjs_require__(143),_metadata=__w_pdfjs_require__(144),_optional_content_config=__w_pdfjs_require__(145),_transport_stream=__w_pdfjs_require__(146),_xfa_text=__w_pdfjs_require__(147);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_is_node.isNodeJS?__w_pdfjs_require__(148).NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_is_node.isNodeJS?__w_pdfjs_require__(148).NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_is_node.isNodeJS?__w_pdfjs_require__(148).NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_is_node.isNodeJS?__w_pdfjs_require__(148).NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;let createPDFNetworkStream;if(_is_node.isNodeJS){const{PDFNodeStream:t}=__w_pdfjs_require__(149);createPDFNetworkStream=e=>new t(e)}else{const{PDFNetworkStream:t}=__w_pdfjs_require__(152),{PDFFetchStream:e}=__w_pdfjs_require__(153);createPDFNetworkStream=n=>(0,_display_utils.isValidFetchUrl)(n.url)?new e(n):new t(n)}function getDocument(t){"string"==typeof t||t instanceof URL?t={url:t}:(0,_util.isArrayBuffer)(t)&&(t={data:t});if("object"!=typeof t)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const e=new PDFDocumentLoadingTask,{docId:n}=e,i=t.url?getUrlProp(t.url):null,s=t.data?getDataProp(t.data):null,r=t.httpHeaders||null,a=!0===t.withCredentials,o=t.password??null,l=t.range instanceof PDFDataRangeTransport?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let h=t.worker instanceof PDFWorker?t.worker:null;const d=t.verbosity,u="string"!=typeof t.docBaseUrl||(0,_display_utils.isDataScheme)(t.docBaseUrl)?null:t.docBaseUrl,p="string"==typeof t.cMapUrl?t.cMapUrl:null,f=!1!==t.cMapPacked,g=t.CMapReaderFactory||DefaultCMapReaderFactory,m="string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,b=t.StandardFontDataFactory||DefaultStandardFontDataFactory,v=!0!==t.stopAtErrors,y=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,A=!1!==t.isEvalSupported,_="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!_is_node.isNodeJS,S=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,x="boolean"==typeof t.disableFontFace?t.disableFontFace:_is_node.isNodeJS,E=!0===t.fontExtraProperties,C=!0===t.enableXfa,w=t.ownerDocument||globalThis.document,T=!0===t.disableRange,P=!0===t.disableStream,k=!0===t.disableAutoFetch,M=!0===t.pdfBug,R=l?l.length:t.length??NaN,I="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!_is_node.isNodeJS&&!x,D="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&b===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(p,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(m,document.baseURI),O=t.canvasFactory||new DefaultCanvasFactory({ownerDocument:w}),L=t.filterFactory||new DefaultFilterFactory({docId:n,ownerDocument:w});(0,_util.setVerbosityLevel)(d);const N={canvasFactory:O,filterFactory:L};if(!D){N.cMapReaderFactory=new g({baseUrl:p,isCompressed:f});N.standardFontDataFactory=new b({baseUrl:m})}if(!h){const t={verbosity:d,port:_worker_options.GlobalWorkerOptions.workerPort};h=t.port?PDFWorker.fromPort(t):new PDFWorker(t);e._worker=h}const j={docId:n,apiVersion:"3.9.0",data:s,password:o,disableAutoFetch:k,rangeChunkSize:c,length:R,docBaseUrl:u,enableXfa:C,evaluatorOptions:{maxImageSize:y,disableFontFace:x,ignoreErrors:v,isEvalSupported:A,isOffscreenCanvasSupported:_,canvasMaxAreaInBytes:S,fontExtraProperties:E,useSystemFonts:I,cMapUrl:D?p:null,standardFontDataUrl:D?m:null}},B={ignoreErrors:v,isEvalSupported:A,disableFontFace:x,fontExtraProperties:E,enableXfa:C,ownerDocument:w,disableAutoFetch:k,pdfBug:M,styleElement:null};h.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");const t=_fetchDocument(h,j),o=new Promise((function(t){let e;l?e=new _transport_stream.PDFDataTransportStream({length:R,initialData:l.initialData,progressiveDone:l.progressiveDone,contentDispositionFilename:l.contentDispositionFilename,disableRange:T,disableStream:P},l):s||(e=createPDFNetworkStream({url:i,length:R,httpHeaders:r,withCredentials:a,rangeChunkSize:c,disableRange:T,disableStream:P}));t(e)}));return Promise.all([t,o]).then((function(t){let[i,s]=t;if(e.destroyed)throw new Error("Loading aborted");const r=new _message_handler.MessageHandler(n,i,h.port),a=new WorkerTransport(r,e,s,B,N);e._transport=a;r.send("Ready",null)}))})).catch(e._capability.reject);return e}async function _fetchDocument(t,e){if(t.destroyed)throw new Error("Worker was destroyed");const n=await t.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(t.destroyed)throw new Error("Worker was destroyed");return n}function getUrlProp(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(_is_node.isNodeJS&&"string"==typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(t){if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return(0,_util.stringToBytes)(t);if("object"==typeof t&&!isNaN(t?.length)||(0,_util.isArrayBuffer)(t))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}class PDFDocumentLoadingTask{static#e=0;constructor(){this._capability=new _util.PromiseCapability;this._transport=null;this._worker=null;this.docId="d"+PDFDocumentLoadingTask.#e++;this.destroyed=!1;this.onPassword=null;this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;await(this._transport?.destroy());this._transport=null;if(this._worker){this._worker.destroy();this._worker=null}}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t;this.initialData=e;this.progressiveDone=n;this.contentDispositionFilename=i;this._rangeListeners=[];this._progressListeners=[];this._progressiveReadListeners=[];this._progressiveDoneListeners=[];this._readyCapability=new _util.PromiseCapability}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const n of this._rangeListeners)n(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const n of this._progressListeners)n(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t;this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(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()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}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(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}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()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{#n=null;#i=!1;constructor(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._pageIndex=t;this._pageInfo=e;this._transport=n;this._stats=i?new _display_utils.StatTimer:null;this._pdfBug=i;this.commonObjs=n.commonObjs;this.objs=new PDFObjects;this._maybeCleanupAfterRender=!1;this._intentStates=new Map;this.destroyed=!1}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(){let{scale:t,rotation:e=this.rotate,offsetX:n=0,offsetY:i=0,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:n,offsetY:i,dontFlip:s})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render(t){let{canvasContext:e,viewport:n,intent:i="display",annotationMode:s=_util.AnnotationMode.ENABLE,transform:r=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:h=null}=t;this._stats?.time("Overall");const d=this._transport.getRenderingIntent(i,s,h);this.#i=!1;this.#s();o||(o=this._transport.getOptionalContentConfig());let u=this._intentStates.get(d.cacheKey);if(!u){u=Object.create(null);this._intentStates.set(d.cacheKey,u)}if(u.streamReaderCancelTimeout){clearTimeout(u.streamReaderCancelTimeout);u.streamReaderCancelTimeout=null}const p=!!(d.renderingIntent&_util.RenderingIntentFlag.PRINT);if(!u.displayReadyCapability){u.displayReadyCapability=new _util.PromiseCapability;u.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats?.time("Page Request");this._pumpOperatorList(d)}const complete=t=>{u.renderTasks.delete(f);(this._maybeCleanupAfterRender||p)&&(this.#i=!0);this.#r(!p);if(t){f.capability.reject(t);this._abortOperatorList({intentState:u,reason:t instanceof Error?t:new Error(t)})}else f.capability.resolve();this._stats?.timeEnd("Rendering");this._stats?.timeEnd("Overall")},f=new InternalRenderTask({callback:complete,params:{canvasContext:e,viewport:n,transform:r,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:u.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!p,pdfBug:this._pdfBug,pageColors:c});(u.renderTasks||=new Set).add(f);const g=f.task;Promise.all([u.displayReadyCapability.promise,o]).then((t=>{let[e,n]=t;if(this.destroyed)complete();else{this._stats?.time("Rendering");f.initializeGraphics({transparency:e,optionalContentConfig:n});f.operatorListChanged()}})).catch(complete);return g}getOperatorList(){let{intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:n=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=this._transport.getRenderingIntent(t,e,n,!0);let s,r=this._intentStates.get(i.cacheKey);if(!r){r=Object.create(null);this._intentStates.set(i.cacheKey,r)}if(!r.opListReadCapability){s=Object.create(null);s.operatorListChanged=function operatorListChanged(){if(r.operatorList.lastChunk){r.opListReadCapability.resolve(r.operatorList);r.renderTasks.delete(s)}};r.opListReadCapability=new _util.PromiseCapability;(r.renderTasks||=new Set).add(s);r.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats?.time("Page Request");this._pumpOperatorList(i)}return r.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1,disableNormalization:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((t=>_xfa_text.XfaText.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,n){const i=e.getReader(),s={items:[],styles:Object.create(null)};!function pump(){i.read().then((function(e){let{value:n,done:i}=e;if(i)t(s);else{Object.assign(s.styles,n.styles);s.items.push(...n.items);pump()}}),n)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values()){this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0});if(!e.opListReadCapability)for(const n of e.renderTasks){t.push(n.completed);n.cancel()}}this.objs.clear();this.#i=!1;this.#s();return Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#i=!0;const e=this.#r(!1);t&&e&&(this._stats&&=new _display_utils.StatTimer);return e}#r(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#s();if(!this.#i||this.destroyed)return!1;if(t){this.#n=setTimeout((()=>{this.#n=null;this.#r(!1)}),DELAYED_CLEANUP_TIMEOUT);return!1}for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;this._intentStates.clear();this.objs.clear();this.#i=!1;return!0}#s(){if(this.#n){clearTimeout(this.#n);this.#n=null}}_startRenderPage(t,e){const n=this._intentStates.get(e);if(n){this._stats?.timeEnd("Page Request");n.displayReadyCapability?.resolve(t)}}_renderPageChunk(t,e){for(let n=0,i=t.length;n{a.read().then((t=>{let{value:e,done:n}=t;if(n)o.streamReader=null;else if(!this._transport.destroyed){this._renderPageChunk(e,o);pump()}}),(t=>{o.streamReader=null;if(!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const t of o.renderTasks)t.operatorListChanged();this.#r(!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}}))};pump()}_abortOperatorList(t){let{intentState:e,reason:n,force:i=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout){clearTimeout(e.streamReaderCancelTimeout);e.streamReaderCancelTimeout=null}if(!i){if(e.renderTasks.size>0)return;if(n instanceof _display_utils.RenderingCancelledException){let t=RENDERING_CANCELLED_TIMEOUT;n.extraDelay>0&&n.extraDelay<1e3&&(t+=n.extraDelay);e.streamReaderCancelTimeout=setTimeout((()=>{e.streamReaderCancelTimeout=null;this._abortOperatorList({intentState:e,reason:n,force:!0})}),t);return}}e.streamReader.cancel(new _util.AbortException(n.message)).catch((()=>{}));e.streamReader=null;if(!this._transport.destroyed){for(const[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#a=new Set;#o=Promise.resolve();postMessage(t,e){const n={data:structuredClone(t,null)};this.#o.then((()=>{for(const t of this.#a)t.call(this,n)}))}addEventListener(t,e){this.#a.add(e)}removeEventListener(t,e){this.#a.delete(e)}terminate(){this.#a.clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;if(_is_node.isNodeJS&&"function"==typeof require){PDFWorkerUtil.isWorkerDisabled=!0;PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js"}else if("object"==typeof document){const t=document?.currentScript?.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,e){let n;try{n=new URL(t);if(!n.origin||"null"===n.origin)return!1}catch{return!1}const i=new URL(e,n);return n.origin===i.origin};PDFWorkerUtil.createCDNWrapper=function(t){const e=`importScripts("${t}");`;return URL.createObjectURL(new Blob([e]))};class PDFWorker{static#l=new WeakMap;constructor(){let{name:t=null,port:e=null,verbosity:n=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e&&PDFWorker.#l.has(e))throw new Error("Cannot use more than one PDFWorker per port.");this.name=t;this.destroyed=!1;this.verbosity=n;this._readyCapability=new _util.PromiseCapability;this._port=null;this._webWorker=null;this._messageHandler=null;if(e){PDFWorker.#l.set(e,this);this._initializeFromPort(e)}else this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t;this._messageHandler=new _message_handler.MessageHandler("main","worker",t);this._messageHandler.on("ready",(function(){}));this._readyCapability.resolve();this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:t}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t),n=new _message_handler.MessageHandler("main","worker",e),terminateEarly=()=>{e.removeEventListener("error",onWorkerError);n.destroy();e.terminate();this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},onWorkerError=()=>{this._webWorker||terminateEarly()};e.addEventListener("error",onWorkerError);n.on("test",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else if(t){this._messageHandler=n;this._port=e;this._webWorker=e;this._readyCapability.resolve();n.send("configure",{verbosity:this.verbosity})}else{this._setupFakeWorker();n.destroy();e.terminate()}}));n.on("ready",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else try{sendTest()}catch{this._setupFakeWorker()}}));const sendTest=()=>{const t=new Uint8Array;n.send("test",t,[t.buffer])};sendTest();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){if(!PDFWorkerUtil.isWorkerDisabled){(0,_util.warn)("Setting up fake worker.");PDFWorkerUtil.isWorkerDisabled=!0}PDFWorker._setupFakeWorkerGlobal.then((t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const e=new LoopbackPort;this._port=e;const n="fake"+PDFWorkerUtil.fakeWorkerId++,i=new _message_handler.MessageHandler(n+"_worker",n,e);t.setup(i,e);const s=new _message_handler.MessageHandler(n,n+"_worker",e);this._messageHandler=s;this._readyCapability.resolve();s.send("configure",{verbosity:this.verbosity})})).catch((t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){this.destroyed=!0;if(this._webWorker){this._webWorker.terminate();this._webWorker=null}PDFWorker.#l.delete(this._port);this._port=null;if(this._messageHandler){this._messageHandler.destroy();this._messageHandler=null}}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.#l.has(t.port)?this.#l.get(t.port):new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc){_is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.');return PDFWorkerUtil.fallbackWorkerSrc}throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&"function"==typeof require){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}await(0,_display_utils.loadScript)(this.workerSrc);return window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;class WorkerTransport{#c=new Map;#h=new Map;#d=new Map;constructor(t,e,n,i,s){this.messageHandler=t;this.loadingTask=e;this.commonObjs=new PDFObjects;this.fontLoader=new _font_loader.FontLoader({ownerDocument:i.ownerDocument,styleElement:i.styleElement});this._params=i;this.canvasFactory=s.canvasFactory;this.filterFactory=s.filterFactory;this.cMapReaderFactory=s.cMapReaderFactory;this.standardFontDataFactory=s.standardFontDataFactory;this.destroyed=!1;this.destroyCapability=null;this._passwordCapability=null;this._networkStream=n;this._fullReader=null;this._lastProgress=null;this.downloadInfoCapability=new _util.PromiseCapability;this.setupMessageHandler()}#u(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=this.#c.get(t);if(n)return n;const i=this.messageHandler.sendWithPromise(t,e);this.#c.set(t,i);return i}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=_util.RenderingIntentFlag.DISPLAY,r=_annotation_storage.SerializableEmpty;switch(t){case"any":s=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":s=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case _util.AnnotationMode.DISABLE:s+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:s+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:s+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE;r=(s&_util.RenderingIntentFlag.PRINT&&n instanceof _annotation_storage.PrintAnnotationStorage?n:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${e}`)}i&&(s+=_util.RenderingIntentFlag.OPLIST);return{renderingIntent:s,cacheKey:`${s}_${r.hash}`,annotationStorageSerializable:r}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=new _util.PromiseCapability;this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const e of this.#h.values())t.push(e._destroy());this.#h.clear();this.#d.clear();this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);t.push(e);Promise.all(t).then((()=>{this.commonObjs.clear();this.fontLoader.clear();this.#c.clear();this.filterFactory.destroy();this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated."));if(this.messageHandler){this.messageHandler.destroy();this.messageHandler=null}this.destroyCapability.resolve()}),this.destroyCapability.reject);return this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available.");this._fullReader=this._networkStream.getFullReader();this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}};e.onPull=()=>{this._fullReader.read().then((function(t){let{value:n,done:i}=t;if(i)e.close();else{(0,_util.assert)(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(n),1,[n])}})).catch((t=>{e.error(t)}))};e.onCancel=t=>{this._fullReader.cancel(t);e.ready.catch((t=>{if(!this.destroyed)throw t}))}}));t.on("ReaderHeadersReady",(t=>{const n=new _util.PromiseCapability,i=this._fullReader;i.headersReady.then((()=>{if(!i.isStreamingSupported||!i.isRangeSupported){this._lastProgress&&e.onProgress?.(this._lastProgress);i.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}}n.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})}),n.reject);return n.promise}));t.on("GetRangeReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(t.begin,t.end);if(n){e.onPull=()=>{n.read().then((function(t){let{value:n,done:i}=t;if(i)e.close();else{(0,_util.assert)(n instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(n),1,[n])}})).catch((t=>{e.error(t)}))};e.onCancel=t=>{n.cancel(t);e.ready.catch((t=>{if(!this.destroyed)throw t}))}}else e.close()}));t.on("GetDoc",(t=>{let{pdfInfo:n}=t;this._numPages=n.numPages;this._htmlForXfa=n.htmlForXfa;delete n.htmlForXfa;e._capability.resolve(new PDFDocumentProxy(n,this))}));t.on("DocException",(function(t){let n;switch(t.name){case"PasswordException":n=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":n=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":n=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":n=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":n=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}e._capability.reject(n)}));t.on("PasswordRequest",(t=>{this._passwordCapability=new _util.PromiseCapability;if(e.onPassword){const updatePassword=t=>{t instanceof Error?this._passwordCapability.reject(t):this._passwordCapability.resolve({password:t})};try{e.onPassword(updatePassword,t.code)}catch(t){this._passwordCapability.reject(t)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.promise}));t.on("DataLoaded",(t=>{e.onProgress?.({loaded:t.length,total:t.length});this.downloadInfoCapability.resolve(t)}));t.on("StartRenderPage",(t=>{if(this.destroyed)return;this.#h.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}));t.on("commonobj",(e=>{let[n,i,s]=e;if(!this.destroyed&&!this.commonObjs.has(n))switch(i){case"Font":const e=this._params;if("error"in s){const t=s.error;(0,_util.warn)(`Error during font loading: ${t}`);this.commonObjs.resolve(n,t);break}const r=e.pdfBug&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,a=new _font_loader.FontFaceObject(s,{isEvalSupported:e.isEvalSupported,disableFontFace:e.disableFontFace,ignoreErrors:e.ignoreErrors,inspectFont:r});this.fontLoader.bind(a).catch((e=>t.sendWithPromise("FontFallback",{id:n}))).finally((()=>{!e.fontExtraProperties&&a.data&&(a.data=null);this.commonObjs.resolve(n,a)}));break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,s);break;default:throw new Error(`Got unknown common object type ${i}`)}}));t.on("obj",(t=>{let[e,n,i,s]=t;if(this.destroyed)return;const r=this.#h.get(n);if(!r.objs.has(e))switch(i){case"Image":r.objs.resolve(e,s);if(s){let t;if(s.bitmap){const{width:e,height:n}=s;t=e*n*4}else t=s.data?.length||0;t>_util.MAX_IMAGE_SIZE_TO_CACHE&&(r._maybeCleanupAfterRender=!0)}break;case"Pattern":r.objs.resolve(e,s);break;default:throw new Error(`Got unknown object type ${i}`)}}));t.on("DocProgress",(t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})}));t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))));t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfers:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,n=this.#d.get(e);if(n)return n;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((t=>{if(this.destroyed)throw new Error("Transport destroyed");const n=new PDFPageProxy(e,t,this,this._params.pdfBug);this.#h.set(e,n);return n}));this.#d.set(e,i);return i}getPageIndex(t){return"object"!=typeof t||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#u("GetFieldObjects")}hasJSActions(){return this.#u("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?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)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}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(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((t=>new _optional_content_config.OptionalContentConfig(t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=this.#c.get(t);if(e)return e;const n=this.messageHandler.sendWithPromise(t,null).then((t=>({info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})));this.#c.set(t,n);return n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#h.values()){if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`)}this.commonObjs.clear();t||this.fontLoader.clear();this.#c.clear();this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:t,enableXfa:e}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t,enableXfa:e})}}class PDFObjects{#p=Object.create(null);#f(t){const e=this.#p[t];return e||(this.#p[t]={capability:new _util.PromiseCapability,data:null})}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const n=this.#f(t);n.capability.promise.then((()=>e(n.data)));return null}const n=this.#p[t];if(!n?.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return n.data}has(t){const e=this.#p[t];return e?.capability.settled||!1}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=this.#f(t);n.data=e;n.capability.resolve()}clear(){for(const t in this.#p){const{data:e}=this.#p[t];e?.bitmap?.close()}this.#p=Object.create(null)}}class RenderTask{#g=null;constructor(t){this.#g=t;this.onContinue=null}get promise(){return this.#g.capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.#g.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#g.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#g;return t.form||t.canvas&&e?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static#m=new WeakSet;constructor(t){let{callback:e,params:n,objs:i,commonObjs:s,annotationCanvasMap:r,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:u=null}=t;this.callback=e;this.params=n;this.objs=i;this.commonObjs=s;this.annotationCanvasMap=r;this.operatorListIdx=null;this.operatorList=a;this._pageIndex=o;this.canvasFactory=l;this.filterFactory=c;this._pdfBug=d;this.pageColors=u;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===h&&"undefined"!=typeof window;this.cancelled=!1;this.capability=new _util.PromiseCapability;this.task=new RenderTask(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=n.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(t){let{transparency:e=!1,optionalContentConfig:n}=t;if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#m.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.");InternalRenderTask.#m.add(this._canvas)}if(this._pdfBug&&globalThis.StepperManager?.enabled){this.stepper=globalThis.StepperManager.create(this._pageIndex);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}const{canvasContext:i,viewport:s,transform:r,background:a}=this.params;this.gfx=new _canvas.CanvasGraphics(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors);this.gfx.beginDrawing({transform:r,viewport:s,transparency:e,background:a});this.operatorListIdx=0;this.graphicsReady=!0;this.graphicsReadyCallback?.()}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1;this.cancelled=!0;this.gfx?.endDrawing();this._canvas&&InternalRenderTask.#m.delete(this._canvas);this.callback(t||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,e))}operatorListChanged(){if(this.graphicsReady){this.stepper?.updateOperatorList(this.operatorList);this.running||this._continue()}else this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0;this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame((()=>{this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){if(!this.cancelled){this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper);if(this.operatorListIdx===this.operatorList.argsArray.length){this.running=!1;if(this.operatorList.lastChunk){this.gfx.endDrawing(this.pageColors);this._canvas&&InternalRenderTask.#m.delete(this._canvas);this.callback()}}}}}const version="3.9.0";exports.version=version;const build="";exports.build=build},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.SerializableEmpty=e.PrintAnnotationStorage=e.AnnotationStorage=void 0;var i=n(1),s=n(133),r=n(137);const a=Object.freeze({map:null,hash:"",transfers:void 0});e.SerializableEmpty=a;class AnnotationStorage{#b=!1;#v=new Map;constructor(){this.onSetModified=null;this.onResetModified=null;this.onAnnotationEditor=null}getValue(t,e){const n=this.#v.get(t);return void 0===n?e:Object.assign(e,n)}getRawValue(t){return this.#v.get(t)}remove(t){this.#v.delete(t);0===this.#v.size&&this.resetModified();if("function"==typeof this.onAnnotationEditor){for(const t of this.#v.values())if(t instanceof s.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){const n=this.#v.get(t);let i=!1;if(void 0!==n){for(const[t,s]of Object.entries(e))if(n[t]!==s){i=!0;n[t]=s}}else{i=!0;this.#v.set(t,e)}i&&this.#y();e instanceof s.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#v.has(t)}getAll(){return this.#v.size>0?(0,i.objectFromMap)(this.#v):null}setAll(t){for(const[e,n]of Object.entries(t))this.setValue(e,n)}get size(){return this.#v.size}#y(){if(!this.#b){this.#b=!0;"function"==typeof this.onSetModified&&this.onSetModified()}}resetModified(){if(this.#b){this.#b=!1;"function"==typeof this.onResetModified&&this.onResetModified()}}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===this.#v.size)return a;const t=new Map,e=new r.MurmurHash3_64,n=[],i=Object.create(null);let o=!1;for(const[n,r]of this.#v){const a=r instanceof s.AnnotationEditor?r.serialize(!1,i):r;if(a){t.set(n,a);e.update(`${n}:${JSON.stringify(a)}`);o||=!!a.bitmap}}if(o)for(const e of t.values())e.bitmap&&n.push(e.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfers:n}:a}}e.AnnotationStorage=AnnotationStorage;class PrintAnnotationStorage extends AnnotationStorage{#A;constructor(t){super();const{map:e,hash:n,transfers:i}=t.serializable,s=structuredClone(e,null);this.#A={map:s,hash:n,transfers:i}}get print(){(0,i.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#A}}e.PrintAnnotationStorage=PrintAnnotationStorage},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditor=void 0;var i=n(134),s=n(1);class AnnotationEditor{#_=!1;#S=this.focusin.bind(this);#x=this.focusout.bind(this);#E=!1;#C=!1;#w=!1;_uiManager=null;#T=AnnotationEditor._zIndex++;static _colorManager=new i.ColorManager;static _zIndex=1;constructor(t){this.constructor===AnnotationEditor&&(0,s.unreachable)("Cannot initialize AnnotationEditor.");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;const{rotation:e,rawDims:{pageWidth:n,pageHeight:i,pageX:r,pageY:a}}=this.parent.viewport;this.rotation=e;this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360;this.pageDimensions=[n,i];this.pageTranslation=[r,a];const[o,l]=this.parentDimensions;this.x=t.x/o;this.y=t.y/l;this.isAttachedToDOM=!1;this.deleted=!1}static get _defaultLineColor(){return(0,s.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new FakeEditor({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId;e.deleted=!0;e._uiManager.addToAnnotationStorage(e)}static initialize(t){}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}get propertiesToUpdate(){return[]}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#T}setParent(t){if(null!==t){this.pageIndex=t.pageIndex;this.pageDimensions=t.pageDimensions}this.parent=t}focusin(t){this.#E?this.#E=!1:this.parent.setSelected(this)}focusout(t){if(!this.isAttachedToDOM)return;const e=t.relatedTarget;if(!e?.closest(`#${this.id}`)){t.preventDefault();this.parent?.isMultipleSelection||this.commitOrRemove()}}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(t){const e=this.parent.div.getBoundingClientRect();this.startX=t.clientX-e.x;this.startY=t.clientY-e.y;t.dataTransfer.setData("text/plain",this.id);t.dataTransfer.effectAllowed="move"}setAt(t,e,n,i){const[s,r]=this.parentDimensions;[n,i]=this.screenToPageTranslation(n,i);this.x=(t+n)/s;this.y=(e+i)/r;this.div.style.left=100*this.x+"%";this.div.style.top=100*this.y+"%"}translate(t,e){const[n,i]=this.parentDimensions;[t,e]=this.screenToPageTranslation(t,e);this.x+=t/n;this.y+=e/i;this.div.style.left=100*this.x+"%";this.div.style.top=100*this.y+"%"}screenToPageTranslation(t,e){switch(this.parentRotation){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{realScale:t}=this._uiManager.viewParameters,[e,n]=this.pageDimensions;return[e*t,n*t]}setDims(t,e){const[n,i]=this.parentDimensions;this.div.style.width=100*t/n+"%";this.#_||(this.div.style.height=100*e/i+"%")}fixDims(){const{style:t}=this.div,{height:e,width:n}=t,i=n.endsWith("%"),s=!this.#_&&e.endsWith("%");if(i&&s)return;const[r,a]=this.parentDimensions;i||(t.width=100*parseFloat(n)/r+"%");this.#_||s||(t.height=100*parseFloat(e)/a+"%")}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div");this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360);this.div.className=this.name;this.div.setAttribute("id",this.id);this.div.setAttribute("tabIndex",0);this.setInForeground();this.div.addEventListener("focusin",this.#S);this.div.addEventListener("focusout",this.#x);const[t,e]=this.getInitialTranslation();this.translate(t,e);(0,i.bindEvents)(this,this.div,["dragstart","pointerdown"]);return this.div}pointerdown(t){const{isMac:e}=s.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)t.preventDefault();else{t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this);this.#E=!0}}getRect(t,e){const n=this.parentScale,[i,s]=this.pageDimensions,[r,a]=this.pageTranslation,o=t/n,l=e/n,c=this.x*i,h=this.y*s,d=this.width*i,u=this.height*s;switch(this.rotation){case 0:return[c+o+r,s-h-l-u+a,c+o+d+r,s-h-l+a];case 90:return[c+l+r,s-h+o+a,c+l+u+r,s-h+o+d+a];case 180:return[c-o-d+r,s-h+l+a,c-o+r,s-h+l+u+a];case 270:return[c-l-u+r,s-h-o-d+a,c-l+r,s-h-o+a];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[n,i,s,r]=t,a=s-n,o=r-i;switch(this.rotation){case 0:return[n,e-r,a,o];case 90:return[n,e-i,o,a];case 180:return[s,e-i,a,o];case 270:return[s,e-r,o,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#w=!0}disableEditMode(){this.#w=!1}isInEditMode(){return this.#w}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#S);this.div?.addEventListener("focusout",this.#x)}serialize(){(0,s.unreachable)("An editor must be serializable")}static deserialize(t,e,n){const i=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:n});i.rotation=t.rotation;const[s,r]=i.pageDimensions,[a,o,l,c]=i.getRectInCurrentCoords(t.rect,r);i.x=a/s;i.y=o/r;i.width=l/s;i.height=c/r;return i}remove(){this.div.removeEventListener("focusin",this.#S);this.div.removeEventListener("focusout",this.#x);this.isEmpty()||this.commit();this.parent?this.parent.remove(this):this._uiManager.removeEditor(this)}select(){this.div?.classList.add("selectedEditor")}unselect(){this.div?.classList.remove("selectedEditor")}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return this.#C}set isEditing(t){this.#C=t;if(this.parent)if(t){this.parent.setSelected(this);this.parent.setActiveEditor(this)}else this.parent.setActiveEditor(null)}setAspectRatio(t,e){this.#_=!0;const n=t/e,{style:i}=this.div;i.aspectRatio=n;i.height="auto";if(n>=1){i.minHeight="16px";i.minWidth=`${Math.round(16*n)}px`}else{i.minWidth="16px";i.minHeight=`${Math.round(16/n)}px`}}static get MIN_SIZE(){return 16}}e.AnnotationEditor=AnnotationEditor;class FakeEditor extends AnnotationEditor{constructor(t){super(t);this.annotationElementId=t.annotationElementId;this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0;e.bindEvents=function bindEvents(t,e,n){for(const i of n)e.addEventListener(i,t[i].bind(t))};e.opacityToHex=function opacityToHex(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")};var i=n(1),s=n(135);class IdManager{#P=0;getId(){return`${i.AnnotationEditorPrefix}${this.#P++}`}}class ImageManager{#k=(0,i.getUuid)();#P=0;#F=null;async#M(t,e){this.#F||=new Map;let n=this.#F.get(t);if(null===n)return null;if(n?.bitmap){n.refCounter+=1;return n}try{n||={bitmap:null,id:`image_${this.#k}_${this.#P++}`,refCounter:0,isSvg:!1};let t;if("string"==typeof e){n.url=e;const i=await fetch(e);if(!i.ok)throw new Error(i.statusText);t=await i.blob()}else t=n.file=e;if("image/svg+xml"===t.type){const e=new FileReader,i=new Promise((t=>{e.onload=()=>{n.svgUrl=e.result;t()}}));e.readAsDataURL(t);const s=URL.createObjectURL(t);t=new Image;const r=new Promise((e=>{t.onload=()=>{URL.revokeObjectURL(s);n.bitmap=t;n.isSvg=!0;e()}}));t.src=s;await Promise.all([r,i])}else n.bitmap=await createImageBitmap(t);n.refCounter=1}catch(t){console.error(t);n=null}this.#F.set(t,n);n&&this.#F.set(n.id,n);return n}async getFromFile(t){const{lastModified:e,name:n,size:i,type:s}=t;return this.#M(`${e}_${n}_${i}_${s}`,t)}async getFromUrl(t){return this.#M(t,t)}async getFromId(t){this.#F||=new Map;const e=this.#F.get(t);if(!e)return null;if(e.bitmap){e.refCounter+=1;return e}return e.file?this.getFromFile(e.file):this.getFromUrl(e.url)}getSvgUrl(t){const e=this.#F.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#F||=new Map;const e=this.#F.get(t);if(e){e.refCounter-=1;0===e.refCounter&&(e.bitmap=null)}}isValidId(t){return t.startsWith(`image_${this.#k}_`)}}class CommandManager{#R=[];#I=!1;#D;#O=-1;constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;this.#D=t}add(t){let{cmd:e,undo:n,mustExec:i,type:s=NaN,overwriteIfSameType:r=!1,keepUndo:a=!1}=t;i&&e();if(this.#I)return;const o={cmd:e,undo:n,type:s};if(-1===this.#O){this.#R.length>0&&(this.#R.length=0);this.#O=0;this.#R.push(o);return}if(r&&this.#R[this.#O].type===s){a&&(o.undo=this.#R[this.#O].undo);this.#R[this.#O]=o;return}const l=this.#O+1;if(l===this.#D)this.#R.splice(0,1);else{this.#O=l;lt===e[n])))return ColorManager._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?i.Util.makeHexColor(...e):t}}e.ColorManager=ColorManager;class AnnotationEditorUIManager{#N=null;#j=new Map;#B=new Map;#U=null;#H=new CommandManager;#z=0;#W=new Set;#q=null;#G=new Set;#V=null;#X=null;#$=new IdManager;#K=!1;#Y=i.AnnotationEditorType.NONE;#J=new Set;#Q=null;#Z=this.copy.bind(this);#tt=this.cut.bind(this);#et=this.paste.bind(this);#nt=this.keydown.bind(this);#it=this.onEditingAction.bind(this);#st=this.onPageChanging.bind(this);#rt=this.onScaleChanging.bind(this);#at=this.onRotationChanging.bind(this);#ot={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#lt=null;static get _keyboardManager(){return(0,i.shadow)(this,"_keyboardManager",new KeyboardManager([[["ctrl+a","mac+meta+a"],AnnotationEditorUIManager.prototype.selectAll],[["ctrl+z","mac+meta+z"],AnnotationEditorUIManager.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],AnnotationEditorUIManager.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],AnnotationEditorUIManager.prototype.delete],[["Escape","mac+Escape"],AnnotationEditorUIManager.prototype.unselectAll]]))}constructor(t,e,n,i){this.#lt=t;this.#V=e;this.#V._on("editingaction",this.#it);this.#V._on("pagechanging",this.#st);this.#V._on("scalechanging",this.#rt);this.#V._on("rotationchanging",this.#at);this.#U=n.annotationStorage;this.#X=n.filterFactory;this.#Q=i;this.viewParameters={realScale:s.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){this.#ct();this.#V._off("editingaction",this.#it);this.#V._off("pagechanging",this.#st);this.#V._off("scalechanging",this.#rt);this.#V._off("rotationchanging",this.#at);for(const t of this.#B.values())t.destroy();this.#B.clear();this.#j.clear();this.#G.clear();this.#N=null;this.#J.clear();this.#H.destroy()}get hcmFilter(){return(0,i.shadow)(this,"hcmFilter",this.#Q?this.#X.addHCMFilter(this.#Q.foreground,this.#Q.background):"none")}onPageChanging(t){let{pageNumber:e}=t;this.#z=e-1}focusMainContainer(){this.#lt.focus()}addShouldRescale(t){this.#G.add(t)}removeShouldRescale(t){this.#G.delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove();this.viewParameters.realScale=e*s.PixelsPerInch.PDF_TO_CSS_UNITS;for(const t of this.#G)t.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove();this.viewParameters.rotation=e}addToAnnotationStorage(t){t.isEmpty()||!this.#U||this.#U.has(t.id)||this.#U.setValue(t.id,t)}#ht(){this.#lt.addEventListener("keydown",this.#nt)}#ct(){this.#lt.removeEventListener("keydown",this.#nt)}#dt(){document.addEventListener("copy",this.#Z);document.addEventListener("cut",this.#tt);document.addEventListener("paste",this.#et)}#ut(){document.removeEventListener("copy",this.#Z);document.removeEventListener("cut",this.#tt);document.removeEventListener("paste",this.#et)}copy(t){t.preventDefault();this.#N&&this.#N.commitOrRemove();if(!this.hasSelection)return;const e=[];for(const t of this.#J){const n=t.serialize(!0);n&&e.push(n)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t);this.delete()}paste(t){t.preventDefault();let e=t.clipboardData.getData("application/pdfjs");if(!e)return;try{e=JSON.parse(e)}catch(t){(0,i.warn)(`paste: "${t.message}".`);return}if(!Array.isArray(e))return;this.unselectAll();const n=this.#B.get(this.#z);try{const t=[];for(const i of e){const e=n.deserialize(i);if(!e)return;t.push(e)}const cmd=()=>{for(const e of t)this.#pt(e);this.#ft(t)},undo=()=>{for(const e of t)e.remove()};this.addCommands({cmd:cmd,undo:undo,mustExec:!0})}catch(t){(0,i.warn)(`paste: "${t.message}".`)}}keydown(t){this.getActive()?.shouldGetKeyboardEvents()||AnnotationEditorUIManager._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}#gt(t){Object.entries(t).some((t=>{let[e,n]=t;return this.#ot[e]!==n}))&&this.#V.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#ot,t)})}#mt(t){this.#V.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){if(t){this.#ht();this.#dt();this.#gt({isEditing:this.#Y!==i.AnnotationEditorType.NONE,isEmpty:this.#bt(),hasSomethingToUndo:this.#H.hasSomethingToUndo(),hasSomethingToRedo:this.#H.hasSomethingToRedo(),hasSelectedEditor:!1})}else{this.#ct();this.#ut();this.#gt({isEditing:!1})}}registerEditorTypes(t){if(!this.#q){this.#q=t;for(const t of this.#q)this.#mt(t.defaultPropertiesToUpdate)}}getId(){return this.#$.getId()}get currentLayer(){return this.#B.get(this.#z)}get currentPageIndex(){return this.#z}addLayer(t){this.#B.set(t.pageIndex,t);this.#K?t.enable():t.disable()}removeLayer(t){this.#B.delete(t.pageIndex)}updateMode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.#Y=t;if(t!==i.AnnotationEditorType.NONE){this.setEditingState(!0);this.#vt();for(const e of this.#B.values())e.updateMode(t);if(e)for(const t of this.#j.values())if(t.annotationElementId===e){this.setSelected(t);t.enterInEditMode();break}}else{this.setEditingState(!1);this.#yt()}}updateToolbar(t){t!==this.#Y&&this.#V.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#q){for(const n of this.#J)n.updateParams(t,e);for(const n of this.#q)n.updateDefaultParams(t,e)}}#vt(){if(!this.#K){this.#K=!0;for(const t of this.#B.values())t.enable()}}#yt(){this.unselectAll();if(this.#K){this.#K=!1;for(const t of this.#B.values())t.disable()}}getEditors(t){const e=[];for(const n of this.#j.values())n.pageIndex===t&&e.push(n);return e}getEditor(t){return this.#j.get(t)}addEditor(t){this.#j.set(t.id,t)}removeEditor(t){this.#j.delete(t.id);this.unselect(t);t.annotationElementId&&this.#W.has(t.annotationElementId)||this.#U?.remove(t.id)}addDeletedAnnotationElement(t){this.#W.add(t.annotationElementId);t.deleted=!0}isDeletedAnnotationElement(t){return this.#W.has(t)}removeDeletedAnnotationElement(t){this.#W.delete(t.annotationElementId);t.deleted=!1}#pt(t){const e=this.#B.get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}setActiveEditor(t){if(this.#N!==t){this.#N=t;t&&this.#mt(t.propertiesToUpdate)}}toggleSelected(t){if(this.#J.has(t)){this.#J.delete(t);t.unselect();this.#gt({hasSelectedEditor:this.hasSelection})}else{this.#J.add(t);t.select();this.#mt(t.propertiesToUpdate);this.#gt({hasSelectedEditor:!0})}}setSelected(t){for(const e of this.#J)e!==t&&e.unselect();this.#J.clear();this.#J.add(t);t.select();this.#mt(t.propertiesToUpdate);this.#gt({hasSelectedEditor:!0})}isSelected(t){return this.#J.has(t)}unselect(t){t.unselect();this.#J.delete(t);this.#gt({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#J.size}undo(){this.#H.undo();this.#gt({hasSomethingToUndo:this.#H.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#bt()})}redo(){this.#H.redo();this.#gt({hasSomethingToUndo:!0,hasSomethingToRedo:this.#H.hasSomethingToRedo(),isEmpty:this.#bt()})}addCommands(t){this.#H.add(t);this.#gt({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#bt()})}#bt(){if(0===this.#j.size)return!0;if(1===this.#j.size)for(const t of this.#j.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();if(!this.hasSelection)return;const t=[...this.#J];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)this.#pt(e)},mustExec:!0})}commitOrRemove(){this.#N?.commitOrRemove()}#ft(t){this.#J.clear();for(const e of t)if(!e.isEmpty()){this.#J.add(e);e.select()}this.#gt({hasSelectedEditor:!0})}selectAll(){for(const t of this.#J)t.commit();this.#ft(this.#j.values())}unselectAll(){if(this.#N)this.#N.commitOrRemove();else if(0!==this.#J.size){for(const t of this.#J)t.unselect();this.#J.clear();this.#gt({hasSelectedEditor:!1})}}isActive(t){return this.#N===t}getActive(){return this.#N}getMode(){return this.#Y}get imageManager(){return(0,i.shadow)(this,"imageManager",new ImageManager)}}e.AnnotationEditorUIManager=AnnotationEditorUIManager},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMFilterFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=e.AnnotationPrefix=void 0;e.deprecated=function deprecated(t){console.log("Deprecated API usage: "+t)};e.getColorValues=function getColorValues(t){const e=document.createElement("span");e.style.visibility="hidden";document.body.append(e);for(const n of t.keys()){e.style.color=n;const i=window.getComputedStyle(e).color;t.set(n,getRGB(i))}e.remove()};e.getCurrentTransform=function getCurrentTransform(t){const{a:e,b:n,c:i,d:s,e:r,f:a}=t.getTransform();return[e,n,i,s,r,a]};e.getCurrentTransformInverse=function getCurrentTransformInverse(t){const{a:e,b:n,c:i,d:s,e:r,f:a}=t.getTransform().invertSelf();return[e,n,i,s,r,a]};e.getFilenameFromUrl=function getFilenameFromUrl(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1]||([t]=t.split(/[#?]/,1));return t.substring(t.lastIndexOf("/")+1)};e.getPdfFilenameFromUrl=function getPdfFilenameFromUrl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof t)return e;if(isDataScheme(t)){(0,s.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');return e}const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let r=n.exec(i[1])||n.exec(i[2])||n.exec(i[3]);if(r){r=r[0];if(r.includes("%"))try{r=n.exec(decodeURIComponent(r))[0]}catch{}}return r||e};e.getRGB=getRGB;e.getXfaPageViewport=function getXfaPageViewport(t,e){let{scale:n=1,rotation:i=0}=e;const{width:s,height:r}=t.attributes.style,a=[0,0,parseInt(s),parseInt(r)];return new PageViewport({viewBox:a,scale:n,rotation:i})};e.isDataScheme=isDataScheme;e.isPdfFile=function isPdfFile(t){return"string"==typeof t&&/\.pdf$/i.test(t)};e.isValidFetchUrl=isValidFetchUrl;e.loadScript=function loadScript(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise(((n,i)=>{const s=document.createElement("script");s.src=t;s.onload=function(t){e&&s.remove();n(t)};s.onerror=function(){i(new Error(`Cannot load script at: ${s.src}`))};(document.head||document.documentElement).append(s)}))};e.setLayerDimensions=function setLayerDimensions(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof PageViewport){const{pageWidth:i,pageHeight:s}=e.rawDims,{style:r}=t,a=`calc(var(--scale-factor) * ${i}px)`,o=`calc(var(--scale-factor) * ${s}px)`;if(n&&e.rotation%180!=0){r.width=o;r.height=a}else{r.width=a;r.height=o}}i&&t.setAttribute("data-main-rotation",e.rotation)};var i=n(136),s=n(1);const r="http://www.w3.org/2000/svg";e.AnnotationPrefix="pdfjs_internal_id_";class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}e.PixelsPerInch=PixelsPerInch;class DOMFilterFactory extends i.BaseFilterFactory{#At;#_t;#e;#St;#xt;#Et;#Ct;#wt;#Tt;#Pt;#P=0;constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();this.#e=t;this.#St=e}get#F(){return this.#At||=new Map}get#kt(){if(!this.#_t){const t=this.#St.createElement("div"),{style:e}=t;e.visibility="hidden";e.contain="strict";e.width=e.height=0;e.position="absolute";e.top=e.left=0;e.zIndex=-1;const n=this.#St.createElementNS(r,"svg");n.setAttribute("width",0);n.setAttribute("height",0);this.#_t=this.#St.createElementNS(r,"defs");t.append(n);n.append(this.#_t);this.#St.body.append(t)}return this.#_t}addFilter(t){if(!t)return"none";let e,n,i,s,r=this.#F.get(t);if(r)return r;if(1===t.length){const r=t[0],a=new Array(256);for(let t=0;t<256;t++)a[t]=r[t]/255;s=e=n=i=a.join(",")}else{const[r,a,o]=t,l=new Array(256),c=new Array(256),h=new Array(256);for(let t=0;t<256;t++){l[t]=r[t]/255;c[t]=a[t]/255;h[t]=o[t]/255}e=l.join(",");n=c.join(",");i=h.join(",");s=`${e}${n}${i}`}r=this.#F.get(s);if(r){this.#F.set(t,r);return r}const a=`g_${this.#e}_transfer_map_${this.#P++}`,o=`url(#${a})`;this.#F.set(t,o);this.#F.set(s,o);const l=this.#Ft(a);this.#Mt(e,n,i,l);return o}addHCMFilter(t,e){const n=`${t}-${e}`;if(this.#Et===n)return this.#Ct;this.#Et=n;this.#Ct="none";this.#xt?.remove();if(!t||!e)return this.#Ct;const i=this.#Rt(t);t=s.Util.makeHexColor(...i);const r=this.#Rt(e);e=s.Util.makeHexColor(...r);this.#kt.style.color="";if("#000000"===t&&"#ffffff"===e||t===e)return this.#Ct;const a=new Array(256);for(let t=0;t<=255;t++){const e=t/255;a[t]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}const o=a.join(","),l=`g_${this.#e}_hcm_filter`,c=this.#wt=this.#Ft(l);this.#Mt(o,o,o,c);this.#It(c);const getSteps=(t,e)=>{const n=i[t]/255,s=r[t]/255,a=new Array(e+1);for(let t=0;t<=e;t++)a[t]=n+t/e*(s-n);return a.join(",")};this.#Mt(getSteps(0,5),getSteps(1,5),getSteps(2,5),c);this.#Ct=`url(#${l})`;return this.#Ct}addHighlightHCMFilter(t,e,n,i){const s=`${t}-${e}-${n}-${i}`;if(this.#Tt===s)return this.#Pt;this.#Tt=s;this.#Pt="none";this.#wt?.remove();if(!t||!e)return this.#Pt;const[r,a]=[t,e].map(this.#Rt.bind(this));let o=Math.round(.2126*r[0]+.7152*r[1]+.0722*r[2]),l=Math.round(.2126*a[0]+.7152*a[1]+.0722*a[2]),[c,h]=[n,i].map(this.#Rt.bind(this));l{const i=new Array(256),s=(l-o)/n,r=t/255,a=(e-t)/(255*n);let c=0;for(let t=0;t<=n;t++){const e=Math.round(o+t*s),n=r+t*a;for(let t=c;t<=e;t++)i[t]=n;c=e+1}for(let t=c;t<256;t++)i[t]=i[c-1];return i.join(",")},d=`g_${this.#e}_hcm_highlight_filter`,u=this.#wt=this.#Ft(d);this.#It(u);this.#Mt(getSteps(c[0],h[0],5),getSteps(c[1],h[1],5),getSteps(c[2],h[2],5),u);this.#Pt=`url(#${d})`;return this.#Pt}destroy(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])||!this.#Ct&&!this.#Pt){if(this.#_t){this.#_t.parentNode.parentNode.remove();this.#_t=null}if(this.#At){this.#At.clear();this.#At=null}this.#P=0}}#It(t){const e=this.#St.createElementNS(r,"feColorMatrix");e.setAttribute("type","matrix");e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0");t.append(e)}#Ft(t){const e=this.#St.createElementNS(r,"filter");e.setAttribute("color-interpolation-filters","sRGB");e.setAttribute("id",t);this.#kt.append(e);return e}#Dt(t,e,n){const i=this.#St.createElementNS(r,e);i.setAttribute("type","discrete");i.setAttribute("tableValues",n);t.append(i)}#Mt(t,e,n,i){const s=this.#St.createElementNS(r,"feComponentTransfer");i.append(s);this.#Dt(s,"feFuncR",t);this.#Dt(s,"feFuncG",e);this.#Dt(s,"feFuncB",n)}#Rt(t){this.#kt.style.color=t;return getRGB(getComputedStyle(this.#kt).getPropertyValue("color"))}}e.DOMFilterFactory=DOMFilterFactory;class DOMCanvasFactory extends i.BaseCanvasFactory{constructor(){let{ownerDocument:t=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();this._document=t}_createCanvas(t,e){if(t*e>16777216){t*=.8;e*=.8}const n=this._document.createElement("canvas");n.width=t;n.height=e;return n}}e.DOMCanvasFactory=DOMCanvasFactory;async function fetchData(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(isValidFetchUrl(t,document.baseURI)){const n=await fetch(t);if(!n.ok)throw new Error(n.statusText);return e?new Uint8Array(await n.arrayBuffer()):(0,s.stringToBytes)(await n.text())}return new Promise(((n,i)=>{const r=new XMLHttpRequest;r.open("GET",t,!0);e&&(r.responseType="arraybuffer");r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(200===r.status||0===r.status){let t;e&&r.response?t=new Uint8Array(r.response):!e&&r.responseText&&(t=(0,s.stringToBytes)(r.responseText));if(t){n(t);return}}i(new Error(r.statusText))}};r.send(null)}))}class DOMCMapReaderFactory extends i.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t,this.isCompressed).then((t=>({cMapData:t,compressionType:e})))}}e.DOMCMapReaderFactory=DOMCMapReaderFactory;class DOMStandardFontDataFactory extends i.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t,!0)}}e.DOMStandardFontDataFactory=DOMStandardFontDataFactory;class DOMSVGFactory extends i.BaseSVGFactory{_createSVG(t){return document.createElementNS(r,t)}}e.DOMSVGFactory=DOMSVGFactory;class PageViewport{constructor(t){let{viewBox:e,scale:n,rotation:i,offsetX:s=0,offsetY:r=0,dontFlip:a=!1}=t;this.viewBox=e;this.scale=n;this.rotation=i;this.offsetX=s;this.offsetY=r;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,h,d,u,p,f,g,m;i%=360;i<0&&(i+=360);switch(i){case 180:c=-1;h=0;d=0;u=1;break;case 90:c=0;h=1;d=1;u=0;break;case 270:c=0;h=-1;d=-1;u=0;break;case 0:c=1;h=0;d=0;u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(a){d=-d;u=-u}if(0===c){p=Math.abs(l-e[1])*n+s;f=Math.abs(o-e[0])*n+r;g=(e[3]-e[1])*n;m=(e[2]-e[0])*n}else{p=Math.abs(o-e[0])*n+s;f=Math.abs(l-e[1])*n+r;g=(e[2]-e[0])*n;m=(e[3]-e[1])*n}this.transform=[c*n,h*n,d*n,u*n,p-c*n*o-d*n*l,f-h*n*o-u*n*l];this.width=g;this.height=m}get rawDims(){const{viewBox:t}=this;return(0,s.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:n=this.offsetX,offsetY:i=this.offsetY,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new PageViewport({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:n,offsetY:i,dontFlip:s})}convertToViewportPoint(t,e){return s.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=s.Util.applyTransform([t[0],t[1]],this.transform),n=s.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],n[0],n[1]]}convertToPdfPoint(t,e){return s.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=PageViewport;class RenderingCancelledException extends s.BaseException{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException");this.extraDelay=e}}e.RenderingCancelledException=RenderingCancelledException;function isDataScheme(t){const e=t.length;let n=0;for(;n=1&&i<=12?i-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let r=parseInt(e[4],10);r=r>=0&&r<=23?r:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const c=e[7]||"Z";let h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let d=parseInt(e[9],10)||0;d=d>=0&&d<=59?d:0;if("-"===c){r+=h;o+=d}else if("+"===c){r-=h;o-=d}return new Date(Date.UTC(n,i,s,r,o,l))}};function getRGB(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}if(t.startsWith("rgb("))return t.slice(4,-1).split(",").map((t=>parseInt(t)));if(t.startsWith("rgba("))return t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3);(0,s.warn)(`Not a valid color format: "${t}"`);return[0,0,0]}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseFilterFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;var i=n(1);class BaseFilterFactory{constructor(){this.constructor===BaseFilterFactory&&(0,i.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addHighlightHCMFilter(t,e,n,i){return"none"}destroy(){}}e.BaseFilterFactory=BaseFilterFactory;class BaseCanvasFactory{constructor(){this.constructor===BaseCanvasFactory&&(0,i.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");if(t*e>16777216){t*=.8;e*=.8}const n=this._createCanvas(t,e);return{canvas:n,context:n.getContext("2d")}}reset(t,e,n){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||n<=0)throw new Error("Invalid canvas size");if(e*n>16777216){e*=.8;n*=.8}t.canvas.width=e;t.canvas.height=n}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){(0,i.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=BaseCanvasFactory;class BaseCMapReaderFactory{constructor(t){let{baseUrl:e=null,isCompressed:n=!0}=t;this.constructor===BaseCMapReaderFactory&&(0,i.unreachable)("Cannot initialize BaseCMapReaderFactory.");this.baseUrl=e;this.isCompressed=n}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const n=this.baseUrl+e+(this.isCompressed?".bcmap":""),s=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE;return this._fetchData(n,s).catch((t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${n}`)}))}_fetchData(t,e){(0,i.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=BaseCMapReaderFactory;class BaseStandardFontDataFactory{constructor(t){let{baseUrl:e=null}=t;this.constructor===BaseStandardFontDataFactory&&(0,i.unreachable)("Cannot initialize BaseStandardFontDataFactory.");this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const n=`${this.baseUrl}${e}`;return this._fetchData(n).catch((t=>{throw new Error(`Unable to load font data at: ${n}`)}))}_fetchData(t){(0,i.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=BaseStandardFontDataFactory;class BaseSVGFactory{constructor(){this.constructor===BaseSVGFactory&&(0,i.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");i.setAttribute("version","1.1");if(!n){i.setAttribute("width",`${t}px`);i.setAttribute("height",`${e}px`)}i.setAttribute("preserveAspectRatio","none");i.setAttribute("viewBox",`0 0 ${t} ${e}`);return i}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,i.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=BaseSVGFactory},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.MurmurHash3_64=void 0;var i=n(1);const s=3285377520,r=4294901760,a=65535;e.MurmurHash3_64=class MurmurHash3_64{constructor(t){this.h1=t?4294967295&t:s;this.h2=t?4294967295&t:s}update(t){let e,n;if("string"==typeof t){e=new Uint8Array(2*t.length);n=0;for(let i=0,s=t.length;i>>8;e[n++]=255&s}}}else{if(!(0,i.isArrayBuffer)(t))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");e=t.slice();n=e.byteLength}const s=n>>2,o=n-4*s,l=new Uint32Array(e.buffer,0,s);let c=0,h=0,d=this.h1,u=this.h2;const p=3432918353,f=461845907,g=11601,m=13715;for(let t=0;t>>17;c=c*f&r|c*m&a;d^=c;d=d<<13|d>>>19;d=5*d+3864292196}else{h=l[t];h=h*p&r|h*g&a;h=h<<15|h>>>17;h=h*f&r|h*m&a;u^=h;u=u<<13|u>>>19;u=5*u+3864292196}c=0;switch(o){case 3:c^=e[4*s+2]<<16;case 2:c^=e[4*s+1]<<8;case 1:c^=e[4*s];c=c*p&r|c*g&a;c=c<<15|c>>>17;c=c*f&r|c*m&a;1&s?d^=c:u^=c}this.h1=d;this.h2=u}hexdigest(){let t=this.h1,e=this.h2;t^=e>>>1;t=3981806797*t&r|36045*t&a;e=4283543511*e&r|(2950163797*(e<<16|t>>>16)&r)>>>16;t^=e>>>1;t=444984403*t&r|60499*t&a;e=3301882366*e&r|(3120437893*(e<<16|t>>>16)&r)>>>16;t^=e>>>1;return(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.FontLoader=e.FontFaceObject=void 0;var i=n(1),s=n(3);e.FontLoader=class FontLoader{#Ot=new Set;constructor(t){let{ownerDocument:e=globalThis.document,styleElement:n=null}=t;this._document=e;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){if(!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();this.#Ot.clear();if(this.styleElement){this.styleElement.remove();this.styleElement=null}}async loadSystemFont(t){if(t&&!this.#Ot.has(t.loadedName)){(0,i.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set.");if(this.isFontLoadingAPISupported){const{loadedName:e,src:n,style:s}=t,r=new FontFace(e,n,s);this.addNativeFontFace(r);try{await r.load();this.#Ot.add(e)}catch{(0,i.warn)(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`);this.removeNativeFontFace(r)}}else(0,i.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;t.attached=!0;if(t.systemFontInfo){await this.loadSystemFont(t.systemFontInfo);return}if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(n){(0,i.warn)(`Failed to load font '${e.family}': '${n}'.`);t.disableFontFace=!0;throw n}}return}const e=t.createFontFaceRule();if(e){this.insertRule(e);if(this.isSyncFontLoadingSupported)return;await new Promise((e=>{const n=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,n)}))}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return(0,i.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;(s.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0);return(0,i.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,n={done:!1,complete:function completeRequest(){(0,i.assert)(!n.done,"completeRequest() cannot be called twice.");n.done=!0;for(;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};e.push(n);return n}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,i.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function int32(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function spliceString(t,e,n,i){return t.substring(0,e)+i+t.substring(e+n)}let n,s;const r=this._document.createElement("canvas");r.width=1;r.height=1;const a=r.getContext("2d");let o=0;const l=`lt${Date.now()}${this.loadTestFontId++}`;let c=this._loadTestFont;c=spliceString(c,976,l.length,l);const h=1482184792;let d=int32(c,16);for(n=0,s=l.length-3;n30){(0,i.warn)("Load test font never loaded.");e();return}a.font="30px "+t;a.fillText(".",0,20);a.getImageData(0,0,1,1).data[3]>0?e():setTimeout(isFontReady.bind(null,t,e))}(l,(()=>{p.remove();e.complete()}))}};e.FontFaceObject=class FontFaceObject{constructor(t,e){let{isEvalSupported:n=!0,disableFontFace:i=!1,ignoreErrors:s=!1,inspectFont:r=null}=e;this.compiledGlyphs=Object.create(null);for(const e in t)this[e]=t[e];this.isEvalSupported=!1!==n;this.disableFontFace=!0===i;this.ignoreErrors=!0===s;this._inspectFont=r}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`);t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});this._inspectFont?.(this);return t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=(0,i.bytesToString)(this.data),e=`url(data:${this.mimetype};base64,${btoa(t)});`;let n;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`);n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else n=`@font-face {font-family:"${this.loadedName}";src:${e}}`;this._inspectFont?.(this,e);return n}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let n;try{n=t.get(this.loadedName+"_path_"+e)}catch(t){if(!this.ignoreErrors)throw t;(0,i.warn)(`getPathGenerator - ignoring character: "${t}".`);return this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&i.FeatureTest.isEvalSupported){const t=[];for(const e of n){const n=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",n,");\n")}return this.compiledGlyphs[e]=new Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(const i of n){"scale"===i.cmd&&(i.args=[e,-e]);t[i.cmd].apply(t,i.args)}}}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.CanvasGraphics=void 0;var i=n(1),s=n(135),r=n(140),a=n(141),o=n(3);const l=4096,c=16;class CachedCanvases{constructor(t){this.canvasFactory=t;this.cache=Object.create(null)}getCanvas(t,e,n){let i;if(void 0!==this.cache[t]){i=this.cache[t];this.canvasFactory.reset(i,e,n)}else{i=this.canvasFactory.create(e,n);this.cache[t]=i}return i}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 drawImageAtIntegerCoords(t,e,n,i,r,a,o,l,c,h){const[d,u,p,f,g,m]=(0,s.getCurrentTransform)(t);if(0===u&&0===p){const s=o*d+g,b=Math.round(s),v=l*f+m,y=Math.round(v),A=(o+c)*d+g,_=Math.abs(Math.round(A)-b)||1,S=(l+h)*f+m,x=Math.abs(Math.round(S)-y)||1;t.setTransform(Math.sign(d),0,0,Math.sign(f),b,y);t.drawImage(e,n,i,r,a,0,0,_,x);t.setTransform(d,u,p,f,g,m);return[_,x]}if(0===d&&0===f){const s=l*p+g,b=Math.round(s),v=o*u+m,y=Math.round(v),A=(l+h)*p+g,_=Math.abs(Math.round(A)-b)||1,S=(o+c)*u+m,x=Math.abs(Math.round(S)-y)||1;t.setTransform(0,Math.sign(u),Math.sign(p),0,b,y);t.drawImage(e,n,i,r,a,0,0,x,_);t.setTransform(d,u,p,f,g,m);return[x,_]}t.drawImage(e,n,i,r,a,o,l,c,h);return[Math.hypot(d,u)*c,Math.hypot(p,f)*h]}class CanvasExtraState{constructor(t,e){this.alphaIsShape=!1;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=i.IDENTITY_MATRIX;this.textMatrixScale=1;this.fontMatrix=i.FONT_IDENTITY_MATRIX;this.leading=0;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRenderingMode=i.TextRenderingMode.FILL;this.textRise=0;this.fillColor="#000000";this.strokeColor="#000000";this.patternFill=!1;this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.activeSMask=null;this.transferMaps="none";this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);t.clipBox=this.clipBox.slice();return t}setCurrentPoint(t,e){this.x=t;this.y=e}updatePathMinMax(t,e,n){[e,n]=i.Util.applyTransform([e,n],t);this.minX=Math.min(this.minX,e);this.minY=Math.min(this.minY,n);this.maxX=Math.max(this.maxX,e);this.maxY=Math.max(this.maxY,n)}updateRectMinMax(t,e){const n=i.Util.applyTransform(e,t),s=i.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,n[0],s[0]);this.minY=Math.min(this.minY,n[1],s[1]);this.maxX=Math.max(this.maxX,n[0],s[0]);this.maxY=Math.max(this.maxY,n[1],s[1])}updateScalingPathMinMax(t,e){i.Util.scaleMinMax(t,e);this.minX=Math.min(this.minX,e[0]);this.maxX=Math.max(this.maxX,e[1]);this.minY=Math.min(this.minY,e[2]);this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,n,s,r,a,o,l,c,h){const d=i.Util.bezierBoundingBox(e,n,s,r,a,o,l,c);if(h){h[0]=Math.min(h[0],d[0],d[2]);h[1]=Math.max(h[1],d[0],d[2]);h[2]=Math.min(h[2],d[1],d[3]);h[3]=Math.max(h[3],d[1],d[3])}else this.updateRectMinMax(t,d)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[this.minX,this.minY,this.maxX,this.maxY];if(t===r.PathType.STROKE){e||(0,i.unreachable)("Stroke bounding box must include transform.");const t=i.Util.singularValueDecompose2dScale(e),s=t[0]*this.lineWidth/2,r=t[1]*this.lineWidth/2;n[0]-=s;n[1]-=r;n[2]+=s;n[3]+=r}return n}updateClipFromPath(){const t=i.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t;this.minX=1/0;this.minY=1/0;this.maxX=0;this.maxY=0}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return i.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function putBinaryImageData(t,e){if("undefined"!=typeof ImageData&&e instanceof ImageData){t.putImageData(e,0,0);return}const n=e.height,s=e.width,r=n%c,a=(n-r)/c,o=0===r?a:a+1,l=t.createImageData(s,c);let h,d=0;const u=e.data,p=l.data;let f,g,m,b;if(e.kind===i.ImageKind.GRAYSCALE_1BPP){const e=u.byteLength,n=new Uint32Array(p.buffer,0,p.byteLength>>2),b=n.length,v=s+7>>3,y=4294967295,A=i.FeatureTest.isLittleEndian?4278190080:255;for(f=0;fv?s:8*t-7,a=-8&r;let o=0,l=0;for(;i>=1}}for(;h=a){m=r;b=s*m}h=0;for(g=b;g--;){p[h++]=u[d++];p[h++]=u[d++];p[h++]=u[d++];p[h++]=255}t.putImageData(l,0,f*c)}}}function putBinaryImageMask(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const n=e.height,i=e.width,s=n%c,r=(n-s)/c,o=0===s?r:r+1,l=t.createImageData(i,c);let h=0;const d=e.data,u=l.data;for(let e=0;e>8;t[r-2]=t[r-2]*s+n*a>>8;t[r-1]=t[r-1]*s+i*a>>8}}}function composeSMaskAlpha(t,e,n){const i=t.length;for(let s=3;s>8]>>8:e[s]*i>>16}}function composeSMask(t,e,n,i){const s=i[0],r=i[1],a=i[2]-s,o=i[3]-r;if(0!==a&&0!==o){!function genericComposeSMask(t,e,n,i,s,r,a,o,l,c,h){const d=!!r,u=d?r[0]:0,p=d?r[1]:0,f=d?r[2]:0;let g;g="Luminosity"===s?composeSMaskLuminosity:composeSMaskAlpha;const m=Math.min(i,Math.ceil(1048576/n));for(let s=0;s1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing(t){let{transform:e,viewport:n,transparency:i=!1,background:r=null}=t,a=this.ctx.canvas.width,o=this.ctx.canvas.height;if(a*o>16777216){a*=.8;o*=.8}const l=this.ctx.fillStyle;this.ctx.fillStyle=r||"#ffffff";this.ctx.fillRect(0,0,a,o);this.ctx.fillStyle=l;if(i){const t=this.cachedCanvases.getCanvas("transparent",a,o);this.compositeCtx=this.ctx;this.transparentCanvas=t.canvas;this.ctx=t.context;this.ctx.save();this.ctx.transform(...(0,s.getCurrentTransform)(this.compositeCtx))}this.ctx.save();resetCtxToDefault(this.ctx);if(e){this.ctx.transform(...e);this.outputScaleX=e[0];this.outputScaleY=e[0]}this.ctx.transform(...n.transform);this.viewportScale=n.scale;this.baseTransform=(0,s.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,n,s){const r=t.argsArray,a=t.fnArray;let o=e||0;const l=r.length;if(l===o)return o;const c=l-o>10&&"function"==typeof n,h=c?Date.now()+15:0;let d=0;const u=this.commonObjs,p=this.objs;let f;for(;;){if(void 0!==s&&o===s.nextBreakPoint){s.breakIt(o,n);return o}f=a[o];if(f!==i.OPS.dependency)this[f].apply(this,r[o]);else for(const t of r[o]){const e=t.startsWith("g_")?u:p;if(!e.has(t)){e.get(t,n);return o}}o++;if(o===l)return o;if(c&&++d>10){if(Date.now()>h){n();return o}d=0}}}#Lt(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore();if(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}}endDrawing(){this.#Lt();this.cachedCanvases.clear();this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear();this.#Nt()}#Nt(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t;this.ctx.drawImage(this.ctx.canvas,0,0);this.ctx.filter=e}}}_scaleImage(t,e){const n=t.width,i=t.height;let s,r,a=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=n,c=i,h="prescale1";for(;a>2&&l>1||o>2&&c>1;){let e=l,n=c;if(a>2&&l>1){e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2);a/=l/e}if(o>2&&c>1){n=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2;o/=c/n}s=this.cachedCanvases.getCanvas(h,e,n);r=s.context;r.clearRect(0,0,e,n);r.drawImage(t,0,0,l,c,0,0,e,n);t=s.canvas;l=e;c=n;h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx;let n=t.width,a=t.height;if(n*a>16777216){n*=.8;a*=.8}const o=this.current.fillColor,l=this.current.patternFill,c=(0,s.getCurrentTransform)(e);let h,d,u,p;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;d=JSON.stringify(l?c:[c.slice(0,4),o]);h=this._cachedBitmapsMap.get(e);if(!h){h=new Map;this._cachedBitmapsMap.set(e,h)}const n=h.get(d);if(n&&!l){return{canvas:n,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])}}u=n}if(!u){p=this.cachedCanvases.getCanvas("maskCanvas",n,a);putBinaryImageMask(p.context,t)}let f=i.Util.transform(c,[1/n,0,0,-1/a,0,0]);f=i.Util.transform(f,[1,0,0,1,0,-a]);const g=i.Util.applyTransform([0,0],f),m=i.Util.applyTransform([n,a],f),b=i.Util.normalizeRect([g[0],g[1],m[0],m[1]]),v=Math.round(b[2]-b[0])||1,y=Math.round(b[3]-b[1])||1,A=this.cachedCanvases.getCanvas("fillCanvas",v,y),_=A.context,S=Math.min(g[0],m[0]),x=Math.min(g[1],m[1]);_.translate(-S,-x);_.transform(...f);if(!u){u=this._scaleImage(p.canvas,(0,s.getCurrentTransformInverse)(_));u=u.img;h&&l&&h.set(d,u)}_.imageSmoothingEnabled=getImageSmoothingEnabled((0,s.getCurrentTransform)(_),t.interpolate);drawImageAtIntegerCoords(_,u,0,0,u.width,u.height,0,0,n,a);_.globalCompositeOperation="source-in";const E=i.Util.transform((0,s.getCurrentTransformInverse)(_),[1,0,0,1,-S,-x]);_.fillStyle=l?o.getPattern(e,this,E,r.PathType.FILL):o;_.fillRect(0,0,n,a);if(h&&!l){this.cachedCanvases.delete("fillCanvas");h.set(d,A.canvas)}return{canvas:A.canvas,offsetX:Math.round(S),offsetY:Math.round(x)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1);this.current.lineWidth=t;this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=h[t]}setLineJoin(t){this.ctx.lineJoin=d[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const n=this.ctx;if(void 0!==n.setLineDash){n.setLineDash(t);n.lineDashOffset=e}}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,n]of t)switch(e){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n;this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null;this.tempSMask=null;this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(n,t,e);this.suspendedCtx=this.ctx;this.ctx=i.context;const r=this.ctx;r.setTransform(...(0,s.getCurrentTransform)(this.suspendedCtx));copyCtxState(this.suspendedCtx,r);!function mirrorContextOperations(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save;t.__originalRestore=t.restore;t.__originalRotate=t.rotate;t.__originalScale=t.scale;t.__originalTranslate=t.translate;t.__originalTransform=t.transform;t.__originalSetTransform=t.setTransform;t.__originalResetTransform=t.resetTransform;t.__originalClip=t.clip;t.__originalMoveTo=t.moveTo;t.__originalLineTo=t.lineTo;t.__originalBezierCurveTo=t.bezierCurveTo;t.__originalRect=t.rect;t.__originalClosePath=t.closePath;t.__originalBeginPath=t.beginPath;t._removeMirroring=()=>{t.save=t.__originalSave;t.restore=t.__originalRestore;t.rotate=t.__originalRotate;t.scale=t.__originalScale;t.translate=t.__originalTranslate;t.transform=t.__originalTransform;t.setTransform=t.__originalSetTransform;t.resetTransform=t.__originalResetTransform;t.clip=t.__originalClip;t.moveTo=t.__originalMoveTo;t.lineTo=t.__originalLineTo;t.bezierCurveTo=t.__originalBezierCurveTo;t.rect=t.__originalRect;t.closePath=t.__originalClosePath;t.beginPath=t.__originalBeginPath;delete t._removeMirroring};t.save=function ctxSave(){e.save();this.__originalSave()};t.restore=function ctxRestore(){e.restore();this.__originalRestore()};t.translate=function ctxTranslate(t,n){e.translate(t,n);this.__originalTranslate(t,n)};t.scale=function ctxScale(t,n){e.scale(t,n);this.__originalScale(t,n)};t.transform=function ctxTransform(t,n,i,s,r,a){e.transform(t,n,i,s,r,a);this.__originalTransform(t,n,i,s,r,a)};t.setTransform=function ctxSetTransform(t,n,i,s,r,a){e.setTransform(t,n,i,s,r,a);this.__originalSetTransform(t,n,i,s,r,a)};t.resetTransform=function ctxResetTransform(){e.resetTransform();this.__originalResetTransform()};t.rotate=function ctxRotate(t){e.rotate(t);this.__originalRotate(t)};t.clip=function ctxRotate(t){e.clip(t);this.__originalClip(t)};t.moveTo=function(t,n){e.moveTo(t,n);this.__originalMoveTo(t,n)};t.lineTo=function(t,n){e.lineTo(t,n);this.__originalLineTo(t,n)};t.bezierCurveTo=function(t,n,i,s,r,a){e.bezierCurveTo(t,n,i,s,r,a);this.__originalBezierCurveTo(t,n,i,s,r,a)};t.rect=function(t,n,i,s){e.rect(t,n,i,s);this.__originalRect(t,n,i,s)};t.closePath=function(){e.closePath();this.__originalClosePath()};t.beginPath=function(){e.beginPath();this.__originalBeginPath()}}(r,this.suspendedCtx);this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring();copyCtxState(this.ctx,this.suspendedCtx);this.ctx=this.suspendedCtx;this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;if(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])}else t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask;composeSMask(this.suspendedCtx,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()}save(){if(this.inSMaskMode){copyCtxState(this.ctx,this.suspendedCtx);this.suspendedCtx.save()}else this.ctx.save();const t=this.current;this.stateStack.push(t);this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode();if(0!==this.stateStack.length){this.current=this.stateStack.pop();if(this.inSMaskMode){this.suspendedCtx.restore();copyCtxState(this.suspendedCtx,this.ctx)}else this.ctx.restore();this.checkSMaskState();this.pendingClip=null;this._cachedScaleForStroking[0]=-1;this._cachedGetSinglePixelWidth=null}}transform(t,e,n,i,s,r){this.ctx.transform(t,e,n,i,s,r);this._cachedScaleForStroking[0]=-1;this._cachedGetSinglePixelWidth=null}constructPath(t,e,n){const r=this.ctx,a=this.current;let o,l,c=a.x,h=a.y;const d=(0,s.getCurrentTransform)(r),u=0===d[0]&&0===d[3]||0===d[1]&&0===d[2],p=u?n.slice(0):null;for(let n=0,s=0,f=t.length;n0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,n=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha;if(this.contentVisible)if("object"==typeof n&&n?.getPattern){e.save();e.strokeStyle=n.getPattern(e,this,(0,s.getCurrentTransformInverse)(e),r.PathType.STROKE);this.rescaleAndStroke(!1);e.restore()}else this.rescaleAndStroke(!0);t&&this.consumePath(this.current.getClippedPathBoundingBox());e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath();this.stroke()}fill(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,n=this.current.fillColor;let i=!1;if(this.current.patternFill){e.save();e.fillStyle=n.getPattern(e,this,(0,s.getCurrentTransformInverse)(e),r.PathType.FILL);i=!0}const a=this.current.getClippedPathBoundingBox();if(this.contentVisible&&null!==a)if(this.pendingEOFill){e.fill("evenodd");this.pendingEOFill=!1}else e.fill();i&&e.restore();t&&this.consumePath(a)}eoFill(){this.pendingEOFill=!0;this.fill()}fillStroke(){this.fill(!1);this.stroke(!1);this.consumePath()}eoFillStroke(){this.pendingEOFill=!0;this.fillStroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0;this.closePath();this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=u}eoClip(){this.pendingClip=p}beginText(){this.current.textMatrix=i.IDENTITY_MATRIX;this.current.textMatrixScale=1;this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save();e.beginPath();for(const n of t){e.setTransform(...n.transform);e.translate(n.x,n.y);n.addToPath(e,n.fontSize)}e.restore();e.clip();e.beginPath();delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){const n=this.commonObjs.get(t),s=this.current;if(!n)throw new Error(`Can't find font for ${t}`);s.fontMatrix=n.fontMatrix||i.FONT_IDENTITY_MATRIX;0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||(0,i.warn)("Invalid font matrix for font "+t);if(e<0){e=-e;s.fontDirection=-1}else s.fontDirection=1;this.current.font=n;this.current.fontSize=e;if(n.isType3Font)return;const r=n.loadedName||"sans-serif",a=n.systemFontInfo?.css||`"${r}", ${n.fallbackName}`;let o="normal";n.black?o="900":n.bold&&(o="bold");const l=n.italic?"italic":"normal";let c=e;e<16?c=16:e>100&&(c=100);this.current.fontSizeScale=e/c;this.ctx.font=`${l} ${o} ${c}px ${a}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t;this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e);this.moveText(t,e)}setTextMatrix(t,e,n,i,s,r){this.current.textMatrix=[t,e,n,i,s,r];this.current.textMatrixScale=Math.hypot(t,e);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,n,r){const a=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,h=o.fontSize/o.fontSizeScale,d=c&i.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&i.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;let f;(l.disableFontFace||u||p)&&(f=l.getPathGenerator(this.commonObjs,t));if(l.disableFontFace||p){a.save();a.translate(e,n);a.beginPath();f(a,h);r&&a.setTransform(...r);d!==i.TextRenderingMode.FILL&&d!==i.TextRenderingMode.FILL_STROKE||a.fill();d!==i.TextRenderingMode.STROKE&&d!==i.TextRenderingMode.FILL_STROKE||a.stroke();a.restore()}else{d!==i.TextRenderingMode.FILL&&d!==i.TextRenderingMode.FILL_STROKE||a.fillText(t,e,n);d!==i.TextRenderingMode.STROKE&&d!==i.TextRenderingMode.FILL_STROKE||a.strokeText(t,e,n)}if(u){(this.pendingTextPaths||=[]).push({transform:(0,s.getCurrentTransform)(a),x:e,y:n,fontSize:h,addToPath:f})}}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 n=!1;for(let t=3;t0&&e[t]<255){n=!0;break}return(0,i.shadow)(this,"isFontSubpixelAAEnabled",n)}showText(t){const e=this.current,n=e.font;if(n.isType3Font)return this.showType3Text(t);const a=e.fontSize;if(0===a)return;const o=this.ctx,l=e.fontSizeScale,c=e.charSpacing,h=e.wordSpacing,d=e.fontDirection,u=e.textHScale*d,p=t.length,f=n.vertical,g=f?1:-1,m=n.defaultVMetrics,b=a*e.fontMatrix[0],v=e.textRenderingMode===i.TextRenderingMode.FILL&&!n.disableFontFace&&!e.patternFill;o.save();o.transform(...e.textMatrix);o.translate(e.x,e.y+e.textRise);d>0?o.scale(u,-1):o.scale(u,1);let y;if(e.patternFill){o.save();const t=e.fillColor.getPattern(o,this,(0,s.getCurrentTransformInverse)(o),r.PathType.FILL);y=(0,s.getCurrentTransform)(o);o.restore();o.fillStyle=t}let A=e.lineWidth;const _=e.textMatrixScale;if(0===_||0===A){const t=e.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;t!==i.TextRenderingMode.STROKE&&t!==i.TextRenderingMode.FILL_STROKE||(A=this.getSinglePixelWidth())}else A/=_;if(1!==l){o.scale(l,l);A/=l}o.lineWidth=A;if(n.isInvalidPDFjsFont){const n=[];let i=0;for(const e of t){n.push(e.unicode);i+=e.width}o.fillText(n.join(""),0,0);e.x+=i*b*u;o.restore();this.compose();return}let S,x=0;for(S=0;S0){const t=1e3*o.measureText(r).width/a*l;if(Enew CanvasGraphics(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new r.TilingPattern(t,n,this.ctx,a,i)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments);this.current.patternFill=!0}setStrokeRGBColor(t,e,n){const s=i.Util.makeHexColor(t,e,n);this.ctx.strokeStyle=s;this.current.strokeColor=s}setFillRGBColor(t,e,n){const s=i.Util.makeHexColor(t,e,n);this.ctx.fillStyle=s;this.current.fillColor=s;this.current.patternFill=!1}_getPattern(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.cachedPatterns.has(t))e=this.cachedPatterns.get(t);else{e=(0,r.getShadingPattern)(this.getObject(t));this.cachedPatterns.set(t,e)}n&&(e.matrix=n);return e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const n=this._getPattern(t);e.fillStyle=n.getPattern(e,this,(0,s.getCurrentTransformInverse)(e),r.PathType.SHADING);const a=(0,s.getCurrentTransformInverse)(e);if(a){let t=e.canvas.width,n=e.canvas.height;if(t*n>16777216){t*=.8;n*=.8}const[s,r,o,l]=i.Util.getAxialAlignedBoundingBox([0,0,t,n],a);let c=o-s,h=l-r;if(c*h>16777216){c*=.8;h*=.8}this.ctx.fillRect(s,r,c,h)}else this.ctx.fillRect(-1e10,-1e10,4095,4095);this.compose(this.current.getClippedPathBoundingBox());this.restore()}beginInlineImage(){(0,i.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,i.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible){this.save();this.baseTransformStack.push(this.baseTransform);Array.isArray(t)&&6===t.length&&this.transform(...t);this.baseTransform=(0,s.getCurrentTransform)(this.ctx);if(e){const t=e[2]-e[0],n=e[3]-e[1];this.ctx.rect(e[0],e[1],t,n);this.current.updateRectMinMax((0,s.getCurrentTransform)(this.ctx),e);this.clip();this.endPath()}}}paintFormXObjectEnd(){if(this.contentVisible){this.restore();this.baseTransform=this.baseTransformStack.pop()}}beginGroup(t){if(!this.contentVisible)return;this.save();if(this.inSMaskMode){this.endSMaskMode();this.current.activeSMask=null}const e=this.ctx;t.isolated||(0,i.info)("TODO: Support non-isolated groups.");t.knockout&&(0,i.warn)("Knockout groups not supported.");const n=(0,s.getCurrentTransform)(e);t.matrix&&e.transform(...t.matrix);if(!t.bbox)throw new Error("Bounding box is required.");let r=i.Util.getAxialAlignedBoundingBox(t.bbox,(0,s.getCurrentTransform)(e));const a=[0,0,e.canvas.width,e.canvas.height];r=i.Util.intersect(r,a)||[0,0,0,0];const o=Math.floor(r[0]),c=Math.floor(r[1]);let h=Math.max(Math.ceil(r[2])-o,1),d=Math.max(Math.ceil(r[3])-c,1),u=1,p=1;if(h>l){u=h/l;h=l}if(d>l){p=d/l;d=l}this.current.startNewPathAndClipBox([0,0,h,d]);let f="groupAt"+this.groupLevel;t.smask&&(f+="_smask_"+this.smaskCounter++%2);const g=this.cachedCanvases.getCanvas(f,h,d),m=g.context;m.scale(1/u,1/p);m.translate(-o,-c);m.transform(...n);if(t.smask)this.smaskStack.push({canvas:g.canvas,context:m,offsetX:o,offsetY:c,scaleX:u,scaleY:p,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null});else{e.setTransform(1,0,0,1,0,0);e.translate(o,c);e.scale(u,p);e.save()}copyCtxState(e,m);this.ctx=m;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(e);this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,n=this.groupStack.pop();this.ctx=n;this.ctx.imageSmoothingEnabled=!1;if(t.smask){this.tempSMask=this.smaskStack.pop();this.restore()}else{this.ctx.restore();const t=(0,s.getCurrentTransform)(this.ctx);this.restore();this.ctx.save();this.ctx.setTransform(...t);const n=i.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0);this.ctx.restore();this.compose(n)}}beginAnnotation(t,e,n,r,a){this.#Lt();resetCtxToDefault(this.ctx);this.ctx.save();this.save();this.baseTransform&&this.ctx.setTransform(...this.baseTransform);if(Array.isArray(e)&&4===e.length){const r=e[2]-e[0],o=e[3]-e[1];if(a&&this.annotationCanvasMap){(n=n.slice())[4]-=e[0];n[5]-=e[1];(e=e.slice())[0]=e[1]=0;e[2]=r;e[3]=o;const[a,l]=i.Util.singularValueDecompose2dScale((0,s.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,h=Math.ceil(r*this.outputScaleX*c),d=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(h,d);const{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,u);this.annotationCanvas.savedCtx=this.ctx;this.ctx=p;this.ctx.save();this.ctx.setTransform(a,0,0,-l,0,o*l);resetCtxToDefault(this.ctx)}else{resetCtxToDefault(this.ctx);this.ctx.rect(e[0],e[1],r,o);this.ctx.clip();this.endPath()}}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.transform(...n);this.transform(...r)}endAnnotation(){if(this.annotationCanvas){this.ctx.restore();this.#Nt();this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const n=this.ctx,i=this.processingType3;if(i){void 0===i.compiled&&(i.compiled=function compileType3Glyph(t){const{width:e,height:n}=t;if(e>1e3||n>1e3)return null;const i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let r,a,o,l=new Uint8Array(s*(n+1));const c=e+7&-8;let h=new Uint8Array(c*n),d=0;for(const e of t.data){let t=128;for(;t>0;){h[d++]=e&t?0:255;t>>=1}}let u=0;d=0;if(0!==h[d]){l[0]=1;++u}for(a=1;a>2)+(h[d+1]?4:0)+(h[d-c+1]?8:0);if(i[t]){l[o+a]=i[t];++u}d++}if(h[d-c]!==h[d]){l[o+a]=h[d]?2:4;++u}if(u>1e3)return null}d=c*(n-1);o=r*s;if(0!==h[d]){l[o]=8;++u}for(a=1;a1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),f=new Path2D;for(r=0;u&&r<=n;r++){let t=r*s;const n=t+e;for(;t>4;l[t]&=a>>2|a<<2}f.lineTo(t%s,t/s|0);l[t]||--u}while(i!==t);--r}h=null;l=null;return function(t){t.save();t.scale(1/e,-1/n);t.translate(0,-n);t.fill(f);t.beginPath();t.restore()}}(t));if(i.compiled){i.compiled(n);return}}const s=this._createMaskCanvas(t),r=s.canvas;n.save();n.setTransform(1,0,0,1,0,0);n.drawImage(r,s.offsetX,s.offsetY);n.restore();this.compose()}paintImageMaskXObjectRepeat(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const l=this.ctx;l.save();const c=(0,s.getCurrentTransform)(l);l.transform(e,n,r,a,0,0);const h=this._createMaskCanvas(t);l.setTransform(1,0,0,1,h.offsetX-c[4],h.offsetY-c[5]);for(let t=0,s=o.length;t16777216){l*=.8;c*=.8}const h=this.cachedCanvases.getCanvas("maskCanvas",l,c),d=h.context;d.save();putBinaryImageMask(d,this.getObject(t,a));d.globalCompositeOperation="source-in";d.fillStyle=i?n.getPattern(d,this,(0,s.getCurrentTransformInverse)(e),r.PathType.FILL):n;d.fillRect(0,0,l,c);d.restore();e.save();e.transform(...o);e.scale(1,-1);drawImageAtIntegerCoords(e,h.canvas,0,0,l,c,0,-1,1,1);e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,i.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,n,s){if(!this.contentVisible)return;const r=this.getObject(t);if(!r){(0,i.warn)("Dependent image isn't ready yet");return}const a=r.width,o=r.height,l=[];for(let t=0,i=s.length;te?c/e:1;a=l>e?l/e:1}}this._cachedScaleForStroking[0]=r;this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:n}=this.current,[i,s]=this.getScaleForStroking();e.lineWidth=n||1;if(1===i&&1===s){e.stroke();return}const r=e.getLineDash();t&&e.save();e.scale(i,s);if(r.length>0){const t=Math.max(i,s);e.setLineDash(r.map((e=>e/t)));e.lineDashOffset/=t}e.stroke();t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}e.CanvasGraphics=CanvasGraphics;for(const t in i.OPS)void 0!==CanvasGraphics.prototype[t]&&(CanvasGraphics.prototype[i.OPS[t]]=CanvasGraphics.prototype[t])},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.TilingPattern=e.PathType=void 0;e.getShadingPattern=function getShadingPattern(t){switch(t[0]){case"RadialAxial":return new RadialAxialShadingPattern(t);case"Mesh":return new MeshShadingPattern(t);case"Dummy":return new DummyShadingPattern}throw new Error(`Unknown IR type: ${t[0]}`)};var i=n(1),s=n(135);const r={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};e.PathType=r;function applyBoundingBox(t,e){if(!e)return;const n=e[2]-e[0],i=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],n,i);t.clip(s)}class BaseShadingPattern{constructor(){this.constructor===BaseShadingPattern&&(0,i.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,i.unreachable)("Abstract method `getPattern` called.")}}class RadialAxialShadingPattern extends BaseShadingPattern{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;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(t,e,n,a){let o;if(a===r.STROKE||a===r.FILL){const r=e.current.getClippedPathBoundingBox(a,(0,s.getCurrentTransform)(t))||[0,0,0,0],l=Math.ceil(r[2]-r[0])||1,c=Math.ceil(r[3]-r[1])||1,h=e.cachedCanvases.getCanvas("pattern",l,c,!0),d=h.context;d.clearRect(0,0,d.canvas.width,d.canvas.height);d.beginPath();d.rect(0,0,d.canvas.width,d.canvas.height);d.translate(-r[0],-r[1]);n=i.Util.transform(n,[1,0,0,1,r[0],r[1]]);d.transform(...e.baseTransform);this.matrix&&d.transform(...this.matrix);applyBoundingBox(d,this._bbox);d.fillStyle=this._createGradient(d);d.fill();o=t.createPattern(h.canvas,"no-repeat");const u=new DOMMatrix(n);o.setTransform(u)}else{applyBoundingBox(t,this._bbox);o=this._createGradient(t)}return o}}function drawTriangle(t,e,n,i,s,r,a,o){const l=e.coords,c=e.colors,h=t.data,d=4*t.width;let u;if(l[n+1]>l[i+1]){u=n;n=i;i=u;u=r;r=a;a=u}if(l[i+1]>l[s+1]){u=i;i=s;s=u;u=a;a=o;o=u}if(l[n+1]>l[i+1]){u=n;n=i;i=u;u=r;r=a;a=u}const p=(l[n]+e.offsetX)*e.scaleX,f=(l[n+1]+e.offsetY)*e.scaleY,g=(l[i]+e.offsetX)*e.scaleX,m=(l[i+1]+e.offsetY)*e.scaleY,b=(l[s]+e.offsetX)*e.scaleX,v=(l[s+1]+e.offsetY)*e.scaleY;if(f>=v)return;const y=c[r],A=c[r+1],_=c[r+2],S=c[a],x=c[a+1],E=c[a+2],C=c[o],w=c[o+1],T=c[o+2],P=Math.round(f),k=Math.round(v);let M,R,I,D,O,L,N,j;for(let t=P;t<=k;t++){if(tv?1:m===v?0:(m-t)/(m-v);M=g-(g-b)*e;R=S-(S-C)*e;I=x-(x-w)*e;D=E-(E-T)*e}let e;e=tv?1:(f-t)/(f-v);O=p-(p-b)*e;L=y-(y-C)*e;N=A-(A-w)*e;j=_-(_-T)*e;const n=Math.round(Math.min(M,O)),i=Math.round(Math.max(M,O));let s=d*t+4*n;for(let t=n;t<=i;t++){e=(M-t)/(M-O);e<0?e=0:e>1&&(e=1);h[s++]=R-(R-L)*e|0;h[s++]=I-(I-N)*e|0;h[s++]=D-(D-j)*e|0;h[s++]=255}}}function drawFigure(t,e,n){const i=e.coords,s=e.colors;let r,a;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(i.length/o)-1,c=o-1;for(r=0;r=i?s=i:n=s/t;return{scale:n,size:s}}clipBbox(t,e,n,i,r){const a=i-e,o=r-n;t.ctx.rect(e,n,a,o);t.current.updateRectMinMax((0,s.getCurrentTransform)(t.ctx),[e,n,i,r]);t.clip();t.endPath()}setFillAndStrokeStyleToContext(t,e,n){const s=t.ctx,r=t.current;switch(e){case a:const t=this.ctx;s.fillStyle=t.fillStyle;s.strokeStyle=t.strokeStyle;r.fillColor=t.fillStyle;r.strokeColor=t.strokeStyle;break;case o:const l=i.Util.makeHexColor(n[0],n[1],n[2]);s.fillStyle=l;s.strokeStyle=l;r.fillColor=l;r.strokeColor=l;break;default:throw new i.FormatError(`Unsupported paint type: ${e}`)}}getPattern(t,e,n,s){let a=n;if(s!==r.SHADING){a=i.Util.transform(a,e.baseTransform);this.matrix&&(a=i.Util.transform(a,this.matrix))}const o=this.createPatternCanvas(e);let l=new DOMMatrix(a);l=l.translate(o.offsetX,o.offsetY);l=l.scale(1/o.scaleX,1/o.scaleY);const c=t.createPattern(o.canvas,"repeat");c.setTransform(l);return c}}e.TilingPattern=TilingPattern},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.convertBlackAndWhiteToRGBA=convertBlackAndWhiteToRGBA;e.convertToRGBA=function convertToRGBA(t){switch(t.kind){case i.ImageKind.GRAYSCALE_1BPP:return convertBlackAndWhiteToRGBA(t);case i.ImageKind.RGB_24BPP:return function convertRGBToRGBA(t){let{src:e,srcPos:n=0,dest:s,destPos:r=0,width:a,height:o}=t,l=0;const c=e.length>>2,h=new Uint32Array(e.buffer,n,c);if(i.FeatureTest.isLittleEndian){for(;l>>24|e<<8|4278190080;s[r+2]=e>>>16|n<<16|4278190080;s[r+3]=n>>>8|4278190080}for(let t=4*l,n=e.length;t>>8|255;s[r+2]=e<<16|n>>>16|255;s[r+3]=n<<8|255}for(let t=4*l,n=e.length;t>3,p=7&r,f=e.length;s=new Uint32Array(s.buffer);let g=0;for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.GlobalWorkerOptions=void 0;const n=Object.create(null);e.GlobalWorkerOptions=n;n.workerPort=null;n.workerSrc=""},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.MessageHandler=void 0;var i=n(1);const s=1,r=2,a=1,o=2,l=3,c=4,h=5,d=6,u=7,p=8;function wrapReason(t){t instanceof Error||"object"==typeof t&&null!==t||(0,i.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(t.name){case"AbortException":return new i.AbortException(t.message);case"MissingPDFException":return new i.MissingPDFException(t.message);case"PasswordException":return new i.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new i.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new i.UnknownErrorException(t.message,t.details);default:return new i.UnknownErrorException(t.message,t.toString())}}e.MessageHandler=class MessageHandler{constructor(t,e,n){this.sourceName=t;this.targetName=e;this.comObj=n;this.callbackId=1;this.streamId=1;this.streamSinks=Object.create(null);this.streamControllers=Object.create(null);this.callbackCapabilities=Object.create(null);this.actionHandler=Object.create(null);this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream){this.#jt(e);return}if(e.callback){const t=e.callbackId,n=this.callbackCapabilities[t];if(!n)throw new Error(`Cannot resolve callback ${t}`);delete this.callbackCapabilities[t];if(e.callback===s)n.resolve(e.data);else{if(e.callback!==r)throw new Error("Unexpected callback case");n.reject(wrapReason(e.reason))}return}const i=this.actionHandler[e.action];if(!i)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,a=e.sourceName;new Promise((function(t){t(i(e.data))})).then((function(i){n.postMessage({sourceName:t,targetName:a,callback:s,callbackId:e.callbackId,data:i})}),(function(i){n.postMessage({sourceName:t,targetName:a,callback:r,callbackId:e.callbackId,reason:wrapReason(i)})}))}else e.streamId?this.#Bt(e):i(e.data)};n.addEventListener("message",this._onComObjOnMessage)}on(t,e){const n=this.actionHandler;if(n[t])throw new Error(`There is already an actionName called "${t}"`);n[t]=e}send(t,e,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},n)}sendWithPromise(t,e,n){const s=this.callbackId++,r=new i.PromiseCapability;this.callbackCapabilities[s]=r;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:s,data:e},n)}catch(t){r.reject(t)}return r.promise}sendWithStream(t,e,n,s){const r=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:n=>{const a=new i.PromiseCapability;this.streamControllers[r]={controller:n,startCall:a,pullCall:null,cancelCall:null,isClosed:!1};c.postMessage({sourceName:o,targetName:l,action:t,streamId:r,data:e,desiredSize:n.desiredSize},s);return a.promise},pull:t=>{const e=new i.PromiseCapability;this.streamControllers[r].pullCall=e;c.postMessage({sourceName:o,targetName:l,stream:d,streamId:r,desiredSize:t.desiredSize});return e.promise},cancel:t=>{(0,i.assert)(t instanceof Error,"cancel must have a valid reason");const e=new i.PromiseCapability;this.streamControllers[r].cancelCall=e;this.streamControllers[r].isClosed=!0;c.postMessage({sourceName:o,targetName:l,stream:a,streamId:r,reason:wrapReason(t)});return e.promise}},n)}#Bt(t){const e=t.streamId,n=this.sourceName,s=t.sourceName,r=this.comObj,a=this,o=this.actionHandler[t.action],d={enqueue(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=a;if(l>0&&this.desiredSize<=0){this.sinkCapability=new i.PromiseCapability;this.ready=this.sinkCapability.promise}r.postMessage({sourceName:n,targetName:s,stream:c,streamId:e,chunk:t},o)},close(){if(!this.isCancelled){this.isCancelled=!0;r.postMessage({sourceName:n,targetName:s,stream:l,streamId:e});delete a.streamSinks[e]}},error(t){(0,i.assert)(t instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;r.postMessage({sourceName:n,targetName:s,stream:h,streamId:e,reason:wrapReason(t)})}},sinkCapability:new i.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};d.sinkCapability.resolve();d.ready=d.sinkCapability.promise;this.streamSinks[e]=d;new Promise((function(e){e(o(t.data,d))})).then((function(){r.postMessage({sourceName:n,targetName:s,stream:p,streamId:e,success:!0})}),(function(t){r.postMessage({sourceName:n,targetName:s,stream:p,streamId:e,reason:wrapReason(t)})}))}#jt(t){const e=t.streamId,n=this.sourceName,s=t.sourceName,r=this.comObj,f=this.streamControllers[e],g=this.streamSinks[e];switch(t.stream){case p:t.success?f.startCall.resolve():f.startCall.reject(wrapReason(t.reason));break;case u:t.success?f.pullCall.resolve():f.pullCall.reject(wrapReason(t.reason));break;case d:if(!g){r.postMessage({sourceName:n,targetName:s,stream:u,streamId:e,success:!0});break}g.desiredSize<=0&&t.desiredSize>0&&g.sinkCapability.resolve();g.desiredSize=t.desiredSize;new Promise((function(t){t(g.onPull?.())})).then((function(){r.postMessage({sourceName:n,targetName:s,stream:u,streamId:e,success:!0})}),(function(t){r.postMessage({sourceName:n,targetName:s,stream:u,streamId:e,reason:wrapReason(t)})}));break;case c:(0,i.assert)(f,"enqueue should have stream controller");if(f.isClosed)break;f.controller.enqueue(t.chunk);break;case l:(0,i.assert)(f,"close should have stream controller");if(f.isClosed)break;f.isClosed=!0;f.controller.close();this.#Ut(f,e);break;case h:(0,i.assert)(f,"error should have stream controller");f.controller.error(wrapReason(t.reason));this.#Ut(f,e);break;case o:t.success?f.cancelCall.resolve():f.cancelCall.reject(wrapReason(t.reason));this.#Ut(f,e);break;case a:if(!g)break;new Promise((function(e){e(g.onCancel?.(wrapReason(t.reason)))})).then((function(){r.postMessage({sourceName:n,targetName:s,stream:o,streamId:e,success:!0})}),(function(t){r.postMessage({sourceName:n,targetName:s,stream:o,streamId:e,reason:wrapReason(t)})}));g.sinkCapability.reject(wrapReason(t.reason));g.isCancelled=!0;delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#Ut(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]);delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Metadata=void 0;var i=n(1);e.Metadata=class Metadata{#Ht;#zt;constructor(t){let{parsedData:e,rawData:n}=t;this.#Ht=e;this.#zt=n}getRaw(){return this.#zt}get(t){return this.#Ht.get(t)??null}getAll(){return(0,i.objectFromMap)(this.#Ht)}has(t){return this.#Ht.has(t)}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.OptionalContentConfig=void 0;var i=n(1),s=n(137);const r=Symbol("INTERNAL");class OptionalContentGroup{#Wt=!0;constructor(t,e){this.name=t;this.intent=e}get visible(){return this.#Wt}_setVisible(t,e){t!==r&&(0,i.unreachable)("Internal method `_setVisible` called.");this.#Wt=e}}e.OptionalContentConfig=class OptionalContentConfig{#qt=null;#Gt=new Map;#Vt=null;#Xt=null;constructor(t){this.name=null;this.creator=null;if(null!==t){this.name=t.name;this.creator=t.creator;this.#Xt=t.order;for(const e of t.groups)this.#Gt.set(e.id,new OptionalContentGroup(e.name,e.intent));if("OFF"===t.baseState)for(const t of this.#Gt.values())t._setVisible(r,!1);for(const e of t.on)this.#Gt.get(e)._setVisible(r,!0);for(const e of t.off)this.#Gt.get(e)._setVisible(r,!1);this.#Vt=this.getHash()}}#$t(t){const e=t.length;if(e<2)return!0;const n=t[0];for(let s=1;s1&&void 0!==arguments[1])||arguments[1];if(this.#Gt.has(t)){this.#Gt.get(t)._setVisible(r,!!e);this.#qt=null}else(0,i.warn)(`Optional content group not found: ${t}`)}get hasInitialVisibility(){return this.getHash()===this.#Vt}getOrder(){return this.#Gt.size?this.#Xt?this.#Xt.slice():[...this.#Gt.keys()]:null}getGroups(){return this.#Gt.size>0?(0,i.objectFromMap)(this.#Gt):null}getGroup(t){return this.#Gt.get(t)||null}getHash(){if(null!==this.#qt)return this.#qt;const t=new s.MurmurHash3_64;for(const[e,n]of this.#Gt)t.update(`${e}:${n.visible}`);return this.#qt=t.hexdigest()}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFDataTransportStream=void 0;var i=n(1),s=n(135);e.PDFDataTransportStream=class PDFDataTransportStream{constructor(t,e){let{length:n,initialData:s,progressiveDone:r=!1,contentDispositionFilename:a=null,disableRange:o=!1,disableStream:l=!1}=t;(0,i.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');this._queuedChunks=[];this._progressiveDone=r;this._contentDispositionFilename=a;if(s?.length>0){const t=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=e;this._isStreamingSupported=!l;this._isRangeSupported=!o;this._contentLength=n;this._fullRequestReader=null;this._rangeReaders=[];this._pdfDataRangeTransport.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})}));this._pdfDataRangeTransport.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})}));this._pdfDataRangeTransport.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})}));this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()}));this._pdfDataRangeTransport.transportReady()}_onReceiveData(t){let{begin:e,chunk:n}=t;const s=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(s):this._queuedChunks.push(s);else{const t=this._rangeReaders.some((function(t){if(t._begin!==e)return!1;t._enqueue(s);return!0}));(0,i.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone();this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;this._queuedChunks=null;return new PDFDataTransportStreamReader(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const n=new PDFDataTransportStreamRangeReader(this,t,e);this._pdfDataRangeTransport.requestDataRange(t,e);this._rangeReaders.push(n);return n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}};class PDFDataTransportStreamReader{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t;this._done=n||!1;this._filename=(0,s.isPdfFile)(i)?i:null;this._queuedChunks=e||[];this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[];this._headersReady=Promise.resolve();t._fullRequestReader=this;this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else 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=new i.PromiseCapability;this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class PDFDataTransportStreamRangeReader{constructor(t,e,n){this._stream=t;this._begin=e;this._end=n;this._queuedChunk=null;this._requests=[];this._done=!1;this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.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 t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=new i.PromiseCapability;this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._stream._removeRangeReader(this)}}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.XfaText=void 0;class XfaText{static textContent(t){const e=[],n={items:e,styles:Object.create(null)};!function walk(t){if(!t)return;let n=null;const i=t.name;if("#text"===i)n=t.value;else{if(!XfaText.shouldBuildText(i))return;t?.attributes?.textContent?n=t.attributes.textContent:t.value&&(n=t.value)}null!==n&&e.push({str:n});if(t.children)for(const e of t.children)walk(e)}(t);return n}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=XfaText},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.NodeStandardFontDataFactory=e.NodeFilterFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;var i=n(136);const fetchData=function(t){return new Promise(((e,n)=>{require("fs").readFile(t,((t,i)=>{!t&&i?e(new Uint8Array(i)):n(new Error(t))}))}))};class NodeFilterFactory extends i.BaseFilterFactory{}e.NodeFilterFactory=NodeFilterFactory;class NodeCanvasFactory extends i.BaseCanvasFactory{_createCanvas(t,e){if(t*e>16777216){t*=.8;e*=.8}return require("canvas").createCanvas(t,e)}}e.NodeCanvasFactory=NodeCanvasFactory;class NodeCMapReaderFactory extends i.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t).then((t=>({cMapData:t,compressionType:e})))}}e.NodeCMapReaderFactory=NodeCMapReaderFactory;class NodeStandardFontDataFactory extends i.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t)}}e.NodeStandardFontDataFactory=NodeStandardFontDataFactory},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFNodeStream=void 0;var i=n(1),s=n(150);const r=require("fs"),a=require("http"),o=require("https"),l=require("url"),c=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class PDFNodeStream{constructor(t){this.source=t;this.url=function parseUrl(t){const e=l.parse(t);if("file:"===e.protocol||e.host)return e;if(/^[a-z]:[/\\]/i.test(t))return l.parse(`file:///${t}`);e.host||(e.protocol="file:");return e}(t.url);this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol;this.isFsUrl="file:"===this.url.protocol;this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once.");this._fullRequestReader=this.isFsUrl?new PDFNodeStreamFsFullReader(this):new PDFNodeStreamFullReader(this);return this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const n=this.isFsUrl?new PDFNodeStreamFsRangeReader(this,t,e):new PDFNodeStreamRangeReader(this,t,e);this._rangeRequestReaders.push(n);return n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class BaseFullReader{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=new i.PromiseCapability;this._headersCapability=new i.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t){this._readCapability=new i.PromiseCapability;return this.read()}this._loaded+=t.length;this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(t).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(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",(t=>{this._error(t)}));!this._isStreamingSupported&&this._isRangeSupported&&this._error(new i.AbortException("streaming is disabled"));this._storedError&&this._readableStream.destroy(this._storedError)}}class BaseRangeReader{constructor(t){this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;this._loaded=0;this._readableStream=null;this._readCapability=new i.PromiseCapability;const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t){this._readCapability=new i.PromiseCapability;return this.read()}this._loaded+=t.length;this.onProgress?.({loaded:this._loaded});return{value:new Uint8Array(t).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(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",(t=>{this._error(t)}));this._storedError&&this._readableStream.destroy(this._storedError)}}function createRequestOptions(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class PDFNodeStreamFullReader extends BaseFullReader{constructor(t){super(t);const handleResponse=e=>{if(404===e.statusCode){const t=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t;this._headersCapability.reject(t);return}this._headersCapability.resolve();this._setReadableStream(e);const getResponseHeader=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:n,suggestedLength:r}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n;this._contentLength=r||this._contentLength;this._filename=(0,s.extractFilenameFromHeader)(getResponseHeader)};this._request=null;"http:"===this._url.protocol?this._request=a.request(createRequestOptions(this._url,t.httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,t.httpHeaders),handleResponse);this._request.on("error",(t=>{this._storedError=t;this._headersCapability.reject(t)}));this._request.end()}}class PDFNodeStreamRangeReader extends BaseRangeReader{constructor(t,e,n){super(t);this._httpHeaders={};for(const e in t.httpHeaders){const n=t.httpHeaders[e];void 0!==n&&(this._httpHeaders[e]=n)}this._httpHeaders.Range=`bytes=${e}-${n-1}`;const handleResponse=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t}};this._request=null;"http:"===this._url.protocol?this._request=a.request(createRequestOptions(this._url,this._httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,this._httpHeaders),handleResponse);this._request.on("error",(t=>{this._storedError=t}));this._request.end()}}class PDFNodeStreamFsFullReader extends BaseFullReader{constructor(t){super(t);let e=decodeURIComponent(this._url.path);c.test(this._url.href)&&(e=e.replace(/^\//,""));r.lstat(e,((t,n)=>{if(t){"ENOENT"===t.code&&(t=new i.MissingPDFException(`Missing PDF "${e}".`));this._storedError=t;this._headersCapability.reject(t)}else{this._contentLength=n.size;this._setReadableStream(r.createReadStream(e));this._headersCapability.resolve()}}))}}class PDFNodeStreamFsRangeReader extends BaseRangeReader{constructor(t,e,n){super(t);let i=decodeURIComponent(this._url.path);c.test(this._url.href)&&(i=i.replace(/^\//,""));this._setReadableStream(r.createReadStream(i,{start:e,end:n-1}))}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.createResponseStatusError=function createResponseStatusError(t,e){if(404===t||0===t&&e.startsWith("file:"))return new i.MissingPDFException('Missing PDF "'+e+'".');return new i.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)};e.extractFilenameFromHeader=function extractFilenameFromHeader(t){const e=t("Content-Disposition");if(e){let t=(0,s.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if((0,r.isPdfFile)(t))return t}return null};e.validateRangeRequestCapabilities=function validateRangeRequestCapabilities(t){let{getResponseHeader:e,isHttp:n,rangeChunkSize:i,disableRange:s}=t;const r={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e("Content-Length"),10);if(!Number.isInteger(a))return r;r.suggestedLength=a;if(a<=2*i)return r;if(s||!n)return r;if("bytes"!==e("Accept-Ranges"))return r;if("identity"!==(e("Content-Encoding")||"identity"))return r;r.allowRangeRequests=!0;return r};e.validateResponseStatus=function validateResponseStatus(t){return 200===t||206===t};var i=n(1),s=n(151),r=n(135)},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.getFilenameFromContentDispositionHeader=function getFilenameFromContentDispositionHeader(t){let e=!0,n=toParamRegExp("filename\\*","i").exec(t);if(n){n=n[1];let t=rfc2616unquote(n);t=unescape(t);t=rfc5987decode(t);t=rfc2047decode(t);return fixupEncoding(t)}n=function rfc2231getparam(t){const e=[];let n;const i=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=i.exec(t));){let[,t,i,s]=n;t=parseInt(t,10);if(t in e){if(0===t)break}else e[t]=[i,s]}const s=[];for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFNetworkStream=void 0;var i=n(1),s=n(150);class NetworkManager{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=t;this.isHttp=/^https?:/i.test(t);this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null);this.withCredentials=e.withCredentials||!1;this.currXhrId=0;this.pendingRequests=Object.create(null)}requestRange(t,e,n){const i={begin:t,end:e};for(const t in n)i[t]=n[t];return this.request(i)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,n=this.currXhrId++,i=this.pendingRequests[n]={xhr:e};e.open("GET",this.url);e.withCredentials=this.withCredentials;for(const t in this.httpHeaders){const n=this.httpHeaders[t];void 0!==n&&e.setRequestHeader(t,n)}if(this.isHttp&&"begin"in t&&"end"in t){e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`);i.expectedStatus=206}else i.expectedStatus=200;e.responseType="arraybuffer";t.onError&&(e.onerror=function(n){t.onError(e.status)});e.onreadystatechange=this.onStateChange.bind(this,n);e.onprogress=this.onProgress.bind(this,n);i.onHeadersReceived=t.onHeadersReceived;i.onDone=t.onDone;i.onError=t.onError;i.onProgress=t.onProgress;e.send(null);return n}onProgress(t,e){const n=this.pendingRequests[t];n&&n.onProgress?.(e)}onStateChange(t,e){const n=this.pendingRequests[t];if(!n)return;const s=n.xhr;if(s.readyState>=2&&n.onHeadersReceived){n.onHeadersReceived();delete n.onHeadersReceived}if(4!==s.readyState)return;if(!(t in this.pendingRequests))return;delete this.pendingRequests[t];if(0===s.status&&this.isHttp){n.onError?.(s.status);return}const r=s.status||200;if(!(200===r&&206===n.expectedStatus)&&r!==n.expectedStatus){n.onError?.(s.status);return}const a=function getArrayBuffer(t){const e=t.response;return"string"!=typeof e?e:(0,i.stringToBytes)(e).buffer}(s);if(206===r){const t=s.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);n.onDone({begin:parseInt(e[1],10),chunk:a})}else a?n.onDone({begin:0,chunk:a}):n.onError?.(s.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()}}e.PDFNetworkStream=class PDFNetworkStream{constructor(t){this._source=t;this._manager=new NetworkManager(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials});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(){(0,i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once.");this._fullRequestReader=new PDFNetworkStreamFullRequestReader(this._manager,this._source);return this._fullRequestReader}getRangeReader(t,e){const n=new PDFNetworkStreamRangeRequestReader(this._manager,t,e);n.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(n);return n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFNetworkStreamFullRequestReader{constructor(t,e){this._manager=t;const n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url;this._fullRequestId=t.requestFull(n);this._headersReceivedCapability=new i.PromiseCapability;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),getResponseHeader=t=>e.getResponseHeader(t),{allowRangeRequests:n,suggestedLength:i}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0);this._contentLength=i||this._contentLength;this._filename=(0,s.extractFilenameFromHeader)(getResponseHeader);this._isRangeSupported&&this._manager.abortRequest(t);this._headersReceivedCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);this._done=!0;if(!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=(0,s.createResponseStatusError)(t,this._url);this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(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=new i.PromiseCapability;this._requests.push(t);return t.promise}cancel(t){this._done=!0;this._headersReceivedCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId);this._fullRequestReader=null}}class PDFNetworkStreamRangeRequestReader{constructor(t,e,n){this._manager=t;const i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url;this._requestId=t.requestRange(e,n,i);this._requests=[];this._queuedChunk=null;this._done=!1;this._storedError=void 0;this.onProgress=null;this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._close()}_onError(t){this._storedError=(0,s.createResponseStatusError)(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=new i.PromiseCapability;this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId);this._close()}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFFetchStream=void 0;var i=n(1),s=n(150);function createFetchOptions(t,e,n){return{method:"GET",headers:t,signal:n.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function createHeaders(t){const e=new Headers;for(const n in t){const i=t[n];void 0!==i&&e.append(n,i)}return e}function getArrayBuffer(t){if(t instanceof Uint8Array)return t.buffer;if(t instanceof ArrayBuffer)return t;(0,i.warn)(`getArrayBuffer - unexpected data format: ${t}`);return new Uint8Array(t).buffer}e.PDFFetchStream=class PDFFetchStream{constructor(t){this.source=t;this.isHttp=/^https?:/i.test(t.url);this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once.");this._fullRequestReader=new PDFFetchStreamReader(this);return this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const n=new PDFFetchStreamRangeReader(this,t,e);this._rangeRequestReaders.push(n);return n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFFetchStreamReader{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=new i.PromiseCapability;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;this._headers=createHeaders(this._stream.httpHeaders);const n=e.url;fetch(n,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,s.validateResponseStatus)(t.status))throw(0,s.createResponseStatusError)(t.status,n);this._reader=t.body.getReader();this._headersCapability.resolve();const getResponseHeader=e=>t.headers.get(e),{allowRangeRequests:e,suggestedLength:r}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=e;this._contentLength=r||this._contentLength;this._filename=(0,s.extractFilenameFromHeader)(getResponseHeader);!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new i.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject);this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t);this._abortController.abort()}}class PDFFetchStreamRangeReader{constructor(t,e,n){this._stream=t;this._reader=null;this._loaded=0;const r=t.source;this._withCredentials=r.withCredentials||!1;this._readCapability=new i.PromiseCapability;this._isStreamingSupported=!r.disableStream;this._abortController=new AbortController;this._headers=createHeaders(this._stream.httpHeaders);this._headers.append("Range",`bytes=${e}-${n-1}`);const a=r.url;fetch(a,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,s.validateResponseStatus)(t.status))throw(0,s.createResponseStatusError)(t.status,a);this._readCapability.resolve();this._reader=t.body.getReader()})).catch(this._readCapability.reject);this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this.onProgress?.({loaded:this._loaded});return{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t);this._abortController.abort()}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.TextLayerRenderTask=void 0;e.renderTextLayer=function renderTextLayer(t){if(!t.textContentSource&&(t.textContent||t.textContentStream)){(0,s.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead.");t.textContentSource=t.textContent||t.textContentStream}const{container:e,viewport:n}=t,i=getComputedStyle(e),r=i.getPropertyValue("visibility"),a=parseFloat(i.getPropertyValue("--scale-factor"));"visible"===r&&(!a||Math.abs(a-n.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const o=new TextLayerRenderTask(t);o._render();return o};e.updateTextLayer=function updateTextLayer(t){let{container:e,viewport:n,textDivs:i,textDivProperties:r,isOffscreenCanvasSupported:a,mustRotate:o=!0,mustRescale:l=!0}=t;o&&(0,s.setLayerDimensions)(e,{rotation:n.rotation});if(l){const t=getCtx(0,a),e={prevFontSize:null,prevFontFamily:null,div:null,scale:n.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t};for(const t of i){e.properties=r.get(t);e.div=t;layout(e)}}};var i=n(1),s=n(135);const r=30,a=.8,o=new Map;function getCtx(t,e){let n;if(e&&i.FeatureTest.isOffscreenCanvasSupported)n=new OffscreenCanvas(t,t).getContext("2d",{alpha:!1});else{const e=document.createElement("canvas");e.width=e.height=t;n=e.getContext("2d",{alpha:!1})}return n}function appendText(t,e,n){const s=document.createElement("span"),l={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(s);const c=i.Util.transform(t._transform,e.transform);let h=Math.atan2(c[1],c[0]);const d=n[e.fontName];d.vertical&&(h+=Math.PI/2);const u=Math.hypot(c[2],c[3]),p=u*function getAscent(t,e){const n=o.get(t);if(n)return n;const i=getCtx(r,e);i.font=`${r}px ${t}`;const s=i.measureText("");let l=s.fontBoundingBoxAscent,c=Math.abs(s.fontBoundingBoxDescent);if(l){const e=l/(l+c);o.set(t,e);i.canvas.width=i.canvas.height=0;return e}i.strokeStyle="red";i.clearRect(0,0,r,r);i.strokeText("g",0,0);let h=i.getImageData(0,0,r,r).data;c=0;for(let t=h.length-1-3;t>=0;t-=4)if(h[t]>0){c=Math.ceil(t/4/r);break}i.clearRect(0,0,r,r);i.strokeText("A",0,r);h=i.getImageData(0,0,r,r).data;l=0;for(let t=0,e=h.length;t0){l=r-Math.floor(t/4/r);break}i.canvas.width=i.canvas.height=0;if(l){const e=l/(l+c);o.set(t,e);return e}o.set(t,a);return a}(d.fontFamily,t._isOffscreenCanvasSupported);let f,g;if(0===h){f=c[4];g=c[5]-p}else{f=c[4]+p*Math.sin(h);g=c[5]-p*Math.cos(h)}const m="calc(var(--scale-factor)*",b=s.style;if(t._container===t._rootContainer){b.left=`${(100*f/t._pageWidth).toFixed(2)}%`;b.top=`${(100*g/t._pageHeight).toFixed(2)}%`}else{b.left=`${m}${f.toFixed(2)}px)`;b.top=`${m}${g.toFixed(2)}px)`}b.fontSize=`${m}${u.toFixed(2)}px)`;b.fontFamily=d.fontFamily;l.fontSize=u;s.setAttribute("role","presentation");s.textContent=e.str;s.dir=e.dir;t._fontInspectorEnabled&&(s.dataset.fontName=e.fontName);0!==h&&(l.angle=h*(180/Math.PI));let v=!1;if(e.str.length>1)v=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),n=Math.abs(e.transform[3]);t!==n&&Math.max(t,n)/Math.min(t,n)>1.5&&(v=!0)}v&&(l.canvasWidth=d.vertical?e.height:e.width);t._textDivProperties.set(s,l);t._isReadableStream&&t._layoutText(s)}function layout(t){const{div:e,scale:n,properties:i,ctx:s,prevFontSize:r,prevFontFamily:a}=t,{style:o}=e;let l="";if(0!==i.canvasWidth&&i.hasText){const{fontFamily:c}=o,{canvasWidth:h,fontSize:d}=i;if(r!==d||a!==c){s.font=`${d*n}px ${c}`;t.prevFontSize=d;t.prevFontFamily=c}const{width:u}=s.measureText(e.textContent);u>0&&(l=`scaleX(${h*n/u})`)}0!==i.angle&&(l=`rotate(${i.angle}deg) ${l}`);l.length>0&&(o.transform=l)}class TextLayerRenderTask{constructor(t){let{textContentSource:e,container:n,viewport:r,textDivs:a,textDivProperties:o,textContentItemsStr:l,isOffscreenCanvasSupported:c}=t;this._textContentSource=e;this._isReadableStream=e instanceof ReadableStream;this._container=this._rootContainer=n;this._textDivs=a||[];this._textContentItemsStr=l||[];this._isOffscreenCanvasSupported=c;this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled;this._reader=null;this._textDivProperties=o||new WeakMap;this._canceled=!1;this._capability=new i.PromiseCapability;this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:r.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:getCtx(0,c)};const{pageWidth:h,pageHeight:d,pageX:u,pageY:p}=r.rawDims;this._transform=[1,0,0,-1,-u,p+d];this._pageWidth=h;this._pageHeight=d;(0,s.setLayerDimensions)(n,r);this._capability.promise.finally((()=>{this._layoutTextParams=null})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0;if(this._reader){this._reader.cancel(new i.AbortException("TextLayer task cancelled.")).catch((()=>{}));this._reader=null}this._capability.reject(new i.AbortException("TextLayer task cancelled."))}_processItems(t,e){for(const n of t)if(void 0!==n.str){this._textContentItemsStr.push(n.str);appendText(this,n,e)}else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const t=this._container;this._container=document.createElement("span");this._container.classList.add("markedContent");null!==n.id&&this._container.setAttribute("id",`${n.id}`);t.append(this._container)}else"endMarkedContent"===n.type&&(this._container=this._container.parentNode)}_layoutText(t){const e=this._layoutTextParams.properties=this._textDivProperties.get(t);this._layoutTextParams.div=t;layout(this._layoutTextParams);e.hasText&&this._container.append(t);if(e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation");this._container.append(t)}}_render(){const t=new i.PromiseCapability;let e=Object.create(null);if(this._isReadableStream){const pump=()=>{this._reader.read().then((n=>{let{value:i,done:s}=n;if(s)t.resolve();else{Object.assign(e,i.styles);this._processItems(i.items,e);pump()}}),t.reject)};this._reader=this._textContentSource.getReader();pump()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:e,styles:n}=this._textContentSource;this._processItems(e,n);t.resolve()}}t.promise.then((()=>{e=null;!function render(t){if(t._canceled)return;const e=t._textDivs,n=t._capability;if(e.length>1e5)n.resolve();else{if(!t._isReadableStream)for(const n of e)t._layoutText(n);n.resolve()}}(this)}),this._capability.reject)}}e.TextLayerRenderTask=TextLayerRenderTask},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditorLayer=void 0;var i=n(1),s=n(133),r=n(134),a=n(156),o=n(161),l=n(135),c=n(162);class AnnotationEditorLayer{#Kt;#Yt=!1;#Jt=null;#Qt=this.pointerup.bind(this);#Zt=this.pointerdown.bind(this);#te=new Map;#ee=!1;#ne=!1;#ie=!1;#se;static _initialized=!1;constructor(t){let{uiManager:e,pageIndex:n,div:i,accessibilityManager:s,annotationLayer:r,viewport:l,l10n:h}=t;const d=[a.FreeTextEditor,o.InkEditor,c.StampEditor];if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;for(const t of d)t.initialize(h)}e.registerEditorTypes(d);this.#se=e;this.pageIndex=n;this.div=i;this.#Kt=s;this.#Jt=r;this.viewport=l;this.#se.addLayer(this)}get isEmpty(){return 0===this.#te.size}updateToolbar(t){this.#se.updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.#se.getMode();this.#re();if(t===i.AnnotationEditorType.INK){this.addInkEditorIfNeeded(!1);this.disableClick()}else this.enableClick();this.#se.unselectAll();if(t!==i.AnnotationEditorType.NONE){this.div.classList.toggle("freeTextEditing",t===i.AnnotationEditorType.FREETEXT);this.div.classList.toggle("inkEditing",t===i.AnnotationEditorType.INK);this.div.classList.toggle("stampEditing",t===i.AnnotationEditorType.STAMP);this.div.hidden=!1}}addInkEditorIfNeeded(t){if(!t&&this.#se.getMode()!==i.AnnotationEditorType.INK)return;if(!t)for(const t of this.#te.values())if(t.isEmpty()){t.setInBackground();return}this.#ae({offsetX:0,offsetY:0}).setInBackground()}setEditingState(t){this.#se.setEditingState(t)}addCommands(t){this.#se.addCommands(t)}enable(){this.div.style.pointerEvents="auto";const t=new Set;for(const e of this.#te.values()){e.enableEditing();e.annotationElementId&&t.add(e.annotationElementId)}if(!this.#Jt)return;const e=this.#Jt.getEditableAnnotations();for(const n of e){n.hide();if(this.#se.isDeletedAnnotationElement(n.data.id))continue;if(t.has(n.data.id))continue;const e=this.deserialize(n);if(e){this.addOrRebuild(e);e.enableEditing()}}}disable(){this.#ie=!0;this.div.style.pointerEvents="none";const t=new Set;for(const e of this.#te.values()){e.disableEditing();if(e.annotationElementId&&null===e.serialize()){this.getEditableAnnotation(e.annotationElementId)?.show();e.remove()}else t.add(e.annotationElementId)}if(this.#Jt){const e=this.#Jt.getEditableAnnotations();for(const n of e){const{id:e}=n.data;t.has(e)||this.#se.isDeletedAnnotationElement(e)||n.show()}}this.#re();this.isEmpty&&(this.div.hidden=!0);this.#ie=!1}getEditableAnnotation(t){return this.#Jt?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#se.getActive()!==t&&this.#se.setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",this.#Zt);this.div.addEventListener("pointerup",this.#Qt)}disableClick(){this.div.removeEventListener("pointerdown",this.#Zt);this.div.removeEventListener("pointerup",this.#Qt)}attach(t){this.#te.set(t.id,t);const{annotationElementId:e}=t;e&&this.#se.isDeletedAnnotationElement(e)&&this.#se.removeDeletedAnnotationElement(t)}detach(t){this.#te.delete(t.id);this.#Kt?.removePointerInTextLayer(t.contentDiv);!this.#ie&&t.annotationElementId&&this.#se.addDeletedAnnotationElement(t)}remove(t){this.detach(t);this.#se.removeEditor(t);t.div.style.display="none";setTimeout((()=>{t.div.style.display="";t.div.remove();t.isAttachedToDOM=!1;document.activeElement===document.body&&this.#se.focusMainContainer()}),0);this.#ne||this.addInkEditorIfNeeded(!1)}#oe(t){if(t.parent!==this){if(t.annotationElementId){this.#se.addDeletedAnnotationElement(t.annotationElementId);s.AnnotationEditor.deleteAnnotationElement(t);t.annotationElementId=null}this.attach(t);t.parent?.detach(t);t.setParent(this);if(t.div&&t.isAttachedToDOM){t.div.remove();this.div.append(t.div)}}}add(t){this.#oe(t);this.#se.addEditor(t);this.attach(t);if(!t.isAttachedToDOM){const e=t.render();this.div.append(e);t.isAttachedToDOM=!0}this.moveEditorInDOM(t);t.onceAdded();this.#se.addToAnnotationStorage(t)}moveEditorInDOM(t){this.#Kt?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#se.getId()}#le(t){switch(this.#se.getMode()){case i.AnnotationEditorType.FREETEXT:return new a.FreeTextEditor(t);case i.AnnotationEditorType.INK:return new o.InkEditor(t);case i.AnnotationEditorType.STAMP:return new c.StampEditor(t)}return null}deserialize(t){switch(t.annotationType??t.annotationEditorType){case i.AnnotationEditorType.FREETEXT:return a.FreeTextEditor.deserialize(t,this,this.#se);case i.AnnotationEditorType.INK:return o.InkEditor.deserialize(t,this,this.#se);case i.AnnotationEditorType.STAMP:return c.StampEditor.deserialize(t,this,this.#se)}return null}#ae(t){const e=this.getNextId(),n=this.#le({parent:this,id:e,x:t.offsetX,y:t.offsetY,uiManager:this.#se});n&&this.add(n);return n}setSelected(t){this.#se.setSelected(t)}toggleSelected(t){this.#se.toggleSelected(t)}isSelected(t){return this.#se.isSelected(t)}unselect(t){this.#se.unselect(t)}pointerup(t){const{isMac:e}=i.FeatureTest.platform;if(!(0!==t.button||t.ctrlKey&&e)&&t.target===this.div&&this.#ee){this.#ee=!1;this.#Yt?this.#ae(t):this.#Yt=!0}}pointerdown(t){const{isMac:e}=i.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;this.#ee=!0;const n=this.#se.getActive();this.#Yt=!n||n.isEmpty()}drop(t){const e=t.dataTransfer.getData("text/plain"),n=this.#se.getEditor(e);if(!n)return;t.preventDefault();t.dataTransfer.dropEffect="move";this.#oe(n);const i=this.div.getBoundingClientRect(),s=t.clientX-i.x,r=t.clientY-i.y;n.translate(s-n.startX,r-n.startY);this.moveEditorInDOM(n);n.div.focus()}dragover(t){t.preventDefault()}destroy(){this.#se.getActive()?.parent===this&&this.#se.setActiveEditor(null);for(const t of this.#te.values()){this.#Kt?.removePointerInTextLayer(t.contentDiv);t.setParent(null);t.isAttachedToDOM=!1;t.div.remove()}this.div=null;this.#te.clear();this.#se.removeLayer(this)}#re(){this.#ne=!0;for(const t of this.#te.values())t.isEmpty()&&t.remove();this.#ne=!1}render(t){let{viewport:e}=t;this.viewport=e;(0,l.setLayerDimensions)(this.div,e);(0,r.bindEvents)(this,this.div,["dragover","drop"]);for(const t of this.#se.getEditors(this.pageIndex))this.add(t);this.updateMode()}update(t){let{viewport:e}=t;this.#se.commitOrRemove();this.viewport=e;(0,l.setLayerDimensions)(this.div,{rotation:e.rotation});this.updateMode()}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}}e.AnnotationEditorLayer=AnnotationEditorLayer},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.FreeTextEditor=void 0;var i=n(1),s=n(134),r=n(133),a=n(157);class FreeTextEditor extends r.AnnotationEditor{#ce=this.editorDivBlur.bind(this);#he=this.editorDivFocus.bind(this);#de=this.editorDivInput.bind(this);#ue=this.editorDivKeydown.bind(this);#pe;#fe="";#ge=`${this.id}-editor`;#me;#be=null;static _freeTextDefaultContent="";static _l10nPromise;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){return(0,i.shadow)(this,"_keyboardManager",new s.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],FreeTextEditor.prototype.commitOrRemove,!0],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],FreeTextEditor.prototype.commitOrRemove]]))}static _type="freetext";constructor(t){super({...t,name:"freeTextEditor"});this.#pe=t.color||FreeTextEditor._defaultColor||r.AnnotationEditor._defaultLineColor;this.#me=t.fontSize||FreeTextEditor._defaultFontSize}static initialize(t){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map((e=>[e,t.get(e)])));const e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case i.AnnotationEditorParamsType.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=e;break;case i.AnnotationEditorParamsType.FREETEXT_COLOR:FreeTextEditor._defaultColor=e}}updateParams(t,e){switch(t){case i.AnnotationEditorParamsType.FREETEXT_SIZE:this.#ve(e);break;case i.AnnotationEditorParamsType.FREETEXT_COLOR:this.#ye(e)}}static get defaultPropertiesToUpdate(){return[[i.AnnotationEditorParamsType.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[i.AnnotationEditorParamsType.FREETEXT_COLOR,FreeTextEditor._defaultColor||r.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[i.AnnotationEditorParamsType.FREETEXT_SIZE,this.#me],[i.AnnotationEditorParamsType.FREETEXT_COLOR,this.#pe]]}#ve(t){const setFontsize=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`;this.translate(0,-(t-this.#me)*this.parentScale);this.#me=t;this.#Ae()},e=this.#me;this.addCommands({cmd:()=>{setFontsize(t)},undo:()=>{setFontsize(e)},mustExec:!0,type:i.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#ye(t){const e=this.#pe;this.addCommands({cmd:()=>{this.#pe=this.editorDiv.style.color=t},undo:()=>{this.#pe=this.editorDiv.style.color=e},mustExec:!0,type:i.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}getInitialTranslation(){const t=this.parentScale;return[-FreeTextEditor._internalPadding*t,-(FreeTextEditor._internalPadding+this.#me)*t]}rebuild(){super.rebuild();null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){if(!this.isInEditMode()){this.parent.setEditingState(!1);this.parent.updateToolbar(i.AnnotationEditorType.FREETEXT);super.enableEditMode();this.overlayDiv.classList.remove("enabled");this.editorDiv.contentEditable=!0;this.div.draggable=!1;this.div.removeAttribute("aria-activedescendant");this.editorDiv.addEventListener("keydown",this.#ue);this.editorDiv.addEventListener("focus",this.#he);this.editorDiv.addEventListener("blur",this.#ce);this.editorDiv.addEventListener("input",this.#de)}}disableEditMode(){if(this.isInEditMode()){this.parent.setEditingState(!0);super.disableEditMode();this.overlayDiv.classList.add("enabled");this.editorDiv.contentEditable=!1;this.div.setAttribute("aria-activedescendant",this.#ge);this.div.draggable=!0;this.editorDiv.removeEventListener("keydown",this.#ue);this.editorDiv.removeEventListener("focus",this.#he);this.editorDiv.removeEventListener("blur",this.#ce);this.editorDiv.removeEventListener("input",this.#de);this.div.focus({preventScroll:!0});this.isEditing=!1;this.parent.div.classList.add("freeTextEditing")}}focusin(t){super.focusin(t);t.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){if(this.width)this.#_e();else{this.enableEditMode();this.editorDiv.focus()}}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1;if(this.parent){this.parent.setEditingState(!0);this.parent.div.classList.add("freeTextEditing")}super.remove()}#Se(){const t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;const e=[];for(const n of t)e.push(n.innerText.replace(/\r\n?|\n/,""));return e.join("\n")}#Ae(){const[t,e]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,i=e.style.display;e.style.display="hidden";t.div.append(this.div);n=e.getBoundingClientRect();e.remove();e.style.display=i}if(this.rotation%180==this.parentRotation%180){this.width=n.width/t;this.height=n.height/e}else{this.width=n.height/t;this.height=n.width/e}}commit(){if(!this.isInEditMode())return;super.commit();this.disableEditMode();const t=this.#fe,e=this.#fe=this.#Se().trimEnd();if(t===e)return;const setText=t=>{this.#fe=t;if(t){this.#xe();this.rebuild();this.#Ae()}else this.remove()};this.addCommands({cmd:()=>{setText(e)},undo:()=>{setText(t)},mustExec:!1});this.#Ae()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode();this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&this.enterInEditMode()}editorDivKeydown(t){FreeTextEditor._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment");this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox");this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();this.editorDiv=document.createElement("div");this.editorDiv.className="internal";this.editorDiv.setAttribute("id",this.#ge);this.enableEditing();FreeTextEditor._l10nPromise.get("editor_free_text2_aria_label").then((t=>this.editorDiv?.setAttribute("aria-label",t)));FreeTextEditor._l10nPromise.get("free_text2_default_content").then((t=>this.editorDiv?.setAttribute("default-content",t)));this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;n.fontSize=`calc(${this.#me}px * var(--scale-factor))`;n.color=this.#pe;this.div.append(this.editorDiv);this.overlayDiv=document.createElement("div");this.overlayDiv.classList.add("overlay","enabled");this.div.append(this.overlayDiv);(0,s.bindEvents)(this,this.div,["dblclick","keydown"]);if(this.width){const[n,i]=this.parentDimensions;if(this.annotationElementId){const[s]=this.getInitialTranslation();this.setAt(t*n,e*i,s,s)}else this.setAt(t*n,e*i,this.width*n,this.height*i);this.#xe();this.div.draggable=!0;this.editorDiv.contentEditable=!1}else{this.div.draggable=!1;this.editorDiv.contentEditable=!0}return this.div}#xe(){this.editorDiv.replaceChildren();if(this.#fe)for(const t of this.#fe.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br"));this.editorDiv.append(e)}}get contentDiv(){return this.editorDiv}static deserialize(t,e,n){let s=null;if(t instanceof a.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:e,fontColor:n},rect:r,rotation:a,id:o},textContent:l,parent:{page:{pageNumber:c}}}=t;if(!l||0===l.length)return null;s=t={annotationType:i.AnnotationEditorType.FREETEXT,color:Array.from(n),fontSize:e,value:l.join("\n"),pageIndex:c-1,rect:r,rotation:a,id:o,deleted:!1}}const r=super.deserialize(t,e,n);r.#me=t.fontSize;r.#pe=i.Util.makeHexColor(...t.color);r.#fe=t.value;r.annotationElementId=t.id||null;r.#be=s;return r}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const e=FreeTextEditor._internalPadding*this.parentScale,n=this.getRect(e,e),s=r.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#pe),a={annotationType:i.AnnotationEditorType.FREETEXT,color:s,fontSize:this.#me,value:this.#fe,pageIndex:this.pageIndex,rect:n,rotation:this.rotation};if(t)return a;if(this.annotationElementId&&!this.#Ee(a))return null;a.id=this.annotationElementId;return a}#Ee(t){const{value:e,fontSize:n,color:i,rect:s,pageIndex:r}=this.#be;return t.value!==e||t.fontSize!==n||t.rect.some(((t,e)=>Math.abs(t-s[e])>=1))||t.color.some(((t,e)=>t!==i[e]))||t.pageIndex!==r}#_e(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.annotationElementId)return;this.#Ae();if(!t&&(0===this.width||0===this.height)){setTimeout((()=>this.#_e(!0)),0);return}const e=FreeTextEditor._internalPadding*this.parentScale;this.#be.rect=this.getRect(e,e)}}e.FreeTextEditor=FreeTextEditor},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.StampAnnotationElement=e.InkAnnotationElement=e.FreeTextAnnotationElement=e.AnnotationLayer=void 0;var i=n(1),s=n(135),r=n(132),a=n(158),o=n(159);const l=1e3,c=new WeakSet;function getRectDims(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class AnnotationElementFactory{static create(t){switch(t.data.annotationType){case i.AnnotationType.LINK:return new LinkAnnotationElement(t);case i.AnnotationType.TEXT:return new TextAnnotationElement(t);case i.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new TextWidgetAnnotationElement(t);case"Btn":return t.data.radioButton?new RadioButtonWidgetAnnotationElement(t):t.data.checkBox?new CheckboxWidgetAnnotationElement(t):new PushButtonWidgetAnnotationElement(t);case"Ch":return new ChoiceWidgetAnnotationElement(t);case"Sig":return new SignatureWidgetAnnotationElement(t)}return new WidgetAnnotationElement(t);case i.AnnotationType.POPUP:return new PopupAnnotationElement(t);case i.AnnotationType.FREETEXT:return new FreeTextAnnotationElement(t);case i.AnnotationType.LINE:return new LineAnnotationElement(t);case i.AnnotationType.SQUARE:return new SquareAnnotationElement(t);case i.AnnotationType.CIRCLE:return new CircleAnnotationElement(t);case i.AnnotationType.POLYLINE:return new PolylineAnnotationElement(t);case i.AnnotationType.CARET:return new CaretAnnotationElement(t);case i.AnnotationType.INK:return new InkAnnotationElement(t);case i.AnnotationType.POLYGON:return new PolygonAnnotationElement(t);case i.AnnotationType.HIGHLIGHT:return new HighlightAnnotationElement(t);case i.AnnotationType.UNDERLINE:return new UnderlineAnnotationElement(t);case i.AnnotationType.SQUIGGLY:return new SquigglyAnnotationElement(t);case i.AnnotationType.STRIKEOUT:return new StrikeOutAnnotationElement(t);case i.AnnotationType.STAMP:return new StampAnnotationElement(t);case i.AnnotationType.FILEATTACHMENT:return new FileAttachmentAnnotationElement(t);default:return new AnnotationElement(t)}}}class AnnotationElement{constructor(t){let{isRenderable:e=!1,ignoreBorder:n=!1,createQuadrilaterals:i=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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.enableScripting=t.enableScripting;this.hasJSActions=t.hasJSActions;this._fieldObjects=t.fieldObjects;this.parent=t.parent;e&&(this.container=this._createContainer(n));i&&(this.quadrilaterals=this._createQuadrilaterals(n))}_createContainer(t){const{data:e,parent:{page:n,viewport:s}}=this,r=document.createElement("section");r.setAttribute("data-annotation-id",e.id);r.style.zIndex=this.parent.zIndex++;this.data.popupRef&&r.setAttribute("aria-haspopup","dialog");e.noRotate&&r.classList.add("norotate");const{pageWidth:a,pageHeight:o,pageX:l,pageY:c}=s.rawDims;if(!e.rect||this instanceof PopupAnnotationElement){const{rotation:t}=e;e.hasOwnCanvas||0===t||this.setRotation(t,r);return r}const{width:h,height:d}=getRectDims(e.rect),u=i.Util.normalizeRect([e.rect[0],n.view[3]-e.rect[1]+n.view[1],e.rect[2],n.view[3]-e.rect[3]+n.view[1]]);if(!t&&e.borderStyle.width>0){r.style.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,n=e.borderStyle.verticalCornerRadius;if(t>0||n>0){const e=`calc(${t}px * var(--scale-factor)) / calc(${n}px * var(--scale-factor))`;r.style.borderRadius=e}else if(this instanceof RadioButtonWidgetAnnotationElement){const t=`calc(${h}px * var(--scale-factor)) / calc(${d}px * var(--scale-factor))`;r.style.borderRadius=t}switch(e.borderStyle.style){case i.AnnotationBorderStyleType.SOLID:r.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:r.style.borderStyle="dashed";break;case i.AnnotationBorderStyleType.BEVELED:(0,i.warn)("Unimplemented border style: beveled");break;case i.AnnotationBorderStyleType.INSET:(0,i.warn)("Unimplemented border style: inset");break;case i.AnnotationBorderStyleType.UNDERLINE:r.style.borderBottomStyle="solid"}const s=e.borderColor||null;s?r.style.borderColor=i.Util.makeHexColor(0|s[0],0|s[1],0|s[2]):r.style.borderWidth=0}r.style.left=100*(u[0]-l)/a+"%";r.style.top=100*(u[1]-c)/o+"%";const{rotation:p}=e;if(e.hasOwnCanvas||0===p){r.style.width=100*h/a+"%";r.style.height=100*d/o+"%"}else this.setRotation(p,r);return r}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;const{pageWidth:n,pageHeight:i}=this.parent.viewport.rawDims,{width:s,height:r}=getRectDims(this.data.rect);let a,o;if(t%180==0){a=100*s/n;o=100*r/i}else{a=100*r/n;o=100*s/i}e.style.width=`${a}%`;e.style.height=`${o}%`;e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const setColor=(t,e,n)=>{const i=n.detail[t];n.target.style[e]=a.ColorConverters[`${i[0]}_HTML`](i.slice(1))};return(0,i.shadow)(this,"_commonActions",{display:t=>{const e=t.detail.display%2==1;this.container.style.visibility=e?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{hidden:e,print:0===t.detail.display||3===t.detail.display})},print:t=>{this.annotationStorage.setValue(this.data.id,{print:t.detail.print})},hidden:t=>{this.container.style.visibility=t.detail.hidden?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{hidden:t.detail.hidden})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.detail.readonly?t.target.setAttribute("readonly",""):t.target.removeAttribute("readonly")},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{setColor("bgColor","backgroundColor",t)},fillColor:t=>{setColor("fillColor","backgroundColor",t)},fgColor:t=>{setColor("fgColor","color",t)},textColor:t=>{setColor("textColor","color",t)},borderColor:t=>{setColor("borderColor","borderColor",t)},strokeColor:t=>{setColor("strokeColor","borderColor",t)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e);this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const n=this._commonActions;for(const i of Object.keys(e.detail)){const s=t[i]||n[i];s?.(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const n=this._commonActions;for(const[i,s]of Object.entries(e)){const r=n[i];if(r){r({detail:{[i]:s},target:t});delete e[i]}}}_createQuadrilaterals(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.data.quadPoints)return null;const e=[],n=this.data.rect;let i=null;for(const n of this.data.quadPoints){this.data.rect=[n[2].x,n[2].y,n[1].x,n[1].y];e.push(this._createContainer(t));i||=this.data.rect}this.data.rect=n;this.firstQuadRect=i;return e}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const n=new PopupAnnotationElement({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:this.firstQuadRect||e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]});this.parent.div.append(n.render())}_renderQuadrilaterals(t){for(const e of this.quadrilaterals)e.classList.add(t);return this.quadrilaterals}render(){(0,i.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[];if(this._fieldObjects){const s=this._fieldObjects[t];if(s)for(const{page:t,id:r,exportValues:a}of s){if(-1===t)continue;if(r===e)continue;const s="string"==typeof a?a:null,o=document.querySelector(`[data-element-id="${r}"]`);!o||c.has(o)?n.push({id:r,exportValue:s,domElement:o}):(0,i.warn)(`_getElementsByName - element not allowed: ${r}`)}return n}for(const i of document.getElementsByName(t)){const{exportValue:t}=i,s=i.getAttribute("data-element-id");s!==e&&(c.has(i)&&n.push({id:s,exportValue:t,domElement:i}))}return n}show(){this.container&&(this.container.hidden=!1);this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0);this.popup?.forceHide()}getElementsToTriggerPopup(){return this.quadrilaterals||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(){const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",(()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})}))}}class LinkAnnotationElement extends AnnotationElement{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0});this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,n=document.createElement("a");n.setAttribute("data-element-id",t.id);let i=!1;if(t.url){e.addLinkAttributes(n,t.url,t.newWindow);i=!0}else if(t.action){this._bindNamedAction(n,t.action);i=!0}else if(t.attachment){this._bindAttachment(n,t.attachment);i=!0}else if(t.setOCGState){this.#Ce(n,t.setOCGState);i=!0}else if(t.dest){this._bindLink(n,t.dest);i=!0}else{if(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions){this._bindJSAction(n,t);i=!0}if(t.resetForm){this._bindResetFormAction(n,t.resetForm);i=!0}else if(this.isTooltipOnly&&!i){this._bindLink(n,"");i=!0}}if(this.quadrilaterals)return this._renderQuadrilaterals("linkAnnotation").map(((t,e)=>{const i=0===e?n:n.cloneNode();t.append(i);return t}));this.container.classList.add("linkAnnotation");i&&this.container.append(n);return this.container}#we(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e);t.onclick=()=>{e&&this.linkService.goToDestination(e);return!1};(e||""===e)&&this.#we()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeNamedAction(e);return!1};this.#we()}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.downloadManager?.openOrDownloadData(this.container,e.content,e.filename);return!1};this.#we()}#Ce(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeSetOCGState(e);return!1};this.#we()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(e.actions)){const s=n.get(i);s&&(t[s]=()=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:i}});return!1})}t.onclick||(t.onclick=()=>!1);this.#we()}_bindResetFormAction(t,e){const n=t.onclick;n||(t.href=this.linkService.getAnchorUrl(""));this.#we();if(this._fieldObjects)t.onclick=()=>{n?.();const{fields:t,refs:s,include:r}=e,a=[];if(0!==t.length||0!==s.length){const e=new Set(s);for(const n of t){const t=this._fieldObjects[n]||[];for(const{id:n}of t)e.add(n)}for(const t of Object.values(this._fieldObjects))for(const n of t)e.has(n.id)===r&&a.push(n)}else for(const t of Object.values(this._fieldObjects))a.push(...t);const o=this.annotationStorage,l=[];for(const t of a){const{id:e}=t;l.push(e);switch(t.type){case"text":{const n=t.defaultValue||"";o.setValue(e,{value:n});break}case"checkbox":case"radiobutton":{const n=t.defaultValue===t.exportValues;o.setValue(e,{value:n});break}case"combobox":case"listbox":{const n=t.defaultValue||"";o.setValue(e,{value:n});break}default:continue}const n=document.querySelector(`[data-element-id="${e}"]`);n&&(c.has(n)?n.dispatchEvent(new Event("resetform")):(0,i.warn)(`_bindResetFormAction - element not allowed: ${e}`))}this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}});return!1};else{(0,i.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.');n||(t.onclick=()=>!1)}}}class TextAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.popupRef||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str)})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg";t.alt="[{{type}} Annotation]";t.dataset.l10nId="text_annotation_type";t.dataset.l10nArgs=JSON.stringify({type:this.data.name});this.data.popupRef||this._createPopup();this.container.append(t);return this.container}}class WidgetAnnotationElement extends AnnotationElement{render(){this.data.alternativeText&&(this.container.title=this.data.alternativeText);return this.container}showElementAndHideCanvas(t){if(this.data.hasOwnCanvas){"CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0);t.hidden=!1}}_getKeyModifier(t){const{isWin:e,isMac:n}=i.FeatureTest.platform;return e&&t.ctrlKey||n&&t.metaKey}_setEventListener(t,e,n,i){e.includes("mouse")?t.addEventListener(e,(t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:i(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(e,(t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:i(t)}})}))}_setEventListeners(t,e,n){for(const[i,s]of e)("Action"===s||this.data.actions?.[s])&&this._setEventListener(t,i,s,n)}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":i.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||9,r=t.style;let a;const roundToOneDecimal=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(i.LINE_FACTOR*s))||1);a=Math.min(s,roundToOneDecimal(e/i.LINE_FACTOR))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(s,roundToOneDecimal(t/i.LINE_FACTOR))}r.fontSize=`calc(${a}px * var(--scale-factor))`;r.color=i.Util.makeHexColor(n[0],n[1],n[2]);null!==this.data.textAlignment&&(r.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required");t.setAttribute("aria-required",e)}}class TextWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,n,i){const s=this.annotationStorage;for(const r of this._getElementsByName(t.name,t.id)){r.domElement&&(r.domElement[e]=n);s.setValue(r.id,{[i]:n})}}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const i=t.getValue(e,{value:this.data.fieldValue});let s=i.value||"";const r=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;r&&s.length>r&&(s=s.slice(0,r));let a=i.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const o={userValue:s,formattedValue:a,lastCommittedValue:null,commitKey:1};if(this.data.multiLine){n=document.createElement("textarea");n.textContent=a??s;this.data.doNotScroll&&(n.style.overflowY="hidden")}else{n=document.createElement("input");n.type="text";n.setAttribute("value",a??s);this.data.doNotScroll&&(n.style.overflowX="hidden")}this.data.hasOwnCanvas&&(n.hidden=!0);c.add(n);n.setAttribute("data-element-id",e);n.disabled=this.data.readOnly;n.name=this.data.baseFieldName||this.data.fieldName;n.tabIndex=l;this._setRequired(n,this.data.required);r&&(n.maxLength=r);n.addEventListener("input",(i=>{t.setValue(e,{value:i.target.value});this.setPropertyOnSiblings(n,"value",i.target.value,"value");o.formattedValue=null}));n.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue??"";n.value=o.userValue=e;o.formattedValue=null}));let blurListener=t=>{const{formattedValue:e}=o;null!=e&&(t.target.value=e);t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",(t=>{const{target:e}=t;o.userValue&&(e.value=o.userValue);o.lastCommittedValue=e.value;o.commitKey=1}));n.addEventListener("updatefromsandbox",(n=>{this.showElementAndHideCanvas(n.target);const i={value(n){o.userValue=n.detail.value??"";t.setValue(e,{value:o.userValue.toString()});n.target.value=o.userValue},formattedValue(n){const{formattedValue:i}=n.detail;o.formattedValue=i;null!=i&&n.target!==document.activeElement&&(n.target.value=i);t.setValue(e,{formattedValue:i})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:n=>{const{charLimit:i}=n.detail,{target:s}=n;if(0===i){s.removeAttribute("maxLength");return}s.setAttribute("maxLength",i);let r=o.userValue;if(r&&!(r.length<=i)){r=r.slice(0,i);s.value=o.userValue=r;t.setValue(e,{value:r});this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:s.selectionStart,selEnd:s.selectionEnd}})}}};this._dispatchEventFromSandbox(i,n)}));n.addEventListener("keydown",(t=>{o.commitKey=1;let n=-1;"Escape"===t.key?n=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(o.commitKey=3):n=2;if(-1===n)return;const{value:i}=t.target;if(o.lastCommittedValue!==i){o.lastCommittedValue=i;o.userValue=i;this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,willCommit:!0,commitKey:n,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}}));const i=blurListener;blurListener=null;n.addEventListener("blur",(t=>{if(!t.relatedTarget)return;const{value:n}=t.target;o.userValue=n;o.lastCommittedValue!==n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:o.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}});i(t)}));this.data.actions?.Keystroke&&n.addEventListener("beforeinput",(t=>{o.lastCommittedValue=null;const{data:n,target:i}=t,{value:s,selectionStart:r,selectionEnd:a}=i;let l=r,c=a;switch(t.inputType){case"deleteWordBackward":{const t=s.substring(0,r).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=s.substring(r).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":r===a&&(l-=1);break;case"deleteContentForward":r===a&&(c+=1)}t.preventDefault();this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,change:n||"",willCommit:!1,selStart:l,selEnd:c}})}));this._setEventListeners(n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}blurListener&&n.addEventListener("blur",blurListener);if(this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/r;n.classList.add("comb");n.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else{n=document.createElement("div");n.textContent=this.data.fieldValue;n.style.verticalAlign="middle";n.style.display="table-cell"}this._setTextStyle(n);this._setBackgroundColor(n);this._setDefaultPropertiesFromJS(n);this.container.append(n);return this.container}}class SignatureWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,n=e.id;let i=t.getValue(n,{value:e.exportValue===e.fieldValue}).value;if("string"==typeof i){i="Off"!==i;t.setValue(n,{value:i})}this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");c.add(s);s.setAttribute("data-element-id",n);s.disabled=e.readOnly;this._setRequired(s,this.data.required);s.type="checkbox";s.name=e.baseFieldName||e.fieldName;i&&s.setAttribute("checked",!0);s.setAttribute("exportValue",e.exportValue);s.tabIndex=l;s.addEventListener("change",(i=>{const{name:s,checked:r}=i.target;for(const i of this._getElementsByName(s,n)){const n=r&&i.exportValue===e.exportValue;i.domElement&&(i.domElement.checked=n);t.setValue(i.id,{value:n})}t.setValue(n,{value:r})}));s.addEventListener("resetform",(t=>{const n=e.defaultFieldValue||"Off";t.target.checked=n===e.exportValue}));if(this.enableScripting&&this.hasJSActions){s.addEventListener("updatefromsandbox",(e=>{const i={value(e){e.target.checked="Off"!==e.detail.value;t.setValue(n,{value:e.target.checked})}};this._dispatchEventFromSandbox(i,e)}));this._setEventListeners(s,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}this._setBackgroundColor(s);this._setDefaultPropertiesFromJS(s);this.container.append(s);return this.container}}class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,n=e.id;let i=t.getValue(n,{value:e.fieldValue===e.buttonValue}).value;if("string"==typeof i){i=i!==e.buttonValue;t.setValue(n,{value:i})}const s=document.createElement("input");c.add(s);s.setAttribute("data-element-id",n);s.disabled=e.readOnly;this._setRequired(s,this.data.required);s.type="radio";s.name=e.baseFieldName||e.fieldName;i&&s.setAttribute("checked",!0);s.tabIndex=l;s.addEventListener("change",(e=>{const{name:i,checked:s}=e.target;for(const e of this._getElementsByName(i,n))t.setValue(e.id,{value:!1});t.setValue(n,{value:s})}));s.addEventListener("resetform",(t=>{const n=e.defaultFieldValue;t.target.checked=null!=n&&n===e.buttonValue}));if(this.enableScripting&&this.hasJSActions){const i=e.buttonValue;s.addEventListener("updatefromsandbox",(e=>{const s={value:e=>{const s=i===e.detail.value;for(const i of this._getElementsByName(e.target.name)){const e=s&&i.id===n;i.domElement&&(i.domElement.checked=e);t.setValue(i.id,{value:e})}}};this._dispatchEventFromSandbox(s,e)}));this._setEventListeners(s,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}this._setBackgroundColor(s);this._setDefaultPropertiesFromJS(s);this.container.append(s);return this.container}}class PushButtonWidgetAnnotationElement extends LinkAnnotationElement{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");this.data.alternativeText&&(t.title=this.data.alternativeText);const e=t.lastChild;if(this.enableScripting&&this.hasJSActions&&e){this._setDefaultPropertiesFromJS(e);e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))}return t}}class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,n=t.getValue(e,{value:this.data.fieldValue}),i=document.createElement("select");c.add(i);i.setAttribute("data-element-id",e);i.disabled=this.data.readOnly;this._setRequired(i,this.data.required);i.name=this.data.baseFieldName||this.data.fieldName;i.tabIndex=l;let s=this.data.combo&&this.data.options.length>0;if(!this.data.combo){i.size=this.data.options.length;this.data.multiSelect&&(i.multiple=!0)}i.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const t of i.options)t.selected=t.value===e}));for(const t of this.data.options){const e=document.createElement("option");e.textContent=t.displayValue;e.value=t.exportValue;if(n.value.includes(t.exportValue)){e.setAttribute("selected",!0);s=!1}i.append(e)}let r=null;if(s){const t=document.createElement("option");t.value=" ";t.setAttribute("hidden",!0);t.setAttribute("selected",!0);i.prepend(t);r=()=>{t.remove();i.removeEventListener("input",r);r=null};i.addEventListener("input",r)}const getValue=t=>{const e=t?"value":"textContent",{options:n,multiple:s}=i;return s?Array.prototype.filter.call(n,(t=>t.selected)).map((t=>t[e])):-1===n.selectedIndex?null:n[n.selectedIndex][e]};let a=getValue(!1);const getItems=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};if(this.enableScripting&&this.hasJSActions){i.addEventListener("updatefromsandbox",(n=>{const s={value(n){r?.();const s=n.detail.value,o=new Set(Array.isArray(s)?s:[s]);for(const t of i.options)t.selected=o.has(t.value);t.setValue(e,{value:getValue(!0)});a=getValue(!1)},multipleSelection(t){i.multiple=!0},remove(n){const s=i.options,r=n.detail.remove;s[r].selected=!1;i.remove(r);if(s.length>0){-1===Array.prototype.findIndex.call(s,(t=>t.selected))&&(s[0].selected=!0)}t.setValue(e,{value:getValue(!0),items:getItems(n)});a=getValue(!1)},clear(n){for(;0!==i.length;)i.remove(0);t.setValue(e,{value:null,items:[]});a=getValue(!1)},insert(n){const{index:s,displayValue:r,exportValue:o}=n.detail.insert,l=i.children[s],c=document.createElement("option");c.textContent=r;c.value=o;l?l.before(c):i.append(c);t.setValue(e,{value:getValue(!0),items:getItems(n)});a=getValue(!1)},items(n){const{items:s}=n.detail;for(;0!==i.length;)i.remove(0);for(const t of s){const{displayValue:e,exportValue:n}=t,s=document.createElement("option");s.textContent=e;s.value=n;i.append(s)}i.options.length>0&&(i.options[0].selected=!0);t.setValue(e,{value:getValue(!0),items:getItems(n)});a=getValue(!1)},indices(n){const i=new Set(n.detail.indices);for(const t of n.target.options)t.selected=i.has(t.index);t.setValue(e,{value:getValue(!0)});a=getValue(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(s,n)}));i.addEventListener("input",(n=>{const i=getValue(!0);t.setValue(e,{value:i});n.preventDefault();this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,changeEx:i,willCommit:!1,commitKey:1,keyDown:!1}})}));this._setEventListeners(i,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))}else i.addEventListener("input",(function(n){t.setValue(e,{value:getValue(!0)})}));this.data.combo&&this._setTextStyle(i);this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}class PopupAnnotationElement extends AnnotationElement{constructor(t){const{data:e,elements:n}=t;super(t,{isRenderable:!!(e.titleObj?.str||e.contentsObj?.str||e.richText?.str)});this.elements=n}render(){this.container.classList.add("popupAnnotation");const t=new PopupElement({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,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}),e=[];for(const n of this.elements){n.popup=t;e.push(n.data.id);n.addHighlightArea()}this.container.setAttribute("aria-controls",e.join(","));return this.container}}class PopupElement{#Te=null;#Pe=this.#ke.bind(this);#Fe=this.#Me.bind(this);#Re=this.#Ie.bind(this);#pe=null;#lt=null;#De=null;#Oe=null;#Le=null;#Ne=null;#je=!1;#Be=null;#Ue=null;#He=null;#ze=null;#We=!1;constructor(t){let{container:e,color:n,elements:i,titleObj:r,modificationDate:a,contentsObj:o,richText:l,parent:c,rect:h,parentRect:d,open:u}=t;this.#lt=e;this.#ze=r;this.#De=o;this.#He=l;this.#Le=c;this.#pe=n;this.#Ue=h;this.#Ne=d;this.#Oe=i;const p=s.PDFDateString.toDateObject(a);p&&(this.#Te=c.l10n.get("annotation_date_string",{date:p.toLocaleDateString(),time:p.toLocaleTimeString()}));this.trigger=i.flatMap((t=>t.getElementsToTriggerPopup()));for(const t of this.trigger){t.addEventListener("click",this.#Re);t.addEventListener("mouseenter",this.#Fe);t.addEventListener("mouseleave",this.#Pe)}this.#lt.hidden=!0;u&&this.#Ie()}render(){if(this.#Be)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:n,pageX:s,pageY:r}}}=this.#Le,a=this.#Be=document.createElement("div");a.className="popup";if(this.#pe){const t=a.style.outlineColor=i.Util.makeHexColor(...this.#pe);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))a.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`;else{const t=.7;a.style.backgroundColor=i.Util.makeHexColor(...this.#pe.map((e=>Math.floor(t*(255-e)+e))))}}const l=document.createElement("span");l.className="header";const c=document.createElement("h1");l.append(c);({dir:c.dir,str:c.textContent}=this.#ze);a.append(l);if(this.#Te){const t=document.createElement("span");t.classList.add("popupDate");this.#Te.then((e=>{t.textContent=e}));l.append(t)}const h=this.#De,d=this.#He;if(!d?.str||h?.str&&h.str!==d.str){const t=this._formatContents(h);a.append(t)}else{o.XfaLayer.render({xfaHtml:d.html,intent:"richText",div:a});a.lastChild.classList.add("richText","popupContent")}let u=!!this.#Ne,p=u?this.#Ne:this.#Ue;for(const t of this.#Oe)if(!p||null!==i.Util.intersect(t.data.rect,p)){p=t.data.rect;u=!0;break}const f=i.Util.normalizeRect([p[0],t[3]-p[1]+t[1],p[2],t[3]-p[3]+t[1]]),g=u?p[2]-p[0]+5:0,m=f[0]+g,b=f[1],{style:v}=this.#lt;v.left=100*(m-s)/e+"%";v.top=100*(b-r)/n+"%";this.#lt.append(a)}_formatContents(t){let{str:e,dir:n}=t;const i=document.createElement("p");i.classList.add("popupContent");i.dir=n;const s=e.split(/(?:\r\n?|\n)/);for(let t=0,e=s.length;t0&&this.#Je.set(n.data.id,n);const s=n.render();t.hidden&&(s.style.visibility="hidden");if(Array.isArray(s))for(const e of s)this.#Qe(e,t.id);else this.#Qe(s,t.id)}this.#Ze();await this.l10n.translate(n)}update(t){let{viewport:e}=t;const n=this.div;this.viewport=e;(0,s.setLayerDimensions)(n,{rotation:e.rotation});this.#Ze();n.hidden=!1}#Ze(){if(!this.#Ye)return;const t=this.div;for(const[e,n]of this.#Ye){const i=t.querySelector(`[data-annotation-id="${e}"]`);if(!i)continue;const{firstChild:s}=i;s?"CANVAS"===s.nodeName?s.replaceWith(n):s.before(n):i.append(n)}this.#Ye.clear()}getEditableAnnotations(){return Array.from(this.#Je.values())}getEditableAnnotation(t){return this.#Je.get(t)}}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.ColorConverters=void 0;function makeColorComp(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}e.ColorConverters=class ColorConverters{static CMYK_G(t){let[e,n,i,s]=t;return["G",1-Math.min(1,.3*e+.59*i+.11*n+s)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_HTML(t){let[e]=t;const n=makeColorComp(e);return`#${n}${n}${n}`}static RGB_G(t){let[e,n,i]=t;return["G",.3*e+.59*n+.11*i]}static RGB_HTML(t){let[e,n,i]=t;return`#${makeColorComp(e)}${makeColorComp(n)}${makeColorComp(i)}`}static T_HTML(){return"#00000000"}static CMYK_RGB(t){let[e,n,i,s]=t;return["RGB",1-Math.min(1,e+s),1-Math.min(1,i+s),1-Math.min(1,n+s)]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,n,i]=t;const s=1-e,r=1-n,a=1-i;return["CMYK",s,r,a,Math.min(s,r,a)]}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.XfaLayer=void 0;var i=n(147);e.XfaLayer=class XfaLayer{static setupStorage(t,e,n,i,s){const r=i.getValue(e,{value:null});switch(n.name){case"textarea":null!==r.value&&(t.textContent=r.value);if("print"===s)break;t.addEventListener("input",(t=>{i.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){r.value===n.attributes.xfaOn?t.setAttribute("checked",!0):r.value===n.attributes.xfaOff&&t.removeAttribute("checked");if("print"===s)break;t.addEventListener("change",(t=>{i.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{null!==r.value&&t.setAttribute("value",r.value);if("print"===s)break;t.addEventListener("input",(t=>{i.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==r.value)for(const t of n.children)t.attributes.value===r.value&&(t.attributes.selected=!0);t.addEventListener("input",(t=>{const n=t.target.options,s=-1===n.selectedIndex?"":n[n.selectedIndex].value;i.setValue(e,{value:s})}))}}static setAttributes(t){let{html:e,element:n,storage:i=null,intent:s,linkService:r}=t;const{attributes:a}=n,o=e instanceof HTMLAnchorElement;"radio"===a.type&&(a.name=`${a.name}-${s}`);for(const[t,n]of Object.entries(a))if(null!=n)switch(t){case"class":n.length&&e.setAttribute(t,n.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",n);break;case"style":Object.assign(e.style,n);break;case"textContent":e.textContent=n;break;default:(!o||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,n)}o&&r.addLinkAttributes(e,a.href,a.newWindow);i&&a.dataId&&this.setupStorage(e,a.dataId,n,i)}static render(t){const e=t.annotationStorage,n=t.linkService,s=t.xfaHtml,r=t.intent||"display",a=document.createElement(s.name);s.attributes&&this.setAttributes({html:a,element:s,intent:r,linkService:n});const o=[[s,-1,a]],l=t.div;l.append(a);if(t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=e}"richText"!==r&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){const[t,s,a]=o.at(-1);if(s+1===t.children.length){o.pop();continue}const l=t.children[++o.at(-1)[1]];if(null===l)continue;const{name:h}=l;if("#text"===h){const t=document.createTextNode(l.value);c.push(t);a.append(t);continue}let d;d=l?.attributes?.xmlns?document.createElementNS(l.attributes.xmlns,h):document.createElement(h);a.append(d);l.attributes&&this.setAttributes({html:d,element:l,storage:e,intent:r,linkService:n});if(l.children&&l.children.length>0)o.push([l,-1,d]);else if(l.value){const t=document.createTextNode(l.value);i.XfaText.shouldBuildText(h)&&c.push(t);d.append(t)}}for(const t of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e;t.div.hidden=!1}}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.NullL10n=void 0;e.getL10nFallback=getL10nFallback;const n={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",print_progress_percent:"{{progress}}%"};function getL10nFallback(t,e){switch(t){case"find_match_count":t=`find_match_count[${1===e.total?"one":"other"}]`;break;case"find_match_count_limit":t=`find_match_count_limit[${1===e.limit?"one":"other"}]`}return n[t]||""}const i={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",async get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function formatL10nValue(t,e){return e?t.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,((t,n)=>n in e?e[n]:"{{"+n+"}}")):t}(arguments.length>2&&void 0!==arguments[2]?arguments[2]:getL10nFallback(t,e),e)},async translate(t){}};e.NullL10n=i},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.InkEditor=void 0;var i=n(1),s=n(133),r=n(157),a=n(134);class InkEditor extends s.AnnotationEditor{#tn=0;#en=0;#nn=this.canvasContextMenu.bind(this);#in=this.canvasPointermove.bind(this);#sn=this.canvasPointerleave.bind(this);#rn=this.canvasPointerup.bind(this);#an=this.canvasPointerdown.bind(this);#on=new Path2D;#ln=!1;#cn=!1;#hn=!1;#dn=null;#un=0;#pn=0;#fn=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _l10nPromise;static _type="ink";constructor(t){super({...t,name:"inkEditor"});this.color=t.color||null;this.thickness=t.thickness||null;this.opacity=t.opacity||null;this.paths=[];this.bezierPath2D=[];this.allRawPaths=[];this.currentPath=[];this.scaleFactor=1;this.translationX=this.translationY=0;this.x=0;this.y=0}static initialize(t){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map((e=>[e,t.get(e)])))}static updateDefaultParams(t,e){switch(t){case i.AnnotationEditorParamsType.INK_THICKNESS:InkEditor._defaultThickness=e;break;case i.AnnotationEditorParamsType.INK_COLOR:InkEditor._defaultColor=e;break;case i.AnnotationEditorParamsType.INK_OPACITY:InkEditor._defaultOpacity=e/100}}updateParams(t,e){switch(t){case i.AnnotationEditorParamsType.INK_THICKNESS:this.#gn(e);break;case i.AnnotationEditorParamsType.INK_COLOR:this.#ye(e);break;case i.AnnotationEditorParamsType.INK_OPACITY:this.#mn(e)}}static get defaultPropertiesToUpdate(){return[[i.AnnotationEditorParamsType.INK_THICKNESS,InkEditor._defaultThickness],[i.AnnotationEditorParamsType.INK_COLOR,InkEditor._defaultColor||s.AnnotationEditor._defaultLineColor],[i.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*InkEditor._defaultOpacity)]]}get propertiesToUpdate(){return[[i.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||InkEditor._defaultThickness],[i.AnnotationEditorParamsType.INK_COLOR,this.color||InkEditor._defaultColor||s.AnnotationEditor._defaultLineColor],[i.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??InkEditor._defaultOpacity))]]}#gn(t){const e=this.thickness;this.addCommands({cmd:()=>{this.thickness=t;this.#bn()},undo:()=>{this.thickness=e;this.#bn()},mustExec:!0,type:i.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#ye(t){const e=this.color;this.addCommands({cmd:()=>{this.color=t;this.#vn()},undo:()=>{this.color=e;this.#vn()},mustExec:!0,type:i.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#mn(t){t/=100;const e=this.opacity;this.addCommands({cmd:()=>{this.opacity=t;this.#vn()},undo:()=>{this.opacity=e;this.#vn()},mustExec:!0,type:i.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){super.rebuild();if(null!==this.div){if(!this.canvas){this.#yn();this.#An()}if(!this.isAttachedToDOM){this.parent.add(this);this.#_n()}this.#bn()}}remove(){if(null!==this.canvas){this.isEmpty()||this.commit();this.canvas.width=this.canvas.height=0;this.canvas.remove();this.canvas=null;this.#dn.disconnect();this.#dn=null;super.remove()}}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this);super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,n=this.width*t,i=this.height*e;this.setDimensions(n,i)}enableEditMode(){if(!this.#ln&&null!==this.canvas){super.enableEditMode();this.div.draggable=!1;this.canvas.addEventListener("pointerdown",this.#an)}}disableEditMode(){if(this.isInEditMode()&&null!==this.canvas){super.disableEditMode();this.div.draggable=!this.isEmpty();this.div.classList.remove("editing");this.canvas.removeEventListener("pointerdown",this.#an)}}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#Sn(){const{parentRotation:t,parentDimensions:[e,n]}=this;switch(t){case 90:return[0,n,n,e];case 180:return[e,n,e,n];case 270:return[e,0,n,e];default:return[0,0,e,n]}}#xn(){const{ctx:t,color:e,opacity:n,thickness:i,parentScale:s,scaleFactor:r}=this;t.lineWidth=i*s/r;t.lineCap="round";t.lineJoin="round";t.miterLimit=10;t.strokeStyle=`${e}${(0,a.opacityToHex)(n)}`}#En(t,e){this.canvas.addEventListener("contextmenu",this.#nn);this.canvas.addEventListener("pointerleave",this.#sn);this.canvas.addEventListener("pointermove",this.#in);this.canvas.addEventListener("pointerup",this.#rn);this.canvas.removeEventListener("pointerdown",this.#an);this.isEditing=!0;if(!this.#hn){this.#hn=!0;this.#_n();this.thickness||=InkEditor._defaultThickness;this.color||=InkEditor._defaultColor||s.AnnotationEditor._defaultLineColor;this.opacity??=InkEditor._defaultOpacity}this.currentPath.push([t,e]);this.#cn=!1;this.#xn();this.#fn=()=>{this.#Cn();this.#fn&&window.requestAnimationFrame(this.#fn)};window.requestAnimationFrame(this.#fn)}#wn(t,e){const[n,i]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===n&&e===i)return;const s=this.currentPath;let r=this.#on;s.push([t,e]);this.#cn=!0;if(s.length<=2){r.moveTo(...s[0]);r.lineTo(t,e)}else{if(3===s.length){this.#on=r=new Path2D;r.moveTo(...s[0])}this.#Tn(r,...s.at(-3),...s.at(-2),t,e)}}#Pn(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);this.#on.lineTo(...t)}#kn(t,e){this.#fn=null;t=Math.min(Math.max(t,0),this.canvas.width);e=Math.min(Math.max(e,0),this.canvas.height);this.#wn(t,e);this.#Pn();let n;if(1!==this.currentPath.length)n=this.#Fn();else{const i=[t,e];n=[[i,i.slice(),i.slice(),i]]}const i=this.#on,s=this.currentPath;this.currentPath=[];this.#on=new Path2D;this.addCommands({cmd:()=>{this.allRawPaths.push(s);this.paths.push(n);this.bezierPath2D.push(i);this.rebuild()},undo:()=>{this.allRawPaths.pop();this.paths.pop();this.bezierPath2D.pop();if(0===this.paths.length)this.remove();else{if(!this.canvas){this.#yn();this.#An()}this.#bn()}},mustExec:!0})}#Cn(){if(!this.#cn)return;this.#cn=!1;const t=Math.ceil(this.thickness*this.parentScale),e=this.currentPath.slice(-3),n=e.map((t=>t[0])),i=e.map((t=>t[1])),{ctx:s}=(Math.min(...n),Math.max(...n),Math.min(...i),Math.max(...i),this);s.save();s.clearRect(0,0,this.canvas.width,this.canvas.height);for(const t of this.bezierPath2D)s.stroke(t);s.stroke(this.#on);s.restore()}#Tn(t,e,n,i,s,r,a){const o=(e+i)/2,l=(n+s)/2,c=(i+r)/2,h=(s+a)/2;t.bezierCurveTo(o+2*(i-o)/3,l+2*(s-l)/3,c+2*(i-c)/3,h+2*(s-h)/3,c,h)}#Fn(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let n,[i,s]=t[0];for(n=1;n{this.canvas.removeEventListener("contextmenu",this.#nn)}),10);this.#kn(t.offsetX,t.offsetY);this.addToAnnotationStorage();this.setInBackground()}#yn(){this.canvas=document.createElement("canvas");this.canvas.width=this.canvas.height=0;this.canvas.className="inkEditorCanvas";InkEditor._l10nPromise.get("editor_ink_canvas_aria_label").then((t=>this.canvas?.setAttribute("aria-label",t)));this.div.append(this.canvas);this.ctx=this.canvas.getContext("2d")}#An(){this.#dn=new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}));this.#dn.observe(this.div)}render(){if(this.div)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();InkEditor._l10nPromise.get("editor_ink2_aria_label").then((t=>this.div?.setAttribute("aria-label",t)));const[n,i,s,r]=this.#Sn();this.setAt(n,i,0,0);this.setDims(s,r);this.#yn();if(this.width){const[n,i]=this.parentDimensions;this.setAspectRatio(this.width*n,this.height*i);this.setAt(t*n,e*i,this.width*n,this.height*i);this.#hn=!0;this.#_n();this.setDims(this.width*n,this.height*i);this.#vn();this.div.classList.add("disabled")}else{this.div.classList.add("editing");this.enableEditMode()}this.#An();return this.div}#_n(){if(!this.#hn)return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t);this.canvas.height=Math.ceil(this.height*e);this.#Mn()}setDimensions(t,e){const n=Math.round(t),i=Math.round(e);if(this.#un===n&&this.#pn===i)return;this.#un=n;this.#pn=i;this.canvas.style.visibility="hidden";const[s,r]=this.parentDimensions;this.width=t/s;this.height=e/r;this.#ln&&this.#In(t,e);this.#_n();this.#vn();this.canvas.style.visibility="visible";this.fixDims()}#In(t,e){const n=this.#Dn(),i=(t-n)/this.#en,s=(e-n)/this.#tn;this.scaleFactor=Math.min(i,s)}#Mn(){const t=this.#Dn()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static#On(t){const e=new Path2D;for(let n=0,i=t.length;n0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!this.#ln){this.#vn();return}const e=this.#Bn(),n=this.#Dn();this.#en=Math.max(s.AnnotationEditor.MIN_SIZE,e[2]-e[0]);this.#tn=Math.max(s.AnnotationEditor.MIN_SIZE,e[3]-e[1]);const i=Math.ceil(n+this.#en*this.scaleFactor),r=Math.ceil(n+this.#tn*this.scaleFactor),[a,o]=this.parentDimensions;this.width=i/a;this.height=r/o;this.setAspectRatio(i,r);const l=this.translationX,c=this.translationY;this.translationX=-e[0];this.translationY=-e[1];this.#_n();this.#vn();this.#un=i;this.#pn=r;this.setDims(i,r);const h=t?n/this.scaleFactor/2:0;this.translate(l-this.translationX-h,c-this.translationY-h)}static deserialize(t,e,n){if(t instanceof r.InkAnnotationElement)return null;const a=super.deserialize(t,e,n);a.thickness=t.thickness;a.color=i.Util.makeHexColor(...t.color);a.opacity=t.opacity;const[o,l]=a.pageDimensions,c=a.width*o,h=a.height*l,d=a.parentScale,u=t.thickness/2;a.#ln=!0;a.#un=Math.round(c);a.#pn=Math.round(h);const{paths:p,rect:f,rotation:g}=t;for(let{bezier:t}of p){t=InkEditor.#Nn(t,f,g);const e=[];a.paths.push(e);let n=d*(t[0]-u),i=d*(t[1]-u);for(let s=2,r=t.length;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.StampEditor=void 0;var i=n(133),s=n(1),r=n(135),a=n(157);class StampEditor extends i.AnnotationEditor{#Un=null;#Hn=null;#zn=null;#Wn=null;#qn=null;#dn=null;#Gn=null;#Vn=!1;static _type="stamp";constructor(t){super({...t,name:"stampEditor"});this.#Wn=t.bitmapUrl}#Xn(){if(this.#Hn){this._uiManager.imageManager.getFromId(this.#Hn).then((t=>{if(t){this.#Un=t.bitmap;this.#yn()}else this.remove()}));return}if(this.#Wn){const t=this.#Wn;this.#Wn=null;this.#zn=this._uiManager.imageManager.getFromUrl(t).then((t=>{this.#zn=null;if(t){({bitmap:this.#Un,id:this.#Hn,isSvg:this.#Vn}=t);this.#yn()}else this.remove()}));return}const t=document.createElement("input");t.type="file";t.accept="image/*";this.#zn=new Promise((e=>{t.addEventListener("change",(async()=>{this.#zn=null;if(t.files&&0!==t.files.length){const e=await this._uiManager.imageManager.getFromFile(t.files[0]);if(!e){this.remove();return}({bitmap:this.#Un,id:this.#Hn,isSvg:this.#Vn}=e);this.#yn()}else this.remove();e()}));t.addEventListener("cancel",(()=>{this.#zn=null;this.remove();e()}))}));t.click()}remove(){if(this.#Hn){this.#Un=null;this._uiManager.imageManager.deleteId(this.#Hn);this.#qn?.remove();this.#qn=null;this.#dn?.disconnect();this.#dn=null}super.remove()}rebuild(){super.rebuild();if(null!==this.div){this.#Hn&&this.#Xn();this.isAttachedToDOM||this.parent.add(this)}}onceAdded(){this.div.draggable=!0;this.parent.addUndoableEditor(this);this.div.focus()}isEmpty(){return null===this.#zn&&null===this.#Un&&null===this.#Wn}render(){if(this.div)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();if(this.#Un)this.#yn();else{this.div.classList.add("loading");this.#Xn()}if(this.width){const[n,i]=this.parentDimensions;this.setAspectRatio(this.width*n,this.height*i);this.setAt(t*n,e*i,this.width*n,this.height*i)}return this.div}#yn(){const{div:t}=this;let{width:e,height:n}=this.#Un;const[i,s]=this.pageDimensions,r=.75;if(this.width){e=this.width*i;n=this.height*s}else if(e>r*i||n>r*s){const t=Math.min(r*i/e,r*s/n);e*=t;n*=t}const[a,o]=this.parentDimensions;this.setDims(e*a/i,n*o/s);this.setAspectRatio(e,n);const l=this.#qn=document.createElement("canvas");t.append(l);this.#$n(e,n);this.#An();t.classList.remove("loading")}#Kn(t,e){const[n,i]=this.parentDimensions;if(Math.abs(t-this.width*n)<1&&Math.abs(e-this.height*i)<1)return;this.width=t/n;this.height=e/i;this.setDims(t,e);null!==this.#Gn&&clearTimeout(this.#Gn);this.#Gn=setTimeout((()=>{this.#Gn=null;this.#$n(t,e)}),200)}#Yn(t,e){const{width:n,height:i}=this.#Un;let s=n,r=i,a=this.#Un;for(;s>2*t||r>2*e;){const n=s,i=r;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2));r>2*e&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2));const o=new OffscreenCanvas(s,r);o.getContext("2d").drawImage(a,0,0,n,i,0,0,s,r);a=o.transferToImageBitmap()}return a}#$n(t,e){const n=this.#qn;if(!n||n.width===t&&n.height===e)return;n.width=t;n.height=e;const i=this.#Vn?this.#Un:this.#Yn(t,e),s=n.getContext("2d");s.filter=this._uiManager.hcmFilter;s.drawImage(i,0,0,i.width,i.height,0,0,t,e)}#Jn(t){if(t){if(this.#Vn){const t=this._uiManager.imageManager.getSvgUrl(this.#Hn);if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=this.#Un);t.getContext("2d").drawImage(this.#Un,0,0);return t.toDataURL()}if(this.#Vn){const[t,e]=this.pageDimensions,n=Math.round(this.width*t*r.PixelsPerInch.PDF_TO_CSS_UNITS),i=Math.round(this.height*e*r.PixelsPerInch.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(n,i);s.getContext("2d").drawImage(this.#Un,0,0,this.#Un.width,this.#Un.height,0,0,n,i);return s.transferToImageBitmap()}return structuredClone(this.#Un)}#An(){this.#dn=new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.#Kn(e.width,e.height)}));this.#dn.observe(this.div)}static deserialize(t,e,n){if(t instanceof a.StampAnnotationElement)return null;const i=super.deserialize(t,e,n),{rect:s,bitmapUrl:r,bitmapId:o,isSvg:l}=t;o&&n.imageManager.isValidId(o)?i.#Hn=o:i.#Wn=r;i.#Vn=l;const[c,h]=i.pageDimensions;i.width=(s[2]-s[0])/c;i.height=(s[3]-s[1])/h;return i}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;const n={annotationType:s.AnnotationEditorType.STAMP,bitmapId:this.#Hn,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#Vn};if(t){n.bitmapUrl=this.#Jn(!0);return n}if(null===e)return n;e.stamps||=new Map;const i=this.#Vn?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(e.stamps.has(this.#Hn)){if(this.#Vn){const t=e.stamps.get(this.#Hn);if(i>t.area){t.area=i;t.serialized.bitmap.close();t.serialized.bitmap=this.#Jn(!1)}}}else{e.stamps.set(this.#Hn,{area:i,serialized:n});n.bitmap=this.#Jn(!1)}return n}}e.StampEditor=StampEditor},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.SVGGraphics=void 0;var i=n(135),s=n(1),r=n(3);const a="normal",o="normal",l="#000000",c=["butt","round","square"],h=["miter","round","bevel"],createObjectURL=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!=typeof Blob&&!n)return URL.createObjectURL(new Blob([t],{type:e}));const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s=`data:${e};base64,`;for(let e=0,n=t.length;e>2]+i[(3&r)<<4|a>>4]+i[e+1>6:64]+i[e+2>1&2147483647:n>>1&2147483647;e[t]=n}function writePngChunk(t,n,i,s){let r=s;const a=n.length;i[r]=a>>24&255;i[r+1]=a>>16&255;i[r+2]=a>>8&255;i[r+3]=255&a;r+=4;i[r]=255&t.charCodeAt(0);i[r+1]=255&t.charCodeAt(1);i[r+2]=255&t.charCodeAt(2);i[r+3]=255&t.charCodeAt(3);r+=4;i.set(n,r);r+=n.length;const o=function crc32(t,n,i){let s=-1;for(let r=n;r>>8^e[n]}return-1^s}(i,s+4,r);i[r]=o>>24&255;i[r+1]=o>>16&255;i[r+2]=o>>8&255;i[r+3]=255&o}function deflateSyncUncompressed(t){let e=t.length;const n=65535,i=Math.ceil(e/n),s=new Uint8Array(2+e+5*i+4);let r=0;s[r++]=120;s[r++]=156;let a=0;for(;e>n;){s[r++]=0;s[r++]=255;s[r++]=255;s[r++]=0;s[r++]=0;s.set(t.subarray(a,a+n),r);r+=n;a+=n;e-=n}s[r++]=1;s[r++]=255&e;s[r++]=e>>8&255;s[r++]=255&~e;s[r++]=(65535&~e)>>8&255;s.set(t.subarray(a),r);r+=t.length-a;const o=function adler32(t,e,n){let i=1,s=0;for(let r=e;r>24&255;s[r++]=o>>16&255;s[r++]=o>>8&255;s[r++]=255&o;return s}function encode(e,n,i,a){const o=e.width,l=e.height;let c,h,d;const u=e.data;switch(n){case s.ImageKind.GRAYSCALE_1BPP:h=0;c=1;d=o+7>>3;break;case s.ImageKind.RGB_24BPP:h=2;c=8;d=3*o;break;case s.ImageKind.RGBA_32BPP:h=6;c=8;d=4*o;break;default:throw new Error("invalid format")}const p=new Uint8Array((1+d)*l);let f=0,g=0;for(let t=0;t>24&255,o>>16&255,o>>8&255,255&o,l>>24&255,l>>16&255,l>>8&255,255&l,c,h,0,0,0]),b=function deflateSync(t){if(!r.isNodeJS)return deflateSyncUncompressed(t);try{let e;e=parseInt(process.versions.node)>=8?t:Buffer.from(t);const n=require("zlib").deflateSync(e,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(t){(0,s.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return deflateSyncUncompressed(t)}(p),v=t.length+36+m.length+b.length,y=new Uint8Array(v);let A=0;y.set(t,A);A+=t.length;writePngChunk("IHDR",m,y,A);A+=12+m.length;writePngChunk("IDATA",b,y,A);A+=12+b.length;writePngChunk("IEND",new Uint8Array(0),y,A);return createObjectURL(y,"image/png",i)}return function convertImgDataToPng(t,e,n){return encode(t,void 0===t.kind?s.ImageKind.GRAYSCALE_1BPP:t.kind,e,n)}}();class SVGExtraState{constructor(){this.fontSizeScale=1;this.fontWeight=o;this.fontSize=0;this.textMatrix=s.IDENTITY_MATRIX;this.fontMatrix=s.FONT_IDENTITY_MATRIX;this.leading=0;this.textRenderingMode=s.TextRenderingMode.FILL;this.textMatrixScale=1;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRise=0;this.fillColor=l;this.strokeColor="#000000";this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.lineJoin="";this.lineCap="";this.miterLimit=0;this.dashArray=[];this.dashPhase=0;this.dependencies=[];this.activeClipUrl=null;this.clipGroup=null;this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(t,e){this.x=t;this.y=e}}function pf(t){if(Number.isInteger(t))return t.toString();const e=t.toFixed(10);let n=e.length-1;if("0"!==e[n])return e;do{n--}while("0"===e[n]);return e.substring(0,"."===e[n]?n:n+1)}function pm(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":`scale(${pf(t[0])} ${pf(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2]){return`rotate(${pf(180*Math.acos(t[0])/Math.PI)})`}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${pf(t[4])} ${pf(t[5])})`;return`matrix(${pf(t[0])} ${pf(t[1])} ${pf(t[2])} ${pf(t[3])} ${pf(t[4])} ${pf(t[5])})`}let u=0,p=0,f=0;e.SVGGraphics=class SVGGraphics{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,i.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future.");this.svgFactory=new i.DOMSVGFactory;this.current=new SVGExtraState;this.transformMatrix=s.IDENTITY_MATRIX;this.transformStack=[];this.extraStack=[];this.commonObjs=t;this.objs=e;this.pendingClip=null;this.pendingEOFill=!1;this.embedFonts=!1;this.embeddedFonts=Object.create(null);this.cssStyle=null;this.forceDataSchema=!!n;this._operatorIdMapping=[];for(const t in s.OPS)this._operatorIdMapping[s.OPS[t]]=t}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}save(){this.transformStack.push(this.transformMatrix);const t=this.current;this.extraStack.push(t);this.current=t.clone()}restore(){this.transformMatrix=this.transformStack.pop();this.current=this.extraStack.pop();this.pendingClip=null;this.tgrp=null}group(t){this.save();this.executeOpTree(t);this.restore()}loadDependencies(t){const e=t.fnArray,n=t.argsArray;for(let t=0,i=e.length;t{t.get(e,n)}));this.current.dependencies.push(n)}return Promise.all(this.current.dependencies)}transform(t,e,n,i,r,a){const o=[t,e,n,i,r,a];this.transformMatrix=s.Util.transform(this.transformMatrix,o);this.tgrp=null}getSVG(t,e){this.viewport=e;const n=this._initialize(e);return this.loadDependencies(t).then((()=>{this.transformMatrix=s.IDENTITY_MATRIX;this.executeOpTree(this.convertOpList(t));return n}))}convertOpList(t){const e=this._operatorIdMapping,n=t.argsArray,i=t.fnArray,s=[];for(let t=0,r=i.length;t0&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=c[t]}setLineJoin(t){this.current.lineJoin=h[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,n){this.current.strokeColor=s.Util.makeHexColor(t,e,n)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,n){this.current.fillColor=s.Util.makeHexColor(t,e,n);this.current.tspan=this.svgFactory.createElement("svg:tspan");this.current.xcoords=[];this.current.ycoords=[]}setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}shadingFill(t){const{width:e,height:n}=this.viewport,i=s.Util.inverseTransform(this.transformMatrix),[r,a,o,l]=s.Util.getAxialAlignedBoundingBox([0,0,e,n],i),c=this.svgFactory.createElement("svg:rect");c.setAttributeNS(null,"x",r);c.setAttributeNS(null,"y",a);c.setAttributeNS(null,"width",o-r);c.setAttributeNS(null,"height",l-a);c.setAttributeNS(null,"fill",this._makeShadingPattern(t));this.current.fillAlpha<1&&c.setAttributeNS(null,"fill-opacity",this.current.fillAlpha);this._ensureTransformGroup().append(c)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){const e=t[1],n=t[2],i=t[3]||s.IDENTITY_MATRIX,[r,a,o,l]=t[4],c=t[5],h=t[6],d=t[7],u="shading"+f++,[p,g,m,b]=s.Util.normalizeRect([...s.Util.applyTransform([r,a],i),...s.Util.applyTransform([o,l],i)]),[v,y]=s.Util.singularValueDecompose2dScale(i),A=c*v,_=h*y,S=this.svgFactory.createElement("svg:pattern");S.setAttributeNS(null,"id",u);S.setAttributeNS(null,"patternUnits","userSpaceOnUse");S.setAttributeNS(null,"width",A);S.setAttributeNS(null,"height",_);S.setAttributeNS(null,"x",`${p}`);S.setAttributeNS(null,"y",`${g}`);const x=this.svg,E=this.transformMatrix,C=this.current.fillColor,w=this.current.strokeColor,T=this.svgFactory.create(m-p,b-g);this.svg=T;this.transformMatrix=i;if(2===d){const t=s.Util.makeHexColor(...e);this.current.fillColor=t;this.current.strokeColor=t}this.executeOpTree(this.convertOpList(n));this.svg=x;this.transformMatrix=E;this.current.fillColor=C;this.current.strokeColor=w;S.append(T.childNodes[0]);this.defs.append(S);return`url(#${u})`}_makeShadingPattern(t){"string"==typeof t&&(t=this.objs.get(t));switch(t[0]){case"RadialAxial":const e="shading"+f++,n=t[3];let i;switch(t[1]){case"axial":const n=t[4],s=t[5];i=this.svgFactory.createElement("svg:linearGradient");i.setAttributeNS(null,"id",e);i.setAttributeNS(null,"gradientUnits","userSpaceOnUse");i.setAttributeNS(null,"x1",n[0]);i.setAttributeNS(null,"y1",n[1]);i.setAttributeNS(null,"x2",s[0]);i.setAttributeNS(null,"y2",s[1]);break;case"radial":const r=t[4],a=t[5],o=t[6],l=t[7];i=this.svgFactory.createElement("svg:radialGradient");i.setAttributeNS(null,"id",e);i.setAttributeNS(null,"gradientUnits","userSpaceOnUse");i.setAttributeNS(null,"cx",a[0]);i.setAttributeNS(null,"cy",a[1]);i.setAttributeNS(null,"r",l);i.setAttributeNS(null,"fx",r[0]);i.setAttributeNS(null,"fy",r[1]);i.setAttributeNS(null,"fr",o);break;default:throw new Error(`Unknown RadialAxial type: ${t[1]}`)}for(const t of n){const e=this.svgFactory.createElement("svg:stop");e.setAttributeNS(null,"offset",t[0]);e.setAttributeNS(null,"stop-color",t[1]);i.append(e)}this.defs.append(i);return`url(#${e})`;case"Mesh":(0,s.warn)("Unimplemented pattern Mesh");return null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${t[0]}`)}}setDash(t,e){this.current.dashArray=t;this.current.dashPhase=e}constructPath(t,e){const n=this.current;let i=n.x,r=n.y,a=[],o=0;for(const n of t)switch(0|n){case s.OPS.rectangle:i=e[o++];r=e[o++];const t=i+e[o++],n=r+e[o++];a.push("M",pf(i),pf(r),"L",pf(t),pf(r),"L",pf(t),pf(n),"L",pf(i),pf(n),"Z");break;case s.OPS.moveTo:i=e[o++];r=e[o++];a.push("M",pf(i),pf(r));break;case s.OPS.lineTo:i=e[o++];r=e[o++];a.push("L",pf(i),pf(r));break;case s.OPS.curveTo:i=e[o+4];r=e[o+5];a.push("C",pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]),pf(i),pf(r));o+=6;break;case s.OPS.curveTo2:a.push("C",pf(i),pf(r),pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]));i=e[o+2];r=e[o+3];o+=4;break;case s.OPS.curveTo3:i=e[o+2];r=e[o+3];a.push("C",pf(e[o]),pf(e[o+1]),pf(i),pf(r),pf(i),pf(r));o+=4;break;case s.OPS.closePath:a.push("Z")}a=a.join(" ");if(n.path&&t.length>0&&t[0]!==s.OPS.rectangle&&t[0]!==s.OPS.moveTo)a=n.path.getAttributeNS(null,"d")+a;else{n.path=this.svgFactory.createElement("svg:path");this._ensureTransformGroup().append(n.path)}n.path.setAttributeNS(null,"d",a);n.path.setAttributeNS(null,"fill","none");n.element=n.path;n.setCurrentPoint(i,r)}endPath(){const t=this.current;t.path=null;if(!this.pendingClip)return;if(!t.element){this.pendingClip=null;return}const e="clippath"+u++,n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",e);n.setAttributeNS(null,"transform",pm(this.transformMatrix));const i=t.element.cloneNode(!0);"evenodd"===this.pendingClip?i.setAttributeNS(null,"clip-rule","evenodd"):i.setAttributeNS(null,"clip-rule","nonzero");this.pendingClip=null;n.append(i);this.defs.append(n);if(t.activeClipUrl){t.clipGroup=null;for(const t of this.extraStack)t.clipGroup=null;n.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl=`url(#${e})`;this.tgrp=null}clip(t){this.pendingClip=t}closePath(){const t=this.current;if(t.path){const e=`${t.path.getAttributeNS(null,"d")}Z`;t.path.setAttributeNS(null,"d",e)}}setLeading(t){this.current.leading=-t}setTextRise(t){this.current.textRise=t}setTextRenderingMode(t){this.current.textRenderingMode=t}setHScale(t){this.current.textHScale=t/100}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,n]of t)switch(e){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n);break;case"CA":this.setStrokeAlpha(n);break;case"ca":this.setFillAlpha(n);break;default:(0,s.warn)(`Unimplemented graphic state operator ${e}`)}}fill(){const t=this.current;if(t.element){t.element.setAttributeNS(null,"fill",t.fillColor);t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha);this.endPath()}}stroke(){const t=this.current;if(t.element){this._setStrokeAttributes(t.element);t.element.setAttributeNS(null,"fill","none");this.endPath()}}_setStrokeAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=this.current;let i=n.dashArray;1!==e&&i.length>0&&(i=i.map((function(t){return e*t})));t.setAttributeNS(null,"stroke",n.strokeColor);t.setAttributeNS(null,"stroke-opacity",n.strokeAlpha);t.setAttributeNS(null,"stroke-miterlimit",pf(n.miterLimit));t.setAttributeNS(null,"stroke-linecap",n.lineCap);t.setAttributeNS(null,"stroke-linejoin",n.lineJoin);t.setAttributeNS(null,"stroke-width",pf(e*n.lineWidth)+"px");t.setAttributeNS(null,"stroke-dasharray",i.map(pf).join(" "));t.setAttributeNS(null,"stroke-dashoffset",pf(e*n.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd");this.fill()}fillStroke(){this.stroke();this.fill()}eoFillStroke(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd");this.fillStroke()}closeStroke(){this.closePath();this.stroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.closePath();this.eoFillStroke()}paintSolidColorImageMask(){const t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0");t.setAttributeNS(null,"y","0");t.setAttributeNS(null,"width","1px");t.setAttributeNS(null,"height","1px");t.setAttributeNS(null,"fill",this.current.fillColor);this._ensureTransformGroup().append(t)}paintImageXObject(t){const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,s.warn)(`Dependent image with object ID ${t} is not ready yet`)}paintInlineImageXObject(t,e){const n=t.width,i=t.height,s=d(t,this.forceDataSchema,!!e),r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x","0");r.setAttributeNS(null,"y","0");r.setAttributeNS(null,"width",pf(n));r.setAttributeNS(null,"height",pf(i));this.current.element=r;this.clip("nonzero");const a=this.svgFactory.createElement("svg:image");a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);a.setAttributeNS(null,"x","0");a.setAttributeNS(null,"y",pf(-i));a.setAttributeNS(null,"width",pf(n)+"px");a.setAttributeNS(null,"height",pf(i)+"px");a.setAttributeNS(null,"transform",`scale(${pf(1/n)} ${pf(-1/i)})`);e?e.append(a):this._ensureTransformGroup().append(a)}paintImageMaskXObject(t){const e=this.getObject(t.data,t);if(e.bitmap){(0,s.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const n=this.current,i=e.width,r=e.height,a=n.fillColor;n.maskId="mask"+p++;const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",n.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0");l.setAttributeNS(null,"y","0");l.setAttributeNS(null,"width",pf(i));l.setAttributeNS(null,"height",pf(r));l.setAttributeNS(null,"fill",a);l.setAttributeNS(null,"mask",`url(#${n.maskId})`);this.defs.append(o);this._ensureTransformGroup().append(l);this.paintInlineImageXObject(e,o)}paintFormXObjectBegin(t,e){Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]);if(e){const t=e[2]-e[0],n=e[3]-e[1],i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x",e[0]);i.setAttributeNS(null,"y",e[1]);i.setAttributeNS(null,"width",pf(t));i.setAttributeNS(null,"height",pf(n));this.current.element=i;this.clip("nonzero");this.endPath()}}paintFormXObjectEnd(){}_initialize(t){const e=this.svgFactory.create(t.width,t.height),n=this.svgFactory.createElement("svg:defs");e.append(n);this.defs=n;const i=this.svgFactory.createElement("svg:g");i.setAttributeNS(null,"transform",pm(t.transform));e.append(i);this.svg=i;return e}_ensureClipGroup(){if(!this.current.clipGroup){const t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl);this.svg.append(t);this.current.clipGroup=t}return this.current.clipGroup}_ensureTransformGroup(){if(!this.tgrp){this.tgrp=this.svgFactory.createElement("svg:g");this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix));this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)}return this.tgrp}}}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={exports:{}};__webpack_modules__[t].call(n.exports,n,n.exports,__w_pdfjs_require__);return n.exports}var __webpack_exports__={};(()=>{"use strict";var t=__webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0});Object.defineProperty(t,"AbortException",{enumerable:!0,get:function(){return e.AbortException}});Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return r.AnnotationEditorLayer}});Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return e.AnnotationEditorParamsType}});Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return e.AnnotationEditorType}});Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return a.AnnotationEditorUIManager}});Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}});Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return e.AnnotationMode}});Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return e.CMapCompressionType}});Object.defineProperty(t,"FeatureTest",{enumerable:!0,get:function(){return e.FeatureTest}});Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}});Object.defineProperty(t,"ImageKind",{enumerable:!0,get:function(){return e.ImageKind}});Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}});Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}});Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}});Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}});Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return i.PDFDateString}});Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}});Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return e.PasswordResponses}});Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return e.PermissionFlag}});Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return i.PixelsPerInch}});Object.defineProperty(t,"PromiseCapability",{enumerable:!0,get:function(){return e.PromiseCapability}});Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return i.RenderingCancelledException}});t.SVGGraphics=void 0;Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return e.UnexpectedResponseException}});Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return e.Util}});Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return e.VerbosityLevel}});Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return c.XfaLayer}});Object.defineProperty(t,"build",{enumerable:!0,get:function(){return n.build}});Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return e.createValidAbsoluteUrl}});Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return n.getDocument}});Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return i.getFilenameFromUrl}});Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return i.getPdfFilenameFromUrl}});Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return i.getXfaPageViewport}});Object.defineProperty(t,"isDataScheme",{enumerable:!0,get:function(){return i.isDataScheme}});Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return i.isPdfFile}});Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return i.loadScript}});Object.defineProperty(t,"normalizeUnicode",{enumerable:!0,get:function(){return e.normalizeUnicode}});Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return s.renderTextLayer}});Object.defineProperty(t,"setLayerDimensions",{enumerable:!0,get:function(){return i.setLayerDimensions}});Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}});Object.defineProperty(t,"updateTextLayer",{enumerable:!0,get:function(){return s.updateTextLayer}});Object.defineProperty(t,"version",{enumerable:!0,get:function(){return n.version}});var e=__w_pdfjs_require__(1),n=__w_pdfjs_require__(131),i=__w_pdfjs_require__(135),s=__w_pdfjs_require__(154),r=__w_pdfjs_require__(155),a=__w_pdfjs_require__(134),o=__w_pdfjs_require__(157),l=__w_pdfjs_require__(142),c=__w_pdfjs_require__(159);const h=__w_pdfjs_require__(163).SVGGraphics;t.SVGGraphics=h})();return __webpack_exports__})())); \ No newline at end of file +!function webpackUniversalModuleDefinition(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],r):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=r():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=r()}(this,(function(){return(()=>{var __webpack_modules__=[,(t,r,a)=>{"use strict";function _typeof(t){_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};return _typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.addLinkAttributes=function addLinkAttributes(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.url,o=r.target,l=r.rel,c=r.enabled,d=void 0===c||c;(0,i.assert)(a&&"string"==typeof a,'addLinkAttributes: A valid "url" parameter must provided.');var h=(0,i.removeNullCharacters)(a);if(d)t.href=t.title=h;else{t.href="";t.title="Disabled: ".concat(h);t.onclick=function(){return!1}}var p="";switch(o){case g.NONE:break;case g.SELF:p="_self";break;case g.BLANK:p="_blank";break;case g.PARENT:p="_parent";break;case g.TOP:p="_top"}t.target=p;t.rel="string"==typeof l?l:u};r.deprecated=function deprecated(t){console.log("Deprecated API usage: "+t)};r.getFilenameFromUrl=function getFilenameFromUrl(t){var r=t.indexOf("#"),a=t.indexOf("?"),o=Math.min(r>0?r:t.length,a>0?a:t.length);return t.substring(t.lastIndexOf("/",o)+1,o)};r.getPdfFilenameFromUrl=function getPdfFilenameFromUrl(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof t)return r;if(isDataScheme(t)){(0,i.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');return r}var a=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,o=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,l=a.exec(t),u=o.exec(l[1])||o.exec(l[2])||o.exec(l[3]);if(u&&(u=u[0]).includes("%"))try{u=o.exec(decodeURIComponent(u))[0]}catch(t){}return u||r};r.getXfaPageViewport=function getXfaPageViewport(t,r){var a=r.scale,o=void 0===a?1:a,i=r.rotation,l=void 0===i?0:i,u=t.attributes.style,c=u.width,d=u.height,h=[0,0,parseInt(c),parseInt(d)];return new y({viewBox:h,scale:o,rotation:l})};r.isDataScheme=isDataScheme;r.isPdfFile=function isPdfFile(t){return"string"==typeof t&&/\.pdf$/i.test(t)};r.isValidFetchUrl=isValidFetchUrl;r.loadScript=function loadScript(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((function(a,o){var i=document.createElement("script");i.src=t;i.onload=function(t){r&&i.remove();a(t)};i.onerror=function(){o(new Error("Cannot load script at: ".concat(i.src)))};(document.head||document.documentElement).appendChild(i)}))};r.StatTimer=r.RenderingCancelledException=r.PixelsPerInch=r.PDFDateString=r.PageViewport=r.LinkTarget=r.DOMSVGFactory=r.DOMStandardFontDataFactory=r.DOMCMapReaderFactory=r.DOMCanvasFactory=void 0;var o=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(2)),i=a(4),l=a(118);function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var o=0,i=function F(){};return{s:i,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,u=!0,c=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();u=t.done;return t},e:function e(t){c=!0;l=t},f:function f(){try{u||null==a.return||a.return()}finally{if(c)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a0&&void 0!==arguments[0]?arguments[0]:{},o=a.ownerDocument,i=void 0===o?globalThis.document:o;_classCallCheck(this,DOMCanvasFactory);(t=r.call(this))._document=i;return t}_createClass(DOMCanvasFactory,[{key:"_createCanvas",value:function _createCanvas(t,r){var a=this._document.createElement("canvas");a.width=t;a.height=r;return a}}]);return DOMCanvasFactory}(l.BaseCanvasFactory);r.DOMCanvasFactory=d;function fetchData(t){return _fetchData.apply(this,arguments)}function _fetchData(){_fetchData=_asyncToGenerator(o.default.mark((function _callee(t){var r,a,l=arguments;return o.default.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:r=l.length>1&&void 0!==l[1]&&l[1];if(!isValidFetchUrl(t,document.baseURI)){o.next=21;break}o.next=4;return fetch(t);case 4:if((a=o.sent).ok){o.next=7;break}throw new Error(a.statusText);case 7:if(!r){o.next=15;break}o.t1=Uint8Array;o.next=11;return a.arrayBuffer();case 11:o.t2=o.sent;o.t0=new o.t1(o.t2);o.next=20;break;case 15:o.t3=i.stringToBytes;o.next=18;return a.text();case 18:o.t4=o.sent;o.t0=(0,o.t3)(o.t4);case 20:return o.abrupt("return",o.t0);case 21:return o.abrupt("return",new Promise((function(a,o){var l=new XMLHttpRequest;l.open("GET",t,!0);r&&(l.responseType="arraybuffer");l.onreadystatechange=function(){if(l.readyState===XMLHttpRequest.DONE){if(200===l.status||0===l.status){var t;r&&l.response?t=new Uint8Array(l.response):!r&&l.responseText&&(t=(0,i.stringToBytes)(l.responseText));if(t){a(t);return}}o(new Error(l.statusText))}};l.send(null)})));case 22:case"end":return o.stop()}}),_callee)})));return _fetchData.apply(this,arguments)}var h=function(t){_inherits(DOMCMapReaderFactory,t);var r=_createSuper(DOMCMapReaderFactory);function DOMCMapReaderFactory(){_classCallCheck(this,DOMCMapReaderFactory);return r.apply(this,arguments)}_createClass(DOMCMapReaderFactory,[{key:"_fetchData",value:function _fetchData(t,r){return fetchData(t,this.isCompressed).then((function(t){return{cMapData:t,compressionType:r}}))}}]);return DOMCMapReaderFactory}(l.BaseCMapReaderFactory);r.DOMCMapReaderFactory=h;var p=function(t){_inherits(DOMStandardFontDataFactory,t);var r=_createSuper(DOMStandardFontDataFactory);function DOMStandardFontDataFactory(){_classCallCheck(this,DOMStandardFontDataFactory);return r.apply(this,arguments)}_createClass(DOMStandardFontDataFactory,[{key:"_fetchData",value:function _fetchData(t){return fetchData(t,!0)}}]);return DOMStandardFontDataFactory}(l.BaseStandardFontDataFactory);r.DOMStandardFontDataFactory=p;var m=function(t){_inherits(DOMSVGFactory,t);var r=_createSuper(DOMSVGFactory);function DOMSVGFactory(){_classCallCheck(this,DOMSVGFactory);return r.apply(this,arguments)}_createClass(DOMSVGFactory,[{key:"_createSVG",value:function _createSVG(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}}]);return DOMSVGFactory}(l.BaseSVGFactory);r.DOMSVGFactory=m;var y=function(){function PageViewport(t){var r=t.viewBox,a=t.scale,o=t.rotation,i=t.offsetX,l=void 0===i?0:i,u=t.offsetY,c=void 0===u?0:u,d=t.dontFlip,h=void 0!==d&&d;_classCallCheck(this,PageViewport);this.viewBox=r;this.scale=a;this.rotation=o;this.offsetX=l;this.offsetY=c;var p,m,y,v,g,b,_,S,A=(r[2]+r[0])/2,C=(r[3]+r[1])/2;(o%=360)<0&&(o+=360);switch(o){case 180:p=-1;m=0;y=0;v=1;break;case 90:p=0;m=1;y=1;v=0;break;case 270:p=0;m=-1;y=-1;v=0;break;case 0:p=1;m=0;y=0;v=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(h){y=-y;v=-v}if(0===p){g=Math.abs(C-r[1])*a+l;b=Math.abs(A-r[0])*a+c;_=Math.abs(r[3]-r[1])*a;S=Math.abs(r[2]-r[0])*a}else{g=Math.abs(A-r[0])*a+l;b=Math.abs(C-r[1])*a+c;_=Math.abs(r[2]-r[0])*a;S=Math.abs(r[3]-r[1])*a}this.transform=[p*a,m*a,y*a,v*a,g-p*a*A-y*a*C,b-m*a*A-v*a*C];this.width=_;this.height=S}_createClass(PageViewport,[{key:"clone",value:function clone(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.scale,a=void 0===r?this.scale:r,o=t.rotation,i=void 0===o?this.rotation:o,l=t.offsetX,u=void 0===l?this.offsetX:l,c=t.offsetY,d=void 0===c?this.offsetY:c,h=t.dontFlip,p=void 0!==h&&h;return new PageViewport({viewBox:this.viewBox.slice(),scale:a,rotation:i,offsetX:u,offsetY:d,dontFlip:p})}},{key:"convertToViewportPoint",value:function convertToViewportPoint(t,r){return i.Util.applyTransform([t,r],this.transform)}},{key:"convertToViewportRectangle",value:function convertToViewportRectangle(t){var r=i.Util.applyTransform([t[0],t[1]],this.transform),a=i.Util.applyTransform([t[2],t[3]],this.transform);return[r[0],r[1],a[0],a[1]]}},{key:"convertToPdfPoint",value:function convertToPdfPoint(t,r){return i.Util.applyInverseTransform([t,r],this.transform)}}]);return PageViewport}();r.PageViewport=y;var v=function(t){_inherits(RenderingCancelledException,t);var r=_createSuper(RenderingCancelledException);function RenderingCancelledException(t,a){var o;_classCallCheck(this,RenderingCancelledException);(o=r.call(this,t,"RenderingCancelledException")).type=a;return o}return RenderingCancelledException}(i.BaseException);r.RenderingCancelledException=v;var g={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};r.LinkTarget=g;function isDataScheme(t){for(var r=t.length,a=0;aa&&(a=i.length)}}catch(t){o.e(t)}finally{o.f()}var l,u=_createForOfIteratorHelper(this.times);try{for(u.s();!(l=u.n()).done;){var c=l.value,d=c.end-c.start;r.push("".concat(c.name.padEnd(a)," ").concat(d,"ms\n"))}}catch(t){u.e(t)}finally{u.f()}return r.join("")}}]);return StatTimer}();r.StatTimer=_;function isValidFetchUrl(t,r){try{var a=(r?new URL(t,r):new URL(t)).protocol;return"http:"===a||"https:"===a}catch(t){return!1}}var S=function(){function PDFDateString(){_classCallCheck(this,PDFDateString)}_createClass(PDFDateString,null,[{key:"toDateObject",value:function toDateObject(t){if(!t||!(0,i.isString)(t))return null;b||(b=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));var r=b.exec(t);if(!r)return null;var a=parseInt(r[1],10),o=parseInt(r[2],10);o=o>=1&&o<=12?o-1:0;var l=parseInt(r[3],10);l=l>=1&&l<=31?l:1;var u=parseInt(r[4],10);u=u>=0&&u<=23?u:0;var c=parseInt(r[5],10);c=c>=0&&c<=59?c:0;var d=parseInt(r[6],10);d=d>=0&&d<=59?d:0;var h=r[7]||"Z",p=parseInt(r[8],10);p=p>=0&&p<=23?p:0;var m=parseInt(r[9],10)||0;m=m>=0&&m<=59?m:0;if("-"===h){u+=p;c+=m}else if("+"===h){u-=p;c-=m}return new Date(Date.UTC(a,o,l,u,c,d))}}]);return PDFDateString}();r.PDFDateString=S},(t,r,a)=>{"use strict";t.exports=a(3)},(t,r,a)=>{"use strict";function _typeof(t){_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};return _typeof(t)}var o=function(t){var r,a=Object.prototype,o=a.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function define(t,r,a){Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0});return t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,o){var i=r&&r.prototype instanceof Generator?r:Generator,l=Object.create(i.prototype),u=new Context(o||[]);l._invoke=function makeInvokeMethod(t,r,a){var o=d;return function invoke(i,l){if(o===p)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw l;return doneResult()}a.method=i;a.arg=l;for(;;){var u=a.delegate;if(u){var c=maybeInvokeDelegate(u,a);if(c){if(c===y)continue;return c}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(o===d){o=m;throw a.arg}a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);o=p;var v=tryCatch(t,r,a);if("normal"===v.type){o=a.done?m:h;if(v.arg===y)continue;return{value:v.arg,done:a.done}}if("throw"===v.type){o=m;a.method="throw";a.arg=v.arg}}}}(t,a,u);return l}t.wrap=wrap;function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}var d="suspendedStart",h="suspendedYield",p="executing",m="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var v={};define(v,l,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(values([])));b&&b!==a&&o.call(b,l)&&(v=b);var _=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(v);GeneratorFunction.prototype=GeneratorFunctionPrototype;define(_,"constructor",GeneratorFunctionPrototype);define(GeneratorFunctionPrototype,"constructor",GeneratorFunction);GeneratorFunction.displayName=define(GeneratorFunctionPrototype,c,"GeneratorFunction");function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))};t.mark=function(t){if(Object.setPrototypeOf)Object.setPrototypeOf(t,GeneratorFunctionPrototype);else{t.__proto__=GeneratorFunctionPrototype;define(t,c,"GeneratorFunction")}t.prototype=Object.create(_);return t};t.awrap=function(t){return{__await:t}};function AsyncIterator(t,r){function invoke(a,i,l,u){var c=tryCatch(t[a],t,i);if("throw"!==c.type){var d=c.arg,h=d.value;return h&&"object"===_typeof(h)&&o.call(h,"__await")?r.resolve(h.__await).then((function(t){invoke("next",t,l,u)}),(function(t){invoke("throw",t,l,u)})):r.resolve(h).then((function(t){d.value=t;l(d)}),(function(t){return invoke("throw",t,l,u)}))}u(c.arg)}var a;this._invoke=function enqueue(t,o){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,o,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}defineIteratorMethods(AsyncIterator.prototype);define(AsyncIterator.prototype,u,(function(){return this}));t.AsyncIterator=AsyncIterator;t.async=function(r,a,o,i,l){void 0===l&&(l=Promise);var u=new AsyncIterator(wrap(r,a,o,i),l);return t.isGeneratorFunction(a)?u:u.next().then((function(t){return t.done?t.value:u.next()}))};function maybeInvokeDelegate(t,a){var o=t.iterator[a.method];if(o===r){a.delegate=null;if("throw"===a.method){if(t.iterator.return){a.method="return";a.arg=r;maybeInvokeDelegate(t,a);if("throw"===a.method)return y}a.method="throw";a.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var i=tryCatch(o,t.iterator,a.arg);if("throw"===i.type){a.method="throw";a.arg=i.arg;a.delegate=null;return y}var l=i.arg;if(!l){a.method="throw";a.arg=new TypeError("iterator result is not an object");a.delegate=null;return y}if(!l.done)return l;a[t.resultName]=l.value;a.next=t.nextLoc;if("return"!==a.method){a.method="next";a.arg=r}a.delegate=null;return y}defineIteratorMethods(_);define(_,c,"Generator");define(_,l,(function(){return this}));define(_,"toString",(function(){return"[object Generator]"}));function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]);if(2 in t){r.finallyLoc=t[2];r.afterLoc=t[3]}this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal";delete r.arg;t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}];t.forEach(pushTryEntry,this);this.reset(!0)}t.keys=function(t){var r=[];for(var a in t)r.push(a);r.reverse();return function next(){for(;r.length;){var a=r.pop();if(a in t){next.value=a;next.done=!1;return next}}next.done=!0;return next}};function values(t){if(t){var a=t[l];if(a)return a.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,u=function next(){for(;++i=0;--i){var l=this.tryEntries[i],u=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var c=o.call(l,"catchLoc"),d=o.call(l,"finallyLoc");if(c&&d){if(this.prev=0;--a){var i=this.tryEntries[a];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t){this.complete(a.completion,a.afterLoc);resetTryEntry(a);return y}}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var o=a.completion;if("throw"===o.type){var i=o.arg;resetTryEntry(a)}return i}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,a,o){this.delegate={iterator:values(t),resultName:a,nextLoc:o};"next"===this.method&&(this.arg=r);return y}};return t}("object"===_typeof(t=a.nmd(t))?t.exports:{});try{regeneratorRuntime=o}catch(t){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.arrayByteLength=arrayByteLength;r.arraysToBytes=function arraysToBytes(t){var r=t.length;if(1===r&&t[0]instanceof Uint8Array)return t[0];for(var a=0,o=0;o1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&!a)return URL.createObjectURL(new Blob([t],{type:r}));for(var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="data:".concat(r,";base64,"),l=0,u=t.length;l>2,m=(3&c)<<4|d>>4,y=l+1>6:64,v=l+21&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(a&&"string"==typeof t){if(a.addDefaultProtocol&&t.startsWith("www.")){var o=t.match(/\./g);o&&o.length>=2&&(t="http://".concat(t))}if(a.tryConvertEncoding)try{t=stringToUTF8String(t)}catch(t){}}var i=r?new URL(t,r):new URL(t);if(_isValidProtocol(i))return i}catch(t){}return null};r.escapeString=function escapeString(t){return t.replace(/([()\\\n\r])/g,(function(t){return"\n"===t?"\\n":"\r"===t?"\\r":"\\".concat(t)}))};r.getModificationDate=function getModificationDate(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,r=[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")];return r.join("")};r.getVerbosityLevel=function getVerbosityLevel(){return i};r.info=function info(t){i>=o.INFOS&&console.log("Info: ".concat(t))};r.isArrayBuffer=function isArrayBuffer(t){return"object"===_typeof(t)&&null!==t&&void 0!==t.byteLength};r.isArrayEqual=function isArrayEqual(t,r){if(t.length!==r.length)return!1;for(var a=0,o=t.length;a=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,u=!0,c=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();u=t.done;return t},e:function e(t){c=!0;l=t},f:function f(){try{u||null==a.return||a.return()}finally{if(c)throw l}}}}(t);try{for(o.s();!(r=o.n()).done;){var i=(c=r.value,d=2,function _arrayWithHoles(t){if(Array.isArray(t))return t}(c)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==a)return;var o,i,l=[],u=!0,c=!1;try{for(a=a.call(t);!(u=(o=a.next()).done);u=!0){l.push(o.value);if(r&&l.length===r)break}}catch(t){c=!0;i=t}finally{try{u||null==a.return||a.return()}finally{if(c)throw i}}return l}(c,d)||_unsupportedIterableToArray(c,d)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=i[0],u=i[1];a[l]=u}}catch(t){o.e(t)}finally{o.f()}var c,d;return a};r.objectSize=function objectSize(t){return Object.keys(t).length};r.removeNullCharacters=function removeNullCharacters(t){if("string"!=typeof t){warn("The argument for removeNullCharacters must be a string.");return t}return t.replace(v,"")};r.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(i=t)};r.shadow=shadow;r.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)};r.stringToBytes=stringToBytes;r.stringToPDFString=function stringToPDFString(t){var r=t.length,a=[];if("þ"===t[0]&&"ÿ"===t[1])for(var o=2;o>8&255),String.fromCharCode(255&i))}return r.join("")};r.stringToUTF8String=stringToUTF8String;r.unreachable=unreachable;r.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))};r.warn=warn;r.VerbosityLevel=r.Util=r.UNSUPPORTED_FEATURES=r.UnknownErrorException=r.UnexpectedResponseException=r.TextRenderingMode=r.StreamType=r.RenderingIntentFlag=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.IsLittleEndianCached=r.IsEvalSupportedCached=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FontType=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.AnnotationType=r.AnnotationStateModelType=r.AnnotationReviewState=r.AnnotationReplyType=r.AnnotationMode=r.AnnotationMarkedState=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0;a(5);function _defineProperties(t,r){for(var a=0;at.length)&&(r=t.length);for(var a=0,o=new Array(r);a=o.WARNINGS&&console.log("Warning: ".concat(t))}function unreachable(t){throw new Error(t)}function assert(t,r){t||unreachable(r)}function _isValidProtocol(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function shadow(t,r,a){Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!1});return a}var l=function BaseExceptionClosure(){function BaseException(t,r){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=r}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();r.BaseException=l;var u=function(t){_inherits(PasswordException,t);var r=_createSuper(PasswordException);function PasswordException(t,a){var o;_classCallCheck(this,PasswordException);(o=r.call(this,t,"PasswordException")).code=a;return o}return PasswordException}(l);r.PasswordException=u;var c=function(t){_inherits(UnknownErrorException,t);var r=_createSuper(UnknownErrorException);function UnknownErrorException(t,a){var o;_classCallCheck(this,UnknownErrorException);(o=r.call(this,t,"UnknownErrorException")).details=a;return o}return UnknownErrorException}(l);r.UnknownErrorException=c;var d=function(t){_inherits(InvalidPDFException,t);var r=_createSuper(InvalidPDFException);function InvalidPDFException(t){_classCallCheck(this,InvalidPDFException);return r.call(this,t,"InvalidPDFException")}return InvalidPDFException}(l);r.InvalidPDFException=d;var h=function(t){_inherits(MissingPDFException,t);var r=_createSuper(MissingPDFException);function MissingPDFException(t){_classCallCheck(this,MissingPDFException);return r.call(this,t,"MissingPDFException")}return MissingPDFException}(l);r.MissingPDFException=h;var p=function(t){_inherits(UnexpectedResponseException,t);var r=_createSuper(UnexpectedResponseException);function UnexpectedResponseException(t,a){var o;_classCallCheck(this,UnexpectedResponseException);(o=r.call(this,t,"UnexpectedResponseException")).status=a;return o}return UnexpectedResponseException}(l);r.UnexpectedResponseException=p;var m=function(t){_inherits(FormatError,t);var r=_createSuper(FormatError);function FormatError(t){_classCallCheck(this,FormatError);return r.call(this,t,"FormatError")}return FormatError}(l);r.FormatError=m;var y=function(t){_inherits(AbortException,t);var r=_createSuper(AbortException);function AbortException(t){_classCallCheck(this,AbortException);return r.call(this,t,"AbortException")}return AbortException}(l);r.AbortException=y;var v=/\x00/g;function stringToBytes(t){assert("string"==typeof t,"Invalid argument for stringToBytes");for(var r=t.length,a=new Uint8Array(r),o=0;ot[2]){r[0]=t[2];r[2]=t[0]}if(t[1]>t[3]){r[1]=t[3];r[3]=t[1]}return r}},{key:"intersect",value:function intersect(t,r){function compare(t,r){return t-r}var a=[t[0],t[2],r[0],r[2]].sort(compare),o=[t[1],t[3],r[1],r[3]].sort(compare),i=[];t=Util.normalizeRect(t);r=Util.normalizeRect(r);if(!(a[0]===t[0]&&a[1]===r[0]||a[0]===r[0]&&a[1]===t[0]))return null;i[0]=a[1];i[2]=a[2];if(!(o[0]===t[1]&&o[1]===r[1]||o[0]===r[1]&&o[1]===t[1]))return null;i[1]=o[1];i[3]=o[2];return i}}]);return Util}();r.Util=S;var A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToUTF8String(t){return decodeURIComponent(escape(t))}},(t,r,a)=>{"use strict";var o=a(6);if("undefined"==typeof globalThis||!globalThis._pdfjsCompatibilityChecked){"undefined"!=typeof globalThis&&globalThis.Math===Math||(globalThis=a(7));globalThis._pdfjsCompatibilityChecked=!0;!function checkNodeBtoa(){!globalThis.btoa&&o.isNodeJS&&(globalThis.btoa=function(t){return Buffer.from(t,"binary").toString("base64")})}();!function checkNodeAtob(){!globalThis.atob&&o.isNodeJS&&(globalThis.atob=function(t){return Buffer.from(t,"base64").toString("binary")})}();!function checkDOMMatrix(){!globalThis.DOMMatrix&&o.isNodeJS&&(globalThis.DOMMatrix=a(60))}();!function checkObjectFromEntries(){Object.fromEntries||a(61)}();!function checkPromise(){globalThis.Promise.allSettled||(globalThis.Promise=a(89))}();!function checkReadableStream(){!globalThis.ReadableStream&&o.isNodeJS&&(globalThis.ReadableStream=a(117).ReadableStream)}()}},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.isNodeJS=void 0;function _typeof(t){_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};return _typeof(t)}var a=!("object"!==("undefined"==typeof process?"undefined":_typeof(process))||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);r.isNodeJS=a},(t,r,a)=>{a(8);t.exports=a(10)},(t,r,a)=>{a(9)({global:!0},{globalThis:a(10)})},(t,r,a)=>{var o=a(10),i=a(11).f,l=a(40),u=a(43),c=a(34),d=a(49),h=a(59);t.exports=function(t,r){var a,p,m,y,v,g=t.target,b=t.global,_=t.stat;if(a=b?o:_?o[g]||c(g,{}):(o[g]||{}).prototype)for(p in r){y=r[p];m=t.noTargetGet?(v=i(a,p))&&v.value:a[p];if(!h(b?p:g+(_?".":"#")+p,t.forced)&&void 0!==m){if(typeof y==typeof m)continue;d(y,m)}(t.sham||m&&m.sham)&&l(y,"sham",!0);u(a,p,y,t)}}},t=>{var check=function(t){return t&&t.Math==Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||Function("return this")()},(t,r,a)=>{var o=a(12),i=a(14),l=a(15),u=a(16),c=a(20),d=a(35),h=a(38),p=Object.getOwnPropertyDescriptor;r.f=o?p:function getOwnPropertyDescriptor(t,r){t=u(t);r=c(r);if(h)try{return p(t,r)}catch(t){}if(d(t,r))return l(!i.f.call(t,r),t[r])}},(t,r,a)=>{var o=a(13);t.exports=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},(t,r)=>{"use strict";var a={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!a.call({1:2},1);r.f=i?function propertyIsEnumerable(t){var r=o(this,t);return!!r&&r.enumerable}:a},t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},(t,r,a)=>{var o=a(17),i=a(19);t.exports=function(t){return o(i(t))}},(t,r,a)=>{var o=a(13),i=a(18),l="".split;t.exports=o((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?l.call(t,""):Object(t)}:Object},t=>{var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},t=>{t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},(t,r,a)=>{var o=a(21),i=a(23);t.exports=function(t){var r=o(t,"string");return i(r)?r:String(r)}},(t,r,a)=>{var o=a(22),i=a(23),l=a(29),u=a(30)("toPrimitive");t.exports=function(t,r){if(!o(t)||i(t))return t;var a,c=t[u];if(void 0!==c){void 0===r&&(r="default");a=c.call(t,r);if(!o(a)||i(a))return a;throw TypeError("Can't convert object to primitive value")}void 0===r&&(r="number");return l(t,r)}},t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},(t,r,a)=>{var o=a(24),i=a(25);t.exports=i?function(t){return"symbol"==typeof t}:function(t){var r=o("Symbol");return"function"==typeof r&&Object(t)instanceof r}},(t,r,a)=>{var o=a(10),aFunction=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,r){return arguments.length<2?aFunction(o[t]):o[t]&&o[t][r]}},(t,r,a)=>{var o=a(26);t.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,r,a)=>{var o=a(27),i=a(13);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&o&&o<41}))},(t,r,a)=>{var o,i,l=a(10),u=a(28),c=l.process,d=l.Deno,h=c&&c.versions||d&&d.version,p=h&&h.v8;p?i=(o=p.split("."))[0]<4?1:o[0]+o[1]:u&&(!(o=u.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=u.match(/Chrome\/(\d+)/))&&(i=o[1]);t.exports=i&&+i},(t,r,a)=>{var o=a(24);t.exports=o("navigator","userAgent")||""},(t,r,a)=>{var o=a(22);t.exports=function(t,r){var a,i;if("string"===r&&"function"==typeof(a=t.toString)&&!o(i=a.call(t)))return i;if("function"==typeof(a=t.valueOf)&&!o(i=a.call(t)))return i;if("string"!==r&&"function"==typeof(a=t.toString)&&!o(i=a.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},(t,r,a)=>{var o=a(10),i=a(31),l=a(35),u=a(37),c=a(26),d=a(25),h=i("wks"),p=o.Symbol,m=d?p:p&&p.withoutSetter||u;t.exports=function(t){l(h,t)&&(c||"string"==typeof h[t])||(c&&l(p,t)?h[t]=p[t]:h[t]=m("Symbol."+t));return h[t]}},(t,r,a)=>{var o=a(32),i=a(33);(t.exports=function(t,r){return i[t]||(i[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.17.3",mode:o?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},t=>{t.exports=!1},(t,r,a)=>{var o=a(10),i=a(34),l="__core-js_shared__",u=o[l]||i(l,{});t.exports=u},(t,r,a)=>{var o=a(10);t.exports=function(t,r){try{Object.defineProperty(o,t,{value:r,configurable:!0,writable:!0})}catch(a){o[t]=r}return r}},(t,r,a)=>{var o=a(36),i={}.hasOwnProperty;t.exports=Object.hasOwn||function hasOwn(t,r){return i.call(o(t),r)}},(t,r,a)=>{var o=a(19);t.exports=function(t){return Object(o(t))}},t=>{var r=0,a=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++r+a).toString(36)}},(t,r,a)=>{var o=a(12),i=a(13),l=a(39);t.exports=!o&&!i((function(){return 7!=Object.defineProperty(l("div"),"a",{get:function(){return 7}}).a}))},(t,r,a)=>{var o=a(10),i=a(22),l=o.document,u=i(l)&&i(l.createElement);t.exports=function(t){return u?l.createElement(t):{}}},(t,r,a)=>{var o=a(12),i=a(41),l=a(15);t.exports=o?function(t,r,a){return i.f(t,r,l(1,a))}:function(t,r,a){t[r]=a;return t}},(t,r,a)=>{var o=a(12),i=a(38),l=a(42),u=a(20),c=Object.defineProperty;r.f=o?c:function defineProperty(t,r,a){l(t);r=u(r);l(a);if(i)try{return c(t,r,a)}catch(t){}if("get"in a||"set"in a)throw TypeError("Accessors not supported");"value"in a&&(t[r]=a.value);return t}},(t,r,a)=>{var o=a(22);t.exports=function(t){if(!o(t))throw TypeError(String(t)+" is not an object");return t}},(t,r,a)=>{var o=a(10),i=a(40),l=a(35),u=a(34),c=a(44),d=a(45),h=d.get,p=d.enforce,m=String(String).split("String");(t.exports=function(t,r,a,c){var d,h=!!c&&!!c.unsafe,y=!!c&&!!c.enumerable,v=!!c&&!!c.noTargetGet;if("function"==typeof a){"string"!=typeof r||l(a,"name")||i(a,"name",r);(d=p(a)).source||(d.source=m.join("string"==typeof r?r:""))}if(t!==o){h?!v&&t[r]&&(y=!0):delete t[r];y?t[r]=a:i(t,r,a)}else y?t[r]=a:u(r,a)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&h(this).source||c(this)}))},(t,r,a)=>{var o=a(33),i=Function.toString;"function"!=typeof o.inspectSource&&(o.inspectSource=function(t){return i.call(t)});t.exports=o.inspectSource},(t,r,a)=>{var o,i,l,u=a(46),c=a(10),d=a(22),h=a(40),p=a(35),m=a(33),y=a(47),v=a(48),g="Object already initialized",b=c.WeakMap;if(u||m.state){var _=m.state||(m.state=new b),S=_.get,A=_.has,C=_.set;o=function(t,r){if(A.call(_,t))throw new TypeError(g);r.facade=t;C.call(_,t,r);return r};i=function(t){return S.call(_,t)||{}};l=function(t){return A.call(_,t)}}else{var k=y("state");v[k]=!0;o=function(t,r){if(p(t,k))throw new TypeError(g);r.facade=t;h(t,k,r);return r};i=function(t){return p(t,k)?t[k]:{}};l=function(t){return p(t,k)}}t.exports={set:o,get:i,has:l,enforce:function(t){return l(t)?i(t):o(t,{})},getterFor:function(t){return function(r){var a;if(!d(r)||(a=i(r)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return a}}}},(t,r,a)=>{var o=a(10),i=a(44),l=o.WeakMap;t.exports="function"==typeof l&&/native code/.test(i(l))},(t,r,a)=>{var o=a(31),i=a(37),l=o("keys");t.exports=function(t){return l[t]||(l[t]=i(t))}},t=>{t.exports={}},(t,r,a)=>{var o=a(35),i=a(50),l=a(11),u=a(41);t.exports=function(t,r){for(var a=i(r),c=u.f,d=l.f,h=0;h{var o=a(24),i=a(51),l=a(58),u=a(42);t.exports=o("Reflect","ownKeys")||function ownKeys(t){var r=i.f(u(t)),a=l.f;return a?r.concat(a(t)):r}},(t,r,a)=>{var o=a(52),i=a(57).concat("length","prototype");r.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return o(t,i)}},(t,r,a)=>{var o=a(35),i=a(16),l=a(53).indexOf,u=a(48);t.exports=function(t,r){var a,c=i(t),d=0,h=[];for(a in c)!o(u,a)&&o(c,a)&&h.push(a);for(;r.length>d;)o(c,a=r[d++])&&(~l(h,a)||h.push(a));return h}},(t,r,a)=>{var o=a(16),i=a(54),l=a(56),createMethod=function(t){return function(r,a,u){var c,d=o(r),h=i(d.length),p=l(u,h);if(t&&a!=a){for(;h>p;)if((c=d[p++])!=c)return!0}else for(;h>p;p++)if((t||p in d)&&d[p]===a)return t||p||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(t,r,a)=>{var o=a(55),i=Math.min;t.exports=function(t){return t>0?i(o(t),9007199254740991):0}},t=>{var r=Math.ceil,a=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?a:r)(t)}},(t,r,a)=>{var o=a(55),i=Math.max,l=Math.min;t.exports=function(t,r){var a=o(t);return a<0?i(a+r,0):l(a,r)}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,r)=>{r.f=Object.getOwnPropertySymbols},(t,r,a)=>{var o=a(13),i=/#|\.prototype\./,isForced=function(t,r){var a=u[l(t)];return a==d||a!=c&&("function"==typeof r?o(r):!!r)},l=isForced.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=isForced.data={},c=isForced.NATIVE="N",d=isForced.POLYFILL="P";t.exports=isForced},(t,r,a)=>{"use strict";var o,i,l;function _typeof(t){_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};return _typeof(t)}l=function(){var t=function CSSMatrix(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];this.setIdentity();return t&&t.length&&this.setMatrixValue(t)},r={isIdentity:{configurable:!0},is2D:{configurable:!0}};r.isIdentity.get=function(){var t=this;return 1===t.m11&&0===t.m12&&0===t.m13&&0===t.m14&&0===t.m21&&1===t.m22&&0===t.m23&&0===t.m24&&0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m41&&0===t.m42&&0===t.m43&&1===t.m44};r.isIdentity.set=function(t){this.isIdentity=t};r.is2D.get=function(){var t=this;return 0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m43&&1===t.m44};r.is2D.set=function(t){this.is2D=t};Object.defineProperties(t.prototype,r);var a=t.prototype;function Translate(r,a,o){var i=new t;i.m41=r;i.e=r;i.m42=a;i.f=a;i.m43=o;return i}function Rotate(r,a,o){var i=new t,l=r*Math.PI/180,u=a*Math.PI/180,c=o*Math.PI/180,d=Math.cos(l),h=-Math.sin(l),p=Math.cos(u),m=-Math.sin(u),y=Math.cos(c),v=-Math.sin(c),g=p*y,b=-p*v;i.m11=g;i.a=g;i.m12=b;i.b=b;i.m13=m;var _=h*m*y+d*v;i.m21=_;i.c=_;var S=d*y-h*m*v;i.m22=S;i.d=S;i.m23=-h*p;i.m31=h*v-d*m*y;i.m32=h*y+d*m*v;i.m33=d*p;return i}function RotateAxisAngle(r,a,o,i){var l=new t,u=i*Math.PI/360,c=Math.sin(u),d=Math.cos(u),h=c*c,p=Math.sqrt(r*r+a*a+o*o),m=0,y=0,v=1;if(0!==p){m=r/p;y=a/p;v=o/p}var g=m*m,b=y*y,_=v*v,S=1-2*(b+_)*h;l.m11=S;l.a=S;var A=2*(r*a*h+o*c*d);l.m12=A;l.b=A;l.m13=2*(r*o*h-a*c*d);var C=2*(a*r*h-o*c*d);l.m21=C;l.c=C;var k=1-2*(_+g)*h;l.m22=k;l.d=k;l.m23=2*(a*o*h+r*c*d);l.m31=2*(o*r*h+a*c*d);l.m32=2*(o*a*h-r*c*d);l.m33=1-2*(g+b)*h;l.m14=0;l.m24=0;l.m34=0;l.m41=0;l.e=0;l.m42=0;l.f=0;l.m43=0;l.m44=1;return l}function Scale(r,a,o){var i=new t;i.m11=r;i.a=r;i.m22=a;i.d=a;i.m33=o;return i}function SkewX(r){var a=r*Math.PI/180,o=new t,i=Math.tan(a);o.m21=i;o.c=i;return o}function SkewY(r){var a=r*Math.PI/180,o=new t,i=Math.tan(a);o.m12=i;o.b=i;return o}function Multiply(r,a){var o=a.m11*r.m11+a.m12*r.m21+a.m13*r.m31+a.m14*r.m41,i=a.m11*r.m12+a.m12*r.m22+a.m13*r.m32+a.m14*r.m42,l=a.m11*r.m13+a.m12*r.m23+a.m13*r.m33+a.m14*r.m43,u=a.m11*r.m14+a.m12*r.m24+a.m13*r.m34+a.m14*r.m44,c=a.m21*r.m11+a.m22*r.m21+a.m23*r.m31+a.m24*r.m41,d=a.m21*r.m12+a.m22*r.m22+a.m23*r.m32+a.m24*r.m42,h=a.m21*r.m13+a.m22*r.m23+a.m23*r.m33+a.m24*r.m43,p=a.m21*r.m14+a.m22*r.m24+a.m23*r.m34+a.m24*r.m44,m=a.m31*r.m11+a.m32*r.m21+a.m33*r.m31+a.m34*r.m41,y=a.m31*r.m12+a.m32*r.m22+a.m33*r.m32+a.m34*r.m42,v=a.m31*r.m13+a.m32*r.m23+a.m33*r.m33+a.m34*r.m43,g=a.m31*r.m14+a.m32*r.m24+a.m33*r.m34+a.m34*r.m44,b=a.m41*r.m11+a.m42*r.m21+a.m43*r.m31+a.m44*r.m41,_=a.m41*r.m12+a.m42*r.m22+a.m43*r.m32+a.m44*r.m42,S=a.m41*r.m13+a.m42*r.m23+a.m43*r.m33+a.m44*r.m43,A=a.m41*r.m14+a.m42*r.m24+a.m43*r.m34+a.m44*r.m44;return new t([o,c,m,b,i,d,y,_,l,h,v,S,u,p,g,A])}function feedFromArray(t,r){var a=Array.from(r);if(16===a.length){var o=a[0],i=a[1],l=a[2],u=a[3],c=a[4],d=a[5],h=a[6],p=a[7],m=a[8],y=a[9],v=a[10],g=a[11],b=a[12],_=a[13],S=a[14],A=a[15];t.m11=o;t.a=o;t.m21=i;t.c=i;t.m31=l;t.m41=u;t.e=u;t.m12=c;t.b=c;t.m22=d;t.d=d;t.m32=h;t.m42=p;t.f=p;t.m13=m;t.m23=y;t.m33=v;t.m43=g;t.m14=b;t.m24=_;t.m34=S;t.m44=A}else{if(6!==a.length)throw new TypeError("CSSMatrix: expecting a 6/16 values Array");var C=a[0],k=a[1],R=a[2],w=a[3],P=a[4],x=a[5];t.m11=C;t.a=C;t.m12=k;t.b=k;t.m21=R;t.c=R;t.m22=w;t.d=w;t.m14=P;t.e=P;t.m24=x;t.f=x}return t}a.setMatrixValue=function setMatrixValue(r){var a=this;if(!r||!r.length)return a;if(r.length&&"string"==typeof r[0]&&r[0].length){var o,i,l=String(r[0]).trim();if("none"===l)return a;o=l.slice(0,l.indexOf("("));i=l.slice("matrix"===o?7:9,-1).split(",").map((function(t){return Math.abs(t)<1e-6?0:+t}));if(!([6,16].indexOf(i.length)>-1))throw new TypeError("CSSMatrix: expecting valid CSS matrix() / matrix3d() syntax");feedFromArray(a,i)}else r[0]instanceof t?feedFromArray(a,r[0].toArray()):Array.isArray(r[0])?feedFromArray(a,r[0]):Array.isArray(r)&&feedFromArray(a,r);return a};a.toString=function toString(){return(this.is2D?"matrix":"matrix3d")+"("+this.toArray(1).join(",")+")"};a.toArray=function toArray(t){var r=this;return r.is2D?[r.a,r.b,r.c,r.d,r.e,r.f]:t?[r.m11,r.m12,r.m13,r.m14,r.m21,r.m22,r.m23,r.m24,r.m31,r.m32,r.m33,r.m34,r.m41,r.m42,r.m43,r.m44]:[r.m11,r.m21,r.m31,r.m41,r.m12,r.m22,r.m32,r.m42,r.m13,r.m23,r.m33,r.m43,r.m14,r.m24,r.m34,r.m44]};a.multiply=function multiply(t){return Multiply(this,t)};a.translate=function translate(t,r,a){var o=r,i=a;null==i&&(i=0);null==o&&(o=0);return Multiply(this,Translate(t,o,i))};a.scale=function scale(t,r,a){var o=r,i=a;null==o&&(o=t);null==i&&(i=t);return Multiply(this,Scale(t,o,i))};a.rotate=function rotate(t,r,a){var o=t,i=r,l=a;null==i&&(i=0);if(null==l){l=o;o=0}return Multiply(this,Rotate(o,i,l))};a.rotateAxisAngle=function rotateAxisAngle(t,r,a,o){if(4!==arguments.length)throw new TypeError("CSSMatrix: expecting 4 values");return Multiply(this,RotateAxisAngle(t,r,a,o))};a.skewX=function skewX(t){return Multiply(this,SkewX(t))};a.skewY=function skewY(t){return Multiply(this,SkewY(t))};a.setIdentity=function setIdentity(){return feedFromArray(this,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};a.transformPoint=function transformPoint(t){var r=Translate(t.x,t.y,t.z);r.m44=t.w||1;return{x:(r=this.multiply(r)).m41,y:r.m42,z:r.m43,w:r.m44}};a.transform=function transform(t){var r=this,a=r.m11*t.x+r.m12*t.y+r.m13*t.z+r.m14*t.w,o=r.m21*t.x+r.m22*t.y+r.m23*t.z+r.m24*t.w,i=r.m31*t.x+r.m32*t.y+r.m33*t.z+r.m34*t.w,l=r.m41*t.x+r.m42*t.y+r.m43*t.z+r.m44*t.w;return{x:a/l,y:o/l,z:i/l,w:l}};t.Translate=Translate;t.Rotate=Rotate;t.RotateAxisAngle=RotateAxisAngle;t.Scale=Scale;t.SkewX=SkewX;t.SkewY=SkewY;t.Multiply=Multiply;t.fromMatrix=function fromMatrix(r){return new t([r.m11,r.m21,r.m31,r.m41,r.m12,r.m22,r.m32,r.m42,r.m13,r.m23,r.m33,r.m43,r.m14,r.m24,r.m34,r.m44])};t.fromArray=function fromArray(r){return feedFromArray(new t,r)};t.feedFromArray=feedFromArray;return t},"object"===_typeof(r)?t.exports=l():void 0!==(i="function"==typeof(o=l)?o.call(r,a,r,t):o)&&(t.exports=i)},(t,r,a)=>{a(62);a(77);var o=a(88);t.exports=o.Object.fromEntries},(t,r,a)=>{"use strict";var o=a(16),i=a(63),l=a(68),u=a(45),c=a(69),d="Array Iterator",h=u.set,p=u.getterFor(d);t.exports=c(Array,"Array",(function(t,r){h(this,{type:d,target:o(t),index:0,kind:r})}),(function(){var t=p(this),r=t.target,a=t.kind,o=t.index++;if(!r||o>=r.length){t.target=void 0;return{value:void 0,done:!0}}return"keys"==a?{value:o,done:!1}:"values"==a?{value:r[o],done:!1}:{value:[o,r[o]],done:!1}}),"values");l.Arguments=l.Array;i("keys");i("values");i("entries")},(t,r,a)=>{var o=a(30),i=a(64),l=a(41),u=o("unscopables"),c=Array.prototype;null==c[u]&&l.f(c,u,{configurable:!0,value:i(null)});t.exports=function(t){c[u][t]=!0}},(t,r,a)=>{var o,i=a(42),l=a(65),u=a(57),c=a(48),d=a(67),h=a(39),p=a(47),m=p("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"