@pdfslick/react 1.2.7 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js
CHANGED
|
@@ -4,11 +4,12 @@ import { StoreApi } from "zustand";
|
|
|
4
4
|
import type { PDFSlickState, PDFSlickOptions } from "@pdfslick/core";
|
|
5
5
|
import PDFSlickViewer from "./PDFSlickViewer";
|
|
6
6
|
import { PDFSlickThumbnails } from "./PDFSlickThumbnails";
|
|
7
|
+
export { PDFSlickViewer };
|
|
7
8
|
export type TUsePDFSlickStore = {
|
|
8
9
|
(): PDFSlickState;
|
|
9
10
|
<T>(selector: (state: PDFSlickState) => T, equals?: ((a: T, b: T) => boolean) | undefined): T;
|
|
10
11
|
};
|
|
11
|
-
type TUsePDFSlick = (url: string | URL | undefined, options?: PDFSlickOptions) => {
|
|
12
|
+
type TUsePDFSlick = (url: string | URL | ArrayBuffer | undefined, options?: PDFSlickOptions) => {
|
|
12
13
|
isDocumentLoaded: boolean;
|
|
13
14
|
viewerRef: RefCallback<HTMLElement>;
|
|
14
15
|
thumbsRef: RefCallback<HTMLElement>;
|
|
@@ -28,5 +29,4 @@ export declare function createStore(store: StoreApi<PDFSlickState>): {
|
|
|
28
29
|
* @returns
|
|
29
30
|
*/
|
|
30
31
|
export declare const usePDFSlick: TUsePDFSlick;
|
|
31
|
-
export {};
|
|
32
32
|
//# sourceMappingURL=usePDFSlick.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePDFSlick.d.ts","sourceRoot":"","sources":["../usePDFSlick.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAoC,WAAW,EAAW,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAE7C,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,aAAa,CAAC;IAClB,CAAC,CAAC,EACA,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,CAAC,EACrC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,SAAS,GAC7C,CAAC,CAAC;CACN,CAAC;AAEF,KAAK,YAAY,GAAG,CAClB,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"usePDFSlick.d.ts","sourceRoot":"","sources":["../usePDFSlick.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAoC,WAAW,EAAW,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAE7C,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,aAAa,CAAC;IAClB,CAAC,CAAC,EACA,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,CAAC,EACrC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,SAAS,GAC7C,CAAC,CAAC;CACN,CAAC;AAEF,KAAK,YAAY,GAAG,CAClB,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,WAAW,GAAG,SAAS,EAE3C,OAAO,CAAC,EAAE,eAAe,KACtB;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACpC,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACpC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IAC/B,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;CAC/C,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC;QAC3B,aAAa;0BAEtB,aAAa,kCACN,OAAO;EAUnC;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,YA+CzB,CAAC"}
|
package/dist/pdf_viewer.css
CHANGED
|
@@ -1327,17 +1327,6 @@ body {
|
|
|
1327
1327
|
display: none !important;
|
|
1328
1328
|
}
|
|
1329
1329
|
|
|
1330
|
-
#viewerContainer.pdfPresentationMode:-webkit-full-screen {
|
|
1331
|
-
top: 0;
|
|
1332
|
-
background-color: rgba(0, 0, 0, 1);
|
|
1333
|
-
width: 100%;
|
|
1334
|
-
height: 100%;
|
|
1335
|
-
overflow: hidden;
|
|
1336
|
-
cursor: none;
|
|
1337
|
-
-webkit-user-select: none;
|
|
1338
|
-
user-select: none;
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
1330
|
#viewerContainer.pdfPresentationMode:fullscreen {
|
|
1342
1331
|
top: 0;
|
|
1343
1332
|
background-color: rgba(0, 0, 0, 1);
|
|
@@ -1350,18 +1339,10 @@ body {
|
|
|
1350
1339
|
user-select: none;
|
|
1351
1340
|
}
|
|
1352
1341
|
|
|
1353
|
-
.pdfPresentationMode:-webkit-full-screen section:not([data-internal-link]) {
|
|
1354
|
-
pointer-events: none;
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
1342
|
.pdfPresentationMode:fullscreen section:not([data-internal-link]) {
|
|
1358
1343
|
pointer-events: none;
|
|
1359
1344
|
}
|
|
1360
1345
|
|
|
1361
|
-
.pdfPresentationMode:-webkit-full-screen .textLayer span {
|
|
1362
|
-
cursor: none;
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
1346
|
.pdfPresentationMode:fullscreen .textLayer span {
|
|
1366
1347
|
cursor: none;
|
|
1367
1348
|
}
|
package/dist/umd/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react/jsx-runtime"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react/jsx-runtime","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).PDFSlickReact={},e.React,e.jsxRuntime,e.ReactDOM)}(this,(function(exports,React,jsxRuntime,reactDom){"use strict";const createStoreImpl=e=>{let t;const i=new Set,n=(e,n)=>{const s="function"==typeof e?e(t):e;if(!Object.is(s,t)){const e=t;t=(null!=n?n:"object"!=typeof s||null===s)?s:Object.assign({},t,s),i.forEach((i=>i(t,e)))}},s=()=>t,r={setState:n,getState:s,subscribe:e=>(i.add(e),()=>i.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}}
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react/jsx-runtime"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react/jsx-runtime","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).PDFSlickReact={},e.React,e.jsxRuntime,e.ReactDOM)}(this,(function(exports,React,jsxRuntime,reactDom){"use strict";var _documentCurrentScript="undefined"!=typeof document?document.currentScript:null;const createStoreImpl=e=>{let t;const i=new Set,n=(e,n)=>{const s="function"==typeof e?e(t):e;if(!Object.is(s,t)){const e=t;t=(null!=n?n:"object"!=typeof s||null===s)?s:Object.assign({},t,s),i.forEach((i=>i(t,e)))}},s=()=>t,r={setState:n,getState:s,getInitialState:()=>a,subscribe:e=>(i.add(e),()=>i.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},a=t=e(n,s,r);return r},createStore$1=e=>e?createStoreImpl(e):createStoreImpl;function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),i}var withSelector={exports:{}},withSelector_production_min={},shim={exports:{}},useSyncExternalStoreShim_production_min={},hasRequiredUseSyncExternalStoreShim_production_min,hasRequiredShim,hasRequiredWithSelector_production_min;function requireUseSyncExternalStoreShim_production_min(){if(hasRequiredUseSyncExternalStoreShim_production_min)return useSyncExternalStoreShim_production_min;hasRequiredUseSyncExternalStoreShim_production_min=1;var e=React;var t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=e.useState,n=e.useEffect,s=e.useLayoutEffect,r=e.useDebugValue;function a(e){var i=e.getSnapshot;e=e.value;try{var n=i();return!t(e,n)}catch(e){return!0}}var o="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var o=t(),l=i({inst:{value:o,getSnapshot:t}}),h=l[0].inst,c=l[1];return s((function(){h.value=o,h.getSnapshot=t,a(h)&&c({inst:h})}),[e,o,t]),n((function(){return a(h)&&c({inst:h}),e((function(){a(h)&&c({inst:h})}))}),[e]),r(o),o};return useSyncExternalStoreShim_production_min.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:o,useSyncExternalStoreShim_production_min}function requireShim(){return hasRequiredShim||(hasRequiredShim=1,shim.exports=requireUseSyncExternalStoreShim_production_min()),shim.exports}
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/function requireWithSelector_production_min(){if(hasRequiredWithSelector_production_min)return withSelector_production_min;hasRequiredWithSelector_production_min=1;var e=React,t=requireShim();var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=t.useSyncExternalStore,s=e.useRef,r=e.useEffect,a=e.useMemo,o=e.useDebugValue;return withSelector_production_min.useSyncExternalStoreWithSelector=function(e,t,l,h,c){var d=s(null);if(null===d.current){var u={hasValue:!1,value:null};d.current=u}else u=d.current;d=a((function(){function e(e){if(!r){if(r=!0,n=e,e=h(e),void 0!==c&&u.hasValue){var t=u.value;if(c(t,e))return s=t}return s=e}if(t=s,i(n,e))return t;var a=h(e);return void 0!==c&&c(t,a)?t:(n=e,s=a)}var n,s,r=!1,a=void 0===l?null:l;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,l,h,c]);var p=n(e,d[0],d[1]);return r((function(){u.hasValue=!0,u.value=p}),[p]),o(p),p},withSelector_production_min}withSelector.exports=requireWithSelector_production_min();var withSelectorExports=withSelector.exports,useSyncExternalStoreExports=getDefaultExportFromCjs(withSelectorExports);const{useDebugValue:useDebugValue}=React,{useSyncExternalStoreWithSelector:useSyncExternalStoreWithSelector}=useSyncExternalStoreExports;let didWarnAboutEqualityFn=!1;function useStore(e,t=
|
|
10
|
+
*/function requireWithSelector_production_min(){if(hasRequiredWithSelector_production_min)return withSelector_production_min;hasRequiredWithSelector_production_min=1;var e=React,t=requireShim();var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=t.useSyncExternalStore,s=e.useRef,r=e.useEffect,a=e.useMemo,o=e.useDebugValue;return withSelector_production_min.useSyncExternalStoreWithSelector=function(e,t,l,h,c){var d=s(null);if(null===d.current){var u={hasValue:!1,value:null};d.current=u}else u=d.current;d=a((function(){function e(e){if(!r){if(r=!0,n=e,e=h(e),void 0!==c&&u.hasValue){var t=u.value;if(c(t,e))return s=t}return s=e}if(t=s,i(n,e))return t;var a=h(e);return void 0!==c&&c(t,a)?t:(n=e,s=a)}var n,s,r=!1,a=void 0===l?null:l;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,l,h,c]);var p=n(e,d[0],d[1]);return r((function(){u.hasValue=!0,u.value=p}),[p]),o(p),p},withSelector_production_min}withSelector.exports=requireWithSelector_production_min();var withSelectorExports=withSelector.exports,useSyncExternalStoreExports=getDefaultExportFromCjs(withSelectorExports);const{useDebugValue:useDebugValue}=React,{useSyncExternalStoreWithSelector:useSyncExternalStoreWithSelector}=useSyncExternalStoreExports;let didWarnAboutEqualityFn=!1;const identity=e=>e;function useStore(e,t=identity,i){i&&!didWarnAboutEqualityFn&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),didWarnAboutEqualityFn=!0);const n=useSyncExternalStoreWithSelector(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,i);return useDebugValue(n),n}function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf={exports:{}},_nodeResolve_empty={},_nodeResolve_empty$1=Object.freeze({__proto__:null,default:_nodeResolve_empty}),require$$5=getAugmentedNamespace(_nodeResolve_empty$1);
|
|
11
11
|
/**
|
|
12
12
|
* @licstart The following is the entire license notice for the
|
|
13
13
|
* JavaScript code in this page
|
|
@@ -51,4 +51,4 @@
|
|
|
51
51
|
* @licend The above is the entire license notice for the
|
|
52
52
|
* JavaScript code in this page
|
|
53
53
|
*/
|
|
54
|
-
!function(e,t){var i,n;i=globalThis,n=()=>(()=>{var e=[,(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFindController=t.FindState=void 0;var n=i(2),s=i(3),r=i(4);const a={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};t.FindState=a;const o={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},l=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]);let h;const c=/\p{M}+/gu,d=/([.*+?^${}()|[\]\\])|(\p{P})|(\s+)|(\p{M})|(\p{L})/gu,u=/([^\p{M}])\p{M}*$/u,p=/^\p{M}*([^\p{M}])/u,g=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,f=new Map,m=new Map;let _=null,v=null;function b(e){const t=[];let i,n;for(;null!==(i=g.exec(e));){let{index:e}=i;for(const n of i[0]){let i=f.get(n);i||(i=n.normalize("NFD").length,f.set(n,i)),t.push([i,e++])}}if(0===t.length&&_)n=_;else if(t.length>0&&v)n=v;else{const e=`([${Object.keys(o).join("")}])|([${(0,s.getNormalizeWithNFKC)()}])|((?:゙|゚)\\n)|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|((?:\\p{Ideographic}|[-ヿ])\\n)|(\\n)`;n=0===t.length?_=new RegExp(e+"|(\\u0000)","gum"):v=new RegExp(e+"|([\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f])","gum")}const r=[];for(;null!==(i=c.exec(e));)r.push([i[0].length,i.index]);let a=e.normalize("NFD");const l=[[0,0]];let h=0,d=0,u=0,p=0,b=0,y=!1;return a=a.replace(n,((e,i,n,s,a,c,g,f,_,v)=>{if(v-=p,i){const e=o[i],t=e.length;for(let e=1;e<t;e++)l.push([v-u+e,u-e]);return u-=t-1,e}if(n){let e=m.get(n);e||(e=n.normalize("NFKC"),m.set(n,e));const t=e.length;for(let e=1;e<t;e++)l.push([v-u+e,u-e]);return u-=t-1,e}if(s)return y=!0,v+b===r[h]?.[1]?++h:(l.push([v-1-u+1,u-1]),u-=1,p+=1),l.push([v-u+1,u]),p+=1,b+=1,s.charAt(0);if(a){const e=a.endsWith("\n"),t=e?a.length-2:a.length;y=!0;let i=t;v+b===r[h]?.[1]&&(i-=r[h][0],++h);for(let e=1;e<=i;e++)l.push([v-1-u+e,u-e]);return u-=i,p+=i,e?(v+=t-1,l.push([v-u+1,1+u]),u+=1,p+=1,b+=1,a.slice(0,t)):a}if(c){const e=c.length-2;return l.push([v-u+e,1+u]),u+=1,p+=1,b+=1,c.slice(0,-2)}if(g){const e=g.length-1;return l.push([v-u+e,u]),p+=1,b+=1,g.slice(0,-1)}if(f)return l.push([v-u+1,u-1]),u-=1,p+=1,b+=1," ";if(v+b===t[d]?.[1]){const e=t[d][0]-1;++d;for(let t=1;t<=e;t++)l.push([v-(u-t),u-t]);u-=e,p+=e}return _})),l.push([a.length,u]),[a,l,y]}function y(e,t,i){if(!e)return[t,i];const s=t,r=t+i-1;let a=(0,n.binarySearchFirstItem)(e,(e=>e[0]>=s));e[a][0]>s&&--a;let o=(0,n.binarySearchFirstItem)(e,(e=>e[0]>=r),a);e[o][0]>r&&--o;const l=s+e[a][1];return[l,r+e[o][1]+1-l]}t.PDFFindController=class{#Ln=null;#kn=!0;#Rn=0;constructor({linkService:e,eventBus:t,updateMatchesCountOnProgress:i=!0}){this._linkService=e,this._eventBus=t,this.#kn=i,this.onIsPageVisible=null,this.#In(),t._on("find",this.#On.bind(this)),t._on("findbarclose",this.#Nn.bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this.#Ln}setDocument(e){this._pdfDocument&&this.#In(),e&&(this._pdfDocument=e,this._firstPageCapability.resolve())}#On(e){if(!e)return;!1===e.phraseSearch&&(console.error("The `phraseSearch`-parameter was removed, please provide an Array of strings in the `query`-parameter instead."),"string"==typeof e.query&&(e.query=e.query.match(/\S+/g)));const t=this._pdfDocument,{type:i}=e;(null===this.#Ln||this.#Bn(e))&&(this._dirtyMatch=!0),this.#Ln=e,"highlightallchange"!==i&&this.#Vn(a.PENDING),this._firstPageCapability.promise.then((()=>{if(!this._pdfDocument||t&&this._pdfDocument!==t)return;this.#Kt();const e=!this._highlightMatches,n=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),i?this._dirtyMatch?this.#Un():"again"===i?(this.#Un(),e&&this.#Ln.highlightAll&&this.#jn()):"highlightallchange"===i?(n?this.#Un():this._highlightMatches=!0,this.#jn()):this.#Un():this._findTimeout=setTimeout((()=>{this.#Un(),this._findTimeout=null}),250)}))}scrollMatchIntoView({element:e=null,selectedLeft:t=0,pageIndex:i=-1,matchIndex:s=-1}){if(!this._scrollMatches||!e)return;if(-1===s||s!==this._selected.matchIdx)return;if(-1===i||i!==this._selected.pageIdx)return;this._scrollMatches=!1;const r={top:-50,left:t+-400};(0,n.scrollIntoView)(e,r,!0)}#In(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],this.#Rn=0,this.#Ln=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=new r.PromiseCapability}get#Hn(){const{query:e}=this.#Ln;return"string"==typeof e?(e!==this._rawQuery&&(this._rawQuery=e,[this._normalizedQuery]=b(e)),this._normalizedQuery):(e||[]).filter((e=>!!e)).map((e=>b(e)[0]))}#Bn(e){const t=e.query,i=this.#Ln.query,n=typeof t;if(n!==typeof i)return!0;if("string"===n){if(t!==i)return!0}else if(JSON.stringify(t)!==JSON.stringify(i))return!0;switch(e.type){case"again":const e=this._selected.pageIdx+1,t=this._linkService;return e>=1&&e<=t.pagesCount&&e!==t.page&&!(this.onIsPageVisible?.(e)??1);case"highlightallchange":return!1}return!0}#Wn(e,t,i){let n=e.slice(0,t).match(u);if(n){const i=e.charCodeAt(t),r=n[1].charCodeAt(0);if((0,s.getCharacterType)(i)===(0,s.getCharacterType)(r))return!1}if(n=e.slice(t+i).match(p),n){const r=e.charCodeAt(t+i-1),a=n[1].charCodeAt(0);if((0,s.getCharacterType)(r)===(0,s.getCharacterType)(a))return!1}return!0}#zn(e,t,i,n){const s=this._pageMatches[i]=[],r=this._pageMatchesLength[i]=[];if(!e)return;const a=this._pageDiffs[i];let o;for(;null!==(o=e.exec(n));){if(t&&!this.#Wn(n,o.index,o[0].length))continue;const[e,i]=y(a,o.index,o[0].length);i&&(s.push(e),r.push(i))}}#Gn(e,t){const{matchDiacritics:i}=this.#Ln;let n=!1;const s="[ ]*";return(e=e.replaceAll(d,((e,s,r,a,o,h)=>s?`[ ]*\\${s}[ ]*`:r?`[ ]*${r}[ ]*`:a?"[ ]+":i?o||h:o?l.has(o.charCodeAt(0))?o:"":t?(n=!0,`${h}\\p{M}*`):h))).endsWith(s)&&(e=e.slice(0,e.length-4)),i&&t&&(h||=String.fromCharCode(...l),n=!0,e=`${e}(?=[${h}]|[^\\p{M}]|$)`),[n,e]}#$n(e){let t=this.#Hn;if(0===t.length)return;const{caseSensitive:i,entireWord:n}=this.#Ln,s=this._pageContents[e],r=this._hasDiacritics[e];let a=!1;"string"==typeof t?[a,t]=this.#Gn(t,r):t=t.sort().reverse().map((e=>{const[t,i]=this.#Gn(e,r);return a||=t,`(${i})`})).join("|"),t=t?new RegExp(t,`g${a?"u":""}${i?"":"i"}`):null,this.#zn(t,n,e,s),this.#Ln.highlightAll&&this.#qn(e),this._resumePageIdx===e&&(this._resumePageIdx=null,this.#Xn());const o=this._pageMatches[e].length;this._matchesCountTotal+=o,this.#kn?o>0&&this.#Kn():++this.#Rn===this._linkService.pagesCount&&this.#Kn()}#Kt(){if(this._extractTextPromises.length>0)return;let e=Promise.resolve();const t={disableNormalization:!0};for(let i=0,n=this._linkService.pagesCount;i<n;i++){const n=new r.PromiseCapability;this._extractTextPromises[i]=n.promise,e=e.then((()=>this._pdfDocument.getPage(i+1).then((e=>e.getTextContent(t))).then((e=>{const t=[];for(const i of e.items)t.push(i.str),i.hasEOL&&t.push("\n");[this._pageContents[i],this._pageDiffs[i],this._hasDiacritics[i]]=b(t.join("")),n.resolve()}),(e=>{console.error(`Unable to get text content for page ${i+1}`,e),this._pageContents[i]="",this._pageDiffs[i]=null,this._hasDiacritics[i]=!1,n.resolve()}))))}}#qn(e){this._scrollMatches&&this._selected.pageIdx===e&&(this._linkService.page=e+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:e})}#jn(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}#Un(){const e=this.#Ln.findPrevious,t=this._linkService.page-1,i=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=t,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,this.#Rn=0,this._matchesCountTotal=0,this.#jn();for(let e=0;e<i;e++)this._pendingFindMatches.has(e)||(this._pendingFindMatches.add(e),this._extractTextPromises[e].then((()=>{this._pendingFindMatches.delete(e),this.#$n(e)})))}if(0===this.#Hn.length)return void this.#Vn(a.FOUND);if(this._resumePageIdx)return;const n=this._offset;if(this._pagesToSearch=i,null!==n.matchIdx){const t=this._pageMatches[n.pageIdx].length;if(!e&&n.matchIdx+1<t||e&&n.matchIdx>0)return n.matchIdx=e?n.matchIdx-1:n.matchIdx+1,void this.#Yn(!0);this.#Qn(e)}this.#Xn()}#Jn(e){const t=this._offset,i=e.length,n=this.#Ln.findPrevious;return i?(t.matchIdx=n?i-1:0,this.#Yn(!0),!0):(this.#Qn(n),!!(t.wrapped&&(t.matchIdx=null,this._pagesToSearch<0))&&(this.#Yn(!1),!0))}#Xn(){null!==this._resumePageIdx&&console.error("There can only be one pending page.");let e=null;do{const t=this._offset.pageIdx;if(e=this._pageMatches[t],!e){this._resumePageIdx=t;break}}while(!this.#Jn(e))}#Qn(e){const t=this._offset,i=this._linkService.pagesCount;t.pageIdx=e?t.pageIdx-1:t.pageIdx+1,t.matchIdx=null,this._pagesToSearch--,(t.pageIdx>=i||t.pageIdx<0)&&(t.pageIdx=e?i-1:0,t.wrapped=!0)}#Yn(e=!1){let t=a.NOT_FOUND;const i=this._offset.wrapped;if(this._offset.wrapped=!1,e){const e=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,t=i?a.WRAPPED:a.FOUND,-1!==e&&e!==this._selected.pageIdx&&this.#qn(e)}this.#Vn(t,this.#Ln.findPrevious),-1!==this._selected.pageIdx&&(this._scrollMatches=!0,this.#qn(this._selected.pageIdx))}#Nn(e){const t=this._pdfDocument;this._firstPageCapability.promise.then((()=>{!this._pdfDocument||t&&this._pdfDocument!==t||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),this.#Vn(a.FOUND),this._highlightMatches=!1,this.#jn())}))}#Zn(){const{pageIdx:e,matchIdx:t}=this._selected;let i=0,n=this._matchesCountTotal;if(-1!==t){for(let t=0;t<e;t++)i+=this._pageMatches[t]?.length||0;i+=t+1}return(i<1||i>n)&&(i=n=0),{current:i,total:n}}#Kn(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this.#Zn()})}#Vn(e,t=!1){(this.#kn||this.#Rn===this._linkService.pagesCount&&e!==a.PENDING)&&this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:e,previous:t,matchesCount:this.#Zn(),rawQuery:this.#Ln?.query??null})}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.animationStarted=t.VERTICAL_PADDING=t.UNKNOWN_SCALE=t.TextLayerMode=t.SpreadMode=t.SidebarView=t.ScrollMode=t.SCROLLBAR_PADDING=t.RenderingStates=t.ProgressBar=t.PresentationModeState=t.OutputScale=t.MIN_SCALE=t.MAX_SCALE=t.MAX_AUTO_SCALE=t.DEFAULT_SCALE_VALUE=t.DEFAULT_SCALE_DELTA=t.DEFAULT_SCALE=t.CursorTool=t.AutoPrintRegExp=void 0,t.apiPageLayoutToViewerModes=function(e){let t=n.VERTICAL,i=s.NONE;switch(e){case"SinglePage":t=n.PAGE;break;case"OneColumn":break;case"TwoPageLeft":t=n.PAGE;case"TwoColumnLeft":i=s.ODD;break;case"TwoPageRight":t=n.PAGE;case"TwoColumnRight":i=s.EVEN}return{scrollMode:t,spreadMode:i}},t.apiPageModeToSidebarView=function(e){switch(e){case"UseNone":return i.NONE;case"UseThumbs":return i.THUMBS;case"UseOutlines":return i.OUTLINE;case"UseAttachments":return i.ATTACHMENTS;case"UseOC":return i.LAYERS}return i.NONE},t.approximateFraction=function(e){if(Math.floor(e)===e)return[e,1];const t=1/e;if(t>8)return[1,8];if(Math.floor(t)===t)return[1,t];const i=e>1?t:e;let n,s=0,r=1,a=1,o=1;for(;;){const e=s+a,t=r+o;if(t>8)break;i<=e/t?(a=e,o=t):(s=e,r=t)}return n=i-s/r<a/o-i?i===e?[s,r]:[r,s]:i===e?[a,o]:[o,a],n},t.backtrackBeforeAllVisibleElements=o,t.binarySearchFirstItem=a,t.docStyle=void 0,t.getActiveOrFocusedElement=function(){let e=document,t=e.activeElement||e.querySelector(":focus");for(;t?.shadowRoot;)e=t.shadowRoot,t=e.activeElement||e.querySelector(":focus");return t},t.getPageSizeInches=function({view:e,userUnit:t,rotate:i}){const[n,s,r,a]=e,o=i%180!=0,l=(r-n)/72*t,h=(a-s)/72*t;return{width:o?h:l,height:o?l:h}},t.getVisibleElements=function({scrollEl:e,views:t,sortByVisibility:i=!1,horizontal:n=!1,rtl:s=!1}){const r=e.scrollTop,l=r+e.clientHeight,h=e.scrollLeft,c=h+e.clientWidth,d=[],u=new Set,p=t.length;let g=a(t,n?function(e){const t=e.div,i=t.offsetLeft+t.clientLeft,n=i+t.clientWidth;return s?i<c:n>h}:function(e){const t=e.div;return t.offsetTop+t.clientTop+t.clientHeight>r});g>0&&g<p&&!n&&(g=o(g,t,r));let f=n?c:-1;for(let e=g;e<p;e++){const i=t[e],s=i.div,a=s.offsetLeft+s.clientLeft,o=s.offsetTop+s.clientTop,p=s.clientWidth,g=s.clientHeight,m=a+p,_=o+g;if(-1===f)_>=l&&(f=_);else if((n?a:o)>f)break;if(_<=r||o>=l||m<=h||a>=c)continue;const v=Math.max(0,r-o)+Math.max(0,_-l),b=(p-(Math.max(0,h-a)+Math.max(0,m-c)))/p,y=(g-v)/g*b*100|0;d.push({id:i.id,x:a,y:o,view:i,percent:y,widthPercent:100*b|0}),u.add(i.id)}const m=d[0],_=d.at(-1);return i&&d.sort((function(e,t){const i=e.percent-t.percent;return Math.abs(i)>.001?-i:e.id-t.id})),{first:m,last:_,views:d,ids:u}},t.isPortraitOrientation=function(e){return e.width<=e.height},t.isValidRotation=function(e){return Number.isInteger(e)&&e%90==0},t.isValidScrollMode=function(e){return Number.isInteger(e)&&Object.values(n).includes(e)&&e!==n.UNKNOWN},t.isValidSpreadMode=function(e){return Number.isInteger(e)&&Object.values(s).includes(e)&&e!==s.UNKNOWN},t.normalizeWheelEventDelta=function(e){const t=e.deltaMode;let i=l(e);return t===WheelEvent.DOM_DELTA_PIXEL?i/=900:t===WheelEvent.DOM_DELTA_LINE&&(i/=30),i},t.normalizeWheelEventDirection=l,t.parseQueryString=function(e){const t=new Map;for(const[i,n]of new URLSearchParams(e))t.set(i.toLowerCase(),n);return t},t.removeNullCharacters=function(e,t=!1){return"string"!=typeof e?(console.error("The argument must be a string."),e):(t&&(e=e.replaceAll(r," ")),e.replaceAll("\0",""))},t.roundToDivide=function(e,t){const i=e%t;return 0===i?e:Math.round(e-i+t)},t.scrollIntoView=function(e,t,i=!1){let n=e.offsetParent;if(!n)return void console.error("offsetParent is not set -- cannot scroll");let s=e.offsetTop+e.clientTop,r=e.offsetLeft+e.clientLeft;for(;n.clientHeight===n.scrollHeight&&n.clientWidth===n.scrollWidth||i&&(n.classList.contains("markedContent")||"hidden"===getComputedStyle(n).overflow);)if(s+=n.offsetTop,r+=n.offsetLeft,n=n.offsetParent,!n)return;t&&(void 0!==t.top&&(s+=t.top),void 0!==t.left&&(r+=t.left,n.scrollLeft=r)),n.scrollTop=s},t.toggleCheckedBtn=function(e,t,i=null){e.classList.toggle("toggled",t),e.setAttribute("aria-checked",t),i?.classList.toggle("hidden",!t)},t.toggleExpandedBtn=function(e,t,i=null){e.classList.toggle("toggled",t),e.setAttribute("aria-expanded",t),i?.classList.toggle("hidden",!t)},t.watchScroll=function(e,t){const i=function(i){s||(s=window.requestAnimationFrame((function(){s=null;const i=e.scrollLeft,r=n.lastX;i!==r&&(n.right=i>r),n.lastX=i;const a=e.scrollTop,o=n.lastY;a!==o&&(n.down=a>o),n.lastY=a,t(n)})))},n={right:!0,down:!0,lastX:e.scrollLeft,lastY:e.scrollTop,_eventHandler:i};let s=null;return e.addEventListener("scroll",i,!0),n},t.DEFAULT_SCALE_VALUE="auto",t.DEFAULT_SCALE=1,t.DEFAULT_SCALE_DELTA=1.1,t.MIN_SCALE=.1,t.MAX_SCALE=10,t.UNKNOWN_SCALE=0,t.MAX_AUTO_SCALE=1.25,t.SCROLLBAR_PADDING=40,t.VERTICAL_PADDING=5,t.RenderingStates={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},t.PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};const i={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4};t.SidebarView=i,t.TextLayerMode={DISABLE:0,ENABLE:1,ENABLE_PERMISSIONS:2};const n={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3};t.ScrollMode=n;const s={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};t.SpreadMode=s,t.CursorTool={SELECT:0,HAND:1,ZOOM:2},t.AutoPrintRegExp=/\bprint\s*\(/,t.OutputScale=class{constructor(){const e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return 1!==this.sx||1!==this.sy}};const r=/[\x01-\x1F]/g;function a(e,t,i=0){let n=i,s=e.length-1;if(s<0||!t(e[s]))return e.length;if(t(e[n]))return n;for(;n<s;){const i=n+s>>1;t(e[i])?s=i:n=i+1}return n}function o(e,t,i){if(e<2)return e;let n=t[e].div,s=n.offsetTop+n.clientTop;s>=i&&(n=t[e-1].div,s=n.offsetTop+n.clientTop);for(let i=e-2;i>=0&&(n=t[i].div,!(n.offsetTop+n.clientTop+n.clientHeight<=s));--i)e=i;return e}function l(e){let t=Math.hypot(e.deltaX,e.deltaY);const i=Math.atan2(e.deltaY,e.deltaX);return-.25*Math.PI<i&&i<.75*Math.PI&&(t=-t),t}const h=new Promise((function(e){window.requestAnimationFrame(e)}));t.animationStarted=h;const c=document.documentElement.style;t.docStyle=c,t.ProgressBar=class{#es=null;#ts=null;#is=0;#ns=null;#mt=!0;constructor(e){this.#es=e.classList,this.#ns=e.style}get percent(){return this.#is}set percent(e){var t,i,n;this.#is=(t=e,i=0,n=100,Math.min(Math.max(t,i),n)),isNaN(e)?this.#es.add("indeterminate"):(this.#es.remove("indeterminate"),this.#ns.setProperty("--progressBar-percent",`${this.#is}%`))}setWidth(e){if(!e)return;const t=e.parentNode.offsetWidth-e.offsetWidth;t>0&&this.#ns.setProperty("--progressBar-end-offset",`${t}px`)}setDisableAutoFetch(e=5e3){isNaN(this.#is)||(this.#ts&&clearTimeout(this.#ts),this.show(),this.#ts=setTimeout((()=>{this.#ts=null,this.hide()}),e))}hide(){this.#mt&&(this.#mt=!1,this.#es.add("hidden"))}show(){this.#mt||(this.#mt=!0,this.#es.remove("hidden"))}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterType=void 0,t.getCharacterType=function(e){return function(e){return e<11904}(e)?function(e){return 0==(65408&e)}(e)?function(e){return 32===e||9===e||13===e||10===e}(e)?i.SPACE:function(e){return e>=97&&e<=122||e>=65&&e<=90}(e)||function(e){return e>=48&&e<=57}(e)||95===e?i.ALPHA_LETTER:i.PUNCT:function(e){return 3584==(65408&e)}(e)?i.THAI_LETTER:160===e?i.SPACE:i.ALPHA_LETTER:function(e){return e>=13312&&e<=40959||e>=63744&&e<=64255}(e)?i.HAN_LETTER:function(e){return e>=12448&&e<=12543}(e)?i.KATAKANA_LETTER:function(e){return e>=12352&&e<=12447}(e)?i.HIRAGANA_LETTER:function(e){return e>=65376&&e<=65439}(e)?i.HALFWIDTH_KATAKANA_LETTER:i.ALPHA_LETTER},t.getNormalizeWithNFKC=function(){return n||=" ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩",n};const i={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};let n;t.CharacterType=i},e=>{e.exports=globalThis.pdfjsLib},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLinkService=t.PDFLinkService=t.LinkTarget=void 0;var n=i(2);const s={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};function r(e,{url:t,target:i,rel:n,enabled:r=!0}={}){if(!t||"string"!=typeof t)throw new Error('A valid "url" parameter must provided.');r?e.href=e.title=t:(e.href="",e.title=`Disabled: ${t}`,e.onclick=()=>!1);let a="";switch(i){case s.NONE:break;case s.SELF:a="_self";break;case s.BLANK:a="_blank";break;case s.PARENT:a="_parent";break;case s.TOP:a="_top"}e.target=a,e.rel="string"==typeof n?n:"noopener noreferrer nofollow"}t.LinkTarget=s;class a{#ss=new Map;constructor({eventBus:e,externalLinkTarget:t=null,externalLinkRel:i=null,ignoreDestinationZoom:n=!1}={}){this.eventBus=e,this.externalLinkTarget=t,this.externalLinkRel=i,this.externalLinkEnabled=!0,this._ignoreDestinationZoom=n,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(e,t=null){this.baseUrl=t,this.pdfDocument=e,this.#ss.clear()}setViewer(e){this.pdfViewer=e}setHistory(e){this.pdfHistory=e}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(e){this.pdfViewer.currentPageNumber=e}get rotation(){return this.pdfViewer.pagesRotation}set rotation(e){this.pdfViewer.pagesRotation=e}get isInPresentationMode(){return this.pdfViewer.isInPresentationMode}#rs(e,t=null,i){const n=i[0];let s;if("object"==typeof n&&null!==n){if(s=this._cachedPageNumber(n),!s)return void this.pdfDocument.getPageIndex(n).then((s=>{this.cachePageRef(s+1,n),this.#rs(e,t,i)})).catch((()=>{console.error(`PDFLinkService.#goToDestinationHelper: "${n}" is not a valid page reference, for dest="${e}".`)}))}else{if(!Number.isInteger(n))return void console.error(`PDFLinkService.#goToDestinationHelper: "${n}" is not a valid destination reference, for dest="${e}".`);s=n+1}!s||s<1||s>this.pagesCount?console.error(`PDFLinkService.#goToDestinationHelper: "${s}" is not a valid page number, for dest="${e}".`):(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:t,explicitDest:i,pageNumber:s})),this.pdfViewer.scrollPageIntoView({pageNumber:s,destArray:i,ignoreDestinationZoom:this._ignoreDestinationZoom}))}async goToDestination(e){if(!this.pdfDocument)return;let t,i;"string"==typeof e?(t=e,i=await this.pdfDocument.getDestination(e)):(t=null,i=await e),Array.isArray(i)?this.#rs(e,t,i):console.error(`PDFLinkService.goToDestination: "${i}" is not a valid destination array, for dest="${e}".`)}goToPage(e){if(!this.pdfDocument)return;const t="string"==typeof e&&this.pdfViewer.pageLabelToPageNumber(e)||0|e;Number.isInteger(t)&&t>0&&t<=this.pagesCount?(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(t)),this.pdfViewer.scrollPageIntoView({pageNumber:t})):console.error(`PDFLinkService.goToPage: "${e}" is not a valid page.`)}addLinkAttributes(e,t,i=!1){r(e,{url:t,target:i?s.BLANK:this.externalLinkTarget,rel:this.externalLinkRel,enabled:this.externalLinkEnabled})}getDestinationHash(e){if("string"==typeof e){if(e.length>0)return this.getAnchorUrl("#"+escape(e))}else if(Array.isArray(e)){const t=JSON.stringify(e);if(t.length>0)return this.getAnchorUrl("#"+escape(t))}return this.getAnchorUrl("")}getAnchorUrl(e){return this.baseUrl?this.baseUrl+e:e}setHash(e){if(!this.pdfDocument)return;let t,i;if(e.includes("=")){const s=(0,n.parseQueryString)(e);if(s.has("search")){const e=s.get("search").replaceAll('"',""),t="true"===s.get("phrase");this.eventBus.dispatch("findfromurlhash",{source:this,query:t?e:e.match(/\S+/g)})}if(s.has("page")&&(t=0|s.get("page")||1),s.has("zoom")){const e=s.get("zoom").split(","),t=e[0],n=parseFloat(t);t.includes("Fit")?"Fit"===t||"FitB"===t?i=[null,{name:t}]:"FitH"===t||"FitBH"===t||"FitV"===t||"FitBV"===t?i=[null,{name:t},e.length>1?0|e[1]:null]:"FitR"===t?5!==e.length?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):i=[null,{name:t},0|e[1],0|e[2],0|e[3],0|e[4]]:console.error(`PDFLinkService.setHash: "${t}" is not a valid zoom value.`):i=[null,{name:"XYZ"},e.length>1?0|e[1]:null,e.length>2?0|e[2]:null,n?n/100:t]}i?this.pdfViewer.scrollPageIntoView({pageNumber:t||this.page,destArray:i,allowNegativeOffset:!0}):t&&(this.page=t),s.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:s.get("pagemode")}),s.has("nameddest")&&this.goToDestination(s.get("nameddest"))}else{i=unescape(e);try{i=JSON.parse(i),Array.isArray(i)||(i=i.toString())}catch{}if("string"==typeof i||a.#as(i))return void this.goToDestination(i);console.error(`PDFLinkService.setHash: "${unescape(e)}" is not a valid destination.`)}}executeNamedAction(e){switch(e){case"GoBack":this.pdfHistory?.back();break;case"GoForward":this.pdfHistory?.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}this.eventBus.dispatch("namedaction",{source:this,action:e})}async executeSetOCGState(e){const t=this.pdfDocument,i=await this.pdfViewer.optionalContentConfigPromise;if(t!==this.pdfDocument)return;let n;for(const t of e.state){switch(t){case"ON":case"OFF":case"Toggle":n=t;continue}switch(n){case"ON":i.setVisibility(t,!0);break;case"OFF":i.setVisibility(t,!1);break;case"Toggle":const e=i.getGroup(t);e&&i.setVisibility(t,!e.visible)}}this.pdfViewer.optionalContentConfigPromise=Promise.resolve(i)}cachePageRef(e,t){if(!t)return;const i=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;this.#ss.set(i,e)}_cachedPageNumber(e){if(!e)return null;const t=0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`;return this.#ss.get(t)||null}static#as(e){if(!Array.isArray(e))return!1;const t=e.length;if(t<2)return!1;const i=e[0];if(!("object"==typeof i&&Number.isInteger(i.num)&&Number.isInteger(i.gen)||Number.isInteger(i)&&i>=0))return!1;const n=e[1];if("object"!=typeof n||"string"!=typeof n.name)return!1;let s=!0;switch(n.name){case"XYZ":if(5!==t)return!1;break;case"Fit":case"FitB":return 2===t;case"FitH":case"FitBH":case"FitV":case"FitBV":if(3!==t)return!1;break;case"FitR":if(6!==t)return!1;s=!1;break;default:return!1}for(let i=2;i<t;i++){const t=e[i];if(!("number"==typeof t||s&&null===t))return!1}return!0}}t.PDFLinkService=a,t.SimpleLinkService=class{constructor(){this.externalLinkEnabled=!0}get pagesCount(){return 0}get page(){return 0}set page(e){}get rotation(){return 0}set rotation(e){}get isInPresentationMode(){return!1}async goToDestination(e){}goToPage(e){}addLinkAttributes(e,t,i=!1){r(e,{url:t,enabled:this.externalLinkEnabled})}getDestinationHash(e){return"#"}getAnchorUrl(e){return"#"}setHash(e){}executeNamedAction(e){}executeSetOCGState(e){}cachePageRef(e,t){}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationLayerBuilder=void 0;var n=i(4),s=i(7),r=i(2);t.AnnotationLayerBuilder=class{#os=null;constructor({pageDiv:e,pdfPage:t,linkService:i,downloadManager:n,annotationStorage:r=null,imageResourcesPath:a="",renderForms:o=!0,l10n:l=s.NullL10n,enableScripting:h=!1,hasJSActionsPromise:c=null,fieldObjectsPromise:d=null,annotationCanvasMap:u=null,accessibilityManager:p=null}){this.pageDiv=e,this.pdfPage=t,this.linkService=i,this.downloadManager=n,this.imageResourcesPath=a,this.renderForms=o,this.l10n=l,this.annotationStorage=r,this.enableScripting=h,this._hasJSActionsPromise=c||Promise.resolve(!1),this._fieldObjectsPromise=d||Promise.resolve(null),this._annotationCanvasMap=u,this._accessibilityManager=p,this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=i.eventBus}async render(e,t="display"){if(this.div){if(this._cancelled||!this.annotationLayer)return;return void this.annotationLayer.update({viewport:e.clone({dontFlip:!0})})}const[i,s,a]=await Promise.all([this.pdfPage.getAnnotations({intent:t}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;const o=this.div=document.createElement("div");o.className="annotationLayer",this.pageDiv.append(o),0!==i.length?(this.annotationLayer=new n.AnnotationLayer({div:o,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,l10n:this.l10n,page:this.pdfPage,viewport:e.clone({dontFlip:!0})}),await this.annotationLayer.render({annotations:i,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:s,fieldObjects:a}),this.linkService.isInPresentationMode&&this.#ls(r.PresentationModeState.FULLSCREEN),this.#os||(this.#os=e=>{this.#ls(e.state)},this._eventBus?._on("presentationmodechanged",this.#os))):this.hide()}cancel(){this._cancelled=!0,this.#os&&(this._eventBus?._off("presentationmodechanged",this.#os),this.#os=null)}hide(){this.div&&(this.div.hidden=!0)}#ls(e){if(!this.div)return;let t=!1;switch(e){case r.PresentationModeState.FULLSCREEN:t=!0;break;case r.PresentationModeState.NORMAL:break;default:return}for(const e of this.div.childNodes)e.hasAttribute("data-internal-link")||(e.inert=t)}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NullL10n=void 0,t.getL10nFallback=n;const i={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",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};function n(e,t){switch(e){case"find_match_count":e=`find_match_count[${1===t.total?"one":"other"}]`;break;case"find_match_count_limit":e=`find_match_count_limit[${1===t.limit?"one":"other"}]`}return i[e]||""}i.print_progress_percent="{{progress}}%";const s={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",get:async(e,t=null,i=n(e,t))=>function(e,t){return t?e.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,((e,i)=>i in t?t[i]:"{{"+i+"}}")):e}(i,t),async translate(e){}};t.NullL10n=s},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DownloadManager=void 0;var n=i(4);function s(e,t){const i=document.createElement("a");if(!i.click)throw new Error('DownloadManager: "a.click()" is not supported.');i.href=e,i.target="_parent","download"in i&&(i.download=t),(document.body||document.documentElement).append(i),i.click(),i.remove()}t.DownloadManager=class{#hs=new WeakMap;downloadUrl(e,t,i){(0,n.createValidAbsoluteUrl)(e,"http://example.com")?s(e+"#pdfjs.action=download",t):console.error(`downloadUrl - not a valid URL: ${e}`)}downloadData(e,t,i){s(URL.createObjectURL(new Blob([e],{type:i})),t)}openOrDownloadData(e,t,i){const s=(0,n.isPdfFile)(i)?"application/pdf":"";return this.downloadData(t,i,s),!1}download(e,t,i,n){s(URL.createObjectURL(e),i)}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WaitOnType=t.EventBus=t.AutomationEventBus=void 0,t.waitOnEventOrTimeout=function({target:e,name:t,delay:s=0}){return new Promise((function(r,a){if("object"!=typeof e||!t||"string"!=typeof t||!(Number.isInteger(s)&&s>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function o(i){e instanceof n?e._off(t,l):e.removeEventListener(t,l),c&&clearTimeout(c),r(i)}const l=o.bind(null,i.EVENT);e instanceof n?e._on(t,l):e.addEventListener(t,l);const h=o.bind(null,i.TIMEOUT),c=setTimeout(h,s)}))};const i={EVENT:"event",TIMEOUT:"timeout"};t.WaitOnType=i;class n{#a=Object.create(null);on(e,t,i=null){this._on(e,t,{external:!0,once:i?.once})}off(e,t,i=null){this._off(e,t,{external:!0,once:i?.once})}dispatch(e,t){const i=this.#a[e];if(!i||0===i.length)return;let n;for(const{listener:s,external:r,once:a}of i.slice(0))a&&this._off(e,s),r?(n||=[]).push(s):s(t);if(n){for(const e of n)e(t);n=null}}_on(e,t,i=null){(this.#a[e]||=[]).push({listener:t,external:!0===i?.external,once:!0===i?.once})}_off(e,t,i=null){const n=this.#a[e];if(n)for(let e=0,i=n.length;e<i;e++)if(n[e].listener===t)return void n.splice(e,1)}}t.EventBus=n,t.AutomationEventBus=class extends n{dispatch(e,t){throw new Error("Not implemented: AutomationEventBus.dispatch")}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GenericL10n=void 0,i(11);var n=i(7);const s={en:"en-US",es:"es-ES",fy:"fy-NL",ga:"ga-IE",gu:"gu-IN",hi:"hi-IN",hy:"hy-AM",nb:"nb-NO",ne:"ne-NP",nn:"nn-NO",pa:"pa-IN",pt:"pt-PT",sv:"sv-SE",zh:"zh-CN"};t.GenericL10n=class{constructor(e){const{webL10n:t}=document;this._lang=e,this._ready=new Promise(((i,n)=>{var r;t.setLanguage((r=e,s[r?.toLowerCase()]||r),(()=>{i(t)}))}))}async getLanguage(){return(await this._ready).getLanguage()}async getDirection(){return(await this._ready).getDirection()}async get(e,t=null,i=(0,n.getL10nFallback)(e,t)){return(await this._ready).get(e,t,i)}async translate(e){return(await this._ready).translate(e)}}},()=>{document.webL10n=function(e,t){var i={},n="",s="textContent",r="",a={},o="loading",l=!0;function h(e,t,i){t=t||function(e){},i=i||function(){};var n=new XMLHttpRequest;n.open("GET",e,l),n.overrideMimeType&&n.overrideMimeType("text/plain; charset=utf-8"),n.onreadystatechange=function(){4==n.readyState&&(200==n.status||0===n.status?t(n.responseText):i())},n.onerror=i,n.ontimeout=i;try{n.send(null)}catch(e){i()}}function c(e,t,r,a){var o=e.replace(/[^\/]*$/,"")||"./";function l(e){return e.lastIndexOf("\\")<0?e:e.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}h(e,(function(e){n+=e,function(e,i){var n={},s=/^\s*|\s*$/,r=/^\s*#|^\s*$/,a=/^\s*\[(.*)\]\s*$/,c=/^\s*@import\s+url\((.*)\)\s*$/i,d=/^([^=\s]*)\s*=\s*(.+)$/;function u(e,i,h){var u=e.replace(s,"").split(/[\r\n]+/),g="*",f=t.split("-",1)[0],m=!1,_="";!function e(){for(;;){if(!u.length)return void h();var s=u.shift();if(!r.test(s)){if(i){if(_=a.exec(s)){g=_[1].toLowerCase(),m="*"!==g&&g!==t&&g!==f;continue}if(m)continue;if(_=c.exec(s))return void p(o+_[1],e)}var v=s.match(d);v&&3==v.length&&(n[v[1]]=l(v[2]))}}}()}function p(e,t){h(e,(function(e){u(e,!1,t)}),(function(){console.warn(e+" not found."),t()}))}u(e,!0,(function(){i(n)}))}(e,(function(e){for(var t in e){var n,a,o=t.lastIndexOf(".");o>0?(n=t.substring(0,o),a=t.substring(o+1)):(n=t,a=s),i[n]||(i[n]={}),i[n][a]=e[t]}r&&r()}))}),a)}function d(e,s){e&&(e=e.toLowerCase()),s=s||function(){},i={},n="",r="",r=e;var a=t.querySelectorAll('link[type="application/l10n"]'),l=a.length;if(0!==l){var h,d,u=0;d=function(){++u>=l&&(s(),o="complete")};for(var p=0;p<l;p++)new _(a[p]).load(e,d)}else{var g=(h=t.querySelector('script[type="application/l10n"]'))?JSON.parse(h.innerHTML):null;if(g&&g.locales&&g.default_locale){if(console.log("using the embedded JSON directory, early way out"),!(i=g.locales[e])){var f=g.default_locale.toLowerCase();for(var m in g.locales){if((m=m.toLowerCase())===e){i=g.locales[e];break}m===f&&(i=g.locales[f])}}s()}else console.log("no resource to load, early way out");o="complete"}function _(e){var t=e.href;this.load=function(e,i){c(t,e,i,(function(){console.warn(t+" not found."),console.warn('"'+e+'" resource not found'),r="",i()}))}}}function u(e,t,n){var s=i[e];if(!s){if(console.warn("#"+e+" is undefined."),!n)return null;s=n}var r={};for(var a in s){var o=s[a];o=g(o=p(o,t,e,a),t,e),r[a]=o}return r}function p(e,t,n,s){var r=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(e);if(!r||!r.length)return e;var o,l=r[1],h=r[2];return t&&h in t?o=t[h]:h in i&&(o=i[h]),l in a&&(e=(0,a[l])(e,o,n,s)),e}function g(e,t,n){return e.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(e,s){return t&&s in t?t[s]:s in i?i[s]:(console.log("argument {{"+s+"}} for #"+n+" is undefined."),e)}))}function f(e){var i=function(e){if(!e)return{};var t=e.getAttribute("data-l10n-id"),i=e.getAttribute("data-l10n-args"),n={};if(i)try{n=JSON.parse(i)}catch(e){console.warn("could not parse arguments for #"+t)}return{id:t,args:n}}(e);if(i.id){var n=u(i.id,i.args);if(n){if(n[s]){if(0===function(e){if(e.children)return e.children.length;if(void 0!==e.childElementCount)return e.childElementCount;for(var t=0,i=0;i<e.childNodes.length;i++)t+=1===e.nodeType?1:0;return t}(e))e[s]=n[s];else{for(var r=e.childNodes,a=!1,o=0,l=r.length;o<l;o++)3===r[o].nodeType&&/\S/.test(r[o].nodeValue)&&(a?r[o].nodeValue="":(r[o].nodeValue=n[s],a=!0));if(!a){var h=t.createTextNode(n[s]);e.prepend(h)}}delete n[s]}for(var c in n)e[c]=n[c]}else console.warn("#"+i.id+" is undefined.")}}return a.plural=function(e,t,n,o){var l=parseFloat(t);if(isNaN(l))return e;if(o!=s)return e;a._pluralRules||(a._pluralRules=function(e){function t(e,t){return-1!==t.indexOf(e)}function i(e,t,i){return t<=e&&e<=i}var n={0:function(e){return"other"},1:function(e){return i(e%100,3,10)?"few":0===e?"zero":i(e%100,11,99)?"many":2==e?"two":1==e?"one":"other"},2:function(e){return 0!==e&&e%10==0?"many":2==e?"two":1==e?"one":"other"},3:function(e){return 1==e?"one":"other"},4:function(e){return i(e,0,1)?"one":"other"},5:function(e){return i(e,0,2)&&2!=e?"one":"other"},6:function(e){return 0===e?"zero":e%10==1&&e%100!=11?"one":"other"},7:function(e){return 2==e?"two":1==e?"one":"other"},8:function(e){return i(e,3,6)?"few":i(e,7,10)?"many":2==e?"two":1==e?"one":"other"},9:function(e){return 0===e||1!=e&&i(e%100,1,19)?"few":1==e?"one":"other"},10:function(e){return i(e%10,2,9)&&!i(e%100,11,19)?"few":e%10!=1||i(e%100,11,19)?"other":"one"},11:function(e){return i(e%10,2,4)&&!i(e%100,12,14)?"few":e%10==0||i(e%10,5,9)||i(e%100,11,14)?"many":e%10==1&&e%100!=11?"one":"other"},12:function(e){return i(e,2,4)?"few":1==e?"one":"other"},13:function(e){return i(e%10,2,4)&&!i(e%100,12,14)?"few":1!=e&&i(e%10,0,1)||i(e%10,5,9)||i(e%100,12,14)?"many":1==e?"one":"other"},14:function(e){return i(e%100,3,4)?"few":e%100==2?"two":e%100==1?"one":"other"},15:function(e){return 0===e||i(e%100,2,10)?"few":i(e%100,11,19)?"many":1==e?"one":"other"},16:function(e){return e%10==1&&11!=e?"one":"other"},17:function(e){return 3==e?"few":0===e?"zero":6==e?"many":2==e?"two":1==e?"one":"other"},18:function(e){return 0===e?"zero":i(e,0,2)&&0!==e&&2!=e?"one":"other"},19:function(e){return i(e,2,10)?"few":i(e,0,1)?"one":"other"},20:function(e){return!i(e%10,3,4)&&e%10!=9||i(e%100,10,19)||i(e%100,70,79)||i(e%100,90,99)?e%1e6==0&&0!==e?"many":e%10!=2||t(e%100,[12,72,92])?e%10!=1||t(e%100,[11,71,91])?"other":"one":"two":"few"},21:function(e){return 0===e?"zero":1==e?"one":"other"},22:function(e){return i(e,0,1)||i(e,11,99)?"one":"other"},23:function(e){return i(e%10,1,2)||e%20==0?"one":"other"},24:function(e){return i(e,3,10)||i(e,13,19)?"few":t(e,[2,12])?"two":t(e,[1,11])?"one":"other"}},s={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3}[e.replace(/-.*$/,"")];return s in n?n[s]:(console.warn("plural form unknown for ["+e+"]"),function(){return"other"})}(r));var h="["+a._pluralRules(l)+"]";return 0===l&&n+"[zero]"in i?e=i[n+"[zero]"][o]:1==l&&n+"[one]"in i?e=i[n+"[one]"][o]:2==l&&n+"[two]"in i?e=i[n+"[two]"][o]:n+h in i?e=i[n+h][o]:n+"[other]"in i&&(e=i[n+"[other]"][o]),e},{get:function(e,t,i){var n,r=e.lastIndexOf("."),a=s;r>0&&(a=e.substring(r+1),e=e.substring(0,r)),i&&((n={})[a]=i);var o=u(e,t,n);return o&&a in o?o[a]:"{{"+e+"}}"},getData:function(){return i},getText:function(){return n},getLanguage:function(){return r},setLanguage:function(e,t){d(e,(function(){t&&t()}))},getDirection:function(){var e=r.split("-",1)[0];return["ar","he","fa","ps","ur"].indexOf(e)>=0?"rtl":"ltr"},translate:function(e){for(var i=function(e){return e?e.querySelectorAll("*[data-l10n-id]"):[]}(e=e||t.documentElement),n=i.length,s=0;s<n;s++)f(i[s]);f(e)},getReadyState:function(){return o},ready:function(i){i&&("complete"==o||"interactive"==o?e.setTimeout((function(){i()})):t.addEventListener&&t.addEventListener("localized",(function e(){t.removeEventListener("localized",e),i()})))}}}(window,document)},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFHistory=void 0,t.isDestArraysEqual=o,t.isDestHashesEqual=a;var n=i(2),s=i(9);function r(){return document.location.hash}function a(e,t){return"string"==typeof e&&"string"==typeof t&&(e===t||(0,n.parseQueryString)(e).get("nameddest")===t)}function o(e,t){function i(e,t){if(typeof e!=typeof t)return!1;if(Array.isArray(e)||Array.isArray(t))return!1;if(null!==e&&"object"==typeof e&&null!==t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!i(e[n],t[n]))return!1;return!0}return e===t||Number.isNaN(e)&&Number.isNaN(t)}if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(let n=0,s=e.length;n<s;n++)if(!i(e[n],t[n]))return!1;return!0}t.PDFHistory=class{constructor({linkService:e,eventBus:t}){this.linkService=e,this.eventBus=t,this._initialized=!1,this._fingerprint="",this.reset(),this._boundEvents=null,this.eventBus._on("pagesinit",(()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",(e=>{this._isPagesLoaded=!!e.pagesCount}),{once:!0})}))}initialize({fingerprint:e,resetHistory:t=!1,updateUrl:i=!1}){if(!e||"string"!=typeof e)return void console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');this._initialized&&this.reset();const n=""!==this._fingerprint&&this._fingerprint!==e;this._fingerprint=e,this._updateUrl=!0===i,this._initialized=!0,this._bindEvents();const s=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=r(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this._isValidState(s,!0)||t){const{hash:e,page:i,rotation:s}=this._parseCurrentHash(!0);return!e||n||t?void this._pushOrReplaceState(null,!0):void this._pushOrReplaceState({hash:e,page:i,rotation:s},!0)}const a=s.destination;this._updateInternalState(a,s.uid,!0),void 0!==a.rotation&&(this._initialRotation=a.rotation),a.dest?(this._initialBookmark=JSON.stringify(a.dest),this._destination.page=null):a.hash?this._initialBookmark=a.hash:a.page&&(this._initialBookmark=`page=${a.page}`)}reset(){this._initialized&&(this._pageHide(),this._initialized=!1,this._unbindEvents()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:e=null,explicitDest:t,pageNumber:i}){if(!this._initialized)return;if(e&&"string"!=typeof e)return void console.error(`PDFHistory.push: "${e}" is not a valid namedDest parameter.`);if(!Array.isArray(t))return void console.error(`PDFHistory.push: "${t}" is not a valid explicitDest parameter.`);if(!this._isValidPage(i)&&(null!==i||this._destination))return void console.error(`PDFHistory.push: "${i}" is not a valid pageNumber parameter.`);const n=e||JSON.stringify(t);if(!n)return;let s=!1;if(this._destination&&(a(this._destination.hash,n)||o(this._destination.dest,t))){if(this._destination.page)return;s=!0}this._popStateInProgress&&!s||(this._pushOrReplaceState({dest:t,hash:n,page:i,rotation:this.linkService.rotation},s),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then((()=>{this._popStateInProgress=!1}))))}pushPage(e){this._initialized&&(this._isValidPage(e)?this._destination?.page!==e&&(this._popStateInProgress||(this._pushOrReplaceState({dest:null,hash:`page=${e}`,page:e,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then((()=>{this._popStateInProgress=!1}))))):console.error(`PDFHistory.pushPage: "${e}" is not a valid page number.`))}pushCurrentPosition(){this._initialized&&!this._popStateInProgress&&this._tryPushCurrentPosition()}back(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;this._isValidState(e)&&e.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;this._isValidState(e)&&e.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}_pushOrReplaceState(e,t=!1){const i=t||!this._destination,n={fingerprint:this._fingerprint,uid:i?this._uid:this._uid+1,destination:e};let s;if(this._updateInternalState(e,n.uid),this._updateUrl&&e?.hash){const t=document.location.href.split("#")[0];t.startsWith("file://")||(s=`${t}#${e.hash}`)}i?window.history.replaceState(n,"",s):window.history.pushState(n,"",s)}_tryPushCurrentPosition(e=!1){if(!this._position)return;let t=this._position;if(e&&(t=Object.assign(Object.create(null),this._position),t.temporary=!0),!this._destination)return void this._pushOrReplaceState(t);if(this._destination.temporary)return void this._pushOrReplaceState(t,!0);if(this._destination.hash===t.hash)return;if(!this._destination.page&&this._numPositionUpdates<=50)return;let i=!1;if(this._destination.page>=t.first&&this._destination.page<=t.page){if(void 0!==this._destination.dest||!this._destination.first)return;i=!0}this._pushOrReplaceState(t,i)}_isValidPage(e){return Number.isInteger(e)&&e>0&&e<=this.linkService.pagesCount}_isValidState(e,t=!1){if(!e)return!1;if(e.fingerprint!==this._fingerprint){if(!t)return!1;{if("string"!=typeof e.fingerprint||e.fingerprint.length!==this._fingerprint.length)return!1;const[t]=performance.getEntriesByType("navigation");if("reload"!==t?.type)return!1}}return!(!Number.isInteger(e.uid)||e.uid<0)&&null!==e.destination&&"object"==typeof e.destination}_updateInternalState(e,t,i=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),i&&e?.temporary&&delete e.temporary,this._destination=e,this._uid=t,this._maxUid=Math.max(this._maxUid,t),this._numPositionUpdates=0}_parseCurrentHash(e=!1){const t=unescape(r()).substring(1),i=(0,n.parseQueryString)(t),s=i.get("nameddest")||"";let a=0|i.get("page");return(!this._isValidPage(a)||e&&s.length>0)&&(a=null),{hash:t,page:a,rotation:this.linkService.rotation}}_updateViewarea({location:e}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:e.pdfOpenParams.substring(1),page:this.linkService.page,first:e.pageNumber,rotation:e.rotation},this._popStateInProgress||(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout((()=>{this._popStateInProgress||this._tryPushCurrentPosition(!0),this._updateViewareaTimeout=null}),1e3))}_popState({state:e}){const t=r(),i=this._currentHash!==t;if(this._currentHash=t,!e){this._uid++;const{hash:e,page:t,rotation:i}=this._parseCurrentHash();return void this._pushOrReplaceState({hash:e,page:t,rotation:i},!0)}if(!this._isValidState(e))return;this._popStateInProgress=!0,i&&(this._blockHashChange++,(0,s.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:1e3}).then((()=>{this._blockHashChange--})));const a=e.destination;this._updateInternalState(a,e.uid,!0),(0,n.isValidRotation)(a.rotation)&&(this.linkService.rotation=a.rotation),a.dest?this.linkService.goToDestination(a.dest):a.hash?this.linkService.setHash(a.hash):a.page&&(this.linkService.page=a.page),Promise.resolve().then((()=>{this._popStateInProgress=!1}))}_pageHide(){this._destination&&!this._destination.temporary||this._tryPushCurrentPosition()}_bindEvents(){this._boundEvents||(this._boundEvents={updateViewarea:this._updateViewarea.bind(this),popState:this._popState.bind(this),pageHide:this._pageHide.bind(this)},this.eventBus._on("updateviewarea",this._boundEvents.updateViewarea),window.addEventListener("popstate",this._boundEvents.popState),window.addEventListener("pagehide",this._boundEvents.pageHide))}_unbindEvents(){this._boundEvents&&(this.eventBus._off("updateviewarea",this._boundEvents.updateViewarea),window.removeEventListener("popstate",this._boundEvents.popState),window.removeEventListener("pagehide",this._boundEvents.pageHide),this._boundEvents=null)}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFPageView=void 0;var n=i(4),s=i(2),r=i(14),a=i(6),o=i(15),l=i(7),h=i(5),c=i(16),d=i(17),u=i(18),p=i(19),g=i(20);const f=o.compatibilityParams.maxCanvasPixels||16777216,m=()=>({annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new h.SimpleLinkService}});t.PDFPageView=class{#cs=n.AnnotationMode.ENABLE_FORMS;#ds=!1;#us=null;#ps=null;#gs=null;#fs=null;#ms=s.RenderingStates.INITIAL;#_s=s.TextLayerMode.ENABLE;#vs={directDrawing:!0,initialOptionalContent:!0,regularAnnotations:!0};#bs=new WeakMap;constructor(e){const t=e.container,i=e.defaultViewport;this.id=e.id,this.renderingId="page"+this.id,this.#us=e.layerProperties||m,this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=e.scale||s.DEFAULT_SCALE,this.viewport=i,this.pdfPageRotate=i.rotation,this._optionalContentConfigPromise=e.optionalContentConfigPromise||null,this.#_s=e.textLayerMode??s.TextLayerMode.ENABLE,this.#cs=e.annotationMode??n.AnnotationMode.ENABLE_FORMS,this.imageResourcesPath=e.imageResourcesPath||"",this.isOffscreenCanvasSupported=e.isOffscreenCanvasSupported??!0,this.maxCanvasPixels=e.maxCanvasPixels??f,this.pageColors=e.pageColors||null,this.eventBus=e.eventBus,this.renderingQueue=e.renderingQueue,this.l10n=e.l10n||l.NullL10n,this.renderTask=null,this.resume=null,this._isStandalone=!this.renderingQueue?.hasViewer(),this._container=t,e.useOnlyCssZoom&&(console.error("useOnlyCssZoom was removed, please use `maxCanvasPixels = 0` instead."),this.maxCanvasPixels=0),this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.zoomLayer=null,this.xfaLayer=null,this.structTreeLayer=null;const r=document.createElement("div");if(r.className="page",r.setAttribute("data-page-number",this.id),r.setAttribute("role","region"),this.l10n.get("page_landmark",{page:this.id}).then((e=>{r.setAttribute("aria-label",e)})),this.div=r,this.#Tn(),t?.append(r),this._isStandalone){t?.style.setProperty("--scale-factor",this.scale*n.PixelsPerInch.PDF_TO_CSS_UNITS);const{optionalContentConfigPromise:i}=e;i&&i.then((e=>{i===this._optionalContentConfigPromise&&(this.#vs.initialOptionalContent=e.hasInitialVisibility)}))}}get renderingState(){return this.#ms}set renderingState(e){if(e!==this.#ms)switch(this.#ms=e,this.#ps&&(clearTimeout(this.#ps),this.#ps=null),e){case s.RenderingStates.PAUSED:this.div.classList.remove("loading");break;case s.RenderingStates.RUNNING:this.div.classList.add("loadingIcon"),this.#ps=setTimeout((()=>{this.div.classList.add("loading"),this.#ps=null}),0);break;case s.RenderingStates.INITIAL:case s.RenderingStates.FINISHED:this.div.classList.remove("loadingIcon","loading")}}#Tn(){const{viewport:e}=this;if(this.pdfPage){if(this.#gs===e.rotation)return;this.#gs=e.rotation}(0,n.setLayerDimensions)(this.div,e,!0,!1)}setPdfPage(e){!this._isStandalone||"CanvasText"!==this.pageColors?.foreground&&"Canvas"!==this.pageColors?.background||this._container?.style.setProperty("--hcm-highligh-filter",e.filterFactory.addHighlightHCMFilter("CanvasText","Canvas","HighlightText","Highlight")),this.pdfPage=e,this.pdfPageRotate=e.rotate;const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:this.scale*n.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:t}),this.#Tn(),this.reset()}destroy(){this.reset(),this.pdfPage?.cleanup()}get _textHighlighter(){return(0,n.shadow)(this,"_textHighlighter",new u.TextHighlighter({pageIndex:this.id-1,eventBus:this.eventBus,findController:this.#us().findController}))}async#ys(){let e=null;try{await this.annotationLayer.render(this.viewport,"display")}catch(t){console.error(`#renderAnnotationLayer: "${t}".`),e=t}finally{this.eventBus.dispatch("annotationlayerrendered",{source:this,pageNumber:this.id,error:e})}}async#Ss(){let e=null;try{await this.annotationEditorLayer.render(this.viewport,"display")}catch(t){console.error(`#renderAnnotationEditorLayer: "${t}".`),e=t}finally{this.eventBus.dispatch("annotationeditorlayerrendered",{source:this,pageNumber:this.id,error:e})}}async#Ps(){let e=null;try{const e=await this.xfaLayer.render(this.viewport,"display");e?.textDivs&&this._textHighlighter&&this.#As(e.textDivs)}catch(t){console.error(`#renderXfaLayer: "${t}".`),e=t}finally{this.eventBus.dispatch("xfalayerrendered",{source:this,pageNumber:this.id,error:e})}}async#ws(){const{pdfPage:e,textLayer:t,viewport:i}=this;if(!t)return;let s=null;try{if(!t.renderingDone){const i=e.streamTextContent({includeMarkedContent:!0,disableNormalization:!0});t.setTextContentSource(i)}await t.render(i)}catch(e){if(e instanceof n.AbortException)return;console.error(`#renderTextLayer: "${e}".`),s=e}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.id,numTextDivs:t.numTextDivs,error:s}),this.#Es()}async#Es(){if(!this.textLayer)return;this.structTreeLayer||=new c.StructTreeLayerBuilder;const e=await(this.structTreeLayer.renderingDone?null:this.pdfPage.getStructTree()),t=this.structTreeLayer?.render(e);t&&this.canvas?.append(t),this.structTreeLayer?.show()}async#As(e){const t=await this.pdfPage.getTextContent(),i=[];for(const e of t.items)i.push(e.str);this._textHighlighter.setTextMapping(e,i),this._textHighlighter.enable()}_resetZoomLayer(e=!1){if(!this.zoomLayer)return;const t=this.zoomLayer.firstChild;this.#bs.delete(t),t.width=0,t.height=0,e&&this.zoomLayer.remove(),this.zoomLayer=null}reset({keepZoomLayer:e=!1,keepAnnotationLayer:t=!1,keepAnnotationEditorLayer:i=!1,keepXfaLayer:n=!1,keepTextLayer:r=!1}={}){this.cancelRendering({keepAnnotationLayer:t,keepAnnotationEditorLayer:i,keepXfaLayer:n,keepTextLayer:r}),this.renderingState=s.RenderingStates.INITIAL;const a=this.div,o=a.childNodes,l=e&&this.zoomLayer||null,h=t&&this.annotationLayer?.div||null,c=i&&this.annotationEditorLayer?.div||null,d=n&&this.xfaLayer?.div||null,u=r&&this.textLayer?.div||null;for(let e=o.length-1;e>=0;e--){const t=o[e];switch(t){case l:case h:case c:case d:case u:continue}t.remove()}a.removeAttribute("data-loaded"),h&&this.annotationLayer.hide(),c&&this.annotationEditorLayer.hide(),d&&this.xfaLayer.hide(),u&&this.textLayer.hide(),this.structTreeLayer?.hide(),l||(this.canvas&&(this.#bs.delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer())}update({scale:e=0,rotation:t=null,optionalContentConfigPromise:i=null,drawingDelay:r=-1}){this.scale=e||this.scale,"number"==typeof t&&(this.rotation=t),i instanceof Promise&&(this._optionalContentConfigPromise=i,i.then((e=>{i===this._optionalContentConfigPromise&&(this.#vs.initialOptionalContent=e.hasInitialVisibility)}))),this.#vs.directDrawing=!0;const a=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*n.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:a}),this.#Tn(),this._isStandalone&&this._container?.style.setProperty("--scale-factor",this.viewport.scale),this.canvas){let e=!1;if(this.#ds)if(0===this.maxCanvasPixels)e=!0;else if(this.maxCanvasPixels>0){const{width:t,height:i}=this.viewport,{sx:n,sy:s}=this.outputScale;e=(Math.floor(t)*n|0)*(Math.floor(i)*s|0)>this.maxCanvasPixels}const t=!e&&r>=0&&r<1e3;if(t||e){if(t&&this.renderingState!==s.RenderingStates.FINISHED&&(this.cancelRendering({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:r}),this.renderingState=s.RenderingStates.FINISHED,this.#vs.directDrawing=!1),this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!t,hideTextLayer:t}),t)return;return void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this.#fs})}this.zoomLayer||this.canvas.hidden||(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform({target:this.zoomLayer.firstChild}),this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0})}cancelRendering({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:t=!1,keepXfaLayer:i=!1,keepTextLayer:n=!1,cancelExtraDelay:s=0}={}){this.renderTask&&(this.renderTask.cancel(s),this.renderTask=null),this.resume=null,!this.textLayer||n&&this.textLayer.div||(this.textLayer.cancel(),this.textLayer=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),!this.annotationLayer||e&&this.annotationLayer.div||(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),!this.annotationEditorLayer||t&&this.annotationEditorLayer.div||(this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),!this.xfaLayer||i&&this.xfaLayer.div||(this.xfaLayer.cancel(),this.xfaLayer=null,this._textHighlighter?.disable())}cssTransform({target:e,redrawAnnotationLayer:t=!1,redrawAnnotationEditorLayer:i=!1,redrawXfaLayer:n=!1,redrawTextLayer:s=!1,hideTextLayer:r=!1}){if(!e.hasAttribute("zooming")){e.setAttribute("zooming",!0);const{style:t}=e;t.width=t.height=""}const a=this.#bs.get(e);if(this.viewport!==a){const t=this.viewport.rotation-a.rotation,i=Math.abs(t);let n=1,s=1;if(90===i||270===i){const{width:e,height:t}=this.viewport;n=t/e,s=e/t}e.style.transform=`rotate(${t}deg) scale(${n}, ${s})`}t&&this.annotationLayer&&this.#ys(),i&&this.annotationEditorLayer&&this.#Ss(),n&&this.xfaLayer&&this.#Ps(),this.textLayer&&(r?(this.textLayer.hide(),this.structTreeLayer?.hide()):s&&this.#ws())}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,t){return this.viewport.convertToPdfPoint(e,t)}async#xs(e,t=null){if(e===this.renderTask&&(this.renderTask=null),t instanceof n.RenderingCancelledException)this.#fs=null;else if(this.#fs=t,this.renderingState=s.RenderingStates.FINISHED,this._resetZoomLayer(!0),this.#vs.regularAnnotations=!e.separateAnnots,this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!1,timestamp:performance.now(),error:this.#fs}),t)throw t}async draw(){this.renderingState!==s.RenderingStates.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:e,l10n:t,pageColors:i,pdfPage:o,viewport:l}=this;if(!o)throw this.renderingState=s.RenderingStates.FINISHED,new Error("pdfPage is not loaded");this.renderingState=s.RenderingStates.RUNNING;const h=document.createElement("div");if(h.classList.add("canvasWrapper"),e.append(h),this.textLayer||this.#_s===s.TextLayerMode.DISABLE||o.isPureXfa||(this._accessibilityManager||=new d.TextAccessibilityManager,this.textLayer=new p.TextLayerBuilder({highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,enablePermissions:this.#_s===s.TextLayerMode.ENABLE_PERMISSIONS}),e.append(this.textLayer.div)),!this.annotationLayer&&this.#cs!==n.AnnotationMode.DISABLE){const{annotationStorage:i,downloadManager:s,enableScripting:r,fieldObjectsPromise:l,hasJSActionsPromise:h,linkService:c}=this.#us();this._annotationCanvasMap||=new Map,this.annotationLayer=new a.AnnotationLayerBuilder({pageDiv:e,pdfPage:o,annotationStorage:i,imageResourcesPath:this.imageResourcesPath,renderForms:this.#cs===n.AnnotationMode.ENABLE_FORMS,linkService:c,downloadManager:s,l10n:t,enableScripting:r,hasJSActionsPromise:h,fieldObjectsPromise:l,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager})}const{width:c,height:u}=l,f=document.createElement("canvas");f.setAttribute("role","presentation"),f.hidden=!0;const m=!(!i?.background||!i?.foreground);let _=e=>{m&&!e||(f.hidden=!1,_=null)};h.append(f),this.canvas=f;const v=f.getContext("2d",{alpha:!1}),b=this.outputScale=new s.OutputScale;if(0===this.maxCanvasPixels){const e=1/this.scale;b.sx*=e,b.sy*=e,this.#ds=!0}else if(this.maxCanvasPixels>0){const e=c*u,t=Math.sqrt(this.maxCanvasPixels/e);b.sx>t||b.sy>t?(b.sx=t,b.sy=t,this.#ds=!0):this.#ds=!1}const y=(0,s.approximateFraction)(b.sx),S=(0,s.approximateFraction)(b.sy);f.width=(0,s.roundToDivide)(c*b.sx,y[0]),f.height=(0,s.roundToDivide)(u*b.sy,S[0]);const{style:P}=f;P.width=(0,s.roundToDivide)(c,y[1])+"px",P.height=(0,s.roundToDivide)(u,S[1])+"px",this.#bs.set(f,l);const A={canvasContext:v,transform:b.scaled?[b.sx,0,0,b.sy,0,0]:null,viewport:l,annotationMode:this.#cs,optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:i},w=this.renderTask=this.pdfPage.render(A);w.onContinue=e=>{if(_?.(!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this))return this.renderingState=s.RenderingStates.PAUSED,void(this.resume=()=>{this.renderingState=s.RenderingStates.RUNNING,e()});e()};const E=w.promise.then((async()=>{if(_?.(!0),await this.#xs(w),this.#ws(),this.annotationLayer&&await this.#ys(),!this.annotationEditorLayer){const{annotationEditorUIManager:i}=this.#us();if(!i)return;this.annotationEditorLayer=new r.AnnotationEditorLayerBuilder({uiManager:i,pageDiv:e,pdfPage:o,l10n:t,accessibilityManager:this._accessibilityManager,annotationLayer:this.annotationLayer?.annotationLayer})}this.#Ss()}),(e=>(e instanceof n.RenderingCancelledException||_?.(!0),this.#xs(w,e))));if(o.isPureXfa){if(this.xfaLayer)this.xfaLayer.div&&e.append(this.xfaLayer.div);else{const{annotationStorage:t,linkService:i}=this.#us();this.xfaLayer=new g.XfaLayerBuilder({pageDiv:e,pdfPage:o,annotationStorage:t,linkService:i})}this.#Ps()}return e.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),E}setPageLabel(e){this.pageLabel="string"==typeof e?e:null,null!==this.pageLabel?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){const{directDrawing:e,initialOptionalContent:t,regularAnnotations:i}=this.#vs;return e&&t&&i?this.canvas:null}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditorLayerBuilder=void 0;var n=i(4),s=i(7);t.AnnotationEditorLayerBuilder=class{#wt=null;#Ft;constructor(e){this.pageDiv=e.pageDiv,this.pdfPage=e.pdfPage,this.accessibilityManager=e.accessibilityManager,this.l10n=e.l10n||s.NullL10n,this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,this.#Ft=e.uiManager,this.#wt=e.annotationLayer||null}async render(e,t="display"){if("display"!==t)return;if(this._cancelled)return;const i=e.clone({dontFlip:!0});if(this.div)return this.annotationEditorLayer.update({viewport:i}),void this.show();const s=this.div=document.createElement("div");s.className="annotationEditorLayer",s.tabIndex=0,s.hidden=!0,s.dir=this.#Ft.direction,this.pageDiv.append(s),this.annotationEditorLayer=new n.AnnotationEditorLayer({uiManager:this.#Ft,div:s,accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:i,annotationLayer:this.#wt});const r={viewport:i,div:s,annotations:null,intent:t};this.annotationEditorLayer.render(r),this.show()}cancel(){this._cancelled=!0,this.div&&(this.pageDiv=null,this.annotationEditorLayer.destroy(),this.div.remove())}hide(){this.div&&(this.div.hidden=!0)}show(){this.div&&!this.annotationEditorLayer.isEmpty&&(this.div.hidden=!1)}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.compatibilityParams=t.OptionKind=t.AppOptions=void 0;const i=Object.create(null);t.compatibilityParams=i;{const e=navigator.userAgent||"",t=navigator.platform||"",n=navigator.maxTouchPoints||1,s=/Android/.test(e);(/\b(iPad|iPhone|iPod)(?=;)/.test(e)||"MacIntel"===t&&n>1||s)&&(i.maxCanvasPixels=5242880)}const n={VIEWER:2,API:4,WORKER:8,PREFERENCE:128};t.OptionKind=n;const s={annotationEditorMode:{value:0,kind:n.VIEWER+n.PREFERENCE},annotationMode:{value:2,kind:n.VIEWER+n.PREFERENCE},cursorToolOnLoad:{value:0,kind:n.VIEWER+n.PREFERENCE},defaultZoomDelay:{value:400,kind:n.VIEWER+n.PREFERENCE},defaultZoomValue:{value:"",kind:n.VIEWER+n.PREFERENCE},disableHistory:{value:!1,kind:n.VIEWER},disablePageLabels:{value:!1,kind:n.VIEWER+n.PREFERENCE},enablePermissions:{value:!1,kind:n.VIEWER+n.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:n.VIEWER+n.PREFERENCE},enableScripting:{value:!0,kind:n.VIEWER+n.PREFERENCE},enableStampEditor:{value:!0,kind:n.VIEWER+n.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:n.VIEWER},externalLinkTarget:{value:0,kind:n.VIEWER+n.PREFERENCE},historyUpdateUrl:{value:!1,kind:n.VIEWER+n.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:n.VIEWER+n.PREFERENCE},imageResourcesPath:{value:"./images/",kind:n.VIEWER},maxCanvasPixels:{value:16777216,kind:n.VIEWER},forcePageColors:{value:!1,kind:n.VIEWER+n.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:n.VIEWER+n.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:n.VIEWER+n.PREFERENCE},pdfBugEnabled:{value:!1,kind:n.VIEWER+n.PREFERENCE},printResolution:{value:150,kind:n.VIEWER},sidebarViewOnLoad:{value:-1,kind:n.VIEWER+n.PREFERENCE},scrollModeOnLoad:{value:-1,kind:n.VIEWER+n.PREFERENCE},spreadModeOnLoad:{value:-1,kind:n.VIEWER+n.PREFERENCE},textLayerMode:{value:1,kind:n.VIEWER+n.PREFERENCE},viewerCssTheme:{value:0,kind:n.VIEWER+n.PREFERENCE},viewOnLoad:{value:0,kind:n.VIEWER+n.PREFERENCE},cMapPacked:{value:!0,kind:n.API},cMapUrl:{value:"../web/cmaps/",kind:n.API},disableAutoFetch:{value:!1,kind:n.API+n.PREFERENCE},disableFontFace:{value:!1,kind:n.API+n.PREFERENCE},disableRange:{value:!1,kind:n.API+n.PREFERENCE},disableStream:{value:!1,kind:n.API+n.PREFERENCE},docBaseUrl:{value:"",kind:n.API},enableXfa:{value:!0,kind:n.API+n.PREFERENCE},fontExtraProperties:{value:!1,kind:n.API},isEvalSupported:{value:!0,kind:n.API},isOffscreenCanvasSupported:{value:!0,kind:n.API},maxImageSize:{value:-1,kind:n.API},pdfBug:{value:!1,kind:n.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:n.API},verbosity:{value:1,kind:n.API},workerPort:{value:null,kind:n.WORKER},workerSrc:{value:"../build/pdf.worker.js",kind:n.WORKER}};s.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:n.VIEWER},s.disablePreferences={value:!1,kind:n.VIEWER},s.locale={value:navigator.language||"en-US",kind:n.VIEWER},s.sandboxBundleSrc={value:"../build/pdf.sandbox.js",kind:n.VIEWER};const r=Object.create(null);class a{constructor(){throw new Error("Cannot initialize AppOptions.")}static get(e){const t=r[e];if(void 0!==t)return t;const n=s[e];return void 0!==n?i[e]??n.value:void 0}static getAll(e=null){const t=Object.create(null);for(const a in s){const o=s[a];if(e){if(0==(e&o.kind))continue;if(e===n.PREFERENCE){const e=o.value,i=typeof e;if("boolean"===i||"string"===i||"number"===i&&Number.isInteger(e)){t[a]=e;continue}throw new Error(`Invalid type for preference: ${a}`)}}const l=r[a];t[a]=void 0!==l?l:i[a]??o.value}return t}static set(e,t){r[e]=t}static setAll(e){for(const t in e)r[t]=e[t]}static remove(e){delete r[e]}}t.AppOptions=a,a._hasUserOptions=function(){return Object.keys(r).length>0}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StructTreeLayerBuilder=void 0;var n=i(2);const s={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},r=/^H(\d+)$/;t.StructTreeLayerBuilder=class{#Cs=void 0;get renderingDone(){return void 0!==this.#Cs}render(e){if(void 0!==this.#Cs)return this.#Cs;const t=this.#Ms(e);return t?.classList.add("structTree"),this.#Cs=t}hide(){this.#Cs&&!this.#Cs.hidden&&(this.#Cs.hidden=!0)}show(){this.#Cs?.hidden&&(this.#Cs.hidden=!1)}#Ts(e,t){const{alt:i,id:s,lang:r}=e;void 0!==i&&t.setAttribute("aria-label",(0,n.removeNullCharacters)(i)),void 0!==s&&t.setAttribute("aria-owns",s),void 0!==r&&t.setAttribute("lang",(0,n.removeNullCharacters)(r,!0))}#Ms(e){if(!e)return null;const t=document.createElement("span");if("role"in e){const{role:i}=e,n=i.match(r);n?(t.setAttribute("role","heading"),t.setAttribute("aria-level",n[1])):s[i]&&t.setAttribute("role",s[i])}if(this.#Ts(e,t),e.children)if(1===e.children.length&&"id"in e.children[0])this.#Ts(e.children[0],t);else for(const i of e.children)t.append(this.#Ms(i));return t}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextAccessibilityManager=void 0;var n=i(2);class s{#Ds=!1;#Fs=null;#Ls=new Map;#ks=new Map;setTextMapping(e){this.#Fs=e}static#Rs(e,t){const i=e.getBoundingClientRect(),n=t.getBoundingClientRect();if(0===i.width&&0===i.height)return 1;if(0===n.width&&0===n.height)return-1;const s=i.y,r=i.y+i.height,a=i.y+i.height/2,o=n.y,l=n.y+n.height,h=n.y+n.height/2;return a<=o&&h>=r?-1:h<=s&&a>=l?1:i.x+i.width/2-(n.x+n.width/2)}enable(){if(this.#Ds)throw new Error("TextAccessibilityManager is already enabled.");if(!this.#Fs)throw new Error("Text divs and strings have not been set.");if(this.#Ds=!0,this.#Fs=this.#Fs.slice(),this.#Fs.sort(s.#Rs),this.#Ls.size>0){const e=this.#Fs;for(const[t,i]of this.#Ls)document.getElementById(t)?this.#Is(t,e[i]):this.#Ls.delete(t)}for(const[e,t]of this.#ks)this.addPointerInTextLayer(e,t);this.#ks.clear()}disable(){this.#Ds&&(this.#ks.clear(),this.#Fs=null,this.#Ds=!1)}removePointerInTextLayer(e){if(!this.#Ds)return void this.#ks.delete(e);const t=this.#Fs;if(!t||0===t.length)return;const{id:i}=e,n=this.#Ls.get(i);if(void 0===n)return;const s=t[n];this.#Ls.delete(i);let r=s.getAttribute("aria-owns");r?.includes(i)&&(r=r.split(" ").filter((e=>e!==i)).join(" "),r?s.setAttribute("aria-owns",r):(s.removeAttribute("aria-owns"),s.setAttribute("role","presentation")))}#Is(e,t){const i=t.getAttribute("aria-owns");i?.includes(e)||t.setAttribute("aria-owns",i?`${i} ${e}`:e),t.removeAttribute("role")}addPointerInTextLayer(e,t){const{id:i}=e;if(!i)return null;if(!this.#Ds)return this.#ks.set(e,t),null;t&&this.removePointerInTextLayer(e);const r=this.#Fs;if(!r||0===r.length)return null;const a=(0,n.binarySearchFirstItem)(r,(t=>s.#Rs(e,t)<0)),o=Math.max(0,a-1),l=r[o];this.#Is(i,l),this.#Ls.set(i,o);const h=l.parentNode;return h?.classList.contains("markedContent")?h.id:null}moveElementInDOM(e,t,i,r){const a=this.addPointerInTextLayer(i,r);if(!e.hasChildNodes())return e.append(t),a;const o=Array.from(e.childNodes).filter((e=>e!==t));if(0===o.length)return a;const l=i||t,h=(0,n.binarySearchFirstItem)(o,(e=>s.#Rs(l,e)<0));return 0===h?o[0].before(t):o[h-1].after(t),a}}t.TextAccessibilityManager=s},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextHighlighter=void 0,t.TextHighlighter=class{constructor({findController:e,eventBus:t,pageIndex:i}){this.findController=e,this.matches=[],this.eventBus=t,this.pageIdx=i,this._onUpdateTextLayerMatches=null,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(e,t){this.textDivs=e,this.textContentItemsStr=t}enable(){if(!this.textDivs||!this.textContentItemsStr)throw new Error("Text divs and strings have not been set.");if(this.enabled)throw new Error("TextHighlighter is already enabled.");this.enabled=!0,this._onUpdateTextLayerMatches||(this._onUpdateTextLayerMatches=e=>{e.pageIndex!==this.pageIdx&&-1!==e.pageIndex||this._updateMatches()},this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches)),this._updateMatches()}disable(){this.enabled&&(this.enabled=!1,this._onUpdateTextLayerMatches&&(this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches),this._onUpdateTextLayerMatches=null),this._updateMatches(!0))}_convertMatches(e,t){if(!e)return[];const{textContentItemsStr:i}=this;let n=0,s=0;const r=i.length-1,a=[];for(let o=0,l=e.length;o<l;o++){let l=e[o];for(;n!==r&&l>=s+i[n].length;)s+=i[n].length,n++;n===i.length&&console.error("Could not find a matching mapping");const h={begin:{divIdx:n,offset:l-s}};for(l+=t[o];n!==r&&l>s+i[n].length;)s+=i[n].length,n++;h.end={divIdx:n,offset:l-s},a.push(h)}return a}_renderMatches(e){if(0===e.length)return;const{findController:t,pageIdx:i}=this,{textContentItemsStr:n,textDivs:s}=this,r=i===t.selected.pageIdx,a=t.selected.matchIdx;let o=null;const l={divIdx:-1,offset:void 0};function h(e,t){const i=e.divIdx;return s[i].textContent="",c(i,0,e.offset,t)}function c(e,t,i,r){let a=s[e];if(a.nodeType===Node.TEXT_NODE){const t=document.createElement("span");a.before(t),t.append(a),s[e]=t,a=t}const o=n[e].substring(t,i),l=document.createTextNode(o);if(r){const e=document.createElement("span");return e.className=`${r} appended`,e.append(l),a.append(e),r.includes("selected")?e.offsetLeft:0}return a.append(l),0}let d=a,u=d+1;if(t.state.highlightAll)d=0,u=e.length;else if(!r)return;let p=-1,g=-1;for(let n=d;n<u;n++){const d=e[n],u=d.begin;if(u.divIdx===p&&u.offset===g)continue;p=u.divIdx,g=u.offset;const f=d.end,m=r&&n===a,_=m?" selected":"";let v=0;if(o&&u.divIdx===o.divIdx?c(o.divIdx,o.offset,u.offset):(null!==o&&c(o.divIdx,o.offset,l.offset),h(u)),u.divIdx===f.divIdx)v=c(u.divIdx,u.offset,f.offset,"highlight"+_);else{v=c(u.divIdx,u.offset,l.offset,"highlight begin"+_);for(let e=u.divIdx+1,t=f.divIdx;e<t;e++)s[e].className="highlight middle"+_;h(f,"highlight end"+_)}o=f,m&&t.scrollMatchIntoView({element:s[u.divIdx],selectedLeft:v,pageIndex:i,matchIndex:a})}o&&c(o.divIdx,o.offset,l.offset)}_updateMatches(e=!1){if(!this.enabled&&!e)return;const{findController:t,matches:i,pageIdx:n}=this,{textContentItemsStr:s,textDivs:r}=this;let a=-1;for(const e of i){for(let t=Math.max(a,e.begin.divIdx),i=e.end.divIdx;t<=i;t++){const e=r[t];e.textContent=s[t],e.className=""}a=e.end.divIdx+1}if(!t?.highlightMatches||e)return;const o=t.pageMatches[n]||null,l=t.pageMatchesLength[n]||null;this.matches=this._convertMatches(o,l),this._renderMatches(this.matches)}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayerBuilder=void 0;var n=i(4),s=i(2);t.TextLayerBuilder=class{#Os=!1;#Ns=0;#Bs=0;#Vs=null;constructor({highlighter:e=null,accessibilityManager:t=null,isOffscreenCanvasSupported:i=!0,enablePermissions:n=!1}){this.textContentItemsStr=[],this.renderingDone=!1,this.textDivs=[],this.textDivProperties=new WeakMap,this.textLayerRenderTask=null,this.highlighter=e,this.accessibilityManager=t,this.isOffscreenCanvasSupported=i,this.#Os=!0===n,this.div=document.createElement("div"),this.div.className="textLayer",this.hide()}#Us(){this.renderingDone=!0;const e=document.createElement("div");e.className="endOfContent",this.div.append(e),this.#js()}get numTextDivs(){return this.textDivs.length}async render(e){if(!this.#Vs)throw new Error('No "textContentSource" parameter specified.');const t=e.scale*(globalThis.devicePixelRatio||1),{rotation:i}=e;if(this.renderingDone){const s=i!==this.#Ns,r=t!==this.#Bs;return(s||r)&&(this.hide(),(0,n.updateTextLayer)({container:this.div,viewport:e,textDivs:this.textDivs,textDivProperties:this.textDivProperties,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,mustRescale:r,mustRotate:s}),this.#Bs=t,this.#Ns=i),void this.show()}this.cancel(),this.highlighter?.setTextMapping(this.textDivs,this.textContentItemsStr),this.accessibilityManager?.setTextMapping(this.textDivs),this.textLayerRenderTask=(0,n.renderTextLayer)({textContentSource:this.#Vs,container:this.div,viewport:e,textDivs:this.textDivs,textDivProperties:this.textDivProperties,textContentItemsStr:this.textContentItemsStr,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported}),await this.textLayerRenderTask.promise,this.#Us(),this.#Bs=t,this.#Ns=i,this.show(),this.accessibilityManager?.enable()}hide(){this.div.hidden||(this.highlighter?.disable(),this.div.hidden=!0)}show(){this.div.hidden&&this.renderingDone&&(this.div.hidden=!1,this.highlighter?.enable())}cancel(){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this.highlighter?.disable(),this.accessibilityManager?.disable(),this.textContentItemsStr.length=0,this.textDivs.length=0,this.textDivProperties=new WeakMap}setTextContentSource(e){this.cancel(),this.#Vs=e}#js(){const{div:e}=this;e.addEventListener("mousedown",(t=>{const i=e.querySelector(".endOfContent");if(!i)return;let n=t.target!==e;if(n&&="none"!==getComputedStyle(i).getPropertyValue("-moz-user-select"),n){const n=e.getBoundingClientRect(),s=Math.max(0,(t.pageY-n.top)/n.height);i.style.top=(100*s).toFixed(2)+"%"}i.classList.add("active")})),e.addEventListener("mouseup",(()=>{const t=e.querySelector(".endOfContent");t&&(t.style.top="",t.classList.remove("active"))})),e.addEventListener("copy",(e=>{if(!this.#Os){const t=document.getSelection();e.clipboardData.setData("text/plain",(0,s.removeNullCharacters)((0,n.normalizeUnicode)(t.toString())))}e.preventDefault(),e.stopPropagation()}))}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayerBuilder=void 0;var n=i(4);t.XfaLayerBuilder=class{constructor({pageDiv:e,pdfPage:t,annotationStorage:i=null,linkService:n,xfaHtml:s=null}){this.pageDiv=e,this.pdfPage=t,this.annotationStorage=i,this.linkService=n,this.xfaHtml=s,this.div=null,this._cancelled=!1}async render(e,t="display"){if("print"===t){const i={viewport:e.clone({dontFlip:!0}),div:this.div,xfaHtml:this.xfaHtml,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:t},s=document.createElement("div");return this.pageDiv.append(s),i.div=s,n.XfaLayer.render(i)}const i=await this.pdfPage.getXfa();if(this._cancelled||!i)return{textDivs:[]};const s={viewport:e.clone({dontFlip:!0}),div:this.div,xfaHtml:i,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:t};return this.div?n.XfaLayer.update(s):(this.div=document.createElement("div"),this.pageDiv.append(this.div),s.div=this.div,n.XfaLayer.render(s))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFScriptingManager=void 0;var n=i(22),s=i(23);class r extends s.PDFScriptingManager{constructor(e){e.externalServices||window.addEventListener("updatefromsandbox",(t=>{e.eventBus.dispatch("updatefromsandbox",{source:window,detail:t.detail})})),e.externalServices||={createScripting:({sandboxBundleSrc:e})=>new n.GenericScripting(e)},e.docProperties||=e=>(0,n.docProperties)(e),super(e)}}t.PDFScriptingManager=r},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GenericScripting=void 0,t.docProperties=async function(e){const t="".split("#")[0];let{info:i,metadata:s,contentDispositionFilename:r,contentLength:a}=await e.getMetadata();if(!a){const{length:t}=await e.getDownloadInfo();a=t}return{...i,baseURL:t,filesize:a,filename:r||(0,n.getPdfFilenameFromUrl)(""),metadata:s?.getRaw(),authors:s?.get("dc:creator"),numPages:e.numPages,URL:""}};var n=i(4);t.GenericScripting=class{constructor(e){this._ready=(0,n.loadScript)(e,!0).then((()=>window.pdfjsSandbox.QuickJSSandbox()))}async createSandbox(e){(await this._ready).create(e)}async dispatchEventInSandbox(e){const t=await this._ready;setTimeout((()=>t.dispatchEvent(e)),0)}async destroySandbox(){(await this._ready).nukeSandbox()}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFScriptingManager=void 0;var n=i(2),s=i(4);t.PDFScriptingManager=class{#Hs=null;#Ws=null;#zs=null;#Gs=null;#$s=null;#qs=null;#Xs=null;#Ks=!1;#Ys=null;#Qs=null;#Js=null;constructor({eventBus:e,sandboxBundleSrc:t=null,externalServices:i=null,docProperties:n=null}){this.#Gs=e,this.#Ys=t,this.#$s=i,this.#zs=n}setViewer(e){this.#Xs=e}async setDocument(e){if(this.#qs&&await this.#Zs(),this.#qs=e,!e)return;const[t,i,n]=await Promise.all([e.getFieldObjects(),e.getCalculationOrderIds(),e.getJSActions()]);if(t||n){if(e===this.#qs){try{this.#Qs=this.#er()}catch(e){return console.error(`setDocument: "${e.message}".`),void await this.#Zs()}this._internalEvents.set("updatefromsandbox",(e=>{e?.source===window&&this.#tr(e.detail)})),this._internalEvents.set("dispatcheventinsandbox",(e=>{this.#Qs?.dispatchEventInSandbox(e.detail)})),this._internalEvents.set("pagechanging",(({pageNumber:e,previous:t})=>{e!==t&&(this.#ir(t),this.#nr(e))})),this._internalEvents.set("pagerendered",(({pageNumber:e})=>{this._pageOpenPending.has(e)&&e===this.#Xs.currentPageNumber&&this.#nr(e)})),this._internalEvents.set("pagesdestroy",(async()=>{await this.#ir(this.#Xs.currentPageNumber),await(this.#Qs?.dispatchEventInSandbox({id:"doc",name:"WillClose"})),this.#Hs?.resolve()}));for(const[e,t]of this._internalEvents)this.#Gs._on(e,t);try{const s=await this.#zs(e);if(e!==this.#qs)return;await this.#Qs.createSandbox({objects:t,calculationOrder:i,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...s,actions:n}}),this.#Gs.dispatch("sandboxcreated",{source:this})}catch(e){return console.error(`setDocument: "${e.message}".`),void await this.#Zs()}await(this.#Qs?.dispatchEventInSandbox({id:"doc",name:"Open"})),await this.#nr(this.#Xs.currentPageNumber,!0),Promise.resolve().then((()=>{e===this.#qs&&(this.#Ks=!0)}))}}else await this.#Zs()}async dispatchWillSave(){return this.#Qs?.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(){return this.#Qs?.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(){if(this.#Qs){await(this.#Js?.promise),this.#Js=new s.PromiseCapability;try{await this.#Qs.dispatchEventInSandbox({id:"doc",name:"WillPrint"})}catch(e){throw this.#Js.resolve(),this.#Js=null,e}await this.#Js.promise}}async dispatchDidPrint(){return this.#Qs?.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get destroyPromise(){return this.#Ws?.promise||null}get ready(){return this.#Ks}get _internalEvents(){return(0,s.shadow)(this,"_internalEvents",new Map)}get _pageOpenPending(){return(0,s.shadow)(this,"_pageOpenPending",new Set)}get _visitedPages(){return(0,s.shadow)(this,"_visitedPages",new Map)}async#tr(e){const t=this.#Xs,i=t.isInPresentationMode||t.isChangingPresentationMode,{id:s,siblings:r,command:a,value:o}=e;if(!s){switch(a){case"clear":console.clear();break;case"error":console.error(o);break;case"layout":if(!i){const e=(0,n.apiPageLayoutToViewerModes)(o);t.spreadMode=e.spreadMode}break;case"page-num":t.currentPageNumber=o+1;break;case"print":await t.pagesPromise,this.#Gs.dispatch("print",{source:this});break;case"println":console.log(o);break;case"zoom":i||(t.currentScaleValue=o);break;case"SaveAs":this.#Gs.dispatch("download",{source:this});break;case"FirstPage":t.currentPageNumber=1;break;case"LastPage":t.currentPageNumber=t.pagesCount;break;case"NextPage":t.nextPage();break;case"PrevPage":t.previousPage();break;case"ZoomViewIn":i||t.increaseScale();break;case"ZoomViewOut":i||t.decreaseScale();break;case"WillPrintFinished":this.#Js?.resolve(),this.#Js=null}return}if(i&&e.focus)return;delete e.id,delete e.siblings;const l=r?[s,...r]:[s];for(const t of l){const i=document.querySelector(`[data-element-id="${t}"]`);i?i.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:e})):this.#qs?.annotationStorage.setValue(t,e)}}async#nr(e,t=!1){const i=this.#qs,r=this._visitedPages;if(t&&(this.#Hs=new s.PromiseCapability),!this.#Hs)return;const a=this.#Xs.getPageView(e-1);if(a?.renderingState!==n.RenderingStates.FINISHED)return void this._pageOpenPending.add(e);this._pageOpenPending.delete(e);const o=(async()=>{const t=await(r.has(e)?null:a.pdfPage?.getJSActions());i===this.#qs&&await(this.#Qs?.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:e,actions:t}))})();r.set(e,o)}async#ir(e){const t=this.#qs,i=this._visitedPages;if(!this.#Hs)return;if(this._pageOpenPending.has(e))return;const n=i.get(e);n&&(i.set(e,null),await n,t===this.#qs&&await(this.#Qs?.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:e})))}#er(){if(this.#Ws=new s.PromiseCapability,this.#Qs)throw new Error("#initScripting: Scripting already exists.");return this.#$s.createScripting({sandboxBundleSrc:this.#Ys})}async#Zs(){if(!this.#Qs)return this.#qs=null,void this.#Ws?.resolve();this.#Hs&&(await Promise.race([this.#Hs.promise,new Promise((e=>{setTimeout(e,1e3)}))]).catch((()=>{})),this.#Hs=null),this.#qs=null;try{await this.#Qs.destroySandbox()}catch{}this.#Js?.reject(new Error("Scripting destroyed.")),this.#Js=null;for(const[e,t]of this._internalEvents)this.#Gs._off(e,t);this._internalEvents.clear(),this._pageOpenPending.clear(),this._visitedPages.clear(),this.#Qs=null,this.#Ks=!1,this.#Ws?.resolve()}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFSinglePageViewer=void 0;var n=i(2),s=i(25);class r extends s.PDFViewer{_resetView(){super._resetView(),this._scrollMode=n.ScrollMode.PAGE,this._spreadMode=n.SpreadMode.NONE}set scrollMode(e){}_updateScrollMode(){}set spreadMode(e){}_updateSpreadMode(){}}t.PDFSinglePageViewer=r},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PagesCountLimit=t.PDFViewer=t.PDFPageViewBuffer=void 0;var n=i(4),s=i(2),r=i(7),a=i(13),o=i(26),l=i(5);const h={FORCE_SCROLL_MODE_PAGE:15e3,FORCE_LAZY_PAGE_INIT:7500,PAUSE_EAGER_PAGE_INIT:250};function c(e){return Object.values(n.AnnotationEditorType).includes(e)&&e!==n.AnnotationEditorType.DISABLE}t.PagesCountLimit=h;class d{#sr=new Set;#rr=0;constructor(e){this.#rr=e}push(e){const t=this.#sr;t.has(e)&&t.delete(e),t.add(e),t.size>this.#rr&&this.#ar()}resize(e,t=null){this.#rr=e;const i=this.#sr;if(t){const e=i.size;let n=1;for(const s of i)if(t.has(s.id)&&(i.delete(s),i.add(s)),++n>e)break}for(;i.size>this.#rr;)this.#ar()}has(e){return this.#sr.has(e)}[Symbol.iterator](){return this.#sr.keys()}#ar(){const e=this.#sr.keys().next().value;e?.destroy(),this.#sr.delete(e)}}t.PDFPageViewBuffer=d,t.PDFViewer=class{#or=null;#ne=null;#lr=n.AnnotationEditorType.NONE;#hr=null;#cs=n.AnnotationMode.ENABLE_FORMS;#cr=null;#dr=null;#Os=!1;#ur=!1;#pr=null;#gr=!1;#fr=0;#mr=new ResizeObserver(this.#_r.bind(this));#vr=null;#br=null;#yr=null;#_s=s.TextLayerMode.ENABLE;constructor(e){const t="3.11.174";if(n.version!==t)throw new Error(`The API version "${n.version}" does not match the Viewer version "${t}".`);if(this.container=e.container,this.viewer=e.viewer||e.container.firstElementChild,"DIV"!==this.container?.tagName||"DIV"!==this.viewer?.tagName)throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&"absolute"!==getComputedStyle(this.container).position)throw new Error("The `container` must be absolutely positioned.");this.#mr.observe(this.container),this.eventBus=e.eventBus,this.linkService=e.linkService||new l.SimpleLinkService,this.downloadManager=e.downloadManager||null,this.findController=e.findController||null,this.#ne=e.altTextManager||null,this.findController&&(this.findController.onIsPageVisible=e=>this._getVisiblePages().ids.has(e)),this._scriptingManager=e.scriptingManager||null,this.#_s=e.textLayerMode??s.TextLayerMode.ENABLE,this.#cs=e.annotationMode??n.AnnotationMode.ENABLE_FORMS,this.#lr=e.annotationEditorMode??n.AnnotationEditorType.NONE,this.imageResourcesPath=e.imageResourcesPath||"",this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1,this.removePageBorders=e.removePageBorders||!1,e.useOnlyCssZoom&&(console.error("useOnlyCssZoom was removed, please use `maxCanvasPixels = 0` instead."),e.maxCanvasPixels=0),this.isOffscreenCanvasSupported=e.isOffscreenCanvasSupported??!0,this.maxCanvasPixels=e.maxCanvasPixels,this.l10n=e.l10n||r.NullL10n,this.#Os=e.enablePermissions||!1,this.pageColors=e.pageColors||null,this.defaultRenderingQueue=!e.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new o.PDFRenderingQueue,this.renderingQueue.setViewer(this)):this.renderingQueue=e.renderingQueue,this.scroll=(0,s.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=s.PresentationModeState.UNKNOWN,this._onBeforeDraw=this._onAfterDraw=null,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),this.#Sr(),this.eventBus._on("thumbnailrendered",(({pageNumber:e,pdfPage:t})=>{const i=this._pages[e-1];this.#or.has(i)||t?.cleanup()}))}get pagesCount(){return this._pages.length}getPageView(e){return this._pages[e]}getCachedPageViews(){return new Set(this.#or)}get pageViewsReady(){return this._pagesCapability.settled&&this._pages.every((e=>e?.pdfPage))}get renderForms(){return this.#cs===n.AnnotationMode.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(e){if(!Number.isInteger(e))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(e,!0)||console.error(`currentPageNumber: "${e}" is not a valid page.`))}_setCurrentPageNumber(e,t=!1){if(this._currentPageNumber===e)return t&&this.#Pr(),!0;if(!(0<e&&e<=this.pagesCount))return!1;const i=this._currentPageNumber;return this._currentPageNumber=e,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:e,pageLabel:this._pageLabels?.[e-1]??null,previous:i}),t&&this.#Pr(),!0}get currentPageLabel(){return this._pageLabels?.[this._currentPageNumber-1]??null}set currentPageLabel(e){if(!this.pdfDocument)return;let t=0|e;if(this._pageLabels){const i=this._pageLabels.indexOf(e);i>=0&&(t=i+1)}this._setCurrentPageNumber(t,!0)||console.error(`currentPageLabel: "${e}" is not a valid page.`)}get currentScale(){return this._currentScale!==s.UNKNOWN_SCALE?this._currentScale:s.DEFAULT_SCALE}set currentScale(e){if(isNaN(e))throw new Error("Invalid numeric scale.");this.pdfDocument&&this.#Ar(e,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(e){this.pdfDocument&&this.#Ar(e,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!(0,s.isValidRotation)(e))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument)return;if((e%=360)<0&&(e+=360),this._pagesRotation===e)return;this._pagesRotation=e;const t=this._currentPageNumber;this.refresh(!0,{rotation:e}),this._currentScaleValue&&this.#Ar(this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:e,pageNumber:t}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}#us(){const e=this;return{get annotationEditorUIManager(){return e.#hr},get annotationStorage(){return e.pdfDocument?.annotationStorage},get downloadManager(){return e.downloadManager},get enableScripting(){return!!e._scriptingManager},get fieldObjectsPromise(){return e.pdfDocument?.getFieldObjects()},get findController(){return e.findController},get hasJSActionsPromise(){return e.pdfDocument?.hasJSActions()},get linkService(){return e.linkService}}}#wr(e){const t={annotationEditorMode:this.#lr,annotationMode:this.#cs,textLayerMode:this.#_s};return e?(e.includes(n.PermissionFlag.COPY)||this.#_s!==s.TextLayerMode.ENABLE||(t.textLayerMode=s.TextLayerMode.ENABLE_PERMISSIONS),e.includes(n.PermissionFlag.MODIFY_CONTENTS)||(t.annotationEditorMode=n.AnnotationEditorType.DISABLE),e.includes(n.PermissionFlag.MODIFY_ANNOTATIONS)||e.includes(n.PermissionFlag.FILL_INTERACTIVE_FORMS)||this.#cs!==n.AnnotationMode.ENABLE_FORMS||(t.annotationMode=n.AnnotationMode.ENABLE),t):t}#Er(){if("hidden"===document.visibilityState||!this.container.offsetParent||0===this._getVisiblePages().views.length)return Promise.resolve();const e=new Promise((e=>{this.#br=()=>{"hidden"===document.visibilityState&&(e(),document.removeEventListener("visibilitychange",this.#br),this.#br=null)},document.addEventListener("visibilitychange",this.#br)}));return Promise.race([this._onePageRenderedCapability.promise,e])}async getAllText(){const e=[],t=[];for(let i=1,n=this.pdfDocument.numPages;i<=n;++i){if(this.#gr)return null;t.length=0;const n=await this.pdfDocument.getPage(i),{items:r}=await n.getTextContent();for(const e of r)e.str&&t.push(e.str),e.hasEOL&&t.push("\n");e.push((0,s.removeNullCharacters)(t.join("")))}return e.join("\n")}#xr(e,t){const i=document.getSelection(),{focusNode:n,anchorNode:r}=i;if(r&&n&&i.containsNode(this.#pr)){if(this.#ur||e===s.TextLayerMode.ENABLE_PERMISSIONS)return t.preventDefault(),void t.stopPropagation();this.#ur=!0;const i=this.container.style.cursor;this.container.style.cursor="wait";const n=e=>this.#gr="Escape"===e.key;window.addEventListener("keydown",n),this.getAllText().then((async e=>{null!==e&&await navigator.clipboard.writeText(e)})).catch((e=>{console.warn(`Something goes wrong when extracting the text: ${e.message}`)})).finally((()=>{this.#ur=!1,this.#gr=!1,window.removeEventListener("keydown",n),this.container.style.cursor=i})),t.preventDefault(),t.stopPropagation()}}setDocument(e){if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),this.findController?.setDocument(null),this._scriptingManager?.setDocument(null),this.#hr&&(this.#hr.destroy(),this.#hr=null)),this.pdfDocument=e,!e)return;const t=e.numPages,i=e.getPage(1),r=e.getOptionalContentConfig(),o=this.#Os?e.getPermissions():Promise.resolve();if(t>h.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const e=this._scrollMode=s.ScrollMode.PAGE;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e})}this._pagesCapability.promise.then((()=>{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:t})}),(()=>{})),this._onBeforeDraw=e=>{const t=this._pages[e.pageNumber-1];t&&this.#or.push(t)},this.eventBus._on("pagerender",this._onBeforeDraw),this._onAfterDraw=e=>{e.cssTransform||this._onePageRenderedCapability.settled||(this._onePageRenderedCapability.resolve({timestamp:e.timestamp}),this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null,this.#br&&(document.removeEventListener("visibilitychange",this.#br),this.#br=null))},this.eventBus._on("pagerendered",this._onAfterDraw),Promise.all([i,o]).then((([i,o])=>{if(e!==this.pdfDocument)return;this._firstPageCapability.resolve(i),this._optionalContentConfigPromise=r;const{annotationEditorMode:l,annotationMode:d,textLayerMode:u}=this.#wr(o);if(u!==s.TextLayerMode.DISABLE){const e=this.#pr=document.createElement("div");e.id="hiddenCopyElement",this.viewer.before(e)}if(l!==n.AnnotationEditorType.DISABLE){const t=l;e.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):c(t)?(this.#hr=new n.AnnotationEditorUIManager(this.container,this.viewer,this.#ne,this.eventBus,e,this.pageColors),t!==n.AnnotationEditorType.NONE&&this.#hr.updateMode(t)):console.error(`Invalid AnnotationEditor mode: ${t}`)}const p=this.#us.bind(this),g=this._scrollMode===s.ScrollMode.PAGE?null:this.viewer,f=this.currentScale,m=i.getViewport({scale:f*n.PixelsPerInch.PDF_TO_CSS_UNITS});this.viewer.style.setProperty("--scale-factor",m.scale),"CanvasText"!==this.pageColors?.foreground&&"Canvas"!==this.pageColors?.background||this.viewer.style.setProperty("--hcm-highligh-filter",e.filterFactory.addHighlightHCMFilter("CanvasText","Canvas","HighlightText","Highlight"));for(let e=1;e<=t;++e){const t=new a.PDFPageView({container:g,eventBus:this.eventBus,id:e,scale:f,defaultViewport:m.clone(),optionalContentConfigPromise:r,renderingQueue:this.renderingQueue,textLayerMode:u,annotationMode:d,imageResourcesPath:this.imageResourcesPath,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,maxCanvasPixels:this.maxCanvasPixels,pageColors:this.pageColors,l10n:this.l10n,layerProperties:p});this._pages.push(t)}const _=this._pages[0];_&&(_.setPdfPage(i),this.linkService.cachePageRef(1,i.ref)),this._scrollMode===s.ScrollMode.PAGE?this.#Cr():this._spreadMode!==s.SpreadMode.NONE&&this._updateSpreadMode(),this.#Er().then((async()=>{if(this.findController?.setDocument(e),this._scriptingManager?.setDocument(e),this.#pr&&(this.#dr=this.#xr.bind(this,u),document.addEventListener("copy",this.#dr)),this.#hr&&this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:this.#lr}),e.loadingParams.disableAutoFetch||t>h.FORCE_LAZY_PAGE_INIT)return void this._pagesCapability.resolve();let i=t-1;if(i<=0)this._pagesCapability.resolve();else for(let n=2;n<=t;++n){const t=e.getPage(n).then((e=>{const t=this._pages[n-1];t.pdfPage||t.setPdfPage(e),this.linkService.cachePageRef(n,e.ref),0==--i&&this._pagesCapability.resolve()}),(e=>{console.error(`Unable to get page ${n} to initialize viewer`,e),0==--i&&this._pagesCapability.resolve()}));n%h.PAUSE_EAGER_PAGE_INIT==0&&await t}})),this.eventBus.dispatch("pagesinit",{source:this}),e.getMetadata().then((({info:t})=>{e===this.pdfDocument&&t.Language&&(this.viewer.lang=t.Language)})),this.defaultRenderingQueue&&this.update()})).catch((e=>{console.error("Unable to initialize viewer",e),this._pagesCapability.reject(e)}))}setPageLabels(e){if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let e=0,t=this._pages.length;e<t;e++)this._pages[e].setPageLabel(this._pageLabels?.[e]??null)}}_resetView(){this._pages=[],this._currentPageNumber=1,this._currentScale=s.UNKNOWN_SCALE,this._currentScaleValue=null,this._pageLabels=null,this.#or=new d(10),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=new n.PromiseCapability,this._onePageRenderedCapability=new n.PromiseCapability,this._pagesCapability=new n.PromiseCapability,this._scrollMode=s.ScrollMode.VERTICAL,this._previousScrollMode=s.ScrollMode.UNKNOWN,this._spreadMode=s.SpreadMode.NONE,this.#vr={previousPageNumber:1,scrollDown:!0,pages:[]},this._onBeforeDraw&&(this.eventBus._off("pagerender",this._onBeforeDraw),this._onBeforeDraw=null),this._onAfterDraw&&(this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null),this.#br&&(document.removeEventListener("visibilitychange",this.#br),this.#br=null),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),this.#pr&&(document.removeEventListener("copy",this.#dr),this.#dr=null,this.#pr.remove(),this.#pr=null)}#Cr(){if(this._scrollMode!==s.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const e=this._currentPageNumber,t=this.#vr,i=this.viewer;if(i.textContent="",t.pages.length=0,this._spreadMode!==s.SpreadMode.NONE||this.isInPresentationMode){const n=new Set,s=this._spreadMode-1;-1===s?n.add(e-1):e%2!==s?(n.add(e-1),n.add(e)):(n.add(e-2),n.add(e-1));const r=document.createElement("div");if(r.className="spread",this.isInPresentationMode){const e=document.createElement("div");e.className="dummyPage",r.append(e)}for(const e of n){const i=this._pages[e];i&&(r.append(i.div),t.pages.push(i))}i.append(r)}else{const n=this._pages[e-1];i.append(n.div),t.pages.push(n)}t.scrollDown=e>=t.previousPageNumber,t.previousPageNumber=e}_scrollUpdate(){0!==this.pagesCount&&this.update()}#Mr(e,t=null){const{div:i,id:n}=e;if(this._currentPageNumber!==n&&this._setCurrentPageNumber(n),this._scrollMode===s.ScrollMode.PAGE&&(this.#Cr(),this.update()),!t&&!this.isInPresentationMode){const e=i.offsetLeft+i.clientLeft,n=e+i.clientWidth,{scrollLeft:r,clientWidth:a}=this.container;(this._scrollMode===s.ScrollMode.HORIZONTAL||e<r||n>r+a)&&(t={left:0,top:0})}(0,s.scrollIntoView)(i,t),!this._currentScaleValue&&this._location&&(this._location=null)}#Tr(e){return e===this._currentScale||Math.abs(e-this._currentScale)<1e-15}#Dr(e,t,{noScroll:i=!1,preset:s=!1,drawingDelay:r=-1}){if(this._currentScaleValue=t.toString(),this.#Tr(e))return void(s&&this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:t}));this.viewer.style.setProperty("--scale-factor",e*n.PixelsPerInch.PDF_TO_CSS_UNITS);const a=r>=0&&r<1e3;if(this.refresh(!0,{scale:e,drawingDelay:a?r:-1}),a&&(this.#yr=setTimeout((()=>{this.#yr=null,this.refresh()}),r)),this._currentScale=e,!i){let e,t=this._currentPageNumber;!this._location||this.isInPresentationMode||this.isChangingPresentationMode||(t=this._location.pageNumber,e=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:t,destArray:e,allowNegativeOffset:!0})}this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:s?t:void 0}),this.defaultRenderingQueue&&this.update()}get#Fr(){return this._spreadMode!==s.SpreadMode.NONE&&this._scrollMode!==s.ScrollMode.HORIZONTAL?2:1}#Ar(e,t){let i=parseFloat(e);if(i>0)t.preset=!1,this.#Dr(i,e,t);else{const n=this._pages[this._currentPageNumber-1];if(!n)return;let r=s.SCROLLBAR_PADDING,a=s.VERTICAL_PADDING;this.isInPresentationMode?(r=a=4,this._spreadMode!==s.SpreadMode.NONE&&(r*=2)):this.removePageBorders?r=a=0:this._scrollMode===s.ScrollMode.HORIZONTAL&&([r,a]=[a,r]);const o=(this.container.clientWidth-r)/n.width*n.scale/this.#Fr,l=(this.container.clientHeight-a)/n.height*n.scale;switch(e){case"page-actual":i=1;break;case"page-width":i=o;break;case"page-height":i=l;break;case"page-fit":i=Math.min(o,l);break;case"auto":const t=(0,s.isPortraitOrientation)(n)?o:Math.min(l,o);i=Math.min(s.MAX_AUTO_SCALE,t);break;default:return void console.error(`#setScale: "${e}" is an unknown zoom value.`)}t.preset=!0,this.#Dr(i,e,t)}}#Pr(){const e=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&this.#Ar(this._currentScaleValue,{noScroll:!0}),this.#Mr(e)}pageLabelToPageNumber(e){if(!this._pageLabels)return null;const t=this._pageLabels.indexOf(e);return t<0?null:t+1}scrollPageIntoView({pageNumber:e,destArray:t=null,allowNegativeOffset:i=!1,ignoreDestinationZoom:r=!1}){if(!this.pdfDocument)return;const a=Number.isInteger(e)&&this._pages[e-1];if(!a)return void console.error(`scrollPageIntoView: "${e}" is not a valid pageNumber parameter.`);if(this.isInPresentationMode||!t)return void this._setCurrentPageNumber(e,!0);let o,l,h=0,c=0,d=0,u=0;const p=a.rotation%180!=0,g=(p?a.height:a.width)/a.scale/n.PixelsPerInch.PDF_TO_CSS_UNITS,f=(p?a.width:a.height)/a.scale/n.PixelsPerInch.PDF_TO_CSS_UNITS;let m=0;switch(t[1].name){case"XYZ":h=t[2],c=t[3],m=t[4],h=null!==h?h:0,c=null!==c?c:f;break;case"Fit":case"FitB":m="page-fit";break;case"FitH":case"FitBH":c=t[2],m="page-width",null===c&&this._location?(h=this._location.left,c=this._location.top):("number"!=typeof c||c<0)&&(c=f);break;case"FitV":case"FitBV":h=t[2],d=g,u=f,m="page-height";break;case"FitR":h=t[2],c=t[3],d=t[4]-h,u=t[5]-c;let e=s.SCROLLBAR_PADDING,i=s.VERTICAL_PADDING;this.removePageBorders&&(e=i=0),o=(this.container.clientWidth-e)/d/n.PixelsPerInch.PDF_TO_CSS_UNITS,l=(this.container.clientHeight-i)/u/n.PixelsPerInch.PDF_TO_CSS_UNITS,m=Math.min(Math.abs(o),Math.abs(l));break;default:return void console.error(`scrollPageIntoView: "${t[1].name}" is not a valid destination type.`)}if(r||(m&&m!==this._currentScale?this.currentScaleValue=m:this._currentScale===s.UNKNOWN_SCALE&&(this.currentScaleValue=s.DEFAULT_SCALE_VALUE)),"page-fit"===m&&!t[4])return void this.#Mr(a);const _=[a.viewport.convertToViewportPoint(h,c),a.viewport.convertToViewportPoint(h+d,c+u)];let v=Math.min(_[0][0],_[1][0]),b=Math.min(_[0][1],_[1][1]);i||(v=Math.max(v,0),b=Math.max(b,0)),this.#Mr(a,{left:v,top:b})}_updateLocation(e){const t=this._currentScale,i=this._currentScaleValue,n=parseFloat(i)===t?Math.round(1e4*t)/100:i,s=e.id,r=this._pages[s-1],a=this.container,o=r.getPagePoint(a.scrollLeft-e.x,a.scrollTop-e.y),l=Math.round(o[0]),h=Math.round(o[1]);let c=`#page=${s}`;this.isInPresentationMode||(c+=`&zoom=${n},${l},${h}`),this._location={pageNumber:s,scale:n,top:h,left:l,rotation:this._pagesRotation,pdfOpenParams:c}}update(){const e=this._getVisiblePages(),t=e.views,i=t.length;if(0===i)return;const n=Math.max(10,2*i+1);this.#or.resize(n,e.ids),this.renderingQueue.renderHighestPriority(e);const r=this._spreadMode===s.SpreadMode.NONE&&(this._scrollMode===s.ScrollMode.PAGE||this._scrollMode===s.ScrollMode.VERTICAL),a=this._currentPageNumber;let o=!1;for(const e of t){if(e.percent<100)break;if(e.id===a&&r){o=!0;break}}this._setCurrentPageNumber(o?a:t[0].id),this._updateLocation(e.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(e){return this.container.contains(e)}focus(){this.container.focus()}get _isContainerRtl(){return"rtl"===getComputedStyle(this.container).direction}get isInPresentationMode(){return this.presentationModeState===s.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===s.PresentationModeState.CHANGING}get isHorizontalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const e=this._scrollMode===s.ScrollMode.PAGE?this.#vr.pages:this._pages,t=this._scrollMode===s.ScrollMode.HORIZONTAL,i=t&&this._isContainerRtl;return(0,s.getVisibleElements)({scrollEl:this.container,views:e,sortByVisibility:!0,horizontal:t,rtl:i})}cleanup(){for(const e of this._pages)e.renderingState!==s.RenderingStates.FINISHED&&e.reset()}_cancelRendering(){for(const e of this._pages)e.cancelRendering()}async#Lr(e){if(e.pdfPage)return e.pdfPage;try{const t=await this.pdfDocument.getPage(e.id);return e.pdfPage||e.setPdfPage(t),this.linkService._cachedPageNumber?.(t.ref)||this.linkService.cachePageRef(e.id,t.ref),t}catch(e){return console.error("Unable to get page for page view",e),null}}#kr(e){if(1===e.first?.id)return!0;if(e.last?.id===this.pagesCount)return!1;switch(this._scrollMode){case s.ScrollMode.PAGE:return this.#vr.scrollDown;case s.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down}forceRendering(e){const t=e||this._getVisiblePages(),i=this.#kr(t),n=this._spreadMode!==s.SpreadMode.NONE&&this._scrollMode!==s.ScrollMode.HORIZONTAL,r=this.renderingQueue.getHighestPriority(t,this._pages,i,n);return!!r&&(this.#Lr(r).then((()=>{this.renderingQueue.renderView(r)})),!0)}get hasEqualPageSizes(){const e=this._pages[0];for(let t=1,i=this._pages.length;t<i;++t){const i=this._pages[t];if(i.width!==e.width||i.height!==e.height)return!1}return!0}getPagesOverview(){let e;return this._pages.map((t=>{const i=t.pdfPage.getViewport({scale:1}),n=(0,s.isPortraitOrientation)(i);if(void 0===e)e=n;else if(this.enablePrintAutoRotate&&n!==e)return{width:i.height,height:i.width,rotation:(i.rotation-90)%360};return{width:i.width,height:i.height,rotation:i.rotation}}))}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig()):Promise.resolve(null)}set optionalContentConfigPromise(e){if(!(e instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${e}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=e,this.refresh(!1,{optionalContentConfigPromise:e}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:e}))}get scrollMode(){return this._scrollMode}set scrollMode(e){if(this._scrollMode!==e){if(!(0,s.isValidScrollMode)(e))throw new Error(`Invalid scroll mode: ${e}`);this.pagesCount>h.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=e,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(e=null){const t=this._scrollMode,i=this.viewer;i.classList.toggle("scrollHorizontal",t===s.ScrollMode.HORIZONTAL),i.classList.toggle("scrollWrapped",t===s.ScrollMode.WRAPPED),this.pdfDocument&&e&&(t===s.ScrollMode.PAGE?this.#Cr():this._previousScrollMode===s.ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&this.#Ar(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(e,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(e){if(this._spreadMode!==e){if(!(0,s.isValidSpreadMode)(e))throw new Error(`Invalid spread mode: ${e}`);this._spreadMode=e,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:e}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(e=null){if(!this.pdfDocument)return;const t=this.viewer,i=this._pages;if(this._scrollMode===s.ScrollMode.PAGE)this.#Cr();else if(t.textContent="",this._spreadMode===s.SpreadMode.NONE)for(const e of this._pages)t.append(e.div);else{const e=this._spreadMode-1;let n=null;for(let s=0,r=i.length;s<r;++s)null===n?(n=document.createElement("div"),n.className="spread",t.append(n)):s%2===e&&(n=n.cloneNode(!1),t.append(n)),n.append(i[s].div)}e&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&this.#Ar(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(e,!0),this.update())}_getPageAdvance(e,t=!1){switch(this._scrollMode){case s.ScrollMode.WRAPPED:{const{views:i}=this._getVisiblePages(),n=new Map;for(const{id:e,y:t,percent:s,widthPercent:r}of i){if(0===s||r<100)continue;let i=n.get(t);i||n.set(t,i||=[]),i.push(e)}for(const i of n.values()){const n=i.indexOf(e);if(-1===n)continue;const s=i.length;if(1===s)break;if(t)for(let t=n-1,s=0;t>=s;t--){const n=i[t],s=i[t+1]-1;if(n<s)return e-s}else for(let t=n+1,r=s;t<r;t++){const n=i[t],s=i[t-1]+1;if(n>s)return s-e}if(t){const t=i[0];if(t<e)return e-t+1}else{const t=i[s-1];if(t>e)return t-e+1}break}break}case s.ScrollMode.HORIZONTAL:break;case s.ScrollMode.PAGE:case s.ScrollMode.VERTICAL:{if(this._spreadMode===s.SpreadMode.NONE)break;const i=this._spreadMode-1;if(t&&e%2!==i)break;if(!t&&e%2===i)break;const{views:n}=this._getVisiblePages(),r=t?e-1:e+1;for(const{id:e,percent:t,widthPercent:i}of n)if(e===r){if(t>0&&100===i)return 2;break}break}}return 1}nextPage(){const e=this._currentPageNumber,t=this.pagesCount;if(e>=t)return!1;const i=this._getPageAdvance(e,!1)||1;return this.currentPageNumber=Math.min(e+i,t),!0}previousPage(){const e=this._currentPageNumber;if(e<=1)return!1;const t=this._getPageAdvance(e,!0)||1;return this.currentPageNumber=Math.max(e-t,1),!0}increaseScale({drawingDelay:e,scaleFactor:t,steps:i}={}){if(!this.pdfDocument)return;let n=this._currentScale;if(t>1)n=Math.round(n*t*100)/100;else{i??=1;do{n=Math.ceil(10*(n*s.DEFAULT_SCALE_DELTA).toFixed(2))/10}while(--i>0&&n<s.MAX_SCALE)}this.#Ar(Math.min(s.MAX_SCALE,n),{noScroll:!1,drawingDelay:e})}decreaseScale({drawingDelay:e,scaleFactor:t,steps:i}={}){if(!this.pdfDocument)return;let n=this._currentScale;if(t>0&&t<1)n=Math.round(n*t*100)/100;else{i??=1;do{n=Math.floor(10*(n/s.DEFAULT_SCALE_DELTA).toFixed(2))/10}while(--i>0&&n>s.MIN_SCALE)}this.#Ar(Math.max(s.MIN_SCALE,n),{noScroll:!1,drawingDelay:e})}#Sr(e=this.container.clientHeight){e!==this.#fr&&(this.#fr=e,s.docStyle.setProperty("--viewer-container-height",`${e}px`))}#_r(e){for(const t of e)if(t.target===this.container){this.#Sr(Math.floor(t.borderBoxSize[0].blockSize)),this.#cr=null;break}}get containerTopLeft(){return this.#cr||=[this.container.offsetTop,this.container.offsetLeft]}get annotationEditorMode(){return this.#hr?this.#lr:n.AnnotationEditorType.DISABLE}set annotationEditorMode({mode:e,editId:t=null}){if(!this.#hr)throw new Error("The AnnotationEditor is not enabled.");if(this.#lr!==e){if(!c(e))throw new Error(`Invalid AnnotationEditor mode: ${e}`);this.pdfDocument&&(this.#lr=e,this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:e}),this.#hr.updateMode(e,t))}}set annotationEditorParams({type:e,value:t}){if(!this.#hr)throw new Error("The AnnotationEditor is not enabled.");this.#hr.updateParams(e,t)}refresh(e=!1,t=Object.create(null)){if(this.pdfDocument){for(const e of this._pages)e.update(t);null!==this.#yr&&(clearTimeout(this.#yr),this.#yr=null),e||this.update()}}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFRenderingQueue=void 0;var n=i(4),s=i(2);t.PDFRenderingQueue=class{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(e){this.pdfViewer=e}setThumbnailViewer(e){this.pdfThumbnailViewer=e}isHighestPriority(e){return this.highestPriorityPage===e.renderingId}renderHighestPriority(e){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),this.pdfViewer.forceRendering(e)||this.isThumbnailViewEnabled&&this.pdfThumbnailViewer?.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),3e4))}getHighestPriority(e,t,i,n=!1){const s=e.views,r=s.length;if(0===r)return null;for(let e=0;e<r;e++){const t=s[e].view;if(!this.isViewFinished(t))return t}const a=e.first.id,o=e.last.id;if(o-a+1>r){const n=e.ids;for(let e=1,s=o-a;e<s;e++){const s=i?a+e:o-e;if(n.has(s))continue;const r=t[s-1];if(!this.isViewFinished(r))return r}}let l=i?o:a-2,h=t[l];return h&&!this.isViewFinished(h)||n&&(l+=i?1:-1,h=t[l],h&&!this.isViewFinished(h))?h:null}isViewFinished(e){return e.renderingState===s.RenderingStates.FINISHED}renderView(e){switch(e.renderingState){case s.RenderingStates.FINISHED:return!1;case s.RenderingStates.PAUSED:this.highestPriorityPage=e.renderingId,e.resume();break;case s.RenderingStates.RUNNING:this.highestPriorityPage=e.renderingId;break;case s.RenderingStates.INITIAL:this.highestPriorityPage=e.renderingId,e.draw().finally((()=>{this.renderHighestPriority()})).catch((e=>{e instanceof n.RenderingCancelledException||console.error(`renderView: "${e}"`)}))}return!0}}}],t={};function i(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AnnotationLayerBuilder",{enumerable:!0,get:function(){return a.AnnotationLayerBuilder}}),Object.defineProperty(e,"DownloadManager",{enumerable:!0,get:function(){return o.DownloadManager}}),Object.defineProperty(e,"EventBus",{enumerable:!0,get:function(){return l.EventBus}}),Object.defineProperty(e,"FindState",{enumerable:!0,get:function(){return t.FindState}}),Object.defineProperty(e,"GenericL10n",{enumerable:!0,get:function(){return h.GenericL10n}}),Object.defineProperty(e,"LinkTarget",{enumerable:!0,get:function(){return s.LinkTarget}}),Object.defineProperty(e,"NullL10n",{enumerable:!0,get:function(){return c.NullL10n}}),Object.defineProperty(e,"PDFFindController",{enumerable:!0,get:function(){return t.PDFFindController}}),Object.defineProperty(e,"PDFHistory",{enumerable:!0,get:function(){return d.PDFHistory}}),Object.defineProperty(e,"PDFLinkService",{enumerable:!0,get:function(){return s.PDFLinkService}}),Object.defineProperty(e,"PDFPageView",{enumerable:!0,get:function(){return u.PDFPageView}}),Object.defineProperty(e,"PDFScriptingManager",{enumerable:!0,get:function(){return p.PDFScriptingManager}}),Object.defineProperty(e,"PDFSinglePageViewer",{enumerable:!0,get:function(){return g.PDFSinglePageViewer}}),Object.defineProperty(e,"PDFViewer",{enumerable:!0,get:function(){return f.PDFViewer}}),Object.defineProperty(e,"ProgressBar",{enumerable:!0,get:function(){return r.ProgressBar}}),Object.defineProperty(e,"RenderingStates",{enumerable:!0,get:function(){return r.RenderingStates}}),Object.defineProperty(e,"ScrollMode",{enumerable:!0,get:function(){return r.ScrollMode}}),Object.defineProperty(e,"SimpleLinkService",{enumerable:!0,get:function(){return s.SimpleLinkService}}),Object.defineProperty(e,"SpreadMode",{enumerable:!0,get:function(){return r.SpreadMode}}),Object.defineProperty(e,"StructTreeLayerBuilder",{enumerable:!0,get:function(){return m.StructTreeLayerBuilder}}),Object.defineProperty(e,"TextLayerBuilder",{enumerable:!0,get:function(){return _.TextLayerBuilder}}),Object.defineProperty(e,"XfaLayerBuilder",{enumerable:!0,get:function(){return v.XfaLayerBuilder}}),Object.defineProperty(e,"parseQueryString",{enumerable:!0,get:function(){return r.parseQueryString}});var t=i(1),s=i(5),r=i(2),a=i(6),o=i(8),l=i(9),h=i(10),c=i(7),d=i(12),u=i(13),p=i(21),g=i(24),f=i(25),m=i(16),_=i(19),v=i(20)})(),n})(),e.exports=i.pdfjsViewer=n()}(pdf_viewer);var pdf_viewerExports=pdf_viewer.exports,_ProgressBar_classList,_ProgressBar_disableAutoFetchTimeout,_ProgressBar_percent,_ProgressBar_style,_ProgressBar_visible;function __awaiter(e,t,i,n){return new(i||(i=Promise))((function(s,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function o(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((n=n.apply(e,t||[])).next())}))}function __classPrivateFieldGet(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}function __classPrivateFieldSet(e,t,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,i):s?s.value=i:t.set(e,i),i}"function"==typeof SuppressedError&&SuppressedError;const DEFAULT_SCALE_VALUE="auto",DEFAULT_SCALE=1,DEFAULT_SCALE_DELTA=1.1,MIN_SCALE=.1,MAX_SCALE=10,UNKNOWN_SCALE=0,MAX_AUTO_SCALE=1.25,SCROLLBAR_PADDING=40,VERTICAL_PADDING=5,RenderingStates={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},SidebarView={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4},RendererType={CANVAS:"canvas",SVG:"svg"},TextLayerMode={DISABLE:0,ENABLE:1},ScrollMode={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},SpreadMode={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2},CursorTool={SELECT:0,HAND:1,ZOOM:2},AutoPrintRegExp=/\bprint\s*\(/;class OutputScale{constructor(){const e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return 1!==this.sx||1!==this.sy}}function scrollIntoView(e,t,i=!1){let n=e.offsetParent;if(!n)return void console.error("offsetParent is not set -- cannot scroll");let s=e.offsetTop+e.clientTop,r=e.offsetLeft+e.clientLeft;for(;n.clientHeight===n.scrollHeight&&n.clientWidth===n.scrollWidth||i&&(n.classList.contains("markedContent")||"hidden"===getComputedStyle(n).overflow);)if(s+=n.offsetTop,r+=n.offsetLeft,n=n.offsetParent,!n)return;t&&(void 0!==t.top&&(s+=t.top),void 0!==t.left&&(r+=t.left,n.scrollLeft=r)),n.scrollTop=s,n.scrollLeft=r}function watchScroll(e,t){const i=function(i){s||(s=window.requestAnimationFrame((function(){s=null;const i=e.scrollLeft,r=n.lastX;i!==r&&(n.right=i>r),n.lastX=i;const a=e.scrollTop,o=n.lastY;a!==o&&(n.down=a>o),n.lastY=a,t(n)})))},n={right:!0,down:!0,lastX:e.scrollLeft,lastY:e.scrollTop,_eventHandler:i};let s=null;return e.addEventListener("scroll",i,!0),n}function parseQueryString(e){const t=new Map;for(const[i,n]of new URLSearchParams(e))t.set(i.toLowerCase(),n);return t}const NullCharactersRegExp=/\x00/g,InvisibleCharactersRegExp=/[\x01-\x1F]/g;function removeNullCharacters(e,t=!1){return"string"!=typeof e?(console.error("The argument must be a string."),e):(t&&(e=e.replace(InvisibleCharactersRegExp," ")),e.replace(NullCharactersRegExp,""))}function binarySearchFirstItem(e,t,i=0){let n=i,s=e.length-1;if(s<0||!t(e[s]))return e.length;if(t(e[n]))return n;for(;n<s;){const i=n+s>>1;t(e[i])?s=i:n=i+1}return n}function approximateFraction(e){if(Math.floor(e)===e)return[e,1];const t=1/e;if(t>8)return[1,8];if(Math.floor(t)===t)return[1,t];const i=e>1?t:e;let n,s=0,r=1,a=1,o=1;for(;;){const e=s+a,t=r+o;if(t>8)break;i<=e/t?(a=e,o=t):(s=e,r=t)}return n=i-s/r<a/o-i?i===e?[s,r]:[r,s]:i===e?[a,o]:[o,a],n}function roundToDivide(e,t){const i=e%t;return 0===i?e:Math.round(e-i+t)}function getPageSizeInches({view:e,userUnit:t,rotate:i}){const[n,s,r,a]=e,o=i%180!=0,l=(r-n)/72*t,h=(a-s)/72*t;return{width:o?h:l,height:o?l:h}}function backtrackBeforeAllVisibleElements(e,t,i){if(e<2)return e;let n=t[e].div,s=n.offsetTop+n.clientTop;s>=i&&(n=t[e-1].div,s=n.offsetTop+n.clientTop);for(let i=e-2;i>=0&&(n=t[i].div,!(n.offsetTop+n.clientTop+n.clientHeight<=s));--i)e=i;return e}function getVisibleElements({scrollEl:e,views:t,sortByVisibility:i=!1,horizontal:n=!1,rtl:s=!1}){const r=e.scrollTop,a=r+e.clientHeight,o=e.scrollLeft,l=o+e.clientWidth;const h=[],c=new Set,d=t.length;let u=binarySearchFirstItem(t,n?function(e){const t=e.div,i=t.offsetLeft+t.clientLeft,n=i+t.clientWidth;return s?i<l:n>o}:function(e){const t=e.div;return t.offsetTop+t.clientTop+t.clientHeight>r});u>0&&u<d&&!n&&(u=backtrackBeforeAllVisibleElements(u,t,r));let p=n?l:-1;for(let e=u;e<d;e++){const i=t[e],s=i.div,d=s.offsetLeft+s.clientLeft,u=s.offsetTop+s.clientTop,g=s.clientWidth,f=s.clientHeight,m=d+g,_=u+f;if(-1===p)_>=a&&(p=_);else if((n?d:u)>p)break;if(_<=r||u>=a||m<=o||d>=l)continue;const v=Math.max(0,r-u)+Math.max(0,_-a),b=(g-(Math.max(0,o-d)+Math.max(0,m-l)))/g,y=(f-v)/f*b*100|0;h.push({id:i.id,x:d,y:u,view:i,percent:y,widthPercent:100*b|0}),c.add(i.id)}const g=h[0],f=h.at(-1);return i&&h.sort((function(e,t){const i=e.percent-t.percent;return Math.abs(i)>.001?-i:e.id-t.id})),{first:g,last:f,views:h,ids:c}}function noContextMenuHandler(e){e.preventDefault()}function normalizeWheelEventDirection(e){let t=Math.hypot(e.deltaX,e.deltaY);const i=Math.atan2(e.deltaY,e.deltaX);return-.25*Math.PI<i&&i<.75*Math.PI&&(t=-t),t}function normalizeWheelEventDelta(e){const t=e.deltaMode;let i=normalizeWheelEventDirection(e);return t===WheelEvent.DOM_DELTA_PIXEL?i/=900:t===WheelEvent.DOM_DELTA_LINE&&(i/=30),i}function isValidRotation(e){return Number.isInteger(e)&&e%90==0}function isValidScrollMode(e){return Number.isInteger(e)&&Object.values(ScrollMode).includes(e)&&e!==ScrollMode.UNKNOWN}function isValidSpreadMode(e){return Number.isInteger(e)&&Object.values(SpreadMode).includes(e)&&e!==SpreadMode.UNKNOWN}function isPortraitOrientation(e){return e.width<=e.height}const animationStarted=new Promise((function(e){window.requestAnimationFrame(e)})),docStyle=document.documentElement.style;function clamp(e,t,i){return Math.min(Math.max(e,t),i)}class ProgressBar{constructor(e){_ProgressBar_classList.set(this,null),_ProgressBar_disableAutoFetchTimeout.set(this,null),_ProgressBar_percent.set(this,0),_ProgressBar_style.set(this,null),_ProgressBar_visible.set(this,!0),__classPrivateFieldSet(this,_ProgressBar_classList,e.classList,"f"),__classPrivateFieldSet(this,_ProgressBar_style,e.style,"f")}get percent(){return __classPrivateFieldGet(this,_ProgressBar_percent,"f")}set percent(e){var t,i,n;__classPrivateFieldSet(this,_ProgressBar_percent,clamp(e,0,100),"f"),isNaN(e)?null===(t=__classPrivateFieldGet(this,_ProgressBar_classList,"f"))||void 0===t||t.add("indeterminate"):(null===(i=__classPrivateFieldGet(this,_ProgressBar_classList,"f"))||void 0===i||i.remove("indeterminate"),null===(n=__classPrivateFieldGet(this,_ProgressBar_style,"f"))||void 0===n||n.setProperty("--progressBar-percent",`${__classPrivateFieldGet(this,_ProgressBar_percent,"f")}%`))}setWidth(e){var t;if(!e)return;const i=e.parentNode.offsetWidth-e.offsetWidth;i>0&&(null===(t=__classPrivateFieldGet(this,_ProgressBar_style,"f"))||void 0===t||t.setProperty("--progressBar-end-offset",`${i}px`))}setDisableAutoFetch(e=5e3){isNaN(__classPrivateFieldGet(this,_ProgressBar_percent,"f"))||(__classPrivateFieldGet(this,_ProgressBar_disableAutoFetchTimeout,"f")&&clearTimeout(__classPrivateFieldGet(this,_ProgressBar_disableAutoFetchTimeout,"f")),this.show(),__classPrivateFieldSet(this,_ProgressBar_disableAutoFetchTimeout,setTimeout((()=>{__classPrivateFieldSet(this,_ProgressBar_disableAutoFetchTimeout,null,"f"),this.hide()}),e),"f"))}hide(){var e;__classPrivateFieldGet(this,_ProgressBar_visible,"f")&&(__classPrivateFieldSet(this,_ProgressBar_visible,!1,"f"),null===(e=__classPrivateFieldGet(this,_ProgressBar_classList,"f"))||void 0===e||e.add("hidden"))}show(){var e;__classPrivateFieldGet(this,_ProgressBar_visible,"f")||(__classPrivateFieldSet(this,_ProgressBar_visible,!0,"f"),null===(e=__classPrivateFieldGet(this,_ProgressBar_classList,"f"))||void 0===e||e.remove("hidden"))}}function getActiveOrFocusedElement(){let e=document,t=e.activeElement||e.querySelector(":focus");for(;null==t?void 0:t.shadowRoot;)e=t.shadowRoot,t=e.activeElement||e.querySelector(":focus");return t}function apiPageLayoutToViewerModes(e){let t=ScrollMode.VERTICAL,i=SpreadMode.NONE;switch(e){case"SinglePage":t=ScrollMode.PAGE;break;case"OneColumn":break;case"TwoPageLeft":t=ScrollMode.PAGE;case"TwoColumnLeft":i=SpreadMode.ODD;break;case"TwoPageRight":t=ScrollMode.PAGE;case"TwoColumnRight":i=SpreadMode.EVEN}return{scrollMode:t,spreadMode:i}}function apiPageModeToSidebarView(e){switch(e){case"UseNone":return SidebarView.NONE;case"UseThumbs":return SidebarView.THUMBS;case"UseOutlines":return SidebarView.OUTLINE;case"UseAttachments":return SidebarView.ATTACHMENTS;case"UseOC":return SidebarView.LAYERS}return SidebarView.NONE}_ProgressBar_classList=new WeakMap,_ProgressBar_disableAutoFetchTimeout=new WeakMap,_ProgressBar_percent=new WeakMap,_ProgressBar_style=new WeakMap,_ProgressBar_visible=new WeakMap;const CLEANUP_TIMEOUT=3e4;class PDFRenderingQueue{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1}setViewer(e){this.pdfViewer=e}setThumbnailViewer(e){this.pdfThumbnailViewer=e}isHighestPriority(e){return this.highestPriorityPage===e.renderingId}hasViewer(){return!!this.pdfViewer}renderHighestPriority(e){var t,i;this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),(null===(t=this.pdfViewer)||void 0===t?void 0:t.forceRendering(e))||this.isThumbnailViewEnabled&&(null===(i=this.pdfThumbnailViewer)||void 0===i?void 0:i.forceRendering())||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),CLEANUP_TIMEOUT))}getHighestPriority(e,t,i,n=!1){const s=e.views,r=s.length;if(0===r)return null;for(let e=0;e<r;e++){const t=s[e].view;if(!this.isViewFinished(t))return t}const a=e.first.id,o=e.last.id;if(o-a+1>r){const n=e.ids;for(let e=1,s=o-a;e<s;e++){const s=i?a+e:o-e;if(n.has(s))continue;const r=t[s-1];if(!this.isViewFinished(r))return r}}let l=i?o:a-2,h=t[l];return h&&!this.isViewFinished(h)||n&&(l+=i?1:-1,h=t[l],h&&!this.isViewFinished(h))?h:null}isViewFinished(e){return e.renderingState===RenderingStates.FINISHED}renderView(e){switch(e.renderingState){case RenderingStates.FINISHED:return!1;case RenderingStates.PAUSED:this.highestPriorityPage=e.renderingId,e.resume();break;case RenderingStates.RUNNING:this.highestPriorityPage=e.renderingId;break;case RenderingStates.INITIAL:this.highestPriorityPage=e.renderingId,e.draw().finally((()=>{this.renderHighestPriority()})).catch((e=>{e instanceof pdfExports.RenderingCancelledException||console.error(`renderView: "${e}"`)}))}return!0}}var _a,_TempImageFactory_tempCanvas;const DRAW_UPSCALE_FACTOR=2,MAX_NUM_SCALING_STEPS=3;class TempImageFactory{static getCanvas(e,t){const i=__classPrivateFieldSet(this,_a,__classPrivateFieldGet(this,_a,"f",_TempImageFactory_tempCanvas)||document.createElement("canvas"),"f",_TempImageFactory_tempCanvas);i.width=e,i.height=t;const n=i.getContext("2d",{alpha:!1});n.save(),n.fillStyle="rgb(255, 255, 255)",n.fillRect(0,0,e,t),n.restore();const s=i.getContext("2d");return[i,s]}static destroyCanvas(){const e=__classPrivateFieldGet(this,_a,"f",_TempImageFactory_tempCanvas);e&&(e.width=0,e.height=0),__classPrivateFieldSet(this,_a,null,"f",_TempImageFactory_tempCanvas)}}_a=TempImageFactory,_TempImageFactory_tempCanvas={value:null};class PDFThumbnailView{constructor({container:e,eventBus:t,id:i,defaultViewport:n,optionalContentConfigPromise:s,linkService:r,renderingQueue:a,l10n:o,pageColors:l,store:h,thumbnailWidth:c}){this.container=e,this.eventBus=t,this.id=i,this.renderingId="thumbnail"+i,this.pageLabel=null,this.store=h,this.loaded=!1,this.pdfPage=null,this.rotation=0,this.viewport=n,this.pdfPageRotate=n.rotation,this._optionalContentConfigPromise=s||null,this.pageColors=l||null,this.linkService=r,this.renderingQueue=a,this.renderTask=null,this.renderingState=RenderingStates.INITIAL,this.resume=null;const d=this.viewport.width,u=d/this.viewport.height;this.canvasWidth=c,this.canvasHeight=this.canvasWidth/u|0,this.scale=this.canvasWidth/d,this.l10n=o,this.canvas=null,this.src=null;const p=document.createElement("div");p.className="thumbnail pdfSlickThumbHolder",p.setAttribute("data-page-number",this.id.toString()),this.div=p,e.append(p)}setPdfPage(e){this.pdfPage=e,this.pdfPageRotate=e.rotate;const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:1,rotation:t}),this.reset()}reset(){this.cancelRendering(),this.renderingState=RenderingStates.INITIAL;const e=this.viewport.width,t=e/this.viewport.height;this.canvasHeight=this.canvasWidth/t|0,this.scale=this.canvasWidth/e,this.div.removeAttribute("data-loaded"),this.loaded=!1,this.canvas&&(this.canvas.width=0,this.canvas.height=0,delete this.canvas)}update({rotation:e=null}){"number"==typeof e&&(this.rotation=e);const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:1,rotation:t}),this.reset()}cancelRendering(){this.renderTask&&(this.renderTask.cancel(),this.renderTask=null),this.resume=null}_getPageDrawContext(e=1){const t=document.createElement("canvas"),i=t.getContext("2d",{alpha:!1}),n=new OutputScale;t.width=e*this.canvasWidth*n.sx|0,t.height=e*this.canvasHeight*n.sy|0;return{ctx:i,canvas:t,transform:n.scaled?[n.sx,0,0,n.sy,0,0]:null}}_convertCanvasToImage(e){if(this.renderingState!==RenderingStates.FINISHED)throw new Error("_convertCanvasToImage: Rendering has not finished.");const t=this._reduceImage(e);this.src=t.toDataURL(),this.div.setAttribute("data-loaded","true"),this.loaded=!0,this.store.getState()._setThumbnailView(this.id,this),t.width=0,t.height=0}draw(){if(this.renderingState!==RenderingStates.INITIAL)return console.error("Must be in new state before drawing"),Promise.resolve();const{pdfPage:e}=this;if(!e)return this.renderingState=RenderingStates.FINISHED,Promise.reject(new Error("pdfPage is not loaded"));this.renderingState=RenderingStates.RUNNING;const t=(e=null)=>__awaiter(this,void 0,void 0,(function*(){if(a===this.renderTask&&(this.renderTask=null),!(e instanceof pdfExports.RenderingCancelledException)&&(this.renderingState=RenderingStates.FINISHED,this._convertCanvasToImage(n),e))throw e})),{ctx:i,canvas:n,transform:s}=this._getPageDrawContext(DRAW_UPSCALE_FACTOR),r={canvasContext:i,transform:s,viewport:this.viewport.clone({scale:DRAW_UPSCALE_FACTOR*this.scale}),optionalContentConfigPromise:this._optionalContentConfigPromise,pageColors:this.pageColors},a=this.renderTask=e.render(r);a.onContinue=e=>{if(!this.renderingQueue.isHighestPriority(this))return this.renderingState=RenderingStates.PAUSED,void(this.resume=()=>{this.renderingState=RenderingStates.RUNNING,e()});e()};const o=a.promise.then((function(){return t(null)}),(function(e){return t(e)}));return o.finally((()=>{n.width=0,n.height=0,this.eventBus.dispatch("thumbnailrendered",{source:this,pageNumber:this.id,pdfPage:this.pdfPage})})),o}setImage(e){if(this.renderingState!==RenderingStates.INITIAL)return;const{thumbnailCanvas:t,pdfPage:i,scale:n}=e;t&&(this.pdfPage||this.setPdfPage(i),n<this.scale||(this.renderingState=RenderingStates.FINISHED,this._convertCanvasToImage(t)))}_reduceImage(e){const{ctx:t,canvas:i}=this._getPageDrawContext();if(e.width<=2*i.width)return t.drawImage(e,0,0,e.width,e.height,0,0,i.width,i.height),i;let n=i.width<<MAX_NUM_SCALING_STEPS,s=i.height<<MAX_NUM_SCALING_STEPS;const[r,a]=TempImageFactory.getCanvas(n,s);for(;n>e.width||s>e.height;)n>>=1,s>>=1;for(a.drawImage(e,0,0,e.width,e.height,0,0,n,s);n>2*i.width;)a.drawImage(r,0,0,n,s,0,0,n>>1,s>>1),n>>=1,s>>=1;return t.drawImage(r,0,0,n,s,0,0,i.width,i.height),i}get _thumbPageTitle(){var e;return this.l10n.get("thumb_page_title",{page:null!==(e=this.pageLabel)&&void 0!==e?e:this.id})}get _thumbPageCanvas(){var e;return this.l10n.get("thumb_page_canvas",{page:null!==(e=this.pageLabel)&&void 0!==e?e:this.id})}setPageLabel(e){this.pageLabel="string"==typeof e?e:null}}var _PDFThumbnailViewer_instances,_PDFThumbnailViewer_ensurePdfPageLoaded,_PDFThumbnailViewer_getScrollAhead;const THUMBNAIL_SCROLL_MARGIN=-19,THUMBNAIL_SELECTED_CLASS="selected";class PDFThumbnailViewer{constructor({container:e,eventBus:t,linkService:i,renderingQueue:n,l10n:s,pageColors:r,store:a,thumbnailWidth:o}){_PDFThumbnailViewer_instances.add(this),this.container=e,this.eventBus=t,this.linkService=i,this.renderingQueue=n,this.l10n=s,this.pageColors=r||null,this._thumbnails=[],this._currentPageNumber=0,this._pagesRotation=0,this._pageLabels=[],this.pdfDocument=null,this.store=a,this.thumbnailWidth=o,!this.pageColors||CSS.supports("color",this.pageColors.background)&&CSS.supports("color",this.pageColors.foreground)||((this.pageColors.background||this.pageColors.foreground)&&console.warn("PDFThumbnailViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."),this.pageColors=null),this.scroll=watchScroll(this.container,this._scrollUpdated.bind(this)),this._resetView()}_scrollUpdated(){this.renderingQueue.renderHighestPriority()}getThumbnail(e){return this._thumbnails[e]}_getVisibleThumbs(){return getVisibleElements({scrollEl:this.container,views:this._thumbnails})}scrollThumbnailIntoView(e){if(!this.pdfDocument)return;const t=this._thumbnails[e-1];if(!t)return void console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.');if(e!==this._currentPageNumber){this._thumbnails[this._currentPageNumber-1].div.classList.remove(THUMBNAIL_SELECTED_CLASS),t.div.classList.add(THUMBNAIL_SELECTED_CLASS)}const i=this._getVisibleThumbs(),{first:n,last:s,views:r}=i;if(r.length>0){let i=!1;if(e<=n.id||e>=(null==s?void 0:s.id))i=!0;else for(const{id:t,percent:n}of r)if(t===e){i=n<100;break}i&&scrollIntoView(t.div,{top:THUMBNAIL_SCROLL_MARGIN})}this._currentPageNumber=e,this.forceRendering()}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!isValidRotation(e))throw new Error("Invalid thumbnails rotation angle.");if(!this.pdfDocument)return;if(this._pagesRotation===e)return;this._pagesRotation=e;const t={rotation:e};for(const e of this._thumbnails)e.update(t)}cleanup(){for(const e of this._thumbnails)e.renderingState!==RenderingStates.FINISHED&&e.reset();TempImageFactory.destroyCanvas()}_resetView(){this._thumbnails=[],this._currentPageNumber=1,this._pageLabels=[],this._pagesRotation=0,this.container.textContent=""}setDocument(e){if(this.pdfDocument&&(this._cancelRendering(),this._resetView()),this.pdfDocument=e,!e)return;const t=e.getPage(1),i=e.getOptionalContentConfig();t.then((t=>{var n;const s=e.numPages,r=t.getViewport({scale:1});for(let e=1;e<=s;++e){const t=new PDFThumbnailView({container:this.container,eventBus:this.eventBus,id:e,defaultViewport:r.clone(),optionalContentConfigPromise:i,linkService:this.linkService,renderingQueue:this.renderingQueue,l10n:this.l10n,pageColors:this.pageColors,store:this.store,thumbnailWidth:this.thumbnailWidth});this._thumbnails.push(t)}null===(n=this._thumbnails[0])||void 0===n||n.setPdfPage(t);this._thumbnails[this._currentPageNumber-1].div.classList.add(THUMBNAIL_SELECTED_CLASS),this.store.getState()._setThumbnailsViews(this._thumbnails)})).catch((e=>{console.error("Unable to initialize thumbnail viewer",e)}))}_cancelRendering(){for(const e of this._thumbnails)e.cancelRendering()}setPageLabels(e){var t,i;if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=[],console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.")):this._pageLabels=[];for(let e=0,n=this._thumbnails.length;e<n;e++)this._thumbnails[e].setPageLabel(null!==(i=null===(t=this._pageLabels)||void 0===t?void 0:t[e])&&void 0!==i?i:null)}}forceRendering(){const e=this._getVisibleThumbs(),t=__classPrivateFieldGet(this,_PDFThumbnailViewer_instances,"m",_PDFThumbnailViewer_getScrollAhead).call(this,e),i=this.renderingQueue.getHighestPriority(e,this._thumbnails,t);return!!i&&(__classPrivateFieldGet(this,_PDFThumbnailViewer_instances,"m",_PDFThumbnailViewer_ensurePdfPageLoaded).call(this,i).then((()=>{this.renderingQueue.renderView(i)})),!0)}}var _OverlayManager_overlays,_OverlayManager_active;_PDFThumbnailViewer_instances=new WeakSet,_PDFThumbnailViewer_ensurePdfPageLoaded=function(e){var t;return __awaiter(this,void 0,void 0,(function*(){if(null==e?void 0:e.pdfPage)return e.pdfPage;try{const i=yield null===(t=this.pdfDocument)||void 0===t?void 0:t.getPage(e.id);return(null==e?void 0:e.pdfPage)||e.setPdfPage(i),i}catch(e){return console.error("Unable to get page for thumb view",e),null}}))},_PDFThumbnailViewer_getScrollAhead=function(e){var t,i;return 1===(null===(t=e.first)||void 0===t?void 0:t.id)||(null===(i=e.last)||void 0===i?void 0:i.id)!==this._thumbnails.length&&this.scroll.down};class OverlayManager{constructor(){_OverlayManager_overlays.set(this,new WeakMap),_OverlayManager_active.set(this,null)}get active(){return __classPrivateFieldGet(this,_OverlayManager_active,"f")}register(e,t=!1){return __awaiter(this,void 0,void 0,(function*(){if("object"!=typeof e)throw new Error("Not enough parameters.");if(__classPrivateFieldGet(this,_OverlayManager_overlays,"f").has(e))throw new Error("The overlay is already registered.");__classPrivateFieldGet(this,_OverlayManager_overlays,"f").set(e,{canForceClose:t}),e.addEventListener("cancel",(()=>{__classPrivateFieldSet(this,_OverlayManager_active,null,"f")}))}))}unregister(e){return __awaiter(this,void 0,void 0,(function*(){if(!__classPrivateFieldGet(this,_OverlayManager_overlays,"f").has(e))throw new Error("The overlay does not exist.");if(__classPrivateFieldGet(this,_OverlayManager_active,"f")===e)throw new Error("The overlay cannot be removed while it is active.");__classPrivateFieldGet(this,_OverlayManager_overlays,"f").delete(e)}))}open(e){return __awaiter(this,void 0,void 0,(function*(){if(!__classPrivateFieldGet(this,_OverlayManager_overlays,"f").has(e))throw new Error("The overlay does not exist.");if(__classPrivateFieldGet(this,_OverlayManager_active,"f")){if(__classPrivateFieldGet(this,_OverlayManager_active,"f")===e)throw new Error("The overlay is already active.");if(!__classPrivateFieldGet(this,_OverlayManager_overlays,"f").get(e).canForceClose)throw new Error("Another overlay is currently active.");yield this.close()}__classPrivateFieldSet(this,_OverlayManager_active,e,"f"),e.showModal()}))}close(e=__classPrivateFieldGet(this,_OverlayManager_active,"f")){return __awaiter(this,void 0,void 0,(function*(){if(!e||!__classPrivateFieldGet(this,_OverlayManager_overlays,"f").has(e))throw new Error("The overlay does not exist.");if(!__classPrivateFieldGet(this,_OverlayManager_active,"f"))throw new Error("The overlay is currently not active.");if(__classPrivateFieldGet(this,_OverlayManager_active,"f")!==e)throw new Error("Another overlay is currently active.");e.close(),__classPrivateFieldSet(this,_OverlayManager_active,null,"f")}))}}function getXfaHtmlForPrinting(e,t){const i=t.allXfaHtml,n=new pdf_viewerExports.SimpleLinkService,s=Math.round(100*pdfExports.PixelsPerInch.PDF_TO_CSS_UNITS)/100;for(const r of null==i?void 0:i.children){const i=document.createElement("div");i.className="xfaPrintedPage",e.append(i);const a=new pdf_viewerExports.XfaLayerBuilder({pageDiv:i,pdfPage:null,annotationStorage:t.annotationStorage,linkService:n,xfaHtml:r}),o=pdfExports.getXfaPageViewport(r,{scale:s});a.render(o,"print")}}_OverlayManager_overlays=new WeakMap,_OverlayManager_active=new WeakMap;let activeService=null,dialog=null,overlayManager=new OverlayManager;function renderPage(e,t,i,n,s,r,a){const o=activeService.scratchCanvas,l=s/pdfExports.PixelsPerInch.PDF;o.width=Math.floor(n.width*l),o.height=Math.floor(n.height*l);const h=o.getContext("2d");return h.save(),h.fillStyle="rgb(255, 255, 255)",h.fillRect(0,0,o.width,o.height),h.restore(),Promise.all([t.getPage(i),a]).then((function([e,t]){const i={canvasContext:h,transform:[l,0,0,l,0,0],viewport:e.getViewport({scale:1,rotation:n.rotation}),intent:"print",annotationMode:pdfExports.AnnotationMode.ENABLE_STORAGE,optionalContentConfigPromise:r,printAnnotationStorage:t};return e.render(i).promise}))}class PDFPrintService{constructor(e,t,i,n,s=null,r=null,a){this.pdfDocument=e,this.pagesOverview=t,this.printContainer=i,this._printResolution=n||150,this._optionalContentConfigPromise=s||e.getOptionalContentConfig(),this._printAnnotationStoragePromise=r||Promise.resolve(),this.l10n=a,this.currentPage=-1,this.scratchCanvas=document.createElement("canvas")}layout(){this.throwIfInactive();const e=document.querySelector("body");null==e||e.setAttribute("data-pdfjsprinting","true");this.pagesOverview.every((e=>e.width===this.pagesOverview[0].width&&e.height===this.pagesOverview[0].height),this)||console.warn("Not all pages have the same size. The printed result may be incorrect!"),this.pageStyleSheet=document.createElement("style");const t=this.pagesOverview[0];this.pageStyleSheet.textContent="@page { size: "+t.width+"pt "+t.height+"pt;}",null==e||e.append(this.pageStyleSheet)}destroy(){if(activeService!==this)return;this.printContainer.textContent="";const e=document.querySelector("body");null==e||e.removeAttribute("data-pdfjsprinting"),this.pageStyleSheet&&(this.pageStyleSheet.remove(),this.pageStyleSheet=null),this.scratchCanvas.width=this.scratchCanvas.height=0,this.scratchCanvas=null,activeService=null,ensureOverlay().then((function(){overlayManager.active===dialog&&overlayManager.close(dialog)}))}renderPages(){if(this.pdfDocument.isPureXfa)return getXfaHtmlForPrinting(this.printContainer,this.pdfDocument),Promise.resolve();const e=this.pagesOverview.length,t=(i,n)=>{if(this.throwIfInactive(),++this.currentPage>=e)return renderProgress(e,e,this.l10n),void i();const s=this.currentPage;renderProgress(s,e,this.l10n),renderPage(this,this.pdfDocument,s+1,this.pagesOverview[s],this._printResolution,this._optionalContentConfigPromise,this._printAnnotationStoragePromise).then(this.useRenderedPage.bind(this)).then((function(){t(i,n)}),n)};return new Promise(t)}useRenderedPage(){this.throwIfInactive();const e=document.createElement("img"),t=this.scratchCanvas;"toBlob"in t?t.toBlob((function(t){e.src=URL.createObjectURL(t)})):e.src=t.toDataURL();const i=document.createElement("div");return i.className="printedPage",i.append(e),this.printContainer.append(i),new Promise((function(t,i){e.onload=t,e.onerror=i}))}performPrint(){return this.throwIfInactive(),new Promise((e=>{setTimeout((()=>{this.active?(print.call(window),setTimeout(e,20)):e()}),0)}))}get active(){return this===activeService}throwIfInactive(){if(!this.active)throw new Error("This print request was cancelled or completed.")}}const print=window.print;function dispatchEvent(e){const t=document.createEvent("CustomEvent");t.initCustomEvent(e,!1,!1,"custom"),window.dispatchEvent(t)}function abort(){activeService&&(activeService.destroy(),dispatchEvent("afterprint"))}function renderProgress(e,t,i){dialog||(dialog=document.getElementById("printServiceDialog"));const n=Math.round(100*e/t),s=dialog.querySelector("progress"),r=dialog.querySelector(".relative-progress");s.value=n,i.get("print_progress_percent",{progress:n}).then((e=>{r.textContent=e}))}if(window.print=function(){if(activeService)console.warn("Ignored window.print() because of a pending print job.");else{ensureOverlay().then((function(){activeService&&overlayManager.open(dialog)}));try{dispatchEvent("beforeprint")}finally{if(!activeService)return console.error("Expected print service to be initialized."),void ensureOverlay().then((function(){overlayManager.active===dialog&&overlayManager.close(dialog)}));const e=activeService;activeService.renderPages().then((function(){return e.performPrint()})).catch((function(){})).then((function(){e.active&&abort()}))}}},window.addEventListener("keydown",(function(e){80!==e.keyCode||!e.ctrlKey&&!e.metaKey||e.altKey||e.shiftKey||(window.print(),e.preventDefault(),e.stopImmediatePropagation())}),!0),"onbeforeprint"in window){const e=function(e){"custom"!==e.detail&&e.stopImmediatePropagation()};window.addEventListener("beforeprint",e),window.addEventListener("afterprint",e)}let overlayPromise;function ensureOverlay(){if(!overlayPromise){if(!overlayManager)throw new Error("The overlay manager has not yet been initialized.");dialog||(dialog=document.getElementById("printServiceDialog")),overlayPromise=overlayManager.register(dialog,!0),document.getElementById("printCancel").onclick=abort,dialog.addEventListener("close",abort)}return overlayPromise}const PDFPrintServiceFactory={instance:{supportsPrinting:!0,createPrintService(e,t,i,n,s,r,a){if(activeService)throw new Error("The print service is created and active.");return activeService=new PDFPrintService(e,t,i,n,s,r,a),activeService}}};var _PDFPresentationMode_instances,_PDFPresentationMode_state,_PDFPresentationMode_args,_PDFPresentationMode_mouseWheel,_PDFPresentationMode_notifyStateChange,_PDFPresentationMode_enter,_PDFPresentationMode_exit,_PDFPresentationMode_mouseDown,_PDFPresentationMode_contextMenu,_PDFPresentationMode_showControls,_PDFPresentationMode_hideControls,_PDFPresentationMode_resetMouseScrollState,_PDFPresentationMode_touchSwipe,_PDFPresentationMode_addWindowListeners,_PDFPresentationMode_removeWindowListeners,_PDFPresentationMode_fullscreenChange,_PDFPresentationMode_addFullscreenChangeListeners,_PDFPresentationMode_removeFullscreenChangeListeners;const DELAY_BEFORE_HIDING_CONTROLS=3e3,ACTIVE_SELECTOR="pdfPresentationMode",CONTROLS_SELECTOR="pdfPresentationModeControls",MOUSE_SCROLL_COOLDOWN_TIME=50,PAGE_SWITCH_THRESHOLD=.1,SWIPE_MIN_DISTANCE_THRESHOLD=50,SWIPE_ANGLE_THRESHOLD=Math.PI/6;class PDFPresentationMode{constructor({container:e,pdfViewer:t,eventBus:i}){_PDFPresentationMode_instances.add(this),_PDFPresentationMode_state.set(this,PresentationModeState.UNKNOWN),_PDFPresentationMode_args.set(this,null),this.container=e,this.pdfViewer=t,this.eventBus=i,this.contextMenuOpen=!1,this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0,this.touchSwipeState=null}request(){return __awaiter(this,void 0,void 0,(function*(){const{container:e,pdfViewer:t}=this;if(this.active||!t.pagesCount||!e.requestFullscreen)return!1;__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_addFullscreenChangeListeners).call(this),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_notifyStateChange).call(this,PresentationModeState.CHANGING);const i=e.requestFullscreen();__classPrivateFieldSet(this,_PDFPresentationMode_args,{pageNumber:t.currentPageNumber,scaleValue:t.currentScaleValue,scrollMode:t.scrollMode,spreadMode:null,annotationEditorMode:null},"f"),t.spreadMode===SpreadMode.NONE||t.pageViewsReady&&t.hasEqualPageSizes||(console.warn("Ignoring Spread modes when entering PresentationMode, since the document may contain varying page sizes."),__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").spreadMode=t.spreadMode),t.annotationEditorMode!==pdfExports.AnnotationEditorType.DISABLE&&(__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").annotationEditorMode=t.annotationEditorMode);try{return yield i,t.focus(),!0}catch(e){__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_removeFullscreenChangeListeners).call(this),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_notifyStateChange).call(this,PresentationModeState.NORMAL)}return!1}))}get active(){return __classPrivateFieldGet(this,_PDFPresentationMode_state,"f")===PresentationModeState.CHANGING||__classPrivateFieldGet(this,_PDFPresentationMode_state,"f")===PresentationModeState.FULLSCREEN}}_PDFPresentationMode_state=new WeakMap,_PDFPresentationMode_args=new WeakMap,_PDFPresentationMode_instances=new WeakSet,_PDFPresentationMode_mouseWheel=function(e){if(!this.active)return;e.preventDefault();const t=normalizeWheelEventDelta(e),i=Date.now(),n=this.mouseScrollTimeStamp;if(!(i>n&&i-n<MOUSE_SCROLL_COOLDOWN_TIME)&&((this.mouseScrollDelta>0&&t<0||this.mouseScrollDelta<0&&t>0)&&__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_resetMouseScrollState).call(this),this.mouseScrollDelta+=t,Math.abs(this.mouseScrollDelta)>=PAGE_SWITCH_THRESHOLD)){const e=this.mouseScrollDelta;__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_resetMouseScrollState).call(this);(e>0?this.pdfViewer.previousPage():this.pdfViewer.nextPage())&&(this.mouseScrollTimeStamp=i)}},_PDFPresentationMode_notifyStateChange=function(e){__classPrivateFieldSet(this,_PDFPresentationMode_state,e,"f"),this.eventBus.dispatch("presentationmodechanged",{source:this,state:e})},_PDFPresentationMode_enter=function(){var e;__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_notifyStateChange).call(this,PresentationModeState.FULLSCREEN),this.container.classList.add(ACTIVE_SELECTOR),setTimeout((()=>{this.pdfViewer.scrollMode=ScrollMode.PAGE,null!==__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").spreadMode&&(this.pdfViewer.spreadMode=SpreadMode.NONE),this.pdfViewer.currentPageNumber=__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").pageNumber,this.pdfViewer.currentScaleValue="page-fit",null!==__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").annotationEditorMode&&(this.pdfViewer.annotationEditorMode=pdfExports.AnnotationEditorType.NONE)}),0),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_addWindowListeners).call(this),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_showControls).call(this),this.contextMenuOpen=!1,null===(e=window.getSelection())||void 0===e||e.removeAllRanges()},_PDFPresentationMode_exit=function(){const e=this.pdfViewer.currentPageNumber;this.container.classList.remove(ACTIVE_SELECTOR),setTimeout((()=>{var t;__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_removeFullscreenChangeListeners).call(this),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_notifyStateChange).call(this,PresentationModeState.NORMAL),this.pdfViewer.scrollMode=__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").scrollMode,null!==(null===(t=__classPrivateFieldGet(this,_PDFPresentationMode_args,"f"))||void 0===t?void 0:t.spreadMode)&&(this.pdfViewer.spreadMode=__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").spreadMode),this.pdfViewer.currentScaleValue=__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").scaleValue,this.pdfViewer.currentPageNumber=e,null!==__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").annotationEditorMode&&(this.pdfViewer.annotationEditorMode=__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").annotationEditorMode),__classPrivateFieldSet(this,_PDFPresentationMode_args,null,"f")}),0),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_removeWindowListeners).call(this),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_hideControls).call(this),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_resetMouseScrollState).call(this),this.contextMenuOpen=!1},_PDFPresentationMode_mouseDown=function(e){var t;if(this.contextMenuOpen)return this.contextMenuOpen=!1,void e.preventDefault();0===e.button&&(e.target.href&&(null===(t=e.target.parentNode)||void 0===t?void 0:t.hasAttribute("data-internal-link"))||(e.preventDefault(),e.shiftKey?this.pdfViewer.previousPage():this.pdfViewer.nextPage()))},_PDFPresentationMode_contextMenu=function(){this.contextMenuOpen=!0},_PDFPresentationMode_showControls=function(){this.controlsTimeout?clearTimeout(this.controlsTimeout):this.container.classList.add(CONTROLS_SELECTOR),this.controlsTimeout=setTimeout((()=>{this.container.classList.remove(CONTROLS_SELECTOR),delete this.controlsTimeout}),DELAY_BEFORE_HIDING_CONTROLS)},_PDFPresentationMode_hideControls=function(){this.controlsTimeout&&(clearTimeout(this.controlsTimeout),this.container.classList.remove(CONTROLS_SELECTOR),delete this.controlsTimeout)},_PDFPresentationMode_resetMouseScrollState=function(){this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0},_PDFPresentationMode_touchSwipe=function(e){if(this.active)if(e.touches.length>1)this.touchSwipeState=null;else switch(e.type){case"touchstart":this.touchSwipeState={startX:e.touches[0].pageX,startY:e.touches[0].pageY,endX:e.touches[0].pageX,endY:e.touches[0].pageY};break;case"touchmove":if(null===this.touchSwipeState)return;this.touchSwipeState.endX=e.touches[0].pageX,this.touchSwipeState.endY=e.touches[0].pageY,e.preventDefault();break;case"touchend":if(null===this.touchSwipeState)return;let t=0;const i=this.touchSwipeState.endX-this.touchSwipeState.startX,n=this.touchSwipeState.endY-this.touchSwipeState.startY,s=Math.abs(Math.atan2(n,i));Math.abs(i)>SWIPE_MIN_DISTANCE_THRESHOLD&&(s<=SWIPE_ANGLE_THRESHOLD||s>=Math.PI-SWIPE_ANGLE_THRESHOLD)?t=i:Math.abs(n)>SWIPE_MIN_DISTANCE_THRESHOLD&&Math.abs(s-Math.PI/2)<=SWIPE_ANGLE_THRESHOLD&&(t=n),t>0?this.pdfViewer.previousPage():t<0&&this.pdfViewer.nextPage()}},_PDFPresentationMode_addWindowListeners=function(){this.showControlsBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_showControls).bind(this),this.mouseDownBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_mouseDown).bind(this),this.mouseWheelBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_mouseWheel).bind(this),this.resetMouseScrollStateBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_resetMouseScrollState).bind(this),this.contextMenuBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_contextMenu).bind(this),this.touchSwipeBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_touchSwipe).bind(this),window.addEventListener("mousemove",this.showControlsBind),window.addEventListener("mousedown",this.mouseDownBind),window.addEventListener("wheel",this.mouseWheelBind,{passive:!1}),window.addEventListener("keydown",this.resetMouseScrollStateBind),window.addEventListener("contextmenu",this.contextMenuBind),window.addEventListener("touchstart",this.touchSwipeBind),window.addEventListener("touchmove",this.touchSwipeBind),window.addEventListener("touchend",this.touchSwipeBind)},_PDFPresentationMode_removeWindowListeners=function(){window.removeEventListener("mousemove",this.showControlsBind),window.removeEventListener("mousedown",this.mouseDownBind),window.removeEventListener("wheel",this.mouseWheelBind,{passive:!1}),window.removeEventListener("keydown",this.resetMouseScrollStateBind),window.removeEventListener("contextmenu",this.contextMenuBind),window.removeEventListener("touchstart",this.touchSwipeBind),window.removeEventListener("touchmove",this.touchSwipeBind),window.removeEventListener("touchend",this.touchSwipeBind),delete this.showControlsBind,delete this.mouseDownBind,delete this.mouseWheelBind,delete this.resetMouseScrollStateBind,delete this.contextMenuBind,delete this.touchSwipeBind},_PDFPresentationMode_fullscreenChange=function(){document.fullscreenElement?__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_enter).call(this):__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_exit).call(this)},_PDFPresentationMode_addFullscreenChangeListeners=function(){this.fullscreenChangeBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_fullscreenChange).bind(this),window.addEventListener("fullscreenchange",this.fullscreenChangeBind)},_PDFPresentationMode_removeFullscreenChangeListeners=function(){window.removeEventListener("fullscreenchange",this.fullscreenChangeBind),delete this.fullscreenChangeBind};const initialState={isDocumentLoaded:!1,pagesReady:!1,url:null,numPages:0,pageNumber:0,scale:0,scaleValue:"auto",pagesRotation:0,spreadMode:SpreadMode.UNKNOWN,scrollMode:ScrollMode.UNKNOWN,documentOutline:null,attachments:new Map,thumbnails:new Map,thumbnailViews:new Map,annotationEditorMode:pdfExports.AnnotationEditorType.NONE,pdfSlick:null},create=()=>createStore$1(((e,t)=>Object.assign(Object.assign({},initialState),{_setThumbnailView:(i,n)=>{const s=new Map(t().thumbnails),r=new Map(t().thumbnailViews),{canvasWidth:a,canvasHeight:o,scale:l,rotation:h,loaded:c,pageLabel:d,src:u=null}=n;r.set(i,n),s.set(i,{pageNumber:i,width:a,height:o,scale:l,rotation:h,loaded:c,pageLabel:d,src:u}),e({thumbnailViews:r,thumbnails:s})},_setThumbnailsViews:t=>{const i=new Map(t.map((e=>[e.id,e]))),n=new Map(t.map((e=>{const{canvasWidth:t,canvasHeight:i,scale:n,rotation:s,loaded:r,pageLabel:a,src:o=null}=e;return[e.id,{pageNumber:e.id,width:t,height:i,scale:n,rotation:s,loaded:r,pageLabel:a,src:o}]})));e({thumbnailViews:i,thumbnails:n})}})));var _PDFSlick_instances,_PDFSlick_renderingQueue,_PDFSlick_container,_PDFSlick_viewerContainer,_PDFSlick_thumbsContainer,_PDFSlick_annotationMode,_PDFSlick_annotationEditorMode,_PDFSlick_initializePageLabels,_PDFSlick_parseDocumentInfo,_PDFSlick_parsePageSize,_PDFSlick_initInternalEventListeners,_PDFSlick_onDocumentReady,_PDFSlick_onRotationChanging,_PDFSlick_onSwitchSpreadMode,_PDFSlick_onSwitchScrollMode,_PDFSlick_onScaleChanging,_PDFSlick_onPageChanging,_PDFSlick_onPageRendered;pdfExports.GlobalWorkerOptions.workerSrc=`//cdn.jsdelivr.net/npm/pdfjs-dist@${pdfExports.version}/build/pdf.worker.min.js`;const US_PAGE_NAMES={"8.5x11":"Letter","8.5x14":"Legal"},METRIC_PAGE_NAMES={"297x420":"A3","210x297":"A4"};function getPageName(e,t,i){return i[`${t?e.width:e.height}x${t?e.height:e.width}`]}class PDFSlick{constructor({container:e,viewer:t,thumbs:i,store:n=create(),options:s}){var r,a,o,l,h,c,d,u,p,g,f,m,_;_PDFSlick_instances.add(this),_PDFSlick_renderingQueue.set(this,void 0),_PDFSlick_container.set(this,void 0),_PDFSlick_viewerContainer.set(this,void 0),_PDFSlick_thumbsContainer.set(this,void 0),this.downloadManager=null,this.findController=null,this.pdfPresentationMode=null,this.document=null,_PDFSlick_annotationMode.set(this,void 0),_PDFSlick_annotationEditorMode.set(this,void 0),__classPrivateFieldSet(this,_PDFSlick_container,e,"f"),__classPrivateFieldSet(this,_PDFSlick_viewerContainer,t,"f"),__classPrivateFieldSet(this,_PDFSlick_thumbsContainer,i,"f"),this.l10n=null!==(r=null==s?void 0:s.l10n)&&void 0!==r?r:pdf_viewerExports.NullL10n,this.downloadManager=new pdf_viewerExports.DownloadManager,this.textLayerMode=null!==(a=null==s?void 0:s.textLayerMode)&&void 0!==a?a:TextLayerMode.ENABLE,__classPrivateFieldSet(this,_PDFSlick_annotationMode,null!==(o=null==s?void 0:s.annotationMode)&&void 0!==o?o:pdfExports.AnnotationMode.ENABLE_FORMS,"f"),__classPrivateFieldSet(this,_PDFSlick_annotationEditorMode,null!==(l=null==s?void 0:s.annotationEditorMode)&&void 0!==l?l:pdfExports.AnnotationEditorType.NONE,"f"),this.removePageBorders=null!==(h=null==s?void 0:s.removePageBorders)&&void 0!==h&&h,this.singlePageViewer=null!==(c=null==s?void 0:s.singlePageViewer)&&void 0!==c&&c,this.enablePrintAutoRotate=null!==(d=null==s?void 0:s.enablePrintAutoRotate)&&void 0!==d&&d,this.useOnlyCssZoom=null!==(u=null==s?void 0:s.useOnlyCssZoom)&&void 0!==u&&u,this.pageColors=null!==(p=null==s?void 0:s.pageColors)&&void 0!==p?p:null,this.maxCanvasPixels=null!==(g=null==s?void 0:s.maxCanvasPixels)&&void 0!==g?g:16777216,this.printResolution=null!==(f=null==s?void 0:s.printResolution)&&void 0!==f?f:96,this.thumbnailWidth=null!==(m=null==s?void 0:s.thumbnailWidth)&&void 0!==m?m:125,!this.pageColors||CSS.supports("color",this.pageColors.background)&&CSS.supports("color",this.pageColors.foreground)||((this.pageColors.background||this.pageColors.foreground)&&console.warn("PDFViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."),this.pageColors=null),this.l10n=pdf_viewerExports.NullL10n,this.store=n;const v=new PDFRenderingQueue;v.onIdle=this._cleanup.bind(this),v.isThumbnailViewEnabled=!0,__classPrivateFieldSet(this,_PDFSlick_renderingQueue,v,"f");const b=new pdf_viewerExports.EventBus,y=new pdf_viewerExports.PDFLinkService({eventBus:b,externalLinkTarget:2,externalLinkRel:"noopener noreferrer nofollow",ignoreDestinationZoom:!1}),S=Object.assign(Object.assign({container:e},t&&{viewer:t}),{eventBus:b,linkService:y,renderingQueue:v,defaultRenderingQueue:!0,textLayerMode:this.textLayerMode,l10n:this.l10n,annotationMode:__classPrivateFieldGet(this,_PDFSlick_annotationMode,"f"),annotationEditorMode:__classPrivateFieldGet(this,_PDFSlick_annotationEditorMode,"f"),removePageBorders:this.removePageBorders,imageResourcesPath:"/images/",useOnlyCssZoom:this.useOnlyCssZoom}),P=this.singlePageViewer?new pdf_viewerExports.PDFSinglePageViewer(S):new pdf_viewerExports.PDFViewer(S);v.setViewer(P),i&&(this.thumbnailViewer=new PDFThumbnailViewer({container:i,eventBus:b,linkService:y,renderingQueue:v,l10n:this.l10n,pageColors:this.pageColors,store:n,thumbnailWidth:this.thumbnailWidth}),v.setThumbnailViewer(this.thumbnailViewer)),document.fullscreenEnabled&&(this.pdfPresentationMode=new PDFPresentationMode({container:e,pdfViewer:P,eventBus:b})),this.eventBus=b,this.linkService=y,this.viewer=P,this.linkService.setViewer(P);const A=null!==(_=null==s?void 0:s.scaleValue)&&void 0!==_?_:"auto";this.store.setState({scaleValue:A})}loadDocument(e,t){var i,n,s,r,a;return __awaiter(this,void 0,void 0,(function*(){if(this.url)try{URL.revokeObjectURL(this.url.toString())}catch(e){}null===(i=this.document)||void 0===i||i.destroy(),null===(n=this.viewer)||void 0===n||n.cleanup(),this.url=e.toString();const o=null!==(s=null==t?void 0:t.filename)&&void 0!==s?s:pdfExports.getPdfFilenameFromUrl(null===(r=this.url)||void 0===r?void 0:r.toString());this.filename=o;const l=yield pdfExports.getDocument({url:e}).promise;this.document=l,this.viewer.setDocument(this.document),this.linkService.setDocument(this.document),this.thumbnailViewer&&(null===(a=this.thumbnailViewer)||void 0===a||a.setDocument(l)),__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_initInternalEventListeners).call(this),yield __classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_initializePageLabels).call(this),this.store.setState({filename:o,numPages:l.numPages,pageNumber:1,isDocumentLoaded:!0,url:e.toString()});const h=yield l.getAttachments(),c=new Map(Object.keys(null!=h?h:{}).sort(((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))).map((e=>[e,h[e]])));this.store.setState({attachments:c}),yield __classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_parseDocumentInfo).call(this),this.forceRendering()}))}forceRendering(e=!0){__classPrivateFieldGet(this,_PDFSlick_renderingQueue,"f").printing=!!this.printService,__classPrivateFieldGet(this,_PDFSlick_renderingQueue,"f").isThumbnailViewEnabled=e,__classPrivateFieldGet(this,_PDFSlick_renderingQueue,"f").renderHighestPriority()}gotoPage(e){this.linkService.goToPage(e)}openOrDownloadData(e,t,i){var n;null===(n=this.downloadManager)||void 0===n||n.openOrDownloadData(e,t,i)}download(){var e,t;return __awaiter(this,void 0,void 0,(function*(){const i=this.url,{filename:n}=this;try{const t=yield this.document.getData(),s=new Blob([t],{type:"application/pdf"});yield null===(e=this.downloadManager)||void 0===e?void 0:e.download(s,i,n,{})}catch(e){yield null===(t=this.downloadManager)||void 0===t?void 0:t.downloadUrl(i,n,{})}}))}save(){var e;return __awaiter(this,void 0,void 0,(function*(){const t=this.url,{filename:i}=this;try{const n=yield this.document.saveDocument(),s=new Blob([n],{type:"application/pdf"});yield null===(e=this.downloadManager)||void 0===e?void 0:e.download(s,t,i,{})}catch(e){console.error(`Error when saving the document: ${e.message}`),yield this.download()}}))}downloadOrSave(){var e;const{annotationStorage:t}=null!==(e=this.document)&&void 0!==e?e:{};t&&t.size>0?this.save():this.download()}get supportsPrinting(){return PDFPrintServiceFactory.instance.supportsPrinting}beforePrint(){if(this.printService)return;if(!this.supportsPrinting)return;if(!this.viewer.pageViewsReady)return void this.l10n.get("printing_not_ready").then((e=>{window.alert(e)}));const e=this.viewer.getPagesOverview(),t=document.getElementById("printContainer"),i=this.printResolution,n=this.viewer.optionalContentConfigPromise,s=PDFPrintServiceFactory.instance.createPrintService(this.document,e,t,i,n,null,this.l10n);this.printService=s,this.forceRendering(),s.layout()}afterPrint(){var e;this.printService&&(this.printService.destroy(),this.printService=null,null===(e=this.document)||void 0===e||e.annotationStorage.resetModified()),this.forceRendering()}requestPresentationMode(){var e;null===(e=this.pdfPresentationMode)||void 0===e||e.request()}triggerPrinting(){this.supportsPrinting&&window.print()}_cleanup(){var e;if(this.document)try{this.viewer.cleanup(),null===(e=this.thumbnailViewer)||void 0===e||e.cleanup(),this.document.cleanup()}catch(e){console.error("Unable to perform cleanup",e)}}setAnnotationEditorMode(e){this.viewer.annotationEditorMode={mode:e},this.store.setState({annotationEditorMode:e})}setAnnotationEditorParams(e){const t=Array.isArray(e)?e:[e];for(const e of t)this.viewer.annotationEditorParams=e}setSpreadMode(e){isValidSpreadMode(e)&&(this.viewer.spreadMode=e,this.dispatch("switchspreadmode",{mode:e}))}setScrollMode(e){isValidScrollMode(e)&&(this.viewer.scrollMode=e,this.dispatch("switchscrollmode",{mode:e}))}setRotation(e){isValidRotation(e)&&(this.viewer.pagesRotation=e)}getPagesOverview(){var e,t;try{return null!==(t=null===(e=this.viewer)||void 0===e?void 0:e.getPagesOverview())&&void 0!==t?t:[]}catch(e){return[]}}increaseScale(){this.viewer.increaseScale()}decreaseScale(){this.viewer.decreaseScale()}set currentScaleValue(e){this.viewer.currentScaleValue=e}set currentScale(e){this.viewer.currentScale=e}getPageView(e){return this.viewer.getPageView(e)}on(e,t,i){this.eventBus.on(e,t,i)}off(e,t,i){this.eventBus.off(e,t,i)}dispatch(e,t){this.eventBus.dispatch(e,t)}}_PDFSlick_renderingQueue=new WeakMap,_PDFSlick_container=new WeakMap,_PDFSlick_viewerContainer=new WeakMap,_PDFSlick_thumbsContainer=new WeakMap,_PDFSlick_annotationMode=new WeakMap,_PDFSlick_annotationEditorMode=new WeakMap,_PDFSlick_instances=new WeakSet,_PDFSlick_initializePageLabels=function(){var e;return __awaiter(this,void 0,void 0,(function*(){const t=this.document,i=null!==(e=yield t.getPageLabels())&&void 0!==e?e:[],n=i.length;let s=0,r=0;for(let e=0;e<n;e++){const t=i[e];if(t===(e+1).toString())s++;else{if(""!==t)break;r++}}if(s>=n||r>=n)return;const{viewer:a,thumbnailViewer:o}=this;a.setPageLabels(i),null==o||o.setPageLabels(i)}))},_PDFSlick_parseDocumentInfo=function(){return __awaiter(this,void 0,void 0,(function*(){const{info:e,contentLength:t}=yield this.document.getMetadata(),i=yield this.document.getPage(this.store.getState().pageNumber).then((e=>__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_parsePageSize).call(this,getPageSizeInches(e),0)));this.store.setState({filesize:t,title:e.Title,author:e.Author,subject:e.Subject,keywords:e.Keywords,creator:e.Creator,producer:e.Producer,version:e.PDFFormatVersion,creationDate:pdfExports.PDFDateString.toDateObject(e.CreationDate),modificationDate:pdfExports.PDFDateString.toDateObject(e.ModDate),isLinearized:e.IsLinearized,pageSize:i})}))},_PDFSlick_parsePageSize=function(e,t){return __awaiter(this,void 0,void 0,(function*(){if(!e)return;t%180!=0&&(e={width:e.height,height:e.width});const i=isPortraitOrientation(e);let n={width:Math.round(100*e.width)/100,height:Math.round(100*e.height)/100},s={width:Math.round(25.4*e.width*10)/10,height:Math.round(25.4*e.height*10)/10},r=getPageName(n,i,US_PAGE_NAMES)||getPageName(s,i,METRIC_PAGE_NAMES);if(!(r||Number.isInteger(s.width)&&Number.isInteger(s.height))){const t={width:25.4*e.width,height:25.4*e.height},a={width:Math.round(s.width),height:Math.round(s.height)};Math.abs(t.width-a.width)<.1&&Math.abs(t.height-a.height)<.1&&(r=getPageName(a,i,METRIC_PAGE_NAMES),r&&(n={width:Math.round(a.width/25.4*100)/100,height:Math.round(a.height/25.4*100)/100},s=a))}const[{width:a,height:o},l,h,c]=yield Promise.all([n,this.l10n.get("document_properties_page_size_unit_inches"),r&&this.l10n.get(`document_properties_page_size_name_${r.toLowerCase()}`),this.l10n.get("document_properties_page_size_orientation_"+(i?"portrait":"landscape"))]);return{width:a.toLocaleString(),height:o.toLocaleString(),unit:l,name:h,orientation:c}}))},_PDFSlick_initInternalEventListeners=function(){this.eventBus._on("pagesinit",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onDocumentReady).bind(this)),this.eventBus._on("scalechanging",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onScaleChanging).bind(this)),this.eventBus._on("pagechanging",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onPageChanging).bind(this)),this.eventBus._on("pagerendered",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onPageRendered).bind(this)),this.eventBus._on("rotationchanging",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onRotationChanging).bind(this)),this.eventBus._on("switchspreadmode",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onSwitchSpreadMode).bind(this)),this.eventBus._on("switchscrollmode",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onSwitchScrollMode).bind(this)),this.eventBus._on("beforeprint",this.beforePrint.bind(this)),this.eventBus._on("afterprint",this.afterPrint.bind(this)),window.onbeforeprint=e=>{this.eventBus.dispatch("beforeprint",{source:window})},window.onafterprint=e=>{this.eventBus.dispatch("afterprint",{source:window})}},_PDFSlick_onDocumentReady=function({source:e}){var t;return __awaiter(this,void 0,void 0,(function*(){const i=yield null===(t=this.document)||void 0===t?void 0:t.getOutline(),n=this.store.getState().scaleValue;e.currentScale=1,e.currentScaleValue="auto",this.store.setState({documentOutline:i,pageNumber:1,scaleValue:n,pagesReady:!0})}))},_PDFSlick_onRotationChanging=function({pagesRotation:e,pageNumber:t}){this.store.setState({pagesRotation:e}),this.thumbnailViewer&&(this.thumbnailViewer.pagesRotation=e),this.forceRendering(),this.viewer.currentPageNumber=t},_PDFSlick_onSwitchSpreadMode=function({mode:e}){this.store.setState({spreadMode:e})},_PDFSlick_onSwitchScrollMode=function({mode:e}){this.store.setState({scrollMode:e})},_PDFSlick_onScaleChanging=function({scale:e,presetValue:t}){this.store.setState({scale:e,scaleValue:t}),this.viewer.update()},_PDFSlick_onPageChanging=function({pageNumber:e}){var t;null===(t=this.thumbnailViewer)||void 0===t||t.scrollThumbnailIntoView(e),this.store.setState({pageNumber:e})},_PDFSlick_onPageRendered=function({pageNumber:e,error:t}){var i;if(__classPrivateFieldGet(this,_PDFSlick_thumbsContainer,"f")){const t=this.viewer.getPageView(e-1),n=null===(i=this.thumbnailViewer)||void 0===i?void 0:i.getThumbnail(e-1);t&&n&&n.setImage(t)}};var noop=function(){},isBrowser="undefined"!=typeof window,useIsomorphicLayoutEffect=isBrowser?React.useLayoutEffect:React.useEffect;function useTimeoutFn(e,t){void 0===t&&(t=0);var i=React.useRef(!1),n=React.useRef(),s=React.useRef(e),r=React.useCallback((function(){return i.current}),[]),a=React.useCallback((function(){i.current=!1,n.current&&clearTimeout(n.current),n.current=setTimeout((function(){i.current=!0,s.current()}),t)}),[t]),o=React.useCallback((function(){i.current=null,n.current&&clearTimeout(n.current)}),[]);return React.useEffect((function(){s.current=e}),[e]),React.useEffect((function(){return a(),o}),[t]),[r,o,a]}function useDebounce(e,t,i){void 0===t&&(t=0),void 0===i&&(i=[]);var n=useTimeoutFn(e,t),s=n[0],r=n[1],a=n[2];return React.useEffect(a,i),[s,r]}var defaultState={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function useMeasure(){var e=React.useState(null),t=e[0],i=e[1],n=React.useState(defaultState),s=n[0],r=n[1],a=React.useMemo((function(){return new window.ResizeObserver((function(e){if(e[0]){var t=e[0].contentRect,i=t.x,n=t.y,s=t.width,a=t.height,o=t.top,l=t.left,h=t.bottom,c=t.right;r({x:i,y:n,width:s,height:a,top:o,left:l,bottom:h,right:c})}}))}),[]);return useIsomorphicLayoutEffect((function(){if(t)return a.observe(t),function(){a.disconnect()}}),[t]),[i,s]}var useMeasure$1=isBrowser&&void 0!==window.ResizeObserver?useMeasure:function(){return[noop,defaultState]};function PDFSlickViewer({usePDFSlickStore:e,viewerRef:t,className:i}){const n=e((e=>e.pdfSlick)),s=e((e=>e.scaleValue)),[r,{width:a}]=useMeasure$1();return useDebounce((()=>{a&&(!n||"auto"!==s&&"page-fit"!==s&&"page-width"!==s||(n.viewer.currentScaleValue=s),null==n||n.viewer.update())}),0,[a]),jsxRuntime.jsx("div",Object.assign({ref:e=>{t(e),r(e)},id:"viewerContainer",className:`pdfSlickContainer ${null!=i?i:""}`,style:{position:"absolute",inset:0}},{children:jsxRuntime.jsx("div",{id:"viewer",className:"pdfSlickViewer pdfViewer"})}))}function PDFSlickThumbnails({children:e,thumbsRef:t,usePDFSlickStore:i,className:n}){const s=i((e=>e.thumbnailViews)),r=i((e=>e.pdfSlick)),[a,{width:o}]=useMeasure$1();return useDebounce((()=>{o&&(null==r||r.forceRendering())}),0,[o]),jsxRuntime.jsx("div",Object.assign({ref:e=>{t(e),a(e)}},{className:n},{style:{position:"absolute",overflow:"auto",inset:0}},{children:Array.from(s).map((([t,i])=>{var n;return reactDom.createPortal(e({pageNumber:t,width:i.canvasWidth,height:i.canvasHeight,scale:i.scale,src:null!==(n=null==i?void 0:i.src)&&void 0!==n?n:null,rotation:i.rotation,pageLabel:i.pageLabel,loaded:i.loaded}),i.div)}))}))}function createStore(e){return function(t,i){return useStore(e,t,i)}}const usePDFSlick=(e,t)=>{const[i,n]=React.useState(!1),[s,r]=React.useState(null),[a,o]=React.useState(null),l=React.useMemo((()=>create()),[]),h=React.useMemo((()=>createStore(l)),[]),c=React.useCallback((e=>{null!==e&&r(e)}),[]),d=React.useCallback((e=>{null!==e&&o(e)}),[]);return React.useEffect((()=>{if(e&&s){const i=new PDFSlick({container:s,thumbs:a,store:l,options:t});i.loadDocument(e,t).then((()=>n(!0))),l.setState({pdfSlick:i})}return()=>{}}),[e,s]),{isDocumentLoaded:i,viewerRef:c,thumbsRef:d,usePDFSlickStore:h,store:l,PDFSlickViewer:PDFSlickViewer,PDFSlickThumbnails:PDFSlickThumbnails}};exports.AutoPrintRegExp=AutoPrintRegExp,exports.CursorTool=CursorTool,exports.DEFAULT_SCALE=DEFAULT_SCALE,exports.DEFAULT_SCALE_DELTA=DEFAULT_SCALE_DELTA,exports.DEFAULT_SCALE_VALUE=DEFAULT_SCALE_VALUE,exports.MAX_AUTO_SCALE=MAX_AUTO_SCALE,exports.MAX_SCALE=MAX_SCALE,exports.MIN_SCALE=MIN_SCALE,exports.OutputScale=OutputScale,exports.PDFSlick=PDFSlick,exports.PDFSlickThumbnails=PDFSlickThumbnails,exports.PresentationModeState=PresentationModeState,exports.ProgressBar=ProgressBar,exports.RendererType=RendererType,exports.RenderingStates=RenderingStates,exports.SCROLLBAR_PADDING=SCROLLBAR_PADDING,exports.ScrollMode=ScrollMode,exports.SidebarView=SidebarView,exports.SpreadMode=SpreadMode,exports.TextLayerMode=TextLayerMode,exports.UNKNOWN_SCALE=UNKNOWN_SCALE,exports.VERTICAL_PADDING=VERTICAL_PADDING,exports.animationStarted=animationStarted,exports.apiPageLayoutToViewerModes=apiPageLayoutToViewerModes,exports.apiPageModeToSidebarView=apiPageModeToSidebarView,exports.approximateFraction=approximateFraction,exports.backtrackBeforeAllVisibleElements=backtrackBeforeAllVisibleElements,exports.binarySearchFirstItem=binarySearchFirstItem,exports.create=create,exports.createStore=createStore,exports.docStyle=docStyle,exports.getActiveOrFocusedElement=getActiveOrFocusedElement,exports.getPageSizeInches=getPageSizeInches,exports.getVisibleElements=getVisibleElements,exports.initialState=initialState,exports.isPortraitOrientation=isPortraitOrientation,exports.isValidRotation=isValidRotation,exports.isValidScrollMode=isValidScrollMode,exports.isValidSpreadMode=isValidSpreadMode,exports.noContextMenuHandler=noContextMenuHandler,exports.normalizeWheelEventDelta=normalizeWheelEventDelta,exports.normalizeWheelEventDirection=normalizeWheelEventDirection,exports.parseQueryString=parseQueryString,exports.removeNullCharacters=removeNullCharacters,exports.roundToDivide=roundToDivide,exports.scrollIntoView=scrollIntoView,exports.usePDFSlick=usePDFSlick,exports.watchScroll=watchScroll}));
|
|
54
|
+
!function(e,t){var i,n;i=globalThis,n=()=>(()=>{var e=[,(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFindController=t.FindState=void 0;var n=i(2),s=i(3),r=i(4);const a={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};t.FindState=a;const o={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},l=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]);let h;const c=/\p{M}+/gu,d=/([.*+?^${}()|[\]\\])|(\p{P})|(\s+)|(\p{M})|(\p{L})/gu,u=/([^\p{M}])\p{M}*$/u,p=/^\p{M}*([^\p{M}])/u,g=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,f=new Map,m=new Map;let _=null,v=null;function b(e){const t=[];let i,n;for(;null!==(i=g.exec(e));){let{index:e}=i;for(const n of i[0]){let i=f.get(n);i||(i=n.normalize("NFD").length,f.set(n,i)),t.push([i,e++])}}if(0===t.length&&_)n=_;else if(t.length>0&&v)n=v;else{const e=`([${Object.keys(o).join("")}])|([${(0,s.getNormalizeWithNFKC)()}])|((?:゙|゚)\\n)|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|((?:\\p{Ideographic}|[-ヿ])\\n)|(\\n)`;n=0===t.length?_=new RegExp(e+"|(\\u0000)","gum"):v=new RegExp(e+"|([\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f])","gum")}const r=[];for(;null!==(i=c.exec(e));)r.push([i[0].length,i.index]);let a=e.normalize("NFD");const l=[[0,0]];let h=0,d=0,u=0,p=0,b=0,y=!1;return a=a.replace(n,((e,i,n,s,a,c,g,f,_,v)=>{if(v-=p,i){const e=o[i],t=e.length;for(let e=1;e<t;e++)l.push([v-u+e,u-e]);return u-=t-1,e}if(n){let e=m.get(n);e||(e=n.normalize("NFKC"),m.set(n,e));const t=e.length;for(let e=1;e<t;e++)l.push([v-u+e,u-e]);return u-=t-1,e}if(s)return y=!0,v+b===r[h]?.[1]?++h:(l.push([v-1-u+1,u-1]),u-=1,p+=1),l.push([v-u+1,u]),p+=1,b+=1,s.charAt(0);if(a){const e=a.endsWith("\n"),t=e?a.length-2:a.length;y=!0;let i=t;v+b===r[h]?.[1]&&(i-=r[h][0],++h);for(let e=1;e<=i;e++)l.push([v-1-u+e,u-e]);return u-=i,p+=i,e?(v+=t-1,l.push([v-u+1,1+u]),u+=1,p+=1,b+=1,a.slice(0,t)):a}if(c){const e=c.length-2;return l.push([v-u+e,1+u]),u+=1,p+=1,b+=1,c.slice(0,-2)}if(g){const e=g.length-1;return l.push([v-u+e,u]),p+=1,b+=1,g.slice(0,-1)}if(f)return l.push([v-u+1,u-1]),u-=1,p+=1,b+=1," ";if(v+b===t[d]?.[1]){const e=t[d][0]-1;++d;for(let t=1;t<=e;t++)l.push([v-(u-t),u-t]);u-=e,p+=e}return _})),l.push([a.length,u]),[a,l,y]}function y(e,t,i){if(!e)return[t,i];const s=t,r=t+i-1;let a=(0,n.binarySearchFirstItem)(e,(e=>e[0]>=s));e[a][0]>s&&--a;let o=(0,n.binarySearchFirstItem)(e,(e=>e[0]>=r),a);e[o][0]>r&&--o;const l=s+e[a][1];return[l,r+e[o][1]+1-l]}t.PDFFindController=class{#Ln=null;#kn=!0;#Rn=0;constructor({linkService:e,eventBus:t,updateMatchesCountOnProgress:i=!0}){this._linkService=e,this._eventBus=t,this.#kn=i,this.onIsPageVisible=null,this.#In(),t._on("find",this.#On.bind(this)),t._on("findbarclose",this.#Nn.bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this.#Ln}setDocument(e){this._pdfDocument&&this.#In(),e&&(this._pdfDocument=e,this._firstPageCapability.resolve())}#On(e){if(!e)return;!1===e.phraseSearch&&(console.error("The `phraseSearch`-parameter was removed, please provide an Array of strings in the `query`-parameter instead."),"string"==typeof e.query&&(e.query=e.query.match(/\S+/g)));const t=this._pdfDocument,{type:i}=e;(null===this.#Ln||this.#Bn(e))&&(this._dirtyMatch=!0),this.#Ln=e,"highlightallchange"!==i&&this.#Vn(a.PENDING),this._firstPageCapability.promise.then((()=>{if(!this._pdfDocument||t&&this._pdfDocument!==t)return;this.#Kt();const e=!this._highlightMatches,n=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),i?this._dirtyMatch?this.#Un():"again"===i?(this.#Un(),e&&this.#Ln.highlightAll&&this.#jn()):"highlightallchange"===i?(n?this.#Un():this._highlightMatches=!0,this.#jn()):this.#Un():this._findTimeout=setTimeout((()=>{this.#Un(),this._findTimeout=null}),250)}))}scrollMatchIntoView({element:e=null,selectedLeft:t=0,pageIndex:i=-1,matchIndex:s=-1}){if(!this._scrollMatches||!e)return;if(-1===s||s!==this._selected.matchIdx)return;if(-1===i||i!==this._selected.pageIdx)return;this._scrollMatches=!1;const r={top:-50,left:t+-400};(0,n.scrollIntoView)(e,r,!0)}#In(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],this.#Rn=0,this.#Ln=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=new r.PromiseCapability}get#Hn(){const{query:e}=this.#Ln;return"string"==typeof e?(e!==this._rawQuery&&(this._rawQuery=e,[this._normalizedQuery]=b(e)),this._normalizedQuery):(e||[]).filter((e=>!!e)).map((e=>b(e)[0]))}#Bn(e){const t=e.query,i=this.#Ln.query,n=typeof t;if(n!==typeof i)return!0;if("string"===n){if(t!==i)return!0}else if(JSON.stringify(t)!==JSON.stringify(i))return!0;switch(e.type){case"again":const e=this._selected.pageIdx+1,t=this._linkService;return e>=1&&e<=t.pagesCount&&e!==t.page&&!(this.onIsPageVisible?.(e)??1);case"highlightallchange":return!1}return!0}#Wn(e,t,i){let n=e.slice(0,t).match(u);if(n){const i=e.charCodeAt(t),r=n[1].charCodeAt(0);if((0,s.getCharacterType)(i)===(0,s.getCharacterType)(r))return!1}if(n=e.slice(t+i).match(p),n){const r=e.charCodeAt(t+i-1),a=n[1].charCodeAt(0);if((0,s.getCharacterType)(r)===(0,s.getCharacterType)(a))return!1}return!0}#zn(e,t,i,n){const s=this._pageMatches[i]=[],r=this._pageMatchesLength[i]=[];if(!e)return;const a=this._pageDiffs[i];let o;for(;null!==(o=e.exec(n));){if(t&&!this.#Wn(n,o.index,o[0].length))continue;const[e,i]=y(a,o.index,o[0].length);i&&(s.push(e),r.push(i))}}#Gn(e,t){const{matchDiacritics:i}=this.#Ln;let n=!1;const s="[ ]*";return(e=e.replaceAll(d,((e,s,r,a,o,h)=>s?`[ ]*\\${s}[ ]*`:r?`[ ]*${r}[ ]*`:a?"[ ]+":i?o||h:o?l.has(o.charCodeAt(0))?o:"":t?(n=!0,`${h}\\p{M}*`):h))).endsWith(s)&&(e=e.slice(0,e.length-4)),i&&t&&(h||=String.fromCharCode(...l),n=!0,e=`${e}(?=[${h}]|[^\\p{M}]|$)`),[n,e]}#$n(e){let t=this.#Hn;if(0===t.length)return;const{caseSensitive:i,entireWord:n}=this.#Ln,s=this._pageContents[e],r=this._hasDiacritics[e];let a=!1;"string"==typeof t?[a,t]=this.#Gn(t,r):t=t.sort().reverse().map((e=>{const[t,i]=this.#Gn(e,r);return a||=t,`(${i})`})).join("|"),t=t?new RegExp(t,`g${a?"u":""}${i?"":"i"}`):null,this.#zn(t,n,e,s),this.#Ln.highlightAll&&this.#qn(e),this._resumePageIdx===e&&(this._resumePageIdx=null,this.#Xn());const o=this._pageMatches[e].length;this._matchesCountTotal+=o,this.#kn?o>0&&this.#Kn():++this.#Rn===this._linkService.pagesCount&&this.#Kn()}#Kt(){if(this._extractTextPromises.length>0)return;let e=Promise.resolve();const t={disableNormalization:!0};for(let i=0,n=this._linkService.pagesCount;i<n;i++){const n=new r.PromiseCapability;this._extractTextPromises[i]=n.promise,e=e.then((()=>this._pdfDocument.getPage(i+1).then((e=>e.getTextContent(t))).then((e=>{const t=[];for(const i of e.items)t.push(i.str),i.hasEOL&&t.push("\n");[this._pageContents[i],this._pageDiffs[i],this._hasDiacritics[i]]=b(t.join("")),n.resolve()}),(e=>{console.error(`Unable to get text content for page ${i+1}`,e),this._pageContents[i]="",this._pageDiffs[i]=null,this._hasDiacritics[i]=!1,n.resolve()}))))}}#qn(e){this._scrollMatches&&this._selected.pageIdx===e&&(this._linkService.page=e+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:e})}#jn(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}#Un(){const e=this.#Ln.findPrevious,t=this._linkService.page-1,i=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=t,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,this.#Rn=0,this._matchesCountTotal=0,this.#jn();for(let e=0;e<i;e++)this._pendingFindMatches.has(e)||(this._pendingFindMatches.add(e),this._extractTextPromises[e].then((()=>{this._pendingFindMatches.delete(e),this.#$n(e)})))}if(0===this.#Hn.length)return void this.#Vn(a.FOUND);if(this._resumePageIdx)return;const n=this._offset;if(this._pagesToSearch=i,null!==n.matchIdx){const t=this._pageMatches[n.pageIdx].length;if(!e&&n.matchIdx+1<t||e&&n.matchIdx>0)return n.matchIdx=e?n.matchIdx-1:n.matchIdx+1,void this.#Yn(!0);this.#Qn(e)}this.#Xn()}#Jn(e){const t=this._offset,i=e.length,n=this.#Ln.findPrevious;return i?(t.matchIdx=n?i-1:0,this.#Yn(!0),!0):(this.#Qn(n),!!(t.wrapped&&(t.matchIdx=null,this._pagesToSearch<0))&&(this.#Yn(!1),!0))}#Xn(){null!==this._resumePageIdx&&console.error("There can only be one pending page.");let e=null;do{const t=this._offset.pageIdx;if(e=this._pageMatches[t],!e){this._resumePageIdx=t;break}}while(!this.#Jn(e))}#Qn(e){const t=this._offset,i=this._linkService.pagesCount;t.pageIdx=e?t.pageIdx-1:t.pageIdx+1,t.matchIdx=null,this._pagesToSearch--,(t.pageIdx>=i||t.pageIdx<0)&&(t.pageIdx=e?i-1:0,t.wrapped=!0)}#Yn(e=!1){let t=a.NOT_FOUND;const i=this._offset.wrapped;if(this._offset.wrapped=!1,e){const e=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,t=i?a.WRAPPED:a.FOUND,-1!==e&&e!==this._selected.pageIdx&&this.#qn(e)}this.#Vn(t,this.#Ln.findPrevious),-1!==this._selected.pageIdx&&(this._scrollMatches=!0,this.#qn(this._selected.pageIdx))}#Nn(e){const t=this._pdfDocument;this._firstPageCapability.promise.then((()=>{!this._pdfDocument||t&&this._pdfDocument!==t||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),this.#Vn(a.FOUND),this._highlightMatches=!1,this.#jn())}))}#Zn(){const{pageIdx:e,matchIdx:t}=this._selected;let i=0,n=this._matchesCountTotal;if(-1!==t){for(let t=0;t<e;t++)i+=this._pageMatches[t]?.length||0;i+=t+1}return(i<1||i>n)&&(i=n=0),{current:i,total:n}}#Kn(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this.#Zn()})}#Vn(e,t=!1){(this.#kn||this.#Rn===this._linkService.pagesCount&&e!==a.PENDING)&&this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:e,previous:t,matchesCount:this.#Zn(),rawQuery:this.#Ln?.query??null})}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.animationStarted=t.VERTICAL_PADDING=t.UNKNOWN_SCALE=t.TextLayerMode=t.SpreadMode=t.SidebarView=t.ScrollMode=t.SCROLLBAR_PADDING=t.RenderingStates=t.ProgressBar=t.PresentationModeState=t.OutputScale=t.MIN_SCALE=t.MAX_SCALE=t.MAX_AUTO_SCALE=t.DEFAULT_SCALE_VALUE=t.DEFAULT_SCALE_DELTA=t.DEFAULT_SCALE=t.CursorTool=t.AutoPrintRegExp=void 0,t.apiPageLayoutToViewerModes=function(e){let t=n.VERTICAL,i=s.NONE;switch(e){case"SinglePage":t=n.PAGE;break;case"OneColumn":break;case"TwoPageLeft":t=n.PAGE;case"TwoColumnLeft":i=s.ODD;break;case"TwoPageRight":t=n.PAGE;case"TwoColumnRight":i=s.EVEN}return{scrollMode:t,spreadMode:i}},t.apiPageModeToSidebarView=function(e){switch(e){case"UseNone":return i.NONE;case"UseThumbs":return i.THUMBS;case"UseOutlines":return i.OUTLINE;case"UseAttachments":return i.ATTACHMENTS;case"UseOC":return i.LAYERS}return i.NONE},t.approximateFraction=function(e){if(Math.floor(e)===e)return[e,1];const t=1/e;if(t>8)return[1,8];if(Math.floor(t)===t)return[1,t];const i=e>1?t:e;let n,s=0,r=1,a=1,o=1;for(;;){const e=s+a,t=r+o;if(t>8)break;i<=e/t?(a=e,o=t):(s=e,r=t)}return n=i-s/r<a/o-i?i===e?[s,r]:[r,s]:i===e?[a,o]:[o,a],n},t.backtrackBeforeAllVisibleElements=o,t.binarySearchFirstItem=a,t.docStyle=void 0,t.getActiveOrFocusedElement=function(){let e=document,t=e.activeElement||e.querySelector(":focus");for(;t?.shadowRoot;)e=t.shadowRoot,t=e.activeElement||e.querySelector(":focus");return t},t.getPageSizeInches=function({view:e,userUnit:t,rotate:i}){const[n,s,r,a]=e,o=i%180!=0,l=(r-n)/72*t,h=(a-s)/72*t;return{width:o?h:l,height:o?l:h}},t.getVisibleElements=function({scrollEl:e,views:t,sortByVisibility:i=!1,horizontal:n=!1,rtl:s=!1}){const r=e.scrollTop,l=r+e.clientHeight,h=e.scrollLeft,c=h+e.clientWidth,d=[],u=new Set,p=t.length;let g=a(t,n?function(e){const t=e.div,i=t.offsetLeft+t.clientLeft,n=i+t.clientWidth;return s?i<c:n>h}:function(e){const t=e.div;return t.offsetTop+t.clientTop+t.clientHeight>r});g>0&&g<p&&!n&&(g=o(g,t,r));let f=n?c:-1;for(let e=g;e<p;e++){const i=t[e],s=i.div,a=s.offsetLeft+s.clientLeft,o=s.offsetTop+s.clientTop,p=s.clientWidth,g=s.clientHeight,m=a+p,_=o+g;if(-1===f)_>=l&&(f=_);else if((n?a:o)>f)break;if(_<=r||o>=l||m<=h||a>=c)continue;const v=Math.max(0,r-o)+Math.max(0,_-l),b=(p-(Math.max(0,h-a)+Math.max(0,m-c)))/p,y=(g-v)/g*b*100|0;d.push({id:i.id,x:a,y:o,view:i,percent:y,widthPercent:100*b|0}),u.add(i.id)}const m=d[0],_=d.at(-1);return i&&d.sort((function(e,t){const i=e.percent-t.percent;return Math.abs(i)>.001?-i:e.id-t.id})),{first:m,last:_,views:d,ids:u}},t.isPortraitOrientation=function(e){return e.width<=e.height},t.isValidRotation=function(e){return Number.isInteger(e)&&e%90==0},t.isValidScrollMode=function(e){return Number.isInteger(e)&&Object.values(n).includes(e)&&e!==n.UNKNOWN},t.isValidSpreadMode=function(e){return Number.isInteger(e)&&Object.values(s).includes(e)&&e!==s.UNKNOWN},t.normalizeWheelEventDelta=function(e){const t=e.deltaMode;let i=l(e);return t===WheelEvent.DOM_DELTA_PIXEL?i/=900:t===WheelEvent.DOM_DELTA_LINE&&(i/=30),i},t.normalizeWheelEventDirection=l,t.parseQueryString=function(e){const t=new Map;for(const[i,n]of new URLSearchParams(e))t.set(i.toLowerCase(),n);return t},t.removeNullCharacters=function(e,t=!1){return"string"!=typeof e?(console.error("The argument must be a string."),e):(t&&(e=e.replaceAll(r," ")),e.replaceAll("\0",""))},t.roundToDivide=function(e,t){const i=e%t;return 0===i?e:Math.round(e-i+t)},t.scrollIntoView=function(e,t,i=!1){let n=e.offsetParent;if(!n)return void console.error("offsetParent is not set -- cannot scroll");let s=e.offsetTop+e.clientTop,r=e.offsetLeft+e.clientLeft;for(;n.clientHeight===n.scrollHeight&&n.clientWidth===n.scrollWidth||i&&(n.classList.contains("markedContent")||"hidden"===getComputedStyle(n).overflow);)if(s+=n.offsetTop,r+=n.offsetLeft,n=n.offsetParent,!n)return;t&&(void 0!==t.top&&(s+=t.top),void 0!==t.left&&(r+=t.left,n.scrollLeft=r)),n.scrollTop=s},t.toggleCheckedBtn=function(e,t,i=null){e.classList.toggle("toggled",t),e.setAttribute("aria-checked",t),i?.classList.toggle("hidden",!t)},t.toggleExpandedBtn=function(e,t,i=null){e.classList.toggle("toggled",t),e.setAttribute("aria-expanded",t),i?.classList.toggle("hidden",!t)},t.watchScroll=function(e,t){const i=function(i){s||(s=window.requestAnimationFrame((function(){s=null;const i=e.scrollLeft,r=n.lastX;i!==r&&(n.right=i>r),n.lastX=i;const a=e.scrollTop,o=n.lastY;a!==o&&(n.down=a>o),n.lastY=a,t(n)})))},n={right:!0,down:!0,lastX:e.scrollLeft,lastY:e.scrollTop,_eventHandler:i};let s=null;return e.addEventListener("scroll",i,!0),n},t.DEFAULT_SCALE_VALUE="auto",t.DEFAULT_SCALE=1,t.DEFAULT_SCALE_DELTA=1.1,t.MIN_SCALE=.1,t.MAX_SCALE=10,t.UNKNOWN_SCALE=0,t.MAX_AUTO_SCALE=1.25,t.SCROLLBAR_PADDING=40,t.VERTICAL_PADDING=5,t.RenderingStates={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},t.PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};const i={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4};t.SidebarView=i,t.TextLayerMode={DISABLE:0,ENABLE:1,ENABLE_PERMISSIONS:2};const n={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3};t.ScrollMode=n;const s={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};t.SpreadMode=s,t.CursorTool={SELECT:0,HAND:1,ZOOM:2},t.AutoPrintRegExp=/\bprint\s*\(/,t.OutputScale=class{constructor(){const e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return 1!==this.sx||1!==this.sy}};const r=/[\x01-\x1F]/g;function a(e,t,i=0){let n=i,s=e.length-1;if(s<0||!t(e[s]))return e.length;if(t(e[n]))return n;for(;n<s;){const i=n+s>>1;t(e[i])?s=i:n=i+1}return n}function o(e,t,i){if(e<2)return e;let n=t[e].div,s=n.offsetTop+n.clientTop;s>=i&&(n=t[e-1].div,s=n.offsetTop+n.clientTop);for(let i=e-2;i>=0&&(n=t[i].div,!(n.offsetTop+n.clientTop+n.clientHeight<=s));--i)e=i;return e}function l(e){let t=Math.hypot(e.deltaX,e.deltaY);const i=Math.atan2(e.deltaY,e.deltaX);return-.25*Math.PI<i&&i<.75*Math.PI&&(t=-t),t}const h=new Promise((function(e){window.requestAnimationFrame(e)}));t.animationStarted=h;const c=document.documentElement.style;t.docStyle=c,t.ProgressBar=class{#es=null;#ts=null;#is=0;#ns=null;#mt=!0;constructor(e){this.#es=e.classList,this.#ns=e.style}get percent(){return this.#is}set percent(e){var t,i,n;this.#is=(t=e,i=0,n=100,Math.min(Math.max(t,i),n)),isNaN(e)?this.#es.add("indeterminate"):(this.#es.remove("indeterminate"),this.#ns.setProperty("--progressBar-percent",`${this.#is}%`))}setWidth(e){if(!e)return;const t=e.parentNode.offsetWidth-e.offsetWidth;t>0&&this.#ns.setProperty("--progressBar-end-offset",`${t}px`)}setDisableAutoFetch(e=5e3){isNaN(this.#is)||(this.#ts&&clearTimeout(this.#ts),this.show(),this.#ts=setTimeout((()=>{this.#ts=null,this.hide()}),e))}hide(){this.#mt&&(this.#mt=!1,this.#es.add("hidden"))}show(){this.#mt||(this.#mt=!0,this.#es.remove("hidden"))}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterType=void 0,t.getCharacterType=function(e){return function(e){return e<11904}(e)?function(e){return 0==(65408&e)}(e)?function(e){return 32===e||9===e||13===e||10===e}(e)?i.SPACE:function(e){return e>=97&&e<=122||e>=65&&e<=90}(e)||function(e){return e>=48&&e<=57}(e)||95===e?i.ALPHA_LETTER:i.PUNCT:function(e){return 3584==(65408&e)}(e)?i.THAI_LETTER:160===e?i.SPACE:i.ALPHA_LETTER:function(e){return e>=13312&&e<=40959||e>=63744&&e<=64255}(e)?i.HAN_LETTER:function(e){return e>=12448&&e<=12543}(e)?i.KATAKANA_LETTER:function(e){return e>=12352&&e<=12447}(e)?i.HIRAGANA_LETTER:function(e){return e>=65376&&e<=65439}(e)?i.HALFWIDTH_KATAKANA_LETTER:i.ALPHA_LETTER},t.getNormalizeWithNFKC=function(){return n||=" ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩",n};const i={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};let n;t.CharacterType=i},e=>{e.exports=globalThis.pdfjsLib},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLinkService=t.PDFLinkService=t.LinkTarget=void 0;var n=i(2);const s={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};function r(e,{url:t,target:i,rel:n,enabled:r=!0}={}){if(!t||"string"!=typeof t)throw new Error('A valid "url" parameter must provided.');r?e.href=e.title=t:(e.href="",e.title=`Disabled: ${t}`,e.onclick=()=>!1);let a="";switch(i){case s.NONE:break;case s.SELF:a="_self";break;case s.BLANK:a="_blank";break;case s.PARENT:a="_parent";break;case s.TOP:a="_top"}e.target=a,e.rel="string"==typeof n?n:"noopener noreferrer nofollow"}t.LinkTarget=s;class a{#ss=new Map;constructor({eventBus:e,externalLinkTarget:t=null,externalLinkRel:i=null,ignoreDestinationZoom:n=!1}={}){this.eventBus=e,this.externalLinkTarget=t,this.externalLinkRel=i,this.externalLinkEnabled=!0,this._ignoreDestinationZoom=n,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(e,t=null){this.baseUrl=t,this.pdfDocument=e,this.#ss.clear()}setViewer(e){this.pdfViewer=e}setHistory(e){this.pdfHistory=e}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(e){this.pdfViewer.currentPageNumber=e}get rotation(){return this.pdfViewer.pagesRotation}set rotation(e){this.pdfViewer.pagesRotation=e}get isInPresentationMode(){return this.pdfViewer.isInPresentationMode}#rs(e,t=null,i){const n=i[0];let s;if("object"==typeof n&&null!==n){if(s=this._cachedPageNumber(n),!s)return void this.pdfDocument.getPageIndex(n).then((s=>{this.cachePageRef(s+1,n),this.#rs(e,t,i)})).catch((()=>{console.error(`PDFLinkService.#goToDestinationHelper: "${n}" is not a valid page reference, for dest="${e}".`)}))}else{if(!Number.isInteger(n))return void console.error(`PDFLinkService.#goToDestinationHelper: "${n}" is not a valid destination reference, for dest="${e}".`);s=n+1}!s||s<1||s>this.pagesCount?console.error(`PDFLinkService.#goToDestinationHelper: "${s}" is not a valid page number, for dest="${e}".`):(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:t,explicitDest:i,pageNumber:s})),this.pdfViewer.scrollPageIntoView({pageNumber:s,destArray:i,ignoreDestinationZoom:this._ignoreDestinationZoom}))}async goToDestination(e){if(!this.pdfDocument)return;let t,i;"string"==typeof e?(t=e,i=await this.pdfDocument.getDestination(e)):(t=null,i=await e),Array.isArray(i)?this.#rs(e,t,i):console.error(`PDFLinkService.goToDestination: "${i}" is not a valid destination array, for dest="${e}".`)}goToPage(e){if(!this.pdfDocument)return;const t="string"==typeof e&&this.pdfViewer.pageLabelToPageNumber(e)||0|e;Number.isInteger(t)&&t>0&&t<=this.pagesCount?(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(t)),this.pdfViewer.scrollPageIntoView({pageNumber:t})):console.error(`PDFLinkService.goToPage: "${e}" is not a valid page.`)}addLinkAttributes(e,t,i=!1){r(e,{url:t,target:i?s.BLANK:this.externalLinkTarget,rel:this.externalLinkRel,enabled:this.externalLinkEnabled})}getDestinationHash(e){if("string"==typeof e){if(e.length>0)return this.getAnchorUrl("#"+escape(e))}else if(Array.isArray(e)){const t=JSON.stringify(e);if(t.length>0)return this.getAnchorUrl("#"+escape(t))}return this.getAnchorUrl("")}getAnchorUrl(e){return this.baseUrl?this.baseUrl+e:e}setHash(e){if(!this.pdfDocument)return;let t,i;if(e.includes("=")){const s=(0,n.parseQueryString)(e);if(s.has("search")){const e=s.get("search").replaceAll('"',""),t="true"===s.get("phrase");this.eventBus.dispatch("findfromurlhash",{source:this,query:t?e:e.match(/\S+/g)})}if(s.has("page")&&(t=0|s.get("page")||1),s.has("zoom")){const e=s.get("zoom").split(","),t=e[0],n=parseFloat(t);t.includes("Fit")?"Fit"===t||"FitB"===t?i=[null,{name:t}]:"FitH"===t||"FitBH"===t||"FitV"===t||"FitBV"===t?i=[null,{name:t},e.length>1?0|e[1]:null]:"FitR"===t?5!==e.length?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):i=[null,{name:t},0|e[1],0|e[2],0|e[3],0|e[4]]:console.error(`PDFLinkService.setHash: "${t}" is not a valid zoom value.`):i=[null,{name:"XYZ"},e.length>1?0|e[1]:null,e.length>2?0|e[2]:null,n?n/100:t]}i?this.pdfViewer.scrollPageIntoView({pageNumber:t||this.page,destArray:i,allowNegativeOffset:!0}):t&&(this.page=t),s.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:s.get("pagemode")}),s.has("nameddest")&&this.goToDestination(s.get("nameddest"))}else{i=unescape(e);try{i=JSON.parse(i),Array.isArray(i)||(i=i.toString())}catch{}if("string"==typeof i||a.#as(i))return void this.goToDestination(i);console.error(`PDFLinkService.setHash: "${unescape(e)}" is not a valid destination.`)}}executeNamedAction(e){switch(e){case"GoBack":this.pdfHistory?.back();break;case"GoForward":this.pdfHistory?.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}this.eventBus.dispatch("namedaction",{source:this,action:e})}async executeSetOCGState(e){const t=this.pdfDocument,i=await this.pdfViewer.optionalContentConfigPromise;if(t!==this.pdfDocument)return;let n;for(const t of e.state){switch(t){case"ON":case"OFF":case"Toggle":n=t;continue}switch(n){case"ON":i.setVisibility(t,!0);break;case"OFF":i.setVisibility(t,!1);break;case"Toggle":const e=i.getGroup(t);e&&i.setVisibility(t,!e.visible)}}this.pdfViewer.optionalContentConfigPromise=Promise.resolve(i)}cachePageRef(e,t){if(!t)return;const i=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;this.#ss.set(i,e)}_cachedPageNumber(e){if(!e)return null;const t=0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`;return this.#ss.get(t)||null}static#as(e){if(!Array.isArray(e))return!1;const t=e.length;if(t<2)return!1;const i=e[0];if(!("object"==typeof i&&Number.isInteger(i.num)&&Number.isInteger(i.gen)||Number.isInteger(i)&&i>=0))return!1;const n=e[1];if("object"!=typeof n||"string"!=typeof n.name)return!1;let s=!0;switch(n.name){case"XYZ":if(5!==t)return!1;break;case"Fit":case"FitB":return 2===t;case"FitH":case"FitBH":case"FitV":case"FitBV":if(3!==t)return!1;break;case"FitR":if(6!==t)return!1;s=!1;break;default:return!1}for(let i=2;i<t;i++){const t=e[i];if(!("number"==typeof t||s&&null===t))return!1}return!0}}t.PDFLinkService=a,t.SimpleLinkService=class{constructor(){this.externalLinkEnabled=!0}get pagesCount(){return 0}get page(){return 0}set page(e){}get rotation(){return 0}set rotation(e){}get isInPresentationMode(){return!1}async goToDestination(e){}goToPage(e){}addLinkAttributes(e,t,i=!1){r(e,{url:t,enabled:this.externalLinkEnabled})}getDestinationHash(e){return"#"}getAnchorUrl(e){return"#"}setHash(e){}executeNamedAction(e){}executeSetOCGState(e){}cachePageRef(e,t){}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationLayerBuilder=void 0;var n=i(4),s=i(7),r=i(2);t.AnnotationLayerBuilder=class{#os=null;constructor({pageDiv:e,pdfPage:t,linkService:i,downloadManager:n,annotationStorage:r=null,imageResourcesPath:a="",renderForms:o=!0,l10n:l=s.NullL10n,enableScripting:h=!1,hasJSActionsPromise:c=null,fieldObjectsPromise:d=null,annotationCanvasMap:u=null,accessibilityManager:p=null}){this.pageDiv=e,this.pdfPage=t,this.linkService=i,this.downloadManager=n,this.imageResourcesPath=a,this.renderForms=o,this.l10n=l,this.annotationStorage=r,this.enableScripting=h,this._hasJSActionsPromise=c||Promise.resolve(!1),this._fieldObjectsPromise=d||Promise.resolve(null),this._annotationCanvasMap=u,this._accessibilityManager=p,this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=i.eventBus}async render(e,t="display"){if(this.div){if(this._cancelled||!this.annotationLayer)return;return void this.annotationLayer.update({viewport:e.clone({dontFlip:!0})})}const[i,s,a]=await Promise.all([this.pdfPage.getAnnotations({intent:t}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;const o=this.div=document.createElement("div");o.className="annotationLayer",this.pageDiv.append(o),0!==i.length?(this.annotationLayer=new n.AnnotationLayer({div:o,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,l10n:this.l10n,page:this.pdfPage,viewport:e.clone({dontFlip:!0})}),await this.annotationLayer.render({annotations:i,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:s,fieldObjects:a}),this.linkService.isInPresentationMode&&this.#ls(r.PresentationModeState.FULLSCREEN),this.#os||(this.#os=e=>{this.#ls(e.state)},this._eventBus?._on("presentationmodechanged",this.#os))):this.hide()}cancel(){this._cancelled=!0,this.#os&&(this._eventBus?._off("presentationmodechanged",this.#os),this.#os=null)}hide(){this.div&&(this.div.hidden=!0)}#ls(e){if(!this.div)return;let t=!1;switch(e){case r.PresentationModeState.FULLSCREEN:t=!0;break;case r.PresentationModeState.NORMAL:break;default:return}for(const e of this.div.childNodes)e.hasAttribute("data-internal-link")||(e.inert=t)}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NullL10n=void 0,t.getL10nFallback=n;const i={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",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};function n(e,t){switch(e){case"find_match_count":e=`find_match_count[${1===t.total?"one":"other"}]`;break;case"find_match_count_limit":e=`find_match_count_limit[${1===t.limit?"one":"other"}]`}return i[e]||""}i.print_progress_percent="{{progress}}%";const s={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",get:async(e,t=null,i=n(e,t))=>function(e,t){return t?e.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,((e,i)=>i in t?t[i]:"{{"+i+"}}")):e}(i,t),async translate(e){}};t.NullL10n=s},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DownloadManager=void 0;var n=i(4);function s(e,t){const i=document.createElement("a");if(!i.click)throw new Error('DownloadManager: "a.click()" is not supported.');i.href=e,i.target="_parent","download"in i&&(i.download=t),(document.body||document.documentElement).append(i),i.click(),i.remove()}t.DownloadManager=class{#hs=new WeakMap;downloadUrl(e,t,i){(0,n.createValidAbsoluteUrl)(e,"http://example.com")?s(e+"#pdfjs.action=download",t):console.error(`downloadUrl - not a valid URL: ${e}`)}downloadData(e,t,i){s(URL.createObjectURL(new Blob([e],{type:i})),t)}openOrDownloadData(e,t,i){const s=(0,n.isPdfFile)(i)?"application/pdf":"";return this.downloadData(t,i,s),!1}download(e,t,i,n){s(URL.createObjectURL(e),i)}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WaitOnType=t.EventBus=t.AutomationEventBus=void 0,t.waitOnEventOrTimeout=function({target:e,name:t,delay:s=0}){return new Promise((function(r,a){if("object"!=typeof e||!t||"string"!=typeof t||!(Number.isInteger(s)&&s>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function o(i){e instanceof n?e._off(t,l):e.removeEventListener(t,l),c&&clearTimeout(c),r(i)}const l=o.bind(null,i.EVENT);e instanceof n?e._on(t,l):e.addEventListener(t,l);const h=o.bind(null,i.TIMEOUT),c=setTimeout(h,s)}))};const i={EVENT:"event",TIMEOUT:"timeout"};t.WaitOnType=i;class n{#a=Object.create(null);on(e,t,i=null){this._on(e,t,{external:!0,once:i?.once})}off(e,t,i=null){this._off(e,t,{external:!0,once:i?.once})}dispatch(e,t){const i=this.#a[e];if(!i||0===i.length)return;let n;for(const{listener:s,external:r,once:a}of i.slice(0))a&&this._off(e,s),r?(n||=[]).push(s):s(t);if(n){for(const e of n)e(t);n=null}}_on(e,t,i=null){(this.#a[e]||=[]).push({listener:t,external:!0===i?.external,once:!0===i?.once})}_off(e,t,i=null){const n=this.#a[e];if(n)for(let e=0,i=n.length;e<i;e++)if(n[e].listener===t)return void n.splice(e,1)}}t.EventBus=n,t.AutomationEventBus=class extends n{dispatch(e,t){throw new Error("Not implemented: AutomationEventBus.dispatch")}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GenericL10n=void 0,i(11);var n=i(7);const s={en:"en-US",es:"es-ES",fy:"fy-NL",ga:"ga-IE",gu:"gu-IN",hi:"hi-IN",hy:"hy-AM",nb:"nb-NO",ne:"ne-NP",nn:"nn-NO",pa:"pa-IN",pt:"pt-PT",sv:"sv-SE",zh:"zh-CN"};t.GenericL10n=class{constructor(e){const{webL10n:t}=document;this._lang=e,this._ready=new Promise(((i,n)=>{var r;t.setLanguage((r=e,s[r?.toLowerCase()]||r),(()=>{i(t)}))}))}async getLanguage(){return(await this._ready).getLanguage()}async getDirection(){return(await this._ready).getDirection()}async get(e,t=null,i=(0,n.getL10nFallback)(e,t)){return(await this._ready).get(e,t,i)}async translate(e){return(await this._ready).translate(e)}}},()=>{document.webL10n=function(e,t){var i={},n="",s="textContent",r="",a={},o="loading",l=!0;function h(e,t,i){t=t||function(e){},i=i||function(){};var n=new XMLHttpRequest;n.open("GET",e,l),n.overrideMimeType&&n.overrideMimeType("text/plain; charset=utf-8"),n.onreadystatechange=function(){4==n.readyState&&(200==n.status||0===n.status?t(n.responseText):i())},n.onerror=i,n.ontimeout=i;try{n.send(null)}catch(e){i()}}function c(e,t,r,a){var o=e.replace(/[^\/]*$/,"")||"./";function l(e){return e.lastIndexOf("\\")<0?e:e.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}h(e,(function(e){n+=e,function(e,i){var n={},s=/^\s*|\s*$/,r=/^\s*#|^\s*$/,a=/^\s*\[(.*)\]\s*$/,c=/^\s*@import\s+url\((.*)\)\s*$/i,d=/^([^=\s]*)\s*=\s*(.+)$/;function u(e,i,h){var u=e.replace(s,"").split(/[\r\n]+/),g="*",f=t.split("-",1)[0],m=!1,_="";!function e(){for(;;){if(!u.length)return void h();var s=u.shift();if(!r.test(s)){if(i){if(_=a.exec(s)){g=_[1].toLowerCase(),m="*"!==g&&g!==t&&g!==f;continue}if(m)continue;if(_=c.exec(s))return void p(o+_[1],e)}var v=s.match(d);v&&3==v.length&&(n[v[1]]=l(v[2]))}}}()}function p(e,t){h(e,(function(e){u(e,!1,t)}),(function(){console.warn(e+" not found."),t()}))}u(e,!0,(function(){i(n)}))}(e,(function(e){for(var t in e){var n,a,o=t.lastIndexOf(".");o>0?(n=t.substring(0,o),a=t.substring(o+1)):(n=t,a=s),i[n]||(i[n]={}),i[n][a]=e[t]}r&&r()}))}),a)}function d(e,s){e&&(e=e.toLowerCase()),s=s||function(){},i={},n="",r="",r=e;var a=t.querySelectorAll('link[type="application/l10n"]'),l=a.length;if(0!==l){var h,d,u=0;d=function(){++u>=l&&(s(),o="complete")};for(var p=0;p<l;p++)new _(a[p]).load(e,d)}else{var g=(h=t.querySelector('script[type="application/l10n"]'))?JSON.parse(h.innerHTML):null;if(g&&g.locales&&g.default_locale){if(console.log("using the embedded JSON directory, early way out"),!(i=g.locales[e])){var f=g.default_locale.toLowerCase();for(var m in g.locales){if((m=m.toLowerCase())===e){i=g.locales[e];break}m===f&&(i=g.locales[f])}}s()}else console.log("no resource to load, early way out");o="complete"}function _(e){var t=e.href;this.load=function(e,i){c(t,e,i,(function(){console.warn(t+" not found."),console.warn('"'+e+'" resource not found'),r="",i()}))}}}function u(e,t,n){var s=i[e];if(!s){if(console.warn("#"+e+" is undefined."),!n)return null;s=n}var r={};for(var a in s){var o=s[a];o=g(o=p(o,t,e,a),t,e),r[a]=o}return r}function p(e,t,n,s){var r=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(e);if(!r||!r.length)return e;var o,l=r[1],h=r[2];return t&&h in t?o=t[h]:h in i&&(o=i[h]),l in a&&(e=(0,a[l])(e,o,n,s)),e}function g(e,t,n){return e.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(e,s){return t&&s in t?t[s]:s in i?i[s]:(console.log("argument {{"+s+"}} for #"+n+" is undefined."),e)}))}function f(e){var i=function(e){if(!e)return{};var t=e.getAttribute("data-l10n-id"),i=e.getAttribute("data-l10n-args"),n={};if(i)try{n=JSON.parse(i)}catch(e){console.warn("could not parse arguments for #"+t)}return{id:t,args:n}}(e);if(i.id){var n=u(i.id,i.args);if(n){if(n[s]){if(0===function(e){if(e.children)return e.children.length;if(void 0!==e.childElementCount)return e.childElementCount;for(var t=0,i=0;i<e.childNodes.length;i++)t+=1===e.nodeType?1:0;return t}(e))e[s]=n[s];else{for(var r=e.childNodes,a=!1,o=0,l=r.length;o<l;o++)3===r[o].nodeType&&/\S/.test(r[o].nodeValue)&&(a?r[o].nodeValue="":(r[o].nodeValue=n[s],a=!0));if(!a){var h=t.createTextNode(n[s]);e.prepend(h)}}delete n[s]}for(var c in n)e[c]=n[c]}else console.warn("#"+i.id+" is undefined.")}}return a.plural=function(e,t,n,o){var l=parseFloat(t);if(isNaN(l))return e;if(o!=s)return e;a._pluralRules||(a._pluralRules=function(e){function t(e,t){return-1!==t.indexOf(e)}function i(e,t,i){return t<=e&&e<=i}var n={0:function(e){return"other"},1:function(e){return i(e%100,3,10)?"few":0===e?"zero":i(e%100,11,99)?"many":2==e?"two":1==e?"one":"other"},2:function(e){return 0!==e&&e%10==0?"many":2==e?"two":1==e?"one":"other"},3:function(e){return 1==e?"one":"other"},4:function(e){return i(e,0,1)?"one":"other"},5:function(e){return i(e,0,2)&&2!=e?"one":"other"},6:function(e){return 0===e?"zero":e%10==1&&e%100!=11?"one":"other"},7:function(e){return 2==e?"two":1==e?"one":"other"},8:function(e){return i(e,3,6)?"few":i(e,7,10)?"many":2==e?"two":1==e?"one":"other"},9:function(e){return 0===e||1!=e&&i(e%100,1,19)?"few":1==e?"one":"other"},10:function(e){return i(e%10,2,9)&&!i(e%100,11,19)?"few":e%10!=1||i(e%100,11,19)?"other":"one"},11:function(e){return i(e%10,2,4)&&!i(e%100,12,14)?"few":e%10==0||i(e%10,5,9)||i(e%100,11,14)?"many":e%10==1&&e%100!=11?"one":"other"},12:function(e){return i(e,2,4)?"few":1==e?"one":"other"},13:function(e){return i(e%10,2,4)&&!i(e%100,12,14)?"few":1!=e&&i(e%10,0,1)||i(e%10,5,9)||i(e%100,12,14)?"many":1==e?"one":"other"},14:function(e){return i(e%100,3,4)?"few":e%100==2?"two":e%100==1?"one":"other"},15:function(e){return 0===e||i(e%100,2,10)?"few":i(e%100,11,19)?"many":1==e?"one":"other"},16:function(e){return e%10==1&&11!=e?"one":"other"},17:function(e){return 3==e?"few":0===e?"zero":6==e?"many":2==e?"two":1==e?"one":"other"},18:function(e){return 0===e?"zero":i(e,0,2)&&0!==e&&2!=e?"one":"other"},19:function(e){return i(e,2,10)?"few":i(e,0,1)?"one":"other"},20:function(e){return!i(e%10,3,4)&&e%10!=9||i(e%100,10,19)||i(e%100,70,79)||i(e%100,90,99)?e%1e6==0&&0!==e?"many":e%10!=2||t(e%100,[12,72,92])?e%10!=1||t(e%100,[11,71,91])?"other":"one":"two":"few"},21:function(e){return 0===e?"zero":1==e?"one":"other"},22:function(e){return i(e,0,1)||i(e,11,99)?"one":"other"},23:function(e){return i(e%10,1,2)||e%20==0?"one":"other"},24:function(e){return i(e,3,10)||i(e,13,19)?"few":t(e,[2,12])?"two":t(e,[1,11])?"one":"other"}},s={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3}[e.replace(/-.*$/,"")];return s in n?n[s]:(console.warn("plural form unknown for ["+e+"]"),function(){return"other"})}(r));var h="["+a._pluralRules(l)+"]";return 0===l&&n+"[zero]"in i?e=i[n+"[zero]"][o]:1==l&&n+"[one]"in i?e=i[n+"[one]"][o]:2==l&&n+"[two]"in i?e=i[n+"[two]"][o]:n+h in i?e=i[n+h][o]:n+"[other]"in i&&(e=i[n+"[other]"][o]),e},{get:function(e,t,i){var n,r=e.lastIndexOf("."),a=s;r>0&&(a=e.substring(r+1),e=e.substring(0,r)),i&&((n={})[a]=i);var o=u(e,t,n);return o&&a in o?o[a]:"{{"+e+"}}"},getData:function(){return i},getText:function(){return n},getLanguage:function(){return r},setLanguage:function(e,t){d(e,(function(){t&&t()}))},getDirection:function(){var e=r.split("-",1)[0];return["ar","he","fa","ps","ur"].indexOf(e)>=0?"rtl":"ltr"},translate:function(e){for(var i=function(e){return e?e.querySelectorAll("*[data-l10n-id]"):[]}(e=e||t.documentElement),n=i.length,s=0;s<n;s++)f(i[s]);f(e)},getReadyState:function(){return o},ready:function(i){i&&("complete"==o||"interactive"==o?e.setTimeout((function(){i()})):t.addEventListener&&t.addEventListener("localized",(function e(){t.removeEventListener("localized",e),i()})))}}}(window,document)},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFHistory=void 0,t.isDestArraysEqual=o,t.isDestHashesEqual=a;var n=i(2),s=i(9);function r(){return document.location.hash}function a(e,t){return"string"==typeof e&&"string"==typeof t&&(e===t||(0,n.parseQueryString)(e).get("nameddest")===t)}function o(e,t){function i(e,t){if(typeof e!=typeof t)return!1;if(Array.isArray(e)||Array.isArray(t))return!1;if(null!==e&&"object"==typeof e&&null!==t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!i(e[n],t[n]))return!1;return!0}return e===t||Number.isNaN(e)&&Number.isNaN(t)}if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(let n=0,s=e.length;n<s;n++)if(!i(e[n],t[n]))return!1;return!0}t.PDFHistory=class{constructor({linkService:e,eventBus:t}){this.linkService=e,this.eventBus=t,this._initialized=!1,this._fingerprint="",this.reset(),this._boundEvents=null,this.eventBus._on("pagesinit",(()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",(e=>{this._isPagesLoaded=!!e.pagesCount}),{once:!0})}))}initialize({fingerprint:e,resetHistory:t=!1,updateUrl:i=!1}){if(!e||"string"!=typeof e)return void console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');this._initialized&&this.reset();const n=""!==this._fingerprint&&this._fingerprint!==e;this._fingerprint=e,this._updateUrl=!0===i,this._initialized=!0,this._bindEvents();const s=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=r(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this._isValidState(s,!0)||t){const{hash:e,page:i,rotation:s}=this._parseCurrentHash(!0);return!e||n||t?void this._pushOrReplaceState(null,!0):void this._pushOrReplaceState({hash:e,page:i,rotation:s},!0)}const a=s.destination;this._updateInternalState(a,s.uid,!0),void 0!==a.rotation&&(this._initialRotation=a.rotation),a.dest?(this._initialBookmark=JSON.stringify(a.dest),this._destination.page=null):a.hash?this._initialBookmark=a.hash:a.page&&(this._initialBookmark=`page=${a.page}`)}reset(){this._initialized&&(this._pageHide(),this._initialized=!1,this._unbindEvents()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:e=null,explicitDest:t,pageNumber:i}){if(!this._initialized)return;if(e&&"string"!=typeof e)return void console.error(`PDFHistory.push: "${e}" is not a valid namedDest parameter.`);if(!Array.isArray(t))return void console.error(`PDFHistory.push: "${t}" is not a valid explicitDest parameter.`);if(!this._isValidPage(i)&&(null!==i||this._destination))return void console.error(`PDFHistory.push: "${i}" is not a valid pageNumber parameter.`);const n=e||JSON.stringify(t);if(!n)return;let s=!1;if(this._destination&&(a(this._destination.hash,n)||o(this._destination.dest,t))){if(this._destination.page)return;s=!0}this._popStateInProgress&&!s||(this._pushOrReplaceState({dest:t,hash:n,page:i,rotation:this.linkService.rotation},s),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then((()=>{this._popStateInProgress=!1}))))}pushPage(e){this._initialized&&(this._isValidPage(e)?this._destination?.page!==e&&(this._popStateInProgress||(this._pushOrReplaceState({dest:null,hash:`page=${e}`,page:e,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then((()=>{this._popStateInProgress=!1}))))):console.error(`PDFHistory.pushPage: "${e}" is not a valid page number.`))}pushCurrentPosition(){this._initialized&&!this._popStateInProgress&&this._tryPushCurrentPosition()}back(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;this._isValidState(e)&&e.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;this._isValidState(e)&&e.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}_pushOrReplaceState(e,t=!1){const i=t||!this._destination,n={fingerprint:this._fingerprint,uid:i?this._uid:this._uid+1,destination:e};let s;if(this._updateInternalState(e,n.uid),this._updateUrl&&e?.hash){const t=document.location.href.split("#")[0];t.startsWith("file://")||(s=`${t}#${e.hash}`)}i?window.history.replaceState(n,"",s):window.history.pushState(n,"",s)}_tryPushCurrentPosition(e=!1){if(!this._position)return;let t=this._position;if(e&&(t=Object.assign(Object.create(null),this._position),t.temporary=!0),!this._destination)return void this._pushOrReplaceState(t);if(this._destination.temporary)return void this._pushOrReplaceState(t,!0);if(this._destination.hash===t.hash)return;if(!this._destination.page&&this._numPositionUpdates<=50)return;let i=!1;if(this._destination.page>=t.first&&this._destination.page<=t.page){if(void 0!==this._destination.dest||!this._destination.first)return;i=!0}this._pushOrReplaceState(t,i)}_isValidPage(e){return Number.isInteger(e)&&e>0&&e<=this.linkService.pagesCount}_isValidState(e,t=!1){if(!e)return!1;if(e.fingerprint!==this._fingerprint){if(!t)return!1;{if("string"!=typeof e.fingerprint||e.fingerprint.length!==this._fingerprint.length)return!1;const[t]=performance.getEntriesByType("navigation");if("reload"!==t?.type)return!1}}return!(!Number.isInteger(e.uid)||e.uid<0)&&null!==e.destination&&"object"==typeof e.destination}_updateInternalState(e,t,i=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),i&&e?.temporary&&delete e.temporary,this._destination=e,this._uid=t,this._maxUid=Math.max(this._maxUid,t),this._numPositionUpdates=0}_parseCurrentHash(e=!1){const t=unescape(r()).substring(1),i=(0,n.parseQueryString)(t),s=i.get("nameddest")||"";let a=0|i.get("page");return(!this._isValidPage(a)||e&&s.length>0)&&(a=null),{hash:t,page:a,rotation:this.linkService.rotation}}_updateViewarea({location:e}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:e.pdfOpenParams.substring(1),page:this.linkService.page,first:e.pageNumber,rotation:e.rotation},this._popStateInProgress||(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout((()=>{this._popStateInProgress||this._tryPushCurrentPosition(!0),this._updateViewareaTimeout=null}),1e3))}_popState({state:e}){const t=r(),i=this._currentHash!==t;if(this._currentHash=t,!e){this._uid++;const{hash:e,page:t,rotation:i}=this._parseCurrentHash();return void this._pushOrReplaceState({hash:e,page:t,rotation:i},!0)}if(!this._isValidState(e))return;this._popStateInProgress=!0,i&&(this._blockHashChange++,(0,s.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:1e3}).then((()=>{this._blockHashChange--})));const a=e.destination;this._updateInternalState(a,e.uid,!0),(0,n.isValidRotation)(a.rotation)&&(this.linkService.rotation=a.rotation),a.dest?this.linkService.goToDestination(a.dest):a.hash?this.linkService.setHash(a.hash):a.page&&(this.linkService.page=a.page),Promise.resolve().then((()=>{this._popStateInProgress=!1}))}_pageHide(){this._destination&&!this._destination.temporary||this._tryPushCurrentPosition()}_bindEvents(){this._boundEvents||(this._boundEvents={updateViewarea:this._updateViewarea.bind(this),popState:this._popState.bind(this),pageHide:this._pageHide.bind(this)},this.eventBus._on("updateviewarea",this._boundEvents.updateViewarea),window.addEventListener("popstate",this._boundEvents.popState),window.addEventListener("pagehide",this._boundEvents.pageHide))}_unbindEvents(){this._boundEvents&&(this.eventBus._off("updateviewarea",this._boundEvents.updateViewarea),window.removeEventListener("popstate",this._boundEvents.popState),window.removeEventListener("pagehide",this._boundEvents.pageHide),this._boundEvents=null)}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFPageView=void 0;var n=i(4),s=i(2),r=i(14),a=i(6),o=i(15),l=i(7),h=i(5),c=i(16),d=i(17),u=i(18),p=i(19),g=i(20);const f=o.compatibilityParams.maxCanvasPixels||16777216,m=()=>({annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new h.SimpleLinkService}});t.PDFPageView=class{#cs=n.AnnotationMode.ENABLE_FORMS;#ds=!1;#us=null;#ps=null;#gs=null;#fs=null;#ms=s.RenderingStates.INITIAL;#_s=s.TextLayerMode.ENABLE;#vs={directDrawing:!0,initialOptionalContent:!0,regularAnnotations:!0};#bs=new WeakMap;constructor(e){const t=e.container,i=e.defaultViewport;this.id=e.id,this.renderingId="page"+this.id,this.#us=e.layerProperties||m,this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=e.scale||s.DEFAULT_SCALE,this.viewport=i,this.pdfPageRotate=i.rotation,this._optionalContentConfigPromise=e.optionalContentConfigPromise||null,this.#_s=e.textLayerMode??s.TextLayerMode.ENABLE,this.#cs=e.annotationMode??n.AnnotationMode.ENABLE_FORMS,this.imageResourcesPath=e.imageResourcesPath||"",this.isOffscreenCanvasSupported=e.isOffscreenCanvasSupported??!0,this.maxCanvasPixels=e.maxCanvasPixels??f,this.pageColors=e.pageColors||null,this.eventBus=e.eventBus,this.renderingQueue=e.renderingQueue,this.l10n=e.l10n||l.NullL10n,this.renderTask=null,this.resume=null,this._isStandalone=!this.renderingQueue?.hasViewer(),this._container=t,e.useOnlyCssZoom&&(console.error("useOnlyCssZoom was removed, please use `maxCanvasPixels = 0` instead."),this.maxCanvasPixels=0),this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.zoomLayer=null,this.xfaLayer=null,this.structTreeLayer=null;const r=document.createElement("div");if(r.className="page",r.setAttribute("data-page-number",this.id),r.setAttribute("role","region"),this.l10n.get("page_landmark",{page:this.id}).then((e=>{r.setAttribute("aria-label",e)})),this.div=r,this.#Tn(),t?.append(r),this._isStandalone){t?.style.setProperty("--scale-factor",this.scale*n.PixelsPerInch.PDF_TO_CSS_UNITS);const{optionalContentConfigPromise:i}=e;i&&i.then((e=>{i===this._optionalContentConfigPromise&&(this.#vs.initialOptionalContent=e.hasInitialVisibility)}))}}get renderingState(){return this.#ms}set renderingState(e){if(e!==this.#ms)switch(this.#ms=e,this.#ps&&(clearTimeout(this.#ps),this.#ps=null),e){case s.RenderingStates.PAUSED:this.div.classList.remove("loading");break;case s.RenderingStates.RUNNING:this.div.classList.add("loadingIcon"),this.#ps=setTimeout((()=>{this.div.classList.add("loading"),this.#ps=null}),0);break;case s.RenderingStates.INITIAL:case s.RenderingStates.FINISHED:this.div.classList.remove("loadingIcon","loading")}}#Tn(){const{viewport:e}=this;if(this.pdfPage){if(this.#gs===e.rotation)return;this.#gs=e.rotation}(0,n.setLayerDimensions)(this.div,e,!0,!1)}setPdfPage(e){!this._isStandalone||"CanvasText"!==this.pageColors?.foreground&&"Canvas"!==this.pageColors?.background||this._container?.style.setProperty("--hcm-highligh-filter",e.filterFactory.addHighlightHCMFilter("CanvasText","Canvas","HighlightText","Highlight")),this.pdfPage=e,this.pdfPageRotate=e.rotate;const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:this.scale*n.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:t}),this.#Tn(),this.reset()}destroy(){this.reset(),this.pdfPage?.cleanup()}get _textHighlighter(){return(0,n.shadow)(this,"_textHighlighter",new u.TextHighlighter({pageIndex:this.id-1,eventBus:this.eventBus,findController:this.#us().findController}))}async#ys(){let e=null;try{await this.annotationLayer.render(this.viewport,"display")}catch(t){console.error(`#renderAnnotationLayer: "${t}".`),e=t}finally{this.eventBus.dispatch("annotationlayerrendered",{source:this,pageNumber:this.id,error:e})}}async#Ss(){let e=null;try{await this.annotationEditorLayer.render(this.viewport,"display")}catch(t){console.error(`#renderAnnotationEditorLayer: "${t}".`),e=t}finally{this.eventBus.dispatch("annotationeditorlayerrendered",{source:this,pageNumber:this.id,error:e})}}async#Ps(){let e=null;try{const e=await this.xfaLayer.render(this.viewport,"display");e?.textDivs&&this._textHighlighter&&this.#As(e.textDivs)}catch(t){console.error(`#renderXfaLayer: "${t}".`),e=t}finally{this.eventBus.dispatch("xfalayerrendered",{source:this,pageNumber:this.id,error:e})}}async#ws(){const{pdfPage:e,textLayer:t,viewport:i}=this;if(!t)return;let s=null;try{if(!t.renderingDone){const i=e.streamTextContent({includeMarkedContent:!0,disableNormalization:!0});t.setTextContentSource(i)}await t.render(i)}catch(e){if(e instanceof n.AbortException)return;console.error(`#renderTextLayer: "${e}".`),s=e}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.id,numTextDivs:t.numTextDivs,error:s}),this.#Es()}async#Es(){if(!this.textLayer)return;this.structTreeLayer||=new c.StructTreeLayerBuilder;const e=await(this.structTreeLayer.renderingDone?null:this.pdfPage.getStructTree()),t=this.structTreeLayer?.render(e);t&&this.canvas?.append(t),this.structTreeLayer?.show()}async#As(e){const t=await this.pdfPage.getTextContent(),i=[];for(const e of t.items)i.push(e.str);this._textHighlighter.setTextMapping(e,i),this._textHighlighter.enable()}_resetZoomLayer(e=!1){if(!this.zoomLayer)return;const t=this.zoomLayer.firstChild;this.#bs.delete(t),t.width=0,t.height=0,e&&this.zoomLayer.remove(),this.zoomLayer=null}reset({keepZoomLayer:e=!1,keepAnnotationLayer:t=!1,keepAnnotationEditorLayer:i=!1,keepXfaLayer:n=!1,keepTextLayer:r=!1}={}){this.cancelRendering({keepAnnotationLayer:t,keepAnnotationEditorLayer:i,keepXfaLayer:n,keepTextLayer:r}),this.renderingState=s.RenderingStates.INITIAL;const a=this.div,o=a.childNodes,l=e&&this.zoomLayer||null,h=t&&this.annotationLayer?.div||null,c=i&&this.annotationEditorLayer?.div||null,d=n&&this.xfaLayer?.div||null,u=r&&this.textLayer?.div||null;for(let e=o.length-1;e>=0;e--){const t=o[e];switch(t){case l:case h:case c:case d:case u:continue}t.remove()}a.removeAttribute("data-loaded"),h&&this.annotationLayer.hide(),c&&this.annotationEditorLayer.hide(),d&&this.xfaLayer.hide(),u&&this.textLayer.hide(),this.structTreeLayer?.hide(),l||(this.canvas&&(this.#bs.delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer())}update({scale:e=0,rotation:t=null,optionalContentConfigPromise:i=null,drawingDelay:r=-1}){this.scale=e||this.scale,"number"==typeof t&&(this.rotation=t),i instanceof Promise&&(this._optionalContentConfigPromise=i,i.then((e=>{i===this._optionalContentConfigPromise&&(this.#vs.initialOptionalContent=e.hasInitialVisibility)}))),this.#vs.directDrawing=!0;const a=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*n.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:a}),this.#Tn(),this._isStandalone&&this._container?.style.setProperty("--scale-factor",this.viewport.scale),this.canvas){let e=!1;if(this.#ds)if(0===this.maxCanvasPixels)e=!0;else if(this.maxCanvasPixels>0){const{width:t,height:i}=this.viewport,{sx:n,sy:s}=this.outputScale;e=(Math.floor(t)*n|0)*(Math.floor(i)*s|0)>this.maxCanvasPixels}const t=!e&&r>=0&&r<1e3;if(t||e){if(t&&this.renderingState!==s.RenderingStates.FINISHED&&(this.cancelRendering({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:r}),this.renderingState=s.RenderingStates.FINISHED,this.#vs.directDrawing=!1),this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!t,hideTextLayer:t}),t)return;return void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this.#fs})}this.zoomLayer||this.canvas.hidden||(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform({target:this.zoomLayer.firstChild}),this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0})}cancelRendering({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:t=!1,keepXfaLayer:i=!1,keepTextLayer:n=!1,cancelExtraDelay:s=0}={}){this.renderTask&&(this.renderTask.cancel(s),this.renderTask=null),this.resume=null,!this.textLayer||n&&this.textLayer.div||(this.textLayer.cancel(),this.textLayer=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),!this.annotationLayer||e&&this.annotationLayer.div||(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),!this.annotationEditorLayer||t&&this.annotationEditorLayer.div||(this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),!this.xfaLayer||i&&this.xfaLayer.div||(this.xfaLayer.cancel(),this.xfaLayer=null,this._textHighlighter?.disable())}cssTransform({target:e,redrawAnnotationLayer:t=!1,redrawAnnotationEditorLayer:i=!1,redrawXfaLayer:n=!1,redrawTextLayer:s=!1,hideTextLayer:r=!1}){if(!e.hasAttribute("zooming")){e.setAttribute("zooming",!0);const{style:t}=e;t.width=t.height=""}const a=this.#bs.get(e);if(this.viewport!==a){const t=this.viewport.rotation-a.rotation,i=Math.abs(t);let n=1,s=1;if(90===i||270===i){const{width:e,height:t}=this.viewport;n=t/e,s=e/t}e.style.transform=`rotate(${t}deg) scale(${n}, ${s})`}t&&this.annotationLayer&&this.#ys(),i&&this.annotationEditorLayer&&this.#Ss(),n&&this.xfaLayer&&this.#Ps(),this.textLayer&&(r?(this.textLayer.hide(),this.structTreeLayer?.hide()):s&&this.#ws())}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,t){return this.viewport.convertToPdfPoint(e,t)}async#xs(e,t=null){if(e===this.renderTask&&(this.renderTask=null),t instanceof n.RenderingCancelledException)this.#fs=null;else if(this.#fs=t,this.renderingState=s.RenderingStates.FINISHED,this._resetZoomLayer(!0),this.#vs.regularAnnotations=!e.separateAnnots,this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!1,timestamp:performance.now(),error:this.#fs}),t)throw t}async draw(){this.renderingState!==s.RenderingStates.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:e,l10n:t,pageColors:i,pdfPage:o,viewport:l}=this;if(!o)throw this.renderingState=s.RenderingStates.FINISHED,new Error("pdfPage is not loaded");this.renderingState=s.RenderingStates.RUNNING;const h=document.createElement("div");if(h.classList.add("canvasWrapper"),e.append(h),this.textLayer||this.#_s===s.TextLayerMode.DISABLE||o.isPureXfa||(this._accessibilityManager||=new d.TextAccessibilityManager,this.textLayer=new p.TextLayerBuilder({highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,enablePermissions:this.#_s===s.TextLayerMode.ENABLE_PERMISSIONS}),e.append(this.textLayer.div)),!this.annotationLayer&&this.#cs!==n.AnnotationMode.DISABLE){const{annotationStorage:i,downloadManager:s,enableScripting:r,fieldObjectsPromise:l,hasJSActionsPromise:h,linkService:c}=this.#us();this._annotationCanvasMap||=new Map,this.annotationLayer=new a.AnnotationLayerBuilder({pageDiv:e,pdfPage:o,annotationStorage:i,imageResourcesPath:this.imageResourcesPath,renderForms:this.#cs===n.AnnotationMode.ENABLE_FORMS,linkService:c,downloadManager:s,l10n:t,enableScripting:r,hasJSActionsPromise:h,fieldObjectsPromise:l,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager})}const{width:c,height:u}=l,f=document.createElement("canvas");f.setAttribute("role","presentation"),f.hidden=!0;const m=!(!i?.background||!i?.foreground);let _=e=>{m&&!e||(f.hidden=!1,_=null)};h.append(f),this.canvas=f;const v=f.getContext("2d",{alpha:!1}),b=this.outputScale=new s.OutputScale;if(0===this.maxCanvasPixels){const e=1/this.scale;b.sx*=e,b.sy*=e,this.#ds=!0}else if(this.maxCanvasPixels>0){const e=c*u,t=Math.sqrt(this.maxCanvasPixels/e);b.sx>t||b.sy>t?(b.sx=t,b.sy=t,this.#ds=!0):this.#ds=!1}const y=(0,s.approximateFraction)(b.sx),S=(0,s.approximateFraction)(b.sy);f.width=(0,s.roundToDivide)(c*b.sx,y[0]),f.height=(0,s.roundToDivide)(u*b.sy,S[0]);const{style:P}=f;P.width=(0,s.roundToDivide)(c,y[1])+"px",P.height=(0,s.roundToDivide)(u,S[1])+"px",this.#bs.set(f,l);const A={canvasContext:v,transform:b.scaled?[b.sx,0,0,b.sy,0,0]:null,viewport:l,annotationMode:this.#cs,optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:i},w=this.renderTask=this.pdfPage.render(A);w.onContinue=e=>{if(_?.(!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this))return this.renderingState=s.RenderingStates.PAUSED,void(this.resume=()=>{this.renderingState=s.RenderingStates.RUNNING,e()});e()};const E=w.promise.then((async()=>{if(_?.(!0),await this.#xs(w),this.#ws(),this.annotationLayer&&await this.#ys(),!this.annotationEditorLayer){const{annotationEditorUIManager:i}=this.#us();if(!i)return;this.annotationEditorLayer=new r.AnnotationEditorLayerBuilder({uiManager:i,pageDiv:e,pdfPage:o,l10n:t,accessibilityManager:this._accessibilityManager,annotationLayer:this.annotationLayer?.annotationLayer})}this.#Ss()}),(e=>(e instanceof n.RenderingCancelledException||_?.(!0),this.#xs(w,e))));if(o.isPureXfa){if(this.xfaLayer)this.xfaLayer.div&&e.append(this.xfaLayer.div);else{const{annotationStorage:t,linkService:i}=this.#us();this.xfaLayer=new g.XfaLayerBuilder({pageDiv:e,pdfPage:o,annotationStorage:t,linkService:i})}this.#Ps()}return e.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),E}setPageLabel(e){this.pageLabel="string"==typeof e?e:null,null!==this.pageLabel?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){const{directDrawing:e,initialOptionalContent:t,regularAnnotations:i}=this.#vs;return e&&t&&i?this.canvas:null}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditorLayerBuilder=void 0;var n=i(4),s=i(7);t.AnnotationEditorLayerBuilder=class{#wt=null;#Ft;constructor(e){this.pageDiv=e.pageDiv,this.pdfPage=e.pdfPage,this.accessibilityManager=e.accessibilityManager,this.l10n=e.l10n||s.NullL10n,this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,this.#Ft=e.uiManager,this.#wt=e.annotationLayer||null}async render(e,t="display"){if("display"!==t)return;if(this._cancelled)return;const i=e.clone({dontFlip:!0});if(this.div)return this.annotationEditorLayer.update({viewport:i}),void this.show();const s=this.div=document.createElement("div");s.className="annotationEditorLayer",s.tabIndex=0,s.hidden=!0,s.dir=this.#Ft.direction,this.pageDiv.append(s),this.annotationEditorLayer=new n.AnnotationEditorLayer({uiManager:this.#Ft,div:s,accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:i,annotationLayer:this.#wt});const r={viewport:i,div:s,annotations:null,intent:t};this.annotationEditorLayer.render(r),this.show()}cancel(){this._cancelled=!0,this.div&&(this.pageDiv=null,this.annotationEditorLayer.destroy(),this.div.remove())}hide(){this.div&&(this.div.hidden=!0)}show(){this.div&&!this.annotationEditorLayer.isEmpty&&(this.div.hidden=!1)}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.compatibilityParams=t.OptionKind=t.AppOptions=void 0;const i=Object.create(null);t.compatibilityParams=i;{const e=navigator.userAgent||"",t=navigator.platform||"",n=navigator.maxTouchPoints||1,s=/Android/.test(e);(/\b(iPad|iPhone|iPod)(?=;)/.test(e)||"MacIntel"===t&&n>1||s)&&(i.maxCanvasPixels=5242880)}const n={VIEWER:2,API:4,WORKER:8,PREFERENCE:128};t.OptionKind=n;const s={annotationEditorMode:{value:0,kind:n.VIEWER+n.PREFERENCE},annotationMode:{value:2,kind:n.VIEWER+n.PREFERENCE},cursorToolOnLoad:{value:0,kind:n.VIEWER+n.PREFERENCE},defaultZoomDelay:{value:400,kind:n.VIEWER+n.PREFERENCE},defaultZoomValue:{value:"",kind:n.VIEWER+n.PREFERENCE},disableHistory:{value:!1,kind:n.VIEWER},disablePageLabels:{value:!1,kind:n.VIEWER+n.PREFERENCE},enablePermissions:{value:!1,kind:n.VIEWER+n.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:n.VIEWER+n.PREFERENCE},enableScripting:{value:!0,kind:n.VIEWER+n.PREFERENCE},enableStampEditor:{value:!0,kind:n.VIEWER+n.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:n.VIEWER},externalLinkTarget:{value:0,kind:n.VIEWER+n.PREFERENCE},historyUpdateUrl:{value:!1,kind:n.VIEWER+n.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:n.VIEWER+n.PREFERENCE},imageResourcesPath:{value:"./images/",kind:n.VIEWER},maxCanvasPixels:{value:16777216,kind:n.VIEWER},forcePageColors:{value:!1,kind:n.VIEWER+n.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:n.VIEWER+n.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:n.VIEWER+n.PREFERENCE},pdfBugEnabled:{value:!1,kind:n.VIEWER+n.PREFERENCE},printResolution:{value:150,kind:n.VIEWER},sidebarViewOnLoad:{value:-1,kind:n.VIEWER+n.PREFERENCE},scrollModeOnLoad:{value:-1,kind:n.VIEWER+n.PREFERENCE},spreadModeOnLoad:{value:-1,kind:n.VIEWER+n.PREFERENCE},textLayerMode:{value:1,kind:n.VIEWER+n.PREFERENCE},viewerCssTheme:{value:0,kind:n.VIEWER+n.PREFERENCE},viewOnLoad:{value:0,kind:n.VIEWER+n.PREFERENCE},cMapPacked:{value:!0,kind:n.API},cMapUrl:{value:"../web/cmaps/",kind:n.API},disableAutoFetch:{value:!1,kind:n.API+n.PREFERENCE},disableFontFace:{value:!1,kind:n.API+n.PREFERENCE},disableRange:{value:!1,kind:n.API+n.PREFERENCE},disableStream:{value:!1,kind:n.API+n.PREFERENCE},docBaseUrl:{value:"",kind:n.API},enableXfa:{value:!0,kind:n.API+n.PREFERENCE},fontExtraProperties:{value:!1,kind:n.API},isEvalSupported:{value:!0,kind:n.API},isOffscreenCanvasSupported:{value:!0,kind:n.API},maxImageSize:{value:-1,kind:n.API},pdfBug:{value:!1,kind:n.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:n.API},verbosity:{value:1,kind:n.API},workerPort:{value:null,kind:n.WORKER},workerSrc:{value:"../build/pdf.worker.js",kind:n.WORKER}};s.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:n.VIEWER},s.disablePreferences={value:!1,kind:n.VIEWER},s.locale={value:navigator.language||"en-US",kind:n.VIEWER},s.sandboxBundleSrc={value:"../build/pdf.sandbox.js",kind:n.VIEWER};const r=Object.create(null);class a{constructor(){throw new Error("Cannot initialize AppOptions.")}static get(e){const t=r[e];if(void 0!==t)return t;const n=s[e];return void 0!==n?i[e]??n.value:void 0}static getAll(e=null){const t=Object.create(null);for(const a in s){const o=s[a];if(e){if(0==(e&o.kind))continue;if(e===n.PREFERENCE){const e=o.value,i=typeof e;if("boolean"===i||"string"===i||"number"===i&&Number.isInteger(e)){t[a]=e;continue}throw new Error(`Invalid type for preference: ${a}`)}}const l=r[a];t[a]=void 0!==l?l:i[a]??o.value}return t}static set(e,t){r[e]=t}static setAll(e){for(const t in e)r[t]=e[t]}static remove(e){delete r[e]}}t.AppOptions=a,a._hasUserOptions=function(){return Object.keys(r).length>0}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StructTreeLayerBuilder=void 0;var n=i(2);const s={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},r=/^H(\d+)$/;t.StructTreeLayerBuilder=class{#Cs=void 0;get renderingDone(){return void 0!==this.#Cs}render(e){if(void 0!==this.#Cs)return this.#Cs;const t=this.#Ms(e);return t?.classList.add("structTree"),this.#Cs=t}hide(){this.#Cs&&!this.#Cs.hidden&&(this.#Cs.hidden=!0)}show(){this.#Cs?.hidden&&(this.#Cs.hidden=!1)}#Ts(e,t){const{alt:i,id:s,lang:r}=e;void 0!==i&&t.setAttribute("aria-label",(0,n.removeNullCharacters)(i)),void 0!==s&&t.setAttribute("aria-owns",s),void 0!==r&&t.setAttribute("lang",(0,n.removeNullCharacters)(r,!0))}#Ms(e){if(!e)return null;const t=document.createElement("span");if("role"in e){const{role:i}=e,n=i.match(r);n?(t.setAttribute("role","heading"),t.setAttribute("aria-level",n[1])):s[i]&&t.setAttribute("role",s[i])}if(this.#Ts(e,t),e.children)if(1===e.children.length&&"id"in e.children[0])this.#Ts(e.children[0],t);else for(const i of e.children)t.append(this.#Ms(i));return t}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextAccessibilityManager=void 0;var n=i(2);class s{#Ds=!1;#Fs=null;#Ls=new Map;#ks=new Map;setTextMapping(e){this.#Fs=e}static#Rs(e,t){const i=e.getBoundingClientRect(),n=t.getBoundingClientRect();if(0===i.width&&0===i.height)return 1;if(0===n.width&&0===n.height)return-1;const s=i.y,r=i.y+i.height,a=i.y+i.height/2,o=n.y,l=n.y+n.height,h=n.y+n.height/2;return a<=o&&h>=r?-1:h<=s&&a>=l?1:i.x+i.width/2-(n.x+n.width/2)}enable(){if(this.#Ds)throw new Error("TextAccessibilityManager is already enabled.");if(!this.#Fs)throw new Error("Text divs and strings have not been set.");if(this.#Ds=!0,this.#Fs=this.#Fs.slice(),this.#Fs.sort(s.#Rs),this.#Ls.size>0){const e=this.#Fs;for(const[t,i]of this.#Ls)document.getElementById(t)?this.#Is(t,e[i]):this.#Ls.delete(t)}for(const[e,t]of this.#ks)this.addPointerInTextLayer(e,t);this.#ks.clear()}disable(){this.#Ds&&(this.#ks.clear(),this.#Fs=null,this.#Ds=!1)}removePointerInTextLayer(e){if(!this.#Ds)return void this.#ks.delete(e);const t=this.#Fs;if(!t||0===t.length)return;const{id:i}=e,n=this.#Ls.get(i);if(void 0===n)return;const s=t[n];this.#Ls.delete(i);let r=s.getAttribute("aria-owns");r?.includes(i)&&(r=r.split(" ").filter((e=>e!==i)).join(" "),r?s.setAttribute("aria-owns",r):(s.removeAttribute("aria-owns"),s.setAttribute("role","presentation")))}#Is(e,t){const i=t.getAttribute("aria-owns");i?.includes(e)||t.setAttribute("aria-owns",i?`${i} ${e}`:e),t.removeAttribute("role")}addPointerInTextLayer(e,t){const{id:i}=e;if(!i)return null;if(!this.#Ds)return this.#ks.set(e,t),null;t&&this.removePointerInTextLayer(e);const r=this.#Fs;if(!r||0===r.length)return null;const a=(0,n.binarySearchFirstItem)(r,(t=>s.#Rs(e,t)<0)),o=Math.max(0,a-1),l=r[o];this.#Is(i,l),this.#Ls.set(i,o);const h=l.parentNode;return h?.classList.contains("markedContent")?h.id:null}moveElementInDOM(e,t,i,r){const a=this.addPointerInTextLayer(i,r);if(!e.hasChildNodes())return e.append(t),a;const o=Array.from(e.childNodes).filter((e=>e!==t));if(0===o.length)return a;const l=i||t,h=(0,n.binarySearchFirstItem)(o,(e=>s.#Rs(l,e)<0));return 0===h?o[0].before(t):o[h-1].after(t),a}}t.TextAccessibilityManager=s},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextHighlighter=void 0,t.TextHighlighter=class{constructor({findController:e,eventBus:t,pageIndex:i}){this.findController=e,this.matches=[],this.eventBus=t,this.pageIdx=i,this._onUpdateTextLayerMatches=null,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(e,t){this.textDivs=e,this.textContentItemsStr=t}enable(){if(!this.textDivs||!this.textContentItemsStr)throw new Error("Text divs and strings have not been set.");if(this.enabled)throw new Error("TextHighlighter is already enabled.");this.enabled=!0,this._onUpdateTextLayerMatches||(this._onUpdateTextLayerMatches=e=>{e.pageIndex!==this.pageIdx&&-1!==e.pageIndex||this._updateMatches()},this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches)),this._updateMatches()}disable(){this.enabled&&(this.enabled=!1,this._onUpdateTextLayerMatches&&(this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches),this._onUpdateTextLayerMatches=null),this._updateMatches(!0))}_convertMatches(e,t){if(!e)return[];const{textContentItemsStr:i}=this;let n=0,s=0;const r=i.length-1,a=[];for(let o=0,l=e.length;o<l;o++){let l=e[o];for(;n!==r&&l>=s+i[n].length;)s+=i[n].length,n++;n===i.length&&console.error("Could not find a matching mapping");const h={begin:{divIdx:n,offset:l-s}};for(l+=t[o];n!==r&&l>s+i[n].length;)s+=i[n].length,n++;h.end={divIdx:n,offset:l-s},a.push(h)}return a}_renderMatches(e){if(0===e.length)return;const{findController:t,pageIdx:i}=this,{textContentItemsStr:n,textDivs:s}=this,r=i===t.selected.pageIdx,a=t.selected.matchIdx;let o=null;const l={divIdx:-1,offset:void 0};function h(e,t){const i=e.divIdx;return s[i].textContent="",c(i,0,e.offset,t)}function c(e,t,i,r){let a=s[e];if(a.nodeType===Node.TEXT_NODE){const t=document.createElement("span");a.before(t),t.append(a),s[e]=t,a=t}const o=n[e].substring(t,i),l=document.createTextNode(o);if(r){const e=document.createElement("span");return e.className=`${r} appended`,e.append(l),a.append(e),r.includes("selected")?e.offsetLeft:0}return a.append(l),0}let d=a,u=d+1;if(t.state.highlightAll)d=0,u=e.length;else if(!r)return;let p=-1,g=-1;for(let n=d;n<u;n++){const d=e[n],u=d.begin;if(u.divIdx===p&&u.offset===g)continue;p=u.divIdx,g=u.offset;const f=d.end,m=r&&n===a,_=m?" selected":"";let v=0;if(o&&u.divIdx===o.divIdx?c(o.divIdx,o.offset,u.offset):(null!==o&&c(o.divIdx,o.offset,l.offset),h(u)),u.divIdx===f.divIdx)v=c(u.divIdx,u.offset,f.offset,"highlight"+_);else{v=c(u.divIdx,u.offset,l.offset,"highlight begin"+_);for(let e=u.divIdx+1,t=f.divIdx;e<t;e++)s[e].className="highlight middle"+_;h(f,"highlight end"+_)}o=f,m&&t.scrollMatchIntoView({element:s[u.divIdx],selectedLeft:v,pageIndex:i,matchIndex:a})}o&&c(o.divIdx,o.offset,l.offset)}_updateMatches(e=!1){if(!this.enabled&&!e)return;const{findController:t,matches:i,pageIdx:n}=this,{textContentItemsStr:s,textDivs:r}=this;let a=-1;for(const e of i){for(let t=Math.max(a,e.begin.divIdx),i=e.end.divIdx;t<=i;t++){const e=r[t];e.textContent=s[t],e.className=""}a=e.end.divIdx+1}if(!t?.highlightMatches||e)return;const o=t.pageMatches[n]||null,l=t.pageMatchesLength[n]||null;this.matches=this._convertMatches(o,l),this._renderMatches(this.matches)}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayerBuilder=void 0;var n=i(4),s=i(2);t.TextLayerBuilder=class{#Os=!1;#Ns=0;#Bs=0;#Vs=null;constructor({highlighter:e=null,accessibilityManager:t=null,isOffscreenCanvasSupported:i=!0,enablePermissions:n=!1}){this.textContentItemsStr=[],this.renderingDone=!1,this.textDivs=[],this.textDivProperties=new WeakMap,this.textLayerRenderTask=null,this.highlighter=e,this.accessibilityManager=t,this.isOffscreenCanvasSupported=i,this.#Os=!0===n,this.div=document.createElement("div"),this.div.className="textLayer",this.hide()}#Us(){this.renderingDone=!0;const e=document.createElement("div");e.className="endOfContent",this.div.append(e),this.#js()}get numTextDivs(){return this.textDivs.length}async render(e){if(!this.#Vs)throw new Error('No "textContentSource" parameter specified.');const t=e.scale*(globalThis.devicePixelRatio||1),{rotation:i}=e;if(this.renderingDone){const s=i!==this.#Ns,r=t!==this.#Bs;return(s||r)&&(this.hide(),(0,n.updateTextLayer)({container:this.div,viewport:e,textDivs:this.textDivs,textDivProperties:this.textDivProperties,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,mustRescale:r,mustRotate:s}),this.#Bs=t,this.#Ns=i),void this.show()}this.cancel(),this.highlighter?.setTextMapping(this.textDivs,this.textContentItemsStr),this.accessibilityManager?.setTextMapping(this.textDivs),this.textLayerRenderTask=(0,n.renderTextLayer)({textContentSource:this.#Vs,container:this.div,viewport:e,textDivs:this.textDivs,textDivProperties:this.textDivProperties,textContentItemsStr:this.textContentItemsStr,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported}),await this.textLayerRenderTask.promise,this.#Us(),this.#Bs=t,this.#Ns=i,this.show(),this.accessibilityManager?.enable()}hide(){this.div.hidden||(this.highlighter?.disable(),this.div.hidden=!0)}show(){this.div.hidden&&this.renderingDone&&(this.div.hidden=!1,this.highlighter?.enable())}cancel(){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this.highlighter?.disable(),this.accessibilityManager?.disable(),this.textContentItemsStr.length=0,this.textDivs.length=0,this.textDivProperties=new WeakMap}setTextContentSource(e){this.cancel(),this.#Vs=e}#js(){const{div:e}=this;e.addEventListener("mousedown",(t=>{const i=e.querySelector(".endOfContent");if(!i)return;let n=t.target!==e;if(n&&="none"!==getComputedStyle(i).getPropertyValue("-moz-user-select"),n){const n=e.getBoundingClientRect(),s=Math.max(0,(t.pageY-n.top)/n.height);i.style.top=(100*s).toFixed(2)+"%"}i.classList.add("active")})),e.addEventListener("mouseup",(()=>{const t=e.querySelector(".endOfContent");t&&(t.style.top="",t.classList.remove("active"))})),e.addEventListener("copy",(e=>{if(!this.#Os){const t=document.getSelection();e.clipboardData.setData("text/plain",(0,s.removeNullCharacters)((0,n.normalizeUnicode)(t.toString())))}e.preventDefault(),e.stopPropagation()}))}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayerBuilder=void 0;var n=i(4);t.XfaLayerBuilder=class{constructor({pageDiv:e,pdfPage:t,annotationStorage:i=null,linkService:n,xfaHtml:s=null}){this.pageDiv=e,this.pdfPage=t,this.annotationStorage=i,this.linkService=n,this.xfaHtml=s,this.div=null,this._cancelled=!1}async render(e,t="display"){if("print"===t){const i={viewport:e.clone({dontFlip:!0}),div:this.div,xfaHtml:this.xfaHtml,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:t},s=document.createElement("div");return this.pageDiv.append(s),i.div=s,n.XfaLayer.render(i)}const i=await this.pdfPage.getXfa();if(this._cancelled||!i)return{textDivs:[]};const s={viewport:e.clone({dontFlip:!0}),div:this.div,xfaHtml:i,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:t};return this.div?n.XfaLayer.update(s):(this.div=document.createElement("div"),this.pageDiv.append(this.div),s.div=this.div,n.XfaLayer.render(s))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFScriptingManager=void 0;var n=i(22),s=i(23);class r extends s.PDFScriptingManager{constructor(e){e.externalServices||window.addEventListener("updatefromsandbox",(t=>{e.eventBus.dispatch("updatefromsandbox",{source:window,detail:t.detail})})),e.externalServices||={createScripting:({sandboxBundleSrc:e})=>new n.GenericScripting(e)},e.docProperties||=e=>(0,n.docProperties)(e),super(e)}}t.PDFScriptingManager=r},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GenericScripting=void 0,t.docProperties=async function(e){const t="".split("#")[0];let{info:i,metadata:s,contentDispositionFilename:r,contentLength:a}=await e.getMetadata();if(!a){const{length:t}=await e.getDownloadInfo();a=t}return{...i,baseURL:t,filesize:a,filename:r||(0,n.getPdfFilenameFromUrl)(""),metadata:s?.getRaw(),authors:s?.get("dc:creator"),numPages:e.numPages,URL:""}};var n=i(4);t.GenericScripting=class{constructor(e){this._ready=(0,n.loadScript)(e,!0).then((()=>window.pdfjsSandbox.QuickJSSandbox()))}async createSandbox(e){(await this._ready).create(e)}async dispatchEventInSandbox(e){const t=await this._ready;setTimeout((()=>t.dispatchEvent(e)),0)}async destroySandbox(){(await this._ready).nukeSandbox()}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFScriptingManager=void 0;var n=i(2),s=i(4);t.PDFScriptingManager=class{#Hs=null;#Ws=null;#zs=null;#Gs=null;#$s=null;#qs=null;#Xs=null;#Ks=!1;#Ys=null;#Qs=null;#Js=null;constructor({eventBus:e,sandboxBundleSrc:t=null,externalServices:i=null,docProperties:n=null}){this.#Gs=e,this.#Ys=t,this.#$s=i,this.#zs=n}setViewer(e){this.#Xs=e}async setDocument(e){if(this.#qs&&await this.#Zs(),this.#qs=e,!e)return;const[t,i,n]=await Promise.all([e.getFieldObjects(),e.getCalculationOrderIds(),e.getJSActions()]);if(t||n){if(e===this.#qs){try{this.#Qs=this.#er()}catch(e){return console.error(`setDocument: "${e.message}".`),void await this.#Zs()}this._internalEvents.set("updatefromsandbox",(e=>{e?.source===window&&this.#tr(e.detail)})),this._internalEvents.set("dispatcheventinsandbox",(e=>{this.#Qs?.dispatchEventInSandbox(e.detail)})),this._internalEvents.set("pagechanging",(({pageNumber:e,previous:t})=>{e!==t&&(this.#ir(t),this.#nr(e))})),this._internalEvents.set("pagerendered",(({pageNumber:e})=>{this._pageOpenPending.has(e)&&e===this.#Xs.currentPageNumber&&this.#nr(e)})),this._internalEvents.set("pagesdestroy",(async()=>{await this.#ir(this.#Xs.currentPageNumber),await(this.#Qs?.dispatchEventInSandbox({id:"doc",name:"WillClose"})),this.#Hs?.resolve()}));for(const[e,t]of this._internalEvents)this.#Gs._on(e,t);try{const s=await this.#zs(e);if(e!==this.#qs)return;await this.#Qs.createSandbox({objects:t,calculationOrder:i,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...s,actions:n}}),this.#Gs.dispatch("sandboxcreated",{source:this})}catch(e){return console.error(`setDocument: "${e.message}".`),void await this.#Zs()}await(this.#Qs?.dispatchEventInSandbox({id:"doc",name:"Open"})),await this.#nr(this.#Xs.currentPageNumber,!0),Promise.resolve().then((()=>{e===this.#qs&&(this.#Ks=!0)}))}}else await this.#Zs()}async dispatchWillSave(){return this.#Qs?.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(){return this.#Qs?.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(){if(this.#Qs){await(this.#Js?.promise),this.#Js=new s.PromiseCapability;try{await this.#Qs.dispatchEventInSandbox({id:"doc",name:"WillPrint"})}catch(e){throw this.#Js.resolve(),this.#Js=null,e}await this.#Js.promise}}async dispatchDidPrint(){return this.#Qs?.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get destroyPromise(){return this.#Ws?.promise||null}get ready(){return this.#Ks}get _internalEvents(){return(0,s.shadow)(this,"_internalEvents",new Map)}get _pageOpenPending(){return(0,s.shadow)(this,"_pageOpenPending",new Set)}get _visitedPages(){return(0,s.shadow)(this,"_visitedPages",new Map)}async#tr(e){const t=this.#Xs,i=t.isInPresentationMode||t.isChangingPresentationMode,{id:s,siblings:r,command:a,value:o}=e;if(!s){switch(a){case"clear":console.clear();break;case"error":console.error(o);break;case"layout":if(!i){const e=(0,n.apiPageLayoutToViewerModes)(o);t.spreadMode=e.spreadMode}break;case"page-num":t.currentPageNumber=o+1;break;case"print":await t.pagesPromise,this.#Gs.dispatch("print",{source:this});break;case"println":console.log(o);break;case"zoom":i||(t.currentScaleValue=o);break;case"SaveAs":this.#Gs.dispatch("download",{source:this});break;case"FirstPage":t.currentPageNumber=1;break;case"LastPage":t.currentPageNumber=t.pagesCount;break;case"NextPage":t.nextPage();break;case"PrevPage":t.previousPage();break;case"ZoomViewIn":i||t.increaseScale();break;case"ZoomViewOut":i||t.decreaseScale();break;case"WillPrintFinished":this.#Js?.resolve(),this.#Js=null}return}if(i&&e.focus)return;delete e.id,delete e.siblings;const l=r?[s,...r]:[s];for(const t of l){const i=document.querySelector(`[data-element-id="${t}"]`);i?i.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:e})):this.#qs?.annotationStorage.setValue(t,e)}}async#nr(e,t=!1){const i=this.#qs,r=this._visitedPages;if(t&&(this.#Hs=new s.PromiseCapability),!this.#Hs)return;const a=this.#Xs.getPageView(e-1);if(a?.renderingState!==n.RenderingStates.FINISHED)return void this._pageOpenPending.add(e);this._pageOpenPending.delete(e);const o=(async()=>{const t=await(r.has(e)?null:a.pdfPage?.getJSActions());i===this.#qs&&await(this.#Qs?.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:e,actions:t}))})();r.set(e,o)}async#ir(e){const t=this.#qs,i=this._visitedPages;if(!this.#Hs)return;if(this._pageOpenPending.has(e))return;const n=i.get(e);n&&(i.set(e,null),await n,t===this.#qs&&await(this.#Qs?.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:e})))}#er(){if(this.#Ws=new s.PromiseCapability,this.#Qs)throw new Error("#initScripting: Scripting already exists.");return this.#$s.createScripting({sandboxBundleSrc:this.#Ys})}async#Zs(){if(!this.#Qs)return this.#qs=null,void this.#Ws?.resolve();this.#Hs&&(await Promise.race([this.#Hs.promise,new Promise((e=>{setTimeout(e,1e3)}))]).catch((()=>{})),this.#Hs=null),this.#qs=null;try{await this.#Qs.destroySandbox()}catch{}this.#Js?.reject(new Error("Scripting destroyed.")),this.#Js=null;for(const[e,t]of this._internalEvents)this.#Gs._off(e,t);this._internalEvents.clear(),this._pageOpenPending.clear(),this._visitedPages.clear(),this.#Qs=null,this.#Ks=!1,this.#Ws?.resolve()}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFSinglePageViewer=void 0;var n=i(2),s=i(25);class r extends s.PDFViewer{_resetView(){super._resetView(),this._scrollMode=n.ScrollMode.PAGE,this._spreadMode=n.SpreadMode.NONE}set scrollMode(e){}_updateScrollMode(){}set spreadMode(e){}_updateSpreadMode(){}}t.PDFSinglePageViewer=r},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PagesCountLimit=t.PDFViewer=t.PDFPageViewBuffer=void 0;var n=i(4),s=i(2),r=i(7),a=i(13),o=i(26),l=i(5);const h={FORCE_SCROLL_MODE_PAGE:15e3,FORCE_LAZY_PAGE_INIT:7500,PAUSE_EAGER_PAGE_INIT:250};function c(e){return Object.values(n.AnnotationEditorType).includes(e)&&e!==n.AnnotationEditorType.DISABLE}t.PagesCountLimit=h;class d{#sr=new Set;#rr=0;constructor(e){this.#rr=e}push(e){const t=this.#sr;t.has(e)&&t.delete(e),t.add(e),t.size>this.#rr&&this.#ar()}resize(e,t=null){this.#rr=e;const i=this.#sr;if(t){const e=i.size;let n=1;for(const s of i)if(t.has(s.id)&&(i.delete(s),i.add(s)),++n>e)break}for(;i.size>this.#rr;)this.#ar()}has(e){return this.#sr.has(e)}[Symbol.iterator](){return this.#sr.keys()}#ar(){const e=this.#sr.keys().next().value;e?.destroy(),this.#sr.delete(e)}}t.PDFPageViewBuffer=d,t.PDFViewer=class{#or=null;#ne=null;#lr=n.AnnotationEditorType.NONE;#hr=null;#cs=n.AnnotationMode.ENABLE_FORMS;#cr=null;#dr=null;#Os=!1;#ur=!1;#pr=null;#gr=!1;#fr=0;#mr=new ResizeObserver(this.#_r.bind(this));#vr=null;#br=null;#yr=null;#_s=s.TextLayerMode.ENABLE;constructor(e){const t="3.11.174";if(n.version!==t)throw new Error(`The API version "${n.version}" does not match the Viewer version "${t}".`);if(this.container=e.container,this.viewer=e.viewer||e.container.firstElementChild,"DIV"!==this.container?.tagName||"DIV"!==this.viewer?.tagName)throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&"absolute"!==getComputedStyle(this.container).position)throw new Error("The `container` must be absolutely positioned.");this.#mr.observe(this.container),this.eventBus=e.eventBus,this.linkService=e.linkService||new l.SimpleLinkService,this.downloadManager=e.downloadManager||null,this.findController=e.findController||null,this.#ne=e.altTextManager||null,this.findController&&(this.findController.onIsPageVisible=e=>this._getVisiblePages().ids.has(e)),this._scriptingManager=e.scriptingManager||null,this.#_s=e.textLayerMode??s.TextLayerMode.ENABLE,this.#cs=e.annotationMode??n.AnnotationMode.ENABLE_FORMS,this.#lr=e.annotationEditorMode??n.AnnotationEditorType.NONE,this.imageResourcesPath=e.imageResourcesPath||"",this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1,this.removePageBorders=e.removePageBorders||!1,e.useOnlyCssZoom&&(console.error("useOnlyCssZoom was removed, please use `maxCanvasPixels = 0` instead."),e.maxCanvasPixels=0),this.isOffscreenCanvasSupported=e.isOffscreenCanvasSupported??!0,this.maxCanvasPixels=e.maxCanvasPixels,this.l10n=e.l10n||r.NullL10n,this.#Os=e.enablePermissions||!1,this.pageColors=e.pageColors||null,this.defaultRenderingQueue=!e.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new o.PDFRenderingQueue,this.renderingQueue.setViewer(this)):this.renderingQueue=e.renderingQueue,this.scroll=(0,s.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=s.PresentationModeState.UNKNOWN,this._onBeforeDraw=this._onAfterDraw=null,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),this.#Sr(),this.eventBus._on("thumbnailrendered",(({pageNumber:e,pdfPage:t})=>{const i=this._pages[e-1];this.#or.has(i)||t?.cleanup()}))}get pagesCount(){return this._pages.length}getPageView(e){return this._pages[e]}getCachedPageViews(){return new Set(this.#or)}get pageViewsReady(){return this._pagesCapability.settled&&this._pages.every((e=>e?.pdfPage))}get renderForms(){return this.#cs===n.AnnotationMode.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(e){if(!Number.isInteger(e))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(e,!0)||console.error(`currentPageNumber: "${e}" is not a valid page.`))}_setCurrentPageNumber(e,t=!1){if(this._currentPageNumber===e)return t&&this.#Pr(),!0;if(!(0<e&&e<=this.pagesCount))return!1;const i=this._currentPageNumber;return this._currentPageNumber=e,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:e,pageLabel:this._pageLabels?.[e-1]??null,previous:i}),t&&this.#Pr(),!0}get currentPageLabel(){return this._pageLabels?.[this._currentPageNumber-1]??null}set currentPageLabel(e){if(!this.pdfDocument)return;let t=0|e;if(this._pageLabels){const i=this._pageLabels.indexOf(e);i>=0&&(t=i+1)}this._setCurrentPageNumber(t,!0)||console.error(`currentPageLabel: "${e}" is not a valid page.`)}get currentScale(){return this._currentScale!==s.UNKNOWN_SCALE?this._currentScale:s.DEFAULT_SCALE}set currentScale(e){if(isNaN(e))throw new Error("Invalid numeric scale.");this.pdfDocument&&this.#Ar(e,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(e){this.pdfDocument&&this.#Ar(e,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!(0,s.isValidRotation)(e))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument)return;if((e%=360)<0&&(e+=360),this._pagesRotation===e)return;this._pagesRotation=e;const t=this._currentPageNumber;this.refresh(!0,{rotation:e}),this._currentScaleValue&&this.#Ar(this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:e,pageNumber:t}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}#us(){const e=this;return{get annotationEditorUIManager(){return e.#hr},get annotationStorage(){return e.pdfDocument?.annotationStorage},get downloadManager(){return e.downloadManager},get enableScripting(){return!!e._scriptingManager},get fieldObjectsPromise(){return e.pdfDocument?.getFieldObjects()},get findController(){return e.findController},get hasJSActionsPromise(){return e.pdfDocument?.hasJSActions()},get linkService(){return e.linkService}}}#wr(e){const t={annotationEditorMode:this.#lr,annotationMode:this.#cs,textLayerMode:this.#_s};return e?(e.includes(n.PermissionFlag.COPY)||this.#_s!==s.TextLayerMode.ENABLE||(t.textLayerMode=s.TextLayerMode.ENABLE_PERMISSIONS),e.includes(n.PermissionFlag.MODIFY_CONTENTS)||(t.annotationEditorMode=n.AnnotationEditorType.DISABLE),e.includes(n.PermissionFlag.MODIFY_ANNOTATIONS)||e.includes(n.PermissionFlag.FILL_INTERACTIVE_FORMS)||this.#cs!==n.AnnotationMode.ENABLE_FORMS||(t.annotationMode=n.AnnotationMode.ENABLE),t):t}#Er(){if("hidden"===document.visibilityState||!this.container.offsetParent||0===this._getVisiblePages().views.length)return Promise.resolve();const e=new Promise((e=>{this.#br=()=>{"hidden"===document.visibilityState&&(e(),document.removeEventListener("visibilitychange",this.#br),this.#br=null)},document.addEventListener("visibilitychange",this.#br)}));return Promise.race([this._onePageRenderedCapability.promise,e])}async getAllText(){const e=[],t=[];for(let i=1,n=this.pdfDocument.numPages;i<=n;++i){if(this.#gr)return null;t.length=0;const n=await this.pdfDocument.getPage(i),{items:r}=await n.getTextContent();for(const e of r)e.str&&t.push(e.str),e.hasEOL&&t.push("\n");e.push((0,s.removeNullCharacters)(t.join("")))}return e.join("\n")}#xr(e,t){const i=document.getSelection(),{focusNode:n,anchorNode:r}=i;if(r&&n&&i.containsNode(this.#pr)){if(this.#ur||e===s.TextLayerMode.ENABLE_PERMISSIONS)return t.preventDefault(),void t.stopPropagation();this.#ur=!0;const i=this.container.style.cursor;this.container.style.cursor="wait";const n=e=>this.#gr="Escape"===e.key;window.addEventListener("keydown",n),this.getAllText().then((async e=>{null!==e&&await navigator.clipboard.writeText(e)})).catch((e=>{console.warn(`Something goes wrong when extracting the text: ${e.message}`)})).finally((()=>{this.#ur=!1,this.#gr=!1,window.removeEventListener("keydown",n),this.container.style.cursor=i})),t.preventDefault(),t.stopPropagation()}}setDocument(e){if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),this.findController?.setDocument(null),this._scriptingManager?.setDocument(null),this.#hr&&(this.#hr.destroy(),this.#hr=null)),this.pdfDocument=e,!e)return;const t=e.numPages,i=e.getPage(1),r=e.getOptionalContentConfig(),o=this.#Os?e.getPermissions():Promise.resolve();if(t>h.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const e=this._scrollMode=s.ScrollMode.PAGE;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e})}this._pagesCapability.promise.then((()=>{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:t})}),(()=>{})),this._onBeforeDraw=e=>{const t=this._pages[e.pageNumber-1];t&&this.#or.push(t)},this.eventBus._on("pagerender",this._onBeforeDraw),this._onAfterDraw=e=>{e.cssTransform||this._onePageRenderedCapability.settled||(this._onePageRenderedCapability.resolve({timestamp:e.timestamp}),this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null,this.#br&&(document.removeEventListener("visibilitychange",this.#br),this.#br=null))},this.eventBus._on("pagerendered",this._onAfterDraw),Promise.all([i,o]).then((([i,o])=>{if(e!==this.pdfDocument)return;this._firstPageCapability.resolve(i),this._optionalContentConfigPromise=r;const{annotationEditorMode:l,annotationMode:d,textLayerMode:u}=this.#wr(o);if(u!==s.TextLayerMode.DISABLE){const e=this.#pr=document.createElement("div");e.id="hiddenCopyElement",this.viewer.before(e)}if(l!==n.AnnotationEditorType.DISABLE){const t=l;e.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):c(t)?(this.#hr=new n.AnnotationEditorUIManager(this.container,this.viewer,this.#ne,this.eventBus,e,this.pageColors),t!==n.AnnotationEditorType.NONE&&this.#hr.updateMode(t)):console.error(`Invalid AnnotationEditor mode: ${t}`)}const p=this.#us.bind(this),g=this._scrollMode===s.ScrollMode.PAGE?null:this.viewer,f=this.currentScale,m=i.getViewport({scale:f*n.PixelsPerInch.PDF_TO_CSS_UNITS});this.viewer.style.setProperty("--scale-factor",m.scale),"CanvasText"!==this.pageColors?.foreground&&"Canvas"!==this.pageColors?.background||this.viewer.style.setProperty("--hcm-highligh-filter",e.filterFactory.addHighlightHCMFilter("CanvasText","Canvas","HighlightText","Highlight"));for(let e=1;e<=t;++e){const t=new a.PDFPageView({container:g,eventBus:this.eventBus,id:e,scale:f,defaultViewport:m.clone(),optionalContentConfigPromise:r,renderingQueue:this.renderingQueue,textLayerMode:u,annotationMode:d,imageResourcesPath:this.imageResourcesPath,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,maxCanvasPixels:this.maxCanvasPixels,pageColors:this.pageColors,l10n:this.l10n,layerProperties:p});this._pages.push(t)}const _=this._pages[0];_&&(_.setPdfPage(i),this.linkService.cachePageRef(1,i.ref)),this._scrollMode===s.ScrollMode.PAGE?this.#Cr():this._spreadMode!==s.SpreadMode.NONE&&this._updateSpreadMode(),this.#Er().then((async()=>{if(this.findController?.setDocument(e),this._scriptingManager?.setDocument(e),this.#pr&&(this.#dr=this.#xr.bind(this,u),document.addEventListener("copy",this.#dr)),this.#hr&&this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:this.#lr}),e.loadingParams.disableAutoFetch||t>h.FORCE_LAZY_PAGE_INIT)return void this._pagesCapability.resolve();let i=t-1;if(i<=0)this._pagesCapability.resolve();else for(let n=2;n<=t;++n){const t=e.getPage(n).then((e=>{const t=this._pages[n-1];t.pdfPage||t.setPdfPage(e),this.linkService.cachePageRef(n,e.ref),0==--i&&this._pagesCapability.resolve()}),(e=>{console.error(`Unable to get page ${n} to initialize viewer`,e),0==--i&&this._pagesCapability.resolve()}));n%h.PAUSE_EAGER_PAGE_INIT==0&&await t}})),this.eventBus.dispatch("pagesinit",{source:this}),e.getMetadata().then((({info:t})=>{e===this.pdfDocument&&t.Language&&(this.viewer.lang=t.Language)})),this.defaultRenderingQueue&&this.update()})).catch((e=>{console.error("Unable to initialize viewer",e),this._pagesCapability.reject(e)}))}setPageLabels(e){if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let e=0,t=this._pages.length;e<t;e++)this._pages[e].setPageLabel(this._pageLabels?.[e]??null)}}_resetView(){this._pages=[],this._currentPageNumber=1,this._currentScale=s.UNKNOWN_SCALE,this._currentScaleValue=null,this._pageLabels=null,this.#or=new d(10),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=new n.PromiseCapability,this._onePageRenderedCapability=new n.PromiseCapability,this._pagesCapability=new n.PromiseCapability,this._scrollMode=s.ScrollMode.VERTICAL,this._previousScrollMode=s.ScrollMode.UNKNOWN,this._spreadMode=s.SpreadMode.NONE,this.#vr={previousPageNumber:1,scrollDown:!0,pages:[]},this._onBeforeDraw&&(this.eventBus._off("pagerender",this._onBeforeDraw),this._onBeforeDraw=null),this._onAfterDraw&&(this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null),this.#br&&(document.removeEventListener("visibilitychange",this.#br),this.#br=null),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),this.#pr&&(document.removeEventListener("copy",this.#dr),this.#dr=null,this.#pr.remove(),this.#pr=null)}#Cr(){if(this._scrollMode!==s.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const e=this._currentPageNumber,t=this.#vr,i=this.viewer;if(i.textContent="",t.pages.length=0,this._spreadMode!==s.SpreadMode.NONE||this.isInPresentationMode){const n=new Set,s=this._spreadMode-1;-1===s?n.add(e-1):e%2!==s?(n.add(e-1),n.add(e)):(n.add(e-2),n.add(e-1));const r=document.createElement("div");if(r.className="spread",this.isInPresentationMode){const e=document.createElement("div");e.className="dummyPage",r.append(e)}for(const e of n){const i=this._pages[e];i&&(r.append(i.div),t.pages.push(i))}i.append(r)}else{const n=this._pages[e-1];i.append(n.div),t.pages.push(n)}t.scrollDown=e>=t.previousPageNumber,t.previousPageNumber=e}_scrollUpdate(){0!==this.pagesCount&&this.update()}#Mr(e,t=null){const{div:i,id:n}=e;if(this._currentPageNumber!==n&&this._setCurrentPageNumber(n),this._scrollMode===s.ScrollMode.PAGE&&(this.#Cr(),this.update()),!t&&!this.isInPresentationMode){const e=i.offsetLeft+i.clientLeft,n=e+i.clientWidth,{scrollLeft:r,clientWidth:a}=this.container;(this._scrollMode===s.ScrollMode.HORIZONTAL||e<r||n>r+a)&&(t={left:0,top:0})}(0,s.scrollIntoView)(i,t),!this._currentScaleValue&&this._location&&(this._location=null)}#Tr(e){return e===this._currentScale||Math.abs(e-this._currentScale)<1e-15}#Dr(e,t,{noScroll:i=!1,preset:s=!1,drawingDelay:r=-1}){if(this._currentScaleValue=t.toString(),this.#Tr(e))return void(s&&this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:t}));this.viewer.style.setProperty("--scale-factor",e*n.PixelsPerInch.PDF_TO_CSS_UNITS);const a=r>=0&&r<1e3;if(this.refresh(!0,{scale:e,drawingDelay:a?r:-1}),a&&(this.#yr=setTimeout((()=>{this.#yr=null,this.refresh()}),r)),this._currentScale=e,!i){let e,t=this._currentPageNumber;!this._location||this.isInPresentationMode||this.isChangingPresentationMode||(t=this._location.pageNumber,e=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:t,destArray:e,allowNegativeOffset:!0})}this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:s?t:void 0}),this.defaultRenderingQueue&&this.update()}get#Fr(){return this._spreadMode!==s.SpreadMode.NONE&&this._scrollMode!==s.ScrollMode.HORIZONTAL?2:1}#Ar(e,t){let i=parseFloat(e);if(i>0)t.preset=!1,this.#Dr(i,e,t);else{const n=this._pages[this._currentPageNumber-1];if(!n)return;let r=s.SCROLLBAR_PADDING,a=s.VERTICAL_PADDING;this.isInPresentationMode?(r=a=4,this._spreadMode!==s.SpreadMode.NONE&&(r*=2)):this.removePageBorders?r=a=0:this._scrollMode===s.ScrollMode.HORIZONTAL&&([r,a]=[a,r]);const o=(this.container.clientWidth-r)/n.width*n.scale/this.#Fr,l=(this.container.clientHeight-a)/n.height*n.scale;switch(e){case"page-actual":i=1;break;case"page-width":i=o;break;case"page-height":i=l;break;case"page-fit":i=Math.min(o,l);break;case"auto":const t=(0,s.isPortraitOrientation)(n)?o:Math.min(l,o);i=Math.min(s.MAX_AUTO_SCALE,t);break;default:return void console.error(`#setScale: "${e}" is an unknown zoom value.`)}t.preset=!0,this.#Dr(i,e,t)}}#Pr(){const e=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&this.#Ar(this._currentScaleValue,{noScroll:!0}),this.#Mr(e)}pageLabelToPageNumber(e){if(!this._pageLabels)return null;const t=this._pageLabels.indexOf(e);return t<0?null:t+1}scrollPageIntoView({pageNumber:e,destArray:t=null,allowNegativeOffset:i=!1,ignoreDestinationZoom:r=!1}){if(!this.pdfDocument)return;const a=Number.isInteger(e)&&this._pages[e-1];if(!a)return void console.error(`scrollPageIntoView: "${e}" is not a valid pageNumber parameter.`);if(this.isInPresentationMode||!t)return void this._setCurrentPageNumber(e,!0);let o,l,h=0,c=0,d=0,u=0;const p=a.rotation%180!=0,g=(p?a.height:a.width)/a.scale/n.PixelsPerInch.PDF_TO_CSS_UNITS,f=(p?a.width:a.height)/a.scale/n.PixelsPerInch.PDF_TO_CSS_UNITS;let m=0;switch(t[1].name){case"XYZ":h=t[2],c=t[3],m=t[4],h=null!==h?h:0,c=null!==c?c:f;break;case"Fit":case"FitB":m="page-fit";break;case"FitH":case"FitBH":c=t[2],m="page-width",null===c&&this._location?(h=this._location.left,c=this._location.top):("number"!=typeof c||c<0)&&(c=f);break;case"FitV":case"FitBV":h=t[2],d=g,u=f,m="page-height";break;case"FitR":h=t[2],c=t[3],d=t[4]-h,u=t[5]-c;let e=s.SCROLLBAR_PADDING,i=s.VERTICAL_PADDING;this.removePageBorders&&(e=i=0),o=(this.container.clientWidth-e)/d/n.PixelsPerInch.PDF_TO_CSS_UNITS,l=(this.container.clientHeight-i)/u/n.PixelsPerInch.PDF_TO_CSS_UNITS,m=Math.min(Math.abs(o),Math.abs(l));break;default:return void console.error(`scrollPageIntoView: "${t[1].name}" is not a valid destination type.`)}if(r||(m&&m!==this._currentScale?this.currentScaleValue=m:this._currentScale===s.UNKNOWN_SCALE&&(this.currentScaleValue=s.DEFAULT_SCALE_VALUE)),"page-fit"===m&&!t[4])return void this.#Mr(a);const _=[a.viewport.convertToViewportPoint(h,c),a.viewport.convertToViewportPoint(h+d,c+u)];let v=Math.min(_[0][0],_[1][0]),b=Math.min(_[0][1],_[1][1]);i||(v=Math.max(v,0),b=Math.max(b,0)),this.#Mr(a,{left:v,top:b})}_updateLocation(e){const t=this._currentScale,i=this._currentScaleValue,n=parseFloat(i)===t?Math.round(1e4*t)/100:i,s=e.id,r=this._pages[s-1],a=this.container,o=r.getPagePoint(a.scrollLeft-e.x,a.scrollTop-e.y),l=Math.round(o[0]),h=Math.round(o[1]);let c=`#page=${s}`;this.isInPresentationMode||(c+=`&zoom=${n},${l},${h}`),this._location={pageNumber:s,scale:n,top:h,left:l,rotation:this._pagesRotation,pdfOpenParams:c}}update(){const e=this._getVisiblePages(),t=e.views,i=t.length;if(0===i)return;const n=Math.max(10,2*i+1);this.#or.resize(n,e.ids),this.renderingQueue.renderHighestPriority(e);const r=this._spreadMode===s.SpreadMode.NONE&&(this._scrollMode===s.ScrollMode.PAGE||this._scrollMode===s.ScrollMode.VERTICAL),a=this._currentPageNumber;let o=!1;for(const e of t){if(e.percent<100)break;if(e.id===a&&r){o=!0;break}}this._setCurrentPageNumber(o?a:t[0].id),this._updateLocation(e.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(e){return this.container.contains(e)}focus(){this.container.focus()}get _isContainerRtl(){return"rtl"===getComputedStyle(this.container).direction}get isInPresentationMode(){return this.presentationModeState===s.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===s.PresentationModeState.CHANGING}get isHorizontalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const e=this._scrollMode===s.ScrollMode.PAGE?this.#vr.pages:this._pages,t=this._scrollMode===s.ScrollMode.HORIZONTAL,i=t&&this._isContainerRtl;return(0,s.getVisibleElements)({scrollEl:this.container,views:e,sortByVisibility:!0,horizontal:t,rtl:i})}cleanup(){for(const e of this._pages)e.renderingState!==s.RenderingStates.FINISHED&&e.reset()}_cancelRendering(){for(const e of this._pages)e.cancelRendering()}async#Lr(e){if(e.pdfPage)return e.pdfPage;try{const t=await this.pdfDocument.getPage(e.id);return e.pdfPage||e.setPdfPage(t),this.linkService._cachedPageNumber?.(t.ref)||this.linkService.cachePageRef(e.id,t.ref),t}catch(e){return console.error("Unable to get page for page view",e),null}}#kr(e){if(1===e.first?.id)return!0;if(e.last?.id===this.pagesCount)return!1;switch(this._scrollMode){case s.ScrollMode.PAGE:return this.#vr.scrollDown;case s.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down}forceRendering(e){const t=e||this._getVisiblePages(),i=this.#kr(t),n=this._spreadMode!==s.SpreadMode.NONE&&this._scrollMode!==s.ScrollMode.HORIZONTAL,r=this.renderingQueue.getHighestPriority(t,this._pages,i,n);return!!r&&(this.#Lr(r).then((()=>{this.renderingQueue.renderView(r)})),!0)}get hasEqualPageSizes(){const e=this._pages[0];for(let t=1,i=this._pages.length;t<i;++t){const i=this._pages[t];if(i.width!==e.width||i.height!==e.height)return!1}return!0}getPagesOverview(){let e;return this._pages.map((t=>{const i=t.pdfPage.getViewport({scale:1}),n=(0,s.isPortraitOrientation)(i);if(void 0===e)e=n;else if(this.enablePrintAutoRotate&&n!==e)return{width:i.height,height:i.width,rotation:(i.rotation-90)%360};return{width:i.width,height:i.height,rotation:i.rotation}}))}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig()):Promise.resolve(null)}set optionalContentConfigPromise(e){if(!(e instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${e}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=e,this.refresh(!1,{optionalContentConfigPromise:e}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:e}))}get scrollMode(){return this._scrollMode}set scrollMode(e){if(this._scrollMode!==e){if(!(0,s.isValidScrollMode)(e))throw new Error(`Invalid scroll mode: ${e}`);this.pagesCount>h.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=e,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(e=null){const t=this._scrollMode,i=this.viewer;i.classList.toggle("scrollHorizontal",t===s.ScrollMode.HORIZONTAL),i.classList.toggle("scrollWrapped",t===s.ScrollMode.WRAPPED),this.pdfDocument&&e&&(t===s.ScrollMode.PAGE?this.#Cr():this._previousScrollMode===s.ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&this.#Ar(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(e,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(e){if(this._spreadMode!==e){if(!(0,s.isValidSpreadMode)(e))throw new Error(`Invalid spread mode: ${e}`);this._spreadMode=e,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:e}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(e=null){if(!this.pdfDocument)return;const t=this.viewer,i=this._pages;if(this._scrollMode===s.ScrollMode.PAGE)this.#Cr();else if(t.textContent="",this._spreadMode===s.SpreadMode.NONE)for(const e of this._pages)t.append(e.div);else{const e=this._spreadMode-1;let n=null;for(let s=0,r=i.length;s<r;++s)null===n?(n=document.createElement("div"),n.className="spread",t.append(n)):s%2===e&&(n=n.cloneNode(!1),t.append(n)),n.append(i[s].div)}e&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&this.#Ar(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(e,!0),this.update())}_getPageAdvance(e,t=!1){switch(this._scrollMode){case s.ScrollMode.WRAPPED:{const{views:i}=this._getVisiblePages(),n=new Map;for(const{id:e,y:t,percent:s,widthPercent:r}of i){if(0===s||r<100)continue;let i=n.get(t);i||n.set(t,i||=[]),i.push(e)}for(const i of n.values()){const n=i.indexOf(e);if(-1===n)continue;const s=i.length;if(1===s)break;if(t)for(let t=n-1,s=0;t>=s;t--){const n=i[t],s=i[t+1]-1;if(n<s)return e-s}else for(let t=n+1,r=s;t<r;t++){const n=i[t],s=i[t-1]+1;if(n>s)return s-e}if(t){const t=i[0];if(t<e)return e-t+1}else{const t=i[s-1];if(t>e)return t-e+1}break}break}case s.ScrollMode.HORIZONTAL:break;case s.ScrollMode.PAGE:case s.ScrollMode.VERTICAL:{if(this._spreadMode===s.SpreadMode.NONE)break;const i=this._spreadMode-1;if(t&&e%2!==i)break;if(!t&&e%2===i)break;const{views:n}=this._getVisiblePages(),r=t?e-1:e+1;for(const{id:e,percent:t,widthPercent:i}of n)if(e===r){if(t>0&&100===i)return 2;break}break}}return 1}nextPage(){const e=this._currentPageNumber,t=this.pagesCount;if(e>=t)return!1;const i=this._getPageAdvance(e,!1)||1;return this.currentPageNumber=Math.min(e+i,t),!0}previousPage(){const e=this._currentPageNumber;if(e<=1)return!1;const t=this._getPageAdvance(e,!0)||1;return this.currentPageNumber=Math.max(e-t,1),!0}increaseScale({drawingDelay:e,scaleFactor:t,steps:i}={}){if(!this.pdfDocument)return;let n=this._currentScale;if(t>1)n=Math.round(n*t*100)/100;else{i??=1;do{n=Math.ceil(10*(n*s.DEFAULT_SCALE_DELTA).toFixed(2))/10}while(--i>0&&n<s.MAX_SCALE)}this.#Ar(Math.min(s.MAX_SCALE,n),{noScroll:!1,drawingDelay:e})}decreaseScale({drawingDelay:e,scaleFactor:t,steps:i}={}){if(!this.pdfDocument)return;let n=this._currentScale;if(t>0&&t<1)n=Math.round(n*t*100)/100;else{i??=1;do{n=Math.floor(10*(n/s.DEFAULT_SCALE_DELTA).toFixed(2))/10}while(--i>0&&n>s.MIN_SCALE)}this.#Ar(Math.max(s.MIN_SCALE,n),{noScroll:!1,drawingDelay:e})}#Sr(e=this.container.clientHeight){e!==this.#fr&&(this.#fr=e,s.docStyle.setProperty("--viewer-container-height",`${e}px`))}#_r(e){for(const t of e)if(t.target===this.container){this.#Sr(Math.floor(t.borderBoxSize[0].blockSize)),this.#cr=null;break}}get containerTopLeft(){return this.#cr||=[this.container.offsetTop,this.container.offsetLeft]}get annotationEditorMode(){return this.#hr?this.#lr:n.AnnotationEditorType.DISABLE}set annotationEditorMode({mode:e,editId:t=null}){if(!this.#hr)throw new Error("The AnnotationEditor is not enabled.");if(this.#lr!==e){if(!c(e))throw new Error(`Invalid AnnotationEditor mode: ${e}`);this.pdfDocument&&(this.#lr=e,this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:e}),this.#hr.updateMode(e,t))}}set annotationEditorParams({type:e,value:t}){if(!this.#hr)throw new Error("The AnnotationEditor is not enabled.");this.#hr.updateParams(e,t)}refresh(e=!1,t=Object.create(null)){if(this.pdfDocument){for(const e of this._pages)e.update(t);null!==this.#yr&&(clearTimeout(this.#yr),this.#yr=null),e||this.update()}}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFRenderingQueue=void 0;var n=i(4),s=i(2);t.PDFRenderingQueue=class{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(e){this.pdfViewer=e}setThumbnailViewer(e){this.pdfThumbnailViewer=e}isHighestPriority(e){return this.highestPriorityPage===e.renderingId}renderHighestPriority(e){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),this.pdfViewer.forceRendering(e)||this.isThumbnailViewEnabled&&this.pdfThumbnailViewer?.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),3e4))}getHighestPriority(e,t,i,n=!1){const s=e.views,r=s.length;if(0===r)return null;for(let e=0;e<r;e++){const t=s[e].view;if(!this.isViewFinished(t))return t}const a=e.first.id,o=e.last.id;if(o-a+1>r){const n=e.ids;for(let e=1,s=o-a;e<s;e++){const s=i?a+e:o-e;if(n.has(s))continue;const r=t[s-1];if(!this.isViewFinished(r))return r}}let l=i?o:a-2,h=t[l];return h&&!this.isViewFinished(h)||n&&(l+=i?1:-1,h=t[l],h&&!this.isViewFinished(h))?h:null}isViewFinished(e){return e.renderingState===s.RenderingStates.FINISHED}renderView(e){switch(e.renderingState){case s.RenderingStates.FINISHED:return!1;case s.RenderingStates.PAUSED:this.highestPriorityPage=e.renderingId,e.resume();break;case s.RenderingStates.RUNNING:this.highestPriorityPage=e.renderingId;break;case s.RenderingStates.INITIAL:this.highestPriorityPage=e.renderingId,e.draw().finally((()=>{this.renderHighestPriority()})).catch((e=>{e instanceof n.RenderingCancelledException||console.error(`renderView: "${e}"`)}))}return!0}}}],t={};function i(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AnnotationLayerBuilder",{enumerable:!0,get:function(){return a.AnnotationLayerBuilder}}),Object.defineProperty(e,"DownloadManager",{enumerable:!0,get:function(){return o.DownloadManager}}),Object.defineProperty(e,"EventBus",{enumerable:!0,get:function(){return l.EventBus}}),Object.defineProperty(e,"FindState",{enumerable:!0,get:function(){return t.FindState}}),Object.defineProperty(e,"GenericL10n",{enumerable:!0,get:function(){return h.GenericL10n}}),Object.defineProperty(e,"LinkTarget",{enumerable:!0,get:function(){return s.LinkTarget}}),Object.defineProperty(e,"NullL10n",{enumerable:!0,get:function(){return c.NullL10n}}),Object.defineProperty(e,"PDFFindController",{enumerable:!0,get:function(){return t.PDFFindController}}),Object.defineProperty(e,"PDFHistory",{enumerable:!0,get:function(){return d.PDFHistory}}),Object.defineProperty(e,"PDFLinkService",{enumerable:!0,get:function(){return s.PDFLinkService}}),Object.defineProperty(e,"PDFPageView",{enumerable:!0,get:function(){return u.PDFPageView}}),Object.defineProperty(e,"PDFScriptingManager",{enumerable:!0,get:function(){return p.PDFScriptingManager}}),Object.defineProperty(e,"PDFSinglePageViewer",{enumerable:!0,get:function(){return g.PDFSinglePageViewer}}),Object.defineProperty(e,"PDFViewer",{enumerable:!0,get:function(){return f.PDFViewer}}),Object.defineProperty(e,"ProgressBar",{enumerable:!0,get:function(){return r.ProgressBar}}),Object.defineProperty(e,"RenderingStates",{enumerable:!0,get:function(){return r.RenderingStates}}),Object.defineProperty(e,"ScrollMode",{enumerable:!0,get:function(){return r.ScrollMode}}),Object.defineProperty(e,"SimpleLinkService",{enumerable:!0,get:function(){return s.SimpleLinkService}}),Object.defineProperty(e,"SpreadMode",{enumerable:!0,get:function(){return r.SpreadMode}}),Object.defineProperty(e,"StructTreeLayerBuilder",{enumerable:!0,get:function(){return m.StructTreeLayerBuilder}}),Object.defineProperty(e,"TextLayerBuilder",{enumerable:!0,get:function(){return _.TextLayerBuilder}}),Object.defineProperty(e,"XfaLayerBuilder",{enumerable:!0,get:function(){return v.XfaLayerBuilder}}),Object.defineProperty(e,"parseQueryString",{enumerable:!0,get:function(){return r.parseQueryString}});var t=i(1),s=i(5),r=i(2),a=i(6),o=i(8),l=i(9),h=i(10),c=i(7),d=i(12),u=i(13),p=i(21),g=i(24),f=i(25),m=i(16),_=i(19),v=i(20)})(),n})(),e.exports=i.pdfjsViewer=n()}(pdf_viewer);var pdf_viewerExports=pdf_viewer.exports,_ProgressBar_classList,_ProgressBar_disableAutoFetchTimeout,_ProgressBar_percent,_ProgressBar_style,_ProgressBar_visible;function __awaiter(e,t,i,n){return new(i||(i=Promise))((function(t,s){function r(e){try{o(n.next(e))}catch(e){s(e)}}function a(e){try{o(n.throw(e))}catch(e){s(e)}}function o(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(e){e(n)}))).then(r,a)}o((n=n.apply(e,[])).next())}))}function __classPrivateFieldGet(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}function __classPrivateFieldSet(e,t,i,n,s){if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s?s.value=i:t.set(e,i),i}"function"==typeof SuppressedError&&SuppressedError;const DEFAULT_SCALE_VALUE="auto",DEFAULT_SCALE=1,DEFAULT_SCALE_DELTA=1.1,MIN_SCALE=.1,MAX_SCALE=10,UNKNOWN_SCALE=0,MAX_AUTO_SCALE=1.25,SCROLLBAR_PADDING=40,VERTICAL_PADDING=5,RenderingStates={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},SidebarView={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4},RendererType={CANVAS:"canvas",SVG:"svg"},TextLayerMode={DISABLE:0,ENABLE:1},ScrollMode={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},SpreadMode={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2},CursorTool={SELECT:0,HAND:1,ZOOM:2},AutoPrintRegExp=/\bprint\s*\(/;class OutputScale{constructor(){const e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return 1!==this.sx||1!==this.sy}}function scrollIntoView(e,t,i=!1){let n=e.offsetParent;if(!n)return void console.error("offsetParent is not set -- cannot scroll");let s=e.offsetTop+e.clientTop,r=e.offsetLeft+e.clientLeft;for(;n.clientHeight===n.scrollHeight&&n.clientWidth===n.scrollWidth||i&&(n.classList.contains("markedContent")||"hidden"===getComputedStyle(n).overflow);)if(s+=n.offsetTop,r+=n.offsetLeft,n=n.offsetParent,!n)return;t&&(void 0!==t.top&&(s+=t.top),void 0!==t.left&&(r+=t.left,n.scrollLeft=r)),n.scrollTop=s,n.scrollLeft=r}function watchScroll(e,t){const i=function(i){s||(s=window.requestAnimationFrame((function(){s=null;const i=e.scrollLeft,r=n.lastX;i!==r&&(n.right=i>r),n.lastX=i;const a=e.scrollTop,o=n.lastY;a!==o&&(n.down=a>o),n.lastY=a,t(n)})))},n={right:!0,down:!0,lastX:e.scrollLeft,lastY:e.scrollTop,_eventHandler:i};let s=null;return e.addEventListener("scroll",i,!0),n}function parseQueryString(e){const t=new Map;for(const[i,n]of new URLSearchParams(e))t.set(i.toLowerCase(),n);return t}const NullCharactersRegExp=/\x00/g,InvisibleCharactersRegExp=/[\x01-\x1F]/g;function removeNullCharacters(e,t=!1){return"string"!=typeof e?(console.error("The argument must be a string."),e):(t&&(e=e.replace(InvisibleCharactersRegExp," ")),e.replace(NullCharactersRegExp,""))}function binarySearchFirstItem(e,t,i=0){let n=i,s=e.length-1;if(s<0||!t(e[s]))return e.length;if(t(e[n]))return n;for(;n<s;){const i=n+s>>1;t(e[i])?s=i:n=i+1}return n}function approximateFraction(e){if(Math.floor(e)===e)return[e,1];const t=1/e;if(t>8)return[1,8];if(Math.floor(t)===t)return[1,t];const i=e>1?t:e;let n,s=0,r=1,a=1,o=1;for(;;){const e=s+a,t=r+o;if(t>8)break;i<=e/t?(a=e,o=t):(s=e,r=t)}return n=i-s/r<a/o-i?i===e?[s,r]:[r,s]:i===e?[a,o]:[o,a],n}function roundToDivide(e,t){const i=e%t;return 0===i?e:Math.round(e-i+t)}function getPageSizeInches({view:e,userUnit:t,rotate:i}){const[n,s,r,a]=e,o=i%180!=0,l=(r-n)/72*t,h=(a-s)/72*t;return{width:o?h:l,height:o?l:h}}function backtrackBeforeAllVisibleElements(e,t,i){if(e<2)return e;let n=t[e].div,s=n.offsetTop+n.clientTop;s>=i&&(n=t[e-1].div,s=n.offsetTop+n.clientTop);for(let i=e-2;i>=0&&(n=t[i].div,!(n.offsetTop+n.clientTop+n.clientHeight<=s));--i)e=i;return e}function getVisibleElements({scrollEl:e,views:t,sortByVisibility:i=!1,horizontal:n=!1,rtl:s=!1}){const r=e.scrollTop,a=r+e.clientHeight,o=e.scrollLeft,l=o+e.clientWidth;const h=[],c=new Set,d=t.length;let u=binarySearchFirstItem(t,n?function(e){const t=e.div,i=t.offsetLeft+t.clientLeft,n=i+t.clientWidth;return s?i<l:n>o}:function(e){const t=e.div;return t.offsetTop+t.clientTop+t.clientHeight>r});u>0&&u<d&&!n&&(u=backtrackBeforeAllVisibleElements(u,t,r));let p=n?l:-1;for(let e=u;e<d;e++){const i=t[e],s=i.div,d=s.offsetLeft+s.clientLeft,u=s.offsetTop+s.clientTop,g=s.clientWidth,f=s.clientHeight,m=d+g,_=u+f;if(-1===p)_>=a&&(p=_);else if((n?d:u)>p)break;if(_<=r||u>=a||m<=o||d>=l)continue;const v=Math.max(0,r-u)+Math.max(0,_-a),b=(g-(Math.max(0,o-d)+Math.max(0,m-l)))/g,y=(f-v)/f*b*100|0;h.push({id:i.id,x:d,y:u,view:i,percent:y,widthPercent:100*b|0}),c.add(i.id)}const g=h[0],f=h.at(-1);return i&&h.sort((function(e,t){const i=e.percent-t.percent;return Math.abs(i)>.001?-i:e.id-t.id})),{first:g,last:f,views:h,ids:c}}function noContextMenuHandler(e){e.preventDefault()}function normalizeWheelEventDirection(e){let t=Math.hypot(e.deltaX,e.deltaY);const i=Math.atan2(e.deltaY,e.deltaX);return-.25*Math.PI<i&&i<.75*Math.PI&&(t=-t),t}function normalizeWheelEventDelta(e){const t=e.deltaMode;let i=normalizeWheelEventDirection(e);return t===WheelEvent.DOM_DELTA_PIXEL?i/=900:t===WheelEvent.DOM_DELTA_LINE&&(i/=30),i}function isValidRotation(e){return Number.isInteger(e)&&e%90==0}function isValidScrollMode(e){return Number.isInteger(e)&&Object.values(ScrollMode).includes(e)&&e!==ScrollMode.UNKNOWN}function isValidSpreadMode(e){return Number.isInteger(e)&&Object.values(SpreadMode).includes(e)&&e!==SpreadMode.UNKNOWN}function isPortraitOrientation(e){return e.width<=e.height}const animationStarted=new Promise((function(e){window.requestAnimationFrame(e)})),docStyle=document.documentElement.style;function clamp(e,t,i){return Math.min(Math.max(e,t),i)}class ProgressBar{constructor(e){_ProgressBar_classList.set(this,null),_ProgressBar_disableAutoFetchTimeout.set(this,null),_ProgressBar_percent.set(this,0),_ProgressBar_style.set(this,null),_ProgressBar_visible.set(this,!0),__classPrivateFieldSet(this,_ProgressBar_classList,e.classList),__classPrivateFieldSet(this,_ProgressBar_style,e.style)}get percent(){return __classPrivateFieldGet(this,_ProgressBar_percent,"f")}set percent(e){var t,i,n;__classPrivateFieldSet(this,_ProgressBar_percent,clamp(e,0,100)),isNaN(e)?null===(t=__classPrivateFieldGet(this,_ProgressBar_classList,"f"))||void 0===t||t.add("indeterminate"):(null===(i=__classPrivateFieldGet(this,_ProgressBar_classList,"f"))||void 0===i||i.remove("indeterminate"),null===(n=__classPrivateFieldGet(this,_ProgressBar_style,"f"))||void 0===n||n.setProperty("--progressBar-percent",`${__classPrivateFieldGet(this,_ProgressBar_percent,"f")}%`))}setWidth(e){var t;if(!e)return;const i=e.parentNode.offsetWidth-e.offsetWidth;i>0&&(null===(t=__classPrivateFieldGet(this,_ProgressBar_style,"f"))||void 0===t||t.setProperty("--progressBar-end-offset",`${i}px`))}setDisableAutoFetch(e=5e3){isNaN(__classPrivateFieldGet(this,_ProgressBar_percent,"f"))||(__classPrivateFieldGet(this,_ProgressBar_disableAutoFetchTimeout,"f")&&clearTimeout(__classPrivateFieldGet(this,_ProgressBar_disableAutoFetchTimeout,"f")),this.show(),__classPrivateFieldSet(this,_ProgressBar_disableAutoFetchTimeout,setTimeout((()=>{__classPrivateFieldSet(this,_ProgressBar_disableAutoFetchTimeout,null,"f"),this.hide()}),e)))}hide(){var e;__classPrivateFieldGet(this,_ProgressBar_visible,"f")&&(__classPrivateFieldSet(this,_ProgressBar_visible,!1),null===(e=__classPrivateFieldGet(this,_ProgressBar_classList,"f"))||void 0===e||e.add("hidden"))}show(){var e;__classPrivateFieldGet(this,_ProgressBar_visible,"f")||(__classPrivateFieldSet(this,_ProgressBar_visible,!0),null===(e=__classPrivateFieldGet(this,_ProgressBar_classList,"f"))||void 0===e||e.remove("hidden"))}}function getActiveOrFocusedElement(){let e=document,t=e.activeElement||e.querySelector(":focus");for(;null==t?void 0:t.shadowRoot;)e=t.shadowRoot,t=e.activeElement||e.querySelector(":focus");return t}function apiPageLayoutToViewerModes(e){let t=ScrollMode.VERTICAL,i=SpreadMode.NONE;switch(e){case"SinglePage":t=ScrollMode.PAGE;break;case"OneColumn":break;case"TwoPageLeft":t=ScrollMode.PAGE;case"TwoColumnLeft":i=SpreadMode.ODD;break;case"TwoPageRight":t=ScrollMode.PAGE;case"TwoColumnRight":i=SpreadMode.EVEN}return{scrollMode:t,spreadMode:i}}function apiPageModeToSidebarView(e){switch(e){case"UseNone":return SidebarView.NONE;case"UseThumbs":return SidebarView.THUMBS;case"UseOutlines":return SidebarView.OUTLINE;case"UseAttachments":return SidebarView.ATTACHMENTS;case"UseOC":return SidebarView.LAYERS}return SidebarView.NONE}_ProgressBar_classList=new WeakMap,_ProgressBar_disableAutoFetchTimeout=new WeakMap,_ProgressBar_percent=new WeakMap,_ProgressBar_style=new WeakMap,_ProgressBar_visible=new WeakMap;const CLEANUP_TIMEOUT=3e4;class PDFRenderingQueue{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1}setViewer(e){this.pdfViewer=e}setThumbnailViewer(e){this.pdfThumbnailViewer=e}isHighestPriority(e){return this.highestPriorityPage===e.renderingId}hasViewer(){return!!this.pdfViewer}renderHighestPriority(e){var t,i;this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),(null===(t=this.pdfViewer)||void 0===t?void 0:t.forceRendering(e))||this.isThumbnailViewEnabled&&(null===(i=this.pdfThumbnailViewer)||void 0===i?void 0:i.forceRendering())||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),CLEANUP_TIMEOUT))}getHighestPriority(e,t,i,n=!1){const s=e.views,r=s.length;if(0===r)return null;for(let e=0;e<r;e++){const t=s[e].view;if(!this.isViewFinished(t))return t}const a=e.first.id,o=e.last.id;if(o-a+1>r){const n=e.ids;for(let e=1,s=o-a;e<s;e++){const s=i?a+e:o-e;if(n.has(s))continue;const r=t[s-1];if(!this.isViewFinished(r))return r}}let l=i?o:a-2,h=t[l];return h&&!this.isViewFinished(h)||n&&(l+=i?1:-1,h=t[l],h&&!this.isViewFinished(h))?h:null}isViewFinished(e){return e.renderingState===RenderingStates.FINISHED}renderView(e){switch(e.renderingState){case RenderingStates.FINISHED:return!1;case RenderingStates.PAUSED:this.highestPriorityPage=e.renderingId,e.resume();break;case RenderingStates.RUNNING:this.highestPriorityPage=e.renderingId;break;case RenderingStates.INITIAL:this.highestPriorityPage=e.renderingId,e.draw().finally((()=>{this.renderHighestPriority()})).catch((e=>{e instanceof pdfExports.RenderingCancelledException||console.error(`renderView: "${e}"`)}))}return!0}}var _a,_TempImageFactory_tempCanvas;const DRAW_UPSCALE_FACTOR=2,MAX_NUM_SCALING_STEPS=3;class TempImageFactory{static getCanvas(e,t){const i=__classPrivateFieldSet(this,_a,__classPrivateFieldGet(this,_a,"f",_TempImageFactory_tempCanvas)||document.createElement("canvas"),"f",_TempImageFactory_tempCanvas);i.width=e,i.height=t;const n=i.getContext("2d",{alpha:!1});n.save(),n.fillStyle="rgb(255, 255, 255)",n.fillRect(0,0,e,t),n.restore();const s=i.getContext("2d");return[i,s]}static destroyCanvas(){const e=__classPrivateFieldGet(this,_a,"f",_TempImageFactory_tempCanvas);e&&(e.width=0,e.height=0),__classPrivateFieldSet(this,_a,null,"f",_TempImageFactory_tempCanvas)}}_a=TempImageFactory,_TempImageFactory_tempCanvas={value:null};class PDFThumbnailView{constructor({container:e,eventBus:t,id:i,defaultViewport:n,optionalContentConfigPromise:s,linkService:r,renderingQueue:a,l10n:o,pageColors:l,store:h,thumbnailWidth:c}){this.container=e,this.eventBus=t,this.id=i,this.renderingId="thumbnail"+i,this.pageLabel=null,this.store=h,this.loaded=!1,this.pdfPage=null,this.rotation=0,this.viewport=n,this.pdfPageRotate=n.rotation,this._optionalContentConfigPromise=s||null,this.pageColors=l||null,this.linkService=r,this.renderingQueue=a,this.renderTask=null,this.renderingState=RenderingStates.INITIAL,this.resume=null;const d=this.viewport.width,u=d/this.viewport.height;this.canvasWidth=c,this.canvasHeight=this.canvasWidth/u|0,this.scale=this.canvasWidth/d,this.l10n=o,this.canvas=null,this.src=null;const p=document.createElement("div");p.className="thumbnail pdfSlickThumbHolder",p.setAttribute("data-page-number",this.id.toString()),this.div=p,e.append(p)}setPdfPage(e){this.pdfPage=e,this.pdfPageRotate=e.rotate;const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:1,rotation:t}),this.reset()}reset(){this.cancelRendering(),this.renderingState=RenderingStates.INITIAL;const e=this.viewport.width,t=e/this.viewport.height;this.canvasHeight=this.canvasWidth/t|0,this.scale=this.canvasWidth/e,this.div.removeAttribute("data-loaded"),this.loaded=!1,this.canvas&&(this.canvas.width=0,this.canvas.height=0,delete this.canvas)}update({rotation:e=null}){"number"==typeof e&&(this.rotation=e);const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:1,rotation:t}),this.reset()}cancelRendering(){this.renderTask&&(this.renderTask.cancel(),this.renderTask=null),this.resume=null}_getPageDrawContext(e=1){const t=document.createElement("canvas"),i=t.getContext("2d",{alpha:!1}),n=new OutputScale;t.width=e*this.canvasWidth*n.sx|0,t.height=e*this.canvasHeight*n.sy|0;return{ctx:i,canvas:t,transform:n.scaled?[n.sx,0,0,n.sy,0,0]:null}}_convertCanvasToImage(e){if(this.renderingState!==RenderingStates.FINISHED)throw new Error("_convertCanvasToImage: Rendering has not finished.");const t=this._reduceImage(e);this.src=t.toDataURL(),this.div.setAttribute("data-loaded","true"),this.loaded=!0,this.store.getState()._setThumbnailView(this.id,this),t.width=0,t.height=0}draw(){if(this.renderingState!==RenderingStates.INITIAL)return console.error("Must be in new state before drawing"),Promise.resolve();const{pdfPage:e}=this;if(!e)return this.renderingState=RenderingStates.FINISHED,Promise.reject(new Error("pdfPage is not loaded"));this.renderingState=RenderingStates.RUNNING;const t=(e=null)=>__awaiter(this,void 0,void 0,(function*(){if(a===this.renderTask&&(this.renderTask=null),!(e instanceof pdfExports.RenderingCancelledException)&&(this.renderingState=RenderingStates.FINISHED,this._convertCanvasToImage(n),e))throw e})),{ctx:i,canvas:n,transform:s}=this._getPageDrawContext(DRAW_UPSCALE_FACTOR),r={canvasContext:i,transform:s,viewport:this.viewport.clone({scale:DRAW_UPSCALE_FACTOR*this.scale}),optionalContentConfigPromise:this._optionalContentConfigPromise,pageColors:this.pageColors},a=this.renderTask=e.render(r);a.onContinue=e=>{if(!this.renderingQueue.isHighestPriority(this))return this.renderingState=RenderingStates.PAUSED,void(this.resume=()=>{this.renderingState=RenderingStates.RUNNING,e()});e()};const o=a.promise.then((function(){return t(null)}),(function(e){return t(e)}));return o.finally((()=>{n.width=0,n.height=0,this.eventBus.dispatch("thumbnailrendered",{source:this,pageNumber:this.id,pdfPage:this.pdfPage})})),o}setImage(e){if(this.renderingState!==RenderingStates.INITIAL)return;const{thumbnailCanvas:t,pdfPage:i,scale:n}=e;t&&(this.pdfPage||this.setPdfPage(i),n<this.scale||(this.renderingState=RenderingStates.FINISHED,this._convertCanvasToImage(t)))}_reduceImage(e){const{ctx:t,canvas:i}=this._getPageDrawContext();if(e.width<=2*i.width)return t.drawImage(e,0,0,e.width,e.height,0,0,i.width,i.height),i;let n=i.width<<MAX_NUM_SCALING_STEPS,s=i.height<<MAX_NUM_SCALING_STEPS;const[r,a]=TempImageFactory.getCanvas(n,s);for(;n>e.width||s>e.height;)n>>=1,s>>=1;for(a.drawImage(e,0,0,e.width,e.height,0,0,n,s);n>2*i.width;)a.drawImage(r,0,0,n,s,0,0,n>>1,s>>1),n>>=1,s>>=1;return t.drawImage(r,0,0,n,s,0,0,i.width,i.height),i}get _thumbPageTitle(){var e;return this.l10n.get("thumb_page_title",{page:null!==(e=this.pageLabel)&&void 0!==e?e:this.id})}get _thumbPageCanvas(){var e;return this.l10n.get("thumb_page_canvas",{page:null!==(e=this.pageLabel)&&void 0!==e?e:this.id})}setPageLabel(e){this.pageLabel="string"==typeof e?e:null}}var _PDFThumbnailViewer_instances,_PDFThumbnailViewer_ensurePdfPageLoaded,_PDFThumbnailViewer_getScrollAhead;const THUMBNAIL_SCROLL_MARGIN=-19,THUMBNAIL_SELECTED_CLASS="selected";class PDFThumbnailViewer{constructor({container:e,eventBus:t,linkService:i,renderingQueue:n,l10n:s,pageColors:r,store:a,thumbnailWidth:o}){_PDFThumbnailViewer_instances.add(this),this.container=e,this.eventBus=t,this.linkService=i,this.renderingQueue=n,this.l10n=s,this.pageColors=r||null,this._thumbnails=[],this._currentPageNumber=0,this._pagesRotation=0,this._pageLabels=[],this.pdfDocument=null,this.store=a,this.thumbnailWidth=o,!this.pageColors||CSS.supports("color",this.pageColors.background)&&CSS.supports("color",this.pageColors.foreground)||((this.pageColors.background||this.pageColors.foreground)&&console.warn("PDFThumbnailViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."),this.pageColors=null),this.scroll=watchScroll(this.container,this._scrollUpdated.bind(this)),this._resetView()}_scrollUpdated(){this.renderingQueue.renderHighestPriority()}getThumbnail(e){return this._thumbnails[e]}_getVisibleThumbs(){return getVisibleElements({scrollEl:this.container,views:this._thumbnails})}scrollThumbnailIntoView(e){if(!this.pdfDocument)return;const t=this._thumbnails[e-1];if(!t)return void console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.');if(e!==this._currentPageNumber){this._thumbnails[this._currentPageNumber-1].div.classList.remove(THUMBNAIL_SELECTED_CLASS),t.div.classList.add(THUMBNAIL_SELECTED_CLASS)}const i=this._getVisibleThumbs(),{first:n,last:s,views:r}=i;if(r.length>0){let i=!1;if(e<=n.id||e>=(null==s?void 0:s.id))i=!0;else for(const{id:t,percent:n}of r)if(t===e){i=n<100;break}i&&scrollIntoView(t.div,{top:THUMBNAIL_SCROLL_MARGIN})}this._currentPageNumber=e,this.forceRendering()}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!isValidRotation(e))throw new Error("Invalid thumbnails rotation angle.");if(!this.pdfDocument)return;if(this._pagesRotation===e)return;this._pagesRotation=e;const t={rotation:e};for(const e of this._thumbnails)e.update(t)}cleanup(){for(const e of this._thumbnails)e.renderingState!==RenderingStates.FINISHED&&e.reset();TempImageFactory.destroyCanvas()}_resetView(){this._thumbnails=[],this._currentPageNumber=1,this._pageLabels=[],this._pagesRotation=0,this.container.textContent=""}setDocument(e){if(this.pdfDocument&&(this._cancelRendering(),this._resetView()),this.pdfDocument=e,!e)return;const t=e.getPage(1),i=e.getOptionalContentConfig();t.then((t=>{var n;const s=e.numPages,r=t.getViewport({scale:1});for(let e=1;e<=s;++e){const t=new PDFThumbnailView({container:this.container,eventBus:this.eventBus,id:e,defaultViewport:r.clone(),optionalContentConfigPromise:i,linkService:this.linkService,renderingQueue:this.renderingQueue,l10n:this.l10n,pageColors:this.pageColors,store:this.store,thumbnailWidth:this.thumbnailWidth});this._thumbnails.push(t)}null===(n=this._thumbnails[0])||void 0===n||n.setPdfPage(t);this._thumbnails[this._currentPageNumber-1].div.classList.add(THUMBNAIL_SELECTED_CLASS),this.store.getState()._setThumbnailsViews(this._thumbnails)})).catch((e=>{console.error("Unable to initialize thumbnail viewer",e)}))}_cancelRendering(){for(const e of this._thumbnails)e.cancelRendering()}setPageLabels(e){var t,i;if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=[],console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.")):this._pageLabels=[];for(let e=0,n=this._thumbnails.length;e<n;e++)this._thumbnails[e].setPageLabel(null!==(i=null===(t=this._pageLabels)||void 0===t?void 0:t[e])&&void 0!==i?i:null)}}forceRendering(){const e=this._getVisibleThumbs(),t=__classPrivateFieldGet(this,_PDFThumbnailViewer_instances,"m",_PDFThumbnailViewer_getScrollAhead).call(this,e),i=this.renderingQueue.getHighestPriority(e,this._thumbnails,t);return!!i&&(__classPrivateFieldGet(this,_PDFThumbnailViewer_instances,"m",_PDFThumbnailViewer_ensurePdfPageLoaded).call(this,i).then((()=>{this.renderingQueue.renderView(i)})),!0)}}var _OverlayManager_overlays,_OverlayManager_active;_PDFThumbnailViewer_instances=new WeakSet,_PDFThumbnailViewer_ensurePdfPageLoaded=function(e){var t;return __awaiter(this,void 0,void 0,(function*(){if(null==e?void 0:e.pdfPage)return e.pdfPage;try{const i=yield null===(t=this.pdfDocument)||void 0===t?void 0:t.getPage(e.id);return(null==e?void 0:e.pdfPage)||e.setPdfPage(i),i}catch(e){return console.error("Unable to get page for thumb view",e),null}}))},_PDFThumbnailViewer_getScrollAhead=function(e){var t,i;return 1===(null===(t=e.first)||void 0===t?void 0:t.id)||(null===(i=e.last)||void 0===i?void 0:i.id)!==this._thumbnails.length&&this.scroll.down};class OverlayManager{constructor(){_OverlayManager_overlays.set(this,new WeakMap),_OverlayManager_active.set(this,null)}get active(){return __classPrivateFieldGet(this,_OverlayManager_active,"f")}register(e,t=!1){return __awaiter(this,void 0,void 0,(function*(){if("object"!=typeof e)throw new Error("Not enough parameters.");if(__classPrivateFieldGet(this,_OverlayManager_overlays,"f").has(e))throw new Error("The overlay is already registered.");__classPrivateFieldGet(this,_OverlayManager_overlays,"f").set(e,{canForceClose:t}),e.addEventListener("cancel",(()=>{__classPrivateFieldSet(this,_OverlayManager_active,null)}))}))}unregister(e){return __awaiter(this,void 0,void 0,(function*(){if(!__classPrivateFieldGet(this,_OverlayManager_overlays,"f").has(e))throw new Error("The overlay does not exist.");if(__classPrivateFieldGet(this,_OverlayManager_active,"f")===e)throw new Error("The overlay cannot be removed while it is active.");__classPrivateFieldGet(this,_OverlayManager_overlays,"f").delete(e)}))}open(e){return __awaiter(this,void 0,void 0,(function*(){if(!__classPrivateFieldGet(this,_OverlayManager_overlays,"f").has(e))throw new Error("The overlay does not exist.");if(__classPrivateFieldGet(this,_OverlayManager_active,"f")){if(__classPrivateFieldGet(this,_OverlayManager_active,"f")===e)throw new Error("The overlay is already active.");if(!__classPrivateFieldGet(this,_OverlayManager_overlays,"f").get(e).canForceClose)throw new Error("Another overlay is currently active.");yield this.close()}__classPrivateFieldSet(this,_OverlayManager_active,e),e.showModal()}))}close(e=__classPrivateFieldGet(this,_OverlayManager_active,"f")){return __awaiter(this,void 0,void 0,(function*(){if(!e||!__classPrivateFieldGet(this,_OverlayManager_overlays,"f").has(e))throw new Error("The overlay does not exist.");if(!__classPrivateFieldGet(this,_OverlayManager_active,"f"))throw new Error("The overlay is currently not active.");if(__classPrivateFieldGet(this,_OverlayManager_active,"f")!==e)throw new Error("Another overlay is currently active.");e.close(),__classPrivateFieldSet(this,_OverlayManager_active,null)}))}}function getXfaHtmlForPrinting(e,t){const i=t.allXfaHtml,n=new pdf_viewerExports.SimpleLinkService,s=Math.round(100*pdfExports.PixelsPerInch.PDF_TO_CSS_UNITS)/100;for(const r of null==i?void 0:i.children){const i=document.createElement("div");i.className="xfaPrintedPage",e.append(i);const a=new pdf_viewerExports.XfaLayerBuilder({pageDiv:i,pdfPage:null,annotationStorage:t.annotationStorage,linkService:n,xfaHtml:r}),o=pdfExports.getXfaPageViewport(r,{scale:s});a.render(o,"print")}}_OverlayManager_overlays=new WeakMap,_OverlayManager_active=new WeakMap;let activeService=null,dialog=null,overlayManager=new OverlayManager;function renderPage(e,t,i,n,s,r,a){const o=activeService.scratchCanvas,l=s/pdfExports.PixelsPerInch.PDF;o.width=Math.floor(n.width*l),o.height=Math.floor(n.height*l);const h=o.getContext("2d");return h.save(),h.fillStyle="rgb(255, 255, 255)",h.fillRect(0,0,o.width,o.height),h.restore(),Promise.all([t.getPage(i),a]).then((function([e,t]){const i={canvasContext:h,transform:[l,0,0,l,0,0],viewport:e.getViewport({scale:1,rotation:n.rotation}),intent:"print",annotationMode:pdfExports.AnnotationMode.ENABLE_STORAGE,optionalContentConfigPromise:r,printAnnotationStorage:t};return e.render(i).promise}))}class PDFPrintService{constructor(e,t,i,n,s=null,r=null,a){this.pdfDocument=e,this.pagesOverview=t,this.printContainer=i,this._printResolution=n||150,this._optionalContentConfigPromise=s||e.getOptionalContentConfig(),this._printAnnotationStoragePromise=r||Promise.resolve(),this.l10n=a,this.currentPage=-1,this.scratchCanvas=document.createElement("canvas")}layout(){this.throwIfInactive();const e=document.querySelector("body");null==e||e.setAttribute("data-pdfjsprinting","true");this.pagesOverview.every((e=>e.width===this.pagesOverview[0].width&&e.height===this.pagesOverview[0].height),this)||console.warn("Not all pages have the same size. The printed result may be incorrect!"),this.pageStyleSheet=document.createElement("style");const t=this.pagesOverview[0];this.pageStyleSheet.textContent="@page { size: "+t.width+"pt "+t.height+"pt;}",null==e||e.append(this.pageStyleSheet)}destroy(){if(activeService!==this)return;this.printContainer.textContent="";const e=document.querySelector("body");null==e||e.removeAttribute("data-pdfjsprinting"),this.pageStyleSheet&&(this.pageStyleSheet.remove(),this.pageStyleSheet=null),this.scratchCanvas.width=this.scratchCanvas.height=0,this.scratchCanvas=null,activeService=null,ensureOverlay().then((function(){overlayManager.active===dialog&&overlayManager.close(dialog)}))}renderPages(){if(this.pdfDocument.isPureXfa)return getXfaHtmlForPrinting(this.printContainer,this.pdfDocument),Promise.resolve();const e=this.pagesOverview.length,t=(i,n)=>{if(this.throwIfInactive(),++this.currentPage>=e)return renderProgress(e,e,this.l10n),void i();const s=this.currentPage;renderProgress(s,e,this.l10n),renderPage(this,this.pdfDocument,s+1,this.pagesOverview[s],this._printResolution,this._optionalContentConfigPromise,this._printAnnotationStoragePromise).then(this.useRenderedPage.bind(this)).then((function(){t(i,n)}),n)};return new Promise(t)}useRenderedPage(){this.throwIfInactive();const e=document.createElement("img"),t=this.scratchCanvas;"toBlob"in t?t.toBlob((function(t){e.src=URL.createObjectURL(t)})):e.src=t.toDataURL();const i=document.createElement("div");return i.className="printedPage",i.append(e),this.printContainer.append(i),new Promise((function(t,i){e.onload=t,e.onerror=i}))}performPrint(){return this.throwIfInactive(),new Promise((e=>{setTimeout((()=>{this.active?(print.call(window),setTimeout(e,20)):e()}),0)}))}get active(){return this===activeService}throwIfInactive(){if(!this.active)throw new Error("This print request was cancelled or completed.")}}const print=window.print;function dispatchEvent(e){const t=document.createEvent("CustomEvent");t.initCustomEvent(e,!1,!1,"custom"),window.dispatchEvent(t)}function abort(){activeService&&(activeService.destroy(),dispatchEvent("afterprint"))}function renderProgress(e,t,i){dialog||(dialog=document.getElementById("printServiceDialog"));const n=Math.round(100*e/t),s=dialog.querySelector("progress"),r=dialog.querySelector(".relative-progress");s.value=n,i.get("print_progress_percent",{progress:n}).then((e=>{r.textContent=e}))}if(window.print=function(){if(activeService)console.warn("Ignored window.print() because of a pending print job.");else{ensureOverlay().then((function(){activeService&&overlayManager.open(dialog)}));try{dispatchEvent("beforeprint")}finally{if(!activeService)return console.error("Expected print service to be initialized."),void ensureOverlay().then((function(){overlayManager.active===dialog&&overlayManager.close(dialog)}));const e=activeService;activeService.renderPages().then((function(){return e.performPrint()})).catch((function(){})).then((function(){e.active&&abort()}))}}},window.addEventListener("keydown",(function(e){80!==e.keyCode||!e.ctrlKey&&!e.metaKey||e.altKey||e.shiftKey||(window.print(),e.preventDefault(),e.stopImmediatePropagation())}),!0),"onbeforeprint"in window){const e=function(e){"custom"!==e.detail&&e.stopImmediatePropagation()};window.addEventListener("beforeprint",e),window.addEventListener("afterprint",e)}let overlayPromise;function ensureOverlay(){if(!overlayPromise){if(!overlayManager)throw new Error("The overlay manager has not yet been initialized.");dialog||(dialog=document.getElementById("printServiceDialog")),overlayPromise=overlayManager.register(dialog,!0),document.getElementById("printCancel").onclick=abort,dialog.addEventListener("close",abort)}return overlayPromise}const PDFPrintServiceFactory={instance:{supportsPrinting:!0,createPrintService(e,t,i,n,s,r,a){if(activeService)throw new Error("The print service is created and active.");return activeService=new PDFPrintService(e,t,i,n,s,r,a),activeService}}};var _PDFPresentationMode_instances,_PDFPresentationMode_state,_PDFPresentationMode_args,_PDFPresentationMode_mouseWheel,_PDFPresentationMode_notifyStateChange,_PDFPresentationMode_enter,_PDFPresentationMode_exit,_PDFPresentationMode_mouseDown,_PDFPresentationMode_contextMenu,_PDFPresentationMode_showControls,_PDFPresentationMode_hideControls,_PDFPresentationMode_resetMouseScrollState,_PDFPresentationMode_touchSwipe,_PDFPresentationMode_addWindowListeners,_PDFPresentationMode_removeWindowListeners,_PDFPresentationMode_fullscreenChange,_PDFPresentationMode_addFullscreenChangeListeners,_PDFPresentationMode_removeFullscreenChangeListeners;const DELAY_BEFORE_HIDING_CONTROLS=3e3,ACTIVE_SELECTOR="pdfPresentationMode",CONTROLS_SELECTOR="pdfPresentationModeControls",MOUSE_SCROLL_COOLDOWN_TIME=50,PAGE_SWITCH_THRESHOLD=.1,SWIPE_MIN_DISTANCE_THRESHOLD=50,SWIPE_ANGLE_THRESHOLD=Math.PI/6;class PDFPresentationMode{constructor({container:e,pdfViewer:t,eventBus:i}){_PDFPresentationMode_instances.add(this),_PDFPresentationMode_state.set(this,PresentationModeState.UNKNOWN),_PDFPresentationMode_args.set(this,null),this.container=e,this.pdfViewer=t,this.eventBus=i,this.contextMenuOpen=!1,this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0,this.touchSwipeState=null}request(){return __awaiter(this,void 0,void 0,(function*(){const{container:e,pdfViewer:t}=this;if(this.active||!t.pagesCount||!e.requestFullscreen)return!1;__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_addFullscreenChangeListeners).call(this),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_notifyStateChange).call(this,PresentationModeState.CHANGING);const i=e.requestFullscreen();__classPrivateFieldSet(this,_PDFPresentationMode_args,{pageNumber:t.currentPageNumber,scaleValue:t.currentScaleValue,scrollMode:t.scrollMode,spreadMode:null,annotationEditorMode:null}),t.spreadMode===SpreadMode.NONE||t.pageViewsReady&&t.hasEqualPageSizes||(console.warn("Ignoring Spread modes when entering PresentationMode, since the document may contain varying page sizes."),__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").spreadMode=t.spreadMode),t.annotationEditorMode!==pdfExports.AnnotationEditorType.DISABLE&&(__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").annotationEditorMode=t.annotationEditorMode);try{return yield i,t.focus(),!0}catch(e){__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_removeFullscreenChangeListeners).call(this),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_notifyStateChange).call(this,PresentationModeState.NORMAL)}return!1}))}get active(){return __classPrivateFieldGet(this,_PDFPresentationMode_state,"f")===PresentationModeState.CHANGING||__classPrivateFieldGet(this,_PDFPresentationMode_state,"f")===PresentationModeState.FULLSCREEN}}_PDFPresentationMode_state=new WeakMap,_PDFPresentationMode_args=new WeakMap,_PDFPresentationMode_instances=new WeakSet,_PDFPresentationMode_mouseWheel=function(e){if(!this.active)return;e.preventDefault();const t=normalizeWheelEventDelta(e),i=Date.now(),n=this.mouseScrollTimeStamp;if(!(i>n&&i-n<MOUSE_SCROLL_COOLDOWN_TIME)&&((this.mouseScrollDelta>0&&t<0||this.mouseScrollDelta<0&&t>0)&&__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_resetMouseScrollState).call(this),this.mouseScrollDelta+=t,Math.abs(this.mouseScrollDelta)>=PAGE_SWITCH_THRESHOLD)){const e=this.mouseScrollDelta;__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_resetMouseScrollState).call(this);(e>0?this.pdfViewer.previousPage():this.pdfViewer.nextPage())&&(this.mouseScrollTimeStamp=i)}},_PDFPresentationMode_notifyStateChange=function(e){__classPrivateFieldSet(this,_PDFPresentationMode_state,e),this.eventBus.dispatch("presentationmodechanged",{source:this,state:e})},_PDFPresentationMode_enter=function(){var e;__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_notifyStateChange).call(this,PresentationModeState.FULLSCREEN),this.container.classList.add(ACTIVE_SELECTOR),setTimeout((()=>{this.pdfViewer.scrollMode=ScrollMode.PAGE,null!==__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").spreadMode&&(this.pdfViewer.spreadMode=SpreadMode.NONE),this.pdfViewer.currentPageNumber=__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").pageNumber,this.pdfViewer.currentScaleValue="page-fit",null!==__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").annotationEditorMode&&(this.pdfViewer.annotationEditorMode=pdfExports.AnnotationEditorType.NONE)}),0),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_addWindowListeners).call(this),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_showControls).call(this),this.contextMenuOpen=!1,null===(e=window.getSelection())||void 0===e||e.removeAllRanges()},_PDFPresentationMode_exit=function(){const e=this.pdfViewer.currentPageNumber;this.container.classList.remove(ACTIVE_SELECTOR),setTimeout((()=>{var t;__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_removeFullscreenChangeListeners).call(this),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_notifyStateChange).call(this,PresentationModeState.NORMAL),this.pdfViewer.scrollMode=__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").scrollMode,null!==(null===(t=__classPrivateFieldGet(this,_PDFPresentationMode_args,"f"))||void 0===t?void 0:t.spreadMode)&&(this.pdfViewer.spreadMode=__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").spreadMode),this.pdfViewer.currentScaleValue=__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").scaleValue,this.pdfViewer.currentPageNumber=e,null!==__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").annotationEditorMode&&(this.pdfViewer.annotationEditorMode=__classPrivateFieldGet(this,_PDFPresentationMode_args,"f").annotationEditorMode),__classPrivateFieldSet(this,_PDFPresentationMode_args,null)}),0),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_removeWindowListeners).call(this),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_hideControls).call(this),__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_resetMouseScrollState).call(this),this.contextMenuOpen=!1},_PDFPresentationMode_mouseDown=function(e){var t;if(this.contextMenuOpen)return this.contextMenuOpen=!1,void e.preventDefault();0===e.button&&(e.target.href&&(null===(t=e.target.parentNode)||void 0===t?void 0:t.hasAttribute("data-internal-link"))||(e.preventDefault(),e.shiftKey?this.pdfViewer.previousPage():this.pdfViewer.nextPage()))},_PDFPresentationMode_contextMenu=function(){this.contextMenuOpen=!0},_PDFPresentationMode_showControls=function(){this.controlsTimeout?clearTimeout(this.controlsTimeout):this.container.classList.add(CONTROLS_SELECTOR),this.controlsTimeout=setTimeout((()=>{this.container.classList.remove(CONTROLS_SELECTOR),delete this.controlsTimeout}),DELAY_BEFORE_HIDING_CONTROLS)},_PDFPresentationMode_hideControls=function(){this.controlsTimeout&&(clearTimeout(this.controlsTimeout),this.container.classList.remove(CONTROLS_SELECTOR),delete this.controlsTimeout)},_PDFPresentationMode_resetMouseScrollState=function(){this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0},_PDFPresentationMode_touchSwipe=function(e){if(this.active)if(e.touches.length>1)this.touchSwipeState=null;else switch(e.type){case"touchstart":this.touchSwipeState={startX:e.touches[0].pageX,startY:e.touches[0].pageY,endX:e.touches[0].pageX,endY:e.touches[0].pageY};break;case"touchmove":if(null===this.touchSwipeState)return;this.touchSwipeState.endX=e.touches[0].pageX,this.touchSwipeState.endY=e.touches[0].pageY,e.preventDefault();break;case"touchend":if(null===this.touchSwipeState)return;let t=0;const i=this.touchSwipeState.endX-this.touchSwipeState.startX,n=this.touchSwipeState.endY-this.touchSwipeState.startY,s=Math.abs(Math.atan2(n,i));Math.abs(i)>SWIPE_MIN_DISTANCE_THRESHOLD&&(s<=SWIPE_ANGLE_THRESHOLD||s>=Math.PI-SWIPE_ANGLE_THRESHOLD)?t=i:Math.abs(n)>SWIPE_MIN_DISTANCE_THRESHOLD&&Math.abs(s-Math.PI/2)<=SWIPE_ANGLE_THRESHOLD&&(t=n),t>0?this.pdfViewer.previousPage():t<0&&this.pdfViewer.nextPage()}},_PDFPresentationMode_addWindowListeners=function(){this.showControlsBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_showControls).bind(this),this.mouseDownBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_mouseDown).bind(this),this.mouseWheelBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_mouseWheel).bind(this),this.resetMouseScrollStateBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_resetMouseScrollState).bind(this),this.contextMenuBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_contextMenu).bind(this),this.touchSwipeBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_touchSwipe).bind(this),window.addEventListener("mousemove",this.showControlsBind),window.addEventListener("mousedown",this.mouseDownBind),window.addEventListener("wheel",this.mouseWheelBind,{passive:!1}),window.addEventListener("keydown",this.resetMouseScrollStateBind),window.addEventListener("contextmenu",this.contextMenuBind),window.addEventListener("touchstart",this.touchSwipeBind),window.addEventListener("touchmove",this.touchSwipeBind),window.addEventListener("touchend",this.touchSwipeBind)},_PDFPresentationMode_removeWindowListeners=function(){window.removeEventListener("mousemove",this.showControlsBind),window.removeEventListener("mousedown",this.mouseDownBind),window.removeEventListener("wheel",this.mouseWheelBind,{passive:!1}),window.removeEventListener("keydown",this.resetMouseScrollStateBind),window.removeEventListener("contextmenu",this.contextMenuBind),window.removeEventListener("touchstart",this.touchSwipeBind),window.removeEventListener("touchmove",this.touchSwipeBind),window.removeEventListener("touchend",this.touchSwipeBind),delete this.showControlsBind,delete this.mouseDownBind,delete this.mouseWheelBind,delete this.resetMouseScrollStateBind,delete this.contextMenuBind,delete this.touchSwipeBind},_PDFPresentationMode_fullscreenChange=function(){document.fullscreenElement?__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_enter).call(this):__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_exit).call(this)},_PDFPresentationMode_addFullscreenChangeListeners=function(){this.fullscreenChangeBind=__classPrivateFieldGet(this,_PDFPresentationMode_instances,"m",_PDFPresentationMode_fullscreenChange).bind(this),window.addEventListener("fullscreenchange",this.fullscreenChangeBind)},_PDFPresentationMode_removeFullscreenChangeListeners=function(){window.removeEventListener("fullscreenchange",this.fullscreenChangeBind),delete this.fullscreenChangeBind};const initialState={isDocumentLoaded:!1,pagesReady:!1,url:null,numPages:0,pageNumber:0,scale:0,scaleValue:"auto",pagesRotation:0,spreadMode:SpreadMode.UNKNOWN,scrollMode:ScrollMode.UNKNOWN,documentOutline:null,attachments:new Map,thumbnails:new Map,thumbnailViews:new Map,annotationEditorMode:pdfExports.AnnotationEditorType.NONE,pdfSlick:null},create=()=>createStore$1(((e,t)=>Object.assign(Object.assign({},initialState),{_setThumbnailView:(i,n)=>{const s=new Map(t().thumbnails),r=new Map(t().thumbnailViews),{canvasWidth:a,canvasHeight:o,scale:l,rotation:h,loaded:c,pageLabel:d,src:u=null}=n;r.set(i,n),s.set(i,{pageNumber:i,width:a,height:o,scale:l,rotation:h,loaded:c,pageLabel:d,src:u}),e({thumbnailViews:r,thumbnails:s})},_setThumbnailsViews:t=>{const i=new Map(t.map((e=>[e.id,e]))),n=new Map(t.map((e=>{const{canvasWidth:t,canvasHeight:i,scale:n,rotation:s,loaded:r,pageLabel:a,src:o=null}=e;return[e.id,{pageNumber:e.id,width:t,height:i,scale:n,rotation:s,loaded:r,pageLabel:a,src:o}]})));e({thumbnailViews:i,thumbnails:n})}})));var _PDFSlick_instances,_PDFSlick_renderingQueue,_PDFSlick_container,_PDFSlick_viewerContainer,_PDFSlick_thumbsContainer,_PDFSlick_annotationMode,_PDFSlick_annotationEditorMode,_PDFSlick_initializePageLabels,_PDFSlick_parseDocumentInfo,_PDFSlick_parsePageSize,_PDFSlick_initInternalEventListeners,_PDFSlick_onDocumentReady,_PDFSlick_onRotationChanging,_PDFSlick_onSwitchSpreadMode,_PDFSlick_onSwitchScrollMode,_PDFSlick_onScaleChanging,_PDFSlick_onPageChanging,_PDFSlick_onPageRendered;pdfExports.GlobalWorkerOptions.workerSrc=new URL("pdfjs-dist/build/pdf.worker.js","undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:_documentCurrentScript&&_documentCurrentScript.src||new URL("index.js",document.baseURI).href).toString();const US_PAGE_NAMES={"8.5x11":"Letter","8.5x14":"Legal"},METRIC_PAGE_NAMES={"297x420":"A3","210x297":"A4"};function getPageName(e,t,i){return i[`${t?e.width:e.height}x${t?e.height:e.width}`]}class PDFSlick{constructor({container:e,viewer:t,thumbs:i,store:n=create(),options:s}){var r,a,o,l,h,c,d,u,p,g,f,m,_;_PDFSlick_instances.add(this),_PDFSlick_renderingQueue.set(this,void 0),_PDFSlick_container.set(this,void 0),_PDFSlick_viewerContainer.set(this,void 0),_PDFSlick_thumbsContainer.set(this,void 0),this.downloadManager=null,this.findController=null,this.pdfPresentationMode=null,this.document=null,_PDFSlick_annotationMode.set(this,void 0),_PDFSlick_annotationEditorMode.set(this,void 0),__classPrivateFieldSet(this,_PDFSlick_container,e),__classPrivateFieldSet(this,_PDFSlick_viewerContainer,t),__classPrivateFieldSet(this,_PDFSlick_thumbsContainer,i),this.l10n=null!==(r=null==s?void 0:s.l10n)&&void 0!==r?r:pdf_viewerExports.NullL10n,this.downloadManager=new pdf_viewerExports.DownloadManager,this.textLayerMode=null!==(a=null==s?void 0:s.textLayerMode)&&void 0!==a?a:TextLayerMode.ENABLE,__classPrivateFieldSet(this,_PDFSlick_annotationMode,null!==(o=null==s?void 0:s.annotationMode)&&void 0!==o?o:pdfExports.AnnotationMode.ENABLE_FORMS),__classPrivateFieldSet(this,_PDFSlick_annotationEditorMode,null!==(l=null==s?void 0:s.annotationEditorMode)&&void 0!==l?l:pdfExports.AnnotationEditorType.NONE),this.removePageBorders=null!==(h=null==s?void 0:s.removePageBorders)&&void 0!==h&&h,this.singlePageViewer=null!==(c=null==s?void 0:s.singlePageViewer)&&void 0!==c&&c,this.enablePrintAutoRotate=null!==(d=null==s?void 0:s.enablePrintAutoRotate)&&void 0!==d&&d,this.useOnlyCssZoom=null!==(u=null==s?void 0:s.useOnlyCssZoom)&&void 0!==u&&u,this.pageColors=null!==(p=null==s?void 0:s.pageColors)&&void 0!==p?p:null,this.maxCanvasPixels=null!==(g=null==s?void 0:s.maxCanvasPixels)&&void 0!==g?g:16777216,this.printResolution=null!==(f=null==s?void 0:s.printResolution)&&void 0!==f?f:96,this.thumbnailWidth=null!==(m=null==s?void 0:s.thumbnailWidth)&&void 0!==m?m:125,!this.pageColors||CSS.supports("color",this.pageColors.background)&&CSS.supports("color",this.pageColors.foreground)||((this.pageColors.background||this.pageColors.foreground)&&console.warn("PDFViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."),this.pageColors=null),this.l10n=pdf_viewerExports.NullL10n,this.store=n;const v=new PDFRenderingQueue;v.onIdle=this._cleanup.bind(this),v.isThumbnailViewEnabled=!0,__classPrivateFieldSet(this,_PDFSlick_renderingQueue,v);const b=new pdf_viewerExports.EventBus,y=new pdf_viewerExports.PDFLinkService({eventBus:b,externalLinkTarget:2,externalLinkRel:"noopener noreferrer nofollow",ignoreDestinationZoom:!1}),S=Object.assign(Object.assign({container:e},t&&{viewer:t}),{eventBus:b,linkService:y,renderingQueue:v,defaultRenderingQueue:!0,textLayerMode:this.textLayerMode,l10n:this.l10n,annotationMode:__classPrivateFieldGet(this,_PDFSlick_annotationMode,"f"),annotationEditorMode:__classPrivateFieldGet(this,_PDFSlick_annotationEditorMode,"f"),removePageBorders:this.removePageBorders,imageResourcesPath:"/images/",useOnlyCssZoom:this.useOnlyCssZoom}),P=this.singlePageViewer?new pdf_viewerExports.PDFSinglePageViewer(S):new pdf_viewerExports.PDFViewer(S);v.setViewer(P),i&&(this.thumbnailViewer=new PDFThumbnailViewer({container:i,eventBus:b,linkService:y,renderingQueue:v,l10n:this.l10n,pageColors:this.pageColors,store:n,thumbnailWidth:this.thumbnailWidth}),v.setThumbnailViewer(this.thumbnailViewer)),document.fullscreenEnabled&&(this.pdfPresentationMode=new PDFPresentationMode({container:e,pdfViewer:P,eventBus:b})),this.eventBus=b,this.linkService=y,this.viewer=P,this.linkService.setViewer(P);const A=null!==(_=null==s?void 0:s.scaleValue)&&void 0!==_?_:"auto";this.store.setState({scaleValue:A})}loadDocument(e,t){var i,n,s,r,a;return __awaiter(this,void 0,void 0,(function*(){if(this.url&&"string"==typeof this.url)try{URL.revokeObjectURL(this.url)}catch(e){}null===(i=this.document)||void 0===i||i.destroy(),null===(n=this.viewer)||void 0===n||n.cleanup(),e instanceof URL?this.url=e.toString():this.url=e;const o=null!==(s=null==t?void 0:t.filename)&&void 0!==s?s:pdfExports.getPdfFilenameFromUrl(null===(r=this.url)||void 0===r?void 0:r.toString());this.filename=o;const l=yield pdfExports.getDocument(e).promise;this.document=l,this.viewer.setDocument(this.document),this.linkService.setDocument(this.document),this.thumbnailViewer&&(null===(a=this.thumbnailViewer)||void 0===a||a.setDocument(l)),__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_initInternalEventListeners).call(this),yield __classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_initializePageLabels).call(this),this.store.setState({filename:o,numPages:l.numPages,pageNumber:1,isDocumentLoaded:!0,url:e.toString()});const h=yield l.getAttachments(),c=new Map(Object.keys(null!=h?h:{}).sort(((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))).map((e=>[e,h[e]])));this.store.setState({attachments:c}),yield __classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_parseDocumentInfo).call(this),this.forceRendering()}))}forceRendering(e=!0){__classPrivateFieldGet(this,_PDFSlick_renderingQueue,"f").printing=!!this.printService,__classPrivateFieldGet(this,_PDFSlick_renderingQueue,"f").isThumbnailViewEnabled=e,__classPrivateFieldGet(this,_PDFSlick_renderingQueue,"f").renderHighestPriority()}gotoPage(e){this.linkService.goToPage(e)}openOrDownloadData(e,t,i){var n;null===(n=this.downloadManager)||void 0===n||n.openOrDownloadData(e,t,i)}download(){var e,t;return __awaiter(this,void 0,void 0,(function*(){const i=this.url,{filename:n}=this;try{const t=yield this.document.getData(),s=new Blob([t],{type:"application/pdf"});yield null===(e=this.downloadManager)||void 0===e?void 0:e.download(s,i,n,{})}catch(e){yield null===(t=this.downloadManager)||void 0===t?void 0:t.downloadUrl(i,n,{})}}))}save(){var e;return __awaiter(this,void 0,void 0,(function*(){const t=this.url,{filename:i}=this;try{const n=yield this.document.saveDocument(),s=new Blob([n],{type:"application/pdf"});yield null===(e=this.downloadManager)||void 0===e?void 0:e.download(s,t,i,{})}catch(e){console.error(`Error when saving the document: ${e.message}`),yield this.download()}}))}downloadOrSave(){var e;const{annotationStorage:t}=null!==(e=this.document)&&void 0!==e?e:{};t&&t.size>0?this.save():this.download()}get supportsPrinting(){return PDFPrintServiceFactory.instance.supportsPrinting}beforePrint(){if(this.printService)return;if(!this.supportsPrinting)return;if(!this.viewer.pageViewsReady)return void this.l10n.get("printing_not_ready").then((e=>{window.alert(e)}));const e=this.viewer.getPagesOverview(),t=document.getElementById("printContainer"),i=this.printResolution,n=this.viewer.optionalContentConfigPromise,s=PDFPrintServiceFactory.instance.createPrintService(this.document,e,t,i,n,null,this.l10n);this.printService=s,this.forceRendering(),s.layout()}afterPrint(){var e;this.printService&&(this.printService.destroy(),this.printService=null,null===(e=this.document)||void 0===e||e.annotationStorage.resetModified()),this.forceRendering()}requestPresentationMode(){var e;null===(e=this.pdfPresentationMode)||void 0===e||e.request()}triggerPrinting(){this.supportsPrinting&&window.print()}_cleanup(){var e;if(this.document)try{this.viewer.cleanup(),null===(e=this.thumbnailViewer)||void 0===e||e.cleanup(),this.document.cleanup()}catch(e){console.error("Unable to perform cleanup",e)}}setAnnotationEditorMode(e){this.viewer.annotationEditorMode={mode:e},this.store.setState({annotationEditorMode:e})}setAnnotationEditorParams(e){const t=Array.isArray(e)?e:[e];for(const e of t)this.viewer.annotationEditorParams=e}setSpreadMode(e){isValidSpreadMode(e)&&(this.viewer.spreadMode=e,this.dispatch("switchspreadmode",{mode:e}))}setScrollMode(e){isValidScrollMode(e)&&(this.viewer.scrollMode=e,this.dispatch("switchscrollmode",{mode:e}))}setRotation(e){isValidRotation(e)&&(this.viewer.pagesRotation=e)}getPagesOverview(){var e,t;try{return null!==(t=null===(e=this.viewer)||void 0===e?void 0:e.getPagesOverview())&&void 0!==t?t:[]}catch(e){return[]}}increaseScale(){this.viewer.increaseScale()}decreaseScale(){this.viewer.decreaseScale()}set currentScaleValue(e){this.viewer.currentScaleValue=e}set currentScale(e){this.viewer.currentScale=e}getPageView(e){return this.viewer.getPageView(e)}on(e,t,i){this.eventBus.on(e,t,i)}off(e,t,i){this.eventBus.off(e,t,i)}dispatch(e,t){this.eventBus.dispatch(e,t)}}_PDFSlick_renderingQueue=new WeakMap,_PDFSlick_container=new WeakMap,_PDFSlick_viewerContainer=new WeakMap,_PDFSlick_thumbsContainer=new WeakMap,_PDFSlick_annotationMode=new WeakMap,_PDFSlick_annotationEditorMode=new WeakMap,_PDFSlick_instances=new WeakSet,_PDFSlick_initializePageLabels=function(){var e;return __awaiter(this,void 0,void 0,(function*(){const t=this.document,i=null!==(e=yield t.getPageLabels())&&void 0!==e?e:[],n=i.length;let s=0,r=0;for(let e=0;e<n;e++){const t=i[e];if(t===(e+1).toString())s++;else{if(""!==t)break;r++}}if(s>=n||r>=n)return;const{viewer:a,thumbnailViewer:o}=this;a.setPageLabels(i),null==o||o.setPageLabels(i)}))},_PDFSlick_parseDocumentInfo=function(){return __awaiter(this,void 0,void 0,(function*(){const{info:e,contentLength:t}=yield this.document.getMetadata(),i=yield this.document.getPage(this.store.getState().pageNumber).then((e=>__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_parsePageSize).call(this,getPageSizeInches(e),0)));this.store.setState({filesize:t,title:e.Title,author:e.Author,subject:e.Subject,keywords:e.Keywords,creator:e.Creator,producer:e.Producer,version:e.PDFFormatVersion,creationDate:pdfExports.PDFDateString.toDateObject(e.CreationDate),modificationDate:pdfExports.PDFDateString.toDateObject(e.ModDate),isLinearized:e.IsLinearized,pageSize:i})}))},_PDFSlick_parsePageSize=function(e,t){return __awaiter(this,void 0,void 0,(function*(){if(!e)return;t%180!=0&&(e={width:e.height,height:e.width});const i=isPortraitOrientation(e);let n={width:Math.round(100*e.width)/100,height:Math.round(100*e.height)/100},s={width:Math.round(25.4*e.width*10)/10,height:Math.round(25.4*e.height*10)/10},r=getPageName(n,i,US_PAGE_NAMES)||getPageName(s,i,METRIC_PAGE_NAMES);if(!(r||Number.isInteger(s.width)&&Number.isInteger(s.height))){const t={width:25.4*e.width,height:25.4*e.height},a={width:Math.round(s.width),height:Math.round(s.height)};Math.abs(t.width-a.width)<.1&&Math.abs(t.height-a.height)<.1&&(r=getPageName(a,i,METRIC_PAGE_NAMES),r&&(n={width:Math.round(a.width/25.4*100)/100,height:Math.round(a.height/25.4*100)/100},s=a))}const[{width:a,height:o},l,h,c]=yield Promise.all([n,this.l10n.get("document_properties_page_size_unit_inches"),r&&this.l10n.get(`document_properties_page_size_name_${r.toLowerCase()}`),this.l10n.get("document_properties_page_size_orientation_"+(i?"portrait":"landscape"))]);return{width:a.toLocaleString(),height:o.toLocaleString(),unit:l,name:h,orientation:c}}))},_PDFSlick_initInternalEventListeners=function(){this.eventBus._on("pagesinit",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onDocumentReady).bind(this)),this.eventBus._on("scalechanging",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onScaleChanging).bind(this)),this.eventBus._on("pagechanging",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onPageChanging).bind(this)),this.eventBus._on("pagerendered",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onPageRendered).bind(this)),this.eventBus._on("rotationchanging",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onRotationChanging).bind(this)),this.eventBus._on("switchspreadmode",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onSwitchSpreadMode).bind(this)),this.eventBus._on("switchscrollmode",__classPrivateFieldGet(this,_PDFSlick_instances,"m",_PDFSlick_onSwitchScrollMode).bind(this)),this.eventBus._on("beforeprint",this.beforePrint.bind(this)),this.eventBus._on("afterprint",this.afterPrint.bind(this)),window.onbeforeprint=e=>{this.eventBus.dispatch("beforeprint",{source:window})},window.onafterprint=e=>{this.eventBus.dispatch("afterprint",{source:window})}},_PDFSlick_onDocumentReady=function({source:e}){var t;return __awaiter(this,void 0,void 0,(function*(){const i=yield null===(t=this.document)||void 0===t?void 0:t.getOutline(),n=this.store.getState().scaleValue;e.currentScale=1,e.currentScaleValue="auto",this.store.setState({documentOutline:i,pageNumber:1,scaleValue:n,pagesReady:!0})}))},_PDFSlick_onRotationChanging=function({pagesRotation:e,pageNumber:t}){this.store.setState({pagesRotation:e}),this.thumbnailViewer&&(this.thumbnailViewer.pagesRotation=e),this.forceRendering(),this.viewer.currentPageNumber=t},_PDFSlick_onSwitchSpreadMode=function({mode:e}){this.store.setState({spreadMode:e})},_PDFSlick_onSwitchScrollMode=function({mode:e}){this.store.setState({scrollMode:e})},_PDFSlick_onScaleChanging=function({scale:e,presetValue:t}){this.store.setState({scale:e,scaleValue:t}),this.viewer.update()},_PDFSlick_onPageChanging=function({pageNumber:e}){var t;null===(t=this.thumbnailViewer)||void 0===t||t.scrollThumbnailIntoView(e),this.store.setState({pageNumber:e})},_PDFSlick_onPageRendered=function({pageNumber:e,error:t}){var i;if(__classPrivateFieldGet(this,_PDFSlick_thumbsContainer,"f")){const t=this.viewer.getPageView(e-1),n=null===(i=this.thumbnailViewer)||void 0===i?void 0:i.getThumbnail(e-1);t&&n&&n.setImage(t)}};var noop=function(){},isBrowser="undefined"!=typeof window,useIsomorphicLayoutEffect=isBrowser?React.useLayoutEffect:React.useEffect;function useTimeoutFn(e,t){var i=React.useRef(!1),n=React.useRef(),s=React.useRef(e),r=React.useCallback((function(){return i.current}),[]),a=React.useCallback((function(){i.current=!1,n.current&&clearTimeout(n.current),n.current=setTimeout((function(){i.current=!0,s.current()}),t)}),[t]),o=React.useCallback((function(){i.current=null,n.current&&clearTimeout(n.current)}),[]);return React.useEffect((function(){s.current=e}),[e]),React.useEffect((function(){return a(),o}),[t]),[r,o,a]}function useDebounce(e,t,i){void 0===i&&(i=[]);var n=useTimeoutFn(e,t),s=n[0],r=n[1],a=n[2];return React.useEffect(a,i),[s,r]}var defaultState={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function useMeasure(){var e=React.useState(null),t=e[0],i=e[1],n=React.useState(defaultState),s=n[0],r=n[1],a=React.useMemo((function(){return new window.ResizeObserver((function(e){if(e[0]){var t=e[0].contentRect,i=t.x,n=t.y,s=t.width,a=t.height,o=t.top,l=t.left,h=t.bottom,c=t.right;r({x:i,y:n,width:s,height:a,top:o,left:l,bottom:h,right:c})}}))}),[]);return useIsomorphicLayoutEffect((function(){if(t)return a.observe(t),function(){a.disconnect()}}),[t]),[i,s]}var useMeasure$1=isBrowser&&void 0!==window.ResizeObserver?useMeasure:function(){return[noop,defaultState]};function PDFSlickViewer({usePDFSlickStore:e,viewerRef:t,className:i}){const n=e((e=>e.pdfSlick)),s=e((e=>e.scaleValue)),[r,{width:a}]=useMeasure$1();return useDebounce((()=>{a&&(!n||"auto"!==s&&"page-fit"!==s&&"page-width"!==s||(n.viewer.currentScaleValue=s),null==n||n.viewer.update())}),0,[a]),jsxRuntime.jsx("div",Object.assign({ref:e=>{t(e),r(e)},id:"viewerContainer",className:`pdfSlickContainer ${null!=i?i:""}`,style:{position:"absolute",inset:0}},{children:jsxRuntime.jsx("div",{id:"viewer",className:"pdfSlickViewer pdfViewer"})}))}function PDFSlickThumbnails({children:e,thumbsRef:t,usePDFSlickStore:i,className:n}){const s=i((e=>e.thumbnailViews)),r=i((e=>e.pdfSlick)),[a,{width:o}]=useMeasure$1();return useDebounce((()=>{o&&(null==r||r.forceRendering())}),0,[o]),jsxRuntime.jsx("div",Object.assign({ref:e=>{t(e),a(e)}},{className:n},{style:{position:"absolute",overflow:"auto",inset:0}},{children:Array.from(s).map((([t,i])=>{var n;return reactDom.createPortal(e({pageNumber:t,width:i.canvasWidth,height:i.canvasHeight,scale:i.scale,src:null!==(n=null==i?void 0:i.src)&&void 0!==n?n:null,rotation:i.rotation,pageLabel:i.pageLabel,loaded:i.loaded}),i.div)}))}))}function createStore(e){return function(t,i){return useStore(e,t,i)}}const usePDFSlick=(e,t)=>{const[i,n]=React.useState(!1),[s,r]=React.useState(null),[a,o]=React.useState(null),l=React.useMemo((()=>create()),[]),h=React.useMemo((()=>createStore(l)),[]),c=React.useCallback((e=>{null!==e&&r(e)}),[]),d=React.useCallback((e=>{null!==e&&o(e)}),[]);return React.useEffect((()=>{if(e&&s){const i=new PDFSlick({container:s,thumbs:a,store:l,options:t});i.loadDocument(e,t).then((()=>n(!0))),l.setState({pdfSlick:i})}return()=>{}}),[e,s]),{isDocumentLoaded:i,viewerRef:c,thumbsRef:d,usePDFSlickStore:h,store:l,PDFSlickViewer:PDFSlickViewer,PDFSlickThumbnails:PDFSlickThumbnails}};exports.AutoPrintRegExp=AutoPrintRegExp,exports.CursorTool=CursorTool,exports.DEFAULT_SCALE=DEFAULT_SCALE,exports.DEFAULT_SCALE_DELTA=DEFAULT_SCALE_DELTA,exports.DEFAULT_SCALE_VALUE=DEFAULT_SCALE_VALUE,exports.MAX_AUTO_SCALE=MAX_AUTO_SCALE,exports.MAX_SCALE=MAX_SCALE,exports.MIN_SCALE=MIN_SCALE,exports.OutputScale=OutputScale,exports.PDFSlick=PDFSlick,exports.PDFSlickThumbnails=PDFSlickThumbnails,exports.PDFSlickViewer=PDFSlickViewer,exports.PresentationModeState=PresentationModeState,exports.ProgressBar=ProgressBar,exports.RendererType=RendererType,exports.RenderingStates=RenderingStates,exports.SCROLLBAR_PADDING=SCROLLBAR_PADDING,exports.ScrollMode=ScrollMode,exports.SidebarView=SidebarView,exports.SpreadMode=SpreadMode,exports.TextLayerMode=TextLayerMode,exports.UNKNOWN_SCALE=UNKNOWN_SCALE,exports.VERTICAL_PADDING=VERTICAL_PADDING,exports.animationStarted=animationStarted,exports.apiPageLayoutToViewerModes=apiPageLayoutToViewerModes,exports.apiPageModeToSidebarView=apiPageModeToSidebarView,exports.approximateFraction=approximateFraction,exports.backtrackBeforeAllVisibleElements=backtrackBeforeAllVisibleElements,exports.binarySearchFirstItem=binarySearchFirstItem,exports.create=create,exports.createStore=createStore,exports.docStyle=docStyle,exports.getActiveOrFocusedElement=getActiveOrFocusedElement,exports.getPageSizeInches=getPageSizeInches,exports.getVisibleElements=getVisibleElements,exports.initialState=initialState,exports.isPortraitOrientation=isPortraitOrientation,exports.isValidRotation=isValidRotation,exports.isValidScrollMode=isValidScrollMode,exports.isValidSpreadMode=isValidSpreadMode,exports.noContextMenuHandler=noContextMenuHandler,exports.normalizeWheelEventDelta=normalizeWheelEventDelta,exports.normalizeWheelEventDirection=normalizeWheelEventDirection,exports.parseQueryString=parseQueryString,exports.removeNullCharacters=removeNullCharacters,exports.roundToDivide=roundToDivide,exports.scrollIntoView=scrollIntoView,exports.usePDFSlick=usePDFSlick,exports.watchScroll=watchScroll}));
|
|
@@ -4,11 +4,12 @@ import { StoreApi } from "zustand";
|
|
|
4
4
|
import type { PDFSlickState, PDFSlickOptions } from "@pdfslick/core";
|
|
5
5
|
import PDFSlickViewer from "./PDFSlickViewer";
|
|
6
6
|
import { PDFSlickThumbnails } from "./PDFSlickThumbnails";
|
|
7
|
+
export { PDFSlickViewer };
|
|
7
8
|
export type TUsePDFSlickStore = {
|
|
8
9
|
(): PDFSlickState;
|
|
9
10
|
<T>(selector: (state: PDFSlickState) => T, equals?: ((a: T, b: T) => boolean) | undefined): T;
|
|
10
11
|
};
|
|
11
|
-
type TUsePDFSlick = (url: string | URL | undefined, options?: PDFSlickOptions) => {
|
|
12
|
+
type TUsePDFSlick = (url: string | URL | ArrayBuffer | undefined, options?: PDFSlickOptions) => {
|
|
12
13
|
isDocumentLoaded: boolean;
|
|
13
14
|
viewerRef: RefCallback<HTMLElement>;
|
|
14
15
|
thumbsRef: RefCallback<HTMLElement>;
|
|
@@ -28,5 +29,4 @@ export declare function createStore(store: StoreApi<PDFSlickState>): {
|
|
|
28
29
|
* @returns
|
|
29
30
|
*/
|
|
30
31
|
export declare const usePDFSlick: TUsePDFSlick;
|
|
31
|
-
export {};
|
|
32
32
|
//# sourceMappingURL=usePDFSlick.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePDFSlick.d.ts","sourceRoot":"","sources":["../usePDFSlick.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAoC,WAAW,EAAW,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAE7C,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,aAAa,CAAC;IAClB,CAAC,CAAC,EACA,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,CAAC,EACrC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,SAAS,GAC7C,CAAC,CAAC;CACN,CAAC;AAEF,KAAK,YAAY,GAAG,CAClB,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"usePDFSlick.d.ts","sourceRoot":"","sources":["../usePDFSlick.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAoC,WAAW,EAAW,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAE7C,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,aAAa,CAAC;IAClB,CAAC,CAAC,EACA,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,CAAC,EACrC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,SAAS,GAC7C,CAAC,CAAC;CACN,CAAC;AAEF,KAAK,YAAY,GAAG,CAClB,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,WAAW,GAAG,SAAS,EAE3C,OAAO,CAAC,EAAE,eAAe,KACtB;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACpC,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACpC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IAC/B,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;CAC/C,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC;QAC3B,aAAa;0BAEtB,aAAa,kCACN,OAAO;EAUnC;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,YA+CzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdfslick/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"source": "./index.tsx",
|
|
5
5
|
"main": "dist/umd/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -40,16 +40,17 @@
|
|
|
40
40
|
"scripts": {
|
|
41
41
|
"lint": "eslint \"**/*.ts*\"",
|
|
42
42
|
"dev": "concurrently \"rollup --config node:@pdfslick/rollup-config --watch\" \"wait-on ./dist && cp ../core/dist/pdf_viewer.css ./dist\"",
|
|
43
|
+
"devdev": "rollup --config node:@pdfslick/rollup-config && cp ../core/dist/pdf_viewer.css ./dist",
|
|
43
44
|
"build": "rollup --config node:@pdfslick/rollup-config --environment NODE_ENV:production && cp ../core/dist/pdf_viewer.css ./dist"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@types/react": "^18.2.
|
|
47
|
+
"@types/react": "^18.2.79",
|
|
47
48
|
"concurrently": "^8.2.2",
|
|
48
49
|
"eslint": "^8.56.0",
|
|
49
50
|
"eslint-config-custom": "0.0.0",
|
|
50
51
|
"react": "^18.2.0",
|
|
51
52
|
"tsconfig": "0.0.0",
|
|
52
|
-
"typescript": "^5.
|
|
53
|
+
"typescript": "^5.4.5",
|
|
53
54
|
"wait-on": "^7.2.0"
|
|
54
55
|
},
|
|
55
56
|
"peerDependencies": {
|
|
@@ -57,9 +58,9 @@
|
|
|
57
58
|
"react-dom": ">=17"
|
|
58
59
|
},
|
|
59
60
|
"dependencies": {
|
|
60
|
-
"@pdfslick/core": "^1.
|
|
61
|
-
"react-use": "^17.
|
|
62
|
-
"zustand": "^4.
|
|
61
|
+
"@pdfslick/core": "^1.4.0",
|
|
62
|
+
"react-use": "^17.5.0",
|
|
63
|
+
"zustand": "^4.5.2"
|
|
63
64
|
},
|
|
64
65
|
"rollup": {
|
|
65
66
|
"globals": {
|