%PDF- %PDF-
Direktori : /var/www/projetos/prod.jornalshowdafe.com.br/wp-content/plugins/_dflip/assets/js/libs/ |
Current File : /var/www/projetos/prod.jornalshowdafe.com.br/wp-content/plugins/_dflip/assets/js/libs/pdf.min.js |
/** * @licstart The following is the entire license notice for the * JavaScript code in this page * * Copyright 2023 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @licend The above is the entire license notice for the * JavaScript code in this page */ !function webpackUniversalModuleDefinition(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],e):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=e():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=e()}(globalThis,(()=>(()=>{var __webpack_modules__=[,(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.RenderingIntentFlag=e.PromiseCapability=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.MAX_IMAGE_SIZE_TO_CACHE=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.BASELINE_FACTOR=e.AnnotationType=e.AnnotationStateModelType=e.AnnotationReviewState=e.AnnotationReplyType=e.AnnotationMode=e.AnnotationMarkedState=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0,e.assert=function assert(t,e){t||unreachable(e)},e.bytesToString=function bytesToString(t){"object"==typeof t&&void 0!==(null==t?void 0:t.length)||unreachable("Invalid argument for bytesToString");const e=t.length,n=8192;if(e<n)return String.fromCharCode.apply(null,t);const r=[];for(let s=0;s<e;s+=n){const i=Math.min(s+n,e),a=t.subarray(s,i);r.push(String.fromCharCode.apply(null,a))}return r.join("")},e.createValidAbsoluteUrl=function createValidAbsoluteUrl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(n&&"string"==typeof t){if(n.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);(null==e?void 0:e.length)>=2&&(t=`http://${t}`)}if(n.tryConvertEncoding)try{t=stringToUTF8String(t)}catch(t){}}const r=e?new URL(t,e):new URL(t);if(function _isValidProtocol(t){switch(null==t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(r))return r}catch(t){}return null},e.getModificationDate=function getModificationDate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")},e.getVerbosityLevel=function getVerbosityLevel(){return s},e.info=function info(t){s>=r.INFOS&&console.log(`Info: ${t}`)},e.isArrayBuffer=function isArrayBuffer(t){return"object"==typeof t&&void 0!==(null==t?void 0:t.byteLength)},e.isArrayEqual=function isArrayEqual(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0},e.normalizeUnicode=function normalizeUnicode(t){l||(l=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,c=new Map([["ſt","ſt"]]));return t.replaceAll(l,((t,e,n)=>e?e.normalize("NFKC"):c.get(n)))},e.objectFromMap=function objectFromMap(t){const e=Object.create(null);for(const[n,r]of t)e[n]=r;return e},e.objectSize=function objectSize(t){return Object.keys(t).length},e.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(s=t)},e.shadow=shadow,e.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)},e.stringToBytes=stringToBytes,e.stringToPDFString=function stringToPDFString(t){if(t[0]>="ï"){let e;if("þ"===t[0]&&"ÿ"===t[1]?e="utf-16be":"ÿ"===t[0]&&"þ"===t[1]?e="utf-16le":"ï"===t[0]&&"»"===t[1]&&"¿"===t[2]&&(e="utf-8"),e)try{const n=new TextDecoder(e,{fatal:!0}),r=stringToBytes(t);return n.decode(r)}catch(t){warn(`stringToPDFString: "${t}".`)}}const e=[];for(let n=0,r=t.length;n<r;n++){const r=o[t.charCodeAt(n)];e.push(r?String.fromCharCode(r):t.charAt(n))}return e.join("")},e.stringToUTF8String=stringToUTF8String,e.unreachable=unreachable,e.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))},e.warn=warn,globalThis._pdfjsCompatibilityChecked||(globalThis._pdfjsCompatibilityChecked=!0,n(2));e.IDENTITY_MATRIX=[1,0,0,1,0,0];e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];e.MAX_IMAGE_SIZE_TO_CACHE=1e7;e.LINE_FACTOR=1.35;e.LINE_DESCENT_FACTOR=.35;e.BASELINE_FACTOR=.25925925925925924;e.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};e.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};e.AnnotationEditorPrefix="pdfjs_internal_editor_";e.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};e.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};e.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};e.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};e.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};e.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};e.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};e.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};e.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};e.AnnotationReplyType={GROUP:"Group",REPLY:"R"};e.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};e.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};e.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};e.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};e.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};e.PageActionEventType={O:"PageOpen",C:"PageClose"};const r={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=r;e.CMapCompressionType={NONE:0,BINARY:1};e.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};e.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let s=r.WARNINGS;function warn(t){s>=r.WARNINGS&&console.log(`Warning: ${t}`)}function unreachable(t){throw new Error(t)}function shadow(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(t,e,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}const i=function BaseExceptionClosure(){function BaseException(t,e){this.constructor===BaseException&&unreachable("Cannot initialize BaseException."),this.message=t,this.name=e}return BaseException.prototype=new Error,BaseException.constructor=BaseException,BaseException}();e.BaseException=i;e.PasswordException=class PasswordException extends i{constructor(t,e){super(t,"PasswordException"),this.code=e}};e.UnknownErrorException=class UnknownErrorException extends i{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}};e.InvalidPDFException=class InvalidPDFException extends i{constructor(t){super(t,"InvalidPDFException")}};e.MissingPDFException=class MissingPDFException extends i{constructor(t){super(t,"MissingPDFException")}};e.UnexpectedResponseException=class UnexpectedResponseException extends i{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}};e.FormatError=class FormatError extends i{constructor(t){super(t,"FormatError")}};function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");const e=t.length,n=new Uint8Array(e);for(let r=0;r<e;++r)n[r]=255&t.charCodeAt(r);return n}e.AbortException=class AbortException extends i{constructor(t){super(t,"AbortException")}};e.FeatureTest=class FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",function isLittleEndian(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{return new Function(""),!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?shadow(this,"platform",{isWin:!1,isMac:!1}):shadow(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}};const a=[...Array(256).keys()].map((t=>t.toString(16).padStart(2,"0")));class Util{static makeHexColor(t,e,n){return`#${a[t]}${a[e]}${a[n]}`}static scaleMinMax(t,e){let n;t[0]?(t[0]<0&&(n=e[0],e[0]=e[1],e[1]=n),e[0]*=t[0],e[1]*=t[0],t[3]<0&&(n=e[2],e[2]=e[3],e[3]=n),e[2]*=t[3],e[3]*=t[3]):(n=e[0],e[0]=e[2],e[2]=n,n=e[1],e[1]=e[3],e[3]=n,t[1]<0&&(n=e[2],e[2]=e[3],e[3]=n),e[2]*=t[1],e[3]*=t[1],t[2]<0&&(n=e[0],e[0]=e[1],e[1]=n),e[0]*=t[2],e[1]*=t[2]),e[0]+=t[4],e[1]+=t[4],e[2]+=t[5],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const n=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/n,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/n]}static getAxialAlignedBoundingBox(t,e){const n=Util.applyTransform(t,e),r=Util.applyTransform(t.slice(2,4),e),s=Util.applyTransform([t[0],t[3]],e),i=Util.applyTransform([t[2],t[1]],e);return[Math.min(n[0],r[0],s[0],i[0]),Math.min(n[1],r[1],s[1],i[1]),Math.max(n[0],r[0],s[0],i[0]),Math.max(n[1],r[1],s[1],i[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],n=t[0]*e[0]+t[1]*e[2],r=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],i=t[2]*e[1]+t[3]*e[3],a=(n+i)/2,o=Math.sqrt((n+i)**2-4*(n*i-s*r))/2,l=a+o||1,c=a-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const n=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),r=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(n>r)return null;const s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),i=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>i?null:[n,s,r,i]}static bezierBoundingBox(t,e,n,r,s,i,a,o){const l=[],c=[[],[]];let d,h,u,p,f,g,m,v;for(let c=0;c<2;++c)if(0===c?(h=6*t-12*n+6*s,d=-3*t+9*n-9*s+3*a,u=3*n-3*t):(h=6*e-12*r+6*i,d=-3*e+9*r-9*i+3*o,u=3*r-3*e),Math.abs(d)<1e-12){if(Math.abs(h)<1e-12)continue;p=-u/h,0<p&&p<1&&l.push(p)}else m=h*h-4*u*d,v=Math.sqrt(m),m<0||(f=(-h+v)/(2*d),0<f&&f<1&&l.push(f),g=(-h-v)/(2*d),0<g&&g<1&&l.push(g));let b,y=l.length;const A=y;for(;y--;)p=l[y],b=1-p,c[0][y]=b*b*b*t+3*b*b*p*n+3*b*p*p*s+p*p*p*a,c[1][y]=b*b*b*e+3*b*b*p*r+3*b*p*p*i+p*p*p*o;return c[0][A]=t,c[1][A]=e,c[0][A+1]=a,c[1][A+1]=o,c[0].length=c[1].length=A+2,[Math.min(...c[0]),Math.min(...c[1]),Math.max(...c[0]),Math.max(...c[1])]}}e.Util=Util;const o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToUTF8String(t){return decodeURIComponent(escape(t))}e.PromiseCapability=class PromiseCapability{#t=!1;constructor(){this.promise=new Promise(((t,e)=>{this.resolve=e=>{this.#t=!0,t(e)},this.reject=t=>{this.#t=!0,e(t)}}))}get settled(){return this.#t}};let l=null,c=null},(t,e,n)=>{"use strict";var r=n(3);!function checkDOMMatrix(){!globalThis.DOMMatrix&&r.isNodeJS&&(globalThis.DOMMatrix=require("canvas").DOMMatrix)}(),function checkPath2D(){if(globalThis.Path2D||!r.isNodeJS)return;const{CanvasRenderingContext2D:t}=require("canvas"),{polyfillPath2D:e}=require("path2d-polyfill");globalThis.CanvasRenderingContext2D=t,e(globalThis)}(),function checkArrayAt(){Array.prototype.at||n(4)}(),function checkTypedArrayAt(){Uint8Array.prototype.at||n(78)}(),function checkStructuredClone(){globalThis.structuredClone||n(90)}()},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isNodeJS=void 0;const n=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=n},(t,e,n)=>{n(5);var r=n(77);t.exports=r("Array","at")},(t,e,n)=>{"use strict";var r=n(6),s=n(43),i=n(67),a=n(65),o=n(72);r({target:"Array",proto:!0},{at:function at(t){var e=s(this),n=i(e),r=a(t),o=r>=0?r:n+r;return o<0||o>=n?void 0:e[o]}}),o("at")},(t,e,n)=>{var r=n(7),s=n(8).f,i=n(47),a=n(51),o=n(41),l=n(59),c=n(71);t.exports=function(t,e){var n,d,h,u,p,f=t.target,g=t.global,m=t.stat;if(n=g?r:m?r[f]||o(f,{}):(r[f]||{}).prototype)for(d in e){if(u=e[d],h=t.dontCallGetSet?(p=s(n,d))&&p.value:n[d],!c(g?d:f+(m?".":"#")+d,t.forced)&&void 0!==h){if(typeof u==typeof h)continue;l(u,h)}(t.sham||h&&h.sham)&&i(u,"sham",!0),a(n,d,u,t)}}},function(t){var check=function(t){return t&&t.Math==Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||this||Function("return this")()},(t,e,n)=>{var r=n(9),s=n(11),i=n(13),a=n(14),o=n(15),l=n(21),c=n(42),d=n(45),h=Object.getOwnPropertyDescriptor;e.f=r?h:function getOwnPropertyDescriptor(t,e){if(t=o(t),e=l(e),d)try{return h(t,e)}catch(t){}if(c(t,e))return a(!s(i.f,t,e),t[e])}},(t,e,n)=>{var r=n(10);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},(t,e,n)=>{var r=n(12),s=Function.prototype.call;t.exports=r?s.bind(s):function(){return s.apply(s,arguments)}},(t,e,n)=>{var r=n(10);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},(t,e)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,s=r&&!n.call({1:2},1);e.f=s?function propertyIsEnumerable(t){var e=r(this,t);return!!e&&e.enumerable}:n},t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},(t,e,n)=>{var r=n(16),s=n(19);t.exports=function(t){return r(s(t))}},(t,e,n)=>{var r=n(17),s=n(10),i=n(18),a=Object,o=r("".split);t.exports=s((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?o(t,""):a(t)}:a},(t,e,n)=>{var r=n(12),s=Function.prototype,i=s.call,a=r&&s.bind.bind(i,i);t.exports=r?a:function(t){return function(){return i.apply(t,arguments)}}},(t,e,n)=>{var r=n(17),s=r({}.toString),i=r("".slice);t.exports=function(t){return i(s(t),8,-1)}},(t,e,n)=>{var r=n(20),s=TypeError;t.exports=function(t){if(r(t))throw s("Can't call method on "+t);return t}},t=>{t.exports=function(t){return null==t}},(t,e,n)=>{var r=n(22),s=n(26);t.exports=function(t){var e=r(t,"string");return s(e)?e:e+""}},(t,e,n)=>{var r=n(11),s=n(23),i=n(26),a=n(33),o=n(36),l=n(37),c=TypeError,d=l("toPrimitive");t.exports=function(t,e){if(!s(t)||i(t))return t;var n,l=a(t,d);if(l){if(void 0===e&&(e="default"),n=r(l,t,e),!s(n)||i(n))return n;throw c("Can't convert object to primitive value")}return void 0===e&&(e="number"),o(t,e)}},(t,e,n)=>{var r=n(24),s=n(25),i=s.all;t.exports=s.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:r(t)||t===i}:function(t){return"object"==typeof t?null!==t:r(t)}},(t,e,n)=>{var r=n(25),s=r.all;t.exports=r.IS_HTMLDDA?function(t){return"function"==typeof t||t===s}:function(t){return"function"==typeof t}},t=>{var e="object"==typeof document&&document.all,n=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:n}},(t,e,n)=>{var r=n(27),s=n(24),i=n(28),a=n(29),o=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return s(e)&&i(e.prototype,o(t))}},(t,e,n)=>{var r=n(7),s=n(24);t.exports=function(t,e){return arguments.length<2?(n=r[t],s(n)?n:void 0):r[t]&&r[t][e];var n}},(t,e,n)=>{var r=n(17);t.exports=r({}.isPrototypeOf)},(t,e,n)=>{var r=n(30);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,e,n)=>{var r=n(31),s=n(10),i=n(7).String;t.exports=!!Object.getOwnPropertySymbols&&!s((function(){var t=Symbol();return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},(t,e,n)=>{var r,s,i=n(7),a=n(32),o=i.process,l=i.Deno,c=o&&o.versions||l&&l.version,d=c&&c.v8;d&&(s=(r=d.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!s&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(s=+r[1]),t.exports=s},t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(t,e,n)=>{var r=n(34),s=n(20);t.exports=function(t,e){var n=t[e];return s(n)?void 0:r(n)}},(t,e,n)=>{var r=n(24),s=n(35),i=TypeError;t.exports=function(t){if(r(t))return t;throw i(s(t)+" is not a function")}},t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},(t,e,n)=>{var r=n(11),s=n(24),i=n(23),a=TypeError;t.exports=function(t,e){var n,o;if("string"===e&&s(n=t.toString)&&!i(o=r(n,t)))return o;if(s(n=t.valueOf)&&!i(o=r(n,t)))return o;if("string"!==e&&s(n=t.toString)&&!i(o=r(n,t)))return o;throw a("Can't convert object to primitive value")}},(t,e,n)=>{var r=n(7),s=n(38),i=n(42),a=n(44),o=n(30),l=n(29),c=r.Symbol,d=s("wks"),h=l?c.for||c:c&&c.withoutSetter||a;t.exports=function(t){return i(d,t)||(d[t]=o&&i(c,t)?c[t]:h("Symbol."+t)),d[t]}},(t,e,n)=>{var r=n(39),s=n(40);(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.30.2",mode:r?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,e,n)=>{var r=n(7),s=n(41),i="__core-js_shared__",a=r[i]||s(i,{});t.exports=a},(t,e,n)=>{var r=n(7),s=Object.defineProperty;t.exports=function(t,e){try{s(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},(t,e,n)=>{var r=n(17),s=n(43),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,e){return i(s(t),e)}},(t,e,n)=>{var r=n(19),s=Object;t.exports=function(t){return s(r(t))}},(t,e,n)=>{var r=n(17),s=0,i=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++s+i,36)}},(t,e,n)=>{var r=n(9),s=n(10),i=n(46);t.exports=!r&&!s((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},(t,e,n)=>{var r=n(7),s=n(23),i=r.document,a=s(i)&&s(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},(t,e,n)=>{var r=n(9),s=n(48),i=n(14);t.exports=r?function(t,e,n){return s.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},(t,e,n)=>{var r=n(9),s=n(45),i=n(49),a=n(50),o=n(21),l=TypeError,c=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h="enumerable",u="configurable",p="writable";e.f=r?i?function defineProperty(t,e,n){if(a(t),e=o(e),a(n),"function"==typeof t&&"prototype"===e&&"value"in n&&p in n&&!n[p]){var r=d(t,e);r&&r[p]&&(t[e]=n.value,n={configurable:u in n?n[u]:r[u],enumerable:h in n?n[h]:r[h],writable:!1})}return c(t,e,n)}:c:function defineProperty(t,e,n){if(a(t),e=o(e),a(n),s)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw l("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},(t,e,n)=>{var r=n(9),s=n(10);t.exports=r&&s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(t,e,n)=>{var r=n(23),s=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw i(s(t)+" is not an object")}},(t,e,n)=>{var r=n(24),s=n(48),i=n(52),a=n(41);t.exports=function(t,e,n,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:e;if(r(n)&&i(n,c,o),o.global)l?t[e]=n:a(e,n);else{try{o.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=n:s.f(t,e,{value:n,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}},(t,e,n)=>{var r=n(17),s=n(10),i=n(24),a=n(42),o=n(9),l=n(53).CONFIGURABLE,c=n(54),d=n(55),h=d.enforce,u=d.get,p=String,f=Object.defineProperty,g=r("".slice),m=r("".replace),v=r([].join),b=o&&!s((function(){return 8!==f((function(){}),"length",{value:8}).length})),y=String(String).split("String"),A=t.exports=function(t,e,n){"Symbol("===g(p(e),0,7)&&(e="["+m(p(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!a(t,"name")||l&&t.name!==e)&&(o?f(t,"name",{value:e,configurable:!0}):t.name=e),b&&n&&a(n,"arity")&&t.length!==n.arity&&f(t,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?o&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=h(t);return a(r,"source")||(r.source=v(y,"string"==typeof e?e:"")),t};Function.prototype.toString=A((function toString(){return i(this)&&u(this).source||c(this)}),"toString")},(t,e,n)=>{var r=n(9),s=n(42),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,o=s(i,"name"),l=o&&"something"===function something(){}.name,c=o&&(!r||r&&a(i,"name").configurable);t.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},(t,e,n)=>{var r=n(17),s=n(24),i=n(40),a=r(Function.toString);s(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},(t,e,n)=>{var r,s,i,a=n(56),o=n(7),l=n(23),c=n(47),d=n(42),h=n(40),u=n(57),p=n(58),f="Object already initialized",g=o.TypeError,m=o.WeakMap;if(a||h.state){var v=h.state||(h.state=new m);v.get=v.get,v.has=v.has,v.set=v.set,r=function(t,e){if(v.has(t))throw g(f);return e.facade=t,v.set(t,e),e},s=function(t){return v.get(t)||{}},i=function(t){return v.has(t)}}else{var b=u("state");p[b]=!0,r=function(t,e){if(d(t,b))throw g(f);return e.facade=t,c(t,b,e),e},s=function(t){return d(t,b)?t[b]:{}},i=function(t){return d(t,b)}}t.exports={set:r,get:s,has:i,enforce:function(t){return i(t)?s(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!l(e)||(n=s(e)).type!==t)throw g("Incompatible receiver, "+t+" required");return n}}}},(t,e,n)=>{var r=n(7),s=n(24),i=r.WeakMap;t.exports=s(i)&&/native code/.test(String(i))},(t,e,n)=>{var r=n(38),s=n(44),i=r("keys");t.exports=function(t){return i[t]||(i[t]=s(t))}},t=>{t.exports={}},(t,e,n)=>{var r=n(42),s=n(60),i=n(8),a=n(48);t.exports=function(t,e,n){for(var o=s(e),l=a.f,c=i.f,d=0;d<o.length;d++){var h=o[d];r(t,h)||n&&r(n,h)||l(t,h,c(e,h))}}},(t,e,n)=>{var r=n(27),s=n(17),i=n(61),a=n(70),o=n(50),l=s([].concat);t.exports=r("Reflect","ownKeys")||function ownKeys(t){var e=i.f(o(t)),n=a.f;return n?l(e,n(t)):e}},(t,e,n)=>{var r=n(62),s=n(69).concat("length","prototype");e.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return r(t,s)}},(t,e,n)=>{var r=n(17),s=n(42),i=n(15),a=n(63).indexOf,o=n(58),l=r([].push);t.exports=function(t,e){var n,r=i(t),c=0,d=[];for(n in r)!s(o,n)&&s(r,n)&&l(d,n);for(;e.length>c;)s(r,n=e[c++])&&(~a(d,n)||l(d,n));return d}},(t,e,n)=>{var r=n(15),s=n(64),i=n(67),createMethod=function(t){return function(e,n,a){var o,l=r(e),c=i(l),d=s(a,c);if(t&&n!=n){for(;c>d;)if((o=l[d++])!=o)return!0}else for(;c>d;d++)if((t||d in l)&&l[d]===n)return t||d||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(t,e,n)=>{var r=n(65),s=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?s(n+e,0):i(n,e)}},(t,e,n)=>{var r=n(66);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},t=>{var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function trunc(t){var r=+t;return(r>0?n:e)(r)}},(t,e,n)=>{var r=n(68);t.exports=function(t){return r(t.length)}},(t,e,n)=>{var r=n(65),s=Math.min;t.exports=function(t){return t>0?s(r(t),9007199254740991):0}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,e)=>{e.f=Object.getOwnPropertySymbols},(t,e,n)=>{var r=n(10),s=n(24),i=/#|\.prototype\./,isForced=function(t,e){var n=o[a(t)];return n==c||n!=l&&(s(e)?r(e):!!e)},a=isForced.normalize=function(t){return String(t).replace(i,".").toLowerCase()},o=isForced.data={},l=isForced.NATIVE="N",c=isForced.POLYFILL="P";t.exports=isForced},(t,e,n)=>{var r=n(37),s=n(73),i=n(48).f,a=r("unscopables"),o=Array.prototype;null==o[a]&&i(o,a,{configurable:!0,value:s(null)}),t.exports=function(t){o[a][t]=!0}},(t,e,n)=>{var r,s=n(50),i=n(74),a=n(69),o=n(58),l=n(76),c=n(46),d=n(57),h="prototype",u="script",p=d("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<"+u+">"+t+"</"+u+">"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag("")),t.close();var e=t.parentWindow.Object;return t=null,e},NullProtoObject=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;NullProtoObject="undefined"!=typeof document?document.domain&&r?NullProtoObjectViaActiveX(r):(e=c("iframe"),n="java"+u+":",e.style.display="none",l.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F):NullProtoObjectViaActiveX(r);for(var s=a.length;s--;)delete NullProtoObject[h][a[s]];return NullProtoObject()};o[p]=!0,t.exports=Object.create||function create(t,e){var n;return null!==t?(EmptyConstructor[h]=s(t),n=new EmptyConstructor,EmptyConstructor[h]=null,n[p]=t):n=NullProtoObject(),void 0===e?n:i.f(n,e)}},(t,e,n)=>{var r=n(9),s=n(49),i=n(48),a=n(50),o=n(15),l=n(75);e.f=r&&!s?Object.defineProperties:function defineProperties(t,e){a(t);for(var n,r=o(e),s=l(e),c=s.length,d=0;c>d;)i.f(t,n=s[d++],r[n]);return t}},(t,e,n)=>{var r=n(62),s=n(69);t.exports=Object.keys||function keys(t){return r(t,s)}},(t,e,n)=>{var r=n(27);t.exports=r("document","documentElement")},(t,e,n)=>{var r=n(7),s=n(17);t.exports=function(t,e){return s(r[t].prototype[e])}},(t,e,n)=>{n(79)},(t,e,n)=>{"use strict";var r=n(80),s=n(67),i=n(65),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("at",(function at(t){var e=a(this),n=s(e),r=i(t),o=r>=0?r:n+r;return o<0||o>=n?void 0:e[o]}))},(t,e,n)=>{"use strict";var r,s,i,a=n(81),o=n(9),l=n(7),c=n(24),d=n(23),h=n(42),u=n(82),p=n(35),f=n(47),g=n(51),m=n(84),v=n(28),b=n(85),y=n(87),A=n(37),_=n(44),S=n(55),x=S.enforce,E=S.get,C=l.Int8Array,w=C&&C.prototype,P=l.Uint8ClampedArray,T=P&&P.prototype,k=C&&b(C),M=w&&b(w),R=Object.prototype,D=l.TypeError,I=A("toStringTag"),O=_("TYPED_ARRAY_TAG"),L="TypedArrayConstructor",N=a&&!!y&&"Opera"!==u(l.opera),j=!1,B={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(t){var e=b(t);if(d(e)){var n=E(e);return n&&h(n,L)?n[L]:getTypedArrayConstructor(e)}},isTypedArray=function(t){if(!d(t))return!1;var e=u(t);return h(B,e)||h(U,e)};for(r in B)(i=(s=l[r])&&s.prototype)?x(i)[L]=s:N=!1;for(r in U)(i=(s=l[r])&&s.prototype)&&(x(i)[L]=s);if((!N||!c(k)||k===Function.prototype)&&(k=function TypedArray(){throw D("Incorrect invocation")},N))for(r in B)l[r]&&y(l[r],k);if((!N||!M||M===R)&&(M=k.prototype,N))for(r in B)l[r]&&y(l[r].prototype,M);if(N&&b(T)!==M&&y(T,M),o&&!h(M,I))for(r in j=!0,m(M,I,{configurable:!0,get:function(){return d(this)?this[O]:void 0}}),B)l[r]&&f(l[r],O,r);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:N,TYPED_ARRAY_TAG:j&&O,aTypedArray:function(t){if(isTypedArray(t))return t;throw D("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!y||v(k,t)))return t;throw D(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,n,r){if(o){if(n)for(var s in B){var i=l[s];if(i&&h(i.prototype,t))try{delete i.prototype[t]}catch(n){try{i.prototype[t]=e}catch(t){}}}M[t]&&!n||g(M,t,n?e:N&&w[t]||e,r)}},exportTypedArrayStaticMethod:function(t,e,n){var r,s;if(o){if(y){if(n)for(r in B)if((s=l[r])&&h(s,t))try{delete s[t]}catch(t){}if(k[t]&&!n)return;try{return g(k,t,n?e:N&&k[t]||e)}catch(t){}}for(r in B)!(s=l[r])||s[t]&&!n||g(s,t,e)}},getTypedArrayConstructor:getTypedArrayConstructor,isView:function isView(t){if(!d(t))return!1;var e=u(t);return"DataView"===e||h(B,e)||h(U,e)},isTypedArray:isTypedArray,TypedArray:k,TypedArrayPrototype:M}},t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(t,e,n)=>{var r=n(83),s=n(24),i=n(18),a=n(37)("toStringTag"),o=Object,l="Arguments"==i(function(){return arguments}());t.exports=r?i:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=o(t),a))?n:l?i(e):"Object"==(r=i(e))&&s(e.callee)?"Arguments":r}},(t,e,n)=>{var r={};r[n(37)("toStringTag")]="z",t.exports="[object z]"===String(r)},(t,e,n)=>{var r=n(52),s=n(48);t.exports=function(t,e,n){return n.get&&r(n.get,e,{getter:!0}),n.set&&r(n.set,e,{setter:!0}),s.f(t,e,n)}},(t,e,n)=>{var r=n(42),s=n(24),i=n(43),a=n(57),o=n(86),l=a("IE_PROTO"),c=Object,d=c.prototype;t.exports=o?c.getPrototypeOf:function(t){var e=i(t);if(r(e,l))return e[l];var n=e.constructor;return s(n)&&e instanceof n?n.prototype:e instanceof c?d:null}},(t,e,n)=>{var r=n(10);t.exports=!r((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype}))},(t,e,n)=>{var r=n(88),s=n(50),i=n(89);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=r(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function setPrototypeOf(n,r){return s(n),i(r),e?t(n,r):n.__proto__=r,n}}():void 0)},(t,e,n)=>{var r=n(17),s=n(34);t.exports=function(t,e,n){try{return r(s(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}}},(t,e,n)=>{var r=n(24),s=String,i=TypeError;t.exports=function(t){if("object"==typeof t||r(t))return t;throw i("Can't set "+s(t)+" as a prototype")}},(t,e,n)=>{n(91),n(98),n(100),n(123),n(125);var r=n(137);t.exports=r.structuredClone},(t,e,n)=>{"use strict";var r=n(15),s=n(72),i=n(92),a=n(55),o=n(48).f,l=n(93),c=n(97),d=n(39),h=n(9),u="Array Iterator",p=a.set,f=a.getterFor(u);t.exports=l(Array,"Array",(function(t,e){p(this,{type:u,target:r(t),index:0,kind:e})}),(function(){var t=f(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,c(void 0,!0)):c("keys"==n?r:"values"==n?e[r]:[r,e[r]],!1)}),"values");var g=i.Arguments=i.Array;if(s("keys"),s("values"),s("entries"),!d&&h&&"values"!==g.name)try{o(g,"name",{value:"values"})}catch(t){}},t=>{t.exports={}},(t,e,n)=>{"use strict";var r=n(6),s=n(11),i=n(39),a=n(53),o=n(24),l=n(94),c=n(85),d=n(87),h=n(96),u=n(47),p=n(51),f=n(37),g=n(92),m=n(95),v=a.PROPER,b=a.CONFIGURABLE,y=m.IteratorPrototype,A=m.BUGGY_SAFARI_ITERATORS,_=f("iterator"),S="keys",x="values",E="entries",returnThis=function(){return this};t.exports=function(t,e,n,a,f,m,C){l(n,e,a);var w,P,T,getIterationMethod=function(t){if(t===f&&I)return I;if(!A&&t in R)return R[t];switch(t){case S:return function keys(){return new n(this,t)};case x:return function values(){return new n(this,t)};case E:return function entries(){return new n(this,t)}}return function(){return new n(this)}},k=e+" Iterator",M=!1,R=t.prototype,D=R[_]||R["@@iterator"]||f&&R[f],I=!A&&D||getIterationMethod(f),O="Array"==e&&R.entries||D;if(O&&(w=c(O.call(new t)))!==Object.prototype&&w.next&&(i||c(w)===y||(d?d(w,y):o(w[_])||p(w,_,returnThis)),h(w,k,!0,!0),i&&(g[k]=returnThis)),v&&f==x&&D&&D.name!==x&&(!i&&b?u(R,"name",x):(M=!0,I=function values(){return s(D,this)})),f)if(P={values:getIterationMethod(x),keys:m?I:getIterationMethod(S),entries:getIterationMethod(E)},C)for(T in P)(A||M||!(T in R))&&p(R,T,P[T]);else r({target:e,proto:!0,forced:A||M},P);return i&&!C||R[_]===I||p(R,_,I,{name:f}),g[e]=I,P}},(t,e,n)=>{"use strict";var r=n(95).IteratorPrototype,s=n(73),i=n(14),a=n(96),o=n(92),returnThis=function(){return this};t.exports=function(t,e,n,l){var c=e+" Iterator";return t.prototype=s(r,{next:i(+!l,n)}),a(t,c,!1,!0),o[c]=returnThis,t}},(t,e,n)=>{"use strict";var r,s,i,a=n(10),o=n(24),l=n(23),c=n(73),d=n(85),h=n(51),u=n(37),p=n(39),f=u("iterator"),g=!1;[].keys&&("next"in(i=[].keys())?(s=d(d(i)))!==Object.prototype&&(r=s):g=!0),!l(r)||a((function(){var t={};return r[f].call(t)!==t}))?r={}:p&&(r=c(r)),o(r[f])||h(r,f,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:g}},(t,e,n)=>{var r=n(48).f,s=n(42),i=n(37)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!s(t,i)&&r(t,i,{configurable:!0,value:e})}},t=>{t.exports=function(t,e){return{value:t,done:e}}},(t,e,n)=>{var r=n(83),s=n(51),i=n(99);r||s(Object.prototype,"toString",i,{unsafe:!0})},(t,e,n)=>{"use strict";var r=n(83),s=n(82);t.exports=r?{}.toString:function toString(){return"[object "+s(this)+"]"}},(t,e,n)=>{n(101)},(t,e,n)=>{"use strict";n(102)("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),n(120))},(t,e,n)=>{"use strict";var r=n(6),s=n(7),i=n(17),a=n(71),o=n(51),l=n(103),c=n(110),d=n(117),h=n(24),u=n(20),p=n(23),f=n(10),g=n(118),m=n(96),v=n(119);t.exports=function(t,e,n){var b=-1!==t.indexOf("Map"),y=-1!==t.indexOf("Weak"),A=b?"set":"add",_=s[t],S=_&&_.prototype,x=_,E={},fixMethod=function(t){var e=i(S[t]);o(S,t,"add"==t?function add(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(y&&!p(t))&&e(this,0===t?0:t)}:"get"==t?function get(t){return y&&!p(t)?void 0:e(this,0===t?0:t)}:"has"==t?function has(t){return!(y&&!p(t))&&e(this,0===t?0:t)}:function set(t,n){return e(this,0===t?0:t,n),this})};if(a(t,!h(_)||!(y||S.forEach&&!f((function(){(new _).entries().next()})))))x=n.getConstructor(e,t,b,A),l.enable();else if(a(t,!0)){var C=new x,w=C[A](y?{}:-0,1)!=C,P=f((function(){C.has(1)})),T=g((function(t){new _(t)})),k=!y&&f((function(){for(var t=new _,e=5;e--;)t[A](e,e);return!t.has(-0)}));T||((x=e((function(t,e){d(t,S);var n=v(new _,t,x);return u(e)||c(e,n[A],{that:n,AS_ENTRIES:b}),n}))).prototype=S,S.constructor=x),(P||k)&&(fixMethod("delete"),fixMethod("has"),b&&fixMethod("get")),(k||w)&&fixMethod(A),y&&S.clear&&delete S.clear}return E[t]=x,r({global:!0,constructor:!0,forced:x!=_},E),m(x,t),y||n.setStrong(x,t,b),x}},(t,e,n)=>{var r=n(6),s=n(17),i=n(58),a=n(23),o=n(42),l=n(48).f,c=n(61),d=n(104),h=n(107),u=n(44),p=n(109),f=!1,g=u("meta"),m=0,setMetadata=function(t){l(t,g,{value:{objectID:"O"+m++,weakData:{}}})},v=t.exports={enable:function(){v.enable=function(){},f=!0;var t=c.f,e=s([].splice),n={};n[g]=1,t(n).length&&(c.f=function(n){for(var r=t(n),s=0,i=r.length;s<i;s++)if(r[s]===g){e(r,s,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:d.f}))},fastKey:function(t,e){if(!a(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,g)){if(!h(t))return"F";if(!e)return"E";setMetadata(t)}return t[g].objectID},getWeakData:function(t,e){if(!o(t,g)){if(!h(t))return!0;if(!e)return!1;setMetadata(t)}return t[g].weakData},onFreeze:function(t){return p&&f&&h(t)&&!o(t,g)&&setMetadata(t),t}};i[g]=!0},(t,e,n)=>{var r=n(18),s=n(15),i=n(61).f,a=n(105),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function getOwnPropertyNames(t){return o&&"Window"==r(t)?function(t){try{return i(t)}catch(t){return a(o)}}(t):i(s(t))}},(t,e,n)=>{var r=n(64),s=n(67),i=n(106),a=Array,o=Math.max;t.exports=function(t,e,n){for(var l=s(t),c=r(e,l),d=r(void 0===n?l:n,l),h=a(o(d-c,0)),u=0;c<d;c++,u++)i(h,u,t[c]);return h.length=u,h}},(t,e,n)=>{"use strict";var r=n(21),s=n(48),i=n(14);t.exports=function(t,e,n){var a=r(e);a in t?s.f(t,a,i(0,n)):t[a]=n}},(t,e,n)=>{var r=n(10),s=n(23),i=n(18),a=n(108),o=Object.isExtensible,l=r((function(){o(1)}));t.exports=l||a?function isExtensible(t){return!!s(t)&&((!a||"ArrayBuffer"!=i(t))&&(!o||o(t)))}:o},(t,e,n)=>{var r=n(10);t.exports=r((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},(t,e,n)=>{var r=n(10);t.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},(t,e,n)=>{var r=n(111),s=n(11),i=n(50),a=n(35),o=n(113),l=n(67),c=n(28),d=n(114),h=n(115),u=n(116),p=TypeError,Result=function(t,e){this.stopped=t,this.result=e},f=Result.prototype;t.exports=function(t,e,n){var g,m,v,b,y,A,_,S=n&&n.that,x=!(!n||!n.AS_ENTRIES),E=!(!n||!n.IS_RECORD),C=!(!n||!n.IS_ITERATOR),w=!(!n||!n.INTERRUPTED),P=r(e,S),stop=function(t){return g&&u(g,"normal",t),new Result(!0,t)},callFn=function(t){return x?(i(t),w?P(t[0],t[1],stop):P(t[0],t[1])):w?P(t,stop):P(t)};if(E)g=t.iterator;else if(C)g=t;else{if(!(m=h(t)))throw p(a(t)+" is not iterable");if(o(m)){for(v=0,b=l(t);b>v;v++)if((y=callFn(t[v]))&&c(f,y))return y;return new Result(!1)}g=d(t,m)}for(A=E?t.next:g.next;!(_=s(A,g)).done;){try{y=callFn(_.value)}catch(t){u(g,"throw",t)}if("object"==typeof y&&y&&c(f,y))return y}return new Result(!1)}},(t,e,n)=>{var r=n(112),s=n(34),i=n(12),a=r(r.bind);t.exports=function(t,e){return s(t),void 0===e?t:i?a(t,e):function(){return t.apply(e,arguments)}}},(t,e,n)=>{var r=n(18),s=n(17);t.exports=function(t){if("Function"===r(t))return s(t)}},(t,e,n)=>{var r=n(37),s=n(92),i=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(s.Array===t||a[i]===t)}},(t,e,n)=>{var r=n(11),s=n(34),i=n(50),a=n(35),o=n(115),l=TypeError;t.exports=function(t,e){var n=arguments.length<2?o(t):e;if(s(n))return i(r(n,t));throw l(a(t)+" is not iterable")}},(t,e,n)=>{var r=n(82),s=n(33),i=n(20),a=n(92),o=n(37)("iterator");t.exports=function(t){if(!i(t))return s(t,o)||s(t,"@@iterator")||a[r(t)]}},(t,e,n)=>{var r=n(11),s=n(50),i=n(33);t.exports=function(t,e,n){var a,o;s(t);try{if(!(a=i(t,"return"))){if("throw"===e)throw n;return n}a=r(a,t)}catch(t){o=!0,a=t}if("throw"===e)throw n;if(o)throw a;return s(a),n}},(t,e,n)=>{var r=n(28),s=TypeError;t.exports=function(t,e){if(r(e,t))return t;throw s("Incorrect invocation")}},(t,e,n)=>{var r=n(37)("iterator"),s=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){s=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!s)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}},(t,e,n)=>{var r=n(24),s=n(23),i=n(87);t.exports=function(t,e,n){var a,o;return i&&r(a=e.constructor)&&a!==n&&s(o=a.prototype)&&o!==n.prototype&&i(t,o),t}},(t,e,n)=>{"use strict";var r=n(73),s=n(84),i=n(121),a=n(111),o=n(117),l=n(20),c=n(110),d=n(93),h=n(97),u=n(122),p=n(9),f=n(103).fastKey,g=n(55),m=g.set,v=g.getterFor;t.exports={getConstructor:function(t,e,n,d){var h=t((function(t,s){o(t,u),m(t,{type:e,index:r(null),first:void 0,last:void 0,size:0}),p||(t.size=0),l(s)||c(s,t[d],{that:t,AS_ENTRIES:n})})),u=h.prototype,g=v(e),define=function(t,e,n){var r,s,i=g(t),a=getEntry(t,e);return a?a.value=n:(i.last=a={index:s=f(e,!0),key:e,value:n,previous:r=i.last,next:void 0,removed:!1},i.first||(i.first=a),r&&(r.next=a),p?i.size++:t.size++,"F"!==s&&(i.index[s]=a)),t},getEntry=function(t,e){var n,r=g(t),s=f(e);if("F"!==s)return r.index[s];for(n=r.first;n;n=n.next)if(n.key==e)return n};return i(u,{clear:function clear(){for(var t=g(this),e=t.index,n=t.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete e[n.index],n=n.next;t.first=t.last=void 0,p?t.size=0:this.size=0},delete:function(t){var e=this,n=g(e),r=getEntry(e,t);if(r){var s=r.next,i=r.previous;delete n.index[r.index],r.removed=!0,i&&(i.next=s),s&&(s.previous=i),n.first==r&&(n.first=s),n.last==r&&(n.last=i),p?n.size--:e.size--}return!!r},forEach:function forEach(t){for(var e,n=g(this),r=a(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function has(t){return!!getEntry(this,t)}}),i(u,n?{get:function get(t){var e=getEntry(this,t);return e&&e.value},set:function set(t,e){return define(this,0===t?0:t,e)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}}),p&&s(u,"size",{configurable:!0,get:function(){return g(this).size}}),h},setStrong:function(t,e,n){var r=e+" Iterator",s=v(e),i=v(r);d(t,e,(function(t,e){m(this,{type:r,target:t,state:s(t),kind:e,last:void 0})}),(function(){for(var t=i(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?h("keys"==e?n.key:"values"==e?n.value:[n.key,n.value],!1):(t.target=void 0,h(void 0,!0))}),n?"entries":"values",!n,!0),u(e)}}},(t,e,n)=>{var r=n(51);t.exports=function(t,e,n){for(var s in e)r(t,s,e[s],n);return t}},(t,e,n)=>{"use strict";var r=n(27),s=n(84),i=n(37),a=n(9),o=i("species");t.exports=function(t){var e=r(t);a&&e&&!e[o]&&s(e,o,{configurable:!0,get:function(){return this}})}},(t,e,n)=>{n(124)},(t,e,n)=>{"use strict";n(102)("Set",(function(t){return function Set(){return t(this,arguments.length?arguments[0]:void 0)}}),n(120))},(t,e,n)=>{var r,s=n(39),i=n(6),a=n(7),o=n(27),l=n(17),c=n(10),d=n(44),h=n(24),u=n(126),p=n(20),f=n(23),g=n(26),m=n(110),v=n(50),b=n(82),y=n(42),A=n(106),_=n(47),S=n(67),x=n(127),E=n(128),C=n(130),w=n(131),P=n(132),T=n(133),k=a.Object,M=a.Array,R=a.Date,D=a.Error,I=a.EvalError,O=a.RangeError,L=a.ReferenceError,N=a.SyntaxError,j=a.TypeError,B=a.URIError,U=a.PerformanceMark,W=a.WebAssembly,q=W&&W.CompileError||D,G=W&&W.LinkError||D,H=W&&W.RuntimeError||D,z=o("DOMException"),V=C.Map,X=C.has,$=C.get,Y=C.set,K=w.Set,J=w.add,Q=o("Object","keys"),Z=l([].push),tt=l((!0).valueOf),et=l(1..valueOf),nt=l("".valueOf),rt=l(R.prototype.getTime),st=d("structuredClone"),it="DataCloneError",ot="Transferring",checkBasicSemantic=function(t){return!c((function(){var e=new a.Set([7]),n=t(e),r=t(k(7));return n==e||!n.has(7)||"object"!=typeof r||7!=r}))&&t},checkErrorsCloning=function(t,e){return!c((function(){var n=new e,r=t({a:n,b:n});return!(r&&r.a===r.b&&r.a instanceof e&&r.a.stack===n.stack)}))},lt=a.structuredClone,ct=s||!checkErrorsCloning(lt,D)||!checkErrorsCloning(lt,z)||(r=lt,!!c((function(){var t=r(new a.AggregateError([1],st,{cause:3}));return"AggregateError"!=t.name||1!=t.errors[0]||t.message!=st||3!=t.cause}))),dt=!lt&&checkBasicSemantic((function(t){return new U(st,{detail:t}).detail})),ht=checkBasicSemantic(lt)||dt,throwUncloneable=function(t){throw new z("Uncloneable type: "+t,it)},throwUnpolyfillable=function(t,e){throw new z((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",it)},tryNativeRestrictedStructuredClone=function(t,e){return ht||throwUnpolyfillable(e),ht(t)},structuredCloneInternal=function(t,e){if(g(t)&&throwUncloneable("Symbol"),!f(t))return t;if(e){if(X(e,t))return $(e,t)}else e=new V;var n,r,s,i,l,c,d,u,p,m,v,x=b(t),C=!1;switch(x){case"Array":s=M(S(t)),C=!0;break;case"Object":s={},C=!0;break;case"Map":s=new V,C=!0;break;case"Set":s=new K,C=!0;break;case"RegExp":s=new RegExp(t.source,E(t));break;case"Error":switch(r=t.name){case"AggregateError":s=o("AggregateError")([]);break;case"EvalError":s=I();break;case"RangeError":s=O();break;case"ReferenceError":s=L();break;case"SyntaxError":s=N();break;case"TypeError":s=j();break;case"URIError":s=B();break;case"CompileError":s=q();break;case"LinkError":s=G();break;case"RuntimeError":s=H();break;default:s=D()}C=!0;break;case"DOMException":s=new z(t.message,t.name),C=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":n=a[x],f(n)||throwUnpolyfillable(x),s=new n(structuredCloneInternal(t.buffer,e),t.byteOffset,"DataView"===x?t.byteLength:t.length);break;case"DOMQuad":try{s=new DOMQuad(structuredCloneInternal(t.p1,e),structuredCloneInternal(t.p2,e),structuredCloneInternal(t.p3,e),structuredCloneInternal(t.p4,e))}catch(e){s=tryNativeRestrictedStructuredClone(t,x)}break;case"File":if(ht)try{s=ht(t),b(s)!==x&&(s=void 0)}catch(t){}if(!s)try{s=new File([t],t.name,t)}catch(t){}s||throwUnpolyfillable(x);break;case"FileList":if(i=function(){var t;try{t=new a.DataTransfer}catch(e){try{t=new a.ClipboardEvent("").clipboardData}catch(t){}}return t&&t.items&&t.files?t:null}()){for(l=0,c=S(t);l<c;l++)i.items.add(structuredCloneInternal(t[l],e));s=i.files}else s=tryNativeRestrictedStructuredClone(t,x);break;case"ImageData":try{s=new ImageData(structuredCloneInternal(t.data,e),t.width,t.height,{colorSpace:t.colorSpace})}catch(e){s=tryNativeRestrictedStructuredClone(t,x)}break;default:if(ht)s=ht(t);else switch(x){case"BigInt":s=k(t.valueOf());break;case"Boolean":s=k(tt(t));break;case"Number":s=k(et(t));break;case"String":s=k(nt(t));break;case"Date":s=new R(rt(t));break;case"ArrayBuffer":(n=a.DataView)||"function"==typeof t.slice||throwUnpolyfillable(x);try{if("function"!=typeof t.slice||t.resizable){c=t.byteLength,v="maxByteLength"in t?{maxByteLength:t.maxByteLength}:void 0,s=new ArrayBuffer(c,v),p=new n(t),m=new n(s);for(l=0;l<c;l++)m.setUint8(l,p.getUint8(l))}else s=t.slice(0)}catch(t){throw new z("ArrayBuffer is detached",it)}break;case"SharedArrayBuffer":s=t;break;case"Blob":try{s=t.slice(0,t.size,t.type)}catch(t){throwUnpolyfillable(x)}break;case"DOMPoint":case"DOMPointReadOnly":n=a[x];try{s=n.fromPoint?n.fromPoint(t):new n(t.x,t.y,t.z,t.w)}catch(t){throwUnpolyfillable(x)}break;case"DOMRect":case"DOMRectReadOnly":n=a[x];try{s=n.fromRect?n.fromRect(t):new n(t.x,t.y,t.width,t.height)}catch(t){throwUnpolyfillable(x)}break;case"DOMMatrix":case"DOMMatrixReadOnly":n=a[x];try{s=n.fromMatrix?n.fromMatrix(t):new n(t)}catch(t){throwUnpolyfillable(x)}break;case"AudioData":case"VideoFrame":h(t.clone)||throwUnpolyfillable(x);try{s=t.clone()}catch(t){throwUncloneable(x)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":throwUnpolyfillable(x);default:throwUncloneable(x)}}if(Y(e,t,s),C)switch(x){case"Array":case"Object":for(d=Q(t),l=0,c=S(d);l<c;l++)u=d[l],A(s,u,structuredCloneInternal(t[u],e));break;case"Map":t.forEach((function(t,n){Y(s,structuredCloneInternal(n,e),structuredCloneInternal(t,e))}));break;case"Set":t.forEach((function(t){J(s,structuredCloneInternal(t,e))}));break;case"Error":_(s,"message",structuredCloneInternal(t.message,e)),y(t,"cause")&&_(s,"cause",structuredCloneInternal(t.cause,e)),"AggregateError"==r&&(s.errors=structuredCloneInternal(t.errors,e));case"DOMException":P&&_(s,"stack",structuredCloneInternal(t.stack,e))}return s};i({global:!0,enumerable:!0,sham:!T,forced:ct},{structuredClone:function structuredClone(t){var e,n=x(arguments.length,1)>1&&!p(arguments[1])?v(arguments[1]):void 0,r=n?n.transfer:void 0;return void 0!==r&&function(t,e){if(!f(t))throw j("Transfer option cannot be converted to a sequence");var n=[];m(t,(function(t){Z(n,v(t))}));var r,s,i,o,l,c,d=0,p=S(n);if(T)for(o=lt(n,{transfer:n});d<p;)Y(e,n[d],o[d++]);else for(;d<p;){if(r=n[d++],X(e,r))throw new z("Duplicate transferable",it);switch(s=b(r)){case"ImageBitmap":i=a.OffscreenCanvas,u(i)||throwUnpolyfillable(s,ot);try{(c=new i(r.width,r.height)).getContext("bitmaprenderer").transferFromImageBitmap(r),l=c.transferToImageBitmap()}catch(t){}break;case"AudioData":case"VideoFrame":h(r.clone)&&h(r.close)||throwUnpolyfillable(s,ot);try{l=r.clone(),r.close()}catch(t){}break;case"ArrayBuffer":h(r.transfer)||throwUnpolyfillable(s,ot),l=r.transfer();break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":throwUnpolyfillable(s,ot)}if(void 0===l)throw new z("This object cannot be transferred: "+s,it);Y(e,r,l)}}(r,e=new V),structuredCloneInternal(t,e)}})},(t,e,n)=>{var r=n(17),s=n(10),i=n(24),a=n(82),o=n(27),l=n(54),noop=function(){},c=[],d=o("Reflect","construct"),h=/^\s*(?:class|function)\b/,u=r(h.exec),p=!h.exec(noop),f=function isConstructor(t){if(!i(t))return!1;try{return d(noop,c,t),!0}catch(t){return!1}},g=function isConstructor(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!u(h,l(t))}catch(t){return!0}};g.sham=!0,t.exports=!d||s((function(){var t;return f(f.call)||!f(Object)||!f((function(){t=!0}))||t}))?g:f},t=>{var e=TypeError;t.exports=function(t,n){if(t<n)throw e("Not enough arguments");return t}},(t,e,n)=>{var r=n(11),s=n(42),i=n(28),a=n(129),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in o||s(t,"flags")||!i(o,t)?e:r(a,t)}},(t,e,n)=>{"use strict";var r=n(50);t.exports=function(){var t=r(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},(t,e,n)=>{var r=n(17),s=Map.prototype;t.exports={Map:Map,set:r(s.set),get:r(s.get),has:r(s.has),remove:r(s.delete),proto:s}},(t,e,n)=>{var r=n(17),s=Set.prototype;t.exports={Set:Set,add:r(s.add),has:r(s.has),remove:r(s.delete),proto:s}},(t,e,n)=>{var r=n(10),s=n(14);t.exports=!r((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",s(1,7)),7!==t.stack)}))},(t,e,n)=>{var r=n(7),s=n(10),i=n(31),a=n(134),o=n(135),l=n(136),c=r.structuredClone;t.exports=!!c&&!s((function(){if(o&&i>92||l&&i>94||a&&i>97)return!1;var t=new ArrayBuffer(8),e=c(t,{transfer:[t]});return 0!=t.byteLength||8!=e.byteLength}))},(t,e,n)=>{var r=n(135),s=n(136);t.exports=!r&&!s&&"object"==typeof window&&"object"==typeof document},t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(t,e,n)=>{var r=n(18);t.exports="undefined"!=typeof process&&"process"==r(process)},(t,e,n)=>{var r=n(7);t.exports=r},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(139),_display_utils=__w_pdfjs_require__(142),_font_loader=__w_pdfjs_require__(145),_canvas=__w_pdfjs_require__(146),_worker_options=__w_pdfjs_require__(149),_is_node=__w_pdfjs_require__(3),_message_handler=__w_pdfjs_require__(150),_metadata=__w_pdfjs_require__(151),_optional_content_config=__w_pdfjs_require__(152),_transport_stream=__w_pdfjs_require__(153),_xfa_text=__w_pdfjs_require__(154);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultFilterFactory=_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory,createPDFNetworkStream;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory:t,NodeCMapReaderFactory:e,NodeFilterFactory:n,NodeStandardFontDataFactory:r}=__w_pdfjs_require__(155);exports.DefaultCanvasFactory=DefaultCanvasFactory=t,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=e,exports.DefaultFilterFactory=DefaultFilterFactory=n,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=r}if(_is_node.isNodeJS){const{PDFNodeStream:t}=__w_pdfjs_require__(156);createPDFNetworkStream=e=>new t(e)}else{const{PDFNetworkStream:t}=__w_pdfjs_require__(159),{PDFFetchStream:e}=__w_pdfjs_require__(160);createPDFNetworkStream=n=>(0,_display_utils.isValidFetchUrl)(n.url)?new e(n):new t(n)}function getDocument(t){if("string"==typeof t||t instanceof URL?t={url:t}:(0,_util.isArrayBuffer)(t)&&(t={data:t}),"object"!=typeof t)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const e=new PDFDocumentLoadingTask,{docId:n}=e,r=t.url?getUrlProp(t.url):null,s=t.data?getDataProp(t.data):null,i=t.httpHeaders||null,a=!0===t.withCredentials,o=t.password??null,l=t.range instanceof PDFDataRangeTransport?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let d=t.worker instanceof PDFWorker?t.worker:null;const h=t.verbosity,u="string"!=typeof t.docBaseUrl||(0,_display_utils.isDataScheme)(t.docBaseUrl)?null:t.docBaseUrl,p="string"==typeof t.cMapUrl?t.cMapUrl:null,f=!1!==t.cMapPacked,g=t.CMapReaderFactory||DefaultCMapReaderFactory,m="string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,v=t.StandardFontDataFactory||DefaultStandardFontDataFactory,b=!0!==t.stopAtErrors,y=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,A=!1!==t.isEvalSupported,_="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!_is_node.isNodeJS,S=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,x="boolean"==typeof t.disableFontFace?t.disableFontFace:_is_node.isNodeJS,E=!0===t.fontExtraProperties,C=!0===t.enableXfa,w=t.ownerDocument||globalThis.document,P=!0===t.disableRange,T=!0===t.disableStream,k=!0===t.disableAutoFetch,M=!0===t.pdfBug,R=l?l.length:t.length??NaN,D="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!_is_node.isNodeJS&&!x,I="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&v===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(p,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(m,document.baseURI),O=t.canvasFactory||new DefaultCanvasFactory({ownerDocument:w}),L=t.filterFactory||new DefaultFilterFactory({docId:n,ownerDocument:w});(0,_util.setVerbosityLevel)(h);const N={canvasFactory:O,filterFactory:L};if(I||(N.cMapReaderFactory=new g({baseUrl:p,isCompressed:f}),N.standardFontDataFactory=new v({baseUrl:m})),!d){const t={verbosity:h,port:_worker_options.GlobalWorkerOptions.workerPort};d=t.port?PDFWorker.fromPort(t):new PDFWorker(t),e._worker=d}const j={docId:n,apiVersion:"3.7.107",data:s,password:o,disableAutoFetch:k,rangeChunkSize:c,length:R,docBaseUrl:u,enableXfa:C,evaluatorOptions:{maxImageSize:y,disableFontFace:x,ignoreErrors:b,isEvalSupported:A,isOffscreenCanvasSupported:_,canvasMaxAreaInBytes:S,fontExtraProperties:E,useSystemFonts:D,cMapUrl:I?p:null,standardFontDataUrl:I?m:null}},B={ignoreErrors:b,isEvalSupported:A,disableFontFace:x,fontExtraProperties:E,enableXfa:C,ownerDocument:w,disableAutoFetch:k,pdfBug:M,styleElement:null};return d.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");const t=_fetchDocument(d,j),o=new Promise((function(t){let e;l?e=new _transport_stream.PDFDataTransportStream({length:R,initialData:l.initialData,progressiveDone:l.progressiveDone,contentDispositionFilename:l.contentDispositionFilename,disableRange:P,disableStream:T},l):s||(e=createPDFNetworkStream({url:r,length:R,httpHeaders:i,withCredentials:a,rangeChunkSize:c,disableRange:P,disableStream:T})),t(e)}));return Promise.all([t,o]).then((function(t){let[r,s]=t;if(e.destroyed)throw new Error("Loading aborted");const i=new _message_handler.MessageHandler(n,r,d.port),a=new WorkerTransport(i,e,s,B,N);e._transport=a,i.send("Ready",null)}))})).catch(e._capability.reject),e}async function _fetchDocument(t,e){if(t.destroyed)throw new Error("Worker was destroyed");const n=await t.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(t.destroyed)throw new Error("Worker was destroyed");return n}function getUrlProp(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch(e){if(_is_node.isNodeJS&&"string"==typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(t){if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&t instanceof Buffer)return(0,_display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`."),new Uint8Array(t);if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return(0,_util.stringToBytes)(t);if("object"==typeof t&&!isNaN(null==t?void 0:t.length)||(0,_util.isArrayBuffer)(t))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}class PDFDocumentLoadingTask{static#e=0;constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d"+PDFDocumentLoadingTask.#e++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var t;this.destroyed=!0,await(null===(t=this._transport)||void 0===t?void 0:t.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t,this.initialData=e,this.progressiveDone=n,this.contentDispositionFilename=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const n of this._rangeListeners)n(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const n of this._progressListeners)n(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{#n=null;#r=!1;constructor(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._pageIndex=t,this._pageInfo=e,this._transport=n,this._stats=r?new _display_utils.StatTimer:null,this._pdfBug=r,this.commonObjs=n.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:t,rotation:e=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:n,offsetY:r,dontFlip:s})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null}render(t){var e,n;let{canvasContext:r,viewport:s,intent:i="display",annotationMode:a=_util.AnnotationMode.ENABLE,transform:o=null,background:l=null,optionalContentConfigPromise:c=null,annotationCanvasMap:d=null,pageColors:h=null,printAnnotationStorage:u=null}=t;if(null!==(e=arguments[0])&&void 0!==e&&e.canvasFactory)throw new Error("render no longer accepts the `canvasFactory`-option, please pass it to the `getDocument`-function instead.");null===(n=this._stats)||void 0===n||n.time("Overall");const p=this._transport.getRenderingIntent(i,a,u);this.#r=!1,this.#s(),c||(c=this._transport.getOptionalContentConfig());let f=this._intentStates.get(p.cacheKey);f||(f=Object.create(null),this._intentStates.set(p.cacheKey,f)),f.streamReaderCancelTimeout&&(clearTimeout(f.streamReaderCancelTimeout),f.streamReaderCancelTimeout=null);const g=!!(p.renderingIntent&_util.RenderingIntentFlag.PRINT);var m;f.displayReadyCapability||(f.displayReadyCapability=new _util.PromiseCapability,f.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(m=this._stats)||void 0===m||m.time("Page Request"),this._pumpOperatorList(p));const complete=t=>{var e,n;f.renderTasks.delete(v),(this._maybeCleanupAfterRender||g)&&(this.#r=!0),this.#i(!g),t?(v.capability.reject(t),this._abortOperatorList({intentState:f,reason:t instanceof Error?t:new Error(t)})):v.capability.resolve(),null===(e=this._stats)||void 0===e||e.timeEnd("Rendering"),null===(n=this._stats)||void 0===n||n.timeEnd("Overall")},v=new InternalRenderTask({callback:complete,params:{canvasContext:r,viewport:s,transform:o,background:l},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:d,operatorList:f.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!g,pdfBug:this._pdfBug,pageColors:h});(f.renderTasks||=new Set).add(v);const b=v.task;return Promise.all([f.displayReadyCapability.promise,c]).then((t=>{var e;let[n,r]=t;this.#r?complete():(null===(e=this._stats)||void 0===e||e.time("Rendering"),v.initializeGraphics({transparency:n,optionalContentConfig:r}),v.operatorListChanged())})).catch(complete),b}getOperatorList(){let{intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:n=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=this._transport.getRenderingIntent(t,e,n,!0);let s,i=this._intentStates.get(r.cacheKey);var a;(i||(i=Object.create(null),this._intentStates.set(r.cacheKey,i)),i.opListReadCapability)||(s=Object.create(null),s.operatorListChanged=function operatorListChanged(){i.operatorList.lastChunk&&(i.opListReadCapability.resolve(i.operatorList),i.renderTasks.delete(s))},i.opListReadCapability=new _util.PromiseCapability,(i.renderTasks||=new Set).add(s),i.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(a=this._stats)||void 0===a||a.time("Page Request"),this._pumpOperatorList(r));return i.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1,disableNormalization:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((t=>_xfa_text.XfaText.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,n){const r=e.getReader(),s={items:[],styles:Object.create(null)};!function pump(){r.read().then((function(e){let{value:n,done:r}=e;r?t(s):(Object.assign(s.styles,n.styles),s.items.push(...n.items),pump())}),n)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const n of e.renderTasks)t.push(n.completed),n.cancel();return this.objs.clear(),this.#r=!1,this.#s(),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#r=!0;const e=this.#i(!1);return t&&e&&(this._stats&&=new _display_utils.StatTimer),e}#i(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.#s(),!this.#r)return!1;if(t)return this.#n=setTimeout((()=>{this.#n=null,this.#i(!1)}),DELAYED_CLEANUP_TIMEOUT),!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#r=!1,!0}#s(){this.#n&&(clearTimeout(this.#n),this.#n=null)}_startRenderPage(t,e){var n,r;const s=this._intentStates.get(e);s&&(null===(n=this._stats)||void 0===n||n.timeEnd("Page Request"),null===(r=s.displayReadyCapability)||void 0===r||r.resolve(t))}_renderPageChunk(t,e){for(let n=0,r=t.length;n<r;n++)e.operatorList.fnArray.push(t.fnArray[n]),e.operatorList.argsArray.push(t.argsArray[n]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const t of e.renderTasks)t.operatorListChanged();t.lastChunk&&this.#i(!0)}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:n,annotationStorageMap:r}=t;const s=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:n,annotationStorage:r}).getReader(),i=this._intentStates.get(n);i.streamReader=s;const pump=()=>{s.read().then((t=>{let{value:e,done:n}=t;n?i.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,i),pump())}),(t=>{if(i.streamReader=null,!this._transport.destroyed){if(i.operatorList){i.operatorList.lastChunk=!0;for(const t of i.renderTasks)t.operatorListChanged();this.#i(!0)}if(i.displayReadyCapability)i.displayReadyCapability.reject(t);else{if(!i.opListReadCapability)throw t;i.opListReadCapability.reject(t)}}}))};pump()}_abortOperatorList(t){let{intentState:e,reason:n,force:r=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(n instanceof _display_utils.RenderingCancelledException){let t=RENDERING_CANCELLED_TIMEOUT;return n.extraDelay>0&&n.extraDelay<1e3&&(t+=n.extraDelay),void(e.streamReaderCancelTimeout=setTimeout((()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:n,force:!0})}),t))}}if(e.streamReader.cancel(new _util.AbortException(n.message)).catch((()=>{})),e.streamReader=null,!this._transport.destroyed){for(const[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#a=new Set;#o=Promise.resolve();postMessage(t,e){const n={data:structuredClone(t,null)};this.#o.then((()=>{for(const t of this.#a)t.call(this,n)}))}addEventListener(t,e){this.#a.add(e)}removeEventListener(t,e){this.#a.delete(e)}terminate(){this.#a.clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_is_node.isNodeJS&&"function"==typeof require)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){var _document,_document$currentScri;const t=null===(_document=document)||void 0===_document||null===(_document$currentScri=_document.currentScript)||void 0===_document$currentScri?void 0:_document$currentScri.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,e){let n;try{if(n=new URL(t),!n.origin||"null"===n.origin)return!1}catch(t){return!1}const r=new URL(e,n);return n.origin===r.origin},PDFWorkerUtil.createCDNWrapper=function(t){const e=`importScripts("${t}");`;return URL.createObjectURL(new Blob([e]))};class PDFWorker{static#l=new WeakMap;constructor(){let{name:t=null,port:e=null,verbosity:n=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e&&PDFWorker.#l.has(e))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=t,this.destroyed=!1,this.verbosity=n,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,e)return PDFWorker.#l.set(e,this),void this._initializeFromPort(e);this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new _message_handler.MessageHandler("main","worker",t),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:t}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t),n=new _message_handler.MessageHandler("main","worker",e),terminateEarly=()=>{e.removeEventListener("error",onWorkerError),n.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},onWorkerError=()=>{this._webWorker||terminateEarly()};e.addEventListener("error",onWorkerError),n.on("test",(t=>{e.removeEventListener("error",onWorkerError),this.destroyed?terminateEarly():t?(this._messageHandler=n,this._port=e,this._webWorker=e,this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),n.destroy(),e.terminate())})),n.on("ready",(t=>{if(e.removeEventListener("error",onWorkerError),this.destroyed)terminateEarly();else try{sendTest()}catch(t){this._setupFakeWorker()}}));const sendTest=()=>{const t=new Uint8Array;n.send("test",t,[t.buffer])};return void sendTest()}catch(t){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then((t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new LoopbackPort;this._port=e;const n="fake"+PDFWorkerUtil.fakeWorkerId++,r=new _message_handler.MessageHandler(n+"_worker",n,e);t.setup(r,e);const s=new _message_handler.MessageHandler(n,n+"_worker",e);this._messageHandler=s,this._readyCapability.resolve(),s.send("configure",{verbosity:this.verbosity})})).catch((t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#l.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(null==t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.#l.has(t.port)?this.#l.get(t.port):new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{var t;return(null===(t=globalThis.pdfjsWorker)||void 0===t?void 0:t.WorkerMessageHandler)||null}catch(t){return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&"function"==typeof require){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;class WorkerTransport{#c=new Map;#d=new Map;#h=new Map;constructor(t,e,n,r,s){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this._params=r,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}#u(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=this.#c.get(t);if(n)return n;const r=this.messageHandler.sendWithPromise(t,e);return this.#c.set(t,r),r}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=_util.RenderingIntentFlag.DISPLAY,i=null;switch(t){case"any":s=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":s=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case _util.AnnotationMode.DISABLE:s+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:s+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:s+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE;i=(s&_util.RenderingIntentFlag.PRINT&&n instanceof _annotation_storage.PrintAnnotationStorage?n:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${e}`)}return r&&(s+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:s,cacheKey:`${s}_${_annotation_storage.AnnotationStorage.getHash(i)}`,annotationStorageMap:i}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const e of this.#d.values())t.push(e._destroy());this.#d.clear(),this.#h.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then((()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#c.clear(),this.filterFactory.destroy(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then((function(t){let{value:n,done:r}=t;r?e.close():((0,_util.assert)(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(n),1,[n]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}})),t.on("ReaderHeadersReady",(t=>{const n=new _util.PromiseCapability,r=this._fullReader;return r.headersReady.then((()=>{if(!r.isStreamingSupported||!r.isRangeSupported){var t;if(this._lastProgress)null===(t=e.onProgress)||void 0===t||t.call(e,this._lastProgress);r.onProgress=t=>{var n;null===(n=e.onProgress)||void 0===n||n.call(e,{loaded:t.loaded,total:t.total})}}n.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})}),n.reject),n.promise})),t.on("GetRangeReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(t.begin,t.end);n?(e.onPull=()=>{n.read().then((function(t){let{value:n,done:r}=t;r?e.close():((0,_util.assert)(n instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(n),1,[n]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{n.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}):e.close()})),t.on("GetDoc",(t=>{let{pdfInfo:n}=t;this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,e._capability.resolve(new PDFDocumentProxy(n,this))})),t.on("DocException",(function(t){let n;switch(t.name){case"PasswordException":n=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":n=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":n=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":n=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":n=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}e._capability.reject(n)})),t.on("PasswordRequest",(t=>{if(this._passwordCapability=new _util.PromiseCapability,e.onPassword){const updatePassword=t=>{t instanceof Error?this._passwordCapability.reject(t):this._passwordCapability.resolve({password:t})};try{e.onPassword(updatePassword,t.code)}catch(t){this._passwordCapability.reject(t)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.promise})),t.on("DataLoaded",(t=>{var n;null===(n=e.onProgress)||void 0===n||n.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(t=>{if(this.destroyed)return;this.#d.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(e=>{var n;let[r,s,i]=e;if(!this.destroyed&&!this.commonObjs.has(r))switch(s){case"Font":const e=this._params;if("error"in i){const t=i.error;(0,_util.warn)(`Error during font loading: ${t}`),this.commonObjs.resolve(r,t);break}const a=e.pdfBug&&null!==(n=globalThis.FontInspector)&&void 0!==n&&n.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,o=new _font_loader.FontFaceObject(i,{isEvalSupported:e.isEvalSupported,disableFontFace:e.disableFontFace,ignoreErrors:e.ignoreErrors,inspectFont:a});this.fontLoader.bind(o).catch((e=>t.sendWithPromise("FontFallback",{id:r}))).finally((()=>{!e.fontExtraProperties&&o.data&&(o.data=null),this.commonObjs.resolve(r,o)}));break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,i);break;default:throw new Error(`Got unknown common object type ${s}`)}})),t.on("obj",(t=>{let[e,n,r,s]=t;if(this.destroyed)return;const i=this.#d.get(n);if(!i.objs.has(e))switch(r){case"Image":if(i.objs.resolve(e,s),s){let t;if(s.bitmap){const{width:e,height:n}=s;t=e*n*4}else{var a;t=(null===(a=s.data)||void 0===a?void 0:a.length)||0}_util.MAX_IMAGE_SIZE_TO_CACHE}break;case"Pattern":i.objs.resolve(e,s);break;default:throw new Error(`Got unknown object type ${r}`)}})),t.on("DocProgress",(t=>{var n;this.destroyed||null===(n=e.onProgress)||void 0===n||n.call(e,{loaded:t.loaded,total:t.total})})),t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t;return this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:(null===(t=this._fullReader)||void 0===t?void 0:t.filename)??null}).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,n=this.#h.get(e);if(n)return n;const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((t=>{if(this.destroyed)throw new Error("Transport destroyed");const n=new PDFPageProxy(e,t,this,this._params.pdfBug);return this.#d.set(e,n),n}));return this.#h.set(e,r),r}getPageIndex(t){return"object"!=typeof t||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#u("GetFieldObjects")}hasJSActions(){return this.#u("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((t=>new _optional_content_config.OptionalContentConfig(t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=this.#c.get(t);if(e)return e;const n=this.messageHandler.sendWithPromise(t,null).then((t=>{var e,n;return{info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:(null===(e=this._fullReader)||void 0===e?void 0:e.filename)??null,contentLength:(null===(n=this._fullReader)||void 0===n?void 0:n.contentLength)??null}}));return this.#c.set(t,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#d.values()){if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`)}this.commonObjs.clear(),t||this.fontLoader.clear(),this.#c.clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:t,enableXfa:e}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t,enableXfa:e})}}class PDFObjects{#p=Object.create(null);#f(t){const e=this.#p[t];return e||(this.#p[t]={capability:new _util.PromiseCapability,data:null})}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const n=this.#f(t);return n.capability.promise.then((()=>e(n.data))),null}const n=this.#p[t];if(null==n||!n.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return n.data}has(t){const e=this.#p[t];return(null==e?void 0:e.capability.settled)||!1}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=this.#f(t);n.data=e,n.capability.resolve()}clear(){for(const e in this.#p){var t;const{data:n}=this.#p[e];null==n||null===(t=n.bitmap)||void 0===t||t.close()}this.#p=Object.create(null)}}class RenderTask{#g=null;constructor(t){this.#g=t,this.onContinue=null}get promise(){return this.#g.capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.#g.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#g.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#g;return t.form||t.canvas&&(null==e?void 0:e.size)>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static#m=new WeakSet;constructor(t){let{callback:e,params:n,objs:r,commonObjs:s,annotationCanvasMap:i,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:d=!1,pdfBug:h=!1,pageColors:u=null}=t;this.callback=e,this.params=n,this.objs=r,this.commonObjs=s,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=h,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===d&&"undefined"!=typeof window,this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=n.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(t){var e,n;let{transparency:r=!1,optionalContentConfig:s}=t;if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#m.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#m.add(this._canvas)}this._pdfBug&&null!==(e=globalThis.StepperManager)&&void 0!==e&&e.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:a,transform:o,background:l}=this.params;this.gfx=new _canvas.CanvasGraphics(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:s},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:a,transparency:r,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,null===(n=this.graphicsReadyCallback)||void 0===n||n.call(this)}cancel(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,null===(t=this.gfx)||void 0===t||t.endDrawing(),this._canvas&&InternalRenderTask.#m.delete(this._canvas),this.callback(e||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas",n))}operatorListChanged(){var t;this.graphicsReady?(null===(t=this.stepper)||void 0===t||t.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame((()=>{this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){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.pageColors),this._canvas&&InternalRenderTask.#m.delete(this._canvas),this.callback())))}}const version="3.7.107";exports.version=version;const build="036f855dc";exports.build=build},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PrintAnnotationStorage=e.AnnotationStorage=void 0;var r=n(1),s=n(140),i=n(144);class AnnotationStorage{#v=!1;#b=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const n=this.#b.get(t);return void 0===n?e:Object.assign(e,n)}getRawValue(t){return this.#b.get(t)}remove(t){if(this.#b.delete(t),0===this.#b.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const t of this.#b.values())if(t instanceof s.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){const n=this.#b.get(t);let r=!1;if(void 0!==n)for(const[t,s]of Object.entries(e))n[t]!==s&&(r=!0,n[t]=s);else r=!0,this.#b.set(t,e);r&&this.#y(),e instanceof s.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#b.has(t)}getAll(){return this.#b.size>0?(0,r.objectFromMap)(this.#b):null}setAll(t){for(const[e,n]of Object.entries(t))this.setValue(e,n)}get size(){return this.#b.size}#y(){this.#v||(this.#v=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#v&&(this.#v=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===this.#b.size)return null;const t=new Map;for(const[e,n]of this.#b){const r=n instanceof s.AnnotationEditor?n.serialize():n;r&&t.set(e,r)}return t}static getHash(t){if(!t)return"";const e=new i.MurmurHash3_64;for(const[n,r]of t)e.update(`${n}:${JSON.stringify(r)}`);return e.hexdigest()}}e.AnnotationStorage=AnnotationStorage;class PrintAnnotationStorage extends AnnotationStorage{#A=null;constructor(t){super(),this.#A=structuredClone(t.serializable)}get print(){(0,r.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#A}}e.PrintAnnotationStorage=PrintAnnotationStorage},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditor=void 0;var r=n(141),s=n(1);class AnnotationEditor{#_=this.focusin.bind(this);#S=this.focusout.bind(this);#x=!1;#E=!1;#C=!1;_uiManager=null;#w=AnnotationEditor._zIndex++;static _colorManager=new r.ColorManager;static _zIndex=1;constructor(t){this.constructor===AnnotationEditor&&(0,s.unreachable)("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager;const{rotation:e,rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:a}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,r],this.pageTranslation=[i,a];const[o,l]=this.parentDimensions;this.x=t.x/o,this.y=t.y/l,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,s.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#w}setParent(t){null!==t&&(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions),this.parent=t}focusin(t){this.#x?this.#x=!1:this.parent.setSelected(this)}focusout(t){var e;if(!this.isAttachedToDOM)return;const n=t.relatedTarget;null!=n&&n.closest(`#${this.id}`)||(t.preventDefault(),null!==(e=this.parent)&&void 0!==e&&e.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(t){const e=this.parent.div.getBoundingClientRect();this.startX=t.clientX-e.x,this.startY=t.clientY-e.y,t.dataTransfer.setData("text/plain",this.id),t.dataTransfer.effectAllowed="move"}setAt(t,e,n,r){const[s,i]=this.parentDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(t+n)/s,this.y=(e+r)/i,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}translate(t,e){const[n,r]=this.parentDimensions;[t,e]=this.screenToPageTranslation(t,e),this.x+=t/n,this.y+=e/r,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}screenToPageTranslation(t,e){switch(this.parentRotation){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{realScale:t}=this._uiManager.viewParameters,[e,n]=this.pageDimensions;return[e*t,n*t]}setDims(t,e){const[n,r]=this.parentDimensions;this.div.style.width=100*t/n+"%",this.div.style.height=100*e/r+"%"}fixDims(){const{style:t}=this.div,{height:e,width:n}=t,r=n.endsWith("%"),s=e.endsWith("%");if(r&&s)return;const[i,a]=this.parentDimensions;r||(t.width=100*parseFloat(n)/i+"%"),s||(t.height=100*parseFloat(e)/a+"%")}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",this.#_),this.div.addEventListener("focusout",this.#S);const[t,e]=this.getInitialTranslation();return this.translate(t,e),(0,r.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(t){const{isMac:e}=s.FeatureTest.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this),this.#x=!0)}getRect(t,e){const n=this.parentScale,[r,s]=this.pageDimensions,[i,a]=this.pageTranslation,o=t/n,l=e/n,c=this.x*r,d=this.y*s,h=this.width*r,u=this.height*s;switch(this.rotation){case 0:return[c+o+i,s-d-l-u+a,c+o+h+i,s-d-l+a];case 90:return[c+l+i,s-d+o+a,c+l+u+i,s-d+o+h+a];case 180:return[c-o-h+i,s-d+l+a,c-o+i,s-d+l+u+a];case 270:return[c-l-u+i,s-d-o-h+a,c-l+i,s-d-o+a];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[n,r,s,i]=t,a=s-n,o=i-r;switch(this.rotation){case 0:return[n,e-i,a,o];case 90:return[n,e-r,o,a];case 180:return[s,e-r,a,o];case 270:return[s,e-i,o,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#C=!0}disableEditMode(){this.#C=!1}isInEditMode(){return this.#C}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t;null===(t=this.div)||void 0===t||t.addEventListener("focusin",this.#_)}serialize(){(0,s.unreachable)("An editor must be serializable")}static deserialize(t,e,n){const r=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:n});r.rotation=t.rotation;const[s,i]=r.pageDimensions,[a,o,l,c]=r.getRectInCurrentCoords(t.rect,i);return r.x=a/s,r.y=o/i,r.width=l/s,r.height=c/i,r}remove(){this.div.removeEventListener("focusin",this.#_),this.div.removeEventListener("focusout",this.#S),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){var t;null===(t=this.div)||void 0===t||t.classList.add("selectedEditor")}unselect(){var t;null===(t=this.div)||void 0===t||t.classList.remove("selectedEditor")}updateParams(t,e){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return this.#E}set isEditing(t){this.#E=t,t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}}e.AnnotationEditor=AnnotationEditor},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0,e.bindEvents=function bindEvents(t,e,n){for(const r of n)e.addEventListener(r,t[r].bind(t))},e.opacityToHex=function opacityToHex(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")};var r=n(1),s=n(142);class IdManager{#P=0;getId(){return`${r.AnnotationEditorPrefix}${this.#P++}`}}class CommandManager{#T=[];#k=!1;#F;#M=-1;constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;this.#F=t}add(t){let{cmd:e,undo:n,mustExec:r,type:s=NaN,overwriteIfSameType:i=!1,keepUndo:a=!1}=t;if(r&&e(),this.#k)return;const o={cmd:e,undo:n,type:s};if(-1===this.#M)return this.#T.length>0&&(this.#T.length=0),this.#M=0,void this.#T.push(o);if(i&&this.#T[this.#M].type===s)return a&&(o.undo=this.#T[this.#M].undo),void(this.#T[this.#M]=o);const l=this.#M+1;l===this.#F?this.#T.splice(0,1):(this.#M=l,l<this.#T.length&&this.#T.splice(l)),this.#T.push(o)}undo(){-1!==this.#M&&(this.#k=!0,this.#T[this.#M].undo(),this.#k=!1,this.#M-=1)}redo(){this.#M<this.#T.length-1&&(this.#M+=1,this.#k=!0,this.#T[this.#M].cmd(),this.#k=!1)}hasSomethingToUndo(){return-1!==this.#M}hasSomethingToRedo(){return this.#M<this.#T.length-1}destroy(){this.#T=null}}e.CommandManager=CommandManager;class KeyboardManager{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=r.FeatureTest.platform;for(const[n,r]of t)for(const t of n){const n=t.startsWith("mac+");e&&n?(this.callbacks.set(t.slice(4),r),this.allKeys.add(t.split("+").at(-1))):e||n||(this.callbacks.set(t,r),this.allKeys.add(t.split("+").at(-1)))}}#R(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e}exec(t,e){if(!this.allKeys.has(e.key))return;const n=this.callbacks.get(this.#R(e));n&&(n.bind(t)(),e.stopPropagation(),e.preventDefault())}}e.KeyboardManager=KeyboardManager;class ColorManager{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return(0,s.getColorValues)(t),(0,r.shadow)(this,"_colors",t)}convert(t){const e=(0,s.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[t,n]of this._colors)if(n.every(((t,n)=>t===e[n])))return ColorManager._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?r.Util.makeHexColor(...e):t}}e.ColorManager=ColorManager;class AnnotationEditorUIManager{#D=null;#I=new Map;#O=new Map;#L=null;#N=new CommandManager;#j=0;#B=null;#U=new Set;#W=null;#q=new IdManager;#G=!1;#H=r.AnnotationEditorType.NONE;#z=new Set;#V=this.copy.bind(this);#X=this.cut.bind(this);#$=this.paste.bind(this);#Y=this.keydown.bind(this);#K=this.onEditingAction.bind(this);#J=this.onPageChanging.bind(this);#Q=this.onScaleChanging.bind(this);#Z=this.onRotationChanging.bind(this);#tt={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#et=null;static _keyboardManager=new KeyboardManager([[["ctrl+a","mac+meta+a"],AnnotationEditorUIManager.prototype.selectAll],[["ctrl+z","mac+meta+z"],AnnotationEditorUIManager.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],AnnotationEditorUIManager.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],AnnotationEditorUIManager.prototype.delete],[["Escape","mac+Escape"],AnnotationEditorUIManager.prototype.unselectAll]]);constructor(t,e,n){this.#et=t,this.#W=e,this.#W._on("editingaction",this.#K),this.#W._on("pagechanging",this.#J),this.#W._on("scalechanging",this.#Q),this.#W._on("rotationchanging",this.#Z),this.#L=n,this.viewParameters={realScale:s.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){this.#nt(),this.#W._off("editingaction",this.#K),this.#W._off("pagechanging",this.#J),this.#W._off("scalechanging",this.#Q),this.#W._off("rotationchanging",this.#Z);for(const t of this.#O.values())t.destroy();this.#O.clear(),this.#I.clear(),this.#U.clear(),this.#D=null,this.#z.clear(),this.#N.destroy()}onPageChanging(t){let{pageNumber:e}=t;this.#j=e-1}focusMainContainer(){this.#et.focus()}addShouldRescale(t){this.#U.add(t)}removeShouldRescale(t){this.#U.delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove(),this.viewParameters.realScale=e*s.PixelsPerInch.PDF_TO_CSS_UNITS;for(const t of this.#U)t.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=e}addToAnnotationStorage(t){t.isEmpty()||!this.#L||this.#L.has(t.id)||this.#L.setValue(t.id,t)}#rt(){this.#et.addEventListener("keydown",this.#Y)}#nt(){this.#et.removeEventListener("keydown",this.#Y)}#st(){document.addEventListener("copy",this.#V),document.addEventListener("cut",this.#X),document.addEventListener("paste",this.#$)}#it(){document.removeEventListener("copy",this.#V),document.removeEventListener("cut",this.#X),document.removeEventListener("paste",this.#$)}copy(t){if(t.preventDefault(),this.#D&&this.#D.commitOrRemove(),!this.hasSelection)return;const e=[];for(const t of this.#z)t.isEmpty()||e.push(t.serialize());0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();let e=t.clipboardData.getData("application/pdfjs");if(!e)return;try{e=JSON.parse(e)}catch(t){return void(0,r.warn)(`paste: "${t.message}".`)}if(!Array.isArray(e))return;this.unselectAll();const n=this.#O.get(this.#j);try{const t=[];for(const r of e){const e=n.deserialize(r);if(!e)return;t.push(e)}const cmd=()=>{for(const e of t)this.#at(e);this.#ot(t)},undo=()=>{for(const e of t)e.remove()};this.addCommands({cmd:cmd,undo:undo,mustExec:!0})}catch(t){(0,r.warn)(`paste: "${t.message}".`)}}keydown(t){var e;null!==(e=this.getActive())&&void 0!==e&&e.shouldGetKeyboardEvents()||AnnotationEditorUIManager._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}#lt(t){Object.entries(t).some((t=>{let[e,n]=t;return this.#tt[e]!==n}))&&this.#W.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#tt,t)})}#ct(t){this.#W.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#rt(),this.#st(),this.#lt({isEditing:this.#H!==r.AnnotationEditorType.NONE,isEmpty:this.#dt(),hasSomethingToUndo:this.#N.hasSomethingToUndo(),hasSomethingToRedo:this.#N.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#nt(),this.#it(),this.#lt({isEditing:!1}))}registerEditorTypes(t){if(!this.#B){this.#B=t;for(const t of this.#B)this.#ct(t.defaultPropertiesToUpdate)}}getId(){return this.#q.getId()}get currentLayer(){return this.#O.get(this.#j)}get currentPageIndex(){return this.#j}addLayer(t){this.#O.set(t.pageIndex,t),this.#G?t.enable():t.disable()}removeLayer(t){this.#O.delete(t.pageIndex)}updateMode(t){if(this.#H=t,t===r.AnnotationEditorType.NONE)this.setEditingState(!1),this.#ht();else{this.setEditingState(!0),this.#ut();for(const e of this.#O.values())e.updateMode(t)}}updateToolbar(t){t!==this.#H&&this.#W.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#B){for(const n of this.#z)n.updateParams(t,e);for(const n of this.#B)n.updateDefaultParams(t,e)}}#ut(){if(!this.#G){this.#G=!0;for(const t of this.#O.values())t.enable()}}#ht(){if(this.unselectAll(),this.#G){this.#G=!1;for(const t of this.#O.values())t.disable()}}getEditors(t){const e=[];for(const n of this.#I.values())n.pageIndex===t&&e.push(n);return e}getEditor(t){return this.#I.get(t)}addEditor(t){this.#I.set(t.id,t)}removeEditor(t){var e;this.#I.delete(t.id),this.unselect(t),null===(e=this.#L)||void 0===e||e.remove(t.id)}#at(t){const e=this.#O.get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}setActiveEditor(t){this.#D!==t&&(this.#D=t,t&&this.#ct(t.propertiesToUpdate))}toggleSelected(t){if(this.#z.has(t))return this.#z.delete(t),t.unselect(),void this.#lt({hasSelectedEditor:this.hasSelection});this.#z.add(t),t.select(),this.#ct(t.propertiesToUpdate),this.#lt({hasSelectedEditor:!0})}setSelected(t){for(const e of this.#z)e!==t&&e.unselect();this.#z.clear(),this.#z.add(t),t.select(),this.#ct(t.propertiesToUpdate),this.#lt({hasSelectedEditor:!0})}isSelected(t){return this.#z.has(t)}unselect(t){t.unselect(),this.#z.delete(t),this.#lt({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#z.size}undo(){this.#N.undo(),this.#lt({hasSomethingToUndo:this.#N.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#dt()})}redo(){this.#N.redo(),this.#lt({hasSomethingToUndo:!0,hasSomethingToRedo:this.#N.hasSomethingToRedo(),isEmpty:this.#dt()})}addCommands(t){this.#N.add(t),this.#lt({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#dt()})}#dt(){if(0===this.#I.size)return!0;if(1===this.#I.size)for(const t of this.#I.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...this.#z];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)this.#at(e)},mustExec:!0})}commitOrRemove(){var t;null===(t=this.#D)||void 0===t||t.commitOrRemove()}#ot(t){this.#z.clear();for(const e of t)e.isEmpty()||(this.#z.add(e),e.select());this.#lt({hasSelectedEditor:!0})}selectAll(){for(const t of this.#z)t.commit();this.#ot(this.#I.values())}unselectAll(){if(this.#D)this.#D.commitOrRemove();else if(0!==this.#z.size){for(const t of this.#z)t.unselect();this.#z.clear(),this.#lt({hasSelectedEditor:!1})}}isActive(t){return this.#D===t}getActive(){return this.#D}getMode(){return this.#H}}e.AnnotationEditorUIManager=AnnotationEditorUIManager},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMFilterFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=e.AnnotationPrefix=void 0,e.deprecated=function deprecated(t){console.log("Deprecated API usage: "+t)},e.getColorValues=function getColorValues(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const n of t.keys()){e.style.color=n;const r=window.getComputedStyle(e).color;t.set(n,getRGB(r))}e.remove()},e.getCurrentTransform=function getCurrentTransform(t){const{a:e,b:n,c:r,d:s,e:i,f:a}=t.getTransform();return[e,n,r,s,i,a]},e.getCurrentTransformInverse=function getCurrentTransformInverse(t){const{a:e,b:n,c:r,d:s,e:i,f:a}=t.getTransform().invertSelf();return[e,n,r,s,i,a]},e.getFilenameFromUrl=function getFilenameFromUrl(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1]||([t]=t.split(/[#?]/,1));return t.substring(t.lastIndexOf("/")+1)},e.getPdfFilenameFromUrl=function getPdfFilenameFromUrl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof t)return e;if(isDataScheme(t))return(0,s.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,r=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let i=n.exec(r[1])||n.exec(r[2])||n.exec(r[3]);if(i&&(i=i[0],i.includes("%")))try{i=n.exec(decodeURIComponent(i))[0]}catch(t){}return i||e},e.getRGB=getRGB,e.getXfaPageViewport=function getXfaPageViewport(t,e){let{scale:n=1,rotation:r=0}=e;const{width:s,height:i}=t.attributes.style,a=[0,0,parseInt(s),parseInt(i)];return new PageViewport({viewBox:a,scale:n,rotation:r})},e.isDataScheme=isDataScheme,e.isPdfFile=function isPdfFile(t){return"string"==typeof t&&/\.pdf$/i.test(t)},e.isValidFetchUrl=isValidFetchUrl,e.loadScript=function loadScript(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise(((n,r)=>{const s=document.createElement("script");s.src=t,s.onload=function(t){e&&s.remove(),n(t)},s.onerror=function(){r(new Error(`Cannot load script at: ${s.src}`))},(document.head||document.documentElement).append(s)}))},e.setLayerDimensions=function setLayerDimensions(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof PageViewport){const{pageWidth:r,pageHeight:s}=e.rawDims,{style:i}=t,a=`calc(var(--scale-factor) * ${r}px)`,o=`calc(var(--scale-factor) * ${s}px)`;n&&e.rotation%180!=0?(i.width=o,i.height=a):(i.width=a,i.height=o)}r&&t.setAttribute("data-main-rotation",e.rotation)};var r=n(143),s=n(1);const i="http://www.w3.org/2000/svg";e.AnnotationPrefix="pdfjs_internal_id_";class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}e.PixelsPerInch=PixelsPerInch;class DOMFilterFactory extends r.BaseFilterFactory{#pt;#ft;#e;#gt;#mt;#vt;#bt;#P=0;constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this.#e=t,this.#gt=e}get#yt(){return this.#pt||=new Map}get#At(){if(!this.#ft){const t=this.#gt.createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const n=this.#gt.createElementNS(i,"svg");n.setAttribute("width",0),n.setAttribute("height",0),this.#ft=this.#gt.createElementNS(i,"defs"),t.append(n),n.append(this.#ft),this.#gt.body.append(t)}return this.#ft}#_t(t,e,n){const r=this.#gt.createElementNS(i,e);r.setAttribute("type","discrete"),r.setAttribute("tableValues",n),t.append(r)}addFilter(t){if(!t)return"none";let e,n,r,s,a=this.#yt.get(t);if(a)return a;if(1===t.length){const i=t[0],a=new Array(256);for(let t=0;t<256;t++)a[t]=i[t]/255;s=e=n=r=a.join(",")}else{const[i,a,o]=t,l=new Array(256),c=new Array(256),d=new Array(256);for(let t=0;t<256;t++)l[t]=i[t]/255,c[t]=a[t]/255,d[t]=o[t]/255;e=l.join(","),n=c.join(","),r=d.join(","),s=`${e}${n}${r}`}if(a=this.#yt.get(s),a)return this.#yt.set(t,a),a;const o=`g_${this.#e}_transfer_map_${this.#P++}`,l=`url(#${o})`;this.#yt.set(t,l),this.#yt.set(s,l);const c=this.#gt.createElementNS(i,"filter",i);c.setAttribute("id",o),c.setAttribute("color-interpolation-filters","sRGB");const d=this.#gt.createElementNS(i,"feComponentTransfer");return c.append(d),this.#_t(d,"feFuncR",e),this.#_t(d,"feFuncG",n),this.#_t(d,"feFuncB",r),this.#At.append(c),l}addHCMFilter(t,e){var n;const r=`${t}-${e}`;if(this.#vt===r)return this.#bt;if(this.#vt=r,this.#bt="none",null===(n=this.#mt)||void 0===n||n.remove(),!t||!e)return this.#bt;this.#At.style.color=t;const a=getRGB(t=getComputedStyle(this.#At).getPropertyValue("color"));t=s.Util.makeHexColor(...a),this.#At.style.color=e;const o=getRGB(e=getComputedStyle(this.#At).getPropertyValue("color"));if(e=s.Util.makeHexColor(...o),this.#At.style.color="","#000000"===t&&"#ffffff"===e||t===e)return this.#bt;const l=new Array(256);for(let t=0;t<=255;t++){const e=t/255;l[t]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}const c=l.join(","),d=`g_${this.#e}_hcm_filter`,h=this.#mt=this.#gt.createElementNS(i,"filter",i);h.setAttribute("id",d),h.setAttribute("color-interpolation-filters","sRGB");let u=this.#gt.createElementNS(i,"feComponentTransfer");h.append(u),this.#_t(u,"feFuncR",c),this.#_t(u,"feFuncG",c),this.#_t(u,"feFuncB",c);const p=this.#gt.createElementNS(i,"feColorMatrix");p.setAttribute("type","matrix"),p.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),h.append(p),u=this.#gt.createElementNS(i,"feComponentTransfer"),h.append(u);const getSteps=(t,e)=>{const n=a[t]/255,r=o[t]/255,s=new Array(e+1);for(let t=0;t<=e;t++)s[t]=n+t/e*(r-n);return s.join(",")};return this.#_t(u,"feFuncR",getSteps(0,5)),this.#_t(u,"feFuncG",getSteps(1,5)),this.#_t(u,"feFuncB",getSteps(2,5)),this.#At.append(h),this.#bt=`url(#${d})`,this.#bt}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.#bt||(this.#ft&&(this.#ft.parentNode.parentNode.remove(),this.#ft=null),this.#pt&&(this.#pt.clear(),this.#pt=null),this.#P=0)}}e.DOMFilterFactory=DOMFilterFactory;class DOMCanvasFactory extends r.BaseCanvasFactory{constructor(){let{ownerDocument:t=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._document=t}_createCanvas(t,e){const n=this._document.createElement("canvas");return n.width=t,n.height=e,n}}async function fetchData(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(isValidFetchUrl(t,document.baseURI)){const n=await fetch(t);if(!n.ok)throw new Error(n.statusText);return e?new Uint8Array(await n.arrayBuffer()):(0,s.stringToBytes)(await n.text())}return new Promise(((n,r)=>{const i=new XMLHttpRequest;i.open("GET",t,!0),e&&(i.responseType="arraybuffer"),i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(200===i.status||0===i.status){let t;if(e&&i.response?t=new Uint8Array(i.response):!e&&i.responseText&&(t=(0,s.stringToBytes)(i.responseText)),t)return void n(t)}r(new Error(i.statusText))}},i.send(null)}))}e.DOMCanvasFactory=DOMCanvasFactory;class DOMCMapReaderFactory extends r.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t,this.isCompressed).then((t=>({cMapData:t,compressionType:e})))}}e.DOMCMapReaderFactory=DOMCMapReaderFactory;class DOMStandardFontDataFactory extends r.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t,!0)}}e.DOMStandardFontDataFactory=DOMStandardFontDataFactory;class DOMSVGFactory extends r.BaseSVGFactory{_createSVG(t){return document.createElementNS(i,t)}}e.DOMSVGFactory=DOMSVGFactory;class PageViewport{constructor(t){let{viewBox:e,scale:n,rotation:r,offsetX:s=0,offsetY:i=0,dontFlip:a=!1}=t;this.viewBox=e,this.scale=n,this.rotation=r,this.offsetX=s,this.offsetY=i;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,d,h,u,p,f,g,m;switch(r%=360,r<0&&(r+=360),r){case 180:c=-1,d=0,h=0,u=1;break;case 90:c=0,d=1,h=1,u=0;break;case 270:c=0,d=-1,h=-1,u=0;break;case 0:c=1,d=0,h=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(h=-h,u=-u),0===c?(p=Math.abs(l-e[1])*n+s,f=Math.abs(o-e[0])*n+i,g=(e[3]-e[1])*n,m=(e[2]-e[0])*n):(p=Math.abs(o-e[0])*n+s,f=Math.abs(l-e[1])*n+i,g=(e[2]-e[0])*n,m=(e[3]-e[1])*n),this.transform=[c*n,d*n,h*n,u*n,p-c*n*o-h*n*l,f-d*n*o-u*n*l],this.width=g,this.height=m}get rawDims(){const{viewBox:t}=this;return(0,s.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:n=this.offsetX,offsetY:r=this.offsetY,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new PageViewport({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:n,offsetY:r,dontFlip:s})}convertToViewportPoint(t,e){return s.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=s.Util.applyTransform([t[0],t[1]],this.transform),n=s.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],n[0],n[1]]}convertToPdfPoint(t,e){return s.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=PageViewport;class RenderingCancelledException extends s.BaseException{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;super(t,"RenderingCancelledException"),this.type=e,this.extraDelay=n}}function isDataScheme(t){const e=t.length;let n=0;for(;n<e&&""===t[n].trim();)n++;return"data:"===t.substring(n,n+5).toLowerCase()}e.RenderingCancelledException=RenderingCancelledException;function isValidFetchUrl(t,e){try{const{protocol:n}=e?new URL(t,e):new URL(t);return"http:"===n||"https:"===n}catch(t){return!1}}let a;e.StatTimer=class StatTimer{started=Object.create(null);times=[];time(t){t in this.started&&(0,s.warn)(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,s.warn)(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:t}of this.times)e=Math.max(t.length,e);for(const{name:n,start:r,end:s}of this.times)t.push(`${n.padEnd(e)} ${s-r}ms\n`);return t.join("")}};function getRGB(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map((t=>parseInt(t))):t.startsWith("rgba(")?t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3):((0,s.warn)(`Not a valid color format: "${t}"`),[0,0,0])}e.PDFDateString=class PDFDateString{static toDateObject(t){if(!t||"string"!=typeof t)return null;a||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const e=a.exec(t);if(!e)return null;const n=parseInt(e[1],10);let r=parseInt(e[2],10);r=r>=1&&r<=12?r-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let i=parseInt(e[4],10);i=i>=0&&i<=23?i:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const c=e[7]||"Z";let d=parseInt(e[8],10);d=d>=0&&d<=23?d:0;let h=parseInt(e[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===c?(i+=d,o+=h):"+"===c&&(i-=d,o-=h),new Date(Date.UTC(n,r,s,i,o,l))}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseFilterFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;var r=n(1);class BaseFilterFactory{constructor(){this.constructor===BaseFilterFactory&&(0,r.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}destroy(){}}e.BaseFilterFactory=BaseFilterFactory;class BaseCanvasFactory{constructor(){this.constructor===BaseCanvasFactory&&(0,r.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(t,e);return{canvas:n,context:n.getContext("2d",{willReadFrequently:!0===pdfjsLib.canvasWillReadFrequently})}}reset(t,e,n){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||n<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=n}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){(0,r.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=BaseCanvasFactory;class BaseCMapReaderFactory{constructor(t){let{baseUrl:e=null,isCompressed:n=!0}=t;this.constructor===BaseCMapReaderFactory&&(0,r.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=n}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const n=this.baseUrl+e+(this.isCompressed?".bcmap":""),s=this.isCompressed?r.CMapCompressionType.BINARY:r.CMapCompressionType.NONE;return this._fetchData(n,s).catch((t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${n}`)}))}_fetchData(t,e){(0,r.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=BaseCMapReaderFactory;class BaseStandardFontDataFactory{constructor(t){let{baseUrl:e=null}=t;this.constructor===BaseStandardFontDataFactory&&(0,r.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const n=`${this.baseUrl}${e}`;return this._fetchData(n).catch((t=>{throw new Error(`Unable to load font data at: ${n}`)}))}_fetchData(t){(0,r.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=BaseStandardFontDataFactory;class BaseSVGFactory{constructor(){this.constructor===BaseSVGFactory&&(0,r.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),n||(r.setAttribute("width",`${t}px`),r.setAttribute("height",`${e}px`)),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox",`0 0 ${t} ${e}`),r}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,r.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=BaseSVGFactory},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MurmurHash3_64=void 0;var r=n(1);const s=3285377520,i=4294901760,a=65535;e.MurmurHash3_64=class MurmurHash3_64{constructor(t){this.h1=t?4294967295&t:s,this.h2=t?4294967295&t:s}update(t){let e,n;if("string"==typeof t){e=new Uint8Array(2*t.length),n=0;for(let r=0,s=t.length;r<s;r++){const s=t.charCodeAt(r);s<=255?e[n++]=s:(e[n++]=s>>>8,e[n++]=255&s)}}else{if(!(0,r.isArrayBuffer)(t))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");e=t.slice(),n=e.byteLength}const s=n>>2,o=n-4*s,l=new Uint32Array(e.buffer,0,s);let c=0,d=0,h=this.h1,u=this.h2;const p=3432918353,f=461845907,g=11601,m=13715;for(let t=0;t<s;t++)1&t?(c=l[t],c=c*p&i|c*g&a,c=c<<15|c>>>17,c=c*f&i|c*m&a,h^=c,h=h<<13|h>>>19,h=5*h+3864292196):(d=l[t],d=d*p&i|d*g&a,d=d<<15|d>>>17,d=d*f&i|d*m&a,u^=d,u=u<<13|u>>>19,u=5*u+3864292196);switch(c=0,o){case 3:c^=e[4*s+2]<<16;case 2:c^=e[4*s+1]<<8;case 1:c^=e[4*s],c=c*p&i|c*g&a,c=c<<15|c>>>17,c=c*f&i|c*m&a,1&s?h^=c:u^=c}this.h1=h,this.h2=u}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&i|36045*t&a,e=4283543511*e&i|(2950163797*(e<<16|t>>>16)&i)>>>16,t^=e>>>1,t=444984403*t&i|60499*t&a,e=3301882366*e&i|(3120437893*(e<<16|t>>>16)&i)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0;var r=n(1),s=n(3);e.FontLoader=class FontLoader{#St=new Set;constructor(t){let{ownerDocument:e=globalThis.document,styleElement:n=null}=t;this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#St.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){if(t&&!this.#St.has(t.loadedName))if((0,r.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:e,src:n,style:s}=t,i=new FontFace(e,n,s);this.addNativeFontFace(i);try{await i.load(),this.#St.add(e)}catch{(0,r.warn)(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(i)}}else(0,r.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void await this.loadSystemFont(t.systemFontInfo);if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(n){throw(0,r.warn)(`Failed to load font '${e.family}': '${n}'.`),t.disableFontFace=!0,n}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise((e=>{const n=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,n)}))}}get isFontLoadingAPISupported(){var t;const e=!(null===(t=this._document)||void 0===t||!t.fonts);return(0,r.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let t=!1;return(s.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),(0,r.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,n={done:!1,complete:function completeRequest(){for((0,r.assert)(!n.done,"completeRequest() cannot be called twice."),n.done=!0;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(n),n}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,r.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function int32(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function spliceString(t,e,n,r){return t.substring(0,e)+r+t.substring(e+n)}let n,s;const i=this._document.createElement("canvas");i.width=1,i.height=1;const a=i.getContext("2d",{willReadFrequently:!0===pdfjsLib.canvasWillReadFrequently});let o=0;const l=`lt${Date.now()}${this.loadTestFontId++}`;let c=this._loadTestFont;c=spliceString(c,976,l.length,l);const d=1482184792;let h=int32(c,16);for(n=0,s=l.length-3;n<s;n+=4)h=h-d+int32(l,n)|0;n<l.length&&(h=h-d+int32(l+"XXX",n)|0),c=spliceString(c,16,4,(0,r.string32)(h));const u=`@font-face {font-family:"${l}";src:${`url(data:font/opentype;base64,${btoa(c)});`}}`;this.insertRule(u);const p=this._document.createElement("div");p.style.visibility="hidden",p.style.width=p.style.height="10px",p.style.position="absolute",p.style.top=p.style.left="0px";for(const e of[t.loadedName,l]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=e,p.append(t)}this._document.body.append(p),function isFontReady(t,e){if(++o>30)return(0,r.warn)("Load test font never loaded."),void e();a.font="30px "+t,a.fillText(".",0,20),a.getImageData(0,0,1,1).data[3]>0?e():setTimeout(isFontReady.bind(null,t,e))}(l,(()=>{p.remove(),e.complete()}))}};e.FontFaceObject=class FontFaceObject{constructor(t,e){let{isEvalSupported:n=!0,disableFontFace:r=!1,ignoreErrors:s=!1,inspectFont:i=null}=e;this.compiledGlyphs=Object.create(null);for(const e in t)this[e]=t[e];this.isEvalSupported=!1!==n,this.disableFontFace=!0===r,this.ignoreErrors=!0===s,this._inspectFont=i}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return null===(t=this._inspectFont)||void 0===t||t.call(this,this),e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e=(0,r.bytesToString)(this.data),n=`url(data:${this.mimetype};base64,${btoa(e)});`;let s;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),s=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${n}}`}else s=`@font-face {font-family:"${this.loadedName}";src:${n}}`;return null===(t=this._inspectFont)||void 0===t||t.call(this,this,n),s}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let n;try{n=t.get(this.loadedName+"_path_"+e)}catch(t){if(!this.ignoreErrors)throw t;return(0,r.warn)(`getPathGenerator - ignoring character: "${t}".`),this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&r.FeatureTest.isEvalSupported){const t=[];for(const e of n){const n=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",n,");\n")}return this.compiledGlyphs[e]=new Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(const r of n)"scale"===r.cmd&&(r.args=[e,-e]),t[r.cmd].apply(t,r.args)}}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0;var r=n(1),s=n(142),i=n(147),a=n(148),o=n(3);const l=4096,c=16;class CachedCanvases{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,n){let r;return void 0!==this.cache[t]?(r=this.cache[t],this.canvasFactory.reset(r,e,n)):(r=this.canvasFactory.create(e,n),this.cache[t]=r),r}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function drawImageAtIntegerCoords(t,e,n,r,i,a,o,l,c,d){const[h,u,p,f,g,m]=(0,s.getCurrentTransform)(t);if(0===u&&0===p){const s=o*h+g,v=Math.round(s),b=l*f+m,y=Math.round(b),A=(o+c)*h+g,_=Math.abs(Math.round(A)-v)||1,S=(l+d)*f+m,x=Math.abs(Math.round(S)-y)||1;return t.setTransform(Math.sign(h),0,0,Math.sign(f),v,y),t.drawImage(e,n,r,i,a,0,0,_,x),t.setTransform(h,u,p,f,g,m),[_,x]}if(0===h&&0===f){const s=l*p+g,v=Math.round(s),b=o*u+m,y=Math.round(b),A=(l+d)*p+g,_=Math.abs(Math.round(A)-v)||1,S=(o+c)*u+m,x=Math.abs(Math.round(S)-y)||1;return t.setTransform(0,Math.sign(u),Math.sign(p),0,v,y),t.drawImage(e,n,r,i,a,0,0,x,_),t.setTransform(h,u,p,f,g,m),[x,_]}t.drawImage(e,n,r,i,a,o,l,c,d);return[Math.hypot(h,u)*c,Math.hypot(p,f)*d]}class CanvasExtraState{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=r.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=r.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=r.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,n){[e,n]=r.Util.applyTransform([e,n],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(t,e){const n=r.Util.applyTransform(e,t),s=r.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,n[0],s[0]),this.minY=Math.min(this.minY,n[1],s[1]),this.maxX=Math.max(this.maxX,n[0],s[0]),this.maxY=Math.max(this.maxY,n[1],s[1])}updateScalingPathMinMax(t,e){r.Util.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.maxX=Math.max(this.maxX,e[1]),this.minY=Math.min(this.minY,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,n,s,i,a,o,l,c,d){const h=r.Util.bezierBoundingBox(e,n,s,i,a,o,l,c);if(d)return d[0]=Math.min(d[0],h[0],h[2]),d[1]=Math.max(d[1],h[0],h[2]),d[2]=Math.min(d[2],h[1],h[3]),void(d[3]=Math.max(d[3],h[1],h[3]));this.updateRectMinMax(t,h)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[this.minX,this.minY,this.maxX,this.maxY];if(t===i.PathType.STROKE){e||(0,r.unreachable)("Stroke bounding box must include transform.");const t=r.Util.singularValueDecompose2dScale(e),s=t[0]*this.lineWidth/2,i=t[1]*this.lineWidth/2;n[0]-=s,n[1]-=i,n[2]+=s,n[3]+=i}return n}updateClipFromPath(){const t=r.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return r.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function putBinaryImageData(t,e){if("undefined"!=typeof ImageData&&e instanceof ImageData)return void t.putImageData(e,0,0);const n=e.height,s=e.width,i=n%c,a=(n-i)/c,o=0===i?a:a+1,l=t.createImageData(s,c);let d,h=0;const u=e.data,p=l.data;let f,g,m,v;if(e.kind===r.ImageKind.GRAYSCALE_1BPP){const e=u.byteLength,n=new Uint32Array(p.buffer,0,p.byteLength>>2),v=n.length,b=s+7>>3,y=4294967295,A=r.FeatureTest.isLittleEndian?4278190080:255;for(f=0;f<o;f++){for(m=f<a?c:i,d=0,g=0;g<m;g++){const t=e-h;let r=0;const i=t>b?s:8*t-7,a=-8&i;let o=0,l=0;for(;r<a;r+=8)l=u[h++],n[d++]=128&l?y:A,n[d++]=64&l?y:A,n[d++]=32&l?y:A,n[d++]=16&l?y:A,n[d++]=8&l?y:A,n[d++]=4&l?y:A,n[d++]=2&l?y:A,n[d++]=1&l?y:A;for(;r<i;r++)0===o&&(l=u[h++],o=128),n[d++]=l&o?y:A,o>>=1}for(;d<v;)n[d++]=0;t.putImageData(l,0,f*c)}}else if(e.kind===r.ImageKind.RGBA_32BPP){for(g=0,v=s*c*4,f=0;f<a;f++)p.set(u.subarray(h,h+v)),h+=v,t.putImageData(l,0,g),g+=c;f<o&&(v=s*i*4,p.set(u.subarray(h,h+v)),t.putImageData(l,0,g))}else{if(e.kind!==r.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);for(m=c,v=s*m,f=0;f<o;f++){for(f>=a&&(m=i,v=s*m),d=0,g=v;g--;)p[d++]=u[h++],p[d++]=u[h++],p[d++]=u[h++],p[d++]=255;t.putImageData(l,0,f*c)}}}function putBinaryImageMask(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const n=e.height,r=e.width,s=n%c,i=(n-s)/c,o=0===s?i:i+1,l=t.createImageData(r,c);let d=0;const h=e.data,u=l.data;for(let e=0;e<o;e++){const n=e<i?c:s;({srcPos:d}=(0,a.convertBlackAndWhiteToRGBA)({src:h,srcPos:d,dest:u,width:r,height:n,nonBlackColor:0})),t.putImageData(l,0,e*c)}}function copyCtxState(t,e){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of n)void 0!==t[r]&&(e[r]=t[r]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function resetCtxToDefault(t){t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0),o.isNodeJS||(t.filter="none")}function composeSMaskBackdrop(t,e,n,r){const s=t.length;for(let i=3;i<s;i+=4){const s=t[i];if(0===s)t[i-3]=e,t[i-2]=n,t[i-1]=r;else if(s<255){const a=255-s;t[i-3]=t[i-3]*s+e*a>>8,t[i-2]=t[i-2]*s+n*a>>8,t[i-1]=t[i-1]*s+r*a>>8}}}function composeSMaskAlpha(t,e,n){const r=t.length;for(let s=3;s<r;s+=4){const r=n?n[t[s]]:t[s];e[s]=e[s]*r*.00392156862745098|0}}function composeSMaskLuminosity(t,e,n){const r=t.length;for(let s=3;s<r;s+=4){const r=77*t[s-3]+152*t[s-2]+28*t[s-1];e[s]=n?e[s]*n[r>>8]>>8:e[s]*r>>16}}function composeSMask(t,e,n,r){const s=r[0],i=r[1],a=r[2]-s,o=r[3]-i;0!==a&&0!==o&&(!function genericComposeSMask(t,e,n,r,s,i,a,o,l,c,d){const h=!!i,u=h?i[0]:0,p=h?i[1]:0,f=h?i[2]:0;let g;g="Luminosity"===s?composeSMaskLuminosity:composeSMaskAlpha;const m=Math.min(r,Math.ceil(1048576/n));for(let s=0;s<r;s+=m){const i=Math.min(m,r-s),v=t.getImageData(o-c,s+(l-d),n,i),b=e.getImageData(o,s+l,n,i);h&&composeSMaskBackdrop(v.data,u,p,f),g(v.data,b.data,a),e.putImageData(b,o,s+l)}}(e.context,n,a,o,e.subtype,e.backdrop,e.transferMap,s,i,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(n.canvas,0,0),t.restore())}function getImageSmoothingEnabled(t,e){const n=r.Util.singularValueDecompose2dScale(t);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const i=Math.fround((globalThis.devicePixelRatio||1)*s.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==e?e:n[0]<=i||n[1]<=i}const d=["butt","round","square"],h=["miter","round","bevel"],u={},p={};class CanvasGraphics{constructor(t,e,n,r,s,i,a,o){let{optionalContentConfig:l,markedContentStack:c=null}=i;this.ctx=t,this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=n,this.canvasFactory=r,this.filterFactory=s,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=c||[],this.optionalContentConfig=l,this.cachedCanvases=new CachedCanvases(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=a,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=o,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing(t){let{transform:e,viewport:n,transparency:r=!1,background:i=null}=t;const a=this.ctx.canvas.width,o=this.ctx.canvas.height,l=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,a,o),this.ctx.fillStyle=l,r){const t=this.cachedCanvases.getCanvas("transparent",a,o);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...(0,s.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),resetCtxToDefault(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...n.transform),this.viewportScale=n.scale,this.baseTransform=(0,s.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,n,s){const i=t.argsArray,a=t.fnArray;let o=e||0;const l=i.length;if(l===o)return o;const c=l-o>10&&"function"==typeof n,d=c?Date.now()+15:0;let h=0;const u=this.commonObjs,p=this.objs;let f;for(;;){if(void 0!==s&&o===s.nextBreakPoint)return s.breakIt(o,n),o;if(f=a[o],f!==r.OPS.dependency)this[f].apply(this,i[o]);else for(const t of i[o]){const e=t.startsWith("g_")?u:p;if(!e.has(t))return e.get(t,n),o}if(o++,o===l)return o;if(c&&++h>10){if(Date.now()>d)return n(),o;h=0}}}#xt(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();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)}endDrawing(){this.#xt(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#Et()}#Et(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}_scaleImage(t,e){const n=t.width,r=t.height;let s,i,a=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=n,c=r,d="prescale1";for(;a>2&&l>1||o>2&&c>1;){let e=l,n=c;a>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/e),o>2&&c>1&&(n=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/n),s=this.cachedCanvases.getCanvas(d,e,n),i=s.context,i.clearRect(0,0,e,n),i.drawImage(t,0,0,l,c,0,0,e,n),t=s.canvas,l=e,c=n,d="prescale1"===d?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:n,height:a}=t,o=this.current.fillColor,l=this.current.patternFill,c=(0,s.getCurrentTransform)(e);let d,h,u,p;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;h=JSON.stringify(l?c:[c.slice(0,4),o]),d=this._cachedBitmapsMap.get(e),d||(d=new Map,this._cachedBitmapsMap.set(e,d));const n=d.get(h);if(n&&!l){return{canvas:n,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])}}u=n}u||(p=this.cachedCanvases.getCanvas("maskCanvas",n,a),putBinaryImageMask(p.context,t));let f=r.Util.transform(c,[1/n,0,0,-1/a,0,0]);f=r.Util.transform(f,[1,0,0,1,0,-a]);const g=r.Util.applyTransform([0,0],f),m=r.Util.applyTransform([n,a],f),v=r.Util.normalizeRect([g[0],g[1],m[0],m[1]]),b=Math.round(v[2]-v[0])||1,y=Math.round(v[3]-v[1])||1,A=this.cachedCanvases.getCanvas("fillCanvas",b,y),_=A.context,S=Math.min(g[0],m[0]),x=Math.min(g[1],m[1]);_.translate(-S,-x),_.transform(...f),u||(u=this._scaleImage(p.canvas,(0,s.getCurrentTransformInverse)(_)),u=u.img,d&&l&&d.set(h,u)),_.imageSmoothingEnabled=getImageSmoothingEnabled((0,s.getCurrentTransform)(_),t.interpolate),drawImageAtIntegerCoords(_,u,0,0,u.width,u.height,0,0,n,a),_.globalCompositeOperation="source-in";const E=r.Util.transform((0,s.getCurrentTransformInverse)(_),[1,0,0,1,-S,-x]);return _.fillStyle=l?o.getPattern(e,this,E,i.PathType.FILL):o,_.fillRect(0,0,n,a),d&&!l&&(this.cachedCanvases.delete("fillCanvas"),d.set(h,A.canvas)),{canvas:A.canvas,offsetX:Math.round(S),offsetY:Math.round(x)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=d[t]}setLineJoin(t){this.ctx.lineJoin=h[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(t),n.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,n]of t)switch(e){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n,this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(n,t,e);this.suspendedCtx=this.ctx,this.ctx=r.context;const i=this.ctx;i.setTransform(...(0,s.getCurrentTransform)(this.suspendedCtx)),copyCtxState(this.suspendedCtx,i),function mirrorContextOperations(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function ctxSave(){e.save(),this.__originalSave()},t.restore=function ctxRestore(){e.restore(),this.__originalRestore()},t.translate=function ctxTranslate(t,n){e.translate(t,n),this.__originalTranslate(t,n)},t.scale=function ctxScale(t,n){e.scale(t,n),this.__originalScale(t,n)},t.transform=function ctxTransform(t,n,r,s,i,a){e.transform(t,n,r,s,i,a),this.__originalTransform(t,n,r,s,i,a)},t.setTransform=function ctxSetTransform(t,n,r,s,i,a){e.setTransform(t,n,r,s,i,a),this.__originalSetTransform(t,n,r,s,i,a)},t.resetTransform=function ctxResetTransform(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function ctxRotate(t){e.rotate(t),this.__originalRotate(t)},t.clip=function ctxRotate(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,n){e.moveTo(t,n),this.__originalMoveTo(t,n)},t.lineTo=function(t,n){e.lineTo(t,n),this.__originalLineTo(t,n)},t.bezierCurveTo=function(t,n,r,s,i,a){e.bezierCurveTo(t,n,r,s,i,a),this.__originalBezierCurveTo(t,n,r,s,i,a)},t.rect=function(t,n,r,s){e.rect(t,n,r,s),this.__originalRect(t,n,r,s)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(i,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),copyCtxState(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask;composeSMask(this.suspendedCtx,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(copyCtxState(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),copyCtxState(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,n,r,s,i){this.ctx.transform(t,e,n,r,s,i),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,n){const i=this.ctx,a=this.current;let o,l,c=a.x,d=a.y;const h=(0,s.getCurrentTransform)(i),u=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],p=u?n.slice(0):null;for(let n=0,s=0,f=t.length;n<f;n++)switch(0|t[n]){case r.OPS.rectangle:c=e[s++],d=e[s++];const t=e[s++],n=e[s++],f=c+t,g=d+n;i.moveTo(c,d),0===t||0===n?i.lineTo(f,g):(i.lineTo(f,d),i.lineTo(f,g),i.lineTo(c,g)),u||a.updateRectMinMax(h,[c,d,f,g]),i.closePath();break;case r.OPS.moveTo:c=e[s++],d=e[s++],i.moveTo(c,d),u||a.updatePathMinMax(h,c,d);break;case r.OPS.lineTo:c=e[s++],d=e[s++],i.lineTo(c,d),u||a.updatePathMinMax(h,c,d);break;case r.OPS.curveTo:o=c,l=d,c=e[s+4],d=e[s+5],i.bezierCurveTo(e[s],e[s+1],e[s+2],e[s+3],c,d),a.updateCurvePathMinMax(h,o,l,e[s],e[s+1],e[s+2],e[s+3],c,d,p),s+=6;break;case r.OPS.curveTo2:o=c,l=d,i.bezierCurveTo(c,d,e[s],e[s+1],e[s+2],e[s+3]),a.updateCurvePathMinMax(h,o,l,c,d,e[s],e[s+1],e[s+2],e[s+3],p),c=e[s+2],d=e[s+3],s+=4;break;case r.OPS.curveTo3:o=c,l=d,c=e[s+2],d=e[s+3],i.bezierCurveTo(e[s],e[s+1],c,d,c,d),a.updateCurvePathMinMax(h,o,l,e[s],e[s+1],c,d,c,d,p),s+=4;break;case r.OPS.closePath:i.closePath()}u&&a.updateScalingPathMinMax(h,p),a.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,n=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof n&&null!=n&&n.getPattern?(e.save(),e.strokeStyle=n.getPattern(e,this,(0,s.getCurrentTransformInverse)(e),i.PathType.STROKE),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,n=this.current.fillColor;let r=!1;this.current.patternFill&&(e.save(),e.fillStyle=n.getPattern(e,this,(0,s.getCurrentTransformInverse)(e),i.PathType.FILL),r=!0);const a=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==a&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),r&&e.restore(),t&&this.consumePath(a)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=u}eoClip(){this.pendingClip=p}beginText(){this.current.textMatrix=r.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(const n of t)e.setTransform(...n.transform),e.translate(n.x,n.y),n.addToPath(e,n.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){var n;const s=this.commonObjs.get(t),i=this.current;if(!s)throw new Error(`Can't find font for ${t}`);if(i.fontMatrix=s.fontMatrix||r.FONT_IDENTITY_MATRIX,0!==i.fontMatrix[0]&&0!==i.fontMatrix[3]||(0,r.warn)("Invalid font matrix for font "+t),e<0?(e=-e,i.fontDirection=-1):i.fontDirection=1,this.current.font=s,this.current.fontSize=e,s.isType3Font)return;const a=s.loadedName||"sans-serif",o=(null===(n=s.systemFontInfo)||void 0===n?void 0:n.css)||`"${a}", ${s.fallbackName}`;let l="normal";s.black?l="900":s.bold&&(l="bold");const c=s.italic?"italic":"normal";let d=e;e<16?d=16:e>100&&(d=100),this.current.fontSizeScale=e/d,this.ctx.font=`${c} ${l} ${d}px ${o}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,n,r,s,i){this.current.textMatrix=[t,e,n,r,s,i],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,n,i){const a=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,h=c&r.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&r.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;let f;if((l.disableFontFace||u||p)&&(f=l.getPathGenerator(this.commonObjs,t)),l.disableFontFace||p?(a.save(),a.translate(e,n),a.beginPath(),f(a,d),i&&a.setTransform(...i),h!==r.TextRenderingMode.FILL&&h!==r.TextRenderingMode.FILL_STROKE||a.fill(),h!==r.TextRenderingMode.STROKE&&h!==r.TextRenderingMode.FILL_STROKE||a.stroke(),a.restore()):(h!==r.TextRenderingMode.FILL&&h!==r.TextRenderingMode.FILL_STROKE||a.fillText(t,e,n),h!==r.TextRenderingMode.STROKE&&h!==r.TextRenderingMode.FILL_STROKE||a.strokeText(t,e,n)),u){(this.pendingTextPaths||=[]).push({transform:(0,s.getCurrentTransform)(a),x:e,y:n,fontSize:d,addToPath:f})}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let n=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){n=!0;break}return(0,r.shadow)(this,"isFontSubpixelAAEnabled",n)}showText(t){const e=this.current,n=e.font;if(n.isType3Font)return this.showType3Text(t);const a=e.fontSize;if(0===a)return;const o=this.ctx,l=e.fontSizeScale,c=e.charSpacing,d=e.wordSpacing,h=e.fontDirection,u=e.textHScale*h,p=t.length,f=n.vertical,g=f?1:-1,m=n.defaultVMetrics,v=a*e.fontMatrix[0],b=e.textRenderingMode===r.TextRenderingMode.FILL&&!n.disableFontFace&&!e.patternFill;let y;if(o.save(),o.transform(...e.textMatrix),o.translate(e.x,e.y+e.textRise),h>0?o.scale(u,-1):o.scale(u,1),e.patternFill){o.save();const t=e.fillColor.getPattern(o,this,(0,s.getCurrentTransformInverse)(o),i.PathType.FILL);y=(0,s.getCurrentTransform)(o),o.restore(),o.fillStyle=t}let A=e.lineWidth;const _=e.textMatrixScale;if(0===_||0===A){const t=e.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;t!==r.TextRenderingMode.STROKE&&t!==r.TextRenderingMode.FILL_STROKE||(A=this.getSinglePixelWidth())}else A/=_;if(1!==l&&(o.scale(l,l),A/=l),o.lineWidth=A,n.isInvalidPDFjsFont){const n=[];let r=0;for(const e of t)n.push(e.unicode),r+=e.width;return o.fillText(n.join(""),0,0),e.x+=r*v*u,o.restore(),void this.compose()}let S,x=0;for(S=0;S<p;++S){const e=t[S];if("number"==typeof e){x+=g*e*a/1e3;continue}let r=!1;const s=(e.isSpace?d:0)+c,i=e.fontChar,u=e.accent;let p,A,_,E=e.width;if(f){const t=e.vmetric||m,n=-(e.vmetric?t[1]:.5*E)*v,r=t[2]*v;E=t?-t[0]:E,p=n/l,A=(x+r)/l}else p=x/l,A=0;if(n.remeasure&&E>0){const t=1e3*o.measureText(i).width/a*l;if(E<t&&this.isFontSubpixelAAEnabled){const e=E/t;r=!0,o.save(),o.scale(e,1),p/=e}else E!==t&&(p+=(E-t)/2e3*a/l)}if(this.contentVisible&&(e.isInFont||n.missingFile))if(b&&!u)o.fillText(i,p,A);else if(this.paintChar(i,p,A,y),u){const t=p+a*u.offset.x/l,e=A-a*u.offset.y/l;this.paintChar(u.fontChar,t,e,y)}_=f?E*v-s*h:E*v+s*h,x+=_,r&&o.restore()}f?e.y-=x:e.x+=x*u,o.restore(),this.compose()}showType3Text(t){const e=this.ctx,n=this.current,s=n.font,i=n.fontSize,a=n.fontDirection,o=s.vertical?1:-1,l=n.charSpacing,c=n.wordSpacing,d=n.textHScale*a,h=n.fontMatrix||r.FONT_IDENTITY_MATRIX,u=t.length;let p,f,g,m;if(!(n.textRenderingMode===r.TextRenderingMode.INVISIBLE)&&0!==i){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...n.textMatrix),e.translate(n.x,n.y),e.scale(d,a),p=0;p<u;++p){if(f=t[p],"number"==typeof f){m=o*f*i/1e3,this.ctx.translate(m,0),n.x+=m*d;continue}const a=(f.isSpace?c:0)+l,u=s.charProcOperatorList[f.operatorListId];if(!u){(0,r.warn)(`Type3 character "${f.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=f,this.save(),e.scale(i,i),e.transform(...h),this.executeOperatorList(u),this.restore());g=r.Util.applyTransform([f.width,0],h)[0]*i+a,e.translate(g,0),n.x+=g*d}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,n,r,s,i){this.ctx.rect(n,r,s-n,i-r),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const n=t[1],r=this.baseTransform||(0,s.getCurrentTransform)(this.ctx),a={createCanvasGraphics:t=>new CanvasGraphics(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new i.TilingPattern(t,n,this.ctx,a,r)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,n){const s=r.Util.makeHexColor(t,e,n);this.ctx.strokeStyle=s,this.current.strokeColor=s}setFillRGBColor(t,e,n){const s=r.Util.makeHexColor(t,e,n);this.ctx.fillStyle=s,this.current.fillColor=s,this.current.patternFill=!1}_getPattern(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=(0,i.getShadingPattern)(this.getObject(t)),this.cachedPatterns.set(t,e)),n&&(e.matrix=n),e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const n=this._getPattern(t);e.fillStyle=n.getPattern(e,this,(0,s.getCurrentTransformInverse)(e),i.PathType.SHADING);const a=(0,s.getCurrentTransformInverse)(e);if(a){const t=e.canvas,n=t.width,s=t.height,i=r.Util.applyTransform([0,0],a),o=r.Util.applyTransform([0,s],a),l=r.Util.applyTransform([n,0],a),c=r.Util.applyTransform([n,s],a),d=Math.min(i[0],o[0],l[0],c[0]),h=Math.min(i[1],o[1],l[1],c[1]),u=Math.max(i[0],o[0],l[0],c[0]),p=Math.max(i[1],o[1],l[1],c[1]);this.ctx.fillRect(d,h,u-d,p-h)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,r.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,r.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(t)&&6===t.length&&this.transform(...t),this.baseTransform=(0,s.getCurrentTransform)(this.ctx),e)){const t=e[2]-e[0],n=e[3]-e[1];this.ctx.rect(e[0],e[1],t,n),this.current.updateRectMinMax((0,s.getCurrentTransform)(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||(0,r.info)("TODO: Support non-isolated groups."),t.knockout&&(0,r.warn)("Knockout groups not supported.");const n=(0,s.getCurrentTransform)(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let i=r.Util.getAxialAlignedBoundingBox(t.bbox,(0,s.getCurrentTransform)(e));const a=[0,0,e.canvas.width,e.canvas.height];i=r.Util.intersect(i,a)||[0,0,0,0];const o=Math.floor(i[0]),c=Math.floor(i[1]);let d=Math.max(Math.ceil(i[2])-o,1),h=Math.max(Math.ceil(i[3])-c,1),u=1,p=1;d>l&&(u=d/l,d=l),h>l&&(p=h/l,h=l),this.current.startNewPathAndClipBox([0,0,d,h]);let f="groupAt"+this.groupLevel;t.smask&&(f+="_smask_"+this.smaskCounter++%2);const g=this.cachedCanvases.getCanvas(f,d,h),m=g.context;m.scale(1/u,1/p),m.translate(-o,-c),m.transform(...n),t.smask?this.smaskStack.push({canvas:g.canvas,context:m,offsetX:o,offsetY:c,scaleX:u,scaleY:p,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(o,c),e.scale(u,p),e.save()),copyCtxState(e,m),this.ctx=m,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=(0,s.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const n=r.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(t,e,n,i,a){if(this.#xt(),resetCtxToDefault(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(e)&&4===e.length){const i=e[2]-e[0],o=e[3]-e[1];if(a&&this.annotationCanvasMap){(n=n.slice())[4]-=e[0],n[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=i,e[3]=o;const[a,l]=r.Util.singularValueDecompose2dScale((0,s.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,d=Math.ceil(i*this.outputScaleX*c),h=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,h);const{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(a,0,0,-l,0,o*l),resetCtxToDefault(this.ctx)}else resetCtxToDefault(this.ctx),this.ctx.rect(e[0],e[1],i,o),this.ctx.clip(),this.endPath()}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...i)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#Et(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const n=this.ctx,r=this.processingType3;if(r&&(void 0===r.compiled&&(r.compiled=function compileType3Glyph(t){const{width:e,height:n}=t;if(e>1e3||n>1e3)return null;const r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let i,a,o,l=new Uint8Array(s*(n+1));const c=e+7&-8;let d=new Uint8Array(c*n),h=0;for(const e of t.data){let t=128;for(;t>0;)d[h++]=e&t?0:255,t>>=1}let u=0;for(h=0,0!==d[h]&&(l[0]=1,++u),a=1;a<e;a++)d[h]!==d[h+1]&&(l[a]=d[h]?2:1,++u),h++;for(0!==d[h]&&(l[a]=2,++u),i=1;i<n;i++){h=i*c,o=i*s,d[h-c]!==d[h]&&(l[o]=d[h]?1:8,++u);let t=(d[h]?4:0)+(d[h-c]?8:0);for(a=1;a<e;a++)t=(t>>2)+(d[h+1]?4:0)+(d[h-c+1]?8:0),r[t]&&(l[o+a]=r[t],++u),h++;if(d[h-c]!==d[h]&&(l[o+a]=d[h]?2:4,++u),u>1e3)return null}for(h=c*(n-1),o=i*s,0!==d[h]&&(l[o]=8,++u),a=1;a<e;a++)d[h]!==d[h+1]&&(l[o+a]=d[h]?4:8,++u),h++;if(0!==d[h]&&(l[o+a]=4,++u),u>1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),f=new Path2D;for(i=0;u&&i<=n;i++){let t=i*s;const n=t+e;for(;t<n&&!l[t];)t++;if(t===n)continue;f.moveTo(t%s,i);const r=t;let a=l[t];do{const e=p[a];do{t+=e}while(!l[t]);const n=l[t];5!==n&&10!==n?(a=n,l[t]=0):(a=n&51*a>>4,l[t]&=a>>2|a<<2),f.lineTo(t%s,t/s|0),l[t]||--u}while(r!==t);--i}return d=null,l=null,function(t){t.save(),t.scale(1/e,-1/n),t.translate(0,-n),t.fill(f),t.beginPath(),t.restore()}}(t)),r.compiled))return void r.compiled(n);const s=this._createMaskCanvas(t),i=s.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(i,s.offsetX,s.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const l=this.ctx;l.save();const c=(0,s.getCurrentTransform)(l);l.transform(e,n,i,a,0,0);const d=this._createMaskCanvas(t);l.setTransform(1,0,0,1,d.offsetX-c[4],d.offsetY-c[5]);for(let t=0,s=o.length;t<s;t+=2){const s=r.Util.transform(c,[e,n,i,a,o[t],o[t+1]]),[h,u]=r.Util.applyTransform([0,0],s);l.drawImage(d.canvas,h,u)}l.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,n=this.current.fillColor,r=this.current.patternFill;for(const a of t){const{data:t,width:o,height:l,transform:c}=a,d=this.cachedCanvases.getCanvas("maskCanvas",o,l),h=d.context;h.save();putBinaryImageMask(h,this.getObject(t,a)),h.globalCompositeOperation="source-in",h.fillStyle=r?n.getPattern(h,this,(0,s.getCurrentTransformInverse)(e),i.PathType.FILL):n,h.fillRect(0,0,o,l),h.restore(),e.save(),e.transform(...c),e.scale(1,-1),drawImageAtIntegerCoords(e,d.canvas,0,0,o,l,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,r.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,n,s){if(!this.contentVisible)return;const i=this.getObject(t);if(!i)return void(0,r.warn)("Dependent image isn't ready yet");const a=i.width,o=i.height,l=[];for(let t=0,r=s.length;t<r;t+=2)l.push({transform:[e,0,0,n,s[t],s[t+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(i,l)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:n,height:r}=t,s=this.cachedCanvases.getCanvas("inlineImage",n,r),i=s.context;return i.filter=this.current.transferMaps,i.drawImage(e,0,0),i.filter="none",s.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,n=t.height,r=this.ctx;let i;if(this.save(),o.isNodeJS||(r.filter="none"),r.scale(1/e,-1/n),t.bitmap)i=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)i=t;else{const r=this.cachedCanvases.getCanvas("inlineImage",e,n).context;putBinaryImageData(r,t),i=this.applyTransferMapsToCanvas(r)}const a=this._scaleImage(i,(0,s.getCurrentTransformInverse)(r));r.imageSmoothingEnabled=getImageSmoothingEnabled((0,s.getCurrentTransform)(r),t.interpolate),drawImageAtIntegerCoords(r,a.img,0,0,a.paintWidth,a.paintHeight,0,-n,e,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const n=this.ctx;let r;if(t.bitmap)r=t.bitmap;else{const e=t.width,n=t.height,s=this.cachedCanvases.getCanvas("inlineImage",e,n).context;putBinaryImageData(s,t),r=this.applyTransferMapsToCanvas(s)}for(const t of e)n.save(),n.transform(...t.transform),n.scale(1,-1),drawImageAtIntegerCoords(n,r,t.x,t.y,t.w,t.h,0,-1,1,1),n.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const n=this.ctx;this.pendingClip&&(e||(this.pendingClip===p?n.clip("evenodd"):n.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),n.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=(0,s.getCurrentTransform)(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),n=Math.hypot(t[0],t[2]),r=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(n,r)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:n,c:r,d:s}=this.ctx.getTransform();let i,a;if(0===n&&0===r){const n=Math.abs(e),r=Math.abs(s);if(n===r)if(0===t)i=a=1/n;else{const e=n*t;i=a=e<1?1/e:1}else if(0===t)i=1/n,a=1/r;else{const e=n*t,s=r*t;i=e<1?1/e:1,a=s<1?1/s:1}}else{const o=Math.abs(e*s-n*r),l=Math.hypot(e,n),c=Math.hypot(r,s);if(0===t)i=c/o,a=l/o;else{const e=t*o;i=c>e?c/e:1,a=l>e?l/e:1}}this._cachedScaleForStroking[0]=i,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:n}=this.current,[r,s]=this.getScaleForStroking();if(e.lineWidth=n||1,1===r&&1===s)return void e.stroke();const i=e.getLineDash();if(t&&e.save(),e.scale(r,s),i.length>0){const t=Math.max(r,s);e.setLineDash(i.map((e=>e/t))),e.lineDashOffset/=t}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}e.CanvasGraphics=CanvasGraphics;for(const t in r.OPS)void 0!==CanvasGraphics.prototype[t]&&(CanvasGraphics.prototype[r.OPS[t]]=CanvasGraphics.prototype[t])},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TilingPattern=e.PathType=void 0,e.getShadingPattern=function getShadingPattern(t){switch(t[0]){case"RadialAxial":return new RadialAxialShadingPattern(t);case"Mesh":return new MeshShadingPattern(t);case"Dummy":return new DummyShadingPattern}throw new Error(`Unknown IR type: ${t[0]}`)};var r=n(1),s=n(142);const i={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function applyBoundingBox(t,e){if(!e)return;const n=e[2]-e[0],r=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],n,r),t.clip(s)}e.PathType=i;class BaseShadingPattern{constructor(){this.constructor===BaseShadingPattern&&(0,r.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,r.unreachable)("Abstract method `getPattern` called.")}}class RadialAxialShadingPattern extends BaseShadingPattern{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(t,e,n,a){let o;if(a===i.STROKE||a===i.FILL){const i=e.current.getClippedPathBoundingBox(a,(0,s.getCurrentTransform)(t))||[0,0,0,0],l=Math.ceil(i[2]-i[0])||1,c=Math.ceil(i[3]-i[1])||1,d=e.cachedCanvases.getCanvas("pattern",l,c,!0),h=d.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-i[0],-i[1]),n=r.Util.transform(n,[1,0,0,1,i[0],i[1]]),h.transform(...e.baseTransform),this.matrix&&h.transform(...this.matrix),applyBoundingBox(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),o=t.createPattern(d.canvas,"no-repeat");const u=new DOMMatrix(n);o.setTransform(u)}else applyBoundingBox(t,this._bbox),o=this._createGradient(t);return o}}function drawTriangle(t,e,n,r,s,i,a,o){const l=e.coords,c=e.colors,d=t.data,h=4*t.width;let u;l[n+1]>l[r+1]&&(u=n,n=r,r=u,u=i,i=a,a=u),l[r+1]>l[s+1]&&(u=r,r=s,s=u,u=a,a=o,o=u),l[n+1]>l[r+1]&&(u=n,n=r,r=u,u=i,i=a,a=u);const p=(l[n]+e.offsetX)*e.scaleX,f=(l[n+1]+e.offsetY)*e.scaleY,g=(l[r]+e.offsetX)*e.scaleX,m=(l[r+1]+e.offsetY)*e.scaleY,v=(l[s]+e.offsetX)*e.scaleX,b=(l[s+1]+e.offsetY)*e.scaleY;if(f>=b)return;const y=c[i],A=c[i+1],_=c[i+2],S=c[a],x=c[a+1],E=c[a+2],C=c[o],w=c[o+1],P=c[o+2],T=Math.round(f),k=Math.round(b);let M,R,D,I,O,L,N,j;for(let t=T;t<=k;t++){if(t<m){let e;e=t<f?0:(f-t)/(f-m),M=p-(p-g)*e,R=y-(y-S)*e,D=A-(A-x)*e,I=_-(_-E)*e}else{let e;e=t>b?1:m===b?0:(m-t)/(m-b),M=g-(g-v)*e,R=S-(S-C)*e,D=x-(x-w)*e,I=E-(E-P)*e}let e;e=t<f?0:t>b?1:(f-t)/(f-b),O=p-(p-v)*e,L=y-(y-C)*e,N=A-(A-w)*e,j=_-(_-P)*e;const n=Math.round(Math.min(M,O)),r=Math.round(Math.max(M,O));let s=h*t+4*n;for(let t=n;t<=r;t++)e=(M-t)/(M-O),e<0?e=0:e>1&&(e=1),d[s++]=R-(R-L)*e|0,d[s++]=D-(D-N)*e|0,d[s++]=I-(I-j)*e|0,d[s++]=255}}function drawFigure(t,e,n){const r=e.coords,s=e.colors;let i,a;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(r.length/o)-1,c=o-1;for(i=0;i<l;i++){let e=i*o;for(let i=0;i<c;i++,e++)drawTriangle(t,n,r[e],r[e+1],r[e+o],s[e],s[e+1],s[e+o]),drawTriangle(t,n,r[e+o+1],r[e+1],r[e+o],s[e+o+1],s[e+1],s[e+o])}break;case"triangles":for(i=0,a=r.length;i<a;i+=3)drawTriangle(t,n,r[i],r[i+1],r[i+2],s[i],s[i+1],s[i+2]);break;default:throw new Error("illegal figure")}}class MeshShadingPattern extends BaseShadingPattern{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,n){const r=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),i=Math.ceil(this._bounds[2])-r,a=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(i*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(a*t[1]*1.1)),3e3),c=i/o,d=a/l,h={coords:this._coords,colors:this._colors,offsetX:-r,offsetY:-s,scaleX:1/c,scaleY:1/d},u=o+4,p=l+4,f=n.getCanvas("mesh",u,p,!1),g=f.context,m=g.createImageData(o,l);if(e){const t=m.data;for(let n=0,r=t.length;n<r;n+=4)t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=255}for(const t of this._figures)drawFigure(m,t,h);g.putImageData(m,2,2);return{canvas:f.canvas,offsetX:r-2*c,offsetY:s-2*d,scaleX:c,scaleY:d}}getPattern(t,e,n,a){let o;if(applyBoundingBox(t,this._bbox),a===i.SHADING)o=r.Util.singularValueDecompose2dScale((0,s.getCurrentTransform)(t));else if(o=r.Util.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=r.Util.singularValueDecompose2dScale(this.matrix);o=[o[0]*t[0],o[1]*t[1]]}const l=this._createMeshCanvas(o,a===i.SHADING?null:this._background,e.cachedCanvases);return a!==i.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(l.offsetX,l.offsetY),t.scale(l.scaleX,l.scaleY),t.createPattern(l.canvas,"no-repeat")}}class DummyShadingPattern extends BaseShadingPattern{getPattern(){return"hotpink"}}const a=1,o=2;class TilingPattern{static MAX_PATTERN_SIZE=3e3;constructor(t,e,n,r,s){this.operatorList=t[2],this.matrix=t[3]||[1,0,0,1,0,0],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=n,this.canvasGraphicsFactory=r,this.baseTransform=s}createPatternCanvas(t){const e=this.operatorList,n=this.bbox,i=this.xstep,a=this.ystep,o=this.paintType,l=this.tilingType,c=this.color,d=this.canvasGraphicsFactory;(0,r.info)("TilingType: "+l);const h=n[0],u=n[1],p=n[2],f=n[3],g=r.Util.singularValueDecompose2dScale(this.matrix),m=r.Util.singularValueDecompose2dScale(this.baseTransform),v=[g[0]*m[0],g[1]*m[1]],b=this.getSizeAndScale(i,this.ctx.canvas.width,v[0]),y=this.getSizeAndScale(a,this.ctx.canvas.height,v[1]),A=t.cachedCanvases.getCanvas("pattern",b.size,y.size,!0),_=A.context,S=d.createCanvasGraphics(_);S.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(S,o,c);let x=h,E=u,C=p,w=f;return h<0&&(x=0,C+=Math.abs(h)),u<0&&(E=0,w+=Math.abs(u)),_.translate(-b.scale*x,-y.scale*E),S.transform(b.scale,0,0,y.scale,0,0),_.save(),this.clipBbox(S,x,E,C,w),S.baseTransform=(0,s.getCurrentTransform)(S.ctx),S.executeOperatorList(e),S.endDrawing(),{canvas:A.canvas,scaleX:b.scale,scaleY:y.scale,offsetX:x,offsetY:E}}getSizeAndScale(t,e,n){t=Math.abs(t);const r=Math.max(TilingPattern.MAX_PATTERN_SIZE,e);let s=Math.ceil(t*n);return s>=r?s=r:n=s/t,{scale:n,size:s}}clipBbox(t,e,n,r,i){const a=r-e,o=i-n;t.ctx.rect(e,n,a,o),t.current.updateRectMinMax((0,s.getCurrentTransform)(t.ctx),[e,n,r,i]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,n){const s=t.ctx,i=t.current;switch(e){case a:const t=this.ctx;s.fillStyle=t.fillStyle,s.strokeStyle=t.strokeStyle,i.fillColor=t.fillStyle,i.strokeColor=t.strokeStyle;break;case o:const l=r.Util.makeHexColor(n[0],n[1],n[2]);s.fillStyle=l,s.strokeStyle=l,i.fillColor=l,i.strokeColor=l;break;default:throw new r.FormatError(`Unsupported paint type: ${e}`)}}getPattern(t,e,n,s){let a=n;s!==i.SHADING&&(a=r.Util.transform(a,e.baseTransform),this.matrix&&(a=r.Util.transform(a,this.matrix)));const o=this.createPatternCanvas(e);let l=new DOMMatrix(a);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const c=t.createPattern(o.canvas,"repeat");return c.setTransform(l),c}}e.TilingPattern=TilingPattern},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.convertBlackAndWhiteToRGBA=convertBlackAndWhiteToRGBA,e.convertToRGBA=function convertToRGBA(t){switch(t.kind){case r.ImageKind.GRAYSCALE_1BPP:return convertBlackAndWhiteToRGBA(t);case r.ImageKind.RGB_24BPP:return function convertRGBToRGBA(t){let{src:e,srcPos:n=0,dest:s,destPos:i=0,width:a,height:o}=t,l=0;const c=e.length>>2,d=new Uint32Array(e.buffer,n,c);if(r.FeatureTest.isLittleEndian){for(;l<c-2;l+=3,i+=4){const t=d[l],e=d[l+1],n=d[l+2];s[i]=4278190080|t,s[i+1]=t>>>24|e<<8|4278190080,s[i+2]=e>>>16|n<<16|4278190080,s[i+3]=n>>>8|4278190080}for(let t=4*l,n=e.length;t<n;t+=3)s[i++]=e[t]|e[t+1]<<8|e[t+2]<<16|4278190080}else{for(;l<c-2;l+=3,i+=4){const t=d[l],e=d[l+1],n=d[l+2];s[i]=255|t,s[i+1]=t<<24|e>>>8|255,s[i+2]=e<<16|n>>>16|255,s[i+3]=n<<8|255}for(let t=4*l,n=e.length;t<n;t+=3)s[i++]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|255}return{srcPos:n,destPos:i}}(t)}return null},e.grayToRGBA=function grayToRGBA(t,e){if(r.FeatureTest.isLittleEndian)for(let n=0,r=t.length;n<r;n++)e[n]=65793*t[n]|4278190080;else for(let n=0,r=t.length;n<r;n++)e[n]=16843008*t[n]|255};var r=n(1);function convertBlackAndWhiteToRGBA(t){let{src:e,srcPos:n=0,dest:s,width:i,height:a,nonBlackColor:o=4294967295,inverseDecode:l=!1}=t;const c=r.FeatureTest.isLittleEndian?4278190080:255,[d,h]=l?[o,c]:[c,o],u=i>>3,p=7&i,f=e.length;s=new Uint32Array(s.buffer);let g=0;for(let t=0;t<a;t++){for(const t=n+u;n<t;n++){const t=n<f?e[n]:255;s[g++]=128&t?h:d,s[g++]=64&t?h:d,s[g++]=32&t?h:d,s[g++]=16&t?h:d,s[g++]=8&t?h:d,s[g++]=4&t?h:d,s[g++]=2&t?h:d,s[g++]=1&t?h:d}if(0===p)continue;const t=n<f?e[n++]:255;for(let e=0;e<p;e++)s[g++]=t&1<<7-e?h:d}return{srcPos:n,destPos:g}}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;const n=Object.create(null);e.GlobalWorkerOptions=n,n.workerPort=null,n.workerSrc=""},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;var r=n(1);const s=1,i=2,a=1,o=2,l=3,c=4,d=5,h=6,u=7,p=8;function wrapReason(t){switch(t instanceof Error||"object"==typeof t&&null!==t||(0,r.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new r.AbortException(t.message);case"MissingPDFException":return new r.MissingPDFException(t.message);case"PasswordException":return new r.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new r.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new r.UnknownErrorException(t.message,t.details);default:return new r.UnknownErrorException(t.message,t.toString())}}e.MessageHandler=class MessageHandler{constructor(t,e,n){this.sourceName=t,this.targetName=e,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#Ct(e);if(e.callback){const t=e.callbackId,n=this.callbackCapabilities[t];if(!n)throw new Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===s)n.resolve(e.data);else{if(e.callback!==i)throw new Error("Unexpected callback case");n.reject(wrapReason(e.reason))}return}const r=this.actionHandler[e.action];if(!r)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,a=e.sourceName;new Promise((function(t){t(r(e.data))})).then((function(r){n.postMessage({sourceName:t,targetName:a,callback:s,callbackId:e.callbackId,data:r})}),(function(r){n.postMessage({sourceName:t,targetName:a,callback:i,callbackId:e.callbackId,reason:wrapReason(r)})}))}else e.streamId?this.#wt(e):r(e.data)},n.addEventListener("message",this._onComObjOnMessage)}on(t,e){const n=this.actionHandler;if(n[t])throw new Error(`There is already an actionName called "${t}"`);n[t]=e}send(t,e,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},n)}sendWithPromise(t,e,n){const s=this.callbackId++,i=new r.PromiseCapability;this.callbackCapabilities[s]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:s,data:e},n)}catch(t){i.reject(t)}return i.promise}sendWithStream(t,e,n,s){const i=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:n=>{const a=new r.PromiseCapability;return this.streamControllers[i]={controller:n,startCall:a,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:o,targetName:l,action:t,streamId:i,data:e,desiredSize:n.desiredSize},s),a.promise},pull:t=>{const e=new r.PromiseCapability;return this.streamControllers[i].pullCall=e,c.postMessage({sourceName:o,targetName:l,stream:h,streamId:i,desiredSize:t.desiredSize}),e.promise},cancel:t=>{(0,r.assert)(t instanceof Error,"cancel must have a valid reason");const e=new r.PromiseCapability;return this.streamControllers[i].cancelCall=e,this.streamControllers[i].isClosed=!0,c.postMessage({sourceName:o,targetName:l,stream:a,streamId:i,reason:wrapReason(t)}),e.promise}},n)}#wt(t){const e=t.streamId,n=this.sourceName,s=t.sourceName,i=this.comObj,a=this,o=this.actionHandler[t.action],h={enqueue(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=a,l>0&&this.desiredSize<=0&&(this.sinkCapability=new r.PromiseCapability,this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:s,stream:c,streamId:e,chunk:t},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:s,stream:l,streamId:e}),delete a.streamSinks[e])},error(t){(0,r.assert)(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:s,stream:d,streamId:e,reason:wrapReason(t)}))},sinkCapability:new r.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};h.sinkCapability.resolve(),h.ready=h.sinkCapability.promise,this.streamSinks[e]=h,new Promise((function(e){e(o(t.data,h))})).then((function(){i.postMessage({sourceName:n,targetName:s,stream:p,streamId:e,success:!0})}),(function(t){i.postMessage({sourceName:n,targetName:s,stream:p,streamId:e,reason:wrapReason(t)})}))}#Ct(t){const e=t.streamId,n=this.sourceName,s=t.sourceName,i=this.comObj,f=this.streamControllers[e],g=this.streamSinks[e];switch(t.stream){case p:t.success?f.startCall.resolve():f.startCall.reject(wrapReason(t.reason));break;case u:t.success?f.pullCall.resolve():f.pullCall.reject(wrapReason(t.reason));break;case h:if(!g){i.postMessage({sourceName:n,targetName:s,stream:u,streamId:e,success:!0});break}g.desiredSize<=0&&t.desiredSize>0&&g.sinkCapability.resolve(),g.desiredSize=t.desiredSize,new Promise((function(t){var e;t(null===(e=g.onPull)||void 0===e?void 0:e.call(g))})).then((function(){i.postMessage({sourceName:n,targetName:s,stream:u,streamId:e,success:!0})}),(function(t){i.postMessage({sourceName:n,targetName:s,stream:u,streamId:e,reason:wrapReason(t)})}));break;case c:if((0,r.assert)(f,"enqueue should have stream controller"),f.isClosed)break;f.controller.enqueue(t.chunk);break;case l:if((0,r.assert)(f,"close should have stream controller"),f.isClosed)break;f.isClosed=!0,f.controller.close(),this.#Pt(f,e);break;case d:(0,r.assert)(f,"error should have stream controller"),f.controller.error(wrapReason(t.reason)),this.#Pt(f,e);break;case o:t.success?f.cancelCall.resolve():f.cancelCall.reject(wrapReason(t.reason)),this.#Pt(f,e);break;case a:if(!g)break;new Promise((function(e){var n;e(null===(n=g.onCancel)||void 0===n?void 0:n.call(g,wrapReason(t.reason)))})).then((function(){i.postMessage({sourceName:n,targetName:s,stream:o,streamId:e,success:!0})}),(function(t){i.postMessage({sourceName:n,targetName:s,stream:o,streamId:e,reason:wrapReason(t)})})),g.sinkCapability.reject(wrapReason(t.reason)),g.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#Pt(t,e){var n,r,s;await Promise.allSettled([null===(n=t.startCall)||void 0===n?void 0:n.promise,null===(r=t.pullCall)||void 0===r?void 0:r.promise,null===(s=t.cancelCall)||void 0===s?void 0:s.promise]),delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var r=n(1);e.Metadata=class Metadata{#Tt;#kt;constructor(t){let{parsedData:e,rawData:n}=t;this.#Tt=e,this.#kt=n}getRaw(){return this.#kt}get(t){return this.#Tt.get(t)??null}getAll(){return(0,r.objectFromMap)(this.#Tt)}has(t){return this.#Tt.has(t)}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalContentConfig=void 0;var r=n(1),s=n(144);const i=Symbol("INTERNAL");class OptionalContentGroup{#Ft=!0;constructor(t,e){this.name=t,this.intent=e}get visible(){return this.#Ft}_setVisible(t,e){t!==i&&(0,r.unreachable)("Internal method `_setVisible` called."),this.#Ft=e}}e.OptionalContentConfig=class OptionalContentConfig{#Mt=null;#Rt=new Map;#Dt=null;#It=null;constructor(t){if(this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,this.#It=t.order;for(const e of t.groups)this.#Rt.set(e.id,new OptionalContentGroup(e.name,e.intent));if("OFF"===t.baseState)for(const t of this.#Rt.values())t._setVisible(i,!1);for(const e of t.on)this.#Rt.get(e)._setVisible(i,!0);for(const e of t.off)this.#Rt.get(e)._setVisible(i,!1);this.#Dt=this.getHash()}}#Ot(t){const e=t.length;if(e<2)return!0;const n=t[0];for(let s=1;s<e;s++){const e=t[s];let i;if(Array.isArray(e))i=this.#Ot(e);else{if(!this.#Rt.has(e))return(0,r.warn)(`Optional content group not found: ${e}`),!0;i=this.#Rt.get(e).visible}switch(n){case"And":if(!i)return!1;break;case"Or":if(i)return!0;break;case"Not":return!i;default:return!0}}return"And"===n}isVisible(t){if(0===this.#Rt.size)return!0;if(!t)return(0,r.warn)("Optional content group not defined."),!0;if("OCG"===t.type)return this.#Rt.has(t.id)?this.#Rt.get(t.id).visible:((0,r.warn)(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#Ot(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!this.#Rt.has(e))return(0,r.warn)(`Optional content group not found: ${e}`),!0;if(this.#Rt.get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!this.#Rt.has(e))return(0,r.warn)(`Optional content group not found: ${e}`),!0;if(!this.#Rt.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!this.#Rt.has(e))return(0,r.warn)(`Optional content group not found: ${e}`),!0;if(!this.#Rt.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!this.#Rt.has(e))return(0,r.warn)(`Optional content group not found: ${e}`),!0;if(this.#Rt.get(e).visible)return!1}return!0}return(0,r.warn)(`Unknown optional content policy ${t.policy}.`),!0}return(0,r.warn)(`Unknown group type ${t.type}.`),!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.#Rt.has(t)?(this.#Rt.get(t)._setVisible(i,!!e),this.#Mt=null):(0,r.warn)(`Optional content group not found: ${t}`)}get hasInitialVisibility(){return this.getHash()===this.#Dt}getOrder(){return this.#Rt.size?this.#It?this.#It.slice():[...this.#Rt.keys()]:null}getGroups(){return this.#Rt.size>0?(0,r.objectFromMap)(this.#Rt):null}getGroup(t){return this.#Rt.get(t)||null}getHash(){if(null!==this.#Mt)return this.#Mt;const t=new s.MurmurHash3_64;for(const[e,n]of this.#Rt)t.update(`${e}:${n.visible}`);return this.#Mt=t.hexdigest()}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0;var r=n(1),s=n(142);e.PDFDataTransportStream=class PDFDataTransportStream{constructor(t,e){let{length:n,initialData:s,progressiveDone:i=!1,contentDispositionFilename:a=null,disableRange:o=!1,disableStream:l=!1}=t;if((0,r.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=i,this._contentDispositionFilename=a,(null==s?void 0:s.length)>0){const t=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!l,this._isRangeSupported=!o,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})})),this._pdfDataRangeTransport.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})})),this._pdfDataRangeTransport.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})})),this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}_onReceiveData(t){let{begin:e,chunk:n}=t;const s=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(s):this._queuedChunks.push(s);else{const t=this._rangeReaders.some((function(t){return t._begin===e&&(t._enqueue(s),!0)}));(0,r.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t;return(null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)??0}_onProgress(t){var e,n,r,s;void 0===t.total?null===(e=this._rangeReaders[0])||void 0===e||null===(n=e.onProgress)||void 0===n||n.call(e,{loaded:t.loaded}):null===(r=this._fullRequestReader)||void 0===r||null===(s=r.onProgress)||void 0===s||s.call(r,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;null===(t=this._fullRequestReader)||void 0===t||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new PDFDataTransportStreamReader(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const n=new PDFDataTransportStreamRangeReader(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(n),n}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}};class PDFDataTransportStreamReader{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t,this._done=n||!1,this._filename=(0,s.isPdfFile)(r)?r:null,this._queuedChunks=e||[],this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=new r.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class PDFDataTransportStreamRangeReader{constructor(t,e,n){this._stream=t,this._begin=e,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=new r.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XfaText=void 0;class XfaText{static textContent(t){const e=[],n={items:e,styles:Object.create(null)};return function walk(t){var n;if(!t)return;let r=null;const s=t.name;if("#text"===s)r=t.value;else{if(!XfaText.shouldBuildText(s))return;null!=t&&null!==(n=t.attributes)&&void 0!==n&&n.textContent?r=t.attributes.textContent:t.value&&(r=t.value)}if(null!==r&&e.push({str:r}),t.children)for(const e of t.children)walk(e)}(t),n}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=XfaText},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeStandardFontDataFactory=e.NodeFilterFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;var r=n(143);const fetchData=function(t){return new Promise(((e,n)=>{require("fs").readFile(t,((t,r)=>{!t&&r?e(new Uint8Array(r)):n(new Error(t))}))}))};class NodeFilterFactory extends r.BaseFilterFactory{}e.NodeFilterFactory=NodeFilterFactory;class NodeCanvasFactory extends r.BaseCanvasFactory{_createCanvas(t,e){return require("canvas").createCanvas(t,e)}}e.NodeCanvasFactory=NodeCanvasFactory;class NodeCMapReaderFactory extends r.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t).then((t=>({cMapData:t,compressionType:e})))}}e.NodeCMapReaderFactory=NodeCMapReaderFactory;class NodeStandardFontDataFactory extends r.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t)}}e.NodeStandardFontDataFactory=NodeStandardFontDataFactory},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0;var r=n(1),s=n(157);const i=require("fs"),a=require("http"),o=require("https"),l=require("url"),c=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class PDFNodeStream{constructor(t){this.source=t,this.url=function parseUrl(t){const e=l.parse(t);return"file:"===e.protocol||e.host?e:/^[a-z]:[/\\]/i.test(t)?l.parse(`file:///${t}`):(e.host||(e.protocol="file:"),e)}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return(null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new PDFNodeStreamFsFullReader(this):new PDFNodeStreamFullReader(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const n=this.isFsUrl?new PDFNodeStreamFsRangeReader(this,t,e):new PDFNodeStreamRangeReader(this,t,e);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class BaseFullReader{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=new r.PromiseCapability,this._headersCapability=new r.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=new r.PromiseCapability,this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(e).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new r.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class BaseRangeReader{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new r.PromiseCapability;const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=new r.PromiseCapability,this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return{value:new Uint8Array(e).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function createRequestOptions(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class PDFNodeStreamFullReader extends BaseFullReader{constructor(t){super(t);const handleResponse=e=>{if(404===e.statusCode){const t=new r.MissingPDFException(`Missing PDF "${this._url}".`);return this._storedError=t,void this._headersCapability.reject(t)}this._headersCapability.resolve(),this._setReadableStream(e);const getResponseHeader=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:n,suggestedLength:i}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=i||this._contentLength,this._filename=(0,s.extractFilenameFromHeader)(getResponseHeader)};this._request=null,"http:"===this._url.protocol?this._request=a.request(createRequestOptions(this._url,t.httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,t.httpHeaders),handleResponse),this._request.on("error",(t=>{this._storedError=t,this._headersCapability.reject(t)})),this._request.end()}}class PDFNodeStreamRangeReader extends BaseRangeReader{constructor(t,e,n){super(t),this._httpHeaders={};for(const e in t.httpHeaders){const n=t.httpHeaders[e];void 0!==n&&(this._httpHeaders[e]=n)}this._httpHeaders.Range=`bytes=${e}-${n-1}`;const handleResponse=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t}};this._request=null,"http:"===this._url.protocol?this._request=a.request(createRequestOptions(this._url,this._httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,this._httpHeaders),handleResponse),this._request.on("error",(t=>{this._storedError=t})),this._request.end()}}class PDFNodeStreamFsFullReader extends BaseFullReader{constructor(t){super(t);let e=decodeURIComponent(this._url.path);c.test(this._url.href)&&(e=e.replace(/^\//,"")),i.lstat(e,((t,n)=>{if(t)return"ENOENT"===t.code&&(t=new r.MissingPDFException(`Missing PDF "${e}".`)),this._storedError=t,void this._headersCapability.reject(t);this._contentLength=n.size,this._setReadableStream(i.createReadStream(e)),this._headersCapability.resolve()}))}}class PDFNodeStreamFsRangeReader extends BaseRangeReader{constructor(t,e,n){super(t);let r=decodeURIComponent(this._url.path);c.test(this._url.href)&&(r=r.replace(/^\//,"")),this._setReadableStream(i.createReadStream(r,{start:e,end:n-1}))}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=function createResponseStatusError(t,e){if(404===t||0===t&&e.startsWith("file:"))return new r.MissingPDFException('Missing PDF "'+e+'".');return new r.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)},e.extractFilenameFromHeader=function extractFilenameFromHeader(t){const e=t("Content-Disposition");if(e){let t=(0,s.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(t){}if((0,i.isPdfFile)(t))return t}return null},e.validateRangeRequestCapabilities=function validateRangeRequestCapabilities(t){let{getResponseHeader:e,isHttp:n,rangeChunkSize:r,disableRange:s}=t;const i={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e("Content-Length"),10);if(!Number.isInteger(a))return i;if(i.suggestedLength=a,a<=2*r)return i;if(s||!n)return i;if("bytes"!==e("Accept-Ranges"))return i;if("identity"!==(e("Content-Encoding")||"identity"))return i;return i.allowRangeRequests=!0,i},e.validateResponseStatus=function validateResponseStatus(t){return 200===t||206===t};var r=n(1),s=n(158),i=n(142)},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=function getFilenameFromContentDispositionHeader(t){let e=!0,n=toParamRegExp("filename\\*","i").exec(t);if(n){n=n[1];let t=rfc2616unquote(n);return t=unescape(t),t=rfc5987decode(t),t=rfc2047decode(t),fixupEncoding(t)}if(n=function rfc2231getparam(t){const e=[];let n;const r=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=r.exec(t));){let[,t,r,s]=n;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[r,s]}const s=[];for(let t=0;t<e.length&&t in e;++t){let[n,r]=e[t];r=rfc2616unquote(r),n&&(r=unescape(r),0===t&&(r=rfc5987decode(r))),s.push(r)}return s.join("")}(t),n){return fixupEncoding(rfc2047decode(n))}if(n=toParamRegExp("filename","i").exec(t),n){n=n[1];let t=rfc2616unquote(n);return t=rfc2047decode(t),fixupEncoding(t)}function toParamRegExp(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function textdecode(t,n){if(t){if(!/^[\x00-\xFF]+$/.test(n))return n;try{const s=new TextDecoder(t,{fatal:!0}),i=(0,r.stringToBytes)(n);n=s.decode(i),e=!1}catch(t){}}return n}function fixupEncoding(t){return e&&/[\x80-\xff]/.test(t)&&(t=textdecode("utf-8",t),e&&(t=textdecode("iso-8859-1",t))),t}function rfc2616unquote(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const n=e[t].indexOf('"');-1!==n&&(e[t]=e[t].slice(0,n),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function rfc5987decode(t){const e=t.indexOf("'");if(-1===e)return t;return textdecode(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function rfc2047decode(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,n,r){if("q"===n||"Q"===n)return textdecode(e,r=(r=r.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})));try{r=atob(r)}catch(t){}return textdecode(e,r)}))}return""};var r=n(1)},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0;var r=n(1),s=n(157);class NetworkManager{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,n){const r={begin:t,end:e};for(const t in n)r[t]=n[t];return this.request(r)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,n=this.currXhrId++,r=this.pendingRequests[n]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const t in this.httpHeaders){const n=this.httpHeaders[t];void 0!==n&&e.setRequestHeader(t,n)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),r.expectedStatus=206):r.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(n){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,n),e.onprogress=this.onProgress.bind(this,n),r.onHeadersReceived=t.onHeadersReceived,r.onDone=t.onDone,r.onError=t.onError,r.onProgress=t.onProgress,e.send(null),n}onProgress(t,e){var n;const r=this.pendingRequests[t];r&&(null===(n=r.onProgress)||void 0===n||n.call(r,e))}onStateChange(t,e){const n=this.pendingRequests[t];if(!n)return;const s=n.xhr;if(s.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==s.readyState)return;if(!(t in this.pendingRequests))return;var i;if(delete this.pendingRequests[t],0===s.status&&this.isHttp)return void(null===(i=n.onError)||void 0===i||i.call(n,s.status));const a=s.status||200;var o;if(!(200===a&&206===n.expectedStatus)&&a!==n.expectedStatus)return void(null===(o=n.onError)||void 0===o||o.call(n,s.status));const l=function getArrayBuffer(t){const e=t.response;return"string"!=typeof e?e:(0,r.stringToBytes)(e).buffer}(s);if(206===a){const t=s.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);n.onDone({begin:parseInt(e[1],10),chunk:l})}else if(l)n.onDone({begin:0,chunk:l});else{var c;null===(c=n.onError)||void 0===c||c.call(n,s.status)}}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}e.PDFNetworkStream=class PDFNetworkStream{constructor(t){this._source=t,this._manager=new NetworkManager(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new PDFNetworkStreamFullRequestReader(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const n=new PDFNetworkStreamRangeRequestReader(this._manager,t,e);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFNetworkStreamFullRequestReader{constructor(t,e){this._manager=t;const n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(n),this._headersReceivedCapability=new r.PromiseCapability,this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),getResponseHeader=t=>e.getResponseHeader(t),{allowRangeRequests:n,suggestedLength:r}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=r||this._contentLength,this._filename=(0,s.extractFilenameFromHeader)(getResponseHeader),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);if(this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=(0,s.createResponseStatusError)(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=new r.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class PDFNetworkStreamRangeRequestReader{constructor(t,e,n){this._manager=t;const r={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,n,r),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=(0,s.createResponseStatusError)(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||(null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:t.loaded}))}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=new r.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0;var r=n(1),s=n(157);function createFetchOptions(t,e,n){return{method:"GET",headers:t,signal:n.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function createHeaders(t){const e=new Headers;for(const n in t){const r=t[n];void 0!==r&&e.append(n,r)}return e}function getArrayBuffer(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:((0,r.warn)(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}e.PDFFetchStream=class PDFFetchStream{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return(null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new PDFFetchStreamReader(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const n=new PDFFetchStreamRangeReader(this,t,e);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFFetchStreamReader{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=new r.PromiseCapability,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._headers=createHeaders(this._stream.httpHeaders);const n=e.url;fetch(n,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,s.validateResponseStatus)(t.status))throw(0,s.createResponseStatusError)(t.status,n);this._reader=t.body.getReader(),this._headersCapability.resolve();const getResponseHeader=e=>t.headers.get(e),{allowRangeRequests:e,suggestedLength:i}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=e,this._contentLength=i||this._contentLength,this._filename=(0,s.extractFilenameFromHeader)(getResponseHeader),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new r.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._headersCapability.promise;const{value:e,done:n}=await this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:getArrayBuffer(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class PDFFetchStreamRangeReader{constructor(t,e,n){this._stream=t,this._reader=null,this._loaded=0;const i=t.source;this._withCredentials=i.withCredentials||!1,this._readCapability=new r.PromiseCapability,this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController,this._headers=createHeaders(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-${n-1}`);const a=i.url;fetch(a,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,s.validateResponseStatus)(t.status))throw(0,s.createResponseStatusError)(t.status,a);this._readCapability.resolve(),this._reader=t.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;const{value:e,done:n}=await this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded}),{value:getArrayBuffer(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextLayerRenderTask=void 0,e.renderTextLayer=function renderTextLayer(t){t.textContentSource||!t.textContent&&!t.textContentStream||((0,s.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),t.textContentSource=t.textContent||t.textContentStream);const{container:e,viewport:n}=t,r=getComputedStyle(e),i=r.getPropertyValue("visibility"),a=parseFloat(r.getPropertyValue("--scale-factor"));"visible"===i&&(!a||Math.abs(a-n.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const o=new TextLayerRenderTask(t);return o._render(),o},e.updateTextLayer=function updateTextLayer(t){let{container:e,viewport:n,textDivs:r,textDivProperties:i,isOffscreenCanvasSupported:a,mustRotate:o=!0,mustRescale:l=!0}=t;o&&(0,s.setLayerDimensions)(e,{rotation:n.rotation});if(l){const t=getCtx(0,a),e={prevFontSize:null,prevFontFamily:null,div:null,scale:n.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t};for(const t of r)e.properties=i.get(t),e.div=t,layout(e)}};var r=n(1),s=n(142);const i=30,a=.8,o=new Map;function getCtx(t,e){let n;if(e&&r.FeatureTest.isOffscreenCanvasSupported)n=new OffscreenCanvas(t,t).getContext("2d",{alpha:!1,willReadFrequently:!0===pdfjsLib.canvasWillReadFrequently});else{const e=document.createElement("canvas");e.width=e.height=t,n=e.getContext("2d",{alpha:!1,willReadFrequently:!0===pdfjsLib.canvasWillReadFrequently})}return n}function appendText(t,e,n){const s=document.createElement("span"),l={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(s);const c=r.Util.transform(t._transform,e.transform);let d=Math.atan2(c[1],c[0]);const h=n[e.fontName];h.vertical&&(d+=Math.PI/2);const u=Math.hypot(c[2],c[3]),p=u*function getAscent(t,e){const n=o.get(t);if(n)return n;const r=getCtx(i,e);r.font=`${i}px ${t}`;const s=r.measureText("");let l=s.fontBoundingBoxAscent,c=Math.abs(s.fontBoundingBoxDescent);if(l){const e=l/(l+c);return o.set(t,e),r.canvas.width=r.canvas.height=0,e}r.strokeStyle="red",r.clearRect(0,0,i,i),r.strokeText("g",0,0);let d=r.getImageData(0,0,i,i).data;c=0;for(let t=d.length-1-3;t>=0;t-=4)if(d[t]>0){c=Math.ceil(t/4/i);break}r.clearRect(0,0,i,i),r.strokeText("A",0,i),d=r.getImageData(0,0,i,i).data,l=0;for(let t=0,e=d.length;t<e;t+=4)if(d[t]>0){l=i-Math.floor(t/4/i);break}if(r.canvas.width=r.canvas.height=0,l){const e=l/(l+c);return o.set(t,e),e}return o.set(t,a),a}(h.fontFamily,t._isOffscreenCanvasSupported);let f,g;0===d?(f=c[4],g=c[5]-p):(f=c[4]+p*Math.sin(d),g=c[5]-p*Math.cos(d));const m="calc(var(--scale-factor)*",v=s.style;t._container===t._rootContainer?(v.left=`${(100*f/t._pageWidth).toFixed(2)}%`,v.top=`${(100*g/t._pageHeight).toFixed(2)}%`):(v.left=`${m}${f.toFixed(2)}px)`,v.top=`${m}${g.toFixed(2)}px)`),v.fontSize=`${m}${u.toFixed(2)}px)`,v.fontFamily=h.fontFamily,l.fontSize=u,s.setAttribute("role","presentation"),s.textContent=e.str,s.dir=e.dir,t._fontInspectorEnabled&&(s.dataset.fontName=e.fontName),0!==d&&(l.angle=d*(180/Math.PI));let b=!1;if(e.str.length>1)b=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),n=Math.abs(e.transform[3]);t!==n&&Math.max(t,n)/Math.min(t,n)>1.5&&(b=!0)}b&&(l.canvasWidth=h.vertical?e.height:e.width),t._textDivProperties.set(s,l),t._isReadableStream&&t._layoutText(s)}function layout(t){const{div:e,scale:n,properties:r,ctx:s,prevFontSize:i,prevFontFamily:a}=t,{style:o}=e;let l="";if(0!==r.canvasWidth&&r.hasText){const{fontFamily:c}=o,{canvasWidth:d,fontSize:h}=r;i===h&&a===c||(s.font=`${h*n}px ${c}`,t.prevFontSize=h,t.prevFontFamily=c);const{width:u}=s.measureText(e.textContent);u>0&&(l=`scaleX(${d*n/u})`)}0!==r.angle&&(l=`rotate(${r.angle}deg) ${l}`),l.length>0&&(o.transform=l)}class TextLayerRenderTask{constructor(t){var e;let{textContentSource:n,container:i,viewport:a,textDivs:o,textDivProperties:l,textContentItemsStr:c,isOffscreenCanvasSupported:d}=t;this._textContentSource=n,this._isReadableStream=n instanceof ReadableStream,this._container=this._rootContainer=i,this._textDivs=o||[],this._textContentItemsStr=c||[],this._isOffscreenCanvasSupported=d,this._fontInspectorEnabled=!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled),this._reader=null,this._textDivProperties=l||new WeakMap,this._canceled=!1,this._capability=new r.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:a.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:getCtx(0,d)};const{pageWidth:h,pageHeight:u,pageX:p,pageY:f}=a.rawDims;this._transform=[1,0,0,-1,-p,f+u],this._pageWidth=h,this._pageHeight=u,(0,s.setLayerDimensions)(i,a),this._capability.promise.finally((()=>{this._layoutTextParams=null})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new r.AbortException("TextLayer task cancelled.")).catch((()=>{})),this._reader=null),this._capability.reject(new r.AbortException("TextLayer task cancelled."))}_processItems(t,e){for(const n of t)if(void 0!==n.str)this._textContentItemsStr.push(n.str),appendText(this,n,e);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const t=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==n.id&&this._container.setAttribute("id",`${n.id}`),t.append(this._container)}else"endMarkedContent"===n.type&&(this._container=this._container.parentNode)}_layoutText(t){const e=this._layoutTextParams.properties=this._textDivProperties.get(t);if(this._layoutTextParams.div=t,layout(this._layoutTextParams),e.hasText&&this._container.append(t),e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),this._container.append(t)}}_render(){const t=new r.PromiseCapability;let e=Object.create(null);if(this._isReadableStream){const pump=()=>{this._reader.read().then((n=>{let{value:r,done:s}=n;s?t.resolve():(Object.assign(e,r.styles),this._processItems(r.items,e),pump())}),t.reject)};this._reader=this._textContentSource.getReader(),pump()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:e,styles:n}=this._textContentSource;this._processItems(e,n),t.resolve()}}t.promise.then((()=>{e=null,function render(t){if(t._canceled)return;const e=t._textDivs,n=t._capability;if(e.length>1e5)n.resolve();else{if(!t._isReadableStream)for(const n of e)t._layoutText(n);n.resolve()}}(this)}),this._capability.reject)}}e.TextLayerRenderTask=TextLayerRenderTask},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditorLayer=void 0;var r=n(1),s=n(141),i=n(163),a=n(164),o=n(142);class AnnotationEditorLayer{#Lt;#Nt=!1;#jt=this.pointerup.bind(this);#Bt=this.pointerdown.bind(this);#Ut=new Map;#Wt=!1;#qt=!1;#Gt;static _initialized=!1;constructor(t){AnnotationEditorLayer._initialized||(AnnotationEditorLayer._initialized=!0,i.FreeTextEditor.initialize(t.l10n),a.InkEditor.initialize(t.l10n)),t.uiManager.registerEditorTypes([i.FreeTextEditor,a.InkEditor]),this.#Gt=t.uiManager,this.pageIndex=t.pageIndex,this.div=t.div,this.#Lt=t.accessibilityManager,this.#Gt.addLayer(this)}get isEmpty(){return 0===this.#Ut.size}updateToolbar(t){this.#Gt.updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.#Gt.getMode();this.#Ht(),t===r.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),this.#Gt.unselectAll(),t!==r.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",t===r.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",t===r.AnnotationEditorType.INK),this.div.hidden=!1)}addInkEditorIfNeeded(t){if(!t&&this.#Gt.getMode()!==r.AnnotationEditorType.INK)return;if(!t)for(const t of this.#Ut.values())if(t.isEmpty())return void t.setInBackground();this.#zt({offsetX:0,offsetY:0}).setInBackground()}setEditingState(t){this.#Gt.setEditingState(t)}addCommands(t){this.#Gt.addCommands(t)}enable(){this.div.style.pointerEvents="auto";for(const t of this.#Ut.values())t.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const t of this.#Ut.values())t.disableEditing();this.#Ht(),this.isEmpty&&(this.div.hidden=!0)}setActiveEditor(t){this.#Gt.getActive()!==t&&this.#Gt.setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",this.#Bt),this.div.addEventListener("pointerup",this.#jt)}disableClick(){this.div.removeEventListener("pointerdown",this.#Bt),this.div.removeEventListener("pointerup",this.#jt)}attach(t){this.#Ut.set(t.id,t)}detach(t){var e;this.#Ut.delete(t.id),null===(e=this.#Lt)||void 0===e||e.removePointerInTextLayer(t.contentDiv)}remove(t){this.#Gt.removeEditor(t),this.detach(t),t.div.style.display="none",setTimeout((()=>{t.div.style.display="",t.div.remove(),t.isAttachedToDOM=!1,document.activeElement===document.body&&this.#Gt.focusMainContainer()}),0),this.#qt||this.addInkEditorIfNeeded(!1)}#Vt(t){var e;t.parent!==this&&(this.attach(t),null===(e=t.parent)||void 0===e||e.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(this.#Vt(t),this.#Gt.addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}this.moveEditorInDOM(t),t.onceAdded(),this.#Gt.addToAnnotationStorage(t)}moveEditorInDOM(t){var e;null===(e=this.#Lt)||void 0===e||e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addANewEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!0})}addUndoableEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#Gt.getId()}#Xt(t){switch(this.#Gt.getMode()){case r.AnnotationEditorType.FREETEXT:return new i.FreeTextEditor(t);case r.AnnotationEditorType.INK:return new a.InkEditor(t)}return null}deserialize(t){switch(t.annotationType){case r.AnnotationEditorType.FREETEXT:return i.FreeTextEditor.deserialize(t,this,this.#Gt);case r.AnnotationEditorType.INK:return a.InkEditor.deserialize(t,this,this.#Gt)}return null}#zt(t){const e=this.getNextId(),n=this.#Xt({parent:this,id:e,x:t.offsetX,y:t.offsetY,uiManager:this.#Gt});return n&&this.add(n),n}setSelected(t){this.#Gt.setSelected(t)}toggleSelected(t){this.#Gt.toggleSelected(t)}isSelected(t){return this.#Gt.isSelected(t)}unselect(t){this.#Gt.unselect(t)}pointerup(t){const{isMac:e}=r.FeatureTest.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&this.#Wt&&(this.#Wt=!1,this.#Nt?this.#zt(t):this.#Nt=!0)}pointerdown(t){const{isMac:e}=r.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;this.#Wt=!0;const n=this.#Gt.getActive();this.#Nt=!n||n.isEmpty()}drop(t){const e=t.dataTransfer.getData("text/plain"),n=this.#Gt.getEditor(e);if(!n)return;t.preventDefault(),t.dataTransfer.dropEffect="move",this.#Vt(n);const r=this.div.getBoundingClientRect(),s=t.clientX-r.x,i=t.clientY-r.y;n.translate(s-n.startX,i-n.startY),this.moveEditorInDOM(n),n.div.focus()}dragover(t){t.preventDefault()}destroy(){var t;(null===(t=this.#Gt.getActive())||void 0===t?void 0:t.parent)===this&&this.#Gt.setActiveEditor(null);for(const t of this.#Ut.values()){var e;null===(e=this.#Lt)||void 0===e||e.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove()}this.div=null,this.#Ut.clear(),this.#Gt.removeLayer(this)}#Ht(){this.#qt=!0;for(const t of this.#Ut.values())t.isEmpty()&&t.remove();this.#qt=!1}render(t){let{viewport:e}=t;this.viewport=e,(0,o.setLayerDimensions)(this.div,e),(0,s.bindEvents)(this,this.div,["dragover","drop"]);for(const t of this.#Gt.getEditors(this.pageIndex))this.add(t);this.updateMode()}update(t){let{viewport:e}=t;this.#Gt.commitOrRemove(),this.viewport=e,(0,o.setLayerDimensions)(this.div,{rotation:e.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}}e.AnnotationEditorLayer=AnnotationEditorLayer},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FreeTextEditor=void 0;var r=n(1),s=n(141),i=n(140);class FreeTextEditor extends i.AnnotationEditor{#$t=this.editorDivBlur.bind(this);#Yt=this.editorDivFocus.bind(this);#Kt=this.editorDivInput.bind(this);#Jt=this.editorDivKeydown.bind(this);#Qt;#Zt="";#te=`${this.id}-editor`;#ee=!1;#ne;static _freeTextDefaultContent="";static _l10nPromise;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static _keyboardManager=new s.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],FreeTextEditor.prototype.commitOrRemove]]);static _type="freetext";constructor(t){super({...t,name:"freeTextEditor"}),this.#Qt=t.color||FreeTextEditor._defaultColor||i.AnnotationEditor._defaultLineColor,this.#ne=t.fontSize||FreeTextEditor._defaultFontSize}static initialize(t){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map((e=>[e,t.get(e)])));const e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case r.AnnotationEditorParamsType.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=e;break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:FreeTextEditor._defaultColor=e}}updateParams(t,e){switch(t){case r.AnnotationEditorParamsType.FREETEXT_SIZE:this.#re(e);break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:this.#se(e)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[r.AnnotationEditorParamsType.FREETEXT_COLOR,FreeTextEditor._defaultColor||i.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,this.#ne],[r.AnnotationEditorParamsType.FREETEXT_COLOR,this.#Qt]]}#re(t){const setFontsize=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-this.#ne)*this.parentScale),this.#ne=t,this.#ie()},e=this.#ne;this.addCommands({cmd:()=>{setFontsize(t)},undo:()=>{setFontsize(e)},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#se(t){const e=this.#Qt;this.addCommands({cmd:()=>{this.#Qt=this.editorDiv.style.color=t},undo:()=>{this.#Qt=this.editorDiv.style.color=e},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}getInitialTranslation(){const t=this.parentScale;return[-FreeTextEditor._internalPadding*t,-(FreeTextEditor._internalPadding+this.#ne)*t]}rebuild(){super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(r.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#Jt),this.editorDiv.addEventListener("focus",this.#Yt),this.editorDiv.addEventListener("blur",this.#$t),this.editorDiv.addEventListener("input",this.#Kt))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#te),this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",this.#Jt),this.editorDiv.removeEventListener("focus",this.#Yt),this.editorDiv.removeEventListener("blur",this.#$t),this.editorDiv.removeEventListener("input",this.#Kt),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(t){super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus())}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing"),super.remove()}#ae(){const t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;const e=[];for(const n of t)e.push(n.innerText.replace(/\r\n?|\n/,""));return e.join("\n")}#ie(){const[t,e]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,r=e.style.display;e.style.display="hidden",t.div.append(this.div),n=e.getBoundingClientRect(),e.remove(),e.style.display=r}this.width=n.width/t,this.height=n.height/e}commit(){this.isInEditMode()&&(super.commit(),this.#ee||(this.#ee=!0,this.parent.addUndoableEditor(this)),this.disableEditMode(),this.#Zt=this.#ae().trimEnd(),this.#ie())}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(t){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(t){FreeTextEditor._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#te),this.enableEditing(),FreeTextEditor._l10nPromise.get("editor_free_text2_aria_label").then((t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("aria-label",t)})),FreeTextEditor._l10nPromise.get("free_text2_default_content").then((t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("default-content",t)})),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#ne}px * var(--scale-factor))`,n.color=this.#Qt,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,s.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[n,r]=this.parentDimensions;this.setAt(t*n,e*r,this.width*n,this.height*r);for(const t of this.#Zt.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(t,e,n){const s=super.deserialize(t,e,n);return s.#ne=t.fontSize,s.#Qt=r.Util.makeHexColor(...t.color),s.#Zt=t.value,s}serialize(){if(this.isEmpty())return null;const t=FreeTextEditor._internalPadding*this.parentScale,e=this.getRect(t,t),n=i.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#Qt);return{annotationType:r.AnnotationEditorType.FREETEXT,color:n,fontSize:this.#ne,value:this.#Zt,pageIndex:this.pageIndex,rect:e,rotation:this.rotation}}}e.FreeTextEditor=FreeTextEditor},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InkEditor=void 0;var r=n(1),s=n(140),i=n(141);const a=16;class InkEditor extends s.AnnotationEditor{#oe=0;#le=0;#ce=0;#de=this.canvasContextMenu.bind(this);#he=this.canvasPointermove.bind(this);#ue=this.canvasPointerleave.bind(this);#pe=this.canvasPointerup.bind(this);#fe=this.canvasPointerdown.bind(this);#ge=new Path2D;#me=!1;#ve=!1;#be=!1;#ye=null;#Ae=0;#_e=0;#Se=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _l10nPromise;static _type="ink";constructor(t){super({...t,name:"inkEditor"}),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(t){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map((e=>[e,t.get(e)])))}static updateDefaultParams(t,e){switch(t){case r.AnnotationEditorParamsType.INK_THICKNESS:InkEditor._defaultThickness=e;break;case r.AnnotationEditorParamsType.INK_COLOR:InkEditor._defaultColor=e;break;case r.AnnotationEditorParamsType.INK_OPACITY:InkEditor._defaultOpacity=e/100}}updateParams(t,e){switch(t){case r.AnnotationEditorParamsType.INK_THICKNESS:this.#xe(e);break;case r.AnnotationEditorParamsType.INK_COLOR:this.#se(e);break;case r.AnnotationEditorParamsType.INK_OPACITY:this.#Ee(e)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,InkEditor._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,InkEditor._defaultColor||s.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*InkEditor._defaultOpacity)]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||InkEditor._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,this.color||InkEditor._defaultColor||s.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??InkEditor._defaultOpacity))]]}#xe(t){const e=this.thickness;this.addCommands({cmd:()=>{this.thickness=t,this.#Ce()},undo:()=>{this.thickness=e,this.#Ce()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#se(t){const e=this.color;this.addCommands({cmd:()=>{this.color=t,this.#we()},undo:()=>{this.color=e,this.#we()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#Ee(t){t/=100;const e=this.opacity;this.addCommands({cmd:()=>{this.opacity=t,this.#we()},undo:()=>{this.opacity=e,this.#we()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){super.rebuild(),null!==this.div&&(this.canvas||(this.#Pe(),this.#Te()),this.isAttachedToDOM||(this.parent.add(this),this.#ke()),this.#Ce())}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#ye.disconnect(),this.#ye=null,super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,n=this.width*t,r=this.height*e;this.setDimensions(n,r)}enableEditMode(){this.#me||null===this.canvas||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",this.#fe))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#fe))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#Fe(){const{parentRotation:t,parentDimensions:[e,n]}=this;switch(t){case 90:return[0,n,n,e];case 180:return[e,n,e,n];case 270:return[e,0,n,e];default:return[0,0,e,n]}}#Me(){const{ctx:t,color:e,opacity:n,thickness:r,parentScale:s,scaleFactor:a}=this;t.lineWidth=r*s/a,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${e}${(0,i.opacityToHex)(n)}`}#Re(t,e){this.canvas.addEventListener("contextmenu",this.#de),this.canvas.addEventListener("pointerleave",this.#ue),this.canvas.addEventListener("pointermove",this.#he),this.canvas.addEventListener("pointerup",this.#pe),this.canvas.removeEventListener("pointerdown",this.#fe),this.isEditing=!0,this.#be||(this.#be=!0,this.#ke(),this.thickness||=InkEditor._defaultThickness,this.color||=InkEditor._defaultColor||s.AnnotationEditor._defaultLineColor,this.opacity??=InkEditor._defaultOpacity),this.currentPath.push([t,e]),this.#ve=!1,this.#Me(),this.#Se=()=>{this.#De(),this.#Se&&window.requestAnimationFrame(this.#Se)},window.requestAnimationFrame(this.#Se)}#Ie(t,e){const[n,r]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===n&&e===r)return;const s=this.currentPath;let i=this.#ge;if(s.push([t,e]),this.#ve=!0,s.length<=2)return i.moveTo(...s[0]),void i.lineTo(t,e);3===s.length&&(this.#ge=i=new Path2D,i.moveTo(...s[0])),this.#Oe(i,...s.at(-3),...s.at(-2),t,e)}#Le(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);this.#ge.lineTo(...t)}#Ne(t,e){let n;if(this.#Se=null,t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),this.#Ie(t,e),this.#Le(),1!==this.currentPath.length)n=this.#je();else{const r=[t,e];n=[[r,r.slice(),r.slice(),r]]}const r=this.#ge,s=this.currentPath;this.currentPath=[],this.#ge=new Path2D;this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(n),this.bezierPath2D.push(r),this.rebuild()},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#Pe(),this.#Te()),this.#Ce())},mustExec:!0})}#De(){if(!this.#ve)return;this.#ve=!1;const t=Math.ceil(this.thickness*this.parentScale),e=this.currentPath.slice(-3),n=e.map((t=>t[0])),r=e.map((t=>t[1])),{ctx:s}=(Math.min(...n),Math.max(...n),Math.min(...r),Math.max(...r),this);s.save(),s.clearRect(0,0,this.canvas.width,this.canvas.height);for(const t of this.bezierPath2D)s.stroke(t);s.stroke(this.#ge),s.restore()}#Oe(t,e,n,r,s,i,a){const o=(e+r)/2,l=(n+s)/2,c=(r+i)/2,d=(s+a)/2;t.bezierCurveTo(o+2*(r-o)/3,l+2*(s-l)/3,c+2*(r-c)/3,d+2*(s-d)/3,c,d)}#je(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let n,[r,s]=t[0];for(n=1;n<t.length-2;n++){const[i,a]=t[n],[o,l]=t[n+1],c=(i+o)/2,d=(a+l)/2,h=[r+2*(i-r)/3,s+2*(a-s)/3],u=[c+2*(i-c)/3,d+2*(a-d)/3];e.push([[r,s],h,u,[c,d]]),[r,s]=[c,d]}const[i,a]=t[n],[o,l]=t[n+1],c=[r+2*(i-r)/3,s+2*(a-s)/3],d=[o+2*(i-o)/3,l+2*(a-l)/3];return e.push([[r,s],c,d,[o,l]]),e}#we(){if(this.isEmpty())return void this.#Be();this.#Me();const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),this.#Be();for(const t of this.bezierPath2D)e.stroke(t)}commit(){this.#me||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#me=!0,this.div.classList.add("disabled"),this.#Ce(!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus({preventScroll:!0}))}focusin(t){super.focusin(t),this.enableEditMode()}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!this.#me&&(this.setInForeground(),t.preventDefault(),"mouse"!==t.type&&this.div.focus(),this.#Re(t.offsetX,t.offsetY))}canvasContextMenu(t){t.preventDefault()}canvasPointermove(t){t.preventDefault(),this.#Ie(t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),this.#Ue(t)}canvasPointerleave(t){this.#Ue(t)}#Ue(t){this.canvas.removeEventListener("pointerleave",this.#ue),this.canvas.removeEventListener("pointermove",this.#he),this.canvas.removeEventListener("pointerup",this.#pe),this.canvas.addEventListener("pointerdown",this.#fe),setTimeout((()=>{this.canvas.removeEventListener("contextmenu",this.#de)}),10),this.#Ne(t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#Pe(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",InkEditor._l10nPromise.get("editor_ink_canvas_aria_label").then((t=>{var e;return null===(e=this.canvas)||void 0===e?void 0:e.setAttribute("aria-label",t)})),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d",{willReadFrequently:!0===pdfjsLib.canvasWillReadFrequently})}#Te(){this.#ye=new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)})),this.#ye.observe(this.div)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),InkEditor._l10nPromise.get("editor_ink2_aria_label").then((t=>{var e;return null===(e=this.div)||void 0===e?void 0:e.setAttribute("aria-label",t)}));const[n,r,s,i]=this.#Fe();if(this.setAt(n,r,0,0),this.setDims(s,i),this.#Pe(),this.width){const[n,r]=this.parentDimensions;this.setAt(t*n,e*r,this.width*n,this.height*r),this.#be=!0,this.#ke(),this.setDims(this.width*n,this.height*r),this.#we(),this.#We(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#Te(),this.div}#ke(){if(!this.#be)return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),this.#Be()}setDimensions(t,e){const n=Math.round(t),r=Math.round(e);if(this.#Ae===n&&this.#_e===r)return;this.#Ae=n,this.#_e=r,this.canvas.style.visibility="hidden",this.#oe&&Math.abs(this.#oe-t/e)>.01&&(e=Math.ceil(t/this.#oe),this.setDims(t,e));const[s,i]=this.parentDimensions;this.width=t/s,this.height=e/i,this.#me&&this.#qe(t,e),this.#ke(),this.#we(),this.canvas.style.visibility="visible",this.fixDims()}#qe(t,e){const n=this.#Ge(),r=(t-n)/this.#ce,s=(e-n)/this.#le;this.scaleFactor=Math.min(r,s)}#Be(){const t=this.#Ge()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static#He(t){const e=new Path2D;for(let n=0,r=t.length;n<r;n++){const[r,s,i,a]=t[n];0===n&&e.moveTo(...r),e.bezierCurveTo(s[0],s[1],i[0],i[1],a[0],a[1])}return e}#ze(t,e,n,r){const s=[],i=this.thickness/2;let a,o;for(const l of this.paths){a=[],o=[];for(let s=0,c=l.length;s<c;s++){const[c,d,h,u]=l[s],p=t*(c[0]+e)+i,f=r-t*(c[1]+n)-i,g=t*(d[0]+e)+i,m=r-t*(d[1]+n)-i,v=t*(h[0]+e)+i,b=r-t*(h[1]+n)-i,y=t*(u[0]+e)+i,A=r-t*(u[1]+n)-i;0===s&&(a.push(p,f),o.push(p,f)),a.push(g,m,v,b,y,A),this.#Ve(p,f,g,m,v,b,y,A,4,o)}s.push({bezier:a,points:o})}return s}#Ve(t,e,n,r,s,i,a,o,l,c){if(this.#Xe(t,e,n,r,s,i,a,o))c.push(a,o);else{for(let d=1;d<l-1;d++){const h=d/l,u=1-h;let p=h*t+u*n,f=h*e+u*r,g=h*n+u*s,m=h*r+u*i;p=h*p+u*g,f=h*f+u*m,g=h*g+u*(h*s+u*a),m=h*m+u*(h*i+u*o),p=h*p+u*g,f=h*f+u*m,c.push(p,f)}c.push(a,o)}}#Xe(t,e,n,r,s,i,a,o){const l=(3*n-2*t-a)**2,c=(3*r-2*e-o)**2,d=(3*s-t-2*a)**2,h=(3*i-e-2*o)**2;return Math.max(l,d)+Math.max(c,h)<=10}#$e(){let t=1/0,e=-1/0,n=1/0,s=-1/0;for(const i of this.paths)for(const[a,o,l,c]of i){const i=r.Util.bezierBoundingBox(...a,...o,...l,...c);t=Math.min(t,i[0]),n=Math.min(n,i[1]),e=Math.max(e,i[2]),s=Math.max(s,i[3])}return[t,n,e,s]}#Ge(){return this.#me?Math.ceil(this.thickness*this.parentScale):0}#Ce(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!this.#me)return void this.#we();const e=this.#$e(),n=this.#Ge();this.#ce=Math.max(a,e[2]-e[0]),this.#le=Math.max(a,e[3]-e[1]);const r=Math.ceil(n+this.#ce*this.scaleFactor),s=Math.ceil(n+this.#le*this.scaleFactor),[i,o]=this.parentDimensions;this.width=r/i,this.height=s/o,this.#oe=r/s,this.#We();const l=this.translationX,c=this.translationY;this.translationX=-e[0],this.translationY=-e[1],this.#ke(),this.#we(),this.#Ae=r,this.#_e=s,this.setDims(r,s);const d=t?n/this.scaleFactor/2:0;this.translate(l-this.translationX-d,c-this.translationY-d)}#We(){const{style:t}=this.div;this.#oe>=1?(t.minHeight="16px",t.minWidth=`${Math.round(this.#oe*a)}px`):(t.minWidth="16px",t.minHeight=`${Math.round(a/this.#oe)}px`)}static deserialize(t,e,n){const s=super.deserialize(t,e,n);s.thickness=t.thickness,s.color=r.Util.makeHexColor(...t.color),s.opacity=t.opacity;const[i,o]=s.pageDimensions,l=s.width*i,c=s.height*o,d=s.parentScale,h=t.thickness/2;s.#oe=l/c,s.#me=!0,s.#Ae=Math.round(l),s.#_e=Math.round(c);for(const{bezier:e}of t.paths){const t=[];s.paths.push(t);let n=d*(e[0]-h),r=d*(c-e[1]-h);for(let s=2,i=e.length;s<i;s+=6){const i=d*(e[s]-h),a=d*(c-e[s+1]-h),o=d*(e[s+2]-h),l=d*(c-e[s+3]-h),u=d*(e[s+4]-h),p=d*(c-e[s+5]-h);t.push([[n,r],[i,a],[o,l],[u,p]]),n=u,r=p}const i=this.#He(t);s.bezierPath2D.push(i)}const u=s.#$e();return s.#ce=Math.max(a,u[2]-u[0]),s.#le=Math.max(a,u[3]-u[1]),s.#qe(l,c),s}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=this.rotation%180==0?t[3]-t[1]:t[2]-t[0],n=s.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:r.AnnotationEditorType.INK,color:n,thickness:this.thickness,opacity:this.opacity,paths:this.#ze(this.scaleFactor/this.parentScale,this.translationX,this.translationY,e),pageIndex:this.pageIndex,rect:t,rotation:this.rotation}}}e.InkEditor=InkEditor},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationLayer=void 0;var r=n(1),s=n(142),i=n(139),a=n(166),o=n(167);const l=1e3,c=new WeakSet;function getRectDims(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class AnnotationElementFactory{static create(t){switch(t.data.annotationType){case r.AnnotationType.LINK:return new LinkAnnotationElement(t);case r.AnnotationType.TEXT:return new TextAnnotationElement(t);case r.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new TextWidgetAnnotationElement(t);case"Btn":return t.data.radioButton?new RadioButtonWidgetAnnotationElement(t):t.data.checkBox?new CheckboxWidgetAnnotationElement(t):new PushButtonWidgetAnnotationElement(t);case"Ch":return new ChoiceWidgetAnnotationElement(t)}return new WidgetAnnotationElement(t);case r.AnnotationType.POPUP:return new PopupAnnotationElement(t);case r.AnnotationType.FREETEXT:return new FreeTextAnnotationElement(t);case r.AnnotationType.LINE:return new LineAnnotationElement(t);case r.AnnotationType.SQUARE:return new SquareAnnotationElement(t);case r.AnnotationType.CIRCLE:return new CircleAnnotationElement(t);case r.AnnotationType.POLYLINE:return new PolylineAnnotationElement(t);case r.AnnotationType.CARET:return new CaretAnnotationElement(t);case r.AnnotationType.INK:return new InkAnnotationElement(t);case r.AnnotationType.POLYGON:return new PolygonAnnotationElement(t);case r.AnnotationType.HIGHLIGHT:return new HighlightAnnotationElement(t);case r.AnnotationType.UNDERLINE:return new UnderlineAnnotationElement(t);case r.AnnotationType.SQUIGGLY:return new SquigglyAnnotationElement(t);case r.AnnotationType.STRIKEOUT:return new StrikeOutAnnotationElement(t);case r.AnnotationType.STAMP:return new StampAnnotationElement(t);case r.AnnotationType.FILEATTACHMENT:return new FileAttachmentAnnotationElement(t);default:return new AnnotationElement(t)}}}class AnnotationElement{constructor(t){let{isRenderable:e=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.page=t.page,this.viewport=t.viewport,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,e&&(this.container=this._createContainer(n)),r&&(this.quadrilaterals=this._createQuadrilaterals(n))}_createContainer(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{data:e,page:n,viewport:s}=this,i=document.createElement("section");i.setAttribute("data-annotation-id",e.id),e.noRotate&&i.classList.add("norotate");const{pageWidth:a,pageHeight:o,pageX:l,pageY:c}=s.rawDims,{width:d,height:h}=getRectDims(e.rect),u=r.Util.normalizeRect([e.rect[0],n.view[3]-e.rect[1]+n.view[1],e.rect[2],n.view[3]-e.rect[3]+n.view[1]]);if(!t&&e.borderStyle.width>0){i.style.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,n=e.borderStyle.verticalCornerRadius;if(t>0||n>0){const e=`calc(${t}px * var(--scale-factor)) / calc(${n}px * var(--scale-factor))`;i.style.borderRadius=e}else if(this instanceof RadioButtonWidgetAnnotationElement){const t=`calc(${d}px * var(--scale-factor)) / calc(${h}px * var(--scale-factor))`;i.style.borderRadius=t}switch(e.borderStyle.style){case r.AnnotationBorderStyleType.SOLID:i.style.borderStyle="solid";break;case r.AnnotationBorderStyleType.DASHED:i.style.borderStyle="dashed";break;case r.AnnotationBorderStyleType.BEVELED:(0,r.warn)("Unimplemented border style: beveled");break;case r.AnnotationBorderStyleType.INSET:(0,r.warn)("Unimplemented border style: inset");break;case r.AnnotationBorderStyleType.UNDERLINE:i.style.borderBottomStyle="solid"}const s=e.borderColor||null;s?i.style.borderColor=r.Util.makeHexColor(0|s[0],0|s[1],0|s[2]):i.style.borderWidth=0}i.style.left=100*(u[0]-l)/a+"%",i.style.top=100*(u[1]-c)/o+"%";const{rotation:p}=e;return e.hasOwnCanvas||0===p?(i.style.width=100*d/a+"%",i.style.height=100*h/o+"%"):this.setRotation(p,i),i}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;const{pageWidth:n,pageHeight:r}=this.viewport.rawDims,{width:s,height:i}=getRectDims(this.data.rect);let a,o;t%180==0?(a=100*s/n,o=100*i/r):(a=100*i/n,o=100*s/r),e.style.width=`${a}%`,e.style.height=`${o}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const setColor=(t,e,n)=>{const r=n.detail[t];n.target.style[e]=a.ColorConverters[`${r[0]}_HTML`](r.slice(1))};return(0,r.shadow)(this,"_commonActions",{display:t=>{const e=t.detail.display%2==1;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:e,print:0===t.detail.display||3===t.detail.display})},print:t=>{this.annotationStorage.setValue(this.data.id,{print:t.detail.print})},hidden:t=>{this.container.style.visibility=t.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:t.detail.hidden})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.detail.readonly?t.target.setAttribute("readonly",""):t.target.removeAttribute("readonly")},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{setColor("bgColor","backgroundColor",t)},fillColor:t=>{setColor("fillColor","backgroundColor",t)},fgColor:t=>{setColor("fgColor","color",t)},textColor:t=>{setColor("textColor","color",t)},borderColor:t=>{setColor("borderColor","borderColor",t)},strokeColor:t=>{setColor("strokeColor","borderColor",t)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const n=this._commonActions;for(const r of Object.keys(e.detail)){const s=t[r]||n[r];null==s||s(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const n=this._commonActions;for(const[r,s]of Object.entries(e)){const i=n[r];if(i){i({detail:{[r]:s},target:t}),delete e[r]}}}_createQuadrilaterals(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.data.quadPoints)return null;const e=[],n=this.data.rect;for(const n of this.data.quadPoints)this.data.rect=[n[2].x,n[2].y,n[1].x,n[1].y],e.push(this._createContainer(t));return this.data.rect=n,e}_createPopup(t,e){let n=this.container;this.quadrilaterals&&(t||=this.quadrilaterals,n=this.quadrilaterals[0]),t||((t=document.createElement("div")).classList.add("popupTriggerArea"),n.append(t));const r=new PopupElement({container:n,trigger:t,color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,hideWrapper:!0}).render();r.style.left="100%",n.append(r)}_renderQuadrilaterals(t){for(const e of this.quadrilaterals)e.classList.add(t);return this.quadrilaterals}render(){(0,r.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[];if(this._fieldObjects){const s=this._fieldObjects[t];if(s)for(const{page:t,id:i,exportValues:a}of s){if(-1===t)continue;if(i===e)continue;const s="string"==typeof a?a:null,o=document.querySelector(`[data-element-id="${i}"]`);!o||c.has(o)?n.push({id:i,exportValue:s,domElement:o}):(0,r.warn)(`_getElementsByName - element not allowed: ${i}`)}return n}for(const r of document.getElementsByName(t)){const{exportValue:t}=r,s=r.getAttribute("data-element-id");s!==e&&(c.has(r)&&n.push({id:s,exportValue:t,domElement:r}))}return n}}class LinkAnnotationElement extends AnnotationElement{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!(null==e||!e.ignoreBorder),createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,n=document.createElement("a");n.setAttribute("data-element-id",t.id);let r=!1;return t.url?(e.addLinkAttributes(n,t.url,t.newWindow),r=!0):t.action?(this._bindNamedAction(n,t.action),r=!0):t.attachment?(this._bindAttachment(n,t.attachment),r=!0):t.setOCGState?(this.#Ye(n,t.setOCGState),r=!0):t.dest?(this._bindLink(n,t.dest),r=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,t),r=!0),t.resetForm?(this._bindResetFormAction(n,t.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,""),r=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map(((t,e)=>{const r=0===e?n:n.cloneNode();return t.append(r),t})):(this.container.classList.add("linkAnnotation"),r&&this.container.append(n),this.container)}#Ke(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&this.#Ke()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),this.#Ke()}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>{var t;return null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.container,e.content,e.filename),!1},this.#Ke()}#Ye(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),this.#Ke()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(e.actions)){const s=n.get(r);s&&(t[s]=()=>{var t;return null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:r}}),!1})}t.onclick||(t.onclick=()=>!1),this.#Ke()}_bindResetFormAction(t,e){const n=t.onclick;if(n||(t.href=this.linkService.getAnchorUrl("")),this.#Ke(),!this._fieldObjects)return(0,r.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(n||(t.onclick=()=>!1));t.onclick=()=>{null==n||n();const{fields:t,refs:s,include:i}=e,a=[];if(0!==t.length||0!==s.length){const e=new Set(s);for(const n of t){const t=this._fieldObjects[n]||[];for(const{id:n}of t)e.add(n)}for(const t of Object.values(this._fieldObjects))for(const n of t)e.has(n.id)===i&&a.push(n)}else for(const t of Object.values(this._fieldObjects))a.push(...t);const o=this.annotationStorage,l=[];for(const t of a){const{id:e}=t;switch(l.push(e),t.type){case"text":{const n=t.defaultValue||"";o.setValue(e,{value:n});break}case"checkbox":case"radiobutton":{const n=t.defaultValue===t.exportValues;o.setValue(e,{value:n});break}case"combobox":case"listbox":{const n=t.defaultValue||"";o.setValue(e,{value:n});break}default:continue}const n=document.querySelector(`[data-element-id="${e}"]`);n&&(c.has(n)?n.dispatchEvent(new Event("resetform")):(0,r.warn)(`_bindResetFormAction - element not allowed: ${e}`))}var d;this.enableScripting&&(null===(d=this.linkService.eventBus)||void 0===d||d.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}}));return!1}}}class TextAnnotationElement extends AnnotationElement{constructor(t){var e,n,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(n=t.data.contentsObj)&&void 0!==n&&n.str||null!==(r=t.data.richText)&&void 0!==r&&r.str)})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.alt="[{{type}} Annotation]",t.dataset.l10nId="text_annotation_type",t.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(t,this.data),this.container.append(t),this.container}}class WidgetAnnotationElement extends AnnotationElement{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&("CANVAS"===(null===(e=t.previousSibling)||void 0===e?void 0:e.nodeName)&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){const{isWin:e,isMac:n}=r.FeatureTest.platform;return e&&t.ctrlKey||n&&t.metaKey}_setEventListener(t,e,n,r){e.includes("mouse")?t.addEventListener(e,(t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(e,(t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(t)}})}))}_setEventListeners(t,e,n){for(const[s,i]of e){var r;("Action"===i||null!==(r=this.data.actions)&&void 0!==r&&r[i])&&this._setEventListener(t,s,i,n)}}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":r.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||9,i=t.style;let a;const roundToOneDecimal=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(r.LINE_FACTOR*s))||1);a=Math.min(s,roundToOneDecimal(e/r.LINE_FACTOR))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(s,roundToOneDecimal(t/r.LINE_FACTOR))}i.fontSize=`calc(${a}px * var(--scale-factor))`,i.color=r.Util.makeHexColor(n[0],n[1],n[2]),null!==this.data.textAlignment&&(i.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class TextWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,n,r){const s=this.annotationStorage;for(const i of this._getElementsByName(t.name,t.id))i.domElement&&(i.domElement[e]=n),s.setValue(i.id,{[r]:n})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){var r;const i=t.getValue(e,{value:this.data.fieldValue});let a=i.value||"";const o=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;o&&a.length>o&&(a=a.slice(0,o));let d=i.formattedValue||(null===(r=this.data.textContent)||void 0===r?void 0:r.join("\n"))||null;d&&this.data.comb&&(d=d.replaceAll(/\s+/g,""));const h={userValue:a,formattedValue:d,lastCommittedValue:null,commitKey:1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=d??a,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",d??a),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),c.add(n),n.setAttribute("data-element-id",e),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=l,this._setRequired(n,this.data.required),o&&(n.maxLength=o),n.addEventListener("input",(r=>{t.setValue(e,{value:r.target.value}),this.setPropertyOnSiblings(n,"value",r.target.value,"value"),h.formattedValue=null})),n.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue??"";n.value=h.userValue=e,h.formattedValue=null}));let blurListener=t=>{const{formattedValue:e}=h;null!=e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var s;n.addEventListener("focus",(t=>{const{target:e}=t;h.userValue&&(e.value=h.userValue),h.lastCommittedValue=e.value,h.commitKey=1})),n.addEventListener("updatefromsandbox",(n=>{this.showElementAndHideCanvas(n.target);const r={value(n){h.userValue=n.detail.value??"",t.setValue(e,{value:h.userValue.toString()}),n.target.value=h.userValue},formattedValue(n){const{formattedValue:r}=n.detail;h.formattedValue=r,null!=r&&n.target!==document.activeElement&&(n.target.value=r),t.setValue(e,{formattedValue:r})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:n=>{var r;const{charLimit:s}=n.detail,{target:i}=n;if(0===s)return void i.removeAttribute("maxLength");i.setAttribute("maxLength",s);let a=h.userValue;!a||a.length<=s||(a=a.slice(0,s),i.value=h.userValue=a,t.setValue(e,{value:a}),null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}};this._dispatchEventFromSandbox(r,n)})),n.addEventListener("keydown",(t=>{var n;h.commitKey=1;let r=-1;if("Escape"===t.key?r=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(h.commitKey=3):r=2,-1===r)return;const{value:s}=t.target;h.lastCommittedValue!==s&&(h.lastCommittedValue=s,h.userValue=s,null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:r,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}));const r=blurListener;blurListener=null,n.addEventListener("blur",(t=>{if(!t.relatedTarget)return;const{value:n}=t.target;var s;(h.userValue=n,h.lastCommittedValue!==n)&&(null===(s=this.linkService.eventBus)||void 0===s||s.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:h.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}));r(t)})),null!==(s=this.data.actions)&&void 0!==s&&s.Keystroke&&n.addEventListener("beforeinput",(t=>{var n;h.lastCommittedValue=null;const{data:r,target:s}=t,{value:i,selectionStart:a,selectionEnd:o}=s;let l=a,c=o;switch(t.inputType){case"deleteWordBackward":{const t=i.substring(0,a).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=i.substring(a).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":a===o&&(l-=1);break;case"deleteContentForward":a===o&&(c+=1)}t.preventDefault(),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,change:r||"",willCommit:!1,selStart:l,selEnd:c}})})),this._setEventListeners(n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}if(blurListener&&n.addEventListener("blur",blurListener),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/o;n.classList.add("comb"),n.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell";return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,n=e.id;let r=t.getValue(n,{value:e.exportValue===e.fieldValue}).value;"string"==typeof r&&(r="Off"!==r,t.setValue(n,{value:r})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return c.add(s),s.setAttribute("data-element-id",n),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=e.fieldName,r&&s.setAttribute("checked",!0),s.setAttribute("exportValue",e.exportValue),s.tabIndex=l,s.addEventListener("change",(r=>{const{name:s,checked:i}=r.target;for(const r of this._getElementsByName(s,n)){const n=i&&r.exportValue===e.exportValue;r.domElement&&(r.domElement.checked=n),t.setValue(r.id,{value:n})}t.setValue(n,{value:i})})),s.addEventListener("resetform",(t=>{const n=e.defaultFieldValue||"Off";t.target.checked=n===e.exportValue})),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",(e=>{const r={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(n,{value:e.target.checked})}};this._dispatchEventFromSandbox(r,e)})),this._setEventListeners(s,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,n=e.id;let r=t.getValue(n,{value:e.fieldValue===e.buttonValue}).value;"string"==typeof r&&(r=r!==e.buttonValue,t.setValue(n,{value:r}));const s=document.createElement("input");if(c.add(s),s.setAttribute("data-element-id",n),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=e.fieldName,r&&s.setAttribute("checked",!0),s.tabIndex=l,s.addEventListener("change",(e=>{const{name:r,checked:s}=e.target;for(const e of this._getElementsByName(r,n))t.setValue(e.id,{value:!1});t.setValue(n,{value:s})})),s.addEventListener("resetform",(t=>{const n=e.defaultFieldValue;t.target.checked=null!=n&&n===e.buttonValue})),this.enableScripting&&this.hasJSActions){const r=e.buttonValue;s.addEventListener("updatefromsandbox",(e=>{const s={value:e=>{const s=r===e.detail.value;for(const r of this._getElementsByName(e.target.name)){const e=s&&r.id===n;r.domElement&&(r.domElement.checked=e),t.setValue(r.id,{value:e})}}};this._dispatchEventFromSandbox(s,e)})),this._setEventListeners(s,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class PushButtonWidgetAnnotationElement extends LinkAnnotationElement{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(t.title=this.data.alternativeText);const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))),t}}class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,n=t.getValue(e,{value:this.data.fieldValue}),r=document.createElement("select");c.add(r),r.setAttribute("data-element-id",e),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=l;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const t of r.options)t.selected=t.value===e}));for(const t of this.data.options){const e=document.createElement("option");e.textContent=t.displayValue,e.value=t.exportValue,n.value.includes(t.exportValue)&&(e.setAttribute("selected",!0),s=!1),r.append(e)}let i=null;if(s){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),r.prepend(t),i=()=>{t.remove(),r.removeEventListener("input",i),i=null},r.addEventListener("input",i)}const getValue=t=>{const e=t?"value":"textContent",{options:n,multiple:s}=r;return s?Array.prototype.filter.call(n,(t=>t.selected)).map((t=>t[e])):-1===n.selectedIndex?null:n[n.selectedIndex][e]};let a=getValue(!1);const getItems=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};return this.enableScripting&&this.hasJSActions?(r.addEventListener("updatefromsandbox",(n=>{const s={value(n){var s;null===(s=i)||void 0===s||s();const o=n.detail.value,l=new Set(Array.isArray(o)?o:[o]);for(const t of r.options)t.selected=l.has(t.value);t.setValue(e,{value:getValue(!0)}),a=getValue(!1)},multipleSelection(t){r.multiple=!0},remove(n){const s=r.options,i=n.detail.remove;if(s[i].selected=!1,r.remove(i),s.length>0){-1===Array.prototype.findIndex.call(s,(t=>t.selected))&&(s[0].selected=!0)}t.setValue(e,{value:getValue(!0),items:getItems(n)}),a=getValue(!1)},clear(n){for(;0!==r.length;)r.remove(0);t.setValue(e,{value:null,items:[]}),a=getValue(!1)},insert(n){const{index:s,displayValue:i,exportValue:o}=n.detail.insert,l=r.children[s],c=document.createElement("option");c.textContent=i,c.value=o,l?l.before(c):r.append(c),t.setValue(e,{value:getValue(!0),items:getItems(n)}),a=getValue(!1)},items(n){const{items:s}=n.detail;for(;0!==r.length;)r.remove(0);for(const t of s){const{displayValue:e,exportValue:n}=t,s=document.createElement("option");s.textContent=e,s.value=n,r.append(s)}r.options.length>0&&(r.options[0].selected=!0),t.setValue(e,{value:getValue(!0),items:getItems(n)}),a=getValue(!1)},indices(n){const r=new Set(n.detail.indices);for(const t of n.target.options)t.selected=r.has(t.index);t.setValue(e,{value:getValue(!0)}),a=getValue(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(s,n)})),r.addEventListener("input",(n=>{var r;const s=getValue(!0);t.setValue(e,{value:s}),n.preventDefault(),null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,changeEx:s,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(r,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))):r.addEventListener("input",(function(n){t.setValue(e,{value:getValue(!0)})})),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class PopupAnnotationElement extends AnnotationElement{static IGNORE_TYPES=new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]);constructor(t){var e,n,r;const{data:s}=t;super(t,{isRenderable:!PopupAnnotationElement.IGNORE_TYPES.has(s.parentType)&&!!(null!==(e=s.titleObj)&&void 0!==e&&e.str||null!==(n=s.contentsObj)&&void 0!==n&&n.str||null!==(r=s.richText)&&void 0!==r&&r.str)})}render(){this.container.classList.add("popupAnnotation");const t=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(0===t.length)return this.container;const e=new PopupElement({container:this.container,trigger:Array.from(t),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),n=this.page,s=r.Util.normalizeRect([this.data.parentRect[0],n.view[3]-this.data.parentRect[1]+n.view[1],this.data.parentRect[2],n.view[3]-this.data.parentRect[3]+n.view[1]]),i=s[0]+this.data.parentRect[2]-this.data.parentRect[0],a=s[1],{pageWidth:o,pageHeight:l,pageX:c,pageY:d}=this.viewport.rawDims;return this.container.style.left=100*(i-c)/o+"%",this.container.style.top=100*(a-d)/l+"%",this.container.append(e.render()),this.container}}class PopupElement{constructor(t){this.container=t.container,this.trigger=t.trigger,this.color=t.color,this.titleObj=t.titleObj,this.modificationDate=t.modificationDate,this.contentsObj=t.contentsObj,this.richText=t.richText,this.hideWrapper=t.hideWrapper||!1,this.pinned=!1}render(){var t,e;const n=document.createElement("div");n.classList.add("popupWrapper"),this.hideElement=this.hideWrapper?n:this.container,this.hideElement.hidden=!0;const i=document.createElement("div");i.classList.add("popup");const a=this.color;if(a){const t=.7*(255-a[0])+a[0],e=.7*(255-a[1])+a[1],n=.7*(255-a[2])+a[2];i.style.backgroundColor=r.Util.makeHexColor(0|t,0|e,0|n)}const l=document.createElement("h1");l.dir=this.titleObj.dir,l.textContent=this.titleObj.str,i.append(l);const c=s.PDFDateString.toDateObject(this.modificationDate);if(c){const t=document.createElement("span");t.classList.add("popupDate"),t.textContent="{{date}}, {{time}}",t.dataset.l10nId="annotation_date_string",t.dataset.l10nArgs=JSON.stringify({date:c.toLocaleDateString(),time:c.toLocaleTimeString()}),i.append(t)}if(null===(t=this.richText)||void 0===t||!t.str||null!==(e=this.contentsObj)&&void 0!==e&&e.str&&this.contentsObj.str!==this.richText.str){const t=this._formatContents(this.contentsObj);i.append(t)}else o.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:i}),i.lastChild.classList.add("richText","popupContent");Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const t of this.trigger)t.addEventListener("click",this._toggle.bind(this)),t.addEventListener("mouseover",this._show.bind(this,!1)),t.addEventListener("mouseout",this._hide.bind(this,!1));return i.addEventListener("click",this._hide.bind(this,!0)),n.append(i),n}_formatContents(t){let{str:e,dir:n}=t;const r=document.createElement("p");r.classList.add("popupContent"),r.dir=n;const s=e.split(/(?:\r\n?|\n)/);for(let t=0,e=s.length;t<e;++t){const n=s[t];r.append(document.createTextNode(n)),t<e-1&&r.append(document.createElement("br"))}return r}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3)}_hide(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.pinned=!1),this.hideElement.hidden||this.pinned||(this.hideElement.hidden=!0,this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3)}}class FreeTextAnnotationElement extends AnnotationElement{constructor(t){var e,n,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(n=t.data.contentsObj)&&void 0!==n&&n.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0}),this.textContent=t.data.textContent}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const n=document.createElement("span");n.textContent=e,t.append(n)}this.container.append(t)}return this.data.hasPopup||this._createPopup(null,this.data),this.container}}class LineAnnotationElement extends AnnotationElement{constructor(t){var e,n,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(n=t.data.contentsObj)&&void 0!==n&&n.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:n}=getRectDims(t.rect),r=this.svgFactory.create(e,n,!0),s=this.svgFactory.createElement("svg:line");return s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),r.append(s),this.container.append(r),this._createPopup(s,t),this.container}}class SquareAnnotationElement extends AnnotationElement{constructor(t){var e,n,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(n=t.data.contentsObj)&&void 0!==n&&n.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:n}=getRectDims(t.rect),r=this.svgFactory.create(e,n,!0),s=t.borderStyle.width,i=this.svgFactory.createElement("svg:rect");return i.setAttribute("x",s/2),i.setAttribute("y",s/2),i.setAttribute("width",e-s),i.setAttribute("height",n-s),i.setAttribute("stroke-width",s||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),r.append(i),this.container.append(r),this._createPopup(i,t),this.container}}class CircleAnnotationElement extends AnnotationElement{constructor(t){var e,n,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(n=t.data.contentsObj)&&void 0!==n&&n.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:n}=getRectDims(t.rect),r=this.svgFactory.create(e,n,!0),s=t.borderStyle.width,i=this.svgFactory.createElement("svg:ellipse");return i.setAttribute("cx",e/2),i.setAttribute("cy",n/2),i.setAttribute("rx",e/2-s/2),i.setAttribute("ry",n/2-s/2),i.setAttribute("stroke-width",s||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),r.append(i),this.container.append(r),this._createPopup(i,t),this.container}}class PolylineAnnotationElement extends AnnotationElement{constructor(t){var e,n,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(n=t.data.contentsObj)&&void 0!==n&&n.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const t=this.data,{width:e,height:n}=getRectDims(t.rect),r=this.svgFactory.create(e,n,!0);let s=[];for(const e of t.vertices){const n=e.x-t.rect[0],r=t.rect[3]-e.y;s.push(n+","+r)}s=s.join(" ");const i=this.svgFactory.createElement(this.svgElementName);return i.setAttribute("points",s),i.setAttribute("stroke-width",t.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),r.append(i),this.container.append(r),this._createPopup(i,t),this.container}}class PolygonAnnotationElement extends PolylineAnnotationElement{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class CaretAnnotationElement extends AnnotationElement{constructor(t){var e,n,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(n=t.data.contentsObj)&&void 0!==n&&n.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),this.data.hasPopup||this._createPopup(null,this.data),this.container}}class InkAnnotationElement extends AnnotationElement{constructor(t){var e,n,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(n=t.data.contentsObj)&&void 0!==n&&n.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const t=this.data,{width:e,height:n}=getRectDims(t.rect),r=this.svgFactory.create(e,n,!0);for(const e of t.inkLists){let n=[];for(const r of e){const e=r.x-t.rect[0],s=t.rect[3]-r.y;n.push(`${e},${s}`)}n=n.join(" ");const s=this.svgFactory.createElement(this.svgElementName);s.setAttribute("points",n),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),this._createPopup(s,t),r.append(s)}return this.container.append(r),this.container}}class HighlightAnnotationElement extends AnnotationElement{constructor(t){var e,n,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(n=t.data.contentsObj)&&void 0!==n&&n.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("highlightAnnotation"):(this.container.classList.add("highlightAnnotation"),this.container)}}class UnderlineAnnotationElement extends AnnotationElement{constructor(t){var e,n,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(n=t.data.contentsObj)&&void 0!==n&&n.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("underlineAnnotation"):(this.container.classList.add("underlineAnnotation"),this.container)}}class SquigglyAnnotationElement extends AnnotationElement{constructor(t){var e,n,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(n=t.data.contentsObj)&&void 0!==n&&n.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.classList.add("squigglyAnnotation"),this.container)}}class StrikeOutAnnotationElement extends AnnotationElement{constructor(t){var e,n,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(n=t.data.contentsObj)&&void 0!==n&&n.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.classList.add("strikeoutAnnotation"),this.container)}}class StampAnnotationElement extends AnnotationElement{constructor(t){var e,n,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(n=t.data.contentsObj)&&void 0!==n&&n.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),this.data.hasPopup||this._createPopup(null,this.data),this.container}}class FileAttachmentAnnotationElement extends AnnotationElement{constructor(t){var e;super(t,{isRenderable:!0});const{filename:n,content:r}=this.data.file;this.filename=(0,s.getFilenameFromUrl)(n,!0),this.content=r,null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",{source:this,filename:n,content:r})}render(){var t,e;let n;return this.container.classList.add("fileAttachmentAnnotation"),this.data.hasAppearance?n=document.createElement("div"):(n=document.createElement("img"),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(this.data.name)?"paperclip":"pushpin"}.svg`),n.classList.add("popupTriggerArea"),n.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&(null!==(t=this.data.titleObj)&&void 0!==t&&t.str||null!==(e=this.data.contentsObj)&&void 0!==e&&e.str||this.data.richText)&&this._createPopup(n,this.data),this.container.append(n),this.container}_download(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.container,this.content,this.filename)}}class AnnotationLayer{static#Je(t,e,n,r){const i=t.firstChild||t;i.id=`${s.AnnotationPrefix}${e}`,n.append(t),null==r||r.moveElementInDOM(n,t,i,!1)}static render(t){const{annotations:e,div:n,viewport:a,accessibilityManager:o}=t;(0,s.setLayerDimensions)(n,a);const l={data:null,layer:n,page:t.page,viewport:a,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new s.DOMSVGFactory,annotationStorage:t.annotationStorage||new i.AnnotationStorage,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects};let c=0;for(const t of e){if(t.noHTML)continue;if(t.annotationType!==r.AnnotationType.POPUP){const{width:e,height:n}=getRectDims(t.rect);if(e<=0||n<=0)continue}l.data=t;const e=AnnotationElementFactory.create(l);if(!e.isRenderable)continue;const s=e.render();if(t.hidden&&(s.style.visibility="hidden"),Array.isArray(s))for(const e of s)e.style.zIndex=c++,AnnotationLayer.#Je(e,t.id,n,o);else s.style.zIndex=c++,e instanceof PopupAnnotationElement?n.prepend(s):AnnotationLayer.#Je(s,t.id,n,o)}this.#Qe(n,t.annotationCanvasMap)}static update(t){const{annotationCanvasMap:e,div:n,viewport:r}=t;(0,s.setLayerDimensions)(n,{rotation:r.rotation}),this.#Qe(n,e),n.hidden=!1}static#Qe(t,e){if(e){for(const[n,r]of e){const e=t.querySelector(`[data-annotation-id="${n}"]`);if(!e)continue;const{firstChild:s}=e;s?"CANVAS"===s.nodeName?s.replaceWith(r):s.before(r):e.append(r)}e.clear()}}}e.AnnotationLayer=AnnotationLayer},(t,e)=>{"use strict";function makeColorComp(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorConverters=void 0;e.ColorConverters=class ColorConverters{static CMYK_G(t){let[e,n,r,s]=t;return["G",1-Math.min(1,.3*e+.59*r+.11*n+s)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_HTML(t){let[e]=t;const n=makeColorComp(e);return`#${n}${n}${n}`}static RGB_G(t){let[e,n,r]=t;return["G",.3*e+.59*n+.11*r]}static RGB_HTML(t){let[e,n,r]=t;return`#${makeColorComp(e)}${makeColorComp(n)}${makeColorComp(r)}`}static T_HTML(){return"#00000000"}static CMYK_RGB(t){let[e,n,r,s]=t;return["RGB",1-Math.min(1,e+s),1-Math.min(1,r+s),1-Math.min(1,n+s)]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,n,r]=t;const s=1-e,i=1-n,a=1-r;return["CMYK",s,i,a,Math.min(s,i,a)]}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XfaLayer=void 0;var r=n(154);e.XfaLayer=class XfaLayer{static setupStorage(t,e,n,r,s){const i=r.getValue(e,{value:null});switch(n.name){case"textarea":if(null!==i.value&&(t.textContent=i.value),"print"===s)break;t.addEventListener("input",(t=>{r.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(i.value===n.attributes.xfaOn?t.setAttribute("checked",!0):i.value===n.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",(t=>{r.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{if(null!==i.value&&t.setAttribute("value",i.value),"print"===s)break;t.addEventListener("input",(t=>{r.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==i.value)for(const t of n.children)t.attributes.value===i.value&&(t.attributes.selected=!0);t.addEventListener("input",(t=>{const n=t.target.options,s=-1===n.selectedIndex?"":n[n.selectedIndex].value;r.setValue(e,{value:s})}))}}static setAttributes(t){let{html:e,element:n,storage:r=null,intent:s,linkService:i}=t;const{attributes:a}=n,o=e instanceof HTMLAnchorElement;"radio"===a.type&&(a.name=`${a.name}-${s}`);for(const[t,n]of Object.entries(a))if(null!=n)switch(t){case"class":n.length&&e.setAttribute(t,n.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",n);break;case"style":Object.assign(e.style,n);break;case"textContent":e.textContent=n;break;default:(!o||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,n)}o&&i.addLinkAttributes(e,a.href,a.newWindow),r&&a.dataId&&this.setupStorage(e,a.dataId,n,r)}static render(t){const e=t.annotationStorage,n=t.linkService,s=t.xfaHtml,i=t.intent||"display",a=document.createElement(s.name);s.attributes&&this.setAttributes({html:a,element:s,intent:i,linkService:n});const o=[[s,-1,a]],l=t.div;if(l.append(a),t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=e}"richText"!==i&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){var d;const[t,s,a]=o.at(-1);if(s+1===t.children.length){o.pop();continue}const l=t.children[++o.at(-1)[1]];if(null===l)continue;const{name:h}=l;if("#text"===h){const t=document.createTextNode(l.value);c.push(t),a.append(t);continue}let u;if(u=null!=l&&null!==(d=l.attributes)&&void 0!==d&&d.xmlns?document.createElementNS(l.attributes.xmlns,h):document.createElement(h),a.append(u),l.attributes&&this.setAttributes({html:u,element:l,storage:e,intent:i,linkService:n}),l.children&&l.children.length>0)o.push([l,-1,u]);else if(l.value){const t=document.createTextNode(l.value);r.XfaText.shouldBuildText(h)&&c.push(t),u.append(t)}}for(const t of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}},(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0;var r=n(142),s=n(1),i=n(3);let a=class{constructor(){(0,s.unreachable)("Not implemented: SVGGraphics")}};e.SVGGraphics=a;{const o={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/1999/xlink",d=["butt","round","square"],h=["miter","round","bevel"],createObjectURL=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!=typeof Blob&&!n)return URL.createObjectURL(new Blob([t],{type:e}));const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s=`data:${e};base64,`;for(let e=0,n=t.length;e<n;e+=3){const i=255&t[e],a=255&t[e+1],o=255&t[e+2];s+=r[i>>2]+r[(3&i)<<4|a>>4]+r[e+1<n?(15&a)<<2|o>>6:64]+r[e+2<n?63&o:64]}return s},u=function(){const t=new Uint8Array([137,80,78,71,13,10,26,10]),e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let t=0;t<8;t++)n=1&n?3988292384^n>>1&2147483647:n>>1&2147483647;e[t]=n}function writePngChunk(t,n,r,s){let i=s;const a=n.length;r[i]=a>>24&255,r[i+1]=a>>16&255,r[i+2]=a>>8&255,r[i+3]=255&a,i+=4,r[i]=255&t.charCodeAt(0),r[i+1]=255&t.charCodeAt(1),r[i+2]=255&t.charCodeAt(2),r[i+3]=255&t.charCodeAt(3),i+=4,r.set(n,i),i+=n.length;const o=function crc32(t,n,r){let s=-1;for(let i=n;i<r;i++){const n=255&(s^t[i]);s=s>>>8^e[n]}return-1^s}(r,s+4,i);r[i]=o>>24&255,r[i+1]=o>>16&255,r[i+2]=o>>8&255,r[i+3]=255&o}function deflateSyncUncompressed(t){let e=t.length;const n=65535,r=Math.ceil(e/n),s=new Uint8Array(2+e+5*r+4);let i=0;s[i++]=120,s[i++]=156;let a=0;for(;e>n;)s[i++]=0,s[i++]=255,s[i++]=255,s[i++]=0,s[i++]=0,s.set(t.subarray(a,a+n),i),i+=n,a+=n,e-=n;s[i++]=1,s[i++]=255&e,s[i++]=e>>8&255,s[i++]=255&~e,s[i++]=(65535&~e)>>8&255,s.set(t.subarray(a),i),i+=t.length-a;const o=function adler32(t,e,n){let r=1,s=0;for(let i=e;i<n;++i)r=(r+(255&t[i]))%65521,s=(s+r)%65521;return s<<16|r}(t,0,t.length);return s[i++]=o>>24&255,s[i++]=o>>16&255,s[i++]=o>>8&255,s[i++]=255&o,s}function encode(e,n,r,a){const o=e.width,l=e.height;let c,d,h;const u=e.data;switch(n){case s.ImageKind.GRAYSCALE_1BPP:d=0,c=1,h=o+7>>3;break;case s.ImageKind.RGB_24BPP:d=2,c=8,h=3*o;break;case s.ImageKind.RGBA_32BPP:d=6,c=8,h=4*o;break;default:throw new Error("invalid format")}const p=new Uint8Array((1+h)*l);let f=0,g=0;for(let t=0;t<l;++t)p[f++]=0,p.set(u.subarray(g,g+h),f),g+=h,f+=h;if(n===s.ImageKind.GRAYSCALE_1BPP&&a){f=0;for(let t=0;t<l;t++){f++;for(let t=0;t<h;t++)p[f++]^=255}}const m=new Uint8Array([o>>24&255,o>>16&255,o>>8&255,255&o,l>>24&255,l>>16&255,l>>8&255,255&l,c,d,0,0,0]),v=function deflateSync(t){if(!i.isNodeJS)return deflateSyncUncompressed(t);try{let e;e=parseInt(process.versions.node)>=8?t:Buffer.from(t);const n=require("zlib").deflateSync(e,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(t){(0,s.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return deflateSyncUncompressed(t)}(p),b=t.length+36+m.length+v.length,y=new Uint8Array(b);let A=0;return y.set(t,A),A+=t.length,writePngChunk("IHDR",m,y,A),A+=12+m.length,writePngChunk("IDATA",v,y,A),A+=12+v.length,writePngChunk("IEND",new Uint8Array(0),y,A),createObjectURL(y,"image/png",r)}return function convertImgDataToPng(t,e,n){return encode(t,void 0===t.kind?s.ImageKind.GRAYSCALE_1BPP:t.kind,e,n)}}();class SVGExtraState{constructor(){this.fontSizeScale=1,this.fontWeight=o.fontWeight,this.fontSize=0,this.textMatrix=s.IDENTITY_MATRIX,this.fontMatrix=s.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=s.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=o.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(t,e){this.x=t,this.y=e}}function opListToTree(t){let e=[];const n=[];for(const r of t)"save"!==r.fn?"restore"===r.fn?e=n.pop():e.push(r):(e.push({fnId:92,fn:"group",items:[]}),n.push(e),e=e.at(-1).items);return e}function pf(t){if(Number.isInteger(t))return t.toString();const e=t.toFixed(10);let n=e.length-1;if("0"!==e[n])return e;do{n--}while("0"===e[n]);return e.substring(0,"."===e[n]?n:n+1)}function pm(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":`scale(${pf(t[0])} ${pf(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2]){return`rotate(${pf(180*Math.acos(t[0])/Math.PI)})`}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${pf(t[4])} ${pf(t[5])})`;return`matrix(${pf(t[0])} ${pf(t[1])} ${pf(t[2])} ${pf(t[3])} ${pf(t[4])} ${pf(t[5])})`}let p=0,f=0,g=0;e.SVGGraphics=a=class{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,r.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new r.DOMSVGFactory,this.current=new SVGExtraState,this.transformMatrix=s.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=t,this.objs=e,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!n,this._operatorIdMapping=[];for(const t in s.OPS)this._operatorIdMapping[s.OPS[t]]=t}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}save(){this.transformStack.push(this.transformMatrix);const t=this.current;this.extraStack.push(t),this.current=t.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(t){this.save(),this.executeOpTree(t),this.restore()}loadDependencies(t){const e=t.fnArray,n=t.argsArray;for(let t=0,r=e.length;t<r;t++)if(e[t]===s.OPS.dependency)for(const e of n[t]){const t=e.startsWith("g_")?this.commonObjs:this.objs,n=new Promise((n=>{t.get(e,n)}));this.current.dependencies.push(n)}return Promise.all(this.current.dependencies)}transform(t,e,n,r,i,a){const o=[t,e,n,r,i,a];this.transformMatrix=s.Util.transform(this.transformMatrix,o),this.tgrp=null}getSVG(t,e){this.viewport=e;const n=this._initialize(e);return this.loadDependencies(t).then((()=>(this.transformMatrix=s.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(t)),n)))}convertOpList(t){const e=this._operatorIdMapping,n=t.argsArray,r=t.fnArray,s=[];for(let t=0,i=r.length;t<i;t++){const i=r[t];s.push({fnId:i,fn:e[i],args:n[t]})}return opListToTree(s)}executeOpTree(t){for(const e of t){const t=e.fn,n=e.fnId,r=e.args;switch(0|n){case s.OPS.beginText:this.beginText();break;case s.OPS.dependency:break;case s.OPS.setLeading:this.setLeading(r);break;case s.OPS.setLeadingMoveText:this.setLeadingMoveText(r[0],r[1]);break;case s.OPS.setFont:this.setFont(r);break;case s.OPS.showText:case s.OPS.showSpacedText:this.showText(r[0]);break;case s.OPS.endText:this.endText();break;case s.OPS.moveText:this.moveText(r[0],r[1]);break;case s.OPS.setCharSpacing:this.setCharSpacing(r[0]);break;case s.OPS.setWordSpacing:this.setWordSpacing(r[0]);break;case s.OPS.setHScale:this.setHScale(r[0]);break;case s.OPS.setTextMatrix:this.setTextMatrix(r[0],r[1],r[2],r[3],r[4],r[5]);break;case s.OPS.setTextRise:this.setTextRise(r[0]);break;case s.OPS.setTextRenderingMode:this.setTextRenderingMode(r[0]);break;case s.OPS.setLineWidth:this.setLineWidth(r[0]);break;case s.OPS.setLineJoin:this.setLineJoin(r[0]);break;case s.OPS.setLineCap:this.setLineCap(r[0]);break;case s.OPS.setMiterLimit:this.setMiterLimit(r[0]);break;case s.OPS.setFillRGBColor:this.setFillRGBColor(r[0],r[1],r[2]);break;case s.OPS.setStrokeRGBColor:this.setStrokeRGBColor(r[0],r[1],r[2]);break;case s.OPS.setStrokeColorN:this.setStrokeColorN(r);break;case s.OPS.setFillColorN:this.setFillColorN(r);break;case s.OPS.shadingFill:this.shadingFill(r[0]);break;case s.OPS.setDash:this.setDash(r[0],r[1]);break;case s.OPS.setRenderingIntent:this.setRenderingIntent(r[0]);break;case s.OPS.setFlatness:this.setFlatness(r[0]);break;case s.OPS.setGState:this.setGState(r[0]);break;case s.OPS.fill:this.fill();break;case s.OPS.eoFill:this.eoFill();break;case s.OPS.stroke:this.stroke();break;case s.OPS.fillStroke:this.fillStroke();break;case s.OPS.eoFillStroke:this.eoFillStroke();break;case s.OPS.clip:this.clip("nonzero");break;case s.OPS.eoClip:this.clip("evenodd");break;case s.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case s.OPS.paintImageXObject:this.paintImageXObject(r[0]);break;case s.OPS.paintInlineImageXObject:this.paintInlineImageXObject(r[0]);break;case s.OPS.paintImageMaskXObject:this.paintImageMaskXObject(r[0]);break;case s.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(r[0],r[1]);break;case s.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case s.OPS.closePath:this.closePath();break;case s.OPS.closeStroke:this.closeStroke();break;case s.OPS.closeFillStroke:this.closeFillStroke();break;case s.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case s.OPS.nextLine:this.nextLine();break;case s.OPS.transform:this.transform(r[0],r[1],r[2],r[3],r[4],r[5]);break;case s.OPS.constructPath:this.constructPath(r[0],r[1]);break;case s.OPS.endPath:this.endPath();break;case 92:this.group(e.items);break;default:(0,s.warn)(`Unimplemented operator ${t}`)}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,n,r,s,i){const a=this.current;a.textMatrix=a.lineMatrix=[t,e,n,r,s,i],a.textMatrixScale=Math.hypot(t,e),a.x=a.lineX=0,a.y=a.lineY=0,a.xcoords=[],a.ycoords=[],a.tspan=this.svgFactory.createElement("svg:tspan"),a.tspan.setAttributeNS(null,"font-family",a.fontFamily),a.tspan.setAttributeNS(null,"font-size",`${pf(a.fontSize)}px`),a.tspan.setAttributeNS(null,"y",pf(-a.y)),a.txtElement=this.svgFactory.createElement("svg:text"),a.txtElement.append(a.tspan)}beginText(){const t=this.current;t.x=t.lineX=0,t.y=t.lineY=0,t.textMatrix=s.IDENTITY_MATRIX,t.lineMatrix=s.IDENTITY_MATRIX,t.textMatrixScale=1,t.tspan=this.svgFactory.createElement("svg:tspan"),t.txtElement=this.svgFactory.createElement("svg:text"),t.txtgrp=this.svgFactory.createElement("svg:g"),t.xcoords=[],t.ycoords=[]}moveText(t,e){const n=this.current;n.x=n.lineX+=t,n.y=n.lineY+=e,n.xcoords=[],n.ycoords=[],n.tspan=this.svgFactory.createElement("svg:tspan"),n.tspan.setAttributeNS(null,"font-family",n.fontFamily),n.tspan.setAttributeNS(null,"font-size",`${pf(n.fontSize)}px`),n.tspan.setAttributeNS(null,"y",pf(-n.y))}showText(t){const e=this.current,n=e.font,r=e.fontSize;if(0===r)return;const i=e.fontSizeScale,a=e.charSpacing,c=e.wordSpacing,d=e.fontDirection,h=e.textHScale*d,u=n.vertical,p=u?1:-1,f=n.defaultVMetrics,g=r*e.fontMatrix[0];let m=0;for(const s of t){if(null===s){m+=d*c;continue}if("number"==typeof s){m+=p*s*r/1e3;continue}const t=(s.isSpace?c:0)+a,o=s.fontChar;let l,h,v,b=s.width;if(u){let t;const e=s.vmetric||f;t=s.vmetric?e[1]:.5*b,t=-t*g;const n=e[2]*g;b=e?-e[0]:b,l=t/i,h=(m+n)/i}else l=m/i,h=0;(s.isInFont||n.missingFile)&&(e.xcoords.push(e.x+l),u&&e.ycoords.push(-e.y+h),e.tspan.textContent+=o),v=u?b*g-t*d:b*g+t*d,m+=v}e.tspan.setAttributeNS(null,"x",e.xcoords.map(pf).join(" ")),u?e.tspan.setAttributeNS(null,"y",e.ycoords.map(pf).join(" ")):e.tspan.setAttributeNS(null,"y",pf(-e.y)),u?e.y-=m:e.x+=m*h,e.tspan.setAttributeNS(null,"font-family",e.fontFamily),e.tspan.setAttributeNS(null,"font-size",`${pf(e.fontSize)}px`),e.fontStyle!==o.fontStyle&&e.tspan.setAttributeNS(null,"font-style",e.fontStyle),e.fontWeight!==o.fontWeight&&e.tspan.setAttributeNS(null,"font-weight",e.fontWeight);const v=e.textRenderingMode&s.TextRenderingMode.FILL_STROKE_MASK;if(v===s.TextRenderingMode.FILL||v===s.TextRenderingMode.FILL_STROKE?(e.fillColor!==o.fillColor&&e.tspan.setAttributeNS(null,"fill",e.fillColor),e.fillAlpha<1&&e.tspan.setAttributeNS(null,"fill-opacity",e.fillAlpha)):e.textRenderingMode===s.TextRenderingMode.ADD_TO_PATH?e.tspan.setAttributeNS(null,"fill","transparent"):e.tspan.setAttributeNS(null,"fill","none"),v===s.TextRenderingMode.STROKE||v===s.TextRenderingMode.FILL_STROKE){const t=1/(e.textMatrixScale||1);this._setStrokeAttributes(e.tspan,t)}let b=e.textMatrix;0!==e.textRise&&(b=b.slice(),b[5]+=e.textRise),e.txtElement.setAttributeNS(null,"transform",`${pm(b)} scale(${pf(h)}, -1)`),e.txtElement.setAttributeNS(l,"xml:space","preserve"),e.txtElement.append(e.tspan),e.txtgrp.append(e.txtElement),this._ensureTransformGroup().append(e.txtElement)}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}addFontStyle(t){if(!t.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const e=createObjectURL(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${t.loadedName}"; src: url(${e}); }\n`}setFont(t){const e=this.current,n=this.commonObjs.get(t[0]);let r=t[1];e.font=n,!this.embedFonts||n.missingFile||this.embeddedFonts[n.loadedName]||(this.addFontStyle(n),this.embeddedFonts[n.loadedName]=n),e.fontMatrix=n.fontMatrix||s.FONT_IDENTITY_MATRIX;let i="normal";n.black?i="900":n.bold&&(i="bold");const a=n.italic?"italic":"normal";r<0?(r=-r,e.fontDirection=-1):e.fontDirection=1,e.fontSize=r,e.fontFamily=n.loadedName,e.fontWeight=i,e.fontStyle=a,e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"y",pf(-e.y)),e.xcoords=[],e.ycoords=[]}endText(){var t;const e=this.current;e.textRenderingMode&s.TextRenderingMode.ADD_TO_PATH_FLAG&&null!==(t=e.txtElement)&&void 0!==t&&t.hasChildNodes()&&(e.element=e.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(t){t>0&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=d[t]}setLineJoin(t){this.current.lineJoin=h[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,n){this.current.strokeColor=s.Util.makeHexColor(t,e,n)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,n){this.current.fillColor=s.Util.makeHexColor(t,e,n),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}shadingFill(t){const e=this.viewport.width,n=this.viewport.height,r=s.Util.inverseTransform(this.transformMatrix),i=s.Util.applyTransform([0,0],r),a=s.Util.applyTransform([0,n],r),o=s.Util.applyTransform([e,0],r),l=s.Util.applyTransform([e,n],r),c=Math.min(i[0],a[0],o[0],l[0]),d=Math.min(i[1],a[1],o[1],l[1]),h=Math.max(i[0],a[0],o[0],l[0]),u=Math.max(i[1],a[1],o[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",c),p.setAttributeNS(null,"y",d),p.setAttributeNS(null,"width",h-c),p.setAttributeNS(null,"height",u-d),p.setAttributeNS(null,"fill",this._makeShadingPattern(t)),this.current.fillAlpha<1&&p.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(p)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){const e=t[1],n=t[2],r=t[3]||s.IDENTITY_MATRIX,[i,a,o,l]=t[4],c=t[5],d=t[6],h=t[7],u="shading"+g++,[p,f,m,v]=s.Util.normalizeRect([...s.Util.applyTransform([i,a],r),...s.Util.applyTransform([o,l],r)]),[b,y]=s.Util.singularValueDecompose2dScale(r),A=c*b,_=d*y,S=this.svgFactory.createElement("svg:pattern");S.setAttributeNS(null,"id",u),S.setAttributeNS(null,"patternUnits","userSpaceOnUse"),S.setAttributeNS(null,"width",A),S.setAttributeNS(null,"height",_),S.setAttributeNS(null,"x",`${p}`),S.setAttributeNS(null,"y",`${f}`);const x=this.svg,E=this.transformMatrix,C=this.current.fillColor,w=this.current.strokeColor,P=this.svgFactory.create(m-p,v-f);if(this.svg=P,this.transformMatrix=r,2===h){const t=s.Util.makeHexColor(...e);this.current.fillColor=t,this.current.strokeColor=t}return this.executeOpTree(this.convertOpList(n)),this.svg=x,this.transformMatrix=E,this.current.fillColor=C,this.current.strokeColor=w,S.append(P.childNodes[0]),this.defs.append(S),`url(#${u})`}_makeShadingPattern(t){switch("string"==typeof t&&(t=this.objs.get(t)),t[0]){case"RadialAxial":const e="shading"+g++,n=t[3];let r;switch(t[1]){case"axial":const n=t[4],s=t[5];r=this.svgFactory.createElement("svg:linearGradient"),r.setAttributeNS(null,"id",e),r.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),r.setAttributeNS(null,"x1",n[0]),r.setAttributeNS(null,"y1",n[1]),r.setAttributeNS(null,"x2",s[0]),r.setAttributeNS(null,"y2",s[1]);break;case"radial":const i=t[4],a=t[5],o=t[6],l=t[7];r=this.svgFactory.createElement("svg:radialGradient"),r.setAttributeNS(null,"id",e),r.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),r.setAttributeNS(null,"cx",a[0]),r.setAttributeNS(null,"cy",a[1]),r.setAttributeNS(null,"r",l),r.setAttributeNS(null,"fx",i[0]),r.setAttributeNS(null,"fy",i[1]),r.setAttributeNS(null,"fr",o);break;default:throw new Error(`Unknown RadialAxial type: ${t[1]}`)}for(const t of n){const e=this.svgFactory.createElement("svg:stop");e.setAttributeNS(null,"offset",t[0]),e.setAttributeNS(null,"stop-color",t[1]),r.append(e)}return this.defs.append(r),`url(#${e})`;case"Mesh":return(0,s.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${t[0]}`)}}setDash(t,e){this.current.dashArray=t,this.current.dashPhase=e}constructPath(t,e){const n=this.current;let r=n.x,i=n.y,a=[],o=0;for(const n of t)switch(0|n){case s.OPS.rectangle:r=e[o++],i=e[o++];const t=r+e[o++],n=i+e[o++];a.push("M",pf(r),pf(i),"L",pf(t),pf(i),"L",pf(t),pf(n),"L",pf(r),pf(n),"Z");break;case s.OPS.moveTo:r=e[o++],i=e[o++],a.push("M",pf(r),pf(i));break;case s.OPS.lineTo:r=e[o++],i=e[o++],a.push("L",pf(r),pf(i));break;case s.OPS.curveTo:r=e[o+4],i=e[o+5],a.push("C",pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]),pf(r),pf(i)),o+=6;break;case s.OPS.curveTo2:a.push("C",pf(r),pf(i),pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3])),r=e[o+2],i=e[o+3],o+=4;break;case s.OPS.curveTo3:r=e[o+2],i=e[o+3],a.push("C",pf(e[o]),pf(e[o+1]),pf(r),pf(i),pf(r),pf(i)),o+=4;break;case s.OPS.closePath:a.push("Z")}a=a.join(" "),n.path&&t.length>0&&t[0]!==s.OPS.rectangle&&t[0]!==s.OPS.moveTo?a=n.path.getAttributeNS(null,"d")+a:(n.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(n.path)),n.path.setAttributeNS(null,"d",a),n.path.setAttributeNS(null,"fill","none"),n.element=n.path,n.setCurrentPoint(r,i)}endPath(){const t=this.current;if(t.path=null,!this.pendingClip)return;if(!t.element)return void(this.pendingClip=null);const e="clippath"+p++,n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",e),n.setAttributeNS(null,"transform",pm(this.transformMatrix));const r=t.element.cloneNode(!0);if("evenodd"===this.pendingClip?r.setAttributeNS(null,"clip-rule","evenodd"):r.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,n.append(r),this.defs.append(n),t.activeClipUrl){t.clipGroup=null;for(const t of this.extraStack)t.clipGroup=null;n.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl=`url(#${e})`,this.tgrp=null}clip(t){this.pendingClip=t}closePath(){const t=this.current;if(t.path){const e=`${t.path.getAttributeNS(null,"d")}Z`;t.path.setAttributeNS(null,"d",e)}}setLeading(t){this.current.leading=-t}setTextRise(t){this.current.textRise=t}setTextRenderingMode(t){this.current.textRenderingMode=t}setHScale(t){this.current.textHScale=t/100}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,n]of t)switch(e){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n);break;case"CA":this.setStrokeAlpha(n);break;case"ca":this.setFillAlpha(n);break;default:(0,s.warn)(`Unimplemented graphic state operator ${e}`)}}fill(){const t=this.current;t.element&&(t.element.setAttributeNS(null,"fill",t.fillColor),t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha),this.endPath())}stroke(){const t=this.current;t.element&&(this._setStrokeAttributes(t.element),t.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=this.current;let r=n.dashArray;1!==e&&r.length>0&&(r=r.map((function(t){return e*t}))),t.setAttributeNS(null,"stroke",n.strokeColor),t.setAttributeNS(null,"stroke-opacity",n.strokeAlpha),t.setAttributeNS(null,"stroke-miterlimit",pf(n.miterLimit)),t.setAttributeNS(null,"stroke-linecap",n.lineCap),t.setAttributeNS(null,"stroke-linejoin",n.lineJoin),t.setAttributeNS(null,"stroke-width",pf(e*n.lineWidth)+"px"),t.setAttributeNS(null,"stroke-dasharray",r.map(pf).join(" ")),t.setAttributeNS(null,"stroke-dashoffset",pf(e*n.dashPhase)+"px")}eoFill(){var t;null===(t=this.current.element)||void 0===t||t.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var t;null===(t=this.current.element)||void 0===t||t.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0"),t.setAttributeNS(null,"y","0"),t.setAttributeNS(null,"width","1px"),t.setAttributeNS(null,"height","1px"),t.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(t)}paintImageXObject(t){const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,s.warn)(`Dependent image with object ID ${t} is not ready yet`)}paintInlineImageXObject(t,e){const n=t.width,r=t.height,s=u(t,this.forceDataSchema,!!e),i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x","0"),i.setAttributeNS(null,"y","0"),i.setAttributeNS(null,"width",pf(n)),i.setAttributeNS(null,"height",pf(r)),this.current.element=i,this.clip("nonzero");const a=this.svgFactory.createElement("svg:image");a.setAttributeNS(c,"xlink:href",s),a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y",pf(-r)),a.setAttributeNS(null,"width",pf(n)+"px"),a.setAttributeNS(null,"height",pf(r)+"px"),a.setAttributeNS(null,"transform",`scale(${pf(1/n)} ${pf(-1/r)})`),e?e.append(a):this._ensureTransformGroup().append(a)}paintImageMaskXObject(t){const e=this.getObject(t.data,t);if(e.bitmap)return void(0,s.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");const n=this.current,r=e.width,i=e.height,a=n.fillColor;n.maskId="mask"+f++;const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",n.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0"),l.setAttributeNS(null,"y","0"),l.setAttributeNS(null,"width",pf(r)),l.setAttributeNS(null,"height",pf(i)),l.setAttributeNS(null,"fill",a),l.setAttributeNS(null,"mask",`url(#${n.maskId})`),this.defs.append(o),this._ensureTransformGroup().append(l),this.paintInlineImageXObject(e,o)}paintFormXObjectBegin(t,e){if(Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e){const t=e[2]-e[0],n=e[3]-e[1],r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x",e[0]),r.setAttributeNS(null,"y",e[1]),r.setAttributeNS(null,"width",pf(t)),r.setAttributeNS(null,"height",pf(n)),this.current.element=r,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(t){const e=this.svgFactory.create(t.width,t.height),n=this.svgFactory.createElement("svg:defs");e.append(n),this.defs=n;const r=this.svgFactory.createElement("svg:g");return r.setAttributeNS(null,"transform",pm(t.transform)),e.append(r),this.svg=r,e}_ensureClipGroup(){if(!this.current.clipGroup){const t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(t),this.current.clipGroup=t}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(n.exports,n,n.exports,__w_pdfjs_require__),n.exports}var __webpack_exports__={};return(()=>{"use strict";var t=__webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AbortException",{enumerable:!0,get:function(){return e.AbortException}}),Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return i.AnnotationEditorLayer}}),Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return e.AnnotationEditorParamsType}}),Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return e.AnnotationEditorType}}),Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return a.AnnotationEditorUIManager}}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}}),Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return e.AnnotationMode}}),Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return e.CMapCompressionType}}),Object.defineProperty(t,"FeatureTest",{enumerable:!0,get:function(){return e.FeatureTest}}),Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}}),Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}}),Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return r.PDFDateString}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return e.PasswordResponses}}),Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return e.PermissionFlag}}),Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return r.PixelsPerInch}}),Object.defineProperty(t,"PromiseCapability",{enumerable:!0,get:function(){return e.PromiseCapability}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return r.RenderingCancelledException}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return c.SVGGraphics}}),Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return e.UnexpectedResponseException}}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return e.Util}}),Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return e.VerbosityLevel}}),Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return d.XfaLayer}}),Object.defineProperty(t,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return e.createValidAbsoluteUrl}}),Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return r.getFilenameFromUrl}}),Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return r.getPdfFilenameFromUrl}}),Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return r.getXfaPageViewport}}),Object.defineProperty(t,"isDataScheme",{enumerable:!0,get:function(){return r.isDataScheme}}),Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return r.isPdfFile}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return r.loadScript}}),Object.defineProperty(t,"normalizeUnicode",{enumerable:!0,get:function(){return e.normalizeUnicode}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return s.renderTextLayer}}),Object.defineProperty(t,"setLayerDimensions",{enumerable:!0,get:function(){return r.setLayerDimensions}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}}),Object.defineProperty(t,"updateTextLayer",{enumerable:!0,get:function(){return s.updateTextLayer}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return n.version}});var e=__w_pdfjs_require__(1),n=__w_pdfjs_require__(138),r=__w_pdfjs_require__(142),s=__w_pdfjs_require__(161),i=__w_pdfjs_require__(162),a=__w_pdfjs_require__(141),o=__w_pdfjs_require__(165),l=__w_pdfjs_require__(149),c=__w_pdfjs_require__(168),d=__w_pdfjs_require__(167)})(),__webpack_exports__})()));