text: /**
   * @licstart The following is the entire license notice for the
   * Javascript code in this page
   *
   * Copyright 2020 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(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],t):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=t():e["pdfjs-dist/build/pdf"]=e.pdfjsLib=t()}(this,(function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){"use strict";var n=i(1),s=i(3),r=i(16),a=i(17),o=i(4),l=i(18);const h=i(10),c=i(6);{const{isNodeJS:e}=i(7);if(e){const e=i(19).PDFNodeStream;s.setPDFNetworkStreamFactory(t=>new e(t))}else{const e=i(22).PDFNetworkStream;let t;o.isFetchSupported()&&(t=i(23).PDFFetchStream),s.setPDFNetworkStreamFactory(i=>t&&o.isValidFetchUrl(i.url)?new t(i):new e(i))}}t.build=s.build,t.version=s.version,t.getDocument=s.getDocument,t.LoopbackPort=s.LoopbackPort,t.PDFDataRangeTransport=s.PDFDataRangeTransport,t.PDFWorker=s.PDFWorker,t.renderTextLayer=r.renderTextLayer,t.AnnotationLayer=a.AnnotationLayer,t.createPromiseCapability=n.createPromiseCapability,t.PasswordResponses=n.PasswordResponses,t.InvalidPDFException=n.InvalidPDFException,t.MissingPDFException=n.MissingPDFException,t.SVGGraphics=l.SVGGraphics,t.NativeImageDecoding=n.NativeImageDecoding,t.CMapCompressionType=n.CMapCompressionType,t.PermissionFlag=n.PermissionFlag,t.UnexpectedResponseException=n.UnexpectedResponseException,t.OPS=n.OPS,t.VerbosityLevel=n.VerbosityLevel,t.UNSUPPORTED_FEATURES=n.UNSUPPORTED_FEATURES,t.createValidAbsoluteUrl=n.createValidAbsoluteUrl,t.createObjectURL=n.createObjectURL,t.removeNullCharacters=n.removeNullCharacters,t.shadow=n.shadow,t.Util=n.Util,t.RenderingCancelledException=o.RenderingCancelledException,t.getFilenameFromUrl=o.getFilenameFromUrl,t.LinkTarget=o.LinkTarget,t.addLinkAttributes=o.addLinkAttributes,t.loadScript=o.loadScript,t.PDFDateString=o.PDFDateString,t.GlobalWorkerOptions=h.GlobalWorkerOptions,t.apiCompatibilityParams=c.apiCompatibilityParams},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayByteLength=d,t.arraysToBytes=function(e){const t=e.length;if(1===t&&e[0]instanceof Uint8Array)return e[0];let i=0;for(let n=0;n<t;n++)i+=d(e[n]);let n=0;const s=new Uint8Array(i);for(let i=0;i<t;i++){let t=e[i];t instanceof Uint8Array||(t="string"==typeof t?c(t):new Uint8Array(t));const r=t.byteLength;s.set(t,n),n+=r}return s},t.assert=o,t.bytesToString=function(e){o(null!==e&&"object"==typeof e&&void 0!==e.length,"Invalid argument for bytesToString");const t=e.length;if(t<8192)return String.fromCharCode.apply(null,e);const i=[];for(let n=0;n<t;n+=8192){const s=Math.min(n+8192,t),r=e.subarray(n,s);i.push(String.fromCharCode.apply(null,r))}return i.join("")},t.createPromiseCapability=function(){const e=Object.create(null);let t=!1;return 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)}})),e},t.getVerbosityLevel=function(){return s},t.info=function(e){s>=n.INFOS&&console.log(`Info: ${e}`)},t.isArrayBuffer=function(e){return"object"==typeof e&&null!==e&&void 0!==e.byteLength},t.isArrayEqual=function(e,t){if(e.length!==t.length)return!1;return e.every((function(e,i){return e===t[i]}))},t.isBool=function(e){return"boolean"==typeof e},t.isEmptyObj=function(e){for(const t in e)return!1;return!0},t.isNum=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSameOrigin=function(e,t){let i;try{if(i=new URL(e),!i.origin||"null"===i.origin)return!1}catch(e){return!1}const n=new URL(t,i);return i.origin===n.origin},t.createValidAbsoluteUrl=function(e,t){if(!e)return null;try{const i=t?new URL(e,t):new URL(e);if(function(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(i))return i}catch(e){}return null},t.isLittleEndian=function(){const e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]},t.isEvalSupported=function(){try{return new Function(""),!0}catch(e){return!1}},t.removeNullCharacters=function(e){if("string"!=typeof e)return r("The argument for removeNullCharacters must be a string."),e;return e.replace(h,"")},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(s=e)},t.shadow=function(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!1}),i},t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=c,t.stringToPDFString=function(e){const t=e.length,i=[];if("þ"===e[0]&&"ÿ"===e[1])for(let n=2;n<t;n+=2)i.push(String.fromCharCode(e.charCodeAt(n)<<8|e.charCodeAt(n+1)));else if("ÿ"===e[0]&&"þ"===e[1])for(let n=2;n<t;n+=2)i.push(String.fromCharCode(e.charCodeAt(n+1)<<8|e.charCodeAt(n)));else for(let n=0;n<t;++n){const t=g[e.charCodeAt(n)];i.push(t?String.fromCharCode(t):e.charAt(n))}return i.join("")},t.stringToUTF8String=function(e){return decodeURIComponent(escape(e))},t.utf8StringToString=function(e){return unescape(encodeURIComponent(e))},t.warn=r,t.unreachable=a,t.createObjectURL=t.FormatError=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.TextRenderingMode=t.StreamType=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.NativeImageDecoding=t.MissingPDFException=t.InvalidPDFException=t.AbortException=t.CMapCompressionType=t.ImageKind=t.FontType=t.AnnotationType=t.AnnotationStateModelType=t.AnnotationReviewState=t.AnnotationReplyType=t.AnnotationMarkedState=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationBorderStyleType=t.UNSUPPORTED_FEATURES=t.VerbosityLevel=t.OPS=t.IDENTITY_MATRIX=t.FONT_IDENTITY_MATRIX=t.BaseException=void 0,i(2);t.IDENTITY_MATRIX=[1,0,0,1,0,0];t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];t.NativeImageDecoding={NONE:"none",DECODE:"decode",DISPLAY:"display"};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.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};t.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};const n={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=n;t.CMapCompressionType={NONE:0,BINARY:1,STREAM:2};t.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};t.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"};t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let s=n.WARNINGS;function r(e){s>=n.WARNINGS&&console.log(`Warning: ${e}`)}function a(e){throw new Error(e)}function o(e,t){e||a(t)}const l=function(){function e(t){this.constructor===e&&a("Cannot initialize BaseException."),this.message=t,this.name=this.constructor.name}return e.prototype=new Error,e.constructor=e,e}();t.BaseException=l;t.PasswordException=class extends l{constructor(e,t){super(e),this.code=t}};t.UnknownErrorException=class extends l{constructor(e,t){super(e),this.details=t}};t.InvalidPDFException=class extends l{};t.MissingPDFException=class extends l{};t.UnexpectedResponseException=class extends l{constructor(e,t){super(e),this.status=t}};t.FormatError=class extends l{};t.AbortException=class extends l{};const h=/\x00/g;function c(e){o("string"==typeof e,"Invalid argument for stringToBytes");const t=e.length,i=new Uint8Array(t);for(let n=0;n<t;++n)i[n]=255&e.charCodeAt(n);return i}function d(e){return void 0!==e.length?e.length:(o(void 0!==e.byteLength),e.byteLength)}const u=["rgb(",0,",",0,",",0,")"];class p{static makeCssRgb(e,t,i){return u[1]=e,u[3]=t,u[5]=i,u.join("")}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=p.applyTransform(e,t),n=p.applyTransform(e.slice(2,4),t),s=p.applyTransform([e[0],e[3]],t),r=p.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 apply3dTransform(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2],e[3]*t[0]+e[4]*t[1]+e[5]*t[2],e[6]*t[0]+e[7]*t[1]+e[8]*t[2]]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],i=e[0]*t[0]+e[1]*t[2],n=e[0]*t[1]+e[1]*t[3],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)*(i+r)-4*(i*r-s*n))/2,l=a+o||1,h=a-o||1;return[Math.sqrt(l),Math.sqrt(h)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){function i(e,t){return e-t}const n=[e[0],e[2],t[0],t[2]].sort(i),s=[e[1],e[3],t[1],t[3]].sort(i),r=[];return e=p.normalizeRect(e),t=p.normalizeRect(t),n[0]===e[0]&&n[1]===t[0]||n[0]===t[0]&&n[1]===e[0]?(r[0]=n[1],r[2]=n[2],s[0]===e[1]&&s[1]===t[1]||s[0]===t[1]&&s[1]===e[1]?(r[1]=s[1],r[3]=s[2],r):null):null}}t.Util=p;const g=[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];const f=function(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t,i,n=!1){if(!n&&URL.createObjectURL){const e=new Blob([t],{type:i});return URL.createObjectURL(e)}let s=`data:${i};base64,`;for(let i=0,n=t.length;i<n;i+=3){const r=255&t[i],a=255&t[i+1],o=255&t[i+2];s+=e[r>>2]+e[(3&r)<<4|a>>4]+e[i+1<n?(15&a)<<2|o>>6:64]+e[i+2<n?63&o:64]}return s}}();t.createObjectURL=f},function(e,t,i){},function(module,exports,__w_pdfjs_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,exports.build=exports.version=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFWorker=exports.PDFDataRangeTransport=exports.LoopbackPort=void 0;var _util=__w_pdfjs_require__(1),_display_utils=__w_pdfjs_require__(4),_font_loader=__w_pdfjs_require__(5),_api_compatibility=__w_pdfjs_require__(6),_canvas=__w_pdfjs_require__(8),_worker_options=__w_pdfjs_require__(10),_is_node=__w_pdfjs_require__(7),_message_handler=__w_pdfjs_require__(11),_metadata=__w_pdfjs_require__(12),_transport_stream=__w_pdfjs_require__(14),_webgl=__w_pdfjs_require__(15);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100;let createPDFNetworkStream;function setPDFNetworkStreamFactory(e){createPDFNetworkStream=e}function getDocument(e){const t=new PDFDocumentLoadingTask;let i;if("string"==typeof e)i={url:e};else if((0,_util.isArrayBuffer)(e))i={data:e};else if(e instanceof PDFDataRangeTransport)i={range:e};else{if("object"!=typeof e)throw new Error("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");i=e}const n=Object.create(null);let s=null,r=null;for(const e in i)if("url"!==e||"undefined"==typeof window)if("range"!==e)if("worker"!==e)if("data"!==e||i[e]instanceof Uint8Array)n[e]=i[e];else{const t=i[e];if("string"==typeof t)n[e]=(0,_util.stringToBytes)(t);else if("object"!=typeof t||null===t||isNaN(t.length)){if(!(0,_util.isArrayBuffer)(t))throw new Error("Invalid PDF binary data: either typed array, string or array-like object is expected in the data property.");n[e]=new Uint8Array(t)}else n[e]=new Uint8Array(t)}else r=i[e];else s=i[e];else n[e]=new URL(i[e],window.location).href;n.rangeChunkSize=n.rangeChunkSize||DEFAULT_RANGE_CHUNK_SIZE,n.CMapReaderFactory=n.CMapReaderFactory||_display_utils.DOMCMapReaderFactory,n.ignoreErrors=!0!==n.stopAtErrors,n.pdfBug=!0===n.pdfBug;const a=Object.values(_util.NativeImageDecoding);if(void 0!==n.nativeImageDecoderSupport&&a.includes(n.nativeImageDecoderSupport)||(n.nativeImageDecoderSupport=_api_compatibility.apiCompatibilityParams.nativeImageDecoderSupport||_util.NativeImageDecoding.DECODE),Number.isInteger(n.maxImageSize)||(n.maxImageSize=-1),"boolean"!=typeof n.isEvalSupported&&(n.isEvalSupported=!0),"boolean"!=typeof n.disableFontFace&&(n.disableFontFace=_api_compatibility.apiCompatibilityParams.disableFontFace||!1),"boolean"!=typeof n.disableRange&&(n.disableRange=!1),"boolean"!=typeof n.disableStream&&(n.disableStream=!1),"boolean"!=typeof n.disableAutoFetch&&(n.disableAutoFetch=!1),"boolean"!=typeof n.disableCreateObjectURL&&(n.disableCreateObjectURL=_api_compatibility.apiCompatibilityParams.disableCreateObjectURL||!1),(0,_util.setVerbosityLevel)(n.verbosity),!r){const e={verbosity:n.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};r=e.port?PDFWorker.fromPort(e):new PDFWorker(e),t._worker=r}const o=t.docId;return r.promise.then((function(){if(t.destroyed)throw new Error("Loading aborted");return _fetchDocument(r,n,s,o).then((function(e){if(t.destroyed)throw new Error("Loading aborted");let i;s?i=new _transport_stream.PDFDataTransportStream({length:n.length,initialData:n.initialData,progressiveDone:n.progressiveDone,disableRange:n.disableRange,disableStream:n.disableStream},s):n.data||(i=createPDFNetworkStream({url:n.url,length:n.length,httpHeaders:n.httpHeaders,withCredentials:n.withCredentials,rangeChunkSize:n.rangeChunkSize,disableRange:n.disableRange,disableStream:n.disableStream}));const a=new _message_handler.MessageHandler(o,e,r.port);a.postMessageTransfers=r.postMessageTransfers;const l=new WorkerTransport(a,t,i,n);t._transport=l,a.send("Ready",null)}))})).catch(t._capability.reject),t}function _fetchDocument(e,t,i,n){return e.destroyed?Promise.reject(new Error("Worker was destroyed")):(i&&(t.length=i.length,t.initialData=i.initialData,t.progressiveDone=i.progressiveDone),e.messageHandler.sendWithPromise("GetDocRequest",{docId:n,apiVersion:"2.4.368",source:{data:t.data,url:t.url,password:t.password,disableAutoFetch:t.disableAutoFetch,rangeChunkSize:t.rangeChunkSize,length:t.length},maxImageSize:t.maxImageSize,disableFontFace:t.disableFontFace,disableCreateObjectURL:t.disableCreateObjectURL,postMessageTransfers:e.postMessageTransfers,docBaseUrl:t.docBaseUrl,nativeImageDecoderSupport:t.nativeImageDecoderSupport,ignoreErrors:t.ignoreErrors,isEvalSupported:t.isEvalSupported}).then((function(t){if(e.destroyed)throw new Error("Worker was destroyed");return t})))}const PDFDocumentLoadingTask=function(){let e=0;return class{constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+e++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}destroy(){return this.destroyed=!0,(this._transport?this._transport.destroy():Promise.resolve()).then(()=>{this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)})}then(e,t){throw new Error("Removed API method: PDFDocumentLoadingTask.then, use the `promise` getter instead.")}}}();class PDFDataRangeTransport{constructor(e,t,i=!1){this.length=e,this.initialData=t,this.progressiveDone=i,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 numPages(){return this._pdfInfo.numPages}get fingerprint(){return this._pdfInfo.fingerprint}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()}getOpenActionDestination(){return this._transport.getOpenActionDestination()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getOutline(){return this._transport.getOutline()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}getStats(){return this._transport.getStats()}cleanup(){return this._transport.startCleanup()}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(e,t,i,n=!1){this.pageIndex=e,this._pageInfo=t,this._transport=i,this._stats=n?new _display_utils.StatTimer:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this.intentStates=Object.create(null),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({scale:e,rotation:t=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:s=!1}={}){if(arguments.length>1||"number"==typeof arguments[0])throw new Error("PDFPageProxy.getViewport is called with obsolete arguments.");return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:i,offsetY:n,dontFlip:s})}getAnnotations({intent:e=null}={}){return this.annotationsPromise&&this.annotationsIntent===e||(this.annotationsPromise=this._transport.getAnnotations(this.pageIndex,e),this.annotationsIntent=e),this.annotationsPromise}render({canvasContext:e,viewport:t,intent:i="display",enableWebGL:n=!1,renderInteractiveForms:s=!1,transform:r=null,imageLayer:a=null,canvasFactory:o=null,background:l=null}){this._stats&&this._stats.time("Overall");const h="print"===i?"print":"display";this.pendingCleanup=!1,this.intentStates[h]||(this.intentStates[h]=Object.create(null));const c=this.intentStates[h];c.streamReaderCancelTimeout&&(clearTimeout(c.streamReaderCancelTimeout),c.streamReaderCancelTimeout=null);const d=o||new _display_utils.DOMCanvasFactory,u=new _webgl.WebGLContext({enable:n});c.displayReadyCapability||(c.displayReadyCapability=(0,_util.createPromiseCapability)(),c.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this.pageNumber-1,intent:h,renderInteractiveForms:!0===s}));const p=e=>{const t=c.renderTasks.indexOf(g);t>=0&&c.renderTasks.splice(t,1),(this.cleanupAfterRender||"print"===h)&&(this.pendingCleanup=!0),this._tryCleanup(),e?(g.capability.reject(e),this._abortOperatorList({intentState:c,reason:e})):g.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},g=new InternalRenderTask({callback:p,params:{canvasContext:e,viewport:t,transform:r,imageLayer:a,background:l},objs:this.objs,commonObjs:this.commonObjs,operatorList:c.operatorList,pageNumber:this.pageNumber,canvasFactory:d,webGLContext:u,useRequestAnimationFrame:"print"!==h,pdfBug:this._pdfBug});c.renderTasks||(c.renderTasks=[]),c.renderTasks.push(g);const f=g.task;return c.displayReadyCapability.promise.then(e=>{this.pendingCleanup?p():(this._stats&&this._stats.time("Rendering"),g.initializeGraphics(e),g.operatorListChanged())}).catch(p),f}getOperatorList(){this.intentStates.oplist||(this.intentStates.oplist=Object.create(null));const e=this.intentStates.oplist;let t;return e.opListReadCapability||(t={},t.operatorListChanged=function(){if(e.operatorList.lastChunk){e.opListReadCapability.resolve(e.operatorList);const i=e.renderTasks.indexOf(t);i>=0&&e.renderTasks.splice(i,1)}},e.opListReadCapability=(0,_util.createPromiseCapability)(),e.renderTasks=[],e.renderTasks.push(t),e.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this.pageIndex,intent:"oplist"})),e.opListReadCapability.promise}streamTextContent({normalizeWhitespace:e=!1,disableCombineTextItems:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this.pageNumber-1,normalizeWhitespace:!0===e,combineTextItems:!0!==t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){const t=this.streamTextContent(e);return new Promise((function(e,i){const n=t.getReader(),s={items:[],styles:Object.create(null)};!function t(){n.read().then((function({value:i,done:n}){n?e(s):(Object.assign(s.styles,i.styles),s.items.push(...i.items),t())}),i)}()}))}_destroy(){this.destroyed=!0,this._transport.pageCache[this.pageIndex]=null;const e=[];return Object.keys(this.intentStates).forEach(t=>{const i=this.intentStates[t];this._abortOperatorList({intentState:i,reason:new Error("Page was destroyed."),force:!0}),"oplist"!==t&&i.renderTasks.forEach((function(t){const i=t.capability.promise.catch((function(){}));e.push(i),t.cancel()}))}),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(e)}cleanup(e=!1){return this.pendingCleanup=!0,this._tryCleanup(e)}_tryCleanup(e=!1){return!(!this.pendingCleanup||Object.keys(this.intentStates).some(e=>{const t=this.intentStates[e];return 0!==t.renderTasks.length||!t.operatorList.lastChunk}))&&(Object.keys(this.intentStates).forEach(e=>{delete this.intentStates[e]}),this.objs.clear(),this.annotationsPromise=null,e&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,!0)}_startRenderPage(e,t){const i=this.intentStates[t];i&&(this._stats&&this._stats.timeEnd("Page Request"),i.displayReadyCapability&&i.displayReadyCapability.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;for(let e=0;e<t.renderTasks.length;e++)t.renderTasks[e].operatorListChanged();e.lastChunk&&this._tryCleanup()}_pumpOperatorList(e){(0,_util.assert)(e.intent,'PDFPageProxy._pumpOperatorList: Expected "intent" argument.');const t=this._transport.messageHandler.sendWithStream("GetOperatorList",e).getReader(),i=this.intentStates[e.intent];i.streamReader=t;const n=()=>{t.read().then(({value:e,done:t})=>{t?i.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,i),n())},e=>{if(i.streamReader=null,!this._transport.destroyed){if(i.operatorList){i.operatorList.lastChunk=!0;for(let e=0;e<i.renderTasks.length;e++)i.renderTasks[e].operatorListChanged();this._tryCleanup()}if(i.displayReadyCapability)i.displayReadyCapability.reject(e);else{if(!i.opListReadCapability)throw e;i.opListReadCapability.reject(e)}}})};n()}_abortOperatorList({intentState:e,reason:t,force:i=!1}){if((0,_util.assert)(t instanceof Error||"object"==typeof t&&null!==t,'PDFPageProxy._abortOperatorList: Expected "reason" argument.'),e.streamReader){if(!i){if(0!==e.renderTasks.length)return;if(t instanceof _display_utils.RenderingCancelledException)return void(e.streamReaderCancelTimeout=setTimeout(()=>{this._abortOperatorList({intentState:e,reason:t,force:!0}),e.streamReaderCancelTimeout=null},RENDERING_CANCELLED_TIMEOUT))}e.streamReader.cancel(new _util.AbortException(t&&t.message)),e.streamReader=null,this._transport.destroyed||(Object.keys(this.intentStates).some(t=>this.intentStates[t]===e&&(delete this.intentStates[t],!0)),this.cleanup())}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(e=!0){this._listeners=[],this._defer=e,this._deferred=Promise.resolve(void 0)}postMessage(e,t){if(!this._defer)return void this._listeners.forEach(t=>{t.call(this,{data:e})});const i=new WeakMap,n={data:function e(n){if("object"!=typeof n||null===n)return n;if(i.has(n))return i.get(n);let s,r;if((s=n.buffer)&&(0,_util.isArrayBuffer)(s)){return r=t&&t.includes(s)?new n.constructor(s,n.byteOffset,n.byteLength):new n.constructor(n),i.set(n,r),r}r=Array.isArray(n)?[]:{},i.set(n,r);for(const t in n){let i,s=n;for(;!(i=Object.getOwnPropertyDescriptor(s,t));)s=Object.getPrototypeOf(s);if(void 0!==i.value)if("function"!=typeof i.value)r[t]=e(i.value);else if(n.hasOwnProperty&&n.hasOwnProperty(t))throw new Error(`LoopbackPort.postMessage - cannot clone: ${n[t]}`)}return r}(e)};this._deferred.then(()=>{this._listeners.forEach(e=>{e.call(this,n)})})}addEventListener(e,t){this._listeners.push(t)}removeEventListener(e,t){const i=this._listeners.indexOf(t);this._listeners.splice(i,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorker=function PDFWorkerClosure(){const pdfWorkerPorts=new WeakMap;let isWorkerDisabled=!1,fallbackWorkerSrc,nextFakeWorkerId=0,fakeWorkerCapability;if(_is_node.isNodeJS&&"function"==typeof require)isWorkerDisabled=!0,fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document&&"currentScript"in document){const e=document.currentScript&&document.currentScript.src;e&&(fallbackWorkerSrc=e.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}function getWorkerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(void 0!==fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}function getMainThreadWorkerMessageHandler(){let e;try{e=globalThis.pdfjsWorker&&globalThis.pdfjsWorker.WorkerMessageHandler}catch(e){}return e||null}function setupFakeWorkerGlobal(){if(fakeWorkerCapability)return fakeWorkerCapability.promise;fakeWorkerCapability=(0,_util.createPromiseCapability)();const loader=async function(){const mainWorkerMessageHandler=getMainThreadWorkerMessageHandler();if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&"function"==typeof require){const worker=eval("require")(getWorkerSrc());return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(getWorkerSrc()),window.pdfjsWorker.WorkerMessageHandler};return loader().then(fakeWorkerCapability.resolve,fakeWorkerCapability.reject),fakeWorkerCapability.promise}function createCDNWrapper(e){const t="importScripts('"+e+"');";return URL.createObjectURL(new Blob([t]))}class PDFWorker{constructor({name:e=null,port:t=null,verbosity:i=(0,_util.getVerbosityLevel)()}={}){if(t&&pdfWorkerPorts.has(t))throw new Error("Cannot use more than one PDFWorker per port");if(this.name=e,this.destroyed=!1,this.postMessageTransfers=!0,this.verbosity=i,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,t)return pdfWorkerPorts.set(t,this),void this._initializeFromPort(t);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()}_initialize(){if("undefined"!=typeof Worker&&!isWorkerDisabled&&!getMainThreadWorkerMessageHandler()){let e=getWorkerSrc();try{(0,_util.isSameOrigin)(window.location.href,e)||(e=createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e),i=new _message_handler.MessageHandler("main","worker",t),n=()=>{t.removeEventListener("error",s),i.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=()=>{this._webWorker||n()};t.addEventListener("error",s),i.on("test",e=>{t.removeEventListener("error",s),this.destroyed?n():e?(this._messageHandler=i,this._port=t,this._webWorker=t,e.supportTransfers||(this.postMessageTransfers=!1),this._readyCapability.resolve(),i.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),i.destroy(),t.terminate())}),i.on("ready",e=>{if(t.removeEventListener("error",s),this.destroyed)n();else try{r()}catch(e){this._setupFakeWorker()}});const r=()=>{const e=new Uint8Array([this.postMessageTransfers?255:0]);try{i.send("test",e,[e.buffer])}catch(t){(0,_util.warn)("Cannot use postMessage transfers."),e[0]=0,i.send("test",e)}};return void r()}catch(e){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),isWorkerDisabled=!0),setupFakeWorkerGlobal().then(e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new LoopbackPort;this._port=t;const i="fake"+nextFakeWorkerId++,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,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),pdfWorkerPorts.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return pdfWorkerPorts.has(e.port)?pdfWorkerPorts.get(e.port):new PDFWorker(e)}static getWorkerSrc(){return getWorkerSrc()}}return PDFWorker}();exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(e,t,i,n){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:t.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this)}),this._params=n,this.CMapReaderFactory=new n.CMapReaderFactory({baseUrl:n.cMapUrl,isCompressed:n.cMapPacked}),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}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=[];this.pageCache.forEach((function(t){t&&e.push(t._destroy())})),this.pageCache.length=0,this.pagePromises.length=0;const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{this.fontLoader.clear(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(e,t)=>{(0,_util.assert)(this._networkStream),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then((function({value:e,done:i}){i?t.close():((0,_util.assert)((0,_util.isArrayBuffer)(e)),t.enqueue(new Uint8Array(e),1,[e]))})).catch(e=>{t.error(e)})},t.onCancel=e=>{this._fullReader.cancel(e)}}),e.on("ReaderHeadersReady",e=>{const i=(0,_util.createPromiseCapability)(),n=this._fullReader;return n.headersReady.then(()=>{n.isStreamingSupported&&n.isRangeSupported||(this._lastProgress&&t.onProgress&&t.onProgress(this._lastProgress),n.onProgress=e=>{t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}),i.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})},i.reject),i.promise}),e.on("GetRangeReader",(e,t)=>{(0,_util.assert)(this._networkStream);const i=this._networkStream.getRangeReader(e.begin,e.end);i?(t.onPull=()=>{i.read().then((function({value:e,done:i}){i?t.close():((0,_util.assert)((0,_util.isArrayBuffer)(e)),t.enqueue(new Uint8Array(e),1,[e]))})).catch(e=>{t.error(e)})},t.onCancel=e=>{i.cancel(e)}):t.close()}),e.on("GetDoc",({pdfInfo:e})=>{this._numPages=e.numPages,t._capability.resolve(new PDFDocumentProxy(e,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)}t._capability.reject(i)})),e.on("PasswordRequest",e=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),t.onPassword){const i=e=>{this._passwordCapability.resolve({password:e})};try{t.onPassword(i,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=>{t.onProgress&&t.onProgress({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on("StartRenderPage",e=>{if(this.destroyed)return;this.pageCache[e.pageIndex]._startRenderPage(e.transparency,e.intent)}),e.on("commonobj",t=>{if(this.destroyed)return;const[i,n,s]=t;if(!this.commonObjs.has(i))switch(n){case"Font":const t=this._params;if("error"in s){const e=s.error;(0,_util.warn)(`Error during font loading: ${e}`),this.commonObjs.resolve(i,e);break}let r=null;t.pdfBug&&globalThis.FontInspector&&globalThis.FontInspector.enabled&&(r={registerFont(e,t){globalThis.FontInspector.fontAdded(e,t)}});const a=new _font_loader.FontFaceObject(s,{isEvalSupported:t.isEvalSupported,disableFontFace:t.disableFontFace,ignoreErrors:t.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:r});this.fontLoader.bind(a).then(()=>{this.commonObjs.resolve(i,a)},t=>{e.sendWithPromise("FontFallback",{id:i}).finally(()=>{this.commonObjs.resolve(i,a)})});break;case"FontPath":case"FontType3Res":this.commonObjs.resolve(i,s);break;default:throw new Error(`Got unknown common object type ${n}`)}}),e.on("obj",e=>{if(this.destroyed)return;const[t,i,n,s]=e,r=this.pageCache[i];if(!r.objs.has(t))switch(n){case"JpegStream":return new Promise((e,t)=>{const i=new Image;i.onload=function(){e(i)},i.onerror=function(){t(new Error("Error during JPEG image loading")),(0,_display_utils.releaseImageResources)(i)},i.src=s}).then(e=>{r.objs.resolve(t,e)});case"Image":r.objs.resolve(t,s);const e=8e6;s&&"data"in s&&s.data.length>e&&(r.cleanupAfterRender=!0);break;default:throw new Error(`Got unknown object type ${n}`)}}),e.on("DocProgress",e=>{this.destroyed||t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}),e.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),e.on("JpegDecode",e=>{if(this.destroyed)return Promise.reject(new Error("Worker was destroyed"));if("undefined"==typeof document)return Promise.reject(new Error('"document" is not defined.'));const[t,i]=e;return 3!==i&&1!==i?Promise.reject(new Error("Only 3 components or 1 component can be returned")):new Promise((function(e,n){const s=new Image;s.onload=function(){const{width:t,height:n}=s,r=t*n,a=4*r,o=new Uint8ClampedArray(r*i);let l=document.createElement("canvas");l.width=t,l.height=n;let h=l.getContext("2d");h.drawImage(s,0,0);const c=h.getImageData(0,0,t,n).data;if(3===i)for(let e=0,t=0;e<a;e+=4,t+=3)o[t]=c[e],o[t+1]=c[e+1],o[t+2]=c[e+2];else if(1===i)for(let e=0,t=0;e<a;e+=4,t++)o[t]=c[e];e({data:o,width:t,height:n}),(0,_display_utils.releaseImageResources)(s),l.width=0,l.height=0,l=null,h=null},s.onerror=function(){n(new Error("JpegDecode failed to load image")),(0,_display_utils.releaseImageResources)(s)},s.src=t}))}),e.on("FetchBuiltInCMap",(e,t)=>{if(this.destroyed)return void t.error(new Error("Worker was destroyed"));let i=!1;t.onPull=()=>{i?t.close():(i=!0,this.CMapReaderFactory.fetch(e).then((function(e){t.enqueue(e,1,[e.cMapData.buffer])})).catch((function(e){t.error(e)})))}})}_onUnsupportedFeature({featureId:e}){this.destroyed||this.loadingTask.onUnsupportedFeature&&this.loadingTask.onUnsupportedFeature(e)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request"));const t=e-1;if(t in this.pagePromises)return this.pagePromises[t];const i=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.pdfBug);return this.pageCache[t]=i,i});return this.pagePromises[t]=i,i}getPageIndex(e){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:e}).catch((function(e){return Promise.reject(new Error(e))}))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}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)}getOpenActionDestination(){return this.messageHandler.sendWithPromise("GetOpenActionDestination",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return this.messageHandler.sendWithPromise("GetMetadata",null).then(e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?this._fullReader.filename:null}))}getStats(){return this.messageHandler.sendWithPromise("GetStats",null)}startCleanup(){return this.messageHandler.sendWithPromise("Cleanup",null).then(()=>{for(let e=0,t=this.pageCache.length;e<t;e++){const t=this.pageCache[e];if(t){if(!t.cleanup())throw new Error(`startCleanup: Page ${e+1} is currently rendering.`)}}this.commonObjs.clear(),this.fontLoader.clear()})}get loadingParams(){const e=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e.disableAutoFetch,disableCreateObjectURL:e.disableCreateObjectURL,disableFontFace:e.disableFontFace,nativeImageDecoderSupport:e.nativeImageDecoderSupport})}}class PDFObjects{constructor(){this._objs=Object.create(null)}_ensureObj(e){return this._objs[e]?this._objs[e]:this._objs[e]={capability:(0,_util.createPromiseCapability)(),data:null,resolved:!1}}get(e,t=null){if(t)return this._ensureObj(e).capability.promise.then(t),null;const i=this._objs[e];if(!i||!i.resolved)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return i.data}has(e){const t=this._objs[e];return!!t&&t.resolved}resolve(e,t){const i=this._ensureObj(e);i.resolved=!0,i.data=t,i.capability.resolve(t)}clear(){for(const e in this._objs){const{data:t}=this._objs[e];"undefined"!=typeof Image&&t instanceof Image&&(0,_display_utils.releaseImageResources)(t)}this._objs=Object.create(null)}}class RenderTask{constructor(e){this._internalRenderTask=e,this.onContinue=null}get promise(){return this._internalRenderTask.capability.promise}cancel(){this._internalRenderTask.cancel()}then(e,t){throw new Error("Removed API method: RenderTask.then, use the `promise` getter instead.")}}const InternalRenderTask=function(){const e=new WeakSet;return class{constructor({callback:e,params:t,objs:i,commonObjs:n,operatorList:s,pageNumber:r,canvasFactory:a,webGLContext:o,useRequestAnimationFrame:l=!1,pdfBug:h=!1}){this.callback=e,this.params=t,this.objs=i,this.commonObjs=n,this.operatorListIdx=null,this.operatorList=s,this.pageNumber=r,this.canvasFactory=a,this.webGLContext=o,this._pdfBug=h,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===l&&"undefined"!=typeof window,this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvasContext.canvas}initializeGraphics(t=!1){if(this.cancelled)return;if(this._canvas){if(e.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.");e.add(this._canvas)}this._pdfBug&&globalThis.StepperManager&&globalThis.StepperManager.enabled&&(this.stepper=globalThis.StepperManager.create(this.pageNumber-1),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:n,transform:s,imageLayer:r,background:a}=this.params;this.gfx=new _canvas.CanvasGraphics(i,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext,r),this.gfx.beginDrawing({transform:s,viewport:n,transparency:t,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}cancel(t=null){this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&e.delete(this._canvas),this.callback(t||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this.pageNumber}`,"canvas"))}operatorListChanged(){this.graphicsReady?(this.stepper&&this.stepper.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this.cancel.bind(this))}):Promise.resolve().then(this._nextBound).catch(this.cancel.bind(this))}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this._canvas&&e.delete(this._canvas),this.callback())))}}}(),version="2.4.368";exports.version=version;const build="64351caf";exports.build=build},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addLinkAttributes=function(e,{url:t,target:i,rel:s,enabled:r=!0}={}){(0,n.assert)(t&&"string"==typeof t,'addLinkAttributes: A valid "url" parameter must provided.');const a=(0,n.removeNullCharacters)(t);r?e.href=e.title=a:(e.href="",e.title=`Disabled: ${a}`,e.onclick=()=>!1);let l="";switch(i){case o.NONE:break;case o.SELF:l="_self";break;case o.BLANK:l="_blank";break;case o.PARENT:l="_parent";break;case o.TOP:l="_top"}e.target=l,e.rel="string"==typeof s?s:"noopener noreferrer nofollow"},t.getFilenameFromUrl=function(e){const t=e.indexOf("#"),i=e.indexOf("?"),n=Math.min(t>0?t:e.length,i>0?i:e.length);return e.substring(e.lastIndexOf("/",n)+1,n)},t.isFetchSupported=l,t.isValidFetchUrl=h,t.loadScript=function(e){return new Promise((t,i)=>{const n=document.createElement("script");n.src=e,n.onload=t,n.onerror=function(){i(new Error(`Cannot load script at: ${n.src}`))},(document.head||document.documentElement).appendChild(n)})},t.deprecated=function(e){console.log("Deprecated API usage: "+e)},t.releaseImageResources=function(e){(0,n.assert)(e instanceof Image,"Invalid `img` parameter.");const t=e.src;"string"==typeof t&&t.startsWith("blob:")&&URL.revokeObjectURL&&URL.revokeObjectURL(t);e.removeAttribute("src")},t.PDFDateString=t.StatTimer=t.DOMSVGFactory=t.DOMCMapReaderFactory=t.DOMCanvasFactory=t.DEFAULT_LINK_REL=t.LinkTarget=t.RenderingCancelledException=t.PageViewport=void 0;var n=i(1);t.DEFAULT_LINK_REL="noopener noreferrer nofollow";const s="http://www.w3.org/2000/svg";t.DOMCanvasFactory=class{create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const i=document.createElement("canvas"),n=i.getContext("2d");return i.width=e,i.height=t,{canvas:i,context:n}}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}};t.DOMCMapReaderFactory=class{constructor({baseUrl:e=null,isCompressed:t=!1}){this.baseUrl=e,this.isCompressed=t}async fetch({name: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(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":""),i=this.isCompressed?n.CMapCompressionType.BINARY:n.CMapCompressionType.NONE;return l()&&h(t,document.baseURI)?fetch(t).then(async e=>{if(!e.ok)throw new Error(e.statusText);let t;return t=this.isCompressed?new Uint8Array(await e.arrayBuffer()):(0,n.stringToBytes)(await e.text()),{cMapData:t,compressionType:i}}).catch(e=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}`+`CMap at: ${t}`)}):new Promise((e,s)=>{const r=new XMLHttpRequest;r.open("GET",t,!0),this.isCompressed&&(r.responseType="arraybuffer"),r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(200===r.status||0===r.status){let t;if(this.isCompressed&&r.response?t=new Uint8Array(r.response):!this.isCompressed&&r.responseText&&(t=(0,n.stringToBytes)(r.responseText)),t)return void e({cMapData:t,compressionType:i})}s(new Error(r.statusText))}},r.send(null)}).catch(e=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}`+`CMap at: ${t}`)})}};t.DOMSVGFactory=class{create(e,t){(0,n.assert)(e>0&&t>0,"Invalid SVG dimensions");const i=document.createElementNS(s,"svg:svg");return i.setAttribute("version","1.1"),i.setAttribute("width",e+"px"),i.setAttribute("height",t+"px"),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox","0 0 "+e+" "+t),i}createElement(e){return(0,n.assert)("string"==typeof e,"Invalid SVG element type"),document.createElementNS(s,e)}};class r{constructor({viewBox:e,scale:t,rotation:i,offsetX:n=0,offsetY:s=0,dontFlip:r=!1}){this.viewBox=e,this.scale=t,this.rotation=i,this.offsetX=n,this.offsetY=s;const a=(e[2]+e[0])/2,o=(e[3]+e[1])/2;let l,h,c,d,u,p,g,f;switch(i=(i%=360)<0?i+360:i){case 180:l=-1,h=0,c=0,d=1;break;case 90:l=0,h=1,c=1,d=0;break;case 270:l=0,h=-1,c=-1,d=0;break;default:l=1,h=0,c=0,d=-1}r&&(c=-c,d=-d),0===l?(u=Math.abs(o-e[1])*t+n,p=Math.abs(a-e[0])*t+s,g=Math.abs(e[3]-e[1])*t,f=Math.abs(e[2]-e[0])*t):(u=Math.abs(a-e[0])*t+n,p=Math.abs(o-e[1])*t+s,g=Math.abs(e[2]-e[0])*t,f=Math.abs(e[3]-e[1])*t),this.transform=[l*t,h*t,c*t,d*t,u-l*t*a-c*t*o,p-h*t*a-d*t*o],this.width=g,this.height=f}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}={}){return new r({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(e,t){return n.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=n.Util.applyTransform([e[0],e[1]],this.transform),i=n.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],i[0],i[1]]}convertToPdfPoint(e,t){return n.Util.applyInverseTransform([e,t],this.transform)}}t.PageViewport=r;class a extends n.BaseException{constructor(e,t){super(e),this.type=t}}t.RenderingCancelledException=a;const o={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};t.LinkTarget=o;function l(){return"undefined"!=typeof fetch&&"undefined"!=typeof Response&&"body"in Response.prototype&&"undefined"!=typeof ReadableStream}function h(e,t){try{const{protocol:i}=t?new URL(e,t):new URL(e);return"http:"===i||"https:"===i}catch(e){return!1}}let c;t.StatTimer=class{constructor(){this.started=Object.create(null),this.times=[]}time(e){e in this.started&&(0,n.warn)(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,n.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 e of this.times){const i=e.name;i.length>t&&(t=i.length)}for(const i of this.times){const n=i.end-i.start;e.push(`${i.name.padEnd(t)} ${n}ms\n`)}return e.join("")}};t.PDFDateString=class{static toDateObject(e){if(!e||!(0,n.isString)(e))return null;c||(c=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=c.exec(e);if(!t)return null;const i=parseInt(t[1],10);let s=parseInt(t[2],10);s=s>=1&&s<=12?s-1:0;let r=parseInt(t[3],10);r=r>=1&&r<=31?r: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 h=t[7]||"Z";let d=parseInt(t[8],10);d=d>=0&&d<=23?d:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,"-"===h?(a+=d,o+=u):"+"===h&&(a-=d,o-=u),new Date(Date.UTC(i,s,r,a,o,l))}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0;var n=i(1);class s{constructor({docId:e,onUnsupportedFeature:t}){this.constructor===s&&(0,n.unreachable)("Cannot initialize BaseFontLoader."),this.docId=e,this._onUnsupportedFeature=t,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(e){this.nativeFontFaces.push(e),document.fonts.add(e)}insertRule(e){let t=this.styleElement;t||(t=this.styleElement=document.createElement("style"),t.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,document.documentElement.getElementsByTagName("head")[0].appendChild(t));const i=t.sheet;i.insertRule(e,i.cssRules.length)}clear(){this.nativeFontFaces.forEach((function(e){document.fonts.delete(e)})),this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(e){if(e.attached||e.missingFile)return;if(e.attached=!0,this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(i){throw this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.font}),(0,n.warn)(`Failed to load font '${t.family}': '${i}'.`),e.disableFontFace=!0,i}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;return new Promise(i=>{const n=this._queueLoadingCallback(i);this._prepareFontLoadEvent([t],[e],n)})}}_queueLoadingCallback(e){(0,n.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){(0,n.unreachable)("Abstract method `isFontLoadingAPISupported`.")}get isSyncFontLoadingSupported(){(0,n.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,n.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(e,t,i){(0,n.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let r;t.FontLoader=r,t.FontLoader=r=class extends s{constructor(e){super(e),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isFontLoadingAPISupported(){let e="undefined"!=typeof document&&!!document.fonts;if(e&&"undefined"!=typeof navigator){const t=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);t&&t[1]<63&&(e=!1)}return(0,n.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;if("undefined"==typeof navigator)e=!0;else{const t=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);t&&t[1]>=14&&(e=!0)}return(0,n.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const t=this.loadingContext,i={id:`pdfjs-font-loading-${t.nextRequestId++}`,done:!1,complete:function(){for((0,n.assert)(!i.done,"completeRequest() cannot be called twice."),i.done=!0;t.requests.length>0&&t.requests[0].done;){const e=t.requests.shift();setTimeout(e.callback,0)}},callback:e};return t.requests.push(i),i}get _loadTestFont(){return(0,n.shadow)(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(e,t,i){function s(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function r(e,t,i,n){return e.substring(0,t)+n+e.substring(t+i)}let a,o;const l=document.createElement("canvas");l.width=1,l.height=1;const h=l.getContext("2d");let c=0;const d=`lt${Date.now()}${this.loadTestFontId++}`;let u=this._loadTestFont;u=r(u,976,d.length,d);let p=s(u,16);for(a=0,o=d.length-3;a<o;a+=4)p=p-1482184792+s(d,a)|0;a<d.length&&(p=p-1482184792+s(d+"XXX",a)|0),u=r(u,16,4,(0,n.string32)(p));const g=`@font-face {font-family:"${d}";src:${`url(data:font/opentype;base64,${btoa(u)});`}}`;this.insertRule(g);const f=[];for(a=0,o=t.length;a<o;a++)f.push(t[a].loadedName);f.push(d);const m=document.createElement("div");for(m.style.visibility="hidden",m.style.width=m.style.height="10px",m.style.position="absolute",m.style.top=m.style.left="0px",a=0,o=f.length;a<o;++a){const e=document.createElement("span");e.textContent="Hi",e.style.fontFamily=f[a],m.appendChild(e)}document.body.appendChild(m),function e(t,i){if(c++,c>30)return(0,n.warn)("Load test font never loaded."),void i();h.font="30px "+t,h.fillText(".",0,20),h.getImageData(0,0,1,1).data[3]>0?i():setTimeout(e.bind(null,t,i))}(d,(function(){document.body.removeChild(m),i.complete()}))}};const a={get value(){return(0,n.shadow)(this,"value",(0,n.isEvalSupported)())}};t.FontFaceObject=class{constructor(e,{isEvalSupported:t=!0,disableFontFace:i=!1,ignoreErrors:n=!1,onUnsupportedFeature:s=null,fontRegistry:r=null}){this.compiledGlyphs=Object.create(null);for(const t in e)this[t]=e[t];this.isEvalSupported=!1!==t,this.disableFontFace=!0===i,this.ignoreErrors=!0===n,this._onUnsupportedFeature=s,this.fontRegistry=r}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;const e=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=(0,n.bytesToString)(new Uint8Array(this.data)),t=`url(data:${this.mimetype};base64,${btoa(e)});`,i=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,t),i}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let i,s;try{i=e.get(this.loadedName+"_path_"+t)}catch(e){if(!this.ignoreErrors)throw e;return this._onUnsupportedFeature&&this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.font}),(0,n.warn)(`getPathGenerator - ignoring character: "${e}".`),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&a.value){let e,n="";for(let t=0,r=i.length;t<r;t++)s=i[t],e=void 0!==s.args?s.args.join(","):"",n+="c."+s.cmd+"("+e+");\n";return this.compiledGlyphs[t]=new Function("c","size",n)}return this.compiledGlyphs[t]=function(e,t){for(let n=0,r=i.length;n<r;n++)s=i[n],"scale"===s.cmd&&(s.args=[t,-t]),e[s.cmd].apply(e,s.args)}}}},function(e,t,i){"use strict";const n=Object.create(null);{const{isNodeJS:e}=i(7),t="undefined"!=typeof navigator&&navigator.userAgent||"",s=/Trident/.test(t),r=/CriOS/.test(t);(s||r)&&(n.disableCreateObjectURL=!0),e&&(n.disableFontFace=!0,n.nativeImageDecoderSupport="none")}t.apiCompatibilityParams=Object.freeze(n)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeJS=void 0;const n="object"==typeof process&&process+""=="[object process]"&&!process.versions.nw&&!process.versions.electron;t.isNodeJS=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasGraphics=void 0;var n=i(1),s=i(9),r={get value(){return(0,n.shadow)(r,"value",(0,n.isLittleEndian)())}};function a(e){e.mozCurrentTransform||(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._transformMatrix=e._transformMatrix||[1,0,0,1,0,0],e._transformStack=[],Object.defineProperty(e,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(e,"mozCurrentTransformInverse",{get:function(){var e=this._transformMatrix,t=e[0],i=e[1],n=e[2],s=e[3],r=e[4],a=e[5],o=t*s-i*n,l=i*n-t*s;return[s/o,i/l,n/l,t/o,(s*r-n*a)/l,(i*r-t*a)/o]}}),e.save=function(){var e=this._transformMatrix;this._transformStack.push(e),this._transformMatrix=e.slice(0,6),this._originalSave()},e.restore=function(){var e=this._transformStack.pop();e&&(this._transformMatrix=e,this._originalRestore())},e.translate=function(e,t){var i=this._transformMatrix;i[4]=i[0]*e+i[2]*t+i[4],i[5]=i[1]*e+i[3]*t+i[5],this._originalTranslate(e,t)},e.scale=function(e,t){var i=this._transformMatrix;i[0]=i[0]*e,i[1]=i[1]*e,i[2]=i[2]*t,i[3]=i[3]*t,this._originalScale(e,t)},e.transform=function(t,i,n,s,r,a){var o=this._transformMatrix;this._transformMatrix=[o[0]*t+o[2]*i,o[1]*t+o[3]*i,o[0]*n+o[2]*s,o[1]*n+o[3]*s,o[0]*r+o[2]*a+o[4],o[1]*r+o[3]*a+o[5]],e._originalTransform(t,i,n,s,r,a)},e.setTransform=function(t,i,n,s,r,a){this._transformMatrix=[t,i,n,s,r,a],e._originalSetTransform(t,i,n,s,r,a)},e.rotate=function(e){var t=Math.cos(e),i=Math.sin(e),n=this._transformMatrix;this._transformMatrix=[n[0]*t+n[2]*i,n[1]*t+n[3]*i,n[0]*-i+n[2]*t,n[1]*-i+n[3]*t,n[4],n[5]],this._originalRotate(e)})}var o=function(){function e(e){this.canvasFactory=e,this.cache=Object.create(null)}return e.prototype={getCanvas:function(e,t,i,n){var s;return void 0!==this.cache[e]?(s=this.cache[e],this.canvasFactory.reset(s,t,i),s.context.setTransform(1,0,0,1,0,0)):(s=this.canvasFactory.create(t,i),this.cache[e]=s),n&&a(s.context),s},clear(){for(var e in this.cache){var t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}},e}();var l=function(){function e(){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.resumeSMaskCtx=null}return e.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(e,t){this.x=e,this.y=t}},e}(),h=function(){function e(e,t,i,n,s,r){this.ctx=e,this.current=new l,this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=i,this.canvasFactory=n,this.webGLContext=s,this.imageLayer=r,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.cachedCanvases=new o(this.canvasFactory),e&&a(e),this._cachedGetSinglePixelWidth=null}function t(e,t){if("undefined"!=typeof ImageData&&t instanceof ImageData)e.putImageData(t,0,0);else{var i,s,a,o,l,h=t.height,c=t.width,d=h%16,u=(h-d)/16,p=0===d?u:u+1,g=e.createImageData(c,16),f=0,m=t.data,v=g.data;if(t.kind===n.ImageKind.GRAYSCALE_1BPP){var b=m.byteLength,_=new Uint32Array(v.buffer,0,v.byteLength>>2),w=_.length,y=c+7>>3,A=4294967295,S=r.value?4278190080:255;for(s=0;s<p;s++){for(o=s<u?16:d,i=0,a=0;a<o;a++){for(var P=b-f,C=0,x=P>y?c:8*P-7,E=-8&x,T=0,L=0;C<E;C+=8)L=m[f++],_[i++]=128&L?A:S,_[i++]=64&L?A:S,_[i++]=32&L?A:S,_[i++]=16&L?A:S,_[i++]=8&L?A:S,_[i++]=4&L?A:S,_[i++]=2&L?A:S,_[i++]=1&L?A:S;for(;C<x;C++)0===T&&(L=m[f++],T=128),_[i++]=L&T?A:S,T>>=1}for(;i<w;)_[i++]=0;e.putImageData(g,0,16*s)}}else if(t.kind===n.ImageKind.RGBA_32BPP){for(a=0,l=16*c*4,s=0;s<u;s++)v.set(m.subarray(f,f+l)),f+=l,e.putImageData(g,0,a),a+=16;s<p&&(l=c*d*4,v.set(m.subarray(f,f+l)),e.putImageData(g,0,a))}else{if(t.kind!==n.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${t.kind}`);for(l=c*(o=16),s=0;s<p;s++){for(s>=u&&(l=c*(o=d)),i=0,a=l;a--;)v[i++]=m[f++],v[i++]=m[f++],v[i++]=m[f++],v[i++]=255;e.putImageData(g,0,16*s)}}}}function i(e,t){for(var i=t.height,n=t.width,s=i%16,r=(i-s)/16,a=0===s?r:r+1,o=e.createImageData(n,16),l=0,h=t.data,c=o.data,d=0;d<a;d++){for(var u=d<r?16:s,p=3,g=0;g<u;g++)for(var f=0,m=0;m<n;m++){if(!f){var v=h[l++];f=128}c[p]=v&f?0:255,p+=4,f>>=1}e.putImageData(o,0,16*d)}}function h(e,t){for(var i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],n=0,s=i.length;n<s;n++){var r=i[n];void 0!==e[r]&&(t[r]=e[r])}void 0!==e.setLineDash&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function c(e){e.strokeStyle="#000000",e.fillStyle="#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",void 0!==e.setLineDash&&(e.setLineDash([]),e.lineDashOffset=0)}function d(e,t,i,n){for(var s=e.length,r=3;r<s;r+=4){var a=e[r];if(0===a)e[r-3]=t,e[r-2]=i,e[r-1]=n;else if(a<255){var o=255-a;e[r-3]=e[r-3]*a+t*o>>8,e[r-2]=e[r-2]*a+i*o>>8,e[r-1]=e[r-1]*a+n*o>>8}}}function u(e,t,i){for(var n=e.length,s=3;s<n;s+=4){var r=i?i[e[s]]:e[s];t[s]=t[s]*r*(1/255)|0}}function p(e,t,i){for(var n=e.length,s=3;s<n;s+=4){var r=77*e[s-3]+152*e[s-2]+28*e[s-1];t[s]=i?t[s]*i[r>>8]>>8:t[s]*r>>16}}function g(e,t,i,n){var s=t.canvas,r=t.context;e.setTransform(t.scaleX,0,0,t.scaleY,t.offsetX,t.offsetY);var a=t.backdrop||null;if(!t.transferMap&&n.isEnabled){const r=n.composeSMask({layer:i.canvas,mask:s,properties:{subtype:t.subtype,backdrop:a}});return e.setTransform(1,0,0,1,0,0),void e.drawImage(r,t.offsetX,t.offsetY)}!function(e,t,i,n,s,r,a){var o,l=!!r,h=l?r[0]:0,c=l?r[1]:0,g=l?r[2]:0;o="Luminosity"===s?p:u;for(var f=Math.min(n,Math.ceil(1048576/i)),m=0;m<n;m+=f){var v=Math.min(f,n-m),b=e.getImageData(0,m,i,v),_=t.getImageData(0,m,i,v);l&&d(b.data,h,c,g),o(b.data,_.data,a),e.putImageData(_,0,m)}}(r,i,s.width,s.height,t.subtype,a,t.transferMap),e.drawImage(s,0,0)}var f=["butt","round","square"],m=["miter","round","bevel"],v={},b={};for(var _ in e.prototype={beginDrawing({transform:e,viewport:t,transparency:i=!1,background:n=null}){var s=this.ctx.canvas.width,r=this.ctx.canvas.height;if(this.ctx.save(),this.ctx.fillStyle=n||"rgb(255, 255, 255)",this.ctx.fillRect(0,0,s,r),this.ctx.restore(),i){var a=this.cachedCanvases.getCanvas("transparent",s,r,!0);this.compositeCtx=this.ctx,this.transparentCanvas=a.canvas,this.ctx=a.context,this.ctx.save(),this.ctx.transform.apply(this.ctx,this.compositeCtx.mozCurrentTransform)}this.ctx.save(),c(this.ctx),e&&this.ctx.transform.apply(this.ctx,e),this.ctx.transform.apply(this.ctx,t.transform),this.baseTransform=this.ctx.mozCurrentTransform.slice(),this.imageLayer&&this.imageLayer.beginLayout()},executeOperatorList:function(e,t,i,s){var r=e.argsArray,a=e.fnArray,o=t||0,l=r.length;if(l===o)return o;for(var h,c=l-o>10&&"function"==typeof i,d=c?Date.now()+15:0,u=0,p=this.commonObjs,g=this.objs;;){if(void 0!==s&&o===s.nextBreakPoint)return s.breakIt(o,i),o;if((h=a[o])!==n.OPS.dependency)this[h].apply(this,r[o]);else for(const e of r[o]){const t=e.startsWith("g_")?p:g;if(!t.has(e))return t.get(e,i),o}if(++o===l)return o;if(c&&++u>10){if(Date.now()>d)return i(),o;u=0}}},endDrawing:function(){null!==this.current.activeSMask&&this.endSMaskGroup(),this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null),this.cachedCanvases.clear(),this.webGLContext.clear(),this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function(e){this.current.lineWidth=e,this.ctx.lineWidth=e},setLineCap:function(e){this.ctx.lineCap=f[e]},setLineJoin:function(e){this.ctx.lineJoin=m[e]},setMiterLimit:function(e){this.ctx.miterLimit=e},setDash:function(e,t){var i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(e),i.lineDashOffset=t)},setRenderingIntent(e){},setFlatness(e){},setGState:function(e){for(var t=0,i=e.length;t<i;t++){var n=e[t],s=n[0],r=n[1];switch(s){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r[0],r[1]);break;case"CA":this.current.strokeAlpha=n[1];break;case"ca":this.current.fillAlpha=n[1],this.ctx.globalAlpha=n[1];break;case"BM":this.ctx.globalCompositeOperation=r;break;case"SMask":this.current.activeSMask&&(this.stateStack.length>0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask?this.suspendSMaskGroup():this.endSMaskGroup()),this.current.activeSMask=r?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null}}},beginSMaskGroup:function(){var e=this.current.activeSMask,t=e.canvas.width,i=e.canvas.height,n="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(n,t,i,!0),r=this.ctx,a=r.mozCurrentTransform;this.ctx.save();var o=s.context;o.scale(1/e.scaleX,1/e.scaleY),o.translate(-e.offsetX,-e.offsetY),o.transform.apply(o,a),e.startTransformInverse=o.mozCurrentTransformInverse,h(r,o),this.ctx=o,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(r),this.groupLevel++},suspendSMaskGroup:function(){var e=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),g(this.ctx,this.current.activeSMask,e,this.webGLContext),this.ctx.restore(),this.ctx.save(),h(e,this.ctx),this.current.resumeSMaskCtx=e;var t=n.Util.transform(this.current.activeSMask.startTransformInverse,e.mozCurrentTransform);this.ctx.transform.apply(this.ctx,t),e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.restore()},resumeSMaskGroup:function(){var e=this.current.resumeSMaskCtx,t=this.ctx;this.ctx=e,this.groupStack.push(t),this.groupLevel++},endSMaskGroup:function(){var e=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),g(this.ctx,this.current.activeSMask,e,this.webGLContext),this.ctx.restore(),h(e,this.ctx);var t=n.Util.transform(this.current.activeSMask.startTransformInverse,e.mozCurrentTransform);this.ctx.transform.apply(this.ctx,t)},save:function(){this.ctx.save();var e=this.current;this.stateStack.push(e),this.current=e.clone(),this.current.resumeSMaskCtx=null},restore:function(){this.current.resumeSMaskCtx&&this.resumeSMaskGroup(),null===this.current.activeSMask||0!==this.stateStack.length&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask||this.endSMaskGroup(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.ctx.restore(),this.pendingClip=null,this._cachedGetSinglePixelWidth=null)},transform:function(e,t,i,n,s,r){this.ctx.transform(e,t,i,n,s,r),this._cachedGetSinglePixelWidth=null},constructPath:function(e,t){for(var i=this.ctx,s=this.current,r=s.x,a=s.y,o=0,l=0,h=e.length;o<h;o++)switch(0|e[o]){case n.OPS.rectangle:r=t[l++],a=t[l++];var c=t[l++],d=t[l++];0===c&&(c=this.getSinglePixelWidth()),0===d&&(d=this.getSinglePixelWidth());var u=r+c,p=a+d;this.ctx.moveTo(r,a),this.ctx.lineTo(u,a),this.ctx.lineTo(u,p),this.ctx.lineTo(r,p),this.ctx.lineTo(r,a),this.ctx.closePath();break;case n.OPS.moveTo:r=t[l++],a=t[l++],i.moveTo(r,a);break;case n.OPS.lineTo:r=t[l++],a=t[l++],i.lineTo(r,a);break;case n.OPS.curveTo:r=t[l+4],a=t[l+5],i.bezierCurveTo(t[l],t[l+1],t[l+2],t[l+3],r,a),l+=6;break;case n.OPS.curveTo2:i.bezierCurveTo(r,a,t[l],t[l+1],t[l+2],t[l+3]),r=t[l+2],a=t[l+3],l+=4;break;case n.OPS.curveTo3:r=t[l+2],a=t[l+3],i.bezierCurveTo(t[l],t[l+1],r,a,r,a),l+=4;break;case n.OPS.closePath:i.closePath()}s.setCurrentPoint(r,a)},closePath:function(){this.ctx.closePath()},stroke:function(e){e=void 0===e||e;var t=this.ctx,i=this.current.strokeColor;if(t.globalAlpha=this.current.strokeAlpha,i&&i.hasOwnProperty("type")&&"Pattern"===i.type){t.save();const e=t.mozCurrentTransform,s=n.Util.singularValueDecompose2dScale(e)[0];t.strokeStyle=i.getPattern(t,this),t.lineWidth=Math.max(.65*this.getSinglePixelWidth(),this.current.lineWidth*s),t.stroke(),t.restore()}else t.lineWidth=Math.max(.65*this.getSinglePixelWidth(),this.current.lineWidth),t.stroke();e&&this.consumePath(),t.globalAlpha=this.current.fillAlpha},closeStroke:function(){this.closePath(),this.stroke()},fill:function(e){e=void 0===e||e;var t=this.ctx,i=this.current.fillColor,n=!1;this.current.patternFill&&(t.save(),this.baseTransform&&t.setTransform.apply(t,this.baseTransform),t.fillStyle=i.getPattern(t,this),n=!0),this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill(),n&&t.restore(),e&&this.consumePath()},eoFill:function(){this.pendingEOFill=!0,this.fill()},fillStroke:function(){this.fill(!1),this.stroke(!1),this.consumePath()},eoFillStroke:function(){this.pendingEOFill=!0,this.fillStroke()},closeFillStroke:function(){this.closePath(),this.fillStroke()},closeEOFillStroke:function(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()},endPath:function(){this.consumePath()},clip:function(){this.pendingClip=v},eoClip:function(){this.pendingClip=b},beginText:function(){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:function(){var e=this.pendingTextPaths,t=this.ctx;if(void 0!==e){t.save(),t.beginPath();for(var i=0;i<e.length;i++){var n=e[i];t.setTransform.apply(t,n.transform),t.translate(n.x,n.y),n.addToPath(t,n.fontSize)}t.restore(),t.clip(),t.beginPath(),delete this.pendingTextPaths}else t.beginPath()},setCharSpacing:function(e){this.current.charSpacing=e},setWordSpacing:function(e){this.current.wordSpacing=e},setHScale:function(e){this.current.textHScale=e/100},setLeading:function(e){this.current.leading=-e},setFont:function(e,t){var i=this.commonObjs.get(e),s=this.current;if(!i)throw new Error(`Can't find font for ${e}`);if(s.fontMatrix=i.fontMatrix?i.fontMatrix:n.FONT_IDENTITY_MATRIX,0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||(0,n.warn)("Invalid font matrix for font "+e),t<0?(t=-t,s.fontDirection=-1):s.fontDirection=1,this.current.font=i,this.current.fontSize=t,i.isType3Font)return;var r=i.loadedName||"sans-serif";let a="normal";i.black?a="900":i.bold&&(a="bold");var o=i.italic?"italic":"normal",l=`"${r}", ${i.fallbackName}`;let h=t;t<16?h=16:t>100&&(h=100),this.current.fontSizeScale=t/h,this.ctx.font=`${o} ${a} ${h}px ${l}`},setTextRenderingMode:function(e){this.current.textRenderingMode=e},setTextRise:function(e){this.current.textRise=e},moveText:function(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t},setLeadingMoveText:function(e,t){this.setLeading(-t),this.moveText(e,t)},setTextMatrix:function(e,t,i,n,s,r){this.current.textMatrix=[e,t,i,n,s,r],this.current.textMatrixScale=Math.sqrt(e*e+t*t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar(e,t,i,s){var r=this.ctx,a=this.current,o=a.font,l=a.textRenderingMode,h=a.fontSize/a.fontSizeScale,c=l&n.TextRenderingMode.FILL_STROKE_MASK,d=!!(l&n.TextRenderingMode.ADD_TO_PATH_FLAG);const u=a.patternFill&&o.data;var p;((o.disableFontFace||d||u)&&(p=o.getPathGenerator(this.commonObjs,e)),o.disableFontFace||u?(r.save(),r.translate(t,i),r.beginPath(),p(r,h),s&&r.setTransform.apply(r,s),c!==n.TextRenderingMode.FILL&&c!==n.TextRenderingMode.FILL_STROKE||r.fill(),c!==n.TextRenderingMode.STROKE&&c!==n.TextRenderingMode.FILL_STROKE||r.stroke(),r.restore()):(c!==n.TextRenderingMode.FILL&&c!==n.TextRenderingMode.FILL_STROKE||r.fillText(e,t,i),c!==n.TextRenderingMode.STROKE&&c!==n.TextRenderingMode.FILL_STROKE||r.strokeText(e,t,i)),d)&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:r.mozCurrentTransform,x:t,y:i,fontSize:h,addToPath:p})},get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);for(var t=e.getImageData(0,0,10,10).data,i=!1,s=3;s<t.length;s+=4)if(t[s]>0&&t[s]<255){i=!0;break}return(0,n.shadow)(this,"isFontSubpixelAAEnabled",i)},showText:function(e){var t=this.current,i=t.font;if(i.isType3Font)return this.showType3Text(e);var s=t.fontSize;if(0===s)return;var r=this.ctx,a=t.fontSizeScale,o=t.charSpacing,l=t.wordSpacing,h=t.fontDirection,c=t.textHScale*h,d=e.length,u=i.vertical,p=u?1:-1,g=i.defaultVMetrics,f=s*t.fontMatrix[0],m=t.textRenderingMode===n.TextRenderingMode.FILL&&!i.disableFontFace&&!t.patternFill;let v;if(r.save(),t.patternFill){r.save();const e=t.fillColor.getPattern(r,this);v=r.mozCurrentTransform,r.restore(),r.fillStyle=e}r.transform.apply(r,t.textMatrix),r.translate(t.x,t.y+t.textRise),h>0?r.scale(c,-1):r.scale(c,1);var b=t.lineWidth,_=t.textMatrixScale;if(0===_||0===b){var w=t.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;w!==n.TextRenderingMode.STROKE&&w!==n.TextRenderingMode.FILL_STROKE||(this._cachedGetSinglePixelWidth=null,b=.65*this.getSinglePixelWidth())}else b/=_;1!==a&&(r.scale(a,a),b/=a),r.lineWidth=b;var y,A=0;for(y=0;y<d;++y){var S=e[y];if((0,n.isNum)(S))A+=p*S*s/1e3;else{var P,C,x,E,T,L,k,R=!1,I=(S.isSpace?l:0)+o,N=S.fontChar,M=S.accent,F=S.width;if(u)T=S.vmetric||g,L=-(L=S.vmetric?T[1]:.5*F)*f,k=T[2]*f,F=T?-T[0]:F,P=L/a,C=(A+k)/a;else P=A/a,C=0;if(i.remeasure&&F>0){var D=1e3*r.measureText(N).width/s*a;if(F<D&&this.isFontSubpixelAAEnabled){var O=F/D;R=!0,r.save(),r.scale(O,1),P/=O}else F!==D&&(P+=(F-D)/2e3*s/a)}(S.isInFont||i.missingFile)&&(m&&!M?r.fillText(N,P,C):(this.paintChar(N,P,C,v),M&&(x=P+M.offset.x/a,E=C-M.offset.y/a,this.paintChar(M.fontChar,x,E,v)))),A+=F*f+I*h,R&&r.restore()}}u?t.y-=A*c:t.x+=A*c,r.restore()},showType3Text:function(e){var t,i,s,r,a=this.ctx,o=this.current,l=o.font,h=o.fontSize,c=o.fontDirection,d=l.vertical?1:-1,u=o.charSpacing,p=o.wordSpacing,g=o.textHScale*c,f=o.fontMatrix||n.FONT_IDENTITY_MATRIX,m=e.length;if(!(o.textRenderingMode===n.TextRenderingMode.INVISIBLE)&&0!==h){for(this._cachedGetSinglePixelWidth=null,a.save(),a.transform.apply(a,o.textMatrix),a.translate(o.x,o.y),a.scale(g,c),t=0;t<m;++t)if(i=e[t],(0,n.isNum)(i))r=d*i*h/1e3,this.ctx.translate(r,0),o.x+=r*g;else{var v=(i.isSpace?p:0)+u,b=l.charProcOperatorList[i.operatorListId];if(b)this.processingType3=i,this.save(),a.scale(h,h),a.transform.apply(a,f),this.executeOperatorList(b),this.restore(),s=n.Util.applyTransform([i.width,0],f)[0]*h+v,a.translate(s,0),o.x+=s*g;else(0,n.warn)(`Type3 character "${i.operatorListId}" is not available.`)}a.restore(),this.processingType3=null}},setCharWidth:function(e,t){},setCharWidthAndBounds:function(e,t,i,n,s,r){this.ctx.rect(i,n,s-i,r-n),this.clip(),this.endPath()},getColorN_Pattern:function(t){var i;if("TilingPattern"===t[0]){var n=t[1],r=this.baseTransform||this.ctx.mozCurrentTransform.slice(),a={createCanvasGraphics:t=>new e(t,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext)};i=new s.TilingPattern(t,n,this.ctx,a,r)}else i=(0,s.getShadingPatternFromIR)(t);return i},setStrokeColorN:function(){this.current.strokeColor=this.getColorN_Pattern(arguments)},setFillColorN:function(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0},setStrokeRGBColor:function(e,t,i){var s=n.Util.makeCssRgb(e,t,i);this.ctx.strokeStyle=s,this.current.strokeColor=s},setFillRGBColor:function(e,t,i){var s=n.Util.makeCssRgb(e,t,i);this.ctx.fillStyle=s,this.current.fillColor=s,this.current.patternFill=!1},shadingFill:function(e){var t=this.ctx;this.save();var i=(0,s.getShadingPatternFromIR)(e);t.fillStyle=i.getPattern(t,this,!0);var r=t.mozCurrentTransformInverse;if(r){var a=t.canvas,o=a.width,l=a.height,h=n.Util.applyTransform([0,0],r),c=n.Util.applyTransform([0,l],r),d=n.Util.applyTransform([o,0],r),u=n.Util.applyTransform([o,l],r),p=Math.min(h[0],c[0],d[0],u[0]),g=Math.min(h[1],c[1],d[1],u[1]),f=Math.max(h[0],c[0],d[0],u[0]),m=Math.max(h[1],c[1],d[1],u[1]);this.ctx.fillRect(p,g,f-p,m-g)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.restore()},beginInlineImage:function(){(0,n.unreachable)("Should not call beginInlineImage")},beginImageData:function(){(0,n.unreachable)("Should not call beginImageData")},paintFormXObjectBegin:function(e,t){if(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform.apply(this,e),this.baseTransform=this.ctx.mozCurrentTransform,t){var i=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],i,n),this.clip(),this.endPath()}},paintFormXObjectEnd:function(){this.restore(),this.baseTransform=this.baseTransformStack.pop()},beginGroup:function(e){this.save();var t=this.ctx;e.isolated||(0,n.info)("TODO: Support non-isolated groups."),e.knockout&&(0,n.warn)("Knockout groups not supported.");var i=t.mozCurrentTransform;if(e.matrix&&t.transform.apply(t,e.matrix),!e.bbox)throw new Error("Bounding box is required.");var s=n.Util.getAxialAlignedBoundingBox(e.bbox,t.mozCurrentTransform),r=[0,0,t.canvas.width,t.canvas.height];s=n.Util.intersect(s,r)||[0,0,0,0];var a=Math.floor(s[0]),o=Math.floor(s[1]),l=Math.max(Math.ceil(s[2])-a,1),c=Math.max(Math.ceil(s[3])-o,1),d=1,u=1;l>4096&&(d=l/4096,l=4096),c>4096&&(u=c/4096,c=4096);var p="groupAt"+this.groupLevel;e.smask&&(p+="_smask_"+this.smaskCounter++%2);var g=this.cachedCanvases.getCanvas(p,l,c,!0),f=g.context;f.scale(1/d,1/u),f.translate(-a,-o),f.transform.apply(f,i),e.smask?this.smaskStack.push({canvas:g.canvas,context:f,offsetX:a,offsetY:o,scaleX:d,scaleY:u,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(a,o),t.scale(d,u)),h(t,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++,this.current.activeSMask=null},endGroup:function(e){this.groupLevel--;var t=this.ctx;this.ctx=this.groupStack.pop(),void 0!==this.ctx.imageSmoothingEnabled?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,e.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(t.canvas,0,0),this.restore()},beginAnnotations:function(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function(){this.restore()},beginAnnotation:function(e,t,i){if(this.save(),c(this.ctx),this.current=new l,Array.isArray(e)&&4===e.length){var n=e[2]-e[0],s=e[3]-e[1];this.ctx.rect(e[0],e[1],n,s),this.clip(),this.endPath()}this.transform.apply(this,t),this.transform.apply(this,i)},endAnnotation:function(){this.restore()},paintJpegXObject:function(e,t,i){const s=this.processingType3?this.commonObjs.get(e):this.objs.get(e);if(s){this.save();var r=this.ctx;if(r.scale(1/t,-1/i),r.drawImage(s,0,0,s.width,s.height,0,-i,t,i),this.imageLayer){var a=r.mozCurrentTransformInverse,o=this.getCanvasPosition(0,0);this.imageLayer.appendImage({objId:e,left:o[0],top:o[1],width:t/a[0],height:i/a[3]})}this.restore()}else(0,n.warn)("Dependent image isn't ready yet")},paintImageMaskXObject:function(e){var t=this.ctx,n=e.width,s=e.height,r=this.current.fillColor,a=this.current.patternFill,o=this.processingType3;if(o&&void 0===o.compiled&&(o.compiled=n<=1e3&&s<=1e3?function(e){var t,i,n,s,r=e.width,a=e.height,o=r+1,l=new Uint8Array(o*(a+1)),h=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),c=r+7&-8,d=e.data,u=new Uint8Array(c*a),p=0;for(t=0,s=d.length;t<s;t++)for(var g=128,f=d[t];g>0;)u[p++]=f&g?0:255,g>>=1;var m=0;for(0!==u[p=0]&&(l[0]=1,++m),i=1;i<r;i++)u[p]!==u[p+1]&&(l[i]=u[p]?2:1,++m),p++;for(0!==u[p]&&(l[i]=2,++m),t=1;t<a;t++){n=t*o,u[(p=t*c)-c]!==u[p]&&(l[n]=u[p]?1:8,++m);var v=(u[p]?4:0)+(u[p-c]?8:0);for(i=1;i<r;i++)h[v=(v>>2)+(u[p+1]?4:0)+(u[p-c+1]?8:0)]&&(l[n+i]=h[v],++m),p++;if(u[p-c]!==u[p]&&(l[n+i]=u[p]?2:4,++m),m>1e3)return null}for(n=t*o,0!==u[p=c*(a-1)]&&(l[n]=8,++m),i=1;i<r;i++)u[p]!==u[p+1]&&(l[n+i]=u[p]?4:8,++m),p++;if(0!==u[p]&&(l[n+i]=4,++m),m>1e3)return null;var b=new Int32Array([0,o,-1,0,-o,0,0,0,1]),_=[];for(t=0;m&&t<=a;t++){for(var w=t*o,y=w+r;w<y&&!l[w];)w++;if(w!==y){var A,S=[w%o,t],P=l[w],C=w;do{var x=b[P];do{w+=x}while(!l[w]);5!==(A=l[w])&&10!==A?(P=A,l[w]=0):(P=A&51*P>>4,l[w]&=P>>2|P<<2),S.push(w%o),S.push(w/o|0),l[w]||--m}while(C!==w);_.push(S),--t}}return function(e){e.save(),e.scale(1/r,-1/a),e.translate(0,-a),e.beginPath();for(var t=0,i=_.length;t<i;t++){var n=_[t];e.moveTo(n[0],n[1]);for(var s=2,o=n.length;s<o;s+=2)e.lineTo(n[s],n[s+1])}e.fill(),e.beginPath(),e.restore()}}({data:e.data,width:n,height:s}):null),o&&o.compiled)o.compiled(t);else{var l=this.cachedCanvases.getCanvas("maskCanvas",n,s),h=l.context;h.save(),i(h,e),h.globalCompositeOperation="source-in",h.fillStyle=a?r.getPattern(h,this):r,h.fillRect(0,0,n,s),h.restore(),this.paintInlineImageXObject(l.canvas)}},paintImageMaskXObjectRepeat:function(e,t,n,s){var r=e.width,a=e.height,o=this.current.fillColor,l=this.current.patternFill,h=this.cachedCanvases.getCanvas("maskCanvas",r,a),c=h.context;c.save(),i(c,e),c.globalCompositeOperation="source-in",c.fillStyle=l?o.getPattern(c,this):o,c.fillRect(0,0,r,a),c.restore();for(var d=this.ctx,u=0,p=s.length;u<p;u+=2)d.save(),d.transform(t,0,0,n,s[u],s[u+1]),d.scale(1,-1),d.drawImage(h.canvas,0,0,r,a,0,-1,1,1),d.restore()},paintImageMaskXObjectGroup:function(e){for(var t=this.ctx,n=this.current.fillColor,s=this.current.patternFill,r=0,a=e.length;r<a;r++){var o=e[r],l=o.width,h=o.height,c=this.cachedCanvases.getCanvas("maskCanvas",l,h),d=c.context;d.save(),i(d,o),d.globalCompositeOperation="source-in",d.fillStyle=s?n.getPattern(d,this):n,d.fillRect(0,0,l,h),d.restore(),t.save(),t.transform.apply(t,o.transform),t.scale(1,-1),t.drawImage(c.canvas,0,0,l,h,0,-1,1,1),t.restore()}},paintImageXObject:function(e){const t=this.processingType3?this.commonObjs.get(e):this.objs.get(e);t?this.paintInlineImageXObject(t):(0,n.warn)("Dependent image isn't ready yet")},paintImageXObjectRepeat:function(e,t,i,s){const r=this.processingType3?this.commonObjs.get(e):this.objs.get(e);if(r){for(var a=r.width,o=r.height,l=[],h=0,c=s.length;h<c;h+=2)l.push({transform:[t,0,0,i,s[h],s[h+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(r,l)}else(0,n.warn)("Dependent image isn't ready yet")},paintInlineImageXObject:function(e){var i=e.width,n=e.height,s=this.ctx;this.save(),s.scale(1/i,-1/n);var r,a,o=s.mozCurrentTransformInverse,l=o[0],h=o[1],c=Math.max(Math.sqrt(l*l+h*h),1),d=o[2],u=o[3],p=Math.max(Math.sqrt(d*d+u*u),1);if("function"==typeof HTMLElement&&e instanceof HTMLElement||!e.data)r=e;else{var g=(a=this.cachedCanvases.getCanvas("inlineImage",i,n)).context;t(g,e),r=a.canvas}for(var f=i,m=n,v="prescale1";c>2&&f>1||p>2&&m>1;){var b=f,_=m;c>2&&f>1&&(c/=f/(b=Math.ceil(f/2))),p>2&&m>1&&(p/=m/(_=Math.ceil(m/2))),(g=(a=this.cachedCanvases.getCanvas(v,b,_)).context).clearRect(0,0,b,_),g.drawImage(r,0,0,f,m,0,0,b,_),r=a.canvas,f=b,m=_,v="prescale1"===v?"prescale2":"prescale1"}if(s.drawImage(r,0,0,f,m,0,-n,i,n),this.imageLayer){var w=this.getCanvasPosition(0,-n);this.imageLayer.appendImage({imgData:e,left:w[0],top:w[1],width:i/o[0],height:n/o[3]})}this.restore()},paintInlineImageXObjectGroup:function(e,i){var n=this.ctx,s=e.width,r=e.height,a=this.cachedCanvases.getCanvas("inlineImage",s,r);t(a.context,e);for(var o=0,l=i.length;o<l;o++){var h=i[o];if(n.save(),n.transform.apply(n,h.transform),n.scale(1,-1),n.drawImage(a.canvas,h.x,h.y,h.w,h.h,0,-1,1,1),this.imageLayer){var c=this.getCanvasPosition(h.x,h.y);this.imageLayer.appendImage({imgData:e,left:c[0],top:c[1],width:s,height:r})}n.restore()}},paintSolidColorImageMask:function(){this.ctx.fillRect(0,0,1,1)},paintXObject:function(){(0,n.warn)("Unsupported 'paintXObject' command.")},markPoint:function(e){},markPointProps:function(e,t){},beginMarkedContent:function(e){},beginMarkedContentProps:function(e,t){},endMarkedContent:function(){},beginCompat:function(){},endCompat:function(){},consumePath:function(){var e=this.ctx;this.pendingClip&&(this.pendingClip===b?e.clip("evenodd"):e.clip(),this.pendingClip=null),e.beginPath()},getSinglePixelWidth(e){if(null===this._cachedGetSinglePixelWidth){const e=this.ctx.mozCurrentTransformInverse;this._cachedGetSinglePixelWidth=Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1],e[2]*e[2]+e[3]*e[3]))}return this._cachedGetSinglePixelWidth},getCanvasPosition:function(e,t){var i=this.ctx.mozCurrentTransform;return[i[0]*e+i[2]*t+i[4],i[1]*e+i[3]*t+i[5]]}},n.OPS)e.prototype[n.OPS[_]]=e.prototype[_];return e}();t.CanvasGraphics=h},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getShadingPatternFromIR=function(e){var t=s[e[0]];if(!t)throw new Error(`Unknown IR type: ${e[0]}`);return t.fromIR(e)},t.TilingPattern=void 0;var n=i(1),s={};function r(e,t){if(!t||"undefined"==typeof Path2D)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)}s.RadialAxial={fromIR:function(e){var t=e[1],i=e[2],n=e[3],s=e[4],a=e[5],o=e[6],l=e[7];return{type:"Pattern",getPattern:function(e){var h;r(e,i),"axial"===t?h=e.createLinearGradient(s[0],s[1],a[0],a[1]):"radial"===t&&(h=e.createRadialGradient(s[0],s[1],o,a[0],a[1],l));for(var c=0,d=n.length;c<d;++c){var u=n[c];h.addColorStop(u[0],u[1])}return h}}}};var a=function(){function e(e,t,i,n,s,r,a,o){var l,h=t.coords,c=t.colors,d=e.data,u=4*e.width;h[i+1]>h[n+1]&&(l=i,i=n,n=l,l=r,r=a,a=l),h[n+1]>h[s+1]&&(l=n,n=s,s=l,l=a,a=o,o=l),h[i+1]>h[n+1]&&(l=i,i=n,n=l,l=r,r=a,a=l);var p=(h[i]+t.offsetX)*t.scaleX,g=(h[i+1]+t.offsetY)*t.scaleY,f=(h[n]+t.offsetX)*t.scaleX,m=(h[n+1]+t.offsetY)*t.scaleY,v=(h[s]+t.offsetX)*t.scaleX,b=(h[s+1]+t.offsetY)*t.scaleY;if(!(g>=b))for(var _,w,y,A,S,P,C,x,E=c[r],T=c[r+1],L=c[r+2],k=c[a],R=c[a+1],I=c[a+2],N=c[o],M=c[o+1],F=c[o+2],D=Math.round(g),O=Math.round(b),B=D;B<=O;B++){if(B<m){let e;e=B<g?0:g===m?1:(g-B)/(g-m),_=p-(p-f)*e,w=E-(E-k)*e,y=T-(T-R)*e,A=L-(L-I)*e}else{let e;e=B>b?1:m===b?0:(m-B)/(m-b),_=f-(f-v)*e,w=k-(k-N)*e,y=R-(R-M)*e,A=I-(I-F)*e}let e;e=B<g?0:B>b?1:(g-B)/(g-b),S=p-(p-v)*e,P=E-(E-N)*e,C=T-(T-M)*e,x=L-(L-F)*e;for(var V=Math.round(Math.min(_,S)),U=Math.round(Math.max(_,S)),j=u*B+4*V,W=V;W<=U;W++){let e=(_-W)/(_-S);e<0?e=0:e>1&&(e=1),d[j++]=w-(w-P)*e|0,d[j++]=y-(y-C)*e|0,d[j++]=A-(A-x)*e|0,d[j++]=255}}}function t(t,i,n){var s,r,a=i.coords,o=i.colors;switch(i.type){case"lattice":var l=i.verticesPerRow,h=Math.floor(a.length/l)-1,c=l-1;for(s=0;s<h;s++)for(var d=s*l,u=0;u<c;u++,d++)e(t,n,a[d],a[d+1],a[d+l],o[d],o[d+1],o[d+l]),e(t,n,a[d+l+1],a[d+1],a[d+l],o[d+l+1],o[d+1],o[d+l]);break;case"triangles":for(s=0,r=a.length;s<r;s+=3)e(t,n,a[s],a[s+1],a[s+2],o[s],o[s+1],o[s+2]);break;default:throw new Error("illegal figure")}}return function(e,i,n,s,r,a,o,l){var h,c,d,u,p=Math.floor(e[0]),g=Math.floor(e[1]),f=Math.ceil(e[2])-p,m=Math.ceil(e[3])-g,v=Math.min(Math.ceil(Math.abs(f*i[0]*1.1)),3e3),b=Math.min(Math.ceil(Math.abs(m*i[1]*1.1)),3e3),_=f/v,w=m/b,y={coords:n,colors:s,offsetX:-p,offsetY:-g,scaleX:1/_,scaleY:1/w},A=v+4,S=b+4;if(l.isEnabled)h=l.drawFigures({width:v,height:b,backgroundColor:a,figures:r,context:y}),(c=o.getCanvas("mesh",A,S,!1)).context.drawImage(h,2,2),h=c.canvas;else{var P=(c=o.getCanvas("mesh",A,S,!1)).context,C=P.createImageData(v,b);if(a){var x=C.data;for(d=0,u=x.length;d<u;d+=4)x[d]=a[0],x[d+1]=a[1],x[d+2]=a[2],x[d+3]=255}for(d=0;d<r.length;d++)t(C,r[d],y);P.putImageData(C,2,2),h=c.canvas}return{canvas:h,offsetX:p-2*_,offsetY:g-2*w,scaleX:_,scaleY:w}}}();s.Mesh={fromIR:function(e){var t=e[2],i=e[3],s=e[4],o=e[5],l=e[6],h=e[7],c=e[8];return{type:"Pattern",getPattern:function(e,d,u){var p;if(r(e,h),u)p=n.Util.singularValueDecompose2dScale(e.mozCurrentTransform);else if(p=n.Util.singularValueDecompose2dScale(d.baseTransform),l){var g=n.Util.singularValueDecompose2dScale(l);p=[p[0]*g[0],p[1]*g[1]]}var f=a(o,p,t,i,s,u?null:c,d.cachedCanvases,d.webGLContext);return u||(e.setTransform.apply(e,d.baseTransform),l&&e.transform.apply(e,l)),e.translate(f.offsetX,f.offsetY),e.scale(f.scaleX,f.scaleY),e.createPattern(f.canvas,"no-repeat")}}}},s.Dummy={fromIR:function(){return{type:"Pattern",getPattern:function(){return"hotpink"}}}};var o=function(){var e=1,t=2;function i(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.canvasGraphicsFactory=n,this.baseTransform=s,this.type="Pattern",this.ctx=i}return i.prototype={createPatternCanvas:function(e){var t=this.operatorList,i=this.bbox,s=this.xstep,r=this.ystep,a=this.paintType,o=this.tilingType,l=this.color,h=this.canvasGraphicsFactory;(0,n.info)("TilingType: "+o);var c=i[0],d=i[1],u=i[2],p=i[3],g=n.Util.singularValueDecompose2dScale(this.matrix),f=n.Util.singularValueDecompose2dScale(this.baseTransform),m=[g[0]*f[0],g[1]*f[1]],v=this.getSizeAndScale(s,this.ctx.canvas.width,m[0]),b=this.getSizeAndScale(r,this.ctx.canvas.height,m[1]),_=e.cachedCanvases.getCanvas("pattern",v.size,b.size,!0),w=_.context,y=h.createCanvasGraphics(w);return y.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(y,a,l),y.transform(v.scale,0,0,b.scale,0,0),y.transform(1,0,0,1,-c,-d),this.clipBbox(y,i,c,d,u,p),y.executeOperatorList(t),this.ctx.transform(1,0,0,1,c,d),this.ctx.scale(1/v.scale,1/b.scale),_.canvas},getSizeAndScale:function(e,t,i){e=Math.abs(e);var n=Math.max(3e3,t),s=Math.ceil(e*i);return s>=n?s=n:i=s/e,{scale:i,size:s}},clipBbox:function(e,t,i,n,s,r){if(Array.isArray(t)&&4===t.length){var a=s-i,o=r-n;e.ctx.rect(i,n,a,o),e.clip(),e.endPath()}},setFillAndStrokeStyleToContext:function(i,s,r){const a=i.ctx,o=i.current;switch(s){case e:var l=this.ctx;a.fillStyle=l.fillStyle,a.strokeStyle=l.strokeStyle,o.fillColor=l.fillStyle,o.strokeColor=l.strokeStyle;break;case t:var h=n.Util.makeCssRgb(r[0],r[1],r[2]);a.fillStyle=h,a.strokeStyle=h,o.fillColor=h,o.strokeColor=h;break;default:throw new n.FormatError(`Unsupported paint type: ${s}`)}},getPattern:function(e,t){(e=this.ctx).setTransform.apply(e,this.baseTransform),e.transform.apply(e,this.matrix);var i=this.createPatternCanvas(t);return e.createPattern(i,"repeat")}},i}();t.TilingPattern=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;const n=Object.create(null);t.GlobalWorkerOptions=n,n.workerPort=void 0===n.workerPort?null:n.workerPort,n.workerSrc=void 0===n.workerSrc?"":n.workerSrc},function(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,h=4,c=5,d=6,u=7,p=8;function g(e){if("object"!=typeof e||null===e)return e;switch(e.name){case"AbortException":return new n.AbortException(e.message);case"MissingPDFException":return new n.MissingPDFException(e.message);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{constructor(e,t,i){this.sourceName=e,this.targetName=t,this.comObj=i,this.callbackId=1,this.streamId=1,this.postMessageTransfers=!0,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)return void this._processStreamMessage(t);if(t.callback){const e=t.callbackId,i=this.callbackCapabilities[e];if(!i)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],t.callback===s)i.resolve(t.data);else{if(t.callback!==r)throw new Error("Unexpected callback case");i.reject(g(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:g(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._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._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,h=this.comObj;return new ReadableStream({start:i=>{const a=(0,n.createPromiseCapability)();return this.streamControllers[r]={controller:i,startCall:a,pullCall:null,cancelCall:null,isClosed:!1},this._postMessage({sourceName:o,targetName:l,action:e,streamId:r,data:t,desiredSize:i.desiredSize},s),a.promise},pull:e=>{const t=(0,n.createPromiseCapability)();return this.streamControllers[r].pullCall=t,h.postMessage({sourceName:o,targetName:l,stream:d,streamId:r,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,n.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,n.createPromiseCapability)();return this.streamControllers[r].cancelCall=t,this.streamControllers[r].isClosed=!0,h.postMessage({sourceName:o,targetName:l,stream:a,streamId:r,reason:g(e)}),t.promise}},i)}_createStreamSink(e){const t=this,i=this.actionHandler[e.action],s=e.streamId,r=this.sourceName,a=e.sourceName,o=this.comObj,d={enqueue(e,i=1,o){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=i,l>0&&this.desiredSize<=0&&(this.sinkCapability=(0,n.createPromiseCapability)(),this.ready=this.sinkCapability.promise),t._postMessage({sourceName:r,targetName:a,stream:h,streamId:s,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:r,targetName:a,stream:l,streamId:s}),delete t.streamSinks[s])},error(e){(0,n.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:r,targetName:a,stream:c,streamId:s,reason:g(e)}))},sinkCapability:(0,n.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};d.sinkCapability.resolve(),d.ready=d.sinkCapability.promise,this.streamSinks[s]=d,new Promise((function(t){t(i(e.data,d))})).then((function(){o.postMessage({sourceName:r,targetName:a,stream:p,streamId:s,success:!0})}),(function(e){o.postMessage({sourceName:r,targetName:a,stream:p,streamId:s,reason:g(e)})}))}_processStreamMessage(e){const t=e.streamId,i=this.sourceName,s=e.sourceName,r=this.comObj;switch(e.stream){case p:e.success?this.streamControllers[t].startCall.resolve():this.streamControllers[t].startCall.reject(g(e.reason));break;case u:e.success?this.streamControllers[t].pullCall.resolve():this.streamControllers[t].pullCall.reject(g(e.reason));break;case d:if(!this.streamSinks[t]){r.postMessage({sourceName:i,targetName:s,stream:u,streamId:t,success:!0});break}this.streamSinks[t].desiredSize<=0&&e.desiredSize>0&&this.streamSinks[t].sinkCapability.resolve(),this.streamSinks[t].desiredSize=e.desiredSize;const{onPull:f}=this.streamSinks[e.streamId];new Promise((function(e){e(f&&f())})).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:g(e)})}));break;case h:if((0,n.assert)(this.streamControllers[t],"enqueue should have stream controller"),this.streamControllers[t].isClosed)break;this.streamControllers[t].controller.enqueue(e.chunk);break;case l:if((0,n.assert)(this.streamControllers[t],"close should have stream controller"),this.streamControllers[t].isClosed)break;this.streamControllers[t].isClosed=!0,this.streamControllers[t].controller.close(),this._deleteStreamController(t);break;case c:(0,n.assert)(this.streamControllers[t],"error should have stream controller"),this.streamControllers[t].controller.error(g(e.reason)),this._deleteStreamController(t);break;case o:e.success?this.streamControllers[t].cancelCall.resolve():this.streamControllers[t].cancelCall.reject(g(e.reason)),this._deleteStreamController(t);break;case a:if(!this.streamSinks[t])break;const{onCancel:m}=this.streamSinks[e.streamId];new Promise((function(t){t(m&&m(g(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:g(e)})})),this.streamSinks[t].sinkCapability.reject(g(e.reason)),this.streamSinks[t].isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(e){await Promise.allSettled([this.streamControllers[e].startCall,this.streamControllers[e].pullCall,this.streamControllers[e].cancelCall].map((function(e){return e&&e.promise}))),delete this.streamControllers[e]}_postMessage(e,t){t&&this.postMessageTransfers?this.comObj.postMessage(e,t):this.comObj.postMessage(e)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var n=i(1),s=i(13);t.Metadata=class{constructor(e){(0,n.assert)("string"==typeof e,"Metadata: input is not a string"),e=this._repair(e);const t=(new s.SimpleXMLParser).parseFromString(e);this._metadataMap=new Map,t&&this._parse(t)}_repair(e){return e.replace(/^[^<]+/,"").replace(/>\\376\\377([^<]+)/g,(function(e,t){const i=t.replace(/\\([0-3])([0-7])([0-7])/g,(function(e,t,i,n){return String.fromCharCode(64*t+8*i+1*n)})).replace(/&(amp|apos|gt|lt|quot);/g,(function(e,t){switch(t){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error(`_repair: ${t} isn't defined.`)}));let n="";for(let e=0,t=i.length;e<t;e+=2){const t=256*i.charCodeAt(e)+i.charCodeAt(e+1);n+=t>=32&&t<127&&60!==t&&62!==t&&38!==t?String.fromCharCode(t):"&#x"+(65536+t).toString(16).substring(1)+";"}return">"+n}))}_parse(e){let t=e.documentElement;if("rdf:rdf"!==t.nodeName.toLowerCase())for(t=t.firstChild;t&&"rdf:rdf"!==t.nodeName.toLowerCase();)t=t.nextSibling;const i=t?t.nodeName.toLowerCase():null;if(!t||"rdf:rdf"!==i||!t.hasChildNodes())return;const n=t.childNodes;for(let e=0,t=n.length;e<t;e++){const t=n[e];if("rdf:description"===t.nodeName.toLowerCase())for(let e=0,i=t.childNodes.length;e<i;e++)if("#text"!==t.childNodes[e].nodeName.toLowerCase()){const i=t.childNodes[e],n=i.nodeName.toLowerCase();this._metadataMap.set(n,i.textContent.trim())}}}get(e){return this._metadataMap.has(e)?this._metadataMap.get(e):null}getAll(){const e=Object.create(null);for(const[t,i]of this._metadataMap)e[t]=i;return e}has(e){return this._metadataMap.has(e)}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleXMLParser=void 0;const n=0,s=-2,r=-3,a=-4,o=-5,l=-6,h=-9;function c(e,t){const i=e[t];return" "===i||"\n"===i||"\r"===i||"\t"===i}class d{constructor(e,t){this.nodeName=e,this.nodeValue=t,Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){return this.childNodes&&this.childNodes[0]}get nextSibling(){const e=this.parentNode.childNodes;if(!e)return;const t=e.indexOf(this);return-1!==t?e[t+1]:void 0}get textContent(){return this.childNodes?this.childNodes.map((function(e){return e.textContent})).join(""):this.nodeValue||""}hasChildNodes(){return this.childNodes&&this.childNodes.length>0}}t.SimpleXMLParser=class extends class{_resolveEntities(e){return e.replace(/&([^;]+);/g,(e,t)=>{if("#x"===t.substring(0,2))return String.fromCharCode(parseInt(t.substring(2),16));if("#"===t.substring(0,1))return String.fromCharCode(parseInt(t.substring(1),10));switch(t){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"'}return this.onResolveEntity(t)})}_parseContent(e,t){const i=[];let n=t;function s(){for(;n<e.length&&c(e,n);)++n}for(;n<e.length&&!c(e,n)&&">"!==e[n]&&"/"!==e[n];)++n;const r=e.substring(t,n);for(s();n<e.length&&">"!==e[n]&&"/"!==e[n]&&"?"!==e[n];){s();let t="",r="";for(;n<e.length&&!c(e,n)&&"="!==e[n];)t+=e[n],++n;if(s(),"="!==e[n])return null;++n,s();const a=e[n];if('"'!==a&&"'"!==a)return null;const o=e.indexOf(a,++n);if(o<0)return null;r=e.substring(n,o),i.push({name:t,value:this._resolveEntities(r)}),n=o+1,s()}return{name:r,attributes:i,parsed:n-t}}_parseProcessingInstruction(e,t){let i=t;for(;i<e.length&&!c(e,i)&&">"!==e[i]&&"/"!==e[i];)++i;const n=e.substring(t,i);!function(){for(;i<e.length&&c(e,i);)++i}();const s=i;for(;i<e.length&&("?"!==e[i]||">"!==e[i+1]);)++i;return{name:n,value:e.substring(s,i),parsed:i-t}}parseXml(e){let t=0;for(;t<e.length;){let i=t;if("<"===e[t]){let t;switch(++i,e[i]){case"/":if(++i,t=e.indexOf(">",i),t<0)return void this.onError(h);this.onEndElement(e.substring(i,t)),i=t+1;break;case"?":++i;const n=this._parseProcessingInstruction(e,i);if("?>"!==e.substring(i+n.parsed,i+n.parsed+2))return void this.onError(r);this.onPi(n.name,n.value),i+=n.parsed+2;break;case"!":if("--"===e.substring(i+1,i+3)){if(t=e.indexOf("--\x3e",i+3),t<0)return void this.onError(o);this.onComment(e.substring(i+3,t)),i=t+3}else if("[CDATA["===e.substring(i+1,i+8)){if(t=e.indexOf("]]>",i+8),t<0)return void this.onError(s);this.onCdata(e.substring(i+8,t)),i=t+3}else{if("DOCTYPE"!==e.substring(i+1,i+8))return void this.onError(l);{const n=e.indexOf("[",i+8);let s=!1;if(t=e.indexOf(">",i+8),t<0)return void this.onError(a);if(n>0&&t>n){if(t=e.indexOf("]>",i+8),t<0)return void this.onError(a);s=!0}const r=e.substring(i+8,t+(s?1:0));this.onDoctype(r),i=t+(s?2:1)}}break;default:const c=this._parseContent(e,i);if(null===c)return void this.onError(l);let d=!1;if("/>"===e.substring(i+c.parsed,i+c.parsed+2))d=!0;else if(">"!==e.substring(i+c.parsed,i+c.parsed+1))return void this.onError(h);this.onBeginElement(c.name,c.attributes,d),i+=c.parsed+(d?2:1)}}else{for(;i<e.length&&"<"!==e[i];)i++;const n=e.substring(t,i);this.onText(this._resolveEntities(n))}t=i}}onResolveEntity(e){return`&${e};`}onPi(e,t){}onComment(e){}onCdata(e){}onDoctype(e){}onText(e){}onBeginElement(e,t,i){}onEndElement(e){}onError(e){}}{constructor(){super(),this._currentFragment=null,this._stack=null,this._errorCode=n}parseFromString(e){if(this._currentFragment=[],this._stack=[],this._errorCode=n,this.parseXml(e),this._errorCode!==n)return;const[t]=this._currentFragment;return t?{documentElement:t}:void 0}onResolveEntity(e){switch(e){case"apos":return"'"}return super.onResolveEntity(e)}onText(e){if(function(e){for(let t=0,i=e.length;t<i;t++)if(!c(e,t))return!1;return!0}(e))return;const t=new d("#text",e);this._currentFragment.push(t)}onCdata(e){const t=new d("#text",e);this._currentFragment.push(t)}onBeginElement(e,t,i){const n=new d(e);n.childNodes=[],this._currentFragment.push(n),i||(this._stack.push(this._currentFragment),this._currentFragment=n.childNodes)}onEndElement(e){this._currentFragment=this._stack.pop()||[];const t=this._currentFragment[this._currentFragment.length-1];if(t)for(let e=0,i=t.childNodes.length;e<i;e++)t.childNodes[e].parentNode=t}onError(e){this._errorCode=e}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDataTransportStream=void 0;var n=i(1);t.PDFDataTransportStream=class{constructor(e,t){(0,n.assert)(t),this._queuedChunks=[],this._progressiveDone=e.progressiveDone||!1;const i=e.initialData;if(i&&i.length>0){const e=new Uint8Array(i).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._contentLength=e.length,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){const t=new Uint8Array(e.chunk).buffer;if(void 0===e.begin)this._fullRequestReader?this._fullRequestReader._enqueue(t):this._queuedChunks.push(t);else{const i=this._rangeReaders.some((function(i){return i._begin===e.begin&&(i._enqueue(t),!0)}));(0,n.assert)(i)}}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}_onProgress(e){if(void 0===e.total){const t=this._rangeReaders[0];t&&t.onProgress&&t.onProgress({loaded:e.loaded})}else{const t=this._fullRequestReader;t&&t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.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);const e=this._queuedChunks;return this._queuedChunks=null,new s(this,e,this._progressiveDone)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const i=new r(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeReaders.slice(0).forEach((function(t){t.cancel(e)})),this._pdfDataRangeTransport.abort()}};class s{constructor(e,t,i=!1){this._stream=e,this._done=i||!1,this._filename=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)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[]}progressiveDone(){this._done||(this._done=!0)}}class r{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}),this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[]}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,n.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[],this._stream._removeRangeReader(this)}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLContext=void 0;var n=i(1);t.WebGLContext=class{constructor({enable:e=!1}){this._enabled=!0===e}get isEnabled(){let e=this._enabled;return e&&(e=s.tryInitGL()),(0,n.shadow)(this,"isEnabled",e)}composeSMask({layer:e,mask:t,properties:i}){return s.composeSMask(e,t,i)}drawFigures({width:e,height:t,backgroundColor:i,figures:n,context:r}){return s.drawFigures(e,t,i,n,r)}clear(){s.cleanup()}};var s=function(){function e(e,t,i){var n=e.createShader(i);if(e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS)){var s=e.getShaderInfoLog(n);throw new Error("Error during shader compilation: "+s)}return n}function t(t,i){return e(t,i,t.VERTEX_SHADER)}function i(t,i){return e(t,i,t.FRAGMENT_SHADER)}function n(e,t){for(var i=e.createProgram(),n=0,s=t.length;n<s;++n)e.attachShader(i,t[n]);if(e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS)){var r=e.getProgramInfoLog(i);throw new Error("Error during program linking: "+r)}return i}function s(e,t,i){e.activeTexture(i);var n=e.createTexture();return e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),n}var r,a;function o(){r||(a=document.createElement("canvas"),r=a.getContext("webgl",{premultipliedalpha:!1}))}var l=null;var h=null;return{tryInitGL(){try{return o(),!!r}catch(e){}return!1},composeSMask:function(e,h,c){var d=e.width,u=e.height;l||function(){var e,s;o(),e=a,a=null,s=r,r=null;var h=n(s,[t(s,"  attribute vec2 a_position;                                      attribute vec2 a_texCoord;                                                                                                      uniform vec2 u_resolution;                                                                                                      varying vec2 v_texCoord;                                                                                                        void main() {                                                     vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0;       gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);                                                                              v_texCoord = a_texCoord;                                      }                                                             "),i(s,"  precision mediump float;                                                                                                        uniform vec4 u_backdrop;                                        uniform int u_subtype;                                          uniform sampler2D u_image;                                      uniform sampler2D u_mask;                                                                                                       varying vec2 v_texCoord;                                                                                                        void main() {                                                     vec4 imageColor = texture2D(u_image, v_texCoord);               vec4 maskColor = texture2D(u_mask, v_texCoord);                 if (u_backdrop.a > 0.0) {                                         maskColor.rgb = maskColor.rgb * maskColor.a +                                   u_backdrop.rgb * (1.0 - maskColor.a);         }                                                               float lum;                                                      if (u_subtype == 0) {                                             lum = maskColor.a;                                            } else {                                                          lum = maskColor.r * 0.3 + maskColor.g * 0.59 +                        maskColor.b * 0.11;                                     }                                                               imageColor.a *= lum;                                            imageColor.rgb *= imageColor.a;                                 gl_FragColor = imageColor;                                    }                                                             ")]);s.useProgram(h);var c={};c.gl=s,c.canvas=e,c.resolutionLocation=s.getUniformLocation(h,"u_resolution"),c.positionLocation=s.getAttribLocation(h,"a_position"),c.backdropLocation=s.getUniformLocation(h,"u_backdrop"),c.subtypeLocation=s.getUniformLocation(h,"u_subtype");var d=s.getAttribLocation(h,"a_texCoord"),u=s.getUniformLocation(h,"u_image"),p=s.getUniformLocation(h,"u_mask"),g=s.createBuffer();s.bindBuffer(s.ARRAY_BUFFER,g),s.bufferData(s.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),s.STATIC_DRAW),s.enableVertexAttribArray(d),s.vertexAttribPointer(d,2,s.FLOAT,!1,0,0),s.uniform1i(u,0),s.uniform1i(p,1),l=c}();var p=l,g=p.canvas,f=p.gl;g.width=d,g.height=u,f.viewport(0,0,f.drawingBufferWidth,f.drawingBufferHeight),f.uniform2f(p.resolutionLocation,d,u),c.backdrop?f.uniform4f(p.resolutionLocation,c.backdrop[0],c.backdrop[1],c.backdrop[2],1):f.uniform4f(p.resolutionLocation,0,0,0,0),f.uniform1i(p.subtypeLocation,"Luminosity"===c.subtype?1:0);var m=s(f,e,f.TEXTURE0),v=s(f,h,f.TEXTURE1),b=f.createBuffer();return f.bindBuffer(f.ARRAY_BUFFER,b),f.bufferData(f.ARRAY_BUFFER,new Float32Array([0,0,d,0,0,u,0,u,d,0,d,u]),f.STATIC_DRAW),f.enableVertexAttribArray(p.positionLocation),f.vertexAttribPointer(p.positionLocation,2,f.FLOAT,!1,0,0),f.clearColor(0,0,0,0),f.enable(f.BLEND),f.blendFunc(f.ONE,f.ONE_MINUS_SRC_ALPHA),f.clear(f.COLOR_BUFFER_BIT),f.drawArrays(f.TRIANGLES,0,6),f.flush(),f.deleteTexture(m),f.deleteTexture(v),f.deleteBuffer(b),g},drawFigures:function(e,s,l,c,d){h||function(){var e,s;o(),e=a,a=null,s=r,r=null;var l=n(s,[t(s,"  attribute vec2 a_position;                                      attribute vec3 a_color;                                                                                                         uniform vec2 u_resolution;                                      uniform vec2 u_scale;                                           uniform vec2 u_offset;                                                                                                          varying vec4 v_color;                                                                                                           void main() {                                                     vec2 position = (a_position + u_offset) * u_scale;              vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0;         gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);                                                                              v_color = vec4(a_color / 255.0, 1.0);                         }                                                             "),i(s,"  precision mediump float;                                                                                                        varying vec4 v_color;                                                                                                           void main() {                                                     gl_FragColor = v_color;                                       }                                                             ")]);s.useProgram(l);var c={};c.gl=s,c.canvas=e,c.resolutionLocation=s.getUniformLocation(l,"u_resolution"),c.scaleLocation=s.getUniformLocation(l,"u_scale"),c.offsetLocation=s.getUniformLocation(l,"u_offset"),c.positionLocation=s.getAttribLocation(l,"a_position"),c.colorLocation=s.getAttribLocation(l,"a_color"),h=c}();var u=h,p=u.canvas,g=u.gl;p.width=e,p.height=s,g.viewport(0,0,g.drawingBufferWidth,g.drawingBufferHeight),g.uniform2f(u.resolutionLocation,e,s);var f,m,v,b=0;for(f=0,m=c.length;f<m;f++)switch(c[f].type){case"lattice":b+=((v=c[f].coords.length/c[f].verticesPerRow|0)-1)*(c[f].verticesPerRow-1)*6;break;case"triangles":b+=c[f].coords.length}var _=new Float32Array(2*b),w=new Uint8Array(3*b),y=d.coords,A=d.colors,S=0,P=0;for(f=0,m=c.length;f<m;f++){var C=c[f],x=C.coords,E=C.colors;switch(C.type){case"lattice":var T=C.verticesPerRow;v=x.length/T|0;for(var L=1;L<v;L++)for(var k=L*T+1,R=1;R<T;R++,k++)_[S]=y[x[k-T-1]],_[S+1]=y[x[k-T-1]+1],_[S+2]=y[x[k-T]],_[S+3]=y[x[k-T]+1],_[S+4]=y[x[k-1]],_[S+5]=y[x[k-1]+1],w[P]=A[E[k-T-1]],w[P+1]=A[E[k-T-1]+1],w[P+2]=A[E[k-T-1]+2],w[P+3]=A[E[k-T]],w[P+4]=A[E[k-T]+1],w[P+5]=A[E[k-T]+2],w[P+6]=A[E[k-1]],w[P+7]=A[E[k-1]+1],w[P+8]=A[E[k-1]+2],_[S+6]=_[S+2],_[S+7]=_[S+3],_[S+8]=_[S+4],_[S+9]=_[S+5],_[S+10]=y[x[k]],_[S+11]=y[x[k]+1],w[P+9]=w[P+3],w[P+10]=w[P+4],w[P+11]=w[P+5],w[P+12]=w[P+6],w[P+13]=w[P+7],w[P+14]=w[P+8],w[P+15]=A[E[k]],w[P+16]=A[E[k]+1],w[P+17]=A[E[k]+2],S+=12,P+=18;break;case"triangles":for(var I=0,N=x.length;I<N;I++)_[S]=y[x[I]],_[S+1]=y[x[I]+1],w[P]=A[E[I]],w[P+1]=A[E[I]+1],w[P+2]=A[E[I]+2],S+=2,P+=3}}l?g.clearColor(l[0]/255,l[1]/255,l[2]/255,1):g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT);var M=g.createBuffer();g.bindBuffer(g.ARRAY_BUFFER,M),g.bufferData(g.ARRAY_BUFFER,_,g.STATIC_DRAW),g.enableVertexAttribArray(u.positionLocation),g.vertexAttribPointer(u.positionLocation,2,g.FLOAT,!1,0,0);var F=g.createBuffer();return g.bindBuffer(g.ARRAY_BUFFER,F),g.bufferData(g.ARRAY_BUFFER,w,g.STATIC_DRAW),g.enableVertexAttribArray(u.colorLocation),g.vertexAttribPointer(u.colorLocation,3,g.UNSIGNED_BYTE,!1,0,0),g.uniform2f(u.scaleLocation,d.scaleX,d.scaleY),g.uniform2f(u.offsetLocation,d.offsetX,d.offsetY),g.drawArrays(g.TRIANGLES,0,b),g.flush(),g.deleteBuffer(M),g.deleteBuffer(F),p},cleanup(){l&&l.canvas&&(l.canvas.width=0,l.canvas.height=0),h&&h.canvas&&(h.canvas.width=0,h.canvas.height=0),l=null,h=null}}}()},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderTextLayer=void 0;var n=i(1),s=function(){var e=/\S/;function t(t,i,s){var r,a=document.createElement("span"),o={angle:0,canvasWidth:0,isWhitespace:!1,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1};if(t._textDivs.push(a),r=i.str,!e.test(r))return o.isWhitespace=!0,void t._textDivProperties.set(a,o);var l=n.Util.transform(t._viewport.transform,i.transform),h=Math.atan2(l[1],l[0]),c=s[i.fontName];c.vertical&&(h+=Math.PI/2);var d=Math.sqrt(l[2]*l[2]+l[3]*l[3]),u=d;let p,g;if(c.ascent?u=c.ascent*u:c.descent&&(u=(1+c.descent)*u),0===h?(p=l[4],g=l[5]-u):(p=l[4]+u*Math.sin(h),g=l[5]-u*Math.cos(h)),a.style.left=`${p}px`,a.style.top=`${g}px`,a.style.fontSize=`${d}px`,a.style.fontFamily=c.fontFamily,a.textContent=i.str,t._fontInspectorEnabled&&(a.dataset.fontName=i.fontName),0!==h&&(o.angle=h*(180/Math.PI)),i.str.length>1&&(c.vertical?o.canvasWidth=i.height*t._viewport.scale:o.canvasWidth=i.width*t._viewport.scale),t._textDivProperties.set(a,o),t._textContentStream&&t._layoutText(a),t._enhanceTextSelection){var f=1,m=0;0!==h&&(f=Math.cos(h),m=Math.sin(h));var v,b,_=(c.vertical?i.height:i.width)*t._viewport.scale,w=d;0!==h?(v=[f,m,-m,f,p,g],b=n.Util.getAxialAlignedBoundingBox([0,0,_,w],v)):b=[p,g,p+_,g+w],t._bounds.push({left:b[0],top:b[1],right:b[2],bottom:b[3],div:a,size:[_,w],m:v})}}function i(e){if(!e._canceled){var t=e._textDivs,i=e._capability,n=t.length;if(n>1e5)return e._renderingDone=!0,void i.resolve();if(!e._textContentStream)for(var s=0;s<n;s++)e._layoutText(t[s]);e._renderingDone=!0,i.resolve()}}function s(e){for(var t=e._bounds,i=e._viewport,s=function(e,t,i){var n=i.map((function(e,t){return{x1:e.left,y1:e.top,x2:e.right,y2:e.bottom,index:t,x1New:void 0,x2New:void 0}}));r(e,n);var s=new Array(i.length);return n.forEach((function(e){var t=e.index;s[t]={left:e.x1New,top:0,right:e.x2New,bottom:0}})),i.map((function(t,i){var r=s[i],a=n[i];a.x1=t.top,a.y1=e-r.right,a.x2=t.bottom,a.y2=e-r.left,a.index=i,a.x1New=void 0,a.x2New=void 0})),r(t,n),n.forEach((function(e){var t=e.index;s[t].top=e.x1New,s[t].bottom=e.x2New})),s}(i.width,i.height,t),a=0;a<s.length;a++){var o=t[a].div,l=e._textDivProperties.get(o);if(0!==l.angle){var h=s[a],c=t[a],d=c.m,u=d[0],p=d[1],g=[[0,0],[0,c.size[1]],[c.size[0],0],c.size],f=new Float64Array(64);g.forEach((function(e,t){var i=n.Util.applyTransform(e,d);f[t+0]=u&&(h.left-i[0])/u,f[t+4]=p&&(h.top-i[1])/p,f[t+8]=u&&(h.right-i[0])/u,f[t+12]=p&&(h.bottom-i[1])/p,f[t+16]=p&&(h.left-i[0])/-p,f[t+20]=u&&(h.top-i[1])/u,f[t+24]=p&&(h.right-i[0])/-p,f[t+28]=u&&(h.bottom-i[1])/u,f[t+32]=u&&(h.left-i[0])/-u,f[t+36]=p&&(h.top-i[1])/-p,f[t+40]=u&&(h.right-i[0])/-u,f[t+44]=p&&(h.bottom-i[1])/-p,f[t+48]=p&&(h.left-i[0])/p,f[t+52]=u&&(h.top-i[1])/-u,f[t+56]=p&&(h.right-i[0])/p,f[t+60]=u&&(h.bottom-i[1])/-u}));var m=function(e,t,i){for(var n=0,s=0;s<i;s++){var r=e[t++];r>0&&(n=n?Math.min(r,n):r)}return n},v=1+Math.min(Math.abs(u),Math.abs(p));l.paddingLeft=m(f,32,16)/v,l.paddingTop=m(f,48,16)/v,l.paddingRight=m(f,0,16)/v,l.paddingBottom=m(f,16,16)/v,e._textDivProperties.set(o,l)}else l.paddingLeft=t[a].left-s[a].left,l.paddingTop=t[a].top-s[a].top,l.paddingRight=s[a].right-t[a].right,l.paddingBottom=s[a].bottom-t[a].bottom,e._textDivProperties.set(o,l)}}function r(e,t){t.sort((function(e,t){return e.x1-t.x1||e.index-t.index}));var i=[{start:-1/0,end:1/0,boundary:{x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0}}];t.forEach((function(e){for(var t=0;t<i.length&&i[t].end<=e.y1;)t++;for(var n,s,r=i.length-1;r>=0&&i[r].start>=e.y2;)r--;var a,o,l=-1/0;for(a=t;a<=r;a++){var h;(h=(s=(n=i[a]).boundary).x2>e.x1?s.index>e.index?s.x1New:e.x1:void 0===s.x2New?(s.x2+e.x1)/2:s.x2New)>l&&(l=h)}for(e.x1New=l,a=t;a<=r;a++)void 0===(s=(n=i[a]).boundary).x2New?s.x2>e.x1?s.index>e.index&&(s.x2New=s.x2):s.x2New=l:s.x2New>l&&(s.x2New=Math.max(l,s.x2));var c=[],d=null;for(a=t;a<=r;a++){var u=(s=(n=i[a]).boundary).x2>e.x2?s:e;d===u?c[c.length-1].end=n.end:(c.push({start:n.start,end:n.end,boundary:u}),d=u)}for(i[t].start<e.y1&&(c[0].start=e.y1,c.unshift({start:i[t].start,end:e.y1,boundary:i[t].boundary})),e.y2<i[r].end&&(c[c.length-1].end=e.y2,c.push({start:e.y2,end:i[r].end,boundary:i[r].boundary})),a=t;a<=r;a++)if(void 0===(s=(n=i[a]).boundary).x2New){var p=!1;for(o=t-1;!p&&o>=0&&i[o].start>=s.y1;o--)p=i[o].boundary===s;for(o=r+1;!p&&o<i.length&&i[o].end<=s.y2;o++)p=i[o].boundary===s;for(o=0;!p&&o<c.length;o++)p=c[o].boundary===s;p||(s.x2New=l)}Array.prototype.splice.apply(i,[t,r-t+1].concat(c))})),i.forEach((function(t){var i=t.boundary;void 0===i.x2New&&(i.x2New=Math.max(e,i.x2))}))}function a({textContent:e,textContentStream:t,container:i,viewport:s,textDivs:r,textContentItemsStr:a,enhanceTextSelection:o}){this._textContent=e,this._textContentStream=t,this._container=i,this._viewport=s,this._textDivs=r||[],this._textContentItemsStr=a||[],this._enhanceTextSelection=!!o,this._fontInspectorEnabled=!(!globalThis.FontInspector||!globalThis.FontInspector.enabled),this._reader=null,this._layoutTextLastFontSize=null,this._layoutTextLastFontFamily=null,this._layoutTextCtx=null,this._textDivProperties=new WeakMap,this._renderingDone=!1,this._canceled=!1,this._capability=(0,n.createPromiseCapability)(),this._renderTimer=null,this._bounds=[],this._capability.promise.finally(()=>{this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=null)}).catch(()=>{})}return a.prototype={get promise(){return this._capability.promise},cancel:function(){this._canceled=!0,this._reader&&(this._reader.cancel(new n.AbortException("TextLayer task cancelled.")),this._reader=null),null!==this._renderTimer&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))},_processItems(e,i){for(let n=0,s=e.length;n<s;n++)this._textContentItemsStr.push(e[n].str),t(this,e[n],i)},_layoutText(e){const t=this._textDivProperties.get(e);if(t.isWhitespace)return;let i="";if(0!==t.canvasWidth){const{fontSize:n,fontFamily:s}=e.style;n===this._layoutTextLastFontSize&&s===this._layoutTextLastFontFamily||(this._layoutTextCtx.font=`${n} ${s}`,this._layoutTextLastFontSize=n,this._layoutTextLastFontFamily=s);const{width:r}=this._layoutTextCtx.measureText(e.textContent);r>0&&(t.scale=t.canvasWidth/r,i=`scaleX(${t.scale})`)}0!==t.angle&&(i=`rotate(${t.angle}deg) ${i}`),i.length>0&&(this._enhanceTextSelection&&(t.originalTransform=i),e.style.transform=i),this._textDivProperties.set(e,t),this._container.appendChild(e)},_render:function(e){const t=(0,n.createPromiseCapability)();let s=Object.create(null);const r=document.createElement("canvas");if(r.mozOpaque=!0,this._layoutTextCtx=r.getContext("2d",{alpha:!1}),this._textContent){const e=this._textContent.items,i=this._textContent.styles;this._processItems(e,i),t.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');{const e=()=>{this._reader.read().then(({value:i,done:n})=>{n?t.resolve():(Object.assign(s,i.styles),this._processItems(i.items,s),e())},t.reject)};this._reader=this._textContentStream.getReader(),e()}}t.promise.then(()=>{s=null,e?this._renderTimer=setTimeout(()=>{i(this),this._renderTimer=null},e):i(this)},this._capability.reject)},expandTextDivs:function(e){if(!this._enhanceTextSelection||!this._renderingDone)return;null!==this._bounds&&(s(this),this._bounds=null);const t=[],i=[];for(var n=0,r=this._textDivs.length;n<r;n++){const s=this._textDivs[n],r=this._textDivProperties.get(s);r.isWhitespace||(e?(t.length=0,i.length=0,r.originalTransform&&t.push(r.originalTransform),r.paddingTop>0?(i.push(`${r.paddingTop}px`),t.push(`translateY(${-r.paddingTop}px)`)):i.push(0),r.paddingRight>0?i.push(`${r.paddingRight/r.scale}px`):i.push(0),r.paddingBottom>0?i.push(`${r.paddingBottom}px`):i.push(0),r.paddingLeft>0?(i.push(`${r.paddingLeft/r.scale}px`),t.push(`translateX(${-r.paddingLeft/r.scale}px)`)):i.push(0),s.style.padding=i.join(" "),t.length&&(s.style.transform=t.join(" "))):(s.style.padding=null,s.style.transform=r.originalTransform))}}},function(e){var t=new a({textContent:e.textContent,textContentStream:e.textContentStream,container:e.container,viewport:e.viewport,textDivs:e.textDivs,textContentItemsStr:e.textContentItemsStr,enhanceTextSelection:e.enhanceTextSelection});return t._render(e.timeout),t}}();t.renderTextLayer=s},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationLayer=void 0;var n=i(4),s=i(1);class r{static create(e){switch(e.data.annotationType){case s.AnnotationType.LINK:return new o(e);case s.AnnotationType.TEXT:return new l(e);case s.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new c(e);case"Btn":return e.data.radioButton?new u(e):e.data.checkBox?new d(e):new p(e);case"Ch":return new g(e)}return new h(e);case s.AnnotationType.POPUP:return new f(e);case s.AnnotationType.FREETEXT:return new v(e);case s.AnnotationType.LINE:return new b(e);case s.AnnotationType.SQUARE:return new _(e);case s.AnnotationType.CIRCLE:return new w(e);case s.AnnotationType.POLYLINE:return new y(e);case s.AnnotationType.CARET:return new S(e);case s.AnnotationType.INK:return new P(e);case s.AnnotationType.POLYGON:return new A(e);case s.AnnotationType.HIGHLIGHT:return new C(e);case s.AnnotationType.UNDERLINE:return new x(e);case s.AnnotationType.SQUIGGLY:return new E(e);case s.AnnotationType.STRIKEOUT:return new T(e);case s.AnnotationType.STAMP:return new L(e);case s.AnnotationType.FILEATTACHMENT:return new k(e);default:return new a(e)}}}class a{constructor(e,t=!1,i=!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.renderInteractiveForms=e.renderInteractiveForms,this.svgFactory=e.svgFactory,t&&(this.container=this._createContainer(i))}_createContainer(e=!1){const t=this.data,i=this.page,n=this.viewport,r=document.createElement("section");let a=t.rect[2]-t.rect[0],o=t.rect[3]-t.rect[1];r.setAttribute("data-annotation-id",t.id);const l=s.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(r.style.transform=`matrix(${n.transform.join(",")})`,r.style.transformOrigin=`-${l[0]}px -${l[1]}px`,!e&&t.borderStyle.width>0){r.style.borderWidth=`${t.borderStyle.width}px`,t.borderStyle.style!==s.AnnotationBorderStyleType.UNDERLINE&&(a-=2*t.borderStyle.width,o-=2*t.borderStyle.width);const e=t.borderStyle.horizontalCornerRadius,i=t.borderStyle.verticalCornerRadius;if(e>0||i>0){const t=`${e}px / ${i}px`;r.style.borderRadius=t}switch(t.borderStyle.style){case s.AnnotationBorderStyleType.SOLID:r.style.borderStyle="solid";break;case s.AnnotationBorderStyleType.DASHED:r.style.borderStyle="dashed";break;case s.AnnotationBorderStyleType.BEVELED:(0,s.warn)("Unimplemented border style: beveled");break;case s.AnnotationBorderStyleType.INSET:(0,s.warn)("Unimplemented border style: inset");break;case s.AnnotationBorderStyleType.UNDERLINE:r.style.borderBottomStyle="solid"}t.color?r.style.borderColor=s.Util.makeCssRgb(0|t.color[0],0|t.color[1],0|t.color[2]):r.style.borderWidth=0}return r.style.left=`${l[0]}px`,r.style.top=`${l[1]}px`,r.style.width=`${a}px`,r.style.height=`${o}px`,r}_createPopup(e,t,i){t||((t=document.createElement("div")).style.height=e.style.height,t.style.width=e.style.width,e.appendChild(t));const n=new m({container:e,trigger:t,color:i.color,title:i.title,modificationDate:i.modificationDate,contents:i.contents,hideWrapper:!0}).render();n.style.left=e.style.width,e.appendChild(n)}render(){(0,s.unreachable)("Abstract method `AnnotationElement.render` called")}}class o extends a{constructor(e){super(e,!!(e.data.url||e.data.dest||e.data.action))}render(){this.container.className="linkAnnotation";const{data:e,linkService:t}=this,i=document.createElement("a");return e.url?(0,n.addLinkAttributes)(i,{url:e.url,target:e.newWindow?n.LinkTarget.BLANK:t.externalLinkTarget,rel:t.externalLinkRel,enabled:t.externalLinkEnabled}):e.action?this._bindNamedAction(i,e.action):this._bindLink(i,e.dest),this.container.appendChild(i),this.container}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.navigateTo(t),!1),t&&(e.className="internalLink")}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),e.className="internalLink"}}class l extends a{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents))}render(){this.container.className="textAnnotation";const e=document.createElement("img");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,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(this.container,e,this.data),this.container.appendChild(e),this.container}}class h extends a{render(){return this.container}}class c extends h{constructor(e){super(e,e.renderInteractiveForms||!e.data.hasAppearance&&!!e.data.fieldValue)}render(){const e=["left","center","right"];this.container.className="textWidgetAnnotation";let t=null;if(this.renderInteractiveForms){if(this.data.multiLine?(t=document.createElement("textarea"),t.textContent=this.data.fieldValue):(t=document.createElement("input"),t.type="text",t.setAttribute("value",this.data.fieldValue)),t.disabled=this.data.readOnly,null!==this.data.maxLen&&(t.maxLength=this.data.maxLen),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;t.classList.add("comb"),t.style.letterSpacing=`calc(${e}px - 1ch)`}}else{t=document.createElement("div"),t.textContent=this.data.fieldValue,t.style.verticalAlign="middle",t.style.display="table-cell";let e=null;this.data.fontRefName&&this.page.commonObjs.has(this.data.fontRefName)&&(e=this.page.commonObjs.get(this.data.fontRefName)),this._setTextStyle(t,e)}return null!==this.data.textAlignment&&(t.style.textAlign=e[this.data.textAlignment]),this.container.appendChild(t),this.container}_setTextStyle(e,t){const i=e.style;if(i.fontSize=`${this.data.fontSize}px`,i.direction=this.data.fontDirection<0?"rtl":"ltr",!t)return;let n="normal";t.black?n="900":t.bold&&(n="bold"),i.fontWeight=n,i.fontStyle=t.italic?"italic":"normal";const s=t.loadedName?`"${t.loadedName}", `:"",r=t.fallbackName||"Helvetica, sans-serif";i.fontFamily=s+r}}class d extends h{constructor(e){super(e,e.renderInteractiveForms)}render(){this.container.className="buttonWidgetAnnotation checkBox";const e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="checkbox",this.data.fieldValue&&"Off"!==this.data.fieldValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}class u extends h{constructor(e){super(e,e.renderInteractiveForms)}render(){this.container.className="buttonWidgetAnnotation radioButton";const e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="radio",e.name=this.data.fieldName,this.data.fieldValue===this.data.buttonValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}class p extends o{render(){const e=super.render();return e.className="buttonWidgetAnnotation pushButton",e}}class g extends h{constructor(e){super(e,e.renderInteractiveForms)}render(){this.container.className="choiceWidgetAnnotation";const e=document.createElement("select");e.disabled=this.data.readOnly,this.data.combo||(e.size=this.data.options.length,this.data.multiSelect&&(e.multiple=!0));for(const t of this.data.options){const i=document.createElement("option");i.textContent=t.displayValue,i.value=t.exportValue,this.data.fieldValue.includes(t.displayValue)&&i.setAttribute("selected",!0),e.appendChild(i)}return this.container.appendChild(e),this.container}}class f extends a{constructor(e){super(e,!(!e.data.title&&!e.data.contents))}render(){if(this.container.className="popupAnnotation",["Line","Square","Circle","PolyLine","Polygon","Ink"].includes(this.data.parentType))return this.container;const e=`[data-annotation-id="${this.data.parentId}"]`,t=this.layer.querySelector(e);if(!t)return this.container;const i=new m({container:this.container,trigger:t,color:this.data.color,title:this.data.title,modificationDate:this.data.modificationDate,contents:this.data.contents}),n=parseFloat(t.style.left),s=parseFloat(t.style.width);return this.container.style.transformOrigin=`-${n+s}px -${t.style.top}`,this.container.style.left=`${n+s}px`,this.container.appendChild(i.render()),this.container}}class m{constructor(e){this.container=e.container,this.trigger=e.trigger,this.color=e.color,this.title=e.title,this.modificationDate=e.modificationDate,this.contents=e.contents,this.hideWrapper=e.hideWrapper||!1,this.pinned=!1}render(){const e=document.createElement("div");e.className="popupWrapper",this.hideElement=this.hideWrapper?e:this.container,this.hideElement.setAttribute("hidden",!0);const t=document.createElement("div");t.className="popup";const i=this.color;if(i){const e=.7*(255-i[0])+i[0],n=.7*(255-i[1])+i[1],r=.7*(255-i[2])+i[2];t.style.backgroundColor=s.Util.makeCssRgb(0|e,0|n,0|r)}const r=document.createElement("h1");r.textContent=this.title,t.appendChild(r);const a=n.PDFDateString.toDateObject(this.modificationDate);if(a){const e=document.createElement("span");e.textContent="{{date}}, {{time}}",e.dataset.l10nId="annotation_date_string",e.dataset.l10nArgs=JSON.stringify({date:a.toLocaleDateString(),time:a.toLocaleTimeString()}),t.appendChild(e)}const o=this._formatContents(this.contents);return t.appendChild(o),this.trigger.addEventListener("click",this._toggle.bind(this)),this.trigger.addEventListener("mouseover",this._show.bind(this,!1)),this.trigger.addEventListener("mouseout",this._hide.bind(this,!1)),t.addEventListener("click",this._hide.bind(this,!0)),e.appendChild(t),e}_formatContents(e){const t=document.createElement("p"),i=e.split(/(?:\r\n?|\n)/);for(let e=0,n=i.length;e<n;++e){const s=i[e];t.appendChild(document.createTextNode(s)),e<n-1&&t.appendChild(document.createElement("br"))}return t}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(e=!1){e&&(this.pinned=!0),this.hideElement.hasAttribute("hidden")&&(this.hideElement.removeAttribute("hidden"),this.container.style.zIndex+=1)}_hide(e=!0){e&&(this.pinned=!1),this.hideElement.hasAttribute("hidden")||this.pinned||(this.hideElement.setAttribute("hidden",!0),this.container.style.zIndex-=1)}}class v extends a{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="freeTextAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class b extends a{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){this.container.className="lineAnnotation";const e=this.data,t=e.rect[2]-e.rect[0],i=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,i),s=this.svgFactory.createElement("svg:line");return 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"),n.appendChild(s),this.container.append(n),this._createPopup(this.container,s,e),this.container}}class _ extends a{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){this.container.className="squareAnnotation";const e=this.data,t=e.rect[2]-e.rect[0],i=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,i),s=e.borderStyle.width,r=this.svgFactory.createElement("svg:rect");return 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","none"),n.appendChild(r),this.container.append(n),this._createPopup(this.container,r,e),this.container}}class w extends a{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){this.container.className="circleAnnotation";const e=this.data,t=e.rect[2]-e.rect[0],i=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,i),s=e.borderStyle.width,r=this.svgFactory.createElement("svg:ellipse");return 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","none"),n.appendChild(r),this.container.append(n),this._createPopup(this.container,r,e),this.container}}class y extends a{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const e=this.data,t=e.rect[2]-e.rect[0],i=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,i);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);return r.setAttribute("points",s),r.setAttribute("stroke-width",e.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","none"),n.appendChild(r),this.container.append(n),this._createPopup(this.container,r,e),this.container}}class A extends y{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class S extends a{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class P extends a{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const e=this.data,t=e.rect[2]-e.rect[0],i=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,i);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","none"),this._createPopup(this.container,s,e),n.appendChild(s)}return this.container.append(n),this.container}}class C extends a{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="highlightAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class x extends a{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="underlineAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class E extends a{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="squigglyAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class T extends a{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="strikeoutAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class L extends a{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class k extends a{constructor(e){super(e,!0);const{filename:t,content:i}=this.data.file;this.filename=(0,n.getFilenameFromUrl)(t),this.content=i,this.linkService.eventBus&&this.linkService.eventBus.dispatch("fileattachmentannotation",{source:this,id:(0,s.stringToPDFString)(t),filename:t,content:i})}render(){this.container.className="fileAttachmentAnnotation";const e=document.createElement("div");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,e.addEventListener("dblclick",this._download.bind(this)),this.data.hasPopup||!this.data.title&&!this.data.contents||this._createPopup(this.container,e,this.data),this.container.appendChild(e),this.container}_download(){this.downloadManager?this.downloadManager.downloadData(this.content,this.filename,""):(0,s.warn)("Download cannot be started due to unavailable download manager")}}t.AnnotationLayer=class{static render(e){const t=[],i=[];for(const n of e.annotations)n&&(n.annotationType!==s.AnnotationType.POPUP?t.push(n):i.push(n));i.length&&t.push(...i);for(const i of t){const t=r.create({data:i,layer:e.div,page:e.page,viewport:e.viewport,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderInteractiveForms:e.renderInteractiveForms||!1,svgFactory:new n.DOMSVGFactory});t.isRenderable&&e.div.appendChild(t.render())}}static update(e){for(const t of e.annotations){const i=e.div.querySelector(`[data-annotation-id="${t.id}"]`);i&&(i.style.transform=`matrix(${e.viewport.transform.join(",")})`)}e.div.removeAttribute("hidden")}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var n=i(1),s=i(4),r=i(7);let a=function(){throw new Error("Not implemented: SVGGraphics")};t.SVGGraphics=a;{const e={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},i="http://www.w3.org/XML/1998/namespace",h="http://www.w3.org/1999/xlink",c=["butt","round","square"],d=["miter","round","bevel"],u=function(){const e=new Uint8Array([137,80,78,71,13,10,26,10]),t=new Int32Array(256);for(let e=0;e<256;e++){let i=e;for(let e=0;e<8;e++)i=1&i?3988292384^i>>1&2147483647:i>>1&2147483647;t[e]=i}function i(e,i,n,s){let r=s;const a=i.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(i,r),r+=i.length;const o=function(e,i,n){let s=-1;for(let r=i;r<n;r++){const i=255&(s^e[r]);s=s>>>8^t[i]}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 s(e){let t=e.length;const i=Math.ceil(t/65535),n=new Uint8Array(2+t+5*i+4);let s=0;n[s++]=120,n[s++]=156;let r=0;for(;t>65535;)n[s++]=0,n[s++]=255,n[s++]=255,n[s++]=0,n[s++]=0,n.set(e.subarray(r,r+65535),s),s+=65535,r+=65535,t-=65535;n[s++]=1,n[s++]=255&t,n[s++]=t>>8&255,n[s++]=255&~t,n[s++]=(65535&~t)>>8&255,n.set(e.subarray(r),s),s+=e.length-r;const a=function(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);return n[s++]=a>>24&255,n[s++]=a>>16&255,n[s++]=a>>8&255,n[s++]=255&a,n}function a(t,a,o,l){const h=t.width,c=t.height;let d,u,p;const g=t.data;switch(a){case n.ImageKind.GRAYSCALE_1BPP:u=0,d=1,p=h+7>>3;break;case n.ImageKind.RGB_24BPP:u=2,d=8,p=3*h;break;case n.ImageKind.RGBA_32BPP:u=6,d=8,p=4*h;break;default:throw new Error("invalid format")}const f=new Uint8Array((1+p)*c);let m=0,v=0;for(let e=0;e<c;++e)f[m++]=0,f.set(g.subarray(v,v+p),m),v+=p,m+=p;if(a===n.ImageKind.GRAYSCALE_1BPP&&l){m=0;for(let e=0;e<c;e++){m++;for(let e=0;e<p;e++)f[m++]^=255}}const b=new Uint8Array([h>>24&255,h>>16&255,h>>8&255,255&h,c>>24&255,c>>16&255,c>>8&255,255&c,d,u,0,0,0]),_=function(e){if(!r.isNodeJS)return s(e);try{let t;t=parseInt(process.versions.node)>=8?e:Buffer.from(e);const i=require("zlib").deflateSync(t,{level:9});return i instanceof Uint8Array?i:new Uint8Array(i)}catch(e){(0,n.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return s(e)}(f),w=e.length+36+b.length+_.length,y=new Uint8Array(w);let A=0;return y.set(e,A),A+=e.length,i("IHDR",b,y,A),A+=12+b.length,i("IDATA",_,y,A),A+=12+_.length,i("IEND",new Uint8Array(0),y,A),(0,n.createObjectURL)(y,"image/png",o)}return function(e,t,i){return a(e,void 0===e.kind?n.ImageKind.GRAYSCALE_1BPP:e.kind,t,i)}}();class p{constructor(){this.fontSizeScale=1,this.fontWeight=e.fontWeight,this.fontSize=0,this.textMatrix=n.IDENTITY_MATRIX,this.fontMatrix=n.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=n.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=e.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 o(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 l(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":`scale(${o(e[0])} ${o(e[3])})`;if(e[0]===e[3]&&e[1]===-e[2]){return`rotate(${o(180*Math.acos(e[0])/Math.PI)})`}}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return`translate(${o(e[4])} ${o(e[5])})`;return`matrix(${o(e[0])} ${o(e[1])} ${o(e[2])} ${o(e[3])} ${o(e[4])} `+`${o(e[5])})`}let g=0,f=0,m=0;t.SVGGraphics=a=class{constructor(e,t,i){this.svgFactory=new s.DOMSVGFactory,this.current=new p,this.transformMatrix=n.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 n.OPS)this._operatorIdMapping[n.OPS[e]]=e}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,s=t.length;e<s;e++)if(t[e]===n.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,s,r,a){const o=[e,t,i,s,r,a];this.transformMatrix=n.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=n.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(e)),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 function(e){let t=[];const i=[];for(const n of e)"save"!==n.fn?"restore"===n.fn?t=i.pop():t.push(n):(t.push({fnId:92,fn:"group",items:[]}),i.push(t),t=t[t.length-1].items);return t}(s)}executeOpTree(e){for(const t of e){const e=t.fn,i=t.fnId,s=t.args;switch(0|i){case n.OPS.beginText:this.beginText();break;case n.OPS.dependency:break;case n.OPS.setLeading:this.setLeading(s);break;case n.OPS.setLeadingMoveText:this.setLeadingMoveText(s[0],s[1]);break;case n.OPS.setFont:this.setFont(s);break;case n.OPS.showText:case n.OPS.showSpacedText:this.showText(s[0]);break;case n.OPS.endText:this.endText();break;case n.OPS.moveText:this.moveText(s[0],s[1]);break;case n.OPS.setCharSpacing:this.setCharSpacing(s[0]);break;case n.OPS.setWordSpacing:this.setWordSpacing(s[0]);break;case n.OPS.setHScale:this.setHScale(s[0]);break;case n.OPS.setTextMatrix:this.setTextMatrix(s[0],s[1],s[2],s[3],s[4],s[5]);break;case n.OPS.setTextRise:this.setTextRise(s[0]);break;case n.OPS.setTextRenderingMode:this.setTextRenderingMode(s[0]);break;case n.OPS.setLineWidth:this.setLineWidth(s[0]);break;case n.OPS.setLineJoin:this.setLineJoin(s[0]);break;case n.OPS.setLineCap:this.setLineCap(s[0]);break;case n.OPS.setMiterLimit:this.setMiterLimit(s[0]);break;case n.OPS.setFillRGBColor:this.setFillRGBColor(s[0],s[1],s[2]);break;case n.OPS.setStrokeRGBColor:this.setStrokeRGBColor(s[0],s[1],s[2]);break;case n.OPS.setStrokeColorN:this.setStrokeColorN(s);break;case n.OPS.setFillColorN:this.setFillColorN(s);break;case n.OPS.shadingFill:this.shadingFill(s[0]);break;case n.OPS.setDash:this.setDash(s[0],s[1]);break;case n.OPS.setRenderingIntent:this.setRenderingIntent(s[0]);break;case n.OPS.setFlatness:this.setFlatness(s[0]);break;case n.OPS.setGState:this.setGState(s[0]);break;case n.OPS.fill:this.fill();break;case n.OPS.eoFill:this.eoFill();break;case n.OPS.stroke:this.stroke();break;case n.OPS.fillStroke:this.fillStroke();break;case n.OPS.eoFillStroke:this.eoFillStroke();break;case n.OPS.clip:this.clip("nonzero");break;case n.OPS.eoClip:this.clip("evenodd");break;case n.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case n.OPS.paintJpegXObject:this.paintJpegXObject(s[0],s[1],s[2]);break;case n.OPS.paintImageXObject:this.paintImageXObject(s[0]);break;case n.OPS.paintInlineImageXObject:this.paintInlineImageXObject(s[0]);break;case n.OPS.paintImageMaskXObject:this.paintImageMaskXObject(s[0]);break;case n.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(s[0],s[1]);break;case n.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case n.OPS.closePath:this.closePath();break;case n.OPS.closeStroke:this.closeStroke();break;case n.OPS.closeFillStroke:this.closeFillStroke();break;case n.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case n.OPS.nextLine:this.nextLine();break;case n.OPS.transform:this.transform(s[0],s[1],s[2],s[3],s[4],s[5]);break;case n.OPS.constructPath:this.constructPath(s[0],s[1]);break;case n.OPS.endPath:this.endPath();break;case 92:this.group(t.items);break;default:(0,n.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.sqrt(e*e+t*t),a.x=a.lineX=0,a.y=a.lineY=0,a.xcoords=[],a.tspan=this.svgFactory.createElement("svg:tspan"),a.tspan.setAttributeNS(null,"font-family",a.fontFamily),a.tspan.setAttributeNS(null,"font-size",`${o(a.fontSize)}px`),a.tspan.setAttributeNS(null,"y",o(-a.y)),a.txtElement=this.svgFactory.createElement("svg:text"),a.txtElement.appendChild(a.tspan)}beginText(){const e=this.current;e.x=e.lineX=0,e.y=e.lineY=0,e.textMatrix=n.IDENTITY_MATRIX,e.lineMatrix=n.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=[]}moveText(e,t){const i=this.current;i.x=i.lineX+=e,i.y=i.lineY+=t,i.xcoords=[],i.tspan=this.svgFactory.createElement("svg:tspan"),i.tspan.setAttributeNS(null,"font-family",i.fontFamily),i.tspan.setAttributeNS(null,"font-size",`${o(i.fontSize)}px`),i.tspan.setAttributeNS(null,"y",o(-i.y))}showText(t){const s=this.current,r=s.font,a=s.fontSize;if(0===a)return;const h=s.charSpacing,c=s.wordSpacing,d=s.fontDirection,u=s.textHScale*d,p=r.vertical,g=a*s.fontMatrix[0];let f=0;for(const e of t){if(null===e){f+=d*c;continue}if((0,n.isNum)(e)){f+=-e*a*.001;continue}const t=e.width,i=e.fontChar,o=t*g+((e.isSpace?c:0)+h)*d;e.isInFont||r.missingFile?(s.xcoords.push(s.x+f*u),s.tspan.textContent+=i,f+=o):f+=o}p?s.y-=f*u:s.x+=f*u,s.tspan.setAttributeNS(null,"x",s.xcoords.map(o).join(" ")),s.tspan.setAttributeNS(null,"y",o(-s.y)),s.tspan.setAttributeNS(null,"font-family",s.fontFamily),s.tspan.setAttributeNS(null,"font-size",`${o(s.fontSize)}px`),s.fontStyle!==e.fontStyle&&s.tspan.setAttributeNS(null,"font-style",s.fontStyle),s.fontWeight!==e.fontWeight&&s.tspan.setAttributeNS(null,"font-weight",s.fontWeight);const m=s.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;if(m===n.TextRenderingMode.FILL||m===n.TextRenderingMode.FILL_STROKE?(s.fillColor!==e.fillColor&&s.tspan.setAttributeNS(null,"fill",s.fillColor),s.fillAlpha<1&&s.tspan.setAttributeNS(null,"fill-opacity",s.fillAlpha)):s.textRenderingMode===n.TextRenderingMode.ADD_TO_PATH?s.tspan.setAttributeNS(null,"fill","transparent"):s.tspan.setAttributeNS(null,"fill","none"),m===n.TextRenderingMode.STROKE||m===n.TextRenderingMode.FILL_STROKE){const e=1/(s.textMatrixScale||1);this._setStrokeAttributes(s.tspan,e)}let v=s.textMatrix;0!==s.textRise&&(v=v.slice(),v[5]+=s.textRise),s.txtElement.setAttributeNS(null,"transform",`${l(v)} scale(1, -1)`),s.txtElement.setAttributeNS(i,"xml:space","preserve"),s.txtElement.appendChild(s.tspan),s.txtgrp.appendChild(s.txtElement),this._ensureTransformGroup().appendChild(s.txtElement)}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}addFontStyle(e){this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.appendChild(this.cssStyle));const t=(0,n.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 s=e[1];t.font=i,this.embedFonts&&i.data&&!this.embeddedFonts[i.loadedName]&&(this.addFontStyle(i),this.embeddedFonts[i.loadedName]=i),t.fontMatrix=i.fontMatrix?i.fontMatrix:n.FONT_IDENTITY_MATRIX;let r="normal";i.black?r="900":i.bold&&(r="bold");const a=i.italic?"italic":"normal";s<0?(s=-s,t.fontDirection=-1):t.fontDirection=1,t.fontSize=s,t.fontFamily=i.loadedName,t.fontWeight=r,t.fontStyle=a,t.tspan=this.svgFactory.createElement("svg:tspan"),t.tspan.setAttributeNS(null,"y",o(-t.y)),t.xcoords=[]}endText(){const e=this.current;e.textRenderingMode&n.TextRenderingMode.ADD_TO_PATH_FLAG&&e.txtElement&&e.txtElement.hasChildNodes()&&(e.element=e.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=n.Util.makeCssRgb(e,t,i)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,i){this.current.fillColor=n.Util.makeCssRgb(e,t,i),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[]}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,s=n.Util.inverseTransform(this.transformMatrix),r=n.Util.applyTransform([0,0],s),a=n.Util.applyTransform([0,i],s),o=n.Util.applyTransform([t,0],s),l=n.Util.applyTransform([t,i],s),h=Math.min(r[0],a[0],o[0],l[0]),c=Math.min(r[1],a[1],o[1],l[1]),d=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",h),p.setAttributeNS(null,"y",c),p.setAttributeNS(null,"width",d-h),p.setAttributeNS(null,"height",u-c),p.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this._ensureTransformGroup().appendChild(p)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){const t=e[1],i=e[2],s=e[3]||n.IDENTITY_MATRIX,[r,a,o,l]=e[4],h=e[5],c=e[6],d=e[7],u=`shading${m++}`,[p,g]=n.Util.applyTransform([r,a],s),[f,v]=n.Util.applyTransform([o,l],s),[b,_]=n.Util.singularValueDecompose2dScale(s),w=h*b,y=c*_,A=this.svgFactory.createElement("svg:pattern");A.setAttributeNS(null,"id",u),A.setAttributeNS(null,"patternUnits","userSpaceOnUse"),A.setAttributeNS(null,"width",w),A.setAttributeNS(null,"height",y),A.setAttributeNS(null,"x",`${p}`),A.setAttributeNS(null,"y",`${g}`);const S=this.svg,P=this.transformMatrix,C=this.current.fillColor,x=this.current.strokeColor,E=this.svgFactory.create(f-p,v-g);if(this.svg=E,this.transformMatrix=s,2===d){const e=n.Util.makeCssRgb(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(i)),this.svg=S,this.transformMatrix=P,this.current.fillColor=C,this.current.strokeColor=x,A.appendChild(E.childNodes[0]),this.defs.appendChild(A),`url(#${u})`}_makeShadingPattern(e){switch(e[0]){case"RadialAxial":const t=`shading${m++}`,i=e[3];let s;switch(e[1]){case"axial":const i=e[4],n=e[5];s=this.svgFactory.createElement("svg:linearGradient"),s.setAttributeNS(null,"id",t),s.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),s.setAttributeNS(null,"x1",i[0]),s.setAttributeNS(null,"y1",i[1]),s.setAttributeNS(null,"x2",n[0]),s.setAttributeNS(null,"y2",n[1]);break;case"radial":const r=e[4],a=e[5],o=e[6],l=e[7];s=this.svgFactory.createElement("svg:radialGradient"),s.setAttributeNS(null,"id",t),s.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),s.setAttributeNS(null,"cx",a[0]),s.setAttributeNS(null,"cy",a[1]),s.setAttributeNS(null,"r",l),s.setAttributeNS(null,"fx",r[0]),s.setAttributeNS(null,"fy",r[1]),s.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]),s.appendChild(t)}return this.defs.appendChild(s),`url(#${t})`;case"Mesh":return(0,n.warn)("Unimplemented pattern Mesh"),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 s=i.x,r=i.y,a=[],l=0;for(const i of e)switch(0|i){case n.OPS.rectangle:s=t[l++],r=t[l++];const e=s+t[l++],i=r+t[l++];a.push("M",o(s),o(r),"L",o(e),o(r),"L",o(e),o(i),"L",o(s),o(i),"Z");break;case n.OPS.moveTo:s=t[l++],r=t[l++],a.push("M",o(s),o(r));break;case n.OPS.lineTo:s=t[l++],r=t[l++],a.push("L",o(s),o(r));break;case n.OPS.curveTo:s=t[l+4],r=t[l+5],a.push("C",o(t[l]),o(t[l+1]),o(t[l+2]),o(t[l+3]),o(s),o(r)),l+=6;break;case n.OPS.curveTo2:a.push("C",o(s),o(r),o(t[l]),o(t[l+1]),o(t[l+2]),o(t[l+3])),s=t[l+2],r=t[l+3],l+=4;break;case n.OPS.curveTo3:s=t[l+2],r=t[l+3],a.push("C",o(t[l]),o(t[l+1]),o(s),o(r),o(s),o(r)),l+=4;break;case n.OPS.closePath:a.push("Z")}a=a.join(" "),i.path&&e.length>0&&e[0]!==n.OPS.rectangle&&e[0]!==n.OPS.moveTo?a=i.path.getAttributeNS(null,"d")+a:(i.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(i.path)),i.path.setAttributeNS(null,"d",a),i.path.setAttributeNS(null,"fill","none"),i.element=i.path,i.setCurrentPoint(s,r)}endPath(){const e=this.current;if(e.path=null,!this.pendingClip)return;if(!e.element)return void(this.pendingClip=null);const t=`clippath${g++}`,i=this.svgFactory.createElement("svg:clipPath");i.setAttributeNS(null,"id",t),i.setAttributeNS(null,"transform",l(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.appendChild(n),this.defs.appendChild(i),e.activeClipUrl&&(e.clipGroup=null,this.extraStack.forEach((function(e){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,n.warn)(`Unimplemented graphic state operator ${t}`)}}fill(){const e=this.current;e.element&&(e.element.setAttributeNS(null,"fill",e.fillColor),e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha),this.endPath())}stroke(){const e=this.current;e.element&&(this._setStrokeAttributes(e.element),e.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(e,t=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",o(i.miterLimit)),e.setAttributeNS(null,"stroke-linecap",i.lineCap),e.setAttributeNS(null,"stroke-linejoin",i.lineJoin),e.setAttributeNS(null,"stroke-width",o(t*i.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",n.map(o).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",o(t*i.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const 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().appendChild(e)}paintJpegXObject(e,t,i){const n=this.objs.get(e),s=this.svgFactory.createElement("svg:image");s.setAttributeNS(h,"xlink:href",n.src),s.setAttributeNS(null,"width",o(t)),s.setAttributeNS(null,"height",o(i)),s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y",o(-i)),s.setAttributeNS(null,"transform",`scale(${o(1/t)} ${o(-1/i)})`),this._ensureTransformGroup().appendChild(s)}paintImageXObject(e){const t=this.objs.get(e);t?this.paintInlineImageXObject(t):(0,n.warn)(`Dependent image with object ID ${e} is not ready yet`)}paintInlineImageXObject(e,t){const i=e.width,n=e.height,s=u(e,this.forceDataSchema,!!t),r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x","0"),r.setAttributeNS(null,"y","0"),r.setAttributeNS(null,"width",o(i)),r.setAttributeNS(null,"height",o(n)),this.current.element=r,this.clip("nonzero");const a=this.svgFactory.createElement("svg:image");a.setAttributeNS(h,"xlink:href",s),a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y",o(-n)),a.setAttributeNS(null,"width",o(i)+"px"),a.setAttributeNS(null,"height",o(n)+"px"),a.setAttributeNS(null,"transform",`scale(${o(1/i)} ${o(-1/n)})`),t?t.appendChild(a):this._ensureTransformGroup().appendChild(a)}paintImageMaskXObject(e){const t=this.current,i=e.width,n=e.height,s=t.fillColor;t.maskId=`mask${f++}`;const r=this.svgFactory.createElement("svg:mask");r.setAttributeNS(null,"id",t.maskId);const a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y","0"),a.setAttributeNS(null,"width",o(i)),a.setAttributeNS(null,"height",o(n)),a.setAttributeNS(null,"fill",s),a.setAttributeNS(null,"mask",`url(#${t.maskId})`),this.defs.appendChild(r),this._ensureTransformGroup().appendChild(a),this.paintInlineImageXObject(e,r)}paintFormXObjectBegin(e,t){if(Array.isArray(e)&&6===e.length&&this.transform(e[0],e[1],e[2],e[3],e[4],e[5]),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",o(e)),n.setAttributeNS(null,"height",o(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.appendChild(i),this.defs=i;const n=this.svgFactory.createElement("svg:g");return n.setAttributeNS(null,"transform",l(e.transform)),t.appendChild(n),this.svg=n,t}_ensureClipGroup(){if(!this.current.clipGroup){const e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(e),this.current.clipGroup=e}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",l(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0;var n=i(1),s=i(20);const r=require("fs"),a=require("http"),o=require("https"),l=require("url"),h=/^file:\/\/\/[a-zA-Z]:\//;t.PDFNodeStream=class{constructor(e){this.source=e,this.url=function(e){const t=l.parse(e);return"file:"===t.protocol||t.host?t:/^[a-z]:[/\\]/i.test(e)?l.parse(`file:///${e}`):(t.host||(t.protocol="file:"),t)}(e.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,n.assert)(!this._fullRequestReader),this._fullRequestReader=this.isFsUrl?new f(this):new p(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const i=this.isFsUrl?new m(this,e,t):new g(this,e,t);return this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeRequestReaders.slice(0).forEach((function(t){t.cancel(e)}))}};class c{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(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=(0,n.createPromiseCapability)(),this.read()):(this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).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 d{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(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=(0,n.createPromiseCapability)(),this.read()):(this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(e).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 u(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class p extends c{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new n.MissingPDFException(`Missing PDF "${this._url}".`);return this._storedError=e,void this._headersCapability.reject(e)}this._headersCapability.resolve(),this._setReadableStream(t);const i=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:r,suggestedLength:a}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=a||this._contentLength,this._filename=(0,s.extractFilenameFromHeader)(i)};this._request=null,"http:"===this._url.protocol?this._request=a.request(u(this._url,e.httpHeaders),t):this._request=o.request(u(this._url,e.httpHeaders),t),this._request.on("error",e=>{this._storedError=e,this._headersCapability.reject(e)}),this._request.end()}}class g extends d{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 s=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(u(this._url,this._httpHeaders),s):this._request=o.request(u(this._url,this._httpHeaders),s),this._request.on("error",e=>{this._storedError=e}),this._request.end()}}class f extends c{constructor(e){super(e);let t=decodeURIComponent(this._url.path);h.test(this._url.href)&&(t=t.replace(/^\//,"")),r.lstat(t,(e,i)=>{if(e)return"ENOENT"===e.code&&(e=new n.MissingPDFException(`Missing PDF "${t}".`)),this._storedError=e,void this._headersCapability.reject(e);this._contentLength=i.size,this._setReadableStream(r.createReadStream(t)),this._headersCapability.resolve()})}}class m extends d{constructor(e,t,i){super(e);let n=decodeURIComponent(this._url.path);h.test(this._url.href)&&(n=n.replace(/^\//,"")),this._setReadableStream(r.createReadStream(n,{start:t,end:i-1}))}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseStatusError=function(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(e){const t=e("Content-Disposition");if(t){let e=(0,s.getFilenameFromContentDispositionHeader)(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch(e){}if(/\.pdf$/i.test(e))return e}return null},t.validateRangeRequestCapabilities=function({getResponseHeader:e,isHttp:t,rangeChunkSize:i,disableRange:s}){(0,n.assert)(i>0,"Range chunk size must be larger than zero");const r={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e("Content-Length"),10);if(!Number.isInteger(a))return r;if(r.suggestedLength=a,a<=2*i)return r;if(s||!t)return r;if("bytes"!==e("Accept-Ranges"))return r;if("identity"!==(e("Content-Encoding")||"identity"))return r;return r.allowRangeRequests=!0,r},t.validateResponseStatus=function(e){return 200===e||206===e};var n=i(1),s=i(21)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let t=!0,i=n("filename\\*","i").exec(e);if(i){i=i[1];let e=a(i);return e=unescape(e),e=o(e),e=l(e),r(e)}if(i=function(e){const t=[];let i;const s=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=s.exec(e));){let[,e,n,s]=i;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[n,s]}const r=[];for(let e=0;e<t.length&&e in t;++e){let[i,n]=t[e];n=a(n),i&&(n=unescape(n),0===e&&(n=o(n))),r.push(n)}return r.join("")}(e),i){return r(l(i))}if(i=n("filename","i").exec(e),i){i=i[1];let e=a(i);return e=l(e),r(e)}function n(e,t){return new RegExp("(?:^|;)\\s*"+e+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',t)}function s(e,i){if(e){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const n=new TextDecoder(e,{fatal:!0}),s=Array.from(i,(function(e){return 255&e.charCodeAt(0)}));i=n.decode(new Uint8Array(s)),t=!1}catch(n){if(/^utf-?8$/i.test(e))try{i=decodeURIComponent(escape(i)),t=!1}catch(e){}}}return i}function r(e){return t&&/[\x80-\xff]/.test(e)&&(e=s("utf-8",e),t&&(e=s("iso-8859-1",e))),e}function a(e){if(e.startsWith('"')){const t=e.slice(1).split('\\"');for(let e=0;e<t.length;++e){const i=t[e].indexOf('"');-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 o(e){const t=e.indexOf("'");return-1===t?e:s(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,""))}function l(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 s(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 s(t,n)}))}return""}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNetworkStream=void 0;var n=i(1),s=i(20);class r{constructor(e,t){this.url=e,t=t||{},this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this.withCredentials=t.withCredentials||!1,this.getXhr=t.getXhr||function(){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)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),n.expectedStatus=206):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),i}onProgress(e,t){const i=this.pendingRequests[e];i&&i.onProgress&&i.onProgress(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),4!==s.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===s.status&&this.isHttp)return void(i.onError&&i.onError(s.status));const r=s.status||200;if(!(200===r&&206===i.expectedStatus)&&r!==i.expectedStatus)return void(i.onError&&i.onError(s.status));const a=function(e){const t=e.response;return"string"!=typeof t?t:(0,n.stringToBytes)(t).buffer}(s);if(206===r){const e=s.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);i.onDone({begin:parseInt(t[1],10),chunk:a})}else a?i.onDone({begin:0,chunk:a}):i.onError&&i.onError(s.status)}hasPendingRequests(){for(const e in this.pendingRequests)return!0;return!1}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortAllRequests(){for(const e in this.pendingRequests)this.abortRequest(0|e)}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}t.PDFNetworkStream=class{constructor(e){this._source=e,this._manager=new r(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(){return(0,n.assert)(!this._fullRequestReader),this._fullRequestReader=new a(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const i=new o(this._manager,e,t);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeRequestReaders.slice(0).forEach((function(t){t.cancel(e)}))}};class a{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),i=e=>t.getResponseHeader(e),{allowRangeRequests:n,suggestedLength:r}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=r||this._contentLength,this._filename=(0,s.extractFilenameFromHeader)(i),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,this._cachedChunks.length>0||(this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[])}_onError(e){const t=this._url,i=(0,s.createResponseStatusError)(e,t);this._storedError=i,this._headersReceivedCapability.reject(i),this._requests.forEach((function(e){e.reject(i)})),this._requests=[],this._cachedChunks=[]}_onProgress(e){this.onProgress&&this.onProgress({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)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e),this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[],this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class o{constructor(e,t,i){this._manager=e;const n={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=e.requestRange(t,i,n),this._requests=[],this._queuedChunk=null,this._done=!1,this.onProgress=null,this.onClosed=null}_close(){this.onClosed&&this.onClosed(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,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[],this._close()}_onProgress(e){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,n.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[],this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var n=i(1),s=i(20);function r(e,t,i){return{method:"GET",headers:e,signal:i&&i.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function a(e){const t=new Headers;for(const i in e){const n=e[i];void 0!==n&&t.append(i,n)}return t}t.PDFFetchStream=class{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(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,n.assert)(!this._fullRequestReader),this._fullRequestReader=new o(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const i=new l(this,e,t);return this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeRequestReaders.slice(0).forEach((function(t){t.cancel(e)}))}};class o{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),"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=a(this._stream.httpHeaders);const i=t.url;fetch(i,r(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 t=t=>e.headers.get(t),{allowRangeRequests:r,suggestedLength:a}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=a||this._contentLength,this._filename=(0,s.extractFilenameFromHeader)(t),!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(){await this._headersCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._reader&&this._reader.cancel(e),this._abortController&&this._abortController.abort()}}class l{constructor(e,t,i){this._stream=e,this._reader=null,this._loaded=0;const o=e.source;this._withCredentials=o.withCredentials||!1,this._readCapability=(0,n.createPromiseCapability)(),this._isStreamingSupported=!o.disableStream,"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._headers=a(this._stream.httpHeaders),this._headers.append("Range",`bytes=${t}-${i-1}`);const l=o.url;fetch(l,r(this._headers,this._withCredentials,this._abortController)).then(e=>{if(!(0,s.validateResponseStatus)(e.status))throw(0,s.createResponseStatusError)(e.status,l);this._readCapability.resolve(),this._reader=e.body.getReader()}),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._reader&&this._reader.cancel(e),this._abortController&&this._abortController.abort()}}}])})),
  /**
   * @licstart The following is the entire license notice for the
   * Javascript code in this page
   *
   * Copyright 2020 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(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){"use strict";let n,s;function r(){const e={appContainer:document.body,mainContainer:document.getElementById("viewerContainer"),viewerContainer:document.getElementById("viewer"),eventBus:null,toolbar:{container:document.getElementById("toolbarViewer"),numPages:document.getElementById("numPages"),pageNumber:document.getElementById("pageNumber"),scaleSelectContainer:document.getElementById("scaleSelectContainer"),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"),presentationModeButton:document.getElementById("presentationMode"),download:document.getElementById("download"),viewBookmark:document.getElementById("viewBookmark")},secondaryToolbar:{toolbar:document.getElementById("secondaryToolbar"),toggleButton:document.getElementById("secondaryToolbarToggle"),toolbarButtonContainer:document.getElementById("secondaryToolbarButtonContainer"),presentationModeButton:document.getElementById("secondaryPresentationMode"),openFileButton:document.getElementById("secondaryOpenFile"),printButton:document.getElementById("secondaryPrint"),downloadButton:document.getElementById("secondaryDownload"),viewBookmarkButton:document.getElementById("secondaryViewBookmark"),firstPageButton:document.getElementById("firstPage"),lastPageButton:document.getElementById("lastPage"),pageRotateCwButton:document.getElementById("pageRotateCw"),pageRotateCcwButton:document.getElementById("pageRotateCcw"),cursorSelectToolButton:document.getElementById("cursorSelectTool"),cursorHandToolButton:document.getElementById("cursorHandTool"),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")},fullscreen:{contextFirstPage:document.getElementById("contextFirstPage"),contextLastPage:document.getElementById("contextLastPage"),contextPageRotateCw:document.getElementById("contextPageRotateCw"),contextPageRotateCcw:document.getElementById("contextPageRotateCcw")},sidebar:{outerContainer:document.getElementById("outerContainer"),viewerContainer:document.getElementById("viewerContainer"),toggleButton:document.getElementById("sidebarToggle"),thumbnailButton:document.getElementById("viewThumbnail"),outlineButton:document.getElementById("viewOutline"),attachmentsButton:document.getElementById("viewAttachments"),thumbnailView:document.getElementById("thumbnailView"),outlineView:document.getElementById("outlineView"),attachmentsView:document.getElementById("attachmentsView")},sidebarResizer:{outerContainer:document.getElementById("outerContainer"),resizer:document.getElementById("sidebarResizer")},findBar:{bar:document.getElementById("findbar"),toggleButton:document.getElementById("viewFind"),findField:document.getElementById("findInput"),highlightAllCheckbox:document.getElementById("findHighlightAll"),caseSensitiveCheckbox:document.getElementById("findMatchCase"),entireWordCheckbox:document.getElementById("findEntireWord"),findMsg:document.getElementById("findMsg"),findResultsCount:document.getElementById("findResultsCount"),findPreviousButton:document.getElementById("findPrevious"),findNextButton:document.getElementById("findNext")},passwordOverlay:{overlayName:"passwordOverlay",container:document.getElementById("passwordOverlay"),label:document.getElementById("passwordText"),input:document.getElementById("password"),submitButton:document.getElementById("passwordSubmit"),cancelButton:document.getElementById("passwordCancel")},documentProperties:{overlayName:"documentPropertiesOverlay",container:document.getElementById("documentPropertiesOverlay"),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")}},errorWrapper:{container:document.getElementById("errorWrapper"),errorMessage:document.getElementById("errorMessage"),closeButton:document.getElementById("errorClose"),errorMoreInfo:document.getElementById("errorMoreInfo"),moreInfoButton:document.getElementById("errorShowMore"),lessInfoButton:document.getElementById("errorShowLess")},printContainer:document.getElementById("printContainer"),openFileInputName:"fileInput",debuggerScriptPath:"./debugger.js"};window.PDFViewerApplication=n.PDFViewerApplication,window.PDFViewerApplicationOptions=s.AppOptions;const t=document.createEvent("CustomEvent");t.initCustomEvent("webviewerloaded",!0,!0,{}),document.dispatchEvent(t),n.PDFViewerApplication.run(e)}n=i(1),s=i(3),i(33),i(38),"interactive"===document.readyState||"complete"===document.readyState?r():document.addEventListener("DOMContentLoaded",r,!0)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFPrintServiceFactory=t.DefaultExternalServices=t.PDFViewerApplication=void 0;var n=i(2),s=i(3),r=i(4),a=i(6),o=i(8),l=i(9),h=i(10),c=i(11),d=i(12),u=i(13),p=i(14),g=i(15),f=i(17),m=i(18),v=i(19),b=i(20),_=i(21),w=i(22),y=i(24),A=i(29),S=i(31),P=i(32);const C=-1,x=1;class E{constructor(){throw new Error("Cannot initialize DefaultExternalServices.")}static updateFindControlState(e){}static updateFindMatchesCount(e){}static initPassiveLoading(e){}static fallback(e,t){}static reportTelemetry(e){}static createDownloadManager(e){throw new Error("Not implemented: createDownloadManager")}static createPreferences(){throw new Error("Not implemented: createPreferences")}static createL10n(e){throw new Error("Not implemented: createL10n")}static get supportsIntegratedFind(){return(0,r.shadow)(this,"supportsIntegratedFind",!1)}static get supportsDocumentFonts(){return(0,r.shadow)(this,"supportsDocumentFonts",!0)}static get supportedMouseWheelZoomModifierKeys(){return(0,r.shadow)(this,"supportedMouseWheelZoomModifierKeys",{ctrlKey:!0,metaKey:!0})}}t.DefaultExternalServices=E;const T={initialBookmark:document.location.hash.substring(1),initialized:!1,fellback:!1,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,pdfCursorTools:null,store:null,downloadManager:null,overlayManager:null,preferences:null,toolbar:null,secondaryToolbar:null,eventBus:null,l10n:null,isInitialViewSet:!1,downloadComplete:!1,isViewerEmbedded:window.parent!==window,url:"",baseUrl:"",externalServices:E,_boundEvents:{},contentDispositionFilename:null,async initialize(e){this.preferences=this.externalServices.createPreferences(),this.appConfig=e,await this._readPreferences(),await this._parseHashParameters(),await this._initializeL10n(),this.isViewerEmbedded&&s.AppOptions.get("externalLinkTarget")===r.LinkTarget.NONE&&s.AppOptions.set("externalLinkTarget",r.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.initialized=!0},async _readPreferences(){if(!0!==s.AppOptions.get("disablePreferences"))try{const e=await this.preferences.getAll();for(const t in e)s.AppOptions.set(t,e[t])}catch(e){console.error(`_readPreferences: "${e.message}".`)}},async _parseHashParameters(){if(!s.AppOptions.get("pdfBugEnabled"))return;const e=document.location.hash.substring(1);if(!e)return;const t=(0,n.parseQueryString)(e),i=[];if("disableworker"in t&&"true"===t.disableworker&&i.push(async function(){r.GlobalWorkerOptions.workerSrc||(r.GlobalWorkerOptions.workerSrc=s.AppOptions.get("workerSrc"));return(0,r.loadScript)(r.PDFWorker.getWorkerSrc())}()),"disablerange"in t&&s.AppOptions.set("disableRange","true"===t.disablerange),"disablestream"in t&&s.AppOptions.set("disableStream","true"===t.disablestream),"disableautofetch"in t&&s.AppOptions.set("disableAutoFetch","true"===t.disableautofetch),"disablefontface"in t&&s.AppOptions.set("disableFontFace","true"===t.disablefontface),"disablehistory"in t&&s.AppOptions.set("disableHistory","true"===t.disablehistory),"webgl"in t&&s.AppOptions.set("enableWebGL","true"===t.webgl),"verbosity"in t&&s.AppOptions.set("verbosity",0|t.verbosity),"textlayer"in t)switch(t.textlayer){case"off":s.AppOptions.set("textLayerMode",n.TextLayerMode.DISABLE);break;case"visible":case"shadow":case"hover":this.appConfig.viewerContainer.classList.add("textLayer-"+t.textlayer)}if("pdfbug"in t){s.AppOptions.set("pdfBug",!0);const e=t.pdfbug.split(",");i.push(function(e){const t=T.appConfig;return(0,r.loadScript)(t.debuggerScriptPath).then((function(){PDFBug.enable(e),PDFBug.init({OPS:r.OPS},t.mainContainer)}))}(e))}return"locale"in t&&s.AppOptions.set("locale",t.locale),Promise.all(i).catch(e=>{console.error(`_parseHashParameters: "${e.message}".`)})},async _initializeL10n(){this.l10n=this.externalServices.createL10n({locale:s.AppOptions.get("locale")});const e=await this.l10n.getDirection();document.getElementsByTagName("html")[0].dir=e},async _initializeViewerComponents(){const e=this.appConfig;this.overlayManager=new h.OverlayManager;const t=e.eventBus||(0,n.getGlobalEventBus)(s.AppOptions.get("eventBusDispatchToDOM"));this.eventBus=t;const i=new o.PDFRenderingQueue;i.onIdle=this.cleanup.bind(this),this.pdfRenderingQueue=i;const r=new m.PDFLinkService({eventBus:t,externalLinkTarget:s.AppOptions.get("externalLinkTarget"),externalLinkRel:s.AppOptions.get("externalLinkRel")});this.pdfLinkService=r;const P=this.externalServices.createDownloadManager({disableCreateObjectURL:s.AppOptions.get("disableCreateObjectURL")});this.downloadManager=P;const C=new g.PDFFindController({linkService:r,eventBus:t});this.findController=C;const x=e.mainContainer,E=e.viewerContainer;this.pdfViewer=new y.PDFViewer({container:x,viewer:E,eventBus:t,renderingQueue:i,linkService:r,downloadManager:P,findController:C,renderer:s.AppOptions.get("renderer"),enableWebGL:s.AppOptions.get("enableWebGL"),l10n:this.l10n,textLayerMode:s.AppOptions.get("textLayerMode"),imageResourcesPath:s.AppOptions.get("imageResourcesPath"),renderInteractiveForms:s.AppOptions.get("renderInteractiveForms"),enablePrintAutoRotate:s.AppOptions.get("enablePrintAutoRotate"),useOnlyCssZoom:s.AppOptions.get("useOnlyCssZoom"),maxCanvasPixels:s.AppOptions.get("maxCanvasPixels")}),i.setViewer(this.pdfViewer),r.setViewer(this.pdfViewer),this.pdfThumbnailViewer=new w.PDFThumbnailViewer({container:e.sidebar.thumbnailView,renderingQueue:i,linkService:r,l10n:this.l10n}),i.setThumbnailViewer(this.pdfThumbnailViewer),this.pdfHistory=new f.PDFHistory({linkService:r,eventBus:t}),r.setHistory(this.pdfHistory),this.supportsIntegratedFind||(this.findBar=new p.PDFFindBar(e.findBar,t,this.l10n)),this.pdfDocumentProperties=new u.PDFDocumentProperties(e.documentProperties,this.overlayManager,t,this.l10n),this.pdfCursorTools=new a.PDFCursorTools({container:x,eventBus:t,cursorToolOnLoad:s.AppOptions.get("cursorToolOnLoad")}),this.toolbar=new S.Toolbar(e.toolbar,t,this.l10n),this.secondaryToolbar=new A.SecondaryToolbar(e.secondaryToolbar,x,t),this.supportsFullscreen&&(this.pdfPresentationMode=new b.PDFPresentationMode({container:x,pdfViewer:this.pdfViewer,eventBus:t,contextMenuItems:e.fullscreen})),this.passwordPrompt=new c.PasswordPrompt(e.passwordOverlay,this.overlayManager,this.l10n),this.pdfOutlineViewer=new v.PDFOutlineViewer({container:e.sidebar.outlineView,eventBus:t,linkService:r}),this.pdfAttachmentViewer=new d.PDFAttachmentViewer({container:e.sidebar.attachmentsView,eventBus:t,downloadManager:P}),this.pdfSidebar=new l.PDFSidebar({elements:e.sidebar,pdfViewer:this.pdfViewer,pdfThumbnailViewer:this.pdfThumbnailViewer,eventBus:t,l10n:this.l10n}),this.pdfSidebar.onToggled=this.forceRendering.bind(this),this.pdfSidebarResizer=new _.PDFSidebarResizer(e.sidebarResizer,t,this.l10n)},run(e){this.initialize(e).then(I)},zoomIn(e){if(this.pdfViewer.isInPresentationMode)return;let t=this.pdfViewer.currentScale;do{t=(1.1*t).toFixed(2),t=Math.ceil(10*t)/10,t=Math.min(n.MAX_SCALE,t)}while(--e>0&&t<n.MAX_SCALE);this.pdfViewer.currentScaleValue=t},zoomOut(e){if(this.pdfViewer.isInPresentationMode)return;let t=this.pdfViewer.currentScale;do{t=(t/1.1).toFixed(2),t=Math.floor(10*t)/10,t=Math.max(n.MIN_SCALE,t)}while(--e>0&&t>n.MIN_SCALE);this.pdfViewer.currentScaleValue=t},zoomReset(){this.pdfViewer.isInPresentationMode||(this.pdfViewer.currentScaleValue=n.DEFAULT_SCALE_VALUE)},get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0},set page(e){this.pdfViewer.currentPageNumber=e},get page(){return this.pdfViewer.currentPageNumber},get printing(){return!!this.printService},get supportsPrinting(){return we.instance.supportsPrinting},get supportsFullscreen(){let e;const t=document.documentElement;return e=!!(t.requestFullscreen||t.mozRequestFullScreen||t.webkitRequestFullScreen||t.msRequestFullscreen),!1!==document.fullscreenEnabled&&!1!==document.mozFullScreenEnabled&&!1!==document.webkitFullscreenEnabled&&!1!==document.msFullscreenEnabled||(e=!1),(0,r.shadow)(this,"supportsFullscreen",e)},get supportsIntegratedFind(){return this.externalServices.supportsIntegratedFind},get supportsDocumentFonts(){return this.externalServices.supportsDocumentFonts},get loadingBar(){const e=new n.ProgressBar("#loadingBar");return(0,r.shadow)(this,"loadingBar",e)},get supportedMouseWheelZoomModifierKeys(){return this.externalServices.supportedMouseWheelZoomModifierKeys},initPassiveLoading(){throw new Error("Not implemented: initPassiveLoading")},setTitleUsingUrl(e=""){this.url=e,this.baseUrl=e.split("#")[0];let t=(0,n.getPDFFileNameFromURL)(e,"");if(!t)try{t=decodeURIComponent((0,r.getFilenameFromUrl)(e))||e}catch(i){t=e}this.setTitle(t)},setTitle(e){this.isViewerEmbedded||(document.title=e)},async close(){if(this.appConfig.errorWrapper.container.setAttribute("hidden","true"),!this.pdfLoadingTask)return;const e=this.pdfLoadingTask.destroy();return this.pdfLoadingTask=null,this.pdfDocument&&(this.pdfDocument=null,this.pdfThumbnailViewer.setDocument(null),this.pdfViewer.setDocument(null),this.pdfLinkService.setDocument(null),this.pdfDocumentProperties.setDocument(null)),this.store=null,this.isInitialViewSet=!1,this.downloadComplete=!1,this.url="",this.baseUrl="",this.contentDispositionFilename=null,this.pdfSidebar.reset(),this.pdfOutlineViewer.reset(),this.pdfAttachmentViewer.reset(),this.pdfHistory&&this.pdfHistory.reset(),this.findBar&&this.findBar.reset(),this.toolbar.reset(),this.secondaryToolbar.reset(),"undefined"!=typeof PDFBug&&PDFBug.cleanup(),e},async open(e,t){this.pdfLoadingTask&&await this.close();const i=s.AppOptions.getAll(s.OptionKind.WORKER);for(const e in i)r.GlobalWorkerOptions[e]=i[e];const n=Object.create(null);"string"==typeof e?(this.setTitleUsingUrl(e),n.url=e):e&&"byteLength"in e?n.data=e:e.url&&e.originalUrl&&(this.setTitleUsingUrl(e.originalUrl),n.url=e.url);const a=s.AppOptions.getAll(s.OptionKind.API);for(const e in a){let t=a[e];n[e]=t}if(t)for(const e in t){const i=t[e];"length"===e&&this.pdfDocumentProperties.setFileSize(i),n[e]=i}const o=(0,r.getDocument)(n);return this.pdfLoadingTask=o,o.onPassword=(e,t)=>{this.pdfLinkService.externalLinkEnabled=!1,this.passwordPrompt.setUpdateCallback(e,t),this.passwordPrompt.open()},o.onProgress=({loaded:e,total:t})=>{this.progress(e/t)},o.onUnsupportedFeature=this.fallback.bind(this),o.promise.then(e=>{this.load(e)},e=>{if(o!==this.pdfLoadingTask)return;const t=e&&e.message;let i;return i=e instanceof r.InvalidPDFException?this.l10n.get("invalid_file_error",null,"Invalid or corrupted PDF file."):e instanceof r.MissingPDFException?this.l10n.get("missing_file_error",null,"Missing PDF file."):e instanceof r.UnexpectedResponseException?this.l10n.get("unexpected_response_error",null,"Unexpected server response."):this.l10n.get("loading_error",null,"An error occurred while loading the PDF."),i.then(e=>{throw this.error(e,{message:t}),new Error(e)})})},download(){function e(){s.downloadUrl(t,i)}const t=this.baseUrl,i=this.contentDispositionFilename||(0,n.getPDFFileNameFromURL)(this.url),s=this.downloadManager;s.onerror=e=>{this.error(`PDF failed to download: ${e}`)},this.pdfDocument&&this.downloadComplete?this.pdfDocument.getData().then((function(e){const n=new Blob([e],{type:"application/pdf"});s.download(n,t,i)})).catch(e):e()},fallback(e){this.fellback||(this.fellback=!0,this.externalServices.fallback({featureId:e,url:this.baseUrl},(function(e){e&&T.download()})))},error(e,t){const i=[this.l10n.get("error_version_info",{version:r.version||"?",build:r.build||"?"},"PDF.js v{{version}} (build: {{build}})")];t&&(i.push(this.l10n.get("error_message",{message:t.message},"Message: {{message}}")),t.stack?i.push(this.l10n.get("error_stack",{stack:t.stack},"Stack: {{stack}}")):(t.filename&&i.push(this.l10n.get("error_file",{file:t.filename},"File: {{file}}")),t.lineNumber&&i.push(this.l10n.get("error_line",{line:t.lineNumber},"Line: {{line}}"))));const s=this.appConfig.errorWrapper,a=s.container;a.removeAttribute("hidden"),s.errorMessage.textContent=e;const o=s.closeButton;o.onclick=function(){a.setAttribute("hidden","true")};const l=s.errorMoreInfo,h=s.moreInfoButton,c=s.lessInfoButton;h.onclick=function(){l.removeAttribute("hidden"),h.setAttribute("hidden","true"),c.removeAttribute("hidden"),l.style.height=l.scrollHeight+"px"},c.onclick=function(){l.setAttribute("hidden","true"),h.removeAttribute("hidden"),c.setAttribute("hidden","true")},h.oncontextmenu=n.noContextMenuHandler,c.oncontextmenu=n.noContextMenuHandler,o.oncontextmenu=n.noContextMenuHandler,h.removeAttribute("hidden"),c.setAttribute("hidden","true"),Promise.all(i).then(e=>{l.value=e.join("\n")})},progress(e){if(this.downloadComplete)return;const t=Math.round(100*e);if(t>this.loadingBar.percent||isNaN(t)){this.loadingBar.percent=t,(this.pdfDocument?this.pdfDocument.loadingParams.disableAutoFetch:s.AppOptions.get("disableAutoFetch"))&&t&&(this.disableAutoFetchLoadingBarTimeout&&(clearTimeout(this.disableAutoFetchLoadingBarTimeout),this.disableAutoFetchLoadingBarTimeout=null),this.loadingBar.show(),this.disableAutoFetchLoadingBarTimeout=setTimeout(()=>{this.loadingBar.hide(),this.disableAutoFetchLoadingBarTimeout=null},5e3))}},load(e){this.pdfDocument=e,e.getDownloadInfo().then(()=>{this.downloadComplete=!0,this.loadingBar.hide(),d.then(()=>{this.eventBus.dispatch("documentloaded",{source:this})})});const t=e.getPageLayout().catch((function(){})),i=e.getPageMode().catch((function(){})),a=e.getOpenActionDestination().catch((function(){}));this.toolbar.setPagesCount(e.numPages,!1),this.secondaryToolbar.setPagesCount(e.numPages);const o=this.store=new P.ViewHistory(e.fingerprint);let h;h=null,this.pdfLinkService.setDocument(e,null),this.pdfDocumentProperties.setDocument(e,this.url);const c=this.pdfViewer;c.setDocument(e);const d=c.firstPagePromise,u=c.pagesPromise,p=c.onePageRendered,g=this.pdfThumbnailViewer;g.setDocument(e),d.then(r=>{this.loadingBar.setWidth(this.appConfig.viewerContainer);const h=o.getMultiple({page:null,zoom:n.DEFAULT_SCALE_VALUE,scrollLeft:"0",scrollTop:"0",rotation:null,sidebarView:l.SidebarView.UNKNOWN,scrollMode:n.ScrollMode.UNKNOWN,spreadMode:n.SpreadMode.UNKNOWN}).catch(()=>{});Promise.all([n.animationStarted,h,t,i,a]).then(async([t,i={},r,a,o])=>{const h=s.AppOptions.get("viewOnLoad");this._initializePdfHistory({fingerprint:e.fingerprint,viewOnLoad:h,initialDest:o});const d=this.initialBookmark,p=s.AppOptions.get("defaultZoomValue");let g=p?`zoom=${p}`:null,f=null,m=s.AppOptions.get("sidebarViewOnLoad"),v=s.AppOptions.get("scrollModeOnLoad"),b=s.AppOptions.get("spreadModeOnLoad");i.page&&h!==x&&(g=`page=${i.page}&zoom=${p||i.zoom},`+`${i.scrollLeft},${i.scrollTop}`,f=parseInt(i.rotation,10),m===l.SidebarView.UNKNOWN&&(m=0|i.sidebarView),v===n.ScrollMode.UNKNOWN&&(v=0|i.scrollMode),b===n.SpreadMode.UNKNOWN&&(b=0|i.spreadMode)),a&&m===l.SidebarView.UNKNOWN&&(m=function(e){switch(e){case"UseNone":return l.SidebarView.NONE;case"UseThumbs":return l.SidebarView.THUMBS;case"UseOutlines":return l.SidebarView.OUTLINE;case"UseAttachments":return l.SidebarView.ATTACHMENTS}return l.SidebarView.NONE}(a)),r&&b===n.SpreadMode.UNKNOWN&&(b=function(e){switch(e){case"SinglePage":case"OneColumn":return n.SpreadMode.NONE;case"TwoColumnLeft":case"TwoPageLeft":return n.SpreadMode.ODD;case"TwoColumnRight":case"TwoPageRight":return n.SpreadMode.EVEN}return n.SpreadMode.NONE}(r)),this.setInitialView(g,{rotation:f,sidebarView:m,scrollMode:v,spreadMode:b}),this.eventBus.dispatch("documentinit",{source:this}),this.isViewerEmbedded||c.focus(),await Promise.race([u,new Promise(e=>{setTimeout(e,1e4)})]),(d||g)&&(c.hasEqualPageSizes||(this.initialBookmark=d,c.currentScaleValue=c.currentScaleValue,this.setInitialView(g)))}).catch(()=>{this.setInitialView()}).then((function(){c.update()}))}),e.getPageLabels().then(t=>{if(!t||s.AppOptions.get("disablePageLabels"))return;const i=t.length;if(i!==this.pagesCount)return void console.error("The number of Page Labels does not match the number of pages in the document.");let n=0;for(;n<i&&t[n]===(n+1).toString();)n++;n!==i&&(c.setPageLabels(t),g.setPageLabels(t),this.toolbar.setPagesCount(e.numPages,!0),this.toolbar.setPageNumber(c.currentPageNumber,c.currentPageLabel))}),u.then(()=>{this.supportsPrinting&&e.getJavaScript().then(e=>{if(e){e.some(e=>!!e&&(console.warn("Warning: JavaScript is not supported"),this.fallback(r.UNSUPPORTED_FEATURES.javaScript),!0));for(const t of e)if(t&&n.AutoPrintRegExp.test(t))return void setTimeout((function(){window.print()}))}})}),p.then(()=>{e.getOutline().then(e=>{this.pdfOutlineViewer.render({outline:e})}),e.getAttachments().then(e=>{this.pdfAttachmentViewer.render({attachments:e})})}),e.getMetadata().then(({info:t,metadata:i,contentDispositionFilename:n})=>{let a;this.documentInfo=t,this.metadata=i,this.contentDispositionFilename=n,console.log("PDF "+e.fingerprint+" ["+t.PDFFormatVersion+" "+(t.Producer||"-").trim()+" / "+(t.Creator||"-").trim()+"] (PDF.js: "+(r.version||"-")+(s.AppOptions.get("enableWebGL")?" [WebGL]":"")+")");const o=t&&t.Title;o&&(a=o);const l=i&&i.get("dc:title");l&&("Untitled"===l||/[\uFFF0-\uFFFF]/g.test(l)||(a=l)),a?this.setTitle(`${a} - ${n||document.title}`):n&&this.setTitle(n),t.IsAcroFormPresent&&(console.warn("Warning: AcroForm/XFA is not supported"),this.fallback(r.UNSUPPORTED_FEATURES.forms));let h="other";["1.0","1.1","1.2","1.3","1.4","1.5","1.6","1.7","1.8","1.9","2.0","2.1","2.2","2.3"].includes(t.PDFFormatVersion)&&(h=`v${t.PDFFormatVersion.replace(".","_")}`);let c="other";const d=["acrobat distiller","acrobat pdfwriter","adobe livecycle","adobe pdf library","adobe photoshop","ghostscript","tcpdf","cairo","dvipdfm","dvips","pdftex","pdfkit","itext","prince","quarkxpress","mac os x","microsoft","openoffice","oracle","luradocument","pdf-xchange","antenna house","aspose.cells","fpdf"];if(t.Producer){const e=t.Producer.toLowerCase();d.some((function(t){return!!e.includes(t)&&(c=t.replace(/[ .\-]/g,"_"),!0)}))}let u=null;t.IsAcroFormPresent&&(u=t.IsXFAPresent?"xfa":"acroform"),this.externalServices.reportTelemetry({type:"documentInfo",version:h,generator:c,formType:u})})},_initializePdfHistory({fingerprint:e,viewOnLoad:t,initialDest:i=null}){s.AppOptions.get("disableHistory")||this.isViewerEmbedded||(this.pdfHistory.initialize({fingerprint:e,resetHistory:t===x,updateUrl:s.AppOptions.get("historyUpdateUrl")}),this.pdfHistory.initialBookmark&&(this.initialBookmark=this.pdfHistory.initialBookmark,this.initialRotation=this.pdfHistory.initialRotation),i&&!this.initialBookmark&&t===C&&(this.initialBookmark=JSON.stringify(i),this.pdfHistory.push({explicitDest:i,pageNumber:null})))},setInitialView(e,{rotation:t,sidebarView:i,scrollMode:s,spreadMode:r}={}){const a=e=>{(0,n.isValidRotation)(e)&&(this.pdfViewer.pagesRotation=e)};this.isInitialViewSet=!0,this.pdfSidebar.setInitialView(i),((e,t)=>{(0,n.isValidScrollMode)(e)&&(this.pdfViewer.scrollMode=e),(0,n.isValidSpreadMode)(t)&&(this.pdfViewer.spreadMode=t)})(s,r),this.initialBookmark?(a(this.initialRotation),delete this.initialRotation,this.pdfLinkService.setHash(this.initialBookmark),this.initialBookmark=null):e&&(a(t),this.pdfLinkService.setHash(e)),this.toolbar.setPageNumber(this.pdfViewer.currentPageNumber,this.pdfViewer.currentPageLabel),this.secondaryToolbar.setPageNumber(this.pdfViewer.currentPageNumber),this.pdfViewer.currentScaleValue||(this.pdfViewer.currentScaleValue=n.DEFAULT_SCALE_VALUE)},cleanup(){this.pdfDocument&&(this.pdfViewer.cleanup(),this.pdfThumbnailViewer.cleanup(),this.pdfViewer.renderer!==n.RendererType.SVG&&this.pdfDocument.cleanup())},forceRendering(){this.pdfRenderingQueue.printing=this.printing,this.pdfRenderingQueue.isThumbnailViewEnabled=this.pdfSidebar.isThumbnailViewVisible,this.pdfRenderingQueue.renderHighestPriority()},beforePrint(){if(this.printService)return;if(!this.supportsPrinting)return void this.l10n.get("printing_not_supported",null,"Warning: Printing is not fully supported by this browser.").then(e=>{this.error(e)});if(!this.pdfViewer.pageViewsReady)return void this.l10n.get("printing_not_ready",null,"Warning: The PDF is not fully loaded for printing.").then(e=>{window.alert(e)});const e=this.pdfViewer.getPagesOverview(),t=this.appConfig.printContainer,i=we.instance.createPrintService(this.pdfDocument,e,t,this.l10n);this.printService=i,this.forceRendering(),i.layout(),this.externalServices.reportTelemetry({type:"print"})},afterPrint(){this.printService&&(this.printService.destroy(),this.printService=null),this.forceRendering()},rotatePages(e){if(!this.pdfDocument)return;const t=(this.pdfViewer.pagesRotation+360+e)%360;this.pdfViewer.pagesRotation=t},requestPresentationMode(){this.pdfPresentationMode&&this.pdfPresentationMode.request()},bindEvents(){const{eventBus:e,_boundEvents:t}=this;t.beforePrint=this.beforePrint.bind(this),t.afterPrint=this.afterPrint.bind(this),e.on("resize",j),e.on("hashchange",W),e.on("beforeprint",t.beforePrint),e.on("afterprint",t.afterPrint),e.on("pagerendered",N),e.on("updateviewarea",B),e.on("pagechanging",pe),e.on("scalechanging",de),e.on("rotationchanging",ue),e.on("sidebarviewchanged",O),e.on("pagemode",M),e.on("namedaction",F),e.on("presentationmodechanged",D),e.on("presentationmode",H),e.on("openfile",z),e.on("print",q),e.on("download",G),e.on("firstpage",$),e.on("lastpage",X),e.on("nextpage",Y),e.on("previouspage",K),e.on("zoomin",Q),e.on("zoomout",J),e.on("zoomreset",Z),e.on("pagenumberchanged",ee),e.on("scalechanged",te),e.on("rotatecw",ie),e.on("rotateccw",ne),e.on("switchscrollmode",se),e.on("scrollmodechanged",V),e.on("switchspreadmode",re),e.on("spreadmodechanged",U),e.on("documentproperties",ae),e.on("find",oe),e.on("findfromurlhash",le),e.on("updatefindmatchescount",he),e.on("updatefindcontrolstate",ce),e.on("fileinputchange",R)},bindWindowEvents(){const{eventBus:e,_boundEvents:t}=this;t.windowResize=()=>{e.dispatch("resize",{source:window})},t.windowHashChange=()=>{e.dispatch("hashchange",{source:window,hash:document.location.hash.substring(1)})},t.windowBeforePrint=()=>{e.dispatch("beforeprint",{source:window})},t.windowAfterPrint=()=>{e.dispatch("afterprint",{source:window})},window.addEventListener("visibilitychange",ge),window.addEventListener("wheel",ve,{passive:!1}),window.addEventListener("click",be),window.addEventListener("keydown",_e),window.addEventListener("resize",t.windowResize),window.addEventListener("hashchange",t.windowHashChange),window.addEventListener("beforeprint",t.windowBeforePrint),window.addEventListener("afterprint",t.windowAfterPrint)},unbindEvents(){const{eventBus:e,_boundEvents:t}=this;e.off("resize",j),e.off("hashchange",W),e.off("beforeprint",t.beforePrint),e.off("afterprint",t.afterPrint),e.off("pagerendered",N),e.off("updateviewarea",B),e.off("pagechanging",pe),e.off("scalechanging",de),e.off("rotationchanging",ue),e.off("sidebarviewchanged",O),e.off("pagemode",M),e.off("namedaction",F),e.off("presentationmodechanged",D),e.off("presentationmode",H),e.off("openfile",z),e.off("print",q),e.off("download",G),e.off("firstpage",$),e.off("lastpage",X),e.off("nextpage",Y),e.off("previouspage",K),e.off("zoomin",Q),e.off("zoomout",J),e.off("zoomreset",Z),e.off("pagenumberchanged",ee),e.off("scalechanged",te),e.off("rotatecw",ie),e.off("rotateccw",ne),e.off("switchscrollmode",se),e.off("scrollmodechanged",V),e.off("switchspreadmode",re),e.off("spreadmodechanged",U),e.off("documentproperties",ae),e.off("find",oe),e.off("findfromurlhash",le),e.off("updatefindmatchescount",he),e.off("updatefindcontrolstate",ce),e.off("fileinputchange",R),t.beforePrint=null,t.afterPrint=null},unbindWindowEvents(){const{_boundEvents:e}=this;window.removeEventListener("visibilitychange",ge),window.removeEventListener("wheel",ve),window.removeEventListener("click",be),window.removeEventListener("keydown",_e),window.removeEventListener("resize",e.windowResize),window.removeEventListener("hashchange",e.windowHashChange),window.removeEventListener("beforeprint",e.windowBeforePrint),window.removeEventListener("afterprint",e.windowAfterPrint),e.windowResize=null,e.windowHashChange=null,e.windowBeforePrint=null,e.windowAfterPrint=null}};let L,k,R;t.PDFViewerApplication=T;{const e=["null","http://mozilla.github.io","https://mozilla.github.io"];L=function(t){if(void 0!==t)try{const i=new URL(window.location.href).origin||"null";if(e.includes(i))return;const{origin:n,protocol:s}=new URL(t,window.location.href);if(n!==i&&"blob:"!==s)throw new Error("file origin does not match viewer's")}catch(e){const t=e&&e.message;throw T.l10n.get("loading_error",null,"An error occurred while loading the PDF.").then(e=>{T.error(e,{message:t})}),e}}}function I(){const e=T.appConfig;let t;const i=document.location.search.substring(1),r=(0,n.parseQueryString)(i);t="file"in r?r.file:s.AppOptions.get("defaultUrl"),L(t);const a=document.createElement("input");a.id=e.openFileInputName,a.className="fileInput",a.setAttribute("type","file"),a.oncontextmenu=n.noContextMenuHandler,document.body.appendChild(a),window.File&&window.FileReader&&window.FileList&&window.Blob?a.value=null:(e.toolbar.openFile.setAttribute("hidden","true"),e.secondaryToolbar.openFileButton.setAttribute("hidden","true")),a.addEventListener("change",(function(e){const t=e.target.files;t&&0!==t.length&&T.eventBus.dispatch("fileinputchange",{source:this,fileInput:e.target})})),e.mainContainer.addEventListener("dragover",(function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"})),e.mainContainer.addEventListener("drop",(function(e){e.preventDefault();const t=e.dataTransfer.files;t&&0!==t.length&&T.eventBus.dispatch("fileinputchange",{source:this,fileInput:e.dataTransfer})})),T.supportsDocumentFonts||(s.AppOptions.set("disableFontFace",!0),T.l10n.get("web_fonts_disabled",null,"Web fonts are disabled: unable to use embedded PDF fonts.").then(e=>{console.warn(e)})),T.supportsPrinting||(e.toolbar.print.classList.add("hidden"),e.secondaryToolbar.printButton.classList.add("hidden")),T.supportsFullscreen||(e.toolbar.presentationModeButton.classList.add("hidden"),e.secondaryToolbar.presentationModeButton.classList.add("hidden")),T.supportsIntegratedFind&&e.toolbar.viewFind.classList.add("hidden"),e.mainContainer.addEventListener("transitionend",(function(e){e.target===this&&T.eventBus.dispatch("resize",{source:this})}),!0);try{k(t)}catch(e){T.l10n.get("loading_error",null,"An error occurred while loading the PDF.").then(t=>{T.error(t,e)})}}function N(e){const t=e.pageNumber,i=t-1,n=T.pdfViewer.getPageView(i);if(t===T.page&&T.toolbar.updateLoadingIndicatorState(!1),n){if(T.pdfSidebar.isThumbnailViewVisible){T.pdfThumbnailViewer.getThumbnail(i).setImage(n)}"undefined"!=typeof Stats&&Stats.enabled&&n.stats&&Stats.add(t,n.stats),n.error&&T.l10n.get("rendering_error",null,"An error occurred while rendering the page.").then(e=>{T.error(e,n.error)}),T.externalServices.reportTelemetry({type:"pageInfo",timestamp:e.timestamp}),T.pdfDocument.getStats().then((function(e){T.externalServices.reportTelemetry({type:"documentStats",stats:e})}))}}function M({mode:e}){let t;switch(e){case"thumbs":t=l.SidebarView.THUMBS;break;case"bookmarks":case"outline":t=l.SidebarView.OUTLINE;break;case"attachments":t=l.SidebarView.ATTACHMENTS;break;case"none":t=l.SidebarView.NONE;break;default:return void console.error('Invalid "pagemode" hash parameter: '+e)}T.pdfSidebar.switchView(t,!0)}function F(e){switch(e.action){case"GoToPage":T.appConfig.toolbar.pageNumber.select();break;case"Find":T.supportsIntegratedFind||T.findBar.toggle()}}function D({active:e,switchInProgress:t}){let i=n.PresentationModeState.NORMAL;t?i=n.PresentationModeState.CHANGING:e&&(i=n.PresentationModeState.FULLSCREEN),T.pdfViewer.presentationModeState=i}function O(e){T.pdfRenderingQueue.isThumbnailViewEnabled=T.pdfSidebar.isThumbnailViewVisible;const t=T.store;t&&T.isInitialViewSet&&t.set("sidebarView",e.view).catch((function(){}))}function B(e){const t=e.location,i=T.store;i&&T.isInitialViewSet&&i.setMultiple({page:t.pageNumber,zoom:t.scale,scrollLeft:t.left,scrollTop:t.top,rotation:t.rotation}).catch((function(){}));const n=T.pdfLinkService.getAnchorUrl(t.pdfOpenParams);T.appConfig.toolbar.viewBookmark.href=n,T.appConfig.secondaryToolbar.viewBookmarkButton.href=n;const s=T.pdfViewer.getPageView(T.page-1).renderingState!==o.RenderingStates.FINISHED;T.toolbar.updateLoadingIndicatorState(s)}function V(e){const t=T.store;t&&T.isInitialViewSet&&t.set("scrollMode",e.mode).catch((function(){}))}function U(e){const t=T.store;t&&T.isInitialViewSet&&t.set("spreadMode",e.mode).catch((function(){}))}function j(){const{pdfDocument:e,pdfViewer:t}=T;if(!e)return;const i=t.currentScaleValue;"auto"!==i&&"page-fit"!==i&&"page-width"!==i||(t.currentScaleValue=i),t.update()}function W(e){const t=e.hash;t&&(T.isInitialViewSet?T.pdfHistory.popStateInProgress||T.pdfLinkService.setHash(t):T.initialBookmark=t)}function H(){T.requestPresentationMode()}function z(){const e=T.appConfig.openFileInputName;document.getElementById(e).click()}function q(){window.print()}function G(){T.download()}function $(){T.pdfDocument&&(T.page=1)}function X(){T.pdfDocument&&(T.page=T.pagesCount)}function Y(){T.page++}function K(){T.page--}function Q(){T.zoomIn()}function J(){T.zoomOut()}function Z(){T.zoomReset()}function ee(e){const t=T.pdfViewer;""!==e.value&&(t.currentPageLabel=e.value),e.value!==t.currentPageNumber.toString()&&e.value!==t.currentPageLabel&&T.toolbar.setPageNumber(t.currentPageNumber,t.currentPageLabel)}function te(e){T.pdfViewer.currentScaleValue=e.value}function ie(){T.rotatePages(90)}function ne(){T.rotatePages(-90)}function se(e){T.pdfViewer.scrollMode=e.mode}function re(e){T.pdfViewer.spreadMode=e.mode}function ae(){T.pdfDocumentProperties.open()}function oe(e){T.findController.executeCommand("find"+e.type,{query:e.query,phraseSearch:e.phraseSearch,caseSensitive:e.caseSensitive,entireWord:e.entireWord,highlightAll:e.highlightAll,findPrevious:e.findPrevious})}function le(e){T.findController.executeCommand("find",{query:e.query,phraseSearch:e.phraseSearch,caseSensitive:!1,entireWord:!1,highlightAll:!0,findPrevious:!1})}function he({matchesCount:e}){T.supportsIntegratedFind?T.externalServices.updateFindMatchesCount(e):T.findBar.updateResultsCount(e)}function ce({state:e,previous:t,matchesCount:i}){T.supportsIntegratedFind?T.externalServices.updateFindControlState({result:e,findPrevious:t,matchesCount:i}):T.findBar.updateUIState(e,t,i)}function de(e){T.toolbar.setPageScale(e.presetValue,e.scale),T.pdfViewer.update()}function ue(e){T.pdfThumbnailViewer.pagesRotation=e.pagesRotation,T.forceRendering(),T.pdfViewer.currentPageNumber=e.pageNumber}function pe(e){const t=e.pageNumber;if(T.toolbar.setPageNumber(t,e.pageLabel||null),T.secondaryToolbar.setPageNumber(t),T.pdfSidebar.isThumbnailViewVisible&&T.pdfThumbnailViewer.scrollThumbnailIntoView(t),"undefined"!=typeof Stats&&Stats.enabled){const e=T.pdfViewer.getPageView(t-1);e&&e.stats&&Stats.add(t,e.stats)}}function ge(e){"visible"===document.visibilityState&&me()}k=function(e){if(e&&0===e.lastIndexOf("file:",0)){T.setTitleUsingUrl(e);const t=new XMLHttpRequest;return t.onload=function(){T.open(new Uint8Array(t.response))},t.open("GET",e),t.responseType="arraybuffer",void t.send()}e&&T.open(e)},R=function(e){if(T.pdfViewer&&T.pdfViewer.isInPresentationMode)return;const t=e.fileInput.files[0];if(URL.createObjectURL&&!s.AppOptions.get("disableCreateObjectURL")){let e=URL.createObjectURL(t);t.name&&(e={url:e,originalUrl:t.name}),T.open(e)}else{T.setTitleUsingUrl(t.name);const e=new FileReader;e.onload=function(e){const t=e.target.result;T.open(new Uint8Array(t))},e.readAsArrayBuffer(t)}const i=T.appConfig;i.toolbar.viewBookmark.setAttribute("hidden","true"),i.secondaryToolbar.viewBookmarkButton.setAttribute("hidden","true"),i.toolbar.download.setAttribute("hidden","true"),i.secondaryToolbar.downloadButton.setAttribute("hidden","true")};let fe=null;function me(){fe&&clearTimeout(fe),fe=setTimeout((function(){fe=null}),1e3)}function ve(e){const{pdfViewer:t,supportedMouseWheelZoomModifierKeys:i}=T;if(!t.isInPresentationMode)if(e.ctrlKey&&i.ctrlKey||e.metaKey&&i.metaKey){if(e.preventDefault(),fe||"hidden"===document.visibilityState)return;const i=t.currentScale,s=(0,n.normalizeWheelEventDelta)(e)*3;s<0?T.zoomOut(-s):T.zoomIn(s);const r=t.currentScale;if(i!==r){const n=r/i-1,s=t.container.getBoundingClientRect(),a=e.clientX-s.left,o=e.clientY-s.top;t.container.scrollLeft+=a*n,t.container.scrollTop+=o*n}}else me()}function be(e){if(!T.secondaryToolbar.isOpen)return;const t=T.appConfig;(T.pdfViewer.containsElement(e.target)||t.toolbar.container.contains(e.target)&&e.target!==t.secondaryToolbar.toggleButton)&&T.secondaryToolbar.close()}function _e(e){if(T.overlayManager.active)return;let t=!1,i=!1;const n=(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0),s=T.pdfViewer,r=s&&s.isInPresentationMode;if(1===n||8===n||5===n||12===n)switch(e.keyCode){case 70:T.supportsIntegratedFind||(T.findBar.open(),t=!0);break;case 71:if(!T.supportsIntegratedFind){const e=T.findController.state;e&&T.findController.executeCommand("findagain",{query:e.query,phraseSearch:e.phraseSearch,caseSensitive:e.caseSensitive,entireWord:e.entireWord,highlightAll:e.highlightAll,findPrevious:5===n||12===n}),t=!0}break;case 61:case 107:case 187:case 171:r||T.zoomIn(),t=!0;break;case 173:case 109:case 189:r||T.zoomOut(),t=!0;break;case 48:case 96:r||(setTimeout((function(){T.zoomReset()})),t=!1);break;case 38:(r||T.page>1)&&(T.page=1,t=!0,i=!0);break;case 40:(r||T.page<T.pagesCount)&&(T.page=T.pagesCount,t=!0,i=!0)}if(1===n||8===n)switch(e.keyCode){case 83:T.download(),t=!0}if(3===n||10===n)switch(e.keyCode){case 80:T.requestPresentationMode(),t=!0;break;case 71:T.appConfig.toolbar.pageNumber.select(),t=!0}if(t)return i&&!r&&s.focus(),void e.preventDefault();const o=document.activeElement||document.querySelector(":focus"),l=o&&o.tagName.toUpperCase();if(!("INPUT"===l||"TEXTAREA"===l||"SELECT"===l||o&&o.isContentEditable)||27===e.keyCode){if(0===n){let n=0,o=!1;switch(e.keyCode){case 38:case 33:s.isVerticalScrollbarEnabled&&(o=!0),n=-1;break;case 8:r||(o=!0),n=-1;break;case 37:s.isHorizontalScrollbarEnabled&&(o=!0);case 75:case 80:n=-1;break;case 27:T.secondaryToolbar.isOpen&&(T.secondaryToolbar.close(),t=!0),!T.supportsIntegratedFind&&T.findBar.opened&&(T.findBar.close(),t=!0);break;case 40:case 34:s.isVerticalScrollbarEnabled&&(o=!0),n=1;break;case 13:case 32:r||(o=!0),n=1;break;case 39:s.isHorizontalScrollbarEnabled&&(o=!0);case 74:case 78:n=1;break;case 36:(r||T.page>1)&&(T.page=1,t=!0,i=!0);break;case 35:(r||T.page<T.pagesCount)&&(T.page=T.pagesCount,t=!0,i=!0);break;case 83:T.pdfCursorTools.switchTool(a.CursorTool.SELECT);break;case 72:T.pdfCursorTools.switchTool(a.CursorTool.HAND);break;case 82:T.rotatePages(90);break;case 115:T.pdfSidebar.toggle()}0===n||o&&"page-fit"!==s.currentScaleValue||(n>0?T.page<T.pagesCount&&T.page++:T.page>1&&T.page--,t=!0)}if(4===n)switch(e.keyCode){case 13:case 32:if(!r&&"page-fit"!==s.currentScaleValue)break;T.page>1&&T.page--,t=!0;break;case 82:T.rotatePages(-90)}t||r||(e.keyCode>=33&&e.keyCode<=40||32===e.keyCode&&"BUTTON"!==l)&&(i=!0),i&&!s.containsElement(o)&&s.focus(),t&&e.preventDefault()}}const we={instance:{supportsPrinting:!1,createPrintService(){throw new Error("Not implemented: createPrintService")}}};t.PDFPrintServiceFactory=we},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidRotation=function(e){return Number.isInteger(e)&&e%90==0},t.isValidScrollMode=function(e){return Number.isInteger(e)&&Object.values(n).includes(e)&&e!==n.UNKNOWN},t.isValidSpreadMode=function(e){return Number.isInteger(e)&&Object.values(s).includes(e)&&e!==s.UNKNOWN},t.isPortraitOrientation=function(e){return e.width<=e.height},t.getGlobalEventBus=function(e=!1){d||(d=new c({dispatchToDOM:e}));return d},t.clamp=u,t.getPDFFileNameFromURL=function(e,t="document.pdf"){if("string"!=typeof e)return t;if(function(e){let t=0;const i=e.length;for(;t<i&&""===e[t].trim();)t++;return"data:"===e.substring(t,t+5).toLowerCase()}(e))return console.warn('getPDFFileNameFromURL: ignoring "data:" URL for performance reasons.'),t;const i=/[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let s=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(s&&(s=s[0],s.includes("%")))try{s=i.exec(decodeURIComponent(s))[0]}catch(e){}return s||t},t.noContextMenuHandler=function(e){e.preventDefault()},t.parseQueryString=function(e){const t=e.split("&"),i=Object.create(null);for(let e=0,n=t.length;e<n;++e){const n=t[e].split("="),s=n[0].toLowerCase(),r=n.length>1?n[1]:null;i[decodeURIComponent(s)]=decodeURIComponent(r)}return i},t.backtrackBeforeAllVisibleElements=o,t.getVisibleElements=function(e,t,i=!1,n=!1){const s=e.scrollTop,r=s+e.clientHeight,l=e.scrollLeft,h=l+e.clientWidth;const c=[],d=t.length;let u=0===d?0:a(t,n?function(e){const t=e.div;return t.offsetLeft+t.clientLeft+t.clientWidth>l}:function(e){const t=e.div;return t.offsetTop+t.clientTop+t.clientHeight>s});u>0&&u<d&&!n&&(u=o(u,t,s));let p=n?h:-1;for(let e=u;e<d;e++){const i=t[e],a=i.div,o=a.offsetLeft+a.clientLeft,d=a.offsetTop+a.clientTop,u=a.clientWidth,g=a.clientHeight,f=o+u,m=d+g;if(-1===p)m>=r&&(p=m);else if((n?o:d)>p)break;if(m<=s||d>=r||f<=l||o>=h)continue;const v=Math.max(0,s-d)+Math.max(0,m-r),b=Math.max(0,l-o)+Math.max(0,f-h),_=(g-v)*(u-b)*100/g/u|0;c.push({id:i.id,x:o,y:d,view:i,percent:_})}const g=c[0],f=c[c.length-1];i&&c.sort((function(e,t){const i=e.percent-t.percent;return Math.abs(i)>.001?-i:e.id-t.id}));return{first:g,last:f,views:c}},t.roundToDivide=function(e,t){const i=e%t;return 0===i?e:Math.round(e-i+t)},t.getPageSizeInches=function({view:e,userUnit:t,rotate:i}){const[n,s,r,a]=e,o=i%180!=0,l=(r-n)/72*t,h=(a-s)/72*t;return{width:o?h:l,height:o?l:h}},t.approximateFraction=function(e){if(Math.floor(e)===e)return[e,1];const t=1/e;if(t>8)return[1,8];if(Math.floor(t)===t)return[1,t];const i=e>1?t:e;let n,s=0,r=1,a=1,o=1;for(;;){const e=s+a,t=r+o;if(t>8)break;i<=e/t?(a=e,o=t):(s=e,r=t)}n=i-s/r<a/o-i?i===e?[s,r]:[r,s]:i===e?[a,o]:[o,a];return n},t.getOutputScale=function(e){const t=window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1,n=t/i;return{sx:n,sy:n,scaled:1!==n}},t.scrollIntoView=function(e,t,i=!1){let n=e.offsetParent;if(!n)return void console.error("offsetParent is not set -- cannot scroll");let s=e.offsetTop+e.clientTop,r=e.offsetLeft+e.clientLeft;for(;n.clientHeight===n.scrollHeight&&n.clientWidth===n.scrollWidth||i&&"hidden"===getComputedStyle(n).overflow;)if(n.dataset._scaleY&&(s/=n.dataset._scaleY,r/=n.dataset._scaleX),s+=n.offsetTop,r+=n.offsetLeft,n=n.offsetParent,!n)return;t&&(void 0!==t.top&&(s+=t.top),void 0!==t.left&&(r+=t.left,n.scrollLeft=r));n.scrollTop=s},t.watchScroll=function(e,t){const i=function(i){s||(s=window.requestAnimationFrame((function(){s=null;const i=e.scrollLeft,r=n.lastX;i!==r&&(n.right=i>r),n.lastX=i;const a=e.scrollTop,o=n.lastY;a!==o&&(n.down=a>o),n.lastY=a,t(n)})))},n={right:!0,down:!0,lastX:e.scrollLeft,lastY:e.scrollTop,_eventHandler:i};let s=null;return e.addEventListener("scroll",i,!0),n},t.binarySearchFirstItem=a,t.normalizeWheelEventDelta=function(e){let t=Math.sqrt(e.deltaX*e.deltaX+e.deltaY*e.deltaY);const i=Math.atan2(e.deltaY,e.deltaX);-.25*Math.PI<i&&i<.75*Math.PI&&(t=-t);0===e.deltaMode?t/=900:1===e.deltaMode&&(t/=30);return t},t.waitOnEventOrTimeout=function({target:e,name:t,delay:i=0}){return new Promise((function(n,s){if("object"!=typeof e||!t||"string"!=typeof t||!(Number.isInteger(i)&&i>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function r(i){e instanceof c?e.off(t,a):e.removeEventListener(t,a),h&&clearTimeout(h),n(i)}const a=r.bind(null,l.EVENT);e instanceof c?e.on(t,a):e.addEventListener(t,a);const o=r.bind(null,l.TIMEOUT),h=setTimeout(o,i)}))},t.moveToEndOfArray=function(e,t){const i=[],n=e.length;let s=0;for(let r=0;r<n;++r)t(e[r])?i.push(e[r]):(e[s]=e[r],++s);for(let t=0;s<n;++t,++s)e[s]=i[t]},t.WaitOnType=t.animationStarted=t.ProgressBar=t.EventBus=t.NullL10n=t.SpreadMode=t.ScrollMode=t.TextLayerMode=t.RendererType=t.PresentationModeState=t.VERTICAL_PADDING=t.SCROLLBAR_PADDING=t.MAX_AUTO_SCALE=t.UNKNOWN_SCALE=t.MAX_SCALE=t.MIN_SCALE=t.DEFAULT_SCALE=t.DEFAULT_SCALE_VALUE=t.CSS_UNITS=t.AutoPrintRegExp=void 0;t.CSS_UNITS=96/72;t.DEFAULT_SCALE_VALUE="auto";t.DEFAULT_SCALE=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.PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};t.RendererType={CANVAS:"canvas",SVG:"svg"};t.TextLayerMode={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2};const n={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2};t.ScrollMode=n;const s={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};t.SpreadMode=s;t.AutoPrintRegExp=/\bprint\s*\(/;const r={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",get:async(e,t,i)=>function(e,t){return t?e.replace(/\{\{\s*(\w+)\s*\}\}/g,(e,i)=>i in t?t[i]:"{{"+i+"}}"):e}(i,t),async translate(e){}};function a(e,t){let i=0,n=e.length-1;if(0===e.length||!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 o(e,t,i){if(e<2)return e;let n=t[e].div,s=n.offsetTop+n.clientTop;s>=i&&(n=t[e-1].div,s=n.offsetTop+n.clientTop);for(let i=e-2;i>=0&&(n=t[i].div,!(n.offsetTop+n.clientTop+n.clientHeight<=s));--i)e=i;return e}t.NullL10n=r;const l={EVENT:"event",TIMEOUT:"timeout"};t.WaitOnType=l;const h=new Promise((function(e){window.requestAnimationFrame(e)}));t.animationStarted=h;class c{constructor({dispatchToDOM:e=!1}={}){this._listeners=Object.create(null),this._dispatchToDOM=!0===e}on(e,t){let i=this._listeners[e];i||(i=[],this._listeners[e]=i),i.push(t)}off(e,t){const i=this._listeners[e];let n;!i||(n=i.indexOf(t))<0||i.splice(n,1)}dispatch(e){const t=this._listeners[e];if(!t||0===t.length){if(this._dispatchToDOM){const t=Array.prototype.slice.call(arguments,1);this._dispatchDOMEvent(e,t)}return}const i=Array.prototype.slice.call(arguments,1);t.slice(0).forEach((function(e){e.apply(null,i)})),this._dispatchToDOM&&this._dispatchDOMEvent(e,i)}_dispatchDOMEvent(e,t=null){const i=Object.create(null);if(t&&t.length>0){const e=t[0];for(const t in e){const n=e[t];if("source"!==t)i[t]=n;else if(n===window||n===document)return}}const n=document.createEvent("CustomEvent");n.initCustomEvent(e,!0,!0,i),document.dispatchEvent(n)}}t.EventBus=c;let d=null;function u(e,t,i){return Math.min(Math.max(e,t),i)}t.ProgressBar=class{constructor(e,{height:t,width:i,units:n}={}){this.visible=!0,this.div=document.querySelector(e+" .progress"),this.bar=this.div.parentNode,this.height=t||100,this.width=i||100,this.units=n||"%",this.div.style.height=this.height+this.units,this.percent=0}_updateBar(){if(this._indeterminate)return this.div.classList.add("indeterminate"),void(this.div.style.width=this.width+this.units);this.div.classList.remove("indeterminate");const e=this.width*this._percent/100;this.div.style.width=e+this.units}get percent(){return this._percent}set percent(e){this._indeterminate=isNaN(e),this._percent=u(e,0,100),this._updateBar()}setWidth(e){if(!e)return;const t=e.parentNode.offsetWidth-e.offsetWidth;t>0&&(this.bar.style.width=`calc(100% - ${t}px)`)}hide(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"),document.body.classList.remove("loadingInProgress"))}show(){this.visible||(this.visible=!0,document.body.classList.add("loadingInProgress"),this.bar.classList.remove("hidden"))}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OptionKind=t.AppOptions=void 0;var n=i(4),s=i(5);const r={VIEWER:2,API:4,WORKER:8,PREFERENCE:128};t.OptionKind=r;const a={cursorToolOnLoad:{value:0,kind:r.VIEWER+r.PREFERENCE},defaultUrl:{value:"compressed.tracemonkey-pldi-09.pdf",kind:r.VIEWER},defaultZoomValue:{value:"",kind:r.VIEWER+r.PREFERENCE},disableHistory:{value:!1,kind:r.VIEWER},disablePageLabels:{value:!1,kind:r.VIEWER+r.PREFERENCE},enablePrintAutoRotate:{value:!1,kind:r.VIEWER+r.PREFERENCE},enableWebGL:{value:!1,kind:r.VIEWER+r.PREFERENCE},eventBusDispatchToDOM:{value:!1,kind:r.VIEWER+r.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:r.VIEWER},externalLinkTarget:{value:0,kind:r.VIEWER+r.PREFERENCE},historyUpdateUrl:{value:!1,kind:r.VIEWER+r.PREFERENCE},imageResourcesPath:{value:"./images/",kind:r.VIEWER},maxCanvasPixels:{value:16777216,compatibility:s.viewerCompatibilityParams.maxCanvasPixels,kind:r.VIEWER},pdfBugEnabled:{value:!1,kind:r.VIEWER+r.PREFERENCE},renderer:{value:"canvas",kind:r.VIEWER+r.PREFERENCE},renderInteractiveForms:{value:!1,kind:r.VIEWER+r.PREFERENCE},sidebarViewOnLoad:{value:-1,kind:r.VIEWER+r.PREFERENCE},scrollModeOnLoad:{value:-1,kind:r.VIEWER+r.PREFERENCE},spreadModeOnLoad:{value:-1,kind:r.VIEWER+r.PREFERENCE},textLayerMode:{value:1,kind:r.VIEWER+r.PREFERENCE},useOnlyCssZoom:{value:!1,kind:r.VIEWER+r.PREFERENCE},viewOnLoad:{value:0,kind:r.VIEWER+r.PREFERENCE},cMapPacked:{value:!0,kind:r.API},cMapUrl:{value:"../web/cmaps/",kind:r.API},disableAutoFetch:{value:!1,kind:r.API+r.PREFERENCE},disableCreateObjectURL:{value:!1,compatibility:n.apiCompatibilityParams.disableCreateObjectURL,kind:r.API},disableFontFace:{value:!1,kind:r.API+r.PREFERENCE},disableRange:{value:!1,kind:r.API+r.PREFERENCE},disableStream:{value:!1,kind:r.API+r.PREFERENCE},docBaseUrl:{value:"",kind:r.API},isEvalSupported:{value:!0,kind:r.API},maxImageSize:{value:-1,kind:r.API},pdfBug:{value:!1,kind:r.API},verbosity:{value:1,kind:r.API},workerPort:{value:null,kind:r.WORKER},workerSrc:{value:"../build/pdf.worker.js",kind:r.WORKER}};a.disablePreferences={value:!1,kind:r.VIEWER},a.locale={value:"undefined"!=typeof navigator?navigator.language:"en-US",kind:r.VIEWER},a.printResolution={value:150,kind:r.VIEWER};const o=Object.create(null);t.AppOptions=class{constructor(){throw new Error("Cannot initialize AppOptions.")}static get(e){const t=o[e];if(void 0!==t)return t;const i=a[e];return void 0!==i?i.compatibility||i.value:void 0}static getAll(e=null){const t=Object.create(null);for(const i in a){const n=a[i];if(e){if(0==(e&n.kind))continue;if(e===r.PREFERENCE){const e=n.value,s=typeof e;if("boolean"===s||"string"===s||"number"===s&&Number.isInteger(e)){t[i]=e;continue}throw new Error(`Invalid type for preference: ${i}`)}}const s=o[i];t[i]=void 0!==s?s:n.compatibility||n.value}return t}static set(e,t){o[e]=t}static remove(e){delete o[e]}}},function(e,t,i){"use strict";let n;n="undefined"!=typeof window&&window["pdfjs-dist/build/pdf"]?window["pdfjs-dist/build/pdf"]:require("../build/pdf.js"),e.exports=n},function(e,t,i){"use strict";const n=Object.create(null);{const e="undefined"!=typeof navigator&&navigator.userAgent||"",t="undefined"!=typeof navigator&&navigator.platform||"",i="undefined"!=typeof navigator&&navigator.maxTouchPoints||1,s=/Android/.test(e);(/\b(iPad|iPhone|iPod)(?=;)/.test(e)||"MacIntel"===t&&i>1||s)&&(n.maxCanvasPixels=5242880)}t.viewerCompatibilityParams=Object.freeze(n)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFCursorTools=t.CursorTool=void 0;var n=i(7);const s={SELECT:0,HAND:1,ZOOM:2};t.CursorTool=s;t.PDFCursorTools=class{constructor({container:e,eventBus:t,cursorToolOnLoad:i=s.SELECT}){this.container=e,this.eventBus=t,this.active=s.SELECT,this.activeBeforePresentationMode=null,this.handTool=new n.GrabToPan({element:this.container}),this._addEventListeners(),Promise.resolve().then(()=>{this.switchTool(i)})}get activeTool(){return this.active}switchTool(e){if(null!==this.activeBeforePresentationMode)return;if(e===this.active)return;const t=()=>{switch(this.active){case s.SELECT:break;case s.HAND:this.handTool.deactivate()}};switch(e){case s.SELECT:t();break;case s.HAND:t(),this.handTool.activate();break;case s.ZOOM:default:return void console.error(`switchTool: "${e}" is an unsupported value.`)}this.active=e,this._dispatchEvent()}_dispatchEvent(){this.eventBus.dispatch("cursortoolchanged",{source:this,tool:this.active})}_addEventListeners(){this.eventBus.on("switchcursortool",e=>{this.switchTool(e.tool)}),this.eventBus.on("presentationmodechanged",e=>{if(e.switchInProgress)return;let t;e.active?(t=this.active,this.switchTool(s.SELECT),this.activeBeforePresentationMode=t):(t=this.activeBeforePresentationMode,this.activeBeforePresentationMode=null,this.switchTool(t))})}}},function(e,t,i){"use strict";function n(e){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=this._onmousedown.bind(this),this._onmousemove=this._onmousemove.bind(this),this._endPan=this._endPan.bind(this),(this.overlay=document.createElement("div")).className="grab-to-pan-grabbing"}let s;Object.defineProperty(t,"__esModule",{value:!0}),t.GrabToPan=n,n.prototype={CSS_CLASS_GRAB:"grab-to-pan-grab",activate:function(){this.active||(this.active=!0,this.element.addEventListener("mousedown",this._onmousedown,!0),this.element.classList.add(this.CSS_CLASS_GRAB),this.onActiveChanged&&this.onActiveChanged(!0))},deactivate:function(){this.active&&(this.active=!1,this.element.removeEventListener("mousedown",this._onmousedown,!0),this._endPan(),this.element.classList.remove(this.CSS_CLASS_GRAB),this.onActiveChanged&&this.onActiveChanged(!1))},toggle:function(){this.active?this.deactivate():this.activate()},ignoreTarget:function(e){return e[s]("a[href], a[href] *, input, textarea, button, button *, select, option")},_onmousedown:function(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,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()},_onmousemove:function(e){if(this.element.removeEventListener("scroll",this._endPan,!0),function(e){if("buttons"in e&&r)return!(1&e.buttons);if(o||l)return 0===e.which;return!1}(e))return void this._endPan();const t=e.clientX-this.clientXStart,i=e.clientY-this.clientYStart,n=this.scrollTopStart-i,s=this.scrollLeftStart-t;this.element.scrollTo?this.element.scrollTo({top:n,left:s,behavior:"instant"}):(this.element.scrollTop=n,this.element.scrollLeft=s),this.overlay.parentNode||document.body.appendChild(this.overlay)},_endPan:function(){this.element.removeEventListener("scroll",this._endPan,!0),this.document.removeEventListener("mousemove",this._onmousemove,!0),this.document.removeEventListener("mouseup",this._endPan,!0),this.overlay.remove()}},["webkitM","mozM","msM","oM","m"].some((function(e){let t=e+"atches";return t in document.documentElement&&(s=t),t+="Selector",t in document.documentElement&&(s=t),s}));const r=!document.documentMode||document.documentMode>9,a=window.chrome,o=a&&(a.webstore||a.app),l=/Apple/.test(navigator.vendor)&&/Version\/([6-9]\d*|[1-5]\d+)/.test(navigator.userAgent)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFRenderingQueue=t.RenderingStates=void 0;const n={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};t.RenderingStates=n;t.PDFRenderingQueue=class{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1}setViewer(e){this.pdfViewer=e}setThumbnailViewer(e){this.pdfThumbnailViewer=e}isHighestPriority(e){return this.highestPriorityPage===e.renderingId}renderHighestPriority(e){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),this.pdfViewer.forceRendering(e)||this.pdfThumbnailViewer&&this.isThumbnailViewEnabled&&this.pdfThumbnailViewer.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),3e4))}getHighestPriority(e,t,i){const n=e.views,s=n.length;if(0===s)return null;for(let e=0;e<s;++e){const t=n[e].view;if(!this.isViewFinished(t))return t}if(i){const i=e.last.id;if(t[i]&&!this.isViewFinished(t[i]))return t[i]}else{const i=e.first.id-2;if(t[i]&&!this.isViewFinished(t[i]))return t[i]}return null}isViewFinished(e){return e.renderingState===n.FINISHED}renderView(e){switch(e.renderingState){case n.FINISHED:return!1;case n.PAUSED:this.highestPriorityPage=e.renderingId,e.resume();break;case n.RUNNING:this.highestPriorityPage=e.renderingId;break;case n.INITIAL:this.highestPriorityPage=e.renderingId,e.draw().finally(()=>{this.renderHighestPriority()})}return!0}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFSidebar=t.SidebarView=void 0;var n=i(2),s=i(8);const r={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4};t.SidebarView=r;t.PDFSidebar=class{constructor({elements:e,pdfViewer:t,pdfThumbnailViewer:i,eventBus:s,l10n:a=n.NullL10n,disableNotification:o=!1}){this.isOpen=!1,this.active=r.THUMBS,this.isInitialViewSet=!1,this.onToggled=null,this.pdfViewer=t,this.pdfThumbnailViewer=i,this.outerContainer=e.outerContainer,this.viewerContainer=e.viewerContainer,this.toggleButton=e.toggleButton,this.thumbnailButton=e.thumbnailButton,this.outlineButton=e.outlineButton,this.attachmentsButton=e.attachmentsButton,this.thumbnailView=e.thumbnailView,this.outlineView=e.outlineView,this.attachmentsView=e.attachmentsView,this.eventBus=s,this.l10n=a,this._disableNotification=o,this._addEventListeners()}reset(){this.isInitialViewSet=!1,this._hideUINotification(null),this.switchView(r.THUMBS),this.outlineButton.disabled=!1,this.attachmentsButton.disabled=!1}get visibleView(){return this.isOpen?this.active:r.NONE}get isThumbnailViewVisible(){return this.isOpen&&this.active===r.THUMBS}get isOutlineViewVisible(){return this.isOpen&&this.active===r.OUTLINE}get isAttachmentsViewVisible(){return this.isOpen&&this.active===r.ATTACHMENTS}setInitialView(e=r.NONE){this.isInitialViewSet||(this.isInitialViewSet=!0,e!==r.NONE&&e!==r.UNKNOWN&&this._switchView(e,!0)||this._dispatchEvent())}switchView(e,t=!1){this._switchView(e,t)}_switchView(e,t=!1){const i=e!==this.active;let n=!1;switch(e){case r.NONE:return!!this.isOpen&&(this.close(),!0);case r.THUMBS:this.isOpen&&i&&(n=!0);break;case r.OUTLINE:if(this.outlineButton.disabled)return!1;break;case r.ATTACHMENTS:if(this.attachmentsButton.disabled)return!1;break;default:return console.error(`PDFSidebar._switchView: "${e}" is not a valid view.`),!1}return this.active=e,this.thumbnailButton.classList.toggle("toggled",e===r.THUMBS),this.outlineButton.classList.toggle("toggled",e===r.OUTLINE),this.attachmentsButton.classList.toggle("toggled",e===r.ATTACHMENTS),this.thumbnailView.classList.toggle("hidden",e!==r.THUMBS),this.outlineView.classList.toggle("hidden",e!==r.OUTLINE),this.attachmentsView.classList.toggle("hidden",e!==r.ATTACHMENTS),t&&!this.isOpen?(this.open(),!0):(n&&(this._updateThumbnailViewer(),this._forceRendering()),i&&this._dispatchEvent(),this._hideUINotification(this.active),i)}open(){this.isOpen||(this.isOpen=!0,this.toggleButton.classList.add("toggled"),this.outerContainer.classList.add("sidebarMoving","sidebarOpen"),this.active===r.THUMBS&&this._updateThumbnailViewer(),this._forceRendering(),this._dispatchEvent(),this._hideUINotification(this.active))}close(){this.isOpen&&(this.isOpen=!1,this.toggleButton.classList.remove("toggled"),this.outerContainer.classList.add("sidebarMoving"),this.outerContainer.classList.remove("sidebarOpen"),this._forceRendering(),this._dispatchEvent())}toggle(){this.isOpen?this.close():this.open()}_dispatchEvent(){this.eventBus.dispatch("sidebarviewchanged",{source:this,view:this.visibleView})}_forceRendering(){this.onToggled?this.onToggled():(this.pdfViewer.forceRendering(),this.pdfThumbnailViewer.forceRendering())}_updateThumbnailViewer(){const{pdfViewer:e,pdfThumbnailViewer:t}=this,i=e.pagesCount;for(let n=0;n<i;n++){const i=e.getPageView(n);if(i&&i.renderingState===s.RenderingStates.FINISHED){t.getThumbnail(n).setImage(i)}}t.scrollThumbnailIntoView(e.currentPageNumber)}_showUINotification(e){if(!this._disableNotification){if(this.l10n.get("toggle_sidebar_notification.title",null,"Toggle Sidebar (document contains outline/attachments)").then(e=>{this.toggleButton.title=e}),this.isOpen){if(e===this.active)return}else this.toggleButton.classList.add("pdfSidebarNotification");switch(e){case r.OUTLINE:this.outlineButton.classList.add("pdfSidebarNotification");break;case r.ATTACHMENTS:this.attachmentsButton.classList.add("pdfSidebarNotification")}}}_hideUINotification(e){if(this._disableNotification)return;const t=e=>{switch(e){case r.OUTLINE:this.outlineButton.classList.remove("pdfSidebarNotification");break;case r.ATTACHMENTS:this.attachmentsButton.classList.remove("pdfSidebarNotification")}};if(this.isOpen||null===e)if(this.toggleButton.classList.remove("pdfSidebarNotification"),null===e){for(e in r)t(r[e]);this.l10n.get("toggle_sidebar.title",null,"Toggle Sidebar").then(e=>{this.toggleButton.title=e})}else t(e)}_addEventListeners(){this.viewerContainer.addEventListener("transitionend",e=>{e.target===this.viewerContainer&&this.outerContainer.classList.remove("sidebarMoving")}),this.toggleButton.addEventListener("click",()=>{this.toggle()}),this.thumbnailButton.addEventListener("click",()=>{this.switchView(r.THUMBS)}),this.outlineButton.addEventListener("click",()=>{this.switchView(r.OUTLINE)}),this.outlineButton.addEventListener("dblclick",()=>{this.eventBus.dispatch("toggleoutlinetree",{source:this})}),this.attachmentsButton.addEventListener("click",()=>{this.switchView(r.ATTACHMENTS)}),this.eventBus.on("outlineloaded",e=>{const t=e.outlineCount;this.outlineButton.disabled=!t,t?this._showUINotification(r.OUTLINE):this.active===r.OUTLINE&&this.switchView(r.THUMBS)}),this.eventBus.on("attachmentsloaded",e=>{if(e.attachmentsCount)return this.attachmentsButton.disabled=!1,void this._showUINotification(r.ATTACHMENTS);Promise.resolve().then(()=>{this.attachmentsView.hasChildNodes()||(this.attachmentsButton.disabled=!0,this.active===r.ATTACHMENTS&&this.switchView(r.THUMBS))})}),this.eventBus.on("presentationmodechanged",e=>{e.active||e.switchInProgress||!this.isThumbnailViewVisible||this._updateThumbnailViewer()})}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OverlayManager=void 0;t.OverlayManager=class{constructor(){this._overlays={},this._active=null,this._keyDownBound=this._keyDown.bind(this)}get active(){return this._active}async register(e,t,i=null,n=!1){let s;if(!(e&&t&&(s=t.parentNode)))throw new Error("Not enough parameters.");if(this._overlays[e])throw new Error("The overlay is already registered.");this._overlays[e]={element:t,container:s,callerCloseMethod:i,canForceClose:n}}async unregister(e){if(!this._overlays[e])throw new Error("The overlay does not exist.");if(this._active===e)throw new Error("The overlay cannot be removed while it is active.");delete this._overlays[e]}async open(e){if(!this._overlays[e])throw new Error("The overlay does not exist.");if(this._active){if(!this._overlays[e].canForceClose)throw this._active===e?new Error("The overlay is already active."):new Error("Another overlay is currently active.");this._closeThroughCaller()}this._active=e,this._overlays[this._active].element.classList.remove("hidden"),this._overlays[this._active].container.classList.remove("hidden"),window.addEventListener("keydown",this._keyDownBound)}async close(e){if(!this._overlays[e])throw new Error("The overlay does not exist.");if(!this._active)throw new Error("The overlay is currently not active.");if(this._active!==e)throw new Error("Another overlay is currently active.");this._overlays[this._active].container.classList.add("hidden"),this._overlays[this._active].element.classList.add("hidden"),this._active=null,window.removeEventListener("keydown",this._keyDownBound)}_keyDown(e){this._active&&27===e.keyCode&&(this._closeThroughCaller(),e.preventDefault())}_closeThroughCaller(){this._overlays[this._active].callerCloseMethod&&this._overlays[this._active].callerCloseMethod(),this._active&&this.close(this._active)}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordPrompt=void 0;var n=i(2),s=i(4);t.PasswordPrompt=class{constructor(e,t,i=n.NullL10n){this.overlayName=e.overlayName,this.container=e.container,this.label=e.label,this.input=e.input,this.submitButton=e.submitButton,this.cancelButton=e.cancelButton,this.overlayManager=t,this.l10n=i,this.updateCallback=null,this.reason=null,this.submitButton.addEventListener("click",this.verify.bind(this)),this.cancelButton.addEventListener("click",this.close.bind(this)),this.input.addEventListener("keydown",e=>{13===e.keyCode&&this.verify()}),this.overlayManager.register(this.overlayName,this.container,this.close.bind(this),!0)}open(){this.overlayManager.open(this.overlayName).then(()=>{let e;this.input.focus(),e=this.reason===s.PasswordResponses.INCORRECT_PASSWORD?this.l10n.get("password_invalid",null,"Invalid password. Please try again."):this.l10n.get("password_label",null,"Enter the password to open this PDF file."),e.then(e=>{this.label.textContent=e})})}close(){this.overlayManager.close(this.overlayName).then(()=>{this.input.value=""})}verify(){const e=this.input.value;e&&e.length>0&&(this.close(),this.updateCallback(e))}setUpdateCallback(e,t){this.updateCallback=e,this.reason=t}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFAttachmentViewer=void 0;var n=i(4);t.PDFAttachmentViewer=class{constructor({container:e,eventBus:t,downloadManager:i}){this.container=e,this.eventBus=t,this.downloadManager=i,this.reset(),this.eventBus.on("fileattachmentannotation",this._appendAttachment.bind(this))}reset(e=!1){this.attachments=null,this.container.textContent="",e||(this._renderedCapability=(0,n.createPromiseCapability)())}_dispatchEvent(e){this._renderedCapability.resolve(),this.eventBus.dispatch("attachmentsloaded",{source:this,attachmentsCount:e})}_bindPdfLink(e,t,i){if(this.downloadManager.disableCreateObjectURL)throw new Error('bindPdfLink: Unsupported "disableCreateObjectURL" value.');let s;e.onclick=function(){let e;return s||(s=(0,n.createObjectURL)(t,"application/pdf")),e="?file="+encodeURIComponent(s+"#"+i),window.open(e),!1}}_bindLink(e,t,i){e.onclick=()=>(this.downloadManager.downloadData(t,i,""),!1)}render({attachments:e,keepRenderedCapability:t=!1}){let i=0;if(this.attachments&&this.reset(!0===t),this.attachments=e||null,!e)return void this._dispatchEvent(i);const s=Object.keys(e).sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}));i=s.length;for(let t=0;t<i;t++){const i=e[s[t]],r=(0,n.removeNullCharacters)((0,n.getFilenameFromUrl)(i.filename)),a=document.createElement("div");a.className="attachmentsItem";const o=document.createElement("button");o.textContent=r,/\.pdf$/i.test(r)&&!this.downloadManager.disableCreateObjectURL?this._bindPdfLink(o,i.content,r):this._bindLink(o,i.content,r),a.appendChild(o),this.container.appendChild(a)}this._dispatchEvent(i)}_appendAttachment({id:e,filename:t,content:i}){this._renderedCapability.promise.then(()=>{let n=this.attachments;if(n){for(const t in n)if(e===t)return}else n=Object.create(null);n[e]={filename:t,content:i},this.render({attachments:n,keepRenderedCapability:!0})})}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDocumentProperties=void 0;var n=i(4),s=i(2);const r=["en-us","en-lr","my"],a={"8.5x11":"Letter","8.5x14":"Legal"},o={"297x420":"A3","210x297":"A4"};function l(e,t,i){return i[`${t?e.width:e.height}x${t?e.height:e.width}`]}t.PDFDocumentProperties=class{constructor({overlayName:e,fields:t,container:i,closeButton:n},a,o,l=s.NullL10n){this.overlayName=e,this.fields=t,this.container=i,this.overlayManager=a,this.l10n=l,this._reset(),n&&n.addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.overlayName,this.container,this.close.bind(this)),o&&(o.on("pagechanging",e=>{this._currentPageNumber=e.pageNumber}),o.on("rotationchanging",e=>{this._pagesRotation=e.pagesRotation})),this._isNonMetricLocale=!0,l.getLanguage().then(e=>{this._isNonMetricLocale=r.includes(e)})}open(){const e=e=>{Object.defineProperty(this,"fieldData",{value:Object.freeze(e),writable:!1,enumerable:!0,configurable:!0})};Promise.all([this.overlayManager.open(this.overlayName),this._dataAvailableCapability.promise]).then(()=>{const t=this._currentPageNumber,i=this._pagesRotation;this.fieldData&&t===this.fieldData._currentPageNumber&&i===this.fieldData._pagesRotation?this._updateUI():this.pdfDocument.getMetadata().then(({info:e,metadata:n,contentDispositionFilename:r})=>Promise.all([e,n,r||(0,s.getPDFFileNameFromURL)(this.url||""),this._parseFileSize(this.maybeFileSize),this._parseDate(e.CreationDate),this._parseDate(e.ModDate),this.pdfDocument.getPage(t).then(e=>this._parsePageSize((0,s.getPageSizeInches)(e),i)),this._parseLinearization(e.IsLinearized)])).then(([n,s,r,a,o,l,h,c])=>(e({fileName:r,fileSize:a,title:n.Title,author:n.Author,subject:n.Subject,keywords:n.Keywords,creationDate:o,modificationDate:l,creator:n.Creator,producer:n.Producer,version:n.PDFFormatVersion,pageCount:this.pdfDocument.numPages,pageSize:h,linearized:c,_currentPageNumber:t,_pagesRotation:i}),this._updateUI(),this.pdfDocument.getDownloadInfo())).then(({length:e})=>(this.maybeFileSize=e,this._parseFileSize(e))).then(t=>{if(t===this.fieldData.fileSize)return;const i=Object.assign(Object.create(null),this.fieldData);i.fileSize=t,e(i),this._updateUI()})})}close(){this.overlayManager.close(this.overlayName)}setDocument(e,t=null){this.pdfDocument&&(this._reset(),this._updateUI(!0)),e&&(this.pdfDocument=e,this.url=t,this._dataAvailableCapability.resolve())}setFileSize(e){Number.isInteger(e)&&e>0&&(this.maybeFileSize=e)}_reset(){this.pdfDocument=null,this.url=null,this.maybeFileSize=0,delete this.fieldData,this._dataAvailableCapability=(0,n.createPromiseCapability)(),this._currentPageNumber=1,this._pagesRotation=0}_updateUI(e=!1){if(!e&&this.fieldData){if(this.overlayManager.active===this.overlayName)for(const e in this.fields){const t=this.fieldData[e];this.fields[e].textContent=t||0===t?t:"-"}}else for(const e in this.fields)this.fields[e].textContent="-"}async _parseFileSize(e=0){const t=e/1024;if(t)return t<1024?this.l10n.get("document_properties_kb",{size_kb:(+t.toPrecision(3)).toLocaleString(),size_b:e.toLocaleString()},"{{size_kb}} KB ({{size_b}} bytes)"):this.l10n.get("document_properties_mb",{size_mb:(+(t/1024).toPrecision(3)).toLocaleString(),size_b:e.toLocaleString()},"{{size_mb}} MB ({{size_b}} bytes)")}async _parsePageSize(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},h=null,c=l(n,i,a)||l(r,i,o);if(!(c||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)};Math.abs(t.width-s.width)<.1&&Math.abs(t.height-s.height)<.1&&(c=l(s,i,o),c&&(n={width:Math.round(s.width/25.4*100)/100,height:Math.round(s.height/25.4*100)/100},r=s))}return c&&(h=this.l10n.get("document_properties_page_size_name_"+c.toLowerCase(),null,c)),Promise.all([this._isNonMetricLocale?n:r,this.l10n.get("document_properties_page_size_unit_"+(this._isNonMetricLocale?"inches":"millimeters"),null,this._isNonMetricLocale?"in":"mm"),h,this.l10n.get("document_properties_page_size_orientation_"+(i?"portrait":"landscape"),null,i?"portrait":"landscape")]).then(([{width:e,height:t},i,n,s])=>this.l10n.get("document_properties_page_size_dimension_"+(n?"name_":"")+"string",{width:e.toLocaleString(),height:t.toLocaleString(),unit:i,name:n,orientation:s},"{{width}} × {{height}} {{unit}} ("+(n?"{{name}}, ":"")+"{{orientation}})"))}async _parseDate(e){const t=n.PDFDateString.toDateObject(e);if(t)return this.l10n.get("document_properties_date_string",{date:t.toLocaleDateString(),time:t.toLocaleTimeString()},"{{date}}, {{time}}")}_parseLinearization(e){return this.l10n.get("document_properties_linearized_"+(e?"yes":"no"),null,e?"Yes":"No")}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFindBar=void 0;var n=i(2),s=i(15);t.PDFFindBar=class{constructor(e,t=(0,n.getGlobalEventBus)(),i=n.NullL10n){this.opened=!1,this.bar=e.bar||null,this.toggleButton=e.toggleButton||null,this.findField=e.findField||null,this.highlightAll=e.highlightAllCheckbox||null,this.caseSensitive=e.caseSensitiveCheckbox||null,this.entireWord=e.entireWordCheckbox||null,this.findMsg=e.findMsg||null,this.findResultsCount=e.findResultsCount||null,this.findPreviousButton=e.findPreviousButton||null,this.findNextButton=e.findNextButton||null,this.eventBus=t,this.l10n=i,this.toggleButton.addEventListener("click",()=>{this.toggle()}),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.eventBus.on("resize",this._adjustWidth.bind(this))}reset(){this.updateUIState()}dispatchEvent(e,t){this.eventBus.dispatch("find",{source:this,type:e,query:this.findField.value,phraseSearch:!0,caseSensitive:this.caseSensitive.checked,entireWord:this.entireWord.checked,highlightAll:this.highlightAll.checked,findPrevious:t})}updateUIState(e,t,i){let n=!1,r="",a="";switch(e){case s.FindState.FOUND:break;case s.FindState.PENDING:a="pending";break;case s.FindState.NOT_FOUND:r=this.l10n.get("find_not_found",null,"Phrase not found"),n=!0;break;case s.FindState.WRAPPED:r=t?this.l10n.get("find_reached_top",null,"Reached top of document, continued from bottom"):this.l10n.get("find_reached_bottom",null,"Reached end of document, continued from top")}this.findField.classList.toggle("notFound",n),this.findField.setAttribute("data-status",a),Promise.resolve(r).then(e=>{this.findMsg.textContent=e,this._adjustWidth()}),this.updateResultsCount(i)}updateResultsCount({current:e=0,total:t=0}={}){if(!this.findResultsCount)return;let i="";t>0&&(i=t>1e3?this.l10n.get("find_match_count_limit",{limit:1e3},"More than {{limit}} matches"):this.l10n.get("find_match_count",{current:e,total:t},"{{current}} of {{total}} match"+(1!==t?"es":""))),Promise.resolve(i).then(e=>{this.findResultsCount.textContent=e,this.findResultsCount.classList.toggle("hidden",!t),this._adjustWidth()})}open(){this.opened||(this.opened=!0,this.toggleButton.classList.add("toggled"),this.bar.classList.remove("hidden")),this.findField.select(),this.findField.focus(),this._adjustWidth()}close(){this.opened&&(this.opened=!1,this.toggleButton.classList.remove("toggled"),this.bar.classList.add("hidden"),this.eventBus.dispatch("findbarclose",{source:this}))}toggle(){this.opened?this.close():this.open()}_adjustWidth(){if(!this.opened)return;this.bar.classList.remove("wrapContainers"),this.bar.clientHeight>this.bar.firstElementChild.clientHeight&&this.bar.classList.add("wrapContainers")}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFindController=t.FindState=void 0;var n=i(2),s=i(4),r=i(16);const a={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};t.FindState=a;const o={"‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"};let l=null;function h(e){if(!l){const e=Object.keys(o).join("");l=new RegExp(`[${e}]`,"g")}return e.replace(l,(function(e){return o[e]}))}t.PDFFindController=class{constructor({linkService:e,eventBus:t=(0,n.getGlobalEventBus)()}){this._linkService=e,this._eventBus=t,this._reset(),t.on("findbarclose",this._onFindBarClose.bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this._state}setDocument(e){this._pdfDocument&&this._reset(),e&&(this._pdfDocument=e,this._firstPageCapability.resolve())}executeCommand(e,t){if(!t)return;const i=this._pdfDocument;(null===this._state||this._shouldDirtyMatch(e,t))&&(this._dirtyMatch=!0),this._state=t,"findhighlightallchange"!==e&&this._updateUIState(a.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||i&&this._pdfDocument!==i)return;this._extractText();const t=!this._highlightMatches,n=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),"find"===e?this._findTimeout=setTimeout(()=>{this._nextMatch(),this._findTimeout=null},250):this._dirtyMatch?this._nextMatch():"findagain"===e?(this._nextMatch(),t&&this._state.highlightAll&&this._updateAllPages()):"findhighlightallchange"===e?(n?this._nextMatch():this._highlightMatches=!0,this._updateAllPages()):this._nextMatch()})}scrollMatchIntoView({element:e=null,pageIndex:t=-1,matchIndex:i=-1}){if(!this._scrollMatches||!e)return;if(-1===i||i!==this._selected.matchIdx)return;if(-1===t||t!==this._selected.pageIdx)return;this._scrollMatches=!1;const s={top:-50,left:-400};(0,n.scrollIntoView)(e,s,!0)}_reset(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],this._state=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=Object.create(null),this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=(0,s.createPromiseCapability)()}get _query(){return this._state.query!==this._rawQuery&&(this._rawQuery=this._state.query,this._normalizedQuery=h(this._state.query)),this._normalizedQuery}_shouldDirtyMatch(e,t){if(t.query!==this._state.query)return!0;switch(e){case"findagain":const e=this._selected.pageIdx+1,t=this._linkService;return e>=1&&e<=t.pagesCount&&e!==t.page&&!t.isPageVisible(e);case"findhighlightallchange":return!1}return!0}_prepareMatches(e,t,i){function n(e,t){const i=e[t],n=e[t+1];if(t<e.length-1&&i.match===n.match)return i.skipped=!0,!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)return i.skipped=!0,!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++)n(e,s)||(t.push(e[s].match),i.push(e[s].matchLength))}_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}_calculatePhraseMatch(e,t,i,n){const s=[],r=e.length;let a=-r;for(;a=i.indexOf(e,a+r),-1!==a;)n&&!this._isEntireWord(i,a,r)||s.push(a);this._pageMatches[t]=s}_calculateWordMatch(e,t,i,n){const s=[],r=e.match(/\S+/g);for(let e=0,t=r.length;e<t;e++){const t=r[e],a=t.length;let o=-a;for(;o=i.indexOf(t,o+a),-1!==o;)n&&!this._isEntireWord(i,o,a)||s.push({match:o,matchLength:a,skipped:!1})}this._pageMatchesLength[t]=[],this._pageMatches[t]=[],this._prepareMatches(s,this._pageMatches[t],this._pageMatchesLength[t])}_calculateMatch(e){let t=this._pageContents[e],i=this._query;const{caseSensitive:n,entireWord:s,phraseSearch:r}=this._state;if(0===i.length)return;n||(t=t.toLowerCase(),i=i.toLowerCase()),r?this._calculatePhraseMatch(i,e,t,s):this._calculateWordMatch(i,e,t,s),this._state.highlightAll&&this._updatePage(e),this._resumePageIdx===e&&(this._resumePageIdx=null,this._nextPageMatch());const a=this._pageMatches[e].length;a>0&&(this._matchesCountTotal+=a,this._updateUIResultsCount())}_extractText(){if(this._extractTextPromises.length>0)return;let e=Promise.resolve();for(let t=0,i=this._linkService.pagesCount;t<i;t++){const i=(0,s.createPromiseCapability)();this._extractTextPromises[t]=i.promise,e=e.then(()=>this._pdfDocument.getPage(t+1).then(e=>e.getTextContent({normalizeWhitespace:!0})).then(e=>{const n=e.items,s=[];for(let e=0,t=n.length;e<t;e++)s.push(n[e].str);this._pageContents[t]=h(s.join("")),i.resolve(t)},e=>{console.error(`Unable to get text content for page ${t+1}`,e),this._pageContents[t]="",i.resolve(t)}))}}_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;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=t,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,this._matchesCountTotal=0,this._updateAllPages();for(let e=0;e<i;e++)!0!==this._pendingFindMatches[e]&&(this._pendingFindMatches[e]=!0,this._extractTextPromises[e].then(e=>{delete this._pendingFindMatches[e],this._calculateMatch(e)}))}if(""===this._query)return void this._updateUIState(a.FOUND);if(this._resumePageIdx)return;const n=this._offset;if(this._pagesToSearch=i,null!==n.matchIdx){const t=this._pageMatches[n.pageIdx].length;if(!e&&n.matchIdx+1<t||e&&n.matchIdx>0)return n.matchIdx=e?n.matchIdx-1:n.matchIdx+1,void this._updateMatch(!0);this._advanceOffsetPage(e)}this._nextPageMatch()}_matchesReady(e){const t=this._offset,i=e.length,n=this._state.findPrevious;return i?(t.matchIdx=n?i-1:0,this._updateMatch(!0),!0):(this._advanceOffsetPage(n),!!(t.wrapped&&(t.matchIdx=null,this._pagesToSearch<0))&&(this._updateMatch(!1),!0))}_nextPageMatch(){null!==this._resumePageIdx&&console.error("There can only be one pending page.");let e=null;do{const t=this._offset.pageIdx;if(e=this._pageMatches[t],!e){this._resumePageIdx=t;break}}while(!this._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--,(t.pageIdx>=i||t.pageIdx<0)&&(t.pageIdx=e?i-1:0,t.wrapped=!0)}_updateMatch(e=!1){let t=a.NOT_FOUND;const i=this._offset.wrapped;if(this._offset.wrapped=!1,e){const e=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,t=i?a.WRAPPED:a.FOUND,-1!==e&&e!==this._selected.pageIdx&&this._updatePage(e)}this._updateUIState(t,this._state.findPrevious),-1!==this._selected.pageIdx&&(this._scrollMatches=!0,this._updatePage(this._selected.pageIdx))}_onFindBarClose(e){const t=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||t&&this._pdfDocument!==t||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),this._updateUIState(a.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++)i+=this._pageMatches[t]&&this._pageMatches[t].length||0;i+=t+1}return(i<1||i>n)&&(i=n=0),{current:i,total:n}}_updateUIResultsCount(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this._requestMatchesCount()})}_updateUIState(e,t){this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:e,previous:t,matchesCount:this._requestMatchesCount()})}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCharacterType=function(e){if(function(e){return e<11904}(e))return function(e){return 0==(65408&e)}(e)?function(e){return 32===e||9===e||13===e||10===e}(e)?n.SPACE:function(e){return e>=97&&e<=122||e>=65&&e<=90}(e)||function(e){return e>=48&&e<=57}(e)||95===e?n.ALPHA_LETTER:n.PUNCT:function(e){return 3584==(65408&e)}(e)?n.THAI_LETTER:160===e?n.SPACE:n.ALPHA_LETTER;if(function(e){return e>=13312&&e<=40959||e>=63744&&e<=64255}(e))return n.HAN_LETTER;if(function(e){return e>=12448&&e<=12543}(e))return n.KATAKANA_LETTER;if(function(e){return e>=12352&&e<=12447}(e))return n.HIRAGANA_LETTER;if(function(e){return e>=65376&&e<=65439}(e))return n.HALFWIDTH_KATAKANA_LETTER;return n.ALPHA_LETTER},t.CharacterType=void 0;const n={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=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDestHashesEqual=r,t.isDestArraysEqual=a,t.PDFHistory=void 0;var n=i(2);function s(){return document.location.hash}function r(e,t){if("string"!=typeof e||"string"!=typeof t)return!1;if(e===t)return!0;const{nameddest:i}=(0,n.parseQueryString)(e);return i===t}function a(e,t){function i(e,t){if(typeof e!=typeof t)return!1;if(Array.isArray(e)||Array.isArray(t))return!1;if(null!==e&&"object"==typeof e&&null!==t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!i(e[n],t[n]))return!1;return!0}return e===t||Number.isNaN(e)&&Number.isNaN(t)}if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(let n=0,s=e.length;n<s;n++)if(!i(e[n],t[n]))return!1;return!0}t.PDFHistory=class{constructor({linkService:e,eventBus:t}){this.linkService=e,this.eventBus=t||(0,n.getGlobalEventBus)(),this._initialized=!1,this._fingerprint="",this.reset(),this._boundEvents=null,this._isViewerInPresentationMode=!1,this.eventBus.on("presentationmodechanged",e=>{this._isViewerInPresentationMode=e.active||e.switchInProgress}),this.eventBus.on("pagesinit",()=>{this._isPagesLoaded=!1;const e=t=>{this.eventBus.off("pagesloaded",e),this._isPagesLoaded=!!t.pagesCount};this.eventBus.on("pagesloaded",e)})}initialize({fingerprint:e,resetHistory:t=!1,updateUrl:i=!1}){if(!e||"string"!=typeof e)return void console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');this._initialized&&this.reset();const n=""!==this._fingerprint&&this._fingerprint!==e;this._fingerprint=e,this._updateUrl=!0===i,this._initialized=!0,this._bindEvents();const r=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=s(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this._isValidState(r,!0)||t){const{hash:e,page:i,rotation:s}=this._parseCurrentHash();return!e||n||t?void this._pushOrReplaceState(null,!0):void this._pushOrReplaceState({hash:e,page:i,rotation:s},!0)}const a=r.destination;this._updateInternalState(a,r.uid,!0),this._uid>this._maxUid&&(this._maxUid=this._uid),void 0!==a.rotation&&(this._initialRotation=a.rotation),a.dest?(this._initialBookmark=JSON.stringify(a.dest),this._destination.page=null):a.hash?this._initialBookmark=a.hash:a.page&&(this._initialBookmark=`page=${a.page}`)}reset(){this._initialized&&(this._pageHide(),this._initialized=!1,this._unbindEvents()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:e=null,explicitDest:t,pageNumber:i}){if(!this._initialized)return;if(e&&"string"!=typeof e)return void console.error("PDFHistory.push: "+`"${e}" is not a valid namedDest parameter.`);if(!Array.isArray(t))return void console.error("PDFHistory.push: "+`"${t}" is not a valid explicitDest parameter.`);if(!(Number.isInteger(i)&&i>0&&i<=this.linkService.pagesCount)&&(null!==i||this._destination))return void console.error("PDFHistory.push: "+`"${i}" is not a valid pageNumber parameter.`);const n=e||JSON.stringify(t);if(!n)return;let s=!1;if(this._destination&&(r(this._destination.hash,n)||a(this._destination.dest,t))){if(this._destination.page)return;s=!0}this._popStateInProgress&&!s||(this._pushOrReplaceState({dest:t,hash:n,page:i,rotation:this.linkService.rotation},s),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushCurrentPosition(){this._initialized&&!this._popStateInProgress&&this._tryPushCurrentPosition()}back(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;this._isValidState(e)&&e.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;this._isValidState(e)&&e.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}_pushOrReplaceState(e,t=!1){const i=t||!this._destination,n={fingerprint:this._fingerprint,uid:i?this._uid:this._uid+1,destination:e};let s;if(this._updateInternalState(e,n.uid),this._updateUrl&&e&&e.hash){const t=document.location.href.split("#")[0];t.startsWith("file://")||(s=`${t}#${e.hash}`)}i?window.history.replaceState(n,"",s):(this._maxUid=this._uid,window.history.pushState(n,"",s))}_tryPushCurrentPosition(e=!1){if(!this._position)return;let t=this._position;if(e&&(t=Object.assign(Object.create(null),this._position),t.temporary=!0),!this._destination)return void this._pushOrReplaceState(t);if(this._destination.temporary)return void this._pushOrReplaceState(t,!0);if(this._destination.hash===t.hash)return;if(!this._destination.page&&this._numPositionUpdates<=50)return;let i=!1;if(this._destination.page>=t.first&&this._destination.page<=t.page){if(this._destination.dest||!this._destination.first)return;i=!0}this._pushOrReplaceState(t,i)}_isValidState(e,t=!1){if(!e)return!1;if(e.fingerprint!==this._fingerprint){if(!t)return!1;{if("string"!=typeof e.fingerprint||e.fingerprint.length!==this._fingerprint.length)return!1;const[t]=performance.getEntriesByType("navigation");if(!t||"reload"!==t.type)return!1}}return!(!Number.isInteger(e.uid)||e.uid<0)&&(null!==e.destination&&"object"==typeof e.destination)}_updateInternalState(e,t,i=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),i&&e&&e.temporary&&delete e.temporary,this._destination=e,this._uid=t,this._numPositionUpdates=0}_parseCurrentHash(){const e=unescape(s()).substring(1);let t=0|(0,n.parseQueryString)(e).page;return Number.isInteger(t)&&t>0&&t<=this.linkService.pagesCount||(t=null),{hash:e,page:t,rotation:this.linkService.rotation}}_updateViewarea({location:e}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:this._isViewerInPresentationMode?`page=${e.pageNumber}`:e.pdfOpenParams.substring(1),page:this.linkService.page,first:e.pageNumber,rotation:e.rotation},this._popStateInProgress||(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||this._tryPushCurrentPosition(!0),this._updateViewareaTimeout=null},1e3))}_popState({state:e}){const t=s(),i=this._currentHash!==t;if(this._currentHash=t,!e){this._uid++;const{hash:e,page:t,rotation:i}=this._parseCurrentHash();return void this._pushOrReplaceState({hash:e,page:t,rotation:i},!0)}if(!this._isValidState(e))return;this._popStateInProgress=!0,i&&(this._blockHashChange++,(0,n.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:1e3}).then(()=>{this._blockHashChange--}));const r=e.destination;this._updateInternalState(r,e.uid,!0),this._uid>this._maxUid&&(this._maxUid=this._uid),(0,n.isValidRotation)(r.rotation)&&(this.linkService.rotation=r.rotation),r.dest?this.linkService.navigateTo(r.dest):r.hash?this.linkService.setHash(r.hash):r.page&&(this.linkService.page=r.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})}_pageHide(){this._destination&&!this._destination.temporary||this._tryPushCurrentPosition()}_bindEvents(){this._boundEvents||(this._boundEvents={updateViewarea:this._updateViewarea.bind(this),popState:this._popState.bind(this),pageHide:this._pageHide.bind(this)},this.eventBus.on("updateviewarea",this._boundEvents.updateViewarea),window.addEventListener("popstate",this._boundEvents.popState),window.addEventListener("pagehide",this._boundEvents.pageHide))}_unbindEvents(){this._boundEvents&&(this.eventBus.off("updateviewarea",this._boundEvents.updateViewarea),window.removeEventListener("popstate",this._boundEvents.popState),window.removeEventListener("pagehide",this._boundEvents.pageHide),this._boundEvents=null)}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLinkService=t.PDFLinkService=void 0;var n=i(2);t.PDFLinkService=class{constructor({eventBus:e,externalLinkTarget:t=null,externalLinkRel:i=null,externalLinkEnabled:s=!0}={}){this.eventBus=e||(0,n.getGlobalEventBus)(),this.externalLinkTarget=t,this.externalLinkRel=i,this.externalLinkEnabled=s,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null,this._pagesRefCache=null}setDocument(e,t=null){this.baseUrl=t,this.pdfDocument=e,this._pagesRefCache=Object.create(null)}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}navigateTo(e){const t=({namedDest:i,explicitDest:n})=>{const s=n[0];let r;if(s instanceof Object){if(r=this._cachedPageNumber(s),null===r)return void this.pdfDocument.getPageIndex(s).then(e=>{this.cachePageRef(e+1,s),t({namedDest:i,explicitDest:n})}).catch(()=>{console.error(`PDFLinkService.navigateTo: "${s}" is not `+`a valid page reference, for dest="${e}".`)})}else{if(!Number.isInteger(s))return void console.error(`PDFLinkService.navigateTo: "${s}" is not `+`a valid destination reference, for dest="${e}".`);r=s+1}!r||r<1||r>this.pagesCount?console.error(`PDFLinkService.navigateTo: "${r}" is not `+`a valid page number, for dest="${e}".`):(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:i,explicitDest:n,pageNumber:r})),this.pdfViewer.scrollPageIntoView({pageNumber:r,destArray:n}))};new Promise((t,i)=>{"string"!=typeof e?t({namedDest:"",explicitDest:e}):this.pdfDocument.getDestination(e).then(i=>{t({namedDest:e,explicitDest:i})})}).then(i=>{Array.isArray(i.explicitDest)?t(i):console.error(`PDFLinkService.navigateTo: "${i.explicitDest}" is`+` not a valid destination array, for dest="${e}".`)})}getDestinationHash(e){if("string"==typeof e)return this.getAnchorUrl("#"+escape(e));if(Array.isArray(e)){const t=JSON.stringify(e);return this.getAnchorUrl("#"+escape(t))}return this.getAnchorUrl("")}getAnchorUrl(e){return(this.baseUrl||"")+e}setHash(e){let t,i;if(e.includes("=")){const s=(0,n.parseQueryString)(e);if("search"in s&&this.eventBus.dispatch("findfromurlhash",{source:this,query:s.search.replace(/"/g,""),phraseSearch:"true"===s.phrase}),"nameddest"in s)return void this.navigateTo(s.nameddest);if("page"in s&&(t=0|s.page||1),"zoom"in s){const e=s.zoom.split(","),t=e[0],n=parseFloat(t);t.includes("Fit")?"Fit"===t||"FitB"===t?i=[null,{name:t}]:"FitH"===t||"FitBH"===t||"FitV"===t||"FitBV"===t?i=[null,{name:t},e.length>1?0|e[1]:null]:"FitR"===t?5!==e.length?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):i=[null,{name:t},0|e[1],0|e[2],0|e[3],0|e[4]]:console.error(`PDFLinkService.setHash: "${t}" is not `+"a valid zoom value."):i=[null,{name:"XYZ"},e.length>1?0|e[1]:null,e.length>2?0|e[2]:null,n?n/100:t]}i?this.pdfViewer.scrollPageIntoView({pageNumber:t||this.page,destArray:i,allowNegativeOffset:!0}):t&&(this.page=t),"pagemode"in s&&this.eventBus.dispatch("pagemode",{source:this,mode:s.pagemode})}else{i=unescape(e);try{i=JSON.parse(i),Array.isArray(i)||(i=i.toString())}catch(e){}if("string"==typeof i||function(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}(i))return void this.navigateTo(i);console.error(`PDFLinkService.setHash: "${unescape(e)}" is not `+"a valid destination.")}}executeNamedAction(e){switch(e){case"GoBack":this.pdfHistory&&this.pdfHistory.back();break;case"GoForward":this.pdfHistory&&this.pdfHistory.forward();break;case"NextPage":this.page<this.pagesCount&&this.page++;break;case"PrevPage":this.page>1&&this.page--;break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}this.eventBus.dispatch("namedaction",{source:this,action:e})}cachePageRef(e,t){if(!t)return;const i=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;this._pagesRefCache[i]=e}_cachedPageNumber(e){const t=0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`;return this._pagesRefCache&&this._pagesRefCache[t]||null}isPageVisible(e){return this.pdfViewer.isPageVisible(e)}};t.SimpleLinkService=class{constructor(){this.externalLinkTarget=null,this.externalLinkRel=null,this.externalLinkEnabled=!0}get pagesCount(){return 0}get page(){return 0}set page(e){}get rotation(){return 0}set rotation(e){}navigateTo(e){}getDestinationHash(e){return"#"}getAnchorUrl(e){return"#"}setHash(e){}executeNamedAction(e){}cachePageRef(e,t){}isPageVisible(e){return!0}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFOutlineViewer=void 0;var n=i(4);t.PDFOutlineViewer=class{constructor({container:e,linkService:t,eventBus:i}){this.container=e,this.linkService=t,this.eventBus=i,this.reset(),i.on("toggleoutlinetree",this.toggleOutlineTree.bind(this))}reset(){this.outline=null,this.lastToggleIsShow=!0,this.container.textContent="",this.container.classList.remove("outlineWithDeepNesting")}_dispatchEvent(e){this.eventBus.dispatch("outlineloaded",{source:this,outlineCount:e})}_bindLink(e,{url:t,newWindow:i,dest:s}){const{linkService:r}=this;t?(0,n.addLinkAttributes)(e,{url:t,target:i?n.LinkTarget.BLANK:r.externalLinkTarget,rel:r.externalLinkRel,enabled:r.externalLinkEnabled}):(e.href=r.getDestinationHash(s),e.onclick=()=>(s&&r.navigateTo(s),!1))}_setStyles(e,{bold:t,italic:i}){t&&(e.style.fontWeight="bold"),i&&(e.style.fontStyle="italic")}_addToggleButton(e,{count:t,items:i}){const n=document.createElement("div");n.className="outlineItemToggler",t<0&&Math.abs(t)===i.length&&n.classList.add("outlineItemsHidden"),n.onclick=t=>{if(t.stopPropagation(),n.classList.toggle("outlineItemsHidden"),t.shiftKey){const t=!n.classList.contains("outlineItemsHidden");this._toggleOutlineItem(e,t)}},e.insertBefore(n,e.firstChild)}_toggleOutlineItem(e,t=!1){this.lastToggleIsShow=t;for(const i of e.querySelectorAll(".outlineItemToggler"))i.classList.toggle("outlineItemsHidden",!t)}toggleOutlineTree(){this.outline&&this._toggleOutlineItem(this.container,!this.lastToggleIsShow)}render({outline:e}){let t=0;if(this.outline&&this.reset(),this.outline=e||null,!e)return void this._dispatchEvent(t);const i=document.createDocumentFragment(),s=[{parent:i,items:this.outline}];let r=!1;for(;s.length>0;){const e=s.shift();for(const i of e.items){const a=document.createElement("div");a.className="outlineItem";const o=document.createElement("a");if(this._bindLink(o,i),this._setStyles(o,i),o.textContent=(0,n.removeNullCharacters)(i.title)||"–",a.appendChild(o),i.items.length>0){r=!0,this._addToggleButton(a,i);const e=document.createElement("div");e.className="outlineItems",a.appendChild(e),s.push({parent:e,items:i.items})}e.parent.appendChild(a),t++}}r&&(this.container.classList.add("outlineWithDeepNesting"),this.lastToggleIsShow=0===i.querySelectorAll(".outlineItemsHidden").length),this.container.appendChild(i),this._dispatchEvent(t)}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFPresentationMode=void 0;var n=i(2);const s=Math.PI/6;t.PDFPresentationMode=class{constructor({container:e,pdfViewer:t,eventBus:i,contextMenuItems:n=null}){this.container=e,this.pdfViewer=t,this.eventBus=i,this.active=!1,this.args=null,this.contextMenuOpen=!1,this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0,this.touchSwipeState=null,n&&(n.contextFirstPage.addEventListener("click",()=>{this.contextMenuOpen=!1,this.eventBus.dispatch("firstpage",{source:this})}),n.contextLastPage.addEventListener("click",()=>{this.contextMenuOpen=!1,this.eventBus.dispatch("lastpage",{source:this})}),n.contextPageRotateCw.addEventListener("click",()=>{this.contextMenuOpen=!1,this.eventBus.dispatch("rotatecw",{source:this})}),n.contextPageRotateCcw.addEventListener("click",()=>{this.contextMenuOpen=!1,this.eventBus.dispatch("rotateccw",{source:this})}))}request(){if(this.switchInProgress||this.active||!this.pdfViewer.pagesCount)return!1;if(this._addFullscreenChangeListeners(),this._setSwitchInProgress(),this._notifyStateChange(),this.container.requestFullscreen)this.container.requestFullscreen();else if(this.container.mozRequestFullScreen)this.container.mozRequestFullScreen();else if(this.container.webkitRequestFullscreen)this.container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);else{if(!this.container.msRequestFullscreen)return!1;this.container.msRequestFullscreen()}return this.args={page:this.pdfViewer.currentPageNumber,previousScale:this.pdfViewer.currentScaleValue},!0}_mouseWheel(e){if(!this.active)return;e.preventDefault();const t=(0,n.normalizeWheelEventDelta)(e),i=(new Date).getTime(),s=this.mouseScrollTimeStamp;if(!(i>s&&i-s<50)&&((this.mouseScrollDelta>0&&t<0||this.mouseScrollDelta<0&&t>0)&&this._resetMouseScrollState(),this.mouseScrollDelta+=t,Math.abs(this.mouseScrollDelta)>=.1)){const e=this.mouseScrollDelta;this._resetMouseScrollState(),(e>0?this._goToPreviousPage():this._goToNextPage())&&(this.mouseScrollTimeStamp=i)}}get isFullscreen(){return!!(document.fullscreenElement||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement)}_goToPreviousPage(){const e=this.pdfViewer.currentPageNumber;return!(e<=1)&&(this.pdfViewer.currentPageNumber=e-1,!0)}_goToNextPage(){const e=this.pdfViewer.currentPageNumber;return!(e>=this.pdfViewer.pagesCount)&&(this.pdfViewer.currentPageNumber=e+1,!0)}_notifyStateChange(){this.eventBus.dispatch("presentationmodechanged",{source:this,active:this.active,switchInProgress:!!this.switchInProgress})}_setSwitchInProgress(){this.switchInProgress&&clearTimeout(this.switchInProgress),this.switchInProgress=setTimeout(()=>{this._removeFullscreenChangeListeners(),delete this.switchInProgress,this._notifyStateChange()},1500)}_resetSwitchInProgress(){this.switchInProgress&&(clearTimeout(this.switchInProgress),delete this.switchInProgress)}_enter(){this.active=!0,this._resetSwitchInProgress(),this._notifyStateChange(),this.container.classList.add("pdfPresentationMode"),setTimeout(()=>{this.pdfViewer.currentPageNumber=this.args.page,this.pdfViewer.currentScaleValue="page-fit"},0),this._addWindowListeners(),this._showControls(),this.contextMenuOpen=!1,this.container.setAttribute("contextmenu","viewerContextMenu"),window.getSelection().removeAllRanges()}_exit(){const e=this.pdfViewer.currentPageNumber;this.container.classList.remove("pdfPresentationMode"),setTimeout(()=>{this.active=!1,this._removeFullscreenChangeListeners(),this._notifyStateChange(),this.pdfViewer.currentScaleValue=this.args.previousScale,this.pdfViewer.currentPageNumber=e,this.args=null},0),this._removeWindowListeners(),this._hideControls(),this._resetMouseScrollState(),this.container.removeAttribute("contextmenu"),this.contextMenuOpen=!1}_mouseDown(e){if(this.contextMenuOpen)return this.contextMenuOpen=!1,void e.preventDefault();if(0===e.button){e.target.href&&e.target.classList.contains("internalLink")||(e.preventDefault(),e.shiftKey?this._goToPreviousPage():this._goToNextPage())}}_contextMenu(){this.contextMenuOpen=!0}_showControls(){this.controlsTimeout?clearTimeout(this.controlsTimeout):this.container.classList.add("pdfPresentationModeControls"),this.controlsTimeout=setTimeout(()=>{this.container.classList.remove("pdfPresentationModeControls"),delete this.controlsTimeout},3e3)}_hideControls(){this.controlsTimeout&&(clearTimeout(this.controlsTimeout),this.container.classList.remove("pdfPresentationModeControls"),delete this.controlsTimeout)}_resetMouseScrollState(){this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0}_touchSwipe(e){if(this.active)if(e.touches.length>1)this.touchSwipeState=null;else switch(e.type){case"touchstart":this.touchSwipeState={startX:e.touches[0].pageX,startY:e.touches[0].pageY,endX:e.touches[0].pageX,endY:e.touches[0].pageY};break;case"touchmove":if(null===this.touchSwipeState)return;this.touchSwipeState.endX=e.touches[0].pageX,this.touchSwipeState.endY=e.touches[0].pageY,e.preventDefault();break;case"touchend":if(null===this.touchSwipeState)return;let t=0;const i=this.touchSwipeState.endX-this.touchSwipeState.startX,n=this.touchSwipeState.endY-this.touchSwipeState.startY,r=Math.abs(Math.atan2(n,i));Math.abs(i)>50&&(r<=s||r>=Math.PI-s)?t=i:Math.abs(n)>50&&Math.abs(r-Math.PI/2)<=s&&(t=n),t>0?this._goToPreviousPage():t<0&&this._goToNextPage()}}_addWindowListeners(){this.showControlsBind=this._showControls.bind(this),this.mouseDownBind=this._mouseDown.bind(this),this.mouseWheelBind=this._mouseWheel.bind(this),this.resetMouseScrollStateBind=this._resetMouseScrollState.bind(this),this.contextMenuBind=this._contextMenu.bind(this),this.touchSwipeBind=this._touchSwipe.bind(this),window.addEventListener("mousemove",this.showControlsBind),window.addEventListener("mousedown",this.mouseDownBind),window.addEventListener("wheel",this.mouseWheelBind),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)}_removeWindowListeners(){window.removeEventListener("mousemove",this.showControlsBind),window.removeEventListener("mousedown",this.mouseDownBind),window.removeEventListener("wheel",this.mouseWheelBind),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}_fullscreenChange(){this.isFullscreen?this._enter():this._exit()}_addFullscreenChangeListeners(){this.fullscreenChangeBind=this._fullscreenChange.bind(this),window.addEventListener("fullscreenchange",this.fullscreenChangeBind),window.addEventListener("mozfullscreenchange",this.fullscreenChangeBind),window.addEventListener("webkitfullscreenchange",this.fullscreenChangeBind),window.addEventListener("MSFullscreenChange",this.fullscreenChangeBind)}_removeFullscreenChangeListeners(){window.removeEventListener("fullscreenchange",this.fullscreenChangeBind),window.removeEventListener("mozfullscreenchange",this.fullscreenChangeBind),window.removeEventListener("webkitfullscreenchange",this.fullscreenChangeBind),window.removeEventListener("MSFullscreenChange",this.fullscreenChangeBind),delete this.fullscreenChangeBind}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFSidebarResizer=void 0;var n=i(2);t.PDFSidebarResizer=class{constructor(e,t,i=n.NullL10n){this.enabled=!1,this.isRTL=!1,this.sidebarOpen=!1,this.doc=document.documentElement,this._width=null,this._outerContainerWidth=null,this._boundEvents=Object.create(null),this.outerContainer=e.outerContainer,this.resizer=e.resizer,this.eventBus=t,this.l10n=i,"undefined"!=typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("--sidebar-width","calc(-1 * 200px)")?(this.enabled=!0,this.resizer.classList.remove("hidden"),this.l10n.getDirection().then(e=>{this.isRTL="rtl"===e}),this._addEventListeners()):console.warn("PDFSidebarResizer: The browser does not support resizing of the sidebar.")}get outerContainerWidth(){return this._outerContainerWidth||(this._outerContainerWidth=this.outerContainer.clientWidth),this._outerContainerWidth}_updateWidth(e=0){if(!this.enabled)return!1;const t=(0,n.clamp)(e,200,Math.floor(this.outerContainerWidth/2));return t!==this._width&&(this._width=t,this.doc.style.setProperty("--sidebar-width",`${t}px`),!0)}_mouseMove(e){let t=e.clientX;this.isRTL&&(t=this.outerContainerWidth-t),this._updateWidth(t)}_mouseUp(e){this.outerContainer.classList.remove("sidebarResizing"),this.eventBus.dispatch("resize",{source:this});const t=this._boundEvents;window.removeEventListener("mousemove",t.mouseMove),window.removeEventListener("mouseup",t.mouseUp)}_addEventListeners(){if(!this.enabled)return;const e=this._boundEvents;e.mouseMove=this._mouseMove.bind(this),e.mouseUp=this._mouseUp.bind(this),this.resizer.addEventListener("mousedown",t=>{0===t.button&&(this.outerContainer.classList.add("sidebarResizing"),window.addEventListener("mousemove",e.mouseMove),window.addEventListener("mouseup",e.mouseUp))}),this.eventBus.on("sidebarviewchanged",e=>{this.sidebarOpen=!(!e||!e.view)}),this.eventBus.on("resize",e=>{if(!e||e.source!==window)return;if(this._outerContainerWidth=null,!this._width)return;if(!this.sidebarOpen)return void this._updateWidth(this._width);this.outerContainer.classList.add("sidebarResizing");const t=this._updateWidth(this._width);Promise.resolve().then(()=>{this.outerContainer.classList.remove("sidebarResizing"),t&&this.eventBus.dispatch("resize",{source:this})})})}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFThumbnailViewer=void 0;var n=i(2),s=i(23);t.PDFThumbnailViewer=class{constructor({container:e,linkService:t,renderingQueue:i,l10n:s=n.NullL10n}){this.container=e,this.linkService=t,this.renderingQueue=i,this.l10n=s,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)(this.container,this._thumbnails)}scrollThumbnailIntoView(e){if(!this.pdfDocument)return;const t=this._thumbnails[e-1];if(!t)return void console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.');if(e!==this._currentPageNumber){this._thumbnails[this._currentPageNumber-1].div.classList.remove("selected"),t.div.classList.add("selected")}const i=this._getVisibleThumbs(),s=i.views.length;if(s>0){const r=i.first.id,a=s>1?i.last.id:r;let o=!1;e<=r||e>=a?o=!0:i.views.some((function(t){return t.id===e&&(o=t.percent<100,!0)})),o&&(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&&this._pagesRotation!==e){this._pagesRotation=e;for(let t=0,i=this._thumbnails.length;t<i;t++)this._thumbnails[t].update(e)}}cleanup(){s.PDFThumbnailView.cleanup()}_resetView(){this._thumbnails=[],this._currentPageNumber=1,this._pageLabels=null,this._pagesRotation=0,this._pagesRequests=new WeakMap,this.container.textContent=""}setDocument(e){this.pdfDocument&&(this._cancelRendering(),this._resetView()),this.pdfDocument=e,e&&e.getPage(1).then(t=>{const i=e.numPages,n=t.getViewport({scale:1});for(let e=1;e<=i;++e){const t=new s.PDFThumbnailView({container:this.container,id:e,defaultViewport:n.clone(),linkService:this.linkService,renderingQueue:this.renderingQueue,disableCanvasToImageConversion:!1,l10n:this.l10n});this._thumbnails.push(t)}const r=this._thumbnails[0];r&&r.setPdfPage(t),this._thumbnails[this._currentPageNumber-1].div.classList.add("selected")}).catch(e=>{console.error("Unable to initialize thumbnail viewer",e)})}_cancelRendering(){for(let e=0,t=this._thumbnails.length;e<t;e++)this._thumbnails[e]&&this._thumbnails[e].cancelRendering()}setPageLabels(e){if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=null,console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let e=0,t=this._thumbnails.length;e<t;e++){const t=this._pageLabels&&this._pageLabels[e];this._thumbnails[e].setPageLabel(t)}}}_ensurePdfPageLoaded(e){if(e.pdfPage)return Promise.resolve(e.pdfPage);if(this._pagesRequests.has(e))return this._pagesRequests.get(e);const t=this.pdfDocument.getPage(e.id).then(t=>(e.pdfPage||e.setPdfPage(t),this._pagesRequests.delete(e),t)).catch(t=>{console.error("Unable to get page for thumb view",t),this._pagesRequests.delete(e)});return this._pagesRequests.set(e,t),t}forceRendering(){const e=this._getVisibleThumbs(),t=this.renderingQueue.getHighestPriority(e,this._thumbnails,this.scroll.down);return!!t&&(this._ensurePdfPageLoaded(t).then(()=>{this.renderingQueue.renderView(t)}),!0)}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFThumbnailView=void 0;var n=i(4),s=i(2),r=i(8);const a=function(){let e=null;return{getCanvas(t,i){let n=e;n||(n=document.createElement("canvas"),e=n),n.width=t,n.height=i,n.mozOpaque=!0;const s=n.getContext("2d",{alpha:!1});return s.save(),s.fillStyle="rgb(255, 255, 255)",s.fillRect(0,0,t,i),s.restore(),n},destroyCanvas(){const t=e;t&&(t.width=0,t.height=0),e=null}}}();t.PDFThumbnailView=class{constructor({container:e,id:t,defaultViewport:i,linkService:n,renderingQueue:a,disableCanvasToImageConversion:o=!1,l10n:l=s.NullL10n}){this.id=t,this.renderingId="thumbnail"+t,this.pageLabel=null,this.pdfPage=null,this.rotation=0,this.viewport=i,this.pdfPageRotate=i.rotation,this.linkService=n,this.renderingQueue=a,this.renderTask=null,this.renderingState=r.RenderingStates.INITIAL,this.resume=null,this.disableCanvasToImageConversion=o,this.pageWidth=this.viewport.width,this.pageHeight=this.viewport.height,this.pageRatio=this.pageWidth/this.pageHeight,this.canvasWidth=98,this.canvasHeight=this.canvasWidth/this.pageRatio|0,this.scale=this.canvasWidth/this.pageWidth,this.l10n=l;const h=document.createElement("a");h.href=n.getAnchorUrl("#page="+t),this._thumbPageTitle.then(e=>{h.title=e}),h.onclick=function(){return n.page=t,!1},this.anchor=h;const c=document.createElement("div");c.className="thumbnail",c.setAttribute("data-page-number",this.id),this.div=c;const d=document.createElement("div");d.className="thumbnailSelectionRing";d.style.width=this.canvasWidth+2+"px",d.style.height=this.canvasHeight+2+"px",this.ring=d,c.appendChild(d),h.appendChild(c),e.appendChild(h)}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=r.RenderingStates.INITIAL,this.pageWidth=this.viewport.width,this.pageHeight=this.viewport.height,this.pageRatio=this.pageWidth/this.pageHeight,this.canvasHeight=this.canvasWidth/this.pageRatio|0,this.scale=this.canvasWidth/this.pageWidth,this.div.removeAttribute("data-loaded");const e=this.ring,t=e.childNodes;for(let i=t.length-1;i>=0;i--)e.removeChild(t[i]);e.style.width=this.canvasWidth+2+"px",e.style.height=this.canvasHeight+2+"px",this.canvas&&(this.canvas.width=0,this.canvas.height=0,delete this.canvas),this.image&&(this.image.removeAttribute("src"),delete this.image)}update(e){void 0!==e&&(this.rotation=e);const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:1,rotation:t}),this.reset()}cancelRendering(){this.renderTask&&(this.renderTask.cancel(),this.renderTask=null),this.resume=null}_getPageDrawContext(e=!1){const t=document.createElement("canvas");this.canvas=t,t.mozOpaque=!0;const i=t.getContext("2d",{alpha:!1}),n=(0,s.getOutputScale)(i);return t.width=this.canvasWidth*n.sx|0,t.height=this.canvasHeight*n.sy|0,t.style.width=this.canvasWidth+"px",t.style.height=this.canvasHeight+"px",!e&&n.scaled&&i.scale(n.sx,n.sy),i}_convertCanvasToImage(){if(!this.canvas)return;if(this.renderingState!==r.RenderingStates.FINISHED)return;if(this.disableCanvasToImageConversion)return this.canvas.className="thumbnailImage",this._thumbPageCanvas.then(e=>{this.canvas.setAttribute("aria-label",e)}),this.div.setAttribute("data-loaded",!0),void this.ring.appendChild(this.canvas);const e=document.createElement("img");e.className="thumbnailImage",this._thumbPageCanvas.then(t=>{e.setAttribute("aria-label",t)}),e.style.width=this.canvasWidth+"px",e.style.height=this.canvasHeight+"px",e.src=this.canvas.toDataURL(),this.image=e,this.div.setAttribute("data-loaded",!0),this.ring.appendChild(e),this.canvas.width=0,this.canvas.height=0,delete this.canvas}draw(){if(this.renderingState!==r.RenderingStates.INITIAL)return console.error("Must be in new state before drawing"),Promise.resolve(void 0);this.renderingState=r.RenderingStates.RUNNING;const e=(0,n.createPromiseCapability)(),t=t=>{s===this.renderTask&&(this.renderTask=null),t instanceof n.RenderingCancelledException?e.resolve(void 0):(this.renderingState=r.RenderingStates.FINISHED,this._convertCanvasToImage(),t?e.reject(t):e.resolve(void 0))},i={canvasContext:this._getPageDrawContext(),viewport:this.viewport.clone({scale:this.scale})},s=this.renderTask=this.pdfPage.render(i);return s.onContinue=e=>{if(!this.renderingQueue.isHighestPriority(this))return this.renderingState=r.RenderingStates.PAUSED,void(this.resume=()=>{this.renderingState=r.RenderingStates.RUNNING,e()});e()},s.promise.then((function(){t(null)}),(function(e){t(e)})),e.promise}setImage(e){if(this.renderingState!==r.RenderingStates.INITIAL)return;const t=e.canvas;if(!t)return;this.pdfPage||this.setPdfPage(e.pdfPage),this.renderingState=r.RenderingStates.FINISHED;const i=this._getPageDrawContext(!0),n=i.canvas;if(t.width<=2*n.width)return i.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height),void this._convertCanvasToImage();let s=n.width<<3,o=n.height<<3;const l=a.getCanvas(s,o),h=l.getContext("2d");for(;s>t.width||o>t.height;)s>>=1,o>>=1;for(h.drawImage(t,0,0,t.width,t.height,0,0,s,o);s>2*n.width;)h.drawImage(l,0,0,s,o,0,0,s>>1,o>>1),s>>=1,o>>=1;i.drawImage(l,0,0,s,o,0,0,n.width,n.height),this._convertCanvasToImage()}get _thumbPageTitle(){return this.l10n.get("thumb_page_title",{page:null!==this.pageLabel?this.pageLabel:this.id},"Page {{page}}")}get _thumbPageCanvas(){return this.l10n.get("thumb_page_canvas",{page:null!==this.pageLabel?this.pageLabel:this.id},"Thumbnail of Page {{page}}")}setPageLabel(e){this.pageLabel="string"==typeof e?e:null,this._thumbPageTitle.then(e=>{this.anchor.title=e}),this.renderingState===r.RenderingStates.FINISHED&&this._thumbPageCanvas.then(e=>{this.image?this.image.setAttribute("aria-label",e):this.disableCanvasToImageConversion&&this.canvas&&this.canvas.setAttribute("aria-label",e)})}static cleanup(){a.destroyCanvas()}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFViewer=void 0;var n=i(25),s=i(4);class r extends n.BaseViewer{get _setDocumentViewerElement(){return(0,s.shadow)(this,"_setDocumentViewerElement",this.viewer)}_scrollIntoView({pageDiv:e,pageSpot:t=null,pageNumber:i=null}){if(!t&&!this.isInPresentationMode){const i=e.offsetLeft+e.clientLeft,n=i+e.clientWidth,{scrollLeft:s,clientWidth:r}=this.container;(this._isScrollModeHorizontal||i<s||n>s+r)&&(t={left:0,top:0})}super._scrollIntoView({pageDiv:e,pageSpot:t,pageNumber:i})}_getVisiblePages(){return this.isInPresentationMode?this._getCurrentVisiblePage():super._getVisiblePages()}_updateHelper(e){if(this.isInPresentationMode)return;let t=this._currentPageNumber,i=!1;for(const n of e){if(n.percent<100)break;if(n.id===t){i=!0;break}}i||(t=e[0].id),this._setCurrentPageNumber(t)}}t.PDFViewer=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseViewer=void 0;var n=i(2),s=i(8),r=i(26),a=i(4),o=i(27),l=i(18),h=i(28);function c(e){const t=[];this.push=function(i){const n=t.indexOf(i);n>=0&&t.splice(n,1),t.push(i),t.length>e&&t.shift().destroy()},this.resize=function(i,s){if(e=i,s){const e=new Set;for(let t=0,i=s.length;t<i;++t)e.add(s[t].id);(0,n.moveToEndOfArray)(t,(function(t){return e.has(t.id)}))}for(;t.length>e;)t.shift().destroy()}}class d{constructor(e){if(this.constructor===d)throw new Error("Cannot initialize BaseViewer.");this._name=this.constructor.name,this.container=e.container,this.viewer=e.viewer||e.container.firstElementChild,this.eventBus=e.eventBus||(0,n.getGlobalEventBus)(),this.linkService=e.linkService||new l.SimpleLinkService,this.downloadManager=e.downloadManager||null,this.findController=e.findController||null,this.removePageBorders=e.removePageBorders||!1,this.textLayerMode=Number.isInteger(e.textLayerMode)?e.textLayerMode:n.TextLayerMode.ENABLE,this.imageResourcesPath=e.imageResourcesPath||"",this.renderInteractiveForms=e.renderInteractiveForms||!1,this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1,this.renderer=e.renderer||n.RendererType.CANVAS,this.enableWebGL=e.enableWebGL||!1,this.useOnlyCssZoom=e.useOnlyCssZoom||!1,this.maxCanvasPixels=e.maxCanvasPixels,this.l10n=e.l10n||n.NullL10n,this.defaultRenderingQueue=!e.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new s.PDFRenderingQueue,this.renderingQueue.setViewer(this)):this.renderingQueue=e.renderingQueue,this.scroll=(0,n.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=n.PresentationModeState.UNKNOWN,this._onBeforeDraw=this._onAfterDraw=null,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),Promise.resolve().then(()=>{this.eventBus.dispatch("baseviewerinit",{source:this})})}get pagesCount(){return this._pages.length}getPageView(e){return this._pages[e]}get pageViewsReady(){return!!this._pageViewsReady&&this._pages.every((function(e){return!(!e||!e.pdfPage)}))}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(e){if(!Number.isInteger(e))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(e,!0)||console.error(`${this._name}.currentPageNumber: "${e}" is not a valid page.`))}_setCurrentPageNumber(e,t=!1){return this._currentPageNumber===e?(t&&this._resetCurrentPageView(),!0):0<e&&e<=this.pagesCount&&(this._currentPageNumber=e,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:e,pageLabel:this._pageLabels&&this._pageLabels[e-1]}),t&&this._resetCurrentPageView(),!0)}get currentPageLabel(){return this._pageLabels&&this._pageLabels[this._currentPageNumber-1]}set currentPageLabel(e){if(!this.pdfDocument)return;let t=0|e;if(this._pageLabels){const i=this._pageLabels.indexOf(e);i>=0&&(t=i+1)}this._setCurrentPageNumber(t,!0)||console.error(`${this._name}.currentPageLabel: "${e}" is not a valid page.`)}get currentScale(){return this._currentScale!==n.UNKNOWN_SCALE?this._currentScale:n.DEFAULT_SCALE}set currentScale(e){if(isNaN(e))throw new Error("Invalid numeric scale.");this.pdfDocument&&this._setScale(e,!1)}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(e){this.pdfDocument&&this._setScale(e,!1)}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!(0,n.isValidRotation)(e))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument)return;if(this._pagesRotation===e)return;this._pagesRotation=e;const t=this._currentPageNumber;for(let t=0,i=this._pages.length;t<i;t++){const i=this._pages[t];i.update(i.scale,e)}this._currentScaleValue&&this._setScale(this._currentScaleValue,!0),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:e,pageNumber:t}),this.defaultRenderingQueue&&this.update()}get _setDocumentViewerElement(){throw new Error("Not implemented: _setDocumentViewerElement")}setDocument(e){if(this.pdfDocument&&(this._cancelRendering(),this._resetView(),this.findController&&this.findController.setDocument(null)),this.pdfDocument=e,!e)return;const t=e.numPages,i=(0,a.createPromiseCapability)();this.pagesPromise=i.promise,i.promise.then(()=>{this._pageViewsReady=!0,this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:t})});const s=(0,a.createPromiseCapability)();this.onePageRendered=s.promise;const r=e.getPage(1);this.firstPagePromise=r,this._onBeforeDraw=e=>{const t=this._pages[e.pageNumber-1];t&&this._buffer.push(t)},this.eventBus.on("pagerender",this._onBeforeDraw),this._onAfterDraw=e=>{e.cssTransform||s.settled||(s.resolve(),this.eventBus.off("pagerendered",this._onAfterDraw),this._onAfterDraw=null)},this.eventBus.on("pagerendered",this._onAfterDraw),r.then(r=>{const a=this.currentScale,l=r.getViewport({scale:a*n.CSS_UNITS});for(let e=1;e<=t;++e){let t=null;this.textLayerMode!==n.TextLayerMode.DISABLE&&(t=this);const i=new o.PDFPageView({container:this._setDocumentViewerElement,eventBus:this.eventBus,id:e,scale:a,defaultViewport:l.clone(),renderingQueue:this.renderingQueue,textLayerFactory:t,textLayerMode:this.textLayerMode,annotationLayerFactory:this,imageResourcesPath:this.imageResourcesPath,renderInteractiveForms:this.renderInteractiveForms,renderer:this.renderer,enableWebGL:this.enableWebGL,useOnlyCssZoom:this.useOnlyCssZoom,maxCanvasPixels:this.maxCanvasPixels,l10n:this.l10n});this._pages.push(i)}const h=this._pages[0];h&&(h.setPdfPage(r),this.linkService.cachePageRef(1,r.ref)),this._spreadMode!==n.SpreadMode.NONE&&this._updateSpreadMode(),s.promise.then(()=>{if(this.findController&&this.findController.setDocument(e),e.loadingParams.disableAutoFetch||t>7500)return void i.resolve();let n=t-1;if(n<=0)i.resolve();else for(let s=2;s<=t;++s)e.getPage(s).then(e=>{const t=this._pages[s-1];t.pdfPage||t.setPdfPage(e),this.linkService.cachePageRef(s,e.ref),0==--n&&i.resolve()},e=>{console.error(`Unable to get page ${s} to initialize viewer`,e),0==--n&&i.resolve()})}),this.eventBus.dispatch("pagesinit",{source:this}),this.defaultRenderingQueue&&this.update()}).catch(e=>{console.error("Unable to initialize viewer",e)})}setPageLabels(e){if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=null,console.error(`${this._name}.setPageLabels: Invalid page labels.`)):this._pageLabels=null;for(let e=0,t=this._pages.length;e<t;e++){const t=this._pages[e],i=this._pageLabels&&this._pageLabels[e];t.setPageLabel(i)}}}_resetView(){this._pages=[],this._currentPageNumber=1,this._currentScale=n.UNKNOWN_SCALE,this._currentScaleValue=null,this._pageLabels=null,this._buffer=new c(10),this._location=null,this._pagesRotation=0,this._pagesRequests=new WeakMap,this._pageViewsReady=!1,this._scrollMode=n.ScrollMode.VERTICAL,this._spreadMode=n.SpreadMode.NONE,this._onBeforeDraw&&(this.eventBus.off("pagerender",this._onBeforeDraw),this._onBeforeDraw=null),this._onAfterDraw&&(this.eventBus.off("pagerendered",this._onAfterDraw),this._onAfterDraw=null),this.viewer.textContent="",this._updateScrollMode()}_scrollUpdate(){0!==this.pagesCount&&this.update()}_scrollIntoView({pageDiv:e,pageSpot:t=null,pageNumber:i=null}){(0,n.scrollIntoView)(e,t)}_setScaleUpdatePages(e,t,i=!1,n=!1){if(this._currentScaleValue=t.toString(),function(e,t){return t===e||Math.abs(t-e)<1e-15}(this._currentScale,e))n&&this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:t});else{for(let t=0,i=this._pages.length;t<i;t++)this._pages[t].update(e);if(this._currentScale=e,!i){let e,t=this._currentPageNumber;!this._location||this.isInPresentationMode||this.isChangingPresentationMode||(t=this._location.pageNumber,e=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:t,destArray:e,allowNegativeOffset:!0})}this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:n?t:void 0}),this.defaultRenderingQueue&&this.update()}}_setScale(e,t=!1){let i=parseFloat(e);if(i>0)this._setScaleUpdatePages(i,e,t,!1);else{const s=this._pages[this._currentPageNumber-1];if(!s)return;const r=this.isInPresentationMode||this.removePageBorders;let a=r?0:n.SCROLLBAR_PADDING,o=r?0:n.VERTICAL_PADDING;!r&&this._isScrollModeHorizontal&&([a,o]=[o,a]);const l=(this.container.clientWidth-a)/s.width*s.scale,h=(this.container.clientHeight-o)/s.height*s.scale;switch(e){case"page-actual":i=1;break;case"page-width":i=l;break;case"page-height":i=h;break;case"page-fit":i=Math.min(l,h);break;case"auto":const t=(0,n.isPortraitOrientation)(s)?l:Math.min(h,l);i=Math.min(n.MAX_AUTO_SCALE,t);break;default:return void console.error(`${this._name}._setScale: "${e}" is an unknown zoom value.`)}this._setScaleUpdatePages(i,e,t,!0)}}_resetCurrentPageView(){this.isInPresentationMode&&this._setScale(this._currentScaleValue,!0);const e=this._pages[this._currentPageNumber-1];this._scrollIntoView({pageDiv:e.div})}scrollPageIntoView({pageNumber:e,destArray:t=null,allowNegativeOffset:i=!1}){if(!this.pdfDocument)return;const s=Number.isInteger(e)&&this._pages[e-1];if(!s)return void console.error(`${this._name}.scrollPageIntoView: `+`"${e}" is not a valid pageNumber parameter.`);if(this.isInPresentationMode||!t)return void this._setCurrentPageNumber(e,!0);let r,a,o=0,l=0,h=0,c=0;const d=s.rotation%180!=0,u=(d?s.height:s.width)/s.scale/n.CSS_UNITS,p=(d?s.width:s.height)/s.scale/n.CSS_UNITS;let g=0;switch(t[1].name){case"XYZ":o=t[2],l=t[3],g=t[4],o=null!==o?o:0,l=null!==l?l:p;break;case"Fit":case"FitB":g="page-fit";break;case"FitH":case"FitBH":l=t[2],g="page-width",null===l&&this._location&&(o=this._location.left,l=this._location.top);break;case"FitV":case"FitBV":o=t[2],h=u,c=p,g="page-height";break;case"FitR":o=t[2],l=t[3],h=t[4]-o,c=t[5]-l;const e=this.removePageBorders?0:n.SCROLLBAR_PADDING,i=this.removePageBorders?0:n.VERTICAL_PADDING;r=(this.container.clientWidth-e)/h/n.CSS_UNITS,a=(this.container.clientHeight-i)/c/n.CSS_UNITS,g=Math.min(Math.abs(r),Math.abs(a));break;default:return void console.error(`${this._name}.scrollPageIntoView: `+`"${t[1].name}" is not a valid destination type.`)}if(g&&g!==this._currentScale?this.currentScaleValue=g:this._currentScale===n.UNKNOWN_SCALE&&(this.currentScaleValue=n.DEFAULT_SCALE_VALUE),"page-fit"===g&&!t[4])return void this._scrollIntoView({pageDiv:s.div,pageNumber:e});const f=[s.viewport.convertToViewportPoint(o,l),s.viewport.convertToViewportPoint(o+h,l+c)];let m=Math.min(f[0][0],f[1][0]),v=Math.min(f[0][1],f[1][1]);i||(m=Math.max(m,0),v=Math.max(v,0)),this._scrollIntoView({pageDiv:s.div,pageSpot:{left:m,top:v},pageNumber:e})}_updateLocation(e){const t=this._currentScale,i=this._currentScaleValue,n=parseFloat(i)===t?Math.round(1e4*t)/100:i,s=e.id;let r="#page="+s;r+="&zoom="+n;const a=this._pages[s-1],o=this.container,l=a.getPagePoint(o.scrollLeft-e.x,o.scrollTop-e.y),h=Math.round(l[0]),c=Math.round(l[1]);r+=","+h+","+c,this._location={pageNumber:s,scale:n,top:c,left:h,rotation:this._pagesRotation,pdfOpenParams:r}}_updateHelper(e){throw new Error("Not implemented: _updateHelper")}update(){const e=this._getVisiblePages(),t=e.views,i=t.length;if(0===i)return;const n=Math.max(10,2*i+1);this._buffer.resize(n,t),this.renderingQueue.renderHighestPriority(e),this._updateHelper(t),this._updateLocation(e.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(e){return this.container.contains(e)}focus(){this.container.focus()}get _isScrollModeHorizontal(){return!this.isInPresentationMode&&this._scrollMode===n.ScrollMode.HORIZONTAL}get isInPresentationMode(){return this.presentationModeState===n.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===n.PresentationModeState.CHANGING}get isHorizontalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollHeight>this.container.clientHeight}_getCurrentVisiblePage(){if(!this.pagesCount)return{views:[]};const e=this._pages[this._currentPageNumber-1],t=e.div,i={id:e.id,x:t.offsetLeft+t.clientLeft,y:t.offsetTop+t.clientTop,view:e};return{first:i,last:i,views:[i]}}_getVisiblePages(){return(0,n.getVisibleElements)(this.container,this._pages,!0,this._isScrollModeHorizontal)}isPageVisible(e){return!!this.pdfDocument&&(e<1||e>this.pagesCount?(console.error(`${this._name}.isPageVisible: "${e}" is out of bounds.`),!1):this._getVisiblePages().views.some((function(t){return t.id===e})))}cleanup(){for(let e=0,t=this._pages.length;e<t;e++)this._pages[e]&&this._pages[e].renderingState!==s.RenderingStates.FINISHED&&this._pages[e].reset()}_cancelRendering(){for(let e=0,t=this._pages.length;e<t;e++)this._pages[e]&&this._pages[e].cancelRendering()}_ensurePdfPageLoaded(e){if(e.pdfPage)return Promise.resolve(e.pdfPage);if(this._pagesRequests.has(e))return this._pagesRequests.get(e);const t=this.pdfDocument.getPage(e.id).then(t=>(e.pdfPage||e.setPdfPage(t),this._pagesRequests.delete(e),t)).catch(t=>{console.error("Unable to get page for page view",t),this._pagesRequests.delete(e)});return this._pagesRequests.set(e,t),t}forceRendering(e){const t=e||this._getVisiblePages(),i=this._isScrollModeHorizontal?this.scroll.right:this.scroll.down,n=this.renderingQueue.getHighestPriority(t,this._pages,i);return!!n&&(this._ensurePdfPageLoaded(n).then(()=>{this.renderingQueue.renderView(n)}),!0)}createTextLayerBuilder(e,t,i,n=!1){return new h.TextLayerBuilder({textLayerDiv:e,eventBus:this.eventBus,pageIndex:t,viewport:i,findController:this.isInPresentationMode?null:this.findController,enhanceTextSelection:!this.isInPresentationMode&&n})}createAnnotationLayerBuilder(e,t,i="",s=!1,a=n.NullL10n){return new r.AnnotationLayerBuilder({pageDiv:e,pdfPage:t,imageResourcesPath:i,renderInteractiveForms:s,linkService:this.linkService,downloadManager:this.downloadManager,l10n:a})}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(){const e=this._pages.map((function(e){const t=e.pdfPage.getViewport({scale:1});return{width:t.width,height:t.height,rotation:t.rotation}}));if(!this.enablePrintAutoRotate)return e;const t=(0,n.isPortraitOrientation)(e[0]);return e.map((function(e){return t===(0,n.isPortraitOrientation)(e)?e:{width:e.height,height:e.width,rotation:(e.rotation+90)%360}}))}get scrollMode(){return this._scrollMode}set scrollMode(e){if(this._scrollMode!==e){if(!(0,n.isValidScrollMode)(e))throw new Error(`Invalid scroll mode: ${e}`);this._scrollMode=e,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e}),this._updateScrollMode(this._currentPageNumber)}}_updateScrollMode(e=null){const t=this._scrollMode,i=this.viewer;i.classList.toggle("scrollHorizontal",t===n.ScrollMode.HORIZONTAL),i.classList.toggle("scrollWrapped",t===n.ScrollMode.WRAPPED),this.pdfDocument&&e&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,!0),this._setCurrentPageNumber(e,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(e){if(this._spreadMode!==e){if(!(0,n.isValidSpreadMode)(e))throw new Error(`Invalid spread mode: ${e}`);this._spreadMode=e,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:e}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(e=null){if(!this.pdfDocument)return;const t=this.viewer,i=this._pages;if(t.textContent="",this._spreadMode===n.SpreadMode.NONE)for(let e=0,n=i.length;e<n;++e)t.appendChild(i[e].div);else{const e=this._spreadMode-1;let n=null;for(let s=0,r=i.length;s<r;++s)null===n?(n=document.createElement("div"),n.className="spread",t.appendChild(n)):s%2===e&&(n=n.cloneNode(!1),t.appendChild(n)),n.appendChild(i[s].div)}e&&(this._setCurrentPageNumber(e,!0),this.update())}}t.BaseViewer=d},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultAnnotationLayerFactory=t.AnnotationLayerBuilder=void 0;var n=i(4),s=i(2),r=i(18);class a{constructor({pageDiv:e,pdfPage:t,linkService:i,downloadManager:n,imageResourcesPath:r="",renderInteractiveForms:a=!1,l10n:o=s.NullL10n}){this.pageDiv=e,this.pdfPage=t,this.linkService=i,this.downloadManager=n,this.imageResourcesPath=r,this.renderInteractiveForms=a,this.l10n=o,this.div=null,this._cancelled=!1}render(e,t="display"){this.pdfPage.getAnnotations({intent:t}).then(t=>{if(this._cancelled)return;const i={viewport:e.clone({dontFlip:!0}),div:this.div,annotations:t,page:this.pdfPage,imageResourcesPath:this.imageResourcesPath,renderInteractiveForms:this.renderInteractiveForms,linkService:this.linkService,downloadManager:this.downloadManager};if(this.div)n.AnnotationLayer.update(i);else{if(0===t.length)return;this.div=document.createElement("div"),this.div.className="annotationLayer",this.pageDiv.appendChild(this.div),i.div=this.div,n.AnnotationLayer.render(i),this.l10n.translate(this.div)}})}cancel(){this._cancelled=!0}hide(){this.div&&this.div.setAttribute("hidden","true")}}t.AnnotationLayerBuilder=a;t.DefaultAnnotationLayerFactory=class{createAnnotationLayerBuilder(e,t,i="",n=!1,o=s.NullL10n){return new a({pageDiv:e,pdfPage:t,imageResourcesPath:i,renderInteractiveForms:n,linkService:new r.SimpleLinkService,l10n:o})}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFPageView=void 0;var n=i(2),s=i(4),r=i(8);const a=i(5).viewerCompatibilityParams.maxCanvasPixels||16777216;t.PDFPageView=class{constructor(e){const t=e.container,i=e.defaultViewport;this.id=e.id,this.renderingId="page"+this.id,this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=e.scale||n.DEFAULT_SCALE,this.viewport=i,this.pdfPageRotate=i.rotation,this.hasRestrictedScaling=!1,this.textLayerMode=Number.isInteger(e.textLayerMode)?e.textLayerMode:n.TextLayerMode.ENABLE,this.imageResourcesPath=e.imageResourcesPath||"",this.renderInteractiveForms=e.renderInteractiveForms||!1,this.useOnlyCssZoom=e.useOnlyCssZoom||!1,this.maxCanvasPixels=e.maxCanvasPixels||a,this.eventBus=e.eventBus||(0,n.getGlobalEventBus)(),this.renderingQueue=e.renderingQueue,this.textLayerFactory=e.textLayerFactory,this.annotationLayerFactory=e.annotationLayerFactory,this.renderer=e.renderer||n.RendererType.CANVAS,this.enableWebGL=e.enableWebGL||!1,this.l10n=e.l10n||n.NullL10n,this.paintTask=null,this.paintedViewportMap=new WeakMap,this.renderingState=r.RenderingStates.INITIAL,this.resume=null,this.error=null,this.annotationLayer=null,this.textLayer=null,this.zoomLayer=null;const s=document.createElement("div");s.className="page",s.style.width=Math.floor(this.viewport.width)+"px",s.style.height=Math.floor(this.viewport.height)+"px",s.setAttribute("data-page-number",this.id),this.div=s,t.appendChild(s)}setPdfPage(e){this.pdfPage=e,this.pdfPageRotate=e.rotate;const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:this.scale*n.CSS_UNITS,rotation:t}),this.stats=e.stats,this.reset()}destroy(){this.reset(),this.pdfPage&&this.pdfPage.cleanup()}_resetZoomLayer(e=!1){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(e=!1,t=!1){this.cancelRendering(t),this.renderingState=r.RenderingStates.INITIAL;const i=this.div;i.style.width=Math.floor(this.viewport.width)+"px",i.style.height=Math.floor(this.viewport.height)+"px";const n=i.childNodes,s=e&&this.zoomLayer||null,a=t&&this.annotationLayer&&this.annotationLayer.div||null;for(let e=n.length-1;e>=0;e--){const t=n[e];s!==t&&a!==t&&i.removeChild(t)}i.removeAttribute("data-loaded"),a?this.annotationLayer.hide():this.annotationLayer&&(this.annotationLayer.cancel(),this.annotationLayer=null),s||(this.canvas&&(this.paintedViewportMap.delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer()),this.svg&&(this.paintedViewportMap.delete(this.svg),delete this.svg),this.loadingIconDiv=document.createElement("div"),this.loadingIconDiv.className="loadingIcon",i.appendChild(this.loadingIconDiv)}update(e,t){this.scale=e||this.scale,void 0!==t&&(this.rotation=t);const i=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*n.CSS_UNITS,rotation:i}),this.svg)return this.cssTransform(this.svg,!0),void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now()});let s=!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&&(s=!0)}if(this.canvas){if(this.useOnlyCssZoom||this.hasRestrictedScaling&&s)return this.cssTransform(this.canvas,!0),void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now()});this.zoomLayer||this.canvas.hasAttribute("hidden")||(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform(this.zoomLayer.firstChild),this.reset(!0,!0)}cancelRendering(e=!1){this.paintTask&&(this.paintTask.cancel(),this.paintTask=null),this.resume=null,this.textLayer&&(this.textLayer.cancel(),this.textLayer=null),!e&&this.annotationLayer&&(this.annotationLayer.cancel(),this.annotationLayer=null)}cssTransform(e,t=!1){const i=this.viewport.width,n=this.viewport.height,s=this.div;e.style.width=e.parentNode.style.width=s.style.width=Math.floor(i)+"px",e.style.height=e.parentNode.style.height=s.style.height=Math.floor(n)+"px";const r=this.viewport.rotation-this.paintedViewportMap.get(e).rotation,a=Math.abs(r);let o=1,l=1;90!==a&&270!==a||(o=n/i,l=i/n);const h="rotate("+r+"deg) scale("+o+","+l+")";if(e.style.transform=h,this.textLayer){const e=this.textLayer.viewport,t=this.viewport.rotation-e.rotation,n=Math.abs(t);let s=i/e.width;90!==n&&270!==n||(s=i/e.height);const r=this.textLayer.textLayerDiv;let a,o;switch(n){case 0:a=o=0;break;case 90:a=0,o="-"+r.style.height;break;case 180:a="-"+r.style.width,o="-"+r.style.height;break;case 270:a="-"+r.style.width,o=0;break;default:console.error("Bad rotation value.")}r.style.transform="rotate("+n+"deg) scale("+s+", "+s+") translate("+a+", "+o+")",r.style.transformOrigin="0% 0%"}t&&this.annotationLayer&&this.annotationLayer.render(this.viewport,"display")}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,t){return this.viewport.convertToPdfPoint(e,t)}draw(){if(this.renderingState!==r.RenderingStates.INITIAL&&(console.error("Must be in new state before drawing"),this.reset()),!this.pdfPage)return this.renderingState=r.RenderingStates.FINISHED,Promise.reject(new Error("Page is not loaded"));this.renderingState=r.RenderingStates.RUNNING;const e=this.pdfPage,t=this.div,i=document.createElement("div");i.style.width=t.style.width,i.style.height=t.style.height,i.classList.add("canvasWrapper"),this.annotationLayer&&this.annotationLayer.div?t.insertBefore(i,this.annotationLayer.div):t.appendChild(i);let a=null;if(this.textLayerMode!==n.TextLayerMode.DISABLE&&this.textLayerFactory){const e=document.createElement("div");e.className="textLayer",e.style.width=i.style.width,e.style.height=i.style.height,this.annotationLayer&&this.annotationLayer.div?t.insertBefore(e,this.annotationLayer.div):t.appendChild(e),a=this.textLayerFactory.createTextLayerBuilder(e,this.id-1,this.viewport,this.textLayerMode===n.TextLayerMode.ENABLE_ENHANCE)}this.textLayer=a;let o=null;this.renderingQueue&&(o=e=>{if(!this.renderingQueue.isHighestPriority(this))return this.renderingState=r.RenderingStates.PAUSED,void(this.resume=()=>{this.renderingState=r.RenderingStates.RUNNING,e()});e()});const l=async i=>{if(h===this.paintTask&&(this.paintTask=null),i instanceof s.RenderingCancelledException)this.error=null;else if(this.renderingState=r.RenderingStates.FINISHED,this.loadingIconDiv&&(t.removeChild(this.loadingIconDiv),delete this.loadingIconDiv),this._resetZoomLayer(!0),this.error=i,this.stats=e.stats,this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!1,timestamp:performance.now()}),i)throw i},h=this.renderer===n.RendererType.SVG?this.paintOnSvg(i):this.paintOnCanvas(i);h.onRenderContinue=o,this.paintTask=h;const c=h.promise.then((function(){return l(null).then((function(){if(a){const t=e.streamTextContent({normalizeWhitespace:!0});a.setTextContentStream(t),a.render()}}))}),(function(e){return l(e)}));return this.annotationLayerFactory&&(this.annotationLayer||(this.annotationLayer=this.annotationLayerFactory.createAnnotationLayerBuilder(t,e,this.imageResourcesPath,this.renderInteractiveForms,this.l10n)),this.annotationLayer.render(this.viewport,"display")),t.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),c}paintOnCanvas(e){const t=(0,s.createPromiseCapability)(),i={promise:t.promise,onRenderContinue(e){e()},cancel(){g.cancel()}},r=this.viewport,a=document.createElement("canvas");this.l10n.get("page_canvas",{page:this.id},"Page {{page}}").then(e=>{a.setAttribute("aria-label",e)}),a.setAttribute("hidden","hidden");let o=!0;const l=function(){o&&(a.removeAttribute("hidden"),o=!1)};e.appendChild(a),this.canvas=a,a.mozOpaque=!0;const h=a.getContext("2d",{alpha:!1}),c=(0,n.getOutputScale)(h);if(this.outputScale=c,this.useOnlyCssZoom){const e=r.clone({scale:n.CSS_UNITS});c.sx*=e.width/r.width,c.sy*=e.height/r.height,c.scaled=!0}if(this.maxCanvasPixels>0){const e=r.width*r.height,t=Math.sqrt(this.maxCanvasPixels/e);c.sx>t||c.sy>t?(c.sx=t,c.sy=t,c.scaled=!0,this.hasRestrictedScaling=!0):this.hasRestrictedScaling=!1}const d=(0,n.approximateFraction)(c.sx),u=(0,n.approximateFraction)(c.sy);a.width=(0,n.roundToDivide)(r.width*c.sx,d[0]),a.height=(0,n.roundToDivide)(r.height*c.sy,u[0]),a.style.width=(0,n.roundToDivide)(r.width,d[1])+"px",a.style.height=(0,n.roundToDivide)(r.height,u[1])+"px",this.paintedViewportMap.set(a,r);const p={canvasContext:h,transform:c.scaled?[c.sx,0,0,c.sy,0,0]:null,viewport:this.viewport,enableWebGL:this.enableWebGL,renderInteractiveForms:this.renderInteractiveForms},g=this.pdfPage.render(p);return g.onContinue=function(e){l(),i.onRenderContinue?i.onRenderContinue(e):e()},g.promise.then((function(){l(),t.resolve(void 0)}),(function(e){l(),t.reject(e)})),i}paintOnSvg(e){let t=!1;const i=()=>{if(t)throw new s.RenderingCancelledException("Rendering cancelled, page "+this.id,"svg")},a=this.pdfPage,o=this.viewport.clone({scale:n.CSS_UNITS});return{promise:a.getOperatorList().then(t=>(i(),new s.SVGGraphics(a.commonObjs,a.objs).getSVG(t,o).then(t=>{i(),this.svg=t,this.paintedViewportMap.set(t,o),t.style.width=e.style.width,t.style.height=e.style.height,this.renderingState=r.RenderingStates.FINISHED,e.appendChild(t)}))),onRenderContinue(e){e()},cancel(){t=!0}}}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")}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultTextLayerFactory=t.TextLayerBuilder=void 0;var n=i(2),s=i(4);class r{constructor({textLayerDiv:e,eventBus:t,pageIndex:i,viewport:s,findController:r=null,enhanceTextSelection:a=!1}){this.textLayerDiv=e,this.eventBus=t||(0,n.getGlobalEventBus)(),this.textContent=null,this.textContentItemsStr=[],this.textContentStream=null,this.renderingDone=!1,this.pageIdx=i,this.pageNumber=this.pageIdx+1,this.matches=[],this.viewport=s,this.textDivs=[],this.findController=r,this.textLayerRenderTask=null,this.enhanceTextSelection=a,this._onUpdateTextLayerMatches=null,this._bindMouse()}_finishRendering(){if(this.renderingDone=!0,!this.enhanceTextSelection){const e=document.createElement("div");e.className="endOfContent",this.textLayerDiv.appendChild(e)}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.pageNumber,numTextDivs:this.textDivs.length})}render(e=0){if(!this.textContent&&!this.textContentStream||this.renderingDone)return;this.cancel(),this.textDivs=[];const t=document.createDocumentFragment();this.textLayerRenderTask=(0,s.renderTextLayer)({textContent:this.textContent,textContentStream:this.textContentStream,container:t,viewport:this.viewport,textDivs:this.textDivs,textContentItemsStr:this.textContentItemsStr,timeout:e,enhanceTextSelection:this.enhanceTextSelection}),this.textLayerRenderTask.promise.then(()=>{this.textLayerDiv.appendChild(t),this._finishRendering(),this._updateMatches()},(function(e){})),this._onUpdateTextLayerMatches||(this._onUpdateTextLayerMatches=e=>{e.pageIndex!==this.pageIdx&&-1!==e.pageIndex||this._updateMatches()},this.eventBus.on("updatetextlayermatches",this._onUpdateTextLayerMatches))}cancel(){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this._onUpdateTextLayerMatches&&(this.eventBus.off("updatetextlayermatches",this._onUpdateTextLayerMatches),this._onUpdateTextLayerMatches=null)}setTextContentStream(e){this.cancel(),this.textContentStream=e}setTextContent(e){this.cancel(),this.textContent=e}_convertMatches(e,t){if(!e)return[];const{findController:i,textContentItemsStr:n}=this;let s=0,r=0;const a=n.length-1,o=i.state.query.length,l=[];for(let i=0,h=e.length;i<h;i++){let h=e[i];for(;s!==a&&h>=r+n[s].length;)r+=n[s].length,s++;s===n.length&&console.error("Could not find a matching mapping");const c={begin:{divIdx:s,offset:h-r}};for(h+=t?t[i]:o;s!==a&&h>r+n[s].length;)r+=n[s].length,s++;c.end={divIdx:s,offset:h-r},l.push(c)}return l}_renderMatches(e){if(0===e.length)return;const{findController:t,pageIdx:i,textContentItemsStr:n,textDivs:s}=this,r=i===t.selected.pageIdx,a=t.selected.matchIdx;let o=null;const l={divIdx:-1,offset:void 0};function h(e,t){const i=e.divIdx;s[i].textContent="",c(i,0,e.offset,t)}function c(e,t,i,r){const a=s[e],o=n[e].substring(t,i),l=document.createTextNode(o);if(r){const e=document.createElement("span");return e.className=r,e.appendChild(l),void a.appendChild(e)}a.appendChild(l)}let d=a,u=d+1;if(t.state.highlightAll)d=0,u=e.length;else if(!r)return;for(let n=d;n<u;n++){const d=e[n],u=d.begin,p=d.end,g=r&&n===a,f=g?" selected":"";if(g&&t.scrollMatchIntoView({element:s[u.divIdx],pageIndex:i,matchIndex:a}),o&&u.divIdx===o.divIdx?c(o.divIdx,o.offset,u.offset):(null!==o&&c(o.divIdx,o.offset,l.offset),h(u)),u.divIdx===p.divIdx)c(u.divIdx,u.offset,p.offset,"highlight"+f);else{c(u.divIdx,u.offset,l.offset,"highlight begin"+f);for(let e=u.divIdx+1,t=p.divIdx;e<t;e++)s[e].className="highlight middle"+f;h(p,"highlight end"+f)}o=p}o&&c(o.divIdx,o.offset,l.offset)}_updateMatches(){if(!this.renderingDone)return;const{findController:e,matches:t,pageIdx:i,textContentItemsStr:n,textDivs:s}=this;let r=-1;for(let e=0,i=t.length;e<i;e++){const i=t[e];for(let e=Math.max(r,i.begin.divIdx),t=i.end.divIdx;e<=t;e++){const t=s[e];t.textContent=n[e],t.className=""}r=i.end.divIdx+1}if(!e||!e.highlightMatches)return;const a=e.pageMatches[i]||null,o=e.pageMatchesLength[i]||null;this.matches=this._convertMatches(a,o),this._renderMatches(this.matches)}_bindMouse(){const e=this.textLayerDiv;let t=null;e.addEventListener("mousedown",i=>{if(this.enhanceTextSelection&&this.textLayerRenderTask)return this.textLayerRenderTask.expandTextDivs(!0),void(t&&(clearTimeout(t),t=null));const n=e.querySelector(".endOfContent");if(!n)return;let s=i.target!==e;if(s=s&&"none"!==window.getComputedStyle(n).getPropertyValue("-moz-user-select"),s){const t=e.getBoundingClientRect(),s=Math.max(0,(i.pageY-t.top)/t.height);n.style.top=(100*s).toFixed(2)+"%"}n.classList.add("active")}),e.addEventListener("mouseup",()=>{if(this.enhanceTextSelection&&this.textLayerRenderTask)return void(t=setTimeout(()=>{this.textLayerRenderTask&&this.textLayerRenderTask.expandTextDivs(!1),t=null},300));const i=e.querySelector(".endOfContent");i&&(i.style.top="",i.classList.remove("active"))})}}t.TextLayerBuilder=r;t.DefaultTextLayerFactory=class{createTextLayerBuilder(e,t,i,n=!1){return new r({textLayerDiv:e,pageIndex:t,viewport:i,enhanceTextSelection:n})}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SecondaryToolbar=void 0;var n=i(2),s=i(6),r=i(30);t.SecondaryToolbar=class{constructor(e,t,i){this.toolbar=e.toolbar,this.toggleButton=e.toggleButton,this.toolbarButtonContainer=e.toolbarButtonContainer,this.buttons=[{element:e.presentationModeButton,eventName:"presentationmode",close:!0},{element:e.openFileButton,eventName:"openfile",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:s.CursorTool.SELECT},close:!0},{element:e.cursorHandToolButton,eventName:"switchcursortool",eventDetails:{tool:s.CursorTool.HAND},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.items={firstPage:e.firstPageButton,lastPage:e.lastPageButton,pageRotateCw:e.pageRotateCwButton,pageRotateCcw:e.pageRotateCcwButton},this.mainContainer=t,this.eventBus=i,this.opened=!1,this.containerHeight=null,this.previousContainerHeight=null,this.reset(),this._bindClickListeners(),this._bindCursorToolsListener(e),this._bindScrollModeListener(e),this._bindSpreadModeListener(e),this.eventBus.on("resize",this._setMaxHeight.bind(this)),this.eventBus.on("baseviewerinit",e=>{e.source instanceof r.PDFSinglePageViewer?this.toolbarButtonContainer.classList.add("hiddenScrollModeButtons","hiddenSpreadModeButtons"):this.toolbarButtonContainer.classList.remove("hiddenScrollModeButtons","hiddenSpreadModeButtons")})}get isOpen(){return this.opened}setPageNumber(e){this.pageNumber=e,this._updateUIState()}setPagesCount(e){this.pagesCount=e,this._updateUIState()}reset(){this.pageNumber=0,this.pagesCount=0,this._updateUIState(),this.eventBus.dispatch("secondarytoolbarreset",{source:this})}_updateUIState(){this.items.firstPage.disabled=this.pageNumber<=1,this.items.lastPage.disabled=this.pageNumber>=this.pagesCount,this.items.pageRotateCw.disabled=0===this.pagesCount,this.items.pageRotateCcw.disabled=0===this.pagesCount}_bindClickListeners(){this.toggleButton.addEventListener("click",this.toggle.bind(this));for(const{element:e,eventName:t,close:i,eventDetails:n}of this.buttons)e.addEventListener("click",e=>{if(null!==t){const e={source:this};for(const t in n)e[t]=n[t];this.eventBus.dispatch(t,e)}i&&this.close()})}_bindCursorToolsListener(e){this.eventBus.on("cursortoolchanged",(function({tool:t}){e.cursorSelectToolButton.classList.toggle("toggled",t===s.CursorTool.SELECT),e.cursorHandToolButton.classList.toggle("toggled",t===s.CursorTool.HAND)}))}_bindScrollModeListener(e){function t({mode:t}){e.scrollVerticalButton.classList.toggle("toggled",t===n.ScrollMode.VERTICAL),e.scrollHorizontalButton.classList.toggle("toggled",t===n.ScrollMode.HORIZONTAL),e.scrollWrappedButton.classList.toggle("toggled",t===n.ScrollMode.WRAPPED);const i=t===n.ScrollMode.HORIZONTAL;e.spreadNoneButton.disabled=i,e.spreadOddButton.disabled=i,e.spreadEvenButton.disabled=i}this.eventBus.on("scrollmodechanged",t),this.eventBus.on("secondarytoolbarreset",e=>{e.source===this&&t({mode:n.ScrollMode.VERTICAL})})}_bindSpreadModeListener(e){function t({mode:t}){e.spreadNoneButton.classList.toggle("toggled",t===n.SpreadMode.NONE),e.spreadOddButton.classList.toggle("toggled",t===n.SpreadMode.ODD),e.spreadEvenButton.classList.toggle("toggled",t===n.SpreadMode.EVEN)}this.eventBus.on("spreadmodechanged",t),this.eventBus.on("secondarytoolbarreset",e=>{e.source===this&&t({mode:n.SpreadMode.NONE})})}open(){this.opened||(this.opened=!0,this._setMaxHeight(),this.toggleButton.classList.add("toggled"),this.toolbar.classList.remove("hidden"))}close(){this.opened&&(this.opened=!1,this.toolbar.classList.add("hidden"),this.toggleButton.classList.remove("toggled"))}toggle(){this.opened?this.close():this.open()}_setMaxHeight(){this.opened&&(this.containerHeight=this.mainContainer.clientHeight,this.containerHeight!==this.previousContainerHeight&&(this.toolbarButtonContainer.style.maxHeight=`${this.containerHeight-n.SCROLLBAR_PADDING}px`,this.previousContainerHeight=this.containerHeight))}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFSinglePageViewer=void 0;var n=i(25),s=i(4);class r extends n.BaseViewer{constructor(e){super(e),this.eventBus.on("pagesinit",e=>{this._ensurePageViewVisible()})}get _setDocumentViewerElement(){return(0,s.shadow)(this,"_setDocumentViewerElement",this._shadowViewer)}_resetView(){super._resetView(),this._previousPageNumber=1,this._shadowViewer=document.createDocumentFragment(),this._updateScrollDown=null}_ensurePageViewVisible(){const e=this._pages[this._currentPageNumber-1],t=this._pages[this._previousPageNumber-1],i=this.viewer.childNodes;switch(i.length){case 0:this.viewer.appendChild(e.div);break;case 1:if(i[0]!==t.div)throw new Error("_ensurePageViewVisible: Unexpected previously visible page.");if(e===t)break;this._shadowViewer.appendChild(t.div),this.viewer.appendChild(e.div),this.container.scrollTop=0;break;default:throw new Error("_ensurePageViewVisible: Only one page should be visible at a time.")}this._previousPageNumber=this._currentPageNumber}_scrollUpdate(){this._updateScrollDown&&this._updateScrollDown(),super._scrollUpdate()}_scrollIntoView({pageDiv:e,pageSpot:t=null,pageNumber:i=null}){i&&this._setCurrentPageNumber(i);const n=this._currentPageNumber>=this._previousPageNumber;this._ensurePageViewVisible(),this.update(),super._scrollIntoView({pageDiv:e,pageSpot:t,pageNumber:i}),this._updateScrollDown=()=>{this.scroll.down=n,this._updateScrollDown=null}}_getVisiblePages(){return this._getCurrentVisiblePage()}_updateHelper(e){}get _isScrollModeHorizontal(){return(0,s.shadow)(this,"_isScrollModeHorizontal",!1)}_updateScrollMode(){}_updateSpreadMode(){}}t.PDFSinglePageViewer=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Toolbar=void 0;var n=i(2);t.Toolbar=class{constructor(e,t,i=n.NullL10n){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.openFile,eventName:"openfile"},{element:e.print,eventName:"print"},{element:e.presentationModeButton,eventName:"presentationmode"},{element:e.download,eventName:"download"},{element:e.viewBookmark,eventName:null}],this.items={numPages:e.numPages,pageNumber:e.pageNumber,scaleSelectContainer:e.scaleSelectContainer,scaleSelect:e.scaleSelect,customScaleOption:e.customScaleOption,previous:e.previous,next:e.next,zoomIn:e.zoomIn,zoomOut:e.zoomOut},this._wasLocalized=!1,this.reset(),this._bindListeners()}setPageNumber(e,t){this.pageNumber=e,this.pageLabel=t,this._updateUIState(!1)}setPagesCount(e,t){this.pagesCount=e,this.hasPageLabels=t,this._updateUIState(!0)}setPageScale(e,t){this.pageScaleValue=(e||t).toString(),this.pageScale=t,this._updateUIState(!1)}reset(){this.pageNumber=0,this.pageLabel=null,this.hasPageLabels=!1,this.pagesCount=0,this.pageScaleValue=n.DEFAULT_SCALE_VALUE,this.pageScale=n.DEFAULT_SCALE,this._updateUIState(!0),this.updateLoadingIndicatorState()}_bindListeners(){const{pageNumber:e,scaleSelect:t}=this.items,i=this;for(const{element:e,eventName:t}of this.buttons)e.addEventListener("click",e=>{null!==t&&this.eventBus.dispatch(t,{source:this})});e.addEventListener("click",(function(){this.select()})),e.addEventListener("change",(function(){i.eventBus.dispatch("pagenumberchanged",{source:i,value:this.value})})),t.addEventListener("change",(function(){"custom"!==this.value&&i.eventBus.dispatch("scalechanged",{source:i,value:this.value})})),t.oncontextmenu=n.noContextMenuHandler,this.eventBus.on("localized",()=>{this._wasLocalized=!0,this._adjustScaleWidth(),this._updateUIState(!0)})}_updateUIState(e=!1){if(!this._wasLocalized)return;const{pageNumber:t,pagesCount:i,pageScaleValue:s,pageScale:r,items:a}=this;e&&(this.hasPageLabels?a.pageNumber.type="text":(a.pageNumber.type="number",this.l10n.get("of_pages",{pagesCount:i},"of {{pagesCount}}").then(e=>{a.numPages.textContent=e})),a.pageNumber.max=i),this.hasPageLabels?(a.pageNumber.value=this.pageLabel,this.l10n.get("page_of_pages",{pageNumber:t,pagesCount:i},"({{pageNumber}} of {{pagesCount}})").then(e=>{a.numPages.textContent=e})):a.pageNumber.value=t,a.previous.disabled=t<=1,a.next.disabled=t>=i,a.zoomOut.disabled=r<=n.MIN_SCALE,a.zoomIn.disabled=r>=n.MAX_SCALE;const o=Math.round(1e4*r)/100;this.l10n.get("page_scale_percent",{scale:o},"{{scale}}%").then(e=>{let t=!1;for(const e of a.scaleSelect.options)e.value===s?(e.selected=!0,t=!0):e.selected=!1;t||(a.customScaleOption.textContent=e,a.customScaleOption.selected=!0)})}updateLoadingIndicatorState(e=!1){this.items.pageNumber.classList.toggle("visiblePageIsLoading",e)}async _adjustScaleWidth(){const{items:e,l10n:t}=this,i=Promise.all([t.get("page_scale_auto",null,"Automatic Zoom"),t.get("page_scale_actual",null,"Actual Size"),t.get("page_scale_fit",null,"Page Fit"),t.get("page_scale_width",null,"Page Width")]);let s=document.createElement("canvas");s.mozOpaque=!0;let r=s.getContext("2d",{alpha:!1});await n.animationStarted;const{fontSize:a,fontFamily:o}=getComputedStyle(e.scaleSelect);r.font=`${a} ${o}`;let l=0;for(const e of await i){const{width:t}=r.measureText(e);t>l&&(l=t)}l+=33,l>140&&(e.scaleSelect.style.width=`${l+22}px`,e.scaleSelectContainer.style.width=`${l}px`),s.width=0,s.height=0,s=r=null}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewHistory=void 0;t.ViewHistory=class{constructor(e,t=20){this.fingerprint=e,this.cacheSize=t,this._initializedPromise=this._readFromStorage().then(e=>{const t=JSON.parse(e||"{}");if("files"in t)for(;t.files.length>=this.cacheSize;)t.files.shift();else t.files=[];let i=-1;for(let e=0,n=t.files.length;e<n;e++){if(t.files[e].fingerprint===this.fingerprint){i=e;break}}-1===i&&(i=t.files.push({fingerprint:this.fingerprint})-1),this.file=t.files[i],this.database=t})}async _writeToStorage(){const e=JSON.stringify(this.database);localStorage.setItem("pdfjs.history",e)}async _readFromStorage(){return localStorage.getItem("pdfjs.history")}async set(e,t){return await this._initializedPromise,this.file[e]=t,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}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericCom=void 0;var n=i(1),s=i(34),r=i(35),a=i(36);t.GenericCom={};class o extends s.BasePreferences{async _writeToStorage(e){localStorage.setItem("pdfjs.preferences",JSON.stringify(e))}async _readFromStorage(e){return JSON.parse(localStorage.getItem("pdfjs.preferences"))}}class l extends n.DefaultExternalServices{static createDownloadManager(e){return new r.DownloadManager(e)}static createPreferences(){return new o}static createL10n({locale:e="en-US"}){return new a.GenericL10n(e)}}n.PDFViewerApplication.externalServices=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BasePreferences=void 0;let n=null;class s{constructor(){if(this.constructor===s)throw new Error("Cannot initialize BasePreferences.");this.prefs=null,this._initializedPromise=(n||(n=Promise.resolve({cursorToolOnLoad:0,defaultZoomValue:"",disablePageLabels:!1,enablePrintAutoRotate:!1,enableWebGL:!1,eventBusDispatchToDOM:!1,externalLinkTarget:0,historyUpdateUrl:!1,pdfBugEnabled:!1,renderer:"canvas",renderInteractiveForms:!1,sidebarViewOnLoad:-1,scrollModeOnLoad:-1,spreadModeOnLoad:-1,textLayerMode:1,useOnlyCssZoom:!1,viewOnLoad:0,disableAutoFetch:!1,disableFontFace:!1,disableRange:!1,disableStream:!1})),n).then(e=>(Object.defineProperty(this,"defaults",{value:Object.freeze(e),writable:!1,enumerable:!0,configurable:!1}),this.prefs=Object.assign(Object.create(null),e),this._readFromStorage(e))).then(e=>{if(e)for(const t in e){const i=this.defaults[t],n=e[t];void 0!==i&&typeof n==typeof i&&(this.prefs[t]=n)}})}async _writeToStorage(e){throw new Error("Not implemented: _writeToStorage")}async _readFromStorage(e){throw new Error("Not implemented: _readFromStorage")}async reset(){return await this._initializedPromise,this.prefs=Object.assign(Object.create(null),this.defaults),this._writeToStorage(this.defaults)}async set(e,t){await this._initializedPromise;const i=this.defaults[e];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 n=typeof t,s=typeof i;if(n!==s){if("number"!==n||"string"!==s)throw new Error(`Set preference: "${t}" is a ${n}, `+`expected a ${s}.`);t=t.toString()}else if("number"===n&&!Number.isInteger(t))throw new Error(`Set preference: "${t}" must be an integer.`);return this.prefs[e]=t,this._writeToStorage(this.prefs)}async get(e){await this._initializedPromise;const t=this.defaults[e];if(void 0===t)throw new Error(`Get preference: "${e}" is undefined.`);{const t=this.prefs[e];if(void 0!==t)return t}return t}async getAll(){return await this._initializedPromise,Object.assign(Object.create(null),this.defaults,this.prefs)}}t.BasePreferences=s},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DownloadManager=void 0;var n=i(4);const s=n.apiCompatibilityParams.disableCreateObjectURL||!1;function r(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).appendChild(i),i.click(),i.remove()}t.DownloadManager=class{constructor({disableCreateObjectURL:e=s}){this.disableCreateObjectURL=e}downloadUrl(e,t){(0,n.createValidAbsoluteUrl)(e,"http://example.com")&&r(e+"#pdfjs.action=download",t)}downloadData(e,t,i){if(navigator.msSaveBlob)return void navigator.msSaveBlob(new Blob([e],{type:i}),t);r((0,n.createObjectURL)(e,i,this.disableCreateObjectURL),t)}download(e,t,i){if(navigator.msSaveBlob)return void(navigator.msSaveBlob(e,i)||this.downloadUrl(t,i));if(this.disableCreateObjectURL)return void this.downloadUrl(t,i);r(URL.createObjectURL(e),i)}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericL10n=void 0,i(37);const n=document.webL10n;t.GenericL10n=class{constructor(e){this._lang=e,this._ready=new Promise((t,i)=>{n.setLanguage(e,()=>{t(n)})})}async getLanguage(){return(await this._ready).getLanguage()}async getDirection(){return(await this._ready).getDirection()}async get(e,t,i){return(await this._ready).get(e,t,i)}async translate(e){return(await this._ready).translate(e)}}},function(e,t,i){"use strict";document.webL10n=function(e,t,i){var n={},s="",r="textContent",a="",o={},l="loading";function h(e,t,i){t=t||function(e){},i=i||function(){};var n=new XMLHttpRequest;n.open("GET",e,!0),n.overrideMimeType&&n.overrideMimeType("text/plain; charset=utf-8"),n.onreadystatechange=function(){4==n.readyState&&(200==n.status||0===n.status?t(n.responseText):i())},n.onerror=i,n.ontimeout=i;try{n.send(null)}catch(e){i()}}function c(e,t,i,a){var o=e.replace(/[^\/]*$/,"")||"./";function l(e){return e.lastIndexOf("\\")<0?e:e.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}h(e,(function(e){s+=e,function(e,i){var n={},s=/^\s*|\s*$/,r=/^\s*#|^\s*$/,a=/^\s*\[(.*)\]\s*$/,c=/^\s*@import\s+url\((.*)\)\s*$/i,d=/^([^=\s]*)\s*=\s*(.+)$/;function u(e,i,h){var u=e.replace(s,"").split(/[\r\n]+/),g="*",f=t.split("-",1)[0],m=!1,v="";!function e(){for(;;){if(!u.length)return void h();var s=u.shift();if(!r.test(s)){if(i){if(v=a.exec(s)){g=v[1].toLowerCase(),m="*"!==g&&g!==t&&g!==f;continue}if(m)continue;if(v=c.exec(s))return void p(o+v[1],e)}var b=s.match(d);b&&3==b.length&&(n[b[1]]=l(b[2]))}}}()}function p(e,t){h(e,(function(e){u(e,!1,t)}),(function(){console.warn(e+" not found."),t()}))}u(e,!0,(function(){i(n)}))}(e,(function(e){for(var t in e){var s,a,o=t.lastIndexOf(".");o>0?(s=t.substring(0,o),a=t.substring(o+1)):(s=t,a=r),n[s]||(n[s]={}),n[s][a]=e[t]}i&&i()}))}),a)}function d(e,i){e&&(e=e.toLowerCase()),i=i||function(){},n={},s="",a="",a=e;var r=t.querySelectorAll('link[type="application/l10n"]'),o=r.length;if(0!==o){var h,d,u=0;d=function(){++u>=o&&(i(),l="complete")};for(var p=0;p<o;p++){new v(r[p]).load(e,d)}}else{var g=(h=t.querySelector('script[type="application/l10n"]'))?JSON.parse(h.innerHTML):null;if(g&&g.locales&&g.default_locale){if(console.log("using the embedded JSON directory, early way out"),!(n=g.locales[e])){var f=g.default_locale.toLowerCase();for(var m in g.locales){if((m=m.toLowerCase())===e){n=g.locales[e];break}m===f&&(n=g.locales[f])}}i()}else console.log("no resource to load, early way out");l="complete"}function v(e){var t=e.href;this.load=function(e,i){c(t,e,i,(function(){console.warn(t+" not found."),console.warn('"'+e+'" resource not found'),a="",i()}))}}}function u(e,t,i){var s=n[e];if(!s){if(console.warn("#"+e+" is undefined."),!i)return null;s=i}var r={};for(var a in s){var o=s[a];o=g(o=p(o,t,e,a),t,e),r[a]=o}return r}function p(e,t,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],h=r[2];(t&&h in t?a=t[h]:h in n&&(a=n[h]),l in o)&&(e=(0,o[l])(e,a,i,s));return e}function g(e,t,i){return e.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(e,s){return t&&s in t?t[s]:s in n?n[s]:(console.log("argument {{"+s+"}} for #"+i+" is undefined."),e)}))}function f(e){var i=function(e){if(!e)return{};var t=e.getAttribute("data-l10n-id"),i=e.getAttribute("data-l10n-args"),n={};if(i)try{n=JSON.parse(i)}catch(e){console.warn("could not parse arguments for #"+t)}return{id:t,args:n}}(e);if(i.id){var n=u(i.id,i.args);if(n){if(n[r]){if(0===function(e){if(e.children)return e.children.length;if(void 0!==e.childElementCount)return e.childElementCount;for(var t=0,i=0;i<e.childNodes.length;i++)t+=1===e.nodeType?1:0;return t}(e))e[r]=n[r];else{for(var s=e.childNodes,a=!1,o=0,l=s.length;o<l;o++)3===s[o].nodeType&&/\S/.test(s[o].nodeValue)&&(a?s[o].nodeValue="":(s[o].nodeValue=n[r],a=!0));if(!a){var h=t.createTextNode(n[r]);e.insertBefore(h,e.firstChild)}}delete n[r]}for(var c in n)e[c]=n[c]}else console.warn("#"+i.id+" is undefined.")}}return o.plural=function(e,t,i,s){var l=parseFloat(t);if(isNaN(l))return e;if(s!=r)return e;o._pluralRules||(o._pluralRules=function(e){function t(e,t){return-1!==t.indexOf(e)}function i(e,t,i){return t<=e&&e<=i}var n={0:function(e){return"other"},1:function(e){return i(e%100,3,10)?"few":0===e?"zero":i(e%100,11,99)?"many":2==e?"two":1==e?"one":"other"},2:function(e){return 0!==e&&e%10==0?"many":2==e?"two":1==e?"one":"other"},3:function(e){return 1==e?"one":"other"},4:function(e){return i(e,0,1)?"one":"other"},5:function(e){return i(e,0,2)&&2!=e?"one":"other"},6:function(e){return 0===e?"zero":e%10==1&&e%100!=11?"one":"other"},7:function(e){return 2==e?"two":1==e?"one":"other"},8:function(e){return i(e,3,6)?"few":i(e,7,10)?"many":2==e?"two":1==e?"one":"other"},9:function(e){return 0===e||1!=e&&i(e%100,1,19)?"few":1==e?"one":"other"},10:function(e){return i(e%10,2,9)&&!i(e%100,11,19)?"few":e%10!=1||i(e%100,11,19)?"other":"one"},11:function(e){return i(e%10,2,4)&&!i(e%100,12,14)?"few":e%10==0||i(e%10,5,9)||i(e%100,11,14)?"many":e%10==1&&e%100!=11?"one":"other"},12:function(e){return i(e,2,4)?"few":1==e?"one":"other"},13:function(e){return i(e%10,2,4)&&!i(e%100,12,14)?"few":1!=e&&i(e%10,0,1)||i(e%10,5,9)||i(e%100,12,14)?"many":1==e?"one":"other"},14:function(e){return i(e%100,3,4)?"few":e%100==2?"two":e%100==1?"one":"other"},15:function(e){return 0===e||i(e%100,2,10)?"few":i(e%100,11,19)?"many":1==e?"one":"other"},16:function(e){return e%10==1&&11!=e?"one":"other"},17:function(e){return 3==e?"few":0===e?"zero":6==e?"many":2==e?"two":1==e?"one":"other"},18:function(e){return 0===e?"zero":i(e,0,2)&&0!==e&&2!=e?"one":"other"},19:function(e){return i(e,2,10)?"few":i(e,0,1)?"one":"other"},20:function(e){return!i(e%10,3,4)&&e%10!=9||i(e%100,10,19)||i(e%100,70,79)||i(e%100,90,99)?e%1e6==0&&0!==e?"many":e%10!=2||t(e%100,[12,72,92])?e%10!=1||t(e%100,[11,71,91])?"other":"one":"two":"few"},21:function(e){return 0===e?"zero":1==e?"one":"other"},22:function(e){return i(e,0,1)||i(e,11,99)?"one":"other"},23:function(e){return i(e%10,1,2)||e%20==0?"one":"other"},24:function(e){return i(e,3,10)||i(e,13,19)?"few":t(e,[2,12])?"two":t(e,[1,11])?"one":"other"}},s={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3}[e.replace(/-.*$/,"")];return s in n?n[s]:(console.warn("plural form unknown for ["+e+"]"),function(){return"other"})}(a));var h="["+o._pluralRules(l)+"]";return 0===l&&i+"[zero]"in n?e=n[i+"[zero]"][s]:1==l&&i+"[one]"in n?e=n[i+"[one]"][s]:2==l&&i+"[two]"in n?e=n[i+"[two]"][s]:i+h in n?e=n[i+h][s]:i+"[other]"in n&&(e=n[i+"[other]"][s]),e},{get:function(e,t,i){var n,s=e.lastIndexOf("."),a=r;s>0&&(a=e.substring(s+1),e=e.substring(0,s)),i&&((n={})[a]=i);var o=u(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){d(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(e){for(var i=function(e){return e?e.querySelectorAll("*[data-l10n-id]"):[]}(e=e||t.documentElement),n=i.length,s=0;s<n;s++)f(i[s]);f(e)},getReadyState:function(){return l},ready:function(i){i&&("complete"==l||"interactive"==l?e.setTimeout((function(){i()})):t.addEventListener&&t.addEventListener("localized",(function e(){t.removeEventListener("localized",e),i()})))}}}(window,document)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFPrintService=l;var n=i(2),s=i(1),r=i(3);let a=null,o=null;function l(e,t,i,s){this.pdfDocument=e,this.pagesOverview=t,this.printContainer=i,this.l10n=s||n.NullL10n,this.disableCreateObjectURL=e.loadingParams.disableCreateObjectURL,this.currentPage=-1,this.scratchCanvas=document.createElement("canvas")}l.prototype={layout(){this.throwIfInactive();const e=document.querySelector("body");e.setAttribute("data-pdfjsprinting",!0),this.pagesOverview.every((function(e){return e.width===this.pagesOverview[0].width&&e.height===this.pagesOverview[0].height}),this)||console.warn("Not all pages have the same size. The printed result may be incorrect!"),this.pageStyleSheet=document.createElement("style");const t=this.pagesOverview[0];this.pageStyleSheet.textContent="@supports ((size:A4) and (size:1pt 1pt)) {@page { size: "+t.width+"pt "+t.height+"pt;}}",e.appendChild(this.pageStyleSheet)},destroy(){if(a!==this)return;this.printContainer.textContent="",document.querySelector("body").removeAttribute("data-pdfjsprinting"),this.pageStyleSheet&&(this.pageStyleSheet.remove(),this.pageStyleSheet=null),this.scratchCanvas.width=this.scratchCanvas.height=0,this.scratchCanvas=null,a=null,g().then((function(){"printServiceOverlay"===o.active&&o.close("printServiceOverlay")}))},renderPages(){const e=this.pagesOverview.length,t=(i,s)=>{if(this.throwIfInactive(),++this.currentPage>=e)return u(e,e,this.l10n),void i();const o=this.currentPage;u(o,e,this.l10n),function(e,t,i,s){const o=a.scratchCanvas,l=(r.AppOptions.get("printResolution")||150)/72;o.width=Math.floor(s.width*l),o.height=Math.floor(s.height*l);const h=Math.floor(s.width*n.CSS_UNITS)+"px",c=Math.floor(s.height*n.CSS_UNITS)+"px",d=o.getContext("2d");return d.save(),d.fillStyle="rgb(255, 255, 255)",d.fillRect(0,0,o.width,o.height),d.restore(),t.getPage(i).then((function(e){const t={canvasContext:d,transform:[l,0,0,l,0,0],viewport:e.getViewport({scale:1,rotation:s.rotation}),intent:"print"};return e.render(t).promise})).then((function(){return{width:h,height:c}}))}(0,this.pdfDocument,o+1,this.pagesOverview[o]).then(this.useRenderedPage.bind(this)).then((function(){t(i,s)}),s)};return new Promise(t)},useRenderedPage(e){this.throwIfInactive();const t=document.createElement("img");t.style.width=e.width,t.style.height=e.height;const i=this.scratchCanvas;"toBlob"in i&&!this.disableCreateObjectURL?i.toBlob((function(e){t.src=URL.createObjectURL(e)})):t.src=i.toDataURL();const n=document.createElement("div");return n.appendChild(t),this.printContainer.appendChild(n),new Promise((function(e,i){t.onload=e,t.onerror=i}))},performPrint(){return this.throwIfInactive(),new Promise(e=>{setTimeout(()=>{this.active?(h.call(window),setTimeout(e,20)):e()},0)})},get active(){return this===a},throwIfInactive(){if(!this.active)throw new Error("This print request was cancelled or completed.")}};const h=window.print;function c(e){const t=document.createEvent("CustomEvent");t.initCustomEvent(e,!1,!1,"custom"),window.dispatchEvent(t)}function d(){a&&(a.destroy(),c("afterprint"))}function u(e,t,i){const n=document.getElementById("printServiceOverlay"),s=Math.round(100*e/t),r=n.querySelector("progress"),a=n.querySelector(".relative-progress");r.value=s,i.get("print_progress_percent",{progress:s},s+"%").then(e=>{a.textContent=e})}if(window.print=function(){if(a)console.warn("Ignored window.print() because of a pending print job.");else{g().then((function(){a&&o.open("printServiceOverlay")}));try{c("beforeprint")}finally{if(!a)return console.error("Expected print service to be initialized."),void g().then((function(){"printServiceOverlay"===o.active&&o.close("printServiceOverlay")}));const e=a;a.renderPages().then((function(){return e.performPrint()})).catch((function(){})).then((function(){e.active&&d()}))}}},window.addEventListener("keydown",(function(e){80!==e.keyCode||!e.ctrlKey&&!e.metaKey||e.altKey||e.shiftKey&&!window.chrome&&!window.opera||(window.print(),e.preventDefault(),e.stopImmediatePropagation?e.stopImmediatePropagation():e.stopPropagation())}),!0),"onbeforeprint"in window){const e=function(e){"custom"!==e.detail&&e.stopImmediatePropagation&&e.stopImmediatePropagation()};window.addEventListener("beforeprint",e),window.addEventListener("afterprint",e)}let p;function g(){if(!p){if(o=s.PDFViewerApplication.overlayManager,!o)throw new Error("The overlay manager has not yet been initialized.");p=o.register("printServiceOverlay",document.getElementById("printServiceOverlay"),d,!0),document.getElementById("printCancel").onclick=d}return p}s.PDFPrintServiceFactory.instance={supportsPrinting:!0,createPrintService(e,t,i,n){if(a)throw new Error("The print service is created and active.");return a=new l(e,t,i,n),a}}}]);