UNPKG

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.

46 lines 794 kB
window.ngxZone.runOutsideAngular(() => {
/**
 * @licstart The following is the entire license notice for the
 * JavaScript code in this page
 *
 * Copyright 2023 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
 */
!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?globalThis["pdfjs-dist/build/pdf"]=module.exports=t():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],t):"object"==typeof exports?globalThis["pdfjs-dist/build/pdf"]=exports["pdfjs-dist/build/pdf"]=t():e["pdfjs-dist/build/pdf"]=e.pdfjsLib=t()}(globalThis,(()=>(()=>{var __webpack_modules__=[,(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.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.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.BASELINE_FACTOR=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.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 s=0;s<t;s+=i){const r=Math.min(s+i,t),a=e.subarray(s,r);n.push(String.fromCharCode.apply(null,a))}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://${e}`)}if(i.tryConvertEncoding)try{e=stringToUTF8String(e)}catch(e){}}const n=t?new URL(e,t):new URL(e);if(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}}(n))return n}catch(e){}return null};t.getModificationDate=function getModificationDate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[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")].join("")};t.getVerbosityLevel=function getVerbosityLevel(){return s};t.info=function info(e){s>=n.INFOS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log(`Info: ${e}`):Window&&Window.ngxConsole?Window.ngxConsole.log(`Info: ${e}`):console.log(`Info: ${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.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)&&(s=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: "${e}".`)}}const t=[];for(let i=0,n=e.length;i<n;i++){const n=o[e.charCodeAt(i)];t.push(n?String.fromCharCode(n):e.charAt(i))}return t.join("")};t.stringToUTF8String=stringToUTF8String;t.unreachable=unreachable;t.utf8StringToString=function utf8StringToString(e){return unescape(encodeURIComponent(e))};t.warn=warn;if(!globalThis._pdfjsCompatibilityChecked){globalThis._pdfjsCompatibilityChecked=!0;i(2)}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.BASELINE_FACTOR=.25925925925925924;t.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,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"};const n={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=n;t.CMapCompressionType={NONE:0,BINARY:1};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,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};t.UNSUPPORTED_FEATURES={forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",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 s=n.WARNINGS;function warn(e){s>=n.WARNINGS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log(`Warning: ${e}`):Window&&Window.ngxConsole?Window.ngxConsole.log(`Warning: ${e}`):console.log(`Warning: ${e}`))}function unreachable(e){throw new Error(e)}function shadow(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.defineProperty(e,t,{value:i,enumerable:!n,configurable:!0,writable:!1});return i}const r=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=r;t.PasswordException=class PasswordException extends r{constructor(e,t){super(e,"PasswordException");this.code=t}};t.UnknownErrorException=class UnknownErrorException extends r{constructor(e,t){super(e,"UnknownErrorException");this.details=t}};t.InvalidPDFException=class InvalidPDFException extends r{constructor(e){super(e,"InvalidPDFException")}};t.MissingPDFException=class MissingPDFException extends r{constructor(e){super(e,"MissingPDFException")}};t.UnexpectedResponseException=class UnexpectedResponseException extends r{constructor(e,t){super(e,"UnexpectedResponseException");this.status=t}};t.FormatError=class FormatError extends r{constructor(e){super(e,"FormatError")}};t.AbortException=class AbortException extends r{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}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)}static get platform(){return"undefined"==typeof navigator?shadow(this,"platform",{isWin:!1,isMac:!1}):shadow(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}};const a=[...Array(256).keys()].map((e=>e.toString(16).padStart(2,"0")));class Util{static makeHexColor(e,t,i){return`#${a[e]}${a[t]}${a[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),s=Util.applyTransform([e[0],e[3]],t),r=Util.applyTransform([e[2],e[1]],t);return[Math.min(i[0],n[0],s[0],r[0]),Math.min(i[1],n[1],s[1],r[1]),Math.max(i[0],n[0],s[0],r[0]),Math.max(i[1],n[1],s[1],r[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 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],s=e[2]*t[0]+e[3]*t[2],r=e[2]*t[1]+e[3]*t[3],a=(i+r)/2,o=Math.sqrt((i+r)**2-4*(i*r-s*n))/2,l=a+o||1,c=a-o||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 s=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),r=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return s>r?null:[i,s,n,r]}static bezierBoundingBox(e,t,i,n,s,r,a,o){const l=[],c=[[],[]];let d,h,u,p,g,f,m,v;for(let c=0;c<2;++c){if(0===c){h=6*e-12*i+6*s;d=-3*e+9*i-9*s+3*a;u=3*i-3*e}else{h=6*t-12*n+6*r;d=-3*t+9*n-9*r+3*o;u=3*n-3*t}if(Math.abs(d)<1e-12){if(Math.abs(h)<1e-12)continue;p=-u/h;0<p&&p<1&&l.push(p)}else{m=h*h-4*u*d;v=Math.sqrt(m);if(!(m<0)){g=(-h+v)/(2*d);0<g&&g<1&&l.push(g);f=(-h-v)/(2*d);0<f&&f<1&&l.push(f)}}}let _,b=l.length;const w=b;for(;b--;){p=l[b];_=1-p;c[0][b]=_*_*_*e+3*_*_*p*i+3*_*p*p*s+p*p*p*a;c[1][b]=_*_*_*t+3*_*_*p*n+3*_*p*p*r+p*p*p*o}c[0][w]=e;c[1][w]=t;c[0][w+1]=a;c[1][w+1]=o;c[0].length=c[1].length=w+2;return[Math.min(...c[0]),Math.min(...c[1]),Math.max(...c[0]),Math.max(...c[1])]}}t.Util=Util;const o=[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)=>{"use strict";!function checkNodeBtoa(){globalThis.btoa}();!function checkNodeAtob(){globalThis.atob}();!function checkDOMMatrix(){globalThis.DOMMatrix}();!function checkPath2D(){globalThis.Path2D}();!function checkReadableStream(){globalThis.ReadableStream}();!function checkArrayAt(){Array.prototype.at||i(3)}();!function checkTypedArrayAt(){Uint8Array.prototype.at||i(77)}();!function checkStructuredClone(){globalThis.structuredClone||i(87)}()},(e,t,i)=>{i(4);var n=i(76);e.exports=n("Array","at")},(e,t,i)=>{"use strict";var n=i(5),s=i(42),r=i(66),a=i(64),o=i(71);n({target:"Array",proto:!0},{at:function at(e){var t=s(this),i=r(t),n=a(e),o=n>=0?n:i+n;return o<0||o>=i?void 0:t[o]}});o("at")},(e,t,i)=>{var n=i(6),s=i(7).f,r=i(46),a=i(50),o=i(40),l=i(58),c=i(70);e.exports=function(e,t){var i,d,h,u,p,g=e.target,f=e.global,m=e.stat;if(i=f?n:m?n[g]||o(g,{}):(n[g]||{}).prototype)for(d in t){u=t[d];h=e.dontCallGetSet?(p=s(i,d))&&p.value:i[d];if(!c(f?d:g+(m?".":"#")+d,e.forced)&&void 0!==h){if(typeof u==typeof h)continue;l(u,h)}(e.sham||h&&h.sham)&&r(u,"sham",!0);a(i,d,u,e)}}},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,t,i)=>{var n=i(8),s=i(10),r=i(12),a=i(13),o=i(14),l=i(20),c=i(41),d=i(44),h=Object.getOwnPropertyDescriptor;t.f=n?h:function getOwnPropertyDescriptor(e,t){e=o(e);t=l(t);if(d)try{return h(e,t)}catch(e){}if(c(e,t))return a(!s(r.f,e,t),e[t])}},(e,t,i)=>{var n=i(9);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},(e,t,i)=>{var n=i(11),s=Function.prototype.call;e.exports=n?s.bind(s):function(){return s.apply(s,arguments)}},(e,t,i)=>{var n=i(9);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},(e,t)=>{"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,s=n&&!i.call({1:2},1);t.f=s?function propertyIsEnumerable(e){var t=n(this,e);return!!t&&t.enumerable}:i},e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},(e,t,i)=>{var n=i(15),s=i(18);e.exports=function(e){return n(s(e))}},(e,t,i)=>{var n=i(16),s=i(9),r=i(17),a=Object,o=n("".split);e.exports=s((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==r(e)?o(e,""):a(e)}:a},(e,t,i)=>{var n=i(11),s=Function.prototype,r=s.call,a=n&&s.bind.bind(r,r);e.exports=n?a:function(e){return function(){return r.apply(e,arguments)}}},(e,t,i)=>{var n=i(16),s=n({}.toString),r=n("".slice);e.exports=function(e){return r(s(e),8,-1)}},(e,t,i)=>{var n=i(19),s=TypeError;e.exports=function(e){if(n(e))throw s("Can't call method on "+e);return e}},e=>{e.exports=function(e){return null==e}},(e,t,i)=>{var n=i(21),s=i(25);e.exports=function(e){var t=n(e,"string");return s(t)?t:t+""}},(e,t,i)=>{var n=i(10),s=i(22),r=i(25),a=i(32),o=i(35),l=i(36),c=TypeError,d=l("toPrimitive");e.exports=function(e,t){if(!s(e)||r(e))return e;var i,l=a(e,d);if(l){void 0===t&&(t="default");i=n(l,e,t);if(!s(i)||r(i))return i;throw c("Can't convert object to primitive value")}void 0===t&&(t="number");return o(e,t)}},(e,t,i)=>{var n=i(23),s=i(24),r=s.all;e.exports=s.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===r}:function(e){return"object"==typeof e?null!==e:n(e)}},(e,t,i)=>{var n=i(24),s=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===s}:function(e){return"function"==typeof e}},e=>{var t="object"==typeof document&&document.all,i=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:i}},(e,t,i)=>{var n=i(26),s=i(23),r=i(27),a=i(28),o=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return s(t)&&r(t.prototype,o(e))}},(e,t,i)=>{var n=i(6),s=i(23),aFunction=function(e){return s(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(16);e.exports=n({}.isPrototypeOf)},(e,t,i)=>{var n=i(29);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(e,t,i)=>{var n=i(30),s=i(9);e.exports=!!Object.getOwnPropertySymbols&&!s((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},(e,t,i)=>{var n,s,r=i(6),a=i(31),o=r.process,l=r.Deno,c=o&&o.versions||l&&l.version,d=c&&c.v8;d&&(s=(n=d.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1]));!s&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(s=+n[1]);e.exports=s},e=>{e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(e,t,i)=>{var n=i(33),s=i(19);e.exports=function(e,t){var i=e[t];return s(i)?void 0:n(i)}},(e,t,i)=>{var n=i(23),s=i(34),r=TypeError;e.exports=function(e){if(n(e))return e;throw r(s(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(10),s=i(23),r=i(22),a=TypeError;e.exports=function(e,t){var i,o;if("string"===t&&s(i=e.toString)&&!r(o=n(i,e)))return o;if(s(i=e.valueOf)&&!r(o=n(i,e)))return o;if("string"!==t&&s(i=e.toString)&&!r(o=n(i,e)))return o;throw a("Can't convert object to primitive value")}},(e,t,i)=>{var n=i(6),s=i(37),r=i(41),a=i(43),o=i(29),l=i(28),c=n.Symbol,d=s("wks"),h=l?c.for||c:c&&c.withoutSetter||a;e.exports=function(e){r(d,e)||(d[e]=o&&r(c,e)?c[e]:h("Symbol."+e));return d[e]}},(e,t,i)=>{var n=i(38),s=i(39);(e.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.27.2",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"})},e=>{e.exports=!1},(e,t,i)=>{var n=i(6),s=i(40),r="__core-js_shared__",a=n[r]||s(r,{});e.exports=a},(e,t,i)=>{var n=i(6),s=Object.defineProperty;e.exports=function(e,t){try{s(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},(e,t,i)=>{var n=i(16),s=i(42),r=n({}.hasOwnProperty);e.exports=Object.hasOwn||function hasOwn(e,t){return r(s(e),t)}},(e,t,i)=>{var n=i(18),s=Object;e.exports=function(e){return s(n(e))}},(e,t,i)=>{var n=i(16),s=0,r=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++s+r,36)}},(e,t,i)=>{var n=i(8),s=i(9),r=i(45);e.exports=!n&&!s((function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},(e,t,i)=>{var n=i(6),s=i(22),r=n.document,a=s(r)&&s(r.createElement);e.exports=function(e){return a?r.createElement(e):{}}},(e,t,i)=>{var n=i(8),s=i(47),r=i(13);e.exports=n?function(e,t,i){return s.f(e,t,r(1,i))}:function(e,t,i){e[t]=i;return e}},(e,t,i)=>{var n=i(8),s=i(44),r=i(48),a=i(49),o=i(20),l=TypeError,c=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h="enumerable",u="configurable",p="writable";t.f=n?r?function defineProperty(e,t,i){a(e);t=o(t);a(i);if("function"==typeof e&&"prototype"===t&&"value"in i&&p in i&&!i[p]){var n=d(e,t);if(n&&n[p]){e[t]=i.value;i={configurable:u in i?i[u]:n[u],enumerable:h in i?i[h]:n[h],writable:!1}}}return c(e,t,i)}:c:function defineProperty(e,t,i){a(e);t=o(t);a(i);if(s)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(8),s=i(9);e.exports=n&&s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(e,t,i)=>{var n=i(22),s=String,r=TypeError;e.exports=function(e){if(n(e))return e;throw r(s(e)+" is not an object")}},(e,t,i)=>{var n=i(23),s=i(47),r=i(51),a=i(40);e.exports=function(e,t,i,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:t;n(i)&&r(i,c,o);if(o.global)l?e[t]=i:a(t,i);else{try{o.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=i:s.f(e,t,{value:i,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e}},(e,t,i)=>{var n=i(16),s=i(9),r=i(23),a=i(41),o=i(8),l=i(52).CONFIGURABLE,c=i(53),d=i(54),h=d.enforce,u=d.get,p=String,g=Object.defineProperty,f=n("".slice),m=n("".replace),v=n([].join),_=o&&!s((function(){return 8!==g((function(){}),"length",{value:8}).length})),b=String(String).split("String"),w=e.exports=function(e,t,i){"Symbol("===f(p(t),0,7)&&(t="["+m(p(t),/^Symbol\(([^)]*)\)/,"$1")+"]");i&&i.getter&&(t="get "+t);i&&i.setter&&(t="set "+t);(!a(e,"name")||l&&e.name!==t)&&(o?g(e,"name",{value:t,configurable:!0}):e.name=t);_&&i&&a(i,"arity")&&e.length!==i.arity&&g(e,"length",{value:i.arity});try{i&&a(i,"constructor")&&i.constructor?o&&g(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=h(e);a(n,"source")||(n.source=v(b,"string"==typeof t?t:""));return e};Function.prototype.toString=w((function toString(){return r(this)&&u(this).source||c(this)}),"toString")},(e,t,i)=>{var n=i(8),s=i(41),r=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,o=s(r,"name"),l=o&&"something"===function something(){}.name,c=o&&(!n||n&&a(r,"name").configurable);e.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},(e,t,i)=>{var n=i(16),s=i(23),r=i(39),a=n(Function.toString);s(r.inspectSource)||(r.inspectSource=function(e){return a(e)});e.exports=r.inspectSource},(e,t,i)=>{var n,s,r,a=i(55),o=i(6),l=i(22),c=i(46),d=i(41),h=i(39),u=i(56),p=i(57),g="Object already initialized",f=o.TypeError,m=o.WeakMap;if(a||h.state){var v=h.state||(h.state=new m);v.get=v.get;v.has=v.has;v.set=v.set;n=function(e,t){if(v.has(e))throw f(g);t.facade=e;v.set(e,t);return t};s=function(e){return v.get(e)||{}};r=function(e){return v.has(e)}}else{var _=u("state");p[_]=!0;n=function(e,t){if(d(e,_))throw f(g);t.facade=e;c(e,_,t);return t};s=function(e){return d(e,_)?e[_]:{}};r=function(e){return d(e,_)}}e.exports={set:n,get:s,has:r,enforce:function(e){return r(e)?s(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!l(t)||(i=s(t)).type!==e)throw f("Incompatible receiver, "+e+" required");return i}}}},(e,t,i)=>{var n=i(6),s=i(23),r=n.WeakMap;e.exports=s(r)&&/native code/.test(String(r))},(e,t,i)=>{var n=i(37),s=i(43),r=n("keys");e.exports=function(e){return r[e]||(r[e]=s(e))}},e=>{e.exports={}},(e,t,i)=>{var n=i(41),s=i(59),r=i(7),a=i(47);e.exports=function(e,t,i){for(var o=s(t),l=a.f,c=r.f,d=0;d<o.length;d++){var h=o[d];n(e,h)||i&&n(i,h)||l(e,h,c(t,h))}}},(e,t,i)=>{var n=i(26),s=i(16),r=i(60),a=i(69),o=i(49),l=s([].concat);e.exports=n("Reflect","ownKeys")||function ownKeys(e){var t=r.f(o(e)),i=a.f;return i?l(t,i(e)):t}},(e,t,i)=>{var n=i(61),s=i(68).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return n(e,s)}},(e,t,i)=>{var n=i(16),s=i(41),r=i(14),a=i(62).indexOf,o=i(57),l=n([].push);e.exports=function(e,t){var i,n=r(e),c=0,d=[];for(i in n)!s(o,i)&&s(n,i)&&l(d,i);for(;t.length>c;)s(n,i=t[c++])&&(~a(d,i)||l(d,i));return d}},(e,t,i)=>{var n=i(14),s=i(63),r=i(66),createMethod=function(e){return function(t,i,a){var o,l=n(t),c=r(l),d=s(a,c);if(e&&i!=i){for(;c>d;)if((o=l[d++])!=o)return!0}else for(;c>d;d++)if((e||d in l)&&l[d]===i)return e||d||0;return!e&&-1}};e.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(e,t,i)=>{var n=i(64),s=Math.max,r=Math.min;e.exports=function(e,t){var i=n(e);return i<0?s(i+t,0):r(i,t)}},(e,t,i)=>{var n=i(65);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(67);e.exports=function(e){return n(e.length)}},(e,t,i)=>{var n=i(64),s=Math.min;e.exports=function(e){return e>0?s(n(e),9007199254740991):0}},e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(e,t)=>{t.f=Object.getOwnPropertySymbols},(e,t,i)=>{var n=i(9),s=i(23),r=/#|\.prototype\./,isForced=function(e,t){var i=o[a(e)];return i==c||i!=l&&(s(t)?n(t):!!t)},a=isForced.normalize=function(e){return String(e).replace(r,".").toLowerCase()},o=isForced.data={},l=isForced.NATIVE="N",c=isForced.POLYFILL="P";e.exports=isForced},(e,t,i)=>{var n=i(36),s=i(72),r=i(47).f,a=n("unscopables"),o=Array.prototype;null==o[a]&&r(o,a,{configurable:!0,value:s(null)});e.exports=function(e){o[a][e]=!0}},(e,t,i)=>{var n,s=i(49),r=i(73),a=i(68),o=i(57),l=i(75),c=i(45),d=i(56),h="prototype",u="script",p=d("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return"<"+u+">"+e+"</"+u+">"},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"),i="java"+u+":";t.style.display="none";l.appendChild(t);t.src=String(i);(e=t.contentWindow.document).open();e.write(scriptTag("document.F=Object"));e.close();return e.F}():NullProtoObjectViaActiveX(n);for(var e=a.length;e--;)delete NullProtoObject[h][a[e]];return NullProtoObject()};o[p]=!0;e.exports=Object.create||function create(e,t){var i;if(null!==e){EmptyConstructor[h]=s(e);i=new EmptyConstructor;EmptyConstructor[h]=null;i[p]=e}else i=NullProtoObject();return void 0===t?i:r.f(i,t)}},(e,t,i)=>{var n=i(8),s=i(48),r=i(47),a=i(49),o=i(14),l=i(74);t.f=n&&!s?Object.defineProperties:function defineProperties(e,t){a(e);for(var i,n=o(t),s=l(t),c=s.length,d=0;c>d;)r.f(e,i=s[d++],n[i]);return e}},(e,t,i)=>{var n=i(61),s=i(68);e.exports=Object.keys||function keys(e){return n(e,s)}},(e,t,i)=>{var n=i(26);e.exports=n("document","documentElement")},(e,t,i)=>{var n=i(6),s=i(16);e.exports=function(e,t){return s(n[e].prototype[t])}},(e,t,i)=>{i(78)},(e,t,i)=>{"use strict";var n=i(79),s=i(66),r=i(64),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("at",(function at(e){var t=a(this),i=s(t),n=r(e),o=n>=0?n:i+n;return o<0||o>=i?void 0:t[o]}))},(e,t,i)=>{"use strict";var n,s,r,a=i(80),o=i(8),l=i(6),c=i(23),d=i(22),h=i(41),u=i(81),p=i(34),g=i(46),f=i(50),m=i(47).f,v=i(27),_=i(83),b=i(85),w=i(36),y=i(43),P=i(54),S=P.enforce,A=P.get,E=l.Int8Array,x=E&&E.prototype,C=l.Uint8ClampedArray,M=C&&C.prototype,T=E&&_(E),k=x&&_(x),I=Object.prototype,D=l.TypeError,R=w("toStringTag"),L=y("TYPED_ARRAY_TAG"),O="TypedArrayConstructor",N=a&&!!b&&"Opera"!==u(l.opera),B=!1,G={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},V={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(e){var t=_(e);if(d(t)){var i=A(t);return i&&h(i,O)?i[O]:getTypedArrayConstructor(t)}},isTypedArray=function(e){if(!d(e))return!1;var t=u(e);return h(G,t)||h(V,t)};for(n in G)(r=(s=l[n])&&s.prototype)?S(r)[O]=s:N=!1;for(n in V)(r=(s=l[n])&&s.prototype)&&(S(r)[O]=s);if(!N||!c(T)||T===Function.prototype){T=function TypedArray(){throw D("Incorrect invocation")};if(N)for(n in G)l[n]&&b(l[n],T)}if(!N||!k||k===I){k=T.prototype;if(N)for(n in G)l[n]&&b(l[n].prototype,k)}N&&_(M)!==k&&b(M,k);if(o&&!h(k,R)){B=!0;m(k,R,{get:function(){return d(this)?this[L]:void 0}});for(n in G)l[n]&&g(l[n],L,n)}e.exports={NATIVE_ARRAY_BUFFER_VIEWS:N,TYPED_ARRAY_TAG:B&&L,aTypedArray:function(e){if(isTypedArray(e))return e;throw D("Target is not a typed array")},aTypedArrayConstructor:function(e){if(c(e)&&(!b||v(T,e)))return e;throw D(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,i,n){if(o){if(i)for(var s in G){var r=l[s];if(r&&h(r.prototype,e))try{delete r.prototype[e]}catch(i){try{r.prototype[e]=t}catch(e){}}}k[e]&&!i||f(k,e,i?t:N&&x[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,i){var n,s;if(o){if(b){if(i)for(n in G)if((s=l[n])&&h(s,e))try{delete s[e]}catch(e){}if(T[e]&&!i)return;try{return f(T,e,i?t:N&&T[e]||t)}catch(e){}}for(n in G)!(s=l[n])||s[e]&&!i||f(s,e,t)}},getTypedArrayConstructor:getTypedArrayConstructor,isView:function isView(e){if(!d(e))return!1;var t=u(e);return"DataView"===t||h(G,t)||h(V,t)},isTypedArray:isTypedArray,TypedArray:T,TypedArrayPrototype:k}},e=>{e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(e,t,i)=>{var n=i(82),s=i(23),r=i(17),a=i(36)("toStringTag"),o=Object,l="Arguments"==r(function(){return arguments}());e.exports=n?r: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=o(e),a))?i:l?r(t):"Object"==(n=r(t))&&s(t.callee)?"Arguments":n}},(e,t,i)=>{var n={};n[i(36)("toStringTag")]="z";e.exports="[object z]"===String(n)},(e,t,i)=>{var n=i(41),s=i(23),r=i(42),a=i(56),o=i(84),l=a("IE_PROTO"),c=Object,d=c.prototype;e.exports=o?c.getPrototypeOf:function(e){var t=r(e);if(n(t,l))return t[l];var i=t.constructor;return s(i)&&t instanceof i?i.prototype:t instanceof c?d:null}},(e,t,i)=>{var n=i(9);e.exports=!n((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(e,t,i)=>{var n=i(16),s=i(49),r=i(86);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){s(i);r(n);t?e(i,n):i.__proto__=n;return i}}():void 0)},(e,t,i)=>{var n=i(23),s=String,r=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw r("Can't set "+s(e)+" as a prototype")}},(e,t,i)=>{i(88);i(95);i(97);i(120);i(122);var n=i(133);e.exports=n.structuredClone},(e,t,i)=>{"use strict";var n=i(14),s=i(71),r=i(89),a=i(54),o=i(47).f,l=i(90),c=i(94),d=i(38),h=i(8),u="Array Iterator",p=a.set,g=a.getterFor(u);e.exports=l(Array,"Array",(function(e,t){p(this,{type:u,target:n(e),index:0,kind:t})}),(function(){var e=g(this),t=e.target,i=e.kind,n=e.index++;if(!t||n>=t.length){e.target=void 0;return c(void 0,!0)}return c("keys"==i?n:"values"==i?t[n]:[n,t[n]],!1)}),"values");var f=r.Arguments=r.Array;s("keys");s("values");s("entries");if(!d&&h&&"values"!==f.name)try{o(f,"name",{value:"values"})}catch(e){}},e=>{e.exports={}},(e,t,i)=>{"use strict";var n=i(5),s=i(10),r=i(38),a=i(52),o=i(23),l=i(91),c=i(83),d=i(85),h=i(93),u=i(46),p=i(50),g=i(36),f=i(89),m=i(92),v=a.PROPER,_=a.CONFIGURABLE,b=m.IteratorPrototype,w=m.BUGGY_SAFARI_ITERATORS,y=g("iterator"),P="keys",S="values",A="entries",returnThis=function(){return this};e.exports=function(e,t,i,a,g,m,E){l(i,t,a);var x,C,M,getIterationMethod=function(e){if(e===g&&R)return R;if(!w&&e in I)return I[e];switch(e){case P:return function keys(){return new i(this,e)};case S:return function values(){return new i(this,e)};case A:return function entries(){return new i(this,e)}}return function(){return new i(this)}},T=t+" Iterator",k=!1,I=e.prototype,D=I[y]||I["@@iterator"]||g&&I[g],R=!w&&D||getIterationMethod(g),L="Array"==t&&I.entries||D;if(L&&(x=c(L.call(new e)))!==Object.prototype&&x.next){r||c(x)===b||(d?d(x,b):o(x[y])||p(x,y,returnThis));h(x,T,!0,!0);r&&(f[T]=returnThis)}if(v&&g==S&&D&&D.name!==S)if(!r&&_)u(I,"name",S);else{k=!0;R=function values(){return s(D,this)}}if(g){C={values:getIterationMethod(S),keys:m?R:getIterationMethod(P),entries:getIterationMethod(A)};if(E)for(M in C)(w||k||!(M in I))&&p(I,M,C[M]);else n({target:t,proto:!0,forced:w||k},C)}r&&!E||I[y]===R||p(I,y,R,{name:g});f[t]=R;return C}},(e,t,i)=>{"use strict";var n=i(92).IteratorPrototype,s=i(72),r=i(13),a=i(93),o=i(89),returnThis=function(){return this};e.exports=function(e,t,i,l){var c=t+" Iterator";e.prototype=s(n,{next:r(+!l,i)});a(e,c,!1,!0);o[c]=returnThis;return e}},(e,t,i)=>{"use strict";var n,s,r,a=i(9),o=i(23),l=i(22),c=i(72),d=i(83),h=i(50),u=i(36),p=i(38),g=u("iterator"),f=!1;[].keys&&("next"in(r=[].keys())?(s=d(d(r)))!==Object.prototype&&(n=s):f=!0);!l(n)||a((function(){var e={};return n[g].call(e)!==e}))?n={}:p&&(n=c(n));o(n[g])||h(n,g,(function(){return this}));e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:f}},(e,t,i)=>{var n=i(47).f,s=i(41),r=i(36)("toStringTag");e.exports=function(e,t,i){e&&!i&&(e=e.prototype);e&&!s(e,r)&&n(e,r,{configurable:!0,value:t})}},e=>{e.exports=function(e,t){return{value:e,done:t}}},(e,t,i)=>{var n=i(82),s=i(50),r=i(96);n||s(Object.prototype,"toString",r,{unsafe:!0})},(e,t,i)=>{"use strict";var n=i(82),s=i(81);e.exports=n?{}.toString:function toString(){return"[object "+s(this)+"]"}},(e,t,i)=>{i(98)},(e,t,i)=>{"use strict";i(99)("Map",(function(e){return function Map(){return e(this,arguments.length?arguments[0]:void 0)}}),i(117))},(e,t,i)=>{"use strict";var n=i(5),s=i(6),r=i(16),a=i(70),o=i(50),l=i(100),c=i(107),d=i(114),h=i(23),u=i(19),p=i(22),g=i(9),f=i(115),m=i(93),v=i(116);e.exports=function(e,t,i){var _=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),w=_?"set":"add",y=s[e],P=y&&y.prototype,S=y,A={},fixMethod=function(e){var t=r(P[e]);o(P,e,"add"==e?function add(e){t(this,0===e?0:e);return this}:"delete"==e?function(e){return!(b&&!p(e))&&t(this,0===e?0:e)}:"get"==e?function get(e){return b&&!p(e)?void 0:t(this,0===e?0:e)}:"has"==e?function has(e){return!(b&&!p(e))&&t(this,0===e?0:e)}:function set(e,i){t(this,0===e?0:e,i);return this})};if(a(e,!h(y)||!(b||P.forEach&&!g((function(){(new y).entries().next()}))))){S=i.getConstructor(t,e,_,w);l.enable()}else if(a(e,!0)){var E=new S,x=E[w](b?{}:-0,1)!=E,C=g((function(){E.has(1)})),M=f((function(e){new y(e)})),T=!b&&g((function(){for(var e=new y,t=5;t--;)e[w](t,t);return!e.has(-0)}));if(!M){(S=t((function(e,t){d(e,P);var i=v(new y,e,S);u(t)||c(t,i[w],{that:i,AS_ENTRIES:_});return i}))).prototype=P;P.constructor=S}if(C||T){fixMethod("delete");fixMethod("has");_&&fixMethod("get")}(T||x)&&fixMethod(w);b&&P.clear&&delete P.clear}A[e]=S;n({global:!0,constructor:!0,forced:S!=y},A);m(S,e);b||i.setStrong(S,e,_);return S}},(e,t,i)=>{var n=i(5),s=i(16),r=i(57),a=i(22),o=i(41),l=i(47).f,c=i(60),d=i(101),h=i(104),u=i(43),p=i(106),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=s([].splice),i={};i[f]=1;if(e(i).length){c.f=function(i){for(var n=e(i),s=0,r=n.length;s<r;s++)if(n[s]===f){t(n,s,1);break}return n};n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:d.f})}},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,f)){if(!h(e))return"F";if(!t)return"E";setMetadata(e)}return e[f].objectID},getWeakData:function(e,t){if(!o(e,f)){if(!h(e))return!0;if(!t)return!1;setMetadata(e)}return e[f].weakData},onFreeze:function(e){p&&g&&h(e)&&!o(e,f)&&setMetadata(e);return e}};r[f]=!0},(e,t,i)=>{var n=i(17),s=i(14),r=i(60).f,a=i(102),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function getOwnPropertyNames(e){return o&&"Window"==n(e)?function(e){try{return r(e)}catch(e){return a(o)}}(e):r(s(e))}},(e,t,i)=>{var n=i(63),s=i(66),r=i(103),a=Array,o=Math.max;e.exports=function(e,t,i){for(var l=s(e),c=n(t,l),d=n(void 0===i?l:i,l),h=a(o(d-c,0)),u=0;c<d;c++,u++)r(h,u,e[c]);h.length=u;return h}},(e,t,i)=>{"use strict";var n=i(20),s=i(47),r=i(13);e.exports=function(e,t,i){var a=n(t);a in e?s.f(e,a,r(0,i)):e[a]=i}},(e,t,i)=>{var n=i(9),s=i(22),r=i(17),a=i(105),o=Object.isExtensible,l=n((function(){o(1)}));e.exports=l||a?function isExtensible(e){return!!s(e)&&((!a||"ArrayBuffer"!=r(e))&&(!o||o(e)))}:o},(e,t,i)=>{var n=i(9);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(9);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},(e,t,i)=>{var n=i(108),s=i(10),r=i(49),a=i(34),o=i(110),l=i(66),c=i(27),d=i(111),h=i(112),u=i(113),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,_,b,w,y,P=i&&i.that,S=!(!i||!i.AS_ENTRIES),A=!(!i||!i.IS_RECORD),E=!(!i||!i.IS_ITERATOR),x=!(!i||!i.INTERRUPTED),C=n(t,P),stop=function(e){f&&u(f,"normal",e);return new Result(!0,e)},callFn=function(e){if(S){r(e);return x?C(e[0],e[1],stop):C(e[0],e[1])}return x?C(e,stop):C(e)};if(A)f=e.iterator;else if(E)f=e;else{if(!(m=h(e)))throw p(a(e)+" is not iterable");if(o(m)){for(v=0,_=l(e);_>v;v++)if((b=callFn(e[v]))&&c(g,b))return b;return new Result(!1)}f=d(e,m)}w=A?e.next:f.next;for(;!(y=s(w,f)).done;){try{b=callFn(y.value)}catch(e){u(f,"throw",e)}if("object"==typeof b&&b&&c(g,b))return b}return new Result(!1)}},(e,t,i)=>{var n=i(109),s=i(33),r=i(11),a=n(n.bind);e.exports=function(e,t){s(e);return void 0===t?e:r?a(e,t):function(){return e.apply(t,arguments)}}},(e,t,i)=>{var n=i(17),s=i(16);e.exports=function(e){if("Function"===n(e))return s(e)}},(e,t,i)=>{var n=i(36),s=i(89),r=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(s.Array===e||a[r]===e)}},(e,t,i)=>{var n=i(10),s=i(33),r=i(49),a=i(34),o=i(112),l=TypeError;e.exports=function(e,t){var i=arguments.length<2?o(e):t;if(s(i))return r(n(i,e));throw l(a(e)+" is not iterable")}},(e,t,i)=>{var n=i(81),s=i(32),r=i(19),a=i(89),o=i(36)("iterator");e.exports=function(e){if(!r(e))return s(e,o)||s(e,"@@iterator")||a[n(e)]}},(e,t,i)=>{var n=i(10),s=i(49),r=i(32);e.exports=function(e,t,i){var a,o;s(e);try{if(!(a=r(e,"return"))){if("throw"===t)throw i;return i}a=n(a,e)}catch(e){o=!0;a=e}if("throw"===t)throw i;if(o)throw a;s(a);return i}},(e,t,i)=>{var n=i(27),s=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw s("Incorrect invocation")}},(e,t,i)=>{var n=i(36)("iterator"),s=!1;try{var r=0,a={next:function(){return{done:!!r++}},return:function(){s=!0}};a[n]=function(){return this};Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!s)return!1;var i=!1;try{var r={};r[n]=function(){return{next:function(){return{done:i=!0}}}};e(r)}catch(e){}return i}},(e,t,i)=>{var n=i(23),s=i(22),r=i(85);e.exports=function(e,t,i){var a,o;r&&n(a=t.constructor)&&a!==i&&s(o=a.prototype)&&o!==i.prototype&&r(e,o);return e}},(e,t,i)=>{"use strict";var n=i(47).f,s=i(72),r=i(118),a=i(108),o=i(114),l=i(19),c=i(107),d=i(90),h=i(94),u=i(119),p=i(8),g=i(100).fastKey,f=i(54),m=f.set,v=f.getterFor;e.exports={getConstructor:function(e,t,i,d){var h=e((function(e,n){o(e,u);m(e,{type:t,index:s(null),first:void 0,last:void 0,size:0});p||(e.size=0);l(n)||c(n,e[d],{that:e,AS_ENTRIES:i})})),u=h.prototype,f=v(t),define=function(e,t,i){var n,s,r=f(e),a=getEntry(e,t);if(a)a.value=i;else{r.last=a={index:s=g(t,!0),key:t,value:i,previous:n=r.last,next:void 0,removed:!1};r.first||(r.first=a);n&&(n.next=a);p?r.size++:e.size++;"F"!==s&&(r.index[s]=a)}return e},getEntry=function(e,t){var i,n=f(e),s=g(t);if("F"!==s)return n.index[s];for(i=n.first;i;i=i.next)if(i.key==t)return i};r(u,{clear:function clear(){for(var e=f(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;p?e.size=0:this.size=0},delete:function(e){var t=this,i=f(t),n=getEntry(t,e);if(n){var s=n.next,r=n.previous;delete i.index[n.index];n.removed=!0;r&&(r.next=s);s&&(s.previous=r);i.first==n&&(i.first=s);i.last==n&&(i.last=r);p?i.size--:t.size--}return!!n},forEach:function forEach(e){for(var t,i=f(this),n=a(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)}});r(u,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)}});p&&n(u,"size",{get:function(){return f(this).size}});return h},setStrong:function(e,t,i){var n=t+" Iterator",s=v(t),r=v(n);d(e,t,(function(e,t){m(this,{type:n,target:e,state:s(e),kind:t,last:void 0})}),(function(){for(var e=r(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 h(void 0,!0)}return h("keys"==t?i.key:"values"==t?i.value:[i.key,i.value],!1)}),i?"entries":"values",!i,!0);u(t)}}},(e,t,i)=>{var n=i(50);e.exports=function(e,t,i){for(var s in t)n(e,s,t[s],i);return e}},(e,t,i)=>{"use strict";var n=i(26),s=i(47),r=i(36),a=i(8),o=r("species");e.exports=function(e){var t=n(e),i=s.f;a&&t&&!t[o]&&i(t,o,{configurable:!0,get:function(){return this}})}},(e,t,i)=>{i(121)},(e,t,i)=>{"use strict";i(99)("Set",(function(e){return function Set(){return e(this,arguments.length?arguments[0]:void 0)}}),i(117))},(e,t,i)=>{var n,s=i(38),r=i(5),a=i(6),o=i(26),l=i(16),c=i(9),d=i(43),h=i(23),u=i(123),p=i(19),g=i(22),f=i(25),m=i(107),v=i(49),_=i(81),b=i(41),w=i(103),y=i(46),P=i(66),S=i(124),A=i(125),E=i(127),x=i(128),C=i(129),M=i(30),T=i(130),k=i(131),I=i(132),D=a.Object,R=a.Array,L=a.Date,O=a.Error,N=a.EvalError,B=a.RangeError,G=a.ReferenceError,V=a.SyntaxError,W=a.TypeError,U=a.URIError,j=a.PerformanceMark,H=a.WebAssembly,z=H&&H.CompileError||O,q=H&&H.LinkError||O,$=H&&H.RuntimeError||O,X=o("DOMException"),K=E.Map,Y=E.has,Q=E.get,Z=E.set,J=x.Set,ee=x.add,te=o("Object","keys"),ie=l([].push),ne=l((!0).valueOf),se=l(1..valueOf),re=l("".valueOf),ae=l(L.prototype.getTime),oe=d("structuredClone"),le="DataCloneError",ce="Transferring",checkBasicSemantic=function(e){return!c((function(){var t=new a.Set([7]),i=e(t),n=e(D(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)}))},de=a.structuredClone,he=s||!checkErrorsCloning(de,O)||!checkErrorsCloning(de,X)||!(n=de,!c((function(){var e=n(new a.AggregateError([1],oe,{cause:3}));return"AggregateError"!=e.name||1!=e.errors[0]||e.message!=oe||3!=e.cause}))),ue=!de&&checkBasicSemantic((function(e){return new j(oe,{detail:e}).detail})),pe=checkBasicSemantic(de)||ue,throwUncloneable=function(e){throw new X("Uncloneable type: "+e,le)},throwUnpolyfillable=function(e,t){throw new X((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",le)},structuredCloneInternal=function(e,t){f(e)&&throwUncloneable("Symbol");if(!g(e))return e;if(t){if(Y(t,e))return Q(t,e)}else t=new K;var i,n,s,r,l,c,d,u,p,m,v=_(e),S=!1;switch(v){case"Array":s=R(P(e));S=!0;break;case"Object":s={};S=!0;break;case"Map":s=new K;S=!0;break;case"Set":s=new J;S=!0;break;case"RegExp":s=new RegExp(e.source,A(e));break;case"Error":switch(n=e.name){case"AggregateError":s=o("AggregateError")([]);break;case"EvalError":s=N();break;case"RangeError":s=B();break;case"ReferenceError":s=G();break;case"SyntaxError":s=V();break;case"TypeError":s=W();break;case"URIError":s=U();break;case"CompileError":s=z();break;case"LinkError":s=q();break;case"RuntimeError":s=$();break;default:s=O()}S=!0;break;case"DOMException":s=new X(e.message,e.name);S=!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=a[v];g(i)||throwUnpolyfillable(v);s=new i(structuredCloneInternal(e.buffer,t),e.byteOffset,"DataView"===v?e.byteLength:e.length);break;case"DOMQuad":try{s=new DOMQuad(structuredCloneInternal(e.p1,t),structuredCloneInternal(e.p2,t),structuredCloneInternal(e.p3,t),structuredCloneInternal(e.p4,t))}catch(t){pe?s=pe(e):throwUnpolyfillable(v)}break;case"FileList":if(r=function(){var e;try{e=new a.DataTransfer}catch(t){try{e=new a.ClipboardEvent("").clipboardData}catch(e){}}return e&&e.items&&e.files?e:null}()){for(l=0,c=P(e);l<c;l++)r.items.add(structuredCloneInternal(e[l],t));s=r.files}else pe?s=pe(e):throwUnpolyfillable(v);break;case"ImageData":try{s=new ImageData(structuredCloneInternal(e.data,t),e.width,e.height,{colorSpace:e.colorSpace})}catch(t){pe?s=pe(e):throwUnpolyfillable(v)}break;default:if(pe)s=pe(e);else switch(v){case"BigInt":s=D(e.valueOf());break;case"Boolean":s=D(ne(e));break;case"Number":s=D(se(e));break;case"String":s=D(re(e));break;case"Date":s=new L(ae(e));break;case"ArrayBuffer":(i=a.DataView)||"function"==typeof e.slice||throwUnpolyfillable(v);try{if("function"==typeof e.slice)s=e.slice(0);else{c=e.byteLength;s=new ArrayBuffer(c);p=new i(e);m=new i(s);for(l=0;l<c;l++)m.setUint8(l,p.getUint8(l))}}catch(e){throw new X("ArrayBuffer is detached",le)}break;case"SharedArrayBuffer":s=e;break;case"Blob":try{s=e.slice(0,e.size,e.type)}catch(e){throwUnpolyfillable(v)}break;case"DOMPoint":case"DOMPointReadOnly":i=a[v];try{s=i.fromPoint?i.fromPoint(e):new i(e.x,e.y,e.z,e.w)}catch(e){throwUnpolyfillable(v)}break;case"DOMRect":case"DOMRectReadOnly":i=a[v];try{s=i.fromRect?i.fromRect(e):new i(e.x,e.y,e.width,e.height)}catch(e){throwUnpolyfillable(v)}break;case"DOMMatrix":case"DOMMatrixReadOnly":i=a[v];try{s=i.fromMatrix?i.fromMatrix(e):new i(e)}catch(e){throwUnpolyfillable(v)}break;case"AudioData":case"VideoFrame":h(e.clone)||throwUnpolyfillable(v);try{s=e.clone()}catch(e){throwUncloneable(v)}break;case"File":try{s=new File([e],e.name,e)}catch(e){throwUnpolyfillable(v)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":throwUnpolyfillable(v);default:throwUncloneable(v)}}Z(t,e,s);if(S)switch(v){case"Array":case"Object":d=te(e);for(l=0,c=P(d);l<c;l++){u=d[l];w(s,u,structuredCloneInternal(e[u],t))}break;case"Map":e.forEach((function(e,i){Z(s,structuredCloneInternal(i,t),structuredCloneInternal(e,t))}));break;case"Set":e.forEach((function(e){ee(s,structuredCloneInternal(e,t))}));break;case"Error":y(s,"message",structuredCloneInternal(e.message,t));b(e,"cause")&&y(s,"cause",structuredCloneInternal(e.cause,t));"AggregateError"==n&&(s.errors=structuredCloneInternal(e.errors,t));case"DOMException":C&&y(s,"stack",structuredCloneInternal(e.stack,t))}return s},ge=de&&!c((function(){if(k&&M>92||I&&M>94||T&&M>97)return!1;var e=new ArrayBuffer(8),t=de(e,{transfer:[e]});return 0!=e.byteLength||8!=t.byteLength})),tryToTransfer=function(e,t){if(!g(e))throw W("Transfer option cannot be converted to a sequence");var i=[];m(e,(function(e){ie(i,v(e))}));var n,s,r,o,l,c,d=0,p=P(i);if(ge){o=de(i,{transfer:i});for(;d<p;)Z(t,i[d],o[d++])}else for(;d<p;){n=i[d++];if(Y(t,n))throw new X("Duplicate transferable",le);switch(s=_(n)){case"ImageBitmap":r=a.OffscreenCanvas;u(r)||throwUnpolyfillable(s,ce);try{(c=new r(n.width,n.height)).getContext("bitmaprenderer").transferFromImageBitmap(n);l=c.transferToImageBitmap()}catch(e){}break;case"AudioData":case"VideoFrame":h(n.clone)&&h(n.close)||throwUnpolyfillable(s,ce);try{l=n.clone();n.close()}catch(e){}break;case"ArrayBuffer":case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":throwUnpolyfillable(s,ce)}if(void 0===l)throw new X("This object cannot be transferred: "+s,le);Z(t,n,l)}};r({global:!0,enumerable:!0,sham:!ge,forced:he},{structuredClone:function structuredClone(e){var t,i=S(arguments.length,1)>1&&!p(arguments[1])?v(arguments[1]):void 0,n=i?i.transfer:void 0;if(void 0!==n){t=new K;tryToTransfer(n,t)}return structuredCloneInternal(e,t)}})},(e,t,i)=>{var n=i(16),s=i(9),r=i(23),a=i(81),o=i(26),l=i(53),noop=function(){},c=[],d=o("Reflect","construct"),h=/^\s*(?:class|function)\b/,u=n(h.exec),p=!h.exec(noop),g=function isConstructor(e){if(!r(e))return!1;try{d(noop,c,e);return!0}catch(e){return!1}},f=function isConstructor(e){if(!r(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!u(h,l(e))}catch(e){return!0}};f.sham=!0;e.exports=!d||s((function(){var e;return g(g.call)||!g(Object)||!g((function(){e=!0}))||e}))?f:g},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(10),s=i(41),r=i(27),a=i(126),o=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in o||s(e,"flags")||!r(o,e)?t:n(a,e)}},(e,t,i)=>{"use strict";var n=i(49);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(16),s=Map.prototype;e.exports={Map:Map,set:n(s.set),get:n(s.get),has:n(s.has),remove:n(s.delete),proto:s}},(e,t,i)=>{var n=i(16),s=Set.prototype;e.exports={Set:Set,add:n(s.add),has:n(s.has),remove:n(s.delete),proto:s,$has:s.has,$keys:s.keys}},(e,t,i)=>{var n=i(9),s=i(13);e.exports=!n((function(){var e=Error("a");if(!("stack"in e))return!0;Object.defineProperty(e,"stack",s(1,7));return 7!==e.stack}))},(e,t,i)=>{var n=i(131),s=i(132);e.exports=!n&&!s&&"object"==typeof window&&"object"==typeof document},e=>{e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(e,t,i)=>{var n=i(17);e.exports="undefined"!=typeof process&&"process"==n(process)},(e,t,i)=>{var n=i(6);e.exports=n},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0;exports.getDocument=getDocument;exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(135),_display_utils=__w_pdfjs_require__(138),_font_loader=__w_pdfjs_require__(141),_canvas=__w_pdfjs_require__(143),_worker_options=__w_pdfjs_require__(146),_is_node=__w_pdfjs_require__(142),_message_handler=__w_pdfjs_require__(147),_metadata=__w_pdfjs_require__(148),_optional_content_config=__w_pdfjs_require__(149),_transport_stream=__w_pdfjs_require__(150),_xfa_text=__w_pdfjs_require__(151);function _classPrivateFieldSet(e,t,i){_classApplyDescriptorSet(e,_classExtractFieldDescriptor(e,t,"set"),i);return 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}}function _classPrivateFieldInitSpec(e,t,i){_checkPrivateRedeclaration(e,t);t.set(e,i)}function _classPrivateFieldGet(e,t){return _classApplyDescriptorGet(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 _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 _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}function _classStaticPrivateFieldSpecGet(e,t,i){_classCheckPrivateStaticAccess(e,t);_classCheckPrivateStaticFieldDescriptor(i,"get");return _classApplyDescriptorGet(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")}function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,ServiceWorkerOptions={showUnverifiedSignatures:!1};window.ServiceWorkerOptions=ServiceWorkerOptions;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory,createPDFNetworkStream;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;if(_is_node.isNodeJS){const{NodeCanvasFactory:e,NodeCMapReaderFactory:t,NodeStandardFontDataFactory:i}=__w_pdfjs_require__(152);exports.DefaultCanvasFactory=DefaultCanvasFactory=e;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=t;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=i}if(_is_node.isNodeJS){const{PDFNodeStream:e}=__w_pdfjs_require__(153);createPDFNetworkStream=t=>new e(t)}else{const{PDFNetworkStream:e}=__w_pdfjs_require__(156),{PDFFetchStream:t}=__w_pdfjs_require__(157);createPDFNetworkStream=i=>(0,_display_utils.isValidFetchUrl)(i.url)?new t(i):new e(i)}function getDocument(e){if("string"==typeof e||e instanceof URL)e={url:e};else if((0,_util.isArrayBuffer)(e))e={data:e};else if(e instanceof PDFDataRangeTransport){(0,_display_utils.deprecated)("`PDFDataRangeTransport`-instance, please use a parameter object with `range`-property instead.");e={range:e}}else if("object"!=typeof e)throw new Error("Invalid parameter in getDocument, need either string, URL, TypedArray, or parameter object.");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const t=new PDFDocumentLoadingTask,i=e.url?getUrlProp(e.url,e.baseHref):null,n=e.data?getDataProp(e.data):null,s=e.httpHeaders||null,r=!0===e.withCredentials,a=e.password??null,o=e.range instanceof PDFDataRangeTransport?e.range:null,l=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let c=e.worker instanceof PDFWorker?e.worker:null;const d=e.verbosity,h="string"!=typeof e.docBaseUrl||(0,_display_utils.isDataScheme)(e.docBaseUrl)?null:e.docBaseUrl,u="function"==typeof e.cMapUrl?e.cMapUrl():"string"==typeof e.cMapUrl?e.cMapUrl:null,p=!1!==e.cMapPacked,g=e.CMapReaderFactory||DefaultCMapReaderFactory,f="function"==typeof e.standardFontDataUrl?e.standardFontDataUrl():"string"==typeof e.standardFontDataUrl?e.standardFontDataUrl:null,m=e.StandardFontDataFactory||DefaultStandardFontDataFactory,v=!0!==e.stopAtErrors,_=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,b=!1!==e.isEvalSupported,w="boolean"==typeof e.isOffscreenCanvasSupported?e.isOffscreenCanvasSupported:!_is_node.isNodeJS,y="boolean"==typeof e.disableFontFace?e.disableFontFace:_is_node.isNodeJS,P=!0===e.fontExtraProperties,S=!0===e.enableXfa,A=e.ownerDocument||globalThis.document,E=!0===e.disableRange,x=!0===e.disableStream,C=!0===e.disableAutoFetch,M=!0===e.pdfBug,T=o?o.length:e.length??NaN,k="boolean"==typeof e.useSystemFonts?e.useSystemFonts:!_is_node.isNodeJS&&!y,I="boolean"==typeof e.useWorkerFetch?e.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&m===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(u,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(f,document.baseURI);(0,_util.setVerbosityLevel)(d);const D=I?null:{cMapReaderFactory:new g({baseUrl:u,isCompressed:p}),standardFontDataFactory:new m({baseUrl:f})};if(!c){const e={verbosity:d,port:_worker_options.GlobalWorkerOptions.workerPort};c=e.port?PDFWorker.fromPort(e):new PDFWorker(e);t._worker=c}const R=t.docId,L={docId:R,apiVersion:"3.4.493",data:n,password:a,disableAutoFetch:C,rangeChunkSize:l,length:T,docBaseUrl:h,enableXfa:S,evaluatorOptions:{maxImageSize:_,disableFontFace:y,ignoreErrors:v,isEvalSupported:b,isOffscreenCanvasSupported:w,fontExtraProperties:P,useSystemFonts:k,cMapUrl:I?u:null,standardFontDataUrl:I?f:null}},O={ignoreErrors:v,isEvalSupported:b,disableFontFace:y,fontExtraProperties:P,enableXfa:S,ownerDocument:A,disableAutoFetch:C,pdfBug:M,styleElement:null};c.promise.then((function(){if(t.destroyed)throw new Error("Loading aborted");const e=_fetchDocument(c,L),a=new Promise((function(e){let t;o?t=new _transport_stream.PDFDataTransportStream({length:T,initialData:o.initialData,progressiveDone:o.progressiveDone,contentDispositionFilename:o.contentDispositionFilename,disableRange:E,disableStream:x},o):n||(t=createPDFNetworkStream({url:i,length:T,httpHeaders:s,withCredentials:r,rangeChunkSize:l,disableRange:E,disableStream:x}));e(t)}));return Promise.all([e,a]).then((function(e){let[i,n]=e;if(t.destroyed)throw new Error("Loading aborted");const s=new _message_handler.MessageHandler(R,i,c.port),r=new WorkerTransport(s,t,n,O,D);t._transport=r;s.send("showUnverifiedSignatures",window.ServiceWorkerOptions.showUnverifiedSignatures);s.send("Ready",null)}))})).catch(t._capability.reject);return t}async function _fetchDocument(e,t){if(e.destroyed)throw new Error("Worker was destroyed");const i=await e.messageHandler.sendWithPromise("GetDocRequest",t,t.data?[t.data.buffer]:null);if(e.destroyed)throw new Error("Worker was destroyed");return i}function getUrlProp(e,t){if(e instanceof URL)return e.href;try{return t?new URL(e,window.location.origin+t).href:new URL(e,window.location).href}catch(t){if(_is_node.isNodeJS&&"string"==typeof e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(e){if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&e instanceof Buffer){(0,_display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`.");return new Uint8Array(e)}if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if("string"==typeof e)return(0,_util.stringToBytes)(e);if("object"==typeof e&&!isNaN(null==e?void 0:e.length)||(0,_util.isArrayBuffer)(e))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}class PDFDocumentLoadingTask{static#e=0;#t=null;constructor(){this._capability=(0,_util.createPromiseCapability)();this._transport=null;this._worker=null;this.docId="d"+PDFDocumentLoadingTask.#e++;this.destroyed=!1;this.onPassword=null;this.onProgress=null}get onUnsupportedFeature(){return this.#t}set onUnsupportedFeature(e){(0,_display_utils.deprecated)("The PDFDocumentLoadingTask onUnsupportedFeature property will be removed in the future.");this.#t=e}get promise(){return this._capability.promise}async destroy(){var e;this.destroyed=!0;await(null===(e=this._transport)||void 0===e?void 0:e.destroy());this._transport=null;if(this._worker){this._worker.destroy();this._worker=null}}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=e;this.initialData=t;this.progressiveDone=i;this.contentDispositionFilename=n;this._rangeListeners=[];this._progressListeners=[];this._progressiveReadListeners=[];this._progressiveDoneListeners=[];this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const i of this._rangeListeners)i(e,t)}onDataProgress(e,t){this._readyCapability.promise.then((()=>{for(const i of this._progressListeners)i(e,t)}))}onDataProgressiveRead(e){this._readyCapability.promise.then((()=>{for(const t of this._progressiveReadListeners)t(e)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const e of this._progressiveDoneListeners)e()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,t){this._pdfInfo=e;this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(e,t,i,n){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this._pageIndex=e;this._pageInfo=t;this._ownerDocument=n;this._transport=i;this._stats=s?new _display_utils.StatTimer:null;this._pdfBug=s;this.commonObjs=i.commonObjs;this.objs=new PDFObjects;this.cleanupAfterRender=!1;this.pendingCleanup=!1;this._intentStates=new Map;this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:e,rotation:t=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:i,offsetY:n,dontFlip:s})}getAnnotations(){let{intent:e="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var e;return(null===(e=this._transport._htmlForXfa)||void 0===e?void 0:e.children[this._pageIndex])||null}render(e){var t,i;let{canvasContext:n,viewport:s,intent:r="display",annotationMode:a=_util.AnnotationMode.ENABLE,transform:o=null,canvasFactory:l=null,background:c=null,backgroundColorToReplace:d=null,optionalContentConfigPromise:h=null,annotationCanvasMap:u=null,pageColors:p=null,printAnnotationStorage:g=null}=e;null===(t=this._stats)||void 0===t||t.time("Overall");const f=this._transport.getRenderingIntent(r,a,g);this.pendingCleanup=!1;h||(h=this._transport.getOptionalContentConfig());let m=this._intentStates.get(f.cacheKey);if(!m){m=Object.create(null);this._intentStates.set(f.cacheKey,m)}if(m.streamReaderCancelTimeout){clearTimeout(m.streamReaderCancelTimeout);m.streamReaderCancelTimeout=null}const v=l||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),_=!!(f.renderingIntent&_util.RenderingIntentFlag.PRINT);if(!m.displayReadyCapability){var b;m.displayReadyCapability=(0,_util.createPromiseCapability)();m.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};null===(b=this._stats)||void 0===b||b.time("Page Request");this._pumpOperatorList(f)}const complete=e=>{var t,i;m.renderTasks.delete(w);(this.cleanupAfterRender||_)&&(this.pendingCleanup=!0);this._tryCleanup();if(e){w.capability.reject(e);this._abortOperatorList({intentState:m,reason:e instanceof Error?e:new Error(e)})}else w.capability.resolve();null===(t=this._stats)||void 0===t||t.timeEnd("Rendering");null===(i=this._stats)||void 0===i||i.timeEnd("Overall")},w=new InternalRenderTask({callback:complete,params:{canvasContext:n,viewport:s,transform:o,background:c,backgroundColorToReplace:d},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:u,operatorList:m.operatorList,pageIndex:this._pageIndex,canvasFactory:v,useRequestAnimationFrame:!_,pdfBug:this._pdfBug,pageColors:p});((i=m).renderTasks||(i.renderTasks=new Set)).add(w);const y=w.task;Promise.all([m.displayReadyCapability.promise,h]).then((e=>{var t;let[i,n]=e;if(this.pendingCleanup)complete();else{null===(t=this._stats)||void 0===t||t.time("Rendering");w.initializeGraphics({transparency:i,optionalContentConfig:n});w.operatorListChanged()}})).catch(complete);return y}getOperatorList(){let{intent:e="display",annotationMode:t=_util.AnnotationMode.ENABLE,printAnnotationStorage:i=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=this._transport.getRenderingIntent(e,t,i,!0);let s,r=this._intentStates.get(n.cacheKey);if(!r){r=Object.create(null);this._intentStates.set(n.cacheKey,r)}if(!r.opListReadCapability){var a,o;s=Object.create(null);s.operatorListChanged=function operatorListChanged(){if(r.operatorList.lastChunk){r.opListReadCapability.resolve(r.operatorList);r.renderTasks.delete(s)}};r.opListReadCapability=(0,_util.createPromiseCapability)();((a=r).renderTasks||(a.renderTasks=new Set)).add(s);r.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};null===(o=this._stats)||void 0===o||o.time("Page Request");this._pumpOperatorList(n)}return r.opListReadCapability.promise}streamTextContent(){let{disableCombineTextItems:e=!1,includeMarkedContent:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:!0!==e,includeMarkedContent:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((e=>_xfa_text.XfaText.textContent(e)));const t=this.streamTextContent(e);return new Promise((function(e,i){const n=t.getReader(),s={items:[],styles:Object.create(null)};!function pump(){n.read().then((function(t){let{value:i,done:n}=t;if(n)e(s);else{Object.assign(s.styles,i.styles);s.items.push(...i.items);pump()}}),i)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values()){this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0});if(!t.opListReadCapability)for(const i of t.renderTasks){e.push(i.completed);i.cancel()}}this.objs.clear();this.pendingCleanup=!1;return Promise.all(e)}cleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.pendingCleanup=!0;this._tryCleanup(e)||(this.cleanupAfterRender=!0);return!0}_tryCleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.pendingCleanup)return!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;this._intentStates.clear();this.objs.clear();e&&this._stats&&(this._stats=new _display_utils.StatTimer);this.pendingCleanup=!1;return!0}_startRenderPage(e,t){var i,n;const s=this._intentStates.get(t);if(s){null===(i=this._stats)||void 0===i||i.timeEnd("Page Request");null===(n=s.displayReadyCapability)||void 0===n||n.resolve(e)}}_renderPageChunk(e,t){for(let i=0,n=e.length;i<n;i++){t.operatorList.fnArray.push(e.fnArray[i]);t.operatorList.argsArray.push(e.argsArray[i])}t.operatorList.lastChunk=e.lastChunk;t.operatorList.separateAnnots=e.separateAnnots;for(const e of t.renderTasks)e.operatorListChanged();e.lastChunk&&this._tryCleanup()}_pumpOperatorList(e){let{renderingIntent:t,cacheKey:i,annotationStorageMap:n}=e;const s=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:i,annotationStorage:n}).getReader(),r=this._intentStates.get(i);r.streamReader=s;const pump=()=>{s.read().then((e=>{let{value:t,done:i}=e;if(i)r.streamReader=null;else if(!this._transport.destroyed){this._renderPageChunk(t,r);pump()}}),(e=>{r.streamReader=null;if(!this._transport.destroyed){if(r.operatorList){r.operatorList.lastChunk=!0;for(const e of r.renderTasks)e.operatorListChanged();this._tryCleanup()}if(r.displayReadyCapability)r.displayReadyCapability.reject(e);else{if(!r.opListReadCapability)throw e;r.opListReadCapability.reject(e)}}}))};pump()}_abortOperatorList(e){let{intentState:t,reason:i,force:n=!1}=e;if(t.streamReader){if(t.streamReaderCancelTimeout){clearTimeout(t.streamReaderCancelTimeout);t.streamReaderCancelTimeout=null}if(!n){if(t.renderTasks.size>0)return;if(i instanceof _display_utils.RenderingCancelledException){let e=RENDERING_CANCELLED_TIMEOUT;i.extraDelay>0&&i.extraDelay<1e3&&(e+=i.extraDelay);t.streamReaderCancelTimeout=setTimeout((()=>{t.streamReaderCancelTimeout=null;this._abortOperatorList({intentState:t,reason:i,force:!0})}),e);return}}t.streamReader.cancel(new _util.AbortException(i.message)).catch((()=>{}));t.streamReader=null;if(!this._transport.destroyed){for(const[e,i]of this._intentStates)if(i===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#i=new Set;#n=Promise.resolve();postMessage(e,t){const i={data:structuredClone(e,t)};this.#n.then((()=>{for(const e of this.#i)e.call(this,i)}))}addEventListener(e,t){this.#i.add(t)}removeEventListener(e,t){this.#i.delete(t)}terminate(){this.#i.clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;if(_is_node.isNodeJS&&"function"==typeof require){PDFWorkerUtil.isWorkerDisabled=!0;PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js"}else if("object"==typeof document){var _document,_document$currentScri;const e=null===(_document=document)||void 0===_document||null===(_document$currentScri=_document.currentScript)||void 0===_document$currentScri?void 0:_document$currentScri.src;e&&(PDFWorkerUtil.fallbackWorkerSrc=e.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(e,t){let i;try{i=new URL(e);if(!i.origin||"null"===i.origin)return!1}catch(e){return!1}const n=new URL(t,i);return i.origin===n.origin};PDFWorkerUtil.createCDNWrapper=function(e){const t=`importScripts("${e}");`;return URL.createObjectURL(new Blob([t]))};var _generateTrustedURL=new WeakSet;class PDFWorker{constructor(){let{name:e=null,port:t=null,verbosity:i=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classPrivateMethodInitSpec(this,_generateTrustedURL);if(t&&_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).has(t))throw new Error("Cannot use more than one PDFWorker per port.");this.name=e;this.destroyed=!1;this.verbosity=i;this._readyCapability=(0,_util.createPromiseCapability)();this._port=null;this._webWorker=null;this._messageHandler=null;if(t){_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).set(t,this);this._initializeFromPort(t)}else this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e;this._messageHandler=new _message_handler.MessageHandler("main","worker",e);this._messageHandler.on("ready",(function(){}));this._readyCapability.resolve();this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:e}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,e)||(e=PDFWorkerUtil.createCDNWrapper(new URL(e,window.location).href));const t=new Worker(_classPrivateMethodGet(this,_generateTrustedURL,_generateTrustedURL2).call(this,e)),i=new _message_handler.MessageHandler("main","worker",t),terminateEarly=()=>{t.removeEventListener("error",onWorkerError);i.destroy();t.terminate();this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},onWorkerError=()=>{this._webWorker||terminateEarly()};t.addEventListener("error",onWorkerError);i.on("test",(e=>{t.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else if(e){this._messageHandler=i;this._port=t;this._webWorker=t;this._readyCapability.resolve();i.send("configure",{verbosity:this.verbosity})}else{this._setupFakeWorker();i.destroy();t.terminate()}}));i.on("ready",(e=>{t.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else try{sendTest()}catch(e){this._setupFakeWorker()}}));const sendTest=()=>{const e=new Uint8Array;i.send("test",e,[e.buffer])};sendTest();return}catch(e){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){if(!PDFWorkerUtil.isWorkerDisabled){(0,_util.warn)("Setting up fake worker.");PDFWorkerUtil.isWorkerDisabled=!0}PDFWorker._setupFakeWorkerGlobal.then((e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const t=new LoopbackPort;this._port=t;const i="fake"+PDFWorkerUtil.fakeWorkerId++,n=new _message_handler.MessageHandler(i+"_worker",i,t);e.setup(n,t);const s=new _message_handler.MessageHandler(i,i+"_worker",t);this._messageHandler=s;this._readyCapability.resolve();s.send("configure",{verbosity:this.verbosity})})).catch((e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))}))}destroy(){this.destroyed=!0;if(this._webWorker){this._webWorker.terminate();this._webWorker=null}_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).delete(this._port);this._port=null;if(this._messageHandler){this._messageHandler.destroy();this._messageHandler=null}}static fromPort(e){if(null==e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return _classStaticPrivateFieldSpecGet(this,PDFWorker,_workerPorts).has(e.port)?_classStaticPrivateFieldSpecGet(this,PDFWorker,_workerPorts).get(e.port):new PDFWorker(e)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return"Function"===_worker_options.GlobalWorkerOptions.workerSrc.constructor.name?_worker_options.GlobalWorkerOptions.workerSrc():_worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc){_is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.');return PDFWorkerUtil.fallbackWorkerSrc}throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch(e){return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&"function"==typeof require){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}await(0,_display_utils.loadScript)(this.workerSrc);return window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;function _generateTrustedURL2(e){if(window.trustedTypes){return window.trustedTypes.createPolicy("foo",{createScriptURL:e=>e}).createScriptURL(e)}return e}var _workerPorts={writable:!0,value:new WeakMap},_methodPromises=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_cacheSimpleMethod=new WeakSet;class WorkerTransport{constructor(e,t,i,n,s){_classPrivateMethodInitSpec(this,_cacheSimpleMethod);_classPrivateFieldInitSpec(this,_methodPromises,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,_pageCache,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,_pagePromises,{writable:!0,value:new Map});this.messageHandler=e;this.loadingTask=t;this.commonObjs=new PDFObjects;this.fontLoader=new _font_loader.FontLoader({onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:n.ownerDocument,styleElement:n.styleElement});this._params=n;this.cMapReaderFactory=null==s?void 0:s.cMapReaderFactory;this.standardFontDataFactory=null==s?void 0:s.standardFontDataFactory;this.destroyed=!1;this.destroyCapability=null;this._passwordCapability=null;this._networkStream=i;this._fullReader=null;this._lastProgress=null;this.downloadInfoCapability=(0,_util.createPromiseCapability)();this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=_util.RenderingIntentFlag.DISPLAY,r=null;switch(e){case"any":s=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":s=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${e}`)}switch(t){case _util.AnnotationMode.DISABLE:s+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:s+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:s+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE;r=(s&_util.RenderingIntentFlag.PRINT&&i instanceof _annotation_storage.PrintAnnotationStorage?i:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${t}`)}n&&(s+=_util.RenderingIntentFlag.OPLIST);return{renderingIntent:s,cacheKey:`${s}_${_annotation_storage.AnnotationStorage.getHash(r)}`,annotationStorageMap:r}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=(0,_util.createPromiseCapability)();this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const t of _classPrivateFieldGet(this,_pageCache).values())e.push(t._destroy());_classPrivateFieldGet(this,_pageCache).clear();_classPrivateFieldGet(this,_pagePromises).clear();this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);e.push(t);Promise.all(e).then((()=>{this.commonObjs.clear();this.fontLoader.clear();_classPrivateFieldGet(this,_methodPromises).clear();this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated."));if(this.messageHandler){this.messageHandler.destroy();this.messageHandler=null}this.destroyCapability.resolve()}),this.destroyCapability.reject);return this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available.");this._fullReader=this._networkStream.getFullReader();this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}};t.onPull=()=>{this._fullReader.read().then((function(e){let{value:i,done:n}=e;if(n)t.close();else{(0,_util.assert)(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer.");t.enqueue(new Uint8Array(i),1,[i])}})).catch((e=>{t.error(e)}))};t.onCancel=e=>{this._fullReader.cancel(e);t.ready.catch((e=>{if(!this.destroyed)throw e}))}}));e.on("ReaderHeadersReady",(e=>{const i=(0,_util.createPromiseCapability)(),n=this._fullReader;n.headersReady.then((()=>{if(!n.isStreamingSupported||!n.isRangeSupported){if(this._lastProgress){var e;null===(e=t.onProgress)||void 0===e||e.call(t,this._lastProgress)}n.onProgress=e=>{var i;null===(i=t.onProgress)||void 0===i||i.call(t,{loaded:e.loaded,total:e.total})}}i.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})}),i.reject);return i.promise}));e.on("GetRangeReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(e.begin,e.end);if(i){t.onPull=()=>{i.read().then((function(e){let{value:i,done:n}=e;if(n)t.close();else{(0,_util.assert)(i instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer.");t.enqueue(new Uint8Array(i),1,[i])}})).catch((e=>{t.error(e)}))};t.onCancel=e=>{i.cancel(e);t.ready.catch((e=>{if(!this.destroyed)throw e}))}}else t.close()}));e.on("GetDoc",(e=>{let{pdfInfo:i}=e;this._numPages=i.numPages;this._htmlForXfa=i.htmlForXfa;delete i.htmlForXfa;t._capability.resolve(new PDFDocumentProxy(i,this))}));e.on("DocException",(function(e){let i;switch(e.name){case"PasswordException":i=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":i=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":i=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":i=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":i=new _util.UnknownErrorException(e.message,e.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}t._capability.reject(i)}));e.on("PasswordRequest",(e=>{this._passwordCapability=(0,_util.createPromiseCapability)();if(t.onPassword){const updatePassword=e=>{e instanceof Error?this._passwordCapability.reject(e):this._passwordCapability.resolve({password:e})};try{t.onPassword(updatePassword,e.code)}catch(e){this._passwordCapability.reject(e)}}else this._passwordCapability.reject(new _util.PasswordException(e.message,e.code));return this._passwordCapability.promise}));e.on("DataLoaded",(e=>{var i;null===(i=t.onProgress)||void 0===i||i.call(t,{loaded:e.length,total:e.length});this.downloadInfoCapability.resolve(e)}));e.on("StartRenderPage",(e=>{if(this.destroyed)return;_classPrivateFieldGet(this,_pageCache).get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)}));e.on("commonobj",(t=>{var i;let[n,s,r]=t;if(!this.destroyed&&!this.commonObjs.has(n))switch(s){case"Font":const t=this._params;if("error"in r){const e=r.error;(0,_util.warn)(`Error during font loading: ${e}`);this.commonObjs.resolve(n,e);break}let a=null;t.pdfBug&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled&&(a={registerFont(e,t){globalThis.FontInspector.fontAdded(e,t)}});const o=new _font_loader.FontFaceObject(r,{isEvalSupported:t.isEvalSupported,disableFontFace:t.disableFontFace,ignoreErrors:t.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:a});this.fontLoader.bind(o).catch((t=>e.sendWithPromise("FontFallback",{id:n}))).finally((()=>{!t.fontExtraProperties&&o.data&&(o.data=null);this.commonObjs.resolve(n,o)}));break;case"FontPath":case"Image":this.commonObjs.resolve(n,r);break;default:throw new Error(`Got unknown common object type ${s}`)}}));e.on("obj",(e=>{let[t,i,n,s]=e;if(this.destroyed)return;const r=_classPrivateFieldGet(this,_pageCache).get(i);if(!r.objs.has(t))switch(n){case"Image":r.objs.resolve(t,s);const e=8e6;if(s){let t;if(s.bitmap){const{width:e,height:i}=s;t=e*i*4}else{var a;t=(null===(a=s.data)||void 0===a?void 0:a.length)||0}t>e&&(r.cleanupAfterRender=!0)}break;case"Pattern":r.objs.resolve(t,s);break;default:throw new Error(`Got unknown object type ${n}`)}}));e.on("DocProgress",(e=>{var i;this.destroyed||null===(i=t.onProgress)||void 0===i||i.call(t,{loaded:e.loaded,total:e.total})}));e.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this));e.on("FetchBuiltInCMap",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(e):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))));e.on("FetchStandardFontData",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(e):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}_onUnsupportedFeature(e){var t,i;let{featureId:n}=e;this.destroyed||null===(t=(i=this.loadingTask).onUnsupportedFeature)||void 0===t||t.call(i,n)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var e;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:(null===(e=this._fullReader)||void 0===e?void 0:e.filename)??null}).finally((()=>{this.annotationStorage.resetModified()}))}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,i=_classPrivateFieldGet(this,_pagePromises).get(t);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then((e=>{if(this.destroyed)throw new Error("Transport destroyed");const i=new PDFPageProxy(t,e,this,this._params.ownerDocument,this._params.pdfBug);_classPrivateFieldGet(this,_pageCache).set(t,i);return i}));_classPrivateFieldGet(this,_pagePromises).set(t,n);return n}getPageIndex(e){return"object"!=typeof e||null===e||!Number.isInteger(e.num)||e.num<0||!Number.isInteger(e.gen)||e.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen})}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return _classPrivateMethodGet(this,_cacheSimpleMethod,_cacheSimpleMethod2).call(this,"GetFieldObjects")}hasJSActions(){return _classPrivateMethodGet(this,_cacheSimpleMethod,_cacheSimpleMethod2).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!=typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((e=>new _optional_content_config.OptionalContentConfig(e)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=_classPrivateFieldGet(this,_methodPromises).get(e);if(t)return t;const i=this.messageHandler.sendWithPromise(e,null).then((e=>{var t,i;return{info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:(null===(t=this._fullReader)||void 0===t?void 0:t.filename)??null,contentLength:(null===(i=this._fullReader)||void 0===i?void 0:i.contentLength)??null}}));_classPrivateFieldGet(this,_methodPromises).set(e,i);return i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of _classPrivateFieldGet(this,_pageCache).values()){if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`)}this.commonObjs.clear();e||this.fontLoader.clear();_classPrivateFieldGet(this,_methodPromises).clear()}}get loadingParams(){const{disableAutoFetch:e,enableXfa:t}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e,enableXfa:t})}}function _cacheSimpleMethod2(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=_classPrivateFieldGet(this,_methodPromises).get(e);if(i)return i;const n=this.messageHandler.sendWithPromise(e,t);_classPrivateFieldGet(this,_methodPromises).set(e,n);return n}var _objs=new WeakMap,_ensureObj=new WeakSet;class PDFObjects{constructor(){_classPrivateMethodInitSpec(this,_ensureObj);_classPrivateFieldInitSpec(this,_objs,{writable:!0,value:Object.create(null)})}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t){const i=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,e);i.capability.promise.then((()=>t(i.data)));return null}const i=_classPrivateFieldGet(this,_objs)[e];if(null==i||!i.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return i.data}has(e){const t=_classPrivateFieldGet(this,_objs)[e];return(null==t?void 0:t.capability.settled)||!1}resolve(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,e);i.data=t;i.capability.resolve()}clear(){for(const t in _classPrivateFieldGet(this,_objs)){var e;const{data:i}=_classPrivateFieldGet(this,_objs)[t];null==i||null===(e=i.bitmap)||void 0===e||e.close()}_classPrivateFieldSet(this,_objs,Object.create(null))}}function _ensureObj2(e){const t=_classPrivateFieldGet(this,_objs)[e];return t||(_classPrivateFieldGet(this,_objs)[e]={capability:(0,_util.createPromiseCapability)(),data:null})}class RenderTask{#s=null;constructor(e){this.#s=e;this.onContinue=null}get promise(){return this.#s.capability.promise}cancel(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.#s.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#s.operatorList;if(!e)return!1;const{annotationCanvasMap:t}=this.#s;return e.form||e.canvas&&(null==t?void 0:t.size)>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static#r=new WeakSet;constructor(e){let{callback:t,params:i,objs:n,commonObjs:s,annotationCanvasMap:r,operatorList:a,pageIndex:o,canvasFactory:l,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:h=null}=e;this.callback=t;this.params=i;this.objs=n;this.commonObjs=s;this.annotationCanvasMap=r;this.operatorListIdx=null;this.operatorList=a;this._pageIndex=o;this.canvasFactory=l;this._pdfBug=d;this.pageColors=h;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window;this.cancelled=!1;this.capability=(0,_util.createPromiseCapability)();this.task=new RenderTask(this);this._cancelBound=this.cancel.bind(this);this._continueBound=this._continue.bind(this);this._scheduleNextBound=this._scheduleNext.bind(this);this._nextBound=this._next.bind(this);this._canvas=i.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(e){var t,i;let{transparency:n=!1,optionalContentConfig:s}=e;if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#r.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#r.add(this._canvas)}if(this._pdfBug&&null!==(t=globalThis.StepperManager)&&void 0!==t&&t.enabled){this.stepper=globalThis.StepperManager.create(this._pageIndex);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}const{canvasContext:r,viewport:a,transform:o,background:l,backgroundColorToReplace:c}=this.params;this.gfx=new _canvas.CanvasGraphics(r,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:s},this.annotationCanvasMap,this.pageColors);this.gfx.beginDrawing({transform:o,viewport:a,transparency:n,background:l,backgroundColorToReplace:c});this.operatorListIdx=0;this.graphicsReady=!0;null===(i=this.graphicsReadyCallback)||void 0===i||i.call(this)}cancel(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1;this.cancelled=!0;null===(e=this.gfx)||void 0===e||e.endDrawing();this._canvas&&InternalRenderTask.#r.delete(this._canvas);this.callback(t||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas",i))}operatorListChanged(){var e;if(this.graphicsReady){null===(e=this.stepper)||void 0===e||e.updateOperatorList(this.operatorList);this.running||this._continue()}else this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0;this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){window.ngxZone.runOutsideAngular((()=>{this._useRequestAnimationFrame?window.requestAnimationFrame((()=>{this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}))}async _next(){if(!this.cancelled){this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper);if(this.operatorListIdx===this.operatorList.argsArray.length){this.running=!1;if(this.operatorList.lastChunk){this.gfx.endDrawing();this._canvas&&InternalRenderTask.#r.delete(this._canvas);this.callback()}}}}}const version="3.4.493";exports.version=version;const build="7b85cf0e7";exports.build=build},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PrintAnnotationStorage=t.AnnotationStorage=void 0;var n=i(1),s=i(136),r=i(140);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)}var a=new WeakMap,o=new WeakMap,l=new WeakSet;class AnnotationStorage{constructor(){!function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t);t.add(e)}(this,l);_classPrivateFieldInitSpec(this,a,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,o,{writable:!0,value:new Map});this.onSetModified=null;this.onResetModified=null;this.onAnnotationEditor=null}getValue(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,s=_classPrivateFieldGet(this,o).get(e);if(void 0===s&&window.getFormValue){window.assignFormIdAndFieldName(e,t,n);const r=window.getFormValue(t);if(void 0!==r&&void 0!==r.value){if(n){s={value:r.value===n}}else s=r;this.setValue(e,void 0,s,void 0,!0)}void 0===s&&void 0!==i&&void 0!==i.value&&""!==i.value&&(n?i.value&&window.setFormValue(t,n):window.setFormValue(t,i.value))}return void 0===s?i:Object.assign(i,s)}getRawValue(e){return _classPrivateFieldGet(this,o).get(e)}remove(e){_classPrivateFieldGet(this,o).delete(e);0===_classPrivateFieldGet(this,o).size&&this.resetModified();if("function"==typeof this.onAnnotationEditor){for(const e of _classPrivateFieldGet(this,o).values())if(e instanceof s.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const a=_classPrivateFieldGet(this,o).get(e);let c=!1;if(void 0!==a){for(const[e,t]of Object.entries(i))if("radioValue"!==e&&"emitMessage"!==e&&a[e]!==t){c=!0;a[e]=t}}else{r||(c=!0);_classPrivateFieldGet(this,o).set(e,i)}if(c){(function _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i})(this,l,_setModified2).call(this);if("FreeTextEditor"!==(null==t?void 0:t.constructor.name)&&(t||n)&&window.setFormValue)if(i.items)window.setFormValue(t,i.items);else if(!1===i.emitMessage);else if(i.radioValue)window.setFormValue(t,i.radioValue);else if(i.exportValue)window.setFormValue(t,i.exportValue);else for(const e of Object.values(i))window.setFormValue(t,e)}i instanceof s.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(i.constructor._type)}has(e){return _classPrivateFieldGet(this,o).has(e)}getAll(){return _classPrivateFieldGet(this,o).size>0?(0,n.objectFromMap)(_classPrivateFieldGet(this,o)):null}setAll(e){for(const[t,i]of Object.entries(e))this.setValue(t,i)}get size(){return _classPrivateFieldGet(this,o).size}resetModified(){if(_classPrivateFieldGet(this,a)){_classPrivateFieldSet(this,a,!1);"function"==typeof this.onResetModified&&this.onResetModified()}}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===_classPrivateFieldGet(this,o).size)return null;const e=new Map;for(const[t,i]of _classPrivateFieldGet(this,o)){const n=i instanceof s.AnnotationEditor?i.serialize():i;n&&e.set(t,n)}return e}static getHash(e){if(!e)return"";const t=new r.MurmurHash3_64;for(const[i,n]of e)t.update(`${i}:${JSON.stringify(n)}`);return t.hexdigest()}}t.AnnotationStorage=AnnotationStorage;function _setModified2(){if(!_classPrivateFieldGet(this,a)){_classPrivateFieldSet(this,a,!0);"function"==typeof this.onSetModified&&this.onSetModified()}}class PrintAnnotationStorage extends AnnotationStorage{#a=null;constructor(e){super();this.#a=structuredClone(e.serializable)}get print(){(0,n.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#a}}t.PrintAnnotationStorage=PrintAnnotationStorage},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.AnnotationEditor=void 0;var n=i(137),s=i(1);class AnnotationEditor{#o=this.focusin.bind(this);#l=this.focusout.bind(this);#c=!1;#d=!1;#h=!1;_uiManager=null;#u=AnnotationEditor._zIndex++;static _colorManager=new n.ColorManager;static _zIndex=1;constructor(e){this.constructor===AnnotationEditor&&(0,s.unreachable)("Cannot initialize AnnotationEditor.");this.parent=e.parent;this.id=e.id;this.width=this.height=null;this.pageIndex=e.parent.pageIndex;this.name=e.name;this.div=null;this._uiManager=e.uiManager;const{rotation:t,rawDims:{pageWidth:i,pageHeight:n,pageX:r,pageY:a}}=this.parent.viewport;this.rotation=t;this.pageDimensions=[i,n];this.pageTranslation=[r,a];const[o,l]=this.parentDimensions;this.x=e.x/o;this.y=e.y/l;this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,s.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#u}setParent(e){if(null!==e){this.pageIndex=e.pageIndex;this.pageDimensions=e.pageDimensions}this.parent=e}focusin(e){this.#c?this.#c=!1:this.parent.setSelected(this)}focusout(e){var t;if(!this.isAttachedToDOM)return;const i=e.relatedTarget;if(null==i||!i.closest(`#${this.id}`)){e.preventDefault();null!==(t=this.parent)&&void 0!==t&&t.isMultipleSelection||this.commitOrRemove()}}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(e){const t=this.parent.div.getBoundingClientRect();this.startX=e.clientX-t.x;this.startY=e.clientY-t.y;e.dataTransfer.setData("text/plain",this.id);e.dataTransfer.effectAllowed="move"}setAt(e,t,i,n){const[s,r]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n);this.x=(e+i)/s;this.y=(t+n)/r;this.div.style.left=100*this.x+"%";this.div.style.top=100*this.y+"%"}translate(e,t){const[i,n]=this.parentDimensions;[e,t]=this.screenToPageTranslation(e,t);this.x+=e/i;this.y+=t/n;this.div.style.left=100*this.x+"%";this.div.style.top=100*this.y+"%"}screenToPageTranslation(e,t){switch(this.parentRotation){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return this._uiManager.viewParameters.rotation}get parentDimensions(){const{realScale:e}=this._uiManager.viewParameters,[t,i]=this.pageDimensions;return[t*e,i*e]}setDims(e,t){const[i,n]=this.parentDimensions;this.div.style.width=100*e/i+"%";this.div.style.height=100*t/n+"%"}fixDims(){const{style:e}=this.div,{height:t,width:i}=e,n=i.endsWith("%"),s=t.endsWith("%");if(n&&s)return;const[r,a]=this.parentDimensions;n||(e.width=100*parseFloat(i)/r+"%");s||(e.height=100*parseFloat(t)/a+"%")}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div");this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360);this.div.className=this.name;this.div.setAttribute("id",this.id);this.div.setAttribute("tabIndex",0);this.setInForeground();this.div.addEventListener("focusin",this.#o);this.div.addEventListener("focusout",this.#l);const[e,t]=this.getInitialTranslation();this.translate(e,t);(0,n.bindEvents)(this,this.div,["dragstart","pointerdown"]);return this.div}pointerdown(e){const{isMac:t}=s.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)e.preventDefault();else{e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this);this.#c=!0}}getRect(e,t){const i=this.parentScale,[n,s]=this.pageDimensions,[r,a]=this.pageTranslation,o=e/i,l=t/i,c=this.x*n,d=this.y*s,h=this.width*n,u=this.height*s;switch(this.rotation){case 0:return[c+o+r,s-d-l-u+a,c+o+h+r,s-d-l+a];case 90:return[c+l+r,s-d+o+a,c+l+u+r,s-d+o+h+a];case 180:return[c-o-h+r,s-d+l+a,c-o+r,s-d+l+u+a];case 270:return[c-l-u+r,s-d-o-h+a,c-l+r,s-d-o+a];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[i,n,s,r]=e,a=s-i,o=r-n;switch(this.rotation){case 0:return[i,t-r,a,o];case 90:return[i,t-n,o,a];case 180:return[s,t-n,a,o];case 270:return[s,t-r,o,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#h=!0}disableEditMode(){this.#h=!1}isInEditMode(){return this.#h}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var e;null===(e=this.div)||void 0===e||e.addEventListener("focusin",this.#o)}serialize(){(0,s.unreachable)("An editor must be serializable")}static deserialize(e,t,i){const n=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:i});n.rotation=e.rotation;const[s,r]=n.pageDimensions,[a,o,l,c]=n.getRectInCurrentCoords(e.rect,r);n.x=a/s;n.y=o/r;n.width=l/s;n.height=c/r;return n}remove(){this.div.removeEventListener("focusin",this.#o);this.div.removeEventListener("focusout",this.#l);this.isEmpty()||this.commit();this.parent.remove(this)}select(){var e;null===(e=this.div)||void 0===e||e.classList.add("selectedEditor")}unselect(){var e;null===(e=this.div)||void 0===e||e.classList.remove("selectedEditor")}updateParams(e,t){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return this.#d}set isEditing(e){this.#d=e;if(e){this.parent.setSelected(this);this.parent.setActiveEditor(this)}else this.parent.setActiveEditor(null)}}t.AnnotationEditor=AnnotationEditor},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.KeyboardManager=t.CommandManager=t.ColorManager=t.AnnotationEditorUIManager=void 0;t.bindEvents=function bindEvents(e,t,i){for(const n of i)t.addEventListener(n,e[n].bind(e))};t.opacityToHex=function opacityToHex(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")};var n=i(1),s=i(138);function _classPrivateFieldInitSpec(e,t,i){_checkPrivateRedeclaration(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)}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 _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}class IdManager{#p=0;getId(){return`${n.AnnotationEditorPrefix}${this.#p++}`}}class CommandManager{#g=[];#f=!1;#m;#v=-1;constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;this.#m=e}add(e){let{cmd:t,undo:i,mustExec:n,type:s=NaN,overwriteIfSameType:r=!1,keepUndo:a=!1}=e;n&&t();if(this.#f)return;const o={cmd:t,undo:i,type:s};if(-1===this.#v){this.#g.length>0&&(this.#g.length=0);this.#v=0;this.#g.push(o);return}if(r&&this.#g[this.#v].type===s){a&&(o.undo=this.#g[this.#v].undo);this.#g[this.#v]=o;return}const l=this.#v+1;if(l===this.#m)this.#g.splice(0,1);else{this.#v=l;l<this.#g.length&&this.#g.splice(l)}this.#g.push(o)}undo(){if(-1!==this.#v){this.#f=!0;this.#g[this.#v].undo();this.#f=!1;this.#v-=1}}redo(){if(this.#v<this.#g.length-1){this.#v+=1;this.#f=!0;this.#g[this.#v].cmd();this.#f=!1}}hasSomethingToUndo(){return-1!==this.#v}hasSomethingToRedo(){return this.#v<this.#g.length-1}destroy(){this.#g=null}}t.CommandManager=CommandManager;var r=new WeakSet;class KeyboardManager{constructor(e){_classPrivateMethodInitSpec(this,r);this.buffer=[];this.callbacks=new Map;this.allKeys=new Set;const{isMac:t}=n.FeatureTest.platform;for(const[i,n]of e)for(const e of i){const i=e.startsWith("mac+");if(t&&i){this.callbacks.set(e.slice(4),n);this.allKeys.add(e.split("+").at(-1))}else if(!t&&!i){this.callbacks.set(e,n);this.allKeys.add(e.split("+").at(-1))}}}exec(e,t){if(!this.allKeys.has(t.key))return;const i=this.callbacks.get(_classPrivateMethodGet(this,r,_serialize2).call(this,t));if(i){i.bind(e)();t.stopPropagation();t.preventDefault()}}}t.KeyboardManager=KeyboardManager;function _serialize2(e){e.altKey&&this.buffer.push("alt");e.ctrlKey&&this.buffer.push("ctrl");e.metaKey&&this.buffer.push("meta");e.shiftKey&&this.buffer.push("shift");this.buffer.push(e.key);const t=this.buffer.join("+");this.buffer.length=0;return t}class ColorManager{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);(0,s.getColorValues)(e);return(0,n.shadow)(this,"_colors",e)}convert(e){const t=(0,s.getRGB)(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[e,i]of this._colors)if(i.every(((e,i)=>e===t[i])))return ColorManager._colorsMapping.get(e);return t}getHexCode(e){const t=this._colors.get(e);return t?n.Util.makeHexColor(...t):e}}t.ColorManager=ColorManager;var a=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,m=new WeakMap,v=new WeakMap,_=new WeakMap,b=new WeakMap,w=new WeakMap,y=new WeakMap,P=new WeakMap,S=new WeakMap,A=new WeakMap,E=new WeakMap,x=new WeakMap,C=new WeakMap,M=new WeakMap,T=new WeakSet,k=new WeakSet,I=new WeakSet,D=new WeakSet,R=new WeakSet,L=new WeakSet,O=new WeakSet,N=new WeakSet,B=new WeakSet,G=new WeakSet,V=new WeakSet;class AnnotationEditorUIManager{constructor(e,t,i){_classPrivateMethodInitSpec(this,V);_classPrivateMethodInitSpec(this,G);_classPrivateMethodInitSpec(this,B);_classPrivateMethodInitSpec(this,N);_classPrivateMethodInitSpec(this,O);_classPrivateMethodInitSpec(this,L);_classPrivateMethodInitSpec(this,R);_classPrivateMethodInitSpec(this,D);_classPrivateMethodInitSpec(this,I);_classPrivateMethodInitSpec(this,k);_classPrivateMethodInitSpec(this,T);_classPrivateFieldInitSpec(this,a,{writable:!0,value:null});_classPrivateFieldInitSpec(this,o,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,l,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,c,{writable:!0,value:null});_classPrivateFieldInitSpec(this,d,{writable:!0,value:new CommandManager});_classPrivateFieldInitSpec(this,h,{writable:!0,value:0});_classPrivateFieldInitSpec(this,u,{writable:!0,value:null});_classPrivateFieldInitSpec(this,p,{writable:!0,value:new Set});_classPrivateFieldInitSpec(this,g,{writable:!0,value:null});_classPrivateFieldInitSpec(this,f,{writable:!0,value:new IdManager});_classPrivateFieldInitSpec(this,m,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,v,{writable:!0,value:n.AnnotationEditorType.NONE});_classPrivateFieldInitSpec(this,_,{writable:!0,value:new Set});_classPrivateFieldInitSpec(this,b,{writable:!0,value:this.copy.bind(this)});_classPrivateFieldInitSpec(this,w,{writable:!0,value:this.cut.bind(this)});_classPrivateFieldInitSpec(this,y,{writable:!0,value:this.paste.bind(this)});_classPrivateFieldInitSpec(this,P,{writable:!0,value:this.keydown.bind(this)});_classPrivateFieldInitSpec(this,S,{writable:!0,value:this.onEditingAction.bind(this)});_classPrivateFieldInitSpec(this,A,{writable:!0,value:this.onPageChanging.bind(this)});_classPrivateFieldInitSpec(this,E,{writable:!0,value:this.onScaleChanging.bind(this)});_classPrivateFieldInitSpec(this,x,{writable:!0,value:this.onRotationChanging.bind(this)});_classPrivateFieldInitSpec(this,C,{writable:!0,value:{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}});_classPrivateFieldInitSpec(this,M,{writable:!0,value:null});_classPrivateFieldSet(this,M,e);_classPrivateFieldSet(this,g,t);_classPrivateFieldGet(this,g)._on("editingaction",_classPrivateFieldGet(this,S));_classPrivateFieldGet(this,g)._on("pagechanging",_classPrivateFieldGet(this,A));_classPrivateFieldGet(this,g)._on("scalechanging",_classPrivateFieldGet(this,E));_classPrivateFieldGet(this,g)._on("rotationchanging",_classPrivateFieldGet(this,x));_classPrivateFieldSet(this,c,i);this.viewParameters={realScale:s.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){_classPrivateMethodGet(this,k,_removeKeyboardManager2).call(this);_classPrivateFieldGet(this,g)._off("editingaction",_classPrivateFieldGet(this,S));_classPrivateFieldGet(this,g)._off("pagechanging",_classPrivateFieldGet(this,A));_classPrivateFieldGet(this,g)._off("scalechanging",_classPrivateFieldGet(this,E));_classPrivateFieldGet(this,g)._off("rotationchanging",_classPrivateFieldGet(this,x));for(const e of _classPrivateFieldGet(this,l).values())e.destroy();_classPrivateFieldGet(this,l).clear();_classPrivateFieldGet(this,o).clear();_classPrivateFieldGet(this,p).clear();_classPrivateFieldSet(this,a,null);_classPrivateFieldGet(this,_).clear();_classPrivateFieldGet(this,d).destroy()}onPageChanging(e){let{pageNumber:t}=e;_classPrivateFieldSet(this,h,t-1)}focusMainContainer(){_classPrivateFieldGet(this,M).focus()}addShouldRescale(e){_classPrivateFieldGet(this,p).add(e)}removeShouldRescale(e){_classPrivateFieldGet(this,p).delete(e)}onScaleChanging(e){let{scale:t}=e;this.commitOrRemove();this.viewParameters.realScale=t*s.PixelsPerInch.PDF_TO_CSS_UNITS;for(const e of _classPrivateFieldGet(this,p))e.onScaleChanging()}onRotationChanging(e){let{pagesRotation:t}=e;this.commitOrRemove();this.viewParameters.rotation=t}addToAnnotationStorage(e){e.isEmpty()||!_classPrivateFieldGet(this,c)||_classPrivateFieldGet(this,c).has(e.id)||_classPrivateFieldGet(this,c).setValue(e.id,null,e)}copy(e){e.preventDefault();_classPrivateFieldGet(this,a)&&_classPrivateFieldGet(this,a).commitOrRemove();if(!this.hasSelection)return;const t=[];for(const e of _classPrivateFieldGet(this,_))e.isEmpty()||t.push(e.serialize());0!==t.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e);this.delete()}paste(e){e.preventDefault();let t=e.clipboardData.getData("application/pdfjs");if(!t)return;try{t=JSON.parse(t)}catch(e){(0,n.warn)(`paste: "${e.message}".`);return}if(!Array.isArray(t))return;this.unselectAll();const i=_classPrivateFieldGet(this,l).get(_classPrivateFieldGet(this,h));try{const e=[];for(const n of t){const t=i.deserialize(n);if(!t)return;e.push(t)}const cmd=()=>{for(const t of e)_classPrivateMethodGet(this,B,_addEditorToLayer2).call(this,t);_classPrivateMethodGet(this,V,_selectEditors2).call(this,e)},undo=()=>{for(const t of e)t.remove()};this.addCommands({cmd:cmd,undo:undo,mustExec:!0})}catch(e){(0,n.warn)(`paste: "${e.message}".`)}}keydown(e){var t;null!==(t=this.getActive())&&void 0!==t&&t.shouldGetKeyboardEvents()||AnnotationEditorUIManager._keyboardManager.exec(this,e)}onEditingAction(e){["undo","redo","delete","selectAll"].includes(e.name)&&this[e.name]()}setEditingState(e){if(e){_classPrivateMethodGet(this,T,_addKeyboardManager2).call(this);_classPrivateMethodGet(this,I,_addCopyPasteListeners2).call(this);_classPrivateMethodGet(this,R,_dispatchUpdateStates2).call(this,{isEditing:_classPrivateFieldGet(this,v)!==n.AnnotationEditorType.NONE,isEmpty:_classPrivateMethodGet(this,G,_isEmpty2).call(this),hasSomethingToUndo:_classPrivateFieldGet(this,d).hasSomethingToUndo(),hasSomethingToRedo:_classPrivateFieldGet(this,d).hasSomethingToRedo(),hasSelectedEditor:!1})}else{_classPrivateMethodGet(this,k,_removeKeyboardManager2).call(this);_classPrivateMethodGet(this,D,_removeCopyPasteListeners2).call(this);_classPrivateMethodGet(this,R,_dispatchUpdateStates2).call(this,{isEditing:!1})}}registerEditorTypes(e){if(!_classPrivateFieldGet(this,u)){_classPrivateFieldSet(this,u,e);for(const e of _classPrivateFieldGet(this,u))_classPrivateMethodGet(this,L,_dispatchUpdateUI2).call(this,e.defaultPropertiesToUpdate)}}getId(){return _classPrivateFieldGet(this,f).getId()}get currentLayer(){return _classPrivateFieldGet(this,l).get(_classPrivateFieldGet(this,h))}get currentPageIndex(){return _classPrivateFieldGet(this,h)}addLayer(e){_classPrivateFieldGet(this,l).set(e.pageIndex,e);_classPrivateFieldGet(this,m)?e.enable():e.disable()}removeLayer(e){_classPrivateFieldGet(this,l).delete(e.pageIndex)}updateMode(e){_classPrivateFieldSet(this,v,e);if(e===n.AnnotationEditorType.NONE){this.setEditingState(!1);_classPrivateMethodGet(this,N,_disableAll2).call(this)}else{this.setEditingState(!0);_classPrivateMethodGet(this,O,_enableAll2).call(this);for(const t of _classPrivateFieldGet(this,l).values())t.updateMode(e)}}updateToolbar(e){e!==_classPrivateFieldGet(this,v)&&_classPrivateFieldGet(this,g).dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){if(_classPrivateFieldGet(this,u)){for(const i of _classPrivateFieldGet(this,_))i.updateParams(e,t);for(const i of _classPrivateFieldGet(this,u))i.updateDefaultParams(e,t)}}getEditors(e){const t=[];for(const i of _classPrivateFieldGet(this,o).values())i.pageIndex===e&&t.push(i);return t}getEditor(e){return _classPrivateFieldGet(this,o).get(e)}addEditor(e){_classPrivateFieldGet(this,o).set(e.id,e)}removeEditor(e){var t;_classPrivateFieldGet(this,o).delete(e.id);this.unselect(e);null===(t=_classPrivateFieldGet(this,c))||void 0===t||t.remove(e.id)}setActiveEditor(e){if(_classPrivateFieldGet(this,a)!==e){_classPrivateFieldSet(this,a,e);e&&_classPrivateMethodGet(this,L,_dispatchUpdateUI2).call(this,e.propertiesToUpdate)}}toggleSelected(e){if(_classPrivateFieldGet(this,_).has(e)){_classPrivateFieldGet(this,_).delete(e);e.unselect();_classPrivateMethodGet(this,R,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}else{_classPrivateFieldGet(this,_).add(e);e.select();_classPrivateMethodGet(this,L,_dispatchUpdateUI2).call(this,e.propertiesToUpdate);_classPrivateMethodGet(this,R,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}}setSelected(e){for(const t of _classPrivateFieldGet(this,_))t!==e&&t.unselect();_classPrivateFieldGet(this,_).clear();_classPrivateFieldGet(this,_).add(e);e.select();_classPrivateMethodGet(this,L,_dispatchUpdateUI2).call(this,e.propertiesToUpdate);_classPrivateMethodGet(this,R,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}isSelected(e){return _classPrivateFieldGet(this,_).has(e)}unselect(e){e.unselect();_classPrivateFieldGet(this,_).delete(e);_classPrivateMethodGet(this,R,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==_classPrivateFieldGet(this,_).size}undo(){_classPrivateFieldGet(this,d).undo();_classPrivateMethodGet(this,R,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:_classPrivateFieldGet(this,d).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:_classPrivateMethodGet(this,G,_isEmpty2).call(this)})}redo(){_classPrivateFieldGet(this,d).redo();_classPrivateMethodGet(this,R,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:_classPrivateFieldGet(this,d).hasSomethingToRedo(),isEmpty:_classPrivateMethodGet(this,G,_isEmpty2).call(this)})}addCommands(e){_classPrivateFieldGet(this,d).add(e);_classPrivateMethodGet(this,R,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:_classPrivateMethodGet(this,G,_isEmpty2).call(this)})}delete(){this.commitOrRemove();if(!this.hasSelection)return;const e=[..._classPrivateFieldGet(this,_)];this.addCommands({cmd:()=>{for(const t of e)t.remove()},undo:()=>{for(const t of e)_classPrivateMethodGet(this,B,_addEditorToLayer2).call(this,t)},mustExec:!0})}commitOrRemove(){var e;null===(e=_classPrivateFieldGet(this,a))||void 0===e||e.commitOrRemove()}selectAll(){for(const e of _classPrivateFieldGet(this,_))e.commit();_classPrivateMethodGet(this,V,_selectEditors2).call(this,_classPrivateFieldGet(this,o).values())}unselectAll(){if(_classPrivateFieldGet(this,a))_classPrivateFieldGet(this,a).commitOrRemove();else if(0!==_classPrivateFieldGet(this,_).size){for(const e of _classPrivateFieldGet(this,_))e.unselect();_classPrivateFieldGet(this,_).clear();_classPrivateMethodGet(this,R,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!1})}}isActive(e){return _classPrivateFieldGet(this,a)===e}getActive(){return _classPrivateFieldGet(this,a)}getMode(){return _classPrivateFieldGet(this,v)}}t.AnnotationEditorUIManager=AnnotationEditorUIManager;function _addKeyboardManager2(){_classPrivateFieldGet(this,M).addEventListener("keydown",_classPrivateFieldGet(this,P))}function _removeKeyboardManager2(){_classPrivateFieldGet(this,M).removeEventListener("keydown",_classPrivateFieldGet(this,P))}function _addCopyPasteListeners2(){document.addEventListener("copy",_classPrivateFieldGet(this,b));document.addEventListener("cut",_classPrivateFieldGet(this,w));document.addEventListener("paste",_classPrivateFieldGet(this,y))}function _removeCopyPasteListeners2(){document.removeEventListener("copy",_classPrivateFieldGet(this,b));document.removeEventListener("cut",_classPrivateFieldGet(this,w));document.removeEventListener("paste",_classPrivateFieldGet(this,y))}function _dispatchUpdateStates2(e){Object.entries(e).some((e=>{let[t,i]=e;return _classPrivateFieldGet(this,C)[t]!==i}))&&_classPrivateFieldGet(this,g).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(_classPrivateFieldGet(this,C),e)})}function _dispatchUpdateUI2(e){_classPrivateFieldGet(this,g).dispatch("annotationeditorparamschanged",{source:this,details:e})}function _enableAll2(){if(!_classPrivateFieldGet(this,m)){_classPrivateFieldSet(this,m,!0);for(const e of _classPrivateFieldGet(this,l).values())e.enable()}}function _disableAll2(){this.unselectAll();if(_classPrivateFieldGet(this,m)){_classPrivateFieldSet(this,m,!1);for(const e of _classPrivateFieldGet(this,l).values())e.disable()}}function _addEditorToLayer2(e){const t=_classPrivateFieldGet(this,l).get(e.pageIndex);t?t.addOrRebuild(e):this.addEditor(e)}function _isEmpty2(){if(0===_classPrivateFieldGet(this,o).size)return!0;if(1===_classPrivateFieldGet(this,o).size)for(const e of _classPrivateFieldGet(this,o).values())return e.isEmpty();return!1}function _selectEditors2(e){_classPrivateFieldGet(this,_).clear();for(const t of e)if(!t.isEmpty()){_classPrivateFieldGet(this,_).add(t);t.select()}_classPrivateMethodGet(this,R,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}!function _defineProperty(e,t,i){(t=function _toPropertyKey(e){var t=function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i;return e}(AnnotationEditorUIManager,"_keyboardManager",new KeyboardManager([[["ctrl+a","mac+meta+a"],AnnotationEditorUIManager.prototype.selectAll],[["ctrl+z","mac+meta+z"],AnnotationEditorUIManager.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],AnnotationEditorUIManager.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],AnnotationEditorUIManager.prototype.delete],[["Escape","mac+Escape"],AnnotationEditorUIManager.prototype.unselectAll]]))},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.StatTimer=t.RenderingCancelledException=t.PixelsPerInch=t.PageViewport=t.PDFDateString=t.DOMStandardFontDataFactory=t.DOMSVGFactory=t.DOMCanvasFactory=t.DOMCMapReaderFactory=t.AnnotationPrefix=void 0;t.deprecated=function deprecated(e){Window.ngxConsole.log("Deprecated API usage: "+e)};t.getColorValues=function getColorValues(e){const t=document.createElement("span");t.style.visibility="hidden";document.body.append(t);for(const i of e.keys()){t.style.color=i;const n=window.getComputedStyle(t).color;e.set(i,getRGB(n))}t.remove()};t.getCurrentTransform=function getCurrentTransform(e){const{a:t,b:i,c:n,d:s,e:r,f:a}=e.getTransform();return[t,i,n,s,r,a]};t.getCurrentTransformInverse=function getCurrentTransformInverse(e){const{a:t,b:i,c:n,d:s,e:r,f:a}=e.getTransform().invertSelf();return[t,i,n,s,r,a]};t.getFilenameFromUrl=function getFilenameFromUrl(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]||([e]=e.split(/[#?]/,1));return e.substring(e.lastIndexOf("/")+1)};t.getPdfFilenameFromUrl=function getPdfFilenameFromUrl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if(window.PDFViewerApplication.appConfig.filenameForDownload)return window.PDFViewerApplication.appConfig.filenameForDownload;if("string"!=typeof e)return t;if(isDataScheme(e)){(0,s.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');return t}const i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let r=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(r){r=r[0];if(r.includes("%"))try{r=i.exec(decodeURIComponent(r))[0]}catch(e){}}return r||t};t.getRGB=getRGB;t.getXfaPageViewport=function getXfaPageViewport(e,t){let{scale:i=1,rotation:n=0}=t;const{width:s,height:r}=e.attributes.style,a=[0,0,parseInt(s),parseInt(r)];return new PageViewport({viewBox:a,scale:i,rotation:n})};t.isDataScheme=isDataScheme;t.isPdfFile=function isPdfFile(e){return"string"==typeof e&&/\.pdf$/i.test(e)};t.isValidFetchUrl=isValidFetchUrl;t.loadScript=function loadScript(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise(((i,n)=>{const s=document.createElement("script");let r=e;"Function"===e.constructor.name&&(r=e());const a=function generateTrustedURL(e){if(window.trustedTypes){return window.trustedTypes.createPolicy("foo",{createScriptURL:e=>e}).createScriptURL(e)}return e}(r);s.src=a;s.onload=function(e){t&&s.remove();i(e)};s.onerror=function(e){Window.ngxConsole.log(e);n(new Error(`Cannot load script at: ${s.src}`))};(document.head||document.documentElement).append(s)}))};t.setLayerDimensions=function setLayerDimensions(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(t instanceof PageViewport){const{pageWidth:n,pageHeight:s}=t.rawDims,{style:r}=e,a=`calc(var(--scale-factor) * ${n}px)`,o=`calc(var(--scale-factor) * ${s}px)`;if(i&&t.rotation%180!=0){r.width=o;r.height=a}else{r.width=a;r.height=o}}n&&e.setAttribute("data-main-rotation",t.rotation)};var n=i(139),s=i(1);t.AnnotationPrefix="pdfjs_internal_id_";class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}t.PixelsPerInch=PixelsPerInch;class DOMCanvasFactory extends n.BaseCanvasFactory{constructor(){let{ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();this._document=e}_createCanvas(e,t){const i=this._document.createElement("canvas");i.width=e;i.height=t;return i}}t.DOMCanvasFactory=DOMCanvasFactory;async function fetchData(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(isValidFetchUrl(e,document.baseURI)){const i=await fetch(e);if(!i.ok)throw new Error(i.statusText);return t?new Uint8Array(await i.arrayBuffer()):(0,s.stringToBytes)(await i.text())}return new Promise(((i,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0);t&&(r.responseType="arraybuffer");r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(200===r.status||0===r.status){let e;t&&r.response?e=new Uint8Array(r.response):!t&&r.responseText&&(e=(0,s.stringToBytes)(r.responseText));if(e){i(e);return}}n(new Error(r.statusText))}};r.send(null)}))}class DOMCMapReaderFactory extends n.BaseCMapReaderFactory{_fetchData(e,t){return fetchData(e,this.isCompressed).then((e=>({cMapData:e,compressionType:t})))}}t.DOMCMapReaderFactory=DOMCMapReaderFactory;class DOMStandardFontDataFactory extends n.BaseStandardFontDataFactory{_fetchData(e){return fetchData(e,!0)}}t.DOMStandardFontDataFactory=DOMStandardFontDataFactory;class DOMSVGFactory extends n.BaseSVGFactory{_createSVG(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}}t.DOMSVGFactory=DOMSVGFactory;class PageViewport{constructor(e){let{viewBox:t,scale:i,rotation:n,offsetX:s=0,offsetY:r=0,dontFlip:a=!1}=e;this.viewBox=t;this.scale=i;this.rotation=n;this.offsetX=s;this.offsetY=r;const o=(t[2]+t[0])/2,l=(t[3]+t[1])/2;let c,d,h,u,p,g,f,m;n%=360;n<0&&(n+=360);switch(n){case 180:c=-1;d=0;h=0;u=1;break;case 90:c=0;d=1;h=1;u=0;break;case 270:c=0;d=-1;h=-1;u=0;break;case 0:c=1;d=0;h=0;u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(a){h=-h;u=-u}if(0===c){p=Math.abs(l-t[1])*i+s;g=Math.abs(o-t[0])*i+r;f=(t[3]-t[1])*i;m=(t[2]-t[0])*i}else{p=Math.abs(o-t[0])*i+s;g=Math.abs(l-t[1])*i+r;f=(t[2]-t[0])*i;m=(t[3]-t[1])*i}this.transform=[c*i,d*i,h*i,u*i,p-c*i*o-h*i*l,g-d*i*o-u*i*l];this.width=f;this.height=m}get rawDims(){const{viewBox:e}=this;return(0,s.shadow)(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone(){let{scale:e=this.scale,rotation:t=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new PageViewport({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(e,t){return s.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=s.Util.applyTransform([e[0],e[1]],this.transform),i=s.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],i[0],i[1]]}convertToPdfPoint(e,t){return s.Util.applyInverseTransform([e,t],this.transform)}}t.PageViewport=PageViewport;class RenderingCancelledException extends s.BaseException{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;super(e,"RenderingCancelledException");this.type=t;this.extraDelay=i}}t.RenderingCancelledException=RenderingCancelledException;function isDataScheme(e){const t=e.length;let i=0;for(;i<t&&""===e[i].trim();)i++;return"data:"===e.substring(i,i+5).toLowerCase()}t.StatTimer=class StatTimer{started=Object.create(null);times=[];time(e){e in this.started&&(0,s.warn)(`Timer is already running for ${e}`);this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,s.warn)(`Timer has not been started for ${e}`);this.times.push({name:e,start:this.started[e],end:Date.now()});delete this.started[e]}toString(){const e=[];let t=0;for(const{name:e}of this.times)t=Math.max(e.length,t);for(const{name:i,start:n,end:s}of this.times)e.push(`${i.padEnd(t)} ${s-n}ms\n`);return e.join("")}};function isValidFetchUrl(e,t){try{const{protocol:i}=t?new URL(e,t):new URL(e);return"http:"===i||"https:"===i||"capacitor:"===i}catch(e){return!1}}let r;t.PDFDateString=class PDFDateString{static toDateObject(e){if(!e||"string"!=typeof e)return null;r||(r=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=r.exec(e);if(!t)return null;const i=parseInt(t[1],10);let n=parseInt(t[2],10);n=n>=1&&n<=12?n-1:0;let s=parseInt(t[3],10);s=s>=1&&s<=31?s:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;const c=t[7]||"Z";let d=parseInt(t[8],10);d=d>=0&&d<=23?d:0;let h=parseInt(t[9],10)||0;h=h>=0&&h<=59?h:0;if("-"===c){a+=d;o+=h}else if("+"===c){a-=d;o-=h}return new Date(Date.UTC(i,n,s,a,o,l))}};function getRGB(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(16711680&t)>>16,(65280&t)>>8,255&t]}if(e.startsWith("rgb("))return e.slice(4,-1).split(",").map((e=>parseInt(e)));if(e.startsWith("rgba("))return e.slice(5,-1).split(",").map((e=>parseInt(e))).slice(0,3);(0,s.warn)(`Not a valid color format: "${e}"`);return[0,0,0]}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.BaseStandardFontDataFactory=t.BaseSVGFactory=t.BaseCanvasFactory=t.BaseCMapReaderFactory=void 0;var n=i(1);class BaseCanvasFactory{constructor(){this.constructor===BaseCanvasFactory&&(0,n.unreachable)("Cannot initialize BaseCanvasFactory.")}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(e,t),n=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0,s=i.getContext("2d",n);return{canvas:i,context:s}}reset(e,t,i){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||i<=0)throw new Error("Invalid canvas size");e.canvas.width=t;e.canvas.height=i}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0;e.canvas.height=0;e.canvas=null;e.context=null}_createCanvas(e,t){(0,n.unreachable)("Abstract method `_createCanvas` called.")}}t.BaseCanvasFactory=BaseCanvasFactory;class BaseCMapReaderFactory{constructor(e){let{baseUrl:t=null,isCompressed:i=!0}=e;this.constructor===BaseCMapReaderFactory&&(0,n.unreachable)("Cannot initialize BaseCMapReaderFactory.");this.baseUrl=t;this.isCompressed=i}async fetch(e){let{name:t}=e;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const i=this.baseUrl+t+(this.isCompressed?".bcmap":""),s=this.isCompressed?n.CMapCompressionType.BINARY:n.CMapCompressionType.NONE;return this._fetchData(i,s).catch((e=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)}))}_fetchData(e,t){(0,n.unreachable)("Abstract method `_fetchData` called.")}}t.BaseCMapReaderFactory=BaseCMapReaderFactory;class BaseStandardFontDataFactory{constructor(e){let{baseUrl:t=null}=e;this.constructor===BaseStandardFontDataFactory&&(0,n.unreachable)("Cannot initialize BaseStandardFontDataFactory.");this.baseUrl=t}async fetch(e){let{filename:t}=e;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${t}`;return this._fetchData(i).catch((e=>{throw new Error(`Unable to load font data at: ${i}`)}))}_fetchData(e){(0,n.unreachable)("Abstract method `_fetchData` called.")}}t.BaseStandardFontDataFactory=BaseStandardFontDataFactory;class BaseSVGFactory{constructor(){this.constructor===BaseSVGFactory&&(0,n.unreachable)("Cannot initialize BaseSVGFactory.")}create(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");n.setAttribute("version","1.1");if(!i){n.setAttribute("width",`${e}px`);n.setAttribute("height",`${t}px`)}n.setAttribute("preserveAspectRatio","none");n.setAttribute("viewBox",`0 0 ${e} ${t}`);return n}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){(0,n.unreachable)("Abstract method `_createSVG` called.")}}t.BaseSVGFactory=BaseSVGFactory},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MurmurHash3_64=void 0;var n=i(1);const s=3285377520,r=4294901760,a=65535;t.MurmurHash3_64=class MurmurHash3_64{constructor(e){this.h1=e?4294967295&e:s;this.h2=e?4294967295&e:s}update(e){let t,i;if("string"==typeof e){t=new Uint8Array(2*e.length);i=0;for(let n=0,s=e.length;n<s;n++){const s=e.charCodeAt(n);if(s<=255)t[i++]=s;else{t[i++]=s>>>8;t[i++]=255&s}}}else{if(!(0,n.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");t=e.slice();i=t.byteLength}const s=i>>2,o=i-4*s,l=new Uint32Array(t.buffer,0,s);let c=0,d=0,h=this.h1,u=this.h2;const p=3432918353,g=461845907,f=11601,m=13715;for(let e=0;e<s;e++)if(1&e){c=l[e];c=c*p&r|c*f&a;c=c<<15|c>>>17;c=c*g&r|c*m&a;h^=c;h=h<<13|h>>>19;h=5*h+3864292196}else{d=l[e];d=d*p&r|d*f&a;d=d<<15|d>>>17;d=d*g&r|d*m&a;u^=d;u=u<<13|u>>>19;u=5*u+3864292196}c=0;switch(o){case 3:c^=t[4*s+2]<<16;case 2:c^=t[4*s+1]<<8;case 1:c^=t[4*s];c=c*p&r|c*f&a;c=c<<15|c>>>17;c=c*g&r|c*m&a;1&s?h^=c:u^=c}this.h1=h;this.h2=u}hexdigest(){let e=this.h1,t=this.h2;e^=t>>>1;e=3981806797*e&r|36045*e&a;t=4283543511*t&r|(2950163797*(t<<16|e>>>16)&r)>>>16;e^=t>>>1;e=444984403*e&r|60499*e&a;t=3301882366*t&r|(3120437893*(t<<16|e>>>16)&r)>>>16;e^=t>>>1;return(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FontLoader=t.FontFaceObject=void 0;var n=i(1),s=i(142);t.FontLoader=class FontLoader{constructor(e){let{onUnsupportedFeature:t,ownerDocument:i=globalThis.document,styleElement:n=null}=e;this._onUnsupportedFeature=t;this._document=i;this.nativeFontFaces=[];this.styleElement=null;this.loadingRequests=[];this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.push(e);this._document.fonts.add(e)}insertRule(e){if(!this.styleElement){this.styleElement=this._document.createElement("style");this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement)}const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.length=0;if(this.styleElement){this.styleElement.remove();this.styleElement=null}}async bind(e){if(e.attached||e.missingFile)return;e.attached=!0;if(this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(i){this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.errorFontLoadNative});(0,n.warn)(`Failed to load font '${t.family}': '${i}'.`);e.disableFontFace=!0;throw i}}return}const t=e.createFontFaceRule();if(t){this.insertRule(t);if(this.isSyncFontLoadingSupported)return;await new Promise((t=>{const i=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,i)}))}}get isFontLoadingAPISupported(){var e;const t=!(null===(e=this._document)||void 0===e||!e.fonts);return(0,n.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let e=!1;(s.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0);return(0,n.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const{loadingRequests:t}=this,i={done:!1,complete:function completeRequest(){(0,n.assert)(!i.done,"completeRequest() cannot be called twice.");i.done=!0;for(;t.length>0&&t[0].done;){const e=t.shift();setTimeout(e.callback,0)}},callback:e};t.push(i);return i}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,n.shadow)(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function int32(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function spliceString(e,t,i,n){return e.substring(0,t)+n+e.substring(t+i)}let i,s;const r=this._document.createElement("canvas");r.width=1;r.height=1;const a=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0,o=r.getContext("2d",a);let l=0;const c=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=spliceString(d,976,c.length,c);const h=1482184792;let u=int32(d,16);for(i=0,s=c.length-3;i<s;i+=4)u=u-h+int32(c,i)|0;i<c.length&&(u=u-h+int32(c+"XXX",i)|0);d=spliceString(d,16,4,(0,n.string32)(u));const p=`@font-face {font-family:"${c}";src:${`url(data:font/opentype;base64,${btoa(d)});`}}`;this.insertRule(p);const g=this._document.createElement("div");g.style.visibility="hidden";g.style.width=g.style.height="10px";g.style.position="absolute";g.style.top=g.style.left="0px";for(const t of[e.loadedName,c]){const e=this._document.createElement("span");e.textContent="Hi";e.style.fontFamily=t;g.append(e)}this._document.body.append(g);!function isFontReady(e,t){if(++l>30){(0,n.warn)("Load test font never loaded.");t();return}o.font="30px "+e;o.fillText(".",0,20);o.getImageData(0,0,1,1).data[3]>0?t():setTimeout(isFontReady.bind(null,e,t))}(c,(()=>{g.remove();t.complete()}))}};t.FontFaceObject=class FontFaceObject{constructor(e,t){let{isEvalSupported:i=!0,disableFontFace:n=!1,ignoreErrors:s=!1,onUnsupportedFeature:r,fontRegistry:a=null}=t;this.compiledGlyphs=Object.create(null);for(const t in e)this[t]=e[t];this.isEvalSupported=!1!==i;this.disableFontFace=!0===n;this.ignoreErrors=!0===s;this._onUnsupportedFeature=r;this.fontRegistry=a}createNativeFontFace(){var e;if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`);t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});null===(e=this.fontRegistry)||void 0===e||e.registerFont(this);return t}createFontFaceRule(){var e;if(!this.data||this.disableFontFace)return null;const t=(0,n.bytesToString)(this.data),i=`url(data:${this.mimetype};base64,${btoa(t)});`;let s;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`);s=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${i}}`}else s=`@font-face {font-family:"${this.loadedName}";src:${i}}`;null===(e=this.fontRegistry)||void 0===e||e.registerFont(this,i);return s}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let i;try{i=e.get(this.loadedName+"_path_"+t)}catch(e){if(!this.ignoreErrors)throw e;this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.errorFontGetPath});(0,n.warn)(`getPathGenerator - ignoring character: "${e}".`);return this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&n.FeatureTest.isEvalSupported){const e=[];for(const t of i){const i=void 0!==t.args?t.args.join(","):"";e.push("c.",t.cmd,"(",i,");\n")}return this.compiledGlyphs[t]=new Function("c","size",e.join(""))}return this.compiledGlyphs[t]=function(e,t){for(const n of i){"scale"===n.cmd&&(n.args=[t,-t]);e[n.cmd].apply(e,n.args)}}}}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.isNodeJS=void 0;const i=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);t.isNodeJS=i},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CanvasGraphics=void 0;var n=i(1),s=i(138),r=i(144),a=i(145);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 o=4096,l=1e3,c=16;class CachedCanvases{constructor(e){this.canvasFactory=e;this.cache=Object.create(null)}getCanvas(e,t,i){let n;if(void 0!==this.cache[e]){n=this.cache[e];this.canvasFactory.reset(n,t,i)}else{n=this.canvasFactory.create(t,i);this.cache[e]=n}return n}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t);delete this.cache[e]}}}function drawImageAtIntegerCoords(e,t,i,n,r,a,o,l,c,d){const[h,u,p,g,f,m]=(0,s.getCurrentTransform)(e);if(0===u&&0===p){const s=o*h+f,v=Math.round(s),_=l*g+m,b=Math.round(_),w=(o+c)*h+f,y=Math.abs(Math.round(w)-v)||1,P=(l+d)*g+m,S=Math.abs(Math.round(P)-b)||1;e.setTransform(Math.sign(h),0,0,Math.sign(g),v,b);e.drawImage(t,i,n,r,a,0,0,y,S);e.setTransform(h,u,p,g,f,m);return[y,S]}if(0===h&&0===g){const s=l*p+f,v=Math.round(s),_=o*u+m,b=Math.round(_),w=(l+d)*p+f,y=Math.abs(Math.round(w)-v)||1,P=(o+c)*u+m,S=Math.abs(Math.round(P)-b)||1;e.setTransform(0,Math.sign(u),Math.sign(p),0,v,b);e.drawImage(t,i,n,r,a,0,0,S,y);e.setTransform(h,u,p,g,f,m);return[S,y]}e.drawImage(t,i,n,r,a,o,l,c,d);return[Math.hypot(h,u)*c,Math.hypot(p,g)*d]}class CanvasExtraState{constructor(e,t){this.alphaIsShape=!1;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=n.IDENTITY_MATRIX;this.textMatrixScale=1;this.fontMatrix=n.FONT_IDENTITY_MATRIX;this.leading=0;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRenderingMode=n.TextRenderingMode.FILL;this.textRise=0;this.fillColor="#000000";this.strokeColor="#000000";this.patternFill=!1;this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.activeSMask=null;this.transferMaps=null;this.startNewPathAndClipBox([0,0,e,t])}clone(){const e=Object.create(this);e.clipBox=this.clipBox.slice();return e}setCurrentPoint(e,t){this.x=e;this.y=t}updatePathMinMax(e,t,i){[t,i]=n.Util.applyTransform([t,i],e);this.minX=Math.min(this.minX,t);this.minY=Math.min(this.minY,i);this.maxX=Math.max(this.maxX,t);this.maxY=Math.max(this.maxY,i)}updateRectMinMax(e,t){const i=n.Util.applyTransform(t,e),s=n.Util.applyTransform(t.slice(2),e);this.minX=Math.min(this.minX,i[0],s[0]);this.minY=Math.min(this.minY,i[1],s[1]);this.maxX=Math.max(this.maxX,i[0],s[0]);this.maxY=Math.max(this.maxY,i[1],s[1])}updateScalingPathMinMax(e,t){n.Util.scaleMinMax(e,t);this.minX=Math.min(this.minX,t[0]);this.maxX=Math.max(this.maxX,t[1]);this.minY=Math.min(this.minY,t[2]);this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,i,s,r,a,o,l,c,d){const h=n.Util.bezierBoundingBox(t,i,s,r,a,o,l,c);if(d){d[0]=Math.min(d[0],h[0],h[2]);d[1]=Math.max(d[1],h[0],h[2]);d[2]=Math.min(d[2],h[1],h[3]);d[3]=Math.max(d[3],h[1],h[3])}else this.updateRectMinMax(e,h)}getPathBoundingBox(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.PathType.FILL,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[this.minX,this.minY,this.maxX,this.maxY];if(e===r.PathType.STROKE){t||(0,n.unreachable)("Stroke bounding box must include transform.");const e=n.Util.singularValueDecompose2dScale(t),s=e[0]*this.lineWidth/2,r=e[1]*this.lineWidth/2;i[0]-=s;i[1]-=r;i[2]+=s;i[3]+=r}return i}updateClipFromPath(){const e=n.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e;this.minX=1/0;this.minY=1/0;this.maxX=0;this.maxY=0}getClippedPathBoundingBox(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.PathType.FILL,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.Util.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function putBinaryImageData(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("undefined"!=typeof ImageData&&t instanceof ImageData){e.putImageData(t,0,0);return}const s=t.height,r=t.width,a=s%c,o=(s-a)/c,l=0===a?o:o+1,d=e.createImageData(r,c);let h,u=0;const p=t.data,g=d.data;let f,m,v,_,b,w,y,P;if(i)switch(i.length){case 1:b=i[0];w=i[0];y=i[0];P=i[0];break;case 4:b=i[0];w=i[1];y=i[2];P=i[3]}if(t.kind===n.ImageKind.GRAYSCALE_1BPP){const t=p.byteLength,i=new Uint32Array(g.buffer,0,g.byteLength>>2),s=i.length,_=r+7>>3;let b=4294967295,w=n.FeatureTest.isLittleEndian?4278190080:255;P&&255===P[0]&&0===P[255]&&([b,w]=[w,b]);for(f=0;f<l;f++){v=f<o?c:a;h=0;for(m=0;m<v;m++){const e=t-u;let n=0;const s=e>_?r:8*e-7,a=-8&s;let o=0,l=0;for(;n<a;n+=8){l=p[u++];i[h++]=128&l?b:w;i[h++]=64&l?b:w;i[h++]=32&l?b:w;i[h++]=16&l?b:w;i[h++]=8&l?b:w;i[h++]=4&l?b:w;i[h++]=2&l?b:w;i[h++]=1&l?b:w}for(;n<s;n++){if(0===o){l=p[u++];o=128}i[h++]=l&o?b:w;o>>=1}}for(;h<s;)i[h++]=0;e.putImageData(d,0,f*c)}}else if(t.kind===n.ImageKind.RGBA_32BPP){const t=!!(b||w||y);m=0;_=r*c*4;for(f=0;f<o;f++){g.set(p.subarray(u,u+_));u+=_;if(t)for(let e=0;e<_;e+=4){b&&(g[e+0]=b[g[e+0]]);w&&(g[e+1]=w[g[e+1]]);y&&(g[e+2]=y[g[e+2]])}e.putImageData(d,0,m);m+=c}if(f<l){_=r*a*4;g.set(p.subarray(u,u+_));if(t)for(let e=0;e<_;e+=4){b&&(g[e+0]=b[g[e+0]]);w&&(g[e+1]=w[g[e+1]]);y&&(g[e+2]=y[g[e+2]])}e.putImageData(d,0,m)}}else{if(t.kind!==n.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${t.kind}`);{const t=!!(b||w||y);v=c;_=r*v;for(f=0;f<l;f++){if(f>=o){v=a;_=r*v}h=0;for(m=_;m--;){g[h++]=p[u++];g[h++]=p[u++];g[h++]=p[u++];g[h++]=255}if(t)for(let e=0;e<h;e+=4){b&&(g[e+0]=b[g[e+0]]);w&&(g[e+1]=w[g[e+1]]);y&&(g[e+2]=y[g[e+2]])}e.putImageData(d,0,f*c)}}}}function putBinaryImageMask(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}const i=t.height,n=t.width,s=i%c,r=(i-s)/c,o=0===s?r:r+1,l=e.createImageData(n,c);let d=0;const h=t.data,u=l.data;for(let t=0;t<o;t++){const i=t<r?c:s;({srcPos:d}=(0,a.applyMaskImageData)({src:h,srcPos:d,dest:u,width:n,height:i}));e.putImageData(l,0,t*c)}}function copyCtxState(e,t){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(const n of i)void 0!==e[n]&&(t[n]=e[n]);if(void 0!==e.setLineDash){t.setLineDash(e.getLineDash());t.lineDashOffset=e.lineDashOffset}}function resetCtxToDefault(e,t){e.strokeStyle=e.fillStyle=t||"#000000";e.fillRule="nonzero";e.globalAlpha=1;e.lineWidth=1;e.lineCap="butt";e.lineJoin="miter";e.miterLimit=10;e.globalCompositeOperation="source-over";e.font="10px sans-serif";if(void 0!==e.setLineDash){e.setLineDash([]);e.lineDashOffset=0}}function composeSMaskBackdrop(e,t,i,n){const s=e.length;for(let r=3;r<s;r+=4){const s=e[r];if(0===s){e[r-3]=t;e[r-2]=i;e[r-1]=n}else if(s<255){const a=255-s;e[r-3]=e[r-3]*s+t*a>>8;e[r-2]=e[r-2]*s+i*a>>8;e[r-1]=e[r-1]*s+n*a>>8}}}function composeSMaskAlpha(e,t,i){const n=e.length;for(let s=3;s<n;s+=4){const n=i?i[e[s]]:e[s];t[s]=t[s]*n*.00392156862745098|0}}function composeSMaskLuminosity(e,t,i){const n=e.length;for(let s=3;s<n;s+=4){const n=77*e[s-3]+152*e[s-2]+28*e[s-1];t[s]=i?t[s]*i[n>>8]>>8:t[s]*n>>16}}function composeSMask(e,t,i,n){const s=n[0],r=n[1],a=n[2]-s,o=n[3]-r;if(0!==a&&0!==o){!function genericComposeSMask(e,t,i,n,s,r,a,o,l,c,d){const h=!!r,u=h?r[0]:0,p=h?r[1]:0,g=h?r[2]:0;let f;f="Luminosity"===s?composeSMaskLuminosity:composeSMaskAlpha;const m=Math.min(n,Math.ceil(1048576/i));for(let s=0;s<n;s+=m){const r=Math.min(m,n-s),v=e.getImageData(o-c,s+(l-d),i,r),_=t.getImageData(o,s+l,i,r);h&&composeSMaskBackdrop(v.data,u,p,g);f(v.data,_.data,a);t.putImageData(_,o,s+l)}}(t.context,i,a,o,t.subtype,t.backdrop,t.transferMap,s,r,t.offsetX,t.offsetY);e.save();e.globalAlpha=1;e.globalCompositeOperation="source-over";e.setTransform(1,0,0,1,0,0);e.drawImage(i.canvas,0,0);e.restore()}}function getImageSmoothingEnabled(e,t){const i=n.Util.singularValueDecompose2dScale(e);i[0]=Math.fround(i[0]);i[1]=Math.fround(i[1]);const r=Math.fround((globalThis.devicePixelRatio||1)*s.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==t?t:i[0]<=r||i[1]<=r}const d=["butt","round","square"],h=["miter","round","bevel"],u={},p={};var g=new WeakSet;class CanvasGraphics{constructor(e,t,i,n,s,r,a){let{optionalContentConfig:o,markedContentStack:l=null}=s;_classPrivateMethodInitSpec(this,g);this.ctx=e;this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.stateStack=[];this.pendingClip=null;this.pendingEOFill=!1;this.res=null;this.xobjs=null;this.commonObjs=t;this.objs=i;this.canvasFactory=n;this.groupStack=[];this.processingType3=null;this.baseTransform=null;this.baseTransformStack=[];this.groupLevel=0;this.smaskStack=[];this.smaskCounter=0;this.tempSMask=null;this.suspendedCtx=null;this.contentVisible=!0;this.markedContentStack=l||[];this.optionalContentConfig=o;this.cachedCanvases=new CachedCanvases(this.canvasFactory);this.cachedPatterns=new Map;this.annotationCanvasMap=r;this.viewportScale=1;this.outputScaleX=1;this.outputScaleY=1;this.backgroundColor=(null==a?void 0:a.background)||null;this.foregroundColor=(null==a?void 0:a.foreground)||null;this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null;this._cachedBitmapsMap=new Map}getObject(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing(e){let{transform:t,viewport:i,transparency:n=!1,background:r=null,backgroundColorToReplace:a=null}=e;const o=this.ctx.canvas.width,l=this.ctx.canvas.height,c=r||"#ffffff";this.ctx.save();if("function"==typeof r)r({context:this.ctx,width:o,height:l});else if(this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;const e=this.foregroundColor=this.ctx.fillStyle;this.ctx.fillStyle=this.backgroundColor;const t=this.backgroundColor=this.ctx.fillStyle;let i=!0,n=c;this.ctx.fillStyle=c;n=this.ctx.fillStyle;i="string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n);if("#000000"===e&&"#ffffff"===t||e===t||!i)this.foregroundColor=this.backgroundColor=null;else{const[i,r,a]=(0,s.getRGB)(n),newComp=e=>(e/=255)<=.03928?e/12.92:((e+.055)/1.055)**2.4,o=Math.round(.2126*newComp(i)+.7152*newComp(r)+.0722*newComp(a));this.selectColor=(i,n,s)=>{const r=.2126*newComp(i)+.7152*newComp(n)+.0722*newComp(s);return Math.round(r)===o?t:e}}}else{r&&(this.background=r);this.backgroundColor=r}if("function"!=typeof r){this.ctx.fillStyle=this.backgroundColor||c;this.ctx.fillRect(0,0,o,l)}this.ctx.restore();this.backgroundColorToReplace=a;if(n){const e=this.cachedCanvases.getCanvas("transparent",o,l);this.compositeCtx=this.ctx;this.transparentCanvas=e.canvas;this.ctx=e.context;this.ctx.save();this.ctx.transform(...(0,s.getCurrentTransform)(this.compositeCtx))}this.ctx.save();resetCtxToDefault(this.ctx,this.foregroundColor);if(t){this.ctx.transform(...t);this.outputScaleX=t[0];this.outputScaleY=t[0]}this.ctx.transform(...i.transform);this.viewportScale=i.scale;this.baseTransform=(0,s.getCurrentTransform)(this.ctx)}executeOperatorList(e,t,i,s){const r=e.argsArray,a=e.fnArray;let o=t||0;const l=r.length;if(l===o)return o;const c=l-o>10&&"function"==typeof i,d=c?Date.now()+15:0;let h=0;const u=this.commonObjs,p=this.objs;let g;for(;;){if(void 0!==s&&o===s.nextBreakPoint){s.breakIt(o,i);return o}g=a[o];if(g!==n.OPS.dependency)this[g].apply(this,r[o]);else for(const e of r[o]){const t=e.startsWith("g_")?u:p;if(!t.has(e)){t.get(e,i);return o}}o++;if(o===l)return o;if(c&&++h>10){if(Date.now()>d){i();return o}h=0}}}endDrawing(){_classPrivateMethodGet(this,g,_restoreInitialState2).call(this);this.cachedCanvases.clear();this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear()}_scaleImage(e,t){const i=e.width,n=e.height;let s,r,a=Math.max(Math.hypot(t[0],t[1]),1),o=Math.max(Math.hypot(t[2],t[3]),1),l=i,c=n,d="prescale1";for(;a>2&&l>1||o>2&&c>1;){let t=l,i=c;if(a>2&&l>1){t=Math.ceil(l/2);a/=l/t}if(o>2&&c>1){i=Math.ceil(c/2);o/=c/i}s=this.cachedCanvases.getCanvas(d,t,i);r=s.context;r.clearRect(0,0,t,i);r.drawImage(e,0,0,l,c,0,0,t,i);e=s.canvas;l=t;c=i;d="prescale1"===d?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}_createMaskCanvas(e){const t=this.ctx,{width:i,height:a}=e,o=this.current.fillColor,l=this.current.patternFill,c=(0,s.getCurrentTransform)(t);let d,h,u,p;if((e.bitmap||e.data)&&e.count>1){const t=e.bitmap||e.data.buffer;h=JSON.stringify(l?c:[c.slice(0,4),o]);d=this._cachedBitmapsMap.get(t);if(!d){d=new Map;this._cachedBitmapsMap.set(t,d)}const i=d.get(h);if(i&&!l){return{canvas:i,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])}}u=i}if(!u){p=this.cachedCanvases.getCanvas("maskCanvas",i,a);putBinaryImageMask(p.context,e)}let g=n.Util.transform(c,[1/i,0,0,-1/a,0,0]);g=n.Util.transform(g,[1,0,0,1,0,-a]);const f=n.Util.applyTransform([0,0],g),m=n.Util.applyTransform([i,a],g),v=n.Util.normalizeRect([f[0],f[1],m[0],m[1]]),_=Math.round(v[2]-v[0])||1,b=Math.round(v[3]-v[1])||1,w=this.cachedCanvases.getCanvas("fillCanvas",_,b),y=w.context,P=Math.min(f[0],m[0]),S=Math.min(f[1],m[1]);y.translate(-P,-S);y.transform(...g);if(!u){u=this._scaleImage(p.canvas,(0,s.getCurrentTransformInverse)(y));u=u.img;d&&l&&d.set(h,u)}y.imageSmoothingEnabled=getImageSmoothingEnabled((0,s.getCurrentTransform)(y),e.interpolate);drawImageAtIntegerCoords(y,u,0,0,u.width,u.height,0,0,i,a);y.globalCompositeOperation="source-in";const A=n.Util.transform((0,s.getCurrentTransformInverse)(y),[1,0,0,1,-P,-S]);y.fillStyle=l?o.getPattern(t,this,A,r.PathType.FILL):o;y.fillRect(0,0,i,a);if(d&&!l){this.cachedCanvases.delete("fillCanvas");d.set(h,w.canvas)}return{canvas:w.canvas,offsetX:Math.round(P),offsetY:Math.round(S)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking=null);this.current.lineWidth=e;this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=d[e]}setLineJoin(e){this.ctx.lineJoin=h[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const i=this.ctx;if(void 0!==i.setLineDash){i.setLineDash(e);i.lineDashOffset=t}}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,i]of e)switch(t){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i;this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null;this.tempSMask=null;this.checkSMaskState();break;case"TR":this.current.transferMaps=i}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(i,e,t);this.suspendedCtx=this.ctx;this.ctx=n.context;const r=this.ctx;r.setTransform(...(0,s.getCurrentTransform)(this.suspendedCtx));copyCtxState(this.suspendedCtx,r);!function mirrorContextOperations(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save;e.__originalRestore=e.restore;e.__originalRotate=e.rotate;e.__originalScale=e.scale;e.__originalTranslate=e.translate;e.__originalTransform=e.transform;e.__originalSetTransform=e.setTransform;e.__originalResetTransform=e.resetTransform;e.__originalClip=e.clip;e.__originalMoveTo=e.moveTo;e.__originalLineTo=e.lineTo;e.__originalBezierCurveTo=e.bezierCurveTo;e.__originalRect=e.rect;e.__originalClosePath=e.closePath;e.__originalBeginPath=e.beginPath;e._removeMirroring=()=>{e.save=e.__originalSave;e.restore=e.__originalRestore;e.rotate=e.__originalRotate;e.scale=e.__originalScale;e.translate=e.__originalTranslate;e.transform=e.__originalTransform;e.setTransform=e.__originalSetTransform;e.resetTransform=e.__originalResetTransform;e.clip=e.__originalClip;e.moveTo=e.__originalMoveTo;e.lineTo=e.__originalLineTo;e.bezierCurveTo=e.__originalBezierCurveTo;e.rect=e.__originalRect;e.closePath=e.__originalClosePath;e.beginPath=e.__originalBeginPath;delete e._removeMirroring};e.save=function ctxSave(){t.save();this.__originalSave()};e.restore=function ctxRestore(){t.restore();this.__originalRestore()};e.translate=function ctxTranslate(e,i){t.translate(e,i);this.__originalTranslate(e,i)};e.scale=function ctxScale(e,i){t.scale(e,i);this.__originalScale(e,i)};e.transform=function ctxTransform(e,i,n,s,r,a){t.transform(e,i,n,s,r,a);this.__originalTransform(e,i,n,s,r,a)};e.setTransform=function ctxSetTransform(e,i,n,s,r,a){t.setTransform(e,i,n,s,r,a);this.__originalSetTransform(e,i,n,s,r,a)};e.resetTransform=function ctxResetTransform(){t.resetTransform();this.__originalResetTransform()};e.rotate=function ctxRotate(e){t.rotate(e);this.__originalRotate(e)};e.clip=function ctxRotate(e){t.clip(e);this.__originalClip(e)};e.moveTo=function(e,i){t.moveTo(e,i);this.__originalMoveTo(e,i)};e.lineTo=function(e,i){t.lineTo(e,i);this.__originalLineTo(e,i)};e.bezierCurveTo=function(e,i,n,s,r,a){t.bezierCurveTo(e,i,n,s,r,a);this.__originalBezierCurveTo(e,i,n,s,r,a)};e.rect=function(e,i,n,s){t.rect(e,i,n,s);this.__originalRect(e,i,n,s)};e.closePath=function(){t.closePath();this.__originalClosePath()};e.beginPath=function(){t.beginPath();this.__originalBeginPath()}}(r,this.suspendedCtx);this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring();copyCtxState(this.ctx,this.suspendedCtx);this.ctx=this.suspendedCtx;this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;if(e){e[0]=Math.floor(e[0]);e[1]=Math.floor(e[1]);e[2]=Math.ceil(e[2]);e[3]=Math.ceil(e[3])}else e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask;composeSMask(this.suspendedCtx,t,this.ctx,e);this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height);this.ctx.restore()}save(){if(this.inSMaskMode){copyCtxState(this.ctx,this.suspendedCtx);this.suspendedCtx.save()}else this.ctx.save();const e=this.current;this.stateStack.push(e);this.current=e.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode();if(0!==this.stateStack.length){this.current=this.stateStack.pop();if(this.inSMaskMode){this.suspendedCtx.restore();copyCtxState(this.suspendedCtx,this.ctx)}else this.ctx.restore();this.checkSMaskState();this.pendingClip=null;this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}}transform(e,t,i,n,s,r){this.ctx.transform(e,t,i,n,s,r);this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}constructPath(e,t,i){const r=this.ctx,a=this.current;let o,l,c=a.x,d=a.y;const h=(0,s.getCurrentTransform)(r),u=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],p=u?i.slice(0):null;for(let i=0,s=0,g=e.length;i<g;i++)switch(0|e[i]){case n.OPS.rectangle:c=t[s++];d=t[s++];const e=t[s++],i=t[s++],g=c+e,f=d+i;r.moveTo(c,d);if(0===e||0===i)r.lineTo(g,f);else{r.lineTo(g,d);r.lineTo(g,f);r.lineTo(c,f)}u||a.updateRectMinMax(h,[c,d,g,f]);r.closePath();break;case n.OPS.moveTo:c=t[s++];d=t[s++];r.moveTo(c,d);u||a.updatePathMinMax(h,c,d);break;case n.OPS.lineTo:c=t[s++];d=t[s++];r.lineTo(c,d);u||a.updatePathMinMax(h,c,d);break;case n.OPS.curveTo:o=c;l=d;c=t[s+4];d=t[s+5];r.bezierCurveTo(t[s],t[s+1],t[s+2],t[s+3],c,d);a.updateCurvePathMinMax(h,o,l,t[s],t[s+1],t[s+2],t[s+3],c,d,p);s+=6;break;case n.OPS.curveTo2:o=c;l=d;r.bezierCurveTo(c,d,t[s],t[s+1],t[s+2],t[s+3]);a.updateCurvePathMinMax(h,o,l,c,d,t[s],t[s+1],t[s+2],t[s+3],p);c=t[s+2];d=t[s+3];s+=4;break;case n.OPS.curveTo3:o=c;l=d;c=t[s+2];d=t[s+3];r.bezierCurveTo(t[s],t[s+1],c,d,c,d);a.updateCurvePathMinMax(h,o,l,t[s],t[s+1],c,d,c,d,p);s+=4;break;case n.OPS.closePath:r.closePath()}u&&a.updateScalingPathMinMax(h,p);a.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=this.ctx,i=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha;if(this.contentVisible)if("object"==typeof i&&null!=i&&i.getPattern){t.save();t.strokeStyle=i.getPattern(t,this,(0,s.getCurrentTransformInverse)(t),r.PathType.STROKE);this.rescaleAndStroke(!1);t.restore()}else this.rescaleAndStroke(!0);e&&this.consumePath(this.current.getClippedPathBoundingBox());t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath();this.stroke()}fill(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=this.ctx;let i=!0,n=this.current.fillColor;this.backgroundColorToReplace&&n===this.backgroundColorToReplace&&(this.background&&"function"!=typeof this.background?n=this.background:i=!1);let a=!1;if(this.current.patternFill){t.save();t.fillStyle=n.getPattern(t,this,(0,s.getCurrentTransformInverse)(t),r.PathType.FILL);a=!0}const o=this.current.getClippedPathBoundingBox();if(i&&this.contentVisible&&null!==o)if(this.pendingEOFill){t.fill("evenodd");this.pendingEOFill=!1}else t.fill();a&&t.restore();e&&this.consumePath(o)}eoFill(){this.pendingEOFill=!0;this.fill()}fillStroke(){this.fill(!1);this.stroke(!1);this.consumePath()}eoFillStroke(){this.pendingEOFill=!0;this.fillStroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0;this.closePath();this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=u}eoClip(){this.pendingClip=p}beginText(){this.current.textMatrix=n.IDENTITY_MATRIX;this.current.textMatrixScale=1;this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,t=this.ctx;if(void 0!==e){t.save();t.beginPath();for(const i of e){t.setTransform(...i.transform);t.translate(i.x,i.y);i.addToPath(t,i.fontSize)}t.restore();t.clip();t.beginPath();delete this.pendingTextPaths}else t.beginPath()}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){const i=this.commonObjs.get(e),s=this.current;if(!i)throw new Error(`Can't find font for ${e}`);s.fontMatrix=i.fontMatrix||n.FONT_IDENTITY_MATRIX;0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||(0,n.warn)("Invalid font matrix for font "+e);if(t<0){t=-t;s.fontDirection=-1}else s.fontDirection=1;this.current.font=i;this.current.fontSize=t;if(i.isType3Font)return;const r=i.loadedName||"sans-serif";let a="normal";i.black?a="900":i.bold&&(a="bold");const o=i.italic?"italic":"normal",l=`"${r}", ${i.fallbackName}`;let c=t;t<16?c=16:t>100&&(c=100);this.current.fontSizeScale=t/c;this.ctx.font=`${o} ${a} ${c}px ${l}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e;this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t);this.moveText(e,t)}setTextMatrix(e,t,i,n,s,r){this.current.textMatrix=[e,t,i,n,s,r];this.current.textMatrixScale=Math.hypot(e,t);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,i,r){const a=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,h=c&n.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&n.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;let g;(l.disableFontFace||u||p)&&(g=l.getPathGenerator(this.commonObjs,e));if(l.disableFontFace||p){a.save();a.translate(t,i);a.beginPath();g(a,d);r&&a.setTransform(...r);h!==n.TextRenderingMode.FILL&&h!==n.TextRenderingMode.FILL_STROKE||a.fill();h!==n.TextRenderingMode.STROKE&&h!==n.TextRenderingMode.FILL_STROKE||a.stroke();a.restore()}else{h!==n.TextRenderingMode.FILL&&h!==n.TextRenderingMode.FILL_STROKE||a.fillText(e,t,i);h!==n.TextRenderingMode.STROKE&&h!==n.TextRenderingMode.FILL_STROKE||a.strokeText(e,t,i)}if(u){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,s.getCurrentTransform)(a),x:t,y:i,fontSize:d,addToPath:g})}}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1);e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let i=!1;for(let e=3;e<t.length;e+=4)if(t[e]>0&&t[e]<255){i=!0;break}return(0,n.shadow)(this,"isFontSubpixelAAEnabled",i)}showText(e){const t=this.current,i=t.font;if(i.isType3Font)return this.showType3Text(e);const a=t.fontSize;if(0===a)return;const o=this.ctx,l=t.fontSizeScale,c=t.charSpacing,d=t.wordSpacing,h=t.fontDirection,u=t.textHScale*h,p=e.length,g=i.vertical,f=g?1:-1,m=i.defaultVMetrics,v=a*t.fontMatrix[0],_=t.textRenderingMode===n.TextRenderingMode.FILL&&!i.disableFontFace&&!t.patternFill;o.save();o.transform(...t.textMatrix);o.translate(t.x,t.y+t.textRise);h>0?o.scale(u,-1):o.scale(u,1);let b;if(t.patternFill){o.save();const e=t.fillColor.getPattern(o,this,(0,s.getCurrentTransformInverse)(o),r.PathType.FILL);b=(0,s.getCurrentTransform)(o);o.restore();o.fillStyle=e}let w=t.lineWidth;const y=t.textMatrixScale;if(0===y||0===w){const e=t.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;e!==n.TextRenderingMode.STROKE&&e!==n.TextRenderingMode.FILL_STROKE||(w=this.getSinglePixelWidth())}else w/=y;if(1!==l){o.scale(l,l);w/=l}o.lineWidth=w;if(i.isInvalidPDFjsFont){const i=[];let n=0;for(const t of e){i.push(t.unicode);n+=t.width}o.fillText(i.join(""),0,0);t.x+=n*v*u;o.restore();this.compose();return}let P,S=0;for(P=0;P<p;++P){const t=e[P];if("number"==typeof t){S+=f*t*a/1e3;continue}let n=!1;const s=(t.isSpace?d:0)+c,r=t.fontChar,u=t.accent;let p,w,y,A=t.width;if(g){const e=t.vmetric||m,i=-(t.vmetric?e[1]:.5*A)*v,n=e[2]*v;A=e?-e[0]:A;p=i/l;w=(S+n)/l}else{p=S/l;w=0}if(i.remeasure&&A>0){const e=1e3*o.measureText(r).width/a*l;if(A<e&&this.isFontSubpixelAAEnabled){const t=A/e;n=!0;o.save();o.scale(t,1);p/=t}else A!==e&&(p+=(A-e)/2e3*a/l)}if(this.contentVisible&&(t.isInFont||i.missingFile))if(_&&!u)o.fillText(r,p,w);else{this.paintChar(r,p,w,b);if(u){const e=p+a*u.offset.x/l,t=w-a*u.offset.y/l;this.paintChar(u.fontChar,e,t,b)}}y=g?A*v-s*h:A*v+s*h;S+=y;n&&o.restore()}g?t.y-=S:t.x+=S*u;o.restore();this.compose()}showType3Text(e){const t=this.ctx,i=this.current,s=i.font,r=i.fontSize,a=i.fontDirection,o=s.vertical?1:-1,l=i.charSpacing,c=i.wordSpacing,d=i.textHScale*a,h=i.fontMatrix||n.FONT_IDENTITY_MATRIX,u=e.length;let p,g,f,m;if(!(i.textRenderingMode===n.TextRenderingMode.INVISIBLE)&&0!==r){this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null;t.save();t.transform(...i.textMatrix);t.translate(i.x,i.y);t.scale(d,a);for(p=0;p<u;++p){g=e[p];if("number"==typeof g){m=o*g*r/1e3;this.ctx.translate(m,0);i.x+=m*d;continue}const a=(g.isSpace?c:0)+l,u=s.charProcOperatorList[g.operatorListId];if(!u){(0,n.warn)(`Type3 character "${g.operatorListId}" is not available.`);continue}if(this.contentVisible){this.processingType3=g;this.save();t.scale(r,r);t.transform(...h);this.executeOperatorList(u);this.restore()}f=n.Util.applyTransform([g.width,0],h)[0]*r+a;t.translate(f,0);i.x+=f*d}t.restore();this.processingType3=null}}setCharWidth(e,t){}setCharWidthAndBounds(e,t,i,n,s,r){this.ctx.rect(i,n,s-i,r-n);this.ctx.clip();this.endPath()}getColorN_Pattern(e){let t;if("TilingPattern"===e[0]){const i=e[1],n=this.baseTransform||(0,s.getCurrentTransform)(this.ctx),a={createCanvasGraphics:e=>new CanvasGraphics(e,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new r.TilingPattern(e,i,this.ctx,a,n)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments);this.current.patternFill=!0}setStrokeRGBColor(e,t,i){var s;const r=(null===(s=this.selectColor)||void 0===s?void 0:s.call(this,e,t,i))||n.Util.makeHexColor(e,t,i);this.ctx.strokeStyle=r;this.current.strokeColor=r}setFillRGBColor(e,t,i){var s;let r=(null===(s=this.selectColor)||void 0===s?void 0:s.call(this,e,t,i))||n.Util.makeHexColor(e,t,i);this.backgroundColorToReplace&&r===this.backgroundColorToReplace&&this.background&&"function"!=typeof this.background&&(r=this.background);this.ctx.fillStyle=r;this.current.fillColor=r;this.current.patternFill=!1}_getPattern(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.cachedPatterns.has(e))t=this.cachedPatterns.get(e);else{t=(0,r.getShadingPattern)(this.objs.get(e));this.cachedPatterns.set(e,t)}i&&(t.matrix=i);return t}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const i=this._getPattern(e);t.fillStyle=i.getPattern(t,this,(0,s.getCurrentTransformInverse)(t),r.PathType.SHADING);const a=(0,s.getCurrentTransformInverse)(t);if(a){const e=t.canvas,i=e.width,s=e.height,r=n.Util.applyTransform([0,0],a),o=n.Util.applyTransform([0,s],a),l=n.Util.applyTransform([i,0],a),c=n.Util.applyTransform([i,s],a),d=Math.min(r[0],o[0],l[0],c[0]),h=Math.min(r[1],o[1],l[1],c[1]),u=Math.max(r[0],o[0],l[0],c[0]),p=Math.max(r[1],o[1],l[1],c[1]);this.ctx.fillRect(d,h,u-d,p-h)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox());this.restore()}beginInlineImage(){(0,n.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,n.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible){this.save();this.baseTransformStack.push(this.baseTransform);Array.isArray(e)&&6===e.length&&this.transform(...e);this.baseTransform=(0,s.getCurrentTransform)(this.ctx);if(t){const e=t[2]-t[0],i=t[3]-t[1];this.ctx.rect(t[0],t[1],e,i);this.current.updateRectMinMax((0,s.getCurrentTransform)(this.ctx),t);this.clip();this.endPath()}}}paintFormXObjectEnd(){if(this.contentVisible){this.restore();this.baseTransform=this.baseTransformStack.pop()}}beginGroup(e){if(!this.contentVisible)return;this.save();if(this.inSMaskMode){this.endSMaskMode();this.current.activeSMask=null}const t=this.ctx;e.isolated||(0,n.info)("TODO: Support non-isolated groups.");e.knockout&&(0,n.warn)("Knockout groups not supported.");const i=(0,s.getCurrentTransform)(t);e.matrix&&t.transform(...e.matrix);if(!e.bbox)throw new Error("Bounding box is required.");let r=n.Util.getAxialAlignedBoundingBox(e.bbox,(0,s.getCurrentTransform)(t));const a=[0,0,t.canvas.width,t.canvas.height];r=n.Util.intersect(r,a)||[0,0,0,0];const l=Math.floor(r[0]),c=Math.floor(r[1]);let d=Math.max(Math.ceil(r[2])-l,1),h=Math.max(Math.ceil(r[3])-c,1),u=1,p=1;if(d>o){u=d/o;d=o}if(h>o){p=h/o;h=o}this.current.startNewPathAndClipBox([0,0,d,h]);let g="groupAt"+this.groupLevel;e.smask&&(g+="_smask_"+this.smaskCounter++%2);const f=this.cachedCanvases.getCanvas(g,d,h),m=f.context;m.scale(1/u,1/p);m.translate(-l,-c);m.transform(...i);if(e.smask)this.smaskStack.push({canvas:f.canvas,context:m,offsetX:l,offsetY:c,scaleX:u,scaleY:p,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null});else{t.setTransform(1,0,0,1,0,0);t.translate(l,c);t.scale(u,p);t.save()}copyCtxState(t,m);this.ctx=m;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(t);this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,i=this.groupStack.pop();this.ctx=i;this.ctx.imageSmoothingEnabled=!1;if(e.smask){this.tempSMask=this.smaskStack.pop();this.restore()}else{this.ctx.restore();const e=(0,s.getCurrentTransform)(this.ctx);this.restore();this.ctx.save();this.ctx.setTransform(...e);const i=n.Util.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e);this.ctx.drawImage(t.canvas,0,0);this.ctx.restore();this.compose(i)}}beginAnnotation(e,t,i,r,a){_classPrivateMethodGet(this,g,_restoreInitialState2).call(this);resetCtxToDefault(this.ctx,this.foregroundColor);this.ctx.save();this.save();this.baseTransform&&this.ctx.setTransform(...this.baseTransform);if(Array.isArray(t)&&4===t.length){const r=t[2]-t[0],o=t[3]-t[1];if(a&&this.annotationCanvasMap){(i=i.slice())[4]-=t[0];i[5]-=t[1];(t=t.slice())[0]=t[1]=0;t[2]=r;t[3]=o;const[a,l]=n.Util.singularValueDecompose2dScale((0,s.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,d=Math.ceil(r*this.outputScaleX*c),h=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,h);const{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(e,u);this.annotationCanvas.savedCtx=this.ctx;this.ctx=p;this.ctx.setTransform(a,0,0,-l,0,o*l);resetCtxToDefault(this.ctx,this.foregroundColor)}else{resetCtxToDefault(this.ctx,this.foregroundColor);this.ctx.rect(t[0],t[1],r,o);this.ctx.clip();this.endPath()}}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.transform(...i);this.transform(...r)}endAnnotation(){if(this.annotationCanvas){this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;(e=this.getObject(e.data,e)).count=t;const i=this.ctx,n=this.processingType3;if(n){void 0===n.compiled&&(n.compiled=function compileType3Glyph(e){const{width:t,height:i}=e;if(t>l||i>l)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=t+1;let r,a,o,c=new Uint8Array(s*(i+1));const d=t+7&-8;let h=new Uint8Array(d*i),u=0;for(const t of e.data){let e=128;for(;e>0;){h[u++]=t&e?0:255;e>>=1}}let p=0;u=0;if(0!==h[u]){c[0]=1;++p}for(a=1;a<t;a++){if(h[u]!==h[u+1]){c[a]=h[u]?2:1;++p}u++}if(0!==h[u]){c[a]=2;++p}for(r=1;r<i;r++){u=r*d;o=r*s;if(h[u-d]!==h[u]){c[o]=h[u]?1:8;++p}let e=(h[u]?4:0)+(h[u-d]?8:0);for(a=1;a<t;a++){e=(e>>2)+(h[u+1]?4:0)+(h[u-d+1]?8:0);if(n[e]){c[o+a]=n[e];++p}u++}if(h[u-d]!==h[u]){c[o+a]=h[u]?2:4;++p}if(p>1e3)return null}u=d*(i-1);o=r*s;if(0!==h[u]){c[o]=8;++p}for(a=1;a<t;a++){if(h[u]!==h[u+1]){c[o+a]=h[u]?4:8;++p}u++}if(0!==h[u]){c[o+a]=4;++p}if(p>1e3)return null;const g=new Int32Array([0,s,-1,0,-s,0,0,0,1]),f=new Path2D;for(r=0;p&&r<=i;r++){let e=r*s;const i=e+t;for(;e<i&&!c[e];)e++;if(e===i)continue;f.moveTo(e%s,r);const n=e;let a=c[e];do{const t=g[a];do{e+=t}while(!c[e]);const i=c[e];if(5!==i&&10!==i){a=i;c[e]=0}else{a=i&51*a>>4;c[e]&=a>>2|a<<2}f.lineTo(e%s,e/s|0);c[e]||--p}while(n!==e);--r}h=null;c=null;return function(e){e.save();e.scale(1/t,-1/i);e.translate(0,-i);e.fill(f);e.beginPath();e.restore()}}(e));if(n.compiled){n.compiled(i);return}}const s=this._createMaskCanvas(e),r=s.canvas;i.save();i.setTransform(1,0,0,1,0,0);i.drawImage(r,s.offsetX,s.offsetY);i.restore();this.compose()}paintImageMaskXObjectRepeat(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;e=this.getObject(e.data,e);const l=this.ctx;l.save();const c=(0,s.getCurrentTransform)(l);l.transform(t,i,r,a,0,0);const d=this._createMaskCanvas(e);l.setTransform(1,0,0,1,d.offsetX-c[4],d.offsetY-c[5]);for(let e=0,s=o.length;e<s;e+=2){const s=n.Util.transform(c,[t,i,r,a,o[e],o[e+1]]),[h,u]=n.Util.applyTransform([0,0],s);l.drawImage(d.canvas,h,u)}l.restore();this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const t=this.ctx,i=this.current.fillColor,n=this.current.patternFill;for(const a of e){const{data:e,width:o,height:l,transform:c}=a,d=this.cachedCanvases.getCanvas("maskCanvas",o,l),h=d.context;h.save();putBinaryImageMask(h,this.getObject(e,a));h.globalCompositeOperation="source-in";h.fillStyle=n?i.getPattern(h,this,(0,s.getCurrentTransformInverse)(t),r.PathType.FILL):i;h.fillRect(0,0,o,l);h.restore();t.save();t.transform(...c);t.scale(1,-1);drawImageAtIntegerCoords(t,d.canvas,0,0,o,l,0,-1,1,1);t.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const t=this.getObject(e);t?this.paintInlineImageXObject(t):(0,n.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(e,t,i,s){if(!this.contentVisible)return;const r=this.getObject(e);if(!r){(0,n.warn)("Dependent image isn't ready yet");return}const a=r.width,o=r.height,l=[];for(let e=0,n=s.length;e<n;e+=2)l.push({transform:[t,0,0,i,s[e],s[e+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(r,l)}paintInlineImageXObject(e){if(!this.contentVisible)return;const t=e.width,i=e.height,n=this.ctx;this.save();n.scale(1/t,-1/i);let r;if("function"==typeof HTMLElement&&e instanceof HTMLElement||!e.data)r=e;else{const n=this.cachedCanvases.getCanvas("inlineImage",t,i);putBinaryImageData(n.context,e,this.current.transferMaps);r=n.canvas}const a=this._scaleImage(r,(0,s.getCurrentTransformInverse)(n));n.imageSmoothingEnabled=getImageSmoothingEnabled((0,s.getCurrentTransform)(n),e.interpolate);drawImageAtIntegerCoords(n,a.img,0,0,a.paintWidth,a.paintHeight,0,-i,t,i);this.compose();this.restore()}paintInlineImageXObjectGroup(e,t){if(!this.contentVisible)return;const i=this.ctx,n=e.width,s=e.height,r=this.cachedCanvases.getCanvas("inlineImage",n,s);putBinaryImageData(r.context,e,this.current.transferMaps);for(const e of t){i.save();i.transform(...e.transform);i.scale(1,-1);drawImageAtIntegerCoords(i,r.canvas,e.x,e.y,e.w,e.h,0,-1,1,1);i.restore()}this.compose()}paintSolidColorImageMask(){if(this.contentVisible){this.ctx.fillRect(0,0,1,1);this.compose()}}markPoint(e){}markPointProps(e,t){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t){"OC"===e?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(t)}):this.markedContentStack.push({visible:!0});this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop();this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){const t=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath();this.pendingClip||this.compose(e);const i=this.ctx;if(this.pendingClip){t||(this.pendingClip===p?i.clip("evenodd"):i.clip());this.pendingClip=null}this.current.startNewPathAndClipBox(this.current.clipBox);i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=(0,s.getCurrentTransform)(this.ctx);if(0===e[1]&&0===e[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const t=Math.abs(e[0]*e[3]-e[2]*e[1]),i=Math.hypot(e[0],e[2]),n=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(i,n)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){const{lineWidth:e}=this.current,t=(0,s.getCurrentTransform)(this.ctx);let i,n;if(0===t[1]&&0===t[2]){const s=Math.abs(t[0]),r=Math.abs(t[3]);if(0===e){i=1/s;n=1/r}else{const t=s*e,a=r*e;i=t<1?1/t:1;n=a<1?1/a:1}}else{const s=Math.abs(t[0]*t[3]-t[2]*t[1]),r=Math.hypot(t[0],t[1]),a=Math.hypot(t[2],t[3]);if(0===e){i=a/s;n=r/s}else{const t=e*s;i=a>t?a/t:1;n=r>t?r/t:1}}this._cachedScaleForStroking=[i,n]}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:i}=this.current,[n,r]=this.getScaleForStroking();t.lineWidth=i||1;if(1===n&&1===r){t.stroke();return}let a,o,l;if(e){a=(0,s.getCurrentTransform)(t);o=t.getLineDash().slice();l=t.lineDashOffset}t.scale(n,r);const c=Math.max(n,r);t.setLineDash(t.getLineDash().map((e=>e/c)));t.lineDashOffset/=c;t.stroke();if(e){t.setTransform(...a);t.setLineDash(o);t.lineDashOffset=l}}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}t.CanvasGraphics=CanvasGraphics;function _restoreInitialState2(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore();if(this.transparentCanvas){this.ctx=this.compositeCtx;this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.drawImage(this.transparentCanvas,0,0);this.ctx.restore();this.transparentCanvas=null}}for(const e in n.OPS)void 0!==CanvasGraphics.prototype[e]&&(CanvasGraphics.prototype[n.OPS[e]]=CanvasGraphics.prototype[e])},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TilingPattern=t.PathType=void 0;t.getShadingPattern=function getShadingPattern(e){switch(e[0]){case"RadialAxial":return new RadialAxialShadingPattern(e);case"Mesh":return new MeshShadingPattern(e);case"Dummy":return new DummyShadingPattern}throw new Error(`Unknown IR type: ${e[0]}`)};var n=i(1),s=i(138);const r={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};t.PathType=r;function applyBoundingBox(e,t){if(!t)return;const i=t[2]-t[0],n=t[3]-t[1],s=new Path2D;s.rect(t[0],t[1],i,n);e.clip(s)}class BaseShadingPattern{constructor(){this.constructor===BaseShadingPattern&&(0,n.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,n.unreachable)("Abstract method `getPattern` called.")}}class RadialAxialShadingPattern extends BaseShadingPattern{constructor(e){super();this._type=e[1];this._bbox=e[2];this._colorStops=e[3];this._p0=e[4];this._p1=e[5];this._r0=e[6];this._r1=e[7];this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,i,a){let o;if(a===r.STROKE||a===r.FILL){const r=t.current.getClippedPathBoundingBox(a,(0,s.getCurrentTransform)(e))||[0,0,0,0],l=Math.ceil(r[2]-r[0])||1,c=Math.ceil(r[3]-r[1])||1,d=t.cachedCanvases.getCanvas("pattern",l,c,!0),h=d.context;h.clearRect(0,0,h.canvas.width,h.canvas.height);h.beginPath();h.rect(0,0,h.canvas.width,h.canvas.height);h.translate(-r[0],-r[1]);i=n.Util.transform(i,[1,0,0,1,r[0],r[1]]);h.transform(...t.baseTransform);this.matrix&&h.transform(...this.matrix);applyBoundingBox(h,this._bbox);h.fillStyle=this._createGradient(h);h.fill();o=e.createPattern(d.canvas,"no-repeat");const u=new DOMMatrix(i);o.setTransform(u)}else{applyBoundingBox(e,this._bbox);o=this._createGradient(e)}return o}}function drawTriangle(e,t,i,n,s,r,a,o){const l=t.coords,c=t.colors,d=e.data,h=4*e.width;let u;if(l[i+1]>l[n+1]){u=i;i=n;n=u;u=r;r=a;a=u}if(l[n+1]>l[s+1]){u=n;n=s;s=u;u=a;a=o;o=u}if(l[i+1]>l[n+1]){u=i;i=n;n=u;u=r;r=a;a=u}const p=(l[i]+t.offsetX)*t.scaleX,g=(l[i+1]+t.offsetY)*t.scaleY,f=(l[n]+t.offsetX)*t.scaleX,m=(l[n+1]+t.offsetY)*t.scaleY,v=(l[s]+t.offsetX)*t.scaleX,_=(l[s+1]+t.offsetY)*t.scaleY;if(g>=_)return;const b=c[r],w=c[r+1],y=c[r+2],P=c[a],S=c[a+1],A=c[a+2],E=c[o],x=c[o+1],C=c[o+2],M=Math.round(g),T=Math.round(_);let k,I,D,R,L,O,N,B;for(let e=M;e<=T;e++){if(e<m){let t;t=e<g?0:(g-e)/(g-m);k=p-(p-f)*t;I=b-(b-P)*t;D=w-(w-S)*t;R=y-(y-A)*t}else{let t;t=e>_?1:m===_?0:(m-e)/(m-_);k=f-(f-v)*t;I=P-(P-E)*t;D=S-(S-x)*t;R=A-(A-C)*t}let t;t=e<g?0:e>_?1:(g-e)/(g-_);L=p-(p-v)*t;O=b-(b-E)*t;N=w-(w-x)*t;B=y-(y-C)*t;const i=Math.round(Math.min(k,L)),n=Math.round(Math.max(k,L));let s=h*e+4*i;for(let e=i;e<=n;e++){t=(k-e)/(k-L);t<0?t=0:t>1&&(t=1);d[s++]=I-(I-O)*t|0;d[s++]=D-(D-N)*t|0;d[s++]=R-(R-B)*t|0;d[s++]=255}}}function drawFigure(e,t,i){const n=t.coords,s=t.colors;let r,a;switch(t.type){case"lattice":const o=t.verticesPerRow,l=Math.floor(n.length/o)-1,c=o-1;for(r=0;r<l;r++){let t=r*o;for(let r=0;r<c;r++,t++){drawTriangle(e,i,n[t],n[t+1],n[t+o],s[t],s[t+1],s[t+o]);drawTriangle(e,i,n[t+o+1],n[t+1],n[t+o],s[t+o+1],s[t+1],s[t+o])}}break;case"triangles":for(r=0,a=n.length;r<a;r+=3)drawTriangle(e,i,n[r],n[r+1],n[r+2],s[r],s[r+1],s[r+2]);break;default:throw new Error("illegal figure")}}class MeshShadingPattern extends BaseShadingPattern{constructor(e){super();this._coords=e[2];this._colors=e[3];this._figures=e[4];this._bounds=e[5];this._bbox=e[7];this._background=e[8];this.matrix=null}_createMeshCanvas(e,t,i){const n=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),r=Math.ceil(this._bounds[2])-n,a=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(r*e[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(a*e[1]*1.1)),3e3),c=r/o,d=a/l,h={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-s,scaleX:1/c,scaleY:1/d},u=o+4,p=l+4,g=i.getCanvas("mesh",u,p,!1),f=g.context,m=f.createImageData(o,l);if(t){const e=m.data;for(let i=0,n=e.length;i<n;i+=4){e[i]=t[0];e[i+1]=t[1];e[i+2]=t[2];e[i+3]=255}}for(const e of this._figures)drawFigure(m,e,h);f.putImageData(m,2,2);return{canvas:g.canvas,offsetX:n-2*c,offsetY:s-2*d,scaleX:c,scaleY:d}}getPattern(e,t,i,a){applyBoundingBox(e,this._bbox);let o;if(a===r.SHADING)o=n.Util.singularValueDecompose2dScale((0,s.getCurrentTransform)(e));else{o=n.Util.singularValueDecompose2dScale(t.baseTransform);if(this.matrix){const e=n.Util.singularValueDecompose2dScale(this.matrix);o=[o[0]*e[0],o[1]*e[1]]}}const l=this._createMeshCanvas(o,a===r.SHADING?null:this._background,t.cachedCanvases);if(a!==r.SHADING){e.setTransform(...t.baseTransform);this.matrix&&e.transform(...this.matrix)}e.translate(l.offsetX,l.offsetY);e.scale(l.scaleX,l.scaleY);return e.createPattern(l.canvas,"no-repeat")}}class DummyShadingPattern extends BaseShadingPattern{getPattern(){return"hotpink"}}const a=1,o=2;class TilingPattern{static get MAX_PATTERN_SIZE(){return(0,n.shadow)(this,"MAX_PATTERN_SIZE",3e3)}constructor(e,t,i,n,s){this.operatorList=e[2];this.matrix=e[3]||[1,0,0,1,0,0];this.bbox=e[4];this.xstep=e[5];this.ystep=e[6];this.paintType=e[7];this.tilingType=e[8];this.color=t;this.ctx=i;this.canvasGraphicsFactory=n;this.baseTransform=s}createPatternCanvas(e){const t=this.operatorList,i=this.bbox,r=this.xstep,a=this.ystep,o=this.paintType,l=this.tilingType,c=this.color,d=this.canvasGraphicsFactory;(0,n.info)("TilingType: "+l);const h=i[0],u=i[1],p=i[2],g=i[3],f=n.Util.singularValueDecompose2dScale(this.matrix),m=n.Util.singularValueDecompose2dScale(this.baseTransform),v=[f[0]*m[0],f[1]*m[1]],_=this.getSizeAndScale(r,this.ctx.canvas.width,v[0]),b=this.getSizeAndScale(a,this.ctx.canvas.height,v[1]),w=e.cachedCanvases.getCanvas("pattern",_.size,b.size,!0),y=w.context,P=d.createCanvasGraphics(y);P.groupLevel=e.groupLevel;this.setFillAndStrokeStyleToContext(P,o,c);let S=h,A=u,E=p,x=g;if(h<0){S=0;E+=Math.abs(h)}if(u<0){A=0;x+=Math.abs(u)}y.translate(-_.scale*S,-b.scale*A);P.transform(_.scale,0,0,b.scale,0,0);y.save();this.clipBbox(P,S,A,E,x);P.baseTransform=(0,s.getCurrentTransform)(P.ctx);P.executeOperatorList(t);P.endDrawing();return{canvas:w.canvas,scaleX:_.scale,scaleY:b.scale,offsetX:S,offsetY:A}}getSizeAndScale(e,t,i){e=Math.abs(e);const n=Math.max(TilingPattern.MAX_PATTERN_SIZE,t);let s=Math.ceil(e*i);s>=n?s=n:i=s/e;return{scale:i,size:s}}clipBbox(e,t,i,n,r){const a=n-t,o=r-i;e.ctx.rect(t,i,a,o);e.current.updateRectMinMax((0,s.getCurrentTransform)(e.ctx),[t,i,n,r]);e.clip();e.endPath()}setFillAndStrokeStyleToContext(e,t,i){const s=e.ctx,r=e.current;switch(t){case a:const e=this.ctx;s.fillStyle=e.fillStyle;s.strokeStyle=e.strokeStyle;r.fillColor=e.fillStyle;r.strokeColor=e.strokeStyle;break;case o:const l=n.Util.makeHexColor(i[0],i[1],i[2]);s.fillStyle=l;s.strokeStyle=l;r.fillColor=l;r.strokeColor=l;break;default:throw new n.FormatError(`Unsupported paint type: ${t}`)}}getPattern(e,t,i,s){let a=i;if(s!==r.SHADING){a=n.Util.transform(a,t.baseTransform);this.matrix&&(a=n.Util.transform(a,this.matrix))}const o=this.createPatternCanvas(t);let l=new DOMMatrix(a);l=l.translate(o.offsetX,o.offsetY);l=l.scale(1/o.scaleX,1/o.scaleY);const c=e.createPattern(o.canvas,"repeat");c.setTransform(l);return c}}t.TilingPattern=TilingPattern},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.applyMaskImageData=function applyMaskImageData(e){let{src:t,srcPos:i=0,dest:s,destPos:r=0,width:a,height:o,inverseDecode:l=!1}=e;const c=n.FeatureTest.isLittleEndian?4278190080:255,[d,h]=l?[0,c]:[c,0],u=a>>3,p=7&a,g=t.length;s=new Uint32Array(s.buffer);for(let e=0;e<o;e++){for(const e=i+u;i<e;i++){const e=i<g?t[i]:255;s[r++]=128&e?h:d;s[r++]=64&e?h:d;s[r++]=32&e?h:d;s[r++]=16&e?h:d;s[r++]=8&e?h:d;s[r++]=4&e?h:d;s[r++]=2&e?h:d;s[r++]=1&e?h:d}if(0===p)continue;const e=i<g?t[i++]:255;for(let t=0;t<p;t++)s[r++]=e&1<<7-t?h:d}return{srcPos:i,destPos:r}};var n=i(1)},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.GlobalWorkerOptions=void 0;const i=Object.create(null);t.GlobalWorkerOptions=i;i.workerPort=null;i.workerSrc=""},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MessageHandler=void 0;var n=i(1);const s=1,r=2,a=1,o=2,l=3,c=4,d=5,h=6,u=7,p=8;function wrapReason(e){e instanceof Error||"object"==typeof e&&null!==e||(0,n.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(e.name){case"AbortException":return new n.AbortException(e.message);case"MissingPDFException":return new n.MissingPDFException(e.message);case"PasswordException":return new n.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new n.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new n.UnknownErrorException(e.message,e.details);default:return new n.UnknownErrorException(e.message,e.toString())}}t.MessageHandler=class MessageHandler{constructor(e,t,i){this.sourceName=e;this.targetName=t;this.comObj=i;this.callbackId=1;this.streamId=1;this.streamSinks=Object.create(null);this.streamControllers=Object.create(null);this.callbackCapabilities=Object.create(null);this.actionHandler=Object.create(null);this._onComObjOnMessage=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream){this._processStreamMessage(t);return}if(t.callback){const e=t.callbackId,i=this.callbackCapabilities[e];if(!i)throw new Error(`Cannot resolve callback ${e}`);delete this.callbackCapabilities[e];if(t.callback===s)i.resolve(t.data);else{if(t.callback!==r)throw new Error("Unexpected callback case");i.reject(wrapReason(t.reason))}return}const n=this.actionHandler[t.action];if(!n)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,a=t.sourceName;new Promise((function(e){e(n(t.data))})).then((function(n){i.postMessage({sourceName:e,targetName:a,callback:s,callbackId:t.callbackId,data:n})}),(function(n){i.postMessage({sourceName:e,targetName:a,callback:r,callbackId:t.callbackId,reason:wrapReason(n)})}))}else t.streamId?this._createStreamSink(t):n(t.data)};i.addEventListener("message",this._onComObjOnMessage)}on(e,t){const i=this.actionHandler;if(i[e])throw new Error(`There is already an actionName called "${e}"`);i[e]=t}send(e,t,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},i)}sendWithPromise(e,t,i){const s=this.callbackId++,r=(0,n.createPromiseCapability)();this.callbackCapabilities[s]=r;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:s,data:t},i)}catch(e){r.reject(e)}return r.promise}sendWithStream(e,t,i,s){const r=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:i=>{const a=(0,n.createPromiseCapability)();this.streamControllers[r]={controller:i,startCall:a,pullCall:null,cancelCall:null,isClosed:!1};c.postMessage({sourceName:o,targetName:l,action:e,streamId:r,data:t,desiredSize:i.desiredSize},s);return a.promise},pull:e=>{const t=(0,n.createPromiseCapability)();this.streamControllers[r].pullCall=t;c.postMessage({sourceName:o,targetName:l,stream:h,streamId:r,desiredSize:e.desiredSize});return t.promise},cancel:e=>{(0,n.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,n.createPromiseCapability)();this.streamControllers[r].cancelCall=t;this.streamControllers[r].isClosed=!0;c.postMessage({sourceName:o,targetName:l,stream:a,streamId:r,reason:wrapReason(e)});return t.promise}},i)}_createStreamSink(e){const t=e.streamId,i=this.sourceName,s=e.sourceName,r=this.comObj,a=this,o=this.actionHandler[e.action],h={enqueue(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=a;if(l>0&&this.desiredSize<=0){this.sinkCapability=(0,n.createPromiseCapability)();this.ready=this.sinkCapability.promise}r.postMessage({sourceName:i,targetName:s,stream:c,streamId:t,chunk:e},o)},close(){if(!this.isCancelled){this.isCancelled=!0;r.postMessage({sourceName:i,targetName:s,stream:l,streamId:t});delete a.streamSinks[t]}},error(e){(0,n.assert)(e instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;r.postMessage({sourceName:i,targetName:s,stream:d,streamId:t,reason:wrapReason(e)})}},sinkCapability:(0,n.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};h.sinkCapability.resolve();h.ready=h.sinkCapability.promise;this.streamSinks[t]=h;new Promise((function(t){t(o(e.data,h))})).then((function(){r.postMessage({sourceName:i,targetName:s,stream:p,streamId:t,success:!0})}),(function(e){r.postMessage({sourceName:i,targetName:s,stream:p,streamId:t,reason:wrapReason(e)})}))}_processStreamMessage(e){const t=e.streamId,i=this.sourceName,s=e.sourceName,r=this.comObj,g=this.streamControllers[t],f=this.streamSinks[t];switch(e.stream){case p:e.success?g.startCall.resolve():g.startCall.reject(wrapReason(e.reason));break;case u:e.success?g.pullCall.resolve():g.pullCall.reject(wrapReason(e.reason));break;case h:if(!f){r.postMessage({sourceName:i,targetName:s,stream:u,streamId:t,success:!0});break}f.desiredSize<=0&&e.desiredSize>0&&f.sinkCapability.resolve();f.desiredSize=e.desiredSize;new Promise((function(e){e(f.onPull&&f.onPull())})).then((function(){r.postMessage({sourceName:i,targetName:s,stream:u,streamId:t,success:!0})}),(function(e){r.postMessage({sourceName:i,targetName:s,stream:u,streamId:t,reason:wrapReason(e)})}));break;case c:(0,n.assert)(g,"enqueue should have stream controller");if(g.isClosed)break;g.controller.enqueue(e.chunk);break;case l:(0,n.assert)(g,"close should have stream controller");if(g.isClosed)break;g.isClosed=!0;g.controller.close();this._deleteStreamController(g,t);break;case d:(0,n.assert)(g,"error should have stream controller");g.controller.error(wrapReason(e.reason));this._deleteStreamController(g,t);break;case o:e.success?g.cancelCall.resolve():g.cancelCall.reject(wrapReason(e.reason));this._deleteStreamController(g,t);break;case a:if(!f)break;new Promise((function(t){t(f.onCancel&&f.onCancel(wrapReason(e.reason)))})).then((function(){r.postMessage({sourceName:i,targetName:s,stream:o,streamId:t,success:!0})}),(function(e){r.postMessage({sourceName:i,targetName:s,stream:o,streamId:t,reason:wrapReason(e)})}));f.sinkCapability.reject(wrapReason(e.reason));f.isCancelled=!0;delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(e,t){await Promise.allSettled([e.startCall&&e.startCall.promise,e.pullCall&&e.pullCall.promise,e.cancelCall&&e.cancelCall.promise]);delete this.streamControllers[t]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Metadata=void 0;var n=i(1);t.Metadata=class Metadata{#_;#b;constructor(e){let{parsedData:t,rawData:i}=e;this.#_=t;this.#b=i}getRaw(){return this.#b}get(e){return this.#_.get(e)??null}getAll(){return(0,n.objectFromMap)(this.#_)}has(e){return this.#_.has(e)}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.OptionalContentConfig=void 0;var n=i(1),s=i(140);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 r=Symbol("INTERNAL");class OptionalContentGroup{#w=!0;constructor(e,t){this.name=e;this.intent=t}get visible(){return this.#w}_setVisible(e,t){e!==r&&(0,n.unreachable)("Internal method `_setVisible` called.");this.#w=t}}var a=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakSet;t.OptionalContentConfig=class OptionalContentConfig{constructor(e){!function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t);t.add(e)}(this,d);_classPrivateFieldInitSpec(this,a,{writable:!0,value:null});_classPrivateFieldInitSpec(this,o,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,l,{writable:!0,value:null});_classPrivateFieldInitSpec(this,c,{writable:!0,value:null});this.name=null;this.creator=null;if(null!==e){this.name=e.name;this.creator=e.creator;_classPrivateFieldSet(this,c,e.order);for(const t of e.groups)_classPrivateFieldGet(this,o).set(t.id,new OptionalContentGroup(t.name,t.intent));if("OFF"===e.baseState)for(const e of _classPrivateFieldGet(this,o).values())e._setVisible(r,!1);for(const t of e.on)_classPrivateFieldGet(this,o).get(t)._setVisible(r,!0);for(const t of e.off)_classPrivateFieldGet(this,o).get(t)._setVisible(r,!1);_classPrivateFieldSet(this,l,this.getHash())}}isVisible(e){if(0===_classPrivateFieldGet(this,o).size)return!0;if(!e){(0,n.warn)("Optional content group not defined.");return!0}if("OCG"===e.type){if(!_classPrivateFieldGet(this,o).has(e.id)){(0,n.warn)(`Optional content group not found: ${e.id}`);return!0}return _classPrivateFieldGet(this,o).get(e.id).visible}if("OCMD"===e.type){if(e.expression)return _classPrivateMethodGet(this,d,_evaluateVisibilityExpression2).call(this,e.expression);if(!e.policy||"AnyOn"===e.policy){for(const t of e.ids){if(!_classPrivateFieldGet(this,o).has(t)){(0,n.warn)(`Optional content group not found: ${t}`);return!0}if(_classPrivateFieldGet(this,o).get(t).visible)return!0}return!1}if("AllOn"===e.policy){for(const t of e.ids){if(!_classPrivateFieldGet(this,o).has(t)){(0,n.warn)(`Optional content group not found: ${t}`);return!0}if(!_classPrivateFieldGet(this,o).get(t).visible)return!1}return!0}if("AnyOff"===e.policy){for(const t of e.ids){if(!_classPrivateFieldGet(this,o).has(t)){(0,n.warn)(`Optional content group not found: ${t}`);return!0}if(!_classPrivateFieldGet(this,o).get(t).visible)return!0}return!1}if("AllOff"===e.policy){for(const t of e.ids){if(!_classPrivateFieldGet(this,o).has(t)){(0,n.warn)(`Optional content group not found: ${t}`);return!0}if(_classPrivateFieldGet(this,o).get(t).visible)return!1}return!0}(0,n.warn)(`Unknown optional content policy ${e.policy}.`);return!0}(0,n.warn)(`Unknown group type ${e.type}.`);return!0}setVisibility(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(_classPrivateFieldGet(this,o).has(e)){_classPrivateFieldGet(this,o).get(e)._setVisible(r,!!t);_classPrivateFieldSet(this,a,null)}else(0,n.warn)(`Optional content group not found: ${e}`)}get hasInitialVisibility(){return this.getHash()===_classPrivateFieldGet(this,l)}getOrder(){return _classPrivateFieldGet(this,o).size?_classPrivateFieldGet(this,c)?_classPrivateFieldGet(this,c).slice():[..._classPrivateFieldGet(this,o).keys()]:null}getGroups(){return _classPrivateFieldGet(this,o).size>0?(0,n.objectFromMap)(_classPrivateFieldGet(this,o)):null}getGroup(e){return _classPrivateFieldGet(this,o).get(e)||null}getHash(){if(null!==_classPrivateFieldGet(this,a))return _classPrivateFieldGet(this,a);const e=new s.MurmurHash3_64;for(const[t,i]of _classPrivateFieldGet(this,o))e.update(`${t}:${i.visible}`);return _classPrivateFieldSet(this,a,e.hexdigest())}};function _evaluateVisibilityExpression2(e){const t=e.length;if(t<2)return!0;const i=e[0];for(let s=1;s<t;s++){const t=e[s];let r;if(Array.isArray(t))r=_classPrivateMethodGet(this,d,_evaluateVisibilityExpression2).call(this,t);else{if(!_classPrivateFieldGet(this,o).has(t)){(0,n.warn)(`Optional content group not found: ${t}`);return!0}r=_classPrivateFieldGet(this,o).get(t).visible}switch(i){case"And":if(!r)return!1;break;case"Or":if(r)return!0;break;case"Not":return!r;default:return!0}}return"And"===i}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFDataTransportStream=void 0;var n=i(1),s=i(138);t.PDFDataTransportStream=class PDFDataTransportStream{constructor(e,t){let{length:i,initialData:s,progressiveDone:r=!1,contentDispositionFilename:a=null,disableRange:o=!1,disableStream:l=!1}=e;(0,n.assert)(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');this._queuedChunks=[];this._progressiveDone=r;this._contentDispositionFilename=a;if((null==s?void 0:s.length)>0){const e=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=t;this._isStreamingSupported=!l;this._isRangeSupported=!o;this._contentLength=i;this._fullRequestReader=null;this._rangeReaders=[];this._pdfDataRangeTransport.addRangeListener(((e,t)=>{this._onReceiveData({begin:e,chunk:t})}));this._pdfDataRangeTransport.addProgressListener(((e,t)=>{this._onProgress({loaded:e,total:t})}));this._pdfDataRangeTransport.addProgressiveReadListener((e=>{this._onReceiveData({chunk:e})}));this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()}));this._pdfDataRangeTransport.transportReady()}_onReceiveData(e){let{begin:t,chunk:i}=e;const s=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(s):this._queuedChunks.push(s);else{const e=this._rangeReaders.some((function(e){if(e._begin!==t)return!1;e._enqueue(s);return!0}));(0,n.assert)(e,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var e;return(null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)??0}_onProgress(e){if(void 0===e.total){var t,i;null===(t=this._rangeReaders[0])||void 0===t||null===(i=t.onProgress)||void 0===i||i.call(t,{loaded:e.loaded})}else{var n,s;null===(n=this._fullRequestReader)||void 0===n||null===(s=n.onProgress)||void 0===s||s.call(n,{loaded:e.loaded,total:e.total})}}_onProgressiveDone(){var e;null===(e=this._fullRequestReader)||void 0===e||e.progressiveDone();this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;this._queuedChunks=null;return new PDFDataTransportStreamReader(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const i=new PDFDataTransportStreamRangeReader(this,e,t);this._pdfDataRangeTransport.requestDataRange(e,t);this._rangeReaders.push(i);return i}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}};class PDFDataTransportStreamReader{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=e;this._done=i||!1;this._filename=(0,s.isPdfFile)(n)?n:null;this._queuedChunks=t||[];this._loaded=0;for(const e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[];this._headersReady=Promise.resolve();e._fullRequestReader=this;this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunks.push(e);this._loaded+=e.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,n.createPromiseCapability)();this._requests.push(e);return e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class PDFDataTransportStreamRangeReader{constructor(e,t,i){this._stream=e;this._begin=t;this._end=i;this._queuedChunk=null;this._requests=[];this._done=!1;this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0;this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;this._queuedChunk=null;return{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,n.createPromiseCapability)();this._requests.push(e);return e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0;this._stream._removeRangeReader(this)}}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.XfaText=void 0;class XfaText{static textContent(e){const t=[],i={items:t,styles:Object.create(null)};!function walk(e){var i;if(!e)return;let n=null;const s=e.name;if("#text"===s)n=e.value;else{if(!XfaText.shouldBuildText(s))return;null!=e&&null!==(i=e.attributes)&&void 0!==i&&i.textContent?n=e.attributes.textContent:e.value&&(n=e.value)}null!==n&&t.push({str:n});if(e.children)for(const t of e.children)walk(t)}(e);return i}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}t.XfaText=XfaText},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NodeStandardFontDataFactory=t.NodeCanvasFactory=t.NodeCMapReaderFactory=void 0;var n=i(139);const fetchData=function(e){return new Promise(((t,i)=>{require("fs").readFile(e,((e,n)=>{!e&&n?t(new Uint8Array(n)):i(new Error(e))}))}))};class NodeCanvasFactory extends n.BaseCanvasFactory{_createCanvas(e,t){return require("canvas").createCanvas(e,t)}}t.NodeCanvasFactory=NodeCanvasFactory;class NodeCMapReaderFactory extends n.BaseCMapReaderFactory{_fetchData(e,t){return fetchData(e).then((e=>({cMapData:e,compressionType:t})))}}t.NodeCMapReaderFactory=NodeCMapReaderFactory;class NodeStandardFontDataFactory extends n.BaseStandardFontDataFactory{_fetchData(e){return fetchData(e)}}t.NodeStandardFontDataFactory=NodeStandardFontDataFactory},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFNodeStream=void 0;var n=i(1),s=i(154);const r=require("fs"),a=require("http"),o=require("https"),l=require("url"),c=/^file:\/\/\/[a-zA-Z]:\//;t.PDFNodeStream=class PDFNodeStream{constructor(e){this.source=e;this.url=function parseUrl(e){const t=l.parse(e);if("file:"===t.protocol||t.host)return t;if(/^[a-z]:[/\\]/i.test(e))return l.parse(`file:///${e}`);t.host||(t.protocol="file:");return t}(e.url);this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol||"capacitor:"===this.url.protocol;this.isFsUrl="file:"===this.url.protocol;this.httpHeaders=this.isHttp&&e.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return(null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)??0}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once.");this._fullRequestReader=this.isFsUrl?new PDFNodeStreamFsFullReader(this):new PDFNodeStreamFullReader(this);return this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const i=this.isFsUrl?new PDFNodeStreamFsRangeReader(this,e,t):new PDFNodeStreamRangeReader(this,e,t);this._rangeRequestReaders.push(i);return i}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class BaseFullReader{constructor(e){this._url=e.url;this._done=!1;this._storedError=null;this.onProgress=null;const t=e.source;this._contentLength=t.length;this._loaded=0;this._filename=null;this._disableRange=t.disableRange||!1;this._rangeChunkSize=t.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!t.disableStream;this._isRangeSupported=!t.disableRange;this._readableStream=null;this._readCapability=(0,n.createPromiseCapability)();this._headersCapability=(0,n.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t){this._readCapability=(0,n.createPromiseCapability)();return this.read()}this._loaded+=t.length;null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(t).buffer,done:!1}}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e;this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e;e.on("readable",(()=>{this._readCapability.resolve()}));e.on("end",(()=>{e.destroy();this._done=!0;this._readCapability.resolve()}));e.on("error",(e=>{this._error(e)}));!this._isStreamingSupported&&this._isRangeSupported&&this._error(new n.AbortException("streaming is disabled"));this._storedError&&this._readableStream.destroy(this._storedError)}}class BaseRangeReader{constructor(e){this._url=e.url;this._done=!1;this._storedError=null;this.onProgress=null;this._loaded=0;this._readableStream=null;this._readCapability=(0,n.createPromiseCapability)();const t=e.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t){this._readCapability=(0,n.createPromiseCapability)();return this.read()}this._loaded+=t.length;null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded});return{value:new Uint8Array(t).buffer,done:!1}}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e;this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e;e.on("readable",(()=>{this._readCapability.resolve()}));e.on("end",(()=>{e.destroy();this._done=!0;this._readCapability.resolve()}));e.on("error",(e=>{this._error(e)}));this._storedError&&this._readableStream.destroy(this._storedError)}}function createRequestOptions(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class PDFNodeStreamFullReader extends BaseFullReader{constructor(e){super(e);const handleResponse=t=>{if(404===t.statusCode){const e=new n.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=e;this._headersCapability.reject(e);return}this._headersCapability.resolve();this._setReadableStream(t);const getResponseHeader=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:i,suggestedLength:r}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i;this._contentLength=r||this._contentLength;this._filename=(0,s.extractFilenameFromHeader)(getResponseHeader)};this._request=null;"http:"===this._url.protocol?this._request=a.request(createRequestOptions(this._url,e.httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,e.httpHeaders),handleResponse);this._request.on("error",(e=>{this._storedError=e;this._headersCapability.reject(e)}));this._request.end()}}class PDFNodeStreamRangeReader extends BaseRangeReader{constructor(e,t,i){super(e);this._httpHeaders={};for(const t in e.httpHeaders){const i=e.httpHeaders[t];void 0!==i&&(this._httpHeaders[t]=i)}this._httpHeaders.Range=`bytes=${t}-${i-1}`;const handleResponse=e=>{if(404!==e.statusCode)this._setReadableStream(e);else{const e=new n.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=e}};this._request=null;"http:"===this._url.protocol?this._request=a.request(createRequestOptions(this._url,this._httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,this._httpHeaders),handleResponse);this._request.on("error",(e=>{this._storedError=e}));this._request.end()}}class PDFNodeStreamFsFullReader extends BaseFullReader{constructor(e){super(e);let t=decodeURIComponent(this._url.path);c.test(this._url.href)&&(t=t.replace(/^\//,""));r.lstat(t,((e,i)=>{if(e){"ENOENT"===e.code&&(e=new n.MissingPDFException(`Missing PDF "${t}".`));this._storedError=e;this._headersCapability.reject(e)}else{this._contentLength=i.size;this._setReadableStream(r.createReadStream(t));this._headersCapability.resolve()}}))}}class PDFNodeStreamFsRangeReader extends BaseRangeReader{constructor(e,t,i){super(e);let n=decodeURIComponent(this._url.path);c.test(this._url.href)&&(n=n.replace(/^\//,""));this._setReadableStream(r.createReadStream(n,{start:t,end:i-1}))}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.createResponseStatusError=function createResponseStatusError(e,t){if(404===e||0===e&&t.startsWith("file:"))return new n.MissingPDFException('Missing PDF "'+t+'".');return new n.UnexpectedResponseException(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)};t.extractFilenameFromHeader=function extractFilenameFromHeader(e){const t=e("Content-Disposition");if(t){let e=(0,s.getFilenameFromContentDispositionHeader)(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch(e){}if((0,r.isPdfFile)(e))return e}return null};t.validateRangeRequestCapabilities=function validateRangeRequestCapabilities(e){let{getResponseHeader:t,isHttp:i,rangeChunkSize:n,disableRange:s}=e;const r={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(t("Content-Length"),10);if(!Number.isInteger(a))return r;r.suggestedLength=a;if(a<=2*n)return r;if(s||!i)return r;if("bytes"!==t("Accept-Ranges"))return r;if("identity"!==(t("Content-Encoding")||"identity"))return r;r.allowRangeRequests=!0;return r};t.validateResponseStatus=function validateResponseStatus(e){return 200===e||206===e};var n=i(1),s=i(155),r=i(138)},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.getFilenameFromContentDispositionHeader=function getFilenameFromContentDispositionHeader(e){let t=!0,i=toParamRegExp("filename\\*","i").exec(e);if(i){i=i[1];let e=rfc2616unquote(i);e=unescape(e);e=rfc5987decode(e);e=rfc2047decode(e);return fixupEncoding(e)}i=function rfc2231getparam(e){const t=[];let i;const n=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=n.exec(e));){let[,e,n,s]=i;e=parseInt(e,10);if(e in t){if(0===e)break}else t[e]=[n,s]}const s=[];for(let e=0;e<t.length&&e in t;++e){let[i,n]=t[e];n=rfc2616unquote(n);if(i){n=unescape(n);0===e&&(n=rfc5987decode(n))}s.push(n)}return s.join("")}(e);if(i){return fixupEncoding(rfc2047decode(i))}i=toParamRegExp("filename","i").exec(e);if(i){i=i[1];let e=rfc2616unquote(i);e=rfc2047decode(e);return fixupEncoding(e)}function toParamRegExp(e,t){return new RegExp("(?:^|;)\\s*"+e+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',t)}function textdecode(e,i){if(e){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const s=new TextDecoder(e,{fatal:!0}),r=(0,n.stringToBytes)(i);i=s.decode(r);t=!1}catch(e){}}return i}function fixupEncoding(e){if(t&&/[\x80-\xff]/.test(e)){e=textdecode("utf-8",e);t&&(e=textdecode("iso-8859-1",e))}return e}function rfc2616unquote(e){if(e.startsWith('"')){const t=e.slice(1).split('\\"');for(let e=0;e<t.length;++e){const i=t[e].indexOf('"');if(-1!==i){t[e]=t[e].slice(0,i);t.length=e+1}t[e]=t[e].replace(/\\(.)/g,"$1")}e=t.join('"')}return e}function rfc5987decode(e){const t=e.indexOf("'");if(-1===t)return e;return textdecode(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,""))}function rfc2047decode(e){return!e.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(e,t,i,n){if("q"===i||"Q"===i)return textdecode(t,n=(n=n.replace(/_/g," ")).replace(/=([0-9a-fA-F]{2})/g,(function(e,t){return String.fromCharCode(parseInt(t,16))})));try{n=atob(n)}catch(e){}return textdecode(t,n)}))}return""};var n=i(1)},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFNetworkStream=void 0;var n=i(1),s=i(154);class NetworkManager{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=e;this.isHttp=/^https?:/i.test(e);this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null);this.withCredentials=t.withCredentials||!1;this.getXhr=t.getXhr||function NetworkManager_getXhr(){return new XMLHttpRequest};this.currXhrId=0;this.pendingRequests=Object.create(null)}requestRange(e,t,i){const n={begin:e,end:t};for(const e in i)n[e]=i[e];return this.request(n)}requestFull(e){return this.request(e)}request(e){const t=this.getXhr(),i=this.currXhrId++,n=this.pendingRequests[i]={xhr:t};t.open("GET",this.url);t.withCredentials=this.withCredentials;for(const e in this.httpHeaders){const i=this.httpHeaders[e];void 0!==i&&t.setRequestHeader(e,i)}if(this.isHttp&&"begin"in e&&"end"in e){t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`);n.expectedStatus=206}else n.expectedStatus=200;t.responseType="arraybuffer";e.onError&&(t.onerror=function(i){e.onError(t.status)});t.onreadystatechange=this.onStateChange.bind(this,i);t.onprogress=this.onProgress.bind(this,i);n.onHeadersReceived=e.onHeadersReceived;n.onDone=e.onDone;n.onError=e.onError;n.onProgress=e.onProgress;t.send(null);return i}onProgress(e,t){var i;const n=this.pendingRequests[e];n&&(null===(i=n.onProgress)||void 0===i||i.call(n,t))}onStateChange(e,t){const i=this.pendingRequests[e];if(!i)return;const s=i.xhr;if(s.readyState>=2&&i.onHeadersReceived){i.onHeadersReceived();delete i.onHeadersReceived}if(4!==s.readyState)return;if(!(e in this.pendingRequests))return;delete this.pendingRequests[e];if(0===s.status&&this.isHttp){var r;null===(r=i.onError)||void 0===r||r.call(i,s.status);return}const a=s.status||200;if(!(200===a&&206===i.expectedStatus)&&a!==i.expectedStatus){var o;null===(o=i.onError)||void 0===o||o.call(i,s.status);return}const l=function getArrayBuffer(e){const t=e.response;return"string"!=typeof t?t:(0,n.stringToBytes)(t).buffer}(s);if(206===a){const e=s.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);i.onDone({begin:parseInt(t[1],10),chunk:l})}else if(l)i.onDone({begin:0,chunk:l});else{var c;null===(c=i.onError)||void 0===c||c.call(i,s.status)}}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e];t.abort()}}t.PDFNetworkStream=class PDFNetworkStream{constructor(e){this._source=e;this._manager=new NetworkManager(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials});this._rangeChunkSize=e.rangeChunkSize;this._fullRequestReader=null;this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once.");this._fullRequestReader=new PDFNetworkStreamFullRequestReader(this._manager,this._source);return this._fullRequestReader}getRangeReader(e,t){const i=new PDFNetworkStreamRangeRequestReader(this._manager,e,t);i.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(i);return i}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class PDFNetworkStreamFullRequestReader{constructor(e,t){this._manager=e;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url;this._fullRequestId=e.requestFull(i);this._headersReceivedCapability=(0,n.createPromiseCapability)();this._disableRange=t.disableRange||!1;this._contentLength=t.length;this._rangeChunkSize=t.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!1;this._isRangeSupported=!1;this._cachedChunks=[];this._requests=[];this._done=!1;this._storedError=void 0;this._filename=null;this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e),getResponseHeader=e=>t.getResponseHeader(e),{allowRangeRequests:i,suggestedLength:n}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0);this._contentLength=n||this._contentLength;this._filename=(0,s.extractFilenameFromHeader)(getResponseHeader);this._isRangeSupported&&this._manager.abortRequest(e);this._headersReceivedCapability.resolve()}_onDone(e){if(e)if(this._requests.length>0){this._requests.shift().resolve({value:e.chunk,done:!1})}else this._cachedChunks.push(e.chunk);this._done=!0;if(!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=(0,s.createResponseStatusError)(e,this._url);this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0;this._cachedChunks.length=0}_onProgress(e){var t;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,n.createPromiseCapability)();this._requests.push(e);return e.promise}cancel(e){this._done=!0;this._headersReceivedCapability.reject(e);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0;this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId);this._fullRequestReader=null}}class PDFNetworkStreamRangeRequestReader{constructor(e,t,i){this._manager=e;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url;this._requestId=e.requestRange(t,i,n);this._requests=[];this._queuedChunk=null;this._done=!1;this._storedError=void 0;this.onProgress=null;this.onClosed=null}_close(){var e;null===(e=this.onClosed)||void 0===e||e.call(this,this)}_onDone(e){const t=e.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunk=t;this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0;this._close()}_onError(e){this._storedError=(0,s.createResponseStatusError)(e,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0;this._queuedChunk=null}_onProgress(e){if(!this.isStreamingSupported){var t;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:e.loaded})}}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const e=this._queuedChunk;this._queuedChunk=null;return{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,n.createPromiseCapability)();this._requests.push(e);return e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0;this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId);this._close()}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFFetchStream=void 0;var n=i(1),s=i(154);function createFetchOptions(e,t,i){return{method:"GET",headers:e,signal:i.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function createHeaders(e){const t=new Headers;for(const i in e){const n=e[i];void 0!==n&&t.append(i,n)}return t}function getArrayBuffer(e){if(e instanceof Uint8Array)return e.buffer;if(e instanceof ArrayBuffer)return e;(0,n.warn)(`getArrayBuffer - unexpected data format: ${e}`);return new Uint8Array(e).buffer}t.PDFFetchStream=class PDFFetchStream{constructor(e){this.source=e;this.isHttp=/^https?:/i.test(e.url);this.httpHeaders=this.isHttp&&e.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return(null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)??0}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once.");this._fullRequestReader=new PDFFetchStreamReader(this);return this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const i=new PDFFetchStreamRangeReader(this,e,t);this._rangeRequestReaders.push(i);return i}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class PDFFetchStreamReader{constructor(e){this._stream=e;this._reader=null;this._loaded=0;this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1;this._contentLength=t.length;this._headersCapability=(0,n.createPromiseCapability)();this._disableRange=t.disableRange||!1;this._rangeChunkSize=t.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._abortController=new AbortController;this._isStreamingSupported=!t.disableStream;this._isRangeSupported=!t.disableRange;this._headers=createHeaders(this._stream.httpHeaders);const i=t.url;fetch(i,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,s.validateResponseStatus)(e.status))throw(0,s.createResponseStatusError)(e.status,i);this._reader=e.body.getReader();this._headersCapability.resolve();const getResponseHeader=t=>e.headers.get(t),{allowRangeRequests:t,suggestedLength:r}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=t;this._contentLength=r||this._contentLength;this._filename=(0,s.extractFilenameFromHeader)(getResponseHeader);!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new n.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject);this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._headersCapability.promise;const{value:t,done:i}=await this._reader.read();if(i)return{value:t,done:i};this._loaded+=t.byteLength;null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded,total:this._contentLength});return{value:getArrayBuffer(t),done:!1}}cancel(e){var t;null===(t=this._reader)||void 0===t||t.cancel(e);this._abortController.abort()}}class PDFFetchStreamRangeReader{constructor(e,t,i){this._stream=e;this._reader=null;this._loaded=0;const r=e.source;this._withCredentials=r.withCredentials||!1;this._readCapability=(0,n.createPromiseCapability)();this._isStreamingSupported=!r.disableStream;this._abortController=new AbortController;this._headers=createHeaders(this._stream.httpHeaders);this._headers.append("Range",`bytes=${t}-${i-1}`);const a=r.url;fetch(a,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,s.validateResponseStatus)(e.status))throw(0,s.createResponseStatusError)(e.status,a);this._readCapability.resolve();this._reader=e.body.getReader()})).catch(this._readCapability.reject);this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._readCapability.promise;const{value:t,done:i}=await this._reader.read();if(i)return{value:t,done:i};this._loaded+=t.byteLength;null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded});return{value:getArrayBuffer(t),done:!1}}cancel(e){var t;null===(t=this._reader)||void 0===t||t.cancel(e);this._abortController.abort()}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TextLayerRenderTask=void 0;t.renderTextLayer=function renderTextLayer(e){if(!e.textContentSource&&(e.textContent||e.textContentStream)){(0,s.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead.");e.textContentSource=e.textContent||e.textContentStream}const t=new TextLayerRenderTask(e);t._render();return t};t.updateTextLayer=function updateTextLayer(e){let{container:t,viewport:i,textDivs:n,textDivProperties:r,isOffscreenCanvasSupported:a,mustRotate:o=!0,mustRescale:l=!0}=e;o&&(0,s.setLayerDimensions)(t,{rotation:i.rotation});if(l){const e=getCtx(0,a),t={prevFontSize:null,prevFontFamily:null,div:null,scale:i.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:e};for(const e of n){t.properties=r.get(e);t.div=e;layout(t)}}};var n=i(1),s=i(138);const r=1e5,a=30,o=.8,l=new Map;function getCtx(e,t){let i;const s=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0,alpha:!1}:{alpha:!1};if(t&&n.FeatureTest.isOffscreenCanvasSupported)i=new OffscreenCanvas(e,e).getContext("2d",s);else{const t=document.createElement("canvas");t.width=t.height=e;i=t.getContext("2d",s)}return i}function appendText(e,t,i){const s=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};e._textDivs.push(s);const c=n.Util.transform(e._transform,t.transform);let d=Math.atan2(c[1],c[0]);const h=i[t.fontName];h.vertical&&(d+=Math.PI/2);const u=Math.hypot(c[2],c[3]),p=u*function getAscent(e,t){const i=l.get(e);if(i)return i;const n=getCtx(a,t);n.font=`${a}px ${e}`;const s=n.measureText("");let r=null==s?void 0:s.fontBoundingBoxAscent,c=Math.abs(null==s?void 0:s.fontBoundingBoxDescent);if(r){const t=r/(r+c);l.set(e,t);n.canvas.width=n.canvas.height=0;return t}n.strokeStyle="red";n.clearRect(0,0,a,a);n.strokeText("g",0,0);let d=n.getImageData(0,0,a,a).data;c=0;for(let e=d.length-1-3;e>=0;e-=4)if(d[e]>0){c=Math.ceil(e/4/a);break}n.clearRect(0,0,a,a);n.strokeText("A",0,a);d=n.getImageData(0,0,a,a).data;r=0;for(let e=0,t=d.length;e<t;e+=4)if(d[e]>0){r=a-Math.floor(e/4/a);break}n.canvas.width=n.canvas.height=0;if(r){const t=r/(r+c);l.set(e,t);return t}l.set(e,o);return o}(h.fontFamily,e._isOffscreenCanvasSupported);let g,f;if(0===d){g=c[4];f=c[5]-p}else{g=c[4]+p*Math.sin(d);f=c[5]-p*Math.cos(d)}const m="calc(var(--scale-factor)*",v=s.style;if(e._container===e._rootContainer){v.left=`${(100*g/e._pageWidth).toFixed(2)}%`;v.top=`${(100*f/e._pageHeight).toFixed(2)}%`}else{v.left=`${m}${g.toFixed(2)}px)`;v.top=`${m}${f.toFixed(2)}px)`}v.fontSize=`${m}${u.toFixed(2)}px)`;v.fontFamily=h.fontFamily;r.fontSize=u;s.setAttribute("role","presentation");s.textContent=t.str;s.dir=t.dir;e._fontInspectorEnabled&&(s.dataset.fontName=t.fontName);0!==d&&(r.angle=d*(180/Math.PI));let _=!1;if(t.str.length>1)_=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),i=Math.abs(t.transform[3]);e!==i&&Math.max(e,i)/Math.min(e,i)>1.5&&(_=!0)}_&&(r.canvasWidth=h.vertical?t.height:t.width);e._textDivProperties.set(s,r);e._isReadableStream&&e._layoutText(s)}function layout(e){const{div:t,scale:i,properties:n,ctx:s,prevFontSize:r,prevFontFamily:a}=e,{style:o}=t;let l="";if(0!==n.canvasWidth&&n.hasText){const{fontFamily:c}=o,{canvasWidth:d,fontSize:h}=n;if(r!==h||a!==c){s.font=`${h*i}px ${c}`;e.prevFontSize=h;e.prevFontFamily=c}try{const{width:e}=s.measureText(t.textContent);e>0&&(l=`scaleX(${d*i/e})`)}catch(e){}}0!==n.angle&&(l=`rotate(${n.angle}deg) ${l}`);l.length>0&&(o.transform=l)}class TextLayerRenderTask{constructor(e){var t;let{textContentSource:i,container:r,viewport:a,textDivs:o,textDivProperties:l,textContentItemsStr:c,isOffscreenCanvasSupported:d}=e;this._textContentSource=i;this._isReadableStream=i instanceof ReadableStream;this._container=this._rootContainer=r;this._textDivs=o||[];this._textContentItemsStr=c||[];this._isOffscreenCanvasSupported=d;this._fontInspectorEnabled=!(null===(t=globalThis.FontInspector)||void 0===t||!t.enabled);this._reader=null;this._textDivProperties=l||new WeakMap;this._canceled=!1;this._capability=(0,n.createPromiseCapability)();this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:a.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:getCtx(0,d)};const{pageWidth:h,pageHeight:u,pageX:p,pageY:g}=a.rawDims;this._transform=[1,0,0,-1,-p,g+u];this._pageWidth=h;this._pageHeight=u;(0,s.setLayerDimensions)(r,a);this._capability.promise.finally((()=>{this._layoutTextParams=null})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0;if(this._reader){this._reader.cancel(new n.AbortException("TextLayer task cancelled.")).catch((()=>{}));this._reader=null}this._capability.reject(new n.AbortException("TextLayer task cancelled."))}_processItems(e,t){for(const i of e)if(void 0!==i.str){this._textContentItemsStr.push(i.str);appendText(this,i,t)}else if("beginMarkedContentProps"===i.type||"beginMarkedContent"===i.type){const e=this._container;this._container=document.createElement("span");this._container.classList.add("markedContent");null!==i.id&&this._container.setAttribute("id",`${i.id}`);e.append(this._container)}else"endMarkedContent"===i.type&&(this._container=this._container.parentNode)}_layoutText(e){const t=this._layoutTextParams.properties=this._textDivProperties.get(e);this._layoutTextParams.div=e;layout(this._layoutTextParams);t.hasText&&this._container.append(e);if(t.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation");this._container.append(e)}}_render(){const e=(0,n.createPromiseCapability)();let t=Object.create(null);if(this._isReadableStream){const pump=()=>{this._reader.read().then((i=>{let{value:n,done:s}=i;if(s)e.resolve();else{Object.assign(t,n.styles);this._processItems(n.items,t);pump()}}),e.reject)};this._reader=this._textContentSource.getReader();pump()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:t,styles:i}=this._textContentSource;this._processItems(t,i);e.resolve()}}e.promise.then((()=>{t=null;!function render(e){if(e._canceled)return;const t=e._textDivs,i=e._capability;if(t.length>r)i.resolve();else{if(!e._isReadableStream)for(const i of t)e._layoutText(i);i.resolve()}}(this)}),this._capability.reject)}}t.TextLayerRenderTask=TextLayerRenderTask},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.AnnotationEditorLayer=void 0;var n=i(1),s=i(137),r=i(160),a=i(161),o=i(138);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)}var l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,m=new WeakSet,v=new WeakSet,_=new WeakSet,b=new WeakSet;class AnnotationEditorLayer{constructor(e){_classPrivateMethodInitSpec(this,b);_classPrivateMethodInitSpec(this,_);_classPrivateMethodInitSpec(this,v);_classPrivateMethodInitSpec(this,m);_classPrivateFieldInitSpec(this,l,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,c,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,d,{writable:!0,value:this.pointerup.bind(this)});_classPrivateFieldInitSpec(this,h,{writable:!0,value:this.pointerdown.bind(this)});_classPrivateFieldInitSpec(this,u,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,p,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,g,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,f,{writable:!0,value:void 0});if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;r.FreeTextEditor.initialize(e.l10n);a.InkEditor.initialize(e.l10n)}e.uiManager.registerEditorTypes([r.FreeTextEditor,a.InkEditor]);_classPrivateFieldSet(this,f,e.uiManager);this.pageIndex=e.pageIndex;this.div=e.div;_classPrivateFieldSet(this,l,e.accessibilityManager);_classPrivateFieldGet(this,f).addLayer(this)}get isEmpty(){return 0===_classPrivateFieldGet(this,u).size}updateToolbar(e){_classPrivateFieldGet(this,f).updateToolbar(e)}updateMode(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_classPrivateFieldGet(this,f).getMode();_classPrivateMethodGet(this,b,_cleanup2).call(this);if(e===n.AnnotationEditorType.INK){this.addInkEditorIfNeeded(!1);this.disableClick()}else this.enableClick();_classPrivateFieldGet(this,f).unselectAll();if(e!==n.AnnotationEditorType.NONE){this.div.classList.toggle("freeTextEditing",e===n.AnnotationEditorType.FREETEXT);this.div.classList.toggle("inkEditing",e===n.AnnotationEditorType.INK);this.div.hidden=!1}}addInkEditorIfNeeded(e){if(!e&&_classPrivateFieldGet(this,f).getMode()!==n.AnnotationEditorType.INK)return;if(!e)for(const e of _classPrivateFieldGet(this,u).values())if(e.isEmpty()){e.setInBackground();return}_classPrivateMethodGet(this,_,_createAndAddNewEditor2).call(this,{offsetX:0,offsetY:0}).setInBackground()}setEditingState(e){_classPrivateFieldGet(this,f).setEditingState(e)}addCommands(e){_classPrivateFieldGet(this,f).addCommands(e)}enable(){this.div.style.pointerEvents="auto";for(const e of _classPrivateFieldGet(this,u).values())e.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const e of _classPrivateFieldGet(this,u).values())e.disableEditing();_classPrivateMethodGet(this,b,_cleanup2).call(this);this.isEmpty&&(this.div.hidden=!0)}setActiveEditor(e){_classPrivateFieldGet(this,f).getActive()!==e&&_classPrivateFieldGet(this,f).setActiveEditor(e)}enableClick(){this.div.addEventListener("pointerdown",_classPrivateFieldGet(this,h));this.div.addEventListener("pointerup",_classPrivateFieldGet(this,d))}disableClick(){this.div.removeEventListener("pointerdown",_classPrivateFieldGet(this,h));this.div.removeEventListener("pointerup",_classPrivateFieldGet(this,d))}attach(e){_classPrivateFieldGet(this,u).set(e.id,e)}detach(e){var t;_classPrivateFieldGet(this,u).delete(e.id);null===(t=_classPrivateFieldGet(this,l))||void 0===t||t.removePointerInTextLayer(e.contentDiv)}remove(e){_classPrivateFieldGet(this,f).removeEditor(e);this.detach(e);e.div.style.display="none";setTimeout((()=>{e.div.style.display="";e.div.remove();e.isAttachedToDOM=!1;document.activeElement===document.body&&_classPrivateFieldGet(this,f).focusMainContainer()}),0);_classPrivateFieldGet(this,g)||this.addInkEditorIfNeeded(!1)}add(e){_classPrivateMethodGet(this,m,_changeParent2).call(this,e);_classPrivateFieldGet(this,f).addEditor(e);this.attach(e);if(!e.isAttachedToDOM){const t=e.render();this.div.append(t);e.isAttachedToDOM=!0}this.moveEditorInDOM(e);e.onceAdded();_classPrivateFieldGet(this,f).addToAnnotationStorage(e)}moveEditorInDOM(e){var t;null===(t=_classPrivateFieldGet(this,l))||void 0===t||t.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?e.rebuild():this.add(e)}addANewEditor(e){this.addCommands({cmd:()=>{this.addOrRebuild(e)},undo:()=>{e.remove()},mustExec:!0})}addUndoableEditor(e){this.addCommands({cmd:()=>{this.addOrRebuild(e)},undo:()=>{e.remove()},mustExec:!1})}getNextId(){return _classPrivateFieldGet(this,f).getId()}deserialize(e){switch(e.annotationType){case n.AnnotationEditorType.FREETEXT:return r.FreeTextEditor.deserialize(e,this,_classPrivateFieldGet(this,f));case n.AnnotationEditorType.INK:return a.InkEditor.deserialize(e,this,_classPrivateFieldGet(this,f))}return null}setSelected(e){_classPrivateFieldGet(this,f).setSelected(e)}toggleSelected(e){_classPrivateFieldGet(this,f).toggleSelected(e)}isSelected(e){return _classPrivateFieldGet(this,f).isSelected(e)}unselect(e){_classPrivateFieldGet(this,f).unselect(e)}pointerup(e){const{isMac:t}=n.FeatureTest.platform;if(!(0!==e.button||e.ctrlKey&&t)&&e.target===this.div&&_classPrivateFieldGet(this,p)){_classPrivateFieldSet(this,p,!1);_classPrivateFieldGet(this,c)?_classPrivateMethodGet(this,_,_createAndAddNewEditor2).call(this,e):_classPrivateFieldSet(this,c,!0)}}pointerdown(e){const{isMac:t}=n.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;_classPrivateFieldSet(this,p,!0);const i=_classPrivateFieldGet(this,f).getActive();_classPrivateFieldSet(this,c,!i||i.isEmpty())}drop(e){const t=e.dataTransfer.getData("text/plain"),i=_classPrivateFieldGet(this,f).getEditor(t);if(!i)return;e.preventDefault();e.dataTransfer.dropEffect="move";_classPrivateMethodGet(this,m,_changeParent2).call(this,i);const n=this.div.getBoundingClientRect(),s=e.clientX-n.x,r=e.clientY-n.y;i.translate(s-i.startX,r-i.startY);this.moveEditorInDOM(i);i.div.focus()}dragover(e){e.preventDefault()}destroy(){var e;(null===(e=_classPrivateFieldGet(this,f).getActive())||void 0===e?void 0:e.parent)===this&&_classPrivateFieldGet(this,f).setActiveEditor(null);for(const e of _classPrivateFieldGet(this,u).values()){var t;null===(t=_classPrivateFieldGet(this,l))||void 0===t||t.removePointerInTextLayer(e.contentDiv);e.setParent(null);e.isAttachedToDOM=!1;e.div.remove()}this.div=null;_classPrivateFieldGet(this,u).clear();_classPrivateFieldGet(this,f).removeLayer(this)}render(e){let{viewport:t}=e;this.viewport=t;(0,o.setLayerDimensions)(this.div,t);(0,s.bindEvents)(this,this.div,["dragover","drop"]);for(const e of _classPrivateFieldGet(this,f).getEditors(this.pageIndex))this.add(e);this.updateMode()}update(e){let{viewport:t}=e;_classPrivateFieldGet(this,f).commitOrRemove();this.viewport=t;(0,o.setLayerDimensions)(this.div,{rotation:t.rotation});this.updateMode()}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}}t.AnnotationEditorLayer=AnnotationEditorLayer;function _changeParent2(e){var t;if(e.parent!==this){this.attach(e);null===(t=e.parent)||void 0===t||t.detach(e);e.setParent(this);if(e.div&&e.isAttachedToDOM){e.div.remove();this.div.append(e.div)}}}function _createNewEditor2(e){switch(_classPrivateFieldGet(this,f).getMode()){case n.AnnotationEditorType.FREETEXT:return new r.FreeTextEditor(e);case n.AnnotationEditorType.INK:return new a.InkEditor(e)}return null}function _createAndAddNewEditor2(e){const t=this.getNextId(),i=_classPrivateMethodGet(this,v,_createNewEditor2).call(this,{parent:this,id:t,x:e.offsetX,y:e.offsetY,uiManager:_classPrivateFieldGet(this,f)});i&&this.add(i);return i}function _cleanup2(){_classPrivateFieldSet(this,g,!0);for(const e of _classPrivateFieldGet(this,u).values())e.isEmpty()&&e.remove();_classPrivateFieldSet(this,g,!1)}!function _defineProperty(e,t,i){(t=function _toPropertyKey(e){var t=function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i;return e}(AnnotationEditorLayer,"_initialized",!1)},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FreeTextEditor=void 0;var n=i(1),s=i(137),r=i(136);function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t);t.add(e)}function _defineProperty(e,t,i){(t=function _toPropertyKey(e){var t=function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i;return 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 _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return 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 a=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakSet,m=new WeakSet,v=new WeakSet,_=new WeakSet;class FreeTextEditor extends r.AnnotationEditor{constructor(e){super({...e,name:"freeTextEditor"});_classPrivateMethodInitSpec(this,_);_classPrivateMethodInitSpec(this,v);_classPrivateMethodInitSpec(this,m);_classPrivateMethodInitSpec(this,f);_classPrivateFieldInitSpec(this,a,{writable:!0,value:this.editorDivBlur.bind(this)});_classPrivateFieldInitSpec(this,o,{writable:!0,value:this.editorDivFocus.bind(this)});_classPrivateFieldInitSpec(this,l,{writable:!0,value:this.editorDivInput.bind(this)});_classPrivateFieldInitSpec(this,c,{writable:!0,value:this.editorDivKeydown.bind(this)});_classPrivateFieldInitSpec(this,d,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,h,{writable:!0,value:""});_classPrivateFieldInitSpec(this,u,{writable:!0,value:`${this.id}-editor`});_classPrivateFieldInitSpec(this,p,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,g,{writable:!0,value:void 0});_classPrivateFieldSet(this,d,e.color||FreeTextEditor._defaultColor||r.AnnotationEditor._defaultLineColor);_classPrivateFieldSet(this,g,e.fontSize||FreeTextEditor._defaultFontSize)}static initialize(e){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map((t=>[t,e.get(t)])));const t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case n.AnnotationEditorParamsType.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=t;break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:FreeTextEditor._defaultColor=t}}updateParams(e,t){switch(e){case n.AnnotationEditorParamsType.FREETEXT_SIZE:_classPrivateMethodGet(this,f,_updateFontSize2).call(this,t);break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:_classPrivateMethodGet(this,m,_updateColor2).call(this,t)}}static get defaultPropertiesToUpdate(){return[[n.AnnotationEditorParamsType.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[n.AnnotationEditorParamsType.FREETEXT_COLOR,FreeTextEditor._defaultColor||r.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[n.AnnotationEditorParamsType.FREETEXT_SIZE,_classPrivateFieldGet(this,g)],[n.AnnotationEditorParamsType.FREETEXT_COLOR,_classPrivateFieldGet(this,d)]]}getInitialTranslation(){const e=this.parentScale;return[-FreeTextEditor._internalPadding*e,-(FreeTextEditor._internalPadding+_classPrivateFieldGet(this,g))*e]}rebuild(){super.rebuild();null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){if(!this.isInEditMode()){this.parent.setEditingState(!1);this.parent.updateToolbar(n.AnnotationEditorType.FREETEXT);super.enableEditMode();this.overlayDiv.classList.remove("enabled");this.editorDiv.contentEditable=!0;this.div.draggable=!1;this.div.removeAttribute("aria-activedescendant");this.editorDiv.addEventListener("keydown",_classPrivateFieldGet(this,c));this.editorDiv.addEventListener("focus",_classPrivateFieldGet(this,o));this.editorDiv.addEventListener("blur",_classPrivateFieldGet(this,a));this.editorDiv.addEventListener("input",_classPrivateFieldGet(this,l))}}disableEditMode(){if(this.isInEditMode()){this.parent.setEditingState(!0);super.disableEditMode();this.overlayDiv.classList.add("enabled");this.editorDiv.contentEditable=!1;this.div.setAttribute("aria-activedescendant",_classPrivateFieldGet(this,u));this.div.draggable=!0;this.editorDiv.removeEventListener("keydown",_classPrivateFieldGet(this,c));this.editorDiv.removeEventListener("focus",_classPrivateFieldGet(this,o));this.editorDiv.removeEventListener("blur",_classPrivateFieldGet(this,a));this.editorDiv.removeEventListener("input",_classPrivateFieldGet(this,l));this.div.focus({preventScroll:!0});this.isEditing=!1;this.parent.div.classList.add("freeTextEditing")}}focusin(e){super.focusin(e);e.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){if(!this.width){this.enableEditMode();this.editorDiv.focus()}}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1;this.parent.setEditingState(!0);this.parent.div.classList.add("freeTextEditing");super.remove()}commit(){if(this.isInEditMode()){super.commit();if(!_classPrivateFieldGet(this,p)){_classPrivateFieldSet(this,p,!0);this.parent.addUndoableEditor(this)}this.disableEditMode();_classPrivateFieldSet(this,h,_classPrivateMethodGet(this,v,_extractText2).call(this).trimEnd());_classPrivateMethodGet(this,_,_setEditorDimensions2).call(this)}}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(e){this.enableEditMode();this.editorDiv.focus()}keydown(e){if(e.target===this.div&&"Enter"===e.key){this.enableEditMode();this.editorDiv.focus()}}editorDivKeydown(e){FreeTextEditor._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment");this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox");this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let e,t;if(this.width){e=this.x;t=this.y}super.render();this.editorDiv=document.createElement("div");this.editorDiv.className="internal";this.editorDiv.setAttribute("id",_classPrivateFieldGet(this,u));this.enableEditing();FreeTextEditor._l10nPromise.get("editor_free_text2_aria_label").then((e=>{var t;return null===(t=this.editorDiv)||void 0===t?void 0:t.setAttribute("aria-label",e)}));FreeTextEditor._l10nPromise.get("free_text2_default_content").then((e=>{var t;return null===(t=this.editorDiv)||void 0===t?void 0:t.setAttribute("default-content",e)}));this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;i.fontSize=`calc(${_classPrivateFieldGet(this,g)}px * var(--scale-factor))`;i.color=_classPrivateFieldGet(this,d);this.div.append(this.editorDiv);this.overlayDiv=document.createElement("div");this.overlayDiv.classList.add("overlay","enabled");this.div.append(this.overlayDiv);(0,s.bindEvents)(this,this.div,["dblclick","keydown"]);if(this.width){const[i,n]=this.parentDimensions;this.setAt(e*i,t*n,this.width*i,this.height*n);for(const e of _classPrivateFieldGet(this,h).split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br"));this.editorDiv.append(t)}this.div.draggable=!0;this.editorDiv.contentEditable=!1}else{this.div.draggable=!1;this.editorDiv.contentEditable=!0}return this.div}get contentDiv(){return this.editorDiv}static deserialize(e,t,i){const s=super.deserialize(e,t,i);_classPrivateFieldSet(s,g,e.fontSize);_classPrivateFieldSet(s,d,n.Util.makeHexColor(...e.color));_classPrivateFieldSet(s,h,e.value);return s}serialize(){if(this.isEmpty())return null;const e=FreeTextEditor._internalPadding*this.parentScale,t=this.getRect(e,e),i=r.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:_classPrivateFieldGet(this,d));return{annotationType:n.AnnotationEditorType.FREETEXT,color:i,fontSize:_classPrivateFieldGet(this,g),value:_classPrivateFieldGet(this,h),pageIndex:this.pageIndex,rect:t,rotation:this.rotation}}}t.FreeTextEditor=FreeTextEditor;function _updateFontSize2(e){const setFontsize=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--scale-factor))`;this.translate(0,-(e-_classPrivateFieldGet(this,g))*this.parentScale);_classPrivateFieldSet(this,g,e);_classPrivateMethodGet(this,_,_setEditorDimensions2).call(this)},t=_classPrivateFieldGet(this,g);this.addCommands({cmd:()=>{setFontsize(e)},undo:()=>{setFontsize(t)},mustExec:!0,type:n.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function _updateColor2(e){const t=_classPrivateFieldGet(this,d);this.addCommands({cmd:()=>{_classPrivateFieldSet(this,d,this.editorDiv.style.color=e)},undo:()=>{_classPrivateFieldSet(this,d,this.editorDiv.style.color=t)},mustExec:!0,type:n.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function _extractText2(){const e=this.editorDiv.getElementsByTagName("div");if(0===e.length)return this.editorDiv.innerText;const t=[];for(const i of e)t.push(i.innerText.replace(/\r\n?|\n/,""));return t.join("\n")}function _setEditorDimensions2(){const[e,t]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:e,div:t}=this,n=t.style.display;t.style.display="hidden";e.div.append(this.div);i=t.getBoundingClientRect();t.remove();t.style.display=n}this.width=i.width/e;this.height=i.height/t}_defineProperty(FreeTextEditor,"_freeTextDefaultContent","");_defineProperty(FreeTextEditor,"_l10nPromise",void 0);_defineProperty(FreeTextEditor,"_internalPadding",0);_defineProperty(FreeTextEditor,"_defaultColor",null);_defineProperty(FreeTextEditor,"_defaultFontSize",10);_defineProperty(FreeTextEditor,"_keyboardManager",new s.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],FreeTextEditor.prototype.commitOrRemove]]));_defineProperty(FreeTextEditor,"_type","freetext")},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.InkEditor=void 0;Object.defineProperty(t,"fitCurve",{enumerable:!0,get:function(){return r.fitCurve}});var n=i(1),s=i(136),r=i(162),a=i(137);function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t);t.add(e)}function _defineProperty(e,t,i){(t=function _toPropertyKey(e){var t=function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i;return 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 _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 _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 o=16,l=100;var c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,m=new WeakMap,v=new WeakMap,_=new WeakMap,b=new WeakMap,w=new WeakMap,y=new WeakMap,P=new WeakMap,S=new WeakSet,A=new WeakSet,E=new WeakSet,x=new WeakSet,C=new WeakSet,M=new WeakSet,T=new WeakSet,k=new WeakSet,I=new WeakSet,D=new WeakSet,R=new WeakSet,L=new WeakSet,O=new WeakSet,N=new WeakSet,B=new WeakSet,G=new WeakSet,V=new WeakSet,W=new WeakSet,U=new WeakSet,j=new WeakSet,H=new WeakSet,z=new WeakSet;class InkEditor extends s.AnnotationEditor{constructor(e){super({...e,name:"inkEditor"});_classPrivateMethodInitSpec(this,z);_classPrivateMethodInitSpec(this,H);_classPrivateMethodInitSpec(this,j);_classPrivateMethodInitSpec(this,U);_classPrivateMethodInitSpec(this,W);_classPrivateMethodInitSpec(this,V);_classPrivateMethodInitSpec(this,G);_classPrivateMethodInitSpec(this,B);_classPrivateMethodInitSpec(this,N);_classPrivateMethodInitSpec(this,O);_classPrivateMethodInitSpec(this,L);_classPrivateMethodInitSpec(this,R);_classPrivateMethodInitSpec(this,D);_classPrivateMethodInitSpec(this,I);_classPrivateMethodInitSpec(this,k);_classPrivateMethodInitSpec(this,T);_classPrivateMethodInitSpec(this,M);_classPrivateMethodInitSpec(this,C);_classPrivateMethodInitSpec(this,x);_classPrivateMethodInitSpec(this,E);_classPrivateMethodInitSpec(this,A);_classPrivateMethodInitSpec(this,S);_classPrivateFieldInitSpec(this,c,{writable:!0,value:0});_classPrivateFieldInitSpec(this,d,{writable:!0,value:0});_classPrivateFieldInitSpec(this,h,{writable:!0,value:0});_classPrivateFieldInitSpec(this,u,{writable:!0,value:this.canvasPointermove.bind(this)});_classPrivateFieldInitSpec(this,p,{writable:!0,value:this.canvasPointerleave.bind(this)});_classPrivateFieldInitSpec(this,g,{writable:!0,value:this.canvasPointerup.bind(this)});_classPrivateFieldInitSpec(this,f,{writable:!0,value:this.canvasPointerdown.bind(this)});_classPrivateFieldInitSpec(this,m,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,v,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,_,{writable:!0,value:null});_classPrivateFieldInitSpec(this,b,{writable:!0,value:null});_classPrivateFieldInitSpec(this,w,{writable:!0,value:0});_classPrivateFieldInitSpec(this,y,{writable:!0,value:0});_classPrivateFieldInitSpec(this,P,{writable:!0,value:null});this.color=e.color||null;this.thickness=e.thickness||null;this.opacity=e.opacity||null;this.paths=[];this.bezierPath2D=[];this.currentPath=[];this.scaleFactor=1;this.translationX=this.translationY=0;this.x=0;this.y=0}static initialize(e){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map((t=>[t,e.get(t)])))}static updateDefaultParams(e,t){switch(e){case n.AnnotationEditorParamsType.INK_THICKNESS:InkEditor._defaultThickness=t;break;case n.AnnotationEditorParamsType.INK_COLOR:InkEditor._defaultColor=t;break;case n.AnnotationEditorParamsType.INK_OPACITY:InkEditor._defaultOpacity=t/100}}updateParams(e,t){switch(e){case n.AnnotationEditorParamsType.INK_THICKNESS:_classPrivateMethodGet(this,S,_updateThickness2).call(this,t);break;case n.AnnotationEditorParamsType.INK_COLOR:_classPrivateMethodGet(this,A,_updateColor2).call(this,t);break;case n.AnnotationEditorParamsType.INK_OPACITY:_classPrivateMethodGet(this,E,_updateOpacity2).call(this,t)}}static get defaultPropertiesToUpdate(){return[[n.AnnotationEditorParamsType.INK_THICKNESS,InkEditor._defaultThickness],[n.AnnotationEditorParamsType.INK_COLOR,InkEditor._defaultColor||s.AnnotationEditor._defaultLineColor],[n.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*InkEditor._defaultOpacity)]]}get propertiesToUpdate(){return[[n.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||InkEditor._defaultThickness],[n.AnnotationEditorParamsType.INK_COLOR,this.color||InkEditor._defaultColor||s.AnnotationEditor._defaultLineColor],[n.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??InkEditor._defaultOpacity))]]}rebuild(){super.rebuild();if(null!==this.div){if(!this.canvas){_classPrivateMethodGet(this,R,_createCanvas2).call(this);_classPrivateMethodGet(this,L,_createObserver2).call(this)}if(!this.isAttachedToDOM){this.parent.add(this);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this)}_classPrivateMethodGet(this,H,_fitToContent2).call(this)}}remove(){if(null!==this.canvas){this.isEmpty()||this.commit();this.canvas.width=this.canvas.height=0;this.canvas.remove();this.canvas=null;_classPrivateFieldGet(this,b).disconnect();_classPrivateFieldSet(this,b,null);super.remove()}}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&null===e&&this._uiManager.addShouldRescale(this);super.setParent(e)}onScaleChanging(){const[e,t]=this.parentDimensions,i=this.width*e,n=this.height*t;this.setDimensions(i,n)}enableEditMode(){if(!_classPrivateFieldGet(this,m)&&null!==this.canvas){super.enableEditMode();this.div.draggable=!1;this.canvas.addEventListener("pointerdown",_classPrivateFieldGet(this,f));this.canvas.addEventListener("pointerup",_classPrivateFieldGet(this,g))}}disableEditMode(){if(this.isInEditMode()&&null!==this.canvas){super.disableEditMode();this.div.draggable=!this.isEmpty();this.div.classList.remove("editing");this.canvas.removeEventListener("pointerdown",_classPrivateFieldGet(this,f));this.canvas.removeEventListener("pointerup",_classPrivateFieldGet(this,g))}}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){if(!_classPrivateFieldGet(this,m)){super.commit();this.isEditing=!1;this.disableEditMode();this.setInForeground();_classPrivateFieldSet(this,m,!0);this.div.classList.add("disabled");_classPrivateMethodGet(this,H,_fitToContent2).call(this,!0);this.parent.addInkEditorIfNeeded(!0);this.parent.moveEditorInDOM(this);this.div.focus({preventScroll:!0})}}focusin(e){super.focusin(e);this.enableEditMode()}canvasPointerdown(e){if(0===e.button&&this.isInEditMode()&&!_classPrivateFieldGet(this,m)){this.setInForeground();"mouse"!==e.type&&this.div.focus();e.stopPropagation();this.canvas.addEventListener("pointerleave",_classPrivateFieldGet(this,p));this.canvas.addEventListener("pointermove",_classPrivateFieldGet(this,u));_classPrivateMethodGet(this,M,_startDrawing2).call(this,e.offsetX,e.offsetY)}}canvasPointermove(e){e.stopPropagation();_classPrivateMethodGet(this,T,_draw2).call(this,e.offsetX,e.offsetY)}canvasPointerup(e){if(0===e.button&&this.isInEditMode()&&0!==this.currentPath.length){e.stopPropagation();_classPrivateMethodGet(this,D,_endDrawing2).call(this,e);this.setInBackground()}}canvasPointerleave(e){_classPrivateMethodGet(this,D,_endDrawing2).call(this,e);this.setInBackground()}render(){if(this.div)return this.div;let e,t;if(this.width){e=this.x;t=this.y}super.render();InkEditor._l10nPromise.get("editor_ink2_aria_label").then((e=>{var t;return null===(t=this.div)||void 0===t?void 0:t.setAttribute("aria-label",e)}));const[i,n,s,r]=_classPrivateMethodGet(this,x,_getInitialBBox2).call(this);this.setAt(i,n,0,0);this.setDims(s,r);_classPrivateMethodGet(this,R,_createCanvas2).call(this);if(this.width){const[i,n]=this.parentDimensions;this.setAt(e*i,t*n,this.width*i,this.height*n);_classPrivateFieldSet(this,v,!0);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);this.setDims(this.width*i,this.height*n);_classPrivateMethodGet(this,I,_redraw2).call(this);_classPrivateMethodGet(this,z,_setMinDims2).call(this);this.div.classList.add("disabled")}else{this.div.classList.add("editing");this.enableEditMode()}_classPrivateMethodGet(this,L,_createObserver2).call(this);return this.div}setDimensions(e,t){const i=Math.round(e),n=Math.round(t);if(_classPrivateFieldGet(this,w)===i&&_classPrivateFieldGet(this,y)===n)return;_classPrivateFieldSet(this,w,i);_classPrivateFieldSet(this,y,n);this.canvas.style.visibility="hidden";if(_classPrivateFieldGet(this,c)&&Math.abs(_classPrivateFieldGet(this,c)-e/t)>.01){t=Math.ceil(e/_classPrivateFieldGet(this,c));this.setDims(e,t)}const[s,r]=this.parentDimensions;this.width=e/s;this.height=t/r;_classPrivateFieldGet(this,m)&&_classPrivateMethodGet(this,N,_setScaleFactor2).call(this,e,t);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);_classPrivateMethodGet(this,I,_redraw2).call(this);this.canvas.style.visibility="visible"}static deserialize(e,t,i){const s=super.deserialize(e,t,i);s.thickness=e.thickness;s.color=n.Util.makeHexColor(...e.color);s.opacity=e.opacity;const[r,a]=s.pageDimensions,l=s.width*r,u=s.height*a,p=s.parentScale,g=e.thickness/2;_classPrivateFieldSet(s,c,l/u);_classPrivateFieldSet(s,m,!0);_classPrivateFieldSet(s,w,Math.round(l));_classPrivateFieldSet(s,y,Math.round(u));for(const{bezier:t}of e.paths){const e=[];s.paths.push(e);let i=p*(t[0]-g),n=p*(u-t[1]-g);for(let s=2,r=t.length;s<r;s+=6){const r=p*(t[s]-g),a=p*(u-t[s+1]-g),o=p*(t[s+2]-g),l=p*(u-t[s+3]-g),c=p*(t[s+4]-g),d=p*(u-t[s+5]-g);e.push([[i,n],[r,a],[o,l],[c,d]]);i=c;n=d}const r=_classStaticPrivateMethodGet(this,InkEditor,_buildPath2D).call(this,e);s.bezierPath2D.push(r)}const f=_classPrivateMethodGet(s,U,_getBbox2).call(s);_classPrivateFieldSet(s,h,Math.max(o,f[2]-f[0]));_classPrivateFieldSet(s,d,Math.max(o,f[3]-f[1]));_classPrivateMethodGet(s,N,_setScaleFactor2).call(s,l,u);return s}serialize(){if(this.isEmpty())return null;const e=this.getRect(0,0),t=this.rotation%180==0?e[3]-e[1]:e[2]-e[0],i=s.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:n.AnnotationEditorType.INK,color:i,thickness:this.thickness,opacity:this.opacity,paths:_classPrivateMethodGet(this,G,_serializePaths2).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:e,rotation:this.rotation}}}t.InkEditor=InkEditor;function _updateThickness2(e){const t=this.thickness;this.addCommands({cmd:()=>{this.thickness=e;_classPrivateMethodGet(this,H,_fitToContent2).call(this)},undo:()=>{this.thickness=t;_classPrivateMethodGet(this,H,_fitToContent2).call(this)},mustExec:!0,type:n.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function _updateColor2(e){const t=this.color;this.addCommands({cmd:()=>{this.color=e;_classPrivateMethodGet(this,I,_redraw2).call(this)},undo:()=>{this.color=t;_classPrivateMethodGet(this,I,_redraw2).call(this)},mustExec:!0,type:n.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function _updateOpacity2(e){e/=100;const t=this.opacity;this.addCommands({cmd:()=>{this.opacity=e;_classPrivateMethodGet(this,I,_redraw2).call(this)},undo:()=>{this.opacity=t;_classPrivateMethodGet(this,I,_redraw2).call(this)},mustExec:!0,type:n.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function _getInitialBBox2(){const{parentRotation:e,parentDimensions:[t,i]}=this;switch(e){case 90:return[0,i,i,t];case 180:return[t,i,t,i];case 270:return[t,0,i,t];default:return[0,0,t,i]}}function _setStroke2(){const{ctx:e,color:t,opacity:i,thickness:n,parentScale:s,scaleFactor:r}=this;e.lineWidth=n*s/r;e.lineCap="round";e.lineJoin="round";e.miterLimit=10;e.strokeStyle=`${t}${(0,a.opacityToHex)(i)}`}function _startDrawing2(e,t){this.isEditing=!0;if(!_classPrivateFieldGet(this,v)){_classPrivateFieldSet(this,v,!0);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);this.thickness||(this.thickness=InkEditor._defaultThickness);this.color||(this.color=InkEditor._defaultColor||s.AnnotationEditor._defaultLineColor);this.opacity??(this.opacity=InkEditor._defaultOpacity)}this.currentPath.push([e,t]);_classPrivateFieldSet(this,_,null);_classPrivateMethodGet(this,C,_setStroke2).call(this);this.ctx.beginPath();this.ctx.moveTo(e,t);_classPrivateFieldSet(this,P,(()=>{if(_classPrivateFieldGet(this,P)){if(_classPrivateFieldGet(this,_)){if(this.isEmpty()){this.ctx.setTransform(1,0,0,1,0,0);this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}else _classPrivateMethodGet(this,I,_redraw2).call(this);this.ctx.lineTo(..._classPrivateFieldGet(this,_));_classPrivateFieldSet(this,_,null);this.ctx.stroke()}window.requestAnimationFrame(_classPrivateFieldGet(this,P))}}));window.requestAnimationFrame(_classPrivateFieldGet(this,P))}function _draw2(e,t){const[i,n]=this.currentPath.at(-1);if(e!==i||t!==n){this.currentPath.push([e,t]);_classPrivateFieldSet(this,_,[e,t])}}function _stopDrawing2(e,t){this.ctx.closePath();_classPrivateFieldSet(this,P,null);e=Math.min(Math.max(e,0),this.canvas.width);t=Math.min(Math.max(t,0),this.canvas.height);const[i,n]=this.currentPath.at(-1);e===i&&t===n||this.currentPath.push([e,t]);let s;if(1!==this.currentPath.length)s=(0,r.fitCurve)(this.currentPath,30,null);else{const i=[e,t];s=[[i,i.slice(),i.slice(),i]]}const a=_classStaticPrivateMethodGet(InkEditor,InkEditor,_buildPath2D).call(InkEditor,s);this.currentPath.length=0;this.addCommands({cmd:()=>{this.paths.push(s);this.bezierPath2D.push(a);this.rebuild()},undo:()=>{this.paths.pop();this.bezierPath2D.pop();if(0===this.paths.length)this.remove();else{if(!this.canvas){_classPrivateMethodGet(this,R,_createCanvas2).call(this);_classPrivateMethodGet(this,L,_createObserver2).call(this)}_classPrivateMethodGet(this,H,_fitToContent2).call(this)}},mustExec:!0})}function _redraw2(){if(this.isEmpty()){_classPrivateMethodGet(this,B,_updateTransform2).call(this);return}_classPrivateMethodGet(this,C,_setStroke2).call(this);const{canvas:e,ctx:t}=this;t.setTransform(1,0,0,1,0,0);t.clearRect(0,0,e.width,e.height);_classPrivateMethodGet(this,B,_updateTransform2).call(this);for(const e of this.bezierPath2D)t.stroke(e)}function _endDrawing2(e){_classPrivateMethodGet(this,k,_stopDrawing2).call(this,e.offsetX,e.offsetY);this.canvas.removeEventListener("pointerleave",_classPrivateFieldGet(this,p));this.canvas.removeEventListener("pointermove",_classPrivateFieldGet(this,u));this.addToAnnotationStorage()}function _createCanvas2(){this.canvas=document.createElement("canvas");this.canvas.width=this.canvas.height=0;this.canvas.className="inkEditorCanvas";InkEditor._l10nPromise.get("editor_ink_canvas_aria_label").then((e=>{var t;return null===(t=this.canvas)||void 0===t?void 0:t.setAttribute("aria-label",e)}));this.div.append(this.canvas);const e=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0;this.ctx=this.canvas.getContext("2d",e)}function _createObserver2(){let e=null;_classPrivateFieldSet(this,b,new ResizeObserver((t=>{const i=t[0].contentRect;if(i.width&&i.height){null!==e&&clearTimeout(e);e=setTimeout((()=>{this.fixDims();e=null}),l);this.setDimensions(i.width,i.height)}})));_classPrivateFieldGet(this,b).observe(this.div)}function _setCanvasDims2(){if(!_classPrivateFieldGet(this,v))return;const[e,t]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e);this.canvas.height=Math.ceil(this.height*t);_classPrivateMethodGet(this,B,_updateTransform2).call(this)}function _setScaleFactor2(e,t){const i=_classPrivateMethodGet(this,j,_getPadding2).call(this),n=(e-i)/_classPrivateFieldGet(this,h),s=(t-i)/_classPrivateFieldGet(this,d);this.scaleFactor=Math.min(n,s)}function _updateTransform2(){const e=_classPrivateMethodGet(this,j,_getPadding2).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}function _buildPath2D(e){const t=new Path2D;for(let i=0,n=e.length;i<n;i++){const[n,s,r,a]=e[i];0===i&&t.moveTo(...n);t.bezierCurveTo(s[0],s[1],r[0],r[1],a[0],a[1])}return t}function _serializePaths2(e,t,i,n){const s=[],r=this.thickness/2;let a,o;for(const l of this.paths){a=[];o=[];for(let s=0,c=l.length;s<c;s++){const[c,d,h,u]=l[s],p=e*(c[0]+t)+r,g=n-e*(c[1]+i)-r,f=e*(d[0]+t)+r,m=n-e*(d[1]+i)-r,v=e*(h[0]+t)+r,_=n-e*(h[1]+i)-r,b=e*(u[0]+t)+r,w=n-e*(u[1]+i)-r;if(0===s){a.push(p,g);o.push(p,g)}a.push(f,m,v,_,b,w);_classPrivateMethodGet(this,V,_extractPointsOnBezier2).call(this,p,g,f,m,v,_,b,w,4,o)}s.push({bezier:a,points:o})}return s}function _extractPointsOnBezier2(e,t,i,n,s,r,a,o,l,c){if(_classPrivateMethodGet(this,W,_isAlmostFlat2).call(this,e,t,i,n,s,r,a,o))c.push(a,o);else{for(let d=1;d<l-1;d++){const h=d/l,u=1-h;let p=h*e+u*i,g=h*t+u*n,f=h*i+u*s,m=h*n+u*r;p=h*p+u*f;g=h*g+u*m;f=h*f+u*(h*s+u*a);m=h*m+u*(h*r+u*o);p=h*p+u*f;g=h*g+u*m;c.push(p,g)}c.push(a,o)}}function _isAlmostFlat2(e,t,i,n,s,r,a,o){const l=(3*i-2*e-a)**2,c=(3*n-2*t-o)**2,d=(3*s-e-2*a)**2,h=(3*r-t-2*o)**2;return Math.max(l,d)+Math.max(c,h)<=10}function _getBbox2(){let e=1/0,t=-1/0,i=1/0,s=-1/0;for(const r of this.paths)for(const[a,o,l,c]of r){const r=n.Util.bezierBoundingBox(...a,...o,...l,...c);e=Math.min(e,r[0]);i=Math.min(i,r[1]);t=Math.max(t,r[2]);s=Math.max(s,r[3])}return[e,i,t,s]}function _getPadding2(){return _classPrivateFieldGet(this,m)?Math.ceil(this.thickness*this.parentScale):0}function _fitToContent2(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!_classPrivateFieldGet(this,m)){_classPrivateMethodGet(this,I,_redraw2).call(this);return}const t=_classPrivateMethodGet(this,U,_getBbox2).call(this),i=_classPrivateMethodGet(this,j,_getPadding2).call(this);_classPrivateFieldSet(this,h,Math.max(o,t[2]-t[0]));_classPrivateFieldSet(this,d,Math.max(o,t[3]-t[1]));const n=Math.ceil(i+_classPrivateFieldGet(this,h)*this.scaleFactor),s=Math.ceil(i+_classPrivateFieldGet(this,d)*this.scaleFactor),[r,a]=this.parentDimensions;this.width=n/r;this.height=s/a;_classPrivateFieldSet(this,c,n/s);_classPrivateMethodGet(this,z,_setMinDims2).call(this);const l=this.translationX,u=this.translationY;this.translationX=-t[0];this.translationY=-t[1];_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);_classPrivateMethodGet(this,I,_redraw2).call(this);_classPrivateFieldSet(this,w,n);_classPrivateFieldSet(this,y,s);this.setDims(n,s);const p=e?i/this.scaleFactor/2:0;this.translate(l-this.translationX-p,u-this.translationY-p)}function _setMinDims2(){const{style:e}=this.div;if(_classPrivateFieldGet(this,c)>=1){e.minHeight=`${o}px`;e.minWidth=`${Math.round(_classPrivateFieldGet(this,c)*o)}px`}else{e.minWidth=`${o}px`;e.minHeight=`${Math.round(o/_classPrivateFieldGet(this,c))}px`}}_defineProperty(InkEditor,"_defaultColor",null);_defineProperty(InkEditor,"_defaultOpacity",1);_defineProperty(InkEditor,"_defaultThickness",1);_defineProperty(InkEditor,"_l10nPromise",void 0);_defineProperty(InkEditor,"_type","ink")},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.fitCurve=void 0;const n=i(163);t.fitCurve=n},e=>{"use strict";function fitCubic(e,t,i,n,s){var r,a,o,l,c,d,h,u,p,g,f,m,v;if(2===e.length){m=maths.vectorLen(maths.subtract(e[0],e[1]))/3;return[r=[e[0],maths.addArrays(e[0],maths.mulItems(t,m)),maths.addArrays(e[1],maths.mulItems(i,m)),e[1]]]}a=function chordLengthParameterize(e){var t,i,n,s=[];e.forEach(((e,r)=>{t=r?i+maths.vectorLen(maths.subtract(e,n)):0;s.push(t);i=t;n=e}));s=s.map((e=>e/i));return s}(e);[r,l,d]=generateAndReport(e,a,a,t,i,s);if(0===l||l<n)return[r];if(l<n*n){o=a;c=l;h=d;for(v=0;v<20;v++){o=reparameterize(r,e,o);[r,l,d]=generateAndReport(e,a,o,t,i,s);if(l<n)return[r];if(d===h){let e=l/c;if(e>.9999&&e<1.0001)break}c=l;h=d}}f=[];if((u=maths.subtract(e[d-1],e[d+1])).every((e=>0===e))){u=maths.subtract(e[d-1],e[d]);[u[0],u[1]]=[-u[1],u[0]]}p=maths.normalize(u);g=maths.mulItems(p,-1);return f=(f=f.concat(fitCubic(e.slice(0,d+1),t,p,n,s))).concat(fitCubic(e.slice(d),g,i,n,s))}function generateAndReport(e,t,i,n,s,r){var a,o,l;a=function generateBezier(e,t,i,n){var s,r,a,o,l,c,d,h,u,p,g,f,m,v,_,b,w,y=e[0],P=e[e.length-1];s=[y,null,null,P];r=maths.zeros_Xx2x2(t.length);for(m=0,v=t.length;m<v;m++){w=1-(b=t[m]);(a=r[m])[0]=maths.mulItems(i,3*b*(w*w));a[1]=maths.mulItems(n,3*w*(b*b))}o=[[0,0],[0,0]];l=[0,0];for(m=0,v=e.length;m<v;m++){b=t[m];a=r[m];o[0][0]+=maths.dot(a[0],a[0]);o[0][1]+=maths.dot(a[0],a[1]);o[1][0]+=maths.dot(a[0],a[1]);o[1][1]+=maths.dot(a[1],a[1]);_=maths.subtract(e[m],bezier.q([y,y,P,P],b));l[0]+=maths.dot(a[0],_);l[1]+=maths.dot(a[1],_)}c=o[0][0]*o[1][1]-o[1][0]*o[0][1];d=o[0][0]*l[1]-o[1][0]*l[0];h=l[0]*o[1][1]-l[1]*o[0][1];u=0===c?0:h/c;p=0===c?0:d/c;f=maths.vectorLen(maths.subtract(y,P));if(u<(g=1e-6*f)||p<g){s[1]=maths.addArrays(y,maths.mulItems(i,f/3));s[2]=maths.addArrays(P,maths.mulItems(n,f/3))}else{s[1]=maths.addArrays(y,maths.mulItems(i,u));s[2]=maths.addArrays(P,maths.mulItems(n,p))}return s}(e,i,n,s);[o,l]=function computeMaxError(e,t,i){var n,s,r,a,o,l,c,d;s=0;r=Math.floor(e.length/2);const h=mapTtoRelativeDistances(t,10);for(o=0,l=e.length;o<l;o++){c=e[o];d=find_t(t,i[o],h,10);if((n=(a=maths.subtract(bezier.q(t,d),c))[0]*a[0]+a[1]*a[1])>s){s=n;r=o}}return[s,r]}(e,a,t);r&&r({bez:a,points:e,params:t,maxErr:o,maxPoint:l});return[a,o,l]}function reparameterize(e,t,i){return i.map(((i,n)=>newtonRaphsonRootFind(e,t[n],i)))}function newtonRaphsonRootFind(e,t,i){var n=maths.subtract(bezier.q(e,i),t),s=bezier.qprime(e,i),r=maths.mulMatrix(n,s),a=maths.sum(maths.squareItems(s))+2*maths.mulMatrix(n,bezier.qprimeprime(e,i));return 0===a?i:i-r/a}var mapTtoRelativeDistances=function(e,t){for(var i,n=[0],s=e[0],r=0,a=1;a<=t;a++){i=bezier.q(e,a/t);r+=maths.vectorLen(maths.subtract(i,s));n.push(r);s=i}return n=n.map((e=>e/r))};function find_t(e,t,i,n){if(t<0)return 0;if(t>1)return 1;for(var s,r,a,o,l=1;l<=n;l++)if(t<=i[l]){a=(l-1)/n;r=l/n;o=(t-(s=i[l-1]))/(i[l]-s)*(r-a)+a;break}return o}function createTangent(e,t){return maths.normalize(maths.subtract(e,t))}class maths{static zeros_Xx2x2(e){for(var t=[];e--;)t.push([0,0]);return t}static mulItems(e,t){return e.map((e=>e*t))}static mulMatrix(e,t){return e.reduce(((e,i,n)=>e+i*t[n]),0)}static subtract(e,t){return e.map(((e,i)=>e-t[i]))}static addArrays(e,t){return e.map(((e,i)=>e+t[i]))}static addItems(e,t){return e.map((e=>e+t))}static sum(e){return e.reduce(((e,t)=>e+t))}static dot(e,t){return maths.mulMatrix(e,t)}static vectorLen(e){return Math.hypot(...e)}static divItems(e,t){return e.map((e=>e/t))}static squareItems(e){return e.map((e=>e*e))}static normalize(e){return this.divItems(e,this.vectorLen(e))}}class bezier{static q(e,t){var i=1-t,n=maths.mulItems(e[0],i*i*i),s=maths.mulItems(e[1],3*i*i*t),r=maths.mulItems(e[2],3*i*t*t),a=maths.mulItems(e[3],t*t*t);return maths.addArrays(maths.addArrays(n,s),maths.addArrays(r,a))}static qprime(e,t){var i=1-t,n=maths.mulItems(maths.subtract(e[1],e[0]),3*i*i),s=maths.mulItems(maths.subtract(e[2],e[1]),6*i*t),r=maths.mulItems(maths.subtract(e[3],e[2]),3*t*t);return maths.addArrays(maths.addArrays(n,s),r)}static qprimeprime(e,t){return maths.addArrays(maths.mulItems(maths.addArrays(maths.subtract(e[2],maths.mulItems(e[1],2)),e[0]),6*(1-t)),maths.mulItems(maths.addArrays(maths.subtract(e[3],maths.mulItems(e[2],2)),e[1]),6*t))}}e.exports=function fitCurve(e,t,i){if(!Array.isArray(e))throw new TypeError("First argument should be an array");e.forEach((t=>{if(!Array.isArray(t)||t.some((e=>"number"!=typeof e))||t.length!==e[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}));if((e=e.filter(((t,i)=>0===i||!t.every(((t,n)=>t===e[i-1][n]))))).length<2)return[];const n=e.length,s=createTangent(e[1],e[0]),r=createTangent(e[n-2],e[n-1]);return fitCubic(e,s,r,t,i)};e.exports.fitCubic=fitCubic;e.exports.createTangent=createTangent},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.AnnotationLayer=void 0;var n=i(1),s=i(138),r=i(135),a=i(165),o=i(166);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 _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 l=1e3,c=new WeakSet;function getRectDims(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class AnnotationElementFactory{static create(e){switch(e.data.annotationType){case n.AnnotationType.LINK:return new LinkAnnotationElement(e);case n.AnnotationType.TEXT:return new TextAnnotationElement(e);case n.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new TextWidgetAnnotationElement(e);case"Btn":return e.data.radioButton?new RadioButtonWidgetAnnotationElement(e):e.data.checkBox?new CheckboxWidgetAnnotationElement(e):new PushButtonWidgetAnnotationElement(e);case"Ch":return new ChoiceWidgetAnnotationElement(e)}return new WidgetAnnotationElement(e);case n.AnnotationType.POPUP:return new PopupAnnotationElement(e);case n.AnnotationType.FREETEXT:return new FreeTextAnnotationElement(e);case n.AnnotationType.LINE:return new LineAnnotationElement(e);case n.AnnotationType.SQUARE:return new SquareAnnotationElement(e);case n.AnnotationType.CIRCLE:return new CircleAnnotationElement(e);case n.AnnotationType.POLYLINE:return new PolylineAnnotationElement(e);case n.AnnotationType.CARET:return new CaretAnnotationElement(e);case n.AnnotationType.INK:return new InkAnnotationElement(e);case n.AnnotationType.POLYGON:return new PolygonAnnotationElement(e);case n.AnnotationType.HIGHLIGHT:return new HighlightAnnotationElement(e);case n.AnnotationType.UNDERLINE:return new UnderlineAnnotationElement(e);case n.AnnotationType.SQUIGGLY:return new SquigglyAnnotationElement(e);case n.AnnotationType.STRIKEOUT:return new StrikeOutAnnotationElement(e);case n.AnnotationType.STAMP:return new StampAnnotationElement(e);case n.AnnotationType.FILEATTACHMENT:return new FileAttachmentAnnotationElement(e);default:return new AnnotationElement(e)}}}class AnnotationElement{constructor(e){let{isRenderable:t=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.isRenderable=t;this.data=e.data;this.layer=e.layer;this.page=e.page;this.viewport=e.viewport;this.linkService=e.linkService;this.downloadManager=e.downloadManager;this.imageResourcesPath=e.imageResourcesPath;this.renderForms=e.renderForms;this.svgFactory=e.svgFactory;this.annotationStorage=e.annotationStorage;this.enableScripting=e.enableScripting;this.hasJSActions=e.hasJSActions;this._fieldObjects=e.fieldObjects;t&&(this.container=this._createContainer(i));n&&(this.quadrilaterals=this._createQuadrilaterals(i))}_createContainer(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{data:t,page:i,viewport:s}=this,r=document.createElement("section");r.setAttribute("data-annotation-id",t.id);const{pageWidth:a,pageHeight:o,pageX:l,pageY:c}=s.rawDims,{width:d,height:h}=getRectDims(t.rect),u=n.Util.normalizeRect([t.rect[0],i.view[3]-t.rect[1]+i.view[1],t.rect[2],i.view[3]-t.rect[3]+i.view[1]]);if(!e&&t.borderStyle.width>0){r.style.borderWidth=`${t.borderStyle.width}px`;const e=t.borderStyle.horizontalCornerRadius,i=t.borderStyle.verticalCornerRadius;if(e>0||i>0){const t=`calc(${e}px * var(--scale-factor)) / calc(${i}px * var(--scale-factor))`;r.style.borderRadius=t}else if(this instanceof RadioButtonWidgetAnnotationElement){const e=`calc(${d}px * var(--scale-factor)) / calc(${h}px * var(--scale-factor))`;r.style.borderRadius=e}switch(t.borderStyle.style){case n.AnnotationBorderStyleType.SOLID:r.style.borderStyle="solid";break;case n.AnnotationBorderStyleType.DASHED:r.style.borderStyle="dashed";break;case n.AnnotationBorderStyleType.BEVELED:(0,n.warn)("Unimplemented border style: beveled");break;case n.AnnotationBorderStyleType.INSET:(0,n.warn)("Unimplemented border style: inset");break;case n.AnnotationBorderStyleType.UNDERLINE:r.style.borderBottomStyle="solid"}const s=t.borderColor||null;s?r.style.borderColor=n.Util.makeHexColor(0|s[0],0|s[1],0|s[2]):r.style.borderWidth=0}r.style.left=100*(u[0]-l)/a+"%";r.style.top=100*(u[1]-c)/o+"%";const{rotation:p}=t;if(t.hasOwnCanvas||0===p){r.style.width=100*d/a+"%";r.style.height=100*h/o+"%"}else this.setRotation(p,r);return r}setRotation(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;const{pageWidth:i,pageHeight:n}=this.viewport.rawDims,{width:s,height:r}=getRectDims(this.data.rect);let a,o;if(e%180==0){a=100*s/i;o=100*r/n}else{a=100*r/i;o=100*s/n}t.style.width=`${a}%`;t.style.height=`${o}%`;t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const setColor=(e,t,i)=>{const n=i.detail[e];i.target.style[t]=a.ColorConverters[`${n[0]}_HTML`](n.slice(1))};return(0,n.shadow)(this,"_commonActions",{display:e=>{const t=e.detail.display%2==1;this.container.style.visibility=t?"hidden":"visible";this.annotationStorage.setValue(this.data.id,this.data.fieldName,{hidden:t,print:0===e.detail.display||3===e.detail.display})},print:e=>{this.annotationStorage.setValue(this.data.id,this.data.fieldName,{print:e.detail.print})},hidden:e=>{this.container.style.visibility=e.detail.hidden?"hidden":"visible";this.annotationStorage.setValue(this.data.id,this.data.fieldName,{hidden:e.detail.hidden})},focus:e=>{setTimeout((()=>e.target.focus({preventScroll:!1})),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.detail.readonly?e.target.setAttribute("readonly",""):e.target.removeAttribute("readonly")},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:e=>{setColor("bgColor","backgroundColor",e)},fillColor:e=>{setColor("fillColor","backgroundColor",e)},fgColor:e=>{setColor("fgColor","color",e)},textColor:e=>{setColor("textColor","color",e)},borderColor:e=>{setColor("borderColor","borderColor",e)},strokeColor:e=>{setColor("strokeColor","borderColor",e)},rotation:e=>{const t=e.detail.rotation;this.setRotation(t);this.annotationStorage.setValue(this.data.id,this.data.fieldName,{rotation:t})}})}_dispatchEventFromSandbox(e,t){const i=this._commonActions;for(const n of Object.keys(t.detail)){const s=e[n]||i[n];null==s||s(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const i=this._commonActions;for(const[n,s]of Object.entries(t)){const r=i[n];if(r){r({detail:{[n]:s},target:e});delete t[n]}}}_createQuadrilaterals(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.data.quadPoints)return null;const t=[],i=this.data.rect;for(const i of this.data.quadPoints){this.data.rect=[i[2].x,i[2].y,i[1].x,i[1].y];t.push(this._createContainer(e))}this.data.rect=i;return t}_createPopup(e,t){let i=this.container;if(this.quadrilaterals){e=e||this.quadrilaterals;i=this.quadrilaterals[0]}if(!e){(e=document.createElement("div")).className="popupTriggerArea";i.append(e)}const n=new PopupElement({container:i,trigger:e,color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,hideWrapper:!0}).render();n.style.left="100%";i.append(n)}_renderQuadrilaterals(e){for(const t of this.quadrilaterals)t.className=e;return this.quadrilaterals}render(){(0,n.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[];if(this._fieldObjects){const s=this._fieldObjects[e];if(s)for(const{page:e,id:r,exportValues:a}of s){if(-1===e)continue;if(r===t)continue;const s="string"==typeof a?a:null,o=document.querySelector(`[data-element-id="${r}"]`);!o||c.has(o)?i.push({id:r,exportValue:s,domElement:o}):(0,n.warn)(`_getElementsByName - element not allowed: ${r}`)}return i}for(const n of document.getElementsByName(e)){const{exportValue:e}=n,s=n.getAttribute("data-element-id");s!==t&&(c.has(n)&&i.push({id:s,exportValue:e,domElement:n}))}return i}}var d=new WeakSet,h=new WeakSet;class LinkAnnotationElement extends AnnotationElement{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(e,{isRenderable:!0,ignoreBorder:!(null==t||!t.ignoreBorder),createQuadrilaterals:!0});_classPrivateMethodInitSpec(this,h);_classPrivateMethodInitSpec(this,d);this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,i=document.createElement("a");i.setAttribute("data-element-id",e.id);let n=!1;if(e.url){t.addLinkAttributes(i,e.url,e.newWindow);n=!0}else if(e.action){this._bindNamedAction(i,e.action);n=!0}else if(e.attachment){this._bindAttachment(i,e.attachment);n=!0}else if(e.setOCGState){_classPrivateMethodGet(this,h,_bindSetOCGState2).call(this,i,e.setOCGState);n=!0}else if(e.dest){this._bindLink(i,e.dest);n=!0}else{if(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions){this._bindJSAction(i,e);n=!0}if(e.resetForm){this._bindResetFormAction(i,e.resetForm);n=!0}else if(this.isTooltipOnly&&!n){this._bindLink(i,"");n=!0}}if(this.quadrilaterals)return this._renderQuadrilaterals("linkAnnotation").map(((e,t)=>{const n=0===t?i:i.cloneNode();e.append(n);return e}));this.container.className="linkAnnotation";n&&this.container.append(i);return this.container}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t);e.onclick=()=>{t&&this.linkService.goToDestination(t);return!1};(t||""===t)&&_classPrivateMethodGet(this,d,_setInternalLink2).call(this)}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl("");e.onclick=()=>{this.linkService.executeNamedAction(t);return!1};_classPrivateMethodGet(this,d,_setInternalLink2).call(this)}_bindAttachment(e,t){e.href=this.linkService.getAnchorUrl("");e.onclick=()=>{var e;null===(e=this.downloadManager)||void 0===e||e.openOrDownloadData(this.container,t.content,t.filename);return!1};_classPrivateMethodGet(this,d,_setInternalLink2).call(this)}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(t.actions)){const s=i.get(n);s&&(e[s]=()=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:n}});return!1})}e.onclick||(e.onclick=()=>!1);_classPrivateMethodGet(this,d,_setInternalLink2).call(this)}_bindResetFormAction(e,t){const i=e.onclick;i||(e.href=this.linkService.getAnchorUrl(""));_classPrivateMethodGet(this,d,_setInternalLink2).call(this);if(this._fieldObjects)e.onclick=()=>{null==i||i();const{fields:e,refs:s,include:r}=t,a=[];if(0!==e.length||0!==s.length){const t=new Set(s);for(const i of e){const e=this._fieldObjects[i]||[];for(const{id:i}of e)t.add(i)}for(const e of Object.values(this._fieldObjects))for(const i of e)t.has(i.id)===r&&a.push(i)}else for(const e of Object.values(this._fieldObjects))a.push(...e);const o=this.annotationStorage,l=[];for(const e of a){const{id:t}=e;l.push(t);switch(e.type){case"text":{const i=e.defaultValue||"";o.setValue(t,this.data.fieldName,{value:i});break}case"checkbox":case"radiobutton":{const i=e.defaultValue===e.exportValues;o.setValue(t,this.data.fieldName,{value:i});break}case"combobox":case"listbox":{const i=e.defaultValue||"";o.setValue(t,this.data.fieldName,{value:i});break}default:continue}const i=document.querySelector(`[data-element-id="${t}"]`);i&&(c.has(i)?i.dispatchEvent(new Event("resetform")):(0,n.warn)(`_bindResetFormAction - element not allowed: ${t}`))}if(this.enableScripting){var d;null===(d=this.linkService.eventBus)||void 0===d||d.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}})}return!1};else{(0,n.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.');i||(e.onclick=()=>!1)}}}function _setInternalLink2(){this.container.setAttribute("data-internal-link","")}function _bindSetOCGState2(e,t){e.href=this.linkService.getAnchorUrl("");e.onclick=()=>{this.linkService.executeSetOCGState(t);return!1};_classPrivateMethodGet(this,d,_setInternalLink2).call(this)}class TextAnnotationElement extends AnnotationElement{constructor(e){var t,i,n;super(e,{isRenderable:!!(e.data.hasPopup||null!==(t=e.data.titleObj)&&void 0!==t&&t.str||null!==(i=e.data.contentsObj)&&void 0!==i&&i.str||null!==(n=e.data.richText)&&void 0!==n&&n.str)})}render(){this.container.className="textAnnotation";const e=document.createElement("img");e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg";e.alt="[{{type}} Annotation]";e.dataset.l10nId="text_annotation_type";e.dataset.l10nArgs=JSON.stringify({type:this.data.name});this.data.hasPopup||this._createPopup(e,this.data);this.container.append(e);return this.container}}class WidgetAnnotationElement extends AnnotationElement{render(){this.data.alternativeText&&(this.container.title=this.data.alternativeText);return this.container}_getKeyModifier(e){const{isWin:t,isMac:i}=n.FeatureTest.platform;return t&&e.ctrlKey||i&&e.metaKey}_setEventListener(e,t,i,n){t.includes("mouse")?e.addEventListener(t,(e=>{var t;null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:n(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})})):e.addEventListener(t,(e=>{var t;null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:n(e)}})}))}_setEventListeners(e,t,i){for(const[s,r]of t){var n;("Action"===r||null!==(n=this.data.actions)&&void 0!==n&&n[r])&&this._setEventListener(e,s,r,i)}}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":n.Util.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||9,r=e.style;let a;const roundToOneDecimal=e=>Math.round(10*e)/10;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(n.LINE_FACTOR*s))||1);a=Math.min(s,roundToOneDecimal(t/n.LINE_FACTOR))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(s,roundToOneDecimal(e/n.LINE_FACTOR))}r.fontSize=`calc(${a}px * var(--scale-factor))`;r.color=n.Util.makeHexColor(i[0],i[1],i[2]);null!==this.data.textAlignment&&(r.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required");e.setAttribute("aria-required",t)}}class TextWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:e.renderForms||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,i,n){const s=this.annotationStorage;for(const r of this._getElementsByName(e.name,e.id)){r.domElement&&(r.domElement[t]=i);s.setValue(r.id,this.data.fieldName,{[n]:i})}}render(){const e=this.annotationStorage,t=this.data.id;this.container.className="textWidgetAnnotation";let i=null;if(this.renderForms){const s=e.getValue(t,this.data.fieldName,{value:this.data.fieldValue});let r=s.formattedValue||s.value||"";const a=e.getValue(t,this.data.fieldName,{charLimit:this.data.maxLen}).charLimit;a&&r.length>a&&(r=r.slice(0,a));const o={userValue:r,formattedValue:null,lastCommittedValue:null,commitKey:1};if(this.data.multiLine){i=document.createElement("textarea");i.textContent=r;this.data.doNotScroll&&(i.style.overflowY="hidden")}else{i=document.createElement("input");i.type="text";i.setAttribute("value",r);this.data.doNotScroll&&(i.style.overflowX="hidden")}c.add(i);i.setAttribute("data-element-id",t);i.disabled=this.data.readOnly;i.name=this.data.fieldName;i.tabIndex=l;this._setRequired(i,this.data.required);a&&(i.maxLength=a);i.addEventListener("input",(n=>{e.setValue(t,this.data.fieldName,{value:n.target.value});this.setPropertyOnSiblings(i,"value",n.target.value,"value")}));i.addEventListener("resetform",(e=>{const t=this.data.defaultFieldValue??"";i.value=o.userValue=t;o.formattedValue=null}));let blurListener=e=>{const{formattedValue:t}=o;null!=t&&(e.target.value=t);e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var n;i.addEventListener("focus",(e=>{const{target:t}=e;o.userValue&&(t.value=o.userValue);o.lastCommittedValue=t.value;o.commitKey=1}));const s=this.data.fieldName;i.addEventListener("updatefromsandbox",(i=>{const n={value(i){o.userValue=i.detail.value??"";e.setValue(t,s,{value:o.userValue.toString()});i.target.value=o.userValue},formattedValue(i){const{formattedValue:n}=i.detail;o.formattedValue=n;null!=n&&i.target!==document.activeElement&&(i.target.value=n);e.setValue(t,s,{formattedValue:n})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:i=>{var n;const{charLimit:s}=i.detail,{target:r}=i;if(0===s){r.removeAttribute("maxLength");return}r.setAttribute("maxLength",s);let a=o.userValue;if(a&&!(a.length<=s)){a=a.slice(0,s);r.value=o.userValue=a;e.setValue(t,this.data.fieldName,{value:a});null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}})}}};this._dispatchEventFromSandbox(n,i)}));i.addEventListener("keydown",(e=>{var i;o.commitKey=1;let n=-1;"Escape"===e.key?n=0:"Enter"!==e.key||this.data.multiLine?"Tab"===e.key&&(o.commitKey=3):n=2;if(-1===n)return;const{value:s}=e.target;if(o.lastCommittedValue!==s){o.lastCommittedValue=s;o.userValue=s;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:s,willCommit:!0,commitKey:n,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}})}}));const r=blurListener;blurListener=null;i.addEventListener("blur",(e=>{if(!e.relatedTarget)return;const{value:i}=e.target;o.userValue=i;if(o.lastCommittedValue!==i){var n;null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,willCommit:!0,commitKey:o.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}})}r(e)}));null!==(n=this.data.actions)&&void 0!==n&&n.Keystroke&&i.addEventListener("beforeinput",(e=>{var i;o.lastCommittedValue=null;const{data:n,target:s}=e,{value:r,selectionStart:a,selectionEnd:l}=s;let c=a,d=l;switch(e.inputType){case"deleteWordBackward":{const e=r.substring(0,a).match(/\w*[^\w]*$/);e&&(c-=e[0].length);break}case"deleteWordForward":{const e=r.substring(a).match(/^[^\w]*\w*/);e&&(d+=e[0].length);break}case"deleteContentBackward":a===l&&(c-=1);break;case"deleteContentForward":a===l&&(d+=1)}e.preventDefault();null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:r,change:n||"",willCommit:!1,selStart:c,selEnd:d}})}));this._setEventListeners(i,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.value))}blurListener&&i.addEventListener("blur",blurListener);if(this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/a;i.classList.add("comb");i.style.letterSpacing=`calc(${e}px * var(--scale-factor) - 1ch)`}}else{i=document.createElement("div");i.textContent=this.data.fieldValue;i.style.verticalAlign="middle";i.style.display="table-cell"}this._setTextStyle(i);this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,i=t.id;let n=e.getValue(i,`${this.data.fieldName}/${this.data.exportValue}`,{value:t.exportValue===t.fieldValue}).value;if("string"==typeof n){n="Off"!==n;e.setValue(i,this.data.fieldName,{value:n})}this.container.className="buttonWidgetAnnotation checkBox";const s=document.createElement("input");c.add(s);s.setAttribute("data-element-id",i);s.disabled=t.readOnly;this._setRequired(s,this.data.required);s.type="checkbox";s.name=t.fieldName;n&&s.setAttribute("checked",!0);s.setAttribute("exportValue",t.exportValue);s.tabIndex=l;s.addEventListener("change",(n=>{const{name:s,checked:r}=n.target;for(const n of this._getElementsByName(s,i)){const i=r&&n.exportValue===t.exportValue;n.domElement&&(n.domElement.checked=i);e.setValue(n.id,this.data.fieldName,{value:i,emitMessage:!1})}e.setValue(i,this.data.fieldName,{value:r,exportValue:r?t.exportValue:null})}));s.addEventListener("resetform",(e=>{const i=t.defaultFieldValue||"Off";e.target.checked=i===t.exportValue}));if(this.enableScripting&&this.hasJSActions){const t=this.data.fieldName;s.addEventListener("updatefromsandbox",(n=>{const s={value(n){n.target.checked="Off"!==n.detail.value;e.setValue(i,t,{value:n.target.checked})}};this._dispatchEventFromSandbox(s,n)}));this._setEventListeners(s,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))}this._setBackgroundColor(s);this._setDefaultPropertiesFromJS(s);this.container.append(s);return this.container}}class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const e=this.annotationStorage,t=this.data,i=t.id;let n=e.getValue(i,this.data.fieldName,{value:t.fieldValue===t.buttonValue},this.data.buttonValue).value;if("string"==typeof n){n=n!==t.buttonValue;e.setValue(i,this.data.fieldName,{value:n},this.data.buttonValue)}const s=document.createElement("input");c.add(s);s.setAttribute("data-element-id",i);s.disabled=t.readOnly;this._setRequired(s,this.data.required);s.type="radio";s.name=t.fieldName;n&&s.setAttribute("checked",!0);s.tabIndex=l;s.addEventListener("change",(t=>{const{name:n,checked:s}=t.target;for(const t of this._getElementsByName(n,i))e.setValue(t.id,this.data.fieldName,{value:!1,emitMessage:!1});e.setValue(i,this.data.fieldName,{value:s,radioValue:this.data.buttonValue})}));s.addEventListener("resetform",(e=>{const i=t.defaultFieldValue;e.target.checked=null!=i&&i===t.buttonValue}));if(this.enableScripting&&this.hasJSActions){const n=t.buttonValue;s.addEventListener("updatefromsandbox",(t=>{const s=this.data.fieldName,r={value:t=>{const r=n===t.detail.value;for(const n of this._getElementsByName(t.target.name)){const t=r&&n.id===i;n.domElement&&(n.domElement.checked=t);e.setValue(n.id,s,{value:t})}}};this._dispatchEventFromSandbox(r,t)}));this._setEventListeners(s,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))}this._setBackgroundColor(s);this._setDefaultPropertiesFromJS(s);this.container.append(s);return this.container}}class PushButtonWidgetAnnotationElement extends LinkAnnotationElement{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.className="buttonWidgetAnnotation pushButton";this.data.alternativeText&&(e.title=this.data.alternativeText);const t=e.lastChild;if(this.enableScripting&&this.hasJSActions&&t){this._setDefaultPropertiesFromJS(t);t.addEventListener("updatefromsandbox",(e=>{this._dispatchEventFromSandbox({},e)}))}return e}}class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const e=this.annotationStorage,t=this.data.id,i=e.getValue(t,this.data.fieldName,{value:this.data.fieldValue}),n=document.createElement("select");c.add(n);n.setAttribute("data-element-id",t);n.disabled=this.data.readOnly;this._setRequired(n,this.data.required);n.name=this.data.fieldName;n.tabIndex=l;let s=this.data.combo&&this.data.options.length>0;if(!this.data.combo){n.size=this.data.options.length;this.data.multiSelect&&(n.multiple=!0)}n.addEventListener("resetform",(e=>{const t=this.data.defaultFieldValue;for(const e of n.options)e.selected=e.value===t}));for(const e of this.data.options){const t=document.createElement("option");t.textContent=e.displayValue;t.value=e.exportValue;if(i.value.includes(e.exportValue)){t.setAttribute("selected",!0);s=!1}n.append(t)}let r=null;if(s){const e=document.createElement("option");e.value=" ";e.setAttribute("hidden",!0);e.setAttribute("selected",!0);n.prepend(e);r=()=>{e.remove();n.removeEventListener("input",r);r=null};n.addEventListener("input",r)}const getValue=e=>{const t=e?"value":"textContent",{options:i,multiple:s}=n;return s?Array.prototype.filter.call(i,(e=>e.selected)).map((e=>e[t])):-1===i.selectedIndex?null:i[i.selectedIndex][t]};let a=getValue(!1);const getItems=e=>{const t=e.target.options;return Array.prototype.map.call(t,(e=>({displayValue:e.textContent,exportValue:e.value})))};if(this.enableScripting&&this.hasJSActions){n.addEventListener("updatefromsandbox",(i=>{const s=this.data.fieldName,o={value(i){var o;null===(o=r)||void 0===o||o();const l=i.detail.value,c=new Set(Array.isArray(l)?l:[l]);for(const e of n.options)e.selected=c.has(e.value);e.setValue(t,s,{value:getValue(!0)});a=getValue(!1)},multipleSelection(e){n.multiple=!0},remove(i){const r=n.options,o=i.detail.remove;r[o].selected=!1;n.remove(o);if(r.length>0){-1===Array.prototype.findIndex.call(r,(e=>e.selected))&&(r[0].selected=!0)}e.setValue(t,s,{value:getValue(!0),items:getItems(i)});a=getValue(!1)},clear(i){for(;0!==n.length;)n.remove(0);e.setValue(t,s,{value:null,items:[]});a=getValue(!1)},insert(i){const{index:r,displayValue:o,exportValue:l}=i.detail.insert,c=n.children[r],d=document.createElement("option");d.textContent=o;d.value=l;c?c.before(d):n.append(d);e.setValue(t,s,{value:getValue(!0),items:getItems(i)});a=getValue(!1)},items(i){const{items:r}=i.detail;for(;0!==n.length;)n.remove(0);for(const e of r){const{displayValue:t,exportValue:i}=e,s=document.createElement("option");s.textContent=t;s.value=i;n.append(s)}n.options.length>0&&(n.options[0].selected=!0);e.setValue(t,s,{value:getValue(!0),items:getItems(i)});a=getValue(!1)},indices(i){const n=new Set(i.detail.indices);for(const e of i.target.options)e.selected=n.has(e.index);e.setValue(t,s,{value:getValue(!0)});a=getValue(!1)},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(o,i)}));n.addEventListener("input",(i=>{var n;const s=getValue(!0);e.setValue(t,{value:s});i.preventDefault();null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:a,changeEx:s,willCommit:!1,commitKey:1,keyDown:!1}})}));this._setEventListeners(n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(e=>e.target.value))}else{const i=this.data.fieldName;n.addEventListener("input",(function(n){e.setValue(t,i,{value:getValue(!0),radioValue:getValue(!0)})}))}this.data.combo&&this._setTextStyle(n);this._setBackgroundColor(n);this._setDefaultPropertiesFromJS(n);this.container.append(n);return this.container}}class PopupAnnotationElement extends AnnotationElement{static IGNORE_TYPES=new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]);constructor(e){var t,i,n;const{data:s}=e;super(e,{isRenderable:!PopupAnnotationElement.IGNORE_TYPES.has(s.parentType)&&!!(null!==(t=s.titleObj)&&void 0!==t&&t.str||null!==(i=s.contentsObj)&&void 0!==i&&i.str||null!==(n=s.richText)&&void 0!==n&&n.str)})}render(){this.container.className="popupAnnotation";const e=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(0===e.length)return this.container;const t=new PopupElement({container:this.container,trigger:Array.from(e),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),i=this.page,s=n.Util.normalizeRect([this.data.parentRect[0],i.view[3]-this.data.parentRect[1]+i.view[1],this.data.parentRect[2],i.view[3]-this.data.parentRect[3]+i.view[1]]),r=s[0]+this.data.parentRect[2]-this.data.parentRect[0],a=s[1],{pageWidth:o,pageHeight:l,pageX:c,pageY:d}=this.viewport.rawDims;this.container.style.left=100*(r-c)/o+"%";this.container.style.top=100*(a-d)/l+"%";this.container.append(t.render());return this.container}}class PopupElement{constructor(e){this.container=e.container;this.trigger=e.trigger;this.color=e.color;this.titleObj=e.titleObj;this.modificationDate=e.modificationDate;this.contentsObj=e.contentsObj;this.richText=e.richText;this.hideWrapper=e.hideWrapper||!1;this.pinned=!1}render(){var e,t;const i=document.createElement("div");i.className="popupWrapper";this.hideElement=this.hideWrapper?i:this.container;this.hideElement.hidden=!0;const r=document.createElement("div");r.className="popup";const a=this.color;if(a){const e=.7*(255-a[0])+a[0],t=.7*(255-a[1])+a[1],i=.7*(255-a[2])+a[2];r.style.backgroundColor=n.Util.makeHexColor(0|e,0|t,0|i)}const l=document.createElement("h1");l.dir=this.titleObj.dir;l.textContent=this.titleObj.str;r.append(l);const c=s.PDFDateString.toDateObject(this.modificationDate);if(c){const e=document.createElement("span");e.className="popupDate";e.textContent="{{date}}, {{time}}";e.dataset.l10nId="annotation_date_string";e.dataset.l10nArgs=JSON.stringify({date:c.toLocaleDateString(),time:c.toLocaleTimeString()});r.append(e)}if(null===(e=this.richText)||void 0===e||!e.str||null!==(t=this.contentsObj)&&void 0!==t&&t.str&&this.contentsObj.str!==this.richText.str){const e=this._formatContents(this.contentsObj);r.append(e)}else{o.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:r});r.lastChild.className="richText popupContent"}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const e of this.trigger){null==e||e.addEventListener("click",this._toggle.bind(this));null==e||e.addEventListener("mouseover",this._show.bind(this,!1));null==e||e.addEventListener("mouseout",this._hide.bind(this,!1))}r.addEventListener("click",this._hide.bind(this,!0));i.append(r);return i}_formatContents(e){let{str:t,dir:i}=e;const n=document.createElement("p");n.className="popupContent";n.dir=i;const s=t.split(/(?:\r\n?|\n)/);for(let e=0,t=s.length;e<t;++e){const i=s[e];n.append(document.createTextNode(i));e<t-1&&n.append(document.createElement("br"))}return n}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this.pinned=!0);if(this.hideElement.hidden){this.hideElement.hidden=!1;this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3}}_hide(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.pinned=!1);if(!this.hideElement.hidden&&!this.pinned){this.hideElement.hidden=!0;this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3}}}class FreeTextAnnotationElement extends AnnotationElement{constructor(e){var t,i,n;super(e,{isRenderable:!!(e.data.hasPopup||null!==(t=e.data.titleObj)&&void 0!==t&&t.str||null!==(i=e.data.contentsObj)&&void 0!==i&&i.str||null!==(n=e.data.richText)&&void 0!==n&&n.str),ignoreBorder:!0});this.textContent=e.data.textContent}render(){this.container.className="freeTextAnnotation";if(this.textContent){const e=document.createElement("div");e.className="annotationTextContent";e.setAttribute("role","comment");for(const t of this.textContent){const i=document.createElement("span");i.textContent=t;e.append(i)}this.container.append(e)}this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class LineAnnotationElement extends AnnotationElement{constructor(e){var t,i,n;super(e,{isRenderable:!!(e.data.hasPopup||null!==(t=e.data.titleObj)&&void 0!==t&&t.str||null!==(i=e.data.contentsObj)&&void 0!==i&&i.str||null!==(n=e.data.richText)&&void 0!==n&&n.str),ignoreBorder:!0})}render(){this.container.className="lineAnnotation";const e=this.data,{width:t,height:i}=getRectDims(e.rect),n=this.svgFactory.create(t,i,!0),s=this.svgFactory.createElement("svg:line");s.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]);s.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]);s.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]);s.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]);s.setAttribute("stroke-width",e.borderStyle.width||1);s.setAttribute("stroke","transparent");s.setAttribute("fill","transparent");n.append(s);this.container.append(n);this._createPopup(s,e);return this.container}}class SquareAnnotationElement extends AnnotationElement{constructor(e){var t,i,n;super(e,{isRenderable:!!(e.data.hasPopup||null!==(t=e.data.titleObj)&&void 0!==t&&t.str||null!==(i=e.data.contentsObj)&&void 0!==i&&i.str||null!==(n=e.data.richText)&&void 0!==n&&n.str),ignoreBorder:!0})}render(){this.container.className="squareAnnotation";const e=this.data,{width:t,height:i}=getRectDims(e.rect),n=this.svgFactory.create(t,i,!0),s=e.borderStyle.width,r=this.svgFactory.createElement("svg:rect");r.setAttribute("x",s/2);r.setAttribute("y",s/2);r.setAttribute("width",t-s);r.setAttribute("height",i-s);r.setAttribute("stroke-width",s||1);r.setAttribute("stroke","transparent");r.setAttribute("fill","transparent");n.append(r);this.container.append(n);this._createPopup(r,e);return this.container}}class CircleAnnotationElement extends AnnotationElement{constructor(e){var t,i,n;super(e,{isRenderable:!!(e.data.hasPopup||null!==(t=e.data.titleObj)&&void 0!==t&&t.str||null!==(i=e.data.contentsObj)&&void 0!==i&&i.str||null!==(n=e.data.richText)&&void 0!==n&&n.str),ignoreBorder:!0})}render(){this.container.className="circleAnnotation";const e=this.data,{width:t,height:i}=getRectDims(e.rect),n=this.svgFactory.create(t,i,!0),s=e.borderStyle.width,r=this.svgFactory.createElement("svg:ellipse");r.setAttribute("cx",t/2);r.setAttribute("cy",i/2);r.setAttribute("rx",t/2-s/2);r.setAttribute("ry",i/2-s/2);r.setAttribute("stroke-width",s||1);r.setAttribute("stroke","transparent");r.setAttribute("fill","transparent");n.append(r);this.container.append(n);this._createPopup(r,e);return this.container}}class PolylineAnnotationElement extends AnnotationElement{constructor(e){var t,i,n;super(e,{isRenderable:!!(e.data.hasPopup||null!==(t=e.data.titleObj)&&void 0!==t&&t.str||null!==(i=e.data.contentsObj)&&void 0!==i&&i.str||null!==(n=e.data.richText)&&void 0!==n&&n.str),ignoreBorder:!0});this.containerClassName="polylineAnnotation";this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const e=this.data,{width:t,height:i}=getRectDims(e.rect),n=this.svgFactory.create(t,i,!0);let s=[];for(const t of e.vertices){const i=t.x-e.rect[0],n=e.rect[3]-t.y;s.push(i+","+n)}s=s.join(" ");const r=this.svgFactory.createElement(this.svgElementName);r.setAttribute("points",s);r.setAttribute("stroke-width",e.borderStyle.width||1);r.setAttribute("stroke","transparent");r.setAttribute("fill","transparent");n.append(r);this.container.append(n);this._createPopup(r,e);return this.container}}class PolygonAnnotationElement extends PolylineAnnotationElement{constructor(e){super(e);this.containerClassName="polygonAnnotation";this.svgElementName="svg:polygon"}}class CaretAnnotationElement extends AnnotationElement{constructor(e){var t,i,n;super(e,{isRenderable:!!(e.data.hasPopup||null!==(t=e.data.titleObj)&&void 0!==t&&t.str||null!==(i=e.data.contentsObj)&&void 0!==i&&i.str||null!==(n=e.data.richText)&&void 0!==n&&n.str),ignoreBorder:!0})}render(){this.container.className="caretAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class InkAnnotationElement extends AnnotationElement{constructor(e){var t,i,n;super(e,{isRenderable:!!(e.data.hasPopup||null!==(t=e.data.titleObj)&&void 0!==t&&t.str||null!==(i=e.data.contentsObj)&&void 0!==i&&i.str||null!==(n=e.data.richText)&&void 0!==n&&n.str),ignoreBorder:!0});this.containerClassName="inkAnnotation";this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const e=this.data,{width:t,height:i}=getRectDims(e.rect),n=this.svgFactory.create(t,i,!0);for(const t of e.inkLists){let i=[];for(const n of t){const t=n.x-e.rect[0],s=e.rect[3]-n.y;i.push(`${t},${s}`)}i=i.join(" ");const s=this.svgFactory.createElement(this.svgElementName);s.setAttribute("points",i);s.setAttribute("stroke-width",e.borderStyle.width||1);s.setAttribute("stroke","transparent");s.setAttribute("fill","transparent");this._createPopup(s,e);n.append(s)}this.container.append(n);return this.container}}class HighlightAnnotationElement extends AnnotationElement{constructor(e){var t,i,n;super(e,{isRenderable:!!(e.data.hasPopup||null!==(t=e.data.titleObj)&&void 0!==t&&t.str||null!==(i=e.data.contentsObj)&&void 0!==i&&i.str||null!==(n=e.data.richText)&&void 0!==n&&n.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("highlightAnnotation");this.container.className="highlightAnnotation";return this.container}}class UnderlineAnnotationElement extends AnnotationElement{constructor(e){var t,i,n;super(e,{isRenderable:!!(e.data.hasPopup||null!==(t=e.data.titleObj)&&void 0!==t&&t.str||null!==(i=e.data.contentsObj)&&void 0!==i&&i.str||null!==(n=e.data.richText)&&void 0!==n&&n.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("underlineAnnotation");this.container.className="underlineAnnotation";return this.container}}class SquigglyAnnotationElement extends AnnotationElement{constructor(e){var t,i,n;super(e,{isRenderable:!!(e.data.hasPopup||null!==(t=e.data.titleObj)&&void 0!==t&&t.str||null!==(i=e.data.contentsObj)&&void 0!==i&&i.str||null!==(n=e.data.richText)&&void 0!==n&&n.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("squigglyAnnotation");this.container.className="squigglyAnnotation";return this.container}}class StrikeOutAnnotationElement extends AnnotationElement{constructor(e){var t,i,n;super(e,{isRenderable:!!(e.data.hasPopup||null!==(t=e.data.titleObj)&&void 0!==t&&t.str||null!==(i=e.data.contentsObj)&&void 0!==i&&i.str||null!==(n=e.data.richText)&&void 0!==n&&n.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("strikeoutAnnotation");this.container.className="strikeoutAnnotation";return this.container}}class StampAnnotationElement extends AnnotationElement{constructor(e){var t,i,n;super(e,{isRenderable:!!(e.data.hasPopup||null!==(t=e.data.titleObj)&&void 0!==t&&t.str||null!==(i=e.data.contentsObj)&&void 0!==i&&i.str||null!==(n=e.data.richText)&&void 0!==n&&n.str),ignoreBorder:!0})}render(){this.container.className="stampAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class FileAttachmentAnnotationElement extends AnnotationElement{constructor(e){var t;super(e,{isRenderable:!0});const{filename:i,content:n}=this.data.file;this.filename=(0,s.getFilenameFromUrl)(i,!0);this.content=n;null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("fileattachmentannotation",{source:this,filename:i,content:n})}render(){var e,t;this.container.className="fileAttachmentAnnotation";let i;if(this.data.hasAppearance)i=document.createElement("div");else{i=document.createElement("img");i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(this.data.name)?"paperclip":"pushpin"}.svg`}i.className="popupTriggerArea";i.addEventListener("dblclick",this._download.bind(this));!this.data.hasPopup&&(null!==(e=this.data.titleObj)&&void 0!==e&&e.str||null!==(t=this.data.contentsObj)&&void 0!==t&&t.str||this.data.richText)&&this._createPopup(i,this.data);this.container.append(i);return this.container}_download(){var e;null===(e=this.downloadManager)||void 0===e||e.openOrDownloadData(this.container,this.content,this.filename)}}class AnnotationLayer{static render(e){const{annotations:t,div:i,viewport:a,accessibilityManager:o}=e;(0,s.setLayerDimensions)(i,a);const l={data:null,layer:i,page:e.page,viewport:a,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new s.DOMSVGFactory,annotationStorage:e.annotationStorage||new r.AnnotationStorage,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects};let c=0;window.registerAcroformAnnotations&&window.registerAcroformAnnotations(t);for(const e of t){if(e.annotationType!==n.AnnotationType.POPUP){const{width:t,height:i}=getRectDims(e.rect);if(t<=0||i<=0)continue}l.data=e;const t=AnnotationElementFactory.create(l);if(!t.isRenderable)continue;const s=t.render();e.hidden&&(s.style.visibility="hidden");if(Array.isArray(s))for(const t of s){t.style.zIndex=c++;_classStaticPrivateMethodGet(AnnotationLayer,AnnotationLayer,_appendElement).call(AnnotationLayer,t,e.id,i,o)}else{s.style.zIndex=c++;t instanceof PopupAnnotationElement?i.prepend(s):_classStaticPrivateMethodGet(AnnotationLayer,AnnotationLayer,_appendElement).call(AnnotationLayer,s,e.id,i,o)}}_classStaticPrivateMethodGet(this,AnnotationLayer,_setAnnotationCanvasMap).call(this,i,e.annotationCanvasMap)}static update(e){const{annotationCanvasMap:t,div:i,viewport:n}=e;(0,s.setLayerDimensions)(i,{rotation:n.rotation});_classStaticPrivateMethodGet(this,AnnotationLayer,_setAnnotationCanvasMap).call(this,i,t);i.hidden=!1}}t.AnnotationLayer=AnnotationLayer;function _appendElement(e,t,i,n){const r=e.firstChild||e;r.id=`${s.AnnotationPrefix}${t}`;i.append(e);null==n||n.moveElementInDOM(i,e,r,!1)}function _setAnnotationCanvasMap(e,t){if(t){for(const[i,n]of t){const t=e.querySelector(`[data-annotation-id="${i}"]`);if(!t)continue;const{firstChild:s}=t;s?"CANVAS"===s.nodeName?s.replaceWith(n):s.before(n):t.append(n)}t.clear()}}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ColorConverters=void 0;function makeColorComp(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}t.ColorConverters=class ColorConverters{static CMYK_G(e){let[t,i,n,s]=e;return["G",1-Math.min(1,.3*t+.59*n+.11*i+s)]}static G_CMYK(e){let[t]=e;return["CMYK",0,0,0,1-t]}static G_RGB(e){let[t]=e;return["RGB",t,t,t]}static G_HTML(e){let[t]=e;const i=makeColorComp(t);return`#${i}${i}${i}`}static RGB_G(e){let[t,i,n]=e;return["G",.3*t+.59*i+.11*n]}static RGB_HTML(e){let[t,i,n]=e;return`#${makeColorComp(t)}${makeColorComp(i)}${makeColorComp(n)}`}static T_HTML(){return"#00000000"}static CMYK_RGB(e){let[t,i,n,s]=e;return["RGB",1-Math.min(1,t+s),1-Math.min(1,n+s),1-Math.min(1,i+s)]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK(e){let[t,i,n]=e;const s=1-t,r=1-i,a=1-n;return["CMYK",s,r,a,Math.min(s,r,a)]}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.XfaLayer=void 0;var n=i(151);t.XfaLayer=class XfaLayer{static setupStorage(e,t,i,n,s){let r=t,a=e;for(;a;){if(a.getAttribute("xfaname")){r=a.getAttribute("xfaname");break}a=a.parentElement}const o=n.getValue(t,r,{value:null});switch(i.name){case"textarea":null!==o.value&&(e.textContent=o.value);if("print"===s)break;e.addEventListener("input",(e=>{n.setValue(t,r,{value:e.target.value})}));break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){o.value===i.attributes.xfaOn?e.setAttribute("checked",!0):o.value===i.attributes.xfaOff&&e.removeAttribute("checked");if("print"===s)break;e.addEventListener("change",(e=>{n.setValue(t,r,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})}))}else{null!==o.value&&e.setAttribute("value",o.value);if("print"===s)break;e.addEventListener("input",(e=>{n.setValue(t,r,{value:e.target.value})}))}break;case"select":if(null!==o.value)for(const e of i.children)e.attributes.value===o.value&&(e.attributes.selected=!0);e.addEventListener("input",(e=>{const i=e.target.options,s=-1===i.selectedIndex?"":i[i.selectedIndex].value;n.setValue(t,r,{value:s})}))}}static setAttributes(e){let{html:t,element:i,storage:n=null,intent:s,linkService:r}=e;const{attributes:a}=i,o=t instanceof HTMLAnchorElement;"radio"===a.type&&(a.name=`${a.name}-${s}`);for(const[e,i]of Object.entries(a))if(null!=i)switch(e){case"class":i.length&&t.setAttribute(e,i.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",i);break;case"style":Object.assign(t.style,i);break;case"textContent":t.textContent=i;break;default:(!o||"href"!==e&&"newWindow"!==e)&&t.setAttribute(e,i)}o&&r.addLinkAttributes(t,a.href,a.newWindow);n&&a.dataId&&this.setupStorage(t,a.dataId,i,n)}static render(e){const t=e.annotationStorage,i=e.linkService,s=e.xfaHtml,r=e.intent||"display",a=document.createElement(s.name);s.attributes&&this.setAttributes({html:a,element:s,intent:r,linkService:i});const o=[[s,-1,a]],l=e.div;l.append(a);if(e.viewport){const t=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=t}"richText"!==r&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){var d;const[e,s,a]=o.at(-1);if(s+1===e.children.length){o.pop();continue}const l=e.children[++o.at(-1)[1]];if(null===l)continue;const{name:h}=l;if("#text"===h){const e=document.createTextNode(l.value);c.push(e);a.append(e);continue}let u;u=null!=l&&null!==(d=l.attributes)&&void 0!==d&&d.xmlns?document.createElementNS(l.attributes.xmlns,h):document.createElement(h);a.append(u);l.attributes&&this.setAttributes({html:u,element:l,storage:t,intent:r,linkService:i});if(l.children&&l.children.length>0)o.push([l,-1,u]);else if(l.value){const e=document.createTextNode(l.value);n.XfaText.shouldBuildText(h)&&c.push(e);u.append(e)}}for(const e of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))e.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t;e.div.hidden=!1}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SVGGraphics=void 0;var n=i(138),s=i(1);i(142);let r=class{constructor(){(0,s.unreachable)("Not implemented: SVGGraphics")}};t.SVGGraphics=r;{const a={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},o="http://www.w3.org/XML/1998/namespace",l="http://www.w3.org/1999/xlink",c=["butt","round","square"],d=["miter","round","bevel"],createObjectURL=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!=typeof Blob&&!i)return URL.createObjectURL(new Blob([e],{type:t}));const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s=`data:${t};base64,`;for(let t=0,i=e.length;t<i;t+=3){const r=255&e[t],a=255&e[t+1],o=255&e[t+2];s+=n[r>>2]+n[(3&r)<<4|a>>4]+n[t+1<i?(15&a)<<2|o>>6:64]+n[t+2<i?63&o:64]}return s},h=function(){const e=new Uint8Array([137,80,78,71,13,10,26,10]),t=12,i=new Int32Array(256);for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)t=1&t?3988292384^t>>1&2147483647:t>>1&2147483647;i[e]=t}function writePngChunk(e,t,n,s){let r=s;const a=t.length;n[r]=a>>24&255;n[r+1]=a>>16&255;n[r+2]=a>>8&255;n[r+3]=255&a;r+=4;n[r]=255&e.charCodeAt(0);n[r+1]=255&e.charCodeAt(1);n[r+2]=255&e.charCodeAt(2);n[r+3]=255&e.charCodeAt(3);r+=4;n.set(t,r);r+=t.length;const o=function crc32(e,t,n){let s=-1;for(let r=t;r<n;r++){const t=255&(s^e[r]);s=s>>>8^i[t]}return-1^s}(n,s+4,r);n[r]=o>>24&255;n[r+1]=o>>16&255;n[r+2]=o>>8&255;n[r+3]=255&o}function deflateSync(e){return function deflateSyncUncompressed(e){let t=e.length;const i=65535,n=Math.ceil(t/i),s=new Uint8Array(2+t+5*n+4);let r=0;s[r++]=120;s[r++]=156;let a=0;for(;t>i;){s[r++]=0;s[r++]=255;s[r++]=255;s[r++]=0;s[r++]=0;s.set(e.subarray(a,a+i),r);r+=i;a+=i;t-=i}s[r++]=1;s[r++]=255&t;s[r++]=t>>8&255;s[r++]=255&~t;s[r++]=(65535&~t)>>8&255;s.set(e.subarray(a),r);r+=e.length-a;const o=function adler32(e,t,i){let n=1,s=0;for(let r=t;r<i;++r){n=(n+(255&e[r]))%65521;s=(s+n)%65521}return s<<16|n}(e,0,e.length);s[r++]=o>>24&255;s[r++]=o>>16&255;s[r++]=o>>8&255;s[r++]=255&o;return s}(e)}return function convertImgDataToPng(i,n,r){return function encode(i,n,r,a){const o=i.width,l=i.height;let c,d,h;const u=i.data;switch(n){case s.ImageKind.GRAYSCALE_1BPP:d=0;c=1;h=o+7>>3;break;case s.ImageKind.RGB_24BPP:d=2;c=8;h=3*o;break;case s.ImageKind.RGBA_32BPP:d=6;c=8;h=4*o;break;default:throw new Error("invalid format")}const p=new Uint8Array((1+h)*l);let g=0,f=0;for(let e=0;e<l;++e){p[g++]=0;p.set(u.subarray(f,f+h),g);f+=h;g+=h}if(n===s.ImageKind.GRAYSCALE_1BPP&&a){g=0;for(let e=0;e<l;e++){g++;for(let e=0;e<h;e++)p[g++]^=255}}const m=new Uint8Array([o>>24&255,o>>16&255,o>>8&255,255&o,l>>24&255,l>>16&255,l>>8&255,255&l,c,d,0,0,0]),v=deflateSync(p),_=e.length+3*t+m.length+v.length,b=new Uint8Array(_);let w=0;b.set(e,w);w+=e.length;writePngChunk("IHDR",m,b,w);w+=t+m.length;writePngChunk("IDATA",v,b,w);w+=t+v.length;writePngChunk("IEND",new Uint8Array(0),b,w);return createObjectURL(b,"image/png",r)}(i,void 0===i.kind?s.ImageKind.GRAYSCALE_1BPP:i.kind,n,r)}}();class SVGExtraState{constructor(){this.fontSizeScale=1;this.fontWeight=a.fontWeight;this.fontSize=0;this.textMatrix=s.IDENTITY_MATRIX;this.fontMatrix=s.FONT_IDENTITY_MATRIX;this.leading=0;this.textRenderingMode=s.TextRenderingMode.FILL;this.textMatrixScale=1;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRise=0;this.fillColor=a.fillColor;this.strokeColor="#000000";this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.lineJoin="";this.lineCap="";this.miterLimit=0;this.dashArray=[];this.dashPhase=0;this.dependencies=[];this.activeClipUrl=null;this.clipGroup=null;this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(e,t){this.x=e;this.y=t}}function opListToTree(e){let t=[];const i=[];for(const n of e)if("save"!==n.fn)"restore"===n.fn?t=i.pop():t.push(n);else{t.push({fnId:92,fn:"group",items:[]});i.push(t);t=t.at(-1).items}return t}function pf(e){if(Number.isInteger(e))return e.toString();const t=e.toFixed(10);let i=t.length-1;if("0"!==t[i])return t;do{i--}while("0"===t[i]);return t.substring(0,"."===t[i]?i:i+1)}function pm(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":`scale(${pf(e[0])} ${pf(e[3])})`;if(e[0]===e[3]&&e[1]===-e[2]){return`rotate(${pf(180*Math.acos(e[0])/Math.PI)})`}}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return`translate(${pf(e[4])} ${pf(e[5])})`;return`matrix(${pf(e[0])} ${pf(e[1])} ${pf(e[2])} ${pf(e[3])} ${pf(e[4])} ${pf(e[5])})`}let u=0,p=0,g=0;t.SVGGraphics=r=class{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,n.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future.");this.svgFactory=new n.DOMSVGFactory;this.current=new SVGExtraState;this.transformMatrix=s.IDENTITY_MATRIX;this.transformStack=[];this.extraStack=[];this.commonObjs=e;this.objs=t;this.pendingClip=null;this.pendingEOFill=!1;this.embedFonts=!1;this.embeddedFonts=Object.create(null);this.cssStyle=null;this.forceDataSchema=!!i;this._operatorIdMapping=[];for(const e in s.OPS)this._operatorIdMapping[s.OPS[e]]=e}getObject(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}save(){this.transformStack.push(this.transformMatrix);const e=this.current;this.extraStack.push(e);this.current=e.clone()}restore(){this.transformMatrix=this.transformStack.pop();this.current=this.extraStack.pop();this.pendingClip=null;this.tgrp=null}group(e){this.save();this.executeOpTree(e);this.restore()}loadDependencies(e){const t=e.fnArray,i=e.argsArray;for(let e=0,n=t.length;e<n;e++)if(t[e]===s.OPS.dependency)for(const t of i[e]){const e=t.startsWith("g_")?this.commonObjs:this.objs,i=new Promise((i=>{e.get(t,i)}));this.current.dependencies.push(i)}return Promise.all(this.current.dependencies)}transform(e,t,i,n,r,a){const o=[e,t,i,n,r,a];this.transformMatrix=s.Util.transform(this.transformMatrix,o);this.tgrp=null}getSVG(e,t){this.viewport=t;const i=this._initialize(t);return this.loadDependencies(e).then((()=>{this.transformMatrix=s.IDENTITY_MATRIX;this.executeOpTree(this.convertOpList(e));return i}))}convertOpList(e){const t=this._operatorIdMapping,i=e.argsArray,n=e.fnArray,s=[];for(let e=0,r=n.length;e<r;e++){const r=n[e];s.push({fnId:r,fn:t[r],args:i[e]})}return opListToTree(s)}executeOpTree(e){for(const t of e){const e=t.fn,i=t.fnId,n=t.args;switch(0|i){case s.OPS.beginText:this.beginText();break;case s.OPS.dependency:break;case s.OPS.setLeading:this.setLeading(n);break;case s.OPS.setLeadingMoveText:this.setLeadingMoveText(n[0],n[1]);break;case s.OPS.setFont:this.setFont(n);break;case s.OPS.showText:case s.OPS.showSpacedText:this.showText(n[0]);break;case s.OPS.endText:this.endText();break;case s.OPS.moveText:this.moveText(n[0],n[1]);break;case s.OPS.setCharSpacing:this.setCharSpacing(n[0]);break;case s.OPS.setWordSpacing:this.setWordSpacing(n[0]);break;case s.OPS.setHScale:this.setHScale(n[0]);break;case s.OPS.setTextMatrix:this.setTextMatrix(n[0],n[1],n[2],n[3],n[4],n[5]);break;case s.OPS.setTextRise:this.setTextRise(n[0]);break;case s.OPS.setTextRenderingMode:this.setTextRenderingMode(n[0]);break;case s.OPS.setLineWidth:this.setLineWidth(n[0]);break;case s.OPS.setLineJoin:this.setLineJoin(n[0]);break;case s.OPS.setLineCap:this.setLineCap(n[0]);break;case s.OPS.setMiterLimit:this.setMiterLimit(n[0]);break;case s.OPS.setFillRGBColor:this.setFillRGBColor(n[0],n[1],n[2]);break;case s.OPS.setStrokeRGBColor:this.setStrokeRGBColor(n[0],n[1],n[2]);break;case s.OPS.setStrokeColorN:this.setStrokeColorN(n);break;case s.OPS.setFillColorN:this.setFillColorN(n);break;case s.OPS.shadingFill:this.shadingFill(n[0]);break;case s.OPS.setDash:this.setDash(n[0],n[1]);break;case s.OPS.setRenderingIntent:this.setRenderingIntent(n[0]);break;case s.OPS.setFlatness:this.setFlatness(n[0]);break;case s.OPS.setGState:this.setGState(n[0]);break;case s.OPS.fill:this.fill();break;case s.OPS.eoFill:this.eoFill();break;case s.OPS.stroke:this.stroke();break;case s.OPS.fillStroke:this.fillStroke();break;case s.OPS.eoFillStroke:this.eoFillStroke();break;case s.OPS.clip:this.clip("nonzero");break;case s.OPS.eoClip:this.clip("evenodd");break;case s.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case s.OPS.paintImageXObject:this.paintImageXObject(n[0]);break;case s.OPS.paintInlineImageXObject:this.paintInlineImageXObject(n[0]);break;case s.OPS.paintImageMaskXObject:this.paintImageMaskXObject(n[0]);break;case s.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(n[0],n[1]);break;case s.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case s.OPS.closePath:this.closePath();break;case s.OPS.closeStroke:this.closeStroke();break;case s.OPS.closeFillStroke:this.closeFillStroke();break;case s.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case s.OPS.nextLine:this.nextLine();break;case s.OPS.transform:this.transform(n[0],n[1],n[2],n[3],n[4],n[5]);break;case s.OPS.constructPath:this.constructPath(n[0],n[1]);break;case s.OPS.endPath:this.endPath();break;case 92:this.group(t.items);break;default:(0,s.warn)(`Unimplemented operator ${e}`)}}}setWordSpacing(e){this.current.wordSpacing=e}setCharSpacing(e){this.current.charSpacing=e}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(e,t,i,n,s,r){const a=this.current;a.textMatrix=a.lineMatrix=[e,t,i,n,s,r];a.textMatrixScale=Math.hypot(e,t);a.x=a.lineX=0;a.y=a.lineY=0;a.xcoords=[];a.ycoords=[];a.tspan=this.svgFactory.createElement("svg:tspan");a.tspan.setAttributeNS(null,"font-family",a.fontFamily);a.tspan.setAttributeNS(null,"font-size",`${pf(a.fontSize)}px`);a.tspan.setAttributeNS(null,"y",pf(-a.y));a.txtElement=this.svgFactory.createElement("svg:text");a.txtElement.append(a.tspan)}beginText(){const e=this.current;e.x=e.lineX=0;e.y=e.lineY=0;e.textMatrix=s.IDENTITY_MATRIX;e.lineMatrix=s.IDENTITY_MATRIX;e.textMatrixScale=1;e.tspan=this.svgFactory.createElement("svg:tspan");e.txtElement=this.svgFactory.createElement("svg:text");e.txtgrp=this.svgFactory.createElement("svg:g");e.xcoords=[];e.ycoords=[]}moveText(e,t){const i=this.current;i.x=i.lineX+=e;i.y=i.lineY+=t;i.xcoords=[];i.ycoords=[];i.tspan=this.svgFactory.createElement("svg:tspan");i.tspan.setAttributeNS(null,"font-family",i.fontFamily);i.tspan.setAttributeNS(null,"font-size",`${pf(i.fontSize)}px`);i.tspan.setAttributeNS(null,"y",pf(-i.y))}showText(e){const t=this.current,i=t.font,n=t.fontSize;if(0===n)return;const r=t.fontSizeScale,l=t.charSpacing,c=t.wordSpacing,d=t.fontDirection,h=t.textHScale*d,u=i.vertical,p=u?1:-1,g=i.defaultVMetrics,f=n*t.fontMatrix[0];let m=0;for(const s of e){if(null===s){m+=d*c;continue}if("number"==typeof s){m+=p*s*n/1e3;continue}const e=(s.isSpace?c:0)+l,a=s.fontChar;let o,h,v,_=s.width;if(u){let e;const t=s.vmetric||g;e=s.vmetric?t[1]:.5*_;e=-e*f;const i=t[2]*f;_=t?-t[0]:_;o=e/r;h=(m+i)/r}else{o=m/r;h=0}if(s.isInFont||i.missingFile){t.xcoords.push(t.x+o);u&&t.ycoords.push(-t.y+h);t.tspan.textContent+=a}v=u?_*f-e*d:_*f+e*d;m+=v}t.tspan.setAttributeNS(null,"x",t.xcoords.map(pf).join(" "));u?t.tspan.setAttributeNS(null,"y",t.ycoords.map(pf).join(" ")):t.tspan.setAttributeNS(null,"y",pf(-t.y));u?t.y-=m:t.x+=m*h;t.tspan.setAttributeNS(null,"font-family",t.fontFamily);t.tspan.setAttributeNS(null,"font-size",`${pf(t.fontSize)}px`);t.fontStyle!==a.fontStyle&&t.tspan.setAttributeNS(null,"font-style",t.fontStyle);t.fontWeight!==a.fontWeight&&t.tspan.setAttributeNS(null,"font-weight",t.fontWeight);const v=t.textRenderingMode&s.TextRenderingMode.FILL_STROKE_MASK;if(v===s.TextRenderingMode.FILL||v===s.TextRenderingMode.FILL_STROKE){t.fillColor!==a.fillColor&&t.tspan.setAttributeNS(null,"fill",t.fillColor);t.fillAlpha<1&&t.tspan.setAttributeNS(null,"fill-opacity",t.fillAlpha)}else t.textRenderingMode===s.TextRenderingMode.ADD_TO_PATH?t.tspan.setAttributeNS(null,"fill","transparent"):t.tspan.setAttributeNS(null,"fill","none");if(v===s.TextRenderingMode.STROKE||v===s.TextRenderingMode.FILL_STROKE){const e=1/(t.textMatrixScale||1);this._setStrokeAttributes(t.tspan,e)}let _=t.textMatrix;if(0!==t.textRise){_=_.slice();_[5]+=t.textRise}t.txtElement.setAttributeNS(null,"transform",`${pm(_)} scale(${pf(h)}, -1)`);t.txtElement.setAttributeNS(o,"xml:space","preserve");t.txtElement.append(t.tspan);t.txtgrp.append(t.txtElement);this._ensureTransformGroup().append(t.txtElement)}setLeadingMoveText(e,t){this.setLeading(-t);this.moveText(e,t)}addFontStyle(e){if(!e.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');if(!this.cssStyle){this.cssStyle=this.svgFactory.createElement("svg:style");this.cssStyle.setAttributeNS(null,"type","text/css");this.defs.append(this.cssStyle)}const t=createObjectURL(e.data,e.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${e.loadedName}"; src: url(${t}); }\n`}setFont(e){const t=this.current,i=this.commonObjs.get(e[0]);let n=e[1];t.font=i;if(this.embedFonts&&!i.missingFile&&!this.embeddedFonts[i.loadedName]){this.addFontStyle(i);this.embeddedFonts[i.loadedName]=i}t.fontMatrix=i.fontMatrix||s.FONT_IDENTITY_MATRIX;let r="normal";i.black?r="900":i.bold&&(r="bold");const a=i.italic?"italic":"normal";if(n<0){n=-n;t.fontDirection=-1}else t.fontDirection=1;t.fontSize=n;t.fontFamily=i.loadedName;t.fontWeight=r;t.fontStyle=a;t.tspan=this.svgFactory.createElement("svg:tspan");t.tspan.setAttributeNS(null,"y",pf(-t.y));t.xcoords=[];t.ycoords=[]}endText(){var e;const t=this.current;if(t.textRenderingMode&s.TextRenderingMode.ADD_TO_PATH_FLAG&&null!==(e=t.txtElement)&&void 0!==e&&e.hasChildNodes()){t.element=t.txtElement;this.clip("nonzero");this.endPath()}}setLineWidth(e){e>0&&(this.current.lineWidth=e)}setLineCap(e){this.current.lineCap=c[e]}setLineJoin(e){this.current.lineJoin=d[e]}setMiterLimit(e){this.current.miterLimit=e}setStrokeAlpha(e){this.current.strokeAlpha=e}setStrokeRGBColor(e,t,i){this.current.strokeColor=s.Util.makeHexColor(e,t,i)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,i){this.current.fillColor=s.Util.makeHexColor(e,t,i);this.current.tspan=this.svgFactory.createElement("svg:tspan");this.current.xcoords=[];this.current.ycoords=[]}setStrokeColorN(e){this.current.strokeColor=this._makeColorN_Pattern(e)}setFillColorN(e){this.current.fillColor=this._makeColorN_Pattern(e)}shadingFill(e){const t=this.viewport.width,i=this.viewport.height,n=s.Util.inverseTransform(this.transformMatrix),r=s.Util.applyTransform([0,0],n),a=s.Util.applyTransform([0,i],n),o=s.Util.applyTransform([t,0],n),l=s.Util.applyTransform([t,i],n),c=Math.min(r[0],a[0],o[0],l[0]),d=Math.min(r[1],a[1],o[1],l[1]),h=Math.max(r[0],a[0],o[0],l[0]),u=Math.max(r[1],a[1],o[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",c);p.setAttributeNS(null,"y",d);p.setAttributeNS(null,"width",h-c);p.setAttributeNS(null,"height",u-d);p.setAttributeNS(null,"fill",this._makeShadingPattern(e));this.current.fillAlpha<1&&p.setAttributeNS(null,"fill-opacity",this.current.fillAlpha);this._ensureTransformGroup().append(p)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){const t=e[1],i=e[2],n=e[3]||s.IDENTITY_MATRIX,[r,a,o,l]=e[4],c=e[5],d=e[6],h=e[7],u="shading"+g++,[p,f,m,v]=s.Util.normalizeRect([...s.Util.applyTransform([r,a],n),...s.Util.applyTransform([o,l],n)]),[_,b]=s.Util.singularValueDecompose2dScale(n),w=c*_,y=d*b,P=this.svgFactory.createElement("svg:pattern");P.setAttributeNS(null,"id",u);P.setAttributeNS(null,"patternUnits","userSpaceOnUse");P.setAttributeNS(null,"width",w);P.setAttributeNS(null,"height",y);P.setAttributeNS(null,"x",`${p}`);P.setAttributeNS(null,"y",`${f}`);const S=this.svg,A=this.transformMatrix,E=this.current.fillColor,x=this.current.strokeColor,C=this.svgFactory.create(m-p,v-f);this.svg=C;this.transformMatrix=n;if(2===h){const e=s.Util.makeHexColor(...t);this.current.fillColor=e;this.current.strokeColor=e}this.executeOpTree(this.convertOpList(i));this.svg=S;this.transformMatrix=A;this.current.fillColor=E;this.current.strokeColor=x;P.append(C.childNodes[0]);this.defs.append(P);return`url(#${u})`}_makeShadingPattern(e){"string"==typeof e&&(e=this.objs.get(e));switch(e[0]){case"RadialAxial":const t="shading"+g++,i=e[3];let n;switch(e[1]){case"axial":const i=e[4],s=e[5];n=this.svgFactory.createElement("svg:linearGradient");n.setAttributeNS(null,"id",t);n.setAttributeNS(null,"gradientUnits","userSpaceOnUse");n.setAttributeNS(null,"x1",i[0]);n.setAttributeNS(null,"y1",i[1]);n.setAttributeNS(null,"x2",s[0]);n.setAttributeNS(null,"y2",s[1]);break;case"radial":const r=e[4],a=e[5],o=e[6],l=e[7];n=this.svgFactory.createElement("svg:radialGradient");n.setAttributeNS(null,"id",t);n.setAttributeNS(null,"gradientUnits","userSpaceOnUse");n.setAttributeNS(null,"cx",a[0]);n.setAttributeNS(null,"cy",a[1]);n.setAttributeNS(null,"r",l);n.setAttributeNS(null,"fx",r[0]);n.setAttributeNS(null,"fy",r[1]);n.setAttributeNS(null,"fr",o);break;default:throw new Error(`Unknown RadialAxial type: ${e[1]}`)}for(const e of i){const t=this.svgFactory.createElement("svg:stop");t.setAttributeNS(null,"offset",e[0]);t.setAttributeNS(null,"stop-color",e[1]);n.append(t)}this.defs.append(n);return`url(#${t})`;case"Mesh":(0,s.warn)("Unimplemented pattern Mesh");return null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${e[0]}`)}}setDash(e,t){this.current.dashArray=e;this.current.dashPhase=t}constructPath(e,t){const i=this.current;let n=i.x,r=i.y,a=[],o=0;for(const i of e)switch(0|i){case s.OPS.rectangle:n=t[o++];r=t[o++];const e=n+t[o++],i=r+t[o++];a.push("M",pf(n),pf(r),"L",pf(e),pf(r),"L",pf(e),pf(i),"L",pf(n),pf(i),"Z");break;case s.OPS.moveTo:n=t[o++];r=t[o++];a.push("M",pf(n),pf(r));break;case s.OPS.lineTo:n=t[o++];r=t[o++];a.push("L",pf(n),pf(r));break;case s.OPS.curveTo:n=t[o+4];r=t[o+5];a.push("C",pf(t[o]),pf(t[o+1]),pf(t[o+2]),pf(t[o+3]),pf(n),pf(r));o+=6;break;case s.OPS.curveTo2:a.push("C",pf(n),pf(r),pf(t[o]),pf(t[o+1]),pf(t[o+2]),pf(t[o+3]));n=t[o+2];r=t[o+3];o+=4;break;case s.OPS.curveTo3:n=t[o+2];r=t[o+3];a.push("C",pf(t[o]),pf(t[o+1]),pf(n),pf(r),pf(n),pf(r));o+=4;break;case s.OPS.closePath:a.push("Z")}a=a.join(" ");if(i.path&&e.length>0&&e[0]!==s.OPS.rectangle&&e[0]!==s.OPS.moveTo)a=i.path.getAttributeNS(null,"d")+a;else{i.path=this.svgFactory.createElement("svg:path");this._ensureTransformGroup().append(i.path)}i.path.setAttributeNS(null,"d",a);i.path.setAttributeNS(null,"fill","none");i.element=i.path;i.setCurrentPoint(n,r)}endPath(){const e=this.current;e.path=null;if(!this.pendingClip)return;if(!e.element){this.pendingClip=null;return}const t="clippath"+u++,i=this.svgFactory.createElement("svg:clipPath");i.setAttributeNS(null,"id",t);i.setAttributeNS(null,"transform",pm(this.transformMatrix));const n=e.element.cloneNode(!0);"evenodd"===this.pendingClip?n.setAttributeNS(null,"clip-rule","evenodd"):n.setAttributeNS(null,"clip-rule","nonzero");this.pendingClip=null;i.append(n);this.defs.append(i);if(e.activeClipUrl){e.clipGroup=null;for(const e of this.extraStack)e.clipGroup=null;i.setAttributeNS(null,"clip-path",e.activeClipUrl)}e.activeClipUrl=`url(#${t})`;this.tgrp=null}clip(e){this.pendingClip=e}closePath(){const e=this.current;if(e.path){const t=`${e.path.getAttributeNS(null,"d")}Z`;e.path.setAttributeNS(null,"d",t)}}setLeading(e){this.current.leading=-e}setTextRise(e){this.current.textRise=e}setTextRenderingMode(e){this.current.textRenderingMode=e}setHScale(e){this.current.textHScale=e/100}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,i]of e)switch(t){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i);break;case"CA":this.setStrokeAlpha(i);break;case"ca":this.setFillAlpha(i);break;default:(0,s.warn)(`Unimplemented graphic state operator ${t}`)}}fill(){const e=this.current;if(e.element){e.element.setAttributeNS(null,"fill",e.fillColor);e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha);this.endPath()}}stroke(){const e=this.current;if(e.element){this._setStrokeAttributes(e.element);e.element.setAttributeNS(null,"fill","none");this.endPath()}}_setStrokeAttributes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const i=this.current;let n=i.dashArray;1!==t&&n.length>0&&(n=n.map((function(e){return t*e})));e.setAttributeNS(null,"stroke",i.strokeColor);e.setAttributeNS(null,"stroke-opacity",i.strokeAlpha);e.setAttributeNS(null,"stroke-miterlimit",pf(i.miterLimit));e.setAttributeNS(null,"stroke-linecap",i.lineCap);e.setAttributeNS(null,"stroke-linejoin",i.lineJoin);e.setAttributeNS(null,"stroke-width",pf(t*i.lineWidth)+"px");e.setAttributeNS(null,"stroke-dasharray",n.map(pf).join(" "));e.setAttributeNS(null,"stroke-dashoffset",pf(t*i.dashPhase)+"px")}eoFill(){var e;null===(e=this.current.element)||void 0===e||e.setAttributeNS(null,"fill-rule","evenodd");this.fill()}fillStroke(){this.stroke();this.fill()}eoFillStroke(){var e;null===(e=this.current.element)||void 0===e||e.setAttributeNS(null,"fill-rule","evenodd");this.fillStroke()}closeStroke(){this.closePath();this.stroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.closePath();this.eoFillStroke()}paintSolidColorImageMask(){const e=this.svgFactory.createElement("svg:rect");e.setAttributeNS(null,"x","0");e.setAttributeNS(null,"y","0");e.setAttributeNS(null,"width","1px");e.setAttributeNS(null,"height","1px");e.setAttributeNS(null,"fill",this.current.fillColor);this._ensureTransformGroup().append(e)}paintImageXObject(e){const t=this.getObject(e);t?this.paintInlineImageXObject(t):(0,s.warn)(`Dependent image with object ID ${e} is not ready yet`)}paintInlineImageXObject(e,t){const i=e.width,n=e.height,s=h(e,this.forceDataSchema,!!t),r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x","0");r.setAttributeNS(null,"y","0");r.setAttributeNS(null,"width",pf(i));r.setAttributeNS(null,"height",pf(n));this.current.element=r;this.clip("nonzero");const a=this.svgFactory.createElement("svg:image");a.setAttributeNS(l,"xlink:href",s);a.setAttributeNS(null,"x","0");a.setAttributeNS(null,"y",pf(-n));a.setAttributeNS(null,"width",pf(i)+"px");a.setAttributeNS(null,"height",pf(n)+"px");a.setAttributeNS(null,"transform",`scale(${pf(1/i)} ${pf(-1/n)})`);t?t.append(a):this._ensureTransformGroup().append(a)}paintImageMaskXObject(e){const t=this.getObject(e.data,e);if(t.bitmap){(0,s.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const i=this.current,n=t.width,r=t.height,a=i.fillColor;i.maskId="mask"+p++;const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",i.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0");l.setAttributeNS(null,"y","0");l.setAttributeNS(null,"width",pf(n));l.setAttributeNS(null,"height",pf(r));l.setAttributeNS(null,"fill",a);l.setAttributeNS(null,"mask",`url(#${i.maskId})`);this.defs.append(o);this._ensureTransformGroup().append(l);this.paintInlineImageXObject(t,o)}paintFormXObjectBegin(e,t){Array.isArray(e)&&6===e.length&&this.transform(e[0],e[1],e[2],e[3],e[4],e[5]);if(t){const e=t[2]-t[0],i=t[3]-t[1],n=this.svgFactory.createElement("svg:rect");n.setAttributeNS(null,"x",t[0]);n.setAttributeNS(null,"y",t[1]);n.setAttributeNS(null,"width",pf(e));n.setAttributeNS(null,"height",pf(i));this.current.element=n;this.clip("nonzero");this.endPath()}}paintFormXObjectEnd(){}_initialize(e){const t=this.svgFactory.create(e.width,e.height),i=this.svgFactory.createElement("svg:defs");t.append(i);this.defs=i;const n=this.svgFactory.createElement("svg:g");n.setAttributeNS(null,"transform",pm(e.transform));t.append(n);this.svg=n;return t}_ensureClipGroup(){if(!this.current.clipGroup){const e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl);this.svg.append(e);this.current.clipGroup=e}return this.current.clipGroup}_ensureTransformGroup(){if(!this.tgrp){this.tgrp=this.svgFactory.createElement("svg:g");this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix));this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)}return this.tgrp}}}}],__webpack_module_cache__={};function __w_pdfjs_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var i=__webpack_module_cache__[e]={exports:{}};__webpack_modules__[e](i,i.exports,__w_pdfjs_require__);return i.exports}var __webpack_exports__={};(()=>{"use strict";var e=__webpack_exports__;Object.defineProperty(e,"__esModule",{value:!0});Object.defineProperty(e,"AbortException",{enumerable:!0,get:function(){return t.AbortException}});Object.defineProperty(e,"AnnotationEditorLayer",{enumerable:!0,get:function(){return r.AnnotationEditorLayer}});Object.defineProperty(e,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return t.AnnotationEditorParamsType}});Object.defineProperty(e,"AnnotationEditorType",{enumerable:!0,get:function(){return t.AnnotationEditorType}});Object.defineProperty(e,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return a.AnnotationEditorUIManager}});Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}});Object.defineProperty(e,"AnnotationMode",{enumerable:!0,get:function(){return t.AnnotationMode}});Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return t.CMapCompressionType}});Object.defineProperty(e,"FeatureTest",{enumerable:!0,get:function(){return t.FeatureTest}});Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}});Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return t.InvalidPDFException}});Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return t.MissingPDFException}});Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return t.OPS}});Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return i.PDFDataRangeTransport}});Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return n.PDFDateString}});Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return i.PDFWorker}});Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return t.PasswordResponses}});Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return t.PermissionFlag}});Object.defineProperty(e,"PixelsPerInch",{enumerable:!0,get:function(){return n.PixelsPerInch}});Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return n.RenderingCancelledException}});Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return c.SVGGraphics}});Object.defineProperty(e,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return t.UNSUPPORTED_FEATURES}});Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return t.UnexpectedResponseException}});Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return t.Util}});Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return t.VerbosityLevel}});Object.defineProperty(e,"XfaLayer",{enumerable:!0,get:function(){return d.XfaLayer}});Object.defineProperty(e,"build",{enumerable:!0,get:function(){return i.build}});Object.defineProperty(e,"createPromiseCapability",{enumerable:!0,get:function(){return t.createPromiseCapability}});Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return t.createValidAbsoluteUrl}});Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return i.getDocument}});Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return n.getFilenameFromUrl}});Object.defineProperty(e,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return n.getPdfFilenameFromUrl}});Object.defineProperty(e,"getXfaPageViewport",{enumerable:!0,get:function(){return n.getXfaPageViewport}});Object.defineProperty(e,"isDataScheme",{enumerable:!0,get:function(){return n.isDataScheme}});Object.defineProperty(e,"isPdfFile",{enumerable:!0,get:function(){return n.isPdfFile}});Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return n.loadScript}});Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return s.renderTextLayer}});Object.defineProperty(e,"setLayerDimensions",{enumerable:!0,get:function(){return n.setLayerDimensions}});Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return t.shadow}});Object.defineProperty(e,"updateTextLayer",{enumerable:!0,get:function(){return s.updateTextLayer}});Object.defineProperty(e,"version",{enumerable:!0,get:function(){return i.version}});var t=__w_pdfjs_require__(1),i=__w_pdfjs_require__(134),n=__w_pdfjs_require__(138),s=__w_pdfjs_require__(158),r=__w_pdfjs_require__(159),a=__w_pdfjs_require__(137),o=__w_pdfjs_require__(164),l=__w_pdfjs_require__(146),c=__w_pdfjs_require__(167),d=__w_pdfjs_require__(166)})();return __webpack_exports__})()));
/**
 * @licstart The following is the entire license notice for the
 * JavaScript code in this page
 *
 * Copyright 2023 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)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.GenericCom=void 0;var n=i(2),s=i(180),r=i(181),a=i(182),o=i(184);t.GenericCom={};class GenericPreferences extends s.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(){return new r.DownloadManager}static createPreferences(){return new GenericPreferences}static createL10n(e){let{locale:t="en-US"}=e;return new a.GenericL10n(t)}static createScripting(e){let{sandboxBundleSrc:t}=e;return new o.GenericScripting(t)}}n.PDFViewerApplication.externalServices=GenericExternalServices},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFViewerApplication=t.PDFPrintServiceFactory=t.DefaultExternalServices=void 0;var n=i(3),s=i(4),r=i(5),a=i(6),o=i(7),l=i(8),c=i(9),d=i(11),h=i(12),u=i(14),p=i(16),g=i(17),f=i(18),m=i(22),v=i(23),_=i(24),b=i(25),w=i(26),y=i(27),P=i(28),S=i(29),A=i(30),E=i(32),x=i(177),C=i(178),M=i(179);const T=1e3,k=-1,I=1,D={AUTOMATIC:0,LIGHT:1,DARK:2};class DefaultExternalServices{constructor(){throw new Error("Cannot initialize DefaultExternalServices.")}static updateFindControlState(e){}static updateFindMatchesCount(e){}static initPassiveLoading(e){}static reportTelemetry(e){}static createDownloadManager(){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 supportsPinchToZoom(){return(0,s.shadow)(this,"supportsPinchToZoom",!0)}static get supportsIntegratedFind(){return(0,s.shadow)(this,"supportsIntegratedFind",!1)}static get supportsDocumentFonts(){return(0,s.shadow)(this,"supportsDocumentFonts",!0)}static get supportedMouseWheelZoomModifierKeys(){return(0,s.shadow)(this,"supportedMouseWheelZoomModifierKeys",{ctrlKey:!0,metaKey:!0})}static get isInAutomation(){return(0,s.shadow)(this,"isInAutomation",!1)}static updateEditorStates(e){throw new Error("Not implemented: updateEditorStates")}}t.DefaultExternalServices=DefaultExternalServices;const R={initialBookmark:document.location.hash.substring(1),_initializedCapability:(0,s.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,_wheelUnusedTicks:0,_wheelUnusedFactor:1,_touchUnusedTicks:0,_touchUnusedFactor:1,_PDFBug:null,_hasAnnotationEditors:!1,_title:document.title,_printAnnotationStoragePromise:null,_touchInfo:null,_isCtrlKeyDown:!1,async initialize(e){this.preferences=this.externalServices.createPreferences();this.appConfig=e;await this._initializeOptions();this._forceCssTheme();await this._initializeL10n();this.isViewerEmbedded&&r.AppOptions.get("externalLinkTarget")===o.LinkTarget.NONE&&r.AppOptions.set("externalLinkTarget",o.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 _initializeOptions(){if(r.AppOptions.get("disablePreferences"))r.AppOptions.get("pdfBugEnabled")&&await this._parseHashParams();else{r.AppOptions._hasUserOptions()&&Window.ngxConsole.warn('_initializeOptions: The Preferences may override manually set AppOptions; please use the "disablePreferences"-option in order to prevent that.');try{r.AppOptions.setAll(await this.preferences.getAll())}catch(e){Window.ngxConsole.error(`_initializeOptions: "${null==e?void 0:e.message}".`)}r.AppOptions.get("pdfBugEnabled")&&await this._parseHashParams()}},async _parseHashParams(){const e=document.location.hash.substring(1);if(!e)return;const{mainContainer:t,viewerContainer:i}=this.appConfig,a=(0,n.parseQueryString)(e);if("true"===a.get("disableworker"))try{await async function loadFakeWorker(){s.GlobalWorkerOptions.workerSrc||(s.GlobalWorkerOptions.workerSrc=r.AppOptions.get("workerSrc"));"Function"===s.GlobalWorkerOptions.workerSrc.constructor.name&&(s.GlobalWorkerOptions.workerSrc=s.GlobalWorkerOptions.workerSrc());await(0,s.loadScript)(s.PDFWorker.workerSrc)}()}catch(e){console.error(`_parseHashParams: "${e.message}".`)}a.has("disablerange")&&r.AppOptions.set("disableRange","true"===a.get("disablerange"));a.has("disablestream")&&r.AppOptions.set("disableStream","true"===a.get("disablestream"));a.has("disableautofetch")&&r.AppOptions.set("disableAutoFetch","true"===a.get("disableautofetch"));a.has("disablefontface")&&r.AppOptions.set("disableFontFace","true"===a.get("disablefontface"));a.has("disablehistory")&&r.AppOptions.set("disableHistory","true"===a.get("disablehistory"));a.has("verbosity")&&r.AppOptions.set("verbosity",0|a.get("verbosity"));if(a.has("textlayer"))switch(a.get("textlayer")){case"off":r.AppOptions.set("textLayerMode",n.TextLayerMode.DISABLE);break;case"visible":case"shadow":case"hover":i.classList.add(`textLayer-${a.get("textlayer")}`);try{await loadPDFBug(this);this._PDFBug.loadCSS()}catch(e){console.error(`_parseHashParams: "${e.message}".`)}}if(a.has("pdfbug")){r.AppOptions.set("pdfBug",!0);r.AppOptions.set("fontExtraProperties",!0);const e=a.get("pdfbug").split(",");try{await loadPDFBug(this);this._PDFBug.init({OPS:s.OPS},t,e)}catch(e){console.error(`_parseHashParams: "${e.message}".`)}}a.has("locale")&&r.AppOptions.set("locale",a.get("locale"))},async _initializeL10n(){this.l10n=this.externalServices.createL10n({locale:r.AppOptions.get("locale")});const e=await this.l10n.getDirection();document.getElementsByTagName("html")[0].dir=e},_forceCssTheme(){const e=r.AppOptions.get("viewerCssTheme");if(e!==D.AUTOMATIC&&Object.values(D).includes(e))try{const i=document.styleSheets[0],n=(null==i?void 0:i.cssRules)||[];for(let s=0,r=n.length;s<r;s++){var t;const r=n[s];if(r instanceof CSSMediaRule&&"(prefers-color-scheme: dark)"===(null===(t=r.media)||void 0===t?void 0:t[0])){if(e===D.LIGHT){i.deleteRule(s);return}const t=/^@media \(prefers-color-scheme: dark\) {\n\s*([\w\s-.,:;/\\{}()]+)\n}$/.exec(r.cssText);if(null!=t&&t[1]){i.deleteRule(s);i.insertRule(t[1],s)}return}}}catch(e){Window.ngxConsole.error(`_forceCssTheme: "${null==e?void 0:e.message}".`)}},async _initializeViewerComponents(){var e,t,i,n,M,T;const{appConfig:k,externalServices:I}=this,D=I.isInAutomation?new a.AutomationEventBus:new a.EventBus;this.eventBus=D;this.overlayManager=new c.OverlayManager;const R=new w.PDFRenderingQueue;R.onIdle=this._cleanup.bind(this);this.pdfRenderingQueue=R;const L=new o.PDFLinkService({eventBus:D,externalLinkTarget:r.AppOptions.get("externalLinkTarget"),externalLinkRel:r.AppOptions.get("externalLinkRel"),ignoreDestinationZoom:r.AppOptions.get("ignoreDestinationZoom")});this.pdfLinkService=L;const O=I.createDownloadManager();this.downloadManager=O;const N=new f.PDFFindController({linkService:L,eventBus:D,pageViewMode:r.AppOptions.get("pageViewMode"),updateMatchesCountOnProgress:!0});this.findController=N;const B=new y.PDFScriptingManager({eventBus:D,sandboxBundleSrc:r.AppOptions.get("sandboxBundleSrc"),scriptingFactory:I,docPropertiesLookup:this._scriptingDocProperties.bind(this)});this.pdfScriptingManager=B;const G=k.mainContainer,V=k.viewerContainer,W=r.AppOptions.get("annotationEditorMode"),U=r.AppOptions.get("forcePageColors")||window.matchMedia("(forced-colors: active)").matches?{background:r.AppOptions.get("pageColorsBackground"),foreground:r.AppOptions.get("pageColorsForeground")}:null;this.pdfViewer=new E.PDFViewer({container:G,viewer:V,eventBus:D,renderingQueue:R,linkService:L,downloadManager:O,findController:N,scriptingManager:r.AppOptions.get("enableScripting")&&B,renderer:r.AppOptions.get("renderer"),l10n:this.l10n,textLayerMode:r.AppOptions.get("textLayerMode"),annotationMode:r.AppOptions.get("annotationMode"),annotationEditorMode:W,imageResourcesPath:r.AppOptions.get("imageResourcesPath"),removePageBorders:r.AppOptions.get("removePageBorders"),enablePrintAutoRotate:r.AppOptions.get("enablePrintAutoRotate"),useOnlyCssZoom:r.AppOptions.get("useOnlyCssZoom"),isOffscreenCanvasSupported:r.AppOptions.get("isOffscreenCanvasSupported"),maxCanvasPixels:r.AppOptions.get("maxCanvasPixels"),pageViewMode:r.AppOptions.get("pageViewMode"),enablePermissions:r.AppOptions.get("enablePermissions"),pageColors:U});R.setViewer(this.pdfViewer);L.setViewer(this.pdfViewer);B.setViewer(this.pdfViewer);if(null!==(e=k.sidebar)&&void 0!==e&&e.thumbnailView){this.pdfThumbnailViewer=new A.PDFThumbnailViewer({container:k.sidebar.thumbnailView,renderingQueue:R,linkService:L,l10n:this.l10n,pageColors:U});R.setThumbnailViewer(this.pdfThumbnailViewer)}if(!this.isViewerEmbedded&&!r.AppOptions.get("disableHistory")){this.pdfHistory=new m.PDFHistory({linkService:L,eventBus:D});L.setHistory(this.pdfHistory)}!this.supportsIntegratedFind&&k.findBar&&(this.findBar=new g.PDFFindBar(k.findBar,D,this.l10n));if(k.annotationEditorParams)if(W!==s.AnnotationEditorType.DISABLE)this.annotationEditorParams=new l.AnnotationEditorParams(k.annotationEditorParams,D);else for(const e of["editorModeButtons","editorModeSeparator"]){var j;null===(j=document.getElementById(e))||void 0===j||j.classList.add("hidden")}k.documentProperties&&(this.pdfDocumentProperties=new p.PDFDocumentProperties(k.documentProperties,this.overlayManager,D,this.l10n,(()=>this._docFilename)));null!==(t=k.secondaryToolbar)&&void 0!==t&&t.cursorHandToolButton&&(this.pdfCursorTools=new u.PDFCursorTools({container:G,eventBus:D,cursorToolOnLoad:r.AppOptions.get("cursorToolOnLoad")}));k.toolbar&&(this.toolbar=new C.Toolbar(k.toolbar,D,this.l10n));k.secondaryToolbar&&(this.secondaryToolbar=new x.SecondaryToolbar(k.secondaryToolbar,D,this.externalServices));this.supportsFullscreen&&null!==(i=k.secondaryToolbar)&&void 0!==i&&i.presentationModeButton&&(this.pdfPresentationMode=new b.PDFPresentationMode({container:G,pdfViewer:this.pdfViewer,eventBus:D}));let H=r.AppOptions.get("passwordPrompt");H||k.passwordOverlay&&(H=new d.PasswordPrompt(k.passwordOverlay,this.overlayManager,this.l10n,this.isViewerEmbedded));this.passwordPrompt=H;null!==(n=k.sidebar)&&void 0!==n&&n.outlineView&&(this.pdfOutlineViewer=new _.PDFOutlineViewer({container:k.sidebar.outlineView,eventBus:D,linkService:L,downloadManager:O}));null!==(M=k.sidebar)&&void 0!==M&&M.attachmentsView&&(this.pdfAttachmentViewer=new h.PDFAttachmentViewer({container:k.sidebar.attachmentsView,eventBus:D,downloadManager:O}));null!==(T=k.sidebar)&&void 0!==T&&T.layersView&&(this.pdfLayerViewer=new v.PDFLayerViewer({container:k.sidebar.layersView,eventBus:D,l10n:this.l10n}));if(k.sidebar){this.pdfSidebar=new P.PDFSidebar({elements:k.sidebar,pdfViewer:this.pdfViewer,pdfThumbnailViewer:this.pdfThumbnailViewer,eventBus:D,l10n:this.l10n});this.pdfSidebar.onToggled=this.forceRendering.bind(this);this.pdfSidebarResizer=new S.PDFSidebarResizer(k.sidebarResizer,D,this.l10n)}},run(e){this.initialize(e).then(webViewerInitialized)},get initialized(){return this._initializedCapability.settled},get initializedPromise(){return this._initializedCapability.promise},zoomIn(e,t){this.pdfViewer.isInPresentationMode||this.pdfViewer.increaseScale({drawingDelay:r.AppOptions.get("defaultZoomDelay"),steps:e,scaleFactor:t})},zoomOut(e,t){this.pdfViewer.isInPresentationMode||this.pdfViewer.decreaseScale({drawingDelay:r.AppOptions.get("defaultZoomDelay"),steps:e,scaleFactor:t})},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 O.instance.supportsPrinting},get supportsFullscreen(){return(0,s.shadow)(this,"supportsFullscreen",document.fullscreenEnabled)},get supportsPinchToZoom(){return this.externalServices.supportsPinchToZoom},get supportsIntegratedFind(){return this.externalServices.supportsIntegratedFind},get supportsDocumentFonts(){return this.externalServices.supportsDocumentFonts},initializeLoadingBar(){const e=document.getElementById("loadingBar"),t=e?new n.ProgressBar(e):null;t.hide();return(0,s.shadow)(this,"loadingBar",t)},get supportedMouseWheelZoomModifierKeys(){return this.externalServices.supportedMouseWheelZoomModifierKeys},initPassiveLoading(){throw new Error("Not implemented: initPassiveLoading")},setTitleUsingUrl(){},setTitle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._title;this._title=e;if(this.isViewerEmbedded)return;const t=this._hasAnnotationEditors&&!this.pdfRenderingQueue.printing;document.title=`${t?"* ":""}${e}`},get _docFilename(){return this._contentDispositionFilename||(0,s.getPdfFilenameFromUrl)(this.url)},_hideViewBookmark(){const{secondaryToolbar:e}=this.appConfig;null==e||e.viewBookmarkButton.classList.add("hidden");if(null!=e&&e.presentationModeButton.classList.contains("hidden")){var t;null===(t=document.getElementById("viewBookmarkSeparator"))||void 0===t||t.classList.add("hidden")}},async close(){var e,t,i,n,s,r,a,o,l,c;this._unblockDocumentLoadEvent();this._hideViewBookmark();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 d=[];d.push(this.pdfLoadingTask.destroy());this.pdfLoadingTask=null;if(this.pdfDocument){var h,u;this.pdfDocument=null;null===(h=this.pdfThumbnailViewer)||void 0===h||h.setDocument(null);this.pdfViewer.setDocument(null);this.pdfLinkService.setDocument(null);null===(u=this.pdfDocumentProperties)||void 0===u||u.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._hasAnnotationEditors=!1;d.push(this.pdfScriptingManager.destroyPromise);this.setTitle();null===(t=this.pdfSidebar)||void 0===t||t.reset();null===(i=this.pdfOutlineViewer)||void 0===i||i.reset();null===(n=this.pdfAttachmentViewer)||void 0===n||n.reset();null===(s=this.pdfLayerViewer)||void 0===s||s.reset();null===(r=this.pdfHistory)||void 0===r||r.reset();null===(a=this.findBar)||void 0===a||a.reset();null===(o=this.toolbar)||void 0===o||o.reset();null===(l=this.secondaryToolbar)||void 0===l||l.reset();null===(c=this._PDFBug)||void 0===c||c.cleanup();await Promise.all(d)},async open(e){window.adjacentPagesLoader=void 0;window.ngxZone.runOutsideAngular((async()=>{var t;let i=!1;if("string"==typeof e){e={url:e};i=!0}else if(null!==(t=e)&&void 0!==t&&t.byteLength){e={data:e};i=!0}i&&console.error("The `PDFViewerApplication.open` signature was updated, please use an object instead.");this.pdfLoadingTask&&await this.close();const n=r.AppOptions.getAll(r.OptionKind.WORKER);Object.assign(s.GlobalWorkerOptions,n);e.url&&this.setTitleUsingUrl(e.originalUrl||e.url,e.url);const a={...r.AppOptions.getAll(r.OptionKind.API),...e},o=(0,s.getDocument)(a);this.pdfLoadingTask=o;o.onPassword=(e,t)=>{this.isViewerEmbedded&&this._unblockDocumentLoadEvent();this.pdfLinkService.externalLinkEnabled=!1;this.passwordPrompt.setUpdateCallback(e,t);this.passwordPrompt.open()};o.onProgress=e=>{var t;let{loaded:i,total:n}=e;this.progress(i/n);null===(t=this.eventBus)||void 0===t||t.dispatch("progress",{source:this,type:"load",total:n,loaded:i,percent:100*i/n})};return o.promise.then((e=>{this.load(e)}),(e=>{if(o!==this.pdfLoadingTask)return;let t="loading_error";e instanceof s.InvalidPDFException?t="invalid_file_error":e instanceof s.MissingPDFException?t="missing_file_error":e instanceof s.UnexpectedResponseException&&(t="unexpected_response_error");R.onError&&R.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: ${e.message}`);await this.download()}finally{await this.pdfScriptingManager.dispatchDidSave();this._saveInProgress=!1}this._hasAnnotationEditors&&this.externalServices.reportTelemetry({type:"editing",data:{type:"save"}})},downloadOrSave(){var e;(null===(e=this.pdfDocument)||void 0===e?void 0:e.annotationStorage.size)>0?this.save():this.download()},_documentError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._unblockDocumentLoadEvent();this._otherError(e,t);this.eventBus.dispatch("documenterror",{source:this,message:e,reason:(null==t?void 0:t.message)??null})},_otherError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[`PDF.js v${s.version||"?"} (build: ${s.build||"?"})`];if(t){i.push(`Message: ${t.message}`);if(t.stack)i.push(`Stack: ${t.stack}`);else{t.filename&&i.push(`File: ${t.filename}`);t.lineNumber&&i.push(`Line: ${t.lineNumber}`)}}console.error(`${e}\n\n${i.join("\n")}`)},progress(e){var t;if(!this.loadingBar||this.downloadComplete)return;const i=Math.round(100*e);if(!(i<=this.loadingBar.percent)){this.loadingBar.percent=i;((null===(t=this.pdfDocument)||void 0===t?void 0:t.loadingParams.disableAutoFetch)??r.AppOptions.get("disableAutoFetch"))&&this.loadingBar.setDisableAutoFetch()}},load(e){var t,i,a,o;this.pdfDocument=e;e.getDownloadInfo().then((e=>{var t;let{length:i}=e;this._contentLength=i;this.downloadComplete=!0;null===(t=this.loadingBar)||void 0===t||t.hide();p.then((()=>{var e;null===(e=this.eventBus)||void 0===e||e.dispatch("documentloaded",{source:this})}))}));const l=e.getPageLayout().catch((function(){})),c=e.getPageMode().catch((function(){})),d=e.getOpenAction().catch((function(){}));null===(t=this.toolbar)||void 0===t||t.setPagesCount(e.numPages,!1);null===(i=this.secondaryToolbar)||void 0===i||i.setPagesCount(e.numPages);let h;h=null;h&&(0,s.isDataScheme)(h)&&(h=null);this.pdfLinkService.setDocument(e,h);null===(a=this.pdfDocumentProperties)||void 0===a||a.setDocument(e);const u=this.pdfViewer;u.setDocument(e);const{firstPagePromise:p,onePageRendered:g,pagesPromise:f}=u;null===(o=this.pdfThumbnailViewer)||void 0===o||o.setDocument(e);const m=(this.store=new M.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)));p.then((t=>{var i;null===(i=this.loadingBar)||void 0===i||i.setWidth(this.appConfig.viewerContainer);this._initializeAnnotationStorageCallbacks(e);Promise.all([n.animationStarted,m,l,c,d]).then((async t=>{let[i,s,a,o,l]=t;const c=r.AppOptions.get("viewOnLoad");this._initializePdfHistory({fingerprint:e.fingerprints[0],viewOnLoad:c,initialDest:null==l?void 0:l.dest});const d=this.initialBookmark,h=r.AppOptions.get("defaultZoomValue");let p=h?`zoom=${h}`:null,g=null,m=r.AppOptions.get("sidebarViewOnLoad"),v=r.AppOptions.get("scrollModeOnLoad"),_=r.AppOptions.get("spreadModeOnLoad");if(s.page&&c!==I){p=`page=${s.page}&zoom=${h||s.zoom},${s.scrollLeft},${s.scrollTop}`;g=parseInt(s.rotation,10);m===n.SidebarView.UNKNOWN&&(m=0|s.sidebarView);v===n.ScrollMode.UNKNOWN&&(v=0|s.scrollMode);_===n.SpreadMode.UNKNOWN&&(_=0|s.spreadMode)}o&&m===n.SidebarView.UNKNOWN&&(m=(0,n.apiPageModeToSidebarView)(o));if(a&&v===n.ScrollMode.UNKNOWN&&_===n.SpreadMode.UNKNOWN){_=(0,n.apiPageLayoutToViewerModes)(a).spreadMode}this.setInitialView(p,{rotation:g,sidebarView:m,scrollMode:v,spreadMode:_});this.eventBus.dispatch("documentinit",{source:this});this.isViewerEmbedded||u.focus();await Promise.race([f,new Promise((e=>{setTimeout(e,10)}))]);if((d||p)&&!u.hasEqualPageSizes){this.initialBookmark=d;u.currentScaleValue=u.currentScaleValue;this.setInitialView(p)}})).catch((()=>{this.setInitialView()})).then((function(){u.update()}))}));f.then((()=>{this._unblockDocumentLoadEvent();this._initializeAutoPrint(e,d)}),(e=>{R.onError&&R.onError(e);this.l10n.get("loading_error").then((t=>{this._documentError(t,{message:null==e?void 0:e.message})}))}));g.then((t=>{this.externalServices.reportTelemetry({type:"pageInfo",timestamp:t.timestamp});this.pdfOutlineViewer&&e.getOutline().then((t=>{e===this.pdfDocument&&this.pdfOutlineViewer.render({outline:t,pdfDocument:e})}));this.pdfAttachmentViewer&&e.getAttachments().then((t=>{e===this.pdfDocument&&this.pdfAttachmentViewer.render({attachments:t})}));this.pdfLayerViewer&&u.optionalContentConfigPromise.then((t=>{e===this.pdfDocument&&this.pdfLayerViewer.render({optionalContentConfig:t,pdfDocument:e})}))}));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 _initializeAutoPrint(e,t){const[i,s]=await Promise.all([t,this.pdfViewer.enableScripting?null:e.getJavaScript()]);if(e!==this.pdfDocument)return;let r=!1;"Print"===(null==i?void 0:i.action)&&(r=!0);if(s){s.some((e=>{if(!e)return!1;Window.ngxConsole.warn("Warning: JavaScript support is not enabled");return!0}));if(!r)for(const e of s)if(e&&n.AutoPrintRegExp.test(e)){r=!0;break}}r&&this.triggerPrinting()},async _initializeMetadata(e){const{info:t,metadata:i,contentDispositionFilename:n,contentLength:r}=await e.getMetadata();if(e!==this.pdfDocument)return;this.documentInfo=t;this.metadata=i;this._contentDispositionFilename??(this._contentDispositionFilename=n);this._contentLength??(this._contentLength=r);console.log(`PDF ${e.fingerprints[0]} [${t.PDFFormatVersion} ${(t.Producer||"-").trim()} / ${(t.Creator||"-").trim()}] (PDF.js: ${s.version||"?"} [${s.build||"?"}])  modified by ngx-extended-pdf-viewer`);let a=t.Title;const o=null==i?void 0:i.get("dc:title");o&&("Untitled"===o||/[\uFFF0-\uFFFF]/g.test(o)||(a=o));a?this.setTitle(`${a} - ${this._contentDispositionFilename||this._title}`):this._contentDispositionFilename&&this.setTitle(this._contentDispositionFilename);!t.IsXFAPresent||t.IsAcroFormPresent||e.isPureXfa?!t.IsAcroFormPresent&&!t.IsXFAPresent||this.pdfViewer.renderForms||console.warn("Warning: Interactive form support is not enabled"):e.loadingParams.enableXfa?Window.ngxConsole.warn("Warning: XFA Foreground documents are not supported"):Window.ngxConsole.warn("Warning: XFA support is not enabled");t.IsSignaturesPresent&&console.warn("Warning: Digital signatures validation is not supported");this.eventBus.dispatch("metadataloaded",{source:this})},async _initializePageLabels(e){const t=await e.getPageLabels();if(e!==this.pdfDocument)return;if(!t||r.AppOptions.get("disablePageLabels"))return;const i=t.length;let n=0,s=0;for(let e=0;e<i;e++){const i=t[e];if(i===(e+1).toString())n++;else{if(""!==i)break;s++}}if(n>=i||s>=i)return;const{pdfViewer:a,pdfThumbnailViewer:o,toolbar:l}=this;a.setPageLabels(t);null==o||o.setPageLabels(t);null==l||l.setPagesCount(i,!0);null==l||l.setPageNumber(a.currentPageNumber,a.currentPageLabel)},_initializePdfHistory(e){let{fingerprint:t,viewOnLoad:i,initialDest:n=null}=e;if(this.pdfHistory){this.pdfHistory.initialize({fingerprint:t,resetHistory:i===I,updateUrl:r.AppOptions.get("historyUpdateUrl")});if(this.pdfHistory.initialBookmark){this.initialBookmark=this.pdfHistory.initialBookmark;this.initialRotation=this.pdfHistory.initialRotation}if(n&&!this.initialBookmark&&i===k){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};t.onAnnotationEditor=e=>{this._hasAnnotationEditors=!!e;this.setTitle();e&&this.externalServices.reportTelemetry({type:"editing",data:{type:e}})}},setInitialView(e){var t,i,s;let{rotation:r,sidebarView:a,scrollMode:o,spreadMode:l}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const setRotation=e=>{(0,n.isValidRotation)(e)&&(this.pdfViewer.pagesRotation=e)};this.isInitialViewSet=!0;null===(t=this.pdfSidebar)||void 0===t||t.setInitialView(a);((e,t)=>{(0,n.isValidScrollMode)(e)&&(this.pdfViewer.scrollMode=e);(0,n.isValidSpreadMode)(t)&&(this.pdfViewer.spreadMode=t)})(o,l);if(this.initialBookmark){setRotation(this.initialRotation);delete this.initialRotation;this.pdfLinkService.setHash(this.initialBookmark);this.initialBookmark=null}else if(e){setRotation(r);this.pdfLinkService.setHash(e)}null===(i=this.toolbar)||void 0===i||i.setPageNumber(this.pdfViewer.currentPageNumber,this.pdfViewer.currentPageLabel);null===(s=this.secondaryToolbar)||void 0===s||s.setPageNumber(this.pdfViewer.currentPageNumber);if(!this.pdfViewer.currentScaleValue){const e=PDFViewerApplicationOptions.get("defaultZoomValue");e&&(this.pdfViewer.currentScaleValue=e)}},_cleanup(){var e;if(this.pdfDocument){this.pdfViewer.cleanup();null===(e=this.pdfThumbnailViewer)||void 0===e||e.cleanup();this.pdfDocument.cleanup(this.pdfViewer.renderer===n.RendererType.SVG)}},forceRendering(){var e;this.pdfRenderingQueue.printing=!!this.printService;this.pdfRenderingQueue.isThumbnailViewEnabled=(null===(e=this.pdfSidebar)||void 0===e?void 0:e.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=r.AppOptions.get("printResolution"),n=this.pdfViewer.optionalContentConfigPromise,s=O.instance.createPrintService(this.pdfDocument,e,t,i,n,this._printAnnotationStoragePromise,this.l10n,this.pdfViewer.eventBus);this.printService=s;this.forceRendering();this.setTitle();s.layout();this._hasAnnotationEditors&&this.externalServices.reportTelemetry({type:"editing",data:{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();this.setTitle()},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("pagerender",webViewerPageRender);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(r.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;!function addWindowResolutionChange(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&function webViewerResolutionChange(e){R.pdfViewer.refresh()}();const i=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`);i.addEventListener("change",addWindowResolutionChange,{once:!0});t.removeWindowResolutionChange||(t.removeWindowResolutionChange=function(){i.removeEventListener("change",addWindowResolutionChange);t.removeWindowResolutionChange=null})}();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("touchstart",webViewerTouchStart,{passive:!1});window.addEventListener("touchmove",webViewerTouchMove,{passive:!1});window.addEventListener("touchend",webViewerTouchEnd,{passive:!1});window.addEventListener("click",webViewerClick);window.addEventListener("keydown",webViewerKeyDown);window.addEventListener("keyup",webViewerKeyUp);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("pagerender",webViewerPageRender);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(){var e;const{_boundEvents:t}=this;window.removeEventListener("visibilitychange",webViewerVisibilityChange);window.removeEventListener("wheel",webViewerWheel,{passive:!1});window.removeEventListener("touchstart",webViewerTouchStart,{passive:!1});window.removeEventListener("touchmove",webViewerTouchMove,{passive:!1});window.removeEventListener("touchend",webViewerTouchEnd,{passive:!1});window.removeEventListener("click",webViewerClick);window.removeEventListener("keydown",webViewerKeyDown);window.removeEventListener("keyup",webViewerKeyUp);window.removeEventListener("resize",t.windowResize);window.removeEventListener("hashchange",t.windowHashChange);window.removeEventListener("beforeprint",t.windowBeforePrint);window.removeEventListener("afterprint",t.windowAfterPrint);window.removeEventListener("updatefromsandbox",t.windowUpdateFromSandbox);null===(e=t.removeWindowResolutionChange)||void 0===e||e.call(t);t.windowResize=null;t.windowHashChange=null;t.windowBeforePrint=null;t.windowAfterPrint=null;t.windowUpdateFromSandbox=null},_accumulateTicks(e,t){(this[t]>0&&e<0||this[t]<0&&e>0)&&(this[t]=0);this[t]+=e;const i=Math.trunc(this[t]);this[t]-=i;return i},_accumulateFactor(e,t,i){if(1===t)return 1;(this[i]>1&&t<1||this[i]<1&&t>1)&&(this[i]=1);const n=Math.floor(e*t*this[i]*100)/(100*e);this[i]=t/n;return n},_centerAtPos(e,t,i){const{pdfViewer:n}=this,s=n.currentScale/e-1;if(0!==s){const[e,r]=n.containerTopLeft;n.container.scrollLeft+=(t-r)*s;n.container.scrollTop+=(i-e)*s}},_unblockDocumentLoadEvent(){var e,t;null===(e=(t=document).blockUnblockOnload)||void 0===e||e.call(t,!1);this._unblockDocumentLoadEvent=()=>{}},get scriptingReady(){return this.pdfScriptingManager.ready}};t.PDFViewerApplication=R;{const e=["null","http://mozilla.github.io","https://mozilla.github.io"];var validateFileURL=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){R.onError&&R.onError(e);R.l10n.get("loading_error").then((t=>{R._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 s=R.pdfViewer.getPageView(n-1);globalThis.Stats.add(n,null==s||null===(i=s.pdfPage)||void 0===i?void 0:i.stats)}function webViewerInitialized(){const{appConfig:e,eventBus:t,l10n:i}=R;let s;const a=document.location.search.substring(1);s=(0,n.parseQueryString)(a).get("file")??r.AppOptions.get("defaultUrl");validateFileURL(s);const o=e.openFileInput;o.value=null;o.addEventListener("change",(function(e){const{files:i}=e.target;i&&0!==i.length&&t.dispatch("fileinputchange",{source:this,fileInput:e.target})}));e.mainContainer.addEventListener("dragover",(function(e){if(r.AppOptions.get("enableDragAndDrop")){e.preventDefault();e.dataTransfer.dropEffect="copy"===e.dataTransfer.effectAllowed?"copy":"move"}}));e.mainContainer.addEventListener("drop",(function(e){if(r.AppOptions.get("enableDragAndDrop")){e.preventDefault();const{files:t}=e.dataTransfer;if(!t||0===t.length)return;R.eventBus.dispatch("fileinputchange",{source:this,fileInput:e.dataTransfer,dropEvent:e})}}));if(!R.supportsDocumentFonts){r.AppOptions.set("disableFontFace",!0);i.get("web_fonts_disabled").then((e=>{Window.ngxConsole.warn(e)}))}if(!R.supportsPrinting){var l,c;null===(l=e.toolbar)||void 0===l||l.print.classList.add("hidden");null===(c=e.secondaryToolbar)||void 0===c||c.printButton.classList.add("hidden")}if(!R.supportsFullscreen){var d;null===(d=e.secondaryToolbar)||void 0===d||d.presentationModeButton.classList.add("hidden")}if(R.supportsIntegratedFind){var h;null===(h=e.toolbar)||void 0===h||h.viewFind.classList.add("hidden")}e.mainContainer.addEventListener("transitionend",(function(e){e.target===this&&t.dispatch("resize",{source:this})}),!0);try{s?R.open({url:s}):R._hideViewBookmark()}catch(e){R.onError&&R.onError(e);i.get("loading_error").then((t=>{R._documentError(t,e)}))}}function webViewerPageRender(e){let{pageNumber:t}=e;if(t===R.page){var i;null===(i=R.toolbar)||void 0===i||i.updateLoadingIndicatorState(!0)}}function webViewerPageRendered(e){var t;let{pageNumber:i,error:s}=e;if(i===R.page){var r;null===(r=R.toolbar)||void 0===r||r.updateLoadingIndicatorState(!1)}if((null===(t=R.pdfSidebar)||void 0===t?void 0:t.visibleView)===n.SidebarView.THUMBS){var a;const e=R.pdfViewer.getPageView(i-1),t=null===(a=R.pdfThumbnailViewer)||void 0===a?void 0:a.getThumbnail(i-1);e&&t&&t.setImage(e)}s&&R.l10n.get("rendering_error").then((e=>{R._otherError(e,s)}))}function webViewerPageMode(e){var t;let i,{mode:s}=e;switch(s){case"thumbs":i=n.SidebarView.THUMBS;break;case"bookmarks":case"outline":i=n.SidebarView.OUTLINE;break;case"attachments":i=n.SidebarView.ATTACHMENTS;break;case"layers":i=n.SidebarView.LAYERS;break;case"none":i=n.SidebarView.NONE;break;default:Window.ngxConsole.error('Invalid "pagemode" hash parameter: '+s);return}null===(t=R.pdfSidebar)||void 0===t||t.switchView(i,!0)}function webViewerNamedAction(e){var t;switch(e.action){case"GoToPage":null===(t=R.appConfig.toolbar)||void 0===t||t.pageNumber.select();break;case"Find":R.supportsIntegratedFind||null==R||R.findBar.toggle();break;case"Print":R.triggerPrinting();break;case"SaveAs":R.downloadOrSave()}}function webViewerPresentationModeChanged(e){R.pdfViewer.presentationModeState=e.state}function webViewerSidebarViewChanged(e){let{view:t}=e;R.pdfRenderingQueue.isThumbnailViewEnabled=t===n.SidebarView.THUMBS;if(R.isInitialViewSet){var i;null===(i=R.store)||void 0===i||i.set("sidebarView",t).catch((()=>{}))}}function webViewerUpdateViewarea(e){let{location:t}=e;if(R.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=R.store)||void 0===i||i.setMultiple(e).catch((()=>{}))}if(R.appConfig.secondaryToolbar){const e=R.pdfLinkService.getAnchorUrl(t.pdfOpenParams);R.appConfig.secondaryToolbar.viewBookmarkButton.href=e}}function webViewerScrollModeChanged(e){if(R.isInitialViewSet&&!R.pdfViewer.isInPresentationMode){var t;null===(t=R.store)||void 0===t||t.set("scrollMode",e.mode).catch((()=>{}))}}function webViewerSpreadModeChanged(e){if(R.isInitialViewSet&&!R.pdfViewer.isInPresentationMode){var t;null===(t=R.store)||void 0===t||t.set("spreadMode",e.mode).catch((()=>{}))}}function webViewerResize(){const{pdfDocument:e,pdfViewer:t,pdfRenderingQueue:i}=R;if(i.printing&&window.matchMedia("print").matches)return;if(!e)return;const n=t.currentScaleValue;"auto"!==n&&"page-fit"!==n&&"page-width"!==n||(t.currentScaleValue=n);t.update()}function webViewerHashchange(e){var t;const i=e.hash;i&&(R.isInitialViewSet?null!==(t=R.pdfHistory)&&void 0!==t&&t.popStateInProgress||R.pdfLinkService.setHash(i):R.initialBookmark=i)}var webViewerFileInputChange=function(e){var t;if(null!==(t=R.pdfViewer)&&void 0!==t&&t.isInPresentationMode)return;const i=e.fileInput.files[0];R.open({url:URL.createObjectURL(i),originalUrl:i.name});window.setNgxExtendedPdfViewerSource&&window.setNgxExtendedPdfViewerSource(i.name?i.name:URL.createObjectURL(i))},webViewerOpenFile=function(e){R.appConfig.openFileInput.click()};function webViewerPresentationMode(){R.requestPresentationMode()}function webViewerSwitchAnnotationEditorMode(e){R.pdfViewer.annotationEditorMode=e.mode}function webViewerSwitchAnnotationEditorParams(e){R.pdfViewer.annotationEditorParams=e}function webViewerPrint(){R.triggerPrinting()}function webViewerDownload(){R.downloadOrSave()}function webViewerFirstPage(){R.page=1}function webViewerLastPage(){R.page=R.pagesCount}function webViewerNextPage(){R.pdfViewer.nextPage()}function webViewerPreviousPage(){R.pdfViewer.previousPage()}function webViewerZoomIn(){R.zoomIn()}function webViewerZoomOut(){R.zoomOut()}function webViewerZoomReset(){R.zoomReset()}function webViewerPageNumberChanged(e){const t=R.pdfViewer;""!==e.value&&R.pdfLinkService.goToPage(e.value);if(e.value!==t.currentPageNumber.toString()&&e.value!==t.currentPageLabel){var i;null===(i=R.toolbar)||void 0===i||i.setPageNumber(t.currentPageNumber,t.currentPageLabel)}}function webViewerScaleChanged(e){R.pdfViewer.currentScaleValue=e.value}function webViewerRotateCw(){R.rotatePages(90)}function webViewerRotateCcw(){R.rotatePages(-90)}function webViewerOptionalContentConfig(e){R.pdfViewer.optionalContentConfigPromise=e.promise}function webViewerSwitchScrollMode(e){R.pdfViewer.scrollMode=e.mode}function webViewerSwitchSpreadMode(e){R.pdfViewer.spreadMode=e.mode}function webViewerDocumentProperties(){var e;null===(e=R.pdfDocumentProperties)||void 0===e||e.open()}function webViewerFindFromUrlHash(e){R.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;R.supportsIntegratedFind?R.externalServices.updateFindMatchesCount(t):R.findBar.updateResultsCount(t)}function webViewerUpdateFindControlState(e){let{state:t,previous:i,matchesCount:n,rawQuery:s}=e;if(R.supportsIntegratedFind)R.externalServices.updateFindControlState({result:t,findPrevious:i,matchesCount:n,rawQuery:s});else{var r;null===(r=R.findBar)||void 0===r||r.updateUIState(t,i,n)}}function webViewerScaleChanging(e){var t;null===(t=R.toolbar)||void 0===t||t.setPageScale(e.presetValue,e.scale);R.pdfViewer.update()}function webViewerRotationChanging(e){R.pdfThumbnailViewer&&(R.pdfThumbnailViewer.pagesRotation=e.pagesRotation);R.forceRendering();R.pdfViewer.currentPageNumber=e.pageNumber}function webViewerPageChanging(e){var t,i,s,r;let{pageNumber:a,pageLabel:o}=e;null===(t=R.toolbar)||void 0===t||t.setPageNumber(a,o);null===(i=R.secondaryToolbar)||void 0===i||i.setPageNumber(a);if((null===(s=R.pdfSidebar)||void 0===s?void 0:s.visibleView)===n.SidebarView.THUMBS){var l;null===(l=R.pdfThumbnailViewer)||void 0===l||l.scrollThumbnailIntoView(a)}const c=R.pdfViewer.getPageView(a-1);null===(r=R.toolbar)||void 0===r||r.updateLoadingIndicatorState((null==c?void 0:c.renderingState)===n.RenderingStates.RUNNING);const d=document.getElementById("pageNumber");if(d){const e=new CustomEvent("page-change");d.dispatchEvent(e)}}function webViewerVisibilityChange(e){"visible"===document.visibilityState&&setZoomDisabledTimeout()}let L=null;function setZoomDisabledTimeout(){L&&clearTimeout(L);L=setTimeout((function(){L=null}),T)}function webViewerWheel(e){const t=document.getElementById("viewerContainer");if(t.parentNode.querySelector(":hover")!==t)return;const{pdfViewer:i,supportedMouseWheelZoomModifierKeys:s,supportsPinchToZoom:r}=R;if(i.isInPresentationMode)return;const a=(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0);if(window.isKeyIgnored&&window.isKeyIgnored(a,"WHEEL"))return;const o=e.deltaMode;let l=Math.exp(-e.deltaY/100);const c=e.ctrlKey&&!R._isCtrlKeyDown&&o===WheelEvent.DOM_DELTA_PIXEL&&0===e.deltaX&&(Math.abs(l-1)<.05||!1)&&0===e.deltaZ;if(c||e.ctrlKey&&s.ctrlKey||e.metaKey&&s.metaKey){e.preventDefault();if(L||"hidden"===document.visibilityState)return;const t=i.currentScale;if(c&&r){l=R._accumulateFactor(t,l,"_wheelUnusedFactor");if(l<1)R.zoomOut(null,l);else{if(!(l>1))return;R.zoomIn(null,l)}}else{const t=(0,n.normalizeWheelEventDirection)(e);let i=0;if(o===WheelEvent.DOM_DELTA_LINE||o===WheelEvent.DOM_DELTA_PAGE)i=Math.abs(t)>=1?Math.sign(t):R._accumulateTicks(t,"_wheelUnusedTicks");else{const e=30;i=R._accumulateTicks(t/e,"_wheelUnusedTicks")}if(i<0)R.zoomOut(-i);else{if(!(i>0))return;R.zoomIn(i)}}R._centerAtPos(t,e.clientX,e.clientY)}else setZoomDisabledTimeout()}function webViewerTouchStart(e){if(R.pdfViewer.isInPresentationMode||e.touches.length<2)return;e.preventDefault();if(2!==e.touches.length){R._touchInfo=null;return}let[t,i]=e.touches;t.identifier>i.identifier&&([t,i]=[i,t]);R._touchInfo={touch0X:t.pageX,touch0Y:t.pageY,touch1X:i.pageX,touch1Y:i.pageY}}function webViewerTouchMove(e){if(!R._touchInfo||2!==e.touches.length)return;const{pdfViewer:t,_touchInfo:i,supportsPinchToZoom:n}=R;let[s,r]=e.touches;s.identifier>r.identifier&&([s,r]=[r,s]);const{pageX:a,pageY:o}=s,{pageX:l,pageY:c}=r,{touch0X:d,touch0Y:h,touch1X:u,touch1Y:p}=i;if(Math.abs(d-a)<=1&&Math.abs(h-o)<=1&&Math.abs(u-l)<=1&&Math.abs(p-c)<=1)return;i.touch0X=a;i.touch0Y=o;i.touch1X=l;i.touch1Y=c;if(d===a&&h===o){const e=u-a,t=p-o,i=l-a,n=c-o,s=e*n-t*i;if(Math.abs(s)>.02*Math.hypot(e,t)*Math.hypot(i,n))return}else if(u===l&&p===c){const e=d-l,t=h-c,i=a-l,n=o-c,s=e*n-t*i;if(Math.abs(s)>.02*Math.hypot(e,t)*Math.hypot(i,n))return}else{if((a-d)*(l-u)+(o-h)*(c-p)>=0)return}e.preventDefault();const g=Math.hypot(a-l,o-c)||1,f=Math.hypot(d-u,h-p)||1,m=t.currentScale;if(n){const e=R._accumulateFactor(m,g/f,"_touchUnusedFactor");if(e<1)R.zoomOut(null,e);else{if(!(e>1))return;R.zoomIn(null,e)}}else{const e=30,t=R._accumulateTicks((g-f)/e,"_touchUnusedTicks");if(t<0)R.zoomOut(-t);else{if(!(t>0))return;R.zoomIn(t)}}R._centerAtPos(m,(a+l)/2,(o+c)/2)}function webViewerTouchEnd(e){if(R._touchInfo){e.preventDefault();R._touchInfo=null;R._touchUnusedTicks=0;R._touchUnusedFactor=1}}function webViewerClick(e){var t,i,n;if(null===(t=R.secondaryToolbar)||void 0===t||!t.isOpen)return;const s=R.appConfig;if(R.pdfViewer.containsElement(e.target)||null!==(i=s.toolbar)&&void 0!==i&&i.container.contains(e.target)&&e.target!==(null===(n=s.secondaryToolbar)||void 0===n?void 0:n.toggleButton)){if(e.target&&e.target.parentElement===s.secondaryToolbar.toggleButton)return;if(e.target&&e.target.parentElement&&e.target.parentElement.parentElement===s.secondaryToolbar.toggleButton)return;R.secondaryToolbar.close()}}function webViewerKeyUp(e){"Control"===e.key&&(R._isCtrlKeyDown=!1)}function webViewerKeyDown(e){var t,i,s,r,a;R._isCtrlKeyDown="Control"===e.key;if(R.overlayManager.active)return;const{eventBus:o,pdfViewer:l}=R,c=l.isInPresentationMode;let d=!1,h=!1;const u=(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0);if(window.isKeyIgnored&&window.isKeyIgnored(u,e.keyCode))return;if(1===u||8===u||5===u||12===u)switch(e.keyCode){case 70:if(!R.supportsIntegratedFind&&!e.shiftKey){var p;null===(p=R.findBar)||void 0===p||p.open();d=!0}break;case 71:if(!R.supportsIntegratedFind){const{state:e}=R.findController;if(e){const t={source:window,type:"again",findPrevious:5===u||12===u};o.dispatch("find",{...e,...t})}d=!0}break;case 61:case 107:case 187:case 171:R.zoomIn();d=!0;break;case 173:case 109:case 189:R.zoomOut();d=!0;break;case 48:case 96:if(!c){setTimeout((function(){R.zoomReset()}));d=!1}break;case 38:if(c||R.page>1){R.page=1;d=!0;h=!0}break;case 40:if(c||R.page<R.pagesCount){R.page=R.pagesCount;d=!0;h=!0}}if(1===u||8===u)switch(e.keyCode){case 83:o.dispatch("download",{source:window});d=!0;break;case 79:o.dispatch("openfile",{source:window});d=!0}if(3===u||10===u)switch(e.keyCode){case 80:R.requestPresentationMode();d=!0;R.externalServices.reportTelemetry({type:"buttons",data:{id:"presentationModeKeyboard"}});break;case 71:if(R.appConfig.toolbar){R.appConfig.toolbar.pageNumber.select();d=!0}}if(d){h&&!c&&l.focus();e.preventDefault();return}const g=(0,n.getActiveOrFocusedElement)(),f=null==g?void 0:g.tagName.toUpperCase();if(!("INPUT"===f||"TEXTAREA"===f||"SELECT"===f||null!=g&&g.isContentEditable)||27===e.keyCode){if(0===u){let o=0,u=!1;switch(e.keyCode){case 38:case 33:l.isVerticalScrollbarEnabled&&(u=!0);o=-1;break;case 8:c||(u=!0);o=-1;break;case 37:l.isHorizontalScrollbarEnabled&&(u=!0);case 75:case 80:o=-1;break;case 27:if(null!==(t=R.secondaryToolbar)&&void 0!==t&&t.isOpen){R.secondaryToolbar.close();d=!0}if(!R.supportsIntegratedFind&&null!==(i=R.findBar)&&void 0!==i&&i.opened){R.findBar.close();d=!0}break;case 40:case 34:l.isVerticalScrollbarEnabled&&(u=!0);o=1;break;case 13:case 32:c||(u=!0);o=1;break;case 39:l.isHorizontalScrollbarEnabled&&(u=!0);case 74:case 78:o=1;break;case 36:if(c||R.page>1){R.page=1;d=!0;h=!0}break;case 35:if(c||R.page<R.pagesCount){R.page=R.pagesCount;d=!0;h=!0}break;case 83:null===(s=R.pdfCursorTools)||void 0===s||s.switchTool(n.CursorTool.SELECT);break;case 72:null===(r=R.pdfCursorTools)||void 0===r||r.switchTool(n.CursorTool.HAND);break;case 82:R.rotatePages(90);break;case 115:null===(a=R.pdfSidebar)||void 0===a||a.toggle()}if(0!==o&&(!u||"page-fit"===l.currentScaleValue)){o>0?l.nextPage():l.previousPage();d=!0}}if(4===u)switch(e.keyCode){case 13:case 32:if(!c&&"page-fit"!==l.currentScaleValue)break;l.previousPage();d=!0;break;case 82:R.rotatePages(-90)}h&&!l.containsElement(g)&&l.focus();d&&e.preventDefault()}}function beforeUnload(e){e.preventDefault();e.returnValue="";return!1}const O={instance:{supportsPrinting:!1,createPrintService(){throw new Error("Not implemented: createPrintService")}}};t.PDFPrintServiceFactory=O},(e,t)=>{"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.CursorTool=t.AutoPrintRegExp=void 0;t.apiPageLayoutToViewerModes=function apiPageLayoutToViewerModes(e){let t=n.VERTICAL,i=s.NONE;switch(e){case"SinglePage":t=n.PAGE;break;case"OneColumn":break;case"TwoPageLeft":t=n.PAGE;case"TwoColumnLeft":i=s.ODD;break;case"TwoPageRight":t=n.PAGE;case"TwoColumnRight":i=s.EVEN}return{scrollMode:t,spreadMode:i}};t.apiPageModeToSidebarView=function apiPageModeToSidebarView(e){switch(e){case"UseNone":return i.NONE;case"UseThumbs":return i.THUMBS;case"UseOutlines":return i.OUTLINE;case"UseAttachments":return i.ATTACHMENTS;case"UseOC":return i.LAYERS}return i.NONE};t.approximateFraction=function approximateFraction(e){if(Math.floor(e)===e)return[e,1];const t=1/e;if(t>8)return[1,8];if(Math.floor(t)===t)return[1,t];const i=e>1?t:e;let n,s=0,r=1,a=1,o=1;for(;;){const e=s+a,t=r+o;if(t>8)break;if(i<=e/t){a=e;o=t}else{s=e;r=t}}n=i-s/r<a/o-i?i===e?[s,r]:[r,s]:i===e?[a,o]:[o,a];return n};t.backtrackBeforeAllVisibleElements=backtrackBeforeAllVisibleElements;t.binarySearchFirstItem=binarySearchFirstItem;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[s,r,a,o]=t,l=n%180!=0,c=(a-s)/72*i,d=(o-r)/72*i;return{width:l?d:c,height:l?c:d}};t.getVisibleElements=function getVisibleElements(e){let{scrollEl:t,views:i,sortByVisibility:n=!1,horizontal:s=!1,rtl:r=!1}=e;const a=t.scrollTop,o=a+t.clientHeight,l=t.scrollLeft,c=l+t.clientWidth;const d=[],h=new Set,u=i.length;let p=binarySearchFirstItem(i,s?function isElementNextAfterViewHorizontally(e){const t=e.div,i=t.offsetLeft+t.clientLeft,n=i+t.clientWidth;return r?i<c:n>l}:function isElementBottomAfterViewTop(e){const t=e.div;return t.offsetTop+t.clientTop+t.clientHeight>a});p>0&&p<u&&!s&&(p=backtrackBeforeAllVisibleElements(p,i,a));let g=s?c:-1;for(let e=p;e<u;e++){const t=i[e],n=t.div,r=n.offsetLeft+n.clientLeft,u=n.offsetTop+n.clientTop,p=n.clientWidth,f=n.clientHeight,m=r+p,v=u+f;if(-1===g)v>=o&&(g=v);else if((s?r:u)>g)break;if(v<=a||u>=o||m<=l||r>=c)continue;const _=Math.max(0,a-u)+Math.max(0,v-o),b=(p-(Math.max(0,l-r)+Math.max(0,m-c)))/p,w=(f-_)/f*b*100|0;d.push({id:t.id,x:r,y:u,view:t,percent:w,widthPercent:100*b|0});h.add(t.id)}const f=d[0],m=d.at(-1);n&&d.sort((function(e,t){const i=e.percent-t.percent;return Math.abs(i)>.001?-i:e.id-t.id}));return{first:f,last:m,views:d,ids:h}};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(n).includes(e)&&e!==n.UNKNOWN};t.isValidSpreadMode=function isValidSpreadMode(e){return Number.isInteger(e)&&Object.values(s).includes(e)&&e!==s.UNKNOWN};t.noContextMenuHandler=function noContextMenuHandler(e){e.preventDefault()};t.normalizeWheelEventDelta=function normalizeWheelEventDelta(e){const t=e.deltaMode;let i=normalizeWheelEventDirection(e);t===WheelEvent.DOM_DELTA_PIXEL?i/=900:t===WheelEvent.DOM_DELTA_LINE&&(i/=30);return i};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(a," "));return e.replace(r,"")};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 s=e.offsetParent;if(!s){Window.ngxConsole.error("offsetParent is not set -- cannot scroll");return}let r=e.offsetTop+e.clientTop,a=e.offsetLeft+e.clientLeft;for(;s.clientHeight===s.scrollHeight&&s.clientWidth===s.scrollWidth||i&&(s.classList.contains("markedContent")||"hidden"===getComputedStyle(s).overflow);){r+=s.offsetTop;a+=s.offsetLeft;s=s.offsetParent;if(!s){if(n&&document.body.clientHeight>r){r-=32;window.scrollTo(window.scrollX,r)}return}}if(t){void 0!==t.top&&(r+=t.top);if(void 0!==t.left){a+=t.left;s.scrollLeft=a}}s.scrollTop=r};t.watchScroll=function watchScroll(e,t){const debounceScroll=function(s){n||(n=window.requestAnimationFrame((function viewAreaElementScrolled(){n=null;const s=e.scrollLeft,r=i.lastX;s!==r&&(i.right=s>r);i.lastX=s;const a=e.scrollTop,o=i.lastY;a!==o&&(i.down=a>o);i.lastY=a;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};t.DEFAULT_SCALE_VALUE="auto";t.DEFAULT_SCALE=1;t.DEFAULT_SCALE_DELTA=1.1;t.MIN_SCALE=.1;t.MAX_SCALE=10;t.UNKNOWN_SCALE=0;t.MAX_AUTO_SCALE=1.25;t.SCROLLBAR_PADDING=40;t.VERTICAL_PADDING=5;t.RenderingStates={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};t.PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};const i={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4};t.SidebarView=i;t.RendererType={CANVAS:"canvas",SVG:"svg"};t.TextLayerMode={DISABLE:0,ENABLE:1};const n={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3};t.ScrollMode=n;const s={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};t.SpreadMode=s;t.CursorTool={SELECT:0,HAND:1,ZOOM:2};t.AutoPrintRegExp=/\bprint\s*\(/;t.OutputScale=class OutputScale{constructor(){const e=window.devicePixelRatio||1;this.sx=e;this.sy=e}get scaled(){return 1!==this.sx||1!==this.sy}};const r=/\x00/g,a=/[\x01-\x1F]/g;function binarySearchFirstItem(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.length-1;if(n<0||!t(e[n]))return e.length;if(t(e[i]))return i;for(;i<n;){const s=i+n>>1;t(e[s])?n=s:i=s+1}return i}function backtrackBeforeAllVisibleElements(e,t,i){if(e<2)return e;let n=t[e].div,s=n.offsetTop+n.clientTop;if(s>=i){n=t[e-1].div;s=n.offsetTop+n.clientTop}for(let i=e-2;i>=0;--i){n=t[i].div;if(n.offsetTop+n.clientTop+n.clientHeight<=s)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 o=new Promise((function(e){window.ngxZone.runOutsideAngular((()=>{window.requestAnimationFrame(e)}))}));t.animationStarted=o;const l=document.documentElement.style;t.docStyle=l;t.ProgressBar=class ProgressBar{#y=null;#P=null;#S=0;#A=null;#w=!0;constructor(e){this.#y=e.classList;this.#A=e.style}get percent(){return this.#S}set percent(e){this.#S=function clamp(e,t,i){return Math.min(Math.max(e,t),i)}(e,0,100);if(isNaN(e))this.#y.add("indeterminate");else{this.#y.remove("indeterminate");this.#A.setProperty("--progressBar-percent",`${this.#S}%`)}}setWidth(e){if(!e)return;const t=e.parentNode.offsetWidth-e.offsetWidth;t>0&&this.#A.setProperty("--progressBar-end-offset",`${t}px`)}setDisableAutoFetch(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3;if(!isNaN(this.#S)){this.#P&&clearTimeout(this.#P);this.show();this.#P=setTimeout((()=>{this.#P=null;this.hide()}),e)}}hide(){if(this.#w){this.#w=!1;this.#y.add("hidden")}}show(){if(!this.#w){this.#w=!0;this.#y.remove("hidden")}}}},e=>{"use strict";e.exports=window["pdfjs-dist/build/pdf"]},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.compatibilityParams=t.OptionKind=t.AppOptions=void 0;const i=Object.create(null);t.compatibilityParams=i;{const e=navigator.userAgent||"",t=navigator.platform||"",n=navigator.maxTouchPoints||1,s=/Android/.test(e),r=/\b(iPad|iPhone|iPod)(?=;)/.test(e)||"MacIntel"===t&&n>1;!function checkCanvasSizeLimitation(){(r||s)&&(i.maxCanvasPixels=5242880)}()}const n={VIEWER:2,API:4,WORKER:8,PREFERENCE:128};t.OptionKind=n;const s={annotationEditorMode:{value:0,kind:n.VIEWER+n.PREFERENCE},annotationMode:{value:2,kind:n.VIEWER+n.PREFERENCE},cursorToolOnLoad:{value:0,kind:n.VIEWER+n.PREFERENCE},defaultZoomDelay:{value:400,kind:n.VIEWER+n.PREFERENCE},defaultZoomValue:{value:"",kind:n.VIEWER+n.PREFERENCE},disableHistory:{value:!1,kind:n.VIEWER},disablePageLabels:{value:!1,kind:n.VIEWER+n.PREFERENCE},enablePermissions:{value:!1,kind:n.VIEWER+n.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:n.VIEWER+n.PREFERENCE},enableScripting:{value:!0,kind:n.VIEWER+n.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:n.VIEWER},externalLinkTarget:{value:0,kind:n.VIEWER+n.PREFERENCE},historyUpdateUrl:{value:!1,kind:n.VIEWER+n.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:n.VIEWER+n.PREFERENCE},imageResourcesPath:{value:"./images/",kind:n.VIEWER},maxCanvasPixels:{value:16777216,kind:n.VIEWER},forcePageColors:{value:!1,kind:n.VIEWER+n.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:n.VIEWER+n.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:n.VIEWER+n.PREFERENCE},pdfBugEnabled:{value:!1,kind:n.VIEWER+n.PREFERENCE},printResolution:{value:150,kind:n.VIEWER},removePageBorders:{value:!1,kind:n.VIEWER+n.PREFERENCE},sidebarViewOnLoad:{value:-1,kind:n.VIEWER+n.PREFERENCE},scrollModeOnLoad:{value:-1,kind:n.VIEWER+n.PREFERENCE},spreadModeOnLoad:{value:-1,kind:n.VIEWER+n.PREFERENCE},textLayerMode:{value:1,kind:n.VIEWER+n.PREFERENCE},useOnlyCssZoom:{value:!1,kind:n.VIEWER+n.PREFERENCE},viewerCssTheme:{value:0,kind:n.VIEWER+n.PREFERENCE},viewOnLoad:{value:0,kind:n.VIEWER+n.PREFERENCE},cMapPacked:{value:!0,kind:n.API},cMapUrl:{value:"../web/cmaps/",kind:n.API},disableAutoFetch:{value:!1,kind:n.API+n.PREFERENCE},disableFontFace:{value:!1,kind:n.API+n.PREFERENCE},disableRange:{value:!1,kind:n.API+n.PREFERENCE},disableStream:{value:!1,kind:n.API+n.PREFERENCE},docBaseUrl:{value:"",kind:n.API},enableXfa:{value:!0,kind:n.API+n.PREFERENCE},fontExtraProperties:{value:!1,kind:n.API},isEvalSupported:{value:!0,kind:n.API},isOffscreenCanvasSupported:{value:!0,kind:n.API},maxImageSize:{value:-1,kind:n.API},pdfBug:{value:!1,kind:n.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:n.API},verbosity:{value:1,kind:n.API},workerPort:{value:null,kind:n.WORKER},workerSrc:{value:"./assets/pdf.worker.js",kind:n.WORKER}};s.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:n.VIEWER};s.disablePreferences={value:!1,kind:n.VIEWER};s.locale={value:navigator.language||"en-US",kind:n.VIEWER};s.renderer={value:"canvas",kind:n.VIEWER+n.PREFERENCE};s.sandboxBundleSrc={value:"../build/pdf.sandbox.js",kind:n.VIEWER};const r=Object.create(null);if(globalThis.pdfDefaultOptions)for(const e in globalThis.pdfDefaultOptions)r[e]=globalThis.pdfDefaultOptions[e];class AppOptions{constructor(){throw new Error("Cannot initialize AppOptions.")}static get(e){const t=r[e];if(void 0!==t)return t;const n=s[e];return void 0!==n?i[e]??n.value:void 0}static getAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=Object.create(null);for(const a in s){const o=s[a];if(e){if(0==(e&o.kind))continue;if(e===n.PREFERENCE){const e=o.value,i=typeof e;if("boolean"===i||"string"===i||"number"===i&&Number.isInteger(e)){t[a]=e;continue}throw new Error(`Invalid type for preference: ${a}`)}}const l=r[a];t[a]=void 0!==l?l:i[a]??o.value}return t}static set(e,t){r[e]=t}static setAll(e){for(const t in e)r[t]=e[t]}static remove(e){delete r[e]}}t.AppOptions=AppOptions;AppOptions._hasUserOptions=function(){return Object.keys(r).length>0}},(e,t)=>{"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:n,delay:s=0}=e;return new Promise((function(e,r){if("object"!=typeof t||!n||"string"!=typeof n||!(Number.isInteger(s)&&s>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function handler(i){t instanceof EventBus?t._off(n,a):t.removeEventListener(n,a);l&&clearTimeout(l);e(i)}const a=handler.bind(null,i.EVENT);t instanceof EventBus?t._on(n,a):t.addEventListener(n,a);const o=handler.bind(null,i.TIMEOUT),l=setTimeout(o,s)}))};const i={EVENT:"event",TIMEOUT:"timeout"};t.WaitOnType=i;class EventBus{#i=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.#i[e];if(!i||0===i.length)return;let n;for(const{listener:s,external:r,once:a}of i.slice(0)){a&&this._off(e,s);r?(n||(n=[])).push(s):s(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.#i)[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.#i[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.SimpleLinkService=t.PDFLinkService=t.LinkTarget=void 0;var n=i(3);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 s="noopener noreferrer nofollow",r={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};t.LinkTarget=r;function addLinkAttributes(e){let{url:t,target:i,rel:a,enabled:o=!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(o)e.href=e.title=l;else{e.href="";e.title=`Disabled: ${l}`;e.onclick=()=>!1}let c="";switch(i){case r.NONE:break;case r.SELF:c="_self";break;case r.BLANK:c="_blank";break;case r.PARENT:c="_parent";break;case r.TOP:c="_top"}e.target=c;e.rel="string"==typeof a?a:s}var a=new WeakMap,o=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,o);!function _classPrivateFieldInitSpec(e,t,i){_checkPrivateRedeclaration(e,t);t.set(e,i)}(this,a,{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,a).clear()}setViewer(e){this.pdfViewer=e}setHistory(e){this.pdfHistory=e}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(e){this.pdfViewer.currentPageNumber=e}get rotation(){return this.pdfViewer.pagesRotation}set rotation(e){this.pdfViewer.pagesRotation=e}get isInPresentationMode(){return this.pdfViewer.isInPresentationMode}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,o,_goToDestinationHelper2).call(this,e,t,i):Window.ngxConsole.error(`PDFLinkService.goToDestination: "${i}" is not a valid destination array, for dest="${e}".`)}goToPage(e){if(!this.pdfDocument)return;const t="string"==typeof e&&this.pdfViewer.pageLabelToPageNumber(e)||0|e;if(Number.isInteger(t)&&t>0&&t<=this.pagesCount){if(this.pdfHistory){this.pdfHistory.pushCurrentPosition();this.pdfHistory.pushPage(t)}if("book"===this.pdfViewer.pageViewMode){if(this.pdfViewer.pageFlip){this.pdfViewer.ensureAdjecentPagesAreLoaded();const e=this.pdfViewer.currentPageNumber-this.pdfViewer.currentPageNumber%2,i=t-t%2;e===i-2?this.pdfViewer.pageFlip.flipNext():e===i+2?this.pdfViewer.pageFlip.flipPrev():this.pdfViewer.pageFlip.turnToPage(t-1)}}else this.pdfViewer.scrollPageIntoView({pageNumber:t})}else Window.ngxConsole.error(`PDFLinkService.goToPage: "${e}" is not a valid page.`)}addLinkAttributes(e,t){addLinkAttributes(e,{url:t,target:arguments.length>2&&void 0!==arguments[2]&&arguments[2]?r.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 s=(0,n.parseQueryString)(e);s.has("search")&&this.eventBus.dispatch("findfromurlhash",{source:this,query:s.get("search").replace(/"/g,""),phraseSearch:"true"===s.get("phrase")});s.has("page")&&(t=0|s.get("page")||1);if(s.has("zoom")){const e=s.get("zoom").split(","),t=e[0],n=parseFloat(t);t.includes("Fit")?"Fit"===t||"FitB"===t?i=[null,{name:t}]:"FitH"===t||"FitBH"===t||"FitV"===t||"FitBV"===t?i=[null,{name:t},e.length>1?0|e[1]:null]:"FitR"===t?5!==e.length?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: "${t}" is not a valid zoom value.`):i=[null,{name:"XYZ"},e.length>1?0|e[1]:null,e.length>2?0|e[2]:null,n?n/100:t]}i?this.pdfViewer.scrollPageIntoView({pageNumber:t||this.page,destArray:i,allowNegativeOffset:!0}):t&&(this.page=t);s.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:s.get("pagemode")});s.has("nameddest")&&this.goToDestination(s.get("nameddest"))}else{i=unescape(e);try{i=JSON.parse(i);Array.isArray(i)||(i=i.toString())}catch(e){}if("string"==typeof i||_classStaticPrivateMethodGet(PDFLinkService,PDFLinkService,_isValidExplicitDestination).call(PDFLinkService,i)){this.goToDestination(i);return}Window.ngxConsole.error(`PDFLinkService.setHash: "${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})}async executeSetOCGState(e){const t=this.pdfDocument,i=await this.pdfViewer.optionalContentConfigPromise;if(t!==this.pdfDocument)return;let n;for(const t of e.state){switch(t){case"ON":case"OFF":case"Toggle":n=t;continue}switch(n){case"ON":i.setVisibility(t,!0);break;case"OFF":i.setVisibility(t,!1);break;case"Toggle":const e=i.getGroup(t);e&&i.setVisibility(t,!e.visible)}}this.pdfViewer.optionalContentConfigPromise=Promise.resolve(i)}cachePageRef(e,t){if(!t)return;const i=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;_classPrivateFieldGet(this,a).set(i,e)}_cachedPageNumber(e){if(!e)return null;const t=0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`;return _classPrivateFieldGet(this,a).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 s;if("object"==typeof n&&null!==n){s=this._cachedPageNumber(n);if(!s){this.pdfDocument.getPageIndex(n).then((s=>{this.cachePageRef(s+1,n);_classPrivateMethodGet(this,o,_goToDestinationHelper2).call(this,e,t,i)})).catch((()=>{Window.ngxConsole.error(`PDFLinkService.#goToDestinationHelper: "${n}" is not a valid page reference, for dest="${e}".`)}));return}}else{if(!Number.isInteger(n)){Window.ngxConsole.error(`PDFLinkService.#goToDestinationHelper: "${n}" is not a valid destination reference, for dest="${e}".`);return}s=n+1}if(!s||s<1||s>this.pagesCount)Window.ngxConsole.error(`PDFLinkService.#goToDestinationHelper: "${s}" is not a valid page number, for dest="${e}".`);else{if(this.pdfHistory){this.pdfHistory.pushCurrentPosition();this.pdfHistory.push({namedDest:t,explicitDest:i,pageNumber:s})}this.pdfViewer.scrollPageIntoView({pageNumber:s,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 s=!0;switch(n.name){case"XYZ":if(5!==t)return!1;break;case"Fit":case"FitB":return 2===t;case"FitH":case"FitBH":case"FitV":case"FitBV":if(3!==t)return!1;break;case"FitR":if(6!==t)return!1;s=!1;break;default:return!1}for(let i=2;i<t;i++){const t=e[i];if(!("number"==typeof t||s&&null===t))return!1}return!0}t.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){}get isInPresentationMode(){return!1}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){}executeSetOCGState(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;var n=i(4);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 s=new WeakSet;t.AnnotationEditorParams=class AnnotationEditorParams{constructor(e,t){_classPrivateMethodInitSpec(this,s);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,s,_bindListeners2).call(this,e)}};function _bindListeners2(e){let{editorFreeTextFontSize:t,editorFreeTextColor:i,editorInkColor:s,editorInkThickness:r,editorInkOpacity:a}=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})}));s.addEventListener("input",(e=>{this.eventBus.dispatch("switchannotationeditorparams",{source:this,type:n.AnnotationEditorParamsType.INK_COLOR,value:s.value})}));r.addEventListener("input",(e=>{this.eventBus.dispatch("switchannotationeditorparams",{source:this,type:n.AnnotationEditorParamsType.INK_THICKNESS,value:r.valueAsNumber})}));a.addEventListener("input",(e=>{this.eventBus.dispatch("switchannotationeditorparams",{source:this,type:n.AnnotationEditorParamsType.INK_OPACITY,value:a.valueAsNumber})}));this.eventBus._on("annotationeditorparamschanged",(e=>{for(const[o,l]of e.details)switch(o){case n.AnnotationEditorParamsType.FREETEXT_SIZE:t.value=l;break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:i.value=l;break;case n.AnnotationEditorParamsType.INK_COLOR:s.value=l;break;case n.AnnotationEditorParamsType.INK_THICKNESS:r.value=l;break;case n.AnnotationEditorParamsType.INK_OPACITY:a.value=l}}))}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.OverlayManager=void 0;t.OverlayManager=class OverlayManager{#E=new WeakMap;#x=null;get active(){return this.#x}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(this.#E.has(e))throw new Error("The overlay is already registered.");this.#E.set(e,{canForceClose:t});if(!e.showModal){i(10).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=>{this.#x=null}))}async unregister(e){if(!this.#E.has(e))throw new Error("The overlay does not exist.");if(this.#x===e)throw new Error("The overlay cannot be removed while it is active.");this.#E.delete(e)}async open(e){if(!this.#E.has(e))throw new Error("The overlay does not exist.");if(this.#x){if(this.#x===e)throw new Error("The overlay is already active.");if(!this.#E.get(e).canForceClose)throw new Error("Another overlay is currently active.");await this.close()}this.#x=e;e.showModal();e.classList.remove("hidden")}async close(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.#x;if(!this.#E.has(e))throw new Error("The overlay does not exist.");if(!this.#x)throw new Error("The overlay is currently not active.");if(this.#x!==e)throw new Error("Another overlay is currently active.");e.close();this.#x=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("*"),s=0;s<n.length&&!(n[s].tagName&&n[s].shadowRoot&&(i=findFocusableElementWithin(n[s].shadowRoot)));s++);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 s=e.target;n=("getRootNode"in s&&s.getRootNode()||document).activeElement}return n&&n.form===i?n:null}function maybeHandleSubmit(e){if(!e.defaultPrevented){var i=e.target,n=t.imagemapUseValue,s=findFormSubmitter(e);null===n&&s&&(n=s.value);var r=findNearestDialog(i);if(r&&"dialog"===(s&&s.getAttribute("formmethod")||i.getAttribute("method"))){e.preventDefault();null!=n?r.close(n):r.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(s){if(s.target===e){var r="DOMNodeRemoved";i|=s.type.substr(0,r.length)===r;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 s=0;s<n.length;++s){var r=n[s],a=null;try{a=document.querySelectorAll(r.selectorText)}catch(e){}if(a&&inNodeList(a,e)){var o=r.style.getPropertyValue("top"),l=r.style.getPropertyValue("bottom");if(o&&"auto"!==o||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 s=n.get;n.get=function(){return isFormMethodDialog(this)?"dialog":s.call(this)};var r=n.set;n.set=function(e){return"string"==typeof e&&"dialog"===e.toLowerCase()?this.setAttribute("method",e):r.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 a=HTMLFormElement.prototype.submit,replacementFormSubmit=function(){if(!isFormMethodDialog(this))return a.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;var n=i(4);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 s=new WeakMap,r=new WeakMap,a=new WeakMap,o=new WeakSet,l=new WeakSet,c=new WeakSet;t.PasswordPrompt=class PasswordPrompt{constructor(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];_classPrivateMethodInitSpec(this,c);_classPrivateMethodInitSpec(this,l);_classPrivateMethodInitSpec(this,o);_classPrivateFieldInitSpec(this,s,{writable:!0,value:null});_classPrivateFieldInitSpec(this,r,{writable:!0,value:null});_classPrivateFieldInitSpec(this,a,{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",this.close.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,l,_cancel2).bind(this))}async open(){_classPrivateFieldGet(this,s)&&await _classPrivateFieldGet(this,s).promise;_classPrivateFieldSet(this,s,(0,n.createPromiseCapability)());try{await this.overlayManager.open(this.dialog);this.input.type="password";this.input.focus()}catch(e){_classPrivateFieldSet(this,s,null);throw e}const e=_classPrivateFieldGet(this,a)===n.PasswordResponses.INCORRECT_PASSWORD;this._isViewerEmbedded&&!e||this.input.focus();this.label.textContent=await this.l10n.get("password_"+(e?"invalid":"label"))}async close(){if(this.overlayManager.active===this.dialog){this.overlayManager.close(this.dialog);this.input.value="";this.input.type="hidden"}}async setUpdateCallback(e,t){_classPrivateFieldGet(this,s)&&await _classPrivateFieldGet(this,s).promise;_classPrivateFieldSet(this,r,e);_classPrivateFieldSet(this,a,t)}};function _verify2(){const e=this.input.value;(null==e?void 0:e.length)>0&&_classPrivateMethodGet(this,c,_invokeCallback2).call(this,e)}function _cancel2(){_classPrivateMethodGet(this,c,_invokeCallback2).call(this,new Error("PasswordPrompt cancelled."));_classPrivateFieldGet(this,s).resolve()}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;var n=i(4),s=i(13),r=i(6);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 a=new WeakSet;class PDFAttachmentViewer extends s.BaseTreeViewer{constructor(e){super(e);_classPrivateMethodInitSpec(this,a);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,a,_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,r.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 s=Object.keys(t).sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())})),r=document.createDocumentFragment();let a=0;for(const e of s){const i=t[e],s=i.content,o=(0,n.getFilenameFromUrl)(i.filename,!0),l=document.createElement("div");l.className="treeItem";const c=document.createElement("a");this._bindLink(c,{content:s,filename:o});c.textContent=this._normalizeTextContent(o);l.append(c);r.append(l);a++}this._finishRendering(r,a)}}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;var n=i(3);const s="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(s);this._currentTreeItem=null}if(e){e.classList.add(s);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.PDFCursorTools=void 0;var n=i(3),s=i(4),r=i(15);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 a=new WeakSet,o=new WeakSet;t.PDFCursorTools=class PDFCursorTools{constructor(e){let{container:t,eventBus:i,cursorToolOnLoad:s=n.CursorTool.SELECT}=e;_classPrivateMethodInitSpec(this,o);_classPrivateMethodInitSpec(this,a);this.container=t;this.eventBus=i;this.active=n.CursorTool.SELECT;this.previouslyActive=null;this.handTool=new r.GrabToPan({element:this.container});_classPrivateMethodGet(this,o,_addEventListeners2).call(this);Promise.resolve().then((()=>{this.switchTool(s)}))}get activeTool(){return this.active}switchTool(e){if(null!==this.previouslyActive)return;if(e===this.active)return;const disableActiveTool=()=>{switch(this.active){case n.CursorTool.SELECT:break;case n.CursorTool.HAND:this.handTool.deactivate();case n.CursorTool.ZOOM:}};switch(e){case n.CursorTool.SELECT:disableActiveTool();break;case n.CursorTool.HAND:disableActiveTool();this.handTool.activate();break;case n.CursorTool.ZOOM:default:Window.ngxConsole.error(`switchTool: "${e}" is an unsupported value.`);return}this.active=e;_classPrivateMethodGet(this,a,_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)}));let e=s.AnnotationEditorType.NONE,t=n.PresentationModeState.NORMAL;const disableActive=()=>{const e=this.active;this.switchTool(n.CursorTool.SELECT);this.previouslyActive??(this.previouslyActive=e)},enableActive=()=>{const i=this.previouslyActive;if(null!==i&&e===s.AnnotationEditorType.NONE&&t===n.PresentationModeState.NORMAL){this.previouslyActive=null;this.switchTool(i)}};this.eventBus._on("secondarytoolbarreset",(i=>{if(null!==this.previouslyActive){e=s.AnnotationEditorType.NONE;t=n.PresentationModeState.NORMAL;enableActive()}}));this.eventBus._on("annotationeditormodechanged",(t=>{let{mode:i}=t;e=i;i===s.AnnotationEditorType.NONE?enableActive():disableActive()}));this.eventBus._on("presentationmodechanged",(e=>{let{state:i}=e;t=i;i===n.PresentationModeState.NORMAL?enableActive():i===n.PresentationModeState.FULLSCREEN&&disableActive()}))}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.GrabToPan=void 0;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 i="grab-to-pan-grab";var n=new WeakSet,s=new WeakSet,r=new WeakSet;t.GrabToPan=class GrabToPan{constructor(e){_classPrivateMethodInitSpec(this,r);_classPrivateMethodInitSpec(this,s);_classPrivateMethodInitSpec(this,n);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,n,_onMouseDown2).bind(this);this._onMouseMove=_classPrivateMethodGet(this,s,_onMouseMove2).bind(this);this._endPan=_classPrivateMethodGet(this,r,_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(i);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(i);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,s=this.scrollLeftStart-t;if(this.element.scrollTo)this.element.scrollTo({top:n,left:s,behavior:"instant"});else{this.element.scrollTop=n;this.element.scrollLeft=s}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:s,right:r,bottom:a,left:o}=n[0].getBoundingClientRect();if(t>=s&&t<=a&&e<=r&&e>=o)return!0}return!1}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFDocumentProperties=void 0;var n=i(4),s=i(3);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 r="-",a=["en-us","en-lr","my"],o={"8.5x11":"Letter","8.5x14":"Legal"},l={"297x420":"A3","210x297":"A4"};function getPageName(e,t,i){return i[`${t?e.width:e.height}x${t?e.height:e.width}`]}var c=new WeakMap,d=new WeakSet,h=new WeakSet,u=new WeakSet,p=new WeakSet,g=new WeakSet,f=new WeakSet;t.PDFDocumentProperties=class PDFDocumentProperties{constructor(e,t,i,n,s){let{dialog:r,fields:o,closeButton:l}=e;_classPrivateMethodInitSpec(this,f);_classPrivateMethodInitSpec(this,g);_classPrivateMethodInitSpec(this,p);_classPrivateMethodInitSpec(this,u);_classPrivateMethodInitSpec(this,h);_classPrivateMethodInitSpec(this,d);!function _classPrivateFieldInitSpec(e,t,i){_checkPrivateRedeclaration(e,t);t.set(e,i)}(this,c,{writable:!0,value:null});this.dialog=r;this.fields=o;this.overlayManager=t;this.l10n=n;this._fileNameLookup=s;_classPrivateMethodGet(this,d,_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=a.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,h,_updateUI2).call(this);return}const{info:i,contentLength:n}=await this.pdfDocument.getMetadata(),[r,a,o,l,d,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,s.getPageSizeInches)(e),t))),_classPrivateMethodGet(this,f,_parseLinearization2).call(this,i.IsLinearized)]);_classPrivateFieldSet(this,c,Object.freeze({fileName:r,fileSize:a,title:i.Title,author:i.Author,subject:i.Subject,keywords:i.Keywords,creationDate:o,modificationDate:l,creator:i.Creator,producer:i.Producer,version:i.PDFFormatVersion,pageCount:this.pdfDocument.numPages,pageSize:d,linearized:m,_currentPageNumber:e,_pagesRotation:t}));_classPrivateMethodGet(this,h,_updateUI2).call(this);const{length:v}=await this.pdfDocument.getDownloadInfo();if(n===v)return;const _=Object.assign(Object.create(null),_classPrivateFieldGet(this,c));_.fileSize=await _classPrivateMethodGet(this,u,_parseFileSize2).call(this,v);_classPrivateFieldSet(this,c,Object.freeze(_));_classPrivateMethodGet(this,h,_updateUI2).call(this)}async close(){this.overlayManager.close(this.dialog)}setDocument(e){if(this.pdfDocument){_classPrivateMethodGet(this,d,_reset2).call(this);_classPrivateMethodGet(this,h,_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(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&_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:r}}else for(const e in this.fields)this.fields[e].textContent=r}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_"+(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,s.isPortraitOrientation)(e);let n={width:Math.round(100*e.width)/100,height:Math.round(100*e.height)/100},r={width:Math.round(25.4*e.width*10)/10,height:Math.round(25.4*e.height*10)/10},a=getPageName(n,i,o)||getPageName(r,i,l);if(!(a||Number.isInteger(r.width)&&Number.isInteger(r.height))){const t={width:25.4*e.width,height:25.4*e.height},s={width:Math.round(r.width),height:Math.round(r.height)};if(Math.abs(t.width-s.width)<.1&&Math.abs(t.height-s.height)<.1){a=getPageName(s,i,l);if(a){n={width:Math.round(s.width/25.4*100)/100,height:Math.round(s.height/25.4*100)/100};r=s}}}const[{width:c,height:d},h,u,p]=await Promise.all([this._isNonMetricLocale?n:r,this.l10n.get("document_properties_page_size_unit_"+(this._isNonMetricLocale?"inches":"millimeters")),a&&this.l10n.get(`document_properties_page_size_name_${a.toLowerCase()}`),this.l10n.get("document_properties_page_size_orientation_"+(i?"portrait":"landscape"))]);return this.l10n.get(`document_properties_page_size_dimension_${u?"name_":""}string`,{width:c.toLocaleString(),height:d.toLocaleString(),unit:h,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_"+(e?"yes":"no"))}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFFindBar=void 0;var n=i(18);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;t.PDFFindBar=class PDFFindBar{constructor(e,t,i){var n;_classPrivateMethodInitSpec(this,s);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,s,_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+"\n",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 r=Promise.resolve(""),a="";switch(e){case n.FindState.FOUND:break;case n.FindState.PENDING:a="pending";break;case n.FindState.NOT_FOUND:r=this.l10n.get("find_not_found");a="notFound";break;case n.FindState.WRAPPED:r=this.l10n.get("find_reached_"+(t?"top":"bottom"))}this.findField.setAttribute("data-status",a);this.findFieldMultiline.classList.toggle("notFound","notFound"===a);this.findFieldMultiline.setAttribute("data-status",a);this.findField.setAttribute("aria-invalid",e===n.FindState.NOT_FOUND);r.then((e=>{this.findMsg.textContent=e;_classPrivateMethodGet(this,s,_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,s,_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,s,_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;var n=i(4),s=i(19),r=i(20),a=i(21),o=i(3);const l={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};t.FindState=l;const c={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4","\n":" "};new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]);const d=/\p{M}+/gu,h=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,u=new Map,p="[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]",g=new Map;let f=null,m=null;function normalize(e){const t=[];let i,n;for(;null!==(i=h.exec(e));){let{index:e}=i;for(const n of i[0]){let i=u.get(n);if(!i){i=n.normalize("NFD").length;u.set(n,i)}t.push([i,e++])}}if(0===t.length&&f)n=f;else if(t.length>0&&m)n=m;else{const e=`([${Object.keys(c).join("")}])|([${"①-⑳Ⓐ-⓿㉄-㊿㋐-㋾＀-￯"}])|(${"(?:゙|゚)"}\\n)|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(${"(?:\\p{Ideographic}|[぀-ヿ])"}\\n)|(\\n)`;n=0===t.length?f=new RegExp(e+"|(\\u0000)","gum"):m=new RegExp(e+`|(${p})`,"gum")}const s=[];for(;null!==(i=d.exec(e));)s.push([i[0].length,i.index]);let r=e.normalize("NFD");const a=[[0,0]];let o=0,l=0,v=0,_=0,b=0,w=!1;r=r.replace(n,((e,i,n,r,d,h,u,p,f,m)=>{var y;m-=_;if(i){const e=c[i],t=e.length;for(let e=1;e<t;e++)a.push([m-v+e,v-e]);v-=t-1;return e}if(n){let e=g.get(n);if(!e){e=n.normalize("NFKC");g.set(n,e)}const t=e.length;for(let e=1;e<t;e++)a.push([m-v+e,v-e]);v-=t-1;return e}if(r){var P;w=!0;if(m+b===(null===(P=s[o])||void 0===P?void 0:P[1]))++o;else{a.push([m-1-v+1,v-1]);v-=1;_+=1}a.push([m-v+1,v]);_+=1;b+=1;return r.charAt(0)}if(d){var S;const e=d.endsWith("\n"),t=e?d.length-2:d.length;w=!0;let i=t;if(m+b===(null===(S=s[o])||void 0===S?void 0:S[1])){i-=s[o][0];++o}for(let e=1;e<=i;e++)a.push([m-1-v+e,v-e]);v-=i;_+=i;if(e){m+=t-1;a.push([m-v+1,1+v]);v+=1;_+=1;b+=1;return d.slice(0,t)}return d}if(h){a.push([m-v+1,1+v]);v+=1;_+=1;b+=1;return h.charAt(0)}if(u){a.push([m-v+1,v]);_+=1;b+=1;return u.charAt(0)}if(p){a.push([m-v+1,v-1]);v-=1;_+=1;b+=1;return" "}if(m+b===(null===(y=t[l])||void 0===y?void 0:y[1])){const e=t[l][0]-1;++l;for(let t=1;t<=e;t++)a.push([m-(v-t),v-t]);v-=e;_+=e}return f}));a.push([r.length,v]);return[r,a,w]}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,s]of t){const t=n+i;if(n>=e)break;if(n+s>e){i+=e-t;break}i+=s}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:s=-1}=e;if(!this._scrollMatches||!t)return;if(-1===s||s!==this._selected.matchIdx)return;if(-1===n||n!==this._selected.pageIdx)return;this._scrollMatches=!1;const r={top:-50,left:i+-400};(0,o.scrollIntoView)(t,r,!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;const e=this._state.query.split("\n").map((e=>normalize(e)[0]));this._normalizedQuery=e.join("\n")}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 s=0,r=e.length;s<r;s++)if(!isSubTerm(s)){t.push(e[s].match);i.push(e[s].matchLength);n.push(e[s].color)}}_isEntireWord(e,t,i){if(t>0){const i=e.charCodeAt(t),n=e.charCodeAt(t-1);if((0,r.getCharacterType)(i)===(0,r.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,r.getCharacterType)(t)===(0,r.getCharacterType)(i))return!1}return!0}_calculateFuzzyMatch(e,t,i,n){const s=[],r=[],o=e.length,l=o<5?o:5,c=Math.round(o/5),d=e.substring(0,l),h={useCollator:!0};for(let t=0;t<i.length-o;t++){const u=i.substring(t,t+l);if(a.Levenshtein.distance(d,u,h)<3){const l=i.substring(t,t+o),d=a.Levenshtein.distance(e,l,h);if(d<=c){if(t+1<i.length-o){const n=i.substring(t+1,t+1+o);if(d>=a.Levenshtein.distance(e,n,h))continue}const l=getOriginalIndex(t,n),c=getOriginalIndex(t+o-1,n)-l+1;s.push(l);r.push(c);t+=o-1}}}this._pageMatches[t]=s;this._pageMatchesLength[t]=r}_calculatePhraseMatch(e,t,i,n,r,a){if(a){i=(0,s.deburr)(i);e=(0,s.deburr)(e)}const o=[],l=[],c=e.length;let d=-c;for(;;){d=i.indexOf(e,d+c);if(-1===d)break;if(r&&!this._isEntireWord(i,d,c))continue;const t=getOriginalIndex(d,n),s=getOriginalIndex(d+c-1,n)-t+1;o.push(t);l.push(s)}this._pageMatches[t]=o;this._pageMatchesLength[t]=l}_calculateWordMatch(e,t,i,n,r,a){if(a){i=(0,s.deburr)(i);e=(0,s.deburr)(e)}const o=[],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],s=t.length;if(0===s)continue;let a=-s;for(;;){a=i.indexOf(t,a+s);if(-1===a)break;if(r&&!this._isEntireWord(i,a,s))continue;const l=getOriginalIndex(a,n),c=getOriginalIndex(a+s-1,n)-l+1;o.push({match:l,matchLength:c,skipped:!1,color:e})}}this._pageMatchesLength[t]=[];this._pageMatchesColor[t]=[];this._pageMatches[t]=[];this._prepareMatches(o,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?arguments[1]:void 0;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 s=i[1].trim();if(s.length>0&&e>Number(s))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:s,entireWord:r,ignoreAccents:a,fuzzySearch:o,phraseSearch:l,currentPage:c,pageRange:d}=this._state;let h=!1;if(c&&e!==this._linkService.page-1){h=!0;this._pageMatches[e]=[]}if(!this._isInPageRanges(e+1,d)){h=!0;this._pageMatches[e]=[]}if(0===n.length)return;if(!h){if(!s){t=t.toLowerCase();n=n.toLowerCase()}o?n.length<=2?this._calculatePhraseMatch(n,e,t,i,!1):this._calculateFuzzyMatch(n,e,t,i):l?this._calculatePhraseMatch(n,e,t,i,r,a):this._calculateWordMatch(n,e,t,i,r,a)}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():c&&!h&&this._updateMatch(!1)}_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,s=[];for(let e=0,t=n.length;e<t;e++){s.push(n[e].str);n[e].hasEOL&&s.push("\n")}[this._pageContents[t],this._pageDiffs[t]]=normalize(s.join(""));i.resolve(t)}),(e=>{Window.ngxConsole.error(`Unable to get text content for page ${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,s=i-1;if(e){n=this._linkService.page-1;s=n}for(let e=n;e<=s;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}if(this.state.currentPage){n.matchIdx=e?t-1:0;this._updateMatch(!0);this._updateUIState(l.WRAPPED);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 s;i+=(null===(s=this._pageMatches[t])||void 0===s?void 0:s.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;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:e,previous:i,matchesCount:this._requestMatchesCount(),rawQuery:(null===(t=this._state)||void 0===t?void 0:t.query)??null})}}},(e,t)=>{"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)&&d.call(e)==n}(e))return p?p.call(e):"";var t=e+"";return"0"==t&&1/e==-i?"-0":t}(e)}(e))&&e.replace(s,c).replace(r,"")};var i=1/0,n="[object Symbol]",s=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,r=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),a="object"==typeof global&&global&&global.Object===Object&&global,o="object"==typeof self&&self&&self.Object===Object&&self,l=a||o||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"}),d=Object.prototype.toString,h=l.Symbol,u=h?h.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=[],s=[];t.Levenshtein=class Levenshtein{static distance(e,t,r){const a=r&&i&&r.useCollator,o=e.length,l=t.length;if(0===o)return l;if(0===l)return o;let c,d,h,u,p,g;for(h=0;h<l;++h){n[h]=h;s[h]=t.charCodeAt(h)}n[l]=l;if(a)for(h=0;h<o;++h){d=h+1;for(u=0;u<l;++u){c=d;g=0===i.compare(e.charAt(h),String.fromCharCode(s[u]));d=n[u]+(g?0:1);p=c+1;d>p&&(d=p);p=n[u+1]+1;d>p&&(d=p);n[u]=c}n[u]=d}else for(h=0;h<o;++h){d=h+1;for(u=0;u<l;++u){c=d;g=e.charCodeAt(h)===s[u];d=n[u]+(g?0:1);p=c+1;d>p&&(d=p);p=n[u+1]+1;d>p&&(d=p);n[u]=c}n[u]=d}return d}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFHistory=void 0;t.isDestArraysEqual=isDestArraysEqual;t.isDestHashesEqual=isDestHashesEqual;var n=i(3),s=i(6);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 s=""!==this._fingerprint&&this._fingerprint!==t;this._fingerprint=t;this._updateUrl=!0===n;this._initialized=!0;this._bindEvents();const r=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(r,!0)||i){const{hash:e,page:t,rotation:n}=this._parseCurrentHash(!0);if(!e||s||i){this._pushOrReplaceState(null,!0);return}this._pushOrReplaceState({hash:e,page:t,rotation:n},!0);return}const a=r.destination;this._updateInternalState(a,r.uid,!0);void 0!==a.rotation&&(this._initialRotation=a.rotation);if(a.dest){this._initialBookmark=JSON.stringify(a.dest);this._destination.page=null}else a.hash?this._initialBookmark=a.hash:a.page&&(this._initialBookmark=`page=${a.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: "${t}" is not a valid namedDest parameter.`);return}if(!Array.isArray(i)){Window.ngxConsole.error(`PDFHistory.push: "${i}" is not a valid explicitDest parameter.`);return}if(!this._isValidPage(n)&&(null!==n||this._destination)){Window.ngxConsole.error(`PDFHistory.push: "${n}" is not a valid pageNumber parameter.`);return}const s=t||JSON.stringify(i);if(!s)return;let r=!1;if(this._destination&&(isDestHashesEqual(this._destination.hash,s)||isDestArraysEqual(this._destination.dest,i))){if(this._destination.page)return;r=!0}if(!this._popStateInProgress||r){this._pushOrReplaceState({dest:i,hash:s,page:n,rotation:this.linkService.rotation},r);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=${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: "${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=`${t}#${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),s=i.get("nameddest")||"";let r=0|i.get("page");(!this._isValidPage(r)||e&&s.length>0)&&(r=null);return{hash:t,page:r,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(),r=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(r){this._blockHashChange++;(0,s.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:1e3}).then((()=>{this._blockHashChange--}))}const a=t.destination;this._updateInternalState(a,t.uid,!0);(0,n.isValidRotation)(a.rotation)&&(this.linkService.rotation=a.rotation);a.dest?this.linkService.goToDestination(a.dest):a.hash?this.linkService.setHash(a.hash):a.page&&(this.linkService.page=a.page);Promise.resolve().then((()=>{this._popStateInProgress=!1}))}_pageHide(){this._destination&&!this._destination.temporary||this._tryPushCurrentPosition()}_bindEvents(){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;var n=i(13);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;class PDFLayerViewer extends n.BaseTreeViewer{constructor(e){super(e);_classPrivateMethodInitSpec(this,s);this.l10n=e.l10n;this.eventBus._on("optionalcontentconfigchanged",(e=>{_classPrivateMethodGet(this,s,_updateLayers2).call(this,e.promise)}));this.eventBus._on("resetlayers",(()=>{_classPrivateMethodGet(this,s,_updateLayers2).call(this)}));this.eventBus._on("togglelayerstree",this._toggleAllTreeItems.bind(this))}reset(){super.reset();this._optionalContentConfig=null;this._optionalContentHash=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._optionalContentHash=this._optionalContentConfig.getHash();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}this._optionalContentHash=t.getHash();const s=document.createDocumentFragment(),r=[{parent:s,groups:n}];let a=0,o=!1;for(;r.length>0;){const e=r.shift();for(const i of e.groups){const n=document.createElement("div");n.className="treeItem";const s=document.createElement("a");n.append(s);if("object"==typeof i){o=!0;this._addToggleButton(n,i);this._setNestedName(s,i);const e=document.createElement("div");e.className="treeItems";n.append(e);r.push({parent:e,groups:i.order})}else{const e=t.getGroup(i),n=document.createElement("input");this._bindLink(s,{groupId:i,input:n});n.type="checkbox";n.checked=e.visible;const r=document.createElement("label");r.textContent=this._normalizeTextContent(e.name);r.append(n);s.append(r);a++}e.parent.append(n)}}this._finishRendering(s,a,o)}}t.PDFLayerViewer=PDFLayerViewer;async function _updateLayers2(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this._optionalContentConfig)return;const t=this._pdfDocument,i=await(e||t.getOptionalContentConfig());if(t===this._pdfDocument){if(e){if(i.getHash()===this._optionalContentHash)return}else this.eventBus.dispatch("optionalcontentconfig",{source:this,promise:Promise.resolve(i)});this.render({optionalContentConfig:i,pdfDocument:this._pdfDocument})}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFOutlineViewer=void 0;var n=i(13),s=i(4),r=i(3);class PDFOutlineViewer extends n.BaseTreeViewer{constructor(e){super(e);this.linkService=e.linkService;this.downloadManager=e.downloadManager;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,s.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,action:s,attachment:r,dest:a,setOCGState:o}=t;const{linkService:l}=this;if(i)l.addLinkAttributes(e,i,n);else if(s){e.href=l.getAnchorUrl("");e.onclick=()=>{l.executeNamedAction(s);return!1}}else if(r){e.href=l.getAnchorUrl("");e.onclick=()=>{this.downloadManager.openOrDownloadData(e,r.content,r.filename);return!1}}else if(o){e.href=l.getAnchorUrl("");e.onclick=()=>{l.executeSetOCGState(o);return!1}}else{e.href=l.getDestinationHash(a);e.onclick=e=>{this._updateCurrentTreeItem(e.target.parentNode);a&&l.goToDestination(a);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,s=!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&&(s=!0)}super._addToggleButton(e,s)}_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(),s=[{parent:n,items:t}];let r=0,a=!1;for(;s.length>0;){const e=s.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){a=!0;this._addToggleButton(i,t);const e=document.createElement("div");e.className="treeItems";i.append(e);s.push({parent:e,items:t.items})}e.parent.append(i);r++}}this._finishRendering(n,r,a)}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===r.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="${i}"]`);if(n){this._scrollToCurrentTreeItem(n.parentNode);break}}}}async _getPageNumberToDestHash(e){if(this._pageNumberToDestHashCapability)return this._pageNumberToDestHashCapability.promise;this._pageNumberToDestHashCapability=(0,s.createPromiseCapability)();const t=new Map,i=new Map,n=[{nesting:0,items:this._outline}];for(;n.length>0;){const s=n.shift(),r=s.nesting;for(const{dest:a,items:o}of s.items){let s,l;if("string"==typeof a){s=await e.getDestination(a);if(e!==this._pdfDocument)return null}else s=a;if(Array.isArray(s)){const[n]=s;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)||r>i.get(l))){const e=this.linkService.getDestinationHash(a);t.set(l,e);i.set(l,r)}}o.length>0&&n.push({nesting:r+1,items:o})}}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;var n=i(3),s=i(4);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 r=3e3,a="pdfPresentationMode",o="pdfPresentationModeControls",l=50,c=.1,d=50,h=Math.PI/6;var u=new WeakMap,p=new WeakMap,g=new WeakSet,f=new WeakSet,m=new WeakSet,v=new WeakSet,_=new WeakSet,b=new WeakSet,w=new WeakSet,y=new WeakSet,P=new WeakSet,S=new WeakSet,A=new WeakSet,E=new WeakSet,x=new WeakSet,C=new WeakSet,M=new WeakSet;t.PDFPresentationMode=class PDFPresentationMode{constructor(e){let{container:t,pdfViewer:i,eventBus:s}=e;_classPrivateMethodInitSpec(this,M);_classPrivateMethodInitSpec(this,C);_classPrivateMethodInitSpec(this,x);_classPrivateMethodInitSpec(this,E);_classPrivateMethodInitSpec(this,A);_classPrivateMethodInitSpec(this,S);_classPrivateMethodInitSpec(this,P);_classPrivateMethodInitSpec(this,y);_classPrivateMethodInitSpec(this,w);_classPrivateMethodInitSpec(this,b);_classPrivateMethodInitSpec(this,_);_classPrivateMethodInitSpec(this,v);_classPrivateMethodInitSpec(this,m);_classPrivateMethodInitSpec(this,f);_classPrivateMethodInitSpec(this,g);_classPrivateFieldInitSpec(this,u,{writable:!0,value:n.PresentationModeState.UNKNOWN});_classPrivateFieldInitSpec(this,p,{writable:!0,value:null});this.container=t;this.pdfViewer=i;this.eventBus=s;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,C,_addFullscreenChangeListeners2).call(this);_classPrivateMethodGet(this,f,_notifyStateChange2).call(this,n.PresentationModeState.CHANGING);const i=e.requestFullscreen();_classPrivateFieldSet(this,p,{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,p).spreadMode=t.spreadMode}t.annotationEditorMode!==s.AnnotationEditorType.DISABLE&&(_classPrivateFieldGet(this,p).annotationEditorMode=t.annotationEditorMode);try{await i;t.focus();return!0}catch(e){_classPrivateMethodGet(this,M,_removeFullscreenChangeListeners2).call(this);_classPrivateMethodGet(this,f,_notifyStateChange2).call(this,n.PresentationModeState.NORMAL)}return!1}get active(){return _classPrivateFieldGet(this,u)===n.PresentationModeState.CHANGING||_classPrivateFieldGet(this,u)===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(),s=this.mouseScrollTimeStamp;if(!(i>s&&i-s<l)){(this.mouseScrollDelta>0&&t<0||this.mouseScrollDelta<0&&t>0)&&_classPrivateMethodGet(this,P,_resetMouseScrollState2).call(this);this.mouseScrollDelta+=t;if(Math.abs(this.mouseScrollDelta)>=c){const e=this.mouseScrollDelta;_classPrivateMethodGet(this,P,_resetMouseScrollState2).call(this);(e>0?this.pdfViewer.previousPage():this.pdfViewer.nextPage())&&(this.mouseScrollTimeStamp=i)}}}function _notifyStateChange2(e){_classPrivateFieldSet(this,u,e);this.eventBus.dispatch("presentationmodechanged",{source:this,state:e})}function _enter2(){_classPrivateMethodGet(this,f,_notifyStateChange2).call(this,n.PresentationModeState.FULLSCREEN);this.container.classList.add(a);setTimeout((()=>{this.pdfViewer.scrollMode=n.ScrollMode.PAGE;null!==_classPrivateFieldGet(this,p).spreadMode&&(this.pdfViewer.spreadMode=n.SpreadMode.NONE);this.pdfViewer.currentPageNumber=_classPrivateFieldGet(this,p).pageNumber;this.pdfViewer.currentScaleValue="page-fit";null!==_classPrivateFieldGet(this,p).annotationEditorMode&&(this.pdfViewer.annotationEditorMode=s.AnnotationEditorType.NONE)}),0);_classPrivateMethodGet(this,A,_addWindowListeners2).call(this);_classPrivateMethodGet(this,w,_showControls2).call(this);this.contextMenuOpen=!1;window.getSelection().removeAllRanges()}function _exit2(){const e=this.pdfViewer.currentPageNumber;this.container.classList.remove(a);setTimeout((()=>{_classPrivateMethodGet(this,M,_removeFullscreenChangeListeners2).call(this);_classPrivateMethodGet(this,f,_notifyStateChange2).call(this,n.PresentationModeState.NORMAL);this.pdfViewer.scrollMode=_classPrivateFieldGet(this,p).scrollMode;null!==_classPrivateFieldGet(this,p).spreadMode&&(this.pdfViewer.spreadMode=_classPrivateFieldGet(this,p).spreadMode);this.pdfViewer.currentScaleValue=_classPrivateFieldGet(this,p).scaleValue;this.pdfViewer.currentPageNumber=e;null!==_classPrivateFieldGet(this,p).annotationEditorMode&&(this.pdfViewer.annotationEditorMode=_classPrivateFieldGet(this,p).annotationEditorMode);_classPrivateFieldSet(this,p,null)}),0);_classPrivateMethodGet(this,E,_removeWindowListeners2).call(this);_classPrivateMethodGet(this,y,_hideControls2).call(this);_classPrivateMethodGet(this,P,_resetMouseScrollState2).call(this);this.contextMenuOpen=!1}function _mouseDown2(e){var t;if(this.contextMenuOpen){this.contextMenuOpen=!1;e.preventDefault()}else if(!(0!==e.button||e.target.href&&null!==(t=e.target.parentNode)&&void 0!==t&&t.hasAttribute("data-internal-link"))){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}),r)}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,s=Math.abs(Math.atan2(n,i));Math.abs(i)>d&&(s<=h||s>=Math.PI-h)?t=i:Math.abs(n)>d&&Math.abs(s-Math.PI/2)<=h&&(t=n);t>0?this.pdfViewer.previousPage():t<0&&this.pdfViewer.nextPage()}}function _addWindowListeners2(){this.showControlsBind=_classPrivateMethodGet(this,w,_showControls2).bind(this);this.mouseDownBind=_classPrivateMethodGet(this,_,_mouseDown2).bind(this);this.mouseWheelBind=_classPrivateMethodGet(this,g,_mouseWheel2).bind(this);this.resetMouseScrollStateBind=_classPrivateMethodGet(this,P,_resetMouseScrollState2).bind(this);this.contextMenuBind=_classPrivateMethodGet(this,b,_contextMenu2).bind(this);this.touchSwipeBind=_classPrivateMethodGet(this,S,_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,m,_enter2).call(this):_classPrivateMethodGet(this,v,_exit2).call(this)}function _addFullscreenChangeListeners2(){this.fullscreenChangeBind=_classPrivateMethodGet(this,x,_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;var n=i(4),s=i(3);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 s=e.views,r=s.length;if(0===r)return null;for(let e=0;e<r;e++){const t=s[e].view;if(!this.isViewFinished(t))return t}const a=e.first.id,o=e.last.id;if(o-a+1>r){const n=e.ids;for(let e=1,s=o-a;e<s;e++){const s=i?a+e:o-e;if(n.has(s))continue;const r=t[s-1];if(!this.isViewFinished(r))return r}}let l=i?o:a-2,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===s.RenderingStates.FINISHED}renderView(e){switch(e.renderingState){case s.RenderingStates.FINISHED:return!1;case s.RenderingStates.PAUSED:this.highestPriorityPage=e.renderingId;e.resume();break;case s.RenderingStates.RUNNING:this.highestPriorityPage=e.renderingId;break;case s.RenderingStates.INITIAL:this.highestPriorityPage=e.renderingId;e.draw().finally((()=>{this.renderHighestPriority()})).catch((e=>{e instanceof n.RenderingCancelledException||Window.ngxConsole.error(`renderView: "${e}"`)}))}return!0}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFScriptingManager=void 0;var n=i(3),s=i(4);t.PDFScriptingManager=class PDFScriptingManager{constructor(e){let{eventBus:t,sandboxBundleSrc:i=null,scriptingFactory:n=null,docPropertiesLookup:s=null}=e;this._pdfDocument=null;this._pdfViewer=null;this._closeCapability=null;this._destroyCapability=null;this._scripting=null;this._ready=!1;this._eventBus=t;this._sandboxBundleSrc=i;this._scriptingFactory=n;this._docPropertiesLookup=s}setViewer(e){this._pdfViewer=e}async setDocument(e){var t;this._pdfDocument&&await this._destroyScripting();this._pdfDocument=e;if(!e)return;const[i,n,s]=await Promise.all([e.getFieldObjects(),e.getCalculationOrderIds(),e.getJSActions()]);if(i||s){if(e===this._pdfDocument){try{this._scripting=this._createScripting()}catch(e){Window.ngxConsole.error(`PDFScriptingManager.setDocument: "${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()}));for(const[e,t]of this._internalEvents)this._eventBus._on(e,t);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:s}});this._eventBus.dispatch("sandboxcreated",{source:this})}catch(e){Window.ngxConsole.error(`PDFScriptingManager.setDocument: "${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)}))}}else await this._destroyScripting()}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 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,s.shadow)(this,"_internalEvents",new Map)}get _pageOpenPending(){return(0,s.shadow)(this,"_pageOpenPending",new Set)}get _visitedPages(){return(0,s.shadow)(this,"_visitedPages",new Map)}async _updateFromSandbox(e){const t=this._pdfViewer.isInPresentationMode||this._pdfViewer.isChangingPresentationMode,{id:i,siblings:s,command:r,value:a}=e;if(!i){switch(r){case"clear":Window.ngxConsole.clear();break;case"error":Window.ngxConsole.error(a);break;case"layout":{if(t)return;const e=(0,n.apiPageLayoutToViewerModes)(a);this._pdfViewer.spreadMode=e.spreadMode;break}case"page-num":this._pdfViewer.currentPageNumber=a+1;break;case"print":await this._pdfViewer.pagesPromise;this._eventBus.dispatch("print",{source:this});break;case"println":Window.ngxConsole.log(a);break;case"zoom":if(t)return;this._pdfViewer.currentScaleValue=a;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 o=s?[i,...s]:[i];for(const t of o){const i=document.querySelector(`[data-element-id="${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,r=this._visitedPages;t&&(this._closeCapability=(0,s.createPromiseCapability)());if(!this._closeCapability)return;const a=this._pdfViewer.getPageView(e-1);if((null==a?void 0:a.renderingState)!==n.RenderingStates.FINISHED){this._pageOpenPending.add(e);return}this._pageOpenPending.delete(e);const o=(async()=>{var t,n;const s=await(r.has(e)?null:null===(t=a.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:s}))})();r.set(e,o)}async _dispatchPageClose(e){var t;const i=this._pdfDocument,n=this._visitedPages;if(!this._closeCapability)return;if(this._pageOpenPending.has(e))return;const s=n.get(e);if(s){n.set(e,null);await s;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,s.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();this._pageOpenPending.clear();this._visitedPages.clear();this._scripting=null;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;var n=i(3);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="pdfSidebarNotification";var r=new WeakSet,a=new WeakSet,o=new WeakSet,l=new WeakSet,c=new WeakSet,d=new WeakSet;t.PDFSidebar=class PDFSidebar{constructor(e){let{elements:t,pdfViewer:i,pdfThumbnailViewer:s,eventBus:h,l10n:u}=e;_classPrivateMethodInitSpec(this,d);_classPrivateMethodInitSpec(this,c);_classPrivateMethodInitSpec(this,l);_classPrivateMethodInitSpec(this,o);_classPrivateMethodInitSpec(this,a);_classPrivateMethodInitSpec(this,r);this.isOpen=!1;this.active=n.SidebarView.THUMBS;this.isInitialViewSet=!1;this.isInitialEventDispatched=!1;this.onToggled=null;this.pdfViewer=i;this.pdfThumbnailViewer=s;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=h;this.l10n=u;_classPrivateMethodGet(this,d,_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,r,_dispatchEvent2).call(this)}else _classPrivateMethodGet(this,r,_dispatchEvent2).call(this)}}switchView(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=e!==this.active;let s=!1;switch(e){case n.SidebarView.NONE:this.isOpen&&this.close();return;case n.SidebarView.THUMBS:this.isOpen&&i&&(s=!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: "${e}" is not a valid view.`);return}this.active=e;const l=e===n.SidebarView.THUMBS,c=e===n.SidebarView.OUTLINE,d=e===n.SidebarView.ATTACHMENTS,h=e===n.SidebarView.LAYERS;this.thumbnailButton.classList.toggle("toggled",l);this.outlineButton.classList.toggle("toggled",c);this.attachmentsButton.classList.toggle("toggled",d);this.layersButton.classList.toggle("toggled",h);this.thumbnailButton.setAttribute("aria-checked",l);this.outlineButton.setAttribute("aria-checked",c);this.attachmentsButton.setAttribute("aria-checked",d);this.layersButton.setAttribute("aria-checked",h);this.thumbnailView.classList.toggle("hidden",!l);this.outlineView.classList.toggle("hidden",!c);this.attachmentsView.classList.toggle("hidden",!d);this.layersView.classList.toggle("hidden",!h);this._outlineOptionsContainer.classList.toggle("hidden",!c);if(!t||this.isOpen){if(s){_classPrivateMethodGet(this,o,_updateThumbnailViewer2).call(this);_classPrivateMethodGet(this,a,_forceRendering2).call(this)}i&&_classPrivateMethodGet(this,r,_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,o,_updateThumbnailViewer2).call(this);_classPrivateMethodGet(this,a,_forceRendering2).call(this);_classPrivateMethodGet(this,r,_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,a,_forceRendering2).call(this);_classPrivateMethodGet(this,r,_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 s=0;s<i;s++){const i=e.getPageView(s);if((null==i?void 0:i.renderingState)===n.RenderingStates.FINISHED){t.getThumbnail(s).setImage(i)}}t.scrollThumbnailIntoView(e.currentPageNumber)}function _showUINotification2(){this.toggleButton.setAttribute("data-l10n-id","toggle_sidebar_notification2");this.l10n.translate(this.toggleButton);this.isOpen||this.toggleButton.classList.add(s)}function _hideUINotification2(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(this.isOpen||e)&&this.toggleButton.classList.remove(s);if(e){this.toggleButton.setAttribute("data-l10n-id","toggle_sidebar");this.l10n.translate(this.toggleButton)}}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,o,_updateThumbnailViewer2).call(this)}))}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFSidebarResizer=void 0;var n=i(3);const s="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",`${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(s);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(s);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(s);const t=this._updateWidth(this._width);Promise.resolve().then((()=>{this.outerContainer.classList.remove(s);t&&this.eventBus.dispatch("resize",{source:this})}))}))}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFThumbnailViewer=void 0;var n=i(3),s=i(31);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="selected";var a=new WeakSet,o=new WeakSet;t.PDFThumbnailViewer=class PDFThumbnailViewer{constructor(e){let{container:t,linkService:i,renderingQueue:s,l10n:r,pageColors:l}=e;_classPrivateMethodInitSpec(this,o);_classPrivateMethodInitSpec(this,a);this.container=t;this.linkService=i;this.renderingQueue=s;this.l10n=r;this.pageColors=l||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(r);t.div.classList.add(r)}const{first:i,last:s,views:a}=this._getVisibleThumbs();if(a.length>0){let r=!1;if(e<=i.id||e>=s.id)r=!0;else for(const{id:t,percent:i}of a)if(t===e){r=i<100;break}r&&(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();s.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=>{var n;const a=e.numPages,o=t.getViewport({scale:1});for(let e=1;e<=a;++e){const t=new s.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)}null===(n=this._thumbnails[0])||void 0===n||n.setPdfPage(t);this._thumbnails[this._currentPageNumber-1].div.classList.add(r)})).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,i=this._thumbnails.length;e<i;e++){var t;this._thumbnails[e].setPageLabel((null===(t=this._pageLabels)||void 0===t?void 0:t[e])??null)}}}forceRendering(){const e=this._getVisibleThumbs(),t=_classPrivateMethodGet(this,o,_getScrollAhead2).call(this,e),i=this.renderingQueue.getHighestPriority(e,this._thumbnails,t);if(i){_classPrivateMethodGet(this,a,_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;var n=i(3),s=i(4);class TempImageFactory{static#C=null;static getCanvas(e,t){const i=this.#C||(this.#C=document.createElement("canvas"));i.width=e;i.height=t;const n=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0,alpha:!1}:{alpha:!1},s=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0,r=i.getContext("2d",n);r.save();r.fillStyle="rgb(255, 255, 255)";r.fillRect(0,0,e,t);r.restore();return[i,i.getContext("2d",s)]}static destroyCanvas(){const e=this.#C;if(e){e.width=0;e.height=0}this.#C=null}}t.TempImageFactory=TempImageFactory;t.PDFThumbnailView=class PDFThumbnailView{constructor(e){let{container:t,id:i,defaultViewport:s,optionalContentConfigPromise:r,linkService:a,renderingQueue:o,l10n:l,pageColors:c}=e;this.id=i;this.renderingId="thumbnail"+i;this.pageLabel=null;this.pdfPage=null;this.rotation=0;this.viewport=s;this.pdfPageRotate=s.rotation;this._optionalContentConfigPromise=r||null;this.pageColors=c||null;this.linkService=a;this.renderingQueue=o;this.renderTask=null;this.renderingState=n.RenderingStates.INITIAL;this.resume=null;const d=this.viewport.width,h=d/this.viewport.height;this.canvasWidth=98;this.canvasHeight=this.canvasWidth/h|0;this.scale=this.canvasWidth/d;this.l10n=l;window.pdfThumbnailGenerator?window.pdfThumbnailGenerator(this,a,i,t,this._thumbPageTitle):this.createThumbnail(this,a,i,t,this._thumbPageTitle)}createThumbnail(e,t,i,n,s){const r=document.createElement("a");r.href=t.getAnchorUrl("#page="+i);s.then((e=>{r.title=e}));r.onclick=function(){t.goToPage(i);return!1};e.anchor=r;const a=document.createElement("div");a.className="thumbnail";a.setAttribute("data-page-number",this.id);e.div=a;const o=document.createElement("div");o.className="thumbnailSelectionRing";o.style.width=this.canvasWidth+2+"px";o.style.height=this.canvasHeight+2+"px";e.ring=o;a.append(o);r.append(a);n.append(r)}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=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0,alpha:!1}:{alpha:!1},s=t.getContext("2d",i),r=new n.OutputScale;t.width=e*this.canvasWidth*r.sx|0;t.height=e*this.canvasHeight*r.sy|0;return{ctx:s,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 s.RenderingCancelledException)){e.renderingState=n.RenderingStates.FINISHED;e._convertCanvasToImage(r);if(t)throw t}},{ctx:i,canvas:r,transform:a}=this._getPageDrawContext(2),o={canvasContext:i,transform:a,viewport:this.viewport.clone({scale:2*this.scale}),optionalContentConfigPromise:this._optionalContentConfigPromise,background:PDFViewerApplicationOptions.get("pdfBackgroundColor"),pageColors:this.pageColors},l=this.renderTask=t.render(o);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((()=>{r.width=0;r.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,scale:s}=e;if(t){this.pdfPage||this.setPdfPage(i);if(!(s<this.scale)){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,s=i.height<<3;const[r,a]=TempImageFactory.getCanvas(n,s);for(;n>e.width||s>e.height;){n>>=1;s>>=1}a.drawImage(e,0,0,e.width,e.height,0,0,n,s);for(;n>2*i.width;){a.drawImage(r,0,0,n,s,0,0,n>>1,s>>1);n>>=1;s>>=1}t.drawImage(r,0,0,n,s,0,0,i.width,i.height);return i}get _thumbPageTitle(){return this.l10n.get("thumb_page_title",{page:this.pageLabel??this.id})}get _thumbPageCanvas(){return this.l10n.get("thumb_page_canvas",{page:this.pageLabel??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.PagesCountLimit=t.PDFViewer=t.PDFPageViewBuffer=void 0;var n=i(4),s=i(3),r=i(33),a=i(34),o=i(35),l=i(26),c=i(7);let d;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 h="enablePermissions",u={FORCE_SCROLL_MODE_PAGE:15e3,FORCE_LAZY_PAGE_INIT:7500,PAUSE_EAGER_PAGE_INIT:250};t.PagesCountLimit=u;function isValidAnnotationEditorMode(e){return Object.values(n.AnnotationEditorType).includes(e)&&e!==n.AnnotationEditorType.DISABLE}var p=new WeakMap,g=new WeakMap,f=new WeakSet;d=Symbol.iterator;class PDFPageViewBuffer{constructor(e){_classPrivateMethodInitSpec(this,f);_classPrivateFieldInitSpec(this,p,{writable:!0,value:new Set});_classPrivateFieldInitSpec(this,g,{writable:!0,value:0});_classPrivateFieldSet(this,g,e)}push(e){const t=_classPrivateFieldGet(this,p);t.has(e)&&t.delete(e);t.add(e);t.size>_classPrivateFieldGet(this,g)&&_classPrivateMethodGet(this,f,_destroyFirstView2).call(this)}resize(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;_classPrivateFieldSet(this,g,e);const i=_classPrivateFieldGet(this,p);if(t){const e=i.size;let n=1;for(const s of i){if(t.has(s.id)){i.delete(s);i.add(s)}if(++n>e)break}}for(;i.size>_classPrivateFieldGet(this,g);)_classPrivateMethodGet(this,f,_destroyFirstView2).call(this)}has(e){return _classPrivateFieldGet(this,p).has(e)}[d](){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 m=new WeakMap,v=new WeakMap,_=new WeakMap,b=new WeakMap,w=new WeakMap,y=new WeakMap,P=new WeakMap,S=new WeakMap,A=new WeakMap,E=new WeakMap,x=new WeakMap,C=new WeakSet,M=new WeakSet,T=new WeakSet,k=new WeakSet,I=new WeakSet,D=new WeakSet,R=new WeakSet,L=new WeakSet,O=new WeakSet,N=new WeakSet,B=new WeakSet;t.PDFViewer=class PDFViewer{constructor(e){var t,i;_classPrivateMethodInitSpec(this,B);_classPrivateMethodInitSpec(this,N);_classPrivateMethodInitSpec(this,O);_classPrivateMethodInitSpec(this,L);_classPrivateMethodInitSpec(this,R);_classPrivateMethodInitSpec(this,D);_classPrivateMethodInitSpec(this,I);_classPrivateMethodInitSpec(this,k);_classPrivateMethodInitSpec(this,T);_classPrivateMethodInitSpec(this,M);_classPrivateMethodInitSpec(this,C);_classPrivateFieldInitSpec(this,m,{writable:!0,value:null});_classPrivateFieldInitSpec(this,v,{writable:!0,value:n.AnnotationEditorType.NONE});_classPrivateFieldInitSpec(this,_,{writable:!0,value:null});_classPrivateFieldInitSpec(this,b,{writable:!0,value:n.AnnotationMode.ENABLE_FORMS});_classPrivateFieldInitSpec(this,w,{writable:!0,value:null});_classPrivateFieldInitSpec(this,y,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,P,{writable:!0,value:0});_classPrivateFieldInitSpec(this,S,{writable:!0,value:new ResizeObserver(_classPrivateMethodGet(this,B,_resizeObserverCallback2).bind(this))});_classPrivateFieldInitSpec(this,A,{writable:!0,value:null});_classPrivateFieldInitSpec(this,E,{writable:!0,value:null});_classPrivateFieldInitSpec(this,x,{writable:!0,value:null});const a="3.4.493";if(n.version!==a)throw new Error(`The API version "${n.version}" does not match the Viewer version "${a}".`);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)||"DIV"!==(null===(i=this.viewer)||void 0===i?void 0:i.tagName))throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&"absolute"!==getComputedStyle(this.container).position)throw new Error("The `container` must be absolutely positioned.");_classPrivateFieldGet(this,S).observe(this.container);this.eventBus=e.eventBus;this.linkService=e.linkService||new c.SimpleLinkService;this.downloadManager=e.downloadManager||null;this.findController=e.findController||null;this._scriptingManager=e.scriptingManager||null;this.textLayerMode=e.textLayerMode??s.TextLayerMode.ENABLE;_classPrivateFieldSet(this,b,e.annotationMode??n.AnnotationMode.ENABLE_FORMS);_classPrivateFieldSet(this,v,e.annotationEditorMode??n.AnnotationEditorType.NONE);this.imageResourcesPath=e.imageResourcesPath||"";this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1;this.removePageBorders=e.removePageBorders||!1;this.renderer=e.renderer||s.RendererType.CANVAS;this.useOnlyCssZoom=e.useOnlyCssZoom||!1;this.isOffscreenCanvasSupported=e.isOffscreenCanvasSupported??!0;this.maxCanvasPixels=e.maxCanvasPixels;this.l10n=e.l10n||r.NullL10n;_classPrivateFieldSet(this,y,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("PDFViewer: 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 l.PDFRenderingQueue;this.renderingQueue.setViewer(this)}else this.renderingQueue=e.renderingQueue;this.scroll=(0,s.watchScroll)(this.container,this._scrollUpdate.bind(this));this.presentationModeState=s.PresentationModeState.UNKNOWN;this._onBeforeDraw=this._onAfterDraw=null;this._resetView();this.removePageBorders&&this.viewer.classList.add("removePageBorders");_classPrivateMethodGet(this,N,_updateContainerHeightCss2).call(this)}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,b)===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: "${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 a.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;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._currentPageNumber===e){i&&_classPrivateMethodGet(this,R,_resetCurrentPageView2).call(this);return!0}if(!(0<e&&e<=this.pagesCount))return!1;const n=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,L,_ensurePdfPageLoaded2).call(this,i).then((()=>{this.renderingQueue.renderView(i)}));e.style.display="inline-block"}));else{_classPrivateMethodGet(this,L,_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=this._pageLabels)||void 0===t?void 0:t[e-1])??null,previous:n});i&&_classPrivateMethodGet(this,R,_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,L,_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,L,_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,L,_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,L,_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,L,_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,L,_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,L,_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;return(null===(e=this._pageLabels)||void 0===e?void 0:e[this._currentPageNumber-1])??null}set currentPageLabel(e){if(!this.pdfDocument)return;let t=0|e;if(this._pageLabels){const i=this._pageLabels.indexOf(e);i>=0&&(t=i+1)}this._setCurrentPageNumber(t,!0)||Window.ngxConsole.error(`currentPageLabel: "${e}" is not a valid page.`)}get currentScale(){return this._currentScale!==s.UNKNOWN_SCALE?this._currentScale:s.DEFAULT_SCALE}set currentScale(e){if(isNaN(e))throw new Error("Invalid numeric scale.");this.pdfDocument&&this._setScale(e,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(e){this.pdfDocument&&this._setScale(e,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!(0,s.isValidRotation)(e))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument)return;(e%=360)<0&&(e+=360);if(this._pagesRotation===e)return;this._pagesRotation=e;const t=this._currentPageNumber;this.refresh(!0,{rotation:e});this._currentScaleValue&&this._setScale(this._currentScaleValue,{noScroll:!0});this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:e,pageNumber:t});this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}setDocument(e){if(this.pdfDocument){var t,i;this.eventBus.dispatch("pagesdestroy",{source:this});this._cancelRendering();this._resetView();null===(t=this.findController)||void 0===t||t.setDocument(null);null===(i=this._scriptingManager)||void 0===i||i.setDocument(null);if(_classPrivateFieldGet(this,_)){_classPrivateFieldGet(this,_).destroy();_classPrivateFieldSet(this,_,null)}}this.pdfDocument=e;if(!e)return;const r=e.numPages,a=e.getPage(1),l=e.getOptionalContentConfig(),c=_classPrivateFieldGet(this,y)?e.getPermissions():Promise.resolve();if(r>u.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const e=this._scrollMode=s.ScrollMode.PAGE;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e})}this._pagesCapability.promise.then((()=>{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:r})}),(()=>{}));this._onBeforeDraw=e=>{const t=this._pages[e.pageNumber-1];t&&_classPrivateFieldGet(this,m).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,E)){document.removeEventListener("visibilitychange",_classPrivateFieldGet(this,E));_classPrivateFieldSet(this,E,null)}}};this.eventBus._on("pagerendered",this._onAfterDraw);Promise.all([a,c]).then((t=>{let[i,a]=t;if(e!==this.pdfDocument)return;this._firstPageCapability.resolve(i);this._optionalContentConfigPromise=l;const{annotationEditorMode:c,annotationMode:d,textLayerMode:h}=_classPrivateMethodGet(this,M,_initializePermissions2).call(this,a);if(c!==n.AnnotationEditorType.DISABLE){const t=c;if(e.isPureXfa)console.warn("Warning: XFA-editing is not implemented.");else if(isValidAnnotationEditorMode(t)){_classPrivateFieldSet(this,_,new n.AnnotationEditorUIManager(this.container,this.eventBus,null==e?void 0:e.annotationStorage));t!==n.AnnotationEditorType.NONE&&_classPrivateFieldGet(this,_).updateMode(t)}else console.error(`Invalid AnnotationEditor mode: ${t}`)}const p=_classPrivateMethodGet(this,C,_layerProperties2).bind(this),g=this._scrollMode===s.ScrollMode.PAGE?null:this.viewer,f=this.currentScale,m=i.getViewport({scale:f*n.PixelsPerInch.PDF_TO_CSS_UNITS});this.viewer.style.setProperty("--scale-factor",m.scale);for(let e=1;e<=r;++e){const t=new o.PDFPageView({container:g,eventBus:this.eventBus,id:e,scale:f,defaultViewport:m.clone(),optionalContentConfigPromise:l,renderingQueue:this.renderingQueue,textLayerMode:h,annotationMode:d,imageResourcesPath:this.imageResourcesPath,removePageBorders:this.removePageBorders,renderer:this.renderer,useOnlyCssZoom:this.useOnlyCssZoom,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,maxCanvasPixels:this.maxCanvasPixels,pageColors:this.pageColors,l10n:this.l10n,layerProperties:p});this._pages.push(t)}const b=this._pages[0];if(b){b.setPdfPage(i);this.linkService.cachePageRef(1,i.ref)}this._scrollMode===s.ScrollMode.PAGE?_classPrivateMethodGet(this,k,_ensurePageViewVisible2).call(this):this._spreadMode!==s.SpreadMode.NONE&&this._updateSpreadMode();_classPrivateMethodGet(this,T,_onePageRenderedOrForceFetch2).call(this).then((async()=>{var t,i;null===(t=this.findController)||void 0===t||t.setDocument(e);null===(i=this._scriptingManager)||void 0===i||i.setDocument(e);_classPrivateFieldGet(this,_)&&this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:_classPrivateFieldGet(this,v)});if(e.loadingParams.disableAutoFetch||r>u.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let n=r-1;if(n<=0)this._pagesCapability.resolve();else for(let t=2;t<=r;++t){const i=e.getPage(t).then((e=>{const i=this._pages[t-1];i.pdfPage||i.setPdfPage(e);this.linkService.cachePageRef(t,e.ref);0==--n&&this._pagesCapability.resolve()}),(e=>{console.error(`Unable to get page ${t} to initialize viewer`,e);0==--n&&this._pagesCapability.resolve()}));t%u.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,i=this._pages.length;e<i;e++){var t;this._pages[e].setPageLabel((null===(t=this._pageLabels)||void 0===t?void 0:t[e])??null)}}}_resetView(){this._pages=[];this._currentPageNumber=1;this._currentScale=s.UNKNOWN_SCALE;this._currentScaleValue=null;this._pageLabels=null;const e=Number(PDFViewerApplicationOptions.get("defaultCacheSize"))||10;_classPrivateFieldSet(this,m,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=s.ScrollMode.VERTICAL;this._previousScrollMode=s.ScrollMode.UNKNOWN;this._spreadMode=s.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,E)){document.removeEventListener("visibilitychange",_classPrivateFieldGet(this,E));_classPrivateFieldSet(this,E,null)}this.viewer.textContent="";this._updateScrollMode();this.viewer.removeAttribute("lang");this.viewer.classList.remove(h)}_scrollUpdate(){0!==this.pagesCount&&this.update()}scrollPagePosIntoView(e,t){const i=this._pages[e-1].div;if(t){const r={...t};if("string"==typeof r.top&&r.top.endsWith("%")){var n;const e=Number(r.top.replace("%","")),t=null===(n=this.viewer.querySelector(".page"))||void 0===n?void 0:n.clientHeight;let s=i.clientHeight?i.clientHeight:t;const a=this.viewer.parentElement.clientHeight;s=Math.max(0,s-a);r.top=e*s/100}if("string"==typeof r.left&&r.left.endsWith("%")){var s;const e=Number(r.left.replace("%","")),t=null===(s=this.viewer.querySelector(".page"))||void 0===s?void 0:s.clientWidth,n=i.clientWidth?i.clientWidth:t;r.left=e*n/100}_classPrivateMethodGet(this,I,_scrollIntoView2).call(this,{div:i,id:e},r)}else _classPrivateMethodGet(this,I,_scrollIntoView2).call(this,{pageDiv:i,pageNumber:e})}_setScaleUpdatePages(e,t,i){let{noScroll:s=!1,preset:r=!1,drawingDelay:a=-1}=i;const o=isNaN(Number(this.currentScale))?void 0:Number(this.currentScale),l=this.currentScaleValue;this._currentScaleValue=t.toString();if(_classPrivateMethodGet(this,D,_isSameScale2).call(this,e)){r&&this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:t,previousScale:o,previousPresetValue:l});return}this.viewer.style.setProperty("--scale-factor",e*n.PixelsPerInch.PDF_TO_CSS_UNITS);const c=a>=0&&a<1e3;this.refresh(!0,{scale:e,drawingDelay:c?a:-1});c&&_classPrivateFieldSet(this,x,setTimeout((()=>{_classPrivateFieldSet(this,x,null);this.refresh()}),a));this._currentScale=e;if(!s){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:r?t:void 0,previousScale:o,previousPresetValue:l});this.defaultRenderingQueue&&this.update()}get _pageWidthScaleFactor(){return this._spreadMode!==s.SpreadMode.NONE&&this._scrollMode!==s.ScrollMode.HORIZONTAL?2:1}_setScale(e,t){e||(e="auto");let i=parseFloat(e);if(this._currentScale!==i)if(i>0){t.preset=!1;this._setScaleUpdatePages(i,e,t)}else{const n=this._pages[this._currentPageNumber-1];if(!n)return;let r=s.SCROLLBAR_PADDING,a=s.VERTICAL_PADDING;if(this.isInPresentationMode){r=a=4;this._spreadMode!==s.SpreadMode.NONE&&(r*=2)}else this.removePageBorders?r=a=0:this._scrollMode===s.ScrollMode.HORIZONTAL&&([r,a]=[a,r]);const o=(this.container.clientWidth-r)/n.width*n.scale/this._pageWidthScaleFactor,l=(this.container.clientHeight-a)/n.height*n.scale;switch(e){case"page-actual":i=1;break;case"page-width":i=o;break;case"page-height":i=l;break;case"page-fit":i=Math.min(o,l);break;case"auto":const t=(0,s.isPortraitOrientation)(n)?o:Math.min(l,o);i=Math.min(s.MAX_AUTO_SCALE,t);break;default:Window.ngxConsole.error(`_setScale: "${e}" is an unknown zoom value.`);return}t.preset=!0;this._setScaleUpdatePages(i,e,t)}}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:r=!1,ignoreDestinationZoom:a=!1}=e;if(!this.pdfDocument)return;const o=Number.isInteger(t)&&this._pages[t-1];if(!o){console.error(`scrollPageIntoView: "${t}" is not a valid pageNumber parameter.`);return}if(this.isInPresentationMode||!i){this._setCurrentPageNumber(t,!0);return}let l,c,d=0,h=0,u=0,p=0;const g=o.rotation%180!=0,f=(g?o.height:o.width)/o.scale/n.PixelsPerInch.PDF_TO_CSS_UNITS,m=(g?o.width:o.height)/o.scale/n.PixelsPerInch.PDF_TO_CSS_UNITS;let v=0;switch(i[1].name){case"XYZ":d=i[2];h=i[3];v=i[4];d=null!==d?d:0;h=null!==h?h:m;break;case"Fit":case"FitB":v="page-fit";break;case"FitH":case"FitBH":h=i[2];v="page-width";if(null===h&&this._location){d=this._location.left;h=this._location.top}else("number"!=typeof h||h<0)&&(h=m);break;case"FitV":case"FitBV":d=i[2];u=f;p=m;v="page-height";break;case"FitR":d=i[2];h=i[3];u=i[4]-d;p=i[5]-h;let e=s.SCROLLBAR_PADDING,t=s.VERTICAL_PADDING;this.removePageBorders&&(e=t=0);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:console.error(`scrollPageIntoView: "${i[1].name}" is not a valid destination type.`);return}a||(v&&v!==this._currentScale?this.currentScaleValue=v:this._currentScale===s.UNKNOWN_SCALE&&(this.currentScaleValue=s.DEFAULT_SCALE_VALUE));_classPrivateMethodGet(this,L,_ensurePdfPageLoaded2).call(this,o).then((()=>{this.renderingQueue.renderView(o);"single"===this.pageViewMode&&this.currentPageNumber!==t&&(this.currentPageNumber=t)}));if("page-fit"===v&&!i[4]){_classPrivateMethodGet(this,I,_scrollIntoView2).call(this,o);return}const _=[o.viewport.convertToViewportPoint(d,h),o.viewport.convertToViewportPoint(d+u,h+p)];let b=Math.min(_[0][0],_[1][0]),w=Math.min(_[0][1],_[1][1]);if(!r){b=Math.max(b,0);w=Math.max(w,0)}_classPrivateMethodGet(this,I,_scrollIntoView2).call(this,o,{left:b,top:w})}_updateLocation(e){const t=this._currentScale,i=this._currentScaleValue,n=parseFloat(i)===t?Math.round(1e4*t)/100:i,s=e.id,r=this._pages[s-1],a=this.container,o=r.getPagePoint(a.scrollLeft-e.x,a.scrollTop-e.y),l=Math.round(o[0]),c=Math.round(o[1]);let d=`#page=${s}`;this.isInPresentationMode||(d+=`&zoom=${n},${l},${c}`);this._location={pageNumber:s,scale:n,top:c,left:l,rotation:this._pagesRotation,pdfOpenParams:d}}update(){this.scrollMode===s.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,r=Math.max(n,2*i+1);_classPrivateFieldGet(this,m).resize(r,e.ids);this.renderingQueue.renderHighestPriority(e);const a=this._spreadMode===s.SpreadMode.NONE&&(this._scrollMode===s.ScrollMode.PAGE||this._scrollMode===s.ScrollMode.VERTICAL),o=this._currentPageNumber;let l=!1;for(const e of t){if(e.percent<100)break;if(e.id===o&&a){l=!0;break}}this._setCurrentPageNumber(l?o: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===s.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===s.PresentationModeState.CHANGING}get isHorizontalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const e=this._scrollMode===s.ScrollMode.PAGE?_classPrivateFieldGet(this,A).pages:this._pages,t=this._scrollMode===s.ScrollMode.HORIZONTAL,i=t&&this._isContainerRtl;return(0,s.getVisibleElements)({scrollEl:this.container,views:e,sortByVisibility:!0,horizontal:t,rtl:i})}isPageVisible(e){if(!this.pdfDocument)return!1;if(!(Number.isInteger(e)&&e>0&&e<=this.pagesCount)){console.error(`isPageVisible: "${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)){console.error(`isPageCached: "${e}" is not a valid page.`);return!1}const t=this._pages[e-1];return _classPrivateFieldGet(this,m).has(t)}cleanup(){for(const e of this._pages)e.renderingState!==s.RenderingStates.FINISHED&&e.reset()}_cancelRendering(){for(const e of this._pages)e.cancelRendering()}forceRendering(e){const t=e||this._getVisiblePages(),i=_classPrivateMethodGet(this,O,_getScrollAhead2).call(this,t),n=this._spreadMode!==s.SpreadMode.NONE&&this._scrollMode!==s.ScrollMode.HORIZONTAL,r=this.renderingQueue.getHighestPriority(t,this._pages,i,n);if(r){_classPrivateMethodGet(this,L,_ensurePdfPageLoaded2).call(this,r).then((()=>{this.renderingQueue.renderView(r)}));return!0}return!1}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,s.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: ${e}`);if(this.pdfDocument&&this._optionalContentConfigPromise){this._optionalContentConfigPromise=e;this.refresh(!1,{optionalContentConfigPromise:e});this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:e})}}get scrollMode(){return this._scrollMode}set scrollMode(e){if(this._scrollMode!==e){if(!(0,s.isValidScrollMode)(e))throw new Error(`Invalid scroll mode: ${e}`);if(!(this.pagesCount>u.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===s.ScrollMode.HORIZONTAL);i.classList.toggle("scrollWrapped",t===s.ScrollMode.WRAPPED);if(this.pdfDocument&&e){t===s.ScrollMode.PAGE?_classPrivateMethodGet(this,k,_ensurePageViewVisible2).call(this):this._previousScrollMode===s.ScrollMode.PAGE&&this._updateSpreadMode();this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,{noScroll:!0});this._setCurrentPageNumber(e,!0);this.update()}}get spreadMode(){return this._spreadMode}set spreadMode(e){if(this._spreadMode!==e){if(!(0,s.isValidSpreadMode)(e))throw new Error(`Invalid spread mode: ${e}`);this._spreadMode=e;this.eventBus.dispatch("spreadmodechanged",{source:this,mode:e});this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(){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===s.ScrollMode.PAGE)_classPrivateMethodGet(this,k,_ensurePageViewVisible2).call(this);else{t.textContent="";if(this._spreadMode===s.SpreadMode.NONE)for(const e of this._pages)t.append(e.div);else{const e=this._spreadMode-1;let n=null;for(let s=0,r=i.length;s<r;++s){if(null===n){n=document.createElement("div");n.className="spread";t.append(n)}else if(s%2===e){n=n.cloneNode(!1);t.append(n)}n.append(i[s].div)}}}this.hidePagesDependingOnpageViewMode();if(e){this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,{noScroll:!0});this._setCurrentPageNumber(e,!0);this.update()}}_getPageAdvance(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(this._scrollMode){case s.ScrollMode.WRAPPED:{const{views:i}=this._getVisiblePages(),n=new Map;for(const{id:e,y:t,percent:s,widthPercent:r}of i){if(0===s||r<100)continue;let i=n.get(t);i||n.set(t,i||(i=[]));i.push(e)}for(const i of n.values()){const n=i.indexOf(e);if(-1===n)continue;const s=i.length;if(1===s)break;if(t)for(let t=n-1,s=0;t>=s;t--){const n=i[t],s=i[t+1]-1;if(n<s)return e-s}else for(let t=n+1,r=s;t<r;t++){const n=i[t],s=i[t-1]+1;if(n>s)return s-e}if(t){const t=i[0];if(t<e)return e-t+1}else{const t=i[s-1];if(t>e)return t-e+1}break}break}case s.ScrollMode.HORIZONTAL:break;case s.ScrollMode.PAGE:case s.ScrollMode.VERTICAL:{if(this._spreadMode===s.SpreadMode.NONE)break;const i=this._spreadMode-1;if(t&&e%2!==i)break;if(!t&&e%2===i)break;const{views:n}=this._getVisiblePages(),r=t?e-1:e+1;for(const{id:e,percent:t,widthPercent:i}of n)if(e===r){if(t>0&&100===i)return 2;break}break}}return 1}nextPage(){const e=this._currentPageNumber,t=this.pagesCount;if(e>=t)return!1;const i=this._getPageAdvance(e,!1)||1;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]:null;if("number"==typeof e){console.error("The `increaseScale` method-signature was updated, please use an object instead.");e={steps:e}}if(!this.pdfDocument)return;e||(e=Object.create(null));let t=this._currentScale,i=Number(PDFViewerApplicationOptions.get("maxZoom"));i||(i=s.MAX_SCALE);if(e.scaleFactor>1)t=Math.min(i,Math.round(t*e.scaleFactor*100)/100);else{let n=e.steps??1;do{t=(t*s.DEFAULT_SCALE_DELTA).toFixed(2);t=Math.ceil(10*t)/10;t=Math.min(i,t)}while(--n>0&&t<i)}e.noScroll=!1;this._setScale(t,e)}decreaseScale(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("number"==typeof e){console.error("The `decreaseScale` method-signature was updated, please use an object instead.");e={steps:e}}if(!this.pdfDocument)return;e||(e=Object.create(null));let t=this._currentScale,i=Number(PDFViewerApplicationOptions.get("minZoom"));i||(i=s.MIN_SCALE);if(e.scaleFactor>0&&e.scaleFactor<1)t=Math.max(i,Math.round(t*e.scaleFactor*100)/100);else{let n=e.steps??1;do{t=(t/s.DEFAULT_SCALE_DELTA).toFixed(2);t=Math.floor(10*t)/10;t=Math.max(i,t)}while(--n>0&&t>i)}e.noScroll=!1;this._setScale(t,e)}get containerTopLeft(){return _classPrivateFieldGet(this,w)||_classPrivateFieldSet(this,w,[this.container.offsetTop,this.container.offsetLeft])}get annotationEditorMode(){return _classPrivateFieldGet(this,_)?_classPrivateFieldGet(this,v):n.AnnotationEditorType.DISABLE}set annotationEditorMode(e){if(!_classPrivateFieldGet(this,_))throw new Error("The AnnotationEditor is not enabled.");if(_classPrivateFieldGet(this,v)!==e){if(!isValidAnnotationEditorMode(e))throw new Error(`Invalid AnnotationEditor mode: ${e}`);if(this.pdfDocument){_classPrivateFieldSet(this,v,e);this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:e});_classPrivateFieldGet(this,_).updateMode(e)}}}set annotationEditorParams(e){let{type:t,value:i}=e;if(!_classPrivateFieldGet(this,_))throw new Error("The AnnotationEditor is not enabled.");_classPrivateFieldGet(this,_).updateParams(t,i)}refresh(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.create(null);if(this.pdfDocument){for(const e of this._pages)e.update(t);if(null!==_classPrivateFieldGet(this,x)){clearTimeout(_classPrivateFieldGet(this,x));_classPrivateFieldSet(this,x,null)}e||this.update()}}};function _layerProperties2(){const e=this;return{get annotationEditorUIManager(){return _classPrivateFieldGet(e,_)},get annotationStorage(){var t;return null===(t=e.pdfDocument)||void 0===t?void 0:t.annotationStorage},get downloadManager(){return e.downloadManager},get enableScripting(){return!!e._scriptingManager},get fieldObjectsPromise(){var t;return null===(t=e.pdfDocument)||void 0===t?void 0:t.getFieldObjects()},get findController(){return e.findController},get hasJSActionsPromise(){var t;return null===(t=e.pdfDocument)||void 0===t?void 0:t.hasJSActions()},get linkService(){return e.linkService}}}function _initializePermissions2(e){const t={annotationEditorMode:_classPrivateFieldGet(this,v),annotationMode:_classPrivateFieldGet(this,b),textLayerMode:this.textLayerMode};if(!e)return t;e.includes(n.PermissionFlag.COPY)||this.viewer.classList.add(h);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,b)!==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,E,(()=>{if("hidden"===document.visibilityState){e();document.removeEventListener("visibilitychange",_classPrivateFieldGet(this,E));_classPrivateFieldSet(this,E,null)}}));document.addEventListener("visibilitychange",_classPrivateFieldGet(this,E))}));return Promise.race([this._onePageRenderedCapability.promise,e])}function _ensurePageViewVisible2(){if(this._scrollMode!==s.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!==s.SpreadMode.NONE||this.isInPresentationMode){const n=new Set,s=this._spreadMode-1;if(-1===s)n.add(e-1);else if(e%2!==s){n.add(e-1);n.add(e)}else{n.add(e-2);n.add(e-1)}const r=document.createElement("div");r.className="spread";if(this.isInPresentationMode){const e=document.createElement("div");e.className="dummyPage";r.append(e)}for(const e of n){const i=this._pages[e];if(i){r.append(i.div);t.pages.push(i)}}i.append(r)}else{const n=this._pages[e-1];i.append(n.div);t.pages.push(n)}t.scrollDown=e>=t.previousPageNumber;t.previousPageNumber=e}function _scrollIntoView2(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return;const{div:i,id:n}=e;this._currentPageNumber!==n&&this._setCurrentPageNumber(n);if(this._scrollMode===s.ScrollMode.PAGE){_classPrivateMethodGet(this,k,_ensurePageViewVisible2).call(this);this.update()}if(!t&&!this.isInPresentationMode){const e=i.offsetLeft+i.clientLeft,n=e+i.clientWidth,{scrollLeft:r,clientWidth:a}=this.container;(this._scrollMode===s.ScrollMode.HORIZONTAL||e<r||n>r+a)&&(t={left:0,top:0})}(0,s.scrollIntoView)(i,t,!1,"infinite-scroll"===this.pageViewMode);!this._currentScaleValue&&this._location&&(this._location=null)}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,{noScroll:!0});_classPrivateMethodGet(this,I,_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){console.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 s.ScrollMode.PAGE:return _classPrivateFieldGet(this,A).scrollDown;case s.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down}function _updateContainerHeightCss2(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.container.clientHeight;if(e!==_classPrivateFieldGet(this,P)){_classPrivateFieldSet(this,P,e);s.docStyle.setProperty("--viewer-container-height",`${e}px`)}}function _resizeObserverCallback2(e){for(const t of e)if(t.target===this.container){_classPrivateMethodGet(this,N,_updateContainerHeightCss2).call(this,Math.floor(t.borderBoxSize[0].blockSize));_classPrivateFieldSet(this,w,null);break}}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NullL10n=void 0;t.fixupLangCode=function fixupLangCode(e){return n[null==e?void 0:e.toLowerCase()]||e};t.getL10nFallback=getL10nFallback;const i={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",print_progress_percent:"{{progress}}%"};function getL10nFallback(e,t){switch(e){case"find_match_count":e=`find_match_count[${1===t.total?"one":"other"}]`;break;case"find_match_count_limit":e=`find_match_count_limit[${1===t.limit?"one":"other"}]`}return i[e]||""}const n={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)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PageFlip=void 0;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=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0,i=canvas.getContext("2d",t),n=this.render.convertToGlobal(this.state.position),s=this.render.getRect().pageWidth,r=this.render.getRect().height;i.save();i.translate(n.x,n.y);i.beginPath();for(let e of this.state.area)if(null!==e){e=this.render.convertToGlobal(e);i.lineTo(e.x-n.x,e.y-n.y)}i.rotate(this.state.angle);i.clip();this.isLoad?i.drawImage(this.image,0,0,s,r):this.drawLoader(i,{x:0,y:0},s,r);i.restore()}simpleDraw(e){const t=this.render.getRect(),i=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0,n=canvas.getContext("2d",i),s=t.pageWidth,r=t.height,a=1===e?t.left+t.pageWidth:t.left,o=t.top;this.isLoad?n.drawImage(this.image,a,o,s,r):this.drawLoader(n,{x:a,y:o},s,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 s={x:t.x+i/2,y:t.y+n/2};e.beginPath();e.lineWidth=10;e.arc(s.x,s.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,s=e[1].x-e[0].x,r=t[1].x-t[0].x;return Math.acos((i*n+s*r)/(Math.sqrt(i*i+s*s)*Math.sqrt(n*n+r*r)))}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,s=e.y,r=i.x,a=i.y;let o=Math.sqrt(Math.pow(t,2)*Math.pow(n-r,2)/(Math.pow(n-r,2)+Math.pow(s-a,2)))+n;i.x<0&&(o*=-1);let l=(o-n)*(s-a)/(n-r)+s;n-r+s===0&&(l=t);return{x:o,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,s=e[1].x-e[0].x,r=t[1].x-t[0].x,a=e[0].x*e[1].y-e[1].x*e[0].y,o=t[0].x*t[1].y-t[1].x*t[0].y,l=i*o-n*a,c=s*o-r*a,d=-(a*r-o*s)/(i*r-n*s),h=-(i*o-n*a)/(i*r-n*s);if(isFinite(d)&&isFinite(h))return{x:d,y:h};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),s=Math.max(i,n),r=[e];function getCord(e,t,i,n,s){return t>e?e+s*(i/n):t<e?e-s*(i/n):e}for(let a=1;a<=s;a+=1)r.push({x:getCord(e.x,t.x,i,s,a),y:getCord(e.y,t.y,n,s,a)});return r}}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,s=this.render.getRect().height;this.element.classList.remove("--simple");const r=`\n            position: absolute;\n            display: block;\n            z-index: ${this.element.style.zIndex};\n            left: 0;\n            top: 0;\n            width: ${n}px;\n            height: ${s}px;\n        `;"hard"===t?this.drawHard(r):this.drawSoft(i,r)}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: ${this.render.getRect().pageWidth}px 0;\n                   transform: translate3d(0, 0, 0) rotateY(${i}deg);`:`transform-origin: 0 0;\n                   transform: translate3d(${t}px, 0, 0) rotateY(${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: ${i}; -webkit-clip-path: ${i};`+(this.render.isSafari()&&0===this.state.angle?`transform: translate(${e.x}px, ${e.y}px);`:`transform: translate3d(${e.x}px, ${e.y}px, 0) rotate(${this.state.angle}rad);`);this.element.style.cssText=n}simpleDraw(e){const t=this.render.getRect(),i=t.pageWidth,n=t.height,s=1===e?t.left+t.pageWidth:t.left,r=t.top;this.element.classList.add("--simple");this.element.style.cssText=`\n            position: absolute;\n            display: block;\n            height: ${n}px;\n            left: ${s}px;\n            top: ${r}px;\n            width: ${i}px;\n            z-index: ${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 s=Math.PI-n;if(!isFinite(n)||s>=0&&s<.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 s=Helper.LimitPointToCircle(t,this.pageWidth,n);if(n!==s){n=s;this.updateAngleAndGeometry(n)}const r=Math.sqrt(Math.pow(this.pageWidth,2)+Math.pow(this.pageHeight,2));let a=this.rect.bottomRight,o=this.rect.topLeft;if("bottom"===this.corner){a=this.rect.topRight;o=this.rect.bottomLeft}if(a.x<=0){const e=Helper.LimitPointToCircle(i,r,o);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,s="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:s},!0)}start(e){this.reset();const t=this.render.convertToBook(e),i=this.getBoundsRect(),n=this.getDirectionByPoint(t),s=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,s,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,s="bottom"===this.calc.getCorner()?t.height-1:1,r="bottom"===this.calc.getCorner()?t.height-n:n;this.animateFlippingTo({x:i-1,y:s},{x:i-n,y:r},!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 s=Helper.GetCordsFromTwoPoint(e,t),r=[];for(const e of s)r.push((()=>this.do(e)));const a=this.getAnimationDuration(s.length);this.render.startAnimation(r,a,(()=>{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,s=this.render.convertToBook(e);return s.x>0&&s.y>0&&s.x<t.width&&s.y<t.height&&(s.x<n||s.x>t.width-n)&&(s.y<n||s.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,s=this.setting.width/this.setting.height;let r=this.setting.width,a=this.setting.height,o=i-r;if("stretch"===this.setting.size){t<2*this.setting.minWidth&&this.app.getSettings().usePortrait&&(e="portrait");r="portrait"===e?this.getBlockWidth():this.getBlockWidth()/2;r>this.setting.maxWidth&&(r=this.setting.maxWidth);a=r/s;if(a>this.getBlockHeight()){a=this.getBlockHeight();r=a*s}o="portrait"===e?i-r/2-r:i-r}else if(t<2*r&&this.app.getSettings().usePortrait){e="portrait";o=i-r/2-r}this.boundsRect={left:o,top:n-a/2,width:2*r,height:a,pageWidth:r};return e}setShadowData(e,t,i,n){if(!this.app.getSettings().drawShadow)return;const s=100*this.getSettings().maxShadowOpacity;this.shadow={pos:e,angle:t,width:3*this.getRect().pageWidth/4*i/100,opacity:(100-i)*s/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;const n=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0;canvas.getContext("2d",n)}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,s=this.ctx.createLinearGradient(0,0,n,0);if(0===this.shadow.direction){this.ctx.translate(-n,-100);s.addColorStop(1,"rgba(0, 0, 0, "+this.shadow.opacity+")");s.addColorStop(.9,"rgba(0, 0, 0, 0.05)");s.addColorStop(.7,"rgba(0, 0, 0, "+this.shadow.opacity+")");s.addColorStop(0,"rgba(0, 0, 0, 0)")}else{this.ctx.translate(0,-100);s.addColorStop(0,"rgba(0, 0, 0, "+this.shadow.opacity+")");s.addColorStop(.1,"rgba(0, 0, 0, 0.05)");s.addColorStop(.3,"rgba(0, 0, 0, "+this.shadow.opacity+")");s.addColorStop(1,"rgba(0, 0, 0, 0)")}this.ctx.clip();this.ctx.fillStyle=s;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 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})}}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: ${(this.getSettings().startZIndex+5).toString(10)};\n            width: ${i}px;\n            height: ${e.height}px;\n            background: linear-gradient(to right,\n                rgba(0, 0, 0, ${this.shadow.opacity*t/100}) 5%,\n                rgba(0, 0, 0, 0) 100%);\n            left: ${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: ${(this.getSettings().startZIndex+4).toString(10)};\n            width: ${t}px;\n            height: ${e.height}px;\n            background: linear-gradient(to left, rgba(0, 0, 0, ${this.shadow.opacity}) 5%, rgba(0, 0, 0, 0) 100%);\n            left: ${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",s=this.convertToGlobal(this.shadow.pos),r=this.shadow.angle+3*Math.PI/2,a=[this.pageRect.topLeft,this.pageRect.topRight,this.pageRect.bottomRight,this.pageRect.bottomLeft];let o="polygon( ";for(const e of a){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},r);o+=t.x+"px "+t.y+"px, "}o=o.slice(0,-2);o+=")";const l=`\n            display: block;\n            z-index: ${(this.getSettings().startZIndex+10).toString(10)};\n            width: ${t}px;\n            height: ${2*e.height}px;\n            background: linear-gradient(${n},\n                rgba(0, 0, 0, ${this.shadow.opacity}) 5%,\n                rgba(0, 0, 0, 0.05) 15%,\n                rgba(0, 0, 0, ${this.shadow.opacity}) 35%,\n                rgba(0, 0, 0, 0) 100%);\n            transform-origin: ${i}px 100px;\n            transform: translate3d(${s.x-i}px, ${s.y-100}px, 0) rotate(${r}rad);\n            clip-path: ${o};\n            -webkit-clip-path: ${o};\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,s=0===this.getDirection()?"to right":"to left",r=[{x:0,y:0},{x:e.pageWidth,y:0},{x:e.pageWidth,y:e.height},{x:0,y:e.height}];let a="polygon( ";for(const e of r)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);a+=t.x+"px "+t.y+"px, "}a=a.slice(0,-2);a+=")";const o=`\n            display: block;\n            z-index: ${(this.getSettings().startZIndex+10).toString(10)};\n            width: ${this.shadow.width}px;\n            height: ${2*e.height}px;\n            background: linear-gradient(${s}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0));\n            transform-origin: ${n}px 100px;\n            transform: translate3d(${t.x-n}px, ${t.y-100}px, 0) rotate(${i}rad);\n            clip-path: ${a};\n            -webkit-clip-path: ${a};\n        `;this.outerShadow.style.cssText=o}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],s=document.createElement("style");s.type="text/css";"top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s);s.styleSheet?s.styleSheet.cssText=e:s.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 EventObject{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;var n=i(4),s=i(3),r=i(36),a=i(37),o=i(5),l=i(33),c=(i(7),i(38)),d=i(39),h=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(i(40)),u=i(41),p=i(174),g=i(175),f=i(176);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 _classPrivateMethodGet(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return 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)}const m=o.compatibilityParams.maxCanvasPixels||16777216,DEFAULT_LAYER_PROPERTIES=()=>null;var v=new WeakMap,_=new WeakMap,b=new WeakMap,w=new WeakMap,y=new WeakMap,P=new WeakMap,S=new WeakSet,A=new WeakSet,E=new WeakSet,x=new WeakSet,C=new WeakSet,M=new WeakSet,T=new WeakSet;t.PDFPageView=class PDFPageView{constructor(e){var t;_classPrivateMethodInitSpec(this,T);_classPrivateMethodInitSpec(this,M);_classPrivateMethodInitSpec(this,C);_classPrivateMethodInitSpec(this,x);_classPrivateMethodInitSpec(this,E);_classPrivateMethodInitSpec(this,A);_classPrivateMethodInitSpec(this,S);_classPrivateFieldInitSpec(this,v,{writable:!0,value:n.AnnotationMode.ENABLE_FORMS});_classPrivateFieldInitSpec(this,_,{writable:!0,value:null});_classPrivateFieldInitSpec(this,b,{writable:!0,value:null});_classPrivateFieldInitSpec(this,w,{writable:!0,value:null});_classPrivateFieldInitSpec(this,y,{writable:!0,value:s.RenderingStates.INITIAL});_classPrivateFieldInitSpec(this,P,{writable:!0,value:{initialOptionalContent:!0,regularAnnotations:!0}});const i=e.container,r=e.defaultViewport;this.id=e.id;this.renderingId="page"+this.id;_classPrivateFieldSet(this,_,e.layerProperties||DEFAULT_LAYER_PROPERTIES);this.pdfPage=null;this.pageLabel=null;this.rotation=0;this.scale=e.scale||s.DEFAULT_SCALE;this.viewport=r;this.pdfPageRotate=r.rotation;this._optionalContentConfigPromise=e.optionalContentConfigPromise||null;this.hasRestrictedScaling=!1;this.textLayerMode=e.textLayerMode??s.TextLayerMode.ENABLE;_classPrivateFieldSet(this,v,e.annotationMode??n.AnnotationMode.ENABLE_FORMS);this.imageResourcesPath=e.imageResourcesPath||"";this.useOnlyCssZoom=e.useOnlyCssZoom||!1;this.isOffscreenCanvasSupported=e.isOffscreenCanvasSupported??!0;this.maxCanvasPixels=e.maxCanvasPixels||m;this.pageColors=e.pageColors||null;this.eventBus=e.eventBus;this.renderingQueue=e.renderingQueue;this.renderer=e.renderer||s.RendererType.CANVAS;this.l10n=e.l10n||l.NullL10n;this.paintTask=null;this.paintedViewportMap=new WeakMap;this.resume=null;this._renderError=null;this._isStandalone=!(null!==(t=this.renderingQueue)&&void 0!==t&&t.hasViewer());this._annotationCanvasMap=null;this.annotationLayer=null;this.annotationEditorLayer=null;this.textLayer=null;this.zoomLayer=null;this.xfaLayer=null;this.structTreeLayer=null;const a=document.createElement("div");a.className="page";a.setAttribute("data-page-number",this.id);a.setAttribute("role","region");this.l10n.get("page_landmark",{page:this.id}).then((e=>{a.setAttribute("aria-label",e)}));this.div=a;_classPrivateMethodGet(this,S,_setDimensions2).call(this);null==i||i.append(a);if(this._isStandalone){null==i||i.style.setProperty("--scale-factor",this.scale*n.PixelsPerInch.PDF_TO_CSS_UNITS);const{optionalContentConfigPromise:t}=e;t&&t.then((e=>{t===this._optionalContentConfigPromise&&(_classPrivateFieldGet(this,P).initialOptionalContent=e.hasInitialVisibility)}))}}get renderingState(){return _classPrivateFieldGet(this,y)}set renderingState(e){if(e!==_classPrivateFieldGet(this,y)){_classPrivateFieldSet(this,y,e);if(_classPrivateFieldGet(this,b)){clearTimeout(_classPrivateFieldGet(this,b));_classPrivateFieldSet(this,b,null)}switch(e){case s.RenderingStates.PAUSED:this.div.classList.remove("loading");break;case s.RenderingStates.RUNNING:this.div.classList.add("loadingIcon");_classPrivateFieldSet(this,b,setTimeout((()=>{this.div.classList.add("loading");_classPrivateFieldSet(this,b,null)}),0));break;case s.RenderingStates.INITIAL:case s.RenderingStates.FINISHED:this.div.classList.remove("loadingIcon","loading")}}}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});_classPrivateMethodGet(this,S,_setDimensions2).call(this);this.reset()}destroy(){var e;this.reset();null===(e=this.pdfPage)||void 0===e||e.cleanup()}get _textHighlighter(){return(0,n.shadow)(this,"_textHighlighter",new p.TextHighlighter({pageIndex:this.id-1,eventBus:this.eventBus,findController:_classPrivateFieldGet(this,_).call(this).findController}))}_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,n,r;let{keepZoomLayer:a=!1,keepAnnotationLayer:o=!1,keepAnnotationEditorLayer:l=!1,keepXfaLayer:c=!1,keepTextLayer:d=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.cancelRendering({keepAnnotationLayer:o,keepAnnotationEditorLayer:l,keepXfaLayer:c,keepTextLayer:d});this.renderingState=s.RenderingStates.INITIAL;const h=this.div,u=h.childNodes,p=a&&this.zoomLayer||null,g=o&&(null===(e=this.annotationLayer)||void 0===e?void 0:e.div)||null,f=l&&(null===(t=this.annotationEditorLayer)||void 0===t?void 0:t.div)||null,m=c&&(null===(i=this.xfaLayer)||void 0===i?void 0:i.div)||null,v=d&&(null===(n=this.textLayer)||void 0===n?void 0:n.div)||null;for(let e=u.length-1;e>=0;e--){const t=u[e];switch(t){case p:case g:case f:case m:case v:continue}t.remove()}h.removeAttribute("data-loaded");g&&this.annotationLayer.hide();f&&this.annotationEditorLayer.hide();m&&this.xfaLayer.hide();v&&this.textLayer.hide();null===(r=this.structTreeLayer)||void 0===r||r.hide();if(!p){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}}update(e){let{scale:t=0,rotation:i=null,optionalContentConfigPromise:r=null,drawingDelay:a=-1}=e;this.scale=t||this.scale;"number"==typeof i&&(this.rotation=i);if(r instanceof Promise){this._optionalContentConfigPromise=r;r.then((e=>{r===this._optionalContentConfigPromise&&(_classPrivateFieldGet(this,P).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});_classPrivateMethodGet(this,S,_setDimensions2).call(this);if(this._isStandalone){var l;null===(l=this.div.parentNode)||void 0===l||l.style.setProperty("--scale-factor",this.viewport.scale)}if(this.svg){this.cssTransform({target:this.svg,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!0});this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this._renderError});return}let c=!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&&(c=!0)}const d=a>=0&&a<1e3;if(this.canvas){if(d||this.useOnlyCssZoom||this.hasRestrictedScaling&&c){if(d&&this.renderingState!==s.RenderingStates.FINISHED){this.cancelRendering({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:a});this.renderingState=s.RenderingStates.FINISHED}this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!d,hideTextLayer:d});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,keepTextLayer:!0})}cancelRendering(){let{keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:t=!1,keepXfaLayer:i=!1,keepTextLayer:n=!1,cancelExtraDelay:s=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.paintTask){this.paintTask.cancel(s);this.paintTask=null}this.resume=null;if(this.textLayer&&(!n||!this.textLayer.div)){this.textLayer.cancel();this.textLayer=null}this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=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 r;this.xfaLayer.cancel();this.xfaLayer=null;null===(r=this._textHighlighter)||void 0===r||r.disable()}}cssTransform(e){let{target:t,redrawAnnotationLayer:i=!1,redrawAnnotationEditorLayer:n=!1,redrawXfaLayer:s=!1,redrawTextLayer:r=!1,hideTextLayer:a=!1}=e;if(t instanceof HTMLCanvasElement){if(!t.hasAttribute("zooming")){t.setAttribute("zooming",!0);const{style:e}=t;e.width=e.height=""}}else{const e=this.div,{width:i,height:n}=this.viewport;t.style.width=t.parentNode.style.width=e.style.width=Math.floor(i)+"px";t.style.height=t.parentNode.style.height=e.style.height=Math.floor(n)+"px"}const o=this.paintedViewportMap.get(t);if(this.viewport!==o){const e=this.viewport.rotation-o.rotation,i=Math.abs(e);let n=1,s=1;if(90===i||270===i){const{width:e,height:t}=this.viewport;n=t/e;s=e/t}0!==i&&(t.style.transform=`rotate(${e}deg) scale(${n}, ${s})`)}i&&this.annotationLayer&&_classPrivateMethodGet(this,A,_renderAnnotationLayer2).call(this);n&&this.annotationEditorLayer&&_classPrivateMethodGet(this,E,_renderAnnotationEditorLayer2).call(this);s&&this.xfaLayer&&_classPrivateMethodGet(this,x,_renderXfaLayer2).call(this);if(this.textLayer)if(a){var l;this.textLayer.hide();null===(l=this.structTreeLayer)||void 0===l||l.hide()}else r&&_classPrivateMethodGet(this,C,_renderTextLayer2).call(this)}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,t){return this.viewport.convertToPdfPoint(e,t)}draw(){var e=this;if(this.renderingState!==s.RenderingStates.INITIAL){Window.ngxConsole.error("Must be in new state before drawing");this.reset()}const{div:t,pdfPage:i}=this;if(!i){this.renderingState=s.RenderingStates.FINISHED;return Promise.reject(new Error("pdfPage is not loaded"))}this.renderingState=s.RenderingStates.RUNNING;const o=document.createElement("div");o.classList.add("canvasWrapper");t.append(o);if(!this.textLayer&&this.textLayerMode!==s.TextLayerMode.DISABLE&&!i.isPureXfa){this._accessibilityManager||(this._accessibilityManager=new d.TextAccessibilityManager);this.textLayer=new g.TextLayerBuilder({highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported});t.append(this.textLayer.div)}if(!this.annotationLayer&&_classPrivateFieldGet(this,v)!==n.AnnotationMode.DISABLE){const{annotationStorage:e,downloadManager:s,enableScripting:r,fieldObjectsPromise:o,hasJSActionsPromise:l,linkService:c}=_classPrivateFieldGet(this,_).call(this);this._annotationCanvasMap||(this._annotationCanvasMap=new Map);this.annotationLayer=new a.AnnotationLayerBuilder({pageDiv:t,pdfPage:i,annotationStorage:e,imageResourcesPath:this.imageResourcesPath,renderForms:_classPrivateFieldGet(this,v)===n.AnnotationMode.ENABLE_FORMS,linkService:c,downloadManager:s,l10n:this.l10n,enableScripting:r,hasJSActionsPromise:l,fieldObjectsPromise:o,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager})}let l=null;this.renderingQueue&&(l=e=>{if(this.renderingQueue.isHighestPriority(this))e();else{this.renderingState=s.RenderingStates.PAUSED;this.resume=()=>{this.renderingState=s.RenderingStates.RUNNING;e()}}});const finishPaintTask=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;c===e.paintTask&&(e.paintTask=null);if(t instanceof n.RenderingCancelledException)e._renderError=null;else{e._renderError=t;e.renderingState=s.RenderingStates.FINISHED;e._resetZoomLayer(!0);_classPrivateFieldGet(e,P).regularAnnotations=!c.separateAnnots;e.eventBus.dispatch("pagerendered",{source:e,pageNumber:e.id,cssTransform:!1,timestamp:performance.now(),error:e._renderError});if(t)throw t}},c=this.renderer===s.RendererType.SVG?this.paintOnSvg(o):this.paintOnCanvas(o);c.onRenderContinue=l;this.paintTask=c;const h=c.promise.then((()=>finishPaintTask(null).then((async()=>{_classPrivateMethodGet(this,C,_renderTextLayer2).call(this);this.annotationLayer&&await _classPrivateMethodGet(this,A,_renderAnnotationLayer2).call(this);if(!this.annotationEditorLayer){const{annotationEditorUIManager:e}=_classPrivateFieldGet(this,_).call(this);if(!e)return;this.annotationEditorLayer=new r.AnnotationEditorLayerBuilder({uiManager:e,pageDiv:t,pdfPage:i,l10n:this.l10n,accessibilityManager:this._accessibilityManager})}_classPrivateMethodGet(this,E,_renderAnnotationEditorLayer2).call(this)}))),(function(e){return finishPaintTask(e)}));if(i.isPureXfa){if(this.xfaLayer)this.xfaLayer.div&&t.append(this.xfaLayer.div);else{const{annotationStorage:e,linkService:n}=_classPrivateFieldGet(this,_).call(this);this.xfaLayer=new f.XfaLayerBuilder({pageDiv:t,pdfPage:i,annotationStorage:e,linkService:n})}_classPrivateMethodGet(this,x,_renderXfaLayer2).call(this)}t.setAttribute("data-loaded",!0);this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id});return h}paintOnCanvas(e){const t=(0,n.createPromiseCapability)(),i={promise:t.promise,onRenderContinue(e){e()},cancel(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;A.cancel(e)},get separateAnnots(){return A.separateAnnots}},r=this.viewport;let{width:a,height:o}=r;const l=document.createElement("canvas");l.setAttribute("role","presentation");l.hidden=!0;let c=!0;const showCanvas=function(){if(c){l.hidden=!1;c=!1}};e.append(l);this.canvas=l;const d=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0,alpha:!1}:{alpha:!1},p=l.getContext("2d",d),g=this.outputScale=new s.OutputScale;if(this.useOnlyCssZoom){const e=r.clone({scale:n.PixelsPerInch.PDF_TO_CSS_UNITS});g.sx*=e.width/a;g.sy*=e.height/o}if(this.maxCanvasPixels>0){const e=a*o,t=Math.sqrt(this.maxCanvasPixels/e);if(g.sx>t||g.sy>t){g.sx=t;g.sy=t;this.hasRestrictedScaling=!0}else this.hasRestrictedScaling=!1}const f=(0,s.approximateFraction)(g.sx),m=(0,s.approximateFraction)(g.sy);a=(0,s.roundToDivide)(a*g.sx,f[0]);o=(0,s.roundToDivide)(o*g.sy,m[0]);let _=1;if((a>=4096||o>=4096)&&(this.maxWidth||!h.default.test({width:a,height:o}))){const e=this.determineMaxDimensions();_=Math.max(a/e,o/e);if(_>1){const e=Math.floor(100*this.scale/_)/100;_=this.scale/e;r.width/=_;r.height/=_;(0,u.warn)(`Page ${this.id}: Reduced the maximum zoom to ${e} because the browser can't render larger canvases.`)}else _=1}l.width=(0,s.roundToDivide)(r.width*g.sx,f[0]);l.height=(0,s.roundToDivide)(r.height*g.sy,m[0]);const{style:b}=l;b.width=(0,s.roundToDivide)(r.width*_,f[1])+"px";b.height=(0,s.roundToDivide)(r.height*_,m[1])+"px";this.paintedViewportMap.set(l,r);const w=g.scaled?[g.sx,0,0,g.sy,0,0]:null;let y=PDFViewerApplicationOptions.get("pdfBackgroundColor");if("function"==typeof y){const e=y({pageNumber:this.id,pageLabel:this.pageLabel});e&&(y=e)}let P=y?PDFViewerApplicationOptions.get("pdfBackgroundColorToReplace"):null;if("function"==typeof P){const e=P({pageNumber:this.id,pageLabel:this.pageLabel});e&&(P=e)}const S={canvasContext:p,transform:w,viewport:r,annotationMode:_classPrivateFieldGet(this,v),optionalContentConfigPromise:this._optionalContentConfigPromise,background:y,backgroundColorToReplace:P,annotationCanvasMap:this._annotationCanvasMap,pageColors:this.pageColors},A=this.pdfPage.render(S);A.onContinue=function(e){showCanvas();i.onRenderContinue?i.onRenderContinue(e):e()};A.promise.then((function(){showCanvas();t.resolve()}),(function(e){e instanceof n.RenderingCancelledException||showCanvas();t.reject(e)}));return i}paintOnSvg(e){let t=!1;const ensureNotCancelled=()=>{if(t)throw new n.RenderingCancelledException(`Rendering cancelled, page ${this.id}`,"svg")},i=this.pdfPage,r=this.viewport.clone({scale:n.PixelsPerInch.PDF_TO_CSS_UNITS});return{promise:i.getOperatorList({annotationMode:_classPrivateFieldGet(this,v)}).then((t=>{ensureNotCancelled();return new n.SVGGraphics(i.commonObjs,i.objs).getSVG(t,r).then((t=>{ensureNotCancelled();this.svg=t;this.paintedViewportMap.set(t,r);t.style.width=e.style.width;t.style.height=e.style.height;this.renderingState=s.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(!h.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,P);return e&&t?this.canvas:null}};function _setDimensions2(){const{viewport:e}=this;if(this.pdfPage){if(_classPrivateFieldGet(this,w)===e.rotation)return;_classPrivateFieldSet(this,w,e.rotation)}(0,n.setLayerDimensions)(this.div,e,!0,!1)}async function _renderAnnotationLayer2(){let e=null;try{await this.annotationLayer.render(this.viewport,"display")}catch(t){console.error(`#renderAnnotationLayer: "${t}".`);e=t}finally{this.eventBus.dispatch("annotationlayerrendered",{source:this,pageNumber:this.id,error:e})}}async function _renderAnnotationEditorLayer2(){let e=null;try{await this.annotationEditorLayer.render(this.viewport,"display")}catch(t){console.error(`#renderAnnotationEditorLayer: "${t}".`);e=t}finally{this.eventBus.dispatch("annotationeditorlayerrendered",{source:this,pageNumber:this.id,error:e})}}async function _renderXfaLayer2(){let e=null;try{const t=await this.xfaLayer.render(this.viewport,"display");null!=t&&t.textDivs&&this._textHighlighter&&_classPrivateMethodGet(this,T,_buildXfaTextContentItems2).call(this,t.textDivs)}catch(t){console.error(`#renderXfaLayer: "${t}".`);e=t}finally{this.eventBus.dispatch("xfalayerrendered",{source:this,pageNumber:this.id,error:e})}}async function _renderTextLayer2(){const{pdfPage:e,textLayer:t,viewport:i}=this;if(!t)return;let s=null;try{if(!t.renderingDone){const i=e.streamTextContent({includeMarkedContent:!0});t.setTextContentSource(i)}await t.render(i)}catch(e){if(e instanceof n.AbortException)return;console.error(`#renderTextLayer: "${e}".`);s=e}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.id,numTextDivs:t.numTextDivs,error:s});_classPrivateMethodGet(this,M,_renderStructTreeLayer2).call(this)}async function _renderStructTreeLayer2(){var e,t;if(!this.textLayer)return;this.structTreeLayer||(this.structTreeLayer=new c.StructTreeLayerBuilder);const i=await(this.structTreeLayer.renderingDone?null:this.pdfPage.getStructTree()),n=null===(e=this.structTreeLayer)||void 0===e?void 0:e.render(i);if(n){var s;null===(s=this.canvas)||void 0===s||s.append(n)}null===(t=this.structTreeLayer)||void 0===t||t.show()}async function _buildXfaTextContentItems2(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()}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.AnnotationEditorLayerBuilder=void 0;var n=i(4),s=i(33);t.AnnotationEditorLayerBuilder=class AnnotationEditorLayerBuilder{#M;constructor(e){this.pageDiv=e.pageDiv;this.pdfPage=e.pdfPage;this.accessibilityManager=e.accessibilityManager;this.l10n=e.l10n||s.NullL10n;this.annotationEditorLayer=null;this.div=null;this._cancelled=!1;this.#M=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}const s=this.div=document.createElement("div");s.className="annotationEditorLayer";s.tabIndex=0;s.hidden=!0;this.pageDiv.append(s);this.annotationEditorLayer=new n.AnnotationEditorLayer({uiManager:this.#M,div:s,accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:i});const r={viewport:i,div:s,annotations:null,intent:t};this.annotationEditorLayer.render(r);this.show()}cancel(){this._cancelled=!0;if(this.div){this.pageDiv=null;this.annotationEditorLayer.destroy();this.div.remove()}}hide(){this.div&&(this.div.hidden=!0)}show(){this.div&&!this.annotationEditorLayer.isEmpty&&(this.div.hidden=!1)}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.AnnotationLayerBuilder=void 0;var n=i(4),s=i(33),r=i(3);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 _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 a=new WeakMap,o=new WeakMap,l=new WeakSet;t.AnnotationLayerBuilder=class AnnotationLayerBuilder{constructor(e){let{pageDiv:t,pdfPage:i,linkService:n,downloadManager:r,annotationStorage:c=null,imageResourcesPath:d="",renderForms:h=!0,l10n:u=s.NullL10n,enableScripting:p=!1,hasJSActionsPromise:g=null,fieldObjectsPromise:f=null,annotationCanvasMap:m=null,accessibilityManager:v=null}=e;!function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t);t.add(e)}(this,l);_classPrivateFieldInitSpec(this,a,{writable:!0,value:0});_classPrivateFieldInitSpec(this,o,{writable:!0,value:null});this.pageDiv=t;this.pdfPage=i;this.linkService=n;this.downloadManager=r;this.imageResourcesPath=d;this.renderForms=h;this.l10n=u;this.annotationStorage=c;this.enableScripting=p;this._hasJSActionsPromise=g||Promise.resolve(!1);this._fieldObjectsPromise=f||Promise.resolve(null);this._annotationCanvasMap=m;this._accessibilityManager=v;this.div=null;this._cancelled=!1;this._eventBus=n.eventBus}async render(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"display";if(this.div){if(this._cancelled||0===_classPrivateFieldGet(this,a))return;n.AnnotationLayer.update({viewport:e.clone({dontFlip:!0}),div:this.div,annotationCanvasMap:this._annotationCanvasMap});return}const[i,s,c]=await Promise.all([this.pdfPage.getAnnotations({intent:t}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(!this._cancelled){_classPrivateFieldSet(this,a,i.length);this.div=document.createElement("div");this.div.className="annotationLayer";this.pageDiv.append(this.div);if(0!==_classPrivateFieldGet(this,a)){n.AnnotationLayer.render({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:s,fieldObjects:c,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager});this.l10n.translate(this.div);this.linkService.isInPresentationMode&&_classPrivateMethodGet(this,l,_updatePresentationModeState2).call(this,r.PresentationModeState.FULLSCREEN);if(!_classPrivateFieldGet(this,o)){var d;_classPrivateFieldSet(this,o,(e=>{_classPrivateMethodGet(this,l,_updatePresentationModeState2).call(this,e.state)}));null===(d=this._eventBus)||void 0===d||d._on("presentationmodechanged",_classPrivateFieldGet(this,o))}}else this.hide()}}cancel(){this._cancelled=!0;if(_classPrivateFieldGet(this,o)){var e;null===(e=this._eventBus)||void 0===e||e._off("presentationmodechanged",_classPrivateFieldGet(this,o));_classPrivateFieldSet(this,o,null)}}hide(){this.div&&(this.div.hidden=!0)}};function _updatePresentationModeState2(e){if(!this.div)return;let t=!1;switch(e){case r.PresentationModeState.FULLSCREEN:t=!0;break;case r.PresentationModeState.NORMAL:break;default:return}for(const e of this.div.childNodes)e.hasAttribute("data-internal-link")||(e.inert=t)}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.StructTreeLayerBuilder=void 0;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 _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 _classExtractFieldDescriptor(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}const i={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},n=/^H(\d+)$/;var s=new WeakMap,r=new WeakSet,a=new WeakSet;t.StructTreeLayerBuilder=class StructTreeLayerBuilder{constructor(){_classPrivateMethodInitSpec(this,a);_classPrivateMethodInitSpec(this,r);!function _classPrivateFieldInitSpec(e,t,i){_checkPrivateRedeclaration(e,t);t.set(e,i)}(this,s,{writable:!0,value:void 0})}get renderingDone(){return void 0!==_classPrivateFieldGet(this,s)}render(e){if(void 0!==_classPrivateFieldGet(this,s))return _classPrivateFieldGet(this,s);const t=_classPrivateMethodGet(this,a,_walk2).call(this,e);null==t||t.classList.add("structTree");return _classPrivateFieldSet(this,s,t)}hide(){_classPrivateFieldGet(this,s)&&!_classPrivateFieldGet(this,s).hidden&&(_classPrivateFieldGet(this,s).hidden=!0)}show(){var e;null!==(e=_classPrivateFieldGet(this,s))&&void 0!==e&&e.hidden&&(_classPrivateFieldGet(this,s).hidden=!1)}};function _setAttributes2(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)}function _walk2(e){if(!e)return null;const t=document.createElement("span");if("role"in e){const{role:s}=e,r=s.match(n);if(r){t.setAttribute("role","heading");t.setAttribute("aria-level",r[1])}else i[s]&&t.setAttribute("role",i[s])}_classPrivateMethodGet(this,r,_setAttributes2).call(this,e,t);if(e.children)if(1===e.children.length&&"id"in e.children[0])_classPrivateMethodGet(this,r,_setAttributes2).call(this,e.children[0],t);else for(const i of e.children)t.append(_classPrivateMethodGet(this,a,_walk2).call(this,i));return t}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TextAccessibilityManager=void 0;var n=i(3);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 _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 _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 s=new WeakMap,r=new WeakMap,a=new WeakMap,o=new WeakMap,l=new WeakSet;class TextAccessibilityManager{constructor(){!function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t);t.add(e)}(this,l);_classPrivateFieldInitSpec(this,s,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,r,{writable:!0,value:null});_classPrivateFieldInitSpec(this,a,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,o,{writable:!0,value:new Map})}setTextMapping(e){_classPrivateFieldSet(this,r,e)}enable(){if(_classPrivateFieldGet(this,s))throw new Error("TextAccessibilityManager is already enabled.");if(!_classPrivateFieldGet(this,r))throw new Error("Text divs and strings have not been set.");_classPrivateFieldSet(this,s,!0);_classPrivateFieldSet(this,r,_classPrivateFieldGet(this,r).slice());_classPrivateFieldGet(this,r).sort(_classStaticPrivateMethodGet(TextAccessibilityManager,TextAccessibilityManager,_compareElementPositions));if(_classPrivateFieldGet(this,a).size>0){const e=_classPrivateFieldGet(this,r);for(const[t,i]of _classPrivateFieldGet(this,a)){document.getElementById(t)?_classPrivateMethodGet(this,l,_addIdToAriaOwns2).call(this,t,e[i]):_classPrivateFieldGet(this,a).delete(t)}}for(const[e,t]of _classPrivateFieldGet(this,o))this.addPointerInTextLayer(e,t);_classPrivateFieldGet(this,o).clear()}disable(){if(_classPrivateFieldGet(this,s)){_classPrivateFieldGet(this,o).clear();_classPrivateFieldSet(this,r,null);_classPrivateFieldSet(this,s,!1)}}removePointerInTextLayer(e){var t;if(!_classPrivateFieldGet(this,s)){_classPrivateFieldGet(this,o).delete(e);return}const i=_classPrivateFieldGet(this,r);if(!i||0===i.length)return;const{id:n}=e,l=_classPrivateFieldGet(this,a).get(n);if(void 0===l)return;const c=i[l];_classPrivateFieldGet(this,a).delete(n);let d=c.getAttribute("aria-owns");if(null!==(t=d)&&void 0!==t&&t.includes(n)){d=d.split(" ").filter((e=>e!==n)).join(" ");if(d)c.setAttribute("aria-owns",d);else{c.removeAttribute("aria-owns");c.setAttribute("role","presentation")}}}addPointerInTextLayer(e,t){const{id:i}=e;if(!i)return;if(!_classPrivateFieldGet(this,s)){_classPrivateFieldGet(this,o).set(e,t);return}t&&this.removePointerInTextLayer(e);const c=_classPrivateFieldGet(this,r);if(!c||0===c.length)return;const d=(0,n.binarySearchFirstItem)(c,(t=>_classStaticPrivateMethodGet(TextAccessibilityManager,TextAccessibilityManager,_compareElementPositions).call(TextAccessibilityManager,e,t)<0)),h=Math.max(0,d-1);_classPrivateMethodGet(this,l,_addIdToAriaOwns2).call(this,i,c[h]);_classPrivateFieldGet(this,a).set(i,h)}moveElementInDOM(e,t,i,s){this.addPointerInTextLayer(i,s);if(!e.hasChildNodes()){e.append(t);return}const r=Array.from(e.childNodes).filter((e=>e!==t));if(0===r.length)return;const a=i||t,o=(0,n.binarySearchFirstItem)(r,(e=>_classStaticPrivateMethodGet(TextAccessibilityManager,TextAccessibilityManager,_compareElementPositions).call(TextAccessibilityManager,a,e)<0));0===o?r[0].before(t):r[o-1].after(t)}}t.TextAccessibilityManager=TextAccessibilityManager;function _compareElementPositions(e,t){const i=e.getBoundingClientRect(),n=t.getBoundingClientRect();if(0===i.width&&0===i.height)return 1;if(0===n.width&&0===n.height)return-1;const s=i.y,r=i.y+i.height,a=i.y+i.height/2,o=n.y,l=n.y+n.height,c=n.y+n.height/2;if(a<=o&&c>=r)return-1;if(c<=s&&a>=l)return 1;return i.x+i.width/2-(n.x+n.width/2)}function _addIdToAriaOwns2(e,t){const i=t.getAttribute("aria-owns");null!=i&&i.includes(e)||t.setAttribute("aria-owns",i?`${i} ${e}`:e);t.removeAttribute("role")}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=void 0;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,s=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var i,n,s={},r=Object.keys(e);for(n=0;n<r.length;n++){i=r[n];t.indexOf(i)>=0||(s[i]=e[i])}return s}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++){i=r[n];t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(s[i]=e[i])}}return s}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,s,r=[],a=!0,o=!1;try{for(i=i.call(e);!(a=(n=i.next()).done);a=!0){r.push(n.value);if(t&&r.length===t)break}}catch(e){o=!0;s=e}finally{try{a||null==i.return||i.return()}finally{if(o)throw s}}return r}(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(),s=Math.max(Math.ceil(n[0]),1),r=Math.max(Math.ceil(n[1]),1),a=[s-1,r-1,1,1],o=Date.now(),l="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;if(l){t=new OffscreenCanvas(1,1);i=new OffscreenCanvas(s,r)}else{(t=document.createElement("canvas")).width=1;t.height=1;(i=document.createElement("canvas")).width=s;i.height=r}var c=t.getContext("2d"),d=i.getContext("2d");if(d){d.fillRect.apply(d,a);c.drawImage(i,s-1,r-1,1,1,0,0,1,1)}var h=c&&0!==c.getImageData(0,0,1,1).data[3],u=Date.now()-o;if(l){postMessage({width:s,height:r,benchmark:u,isTestPass:h});!h&&e.sizes.length&&canvasTest(e)}else if(h)e.onSuccess(s,r,u);else{e.onError(s,r,u);e.sizes.length&&canvasTest(e)}return h}var i={area:[16384,14188,11402,11180,10836,8192,4096,1],height:[8388607,65535,32767,16384,8192,4096,1],width:[4194303,65535,32767,16384,8192,4096,1]},n=["onError","onSuccess"],s={max:null,min:1,sizes:[],step:1024,usePromise:!1,useWorker:!1,onError:Function.prototype,onSuccess:Function.prototype},r={};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 a=e.min||s.min,o=e.step||s.step,l=Math.max(e.width,e.height);l>=a;){var c=t||i?l:1,d=t||n?l:1;r.push([c,d]);l-=o}else e.sizes.forEach((function(e){var s=t||i?e:1,a=t||n?e:1;r.push([s,a])}));return r}function handleMethod(e){var t=window&&"HTMLCanvasElement"in window,i=window&&"OffscreenCanvas"in window,s=Date.now(),a=e.onError,o=e.onSuccess,l=_objectWithoutProperties(e,n),c=null;if(!t)return!1;if(e.useWorker&&i){var d="\n            var canvasTest = ".concat(canvasTest.toString(),";\n            onmessage = function(e) {\n                canvasTest(e.data);\n            };\n        "),h=new Blob([d],{type:"application/javascript"}),u=URL.createObjectURL(h);c=new Worker(u);URL.revokeObjectURL(u);c.onmessage=function(e){var t=e.data,i=t.width,n=t.height,a=t.benchmark;if(t.isTestPass){r[s].onSuccess(i,n,a);delete r[s]}else r[s].onError(i,n,a)}}if(e.usePromise)return new Promise((function(t,i){var n=_objectSpread2(_objectSpread2({},e),{},{onError:function onError(t,n,s){var r;if(0===e.sizes.length)r=!0;else{var o=_slicedToArray(e.sizes.slice(-1),1),l=_slicedToArray(o[0],2),c=l[0],d=l[1];r=t===c&&n===d}a(t,n,s);r&&i({width:t,height:n,benchmark:s})},onSuccess:function onSuccess(e,i,n){o(e,i,n);t({width:e,height:i,benchmark:n})}});if(c){var d=n.onError,h=n.onSuccess;r[s]={onError:d,onSuccess:h};c.postMessage(l)}else canvasTest(n)}));if(!c)return canvasTest(e);r[s]={onError:a,onSuccess:o};c.postMessage(l)}var a={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(i.area)});return handleMethod(_objectSpread2(_objectSpread2(_objectSpread2({},s),e),{},{sizes:t}))},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(i.height)});return handleMethod(_objectSpread2(_objectSpread2(_objectSpread2({},s),e),{},{sizes:t}))},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(i.width)});return handleMethod(_objectSpread2(_objectSpread2(_objectSpread2({},s),e),{},{sizes:t}))},test:function test(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=_objectSpread2(_objectSpread2({},s),e);t.sizes=_toConsumableArray(t.sizes);t.width&&t.height&&(t.sizes=[[t.width,t.height]]);return handleMethod(t)}};t.default=a},(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.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.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.BASELINE_FACTOR=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.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 s=0;s<t;s+=i){const r=Math.min(s+i,t),a=e.subarray(s,r);n.push(String.fromCharCode.apply(null,a))}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://${e}`)}if(i.tryConvertEncoding)try{e=stringToUTF8String(e)}catch(e){}}const n=t?new URL(e,t):new URL(e);if(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}}(n))return n}catch(e){}return null};t.getModificationDate=function getModificationDate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[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")].join("")};t.getVerbosityLevel=function getVerbosityLevel(){return s};t.info=function info(e){s>=n.INFOS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log(`Info: ${e}`):Window&&Window.ngxConsole?Window.ngxConsole.log(`Info: ${e}`):console.log(`Info: ${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.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)&&(s=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: "${e}".`)}}const t=[];for(let i=0,n=e.length;i<n;i++){const n=o[e.charCodeAt(i)];t.push(n?String.fromCharCode(n):e.charAt(i))}return t.join("")};t.stringToUTF8String=stringToUTF8String;t.unreachable=unreachable;t.utf8StringToString=function utf8StringToString(e){return unescape(encodeURIComponent(e))};t.warn=warn;if(!globalThis._pdfjsCompatibilityChecked){globalThis._pdfjsCompatibilityChecked=!0;i(42)}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.BASELINE_FACTOR=.25925925925925924;t.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,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"};const n={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=n;t.CMapCompressionType={NONE:0,BINARY:1};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,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};t.UNSUPPORTED_FEATURES={forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",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 s=n.WARNINGS;function warn(e){s>=n.WARNINGS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log(`Warning: ${e}`):Window&&Window.ngxConsole?Window.ngxConsole.log(`Warning: ${e}`):console.log(`Warning: ${e}`))}function unreachable(e){throw new Error(e)}function shadow(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.defineProperty(e,t,{value:i,enumerable:!n,configurable:!0,writable:!1});return i}const r=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=r;t.PasswordException=class PasswordException extends r{constructor(e,t){super(e,"PasswordException");this.code=t}};t.UnknownErrorException=class UnknownErrorException extends r{constructor(e,t){super(e,"UnknownErrorException");this.details=t}};t.InvalidPDFException=class InvalidPDFException extends r{constructor(e){super(e,"InvalidPDFException")}};t.MissingPDFException=class MissingPDFException extends r{constructor(e){super(e,"MissingPDFException")}};t.UnexpectedResponseException=class UnexpectedResponseException extends r{constructor(e,t){super(e,"UnexpectedResponseException");this.status=t}};t.FormatError=class FormatError extends r{constructor(e){super(e,"FormatError")}};t.AbortException=class AbortException extends r{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}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)}static get platform(){return"undefined"==typeof navigator?shadow(this,"platform",{isWin:!1,isMac:!1}):shadow(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}};const a=[...Array(256).keys()].map((e=>e.toString(16).padStart(2,"0")));class Util{static makeHexColor(e,t,i){return`#${a[e]}${a[t]}${a[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),s=Util.applyTransform([e[0],e[3]],t),r=Util.applyTransform([e[2],e[1]],t);return[Math.min(i[0],n[0],s[0],r[0]),Math.min(i[1],n[1],s[1],r[1]),Math.max(i[0],n[0],s[0],r[0]),Math.max(i[1],n[1],s[1],r[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 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],s=e[2]*t[0]+e[3]*t[2],r=e[2]*t[1]+e[3]*t[3],a=(i+r)/2,o=Math.sqrt((i+r)**2-4*(i*r-s*n))/2,l=a+o||1,c=a-o||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 s=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),r=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return s>r?null:[i,s,n,r]}static bezierBoundingBox(e,t,i,n,s,r,a,o){const l=[],c=[[],[]];let d,h,u,p,g,f,m,v;for(let c=0;c<2;++c){if(0===c){h=6*e-12*i+6*s;d=-3*e+9*i-9*s+3*a;u=3*i-3*e}else{h=6*t-12*n+6*r;d=-3*t+9*n-9*r+3*o;u=3*n-3*t}if(Math.abs(d)<1e-12){if(Math.abs(h)<1e-12)continue;p=-u/h;0<p&&p<1&&l.push(p)}else{m=h*h-4*u*d;v=Math.sqrt(m);if(!(m<0)){g=(-h+v)/(2*d);0<g&&g<1&&l.push(g);f=(-h-v)/(2*d);0<f&&f<1&&l.push(f)}}}let _,b=l.length;const w=b;for(;b--;){p=l[b];_=1-p;c[0][b]=_*_*_*e+3*_*_*p*i+3*_*p*p*s+p*p*p*a;c[1][b]=_*_*_*t+3*_*_*p*n+3*_*p*p*r+p*p*p*o}c[0][w]=e;c[1][w]=t;c[0][w+1]=a;c[1][w+1]=o;c[0].length=c[1].length=w+2;return[Math.min(...c[0]),Math.min(...c[1]),Math.max(...c[0]),Math.max(...c[1])]}}t.Util=Util;const o=[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)=>{"use strict";!function checkNodeBtoa(){globalThis.btoa}();!function checkNodeAtob(){globalThis.atob}();!function checkDOMMatrix(){globalThis.DOMMatrix}();!function checkPath2D(){globalThis.Path2D}();!function checkReadableStream(){globalThis.ReadableStream}();!function checkArrayAt(){Array.prototype.at||i(43)}();!function checkTypedArrayAt(){Uint8Array.prototype.at||i(117)}();!function checkStructuredClone(){globalThis.structuredClone||i(127)}()},(e,t,i)=>{i(44);var n=i(116);e.exports=n("Array","at")},(e,t,i)=>{"use strict";var n=i(45),s=i(82),r=i(106),a=i(104),o=i(111);n({target:"Array",proto:!0},{at:function at(e){var t=s(this),i=r(t),n=a(e),o=n>=0?n:i+n;return o<0||o>=i?void 0:t[o]}});o("at")},(e,t,i)=>{var n=i(46),s=i(47).f,r=i(86),a=i(90),o=i(80),l=i(98),c=i(110);e.exports=function(e,t){var i,d,h,u,p,g=e.target,f=e.global,m=e.stat;if(i=f?n:m?n[g]||o(g,{}):(n[g]||{}).prototype)for(d in t){u=t[d];h=e.dontCallGetSet?(p=s(i,d))&&p.value:i[d];if(!c(f?d:g+(m?".":"#")+d,e.forced)&&void 0!==h){if(typeof u==typeof h)continue;l(u,h)}(e.sham||h&&h.sham)&&r(u,"sham",!0);a(i,d,u,e)}}},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,t,i)=>{var n=i(48),s=i(50),r=i(52),a=i(53),o=i(54),l=i(60),c=i(81),d=i(84),h=Object.getOwnPropertyDescriptor;t.f=n?h:function getOwnPropertyDescriptor(e,t){e=o(e);t=l(t);if(d)try{return h(e,t)}catch(e){}if(c(e,t))return a(!s(r.f,e,t),e[t])}},(e,t,i)=>{var n=i(49);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},(e,t,i)=>{var n=i(51),s=Function.prototype.call;e.exports=n?s.bind(s):function(){return s.apply(s,arguments)}},(e,t,i)=>{var n=i(49);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},(e,t)=>{"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,s=n&&!i.call({1:2},1);t.f=s?function propertyIsEnumerable(e){var t=n(this,e);return!!t&&t.enumerable}:i},e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},(e,t,i)=>{var n=i(55),s=i(58);e.exports=function(e){return n(s(e))}},(e,t,i)=>{var n=i(56),s=i(49),r=i(57),a=Object,o=n("".split);e.exports=s((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==r(e)?o(e,""):a(e)}:a},(e,t,i)=>{var n=i(51),s=Function.prototype,r=s.call,a=n&&s.bind.bind(r,r);e.exports=n?a:function(e){return function(){return r.apply(e,arguments)}}},(e,t,i)=>{var n=i(56),s=n({}.toString),r=n("".slice);e.exports=function(e){return r(s(e),8,-1)}},(e,t,i)=>{var n=i(59),s=TypeError;e.exports=function(e){if(n(e))throw s("Can't call method on "+e);return e}},e=>{e.exports=function(e){return null==e}},(e,t,i)=>{var n=i(61),s=i(65);e.exports=function(e){var t=n(e,"string");return s(t)?t:t+""}},(e,t,i)=>{var n=i(50),s=i(62),r=i(65),a=i(72),o=i(75),l=i(76),c=TypeError,d=l("toPrimitive");e.exports=function(e,t){if(!s(e)||r(e))return e;var i,l=a(e,d);if(l){void 0===t&&(t="default");i=n(l,e,t);if(!s(i)||r(i))return i;throw c("Can't convert object to primitive value")}void 0===t&&(t="number");return o(e,t)}},(e,t,i)=>{var n=i(63),s=i(64),r=s.all;e.exports=s.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===r}:function(e){return"object"==typeof e?null!==e:n(e)}},(e,t,i)=>{var n=i(64),s=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===s}:function(e){return"function"==typeof e}},e=>{var t="object"==typeof document&&document.all,i=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:i}},(e,t,i)=>{var n=i(66),s=i(63),r=i(67),a=i(68),o=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return s(t)&&r(t.prototype,o(e))}},(e,t,i)=>{var n=i(46),s=i(63),aFunction=function(e){return s(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(56);e.exports=n({}.isPrototypeOf)},(e,t,i)=>{var n=i(69);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(e,t,i)=>{var n=i(70),s=i(49);e.exports=!!Object.getOwnPropertySymbols&&!s((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},(e,t,i)=>{var n,s,r=i(46),a=i(71),o=r.process,l=r.Deno,c=o&&o.versions||l&&l.version,d=c&&c.v8;d&&(s=(n=d.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1]));!s&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(s=+n[1]);e.exports=s},e=>{e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(e,t,i)=>{var n=i(73),s=i(59);e.exports=function(e,t){var i=e[t];return s(i)?void 0:n(i)}},(e,t,i)=>{var n=i(63),s=i(74),r=TypeError;e.exports=function(e){if(n(e))return e;throw r(s(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(50),s=i(63),r=i(62),a=TypeError;e.exports=function(e,t){var i,o;if("string"===t&&s(i=e.toString)&&!r(o=n(i,e)))return o;if(s(i=e.valueOf)&&!r(o=n(i,e)))return o;if("string"!==t&&s(i=e.toString)&&!r(o=n(i,e)))return o;throw a("Can't convert object to primitive value")}},(e,t,i)=>{var n=i(46),s=i(77),r=i(81),a=i(83),o=i(69),l=i(68),c=n.Symbol,d=s("wks"),h=l?c.for||c:c&&c.withoutSetter||a;e.exports=function(e){r(d,e)||(d[e]=o&&r(c,e)?c[e]:h("Symbol."+e));return d[e]}},(e,t,i)=>{var n=i(78),s=i(79);(e.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.27.2",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"})},e=>{e.exports=!1},(e,t,i)=>{var n=i(46),s=i(80),r="__core-js_shared__",a=n[r]||s(r,{});e.exports=a},(e,t,i)=>{var n=i(46),s=Object.defineProperty;e.exports=function(e,t){try{s(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},(e,t,i)=>{var n=i(56),s=i(82),r=n({}.hasOwnProperty);e.exports=Object.hasOwn||function hasOwn(e,t){return r(s(e),t)}},(e,t,i)=>{var n=i(58),s=Object;e.exports=function(e){return s(n(e))}},(e,t,i)=>{var n=i(56),s=0,r=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++s+r,36)}},(e,t,i)=>{var n=i(48),s=i(49),r=i(85);e.exports=!n&&!s((function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},(e,t,i)=>{var n=i(46),s=i(62),r=n.document,a=s(r)&&s(r.createElement);e.exports=function(e){return a?r.createElement(e):{}}},(e,t,i)=>{var n=i(48),s=i(87),r=i(53);e.exports=n?function(e,t,i){return s.f(e,t,r(1,i))}:function(e,t,i){e[t]=i;return e}},(e,t,i)=>{var n=i(48),s=i(84),r=i(88),a=i(89),o=i(60),l=TypeError,c=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h="enumerable",u="configurable",p="writable";t.f=n?r?function defineProperty(e,t,i){a(e);t=o(t);a(i);if("function"==typeof e&&"prototype"===t&&"value"in i&&p in i&&!i[p]){var n=d(e,t);if(n&&n[p]){e[t]=i.value;i={configurable:u in i?i[u]:n[u],enumerable:h in i?i[h]:n[h],writable:!1}}}return c(e,t,i)}:c:function defineProperty(e,t,i){a(e);t=o(t);a(i);if(s)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(48),s=i(49);e.exports=n&&s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(e,t,i)=>{var n=i(62),s=String,r=TypeError;e.exports=function(e){if(n(e))return e;throw r(s(e)+" is not an object")}},(e,t,i)=>{var n=i(63),s=i(87),r=i(91),a=i(80);e.exports=function(e,t,i,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:t;n(i)&&r(i,c,o);if(o.global)l?e[t]=i:a(t,i);else{try{o.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=i:s.f(e,t,{value:i,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e}},(e,t,i)=>{var n=i(56),s=i(49),r=i(63),a=i(81),o=i(48),l=i(92).CONFIGURABLE,c=i(93),d=i(94),h=d.enforce,u=d.get,p=String,g=Object.defineProperty,f=n("".slice),m=n("".replace),v=n([].join),_=o&&!s((function(){return 8!==g((function(){}),"length",{value:8}).length})),b=String(String).split("String"),w=e.exports=function(e,t,i){"Symbol("===f(p(t),0,7)&&(t="["+m(p(t),/^Symbol\(([^)]*)\)/,"$1")+"]");i&&i.getter&&(t="get "+t);i&&i.setter&&(t="set "+t);(!a(e,"name")||l&&e.name!==t)&&(o?g(e,"name",{value:t,configurable:!0}):e.name=t);_&&i&&a(i,"arity")&&e.length!==i.arity&&g(e,"length",{value:i.arity});try{i&&a(i,"constructor")&&i.constructor?o&&g(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=h(e);a(n,"source")||(n.source=v(b,"string"==typeof t?t:""));return e};Function.prototype.toString=w((function toString(){return r(this)&&u(this).source||c(this)}),"toString")},(e,t,i)=>{var n=i(48),s=i(81),r=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,o=s(r,"name"),l=o&&"something"===function something(){}.name,c=o&&(!n||n&&a(r,"name").configurable);e.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},(e,t,i)=>{var n=i(56),s=i(63),r=i(79),a=n(Function.toString);s(r.inspectSource)||(r.inspectSource=function(e){return a(e)});e.exports=r.inspectSource},(e,t,i)=>{var n,s,r,a=i(95),o=i(46),l=i(62),c=i(86),d=i(81),h=i(79),u=i(96),p=i(97),g="Object already initialized",f=o.TypeError,m=o.WeakMap;if(a||h.state){var v=h.state||(h.state=new m);v.get=v.get;v.has=v.has;v.set=v.set;n=function(e,t){if(v.has(e))throw f(g);t.facade=e;v.set(e,t);return t};s=function(e){return v.get(e)||{}};r=function(e){return v.has(e)}}else{var _=u("state");p[_]=!0;n=function(e,t){if(d(e,_))throw f(g);t.facade=e;c(e,_,t);return t};s=function(e){return d(e,_)?e[_]:{}};r=function(e){return d(e,_)}}e.exports={set:n,get:s,has:r,enforce:function(e){return r(e)?s(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!l(t)||(i=s(t)).type!==e)throw f("Incompatible receiver, "+e+" required");return i}}}},(e,t,i)=>{var n=i(46),s=i(63),r=n.WeakMap;e.exports=s(r)&&/native code/.test(String(r))},(e,t,i)=>{var n=i(77),s=i(83),r=n("keys");e.exports=function(e){return r[e]||(r[e]=s(e))}},e=>{e.exports={}},(e,t,i)=>{var n=i(81),s=i(99),r=i(47),a=i(87);e.exports=function(e,t,i){for(var o=s(t),l=a.f,c=r.f,d=0;d<o.length;d++){var h=o[d];n(e,h)||i&&n(i,h)||l(e,h,c(t,h))}}},(e,t,i)=>{var n=i(66),s=i(56),r=i(100),a=i(109),o=i(89),l=s([].concat);e.exports=n("Reflect","ownKeys")||function ownKeys(e){var t=r.f(o(e)),i=a.f;return i?l(t,i(e)):t}},(e,t,i)=>{var n=i(101),s=i(108).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return n(e,s)}},(e,t,i)=>{var n=i(56),s=i(81),r=i(54),a=i(102).indexOf,o=i(97),l=n([].push);e.exports=function(e,t){var i,n=r(e),c=0,d=[];for(i in n)!s(o,i)&&s(n,i)&&l(d,i);for(;t.length>c;)s(n,i=t[c++])&&(~a(d,i)||l(d,i));return d}},(e,t,i)=>{var n=i(54),s=i(103),r=i(106),createMethod=function(e){return function(t,i,a){var o,l=n(t),c=r(l),d=s(a,c);if(e&&i!=i){for(;c>d;)if((o=l[d++])!=o)return!0}else for(;c>d;d++)if((e||d in l)&&l[d]===i)return e||d||0;return!e&&-1}};e.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(e,t,i)=>{var n=i(104),s=Math.max,r=Math.min;e.exports=function(e,t){var i=n(e);return i<0?s(i+t,0):r(i,t)}},(e,t,i)=>{var n=i(105);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(107);e.exports=function(e){return n(e.length)}},(e,t,i)=>{var n=i(104),s=Math.min;e.exports=function(e){return e>0?s(n(e),9007199254740991):0}},e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(e,t)=>{t.f=Object.getOwnPropertySymbols},(e,t,i)=>{var n=i(49),s=i(63),r=/#|\.prototype\./,isForced=function(e,t){var i=o[a(e)];return i==c||i!=l&&(s(t)?n(t):!!t)},a=isForced.normalize=function(e){return String(e).replace(r,".").toLowerCase()},o=isForced.data={},l=isForced.NATIVE="N",c=isForced.POLYFILL="P";e.exports=isForced},(e,t,i)=>{var n=i(76),s=i(112),r=i(87).f,a=n("unscopables"),o=Array.prototype;null==o[a]&&r(o,a,{configurable:!0,value:s(null)});e.exports=function(e){o[a][e]=!0}},(e,t,i)=>{var n,s=i(89),r=i(113),a=i(108),o=i(97),l=i(115),c=i(85),d=i(96),h="prototype",u="script",p=d("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return"<"+u+">"+e+"</"+u+">"},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"),i="java"+u+":";t.style.display="none";l.appendChild(t);t.src=String(i);(e=t.contentWindow.document).open();e.write(scriptTag("document.F=Object"));e.close();return e.F}():NullProtoObjectViaActiveX(n);for(var e=a.length;e--;)delete NullProtoObject[h][a[e]];return NullProtoObject()};o[p]=!0;e.exports=Object.create||function create(e,t){var i;if(null!==e){EmptyConstructor[h]=s(e);i=new EmptyConstructor;EmptyConstructor[h]=null;i[p]=e}else i=NullProtoObject();return void 0===t?i:r.f(i,t)}},(e,t,i)=>{var n=i(48),s=i(88),r=i(87),a=i(89),o=i(54),l=i(114);t.f=n&&!s?Object.defineProperties:function defineProperties(e,t){a(e);for(var i,n=o(t),s=l(t),c=s.length,d=0;c>d;)r.f(e,i=s[d++],n[i]);return e}},(e,t,i)=>{var n=i(101),s=i(108);e.exports=Object.keys||function keys(e){return n(e,s)}},(e,t,i)=>{var n=i(66);e.exports=n("document","documentElement")},(e,t,i)=>{var n=i(46),s=i(56);e.exports=function(e,t){return s(n[e].prototype[t])}},(e,t,i)=>{i(118)},(e,t,i)=>{"use strict";var n=i(119),s=i(106),r=i(104),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("at",(function at(e){var t=a(this),i=s(t),n=r(e),o=n>=0?n:i+n;return o<0||o>=i?void 0:t[o]}))},(e,t,i)=>{"use strict";var n,s,r,a=i(120),o=i(48),l=i(46),c=i(63),d=i(62),h=i(81),u=i(121),p=i(74),g=i(86),f=i(90),m=i(87).f,v=i(67),_=i(123),b=i(125),w=i(76),y=i(83),P=i(94),S=P.enforce,A=P.get,E=l.Int8Array,x=E&&E.prototype,C=l.Uint8ClampedArray,M=C&&C.prototype,T=E&&_(E),k=x&&_(x),I=Object.prototype,D=l.TypeError,R=w("toStringTag"),L=y("TYPED_ARRAY_TAG"),O="TypedArrayConstructor",N=a&&!!b&&"Opera"!==u(l.opera),B=!1,G={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},V={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(e){var t=_(e);if(d(t)){var i=A(t);return i&&h(i,O)?i[O]:getTypedArrayConstructor(t)}},isTypedArray=function(e){if(!d(e))return!1;var t=u(e);return h(G,t)||h(V,t)};for(n in G)(r=(s=l[n])&&s.prototype)?S(r)[O]=s:N=!1;for(n in V)(r=(s=l[n])&&s.prototype)&&(S(r)[O]=s);if(!N||!c(T)||T===Function.prototype){T=function TypedArray(){throw D("Incorrect invocation")};if(N)for(n in G)l[n]&&b(l[n],T)}if(!N||!k||k===I){k=T.prototype;if(N)for(n in G)l[n]&&b(l[n].prototype,k)}N&&_(M)!==k&&b(M,k);if(o&&!h(k,R)){B=!0;m(k,R,{get:function(){return d(this)?this[L]:void 0}});for(n in G)l[n]&&g(l[n],L,n)}e.exports={NATIVE_ARRAY_BUFFER_VIEWS:N,TYPED_ARRAY_TAG:B&&L,aTypedArray:function(e){if(isTypedArray(e))return e;throw D("Target is not a typed array")},aTypedArrayConstructor:function(e){if(c(e)&&(!b||v(T,e)))return e;throw D(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,i,n){if(o){if(i)for(var s in G){var r=l[s];if(r&&h(r.prototype,e))try{delete r.prototype[e]}catch(i){try{r.prototype[e]=t}catch(e){}}}k[e]&&!i||f(k,e,i?t:N&&x[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,i){var n,s;if(o){if(b){if(i)for(n in G)if((s=l[n])&&h(s,e))try{delete s[e]}catch(e){}if(T[e]&&!i)return;try{return f(T,e,i?t:N&&T[e]||t)}catch(e){}}for(n in G)!(s=l[n])||s[e]&&!i||f(s,e,t)}},getTypedArrayConstructor:getTypedArrayConstructor,isView:function isView(e){if(!d(e))return!1;var t=u(e);return"DataView"===t||h(G,t)||h(V,t)},isTypedArray:isTypedArray,TypedArray:T,TypedArrayPrototype:k}},e=>{e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(e,t,i)=>{var n=i(122),s=i(63),r=i(57),a=i(76)("toStringTag"),o=Object,l="Arguments"==r(function(){return arguments}());e.exports=n?r: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=o(e),a))?i:l?r(t):"Object"==(n=r(t))&&s(t.callee)?"Arguments":n}},(e,t,i)=>{var n={};n[i(76)("toStringTag")]="z";e.exports="[object z]"===String(n)},(e,t,i)=>{var n=i(81),s=i(63),r=i(82),a=i(96),o=i(124),l=a("IE_PROTO"),c=Object,d=c.prototype;e.exports=o?c.getPrototypeOf:function(e){var t=r(e);if(n(t,l))return t[l];var i=t.constructor;return s(i)&&t instanceof i?i.prototype:t instanceof c?d:null}},(e,t,i)=>{var n=i(49);e.exports=!n((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(e,t,i)=>{var n=i(56),s=i(89),r=i(126);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){s(i);r(n);t?e(i,n):i.__proto__=n;return i}}():void 0)},(e,t,i)=>{var n=i(63),s=String,r=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw r("Can't set "+s(e)+" as a prototype")}},(e,t,i)=>{i(128);i(135);i(137);i(160);i(162);var n=i(173);e.exports=n.structuredClone},(e,t,i)=>{"use strict";var n=i(54),s=i(111),r=i(129),a=i(94),o=i(87).f,l=i(130),c=i(134),d=i(78),h=i(48),u="Array Iterator",p=a.set,g=a.getterFor(u);e.exports=l(Array,"Array",(function(e,t){p(this,{type:u,target:n(e),index:0,kind:t})}),(function(){var e=g(this),t=e.target,i=e.kind,n=e.index++;if(!t||n>=t.length){e.target=void 0;return c(void 0,!0)}return c("keys"==i?n:"values"==i?t[n]:[n,t[n]],!1)}),"values");var f=r.Arguments=r.Array;s("keys");s("values");s("entries");if(!d&&h&&"values"!==f.name)try{o(f,"name",{value:"values"})}catch(e){}},e=>{e.exports={}},(e,t,i)=>{"use strict";var n=i(45),s=i(50),r=i(78),a=i(92),o=i(63),l=i(131),c=i(123),d=i(125),h=i(133),u=i(86),p=i(90),g=i(76),f=i(129),m=i(132),v=a.PROPER,_=a.CONFIGURABLE,b=m.IteratorPrototype,w=m.BUGGY_SAFARI_ITERATORS,y=g("iterator"),P="keys",S="values",A="entries",returnThis=function(){return this};e.exports=function(e,t,i,a,g,m,E){l(i,t,a);var x,C,M,getIterationMethod=function(e){if(e===g&&R)return R;if(!w&&e in I)return I[e];switch(e){case P:return function keys(){return new i(this,e)};case S:return function values(){return new i(this,e)};case A:return function entries(){return new i(this,e)}}return function(){return new i(this)}},T=t+" Iterator",k=!1,I=e.prototype,D=I[y]||I["@@iterator"]||g&&I[g],R=!w&&D||getIterationMethod(g),L="Array"==t&&I.entries||D;if(L&&(x=c(L.call(new e)))!==Object.prototype&&x.next){r||c(x)===b||(d?d(x,b):o(x[y])||p(x,y,returnThis));h(x,T,!0,!0);r&&(f[T]=returnThis)}if(v&&g==S&&D&&D.name!==S)if(!r&&_)u(I,"name",S);else{k=!0;R=function values(){return s(D,this)}}if(g){C={values:getIterationMethod(S),keys:m?R:getIterationMethod(P),entries:getIterationMethod(A)};if(E)for(M in C)(w||k||!(M in I))&&p(I,M,C[M]);else n({target:t,proto:!0,forced:w||k},C)}r&&!E||I[y]===R||p(I,y,R,{name:g});f[t]=R;return C}},(e,t,i)=>{"use strict";var n=i(132).IteratorPrototype,s=i(112),r=i(53),a=i(133),o=i(129),returnThis=function(){return this};e.exports=function(e,t,i,l){var c=t+" Iterator";e.prototype=s(n,{next:r(+!l,i)});a(e,c,!1,!0);o[c]=returnThis;return e}},(e,t,i)=>{"use strict";var n,s,r,a=i(49),o=i(63),l=i(62),c=i(112),d=i(123),h=i(90),u=i(76),p=i(78),g=u("iterator"),f=!1;[].keys&&("next"in(r=[].keys())?(s=d(d(r)))!==Object.prototype&&(n=s):f=!0);!l(n)||a((function(){var e={};return n[g].call(e)!==e}))?n={}:p&&(n=c(n));o(n[g])||h(n,g,(function(){return this}));e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:f}},(e,t,i)=>{var n=i(87).f,s=i(81),r=i(76)("toStringTag");e.exports=function(e,t,i){e&&!i&&(e=e.prototype);e&&!s(e,r)&&n(e,r,{configurable:!0,value:t})}},e=>{e.exports=function(e,t){return{value:e,done:t}}},(e,t,i)=>{var n=i(122),s=i(90),r=i(136);n||s(Object.prototype,"toString",r,{unsafe:!0})},(e,t,i)=>{"use strict";var n=i(122),s=i(121);e.exports=n?{}.toString:function toString(){return"[object "+s(this)+"]"}},(e,t,i)=>{i(138)},(e,t,i)=>{"use strict";i(139)("Map",(function(e){return function Map(){return e(this,arguments.length?arguments[0]:void 0)}}),i(157))},(e,t,i)=>{"use strict";var n=i(45),s=i(46),r=i(56),a=i(110),o=i(90),l=i(140),c=i(147),d=i(154),h=i(63),u=i(59),p=i(62),g=i(49),f=i(155),m=i(133),v=i(156);e.exports=function(e,t,i){var _=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),w=_?"set":"add",y=s[e],P=y&&y.prototype,S=y,A={},fixMethod=function(e){var t=r(P[e]);o(P,e,"add"==e?function add(e){t(this,0===e?0:e);return this}:"delete"==e?function(e){return!(b&&!p(e))&&t(this,0===e?0:e)}:"get"==e?function get(e){return b&&!p(e)?void 0:t(this,0===e?0:e)}:"has"==e?function has(e){return!(b&&!p(e))&&t(this,0===e?0:e)}:function set(e,i){t(this,0===e?0:e,i);return this})};if(a(e,!h(y)||!(b||P.forEach&&!g((function(){(new y).entries().next()}))))){S=i.getConstructor(t,e,_,w);l.enable()}else if(a(e,!0)){var E=new S,x=E[w](b?{}:-0,1)!=E,C=g((function(){E.has(1)})),M=f((function(e){new y(e)})),T=!b&&g((function(){for(var e=new y,t=5;t--;)e[w](t,t);return!e.has(-0)}));if(!M){(S=t((function(e,t){d(e,P);var i=v(new y,e,S);u(t)||c(t,i[w],{that:i,AS_ENTRIES:_});return i}))).prototype=P;P.constructor=S}if(C||T){fixMethod("delete");fixMethod("has");_&&fixMethod("get")}(T||x)&&fixMethod(w);b&&P.clear&&delete P.clear}A[e]=S;n({global:!0,constructor:!0,forced:S!=y},A);m(S,e);b||i.setStrong(S,e,_);return S}},(e,t,i)=>{var n=i(45),s=i(56),r=i(97),a=i(62),o=i(81),l=i(87).f,c=i(100),d=i(141),h=i(144),u=i(83),p=i(146),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=s([].splice),i={};i[f]=1;if(e(i).length){c.f=function(i){for(var n=e(i),s=0,r=n.length;s<r;s++)if(n[s]===f){t(n,s,1);break}return n};n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:d.f})}},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,f)){if(!h(e))return"F";if(!t)return"E";setMetadata(e)}return e[f].objectID},getWeakData:function(e,t){if(!o(e,f)){if(!h(e))return!0;if(!t)return!1;setMetadata(e)}return e[f].weakData},onFreeze:function(e){p&&g&&h(e)&&!o(e,f)&&setMetadata(e);return e}};r[f]=!0},(e,t,i)=>{var n=i(57),s=i(54),r=i(100).f,a=i(142),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function getOwnPropertyNames(e){return o&&"Window"==n(e)?function(e){try{return r(e)}catch(e){return a(o)}}(e):r(s(e))}},(e,t,i)=>{var n=i(103),s=i(106),r=i(143),a=Array,o=Math.max;e.exports=function(e,t,i){for(var l=s(e),c=n(t,l),d=n(void 0===i?l:i,l),h=a(o(d-c,0)),u=0;c<d;c++,u++)r(h,u,e[c]);h.length=u;return h}},(e,t,i)=>{"use strict";var n=i(60),s=i(87),r=i(53);e.exports=function(e,t,i){var a=n(t);a in e?s.f(e,a,r(0,i)):e[a]=i}},(e,t,i)=>{var n=i(49),s=i(62),r=i(57),a=i(145),o=Object.isExtensible,l=n((function(){o(1)}));e.exports=l||a?function isExtensible(e){return!!s(e)&&((!a||"ArrayBuffer"!=r(e))&&(!o||o(e)))}:o},(e,t,i)=>{var n=i(49);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(49);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},(e,t,i)=>{var n=i(148),s=i(50),r=i(89),a=i(74),o=i(150),l=i(106),c=i(67),d=i(151),h=i(152),u=i(153),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,_,b,w,y,P=i&&i.that,S=!(!i||!i.AS_ENTRIES),A=!(!i||!i.IS_RECORD),E=!(!i||!i.IS_ITERATOR),x=!(!i||!i.INTERRUPTED),C=n(t,P),stop=function(e){f&&u(f,"normal",e);return new Result(!0,e)},callFn=function(e){if(S){r(e);return x?C(e[0],e[1],stop):C(e[0],e[1])}return x?C(e,stop):C(e)};if(A)f=e.iterator;else if(E)f=e;else{if(!(m=h(e)))throw p(a(e)+" is not iterable");if(o(m)){for(v=0,_=l(e);_>v;v++)if((b=callFn(e[v]))&&c(g,b))return b;return new Result(!1)}f=d(e,m)}w=A?e.next:f.next;for(;!(y=s(w,f)).done;){try{b=callFn(y.value)}catch(e){u(f,"throw",e)}if("object"==typeof b&&b&&c(g,b))return b}return new Result(!1)}},(e,t,i)=>{var n=i(149),s=i(73),r=i(51),a=n(n.bind);e.exports=function(e,t){s(e);return void 0===t?e:r?a(e,t):function(){return e.apply(t,arguments)}}},(e,t,i)=>{var n=i(57),s=i(56);e.exports=function(e){if("Function"===n(e))return s(e)}},(e,t,i)=>{var n=i(76),s=i(129),r=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(s.Array===e||a[r]===e)}},(e,t,i)=>{var n=i(50),s=i(73),r=i(89),a=i(74),o=i(152),l=TypeError;e.exports=function(e,t){var i=arguments.length<2?o(e):t;if(s(i))return r(n(i,e));throw l(a(e)+" is not iterable")}},(e,t,i)=>{var n=i(121),s=i(72),r=i(59),a=i(129),o=i(76)("iterator");e.exports=function(e){if(!r(e))return s(e,o)||s(e,"@@iterator")||a[n(e)]}},(e,t,i)=>{var n=i(50),s=i(89),r=i(72);e.exports=function(e,t,i){var a,o;s(e);try{if(!(a=r(e,"return"))){if("throw"===t)throw i;return i}a=n(a,e)}catch(e){o=!0;a=e}if("throw"===t)throw i;if(o)throw a;s(a);return i}},(e,t,i)=>{var n=i(67),s=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw s("Incorrect invocation")}},(e,t,i)=>{var n=i(76)("iterator"),s=!1;try{var r=0,a={next:function(){return{done:!!r++}},return:function(){s=!0}};a[n]=function(){return this};Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!s)return!1;var i=!1;try{var r={};r[n]=function(){return{next:function(){return{done:i=!0}}}};e(r)}catch(e){}return i}},(e,t,i)=>{var n=i(63),s=i(62),r=i(125);e.exports=function(e,t,i){var a,o;r&&n(a=t.constructor)&&a!==i&&s(o=a.prototype)&&o!==i.prototype&&r(e,o);return e}},(e,t,i)=>{"use strict";var n=i(87).f,s=i(112),r=i(158),a=i(148),o=i(154),l=i(59),c=i(147),d=i(130),h=i(134),u=i(159),p=i(48),g=i(140).fastKey,f=i(94),m=f.set,v=f.getterFor;e.exports={getConstructor:function(e,t,i,d){var h=e((function(e,n){o(e,u);m(e,{type:t,index:s(null),first:void 0,last:void 0,size:0});p||(e.size=0);l(n)||c(n,e[d],{that:e,AS_ENTRIES:i})})),u=h.prototype,f=v(t),define=function(e,t,i){var n,s,r=f(e),a=getEntry(e,t);if(a)a.value=i;else{r.last=a={index:s=g(t,!0),key:t,value:i,previous:n=r.last,next:void 0,removed:!1};r.first||(r.first=a);n&&(n.next=a);p?r.size++:e.size++;"F"!==s&&(r.index[s]=a)}return e},getEntry=function(e,t){var i,n=f(e),s=g(t);if("F"!==s)return n.index[s];for(i=n.first;i;i=i.next)if(i.key==t)return i};r(u,{clear:function clear(){for(var e=f(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;p?e.size=0:this.size=0},delete:function(e){var t=this,i=f(t),n=getEntry(t,e);if(n){var s=n.next,r=n.previous;delete i.index[n.index];n.removed=!0;r&&(r.next=s);s&&(s.previous=r);i.first==n&&(i.first=s);i.last==n&&(i.last=r);p?i.size--:t.size--}return!!n},forEach:function forEach(e){for(var t,i=f(this),n=a(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)}});r(u,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)}});p&&n(u,"size",{get:function(){return f(this).size}});return h},setStrong:function(e,t,i){var n=t+" Iterator",s=v(t),r=v(n);d(e,t,(function(e,t){m(this,{type:n,target:e,state:s(e),kind:t,last:void 0})}),(function(){for(var e=r(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 h(void 0,!0)}return h("keys"==t?i.key:"values"==t?i.value:[i.key,i.value],!1)}),i?"entries":"values",!i,!0);u(t)}}},(e,t,i)=>{var n=i(90);e.exports=function(e,t,i){for(var s in t)n(e,s,t[s],i);return e}},(e,t,i)=>{"use strict";var n=i(66),s=i(87),r=i(76),a=i(48),o=r("species");e.exports=function(e){var t=n(e),i=s.f;a&&t&&!t[o]&&i(t,o,{configurable:!0,get:function(){return this}})}},(e,t,i)=>{i(161)},(e,t,i)=>{"use strict";i(139)("Set",(function(e){return function Set(){return e(this,arguments.length?arguments[0]:void 0)}}),i(157))},(e,t,i)=>{var n,s=i(78),r=i(45),a=i(46),o=i(66),l=i(56),c=i(49),d=i(83),h=i(63),u=i(163),p=i(59),g=i(62),f=i(65),m=i(147),v=i(89),_=i(121),b=i(81),w=i(143),y=i(86),P=i(106),S=i(164),A=i(165),E=i(167),x=i(168),C=i(169),M=i(70),T=i(170),k=i(171),I=i(172),D=a.Object,R=a.Array,L=a.Date,O=a.Error,N=a.EvalError,B=a.RangeError,G=a.ReferenceError,V=a.SyntaxError,W=a.TypeError,U=a.URIError,j=a.PerformanceMark,H=a.WebAssembly,z=H&&H.CompileError||O,q=H&&H.LinkError||O,$=H&&H.RuntimeError||O,X=o("DOMException"),K=E.Map,Y=E.has,Q=E.get,Z=E.set,J=x.Set,ee=x.add,te=o("Object","keys"),ie=l([].push),ne=l((!0).valueOf),se=l(1..valueOf),re=l("".valueOf),ae=l(L.prototype.getTime),oe=d("structuredClone"),le="DataCloneError",ce="Transferring",checkBasicSemantic=function(e){return!c((function(){var t=new a.Set([7]),i=e(t),n=e(D(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)}))},de=a.structuredClone,he=s||!checkErrorsCloning(de,O)||!checkErrorsCloning(de,X)||!(n=de,!c((function(){var e=n(new a.AggregateError([1],oe,{cause:3}));return"AggregateError"!=e.name||1!=e.errors[0]||e.message!=oe||3!=e.cause}))),ue=!de&&checkBasicSemantic((function(e){return new j(oe,{detail:e}).detail})),pe=checkBasicSemantic(de)||ue,throwUncloneable=function(e){throw new X("Uncloneable type: "+e,le)},throwUnpolyfillable=function(e,t){throw new X((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",le)},structuredCloneInternal=function(e,t){f(e)&&throwUncloneable("Symbol");if(!g(e))return e;if(t){if(Y(t,e))return Q(t,e)}else t=new K;var i,n,s,r,l,c,d,u,p,m,v=_(e),S=!1;switch(v){case"Array":s=R(P(e));S=!0;break;case"Object":s={};S=!0;break;case"Map":s=new K;S=!0;break;case"Set":s=new J;S=!0;break;case"RegExp":s=new RegExp(e.source,A(e));break;case"Error":switch(n=e.name){case"AggregateError":s=o("AggregateError")([]);break;case"EvalError":s=N();break;case"RangeError":s=B();break;case"ReferenceError":s=G();break;case"SyntaxError":s=V();break;case"TypeError":s=W();break;case"URIError":s=U();break;case"CompileError":s=z();break;case"LinkError":s=q();break;case"RuntimeError":s=$();break;default:s=O()}S=!0;break;case"DOMException":s=new X(e.message,e.name);S=!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=a[v];g(i)||throwUnpolyfillable(v);s=new i(structuredCloneInternal(e.buffer,t),e.byteOffset,"DataView"===v?e.byteLength:e.length);break;case"DOMQuad":try{s=new DOMQuad(structuredCloneInternal(e.p1,t),structuredCloneInternal(e.p2,t),structuredCloneInternal(e.p3,t),structuredCloneInternal(e.p4,t))}catch(t){pe?s=pe(e):throwUnpolyfillable(v)}break;case"FileList":if(r=function(){var e;try{e=new a.DataTransfer}catch(t){try{e=new a.ClipboardEvent("").clipboardData}catch(e){}}return e&&e.items&&e.files?e:null}()){for(l=0,c=P(e);l<c;l++)r.items.add(structuredCloneInternal(e[l],t));s=r.files}else pe?s=pe(e):throwUnpolyfillable(v);break;case"ImageData":try{s=new ImageData(structuredCloneInternal(e.data,t),e.width,e.height,{colorSpace:e.colorSpace})}catch(t){pe?s=pe(e):throwUnpolyfillable(v)}break;default:if(pe)s=pe(e);else switch(v){case"BigInt":s=D(e.valueOf());break;case"Boolean":s=D(ne(e));break;case"Number":s=D(se(e));break;case"String":s=D(re(e));break;case"Date":s=new L(ae(e));break;case"ArrayBuffer":(i=a.DataView)||"function"==typeof e.slice||throwUnpolyfillable(v);try{if("function"==typeof e.slice)s=e.slice(0);else{c=e.byteLength;s=new ArrayBuffer(c);p=new i(e);m=new i(s);for(l=0;l<c;l++)m.setUint8(l,p.getUint8(l))}}catch(e){throw new X("ArrayBuffer is detached",le)}break;case"SharedArrayBuffer":s=e;break;case"Blob":try{s=e.slice(0,e.size,e.type)}catch(e){throwUnpolyfillable(v)}break;case"DOMPoint":case"DOMPointReadOnly":i=a[v];try{s=i.fromPoint?i.fromPoint(e):new i(e.x,e.y,e.z,e.w)}catch(e){throwUnpolyfillable(v)}break;case"DOMRect":case"DOMRectReadOnly":i=a[v];try{s=i.fromRect?i.fromRect(e):new i(e.x,e.y,e.width,e.height)}catch(e){throwUnpolyfillable(v)}break;case"DOMMatrix":case"DOMMatrixReadOnly":i=a[v];try{s=i.fromMatrix?i.fromMatrix(e):new i(e)}catch(e){throwUnpolyfillable(v)}break;case"AudioData":case"VideoFrame":h(e.clone)||throwUnpolyfillable(v);try{s=e.clone()}catch(e){throwUncloneable(v)}break;case"File":try{s=new File([e],e.name,e)}catch(e){throwUnpolyfillable(v)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":throwUnpolyfillable(v);default:throwUncloneable(v)}}Z(t,e,s);if(S)switch(v){case"Array":case"Object":d=te(e);for(l=0,c=P(d);l<c;l++){u=d[l];w(s,u,structuredCloneInternal(e[u],t))}break;case"Map":e.forEach((function(e,i){Z(s,structuredCloneInternal(i,t),structuredCloneInternal(e,t))}));break;case"Set":e.forEach((function(e){ee(s,structuredCloneInternal(e,t))}));break;case"Error":y(s,"message",structuredCloneInternal(e.message,t));b(e,"cause")&&y(s,"cause",structuredCloneInternal(e.cause,t));"AggregateError"==n&&(s.errors=structuredCloneInternal(e.errors,t));case"DOMException":C&&y(s,"stack",structuredCloneInternal(e.stack,t))}return s},ge=de&&!c((function(){if(k&&M>92||I&&M>94||T&&M>97)return!1;var e=new ArrayBuffer(8),t=de(e,{transfer:[e]});return 0!=e.byteLength||8!=t.byteLength})),tryToTransfer=function(e,t){if(!g(e))throw W("Transfer option cannot be converted to a sequence");var i=[];m(e,(function(e){ie(i,v(e))}));var n,s,r,o,l,c,d=0,p=P(i);if(ge){o=de(i,{transfer:i});for(;d<p;)Z(t,i[d],o[d++])}else for(;d<p;){n=i[d++];if(Y(t,n))throw new X("Duplicate transferable",le);switch(s=_(n)){case"ImageBitmap":r=a.OffscreenCanvas;u(r)||throwUnpolyfillable(s,ce);try{(c=new r(n.width,n.height)).getContext("bitmaprenderer").transferFromImageBitmap(n);l=c.transferToImageBitmap()}catch(e){}break;case"AudioData":case"VideoFrame":h(n.clone)&&h(n.close)||throwUnpolyfillable(s,ce);try{l=n.clone();n.close()}catch(e){}break;case"ArrayBuffer":case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":throwUnpolyfillable(s,ce)}if(void 0===l)throw new X("This object cannot be transferred: "+s,le);Z(t,n,l)}};r({global:!0,enumerable:!0,sham:!ge,forced:he},{structuredClone:function structuredClone(e){var t,i=S(arguments.length,1)>1&&!p(arguments[1])?v(arguments[1]):void 0,n=i?i.transfer:void 0;if(void 0!==n){t=new K;tryToTransfer(n,t)}return structuredCloneInternal(e,t)}})},(e,t,i)=>{var n=i(56),s=i(49),r=i(63),a=i(121),o=i(66),l=i(93),noop=function(){},c=[],d=o("Reflect","construct"),h=/^\s*(?:class|function)\b/,u=n(h.exec),p=!h.exec(noop),g=function isConstructor(e){if(!r(e))return!1;try{d(noop,c,e);return!0}catch(e){return!1}},f=function isConstructor(e){if(!r(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!u(h,l(e))}catch(e){return!0}};f.sham=!0;e.exports=!d||s((function(){var e;return g(g.call)||!g(Object)||!g((function(){e=!0}))||e}))?f:g},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(50),s=i(81),r=i(67),a=i(166),o=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in o||s(e,"flags")||!r(o,e)?t:n(a,e)}},(e,t,i)=>{"use strict";var n=i(89);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(56),s=Map.prototype;e.exports={Map:Map,set:n(s.set),get:n(s.get),has:n(s.has),remove:n(s.delete),proto:s}},(e,t,i)=>{var n=i(56),s=Set.prototype;e.exports={Set:Set,add:n(s.add),has:n(s.has),remove:n(s.delete),proto:s,$has:s.has,$keys:s.keys}},(e,t,i)=>{var n=i(49),s=i(53);e.exports=!n((function(){var e=Error("a");if(!("stack"in e))return!0;Object.defineProperty(e,"stack",s(1,7));return 7!==e.stack}))},(e,t,i)=>{var n=i(171),s=i(172);e.exports=!n&&!s&&"object"==typeof window&&"object"==typeof document},e=>{e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(e,t,i)=>{var n=i(57);e.exports="undefined"!=typeof process&&"process"==n(process)},(e,t,i)=>{var n=i(46);e.exports=n},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TextHighlighter=void 0;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){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}this._updateMatches(!0)}}_convertMatches(e,t,i){if(!e)return[];const{textContentItemsStr:n}=this;let s=0,r=0;const a=n.length-1,o=[];for(let l=0,c=e.length;l<c;l++){let c=e[l];for(;s!==a&&c>=r+n[s].length;){r+=n[s].length;s++}s===n.length&&Window.ngxConsole.error("Could not find a matching mapping");const d={color:i?i[l]:0,begin:{divIdx:s,offset:c-r}};c+=t[l];for(;s!==a&&c>r+n[s].length;){r+=n[s].length;s++}d.end={divIdx:s,offset:c-r};o.push(d)}return o}_renderMatches(e){if(0===e.length)return;const{findController:t,pageIdx:i}=this,{textContentItemsStr:n,textDivs:s}=this,r=i===t.selected.pageIdx,a=t.selected.matchIdx;let o=null;const l={divIdx:-1,offset:void 0};function beginText(e,t){const i=e.divIdx;s[i].textContent="";return appendTextToDiv(i,0,e.offset,t)}function appendTextToDiv(e,t,i,r){let a=s[e];if(a.nodeType===Node.TEXT_NODE){const t=document.createElement("span");a.before(t);t.append(a);s[e]=t;a=t}const o=n[e].substring(t,i),l=document.createTextNode(o);if(r){const e=document.createElement("span");e.className=`${r} appended`;e.append(l);a.append(e);return r.includes("selected")?e.offsetLeft:0}a.append(l);return 0}let c=a,d=c+1;if(t.state.highlightAll){c=0;d=e.length}else if(!r)return;for(let n=c;n<d;n++){const c=e[n],d=c.begin,h=c.end,u=r&&n===a,p=(u?" selected":"")+" color"+c.color%5;let g=0;if(o&&d.divIdx===o.divIdx)appendTextToDiv(o.divIdx,o.offset,d.offset);else{null!==o&&appendTextToDiv(o.divIdx,o.offset,l.offset);beginText(d)}if(d.divIdx===h.divIdx)g=appendTextToDiv(d.divIdx,d.offset,h.offset,"highlight"+p);else{g=appendTextToDiv(d.divIdx,d.offset,l.offset,"highlight begin"+p);for(let e=d.divIdx+1,t=h.divIdx;e<t;e++)s[e].className="highlight middle"+p;beginText(h,"highlight end"+p)}o=h;u&&t.scrollMatchIntoView({element:s[d.divIdx],selectedLeft:g,pageIndex:i,matchIndex:a})}o&&appendTextToDiv(o.divIdx,o.offset,l.offset)}_updateMatches(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.enabled&&!e)return;const{findController:t,matches:i,pageIdx:n}=this,{textContentItemsStr:s,textDivs:r}=this;let a=-1;for(const e of i){for(let t=Math.max(a,e.begin.divIdx),i=e.end.divIdx;t<=i;t++){const e=r[t];e.textContent=s[t];e.className=""}a=e.end.divIdx+1}if(null==t||!t.highlightMatches||e)return;const o=t.pageMatches[n]||null,l=t.pageMatchesLength[n]||null,c=t.pageMatchesColor[n]||null;this.matches=this._convertMatches(o,l,c);this._renderMatches(this.matches)}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TextLayerBuilder=void 0;var n=i(4);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 s=new WeakMap,r=new WeakMap,a=new WeakMap,o=new WeakSet,l=new WeakSet;t.TextLayerBuilder=class TextLayerBuilder{constructor(e){let{highlighter:t=null,accessibilityManager:i=null,isOffscreenCanvasSupported:n=!0}=e;_classPrivateMethodInitSpec(this,l);_classPrivateMethodInitSpec(this,o);_classPrivateFieldInitSpec(this,s,{writable:!0,value:0});_classPrivateFieldInitSpec(this,r,{writable:!0,value:0});_classPrivateFieldInitSpec(this,a,{writable:!0,value:null});this.textContentItemsStr=[];this.renderingDone=!1;this.textDivs=[];this.textDivProperties=new WeakMap;this.textLayerRenderTask=null;this.highlighter=t;this.accessibilityManager=i;this.isOffscreenCanvasSupported=n;this.div=document.createElement("div");this.div.className="textLayer";this.hide()}get numTextDivs(){return this.textDivs.length}async render(e){var t,i,l;if(!_classPrivateFieldGet(this,a))throw new Error('No "textContentSource" parameter specified.');const c=e.scale*(globalThis.devicePixelRatio||1),{rotation:d}=e;if(this.renderingDone){const t=d!==_classPrivateFieldGet(this,s),i=c!==_classPrivateFieldGet(this,r);if(t||i){this.hide();(0,n.updateTextLayer)({container:this.div,viewport:e,textDivs:this.textDivs,textDivProperties:this.textDivProperties,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,mustRescale:i,mustRotate:t});_classPrivateFieldSet(this,r,c);_classPrivateFieldSet(this,s,d)}this.show()}else{this.cancel();null===(t=this.highlighter)||void 0===t||t.setTextMapping(this.textDivs,this.textContentItemsStr);null===(i=this.accessibilityManager)||void 0===i||i.setTextMapping(this.textDivs);this.textLayerRenderTask=(0,n.renderTextLayer)({textContentSource:_classPrivateFieldGet(this,a),container:this.div,viewport:e,textDivs:this.textDivs,textDivProperties:this.textDivProperties,textContentItemsStr:this.textContentItemsStr,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported});await this.textLayerRenderTask.promise;_classPrivateMethodGet(this,o,_finishRendering2).call(this);_classPrivateFieldSet(this,r,c);_classPrivateFieldSet(this,s,d);this.show();null===(l=this.accessibilityManager)||void 0===l||l.enable()}}hide(){if(!this.div.hidden){var e;null===(e=this.highlighter)||void 0===e||e.disable();this.div.hidden=!0}}show(){if(this.div.hidden&&this.renderingDone){var e;this.div.hidden=!1;null===(e=this.highlighter)||void 0===e||e.enable()}}cancel(){var e,t;if(this.textLayerRenderTask){this.textLayerRenderTask.cancel();this.textLayerRenderTask=null}null===(e=this.highlighter)||void 0===e||e.disable();null===(t=this.accessibilityManager)||void 0===t||t.disable();this.textContentItemsStr.length=0;this.textDivs.length=0;this.textDivProperties=new WeakMap}setTextContentSource(e){this.cancel();_classPrivateFieldSet(this,a,e)}};function _finishRendering2(){this.renderingDone=!0;const e=document.createElement("div");e.className="endOfContent";this.div.append(e);_classPrivateMethodGet(this,l,_bindMouse2).call(this)}function _bindMouse2(){const{div:e}=this;e.addEventListener("mousedown",(t=>{const i=e.querySelector(".endOfContent");if(!i)return;let n=t.target!==e;n&&(n="none"!==getComputedStyle(i).getPropertyValue("-moz-user-select"));if(n){const n=e.getBoundingClientRect(),s=Math.max(0,(t.pageY-n.top)/n.height);i.style.top=(100*s).toFixed(2)+"%"}i.classList.add("active")}));e.addEventListener("mouseup",(()=>{const t=e.querySelector(".endOfContent");if(t){t.style.top="";t.classList.remove("active")}}))}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.XfaLayerBuilder=void 0;var n=i(4);t.XfaLayerBuilder=class XfaLayerBuilder{constructor(e){let{pageDiv:t,pdfPage:i,annotationStorage:n=null,linkService:s,xfaHtml:r=null}=e;this.pageDiv=t;this.pdfPage=i;this.annotationStorage=n;this.linkService=s;this.xfaHtml=r;this.div=null;this._cancelled=!1}async 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},s=document.createElement("div");this.pageDiv.append(s);i.div=s;return n.XfaLayer.render(i)}const i=await this.pdfPage.getXfa();if(this._cancelled||!i)return{textDivs:[]};const s={viewport:e.clone({dontFlip:!0}),div:this.div,xfaHtml:i,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:t};if(this.div)return n.XfaLayer.update(s);this.div=document.createElement("div");this.pageDiv.append(this.div);s.div=this.div;return n.XfaLayer.render(s)}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;var n=i(3),s=i(32);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,a=new WeakSet,o=new WeakSet,l=new WeakSet,c=new WeakSet;t.SecondaryToolbar=class SecondaryToolbar{constructor(e,t,i){_classPrivateMethodInitSpec(this,c);_classPrivateMethodInitSpec(this,l);_classPrivateMethodInitSpec(this,o);_classPrivateMethodInitSpec(this,a);_classPrivateMethodInitSpec(this,r);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:n.CursorTool.SELECT},close:!0},{element:e.cursorHandToolButton,eventName:"switchcursortool",eventDetails:{tool:n.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.externalServices=i;this.opened=!1;_classPrivateMethodGet(this,a,_bindClickListeners2).call(this);_classPrivateMethodGet(this,o,_bindCursorToolsListener2).call(this,e);_classPrivateMethodGet(this,l,_bindScrollModeListener2).call(this,e);_classPrivateMethodGet(this,c,_bindSpreadModeListener2).call(this,e);this.reset()}get isOpen(){return this.opened}setPageNumber(e){this.pageNumber=e;_classPrivateMethodGet(this,r,_updateUIState2).call(this)}setPagesCount(e){this.pagesCount=e;_classPrivateMethodGet(this,r,_updateUIState2).call(this)}reset(){this.pageNumber=0;this.pagesCount=0;_classPrivateMethodGet(this,r,_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)null==e||e.addEventListener("click",(s=>{if(null!==t){const e={source:this};for(const t in n)e[t]=n[t];this.eventBus.dispatch(t,e)}i&&this.close();this.externalServices.reportTelemetry({type:"buttons",data:{id:e.id}})}))}function _bindCursorToolsListener2(e){let{cursorSelectToolButton:t,cursorHandToolButton:i}=e;this.eventBus._on("cursortoolchanged",(function(e){let{tool:s}=e;const r=s===n.CursorTool.SELECT,a=s===n.CursorTool.HAND;t.classList.toggle("toggled",r);i.classList.toggle("toggled",a);t.setAttribute("aria-checked",r);i.setAttribute("aria-checked",a)}))}function _bindScrollModeListener2(e){let{scrollPageButton:t,scrollVerticalButton:i,scrollHorizontalButton:r,scrollWrappedButton:a,spreadNoneButton:o,spreadOddButton:l,spreadEvenButton:c}=e;const scrollModeChanged=e=>{let{mode:d}=e;const h=d===n.ScrollMode.PAGE,u=d===n.ScrollMode.VERTICAL,p=d===n.ScrollMode.HORIZONTAL,g=d===n.ScrollMode.WRAPPED;t.classList.toggle("toggled",h);i.classList.toggle("toggled",u);r.classList.toggle("toggled",p);a.classList.toggle("toggled",g);t.setAttribute("aria-checked",h);i.setAttribute("aria-checked",u);r.setAttribute("aria-checked",p);a.setAttribute("aria-checked",g);const f=this.pagesCount>s.PagesCountLimit.FORCE_SCROLL_MODE_PAGE;t.disabled=f;i.disabled=f;r.disabled=f;a.disabled=f;o.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:s}=e;function spreadModeChanged(e){let{mode:r}=e;const a=r===n.SpreadMode.NONE,o=r===n.SpreadMode.ODD,l=r===n.SpreadMode.EVEN;t.classList.toggle("toggled",a);i.classList.toggle("toggled",o);s.classList.toggle("toggled",l);t.setAttribute("aria-checked",a);i.setAttribute("aria-checked",o);s.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;var n=i(3),s=i(4);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 _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,a=new WeakSet,o=new WeakSet,l=new WeakSet,c=new WeakSet;t.Toolbar=class Toolbar{constructor(e,t,i){_classPrivateMethodInitSpec(this,c);_classPrivateMethodInitSpec(this,l);_classPrivateMethodInitSpec(this,o);_classPrivateMethodInitSpec(this,a);!function _classPrivateFieldInitSpec(e,t,i){_checkPrivateRedeclaration(e,t);t.set(e,i)}(this,r,{writable:!0,value:!1});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.download,eventName:"download"},{element:e.editorFreeTextButton,eventName:"switchannotationeditormode",eventDetails:{get mode(){const{classList:t}=e.editorFreeTextButton;return t.contains("toggled")?s.AnnotationEditorType.NONE:s.AnnotationEditorType.FREETEXT}}},{element:e.editorInkButton,eventName:"switchannotationeditormode",eventDetails:{get mode(){const{classList:t}=e.editorInkButton;return t.contains("toggled")?s.AnnotationEditorType.NONE:s.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};_classPrivateMethodGet(this,a,_bindListeners2).call(this,e);this.reset()}setPageNumber(e,t){this.pageNumber=e;this.pageLabel=t;_classPrivateMethodGet(this,l,_updateUIState2).call(this,!1)}setPagesCount(e,t){this.pagesCount=e;this.hasPageLabels=t;_classPrivateMethodGet(this,l,_updateUIState2).call(this,!0)}setPageScale(e,t){this.pageScaleValue=(e||t).toString();this.pageScale=t;_classPrivateMethodGet(this,l,_updateUIState2).call(this,!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}_classPrivateMethodGet(this,l,_updateUIState2).call(this,!0);this.updateLoadingIndicatorState();this.eventBus.dispatch("toolbarreset",{source:this})}updateLoadingIndicatorState(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{pageNumber:t}=this.items;t.classList.toggle("visiblePageIsLoading",e)}};function _bindListeners2(e){const{pageNumber:t,scaleSelect:i}=this.items,s=this;for(const{element:e,eventName:t,eventDetails:i}of this.buttons)null==e||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(){s.eventBus.dispatch("pagenumberchanged",{source:s,value:this.value})}));i.addEventListener("change",(function(){"custom"!==this.value&&s.eventBus.dispatch("scalechanged",{source:s,value:this.value})}));i.addEventListener("click",(function(e){const t=e.target;this.value===s.pageScaleValue&&"OPTION"===t.tagName.toUpperCase()&&this.blur()}));i.oncontextmenu=n.noContextMenuHandler;this.eventBus._on("localized",(()=>{_classPrivateFieldSet(this,r,!0);_classPrivateMethodGet(this,c,_adjustScaleWidth2).call(this);_classPrivateMethodGet(this,l,_updateUIState2).call(this,!0)}));_classPrivateMethodGet(this,o,_bindEditorToolsListener2).call(this,e)}function _bindEditorToolsListener2(e){let{editorFreeTextButton:t,editorFreeTextParamsToolbar:i,editorInkButton:n,editorInkParamsToolbar:r}=e;const editorModeChanged=function(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const o=[{mode:s.AnnotationEditorType.FREETEXT,button:t,toolbar:i},{mode:s.AnnotationEditorType.INK,button:n,toolbar:r}];for(const{mode:t,button:i,toolbar:n}of o){const s=t===e.mode;i.classList.toggle("toggled",s);i.setAttribute("aria-checked",s);i.disabled=a;null==n||n.classList.toggle("hidden",!s)}};this.eventBus._on("annotationeditormodechanged",editorModeChanged);this.eventBus._on("toolbarreset",(e=>{e.source===this&&editorModeChanged({mode:s.AnnotationEditorType.NONE},!0)}))}function _updateUIState2(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!function _classPrivateFieldGet(e,t){return function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}(e,_classExtractFieldDescriptor(e,t,"get"))}(this,r))return;const{pageNumber:t,pagesCount:i,pageScaleValue:s,pageScale:a,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=a<=n.MIN_SCALE;o.zoomIn.disabled=a>=n.MAX_SCALE;this.l10n.get("page_scale_percent",{scale:Math.round(1e4*a)/100}).then((e=>{let t=!1;if(o.scaleSelect.options)for(const e of o.scaleSelect.options)if(e.value===s){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:s,pageScale:a})}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 s=getComputedStyle(e.scaleSelect),r=parseFloat(s.getPropertyValue("--scale-select-width")),a=document.createElement("canvas"),o=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0,alpha:!1}:{alpha:!1},l=a.getContext("2d",o);l.font=`${s.fontSize} ${s.fontFamily}`;let c=0;for(const e of await i)try{const{width:t}=l.measureText(e);t>c&&(c=t)}catch(e){}c+=.3*r;if(c>r){e.scaleSelect.parentNode.style.setProperty("--scale-select-width",`${c}px`)}a.width=0;a.height=0}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ViewHistory=void 0;var n=i(5);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.BasePreferences=void 0;i(5);class BasePreferences{#T=Object.freeze({annotationEditorMode:0,annotationMode:2,cursorToolOnLoad:0,defaultZoomDelay:400,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"});#F=Object.create(null);#k=null;constructor(){if(this.constructor===BasePreferences)throw new Error("Cannot initialize BasePreferences.");this.#k=this._readFromStorage(this.#T).then((e=>{for(const t in this.#T){const i=null==e?void 0:e[t];typeof i==typeof this.#T[t]&&(this.#F[t]=i)}}))}async _writeToStorage(e){throw new Error("Not implemented: _writeToStorage")}async _readFromStorage(e){throw new Error("Not implemented: _readFromStorage")}async reset(){await this.#k;const e=this.#F;this.#F=Object.create(null);return this._writeToStorage(this.#T).catch((t=>{this.#F=e;throw t}))}async set(e,t){await this.#k;const i=this.#T[e],n=this.#F;if(void 0===i)throw new Error(`Set preference: "${e}" is undefined.`);if(void 0===t)throw new Error("Set preference: no value is specified.");const s=typeof t,r=typeof i;if(s!==r){if("number"!==s||"string"!==r)throw new Error(`Set preference: "${t}" is a ${s}, expected a ${r}.`);t=t.toString()}else if("number"===s&&!Number.isInteger(t))throw new Error(`Set preference: "${t}" must be an integer.`);this.#F[e]=t;return this._writeToStorage(this.#F).catch((e=>{this.#F=n;throw e}))}async get(e){await this.#k;const t=this.#T[e];if(void 0===t)throw new Error(`Get preference: "${e}" is undefined.`);return this.#F[e]??t}async getAll(){await this.#k;const e=Object.create(null);for(const t in this.#T)e[t]=this.#F[t]??this.#T[t];return e}}t.BasePreferences=BasePreferences},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DownloadManager=void 0;var n=i(4);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{#I=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: ${e}`)}downloadData(e,t,i){download(URL.createObjectURL(new Blob([e],{type:i})),t)}openOrDownloadData(e,t,i){const s=(0,n.isPdfFile)(i),r=s?"application/pdf":"";if(s){let i=this.#I.get(e);if(!i){i=URL.createObjectURL(new Blob([t],{type:r}));this.#I.set(e,i)}try{window.open(i);return!0}catch(t){Window.ngxConsole.error(`openOrDownloadData: ${t}`);URL.revokeObjectURL(i);this.#I.delete(e)}}this.downloadData(t,i,r);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(183);var n=i(33);const s=document.webL10n;t.GenericL10n=class GenericL10n{constructor(e){this._lang=e;this._ready=new Promise(((t,i)=>{s.setLanguage((0,n.fixupLangCode)(e),(()=>{t(s)}))}))}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)}}},()=>{"use strict";document.webL10n=function(e,t,i){var n={},s="",r="textContent",a="",o={},l="loading",c=!0;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,c);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,a,o,l){var c=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){s+=t;!function parseProperties(t,n){var s={},r=/^\s*|\s*$/,o=/^\s*#|^\s*$/,l=/^\s*\[(.*)\]\s*$/,d=/^\s*@import\s+url\((.*)\)\s*$/i,h=/^([^=\s]*)\s*=\s*(.+)$/;function parseRawLines(e,t,n){var u=e.replace(r,"").split(/[\r\n]+/),p="*",g=a.split("-",1)[0],f=!1,m="",v=!1;!function nextEntry(){for(var e=i;;){if(!u.length&&e){v?nextEntry():loadImport(e,nextEntry);return}if(!u.length){n();return}var r=u.shift();if(!o.test(r)){if(t){if(m=l.exec(r)){p=m[1].toLowerCase();f="*"!==p&&p!==a&&p!==g;continue}if(f)continue;if(m=d.exec(r)){if("*"===p||p===a){loadImport(c+m[1],nextEntry);v=!0;return}e=c+m[1]}}var _=r.match(h);_&&3==_.length&&(s[_[1]]=evalString(_[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(s)}))}(t,(function(e){for(var t in e){var i,s,a=t.lastIndexOf(".");if(a>0){i=t.substring(0,a);s=t.substring(a+1)}else{i=t;s=r}n[i]||(n[i]={});n[i][s]=e[t]}o&&o()}))}),l)}function loadLocale(i,r){let o=i;i&&(i=i.toLowerCase());r=r||function _callback(){};!function clear(){n={};s="";a=""}();a=i;var c=function getL10nResourceLinks(){return t.querySelectorAll('link[type="application/l10n"]')}(),d=c.length;if(0!==d){var h,u=0;h=function(){if(++u>=d){r();fireL10nReadyEvent(i);l="complete"}};for(var p=0;p<d;p++){new L10nResourceLink(c[p]).load(i,h)}}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[o])){var f=g.default_locale.toLowerCase();for(var m in g.locales){o=m;if((m=m.toLowerCase())===i){n=g.locales[o];break}m===f&&(n=g.locales[o])}}r()}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 s=e.PDFViewerApplicationOptions;if(!s||s.get("verbosity")>0){Window.ngxConsole.warn(i+" not found.");Window.ngxConsole.warn('"'+t+'" resource not found')}a="";n()}))}}}o.plural=function(t,i,s,l){var c=parseFloat(i);if(isNaN(c))return t;if(l!=r)return t;o._pluralRules||(o._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]}(a));var d="["+o._pluralRules(c)+"]";0===c&&s+"[zero]"in n?t=n[s+"[zero]"][l]:1==c&&s+"[one]"in n?t=n[s+"[one]"][l]:2==c&&s+"[two]"in n?t=n[s+"[two]"][l]:s+d in n?t=n[s+d][l]:s+"[other]"in n&&(t=n[s+"[other]"][l]);return t};function getL10nData(t,i,s){var r=n[t];if(!r){const i=e.PDFViewerApplicationOptions;(!i||i.get("verbosity")>0)&&Window.ngxConsole.warn("Translation for the key #"+t+" is missing.");if(!s)return null;r=s}var a={};for(var o in r){var l=r[o];l=substArguments(l=substIndexes(l,i,t,o),i,t);a[o]=l}return a}function substIndexes(e,t,i,s){var r=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(e);if(!r||!r.length)return e;var a,l=r[1],c=r[2];t&&c in t?a=t[c]:c in n&&(a=n[c]);if(l in o){e=(0,o[l])(e,a,i,s)}return e}function substArguments(e,t,i){return e.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(e,s){if(t&&s in t)return t[s];if(s in n)return n[s];Window.ngxConsole.log("argument {{"+s+"}} 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"),s={};if(n)try{s=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:s}}(i);if(n.id){var s=getL10nData(n.id,n.args);if(s){if(s[r]){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[r]=s[r];else{for(var a=i.childNodes,o=!1,l=0,c=a.length;l<c;l++)if(3===a[l].nodeType&&/\S/.test(a[l].nodeValue))if(o)a[l].nodeValue="";else{a[l].nodeValue=s[r];o=!0}if(!o){var d=t.createTextNode(s[r]);i.prepend(d)}}delete s[r]}for(var h in s)i[h]=s[h]}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,s=e.lastIndexOf("."),a=r;if(s>0){a=e.substring(s+1);e=e.substring(0,s)}i&&((n={})[a]=i);var o=getL10nData(e,t,n);return o&&a in o?o[a]:"{{"+e+"}}"},getData:function(){return n},getText:function(){return s},getLanguage:function(){return a},setLanguage:function(e,t){loadLocale(e,(function(){t&&t()}))},getDirection:function(){var e=a.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,s=0;s<n;s++)translateElement(i[s]);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:s,contentDispositionFilename:r,contentLength:a}=await e.getMetadata();if(!a){const{length:t}=await e.getDownloadInfo();a=t}return{...i,baseURL:t,filesize:a,filename:r||(0,n.getPdfFilenameFromUrl)(""),metadata:null==s?void 0:s.getRaw(),authors:null==s?void 0:s.get("dc:creator"),numPages:e.numPages,URL:""}};var n=i(4);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;var n=i(4),s=i(2),r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(i(40)),a=i(186),o=i(41);let l=null,c=null,d=null;function renderPage(e,t,i,s,a,c,d){const h=l.scratchCanvas;let u=a/n.PixelsPerInch.PDF,p=1;const g=Math.floor(s.width*u),f=Math.floor(s.height*u);if(g>=4096||f>=4096){if(!r.default.test({width:g,height:f})){const e=function determineMaxDimensions(){const e=[4096,8192,10836,11180,11402,14188,16384];for(let t of e)if(!r.default.test({width:t+1,height:t+1}))return t;return 16384}();p=.95*Math.min(e/g,e/f)}(0,o.warn)("Page "+i+": Reduced the [printResolution] to "+Math.floor(a*p)+" because the browser can't render larger canvases. If you see blank page in the print preview, reduce [printResolution] manually to a lower value.")}u*=p;h.width=Math.floor(s.width*u);h.height=Math.floor(s.height*u);const m=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0,v=h.getContext("2d",m);v.save();v.fillStyle="rgb(255, 255, 255)";v.fillRect(0,0,h.width,h.height);v.restore();return Promise.all([t.getPage(i),d]).then((function(e){let[t,i]=e;const r={canvasContext:v,transform:[u,0,0,u,0,0],viewport:t.getViewport({scale:1,rotation:s.rotation}),intent:"print",annotationMode:n.AnnotationMode.ENABLE_STORAGE,optionalContentConfigPromise:c,background:PDFViewerApplicationOptions.get("pdfBackgroundColor"),printAnnotationStorage:i};return t.render(r).promise}))}function PDFPrintService(e,t,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6?arguments[6]:void 0,o=arguments.length>7?arguments[7]:void 0;this.pdfDocument=e;this.pagesOverview=t;this.printContainer=i;this._printResolution=n||150;this._optionalContentConfigPromise=s||e.getOptionalContentConfig();this._printAnnotationStoragePromise=r||Promise.resolve();this.l10n=a;this.currentPage=-1;this.scratchCanvas=document.createElement("canvas");this.eventBus=o}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(l!==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;l=null;ensureOverlay().then((function(){if(d.active===c){d.close(c);d.unregister(c)}}));u=void 0},renderPages(){if(this.pdfDocument.isPureXfa){(0,a.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===l},throwIfInactive(){if(!this.active)throw new Error("This print request was cancelled or completed.")}};const h=window.print;window.printPDF=function printPdf(){if(s.PDFViewerApplication.enablePrint)if(l)Window.ngxConsole.warn("Ignored window.printPDF() because of a pending print job.");else{ensureOverlay().then((function(){l&&d.open(c)}));try{dispatchEvent("beforeprint")}finally{if(!l){Window.ngxConsole.error("Expected print service to be initialized.");ensureOverlay().then((function(){d.active===c&&d.close(c)}));return}const e=l;l.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(l){l.destroy();dispatchEvent("afterprint")}}function renderProgress(e,t,i,n){c=document.getElementById("printServiceDialog");const s=Math.round(100*e/t),r=c.querySelector("progress"),a=c.querySelector(".relative-progress");r.value=s;i.get("print_progress_percent",{progress:s}).then((e=>{a.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()}}),!0);if("onbeforeprint"in window){const stopPropagationIfNeeded=function(e){"custom"!==e.detail&&e.stopImmediatePropagation()};window.addEventListener("beforeprint",stopPropagationIfNeeded);window.addEventListener("afterprint",stopPropagationIfNeeded)}let u;function ensureOverlay(){if(!u){d=s.PDFViewerApplication.overlayManager;if(!d)throw new Error("The overlay manager has not yet been initialized.");c=document.getElementById("printServiceDialog");u=d.register(c,!0);document.getElementById("printCancel").onclick=abort;c.addEventListener("close",abort)}return u}s.PDFPrintServiceFactory.instance={supportsPrinting:!0,createPrintService(e,t,i,n,s,r,a,o){if(l)throw new Error("The print service is created and active.");l=new PDFPrintService(e,t,i,n,s,r,a,o);return l}}},(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.getXfaHtmlForPrinting=function getXfaHtmlForPrinting(e,t){const i=t.allXfaHtml,a=new s.SimpleLinkService,o=Math.round(100*n.PixelsPerInch.PDF_TO_CSS_UNITS)/100;for(const s of i.children){const i=document.createElement("div");i.className="xfaPrintedPage";e.append(i);const l=new r.XfaLayerBuilder({pageDiv:i,pdfPage:null,annotationStorage:t.annotationStorage,linkService:a,xfaHtml:s}),c=(0,n.getXfaPageViewport)(s,{scale:o});l.render(c,"print")}};var n=i(4),s=i(7),r=i(176)}],t={};function __webpack_require__(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};e[i](s,s.exports,__webpack_require__);return s.exports}var i={};(()=>{"use strict";var e=i;Object.defineProperty(e,"__esModule",{value:!0});Object.defineProperty(e,"PDFViewerApplication",{enumerable:!0,get:function(){return o.PDFViewerApplication}});e.PDFViewerApplicationConstants=void 0;Object.defineProperty(e,"PDFViewerApplicationOptions",{enumerable:!0,get:function(){return r.AppOptions}});__webpack_require__(1);__webpack_require__(185);var t,n,s=__webpack_require__(3),r=__webpack_require__(5),a=__webpack_require__(7),o=__webpack_require__(2);const l={LinkTarget:a.LinkTarget,RenderingStates:s.RenderingStates,ScrollMode:s.ScrollMode,SpreadMode:s.SpreadMode};e.PDFViewerApplicationConstants=l;window.PDFViewerApplication=o.PDFViewerApplication;window.PDFViewerApplicationConstants=l;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});null===(t=(n=document).blockUnblockOnload)||void 0===t||t.call(n,!0);window.webViewerLoad=function webViewerLoad(){const e=function getViewerConfiguration(){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"),editorFreeTextButton:document.getElementById("editorFreeText"),editorFreeTextParamsToolbar:document.getElementById("editorFreeTextParamsToolbar"),editorInkButton:document.getElementById("editorInk"),editorInkParamsToolbar:document.getElementById("editorInkParamsToolbar"),download:document.getElementById("download")},secondaryToolbar:{toolbar:document.getElementById("secondaryToolbar"),toggleButton:document.getElementById("secondaryToolbarToggle"),presentationModeButton:document.getElementById("presentationMode"),openFileButton:document.getElementById("secondaryOpenFile"),printButton:document.getElementById("secondaryPrint"),downloadButton:document.getElementById("secondaryDownload"),viewBookmarkButton:document.getElementById("viewBookmark"),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")},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.dispatchEvent(t)}catch(e){console.error(`webviewerloaded: ${e}`);document.dispatchEvent(t)}o.PDFViewerApplication.run(e)}})()})();
});