ngx-extended-pdf-viewer
Version:
Embedding PDF files in your Angular application. Highly configurable viewer including the toolbar, sidebar, and all the features you're used to.
24 lines • 468 kB
JavaScript
window.ngxZone.runOutsideAngular(() => {
/**
* @licstart The following is the entire license notice for the
* JavaScript code in this page
*
* Copyright 2022 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @licend The above is the entire license notice for the
* JavaScript code in this page
*/(()=>{var e=[,(e,t,i)=>{var n=i(2),r=i(3),s=i(4),o=i(8),a=i(62),l=i(17),c=l("iterator"),h=l("toStringTag"),d=o.values,handlePrototype=function(e,t){if(e){if(e[c]!==d)try{a(e,c,d)}catch(t){e[c]=d}e[h]||a(e,h,t);if(r[t])for(var i in o)if(e[i]!==o[i])try{a(e,i,o[i])}catch(t){e[i]=o[i]}}};for(var u in r)handlePrototype(n[u]&&n[u].prototype,u);handlePrototype(s,"DOMTokenList")},e=>{var check=function(e){return e&&e.Math==Math&&e};e.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||Function("return this")()},e=>{e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},(e,t,i)=>{var n=i(5)("span").classList,r=n&&n.constructor&&n.constructor.prototype;e.exports=r===Object.prototype?void 0:r},(e,t,i)=>{var n=i(2),r=i(6),s=n.document,o=r(s)&&r(s.createElement);e.exports=function(e){return o?s.createElement(e):{}}},(e,t,i)=>{var n=i(7);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},e=>{e.exports=function(e){return"function"==typeof e}},(e,t,i)=>{"use strict";var n=i(9),r=i(16),s=i(58),o=i(59),a=i(35).f,l=i(64),c=i(19),h=i(33),d="Array Iterator",u=o.set,p=o.getterFor(d);e.exports=l(Array,"Array",(function(e,t){u(this,{type:d,target:n(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,i=e.kind,n=e.index++;if(!t||n>=t.length){e.target=void 0;return{value:void 0,done:!0}}return"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");var g=s.Arguments=s.Array;r("keys");r("values");r("entries");if(!c&&h&&"values"!==g.name)try{a(g,"name",{value:"values"})}catch(e){}},(e,t,i)=>{var n=i(10),r=i(15);e.exports=function(e){return n(r(e))}},(e,t,i)=>{var n=i(11),r=i(13),s=i(14),o=Object,a=n("".split);e.exports=r((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"==s(e)?a(e,""):o(e)}:o},(e,t,i)=>{var n=i(12),r=Function.prototype,s=r.bind,o=r.call,a=n&&s.bind(o,o);e.exports=n?function(e){return e&&a(e)}:function(e){return e&&function(){return o.apply(e,arguments)}}},(e,t,i)=>{var n=i(13);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},(e,t,i)=>{var n=i(11),r=n({}.toString),s=n("".slice);e.exports=function(e){return s(r(e),8,-1)}},e=>{var t=TypeError;e.exports=function(e){if(null==e)throw t("Can't call method on "+e);return e}},(e,t,i)=>{var n=i(17),r=i(30),s=i(35).f,o=n("unscopables"),a=Array.prototype;null==a[o]&&s(a,o,{configurable:!0,value:r(null)});e.exports=function(e){a[o][e]=!0}},(e,t,i)=>{var n=i(2),r=i(18),s=i(22),o=i(24),a=i(25),l=i(29),c=r("wks"),h=n.Symbol,d=h&&h.for,u=l?h:h&&h.withoutSetter||o;e.exports=function(e){if(!s(c,e)||!a&&"string"!=typeof c[e]){var t="Symbol."+e;a&&s(h,e)?c[e]=h[e]:c[e]=l&&d?d(t):u(t)}return c[e]}},(e,t,i)=>{var n=i(19),r=i(20);(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.23.5",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.5/LICENSE",source:"https://github.com/zloirock/core-js"})},e=>{e.exports=!1},(e,t,i)=>{var n=i(2),r=i(21),s="__core-js_shared__",o=n[s]||r(s,{});e.exports=o},(e,t,i)=>{var n=i(2),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},(e,t,i)=>{var n=i(11),r=i(23),s=n({}.hasOwnProperty);e.exports=Object.hasOwn||function hasOwn(e,t){return s(r(e),t)}},(e,t,i)=>{var n=i(15),r=Object;e.exports=function(e){return r(n(e))}},(e,t,i)=>{var n=i(11),r=0,s=Math.random(),o=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++r+s,36)}},(e,t,i)=>{var n=i(26),r=i(13);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},(e,t,i)=>{var n,r,s=i(2),o=i(27),a=s.process,l=s.Deno,c=a&&a.versions||l&&l.version,h=c&&c.v8;h&&(r=(n=h.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1]));!r&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(r=+n[1]);e.exports=r},(e,t,i)=>{var n=i(28);e.exports=n("navigator","userAgent")||""},(e,t,i)=>{var n=i(2),r=i(7),aFunction=function(e){return r(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?aFunction(n[e]):n[e]&&n[e][t]}},(e,t,i)=>{var n=i(25);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(e,t,i)=>{var n,r=i(31),s=i(32),o=i(55),a=i(54),l=i(56),c=i(5),h=i(57),d=h("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return"<script>"+e+"</"+"script>"},NullProtoObjectViaActiveX=function(e){e.write(scriptTag(""));e.close();var t=e.parentWindow.Object;e=null;return t},NullProtoObject=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"!=typeof document?document.domain&&n?NullProtoObjectViaActiveX(n):function(){var e,t=c("iframe");t.style.display="none";l.appendChild(t);t.src=String("javascript:");(e=t.contentWindow.document).open();e.write(scriptTag("document.F=Object"));e.close();return e.F}():NullProtoObjectViaActiveX(n);for(var e=o.length;e--;)delete NullProtoObject.prototype[o[e]];return NullProtoObject()};a[d]=!0;e.exports=Object.create||function create(e,t){var i;if(null!==e){EmptyConstructor.prototype=r(e);i=new EmptyConstructor;EmptyConstructor.prototype=null;i[d]=e}else i=NullProtoObject();return void 0===t?i:s.f(i,t)}},(e,t,i)=>{var n=i(6),r=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw s(r(e)+" is not an object")}},(e,t,i)=>{var n=i(33),r=i(34),s=i(35),o=i(31),a=i(9),l=i(46);t.f=n&&!r?Object.defineProperties:function defineProperties(e,t){o(e);for(var i,n=a(t),r=l(t),c=r.length,h=0;c>h;)s.f(e,i=r[h++],n[i]);return e}},(e,t,i)=>{var n=i(13);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},(e,t,i)=>{var n=i(33),r=i(13);e.exports=n&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(e,t,i)=>{var n=i(33),r=i(36),s=i(34),o=i(31),a=i(37),l=TypeError,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",p="writable";t.f=n?s?function defineProperty(e,t,i){o(e);t=a(t);o(i);if("function"==typeof e&&"prototype"===t&&"value"in i&&p in i&&!i.writable){var n=h(e,t);if(n&&n.writable){e[t]=i.value;i={configurable:u in i?i.configurable:n.configurable,enumerable:d in i?i.enumerable:n.enumerable,writable:!1}}}return c(e,t,i)}:c:function defineProperty(e,t,i){o(e);t=a(t);o(i);if(r)try{return c(e,t,i)}catch(e){}if("get"in i||"set"in i)throw l("Accessors not supported");"value"in i&&(e[t]=i.value);return e}},(e,t,i)=>{var n=i(33),r=i(13),s=i(5);e.exports=!n&&!r((function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},(e,t,i)=>{var n=i(38),r=i(40);e.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}},(e,t,i)=>{var n=i(39),r=i(6),s=i(40),o=i(42),a=i(45),l=i(17),c=TypeError,h=l("toPrimitive");e.exports=function(e,t){if(!r(e)||s(e))return e;var i,l=o(e,h);if(l){void 0===t&&(t="default");i=n(l,e,t);if(!r(i)||s(i))return i;throw c("Can't convert object to primitive value")}void 0===t&&(t="number");return a(e,t)}},(e,t,i)=>{var n=i(12),r=Function.prototype.call;e.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},(e,t,i)=>{var n=i(28),r=i(7),s=i(41),o=i(29),a=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return r(t)&&s(t.prototype,a(e))}},(e,t,i)=>{var n=i(11);e.exports=n({}.isPrototypeOf)},(e,t,i)=>{var n=i(43);e.exports=function(e,t){var i=e[t];return null==i?void 0:n(i)}},(e,t,i)=>{var n=i(7),r=i(44),s=TypeError;e.exports=function(e){if(n(e))return e;throw s(r(e)+" is not a function")}},e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},(e,t,i)=>{var n=i(39),r=i(7),s=i(6),o=TypeError;e.exports=function(e,t){var i,a;if("string"===t&&r(i=e.toString)&&!s(a=n(i,e)))return a;if(r(i=e.valueOf)&&!s(a=n(i,e)))return a;if("string"!==t&&r(i=e.toString)&&!s(a=n(i,e)))return a;throw o("Can't convert object to primitive value")}},(e,t,i)=>{var n=i(47),r=i(55);e.exports=Object.keys||function keys(e){return n(e,r)}},(e,t,i)=>{var n=i(11),r=i(22),s=i(9),o=i(48).indexOf,a=i(54),l=n([].push);e.exports=function(e,t){var i,n=s(e),c=0,h=[];for(i in n)!r(a,i)&&r(n,i)&&l(h,i);for(;t.length>c;)r(n,i=t[c++])&&(~o(h,i)||l(h,i));return h}},(e,t,i)=>{var n=i(9),r=i(49),s=i(52),createMethod=function(e){return function(t,i,o){var a,l=n(t),c=s(l),h=r(o,c);if(e&&i!=i){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((e||h in l)&&l[h]===i)return e||h||0;return!e&&-1}};e.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(e,t,i)=>{var n=i(50),r=Math.max,s=Math.min;e.exports=function(e,t){var i=n(e);return i<0?r(i+t,0):s(i,t)}},(e,t,i)=>{var n=i(51);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},e=>{var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function trunc(e){var n=+e;return(n>0?i:t)(n)}},(e,t,i)=>{var n=i(53);e.exports=function(e){return n(e.length)}},(e,t,i)=>{var n=i(50),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},e=>{e.exports={}},e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(e,t,i)=>{var n=i(28);e.exports=n("document","documentElement")},(e,t,i)=>{var n=i(18),r=i(24),s=n("keys");e.exports=function(e){return s[e]||(s[e]=r(e))}},e=>{e.exports={}},(e,t,i)=>{var n,r,s,o=i(60),a=i(2),l=i(11),c=i(6),h=i(62),d=i(22),u=i(20),p=i(57),g=i(54),f="Object already initialized",m=a.TypeError,v=a.WeakMap;if(o||u.state){var w=u.state||(u.state=new v),_=l(w.get),y=l(w.has),b=l(w.set);n=function(e,t){if(y(w,e))throw new m(f);t.facade=e;b(w,e,t);return t};r=function(e){return _(w,e)||{}};s=function(e){return y(w,e)}}else{var P=p("state");g[P]=!0;n=function(e,t){if(d(e,P))throw new m(f);t.facade=e;h(e,P,t);return t};r=function(e){return d(e,P)?e[P]:{}};s=function(e){return d(e,P)}}e.exports={set:n,get:r,has:s,enforce:function(e){return s(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!c(t)||(i=r(t)).type!==e)throw m("Incompatible receiver, "+e+" required");return i}}}},(e,t,i)=>{var n=i(2),r=i(7),s=i(61),o=n.WeakMap;e.exports=r(o)&&/native code/.test(s(o))},(e,t,i)=>{var n=i(11),r=i(7),s=i(20),o=n(Function.toString);r(s.inspectSource)||(s.inspectSource=function(e){return o(e)});e.exports=s.inspectSource},(e,t,i)=>{var n=i(33),r=i(35),s=i(63);e.exports=n?function(e,t,i){return r.f(e,t,s(1,i))}:function(e,t,i){e[t]=i;return e}},e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},(e,t,i)=>{"use strict";var n=i(65),r=i(39),s=i(19),o=i(70),a=i(7),l=i(76),c=i(78),h=i(81),d=i(80),u=i(62),p=i(68),g=i(17),f=i(58),m=i(77),v=o.PROPER,w=o.CONFIGURABLE,_=m.IteratorPrototype,y=m.BUGGY_SAFARI_ITERATORS,b=g("iterator"),P="keys",S="values",E="entries",returnThis=function(){return this};e.exports=function(e,t,i,o,g,m,x){l(i,t,o);var C,T,I,getIterationMethod=function(e){if(e===g&&k)return k;if(!y&&e in A)return A[e];switch(e){case P:return function keys(){return new i(this,e)};case S:return function values(){return new i(this,e)};case E:return function entries(){return new i(this,e)}}return function(){return new i(this)}},M=t+" Iterator",L=!1,A=e.prototype,D=A[b]||A["@@iterator"]||g&&A[g],k=!y&&D||getIterationMethod(g),O="Array"==t&&A.entries||D;if(O&&(C=c(O.call(new e)))!==Object.prototype&&C.next){s||c(C)===_||(h?h(C,_):a(C[b])||p(C,b,returnThis));d(C,M,!0,!0);s&&(f[M]=returnThis)}if(v&&g==S&&D&&D.name!==S)if(!s&&w)u(A,"name",S);else{L=!0;k=function values(){return r(D,this)}}if(g){T={values:getIterationMethod(S),keys:m?k:getIterationMethod(P),entries:getIterationMethod(E)};if(x)for(I in T)(y||L||!(I in A))&&p(A,I,T[I]);else n({target:t,proto:!0,forced:y||L},T)}s&&!x||A[b]===k||p(A,b,k,{name:g});f[t]=k;return T}},(e,t,i)=>{var n=i(2),r=i(66).f,s=i(62),o=i(68),a=i(21),l=i(71),c=i(75);e.exports=function(e,t){var i,h,d,u,p,g=e.target,f=e.global,m=e.stat;if(i=f?n:m?n[g]||a(g,{}):(n[g]||{}).prototype)for(h in t){u=t[h];d=e.dontCallGetSet?(p=r(i,h))&&p.value:i[h];if(!c(f?h:g+(m?".":"#")+h,e.forced)&&void 0!==d){if(typeof u==typeof d)continue;l(u,d)}(e.sham||d&&d.sham)&&s(u,"sham",!0);o(i,h,u,e)}}},(e,t,i)=>{var n=i(33),r=i(39),s=i(67),o=i(63),a=i(9),l=i(37),c=i(22),h=i(36),d=Object.getOwnPropertyDescriptor;t.f=n?d:function getOwnPropertyDescriptor(e,t){e=a(e);t=l(t);if(h)try{return d(e,t)}catch(e){}if(c(e,t))return o(!r(s.f,e,t),e[t])}},(e,t)=>{"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);t.f=r?function propertyIsEnumerable(e){var t=n(this,e);return!!t&&t.enumerable}:i},(e,t,i)=>{var n=i(7),r=i(35),s=i(69),o=i(21);e.exports=function(e,t,i,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:t;n(i)&&s(i,c,a);if(a.global)l?e[t]=i:o(t,i);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=i:r.f(e,t,{value:i,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},(e,t,i)=>{var n=i(13),r=i(7),s=i(22),o=i(33),a=i(70).CONFIGURABLE,l=i(61),c=i(59),h=c.enforce,d=c.get,u=Object.defineProperty,p=o&&!n((function(){return 8!==u((function(){}),"length",{value:8}).length})),g=String(String).split("String"),f=e.exports=function(e,t,i){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]");i&&i.getter&&(t="get "+t);i&&i.setter&&(t="set "+t);(!s(e,"name")||a&&e.name!==t)&&(o?u(e,"name",{value:t,configurable:!0}):e.name=t);p&&i&&s(i,"arity")&&e.length!==i.arity&&u(e,"length",{value:i.arity});try{i&&s(i,"constructor")&&i.constructor?o&&u(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=h(e);s(n,"source")||(n.source=g.join("string"==typeof t?t:""));return e};Function.prototype.toString=f((function toString(){return r(this)&&d(this).source||l(this)}),"toString")},(e,t,i)=>{var n=i(33),r=i(22),s=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,a=r(s,"name"),l=a&&"something"===function something(){}.name,c=a&&(!n||n&&o(s,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},(e,t,i)=>{var n=i(22),r=i(72),s=i(66),o=i(35);e.exports=function(e,t,i){for(var a=r(t),l=o.f,c=s.f,h=0;h<a.length;h++){var d=a[h];n(e,d)||i&&n(i,d)||l(e,d,c(t,d))}}},(e,t,i)=>{var n=i(28),r=i(11),s=i(73),o=i(74),a=i(31),l=r([].concat);e.exports=n("Reflect","ownKeys")||function ownKeys(e){var t=s.f(a(e)),i=o.f;return i?l(t,i(e)):t}},(e,t,i)=>{var n=i(47),r=i(55).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return n(e,r)}},(e,t)=>{t.f=Object.getOwnPropertySymbols},(e,t,i)=>{var n=i(13),r=i(7),s=/#|\.prototype\./,isForced=function(e,t){var i=a[o(e)];return i==c||i!=l&&(r(t)?n(t):!!t)},o=isForced.normalize=function(e){return String(e).replace(s,".").toLowerCase()},a=isForced.data={},l=isForced.NATIVE="N",c=isForced.POLYFILL="P";e.exports=isForced},(e,t,i)=>{"use strict";var n=i(77).IteratorPrototype,r=i(30),s=i(63),o=i(80),a=i(58),returnThis=function(){return this};e.exports=function(e,t,i,l){var c=t+" Iterator";e.prototype=r(n,{next:s(+!l,i)});o(e,c,!1,!0);a[c]=returnThis;return e}},(e,t,i)=>{"use strict";var n,r,s,o=i(13),a=i(7),l=i(30),c=i(78),h=i(68),d=i(17),u=i(19),p=d("iterator"),g=!1;[].keys&&("next"in(s=[].keys())?(r=c(c(s)))!==Object.prototype&&(n=r):g=!0);null==n||o((function(){var e={};return n[p].call(e)!==e}))?n={}:u&&(n=l(n));a(n[p])||h(n,p,(function(){return this}));e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:g}},(e,t,i)=>{var n=i(22),r=i(7),s=i(23),o=i(57),a=i(79),l=o("IE_PROTO"),c=Object,h=c.prototype;e.exports=a?c.getPrototypeOf:function(e){var t=s(e);if(n(t,l))return t[l];var i=t.constructor;return r(i)&&t instanceof i?i.prototype:t instanceof c?h:null}},(e,t,i)=>{var n=i(13);e.exports=!n((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(e,t,i)=>{var n=i(35).f,r=i(22),s=i(17)("toStringTag");e.exports=function(e,t,i){e&&!i&&(e=e.prototype);e&&!r(e,s)&&n(e,s,{configurable:!0,value:t})}},(e,t,i)=>{var n=i(11),r=i(31),s=i(82);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]);t=i instanceof Array}catch(e){}return function setPrototypeOf(i,n){r(i);s(n);t?e(i,n):i.__proto__=n;return i}}():void 0)},(e,t,i)=>{var n=i(7),r=String,s=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw s("Can't set "+r(e)+" as a prototype")}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.compatibilityParams=t.OptionKind=t.AppOptions=void 0;i(84);const n=Object.create(null);t.compatibilityParams=n;{const e=navigator.userAgent||"",t=navigator.platform||"",i=navigator.maxTouchPoints||1,r=/Android/.test(e),s=/\b(iPad|iPhone|iPod)(?=;)/.test(e)||"MacIntel"===t&&i>1;!function checkCanvasSizeLimitation(){(s||r)&&(n.maxCanvasPixels=5242880)}();!function checkResizeObserver(){"undefined"==typeof ResizeObserver&&(n.annotationEditorMode=-1)}()}const r={VIEWER:2,API:4,WORKER:8,PREFERENCE:128};t.OptionKind=r;const s={annotationEditorMode:{value:-1,kind:r.VIEWER+r.PREFERENCE},annotationMode:{value:2,kind:r.VIEWER+r.PREFERENCE},cursorToolOnLoad:{value:0,kind:r.VIEWER+r.PREFERENCE},defaultZoomValue:{value:"",kind:r.VIEWER+r.PREFERENCE},disableHistory:{value:!1,kind:r.VIEWER},disablePageLabels:{value:!1,kind:r.VIEWER+r.PREFERENCE},enablePermissions:{value:!1,kind:r.VIEWER+r.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:r.VIEWER+r.PREFERENCE},enableScripting:{value:!0,kind:r.VIEWER+r.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:r.VIEWER},externalLinkTarget:{value:0,kind:r.VIEWER+r.PREFERENCE},historyUpdateUrl:{value:!1,kind:r.VIEWER+r.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:r.VIEWER+r.PREFERENCE},imageResourcesPath:{value:"./images/",kind:r.VIEWER},maxCanvasPixels:{value:16777216,kind:r.VIEWER},forcePageColors:{value:!1,kind:r.VIEWER+r.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:r.VIEWER+r.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:r.VIEWER+r.PREFERENCE},pdfBugEnabled:{value:!1,kind:r.VIEWER+r.PREFERENCE},printResolution:{value:150,kind:r.VIEWER},removePageBorders:{value:!1,kind:r.VIEWER+r.PREFERENCE},sidebarViewOnLoad:{value:-1,kind:r.VIEWER+r.PREFERENCE},scrollModeOnLoad:{value:-1,kind:r.VIEWER+r.PREFERENCE},spreadModeOnLoad:{value:-1,kind:r.VIEWER+r.PREFERENCE},textLayerMode:{value:1,kind:r.VIEWER+r.PREFERENCE},useOnlyCssZoom:{value:!1,kind:r.VIEWER+r.PREFERENCE},viewerCssTheme:{value:0,kind:r.VIEWER+r.PREFERENCE},viewOnLoad:{value:0,kind:r.VIEWER+r.PREFERENCE},cMapPacked:{value:!0,kind:r.API},cMapUrl:{value:"../web/cmaps/",kind:r.API},disableAutoFetch:{value:!1,kind:r.API+r.PREFERENCE},disableFontFace:{value:!1,kind:r.API+r.PREFERENCE},disableRange:{value:!1,kind:r.API+r.PREFERENCE},disableStream:{value:!1,kind:r.API+r.PREFERENCE},docBaseUrl:{value:"",kind:r.API},enableXfa:{value:!0,kind:r.API+r.PREFERENCE},fontExtraProperties:{value:!1,kind:r.API},isEvalSupported:{value:!0,kind:r.API},maxImageSize:{value:-1,kind:r.API},pdfBug:{value:!1,kind:r.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:r.API},verbosity:{value:1,kind:r.API},workerPort:{value:null,kind:r.WORKER},workerSrc:{value:"./assets/pdf.worker.js",kind:r.WORKER}};s.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:r.VIEWER};s.disablePreferences={value:!1,kind:r.VIEWER};s.locale={value:navigator.language||"en-US",kind:r.VIEWER};s.renderer={value:"canvas",kind:r.VIEWER+r.PREFERENCE};s.sandboxBundleSrc={value:"../build/pdf.sandbox.js",kind:r.VIEWER};const o=Object.create(null);if(globalThis.pdfDefaultOptions)for(const e in globalThis.pdfDefaultOptions)o[e]=globalThis.pdfDefaultOptions[e];t.AppOptions=class AppOptions{constructor(){throw new Error("Cannot initialize AppOptions.")}static get(e){const t=o[e];if(void 0!==t)return t;const i=s[e];if(void 0!==i){var r;return null!==(r=n[e])&&void 0!==r?r:i.value}}static getAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=Object.create(null);for(const a in s){var i;const l=s[a];if(e){if(0==(e&l.kind))continue;if(e===r.PREFERENCE){const e=l.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: ".concat(a))}}const c=o[a];t[a]=void 0!==c?c:null!==(i=n[a])&&void 0!==i?i:l.value}return t}static set(e,t){o[e]=t}static setAll(e){for(const t in e)o[t]=e[t]}static remove(e){delete o[e]}static _hasUserOptions(){return Object.keys(o).length>0}}},(e,t,i)=>{"use strict";var n=i(65),r=i(85);n({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},(e,t,i)=>{"use strict";var n=i(39),r=i(11),s=i(86),o=i(89),a=i(90),l=i(18),c=i(30),h=i(59).get,d=i(91),u=i(92),p=l("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,f=g,m=r("".charAt),v=r("".indexOf),w=r("".replace),_=r("".slice),y=function(){var e=/a/,t=/b*/g;n(g,e,"a");n(g,t,"a");return 0!==e.lastIndex||0!==t.lastIndex}(),b=a.BROKEN_CARET,P=void 0!==/()??/.exec("")[1];(y||P||b||d||u)&&(f=function exec(e){var t,i,r,a,l,d,u,S=this,E=h(S),x=s(e),C=E.raw;if(C){C.lastIndex=S.lastIndex;t=n(f,C,x);S.lastIndex=C.lastIndex;return t}var T=E.groups,I=b&&S.sticky,M=n(o,S),L=S.source,A=0,D=x;if(I){M=w(M,"y","");-1===v(M,"g")&&(M+="g");D=_(x,S.lastIndex);if(S.lastIndex>0&&(!S.multiline||S.multiline&&"\n"!==m(x,S.lastIndex-1))){L="(?: "+L+")";D=" "+D;A++}i=new RegExp("^(?:"+L+")",M)}P&&(i=new RegExp("^"+L+"$(?!\\s)",M));y&&(r=S.lastIndex);a=n(g,I?i:S,D);if(I)if(a){a.input=_(a.input,A);a[0]=_(a[0],A);a.index=S.lastIndex;S.lastIndex+=a[0].length}else S.lastIndex=0;else y&&a&&(S.lastIndex=S.global?a.index+a[0].length:r);P&&a&&a.length>1&&n(p,a[0],i,(function(){for(l=1;l<arguments.length-2;l++)void 0===arguments[l]&&(a[l]=void 0)}));if(a&&T){a.groups=d=c(null);for(l=0;l<T.length;l++)d[(u=T[l])[0]]=a[u[1]]}return a});e.exports=f},(e,t,i)=>{var n=i(87),r=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return r(e)}},(e,t,i)=>{var n=i(88),r=i(7),s=i(14),o=i(17)("toStringTag"),a=Object,l="Arguments"==s(function(){return arguments}());e.exports=n?s:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=a(e),o))?i:l?s(t):"Object"==(n=s(t))&&r(t.callee)?"Arguments":n}},(e,t,i)=>{var n={};n[i(17)("toStringTag")]="z";e.exports="[object z]"===String(n)},(e,t,i)=>{"use strict";var n=i(31);e.exports=function(){var e=n(this),t="";e.hasIndices&&(t+="d");e.global&&(t+="g");e.ignoreCase&&(t+="i");e.multiline&&(t+="m");e.dotAll&&(t+="s");e.unicode&&(t+="u");e.unicodeSets&&(t+="v");e.sticky&&(t+="y");return t}},(e,t,i)=>{var n=i(13),r=i(2).RegExp,s=n((function(){var e=r("a","y");e.lastIndex=2;return null!=e.exec("abcd")})),o=s||n((function(){return!r("a","y").sticky})),a=s||n((function(){var e=r("^r","gy");e.lastIndex=2;return null!=e.exec("str")}));e.exports={BROKEN_CARET:a,MISSED_STICKY:o,UNSUPPORTED_Y:s}},(e,t,i)=>{var n=i(13),r=i(2).RegExp;e.exports=n((function(){var e=r(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},(e,t,i)=>{var n=i(13),r=i(2).RegExp;e.exports=n((function(){var e=r("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFViewerApplication=t.PDFPrintServiceFactory=t.DefaultExternalServices=void 0;i(1);i(94);i(84);i(131);i(132);i(138);i(152);var n=i(153),r=i(155),s=i(83),o=i(156),a=i(157),l=i(159),c=i(160),h=i(161),d=i(163),u=i(164),p=i(166),g=i(167),f=i(168),m=i(177),v=i(178),w=i(179),_=i(180),y=i(181),b=i(183),P=i(184),S=i(185),E=i(186),x=i(188),C=i(250),T=i(251),I=i(252);const M=-1,L=1,A={AUTOMATIC:0,LIGHT:1,DARK:2},D=["1.0","1.1","1.2","1.3","1.4","1.5","1.6","1.7","1.8","1.9","2.0","2.1","2.2","2.3"],k=["acrobat distiller","acrobat pdfwriter","adobe livecycle","adobe pdf library","adobe photoshop","ghostscript","tcpdf","cairo","dvipdfm","dvips","pdftex","pdfkit","itext","prince","quarkxpress","mac os x","microsoft","openoffice","oracle","luradocument","pdf-xchange","antenna house","aspose.cells","fpdf"];class DefaultExternalServices{constructor(){throw new Error("Cannot initialize DefaultExternalServices.")}static updateFindControlState(e){}static updateFindMatchesCount(e){}static initPassiveLoading(e){}static reportTelemetry(e){}static createDownloadManager(e){throw new Error("Not implemented: createDownloadManager")}static createPreferences(){throw new Error("Not implemented: createPreferences")}static createL10n(e){throw new Error("Not implemented: createL10n")}static createScripting(e){throw new Error("Not implemented: createScripting")}static get supportsIntegratedFind(){return(0,r.shadow)(this,"supportsIntegratedFind",!1)}static get supportsDocumentFonts(){return(0,r.shadow)(this,"supportsDocumentFonts",!0)}static get supportedMouseWheelZoomModifierKeys(){return(0,r.shadow)(this,"supportedMouseWheelZoomModifierKeys",{ctrlKey:!0,metaKey:!0})}static get isInAutomation(){return(0,r.shadow)(this,"isInAutomation",!1)}static updateEditorStates(e){throw new Error("Not implemented: updateEditorStates")}}t.DefaultExternalServices=DefaultExternalServices;const O={initialBookmark:document.location.hash.substring(1),_initializedCapability:(0,r.createPromiseCapability)(),appConfig:null,pdfDocument:null,pdfLoadingTask:null,printService:null,pdfViewer:null,pdfThumbnailViewer:null,pdfRenderingQueue:null,pdfPresentationMode:null,pdfDocumentProperties:null,pdfLinkService:null,pdfHistory:null,pdfSidebar:null,pdfSidebarResizer:null,pdfOutlineViewer:null,pdfAttachmentViewer:null,pdfLayerViewer:null,pdfCursorTools:null,pdfScriptingManager:null,store:null,downloadManager:null,overlayManager:null,preferences:null,toolbar:null,secondaryToolbar:null,eventBus:null,l10n:null,annotationEditorParams:null,isInitialViewSet:!1,downloadComplete:!1,isViewerEmbedded:window.parent!==window,url:"",baseUrl:"",_downloadUrl:"",externalServices:DefaultExternalServices,_boundEvents:Object.create(null),documentInfo:null,metadata:null,_contentDispositionFilename:null,_contentLength:null,_saveInProgress:!1,_docStats:null,_wheelUnusedTicks:0,_idleCallbacks:new Set,_PDFBug:null,_printAnnotationStoragePromise:null,async initialize(e){this.preferences=this.externalServices.createPreferences();this.appConfig=e;await this._readPreferences();await this._parseHashParameters();this._forceCssTheme();await this._initializeL10n();this.isViewerEmbedded&&s.AppOptions.get("externalLinkTarget")===l.LinkTarget.NONE&&s.AppOptions.set("externalLinkTarget",l.LinkTarget.TOP);await this._initializeViewerComponents();this.bindEvents();this.bindWindowEvents();const t=e.appContainer||document.documentElement;this.l10n.translate(t).then((()=>{this.eventBus.dispatch("localized",{source:this})}));this._initializedCapability.resolve();this.initializeLoadingBar()},async _readPreferences(){if(!s.AppOptions.get("disablePreferences")){s.AppOptions._hasUserOptions()&&Window.ngxConsole.warn('_readPreferences: The Preferences may override manually set AppOptions; please use the "disablePreferences"-option in order to prevent that.');try{s.AppOptions.setAll(await this.preferences.getAll())}catch(e){Window.ngxConsole.error('_readPreferences: "'.concat(null==e?void 0:e.message,'".'))}}},async _parseHashParameters(){if(!s.AppOptions.get("pdfBugEnabled"))return;const e=document.location.hash.substring(1);if(!e)return;const{mainContainer:t,viewerContainer:i}=this.appConfig,o=(0,n.parseQueryString)(e);if("true"===o.get("disableworker"))try{await async function loadFakeWorker(){r.GlobalWorkerOptions.workerSrc||(r.GlobalWorkerOptions.workerSrc=s.AppOptions.get("workerSrc"));"Function"===r.GlobalWorkerOptions.workerSrc.constructor.name&&(r.GlobalWorkerOptions.workerSrc=r.GlobalWorkerOptions.workerSrc());await(0,r.loadScript)(r.PDFWorker.workerSrc)}()}catch(e){console.error('_parseHashParameters: "'.concat(e.message,'".'))}o.has("disablerange")&&s.AppOptions.set("disableRange","true"===o.get("disablerange"));o.has("disablestream")&&s.AppOptions.set("disableStream","true"===o.get("disablestream"));o.has("disableautofetch")&&s.AppOptions.set("disableAutoFetch","true"===o.get("disableautofetch"));o.has("disablefontface")&&s.AppOptions.set("disableFontFace","true"===o.get("disablefontface"));o.has("disablehistory")&&s.AppOptions.set("disableHistory","true"===o.get("disablehistory"));o.has("verbosity")&&s.AppOptions.set("verbosity",0|o.get("verbosity"));if(o.has("textlayer"))switch(o.get("textlayer")){case"off":s.AppOptions.set("textLayerMode",n.TextLayerMode.DISABLE);break;case"visible":case"shadow":case"hover":i.classList.add("textLayer-".concat(o.get("textlayer")));try{await loadPDFBug(this);this._PDFBug.loadCSS()}catch(e){console.error('_parseHashParameters: "'.concat(e.message,'".'))}}if(o.has("pdfbug")){s.AppOptions.set("pdfBug",!0);s.AppOptions.set("fontExtraProperties",!0);const e=o.get("pdfbug").split(",");try{await loadPDFBug(this);this._PDFBug.init({OPS:r.OPS},t,e)}catch(e){console.error('_parseHashParameters: "'.concat(e.message,'".'))}}o.has("locale")&&s.AppOptions.set("locale",o.get("locale"))},async _initializeL10n(){this.l10n=this.externalServices.createL10n({locale:s.AppOptions.get("locale")});const e=await this.l10n.getDirection();document.getElementsByTagName("html")[0].dir=e},_forceCssTheme(){const e=s.AppOptions.get("viewerCssTheme");if(e!==A.AUTOMATIC&&Object.values(A).includes(e))try{const i=document.styleSheets[0],n=(null==i?void 0:i.cssRules)||[];for(let r=0,s=n.length;r<s;r++){var t;const s=n[r];if(s instanceof CSSMediaRule&&"(prefers-color-scheme: dark)"===(null===(t=s.media)||void 0===t?void 0:t[0])){if(e===A.LIGHT){i.deleteRule(r);return}const t=/^@media \(prefers-color-scheme: dark\) {\n\s*([\w\s-.,:;/\\{}()]+)\n}$/.exec(s.cssText);if(null!=t&&t[1]){i.deleteRule(r);i.insertRule(t[1],r)}return}}}catch(e){Window.ngxConsole.error('_forceCssTheme: "'.concat(null==e?void 0:e.message,'".'))}},async _initializeViewerComponents(){const{appConfig:e,externalServices:t}=this,i=t.isInAutomation?new o.AutomationEventBus:new o.EventBus;this.eventBus=i;this.overlayManager=new h.OverlayManager;const n=new y.PDFRenderingQueue;n.onIdle=this._cleanup.bind(this);this.pdfRenderingQueue=n;const I=new l.PDFLinkService({eventBus:i,externalLinkTarget:s.AppOptions.get("externalLinkTarget"),externalLinkRel:s.AppOptions.get("externalLinkRel"),ignoreDestinationZoom:s.AppOptions.get("ignoreDestinationZoom")});this.pdfLinkService=I;const M=t.createDownloadManager();this.downloadManager=M;const L=new f.PDFFindController({linkService:I,eventBus:i,pageViewMode:s.AppOptions.get("pageViewMode")});this.findController=L;const A=new b.PDFScriptingManager({eventBus:i,sandboxBundleSrc:s.AppOptions.get("sandboxBundleSrc"),scriptingFactory:t,docPropertiesLookup:this._scriptingDocProperties.bind(this)});this.pdfScriptingManager=A;const D=e.mainContainer,k=e.viewerContainer,O=s.AppOptions.get("annotationEditorMode"),R=s.AppOptions.get("forcePageColors")||window.matchMedia("(forced-colors: active)").matches?{background:s.AppOptions.get("pageColorsBackground"),foreground:s.AppOptions.get("pageColorsForeground")}:null;this.pdfViewer=new x.PDFViewer({container:D,viewer:k,eventBus:i,renderingQueue:n,linkService:I,downloadManager:M,findController:L,scriptingManager:s.AppOptions.get("enableScripting")&&A,renderer:s.AppOptions.get("renderer"),l10n:this.l10n,textLayerMode:s.AppOptions.get("textLayerMode"),annotationMode:s.AppOptions.get("annotationMode"),annotationEditorMode:O,imageResourcesPath:s.AppOptions.get("imageResourcesPath"),removePageBorders:s.AppOptions.get("removePageBorders"),enablePrintAutoRotate:s.AppOptions.get("enablePrintAutoRotate"),useOnlyCssZoom:s.AppOptions.get("useOnlyCssZoom"),maxCanvasPixels:s.AppOptions.get("maxCanvasPixels"),pageViewMode:s.AppOptions.get("pageViewMode"),enablePermissions:s.AppOptions.get("enablePermissions"),pageColors:R});n.setViewer(this.pdfViewer);I.setViewer(this.pdfViewer);A.setViewer(this.pdfViewer);this.pdfThumbnailViewer=new E.PDFThumbnailViewer({container:e.sidebar.thumbnailView,eventBus:i,renderingQueue:n,linkService:I,l10n:this.l10n,pageColors:R});n.setThumbnailViewer(this.pdfThumbnailViewer);if(!this.isViewerEmbedded&&!s.AppOptions.get("disableHistory")){this.pdfHistory=new m.PDFHistory({linkService:I,eventBus:i});I.setHistory(this.pdfHistory)}this.supportsIntegratedFind||(this.findBar=new g.PDFFindBar(e.findBar,i,this.l10n));if(O!==r.AnnotationEditorType.DISABLE){this.annotationEditorParams=new c.AnnotationEditorParams(e.annotationEditorParams,i);for(const e of[document.getElementById("editorModeButtons"),document.getElementById("editorModeSeparator")])e.classList.remove("hidden")}this.pdfDocumentProperties=new p.PDFDocumentProperties(e.documentProperties,this.overlayManager,i,this.l10n,(()=>this._docFilename));this.pdfCursorTools=new a.PDFCursorTools({container:D,eventBus:i,cursorToolOnLoad:s.AppOptions.get("cursorToolOnLoad")});this.toolbar=new T.Toolbar(e.toolbar,i,this.l10n);this.secondaryToolbar=new C.SecondaryToolbar(e.secondaryToolbar,i);this.supportsFullscreen&&(this.pdfPresentationMode=new _.PDFPresentationMode({container:D,pdfViewer:this.pdfViewer,eventBus:i}));let B=s.AppOptions.get("passwordPrompt");B||(B=new d.PasswordPrompt(e.passwordOverlay,this.overlayManager,this.l10n,this.isViewerEmbedded));this.passwordPrompt=B;this.pdfOutlineViewer=new w.PDFOutlineViewer({container:e.sidebar.outlineView,eventBus:i,linkService:I});this.pdfAttachmentViewer=new u.PDFAttachmentViewer({container:e.sidebar.attachmentsView,eventBus:i,downloadManager:M});this.pdfLayerViewer=new v.PDFLayerViewer({container:e.sidebar.layersView,eventBus:i,l10n:this.l10n});this.pdfSidebar=new P.PDFSidebar({elements:e.sidebar,pdfViewer:this.pdfViewer,pdfThumbnailViewer:this.pdfThumbnailViewer,eventBus:i,l10n:this.l10n});this.pdfSidebar.onToggled=this.forceRendering.bind(this);this.pdfSidebarResizer=new S.PDFSidebarResizer(e.sidebarResizer,i,this.l10n)},run(e){this.initialize(e).then(webViewerInitialized)},get initialized(){return this._initializedCapability.settled},get initializedPromise(){return this._initializedCapability.promise},zoomIn(e){this.pdfViewer.isInPresentationMode||this.pdfViewer.increaseScale(e)},zoomOut(e){this.pdfViewer.isInPresentationMode||this.pdfViewer.decreaseScale(e)},zoomReset(){this.pdfViewer.isInPresentationMode||(this.pdfViewer.currentScaleValue=n.DEFAULT_SCALE_VALUE)},get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0},get page(){return this.pdfViewer.currentPageNumber},set page(e){this.pdfViewer.currentPageNumber=e},get supportsPrinting(){return N.instance.supportsPrinting},get supportsFullscreen(){return(0,r.shadow)(this,"supportsFullscreen",document.fullscreenEnabled)},get supportsIntegratedFind(){return this.externalServices.supportsIntegratedFind},get supportsDocumentFonts(){return this.externalServices.supportsDocumentFonts},initializeLoadingBar(){const e=new n.ProgressBar("loadingBar");e.hide();return(0,r.shadow)(this,"loadingBar",e)},get supportedMouseWheelZoomModifierKeys(){return this.externalServices.supportedMouseWheelZoomModifierKeys},initPassiveLoading(){throw new Error("Not implemented: initPassiveLoading")},setTitleUsingUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.url=e;this.baseUrl=e.split("#")[0];t&&(this._downloadUrl=t===e?this.baseUrl:t.split("#")[0]);let i=(0,r.getPdfFilenameFromUrl)(e,"");if(!i)try{i=decodeURIComponent((0,r.getFilenameFromUrl)(e))||e}catch(t){i=e}this.setTitle(i)},setTitle(e){this.isViewerEmbedded||(document.title=e)},get _docFilename(){return this._contentDispositionFilename||(0,r.getPdfFilenameFromUrl)(this.url)},_hideViewBookmark(){const{toolbar:e,secondaryToolbar:t}=this.appConfig;e.viewBookmark.hidden=!0;t.viewBookmarkButton.hidden=!0},_cancelIdleCallbacks(){if(this._idleCallbacks.size){for(const e of this._idleCallbacks)window.cancelIdleCallback(e);this._idleCallbacks.clear()}},async close(){var e,t,i,n;this._unblockDocumentLoadEvent();this._hideViewBookmark();const{container:r}=this.appConfig.errorWrapper;r.hidden=!0;if(!this.pdfLoadingTask)return;if((null===(e=this.pdfDocument)||void 0===e?void 0:e.annotationStorage.size)>0&&this._annotationStorageModified)try{await this.save()}catch(e){}const s=[];s.push(this.pdfLoadingTask.destroy());this.pdfLoadingTask=null;if(this.pdfDocument){this.pdfDocument=null;this.pdfThumbnailViewer.setDocument(null);this.pdfViewer.setDocument(null);this.pdfLinkService.setDocument(null);this.pdfDocumentProperties.setDocument(null)}this.pdfLinkService.externalLinkEnabled=!0;this.store=null;this.isInitialViewSet=!1;this.downloadComplete=!1;this.url="";this.baseUrl="";this._downloadUrl="";this.documentInfo=null;this.metadata=null;this._contentDispositionFilename=null;this._contentLength=null;this._saveInProgress=!1;this._docStats=null;this._cancelIdleCallbacks();s.push(this.pdfScriptingManager.destroyPromise);this.pdfSidebar.reset();this.pdfOutlineViewer.reset();this.pdfAttachmentViewer.reset();this.pdfLayerViewer.reset();null===(t=this.pdfHistory)||void 0===t||t.reset();null===(i=this.findBar)||void 0===i||i.reset();this.toolbar.reset();this.secondaryToolbar.reset();null===(n=this._PDFBug)||void 0===n||n.cleanup();await Promise.all(s)},async open(e,t){window.adjacentPagesLoader=void 0;window.ngxZone.runOutsideAngular((async()=>{this.pdfLoadingTask&&await this.close();const i=s.AppOptions.getAll(s.OptionKind.WORKER);for(const e in i)r.GlobalWorkerOptions[e]=i[e];const n=Object.create(null);if("string"==typeof e){this.setTitleUsingUrl(e,e);n.url=e}else if(e&&"byteLength"in e)n.data=e;else if(e.url&&e.originalUrl){this.setTitleUsingUrl(e.originalUrl,e.url);n.url=e.url}const o=s.AppOptions.getAll(s.OptionKind.API);for(const e in o){let t=o[e];n[e]=t}if(t)for(const e in t)n[e]=t[e];const a=(0,r.getDocument)(n);this.pdfLoadingTask=a;a.onPassword=(e,t)=>{this.pdfLinkService.externalLinkEnabled=!1;this.passwordPrompt.setUpdateCallback(e,t);this.passwordPrompt.open()};a.onProgress=e=>{let{loaded:t,total:i}=e;this.progress(t/i);this.eventBus.dispatch("progress",{source:this,type:"load",total:i,loaded:t,percent:100*t/i})};a.onUnsupportedFeature=this.fallback.bind(this);this.loadingBar.show();return a.promise.then((e=>{this.load(e)}),(e=>{if(a!==this.pdfLoadingTask)return;let t="loading_error";e instanceof r.InvalidPDFException?t="invalid_file_error":e instanceof r.MissingPDFException?t="missing_file_error":e instanceof r.UnexpectedResponseException&&(t="unexpected_response_error");O.onError&&O.onError(e);return this.l10n.get(t).then((t=>{this._documentError(t,{message:null==e?void 0:e.message});throw e}))}))}))},_ensureDownloadComplete(){if(!this.pdfDocument||!this.downloadComplete)throw new Error("PDF document not downloaded.")},async download(){const e=this._downloadUrl,t=this._docFilename;try{this._ensureDownloadComplete();const i=await this.pdfDocument.getData(),n=new Blob([i],{type:"application/pdf"});await this.downloadManager.download(n,e,t)}catch(i){await this.downloadManager.downloadUrl(e,t)}},async save(){if(this._saveInProgress)return;this._saveInProgress=!0;await this.pdfScriptingManager.dispatchWillSave();const e=this._downloadUrl,t=this._docFilename;try{this._ensureDownloadComplete();const i=await this.pdfDocument.saveDocument(),n=new Blob([i],{type:"application/pdf"});await this.downloadManager.download(n,e,t)}catch(e){Window.ngxConsole.error("Error when saving the document: ".concat(e.message));await this.download()}finally{await this.pdfScriptingManager.dispatchDidSave();this._saveInProgress=!1}},downloadOrSave(){var e;(null===(e=this.pdfDocument)||void 0===e?void 0:e.annotationStorage.size)>0?this.save():this.download()},fallback(e){this.externalServices.reportTelemetry({type:"unsupportedFeature",featureId:e})},_documentError(e){var t;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._unblockDocumentLoadEvent();this._otherError(e,i);this.eventBus.dispatch("documenterror",{source:this,message:e,reason:null!==(t=null==i?void 0:i.message)&&void 0!==t?t:null})},_otherError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[this.l10n.get("error_version_info",{version:r.version||"?",build:r.build||"?"})];if(t){i.push(this.l10n.get("error_message",{message:t.message}));if(t.stack)i.push(this.l10n.get("error_stack",{stack:t.stack}));else{t.filename&&i.push(this.l10n.get("error_file",{file:t.filename}));t.lineNumber&&i.push(this.l10n.get("error_line",{line:t.lineNumber}))}}const s=this.appConfig.errorWrapper,o=s.container;o.hidden=!1;s.errorMessage.textContent=e;const a=s.closeButton;a.onclick=function(){o.hidden=!0};const l=s.errorMoreInfo,c=s.moreInfoButton,h=s.lessInfoButton;c.onclick=function(){l.hidden=!1;c.hidden=!0;h.hidden=!1;l.style.height=l.scrollHeight+"px"};h.onclick=function(){l.hidden=!0;c.hidden=!1;h.hidden=!0};c.oncontextmenu=n.noContextMenuHandler;h.oncontextmenu=n.noContextMenuHandler;a.oncontextmenu=n.noContextMenuHandler;c.hidden=!1;h.hidden=!0;Promise.all(i).then((e=>{l.value=e.join("\n")}))},progress(e){var t,i;if(this.downloadComplete)return;const n=Math.round(100*e);if(n<=this.loadingBar.percent)return;this.loadingBar.percent=n;if((null!==(t=null===(i=this.pdfDocument)||void 0===i?void 0:i.loadingParams.disableAutoFetch)&&void 0!==t?t:s.AppOptions.get("disableAutoFetch"))&&!isNaN(n)){if(this.disableAutoFetchLoadingBarTimeout){clearTimeout(this.disableAutoFetchLoadingBarTimeout);this.disableAutoFetchLoadingBarTimeout=null}this.loadingBar.show();this.disableAutoFetchLoadingBarTimeout=setTimeout((()=>{this.loadingBar.hide();this.disableAutoFetchLoadingBarTimeout=null}),5e3)}},load(e){this.pdfDocument=e;e.getDownloadInfo().then((e=>{let{length:t}=e;this._contentLength=t;this.downloadComplete=!0;this.loadingBar.hide();l.then((()=>{this.eventBus.dispatch("documentloaded",{source:this})}))}));const t=e.getPageLayout().catch((function(){})),i=e.getPageMode().catch((function(){})),r=e.getOpenAction().catch((function(){}));this.toolbar.setPagesCount(e.numPages,!1);this.secondaryToolbar.setPagesCount(e.numPages);let o;o=null;this.pdfLinkService.setDocument(e,null);this.pdfDocumentProperties.setDocument(e);const a=this.pdfViewer;a.setDocument(e);const{firstPagePromise:l,onePageRendered:c,pagesPromise:h}=a;this.pdfThumbnailViewer.setDocument(e);const d=(this.store=new I.ViewHistory(e.fingerprints[0])).getMultiple({page:null,zoom:n.DEFAULT_SCALE_VALUE,scrollLeft:"0",scrollTop:"0",rotation:null,sidebarView:n.SidebarView.UNKNOWN,scrollMode:n.ScrollMode.UNKNOWN,spreadMode:n.SpreadMode.UNKNOWN}).catch((()=>Object.create(null)));l.then((o=>{this.loadingBar.setWidth(this.appConfig.viewerContainer);this._initializeAnnotationStorageCallbacks(e);Promise.all([n.animationStarted,d,t,i,r]).then((async t=>{let[i,r,o,l,c]=t;const d=s.AppOptions.get("viewOnLoad");this._initializePdfHistory({fingerprint:e.fingerprints[0],viewOnLoad:d,initialDest:null==c?void 0:c.dest});const u=this.initialBookmark,p=s.AppOptions.get("defaultZoomValue");let g=p?"zoom=".concat(p):null,f=null,m=s.AppOptions.get("sidebarViewOnLoad"),v=s.AppOptions.get("scrollModeOnLoad"),w=s.AppOptions.get("spreadModeOnLoad");if(r.page&&d!==L){g="page=".concat(r.page,"&zoom=").concat(p||r.zoom,",")+"".concat(r.scrollLeft,",").concat(r.scrollTop);f=parseInt(r.rotation,10);m===n.SidebarView.UNKNOWN&&(m=0|r.sidebarView);v===n.ScrollMode.UNKNOWN&&(v=0|r.scrollMode);w===n.SpreadMode.UNKNOWN&&(w=0|r.spreadMode)}l&&m===n.SidebarView.UNKNOWN&&(m=(0,n.apiPageModeToSidebarView)(l));if(o&&v===n.ScrollMode.UNKNOWN&&w===n.SpreadMode.UNKNOWN){w=(0,n.apiPageLayoutToViewerModes)(o).spreadMode}this.setInitialView(g,{rotation:f,sidebarView:m,scrollMode:v,spreadMode:w});this.eventBus.dispatch("documentinit",{source:this});this.isViewerEmbedded||a.focus();await Promise.race([h,new Promise((e=>{setTimeout(e,10)}))]);if((u||g)&&!a.hasEqualPageSizes){this.initialBookmark=u;a.currentScaleValue=a.currentScaleValue;this.setInitialView(g)}})).catch((()=>{this.setInitialView()})).then((function(){a.update()}))}));h.then((()=>{this._unblockDocumentLoadEvent();this._initializeAutoPrint(e,r)}),(e=>{O.onError&&O.onError(e);this.l10n.get("loading_error").then((t=>{this._documentError(t,{message:null==e?void 0:e.message})}))}));c.then((t=>{this.externalServices.reportTelemetry({type:"pageInfo",timestamp:t.timestamp});e.getOutline().then((t=>{e===this.pdfDocument&&this.pdfOutlineViewer.render({outline:t,pdfDocument:e})}));e.getAttachments().then((t=>{e===this.pdfDocument&&this.pdfAttachmentViewer.render({attachments:t})}));a.optionalContentConfigPromise.then((t=>{e===this.pdfDocument&&this.pdfLayerViewer.render({optionalContentConfig:t,pdfDocument:e})}));if("requestIdleCallback"in window){const t=window.requestIdleCallback((()=>{this._collectTelemetry(e);this._idleCallbacks.delete(t)}),{timeout:1e3});this._idleCallbacks.add(t)}}));this._initializePageLabels(e);this._initializeMetadata(e)},async _scriptingDocProperties(e){var t,i;if(!this.documentInfo){await new Promise((e=>{this.eventBus._on("metadataloaded",e,{once:!0})}));if(e!==this.pdfDocument)return null}if(!this._contentLength){await new Promise((e=>{this.eventBus._on("documentloaded",e,{once:!0})}));if(e!==this.pdfDocument)return null}return{...this.documentInfo,baseURL:this.baseUrl,filesize:this._contentLength,filename:this._docFilename,metadata:null===(t=this.metadata)||void 0===t?void 0:t.getRaw(),authors:null===(i=this.metadata)||void 0===i?void 0:i.get("dc:creator"),numPages:this.pagesCount,URL:this.url}},async _collectTelemetry(e){const t=await this.pdfDocument.getMarkInfo();if(e!==this.pdfDocument)return;const i=(null==t?void 0:t.Marked)||!1;this.externalServices.reportTelemetry({type:"tagged",tagged:i})},async _initializeAutoPrint(e,t){const[i,s]=await Promise.all([t,this.pdfViewer.enableScripting?null:e.getJavaScript()]);if(e!==this.pdfDocument)return;let o=!1;"Print"===(null==i?void 0:i.action)&&(o=!0);if(s){s.some((e=>{if(!e)return!1;Window.ngxConsole.warn("Warning: JavaScript support is not enabled");this.fallback(r.UNSUPPORTED_FEATURES.javaScript);return!0}));if(!o)for(const e of s)if(e&&n.AutoPrintRegExp.test(e)){o=!0;break}}o&&this.triggerPrinting()},async _initializeMetadata(e){var t,i;const{info:n,metadata:s,contentDispositionFilename:o,contentLength:a}=await e.getMetadata();if(e!==this.pdfDocument)return;this.documentInfo=n;this.metadata=s;null!==(t=this._contentDispositionFilename)&&void 0!==t||(this._contentDispositionFilename=o);null!==(i=this._contentLength)&&void 0!==i||(this._contentLength=a);const l=window.PDFViewerApplicationOptions;if(!l||l.get("verbosity")>0){Window.ngxConsole.log("PDF viewer: ngx-extended-pdf-viewer running on pdf.js "+(window["pdfjs-dist/build/pdf"]?window["pdfjs-dist/build/pdf"].version:" developer version (?)"));Window.ngxConsole.log("PDF ".concat(e.fingerprints[0]," [").concat(n.PDFFormatVersion," ")+"".concat((n.Producer||"-").trim()," / ").concat((n.Creator||"-").trim(),"] ")+"(PDF.js: ".concat(r.version||"-")+"".concat(this.pdfViewer.enableWebGL?" [WebGL]":"",") modified by ngx-extended-pdf-viewer)"))}let c=null==n?void 0:n.Title;const h=null==s?void 0:s.get("dc:title");h&&("Untitled"===h||/[\uFFF0-\uFFFF]/g.test(h)||(c=h));c?this.setTitle("".concat(c," - ").concat(this._contentDispositionFilename||document.title)):this._contentDispositionFilename&&this.setTitle(this._contentDispositionFilename);if(!n.IsXFAPresent||n.IsAcroFormPresent||e.isPureXfa){if((n.IsAcroFormPresent||n.IsXFAPresent)&&!this.pdfViewer.renderForms){Window.ngxConsole.warn("Warning: Interactive form support is not enabled");this.fallback(r.UNSUPPORTED_FEATURES.forms)}}else{e.loadingParams.enableXfa?Window.ngxConsole.warn("Warning: XFA Foreground documents are not supported"):Window.ngxConsole.warn("Warning: XFA support is not enabled");this.fallback(r.UNSUPPORTED_FEATURES.forms)}if(n.IsSignaturesPresent){Window.ngxConsole.warn("Warning: Digital signatures validation is not supported");this.fallback(r.UNSUPPORTED_FEATURES.signatures)}let d="other";D.includes(n.PDFFormatVersion)&&(d="v".concat(n.PDFFormatVersion.replace(".","_")));let u="other";if(n.Producer){const e=n.Producer.toLowerCase();k.some((function(t){if(!e.includes(t))return!1;u=t.replace(/[ .-]/g,"_");return!0}))}let p=null;n.IsXFAPresent?p="xfa":n.IsAcroFormPresent&&(p="acroform");this.externalServices.reportTelemetry({type:"documentInfo",version:d,generator:u,formType:p});this.eventBus.dispatch("metadataloaded",{source:this})},async _initializePageLabels(e){const t=await e.getPageLabels();if(e!==this.pdfDocument)return;if(!t||s.AppOptions.get("disablePageLabels"))return;const i=t.length;let n=0,r=0;for(let e=0;e<i;e++){const i=t[e];if(i===(e+1).toString())n++;else{if(""!==i)break;r++}}if(n>=i||r>=i)return;const{pdfViewer:o,pdfThumbnailViewer:a,toolbar:l}=this;o.setPageLabels(t);a.setPageLabels(t);l.setPagesCount(i,!0);l.setPageNumber(o.currentPageNumber,o.currentPageLabel)},_initializePdfHistory(e){let{fingerprint:t,viewOnLoad:i,initialDest:n=null}=e;if(this.pdfHistory){this.pdfHistory.initialize({fingerprint:t,resetHistory:i===L,updateUrl:s.AppOptions.get("historyUpdateUrl")});if(this.pdfHistory.initialBookmark){this.initialBookmark=this.pdfHistory.initialBookmark;this.initialRotation=this.pdfHistory.initialRotation}if(n&&!this.initialBookmark&&i===M){this.initialBookmark=JSON.stringify(n);this.pdfHistory.push({explicitDest:n,pageNumber:null})}}},_initializeAnnotationStorageCallbacks(e){if(e!==this.pdfDocument)return;const{annotationStorage:t}=e;t.onSetModified=()=>{window.addEventListener("beforeunload",beforeUnload);this._annotationStorageModified=!0};t.onResetModified=()=>{window.removeEventListener("beforeunload",beforeUnload);delete this._annotationStorageModified}},setInitialView(e){let{rotation:t,sidebarView:i,scrollMode:r,spreadMode:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const setRotation=e=>{(0,n.isValidRotation)(e)&&(this.pdfViewer.pagesRotation=e)};this.isInitialViewSet=!0;this.pdfSidebar.setInitialView(i);((e,t)=>{(0,n.isValidScrollMode)(e)&&(this.pdfViewer.scrollMode=e);(0,n.isValidSpreadMode)(t)&&(this.pdfViewer.spreadMode=t)})(r,s);if(this.initialBookmark){setRotation(this.initialRotation);delete this.initialRotation;this.pdfLinkService.setHash(this.initialBookmark);this.initialBookmark=null}else if(e){setRotation(t);this.pdfLinkService.setHash(e)}this.toolbar.setPageNumber(this.pdfViewer.currentPageNumber,this.pdfViewer.currentPageLabel);this.secondaryToolbar.setPageNumber(this.pdfViewer.currentPageNumber);if(!this.pdfViewer.currentScaleValue){const e=PDFViewerApplicationOptions.get("defaultZoomValue");e&&(this.pdfViewer.currentScaleValue=e)}},_cleanup(){if(this.pdfDocument){this.pdfViewer.cleanup();this.pdfThumbnailViewer.cleanup();this.pdfDocument.cleanup(this.pdfViewer.renderer===n.RendererType.SVG)}},forceRendering(){this.pdfRenderingQueue.printing=!!this.printService;this.pdfRenderingQueue.isThumbnailViewEnabled=this.pdfSidebar.visibleView===n.SidebarView.THUMBS;this.pdfRenderingQueue.renderHighestPriority()},beforePrint(){this._printAnnotationStoragePromise=this.pdfScriptingManager.dispatchWillPrint().catch((()=>{})).then((()=>{var e;return null===(e=this.pdfDocument)||void 0===e?void 0:e.annotationStorage.print}));if(this.printService)return;if(!this.supportsPrinting){this.l10n.get("printing_not_supported").then((e=>{this._otherError(e)}));return}if(!this.pdfViewer.pageViewsReady){this.l10n.get("printing_not_ready").then((e=>{window.alert(e)}));return}const e=this.pdfViewer.getPagesOverview(),t=this.appConfig.printContainer,i=s.AppOptions.get("printResolution"),n=this.pdfViewer.optionalContentConfigPromise,r=N.instance.createPrintService(this.pdfDocument,e,t,i,n,this._printAnnotationStoragePromise,this.l10n,this.pdfViewer.eventBus);this.printService=r;this.forceRendering();r.layout();this.externalServices.reportTelemetry({type:"print"})},afterPrint(){if(this._printAnnotationStoragePromise){this._printAnnotationStoragePromise.then((()=>{this.pdfScriptingManager.dispatchDidPrint()}));this._printAnnotationStoragePromise=null}if(this.printService){var e;this.printService.destroy();this.printService=null;null===(e=this.pdfDocument)||void 0===e||e.annotationStorage.resetModified()}this.forceRendering()},rotatePages(e){this.pdfViewer.pagesRotation+=e},requestPresentationMode(){var e;null===(e=this.pdfPresentationMode)||void 0===e||e.request()},triggerPrinting(){this.supportsPrinting&&window.printPDF()},bindEvents(){const{eventBus:e,_boundEvents:t}=this;t.beforePrint=this.beforePrint.bind(this);t.afterPrint=this.afterPrint.bind(this);e._on("resize",webViewerResize);e._on("hashchange",webViewerHashchange);e._on("beforeprint",t.beforePrint);e._on("afterprint",t.afterPrint);e._on("pagerendered",webViewerPageRendered);e._on("updateviewarea",webViewerUpdateViewarea);e._on("pagechanging",webViewerPageChanging);e._on("scalechanging",webViewerScaleChanging);e._on("rotationchanging",webViewerRotationChanging);e._on("sidebarviewchanged",webViewerSidebarViewChanged);e._on("pagemode",webViewerPageMode);e._on("namedaction",webViewerNamedAction);e._on("presentationmodechanged",webViewerPresentationModeChanged);e._on("presentationmode",webViewerPresentationMode);e._on("switchannotationeditormode",webViewerSwitchAnnotationEditorMode);e._on("switchannotationeditorparams",webViewerSwitchAnnotationEditorParams);e._on("print",webViewerPrint);e._on("download",webViewerDownload);e._on("firstpage",webViewerFirstPage);e._on("lastpage",webViewerLastPage);e._on("nextpage",webViewerNextPage);e._on("previouspage",webViewerPreviousPage);e._on("zoomin",webViewerZoomIn);e._on("zoomout",webViewerZoomOut);e._on("zoomreset",webViewerZoomReset);e._on("pagenumberchanged",webViewerPageNumberChanged);e._on("scalechanged",webViewerScaleChanged);e._on("rotatecw",webViewerRotateCw);e._on("rotateccw",webViewerRotateCcw);e._on("optionalcontentconfig",webViewerOptionalContentConfig);e._on("switchscrollmode",webViewerSwitchScrollMode);e._on("scrollmodechanged",webViewerScrollModeChanged);e._on("switchspreadmode",webViewerSwitchSpreadMode);e._on("spreadmodechanged",webViewerSpreadModeChanged);e._on("documentproperties",webViewerDocumentProperties);e._on("findfromurlhash",webViewerFindFromUrlHash);e._on("updatefindmatchescount",webViewerUpdateFindMatchesCount);e._on("updatefindcontrolstate",webViewerUpdateFindControlState);if(s.AppOptions.get("pdfBug")){t.reportPageStatsPDFBug=reportPageStatsPDFBug;e._on("pagerendered",t.reportPageStatsPDFBug);e._on("pagechanging",t.reportPageStatsPDFBug)}e._on("fileinputchange",webViewerFileInputChange);e._on("openfile",webViewerOpenFile)},bindWindowEvents(){const{eventBus:e,_boundEvents:t}=this;t.windowResize=()=>{e.dispatch("resize",{source:window})};t.windowHashChange=()=>{e.dispatch("hashchange",{source:window,hash:document.location.hash.substring(1)})};t.windowBeforePrint=()=>{e.dispatch("beforeprint",{source:window})};t.windowAfterPrint=()=>{e.dispatch("afterprint",{source:window})};t.windowUpdateFromSandbox=t=>{e.dispatch("updatefromsandbox",{source:window,detail:t.detail})};window.addEventListener("visibilitychange",webViewerVisibilityChange);window.addEventListener("wheel",webViewerWheel,{passive:!1});window.addEventListener("click",webViewerClick);window.addEventListener("keydown",webViewerKeyDown);window.addEventListener("resize",t.windowResize);window.addEventListener("hashchange",t.windowHashChange);window.addEventListener("beforeprint",t.windowBeforePrint);window.addEventListener("afterprint",t.windowAfterPrint);window.addEventListener("updatefromsandbox",t.windowUpdateFromSandbox)},unbindEvents(){const{eventBus:e,_boundEvents:t}=this;e._off("resize",webViewerResize);e._off("hashchange",webViewerHashchange);e._off("beforeprint",t.beforePrint);e._off("afterprint",t.afterPrint);e._off("pagerendered",webViewerPageRendered);e._off("updateviewarea",webViewerUpdateViewarea);e._off("pagechanging",webViewerPageChanging);e._off("scalechanging",webViewerScaleChanging);e._off("rotationchanging",webViewerRotationChanging);e._off("sidebarviewchanged",webViewerSidebarViewChanged);e._off("pagemode",webViewerPageMode);e._off("namedaction",webViewerNamedAction);e._off("presentationmodechanged",webViewerPresentationModeChanged);e._off("presentationmode",webViewerPresentationMode);e._off("print",webViewerPrint);e._off("download",webViewerDownload);e._off("firstpage",webViewerFirstPage);e._off("lastpage",webViewerLastPage);e._off("nextpage",webViewerNextPage);e._off("previouspage",webViewerPreviousPage);e._off("zoomin",webViewerZoomIn);e._off("zoomout",webViewerZoomOut);e._off("zoomreset",webViewerZoomReset);e._off("pagenumberchanged",webViewerPageNumberChanged);e._off("scalechanged",webViewerScaleChanged);e._off("rotatecw",webViewerRotateCw);e._off("rotateccw",webViewerRotateCcw);e._off("optionalcontentconfig",webViewerOptionalContentConfig);e._off("switchscrollmode",webViewerSwitchScrollMode);e._off("scrollmodechanged",webViewerScrollModeChanged);e._off("switchspreadmode",webViewerSwitchSpreadMode);e._off("spreadmodechanged",webViewerSpreadModeChanged);e._off("documentproperties",webViewerDocumentProperties);e._off("findfromurlhash",webViewerFindFromUrlHash);e._off("updatefindmatchescount",webViewerUpdateFindMatchesCount);e._off("updatefindcontrolstate",webViewerUpdateFindControlState);if(t.reportPageStatsPDFBug){e._off("pagerendered",t.reportPageStatsPDFBug);e._off("pagechanging",t.reportPageStatsPDFBug);t.reportPageStatsPDFBug=null}e._off("fileinputchange",webViewerFileInputChange);e._off("openfile",webViewerOpenFile);t.beforePrint=null;t.afterPrint=null},unbindWindowEvents(){const{_boundEvents:e}=this;window.removeEventListener("visibilitychange",webViewerVisibilityChange);window.removeEventListener("wheel",webViewerWheel,{passive:!1});window.removeEventListener("click",webViewerClick);window.removeEventListener("keydown",webViewerKeyDown);window.removeEventListener("resize",e.windowResize);window.removeEventListener("hashchange",e.windowHashChange);window.removeEventListener("beforeprint",e.windowBeforePrint);window.removeEventListener("afterprint",e.windowAfterPrint);window.removeEventListener("updatefromsandbox",e.windowUpdateFromSandbox);e.windowResize=null;e.windowHashChange=null;e.windowBeforePrint=null;e.windowAfterPrint=null;e.windowUpdateFromSandbox=null},accumulateWheelTicks(e){(this._wheelUnusedTicks>0&&e<0||this._wheelUnusedTicks<0&&e>0)&&(this._wheelUnusedTicks=0);this._wheelUnusedTicks+=e;const t=Math.sign(this._wheelUnusedTicks)*Math.floor(Math.abs(this._wheelUnusedTicks));this._wheelUnusedTicks-=t;return t},_unblockDocumentLoadEvent(){var e,t;null===(e=(t=document).blockUnblockOnload)||void 0===e||e.call(t,!1);this._unblockDocumentLoadEvent=()=>{}},_reportDocumentStatsTelemetry(){const{stats:e}=this.pdfDocument;if(e!==this._docStats){this._docStats=e;this.externalServices.reportTelemetry({type:"documentStats",stats:e})}},get scriptingReady(){return this.pdfScriptingManager.ready}};t.PDFViewerApplication=O;let R;{const e=["null","http://mozilla.github.io","https://mozilla.github.io"];R=function(t){if(t)try{const i=new URL(window.location.href).origin||"null";if(e.includes(i))return;if(new URL(t,window.location.href).origin!==i)throw new Error("file origin does not match viewer's")}catch(e){O.onError&&O.onError(e);O.l10n.get("loading_error").then((t=>{O._documentError(t,{message:null==e?void 0:e.message})}));throw e}}}async function loadPDFBug(e){const{debuggerScriptPath:t}=e.appConfig,{PDFBug:i}=await import(t);e._PDFBug=i}function reportPageStatsPDFBug(e){var t,i;let{pageNumber:n}=e;if(null===(t=globalThis.Stats)||void 0===t||!t.enabled)return;const r=O.pdfViewer.getPageView(n-1);globalThis.Stats.add(n,null==r||null===(i=r.pdfPage)||void 0===i?void 0:i.stats)}function webViewerInitialized(){var e;const{appConfig:t,eventBus:i}=O;let r;const o=document.location.search.substring(1);r=null!==(e=(0,n.parseQueryString)(o).get("file"))&&void 0!==e?e:s.AppOptions.get("defaultUrl");R(r);const a=t.openFileInput;a.value=null;a.addEventListener("change",(function(e){const{files:t}=e.target;t&&0!==t.length&&i.dispatch("fileinputchange",{source:this,fileInput:e.target})}));t.mainContainer.addEventListener("dragover",(function(e){if(s.AppOptions.get("enableDragAndDrop")){e.preventDefault();e.dataTransfer.dropEffect="copy"===e.dataTransfer.effectAllowed?"copy":"move"}}));t.mainContainer.addEventListener("drop",(function(e){if(s.AppOptions.get("enableDragAndDrop")){e.preventDefault();const{files:t}=e.dataTransfer;if(!t||0===t.length)return;O.eventBus.dispatch("fileinputchange",{source:this,fileInput:e.dataTransfer,dropEvent:e})}}));if(!O.supportsDocumentFonts){s.AppOptions.set("disableFontFace",!0);O.l10n.get("web_fonts_disabled").then((e=>{Window.ngxConsole.warn(e)}))}if(!O.supportsPrinting){t.toolbar.print.classList.add("hidden");t.secondaryToolbar.printButton.classList.add("hidden")}if(!O.supportsFullscreen){t.toolbar.presentationModeButton.classList.add("hidden");t.secondaryToolbar.presentationModeButton.classList.add("hidden")}O.supportsIntegratedFind&&t.toolbar.viewFind.classList.add("hidden");t.mainContainer.addEventListener("transitionend",(function(e){e.target===this&&i.dispatch("resize",{source:this})}),!0);try{r?O.open(r):O._hideViewBookmark()}catch(e){O.onError&&O.onError(e);O.l10n.get("loading_error").then((t=>{O._documentError(t,e)}))}}function webViewerPageRendered(e){let{pageNumber:t,error:i}=e;t===O.page&&O.toolbar.updateLoadingIndicatorState(!1);if(O.pdfSidebar.visibleView===n.SidebarView.THUMBS){const e=O.pdfViewer.getPageView(t-1),i=O.pdfThumbnailViewer.getThumbnail(t-1);e&&i&&i.setImage(e)}i&&O.l10n.get("rendering_error").then((e=>{O._otherError(e,i)}));O._reportDocumentStatsTelemetry()}function webViewerPageMode(e){let t,{mode:i}=e;switch(i){case"thumbs":t=n.SidebarView.THUMBS;break;case"bookmarks":case"outline":t=n.SidebarView.OUTLINE;break;case"attachments":t=n.SidebarView.ATTACHMENTS;break;case"layers":t=n.SidebarView.LAYERS;break;case"none":t=n.SidebarView.NONE;break;default:Window.ngxConsole.error('Invalid "pagemode" hash parameter: '+i);return}O.pdfSidebar.switchView(t,!0)}function webViewerNamedAction(e){switch(e.action){case"GoToPage":O.appConfig.toolbar.pageNumber.select();break;case"Find":O.supportsIntegratedFind||O.findBar.toggle();break;case"Print":O.triggerPrinting();break;case"SaveAs":O.downloadOrSave()}}function webViewerPresentationModeChanged(e){O.pdfViewer.presentationModeState=e.state}function webViewerSidebarViewChanged(e){let{view:t}=e;O.pdfRenderingQueue.isThumbnailViewEnabled=t===n.SidebarView.THUMBS;if(O.isInitialViewSet){var i;null===(i=O.store)||void 0===i||i.set("sidebarView",t).catch((()=>{}))}}function webViewerUpdateViewarea(e){let{location:t}=e;if(O.isInitialViewSet){var i;const e={};void 0===t.pageNumber&&null===t.pageNumber||(e.page=t.pageNumber);t.scale&&(e.zoom=t.scale);t.left&&(e.scrollLeft=t.left);t.top&&(e.scrollTop=t.top);void 0===t.rotation&&null===t.rotation||(e.rotation=t.rotation);null===(i=O.store)||void 0===i||i.setMultiple(e).catch((()=>{}))}const r=O.pdfLinkService.getAnchorUrl(t.pdfOpenParams);O.appConfig.toolbar.viewBookmark.href=r;O.appConfig.secondaryToolbar.viewBookmarkButton.href=r;const s=O.pdfViewer.getPageView(O.page-1),o=(null==s?void 0:s.renderingState)!==n.RenderingStates.FINISHED;O.toolbar.updateLoadingIndicatorState(o)}function webViewerScrollModeChanged(e){if(O.isInitialViewSet){var t;null===(t=O.store)||void 0===t||t.set("scrollMode",e.mode).catch((()=>{}))}}function webViewerSpreadModeChanged(e){if(O.isInitialViewSet){var t;null===(t=O.store)||void 0===t||t.set("spreadMode",e.mode).catch((()=>{}))}}function webViewerResize(){const{pdfDocument:e,pdfViewer:t}=O;t.updateContainerHeightCss();if(!e)return;const i=t.currentScaleValue;"auto"!==i&&"page-fit"!==i&&"page-width"!==i||(t.currentScaleValue=i);t.update()}function webViewerHashchange(e){var t;const i=e.hash;i&&(O.isInitialViewSet?null!==(t=O.pdfHistory)&&void 0!==t&&t.popStateInProgress||O.pdfLinkService.setHash(i):O.initialBookmark=i)}var webViewerFileInputChange=function(e){var t;if(null!==(t=O.pdfViewer)&&void 0!==t&&t.isInPresentationMode)return;const i=e.fileInput.files[0];let n=URL.createObjectURL(i);i.name&&(n={url:n,originalUrl:i.name});O.open(n);window.setNgxExtendedPdfViewerSource&&window.setNgxExtendedPdfViewerSource(i.name?i.name:n)},webViewerOpenFile=function(e){O.appConfig.openFileInput.click()};function webViewerPresentationMode(){O.requestPresentationMode()}function webViewerSwitchAnnotationEditorMode(e){O.pdfViewer.annotationEditorMode=e.mode}function webViewerSwitchAnnotationEditorParams(e){O.pdfViewer.annotationEditorParams=e}function webViewerPrint(){O.triggerPrinting()}function webViewerDownload(){O.downloadOrSave()}function webViewerFirstPage(){O.pdfDocument&&(O.page=1)}function webViewerLastPage(){O.pdfDocument&&(O.page=O.pagesCount)}function webViewerNextPage(){O.pdfViewer.nextPage()}function webViewerPreviousPage(){O.pdfViewer.previousPage()}function webViewerZoomIn(){O.zoomIn()}function webViewerZoomOut(){O.zoomOut()}function webViewerZoomReset(){O.zoomReset()}function webViewerPageNumberChanged(e){const t=O.pdfViewer;""!==e.value&&O.pdfLinkService.goToPage(e.value);e.value!==t.currentPageNumber.toString()&&e.value!==t.currentPageLabel&&O.toolbar.setPageNumber(t.currentPageNumber,t.currentPageLabel)}function webViewerScaleChanged(e){O.pdfViewer.currentScaleValue=e.value}function webViewerRotateCw(){O.rotatePages(90)}function webViewerRotateCcw(){O.rotatePages(-90)}function webViewerOptionalContentConfig(e){O.pdfViewer.optionalContentConfigPromise=e.promise}function webViewerSwitchScrollMode(e){O.pdfViewer.scrollMode=e.mode}function webViewerSwitchSpreadMode(e){O.pdfViewer.spreadMode=e.mode}function webViewerDocumentProperties(){O.pdfDocumentProperties.open()}function webViewerFindFromUrlHash(e){O.eventBus.dispatch("find",{source:e.source,type:"",query:e.query,phraseSearch:e.phraseSearch,caseSensitive:!1,entireWord:!1,ignoreAccents:!1,fuzzySearch:!1,highlightAll:!0,findPrevious:!1,matchDiacritics:!0})}function webViewerUpdateFindMatchesCount(e){let{matchesCount:t}=e;O.supportsIntegratedFind?O.externalServices.updateFindMatchesCount(t):O.findBar.updateResultsCount(t)}function webViewerUpdateFindControlState(e){let{state:t,previous:i,matchesCount:n,rawQuery:r}=e;O.supportsIntegratedFind?O.externalServices.updateFindControlState({result:t,findPrevious:i,matchesCount:n,rawQuery:r}):O.findBar.updateUIState(t,i,n)}function webViewerScaleChanging(e){O.toolbar.setPageScale(e.presetValue,e.scale);O.pdfViewer.update()}function webViewerRotationChanging(e){O.pdfThumbnailViewer.pagesRotation=e.pagesRotation;O.forceRendering();O.pdfViewer.currentPageNumber=e.pageNumber}function webViewerPageChanging(e){let{pageNumber:t,pageLabel:i}=e;O.toolbar.setPageNumber(t,i);O.secondaryToolbar.setPageNumber(t);O.pdfSidebar.visibleView===n.SidebarView.THUMBS&&O.pdfThumbnailViewer.scrollThumbnailIntoView(t);const r=document.getElementById("pageNumber");if(r){const e=new CustomEvent("page-change");r.dispatchEvent(e)}}function webViewerVisibilityChange(e){"visible"===document.visibilityState&&setZoomDisabledTimeout()}let B=null;function setZoomDisabledTimeout(){B&&clearTimeout(B);B=setTimeout((function(){B=null}),1e3)}function webViewerWheel(e){const t=document.getElementById("viewerContainer");if(t.parentNode.querySelector(":hover")!==t)return;const{pdfViewer:i,supportedMouseWheelZoomModifierKeys:r}=O;if(i.isInPresentationMode)return;const o=(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0);if(window.isKeyIgnored&&window.isKeyIgnored(o,"WHEEL"))return;const a=s.AppOptions.get("wheelAction");if(e.ctrlKey&&r.ctrlKey||e.metaKey&&r.metaKey?"zoom"!==a:"zoom"===a){e.preventDefault();if(B||"hidden"===document.visibilityState)return;const t=e.deltaMode,r=(0,n.normalizeWheelEventDirection)(e),s=i.currentScale;let o=0;if(t===WheelEvent.DOM_DELTA_LINE||t===WheelEvent.DOM_DELTA_PAGE)o=Math.abs(r)>=1?Math.sign(r):O.accumulateWheelTicks(r);else{const e=30;o=O.accumulateWheelTicks(r/e)}o<0?O.zoomOut(-o):o>0&&O.zoomIn(o);const a=i.currentScale;if(s!==a){const t=a/s-1,n=i.container.getBoundingClientRect(),r=e.clientX-n.left,o=e.clientY-n.top;i.container.scrollLeft+=r*t;i.container.scrollTop+=o*t}}else setZoomDisabledTimeout()}function webViewerClick(e){if(!O.secondaryToolbar.isOpen)return;const t=O.appConfig;if(O.pdfViewer.containsElement(e.target)||t.toolbar.container.contains(e.target)&&e.target!==t.secondaryToolbar.toggleButton){if(e.target&&e.target.parentElement===t.secondaryToolbar.toggleButton)return;if(e.target&&e.target.parentElement&&e.target.parentElement.parentElement===t.secondaryToolbar.toggleButton)return;O.secondaryToolbar.close()}}function webViewerKeyDown(e){if(O.overlayManager.active)return;const{eventBus:t,pdfViewer:i}=O,r=i.isInPresentationMode;let s=!1,o=!1;const l=(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0);if(window.isKeyIgnored&&window.isKeyIgnored(l,e.keyCode))return;if(1===l||8===l||5===l||12===l)switch(e.keyCode){case 70:if(!O.supportsIntegratedFind&&!e.shiftKey){O.findBar.open();s=!0}break;case 71:if(!O.supportsIntegratedFind){const{state:e}=O.findController;if(e){const i=Object.assign(Object.create(null),e,{source:window,type:"again",findPrevious:5===l||12===l});t.dispatch("find",i)}s=!0}break;case 61:case 107:case 187:case 171:r||O.zoomIn();s=!0;break;case 173:case 109:case 189:r||O.zoomOut();s=!0;break;case 48:case 96:if(!r){setTimeout((function(){O.zoomReset()}));s=!1}break;case 38:if(r||O.page>1){O.page=1;s=!0;o=!0}break;case 40:if(r||O.page<O.pagesCount){O.page=O.pagesCount;s=!0;o=!0}}if(1===l||8===l)switch(e.keyCode){case 83:t.dispatch("download",{source:window});s=!0;break;case 79:t.dispatch("openfile",{source:window});s=!0}if(3===l||10===l)switch(e.keyCode){case 80:O.requestPresentationMode();s=!0;break;case 71:O.appConfig.toolbar.pageNumber.select();s=!0}if(s){o&&!r&&i.focus();e.preventDefault();return}const c=(0,n.getActiveOrFocusedElement)(),h=null==c?void 0:c.tagName.toUpperCase();if(!("INPUT"===h||"TEXTAREA"===h||"SELECT"===h||null!=c&&c.isContentEditable)||27===e.keyCode){if(0===l){let t=0,n=!1;switch(e.keyCode){case 38:case 33:i.isVerticalScrollbarEnabled&&(n=!0);t=-1;break;case 8:r||(n=!0);t=-1;break;case 37:i.isHorizontalScrollbarEnabled&&(n=!0);case 75:case 80:t=-1;break;case 27:if(O.secondaryToolbar.isOpen){O.secondaryToolbar.close();s=!0}if(!O.supportsIntegratedFind&&O.findBar.opened){O.findBar.close();s=!0}break;case 40:case 34:i.isVerticalScrollbarEnabled&&(n=!0);t=1;break;case 13:case 32:r||(n=!0);t=1;break;case 39:i.isHorizontalScrollbarEnabled&&(n=!0);case 74:case 78:t=1;break;case 36:if(r||O.page>1){O.page=1;s=!0;o=!0}break;case 35:if(r||O.page<O.pagesCount){O.page=O.pagesCount;s=!0;o=!0}break;case 83:O.pdfCursorTools.switchTool(a.CursorTool.SELECT);break;case 72:O.pdfCursorTools.switchTool(a.CursorTool.HAND);break;case 82:O.rotatePages(90);break;case 115:O.pdfSidebar.toggle()}if(0!==t&&(!n||"page-fit"===i.currentScaleValue)){t>0?i.nextPage():i.previousPage();s=!0}}if(4===l)switch(e.keyCode){case 13:case 32:if(!r&&"page-fit"!==i.currentScaleValue)break;i.previousPage();s=!0;break;case 82:O.rotatePages(-90)}o&&!i.containsElement(c)&&i.focus();s&&e.preventDefault()}}function beforeUnload(e){e.preventDefault();e.returnValue="";return!1}const N={instance:{supportsPrinting:!1,createPrintService(){throw new Error("Not implemented: createPrintService")}}};t.PDFPrintServiceFactory=N},(e,t,i)=>{i(95);i(118);i(126);i(127);i(128);i(129)},(e,t,i)=>{"use strict";var n,r,s,o=i(65),a=i(19),l=i(96),c=i(2),h=i(39),d=i(68),u=i(81),p=i(80),g=i(97),f=i(43),m=i(7),v=i(6),w=i(98),_=i(99),y=i(102).set,b=i(108),P=i(111),S=i(112),E=i(113),x=i(59),C=i(114),T=i(115),I=i(117),M="Promise",L=T.CONSTRUCTOR,A=T.REJECTION_EVENT,D=T.SUBCLASSING,k=x.getterFor(M),O=x.set,R=C&&C.prototype,B=C,N=R,V=c.TypeError,U=c.document,W=c.process,H=I.f,G=H,z=!!(U&&U.createEvent&&c.dispatchEvent),j="unhandledrejection",isThenable=function(e){var t;return!(!v(e)||!m(t=e.then))&&t},callReaction=function(e,t){var i,n,r,s=t.value,o=1==t.state,a=o?e.ok:e.fail,l=e.resolve,c=e.reject,d=e.domain;try{if(a){if(!o){2===t.rejection&&onHandleUnhandled(t);t.rejection=1}if(!0===a)i=s;else{d&&d.enter();i=a(s);if(d){d.exit();r=!0}}i===e.promise?c(V("Promise-chain cycle")):(n=isThenable(i))?h(n,i,l,c):l(i)}else c(s)}catch(e){d&&!r&&d.exit();c(e)}},notify=function(e,t){if(!e.notified){e.notified=!0;b((function(){for(var i,n=e.reactions;i=n.get();)callReaction(i,e);e.notified=!1;t&&!e.rejection&&onUnhandled(e)}))}},dispatchEvent=function(e,t,i){var n,r;if(z){(n=U.createEvent("Event")).promise=t;n.reason=i;n.initEvent(e,!1,!0);c.dispatchEvent(n)}else n={promise:t,reason:i};!A&&(r=c["on"+e])?r(n):e===j&&P("Unhandled promise rejection",i)},onUnhandled=function(e){h(y,c,(function(){var t,i=e.facade,n=e.value;if(isUnhandled(e)){t=S((function(){l?W.emit("unhandledRejection",n,i):dispatchEvent(j,i,n)}));e.rejection=l||isUnhandled(e)?2:1;if(t.error)throw t.value}}))},isUnhandled=function(e){return 1!==e.rejection&&!e.parent},onHandleUnhandled=function(e){h(y,c,(function(){var t=e.facade;l?W.emit("rejectionHandled",t):dispatchEvent("rejectionhandled",t,e.value)}))},bind=function(e,t,i){return function(n){e(t,n,i)}},internalReject=function(e,t,i){if(!e.done){e.done=!0;i&&(e=i);e.value=t;e.state=2;notify(e,!0)}},internalResolve=function(e,t,i){if(!e.done){e.done=!0;i&&(e=i);try{if(e.facade===t)throw V("Promise can't be resolved itself");var n=isThenable(t);if(n)b((function(){var i={done:!1};try{h(n,t,bind(internalResolve,i,e),bind(internalReject,i,e))}catch(t){internalReject(i,t,e)}}));else{e.value=t;e.state=1;notify(e,!1)}}catch(t){internalReject({done:!1},t,e)}}};if(L){N=(B=function Promise(e){w(this,N);f(e);h(n,this);var t=k(this);try{e(bind(internalResolve,t),bind(internalReject,t))}catch(e){internalReject(t,e)}}).prototype;(n=function Promise(e){O(this,{type:M,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:void 0})}).prototype=d(N,"then",(function then(e,t){var i=k(this),n=H(_(this,B));i.parent=!0;n.ok=!m(e)||e;n.fail=m(t)&&t;n.domain=l?W.domain:void 0;0==i.state?i.reactions.add(n):b((function(){callReaction(n,i)}));return n.promise}));r=function(){var e=new n,t=k(e);this.promise=e;this.resolve=bind(internalResolve,t);this.reject=bind(internalReject,t)};I.f=H=function(e){return e===B||undefined===e?new r(e):G(e)};if(!a&&m(C)&&R!==Object.prototype){s=R.then;D||d(R,"then",(function then(e,t){var i=this;return new B((function(e,t){h(s,i,e,t)})).then(e,t)}),{unsafe:!0});try{delete R.constructor}catch(e){}u&&u(R,N)}}o({global:!0,constructor:!0,wrap:!0,forced:L},{Promise:B});p(B,M,!1,!0);g(M)},(e,t,i)=>{var n=i(14),r=i(2);e.exports="process"==n(r.process)},(e,t,i)=>{"use strict";var n=i(28),r=i(35),s=i(17),o=i(33),a=s("species");e.exports=function(e){var t=n(e),i=r.f;o&&t&&!t[a]&&i(t,a,{configurable:!0,get:function(){return this}})}},(e,t,i)=>{var n=i(41),r=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw r("Incorrect invocation")}},(e,t,i)=>{var n=i(31),r=i(100),s=i(17)("species");e.exports=function(e,t){var i,o=n(e).constructor;return void 0===o||null==(i=n(o)[s])?t:r(i)}},(e,t,i)=>{var n=i(101),r=i(44),s=TypeError;e.exports=function(e){if(n(e))return e;throw s(r(e)+" is not a constructor")}},(e,t,i)=>{var n=i(11),r=i(13),s=i(7),o=i(87),a=i(28),l=i(61),noop=function(){},c=[],h=a("Reflect","construct"),d=/^\s*(?:class|function)\b/,u=n(d.exec),p=!d.exec(noop),g=function isConstructor(e){if(!s(e))return!1;try{h(noop,c,e);return!0}catch(e){return!1}},f=function isConstructor(e){if(!s(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!u(d,l(e))}catch(e){return!0}};f.sham=!0;e.exports=!h||r((function(){var e;return g(g.call)||!g(Object)||!g((function(){e=!0}))||e}))?f:g},(e,t,i)=>{var n,r,s,o,a=i(2),l=i(103),c=i(104),h=i(7),d=i(22),u=i(13),p=i(56),g=i(105),f=i(5),m=i(106),v=i(107),w=i(96),_=a.setImmediate,y=a.clearImmediate,b=a.process,P=a.Dispatch,S=a.Function,E=a.MessageChannel,x=a.String,C=0,T={},I="onreadystatechange";try{n=a.location}catch(e){}var run=function(e){if(d(T,e)){var t=T[e];delete T[e];t()}},runner=function(e){return function(){run(e)}},listener=function(e){run(e.data)},post=function(e){a.postMessage(x(e),n.protocol+"//"+n.host)};if(!_||!y){_=function setImmediate(e){m(arguments.length,1);var t=h(e)?e:S(e),i=g(arguments,1);T[++C]=function(){l(t,void 0,i)};r(C);return C};y=function clearImmediate(e){delete T[e]};if(w)r=function(e){b.nextTick(runner(e))};else if(P&&P.now)r=function(e){P.now(runner(e))};else if(E&&!v){o=(s=new E).port2;s.port1.onmessage=listener;r=c(o.postMessage,o)}else if(a.addEventListener&&h(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!u(post)){r=post;a.addEventListener("message",listener,!1)}else r=I in f("script")?function(e){p.appendChild(f("script")).onreadystatechange=function(){p.removeChild(this);run(e)}}:function(e){setTimeout(runner(e),0)}}e.exports={set:_,clear:y}},(e,t,i)=>{var n=i(12),r=Function.prototype,s=r.apply,o=r.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(s):function(){return o.apply(s,arguments)})},(e,t,i)=>{var n=i(11),r=i(43),s=i(12),o=n(n.bind);e.exports=function(e,t){r(e);return void 0===t?e:s?o(e,t):function(){return e.apply(t,arguments)}}},(e,t,i)=>{var n=i(11);e.exports=n([].slice)},e=>{var t=TypeError;e.exports=function(e,i){if(e<i)throw t("Not enough arguments");return e}},(e,t,i)=>{var n=i(27);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},(e,t,i)=>{var n,r,s,o,a,l,c,h,d=i(2),u=i(104),p=i(66).f,g=i(102).set,f=i(107),m=i(109),v=i(110),w=i(96),_=d.MutationObserver||d.WebKitMutationObserver,y=d.document,b=d.process,P=d.Promise,S=p(d,"queueMicrotask"),E=S&&S.value;if(!E){n=function(){var e,t;w&&(e=b.domain)&&e.exit();for(;r;){t=r.fn;r=r.next;try{t()}catch(e){r?o():s=void 0;throw e}}s=void 0;e&&e.enter()};if(f||w||v||!_||!y)if(!m&&P&&P.resolve){(c=P.resolve(void 0)).constructor=P;h=u(c.then,c);o=function(){h(n)}}else if(w)o=function(){b.nextTick(n)};else{g=u(g,d);o=function(){g(n)}}else{a=!0;l=y.createTextNode("");new _(n).observe(l,{characterData:!0});o=function(){l.data=a=!a}}}e.exports=E||function(e){var t={fn:e,next:void 0};s&&(s.next=t);if(!r){r=t;o()}s=t}},(e,t,i)=>{var n=i(27),r=i(2);e.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==r.Pebble},(e,t,i)=>{var n=i(27);e.exports=/web0s(?!.*chrome)/i.test(n)},(e,t,i)=>{var n=i(2);e.exports=function(e,t){var i=n.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))}},e=>{e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},e=>{var Queue=function(){this.head=null;this.tail=null};Queue.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t;this.tail=t},get:function(){var e=this.head;if(e){this.head=e.next;this.tail===e&&(this.tail=null);return e.item}}};e.exports=Queue},(e,t,i)=>{var n=i(2);e.exports=n.Promise},(e,t,i)=>{var n=i(2),r=i(114),s=i(7),o=i(75),a=i(61),l=i(17),c=i(116),h=i(19),d=i(26),u=r&&r.prototype,p=l("species"),g=!1,f=s(n.PromiseRejectionEvent),m=o("Promise",(function(){var e=a(r),t=e!==String(r);if(!t&&66===d)return!0;if(h&&(!u.catch||!u.finally))return!0;if(d>=51&&/native code/.test(e))return!1;var i=new r((function(e){e(1)})),FakePromise=function(e){e((function(){}),(function(){}))};(i.constructor={})[p]=FakePromise;return!(g=i.then((function(){}))instanceof FakePromise)||!t&&c&&!f}));e.exports={CONSTRUCTOR:m,REJECTION_EVENT:f,SUBCLASSING:g}},e=>{e.exports="object"==typeof window&&"object"!=typeof Deno},(e,t,i)=>{"use strict";var n=i(43),PromiseCapability=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e;i=n}));this.resolve=n(t);this.reject=n(i)};e.exports.f=function(e){return new PromiseCapability(e)}},(e,t,i)=>{"use strict";var n=i(65),r=i(39),s=i(43),o=i(117),a=i(112),l=i(119);n({target:"Promise",stat:!0,forced:i(124)},{all:function all(e){var t=this,i=o.f(t),n=i.resolve,c=i.reject,h=a((function(){var i=s(t.resolve),o=[],a=0,h=1;l(e,(function(e){var s=a++,l=!1;h++;r(i,t,e).then((function(e){if(!l){l=!0;o[s]=e;--h||n(o)}}),c)}));--h||n(o)}));h.error&&c(h.value);return i.promise}})},(e,t,i)=>{var n=i(104),r=i(39),s=i(31),o=i(44),a=i(120),l=i(52),c=i(41),h=i(121),d=i(122),u=i(123),p=TypeError,Result=function(e,t){this.stopped=e;this.result=t},g=Result.prototype;e.exports=function(e,t,i){var f,m,v,w,_,y,b,P=i&&i.that,S=!(!i||!i.AS_ENTRIES),E=!(!i||!i.IS_RECORD),x=!(!i||!i.IS_ITERATOR),C=!(!i||!i.INTERRUPTED),T=n(t,P),stop=function(e){f&&u(f,"normal",e);return new Result(!0,e)},callFn=function(e){if(S){s(e);return C?T(e[0],e[1],stop):T(e[0],e[1])}return C?T(e,stop):T(e)};if(E)f=e.iterator;else if(x)f=e;else{if(!(m=d(e)))throw p(o(e)+" is not iterable");if(a(m)){for(v=0,w=l(e);w>v;v++)if((_=callFn(e[v]))&&c(g,_))return _;return new Result(!1)}f=h(e,m)}y=E?e.next:f.next;for(;!(b=r(y,f)).done;){try{_=callFn(b.value)}catch(e){u(f,"throw",e)}if("object"==typeof _&&_&&c(g,_))return _}return new Result(!1)}},(e,t,i)=>{var n=i(17),r=i(58),s=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[s]===e)}},(e,t,i)=>{var n=i(39),r=i(43),s=i(31),o=i(44),a=i(122),l=TypeError;e.exports=function(e,t){var i=arguments.length<2?a(e):t;if(r(i))return s(n(i,e));throw l(o(e)+" is not iterable")}},(e,t,i)=>{var n=i(87),r=i(42),s=i(58),o=i(17)("iterator");e.exports=function(e){if(null!=e)return r(e,o)||r(e,"@@iterator")||s[n(e)]}},(e,t,i)=>{var n=i(39),r=i(31),s=i(42);e.exports=function(e,t,i){var o,a;r(e);try{if(!(o=s(e,"return"))){if("throw"===t)throw i;return i}o=n(o,e)}catch(e){a=!0;o=e}if("throw"===t)throw i;if(a)throw o;r(o);return i}},(e,t,i)=>{var n=i(114),r=i(125),s=i(115).CONSTRUCTOR;e.exports=s||!r((function(e){n.all(e).then(void 0,(function(){}))}))},(e,t,i)=>{var n=i(17)("iterator"),r=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){r=!0}};o[n]=function(){return this};Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!r)return!1;var i=!1;try{var s={};s[n]=function(){return{next:function(){return{done:i=!0}}}};e(s)}catch(e){}return i}},(e,t,i)=>{"use strict";var n=i(65),r=i(19),s=i(115).CONSTRUCTOR,o=i(114),a=i(28),l=i(7),c=i(68),h=o&&o.prototype;n({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(e){return this.then(void 0,e)}});if(!r&&l(o)){var d=a("Promise").prototype.catch;h.catch!==d&&c(h,"catch",d,{unsafe:!0})}},(e,t,i)=>{"use strict";var n=i(65),r=i(39),s=i(43),o=i(117),a=i(112),l=i(119);n({target:"Promise",stat:!0,forced:i(124)},{race:function race(e){var t=this,i=o.f(t),n=i.reject,c=a((function(){var o=s(t.resolve);l(e,(function(e){r(o,t,e).then(i.resolve,n)}))}));c.error&&n(c.value);return i.promise}})},(e,t,i)=>{"use strict";var n=i(65),r=i(39),s=i(117);n({target:"Promise",stat:!0,forced:i(115).CONSTRUCTOR},{reject:function reject(e){var t=s.f(this);r(t.reject,void 0,e);return t.promise}})},(e,t,i)=>{"use strict";var n=i(65),r=i(28),s=i(19),o=i(114),a=i(115).CONSTRUCTOR,l=i(130),c=r("Promise"),h=s&&!a;n({target:"Promise",stat:!0,forced:s||a},{resolve:function resolve(e){return l(h&&this===c?o:this,e)}})},(e,t,i)=>{var n=i(31),r=i(6),s=i(117);e.exports=function(e,t){n(e);if(r(t)&&t.constructor===e)return t;var i=s.f(e);(0,i.resolve)(t);return i.promise}},(e,t,i)=>{"use strict";var n=i(65),r=i(48).includes,s=i(13),o=i(16);n({target:"Array",proto:!0,forced:s((function(){return!Array(1).includes()}))},{includes:function includes(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}});o("includes")},(e,t,i)=>{"use strict";var n=i(103),r=i(39),s=i(11),o=i(133),a=i(13),l=i(31),c=i(7),h=i(50),d=i(53),u=i(86),p=i(15),g=i(134),f=i(42),m=i(136),v=i(137),w=i(17)("replace"),_=Math.max,y=Math.min,b=s([].concat),P=s([].push),S=s("".indexOf),E=s("".slice),x="$0"==="a".replace(/./,"$0"),C=!!/./[w]&&""===/./[w]("a","$0");o("replace",(function(e,t,i){var s=C?"$":"$0";return[function replace(e,i){var n=p(this),s=null==e?void 0:f(e,w);return s?r(s,e,n,i):r(t,u(n),e,i)},function(e,r){var o=l(this),a=u(e);if("string"==typeof r&&-1===S(r,s)&&-1===S(r,"$<")){var p=i(t,o,a,r);if(p.done)return p.value}var f=c(r);f||(r=u(r));var w=o.global;if(w){var x=o.unicode;o.lastIndex=0}for(var C=[];;){var T=v(o,a);if(null===T)break;P(C,T);if(!w)break;""===u(T[0])&&(o.lastIndex=g(a,d(o.lastIndex),x))}for(var I,M="",L=0,A=0;A<C.length;A++){for(var D=u((T=C[A])[0]),k=_(y(h(T.index),a.length),0),O=[],R=1;R<T.length;R++)P(O,void 0===(I=T[R])?I:String(I));var B=T.groups;if(f){var N=b([D],O,k,a);void 0!==B&&P(N,B);var V=u(n(r,void 0,N))}else V=m(D,a,k,O,B,r);if(k>=L){M+=E(a,L,k)+V;L=k+D.length}}return M+E(a,L)}]}),!!a((function(){var e=/./;e.exec=function(){var e=[];e.groups={a:"7"};return e};return"7"!=="".replace(e,"$<a>")}))||!x||C)},(e,t,i)=>{"use strict";i(84);var n=i(11),r=i(68),s=i(85),o=i(13),a=i(17),l=i(62),c=a("species"),h=RegExp.prototype;e.exports=function(e,t,i,d){var u=a(e),p=!o((function(){var t={};t[u]=function(){return 7};return 7!=""[e](t)})),g=p&&!o((function(){var t=!1,i=/a/;if("split"===e){(i={}).constructor={};i.constructor[c]=function(){return i};i.flags="";i[u]=/./[u]}i.exec=function(){t=!0;return null};i[u]("");return!t}));if(!p||!g||i){var f=n(/./[u]),m=t(u,""[e],(function(e,t,i,r,o){var a=n(e),l=t.exec;return l===s||l===h.exec?p&&!o?{done:!0,value:f(t,i,r)}:{done:!0,value:a(i,t,r)}:{done:!1}}));r(String.prototype,e,m[0]);r(h,u,m[1])}d&&l(h[u],"sham",!0)}},(e,t,i)=>{"use strict";var n=i(135).charAt;e.exports=function(e,t,i){return t+(i?n(e,t).length:1)}},(e,t,i)=>{var n=i(11),r=i(50),s=i(86),o=i(15),a=n("".charAt),l=n("".charCodeAt),c=n("".slice),createMethod=function(e){return function(t,i){var n,h,d=s(o(t)),u=r(i),p=d.length;return u<0||u>=p?e?"":void 0:(n=l(d,u))<55296||n>56319||u+1===p||(h=l(d,u+1))<56320||h>57343?e?a(d,u):n:e?c(d,u,u+2):h-56320+(n-55296<<10)+65536}};e.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},(e,t,i)=>{var n=i(11),r=i(23),s=Math.floor,o=n("".charAt),a=n("".replace),l=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,h=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,i,n,d,u){var p=i+e.length,g=n.length,f=h;if(void 0!==d){d=r(d);f=c}return a(u,f,(function(r,a){var c;switch(o(a,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,i);case"'":return l(t,p);case"<":c=d[l(a,1,-1)];break;default:var h=+a;if(0===h)return r;if(h>g){var u=s(h/10);return 0===u?r:u<=g?void 0===n[u-1]?o(a,1):n[u-1]+o(a,1):r}c=n[h-1]}return void 0===c?"":c}))}},(e,t,i)=>{var n=i(39),r=i(31),s=i(7),o=i(14),a=i(85),l=TypeError;e.exports=function(e,t){var i=e.exec;if(s(i)){var c=n(i,e,t);null!==c&&r(c);return c}if("RegExp"===o(e))return n(a,e,t);throw l("RegExp#exec called on incompatible receiver")}},(e,t,i)=>{i(139)},(e,t,i)=>{"use strict";i(140);var n,r=i(65),s=i(33),o=i(141),a=i(2),l=i(104),c=i(11),h=i(68),d=i(142),u=i(98),p=i(22),g=i(143),f=i(144),m=i(147),v=i(135).codeAt,w=i(148),_=i(86),y=i(80),b=i(106),P=i(149),S=i(59),E=S.set,x=S.getterFor("URL"),C=P.URLSearchParams,T=P.getState,I=a.URL,M=a.TypeError,L=a.parseInt,A=Math.floor,D=Math.pow,k=c("".charAt),O=c(/./.exec),R=c([].join),B=c(1..toString),N=c([].pop),V=c([].push),U=c("".replace),W=c([].shift),H=c("".split),G=c("".slice),z=c("".toLowerCase),j=c([].unshift),q="Invalid scheme",K="Invalid host",X="Invalid port",Y=/[a-z]/i,Z=/[\d+-.a-z]/i,Q=/\d/,J=/^0x/i,$=/^[0-7]+$/,ee=/^\d+$/,te=/^[\da-f]+$/i,ie=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ne=/[\0\t\n\r #/:<>?@[\\\]^|]/,re=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,se=/[\t\n\r]/g,serializeHost=function(e){var t,i,n,r;if("number"==typeof e){t=[];for(i=0;i<4;i++){j(t,e%256);e=A(e/256)}return R(t,".")}if("object"==typeof e){t="";n=function(e){for(var t=null,i=1,n=null,r=0,s=0;s<8;s++)if(0!==e[s]){if(r>i){t=n;i=r}n=null;r=0}else{null===n&&(n=s);++r}if(r>i){t=n;i=r}return t}(e);for(i=0;i<8;i++)if(!r||0!==e[i]){r&&(r=!1);if(n===i){t+=i?":":"::";r=!0}else{t+=B(e[i],16);i<7&&(t+=":")}}return"["+t+"]"}return e},oe={},ae=g({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),le=g({},ae,{"#":1,"?":1,"{":1,"}":1}),ce=g({},le,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,t){var i=v(e,0);return i>32&&i<127&&!p(t,e)?e:encodeURIComponent(e)},he={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(e,t){var i;return 2==e.length&&O(Y,k(e,0))&&(":"==(i=k(e,1))||!t&&"|"==i)},startsWithWindowsDriveLetter=function(e){var t;return e.length>1&&isWindowsDriveLetter(G(e,0,2))&&(2==e.length||"/"===(t=k(e,2))||"\\"===t||"?"===t||"#"===t)},isSingleDot=function(e){return"."===e||"%2e"===z(e)},de={},ue={},pe={},ge={},fe={},me={},ve={},we={},_e={},ye={},be={},Pe={},Se={},Ee={},xe={},Ce={},Te={},Ie={},Me={},Le={},Ae={},URLState=function(e,t,i){var n,r,s,o=_(e);if(t){if(r=this.parse(o))throw M(r);this.searchParams=null}else{void 0!==i&&(n=new URLState(i,!0));if(r=this.parse(o,null,n))throw M(r);(s=T(new C)).bindURL(this);this.searchParams=s}};URLState.prototype={type:"URL",parse:function(e,t,i){var r,s,o,a,l,c=this,h=t||de,d=0,u="",g=!1,v=!1,w=!1;e=_(e);if(!t){c.scheme="";c.username="";c.password="";c.host=null;c.port=null;c.path=[];c.query=null;c.fragment=null;c.cannotBeABaseURL=!1;e=U(e,re,"")}e=U(e,se,"");r=f(e);for(;d<=r.length;){s=r[d];switch(h){case de:if(!s||!O(Y,s)){if(t)return q;h=pe;continue}u+=z(s);h=ue;break;case ue:if(s&&(O(Z,s)||"+"==s||"-"==s||"."==s))u+=z(s);else{if(":"!=s){if(t)return q;u="";h=pe;d=0;continue}if(t&&(c.isSpecial()!=p(he,u)||"file"==u&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;c.scheme=u;if(t){c.isSpecial()&&he[c.scheme]==c.port&&(c.port=null);return}u="";if("file"==c.scheme)h=Ee;else if(c.isSpecial()&&i&&i.scheme==c.scheme)h=ge;else if(c.isSpecial())h=we;else if("/"==r[d+1]){h=fe;d++}else{c.cannotBeABaseURL=!0;V(c.path,"");h=Me}}break;case pe:if(!i||i.cannotBeABaseURL&&"#"!=s)return q;if(i.cannotBeABaseURL&&"#"==s){c.scheme=i.scheme;c.path=m(i.path);c.query=i.query;c.fragment="";c.cannotBeABaseURL=!0;h=Ae;break}h="file"==i.scheme?Ee:me;continue;case ge:if("/"!=s||"/"!=r[d+1]){h=me;continue}h=_e;d++;break;case fe:if("/"==s){h=ye;break}h=Ie;continue;case me:c.scheme=i.scheme;if(s==n){c.username=i.username;c.password=i.password;c.host=i.host;c.port=i.port;c.path=m(i.path);c.query=i.query}else if("/"==s||"\\"==s&&c.isSpecial())h=ve;else if("?"==s){c.username=i.username;c.password=i.password;c.host=i.host;c.port=i.port;c.path=m(i.path);c.query="";h=Le}else{if("#"!=s){c.username=i.username;c.password=i.password;c.host=i.host;c.port=i.port;c.path=m(i.path);c.path.length--;h=Ie;continue}c.username=i.username;c.password=i.password;c.host=i.host;c.port=i.port;c.path=m(i.path);c.query=i.query;c.fragment="";h=Ae}break;case ve:if(!c.isSpecial()||"/"!=s&&"\\"!=s){if("/"!=s){c.username=i.username;c.password=i.password;c.host=i.host;c.port=i.port;h=Ie;continue}h=ye}else h=_e;break;case we:h=_e;if("/"!=s||"/"!=k(u,d+1))continue;d++;break;case _e:if("/"!=s&&"\\"!=s){h=ye;continue}break;case ye:if("@"==s){g&&(u="%40"+u);g=!0;o=f(u);for(var y=0;y<o.length;y++){var b=o[y];if(":"!=b||w){var P=percentEncode(b,ce);w?c.password+=P:c.username+=P}else w=!0}u=""}else if(s==n||"/"==s||"?"==s||"#"==s||"\\"==s&&c.isSpecial()){if(g&&""==u)return"Invalid authority";d-=f(u).length+1;u="";h=be}else u+=s;break;case be:case Pe:if(t&&"file"==c.scheme){h=Ce;continue}if(":"!=s||v){if(s==n||"/"==s||"?"==s||"#"==s||"\\"==s&&c.isSpecial()){if(c.isSpecial()&&""==u)return K;if(t&&""==u&&(c.includesCredentials()||null!==c.port))return;if(a=c.parseHost(u))return a;u="";h=Te;if(t)return;continue}"["==s?v=!0:"]"==s&&(v=!1);u+=s}else{if(""==u)return K;if(a=c.parseHost(u))return a;u="";h=Se;if(t==Pe)return}break;case Se:if(!O(Q,s)){if(s==n||"/"==s||"?"==s||"#"==s||"\\"==s&&c.isSpecial()||t){if(""!=u){var S=L(u,10);if(S>65535)return X;c.port=c.isSpecial()&&S===he[c.scheme]?null:S;u=""}if(t)return;h=Te;continue}return X}u+=s;break;case Ee:c.scheme="file";if("/"==s||"\\"==s)h=xe;else{if(!i||"file"!=i.scheme){h=Ie;continue}if(s==n){c.host=i.host;c.path=m(i.path);c.query=i.query}else if("?"==s){c.host=i.host;c.path=m(i.path);c.query="";h=Le}else{if("#"!=s){if(!startsWithWindowsDriveLetter(R(m(r,d),""))){c.host=i.host;c.path=m(i.path);c.shortenPath()}h=Ie;continue}c.host=i.host;c.path=m(i.path);c.query=i.query;c.fragment="";h=Ae}}break;case xe:if("/"==s||"\\"==s){h=Ce;break}i&&"file"==i.scheme&&!startsWithWindowsDriveLetter(R(m(r,d),""))&&(isWindowsDriveLetter(i.path[0],!0)?V(c.path,i.path[0]):c.host=i.host);h=Ie;continue;case Ce:if(s==n||"/"==s||"\\"==s||"?"==s||"#"==s){if(!t&&isWindowsDriveLetter(u))h=Ie;else if(""==u){c.host="";if(t)return;h=Te}else{if(a=c.parseHost(u))return a;"localhost"==c.host&&(c.host="");if(t)return;u="";h=Te}continue}u+=s;break;case Te:if(c.isSpecial()){h=Ie;if("/"!=s&&"\\"!=s)continue}else if(t||"?"!=s)if(t||"#"!=s){if(s!=n){h=Ie;if("/"!=s)continue}}else{c.fragment="";h=Ae}else{c.query="";h=Le}break;case Ie:if(s==n||"/"==s||"\\"==s&&c.isSpecial()||!t&&("?"==s||"#"==s)){if(".."===(l=z(l=u))||"%2e."===l||".%2e"===l||"%2e%2e"===l){c.shortenPath();"/"==s||"\\"==s&&c.isSpecial()||V(c.path,"")}else if(isSingleDot(u))"/"==s||"\\"==s&&c.isSpecial()||V(c.path,"");else{if("file"==c.scheme&&!c.path.length&&isWindowsDriveLetter(u)){c.host&&(c.host="");u=k(u,0)+":"}V(c.path,u)}u="";if("file"==c.scheme&&(s==n||"?"==s||"#"==s))for(;c.path.length>1&&""===c.path[0];)W(c.path);if("?"==s){c.query="";h=Le}else if("#"==s){c.fragment="";h=Ae}}else u+=percentEncode(s,le);break;case Me:if("?"==s){c.query="";h=Le}else if("#"==s){c.fragment="";h=Ae}else s!=n&&(c.path[0]+=percentEncode(s,oe));break;case Le:if(t||"#"!=s)s!=n&&("'"==s&&c.isSpecial()?c.query+="%27":c.query+="#"==s?"%23":percentEncode(s,oe));else{c.fragment="";h=Ae}break;case Ae:s!=n&&(c.fragment+=percentEncode(s,ae))}d++}},parseHost:function(e){var t,i,n;if("["==k(e,0)){if("]"!=k(e,e.length-1))return K;t=function(e){var t,i,n,r,s,o,a,l=[0,0,0,0,0,0,0,0],c=0,h=null,d=0,chr=function(){return k(e,d)};if(":"==chr()){if(":"!=k(e,1))return;d+=2;h=++c}for(;chr();){if(8==c)return;if(":"!=chr()){t=i=0;for(;i<4&&O(te,chr());){t=16*t+L(chr(),16);d++;i++}if("."==chr()){if(0==i)return;d-=i;if(c>6)return;n=0;for(;chr();){r=null;if(n>0){if(!("."==chr()&&n<4))return;d++}if(!O(Q,chr()))return;for(;O(Q,chr());){s=L(chr(),10);if(null===r)r=s;else{if(0==r)return;r=10*r+s}if(r>255)return;d++}l[c]=256*l[c]+r;2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==chr()){d++;if(!chr())return}else if(chr())return;l[c++]=t}else{if(null!==h)return;d++;h=++c}}if(null!==h){o=c-h;c=7;for(;0!=c&&o>0;){a=l[c];l[c--]=l[h+o-1];l[h+--o]=a}}else if(8!=c)return;return l}(G(e,1,-1));if(!t)return K;this.host=t}else if(this.isSpecial()){e=w(e);if(O(ie,e))return K;t=function(e){var t,i,n,r,s,o,a,l=H(e,".");l.length&&""==l[l.length-1]&&l.length--;if((t=l.length)>4)return e;i=[];for(n=0;n<t;n++){if(""==(r=l[n]))return e;s=10;if(r.length>1&&"0"==k(r,0)){s=O(J,r)?16:8;r=G(r,8==s?1:2)}if(""===r)o=0;else{if(!O(10==s?ee:8==s?$:te,r))return e;o=L(r,s)}V(i,o)}for(n=0;n<t;n++){o=i[n];if(n==t-1){if(o>=D(256,5-t))return null}else if(o>255)return null}a=N(i);for(n=0;n<i.length;n++)a+=i[n]*D(256,3-n);return a}(e);if(null===t)return K;this.host=t}else{if(O(ne,e))return K;t="";i=f(e);for(n=0;n<i.length;n++)t+=percentEncode(i[n],oe);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return p(he,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&isWindowsDriveLetter(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,i=e.username,n=e.password,r=e.host,s=e.port,o=e.path,a=e.query,l=e.fragment,c=t+":";if(null!==r){c+="//";e.includesCredentials()&&(c+=i+(n?":"+n:"")+"@");c+=serializeHost(r);null!==s&&(c+=":"+s)}else"file"==t&&(c+="//");c+=e.cannotBeABaseURL?o[0]:o.length?"/"+R(o,"/"):"";null!==a&&(c+="?"+a);null!==l&&(c+="#"+l);return c},setHref:function(e){var t=this.parse(e);if(t)throw M(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new De(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+serializeHost(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(_(e)+":",de)},getUsername:function(){return this.username},setUsername:function(e){var t=f(_(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var i=0;i<t.length;i++)this.username+=percentEncode(t[i],ce)}},getPassword:function(){return this.password},setPassword:function(e){var t=f(_(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var i=0;i<t.length;i++)this.password+=percentEncode(t[i],ce)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?serializeHost(e):serializeHost(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,be)},getHostname:function(){var e=this.host;return null===e?"":serializeHost(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Pe)},getPort:function(){var e=this.port;return null===e?"":_(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=_(e))?this.port=null:this.parse(e,Se))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+R(e,"/"):""},setPathname:function(e){if(!this.cannotBeABaseURL){this.path=[];this.parse(e,Te)}},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){if(""==(e=_(e)))this.query=null;else{"?"==k(e,0)&&(e=G(e,1));this.query="";this.parse(e,Le)}this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(""!=(e=_(e))){"#"==k(e,0)&&(e=G(e,1));this.fragment="";this.parse(e,Ae)}else this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var De=function URL(e){var t=u(this,ke),i=b(arguments.length,1)>1?arguments[1]:void 0,n=E(t,new URLState(e,!1,i));if(!s){t.href=n.serialize();t.origin=n.getOrigin();t.protocol=n.getProtocol();t.username=n.getUsername();t.password=n.getPassword();t.host=n.getHost();t.hostname=n.getHostname();t.port=n.getPort();t.pathname=n.getPathname();t.search=n.getSearch();t.searchParams=n.getSearchParams();t.hash=n.getHash()}},ke=De.prototype,accessorDescriptor=function(e,t){return{get:function(){return x(this)[e]()},set:t&&function(e){return x(this)[t](e)},configurable:!0,enumerable:!0}};if(s){d(ke,"href",accessorDescriptor("serialize","setHref"));d(ke,"origin",accessorDescriptor("getOrigin"));d(ke,"protocol",accessorDescriptor("getProtocol","setProtocol"));d(ke,"username",accessorDescriptor("getUsername","setUsername"));d(ke,"password",accessorDescriptor("getPassword","setPassword"));d(ke,"host",accessorDescriptor("getHost","setHost"));d(ke,"hostname",accessorDescriptor("getHostname","setHostname"));d(ke,"port",accessorDescriptor("getPort","setPort"));d(ke,"pathname",accessorDescriptor("getPathname","setPathname"));d(ke,"search",accessorDescriptor("getSearch","setSearch"));d(ke,"searchParams",accessorDescriptor("getSearchParams"));d(ke,"hash",accessorDescriptor("getHash","setHash"))}h(ke,"toJSON",(function toJSON(){return x(this).serialize()}),{enumerable:!0});h(ke,"toString",(function toString(){return x(this).serialize()}),{enumerable:!0});if(I){var Fe=I.createObjectURL,Oe=I.revokeObjectURL;Fe&&h(De,"createObjectURL",l(Fe,I));Oe&&h(De,"revokeObjectURL",l(Oe,I))}y(De,"URL");r({global:!0,constructor:!0,forced:!o,sham:!s},{URL:De})},(e,t,i)=>{"use strict";var n=i(135).charAt,r=i(86),s=i(59),o=i(64),a="String Iterator",l=s.set,c=s.getterFor(a);o(String,"String",(function(e){l(this,{type:a,string:r(e),index:0})}),(function next(){var e,t=c(this),i=t.string,r=t.index;if(r>=i.length)return{value:void 0,done:!0};e=n(i,r);t.index+=e.length;return{value:e,done:!1}}))},(e,t,i)=>{var n=i(13),r=i(17),s=i(19),o=r("iterator");e.exports=!n((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,i="";e.pathname="c%20d";t.forEach((function(e,n){t.delete("b");i+=n+e}));return s&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[o]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host}))},(e,t,i)=>{var n=i(69),r=i(35);e.exports=function(e,t,i){i.get&&n(i.get,t,{getter:!0});i.set&&n(i.set,t,{setter:!0});return r.f(e,t,i)}},(e,t,i)=>{"use strict";var n=i(33),r=i(11),s=i(39),o=i(13),a=i(46),l=i(74),c=i(67),h=i(23),d=i(10),u=Object.assign,p=Object.defineProperty,g=r([].concat);e.exports=!u||o((function(){if(n&&1!==u({b:1},u(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol(),r="abcdefghijklmnopqrst";e[i]=7;r.split("").forEach((function(e){t[e]=e}));return 7!=u({},e)[i]||a(u({},t)).join("")!=r}))?function assign(e,t){for(var i=h(e),r=arguments.length,o=1,u=l.f,p=c.f;r>o;)for(var f,m=d(arguments[o++]),v=u?g(a(m),u(m)):a(m),w=v.length,_=0;w>_;){f=v[_++];n&&!s(p,m,f)||(i[f]=m[f])}return i}:u},(e,t,i)=>{"use strict";var n=i(104),r=i(39),s=i(23),o=i(145),a=i(120),l=i(101),c=i(52),h=i(146),d=i(121),u=i(122),p=Array;e.exports=function from(e){var t=s(e),i=l(this),g=arguments.length,f=g>1?arguments[1]:void 0,m=void 0!==f;m&&(f=n(f,g>2?arguments[2]:void 0));var v,w,_,y,b,P,S=u(t),E=0;if(!S||this===p&&a(S)){v=c(t);w=i?new this(v):p(v);for(;v>E;E++){P=m?f(t[E],E):t[E];h(w,E,P)}}else{b=(y=d(t,S)).next;w=i?new this:[];for(;!(_=r(b,y)).done;E++){P=m?o(y,f,[_.value,E],!0):_.value;h(w,E,P)}}w.length=E;return w}},(e,t,i)=>{var n=i(31),r=i(123);e.exports=function(e,t,i,s){try{return s?t(n(i)[0],i[1]):t(i)}catch(t){r(e,"throw",t)}}},(e,t,i)=>{"use strict";var n=i(37),r=i(35),s=i(63);e.exports=function(e,t,i){var o=n(t);o in e?r.f(e,o,s(0,i)):e[o]=i}},(e,t,i)=>{var n=i(49),r=i(52),s=i(146),o=Array,a=Math.max;e.exports=function(e,t,i){for(var l=r(e),c=n(t,l),h=n(void 0===i?l:i,l),d=o(a(h-c,0)),u=0;c<h;c++,u++)s(d,u,e[c]);d.length=u;return d}},(e,t,i)=>{"use strict";var n=i(11),r=2147483647,s=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",l=RangeError,c=n(o.exec),h=Math.floor,d=String.fromCharCode,u=n("".charCodeAt),p=n([].join),g=n([].push),f=n("".replace),m=n("".split),v=n("".toLowerCase),digitToBasic=function(e){return e+22+75*(e<26)},adapt=function(e,t,i){var n=0;e=i?h(e/700):e>>1;e+=h(e/t);for(;e>455;){e=h(e/35);n+=36}return h(n+36*e/(e+38))},encode=function(e){var t=[];e=function(e){for(var t=[],i=0,n=e.length;i<n;){var r=u(e,i++);if(r>=55296&&r<=56319&&i<n){var s=u(e,i++);if(56320==(64512&s))g(t,((1023&r)<<10)+(1023&s)+65536);else{g(t,r);i--}}else g(t,r)}return t}(e);var i,n,s=e.length,o=128,c=0,f=72;for(i=0;i<e.length;i++)(n=e[i])<128&&g(t,d(n));var m=t.length,v=m;m&&g(t,"-");for(;v<s;){var w=r;for(i=0;i<e.length;i++)(n=e[i])>=o&&n<w&&(w=n);var _=v+1;if(w-o>h((r-c)/_))throw l(a);c+=(w-o)*_;o=w;for(i=0;i<e.length;i++){if((n=e[i])<o&&++c>r)throw l(a);if(n==o){for(var y=c,b=36;;){var P=b<=f?1:b>=f+26?26:b-f;if(y<P)break;var S=y-P,E=36-P;g(t,d(digitToBasic(P+S%E)));y=h(S/E);b+=36}g(t,d(digitToBasic(y)));f=adapt(c,_,v==m);c=0;v++}}c++;o++}return p(t,"")};e.exports=function(e){var t,i,n=[],r=m(f(v(e),o,"."),".");for(t=0;t<r.length;t++){i=r[t];g(n,c(s,i)?"xn--"+encode(i):i)}return p(n,".")}},(e,t,i)=>{"use strict";i(8);var n=i(65),r=i(2),s=i(39),o=i(11),a=i(33),l=i(141),c=i(68),h=i(150),d=i(80),u=i(76),p=i(59),g=i(98),f=i(7),m=i(22),v=i(104),w=i(87),_=i(31),y=i(6),b=i(86),P=i(30),S=i(63),E=i(121),x=i(122),C=i(106),T=i(17),I=i(151),M=T("iterator"),L="URLSearchParams",A="URLSearchParamsIterator",D=p.set,k=p.getterFor(L),O=p.getterFor(A),R=Object.getOwnPropertyDescriptor,safeGetBuiltIn=function(e){if(!a)return r[e];var t=R(r,e);return t&&t.value},B=safeGetBuiltIn("fetch"),N=safeGetBuiltIn("Request"),V=safeGetBuiltIn("Headers"),U=N&&N.prototype,W=V&&V.prototype,H=r.RegExp,G=r.TypeError,z=r.decodeURIComponent,j=r.encodeURIComponent,q=o("".charAt),K=o([].join),X=o([].push),Y=o("".replace),Z=o([].shift),Q=o([].splice),J=o("".split),$=o("".slice),ee=/\+/g,te=Array(4),percentSequence=function(e){return te[e-1]||(te[e-1]=H("((?:%[\\da-f]{2}){"+e+"})","gi"))},percentDecode=function(e){try{return z(e)}catch(t){return e}},deserialize=function(e){var t=Y(e,ee," "),i=4;try{return z(t)}catch(e){for(;i;)t=Y(t,percentSequence(i--),percentDecode);return t}},ie=/[!'()~]|%20/g,ne={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(e){return ne[e]},serialize=function(e){return Y(j(e),ie,replacer)},re=u((function Iterator(e,t){D(this,{type:A,iterator:E(k(e).entries),kind:t})}),"Iterator",(function next(){var e=O(this),t=e.kind,i=e.iterator.next(),n=i.value;i.done||(i.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]);return i}),!0),URLSearchParamsState=function(e){this.entries=[];this.url=null;void 0!==e&&(y(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===q(e,0)?$(e,1):e:b(e)))};URLSearchParamsState.prototype={type:L,bindURL:function(e){this.url=e;this.update()},parseObject:function(e){var t,i,n,r,o,a,l,c=x(e);if(c){i=(t=E(e,c)).next;for(;!(n=s(i,t)).done;){o=(r=E(_(n.value))).next;if((a=s(o,r)).done||(l=s(o,r)).done||!s(o,r).done)throw G("Expected sequence with length 2");X(this.entries,{key:b(a.value),value:b(l.value)})}}else for(var h in e)m(e,h)&&X(this.entries,{key:h,value:b(e[h])})},parseQuery:function(e){if(e)for(var t,i,n=J(e,"&"),r=0;r<n.length;)if((t=n[r++]).length){i=J(t,"=");X(this.entries,{key:deserialize(Z(i)),value:deserialize(K(i,"="))})}},serialize:function(){for(var e,t=this.entries,i=[],n=0;n<t.length;){e=t[n++];X(i,serialize(e.key)+"="+serialize(e.value))}return K(i,"&")},update:function(){this.entries.length=0;this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var se=function URLSearchParams(){g(this,oe);var e=arguments.length>0?arguments[0]:void 0;D(this,new URLSearchParamsState(e))},oe=se.prototype;h(oe,{append:function append(e,t){C(arguments.length,2);var i=k(this);X(i.entries,{key:b(e),value:b(t)});i.updateURL()},delete:function(e){C(arguments.length,1);for(var t=k(this),i=t.entries,n=b(e),r=0;r<i.length;)i[r].key===n?Q(i,r,1):r++;t.updateURL()},get:function get(e){C(arguments.length,1);for(var t=k(this).entries,i=b(e),n=0;n<t.length;n++)if(t[n].key===i)return t[n].value;return null},getAll:function getAll(e){C(arguments.length,1);for(var t=k(this).entries,i=b(e),n=[],r=0;r<t.length;r++)t[r].key===i&&X(n,t[r].value);return n},has:function has(e){C(arguments.length,1);for(var t=k(this).entries,i=b(e),n=0;n<t.length;)if(t[n++].key===i)return!0;return!1},set:function set(e,t){C(arguments.length,1);for(var i,n=k(this),r=n.entries,s=!1,o=b(e),a=b(t),l=0;l<r.length;l++)if((i=r[l]).key===o)if(s)Q(r,l--,1);else{s=!0;i.value=a}s||X(r,{key:o,value:a});n.updateURL()},sort:function sort(){var e=k(this);I(e.entries,(function(e,t){return e.key>t.key?1:-1}));e.updateURL()},forEach:function forEach(e){for(var t,i=k(this).entries,n=v(e,arguments.length>1?arguments[1]:void 0),r=0;r<i.length;)n((t=i[r++]).value,t.key,this)},keys:function keys(){return new re(this,"keys")},values:function values(){return new re(this,"values")},entries:function entries(){return new re(this,"entries")}},{enumerable:!0});c(oe,M,oe.entries,{name:"entries"});c(oe,"toString",(function toString(){return k(this).serialize()}),{enumerable:!0});d(se,L);n({global:!0,constructor:!0,forced:!l},{URLSearchParams:se});if(!l&&f(V)){var ae=o(W.has),le=o(W.set),wrapRequestOptions=function(e){if(y(e)){var t,i=e.body;if(w(i)===L){t=e.headers?new V(e.headers):new V;ae(t,"content-type")||le(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8");return P(e,{body:S(0,b(i)),headers:S(0,t)})}}return e};f(B)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function fetch(e){return B(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})}});if(f(N)){var ce=function Request(e){g(this,U);return new N(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};U.constructor=ce;ce.prototype=U;n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ce})}}e.exports={URLSearchParams:se,getState:k}},(e,t,i)=>{var n=i(68);e.exports=function(e,t,i){for(var r in t)n(e,r,t[r],i);return e}},(e,t,i)=>{var n=i(147),r=Math.floor,mergeSort=function(e,t){var i=e.length,s=r(i/2);return i<8?insertionSort(e,t):merge(e,mergeSort(n(e,0,s),t),mergeSort(n(e,s),t),t)},insertionSort=function(e,t){for(var i,n,r=e.length,s=1;s<r;){n=s;i=e[s];for(;n&&t(e[n-1],i)>0;)e[n]=e[--n];n!==s++&&(e[n]=i)}return e},merge=function(e,t,i,n){for(var r=t.length,s=i.length,o=0,a=0;o<r||a<s;)e[o+a]=o<r&&a<s?n(t[o],i[a])<=0?t[o++]:i[a++]:o<r?t[o++]:i[a++];return e};e.exports=mergeSort},(e,t,i)=>{i(149)},(e,t,i)=>{"use strict";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.RendererType=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.AutoPrintRegExp=void 0;t.apiPageLayoutToViewerModes=function apiPageLayoutToViewerModes(e){let t=s.VERTICAL,i=o.NONE;switch(e){case"SinglePage":t=s.PAGE;break;case"OneColumn":break;case"TwoPageLeft":t=s.PAGE;case"TwoColumnLeft":i=o.ODD;break;case"TwoPageRight":t=s.PAGE;case"TwoColumnRight":i=o.EVEN}return{scrollMode:t,spreadMode:i}};t.apiPageModeToSidebarView=function apiPageModeToSidebarView(e){switch(e){case"UseNone":return r.NONE;case"UseThumbs":return r.THUMBS;case"UseOutlines":return r.OUTLINE;case"UseAttachments":return r.ATTACHMENTS;case"UseOC":return r.LAYERS}return r.NONE};t.approximateFraction=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,r=0,s=1,o=1,a=1;for(;;){const e=r+o,t=s+a;if(t>8)break;if(i<=e/t){o=e;a=t}else{r=e;s=t}}n=i-r/s<o/a-i?i===e?[r,s]:[s,r]:i===e?[o,a]:[a,o];return n};t.backtrackBeforeAllVisibleElements=backtrackBeforeAllVisibleElements;t.docStyle=void 0;t.getActiveOrFocusedElement=function getActiveOrFocusedElement(){let e=document,t=e.activeElement||e.querySelector(":focus");for(;null!==(i=t)&&void 0!==i&&i.shadowRoot;){var i;e=t.shadowRoot;t=e.activeElement||e.querySelector(":focus")}return t};t.getPageSizeInches=function getPageSizeInches(e){let{view:t,userUnit:i,rotate:n}=e;const[r,s,o,a]=t,l=n%180!=0,c=(o-r)/72*i,h=(a-s)/72*i;return{width:l?h:c,height:l?c:h}};t.getVisibleElements=function getVisibleElements(e){let{scrollEl:t,views:i,sortByVisibility:r=!1,horizontal:s=!1,rtl:o=!1}=e;const a=t.scrollTop,l=a+t.clientHeight,c=t.scrollLeft,h=c+t.clientWidth;const d=[],u=new Set,p=i.length;let g=(0,n.binarySearchFirstItem)(i,s?function isElementNextAfterViewHorizontally(e){const t=e.div,i=t.offsetLeft+t.clientLeft,n=i+t.clientWidth;return o?i<h:n>c}:function isElementBottomAfterViewTop(e){const t=e.div;return t.offsetTop+t.clientTop+t.clientHeight>a});g>0&&g<p&&!s&&(g=backtrackBeforeAllVisibleElements(g,i,a));let f=s?h:-1;for(let e=g;e<p;e++){const t=i[e],n=t.div,r=n.offsetLeft+n.clientLeft,o=n.offsetTop+n.clientTop,p=n.clientWidth,g=n.clientHeight,m=r+p,v=o+g;if(-1===f)v>=l&&(f=v);else if((s?r:o)>f)break;if(v<=a||o>=l||m<=c||r>=h)continue;const w=Math.max(0,a-o)+Math.max(0,v-l),_=Math.max(0,c-r)+Math.max(0,m-h),y=(p-_)/p,b=(g-w)/g*y*100|0;d.push({id:t.id,x:r,y:o,view:t,percent:b,widthPercent:100*y|0});u.add(t.id)}const m=d[0],v=d.at(-1);r&&d.sort((function(e,t){const i=e.percent-t.percent;return Math.abs(i)>.001?-i:e.id-t.id}));return{first:m,last:v,views:d,ids:u}};t.isPortraitOrientation=function isPortraitOrientation(e){return e.width<=e.height};t.isValidRotation=function isValidRotation(e){return Number.isInteger(e)&&e%90==0};t.isValidScrollMode=function isValidScrollMode(e){return Number.isInteger(e)&&Object.values(s).includes(e)&&e!==s.UNKNOWN};t.isValidSpreadMode=function isValidSpreadMode(e){return Number.isInteger(e)&&Object.values(o).includes(e)&&e!==o.UNKNOWN};t.noContextMenuHandler=function noContextMenuHandler(e){e.preventDefault()};t.normalizeWheelEventDelta=function normalizeWheelEventDelta(e){let t=normalizeWheelEventDirection(e);0===e.deltaMode?t/=900:1===e.deltaMode&&(t/=30);return t};t.normalizeWheelEventDirection=normalizeWheelEventDirection;t.parseQueryString=function parseQueryString(e){const t=new Map;for(const[i,n]of new URLSearchParams(e))t.set(i.toLowerCase(),n);return t};t.removeNullCharacters=function removeNullCharacters(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof e){console.error("The argument must be a string.");return e}t&&(e=e.replace(l," "));return e.replace(a,"")};t.roundToDivide=function roundToDivide(e,t){const i=e%t;return 0===i?e:Math.round(e-i+t)};t.scrollIntoView=function scrollIntoView(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.classList.contains("stf__item")){Window.ngxConsole.log("don't scroll in book mode");return}let r=e.offsetParent;if(!r){Window.ngxConsole.error("offsetParent is not set -- cannot scroll");return}let s=e.offsetTop+e.clientTop,o=e.offsetLeft+e.clientLeft;for(;r.clientHeight===r.scrollHeight&&r.clientWidth===r.scrollWidth||i&&(r.classList.contains("markedContent")||"hidden"===getComputedStyle(r).overflow);){s+=r.offsetTop;o+=r.offsetLeft;r=r.offsetParent;if(!r){if(n&&document.body.clientHeight>s){s-=32;window.scrollTo(window.scrollX,s)}return}}if(t){void 0!==t.top&&(s+=t.top);if(void 0!==t.left){o+=t.left;r.scrollLeft=o}}r.scrollTop=s};t.watchScroll=function watchScroll(e,t){const debounceScroll=function(r){n||(n=window.requestAnimationFrame((function viewAreaElementScrolled(){n=null;const r=e.scrollLeft,s=i.lastX;r!==s&&(i.right=r>s);i.lastX=r;const o=e.scrollTop,a=i.lastY;o!==a&&(i.down=o>a);i.lastY=o;t(i)})))},i={right:!0,down:!0,lastX:e.scrollLeft,lastY:e.scrollTop,_eventHandler:debounceScroll};let n=null;e.addEventListener("scroll",debounceScroll,!0);return i};i(1);i(152);i(84);i(132);i(154);i(131);i(94);var n=i(155);function _classPrivateFieldInitSpec(e,t,i){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.set(e,i)}function _classPrivateFieldGet(e,t){return function _classApplyDescriptorGet(e,t){if(t.get)return t.get.call(e);return t.value}(e,_classExtractFieldDescriptor(e,t,"get"))}function _classPrivateFieldSet(e,t,i){!function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}(e,_classExtractFieldDescriptor(e,t,"set"),i);return i}function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}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 r={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4};t.SidebarView=r;t.RendererType={CANVAS:"canvas",SVG:"svg"};t.TextLayerMode={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2};const s={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3};t.ScrollMode=s;const o={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};t.SpreadMode=o;t.AutoPrintRegExp=/\bprint\s*\(/;t.OutputScale=class OutputScale{constructor(){const e=window.devicePixelRatio||1;this.sx=e;this.sy=e}get scaled(){return 1!==this.sx||1!==this.sy}};const a=/\x00/g,l=/[\x01-\x1F]/g;function backtrackBeforeAllVisibleElements(e,t,i){if(e<2)return e;let n=t[e].div,r=n.offsetTop+n.clientTop;if(r>=i){n=t[e-1].div;r=n.offsetTop+n.clientTop}for(let i=e-2;i>=0;--i){n=t[i].div;if(n.offsetTop+n.clientTop+n.clientHeight<=r)break;e=i}return e}function normalizeWheelEventDirection(e){let t=Math.hypot(e.deltaX,e.deltaY);const i=Math.atan2(e.deltaY,e.deltaX);-.25*Math.PI<i&&i<.75*Math.PI&&(t=-t);return t}const c=new Promise((function(e){window.ngxZone.runOutsideAngular((()=>{window.requestAnimationFrame(e)}))}));t.animationStarted=c;const h=document.documentElement.style;t.docStyle=h;var d=new WeakMap,u=new WeakMap,p=new WeakMap;t.ProgressBar=class ProgressBar{constructor(e){_classPrivateFieldInitSpec(this,d,{writable:!0,value:null});_classPrivateFieldInitSpec(this,u,{writable:!0,value:0});_classPrivateFieldInitSpec(this,p,{writable:!0,value:!0});if(arguments.length>1)throw new Error("ProgressBar no longer accepts any additional options, please use CSS rules to modify its appearance instead.");const t=document.getElementById(e);_classPrivateFieldSet(this,d,t.classList)}get percent(){return _classPrivateFieldGet(this,u)}set percent(e){_classPrivateFieldSet(this,u,function clamp(e,t,i){return Math.min(Math.max(e,t),i)}(e,0,100));if(isNaN(e))_classPrivateFieldGet(this,d).add("indeterminate");else{_classPrivateFieldGet(this,d).remove("indeterminate");h.setProperty("--progressBar-percent","".concat(_classPrivateFieldGet(this,u),"%"))}}setWidth(e){if(!e)return;const t=e.parentNode.offsetWidth-e.offsetWidth;t>0&&h.setProperty("--progressBar-end-offset","".concat(t,"px"))}hide(){if(_classPrivateFieldGet(this,p)){_classPrivateFieldSet(this,p,!1);_classPrivateFieldGet(this,d).add("hidden")}}show(){if(!_classPrivateFieldGet(this,p)){_classPrivateFieldSet(this,p,!0);_classPrivateFieldGet(this,d).remove("hidden")}}}},(e,t,i)=>{var n=i(65),r=Math.hypot,s=Math.abs,o=Math.sqrt;n({target:"Math",stat:!0,arity:2,forced:!!r&&r(1/0,NaN)!==1/0},{hypot:function hypot(e,t){for(var i,n,r=0,a=0,l=arguments.length,c=0;a<l;)if(c<(i=s(arguments[a++]))){r=r*(n=c/i)*n+1;c=i}else r+=i>0?(n=i/c)*n:i;return c===1/0?1/0:c*o(r)}})},e=>{"use strict";e.exports=window["pdfjs-dist/build/pdf"]},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.WaitOnType=t.EventBus=t.AutomationEventBus=void 0;t.waitOnEventOrTimeout=function waitOnEventOrTimeout(e){let{target:t,name:i,delay:r=0}=e;return new Promise((function(e,s){if("object"!=typeof t||!i||"string"!=typeof i||!(Number.isInteger(r)&&r>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function handler(n){t instanceof EventBus?t._off(i,o):t.removeEventListener(i,o);l&&clearTimeout(l);e(n)}const o=handler.bind(null,n.EVENT);t instanceof EventBus?t._on(i,o):t.addEventListener(i,o);const a=handler.bind(null,n.TIMEOUT),l=setTimeout(a,r)}))};i(94);i(1);const n={EVENT:"event",TIMEOUT:"timeout"};t.WaitOnType=n;class EventBus{constructor(){this._listeners=Object.create(null)}on(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._on(e,t,{external:!0,once:null==i?void 0:i.once})}off(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._off(e,t,{external:!0,once:null==i?void 0:i.once})}dispatch(e,t){const i=this._listeners[e];if(!i||0===i.length)return;let n;for(const{listener:r,external:s,once:o}of i.slice(0)){o&&this._off(e,r);s?(n||(n=[])).push(r):r(t)}if(n){for(const e of n)e(t);n=null}}_on(e,t){var i;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;((i=this._listeners)[e]||(i[e]=[])).push({listener:t,external:!0===(null==n?void 0:n.external),once:!0===(null==n?void 0:n.once)})}_off(e,t){const i=this._listeners[e];if(i)for(let e=0,n=i.length;e<n;e++)if(i[e].listener===t){i.splice(e,1);return}}}t.EventBus=EventBus;t.AutomationEventBus=class AutomationEventBus extends EventBus{dispatch(e,t){throw new Error("Not implemented: AutomationEventBus.dispatch")}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFCursorTools=t.CursorTool=void 0;i(94);i(1);var n=i(158),r=i(153);function _classPrivateMethodInitSpec(e,t){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.add(e)}function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}const s={SELECT:0,HAND:1,ZOOM:2};t.CursorTool=s;var o=new WeakSet,a=new WeakSet;t.PDFCursorTools=class PDFCursorTools{constructor(e){let{container:t,eventBus:i,cursorToolOnLoad:r=s.SELECT}=e;_classPrivateMethodInitSpec(this,a);_classPrivateMethodInitSpec(this,o);this.container=t;this.eventBus=i;this.active=s.SELECT;this.activeBeforePresentationMode=null;this.handTool=new n.GrabToPan({element:this.container});_classPrivateMethodGet(this,a,_addEventListeners2).call(this);Promise.resolve().then((()=>{this.switchTool(r)}))}get activeTool(){return this.active}switchTool(e){if(null!==this.activeBeforePresentationMode)return;if(e===this.active)return;const disableActiveTool=()=>{switch(this.active){case s.SELECT:break;case s.HAND:this.handTool.deactivate();case s.ZOOM:}};switch(e){case s.SELECT:disableActiveTool();break;case s.HAND:disableActiveTool();this.handTool.activate();break;case s.ZOOM:default:Window.ngxConsole.error('switchTool: "'.concat(e,'" is an unsupported value.'));return}this.active=e;_classPrivateMethodGet(this,o,_dispatchEvent2).call(this)}};function _dispatchEvent2(){this.eventBus.dispatch("cursortoolchanged",{source:this,tool:this.active})}function _addEventListeners2(){this.eventBus._on("switchcursortool",(e=>{this.switchTool(e.tool)}));this.eventBus._on("presentationmodechanged",(e=>{switch(e.state){case r.PresentationModeState.FULLSCREEN:{const e=this.active;this.switchTool(s.SELECT);this.activeBeforePresentationMode=e;break}case r.PresentationModeState.NORMAL:{const e=this.activeBeforePresentationMode;this.activeBeforePresentationMode=null;this.switchTool(e);break}}}))}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.GrabToPan=void 0;i(1);function _classPrivateMethodInitSpec(e,t){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.add(e)}function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}const n="grab-to-pan-grab";var r=new WeakSet,s=new WeakSet,o=new WeakSet;t.GrabToPan=class GrabToPan{constructor(e){_classPrivateMethodInitSpec(this,o);_classPrivateMethodInitSpec(this,s);_classPrivateMethodInitSpec(this,r);this.element=e.element;this.document=e.element.ownerDocument;"function"==typeof e.ignoreTarget&&(this.ignoreTarget=e.ignoreTarget);this.onActiveChanged=e.onActiveChanged;this.activate=this.activate.bind(this);this.deactivate=this.deactivate.bind(this);this.toggle=this.toggle.bind(this);this._onMouseDown=_classPrivateMethodGet(this,r,_onMouseDown2).bind(this);this._onMouseMove=_classPrivateMethodGet(this,s,_onMouseMove2).bind(this);this._endPan=_classPrivateMethodGet(this,o,_endPan2).bind(this);(this.overlay=document.createElement("div")).className="grab-to-pan-grabbing"}activate(){if(!this.active){var e;this.active=!0;this.element.addEventListener("mousedown",this._onMouseDown);this.element.classList.add(n);null===(e=this.onActiveChanged)||void 0===e||e.call(this,!0)}}deactivate(){if(this.active){var e;this.active=!1;this.element.removeEventListener("mousedown",this._onMouseDown);this._endPan();this.element.classList.remove(n);null===(e=this.onActiveChanged)||void 0===e||e.call(this,!1)}}toggle(){this.active?this.deactivate():this.activate()}ignoreTarget(e){return!!document.querySelector(".stf__item")||e.matches("a[href], a[href] *, input, textarea, button, button *, select, option")}};function _onMouseDown2(e){if(0!==e.button||this.ignoreTarget(e.target))return;if(e.originalTarget)try{e.originalTarget.tagName}catch(e){return}this.scrollLeftStart=this.element.scrollLeft;this.scrollTopStart=this.element.scrollTop;this.clientXStart=e.clientX;this.clientYStart=e.clientY;if(isOverPerfectScrollbar(this.clientXStart,this.clientYStart,"ps__rail-x"))return;if(isOverPerfectScrollbar(this.clientXStart,this.clientYStart,"ps__rail-y"))return;this.document.addEventListener("mousemove",this._onMouseMove,!0);this.document.addEventListener("mouseup",this._endPan,!0);this.element.addEventListener("scroll",this._endPan,!0);e.preventDefault();e.stopPropagation();const t=document.activeElement;t&&!t.contains(e.target)&&t.blur()}function _onMouseMove2(e){this.element.removeEventListener("scroll",this._endPan,!0);if(!(1&e.buttons)){this._endPan();return}const t=e.clientX-this.clientXStart,i=e.clientY-this.clientYStart,n=this.scrollTopStart-i,r=this.scrollLeftStart-t;if(this.element.scrollTo)this.element.scrollTo({top:n,left:r,behavior:"instant"});else{this.element.scrollTop=n;this.element.scrollLeft=r}this.overlay.parentNode||document.body.append(this.overlay)}function _endPan2(){this.element.removeEventListener("scroll",this._endPan,!0);this.document.removeEventListener("mousemove",this._onMouseMove,!0);this.document.removeEventListener("mouseup",this._endPan,!0);this.overlay.remove()}function isOverPerfectScrollbar(e,t,i){const n=document.getElementsByClassName(i);if(n&&1===n.length){var{top:r,right:s,bottom:o,left:a}=n[0].getBoundingClientRect();if(t>=r&&t<=o&&e<=s&&e>=a)return!0}return!1}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SimpleLinkService=t.PDFLinkService=t.LinkTarget=void 0;i(1);i(94);i(131);i(84);i(132);var n=i(153);function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classStaticPrivateMethodGet(e,t,i){!function _classCheckPrivateStaticAccess(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}(e,t);return i}function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}function _classPrivateFieldGet(e,t){var i=function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}(e,t,"get");return function _classApplyDescriptorGet(e,t){if(t.get)return t.get.call(e);return t.value}(e,i)}const r="noopener noreferrer nofollow",s={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};t.LinkTarget=s;function addLinkAttributes(e){let{url:t,target:i,rel:o,enabled:a=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||"string"!=typeof t)throw new Error('A valid "url" parameter must provided.');const l=(0,n.removeNullCharacters)(t);if(a)e.href=e.title=l;else{e.href="";e.title="Disabled: ".concat(l);e.onclick=()=>!1}let c="";switch(i){case s.NONE:break;case s.SELF:c="_self";break;case s.BLANK:c="_blank";break;case s.PARENT:c="_parent";break;case s.TOP:c="_top"}e.target=c;e.rel="string"==typeof o?o:r}var o=new WeakMap,a=new WeakSet;class PDFLinkService{constructor(){let{eventBus:e,externalLinkTarget:t=null,externalLinkRel:i=null,ignoreDestinationZoom:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t);t.add(e)}(this,a);!function _classPrivateFieldInitSpec(e,t,i){_checkPrivateRedeclaration(e,t);t.set(e,i)}(this,o,{writable:!0,value:new Map});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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.baseUrl=t;this.pdfDocument=e;_classPrivateFieldGet(this,o).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}async goToDestination(e){if(!this.pdfDocument)return;let t,i;if("string"==typeof e){t=e;i=await this.pdfDocument.getDestination(e)}else{t=null;i=await e}Array.isArray(i)?_classPrivateMethodGet(this,a,_goToDestinationHelper2).call(this,e,t,i):Window.ngxConsole.error('PDFLinkService.goToDestination: "'.concat(i,'" is not ')+'a valid destination array, for dest="'.concat(e,'".'))}goToPage(e){if(!this.pdfDocument)return;const t="string"==typeof e&&this.pdfViewer.pageLabelToPageNumber(e)||0|e;if(Number.isInteger(t)&&t>0&&t<=this.pagesCount){if(this.pdfHistory){this.pdfHistory.pushCurrentPosition();this.pdfHistory.pushPage(t)}this.pdfViewer.scrollPageIntoView({pageNumber:t})}else Window.ngxConsole.error('PDFLinkService.goToPage: "'.concat(e,'" is not a valid page.'))}addLinkAttributes(e,t){addLinkAttributes(e,{url:t,target:arguments.length>2&&void 0!==arguments[2]&&arguments[2]?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||"")+e}setHash(e){if(!this.pdfDocument)return;let t,i;if(e.includes("=")){const r=(0,n.parseQueryString)(e);r.has("search")&&this.eventBus.dispatch("findfromurlhash",{source:this,query:r.get("search").replace(/"/g,""),phraseSearch:"true"===r.get("phrase")});r.has("page")&&(t=0|r.get("page")||1);if(r.has("zoom")){const e=r.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?Window.ngxConsole.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):i=[null,{name:t},0|e[1],0|e[2],0|e[3],0|e[4]]:Window.ngxConsole.error('PDFLinkService.setHash: "'.concat(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);r.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:r.get("pagemode")});r.has("nameddest")&&this.goToDestination(r.get("nameddest"))}else{i=unescape(e);try{i=JSON.parse(i);Array.isArray(i)||(i=i.toString())}catch(e){}if("string"==typeof i||_classStaticPrivateMethodGet(PDFLinkService,PDFLinkService,_isValidExplicitDestination).call(PDFLinkService,i)){this.goToDestination(i);return}Window.ngxConsole.error('PDFLinkService.setHash: "'.concat(unescape(e),'" is not a valid destination.'))}}executeNamedAction(e){var t,i;switch(e){case"GoBack":null===(t=this.pdfHistory)||void 0===t||t.back();break;case"GoForward":null===(i=this.pdfHistory)||void 0===i||i.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})}cachePageRef(e,t){if(!t)return;const i=0===t.gen?"".concat(t.num,"R"):"".concat(t.num,"R").concat(t.gen);_classPrivateFieldGet(this,o).set(i,e)}_cachedPageNumber(e){if(!e)return null;const t=0===e.gen?"".concat(e.num,"R"):"".concat(e.num,"R").concat(e.gen);return _classPrivateFieldGet(this,o).get(t)||null}isPageVisible(e){return this.pdfViewer.isPageVisible(e)}isPageCached(e){return this.pdfViewer.isPageCached(e)}}t.PDFLinkService=PDFLinkService;function _goToDestinationHelper2(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0;const n=i[0];let r;if("object"==typeof n&&null!==n){r=this._cachedPageNumber(n);if(!r){this.pdfDocument.getPageIndex(n).then((r=>{this.cachePageRef(r+1,n);_classPrivateMethodGet(this,a,_goToDestinationHelper2).call(this,e,t,i)})).catch((()=>{Window.ngxConsole.error('PDFLinkService.#goToDestinationHelper: "'.concat(n,'" is not ')+'a valid page reference, for dest="'.concat(e,'".'))}));return}}else{if(!Number.isInteger(n)){Window.ngxConsole.error('PDFLinkService.#goToDestinationHelper: "'.concat(n,'" is not ')+'a valid destination reference, for dest="'.concat(e,'".'));return}r=n+1}if(!r||r<1||r>this.pagesCount)Window.ngxConsole.error('PDFLinkService.#goToDestinationHelper: "'.concat(r,'" is not ')+'a valid page number, for dest="'.concat(e,'".'));else{if(this.pdfHistory){this.pdfHistory.pushCurrentPosition();this.pdfHistory.push({namedDest:t,explicitDest:i,pageNumber:r})}this.pdfViewer.scrollPageIntoView({pageNumber:r,destArray:i,ignoreDestinationZoom:this._ignoreDestinationZoom})}}function _isValidExplicitDestination(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 r=!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;r=!1;break;default:return!1}for(let i=2;i<t;i++){const t=e[i];if(!("number"==typeof t||r&&null===t))return!1}return!0}t.SimpleLinkService=class SimpleLinkService{constructor(){this.externalLinkEnabled=!0}get pagesCount(){return 0}get page(){return 0}set page(e){}get rotation(){return 0}set rotation(e){}async goToDestination(e){}goToPage(e){}addLinkAttributes(e,t){addLinkAttributes(e,{url:t,enabled:this.externalLinkEnabled})}getDestinationHash(e){return"#"}getAnchorUrl(e){return"#"}setHash(e){}executeNamedAction(e){}cachePageRef(e,t){}isPageVisible(e){return!0}isPageCached(e){return!0}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.AnnotationEditorParams=void 0;i(1);var n=i(155);function _classPrivateMethodInitSpec(e,t){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.add(e)}var r=new WeakSet;t.AnnotationEditorParams=class AnnotationEditorParams{constructor(e,t){_classPrivateMethodInitSpec(this,r);this.eventBus=t;(function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i})(this,r,_bindListeners2).call(this,e)}};function _bindListeners2(e){let{editorFreeTextFontSize:t,editorFreeTextColor:i,editorInkColor:r,editorInkThickness:s,editorInkOpacity:o}=e;t.addEventListener("input",(e=>{this.eventBus.dispatch("switchannotationeditorparams",{source:this,type:n.AnnotationEditorParamsType.FREETEXT_SIZE,value:t.valueAsNumber})}));i.addEventListener("input",(e=>{this.eventBus.dispatch("switchannotationeditorparams",{source:this,type:n.AnnotationEditorParamsType.FREETEXT_COLOR,value:i.value})}));r.addEventListener("input",(e=>{this.eventBus.dispatch("switchannotationeditorparams",{source:this,type:n.AnnotationEditorParamsType.INK_COLOR,value:r.value})}));s.addEventListener("input",(e=>{this.eventBus.dispatch("switchannotationeditorparams",{source:this,type:n.AnnotationEditorParamsType.INK_THICKNESS,value:s.valueAsNumber})}));o.addEventListener("input",(e=>{this.eventBus.dispatch("switchannotationeditorparams",{source:this,type:n.AnnotationEditorParamsType.INK_OPACITY,value:o.valueAsNumber})}));this.eventBus._on("annotationeditorparamschanged",(e=>{for(const[a,l]of e.details)switch(a){case n.AnnotationEditorParamsType.FREETEXT_SIZE:t.value=l;break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:i.value=l;break;case n.AnnotationEditorParamsType.INK_COLOR:r.value=l;break;case n.AnnotationEditorParamsType.INK_THICKNESS:s.value=l;break;case n.AnnotationEditorParamsType.INK_OPACITY:o.value=l}}))}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.OverlayManager=void 0;i(1);i(94);function _classPrivateFieldInitSpec(e,t,i){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.set(e,i)}function _classPrivateFieldSet(e,t,i){!function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}(e,_classExtractFieldDescriptor(e,t,"set"),i);return i}function _classPrivateFieldGet(e,t){return function _classApplyDescriptorGet(e,t){if(t.get)return t.get.call(e);return t.value}(e,_classExtractFieldDescriptor(e,t,"get"))}function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}var n=new WeakMap,r=new WeakMap;t.OverlayManager=class OverlayManager{constructor(){_classPrivateFieldInitSpec(this,n,{writable:!0,value:new WeakMap});_classPrivateFieldInitSpec(this,r,{writable:!0,value:null})}get active(){return _classPrivateFieldGet(this,r)}async register(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("object"!=typeof e)throw new Error("Not enough parameters.");if(_classPrivateFieldGet(this,n).has(e))throw new Error("The overlay is already registered.");_classPrivateFieldGet(this,n).set(e,{canForceClose:t});if(!e.showModal){i(162).registerDialog(e);if(!this._dialogPolyfillCSS){this._dialogPolyfillCSS=!0;const e=document.createElement("style");e.textContent="dialog {\n position: absolute;\n left: 0; right: 0;\n width: -moz-fit-content;\n width: -webkit-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: -webkit-fit-content;\n height: fit-content;\n margin: auto;\n border: solid;\n padding: 1em;\n background: white;\n color: black;\n display: block;\n}\n\ndialog:not([open]) {\n display: none;\n}\n\ndialog + .backdrop {\n position: fixed;\n top: 0; right: 0; bottom: 0; left: 0;\n background: rgba(0,0,0,0.1);\n}\n\n._dialog_overlay {\n position: fixed;\n top: 0; right: 0; bottom: 0; left: 0;\n}\n\ndialog.fixed {\n position: fixed;\n top: 50%;\n transform: translate(0, -50%);\n}";document.head.prepend(e)}}e.addEventListener("cancel",(e=>{_classPrivateFieldSet(this,r,null)}))}async unregister(e){if(!_classPrivateFieldGet(this,n).has(e))throw new Error("The overlay does not exist.");if(_classPrivateFieldGet(this,r)===e)throw new Error("The overlay cannot be removed while it is active.");_classPrivateFieldGet(this,n).delete(e)}async open(e){if(!_classPrivateFieldGet(this,n).has(e))throw new Error("The overlay does not exist.");if(_classPrivateFieldGet(this,r)){if(_classPrivateFieldGet(this,r)===e)throw new Error("The overlay is already active.");if(!_classPrivateFieldGet(this,n).get(e).canForceClose)throw new Error("Another overlay is currently active.");await this.close()}_classPrivateFieldSet(this,r,e);e.showModal();e.classList.remove("hidden")}async close(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_classPrivateFieldGet(this,r);if(!_classPrivateFieldGet(this,n).has(e))throw new Error("The overlay does not exist.");if(!_classPrivateFieldGet(this,r))throw new Error("The overlay is currently not active.");if(_classPrivateFieldGet(this,r)!==e)throw new Error("Another overlay is currently active.");e.close();_classPrivateFieldSet(this,r,null)}}},e=>{"use strict";e.exports=function(){var e=window.CustomEvent;e&&"object"!=typeof e||((e=function CustomEvent(e,t){t=t||{};var i=document.createEvent("CustomEvent");i.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail||null);return i}).prototype=window.Event.prototype);function safeDispatchEvent(e,t){var i="on"+t.type.toLowerCase();"function"==typeof e[i]&&e[i](t);return e.dispatchEvent(t)}function createsStackingContext(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),invalid=function(e,i){return!(void 0===t[e]||t[e]===i)};if(t.opacity<1||invalid("zIndex","auto")||invalid("transform","none")||invalid("mixBlendMode","normal")||invalid("filter","none")||invalid("perspective","none")||"isolate"===t.isolation||"fixed"===t.position||"touch"===t.webkitOverflowScrolling)return!0;e=e.parentElement}return!1}function findNearestDialog(e){for(;e;){if("dialog"===e.localName)return e;e=e.parentElement?e.parentElement:e.parentNode?e.parentNode.host:null}return null}function safeBlur(e){for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;e&&e.blur&&e!==document.body&&e.blur()}function inNodeList(e,t){for(var i=0;i<e.length;++i)if(e[i]===t)return!0;return!1}function isFormMethodDialog(e){return!(!e||!e.hasAttribute("method"))&&"dialog"===e.getAttribute("method").toLowerCase()}function findFocusableElementWithin(e){var t=["button","input","keygen","select","textarea"].map((function(e){return e+":not([disabled])"}));t.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=e.querySelector(t.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var n=e.querySelectorAll("*"),r=0;r<n.length&&!(n[r].tagName&&n[r].shadowRoot&&(i=findFocusableElementWithin(n[r].shadowRoot)));r++);return i}function isConnected(e){return e.isConnected||document.body.contains(e)}function findFormSubmitter(e){if(e.submitter)return e.submitter;var i=e.target;if(!(i instanceof HTMLFormElement))return null;var n=t.formSubmitter;if(!n){var r=e.target;n=("getRootNode"in r&&r.getRootNode()||document).activeElement}return n&&n.form===i?n:null}function maybeHandleSubmit(e){if(!e.defaultPrevented){var i=e.target,n=t.imagemapUseValue,r=findFormSubmitter(e);null===n&&r&&(n=r.value);var s=findNearestDialog(i);if(s&&"dialog"===(r&&r.getAttribute("formmethod")||i.getAttribute("method"))){e.preventDefault();null!=n?s.close(n):s.close()}}}function dialogPolyfillInfo(e){this.dialog_=e;this.replacedStyleTop_=!1;this.openAsModal_=!1;e.hasAttribute("role")||e.setAttribute("role","dialog");e.show=this.show.bind(this);e.showModal=this.showModal.bind(this);e.close=this.close.bind(this);e.addEventListener("submit",maybeHandleSubmit,!1);"returnValue"in e||(e.returnValue="");if("MutationObserver"in window)new MutationObserver(this.maybeHideModal.bind(this)).observe(e,{attributes:!0,attributeFilter:["open"]});else{var t,i=!1,n=function(){i?this.downgradeModal():this.maybeHideModal();i=!1}.bind(this),delayModel=function(r){if(r.target===e){var s="DOMNodeRemoved";i|=r.type.substr(0,s.length)===s;window.clearTimeout(t);t=window.setTimeout(n,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach((function(t){e.addEventListener(t,delayModel)}))}Object.defineProperty(e,"open",{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,"open")});this.backdrop_=document.createElement("div");this.backdrop_.className="backdrop";this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this));this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this));this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}dialogPolyfillInfo.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&isConnected(this.dialog_)||this.downgradeModal()},downgradeModal:function(){if(this.openAsModal_){this.openAsModal_=!1;this.dialog_.style.zIndex="";if(this.replacedStyleTop_){this.dialog_.style.top="";this.replacedStyleTop_=!1}this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_);t.dm.removeDialog(this)}},setOpen:function(e){if(e)this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open","");else{this.dialog_.removeAttribute("open");this.maybeHideModal()}},backdropMouseEvent_:function(e){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild);t.tabIndex=-1;t.focus();this.dialog_.removeChild(t)}var i=document.createEvent("MouseEvents");i.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget);this.dialog_.dispatchEvent(i);e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector("[autofocus]:not([disabled])");!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_);e||(e=findFocusableElementWithin(this.dialog_));safeBlur(document.activeElement);e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=e;this.backdrop_.style.zIndex=t},show:function(){if(!this.dialog_.open){this.setOpen(!0);this.focus_()}},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!isConnected(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!t.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");createsStackingContext(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context");this.setOpen(!0);this.openAsModal_=!0;if(t.needsCentering(this.dialog_)){t.reposition(this.dialog_);this.replacedStyleTop_=!0}else this.replacedStyleTop_=!1;this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling);this.focus_()},close:function(t){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1);void 0!==t&&(this.dialog_.returnValue=t);var i=new e("close",{bubbles:!1,cancelable:!1});safeDispatchEvent(this.dialog_,i)}};var t={reposition:function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,i=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,i)+"px"},isInlinePositionSetByStylesheet:function(e){for(var t=0;t<document.styleSheets.length;++t){var i=document.styleSheets[t],n=null;try{n=i.cssRules}catch(e){}if(n)for(var r=0;r<n.length;++r){var s=n[r],o=null;try{o=document.querySelectorAll(s.selectorText)}catch(e){}if(o&&inNodeList(o,e)){var a=s.style.getPropertyValue("top"),l=s.style.getPropertyValue("bottom");if(a&&"auto"!==a||l&&"auto"!==l)return!0}}}return!1},needsCentering:function(e){return!("absolute"!==window.getComputedStyle(e).position||"auto"!==e.style.top&&""!==e.style.top||"auto"!==e.style.bottom&&""!==e.style.bottom||t.isInlinePositionSetByStylesheet(e))},forceRegisterDialog:function(e){(window.HTMLDialogElement||e.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",e);if("dialog"!==e.localName)throw new Error("Failed to register dialog: The element is not a dialog.");new dialogPolyfillInfo(e)},registerDialog:function(e){e.showModal||t.forceRegisterDialog(e)},DialogManager:function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div");this.overlay.className="_dialog_overlay";this.overlay.addEventListener("click",function(t){this.forwardTab_=void 0;t.stopPropagation();e([])}.bind(this));this.handleKey_=this.handleKey_.bind(this);this.handleFocus_=this.handleFocus_.bind(this);this.zIndexLow_=1e5;this.zIndexHigh_=100150;this.forwardTab_=void 0;"MutationObserver"in window&&(this.mo_=new MutationObserver((function(t){var i=[];t.forEach((function(e){for(var t,n=0;t=e.removedNodes[n];++n)if(t instanceof Element){"dialog"===t.localName&&i.push(t);i=i.concat(t.querySelectorAll("dialog"))}}));i.length&&e(i)})))}};t.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0);document.addEventListener("keydown",this.handleKey_);this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})};t.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0);document.removeEventListener("keydown",this.handleKey_);this.mo_&&this.mo_.disconnect()};t.DialogManager.prototype.updateStacking=function(){for(var e,t=this.zIndexHigh_,i=0;e=this.pendingDialogStack[i];++i){e.updateZIndex(--t,--t);0===i&&(this.overlay.style.zIndex=--t)}var n=this.pendingDialogStack[0];n?(n.dialog.parentNode||document.body).appendChild(this.overlay):this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)};t.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=findNearestDialog(e);){for(var t,i=0;t=this.pendingDialogStack[i];++i)if(t.dialog===e)return 0===i;e=e.parentElement}return!1};t.DialogManager.prototype.handleFocus_=function(e){var t=e.composedPath?e.composedPath()[0]:e.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement){e.preventDefault();e.stopPropagation();safeBlur(t);if(void 0!==this.forwardTab_){var i=this.pendingDialogStack[0];i.dialog.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?i.focus_():t!==document.documentElement&&document.documentElement.focus());return!1}}};t.DialogManager.prototype.handleKey_=function(t){this.forwardTab_=void 0;if(27===t.keyCode){t.preventDefault();t.stopPropagation();var i=new e("cancel",{bubbles:!1,cancelable:!0}),n=this.pendingDialogStack[0];n&&safeDispatchEvent(n.dialog,i)&&n.dialog.close()}else 9===t.keyCode&&(this.forwardTab_=!t.shiftKey)};t.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach((function(t){-1!==e.indexOf(t.dialog)?t.downgradeModal():t.maybeHideModal()}))};t.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;if(this.pendingDialogStack.length>=t)return!1;1===this.pendingDialogStack.unshift(e)&&this.blockDocument();this.updateStacking();return!0};t.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);if(-1!==t){this.pendingDialogStack.splice(t,1);0===this.pendingDialogStack.length&&this.unblockDocument();this.updateStacking()}};t.dm=new t.DialogManager;t.formSubmitter=null;t.imagemapUseValue=null;if(void 0===window.HTMLDialogElement){var i=document.createElement("form");i.setAttribute("method","dialog");if("dialog"!==i.method){var n=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(n){var r=n.get;n.get=function(){return isFormMethodDialog(this)?"dialog":r.call(this)};var s=n.set;n.set=function(e){return"string"==typeof e&&"dialog"===e.toLowerCase()?this.setAttribute("method",e):s.call(this,e)};Object.defineProperty(HTMLFormElement.prototype,"method",n)}}document.addEventListener("click",(function(e){t.formSubmitter=null;t.imagemapUseValue=null;if(!e.defaultPrevented){var i=e.target;"composedPath"in e&&(i=e.composedPath().shift()||i);if(i&&isFormMethodDialog(i.form)){if(!("submit"===i.type&&["button","input"].indexOf(i.localName)>-1)){if("input"!==i.localName||"image"!==i.type)return;t.imagemapUseValue=e.offsetX+","+e.offsetY}findNearestDialog(i)&&(t.formSubmitter=i)}}}),!1);document.addEventListener("submit",(function(e){var t=e.target;if(!findNearestDialog(t)){var i=findFormSubmitter(e);"dialog"===(i&&i.getAttribute("formmethod")||t.getAttribute("method"))&&e.preventDefault()}}));var o=HTMLFormElement.prototype.submit,replacementFormSubmit=function(){if(!isFormMethodDialog(this))return o.call(this);var e=findNearestDialog(this);e&&e.close()};HTMLFormElement.prototype.submit=replacementFormSubmit}return t}()},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PasswordPrompt=void 0;i(94);i(1);var n=i(155);function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t);t.add(e)}function _classPrivateFieldInitSpec(e,t,i){_checkPrivateRedeclaration(e,t);t.set(e,i)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldSet(e,t,i){!function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}(e,_classExtractFieldDescriptor(e,t,"set"),i);return i}function _classPrivateFieldGet(e,t){return function _classApplyDescriptorGet(e,t){if(t.get)return t.get.call(e);return t.value}(e,_classExtractFieldDescriptor(e,t,"get"))}function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}var r=new WeakMap,s=new WeakMap,o=new WeakSet,a=new WeakSet,l=new WeakSet;t.PasswordPrompt=class PasswordPrompt{constructor(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];_classPrivateMethodInitSpec(this,l);_classPrivateMethodInitSpec(this,a);_classPrivateMethodInitSpec(this,o);_classPrivateFieldInitSpec(this,r,{writable:!0,value:null});_classPrivateFieldInitSpec(this,s,{writable:!0,value:null});this.dialog=e.dialog;this.label=e.label;this.input=e.input;this.submitButton=e.submitButton;this.cancelButton=e.cancelButton;this.overlayManager=t;this.l10n=i;this._isViewerEmbedded=n;this.submitButton.addEventListener("click",_classPrivateMethodGet(this,o,_verify2).bind(this));this.cancelButton.addEventListener("click",_classPrivateMethodGet(this,a,_cancel2).bind(this));this.input.addEventListener("keydown",(e=>{13===e.keyCode&&_classPrivateMethodGet(this,o,_verify2).call(this)}));this.overlayManager.register(this.dialog,!0);this.dialog.addEventListener("close",_classPrivateMethodGet(this,a,_cancel2).bind(this))}async open(){await this.overlayManager.open(this.dialog);this.input.type="password";this.input.focus();const e=_classPrivateFieldGet(this,s)===n.PasswordResponses.INCORRECT_PASSWORD;this._isViewerEmbedded&&!e||this.input.focus();this.label.textContent=await this.l10n.get("password_".concat(e?"invalid":"label"))}async close(){if(this.overlayManager.active===this.dialog){this.overlayManager.close(this.dialog);this.input.value=""}}setUpdateCallback(e,t){_classPrivateFieldSet(this,r,e);_classPrivateFieldSet(this,s,t)}};function _verify2(){const e=this.input.value;(null==e?void 0:e.length)>0&&_classPrivateMethodGet(this,l,_invokeCallback2).call(this,e)}function _cancel2(){_classPrivateMethodGet(this,l,_invokeCallback2).call(this,new Error("PasswordPrompt cancelled."))}function _invokeCallback2(e){if(_classPrivateFieldGet(this,r)){this.close();this.input.value="";_classPrivateFieldGet(this,r).call(this,e);_classPrivateFieldSet(this,r,null)}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFAttachmentViewer=void 0;i(94);i(1);var n=i(155),r=i(165),s=i(156);function _classPrivateMethodInitSpec(e,t){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.add(e)}var o=new WeakSet;class PDFAttachmentViewer extends r.BaseTreeViewer{constructor(e){super(e);_classPrivateMethodInitSpec(this,o);this.downloadManager=e.downloadManager;this.eventBus._on("fileattachmentannotation",function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}(this,o,_appendAttachment2).bind(this))}reset(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super.reset();this._attachments=null;e||(this._renderedCapability=(0,n.createPromiseCapability)());this._pendingDispatchEvent=!1}async _dispatchEvent(e){this._renderedCapability.resolve();if(0===e&&!this._pendingDispatchEvent){this._pendingDispatchEvent=!0;await(0,s.waitOnEventOrTimeout)({target:this.eventBus,name:"annotationlayerrendered",delay:1e3});if(!this._pendingDispatchEvent)return}this._pendingDispatchEvent=!1;this.eventBus.dispatch("attachmentsloaded",{source:this,attachmentsCount:e})}_bindLink(e,t){let{content:i,filename:n}=t;e.onclick=()=>{this.downloadManager.openOrDownloadData(e,i,n);return!1}}render(e){let{attachments:t,keepRenderedCapability:i=!1}=e;this._attachments&&this.reset(i);this._attachments=t||null;if(!t){this._dispatchEvent(0);return}const r=Object.keys(t).sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())})),s=document.createDocumentFragment();let o=0;for(const e of r){const i=t[e],r=i.content,a=(0,n.getFilenameFromUrl)(i.filename),l=document.createElement("div");l.className="treeItem";const c=document.createElement("a");this._bindLink(c,{content:r,filename:a});c.textContent=this._normalizeTextContent(a);l.append(c);s.append(l);o++}this._finishRendering(s,o)}}t.PDFAttachmentViewer=PDFAttachmentViewer;function _appendAttachment2(e){let{filename:t,content:i}=e;const n=this._renderedCapability.promise;n.then((()=>{if(n!==this._renderedCapability.promise)return;const e=this._attachments||Object.create(null);for(const i in e)if(t===i)return;e[t]={filename:t,content:i};this.render({attachments:e,keepRenderedCapability:!0})}))}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.BaseTreeViewer=void 0;i(1);var n=i(153);const r="selected";class BaseTreeViewer{constructor(e){if(this.constructor===BaseTreeViewer)throw new Error("Cannot initialize BaseTreeViewer.");this.container=e.container;this.eventBus=e.eventBus;this.reset()}reset(){this._pdfDocument=null;this._lastToggleIsShow=!0;this._currentTreeItem=null;this.container.textContent="";this.container.classList.remove("treeWithDeepNesting")}_dispatchEvent(e){throw new Error("Not implemented: _dispatchEvent")}_bindLink(e,t){throw new Error("Not implemented: _bindLink")}_normalizeTextContent(e){return(0,n.removeNullCharacters)(e,!0)||"–"}_addToggleButton(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.createElement("div");i.className="treeItemToggler";t&&i.classList.add("treeItemsHidden");i.onclick=t=>{t.stopPropagation();i.classList.toggle("treeItemsHidden");if(t.shiftKey){const t=!i.classList.contains("treeItemsHidden");this._toggleTreeItem(e,t)}};e.prepend(i)}_toggleTreeItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._lastToggleIsShow=t;for(const i of e.querySelectorAll(".treeItemToggler"))i.classList.toggle("treeItemsHidden",!t)}_toggleAllTreeItems(){this._toggleTreeItem(this.container,!this._lastToggleIsShow)}_finishRendering(e,t){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]){this.container.classList.add("treeWithDeepNesting");this._lastToggleIsShow=!e.querySelector(".treeItemsHidden")}this.container.append(e);this._dispatchEvent(t)}render(e){throw new Error("Not implemented: render")}_updateCurrentTreeItem(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this._currentTreeItem){this._currentTreeItem.classList.remove(r);this._currentTreeItem=null}if(e){e.classList.add(r);this._currentTreeItem=e}}_scrollToCurrentTreeItem(e){if(!e)return;let t=e.parentNode;for(;t&&t!==this.container;){if(t.classList.contains("treeItem")){const e=t.firstElementChild;null==e||e.classList.remove("treeItemsHidden")}t=t.parentNode}this._updateCurrentTreeItem(e);this.container.scrollTo(e.offsetLeft,e.offsetTop+-100)}}t.BaseTreeViewer=BaseTreeViewer},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFDocumentProperties=void 0;i(131);i(94);i(1);var n=i(155),r=i(153);function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t);t.add(e)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldSet(e,t,i){!function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}(e,_classExtractFieldDescriptor(e,t,"set"),i);return i}function _classPrivateFieldGet(e,t){return function _classApplyDescriptorGet(e,t){if(t.get)return t.get.call(e);return t.value}(e,_classExtractFieldDescriptor(e,t,"get"))}function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}const s="-",o=["en-us","en-lr","my"],a={"8.5x11":"Letter","8.5x14":"Legal"},l={"297x420":"A3","210x297":"A4"};function getPageName(e,t,i){const n=t?e.width:e.height,r=t?e.height:e.width;return i["".concat(n,"x").concat(r)]}var c=new WeakMap,h=new WeakSet,d=new WeakSet,u=new WeakSet,p=new WeakSet,g=new WeakSet,f=new WeakSet;t.PDFDocumentProperties=class PDFDocumentProperties{constructor(e,t,i,n,r){let{dialog:s,fields:a,closeButton:l}=e;_classPrivateMethodInitSpec(this,f);_classPrivateMethodInitSpec(this,g);_classPrivateMethodInitSpec(this,p);_classPrivateMethodInitSpec(this,u);_classPrivateMethodInitSpec(this,d);_classPrivateMethodInitSpec(this,h);!function _classPrivateFieldInitSpec(e,t,i){_checkPrivateRedeclaration(e,t);t.set(e,i)}(this,c,{writable:!0,value:null});this.dialog=s;this.fields=a;this.overlayManager=t;this.l10n=n;this._fileNameLookup=r;_classPrivateMethodGet(this,h,_reset2).call(this);l.addEventListener("click",this.close.bind(this));this.overlayManager.register(this.dialog);i._on("pagechanging",(e=>{this._currentPageNumber=e.pageNumber}));i._on("rotationchanging",(e=>{this._pagesRotation=e.pagesRotation}));this._isNonMetricLocale=!0;n.getLanguage().then((e=>{this._isNonMetricLocale=o.includes(e)}))}async open(){await Promise.all([this.overlayManager.open(this.dialog),this._dataAvailableCapability.promise]);const e=this._currentPageNumber,t=this._pagesRotation;if(_classPrivateFieldGet(this,c)&&e===_classPrivateFieldGet(this,c)._currentPageNumber&&t===_classPrivateFieldGet(this,c)._pagesRotation){_classPrivateMethodGet(this,d,_updateUI2).call(this);return}const{info:i,contentLength:n}=await this.pdfDocument.getMetadata(),[s,o,a,l,h,m]=await Promise.all([this._fileNameLookup(),_classPrivateMethodGet(this,u,_parseFileSize2).call(this,n),_classPrivateMethodGet(this,g,_parseDate2).call(this,i.CreationDate),_classPrivateMethodGet(this,g,_parseDate2).call(this,i.ModDate),this.pdfDocument.getPage(e).then((e=>_classPrivateMethodGet(this,p,_parsePageSize2).call(this,(0,r.getPageSizeInches)(e),t))),_classPrivateMethodGet(this,f,_parseLinearization2).call(this,i.IsLinearized)]);_classPrivateFieldSet(this,c,Object.freeze({fileName:s,fileSize:o,title:i.Title,author:i.Author,subject:i.Subject,keywords:i.Keywords,creationDate:a,modificationDate:l,creator:i.Creator,producer:i.Producer,version:i.PDFFormatVersion,pageCount:this.pdfDocument.numPages,pageSize:h,linearized:m,_currentPageNumber:e,_pagesRotation:t}));_classPrivateMethodGet(this,d,_updateUI2).call(this);const{length:v}=await this.pdfDocument.getDownloadInfo();if(n===v)return;const w=Object.assign(Object.create(null),_classPrivateFieldGet(this,c));w.fileSize=await _classPrivateMethodGet(this,u,_parseFileSize2).call(this,v);_classPrivateFieldSet(this,c,Object.freeze(w));_classPrivateMethodGet(this,d,_updateUI2).call(this)}async close(){this.overlayManager.close(this.dialog)}setDocument(e){if(this.pdfDocument){_classPrivateMethodGet(this,h,_reset2).call(this);_classPrivateMethodGet(this,d,_updateUI2).call(this,!0)}if(e){this.pdfDocument=e;this._dataAvailableCapability.resolve()}}};function _reset2(){this.pdfDocument=null;_classPrivateFieldSet(this,c,null);this._dataAvailableCapability=(0,n.createPromiseCapability)();this._currentPageNumber=1;this._pagesRotation=0}function _updateUI2(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e&&_classPrivateFieldGet(this,c)){if(this.overlayManager.active===this.dialog)for(const e in this.fields){const t=_classPrivateFieldGet(this,c)[e];this.fields[e].textContent=t||0===t?t:s}}else for(const e in this.fields)this.fields[e].textContent=s}async function _parseFileSize2(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const t=e/1024,i=t/1024;if(t)return this.l10n.get("document_properties_".concat(i>=1?"mb":"kb"),{size_mb:i>=1&&(+i.toPrecision(3)).toLocaleString(),size_kb:i<1&&(+t.toPrecision(3)).toLocaleString(),size_b:e.toLocaleString()})}async function _parsePageSize2(e,t){if(!e)return;t%180!=0&&(e={width:e.height,height:e.width});const i=(0,r.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},o=getPageName(n,i,a)||getPageName(s,i,l);if(!(o||Number.isInteger(s.width)&&Number.isInteger(s.height))){const t={width:25.4*e.width,height:25.4*e.height},r={width:Math.round(s.width),height:Math.round(s.height)};if(Math.abs(t.width-r.width)<.1&&Math.abs(t.height-r.height)<.1){o=getPageName(r,i,l);if(o){n={width:Math.round(r.width/25.4*100)/100,height:Math.round(r.height/25.4*100)/100};s=r}}}const[{width:c,height:h},d,u,p]=await Promise.all([this._isNonMetricLocale?n:s,this.l10n.get("document_properties_page_size_unit_".concat(this._isNonMetricLocale?"inches":"millimeters")),o&&this.l10n.get("document_properties_page_size_name_".concat(o.toLowerCase())),this.l10n.get("document_properties_page_size_orientation_".concat(i?"portrait":"landscape"))]);return this.l10n.get("document_properties_page_size_dimension_".concat(u?"name_":"","string"),{width:c.toLocaleString(),height:h.toLocaleString(),unit:d,name:u,orientation:p})}async function _parseDate2(e){const t=n.PDFDateString.toDateObject(e);if(t)return this.l10n.get("document_properties_date_string",{date:t.toLocaleDateString(),time:t.toLocaleTimeString()})}function _parseLinearization2(e){return this.l10n.get("document_properties_linearized_".concat(e?"yes":"no"))}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFFindBar=void 0;i(94);i(1);var n=i(168);function _classPrivateMethodInitSpec(e,t){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.add(e)}function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}var r=new WeakSet;t.PDFFindBar=class PDFFindBar{constructor(e,t,i){var n;_classPrivateMethodInitSpec(this,r);this.opened=!1;this.bar=e.bar;this.toggleButton=e.toggleButton;this.findField=e.findField;this.highlightAll=e.highlightAllCheckbox;this.currentPage=e.findCurrentPageCheckbox;this.pageRange=e.findPageRangeField;this.caseSensitive=e.caseSensitiveCheckbox;this.matchDiacritics=e.matchDiacriticsCheckbox;this.entireWord=e.entireWordCheckbox;this.findMsg=e.findMsg;this.findResultsCount=e.findResultsCount;this.findPreviousButton=e.findPreviousButton;this.findNextButton=e.findNextButton;this.findFieldMultiline=e.findFieldMultiline||null;this.multipleSearchTexts=e.findMultipleSearchTextsCheckbox||null;this.ignoreAccents=e.ignoreAccentsCheckbox||null;this.fuzzySearch=e.fuzzyCheckbox||null;this.eventBus=t;this.l10n=i;this.toggleButton.addEventListener("click",(()=>{this.toggle()}));this.findFieldMultiline.addEventListener("input",(()=>{this.dispatchEvent("")}));this.findField.addEventListener("input",(()=>{this.dispatchEvent("")}));this.bar.addEventListener("keydown",(e=>{switch(e.keyCode){case 13:e.target===this.findField&&this.dispatchEvent("again",e.shiftKey);break;case 27:this.close()}}));this.findPreviousButton.addEventListener("click",(()=>{this.dispatchEvent("again",!0)}));this.findNextButton.addEventListener("click",(()=>{this.dispatchEvent("again",!1)}));this.highlightAll.addEventListener("click",(()=>{this.dispatchEvent("highlightallchange")}));this.caseSensitive.addEventListener("click",(()=>{this.dispatchEvent("casesensitivitychange")}));this.entireWord.addEventListener("click",(()=>{this.dispatchEvent("entirewordchange")}));this.multipleSearchTexts.addEventListener("click",(()=>{this.dispatchEvent("multiplesearchtextschange")}));this.ignoreAccents.addEventListener("click",(()=>{this.dispatchEvent("ignoreAccentsChange")}));this.fuzzySearch.addEventListener("click",(()=>{this.dispatchEvent("fuzzySearchChange")}));this.currentPage.addEventListener("click",(()=>{this.dispatchEvent("currentPageChange")}));this.pageRange.addEventListener("input",(()=>{this.dispatchEvent("pageRangeChange")}));null===(n=this.matchDiacritics)||void 0===n||n.addEventListener("click",(()=>{this.dispatchEvent("diacriticmatchingchange")}));this.eventBus._on("resize",_classPrivateMethodGet(this,r,_adjustWidth2).bind(this))}reset(){this.updateUIState()}dispatchEvent(e){var t;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.eventBus.dispatch("find",{source:this,type:e,query:this.findFieldMultiline.classList.contains("hidden")?this.findField.value:this.findFieldMultiline.value,phraseSearch:!this.multipleSearchTexts.checked,caseSensitive:this.caseSensitive.checked,entireWord:this.entireWord.checked,ignoreAccents:this.ignoreAccents.checked,fuzzySearch:this.fuzzySearch.checked,highlightAll:this.highlightAll.checked,currentPage:this.currentPage.checked,pageRange:this.pageRange.value,findPrevious:i,matchDiacritics:null===(t=this.matchDiacritics)||void 0===t?void 0:t.checked})}updateUIState(e,t,i){let s=Promise.resolve(""),o="";switch(e){case n.FindState.FOUND:break;case n.FindState.PENDING:o="pending";break;case n.FindState.NOT_FOUND:s=this.l10n.get("find_not_found");o="notFound";break;case n.FindState.WRAPPED:s=this.l10n.get("find_reached_".concat(t?"top":"bottom"))}this.findField.setAttribute("data-status",o);this.findFieldMultiline.classList.toggle("notFound","notFound"===o);this.findFieldMultiline.setAttribute("data-status",o);this.findField.setAttribute("aria-invalid",e===n.FindState.NOT_FOUND);s.then((e=>{this.findMsg.textContent=e;_classPrivateMethodGet(this,r,_adjustWidth2).call(this)}));this.updateResultsCount(i)}updateResultsCount(){let{current:e=0,total:t=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};let i=Promise.resolve("");if(t>0)if(t>1e3){let e="find_match_count_limit";i=this.l10n.get(e,{limit:1e3})}else{let n="find_match_count";i=this.l10n.get(n,{current:e,total:t})}i.then((e=>{this.findResultsCount.textContent=e;_classPrivateMethodGet(this,r,_adjustWidth2).call(this)}))}open(){if(!this.opened){this.opened=!0;this.toggleButton.classList.add("toggled");this.toggleButton.setAttribute("aria-expanded","true");this.bar.classList.remove("hidden")}this.findField.select();this.findField.focus();this.dispatchEvent("");_classPrivateMethodGet(this,r,_adjustWidth2).call(this)}close(){if(this.opened){this.opened=!1;this.toggleButton.classList.remove("toggled");this.toggleButton.setAttribute("aria-expanded","false");this.bar.classList.add("hidden");this.eventBus.dispatch("findbarclose",{source:this})}}toggle(){this.opened?this.close():this.open()}};function _adjustWidth2(){if(!this.opened)return;this.bar.classList.remove("wrapContainers");this.bar.clientHeight>this.bar.firstElementChild.clientHeight&&this.bar.classList.add("wrapContainers")}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFFindController=t.FindState=void 0;i(169);i(84);i(132);i(1);i(131);i(94);var n=i(155),r=i(174),s=i(175),o=i(176),a=i(153);const l={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};t.FindState=l;const c={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4","\n":" "};let h=null;function normalize(e){if(!h){const e=Object.keys(c).join("");h=new RegExp("[".concat(e,"]"),"g")}let t=null;return[e.replace(h,(function(e,i){const n=c[e],r=n.length-e.length;"\n"===e?(t||(t=[])).push([i-1,1]):0!==r&&(t||(t=[])).push([i,r]);return n})),t]}function getOriginalIndex(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return e;let i=0;for(const[n,r]of t){const t=n+i;if(n>=e)break;if(n+r>e){i+=e-t;break}i+=r}return e-i}t.PDFFindController=class PDFFindController{constructor(e){let{linkService:t,eventBus:i,pageViewMode:n}=e;this._linkService=t;this._eventBus=i;this._pageViewMode=n;this._reset();i._on("find",this._onFind.bind(this));i._on("findbarclose",this._onFindBarClose.bind(this));this.executeCommand=(e,t)=>{Window.ngxConsole.error('Deprecated method `PDFFindController.executeCommand` called, please dispatch a "find"-event using the EventBus instead.');const i=Object.assign(Object.create(null),t,{type:e.substring("find".length)});this._onFind(i)}}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesColor(){return this._pageMatchesColor}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this._state}setDocument(e){this._pdfDocument&&this._reset();if(e){this._pdfDocument=e;this._firstPageCapability.resolve()}}_onFind(e){if(!e)return;const t=this._pdfDocument,{type:i}=e;(null===this._state||this._shouldDirtyMatch(e))&&(this._dirtyMatch=!0);this._state=e;"highlightallchange"!==i&&this._updateUIState(l.PENDING);this._firstPageCapability.promise.then((()=>{if(!this._pdfDocument||t&&this._pdfDocument!==t)return;this._extractText();const e=!this._highlightMatches,n=!!this._findTimeout;if(this._findTimeout){clearTimeout(this._findTimeout);this._findTimeout=null}if(i)if(this._dirtyMatch)this._nextMatch();else if("again"===i){this._nextMatch();e&&this._state.highlightAll&&this._updateAllPages()}else if("highlightallchange"===i){n?this._nextMatch():this._highlightMatches=!0;this._updateAllPages()}else this._nextMatch();else this._findTimeout=setTimeout((()=>{this._nextMatch();this._findTimeout=null}),250)}))}scrollMatchIntoView(e){let{element:t=null,selectedLeft:i=0,pageIndex:n=-1,matchIndex:r=-1}=e;if(!this._scrollMatches||!t)return;if(-1===r||r!==this._selected.matchIdx)return;if(-1===n||n!==this._selected.pageIdx)return;this._scrollMatches=!1;const s={top:-50,left:i+-400};(0,a.scrollIntoView)(t,s,!0,"infinite-scroll"===this._pageViewMode)}_reset(){this._highlightMatches=!1;this._scrollMatches=!1;this._pdfDocument=null;this._pageMatches=[];this._pageMatchesLength=[];this._pageMatchesColor=[];this._state=null;this._selected={pageIdx:-1,matchIdx:-1};this._offset={pageIdx:null,matchIdx:null,wrapped:!1};this._extractTextPromises=[];this._pageContents=[];this._pageDiffs=[];this._matchesCountTotal=0;this._pagesToSearch=null;this._pendingFindMatches=new Set;this._resumePageIdx=null;this._dirtyMatch=!1;clearTimeout(this._findTimeout);this._findTimeout=null;this._firstPageCapability=(0,n.createPromiseCapability)()}get _query(){if(this._state.query!==this._rawQuery){this._rawQuery=this._state.query;[this._normalizedQuery]=normalize(this._state.query)}return this._normalizedQuery}_shouldDirtyMatch(e){if(e.query!==this._state.query)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&&!t.isPageVisible(e);case"highlightallchange":return!1}return!0}_prepareMatches(e,t,i,n){function isSubTerm(t){const i=e[t],n=e[t+1];if(t<e.length-1&&i.match===n.match){i.skipped=!0;return!0}for(let n=t-1;n>=0;n--){const t=e[n];if(!t.skipped){if(t.match+t.matchLength<i.match)break;if(t.match+t.matchLength>=i.match+i.matchLength){i.skipped=!0;return!0}}}return!1}e.sort((function(e,t){return e.match===t.match?e.matchLength-t.matchLength:e.match-t.match}));for(let r=0,s=e.length;r<s;r++)if(!isSubTerm(r)){t.push(e[r].match);i.push(e[r].matchLength);n.push(e[r].color)}}_isEntireWord(e,t,i){if(t>0){const i=e.charCodeAt(t),n=e.charCodeAt(t-1);if((0,s.getCharacterType)(i)===(0,s.getCharacterType)(n))return!1}const n=t+i-1;if(n<e.length-1){const t=e.charCodeAt(n),i=e.charCodeAt(n+1);if((0,s.getCharacterType)(t)===(0,s.getCharacterType)(i))return!1}return!0}_calculateFuzzyMatch(e,t,i,n){const r=[],s=[],a=e.length,l=a<5?a:5,c=Math.round(a/5),h=e.substring(0,l),d={useCollator:!0};for(let t=0;t<i.length-a;t++){const u=i.substring(t,t+l);if(o.Levenshtein.distance(h,u,d)<3){const l=i.substring(t,t+a),h=o.Levenshtein.distance(e,l,d);if(h<=c){if(t+1<i.length-a){const n=i.substring(t+1,t+1+a);if(h>=o.Levenshtein.distance(e,n,d))continue}const l=getOriginalIndex(t,n),c=getOriginalIndex(t+a-1,n)-l+1;r.push(l);s.push(c);t+=a-1}}}this._pageMatches[t]=r;this._pageMatchesLength[t]=s}_calculatePhraseMatch(e,t,i,n,s,o){if(o){i=(0,r.deburr)(i);e=(0,r.deburr)(e)}const a=[],l=[],c=e.length;let h=-c;for(;;){h=i.indexOf(e,h+c);if(-1===h)break;if(s&&!this._isEntireWord(i,h,c))continue;const t=getOriginalIndex(h,n),r=getOriginalIndex(h+c-1,n)-t+1;a.push(t);l.push(r)}this._pageMatches[t]=a;this._pageMatchesLength[t]=l}_calculateWordMatch(e,t,i,n,s,o){if(o){i=(0,r.deburr)(i);e=(0,r.deburr)(e)}const a=[],l=e.includes("\n")?e.trim().split(/\n+/g):e.trim().match(/\S+/g);for(let e=0,t=l.length;e<t;e++){const t=l[e],r=t.length;if(0===r)continue;let o=-r;for(;;){o=i.indexOf(t,o+r);if(-1===o)break;if(s&&!this._isEntireWord(i,o,r))continue;const l=getOriginalIndex(o,n),c=getOriginalIndex(o+r-1,n)-l+1;a.push({match:l,matchLength:c,skipped:!1,color:e})}}this._pageMatchesLength[t]=[];this._pageMatchesColor[t]=[];this._pageMatches[t]=[];this._prepareMatches(a,this._pageMatches[t],this._pageMatchesLength[t],this._pageMatchesColor[t])}_isInPageRanges(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"1,3,6-7";try{if(!t)return!0;return t.split(",").some((t=>this._isInPageRange(e,t)))}catch(e){return!0}}_isInPageRange(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"6-7";try{if(!t)return!0;if(t.includes("-")){const i=t.split("-"),n=i[0].trim();if(n.length>0&&e<Number(n))return!1;const r=i[1].trim();if(r.length>0&&e>Number(r))return!1}else{const i=t.trim();if(i.length>0)return Number(i)===e}return!0}catch(e){return!0}}_calculateMatch(e){if(!this.state)return;let t=this._pageContents[e];const i=this._pageDiffs[e];let n=this._query;const{caseSensitive:r,entireWord:s,ignoreAccents:o,fuzzySearch:a,phraseSearch:l,currentPage:c,pageRange:h}=this._state;let d=!1;if(c&&e!==this._linkService.page-1){d=!0;this._pageMatches[e]=[]}if(!this._isInPageRanges(e+1,h)){d=!0;this._pageMatches[e]=[]}if(0===n.length)return;if(!d){if(!r){t=t.toLowerCase();n=n.toLowerCase()}a?n.length<=2?this._calculatePhraseMatch(n,e,t,i,!1):this._calculateFuzzyMatch(n,e,t,i):l?this._calculatePhraseMatch(n,e,t,i,s,o):this._calculateWordMatch(n,e,t,i,s,o)}this._state.highlightAll&&this._updatePage(e);if(this._resumePageIdx===e){this._resumePageIdx=null;this._nextPageMatch()}const u=this._pageMatches[e].length;if(u>0){this._matchesCountTotal+=u;this._updateUIResultsCount()}else e+1===this._pageContents.length&&0===this._matchesCountTotal&&this._updateUIResultsCount()}_extractText(){if(this._extractTextPromises.length>0)return;let e=Promise.resolve();for(let t=0,i=this._linkService.pagesCount;t<i;t++){const i=(0,n.createPromiseCapability)();this._extractTextPromises[t]=i.promise;e=e.then((()=>this._pdfDocument&&this._extractTextPromises.length>0?this._pdfDocument.getPage(t+1).then((e=>e.getTextContent())).then((e=>{const n=e.items,r=[];for(let e=0,t=n.length;e<t;e++){r.push(n[e].str);n[e].hasEOL&&r.push("\n")}[this._pageContents[t],this._pageDiffs[t]]=normalize(r.join(""));i.resolve(t)}),(e=>{Window.ngxConsole.error("Unable to get text content for page ".concat(t+1),e);this._pageContents[t]="";this._pageDiffs[t]=null;i.resolve(t)})):Promise.resolve()))}}_updatePage(e){this._scrollMatches&&this._selected.pageIdx===e&&(this._linkService.page=e+1);this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:e})}_updateAllPages(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}_nextMatch(){const e=this._state.findPrevious,t=this._linkService.page-1,i=this._linkService.pagesCount;this._highlightMatches=!0;if(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._pageMatchesColor.length=0;this._matchesCountTotal=0;this._updateAllPages();const{currentPage:e}=this.state;let n=0,r=i-1;if(e){n=this._linkService.page-1;r=n}for(let e=n;e<=r;e++)if(!this._pendingFindMatches.has(e)){this._pendingFindMatches.add(e);this._extractTextPromises[e].then((e=>{this._pendingFindMatches.delete(e);this._calculateMatch(e)}))}}if(""===this._query){this._updateUIState(l.FOUND);return}if(this._resumePageIdx)return;const n=this._offset;this._pagesToSearch=i;if(null!==n.matchIdx){const t=this._pageMatches[n.pageIdx].length;if(!e&&n.matchIdx+1<t||e&&n.matchIdx>0){n.matchIdx=e?n.matchIdx-1:n.matchIdx+1;this._updateMatch(!0);return}this._advanceOffsetPage(e)}this._nextPageMatch()}_matchesReady(e){const t=this._offset,i=e.length,n=this._state.findPrevious;if(i){t.matchIdx=n?i-1:0;this._updateMatch(!0);return!0}this._advanceOffsetPage(n);if(t.wrapped){t.matchIdx=null;if(this._pagesToSearch<0){this._updateMatch(!1);return!0}}return!1}_nextPageMatch(){null!==this._resumePageIdx&&Window.ngxConsole.error("There can only be one pending page.");let e=null;do{const t=this._offset.pageIdx;e=this._pageMatches[t];if(!e){this._resumePageIdx=t;break}}while(!this._matchesReady(e))}_advanceOffsetPage(e){const t=this._offset,i=this._linkService.pagesCount;t.pageIdx=e?t.pageIdx-1:t.pageIdx+1;t.matchIdx=null;this._pagesToSearch--;if(t.pageIdx>=i||t.pageIdx<0){t.pageIdx=e?i-1:0;t.wrapped=!0}}_updateMatch(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=l.NOT_FOUND;const i=this._offset.wrapped;this._offset.wrapped=!1;if(e){const e=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx;this._selected.matchIdx=this._offset.matchIdx;t=i?l.WRAPPED:l.FOUND;-1!==e&&e!==this._selected.pageIdx&&this._updatePage(e)}this._updateUIState(t,this._state.findPrevious);if(-1!==this._selected.pageIdx){this._scrollMatches=!0;this._updatePage(this._selected.pageIdx)}}_onFindBarClose(e){const t=this._pdfDocument;this._firstPageCapability.promise.then((()=>{if(this._pdfDocument&&(!t||this._pdfDocument===t)){if(this._findTimeout){clearTimeout(this._findTimeout);this._findTimeout=null}if(this._resumePageIdx){this._resumePageIdx=null;this._dirtyMatch=!0}this._updateUIState(l.FOUND);this._highlightMatches=!1;this._updateAllPages()}}))}_requestMatchesCount(){const{pageIdx:e,matchIdx:t}=this._selected;let i=0,n=this._matchesCountTotal;if(-1!==t){for(let t=0;t<e;t++){var r;i+=(null===(r=this._pageMatches[t])||void 0===r?void 0:r.length)||0}i+=t+1}(i<1||i>n)&&(i=n=0);return{current:i,total:n}}_updateUIResultsCount(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this._requestMatchesCount()})}_updateUIState(e){var t,i;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:e,previous:n,matchesCount:this._requestMatchesCount(),rawQuery:null!==(t=null===(i=this._state)||void 0===i?void 0:i.query)&&void 0!==t?t:null})}}},(e,t,i)=>{var n=i(33),r=i(2),s=i(11),o=i(75),a=i(170),l=i(62),c=i(73).f,h=i(41),d=i(171),u=i(86),p=i(172),g=i(90),f=i(173),m=i(68),v=i(13),w=i(22),_=i(59).enforce,y=i(97),b=i(17),P=i(91),S=i(92),E=b("match"),x=r.RegExp,C=x.prototype,T=r.SyntaxError,I=s(C.exec),M=s("".charAt),L=s("".replace),A=s("".indexOf),D=s("".slice),k=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,O=/a/g,R=/a/g,B=new x(O)!==O,N=g.MISSED_STICKY,V=g.UNSUPPORTED_Y,U=n&&(!B||N||P||S||v((function(){R[E]=!1;return x(O)!=O||x(R)==R||"/a/i"!=x(O,"i")})));if(o("RegExp",U)){for(var W=function RegExp(e,t){var i,n,r,s,o,c,g=h(C,this),f=d(e),m=void 0===t,v=[],y=e;if(!g&&f&&m&&e.constructor===W)return e;if(f||h(C,e)){e=e.source;m&&(t=p(y))}e=void 0===e?"":u(e);t=void 0===t?"":u(t);y=e;P&&"dotAll"in O&&(n=!!t&&A(t,"s")>-1)&&(t=L(t,/s/g,""));i=t;N&&"sticky"in O&&(r=!!t&&A(t,"y")>-1)&&V&&(t=L(t,/y/g,""));if(S){s=function(e){for(var t,i=e.length,n=0,r="",s=[],o={},a=!1,l=!1,c=0,h="";n<=i;n++){if("\\"===(t=M(e,n)))t+=M(e,++n);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:if(I(k,D(e,n+1))){n+=2;l=!0}r+=t;c++;continue;case">"===t&&l:if(""===h||w(o,h))throw new T("Invalid capture group name");o[h]=!0;s[s.length]=[h,c];l=!1;h="";continue}l?h+=t:r+=t}return[r,s]}(e);e=s[0];v=s[1]}o=a(x(e,t),g?this:C,W);if(n||r||v.length){c=_(o);if(n){c.dotAll=!0;c.raw=W(function(e){for(var t,i=e.length,n=0,r="",s=!1;n<=i;n++)if("\\"!==(t=M(e,n)))if(s||"."!==t){"["===t?s=!0:"]"===t&&(s=!1);r+=t}else r+="[\\s\\S]";else r+=t+M(e,++n);return r}(e),i)}r&&(c.sticky=!0);v.length&&(c.groups=v)}if(e!==y)try{l(o,"source",""===y?"(?:)":y)}catch(e){}return o},H=c(x),G=0;H.length>G;)f(W,x,H[G++]);C.constructor=W;W.prototype=C;m(r,"RegExp",W,{constructor:!0})}y("RegExp")},(e,t,i)=>{var n=i(7),r=i(6),s=i(81);e.exports=function(e,t,i){var o,a;s&&n(o=t.constructor)&&o!==i&&r(a=o.prototype)&&a!==i.prototype&&s(e,a);return e}},(e,t,i)=>{var n=i(6),r=i(14),s=i(17)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[s])?!!t:"RegExp"==r(e))}},(e,t,i)=>{var n=i(39),r=i(22),s=i(41),o=i(89),a=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in a||r(e,"flags")||!s(a,e)?t:n(o,e)}},(e,t,i)=>{var n=i(35).f;e.exports=function(e,t,i){i in e||n(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.deburr=function deburr(e){return(e=function toString(e){return null==e?"":function baseToString(e){if("string"==typeof e)return e;if(function isSymbol(e){return"symbol"==typeof e||function isObjectLike(e){return!!e&&"object"==typeof e}(e)&&h.call(e)==n}(e))return p?p.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(e))&&e.replace(r,c).replace(s,"")};i(169);i(84);i(132);var n="[object Symbol]",r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,s=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),o="object"==typeof global&&global&&global.Object===Object&&global,a="object"==typeof self&&self&&self.Object===Object&&self,l=o||a||Function("return this")();var c=function basePropertyOf(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"}),h=Object.prototype.toString,d=l.Symbol,u=d?d.prototype:void 0,p=u?u.toString:void 0},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CharacterType=void 0;t.getCharacterType=function getCharacterType(e){if(function isAlphabeticalScript(e){return e<11904}(e))return function isAscii(e){return 0==(65408&e)}(e)?function isAsciiSpace(e){return 32===e||9===e||13===e||10===e}(e)?i.SPACE:function isAsciiAlpha(e){return e>=97&&e<=122||e>=65&&e<=90}(e)||function isAsciiDigit(e){return e>=48&&e<=57}(e)||95===e?i.ALPHA_LETTER:i.PUNCT:function isThai(e){return 3584==(65408&e)}(e)?i.THAI_LETTER:160===e?i.SPACE:i.ALPHA_LETTER;if(function isHan(e){return e>=13312&&e<=40959||e>=63744&&e<=64255}(e))return i.HAN_LETTER;if(function isKatakana(e){return e>=12448&&e<=12543}(e))return i.KATAKANA_LETTER;if(function isHiragana(e){return e>=12352&&e<=12447}(e))return i.HIRAGANA_LETTER;if(function isHalfwidthKatakana(e){return e>=65376&&e<=65439}(e))return i.HALFWIDTH_KATAKANA_LETTER;return i.ALPHA_LETTER};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};t.CharacterType=i},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Levenshtein=void 0;let i;try{i=Intl.Collator("und",{sensitivity:"base"})}catch(e){try{i=Intl.Collator("generic",{sensitivity:"base"})}catch(e){i=void 0}}const n=[],r=[];t.Levenshtein=class Levenshtein{static distance(e,t,s){const o=s&&i&&s.useCollator,a=e.length,l=t.length;if(0===a)return l;if(0===l)return a;let c,h,d,u,p,g;for(d=0;d<l;++d){n[d]=d;r[d]=t.charCodeAt(d)}n[l]=l;if(o)for(d=0;d<a;++d){h=d+1;for(u=0;u<l;++u){c=h;g=0===i.compare(e.charAt(d),String.fromCharCode(r[u]));h=n[u]+(g?0:1);p=c+1;h>p&&(h=p);p=n[u+1]+1;h>p&&(h=p);n[u]=c}n[u]=h}else for(d=0;d<a;++d){h=d+1;for(u=0;u<l;++u){c=h;g=e.charCodeAt(d)===r[u];h=n[u]+(g?0:1);p=c+1;h>p&&(h=p);p=n[u+1]+1;h>p&&(h=p);n[u]=c}n[u]=h}return h}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFHistory=void 0;t.isDestArraysEqual=isDestArraysEqual;t.isDestHashesEqual=isDestHashesEqual;i(94);i(84);i(1);var n=i(153),r=i(156);function getCurrentHash(){return document.location.hash}t.PDFHistory=class PDFHistory{constructor(e){let{linkService:t,eventBus:i}=e;this.linkService=t;this.eventBus=i;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(e){let{fingerprint:t,resetHistory:i=!1,updateUrl:n=!1}=e;if(!t||"string"!=typeof t){Window.ngxConsole.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}this._initialized&&this.reset();const r=""!==this._fingerprint&&this._fingerprint!==t;this._fingerprint=t;this._updateUrl=!0===n;this._initialized=!0;this._bindEvents();const s=window.history.state;this._popStateInProgress=!1;this._blockHashChange=0;this._currentHash=getCurrentHash();this._numPositionUpdates=0;this._uid=this._maxUid=0;this._destination=null;this._position=null;if(!this._isValidState(s,!0)||i){const{hash:e,page:t,rotation:n}=this._parseCurrentHash(!0);if(!e||r||i){this._pushOrReplaceState(null,!0);return}this._pushOrReplaceState({hash:e,page:t,rotation:n},!0);return}const o=s.destination;this._updateInternalState(o,s.uid,!0);void 0!==o.rotation&&(this._initialRotation=o.rotation);if(o.dest){this._initialBookmark=JSON.stringify(o.dest);this._destination.page=null}else o.hash?this._initialBookmark=o.hash:o.page&&(this._initialBookmark="page=".concat(o.page))}reset(){if(this._initialized){this._pageHide();this._initialized=!1;this._unbindEvents()}if(this._updateViewareaTimeout){clearTimeout(this._updateViewareaTimeout);this._updateViewareaTimeout=null}this._initialBookmark=null;this._initialRotation=null}push(e){let{namedDest:t=null,explicitDest:i,pageNumber:n}=e;if(!this._initialized)return;if(t&&"string"!=typeof t){Window.ngxConsole.error("PDFHistory.push: "+'"'.concat(t,'" is not a valid namedDest parameter.'));return}if(!Array.isArray(i)){Window.ngxConsole.error("PDFHistory.push: "+'"'.concat(i,'" is not a valid explicitDest parameter.'));return}if(!this._isValidPage(n)&&(null!==n||this._destination)){Window.ngxConsole.error("PDFHistory.push: "+'"'.concat(n,'" is not a valid pageNumber parameter.'));return}const r=t||JSON.stringify(i);if(!r)return;let s=!1;if(this._destination&&(isDestHashesEqual(this._destination.hash,r)||isDestArraysEqual(this._destination.dest,i))){if(this._destination.page)return;s=!0}if(!this._popStateInProgress||s){this._pushOrReplaceState({dest:i,hash:r,page:n,rotation:this.linkService.rotation},s);if(!this._popStateInProgress){this._popStateInProgress=!0;Promise.resolve().then((()=>{this._popStateInProgress=!1}))}}}pushPage(e){var t;if(this._initialized)if(this._isValidPage(e)){if((null===(t=this._destination)||void 0===t?void 0:t.page)!==e&&!this._popStateInProgress){this._pushOrReplaceState({dest:null,hash:"page=".concat(e),page:e,rotation:this.linkService.rotation});if(!this._popStateInProgress){this._popStateInProgress=!0;Promise.resolve().then((()=>{this._popStateInProgress=!1}))}}}else Window.ngxConsole.error('PDFHistory.pushPage: "'.concat(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){const t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]||!this._destination,i={fingerprint:this._fingerprint,uid:t?this._uid:this._uid+1,destination:e};this._updateInternalState(e,i.uid);let n;if(this._updateUrl&&null!=e&&e.hash){const t=document.location.href.split("#")[0];t.startsWith("file://")||(n="".concat(t,"#").concat(e.hash))}t?window.history.replaceState(i,"",n):window.history.pushState(i,"",n)}_tryPushCurrentPosition(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._position)return;let t=this._position;if(e){t=Object.assign(Object.create(null),this._position);t.temporary=!0}if(!this._destination){this._pushOrReplaceState(t);return}if(this._destination.temporary){this._pushOrReplaceState(t,!0);return}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){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[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"!==(null==t?void 0:t.type))return!1}}return!(!Number.isInteger(e.uid)||e.uid<0)&&(null!==e.destination&&"object"==typeof e.destination)}_updateInternalState(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this._updateViewareaTimeout){clearTimeout(this._updateViewareaTimeout);this._updateViewareaTimeout=null}i&&null!=e&&e.temporary&&delete e.temporary;this._destination=e;this._uid=t;this._maxUid=Math.max(this._maxUid,t);this._numPositionUpdates=0}_parseCurrentHash(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=unescape(getCurrentHash()).substring(1),i=(0,n.parseQueryString)(t),r=i.get("nameddest")||"";let s=0|i.get("page");(!this._isValidPage(s)||e&&r.length>0)&&(s=null);return{hash:t,page:s,rotation:this.linkService.rotation}}_updateViewarea(e){let{location:t}=e;if(this._updateViewareaTimeout){clearTimeout(this._updateViewareaTimeout);this._updateViewareaTimeout=null}this._position={hash:t.pdfOpenParams.substring(1),page:this.linkService.page,first:t.pageNumber,rotation:t.rotation};if(!this._popStateInProgress){this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++;this._updateViewareaTimeout=setTimeout((()=>{this._popStateInProgress||this._tryPushCurrentPosition(!0);this._updateViewareaTimeout=null}),1e3)}}_popState(e){let{state:t}=e;const i=getCurrentHash(),s=this._currentHash!==i;this._currentHash=i;if(!t){this._uid++;const{hash:e,page:t,rotation:i}=this._parseCurrentHash();this._pushOrReplaceState({hash:e,page:t,rotation:i},!0);return}if(!this._isValidState(t))return;this._popStateInProgress=!0;if(s){this._blockHashChange++;(0,r.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:1e3}).then((()=>{this._blockHashChange--}))}const o=t.destination;this._updateInternalState(o,t.uid,!0);(0,n.isValidRotation)(o.rotation)&&(this.linkService.rotation=o.rotation);o.dest?this.linkService.goToDestination(o.dest):o.hash?this.linkService.setHash(o.hash):o.page&&(this.linkService.page=o.page);Promise.resolve().then((()=>{this._popStateInProgress=!1}))}_pageHide(){this._destination&&!this._destination.temporary||this._tryPushCurrentPosition()}_bindEvents(){if(!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(){if(this._boundEvents){this.eventBus._off("updateviewarea",this._boundEvents.updateViewarea);window.removeEventListener("popstate",this._boundEvents.popState);window.removeEventListener("pagehide",this._boundEvents.pageHide);this._boundEvents=null}}};function isDestHashesEqual(e,t){if("string"!=typeof e||"string"!=typeof t)return!1;if(e===t)return!0;return(0,n.parseQueryString)(e).get("nameddest")===t}function isDestArraysEqual(e,t){function isEntryEqual(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 i in e)if(!isEntryEqual(e[i],t[i]))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 i=0,n=e.length;i<n;i++)if(!isEntryEqual(e[i],t[i]))return!1;return!0}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFLayerViewer=void 0;i(94);i(1);var n=i(165);class PDFLayerViewer extends n.BaseTreeViewer{constructor(e){super(e);this.l10n=e.l10n;this.eventBus._on("resetlayers",this._resetLayers.bind(this));this.eventBus._on("togglelayerstree",this._toggleAllTreeItems.bind(this))}reset(){super.reset();this._optionalContentConfig=null}_dispatchEvent(e){this.eventBus.dispatch("layersloaded",{source:this,layersCount:e})}_bindLink(e,t){let{groupId:i,input:n}=t;const setVisibility=()=>{this._optionalContentConfig.setVisibility(i,n.checked);this.eventBus.dispatch("optionalcontentconfig",{source:this,promise:Promise.resolve(this._optionalContentConfig)})};e.onclick=t=>{if(t.target===n){setVisibility();return!0}if(t.target!==e)return!0;n.checked=!n.checked;setVisibility();return!1}}async _setNestedName(e,t){let{name:i=null}=t;if("string"!=typeof i){e.textContent=await this.l10n.get("additional_layers");e.style.fontStyle="italic"}else e.textContent=this._normalizeTextContent(i)}_addToggleButton(e,t){let{name:i=null}=t;super._addToggleButton(e,null===i)}_toggleAllTreeItems(){this._optionalContentConfig&&super._toggleAllTreeItems()}render(e){let{optionalContentConfig:t,pdfDocument:i}=e;this._optionalContentConfig&&this.reset();this._optionalContentConfig=t||null;this._pdfDocument=i||null;const n=null==t?void 0:t.getOrder();if(!n){this._dispatchEvent(0);return}const r=document.createDocumentFragment(),s=[{parent:r,groups:n}];let o=0,a=!1;for(;s.length>0;){const e=s.shift();for(const i of e.groups){const n=document.createElement("div");n.className="treeItem";const r=document.createElement("a");n.append(r);if("object"==typeof i){a=!0;this._addToggleButton(n,i);this._setNestedName(r,i);const e=document.createElement("div");e.className="treeItems";n.append(e);s.push({parent:e,groups:i.order})}else{const e=t.getGroup(i),n=document.createElement("input");this._bindLink(r,{groupId:i,input:n});n.type="checkbox";n.checked=e.visible;const s=document.createElement("label");s.textContent=this._normalizeTextContent(e.name);s.append(n);r.append(s);o++}e.parent.append(n)}}this._finishRendering(r,o,a)}async _resetLayers(){if(!this._optionalContentConfig)return;const e=await this._pdfDocument.getOptionalContentConfig();this.eventBus.dispatch("optionalcontentconfig",{source:this,promise:Promise.resolve(e)});this.render({optionalContentConfig:e,pdfDocument:this._pdfDocument})}}t.PDFLayerViewer=PDFLayerViewer},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFOutlineViewer=void 0;i(1);i(94);var n=i(165),r=i(155),s=i(153);class PDFOutlineViewer extends n.BaseTreeViewer{constructor(e){super(e);this.linkService=e.linkService;this.eventBus._on("toggleoutlinetree",this._toggleAllTreeItems.bind(this));this.eventBus._on("currentoutlineitem",this._currentOutlineItem.bind(this));this.eventBus._on("pagechanging",(e=>{this._currentPageNumber=e.pageNumber}));this.eventBus._on("pagesloaded",(e=>{this._isPagesLoaded=!!e.pagesCount;this._currentOutlineItemCapability&&!this._currentOutlineItemCapability.settled&&this._currentOutlineItemCapability.resolve(this._isPagesLoaded)}));this.eventBus._on("sidebarviewchanged",(e=>{this._sidebarView=e.view}))}reset(){super.reset();this._outline=null;this._pageNumberToDestHashCapability=null;this._currentPageNumber=1;this._isPagesLoaded=null;this._currentOutlineItemCapability&&!this._currentOutlineItemCapability.settled&&this._currentOutlineItemCapability.resolve(!1);this._currentOutlineItemCapability=null}_dispatchEvent(e){var t;this._currentOutlineItemCapability=(0,r.createPromiseCapability)();0===e||null!==(t=this._pdfDocument)&&void 0!==t&&t.loadingParams.disableAutoFetch?this._currentOutlineItemCapability.resolve(!1):null!==this._isPagesLoaded&&this._currentOutlineItemCapability.resolve(this._isPagesLoaded);this.eventBus.dispatch("outlineloaded",{source:this,outlineCount:e,currentOutlineItemPromise:this._currentOutlineItemCapability.promise})}_bindLink(e,t){let{url:i,newWindow:n,dest:r}=t;const{linkService:s}=this;if(i)s.addLinkAttributes(e,i,n);else{e.href=s.getDestinationHash(r);e.onclick=e=>{this._updateCurrentTreeItem(e.target.parentNode);r&&s.goToDestination(r);return!1}}}_setStyles(e,t){let{bold:i,italic:n}=t;i&&(e.style.fontWeight="bold");n&&(e.style.fontStyle="italic")}_addToggleButton(e,t){let{count:i,items:n}=t,r=!1;if(i<0){let e=n.length;if(e>0){const t=[...n];for(;t.length>0;){const{count:i,items:n}=t.shift();if(i>0&&n.length>0){e+=n.length;t.push(...n)}}}Math.abs(i)===e&&(r=!0)}super._addToggleButton(e,r)}_toggleAllTreeItems(){this._outline&&super._toggleAllTreeItems()}render(e){let{outline:t,pdfDocument:i}=e;this._outline&&this.reset();this._outline=t||null;this._pdfDocument=i||null;if(!t){this._dispatchEvent(0);return}const n=document.createDocumentFragment(),r=[{parent:n,items:t}];let s=0,o=!1;for(;r.length>0;){const e=r.shift();for(const t of e.items){const i=document.createElement("div");i.className="treeItem";const n=document.createElement("a");this._bindLink(n,t);this._setStyles(n,t);n.textContent=this._normalizeTextContent(t.title);i.append(n);if(t.items.length>0){o=!0;this._addToggleButton(i,t);const e=document.createElement("div");e.className="treeItems";i.append(e);r.push({parent:e,items:t.items})}e.parent.append(i);s++}}this._finishRendering(n,s,o)}async _currentOutlineItem(){if(!this._isPagesLoaded)throw new Error("_currentOutlineItem: All pages have not been loaded.");if(!this._outline||!this._pdfDocument)return;const e=await this._getPageNumberToDestHash(this._pdfDocument);if(e){this._updateCurrentTreeItem(null);if(this._sidebarView===s.SidebarView.OUTLINE)for(let t=this._currentPageNumber;t>0;t--){const i=e.get(t);if(!i)continue;const n=this.container.querySelector('a[href="'.concat(i,'"]'));if(n){this._scrollToCurrentTreeItem(n.parentNode);break}}}}async _getPageNumberToDestHash(e){if(this._pageNumberToDestHashCapability)return this._pageNumberToDestHashCapability.promise;this._pageNumberToDestHashCapability=(0,r.createPromiseCapability)();const t=new Map,i=new Map,n=[{nesting:0,items:this._outline}];for(;n.length>0;){const r=n.shift(),s=r.nesting;for(const{dest:o,items:a}of r.items){let r,l;if("string"==typeof o){r=await e.getDestination(o);if(e!==this._pdfDocument)return null}else r=o;if(Array.isArray(r)){const[n]=r;if("object"==typeof n&&null!==n){l=this.linkService._cachedPageNumber(n);if(!l)try{l=await e.getPageIndex(n)+1;if(e!==this._pdfDocument)return null;this.linkService.cachePageRef(l,n)}catch(e){}}else Number.isInteger(n)&&(l=n+1);if(Number.isInteger(l)&&(!t.has(l)||s>i.get(l))){const e=this.linkService.getDestinationHash(o);t.set(l,e);i.set(l,s)}}a.length>0&&n.push({nesting:s+1,items:a})}}this._pageNumberToDestHashCapability.resolve(t.size>0?t:null);return this._pageNumberToDestHashCapability.promise}}t.PDFOutlineViewer=PDFOutlineViewer},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFPresentationMode=void 0;i(94);i(1);var n=i(153),r=i(155);function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t);t.add(e)}function _classPrivateFieldInitSpec(e,t,i){_checkPrivateRedeclaration(e,t);t.set(e,i)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(e,t){return function _classApplyDescriptorGet(e,t){if(t.get)return t.get.call(e);return t.value}(e,_classExtractFieldDescriptor(e,t,"get"))}function _classPrivateFieldSet(e,t,i){!function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}(e,_classExtractFieldDescriptor(e,t,"set"),i);return i}function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}const s="pdfPresentationMode",o="pdfPresentationModeControls",a=Math.PI/6;var l=new WeakMap,c=new WeakMap,h=new WeakSet,d=new WeakSet,u=new WeakSet,p=new WeakSet,g=new WeakSet,f=new WeakSet,m=new WeakSet,v=new WeakSet,w=new WeakSet,_=new WeakSet,y=new WeakSet,b=new WeakSet,P=new WeakSet,S=new WeakSet,E=new WeakSet;t.PDFPresentationMode=class PDFPresentationMode{constructor(e){let{container:t,pdfViewer:i,eventBus:r}=e;_classPrivateMethodInitSpec(this,E);_classPrivateMethodInitSpec(this,S);_classPrivateMethodInitSpec(this,P);_classPrivateMethodInitSpec(this,b);_classPrivateMethodInitSpec(this,y);_classPrivateMethodInitSpec(this,_);_classPrivateMethodInitSpec(this,w);_classPrivateMethodInitSpec(this,v);_classPrivateMethodInitSpec(this,m);_classPrivateMethodInitSpec(this,f);_classPrivateMethodInitSpec(this,g);_classPrivateMethodInitSpec(this,p);_classPrivateMethodInitSpec(this,u);_classPrivateMethodInitSpec(this,d);_classPrivateMethodInitSpec(this,h);_classPrivateFieldInitSpec(this,l,{writable:!0,value:n.PresentationModeState.UNKNOWN});_classPrivateFieldInitSpec(this,c,{writable:!0,value:null});this.container=t;this.pdfViewer=i;this.eventBus=r;this.contextMenuOpen=!1;this.mouseScrollTimeStamp=0;this.mouseScrollDelta=0;this.touchSwipeState=null}async request(){const{container:e,pdfViewer:t}=this;if(this.active||!t.pagesCount||!e.requestFullscreen)return!1;_classPrivateMethodGet(this,S,_addFullscreenChangeListeners2).call(this);_classPrivateMethodGet(this,d,_notifyStateChange2).call(this,n.PresentationModeState.CHANGING);const i=e.requestFullscreen();_classPrivateFieldSet(this,c,{pageNumber:t.currentPageNumber,scaleValue:t.currentScaleValue,scrollMode:t.scrollMode,spreadMode:null,annotationEditorMode:null});if(!(t.spreadMode===n.SpreadMode.NONE||t.pageViewsReady&&t.hasEqualPageSizes)){console.warn("Ignoring Spread modes when entering PresentationMode, since the document may contain varying page sizes.");_classPrivateFieldGet(this,c).spreadMode=t.spreadMode}t.annotationEditorMode!==r.AnnotationEditorType.DISABLE&&(_classPrivateFieldGet(this,c).annotationEditorMode=t.annotationEditorMode);try{await i;return!0}catch(e){_classPrivateMethodGet(this,E,_removeFullscreenChangeListeners2).call(this);_classPrivateMethodGet(this,d,_notifyStateChange2).call(this,n.PresentationModeState.NORMAL)}return!1}get active(){return _classPrivateFieldGet(this,l)===n.PresentationModeState.CHANGING||_classPrivateFieldGet(this,l)===n.PresentationModeState.FULLSCREEN}_prepareFullscreenMode(){const e=document.getElementsByClassName("zoom")[0].parentElement,t=e.parentElement;this.ngxContainer=t;for(let i=0;i<t.childElementCount;i++)t.children.item(i)===e&&(this.ngxContainerIndex=i);t.removeChild(e);document.body.append(e);const i=document.body.children;for(let t=0;t<i.length;t++){const n=i.item(t);n!==e&&n instanceof HTMLElement&&n.classList.add("hidden-by-fullscreen")}document.getElementById("sidebarContainer").classList.add("hidden-by-fullscreen");document.getElementsByClassName("toolbar")[0].classList.add("hidden-by-fullscreen")}_tidyUpFullscreenMode(){if(this.ngxContainer){const e=document.getElementsByClassName("zoom")[0].parentElement;document.body.removeChild(e);this.ngxContainerIndex>=this.ngxContainer.childElementCount?this.ngxContainer.append(e):this.ngxContainer.insertBefore(e,this.ngxContainer.children.item(this.ngxContainerIndex));this.ngxContainer=void 0;const t=document.body.children;for(let i=0;i<t.length;i++){const n=t.item(i);n!==e&&n instanceof HTMLElement&&n.classList.contains("hidden-by-fullscreen")&&n.classList.remove("hidden-by-fullscreen")}document.getElementById("sidebarContainer").classList.remove("hidden-by-fullscreen");document.getElementsByClassName("toolbar")[0].classList.remove("hidden-by-fullscreen")}}};function _mouseWheel2(e){if(!this.active)return;e.preventDefault();const t=(0,n.normalizeWheelEventDelta)(e),i=Date.now(),r=this.mouseScrollTimeStamp;if(!(i>r&&i-r<50)){(this.mouseScrollDelta>0&&t<0||this.mouseScrollDelta<0&&t>0)&&_classPrivateMethodGet(this,w,_resetMouseScrollState2).call(this);this.mouseScrollDelta+=t;if(Math.abs(this.mouseScrollDelta)>=.1){const e=this.mouseScrollDelta;_classPrivateMethodGet(this,w,_resetMouseScrollState2).call(this);(e>0?this.pdfViewer.previousPage():this.pdfViewer.nextPage())&&(this.mouseScrollTimeStamp=i)}}}function _notifyStateChange2(e){_classPrivateFieldSet(this,l,e);this.eventBus.dispatch("presentationmodechanged",{source:this,state:e})}function _enter2(){_classPrivateMethodGet(this,d,_notifyStateChange2).call(this,n.PresentationModeState.FULLSCREEN);this.container.classList.add(s);setTimeout((()=>{this.pdfViewer.scrollMode=n.ScrollMode.PAGE;null!==_classPrivateFieldGet(this,c).spreadMode&&(this.pdfViewer.spreadMode=n.SpreadMode.NONE);this.pdfViewer.currentPageNumber=_classPrivateFieldGet(this,c).pageNumber;this.pdfViewer.currentScaleValue="page-fit";null!==_classPrivateFieldGet(this,c).annotationEditorMode&&(this.pdfViewer.annotationEditorMode=r.AnnotationEditorType.NONE)}),0);_classPrivateMethodGet(this,y,_addWindowListeners2).call(this);_classPrivateMethodGet(this,m,_showControls2).call(this);this.contextMenuOpen=!1;window.getSelection().removeAllRanges()}function _exit2(){const e=this.pdfViewer.currentPageNumber;this.container.classList.remove(s);setTimeout((()=>{_classPrivateMethodGet(this,E,_removeFullscreenChangeListeners2).call(this);_classPrivateMethodGet(this,d,_notifyStateChange2).call(this,n.PresentationModeState.NORMAL);this.pdfViewer.scrollMode=_classPrivateFieldGet(this,c).scrollMode;null!==_classPrivateFieldGet(this,c).spreadMode&&(this.pdfViewer.spreadMode=_classPrivateFieldGet(this,c).spreadMode);this.pdfViewer.currentScaleValue=_classPrivateFieldGet(this,c).scaleValue;this.pdfViewer.currentPageNumber=e;null!==_classPrivateFieldGet(this,c).annotationEditorMode&&(this.pdfViewer.annotationEditorMode=_classPrivateFieldGet(this,c).annotationEditorMode);_classPrivateFieldSet(this,c,null)}),0);_classPrivateMethodGet(this,b,_removeWindowListeners2).call(this);_classPrivateMethodGet(this,v,_hideControls2).call(this);_classPrivateMethodGet(this,w,_resetMouseScrollState2).call(this);this.contextMenuOpen=!1}function _mouseDown2(e){if(this.contextMenuOpen){this.contextMenuOpen=!1;e.preventDefault()}else if(0===e.button){if(!(e.target.href&&e.target.classList.contains("internalLink"))){e.preventDefault();e.shiftKey?this.pdfViewer.previousPage():this.pdfViewer.nextPage()}}}function _contextMenu2(){this.contextMenuOpen=!0}function _showControls2(){this.controlsTimeout?clearTimeout(this.controlsTimeout):this.container.classList.add(o);this.controlsTimeout=setTimeout((()=>{this.container.classList.remove(o);delete this.controlsTimeout}),3e3)}function _hideControls2(){if(this.controlsTimeout){clearTimeout(this.controlsTimeout);this.container.classList.remove(o);delete this.controlsTimeout}}function _resetMouseScrollState2(){this.mouseScrollTimeStamp=0;this.mouseScrollDelta=0}function _touchSwipe2(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,r=Math.abs(Math.atan2(n,i));Math.abs(i)>50&&(r<=a||r>=Math.PI-a)?t=i:Math.abs(n)>50&&Math.abs(r-Math.PI/2)<=a&&(t=n);t>0?this.pdfViewer.previousPage():t<0&&this.pdfViewer.nextPage()}}function _addWindowListeners2(){this.showControlsBind=_classPrivateMethodGet(this,m,_showControls2).bind(this);this.mouseDownBind=_classPrivateMethodGet(this,g,_mouseDown2).bind(this);this.mouseWheelBind=_classPrivateMethodGet(this,h,_mouseWheel2).bind(this);this.resetMouseScrollStateBind=_classPrivateMethodGet(this,w,_resetMouseScrollState2).bind(this);this.contextMenuBind=_classPrivateMethodGet(this,f,_contextMenu2).bind(this);this.touchSwipeBind=_classPrivateMethodGet(this,_,_touchSwipe2).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)}function _removeWindowListeners2(){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}function _fullscreenChange2(){document.fullscreenElement?_classPrivateMethodGet(this,u,_enter2).call(this):_classPrivateMethodGet(this,p,_exit2).call(this)}function _addFullscreenChangeListeners2(){this.fullscreenChangeBind=_classPrivateMethodGet(this,P,_fullscreenChange2).bind(this);window.addEventListener("fullscreenchange",this.fullscreenChangeBind)}function _removeFullscreenChangeListeners2(){window.removeEventListener("fullscreenchange",this.fullscreenChangeBind);delete this.fullscreenChangeBind}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFRenderingQueue=void 0;i(94);i(182);var n=i(155),r=i(153);t.PDFRenderingQueue=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;if(this.idleTimeout){clearTimeout(this.idleTimeout);this.idleTimeout=null}this.pdfViewer.forceRendering(e)||this.isThumbnailViewEnabled&&null!==(t=this.pdfThumbnailViewer)&&void 0!==t&&t.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),3e4))}getHighestPriority(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=e.views,s=r.length;if(0===s)return null;for(let e=0;e<s;e++){const t=r[e].view;if(!this.isViewFinished(t))return t}const o=e.first.id,a=e.last.id;if(a-o+1>s){const n=e.ids;for(let e=1,r=a-o;e<r;e++){const r=i?o+e:a-e;if(n.has(r))continue;const s=t[r-1];if(!this.isViewFinished(s))return s}}let l=i?a:o-2,c=t[l];if(c&&!this.isViewFinished(c))return c;if(n){l+=i?1:-1;c=t[l];if(c&&!this.isViewFinished(c))return c}return null}isViewFinished(e){return e.renderingState===r.RenderingStates.FINISHED}renderView(e){switch(e.renderingState){case r.RenderingStates.FINISHED:return!1;case r.RenderingStates.PAUSED:this.highestPriorityPage=e.renderingId;e.resume();break;case r.RenderingStates.RUNNING:this.highestPriorityPage=e.renderingId;break;case r.RenderingStates.INITIAL:this.highestPriorityPage=e.renderingId;e.draw().finally((()=>{this.renderHighestPriority()})).catch((e=>{e instanceof n.RenderingCancelledException||Window.ngxConsole.error('renderView: "'.concat(e,'"'))}))}return!0}}},(e,t,i)=>{"use strict";var n=i(65),r=i(19),s=i(114),o=i(13),a=i(28),l=i(7),c=i(99),h=i(130),d=i(68),u=s&&s.prototype;n({target:"Promise",proto:!0,real:!0,forced:!!s&&o((function(){u.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=c(this,a("Promise")),i=l(e);return this.then(i?function(i){return h(t,e()).then((function(){return i}))}:e,i?function(i){return h(t,e()).then((function(){throw i}))}:e)}});if(!r&&l(s)){var p=a("Promise").prototype.finally;u.finally!==p&&d(u,"finally",p,{unsafe:!0})}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFScriptingManager=void 0;i(94);i(1);var n=i(153),r=i(155);t.PDFScriptingManager=class PDFScriptingManager{constructor(e){let{eventBus:t,sandboxBundleSrc:i=null,scriptingFactory:n=null,docPropertiesLookup:r=null}=e;this._pdfDocument=null;this._pdfViewer=null;this._closeCapability=null;this._destroyCapability=null;this._scripting=null;this._mouseState=Object.create(null);this._ready=!1;this._eventBus=t;this._sandboxBundleSrc=i;this._scriptingFactory=n;this._docPropertiesLookup=r}setViewer(e){this._pdfViewer=e}async setDocument(e){var t;this._pdfDocument&&await this._destroyScripting();this._pdfDocument=e;if(!e)return;const[i,n,r]=await Promise.all([e.getFieldObjects(),e.getCalculationOrderIds(),e.getJSActions()]);if(!i&&!r){await this._destroyScripting();return}if(e!==this._pdfDocument)return;try{this._scripting=this._createScripting()}catch(e){Window.ngxConsole.error('PDFScriptingManager.setDocument: "'.concat(null==e?void 0:e.message,'".'));await this._destroyScripting();return}this._internalEvents.set("updatefromsandbox",(e=>{(null==e?void 0:e.source)===window&&this._updateFromSandbox(e.detail)}));this._internalEvents.set("dispatcheventinsandbox",(e=>{var t;null===(t=this._scripting)||void 0===t||t.dispatchEventInSandbox(e.detail)}));this._internalEvents.set("pagechanging",(e=>{let{pageNumber:t,previous:i}=e;if(t!==i){this._dispatchPageClose(i);this._dispatchPageOpen(t)}}));this._internalEvents.set("pagerendered",(e=>{let{pageNumber:t}=e;this._pageOpenPending.has(t)&&t===this._pdfViewer.currentPageNumber&&this._dispatchPageOpen(t)}));this._internalEvents.set("pagesdestroy",(async e=>{var t,i;await this._dispatchPageClose(this._pdfViewer.currentPageNumber);await(null===(t=this._scripting)||void 0===t?void 0:t.dispatchEventInSandbox({id:"doc",name:"WillClose"}));null===(i=this._closeCapability)||void 0===i||i.resolve()}));this._domEvents.set("mousedown",(e=>{this._mouseState.isDown=!0}));this._domEvents.set("mouseup",(e=>{this._mouseState.isDown=!1}));for(const[e,t]of this._internalEvents)this._eventBus._on(e,t);const s=document.querySelector(".pdfViewer");for(const[e,t]of this._domEvents)s.addEventListener(e,t,!0);try{const t=await this._getDocProperties();if(e!==this._pdfDocument)return;await this._scripting.createSandbox({objects:i,calculationOrder:n,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...t,actions:r}});this._eventBus.dispatch("sandboxcreated",{source:this})}catch(e){Window.ngxConsole.error('PDFScriptingManager.setDocument: "'.concat(null==e?void 0:e.message,'".'));await this._destroyScripting();return}await(null===(t=this._scripting)||void 0===t?void 0:t.dispatchEventInSandbox({id:"doc",name:"Open"}));await this._dispatchPageOpen(this._pdfViewer.currentPageNumber,!0);Promise.resolve().then((()=>{e===this._pdfDocument&&(this._ready=!0)}))}async dispatchWillSave(e){var t;return null===(t=this._scripting)||void 0===t?void 0:t.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(e){var t;return null===(t=this._scripting)||void 0===t?void 0:t.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(e){var t;return null===(t=this._scripting)||void 0===t?void 0:t.dispatchEventInSandbox({id:"doc",name:"WillPrint"})}async dispatchDidPrint(e){var t;return null===(t=this._scripting)||void 0===t?void 0:t.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get mouseState(){return this._mouseState}get destroyPromise(){var e;return(null===(e=this._destroyCapability)||void 0===e?void 0:e.promise)||null}get ready(){return this._ready}get _internalEvents(){return(0,r.shadow)(this,"_internalEvents",new Map)}get _domEvents(){return(0,r.shadow)(this,"_domEvents",new Map)}get _pageOpenPending(){return(0,r.shadow)(this,"_pageOpenPending",new Set)}get _visitedPages(){return(0,r.shadow)(this,"_visitedPages",new Map)}async _updateFromSandbox(e){const t=this._pdfViewer.isInPresentationMode||this._pdfViewer.isChangingPresentationMode,{id:i,siblings:r,command:s,value:o}=e;if(!i){switch(s){case"clear":Window.ngxConsole.clear();break;case"error":Window.ngxConsole.error(o);break;case"layout":if(t)return;const e=(0,n.apiPageLayoutToViewerModes)(o);this._pdfViewer.spreadMode=e.spreadMode;break;case"page-num":this._pdfViewer.currentPageNumber=o+1;break;case"print":await this._pdfViewer.pagesPromise;this._eventBus.dispatch("print",{source:this});break;case"println":Window.ngxConsole.log(o);break;case"zoom":if(t)return;this._pdfViewer.currentScaleValue=o;break;case"SaveAs":this._eventBus.dispatch("download",{source:this});break;case"FirstPage":this._pdfViewer.currentPageNumber=1;break;case"LastPage":this._pdfViewer.currentPageNumber=this._pdfViewer.pagesCount;break;case"NextPage":this._pdfViewer.nextPage();break;case"PrevPage":this._pdfViewer.previousPage();break;case"ZoomViewIn":if(t)return;this._pdfViewer.increaseScale();break;case"ZoomViewOut":if(t)return;this._pdfViewer.decreaseScale()}return}if(t&&e.focus)return;delete e.id;delete e.siblings;const a=r?[i,...r]:[i];for(const t of a){const i=document.querySelector('[data-element-id="'.concat(t,'"]'));if(i)i.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:e}));else{var l;null===(l=this._pdfDocument)||void 0===l||l.annotationStorage.setValue(t,void 0,e)}}}async _dispatchPageOpen(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this._pdfDocument,s=this._visitedPages;t&&(this._closeCapability=(0,r.createPromiseCapability)());if(!this._closeCapability)return;const o=this._pdfViewer.getPageView(e-1);if((null==o?void 0:o.renderingState)!==n.RenderingStates.FINISHED){this._pageOpenPending.add(e);return}this._pageOpenPending.delete(e);const a=(async()=>{var t,n;const r=await(s.has(e)?null:null===(t=o.pdfPage)||void 0===t?void 0:t.getJSActions());i===this._pdfDocument&&await(null===(n=this._scripting)||void 0===n?void 0:n.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:e,actions:r}))})();s.set(e,a)}async _dispatchPageClose(e){var t;const i=this._pdfDocument,n=this._visitedPages;if(!this._closeCapability)return;if(this._pageOpenPending.has(e))return;const r=n.get(e);if(r){n.set(e,null);await r;i===this._pdfDocument&&await(null===(t=this._scripting)||void 0===t?void 0:t.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:e}))}}async _getDocProperties(){if(this._docPropertiesLookup)return this._docPropertiesLookup(this._pdfDocument);throw new Error("_getDocProperties: Unable to lookup properties.")}_createScripting(){this._destroyCapability=(0,r.createPromiseCapability)();if(this._scripting)throw new Error("_createScripting: Scripting already exists.");if(this._scriptingFactory)return this._scriptingFactory.createScripting({sandboxBundleSrc:this._sandboxBundleSrc});throw new Error("_createScripting: Cannot create scripting.")}async _destroyScripting(){var e;if(this._scripting){if(this._closeCapability){await Promise.race([this._closeCapability.promise,new Promise((e=>{setTimeout(e,1e3)}))]).catch((e=>{}));this._closeCapability=null}this._pdfDocument=null;try{await this._scripting.destroySandbox()}catch(e){}for(const[e,t]of this._internalEvents)this._eventBus._off(e,t);this._internalEvents.clear();for(const[e,t]of this._domEvents)window.removeEventListener(e,t,!0);this._domEvents.clear();this._pageOpenPending.clear();this._visitedPages.clear();this._scripting=null;delete this._mouseState.isDown;this._ready=!1;null===(e=this._destroyCapability)||void 0===e||e.resolve()}else{var t;this._pdfDocument=null;null===(t=this._destroyCapability)||void 0===t||t.resolve()}}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFSidebar=void 0;i(1);var n=i(153);function _classPrivateMethodInitSpec(e,t){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.add(e)}function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}const r="pdfSidebarNotification";var s=new WeakSet,o=new WeakSet,a=new WeakSet,l=new WeakSet,c=new WeakSet,h=new WeakSet;t.PDFSidebar=class PDFSidebar{constructor(e){let{elements:t,pdfViewer:i,pdfThumbnailViewer:r,eventBus:d,l10n:u}=e;_classPrivateMethodInitSpec(this,h);_classPrivateMethodInitSpec(this,c);_classPrivateMethodInitSpec(this,l);_classPrivateMethodInitSpec(this,a);_classPrivateMethodInitSpec(this,o);_classPrivateMethodInitSpec(this,s);this.isOpen=!1;this.active=n.SidebarView.THUMBS;this.isInitialViewSet=!1;this.isInitialEventDispatched=!1;this.onToggled=null;this.pdfViewer=i;this.pdfThumbnailViewer=r;this.outerContainer=t.outerContainer;this.sidebarContainer=t.sidebarContainer;this.toggleButton=t.toggleButton;this.thumbnailButton=t.thumbnailButton;this.outlineButton=t.outlineButton;this.attachmentsButton=t.attachmentsButton;this.layersButton=t.layersButton;this.thumbnailView=t.thumbnailView;this.outlineView=t.outlineView;this.attachmentsView=t.attachmentsView;this.layersView=t.layersView;this._outlineOptionsContainer=t.outlineOptionsContainer;this._currentOutlineItemButton=t.currentOutlineItemButton;this.eventBus=d;this.l10n=u;_classPrivateMethodGet(this,h,_addEventListeners2).call(this)}reset(){this.isInitialViewSet=!1;this.isInitialEventDispatched=!1;_classPrivateMethodGet(this,c,_hideUINotification2).call(this,!0);this.switchView(n.SidebarView.THUMBS);this.outlineButton.disabled=!1;this.attachmentsButton.disabled=!1;this.layersButton.disabled=!1;this.outlineButton.hidden=!1;this.attachmentsButton.hidden=!1;this.layersButton.hidden=!1;this._currentOutlineItemButton.disabled=!0}get visibleView(){return this.isOpen?this.active:n.SidebarView.NONE}setInitialView(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.SidebarView.NONE;if(!this.isInitialViewSet){this.isInitialViewSet=!0;if(e!==n.SidebarView.NONE&&e!==n.SidebarView.UNKNOWN){this.switchView(e,!0);this.isInitialEventDispatched||_classPrivateMethodGet(this,s,_dispatchEvent2).call(this)}else _classPrivateMethodGet(this,s,_dispatchEvent2).call(this)}}switchView(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=e!==this.active;let r=!1;switch(e){case n.SidebarView.NONE:this.isOpen&&this.close();return;case n.SidebarView.THUMBS:this.isOpen&&i&&(r=!0);break;case n.SidebarView.OUTLINE:if(this.outlineButton.disabled)return;break;case n.SidebarView.ATTACHMENTS:if(this.attachmentsButton.disabled)return;break;case n.SidebarView.LAYERS:if(this.layersButton.disabled)return;break;default:Window.ngxConsole.error('PDFSidebar.switchView: "'.concat(e,'" is not a valid view.'));return}this.active=e;const l=e===n.SidebarView.THUMBS,c=e===n.SidebarView.OUTLINE,h=e===n.SidebarView.ATTACHMENTS,d=e===n.SidebarView.LAYERS;this.thumbnailButton.classList.toggle("toggled",l);this.outlineButton.classList.toggle("toggled",c);this.attachmentsButton.classList.toggle("toggled",h);this.layersButton.classList.toggle("toggled",d);this.thumbnailButton.setAttribute("aria-checked",l);this.outlineButton.setAttribute("aria-checked",c);this.attachmentsButton.setAttribute("aria-checked",h);this.layersButton.setAttribute("aria-checked",d);this.thumbnailView.classList.toggle("hidden",!l);this.outlineView.classList.toggle("hidden",!c);this.attachmentsView.classList.toggle("hidden",!h);this.layersView.classList.toggle("hidden",!d);this._outlineOptionsContainer.classList.toggle("hidden",!c);if(!t||this.isOpen){if(r){_classPrivateMethodGet(this,a,_updateThumbnailViewer2).call(this);_classPrivateMethodGet(this,o,_forceRendering2).call(this)}i&&_classPrivateMethodGet(this,s,_dispatchEvent2).call(this)}else this.open()}open(){if(!this.isOpen){this.isOpen=!0;this.toggleButton.classList.add("toggled");this.toggleButton.setAttribute("aria-expanded","true");this.outerContainer.classList.add("sidebarMoving","sidebarOpen");this.active===n.SidebarView.THUMBS&&_classPrivateMethodGet(this,a,_updateThumbnailViewer2).call(this);_classPrivateMethodGet(this,o,_forceRendering2).call(this);_classPrivateMethodGet(this,s,_dispatchEvent2).call(this);_classPrivateMethodGet(this,c,_hideUINotification2).call(this)}}close(){if(this.isOpen){this.isOpen=!1;this.toggleButton.classList.remove("toggled");this.toggleButton.setAttribute("aria-expanded","false");this.outerContainer.classList.add("sidebarMoving");this.outerContainer.classList.remove("sidebarOpen");_classPrivateMethodGet(this,o,_forceRendering2).call(this);_classPrivateMethodGet(this,s,_dispatchEvent2).call(this)}}toggle(){this.isOpen?this.close():this.open()}};function _dispatchEvent2(){this.isInitialViewSet&&!this.isInitialEventDispatched&&(this.isInitialEventDispatched=!0);this.eventBus.dispatch("sidebarviewchanged",{source:this,view:this.visibleView})}function _forceRendering2(){if(this.onToggled)this.onToggled();else{this.pdfViewer.forceRendering();this.pdfThumbnailViewer.forceRendering()}}function _updateThumbnailViewer2(){const{pdfViewer:e,pdfThumbnailViewer:t}=this,i=e.pagesCount;for(let r=0;r<i;r++){const i=e.getPageView(r);if((null==i?void 0:i.renderingState)===n.RenderingStates.FINISHED){t.getThumbnail(r).setImage(i)}}t.scrollThumbnailIntoView(e.currentPageNumber)}function _showUINotification2(){this.l10n.get("toggle_sidebar_notification2.title").then((e=>{this.toggleButton.title=e}));this.isOpen||this.toggleButton.classList.add(r)}function _hideUINotification2(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(this.isOpen||e)&&this.toggleButton.classList.remove(r);e&&this.l10n.get("toggle_sidebar.title").then((e=>{this.toggleButton.title=e}))}function _addEventListeners2(){this.sidebarContainer.addEventListener("transitionend",(e=>{e.target===this.sidebarContainer&&this.outerContainer.classList.remove("sidebarMoving")}));this.toggleButton.addEventListener("click",(()=>{this.toggle()}));this.thumbnailButton.addEventListener("click",(()=>{this.switchView(n.SidebarView.THUMBS)}));this.outlineButton.addEventListener("click",(()=>{this.switchView(n.SidebarView.OUTLINE)}));this.outlineButton.addEventListener("dblclick",(()=>{this.eventBus.dispatch("toggleoutlinetree",{source:this})}));this.attachmentsButton.addEventListener("click",(()=>{this.switchView(n.SidebarView.ATTACHMENTS)}));this.layersButton.addEventListener("click",(()=>{this.switchView(n.SidebarView.LAYERS)}));this.layersButton.addEventListener("dblclick",(()=>{this.eventBus.dispatch("resetlayers",{source:this})}));this._currentOutlineItemButton.addEventListener("click",(()=>{this.eventBus.dispatch("currentoutlineitem",{source:this})}));const onTreeLoaded=(e,t,i)=>{t.disabled=!e;t.hidden=!e;e?_classPrivateMethodGet(this,l,_showUINotification2).call(this):this.active===i&&this.switchView(n.SidebarView.THUMBS)};this.eventBus._on("outlineloaded",(e=>{onTreeLoaded(e.outlineCount,this.outlineButton,n.SidebarView.OUTLINE);e.enableCurrentOutlineItemButton&&e.currentOutlineItemPromise&&e.currentOutlineItemPromise.then((e=>{this.isInitialViewSet&&(this._currentOutlineItemButton.disabled=!e)}))}));this.eventBus._on("attachmentsloaded",(e=>{onTreeLoaded(e.attachmentsCount,this.attachmentsButton,n.SidebarView.ATTACHMENTS)}));this.eventBus._on("layersloaded",(e=>{onTreeLoaded(e.layersCount,this.layersButton,n.SidebarView.LAYERS)}));this.eventBus._on("presentationmodechanged",(e=>{e.state===n.PresentationModeState.NORMAL&&this.visibleView===n.SidebarView.THUMBS&&_classPrivateMethodGet(this,a,_updateThumbnailViewer2).call(this)}))}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFSidebarResizer=void 0;i(94);var n=i(153);const r="sidebarResizing";t.PDFSidebarResizer=class PDFSidebarResizer{constructor(e,t,i){this.isRTL=!1;this.sidebarOpen=!1;this._width=null;this._outerContainerWidth=null;this._boundEvents=Object.create(null);this.outerContainer=e.outerContainer;this.resizer=e.resizer;this.eventBus=t;i.getDirection().then((e=>{this.isRTL="rtl"===e}));this._addEventListeners()}get outerContainerWidth(){return this._outerContainerWidth||(this._outerContainerWidth=this.outerContainer.clientWidth)}_updateWidth(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const t=Math.floor(this.outerContainerWidth/2);e>t&&(e=t);e<200&&(e=200);if(e===this._width)return!1;this._width=e;n.docStyle.setProperty("--sidebar-width","".concat(e,"px"));return!0}_mouseMove(e){let t=e.clientX;this.isRTL&&(t=this.outerContainerWidth-t);this._updateWidth(t)}_mouseUp(e){this.outerContainer.classList.remove(r);this.eventBus.dispatch("resize",{source:this});const t=this._boundEvents;window.removeEventListener("mousemove",t.mouseMove);window.removeEventListener("mouseup",t.mouseUp)}_addEventListeners(){const e=this._boundEvents;e.mouseMove=this._mouseMove.bind(this);e.mouseUp=this._mouseUp.bind(this);this.resizer.addEventListener("mousedown",(t=>{if(0===t.button){this.outerContainer.classList.add(r);window.addEventListener("mousemove",e.mouseMove);window.addEventListener("mouseup",e.mouseUp)}}));this.eventBus._on("sidebarviewchanged",(e=>{this.sidebarOpen=!(null==e||!e.view)}));this.eventBus._on("resize",(e=>{if((null==e?void 0:e.source)!==window)return;this._outerContainerWidth=null;if(!this._width)return;if(!this.sidebarOpen){this._updateWidth(this._width);return}this.outerContainer.classList.add(r);const t=this._updateWidth(this._width);Promise.resolve().then((()=>{this.outerContainer.classList.remove(r);t&&this.eventBus.dispatch("resize",{source:this})}))}))}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFThumbnailViewer=void 0;i(1);i(94);var n=i(153),r=i(187);function _classPrivateMethodInitSpec(e,t){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.add(e)}function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}const s="selected";var o=new WeakSet,a=new WeakSet;t.PDFThumbnailViewer=class PDFThumbnailViewer{constructor(e){let{container:t,eventBus:i,linkService:r,renderingQueue:s,l10n:l,pageColors:c}=e;_classPrivateMethodInitSpec(this,a);_classPrivateMethodInitSpec(this,o);this.container=t;this.linkService=r;this.renderingQueue=s;this.l10n=l;this.pageColors=c||null;if(this.pageColors&&(!CSS.supports("color",this.pageColors.background)||!CSS.supports("color",this.pageColors.foreground))){(this.pageColors.background||this.pageColors.foreground)&&Window.ngxConsole.warn("PDFThumbnailViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used.");this.pageColors=null}this.scroll=(0,n.watchScroll)(this.container,this._scrollUpdated.bind(this));this._resetView()}_scrollUpdated(){this.renderingQueue.renderHighestPriority()}getThumbnail(e){return this._thumbnails[e]}_getVisibleThumbs(){return(0,n.getVisibleElements)({scrollEl:this.container,views:this._thumbnails})}scrollThumbnailIntoView(e){if(!this.pdfDocument)return;const t=this._thumbnails[e-1];if(!t){Window.ngxConsole.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.');return}if(e!==this._currentPageNumber){this._thumbnails[this._currentPageNumber-1].div.classList.remove(s);t.div.classList.add(s)}const{first:i,last:r,views:o}=this._getVisibleThumbs();if(o.length>0){let s=!1;if(e<=i.id||e>=r.id)s=!0;else for(const{id:t,percent:i}of o)if(t===e){s=i<100;break}s&&(0,n.scrollIntoView)(t.div,{top:-19})}this._currentPageNumber=e}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!(0,n.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!==n.RenderingStates.FINISHED&&e.reset();r.TempImageFactory.destroyCanvas()}_resetView(){this._thumbnails=[];this._currentPageNumber=1;this._pageLabels=null;this._pagesRotation=0;this.container.textContent=""}setDocument(e){this.initialized=!1;if(this.pdfDocument){this._cancelRendering();this._resetView()}this.pdfDocument=e;if(!e)return;if(this.initialized)return;this.initialized=!0;const t=e.getPage(1),i=e.getOptionalContentConfig();t.then((t=>{const n=e.numPages,o=t.getViewport({scale:1});for(let e=1;e<=n;++e){const t=new r.PDFThumbnailView({container:this.container,id:e,defaultViewport:o.clone(),optionalContentConfigPromise:i,linkService:this.linkService,renderingQueue:this.renderingQueue,l10n:this.l10n,pageColors:this.pageColors});this._thumbnails.push(t)}const a=this._thumbnails[0];a&&a.setPdfPage(t);this._thumbnails[this._currentPageNumber-1].div.classList.add(s)})).catch((e=>{Window.ngxConsole.error("Unable to initialize thumbnail viewer",e)}))}_cancelRendering(){for(const e of this._thumbnails)e.cancelRendering()}setPageLabels(e){if(this.pdfDocument){if(e)if(Array.isArray(e)&&this.pdfDocument.numPages===e.length)this._pageLabels=e;else{this._pageLabels=null;Window.ngxConsole.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.")}else this._pageLabels=null;for(let e=0,n=this._thumbnails.length;e<n;e++){var t,i;this._thumbnails[e].setPageLabel(null!==(t=null===(i=this._pageLabels)||void 0===i?void 0:i[e])&&void 0!==t?t:null)}}}forceRendering(){const e=this._getVisibleThumbs(),t=_classPrivateMethodGet(this,a,_getScrollAhead2).call(this,e),i=this.renderingQueue.getHighestPriority(e,this._thumbnails,t);if(i){_classPrivateMethodGet(this,o,_ensurePdfPageLoaded2).call(this,i).then((()=>{this.renderingQueue.renderView(i)}));return!0}return!1}};async function _ensurePdfPageLoaded2(e){if(e.pdfPage)return e.pdfPage;try{const t=await this.pdfDocument.getPage(e.id);e.pdfPage||e.setPdfPage(t);return t}catch(e){Window.ngxConsole.error("Unable to get page for thumb view",e);return null}}function _getScrollAhead2(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}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TempImageFactory=t.PDFThumbnailView=void 0;i(94);i(182);i(1);var n=i(153),r=i(155);function _classStaticPrivateFieldSpecSet(e,t,i,n){_classCheckPrivateStaticAccess(e,t);_classCheckPrivateStaticFieldDescriptor(i,"set");!function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}(e,i,n);return n}function _classStaticPrivateFieldSpecGet(e,t,i){_classCheckPrivateStaticAccess(e,t);_classCheckPrivateStaticFieldDescriptor(i,"get");return function _classApplyDescriptorGet(e,t){if(t.get)return t.get.call(e);return t.value}(e,i)}function _classCheckPrivateStaticFieldDescriptor(e,t){if(void 0===e)throw new TypeError("attempted to "+t+" private static field before its declaration")}function _classCheckPrivateStaticAccess(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}class TempImageFactory{static getCanvas(e,t){const i=_classStaticPrivateFieldSpecGet(this,TempImageFactory,s)||_classStaticPrivateFieldSpecSet(this,TempImageFactory,s,document.createElement("canvas"));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();return[i,i.getContext("2d")]}static destroyCanvas(){const e=_classStaticPrivateFieldSpecGet(this,TempImageFactory,s);if(e){e.width=0;e.height=0}_classStaticPrivateFieldSpecSet(this,TempImageFactory,s,null)}}t.TempImageFactory=TempImageFactory;var s={writable:!0,value:null};t.PDFThumbnailView=class PDFThumbnailView{constructor(e){let{container:t,id:i,defaultViewport:r,optionalContentConfigPromise:s,linkService:o,renderingQueue:a,l10n:l,pageColors:c}=e;this.id=i;this.renderingId="thumbnail"+i;this.pageLabel=null;this.pdfPage=null;this.rotation=0;this.viewport=r;this.pdfPageRotate=r.rotation;this._optionalContentConfigPromise=s||null;this.pageColors=c||null;this.linkService=o;this.renderingQueue=a;this.renderTask=null;this.renderingState=n.RenderingStates.INITIAL;this.resume=null;const h=this.viewport.width,d=h/this.viewport.height;this.canvasWidth=98;this.canvasHeight=this.canvasWidth/d|0;this.scale=this.canvasWidth/h;this.l10n=l;window.pdfThumbnailGenerator?window.pdfThumbnailGenerator(this,o,i,t,this._thumbPageTitle):this.createThumbnail(this,o,i,t,this._thumbPageTitle)}createThumbnail(e,t,i,n,r){const s=document.createElement("a");s.href=t.getAnchorUrl("#page="+i);r.then((e=>{s.title=e}));s.onclick=function(){t.goToPage(i);return!1};e.anchor=s;const o=document.createElement("div");o.className="thumbnail";o.setAttribute("data-page-number",this.id);e.div=o;const a=document.createElement("div");a.className="thumbnailSelectionRing";a.style.width=this.canvasWidth+2+"px";a.style.height=this.canvasHeight+2+"px";e.ring=a;o.append(a);s.append(o);n.append(s)}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=n.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");const i=this.ring;i.textContent="";i.style.width=this.canvasWidth+2+"px";i.style.height=this.canvasHeight+2+"px";if(this.canvas){this.canvas.width=0;this.canvas.height=0;delete this.canvas}if(this.image){this.image.removeAttribute("src");delete this.image}}update(e){let{rotation:t=null}=e;"number"==typeof t&&(this.rotation=t);const i=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:1,rotation:i});this.reset()}cancelRendering(){if(this.renderTask){this.renderTask.cancel();this.renderTask=null}this.resume=null}_getPageDrawContext(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const t=document.createElement("canvas"),i=t.getContext("2d",{alpha:!1}),r=new n.OutputScale;t.width=e*this.canvasWidth*r.sx|0;t.height=e*this.canvasHeight*r.sy|0;return{ctx:i,canvas:t,transform:r.scaled?[r.sx,0,0,r.sy,0,0]:null}}_convertCanvasToImage(e){if(this.renderingState!==n.RenderingStates.FINISHED)throw new Error("_convertCanvasToImage: Rendering has not finished.");const t=this._reduceImage(e),i=document.createElement("img");i.className="thumbnailImage";this._thumbPageCanvas.then((e=>{i.setAttribute("aria-label",e)}));i.style.width=this.canvasWidth+"px";i.style.height=this.canvasHeight+"px";i.src=t.toDataURL();this.image=i;this.div.setAttribute("data-loaded",!0);this.ring.append(i);t.width=0;t.height=0}draw(){var e=this;if(this.renderingState!==n.RenderingStates.INITIAL){Window.ngxConsole.error("Must be in new state before drawing");return Promise.resolve()}const{pdfPage:t}=this;if(!t){this.renderingState=n.RenderingStates.FINISHED;return Promise.reject(new Error("pdfPage is not loaded"))}this.renderingState=n.RenderingStates.RUNNING;const finishRenderTask=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;l===e.renderTask&&(e.renderTask=null);if(!(t instanceof r.RenderingCancelledException)){e.renderingState=n.RenderingStates.FINISHED;e._convertCanvasToImage(s);if(t)throw t}},{ctx:i,canvas:s,transform:o}=this._getPageDrawContext(2),a={canvasContext:i,transform:o,viewport:this.viewport.clone({scale:2*this.scale}),optionalContentConfigPromise:this._optionalContentConfigPromise,background:PDFViewerApplicationOptions.get("pdfBackgroundColor"),pageColors:this.pageColors},l=this.renderTask=t.render(a);l.onContinue=e=>{if(this.renderingQueue.isHighestPriority(this))e();else{this.renderingState=n.RenderingStates.PAUSED;this.resume=()=>{this.renderingState=n.RenderingStates.RUNNING;e()}}};const c=l.promise.then((function(){return finishRenderTask(null)}),(function(e){return finishRenderTask(e)}));c.finally((()=>{s.width=0;s.height=0;if(!this.linkService.isPageCached(this.id)){var e;null===(e=this.pdfPage)||void 0===e||e.cleanup()}}));return c}setImage(e){if(this.renderingState!==n.RenderingStates.INITIAL)return;const{thumbnailCanvas:t,pdfPage:i}=e;if(t){this.pdfPage||this.setPdfPage(i);this.renderingState=n.RenderingStates.FINISHED;this._convertCanvasToImage(t)}}_reduceImage(e){const{ctx:t,canvas:i}=this._getPageDrawContext();if(e.width<=2*i.width){t.drawImage(e,0,0,e.width,e.height,0,0,i.width,i.height);return i}let n=i.width<<3,r=i.height<<3;const[s,o]=TempImageFactory.getCanvas(n,r);for(;n>e.width||r>e.height;){n>>=1;r>>=1}o.drawImage(e,0,0,e.width,e.height,0,0,n,r);for(;n>2*i.width;){o.drawImage(s,0,0,n,r,0,0,n>>1,r>>1);n>>=1;r>>=1}t.drawImage(s,0,0,n,r,0,0,i.width,i.height);return 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;this._thumbPageTitle.then((e=>{this.anchor.title=e}));this.renderingState===n.RenderingStates.FINISHED&&this._thumbPageCanvas.then((e=>{var t;null===(t=this.image)||void 0===t||t.setAttribute("aria-label",e)}))}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFViewer=t.PDFSinglePageViewer=void 0;var n=i(153),r=i(189);class PDFViewer extends r.BaseViewer{}t.PDFViewer=PDFViewer;class PDFSinglePageViewer extends r.BaseViewer{_resetView(){super._resetView();this._scrollMode=n.ScrollMode.PAGE;this._spreadMode=n.SpreadMode.NONE}set scrollMode(e){}_updateScrollMode(){}set spreadMode(e){}_updateSpreadMode(){}}t.PDFSinglePageViewer=PDFSinglePageViewer},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PagesCountLimit=t.PDFPageViewBuffer=t.BaseViewer=void 0;i(131);i(1);i(94);i(84);i(132);var n=i(155),r=i(153),s=i(190),o=i(192),a=i(83),l=i(191),c=i(193),h=i(194),d=i(181),u=i(159),p=i(246),g=i(247),f=i(248),m=i(249);let v;var w;function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t);t.add(e)}function _classPrivateFieldInitSpec(e,t,i){_checkPrivateRedeclaration(e,t);t.set(e,i)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}function _classPrivateFieldGet(e,t){return function _classApplyDescriptorGet(e,t){if(t.get)return t.get.call(e);return t.value}(e,_classExtractFieldDescriptor(e,t,"get"))}function _classPrivateFieldSet(e,t,i){!function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}(e,_classExtractFieldDescriptor(e,t,"set"),i);return i}function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}const _="enablePermissions",y={FORCE_SCROLL_MODE_PAGE:15e3,FORCE_LAZY_PAGE_INIT:7500,PAUSE_EAGER_PAGE_INIT:250};t.PagesCountLimit=y;const b=null!==(w=a.compatibilityParams.annotationEditorMode)&&void 0!==w?w:n.AnnotationEditorType.DISABLE;function isValidAnnotationEditorMode(e){return Object.values(n.AnnotationEditorType).includes(e)&&e!==n.AnnotationEditorType.DISABLE}var P=new WeakMap,S=new WeakMap,E=new WeakSet;v=Symbol.iterator;class PDFPageViewBuffer{constructor(e){_classPrivateMethodInitSpec(this,E);_classPrivateFieldInitSpec(this,P,{writable:!0,value:new Set});_classPrivateFieldInitSpec(this,S,{writable:!0,value:0});_classPrivateFieldSet(this,S,e)}push(e){const t=_classPrivateFieldGet(this,P);t.has(e)&&t.delete(e);t.add(e);t.size>_classPrivateFieldGet(this,S)&&_classPrivateMethodGet(this,E,_destroyFirstView2).call(this)}resize(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;_classPrivateFieldSet(this,S,e);const i=_classPrivateFieldGet(this,P);if(t){const e=i.size;let n=1;for(const r of i){if(t.has(r.id)){i.delete(r);i.add(r)}if(++n>e)break}}for(;i.size>_classPrivateFieldGet(this,S);)_classPrivateMethodGet(this,E,_destroyFirstView2).call(this)}has(e){return _classPrivateFieldGet(this,P).has(e)}[v](){return _classPrivateFieldGet(this,P).keys()}}t.PDFPageViewBuffer=PDFPageViewBuffer;function _destroyFirstView2(){const e=_classPrivateFieldGet(this,P).keys().next().value;null==e||e.destroy();_classPrivateFieldGet(this,P).delete(e)}var x=new WeakMap,C=new WeakMap,T=new WeakMap,I=new WeakMap,M=new WeakMap,L=new WeakMap,A=new WeakMap,D=new WeakMap,k=new WeakSet,O=new WeakSet,R=new WeakSet,B=new WeakSet,N=new WeakSet,V=new WeakSet,U=new WeakSet,W=new WeakSet,H=new WeakSet;class BaseViewer{constructor(e){var t,i,s,o,a;_classPrivateMethodInitSpec(this,H);_classPrivateMethodInitSpec(this,W);_classPrivateMethodInitSpec(this,U);_classPrivateMethodInitSpec(this,V);_classPrivateMethodInitSpec(this,N);_classPrivateMethodInitSpec(this,B);_classPrivateMethodInitSpec(this,R);_classPrivateMethodInitSpec(this,O);_classPrivateMethodInitSpec(this,k);_classPrivateFieldInitSpec(this,x,{writable:!0,value:null});_classPrivateFieldInitSpec(this,C,{writable:!0,value:n.AnnotationEditorType.DISABLE});_classPrivateFieldInitSpec(this,T,{writable:!0,value:null});_classPrivateFieldInitSpec(this,I,{writable:!0,value:n.AnnotationMode.ENABLE_FORMS});_classPrivateFieldInitSpec(this,M,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,L,{writable:!0,value:0});_classPrivateFieldInitSpec(this,A,{writable:!0,value:null});_classPrivateFieldInitSpec(this,D,{writable:!0,value:null});if(this.constructor===BaseViewer)throw new Error("Cannot initialize BaseViewer.");const c="2.16.323";if(n.version!==c)throw new Error('The API version "'.concat(n.version,'" does not match the Viewer version "').concat(c,'".'));this.container=e.container;this.viewer=e.viewer||e.container.firstElementChild;this.pageViewMode=e.pageViewMode||"multiple";if("DIV"!==(null===(t=this.container)||void 0===t?void 0:t.tagName.toUpperCase())||"DIV"!==(null===(i=this.viewer)||void 0===i?void 0:i.tagName.toUpperCase()))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.eventBus=e.eventBus;this.linkService=e.linkService||new u.SimpleLinkService;this.downloadManager=e.downloadManager||null;this.findController=e.findController||null;this._scriptingManager=e.scriptingManager||null;this.removePageBorders=e.removePageBorders||!1;this.textLayerMode=null!==(s=e.textLayerMode)&&void 0!==s?s:r.TextLayerMode.ENABLE;_classPrivateFieldSet(this,I,null!==(o=e.annotationMode)&&void 0!==o?o:n.AnnotationMode.ENABLE_FORMS);_classPrivateFieldSet(this,C,null!==(a=e.annotationEditorMode)&&void 0!==a?a:b);this.imageResourcesPath=e.imageResourcesPath||"";this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1;this.renderer=e.renderer||r.RendererType.CANVAS;this.useOnlyCssZoom=e.useOnlyCssZoom||!1;this.maxCanvasPixels=e.maxCanvasPixels;this.l10n=e.l10n||l.NullL10n;_classPrivateFieldSet(this,M,e.enablePermissions||!1);this.pageColors=e.pageColors||null;if(this.pageColors&&(!CSS.supports("color",this.pageColors.background)||!CSS.supports("color",this.pageColors.foreground))){(this.pageColors.background||this.pageColors.foreground)&&console.warn("BaseViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used.");this.pageColors=null}this.defaultRenderingQueue=!e.renderingQueue;if(this.defaultRenderingQueue){this.renderingQueue=new d.PDFRenderingQueue;this.renderingQueue.setViewer(this)}else this.renderingQueue=e.renderingQueue;this.scroll=(0,r.watchScroll)(this.container,this._scrollUpdate.bind(this));this.presentationModeState=r.PresentationModeState.UNKNOWN;this._onBeforeDraw=this._onAfterDraw=null;this._resetView();this.removePageBorders&&this.viewer.classList.add("removePageBorders");this.updateContainerHeightCss()}get pagesCount(){return this._pages.length}getPageView(e){return this._pages[e]}get pageViewsReady(){return!!this._pagesCapability.settled&&this._pages.every((function(e){return null==e?void 0:e.pdfPage}))}get renderForms(){return _classPrivateFieldGet(this,I)===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.");if(!this.pdfDocument)return;const t=Math.abs(this._currentPageNumber-e)<2;this._setCurrentPageNumber(e,!0)||Window.ngxConsole.error('currentPageNumber: "'.concat(e,'" is not a valid page.'));if(this.pageFlip)if(t){Window.ngxConsole.log("Flip");this.pageFlip.flip(e-1)}else{Window.ngxConsole.log("turn to page");this.pageFlip.turnToPage(e-1)}}hidePagesDependingOnpageViewMode(){"book"===this.pageViewMode&&(this.pageFlip||setTimeout((()=>{if(!this.pageFlip){const e=this._pages[0].div,t=e.parentElement,i=t.parentElement;i.style.width=2*e.clientWidth+"px";i.style.overflow="hidden";i.style.marginLeft="auto";i.style.marginRight="auto";this.pageFlip=new c.PageFlip(t,{width:e.clientWidth,height:e.clientHeight,showCover:!0,size:"fixed"});this.pageFlip.loadFromHTML(document.querySelectorAll(".page"));this.ensureAdjecentPagesAreLoaded();this.pageFlip.on("flip",(e=>{this._currentPageNumber!==e.data+1&&this._setCurrentPageNumber(e.data+1,!1)}))}}),100))}_setCurrentPageNumber(e){var t,i;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._currentPageNumber===e){n&&_classPrivateMethodGet(this,V,_resetCurrentPageView2).call(this);return!0}if(!(0<e&&e<=this.pagesCount))return!1;const r=this._currentPageNumber;this._currentPageNumber=e;this.hidePagesDependingOnpageViewMode();if("book"===this.pageViewMode||"infinite-scroll"===this.pageViewMode){const e=this._pages[this.currentPageNumber-1];if(e.div.parentElement.classList.contains("spread"))e.div.parentElement.childNodes.forEach((e=>{const t=Number(e.getAttribute("data-page-number")),i=this._pages[t-1];_classPrivateMethodGet(this,U,_ensurePdfPageLoaded2).call(this,i).then((()=>{this.renderingQueue.renderView(i)}));e.style.display="inline-block"}));else{_classPrivateMethodGet(this,U,_ensurePdfPageLoaded2).call(this,e).then((()=>{this.renderingQueue.renderView(e)}));"book"===this.pageViewMode&&this.ensureAdjecentPagesAreLoaded()}}this.eventBus.dispatch("pagechanging",{source:this,pageNumber:e,pageLabel:null!==(t=null===(i=this._pageLabels)||void 0===i?void 0:i[e-1])&&void 0!==t?t:null,previous:r});n&&_classPrivateMethodGet(this,V,_resetCurrentPageView2).call(this);return!0}addPageToRenderQueue(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(e>=0&&e<=this._pages.length-1){const t=this._pages[e];if(t.div.querySelector(".loadingIcon")){_classPrivateMethodGet(this,U,_ensurePdfPageLoaded2).call(this,t).then((()=>{this.renderingQueue.renderView(t)}));return!0}}return!1}ensureAdjecentPagesAreLoaded(){if(!window.adjacentPagesLoader){window.adjacentPagesLoader=e=>{Window.ngxConsole.log("rendered",e);let t=this._pages[Math.min(this._pages.length-1,this.currentPageNumber)];if(t){let e=t.div.querySelector(".loadingIcon");if(e){Window.ngxConsole.log("asking for the next page");_classPrivateMethodGet(this,U,_ensurePdfPageLoaded2).call(this,t).then((()=>{this.renderingQueue.renderView(t)}))}else{t=this._pages[Math.min(this._pages.length-1,this.currentPageNumber+1)];e=t.div.querySelector(".loadingIcon");if(e){Window.ngxConsole.log("asking for the next + 1 page");_classPrivateMethodGet(this,U,_ensurePdfPageLoaded2).call(this,t).then((()=>{this.renderingQueue.renderView(t)}))}else{t=this._pages[Math.min(this._pages.length-1,this.currentPageNumber+2)];e=t.div.querySelector(".loadingIcon");if(e){Window.ngxConsole.log("asking for the next + 2 page");_classPrivateMethodGet(this,U,_ensurePdfPageLoaded2).call(this,t).then((()=>{this.renderingQueue.renderView(t)}))}else{t=this._pages[Math.min(this._pages.length-1,this.currentPageNumber+3)];e=t.div.querySelector(".loadingIcon");if(e){Window.ngxConsole.log("asking for the next + 3 page");_classPrivateMethodGet(this,U,_ensurePdfPageLoaded2).call(this,t).then((()=>{this.renderingQueue.renderView(t)}))}else{t=this._pages[Math.max(0,this.currentPageNumber-1)];e=t.div.querySelector(".loadingIcon");if(e){Window.ngxConsole.log("asking for the current page");_classPrivateMethodGet(this,U,_ensurePdfPageLoaded2).call(this,t).then((()=>{this.renderingQueue.renderView(t)}))}else{t=this._pages[Math.max(0,this.currentPageNumber-2)];e=t.div.querySelector(".loadingIcon");if(e){Window.ngxConsole.log("asking for the previous page");_classPrivateMethodGet(this,U,_ensurePdfPageLoaded2).call(this,t).then((()=>{this.renderingQueue.renderView(t)}))}else Window.ngxConsole.log("Finished preloading the pages")}}}}}}};this.eventBus._on("pagerendered",window.adjacentPagesLoader)}window.adjacentPagesLoader()}get currentPageLabel(){var e,t;return null!==(e=null===(t=this._pageLabels)||void 0===t?void 0:t[this._currentPageNumber-1])&&void 0!==e?e: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)||Window.ngxConsole.error('currentPageLabel: "'.concat(e,'" is not a valid page.'))}get currentScale(){return this._currentScale!==r.UNKNOWN_SCALE?this._currentScale:r.DEFAULT_SCALE}set currentScale(e){if(isNaN(e))throw new Error("Invalid numeric scale.");this.pdfDocument&&this._setScale(e,!1)}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(e){this.pdfDocument&&this._setScale(e,!1)}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!(0,r.isValidRotation)(e))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument)return;(e%=360)<0&&(e+=360);if(this._pagesRotation===e)return;this._pagesRotation=e;const t=this._currentPageNumber,i={rotation:e};for(const e of this._pages)e.update(i);this._currentScaleValue&&this._setScale(this._currentScaleValue,!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}setDocument(e){if(this.pdfDocument){this.eventBus.dispatch("pagesdestroy",{source:this});this._cancelRendering();this._resetView();this.findController&&this.findController.setDocument(null);this._scriptingManager&&this._scriptingManager.setDocument(null);if(_classPrivateFieldGet(this,T)){_classPrivateFieldGet(this,T).destroy();_classPrivateFieldSet(this,T,null)}}this.pdfDocument=e;if(!e)return;const t=e.isPureXfa,i=e.numPages,s=e.getPage(1),o=e.getOptionalContentConfig(),a=_classPrivateFieldGet(this,M)?e.getPermissions():Promise.resolve();if(i>y.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const e=this._scrollMode=r.ScrollMode.PAGE;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e})}this._pagesCapability.promise.then((()=>{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:i})}),(()=>{}));this._onBeforeDraw=e=>{const t=this._pages[e.pageNumber-1];t&&_classPrivateFieldGet(this,x).push(t)};this.eventBus._on("pagerender",this._onBeforeDraw);this._onAfterDraw=e=>{if(!e.cssTransform&&!this._onePageRenderedCapability.settled){this._onePageRenderedCapability.resolve({timestamp:e.timestamp});this.eventBus._off("pagerendered",this._onAfterDraw);this._onAfterDraw=null;if(_classPrivateFieldGet(this,D)){document.removeEventListener("visibilitychange",_classPrivateFieldGet(this,D));_classPrivateFieldSet(this,D,null)}}};this.eventBus._on("pagerendered",this._onAfterDraw);Promise.all([s,a]).then((s=>{let[a,l]=s;if(e!==this.pdfDocument)return;this._firstPageCapability.resolve(a);this._optionalContentConfigPromise=o;const{annotationEditorMode:c,annotationMode:d,textLayerMode:u}=_classPrivateMethodGet(this,k,_initializePermissions2).call(this,l);if(c!==n.AnnotationEditorType.DISABLE){const e=c;if(t)console.warn("Warning: XFA-editing is not implemented.");else if(isValidAnnotationEditorMode(e)){this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:e});_classPrivateFieldSet(this,T,new n.AnnotationEditorUIManager(this.container,this.eventBus));e!==n.AnnotationEditorType.NONE&&_classPrivateFieldGet(this,T).updateMode(e)}else console.error("Invalid AnnotationEditor mode: ".concat(e))}const p=this._scrollMode===r.ScrollMode.PAGE?null:this.viewer,g=this.currentScale,f=a.getViewport({scale:g*n.PixelsPerInch.PDF_TO_CSS_UNITS}),m=u===r.TextLayerMode.DISABLE||t?null:this,v=d!==n.AnnotationMode.DISABLE?this:null,w=t?this:null,_=_classPrivateFieldGet(this,T)?this:null;for(let e=1;e<=i;++e){const t=new h.PDFPageView({container:p,eventBus:this.eventBus,id:e,scale:g,defaultViewport:f.clone(),optionalContentConfigPromise:o,renderingQueue:this.renderingQueue,textLayerFactory:m,textLayerMode:u,annotationLayerFactory:v,annotationMode:d,xfaLayerFactory:w,annotationEditorLayerFactory:_,textHighlighterFactory:this,structTreeLayerFactory:this,imageResourcesPath:this.imageResourcesPath,removePageBorders:this.removePageBorders,renderer:this.renderer,useOnlyCssZoom:this.useOnlyCssZoom,maxCanvasPixels:this.maxCanvasPixels,pageColors:this.pageColors,l10n:this.l10n});this._pages.push(t)}const b=this._pages[0];if(b){b.setPdfPage(a);this.linkService.cachePageRef(1,a.ref)}this._scrollMode===r.ScrollMode.PAGE?_classPrivateMethodGet(this,R,_ensurePageViewVisible2).call(this):this._spreadMode!==r.SpreadMode.NONE&&this._updateSpreadMode();_classPrivateMethodGet(this,O,_onePageRenderedOrForceFetch2).call(this).then((async()=>{this.findController&&this.findController.setDocument(e);this._scriptingManager&&this._scriptingManager.setDocument(e);if(e.loadingParams.disableAutoFetch||i>y.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let t=i-1;if(t<=0)this._pagesCapability.resolve();else for(let n=2;n<=i;++n){const i=e.getPage(n).then((e=>{const i=this._pages[n-1];i.pdfPage||i.setPdfPage(e);this.linkService.cachePageRef(n,e.ref);0==--t&&this._pagesCapability.resolve()}),(e=>{Window.ngxConsole.error("Unable to get page ".concat(n," to initialize viewer"),e);0==--t&&this._pagesCapability.resolve()}));n%y.PAUSE_EAGER_PAGE_INIT==0&&await i}}));this.hidePagesDependingOnpageViewMode();this.eventBus.dispatch("pagesinit",{source:this});e.getMetadata().then((t=>{let{info:i}=t;e===this.pdfDocument&&i.Language&&(this.viewer.lang=i.Language)}));this.defaultRenderingQueue&&this.update()})).catch((e=>{Window.ngxConsole.error("Unable to initialize viewer",e);this._pagesCapability.reject(e)}))}setPageLabels(e){if(this.pdfDocument){if(e)if(Array.isArray(e)&&this.pdfDocument.numPages===e.length)this._pageLabels=e;else{this._pageLabels=null;Window.ngxConsole.error("setPageLabels: Invalid page labels.")}else this._pageLabels=null;for(let e=0,n=this._pages.length;e<n;e++){var t,i;this._pages[e].setPageLabel(null!==(t=null===(i=this._pageLabels)||void 0===i?void 0:i[e])&&void 0!==t?t:null)}}}_resetView(){this._pages=[];this._currentPageNumber=1;this._currentScale=r.UNKNOWN_SCALE;this._currentScaleValue=null;this._pageLabels=null;const e=Number(PDFViewerApplicationOptions.get("defaultCacheSize"))||10;_classPrivateFieldSet(this,x,new PDFPageViewBuffer(e));this._location=null;this._pagesRotation=0;this._optionalContentConfigPromise=null;this._firstPageCapability=(0,n.createPromiseCapability)();this._onePageRenderedCapability=(0,n.createPromiseCapability)();this._pagesCapability=(0,n.createPromiseCapability)();this._scrollMode=r.ScrollMode.VERTICAL;this._previousScrollMode=r.ScrollMode.UNKNOWN;this._spreadMode=r.SpreadMode.NONE;_classPrivateFieldSet(this,A,{previousPageNumber:1,scrollDown:!0,pages:[]});if(this._onBeforeDraw){this.eventBus._off("pagerender",this._onBeforeDraw);this._onBeforeDraw=null}if(this._onAfterDraw){this.eventBus._off("pagerendered",this._onAfterDraw);this._onAfterDraw=null}if(_classPrivateFieldGet(this,D)){document.removeEventListener("visibilitychange",_classPrivateFieldGet(this,D));_classPrivateFieldSet(this,D,null)}this.viewer.textContent="";this._updateScrollMode();this.viewer.removeAttribute("lang");this.viewer.classList.remove(_)}_scrollUpdate(){0!==this.pagesCount&&this.update()}scrollPagePosIntoView(e,t){const i=this._pages[e-1].div;if(t){const s={...t};if("string"==typeof s.top&&s.top.endsWith("%")){var n;const e=Number(s.top.replace("%","")),t=null===(n=this.viewer.querySelector(".page"))||void 0===n?void 0:n.clientHeight;let r=i.clientHeight?i.clientHeight:t;const o=this.viewer.parentElement.clientHeight;r=Math.max(0,r-o);s.top=e*r/100}if("string"==typeof s.left&&s.left.endsWith("%")){var r;const e=Number(s.left.replace("%","")),t=null===(r=this.viewer.querySelector(".page"))||void 0===r?void 0:r.clientWidth,n=i.clientWidth?i.clientWidth:t;s.left=e*n/100}_classPrivateMethodGet(this,B,_scrollIntoView2).call(this,{div:i,id:e},s)}else _classPrivateMethodGet(this,B,_scrollIntoView2).call(this,{pageDiv:i,pageNumber:e})}_setScaleUpdatePages(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._currentScaleValue=t.toString();if(_classPrivateMethodGet(this,N,_isSameScale2).call(this,e)){s&&this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:t});return}r.docStyle.setProperty("--scale-factor",e*n.PixelsPerInch.PDF_TO_CSS_UNITS);const o={scale:e};for(const e of this._pages)e.update(o);this._currentScale=e;if(!i){let e,t=this._currentPageNumber;if(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();this.updateContainerHeightCss()}get _pageWidthScaleFactor(){return this._spreadMode!==r.SpreadMode.NONE&&this._scrollMode!==r.ScrollMode.HORIZONTAL?2:1}_setScale(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e||(e="auto");let i=parseFloat(e);if(this._currentScale!==i)if(i>0)this._setScaleUpdatePages(i,e,t,!1);else{const n=this._pages[this._currentPageNumber-1];if(!n)return;let s=r.SCROLLBAR_PADDING,o=r.VERTICAL_PADDING;this.isInPresentationMode?s=o=4:this.removePageBorders?s=o=0:this._scrollMode===r.ScrollMode.HORIZONTAL&&([s,o]=[o,s]);const a=(this.container.clientWidth-s)/n.width*n.scale/this._pageWidthScaleFactor,l=(this.container.clientHeight-o)/n.height*n.scale;switch(e){case"page-actual":i=1;break;case"page-width":i=a;break;case"page-height":i=l;break;case"page-fit":i=Math.min(a,l);break;case"auto":const t=(0,r.isPortraitOrientation)(n)?a:Math.min(l,a);i=Math.min(r.MAX_AUTO_SCALE,t);break;default:Window.ngxConsole.error('_setScale: "'.concat(e,'" is an unknown zoom value.'));return}this._setScaleUpdatePages(i,e,t,!0)}}pageLabelToPageNumber(e){if(!this._pageLabels)return null;const t=this._pageLabels.indexOf(e);return t<0?null:t+1}scrollPageIntoView(e){let{pageNumber:t,destArray:i=null,allowNegativeOffset:s=!1,ignoreDestinationZoom:o=!1}=e;if(!this.pdfDocument)return;const a=Number.isInteger(t)&&this._pages[t-1];if(!a){Window.ngxConsole.error('scrollPageIntoView: "'.concat(t,'" is not a valid pageNumber parameter.'));return}if(this.isInPresentationMode||!i){this._setCurrentPageNumber(t,!0);return}let l,c,h=0,d=0,u=0,p=0;const g=a.rotation%180!=0,f=(g?a.height:a.width)/a.scale/n.PixelsPerInch.PDF_TO_CSS_UNITS,m=(g?a.width:a.height)/a.scale/n.PixelsPerInch.PDF_TO_CSS_UNITS;let v=0;switch(i[1].name){case"XYZ":h=i[2];d=i[3];v=i[4];h=null!==h?h:0;d=null!==d?d:m;break;case"Fit":case"FitB":v="page-fit";break;case"FitH":case"FitBH":d=i[2];v="page-width";if(null===d&&this._location){h=this._location.left;d=this._location.top}else("number"!=typeof d||d<0)&&(d=m);break;case"FitV":case"FitBV":h=i[2];u=f;p=m;v="page-height";break;case"FitR":h=i[2];d=i[3];u=i[4]-h;p=i[5]-d;const e=this.removePageBorders?0:r.SCROLLBAR_PADDING,t=this.removePageBorders?0:r.VERTICAL_PADDING;l=(this.container.clientWidth-e)/u/n.PixelsPerInch.PDF_TO_CSS_UNITS;c=(this.container.clientHeight-t)/p/n.PixelsPerInch.PDF_TO_CSS_UNITS;v=Math.min(Math.abs(l),Math.abs(c));break;default:Window.ngxConsole.error('scrollPageIntoView: "'.concat(i[1].name,'" is not a valid destination type.'));return}o||(v&&v!==this._currentScale?this.currentScaleValue=v:this._currentScale===r.UNKNOWN_SCALE&&(this.currentScaleValue=r.DEFAULT_SCALE_VALUE));_classPrivateMethodGet(this,U,_ensurePdfPageLoaded2).call(this,a).then((()=>{this.renderingQueue.renderView(a);"single"===this.pageViewMode&&this.currentPageNumber!==t&&(this.currentPageNumber=t)}));if("page-fit"===v&&!i[4]){_classPrivateMethodGet(this,B,_scrollIntoView2).call(this,a);return}const w=[a.viewport.convertToViewportPoint(h,d),a.viewport.convertToViewportPoint(h+u,d+p)];let _=Math.min(w[0][0],w[1][0]),y=Math.min(w[0][1],w[1][1]);if(!s){_=Math.max(_,0);y=Math.max(y,0)}_classPrivateMethodGet(this,B,_scrollIntoView2).call(this,a,{left:_,top:y})}_updateLocation(e){const t=this._currentScale,i=this._currentScaleValue,n=parseFloat(i)===t?Math.round(1e4*t)/100:i,r=e.id,s=this._pages[r-1],o=this.container,a=s.getPagePoint(o.scrollLeft-e.x,o.scrollTop-e.y),l=Math.round(a[0]),c=Math.round(a[1]);let h="#page=".concat(r);this.isInPresentationMode||(h+="&zoom=".concat(n,",").concat(l,",").concat(c));this._location={pageNumber:r,scale:n,top:c,left:l,rotation:this._pagesRotation,pdfOpenParams:h}}update(){this.scrollMode===r.ScrollMode.PAGE?this.viewer.classList.add("singlePageView"):this.viewer.classList.remove("singlePageView");const e=this._getVisiblePages(),t=e.views,i=t.length;if(0===i)return;const n=Number(PDFViewerApplicationOptions.get("defaultCacheSize"))||10,s=Math.max(n,2*i+1);_classPrivateFieldGet(this,x).resize(s,e.ids);this.renderingQueue.renderHighestPriority(e);const o=this._spreadMode===r.SpreadMode.NONE&&(this._scrollMode===r.ScrollMode.PAGE||this._scrollMode===r.ScrollMode.VERTICAL),a=this._currentPageNumber;let l=!1;for(const e of t){if(e.percent<100)break;if(e.id===a&&o){l=!0;break}}this._setCurrentPageNumber(l?a:t[0].id);this._updateLocation(e.first);this.eventBus.dispatch("updateviewarea",{source:this,location:this._location});this.hidePagesDependingOnpageViewMode()}containsElement(e){return this.container.contains(e)}focus(){this.container.focus()}get _isContainerRtl(){return"rtl"===getComputedStyle(this.container).direction}get isInPresentationMode(){return this.presentationModeState===r.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===r.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===r.ScrollMode.PAGE?_classPrivateFieldGet(this,A).pages:this._pages,t=this._scrollMode===r.ScrollMode.HORIZONTAL,i=t&&this._isContainerRtl;return(0,r.getVisibleElements)({scrollEl:this.container,views:e,sortByVisibility:!0,horizontal:t,rtl:i})}isPageVisible(e){if(!this.pdfDocument)return!1;if(!(Number.isInteger(e)&&e>0&&e<=this.pagesCount)){Window.ngxConsole.error('isPageVisible: "'.concat(e,'" is not a valid page.'));return!1}return this._getVisiblePages().ids.has(e)}isPageCached(e){if(!this.pdfDocument)return!1;if(!(Number.isInteger(e)&&e>0&&e<=this.pagesCount)){Window.ngxConsole.error('isPageCached: "'.concat(e,'" is not a valid page.'));return!1}const t=this._pages[e-1];return _classPrivateFieldGet(this,x).has(t)}cleanup(){for(const e of this._pages)e.renderingState!==r.RenderingStates.FINISHED&&e.reset()}_cancelRendering(){for(const e of this._pages)e.cancelRendering()}forceRendering(e){const t=e||this._getVisiblePages(),i=_classPrivateMethodGet(this,W,_getScrollAhead2).call(this,t),n=this._spreadMode!==r.SpreadMode.NONE&&this._scrollMode!==r.ScrollMode.HORIZONTAL,s=this.renderingQueue.getHighestPriority(t,this._pages,i,n);_classPrivateMethodGet(this,H,_toggleLoadingIconSpinner2).call(this,t.ids);if(s){_classPrivateMethodGet(this,U,_ensurePdfPageLoaded2).call(this,s).then((()=>{this.renderingQueue.renderView(s)}));return!0}return!1}createTextLayerBuilder(e){let{textLayerDiv:t,pageIndex:i,viewport:n,enhanceTextSelection:r=!1,eventBus:s,highlighter:o}=e;return new f.TextLayerBuilder({textLayerDiv:t,eventBus:s,pageIndex:i,viewport:n,enhanceTextSelection:!this.isInPresentationMode&&r,highlighter:o})}createTextHighlighter(e){let{pageIndex:t,eventBus:i}=e;return new g.TextHighlighter({eventBus:i,pageIndex:t,findController:this.isInPresentationMode?null:this.findController})}createAnnotationLayerBuilder(e){var t,i,n,r;let{pageDiv:s,pdfPage:a,annotationStorage:c=(null===(t=this.pdfDocument)||void 0===t?void 0:t.annotationStorage),imageResourcesPath:h="",renderForms:d=!0,l10n:u=l.NullL10n,enableScripting:p=this.enableScripting,hasJSActionsPromise:g=(null===(i=this.pdfDocument)||void 0===i?void 0:i.hasJSActions()),mouseState:f=(null===(n=this._scriptingManager)||void 0===n?void 0:n.mouseState),fieldObjectsPromise:m=(null===(r=this.pdfDocument)||void 0===r?void 0:r.getFieldObjects()),annotationCanvasMap:v=null}=e;return new o.AnnotationLayerBuilder({pageDiv:s,pdfPage:a,annotationStorage:c,imageResourcesPath:h,renderForms:d,linkService:this.linkService,downloadManager:this.downloadManager,l10n:u,enableScripting:p,hasJSActionsPromise:g,mouseState:f,fieldObjectsPromise:m,annotationCanvasMap:v})}createAnnotationEditorLayerBuilder(e){var t;let{uiManager:i=_classPrivateFieldGet(this,T),pageDiv:n,pdfPage:r,l10n:o,annotationStorage:a=(null===(t=this.pdfDocument)||void 0===t?void 0:t.annotationStorage)}=e;return new s.AnnotationEditorLayerBuilder({uiManager:i,pageDiv:n,pdfPage:r,annotationStorage:a,l10n:o})}createXfaLayerBuilder(e){var t;let{pageDiv:i,pdfPage:n,annotationStorage:r=(null===(t=this.pdfDocument)||void 0===t?void 0:t.annotationStorage)}=e;return new m.XfaLayerBuilder({pageDiv:i,pdfPage:n,annotationStorage:r,linkService:this.linkService})}createStructTreeLayerBuilder(e){let{pdfPage:t}=e;return new p.StructTreeLayerBuilder({pdfPage:t})}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(){return this._pages.map((e=>{const t=e.pdfPage.getViewport({scale:1});return!this.enablePrintAutoRotate||(0,r.isPortraitOrientation)(t)?{width:t.width,height:t.height,rotation:t.rotation}:{width:t.height,height:t.width,rotation:(t.rotation-90)%360}}))}get optionalContentConfigPromise(){if(!this.pdfDocument)return Promise.resolve(null);if(!this._optionalContentConfigPromise){console.error("optionalContentConfigPromise: Not initialized yet.");return this.pdfDocument.getOptionalContentConfig()}return this._optionalContentConfigPromise}set optionalContentConfigPromise(e){if(!(e instanceof Promise))throw new Error("Invalid optionalContentConfigPromise: ".concat(e));if(!this.pdfDocument)return;if(!this._optionalContentConfigPromise)return;this._optionalContentConfigPromise=e;const t={optionalContentConfigPromise:e};for(const e of this._pages)e.update(t);this.update();this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:e})}get scrollMode(){return this._scrollMode}set scrollMode(e){if(this._scrollMode!==e){if(!(0,r.isValidScrollMode)(e))throw new Error("Invalid scroll mode: ".concat(e));if(!(this.pagesCount>y.FORCE_SCROLL_MODE_PAGE)){this._previousScrollMode=this._scrollMode;this._scrollMode=e;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e});this._updateScrollMode(this._currentPageNumber)}}}_updateScrollMode(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=this._scrollMode,i=this.viewer;i.classList.toggle("scrollHorizontal",t===r.ScrollMode.HORIZONTAL);i.classList.toggle("scrollWrapped",t===r.ScrollMode.WRAPPED);if(this.pdfDocument&&e){t===r.ScrollMode.PAGE?_classPrivateMethodGet(this,R,_ensurePageViewVisible2).call(this):this._previousScrollMode===r.ScrollMode.PAGE&&this._updateSpreadMode();this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,!0);this._setCurrentPageNumber(e,!0);this.update()}}get spreadMode(){return this._spreadMode}set spreadMode(e){if(this._spreadMode!==e){if(!(0,r.isValidSpreadMode)(e))throw new Error("Invalid spread mode: ".concat(e));this._spreadMode=e;this.eventBus.dispatch("spreadmodechanged",{source:this,mode:e});this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this.pdfDocument)return;const t=this.viewer,i=this._pages;if(this._scrollMode===r.ScrollMode.PAGE)_classPrivateMethodGet(this,R,_ensurePageViewVisible2).call(this);else{t.textContent="";if(this._spreadMode===r.SpreadMode.NONE)for(const e of this._pages)t.append(e.div);else{const e=this._spreadMode-1;let n=null;for(let r=0,s=i.length;r<s;++r){if(null===n){n=document.createElement("div");n.className="spread";t.append(n)}else if(r%2===e){n=n.cloneNode(!1);t.append(n)}n.append(i[r].div)}}}this.hidePagesDependingOnpageViewMode();if(e){this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,!0);this._setCurrentPageNumber(e,!0);this.update()}}_getPageAdvance(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(this._scrollMode){case r.ScrollMode.WRAPPED:{const{views:i}=this._getVisiblePages(),n=new Map;for(const{id:e,y:t,percent:r,widthPercent:s}of i){if(0===r||s<100)continue;let i=n.get(t);i||n.set(t,i||(i=[]));i.push(e)}for(const i of n.values()){const n=i.indexOf(e);if(-1===n)continue;const r=i.length;if(1===r)break;if(t)for(let t=n-1,r=0;t>=r;t--){const n=i[t],r=i[t+1]-1;if(n<r)return e-r}else for(let t=n+1,s=r;t<s;t++){const n=i[t],r=i[t-1]+1;if(n>r)return r-e}if(t){const t=i[0];if(t<e)return e-t+1}else{const t=i[r-1];if(t>e)return t-e+1}break}break}case r.ScrollMode.HORIZONTAL:break;case r.ScrollMode.PAGE:case r.ScrollMode.VERTICAL:{if(this._spreadMode===r.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(),s=t?e-1:e+1;for(const{id:e,percent:t,widthPercent:i}of n)if(e===s){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;this.currentPageNumber=Math.min(e+i,t);return!0}previousPage(){const e=this._currentPageNumber;if(e<=1)return!1;const t=this._getPageAdvance(e,!0)||1;this.currentPageNumber=Math.max(e-t,1);return!0}increaseScale(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=this._currentScale,i=Number(PDFViewerApplicationOptions.get("maxZoom"));i||(i=r.MAX_SCALE);do{t=(t*r.DEFAULT_SCALE_DELTA).toFixed(2);t=Math.ceil(10*t)/10;t=Math.min(i,t)}while(--e>0&&t<i);this.currentScaleValue=t}decreaseScale(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=this._currentScale,i=Number(PDFViewerApplicationOptions.get("minZoom"));i||(i=r.MIN_SCALE);do{t=(t/r.DEFAULT_SCALE_DELTA).toFixed(2);t=Math.floor(10*t)/10;t=Math.max(i,t)}while(--e>0&&t>i);this.currentScaleValue=t}updateContainerHeightCss(){const e=this.container.clientHeight;if(e!==_classPrivateFieldGet(this,L)){_classPrivateFieldSet(this,L,e);r.docStyle.setProperty("--viewer-container-height","".concat(e,"px"))}}get annotationEditorMode(){return _classPrivateFieldGet(this,T)?_classPrivateFieldGet(this,C):n.AnnotationEditorType.DISABLE}set annotationEditorMode(e){if(!_classPrivateFieldGet(this,T))throw new Error("The AnnotationEditor is not enabled.");if(_classPrivateFieldGet(this,C)!==e){if(!isValidAnnotationEditorMode(e))throw new Error("Invalid AnnotationEditor mode: ".concat(e));if(this.pdfDocument){_classPrivateFieldSet(this,C,e);this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:e});_classPrivateFieldGet(this,T).updateMode(e)}}}set annotationEditorParams(e){let{type:t,value:i}=e;if(!_classPrivateFieldGet(this,T))throw new Error("The AnnotationEditor is not enabled.");_classPrivateFieldGet(this,T).updateParams(t,i)}}t.BaseViewer=BaseViewer;function _initializePermissions2(e){const t={annotationEditorMode:_classPrivateFieldGet(this,C),annotationMode:_classPrivateFieldGet(this,I),textLayerMode:this.textLayerMode};if(!e)return t;e.includes(n.PermissionFlag.COPY)||this.viewer.classList.add(_);e.includes(n.PermissionFlag.MODIFY_CONTENTS)||(t.annotationEditorMode=n.AnnotationEditorType.DISABLE);e.includes(n.PermissionFlag.MODIFY_ANNOTATIONS)||e.includes(n.PermissionFlag.FILL_INTERACTIVE_FORMS)||_classPrivateFieldGet(this,I)!==n.AnnotationMode.ENABLE_FORMS||(t.annotationMode=n.AnnotationMode.ENABLE);return t}function _onePageRenderedOrForceFetch2(){if("hidden"===document.visibilityState||!this.container.offsetParent||0===this._getVisiblePages().views.length)return Promise.resolve();const e=new Promise((e=>{_classPrivateFieldSet(this,D,(()=>{if("hidden"===document.visibilityState){e();document.removeEventListener("visibilitychange",_classPrivateFieldGet(this,D));_classPrivateFieldSet(this,D,null)}}));document.addEventListener("visibilitychange",_classPrivateFieldGet(this,D))}));return Promise.race([this._onePageRenderedCapability.promise,e])}function _ensurePageViewVisible2(){if(this._scrollMode!==r.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const e=this._currentPageNumber,t=_classPrivateFieldGet(this,A),i=this.viewer;i.textContent="";t.pages.length=0;if(this._spreadMode!==r.SpreadMode.NONE||this.isInPresentationMode){const n=new Set,r=this._spreadMode-1;if(-1===r)n.add(e-1);else if(e%2!==r){n.add(e-1);n.add(e)}else{n.add(e-2);n.add(e-1)}const s=document.createElement("div");s.className="spread";if(this.isInPresentationMode){const e=document.createElement("div");e.className="dummyPage";s.append(e)}for(const e of n){const i=this._pages[e];if(i){s.append(i.div);t.pages.push(i)}}i.append(s)}else{const n=this._pages[e-1];i.append(n.div);t.pages.push(n)}t.scrollDown=e>=t.previousPageNumber;t.previousPageNumber=e}function _scrollIntoView2(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return;const{div:i,id:n}=e;if(this._scrollMode===r.ScrollMode.PAGE){this._setCurrentPageNumber(n);_classPrivateMethodGet(this,R,_ensurePageViewVisible2).call(this);this.update()}if(!t&&!this.isInPresentationMode){const e=i.offsetLeft+i.clientLeft,n=e+i.clientWidth,{scrollLeft:s,clientWidth:o}=this.container;(this._scrollMode===r.ScrollMode.HORIZONTAL||e<s||n>s+o)&&(t={left:0,top:0})}(0,r.scrollIntoView)(i,t,!1,"infinite-scroll"===this.pageViewMode)}function _isSameScale2(e){return e===this._currentScale||Math.abs(e-this._currentScale)<1e-15}function _resetCurrentPageView2(){const e=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&this._setScale(this._currentScaleValue,!0);_classPrivateMethodGet(this,B,_scrollIntoView2).call(this,e)}async function _ensurePdfPageLoaded2(e){if(e.pdfPage)return e.pdfPage;try{var t,i;const n=await this.pdfDocument.getPage(e.id);e.pdfPage||e.setPdfPage(n);null!==(t=(i=this.linkService)._cachedPageNumber)&&void 0!==t&&t.call(i,n.ref)||this.linkService.cachePageRef(e.id,n.ref);return n}catch(e){Window.ngxConsole.error("Unable to get page for page view",e);return null}}function _getScrollAhead2(e){var t,i;if(1===(null===(t=e.first)||void 0===t?void 0:t.id))return!0;if((null===(i=e.last)||void 0===i?void 0:i.id)===this.pagesCount)return!1;switch(this._scrollMode){case r.ScrollMode.PAGE:return _classPrivateFieldGet(this,A).scrollDown;case r.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down}function _toggleLoadingIconSpinner2(e){for(const t of e){const e=this._pages[t-1];null==e||e.toggleLoadingIconSpinner(!0)}for(const t of _classPrivateFieldGet(this,x))e.has(t.id)||t.toggleLoadingIconSpinner(!1)}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.AnnotationEditorLayerBuilder=void 0;i(94);i(1);var n=i(155),r=i(191);function _classPrivateFieldInitSpec(e,t,i){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.set(e,i)}function _classPrivateFieldSet(e,t,i){!function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}(e,_classExtractFieldDescriptor(e,t,"set"),i);return i}function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}var s=new WeakMap;t.AnnotationEditorLayerBuilder=class AnnotationEditorLayerBuilder{constructor(e){_classPrivateFieldInitSpec(this,s,{writable:!0,value:void 0});this.pageDiv=e.pageDiv;this.pdfPage=e.pdfPage;this.annotationStorage=e.annotationStorage||null;this.l10n=e.l10n||r.NullL10n;this.annotationEditorLayer=null;this.div=null;this._cancelled=!1;_classPrivateFieldSet(this,s,e.uiManager)}async render(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"display";if("display"!==t)return;if(this._cancelled)return;const i=e.clone({dontFlip:!0});if(this.div){this.annotationEditorLayer.update({viewport:i});this.show();return}this.div=document.createElement("div");this.div.className="annotationEditorLayer";this.div.tabIndex=0;this.pageDiv.append(this.div);this.annotationEditorLayer=new n.AnnotationEditorLayer({uiManager:(r=this,o=s,function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}(r,_classExtractFieldDescriptor(r,o,"get"))),div:this.div,annotationStorage:this.annotationStorage,pageIndex:this.pdfPage._pageIndex,l10n:this.l10n,viewport:i});var r,o;const a={viewport:i,div:this.div,annotations:null,intent:t};this.annotationEditorLayer.render(a)}cancel(){this._cancelled=!0;this.destroy()}hide(){this.div&&(this.div.hidden=!0)}show(){this.div&&(this.div.hidden=!1)}destroy(){if(this.div){this.pageDiv=null;this.annotationEditorLayer.destroy();this.div.remove()}}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NullL10n=void 0;t.fixupLangCode=function fixupLangCode(e){return r[null==e?void 0:e.toLowerCase()]||e};t.getL10nFallback=getL10nFallback;i(84);i(132);i(94);const n={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",print_progress_percent:"{{progress}}%","toggle_sidebar.title":"Toggle Sidebar","toggle_sidebar_notification2.title":"Toggle Sidebar (document contains outline/attachments/layers)",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",error_version_info:"PDF.js v{{version}} (build: {{build}})",error_message:"Message: {{message}}",error_stack:"Stack: {{stack}}",error_file:"File: {{file}}",error_line:"Line: {{line}}",rendering_error:"An error occurred while rendering the page.",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:"Loading…",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.",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_text_default_content:"Enter text…",editor_free_text_aria_label:"FreeText Editor",editor_ink_aria_label:"Ink Editor",editor_ink_canvas_aria_label:"User-created image"};function getL10nFallback(e,t){switch(e){case"find_match_count":e="find_match_count[".concat(1===t.total?"one":"other","]");break;case"find_match_count_limit":e="find_match_count_limit[".concat(1===t.limit?"one":"other","]")}return n[e]||""}const r={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"};const s={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function formatL10nValue(e,t){return t?e.replace(/\{\{\s*(\w+)\s*\}\}/g,((e,i)=>i in t?t[i]:"{{"+i+"}}")):e}(arguments.length>2&&void 0!==arguments[2]?arguments[2]:getL10nFallback(e,t),t)},async translate(e){}};t.NullL10n=s},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.AnnotationLayerBuilder=void 0;i(94);i(1);var n=i(155),r=i(191);t.AnnotationLayerBuilder=class AnnotationLayerBuilder{constructor(e){let{pageDiv:t,pdfPage:i,linkService:n,downloadManager:s,annotationStorage:o=null,imageResourcesPath:a="",renderForms:l=!0,l10n:c=r.NullL10n,enableScripting:h=!1,hasJSActionsPromise:d=null,fieldObjectsPromise:u=null,mouseState:p=null,annotationCanvasMap:g=null}=e;this.pageDiv=t;this.pdfPage=i;this.linkService=n;this.downloadManager=s;this.imageResourcesPath=a;this.renderForms=l;this.l10n=c;this.annotationStorage=o;this.enableScripting=h;this._hasJSActionsPromise=d;this._fieldObjectsPromise=u;this._mouseState=p;this._annotationCanvasMap=g;this.div=null;this._cancelled=!1}async render(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"display";const[i,r=!1,s=null]=await Promise.all([this.pdfPage.getAnnotations({intent:t}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled||0===i.length)return;const o={viewport:e.clone({dontFlip:!0}),div:this.div,annotations:i,page:this.pdfPage,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:r,fieldObjects:s,mouseState:this._mouseState,annotationCanvasMap:this._annotationCanvasMap};if(this.div)n.AnnotationLayer.update(o);else{this.div=document.createElement("div");this.div.className="annotationLayer";this.pageDiv.append(this.div);o.div=this.div;n.AnnotationLayer.render(o);this.l10n.translate(this.div)}}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PageFlip=void 0;i(1);i(169);i(84);i(131);class Page{constructor(e,t){this.state={angle:0,area:[],position:{x:0,y:0},hardAngle:0,hardDrawingAngle:0};this.createdDensity=t;this.nowDrawingDensity=this.createdDensity;this.render=e}setDensity(e){this.createdDensity=e;this.nowDrawingDensity=e}setDrawingDensity(e){this.nowDrawingDensity=e}setPosition(e){this.state.position=e}setAngle(e){this.state.angle=e}setArea(e){this.state.area=e}setHardDrawingAngle(e){this.state.hardDrawingAngle=e}setHardAngle(e){this.state.hardAngle=e;this.state.hardDrawingAngle=e}setOrientation(e){this.orientation=e}getDrawingDensity(){return this.nowDrawingDensity}getDensity(){return this.createdDensity}getHardAngle(){return this.state.hardAngle}}class ImagePage extends Page{constructor(e,t,i){super(e,i);this.image=null;this.isLoad=!1;this.loadingAngle=0;this.image=new Image;this.image.src=t}draw(e){const t=this.render.getContext(),i=this.render.convertToGlobal(this.state.position),n=this.render.getRect().pageWidth,r=this.render.getRect().height;t.save();t.translate(i.x,i.y);t.beginPath();for(let e of this.state.area)if(null!==e){e=this.render.convertToGlobal(e);t.lineTo(e.x-i.x,e.y-i.y)}t.rotate(this.state.angle);t.clip();this.isLoad?t.drawImage(this.image,0,0,n,r):this.drawLoader(t,{x:0,y:0},n,r);t.restore()}simpleDraw(e){const t=this.render.getRect(),i=this.render.getContext(),n=t.pageWidth,r=t.height,s=1===e?t.left+t.pageWidth:t.left,o=t.top;this.isLoad?i.drawImage(this.image,s,o,n,r):this.drawLoader(i,{x:s,y:o},n,r)}drawLoader(e,t,i,n){e.beginPath();e.strokeStyle="rgb(200, 200, 200)";e.fillStyle="rgb(255, 255, 255)";e.lineWidth=1;e.rect(t.x+1,t.y+1,i-1,n-1);e.stroke();e.fill();const r={x:t.x+i/2,y:t.y+n/2};e.beginPath();e.lineWidth=10;e.arc(r.x,r.y,20,this.loadingAngle,3*Math.PI/2+this.loadingAngle);e.stroke();e.closePath();this.loadingAngle+=.07;this.loadingAngle>=2*Math.PI&&(this.loadingAngle=0)}load(){this.isLoad||(this.image.onload=()=>{this.isLoad=!0})}newTemporaryCopy(){return this}getTemporaryCopy(){return this}hideTemporaryCopy(){}}class PageCollection{constructor(e,t){this.pages=[];this.currentPageIndex=0;this.currentSpreadIndex=0;this.landscapeSpread=[];this.portraitSpread=[];this.render=t;this.app=e;this.currentPageIndex=0;this.isShowCover=this.app.getSettings().showCover}destroy(){this.pages=[]}createSpread(){this.landscapeSpread=[];this.portraitSpread=[];for(let e=0;e<this.pages.length;e++)this.portraitSpread.push([e]);let e=0;if(this.isShowCover){this.pages[0].setDensity("hard");this.landscapeSpread.push([e]);e++}for(let t=e;t<this.pages.length;t+=2)if(t<this.pages.length-1)this.landscapeSpread.push([t,t+1]);else{this.landscapeSpread.push([t]);this.pages[t].setDensity("hard")}}getSpread(){return"landscape"===this.render.getOrientation()?this.landscapeSpread:this.portraitSpread}getSpreadIndexByPage(e){const t=this.getSpread();for(let i=0;i<t.length;i++)if(e===t[i][0]||e===t[i][1])return i;return null}getPageCount(){return this.pages.length}getPages(){return this.pages}getPage(e){if(e>=0&&e<this.pages.length)return this.pages[e];throw new Error("Invalid page number")}nextBy(e){const t=this.pages.indexOf(e);return t<this.pages.length-1?this.pages[t+1]:null}prevBy(e){const t=this.pages.indexOf(e);return t>0?this.pages[t-1]:null}getFlippingPage(e){const t=this.currentSpreadIndex;if("portrait"===this.render.getOrientation())return 0===e?this.pages[t].newTemporaryCopy():this.pages[t-1];{const i=0===e?this.getSpread()[t+1]:this.getSpread()[t-1];return 1===i.length||0===e?this.pages[i[0]]:this.pages[i[1]]}}getBottomPage(e){const t=this.currentSpreadIndex;if("portrait"===this.render.getOrientation())return 0===e?this.pages[t+1]:this.pages[t-1];{const i=0===e?this.getSpread()[t+1]:this.getSpread()[t-1];return 1===i.length?this.pages[i[0]]:0===e?this.pages[i[1]]:this.pages[i[0]]}}showNext(){if(this.currentSpreadIndex<this.getSpread().length){this.currentSpreadIndex++;this.showSpread()}}showPrev(){if(this.currentSpreadIndex>0){this.currentSpreadIndex--;this.showSpread()}}getCurrentPageIndex(){return this.currentPageIndex}show(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===e&&(e=this.currentPageIndex);if(e<0||e>=this.pages.length)return;const t=this.getSpreadIndexByPage(e);if(null!==t){this.currentSpreadIndex=t;this.showSpread()}}getCurrentSpreadIndex(){return this.currentSpreadIndex}setCurrentSpreadIndex(e){if(!(e>=0&&e<this.getSpread().length))throw new Error("Invalid page");this.currentSpreadIndex=e}showSpread(){const e=this.getSpread()[this.currentSpreadIndex];if(2===e.length){this.render.setLeftPage(this.pages[e[0]]);this.render.setRightPage(this.pages[e[1]])}else if("landscape"===this.render.getOrientation())if(e[0]===this.pages.length-1){this.render.setLeftPage(this.pages[e[0]]);this.render.setRightPage(null)}else{this.render.setLeftPage(null);this.render.setRightPage(this.pages[e[0]])}else{this.render.setLeftPage(null);this.render.setRightPage(this.pages[e[0]])}this.currentPageIndex=e[0];this.app.updatePageIndex(this.currentPageIndex)}}class ImagePageCollection extends PageCollection{constructor(e,t,i){super(e,t);this.imagesHref=i}load(){for(const e of this.imagesHref){const t=new ImagePage(this.render,e,"soft");t.load();this.pages.push(t)}this.createSpread()}}class Helper{static GetDistanceBetweenTwoPoint(e,t){return null===e||null===t?1/0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}static GetSegmentLength(e){return Helper.GetDistanceBetweenTwoPoint(e[0],e[1])}static GetAngleBetweenTwoLine(e,t){const i=e[0].y-e[1].y,n=t[0].y-t[1].y,r=e[1].x-e[0].x,s=t[1].x-t[0].x;return Math.acos((i*n+r*s)/(Math.sqrt(i*i+r*r)*Math.sqrt(n*n+s*s)))}static PointInRect(e,t){return null===t?null:t.x>=e.left&&t.x<=e.width+e.left&&t.y>=e.top&&t.y<=e.top+e.height?t:null}static GetRotatedPoint(e,t,i){return{x:e.x*Math.cos(i)+e.y*Math.sin(i)+t.x,y:e.y*Math.cos(i)-e.x*Math.sin(i)+t.y}}static LimitPointToCircle(e,t,i){if(Helper.GetDistanceBetweenTwoPoint(e,i)<=t)return i;const n=e.x,r=e.y,s=i.x,o=i.y;let a=Math.sqrt(Math.pow(t,2)*Math.pow(n-s,2)/(Math.pow(n-s,2)+Math.pow(r-o,2)))+n;i.x<0&&(a*=-1);let l=(a-n)*(r-o)/(n-s)+r;n-s+r===0&&(l=t);return{x:a,y:l}}static GetIntersectBetweenTwoSegment(e,t,i){return Helper.PointInRect(e,Helper.GetIntersectBeetwenTwoLine(t,i))}static GetIntersectBeetwenTwoLine(e,t){const i=e[0].y-e[1].y,n=t[0].y-t[1].y,r=e[1].x-e[0].x,s=t[1].x-t[0].x,o=e[0].x*e[1].y-e[1].x*e[0].y,a=t[0].x*t[1].y-t[1].x*t[0].y,l=i*a-n*o,c=r*a-s*o,h=-(o*s-a*r)/(i*s-n*r),d=-(i*a-n*o)/(i*s-n*r);if(isFinite(h)&&isFinite(d))return{x:h,y:d};if(Math.abs(l-c)<.1)throw new Error("Segment included");return null}static GetCordsFromTwoPoint(e,t){const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y),r=Math.max(i,n),s=[e];function getCord(e,t,i,n,r){return t>e?e+r*(i/n):t<e?e-r*(i/n):e}for(let o=1;o<=r;o+=1)s.push({x:getCord(e.x,t.x,i,r,o),y:getCord(e.y,t.y,n,r,o)});return s}}class HTMLPage extends Page{constructor(e,t,i){super(e,i);this.copiedElement=null;this.temporaryCopy=null;this.isLoad=!1;this.element=t;this.element.classList.add("stf__item");this.element.classList.add("--"+i)}newTemporaryCopy(){if("hard"===this.nowDrawingDensity)return this;if(null===this.temporaryCopy){this.copiedElement=this.element.cloneNode(!0);this.element.parentElement.appendChild(this.copiedElement);this.temporaryCopy=new HTMLPage(this.render,this.copiedElement,this.nowDrawingDensity)}return this.getTemporaryCopy()}getTemporaryCopy(){return this.temporaryCopy}hideTemporaryCopy(){if(null!==this.temporaryCopy){this.copiedElement.remove();this.copiedElement=null;this.temporaryCopy=null}}draw(e){const t=e||this.nowDrawingDensity,i=this.render.convertToGlobal(this.state.position),n=this.render.getRect().pageWidth,r=this.render.getRect().height;this.element.classList.remove("--simple");const s="\n position: absolute;\n display: block;\n z-index: ".concat(this.element.style.zIndex,";\n left: 0;\n top: 0;\n width: ").concat(n,"px;\n height: ").concat(r,"px;\n ");"hard"===t?this.drawHard(s):this.drawSoft(i,s)}drawHard(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=this.render.getRect().left+this.render.getRect().width/2,i=this.state.hardDrawingAngle,n=e+"\n backface-visibility: hidden;\n -webkit-backface-visibility: hidden;\n clip-path: none;\n -webkit-clip-path: none;\n "+(0===this.orientation?"transform-origin: ".concat(this.render.getRect().pageWidth,"px 0;\n transform: translate3d(0, 0, 0) rotateY(").concat(i,"deg);"):"transform-origin: 0 0;\n transform: translate3d(".concat(t,"px, 0, 0) rotateY(").concat(i,"deg);"));this.element.style.cssText=n}drawSoft(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i="polygon( ";for(const e of this.state.area)if(null!==e){let t=1===this.render.getDirection()?{x:-e.x+this.state.position.x,y:e.y-this.state.position.y}:{x:e.x-this.state.position.x,y:e.y-this.state.position.y};t=Helper.GetRotatedPoint(t,{x:0,y:0},this.state.angle);i+=t.x+"px "+t.y+"px, "}i=i.slice(0,-2);i+=")";const n=t+"transform-origin: 0 0; clip-path: ".concat(i,"; -webkit-clip-path: ").concat(i,";")+(this.render.isSafari()&&0===this.state.angle?"transform: translate(".concat(e.x,"px, ").concat(e.y,"px);"):"transform: translate3d(".concat(e.x,"px, ").concat(e.y,"px, 0) rotate(").concat(this.state.angle,"rad);"));this.element.style.cssText=n}simpleDraw(e){const t=this.render.getRect(),i=t.pageWidth,n=t.height,r=1===e?t.left+t.pageWidth:t.left,s=t.top;this.element.classList.add("--simple");this.element.style.cssText="\n position: absolute;\n display: block;\n height: ".concat(n,"px;\n left: ").concat(r,"px;\n top: ").concat(s,"px;\n width: ").concat(i,"px;\n z-index: ").concat(this.render.getSettings().startZIndex+1,";")}getElement(){return this.element}load(){this.isLoad=!0}setOrientation(e){super.setOrientation(e);this.element.classList.remove("--left","--right");this.element.classList.add(1===e?"--right":"--left")}setDrawingDensity(e){this.element.classList.remove("--soft","--hard");this.element.classList.add("--"+e);super.setDrawingDensity(e)}}class HTMLPageCollection extends PageCollection{constructor(e,t,i,n){super(e,t);this.element=i;this.pagesElement=n}load(){for(const e of this.pagesElement){const t=new HTMLPage(this.render,e,"hard"===e.dataset.density?"hard":"soft");t.load();this.pages.push(t)}this.createSpread()}}class FlipCalculation{constructor(e,t,i,n){this.direction=e;this.corner=t;this.topIntersectPoint=null;this.sideIntersectPoint=null;this.bottomIntersectPoint=null;this.pageWidth=parseInt(i,10);this.pageHeight=parseInt(n,10)}calc(e){try{this.position=this.calcAngleAndPosition(e);this.calculateIntersectPoint(this.position);return!0}catch(e){return!1}}getFlippingClipArea(){const e=[];let t=!1;e.push(this.rect.topLeft);e.push(this.topIntersectPoint);if(null===this.sideIntersectPoint)t=!0;else{e.push(this.sideIntersectPoint);null===this.bottomIntersectPoint&&(t=!1)}e.push(this.bottomIntersectPoint);(t||"bottom"===this.corner)&&e.push(this.rect.bottomLeft);return e}getBottomClipArea(){const e=[];e.push(this.topIntersectPoint);if("top"===this.corner)e.push({x:this.pageWidth,y:0});else{null!==this.topIntersectPoint&&e.push({x:this.pageWidth,y:0});e.push({x:this.pageWidth,y:this.pageHeight})}null!==this.sideIntersectPoint?Helper.GetDistanceBetweenTwoPoint(this.sideIntersectPoint,this.topIntersectPoint)>=10&&e.push(this.sideIntersectPoint):"top"===this.corner&&e.push({x:this.pageWidth,y:this.pageHeight});e.push(this.bottomIntersectPoint);e.push(this.topIntersectPoint);return e}getAngle(){return 0===this.direction?-this.angle:this.angle}getRect(){return this.rect}getPosition(){return this.position}getActiveCorner(){return 0===this.direction?this.rect.topLeft:this.rect.topRight}getDirection(){return this.direction}getFlippingProgress(){return Math.abs((this.position.x-this.pageWidth)/(2*this.pageWidth)*100)}getCorner(){return this.corner}getBottomPagePosition(){return 1===this.direction?{x:this.pageWidth,y:0}:{x:0,y:0}}getShadowStartPoint(){return"top"===this.corner?this.topIntersectPoint:null!==this.sideIntersectPoint?this.sideIntersectPoint:this.topIntersectPoint}getShadowAngle(){const e=Helper.GetAngleBetweenTwoLine(this.getSegmentToShadowLine(),[{x:0,y:0},{x:this.pageWidth,y:0}]);return 0===this.direction?e:Math.PI-e}calcAngleAndPosition(e){let t=e;this.updateAngleAndGeometry(t);t="top"===this.corner?this.checkPositionAtCenterLine(t,{x:0,y:0},{x:0,y:this.pageHeight}):this.checkPositionAtCenterLine(t,{x:0,y:this.pageHeight},{x:0,y:0});if(Math.abs(t.x-this.pageWidth)<1&&Math.abs(t.y)<1)throw new Error("Point is too small");return t}updateAngleAndGeometry(e){this.angle=this.calculateAngle(e);this.rect=this.getPageRect(e)}calculateAngle(e){const t=this.pageWidth-e.x+1,i="bottom"===this.corner?this.pageHeight-e.y:e.y;let n=2*Math.acos(t/Math.sqrt(i*i+t*t));i<0&&(n=-n);const r=Math.PI-n;if(!isFinite(n)||r>=0&&r<.003)throw new Error("The G point is too small");"bottom"===this.corner&&(n=-n);return n}getPageRect(e){return"top"===this.corner?this.getRectFromBasePoint([{x:0,y:0},{x:this.pageWidth,y:0},{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}],e):this.getRectFromBasePoint([{x:0,y:-this.pageHeight},{x:this.pageWidth,y:-this.pageHeight},{x:0,y:0},{x:this.pageWidth,y:0}],e)}getRectFromBasePoint(e,t){return{topLeft:this.getRotatedPoint(e[0],t),topRight:this.getRotatedPoint(e[1],t),bottomLeft:this.getRotatedPoint(e[2],t),bottomRight:this.getRotatedPoint(e[3],t)}}getRotatedPoint(e,t){return{x:e.x*Math.cos(this.angle)+e.y*Math.sin(this.angle)+t.x,y:e.y*Math.cos(this.angle)-e.x*Math.sin(this.angle)+t.y}}calculateIntersectPoint(e){const t={left:-1,top:-1,width:this.pageWidth+2,height:this.pageHeight+2};if("top"===this.corner){this.topIntersectPoint=Helper.GetIntersectBetweenTwoSegment(t,[e,this.rect.topRight],[{x:0,y:0},{x:this.pageWidth,y:0}]);this.sideIntersectPoint=Helper.GetIntersectBetweenTwoSegment(t,[e,this.rect.bottomLeft],[{x:this.pageWidth,y:0},{x:this.pageWidth,y:this.pageHeight}]);this.bottomIntersectPoint=Helper.GetIntersectBetweenTwoSegment(t,[this.rect.bottomLeft,this.rect.bottomRight],[{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}])}else{this.topIntersectPoint=Helper.GetIntersectBetweenTwoSegment(t,[this.rect.topLeft,this.rect.topRight],[{x:0,y:0},{x:this.pageWidth,y:0}]);this.sideIntersectPoint=Helper.GetIntersectBetweenTwoSegment(t,[e,this.rect.topLeft],[{x:this.pageWidth,y:0},{x:this.pageWidth,y:this.pageHeight}]);this.bottomIntersectPoint=Helper.GetIntersectBetweenTwoSegment(t,[this.rect.bottomLeft,this.rect.bottomRight],[{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}])}}checkPositionAtCenterLine(e,t,i){let n=e;const r=Helper.LimitPointToCircle(t,this.pageWidth,n);if(n!==r){n=r;this.updateAngleAndGeometry(n)}const s=Math.sqrt(Math.pow(this.pageWidth,2)+Math.pow(this.pageHeight,2));let o=this.rect.bottomRight,a=this.rect.topLeft;if("bottom"===this.corner){o=this.rect.topRight;a=this.rect.bottomLeft}if(o.x<=0){const e=Helper.LimitPointToCircle(i,s,a);if(e!==n){n=e;this.updateAngleAndGeometry(n)}}return n}getSegmentToShadowLine(){const e=this.getShadowStartPoint();return[e,e!==this.sideIntersectPoint&&null!==this.sideIntersectPoint?this.sideIntersectPoint:this.bottomIntersectPoint]}}class Flip{constructor(e,t){this.flippingPage=null;this.bottomPage=null;this.calc=null;this.state="read";this.render=e;this.app=t}fold(e){this.setState("user_fold");null===this.calc&&this.start(e);this.do(this.render.convertToPage(e))}flip(e){if(this.app.getSettings().disableFlipByClick&&!this.isPointOnCorners(e))return;null!==this.calc&&this.render.finishAnimation();if(!this.start(e))return;const t=this.getBoundsRect();this.setState("flipping");const i=t.height/10,n="bottom"===this.calc.getCorner()?t.height-i:i,r="bottom"===this.calc.getCorner()?t.height:0;this.calc.calc({x:t.pageWidth-i,y:n});this.animateFlippingTo({x:t.pageWidth-i,y:n},{x:-t.pageWidth,y:r},!0)}start(e){this.reset();const t=this.render.convertToBook(e),i=this.getBoundsRect(),n=this.getDirectionByPoint(t),r=t.y>=i.height/2?"bottom":"top";if(!this.checkDirection(n))return!1;try{this.flippingPage=this.app.getPageCollection().getFlippingPage(n);this.bottomPage=this.app.getPageCollection().getBottomPage(n);if("landscape"===this.render.getOrientation())if(1===n){const e=this.app.getPageCollection().nextBy(this.flippingPage);if(null!==e&&this.flippingPage.getDensity()!==e.getDensity()){this.flippingPage.setDrawingDensity("hard");e.setDrawingDensity("hard")}}else{const e=this.app.getPageCollection().prevBy(this.flippingPage);if(null!==e&&this.flippingPage.getDensity()!==e.getDensity()){this.flippingPage.setDrawingDensity("hard");e.setDrawingDensity("hard")}}this.render.setDirection(n);this.calc=new FlipCalculation(n,r,i.pageWidth.toString(10),i.height.toString(10));return!0}catch(e){return!1}}do(e){if(null!==this.calc&&this.calc.calc(e)){const e=this.calc.getFlippingProgress();this.bottomPage.setArea(this.calc.getBottomClipArea());this.bottomPage.setPosition(this.calc.getBottomPagePosition());this.bottomPage.setAngle(0);this.bottomPage.setHardAngle(0);this.flippingPage.setArea(this.calc.getFlippingClipArea());this.flippingPage.setPosition(this.calc.getActiveCorner());this.flippingPage.setAngle(this.calc.getAngle());0===this.calc.getDirection()?this.flippingPage.setHardAngle(90*(200-2*e)/100):this.flippingPage.setHardAngle(-90*(200-2*e)/100);this.render.setPageRect(this.calc.getRect());this.render.setBottomPage(this.bottomPage);this.render.setFlippingPage(this.flippingPage);this.render.setShadowData(this.calc.getShadowStartPoint(),this.calc.getShadowAngle(),e,this.calc.getDirection())}}flipToPage(e,t){const i=this.app.getPageCollection().getCurrentSpreadIndex(),n=this.app.getPageCollection().getSpreadIndexByPage(e);try{if(n>i){this.app.getPageCollection().setCurrentSpreadIndex(n-1);this.flipNext(t)}if(n<i){this.app.getPageCollection().setCurrentSpreadIndex(n+1);this.flipPrev(t)}}catch(e){}}flipNext(e){this.flip({x:this.render.getRect().left+2*this.render.getRect().pageWidth-10,y:"top"===e?1:this.render.getRect().height-2})}flipPrev(e){this.flip({x:10,y:"top"===e?1:this.render.getRect().height-2})}stopMove(){if(null===this.calc)return;const e=this.calc.getPosition(),t=this.getBoundsRect(),i="bottom"===this.calc.getCorner()?t.height:0;e.x<=0?this.animateFlippingTo(e,{x:-t.pageWidth,y:i},!0):this.animateFlippingTo(e,{x:t.pageWidth,y:i},!1)}showCorner(e){if(!this.checkState("read","fold_corner"))return;const t=this.getBoundsRect(),i=t.pageWidth;if(this.isPointOnCorners(e))if(null===this.calc){if(!this.start(e))return;this.setState("fold_corner");this.calc.calc({x:i-1,y:1});const n=50,r="bottom"===this.calc.getCorner()?t.height-1:1,s="bottom"===this.calc.getCorner()?t.height-n:n;this.animateFlippingTo({x:i-1,y:r},{x:i-n,y:s},!1,!1)}else this.do(this.render.convertToPage(e));else{this.setState("read");this.render.finishAnimation();this.stopMove()}}animateFlippingTo(e,t,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const r=Helper.GetCordsFromTwoPoint(e,t),s=[];for(const e of r)s.push((()=>this.do(e)));const o=this.getAnimationDuration(r.length);this.render.startAnimation(s,o,(()=>{if(this.calc){i&&(1===this.calc.getDirection()?this.app.turnToPrevPage():this.app.turnToNextPage());if(n){this.render.setBottomPage(null);this.render.setFlippingPage(null);this.render.clearShadow();this.setState("read");this.reset()}}}))}getCalculation(){return this.calc}getState(){return this.state}setState(e){if(this.state!==e){this.app.updateState(e);this.state=e}}getDirectionByPoint(e){const t=this.getBoundsRect();if("portrait"===this.render.getOrientation()){if(e.x-t.pageWidth<=t.width/5)return 1}else if(e.x<t.width/2)return 1;return 0}getAnimationDuration(e){const t=this.app.getSettings().flippingTime;return e>=1e3?t:e/1e3*t}checkDirection(e){return 0===e?this.app.getCurrentPageIndex()<this.app.getPageCount()-1:this.app.getCurrentPageIndex()>=1}reset(){this.calc=null;this.flippingPage=null;this.bottomPage=null}getBoundsRect(){return this.render.getRect()}checkState(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(const e of t)if(this.state===e)return!0;return!1}isPointOnCorners(e){const t=this.getBoundsRect(),i=t.pageWidth,n=Math.sqrt(Math.pow(i,2)+Math.pow(t.height,2))/5,r=this.render.convertToBook(e);return r.x>0&&r.y>0&&r.x<t.width&&r.y<t.height&&(r.x<n||r.x>t.width-n)&&(r.y<n||r.y>t.height-n)}}class Render{constructor(e,t){this.leftPage=null;this.rightPage=null;this.flippingPage=null;this.bottomPage=null;this.direction=null;this.orientation=null;this.shadow=null;this.animation=null;this.pageRect=null;this.boundsRect=null;this.timer=0;this.safari=!1;this.setting=t;this.app=e;const i=new RegExp("Version\\/[\\d\\.]+.*Safari/");this.safari=null!==i.exec(window.navigator.userAgent)}render(e){if(null!==this.animation){const t=Math.round((e-this.animation.startedAt)/this.animation.durationFrame);if(t<this.animation.frames.length)this.animation.frames[t]();else{this.animation.onAnimateEnd();this.animation=null}}this.timer=e;this.drawFrame()}start(){this.update();const loop=e=>{window.ngxZone.runOutsideAngular((()=>{this.render(e);requestAnimationFrame(loop)}))};window.ngxZone.runOutsideAngular((()=>{requestAnimationFrame(loop)}))}startAnimation(e,t,i){this.finishAnimation();this.animation={frames:e,duration:t,durationFrame:t/e.length,onAnimateEnd:i,startedAt:this.timer}}finishAnimation(){if(null!==this.animation){this.animation.frames[this.animation.frames.length-1]();null!==this.animation.onAnimateEnd&&this.animation.onAnimateEnd()}this.animation=null}update(){this.boundsRect=null;const e=this.calculateBoundsRect();if(this.orientation!==e){this.orientation=e;this.app.updateOrientation(e)}}calculateBoundsRect(){let e="landscape";const t=this.getBlockWidth(),i=t/2,n=this.getBlockHeight()/2,r=this.setting.width/this.setting.height;let s=this.setting.width,o=this.setting.height,a=i-s;if("stretch"===this.setting.size){t<2*this.setting.minWidth&&this.app.getSettings().usePortrait&&(e="portrait");s="portrait"===e?this.getBlockWidth():this.getBlockWidth()/2;s>this.setting.maxWidth&&(s=this.setting.maxWidth);o=s/r;if(o>this.getBlockHeight()){o=this.getBlockHeight();s=o*r}a="portrait"===e?i-s/2-s:i-s}else if(t<2*s&&this.app.getSettings().usePortrait){e="portrait";a=i-s/2-s}this.boundsRect={left:a,top:n-o/2,width:2*s,height:o,pageWidth:s};return e}setShadowData(e,t,i,n){if(!this.app.getSettings().drawShadow)return;const r=100*this.getSettings().maxShadowOpacity;this.shadow={pos:e,angle:t,width:3*this.getRect().pageWidth/4*i/100,opacity:(100-i)*r/100/100,direction:n,progress:2*i}}clearShadow(){this.shadow=null}getBlockWidth(){return this.app.getUI().getDistElement().offsetWidth}getBlockHeight(){return this.app.getUI().getDistElement().offsetHeight}getDirection(){return this.direction}getRect(){null===this.boundsRect&&this.calculateBoundsRect();return this.boundsRect}getSettings(){return this.app.getSettings()}getOrientation(){return this.orientation}setPageRect(e){this.pageRect=e}setDirection(e){this.direction=e}setRightPage(e){null!==e&&e.setOrientation(1);this.rightPage=e}setLeftPage(e){null!==e&&e.setOrientation(0);this.leftPage=e}setBottomPage(e){null!==e&&e.setOrientation(1===this.direction?0:1);this.bottomPage=e}setFlippingPage(e){null!==e&&e.setOrientation(0===this.direction&&"portrait"!==this.orientation?0:1);this.flippingPage=e}convertToBook(e){const t=this.getRect();return{x:e.x-t.left,y:e.y-t.top}}isSafari(){return this.safari}convertToPage(e,t){t||(t=this.direction);const i=this.getRect();return{x:0===t?e.x-i.left-i.width/2:i.width/2-e.x+i.left,y:e.y-i.top}}convertToGlobal(e,t){t||(t=this.direction);if(null==e)return null;const i=this.getRect();return{x:0===t?e.x+i.left+i.width/2:i.width/2-e.x+i.left,y:e.y+i.top}}convertRectToGlobal(e,t){t||(t=this.direction);return{topLeft:this.convertToGlobal(e.topLeft,t),topRight:this.convertToGlobal(e.topRight,t),bottomLeft:this.convertToGlobal(e.bottomLeft,t),bottomRight:this.convertToGlobal(e.bottomRight,t)}}}class CanvasRender extends Render{constructor(e,t,i){super(e,t);this.canvas=i;this.ctx=i.getContext("2d")}getContext(){return this.ctx}reload(){}drawFrame(){this.clear();"portrait"!==this.orientation&&null!=this.leftPage&&this.leftPage.simpleDraw(0);null!=this.rightPage&&this.rightPage.simpleDraw(1);null!=this.bottomPage&&this.bottomPage.draw();this.drawBookShadow();null!=this.flippingPage&&this.flippingPage.draw();if(null!=this.shadow){this.drawOuterShadow();this.drawInnerShadow()}const e=this.getRect();if("portrait"===this.orientation){this.ctx.beginPath();this.ctx.rect(e.left+e.pageWidth,e.top,e.width,e.height);this.ctx.clip()}}drawBookShadow(){const e=this.getRect();this.ctx.save();this.ctx.beginPath();const t=e.width/20;this.ctx.rect(e.left,e.top,e.width,e.height);const i={x:e.left+e.width/2-t/2,y:0};this.ctx.translate(i.x,i.y);const n=this.ctx.createLinearGradient(0,0,t,0);n.addColorStop(0,"rgba(0, 0, 0, 0)");n.addColorStop(.4,"rgba(0, 0, 0, 0.2)");n.addColorStop(.49,"rgba(0, 0, 0, 0.1)");n.addColorStop(.5,"rgba(0, 0, 0, 0.5)");n.addColorStop(.51,"rgba(0, 0, 0, 0.4)");n.addColorStop(1,"rgba(0, 0, 0, 0)");this.ctx.clip();this.ctx.fillStyle=n;this.ctx.fillRect(0,0,t,2*e.height);this.ctx.restore()}drawOuterShadow(){const e=this.getRect();this.ctx.save();this.ctx.beginPath();this.ctx.rect(e.left,e.top,e.width,e.height);const t=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y});this.ctx.translate(t.x,t.y);this.ctx.rotate(Math.PI+this.shadow.angle+Math.PI/2);const i=this.ctx.createLinearGradient(0,0,this.shadow.width,0);if(0===this.shadow.direction){this.ctx.translate(0,-100);i.addColorStop(0,"rgba(0, 0, 0, "+this.shadow.opacity+")");i.addColorStop(1,"rgba(0, 0, 0, 0)")}else{this.ctx.translate(-this.shadow.width,-100);i.addColorStop(0,"rgba(0, 0, 0, 0)");i.addColorStop(1,"rgba(0, 0, 0, "+this.shadow.opacity+")")}this.ctx.clip();this.ctx.fillStyle=i;this.ctx.fillRect(0,0,this.shadow.width,2*e.height);this.ctx.restore()}drawInnerShadow(){const e=this.getRect();this.ctx.save();this.ctx.beginPath();const t=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y}),i=this.convertRectToGlobal(this.pageRect);this.ctx.moveTo(i.topLeft.x,i.topLeft.y);this.ctx.lineTo(i.topRight.x,i.topRight.y);this.ctx.lineTo(i.bottomRight.x,i.bottomRight.y);this.ctx.lineTo(i.bottomLeft.x,i.bottomLeft.y);this.ctx.translate(t.x,t.y);this.ctx.rotate(Math.PI+this.shadow.angle+Math.PI/2);const n=3*this.shadow.width/4,r=this.ctx.createLinearGradient(0,0,n,0);if(0===this.shadow.direction){this.ctx.translate(-n,-100);r.addColorStop(1,"rgba(0, 0, 0, "+this.shadow.opacity+")");r.addColorStop(.9,"rgba(0, 0, 0, 0.05)");r.addColorStop(.7,"rgba(0, 0, 0, "+this.shadow.opacity+")");r.addColorStop(0,"rgba(0, 0, 0, 0)")}else{this.ctx.translate(0,-100);r.addColorStop(0,"rgba(0, 0, 0, "+this.shadow.opacity+")");r.addColorStop(.1,"rgba(0, 0, 0, 0.05)");r.addColorStop(.3,"rgba(0, 0, 0, "+this.shadow.opacity+")");r.addColorStop(1,"rgba(0, 0, 0, 0)")}this.ctx.clip();this.ctx.fillStyle=r;this.ctx.fillRect(0,0,n,2*e.height);this.ctx.restore()}clear(){this.ctx.fillStyle="white";this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)}}class UI{constructor(e,t,i){this.touchPoint=null;this.swipeTimeout=250;this.onResize=()=>{this.update()};this.onMouseDown=e=>{if(this.checkTarget(e.target)){const t=this.getMousePos(e.clientX,e.clientY);this.app.startUserTouch(t);e.preventDefault()}};this.onTouchStart=e=>{if(this.checkTarget(e.target)&&e.changedTouches.length>0){const t=e.changedTouches[0],i=this.getMousePos(t.clientX,t.clientY);this.touchPoint={point:i,time:Date.now()};setTimeout((()=>{null!==this.touchPoint&&this.app.startUserTouch(i)}),this.swipeTimeout);this.app.getSettings().mobileScrollSupport||e.preventDefault()}};this.onMouseUp=e=>{const t=this.getMousePos(e.clientX,e.clientY);this.app.userStop(t)};this.onMouseMove=e=>{const t=this.getMousePos(e.clientX,e.clientY);this.app.userMove(t,!1)};this.onTouchMove=e=>{if(e.changedTouches.length>0){const t=e.changedTouches[0],i=this.getMousePos(t.clientX,t.clientY);if(this.app.getSettings().mobileScrollSupport){null!==this.touchPoint&&(Math.abs(this.touchPoint.point.x-i.x)>10||"read"!==this.app.getState())&&e.cancelable&&this.app.userMove(i,!0);"read"!==this.app.getState()&&e.preventDefault()}else this.app.userMove(i,!0)}};this.onTouchEnd=e=>{if(e.changedTouches.length>0){const t=e.changedTouches[0],i=this.getMousePos(t.clientX,t.clientY);let n=!1;if(null!==this.touchPoint){const e=i.x-this.touchPoint.point.x,t=Math.abs(i.y-this.touchPoint.point.y);if(Math.abs(e)>this.swipeDistance&&t<2*this.swipeDistance&&Date.now()-this.touchPoint.time<this.swipeTimeout){e>0?this.app.flipPrev(this.touchPoint.point.y<this.app.getRender().getRect().height/2?"top":"bottom"):this.app.flipNext(this.touchPoint.point.y<this.app.getRender().getRect().height/2?"top":"bottom");n=!0}this.touchPoint=null}this.app.userStop(i,n)}};this.parentElement=e;e.classList.add("stf__parent");e.insertAdjacentHTML("afterbegin",'<div class="stf__wrapper"></div>');this.wrapper=e.querySelector(".stf__wrapper");this.app=t;const n=this.app.getSettings().usePortrait?1:2;e.style.minWidth=i.minWidth*n+"px";e.style.minHeight=i.minHeight+"px";if("fixed"===i.size){e.style.minWidth=i.width*n+"px";e.style.minHeight=i.height+"px"}if(i.autoSize){e.style.width="100%";e.style.maxWidth=2*i.maxWidth+"px"}e.style.display="block";window.addEventListener("resize",this.onResize,!1);this.swipeDistance=i.swipeDistance}destroy(){this.app.getSettings().useMouseEvents&&this.removeHandlers();this.distElement.remove();this.wrapper.remove()}getDistElement(){return this.distElement}getWrapper(){return this.wrapper}setOrientationStyle(e){this.wrapper.classList.remove("--portrait","--landscape");if("portrait"===e){this.app.getSettings().autoSize&&(this.wrapper.style.paddingBottom=this.app.getSettings().height/this.app.getSettings().width*100+"%");this.wrapper.classList.add("--portrait")}else{this.app.getSettings().autoSize&&(this.wrapper.style.paddingBottom=this.app.getSettings().height/(2*this.app.getSettings().width)*100+"%");this.wrapper.classList.add("--landscape")}this.update()}removeHandlers(){window.removeEventListener("resize",this.onResize);this.distElement.removeEventListener("mousedown",this.onMouseDown);this.distElement.removeEventListener("touchstart",this.onTouchStart);window.removeEventListener("mousemove",this.onMouseMove);window.removeEventListener("touchmove",this.onTouchMove);window.removeEventListener("mouseup",this.onMouseUp);window.removeEventListener("touchend",this.onTouchEnd)}setHandlers(){window.addEventListener("resize",this.onResize,!1);if(this.app.getSettings().useMouseEvents){this.distElement.addEventListener("mousedown",this.onMouseDown);this.distElement.addEventListener("touchstart",this.onTouchStart);window.addEventListener("mousemove",this.onMouseMove);window.addEventListener("touchmove",this.onTouchMove,{passive:!this.app.getSettings().mobileScrollSupport});window.addEventListener("mouseup",this.onMouseUp);window.addEventListener("touchend",this.onTouchEnd)}}getMousePos(e,t){const i=this.distElement.getBoundingClientRect();return{x:e-i.left,y:t-i.top}}checkTarget(e){return!this.app.getSettings().clickEventForward||!["a","button"].includes(e.tagName.toLowerCase())}}class HTMLUI extends UI{constructor(e,t,i,n){super(e,t,i);this.wrapper.insertAdjacentHTML("afterbegin",'<div class="stf__block"></div>');this.distElement=e.querySelector(".stf__block");this.items=n;for(const e of n)this.distElement.appendChild(e);this.setHandlers()}clear(){for(const e of this.items)this.parentElement.appendChild(e)}updateItems(e){this.removeHandlers();this.distElement.innerHTML="";for(const t of e)this.distElement.appendChild(t);this.items=e;this.setHandlers()}update(){this.app.getRender().update()}}class CanvasUI extends UI{constructor(e,t,i){super(e,t,i);this.wrapper.innerHTML='<canvas class="stf__canvas"></canvas>';this.canvas=e.querySelectorAll("canvas")[0];this.distElement=this.canvas;this.resizeCanvas();this.setHandlers()}resizeCanvas(){const e=getComputedStyle(this.canvas),t=parseInt(e.getPropertyValue("width"),10),i=parseInt(e.getPropertyValue("height"),10);this.canvas.width=t;this.canvas.height=i}getCanvas(){return this.canvas}update(){this.resizeCanvas();this.app.getRender().update()}}class HTMLRender extends Render{constructor(e,t,i){super(e,t);this.outerShadow=null;this.innerShadow=null;this.hardShadow=null;this.hardInnerShadow=null;this.element=i;this.createShadows()}createShadows(){this.element.insertAdjacentHTML("beforeend",'<div class="stf__outerShadow"></div>\n <div class="stf__innerShadow"></div>\n <div class="stf__hardShadow"></div>\n <div class="stf__hardInnerShadow"></div>');this.outerShadow=this.element.querySelector(".stf__outerShadow");this.innerShadow=this.element.querySelector(".stf__innerShadow");this.hardShadow=this.element.querySelector(".stf__hardShadow");this.hardInnerShadow=this.element.querySelector(".stf__hardInnerShadow")}clearShadow(){super.clearShadow();this.outerShadow.style.cssText="display: none";this.innerShadow.style.cssText="display: none";this.hardShadow.style.cssText="display: none";this.hardInnerShadow.style.cssText="display: none"}reload(){this.element.querySelector(".stf__outerShadow")||this.createShadows()}drawHardInnerShadow(){const e=this.getRect(),t=this.shadow.progress>100?200-this.shadow.progress:this.shadow.progress;let i=(100-t)*(2.5*e.pageWidth)/100+20;i>e.pageWidth&&(i=e.pageWidth);let n="\n display: block;\n z-index: ".concat((this.getSettings().startZIndex+5).toString(10),";\n width: ").concat(i,"px;\n height: ").concat(e.height,"px;\n background: linear-gradient(to right,\n rgba(0, 0, 0, ").concat(this.shadow.opacity*t/100,") 5%,\n rgba(0, 0, 0, 0) 100%);\n left: ").concat(e.left+e.width/2,"px;\n transform-origin: 0 0;\n ");n+=0===this.getDirection()&&this.shadow.progress>100||1===this.getDirection()&&this.shadow.progress<=100?"transform: translate3d(0, 0, 0);":"transform: translate3d(0, 0, 0) rotateY(180deg);";this.hardInnerShadow.style.cssText=n}drawHardOuterShadow(){const e=this.getRect();let t=(100-(this.shadow.progress>100?200-this.shadow.progress:this.shadow.progress))*(2.5*e.pageWidth)/100+20;t>e.pageWidth&&(t=e.pageWidth);let i="\n display: block;\n z-index: ".concat((this.getSettings().startZIndex+4).toString(10),";\n width: ").concat(t,"px;\n height: ").concat(e.height,"px;\n background: linear-gradient(to left, rgba(0, 0, 0, ").concat(this.shadow.opacity,") 5%, rgba(0, 0, 0, 0) 100%);\n left: ").concat(e.left+e.width/2,"px;\n transform-origin: 0 0;\n ");i+=0===this.getDirection()&&this.shadow.progress>100||1===this.getDirection()&&this.shadow.progress<=100?"transform: translate3d(0, 0, 0) rotateY(180deg);":"transform: translate3d(0, 0, 0);";this.hardShadow.style.cssText=i}drawInnerShadow(){const e=this.getRect(),t=3*this.shadow.width/4,i=0===this.getDirection()?t:0,n=0===this.getDirection()?"to left":"to right",r=this.convertToGlobal(this.shadow.pos),s=this.shadow.angle+3*Math.PI/2,o=[this.pageRect.topLeft,this.pageRect.topRight,this.pageRect.bottomRight,this.pageRect.bottomLeft];let a="polygon( ";for(const e of o){let t=1===this.getDirection()?{x:-e.x+this.shadow.pos.x,y:e.y-this.shadow.pos.y}:{x:e.x-this.shadow.pos.x,y:e.y-this.shadow.pos.y};t=Helper.GetRotatedPoint(t,{x:i,y:100},s);a+=t.x+"px "+t.y+"px, "}a=a.slice(0,-2);a+=")";const l="\n display: block;\n z-index: ".concat((this.getSettings().startZIndex+10).toString(10),";\n width: ").concat(t,"px;\n height: ").concat(2*e.height,"px;\n background: linear-gradient(").concat(n,",\n rgba(0, 0, 0, ").concat(this.shadow.opacity,") 5%,\n rgba(0, 0, 0, 0.05) 15%,\n rgba(0, 0, 0, ").concat(this.shadow.opacity,") 35%,\n rgba(0, 0, 0, 0) 100%);\n transform-origin: ").concat(i,"px 100px;\n transform: translate3d(").concat(r.x-i,"px, ").concat(r.y-100,"px, 0) rotate(").concat(s,"rad);\n clip-path: ").concat(a,";\n -webkit-clip-path: ").concat(a,";\n ");this.innerShadow.style.cssText=l}drawOuterShadow(){const e=this.getRect(),t=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y}),i=this.shadow.angle+3*Math.PI/2,n=1===this.getDirection()?this.shadow.width:0,r=0===this.getDirection()?"to right":"to left",s=[{x:0,y:0},{x:e.pageWidth,y:0},{x:e.pageWidth,y:e.height},{x:0,y:e.height}];let o="polygon( ";for(const e of s)if(null!==e){let t=1===this.getDirection()?{x:-e.x+this.shadow.pos.x,y:e.y-this.shadow.pos.y}:{x:e.x-this.shadow.pos.x,y:e.y-this.shadow.pos.y};t=Helper.GetRotatedPoint(t,{x:n,y:100},i);o+=t.x+"px "+t.y+"px, "}o=o.slice(0,-2);o+=")";const a="\n display: block;\n z-index: ".concat((this.getSettings().startZIndex+10).toString(10),";\n width: ").concat(this.shadow.width,"px;\n height: ").concat(2*e.height,"px;\n background: linear-gradient(").concat(r,", rgba(0, 0, 0, ").concat(this.shadow.opacity,"), rgba(0, 0, 0, 0));\n transform-origin: ").concat(n,"px 100px;\n transform: translate3d(").concat(t.x-n,"px, ").concat(t.y-100,"px, 0) rotate(").concat(i,"rad);\n clip-path: ").concat(o,";\n -webkit-clip-path: ").concat(o,";\n ");this.outerShadow.style.cssText=a}drawLeftPage(){if("portrait"!==this.orientation&&null!==this.leftPage)if(1===this.direction&&null!==this.flippingPage&&"hard"===this.flippingPage.getDrawingDensity()){if(this.flippingPage.getHardAngle()<-90){this.leftPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10);this.leftPage.setHardDrawingAngle(180+this.flippingPage.getHardAngle());this.leftPage.draw(this.flippingPage.getDrawingDensity())}else this.leftPage.getElement().style.display="none"}else this.leftPage.simpleDraw(0)}drawRightPage(){if(null!==this.rightPage)if(0===this.direction&&null!==this.flippingPage&&"hard"===this.flippingPage.getDrawingDensity()){if(this.flippingPage.getHardAngle()>90){this.rightPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10);this.rightPage.setHardDrawingAngle(180+this.flippingPage.getHardAngle());this.rightPage.draw(this.flippingPage.getDrawingDensity())}else this.rightPage.getElement().style.display="none"}else this.rightPage.simpleDraw(1)}drawBottomPage(){if(null===this.bottomPage)return;const e=null!=this.flippingPage?this.flippingPage.getDrawingDensity():null;if("portrait"!==this.orientation||1!==this.direction){this.bottomPage.getElement().style.zIndex=(this.getSettings().startZIndex+3).toString(10);this.bottomPage.draw(e)}}drawFrame(){if(null!==this.flippingPage){if(this.flippingPage.getHardAngle()===this.lastAngle)return;this.lastAngle=this.flippingPage.getHardAngle()}else this.lastAngle=-1234;this.clear();this.drawLeftPage();this.drawRightPage();this.drawBottomPage();if(null!=this.flippingPage){if(this.flippingPage.state.hardDrawingAngle<=90){this.flippingPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10);this.flippingPage.draw()}else this.flippingPage.getElement().style.display="none"}if(null!=this.shadow&&null!==this.flippingPage)if("soft"===this.flippingPage.getDrawingDensity()){this.drawOuterShadow();this.drawInnerShadow()}else{this.drawHardOuterShadow();this.drawHardInnerShadow()}}clear(){for(const e of this.app.getPageCollection().getPages()){if(e!==this.leftPage&&e!==this.rightPage&&e!==this.flippingPage&&e!==this.bottomPage){const t=e.getElement().style;"none"!==t.display&&(t.cssText="display: none")}e.getTemporaryCopy()!==this.flippingPage&&e.hideTemporaryCopy()}}update(){super.update();null!==this.rightPage&&this.rightPage.setOrientation(1);null!==this.leftPage&&this.leftPage.setOrientation(0)}}class Settings{constructor(){this._default={startPage:0,size:"fixed",width:0,height:0,minWidth:0,maxWidth:0,minHeight:0,maxHeight:0,drawShadow:!0,flippingTime:1e3,usePortrait:!0,startZIndex:0,autoSize:!0,maxShadowOpacity:1,showCover:!1,mobileScrollSupport:!0,swipeDistance:30,clickEventForward:!0,useMouseEvents:!0,showPageCorners:!0,disableFlipByClick:!1}}getSettings(e){const t=this._default;Object.assign(t,e);if("stretch"!==t.size&&"fixed"!==t.size)throw new Error('Invalid size type. Available only "fixed" and "stretch" value');if(t.width<=0||t.height<=0)throw new Error("Invalid width or height");if(t.flippingTime<=0)throw new Error("Invalid flipping time");if("stretch"===t.size){t.minWidth<=0&&(t.minWidth=100);t.maxWidth<t.minWidth&&(t.maxWidth=2e3);t.minHeight<=0&&(t.minHeight=100);t.maxHeight<t.minHeight&&(t.maxHeight=2e3)}else{t.minWidth=t.width;t.maxWidth=t.width;t.minHeight=t.height;t.maxHeight=t.height}return t}}!function styleInject(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";"top"===i&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r);r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".stf__parent {\n position: relative;\n display: block;\n box-sizing: border-box;\n transform: translateZ(0);\n\n -ms-touch-action: pan-y;\n touch-action: pan-y;\n}\n\n.sft__wrapper {\n position: relative;\n width: 100%;\n box-sizing: border-box;\n}\n\n.stf__parent canvas {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n}\n\n.stf__block {\n position: absolute;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n perspective: 2000px;\n}\n\n.stf__item {\n display: none;\n position: absolute;\n transform-style: preserve-3d;\n}\n\n.stf__outerShadow {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.stf__innerShadow {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.stf__hardShadow {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.stf__hardInnerShadow {\n position: absolute;\n left: 0;\n top: 0;\n}");t.PageFlip=class PageFlip extends class EventObject{constructor(){this.events=new Map}on(e,t){this.events.has(e)?this.events.get(e).push(t):this.events.set(e,[t]);return this}off(e){this.events.delete(e)}trigger(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(this.events.has(e))for(const n of this.events.get(e))n({data:i,object:t})}}{constructor(e,t){super();this.isUserTouch=!1;this.isUserMove=!1;this.setting=null;this.pages=null;this.setting=(new Settings).getSettings(t);this.block=e}destroy(){this.ui.destroy();this.block.remove()}update(){this.render.update();this.pages.show()}loadFromImages(e){this.ui=new CanvasUI(this.block,this,this.setting);const t=this.ui.getCanvas();this.render=new CanvasRender(this,this.setting,t);this.flipController=new Flip(this.render,this);this.pages=new ImagePageCollection(this,this.render,e);this.pages.load();this.render.start();this.pages.show(this.setting.startPage);setTimeout((()=>{this.ui.update();this.trigger("init",this,{page:this.setting.startPage,mode:this.render.getOrientation()})}),1)}loadFromHTML(e){this.ui=new HTMLUI(this.block,this,this.setting,e);this.render=new HTMLRender(this,this.setting,this.ui.getDistElement());this.flipController=new Flip(this.render,this);this.pages=new HTMLPageCollection(this,this.render,this.ui.getDistElement(),e);this.pages.load();this.render.start();this.pages.show(this.setting.startPage);setTimeout((()=>{this.ui.update();this.trigger("init",this,{page:this.setting.startPage,mode:this.render.getOrientation()})}),1)}updateFromImages(e){const t=this.pages.getCurrentPageIndex();this.pages.destroy();this.pages=new ImagePageCollection(this,this.render,e);this.pages.load();this.pages.show(t);this.trigger("update",this,{page:t,mode:this.render.getOrientation()})}updateFromHtml(e){const t=this.pages.getCurrentPageIndex();this.pages.destroy();this.pages=new HTMLPageCollection(this,this.render,this.ui.getDistElement(),e);this.pages.load();this.ui.updateItems(e);this.render.reload();this.pages.show(t);this.trigger("update",this,{page:t,mode:this.render.getOrientation()})}clear(){this.pages.destroy();this.ui.clear()}turnToPrevPage(){this.pages.showPrev()}turnToNextPage(){this.pages.showNext()}turnToPage(e){this.pages.show(e)}flipNext(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"top";this.flipController.flipNext(e)}flipPrev(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"top";this.flipController.flipPrev(e)}flip(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top";this.flipController.flipToPage(e,t)}updateState(e){this.trigger("changeState",this,e)}updatePageIndex(e){this.trigger("flip",this,e)}updateOrientation(e){this.ui.setOrientationStyle(e);this.update();this.trigger("changeOrientation",this,e)}getPageCount(){return this.pages.getPageCount()}getCurrentPageIndex(){return this.pages.getCurrentPageIndex()}getPage(e){return this.pages.getPage(e)}getRender(){return this.render}getFlipController(){return this.flipController}getOrientation(){return this.render.getOrientation()}getBoundsRect(){return this.render.getRect()}getSettings(){return this.setting}getUI(){return this.ui}getState(){return this.flipController.getState()}getPageCollection(){return this.pages}startUserTouch(e){this.mousePosition=e;this.isUserTouch=!0;this.isUserMove=!1}userMove(e,t){if(this.isUserTouch||t||!this.setting.showPageCorners){if(this.isUserTouch&&Helper.GetDistanceBetweenTwoPoint(this.mousePosition,e)>5){this.isUserMove=!0;this.flipController.fold(e)}}else this.flipController.showCorner(e)}userStop(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.isUserTouch){this.isUserTouch=!1;t||(this.isUserMove?this.flipController.stopMove():this.flipController.flip(e))}}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFPageView=void 0;i(1);i(94);i(84);var n=i(155),r=i(153),s=i(83),o=i(191),a=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(i(195)),l=i(196);function _classPrivateFieldInitSpec(e,t,i){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.set(e,i)}function _classPrivateFieldGet(e,t){return function _classApplyDescriptorGet(e,t){if(t.get)return t.get.call(e);return t.value}(e,_classExtractFieldDescriptor(e,t,"get"))}function _classPrivateFieldSet(e,t,i){!function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}(e,_classExtractFieldDescriptor(e,t,"set"),i);return i}function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}const c=s.compatibilityParams.maxCanvasPixels||16777216;var h=new WeakMap,d=new WeakMap;t.PDFPageView=class PDFPageView{constructor(e){var t,i,s,a;_classPrivateFieldInitSpec(this,h,{writable:!0,value:n.AnnotationMode.ENABLE_FORMS});_classPrivateFieldInitSpec(this,d,{writable:!0,value:{initialOptionalContent:!0,regularAnnotations:!0}});const l=e.container,u=e.defaultViewport;this.id=e.id;this.renderingId="page"+this.id;this.pdfPage=null;this.pageLabel=null;this.rotation=0;this.scale=e.scale||r.DEFAULT_SCALE;this.viewport=u;this.pdfPageRotate=u.rotation;this._optionalContentConfigPromise=e.optionalContentConfigPromise||null;this.hasRestrictedScaling=!1;this.textLayerMode=null!==(t=e.textLayerMode)&&void 0!==t?t:r.TextLayerMode.ENABLE;_classPrivateFieldSet(this,h,null!==(i=e.annotationMode)&&void 0!==i?i:n.AnnotationMode.ENABLE_FORMS);this.imageResourcesPath=e.imageResourcesPath||"";this.useOnlyCssZoom=e.useOnlyCssZoom||!1;this.maxCanvasPixels=e.maxCanvasPixels||c;this.pageColors=e.pageColors||null;this.eventBus=e.eventBus;this.renderingQueue=e.renderingQueue;this.textLayerFactory=e.textLayerFactory;this.annotationLayerFactory=e.annotationLayerFactory;this.annotationEditorLayerFactory=e.annotationEditorLayerFactory;this.xfaLayerFactory=e.xfaLayerFactory;this.textHighlighter=null===(s=e.textHighlighterFactory)||void 0===s?void 0:s.createTextHighlighter({pageIndex:this.id-1,eventBus:this.eventBus});this.structTreeLayerFactory=e.structTreeLayerFactory;this.renderer=e.renderer||r.RendererType.CANVAS;this.l10n=e.l10n||o.NullL10n;this.paintTask=null;this.paintedViewportMap=new WeakMap;this.renderingState=r.RenderingStates.INITIAL;this.resume=null;this._renderError=null;this._isStandalone=!(null!==(a=this.renderingQueue)&&void 0!==a&&a.hasViewer());this._annotationCanvasMap=null;this.annotationLayer=null;this.annotationEditorLayer=null;this.textLayer=null;this.zoomLayer=null;this.xfaLayer=null;this.structTreeLayer=null;const p=document.createElement("div");p.className="page";p.style.width=Math.floor(this.viewport.width)+"px";p.style.height=Math.floor(this.viewport.height)+"px";p.setAttribute("data-page-number",this.id);p.setAttribute("role","region");this.l10n.get("page_landmark",{page:this.id}).then((e=>{p.setAttribute("aria-label",e)}));this.div=p;null==l||l.append(p);if(this._isStandalone){const{optionalContentConfigPromise:t}=e;t&&t.then((e=>{t===this._optionalContentConfigPromise&&(_classPrivateFieldGet(this,d).initialOptionalContent=e.hasInitialVisibility)}))}}setPdfPage(e){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.reset()}destroy(){this.reset();this.pdfPage&&this.pdfPage.cleanup()}async _renderAnnotationLayer(){let e=null;try{await this.annotationLayer.render(this.viewport,"display")}catch(t){e=t}finally{this.eventBus.dispatch("annotationlayerrendered",{source:this,pageNumber:this.id,error:e})}}async _renderAnnotationEditorLayer(){let e=null;try{await this.annotationEditorLayer.render(this.viewport,"display")}catch(t){e=t}finally{this.eventBus.dispatch("annotationeditorlayerrendered",{source:this,pageNumber:this.id,error:e})}}async _renderXfaLayer(){let e=null;try{const t=await this.xfaLayer.render(this.viewport,"display");this.textHighlighter&&this._buildXfaTextContentItems(t.textDivs)}catch(t){e=t}finally{this.eventBus.dispatch("xfalayerrendered",{source:this,pageNumber:this.id,error:e})}}async _buildXfaTextContentItems(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(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.zoomLayer)return;const t=this.zoomLayer.firstChild;this.paintedViewportMap.delete(t);t.width=0;t.height=0;e&&this.zoomLayer.remove();this.zoomLayer=null}reset(){var e,t,i;let{keepZoomLayer:n=!1,keepAnnotationLayer:s=!1,keepAnnotationEditorLayer:o=!1,keepXfaLayer:a=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.cancelRendering({keepAnnotationLayer:s,keepAnnotationEditorLayer:o,keepXfaLayer:a});this.renderingState=r.RenderingStates.INITIAL;const l=this.div;l.style.width=Math.floor(this.viewport.width)+"px";l.style.height=Math.floor(this.viewport.height)+"px";const c=l.childNodes,h=n&&this.zoomLayer||null,d=s&&(null===(e=this.annotationLayer)||void 0===e?void 0:e.div)||null,u=o&&(null===(t=this.annotationEditorLayer)||void 0===t?void 0:t.div)||null,p=a&&(null===(i=this.xfaLayer)||void 0===i?void 0:i.div)||null;for(let e=c.length-1;e>=0;e--){const t=c[e];switch(t){case h:case d:case u:case p:continue}t.remove()}l.removeAttribute("data-loaded");d&&this.annotationLayer.hide();if(u)this.annotationEditorLayer.hide();else{var g;null===(g=this.annotationEditorLayer)||void 0===g||g.destroy()}p&&this.xfaLayer.hide();if(!h){if(this.canvas){this.paintedViewportMap.delete(this.canvas);this.canvas.width=0;this.canvas.height=0;delete this.canvas}this._resetZoomLayer()}if(this.svg){this.paintedViewportMap.delete(this.svg);delete this.svg}this.loadingIconDiv=document.createElement("div");this.loadingIconDiv.className="loadingIcon notVisible";this._isStandalone&&this.toggleLoadingIconSpinner(!0);this.loadingIconDiv.setAttribute("role","img");this.l10n.get("loading").then((e=>{var t;null===(t=this.loadingIconDiv)||void 0===t||t.setAttribute("aria-label",e)}));l.append(this.loadingIconDiv)}update(e){let{scale:t=0,rotation:i=null,optionalContentConfigPromise:s=null}=e;this.scale=t||this.scale;"number"==typeof i&&(this.rotation=i);if(s instanceof Promise){this._optionalContentConfigPromise=s;s.then((e=>{s===this._optionalContentConfigPromise&&(_classPrivateFieldGet(this,d).initialOptionalContent=e.hasInitialVisibility)}))}const o=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:this.scale*n.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:o});this._isStandalone&&r.docStyle.setProperty("--scale-factor",this.viewport.scale);if(this.svg){this.cssTransform({target:this.svg,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0});this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this._renderError});return}let a=!1;if(this.canvas&&this.maxCanvasPixels>0){const e=this.outputScale;(Math.floor(this.viewport.width)*e.sx|0)*(Math.floor(this.viewport.height)*e.sy|0)>this.maxCanvasPixels&&(a=!0)}if(this.canvas){if(this.useOnlyCssZoom||this.hasRestrictedScaling&&a){this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0});this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this._renderError});return}if(!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})}cancelRendering(){let{keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:t=!1,keepXfaLayer:i=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.paintTask){this.paintTask.cancel();this.paintTask=null}this.resume=null;if(this.textLayer){this.textLayer.cancel();this.textLayer=null}if(this.annotationLayer&&(!e||!this.annotationLayer.div)){this.annotationLayer.cancel();this.annotationLayer=null;this._annotationCanvasMap=null}if(this.annotationEditorLayer&&(!t||!this.annotationEditorLayer.div)){this.annotationEditorLayer.cancel();this.annotationEditorLayer=null}if(this.xfaLayer&&(!i||!this.xfaLayer.div)){var n;this.xfaLayer.cancel();this.xfaLayer=null;null===(n=this.textHighlighter)||void 0===n||n.disable()}if(this._onTextLayerRendered){this.eventBus._off("textlayerrendered",this._onTextLayerRendered);this._onTextLayerRendered=null}}cssTransform(e){let{target:t,redrawAnnotationLayer:i=!1,redrawAnnotationEditorLayer:n=!1,redrawXfaLayer:r=!1}=e;const s=this.viewport.width,o=this.viewport.height,a=this.div;t.style.width=t.parentNode.style.width=a.style.width=Math.floor(s)+"px";t.style.height=t.parentNode.style.height=a.style.height=Math.floor(o)+"px";const l=this.viewport.rotation-this.paintedViewportMap.get(t).rotation,c=Math.abs(l);let h=1,d=1;if(90===c||270===c){h=o/s;d=s/o}t.style.transform="rotate(".concat(l,"deg) scale(").concat(h,", ").concat(d,")");if(this.textLayer){const e=this.textLayer.viewport,t=this.viewport.rotation-e.rotation,i=Math.abs(t);let n=s/e.width;90!==i&&270!==i||(n=s/e.height);const r=this.textLayer.textLayerDiv;let o,a;switch(i){case 0:o=a=0;break;case 90:o=0;a="-"+r.style.height;break;case 180:o="-"+r.style.width;a="-"+r.style.height;break;case 270:o="-"+r.style.width;a=0;break;default:Window.ngxConsole.error("Bad rotation value.")}r.style.transform="rotate(".concat(i,"deg) ")+"scale(".concat(n,") ")+"translate(".concat(o,", ").concat(a,")");r.style.transformOrigin="0% 0%"}i&&this.annotationLayer&&this._renderAnnotationLayer();n&&this.annotationEditorLayer&&this._renderAnnotationEditorLayer();r&&this.xfaLayer&&this._renderXfaLayer()}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,t){return this.viewport.convertToPdfPoint(e,t)}toggleLoadingIconSpinner(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=this.loadingIconDiv)||void 0===e||e.classList.toggle("notVisible",!t)}draw(){var e,t,i,s=this;if(this.renderingState!==r.RenderingStates.INITIAL){Window.ngxConsole.error("Must be in new state before drawing");this.reset()}const{div:o,pdfPage:a}=this;if(!a){this.renderingState=r.RenderingStates.FINISHED;if(this.loadingIconDiv){this.loadingIconDiv.remove();delete this.loadingIconDiv}return Promise.reject(new Error("pdfPage is not loaded"))}this.renderingState=r.RenderingStates.RUNNING;const l=document.createElement("div");l.style.width=o.style.width;l.style.height=o.style.height;l.classList.add("canvasWrapper");const c=(null===(e=this.annotationLayer)||void 0===e?void 0:e.div)||(null===(t=this.annotationEditorLayer)||void 0===t?void 0:t.div);c?c.before(l):o.append(l);let u=null;if(this.textLayerMode!==r.TextLayerMode.DISABLE&&this.textLayerFactory){const e=document.createElement("div");e.className="textLayer";e.style.width=l.style.width;e.style.height=l.style.height;c?c.before(e):o.append(e);u=this.textLayerFactory.createTextLayerBuilder({textLayerDiv:e,pageIndex:this.id-1,viewport:this.viewport,enhanceTextSelection:this.textLayerMode===r.TextLayerMode.ENABLE_ENHANCE,eventBus:this.eventBus,highlighter:this.textHighlighter})}this.textLayer=u;if(_classPrivateFieldGet(this,h)!==n.AnnotationMode.DISABLE&&this.annotationLayerFactory){this._annotationCanvasMap||(this._annotationCanvasMap=new Map);this.annotationLayer||(this.annotationLayer=this.annotationLayerFactory.createAnnotationLayerBuilder({pageDiv:o,pdfPage:a,imageResourcesPath:this.imageResourcesPath,renderForms:_classPrivateFieldGet(this,h)===n.AnnotationMode.ENABLE_FORMS,l10n:this.l10n,annotationCanvasMap:this._annotationCanvasMap}))}null!==(i=this.xfaLayer)&&void 0!==i&&i.div&&o.append(this.xfaLayer.div);let p=null;this.renderingQueue&&(p=e=>{if(this.renderingQueue.isHighestPriority(this))e();else{this.renderingState=r.RenderingStates.PAUSED;this.resume=()=>{this.renderingState=r.RenderingStates.RUNNING;e()}}});const finishPaintTask=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;g===s.paintTask&&(s.paintTask=null);if(e instanceof n.RenderingCancelledException)s._renderError=null;else{s._renderError=e;s.renderingState=r.RenderingStates.FINISHED;if(s.loadingIconDiv){s.loadingIconDiv.remove();delete s.loadingIconDiv}s._resetZoomLayer(!0);_classPrivateFieldGet(s,d).regularAnnotations=!g.separateAnnots;s.eventBus.dispatch("pagerendered",{source:s,pageNumber:s.id,cssTransform:!1,timestamp:performance.now(),error:s._renderError});if(e)throw e}},g=this.renderer===r.RendererType.SVG?this.paintOnSvg(l):this.paintOnCanvas(l);g.onRenderContinue=p;this.paintTask=g;const f=g.promise.then((()=>finishPaintTask(null).then((()=>{if(u){const e=a.streamTextContent({includeMarkedContent:!0});u.setTextContentStream(e);u.render()}this.annotationLayer&&this._renderAnnotationLayer().then((()=>{if(this.annotationEditorLayerFactory){this.annotationEditorLayer||(this.annotationEditorLayer=this.annotationEditorLayerFactory.createAnnotationEditorLayerBuilder({pageDiv:o,pdfPage:a,l10n:this.l10n}));this._renderAnnotationEditorLayer()}}))}))),(function(e){return finishPaintTask(e)}));if(this.xfaLayerFactory){this.xfaLayer||(this.xfaLayer=this.xfaLayerFactory.createXfaLayerBuilder({pageDiv:o,pdfPage:a}));this._renderXfaLayer()}if(this.structTreeLayerFactory&&this.textLayer&&this.canvas){this._onTextLayerRendered=e=>{if(e.pageNumber===this.id){this.eventBus._off("textlayerrendered",this._onTextLayerRendered);this._onTextLayerRendered=null;this.canvas&&this.pdfPage.getStructTree().then((e=>{if(!e)return;if(!this.canvas)return;const t=this.structTreeLayer.render(e);t.classList.add("structTree");this.canvas.append(t)}))}};this.eventBus._on("textlayerrendered",this._onTextLayerRendered);this.structTreeLayer=this.structTreeLayerFactory.createStructTreeLayerBuilder({pdfPage:a})}o.setAttribute("data-loaded",!0);this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id});return f}paintOnCanvas(e){const t=(0,n.createPromiseCapability)(),i={promise:t.promise,onRenderContinue(e){e()},cancel(){P.cancel()},get separateAnnots(){return P.separateAnnots}},s=this.viewport,o=document.createElement("canvas");o.setAttribute("role","presentation");o.hidden=!0;let c=!0;const showCanvas=function(){if(c){o.hidden=!1;c=!1}};e.append(o);this.canvas=o;const d=o.getContext("2d",{alpha:!1}),u=this.outputScale=new r.OutputScale;if(this.useOnlyCssZoom){const e=s.clone({scale:n.PixelsPerInch.PDF_TO_CSS_UNITS});u.sx*=e.width/s.width;u.sy*=e.height/s.height}if(this.maxCanvasPixels>0){const e=s.width*s.height,t=Math.sqrt(this.maxCanvasPixels/e);if(u.sx>t||u.sy>t){u.sx=t;u.sy=t;this.hasRestrictedScaling=!0}else this.hasRestrictedScaling=!1}const p=(0,r.approximateFraction)(u.sx),g=(0,r.approximateFraction)(u.sy),f=(0,r.roundToDivide)(s.width*u.sx,p[0]),m=(0,r.roundToDivide)(s.height*u.sy,g[0]);let v=1;if((f>=4096||m>=4096)&&(this.maxWidth||!a.default.test({width:f,height:m}))){const e=this.determineMaxDimensions();v=Math.max(f/e,m/e);if(v>1){const e=Math.floor(100*this.scale/v)/100;v=this.scale/e;s.width/=v;s.height/=v;(0,l.warn)("Page ".concat(this.id,": Reduced the maximum zoom to ").concat(e," because the browser can't render larger canvases."))}else v=1}o.width=(0,r.roundToDivide)(s.width*u.sx,p[0]);o.height=(0,r.roundToDivide)(s.height*u.sy,g[0]);o.style.width=(0,r.roundToDivide)(s.width*v,p[1])+"px";o.style.height=(0,r.roundToDivide)(s.height*v,g[1])+"px";this.paintedViewportMap.set(o,s);const w=u.scaled?[u.sx,0,0,u.sy,0,0]:null;let _=PDFViewerApplicationOptions.get("pdfBackgroundColor");if("function"==typeof _){const e=_({pageNumber:this.id,pageLabel:this.pageLabel});e&&(_=e)}let y=_?PDFViewerApplicationOptions.get("pdfBackgroundColorToReplace"):null;if("function"==typeof y){const e=y({pageNumber:this.id,pageLabel:this.pageLabel});e&&(y=e)}const b={canvasContext:d,transform:w,viewport:this.viewport,annotationMode:_classPrivateFieldGet(this,h),optionalContentConfigPromise:this._optionalContentConfigPromise,background:_,backgroundColorToReplace:y,annotationCanvasMap:this._annotationCanvasMap,pageColors:this.pageColors},P=this.pdfPage.render(b);P.onContinue=function(e){showCanvas();i.onRenderContinue?i.onRenderContinue(e):e()};P.promise.then((function(){showCanvas();t.resolve()}),(function(e){showCanvas();t.reject(e)}));return i}paintOnSvg(e){let t=!1;const ensureNotCancelled=()=>{if(t)throw new n.RenderingCancelledException("Rendering cancelled, page ".concat(this.id),"svg")},i=this.pdfPage,s=this.viewport.clone({scale:n.PixelsPerInch.PDF_TO_CSS_UNITS});return{promise:i.getOperatorList({annotationMode:_classPrivateFieldGet(this,h)}).then((t=>{ensureNotCancelled();return new n.SVGGraphics(i.commonObjs,i.objs).getSVG(t,s).then((t=>{ensureNotCancelled();this.svg=t;this.paintedViewportMap.set(t,s);t.style.width=e.style.width;t.style.height=e.style.height;this.renderingState=r.RenderingStates.FINISHED;e.append(t)}))})),onRenderContinue(e){e()},cancel(){t=!0},get separateAnnots(){return!1}}}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")}determineMaxDimensions(){if(this.maxWidth)return this.maxWidth;const e=[4096,8192,10836,11180,11402,14188,16384];for(const t of e)if(!a.default.test({width:t+1,height:t+1})){this.maxWidth=t;return this.maxWidth}return 16384}get thumbnailCanvas(){const{initialOptionalContent:e,regularAnnotations:t}=_classPrivateFieldGet(this,d);return e&&t?this.canvas:null}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=void 0;i(1);i(84);i(138);i(152);i(94);function ownKeys(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));i.push.apply(i,n)}return i}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(i),!0).forEach((function(t){_defineProperty(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function _defineProperty(e,t,i){t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i;return e}function _objectWithoutProperties(e,t){if(null==e)return{};var i,n,r=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var i,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++){i=s[n];t.indexOf(i)>=0||(r[i]=e[i])}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++){i=s[n];t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}}return r}function _slicedToArray(e,t){return function _arrayWithHoles(e){if(Array.isArray(e))return e}(e)||function _iterableToArrayLimit(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var n,r,s=[],o=!0,a=!1;try{for(i=i.call(e);!(o=(n=i.next()).done);o=!0){s.push(n.value);if(t&&s.length===t)break}}catch(e){a=!0;r=e}finally{try{o||null==i.return||i.return()}finally{if(a)throw r}}return s}(e,t)||_unsupportedIterableToArray(e,t)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}(e)||function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_unsupportedIterableToArray(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);return"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function canvasTest(e){var t,i,n=e.sizes.shift(),r=Math.max(Math.ceil(n[0]),1),s=Math.max(Math.ceil(n[1]),1),o=[r-1,s-1,1,1],a=Date.now(),l="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;if(l){t=new OffscreenCanvas(1,1);i=new OffscreenCanvas(r,s)}else{(t=document.createElement("canvas")).width=1;t.height=1;(i=document.createElement("canvas")).width=r;i.height=s}var c=t.getContext("2d"),h=i.getContext("2d");if(h){h.fillRect.apply(h,o);c.drawImage(i,r-1,s-1,1,1,0,0,1,1)}var d=c&&0!==c.getImageData(0,0,1,1).data[3],u=Date.now()-a;if(l){postMessage({width:r,height:s,benchmark:u,isTestPass:d});!d&&e.sizes.length&&canvasTest(e)}else if(d)e.onSuccess(r,s,u);else{e.onError(r,s,u);e.sizes.length&&canvasTest(e)}return d}var n=[16384,14188,11402,11180,10836,8192,4096,1],r=[8388607,65535,32767,16384,8192,4096,1],s=[4194303,65535,32767,16384,8192,4096,1],o=["onError","onSuccess"],a={max:null,min:1,sizes:[],step:1024,usePromise:!1,useWorker:!1,onError:Function.prototype,onSuccess:Function.prototype},l={};function createSizesArray(e){var t=e.width===e.height,i=1===e.height,n=1===e.width,r=[];if(e.width&&e.height)for(var s=e.min||a.min,o=e.step||a.step,l=Math.max(e.width,e.height);l>=s;){var c=t||i?l:1,h=t||n?l:1;r.push([c,h]);l-=o}else e.sizes.forEach((function(e){var s=t||i?e:1,o=t||n?e:1;r.push([s,o])}));return r}function handleMethod(e){var t=window&&"HTMLCanvasElement"in window,i=window&&"OffscreenCanvas"in window,n=Date.now(),r=e.onError,s=e.onSuccess,a=_objectWithoutProperties(e,o),c=null;if(!t)return!1;if(e.useWorker&&i){var h="\n var canvasTest = ".concat(canvasTest.toString(),";\n onmessage = function(e) {\n canvasTest(e.data);\n };\n "),d=new Blob([h],{type:"application/javascript"}),u=URL.createObjectURL(d);c=new Worker(u);URL.revokeObjectURL(u);c.onmessage=function(e){var t=e.data,i=t.width,r=t.height,s=t.benchmark;if(t.isTestPass){l[n].onSuccess(i,r,s);delete l[n]}else l[n].onError(i,r,s)}}if(e.usePromise)return new Promise((function(t,i){var o=_objectSpread2(_objectSpread2({},e),{},{onError:function onError(t,n,s){var o;if(0===e.sizes.length)o=!0;else{var a=_slicedToArray(e.sizes.slice(-1),1),l=_slicedToArray(a[0],2),c=l[0],h=l[1];o=t===c&&n===h}r(t,n,s);o&&i({width:t,height:n,benchmark:s})},onSuccess:function onSuccess(e,i,n){s(e,i,n);t({width:e,height:i,benchmark:n})}});if(c){var h=o.onError,d=o.onSuccess;l[n]={onError:h,onSuccess:d};c.postMessage(a)}else canvasTest(o)}));if(!c)return canvasTest(e);l[n]={onError:r,onSuccess:s};c.postMessage(a)}var c={maxArea:function maxArea(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=createSizesArray({width:e.max,height:e.max,min:e.min,step:e.step,sizes:_toConsumableArray(n)}),i=_objectSpread2(_objectSpread2(_objectSpread2({},a),e),{},{sizes:t});return handleMethod(i)},maxHeight:function maxHeight(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=createSizesArray({width:1,height:e.max,min:e.min,step:e.step,sizes:_toConsumableArray(r)}),i=_objectSpread2(_objectSpread2(_objectSpread2({},a),e),{},{sizes:t});return handleMethod(i)},maxWidth:function maxWidth(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=createSizesArray({width:e.max,height:1,min:e.min,step:e.step,sizes:_toConsumableArray(s)}),i=_objectSpread2(_objectSpread2(_objectSpread2({},a),e),{},{sizes:t});return handleMethod(i)},test:function test(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=_objectSpread2(_objectSpread2({},a),e);t.sizes=_toConsumableArray(t.sizes);t.width&&t.height&&(t.sizes=[[t.width,t.height]]);return handleMethod(t)}};t.default=c},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.UNSUPPORTED_FEATURES=t.TextRenderingMode=t.StreamType=t.RenderingIntentFlag=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FontType=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.AnnotationType=t.AnnotationStateModelType=t.AnnotationReviewState=t.AnnotationReplyType=t.AnnotationMode=t.AnnotationMarkedState=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0;t.arrayByteLength=arrayByteLength;t.arraysToBytes=function arraysToBytes(e){const t=e.length;if(1===t&&e[0]instanceof Uint8Array)return e[0];let i=0;for(let n=0;n<t;n++)i+=arrayByteLength(e[n]);let n=0;const r=new Uint8Array(i);for(let i=0;i<t;i++){let t=e[i];t instanceof Uint8Array||(t="string"==typeof t?stringToBytes(t):new Uint8Array(t));const s=t.byteLength;r.set(t,n);n+=s}return r};t.assert=function assert(e,t){e||unreachable(t)};t.bytesToString=function bytesToString(e){"object"==typeof e&&null!==e&&void 0!==e.length||unreachable("Invalid argument for bytesToString");const t=e.length,i=8192;if(t<i)return String.fromCharCode.apply(null,e);const n=[];for(let r=0;r<t;r+=i){const s=Math.min(r+i,t),o=e.subarray(r,s);n.push(String.fromCharCode.apply(null,o))}return n.join("")};t.createPromiseCapability=function createPromiseCapability(){const e=Object.create(null);let t=!1;Object.defineProperty(e,"settled",{get:()=>t});e.promise=new Promise((function(i,n){e.resolve=function(e){t=!0;i(e)};e.reject=function(e){t=!0;n(e)}}));return e};t.createValidAbsoluteUrl=function createValidAbsoluteUrl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return null;try{if(i&&"string"==typeof e){if(i.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);t&&t.length>=2&&(e="http://".concat(e))}if(i.tryConvertEncoding)try{e=stringToUTF8String(e)}catch(e){}}const n=t?new URL(e,t):new URL(e);if(_isValidProtocol(n))return n}catch(e){}return null};t.escapeString=function escapeString(e){return e.replace(/([()\\\n\r])/g,(e=>"\n"===e?"\\n":"\r"===e?"\\r":"\\".concat(e)))};t.getModificationDate=function getModificationDate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;const t=[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")];return t.join("")};t.getVerbosityLevel=function getVerbosityLevel(){return r};t.info=function info(e){r>=n.INFOS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log("Info: ".concat(e)):Window&&Window.ngxConsole?Window.ngxConsole.log("Info: ".concat(e)):console.log("Info: ".concat(e)))};t.isArrayBuffer=function isArrayBuffer(e){return"object"==typeof e&&null!==e&&void 0!==e.byteLength};t.isArrayEqual=function isArrayEqual(e,t){if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;i++)if(e[i]!==t[i])return!1;return!0};t.isAscii=function isAscii(e){return/^[\x00-\x7F]*$/.test(e)};t.objectFromMap=function objectFromMap(e){const t=Object.create(null);for(const[i,n]of e)t[i]=n;return t};t.objectSize=function objectSize(e){return Object.keys(e).length};t.setVerbosityLevel=function setVerbosityLevel(e){Number.isInteger(e)&&(r=e)};t.shadow=shadow;t.string32=function string32(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)};t.stringToBytes=stringToBytes;t.stringToPDFString=function stringToPDFString(e){if(e[0]>="ï"){let t;"þ"===e[0]&&"ÿ"===e[1]?t="utf-16be":"ÿ"===e[0]&&"þ"===e[1]?t="utf-16le":"ï"===e[0]&&"»"===e[1]&&"¿"===e[2]&&(t="utf-8");if(t)try{const i=new TextDecoder(t,{fatal:!0}),n=stringToBytes(e);return i.decode(n)}catch(e){warn('stringToPDFString: "'.concat(e,'".'))}}const t=[];for(let i=0,n=e.length;i<n;i++){const n=a[e.charCodeAt(i)];t.push(n?String.fromCharCode(n):e.charAt(i))}return t.join("")};t.stringToUTF16BEString=function stringToUTF16BEString(e){const t=["þÿ"];for(let i=0,n=e.length;i<n;i++){const n=e.charCodeAt(i);t.push(String.fromCharCode(n>>8&255),String.fromCharCode(255&n))}return t.join("")};t.stringToUTF8String=stringToUTF8String;t.unreachable=unreachable;t.utf8StringToString=function utf8StringToString(e){return unescape(encodeURIComponent(e))};t.warn=warn;i(84);i(1);i(138);i(152);i(197);i(214);i(216);i(217);i(221);i(132);i(94);i(222);t.IDENTITY_MATRIX=[1,0,0,1,0,0];t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];t.LINE_FACTOR=1.35;t.LINE_DESCENT_FACTOR=.35;t.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};t.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};t.AnnotationEditorPrefix="pdfjs_internal_editor_";t.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};t.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};t.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};t.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};t.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};t.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};t.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};t.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};t.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};t.AnnotationReplyType={GROUP:"Group",REPLY:"R"};t.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};t.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};t.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};t.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};t.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};t.PageActionEventType={O:"PageOpen",C:"PageClose"};t.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};t.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};const n={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=n;t.CMapCompressionType={NONE:0,BINARY:1,STREAM:2};t.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};t.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let r=n.WARNINGS;function warn(e){r>=n.WARNINGS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log("Warning: ".concat(e)):Window&&Window.ngxConsole?Window.ngxConsole.log("Warning: ".concat(e)):console.log("Warning: ".concat(e)))}function unreachable(e){throw new Error(e)}function _isValidProtocol(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":case"capacitor":return!0;default:return!1}}function shadow(e,t,i){Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!1});return i}const s=function BaseExceptionClosure(){function BaseException(e,t){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=e;this.name=t}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();t.BaseException=s;t.PasswordException=class PasswordException extends s{constructor(e,t){super(e,"PasswordException");this.code=t}};t.UnknownErrorException=class UnknownErrorException extends s{constructor(e,t){super(e,"UnknownErrorException");this.details=t}};t.InvalidPDFException=class InvalidPDFException extends s{constructor(e){super(e,"InvalidPDFException")}};t.MissingPDFException=class MissingPDFException extends s{constructor(e){super(e,"MissingPDFException")}};t.UnexpectedResponseException=class UnexpectedResponseException extends s{constructor(e,t){super(e,"UnexpectedResponseException");this.status=t}};t.FormatError=class FormatError extends s{constructor(e){super(e,"FormatError")}};t.AbortException=class AbortException extends s{constructor(e){super(e,"AbortException")}};function stringToBytes(e){"string"!=typeof e&&unreachable("Invalid argument for stringToBytes");const t=e.length,i=new Uint8Array(t);for(let n=0;n<t;++n)i[n]=255&e.charCodeAt(n);return i}function arrayByteLength(e){if(void 0!==e.length)return e.length;if(void 0!==e.byteLength)return e.byteLength;unreachable("Invalid argument for arrayByteLength")}t.FeatureTest=class FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",function isLittleEndian(){const e=new Uint8Array(4);e[0]=1;return 1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch(e){return!1}}())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}};const o=[...Array(256).keys()].map((e=>e.toString(16).padStart(2,"0")));class Util{static makeHexColor(e,t,i){return"#".concat(o[e]).concat(o[t]).concat(o[i])}static scaleMinMax(e,t){let i;if(e[0]){if(e[0]<0){i=t[0];t[0]=t[1];t[1]=i}t[0]*=e[0];t[1]*=e[0];if(e[3]<0){i=t[2];t[2]=t[3];t[3]=i}t[2]*=e[3];t[3]*=e[3]}else{i=t[0];t[0]=t[2];t[2]=i;i=t[1];t[1]=t[3];t[3]=i;if(e[1]<0){i=t[2];t[2]=t[3];t[3]=i}t[2]*=e[1];t[3]*=e[1];if(e[2]<0){i=t[0];t[0]=t[1];t[1]=i}t[0]*=e[2];t[1]*=e[2]}t[0]+=e[4];t[1]+=e[4];t[2]+=e[5];t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const i=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/i,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/i]}static getAxialAlignedBoundingBox(e,t){const i=Util.applyTransform(e,t),n=Util.applyTransform(e.slice(2,4),t),r=Util.applyTransform([e[0],e[3]],t),s=Util.applyTransform([e[2],e[1]],t);return[Math.min(i[0],n[0],r[0],s[0]),Math.min(i[1],n[1],r[1],s[1]),Math.max(i[0],n[0],r[0],s[0]),Math.max(i[1],n[1],r[1],s[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static apply3dTransform(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2],e[3]*t[0]+e[4]*t[1]+e[5]*t[2],e[6]*t[0]+e[7]*t[1]+e[8]*t[2]]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],i=e[0]*t[0]+e[1]*t[2],n=e[0]*t[1]+e[1]*t[3],r=e[2]*t[0]+e[3]*t[2],s=e[2]*t[1]+e[3]*t[3],o=(i+s)/2,a=Math.sqrt((i+s)**2-4*(i*s-r*n))/2,l=o+a||1,c=o-a||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);if(e[0]>e[2]){t[0]=e[2];t[2]=e[0]}if(e[1]>e[3]){t[1]=e[3];t[3]=e[1]}return t}static intersect(e,t){const i=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),n=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(i>n)return null;const r=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return r>s?null:[i,r,n,s]}static bezierBoundingBox(e,t,i,n,r,s,o,a){const l=[],c=[[],[]];let h,d,u,p,g,f,m,v;for(let c=0;c<2;++c){if(0===c){d=6*e-12*i+6*r;h=-3*e+9*i-9*r+3*o;u=3*i-3*e}else{d=6*t-12*n+6*s;h=-3*t+9*n-9*s+3*a;u=3*n-3*t}if(Math.abs(h)<1e-12){if(Math.abs(d)<1e-12)continue;p=-u/d;0<p&&p<1&&l.push(p)}else{m=d*d-4*u*h;v=Math.sqrt(m);if(!(m<0)){g=(-d+v)/(2*h);0<g&&g<1&&l.push(g);f=(-d-v)/(2*h);0<f&&f<1&&l.push(f)}}}let w,_=l.length;const y=_;for(;_--;){p=l[_];w=1-p;c[0][_]=w*w*w*e+3*w*w*p*i+3*w*p*p*r+p*p*p*o;c[1][_]=w*w*w*t+3*w*w*p*n+3*w*p*p*s+p*p*p*a}c[0][y]=e;c[1][y]=t;c[0][y+1]=o;c[1][y+1]=a;c[0].length=c[1].length=y+2;return[Math.min(...c[0]),Math.min(...c[1]),Math.max(...c[0]),Math.max(...c[1])]}}t.Util=Util;const a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToUTF8String(e){return decodeURIComponent(escape(e))}},(e,t,i)=>{i(198)("Uint8",(function(e){return function Uint8Array(t,i,n){return e(this,t,i,n)}}))},(e,t,i)=>{"use strict";var n=i(65),r=i(2),s=i(39),o=i(33),a=i(199),l=i(200),c=i(202),h=i(98),d=i(63),u=i(62),p=i(206),g=i(53),f=i(203),m=i(207),v=i(37),w=i(22),_=i(87),y=i(6),b=i(40),P=i(30),S=i(41),E=i(81),x=i(73).f,C=i(209),T=i(210).forEach,I=i(97),M=i(35),L=i(66),A=i(59),D=i(170),k=A.get,O=A.set,R=A.enforce,B=M.f,N=L.f,V=Math.round,U=r.RangeError,W=c.ArrayBuffer,H=W.prototype,G=c.DataView,z=l.NATIVE_ARRAY_BUFFER_VIEWS,j=l.TYPED_ARRAY_TAG,q=l.TypedArray,K=l.TypedArrayPrototype,X=l.aTypedArrayConstructor,Y=l.isTypedArray,Z="BYTES_PER_ELEMENT",Q="Wrong length",fromList=function(e,t){X(e);for(var i=0,n=t.length,r=new e(n);n>i;)r[i]=t[i++];return r},addGetter=function(e,t){B(e,t,{get:function(){return k(this)[t]}})},isArrayBuffer=function(e){var t;return S(H,e)||"ArrayBuffer"==(t=_(e))||"SharedArrayBuffer"==t},isTypedArrayIndex=function(e,t){return Y(e)&&!b(t)&&t in e&&p(+t)&&t>=0},J=function getOwnPropertyDescriptor(e,t){t=v(t);return isTypedArrayIndex(e,t)?d(2,e[t]):N(e,t)},$=function defineProperty(e,t,i){t=v(t);if(isTypedArrayIndex(e,t)&&y(i)&&w(i,"value")&&!w(i,"get")&&!w(i,"set")&&!i.configurable&&(!w(i,"writable")||i.writable)&&(!w(i,"enumerable")||i.enumerable)){e[t]=i.value;return e}return B(e,t,i)};if(o){if(!z){L.f=J;M.f=$;addGetter(K,"buffer");addGetter(K,"byteOffset");addGetter(K,"byteLength");addGetter(K,"length")}n({target:"Object",stat:!0,forced:!z},{getOwnPropertyDescriptor:J,defineProperty:$});e.exports=function(e,t,i){var o=e.match(/\d+$/)[0]/8,l=e+(i?"Clamped":"")+"Array",c="get"+e,d="set"+e,p=r[l],v=p,w=v&&v.prototype,_={},addElement=function(e,t){B(e,t,{get:function(){return function(e,t){var i=k(e);return i.view[c](t*o+i.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var r=k(e);i&&(n=(n=V(n))<0?0:n>255?255:255&n);r.view[d](t*o+r.byteOffset,n,!0)}(this,t,e)},enumerable:!0})};if(z){if(a){v=t((function(e,t,i,n){h(e,w);return D(y(t)?isArrayBuffer(t)?void 0!==n?new p(t,m(i,o),n):void 0!==i?new p(t,m(i,o)):new p(t):Y(t)?fromList(v,t):s(C,v,t):new p(f(t)),e,v)}));E&&E(v,q);T(x(p),(function(e){e in v||u(v,e,p[e])}));v.prototype=w}}else{v=t((function(e,t,i,n){h(e,w);var r,a,l,c=0,d=0;if(y(t)){if(!isArrayBuffer(t))return Y(t)?fromList(v,t):s(C,v,t);r=t;d=m(i,o);var u=t.byteLength;if(void 0===n){if(u%o)throw U(Q);if((a=u-d)<0)throw U(Q)}else if((a=g(n)*o)+d>u)throw U(Q);l=a/o}else{l=f(t);r=new W(a=l*o)}O(e,{buffer:r,byteOffset:d,byteLength:a,length:l,view:new G(r)});for(;c<l;)addElement(e,c++)}));E&&E(v,q);w=v.prototype=P(K)}w.constructor!==v&&u(w,"constructor",v);R(w).TypedArrayConstructor=v;j&&u(w,j,l);var b=v!=p;_[l]=v;n({global:!0,constructor:!0,forced:b,sham:!z},_);Z in v||u(v,Z,o);Z in w||u(w,Z,o);I(l)}}else e.exports=function(){}},(e,t,i)=>{var n=i(2),r=i(13),s=i(125),o=i(200).NATIVE_ARRAY_BUFFER_VIEWS,a=n.ArrayBuffer,l=n.Int8Array;e.exports=!o||!r((function(){l(1)}))||!r((function(){new l(-1)}))||!s((function(e){new l;new l(null);new l(1.5);new l(e)}),!0)||r((function(){return 1!==new l(new a(2),1,void 0).length}))},(e,t,i)=>{"use strict";var n,r,s,o=i(201),a=i(33),l=i(2),c=i(7),h=i(6),d=i(22),u=i(87),p=i(44),g=i(62),f=i(68),m=i(35).f,v=i(41),w=i(78),_=i(81),y=i(17),b=i(24),P=i(59),S=P.enforce,E=P.get,x=l.Int8Array,C=x&&x.prototype,T=l.Uint8ClampedArray,I=T&&T.prototype,M=x&&w(x),L=C&&w(C),A=Object.prototype,D=l.TypeError,k=y("toStringTag"),O=b("TYPED_ARRAY_TAG"),R="TypedArrayConstructor",B=o&&!!_&&"Opera"!==u(l.opera),N=!1,V={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(e){var t=w(e);if(h(t)){var i=E(t);return i&&d(i,R)?i.TypedArrayConstructor:getTypedArrayConstructor(t)}},isTypedArray=function(e){if(!h(e))return!1;var t=u(e);return d(V,t)||d(U,t)};for(n in V)(s=(r=l[n])&&r.prototype)?S(s).TypedArrayConstructor=r:B=!1;for(n in U)(s=(r=l[n])&&r.prototype)&&(S(s).TypedArrayConstructor=r);if(!B||!c(M)||M===Function.prototype){M=function TypedArray(){throw D("Incorrect invocation")};if(B)for(n in V)l[n]&&_(l[n],M)}if(!B||!L||L===A){L=M.prototype;if(B)for(n in V)l[n]&&_(l[n].prototype,L)}B&&w(I)!==L&&_(I,L);if(a&&!d(L,k)){N=!0;m(L,k,{get:function(){return h(this)?this[O]:void 0}});for(n in V)l[n]&&g(l[n],O,n)}e.exports={NATIVE_ARRAY_BUFFER_VIEWS:B,TYPED_ARRAY_TAG:N&&O,aTypedArray:function(e){if(isTypedArray(e))return e;throw D("Target is not a typed array")},aTypedArrayConstructor:function(e){if(c(e)&&(!_||v(M,e)))return e;throw D(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,i,n){if(a){if(i)for(var r in V){var s=l[r];if(s&&d(s.prototype,e))try{delete s.prototype[e]}catch(i){try{s.prototype[e]=t}catch(e){}}}L[e]&&!i||f(L,e,i?t:B&&C[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,i){var n,r;if(a){if(_){if(i)for(n in V)if((r=l[n])&&d(r,e))try{delete r[e]}catch(e){}if(M[e]&&!i)return;try{return f(M,e,i?t:B&&M[e]||t)}catch(e){}}for(n in V)!(r=l[n])||r[e]&&!i||f(r,e,t)}},getTypedArrayConstructor:getTypedArrayConstructor,isView:function isView(e){if(!h(e))return!1;var t=u(e);return"DataView"===t||d(V,t)||d(U,t)},isTypedArray:isTypedArray,TypedArray:M,TypedArrayPrototype:L}},e=>{e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(e,t,i)=>{"use strict";var n=i(2),r=i(11),s=i(33),o=i(201),a=i(70),l=i(62),c=i(150),h=i(13),d=i(98),u=i(50),p=i(53),g=i(203),f=i(204),m=i(78),v=i(81),w=i(73).f,_=i(35).f,y=i(205),b=i(147),P=i(80),S=i(59),E=a.PROPER,x=a.CONFIGURABLE,C=S.get,T=S.set,I="ArrayBuffer",M="DataView",L="Wrong index",A=n.ArrayBuffer,D=A,k=D&&D.prototype,O=n.DataView,R=O&&O.prototype,B=Object.prototype,N=n.Array,V=n.RangeError,U=r(y),W=r([].reverse),H=f.pack,G=f.unpack,packInt8=function(e){return[255&e]},packInt16=function(e){return[255&e,e>>8&255]},packInt32=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},unpackInt32=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},packFloat32=function(e){return H(e,23,4)},packFloat64=function(e){return H(e,52,8)},addGetter=function(e,t){_(e.prototype,t,{get:function(){return C(this)[t]}})},get=function(e,t,i,n){var r=g(i),s=C(e);if(r+t>s.byteLength)throw V(L);var o=C(s.buffer).bytes,a=r+s.byteOffset,l=b(o,a,a+t);return n?l:W(l)},set=function(e,t,i,n,r,s){var o=g(i),a=C(e);if(o+t>a.byteLength)throw V(L);for(var l=C(a.buffer).bytes,c=o+a.byteOffset,h=n(+r),d=0;d<t;d++)l[c+d]=h[s?d:t-d-1]};if(o){var z=E&&A.name!==I;if(h((function(){A(1)}))&&h((function(){new A(-1)}))&&!h((function(){new A;new A(1.5);new A(NaN);return z&&!x})))z&&x&&l(A,"name",I);else{(D=function ArrayBuffer(e){d(this,k);return new A(g(e))}).prototype=k;for(var j,q=w(A),K=0;q.length>K;)(j=q[K++])in D||l(D,j,A[j]);k.constructor=D}v&&m(R)!==B&&v(R,B);var X=new O(new D(2)),Y=r(R.setInt8);X.setInt8(0,2147483648);X.setInt8(1,2147483649);!X.getInt8(0)&&X.getInt8(1)||c(R,{setInt8:function setInt8(e,t){Y(this,e,t<<24>>24)},setUint8:function setUint8(e,t){Y(this,e,t<<24>>24)}},{unsafe:!0})}else{k=(D=function ArrayBuffer(e){d(this,k);var t=g(e);T(this,{bytes:U(N(t),0),byteLength:t});s||(this.byteLength=t)}).prototype;R=(O=function DataView(e,t,i){d(this,R);d(e,k);var n=C(e).byteLength,r=u(t);if(r<0||r>n)throw V("Wrong offset");if(r+(i=void 0===i?n-r:p(i))>n)throw V("Wrong length");T(this,{buffer:e,byteLength:i,byteOffset:r});if(!s){this.buffer=e;this.byteLength=i;this.byteOffset=r}}).prototype;if(s){addGetter(D,"byteLength");addGetter(O,"buffer");addGetter(O,"byteLength");addGetter(O,"byteOffset")}c(R,{getInt8:function getInt8(e){return get(this,1,e)[0]<<24>>24},getUint8:function getUint8(e){return get(this,1,e)[0]},getInt16:function getInt16(e){var t=get(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function getUint16(e){var t=get(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function getInt32(e){return unpackInt32(get(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function getUint32(e){return unpackInt32(get(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function getFloat32(e){return G(get(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function getFloat64(e){return G(get(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function setInt8(e,t){set(this,1,e,packInt8,t)},setUint8:function setUint8(e,t){set(this,1,e,packInt8,t)},setInt16:function setInt16(e,t){set(this,2,e,packInt16,t,arguments.length>2?arguments[2]:void 0)},setUint16:function setUint16(e,t){set(this,2,e,packInt16,t,arguments.length>2?arguments[2]:void 0)},setInt32:function setInt32(e,t){set(this,4,e,packInt32,t,arguments.length>2?arguments[2]:void 0)},setUint32:function setUint32(e,t){set(this,4,e,packInt32,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function setFloat32(e,t){set(this,4,e,packFloat32,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function setFloat64(e,t){set(this,8,e,packFloat64,t,arguments.length>2?arguments[2]:void 0)}})}P(D,I);P(O,M);e.exports={ArrayBuffer:D,DataView:O}},(e,t,i)=>{var n=i(50),r=i(53),s=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=n(e),i=r(t);if(t!==i)throw s("Wrong length or index");return i}},e=>{var t=Array,i=Math.abs,n=Math.pow,r=Math.floor,s=Math.log,o=Math.LN2;e.exports={pack:function(e,a,l){var c,h,d,u=t(l),p=8*l-a-1,g=(1<<p)-1,f=g>>1,m=23===a?n(2,-24)-n(2,-77):0,v=e<0||0===e&&1/e<0?1:0,w=0;if((e=i(e))!=e||e===1/0){h=e!=e?1:0;c=g}else{c=r(s(e)/o);if(e*(d=n(2,-c))<1){c--;d*=2}if((e+=c+f>=1?m/d:m*n(2,1-f))*d>=2){c++;d/=2}if(c+f>=g){h=0;c=g}else if(c+f>=1){h=(e*d-1)*n(2,a);c+=f}else{h=e*n(2,f-1)*n(2,a);c=0}}for(;a>=8;){u[w++]=255&h;h/=256;a-=8}c=c<<a|h;p+=a;for(;p>0;){u[w++]=255&c;c/=256;p-=8}u[--w]|=128*v;return u},unpack:function(e,t){var i,r=e.length,s=8*r-t-1,o=(1<<s)-1,a=o>>1,l=s-7,c=r-1,h=e[c--],d=127&h;h>>=7;for(;l>0;){d=256*d+e[c--];l-=8}i=d&(1<<-l)-1;d>>=-l;l+=t;for(;l>0;){i=256*i+e[c--];l-=8}if(0===d)d=1-a;else{if(d===o)return i?NaN:h?-1/0:1/0;i+=n(2,t);d-=a}return(h?-1:1)*i*n(2,d-t)}}},(e,t,i)=>{"use strict";var n=i(23),r=i(49),s=i(52);e.exports=function fill(e){for(var t=n(this),i=s(t),o=arguments.length,a=r(o>1?arguments[1]:void 0,i),l=o>2?arguments[2]:void 0,c=void 0===l?i:r(l,i);c>a;)t[a++]=e;return t}},(e,t,i)=>{var n=i(6),r=Math.floor;e.exports=Number.isInteger||function isInteger(e){return!n(e)&&isFinite(e)&&r(e)===e}},(e,t,i)=>{var n=i(208),r=RangeError;e.exports=function(e,t){var i=n(e);if(i%t)throw r("Wrong offset");return i}},(e,t,i)=>{var n=i(50),r=RangeError;e.exports=function(e){var t=n(e);if(t<0)throw r("The argument can't be less than 0");return t}},(e,t,i)=>{var n=i(104),r=i(39),s=i(100),o=i(23),a=i(52),l=i(121),c=i(122),h=i(120),d=i(200).aTypedArrayConstructor;e.exports=function from(e){var t,i,u,p,g,f,m=s(this),v=o(e),w=arguments.length,_=w>1?arguments[1]:void 0,y=void 0!==_,b=c(v);if(b&&!h(b)){f=(g=l(v,b)).next;v=[];for(;!(p=r(f,g)).done;)v.push(p.value)}y&&w>2&&(_=n(_,arguments[2]));i=a(v);u=new(d(m))(i);for(t=0;i>t;t++)u[t]=y?_(v[t],t):v[t];return u}},(e,t,i)=>{var n=i(104),r=i(11),s=i(10),o=i(23),a=i(52),l=i(211),c=r([].push),createMethod=function(e){var t=1==e,i=2==e,r=3==e,h=4==e,d=6==e,u=7==e,p=5==e||d;return function(g,f,m,v){for(var w,_,y=o(g),b=s(y),P=n(f,m),S=a(b),E=0,x=v||l,C=t?x(g,S):i||u?x(g,0):void 0;S>E;E++)if(p||E in b){_=P(w=b[E],E,y);if(e)if(t)C[E]=_;else if(_)switch(e){case 3:return!0;case 5:return w;case 6:return E;case 2:c(C,w)}else switch(e){case 4:return!1;case 7:c(C,w)}}return d?-1:r||h?h:C}};e.exports={forEach:createMethod(0),map:createMethod(1),filter:createMethod(2),some:createMethod(3),every:createMethod(4),find:createMethod(5),findIndex:createMethod(6),filterReject:createMethod(7)}},(e,t,i)=>{var n=i(212);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},(e,t,i)=>{var n=i(213),r=i(101),s=i(6),o=i(17)("species"),a=Array;e.exports=function(e){var t;if(n(e)){t=e.constructor;(r(t)&&(t===a||n(t.prototype))||s(t)&&null===(t=t[o]))&&(t=void 0)}return void 0===t?a:t}},(e,t,i)=>{var n=i(14);e.exports=Array.isArray||function isArray(e){return"Array"==n(e)}},(e,t,i)=>{"use strict";var n=i(200),r=i(205),s=i(215),o=i(87),a=i(39),l=i(11),c=i(13),h=n.aTypedArray,d=n.exportTypedArrayMethod,u=l("".slice);d("fill",(function fill(e){var t=arguments.length;h(this);var i="Big"===u(o(this),0,3)?s(e):+e;return a(r,this,i,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),c((function(){var e=0;new Int8Array(2).fill({valueOf:function(){return e++}});return 1!==e})))},(e,t,i)=>{var n=i(38),r=TypeError;e.exports=function(e){var t=n(e,"number");if("number"==typeof t)throw r("Can't convert number to bigint");return BigInt(t)}},(e,t,i)=>{"use strict";var n=i(2),r=i(39),s=i(200),o=i(52),a=i(207),l=i(23),c=i(13),h=n.RangeError,d=n.Int8Array,u=d&&d.prototype,p=u&&u.set,g=s.aTypedArray,f=s.exportTypedArrayMethod,m=!c((function(){var e=new Uint8ClampedArray(2);r(p,e,{length:1,0:3},1);return 3!==e[1]})),v=m&&s.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var e=new d(2);e.set(1);e.set("2",1);return 0!==e[0]||2!==e[1]}));f("set",(function set(e){g(this);var t=a(arguments.length>1?arguments[1]:void 0,1),i=l(e);if(m)return r(p,this,i,t);var n=this.length,s=o(i),c=0;if(s+t>n)throw h("Wrong length");for(;c<s;)this[t+c]=i[c++]}),!m||v)},(e,t,i)=>{"use strict";var n=i(2),r=i(11),s=i(13),o=i(43),a=i(151),l=i(200),c=i(218),h=i(219),d=i(26),u=i(220),p=l.aTypedArray,g=l.exportTypedArrayMethod,f=n.Uint16Array,m=f&&r(f.prototype.sort),v=!(!m||s((function(){m(new f(2),null)}))&&s((function(){m(new f(2),{})}))),w=!!m&&!s((function(){if(d)return d<74;if(c)return c<67;if(h)return!0;if(u)return u<602;var e,t,i=new f(516),n=Array(516);for(e=0;e<516;e++){t=e%4;i[e]=515-e;n[e]=e-2*t+3}m(i,(function(e,t){return(e/4|0)-(t/4|0)}));for(e=0;e<516;e++)if(i[e]!==n[e])return!0}));g("sort",(function sort(e){void 0!==e&&o(e);return w?m(this,e):a(p(this),function(e){return function(t,i){return void 0!==e?+e(t,i)||0:i!=i?-1:t!=t?1:0===t&&0===i?1/t>0&&1/i<0?1:-1:t>i}}(e))}),!w||v)},(e,t,i)=>{var n=i(27).match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},(e,t,i)=>{var n=i(27);e.exports=/MSIE|Trident/.test(n)},(e,t,i)=>{var n=i(27).match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},(e,t,i)=>{i(198)("Uint32",(function(e){return function Uint32Array(t,i,n){return e(this,t,i,n)}}))},(e,t,i)=>{"use strict";i(197);i(214);i(216);i(217);if(!globalThis._pdfjsCompatibilityChecked){globalThis._pdfjsCompatibilityChecked=!0;!function checkNodeBtoa(){globalThis.btoa}();!function checkNodeAtob(){globalThis.atob}();!function checkDOMMatrix(){globalThis.DOMMatrix}();!function checkReadableStream(){globalThis.ReadableStream}();!function checkArrayAt(){Array.prototype.at||i(223)}();!function checkTypedArrayAt(){Uint8Array.prototype.at||i(226)}();!function checkStructuredClone(){globalThis.structuredClone||i(228)}()}},(e,t,i)=>{i(224);var n=i(225);e.exports=n("Array","at")},(e,t,i)=>{"use strict";var n=i(65),r=i(23),s=i(52),o=i(50),a=i(16);n({target:"Array",proto:!0},{at:function at(e){var t=r(this),i=s(t),n=o(e),a=n>=0?n:i+n;return a<0||a>=i?void 0:t[a]}});a("at")},(e,t,i)=>{var n=i(2),r=i(11);e.exports=function(e,t){return r(n[e].prototype[t])}},(e,t,i)=>{i(227)},(e,t,i)=>{"use strict";var n=i(200),r=i(52),s=i(50),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("at",(function at(e){var t=o(this),i=r(t),n=s(e),a=n>=0?n:i+n;return a<0||a>=i?void 0:t[a]}))},(e,t,i)=>{i(8);i(229);i(231);i(240);i(242);var n=i(245);e.exports=n.structuredClone},(e,t,i)=>{var n=i(88),r=i(68),s=i(230);n||r(Object.prototype,"toString",s,{unsafe:!0})},(e,t,i)=>{"use strict";var n=i(88),r=i(87);e.exports=n?{}.toString:function toString(){return"[object "+r(this)+"]"}},(e,t,i)=>{i(232)},(e,t,i)=>{"use strict";i(233)("Map",(function(e){return function Map(){return e(this,arguments.length?arguments[0]:void 0)}}),i(239))},(e,t,i)=>{"use strict";var n=i(65),r=i(2),s=i(11),o=i(75),a=i(68),l=i(234),c=i(119),h=i(98),d=i(7),u=i(6),p=i(13),g=i(125),f=i(80),m=i(170);e.exports=function(e,t,i){var v=-1!==e.indexOf("Map"),w=-1!==e.indexOf("Weak"),_=v?"set":"add",y=r[e],b=y&&y.prototype,P=y,S={},fixMethod=function(e){var t=s(b[e]);a(b,e,"add"==e?function add(e){t(this,0===e?0:e);return this}:"delete"==e?function(e){return!(w&&!u(e))&&t(this,0===e?0:e)}:"get"==e?function get(e){return w&&!u(e)?void 0:t(this,0===e?0:e)}:"has"==e?function has(e){return!(w&&!u(e))&&t(this,0===e?0:e)}:function set(e,i){t(this,0===e?0:e,i);return this})};if(o(e,!d(y)||!(w||b.forEach&&!p((function(){(new y).entries().next()}))))){P=i.getConstructor(t,e,v,_);l.enable()}else if(o(e,!0)){var E=new P,x=E[_](w?{}:-0,1)!=E,C=p((function(){E.has(1)})),T=g((function(e){new y(e)})),I=!w&&p((function(){for(var e=new y,t=5;t--;)e[_](t,t);return!e.has(-0)}));if(!T){(P=t((function(e,t){h(e,b);var i=m(new y,e,P);null!=t&&c(t,i[_],{that:i,AS_ENTRIES:v});return i}))).prototype=b;b.constructor=P}if(C||I){fixMethod("delete");fixMethod("has");v&&fixMethod("get")}(I||x)&&fixMethod(_);w&&b.clear&&delete b.clear}S[e]=P;n({global:!0,constructor:!0,forced:P!=y},S);f(P,e);w||i.setStrong(P,e,v);return P}},(e,t,i)=>{var n=i(65),r=i(11),s=i(54),o=i(6),a=i(22),l=i(35).f,c=i(73),h=i(235),d=i(236),u=i(24),p=i(238),g=!1,f=u("meta"),m=0,setMetadata=function(e){l(e,f,{value:{objectID:"O"+m++,weakData:{}}})},v=e.exports={enable:function(){v.enable=function(){};g=!0;var e=c.f,t=r([].splice),i={};i[f]=1;if(e(i).length){c.f=function(i){for(var n=e(i),r=0,s=n.length;r<s;r++)if(n[r]===f){t(n,r,1);break}return n};n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:h.f})}},fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,f)){if(!d(e))return"F";if(!t)return"E";setMetadata(e)}return e[f].objectID},getWeakData:function(e,t){if(!a(e,f)){if(!d(e))return!0;if(!t)return!1;setMetadata(e)}return e[f].weakData},onFreeze:function(e){p&&g&&d(e)&&!a(e,f)&&setMetadata(e);return e}};s[f]=!0},(e,t,i)=>{var n=i(14),r=i(9),s=i(73).f,o=i(147),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function getOwnPropertyNames(e){return a&&"Window"==n(e)?function(e){try{return s(e)}catch(e){return o(a)}}(e):s(r(e))}},(e,t,i)=>{var n=i(13),r=i(6),s=i(14),o=i(237),a=Object.isExtensible,l=n((function(){a(1)}));e.exports=l||o?function isExtensible(e){return!!r(e)&&((!o||"ArrayBuffer"!=s(e))&&(!a||a(e)))}:a},(e,t,i)=>{var n=i(13);e.exports=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},(e,t,i)=>{var n=i(13);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},(e,t,i)=>{"use strict";var n=i(35).f,r=i(30),s=i(150),o=i(104),a=i(98),l=i(119),c=i(64),h=i(97),d=i(33),u=i(234).fastKey,p=i(59),g=p.set,f=p.getterFor;e.exports={getConstructor:function(e,t,i,c){var h=e((function(e,n){a(e,p);g(e,{type:t,index:r(null),first:void 0,last:void 0,size:0});d||(e.size=0);null!=n&&l(n,e[c],{that:e,AS_ENTRIES:i})})),p=h.prototype,m=f(t),define=function(e,t,i){var n,r,s=m(e),o=getEntry(e,t);if(o)o.value=i;else{s.last=o={index:r=u(t,!0),key:t,value:i,previous:n=s.last,next:void 0,removed:!1};s.first||(s.first=o);n&&(n.next=o);d?s.size++:e.size++;"F"!==r&&(s.index[r]=o)}return e},getEntry=function(e,t){var i,n=m(e),r=u(t);if("F"!==r)return n.index[r];for(i=n.first;i;i=i.next)if(i.key==t)return i};s(p,{clear:function clear(){for(var e=m(this),t=e.index,i=e.first;i;){i.removed=!0;i.previous&&(i.previous=i.previous.next=void 0);delete t[i.index];i=i.next}e.first=e.last=void 0;d?e.size=0:this.size=0},delete:function(e){var t=this,i=m(t),n=getEntry(t,e);if(n){var r=n.next,s=n.previous;delete i.index[n.index];n.removed=!0;s&&(s.next=r);r&&(r.previous=s);i.first==n&&(i.first=r);i.last==n&&(i.last=s);d?i.size--:t.size--}return!!n},forEach:function forEach(e){for(var t,i=m(this),n=o(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:i.first;){n(t.value,t.key,this);for(;t&&t.removed;)t=t.previous}},has:function has(e){return!!getEntry(this,e)}});s(p,i?{get:function get(e){var t=getEntry(this,e);return t&&t.value},set:function set(e,t){return define(this,0===e?0:e,t)}}:{add:function add(e){return define(this,e=0===e?0:e,e)}});d&&n(p,"size",{get:function(){return m(this).size}});return h},setStrong:function(e,t,i){var n=t+" Iterator",r=f(t),s=f(n);c(e,t,(function(e,t){g(this,{type:n,target:e,state:r(e),kind:t,last:void 0})}),(function(){for(var e=s(this),t=e.kind,i=e.last;i&&i.removed;)i=i.previous;if(!e.target||!(e.last=i=i?i.next:e.state.first)){e.target=void 0;return{value:void 0,done:!0}}return"keys"==t?{value:i.key,done:!1}:"values"==t?{value:i.value,done:!1}:{value:[i.key,i.value],done:!1}}),i?"entries":"values",!i,!0);h(t)}}},(e,t,i)=>{i(241)},(e,t,i)=>{"use strict";i(233)("Set",(function(e){return function Set(){return e(this,arguments.length?arguments[0]:void 0)}}),i(239))},(e,t,i)=>{var n,r=i(19),s=i(65),o=i(2),a=i(28),l=i(11),c=i(13),h=i(24),d=i(7),u=i(101),p=i(6),g=i(40),f=i(119),m=i(31),v=i(87),w=i(22),_=i(146),y=i(62),b=i(52),P=i(106),S=i(172),E=i(243),x=i(26),C=i(116),T=i(244),I=i(96),M=o.Object,L=o.Date,A=o.Error,D=o.EvalError,k=o.RangeError,O=o.ReferenceError,R=o.SyntaxError,B=o.TypeError,N=o.URIError,V=o.PerformanceMark,U=o.WebAssembly,W=U&&U.CompileError||A,H=U&&U.LinkError||A,G=U&&U.RuntimeError||A,z=a("DOMException"),j=a("Set"),q=a("Map"),K=q.prototype,X=l(K.has),Y=l(K.get),Z=l(K.set),Q=l(j.prototype.add),J=a("Object","keys"),$=l([].push),ee=l((!0).valueOf),te=l(1..valueOf),ie=l("".valueOf),ne=l(L.prototype.getTime),re=h("structuredClone"),se="DataCloneError",oe="Transferring",checkBasicSemantic=function(e){return!c((function(){var t=new o.Set([7]),i=e(t),n=e(M(7));return i==t||!i.has(7)||"object"!=typeof n||7!=n}))&&e},checkErrorsCloning=function(e,t){return!c((function(){var i=new t,n=e({a:i,b:i});return!(n&&n.a===n.b&&n.a instanceof t&&n.a.stack===i.stack)}))},ae=o.structuredClone,le=r||!checkErrorsCloning(ae,A)||!checkErrorsCloning(ae,z)||!(n=ae,!c((function(){var e=n(new o.AggregateError([1],re,{cause:3}));return"AggregateError"!=e.name||1!=e.errors[0]||e.message!=re||3!=e.cause}))),ce=!ae&&checkBasicSemantic((function(e){return new V(re,{detail:e}).detail})),he=checkBasicSemantic(ae)||ce,throwUncloneable=function(e){throw new z("Uncloneable type: "+e,se)},throwUnpolyfillable=function(e,t){throw new z((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",se)},structuredCloneInternal=function(e,t){g(e)&&throwUncloneable("Symbol");if(!p(e))return e;if(t){if(X(t,e))return Y(t,e)}else t=new q;var i,n,r,s,l,c,h,f,m,P,x=v(e),C=!1;switch(x){case"Array":r=[];C=!0;break;case"Object":r={};C=!0;break;case"Map":r=new q;C=!0;break;case"Set":r=new j;C=!0;break;case"RegExp":r=new RegExp(e.source,S(e));break;case"Error":switch(n=e.name){case"AggregateError":r=a("AggregateError")([]);break;case"EvalError":r=D();break;case"RangeError":r=k();break;case"ReferenceError":r=O();break;case"SyntaxError":r=R();break;case"TypeError":r=B();break;case"URIError":r=N();break;case"CompileError":r=W();break;case"LinkError":r=H();break;case"RuntimeError":r=G();break;default:r=A()}C=!0;break;case"DOMException":r=new z(e.message,e.name);C=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":i=o[x];p(i)||throwUnpolyfillable(x);r=new i(structuredCloneInternal(e.buffer,t),e.byteOffset,"DataView"===x?e.byteLength:e.length);break;case"DOMQuad":try{r=new DOMQuad(structuredCloneInternal(e.p1,t),structuredCloneInternal(e.p2,t),structuredCloneInternal(e.p3,t),structuredCloneInternal(e.p4,t))}catch(t){he?r=he(e):throwUnpolyfillable(x)}break;case"FileList":i=o.DataTransfer;if(u(i)){s=new i;for(l=0,c=b(e);l<c;l++)s.items.add(structuredCloneInternal(e[l],t));r=s.files}else he?r=he(e):throwUnpolyfillable(x);break;case"ImageData":try{r=new ImageData(structuredCloneInternal(e.data,t),e.width,e.height,{colorSpace:e.colorSpace})}catch(t){he?r=he(e):throwUnpolyfillable(x)}break;default:if(he)r=he(e);else switch(x){case"BigInt":r=M(e.valueOf());break;case"Boolean":r=M(ee(e));break;case"Number":r=M(te(e));break;case"String":r=M(ie(e));break;case"Date":r=new L(ne(e));break;case"ArrayBuffer":(i=o.DataView)||"function"==typeof e.slice||throwUnpolyfillable(x);try{if("function"==typeof e.slice)r=e.slice(0);else{c=e.byteLength;r=new ArrayBuffer(c);m=new i(e);P=new i(r);for(l=0;l<c;l++)P.setUint8(l,m.getUint8(l))}}catch(e){throw new z("ArrayBuffer is detached",se)}break;case"SharedArrayBuffer":r=e;break;case"Blob":try{r=e.slice(0,e.size,e.type)}catch(e){throwUnpolyfillable(x)}break;case"DOMPoint":case"DOMPointReadOnly":i=o[x];try{r=i.fromPoint?i.fromPoint(e):new i(e.x,e.y,e.z,e.w)}catch(e){throwUnpolyfillable(x)}break;case"DOMRect":case"DOMRectReadOnly":i=o[x];try{r=i.fromRect?i.fromRect(e):new i(e.x,e.y,e.width,e.height)}catch(e){throwUnpolyfillable(x)}break;case"DOMMatrix":case"DOMMatrixReadOnly":i=o[x];try{r=i.fromMatrix?i.fromMatrix(e):new i(e)}catch(e){throwUnpolyfillable(x)}break;case"AudioData":case"VideoFrame":d(e.clone)||throwUnpolyfillable(x);try{r=e.clone()}catch(e){throwUncloneable(x)}break;case"File":try{r=new File([e],e.name,e)}catch(e){throwUnpolyfillable(x)}break;case"CryptoKey":case"GPUCompilationMessage":case"GPUCompilationInfo":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":throwUnpolyfillable(x);default:throwUncloneable(x)}}Z(t,e,r);if(C)switch(x){case"Array":case"Object":h=J(e);for(l=0,c=b(h);l<c;l++){f=h[l];_(r,f,structuredCloneInternal(e[f],t))}break;case"Map":e.forEach((function(e,i){Z(r,structuredCloneInternal(i,t),structuredCloneInternal(e,t))}));break;case"Set":e.forEach((function(e){Q(r,structuredCloneInternal(e,t))}));break;case"Error":y(r,"message",structuredCloneInternal(e.message,t));w(e,"cause")&&y(r,"cause",structuredCloneInternal(e.cause,t));"AggregateError"==n&&(r.errors=structuredCloneInternal(e.errors,t));case"DOMException":E&&y(r,"stack",structuredCloneInternal(e.stack,t))}return r},de=ae&&!c((function(){if(T&&x>92||I&&x>94||C&&x>97)return!1;var e=new ArrayBuffer(8),t=ae(e,{transfer:[e]});return 0!=e.byteLength||8!=t.byteLength})),tryToTransfer=function(e,t){if(!p(e))throw B("Transfer option cannot be converted to a sequence");var i=[];f(e,(function(e){$(i,m(e))}));var n,r,s,a,l,c,h=0,g=b(i);if(de){a=ae(i,{transfer:i});for(;h<g;)Z(t,i[h],a[h++])}else for(;h<g;){n=i[h++];if(X(t,n))throw new z("Duplicate transferable",se);switch(r=v(n)){case"ImageBitmap":s=o.OffscreenCanvas;u(s)||throwUnpolyfillable(r,oe);try{(c=new s(n.width,n.height)).getContext("bitmaprenderer").transferFromImageBitmap(n);l=c.transferToImageBitmap()}catch(e){}break;case"AudioData":case"VideoFrame":d(n.clone)&&d(n.close)||throwUnpolyfillable(r,oe);try{l=n.clone();n.close()}catch(e){}break;case"ArrayBuffer":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":throwUnpolyfillable(r,oe)}if(void 0===l)throw new z("This object cannot be transferred: "+r,se);Z(t,n,l)}};s({global:!0,enumerable:!0,sham:!de,forced:le},{structuredClone:function structuredClone(e){var t,i=P(arguments.length,1)>1&&null!=arguments[1]?m(arguments[1]):void 0,n=i?i.transfer:void 0;if(void 0!==n){t=new q;tryToTransfer(n,t)}return structuredCloneInternal(e,t)}})},(e,t,i)=>{var n=i(13),r=i(63);e.exports=!n((function(){var e=Error("a");if(!("stack"in e))return!0;Object.defineProperty(e,"stack",r(1,7));return 7!==e.stack}))},e=>{e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(e,t,i)=>{var n=i(2);e.exports=n},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.StructTreeLayerBuilder=void 0;i(84);i(1);const n={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 StructTreeLayerBuilder{constructor(e){let{pdfPage:t}=e;this.pdfPage=t}render(e){return this._walk(e)}_setAttributes(e,t){void 0!==e.alt&&t.setAttribute("aria-label",e.alt);void 0!==e.id&&t.setAttribute("aria-owns",e.id);void 0!==e.lang&&t.setAttribute("lang",e.lang)}_walk(e){if(!e)return null;const t=document.createElement("span");if("role"in e){const{role:i}=e,s=i.match(r);if(s){t.setAttribute("role","heading");t.setAttribute("aria-level",s[1])}else n[i]&&t.setAttribute("role",n[i])}this._setAttributes(e,t);if(e.children)if(1===e.children.length&&"id"in e.children[0])this._setAttributes(e.children[0],t);else for(const i of e.children)t.append(this._walk(i));return t}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TextHighlighter=void 0;i(131);t.TextHighlighter=class TextHighlighter{constructor(e){let{findController:t,eventBus:i,pageIndex:n}=e;this.findController=t;this.matches=[];this.eventBus=i;this.pageIdx=n;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;if(!this._onUpdateTextLayerMatches){this._onUpdateTextLayerMatches=e=>{e.pageIndex!==this.pageIdx&&-1!==e.pageIndex||this._updateMatches()};this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches)}this._updateMatches()}disable(){if(this.enabled){this.enabled=!1;if(this._onUpdateTextLayerMatches){this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches);this._onUpdateTextLayerMatches=null}}}_convertMatches(e,t,i){if(!e)return[];const{textContentItemsStr:n}=this;let r=0,s=0;const o=n.length-1,a=[];for(let l=0,c=e.length;l<c;l++){let c=e[l];for(;r!==o&&c>=s+n[r].length;){s+=n[r].length;r++}r===n.length&&Window.ngxConsole.error("Could not find a matching mapping");const h={color:i?i[l]:0,begin:{divIdx:r,offset:c-s}};c+=t[l];for(;r!==o&&c>s+n[r].length;){s+=n[r].length;r++}h.end={divIdx:r,offset:c-s};a.push(h)}return a}_renderMatches(e){if(0===e.length)return;const{findController:t,pageIdx:i}=this,{textContentItemsStr:n,textDivs:r}=this,s=i===t.selected.pageIdx,o=t.selected.matchIdx;let a=null;const l={divIdx:-1,offset:void 0};function beginText(e,t){const i=e.divIdx;r[i].textContent="";return appendTextToDiv(i,0,e.offset,t)}function appendTextToDiv(e,t,i,s){let o=r[e];if(o.nodeType===Node.TEXT_NODE){const t=document.createElement("span");o.before(t);t.append(o);r[e]=t;o=t}const a=n[e].substring(t,i),l=document.createTextNode(a);if(s){const e=document.createElement("span");e.className="".concat(s," appended");e.append(l);o.append(e);return s.includes("selected")?e.offsetLeft:0}o.append(l);return 0}let c=o,h=c+1;if(t.state.highlightAll){c=0;h=e.length}else if(!s)return;for(let n=c;n<h;n++){const c=e[n],h=c.begin,d=c.end,u=s&&n===o,p=(u?" selected":"")+" color"+c.color;let g=0;if(a&&h.divIdx===a.divIdx)appendTextToDiv(a.divIdx,a.offset,h.offset);else{null!==a&&appendTextToDiv(a.divIdx,a.offset,l.offset);beginText(h)}if(h.divIdx===d.divIdx)g=appendTextToDiv(h.divIdx,h.offset,d.offset,"highlight"+p);else{g=appendTextToDiv(h.divIdx,h.offset,l.offset,"highlight begin"+p);for(let e=h.divIdx+1,t=d.divIdx;e<t;e++)r[e].className="highlight middle"+p;beginText(d,"highlight end"+p)}a=d;u&&t.scrollMatchIntoView({element:r[h.divIdx],selectedLeft:g,pageIndex:i,matchIndex:o})}a&&appendTextToDiv(a.divIdx,a.offset,l.offset)}_updateMatches(){if(!this.enabled)return;const{findController:e,matches:t,pageIdx:i}=this,{textContentItemsStr:n,textDivs:r}=this;let s=-1;for(let e=0,i=t.length;e<i;e++){const i=t[e];for(let e=Math.max(s,i.begin.divIdx),t=i.end.divIdx;e<=t;e++){const t=r[e];t.textContent=n[e];t.className=""}s=i.end.divIdx+1}if(null==e||!e.highlightMatches)return;const o=e.pageMatches[i]||null,a=e.pageMatchesLength[i]||null,l=e.pageMatchesColor[i]||null;this.matches=this._convertMatches(o,a,l);this._renderMatches(this.matches)}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TextLayerBuilder=void 0;var n=i(155);t.TextLayerBuilder=class TextLayerBuilder{constructor(e){let{textLayerDiv:t,eventBus:i,pageIndex:n,viewport:r,highlighter:s=null,enhanceTextSelection:o=!1}=e;this.textLayerDiv=t;this.eventBus=i;this.textContent=null;this.textContentItemsStr=[];this.textContentStream=null;this.renderingDone=!1;this.pageNumber=n+1;this.viewport=r;this.textDivs=[];this.textLayerRenderTask=null;this.highlighter=s;this.enhanceTextSelection=o;this._bindMouse()}_finishRendering(){this.renderingDone=!0;if(!this.enhanceTextSelection){const e=document.createElement("div");e.className="endOfContent";this.textLayerDiv.append(e)}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.pageNumber,numTextDivs:this.textDivs.length})}render(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!this.textContent&&!this.textContentStream||this.renderingDone)return;this.cancel();this.textDivs.length=0;null===(e=this.highlighter)||void 0===e||e.setTextMapping(this.textDivs,this.textContentItemsStr);const i=document.createDocumentFragment();this.textLayerRenderTask=(0,n.renderTextLayer)({textContent:this.textContent,textContentStream:this.textContentStream,container:i,viewport:this.viewport,textDivs:this.textDivs,textContentItemsStr:this.textContentItemsStr,timeout:t,enhanceTextSelection:this.enhanceTextSelection});this.textLayerRenderTask.promise.then((()=>{var e;this.textLayerDiv.append(i);this._finishRendering();null===(e=this.highlighter)||void 0===e||e.enable()}),(function(e){}))}cancel(){var e;if(this.textLayerRenderTask){this.textLayerRenderTask.cancel();this.textLayerRenderTask=null}null===(e=this.highlighter)||void 0===e||e.disable()}setTextContentStream(e){this.cancel();this.textContentStream=e}setTextContent(e){this.cancel();this.textContent=e}_bindMouse(){const e=this.textLayerDiv;let t=null;e.addEventListener("mousedown",(i=>{if(this.enhanceTextSelection&&this.textLayerRenderTask){this.textLayerRenderTask.expandTextDivs(!0);if(t){clearTimeout(t);t=null}return}const n=e.querySelector(".endOfContent");if(!n)return;let r=i.target!==e;r=r&&"none"!==window.getComputedStyle(n).getPropertyValue("-moz-user-select");if(r){const t=e.getBoundingClientRect(),r=Math.max(0,(i.pageY-t.top)/t.height);n.style.top=(100*r).toFixed(2)+"%"}n.classList.add("active")}));e.addEventListener("mouseup",(()=>{if(this.enhanceTextSelection&&this.textLayerRenderTask){t=setTimeout((()=>{this.textLayerRenderTask&&this.textLayerRenderTask.expandTextDivs(!1);t=null}),300);return}const i=e.querySelector(".endOfContent");if(i){i.style.top="";i.classList.remove("active")}}))}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.XfaLayerBuilder=void 0;i(94);var n=i(155);t.XfaLayerBuilder=class XfaLayerBuilder{constructor(e){let{pageDiv:t,pdfPage:i,annotationStorage:n=null,linkService:r,xfaHtml:s=null}=e;this.pageDiv=t;this.pdfPage=i;this.annotationStorage=n;this.linkService=r;this.xfaHtml=s;this.div=null;this._cancelled=!1}render(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"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},r=document.createElement("div");this.pageDiv.append(r);i.div=r;const s=n.XfaLayer.render(i);return Promise.resolve(s)}return this.pdfPage.getXfa().then((i=>{if(this._cancelled||!i)return{textDivs:[]};const r={viewport:e.clone({dontFlip:!0}),div:this.div,xfaHtml:i,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:t};if(this.div)return n.XfaLayer.update(r);this.div=document.createElement("div");this.pageDiv.append(this.div);r.div=this.div;return n.XfaLayer.render(r)})).catch((e=>{Window.ngxConsole.error(e)}))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SecondaryToolbar=void 0;i(1);var n=i(153),r=i(157),s=i(189);function _classPrivateMethodInitSpec(e,t){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.add(e)}function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}var o=new WeakSet,a=new WeakSet,l=new WeakSet,c=new WeakSet,h=new WeakSet;t.SecondaryToolbar=class SecondaryToolbar{constructor(e,t){_classPrivateMethodInitSpec(this,h);_classPrivateMethodInitSpec(this,c);_classPrivateMethodInitSpec(this,l);_classPrivateMethodInitSpec(this,a);_classPrivateMethodInitSpec(this,o);this.toolbar=e.toolbar;this.toggleButton=e.toggleButton;this.buttons=[{element:e.presentationModeButton,eventName:"presentationmode",close:!0},{element:e.printButton,eventName:"print",close:!0},{element:e.downloadButton,eventName:"download",close:!0},{element:e.viewBookmarkButton,eventName:null,close:!0},{element:e.firstPageButton,eventName:"firstpage",close:!0},{element:e.lastPageButton,eventName:"lastpage",close:!0},{element:e.pageRotateCwButton,eventName:"rotatecw",close:!1},{element:e.pageRotateCcwButton,eventName:"rotateccw",close:!1},{element:e.cursorSelectToolButton,eventName:"switchcursortool",eventDetails:{tool:r.CursorTool.SELECT},close:!0},{element:e.cursorHandToolButton,eventName:"switchcursortool",eventDetails:{tool:r.CursorTool.HAND},close:!0},{element:e.scrollPageButton,eventName:"switchscrollmode",eventDetails:{mode:n.ScrollMode.PAGE},close:!0},{element:e.scrollVerticalButton,eventName:"switchscrollmode",eventDetails:{mode:n.ScrollMode.VERTICAL},close:!0},{element:e.scrollHorizontalButton,eventName:"switchscrollmode",eventDetails:{mode:n.ScrollMode.HORIZONTAL},close:!0},{element:e.scrollWrappedButton,eventName:"switchscrollmode",eventDetails:{mode:n.ScrollMode.WRAPPED},close:!0},{element:e.spreadNoneButton,eventName:"switchspreadmode",eventDetails:{mode:n.SpreadMode.NONE},close:!0},{element:e.spreadOddButton,eventName:"switchspreadmode",eventDetails:{mode:n.SpreadMode.ODD},close:!0},{element:e.spreadEvenButton,eventName:"switchspreadmode",eventDetails:{mode:n.SpreadMode.EVEN},close:!0},{element:e.documentPropertiesButton,eventName:"documentproperties",close:!0}];this.buttons.push({element:e.openFileButton,eventName:"openfile",close:!0});this.items={firstPage:e.firstPageButton,lastPage:e.lastPageButton,pageRotateCw:e.pageRotateCwButton,pageRotateCcw:e.pageRotateCcwButton};this.eventBus=t;this.opened=!1;this.reset();_classPrivateMethodGet(this,a,_bindClickListeners2).call(this);_classPrivateMethodGet(this,l,_bindCursorToolsListener2).call(this,e);_classPrivateMethodGet(this,c,_bindScrollModeListener2).call(this,e);_classPrivateMethodGet(this,h,_bindSpreadModeListener2).call(this,e)}get isOpen(){return this.opened}setPageNumber(e){this.pageNumber=e;_classPrivateMethodGet(this,o,_updateUIState2).call(this)}setPagesCount(e){this.pagesCount=e;_classPrivateMethodGet(this,o,_updateUIState2).call(this)}reset(){this.pageNumber=0;this.pagesCount=0;_classPrivateMethodGet(this,o,_updateUIState2).call(this);this.eventBus.dispatch("secondarytoolbarreset",{source:this})}open(){if(!this.opened){this.opened=!0;this.toggleButton.classList.add("toggled");this.toggleButton.setAttribute("aria-expanded","true");this.toolbar.classList.remove("hidden")}}close(){if(this.opened){this.opened=!1;this.toolbar.classList.add("hidden");this.toggleButton.classList.remove("toggled");this.toggleButton.setAttribute("aria-expanded","false")}}toggle(){this.opened?this.close():this.open()}};function _updateUIState2(){this.items.firstPage.disabled=this.pageNumber<=1;document.getElementById("previousPage")&&(document.getElementById("previousPage").disabled=this.pageNumber<=1);this.items.lastPage.disabled=this.pageNumber>=this.pagesCount;document.getElementById("nextPage")&&(document.getElementById("nextPage").disabled=this.pageNumber>=this.pagesCount);this.items.pageRotateCw.disabled=0===this.pagesCount;this.items.pageRotateCcw.disabled=0===this.pagesCount;this.eventBus.dispatch("updateuistate",{source:this,widget:"SecondaryToolbar",pageNumber:this.pageNumber,pagesCount:this.pagesCount})}function _bindClickListeners2(){this.toggleButton.addEventListener("click",this.toggle.bind(this));for(const{element:e,eventName:t,close:i,eventDetails:n}of this.buttons)e.addEventListener("click",(e=>{if(null!==t){const e={source:this};for(const t in n)e[t]=n[t];this.eventBus.dispatch(t,e)}i&&this.close()}))}function _bindCursorToolsListener2(e){let{cursorSelectToolButton:t,cursorHandToolButton:i}=e;this.eventBus._on("cursortoolchanged",(function(e){let{tool:n}=e;const s=n===r.CursorTool.SELECT,o=n===r.CursorTool.HAND;t.classList.toggle("toggled",s);i.classList.toggle("toggled",o);t.setAttribute("aria-checked",s);i.setAttribute("aria-checked",o)}))}function _bindScrollModeListener2(e){let{scrollPageButton:t,scrollVerticalButton:i,scrollHorizontalButton:r,scrollWrappedButton:o,spreadNoneButton:a,spreadOddButton:l,spreadEvenButton:c}=e;const scrollModeChanged=e=>{let{mode:h}=e;const d=h===n.ScrollMode.PAGE,u=h===n.ScrollMode.VERTICAL,p=h===n.ScrollMode.HORIZONTAL,g=h===n.ScrollMode.WRAPPED;t.classList.toggle("toggled",d);i.classList.toggle("toggled",u);r.classList.toggle("toggled",p);o.classList.toggle("toggled",g);t.setAttribute("aria-checked",d);i.setAttribute("aria-checked",u);r.setAttribute("aria-checked",p);o.setAttribute("aria-checked",g);const f=this.pagesCount>s.PagesCountLimit.FORCE_SCROLL_MODE_PAGE;t.disabled=f;i.disabled=f;r.disabled=f;o.disabled=f;a.disabled=p;l.disabled=p;c.disabled=p};this.eventBus._on("scrollmodechanged",scrollModeChanged);this.eventBus._on("secondarytoolbarreset",(e=>{e.source===this&&scrollModeChanged({mode:n.ScrollMode.VERTICAL})}))}function _bindSpreadModeListener2(e){let{spreadNoneButton:t,spreadOddButton:i,spreadEvenButton:r}=e;function spreadModeChanged(e){let{mode:s}=e;const o=s===n.SpreadMode.NONE,a=s===n.SpreadMode.ODD,l=s===n.SpreadMode.EVEN;t.classList.toggle("toggled",o);i.classList.toggle("toggled",a);r.classList.toggle("toggled",l);t.setAttribute("aria-checked",o);i.setAttribute("aria-checked",a);r.setAttribute("aria-checked",l)}this.eventBus._on("spreadmodechanged",spreadModeChanged);this.eventBus._on("secondarytoolbarreset",(e=>{e.source===this&&spreadModeChanged({mode:n.SpreadMode.NONE})}))}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Toolbar=void 0;i(1);i(94);var n=i(153),r=i(155);function _classPrivateMethodInitSpec(e,t){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.add(e)}function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}var s=new WeakSet,o=new WeakSet;t.Toolbar=class Toolbar{constructor(e,t,i){_classPrivateMethodInitSpec(this,o);_classPrivateMethodInitSpec(this,s);this.toolbar=e.container;this.eventBus=t;this.l10n=i;this.buttons=[{element:e.previous,eventName:"previouspage"},{element:e.next,eventName:"nextpage"},{element:e.zoomIn,eventName:"zoomin"},{element:e.zoomOut,eventName:"zoomout"},{element:e.print,eventName:"print"},{element:e.presentationModeButton,eventName:"presentationmode"},{element:e.download,eventName:"download"},{element:e.viewBookmark,eventName:null},{element:e.editorNoneButton,eventName:"switchannotationeditormode",eventDetails:{mode:r.AnnotationEditorType.NONE}},{element:e.editorFreeTextButton,eventName:"switchannotationeditormode",eventDetails:{mode:r.AnnotationEditorType.FREETEXT}},{element:e.editorInkButton,eventName:"switchannotationeditormode",eventDetails:{mode:r.AnnotationEditorType.INK}}];this.buttons.push({element:e.openFile,eventName:"openfile"});this.items={numPages:e.numPages,pageNumber:e.pageNumber,scaleSelect:e.scaleSelect,customScaleOption:e.customScaleOption,previous:e.previous,next:e.next,zoomIn:e.zoomIn,zoomOut:e.zoomOut,editorNoneButton:e.editorNoneButton,editorFreeTextButton:e.editorFreeTextButton,editorFreeTextParamsToolbar:e.editorFreeTextParamsToolbar,editorInkButton:e.editorInkButton,editorInkParamsToolbar:e.editorInkParamsToolbar};this._wasLocalized=!1;this.reset();this._bindListeners(e)}setPageNumber(e,t){this.pageNumber=e;this.pageLabel=t;this._updateUIState(!1)}setPagesCount(e,t){this.pagesCount=e;this.hasPageLabels=t;this._updateUIState(!0)}setPageScale(e,t){this.pageScaleValue=(e||t).toString();this.pageScale=t;this._updateUIState(!1)}reset(){this.pageNumber=0;this.pageLabel=null;this.hasPageLabels=!1;this.pagesCount=0;const e=PDFViewerApplicationOptions.get("defaultZoomValue");if(e){this.pageScaleValue=e;Number(e)&&(this.pageScale=Number(e))}else{this.pageScaleValue=n.DEFAULT_SCALE_VALUE;this.pageScale=n.DEFAULT_SCALE}this._updateUIState(!0);this.updateLoadingIndicatorState();this.eventBus.dispatch("toolbarreset",{source:this})}_bindListeners(e){const{pageNumber:t,scaleSelect:i}=this.items,r=this;for(const{element:e,eventName:t,eventDetails:i}of this.buttons)e.addEventListener("click",(e=>{if(null!==t){const e={source:this};if(i)for(const t in i)e[t]=i[t];this.eventBus.dispatch(t,e)}}));t.addEventListener("click",(function(){this.select()}));t.addEventListener("change",(function(){r.eventBus.dispatch("pagenumberchanged",{source:r,value:this.value})}));i.addEventListener("change",(function(){"custom"!==this.value&&r.eventBus.dispatch("scalechanged",{source:r,value:this.value})}));i.addEventListener("click",(function(e){const t=e.target;this.value===r.pageScaleValue&&"OPTION"===t.tagName.toUpperCase()&&this.blur()}));i.oncontextmenu=n.noContextMenuHandler;this.eventBus._on("localized",(()=>{this._wasLocalized=!0;_classPrivateMethodGet(this,o,_adjustScaleWidth2).call(this);this._updateUIState(!0)}));_classPrivateMethodGet(this,s,_bindEditorToolsListener2).call(this,e)}_updateUIState(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._wasLocalized)return;const{pageNumber:t,pagesCount:i,pageScaleValue:r,pageScale:s,items:o}=this;if(e){if(this.hasPageLabels)o.pageNumber.type="text";else{o.pageNumber.type="number";this.l10n.get("of_pages",{pagesCount:i}).then((e=>{o.numPages.textContent=e}))}o.pageNumber.max=i}if(this.hasPageLabels){o.pageNumber.value=this.pageLabel;this.l10n.get("page_of_pages",{pageNumber:t,pagesCount:i}).then((e=>{o.numPages.textContent=e}))}else o.pageNumber.value=t;o.previous.disabled=t<=1;o.next.disabled=t>=i;o.zoomOut.disabled=s<=n.MIN_SCALE;o.zoomIn.disabled=s>=n.MAX_SCALE;this.l10n.get("page_scale_percent",{scale:Math.round(1e4*s)/100}).then((e=>{let t=!1;if(o.scaleSelect.options)for(const e of o.scaleSelect.options)if(e.value===r){e.selected=!0;t=!0}else e.selected=!1;if(!t){o.customScaleOption.textContent=e;o.customScaleOption.selected=!0}}));this.eventBus.dispatch("updateuistate",{source:this,widget:"Toolbar",pageNumber:t,pagesCount:i,pageScaleValue:r,pageScale:s})}updateLoadingIndicatorState(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{pageNumber:t}=this.items;t.classList.toggle("visiblePageIsLoading",e)}};function _bindEditorToolsListener2(e){let{editorNoneButton:t,editorFreeTextButton:i,editorFreeTextParamsToolbar:n,editorInkButton:s,editorInkParamsToolbar:o}=e;const editorModeChanged=function(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const l=[{mode:r.AnnotationEditorType.NONE,button:t},{mode:r.AnnotationEditorType.FREETEXT,button:i,toolbar:n},{mode:r.AnnotationEditorType.INK,button:s,toolbar:o}];for(const{mode:t,button:i,toolbar:n}of l){const r=t===e.mode;i.classList.toggle("toggled",r);i.setAttribute("aria-checked",r);i.disabled=a;n&&n.classList.toggle("hidden",!r)}};this.eventBus._on("annotationeditormodechanged",editorModeChanged);this.eventBus._on("toolbarreset",(e=>{e.source===this&&editorModeChanged({mode:r.AnnotationEditorType.NONE},!0)}))}async function _adjustScaleWidth2(){const{items:e,l10n:t}=this,i=Promise.all([t.get("page_scale_auto"),t.get("page_scale_actual"),t.get("page_scale_fit"),t.get("page_scale_width")]);await n.animationStarted;const r=getComputedStyle(e.scaleSelect),s=parseInt(r.getPropertyValue("--scale-select-container-width"),10),o=parseInt(r.getPropertyValue("--scale-select-overflow"),10),a=document.createElement("canvas"),l=a.getContext("2d",{alpha:!1});l.font="".concat(r.fontSize," ").concat(r.fontFamily);let c=0;for(const e of await i)try{const{width:t}=l.measureText(e);t>c&&(c=t)}catch(e){}c+=2*o;c>s&&n.docStyle.setProperty("--scale-select-container-width","".concat(c,"px"));a.width=0;a.height=0}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ViewHistory=void 0;i(94);var n=i(83);t.ViewHistory=class ViewHistory{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;this.fingerprint=e;this.cacheSize=t;this._initializedPromise=this._readFromStorage().then((e=>{const t=JSON.parse(e||"{}");let i=-1;if(Array.isArray(t.files)){for(;t.files.length>=this.cacheSize;)t.files.shift();for(let e=0,n=t.files.length;e<n;e++){if(t.files[e].fingerprint===this.fingerprint){i=e;break}}}else t.files=[];-1===i&&(i=t.files.push({fingerprint:this.fingerprint})-1);this.file=t.files[i];this.database=t}))}async _writeToStorage(){if(n.AppOptions.get("disableHistory"))return;const e=JSON.stringify(this.database);try{localStorage.setItem("pdfjs.history",e)}catch(e){}}async _readFromStorage(){if(!n.AppOptions.get("disableHistory"))try{return localStorage.getItem("pdfjs.history")}catch(e){return}}async set(e,t){await this._initializedPromise;this.file[e]=t;return this._writeToStorage()}async setMultiple(e){await this._initializedPromise;for(const t in e)this.file[t]=e[t];return this._writeToStorage()}async get(e,t){await this._initializedPromise;const i=this.file[e];return void 0!==i?i:t}async getMultiple(e){await this._initializedPromise;const t=Object.create(null);for(const i in e){const n=this.file[i];t[i]=void 0!==n?n:e[i]}return t}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.GenericCom=void 0;i(94);var n=i(93),r=i(254),s=i(255),o=i(256),a=i(258);t.GenericCom={};class GenericPreferences extends r.BasePreferences{async _writeToStorage(e){try{localStorage.setItem("pdfjs.preferences",JSON.stringify(e))}catch(e){}}async _readFromStorage(e){try{return JSON.parse(localStorage.getItem("pdfjs.preferences"))}catch(e){return{}}}}class GenericExternalServices extends n.DefaultExternalServices{static createDownloadManager(e){return new s.DownloadManager}static createPreferences(){return new GenericPreferences}static createL10n(e){let{locale:t="en-US"}=e;return new o.GenericL10n(t)}static createScripting(e){let{sandboxBundleSrc:t}=e;return new a.GenericScripting(t)}}n.PDFViewerApplication.externalServices=GenericExternalServices},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.BasePreferences=void 0;i(94);i(1);i(83);function _classPrivateFieldInitSpec(e,t,i){!function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t);t.set(e,i)}function _classPrivateFieldGet(e,t){return function _classApplyDescriptorGet(e,t){if(t.get)return t.get.call(e);return t.value}(e,_classExtractFieldDescriptor(e,t,"get"))}function _classPrivateFieldSet(e,t,i){!function _classApplyDescriptorSet(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}(e,_classExtractFieldDescriptor(e,t,"set"),i);return i}function _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}var n=new WeakMap,r=new WeakMap,s=new WeakMap;class BasePreferences{constructor(){_classPrivateFieldInitSpec(this,n,{writable:!0,value:Object.freeze({annotationEditorMode:-1,annotationMode:2,cursorToolOnLoad:0,defaultZoomValue:"",disablePageLabels:!1,enablePermissions:!1,enablePrintAutoRotate:!0,enableScripting:!0,externalLinkTarget:0,historyUpdateUrl:!1,ignoreDestinationZoom:!1,forcePageColors:!1,pageColorsBackground:"Canvas",pageColorsForeground:"CanvasText",pdfBugEnabled:!1,removePageBorders:!1,sidebarViewOnLoad:-1,scrollModeOnLoad:-1,spreadModeOnLoad:-1,textLayerMode:1,useOnlyCssZoom:!1,viewerCssTheme:0,viewOnLoad:0,disableAutoFetch:!1,disableFontFace:!1,disableRange:!1,disableStream:!1,enableXfa:!0,renderer:"canvas"})});_classPrivateFieldInitSpec(this,r,{writable:!0,value:Object.create(null)});_classPrivateFieldInitSpec(this,s,{writable:!0,value:null});if(this.constructor===BasePreferences)throw new Error("Cannot initialize BasePreferences.");_classPrivateFieldSet(this,s,this._readFromStorage(_classPrivateFieldGet(this,n)).then((e=>{for(const t in _classPrivateFieldGet(this,n)){const i=null==e?void 0:e[t];typeof i==typeof _classPrivateFieldGet(this,n)[t]&&(_classPrivateFieldGet(this,r)[t]=i)}})))}async _writeToStorage(e){throw new Error("Not implemented: _writeToStorage")}async _readFromStorage(e){throw new Error("Not implemented: _readFromStorage")}async reset(){await _classPrivateFieldGet(this,s);const e=_classPrivateFieldGet(this,r);_classPrivateFieldSet(this,r,Object.create(null));return this._writeToStorage(_classPrivateFieldGet(this,n)).catch((t=>{_classPrivateFieldSet(this,r,e);throw t}))}async set(e,t){await _classPrivateFieldGet(this,s);const i=_classPrivateFieldGet(this,n)[e],o=_classPrivateFieldGet(this,r);if(void 0===i)throw new Error('Set preference: "'.concat(e,'" is undefined.'));if(void 0===t)throw new Error("Set preference: no value is specified.");const a=typeof t,l=typeof i;if(a!==l){if("number"!==a||"string"!==l)throw new Error('Set preference: "'.concat(t,'" is a ').concat(a,", expected a ").concat(l,"."));t=t.toString()}else if("number"===a&&!Number.isInteger(t))throw new Error('Set preference: "'.concat(t,'" must be an integer.'));_classPrivateFieldGet(this,r)[e]=t;return this._writeToStorage(_classPrivateFieldGet(this,r)).catch((e=>{_classPrivateFieldSet(this,r,o);throw e}))}async get(e){var t;await _classPrivateFieldGet(this,s);const i=_classPrivateFieldGet(this,n)[e];if(void 0===i)throw new Error('Get preference: "'.concat(e,'" is undefined.'));return null!==(t=_classPrivateFieldGet(this,r)[e])&&void 0!==t?t:i}async getAll(){await _classPrivateFieldGet(this,s);const e=Object.create(null);for(const i in _classPrivateFieldGet(this,n)){var t;e[i]=null!==(t=_classPrivateFieldGet(this,r)[i])&&void 0!==t?t:_classPrivateFieldGet(this,n)[i]}return e}}t.BasePreferences=BasePreferences},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DownloadManager=void 0;i(1);i(138);i(152);var n=i(155);function download(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 DownloadManager{constructor(){this._openBlobUrls=new WeakMap}downloadUrl(e,t){(0,n.createValidAbsoluteUrl)(e,"http://example.com")?download(e+"#pdfjs.action=download",t):Window.ngxConsole.error("downloadUrl - not a valid URL: ".concat(e))}downloadData(e,t,i){download(URL.createObjectURL(new Blob([e],{type:i})),t)}openOrDownloadData(e,t,i){const r=(0,n.isPdfFile)(i),s=r?"application/pdf":"";if(r){let n,r=this._openBlobUrls.get(e);if(!r){r=URL.createObjectURL(new Blob([t],{type:s}));this._openBlobUrls.set(e,r)}n="?file="+encodeURIComponent(r+"#"+i);try{window.open(n);return!0}catch(t){Window.ngxConsole.error("openOrDownloadData: ".concat(t));URL.revokeObjectURL(r);this._openBlobUrls.delete(e)}}this.downloadData(t,i,s);return!1}download(e,t,i){download(URL.createObjectURL(e),i)}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.GenericL10n=void 0;i(94);i(257);var n=i(191);const r=document.webL10n;t.GenericL10n=class GenericL10n{constructor(e){this._lang=e;this._ready=new Promise(((t,i)=>{r.setLanguage((0,n.fixupLangCode)(e),(()=>{t(r)}))}))}async getLanguage(){return(await this._ready).getLanguage()}async getDirection(){return(await this._ready).getDirection()}async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,n.getL10nFallback)(e,t);return(await this._ready).get(e,t,i)}async translate(e){return(await this._ready).translate(e)}}},(e,t,i)=>{"use strict";i(84);i(132);document.webL10n=function(e,t,i){var n={},r="",s="textContent",o="",a={},l="loading";function fireL10nReadyEvent(e){var i=t.createEvent("Event");i.initEvent("localized",!0,!1);i.language=e;t.dispatchEvent(i)}function xhrLoadText(e,t,i){t=t||function _onSuccess(e){};i=i||function _onFailure(){};var n=new XMLHttpRequest;n.open("GET",e,true);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 parseResource(t,i,o,a){var l=t.replace(/[^\/]*$/,"")||"./";function evalString(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,"'")}xhrLoadText(t,(function(t){r+=t;!function parseProperties(t,n){var r={},s=/^\s*|\s*$/,o=/^\s*#|^\s*$/,a=/^\s*\[(.*)\]\s*$/,c=/^\s*@import\s+url\((.*)\)\s*$/i,h=/^([^=\s]*)\s*=\s*(.+)$/;function parseRawLines(e,t,n){var d=e.replace(s,"").split(/[\r\n]+/),u="*",p=i.split("-",1)[0],g=!1,f="",m=!1;!function nextEntry(){for(var e=void 0;;){if(!d.length&&e){m?nextEntry():loadImport(e,nextEntry);return}if(!d.length){n();return}var s=d.shift();if(!o.test(s)){if(t){if(f=a.exec(s)){u=f[1].toLowerCase();g="*"!==u&&u!==i&&u!==p;continue}if(g)continue;if(f=c.exec(s)){if("*"===u||u===i){loadImport(l+f[1],nextEntry);m=!0;return}e=l+f[1]}}var v=s.match(h);v&&3==v.length&&(r[v[1]]=evalString(v[2]))}}}()}function loadImport(t,i){xhrLoadText(t,(function(e){parseRawLines(e,!1,i)}),(function(){const n=e.PDFViewerApplicationOptions;(!n||n.get("verbosity")>0)&&Window.ngxConsole.warn(t+" not found.");i()}))}parseRawLines(t,!0,(function(){n(r)}))}(t,(function(e){for(var t in e){var i,r,a=t.lastIndexOf(".");if(a>0){i=t.substring(0,a);r=t.substring(a+1)}else{i=t;r=s}n[i]||(n[i]={});n[i][r]=e[t]}o&&o()}))}),a)}function loadLocale(i,s){let a=i;i&&(i=i.toLowerCase());s=s||function _callback(){};!function clear(){n={};r="";o=""}();o=i;var c=function getL10nResourceLinks(){return t.querySelectorAll('link[type="application/l10n"]')}(),h=c.length;if(0!==h){var d,u=0;d=function(){if(++u>=h){s();fireL10nReadyEvent(i);l="complete"}};for(var p=0;p<h;p++){new L10nResourceLink(c[p]).load(i,d)}}else{var g=function getL10nDictionary(){var e=t.querySelector('script[type="application/l10n"]');return e?JSON.parse(e.innerHTML):null}();if(g&&g.locales&&g.default_locale){Window.ngxConsole.log("The PDF viewer uses the pre-compiled language bundle stored in the HTML page.");if(!(n=g.locales[a])){var f=g.default_locale.toLowerCase();for(var m in g.locales){a=m;if((m=m.toLowerCase())===i){n=g.locales[a];break}m===f&&(n=g.locales[a])}}s()}else Window.ngxConsole.log("Could not load the translation files for the PDF viewer. Check the flag useBrowserLocale, check the locales subfolder of the assets folder, or add the locale definition to the index.html");fireL10nReadyEvent(i);l="complete"}function L10nResourceLink(t){var i=t.href;this.load=function(t,n){parseResource(i,t,n,(function(){const r=e.PDFViewerApplicationOptions;if(!r||r.get("verbosity")>0){Window.ngxConsole.warn(i+" not found.");Window.ngxConsole.warn('"'+t+'" resource not found')}o="";n()}))}}}a.plural=function(t,i,r,l){var c=parseFloat(i);if(isNaN(c))return t;if(l!=s)return t;a._pluralRules||(a._pluralRules=function getPluralRules(t){function isIn(e,t){return-1!==t.indexOf(e)}function isBetween(e,t,i){return t<=e&&e<=i}var i={0:function(e){return"other"},1:function(e){return isBetween(e%100,3,10)?"few":0===e?"zero":isBetween(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 isBetween(e,0,1)?"one":"other"},5:function(e){return isBetween(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 isBetween(e,3,6)?"few":isBetween(e,7,10)?"many":2==e?"two":1==e?"one":"other"},9:function(e){return 0===e||1!=e&&isBetween(e%100,1,19)?"few":1==e?"one":"other"},10:function(e){return isBetween(e%10,2,9)&&!isBetween(e%100,11,19)?"few":e%10!=1||isBetween(e%100,11,19)?"other":"one"},11:function(e){return isBetween(e%10,2,4)&&!isBetween(e%100,12,14)?"few":e%10==0||isBetween(e%10,5,9)||isBetween(e%100,11,14)?"many":e%10==1&&e%100!=11?"one":"other"},12:function(e){return isBetween(e,2,4)?"few":1==e?"one":"other"},13:function(e){return isBetween(e%10,2,4)&&!isBetween(e%100,12,14)?"few":1!=e&&isBetween(e%10,0,1)||isBetween(e%10,5,9)||isBetween(e%100,12,14)?"many":1==e?"one":"other"},14:function(e){return isBetween(e%100,3,4)?"few":e%100==2?"two":e%100==1?"one":"other"},15:function(e){return 0===e||isBetween(e%100,2,10)?"few":isBetween(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":isBetween(e,0,2)&&0!==e&&2!=e?"one":"other"},19:function(e){return isBetween(e,2,10)?"few":isBetween(e,0,1)?"one":"other"},20:function(e){return!isBetween(e%10,3,4)&&e%10!=9||isBetween(e%100,10,19)||isBetween(e%100,70,79)||isBetween(e%100,90,99)?e%1e6==0&&0!==e?"many":e%10!=2||isIn(e%100,[12,72,92])?e%10!=1||isIn(e%100,[11,71,91])?"other":"one":"two":"few"},21:function(e){return 0===e?"zero":1==e?"one":"other"},22:function(e){return isBetween(e,0,1)||isBetween(e,11,99)?"one":"other"},23:function(e){return isBetween(e%10,1,2)||e%20==0?"one":"other"},24:function(e){return isBetween(e,3,10)||isBetween(e,13,19)?"few":isIn(e,[2,12])?"two":isIn(e,[1,11])?"one":"other"}},n={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}[t.replace(/-.*$/,"")];if(!(n in i)){const i=e.PDFViewerApplicationOptions;(!i||i.get("verbosity")>0)&&Window.ngxConsole.warn("plural form unknown for ["+t+"]");return function(){return"other"}}return i[n]}(o));var h="["+a._pluralRules(c)+"]";0===c&&r+"[zero]"in n?t=n[r+"[zero]"][l]:1==c&&r+"[one]"in n?t=n[r+"[one]"][l]:2==c&&r+"[two]"in n?t=n[r+"[two]"][l]:r+h in n?t=n[r+h][l]:r+"[other]"in n&&(t=n[r+"[other]"][l]);return t};function getL10nData(t,i,r){var s=n[t];if(!s){const i=e.PDFViewerApplicationOptions;(!i||i.get("verbosity")>0)&&Window.ngxConsole.warn("Translation for the key #"+t+" is missing.");if(!r)return null;s=r}var o={};for(var a in s){var l=s[a];l=substArguments(l=substIndexes(l,i,t,a),i,t);o[a]=l}return o}function substIndexes(e,t,i,r){var s=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(e);if(!s||!s.length)return e;var o,l=s[1],c=s[2];t&&c in t?o=t[c]:c in n&&(o=n[c]);if(l in a){e=(0,a[l])(e,o,i,r)}return e}function substArguments(e,t,i){return e.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(e,r){if(t&&r in t)return t[r];if(r in n)return n[r];Window.ngxConsole.log("argument {{"+r+"}} for #"+i+" is undefined.");return e}))}function translateElement(i){var n=function getL10nAttributes(t){if(!t)return{};var i=t.getAttribute("data-l10n-id"),n=t.getAttribute("data-l10n-args"),r={};if(n)try{r=JSON.parse(n)}catch(t){const n=e.PDFViewerApplicationOptions;(!n||n.get("verbosity")>0)&&Window.ngxConsole.warn("could not parse arguments for #"+i)}return{id:i,args:r}}(i);if(n.id){var r=getL10nData(n.id,n.args);if(r){if(r[s]){if(0===function getChildElementCount(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}(i))i[s]=r[s];else{for(var o=i.childNodes,a=!1,l=0,c=o.length;l<c;l++)if(3===o[l].nodeType&&/\S/.test(o[l].nodeValue))if(a)o[l].nodeValue="";else{o[l].nodeValue=r[s];a=!0}if(!a){var h=t.createTextNode(r[s]);i.prepend(h)}}delete r[s]}for(var d in r)i[d]=r[d]}else{const t=e.PDFViewerApplicationOptions;(!t||t.get("verbosity")>0)&&Window.ngxConsole.warn("#"+n.id+" is undefined.")}}}return{get:function(e,t,i){var n,r=e.lastIndexOf("."),o=s;if(r>0){o=e.substring(r+1);e=e.substring(0,r)}i&&((n={})[o]=i);var a=getL10nData(e,t,n);return a&&o in a?a[o]:"{{"+e+"}}"},getData:function(){return n},getText:function(){return r},getLanguage:function(){return o},setLanguage:function(e,t){loadLocale(e,(function(){t&&t()}))},getDirection:function(){var e=o.split("-",1)[0];return["ar","he","fa","ps","ur"].indexOf(e)>=0?"rtl":"ltr"},translate:function translateFragment(e){for(var i=function getTranslatableChildren(e){return e?e.querySelectorAll("*[data-l10n-id]"):[]}(e=e||t.documentElement),n=i.length,r=0;r<n;r++)translateElement(i[r]);translateElement(e)},getReadyState:function(){return l},ready:function(i){i&&("complete"==l||"interactive"==l?e.setTimeout((function(){i()})):t.addEventListener&&t.addEventListener("localized",(function once(){t.removeEventListener("localized",once);i()})))}}}(window,document)},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.GenericScripting=void 0;t.docPropertiesLookup=async function docPropertiesLookup(e){const t="".split("#")[0];let{info:i,metadata:r,contentDispositionFilename:s,contentLength:o}=await e.getMetadata();if(!o){const{length:t}=await e.getDownloadInfo();o=t}return{...i,baseURL:t,filesize:o,filename:s||(0,n.getPdfFilenameFromUrl)(""),metadata:null==r?void 0:r.getRaw(),authors:null==r?void 0:r.get("dc:creator"),numPages:e.numPages,URL:""}};i(94);i(84);var n=i(155);t.GenericScripting=class GenericScripting{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)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFPrintService=PDFPrintService;i(84);i(94);i(1);i(138);i(152);i(131);var n=i(155),r=i(93),s=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(i(195)),o=i(260);let a=null,l=null,c=null;function renderPage(e,t,i,r,o,l,c){const h=a.scratchCanvas;let d=o/n.PixelsPerInch.PDF,u=1;const p=Math.floor(r.width*d),g=Math.floor(r.height*d);if(p>=4096||g>=4096){if(!s.default.test({width:p,height:g})){const e=function determineMaxDimensions(){const e=[4096,8192,10836,11180,11402,14188,16384];for(let t of e)if(!s.default.test({width:t+1,height:t+1}))return t;return 16384}();u=.95*Math.min(e/p,e/g)}warn("Page "+i+": Reduced the [printResolution] to "+Math.floor(o*u)+" because the browser can't render larger canvases. If you see blank page in the print preview, reduce [printResolution] manually to a lower value.")}d*=u;h.width=Math.floor(r.width*d);h.height=Math.floor(r.height*d);const f=h.getContext("2d");f.save();f.fillStyle="rgb(255, 255, 255)";f.fillRect(0,0,h.width,h.height);f.restore();return Promise.all([t.getPage(i),c]).then((function(e){let[t,i]=e;const s={canvasContext:f,transform:[d,0,0,d,0,0],viewport:t.getViewport({scale:1,rotation:r.rotation}),intent:"print",annotationMode:n.AnnotationMode.ENABLE_STORAGE,optionalContentConfigPromise:l,background:PDFViewerApplicationOptions.get("pdfBackgroundColor"),printAnnotationStorage:i};return t.render(s).promise}))}function PDFPrintService(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,o=arguments.length>6?arguments[6]:void 0,a=arguments.length>7?arguments[7]:void 0;this.pdfDocument=e;this.pagesOverview=t;this.printContainer=i;this._printResolution=n||150;this._optionalContentConfigPromise=r||e.getOptionalContentConfig();this._printAnnotationStoragePromise=s||Promise.resolve();this.l10n=o;this.currentPage=-1;this.scratchCanvas=document.createElement("canvas");this.eventBus=a}PDFPrintService.prototype={layout(){this.throwIfInactive();const e=document.querySelector("body");e.setAttribute("data-pdfjsprinting",!0);document.querySelector("html").setAttribute("data-pdfjsprinting",!0);this.pagesOverview.every((function(e){return e.width===this.pagesOverview[0].width&&e.height===this.pagesOverview[0].height}),this)||Window.ngxConsole.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;}";e.append(this.pageStyleSheet)},destroy(){if(a!==this)return;this.printContainer.textContent="";document.querySelector("body").removeAttribute("data-pdfjsprinting");document.querySelector("html").removeAttribute("data-pdfjsprinting");if(this.pageStyleSheet){this.pageStyleSheet.remove();this.pageStyleSheet=null}this.scratchCanvas.width=this.scratchCanvas.height=0;this.scratchCanvas=null;a=null;ensureOverlay().then((function(){if(c.active===l){c.close(l);c.unregister(l)}}));d=void 0},renderPages(){if(this.pdfDocument.isPureXfa){(0,o.getXfaHtmlForPrinting)(this.printContainer,this.pdfDocument);return Promise.resolve()}const e=this.pagesOverview.length,renderNextPage=(t,i)=>{this.throwIfInactive();for(;;){++this.currentPage;if(this.currentPage>=e)break;if(!window.isInPDFPrintRange||window.isInPDFPrintRange(this.currentPage))break}if(this.currentPage>=e){renderProgress(window.filteredPageCount|e,window.filteredPageCount|e,this.l10n,this.eventBus);t();return}const n=this.currentPage;renderProgress(n,window.filteredPageCount|e,this.l10n,this.eventBus);renderPage(0,this.pdfDocument,n+1,this.pagesOverview[n],this._printResolution,this._optionalContentConfigPromise,this._printAnnotationStoragePromise).then(this.useRenderedPage.bind(this)).then((function(){renderNextPage(t,i)}),i)};return new Promise(renderNextPage)},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");i.className="printedPage";i.append(e);this.printContainer.append(i);return new Promise((function(t,i){e.onload=t;e.onerror=i}))},performPrint(){this.throwIfInactive();return new Promise((e=>{setTimeout((()=>{if(!this.active){e();return}h.call(window);const t=navigator.platform&&["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document;setTimeout(e,t?1500:20)}),0)}))},get active(){return this===a},throwIfInactive(){if(!this.active)throw new Error("This print request was cancelled or completed.")}};const h=window.print;window.printPDF=function(){if(r.PDFViewerApplication.enablePrint)if(a)Window.ngxConsole.warn("Ignored window.printPDF() because of a pending print job.");else{ensureOverlay().then((function(){a&&c.open(l)}));try{dispatchEvent("beforeprint")}finally{if(!a){Window.ngxConsole.error("Expected print service to be initialized.");ensureOverlay().then((function(){c.active===l&&c.close(l)}));return}const e=a;a.renderPages().then((function(){const t=document.getElementById("printServiceDialog");t&&t.classList.add("hidden");return e.performPrint()})).catch((function(){})).then((function(){e.active&&abort()}))}}};function dispatchEvent(e){const t=document.createEvent("CustomEvent");t.initCustomEvent(e,!1,!1,"custom");window.dispatchEvent(t)}function abort(){if(a){a.destroy();dispatchEvent("afterprint")}}function renderProgress(e,t,i,n){l=document.getElementById("printServiceDialog");const r=Math.round(100*e/t),s=l.querySelector("progress"),o=l.querySelector(".relative-progress");s.value=r;i.get("print_progress_percent",{progress:r}).then((e=>{o.textContent=e}));n.dispatch("progress",{source:this,type:"print",total:t,page:e,percent:100*e/t})}window.addEventListener("keydown",(function(e){if(80===e.keyCode&&(e.ctrlKey||e.metaKey)&&!e.altKey&&(!e.shiftKey||window.chrome||window.opera)){window.print();e.preventDefault();e.stopImmediatePropagation?e.stopImmediatePropagation():e.stopPropagation()}}),!0);if("onbeforeprint"in window){const stopPropagationIfNeeded=function(e){"custom"!==e.detail&&e.stopImmediatePropagation&&e.stopImmediatePropagation()};window.addEventListener("beforeprint",stopPropagationIfNeeded);window.addEventListener("afterprint",stopPropagationIfNeeded)}let d;function ensureOverlay(){if(!d){c=r.PDFViewerApplication.overlayManager;if(!c)throw new Error("The overlay manager has not yet been initialized.");l=document.getElementById("printServiceDialog");d=c.register(l,!0);document.getElementById("printCancel").onclick=abort;l.addEventListener("close",abort)}return d}r.PDFPrintServiceFactory.instance={supportsPrinting:!0,createPrintService(e,t,i,n,r,s,o,l){if(a)throw new Error("The print service is created and active.");a=new PDFPrintService(e,t,i,n,r,s,o,l);return a}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.getXfaHtmlForPrinting=function getXfaHtmlForPrinting(e,t){const i=t.allXfaHtml,o=new r.SimpleLinkService,a=Math.round(100*n.PixelsPerInch.PDF_TO_CSS_UNITS)/100;for(const r of i.children){const i=document.createElement("div");i.className="xfaPrintedPage";e.append(i);const l=new s.XfaLayerBuilder({pageDiv:i,pdfPage:null,annotationStorage:t.annotationStorage,linkService:o,xfaHtml:r}),c=(0,n.getXfaPageViewport)(r,{scale:a});l.render(c,"print")}};i(1);var n=i(155),r=i(159),s=i(249)}],t={};function __webpack_require__(i){var n=t[i];if(void 0!==n)return n.exports;var r=t[i]={exports:{}};e[i](r,r.exports,__webpack_require__);return r.exports}var i={};(()=>{"use strict";var e=i;Object.defineProperty(e,"__esModule",{value:!0});Object.defineProperty(e,"PDFViewerApplication",{enumerable:!0,get:function(){return s.PDFViewerApplication}});Object.defineProperty(e,"PDFViewerApplicationOptions",{enumerable:!0,get:function(){return r.AppOptions}});__webpack_require__(1);var t,n,r=__webpack_require__(83),s=__webpack_require__(93);window.PDFViewerApplication=s.PDFViewerApplication;window.PDFViewerApplicationOptions=r.AppOptions;HTMLCollection.prototype[Symbol.iterator]||(HTMLCollection.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator]);"function"!=typeof window.CustomEvent&&(window.CustomEvent=function CustomEvent(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};const i=document.createEvent("CustomEvent");i.initCustomEvent(e,t.bubbles,t.cancelable,t.detail);return i});__webpack_require__(253);__webpack_require__(259);null===(t=(n=document).blockUnblockOnload)||void 0===t||t.call(n,!0);window.webViewerLoad=function webViewerLoad(){const e=function getViewerConfiguration(){let e=null;e={container:document.getElementById("errorWrapper"),errorMessage:document.getElementById("errorMessage"),closeButton:document.getElementById("errorClose"),errorMoreInfo:document.getElementById("errorMoreInfo"),moreInfoButton:document.getElementById("errorShowMore"),lessInfoButton:document.getElementById("errorShowLess")};return{appContainer:document.body,mainContainer:document.getElementById("viewerContainer"),viewerContainer:document.getElementById("viewer"),toolbar:{container:document.getElementById("toolbarViewer"),numPages:document.getElementById("numPages"),pageNumber:document.getElementById("pageNumber"),scaleSelect:document.getElementById("scaleSelect"),customScaleOption:document.getElementById("customScaleOption"),previous:document.getElementById("previous"),next:document.getElementById("next"),zoomIn:document.getElementById("zoomIn"),zoomOut:document.getElementById("zoomOut"),viewFind:document.getElementById("viewFind"),openFile:document.getElementById("openFile"),print:document.getElementById("print"),editorNoneButton:document.getElementById("editorNone"),editorFreeTextButton:document.getElementById("editorFreeText"),editorFreeTextParamsToolbar:document.getElementById("editorFreeTextParamsToolbar"),editorInkButton:document.getElementById("editorInk"),editorInkParamsToolbar:document.getElementById("editorInkParamsToolbar"),presentationModeButton:document.getElementById("presentationMode"),download:document.getElementById("download"),viewBookmark:document.getElementById("viewBookmark")},secondaryToolbar:{toolbar:document.getElementById("secondaryToolbar"),toggleButton:document.getElementById("secondaryToolbarToggle"),presentationModeButton:document.getElementById("secondaryPresentationMode"),openFileButton:document.getElementById("secondaryOpenFile"),printButton:document.getElementById("secondaryPrint"),downloadButton:document.getElementById("secondaryDownload"),viewBookmarkButton:document.getElementById("secondaryViewBookmark"),firstPageButton:document.getElementById("firstPage"),lastPageButton:document.getElementById("lastPage"),pageRotateCwButton:document.getElementById("pageRotateCw"),pageRotateCcwButton:document.getElementById("pageRotateCcw"),cursorSelectToolButton:document.getElementById("cursorSelectTool"),cursorHandToolButton:document.getElementById("cursorHandTool"),scrollPageButton:document.getElementById("scrollPage"),scrollVerticalButton:document.getElementById("scrollVertical"),scrollHorizontalButton:document.getElementById("scrollHorizontal"),scrollWrappedButton:document.getElementById("scrollWrapped"),spreadNoneButton:document.getElementById("spreadNone"),spreadOddButton:document.getElementById("spreadOdd"),spreadEvenButton:document.getElementById("spreadEven"),documentPropertiesButton:document.getElementById("documentProperties")},sidebar:{outerContainer:document.getElementById("outerContainer"),sidebarContainer:document.getElementById("sidebarContainer"),toggleButton:document.getElementById("sidebarToggle"),thumbnailButton:document.getElementById("viewThumbnail"),outlineButton:document.getElementById("viewOutline"),attachmentsButton:document.getElementById("viewAttachments"),layersButton:document.getElementById("viewLayers"),thumbnailView:document.getElementById("thumbnailView"),outlineView:document.getElementById("outlineView"),attachmentsView:document.getElementById("attachmentsView"),layersView:document.getElementById("layersView"),outlineOptionsContainer:document.getElementById("outlineOptionsContainer"),currentOutlineItemButton:document.getElementById("currentOutlineItem")},sidebarResizer:{outerContainer:document.getElementById("outerContainer"),resizer:document.getElementById("sidebarResizer")},findBar:{bar:document.getElementById("findbar"),toggleButton:document.getElementById("viewFind"),findField:document.getElementById("findInput"),findFieldMultiline:document.getElementById("findInputMultiline"),highlightAllCheckbox:document.getElementById("findHighlightAll"),findCurrentPageCheckbox:document.getElementById("findCurrentPage"),findPageRangeField:document.getElementById("findRange"),caseSensitiveCheckbox:document.getElementById("findMatchCase"),matchDiacriticsCheckbox:document.getElementById("findMatchDiacritics"),entireWordCheckbox:document.getElementById("findEntireWord"),findMultipleSearchTextsCheckbox:document.getElementById("findMultipleSearchTexts"),ignoreAccentsCheckbox:document.getElementById("findIgnoreAccents"),fuzzyCheckbox:document.getElementById("findFuzzy"),findMsg:document.getElementById("findMsg"),findResultsCount:document.getElementById("findResultsCount"),findPreviousButton:document.getElementById("findPrevious"),findNextButton:document.getElementById("findNext")},passwordOverlay:{dialog:document.getElementById("passwordDialog"),label:document.getElementById("passwordText"),input:document.getElementById("password"),submitButton:document.getElementById("passwordSubmit"),cancelButton:document.getElementById("passwordCancel")},documentProperties:{dialog:document.getElementById("documentPropertiesDialog"),closeButton:document.getElementById("documentPropertiesClose"),fields:{fileName:document.getElementById("fileNameField"),fileSize:document.getElementById("fileSizeField"),title:document.getElementById("titleField"),author:document.getElementById("authorField"),subject:document.getElementById("subjectField"),keywords:document.getElementById("keywordsField"),creationDate:document.getElementById("creationDateField"),modificationDate:document.getElementById("modificationDateField"),creator:document.getElementById("creatorField"),producer:document.getElementById("producerField"),version:document.getElementById("versionField"),pageCount:document.getElementById("pageCountField"),pageSize:document.getElementById("pageSizeField"),linearized:document.getElementById("linearizedField")}},annotationEditorParams:{editorFreeTextFontSize:document.getElementById("editorFreeTextFontSize"),editorFreeTextColor:document.getElementById("editorFreeTextColor"),editorInkColor:document.getElementById("editorInkColor"),editorInkThickness:document.getElementById("editorInkThickness"),editorInkOpacity:document.getElementById("editorInkOpacity")},errorWrapper:e,printContainer:document.getElementById("printContainer"),openFileInput:document.getElementById("fileInput"),debuggerScriptPath:"./debugger.js"}}(),t=document.createEvent("CustomEvent");t.initCustomEvent("webviewerloaded",!0,!0,{source:window});try{parent.document.eventListeners&&parent.document.eventListeners("webviewerloaded").length?parent.document.dispatchEvent(t):document.dispatchEvent(t)}catch(e){Window.ngxConsole.error("webviewerloaded: ".concat(e));document.dispatchEvent(t)}s.PDFViewerApplication.run(e)}})()})();
});