PageSourceSearch

https://app.vogelspot.de/dist/9251-5c9b82539bfbaaeff6f3.chunk.js

js vogelspot.de collected 2026-10-05 22:24:12 UTC 364,845 bytes, 2 lines download raw bytes

1/*! For license information please see 9251-5c9b82539bfbaaeff6f3.chunk.js.LICENSE.txt */
2(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[9251],{3889(t,e,n){"use strict";n.d(e,{A:()=>c});var s=n(31601),a=n.n(s),o=n(76314),l=n.n(o)()(a());l.push([t.id,"/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n:root {\n  --react-pdf-annotation-layer: 1;\n  --annotation-unfocused-field-background: url(\"data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>\");\n  --input-focus-border-color: Highlight;\n  --input-focus-outline: 1px solid Canvas;\n  --input-unfocused-border-color: transparent;\n  --input-disabled-border-color: transparent;\n  --input-hover-border-color: black;\n  --link-outline: none;\n}\n\n@media screen and (forced-colors: active) {\n  :root {\n    --input-focus-border-color: CanvasText;\n    --input-unfocused-border-color: ActiveText;\n    --input-disabled-border-color: GrayText;\n    --input-hover-border-color: Highlight;\n    --link-outline: 1.5px solid LinkText;\n  }\n  .annotationLayer .textWidgetAnnotation :is(input, textarea):required,\n  .annotationLayer .choiceWidgetAnnotation select:required,\n  .annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required {\n    outline: 1.5px solid selectedItem;\n  }\n\n  .annotationLayer .linkAnnotation:hover {\n    backdrop-filter: invert(100%);\n  }\n}\n\n.annotationLayer {\n  position: absolute;\n  top: 0;\n  left: 0;\n  pointer-events: none;\n  transform-origin: 0 0;\n  z-index: 3;\n}\n\n.annotationLayer[data-main-rotation='90'] .norotate {\n  transform: rotate(270deg) translateX(-100%);\n}\n.annotationLayer[data-main-rotation='180'] .norotate {\n  transform: rotate(180deg) translate(-100%, -100%);\n}\n.annotationLayer[data-main-rotation='270'] .norotate {\n  transform: rotate(90deg) translateY(-100%);\n}\n\n.annotationLayer canvas {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n}\n\n.annotationLayer section {\n  position: absolute;\n  text-align: initial;\n  pointer-events: auto;\n  box-sizing: border-box;\n  margin: 0;\n  transform-origin: 0 0;\n}\n\n.annotationLayer .linkAnnotation {\n  outline: var(--link-outline);\n}\n\n.annotationLayer :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a {\n  position: absolute;\n  font-size: 1em;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n}\n\n.annotationLayer :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a:hover {\n  opacity: 0.2;\n  background: rgba(255, 255, 0, 1);\n  box-shadow: 0 2px 10px rgba(255, 255, 0, 1);\n}\n\n.annotationLayer .textAnnotation img {\n  position: absolute;\n  cursor: pointer;\n  width: 100%;\n  height: 100%;\n  top: 0;\n  left: 0;\n}\n\n.annotationLayer .textWidgetAnnotation :is(input, textarea),\n.annotationLayer .choiceWidgetAnnotation select,\n.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {\n  background-image: var(--annotation-unfocused-field-background);\n  border: 2px solid var(--input-unfocused-border-color);\n  box-sizing: border-box;\n  font: calc(9px * var(--scale-factor)) sans-serif;\n  height: 100%;\n  margin: 0;\n  vertical-align: top;\n  width: 100%;\n}\n\n.annotationLayer .textWidgetAnnotation :is(input, textarea):required,\n.annotationLayer .choiceWidgetAnnotation select:required,\n.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required {\n  outline: 1.5px solid red;\n}\n\n.annotationLayer .choiceWidgetAnnotation select option {\n  padding: 0;\n}\n\n.annotationLayer .buttonWidgetAnnotation.radioButton input {\n  border-radius: 50%;\n}\n\n.annotationLayer .textWidgetAnnotation textarea {\n  resize: none;\n}\n\n.annotationLayer .textWidgetAnnotation :is(input, textarea)[disabled],\n.annotationLayer .choiceWidgetAnnotation select[disabled],\n.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input[disabled] {\n  background: none;\n  border: 2px solid var(--input-disabled-border-color);
2\n  cursor: not-allowed;\n}\n\n.annotationLayer .textWidgetAnnotation :is(input, textarea):hover,\n.annotationLayer .choiceWidgetAnnotation select:hover,\n.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:hover {\n  border: 2px solid var(--input-hover-border-color);\n}\n.annotationLayer .textWidgetAnnotation :is(input, textarea):hover,\n.annotationLayer .choiceWidgetAnnotation select:hover,\n.annotationLayer .buttonWidgetAnnotation.checkBox input:hover {\n  border-radius: 2px;\n}\n\n.annotationLayer .textWidgetAnnotation :is(input, textarea):focus,\n.annotationLayer .choiceWidgetAnnotation select:focus {\n  background: none;\n  border: 2px solid var(--input-focus-border-color);\n  border-radius: 2px;\n  outline: var(--input-focus-outline);\n}\n\n.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) :focus {\n  background-image: none;\n  background-color: transparent;\n}\n\n.annotationLayer .buttonWidgetAnnotation.checkBox :focus {\n  border: 2px solid var(--input-focus-border-color);\n  border-radius: 2px;\n  outline: var(--input-focus-outline);\n}\n\n.annotationLayer .buttonWidgetAnnotation.radioButton :focus {\n  border: 2px solid var(--input-focus-border-color);\n  outline: var(--input-focus-outline);\n}\n\n.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before,\n.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after,\n.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before {\n  background-color: CanvasText;\n  content: '';\n  display: block;\n  position: absolute;\n}\n\n.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before,\n.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after {\n  height: 80%;\n  left: 45%;\n  width: 1px;\n}\n\n.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before {\n  transform: rotate(45deg);\n}\n\n.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after {\n  transform: rotate(-45deg);\n}\n\n.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before {\n  border-radius: 50%;\n  height: 50%;\n  left: 30%;\n  top: 20%;\n  width: 50%;\n}\n\n.annotationLayer .textWidgetAnnotation input.comb {\n  font-family: monospace;\n  padding-left: 2px;\n  padding-right: 0;\n}\n\n.annotationLayer .textWidgetAnnotation input.comb:focus {\n  /*\n   * Letter spacing is placed on the right side of each character. Hence, the\n   * letter spacing of the last character may be placed outside the visible\n   * area, causing horizontal scrolling. We avoid this by extending the width\n   * when the element has focus and revert this when it loses focus.\n   */\n  width: 103%;\n}\n\n.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {\n  appearance: none;\n}\n\n.annotationLayer .popupTriggerArea {\n  height: 100%;\n  width: 100%;\n}\n\n.annotationLayer .fileAttachmentAnnotation .popupTriggerArea {\n  position: absolute;\n}\n\n.annotationLayer .popupWrapper {\n  position: absolute;\n  font-size: calc(9px * var(--scale-factor));\n  width: 100%;\n  min-width: calc(180px * var(--scale-factor));\n  pointer-events: none;\n}\n\n.annotationLayer .popup {\n  position: absolute;\n  max-width: calc(180px * var(--scale-factor));\n  background-color: rgba(255, 255, 153, 1);\n  box-shadow: 0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor))\n    rgba(136, 136, 136, 1);\n  border-radius: calc(2px * var(--scale-factor));\n  padding: calc(6px * var(--scale-factor));\n  margin-left: calc(5px * var(--scale-factor));\n  cursor: pointer;\n  font: message-box;\n  white-space: normal;\n  word-wrap: break-word;\n  pointer-events: auto;\n}\n\n.annotationLayer .popup > * {\n  font-size: calc(9px * var(--scale-factor));\n}\n\n.annotationLayer .popup h1 {\n  display: inline-block;\n}\n\n.annotationLayer .popupDate {\n  display: inline-block;\n  margin-left: calc(5px * var(--scale-factor));\n}\n\n.annotationLayer .popupContent {\n  border-top: 1px solid rgba(51, 51, 51, 1);\n  margin-top: calc(2px * var(--scale-factor));\n  padding-top: calc(2px * var(--scale-factor));\n}\n\n.annotationLayer .richText > * {\n  white-space: pre-wrap;\n  font-size: calc(9px * var(--scale-factor));\n}\n\n.annotationLayer .highlightAnnotation,\n.annotationLayer .underlineAnnotation,\n.annotationLayer .squigglyAnnotation,\n.annotationLayer .strikeoutAnnotation,\n.annotationLayer .freeTextAnnotation,\n.annotationLayer .lineAnnotation svg line,\n.annotationLayer .squareAnnotation svg rect,\n.annotationLayer .circleAnnotation svg ellipse,\n.annotationLayer .polylineAnnotation svg polyline,\n.annotationLayer .polygonAnnotation svg polygon,\n.annotationLayer .caretAnnotation,\n.annotationLayer .inkAnnotation svg polyline,\n.annotationLayer .stampAnnotation,\n.annotationLayer .fileAttachmentAnnotation {\n  cursor: pointer;\n}\n\n.annotationLayer section svg {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  top: 0;\n  left: 0;\n}\n\n.annotationLayer .annotationTextContent {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  opacity: 0;\n  color: transparent;\n  user-select: none;\n  pointer-events: none;\n}\n\n.annotationLayer .annotationTextContent span {\n  width: 100%;\n  display: inline-block;\n}\n",""]);const c=l},38815(t,e,n){"use strict";n.d(e,{A:()=>c});var s=n(31601),a=n.n(s),o=n(76314),l=n.n(o)()(a());
2l.push([t.id,"/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n:root {\n  --react-pdf-text-layer: 1;\n  --highlight-bg-color: rgba(180, 0, 170, 1);\n  --highlight-selected-bg-color: rgba(0, 100, 0, 1);\n}\n\n@media screen and (forced-colors: active) {\n  :root {\n    --highlight-bg-color: Highlight;\n    --highlight-selected-bg-color: ButtonText;\n  }\n}\n\n[data-main-rotation='90'] {\n  transform: rotate(90deg) translateY(-100%);\n}\n[data-main-rotation='180'] {\n  transform: rotate(180deg) translate(-100%, -100%);\n}\n[data-main-rotation='270'] {\n  transform: rotate(270deg) translateX(-100%);\n}\n\n.textLayer {\n  position: absolute;\n  text-align: initial;\n  inset: 0;\n  overflow: hidden;\n  line-height: 1;\n  text-size-adjust: none;\n  forced-color-adjust: none;\n  transform-origin: 0 0;\n  z-index: 2;\n}\n\n.textLayer :is(span, br) {\n  color: transparent;\n  position: absolute;\n  white-space: pre;\n  cursor: text;\n  margin: 0;\n  transform-origin: 0 0;\n}\n\n/* Only necessary in Google Chrome, see issue 14205, and most unfortunately\n * the problem doesn't show up in \"text\" reference tests. */\n.textLayer span.markedContent {\n  top: 0;\n  height: 0;\n}\n\n.textLayer .highlight {\n  margin: -1px;\n  padding: 1px;\n  background-color: var(--highlight-bg-color);\n  border-radius: 4px;\n}\n\n.textLayer .highlight.appended {\n  position: initial;\n}\n\n.textLayer .highlight.begin {\n  border-radius: 4px 0 0 4px;\n}\n\n.textLayer .highlight.end {\n  border-radius: 0 4px 4px 0;\n}\n\n.textLayer .highlight.middle {\n  border-radius: 0;\n}\n\n.textLayer .highlight.selected {\n  background-color: var(--highlight-selected-bg-color);\n}\n\n/* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */\n.textLayer br::selection {\n  background: transparent;\n}\n\n.textLayer .endOfContent {\n  display: block;\n  position: absolute;\n  inset: 100% 0 0;\n  z-index: -1;\n  cursor: default;\n  user-select: none;\n}\n\n.textLayer .endOfContent.active {\n  top: 0;\n}\n",""]);const c=l},76314(t){"use strict";t.exports=function(t){var e=[];return e.toString=function toString(){return this.map(function(e){var n="",s="undefined"!==typeof e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),s&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),s&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n}).join("")},e.i=function i(t,n,s,a,o){"string"===typeof t&&(t=[[null,t,void 0]]);var l={};if(s)for(var c=0;c<this.length;c++){var d=this[c][0];null!=d&&(l[d]=!0)}for(var h=0;h<t.length;h++){var u=[].concat(t[h]);s&&l[u[0]]||("undefined"!==typeof o&&("undefined"===typeof u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),a&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=a):u[4]="".concat(a)),e.push(u))}},e}},31601(t){"use strict";t.exports=function(t){return t[1]}},80748(module,__unused_webpack_exports,__webpack_require__){var Buffer=__webpack_require__(48287).hp;!function webpackUniversalModuleDefinition(t,e){module.exports=t.pdfjsLib=e()}(globalThis,()=>(()=>{"use strict";var __webpack_modules__=[,(t,e)=>{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.AnnotationReplyType=e.AnnotationPrefix=e.AnnotationMode=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=bytesToString,e.createValidAbsoluteUrl=function createValidAbsoluteUrl(t,e=null,n=null){if(!t)return null;try{if(n&&"string"===typeof t){if(n.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(n.tryConvertEncoding)try{t=stringToUTF8String(t)}catch{}}const s=e?new URL(t,e):new URL(t);if(function _isValidProtocol(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(s))return s}catch{}return null},e.getModificationDate=function getModificationDate(t=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.getUuid=function getUuid(){if("undefined"!==typeof crypto&&"function"===typeof crypto?.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof crypto?.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(255*Math.random());return bytesToString(t)},e.getVerbosityLevel=function getVerbosityLevel(){return o}
2,e.info=function info(t){o>=a.INFOS&&console.log(`Info: ${t}`)},e.isArrayBuffer=function isArrayBuffer(t){return"object"===typeof t&&void 0!==t?.byteLength},e.isArrayEqual=function isArrayEqual(t,e){if(t.length!==e.length)return!1;for(let n=0,s=t.length;n<s;n++)if(t[n]!==e[n])return!1;return!0},e.isNodeJS=void 0,e.normalizeUnicode=function normalizeUnicode(t){h||(h=/([\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,u=new Map([["\ufb05","\u017ft"]]));return t.replaceAll(h,(t,e,n)=>e?e.normalize("NFKC"):u.get(n))},e.objectFromMap=function objectFromMap(t){const e=Object.create(null);for(const[n,s]of t)e[n]=s;return e},e.objectSize=function objectSize(t){return Object.keys(t).length},e.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(o=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]>="\xef"){let e;if("\xfe"===t[0]&&"\xff"===t[1]?e="utf-16be":"\xff"===t[0]&&"\xfe"===t[1]?e="utf-16le":"\xef"===t[0]&&"\xbb"===t[1]&&"\xbf"===t[2]&&(e="utf-8"),e)try{const n=new TextDecoder(e,{fatal:!0}),s=stringToBytes(t);return n.decode(s)}catch(n){warn(`stringToPDFString: "${n}".`)}}const e=[];for(let s=0,a=t.length;s<a;s++){const n=d[t.charCodeAt(s)];e.push(n?String.fromCharCode(n):t.charAt(s))}return e.join("")},e.stringToUTF8String=stringToUTF8String,e.unreachable=unreachable,e.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))},e.warn=warn;const n="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=n;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;const s=.35/1.35;e.BASELINE_FACTOR=s;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,STAMP:13,INK:15};e.AnnotationEditorParamsType={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};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.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 a={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=a;e.CMapCompressionType={NONE:0,BINARY:1};
2e.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 o=a.WARNINGS;function warn(t){o>=a.WARNINGS&&console.log(`Warning: ${t}`)}function unreachable(t){throw new Error(t)}function shadow(t,e,n,s=!1){return Object.defineProperty(t,e,{value:n,enumerable:!s,configurable:!0,writable:!1}),n}const l=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=l;e.PasswordException=class PasswordException extends l{constructor(t,e){super(t,"PasswordException"),this.code=e}};e.UnknownErrorException=class UnknownErrorException extends l{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}};e.InvalidPDFException=class InvalidPDFException extends l{constructor(t){super(t,"InvalidPDFException")}};e.MissingPDFException=class MissingPDFException extends l{constructor(t){super(t,"MissingPDFException")}};e.UnexpectedResponseException=class UnexpectedResponseException extends l{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}};e.FormatError=class FormatError extends l{constructor(t){super(t,"FormatError")}};function bytesToString(t){"object"===typeof 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 s=[];for(let a=0;a<e;a+=n){const o=Math.min(a+n,e),l=t.subarray(a,o);s.push(String.fromCharCode.apply(null,l))}return s.join("")}function stringToBytes(t){"string"!==typeof t&&unreachable("Invalid argument for stringToBytes");const e=t.length,n=new Uint8Array(e);for(let s=0;s<e;++s)n[s]=255&t.charCodeAt(s);return n}e.AbortException=class AbortException extends l{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{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")})}static get isCSSRoundSupported(){return shadow(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}};const c=[...Array(256).keys()].map(t=>t.toString(16).padStart(2,"0"));e.Util=class Util{static makeHexColor(t,e,n){return`#${c[t]}${c[e]}${c[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=this.applyTransform(t,e),s=this.applyTransform(t.slice(2,4),e),a=this.applyTransform([t[0],t[3]],e),o=this.applyTransform([t[2],t[1]],e);return[Math.min(n[0],s[0],a[0],o[0]),Math.min(n[1],s[1],a[1],o[1]),Math.max(n[0],s[0],a[0],o[0]),Math.max(n[1],s[1],a[1],o[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],s=t[0]*e[1]+t[1]*e[3],a=t[2]*e[0]+t[3]*e[2],o=t[2]*e[1]+t[3]*e[3],l=(n+o)/2,c=Math.sqrt((n+o)**2-4*(n*o-a*s))/2,d=l+c||1,h=l-c||1;return[Math.sqrt(d),Math.sqrt(h)]}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])),s=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(n>s)return null;const a=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),o=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return a>o?null:[n,a,s,o]}static bezierBoundingBox(t,e,n,s,a,o,l,c){const d=[],h=[[],[]];let u,p,g,m,f,b,A,v;for(let x=0;x<2;++x)if(0===x?(p=6*t-12*n+6*a,u=-3*t+9*n-9*a+3*l,g=3*n-3*t):(p=6*e-12*s+6*o,u=-3*e+9*s-9*o+3*c,g=3*s-3*e),Math.abs(u)<1e-12){if(Math.abs(p)<1e-12)continue;m=-g/p,0<m&&m<1&&d.push(m)}else A=p*p-4*g*u,v=Math.sqrt(A),A<0||(f=(-p+v)/(2*u),0<f&&f<1&&d.push(f),b=(-p-v)/(2*u),0<b&&b<1&&d.push(b));let y,_=d.length;const S=_;for(;_--;)m=d[_],y=1-m,h[0][_]=y*y*y*t+3*y*y*m*n+3*y*m*m*a+m*m*m*l,h[1][_]=y*y*y*e+3*y*y*m*s+3*y*m*m*o+m*m*m*c;return h[0][S]=t,h[1][S]=e,h[0][S+1]=l,h[1][S+1]=c,h[0].length=h[1].length=S+2,[Math.min(...h[0]),Math.min(...h[1]),Math.max(...h[0]),Math.max(...h[1])]}};const d=[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 h=null,u=null;e.AnnotationPrefix="pdfjs_internal_id_"},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),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,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_c
2anvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;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,s=t.url?getUrlProp(t.url):null,a=t.data?getDataProp(t.data):null,o=t.httpHeaders||null,l=!0===t.withCredentials,c=t.password??null,d=t.range instanceof PDFDataRangeTransport?t.range:null,h=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let u=t.worker instanceof PDFWorker?t.worker:null;const p=t.verbosity,g="string"!==typeof t.docBaseUrl||(0,_display_utils.isDataScheme)(t.docBaseUrl)?null:t.docBaseUrl,m="string"===typeof t.cMapUrl?t.cMapUrl:null,f=!1!==t.cMapPacked,b=t.CMapReaderFactory||DefaultCMapReaderFactory,A="string"===typeof t.standardFontDataUrl?t.standardFontDataUrl:null,v=t.StandardFontDataFactory||DefaultStandardFontDataFactory,y=!0!==t.stopAtErrors,_=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,S=!1!==t.isEvalSupported,x="boolean"===typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!_util.isNodeJS,E=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,w="boolean"===typeof t.disableFontFace?t.disableFontFace:_util.isNodeJS,C=!0===t.fontExtraProperties,T=!0===t.enableXfa,P=t.ownerDocument||globalThis.document,k=!0===t.disableRange,M=!0===t.disableStream,R=!0===t.disableAutoFetch,F=!0===t.pdfBug,D=d?d.length:t.length??NaN,I="boolean"===typeof t.useSystemFonts?t.useSystemFonts:!_util.isNodeJS&&!w,L="boolean"===typeof t.useWorkerFetch?t.useWorkerFetch:b===_display_utils.DOMCMapReaderFactory&&v===_display_utils.DOMStandardFontDataFactory&&m&&A&&(0,_display_utils.isValidFetchUrl)(m,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(A,document.baseURI),O=t.canvasFactory||new DefaultCanvasFactory({ownerDocument:P}),N=t.filterFactory||new DefaultFilterFactory({docId:n,ownerDocument:P});(0,_util.setVerbosityLevel)(p);const B={canvasFactory:O,filterFactory:N};if(L||(B.cMapReaderFactory=new b({baseUrl:m,isCompressed:f}),B.standardFontDataFactory=new v({baseUrl:A})),!u){const t={verbosity:p,port:_worker_options.GlobalWorkerOptions.workerPort};u=t.port?PDFWorker.fromPort(t):new PDFWorker(t),e._worker=u}const j={docId:n,apiVersion:"3.11.174",data:a,password:c,disableAutoFetch:R,rangeChunkSize:h,length:D,docBaseUrl:g,enableXfa:T,evaluatorOptions:{maxImageSize:_,disableFontFace:w,ignoreErrors:y,isEvalSupported:S,isOffscreenCanvasSupported:x,canvasMaxAreaInBytes:E,fontExtraProperties:C,useSystemFonts:I,cMapUrl:L?m:null,standardFontDataUrl:L?A:null}},U={ignoreErrors:y,isEvalSupported:S,disableFontFace:w,fontExtraProperties:C,enableXfa:T,ownerDocument:P,disableAutoFetch:R,pdfBug:F,styleElement:null};return u.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");const t=_fetchDocument(u,j),c=new Promise(function(t){let e;if(d)e=new _transport_stream.PDFDataTransportStream({length:D,initialData:d.initialData,progressiveDone:d.progressiveDone,contentDispositionFilename:d.contentDispositionFilename,disableRange:k,disableStream:M},d);else if(!a){e=(t=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(t):(0,_display_utils.isValidFetchUrl)(t.url)?new _displayFetch_stream.PDFFetchStream(t):new _displayNetwork.PDFNetworkStream(t))({url:s,length:D,httpHeaders:o,withCredentials:l,rangeChunkSize:h,disableRange:k,disableStream:M})}t(e)});return Promise.all([t,c]).then(function([t,s]){if(e.destroyed)throw new Error("Loading aborted");const a=new _message_handler.MessageHandler(n,t,u.port),o=new WorkerTransport(a,e,s,U,B);e._transport=o,a.send("Ready",null)})}).catch(e._capability.reject),e}async function _fetchDocument(t,e){if(t.destroyed)throw new Error("Worker was destroyed");
2const 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{if(_util.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(_util.isNodeJS&&"undefined"!==typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");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(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.")}exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;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(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await(this._transport?.destroy())}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(t,e,n=!1,s=null){this.length=t,this.initialData=e,this.progressiveDone=n,this.contentDispositionFilename=s,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,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(t=>{if(!t)return t;const e=[];for(const n in t)e.push(...t[n]);return 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()}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(t=!1){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;#i=!1;constructor(t,e,n,s=!1){this._pageIndex=t,this._pageInfo=e,this._transport=n,this._stats=s?new _display_utils.StatTimer:null,this._pdfBug=s,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({scale:t,rotation:e=this.rotate,offsetX:n=0,offsetY:s=0,dontFlip:a=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:n,offsetY:s,dontFlip:a})}getAnnotations({intent:t="display"}={}
2){const e=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:e,intent:n="display",annotationMode:s=_util.AnnotationMode.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:c=null,pageColors:d=null,printAnnotationStorage:h=null}){this._stats?.time("Overall");const u=this._transport.getRenderingIntent(n,s,h);this.#i=!1,this.#s(),l||(l=this._transport.getOptionalContentConfig());let p=this._intentStates.get(u.cacheKey);p||(p=Object.create(null),this._intentStates.set(u.cacheKey,p)),p.streamReaderCancelTimeout&&(clearTimeout(p.streamReaderCancelTimeout),p.streamReaderCancelTimeout=null);const g=!!(u.renderingIntent&_util.RenderingIntentFlag.PRINT);p.displayReadyCapability||(p.displayReadyCapability=new _util.PromiseCapability,p.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(u));const complete=t=>{p.renderTasks.delete(m),(this._maybeCleanupAfterRender||g)&&(this.#i=!0),this.#r(!g),t?(m.capability.reject(t),this._abortOperatorList({intentState:p,reason:t instanceof Error?t:new Error(t)})):m.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")},m=new InternalRenderTask({callback:complete,params:{canvasContext:t,viewport:e,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:p.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!g,pdfBug:this._pdfBug,pageColors:d});(p.renderTasks||=new Set).add(m);const f=m.task;return Promise.all([p.displayReadyCapability.promise,l]).then(([t,e])=>{this.destroyed?complete():(this._stats?.time("Rendering"),m.initializeGraphics({transparency:t,optionalContentConfig:e}),m.operatorListChanged())}).catch(complete),f}getOperatorList({intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:n=null}={}){const s=this._transport.getRenderingIntent(t,e,n,!0);let a,o=this._intentStates.get(s.cacheKey);return o||(o=Object.create(null),this._intentStates.set(s.cacheKey,o)),o.opListReadCapability||(a=Object.create(null),a.operatorListChanged=function operatorListChanged(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(a))},o.opListReadCapability=new _util.PromiseCapability,(o.renderTasks||=new Set).add(a),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(s)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(t={}){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 s=e.getReader(),a={items:[],styles:Object.create(null)};!function pump(){s.read().then(function({value:e,done:n}){n?t(a):(Object.assign(a.styles,e.styles),a.items.push(...e.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.#i=!1,this.#s(),Promise.all(t)}cleanup(t=!1){this.#i=!0;const e=this.#r(!1);
2return t&&e&&(this._stats&&=new _display_utils.StatTimer),e}#r(t=!1){if(this.#s(),!this.#i||this.destroyed)return!1;if(t)return this.#n=setTimeout(()=>{this.#n=null,this.#r(!1)},DELAYED_CLEANUP_TIMEOUT),!1;for(const{renderTasks:e,operatorList:n}of this._intentStates.values())if(e.size>0||!n.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#i=!1,!0}#s(){this.#n&&(clearTimeout(this.#n),this.#n=null)}_startRenderPage(t,e){const n=this._intentStates.get(e);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let n=0,s=t.length;n<s;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 n of e.renderTasks)n.operatorListChanged();t.lastChunk&&this.#r(!0)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:n}){const{map:s,transfers:a}=n,o=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:s},a).getReader(),l=this._intentStates.get(e);l.streamReader=o;const pump=()=>{o.read().then(({value:t,done:e})=>{e?l.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,l),pump())},t=>{if(l.streamReader=null,!this._transport.destroyed){if(l.operatorList){l.operatorList.lastChunk=!0;for(const t of l.renderTasks)t.operatorListChanged();this.#r(!0)}if(l.displayReadyCapability)l.displayReadyCapability.reject(t);else{if(!l.opListReadCapability)throw t;l.opListReadCapability.reject(t)}}})};pump()}_abortOperatorList({intentState:t,reason:e,force:n=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!n){if(t.renderTasks.size>0)return;if(e instanceof _display_utils.RenderingCancelledException){let n=RENDERING_CANCELLED_TIMEOUT;return e.extraDelay>0&&e.extraDelay<1e3&&(n+=e.extraDelay),void(t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},n))}}if(t.streamReader.cancel(new _util.AbortException(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[e,n]of this._intentStates)if(n===t){this._intentStates.delete(e);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,e?{transfer:e}: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,_util.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"===typeof document){const t=document?.currentScript?.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{return!1}const s=new URL(e,n);return n.origin===s.origin},PDFWorkerUtil.createCDNWrapper=function(t){const e=`importScripts("${t}");`;return URL.createObjectURL(new Blob([e]))};class PDFWorker{static#l;constructor({name:t=null,port:e=null,verbosity:n=(0,_util.getVerbosityLevel)()}={}){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){if(PDFWorker.#l?.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(PDFWorker.#l||=new WeakMap).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{this._setupFakeWorker()}});const sendTest=()=>{const t=new Uint8Array;n.send("test",t,[t.buffer])};return void sendTest()}catch{(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++,s=new _message_handler.MessageHandler(n+"_worker",n,e);t.setup(s,e);const a=new _message_handler.MessageHandler(n,n+"_worker",e);this._messageHandler=a,this._readyCapability.resolve(),a.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(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const e=this.#l?.get(t.port);
2if(e){if(e._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS){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;#u=null;constructor(t,e,n,s,a){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:s.ownerDocument,styleElement:s.styleElement}),this._params=s,this.canvasFactory=a.canvasFactory,this.filterFactory=a.filterFactory,this.cMapReaderFactory=a.cMapReaderFactory,this.standardFontDataFactory=a.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}#p(t,e=null){const n=this.#c.get(t);if(n)return n;const s=this.messageHandler.sendWithPromise(t,e);return this.#c.set(t,s),s}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(t,e=_util.AnnotationMode.ENABLE,n=null,s=!1){let a=_util.RenderingIntentFlag.DISPLAY,o=_annotation_storage.SerializableEmpty;switch(t){case"any":a=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":a=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case _util.AnnotationMode.DISABLE:a+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:a+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:a+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE;o=(a&_util.RenderingIntentFlag.PRINT&&n instanceof _annotation_storage.PrintAnnotationStorage?n:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${e}`)}return s&&(a+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:a,cacheKey:`${a}_${o.hash}`,annotationStorageSerializable:o}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this.#u?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const n of this.#d.values())t.push(n._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?.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({value:t,done:n}){n?e.close():((0,_util.assert)(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))}).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,s=this._fullReader;return s.headersReady.then(()=>{s.isStreamingSupported&&s.isRangeSupported||(this._lastProgress&&e.onProgress?.(this._lastProgress),s.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}),n.resolve({isStreamingSupported:s.isStreamingSupported,isRangeSupported:s.isRangeSupported,contentLength:s.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({value:t,done:n}){n?e.close():((0,_util.assert)(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))}).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",({pdfInfo:t})=>{this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,e._capability.resolve(new PDFDocumentProxy(t,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)}
2),t.on("PasswordRequest",t=>{if(this.#u=new _util.PromiseCapability,e.onPassword){const updatePassword=t=>{t instanceof Error?this.#u.reject(t):this.#u.resolve({password:t})};try{e.onPassword(updatePassword,t.code)}catch(n){this.#u.reject(n)}}else this.#u.reject(new _util.PasswordException(t.message,t.code));return this.#u.promise}),t.on("DataLoaded",t=>{e.onProgress?.({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,n,s])=>{if(!this.destroyed&&!this.commonObjs.has(e))switch(n){case"Font":const a=this._params;if("error"in s){const t=s.error;(0,_util.warn)(`Error during font loading: ${t}`),this.commonObjs.resolve(e,t);break}const o=a.pdfBug&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,l=new _font_loader.FontFaceObject(s,{isEvalSupported:a.isEvalSupported,disableFontFace:a.disableFontFace,ignoreErrors:a.ignoreErrors,inspectFont:o});this.fontLoader.bind(l).catch(n=>t.sendWithPromise("FontFallback",{id:e})).finally(()=>{!a.fontExtraProperties&&l.data&&(l.data=null),this.commonObjs.resolve(e,l)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(e,s);break;default:throw new Error(`Got unknown common object type ${n}`)}}),t.on("obj",([t,e,n,s])=>{if(this.destroyed)return;const a=this.#d.get(e);if(!a.objs.has(t))switch(n){case"Image":if(a.objs.resolve(t,s),s){let t;if(s.bitmap){const{width:e,height:n}=s;t=e*n*4}else t=s.data?.length||0;t>_util.MAX_IMAGE_SIZE_TO_CACHE&&(a._maybeCleanupAfterRender=!0)}break;case"Pattern":a.objs.resolve(t,s);break;default:throw new Error(`Got unknown object type ${n}`)}}),t.on("DocProgress",t=>{this.destroyed||e.onProgress?.({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(){this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfers:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).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 s=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,s),s}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.#p("GetFieldObjects")}hasJSActions(){return this.#p("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})}
2getPageLabels(){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)}getDocJSActions(){return this.#p("GetDocJSActions")}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=>({info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#c.set(t,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){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{#g=Object.create(null);#m(t){return this.#g[t]||={capability:new _util.PromiseCapability,data:null}}get(t,e=null){if(e){const n=this.#m(t);return n.capability.promise.then(()=>e(n.data)),null}const n=this.#g[t];if(!n?.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return n.data}has(t){const e=this.#g[t];return e?.capability.settled||!1}resolve(t,e=null){const n=this.#m(t);n.data=e,n.capability.resolve()}clear(){for(const t in this.#g){const{data:e}=this.#g[t];e?.bitmap?.close()}this.#g=Object.create(null)}}class RenderTask{#f=null;constructor(t){this.#f=t,this.onContinue=null}get promise(){return this.#f.capability.promise}cancel(t=0){this.#f.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#f.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#f;return t.form||t.canvas&&e?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static#b=new WeakSet;constructor({callback:t,params:e,objs:n,commonObjs:s,annotationCanvasMap:a,operatorList:o,pageIndex:l,canvasFactory:c,filterFactory:d,useRequestAnimationFrame:h=!1,pdfBug:u=!1,pageColors:p=null}){this.callback=t,this.params=e,this.objs=n,this.commonObjs=s,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=o,this._pageIndex=l,this.canvasFactory=c,this.filterFactory=d,this._pdfBug=u,this.pageColors=p,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===h&&"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=e.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#b.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.#b.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:s,transform:a,background:o}=this.params;this.gfx=new _canvas.CanvasGraphics(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:a,viewport:s,transparency:t,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,e=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),InternalRenderTask.#b.delete(this._canvas),this.callback(t||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,e))}operatorListChanged(){this.graphicsReady?(this.stepper?.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)}
2):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(),InternalRenderTask.#b.delete(this._canvas),this.callback())))}}const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SerializableEmpty=e.PrintAnnotationStorage=e.AnnotationStorage=void 0;var s=n(1),a=n(4),o=n(8);const l=Object.freeze({map:null,hash:"",transfers:void 0});e.SerializableEmpty=l;class AnnotationStorage{#A=!1;#v=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const n=this.#v.get(t);return void 0===n?e:Object.assign(e,n)}getRawValue(t){return this.#v.get(t)}remove(t){if(this.#v.delete(t),0===this.#v.size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const t of this.#v.values())if(t instanceof a.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){const n=this.#v.get(t);let s=!1;if(void 0!==n)for(const[a,o]of Object.entries(e))n[a]!==o&&(s=!0,n[a]=o);else s=!0,this.#v.set(t,e);s&&this.#y(),e instanceof a.AnnotationEditor&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#v.has(t)}getAll(){return this.#v.size>0?(0,s.objectFromMap)(this.#v):null}setAll(t){for(const[e,n]of Object.entries(t))this.setValue(e,n)}get size(){return this.#v.size}#y(){this.#A||(this.#A=!0,"function"===typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#A&&(this.#A=!1,"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===this.#v.size)return l;const t=new Map,e=new o.MurmurHash3_64,n=[],s=Object.create(null);let c=!1;for(const[o,l]of this.#v){const n=l instanceof a.AnnotationEditor?l.serialize(!1,s):l;n&&(t.set(o,n),e.update(`${o}:${JSON.stringify(n)}`),c||=!!n.bitmap)}if(c)for(const a of t.values())a.bitmap&&n.push(a.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfers:n}:l}}e.AnnotationStorage=AnnotationStorage;class PrintAnnotationStorage extends AnnotationStorage{#_;constructor(t){super();const{map:e,hash:n,transfers:s}=t.serializable,a=structuredClone(e,s?{transfer:s}:null);this.#_={map:a,hash:n,transfers:s}}get print(){(0,s.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#_}}e.PrintAnnotationStorage=PrintAnnotationStorage},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditor=void 0;var s=n(5),a=n(1),o=n(6);class AnnotationEditor{#S="";#x=!1;#E=null;#w=null;#C=null;#T=!1;#P=null;#k=this.focusin.bind(this);#M=this.focusout.bind(this);#R=!1;#F=!1;#D=!1;_initialOptions=Object.create(null);_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#I=!1;#L=AnnotationEditor._zIndex++;static _borderLineWidth=-1;static _colorManager=new s.ColorManager;static _zIndex=1;static SMALL_EDITOR_SIZE=0;constructor(t){this.constructor===AnnotationEditor&&(0,a.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,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:e,rawDims:{pageWidth:n,pageHeight:s,pageX:o,pageY:l}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,s],this.pageTranslation=[o,l];const[c,d]=this.parentDimensions;this.x=t.x/c,this.y=t.y/d,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,a.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new FakeEditor({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e=null){if(AnnotationEditor._l10nPromise||=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(e=>[e,t.get(e)])),e?.strings)for(const s of e.strings)AnnotationEditor._l10nPromise.set(s,t.get(s));if(-1!==AnnotationEditor._borderLineWidth)return;const n=getComputedStyle(document.documentElement);AnnotationEditor._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){(0,a.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#I}set _isDraggable(t){this.#I=t,this.div?.classList.toggle("draggable",t)}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}
2setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#L}setParent(t){null!==t&&(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#R?this.#R=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const e=t.relatedTarget;e?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,n,s){const[a,o]=this.parentDimensions;[n,s]=this.screenToPageTranslation(n,s),this.x=(t+n)/a,this.y=(e+s)/o,this.fixAndSetPosition()}#O([t,e],n,s){[n,s]=this.screenToPageTranslation(n,s),this.x+=n/t,this.y+=s/e,this.fixAndSetPosition()}translate(t,e){this.#O(this.parentDimensions,t,e)}translateInPage(t,e){this.#O(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){const[n,s]=this.parentDimensions;if(this.x+=t/n,this.y+=e/s,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this;const[l,c]=this.#N();a+=l,o+=c,this.div.style.left=`${(100*a).toFixed(2)}%`,this.div.style.top=`${(100*o).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}#N(){const[t,e]=this.parentDimensions,{_borderLineWidth:n}=AnnotationEditor,s=n/t,a=n/e;switch(this.rotation){case 90:return[-s,a];case 180:return[s,a];case 270:return[s,-a];default:return[-s,-a]}}fixAndSetPosition(){const[t,e]=this.pageDimensions;let{x:n,y:s,width:a,height:o}=this;switch(a*=t,o*=e,n*=t,s*=e,this.rotation){case 0:n=Math.max(0,Math.min(t-a,n)),s=Math.max(0,Math.min(e-o,s));break;case 90:n=Math.max(0,Math.min(t-o,n)),s=Math.min(e,Math.max(a,s));break;case 180:n=Math.min(t,Math.max(a,n)),s=Math.min(e,Math.max(o,s));break;case 270:n=Math.min(t,Math.max(o,n)),s=Math.max(0,Math.min(e-a,s))}this.x=n/=t,this.y=s/=e;const[l,c]=this.#N();n+=l,s+=c;const{style:d}=this.div;d.left=`${(100*n).toFixed(2)}%`,d.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#B(t,e,n){switch(n){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return AnnotationEditor.#B(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return AnnotationEditor.#B(t,e,360-this.parentRotation)}#j(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,n]}=this,s=e*t,o=n*t;return a.FeatureTest.isCSSRoundSupported?[Math.round(s),Math.round(o)]:[s,o]}setDims(t,e){const[n,s]=this.parentDimensions;this.div.style.width=`${(100*t/n).toFixed(2)}%`,this.#T||(this.div.style.height=`${(100*e/s).toFixed(2)}%`),this.#E?.classList.toggle("small",t<AnnotationEditor.SMALL_EDITOR_SIZE||e<AnnotationEditor.SMALL_EDITOR_SIZE)}fixDims(){const{style:t}=this.div,{height:e,width:n}=t,s=n.endsWith("%"),a=!this.#T&&e.endsWith("%");if(s&&a)return;const[o,l]=this.parentDimensions;s||(t.width=`${(100*parseFloat(n)/o).toFixed(2)}%`),this.#T||a||(t.height=`${(100*parseFloat(e)/l).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#U(){if(this.#P)return;this.#P=document.createElement("div"),this.#P.classList.add("resizers");const t=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||t.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const e of t){const t=document.createElement("div");this.#P.append(t),t.classList.add("resizer",e),t.addEventListener("pointerdown",this.#W.bind(this,e)),t.addEventListener("contextmenu",o.noContextMenu)}this.div.prepend(this.#P)}#W(t,e){e.preventDefault();const{isMac:n}=a.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&n)return;const s=this.#z.bind(this,t),o=this._isDraggable;this._isDraggable=!1;const l={passive:!0,capture:!0};window.addEventListener("pointermove",s,l);const c=this.x,d=this.y,h=this.width,u=this.height,p=this.parent.div.style.cursor,g=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const pointerUpCallback=()=>{this._isDraggable=o,window.removeEventListener("pointerup",pointerUpCallback),window.removeEventListener("blur",pointerUpCallback),window.removeEventListener("pointermove",s,l),this.parent.div.style.cursor=p,this.div.style.cursor=g;const t=this.x,e=this.y,n=this.width,a=this.height;t===c&&e===d&&n===h&&a===u||this.addCommands({cmd:()=>{this.width=n,this.height=a,this.x=t,this.y=e;const[s,o]=this.parentDimensions;this.setDims(s*n,o*a),this.fixAndSetPosition()},undo:()=>{this.width=h,this.height=u,this.x=c,this.y=d;const[t,e]=this.parentDimensions;this.setDims(t*h,e*u),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",pointerUpCallback),window.addEventListener("blur",pointerUpCallback)}#z(t,e){const[n,s]=this.parentDimensions,a=this.x,o=this.y,l=this.width,c=this.height,d=AnnotationEditor.MIN_SIZE/n,h=AnnotationEditor.MIN_SIZE/s,round=t=>Math.round(1e4*t)/1e4,u=this.#j(this.rotation),transf=(t,e)=>[u[0]*t+u[2]*e,u[1]*t+u[3]*e],p=this.#j(360-this.rotation);let g,m,f=!1,b=!1;switch(t){case"topLeft":f=!0,g=(t,e)=>
2[0,0],m=(t,e)=>[t,e];break;case"topMiddle":g=(t,e)=>[t/2,0],m=(t,e)=>[t/2,e];break;case"topRight":f=!0,g=(t,e)=>[t,0],m=(t,e)=>[0,e];break;case"middleRight":b=!0,g=(t,e)=>[t,e/2],m=(t,e)=>[0,e/2];break;case"bottomRight":f=!0,g=(t,e)=>[t,e],m=(t,e)=>[0,0];break;case"bottomMiddle":g=(t,e)=>[t/2,e],m=(t,e)=>[t/2,0];break;case"bottomLeft":f=!0,g=(t,e)=>[0,e],m=(t,e)=>[t,0];break;case"middleLeft":b=!0,g=(t,e)=>[0,e/2],m=(t,e)=>[t,e/2]}const A=g(l,c),v=m(l,c);let y=transf(...v);const _=round(a+y[0]),S=round(o+y[1]);let x=1,E=1,[w,C]=this.screenToPageTranslation(e.movementX,e.movementY);var T,P;if([w,C]=(T=w/n,P=C/s,[p[0]*T+p[2]*P,p[1]*T+p[3]*P]),f){const t=Math.hypot(l,c);x=E=Math.max(Math.min(Math.hypot(v[0]-A[0]-w,v[1]-A[1]-C)/t,1/l,1/c),d/l,h/c)}else b?x=Math.max(d,Math.min(1,Math.abs(v[0]-A[0]-w)))/l:E=Math.max(h,Math.min(1,Math.abs(v[1]-A[1]-C)))/c;const k=round(l*x),M=round(c*E);y=transf(...m(k,M));const R=_-y[0],F=S-y[1];this.width=k,this.height=M,this.x=R,this.y=F,this.setDims(n*k,s*M),this.fixAndSetPosition()}async addAltTextButton(){if(this.#E)return;const t=this.#E=document.createElement("button");t.className="altText";const e=await AnnotationEditor._l10nPromise.get("editor_alt_text_button_label");if(t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0",t.addEventListener("contextmenu",o.noContextMenu),t.addEventListener("pointerdown",t=>t.stopPropagation()),t.addEventListener("click",t=>{t.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(e.preventDefault(),this._uiManager.editAltText(this))}),this.#H(),this.div.append(t),!AnnotationEditor.SMALL_EDITOR_SIZE){const e=40;AnnotationEditor.SMALL_EDITOR_SIZE=Math.min(128,Math.round(t.getBoundingClientRect().width*(1+e/100)))}}async#H(){const t=this.#E;if(!t)return;if(!this.#S&&!this.#x)return t.classList.remove("done"),void this.#w?.remove();AnnotationEditor._l10nPromise.get("editor_alt_text_edit_button_label").then(e=>{t.setAttribute("aria-label",e)});let e=this.#w;if(!e){this.#w=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip");const n=e.id=`alt-text-tooltip-${this.id}`;t.setAttribute("aria-describedby",n);const s=100;t.addEventListener("mouseenter",()=>{this.#C=setTimeout(()=>{this.#C=null,this.#w.classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},s)}),t.addEventListener("mouseleave",()=>{clearTimeout(this.#C),this.#C=null,this.#w?.classList.remove("show")})}t.classList.add("done"),e.innerText=this.#x?await AnnotationEditor._l10nPromise.get("editor_alt_text_decorative_tooltip"):this.#S,e.parentNode||t.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:this.#S,decorative:this.#x}}set altTextData({altText:t,decorative:e}){this.#S===t&&this.#x===e||(this.#S=t,this.#x=e,this.#H())}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.#k),this.div.addEventListener("focusout",this.#M);const[t,e]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*e/t).toFixed(2)}%`,this.div.style.maxHeight=`${(100*t/e).toFixed(2)}%`);const[n,a]=this.getInitialTranslation();return this.translate(n,a),(0,s.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=a.FeatureTest.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(this.#R=!0,this.#G(t))}#G(t){if(!this._isDraggable)return;const e=this._uiManager.isSelected(this);let n,s;this._uiManager.setUpDragSession(),e&&(n={passive:!0,capture:!0},s=t=>{const[e,n]=this.screenToPageTranslation(t.movementX,t.movementY);this._uiManager.dragSelectedEditors(e,n)},window.addEventListener("pointermove",s,n));const pointerUpCallback=()=>{if(window.removeEventListener("pointerup",pointerUpCallback),window.removeEventListener("blur",pointerUpCallback),e&&window.removeEventListener("pointermove",s,n),this.#R=!1,!this._uiManager.endDragSession()){const{isMac:e}=a.FeatureTest.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",pointerUpCallback),window.addEventListener("blur",pointerUpCallback)}moveInDOM(){this.parent?.moveEditorInDOM(this)}_setParentAndPosition(t,e,n){t.changeParent(this),this.x=e,this.y=n,this.fixAndSetPosition()}getRect(t,e){const n=this.parentScale,[s,a]=this.pageDimensions,[o,l]=this.pageTranslation,c=t/n,d=e/n,h=this.x*s,u=this.y*a,p=this.width*s,g=this.height*a;switch(this.rotation){case 0:return[h+c+o,a-u-d-g+l,h+c+p+o,a-u-d+l];case 90:return[h+d+o,a-u+c+l,h+d+g+o,a-u+c+p+l];case 180:return[h-c-p+o,a-u+d+l,h-c+o,a-u+d+g+l];case 270:return[h-d-g+o,a-u-c-p+l,h-d+o,a-u-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[n,s,a,o]=t,l=a-n,c=o-s;switch(this.rotation){case 0:return[n,e-o,l,c];case 90:return[n,e-s,c,l];case 180:return[a,e-s,l,c];case 270:return[a,e-o,c,l];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#D=!0}disableEditMode(){this.#D=!1}isInEditMode(){return this.#D}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#k),this.div?.addEventListener("focusout",this.#M)}serialize(t=!1,e=null){(0,a.unreachable)("An editor must be serializable")}static deserialize(t,e,n){const s=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:n});s.rotation=t.rotation;const[a,o]=s.pageDimensions,[l,c,d,h]=s.getRectInCurrentCoords(t.rect,o);return s.x=l/a,s.y=c/o,s.width=d/a,s.height=h/o,s}remove(){this.div.removeEventListener("focusin",this.#k),this.div.removeEventListener("focusout",this.#M),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#E?.remove(),this.#E=null,this.#w=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#U(),this.#P.classList.remove("hidden"))}select(){this.makeResizable(),this.div?.classList.add("selectedEditor")}unselect(){this.#P?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(t,e){}
2disableEditing(){this.#E&&(this.#E.hidden=!0)}enableEditing(){this.#E&&(this.#E.hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return this.#F}set isEditing(t){this.#F=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){this.#T=!0;const n=t/e,{style:s}=this.div;s.aspectRatio=n,s.height="auto"}static get MIN_SIZE(){return 16}}e.AnnotationEditor=AnnotationEditor;class FakeEditor extends AnnotationEditor{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(t,e,n)=>{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 s of n)e.addEventListener(s,t[s].bind(t))},e.opacityToHex=function opacityToHex(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")};var s=n(1),a=n(6);class IdManager{#V=0;getId(){return`${s.AnnotationEditorPrefix}${this.#V++}`}}class ImageManager{#q=(0,s.getUuid)();#V=0;#$=null;static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d"),e=new Image;e.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';const n=e.decode().then(()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]));return(0,s.shadow)(this,"_isSVGFittingCanvas",n)}async#X(t,e){this.#$||=new Map;let n=this.#$.get(t);if(null===n)return null;if(n?.bitmap)return n.refCounter+=1,n;try{let t;if(n||={bitmap:null,id:`image_${this.#q}_${this.#V++}`,refCounter:0,isSvg:!1},"string"===typeof e){n.url=e;const s=await fetch(e);if(!s.ok)throw new Error(s.statusText);t=await s.blob()}else t=n.file=e;if("image/svg+xml"===t.type){const e=ImageManager._isSVGFittingCanvas,s=new FileReader,a=new Image,o=new Promise((t,o)=>{a.onload=()=>{n.bitmap=a,n.isSvg=!0,t()},s.onload=async()=>{const t=n.svgUrl=s.result;a.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t},a.onerror=s.onerror=o});s.readAsDataURL(t),await o}else n.bitmap=await createImageBitmap(t);n.refCounter=1}catch(s){console.error(s),n=null}return this.#$.set(t,n),n&&this.#$.set(n.id,n),n}async getFromFile(t){const{lastModified:e,name:n,size:s,type:a}=t;return this.#X(`${e}_${n}_${s}_${a}`,t)}async getFromUrl(t){return this.#X(t,t)}async getFromId(t){this.#$||=new Map;const e=this.#$.get(t);return e?e.bitmap?(e.refCounter+=1,e):e.file?this.getFromFile(e.file):this.getFromUrl(e.url):null}getSvgUrl(t){const e=this.#$.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#$||=new Map;const e=this.#$.get(t);e&&(e.refCounter-=1,0===e.refCounter&&(e.bitmap=null))}isValidId(t){return t.startsWith(`image_${this.#q}_`)}}class CommandManager{#K=[];#Y=!1;#J;#Q=-1;constructor(t=128){this.#J=t}add({cmd:t,undo:e,mustExec:n,type:s=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(n&&t(),this.#Y)return;const l={cmd:t,undo:e,type:s};if(-1===this.#Q)return this.#K.length>0&&(this.#K.length=0),this.#Q=0,void this.#K.push(l);if(a&&this.#K[this.#Q].type===s)return o&&(l.undo=this.#K[this.#Q].undo),void(this.#K[this.#Q]=l);const c=this.#Q+1;c===this.#J?this.#K.splice(0,1):(this.#Q=c,c<this.#K.length&&this.#K.splice(c)),this.#K.push(l)}undo(){-1!==this.#Q&&(this.#Y=!0,this.#K[this.#Q].undo(),this.#Y=!1,this.#Q-=1)}redo(){this.#Q<this.#K.length-1&&(this.#Q+=1,this.#Y=!0,this.#K[this.#Q].cmd(),this.#Y=!1)}hasSomethingToUndo(){return-1!==this.#Q}hasSomethingToRedo(){return this.#Q<this.#K.length-1}destroy(){this.#K=null}}e.CommandManager=CommandManager;class KeyboardManager{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=s.FeatureTest.platform;for(const[n,s,a={}]of t)for(const t of n){const n=t.startsWith("mac+");e&&n?(this.callbacks.set(t.slice(4),{callback:s,options:a}),this.allKeys.add(t.split("+").at(-1))):e||n||(this.callbacks.set(t,{callback:s,options:a}),this.allKeys.add(t.split("+").at(-1)))}}#Z(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.#Z(e));if(!n)return;const{callback:s,options:{bubbles:a=!1,args:o=[],checker:l=null}}=n;l&&!l(t,e)||(s.bind(t,...o)(),a||(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,a.getColorValues)(t),(0,s.shadow)(this,"_colors",t)}convert(t){const e=(0,a.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[n,s]of this._colors)if(s.every((t,n)=>t===e[n]))return ColorManager._colorsMapping.get(n);return e}getHexCode(t){const e=this._colors.get(t);return e?s.Util.makeHexColor(...e):t}}e.ColorManager=ColorManager;class AnnotationEditorUIManager{#tt=null;#et=new Map;#nt=new Map;#it=null;#st=null;#rt=new CommandManager;#at=0;#ot=new Set;#lt=null;#ct=null;#dt=new Set;#ht=null;#ut=new IdManager;#pt=!1;#gt=!1;#mt=null;#ft=s.AnnotationEditorType.NONE;#bt=new Set;#At=null;#vt=this.blur.bind(this);#yt=this.focus.bind(this);#_t=this.copy.bind(this);#St=this.cut.bind(this);#xt=this.paste.bind(this);#Et=this.keydown.bind(this);#wt=this.onEditingAction.bind(this);#Ct=this.onPageChanging.bind(this);#Tt=this.onScaleChanging.bind(this);#Pt=this.onRotationChanging.bind(this);#kt={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#Mt=[0,0];#Rt=null;#Ft=null;#Dt=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=AnnotationEditorUIManager.prototype,arrowChecker=t=>{const{activeElement:e}=document;return e&&t.#Ft.contains(e)&&t.hasSomethingToControl()},e=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return(0,s.shadow)(this,"_keyboardManager",new KeyboardManager([[["ctrl+a","mac+meta+a"],t.selectAll],[["ctrl+z","mac+meta+z"],t.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-e,0],checker:arrowChecker}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:arrowChecker}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[e,0],checker:arrowChecker}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:arrowChecker}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-e],checker:arrowChecker}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:arrowChecker}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,e],checker:arrowChecker}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:arrowChecker}]]))}constructor(t,e,n,s,o,l){this.#Ft=t,this.#Dt=e,this.#it=n,this._eventBus=s,this._eventBus._on("editingaction",this.#wt),this._eventBus._on("pagechanging",this.#Ct),this._eventBus._on("scalechanging",this.#Tt),this._eventBus._on("rotationchanging",this.#Pt),this.#st=o.annotationStorage,this.#ht=o.filterFactory,this.#At=l,this.viewParameters={realScale:a.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){this.#It(),this.#Lt(),this._eventBus._off("editingaction",this.#wt),this._eventBus._off("pagechanging",this.#Ct),this._eventBus._off("scalechanging",this.#Tt),this._eventBus._off("rotationchanging",this.#Pt);
2for(const t of this.#nt.values())t.destroy();this.#nt.clear(),this.#et.clear(),this.#dt.clear(),this.#tt=null,this.#bt.clear(),this.#rt.destroy(),this.#it.destroy()}get hcmFilter(){return(0,s.shadow)(this,"hcmFilter",this.#At?this.#ht.addHCMFilter(this.#At.foreground,this.#At.background):"none")}get direction(){return(0,s.shadow)(this,"direction",getComputedStyle(this.#Ft).direction)}editAltText(t){this.#it?.editAltText(this,t)}onPageChanging({pageNumber:t}){this.#at=t-1}focusMainContainer(){this.#Ft.focus()}findParent(t,e){for(const n of this.#nt.values()){const{x:s,y:a,width:o,height:l}=n.div.getBoundingClientRect();if(t>=s&&t<=s+o&&e>=a&&e<=a+l)return n}return null}disableUserSelect(t=!1){this.#Dt.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#dt.add(t)}removeShouldRescale(t){this.#dt.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*a.PixelsPerInch.PDF_TO_CSS_UNITS;for(const e of this.#dt)e.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}addToAnnotationStorage(t){t.isEmpty()||!this.#st||this.#st.has(t.id)||this.#st.setValue(t.id,t)}#Ot(){window.addEventListener("focus",this.#yt),window.addEventListener("blur",this.#vt)}#Lt(){window.removeEventListener("focus",this.#yt),window.removeEventListener("blur",this.#vt)}blur(){if(!this.hasSelection)return;const{activeElement:t}=document;for(const e of this.#bt)if(e.div.contains(t)){this.#mt=[e,t],e._focusEventsAllowed=!1;break}}focus(){if(!this.#mt)return;const[t,e]=this.#mt;this.#mt=null,e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0}),e.focus()}#Nt(){window.addEventListener("keydown",this.#Et,{capture:!0})}#It(){window.removeEventListener("keydown",this.#Et,{capture:!0})}#Bt(){document.addEventListener("copy",this.#_t),document.addEventListener("cut",this.#St),document.addEventListener("paste",this.#xt)}#jt(){document.removeEventListener("copy",this.#_t),document.removeEventListener("cut",this.#St),document.removeEventListener("paste",this.#xt)}addEditListeners(){this.#Nt(),this.#Bt()}removeEditListeners(){this.#It(),this.#jt()}copy(t){if(t.preventDefault(),this.#tt?.commitOrRemove(),!this.hasSelection)return;const e=[];for(const n of this.#bt){const t=n.serialize(!0);t&&e.push(t)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:e}=t;for(const s of e.items)for(const t of this.#ct)if(t.isHandlingMimeForPasting(s.type))return void t.paste(s,this.currentLayer);let n=e.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(o){return void(0,s.warn)(`paste: "${o.message}".`)}if(!Array.isArray(n))return;this.unselectAll();const a=this.currentLayer;try{const t=[];for(const e of n){const n=a.deserialize(e);if(!n)return;t.push(n)}const cmd=()=>{for(const e of t)this.#Ut(e);this.#Wt(t)},undo=()=>{for(const e of t)e.remove()};this.addCommands({cmd:cmd,undo:undo,mustExec:!0})}catch(o){(0,s.warn)(`paste: "${o.message}".`)}}keydown(t){this.getActive()?.shouldGetKeyboardEvents()||AnnotationEditorUIManager._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}#zt(t){Object.entries(t).some(([t,e])=>this.#kt[t]!==e)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#kt,t)})}#Ht(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#Ot(),this.#Nt(),this.#Bt(),this.#zt({isEditing:this.#ft!==s.AnnotationEditorType.NONE,isEmpty:this.#Gt(),hasSomethingToUndo:this.#rt.hasSomethingToUndo(),hasSomethingToRedo:this.#rt.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#Lt(),this.#It(),this.#jt(),this.#zt({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#ct){this.#ct=t;for(const t of this.#ct)this.#Ht(t.defaultPropertiesToUpdate)}}getId(){return this.#ut.getId()}get currentLayer(){return this.#nt.get(this.#at)}getLayer(t){return this.#nt.get(t)}get currentPageIndex(){return this.#at}addLayer(t){this.#nt.set(t.pageIndex,t),this.#pt?t.enable():t.disable()}removeLayer(t){this.#nt.delete(t.pageIndex)}updateMode(t,e=null){if(this.#ft!==t){if(this.#ft=t,t===s.AnnotationEditorType.NONE)return this.setEditingState(!1),void this.#Vt();this.setEditingState(!0),this.#qt(),this.unselectAll();for(const e of this.#nt.values())e.updateMode(t);if(e)for(const t of this.#et.values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}}updateToolbar(t){t!==this.#ft&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#ct)if(t!==s.AnnotationEditorParamsType.CREATE){for(const n of this.#bt)n.updateParams(t,e);for(const n of this.#ct)n.updateDefaultParams(t,e)}else this.currentLayer.addNewEditor(t)}enableWaiting(t=!1){if(this.#gt!==t){this.#gt=t;for(const e of this.#nt.values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}
vendor: 4,301 bytes, line 2
2#qt(){if(!this.#pt){this.#pt=!0;for(const t of this.#nt.values())t.enable()}}#Vt(){if(this.unselectAll(),this.#pt){this.#pt=!1;for(const t of this.#nt.values())t.disable()}}getEditors(t){const e=[];for(const n of this.#et.values())n.pageIndex===t&&e.push(n);return e}getEditor(t){return this.#et.get(t)}addEditor(t){this.#et.set(t.id,t)}removeEditor(t){this.#et.delete(t.id),this.unselect(t),t.annotationElementId&&this.#ot.has(t.annotationElementId)||this.#st?.remove(t.id)}addDeletedAnnotationElement(t){this.#ot.add(t.annotationElementId),t.deleted=!0}isDeletedAnnotationElement(t){return this.#ot.has(t)}removeDeletedAnnotationElement(t){this.#ot.delete(t.annotationElementId),t.deleted=!1}#Ut(t){const e=this.#nt.get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}setActiveEditor(t){this.#tt!==t&&(this.#tt=t,t&&this.#Ht(t.propertiesToUpdate))}toggleSelected(t){if(this.#bt.has(t))return this.#bt.delete(t),t.unselect(),void this.#zt({hasSelectedEditor:this.hasSelection});this.#bt.add(t),t.select(),this.#Ht(t.propertiesToUpdate),this.#zt({hasSelectedEditor:!0})}setSelected(t){for(const e of this.#bt)e!==t&&e.unselect();this.#bt.clear(),this.#bt.add(t),t.select(),this.#Ht(t.propertiesToUpdate),this.#zt({hasSelectedEditor:!0})}isSelected(t){return this.#bt.has(t)}unselect(t){t.unselect(),this.#bt.delete(t),this.#zt({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#bt.size}undo(){this.#rt.undo(),this.#zt({hasSomethingToUndo:this.#rt.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Gt()})}redo(){this.#rt.redo(),this.#zt({hasSomethingToUndo:!0,hasSomethingToRedo:this.#rt.hasSomethingToRedo(),isEmpty:this.#Gt()})}addCommands(t){this.#rt.add(t),this.#zt({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Gt()})}#Gt(){if(0===this.#et.size)return!0;if(1===this.#et.size)for(const t of this.#et.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...this.#bt];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)this.#Ut(e)},mustExec:!0})}commitOrRemove(){this.#tt?.commitOrRemove()}hasSomethingToControl(){return this.#tt||this.hasSelection}#Wt(t){this.#bt.clear();for(const e of t)e.isEmpty()||(this.#bt.add(e),e.select());this.#zt({hasSelectedEditor:!0})}selectAll(){for(const t of this.#bt)t.commit();this.#Wt(this.#et.values())}unselectAll(){if(this.#tt)this.#tt.commitOrRemove();else if(this.hasSelection){for(const t of this.#bt)t.unselect();this.#bt.clear(),this.#zt({hasSelectedEditor:!1})}}translateSelectedEditors(t,e,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#Mt[0]+=t,this.#Mt[1]+=e;const[s,a]=this.#Mt,o=[...this.#bt];this.#Rt&&clearTimeout(this.#Rt),this.#Rt=setTimeout(()=>{this.#Rt=null,this.#Mt[0]=this.#Mt[1]=0,this.addCommands({cmd:()=>{for(const t of o)this.#et.has(t.id)&&t.translateInPage(s,a)},undo:()=>{for(const t of o)this.#et.has(t.id)&&t.translateInPage(-s,-a)},mustExec:!1})},1e3);for(const l of o)l.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#lt=new Map;for(const t of this.#bt)this.#lt.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#lt)return!1;this.disableUserSelect(!1);const t=this.#lt;this.#lt=null;let e=!1;for(const[{x:n,y:s,pageIndex:a},o]of t)o.newX=n,o.newY=s,o.newPageIndex=a,e||=n!==o.savedX||s!==o.savedY||a!==o.savedPageIndex;if(!e)return!1;const move=(t,e,n,s)=>{if(this.#et.has(t.id)){const a=this.#nt.get(s);a?t._setParentAndPosition(a,e,n):(t.pageIndex=s,t.x=e,t.y=n)}};return this.addCommands({cmd:()=>{for(const[e,{newX:n,newY:s,newPageIndex:a}]of t)move(e,n,s,a)},undo:()=>{for(const[e,{savedX:n,savedY:s,savedPageIndex:a}]of t)move(e,n,s,a)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(this.#lt)for(const n of this.#lt.keys())n.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}isActive(t){return this.#tt===t}getActive(){return this.#tt}getMode(){return this.#ft}get imageManager(){return(0,s.shadow)(this,"imageManager",new ImageManager)}}e.AnnotationEditorUIManager=AnnotationEditorUIManager},(t,e,n)=>
2{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=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 s=window.getComputedStyle(e).color;t.set(n,getRGB(s))}e.remove()},e.getCurrentTransform=function getCurrentTransform(t){const{a:e,b:n,c:s,d:a,e:o,f:l}=t.getTransform();return[e,n,s,a,o,l]},e.getCurrentTransformInverse=function getCurrentTransformInverse(t){const{a:e,b:n,c:s,d:a,e:o,f:l}=t.getTransform().invertSelf();return[e,n,s,a,o,l]},e.getFilenameFromUrl=function getFilenameFromUrl(t,e=!1){e||([t]=t.split(/[#?]/,1));return t.substring(t.lastIndexOf("/")+1)},e.getPdfFilenameFromUrl=function getPdfFilenameFromUrl(t,e="document.pdf"){if("string"!==typeof t)return e;if(isDataScheme(t))return(0,a.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,s=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let o=n.exec(s[1])||n.exec(s[2])||n.exec(s[3]);if(o&&(o=o[0],o.includes("%")))try{o=n.exec(decodeURIComponent(o))[0]}catch{}return o||e},e.getRGB=getRGB,e.getXfaPageViewport=function getXfaPageViewport(t,{scale:e=1,rotation:n=0}){const{width:s,height:a}=t.attributes.style,o=[0,0,parseInt(s),parseInt(a)];return new PageViewport({viewBox:o,scale:e,rotation:n})},e.isDataScheme=isDataScheme,e.isPdfFile=function isPdfFile(t){return"string"===typeof t&&/\.pdf$/i.test(t)},e.isValidFetchUrl=isValidFetchUrl,e.loadScript=function loadScript(t,e=!1){return new Promise((n,s)=>{const a=document.createElement("script");a.src=t,a.onload=function(t){e&&a.remove(),n(t)},a.onerror=function(){s(new Error(`Cannot load script at: ${a.src}`))},(document.head||document.documentElement).append(a)})},e.noContextMenu=function noContextMenu(t){t.preventDefault()},e.setLayerDimensions=function setLayerDimensions(t,e,n=!1,s=!0){if(e instanceof PageViewport){const{pageWidth:s,pageHeight:o}=e.rawDims,{style:l}=t,c=a.FeatureTest.isCSSRoundSupported,d=`var(--scale-factor) * ${s}px`,h=`var(--scale-factor) * ${o}px`,u=c?`round(${d}, 1px)`:`calc(${d})`,p=c?`round(${h}, 1px)`:`calc(${h})`;n&&e.rotation%180!==0?(l.width=p,l.height=u):(l.width=u,l.height=p)}s&&t.setAttribute("data-main-rotation",e.rotation)};var s=n(7),a=n(1);const o="http://www.w3.org/2000/svg";class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}e.PixelsPerInch=PixelsPerInch;class DOMFilterFactory extends s.BaseFilterFactory{#$t;#Xt;#e;#Kt;#Yt;#Jt;#Qt;#Zt;#te;#ee;#V=0;constructor({docId:t,ownerDocument:e=globalThis.document}={}){super(),this.#e=t,this.#Kt=e}get#$(){return this.#$t||=new Map}get#ne(){if(!this.#Xt){const t=this.#Kt.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.#Kt.createElementNS(o,"svg");n.setAttribute("width",0),n.setAttribute("height",0),this.#Xt=this.#Kt.createElementNS(o,"defs"),t.append(n),n.append(this.#Xt),this.#Kt.body.append(t)}return this.#Xt}addFilter(t){if(!t)return"none";let e,n,s,a,o=this.#$.get(t);if(o)return o;if(1===t.length){const o=t[0],l=new Array(256);for(let t=0;t<256;t++)l[t]=o[t]/255;a=e=n=s=l.join(",")}else{const[o,l,c]=t,d=new Array(256),h=new Array(256),u=new Array(256);for(let t=0;t<256;t++)d[t]=o[t]/255,h[t]=l[t]/255,u[t]=c[t]/255;e=d.join(","),n=h.join(","),s=u.join(","),a=`${e}${n}${s}`}if(o=this.#$.get(a),o)return this.#$.set(t,o),o;const l=`g_${this.#e}_transfer_map_${this.#V++}`,c=`url(#${l})`;this.#$.set(t,c),this.#$.set(a,c);const d=this.#ie(l);return this.#se(e,n,s,d),c}addHCMFilter(t,e){const n=`${t}-${e}`;if(this.#Jt===n)return this.#Qt;if(this.#Jt=n,this.#Qt="none",this.#Yt?.remove(),!t||!e)return this.#Qt;const s=this.#re(t);t=a.Util.makeHexColor(...s);const o=this.#re(e);
2if(e=a.Util.makeHexColor(...o),this.#ne.style.color="","#000000"===t&&"#ffffff"===e||t===e)return this.#Qt;const l=new Array(256);for(let a=0;a<=255;a++){const t=a/255;l[a]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const c=l.join(","),d=`g_${this.#e}_hcm_filter`,h=this.#Zt=this.#ie(d);this.#se(c,c,c,h),this.#ae(h);const getSteps=(t,e)=>{const n=s[t]/255,a=o[t]/255,l=new Array(e+1);for(let s=0;s<=e;s++)l[s]=n+s/e*(a-n);return l.join(",")};return this.#se(getSteps(0,5),getSteps(1,5),getSteps(2,5),h),this.#Qt=`url(#${d})`,this.#Qt}addHighlightHCMFilter(t,e,n,s){const a=`${t}-${e}-${n}-${s}`;if(this.#te===a)return this.#ee;if(this.#te=a,this.#ee="none",this.#Zt?.remove(),!t||!e)return this.#ee;const[o,l]=[t,e].map(this.#re.bind(this));let c=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),d=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[h,u]=[n,s].map(this.#re.bind(this));d<c&&([c,d,h,u]=[d,c,u,h]),this.#ne.style.color="";const getSteps=(t,e,n)=>{const s=new Array(256),a=(d-c)/n,o=t/255,l=(e-t)/(255*n);let h=0;for(let d=0;d<=n;d++){const t=Math.round(c+d*a),e=o+d*l;for(let n=h;n<=t;n++)s[n]=e;h=t+1}for(let c=h;c<256;c++)s[c]=s[h-1];return s.join(",")},p=`g_${this.#e}_hcm_highlight_filter`,g=this.#Zt=this.#ie(p);return this.#ae(g),this.#se(getSteps(h[0],u[0],5),getSteps(h[1],u[1],5),getSteps(h[2],u[2],5),g),this.#ee=`url(#${p})`,this.#ee}destroy(t=!1){t&&(this.#Qt||this.#ee)||(this.#Xt&&(this.#Xt.parentNode.parentNode.remove(),this.#Xt=null),this.#$t&&(this.#$t.clear(),this.#$t=null),this.#V=0)}#ae(t){const e=this.#Kt.createElementNS(o,"feColorMatrix");e.setAttribute("type","matrix"),e.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"),t.append(e)}#ie(t){const e=this.#Kt.createElementNS(o,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#ne.append(e),e}#oe(t,e,n){const s=this.#Kt.createElementNS(o,e);s.setAttribute("type","discrete"),s.setAttribute("tableValues",n),t.append(s)}#se(t,e,n,s){const a=this.#Kt.createElementNS(o,"feComponentTransfer");
2s.append(a),this.#oe(a,"feFuncR",t),this.#oe(a,"feFuncG",e),this.#oe(a,"feFuncB",n)}#re(t){return this.#ne.style.color=t,getRGB(getComputedStyle(this.#ne).getPropertyValue("color"))}}e.DOMFilterFactory=DOMFilterFactory;class DOMCanvasFactory extends s.BaseCanvasFactory{constructor({ownerDocument:t=globalThis.document}={}){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,e=!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,a.stringToBytes)(await n.text())}return new Promise((n,s)=>{const o=new XMLHttpRequest;o.open("GET",t,!0),e&&(o.responseType="arraybuffer"),o.onreadystatechange=()=>{if(o.readyState===XMLHttpRequest.DONE){if(200===o.status||0===o.status){let t;if(e&&o.response?t=new Uint8Array(o.response):!e&&o.responseText&&(t=(0,a.stringToBytes)(o.responseText)),t)return void n(t)}s(new Error(o.statusText))}},o.send(null)})}e.DOMCanvasFactory=DOMCanvasFactory;class DOMCMapReaderFactory extends s.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t,this.isCompressed).then(t=>({cMapData:t,compressionType:e}))}}e.DOMCMapReaderFactory=DOMCMapReaderFactory;class DOMStandardFontDataFactory extends s.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t,!0)}}e.DOMStandardFontDataFactory=DOMStandardFontDataFactory;class DOMSVGFactory extends s.BaseSVGFactory{_createSVG(t){return document.createElementNS(o,t)}}e.DOMSVGFactory=DOMSVGFactory;class PageViewport{constructor({viewBox:t,scale:e,rotation:n,offsetX:s=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=t,this.scale=e,this.rotation=n,this.offsetX=s,this.offsetY=a;const l=(t[2]+t[0])/2,c=(t[3]+t[1])/2;let d,h,u,p,g,m,f,b;switch((n%=360)<0&&(n+=360),n){case 180:d=-1,h=0,u=0,p=1;break;case 90:d=0,h=1,u=1,p=0;break;case 270:d=0,h=-1,u=-1,p=0;break;case 0:d=1,h=0,u=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(u=-u,p=-p),0===d?(g=Math.abs(c-t[1])*e+s,m=Math.abs(l-t[0])*e+a,f=(t[3]-t[1])*e,b=(t[2]-t[0])*e):(g=Math.abs(l-t[0])*e+s,m=Math.abs(c-t[1])*e+a,f=(t[2]-t[0])*e,b=(t[3]-t[1])*e),this.transform=[d*e,h*e,u*e,p*e,g-d*e*l-u*e*c,m-h*e*l-p*e*c],this.width=f,this.height=b}get rawDims(){const{viewBox:t}=this;return(0,a.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:n=this.offsetX,offsetY:s=this.offsetY,dontFlip:a=!1}={}){return new PageViewport({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:n,offsetY:s,dontFlip:a})}convertToViewportPoint(t,e){return a.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=a.Util.applyTransform([t[0],t[1]],this.transform),n=a.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],n[0],n[1]]}convertToPdfPoint(t,e){return a.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=PageViewport;class RenderingCancelledException extends a.BaseException{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}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{return!1}}let l;e.StatTimer=class StatTimer{started=Object.create(null);times=[];time(t){t in this.started&&(0,a.warn)(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,a.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:n}of this.times)e=Math.max(n.length,e);for(const{name:n,start:s,end:a}of this.times)t.push(`${n.padEnd(e)} ${a-s}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,a.warn)(`Not a valid color format: "${t}"`),[0,0,0])}e.PDFDateString=class PDFDateString{static toDateObject(t){if(!t||"string"!==typeof t)return null;l||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const e=l.exec(t);if(!e)return null;const n=parseInt(e[1],10);let s=parseInt(e[2],10);s=s>=1&&s<=12?s-1:0;let a=parseInt(e[3],10);a=a>=1&&a<=31?a:1;let o=parseInt(e[4],10);o=o>=0&&o<=23?o:0;let c=parseInt(e[5],10);c=c>=0&&c<=59?c:0;let d=parseInt(e[6],10);d=d>=0&&d<=59?d:0;const h=e[7]||"Z";let u=parseInt(e[8],10);u=u>=0&&u<=23?u:0;let p=parseInt(e[9],10)||0;return p=p>=0&&p<=59?p:0,"-"===h?(o+=u,c+=p):"+"===h&&(o-=u,c-=p),new Date(Date.UTC(n,s,a,o,c,d))}}},(t,e,n)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseFilterFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;var s=n(1);class BaseFilterFactory{constructor(){this.constructor===BaseFilterFactory&&(0,s.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addHighlightHCMFilter(t,e,n,s){return"none"}destroy(t=!1){}}e.BaseFilterFactory=BaseFilterFactory;class BaseCanvasFactory{constructor(){this.constructor===BaseCanvasFactory&&(0,s.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")}}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,s.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=BaseCanvasFactory;class BaseCMapReaderFactory{constructor({baseUrl:t=null,isCompressed:e=!0}){this.constructor===BaseCMapReaderFactory&&(0,s.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=e}async fetch({name: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(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":""),n=this.isCompressed?s.CMapCompressionType.BINARY:s.CMapCompressionType.NONE;return this._fetchData(e,n).catch(t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)})}_fetchData(t,e){(0,s.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=BaseCMapReaderFactory;class BaseStandardFontDataFactory{constructor({baseUrl:t=null}){this.constructor===BaseStandardFontDataFactory&&(0,s.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetchData(e).catch(t=>{throw new Error(`Unable to load font data at: ${e}`)})}_fetchData(t){(0,s.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=BaseStandardFontDataFactory;class BaseSVGFactory{constructor(){this.constructor===BaseSVGFactory&&(0,s.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e,n=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const s=this._createSVG("svg:svg");return s.setAttribute("version","1.1"),n||(s.setAttribute("width",`${t}px`),s.setAttribute("height",`${e}px`)),s.setAttribute("preserveAspectRatio","none"),s.setAttribute("viewBox",`0 0 ${t} ${e}`),s}createElement(t){if("string"!==typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,s.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=BaseSVGFactory},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MurmurHash3_64=void 0;var s=n(1);const a=3285377520,o=4294901760,l=65535;e.MurmurHash3_64=class MurmurHash3_64{constructor(t){this.h1=t?4294967295&t:a,this.h2=t?4294967295&t:a}update(t){let e,n;if("string"===typeof t){e=new Uint8Array(2*t.length),n=0;for(let s=0,a=t.length;s<a;s++){const a=t.charCodeAt(s);a<=255?e[n++]=a:(e[n++]=a>>>8,e[n++]=255&a)}}else{if(!(0,s.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 a=n>>2,c=n-4*a,d=new Uint32Array(e.buffer,0,a);let h=0,u=0,p=this.h1,g=this.h2;const m=3432918353,f=461845907,b=11601,A=13715;for(let s=0;s<a;s++)1&s?(h=d[s],h=h*m&o|h*b&l,h=h<<15|h>>>17,h=h*f&o|h*A&l,p^=h,p=p<<13|p>>>19,p=5*p+3864292196):(u=d[s],u=u*m&o|u*b&l,u=u<<15|u>>>17,u=u*f&o|u*A&l,g^=u,g=g<<13|g>>>19,g=5*g+3864292196);switch(h=0,c){case 3:h^=e[4*a+2]<<16;case 2:h^=e[4*a+1]<<8;case 1:h^=e[4*a],h=h*m&o|h*b&l,h=h<<15|h>>>17,h=h*f&o|h*A&l,1&a?p^=h:g^=h}this.h1=p,this.h2=g}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&o|36045*t&l,e=4283543511*e&o|(2950163797*(e<<16|t>>>16)&o)>>>16,t^=e>>>1,t=444984403*t&o|60499*t&l,e=3301882366*e&o|(3120437893*(e<<16|t>>>16)&o)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}},(t,e,n)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0;var s=n(1);e.FontLoader=class FontLoader{#le=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){this._document=t,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.#le.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){if(t&&!this.#le.has(t.loadedName)){if((0,s.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:e,src:n,style:a}=t,o=new FontFace(e,n,a);this.addNativeFontFace(o);try{await o.load(),this.#le.add(e)}catch{(0,s.warn)(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}(0,s.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,s.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(){const t=!!this._document?.fonts;return(0,s.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(s.isNodeJS||"undefined"!==typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),(0,s.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,n={done:!1,complete:function completeRequest(){for((0,s.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,s.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,s){return t.substring(0,e)+s+t.substring(e+n)}let n,a;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;const d=`lt${Date.now()}${this.loadTestFontId++}`;let h=this._loadTestFont;h=spliceString(h,976,d.length,d);const u=1482184792;let p=int32(h,16);for(n=0,a=d.length-3;n<a;n+=4)p=p-u+int32(d,n)|0;n<d.length&&(p=p-u+int32(d+"XXX",n)|0),h=spliceString(h,16,4,(0,s.string32)(p));const g=`@font-face {font-family:"${d}";src:${`url(data:font/opentype;base64,${btoa(h)});`}}`;this.insertRule(g);const m=this._document.createElement("div");m.style.visibility="hidden",m.style.width=m.style.height="10px",m.style.position="absolute",m.style.top=m.style.left="0px";for(const s of[t.loadedName,d]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=s,m.append(t)}this._document.body.append(m),function isFontReady(t,e){if(++c>30)return(0,s.warn)("Load test font never loaded."),void e();l.font="30px "+t,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0?e():setTimeout(isFontReady.bind(null,t,e))}(d,()=>{m.remove(),e.complete()})}};e.FontFaceObject=class FontFaceObject{constructor(t,{isEvalSupported:e=!0,disableFontFace:n=!1,ignoreErrors:s=!1,inspectFont:a=null}){this.compiledGlyphs=Object.create(null);
vendor: 4,954 bytes, line 2
2for(const o in t)this[o]=t[o];this.isEvalSupported=!1!==e,this.disableFontFace=!0===n,this.ignoreErrors=!0===s,this._inspectFont=a}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=(0,s.bytesToString)(this.data),e=`url(data:${this.mimetype};base64,${btoa(t)});`;let n;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else n=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),n}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let n;try{n=t.get(this.loadedName+"_path_"+e)}catch(a){if(!this.ignoreErrors)throw a;return(0,s.warn)(`getPathGenerator - ignoring character: "${a}".`),this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&s.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 s of n)"scale"===s.cmd&&(s.args=[e,-e]),t[s.cmd].apply(t,s.args)}}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeStandardFontDataFactory=e.NodeFilterFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;var s=n(7);n(1);const fetchData=function(t){return new Promise((e,n)=>{__webpack_require__(23237).readFile(t,(t,s)=>{!t&&s?e(new Uint8Array(s)):n(new Error(t))})})};class NodeFilterFactory extends s.BaseFilterFactory{}e.NodeFilterFactory=NodeFilterFactory;class NodeCanvasFactory extends s.BaseCanvasFactory{_createCanvas(t,e){return __webpack_require__(17640).createCanvas(t,e)}}e.NodeCanvasFactory=NodeCanvasFactory;class NodeCMapReaderFactory extends s.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t).then(t=>({cMapData:t,compressionType:e}))}}e.NodeCMapReaderFactory=NodeCMapReaderFactory;class NodeStandardFontDataFactory extends s.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t)}}e.NodeStandardFontDataFactory=NodeStandardFontDataFactory},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0;var s=n(1),a=n(6),o=n(12),l=n(13);const c=4096,d=16;class CachedCanvases{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,n){let s;return void 0!==this.cache[t]?(s=this.cache[t],this.canvasFactory.reset(s,e,n)):(s=this.canvasFactory.create(e,n),this.cache[t]=s),s}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,s,o,l,c,d,h,u){const[p,g,m,f,b,A]=(0,a.getCurrentTransform)(t);if(0===g&&0===m){const a=c*p+b,v=Math.round(a),y=d*f+A,_=Math.round(y),S=(c+h)*p+b,x=Math.abs(Math.round(S)-v)||1,E=(d+u)*f+A,w=Math.abs(Math.round(E)-_)||1;return t.setTransform(Math.sign(p),0,0,Math.sign(f),v,_),t.drawImage(e,n,s,o,l,0,0,x,w),t.setTransform(p,g,m,f,b,A),[x,w]}if(0===p&&0===f){const a=d*m+b,v=Math.round(a),y=c*g+A,_=Math.round(y),S=(d+u)*m+b,x=Math.abs(Math.round(S)-v)||1,E=(c+h)*g+A,w=Math.abs(Math.round(E)-_)||1;return t.setTransform(0,Math.sign(g),Math.sign(m),0,v,_),t.drawImage(e,n,s,o,l,0,0,w,x),t.setTransform(p,g,m,f,b,A),[w,x]}t.drawImage(e,n,s,o,l,c,d,h,u);return[Math.hypot(p,g)*h,Math.hypot(m,f)*u]}class CanvasExtraState{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=s.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=s.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=s.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]=s.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=s.Util.applyTransform(e,t),a=s.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,n[0],a[0]),this.minY=Math.min(this.minY,n[1],a[1]),this.maxX=Math.max(this.maxX,n[0],a[0]),this.maxY=Math.max(this.maxY,n[
21],a[1])}updateScalingPathMinMax(t,e){s.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,a,o,l,c,d,h,u){const p=s.Util.bezierBoundingBox(e,n,a,o,l,c,d,h);if(u)return u[0]=Math.min(u[0],p[0],p[2]),u[1]=Math.max(u[1],p[0],p[2]),u[2]=Math.min(u[2],p[1],p[3]),void(u[3]=Math.max(u[3],p[1],p[3]));this.updateRectMinMax(t,p)}getPathBoundingBox(t=o.PathType.FILL,e=null){const n=[this.minX,this.minY,this.maxX,this.maxY];if(t===o.PathType.STROKE){e||(0,s.unreachable)("Stroke bounding box must include transform.");const t=s.Util.singularValueDecompose2dScale(e),a=t[0]*this.lineWidth/2,o=t[1]*this.lineWidth/2;n[0]-=a,n[1]-=o,n[2]+=a,n[3]+=o}return n}updateClipFromPath(){const t=s.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(t=o.PathType.FILL,e=null){return s.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,a=e.width,o=n%d,l=(n-o)/d,c=0===o?l:l+1,h=t.createImageData(a,d);let u,p=0;const g=e.data,m=h.data;let f,b,A,v;if(e.kind===s.ImageKind.GRAYSCALE_1BPP){const e=g.byteLength,n=new Uint32Array(m.buffer,0,m.byteLength>>2),v=n.length,y=a+7>>3,_=4294967295,S=s.FeatureTest.isLittleEndian?4278190080:255;for(f=0;f<c;f++){for(A=f<l?d:o,u=0,b=0;b<A;b++){const t=e-p;let s=0;const o=t>y?a:8*t-7,l=-8&o;let c=0,d=0;for(;s<l;s+=8)d=g[p++],n[u++]=128&d?_:S,n[u++]=64&d?_:S,n[u++]=32&d?_:S,n[u++]=16&d?_:S,n[u++]=8&d?_:S,n[u++]=4&d?_:S,n[u++]=2&d?_:S,n[u++]=1&d?_:S;for(;s<o;s++)0===c&&(d=g[p++],c=128),n[u++]=d&c?_:S,c>>=1}for(;u<v;)n[u++]=0;t.putImageData(h,0,f*d)}}else if(e.kind===s.ImageKind.RGBA_32BPP){for(b=0,v=a*d*4,f=0;f<l;f++)m.set(g.subarray(p,p+v)),p+=v,t.putImageData(h,0,b),b+=d;f<c&&(v=a*o*4,m.set(g.subarray(p,p+v)),t.putImageData(h,0,b))}else{if(e.kind!==s.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);for(A=d,v=a*A,f=0;f<c;f++){for(f>=l&&(A=o,v=a*A),u=0,b=v;b--;)m[u++]=g[p++],m[u++]=g[p++],m[u++]=g[p++],m[u++]=255;t.putImageData(h,0,f*d)}}}function putBinaryImageMask(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const n=e.height,s=e.width,a=n%d,o=(n-a)/d,c=0===a?o:o+1,h=t.createImageData(s,d);let u=0;const p=e.data,g=h.data;for(let m=0;m<c;m++){const e=m<o?d:a;({srcPos:u}=(0,l.convertBlackAndWhiteToRGBA)({src:p,srcPos:u,dest:g,width:s,height:e,nonBlackColor:0})),t.putImageData(h,0,m*d)}}function copyCtxState(t,e){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const s of n)void 0!==t[s]&&(e[s]=t[s]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function resetCtxToDefault(t){if(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),!s.isNodeJS){const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function composeSMaskBackdrop(t,e,n,s){const a=t.length;for(let o=3;o<a;o+=4){const a=t[o];if(0===a)t[o-3]=e,t[o-2]=n,t[o-1]=s;else if(a<255){const l=255-a;t[o-3]=t[o-3]*a+e*l>>8,t[o-2]=t[o-2]*a+n*l>>8,t[o-1]=t[o-1]*a+s*l>>8}}}function composeSMaskAlpha(t,e,n){const s=t.length,a=1/255;for(let o=3;o<s;o+=4){const s=n?n[t[o]]:t[o];e[o]=e[o]*s*a|0}}function composeSMaskLuminosity(t,e,n){const s=t.length;for(let a=3;a<s;a+=4){const s=77*t[a-3]+152*t[a-2]+28*t[a-1];e[a]=n?e[a]*n[s>>8]>>8:e[a]*s>>16}}function composeSMask(t,e,n,s){const a=s[0],o=s[1],l=s[2]-a,c=s[3]-o;0!==l&&0!==c&&(!function genericComposeSMask(t,e,n,s,a,o,l,c,d,h,u){const p=!!o,g=p?o[0]:0,m=p?o[1]:0,f=p?o[2]:0,b="Luminosity"===a?composeSMaskLuminosity:composeSMaskAlpha,A=Math.min(s,Math.ceil(1048576/n));for(let v=0;v<s;v+=A){const a=Math.min(A,s-v),o=t.getImageData(c-h,v+(d-u),n,a),y=e.getImageData(c,v+d,n,a);p&&composeSMaskBackdrop(o.data,g,m,f),b(o.data,y.data,l),e.putImageData(y,c,v+d)}}(e.context,n,l,c,e.subtype,e.backdrop,e.transferMap,a,o,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(
2))}function getImageSmoothingEnabled(t,e){const n=s.Util.singularValueDecompose2dScale(t);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const o=Math.fround((globalThis.devicePixelRatio||1)*a.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==e?e:n[0]<=o||n[1]<=o}const h=["butt","round","square"],u=["miter","round","bevel"],p={},g={};class CanvasGraphics{constructor(t,e,n,s,a,{optionalContentConfig:o,markedContentStack:l=null},c,d){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=s,this.filterFactory=a,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=l||[],this.optionalContentConfig=o,this.cachedCanvases=new CachedCanvases(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=c,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=d,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,e=null){return"string"===typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing({transform:t,viewport:e,transparency:n=!1,background:s=null}){const o=this.ctx.canvas.width,l=this.ctx.canvas.height,c=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,o,l),this.ctx.fillStyle=c,n){const t=this.cachedCanvases.getCanvas("transparent",o,l);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...(0,a.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),resetCtxToDefault(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=(0,a.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,n,a){const o=t.argsArray,l=t.fnArray;let c=e||0;const d=o.length;if(d===c)return c;const h=d-c>10&&"function"===typeof n,u=h?Date.now()+15:0;let p=0;const g=this.commonObjs,m=this.objs;let f;for(;;){if(void 0!==a&&c===a.nextBreakPoint)return a.breakIt(c,n),c;if(f=l[c],f!==s.OPS.dependency)this[f].apply(this,o[c]);else for(const t of o[c]){const e=t.startsWith("g_")?g:m;if(!e.has(t))return e.get(t,n),c}if(c++,c===d)return c;if(h&&++p>10){if(Date.now()>u)return n(),c;p=0}}}#ce(){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.#ce(),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.#de()}#de(){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,s=t.height;let a,o,l=Math.max(Math.hypot(e[0],e[1]),1),c=Math.max(Math.hypot(e[2],e[3]),1),d=n,h=s,u="prescale1";for(;l>2&&d>1||c>2&&h>1;){let e=d,n=h;l>2&&d>1&&(e=d>=16384?Math.floor(d/2)-1||1:Math.ceil(d/2),l/=d/e),c>2&&h>1&&(n=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h)/2,c/=h/n),a=this.cachedCanvases.getCanvas(u,e,n),o=a.context,o.clearRect(0,0,e,n),o.drawImage(t,0,0,d,h,0,0,e,n),t=a.canvas,d=e,h=n,u="prescale1"===u?"prescale2":"prescale1"}return{img:t,paintWidth:d,paintHeight:h}}_createMaskCanvas(t){const e=this.ctx,{width:n,height:l}=t,c=this.current.fillColor,d=this.current.patternFill,h=(0,a.getCurrentTransform)(e);let u,p,g,m;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;p=JSON.stringify(d?h:[h.slice(0,4),c]),u=this._cachedBitmapsMap.get(e),u||(u=new Map,this._cachedBitmapsMap.set(e,u));const n=u.get(p);if(n&&!d){return{canvas:n,offsetX:Math.round(Math.min(h[0],h[2])+h[4]),offsetY:Math.round(Math.min(h[1],h[3])+h[5])}}g=n}g||(m=this.cachedCanvases.getCanvas("maskCanvas",n,l),putBinaryImageMask(m.context,t));let f=s.Util.transform(h,[1/n,0,0,-1/l,0,0]);f=s.Util.transform(f,[1,0,0,1,0,-l]);const b=s.Util.applyTransform([0,0],f),A=s.Util.applyTransform([n,l],f),v=s.Util.normalizeRect([b[0],b[1],A[0],A[1]]),y=Math.round(v[2]-v[0])||1,_=Math.round(v[3]-v[1])||1,S=this.cachedCanvases.getCanvas("fillCanvas",y,_),x=S.context,E=Math.min(b[0],A[0]),w=Math.min(b[1],A[1]);x.translate(-E,-w),x.transform(...f),g||(g=this._scaleImage(m.canvas,(0,a.getCurrentTransformInverse)(x)
vendor: 9,969 bytes, line 2
2),g=g.img,u&&d&&u.set(p,g)),x.imageSmoothingEnabled=getImageSmoothingEnabled((0,a.getCurrentTransform)(x),t.interpolate),drawImageAtIntegerCoords(x,g,0,0,g.width,g.height,0,0,n,l),x.globalCompositeOperation="source-in";const C=s.Util.transform((0,a.getCurrentTransformInverse)(x),[1,0,0,1,-E,-w]);return x.fillStyle=d?c.getPattern(e,this,C,o.PathType.FILL):c,x.fillRect(0,0,n,l),u&&!d&&(this.cachedCanvases.delete("fillCanvas"),u.set(p,S.canvas)),{canvas:S.canvas,offsetX:Math.round(E),offsetY:Math.round(w)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=h[t]}setLineJoin(t){this.ctx.lineJoin=u[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,s=this.cachedCanvases.getCanvas(n,t,e);this.suspendedCtx=this.ctx,this.ctx=s.context;const o=this.ctx;o.setTransform(...(0,a.getCurrentTransform)(this.suspendedCtx)),copyCtxState(this.suspendedCtx,o),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,s,a,o,l){e.transform(t,n,s,a,o,l),this.__originalTransform(t,n,s,a,o,l)},t.setTransform=function ctxSetTransform(t,n,s,a,o,l){e.setTransform(t,n,s,a,o,l),this.__originalSetTransform(t,n,s,a,o,l)},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,s,a,o,l){e.bezierCurveTo(t,n,s,a,o,l),this.__originalBezierCurveTo(t,n,s,a,o,l)},t.rect=function(t,n,s,a){e.rect(t,n,s,a),this.__originalRect(t,n,s,a)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(o,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,s,a,o){this.ctx.transform(t,e,n,s,a,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,n){const o=this.ctx,l=this.current;let c,d,h=l.x,u=l.y;const p=(0,a.getCurrentTransform)(o),g=0===p[0]&&0===p[3]||0===p[1]&&0===p[2],m=g?n.slice(0):null;for(let a=0,f=0,b=t.length;a<b;a++)switch(0|t[a]){case s.OPS.rectangle:h=e[f++],u=e[f++];const t=e[f++],n=e[f++],a=h+t,b=u+n;o.moveTo(h,u),0===t||0===n?o.lineTo(a,b):(o.lineTo(a,u),o.lineTo(a,b),o.lineTo(h,b)),g||l.updateRectMinMax(p,[h,u,a,b]),o.closePath();break;case s.OPS.moveTo:h=e[f++],u=e[f++],o.moveTo(h,u),g||l.updatePathMinMax(p,h,u);break;case s.OPS.lineTo:h=e[f++],u=e[f++],o.lineTo(h,u),g||l.updatePathMinMax(p,h,u);break;case s.OPS.curveTo:c=h,d=u,h=e[f+4],u=e[f+5],o.bezierCurveTo(e[f],e[f+1],e[f+2],e[f+3],h,u),l.updateCurvePathMinMax(p,c,d,e[f],e[f+1],e[f+2],e[f+3],h,u,m),f+=6;break;case s.OPS.curveTo2:c=h,d=u,o.bezierCurveTo(h,u,e[f],e[f+1],e[f+2],e[f+3]),l.updateCurvePathMinMax(p,c,d,h,u,e[f],e[f+1],e[f+2],e[f+3],m),h=e[f+2],u=e[f+3],f+=4;break;case s.OPS.curveTo3:c=h,d=u,h=e[f+2],u=e[f+3],o.bezierCurveTo(e[f],e[f+1],h,u,h,u),l.updateCurvePathMinMax(p,c,d,e[f],e[f+1],h,u,h,u,m),f+=4;break;case s.OPS.closePath:o.closePath()}g&&l.updateScalingPathMinMax(p,m),l.setCurrentPoint(h,u)}closePath(){this.ctx.closePath()}stroke(t=!0){const e=this.ctx,n=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"===typeof n&&n?.getPattern?(e.save(),e.strokeStyle=n.getPattern(e,this,(0,a.getCurrentTransformInverse)(e),o.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(t=!0){const e=this.ctx,n=this.current.fillColor;let s=!1;this.current.patternFill&&(e.save(),e.fillStyle=n.getPattern(e,this,(0,a.getCurrentTransformInverse)(e),o.PathType.FILL),s=!0);const l=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==l&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),s&&e.restore(),t&&this.consumePath(l)}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=p}eoClip(){this.pendingClip=g}beginText(){this.current.textMatrix=s.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){const n=this.commonObjs.get(t),a=this.current;if(!n)throw new Error(`Can't find font for ${t}`);if(a.fontMatrix=n.fontMatrix||s.FONT_IDENTITY_MATRIX,0!==a.fontMatrix[0]&&0!==a.fontMatrix[3]||(0,s.warn)("Invalid font matrix for font "+t),e<0?(e=-e,a.fontDirection=-1):a.fontDirection=1,this.current.font=n,this.current.fontSize=e,n.isType3Font)return;const o=n.loadedName||"sans-serif",l=n.systemFontInfo?.css||`"${o}", ${n.fallbackName}`;let c="normal";n.black?c="900":n.bold&&(c="bold");const d=n.italic?"italic":"normal";let h=e;e<16?h=16:e>100&&(h=100),this.current.fontSizeScale=e/h,this.ctx.font=`${d} ${c} ${h}px ${l}`}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,s,a,o){this.current.textMatrix=[t,e,n,s,a,o],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)}
2paintChar(t,e,n,o){const l=this.ctx,c=this.current,d=c.font,h=c.textRenderingMode,u=c.fontSize/c.fontSizeScale,p=h&s.TextRenderingMode.FILL_STROKE_MASK,g=!!(h&s.TextRenderingMode.ADD_TO_PATH_FLAG),m=c.patternFill&&!d.missingFile;let f;if((d.disableFontFace||g||m)&&(f=d.getPathGenerator(this.commonObjs,t)),d.disableFontFace||m?(l.save(),l.translate(e,n),l.beginPath(),f(l,u),o&&l.setTransform(...o),p!==s.TextRenderingMode.FILL&&p!==s.TextRenderingMode.FILL_STROKE||l.fill(),p!==s.TextRenderingMode.STROKE&&p!==s.TextRenderingMode.FILL_STROKE||l.stroke(),l.restore()):(p!==s.TextRenderingMode.FILL&&p!==s.TextRenderingMode.FILL_STROKE||l.fillText(t,e,n),p!==s.TextRenderingMode.STROKE&&p!==s.TextRenderingMode.FILL_STROKE||l.strokeText(t,e,n)),g){(this.pendingTextPaths||=[]).push({transform:(0,a.getCurrentTransform)(l),x:e,y:n,fontSize:u,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 s=3;s<e.length;s+=4)if(e[s]>0&&e[s]<255){n=!0;break}return(0,s.shadow)(this,"isFontSubpixelAAEnabled",n)}showText(t){const e=this.current,n=e.font;if(n.isType3Font)return this.showType3Text(t);const l=e.fontSize;if(0===l)return;const c=this.ctx,d=e.fontSizeScale,h=e.charSpacing,u=e.wordSpacing,p=e.fontDirection,g=e.textHScale*p,m=t.length,f=n.vertical,b=f?1:-1,A=n.defaultVMetrics,v=l*e.fontMatrix[0],y=e.textRenderingMode===s.TextRenderingMode.FILL&&!n.disableFontFace&&!e.patternFill;let _;if(c.save(),c.transform(...e.textMatrix),c.translate(e.x,e.y+e.textRise),p>0?c.scale(g,-1):c.scale(g,1),e.patternFill){c.save();const t=e.fillColor.getPattern(c,this,(0,a.getCurrentTransformInverse)(c),o.PathType.FILL);_=(0,a.getCurrentTransform)(c),c.restore(),c.fillStyle=t}let S=e.lineWidth;const x=e.textMatrixScale;if(0===x||0===S){const t=e.textRenderingMode&s.TextRenderingMode.FILL_STROKE_MASK;t!==s.TextRenderingMode.STROKE&&t!==s.TextRenderingMode.FILL_STROKE||(S=this.getSinglePixelWidth())}else S/=x;if(1!==d&&(c.scale(d,d),S/=d),c.lineWidth=S,n.isInvalidPDFjsFont){const n=[];let s=0;for(const e of t)n.push(e.unicode),s+=e.width;return c.fillText(n.join(""),0,0),e.x+=s*v*g,c.restore(),void this.compose()}let E,w=0;for(E=0;E<m;++E){const e=t[E];if("number"===typeof e){w+=b*e*l/1e3;continue}let s=!1;const a=(e.isSpace?u:0)+h,o=e.fontChar,g=e.accent;let m,S,x=e.width;if(f){const t=e.vmetric||A,n=-(e.vmetric?t[1]:.5*x)*v,s=t[2]*v;x=t?-t[0]:x,m=n/d,S=(w+s)/d}else m=w/d,S=0;if(n.remeasure&&x>0){const t=1e3*c.measureText(o).width/l*d;if(x<t&&this.isFontSubpixelAAEnabled){const e=x/t;s=!0,c.save(),c.scale(e,1),m/=e}else x!==t&&(m+=(x-t)/2e3*l/d)}if(this.contentVisible&&(e.isInFont||n.missingFile))if(y&&!g)c.fillText(o,m,S);else if(this.paintChar(o,m,S,_),g){const t=m+l*g.offset.x/d,e=S-l*g.offset.y/d;this.paintChar(g.fontChar,t,e,_)}w+=f?x*v-a*p:x*v+a*p,s&&c.restore()}f?e.y-=w:e.x+=w*g,c.restore(),this.compose()}showType3Text(t){const e=this.ctx,n=this.current,a=n.font,o=n.fontSize,l=n.fontDirection,c=a.vertical?1:-1,d=n.charSpacing,h=n.wordSpacing,u=n.textHScale*l,p=n.fontMatrix||s.FONT_IDENTITY_MATRIX,g=t.length;let m,f,b,A;if(!(n.textRenderingMode===s.TextRenderingMode.INVISIBLE)&&0!==o){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...n.textMatrix),e.translate(n.x,n.y),e.scale(u,l),m=0;m<g;++m){if(f=t[m],"number"===typeof f){A=c*f*o/1e3,this.ctx.translate(A,0),n.x+=A*u;continue}const l=(f.isSpace?h:0)+d,g=a.charProcOperatorList[f.operatorListId];if(!g){(0,s.warn)(`Type3 character "${f.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=f,this.save(),e.scale(o,o),e.transform(...p),this.executeOperatorList(g),this.restore());b=s.Util.applyTransform([f.width,0],p)[0]*o+l,e.translate(b,0),n.x+=b*u}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,n,s,a,o){this.ctx.rect(n,s,a-n,o-s),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const n=t[1],s=this.baseTransform||(0,a.getCurrentTransform)(this.ctx),l={createCanvasGraphics:t=>new CanvasGraphics(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new o.TilingPattern(t,n,this.ctx,l,s)}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 a=s.Util.makeHexColor(t,e,n);this.ctx.strokeStyle=a,this.current.strokeColor=a}setFillRGBColor(t,e,n){const a=s.Util.makeHexColor(t,e,n);this.ctx.fillStyle=a,this.current.fillColor=a,this.current.patternFill=!1}_getPattern(t,e=null){let n;return this.cachedPatterns.has(t)?n=this.cachedPatterns.get(t):(n=(0,o.getShadingPattern)(this.getObject(t)),this.cachedPatterns.set(t,n)),e&&(n.matrix=e),n}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const n=this._getPattern(t);e.fillStyle=n.getPattern(e,this,(0,a.getCurrentTransformInverse)(e),o.PathType.SHADING);const l=(0,a.getCurrentTransformInverse)(e);if(l){const{width:t,height:n}=e.canvas,[a,o,c,d]=s.Util.getAxialAlignedBoundingBox([0,0,t,n],l);this.ctx.fillRect(a,o,c-a,d-o)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore(
vendor: 8,296 bytes, line 2
2)}beginInlineImage(){(0,s.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,s.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,a.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,a.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,s.info)("TODO: Support non-isolated groups."),t.knockout&&(0,s.warn)("Knockout groups not supported.");const n=(0,a.getCurrentTransform)(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let o=s.Util.getAxialAlignedBoundingBox(t.bbox,(0,a.getCurrentTransform)(e));const l=[0,0,e.canvas.width,e.canvas.height];o=s.Util.intersect(o,l)||[0,0,0,0];const d=Math.floor(o[0]),h=Math.floor(o[1]);let u=Math.max(Math.ceil(o[2])-d,1),p=Math.max(Math.ceil(o[3])-h,1),g=1,m=1;u>c&&(g=u/c,u=c),p>c&&(m=p/c,p=c),this.current.startNewPathAndClipBox([0,0,u,p]);let f="groupAt"+this.groupLevel;t.smask&&(f+="_smask_"+this.smaskCounter++%2);const b=this.cachedCanvases.getCanvas(f,u,p),A=b.context;A.scale(1/g,1/m),A.translate(-d,-h),A.transform(...n),t.smask?this.smaskStack.push({canvas:b.canvas,context:A,offsetX:d,offsetY:h,scaleX:g,scaleY:m,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(d,h),e.scale(g,m),e.save()),copyCtxState(e,A),this.ctx=A,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,a.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const n=s.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,o,l){if(this.#ce(),resetCtxToDefault(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(e)&&4===e.length){const o=e[2]-e[0],c=e[3]-e[1];if(l&&this.annotationCanvasMap){(n=n.slice())[4]-=e[0],n[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=o,e[3]=c;const[l,d]=s.Util.singularValueDecompose2dScale((0,a.getCurrentTransform)(this.ctx)),{viewportScale:h}=this,u=Math.ceil(o*this.outputScaleX*h),p=Math.ceil(c*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(u,p);const{canvas:g,context:m}=this.annotationCanvas;this.annotationCanvasMap.set(t,g),this.annotationCanvas.savedCtx=this.ctx,this.ctx=m,this.ctx.save(),this.ctx.setTransform(l,0,0,-d,0,c*d),resetCtxToDefault(this.ctx)}else resetCtxToDefault(this.ctx),this.ctx.rect(e[0],e[1],o,c),this.ctx.clip(),this.endPath()}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...o)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#de(),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,s=this.processingType3;if(s&&(void 0===s.compiled&&(s.compiled=function compileType3Glyph(t){const{width:e,height:n}=t;if(e>1e3||n>1e3)return null;const s=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),a=e+1;let o,l,c,d=new Uint8Array(a*(n+1));const h=e+7&-8;let u=new Uint8Array(h*n),p=0;for(const b of t.data){let t=128;for(;t>0;)u[p++]=b&t?0:255,t>>=1}let g=0;for(p=0,0!==u[p]&&(d[0]=1,++g),l=1;l<e;l++)u[p]!==u[p+1]&&(d[l]=u[p]?2:1,++g),p++;for(0!==u[p]&&(d[l]=2,++g),o=1;o<n;o++){p=o*h,c=o*a,u[p-h]!==u[p]&&(d[c]=u[p]?1:8,++g);let t=(u[p]?4:0)+(u[p-h]?8:0);for(l=1;l<e;l++)t=(t>>2)+(u[p+1]?4:0)+(u[p-h+1]?8:0),s[t]&&(d[c+l]=s[t],++g),p++;if(u[p-h]!==u[p]&&(d[c+l]=u[p]?2:4,++g),g>1e3)return null}for(p=h*(n-1),c=o*a,0!==u[p]&&(d[c]=8,++g),l=1;l<e;l++)u[p]!==u[p+1]&&(d[c+l]=u[p]?4:8,++g),p++;if(0!==u[p]&&(d[c+l]=4,++g),g>1e3)return null;const m=new Int32Array([0,a,-1,0,-a,0,0,0,1]),f=new Path2D;for(o=0;g&&o<=n;o++){let t=o*a;const n=t+e;for(;t<n&&!d[t];)t++;if(t===n)continue;f.moveTo(t%a,o);const s=t;let l=d[t];do{const e=m[l];do{t+=e}while(!d[t]);const n=d[t];5!==n&&10!==n?(l=n,d[t]=0):(l=n&51*l>>4,d[t]&=l>>2|l<<2),f.lineTo(t%a,t/a|0),d[t]||--g}while(s!==t);--o}return u=null,d=null,function(t){t.save(),t.scale(1/e,-1/n),t.translate(0,-n),t.fill(f),t.beginPath(),t.restore()}}(t)),s.compiled))return void s.compiled(n);const a=this._createMaskCanvas(t),o=a.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(o,a.offsetX,a.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,n=0,o=0,l,c){if(!this.contentVisible)return;t=this.getObject(t.data,t);const d=this.ctx;d.save();const h=(0,a.getCurrentTransform)(d);d.transform(e,n,o,l,0,0);const u=this._createMaskCanvas(t);d.setTransform(1,0,0,1,u.offsetX-h[4],u.offsetY-h[5]);for(let a=0,p=c.length;a<p;a+=2){const t=s.Util.transform(h,[e,n,o,l,c[a],c[a+1]]),[p,g]=s.Util.applyTransform([0,0],t);d.drawImage(u.canvas,p,g)}d.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,n=this.current.fillColor,s=this.current.patternFill;for(const l of t){const{data:t,width:c,height:d,transform:h}=l,u=this.cachedCanvases.getCanvas("maskCanvas",c,d),p=u.context;p.save();putBinaryImageMask(p,this.getObject(t,l)),p.globalCompositeOperation="source-in",p.fillStyle=s?n.getPattern(p,this,(0,a.getCurrentTransformInverse)(e),o.PathType.FILL):n,p.fillRect(0,0,c,d),p.restore(),e.save(),e.transform(...h),e.scale(1,-1),drawImageAtIntegerCoords(e,u.canvas,0,0,c,d,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,s.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,n,a){if(!this.contentVisible)return;const o=this.getObject(t);if(!o)return void(0,s.warn)("Dependent image isn't ready yet");const l=o.width,c=o.height,d=[];for(let s=0,h=a.length;s<h;s+=2)d.push({transform:[e,0,0,n,a[s],a[s+1]],x:0,y:0,w:l,h:c});this.paintInlineImageXObjectGroup(o,d)}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:s}=t,a=this.cachedCanvases.getCanvas("inlineImage",n,s),o=a.context;return o.filter=this.current.transferMaps,o.drawImage(e,0,0),o.filter="none",a.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,n=t.height,o=this.ctx;if(this.save(),!s.isNodeJS){const{filter:t}=o;"none"!==t&&""!==t&&(o.filter="none")}let l;if(o.scale(1/e,-1/n),t.bitmap)l=this.applyTransferMapsToBitmap(t);else if("function"===typeof HTMLElement&&t instanceof HTMLElement||!t.data)l=t;else{const s=this.cachedCanvases.getCanvas("inlineImage",e,n).context;putBinaryImageData(s,t),l=this.applyTransferMapsToCanvas(s)}const c=this._scaleImage(l,(0,a.getCurrentTransformInverse)(o));o.imageSmoothingEnabled=getImageSmoothingEnabled((0,a.getCurrentTransform)(o),t.interpolate),drawImageAtIntegerCoords(o,c.img,0,0,c.paintWidth,c.paintHeight,0,-n,e,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const n=this.ctx;let s;if(t.bitmap)s=t.bitmap;else{const e=t.width,n=t.height,a=this.cachedCanvases.getCanvas("inlineImage",e,n).context;putBinaryImageData(a,t),s=this.applyTransferMapsToCanvas(a)}for(const a of e)n.save(),n.transform(...a.transform),n.scale(1,-1),drawImageAtIntegerCoords(n,s,a.x,a.y,a.w,a.h,0,-1,1,1),n.restore(
2);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===g?n.clip("evenodd"):n.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),n.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=(0,a.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]),s=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(n,s)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:n,c:s,d:a}=this.ctx.getTransform();let o,l;if(0===n&&0===s){const n=Math.abs(e),s=Math.abs(a);if(n===s)if(0===t)o=l=1/n;else{const e=n*t;o=l=e<1?1/e:1}else if(0===t)o=1/n,l=1/s;else{const e=n*t,a=s*t;o=e<1?1/e:1,l=a<1?1/a:1}}else{const c=Math.abs(e*a-n*s),d=Math.hypot(e,n),h=Math.hypot(s,a);if(0===t)o=h/c,l=d/c;else{const e=t*c;o=h>e?h/e:1,l=d>e?d/e:1}}this._cachedScaleForStroking[0]=o,this._cachedScaleForStroking[1]=l}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:n}=this.current,[s,a]=this.getScaleForStroking();if(e.lineWidth=n||1,1===s&&1===a)return void e.stroke();const o=e.getLineDash();if(t&&e.save(),e.scale(s,a),o.length>0){const t=Math.max(s,a);e.setLineDash(o.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 m in s.OPS)void 0!==CanvasGraphics.prototype[m]&&(CanvasGraphics.prototype[s.OPS[m]]=CanvasGraphics.prototype[m])},(t,e,n)=>{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 s=n(1),a=n(6);const o={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function applyBoundingBox(t,e){if(!e)return;const n=e[2]-e[0],s=e[3]-e[1],a=new Path2D;a.rect(e[0],e[1],n,s),t.clip(a)}e.PathType=o;class BaseShadingPattern{constructor(){this.constructor===BaseShadingPattern&&(0,s.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,s.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 n of this._colorStops)e.addColorStop(n[0],n[1]);return e}getPattern(t,e,n,l){let c;if(l===o.STROKE||l===o.FILL){const o=e.current.getClippedPathBoundingBox(l,(0,a.getCurrentTransform)(t))||[0,0,0,0],d=Math.ceil(o[2]-o[0])||1,h=Math.ceil(o[3]-o[1])||1,u=e.cachedCanvases.getCanvas("pattern",d,h,!0),p=u.context;p.clearRect(0,0,p.canvas.width,p.canvas.height),p.beginPath(),p.rect(0,0,p.canvas.width,p.canvas.height),p.translate(-o[0],-o[1]),n=s.Util.transform(n,[1,0,0,1,o[0],o[1]]),p.transform(...e.baseTransform),this.matrix&&p.transform(...this.matrix
vendor: 5,357 bytes, line 2
2),applyBoundingBox(p,this._bbox),p.fillStyle=this._createGradient(p),p.fill(),c=t.createPattern(u.canvas,"no-repeat");const g=new DOMMatrix(n);c.setTransform(g)}else applyBoundingBox(t,this._bbox),c=this._createGradient(t);return c}}function drawTriangle(t,e,n,s,a,o,l,c){const d=e.coords,h=e.colors,u=t.data,p=4*t.width;let g;d[n+1]>d[s+1]&&(g=n,n=s,s=g,g=o,o=l,l=g),d[s+1]>d[a+1]&&(g=s,s=a,a=g,g=l,l=c,c=g),d[n+1]>d[s+1]&&(g=n,n=s,s=g,g=o,o=l,l=g);const m=(d[n]+e.offsetX)*e.scaleX,f=(d[n+1]+e.offsetY)*e.scaleY,b=(d[s]+e.offsetX)*e.scaleX,A=(d[s+1]+e.offsetY)*e.scaleY,v=(d[a]+e.offsetX)*e.scaleX,y=(d[a+1]+e.offsetY)*e.scaleY;if(f>=y)return;const _=h[o],S=h[o+1],x=h[o+2],E=h[l],w=h[l+1],C=h[l+2],T=h[c],P=h[c+1],k=h[c+2],M=Math.round(f),R=Math.round(y);let F,D,I,L,O,N,B,j;for(let U=M;U<=R;U++){if(U<A){const t=U<f?0:(f-U)/(f-A);F=m-(m-b)*t,D=_-(_-E)*t,I=S-(S-w)*t,L=x-(x-C)*t}else{let t;t=U>y?1:A===y?0:(A-U)/(A-y),F=b-(b-v)*t,D=E-(E-T)*t,I=w-(w-P)*t,L=C-(C-k)*t}let t;t=U<f?0:U>y?1:(f-U)/(f-y),O=m-(m-v)*t,N=_-(_-T)*t,B=S-(S-P)*t,j=x-(x-k)*t;const e=Math.round(Math.min(F,O)),n=Math.round(Math.max(F,O));let s=p*U+4*e;for(let a=e;a<=n;a++)t=(F-a)/(F-O),t<0?t=0:t>1&&(t=1),u[s++]=D-(D-N)*t|0,u[s++]=I-(I-B)*t|0,u[s++]=L-(L-j)*t|0,u[s++]=255}}function drawFigure(t,e,n){const s=e.coords,a=e.colors;let o,l;switch(e.type){case"lattice":const c=e.verticesPerRow,d=Math.floor(s.length/c)-1,h=c-1;for(o=0;o<d;o++){let e=o*c;for(let o=0;o<h;o++,e++)drawTriangle(t,n,s[e],s[e+1],s[e+c],a[e],a[e+1],a[e+c]),drawTriangle(t,n,s[e+c+1],s[e+1],s[e+c],a[e+c+1],a[e+1],a[e+c])}break;case"triangles":for(o=0,l=s.length;o<l;o+=3)drawTriangle(t,n,s[o],s[o+1],s[o+2],a[o],a[o+1],a[o+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 s=Math.floor(this._bounds[0]),a=Math.floor(this._bounds[1]),o=Math.ceil(this._bounds[2])-s,l=Math.ceil(this._bounds[3])-a,c=Math.min(Math.ceil(Math.abs(o*t[0]*1.1)),3e3),d=Math.min(Math.ceil(Math.abs(l*t[1]*1.1)),3e3),h=o/c,u=l/d,p={coords:this._coords,colors:this._colors,offsetX:-s,offsetY:-a,scaleX:1/h,scaleY:1/u},g=c+4,m=d+4,f=n.getCanvas("mesh",g,m,!1),b=f.context,A=b.createImageData(c,d);if(e){const t=A.data;for(let n=0,s=t.length;n<s;n+=4)t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=255}for(const v of this._figures)drawFigure(A,v,p);b.putImageData(A,2,2);return{canvas:f.canvas,offsetX:s-2*h,offsetY:a-2*u,scaleX:h,scaleY:u}}getPattern(t,e,n,l){let c;if(applyBoundingBox(t,this._bbox),l===o.SHADING)c=s.Util.singularValueDecompose2dScale((0,a.getCurrentTransform)(t));else if(c=s.Util.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=s.Util.singularValueDecompose2dScale(this.matrix);c=[c[0]*t[0],c[1]*t[1]]}const d=this._createMeshCanvas(c,l===o.SHADING?null:this._background,e.cachedCanvases);return l!==o.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(d.offsetX,d.offsetY),t.scale(d.scaleX,d.scaleY),t.createPattern(d.canvas,"no-repeat")}}class DummyShadingPattern extends BaseShadingPattern{getPattern(){return"hotpink"}}const l=1,c=2;class TilingPattern{static MAX_PATTERN_SIZE=3e3;constructor(t,e,n,s,a){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=s,this.baseTransform=a}createPatternCanvas(t){const e=this.operatorList,n=this.bbox,o=this.xstep,l=this.ystep,c=this.paintType,d=this.tilingType,h=this.color,u=this.canvasGraphicsFactory;(0,s.info)("TilingType: "+d);const p=n[0],g=n[1],m=n[2],f=n[3],b=s.Util.singularValueDecompose2dScale(this.matrix),A=s.Util.singularValueDecompose2dScale(this.baseTransform),v=[b[0]*A[0],b[1]*A[1]],y=this.getSizeAndScale(o,this.ctx.canvas.width,v[0]),_=this.getSizeAndScale(l,this.ctx.canvas.height,v[1]),S=t.cachedCanvases.getCanvas("pattern",y.size,_.size,!0),x=S.context,E=u.createCanvasGraphics(x);E.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(E,c,h);let w=p,C=g,T=m,P=f;return p<0&&(w=0,T+=Math.abs(p)),g<0&&(C=0,P+=Math.abs(g)),x.translate(-y.scale*w,-_.scale*C),E.transform(y.scale,0,0,_.scale,0,0),x.save(),this.clipBbox(E,w,C,T,P),E.baseTransform=(0,a.getCurrentTransform)(E.ctx),E.executeOperatorList(e),E.endDrawing(),{canvas:S.canvas,scaleX:y.scale,scaleY:_.scale,offsetX:w,offsetY:C}}getSizeAndScale(t,e,n){t=Math.abs(t);const s=Math.max(TilingPattern.MAX_PATTERN_SIZE,e);let a=Math.ceil(t*n);return a>=s?a=s:n=a/t,{scale:n,size:a}}clipBbox(t,e,n,s,o){const l=s-e,c=o-n;t.ctx.rect(e,n,l,c),t.current.updateRectMinMax((0,a.getCurrentTransform)(t.ctx),[e,n,s,o]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,n){const a=t.ctx,o=t.current;switch(e){case l:const t=this.ctx;a.fillStyle=t.fillStyle,a.strokeStyle=t.strokeStyle,o.fillColor=t.fillStyle,o.strokeColor=t.strokeStyle;break;case c:const d=s.Util.makeHexColor(n[0],n[1],n[2]);a.fillStyle=d,a.strokeStyle=d,o.fillColor=d,o.strokeColor=d;break;default:throw new s.FormatError(`Unsupported paint type: ${e}`)}}getPattern(t,e,n,a){let l=n;a!==o.SHADING&&(l=s.Util.transform(l,e.baseTransform),this.matrix&&(l=s.Util.transform(l,this.matrix
2)));const c=this.createPatternCanvas(e);let d=new DOMMatrix(l);d=d.translate(c.offsetX,c.offsetY),d=d.scale(1/c.scaleX,1/c.scaleY);const h=t.createPattern(c.canvas,"repeat");return h.setTransform(d),h}}e.TilingPattern=TilingPattern},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertBlackAndWhiteToRGBA=convertBlackAndWhiteToRGBA,e.convertToRGBA=function convertToRGBA(t){switch(t.kind){case s.ImageKind.GRAYSCALE_1BPP:return convertBlackAndWhiteToRGBA(t);case s.ImageKind.RGB_24BPP:return function convertRGBToRGBA({src:t,srcPos:e=0,dest:n,destPos:a=0,width:o,height:l}){let c=0;const d=t.length>>2,h=new Uint32Array(t.buffer,e,d);if(s.FeatureTest.isLittleEndian){for(;c<d-2;c+=3,a+=4){const t=h[c],e=h[c+1],s=h[c+2];n[a]=4278190080|t,n[a+1]=t>>>24|e<<8|4278190080,n[a+2]=e>>>16|s<<16|4278190080,n[a+3]=s>>>8|4278190080}for(let e=4*c,s=t.length;e<s;e+=3)n[a++]=t[e]|t[e+1]<<8|t[e+2]<<16|4278190080}else{for(;c<d-2;c+=3,a+=4){const t=h[c],e=h[c+1],s=h[c+2];n[a]=255|t,n[a+1]=t<<24|e>>>8|255,n[a+2]=e<<16|s>>>16|255,n[a+3]=s<<8|255}for(let e=4*c,s=t.length;e<s;e+=3)n[a++]=t[e]<<24|t[e+1]<<16|t[e+2]<<8|255}return{srcPos:e,destPos:a}}(t)}return null},e.grayToRGBA=function grayToRGBA(t,e){if(s.FeatureTest.isLittleEndian)for(let n=0,s=t.length;n<s;n++)e[n]=65793*t[n]|4278190080;else for(let n=0,s=t.length;n<s;n++)e[n]=16843008*t[n]|255};var s=n(1);function convertBlackAndWhiteToRGBA({src:t,srcPos:e=0,dest:n,width:a,height:o,nonBlackColor:l=4294967295,inverseDecode:c=!1}){const d=s.FeatureTest.isLittleEndian?4278190080:255,[h,u]=c?[l,d]:[d,l],p=a>>3,g=7&a,m=t.length;n=new Uint32Array(n.buffer);let f=0;for(let s=0;s<o;s++){for(const a=e+p;e<a;e++){const s=e<m?t[e]:255;n[f++]=128&s?u:h,n[f++]=64&s?u:h,n[f++]=32&s?u:h,n[f++]=16&s?u:h,n[f++]=8&s?u:h,n[f++]=4&s?u:h,n[f++]=2&s?u:h,n[f++]=1&s?u:h}if(0===g)continue;const s=e<m?t[e++]:255;for(let t=0;t<g;t++)n[f++]=s&1<<7-t?u:h}return{srcPos:e,destPos:f}}},(t,e)=>{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)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;var s=n(1);const a=1,o=2,l=1,c=2,d=3,h=4,u=5,p=6,g=7,m=8;function wrapReason(t){switch(t instanceof Error||"object"===typeof t&&null!==t||(0,s.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new s.AbortException(t.message);case"MissingPDFException":return new s.MissingPDFException(t.message);case"PasswordException":return new s.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new s.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new s.UnknownErrorException(t.message,t.details);default:return new s.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.#he(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===a)n.resolve(e.data);else{if(e.callback!==o)throw new Error("Unexpected callback case");n.reject(wrapReason(e.reason))}return}const s=this.actionHandler[e.action];if(!s)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,l=e.sourceName;return void new Promise(function(t){t(s(e.data))}).then(function(s){n.postMessage({sourceName:t,targetName:l,callback:a,callbackId:e.callbackId,data:s})},function(s){n.postMessage({sourceName:t,targetName:l,callback:o,callbackId:e.callbackId,reason:wrapReason(s)})})}e.streamId?this.#ue(e):s(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)}
2sendWithPromise(t,e,n){const a=this.callbackId++,o=new s.PromiseCapability;this.callbackCapabilities[a]=o;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:a,data:e},n)}catch(l){o.reject(l)}return o.promise}sendWithStream(t,e,n,a){const o=this.streamId++,c=this.sourceName,d=this.targetName,h=this.comObj;return new ReadableStream({start:n=>{const l=new s.PromiseCapability;return this.streamControllers[o]={controller:n,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},h.postMessage({sourceName:c,targetName:d,action:t,streamId:o,data:e,desiredSize:n.desiredSize},a),l.promise},pull:t=>{const e=new s.PromiseCapability;return this.streamControllers[o].pullCall=e,h.postMessage({sourceName:c,targetName:d,stream:p,streamId:o,desiredSize:t.desiredSize}),e.promise},cancel:t=>{(0,s.assert)(t instanceof Error,"cancel must have a valid reason");const e=new s.PromiseCapability;return this.streamControllers[o].cancelCall=e,this.streamControllers[o].isClosed=!0,h.postMessage({sourceName:c,targetName:d,stream:l,streamId:o,reason:wrapReason(t)}),e.promise}},n)}#ue(t){const e=t.streamId,n=this.sourceName,a=t.sourceName,o=this.comObj,l=this,c=this.actionHandler[t.action],p={enqueue(t,l=1,c){if(this.isCancelled)return;const d=this.desiredSize;this.desiredSize-=l,d>0&&this.desiredSize<=0&&(this.sinkCapability=new s.PromiseCapability,this.ready=this.sinkCapability.promise),o.postMessage({sourceName:n,targetName:a,stream:h,streamId:e,chunk:t},c)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:a,stream:d,streamId:e}),delete l.streamSinks[e])},error(t){(0,s.assert)(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:a,stream:u,streamId:e,reason:wrapReason(t)}))},sinkCapability:new s.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};p.sinkCapability.resolve(),p.ready=p.sinkCapability.promise,this.streamSinks[e]=p,new Promise(function(e){e(c(t.data,p))}).then(function(){o.postMessage({sourceName:n,targetName:a,stream:m,streamId:e,success:!0})},function(t){o.postMessage({sourceName:n,targetName:a,stream:m,streamId:e,reason:wrapReason(t)})})}#he(t){const e=t.streamId,n=this.sourceName,a=t.sourceName,o=this.comObj,f=this.streamControllers[e],b=this.streamSinks[e];switch(t.stream){case m:t.success?f.startCall.resolve():f.startCall.reject(wrapReason(t.reason));break;case g:t.success?f.pullCall.resolve():f.pullCall.reject(wrapReason(t.reason));break;case p:if(!b){o.postMessage({sourceName:n,targetName:a,stream:g,streamId:e,success:!0});break}b.desiredSize<=0&&t.desiredSize>0&&b.sinkCapability.resolve(),b.desiredSize=t.desiredSize,new Promise(function(t){t(b.onPull?.())}).then(function(){o.postMessage({sourceName:n,targetName:a,stream:g,streamId:e,success:!0})},function(t){o.postMessage({sourceName:n,targetName:a,stream:g,streamId:e,reason:wrapReason(t)})});break;case h:if((0,s.assert)(f,"enqueue should have stream controller"),f.isClosed)break;f.controller.enqueue(t.chunk);break;case d:if((0,s.assert)(f,"close should have stream controller"),f.isClosed)break;f.isClosed=!0,f.controller.close(),this.#pe(f,e);break;case u:(0,s.assert)(f,"error should have stream controller"),f.controller.error(wrapReason(t.reason)),this.#pe(f,e);break;case c:t.success?f.cancelCall.resolve():f.cancelCall.reject(wrapReason(t.reason)),this.#pe(f,e);break;case l:if(!b)break;new Promise(function(e){e(b.onCancel?.(wrapReason(t.reason)))}).then(function(){o.postMessage({sourceName:n,targetName:a,stream:c,streamId:e,success:!0})},function(t){o.postMessage({sourceName:n,targetName:a,stream:c,streamId:e,reason:wrapReason(t)})}),b.sinkCapability.reject(wrapReason(t.reason)),b.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#pe(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(t,e,n)=>
vendor: 5,585 bytes, line 2
2{Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var s=n(1);e.Metadata=class Metadata{#ge;#me;constructor({parsedData:t,rawData:e}){this.#ge=t,this.#me=e}getRaw(){return this.#me}get(t){return this.#ge.get(t)??null}getAll(){return(0,s.objectFromMap)(this.#ge)}has(t){return this.#ge.has(t)}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalContentConfig=void 0;var s=n(1),a=n(8);const o=Symbol("INTERNAL");class OptionalContentGroup{#fe=!0;constructor(t,e){this.name=t,this.intent=e}get visible(){return this.#fe}_setVisible(t,e){t!==o&&(0,s.unreachable)("Internal method `_setVisible` called."),this.#fe=e}}e.OptionalContentConfig=class OptionalContentConfig{#be=null;#Ae=new Map;#ve=null;#ye=null;constructor(t){if(this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,this.#ye=t.order;for(const e of t.groups)this.#Ae.set(e.id,new OptionalContentGroup(e.name,e.intent));if("OFF"===t.baseState)for(const t of this.#Ae.values())t._setVisible(o,!1);for(const e of t.on)this.#Ae.get(e)._setVisible(o,!0);for(const e of t.off)this.#Ae.get(e)._setVisible(o,!1);this.#ve=this.getHash()}}#_e(t){const e=t.length;if(e<2)return!0;const n=t[0];for(let a=1;a<e;a++){const e=t[a];let o;if(Array.isArray(e))o=this.#_e(e);else{if(!this.#Ae.has(e))return(0,s.warn)(`Optional content group not found: ${e}`),!0;o=this.#Ae.get(e).visible}switch(n){case"And":if(!o)return!1;break;case"Or":if(o)return!0;break;case"Not":return!o;default:return!0}}return"And"===n}isVisible(t){if(0===this.#Ae.size)return!0;if(!t)return(0,s.warn)("Optional content group not defined."),!0;if("OCG"===t.type)return this.#Ae.has(t.id)?this.#Ae.get(t.id).visible:((0,s.warn)(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#_e(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!this.#Ae.has(e))return(0,s.warn)(`Optional content group not found: ${e}`),!0;if(this.#Ae.get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!this.#Ae.has(e))return(0,s.warn)(`Optional content group not found: ${e}`),!0;if(!this.#Ae.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!this.#Ae.has(e))return(0,s.warn)(`Optional content group not found: ${e}`),!0;if(!this.#Ae.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!this.#Ae.has(e))return(0,s.warn)(`Optional content group not found: ${e}`),!0;if(this.#Ae.get(e).visible)return!1}return!0}return(0,s.warn)(`Unknown optional content policy ${t.policy}.`),!0}return(0,s.warn)(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0){this.#Ae.has(t)?(this.#Ae.get(t)._setVisible(o,!!e),this.#be=null):(0,s.warn)(`Optional content group not found: ${t}`)}get hasInitialVisibility(){return null===this.#ve||this.getHash()===this.#ve}getOrder(){return this.#Ae.size?this.#ye?this.#ye.slice():[...this.#Ae.keys()]:null}getGroups(){return this.#Ae.size>0?(0,s.objectFromMap)(this.#Ae):null}getGroup(t){return this.#Ae.get(t)||null}getHash(){if(null!==this.#be)return this.#be;const t=new a.MurmurHash3_64;for(const[e,n]of this.#Ae)t.update(`${e}:${n.visible}`);return this.#be=t.hexdigest()}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0;var s=n(1),a=n(6);e.PDFDataTransportStream=class PDFDataTransportStream{constructor({length:t,initialData:e,progressiveDone:n=!1,contentDispositionFilename:a=null,disableRange:o=!1,disableStream:l=!1},c){if((0,s.assert)(c,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=n,this._contentDispositionFilename=a,e?.length>0){const t=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=c,this._isStreamingSupported=!l,this._isRangeSupported=!o,this._contentLength=t,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({begin:t,chunk:e}){const n=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const e=this._rangeReaders.some(function(e){return e._begin===t&&(e._enqueue(n),!0)});(0,s.assert)(e,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,s.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;
2const n=new PDFDataTransportStreamRangeReader(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(n),n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}};class PDFDataTransportStreamReader{constructor(t,e,n=!1,s=null){this._stream=t,this._done=n||!1,this._filename=(0,a.isPdfFile)(s)?s:null,this._queuedChunks=e||[],this._loaded=0;for(const a of this._queuedChunks)this._loaded+=a.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 s.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class PDFDataTransportStreamRangeReader{constructor(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 s.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0;var s=n(1),a=n(20);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 s=t[n];void 0!==s&&e.append(n,s)}return e}function getArrayBuffer(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:((0,s.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(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,s.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){this._fullRequestReader?.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 s.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,a.validateResponseStatus)(t.status))throw(0,a.createResponseStatusError)(t.status,n);this._reader=t.body.getReader(),this._headersCapability.resolve();const getResponseHeader=e=>t.headers.get(e),{allowRangeRequests:e,suggestedLength:o}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=e,this._contentLength=o||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(getResponseHeader),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new s.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:getArrayBuffer(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class PDFFetchStreamRangeReader{constructor(t,e,n){this._stream=t,this._reader=null,this._loaded=0;const o=t.source;this._withCredentials=o.withCredentials||!1,this._readCapability=new s.PromiseCapability,this._isStreamingSupported=!o.disableStream,this._abortController=new AbortController,this._headers=createHeaders(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-${n-1}`);const l=o.url;fetch(l,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!(0,a.validateResponseStatus)(t.status))throw(0,a.createResponseStatusError)(t.status,l);this._readCapability.resolve(),this._reader=t.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:getArrayBuffer(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}},(t,e,n)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=function createResponseStatusError(t,e){if(404===t||0===t&&e.startsWith("file:"))return new s.MissingPDFException('Missing PDF "'+e+'".');return new s.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,a.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if((0,o.isPdfFile)(t))return t}return null},e.validateRangeRequestCapabilities=function validateRangeRequestCapabilities({getResponseHeader:t,isHttp:e,rangeChunkSize:n,disableRange:s}){const a={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(t("Content-Length"),10);if(!Number.isInteger(o))return a;if(a.suggestedLength=o,o<=2*n)return a;if(s||!e)return a;if("bytes"!==t("Accept-Ranges"))return a;if("identity"!==(t("Content-Encoding")||"identity"))return a;return a.allowRangeRequests=!0,a},e.validateResponseStatus=function validateResponseStatus(t){return 200===t||206===t};var s=n(1),a=n(21),o=n(6)},(t,e,n)=>{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 s=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=s.exec(t));){let[,t,s,a]=n;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[s,a]}const a=[];for(let o=0;o<e.length&&o in e;++o){let[t,n]=e[o];n=rfc2616unquote(n),t&&(n=unescape(n),0===o&&(n=rfc5987decode(n))),a.push(n)}return a.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 a=new TextDecoder(t,{fatal:!0}),o=(0,s.stringToBytes)(n);n=a.decode(o),e=!1}catch{}}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,s){if("q"===n||"Q"===n)return textdecode(e,s=(s=s.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));try{s=atob(s)}catch{}return textdecode(e,s)})}return""};var s=n(1)},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0;var s=n(1),a=n(20);class NetworkManager{constructor(t,e={}){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 s={begin:t,end:e};for(const a in n)s[a]=n[a];return this.request(s)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,n=this.currXhrId++,s=this.pendingRequests[n]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const a in this.httpHeaders){const t=this.httpHeaders[a];void 0!==t&&e.setRequestHeader(a,t)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),s.expectedStatus=206):s.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),s.onHeadersReceived=t.onHeadersReceived,s.onDone=t.onDone,s.onError=t.onError,s.onProgress=t.onProgress,e.send(null),n}onProgress(t,e){const n=this.pendingRequests[t];n&&n.onProgress?.(e)}onStateChange(t,e){const n=this.pendingRequests[t];if(!n)return;const a=n.xhr;if(a.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==a.readyState)return;if(!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===a.status&&this.isHttp)return void n.onError?.(a.status);const o=a.status||200;if(!(200===o&&206===n.expectedStatus)&&o!==n.expectedStatus)return void n.onError?.(a.status);const l=function getArrayBuffer(t){const e=t.response;return"string"!==typeof e?e:(0,s.stringToBytes)(e).buffer}(a);if(206===o){const t=a.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);n.onDone({begin:parseInt(e[1],10),chunk:l})}else l?n.onDone({begin:0,chunk:l}):n.onError?.(a.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}
2abortRequest(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,s.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){this._fullRequestReader?.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 s.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:s}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=(0,a.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,a.createResponseStatusError)(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({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 s.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class PDFNetworkStreamRangeRequestReader{constructor(t,e,n){this._manager=t;const s={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,s),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const e=t.chunk;
2if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=(0,a.createResponseStatusError)(t,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({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 s.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0;var s=n(1),a=n(20);const o=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class PDFNodeStream{constructor(t){this.source=t,this.url=function parseUrl(t){const e=__webpack_require__(66671),n=e.parse(t);return"file:"===n.protocol||n.host?n:/^[a-z]:[/\\]/i.test(t)?e.parse(`file:///${t}`):(n.host||(n.protocol="file:"),n)}(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(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,s.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){this._fullRequestReader?.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 s.PromiseCapability,this._headersCapability=new s.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(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t)return this._readCapability=new s.PromiseCapability,this.read();this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(t).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 s.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 s.PromiseCapability;const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t)return this._readCapability=new s.PromiseCapability,this.read();this._loaded+=t.length,this.onProgress?.({loaded:this._loaded});return{value:new Uint8Array(t).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 s.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:o}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=o||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(getResponseHeader)};if(this._request=null,"http:"===this._url.protocol){const e=__webpack_require__(97492);this._request=e.request(createRequestOptions(this._url,t.httpHeaders),handleResponse)}else{const e=__webpack_require__(31815);this._request=e.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 s in t.httpHeaders){const e=t.httpHeaders[s];void 0!==e&&(this._httpHeaders[s]=e)}this._httpHeaders.Range=`bytes=${e}-${n-1}`;const handleResponse=t=>{if(404===t.statusCode){const t=new s.MissingPDFException(`Missing PDF "${this._url}".`);return void(this._storedError=t)}this._setReadableStream(t)};if(this._request=null,"http:"===this._url.protocol){const t=__webpack_require__(97492);this._request=t.request(createRequestOptions(this._url,this._httpHeaders),handleResponse)}else{const t=__webpack_require__(31815);this._request=t.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);o.test(this._url.href)&&(e=e.replace(/^\//,""));const n=__webpack_require__(23237);n.lstat(e,(t,a)=>{if(t)return"ENOENT"===t.code&&(t=new s.MissingPDFException(`Missing PDF "${e}".`)),this._storedError=t,void this._headersCapability.reject(t);this._contentLength=a.size,this._setReadableStream(n.createReadStream(e)),this._headersCapability.resolve()})}}class PDFNodeStreamFsRangeReader extends BaseRangeReader{constructor(t,e,n){super(t);let s=decodeURIComponent(this._url.path);o.test(this._url.href)&&(s=s.replace(/^\//,""));const a=__webpack_require__(23237);this._setReadableStream(a.createReadStream(s,{start:e,end:n-1}))}}},(t,e,n)=>
vendor: 24,120 bytes, line 2
2{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0;var s=n(6),a=n(1);const o="normal",l="normal",c="#000000",d=["butt","round","square"],h=["miter","round","bevel"],createObjectURL=function(t,e="",n=!1){if(URL.createObjectURL&&"undefined"!==typeof Blob&&!n)return URL.createObjectURL(new Blob([t],{type:e}));const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let a=`data:${e};base64,`;for(let o=0,l=t.length;o<l;o+=3){const e=255&t[o],n=255&t[o+1],c=255&t[o+2];a+=s[e>>2]+s[(3&e)<<4|n>>4]+s[o+1<l?(15&n)<<2|c>>6:64]+s[o+2<l?63&c:64]}return a},u=function(){const t=new Uint8Array([137,80,78,71,13,10,26,10]),e=new Int32Array(256);for(let n=0;n<256;n++){let t=n;for(let e=0;e<8;e++)t=1&t?3988292384^t>>1&2147483647:t>>1&2147483647;e[n]=t}function writePngChunk(t,n,s,a){let o=a;const l=n.length;s[o]=l>>24&255,s[o+1]=l>>16&255,s[o+2]=l>>8&255,s[o+3]=255&l,o+=4,s[o]=255&t.charCodeAt(0),s[o+1]=255&t.charCodeAt(1),s[o+2]=255&t.charCodeAt(2),s[o+3]=255&t.charCodeAt(3),o+=4,s.set(n,o),o+=n.length;const c=function crc32(t,n,s){let a=-1;for(let o=n;o<s;o++){const n=255&(a^t[o]);a=a>>>8^e[n]}return-1^a}(s,a+4,o);s[o]=c>>24&255,s[o+1]=c>>16&255,s[o+2]=c>>8&255,s[o+3]=255&c}function deflateSyncUncompressed(t){let e=t.length;const n=65535,s=Math.ceil(e/n),a=new Uint8Array(2+e+5*s+4);let o=0;a[o++]=120,a[o++]=156;let l=0;for(;e>n;)a[o++]=0,a[o++]=255,a[o++]=255,a[o++]=0,a[o++]=0,a.set(t.subarray(l,l+n),o),o+=n,l+=n,e-=n;a[o++]=1,a[o++]=255&e,a[o++]=e>>8&255,a[o++]=255&~e,a[o++]=(65535&~e)>>8&255,a.set(t.subarray(l),o),o+=t.length-l;const c=function adler32(t,e,n){let s=1,a=0;for(let o=e;o<n;++o)s=(s+(255&t[o]))%65521,a=(a+s)%65521;return a<<16|s}(t,0,t.length);return a[o++]=c>>24&255,a[o++]=c>>16&255,a[o++]=c>>8&255,a[o++]=255&c,a}function encode(e,n,s,o){const l=e.width,c=e.height;let d,h,u;const p=e.data;switch(n){case a.ImageKind.GRAYSCALE_1BPP:h=0,d=1,u=l+7>>3;break;case a.ImageKind.RGB_24BPP:h=2,d=8,u=3*l;break;case a.ImageKind.RGBA_32BPP:h=6,d=8,u=4*l;break;default:throw new Error("invalid format")}const g=new Uint8Array((1+u)*c);let m=0,f=0;for(let t=0;t<c;++t)g[m++]=0,g.set(p.subarray(f,f+u),m),f+=u,m+=u;if(n===a.ImageKind.GRAYSCALE_1BPP&&o){m=0;for(let t=0;t<c;t++){m++;for(let t=0;t<u;t++)g[m++]^=255}}const b=new Uint8Array([l>>24&255,l>>16&255,l>>8&255,255&l,c>>24&255,c>>16&255,c>>8&255,255&c,d,h,0,0,0]),A=function deflateSync(t){if(!a.isNodeJS)return deflateSyncUncompressed(t);try{const e=parseInt(process.versions.node)>=8?t:Buffer.from(t),n=__webpack_require__(82787).deflateSync(e,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(e){(0,a.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return deflateSyncUncompressed(t)}(g),v=t.length+36+b.length+A.length,y=new Uint8Array(v);let _=0;return y.set(t,_),_+=t.length,writePngChunk("IHDR",b,y,_),_+=12+b.length,writePngChunk("IDATA",A,y,_),_+=12+A.length,writePngChunk("IEND",new Uint8Array(0),y,_),createObjectURL(y,"image/png",s)}return function convertImgDataToPng(t,e,n){return encode(t,void 0===t.kind?a.ImageKind.GRAYSCALE_1BPP:t.kind,e,n)}}();class SVGExtraState{constructor(){this.fontSizeScale=1,this.fontWeight=l,this.fontSize=0,this.textMatrix=a.IDENTITY_MATRIX,this.fontMatrix=a.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=a.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=c,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 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,g=0,m=0;e.SVGGraphics=class SVGGraphics{constructor(t,e,n=!1){(0,s.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new s.DOMSVGFactory,this.current=new SVGExtraState,this.transformMatrix=a.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 s in a.OPS)this._operatorIdMapping[a.OPS[s]]=s}getObject(t,e=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 s=0,o=e.length;s<o;s++)if(e[s]===a.OPS.dependency)for(const t of n[s]){const e=t.startsWith("g_")?this.commonObjs:this.objs,n=new Promise(n=>{e.get(t,n)});this.current.dependencies.push(n)}return Promise.all(this.current.dependencies)}transform(t,e,n,s,o,l){const c=[t,e,n,s,o,l];this.transformMatrix=a.Util.transform(this.transformMatrix,c),this.tgrp=null}getSVG(t,e){this.viewport=e;const n=this._initialize(e);return this.loadDependencies(t).then(()=>(this.transformMatrix=a.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(t)),n))}convertOpList(t){const e=this._operatorIdMapping,n=t.argsArray,s=t.fnArray,a=[];for(let o=0,l=s.length;o<l;o++){const t=s[o];a.push({fnId:t,fn:e[t],args:n[o]})}return function opListToTree(t){let e=[];const n=[];for(const s of t)"save"!==s.fn?"restore"===s.fn?e=n.pop():e.push(s):(e.push({fnId:92,fn:"group",items:[]}),n.push(e),e=e.at(-1).items);return e}(a)}executeOpTree(t){for(const e of t){const t=e.fn,n=e.fnId,s=e.args;switch(0|n){case a.OPS.beginText:this.beginText();break;case a.OPS.dependency:break;case a.OPS.setLeading:this.setLeading(s);break;case a.OPS.setLeadingMoveText:this.setLeadingMoveText(s[0],s[1]);break;case a.OPS.setFont:this.setFont(s);break;case a.OPS.showText:case a.OPS.showSpacedText:this.showText(s[0]);break;case a.OPS.endText:this.endText();break;case a.OPS.moveText:this.moveText(s[0],s[1]);break;case a.OPS.setCharSpacing:this.setCharSpacing(s[0]);break;case a.OPS.setWordSpacing:this.setWordSpacing(s[0]);break;case a.OPS.setHScale:this.setHScale(s[0]);break;case a.OPS.setTextMatrix:this.setTextMatrix(s[0],s[1],s[2],s[3],s[4],s[5]);break;case a.OPS.setTextRise:this.setTextRise(s[0]);break;case a.OPS.setTextRenderingMode:this.setTextRenderingMode(s[0]);break;case a.OPS.setLineWidth:this.setLineWidth(s[0]);break;case a.OPS.setLineJoin:this.setLineJoin(s[0]);break;case a.OPS.setLineCap:this.setLineCap(s[0]);break;case a.OPS.setMiterLimit:this.setMiterLimit(s[0]);break;case a.OPS.setFillRGBColor:this.setFillRGBColor(s[0],s[1],s[2]);break;case a.OPS.setStrokeRGBColor:this.setStrokeRGBColor(s[0],s[1],s[2]);break;case a.OPS.setStrokeColorN:this.setStrokeColorN(s);break;case a.OPS.setFillColorN:this.setFillColorN(s);break;case a.OPS.shadingFill:this.shadingFill(s[0]);break;case a.OPS.setDash:this.setDash(s[0],s[1]);break;case a.OPS.setRenderingIntent:this.setRenderingIntent(s[0]);break;case a.OPS.setFlatness:this.setFlatness(s[0]);break;case a.OPS.setGState:this.setGState(s[0]);break;case a.OPS.fill:this.fill();break;case a.OPS.eoFill:this.eoFill();break;case a.OPS.stroke:this.stroke();break;case a.OPS.fillStroke:this.fillStroke();break;case a.OPS.eoFillStroke:this.eoFillStroke();break;case a.OPS.clip:this.clip("nonzero");break;case a.OPS.eoClip:this.clip("evenodd");break;case a.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case a.OPS.paintImageXObject:this.paintImageXObject(s[0]);break;case a.OPS.paintInlineImageXObject:this.paintInlineImageXObject(s[0]);break;case a.OPS.paintImageMaskXObject:this.paintImageMaskXObject(s[0]);break;case a.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(s[0],s[1]);break;case a.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case a.OPS.closePath:this.closePath();break;case a.OPS.closeStroke:this.closeStroke();break;case a.OPS.closeFillStroke:this.closeFillStroke();break;case a.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case a.OPS.nextLine:this.nextLine();break;case a.OPS.transform:this.transform(s[0],s[1],s[2],s[3],s[4],s[5]);break;case a.OPS.constructPath:this.constructPath(s[0],s[1]);break;case a.OPS.endPath:this.endPath();break;case 92:this.group(e.items);break;default:(0,a.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,s,a,o){const l=this.current;l.textMatrix=l.lineMatrix=[t,e,n,s,a,o],l.textMatrixScale=Math.hypot(t,e),l.x=l.lineX=0,l.y=l.lineY=0,l.xcoords=[],l.ycoords=[],l.tspan=this.svgFactory.createElement("svg:tspan"),l.tspan.setAttributeNS(null,"font-family",l.fontFamily),l.tspan.setAttributeNS(null,"font-size",`${pf(l.fontSize)}px`),l.tspan.setAttributeNS(null,"y",pf(-l.y)),l.txtElement=this.svgFactory.createElement("svg:text"),l.txtElement.append(l.tspan)}beginText(){const t=this.current;t.x=t.lineX=0,t.y=t.lineY=0,t.textMatrix=a.IDENTITY_MATRIX,t.lineMatrix=a.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,s=e.fontSize;if(0===s)return;const d=e.fontSizeScale,h=e.charSpacing,u=e.wordSpacing,p=e.fontDirection,g=e.textHScale*p,m=n.vertical,f=m?1:-1,b=n.defaultVMetrics,A=s*e.fontMatrix[0];let v=0;for(const a of t){if(null===a){v+=p*u;continue}if("number"===typeof a){v+=f*a*s/1e3;continue}const t=(a.isSpace?u:0)+h,o=a.fontChar;let l,c,g=a.width;if(m){let t;const e=a.vmetric||b;t=a.vmetric?e[1]:.5*g,t=-t*A;const n=e[2]*A;g=e?-e[0]:g,l=t/d,c=(v+n)/d}else l=v/d,c=0;(a.isInFont||n.missingFile)&&(e.xcoords.push(e.x+l),m&&e.ycoords.push(-e.y+c),e.tspan.textContent+=o);v+=m?g*A-t*p:g*A+t*p}e.tspan.setAttributeNS(null,"x",e.xcoords.map(pf).join(" ")),m?e.tspan.setAttributeNS(null,"y",e.ycoords.map(pf).join(" ")):e.tspan.setAttributeNS(null,"y",pf(-e.y)),m?e.y-=v:e.x+=v*g,e.tspan.setAttributeNS(null,"font-family",e.fontFamily),e.tspan.setAttributeNS(null,"font-size",`${pf(e.fontSize)}px`),e.fontStyle!==o&&e.tspan.setAttributeNS(null,"font-style",e.fontStyle),e.fontWeight!==l&&e.tspan.setAttributeNS(null,"font-weight",e.fontWeight);const y=e.textRenderingMode&a.TextRenderingMode.FILL_STROKE_MASK;if(y===a.TextRenderingMode.FILL||y===a.TextRenderingMode.FILL_STROKE?(e.fillColor!==c&&e.tspan.setAttributeNS(null,"fill",e.fillColor),e.fillAlpha<1&&e.tspan.setAttributeNS(null,"fill-opacity",e.fillAlpha)):e.textRenderingMode===a.TextRenderingMode.ADD_TO_PATH?e.tspan.setAttributeNS(null,"fill","transparent"):e.tspan.setAttributeNS(null,"fill","none"),y===a.TextRenderingMode.STROKE||y===a.TextRenderingMode.FILL_STROKE){const t=1/(e.textMatrixScale||1);this._setStrokeAttributes(e.tspan,t)}let _=e.textMatrix;0!==e.textRise&&(_=_.slice(),_[5]+=e.textRise),e.txtElement.setAttributeNS(null,"transform",`${pm(_)} scale(${pf(g)}, -1)`),e.txtElement.setAttributeNS("http://www.w3.org/XML/1998/namespace","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 s=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||a.FONT_IDENTITY_MATRIX;let o="normal";n.black?o="900":n.bold&&(o="bold");const l=n.italic?"italic":"normal";s<0?(s=-s,e.fontDirection=-1):e.fontDirection=1,e.fontSize=s,e.fontFamily=n.loadedName,e.fontWeight=o,e.fontStyle=l,e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"y",pf(-e.y)),e.xcoords=[],e.ycoords=[]}endText(){const t=this.current;t.textRenderingMode&a.TextRenderingMode.ADD_TO_PATH_FLAG&&t.txtElement?.hasChildNodes()&&(t.element=t.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=a.Util.makeHexColor(t,e,n)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,n){this.current.fillColor=a.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{width:e,height:n}=this.viewport,s=a.Util.inverseTransform(this.transformMatrix),[o,l,c,d]=a.Util.getAxialAlignedBoundingBox([0,0,e,n],s),h=this.svgFactory.createElement("svg:rect");h.setAttributeNS(null,"x",o),h.setAttributeNS(null,"y",l),h.setAttributeNS(null,"width",c-o),h.setAttributeNS(null,"height",d-l),h.setAttributeNS(null,"fill",this._makeShadingPattern(t)),this.current.fillAlpha<1&&h.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(h)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){const e=t[1],n=t[2],s=t[3]||a.IDENTITY_MATRIX,[o,l,c,d]=t[4],h=t[5],u=t[6],p=t[7],g="shading"+m++,[f,b,A,v]=a.Util.normalizeRect([...a.Util.applyTransform([o,l],s),...a.Util.applyTransform([c,d],s)]),[y,_]=a.Util.singularValueDecompose2dScale(s),S=h*y,x=u*_,E=this.svgFactory.createElement("svg:pattern");E.setAttributeNS(null,"id",g),E.setAttributeNS(null,"patternUnits","userSpaceOnUse"),E.setAttributeNS(null,"width",S),E.setAttributeNS(null,"height",x),E.setAttributeNS(null,"x",`${f}`),E.setAttributeNS(null,"y",`${b}`);const w=this.svg,C=this.transformMatrix,T=this.current.fillColor,P=this.current.strokeColor,k=this.svgFactory.create(A-f,v-b);if(this.svg=k,this.transformMatrix=s,2===p){const t=a.Util.makeHexColor(...e);this.current.fillColor=t,this.current.strokeColor=t}return this.executeOpTree(this.convertOpList(n)),this.svg=w,this.transformMatrix=C,this.current.fillColor=T,this.current.strokeColor=P,E.append(k.childNodes[0]),this.defs.append(E),`url(#${g})`}_makeShadingPattern(t){switch("string"===typeof t&&(t=this.objs.get(t)),t[0]){case"RadialAxial":const e="shading"+m++,n=t[3];let s;switch(t[1]){case"axial":const n=t[4],a=t[5];s=this.svgFactory.createElement("svg:linearGradient"),s.setAttributeNS(null,"id",e),s.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),s.setAttributeNS(null,"x1",n[0]),s.setAttributeNS(null,"y1",n[1]),s.setAttributeNS(null,"x2",a[0]),s.setAttributeNS(null,"y2",a[1]);break;case"radial":const o=t[4],l=t[5],c=t[6],d=t[7];s=this.svgFactory.createElement("svg:radialGradient"),s.setAttributeNS(null,"id",e),s.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),s.setAttributeNS(null,"cx",l[0]),s.setAttributeNS(null,"cy",l[1]),s.setAttributeNS(null,"r",d),s.setAttributeNS(null,"fx",o[0]),s.setAttributeNS(null,"fy",o[1]),s.setAttributeNS(null,"fr",c);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]),s.append(e)}return this.defs.append(s),`url(#${e})`;case"Mesh":return(0,a.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 s=n.x,o=n.y,l=[],c=0;for(const d of t)switch(0|d){case a.OPS.rectangle:s=e[c++],o=e[c++];const t=s+e[c++],n=o+e[c++];l.push("M",pf(s),pf(o),"L",pf(t),pf(o),"L",pf(t),pf(n),"L",pf(s),pf(n),"Z");break;case a.OPS.moveTo:s=e[c++],o=e[c++],l.push("M",pf(s),pf(o));break;case a.OPS.lineTo:s=e[c++],o=e[c++],l.push("L",pf(s),pf(o));break;case a.OPS.curveTo:s=e[c+4],o=e[c+5],l.push("C",pf(e[c]),pf(e[c+1]),pf(e[c+2]),pf(e[c+3]),pf(s),pf(o)),c+=6;break;case a.OPS.curveTo2:l.push("C",pf(s),pf(o),pf(e[c]),pf(e[c+1]),pf(e[c+2]),pf(e[c+3])),s=e[c+2],o=e[c+3],c+=4;break;case a.OPS.curveTo3:s=e[c+2],o=e[c+3],l.push("C",pf(e[c]),pf(e[c+1]),pf(s),pf(o),pf(s),pf(o)),c+=4;break;case a.OPS.closePath:l.push("Z")}l=l.join(" "),n.path&&t.length>0&&t[0]!==a.OPS.rectangle&&t[0]!==a.OPS.moveTo?l=n.path.getAttributeNS(null,"d")+l:(n.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(n.path)),n.path.setAttributeNS(null,"d",l),n.path.setAttributeNS(null,"fill","none"),n.element=n.path,n.setCurrentPoint(s,o)}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 s=t.element.cloneNode(!0);if("evenodd"===this.pendingClip?s.setAttributeNS(null,"clip-rule","evenodd"):s.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,n.append(s),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,a.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,e=1){const n=this.current;let s=n.dashArray;1!==e&&s.length>0&&(s=s.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",s.map(pf).join(" ")),t.setAttributeNS(null,"stroke-dashoffset",pf(e*n.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const 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,a.warn)(`Dependent image with object ID ${t} is not ready yet`)}paintInlineImageXObject(t,e){const n=t.width,s=t.height,a=u(t,this.forceDataSchema,!!e),o=this.svgFactory.createElement("svg:rect");o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","0"),o.setAttributeNS(null,"width",pf(n)),o.setAttributeNS(null,"height",pf(s)),this.current.element=o,this.clip("nonzero");const l=this.svgFactory.createElement("svg:image");l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),l.setAttributeNS(null,"x","0"),l.setAttributeNS(null,"y",pf(-s)),l.setAttributeNS(null,"width",pf(n)+"px"),l.setAttributeNS(null,"height",pf(s)+"px"),l.setAttributeNS(null,"transform",`scale(${pf(1/n)} ${pf(-1/s)})`),e?e.append(l):this._ensureTransformGroup().append(l)}paintImageMaskXObject(t){const e=this.getObject(t.data,t);if(e.bitmap)return void(0,a.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");const n=this.current,s=e.width,o=e.height,l=n.fillColor;n.maskId="mask"+g++;const c=this.svgFactory.createElement("svg:mask");c.setAttributeNS(null,"id",n.maskId);const d=this.svgFactory.createElement("svg:rect");d.setAttributeNS(null,"x","0"),d.setAttributeNS(null,"y","0"),d.setAttributeNS(null,"width",pf(s)),d.setAttributeNS(null,"height",pf(o)),d.setAttributeNS(null,"fill",l),d.setAttributeNS(null,"mask",`url(#${n.maskId})`),this.defs.append(c),this._ensureTransformGroup().append(d),this.paintInlineImageXObject(e,c)}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],s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x",e[0]),s.setAttributeNS(null,"y",e[1]),s.setAttributeNS(null,"width",pf(t)),s.setAttributeNS(null,"height",pf(n)),this.current.element=s,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 s=this.svgFactory.createElement("svg:g");return s.setAttributeNS(null,"transform",pm(t.transform)),e.append(s),this.svg=s,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}}},(t,e)=>
2{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){if(!t)return;let n=null;const s=t.name;if("#text"===s)n=t.value;else{if(!XfaText.shouldBuildText(s))return;t?.attributes?.textContent?n=t.attributes.textContent:t.value&&(n=t.value)}if(null!==n&&e.push({str:n}),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)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextLayerRenderTask=void 0,e.renderTextLayer=function renderTextLayer(t){t.textContentSource||!t.textContent&&!t.textContentStream||((0,a.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,s=getComputedStyle(e),o=s.getPropertyValue("visibility"),l=parseFloat(s.getPropertyValue("--scale-factor"));"visible"===o&&(!l||Math.abs(l-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 c=new TextLayerRenderTask(t);return c._render(),c},e.updateTextLayer=function updateTextLayer({container:t,viewport:e,textDivs:n,textDivProperties:s,isOffscreenCanvasSupported:o,mustRotate:l=!0,mustRescale:c=!0}){l&&(0,a.setLayerDimensions)(t,{rotation:e.rotation});if(c){const t=getCtx(0,o),a={prevFontSize:null,prevFontFamily:null,div:null,scale:e.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t};for(const e of n)a.properties=s.get(e),a.div=e,layout(a)}};var s=n(1),a=n(6);const o=30,l=new Map;function getCtx(t,e){let n;if(e&&s.FeatureTest.isOffscreenCanvasSupported)n=new OffscreenCanvas(t,t).getContext("2d",{alpha:!1});else{const e=document.createElement("canvas");e.width=e.height=t,n=e.getContext("2d",{alpha:!1})}return n}function appendText(t,e,n){const a=document.createElement("span"),c={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(a);const d=s.Util.transform(t._transform,e.transform);let h=Math.atan2(d[1],d[0]);const u=n[e.fontName];u.vertical&&(h+=Math.PI/2);const p=Math.hypot(d[2],d[3]),g=p*function getAscent(t,e){const n=l.get(t);if(n)return n;const s=getCtx(o,e);s.font=`30px ${t}`;const a=s.measureText("");let c=a.fontBoundingBoxAscent,d=Math.abs(a.fontBoundingBoxDescent);if(c){const e=c/(c+d);return l.set(t,e),s.canvas.width=s.canvas.height=0,e}s.strokeStyle="red",s.clearRect(0,0,o,o),s.strokeText("g",0,0);let h=s.getImageData(0,0,o,o).data;d=0;for(let l=h.length-1-3;l>=0;l-=4)if(h[l]>0){d=Math.ceil(l/4/o);break}s.clearRect(0,0,o,o),s.strokeText("A",0,o),h=s.getImageData(0,0,o,o).data,c=0;for(let l=0,u=h.length;l<u;l+=4)if(h[l]>0){c=o-Math.floor(l/4/o);break}if(s.canvas.width=s.canvas.height=0,c){const e=c/(c+d);return l.set(t,e),e}return l.set(t,.8),.8}(u.fontFamily,t._isOffscreenCanvasSupported);let m,f;0===h?(m=d[4],f=d[5]-g):(m=d[4]+g*Math.sin(h),f=d[5]-g*Math.cos(h));const b="calc(var(--scale-factor)*",A=a.style;t._container===t._rootContainer?(A.left=`${(100*m/t._pageWidth).toFixed(2)}%`,A.top=`${(100*f/t._pageHeight).toFixed(2)}%`):(A.left=`${b}${m.toFixed(2)}px)`,A.top=`${b}${f.toFixed(2)}px)`),A.fontSize=`${b}${p.toFixed(2)}px)`,A.fontFamily=u.fontFamily,c.fontSize=p,a.setAttribute("role","presentation"),a.textContent=e.str,a.dir=e.dir,t._fontInspectorEnabled&&(a.dataset.fontName=e.fontName),0!==h&&(c.angle=h*(180/Math.PI));let v=!1;if(e.str.length>1)v=!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&&(v=!0)}v&&(c.canvasWidth=u.vertical?e.height:e.width),t._textDivProperties.set(a,c),t._isReadableStream&&t._layoutText(a)}function layout(t){const{div:e,scale:n,properties:s,ctx:a,prevFontSize:o,prevFontFamily:l}=t,{style:c}=e;let d="";if(0!==s.canvasWidth&&s.hasText){const{fontFamily:h}=c,{canvasWidth:u,fontSize:p}=s;o===p&&l===h||(a.font=`${p*n}px ${h}`,t.prevFontSize=p,t.prevFontFamily=h);const{width:g}=a.measureText(e.textContent);g>0&&(d=`scaleX(${u*n/g})`)}0!==s.angle&&(d=`rotate(${s.angle}deg) ${d}`),d.length>0&&(c.transform=d)}class TextLayerRenderTask{constructor({textContentSource:t,container:e,viewport:n,textDivs:o,textDivProperties:l,textContentItemsStr:c,isOffscreenCanvasSupported:d}){this._textContentSource=t,this._isReadableStream=t instanceof ReadableStream,this._container=this._rootContainer=e,this._textDivs=o||[],this._textContentItemsStr=c||[],this._isOffscreenCanvasSupported=d,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=l||new WeakMap,this._canceled=!1,this._capability=new s.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:n.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:getCtx(0,d)};const{pageWidth:h,pageHeight:u,pageX:p,pageY:g}=n.rawDims;this._transform=[1,0,0,-1,-p,g+u],this._pageWidth=h,this._pageHeight=u,(0,a.setLayerDimensions)(e,n),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new s.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new s.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 s.PromiseCapability;let e=Object.create(null);if(this._isReadableStream){const pump=()=>{this._reader.read().then(({value:n,done:s})=>{s?t.resolve():(Object.assign(e,n.styles),this._processItems(n.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;
2this._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)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditorLayer=void 0;var s=n(1),a=n(4),o=n(28),l=n(33),c=n(6),d=n(34);class AnnotationEditorLayer{#Se;#xe=!1;#Ee=null;#we=this.pointerup.bind(this);#Ce=this.pointerdown.bind(this);#Te=new Map;#Pe=!1;#ke=!1;#Me=!1;#Re;static _initialized=!1;constructor({uiManager:t,pageIndex:e,div:n,accessibilityManager:s,annotationLayer:a,viewport:c,l10n:h}){const u=[o.FreeTextEditor,l.InkEditor,d.StampEditor];if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;for(const t of u)t.initialize(h)}t.registerEditorTypes(u),this.#Re=t,this.pageIndex=e,this.div=n,this.#Se=s,this.#Ee=a,this.viewport=c,this.#Re.addLayer(this)}get isEmpty(){return 0===this.#Te.size}updateToolbar(t){this.#Re.updateToolbar(t)}updateMode(t=this.#Re.getMode()){this.#Fe(),t===s.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),t!==s.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",t===s.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",t===s.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",t===s.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(t){if(!t&&this.#Re.getMode()!==s.AnnotationEditorType.INK)return;if(!t)for(const e of this.#Te.values())if(e.isEmpty())return void e.setInBackground();this.#De({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(t){this.#Re.setEditingState(t)}addCommands(t){this.#Re.addCommands(t)}enable(){this.div.style.pointerEvents="auto";const t=new Set;for(const n of this.#Te.values())n.enableEditing(),n.annotationElementId&&t.add(n.annotationElementId);if(!this.#Ee)return;const e=this.#Ee.getEditableAnnotations();for(const n of e){if(n.hide(),this.#Re.isDeletedAnnotationElement(n.data.id))continue;if(t.has(n.data.id))continue;const e=this.deserialize(n);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){this.#Me=!0,this.div.style.pointerEvents="none";const t=new Set;for(const e of this.#Te.values())e.disableEditing(),e.annotationElementId&&null===e.serialize()?(this.getEditableAnnotation(e.annotationElementId)?.show(),e.remove()):t.add(e.annotationElementId);if(this.#Ee){const e=this.#Ee.getEditableAnnotations();for(const n of e){const{id:e}=n.data;t.has(e)||this.#Re.isDeletedAnnotationElement(e)||n.show()}}this.#Fe(),this.isEmpty&&(this.div.hidden=!0),this.#Me=!1}getEditableAnnotation(t){return this.#Ee?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#Re.getActive()!==t&&this.#Re.setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",this.#Ce),this.div.addEventListener("pointerup",this.#we)}disableClick(){this.div.removeEventListener("pointerdown",this.#Ce),this.div.removeEventListener("pointerup",this.#we)}attach(t){this.#Te.set(t.id,t);const{annotationElementId:e}=t;e&&this.#Re.isDeletedAnnotationElement(e)&&this.#Re.removeDeletedAnnotationElement(t)}detach(t){this.#Te.delete(t.id),this.#Se?.removePointerInTextLayer(t.contentDiv),!this.#Me&&t.annotationElementId&&this.#Re.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#Re.removeEditor(t),t.div.contains(document.activeElement)&&setTimeout(()=>{this.#Re.focusMainContainer()},0),t.div.remove(),t.isAttachedToDOM=!1,this.#ke||this.addInkEditorIfNeeded(!1)}changeParent(t){t.parent!==this&&(t.annotationElementId&&(this.#Re.addDeletedAnnotationElement(t.annotationElementId),a.AnnotationEditor.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(this.changeParent(t),this.#Re.addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),this.#Re.addToAnnotationStorage(t)}
2moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&(t._focusEventsAllowed=!1,setTimeout(()=>{t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0}),e.focus())},0)),t._structTreeParentId=this.#Se?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#Re.getId()}#Ie(t){switch(this.#Re.getMode()){case s.AnnotationEditorType.FREETEXT:return new o.FreeTextEditor(t);case s.AnnotationEditorType.INK:return new l.InkEditor(t);case s.AnnotationEditorType.STAMP:return new d.StampEditor(t)}return null}pasteEditor(t,e){this.#Re.updateToolbar(t),this.#Re.updateMode(t);const{offsetX:n,offsetY:s}=this.#Le(),a=this.getNextId(),o=this.#Ie({parent:this,id:a,x:n,y:s,uiManager:this.#Re,isCentered:!0,...e});o&&this.add(o)}deserialize(t){switch(t.annotationType??t.annotationEditorType){case s.AnnotationEditorType.FREETEXT:return o.FreeTextEditor.deserialize(t,this,this.#Re);case s.AnnotationEditorType.INK:return l.InkEditor.deserialize(t,this,this.#Re);case s.AnnotationEditorType.STAMP:return d.StampEditor.deserialize(t,this,this.#Re)}return null}#De(t,e){const n=this.getNextId(),s=this.#Ie({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:this.#Re,isCentered:e});return s&&this.add(s),s}#Le(){const{x:t,y:e,width:n,height:s}=this.div.getBoundingClientRect(),a=Math.max(0,t),o=Math.max(0,e),l=(a+Math.min(window.innerWidth,t+n))/2-t,c=(o+Math.min(window.innerHeight,e+s))/2-e,[d,h]=this.viewport.rotation%180===0?[l,c]:[c,l];return{offsetX:d,offsetY:h}}addNewEditor(){this.#De(this.#Le(),!0)}setSelected(t){this.#Re.setSelected(t)}toggleSelected(t){this.#Re.toggleSelected(t)}isSelected(t){return this.#Re.isSelected(t)}unselect(t){this.#Re.unselect(t)}pointerup(t){const{isMac:e}=s.FeatureTest.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&this.#Pe&&(this.#Pe=!1,this.#xe?this.#Re.getMode()!==s.AnnotationEditorType.STAMP?this.#De(t,!1):this.#Re.unselectAll():this.#xe=!0)}pointerdown(t){if(this.#Pe)return void(this.#Pe=!1);const{isMac:e}=s.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;this.#Pe=!0;const n=this.#Re.getActive();this.#xe=!n||n.isEmpty()}findNewParent(t,e,n){const s=this.#Re.findParent(e,n);return null!==s&&s!==this&&(s.changeParent(t),!0)}destroy(){this.#Re.getActive()?.parent===this&&(this.#Re.commitOrRemove(),this.#Re.setActiveEditor(null));for(const t of this.#Te.values())this.#Se?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#Te.clear(),this.#Re.removeLayer(this)}#Fe(){this.#ke=!0;for(const t of this.#Te.values())t.isEmpty()&&t.remove();this.#ke=!1}render({viewport:t}){this.viewport=t,(0,c.setLayerDimensions)(this.div,t);for(const e of this.#Re.getEditors(this.pageIndex))this.add(e);this.updateMode()}update({viewport:t}){this.#Re.commitOrRemove(),this.viewport=t,(0,c.setLayerDimensions)(this.div,{rotation:t.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}}e.AnnotationEditorLayer=AnnotationEditorLayer},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FreeTextEditor=void 0;var s=n(1),a=n(5),o=n(4),l=n(29);class FreeTextEditor extends o.AnnotationEditor{#Oe=this.editorDivBlur.bind(this);#Ne=this.editorDivFocus.bind(this);#Be=this.editorDivInput.bind(this);#je=this.editorDivKeydown.bind(this);#Ue;#We="";#ze=`${this.id}-editor`;#He;#Ge=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=FreeTextEditor.prototype,arrowChecker=t=>t.isEmpty(),e=a.AnnotationEditorUIManager.TRANSLATE_SMALL,n=a.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,s.shadow)(this,"_keyboardManager",new a.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-e,0],checker:arrowChecker}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-n,0],checker:arrowChecker}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[e,0],checker:arrowChecker}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[n,0],checker:arrowChecker}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-e],checker:arrowChecker}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:arrowChecker}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,e],checker:arrowChecker}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,n],checker:arrowChecker}]]))}static _type="freetext";constructor(t){super({...t,name:"freeTextEditor"}),this.#Ue=t.color||FreeTextEditor._defaultColor||o.AnnotationEditor._defaultLineColor,this.#He=t.fontSize||FreeTextEditor._defaultFontSize}static initialize(t){o.AnnotationEditor.initialize(t,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case s.AnnotationEditorParamsType.FREETEXT_S
2IZE:FreeTextEditor._defaultFontSize=e;break;case s.AnnotationEditorParamsType.FREETEXT_COLOR:FreeTextEditor._defaultColor=e}}updateParams(t,e){switch(t){case s.AnnotationEditorParamsType.FREETEXT_SIZE:this.#Ve(e);break;case s.AnnotationEditorParamsType.FREETEXT_COLOR:this.#qe(e)}}static get defaultPropertiesToUpdate(){return[[s.AnnotationEditorParamsType.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[s.AnnotationEditorParamsType.FREETEXT_COLOR,FreeTextEditor._defaultColor||o.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[s.AnnotationEditorParamsType.FREETEXT_SIZE,this.#He],[s.AnnotationEditorParamsType.FREETEXT_COLOR,this.#Ue]]}#Ve(t){const setFontsize=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-this.#He)*this.parentScale),this.#He=t,this.#$e()},e=this.#He;this.addCommands({cmd:()=>{setFontsize(t)},undo:()=>{setFontsize(e)},mustExec:!0,type:s.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#qe(t){const e=this.#Ue;this.addCommands({cmd:()=>{this.#Ue=this.editorDiv.style.color=t},undo:()=>{this.#Ue=this.editorDiv.style.color=e},mustExec:!0,type:s.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-FreeTextEditor._internalPadding*t,-(FreeTextEditor._internalPadding+this.#He)*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(s.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#je),this.editorDiv.addEventListener("focus",this.#Ne),this.editorDiv.addEventListener("blur",this.#Oe),this.editorDiv.addEventListener("input",this.#Be))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#ze),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#je),this.editorDiv.removeEventListener("focus",this.#Ne),this.editorDiv.removeEventListener("blur",this.#Oe),this.editorDiv.removeEventListener("input",this.#Be),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width?this.#Xe():(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}#Ke(){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")}#$e(){const[t,e]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,s=e.style.display;e.style.display="hidden",t.div.append(this.div),n=e.getBoundingClientRect(),e.remove(),e.style.display=s}this.rotation%180===this.parentRotation%180?(this.width=n.width/t,this.height=n.height/e):(this.width=n.height/t,this.height=n.width/e),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#We,e=this.#We=this.#Ke().trimEnd();if(t===e)return;const setText=t=>{this.#We=t,t?(this.#Ye(),this._uiManager.rebuild(this),this.#$e()):this.remove()};this.addCommands({cmd:()=>{setText(e)},undo:()=>{setText(t)},mustExec:!1}),this.#$e()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}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)}
2render(){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.#ze),this.enableEditing(),o.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(t=>this.editorDiv?.setAttribute("aria-label",t)),o.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(t=>this.editorDiv?.setAttribute("default-content",t)),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#He}px * var(--scale-factor))`,n.color=this.#Ue,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,a.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[n,s]=this.parentDimensions;if(this.annotationElementId){const{position:a}=this.#Ge;let[o,l]=this.getInitialTranslation();[o,l]=this.pageTranslationToScreen(o,l);const[c,d]=this.pageDimensions,[h,u]=this.pageTranslation;let p,g;switch(this.rotation){case 0:p=t+(a[0]-h)/c,g=e+this.height-(a[1]-u)/d;break;case 90:p=t+(a[0]-h)/c,g=e-(a[1]-u)/d,[o,l]=[l,-o];break;case 180:p=t-this.width+(a[0]-h)/c,g=e-(a[1]-u)/d,[o,l]=[-o,-l];break;case 270:p=t+(a[0]-h-this.height*d)/c,g=e+(a[1]-u-this.width*c)/d,[o,l]=[-l,o]}this.setAt(p*n,g*s,o,l)}else this.setAt(t*n,e*s,this.width*n,this.height*s);this.#Ye(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}#Ye(){if(this.editorDiv.replaceChildren(),this.#We)for(const t of this.#We.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}get contentDiv(){return this.editorDiv}static deserialize(t,e,n){let a=null;if(t instanceof l.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:e,fontColor:n},rect:o,rotation:l,id:c},textContent:d,textPosition:h,parent:{page:{pageNumber:u}}}=t;if(!d||0===d.length)return null;a=t={annotationType:s.AnnotationEditorType.FREETEXT,color:Array.from(n),fontSize:e,value:d.join("\n"),position:h,pageIndex:u-1,rect:o,rotation:l,id:c,deleted:!1}}const o=super.deserialize(t,e,n);return o.#He=t.fontSize,o.#Ue=s.Util.makeHexColor(...t.color),o.#We=t.value,o.annotationElementId=t.id||null,o.#Ge=a,o}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const e=FreeTextEditor._internalPadding*this.parentScale,n=this.getRect(e,e),a=o.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#Ue),l={annotationType:s.AnnotationEditorType.FREETEXT,color:a,fontSize:this.#He,value:this.#We,pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?l:this.annotationElementId&&!this.#Je(l)?null:(l.id=this.annotationElementId,l)}#Je(t){const{value:e,fontSize:n,color:s,rect:a,pageIndex:o}=this.#Ge;return t.value!==e||t.fontSize!==n||t.rect.some((t,e)=>Math.abs(t-a[e])>=1)||t.color.some((t,e)=>t!==s[e])||t.pageIndex!==o}#Xe(t=!1){if(!this.annotationElementId)return;if(this.#$e(),!t&&(0===this.width||0===this.height))return void setTimeout(()=>this.#Xe(!0),0);const e=FreeTextEditor._internalPadding*this.parentScale;this.#Ge.rect=this.getRect(e,e)}}e.FreeTextEditor=FreeTextEditor},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StampAnnotationElement=e.InkAnnotationElement=e.FreeTextAnnotationElement=e.AnnotationLayer=void 0;var s=n(1),a=n(6),o=n(3),l=n(30),c=n(31),d=n(32);const h=1e3,u=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 s.AnnotationType.LINK:return new LinkAnnotationElement(t);case s.AnnotationType.TEXT:return new TextAnnotationElement(t);case s.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);case"Sig":return new SignatureWidgetAnnotationElement(t)}return new WidgetAnnotationElement(t);case s.AnnotationType.POPUP:return new PopupAnnotationElement(t);case s.AnnotationType.FREETEXT:return new FreeTextAnnotationElement(t);case s.AnnotationType.LINE:return new LineAnnotationElement(t);case s.AnnotationType.SQUARE:return new SquareAnnotationElement(t);case s.AnnotationType.CIRCLE:return new CircleAnnotationElement(t);case s.AnnotationType.POLYLINE:return new PolylineAnnotationElement(t);case s.AnnotationType.CARET:return new CaretAnnotationElement(t);case s.AnnotationType.INK:return new InkAnnotationElement(t);case s.AnnotationType.POLYGON:return new PolygonAnnotationElement(t);case s.AnnotationType.HIGHLIGHT:return new HighlightAnnotationElement(t);case s.AnnotationType.UNDERLINE:return new UnderlineAnnotationElement(t);case s.AnnotationType.SQUIGGLY:return new SquigglyAnnotationElement(t);case s.AnnotationType.STRIKEOUT:return new StrikeOutAnnotationElement(t);case s.AnnotationType.STAMP:return new StampAnnotationElement(t);case s.AnnotationType.FILEATTACHMENT:return new FileAttachmentAnnotationElement(t);default:return new AnnotationElement(t)}}}class AnnotationElement{#Qe=!1;constructor(t,{isRenderable:e=!1,ignoreBorder:n=!1,createQuadrilaterals:s=!1}={}){this.isRenderable=e,this.data=t.data,this.layer=t.layer,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,this.parent=t.parent,e&&(this.container=this._createContainer(n)),s&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:e,richText:n}){return!!(t?.str||e?.str||n?.str)}get hasPopupData(){return AnnotationElement._hasPopupData(this.data)}
2_createContainer(t){const{data:e,parent:{page:n,viewport:a}}=this,o=document.createElement("section");o.setAttribute("data-annotation-id",e.id),this instanceof WidgetAnnotationElement||(o.tabIndex=h),o.style.zIndex=this.parent.zIndex++,this.data.popupRef&&o.setAttribute("aria-haspopup","dialog"),e.noRotate&&o.classList.add("norotate");const{pageWidth:l,pageHeight:c,pageX:d,pageY:u}=a.rawDims;if(!e.rect||this instanceof PopupAnnotationElement){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,o),o}const{width:p,height:g}=getRectDims(e.rect),m=s.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){o.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))`;o.style.borderRadius=e}else if(this instanceof RadioButtonWidgetAnnotationElement){const t=`calc(${p}px * var(--scale-factor)) / calc(${g}px * var(--scale-factor))`;o.style.borderRadius=t}switch(e.borderStyle.style){case s.AnnotationBorderStyleType.SOLID:o.style.borderStyle="solid";break;case s.AnnotationBorderStyleType.DASHED:o.style.borderStyle="dashed";break;case s.AnnotationBorderStyleType.BEVELED:(0,s.warn)("Unimplemented border style: beveled");break;case s.AnnotationBorderStyleType.INSET:(0,s.warn)("Unimplemented border style: inset");break;case s.AnnotationBorderStyleType.UNDERLINE:o.style.borderBottomStyle="solid"}const a=e.borderColor||null;a?(this.#Qe=!0,o.style.borderColor=s.Util.makeHexColor(0|a[0],0|a[1],0|a[2])):o.style.borderWidth=0}o.style.left=100*(m[0]-d)/l+"%",o.style.top=100*(m[1]-u)/c+"%";const{rotation:f}=e;return e.hasOwnCanvas||0===f?(o.style.width=100*p/l+"%",o.style.height=100*g/c+"%"):this.setRotation(f,o),o}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:n,pageHeight:s}=this.parent.viewport.rawDims,{width:a,height:o}=getRectDims(this.data.rect);let l,c;t%180===0?(l=100*a/n,c=100*o/s):(l=100*o/n,c=100*a/s),e.style.width=`${l}%`,e.style.height=`${c}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const setColor=(t,e,n)=>{const s=n.detail[t],a=s[0],o=s.slice(1);n.target.style[e]=l.ColorConverters[`${a}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[e]:l.ColorConverters[`${a}_rgb`](o)})};return(0,s.shadow)(this,"_commonActions",{display:t=>{const{display:e}=t.detail,n=e%2===1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.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 s of Object.keys(e.detail)){const a=t[s]||n[s];a?.(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const n=this._commonActions;for(const[s,a]of Object.entries(e)){const o=n[s];if(o){o({detail:{[s]:a},target:t}),delete e[s]}}}
2_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,n,s,a]=this.data.rect;if(1===t.length){const[,{x:o,y:l},{x:c,y:d}]=t[0];if(s===o&&a===l&&e===c&&n===d)return}const{style:o}=this.container;let l;if(this.#Qe){const{borderColor:t,borderWidth:e}=o;o.borderWidth=0,l=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${t}" stroke-width="${e}">`],this.container.classList.add("hasBorder")}const c=s-e,d=a-n,{svgFactory:h}=this,u=h.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0);const p=h.createElement("defs");u.append(p);const g=h.createElement("clipPath"),m=`clippath_${this.data.id}`;g.setAttribute("id",m),g.setAttribute("clipPathUnits","objectBoundingBox"),p.append(g);for(const[,{x:f,y:b},{x:A,y:v}]of t){const t=h.createElement("rect"),n=(A-e)/c,s=(a-b)/d,o=(f-A)/c,u=(b-v)/d;t.setAttribute("x",n),t.setAttribute("y",s),t.setAttribute("width",o),t.setAttribute("height",u),g.append(t),l?.push(`<rect vector-effect="non-scaling-stroke" x="${n}" y="${s}" width="${o}" height="${u}"/>`)}this.#Qe&&(l.push("</g></svg>')"),o.backgroundImage=l.join("")),this.container.append(u),this.container.style.clipPath=`url(#${m})`}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const n=new PopupAnnotationElement({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]});this.parent.div.append(n.render())}render(){(0,s.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const n=[];if(this._fieldObjects){const a=this._fieldObjects[t];if(a)for(const{page:t,id:o,exportValues:l}of a){if(-1===t)continue;if(o===e)continue;const a="string"===typeof l?l:null,c=document.querySelector(`[data-element-id="${o}"]`);!c||u.has(c)?n.push({id:o,exportValue:a,domElement:c}):(0,s.warn)(`_getElementsByName - element not allowed: ${o}`)}return n}for(const s of document.getElementsByName(t)){const{exportValue:t}=s,a=s.getAttribute("data-element-id");a!==e&&(u.has(s)&&n.push({id:a,exportValue:t,domElement:s}))}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})})}}class LinkAnnotationElement extends AnnotationElement{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!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 s=!1;return t.url?(e.addLinkAttributes(n,t.url,t.newWindow),s=!0):t.action?(this._bindNamedAction(n,t.action),s=!0):t.attachment?(this._bindAttachment(n,t.attachment),s=!0):t.setOCGState?(this.#Ze(n,t.setOCGState),s=!0):t.dest?(this._bindLink(n,t.dest),s=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,t),s=!0),t.resetForm?(this._bindResetFormAction(n,t.resetForm),s=!0):this.isTooltipOnly&&!s&&(this._bindLink(n,""),s=!0)),this.container.classList.add("linkAnnotation"),s&&this.container.append(n),this.container}#tn(){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.#tn()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),this.#tn()}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,e.content,e.filename),!1),this.#tn()}#Ze(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),this.#tn()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const s of Object.keys(e.actions)){const a=n.get(s);a&&(t[a]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:s}}),!1))}t.onclick||(t.onclick=()=>!1),this.#tn()}_bindResetFormAction(t,e){const n=t.onclick;if(n||(t.href=this.linkService.getAnchorUrl("")),this.#tn(),!this._fieldObjects)return(0,s.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(n||(t.onclick=()=>!1));t.onclick=()=>{n?.();const{fields:t,refs:a,include:o}=e,l=[];
vendor: 15,914 bytes, line 2
2if(0!==t.length||0!==a.length){const e=new Set(a);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)===o&&l.push(n)}else for(const e of Object.values(this._fieldObjects))l.push(...e);const c=this.annotationStorage,d=[];for(const e of l){const{id:t}=e;switch(d.push(t),e.type){case"text":{const n=e.defaultValue||"";c.setValue(t,{value:n});break}case"checkbox":case"radiobutton":{const n=e.defaultValue===e.exportValues;c.setValue(t,{value:n});break}case"combobox":case"listbox":{const n=e.defaultValue||"";c.setValue(t,{value:n});break}default:continue}const n=document.querySelector(`[data-element-id="${t}"]`);n&&(u.has(n)?n.dispatchEvent(new Event("resetform")):(0,s.warn)(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:d,name:"ResetForm"}}),!1}}}class TextAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0})}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.popupRef&&this.hasPopupData&&this._createPopup(),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){this.data.hasOwnCanvas&&("CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){const{isWin:e,isMac:n}=s.FeatureTest.platform;return e&&t.ctrlKey||n&&t.metaKey}_setEventListener(t,e,n,s,a){n.includes("mouse")?t.addEventListener(n,t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:a(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(n,t=>{if("blur"===n){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===n){if(e.focused)return;e.focused=!0}a&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:a(t)}})})}_setEventListeners(t,e,n,s){for(const[a,o]of n)("Action"===o||this.data.actions?.[o])&&("Focus"!==o&&"Blur"!==o||(e||={focused:!1}),this._setEventListener(t,e,a,o,s),"Focus"!==o||this.data.actions?.Blur?"Blur"!==o||this.data.actions?.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":s.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||9,o=t.style;let l;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/(s.LINE_FACTOR*a))||1);l=Math.min(a,roundToOneDecimal(e/s.LINE_FACTOR))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);l=Math.min(a,roundToOneDecimal(t/s.LINE_FACTOR))}o.fontSize=`calc(${l}px * var(--scale-factor))`,o.color=s.Util.makeHexColor(n[0],n[1],n[2]),null!==this.data.textAlignment&&(o.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,s){const a=this.annotationStorage;for(const o of this._getElementsByName(t.name,t.id))o.domElement&&(o.domElement[e]=n),a.setValue(o.id,{[s]:n})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const s=t.getValue(e,{value:this.data.fieldValue});let a=s.value||"";const o=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;o&&a.length>o&&(a=a.slice(0,o));let l=s.formattedValue||this.data.textContent?.join("\n")||null;l&&this.data.comb&&(l=l.replaceAll(/\s+/g,""));const c={userValue:a,formattedValue:l,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=l??a,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",l??a),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),u.add(n),n.setAttribute("data-element-id",e),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=h,this._setRequired(n,this.data.required),o&&(n.maxLength=o),n.addEventListener("input",s=>{t.setValue(e,{value:s.target.value}),this.setPropertyOnSiblings(n,"value",s.target.value,"value"),c.formattedValue=null}),n.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue??"";n.value=c.userValue=e,c.formattedValue=null});let blurListener=t=>{const{formattedValue:e}=c;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",t=>{if(c.focused)return;const{target:e}=t;c.userValue&&(e.value=c.userValue),c.lastCommittedValue=e.value,c.commitKey=1,c.focused=!0}),n.addEventListener("updatefromsandbox",n=>{this.showElementAndHideCanvas(n.target);const s={value(n){c.userValue=n.detail.value??"",t.setValue(e,{value:c.userValue.toString()}),n.target.value=c.userValue},formattedValue(n){const{formattedValue:s}=n.detail;c.formattedValue=s,null!==s&&void 0!==s&&n.target!==document.activeElement&&(n.target.value=s),t.setValue(e,{formattedValue:s})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:n=>{const{charLimit:s}=n.detail,{target:a}=n;if(0===s)return void a.removeAttribute("maxLength");a.setAttribute("maxLength",s);let o=c.userValue;!o||o.length<=s||(o=o.slice(0,s),a.value=c.userValue=o,t.setValue(e,{value:o}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,willCommit:!0,commitKey:1,selStart:a.selectionStart,selEnd:a.selectionEnd}}))}};this._dispatchEventFromSandbox(s,n)}),n.addEventListener("keydown",t=>{c.commitKey=1;let n=-1;if("Escape"===t.key?n=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(c.commitKey=3):n=2,-1===n)return;const{value:s}=t.target;c.lastCommittedValue!==s&&(c.lastCommittedValue=s,c.userValue=s,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:n,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});const s=blurListener;blurListener=null,n.addEventListener("blur",t=>{if(!c.focused||!t.relatedTarget)return;c.focused=!1;const{value:n}=t.target;c.userValue=n,c.lastCommittedValue!==n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:c.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),s(t)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",t=>{c.lastCommittedValue=null;const{data:n,target:s}=t,{value:a,selectionStart:o,selectionEnd:l}=s;let d=o,h=l;switch(t.inputType){case"deleteWordBackward":{const t=a.substring(0,o).match(/\w*[^\w]*$/);t&&(d-=t[0].length);break}case"deleteWordForward":{const t=a.substring(o).match(/^[^\w]*\w*/);t&&(h+=t[0].length);break}case"deleteContentBackward":o===l&&(d-=1);break;case"deleteContentForward":o===l&&(h+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,change:n||"",willCommit:!1,selStart:d,selEnd:h}})}),this._setEventListeners(n,c,[["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 SignatureWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,n=e.id;let s=t.getValue(n,{value:e.exportValue===e.fieldValue}).value;"string"===typeof s&&(s="Off"!==s,t.setValue(n,{value:s})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const a=document.createElement("input");return u.add(a),a.setAttribute("data-element-id",n),a.disabled=e.readOnly,this._setRequired(a,this.data.required),a.type="checkbox",a.name=e.fieldName,s&&a.setAttribute("checked",!0),a.setAttribute("exportValue",e.exportValue),a.tabIndex=h,a.addEventListener("change",s=>{const{name:a,checked:o}=s.target;for(const l of this._getElementsByName(a,n)){const n=o&&l.exportValue===e.exportValue;l.domElement&&(l.domElement.checked=n),t.setValue(l.id,{value:n})}t.setValue(n,{value:o})}),a.addEventListener("resetform",t=>{const n=e.defaultFieldValue||"Off";t.target.checked=n===e.exportValue}),this.enableScripting&&this.hasJSActions&&(a.addEventListener("updatefromsandbox",e=>{const s={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(n,{value:e.target.checked})}};this._dispatchEventFromSandbox(s,e)}),this._setEventListeners(a,null,[["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(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),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 s=t.getValue(n,{value:e.fieldValue===e.buttonValue}).value;"string"===typeof s&&(s=s!==e.buttonValue,t.setValue(n,{value:s}));const a=document.createElement("input");if(u.add(a),a.setAttribute("data-element-id",n),a.disabled=e.readOnly,this._setRequired(a,this.data.required),a.type="radio",a.name=e.fieldName,s&&a.setAttribute("checked",!0),a.tabIndex=h,a.addEventListener("change",e=>{const{name:s,checked:a}=e.target;for(const o of this._getElementsByName(s,n))t.setValue(o.id,{value:!1});t.setValue(n,{value:a})}),a.addEventListener("resetform",t=>{const n=e.defaultFieldValue;t.target.checked=null!==n&&void 0!==n&&n===e.buttonValue}),this.enableScripting&&this.hasJSActions){const s=e.buttonValue;a.addEventListener("updatefromsandbox",e=>{const a={value:e=>{const a=s===e.detail.value;for(const s of this._getElementsByName(e.target.name)){const e=a&&s.id===n;s.domElement&&(s.domElement.checked=e),t.setValue(s.id,{value:e})}}};this._dispatchEventFromSandbox(a,e)}),this._setEventListeners(a,null,[["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(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),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}),s=document.createElement("select");u.add(s),s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,this._setRequired(s,this.data.required),s.name=this.data.fieldName,s.tabIndex=h;let a=this.data.combo&&this.data.options.length>0;this.data.combo||(s.size=this.data.options.length,this.data.multiSelect&&(s.multiple=!0)),s.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue;for(const n of s.options)n.selected=n.value===e});for(const c of this.data.options){const t=document.createElement("option");t.textContent=c.displayValue,t.value=c.exportValue,n.value.includes(c.exportValue)&&(t.setAttribute("selected",!0),a=!1),s.append(t)}let o=null;if(a){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),s.prepend(t),o=()=>{t.remove(),s.removeEventListener("input",o),o=null},s.addEventListener("input",o)}const getValue=t=>{const e=t?"value":"textContent",{options:n,multiple:a}=s;return a?Array.prototype.filter.call(n,t=>t.selected).map(t=>t[e]):-1===n.selectedIndex?null:n[n.selectedIndex][e]};let l=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?(s.addEventListener("updatefromsandbox",n=>{const a={value(n){o?.();const a=n.detail.value,c=new Set(Array.isArray(a)?a:[a]);for(const t of s.options)t.selected=c.has(t.value);t.setValue(e,{value:getValue(!0)}),l=getValue(!1)},multipleSelection(t){s.multiple=!0},remove(n){const a=s.options,o=n.detail.remove;if(a[o].selected=!1,s.remove(o),a.length>0){-1===Array.prototype.findIndex.call(a,t=>t.selected)&&(a[0].selected=!0)}t.setValue(e,{value:getValue(!0),items:getItems(n)}),l=getValue(!1)},clear(n){for(;0!==s.length;)s.remove(0);t.setValue(e,{value:null,items:[]}),l=getValue(!1)},insert(n){const{index:a,displayValue:o,exportValue:c}=n.detail.insert,d=s.children[a],h=document.createElement("option");h.textContent=o,h.value=c,d?d.before(h):s.append(h),t.setValue(e,{value:getValue(!0),items:getItems(n)}),l=getValue(!1)},items(n){const{items:a}=n.detail;for(;0!==s.length;)s.remove(0);for(const t of a){const{displayValue:e,exportValue:n}=t,a=document.createElement("option");a.textContent=e,a.value=n,s.append(a)}s.options.length>0&&(s.options[0].selected=!0),t.setValue(e,{value:getValue(!0),items:getItems(n)}),l=getValue(!1)},indices(n){const s=new Set(n.detail.indices);for(const t of n.target.options)t.selected=s.has(t.index);t.setValue(e,{value:getValue(!0)}),l=getValue(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(a,n)}),s.addEventListener("input",n=>{const s=getValue(!0);t.setValue(e,{value:s}),n.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:l,changeEx:s,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(s,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],t=>t.target.value)):s.addEventListener("input",function(n){t.setValue(e,{value:getValue(!0)})}
2),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class PopupAnnotationElement extends AnnotationElement{constructor(t){const{data:e,elements:n}=t;super(t,{isRenderable:AnnotationElement._hasPopupData(e)}),this.elements=n}render(){this.container.classList.add("popupAnnotation");const t=new PopupElement({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(const n of this.elements)n.popup=t,e.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",e.map(t=>`${s.AnnotationPrefix}${t}`).join(",")),this.container}}class PopupElement{#en=null;#nn=this.#in.bind(this);#sn=this.#rn.bind(this);#an=this.#on.bind(this);#ln=this.#cn.bind(this);#Ue=null;#Ft=null;#dn=null;#hn=null;#un=null;#pn=null;#gn=!1;#mn=null;#fn=null;#bn=null;#An=null;#vn=!1;constructor({container:t,color:e,elements:n,titleObj:s,modificationDate:o,contentsObj:l,richText:c,parent:d,rect:h,parentRect:u,open:p}){this.#Ft=t,this.#An=s,this.#dn=l,this.#bn=c,this.#un=d,this.#Ue=e,this.#fn=h,this.#pn=u,this.#hn=n;const g=a.PDFDateString.toDateObject(o);g&&(this.#en=d.l10n.get("annotation_date_string",{date:g.toLocaleDateString(),time:g.toLocaleTimeString()})),this.trigger=n.flatMap(t=>t.getElementsToTriggerPopup());for(const a of this.trigger)a.addEventListener("click",this.#ln),a.addEventListener("mouseenter",this.#an),a.addEventListener("mouseleave",this.#sn),a.classList.add("popupTriggerArea");for(const a of n)a.container?.addEventListener("keydown",this.#nn);this.#Ft.hidden=!0,p&&this.#cn()}render(){if(this.#mn)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:n,pageX:a,pageY:o}}}=this.#un,l=this.#mn=document.createElement("div");if(l.className="popup",this.#Ue){const t=l.style.outlineColor=s.Util.makeHexColor(...this.#Ue);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))l.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`;else{const t=.7;l.style.backgroundColor=s.Util.makeHexColor(...this.#Ue.map(e=>Math.floor(t*(255-e)+e)))}}const c=document.createElement("span");c.className="header";const h=document.createElement("h1");if(c.append(h),({dir:h.dir,str:h.textContent}=this.#An),l.append(c),this.#en){const t=document.createElement("span");t.classList.add("popupDate"),this.#en.then(e=>{t.textContent=e}),c.append(t)}const u=this.#dn,p=this.#bn;if(!p?.str||u?.str&&u.str!==p.str){const t=this._formatContents(u);l.append(t)}else d.XfaLayer.render({xfaHtml:p.html,intent:"richText",div:l}),l.lastChild.classList.add("richText","popupContent");let g=!!this.#pn,m=g?this.#pn:this.#fn;for(const d of this.#hn)if(!m||null!==s.Util.intersect(d.data.rect,m)){m=d.data.rect,g=!0;break}const f=s.Util.normalizeRect([m[0],t[3]-m[1]+t[1],m[2],t[3]-m[3]+t[1]]),b=g?m[2]-m[0]+5:0,A=f[0]+b,v=f[1],{style:y}=this.#Ft;y.left=100*(A-a)/e+"%",y.top=100*(v-o)/n+"%",this.#Ft.append(l)}_formatContents({str:t,dir:e}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=e;const s=t.split(/(?:\r\n?|\n)/);for(let a=0,o=s.length;a<o;++a){const t=s[a];n.append(document.createTextNode(t)),a<o-1&&n.append(document.createElement("br"))}return n}#in(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&this.#gn)&&this.#cn()}#cn(){this.#gn=!this.#gn,this.#gn?(this.#on(),this.#Ft.addEventListener("click",this.#ln),this.#Ft.addEventListener("keydown",this.#nn)):(this.#rn(),this.#Ft.removeEventListener("click",this.#ln),this.#Ft.removeEventListener("keydown",this.#nn))}#on(){this.#mn||this.render(),this.isVisible?this.#gn&&this.#Ft.classList.add("focused"):(this.#Ft.hidden=!1,this.#Ft.style.zIndex=parseInt(this.#Ft.style.zIndex)+1e3)}#rn(){this.#Ft.classList.remove("focused"),!this.#gn&&this.isVisible&&(this.#Ft.hidden=!0,this.#Ft.style.zIndex=parseInt(this.#Ft.style.zIndex)-1e3)}forceHide(){this.#vn=this.isVisible,this.#vn&&(this.#Ft.hidden=!0)}maybeShow(){this.#vn&&(this.#vn=!1,this.#Ft.hidden=!1)}get isVisible(){return!1===this.#Ft.hidden}}class FreeTextAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=s.AnnotationEditorType.FREETEXT}
vendor: 4,262 bytes, line 2
2render(){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.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}e.FreeTextAnnotationElement=FreeTextAnnotationElement;class LineAnnotationElement extends AnnotationElement{#yn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:n}=getRectDims(t.rect),s=this.svgFactory.create(e,n,!0),a=this.#yn=this.svgFactory.createElement("svg:line");return a.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),a.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),a.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),a.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),a.setAttribute("stroke-width",t.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),s.append(a),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#yn}addHighlightArea(){this.container.classList.add("highlightArea")}}class SquareAnnotationElement extends AnnotationElement{#_n=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:n}=getRectDims(t.rect),s=this.svgFactory.create(e,n,!0),a=t.borderStyle.width,o=this.#_n=this.svgFactory.createElement("svg:rect");return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",e-a),o.setAttribute("height",n-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#_n}addHighlightArea(){this.container.classList.add("highlightArea")}}class CircleAnnotationElement extends AnnotationElement{#Sn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:n}=getRectDims(t.rect),s=this.svgFactory.create(e,n,!0),a=t.borderStyle.width,o=this.#Sn=this.svgFactory.createElement("svg:ellipse");return o.setAttribute("cx",e/2),o.setAttribute("cy",n/2),o.setAttribute("rx",e/2-a/2),o.setAttribute("ry",n/2-a/2),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Sn}addHighlightArea(){this.container.classList.add("highlightArea")}}class PolylineAnnotationElement extends AnnotationElement{#xn=null;constructor(t){super(t,{isRenderable:!0,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),s=this.svgFactory.create(e,n,!0);let a=[];for(const l of t.vertices){const e=l.x-t.rect[0],n=t.rect[3]-l.y;a.push(e+","+n)}a=a.join(" ");const o=this.#xn=this.svgFactory.createElement(this.svgElementName);return o.setAttribute("points",a),o.setAttribute("stroke-width",t.borderStyle.width||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#xn}addHighlightArea(){this.container.classList.add("highlightArea")}}class PolygonAnnotationElement extends PolylineAnnotationElement{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class CaretAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}
2class InkAnnotationElement extends AnnotationElement{#En=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=s.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const t=this.data,{width:e,height:n}=getRectDims(t.rect),s=this.svgFactory.create(e,n,!0);for(const a of t.inkLists){let e=[];for(const s of a){const n=s.x-t.rect[0],a=t.rect[3]-s.y;e.push(`${n},${a}`)}e=e.join(" ");const n=this.svgFactory.createElement(this.svgElementName);this.#En.push(n),n.setAttribute("points",e),n.setAttribute("stroke-width",t.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),!t.popupRef&&this.hasPopupData&&this._createPopup(),s.append(n)}return this.container.append(s),this.container}getElementsToTriggerPopup(){return this.#En}addHighlightArea(){this.container.classList.add("highlightArea")}}e.InkAnnotationElement=InkAnnotationElement;class HighlightAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class UnderlineAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class SquigglyAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class StrikeOutAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class StampAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}e.StampAnnotationElement=StampAnnotationElement;class FileAttachmentAnnotationElement extends AnnotationElement{#wn=null;constructor(t){super(t,{isRenderable:!0});const{filename:e,content:n}=this.data.file;this.filename=(0,a.getFilenameFromUrl)(e,!0),this.content=n,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:e,content:n})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:e}=this;let n;e.hasAppearance||0===e.fillAlpha?n=document.createElement("div"):(n=document.createElement("img"),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name)?"paperclip":"pushpin"}.svg`,e.fillAlpha&&e.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(100*e.fillAlpha)}%);`)),n.addEventListener("dblclick",this.#Cn.bind(this)),this.#wn=n;const{isMac:a}=s.FeatureTest.platform;return t.addEventListener("keydown",t=>{"Enter"===t.key&&(a?t.metaKey:t.ctrlKey)&&this.#Cn()}),!e.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea"),t.append(n),t}getElementsToTriggerPopup(){return this.#wn}addHighlightArea(){this.container.classList.add("highlightArea")}#Cn(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}e.AnnotationLayer=class AnnotationLayer{#Se=null;#Tn=null;#Pn=new Map;constructor({div:t,accessibilityManager:e,annotationCanvasMap:n,l10n:s,page:a,viewport:o}){this.div=t,this.#Se=e,this.#Tn=n,this.l10n=s,this.page=a,this.viewport=o,this.zIndex=0,this.l10n||=c.NullL10n}#kn(t,e){const n=t.firstChild||t;n.id=`${s.AnnotationPrefix}${e}`,this.div.append(t),this.#Se?.moveElementInDOM(this.div,t,n,!1)}async render(t){const{annotations:e}=t,n=this.div;(0,a.setLayerDimensions)(n,this.viewport);const l=new Map,c={data:null,layer:n,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new a.DOMSVGFactory,annotationStorage:t.annotationStorage||new o.AnnotationStorage,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const a of e){if(a.noHTML)continue;const t=a.annotationType===s.AnnotationType.POPUP;if(t){const t=l.get(a.id);if(!t)continue;c.elements=t}else{const{width:t,height:e}=getRectDims(a.rect);if(t<=0||e<=0)continue}c.data=a;const e=AnnotationElementFactory.create(c);if(!e.isRenderable)continue;if(!t&&a.popupRef){const t=l.get(a.popupRef);t?t.push(e):l.set(a.popupRef,[e])}e.annotationEditorType>0&&this.#Pn.set(e.data.id,e);const n=e.render();a.hidden&&(n.style.visibility="hidden"),this.#kn(n,a.id)}this.#Mn(),await this.l10n.translate(n)}update({viewport:t}){const e=this.div;this.viewport=t,(0,a.setLayerDimensions)(e,{rotation:t.rotation}),this.#Mn(),e.hidden=!1}#Mn(){if(!this.#Tn)return;const t=this.div;for(const[e,n]of this.#Tn){const s=t.querySelector(`[data-annotation-id="${e}"]`);if(!s)continue;const{firstChild:a}=s;a?"CANVAS"===a.nodeName?a.replaceWith(n):a.before(n):s.append(n)}this.#Tn.clear()}getEditableAnnotations(){return Array.from(this.#Pn.values())}getEditableAnnotation(t){return this.#Pn.get(t)}}},(t,e)=>{function makeColorComp(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function scaleAndClamp(t){return Math.max(0,Math.min(255,255*t))}
2Object.defineProperty(e,"__esModule",{value:!0}),e.ColorConverters=void 0;e.ColorConverters=class ColorConverters{static CMYK_G([t,e,n,s]){return["G",1-Math.min(1,.3*t+.59*n+.11*e+s)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=scaleAndClamp(t),t,t]}static G_HTML([t]){const e=makeColorComp(t);return`#${e}${e}${e}`}static RGB_G([t,e,n]){return["G",.3*t+.59*e+.11*n]}static RGB_rgb(t){return t.map(scaleAndClamp)}static RGB_HTML(t){return`#${t.map(makeColorComp).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,n,s]){return["RGB",1-Math.min(1,t+s),1-Math.min(1,n+s),1-Math.min(1,e+s)]}static CMYK_rgb([t,e,n,s]){return[scaleAndClamp(1-Math.min(1,t+s)),scaleAndClamp(1-Math.min(1,n+s)),scaleAndClamp(1-Math.min(1,e+s))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,n]){const s=1-t,a=1-e,o=1-n;return["CMYK",s,a,o,Math.min(s,a,o)]}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NullL10n=void 0,e.getL10nFallback=getL10nFallback;const n={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} \xd7 {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} \xd7 {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing\u2026",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};function getL10nFallback(t,e){switch(t){case"find_match_count":t=`find_match_count[${1===e.total?"one":"other"}]`;break;case"find_match_count_limit":t=`find_match_count_limit[${1===e.limit?"one":"other"}]`}return n[t]||""}n.print_progress_percent="{{progress}}%";const s={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",get:async(t,e=null,n=getL10nFallback(t,e))=>function formatL10nValue(t,e){return e?t.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(t,n)=>n in e?e[n]:"{{"+n+"}}"):t}(n,e),async translate(t){}};e.NullL10n=s},(t,e,n)=>
vendor: 6,110 bytes, line 2
2{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaLayer=void 0;var s=n(25);e.XfaLayer=class XfaLayer{static setupStorage(t,e,n,s,a){const o=s.getValue(e,{value:null});switch(n.name){case"textarea":if(null!==o.value&&(t.textContent=o.value),"print"===a)break;t.addEventListener("input",t=>{s.setValue(e,{value:t.target.value})});break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(o.value===n.attributes.xfaOn?t.setAttribute("checked",!0):o.value===n.attributes.xfaOff&&t.removeAttribute("checked"),"print"===a)break;t.addEventListener("change",t=>{s.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{if(null!==o.value&&t.setAttribute("value",o.value),"print"===a)break;t.addEventListener("input",t=>{s.setValue(e,{value:t.target.value})})}break;case"select":if(null!==o.value){t.setAttribute("value",o.value);for(const t of n.children)t.attributes.value===o.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",t=>{const n=t.target.options,a=-1===n.selectedIndex?"":n[n.selectedIndex].value;s.setValue(e,{value:a})})}}static setAttributes({html:t,element:e,storage:n=null,intent:s,linkService:a}){const{attributes:o}=e,l=t instanceof HTMLAnchorElement;"radio"===o.type&&(o.name=`${o.name}-${s}`);for(const[c,d]of Object.entries(o))if(null!==d&&void 0!==d)switch(c){case"class":d.length&&t.setAttribute(c,d.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",d);break;case"style":Object.assign(t.style,d);break;case"textContent":t.textContent=d;break;default:(!l||"href"!==c&&"newWindow"!==c)&&t.setAttribute(c,d)}l&&a.addLinkAttributes(t,o.href,o.newWindow),n&&o.dataId&&this.setupStorage(t,o.dataId,e,n)}static render(t){const e=t.annotationStorage,n=t.linkService,a=t.xfaHtml,o=t.intent||"display",l=document.createElement(a.name);a.attributes&&this.setAttributes({html:l,element:a,intent:o,linkService:n});const c=[[a,-1,l]],d=t.div;if(d.append(l),t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;d.style.transform=e}"richText"!==o&&d.setAttribute("class","xfaLayer xfaFont");const h=[];for(;c.length>0;){const[t,a,l]=c.at(-1);if(a+1===t.children.length){c.pop();continue}const d=t.children[++c.at(-1)[1]];if(null===d)continue;const{name:u}=d;if("#text"===u){const t=document.createTextNode(d.value);h.push(t),l.append(t);continue}const p=d?.attributes?.xmlns?document.createElementNS(d.attributes.xmlns,u):document.createElement(u);if(l.append(p),d.attributes&&this.setAttributes({html:p,element:d,storage:e,intent:o,linkService:n}),d.children&&d.children.length>0)c.push([d,-1,p]);else if(d.value){const t=document.createTextNode(d.value);s.XfaText.shouldBuildText(u)&&h.push(t),p.append(t)}}for(const s of d.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))s.setAttribute("readOnly",!0);return{textDivs:h}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InkEditor=void 0;var s=n(1),a=n(4),o=n(29),l=n(6),c=n(5);class InkEditor extends a.AnnotationEditor{#Rn=0;#Fn=0;#Dn=this.canvasPointermove.bind(this);#In=this.canvasPointerleave.bind(this);#Ln=this.canvasPointerup.bind(this);#On=this.canvasPointerdown.bind(this);#Nn=new Path2D;#Bn=!1;#jn=!1;#Un=!1;#Wn=null;#zn=0;#Hn=0;#Gn=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;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,this._willKeepAspectRatio=!0}static initialize(t){a.AnnotationEditor.initialize(t,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(t,e){switch(t){case s.AnnotationEditorParamsType.INK_THICKNESS:InkEditor._defaultThickness=e;break;case s.AnnotationEditorParamsType.INK_COLOR:InkEditor._defaultColor=e;break;case s.AnnotationEditorParamsType.INK_OPACITY:InkEditor._defaultOpacity=e/100}}updateParams(t,e){switch(t){case s.AnnotationEditorParamsType.INK_THICKNESS:this.#Vn(e);break;case s.AnnotationEditorParamsType.INK_COLOR:this.#qe(e);break;case s.AnnotationEditorParamsType.INK_OPACITY:this.#qn(e)}}static get defaultPropertiesToUpdate(){return[[s.AnnotationEditorParamsType.INK_THICKNESS,InkEditor._defaultThickness],[s.AnnotationEditorParamsType.INK_COLOR,InkEditor._defaultColor||a.AnnotationEditor._defaultLineColor],[s.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*InkEditor._defaultOpacity)]]}get propertiesToUpdate(){return[[s.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||InkEditor._defaultThickness],[s.AnnotationEditorParamsType.INK_COLOR,this.color||InkEditor._defaultColor||a.AnnotationEditor._defaultLineColor],[s.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??InkEditor._defaultOpacity))]]}#Vn(t){const e=this.thickness;this.addCommands({cmd:()=>{this.thickness=t,this.#$n()},undo:()=>{this.thickness=e,this.#$n()},mustExec:!0,type:s.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#qe(t){const e=this.color;this.addCommands({cmd:()=>{this.color=t,this.#Xn()},undo:()=>{this.color=e,this.#Xn()},mustExec:!0,type:s.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#qn(t){t/=100;const e=this.opacity;this.addCommands({cmd:()=>{this.opacity=t,this.#Xn()},undo:()=>{this.opacity=e,this.#Xn()},mustExec:!0,type:s.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(this.#Kn(),this.#Yn()),this.isAttachedToDOM||(this.parent.add(this),this.#Jn()),this.#$n()))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#Wn.disconnect(),this.#Wn=null,
2super.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,s=this.height*e;this.setDimensions(n,s)}enableEditMode(){this.#Bn||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",this.#On))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#On))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#Qn(){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]}}#Zn(){const{ctx:t,color:e,opacity:n,thickness:s,parentScale:a,scaleFactor:o}=this;t.lineWidth=s*a/o,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${e}${(0,c.opacityToHex)(n)}`}#ti(t,e){this.canvas.addEventListener("contextmenu",l.noContextMenu),this.canvas.addEventListener("pointerleave",this.#In),this.canvas.addEventListener("pointermove",this.#Dn),this.canvas.addEventListener("pointerup",this.#Ln),this.canvas.removeEventListener("pointerdown",this.#On),this.isEditing=!0,this.#Un||(this.#Un=!0,this.#Jn(),this.thickness||=InkEditor._defaultThickness,this.color||=InkEditor._defaultColor||a.AnnotationEditor._defaultLineColor,this.opacity??=InkEditor._defaultOpacity),this.currentPath.push([t,e]),this.#jn=!1,this.#Zn(),this.#Gn=()=>{this.#ei(),this.#Gn&&window.requestAnimationFrame(this.#Gn)},window.requestAnimationFrame(this.#Gn)}#ni(t,e){const[n,s]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===n&&e===s)return;const a=this.currentPath;let o=this.#Nn;if(a.push([t,e]),this.#jn=!0,a.length<=2)return o.moveTo(...a[0]),void o.lineTo(t,e);3===a.length&&(this.#Nn=o=new Path2D,o.moveTo(...a[0])),this.#ii(o,...a.at(-3),...a.at(-2),t,e)}#si(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);this.#Nn.lineTo(...t)}#ri(t,e){let n;if(this.#Gn=null,t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),this.#ni(t,e),this.#si(),1!==this.currentPath.length)n=this.#ai();else{const s=[t,e];n=[[s,s.slice(),s.slice(),s]]}const s=this.#Nn,a=this.currentPath;this.currentPath=[],this.#Nn=new Path2D;this.addCommands({cmd:()=>{this.allRawPaths.push(a),this.paths.push(n),this.bezierPath2D.push(s),this.rebuild()},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#Kn(),this.#Yn()),this.#$n())},mustExec:!0})}#ei(){if(!this.#jn)return;this.#jn=!1;const t=Math.ceil(this.thickness*this.parentScale),e=this.currentPath.slice(-3),n=e.map(t=>t[0]),s=e.map(t=>t[1]),{ctx:a}=(Math.min(...n),Math.max(...n),Math.min(...s),Math.max(...s),this);a.save(),a.clearRect(0,0,this.canvas.width,this.canvas.height);for(const o of this.bezierPath2D)a.stroke(o);a.stroke(this.#Nn),a.restore()}#ii(t,e,n,s,a,o,l){const c=(e+s)/2,d=(n+a)/2,h=(s+o)/2,u=(a+l)/2;t.bezierCurveTo(c+2*(s-c)/3,d+2*(a-d)/3,h+2*(s-h)/3,u+2*(a-u)/3,h,u)}#ai(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let n,[s,a]=t[0];for(n=1;n<t.length-2;n++){const[o,l]=t[n],[c,d]=t[n+1],h=(o+c)/2,u=(l+d)/2,p=[s+2*(o-s)/3,a+2*(l-a)/3],g=[h+2*(o-h)/3,u+2*(l-u)/3];e.push([[s,a],p,g,[h,u]]),[s,a]=[h,u]}const[o,l]=t[n],[c,d]=t[n+1],h=[s+2*(o-s)/3,a+2*(l-a)/3],u=[c+2*(o-c)/3,d+2*(l-d)/3];return e.push([[s,a],h,u,[c,d]]),e}#Xn(){if(this.isEmpty())return void this.#oi();this.#Zn();const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),this.#oi();for(const n of this.bezierPath2D)e.stroke(n)}commit(){this.#Bn||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#Bn=!0,this.div.classList.add("disabled"),this.#$n(!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!this.#Bn&&(this.setInForeground(),t.preventDefault(),"mouse"!==t.type&&this.div.focus(),this.#ti(t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),this.#ni(t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),this.#li(t)}canvasPointerleave(t){this.#li(t)}#li(t){this.canvas.removeEventListener("pointerleave",this.#In),this.canvas.removeEventListener("pointermove",this.#Dn),this.canvas.removeEventListener("pointerup",this.#Ln),this.canvas.addEventListener("pointerdown",this.#On
2),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",l.noContextMenu)},10),this.#ri(t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#Kn(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",a.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(t=>this.canvas?.setAttribute("aria-label",t)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#Yn(){this.#Wn=new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}),this.#Wn.observe(this.div)}get isResizable(){return!this.isEmpty()&&this.#Bn}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),a.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(t=>this.div?.setAttribute("aria-label",t));const[n,s,o,l]=this.#Qn();if(this.setAt(n,s,0,0),this.setDims(o,l),this.#Kn(),this.width){const[n,s]=this.parentDimensions;this.setAspectRatio(this.width*n,this.height*s),this.setAt(t*n,e*s,this.width*n,this.height*s),this.#Un=!0,this.#Jn(),this.setDims(this.width*n,this.height*s),this.#Xn(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#Yn(),this.div}#Jn(){if(!this.#Un)return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),this.#oi()}setDimensions(t,e){const n=Math.round(t),s=Math.round(e);if(this.#zn===n&&this.#Hn===s)return;this.#zn=n,this.#Hn=s,this.canvas.style.visibility="hidden";const[a,o]=this.parentDimensions;this.width=t/a,this.height=e/o,this.fixAndSetPosition(),this.#Bn&&this.#ci(t,e),this.#Jn(),this.#Xn(),this.canvas.style.visibility="visible",this.fixDims()}#ci(t,e){const n=this.#di(),s=(t-n)/this.#Fn,a=(e-n)/this.#Rn;this.scaleFactor=Math.min(s,a)}#oi(){const t=this.#di()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static#hi(t){const e=new Path2D;for(let n=0,s=t.length;n<s;n++){const[s,a,o,l]=t[n];0===n&&e.moveTo(...s),e.bezierCurveTo(a[0],a[1],o[0],o[1],l[0],l[1])}return e}static#ui(t,e,n){const[s,a,o,l]=e;switch(n){case 0:for(let e=0,n=t.length;e<n;e+=2)t[e]+=s,t[e+1]=l-t[e+1];break;case 90:for(let e=0,n=t.length;e<n;e+=2){const n=t[e];t[e]=t[e+1]+s,t[e+1]=n+a}break;case 180:for(let e=0,n=t.length;e<n;e+=2)t[e]=o-t[e],t[e+1]+=a;break;case 270:for(let e=0,n=t.length;e<n;e+=2){const n=t[e];t[e]=o-t[e+1],t[e+1]=l-n}break;default:throw new Error("Invalid rotation")}return t}static#pi(t,e,n){const[s,a,o,l]=e;switch(n){case 0:for(let e=0,n=t.length;e<n;e+=2)t[e]-=s,t[e+1]=l-t[e+1];break;case 90:for(let e=0,n=t.length;e<n;e+=2){const n=t[e];t[e]=t[e+1]-a,t[e+1]=n-s}break;case 180:for(let e=0,n=t.length;e<n;e+=2)t[e]=o-t[e],t[e+1]-=a;break;case 270:for(let e=0,n=t.length;e<n;e+=2){const n=t[e];t[e]=l-t[e+1],t[e+1]=o-n}break;default:throw new Error("Invalid rotation")}return t}#gi(t,e,n,s){const a=[],o=this.thickness/2,l=t*e+o,c=t*n+o;for(const d of this.paths){const e=[],n=[];for(let s=0,a=d.length;s<a;s++){const[o,h,u,p]=d[s],g=t*o[0]+l,m=t*o[1]+c,f=t*h[0]+l,b=t*h[1]+c,A=t*u[0]+l,v=t*u[1]+c,y=t*p[0]+l,_=t*p[1]+c;0===s&&(e.push(g,m),n.push(g,m)),e.push(f,b,A,v,y,_),n.push(f,b),s===a-1&&n.push(y,_)}a.push({bezier:InkEditor.#ui(e,s,this.rotation),points:InkEditor.#ui(n,s,this.rotation)})}return a}#mi(){let t=1/0,e=-1/0,n=1/0,a=-1/0;for(const o of this.paths)for(const[l,c,d,h]of o){const o=s.Util.bezierBoundingBox(...l,...c,...d,...h);t=Math.min(t,o[0]),n=Math.min(n,o[1]),e=Math.max(e,o[2]),a=Math.max(a,o[3])}return[t,n,e,a]}#di(){return this.#Bn?Math.ceil(this.thickness*this.parentScale):0}#$n(t=!1){if(this.isEmpty())return;if(!this.#Bn)return void this.#Xn();const e=this.#mi(),n=this.#di();this.#Fn=Math.max(a.AnnotationEditor.MIN_SIZE,e[2]-e[0]),this.#Rn=Math.max(a.AnnotationEditor.MIN_SIZE,e[3]-e[1]);const s=Math.ceil(n+this.#Fn*this.scaleFactor),o=Math.ceil(n+this.#Rn*this.scaleFactor),[l,c]=this.parentDimensions;this.width=s/l,this.height=o/c,this.setAspectRatio(s,o);const d=this.translationX,h=this.translationY;this.translationX=-e[0],this.translationY=-e[1],this.#Jn(),this.#Xn(),this.#zn=s,this.#Hn=o,this.setDims(s,o);const u=t?n/this.scaleFactor/2:0;this.translate(d-this.translationX-u,h-this.translationY-u)}static deserialize(t,e,n){if(t instanceof o.InkAnnotationElement)return null;const l=super.deserialize(t,e,n);l.thickness=t.thickness,l.color=s.Util.makeHexColor(...t.color),l.opacity=t.opacity;const[c,d]=l.pageDimensions,h=l.width*c,u=l.height*d,p=l.parentScale,g=t.thickness/2;l.#Bn=!0,l.#zn=Math.round(h),l.#Hn=Math.round(u);const{paths:m,rect:f,rotation:b}=t;for(let{bezier:s}of m){s=InkEditor.#pi(s,f,b);const t=[];l.paths.push(t);let e=p*(s[0]-g),n=p*(s[1]-g);for(let o=2,l=s.length;o<l;o+=6){const a=p*(s[o]-g),l=p*(s[o+1]-g),c=p*(s[o+2]-g),d=p*(s[o+3]-g),h=p*(s[o+4]-g),u=p*(s[o+5]-g);t.push([[e,n],[a,l],[c,d],[h,u]]),e=h,n=u}const a=this.#hi(t);l.bezierPath2D.push(a)}const A=l.#mi();return l.#Fn=Math.max(a.AnnotationEditor.MIN_SIZE,A[2]-A[0]),l.#Rn=Math.max(a.AnnotationEditor.MIN_SIZE,A[3]-A[1]),l.#ci(h,u),l}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=a.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:s.AnnotationEditorType.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:this.#gi(this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}e.InkEditor=InkEditor},(t,e,n)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.StampEditor=void 0;var s=n(1),a=n(4),o=n(6),l=n(29);class StampEditor extends a.AnnotationEditor{#fi=null;#bi=null;#Ai=null;#vi=null;#yi=null;#_i=null;#Wn=null;#Si=null;#xi=!1;#Ei=!1;static _type="stamp";constructor(t){super({...t,name:"stampEditor"}),this.#vi=t.bitmapUrl,this.#yi=t.bitmapFile}static initialize(t){a.AnnotationEditor.initialize(t)}static get supportedTypes(){return(0,s.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(t=>`image/${t}`))}static get supportedTypesStr(){return(0,s.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(s.AnnotationEditorType.STAMP,{bitmapFile:t.getAsFile()})}#wi(t,e=!1){t?(this.#fi=t.bitmap,e||(this.#bi=t.id,this.#xi=t.isSvg),this.#Kn()):this.remove()}#Ci(){this.#Ai=null,this._uiManager.enableWaiting(!1),this.#_i&&this.div.focus()}#Ti(){if(this.#bi)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#bi).then(t=>this.#wi(t,!0)).finally(()=>this.#Ci());if(this.#vi){const t=this.#vi;return this.#vi=null,this._uiManager.enableWaiting(!0),void(this.#Ai=this._uiManager.imageManager.getFromUrl(t).then(t=>this.#wi(t)).finally(()=>this.#Ci()))}if(this.#yi){const t=this.#yi;return this.#yi=null,this._uiManager.enableWaiting(!0),void(this.#Ai=this._uiManager.imageManager.getFromFile(t).then(t=>this.#wi(t)).finally(()=>this.#Ci()))}const t=document.createElement("input");t.type="file",t.accept=StampEditor.supportedTypesStr,this.#Ai=new Promise(e=>{t.addEventListener("change",async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);this.#wi(e)}else this.remove();e()}),t.addEventListener("cancel",()=>{this.remove(),e()})}).finally(()=>this.#Ci()),t.click()}remove(){this.#bi&&(this.#fi=null,this._uiManager.imageManager.deleteId(this.#bi),this.#_i?.remove(),this.#_i=null,this.#Wn?.disconnect(),this.#Wn=null),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#bi&&this.#Ti(),this.isAttachedToDOM||this.parent.add(this))):this.#bi&&this.#Ti()}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#Ai||this.#fi||this.#vi||this.#yi)}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.#fi?this.#Kn():this.#Ti(),this.width){const[n,s]=this.parentDimensions;this.setAt(t*n,e*s,this.width*n,this.height*s)}return this.div}#Kn(){const{div:t}=this;let{width:e,height:n}=this.#fi;const[s,a]=this.pageDimensions,o=.75;if(this.width)e=this.width*s,n=this.height*a;else if(e>o*s||n>o*a){const t=Math.min(o*s/e,o*a/n);e*=t,n*=t}const[l,c]=this.parentDimensions;this.setDims(e*l/s,n*c/a),this._uiManager.enableWaiting(!1);const d=this.#_i=document.createElement("canvas");t.append(d),t.hidden=!1,this.#Pi(e,n),this.#Yn(),this.#Ei||(this.parent.addUndoableEditor(this),this.#Ei=!0),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()}#ki(t,e){const[n,s]=this.parentDimensions;this.width=t/n,this.height=e/s,this.setDims(t,e),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==this.#Si&&clearTimeout(this.#Si);this.#Si=setTimeout(()=>{this.#Si=null,this.#Pi(t,e)},200)}#Mi(t,e){const{width:n,height:s}=this.#fi;let a=n,o=s,l=this.#fi;for(;a>2*t||o>2*e;){const n=a,s=o;a>2*t&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),o>2*e&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const c=new OffscreenCanvas(a,o);c.getContext("2d").drawImage(l,0,0,n,s,0,0,a,o),l=c.transferToImageBitmap()}return l}#Pi(t,e){t=Math.ceil(t),e=Math.ceil(e);const n=this.#_i;if(!n||n.width===t&&n.height===e)return;n.width=t,n.height=e;const s=this.#xi?this.#fi:this.#Mi(t,e),a=n.getContext("2d");a.filter=this._uiManager.hcmFilter,a.drawImage(s,0,0,s.width,s.height,0,0,t,e)}
2#Ri(t){if(t){if(this.#xi){const t=this._uiManager.imageManager.getSvgUrl(this.#bi);if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=this.#fi);return t.getContext("2d").drawImage(this.#fi,0,0),t.toDataURL()}if(this.#xi){const[t,e]=this.pageDimensions,n=Math.round(this.width*t*o.PixelsPerInch.PDF_TO_CSS_UNITS),s=Math.round(this.height*e*o.PixelsPerInch.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(n,s);return a.getContext("2d").drawImage(this.#fi,0,0,this.#fi.width,this.#fi.height,0,0,n,s),a.transferToImageBitmap()}return structuredClone(this.#fi)}#Yn(){this.#Wn=new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&this.#ki(e.width,e.height)}),this.#Wn.observe(this.div)}static deserialize(t,e,n){if(t instanceof l.StampAnnotationElement)return null;const s=super.deserialize(t,e,n),{rect:a,bitmapUrl:o,bitmapId:c,isSvg:d,accessibilityData:h}=t;c&&n.imageManager.isValidId(c)?s.#bi=c:s.#vi=o,s.#xi=d;const[u,p]=s.pageDimensions;return s.width=(a[2]-a[0])/u,s.height=(a[3]-a[1])/p,h&&(s.altTextData=h),s}serialize(t=!1,e=null){if(this.isEmpty())return null;const n={annotationType:s.AnnotationEditorType.STAMP,bitmapId:this.#bi,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#xi,structTreeParentId:this._structTreeParentId};if(t)return n.bitmapUrl=this.#Ri(!0),n.accessibilityData=this.altTextData,n;const{decorative:a,altText:o}=this.altTextData;if(!a&&o&&(n.accessibilityData={type:"Figure",alt:o}),null===e)return n;e.stamps||=new Map;const l=this.#xi?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(e.stamps.has(this.#bi)){if(this.#xi){const t=e.stamps.get(this.#bi);l>t.area&&(t.area=l,t.serialized.bitmap.close(),t.serialized.bitmap=this.#Ri(!1))}}else e.stamps.set(this.#bi,{area:l,serialized:n}),n.bitmap=this.#Ri(!1);return n}}e.StampEditor=StampEditor}],__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](n,n.exports,__w_pdfjs_require__),n.exports}var __nested_webpack_exports__={};return(()=>{var t=__nested_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 o.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 l.AnnotationEditorUIManager}}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return c.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,"DOMSVGFactory",{enumerable:!0,get:function(){return s.DOMSVGFactory}}),Object.defineProperty(t,"FeatureTest",{enumerable:!0,get:function(){return e.FeatureTest}}),Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return d.GlobalWorkerOptions}}),Object.defineProperty(t,"ImageKind",{enumerable:!0,get:function(){return e.ImageKind}}),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 s.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 s.PixelsPerInch}}),Object.defineProperty(t,"PromiseCapability",{enumerable:!0,get:function(){return e.PromiseCapability}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return s.RenderingCancelledException}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return n.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}}
2),Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return h.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 s.getFilenameFromUrl}}),Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return s.getPdfFilenameFromUrl}}),Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return s.getXfaPageViewport}}),Object.defineProperty(t,"isDataScheme",{enumerable:!0,get:function(){return s.isDataScheme}}),Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return s.isPdfFile}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return s.loadScript}}),Object.defineProperty(t,"noContextMenu",{enumerable:!0,get:function(){return s.noContextMenu}}),Object.defineProperty(t,"normalizeUnicode",{enumerable:!0,get:function(){return e.normalizeUnicode}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return a.renderTextLayer}}),Object.defineProperty(t,"setLayerDimensions",{enumerable:!0,get:function(){return s.setLayerDimensions}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}}),Object.defineProperty(t,"updateTextLayer",{enumerable:!0,get:function(){return a.updateTextLayer}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return n.version}});var e=__w_pdfjs_require__(1),n=__w_pdfjs_require__(2),s=__w_pdfjs_require__(6),a=__w_pdfjs_require__(26),o=__w_pdfjs_require__(27),l=__w_pdfjs_require__(5),c=__w_pdfjs_require__(29),d=__w_pdfjs_require__(14),h=__w_pdfjs_require__(32)})(),__nested_webpack_exports__})())},53736(t,e,n){"use strict";var s=n(85072),a=n.n(s),o=n(97825),l=n.n(o),c=n(77659),d=n.n(c),h=n(55056),u=n.n(h),p=n(10540),g=n.n(p),m=n(41113),f=n.n(m),b=n(3889),A={};A.styleTagTransform=f(),A.setAttributes=u(),A.insert=d().bind(null,"head"),A.domAPI=l(),A.insertStyleElement=g();a()(b.A,A),b.A&&b.A.locals&&b.A.locals},66642(t,e,n){"use strict";var s=n(85072),a=n.n(s),o=n(97825),l=n.n(o),c=n(77659),d=n.n(c),h=n(55056),u=n.n(h),p=n(10540),g=n.n(p),m=n(41113),f=n.n(m),b=n(38815),A={};A.styleTagTransform=f(),A.setAttributes=u(),A.insert=d().bind(null,"head"),A.domAPI=l(),A.insertStyleElement=g();a()(b.A,A),b.A&&b.A.locals&&b.A.locals},85072(t){"use strict";var e=[];function getIndexByIdentifier(t){for(var n=-1,s=0;s<e.length;s++)if(e[s].identifier===t){n=s;break}return n}function modulesToDom(t,n){for(var s={},a=[],o=0;o<t.length;o++){var l=t[o],c=n.base?l[0]+n.base:l[0],d=s[c]||0,h="".concat(c," ").concat(d);s[c]=d+1;var u=getIndexByIdentifier(h),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)e[u].references++,e[u].updater(p);else{var g=addElementStyle(p,n);n.byIndex=o,e.splice(o,0,{identifier:h,updater:g,references:1})}a.push(h)}return a}function addElementStyle(t,e){var n=e.domAPI(e);n.update(t);return function updater(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,n){var s=modulesToDom(t=t||[],n=n||{});return function update(t){t=t||[];for(var a=0;a<s.length;a++){var o=getIndexByIdentifier(s[a]);e[o].references--}for(var l=modulesToDom(t,n),c=0;c<s.length;c++){var d=getIndexByIdentifier(s[c]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}s=l}}},77659(t){"use strict";var e={};t.exports=function insertBySelector(t,n){var s=function getTarget(t){if("undefined"===typeof e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(s){n=null}e[t]=n}return e[t]}(t);if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(n)}},10540(t){"use strict";
2t.exports=function insertStyleElement(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},55056(t,e,n){"use strict";t.exports=function setAttributesWithoutAttributes(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},97825(t){"use strict";t.exports=function domAPI(t){if("undefined"===typeof document)return{update:function update(){},remove:function remove(){}};var e=t.insertStyleElement(t);return{update:function update(n){!function apply(t,e,n){var s="";n.supports&&(s+="@supports (".concat(n.supports,") {")),n.media&&(s+="@media ".concat(n.media," {"));var a="undefined"!==typeof n.layer;a&&(s+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),s+=n.css,a&&(s+="}"),n.media&&(s+="}"),n.supports&&(s+="}");var o=n.sourceMap;o&&"undefined"!==typeof btoa&&(s+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleTagTransform(s,t,e.options)}(e,t,n)},remove:function remove(){!function removeStyleElement(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},41113(t){"use strict";t.exports=function styleTagTransform(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},9771(t){"use strict";var warning=function(){};t.exports=warning},34164(t,e,n){"use strict";function r(t){var e,n,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t)if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(n=r(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}n.d(e,{A:()=>s});const s=function clsx(){for(var t,e,n=0,s="",a=arguments.length;n<a;n++)(t=arguments[n])&&(e=r(t))&&(s&&(s+=" "),s+=e);return s}},9166(t,e,n){"use strict";function makeCancellablePromise(t){var e=!1;return{promise:new Promise(function(n,s){t.then(function(t){return!e&&n(t)}).catch(function(t){return!e&&s(t)})}),cancel:function(){e=!0}}}n.d(e,{A:()=>makeCancellablePromise})},80065(t,e,n){"use strict";n.d(e,{Ay:()=>makeEventProps});var __spreadArray=function(t,e,n){if(n||2===arguments.length)for(var s,a=0,o=e.length;a<o;a++)!s&&a in e||(s||(s=Array.prototype.slice.call(e,0,a)),s[a]=e[a]);return t.concat(s||Array.prototype.slice.call(e))},s=__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],["onCopy","onCut","onPaste"],!0),["onCompositionEnd","onCompositionStart","onCompositionUpdate"],!0),["onFocus","onBlur"],!0),["onInput","onInvalid","onReset","onSubmit"],!0),["onLoad","onError"],!0),["onKeyDown","onKeyPress","onKeyUp"],!0),["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],!0),["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],!0),["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],!0),["onSelect"],!0),["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],!0),["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],!0),["onScroll"],!0),["onWheel"],!0),["onAnimationStart","onAnimationEnd","onAnimationIteration"],!0),["onTransitionEnd"],!0),["onChange"],!0),["onToggle"],!0);function makeEventProps(t,e){var n={};return s.forEach(function(s){var a=t[s];a&&(n[s]=e?function(t){return a(t,e(s))}:a)}),n}},47081(t,e,n){"use strict";n.d(e,{A:()=>y});var s=n(74848),a=n(96540),o=n(80065),l=n(9166),c=n(34164),d=n(11561),h=n(9771),u=Object.prototype.hasOwnProperty;function find(t,e,n){for(n of t.keys())if(dequal(n,e))return n}function dequal(t,e){var n,s,a;if(t===e)return!0;
2if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((s=t.length)===e.length)for(;s--&&dequal(t[s],e[s]););return-1===s}if(n===Set){if(t.size!==e.size)return!1;for(s of t){if((a=s)&&"object"===typeof a&&!(a=find(e,a)))return!1;if(!e.has(a))return!1}return!0}if(n===Map){if(t.size!==e.size)return!1;for(s of t){if((a=s[0])&&"object"===typeof a&&!(a=find(e,a)))return!1;if(!dequal(s[1],e.get(a)))return!1}return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((s=t.byteLength)===e.byteLength)for(;s--&&t.getInt8(s)===e.getInt8(s););return-1===s}if(ArrayBuffer.isView(t)){if((s=t.byteLength)===e.byteLength)for(;s--&&t[s]===e[s];);return-1===s}if(!n||"object"===typeof t){for(n in s=0,t){if(u.call(t,n)&&++s&&!u.call(e,n))return!1;if(!(n in e)||!dequal(t[n],e[n]))return!1}return Object.keys(e).length===s}}return t!==t&&e!==e}var p=n(40956),g=n(1401),m=n(98922);class LinkService{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(t){this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setExternalLinkRel(t){this.externalLinkRel=t}setExternalLinkTarget(t){this.externalLinkTarget=t}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return(0,d.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(t){(0,d.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise(e=>{(0,d.A)(this.pdfDocument,"PDF document not loaded."),(0,d.A)(t,"Destination is not specified."),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)}).then(t=>{(0,d.A)(Array.isArray(t),`"${t}" is not a valid destination array.`);const e=t[0];new Promise(t=>{(0,d.A)(this.pdfDocument,"PDF document not loaded."),e instanceof Object?this.pdfDocument.getPageIndex(e).then(e=>{t(e)}).catch(()=>{(0,d.A)(!1,`"${e}" is not a valid page reference.`)}):"number"===typeof e?t(e):(0,d.A)(!1,`"${e}" is not a valid destination reference.`)}).then(e=>{const n=e+1;(0,d.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,d.A)(n>=1&&n<=this.pagesCount,`"${n}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:n})})})}navigateTo(t){this.goToDestination(t)}goToPage(t){const e=t-1;(0,d.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,d.A)(t>=1&&t<=this.pagesCount,`"${t}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}addLinkAttributes(t,e,n){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=n?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const f={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var b=n(71446),A=n(27829),__awaiter=function(t,e,n,s){return new(n||(n=Promise))(function(a,o){function fulfilled(t){try{step(s.next(t))}catch(e){o(e)}}function rejected(t){try{step(s.throw(t))}catch(e){o(e)}}function step(t){t.done?a(t.value):function adopt(t){return t instanceof n?t:new n(function(e){e(t)})}(t.value).then(fulfilled,rejected)}step((s=s.apply(t,e||[])).next())})},__rest=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(s=Object.getOwnPropertySymbols(t);a<s.length;a++)e.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(n[s[a]]=t[s[a]])}return n};const{PDFDataRangeTransport:v}=p.A,defaultOnPassword=(t,e)=>{switch(e){case f.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case f.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function isParameterObject(t){return"object"===typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const y=(0,a.forwardRef)(function Document(t,e){var{children:n,className:u,error:f="Failed to load PDF file.",externalLinkRel:y,externalLinkTarget:_,file:S,inputRef:x,imageResourcesPath:E,loading:w="Loading PDF\u2026",noData:C="No PDF file specified.",onItemClick:T,onLoadError:P,onLoadProgress:k,onLoadSuccess:M,onPassword:R=defaultOnPassword,onSourceError:F,onSourceSuccess:D,options:I,renderMode:L,rotate:O}=t,N=__rest(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[B,j]=(0,A.A)(),{value:U,error:W}=B,[z,H]=(0,A.A)(),{value:G,error:V}=z,q=(0,a.useRef)(new LinkService),$=(0,a.useRef)([]),X=(0,a.useRef)(void 0),K=(0,a.useRef)(void 0);S&&S!==X.current&&isParameterObject(S)&&(h(!dequal(S,X.current),'File prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.'),X.current=S),I&&I!==K.current&&(h(!dequal(I,K.current),'Options prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.'),K.current=I);const Y=(0,a.useRef)({scrollPageIntoView:t=>{const{dest:e,pageNumber:n,pageIndex:s=n-1}=t;if(T)return void T({dest:e,pageIndex:s,pageNumber:n});const a=$.current[s];a?a.scrollIntoView():h(!1,`An internal link leading to page ${n} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document>
2 and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});(0,a.useImperativeHandle)(e,()=>({linkService:q,pages:$,viewer:Y}),[]),(0,a.useEffect)(function resetSource(){j({type:"RESET"})},[S,j]);const J=(0,a.useCallback)(()=>__awaiter(this,void 0,void 0,function*(){if(!S)return null;if("string"===typeof S){if((0,b.zL)(S)){return{data:(0,b.jA)(S)}}return(0,b.qC)(),{url:S}}if(S instanceof v)return{range:S};if((0,b.mw)(S))return{data:S};if(b.Bd&&(0,b.qf)(S)){return{data:yield(0,b.h1)(S)}}if((0,d.A)("object"===typeof S,"Invalid parameter in file, need either Uint8Array, string or a parameter object"),(0,d.A)(isParameterObject(S),"Invalid parameter object: need either .data, .range or .url"),"url"in S&&"string"===typeof S.url){if((0,b.zL)(S.url)){const{url:t}=S,e=__rest(S,["url"]),n=(0,b.jA)(t);return Object.assign({data:n},e)}(0,b.qC)()}return S}),[S]);function registerPage(t,e){$.current[t]=e}function unregisterPage(t){delete $.current[t]}(0,a.useEffect)(()=>{const t=(0,l.A)(J());return t.promise.then(t=>{j({type:"RESOLVE",value:t})}).catch(t=>{j({type:"REJECT",error:t})}),()=>{(0,b.xL)(t)}},[J,j]),(0,a.useEffect)(()=>{"undefined"!==typeof U&&(!1!==U?function onSourceSuccess(){D&&D()}():function onSourceError(){W&&(h(!1,W.toString()),F&&F(W))}())},[U]),(0,a.useEffect)(function resetDocument(){H({type:"RESET"})},[H,U]),(0,a.useEffect)(function loadDocument(){if(!U)return;const t=Object.assign(Object.assign({},I),{isEvalSupported:!1}),e=Object.assign(Object.assign({},U),t),n=p.A.getDocument(e);k&&(n.onProgress=k),R&&(n.onPassword=R);const s=n;return s.promise.then(t=>{H({type:"RESOLVE",value:t})}).catch(t=>{s.destroyed||H({type:"REJECT",error:t})}),()=>{s.destroy()}},[I,H,U]),(0,a.useEffect)(()=>{"undefined"!==typeof G&&(!1!==G?function onLoadSuccess(){G&&(M&&M(G),$.current=new Array(G.numPages),q.current.setDocument(G))}():function onLoadError(){V&&(h(!1,V.toString()),P&&P(V))}())},[G]),(0,a.useEffect)(function setupLinkService(){q.current.setViewer(Y.current),q.current.setExternalLinkRel(y),q.current.setExternalLinkTarget(_)},[y,_]);const Q=(0,a.useMemo)(()=>({imageResourcesPath:E,linkService:q.current,onItemClick:T,pdf:G,registerPage:registerPage,renderMode:L,rotate:O,unregisterPage:unregisterPage}),[E,T,G,L,O]),Z=(0,a.useMemo)(()=>(0,o.Ay)(N,()=>G),[N,G]);return(0,s.jsx)("div",Object.assign({className:(0,c.A)("react-pdf__Document",u),ref:x,style:{"--scale-factor":"1"}},Z,{children:function renderContent(){return S?void 0===G||null===G?(0,s.jsx)(m.A,{type:"loading",children:"function"===typeof w?w():w}):!1===G?(0,s.jsx)(m.A,{type:"error",children:"function"===typeof f?f():f}):function renderChildren(){return(0,s.jsx)(g.A.Provider,{value:Q,children:n})}():(0,s.jsx)(m.A,{type:"no-data",children:"function"===typeof C?C():C})}()}))})},1401(t,e,n){"use strict";n.d(e,{A:()=>s});const s=(0,n(96540).createContext)(null)},98922(t,e,n){"use strict";n.d(e,{A:()=>Message});var s=n(74848);function Message({children:t,type:e}){return(0,s.jsx)("div",{className:`react-pdf__message react-pdf__message--${e}`,children:t})}},49083(t,e,n){"use strict";n.d(e,{A:()=>Page});var s=n(74848),a=n(96540),o=n(9166),l=n(80065),c=n(34164);function mergeRefs(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.filter(Boolean);return n.length<=1?n[0]||null:function mergedRefs(t){n.forEach(function(e){"function"===typeof e?e(t):e&&(e.current=t)})}}var d=n(11561),h=n(9771);const u=(0,a.createContext)(null);var p=n(98922),g=n(40956);const m={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},f=/^H(\d+)$/;function isStructTreeNode(t){return"children"in t}function isStructTreeNodeWithOnlyContentChild(t){return!!isStructTreeNode(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function getRoleAttributes(t){const e={};if(isStructTreeNode(t)){const{role:n}=t,s=n.match(f);if(s)e.role="heading",e["aria-level"]=Number(s[1]);else if(function isPdfRole(t){return t in m}(n)){const t=m[n];t&&(e.role=t)}}return e}function getBaseAttributes(t){const e={};if(isStructTreeNode(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),isStru
2ctTreeNodeWithOnlyContentChild(t)){const[n]=t.children;if(n){const t=getBaseAttributes(n);return Object.assign(Object.assign({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function getAttributes(t){return t?Object.assign(Object.assign({},getRoleAttributes(t)),getBaseAttributes(t)):null}function StructTreeItem({className:t,node:e}){const n=(0,a.useMemo)(()=>getAttributes(e),[e]),o=(0,a.useMemo)(()=>isStructTreeNode(e)?isStructTreeNodeWithOnlyContentChild(e)?null:e.children.map((t,e)=>(0,s.jsx)(StructTreeItem,{node:t},e)):null,[e]);return(0,s.jsx)("span",Object.assign({className:t},n,{children:o}))}function usePageContext(){return(0,a.useContext)(u)}var b=n(27829),A=n(71446);function StructTree(){const t=usePageContext();(0,d.A)(t,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:n}=t,[l,c]=(0,b.A)(),{value:u,error:p}=l,{customTextRenderer:g,page:m}=t;return(0,a.useEffect)(function resetAnnotations(){c({type:"RESET"})},[c,m]),(0,a.useEffect)(function loadStructTree(){if(g)return;if(!m)return;const t=(0,o.A)(m.getStructTree()),e=t;return t.promise.then(t=>{c({type:"RESOLVE",value:t})}).catch(t=>{c({type:"REJECT",error:t})}),()=>(0,A.xL)(e)},[g,m,c]),(0,a.useEffect)(()=>{void 0!==u&&(!1!==u?function onLoadSuccess(){u&&n&&n(u)}():function onLoadError(){p&&(h(!1,p.toString()),e&&e(p))}())},[u]),u?(0,s.jsx)(StructTreeItem,{className:"react-pdf__Page__structTree structTree",node:u}):null}const v=g.A.AnnotationMode;function PageCanvas(t){const e=usePageContext();(0,d.A)(e,"Unable to find Page context.");const n=Object.assign(Object.assign({},e),t),{_className:o,canvasBackground:l,devicePixelRatio:c=(0,A.mZ)(),onRenderError:u,onRenderSuccess:p,page:g,renderForms:m,renderTextLayer:f,rotate:b,scale:y}=n,{canvasRef:_}=t;(0,d.A)(g,"Attempted to render page canvas, but no page was specified.");const S=(0,a.useRef)(null);function onRenderError(t){(0,A.UT)(t)||(h(!1,t.toString()),u&&u(t))}const x=(0,a.useMemo)(()=>g.getViewport({scale:y*c,rotation:b}),[c,g,b,y]),E=(0,a.useMemo)(()=>g.getViewport({scale:y,rotation:b}),[g,b,y]);(0,a.useEffect)(function drawPageOnCanvas(){if(!g)return;g.cleanup();const{current:t}=S;if(!t)return;t.width=x.width,t.height=x.height,t.style.width=`${Math.floor(E.width)}px`,t.style.height=`${Math.floor(E.height)}px`,t.style.visibility="hidden";const e={annotationMode:m?v.ENABLE_FORMS:v.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:x};l&&(e.background=l);const n=g.render(e),s=n;return n.promise.then(()=>{t.style.visibility="",function onRenderSuccess(){g&&p&&p((0,A.vS)(g,y))}()}).catch(onRenderError),()=>(0,A.xL)(s)},[l,S,c,g,m,x,E]);const w=(0,a.useCallback)(()=>{const{current:t}=S;t&&(t.width=0,t.height=0)},[S]);return(0,a.useEffect)(()=>w,[w]),(0,s.jsx)("canvas",{className:`${o}__canvas`,dir:"ltr",ref:mergeRefs(_,S),style:{display:"block",userSelect:"none"},children:f?(0,s.jsx)(StructTree,{}):null})}function PageSVG(){const t=usePageContext();(0,d.A)(t,"Unable to find Page context.");const{_className:e,onRenderSuccess:n,onRenderError:l,page:c,rotate:u,scale:p}=t;(0,d.A)(c,"Attempted to render page SVG, but no page was specified.");const[m,f]=(0,b.A)(),{value:v,error:y}=m;const _=(0,a.useMemo)(()=>c.getViewport({scale:p,rotation:u}),[c,u,p]);(0,a.useEffect)(function resetSVG(){f({type:"RESET"})}
2,[c,f,_]),(0,a.useEffect)(function renderSVG(){if(!c)return;const t=(0,o.A)(c.getOperatorList());return t.promise.then(t=>{new g.A.SVGGraphics(c.commonObjs,c.objs).getSVG(t,_).then(t=>{if(!(t instanceof SVGElement))throw new Error("getSVG returned unexpected result.");f({type:"RESOLVE",value:t})}).catch(t=>{f({type:"REJECT",error:t})})}).catch(t=>{f({type:"REJECT",error:t})}),()=>(0,A.xL)(t)},[c,f,_]),(0,a.useEffect)(()=>{void 0!==v&&(!1!==v?function onRenderSuccess(){c&&n&&n((0,A.vS)(c,p))}():function onRenderError(){y&&((0,A.UT)(y)||(h(!1,y.toString()),l&&l(y)))}())},[v]);const{width:S,height:x}=_;return(0,s.jsx)("div",{className:`${e}__svg`,ref:t=>function drawPageOnContainer(t){if(!t||!v)return;t.firstElementChild||t.appendChild(v);const{width:e,height:n}=_;v.setAttribute("width",`${e}`),v.setAttribute("height",`${n}`)}(t),style:{display:"block",backgroundColor:"white",overflow:"hidden",width:S,height:x,userSelect:"none"}})}function TextLayer(){const t=usePageContext();(0,d.A)(t,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:n,onGetTextSuccess:l,onRenderTextLayerError:u,onRenderTextLayerSuccess:p,page:m,pageIndex:f,pageNumber:v,rotate:y,scale:_}=t;(0,d.A)(m,"Attempted to load page text content, but no page was specified.");const[S,x]=(0,b.A)(),{value:E,error:w}=S,C=(0,a.useRef)(null),T=(0,a.useRef)(void 0);h(1===parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10),"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer"),(0,a.useEffect)(function resetTextContent(){x({type:"RESET"})},[m,x]),(0,a.useEffect)(function loadTextContent(){if(!m)return;const t=(0,o.A)(m.getTextContent()),e=t;return t.promise.then(t=>{x({type:"RESOLVE",value:t})}).catch(t=>{x({type:"REJECT",error:t})}),()=>(0,A.xL)(e)},[m,x]),(0,a.useEffect)(()=>{void 0!==E&&(!1!==E?function onLoadSuccess(){E&&l&&l(E)}():function onLoadError(){w&&(h(!1,w.toString()),n&&n(w))}())},[E]);const P=(0,a.useCallback)(()=>{p&&p()},[p]),k=(0,a.useCallback)(t=>{h(!1,t.toString()),u&&u(t)},[u]);const M=(0,a.useMemo)(()=>m.getViewport({scale:_,rotation:y}),[m,y,_]);return(0,a.useLayoutEffect)(function renderTextLayer(){if(!m||!E)return;const{current:t}=C;if(!t)return;t.innerHTML="";const n=m.streamTextContent({includeMarkedContent:!0}),s={container:t,textContentSource:n,viewport:M},a=g.A.renderTextLayer(s),o=a;return a.promise.then(()=>{const n=document.createElement("div");n.className="endOfContent",t.append(n),T.current=n;const s=t.querySelectorAll('[role="presentation"]');if(e){let t=0;E.items.forEach((n,a)=>
2{if(!function isTextItem(t){return"str"in t}(n))return;const o=s[t];if(!o)return;const l=e(Object.assign({pageIndex:f,pageNumber:v,itemIndex:a},n));o.innerHTML=l,t+=n.str&&n.hasEOL?2:1})}P()}).catch(k),()=>(0,A.xL)(o)},[e,k,P,m,f,v,E,M]),(0,s.jsx)("div",{className:(0,c.A)("react-pdf__Page__textContent","textLayer"),onMouseUp:function onMouseUp(){const t=T.current;t&&t.classList.remove("active")},onMouseDown:function onMouseDown(){const t=T.current;t&&t.classList.add("active")},ref:C})}var y=n(1401);function useDocumentContext(){return(0,a.useContext)(y.A)}function AnnotationLayer(){const t=useDocumentContext(),e=usePageContext();(0,d.A)(e,"Unable to find Page context.");const n=Object.assign(Object.assign({},t),e),{imageResourcesPath:l,linkService:u,onGetAnnotationsError:p,onGetAnnotationsSuccess:m,onRenderAnnotationLayerError:f,onRenderAnnotationLayerSuccess:v,page:y,pdf:_,renderForms:S,rotate:x,scale:E=1}=n;(0,d.A)(_,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),(0,d.A)(y,"Attempted to load page annotations, but no page was specified."),(0,d.A)(u,"Attempted to load page annotations, but no linkService was specified.");const[w,C]=(0,b.A)(),{value:T,error:P}=w,k=(0,a.useRef)(null);h(1===parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10),"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations"),(0,a.useEffect)(function resetAnnotations(){C({type:"RESET"})},[C,y]),(0,a.useEffect)(function loadAnnotations(){if(!y)return;const t=(0,o.A)(y.getAnnotations()),e=t;return t.promise.then(t=>{C({type:"RESOLVE",value:t})}).catch(t=>{C({type:"REJECT",error:t})}),()=>{(0,A.xL)(e)}},[C,y,S]),(0,a.useEffect)(()=>{void 0!==T&&(!1!==T?function onLoadSuccess(){T&&m&&m(T)}():function onLoadError(){P&&(h(!1,P.toString()),p&&p(P))}())},[T]);const M=(0,a.useMemo)(()=>y.getViewport({scale:E,rotation:x}),[y,x,E]);return(0,a.useEffect)(function renderAnnotationLayer(){if(!_||!y||!u||!T)return;const{current:t}=k;if(!t)return;const e=M.clone({dontFlip:!0}),n={accessibilityManager:null,annotationCanvasMap:null,div:t,l10n:null,page:y,viewport:e},s={annotations:T,annotationStorage:_.annotationStorage,div:t,downloadManager:null,imageResourcesPath:l,linkService:u,page:y,renderForms:S,viewport:e};t.innerHTML="";try{new g.A.AnnotationLayer(n).render(s),function onRenderSuccess(){v&&v()}()}catch(a){!function onRenderError(t){h(!1,`${t}`),f&&f(t)}(a)}return()=>{}},[T,l,u,y,S,M]),(0,s.jsx)("div",{className:(0,c.A)("react-pdf__Page__annotations","annotationLayer"),ref:k})}var __rest=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(s=Object.getOwnPropertySymbols(t);a<s.length;a++)e.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(n[s[a]]=t[s[a]])}return n};const _=1;function Page(t){const e=useDocumentContext(),n=Object.assign(Object.assign({},e),t),{_className:g="react-pdf__Page",_enableRegisterUnregisterPage:m=!0,canvasBackground:f,canvasRef:v,children:y,className:S,customRenderer:x,customTextRenderer:E,devicePixelRatio:w,error:C="Failed to load the page.",height:T,inputRef:P,loading:k="Loading page\u2026",noData:M="No page specified.",onGetAnnotationsError:R,onGetAnnotationsSuccess:F,onGetStructTreeError:D,onGetStructTreeSuccess:I,onGetTextError:L,onGetTextSuccess:O,onLoadError:N,onLoadSuccess:B,onRenderAnnotationLayerError:j,onRenderAnnotationLayerSuccess:U,onRenderError:W,onRenderSuccess:z,onRenderTextLayerError:H,onRenderTextLayerSuccess:G,pageIndex:V,pageNumber:q,pdf:$,registerPage:X,renderAnnotationLayer:K=!0,renderForms:Y=!1,renderMode:J="canvas",renderTextLayer:Q=!0,rotate:Z,scale:tt=_,unregisterPage:et,width:nt}=n,it=__rest(n,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[st,rt]=(0,b.A)(),{value:at,error:ot}=st,lt=(0,a.useRef)(null);(0,d.A)($,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const ct=(0,A.ci)(q)?q-1:null!==V&&void 0!==V?V:null,dt=null!==q&&void 0!==q?q:(0,A.ci)(V)?V+1:null,ht=null!==Z&&void 0!==Z?Z:at?at.rotate:null,ut=(0,a.useMemo)(()=>
2{if(!at)return null;let t=1;const e=null!==tt&&void 0!==tt?tt:_;if(nt||T){const e=at.getViewport({scale:1,rotation:ht});nt?t=nt/e.width:T&&(t=T/e.height)}return e*t},[T,at,ht,tt,nt]);(0,a.useEffect)(function hook(){return()=>{(0,A.ci)(ct)&&m&&et&&et(ct)}},[m,$,ct,et]),(0,a.useEffect)(function resetPage(){rt({type:"RESET"})},[rt,$,ct]),(0,a.useEffect)(function loadPage(){if(!$||!dt)return;const t=(0,o.A)($.getPage(dt)),e=t;return t.promise.then(t=>{rt({type:"RESOLVE",value:t})}).catch(t=>{rt({type:"REJECT",error:t})}),()=>(0,A.xL)(e)},[rt,$,ct,dt,X]),(0,a.useEffect)(()=>{void 0!==at&&(!1!==at?function onLoadSuccess(){if(B){if(!at||!ut)return;B((0,A.vS)(at,ut))}if(m&&X){if(!(0,A.ci)(ct)||!lt.current)return;X(ct,lt.current)}}():function onLoadError(){ot&&(h(!1,ot.toString()),N&&N(ot))}())},[at,ut]);const pt=(0,a.useMemo)(()=>at&&(0,A.ci)(ct)&&dt&&(0,A.ci)(ht)&&(0,A.ci)(ut)?{_className:g,canvasBackground:f,customTextRenderer:E,devicePixelRatio:w,onGetAnnotationsError:R,onGetAnnotationsSuccess:F,onGetStructTreeError:D,onGetStructTreeSuccess:I,onGetTextError:L,onGetTextSuccess:O,onRenderAnnotationLayerError:j,onRenderAnnotationLayerSuccess:U,onRenderError:W,onRenderSuccess:z,onRenderTextLayerError:H,onRenderTextLayerSuccess:G,page:at,pageIndex:ct,pageNumber:dt,renderForms:Y,renderTextLayer:Q,rotate:ht,scale:ut}:null,[g,f,E,w,R,F,D,I,L,O,j,U,W,z,H,G,at,ct,dt,Y,Q,ht,ut]),gt=(0,a.useMemo)(()=>(0,l.Ay)(it,()=>at?ut?(0,A.vS)(at,ut):void 0:at),[it,at,ut]),mt=`${ct}@${ut}/${ht}`,ft=`${ct}/${ht}`;function renderMainLayer(){switch(J){case"custom":return(0,d.A)(x,'renderMode was set to "custom", but no customRenderer was passed.'),(0,s.jsx)(x,{},`${mt}_custom`);case"none":return null;case"svg":return(0,s.jsx)(PageSVG,{},`${ft}_svg`);default:return(0,s.jsx)(PageCanvas,{canvasRef:v},`${mt}_canvas`)}}return(0,s.jsx)("div",Object.assign({className:(0,c.A)(g,S),"data-page-number":dt,ref:mergeRefs(P,lt),style:{"--scale-factor":`${ut}`,backgroundColor:f||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},gt,{children:function renderContent(){return dt?null===$||void 0===at||null===at?(0,s.jsx)(p.A,{type:"loading",children:"function"===typeof k?k():k}):!1===$||!1===at?(0,s.jsx)(p.A,{type:"error",children:"function"===typeof C?C():C}):function renderChildren(){return(0,s.jsxs)(u.Provider,{value:pt,children:[renderMainLayer(),Q?(0,s.jsx)(TextLayer,{},`${mt}_text`):null,K?(0,s.jsx)(AnnotationLayer,{},`${mt}_annotations`):null,y]})}():(0,s.jsx)(p.A,{type:"no-data",children:"function"===typeof M?M():M})}()}))}},40956(t,e,n){"use strict";n.d(e,{A:()=>a});var s=n(80748);const a=s},27829(t,e,n){"use strict";n.d(e,{A:()=>useResolver});var s=n(96540);function reducer(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function useResolver(){return(0,s.useReducer)(reducer,{value:void 0,error:void 0})}},71446(t,e,n){"use strict";n.d(e,{Bd:()=>o,UT:()=>isCancelException,ci:()=>isProvided,h1:()=>loadFromFile,jA:()=>dataURItoByteString,mZ:()=>getDevicePixelRatio,mw:()=>isArrayBuffer,qC:()=>displayCORSWarning,qf:()=>isBlob,vS:()=>makePageCallback,xL:()=>cancelRunningTask,zL:()=>isDataURI});var s=n(11561),a=n(9771);const o="undefined"!==typeof document,l=o&&"file:"===window.location.protocol;function isProvided(t){return function isDefined(t){return"undefined"!==typeof t}(t)&&null!==t}function isArrayBuffer(t){return t instanceof ArrayBuffer}function isBlob(t){return(0,s.A)(o,"isBlob can only be used in a browser environment"),t instanceof Blob}function isDataURI(t){return function isString(t){return"string"===typeof t}(t)&&/^data:/.test(t)}function dataURItoByteString(t){(0,s.A)(isDataURI(t),"Invalid data URI.");const[e="",n=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(n):unescape(n)}function getDevicePixelRatio(){return o&&window.devicePixelRatio||1}const c="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function displayCORSWarning(){a(!l,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${c}`)}function cancelRunningTask(t){t&&t.cancel&&t.cancel()}function makePageCallback(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}
2function isCancelException(t){return"RenderingCancelledException"===t.name}function loadFromFile(t){return new Promise((e,n)=>{const s=new FileReader;s.onload=()=>{if(!s.result)return n(new Error("Error while reading a file."));e(s.result)},s.onerror=t=>{if(!t.target)return n(new Error("Error while reading a file."));const{error:e}=t.target;if(!e)return n(new Error("Error while reading a file."));switch(e.code){case e.NOT_FOUND_ERR:return n(new Error("Error while reading a file: File not found."));case e.SECURITY_ERR:return n(new Error("Error while reading a file: Security error."));case e.ABORT_ERR:return n(new Error("Error while reading a file: Aborted."));default:return n(new Error("Error while reading a file."))}},s.readAsArrayBuffer(t)})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.