react-pdf-editor-1 1.2.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/.babelrc +3 -0
  2. package/LICENSE +2 -0
  3. package/README.md +315 -0
  4. package/dist/index.js +526 -0
  5. package/package.json +33 -0
  6. package/public/01fd34b01abf8d0a1fdb3c10f95146cd.svg +7 -0
  7. package/public/025954f8cad47e40240e15487d1e396c.svg +17 -0
  8. package/public/105d10237b3dddb56304b2af06fab51c.svg +8 -0
  9. package/public/10879587954149cc5fd694c7785e9d3a.svg +8 -0
  10. package/public/15cba32d3c729060a92912d969d1cc2c.svg +17 -0
  11. package/public/1964539986cd6aea3baee0f32a61923e.svg +4 -0
  12. package/public/1c0b882b730b22fbd7d42b68bd0a970e.svg +2 -0
  13. package/public/1d66d40875fa58261ff4b850e8cba7cc.svg +5 -0
  14. package/public/22b31630cb8b4b2ad58da61bb133ab1f.svg +8 -0
  15. package/public/2d62d3d287fbc3c497dddab32168f325.svg +4 -0
  16. package/public/31f31a1074e7f19fde072c1158a8e6a0.svg +14 -0
  17. package/public/3659a716673b2dd214d961c5feb3caa6.svg +4 -0
  18. package/public/3bc689e0aff9db355266a7b3be92e9d0.svg +4 -0
  19. package/public/3eb1d80899f968c9398d1c08a5350b2d.svg +4 -0
  20. package/public/4c63cae958b5685dfd85cda1b06787fe.svg +17 -0
  21. package/public/50842dfca45fc95070e4fdd2259db45c.svg +4 -0
  22. package/public/536890911d2db783d87b77a39b74f396.svg +4 -0
  23. package/public/71edf29951e1e0d3b50d9562bc7a5049.svg +14 -0
  24. package/public/79ee5b45e590be841daeba9d60e7db6e.svg +5 -0
  25. package/public/839d642763fa2703bfa92fcdbaa0397c.svg +17 -0
  26. package/public/8639ab06d026e5d60849b007b6f432b6.svg +14 -0
  27. package/public/9209f692646c3a0d4fb372037a3d7237.svg +4 -0
  28. package/public/96ba4601cfdb560093692ac2d34260dd.svg +8 -0
  29. package/public/9c36754c195ca83d24a39e75ef3821c0.svg +4 -0
  30. package/public/9f41f6f39d1736d2782a934fea979c01.svg +4 -0
  31. package/public/a24af8321bcb23961c196b0b4fce89c7.svg +17 -0
  32. package/public/a3f2a45a2d94e515bc17ea9740631aa0.svg +6 -0
  33. package/public/a51521eadbd56edc63eb19bc5a41a598.svg +5 -0
  34. package/public/a7a14359ef6035eb03282f98500c02f3.svg +17 -0
  35. package/public/b4d7375b688647fc2e477f9d911f1e2e.svg +17 -0
  36. package/public/b947e1da1eac39e0ff7f9b7c1f944f52.svg +17 -0
  37. package/public/bundle.js +2 -0
  38. package/public/bundle.js.LICENSE.txt +32 -0
  39. package/public/c0ab9ce68d42392fb8fc13f7089c9518.svg +5 -0
  40. package/public/c69a80a1cc748b27d5ee83d3951bc956.svg +4 -0
  41. package/public/c6ac6e95ae6fe2f0391da8fa2e9c8554.svg +14 -0
  42. package/public/d538166f1033a89b5d2735aecea91c62.svg +5 -0
  43. package/public/d84737c082efeea55189a8196ac9236c.svg +17 -0
  44. package/public/e19e4765f223f61db42d28f92ddbcd4e.svg +5 -0
  45. package/public/e80893668bffe9e8e3c09306c073cf30.svg +2 -0
  46. package/public/eb7981a1b3a89b6cfce8722d72214fde.svg +17 -0
  47. package/public/eccb83ba375a1929a3f18ba30694c231.svg +5 -0
  48. package/public/ee12777ac448b2018f768c80fb248e9c.svg +4 -0
  49. package/public/f646afcaa121a7b8d388826e30f410c1.svg +4 -0
  50. package/public/ff2dfa442d903d9d5e30.gif +0 -0
  51. package/public/index.html +1 -0
  52. package/public/pdf-ui/033ea05cff39966fc00030593f62d81f.svg +5 -0
  53. package/public/pdf-ui/0353d3a6acc37ec6b16e6bf353926342.svg +15 -0
  54. package/public/pdf-ui/045352e9aa7d98994484ffb8ec3dbe38.svg +4 -0
  55. package/public/pdf-ui/067c6de2adec31f57b18.gif +1 -0
  56. package/public/pdf-ui/088c54c203716cb1be7190bb6075efb6.png +0 -0
  57. package/public/pdf-ui/0d18d81ca415c6007655b836f84e4219.svg +8 -0
  58. package/public/pdf-ui/15cba32d3c729060a92912d969d1cc2c.svg +17 -0
  59. package/public/pdf-ui/1c0b882b730b22fbd7d42b68bd0a970e.svg +2 -0
  60. package/public/pdf-ui/1c5917d73900d5039cd8.gif +1 -0
  61. package/public/pdf-ui/1d66d40875fa58261ff4b850e8cba7cc.svg +5 -0
  62. package/public/pdf-ui/1ec9099f99fb29fd2f6862878724a0a3.svg +5 -0
  63. package/public/pdf-ui/22b31630cb8b4b2ad58da61bb133ab1f.svg +8 -0
  64. package/public/pdf-ui/2a087ab7d6db0961c9a3.gif +1 -0
  65. package/public/pdf-ui/2c98033a3b632f65d3ec.wasm +0 -0
  66. package/public/pdf-ui/2d857cb345dc7c8dbece3d62a20f09bd.svg +5 -0
  67. package/public/pdf-ui/325f20a2786a21caee0f924078e07d71.svg +2 -0
  68. package/public/pdf-ui/35d6b608bc295d96f7fd45b93b27706c.svg +8 -0
  69. package/public/pdf-ui/3659a716673b2dd214d961c5feb3caa6.svg +4 -0
  70. package/public/pdf-ui/3bc689e0aff9db355266a7b3be92e9d0.svg +4 -0
  71. package/public/pdf-ui/3e8dbb8345f70b7b4c36bb1ad05dfe7e.svg +4 -0
  72. package/public/pdf-ui/3eb1d80899f968c9398d1c08a5350b2d.svg +4 -0
  73. package/public/pdf-ui/4ab3dd8677ef3699fc53c7328a3ae1c6.svg +2 -0
  74. package/public/pdf-ui/4c63cae958b5685dfd85cda1b06787fe.svg +17 -0
  75. package/public/pdf-ui/4dc3c7d029346b6ca3318f0e60ccfe87.svg +4 -0
  76. package/public/pdf-ui/4e9b9c2bcbd6c3737c340cd5bebefd8c.svg +6 -0
  77. package/public/pdf-ui/4ebd2633a2d5debf8a4e568b7985be7e.svg +4 -0
  78. package/public/pdf-ui/50842dfca45fc95070e4fdd2259db45c.svg +4 -0
  79. package/public/pdf-ui/5087ceef6868b5ab32a1.svg +1 -0
  80. package/public/pdf-ui/536890911d2db783d87b77a39b74f396.svg +4 -0
  81. package/public/pdf-ui/53f17281bc4dffa3a650442bfb07d321.svg +4 -0
  82. package/public/pdf-ui/586876b8baad663cfcb1.svg +1 -0
  83. package/public/pdf-ui/59fe962b3e6bd8bfdda7a104ebfba9e9.svg +3 -0
  84. package/public/pdf-ui/5a84e180ec596169981c831f0288374a.svg +19 -0
  85. package/public/pdf-ui/5e9941f27dabbef172bdaf2deccb70f6.svg +11 -0
  86. package/public/pdf-ui/5ea0869845becef03a065090fee2a9a5.svg +4 -0
  87. package/public/pdf-ui/6529e96a9906058150e3de021602f1d9.svg +4 -0
  88. package/public/pdf-ui/65c76ef6e36e34a13364a8127e57b18e.svg +4 -0
  89. package/public/pdf-ui/79edeed2414d6ac5ec44.svg +1 -0
  90. package/public/pdf-ui/79ee5b45e590be841daeba9d60e7db6e.svg +5 -0
  91. package/public/pdf-ui/80a30e134dde30c967de.svg +1 -0
  92. package/public/pdf-ui/854c025f76bbfdf1a6c3db5a8db6abb4.svg +11 -0
  93. package/public/pdf-ui/8be7b158d340ed4fd589.svg +1 -0
  94. package/public/pdf-ui/8d64a1271d5126b8cb78.svg +1 -0
  95. package/public/pdf-ui/9c36754c195ca83d24a39e75ef3821c0.svg +4 -0
  96. package/public/pdf-ui/9fb032a1799ca2a1c7518895c7533af2.svg +3 -0
  97. package/public/pdf-ui/a64081b14b23b34ed10bb1183be53747.png +0 -0
  98. package/public/pdf-ui/ac0f6afbea0be2b67f8b2dc2f40fdf4b.svg +4 -0
  99. package/public/pdf-ui/assets/blue-bg-5-2.png +0 -0
  100. package/public/pdf-ui/assets/blue-bg-500-150.png +0 -0
  101. package/public/pdf-ui/assets/color-wheel.png +0 -0
  102. package/public/pdf-ui/assets/signature-bg.png +0 -0
  103. package/public/pdf-ui/assets/signature-icon.png +0 -0
  104. package/public/pdf-ui/assets/yellow-bg-5-4.png +0 -0
  105. package/public/pdf-ui/assets/yellow-bg-500-150.png +0 -0
  106. package/public/pdf-ui/b1db19c0847c6c911193d6b9b48ae9df.svg +2 -0
  107. package/public/pdf-ui/b722fb1fa619a347bb3fe0e24b0c40cc.png +0 -0
  108. package/public/pdf-ui/bb72d81b39be40898db21e81272dbf39.svg +3 -0
  109. package/public/pdf-ui/bundle.js +3 -0
  110. package/public/pdf-ui/bundle.js.LICENSE.txt +74 -0
  111. package/public/pdf-ui/bundle.js.map +1 -0
  112. package/public/pdf-ui/c69a80a1cc748b27d5ee83d3951bc956.svg +4 -0
  113. package/public/pdf-ui/c6a3cd10a29122c87d0aff12229e1539.svg +4 -0
  114. package/public/pdf-ui/c6ac6e95ae6fe2f0391da8fa2e9c8554.svg +14 -0
  115. package/public/pdf-ui/c85c0ff9534eda6ec97b1f5c7c80d994.svg +4 -0
  116. package/public/pdf-ui/ccb5b2b4f2a6efbac0194acb7dd27875.svg +4 -0
  117. package/public/pdf-ui/d4a0946ca523e1a07119c30351cdc625.svg +8 -0
  118. package/public/pdf-ui/de62f36b83bb7ae79e7f4499387ee87e.svg +4 -0
  119. package/public/pdf-ui/e19e4765f223f61db42d28f92ddbcd4e.svg +5 -0
  120. package/public/pdf-ui/e80893668bffe9e8e3c09306c073cf30.svg +2 -0
  121. package/public/pdf-ui/f20333b6d7b1530454d1ea949f337c4d.svg +5 -0
  122. package/public/pdf-ui/f8f9feb56bfaf57527c21e854ad43533.svg +5 -0
  123. package/public/pdf-ui/ff2dfa442d903d9d5e30.gif +0 -0
  124. package/public/pdf-ui/ff2dfa442d903d9d5e303345b82e5415.gif +0 -0
  125. package/public/pdf-ui/index.html +1 -0
  126. package/public/pdf-ui/lib/pdf.worker.js +2 -0
  127. package/public/pdf-ui/lib/pdf.worker.js.LICENSE.txt +21 -0
  128. package/public/pdf-ui/lib/pdf_wasm_project.js +1 -0
  129. package/public/pdf-ui/lib/pdf_wasm_project_bg.wasm +0 -0
  130. package/public/pdf-ui/node_modules/alien35-pf/web/images/loading-icon.gif +0 -0
  131. package/public/pdf-ui/node_modules/pdfjs-dist/web/images/loading-icon.gif +0 -0
  132. package/src/index.d.ts +33 -0
  133. package/src/index.js +374 -0
@@ -0,0 +1,2 @@
1
+ /*! For license information please see bundle.js.LICENSE.txt */
2
+ (()=>{var __webpack_modules__={282:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var i=n(81),r=n.n(i),s=n(645),a=n.n(s),o=n(667),l=n.n(o),c=new URL(n(396),n.b),d=a()(r()),h=l()(c);d.push([e.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 --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.textLayer {\n position: absolute;\n text-align: initial;\n inset: 0;\n overflow: hidden;\n opacity: 0.25;\n line-height: 1;\n -webkit-text-size-adjust: none;\n -moz-text-size-adjust: none;\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 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.textLayer ::-moz-selection {\n background: blue;\n background: AccentColor;\n}\n\n.textLayer ::selection {\n background: blue;\n background: AccentColor;\n}\n\n/* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */\n.textLayer br::-moz-selection {\n background: transparent;\n}\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 -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n\n.textLayer .endOfContent.active {\n top: 0;\n}\n\n\n:root {\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 --hcm-highligh-filter: invert(100%);\n }\n .annotationLayer .textWidgetAnnotation :is(input, textarea):required,\n .annotationLayer .choiceWidgetAnnotation select:required,\n .annotationLayer\n .buttonWidgetAnnotation:is(.checkBox, .radioButton)\n input:required {\n outline: 1.5px solid selectedItem;\n }\n\n .annotationLayer .linkAnnotation:hover {\n -webkit-backdrop-filter: var(--hcm-highligh-filter);\n backdrop-filter: var(--hcm-highligh-filter);\n }\n\n .annotationLayer .linkAnnotation > a:hover {\n opacity: 0 !important;\n background: none !important;\n box-shadow: none;\n }\n\n .annotationLayer .popupAnnotation .popup {\n outline: calc(1.5px * var(--scale-factor)) solid CanvasText !important;\n background-color: ButtonFace !important;\n color: ButtonText !important;\n }\n\n .annotationLayer .highlightArea:hover::after {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n -webkit-backdrop-filter: var(--hcm-highligh-filter);\n backdrop-filter: var(--hcm-highligh-filter);\n content: "";\n pointer-events: none;\n }\n\n .annotationLayer .popupAnnotation.focused .popup {\n outline: calc(3px * var(--scale-factor)) solid Highlight !important;\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 pointer-events: none;\n}\n\n.annotationLayer section {\n position: absolute;\n text-align: initial;\n pointer-events: auto;\n box-sizing: border-box;\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\n :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton)\n > 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\n .buttonWidgetAnnotation:is(.checkBox, .radioButton)\n 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\n .buttonWidgetAnnotation:is(.checkBox, .radioButton)\n input[disabled] {\n background: none;\n border: 2px solid var(--input-disabled-border-color);\n cursor: not-allowed;\n}\n\n.annotationLayer .textWidgetAnnotation :is(input, textarea):hover,\n.annotationLayer .choiceWidgetAnnotation select:hover,\n.annotationLayer\n .buttonWidgetAnnotation:is(.checkBox, .radioButton)\n 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 -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\n.annotationLayer .fileAttachmentAnnotation .popupTriggerArea {\n height: 100%;\n width: 100%;\n}\n\n.annotationLayer .popupAnnotation {\n position: absolute;\n font-size: calc(9px * var(--scale-factor));\n pointer-events: none;\n width: -moz-max-content;\n width: max-content;\n max-width: 45%;\n height: auto;\n}\n\n.annotationLayer .popup {\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 outline: 1.5px solid rgb(255, 255, 74);\n padding: calc(6px * 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 .popupAnnotation.focused .popup {\n outline-width: 3px;\n}\n\n.annotationLayer .popup * {\n font-size: calc(9px * var(--scale-factor));\n}\n\n.annotationLayer .popup > .header {\n display: inline-block;\n}\n\n.annotationLayer .popup > .header h1 {\n display: inline;\n}\n\n.annotationLayer .popup > .header .popupDate {\n display: inline-block;\n margin-left: calc(5px * var(--scale-factor));\n width: -moz-fit-content;\n width: fit-content;\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 -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n pointer-events: none;\n}\n\n.annotationLayer .annotationTextContent span {\n width: 100%;\n display: inline-block;\n}\n\n\n:root {\n --xfa-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 --xfa-focus-outline: auto;\n}\n\n@media screen and (forced-colors: active) {\n :root {\n --xfa-focus-outline: 2px solid CanvasText;\n }\n .xfaLayer *:required {\n outline: 1.5px solid selectedItem;\n }\n}\n\n.xfaLayer {\n background-color: transparent;\n}\n\n.xfaLayer .highlight {\n margin: -1px;\n padding: 1px;\n background-color: rgba(239, 203, 237, 1);\n border-radius: 4px;\n}\n\n.xfaLayer .highlight.appended {\n position: initial;\n}\n\n.xfaLayer .highlight.begin {\n border-radius: 4px 0 0 4px;\n}\n\n.xfaLayer .highlight.end {\n border-radius: 0 4px 4px 0;\n}\n\n.xfaLayer .highlight.middle {\n border-radius: 0;\n}\n\n.xfaLayer .highlight.selected {\n background-color: rgba(203, 223, 203, 1);\n}\n\n.xfaPage {\n overflow: hidden;\n position: relative;\n}\n\n.xfaContentarea {\n position: absolute;\n}\n\n.xfaPrintOnly {\n display: none;\n}\n\n.xfaLayer {\n position: absolute;\n text-align: initial;\n top: 0;\n left: 0;\n transform-origin: 0 0;\n line-height: 1.2;\n}\n\n.xfaLayer * {\n color: inherit;\n font: inherit;\n font-style: inherit;\n font-weight: inherit;\n font-kerning: inherit;\n letter-spacing: -0.01px;\n text-align: inherit;\n text-decoration: inherit;\n box-sizing: border-box;\n background-color: transparent;\n padding: 0;\n margin: 0;\n pointer-events: auto;\n line-height: inherit;\n}\n\n.xfaLayer *:required {\n outline: 1.5px solid red;\n}\n\n.xfaLayer div,\n.xfaLayer svg,\n.xfaLayer svg * {\n pointer-events: none;\n}\n\n.xfaLayer a {\n color: blue;\n}\n\n.xfaRich li {\n margin-left: 3em;\n}\n\n.xfaFont {\n color: black;\n font-weight: normal;\n font-kerning: none;\n font-size: 10px;\n font-style: normal;\n letter-spacing: 0;\n text-decoration: none;\n vertical-align: 0;\n}\n\n.xfaCaption {\n overflow: hidden;\n flex: 0 0 auto;\n}\n\n.xfaCaptionForCheckButton {\n overflow: hidden;\n flex: 1 1 auto;\n}\n\n.xfaLabel {\n height: 100%;\n width: 100%;\n}\n\n.xfaLeft {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.xfaRight {\n display: flex;\n flex-direction: row-reverse;\n align-items: center;\n}\n\n:is(.xfaLeft, .xfaRight) > :is(.xfaCaption, .xfaCaptionForCheckButton) {\n max-height: 100%;\n}\n\n.xfaTop {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n}\n\n.xfaBottom {\n display: flex;\n flex-direction: column-reverse;\n align-items: flex-start;\n}\n\n:is(.xfaTop, .xfaBottom) > :is(.xfaCaption, .xfaCaptionForCheckButton) {\n width: 100%;\n}\n\n.xfaBorder {\n background-color: transparent;\n position: absolute;\n pointer-events: none;\n}\n\n.xfaWrapped {\n width: 100%;\n height: 100%;\n}\n\n:is(.xfaTextfield, .xfaSelect):focus {\n background-image: none;\n background-color: transparent;\n outline: var(--xfa-focus-outline);\n outline-offset: -1px;\n}\n\n:is(.xfaCheckbox, .xfaRadio):focus {\n outline: var(--xfa-focus-outline);\n}\n\n.xfaTextfield,\n.xfaSelect {\n height: 100%;\n width: 100%;\n flex: 1 1 auto;\n border: none;\n resize: none;\n background-image: var(--xfa-unfocused-field-background);\n}\n\n.xfaSelect {\n padding-inline: 2px;\n}\n\n:is(.xfaTop, .xfaBottom) > :is(.xfaTextfield, .xfaSelect) {\n flex: 0 1 auto;\n}\n\n.xfaButton {\n cursor: pointer;\n width: 100%;\n height: 100%;\n border: none;\n text-align: center;\n}\n\n.xfaLink {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n}\n\n.xfaCheckbox,\n.xfaRadio {\n width: 100%;\n height: 100%;\n flex: 0 0 auto;\n border: none;\n}\n\n.xfaRich {\n white-space: pre-wrap;\n width: 100%;\n height: 100%;\n}\n\n.xfaImage {\n -o-object-position: left top;\n object-position: left top;\n -o-object-fit: contain;\n object-fit: contain;\n width: 100%;\n height: 100%;\n}\n\n.xfaLrTb,\n.xfaRlTb,\n.xfaTb {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}\n\n.xfaLr {\n display: flex;\n flex-direction: row;\n align-items: stretch;\n}\n\n.xfaRl {\n display: flex;\n flex-direction: row-reverse;\n align-items: stretch;\n}\n\n.xfaTb > div {\n justify-content: left;\n}\n\n.xfaPosition {\n position: relative;\n}\n\n.xfaArea {\n position: relative;\n}\n\n.xfaValignMiddle {\n display: flex;\n align-items: center;\n}\n\n.xfaTable {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}\n\n.xfaTable .xfaRow {\n display: flex;\n flex-direction: row;\n align-items: stretch;\n}\n\n.xfaTable .xfaRlRow {\n display: flex;\n flex-direction: row-reverse;\n align-items: stretch;\n flex: 1;\n}\n\n.xfaTable .xfaRlRow > div {\n flex: 1;\n}\n\n:is(.xfaNonInteractive, .xfaDisabled, .xfaReadOnly) :is(input, textarea) {\n background: initial;\n}\n\n@media print {\n .xfaTextfield,\n .xfaSelect {\n background: transparent;\n }\n\n .xfaSelect {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n text-indent: 1px;\n text-overflow: "";\n }\n}\n\n\n:root {\n --focus-outline: solid 2px blue;\n --hover-outline: dashed 2px blue;\n --freetext-line-height: 1.35;\n --freetext-padding: 2px;\n --editorFreeText-editing-cursor: text;\n --editorInk-editing-cursor: pointer;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.1), (min-resolution: 1.1dppx) {\n :root {\n }\n}\n\n@media screen and (forced-colors: active) {\n :root {\n --focus-outline: solid 3px ButtonText;\n --hover-outline: dashed 3px ButtonText;\n }\n}\n\n[data-editor-rotation="90"] {\n transform: rotate(90deg);\n}\n[data-editor-rotation="180"] {\n transform: rotate(180deg);\n}\n[data-editor-rotation="270"] {\n transform: rotate(270deg);\n}\n\n.annotationEditorLayer {\n background: transparent;\n position: absolute;\n top: 0;\n left: 0;\n font-size: calc(100px * var(--scale-factor));\n transform-origin: 0 0;\n cursor: auto;\n z-index: 4;\n}\n\n.annotationEditorLayer.freeTextEditing {\n cursor: var(--editorFreeText-editing-cursor);\n}\n\n.annotationEditorLayer.inkEditing {\n cursor: var(--editorInk-editing-cursor);\n}\n\n.annotationEditorLayer :is(.freeTextEditor, .inkEditor)[draggable="true"] {\n cursor: move;\n}\n\n.annotationEditorLayer .selectedEditor {\n outline: var(--focus-outline);\n resize: none;\n}\n\n.annotationEditorLayer .freeTextEditor {\n position: absolute;\n background: transparent;\n border-radius: 3px;\n padding: calc(var(--freetext-padding) * var(--scale-factor));\n resize: none;\n width: auto;\n height: auto;\n z-index: 1;\n transform-origin: 0 0;\n touch-action: none;\n cursor: auto;\n}\n\n.annotationEditorLayer .freeTextEditor .internal {\n background: transparent;\n border: none;\n top: 0;\n left: 0;\n overflow: visible;\n white-space: nowrap;\n resize: none;\n font: 10px sans-serif;\n line-height: var(--freetext-line-height);\n}\n\n.annotationEditorLayer .freeTextEditor .overlay {\n position: absolute;\n display: none;\n background: transparent;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.annotationEditorLayer .freeTextEditor .overlay.enabled {\n display: block;\n}\n\n.annotationEditorLayer .freeTextEditor .internal:empty::before {\n content: attr(default-content);\n color: gray;\n}\n\n.annotationEditorLayer .freeTextEditor .internal:focus {\n outline: none;\n}\n\n.annotationEditorLayer .inkEditor.disabled {\n resize: none;\n}\n\n.annotationEditorLayer .inkEditor.disabled.selectedEditor {\n resize: horizontal;\n}\n\n.annotationEditorLayer\n :is(.freeTextEditor, .inkEditor):hover:not(.selectedEditor) {\n outline: var(--hover-outline);\n}\n\n.annotationEditorLayer .inkEditor {\n position: absolute;\n background: transparent;\n border-radius: 3px;\n overflow: auto;\n width: 100%;\n height: 100%;\n z-index: 1;\n transform-origin: 0 0;\n cursor: auto;\n}\n\n.annotationEditorLayer .inkEditor.editing {\n resize: none;\n cursor: inherit;\n}\n\n.annotationEditorLayer .inkEditor .inkEditorCanvas {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n touch-action: none;\n}\n\n:root {\n --viewer-container-height: 0;\n --pdfViewer-padding-bottom: 0;\n --page-margin: 1px auto -8px;\n --page-border: 9px solid transparent;\n --spreadHorizontalWrapped-margin-LR: -3.5px;\n --loading-icon-delay: 400ms;\n}\n\n@media screen and (forced-colors: active) {\n :root {\n --pdfViewer-padding-bottom: 9px;\n --page-margin: 8px auto -1px;\n --page-border: 1px solid CanvasText;\n --spreadHorizontalWrapped-margin-LR: 3.5px;\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#hiddenCopyElement {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n display: none;\n}\n\n.pdfViewer {\n /* Define this variable here and not in :root to avoid to reflow all the UI\n when scaling (see #15929). */\n --scale-factor: 1;\n\n padding-bottom: var(--pdfViewer-padding-bottom);\n}\n\n.pdfViewer .canvasWrapper {\n overflow: hidden;\n width: 100%;\n height: 100%;\n z-index: 1;\n}\n\n.pdfViewer .page {\n direction: ltr;\n width: 816px;\n height: 1056px;\n margin: var(--page-margin);\n position: relative;\n overflow: visible;\n border: var(--page-border);\n background-clip: content-box;\n background-color: rgba(255, 255, 255, 1);\n}\n\n.pdfViewer .dummyPage {\n position: relative;\n width: 0;\n height: var(--viewer-container-height);\n}\n\n.pdfViewer.removePageBorders .page {\n margin: 0 auto 10px;\n border: none;\n}\n\n.pdfViewer.singlePageView {\n display: inline-block;\n}\n\n.pdfViewer.singlePageView .page {\n margin: 0;\n border: none;\n}\n\n.pdfViewer:is(.scrollHorizontal, .scrollWrapped),\n.spread {\n margin-inline: 3.5px;\n text-align: center;\n}\n\n.pdfViewer.scrollHorizontal,\n.spread {\n white-space: nowrap;\n}\n\n.pdfViewer.removePageBorders,\n.pdfViewer:is(.scrollHorizontal, .scrollWrapped) .spread {\n margin-inline: 0;\n}\n\n.spread :is(.page, .dummyPage),\n.pdfViewer:is(.scrollHorizontal, .scrollWrapped) :is(.page, .spread) {\n display: inline-block;\n vertical-align: middle;\n}\n\n.spread .page,\n.pdfViewer:is(.scrollHorizontal, .scrollWrapped) .page {\n margin-inline: var(--spreadHorizontalWrapped-margin-LR);\n}\n\n.pdfViewer.removePageBorders .spread .page,\n.pdfViewer.removePageBorders:is(.scrollHorizontal, .scrollWrapped) .page {\n margin-inline: 5px;\n}\n\n.pdfViewer .page canvas {\n margin: 0;\n display: block;\n}\n\n.pdfViewer .page canvas .structTree {\n contain: strict;\n}\n\n.pdfViewer .page canvas[hidden] {\n display: none;\n}\n\n.pdfViewer .page canvas[zooming] {\n width: 100%;\n height: 100%;\n}\n\n.pdfViewer .page.loadingIcon::after {\n position: absolute;\n top: 0;\n left: 0;\n content: "";\n width: 100%;\n height: 100%;\n background: url(${h}) center no-repeat;\n display: none;\n /* Using a delay with background-image doesn't work,\n consequently we use the display. */\n transition-property: display;\n transition-delay: var(--loading-icon-delay);\n z-index: 5;\n contain: strict;\n}\n\n.pdfViewer .page.loading::after {\n display: block;\n}\n\n.pdfViewer .page:not(.loading)::after {\n transition-property: none;\n display: none;\n}\n\n.pdfPresentationMode .pdfViewer {\n padding-bottom: 0;\n}\n\n.pdfPresentationMode .spread {\n margin: 0;\n}\n\n.pdfPresentationMode .pdfViewer .page {\n margin: 0 auto;\n border: 2px solid transparent;\n}\n`,""]);const u=d},645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",i=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),i&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),i&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,i,r,s){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(i)for(var o=0;o<this.length;o++){var l=this[o][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);i&&a[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},667:e=>{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},81:e=>{"use strict";e.exports=function(e){return e[1]}},679:(e,t,n)=>{"use strict";var i=n(864),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};function l(e){return i.isMemo(e)?a:o[e.$$typeof]||r}o[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o[i.Memo]=a;var c=Object.defineProperty,d=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,n,i){if("string"!=typeof n){if(f){var r=p(n);r&&r!==f&&e(t,r,i)}var a=d(n);h&&(a=a.concat(h(n)));for(var o=l(t),g=l(n),m=0;m<a.length;++m){var _=a[m];if(!(s[_]||i&&i[_]||g&&g[_]||o&&o[_])){var b=u(n,_);try{c(t,_,b)}catch(e){}}}}return t}},299:(module,__unused_webpack_exports,__webpack_require__)=>{var factory;globalThis,factory=()=>(()=>{"use strict";var __webpack_modules__=[,(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.TextRenderingMode=t.RenderingIntentFlag=t.PromiseCapability=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.MAX_IMAGE_SIZE_TO_CACHE=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.BASELINE_FACTOR=t.AnnotationType=t.AnnotationReplyType=t.AnnotationMode=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0,t.assert=function(e,t){e||s(t)},t.bytesToString=function(e){"object"==typeof e&&void 0!==e?.length||s("Invalid argument for bytesToString");const t=e.length,n=8192;if(t<n)return String.fromCharCode.apply(null,e);const i=[];for(let r=0;r<t;r+=n){const s=Math.min(r+n,t),a=e.subarray(r,s);i.push(String.fromCharCode.apply(null,a))}return i.join("")},t.createValidAbsoluteUrl=function(e,t=null,n=null){if(!e)return null;try{if(n&&"string"==typeof e){if(n.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);t?.length>=2&&(e=`http://${e}`)}if(n.tryConvertEncoding)try{e=h(e)}catch{}}const i=t?new URL(e,t):new URL(e);if(function(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(i))return i}catch{}return null},t.getModificationDate=function(e=new Date){return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")},t.getVerbosityLevel=function(){return i},t.info=function(e){i>=n.INFOS&&console.log(`Info: ${e}`)},t.isArrayBuffer=function(e){return"object"==typeof e&&void 0!==e?.byteLength},t.isArrayEqual=function(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0},t.normalizeUnicode=function(e){return u||(u=/([\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,p=new Map([["ſt","ſt"]])),e.replaceAll(u,((e,t,n)=>t?t.normalize("NFKC"):p.get(n)))},t.objectFromMap=function(e){const t=Object.create(null);for(const[n,i]of e)t[n]=i;return t},t.objectSize=function(e){return Object.keys(e).length},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(i=e)},t.shadow=a,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=l,t.stringToPDFString=function(e){if(e[0]>="ï"){let t;if("þ"===e[0]&&"ÿ"===e[1]?t="utf-16be":"ÿ"===e[0]&&"þ"===e[1]?t="utf-16le":"ï"===e[0]&&"»"===e[1]&&"¿"===e[2]&&(t="utf-8"),t)try{const n=new TextDecoder(t,{fatal:!0}),i=l(e);return n.decode(i)}catch(e){r(`stringToPDFString: "${e}".`)}}const t=[];for(let n=0,i=e.length;n<i;n++){const i=d[e.charCodeAt(n)];t.push(i?String.fromCharCode(i):e.charAt(n))}return t.join("")},t.stringToUTF8String=h,t.unreachable=s,t.utf8StringToString=function(e){return unescape(encodeURIComponent(e))},t.warn=r,t.IDENTITY_MATRIX=[1,0,0,1,0,0],t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],t.MAX_IMAGE_SIZE_TO_CACHE=1e7,t.LINE_FACTOR=1.35,t.LINE_DESCENT_FACTOR=.35,t.BASELINE_FACTOR=.25925925925925924,t.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},t.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},t.AnnotationEditorPrefix="pdfjs_internal_editor_",t.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15},t.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13},t.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},t.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},t.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},t.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},t.AnnotationReplyType={GROUP:"Group",REPLY:"R"},t.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},t.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864},t.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},t.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},t.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},t.PageActionEventType={O:"PageOpen",C:"PageClose"};const n={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=n,t.CMapCompressionType={NONE:0,BINARY:1},t.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let i=n.WARNINGS;function r(e){i>=n.WARNINGS&&console.log(`Warning: ${e}`)}function s(e){throw new Error(e)}function a(e,t,n,i=!1){return Object.defineProperty(e,t,{value:n,enumerable:!i,configurable:!0,writable:!1}),n}const o=function(){function e(t,n){this.constructor===e&&s("Cannot initialize BaseException."),this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e}();function l(e){"string"!=typeof e&&s("Invalid argument for stringToBytes");const t=e.length,n=new Uint8Array(t);for(let i=0;i<t;++i)n[i]=255&e.charCodeAt(i);return n}t.BaseException=o,t.PasswordException=class extends o{constructor(e,t){super(e,"PasswordException"),this.code=t}},t.UnknownErrorException=class extends o{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}},t.InvalidPDFException=class extends o{constructor(e){super(e,"InvalidPDFException")}},t.MissingPDFException=class extends o{constructor(e){super(e,"MissingPDFException")}},t.UnexpectedResponseException=class extends o{constructor(e,t){super(e,"UnexpectedResponseException"),this.status=t}},t.FormatError=class extends o{constructor(e){super(e,"FormatError")}},t.AbortException=class extends o{constructor(e){super(e,"AbortException")}},t.FeatureTest=class{static get isLittleEndian(){return a(this,"isLittleEndian",function(){const e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return a(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return a(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?a(this,"platform",{isWin:!1,isMac:!1}):a(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}};const c=[...Array(256).keys()].map((e=>e.toString(16).padStart(2,"0")));t.Util=class{static makeHexColor(e,t,n){return`#${c[e]}${c[t]}${c[n]}`}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[0],t[1]*=e[0],e[3]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[2],t[2]=n,n=t[1],t[1]=t[3],t[3]=n,e[1]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[2],t[1]*=e[2]),t[0]+=e[4],t[1]+=e[4],t[2]+=e[5],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const n=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/n,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/n]}static getAxialAlignedBoundingBox(e,t){const n=this.applyTransform(e,t),i=this.applyTransform(e.slice(2,4),t),r=this.applyTransform([e[0],e[3]],t),s=this.applyTransform([e[2],e[1]],t);return[Math.min(n[0],i[0],r[0],s[0]),Math.min(n[1],i[1],r[1],s[1]),Math.max(n[0],i[0],r[0],s[0]),Math.max(n[1],i[1],r[1],s[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],n=e[0]*t[0]+e[1]*t[2],i=e[0]*t[1]+e[1]*t[3],r=e[2]*t[0]+e[3]*t[2],s=e[2]*t[1]+e[3]*t[3],a=(n+s)/2,o=Math.sqrt((n+s)**2-4*(n*s-r*i))/2,l=a+o||1,c=a-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),i=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>i)return null;const r=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return r>s?null:[n,r,i,s]}static bezierBoundingBox(e,t,n,i,r,s,a,o){const l=[],c=[[],[]];let d,h,u,p,f,g,m,_;for(let c=0;c<2;++c)if(0===c?(h=6*e-12*n+6*r,d=-3*e+9*n-9*r+3*a,u=3*n-3*e):(h=6*t-12*i+6*s,d=-3*t+9*i-9*s+3*o,u=3*i-3*t),Math.abs(d)<1e-12){if(Math.abs(h)<1e-12)continue;p=-u/h,0<p&&p<1&&l.push(p)}else m=h*h-4*u*d,_=Math.sqrt(m),m<0||(f=(-h+_)/(2*d),0<f&&f<1&&l.push(f),g=(-h-_)/(2*d),0<g&&g<1&&l.push(g));let b,v=l.length;const y=v;for(;v--;)p=l[v],b=1-p,c[0][v]=b*b*b*e+3*b*b*p*n+3*b*p*p*r+p*p*p*a,c[1][v]=b*b*b*t+3*b*b*p*i+3*b*p*p*s+p*p*p*o;return c[0][y]=e,c[1][y]=t,c[0][y+1]=a,c[1][y+1]=o,c[0].length=c[1].length=y+2,[Math.min(...c[0]),Math.min(...c[1]),Math.max(...c[0]),Math.max(...c[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 h(e){return decodeURIComponent(escape(e))}t.PromiseCapability=class{#e=!1;constructor(){this.promise=new Promise(((e,t)=>{this.resolve=t=>{this.#e=!0,e(t)},this.reject=e=>{this.#e=!0,t(e)}}))}get settled(){return this.#e}};let u=null,p=null},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_is_node=__w_pdfjs_require__(10),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_xfa_text=__w_pdfjs_require__(19);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_is_node.isNodeJS?__w_pdfjs_require__(20).NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_is_node.isNodeJS?__w_pdfjs_require__(20).NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_is_node.isNodeJS?__w_pdfjs_require__(20).NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_is_node.isNodeJS?__w_pdfjs_require__(20).NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;let createPDFNetworkStream;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{PDFNodeStream:e}=__w_pdfjs_require__(21);createPDFNetworkStream=t=>new e(t)}else{const{PDFNetworkStream:e}=__w_pdfjs_require__(24),{PDFFetchStream:t}=__w_pdfjs_require__(25);createPDFNetworkStream=n=>(0,_display_utils.isValidFetchUrl)(n.url)?new t(n):new e(n)}function getDocument(e){if("string"==typeof e||e instanceof URL?e={url:e}:(0,_util.isArrayBuffer)(e)&&(e={data:e}),"object"!=typeof e)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const t=new PDFDocumentLoadingTask,{docId:n}=t,i=e.url?getUrlProp(e.url):null,r=e.data?getDataProp(e.data):null,s=e.httpHeaders||null,a=!0===e.withCredentials,o=e.password??null,l=e.range instanceof PDFDataRangeTransport?e.range:null,c=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let d=e.worker instanceof PDFWorker?e.worker:null;const h=e.verbosity,u="string"!=typeof e.docBaseUrl||(0,_display_utils.isDataScheme)(e.docBaseUrl)?null:e.docBaseUrl,p="string"==typeof e.cMapUrl?e.cMapUrl:null,f=!1!==e.cMapPacked,g=e.CMapReaderFactory||DefaultCMapReaderFactory,m="string"==typeof e.standardFontDataUrl?e.standardFontDataUrl:null,_=e.StandardFontDataFactory||DefaultStandardFontDataFactory,b=!0!==e.stopAtErrors,v=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,y=!1!==e.isEvalSupported,A="boolean"==typeof e.isOffscreenCanvasSupported?e.isOffscreenCanvasSupported:!_is_node.isNodeJS,x=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,S="boolean"==typeof e.disableFontFace?e.disableFontFace:_is_node.isNodeJS,w=!0===e.fontExtraProperties,E=!0===e.enableXfa,P=e.ownerDocument||globalThis.document,C=!0===e.disableRange,k=!0===e.disableStream,T=!0===e.disableAutoFetch,M=!0===e.pdfBug,L=l?l.length:e.length??NaN,R="boolean"==typeof e.useSystemFonts?e.useSystemFonts:!_is_node.isNodeJS&&!S,I="boolean"==typeof e.useWorkerFetch?e.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&_===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(p,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(m,document.baseURI),F=e.canvasFactory||new DefaultCanvasFactory({ownerDocument:P}),D=e.filterFactory||new DefaultFilterFactory({docId:n,ownerDocument:P});(0,_util.setVerbosityLevel)(h);const O={canvasFactory:F,filterFactory:D};if(I||(O.cMapReaderFactory=new g({baseUrl:p,isCompressed:f}),O.standardFontDataFactory=new _({baseUrl:m})),!d){const e={verbosity:h,port:_worker_options.GlobalWorkerOptions.workerPort};d=e.port?PDFWorker.fromPort(e):new PDFWorker(e),t._worker=d}const N={docId:n,apiVersion:"3.8.162",data:r,password:o,disableAutoFetch:T,rangeChunkSize:c,length:L,docBaseUrl:u,enableXfa:E,evaluatorOptions:{maxImageSize:v,disableFontFace:S,ignoreErrors:b,isEvalSupported:y,isOffscreenCanvasSupported:A,canvasMaxAreaInBytes:x,fontExtraProperties:w,useSystemFonts:R,cMapUrl:I?p:null,standardFontDataUrl:I?m:null}},j={ignoreErrors:b,isEvalSupported:y,disableFontFace:S,fontExtraProperties:w,enableXfa:E,ownerDocument:P,disableAutoFetch:T,pdfBug:M,styleElement:null};return d.promise.then((function(){if(t.destroyed)throw new Error("Loading aborted");const e=_fetchDocument(d,N),o=new Promise((function(e){let t;l?t=new _transport_stream.PDFDataTransportStream({length:L,initialData:l.initialData,progressiveDone:l.progressiveDone,contentDispositionFilename:l.contentDispositionFilename,disableRange:C,disableStream:k},l):r||(t=createPDFNetworkStream({url:i,length:L,httpHeaders:s,withCredentials:a,rangeChunkSize:c,disableRange:C,disableStream:k})),e(t)}));return Promise.all([e,o]).then((function([e,i]){if(t.destroyed)throw new Error("Loading aborted");const r=new _message_handler.MessageHandler(n,e,d.port),s=new WorkerTransport(r,t,i,j,O);t._transport=s,r.send("Ready",null)}))})).catch(t._capability.reject),t}async function _fetchDocument(e,t){if(e.destroyed)throw new Error("Worker was destroyed");const n=await e.messageHandler.sendWithPromise("GetDocRequest",t,t.data?[t.data.buffer]:null);if(e.destroyed)throw new Error("Worker was destroyed");return n}function getUrlProp(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(_is_node.isNodeJS&&"string"==typeof e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(e){if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&e instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if("string"==typeof e)return(0,_util.stringToBytes)(e);if("object"==typeof e&&!isNaN(e?.length)||(0,_util.isArrayBuffer)(e))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}class PDFDocumentLoadingTask{static#t=0;constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d"+PDFDocumentLoadingTask.#t++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0,await(this._transport?.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(e,t,n=!1,i=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=i,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const n of this._rangeListeners)n(e,t)}onDataProgress(e,t){this._readyCapability.promise.then((()=>{for(const n of this._progressListeners)n(e,t)}))}onDataProgressiveRead(e){this._readyCapability.promise.then((()=>{for(const t of this._progressiveReadListeners)t(e)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const e of this._progressiveDoneListeners)e()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get 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(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{#n=null;#i=!1;constructor(e,t,n,i=!1){this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=i?new _display_utils.StatTimer:null,this._pdfBug=i,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:e,rotation:t=this.rotate,offsetX:n=0,offsetY:i=0,dontFlip:r=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:n,offsetY:i,dontFlip:r})}getAnnotations({intent:e="display"}={}){const t=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t.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:e,viewport:t,intent:n="display",annotationMode:i=_util.AnnotationMode.ENABLE,transform:r=null,background:s=null,optionalContentConfigPromise:a=null,annotationCanvasMap:o=null,pageColors:l=null,printAnnotationStorage:c=null}){this._stats?.time("Overall");const d=this._transport.getRenderingIntent(n,i,c);this.#i=!1,this.#r(),a||(a=this._transport.getOptionalContentConfig());let h=this._intentStates.get(d.cacheKey);h||(h=Object.create(null),this._intentStates.set(d.cacheKey,h)),h.streamReaderCancelTimeout&&(clearTimeout(h.streamReaderCancelTimeout),h.streamReaderCancelTimeout=null);const u=!!(d.renderingIntent&_util.RenderingIntentFlag.PRINT);h.displayReadyCapability||(h.displayReadyCapability=new _util.PromiseCapability,h.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(d));const p=e=>{h.renderTasks.delete(f),(this._maybeCleanupAfterRender||u)&&(this.#i=!0),this.#s(!u),e?(f.capability.reject(e),this._abortOperatorList({intentState:h,reason:e instanceof Error?e:new Error(e)})):f.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")},f=new InternalRenderTask({callback:p,params:{canvasContext:e,viewport:t,transform:r,background:s},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:o,operatorList:h.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!u,pdfBug:this._pdfBug,pageColors:l});(h.renderTasks||=new Set).add(f);const g=f.task;return Promise.all([h.displayReadyCapability.promise,a]).then((([e,t])=>{this.destroyed?p():(this._stats?.time("Rendering"),f.initializeGraphics({transparency:e,optionalContentConfig:t}),f.operatorListChanged())})).catch(p),g}getOperatorList({intent:e="display",annotationMode:t=_util.AnnotationMode.ENABLE,printAnnotationStorage:n=null}={}){const i=this._transport.getRenderingIntent(e,t,n,!0);let r,s=this._intentStates.get(i.cacheKey);return s||(s=Object.create(null),this._intentStates.set(i.cacheKey,s)),s.opListReadCapability||(r=Object.create(null),r.operatorListChanged=function(){s.operatorList.lastChunk&&(s.opListReadCapability.resolve(s.operatorList),s.renderTasks.delete(r))},s.opListReadCapability=new _util.PromiseCapability,(s.renderTasks||=new Set).add(r),s.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(i)),s.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===e,disableNormalization:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then((e=>_xfa_text.XfaText.textContent(e)));const t=this.streamTextContent(e);return new Promise((function(e,n){const i=t.getReader(),r={items:[],styles:Object.create(null)};!function t(){i.read().then((function({value:n,done:i}){i?e(r):(Object.assign(r.styles,n.styles),r.items.push(...n.items),t())}),n)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),this.#i=!1,this.#r(),Promise.all(e)}cleanup(e=!1){this.#i=!0;const t=this.#s(!1);return e&&t&&(this._stats&&=new _display_utils.StatTimer),t}#s(e=!1){if(this.#r(),!this.#i||this.destroyed)return!1;if(e)return this.#n=setTimeout((()=>{this.#n=null,this.#s(!1)}),DELAYED_CLEANUP_TIMEOUT),!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#i=!1,!0}#r(){this.#n&&(clearTimeout(this.#n),this.#n=null)}_startRenderPage(e,t){const n=this._intentStates.get(t);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let n=0,i=e.length;n<i;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(const e of t.renderTasks)e.operatorListChanged();e.lastChunk&&this.#s(!0)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n}){const{map:i,transfers:r}=n,s=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:i},r).getReader(),a=this._intentStates.get(t);a.streamReader=s;const o=()=>{s.read().then((({value:e,done:t})=>{t?a.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,a),o())}),(e=>{if(a.streamReader=null,!this._transport.destroyed){if(a.operatorList){a.operatorList.lastChunk=!0;for(const e of a.renderTasks)e.operatorListChanged();this.#s(!0)}if(a.displayReadyCapability)a.displayReadyCapability.reject(e);else{if(!a.opListReadCapability)throw e;a.opListReadCapability.reject(e)}}}))};o()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(t instanceof _display_utils.RenderingCancelledException){let n=RENDERING_CANCELLED_TIMEOUT;return t.extraDelay>0&&t.extraDelay<1e3&&(n+=t.extraDelay),void(e.streamReaderCancelTimeout=setTimeout((()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})}),n))}}if(e.streamReader.cancel(new _util.AbortException(t.message)).catch((()=>{})),e.streamReader=null,!this._transport.destroyed){for(const[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#a=new Set;#o=Promise.resolve();postMessage(e,t){const n={data:structuredClone(e,t?{transfer:t}:null)};this.#o.then((()=>{for(const e of this.#a)e.call(this,n)}))}addEventListener(e,t){this.#a.add(t)}removeEventListener(e,t){this.#a.delete(t)}terminate(){this.#a.clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_is_node.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){const e=document?.currentScript?.src;e&&(PDFWorkerUtil.fallbackWorkerSrc=e.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(e,t){let n;try{if(n=new URL(e),!n.origin||"null"===n.origin)return!1}catch{return!1}const i=new URL(t,n);return n.origin===i.origin},PDFWorkerUtil.createCDNWrapper=function(e){const t=`importScripts("${e}");`;return URL.createObjectURL(new Blob([t]))};class PDFWorker{static#l=new WeakMap;constructor({name:e=null,port:t=null,verbosity:n=(0,_util.getVerbosityLevel)()}={}){if(t&&PDFWorker.#l.has(t))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=e,this.destroyed=!1,this.verbosity=n,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,t)return PDFWorker.#l.set(t,this),void this._initializeFromPort(t);this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:e}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,e)||(e=PDFWorkerUtil.createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e),n=new _message_handler.MessageHandler("main","worker",t),i=()=>{t.removeEventListener("error",r),n.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},r=()=>{this._webWorker||i()};t.addEventListener("error",r),n.on("test",(e=>{t.removeEventListener("error",r),this.destroyed?i():e?(this._messageHandler=n,this._port=t,this._webWorker=t,this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),n.destroy(),t.terminate())})),n.on("ready",(e=>{if(t.removeEventListener("error",r),this.destroyed)i();else try{s()}catch{this._setupFakeWorker()}}));const s=()=>{const e=new Uint8Array;n.send("test",e,[e.buffer])};return void s()}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((e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new LoopbackPort;this._port=t;const n="fake"+PDFWorkerUtil.fakeWorkerId++,i=new _message_handler.MessageHandler(n+"_worker",n,t);e.setup(i,t);const r=new _message_handler.MessageHandler(n,n+"_worker",t);this._messageHandler=r,this._readyCapability.resolve(),r.send("configure",{verbosity:this.verbosity})})).catch((e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))}))}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#l.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.#l.has(e.port)?this.#l.get(e.port):new PDFWorker(e)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.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;constructor(e,t,n,i,r){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this._params=i,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.cMapReaderFactory=r.cMapReaderFactory,this.standardFontDataFactory=r.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}#u(e,t=null){const n=this.#c.get(e);if(n)return n;const i=this.messageHandler.sendWithPromise(e,t);return this.#c.set(e,i),i}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(e,t=_util.AnnotationMode.ENABLE,n=null,i=!1){let r=_util.RenderingIntentFlag.DISPLAY,s=_annotation_storage.SerializableEmpty;switch(e){case"any":r=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":r=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${e}`)}switch(t){case _util.AnnotationMode.DISABLE:r+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:r+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:r+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,s=(r&_util.RenderingIntentFlag.PRINT&&n instanceof _annotation_storage.PrintAnnotationStorage?n:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${t}`)}return i&&(r+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:r,cacheKey:`${r}_${s.hash}`,annotationStorageSerializable:s}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const t of this.#d.values())e.push(t._destroy());this.#d.clear(),this.#h.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then((()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#c.clear(),this.filterFactory.destroy(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then((function({value:e,done:n}){n?t.close():((0,_util.assert)(e instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}})),e.on("ReaderHeadersReady",(e=>{const n=new _util.PromiseCapability,i=this._fullReader;return i.headersReady.then((()=>{i.isStreamingSupported&&i.isRangeSupported||(this._lastProgress&&t.onProgress?.(this._lastProgress),i.onProgress=e=>{t.onProgress?.({loaded:e.loaded,total:e.total})}),n.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})}),n.reject),n.promise})),e.on("GetRangeReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then((function({value:e,done:n}){n?t.close():((0,_util.assert)(e instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{n.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}):t.close()})),e.on("GetDoc",(({pdfInfo:e})=>{this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new PDFDocumentProxy(e,this))})),e.on("DocException",(function(e){let n;switch(e.name){case"PasswordException":n=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":n=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":n=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":n=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":n=new _util.UnknownErrorException(e.message,e.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}t._capability.reject(n)})),e.on("PasswordRequest",(e=>{if(this._passwordCapability=new _util.PromiseCapability,t.onPassword){const n=e=>{e instanceof Error?this._passwordCapability.reject(e):this._passwordCapability.resolve({password:e})};try{t.onPassword(n,e.code)}catch(e){this._passwordCapability.reject(e)}}else this._passwordCapability.reject(new _util.PasswordException(e.message,e.code));return this._passwordCapability.promise})),e.on("DataLoaded",(e=>{t.onProgress?.({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)})),e.on("StartRenderPage",(e=>{this.destroyed||this.#d.get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)})),e.on("commonobj",(([t,n,i])=>{if(!this.destroyed&&!this.commonObjs.has(t))switch(n){case"Font":const r=this._params;if("error"in i){const e=i.error;(0,_util.warn)(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}const s=r.pdfBug&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,a=new _font_loader.FontFaceObject(i,{isEvalSupported:r.isEvalSupported,disableFontFace:r.disableFontFace,ignoreErrors:r.ignoreErrors,inspectFont:s});this.fontLoader.bind(a).catch((n=>e.sendWithPromise("FontFallback",{id:t}))).finally((()=>{!r.fontExtraProperties&&a.data&&(a.data=null),this.commonObjs.resolve(t,a)}));break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(t,i);break;default:throw new Error(`Got unknown common object type ${n}`)}})),e.on("obj",(([e,t,n,i])=>{if(this.destroyed)return;const r=this.#d.get(t);if(!r.objs.has(e))switch(n){case"Image":if(r.objs.resolve(e,i),i){let e;if(i.bitmap){const{width:t,height:n}=i;e=t*n*4}else e=i.data?.length||0;e>_util.MAX_IMAGE_SIZE_TO_CACHE&&(r._maybeCleanupAfterRender=!0)}break;case"Pattern":r.objs.resolve(e,i);break;default:throw new Error(`Got unknown object type ${n}`)}})),e.on("DocProgress",(e=>{this.destroyed||t.onProgress?.({loaded:e.loaded,total:e.total})})),e.on("FetchBuiltInCMap",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(e):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),e.on("FetchStandardFontData",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(e):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}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:e,transfers:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally((()=>{this.annotationStorage.resetModified()}))}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,n=this.#h.get(t);if(n)return n;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then((e=>{if(this.destroyed)throw new Error("Transport destroyed");const n=new PDFPageProxy(t,e,this,this._params.pdfBug);return this.#d.set(t,n),n}));return this.#h.set(t,i),i}getPageIndex(e){return"object"!=typeof e||null===e||!Number.isInteger(e.num)||e.num<0||!Number.isInteger(e.gen)||e.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen})}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return this.#u("GetFieldObjects")}hasJSActions(){return this.#u("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!=typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((e=>new _optional_content_config.OptionalContentConfig(e)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=this.#c.get(e);if(t)return t;const n=this.messageHandler.sendWithPromise(e,null).then((e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})));return this.#c.set(e,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of this.#d.values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#c.clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:e,enableXfa:t}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e,enableXfa:t})}}class PDFObjects{#p=Object.create(null);#f(e){return this.#p[e]||(this.#p[e]={capability:new _util.PromiseCapability,data:null})}get(e,t=null){if(t){const n=this.#f(e);return n.capability.promise.then((()=>t(n.data))),null}const n=this.#p[e];if(!n?.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){const t=this.#p[e];return t?.capability.settled||!1}resolve(e,t=null){const n=this.#f(e);n.data=t,n.capability.resolve()}clear(){for(const e in this.#p){const{data:t}=this.#p[e];t?.bitmap?.close()}this.#p=Object.create(null)}}class RenderTask{#g=null;constructor(e){this.#g=e,this.onContinue=null}get promise(){return this.#g.capability.promise}cancel(e=0){this.#g.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#g.operatorList;if(!e)return!1;const{annotationCanvasMap:t}=this.#g;return e.form||e.canvas&&t?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static#m=new WeakSet;constructor({callback:e,params:t,objs:n,commonObjs:i,annotationCanvasMap:r,operatorList:s,pageIndex:a,canvasFactory:o,filterFactory:l,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:h=null}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=i,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=a,this.canvasFactory=o,this.filterFactory=l,this._pdfBug=d,this.pageColors=h,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window,this.cancelled=!1,this.capability=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=t.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#m.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#m.add(this._canvas)}this._pdfBug&&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:i,transform:r,background:s}=this.params;this.gfx=new _canvas.CanvasGraphics(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:r,viewport:i,transparency:e,background:s}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this._canvas&&InternalRenderTask.#m.delete(this._canvas),this.callback(e||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,t))}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)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(this.pageColors),this._canvas&&InternalRenderTask.#m.delete(this._canvas),this.callback())))}}const version="3.8.162";exports.version=version;const build="2c74323e3";exports.build=build},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SerializableEmpty=t.PrintAnnotationStorage=t.AnnotationStorage=void 0;var i=n(1),r=n(4),s=n(8);const a=Object.freeze({map:null,hash:"",transfers:void 0});t.SerializableEmpty=a;class o{#_=!1;#b=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const n=this.#b.get(e);return void 0===n?t:Object.assign(t,n)}getRawValue(e){return this.#b.get(e)}remove(e){if(this.#b.delete(e),0===this.#b.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const e of this.#b.values())if(e instanceof r.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(e,t){const n=this.#b.get(e);let i=!1;if(void 0!==n)for(const[e,r]of Object.entries(t))n[e]!==r&&(i=!0,n[e]=r);else i=!0,this.#b.set(e,t);i&&this.#v(),t instanceof r.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type)}has(e){return this.#b.has(e)}getAll(){return this.#b.size>0?(0,i.objectFromMap)(this.#b):null}setAll(e){for(const[t,n]of Object.entries(e))this.setValue(t,n)}get size(){return this.#b.size}#v(){this.#_||(this.#_=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#_&&(this.#_=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new l(this)}get serializable(){if(0===this.#b.size)return a;const e=new Map,t=new s.MurmurHash3_64,n=[];for(const[i,s]of this.#b){const a=s instanceof r.AnnotationEditor?s.serialize():s;a&&(e.set(i,a),t.update(`${i}:${JSON.stringify(a)}`),a.bitmap&&n.push(a.bitmap))}return e.size>0?{map:e,hash:t.hexdigest(),transfers:n}:a}}t.AnnotationStorage=o;class l extends o{#y;constructor(e){super();const{map:t,hash:n,transfers:i}=e.serializable,r=structuredClone(t,i?{transfer:i}:null);this.#y={map:r,hash:n,transfers:i}}get print(){(0,i.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#y}}t.PrintAnnotationStorage=l},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditor=void 0;var i=n(5),r=n(1);class s{#A=this.focusin.bind(this);#x=this.focusout.bind(this);#S=!1;#w=!1;#E=!1;_uiManager=null;#P=s._zIndex++;static _colorManager=new i.ColorManager;static _zIndex=1;constructor(e){this.constructor===s&&(0,r.unreachable)("Cannot initialize AnnotationEditor."),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null;const{rotation:t,rawDims:{pageWidth:n,pageHeight:i,pageX:a,pageY:o}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,i],this.pageTranslation=[a,o];const[l,c]=this.parentDimensions;this.x=e.x/l,this.y=e.y/c,this.isAttachedToDOM=!1,this.deleted=!1}static get _defaultLineColor(){return(0,r.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new a({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#P}setParent(e){null!==e&&(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}focusin(e){this.#S?this.#S=!1:this.parent.setSelected(this)}focusout(e){if(!this.isAttachedToDOM)return;const t=e.relatedTarget;t?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(e){const t=this.parent.div.getBoundingClientRect();this.startX=e.clientX-t.x,this.startY=e.clientY-t.y,e.dataTransfer.setData("text/plain",this.id),e.dataTransfer.effectAllowed="move"}setAt(e,t,n,i){const[r,s]=this.parentDimensions;[n,i]=this.screenToPageTranslation(n,i),this.x=(e+n)/r,this.y=(t+i)/s,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}translate(e,t){const[n,i]=this.parentDimensions;[e,t]=this.screenToPageTranslation(e,t),this.x+=e/n,this.y+=t/i,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}screenToPageTranslation(e,t){switch(this.parentRotation){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{realScale:e}=this._uiManager.viewParameters,[t,n]=this.pageDimensions;return[t*e,n*e]}setDims(e,t){const[n,i]=this.parentDimensions;this.div.style.width=100*e/n+"%",this.div.style.height=100*t/i+"%"}fixDims(){const{style:e}=this.div,{height:t,width:n}=e,i=n.endsWith("%"),r=t.endsWith("%");if(i&&r)return;const[s,a]=this.parentDimensions;i||(e.width=100*parseFloat(n)/s+"%"),r||(e.height=100*parseFloat(t)/a+"%")}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",this.#A),this.div.addEventListener("focusout",this.#x);const[e,t]=this.getInitialTranslation();return this.translate(e,t),(0,i.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(e){const{isMac:t}=r.FeatureTest.platform;0!==e.button||e.ctrlKey&&t?e.preventDefault():(e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this),this.#S=!0)}getRect(e,t){const n=this.parentScale,[i,r]=this.pageDimensions,[s,a]=this.pageTranslation,o=e/n,l=t/n,c=this.x*i,d=this.y*r,h=this.width*i,u=this.height*r;switch(this.rotation){case 0:return[c+o+s,r-d-l-u+a,c+o+h+s,r-d-l+a];case 90:return[c+l+s,r-d+o+a,c+l+u+s,r-d+o+h+a];case 180:return[c-o-h+s,r-d+l+a,c-o+s,r-d+l+u+a];case 270:return[c-l-u+s,r-d-o-h+a,c-l+s,r-d-o+a];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[n,i,r,s]=e,a=r-n,o=s-i;switch(this.rotation){case 0:return[n,t-s,a,o];case 90:return[n,t-i,o,a];case 180:return[r,t-i,a,o];case 270:return[r,t-s,o,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#E=!0}disableEditMode(){this.#E=!1}isInEditMode(){return this.#E}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#A),this.div?.addEventListener("focusout",this.#x)}serialize(e=!1){(0,r.unreachable)("An editor must be serializable")}static deserialize(e,t,n){const i=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:n});i.rotation=e.rotation;const[r,s]=i.pageDimensions,[a,o,l,c]=i.getRectInCurrentCoords(e.rect,s);return i.x=a/r,i.y=o/s,i.width=l/r,i.height=c/s,i}remove(){this.div.removeEventListener("focusin",this.#A),this.div.removeEventListener("focusout",this.#x),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){this.div?.classList.add("selectedEditor")}unselect(){this.div?.classList.remove("selectedEditor")}updateParams(e,t){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return this.#w}set isEditing(e){this.#w=e,e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}}t.AnnotationEditor=s;class a extends s{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardManager=t.CommandManager=t.ColorManager=t.AnnotationEditorUIManager=void 0,t.bindEvents=function(e,t,n){for(const i of n)t.addEventListener(i,e[i].bind(e))},t.opacityToHex=function(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")};var i=n(1),r=n(6);class s{#C=0;getId(){return`${i.AnnotationEditorPrefix}${this.#C++}`}}class a{#k=[];#T=!1;#M;#L=-1;constructor(e=128){this.#M=e}add({cmd:e,undo:t,mustExec:n,type:i=NaN,overwriteIfSameType:r=!1,keepUndo:s=!1}){if(n&&e(),this.#T)return;const a={cmd:e,undo:t,type:i};if(-1===this.#L)return this.#k.length>0&&(this.#k.length=0),this.#L=0,void this.#k.push(a);if(r&&this.#k[this.#L].type===i)return s&&(a.undo=this.#k[this.#L].undo),void(this.#k[this.#L]=a);const o=this.#L+1;o===this.#M?this.#k.splice(0,1):(this.#L=o,o<this.#k.length&&this.#k.splice(o)),this.#k.push(a)}undo(){-1!==this.#L&&(this.#T=!0,this.#k[this.#L].undo(),this.#T=!1,this.#L-=1)}redo(){this.#L<this.#k.length-1&&(this.#L+=1,this.#T=!0,this.#k[this.#L].cmd(),this.#T=!1)}hasSomethingToUndo(){return-1!==this.#L}hasSomethingToRedo(){return this.#L<this.#k.length-1}destroy(){this.#k=null}}t.CommandManager=a;class o{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=i.FeatureTest.platform;for(const[n,i,r=!1]of e)for(const e of n){const n=e.startsWith("mac+");t&&n?(this.callbacks.set(e.slice(4),{callback:i,bubbles:r}),this.allKeys.add(e.split("+").at(-1))):t||n||(this.callbacks.set(e,{callback:i,bubbles:r}),this.allKeys.add(e.split("+").at(-1)))}}#R(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;const n=this.callbacks.get(this.#R(t));if(!n)return;const{callback:i,bubbles:r}=n;i.bind(e)(),r||(t.stopPropagation(),t.preventDefault())}}t.KeyboardManager=o;class l{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return(0,r.getColorValues)(e),(0,i.shadow)(this,"_colors",e)}convert(e){const t=(0,r.getRGB)(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[e,n]of this._colors)if(n.every(((e,n)=>e===t[n])))return l._colorsMapping.get(e);return t}getHexCode(e){const t=this._colors.get(e);return t?i.Util.makeHexColor(...t):e}}t.ColorManager=l;class c{#I=null;#F=new Map;#D=new Map;#O=null;#N=new a;#j=0;#B=new Set;#U=null;#V=new Set;#H=null;#z=new s;#W=!1;#q=i.AnnotationEditorType.NONE;#$=new Set;#G=this.copy.bind(this);#X=this.cut.bind(this);#K=this.paste.bind(this);#Y=this.keydown.bind(this);#Q=this.onEditingAction.bind(this);#J=this.onPageChanging.bind(this);#Z=this.onScaleChanging.bind(this);#ee=this.onRotationChanging.bind(this);#te={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#ne=null;static get _keyboardManager(){return(0,i.shadow)(this,"_keyboardManager",new o([[["ctrl+a","mac+meta+a"],c.prototype.selectAll],[["ctrl+z","mac+meta+z"],c.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],c.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],c.prototype.delete],[["Escape","mac+Escape"],c.prototype.unselectAll]]))}constructor(e,t,n){this.#ne=e,this.#H=t,this.#H._on("editingaction",this.#Q),this.#H._on("pagechanging",this.#J),this.#H._on("scalechanging",this.#Z),this.#H._on("rotationchanging",this.#ee),this.#O=n,this.viewParameters={realScale:r.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){this.#ie(),this.#H._off("editingaction",this.#Q),this.#H._off("pagechanging",this.#J),this.#H._off("scalechanging",this.#Z),this.#H._off("rotationchanging",this.#ee);for(const e of this.#D.values())e.destroy();this.#D.clear(),this.#F.clear(),this.#V.clear(),this.#I=null,this.#$.clear(),this.#N.destroy()}onPageChanging({pageNumber:e}){this.#j=e-1}focusMainContainer(){this.#ne.focus()}addShouldRescale(e){this.#V.add(e)}removeShouldRescale(e){this.#V.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*r.PixelsPerInch.PDF_TO_CSS_UNITS;for(const e of this.#V)e.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}addToAnnotationStorage(e){e.isEmpty()||!this.#O||this.#O.has(e.id)||this.#O.setValue(e.id,e)}#re(){this.#ne.addEventListener("keydown",this.#Y)}#ie(){this.#ne.removeEventListener("keydown",this.#Y)}#se(){document.addEventListener("copy",this.#G),document.addEventListener("cut",this.#X),document.addEventListener("paste",this.#K)}#ae(){document.removeEventListener("copy",this.#G),document.removeEventListener("cut",this.#X),document.removeEventListener("paste",this.#K)}copy(e){if(e.preventDefault(),this.#I&&this.#I.commitOrRemove(),!this.hasSelection)return;const t=[];for(const e of this.#$){const n=e.serialize(!0);n&&t.push(n)}0!==t.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}paste(e){e.preventDefault();let t=e.clipboardData.getData("application/pdfjs");if(!t)return;try{t=JSON.parse(t)}catch(e){return void(0,i.warn)(`paste: "${e.message}".`)}if(!Array.isArray(t))return;this.unselectAll();const n=this.#D.get(this.#j);try{const e=[];for(const i of t){const t=n.deserialize(i);if(!t)return;e.push(t)}const i=()=>{for(const t of e)this.#oe(t);this.#le(e)},r=()=>{for(const t of e)t.remove()};this.addCommands({cmd:i,undo:r,mustExec:!0})}catch(e){(0,i.warn)(`paste: "${e.message}".`)}}keydown(e){this.getActive()?.shouldGetKeyboardEvents()||c._keyboardManager.exec(this,e)}onEditingAction(e){["undo","redo","delete","selectAll"].includes(e.name)&&this[e.name]()}#ce(e){Object.entries(e).some((([e,t])=>this.#te[e]!==t))&&this.#H.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#te,e)})}#de(e){this.#H.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#re(),this.#se(),this.#ce({isEditing:this.#q!==i.AnnotationEditorType.NONE,isEmpty:this.#he(),hasSomethingToUndo:this.#N.hasSomethingToUndo(),hasSomethingToRedo:this.#N.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ie(),this.#ae(),this.#ce({isEditing:!1}))}registerEditorTypes(e){if(!this.#U){this.#U=e;for(const e of this.#U)this.#de(e.defaultPropertiesToUpdate)}}getId(){return this.#z.getId()}get currentLayer(){return this.#D.get(this.#j)}get currentPageIndex(){return this.#j}addLayer(e){this.#D.set(e.pageIndex,e),this.#W?e.enable():e.disable()}removeLayer(e){this.#D.delete(e.pageIndex)}updateMode(e){if(this.#q=e,e===i.AnnotationEditorType.NONE)this.setEditingState(!1),this.#ue();else{this.setEditingState(!0),this.#pe();for(const t of this.#D.values())t.updateMode(e)}}updateToolbar(e){e!==this.#q&&this.#H.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){if(this.#U){for(const n of this.#$)n.updateParams(e,t);for(const n of this.#U)n.updateDefaultParams(e,t)}}#pe(){if(!this.#W){this.#W=!0;for(const e of this.#D.values())e.enable()}}#ue(){if(this.unselectAll(),this.#W){this.#W=!1;for(const e of this.#D.values())e.disable()}}getEditors(e){const t=[];for(const n of this.#F.values())n.pageIndex===e&&t.push(n);return t}getEditor(e){return this.#F.get(e)}addEditor(e){this.#F.set(e.id,e)}removeEditor(e){this.#F.delete(e.id),this.unselect(e),e.annotationElementId&&this.#B.has(e.annotationElementId)||this.#O?.remove(e.id)}addDeletedAnnotationElement(e){this.#B.add(e.annotationElementId),e.deleted=!0}isDeletedAnnotationElement(e){return this.#B.has(e)}removeDeletedAnnotationElement(e){this.#B.delete(e.annotationElementId),e.deleted=!1}#oe(e){const t=this.#D.get(e.pageIndex);t?t.addOrRebuild(e):this.addEditor(e)}setActiveEditor(e){this.#I!==e&&(this.#I=e,e&&this.#de(e.propertiesToUpdate))}toggleSelected(e){if(this.#$.has(e))return this.#$.delete(e),e.unselect(),void this.#ce({hasSelectedEditor:this.hasSelection});this.#$.add(e),e.select(),this.#de(e.propertiesToUpdate),this.#ce({hasSelectedEditor:!0})}setSelected(e){for(const t of this.#$)t!==e&&t.unselect();this.#$.clear(),this.#$.add(e),e.select(),this.#de(e.propertiesToUpdate),this.#ce({hasSelectedEditor:!0})}isSelected(e){return this.#$.has(e)}unselect(e){e.unselect(),this.#$.delete(e),this.#ce({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#$.size}undo(){this.#N.undo(),this.#ce({hasSomethingToUndo:this.#N.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#he()})}redo(){this.#N.redo(),this.#ce({hasSomethingToUndo:!0,hasSomethingToRedo:this.#N.hasSomethingToRedo(),isEmpty:this.#he()})}addCommands(e){this.#N.add(e),this.#ce({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#he()})}#he(){if(0===this.#F.size)return!0;if(1===this.#F.size)for(const e of this.#F.values())return e.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...this.#$];this.addCommands({cmd:()=>{for(const t of e)t.remove()},undo:()=>{for(const t of e)this.#oe(t)},mustExec:!0})}commitOrRemove(){this.#I?.commitOrRemove()}#le(e){this.#$.clear();for(const t of e)t.isEmpty()||(this.#$.add(t),t.select());this.#ce({hasSelectedEditor:!0})}selectAll(){for(const e of this.#$)e.commit();this.#le(this.#F.values())}unselectAll(){if(this.#I)this.#I.commitOrRemove();else if(0!==this.#$.size){for(const e of this.#$)e.unselect();this.#$.clear(),this.#ce({hasSelectedEditor:!1})}}isActive(e){return this.#I===e}getActive(){return this.#I}getMode(){return this.#q}}t.AnnotationEditorUIManager=c},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatTimer=t.RenderingCancelledException=t.PixelsPerInch=t.PageViewport=t.PDFDateString=t.DOMStandardFontDataFactory=t.DOMSVGFactory=t.DOMFilterFactory=t.DOMCanvasFactory=t.DOMCMapReaderFactory=t.AnnotationPrefix=void 0,t.deprecated=function(e){console.log("Deprecated API usage: "+e)},t.getColorValues=function(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const n of e.keys()){t.style.color=n;const i=window.getComputedStyle(t).color;e.set(n,b(i))}t.remove()},t.getCurrentTransform=function(e){const{a:t,b:n,c:i,d:r,e:s,f:a}=e.getTransform();return[t,n,i,r,s,a]},t.getCurrentTransformInverse=function(e){const{a:t,b:n,c:i,d:r,e:s,f:a}=e.getTransform().invertSelf();return[t,n,i,r,s,a]},t.getFilenameFromUrl=function(e,t=!1){return t||([e]=e.split(/[#?]/,1)),e.substring(e.lastIndexOf("/")+1)},t.getPdfFilenameFromUrl=function(e,t="document.pdf"){if("string"!=typeof e)return t;if(g(e))return(0,r.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let s=n.exec(i[1])||n.exec(i[2])||n.exec(i[3]);if(s&&(s=s[0],s.includes("%")))try{s=n.exec(decodeURIComponent(s))[0]}catch{}return s||t},t.getRGB=b,t.getXfaPageViewport=function(e,{scale:t=1,rotation:n=0}){const{width:i,height:r}=e.attributes.style,s=[0,0,parseInt(i),parseInt(r)];return new p({viewBox:s,scale:t,rotation:n})},t.isDataScheme=g,t.isPdfFile=function(e){return"string"==typeof e&&/\.pdf$/i.test(e)},t.isValidFetchUrl=m,t.loadScript=function(e,t=!1){return new Promise(((n,i)=>{const r=document.createElement("script");r.src=e,r.onload=function(e){t&&r.remove(),n(e)},r.onerror=function(){i(new Error(`Cannot load script at: ${r.src}`))},(document.head||document.documentElement).append(r)}))},t.setLayerDimensions=function(e,t,n=!1,i=!0){if(t instanceof p){const{pageWidth:i,pageHeight:r}=t.rawDims,{style:s}=e,a=`calc(var(--scale-factor) * ${i}px)`,o=`calc(var(--scale-factor) * ${r}px)`;n&&t.rotation%180!=0?(s.width=o,s.height=a):(s.width=a,s.height=o)}i&&e.setAttribute("data-main-rotation",t.rotation)};var i=n(7),r=n(1);const s="http://www.w3.org/2000/svg";t.AnnotationPrefix="pdfjs_internal_id_";class a{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}t.PixelsPerInch=a;class o extends i.BaseFilterFactory{#fe;#ge;#t;#me;#_e;#be;#ve;#ye;#Ae;#xe;#C=0;constructor({docId:e,ownerDocument:t=globalThis.document}={}){super(),this.#t=e,this.#me=t}get#Se(){return this.#fe||=new Map}get#we(){if(!this.#ge){const e=this.#me.createElement("div"),{style:t}=e;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;const n=this.#me.createElementNS(s,"svg");n.setAttribute("width",0),n.setAttribute("height",0),this.#ge=this.#me.createElementNS(s,"defs"),e.append(n),n.append(this.#ge),this.#me.body.append(e)}return this.#ge}addFilter(e){if(!e)return"none";let t,n,i,r,s=this.#Se.get(e);if(s)return s;if(1===e.length){const s=e[0],a=new Array(256);for(let e=0;e<256;e++)a[e]=s[e]/255;r=t=n=i=a.join(",")}else{const[s,a,o]=e,l=new Array(256),c=new Array(256),d=new Array(256);for(let e=0;e<256;e++)l[e]=s[e]/255,c[e]=a[e]/255,d[e]=o[e]/255;t=l.join(","),n=c.join(","),i=d.join(","),r=`${t}${n}${i}`}if(s=this.#Se.get(r),s)return this.#Se.set(e,s),s;const a=`g_${this.#t}_transfer_map_${this.#C++}`,o=`url(#${a})`;this.#Se.set(e,o),this.#Se.set(r,o);const l=this.#Ee(a);return this.#Pe(t,n,i,l),o}addHCMFilter(e,t){const n=`${e}-${t}`;if(this.#be===n)return this.#ve;if(this.#be=n,this.#ve="none",this.#_e?.remove(),!e||!t)return this.#ve;const i=this.#Ce(e);e=r.Util.makeHexColor(...i);const s=this.#Ce(t);if(t=r.Util.makeHexColor(...s),this.#we.style.color="","#000000"===e&&"#ffffff"===t||e===t)return this.#ve;const a=new Array(256);for(let e=0;e<=255;e++){const t=e/255;a[e]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const o=a.join(","),l=`g_${this.#t}_hcm_filter`,c=this.#ye=this.#Ee(l);this.#Pe(o,o,o,c),this.#ke(c);const d=(e,t)=>{const n=i[e]/255,r=s[e]/255,a=new Array(t+1);for(let e=0;e<=t;e++)a[e]=n+e/t*(r-n);return a.join(",")};return this.#Pe(d(0,5),d(1,5),d(2,5),c),this.#ve=`url(#${l})`,this.#ve}addHighlightHCMFilter(e,t,n,i){const r=`${e}-${t}-${n}-${i}`;if(this.#Ae===r)return this.#xe;if(this.#Ae=r,this.#xe="none",this.#ye?.remove(),!e||!t)return this.#xe;const[s,a]=[e,t].map(this.#Ce.bind(this));let o=Math.round(.2126*s[0]+.7152*s[1]+.0722*s[2]),l=Math.round(.2126*a[0]+.7152*a[1]+.0722*a[2]),[c,d]=[n,i].map(this.#Ce.bind(this));l<o&&([o,l,c,d]=[l,o,d,c]),this.#we.style.color="";const h=(e,t,n)=>{const i=new Array(256),r=(l-o)/n,s=e/255,a=(t-e)/(255*n);let c=0;for(let e=0;e<=n;e++){const t=Math.round(o+e*r),n=s+e*a;for(let e=c;e<=t;e++)i[e]=n;c=t+1}for(let e=c;e<256;e++)i[e]=i[c-1];return i.join(",")},u=`g_${this.#t}_hcm_highlight_filter`,p=this.#ye=this.#Ee(u);return this.#ke(p),this.#Pe(h(c[0],d[0],5),h(c[1],d[1],5),h(c[2],d[2],5),p),this.#xe=`url(#${u})`,this.#xe}destroy(e=!1){e&&(this.#ve||this.#xe)||(this.#ge&&(this.#ge.parentNode.parentNode.remove(),this.#ge=null),this.#fe&&(this.#fe.clear(),this.#fe=null),this.#C=0)}#ke(e){const t=this.#me.createElementNS(s,"feColorMatrix");t.setAttribute("type","matrix"),t.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"),e.append(t)}#Ee(e){const t=this.#me.createElementNS(s,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),this.#we.append(t),t}#Te(e,t,n){const i=this.#me.createElementNS(s,t);i.setAttribute("type","discrete"),i.setAttribute("tableValues",n),e.append(i)}#Pe(e,t,n,i){const r=this.#me.createElementNS(s,"feComponentTransfer");i.append(r),this.#Te(r,"feFuncR",e),this.#Te(r,"feFuncG",t),this.#Te(r,"feFuncB",n)}#Ce(e){return this.#we.style.color=e,b(getComputedStyle(this.#we).getPropertyValue("color"))}}t.DOMFilterFactory=o;class l extends i.BaseCanvasFactory{constructor({ownerDocument:e=globalThis.document}={}){super(),this._document=e}_createCanvas(e,t){const n=this._document.createElement("canvas");return n.width=e,n.height=t,n}}async function c(e,t=!1){if(m(e,document.baseURI)){const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);return t?new Uint8Array(await n.arrayBuffer()):(0,r.stringToBytes)(await n.text())}return new Promise(((n,i)=>{const s=new XMLHttpRequest;s.open("GET",e,!0),t&&(s.responseType="arraybuffer"),s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(200===s.status||0===s.status){let e;if(t&&s.response?e=new Uint8Array(s.response):!t&&s.responseText&&(e=(0,r.stringToBytes)(s.responseText)),e)return void n(e)}i(new Error(s.statusText))}},s.send(null)}))}t.DOMCanvasFactory=l;class d extends i.BaseCMapReaderFactory{_fetchData(e,t){return c(e,this.isCompressed).then((e=>({cMapData:e,compressionType:t})))}}t.DOMCMapReaderFactory=d;class h extends i.BaseStandardFontDataFactory{_fetchData(e){return c(e,!0)}}t.DOMStandardFontDataFactory=h;class u extends i.BaseSVGFactory{_createSVG(e){return document.createElementNS(s,e)}}t.DOMSVGFactory=u;class p{constructor({viewBox:e,scale:t,rotation:n,offsetX:i=0,offsetY:r=0,dontFlip:s=!1}){this.viewBox=e,this.scale=t,this.rotation=n,this.offsetX=i,this.offsetY=r;const a=(e[2]+e[0])/2,o=(e[3]+e[1])/2;let l,c,d,h,u,p,f,g;switch((n%=360)<0&&(n+=360),n){case 180:l=-1,c=0,d=0,h=1;break;case 90:l=0,c=1,d=1,h=0;break;case 270:l=0,c=-1,d=-1,h=0;break;case 0:l=1,c=0,d=0,h=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}s&&(d=-d,h=-h),0===l?(u=Math.abs(o-e[1])*t+i,p=Math.abs(a-e[0])*t+r,f=(e[3]-e[1])*t,g=(e[2]-e[0])*t):(u=Math.abs(a-e[0])*t+i,p=Math.abs(o-e[1])*t+r,f=(e[2]-e[0])*t,g=(e[3]-e[1])*t),this.transform=[l*t,c*t,d*t,h*t,u-l*t*a-d*t*o,p-c*t*a-h*t*o],this.width=f,this.height=g}get rawDims(){const{viewBox:e}=this;return(0,r.shadow)(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:i=this.offsetY,dontFlip:r=!1}={}){return new p({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:n,offsetY:i,dontFlip:r})}convertToViewportPoint(e,t){return r.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=r.Util.applyTransform([e[0],e[1]],this.transform),n=r.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){return r.Util.applyInverseTransform([e,t],this.transform)}}t.PageViewport=p;class f extends r.BaseException{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function g(e){const t=e.length;let n=0;for(;n<t&&""===e[n].trim();)n++;return"data:"===e.substring(n,n+5).toLowerCase()}function m(e,t){try{const{protocol:n}=t?new URL(e,t):new URL(e);return"http:"===n||"https:"===n}catch{return!1}}let _;function b(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(16711680&t)>>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map((e=>parseInt(e))):e.startsWith("rgba(")?e.slice(5,-1).split(",").map((e=>parseInt(e))).slice(0,3):((0,r.warn)(`Not a valid color format: "${e}"`),[0,0,0])}t.RenderingCancelledException=f,t.StatTimer=class{started=Object.create(null);times=[];time(e){e in this.started&&(0,r.warn)(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,r.warn)(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:e}of this.times)t=Math.max(e.length,t);for(const{name:n,start:i,end:r}of this.times)e.push(`${n.padEnd(t)} ${r-i}ms\n`);return e.join("")}},t.PDFDateString=class{static toDateObject(e){if(!e||"string"!=typeof e)return null;_||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const t=_.exec(e);if(!t)return null;const n=parseInt(t[1],10);let i=parseInt(t[2],10);i=i>=1&&i<=12?i-1:0;let r=parseInt(t[3],10);r=r>=1&&r<=31?r:1;let s=parseInt(t[4],10);s=s>=0&&s<=23?s:0;let a=parseInt(t[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(t[6],10);o=o>=0&&o<=59?o:0;const l=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(t[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===l?(s+=c,a+=d):"+"===l&&(s-=c,a-=d),new Date(Date.UTC(n,i,r,s,a,o))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStandardFontDataFactory=t.BaseSVGFactory=t.BaseFilterFactory=t.BaseCanvasFactory=t.BaseCMapReaderFactory=void 0;var i=n(1);class r{constructor(){this.constructor===r&&(0,i.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addHighlightHCMFilter(e,t,n,i){return"none"}destroy(e=!1){}}t.BaseFilterFactory=r;class s{constructor(){this.constructor===s&&(0,i.unreachable)("Cannot initialize BaseCanvasFactory.")}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d")}}reset(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){(0,i.unreachable)("Abstract method `_createCanvas` called.")}}t.BaseCanvasFactory=s;class a{constructor({baseUrl:e=null,isCompressed:t=!0}){this.constructor===a&&(0,i.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE;return this._fetchData(t,n).catch((e=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)}))}_fetchData(e,t){(0,i.unreachable)("Abstract method `_fetchData` called.")}}t.BaseCMapReaderFactory=a;class o{constructor({baseUrl:e=null}){this.constructor===o&&(0,i.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetchData(t).catch((e=>{throw new Error(`Unable to load font data at: ${t}`)}))}_fetchData(e){(0,i.unreachable)("Abstract method `_fetchData` called.")}}t.BaseStandardFontDataFactory=o;class l{constructor(){this.constructor===l&&(0,i.unreachable)("Cannot initialize BaseSVGFactory.")}create(e,t,n=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),n||(i.setAttribute("width",`${e}px`),i.setAttribute("height",`${t}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${e} ${t}`),i}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){(0,i.unreachable)("Abstract method `_createSVG` called.")}}t.BaseSVGFactory=l},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MurmurHash3_64=void 0;var i=n(1);const r=3285377520,s=4294901760,a=65535;t.MurmurHash3_64=class{constructor(e){this.h1=e?4294967295&e:r,this.h2=e?4294967295&e:r}update(e){let t,n;if("string"==typeof e){t=new Uint8Array(2*e.length),n=0;for(let i=0,r=e.length;i<r;i++){const r=e.charCodeAt(i);r<=255?t[n++]=r:(t[n++]=r>>>8,t[n++]=255&r)}}else{if(!(0,i.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");t=e.slice(),n=t.byteLength}const r=n>>2,o=n-4*r,l=new Uint32Array(t.buffer,0,r);let c=0,d=0,h=this.h1,u=this.h2;const p=3432918353,f=461845907,g=11601,m=13715;for(let e=0;e<r;e++)1&e?(c=l[e],c=c*p&s|c*g&a,c=c<<15|c>>>17,c=c*f&s|c*m&a,h^=c,h=h<<13|h>>>19,h=5*h+3864292196):(d=l[e],d=d*p&s|d*g&a,d=d<<15|d>>>17,d=d*f&s|d*m&a,u^=d,u=u<<13|u>>>19,u=5*u+3864292196);switch(c=0,o){case 3:c^=t[4*r+2]<<16;case 2:c^=t[4*r+1]<<8;case 1:c^=t[4*r],c=c*p&s|c*g&a,c=c<<15|c>>>17,c=c*f&s|c*m&a,1&r?h^=c:u^=c}this.h1=h,this.h2=u}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&s|36045*e&a,t=4283543511*t&s|(2950163797*(t<<16|e>>>16)&s)>>>16,e^=t>>>1,e=444984403*e&s|60499*e&a,t=3301882366*t&s|(3120437893*(t<<16|e>>>16)&s)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0;var i=n(1),r=n(10);t.FontLoader=class{#Me=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#Me.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(e){if(e&&!this.#Me.has(e.loadedName))if((0,i.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:n,style:r}=e,s=new FontFace(t,n,r);this.addNativeFontFace(s);try{await s.load(),this.#Me.add(t)}catch{(0,i.warn)(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(s)}}else(0,i.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo)return void await this.loadSystemFont(e.systemFontInfo);if(this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw(0,i.warn)(`Failed to load font '${t.family}': '${n}'.`),e.disableFontFace=!0,n}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise((t=>{const n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)}))}}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return(0,i.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(r.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),(0,i.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const{loadingRequests:t}=this,n={done:!1,complete:function(){for((0,i.assert)(!n.done,"completeRequest() cannot be called twice."),n.done=!0;t.length>0&&t[0].done;){const e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(n),n}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,i.shadow)(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function r(e,t,n,i){return e.substring(0,t)+i+e.substring(t+n)}let s,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=r(h,976,d.length,d);const u=1482184792;let p=n(h,16);for(s=0,a=d.length-3;s<a;s+=4)p=p-u+n(d,s)|0;s<d.length&&(p=p-u+n(d+"XXX",s)|0),h=r(h,16,4,(0,i.string32)(p));const f=`@font-face {font-family:"${d}";src:url(data:font/opentype;base64,${btoa(h)});}`;this.insertRule(f);const g=this._document.createElement("div");g.style.visibility="hidden",g.style.width=g.style.height="10px",g.style.position="absolute",g.style.top=g.style.left="0px";for(const t of[e.loadedName,d]){const e=this._document.createElement("span");e.textContent="Hi",e.style.fontFamily=t,g.append(e)}this._document.body.append(g),function e(t,n){if(++c>30)return(0,i.warn)("Load test font never loaded."),void n();l.font="30px "+t,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0?n():setTimeout(e.bind(null,t,n))}(d,(()=>{g.remove(),t.complete()}))}},t.FontFaceObject=class{constructor(e,{isEvalSupported:t=!0,disableFontFace:n=!1,ignoreErrors:i=!1,inspectFont:r=null}){this.compiledGlyphs=Object.create(null);for(const t in e)this[t]=e[t];this.isEvalSupported=!1!==t,this.disableFontFace=!0===n,this.ignoreErrors=!0===i,this._inspectFont=r}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=(0,i.bytesToString)(this.data),t=`url(data:${this.mimetype};base64,${btoa(e)});`;let n;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${t}}`}else n=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this._inspectFont?.(this,t),n}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let n;try{n=e.get(this.loadedName+"_path_"+t)}catch(e){if(!this.ignoreErrors)throw e;return(0,i.warn)(`getPathGenerator - ignoring character: "${e}".`),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&i.FeatureTest.isEvalSupported){const e=[];for(const t of n){const n=void 0!==t.args?t.args.join(","):"";e.push("c.",t.cmd,"(",n,");\n")}return this.compiledGlyphs[t]=new Function("c","size",e.join(""))}return this.compiledGlyphs[t]=function(e,t){for(const i of n)"scale"===i.cmd&&(i.args=[t,-t]),e[i.cmd].apply(e,i.args)}}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeJS=void 0;const n=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);t.isNodeJS=n},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasGraphics=void 0;var i=n(1),r=n(6),s=n(12),a=n(13),o=n(10);const l=4096,c=16;class d{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let i;return void 0!==this.cache[e]?(i=this.cache[e],this.canvasFactory.reset(i,t,n)):(i=this.canvasFactory.create(t,n),this.cache[e]=i),i}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function h(e,t,n,i,s,a,o,l,c,d){const[h,u,p,f,g,m]=(0,r.getCurrentTransform)(e);if(0===u&&0===p){const r=o*h+g,_=Math.round(r),b=l*f+m,v=Math.round(b),y=(o+c)*h+g,A=Math.abs(Math.round(y)-_)||1,x=(l+d)*f+m,S=Math.abs(Math.round(x)-v)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(f),_,v),e.drawImage(t,n,i,s,a,0,0,A,S),e.setTransform(h,u,p,f,g,m),[A,S]}if(0===h&&0===f){const r=l*p+g,_=Math.round(r),b=o*u+m,v=Math.round(b),y=(l+d)*p+g,A=Math.abs(Math.round(y)-_)||1,x=(o+c)*u+m,S=Math.abs(Math.round(x)-v)||1;return e.setTransform(0,Math.sign(u),Math.sign(p),0,_,v),e.drawImage(t,n,i,s,a,0,0,S,A),e.setTransform(h,u,p,f,g,m),[S,A]}return e.drawImage(t,n,i,s,a,o,l,c,d),[Math.hypot(h,u)*c,Math.hypot(p,f)*d]}class u{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=i.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=i.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=i.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,e,t])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,n){[t,n]=i.Util.applyTransform([t,n],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(e,t){const n=i.Util.applyTransform(t,e),r=i.Util.applyTransform(t.slice(2),e);this.minX=Math.min(this.minX,n[0],r[0]),this.minY=Math.min(this.minY,n[1],r[1]),this.maxX=Math.max(this.maxX,n[0],r[0]),this.maxY=Math.max(this.maxY,n[1],r[1])}updateScalingPathMinMax(e,t){i.Util.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.maxX=Math.max(this.maxX,t[1]),this.minY=Math.min(this.minY,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,n,r,s,a,o,l,c,d){const h=i.Util.bezierBoundingBox(t,n,r,s,a,o,l,c);if(d)return d[0]=Math.min(d[0],h[0],h[2]),d[1]=Math.max(d[1],h[0],h[2]),d[2]=Math.min(d[2],h[1],h[3]),void(d[3]=Math.max(d[3],h[1],h[3]));this.updateRectMinMax(e,h)}getPathBoundingBox(e=s.PathType.FILL,t=null){const n=[this.minX,this.minY,this.maxX,this.maxY];if(e===s.PathType.STROKE){t||(0,i.unreachable)("Stroke bounding box must include transform.");const e=i.Util.singularValueDecompose2dScale(t),r=e[0]*this.lineWidth/2,s=e[1]*this.lineWidth/2;n[0]-=r,n[1]-=s,n[2]+=r,n[3]+=s}return n}updateClipFromPath(){const e=i.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=s.PathType.FILL,t=null){return i.Util.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function p(e,t){if("undefined"!=typeof ImageData&&t instanceof ImageData)return void e.putImageData(t,0,0);const n=t.height,r=t.width,s=n%c,a=(n-s)/c,o=0===s?a:a+1,l=e.createImageData(r,c);let d,h=0;const u=t.data,p=l.data;let f,g,m,_;if(t.kind===i.ImageKind.GRAYSCALE_1BPP){const t=u.byteLength,n=new Uint32Array(p.buffer,0,p.byteLength>>2),_=n.length,b=r+7>>3,v=4294967295,y=i.FeatureTest.isLittleEndian?4278190080:255;for(f=0;f<o;f++){for(m=f<a?c:s,d=0,g=0;g<m;g++){const e=t-h;let i=0;const s=e>b?r:8*e-7,a=-8&s;let o=0,l=0;for(;i<a;i+=8)l=u[h++],n[d++]=128&l?v:y,n[d++]=64&l?v:y,n[d++]=32&l?v:y,n[d++]=16&l?v:y,n[d++]=8&l?v:y,n[d++]=4&l?v:y,n[d++]=2&l?v:y,n[d++]=1&l?v:y;for(;i<s;i++)0===o&&(l=u[h++],o=128),n[d++]=l&o?v:y,o>>=1}for(;d<_;)n[d++]=0;e.putImageData(l,0,f*c)}}else if(t.kind===i.ImageKind.RGBA_32BPP){for(g=0,_=r*c*4,f=0;f<a;f++)p.set(u.subarray(h,h+_)),h+=_,e.putImageData(l,0,g),g+=c;f<o&&(_=r*s*4,p.set(u.subarray(h,h+_)),e.putImageData(l,0,g))}else{if(t.kind!==i.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${t.kind}`);for(m=c,_=r*m,f=0;f<o;f++){for(f>=a&&(m=s,_=r*m),d=0,g=_;g--;)p[d++]=u[h++],p[d++]=u[h++],p[d++]=u[h++],p[d++]=255;e.putImageData(l,0,f*c)}}}function f(e,t){if(t.bitmap)return void e.drawImage(t.bitmap,0,0);const n=t.height,i=t.width,r=n%c,s=(n-r)/c,o=0===r?s:s+1,l=e.createImageData(i,c);let d=0;const h=t.data,u=l.data;for(let t=0;t<o;t++){const n=t<s?c:r;({srcPos:d}=(0,a.convertBlackAndWhiteToRGBA)({src:h,srcPos:d,dest:u,width:i,height:n,nonBlackColor:0})),e.putImageData(l,0,t*c)}}function g(e,t){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of n)void 0!==e[i]&&(t[i]=e[i]);void 0!==e.setLineDash&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function m(e){e.strokeStyle=e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",void 0!==e.setLineDash&&(e.setLineDash([]),e.lineDashOffset=0),o.isNodeJS||(e.filter="none")}function _(e,t,n,i){const r=e.length;for(let s=3;s<r;s+=4){const r=e[s];if(0===r)e[s-3]=t,e[s-2]=n,e[s-1]=i;else if(r<255){const a=255-r;e[s-3]=e[s-3]*r+t*a>>8,e[s-2]=e[s-2]*r+n*a>>8,e[s-1]=e[s-1]*r+i*a>>8}}}function b(e,t,n){const i=e.length;for(let r=3;r<i;r+=4){const i=n?n[e[r]]:e[r];t[r]=t[r]*i*.00392156862745098|0}}function v(e,t,n){const i=e.length;for(let r=3;r<i;r+=4){const i=77*e[r-3]+152*e[r-2]+28*e[r-1];t[r]=n?t[r]*n[i>>8]>>8:t[r]*i>>16}}function y(e,t){const n=i.Util.singularValueDecompose2dScale(e);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const s=Math.fround((globalThis.devicePixelRatio||1)*r.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==t?t:n[0]<=s||n[1]<=s}const A=["butt","round","square"],x=["miter","round","bevel"],S={},w={};class E{constructor(e,t,n,i,r,{optionalContentConfig:s,markedContentStack:a=null},o,l){this.ctx=e,this.current=new u(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=n,this.canvasFactory=i,this.filterFactory=r,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=a||[],this.optionalContentConfig=s,this.cachedCanvases=new d(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,t=null){return"string"==typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:i=null}){const s=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,s,a),this.ctx.fillStyle=o,n){const e=this.cachedCanvases.getCanvas("transparent",s,a);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...(0,r.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),m(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=(0,r.getCurrentTransform)(this.ctx)}executeOperatorList(e,t,n,r){const s=e.argsArray,a=e.fnArray;let o=t||0;const l=s.length;if(l===o)return o;const c=l-o>10&&"function"==typeof n,d=c?Date.now()+15:0;let h=0;const u=this.commonObjs,p=this.objs;let f;for(;;){if(void 0!==r&&o===r.nextBreakPoint)return r.breakIt(o,n),o;if(f=a[o],f!==i.OPS.dependency)this[f].apply(this,s[o]);else for(const e of s[o]){const t=e.startsWith("g_")?u:p;if(!t.has(e))return t.get(e,n),o}if(o++,o===l)return o;if(c&&++h>10){if(Date.now()>d)return n(),o;h=0}}}#Le(){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.#Le(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#Re()}#Re(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==e){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){const n=e.width,i=e.height;let r,s,a=Math.max(Math.hypot(t[0],t[1]),1),o=Math.max(Math.hypot(t[2],t[3]),1),l=n,c=i,d="prescale1";for(;a>2&&l>1||o>2&&c>1;){let t=l,n=c;a>2&&l>1&&(t=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/t),o>2&&c>1&&(n=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/n),r=this.cachedCanvases.getCanvas(d,t,n),s=r.context,s.clearRect(0,0,t,n),s.drawImage(e,0,0,l,c,0,0,t,n),e=r.canvas,l=t,c=n,d="prescale1"===d?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}_createMaskCanvas(e){const t=this.ctx,{width:n,height:a}=e,o=this.current.fillColor,l=this.current.patternFill,c=(0,r.getCurrentTransform)(t);let d,u,p,g;if((e.bitmap||e.data)&&e.count>1){const t=e.bitmap||e.data.buffer;u=JSON.stringify(l?c:[c.slice(0,4),o]),d=this._cachedBitmapsMap.get(t),d||(d=new Map,this._cachedBitmapsMap.set(t,d));const n=d.get(u);if(n&&!l)return{canvas:n,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])};p=n}p||(g=this.cachedCanvases.getCanvas("maskCanvas",n,a),f(g.context,e));let m=i.Util.transform(c,[1/n,0,0,-1/a,0,0]);m=i.Util.transform(m,[1,0,0,1,0,-a]);const _=i.Util.applyTransform([0,0],m),b=i.Util.applyTransform([n,a],m),v=i.Util.normalizeRect([_[0],_[1],b[0],b[1]]),A=Math.round(v[2]-v[0])||1,x=Math.round(v[3]-v[1])||1,S=this.cachedCanvases.getCanvas("fillCanvas",A,x),w=S.context,E=Math.min(_[0],b[0]),P=Math.min(_[1],b[1]);w.translate(-E,-P),w.transform(...m),p||(p=this._scaleImage(g.canvas,(0,r.getCurrentTransformInverse)(w)),p=p.img,d&&l&&d.set(u,p)),w.imageSmoothingEnabled=y((0,r.getCurrentTransform)(w),e.interpolate),h(w,p,0,0,p.width,p.height,0,0,n,a),w.globalCompositeOperation="source-in";const C=i.Util.transform((0,r.getCurrentTransformInverse)(w),[1,0,0,1,-E,-P]);return w.fillStyle=l?o.getPattern(t,this,C,s.PathType.FILL):o,w.fillRect(0,0,n,a),d&&!l&&(this.cachedCanvases.delete("fillCanvas"),d.set(u,S.canvas)),{canvas:S.canvas,offsetX:Math.round(E),offsetY:Math.round(P)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=A[e]}setLineJoin(e){this.ctx.lineJoin=x[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(e),n.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){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 e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(n,e,t);this.suspendedCtx=this.ctx,this.ctx=i.context;const s=this.ctx;s.setTransform(...(0,r.getCurrentTransform)(this.suspendedCtx)),g(this.suspendedCtx,s),function(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,i,r,s,a){t.transform(e,n,i,r,s,a),this.__originalTransform(e,n,i,r,s,a)},e.setTransform=function(e,n,i,r,s,a){t.setTransform(e,n,i,r,s,a),this.__originalSetTransform(e,n,i,r,s,a)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,i,r,s,a){t.bezierCurveTo(e,n,i,r,s,a),this.__originalBezierCurveTo(e,n,i,r,s,a)},e.rect=function(e,n,i,r){t.rect(e,n,i,r),this.__originalRect(e,n,i,r)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(s,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(),g(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask;(function(e,t,n,i){const r=i[0],s=i[1],a=i[2]-r,o=i[3]-s;0!==a&&0!==o&&(function(e,t,n,i,r,s,a,o,l,c,d){const h=!!s,u=h?s[0]:0,p=h?s[1]:0,f=h?s[2]:0;let g;g="Luminosity"===r?v:b;const m=Math.min(i,Math.ceil(1048576/n));for(let r=0;r<i;r+=m){const s=Math.min(m,i-r),b=e.getImageData(o-c,r+(l-d),n,s),v=t.getImageData(o,r+l,n,s);h&&_(b.data,u,p,f),g(b.data,v.data,a),t.putImageData(v,o,r+l)}}(t.context,n,a,o,t.subtype,t.backdrop,t.transferMap,r,s,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,0,0),e.restore())})(this.suspendedCtx,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(g(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),g(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,t,n,i,r,s){this.ctx.transform(e,t,n,i,r,s),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n){const s=this.ctx,a=this.current;let o,l,c=a.x,d=a.y;const h=(0,r.getCurrentTransform)(s),u=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],p=u?n.slice(0):null;for(let n=0,r=0,f=e.length;n<f;n++)switch(0|e[n]){case i.OPS.rectangle:c=t[r++],d=t[r++];const e=t[r++],n=t[r++],f=c+e,g=d+n;s.moveTo(c,d),0===e||0===n?s.lineTo(f,g):(s.lineTo(f,d),s.lineTo(f,g),s.lineTo(c,g)),u||a.updateRectMinMax(h,[c,d,f,g]),s.closePath();break;case i.OPS.moveTo:c=t[r++],d=t[r++],s.moveTo(c,d),u||a.updatePathMinMax(h,c,d);break;case i.OPS.lineTo:c=t[r++],d=t[r++],s.lineTo(c,d),u||a.updatePathMinMax(h,c,d);break;case i.OPS.curveTo:o=c,l=d,c=t[r+4],d=t[r+5],s.bezierCurveTo(t[r],t[r+1],t[r+2],t[r+3],c,d),a.updateCurvePathMinMax(h,o,l,t[r],t[r+1],t[r+2],t[r+3],c,d,p),r+=6;break;case i.OPS.curveTo2:o=c,l=d,s.bezierCurveTo(c,d,t[r],t[r+1],t[r+2],t[r+3]),a.updateCurvePathMinMax(h,o,l,c,d,t[r],t[r+1],t[r+2],t[r+3],p),c=t[r+2],d=t[r+3],r+=4;break;case i.OPS.curveTo3:o=c,l=d,c=t[r+2],d=t[r+3],s.bezierCurveTo(t[r],t[r+1],c,d,c,d),a.updateCurvePathMinMax(h,o,l,t[r],t[r+1],c,d,c,d,p),r+=4;break;case i.OPS.closePath:s.closePath()}u&&a.updateScalingPathMinMax(h,p),a.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(e=!0){const t=this.ctx,n=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof n&&n?.getPattern?(t.save(),t.strokeStyle=n.getPattern(t,this,(0,r.getCurrentTransformInverse)(t),s.PathType.STROKE),this.rescaleAndStroke(!1),t.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){const t=this.ctx,n=this.current.fillColor;let i=!1;this.current.patternFill&&(t.save(),t.fillStyle=n.getPattern(t,this,(0,r.getCurrentTransformInverse)(t),s.PathType.FILL),i=!0);const a=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==a&&(this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill()),i&&t.restore(),e&&this.consumePath(a)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=S}eoClip(){this.pendingClip=w}beginText(){this.current.textMatrix=i.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,t=this.ctx;if(void 0!==e){t.save(),t.beginPath();for(const n of e)t.setTransform(...n.transform),t.translate(n.x,n.y),n.addToPath(t,n.fontSize);t.restore(),t.clip(),t.beginPath(),delete this.pendingTextPaths}else t.beginPath()}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){const n=this.commonObjs.get(e),r=this.current;if(!n)throw new Error(`Can't find font for ${e}`);if(r.fontMatrix=n.fontMatrix||i.FONT_IDENTITY_MATRIX,0!==r.fontMatrix[0]&&0!==r.fontMatrix[3]||(0,i.warn)("Invalid font matrix for font "+e),t<0?(t=-t,r.fontDirection=-1):r.fontDirection=1,this.current.font=n,this.current.fontSize=t,n.isType3Font)return;const s=n.loadedName||"sans-serif",a=n.systemFontInfo?.css||`"${s}", ${n.fallbackName}`;let o="normal";n.black?o="900":n.bold&&(o="bold");const l=n.italic?"italic":"normal";let c=t;t<16?c=16:t>100&&(c=100),this.current.fontSizeScale=t/c,this.ctx.font=`${l} ${o} ${c}px ${a}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,n,i,r,s){this.current.textMatrix=[e,t,n,i,r,s],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,n,s){const a=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,h=c&i.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&i.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;let f;(l.disableFontFace||u||p)&&(f=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||p?(a.save(),a.translate(t,n),a.beginPath(),f(a,d),s&&a.setTransform(...s),h!==i.TextRenderingMode.FILL&&h!==i.TextRenderingMode.FILL_STROKE||a.fill(),h!==i.TextRenderingMode.STROKE&&h!==i.TextRenderingMode.FILL_STROKE||a.stroke(),a.restore()):(h!==i.TextRenderingMode.FILL&&h!==i.TextRenderingMode.FILL_STROKE||a.fillText(e,t,n),h!==i.TextRenderingMode.STROKE&&h!==i.TextRenderingMode.FILL_STROKE||a.strokeText(e,t,n)),u&&(this.pendingTextPaths||=[]).push({transform:(0,r.getCurrentTransform)(a),x:t,y:n,fontSize:d,addToPath:f})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let n=!1;for(let e=3;e<t.length;e+=4)if(t[e]>0&&t[e]<255){n=!0;break}return(0,i.shadow)(this,"isFontSubpixelAAEnabled",n)}showText(e){const t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);const a=t.fontSize;if(0===a)return;const o=this.ctx,l=t.fontSizeScale,c=t.charSpacing,d=t.wordSpacing,h=t.fontDirection,u=t.textHScale*h,p=e.length,f=n.vertical,g=f?1:-1,m=n.defaultVMetrics,_=a*t.fontMatrix[0],b=t.textRenderingMode===i.TextRenderingMode.FILL&&!n.disableFontFace&&!t.patternFill;let v;if(o.save(),o.transform(...t.textMatrix),o.translate(t.x,t.y+t.textRise),h>0?o.scale(u,-1):o.scale(u,1),t.patternFill){o.save();const e=t.fillColor.getPattern(o,this,(0,r.getCurrentTransformInverse)(o),s.PathType.FILL);v=(0,r.getCurrentTransform)(o),o.restore(),o.fillStyle=e}let y=t.lineWidth;const A=t.textMatrixScale;if(0===A||0===y){const e=t.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;e!==i.TextRenderingMode.STROKE&&e!==i.TextRenderingMode.FILL_STROKE||(y=this.getSinglePixelWidth())}else y/=A;if(1!==l&&(o.scale(l,l),y/=l),o.lineWidth=y,n.isInvalidPDFjsFont){const n=[];let i=0;for(const t of e)n.push(t.unicode),i+=t.width;return o.fillText(n.join(""),0,0),t.x+=i*_*u,o.restore(),void this.compose()}let x,S=0;for(x=0;x<p;++x){const t=e[x];if("number"==typeof t){S+=g*t*a/1e3;continue}let i=!1;const r=(t.isSpace?d:0)+c,s=t.fontChar,u=t.accent;let p,y,A,w=t.width;if(f){const e=t.vmetric||m,n=-(t.vmetric?e[1]:.5*w)*_,i=e[2]*_;w=e?-e[0]:w,p=n/l,y=(S+i)/l}else p=S/l,y=0;if(n.remeasure&&w>0){const e=1e3*o.measureText(s).width/a*l;if(w<e&&this.isFontSubpixelAAEnabled){const t=w/e;i=!0,o.save(),o.scale(t,1),p/=t}else w!==e&&(p+=(w-e)/2e3*a/l)}if(this.contentVisible&&(t.isInFont||n.missingFile))if(b&&!u)o.fillText(s,p,y);else if(this.paintChar(s,p,y,v),u){const e=p+a*u.offset.x/l,t=y-a*u.offset.y/l;this.paintChar(u.fontChar,e,t,v)}A=f?w*_-r*h:w*_+r*h,S+=A,i&&o.restore()}f?t.y-=S:t.x+=S*u,o.restore(),this.compose()}showType3Text(e){const t=this.ctx,n=this.current,r=n.font,s=n.fontSize,a=n.fontDirection,o=r.vertical?1:-1,l=n.charSpacing,c=n.wordSpacing,d=n.textHScale*a,h=n.fontMatrix||i.FONT_IDENTITY_MATRIX,u=e.length;let p,f,g,m;if(n.textRenderingMode!==i.TextRenderingMode.INVISIBLE&&0!==s){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,t.save(),t.transform(...n.textMatrix),t.translate(n.x,n.y),t.scale(d,a),p=0;p<u;++p){if(f=e[p],"number"==typeof f){m=o*f*s/1e3,this.ctx.translate(m,0),n.x+=m*d;continue}const a=(f.isSpace?c:0)+l,u=r.charProcOperatorList[f.operatorListId];u?(this.contentVisible&&(this.processingType3=f,this.save(),t.scale(s,s),t.transform(...h),this.executeOperatorList(u),this.restore()),g=i.Util.applyTransform([f.width,0],h)[0]*s+a,t.translate(g,0),n.x+=g*d):(0,i.warn)(`Type3 character "${f.operatorListId}" is not available.`)}t.restore(),this.processingType3=null}}setCharWidth(e,t){}setCharWidthAndBounds(e,t,n,i,r,s){this.ctx.rect(n,i,r-n,s-i),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let t;if("TilingPattern"===e[0]){const n=e[1],i=this.baseTransform||(0,r.getCurrentTransform)(this.ctx),a={createCanvasGraphics:e=>new E(e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new s.TilingPattern(e,n,this.ctx,a,i)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,n){const r=i.Util.makeHexColor(e,t,n);this.ctx.strokeStyle=r,this.current.strokeColor=r}setFillRGBColor(e,t,n){const r=i.Util.makeHexColor(e,t,n);this.ctx.fillStyle=r,this.current.fillColor=r,this.current.patternFill=!1}_getPattern(e,t=null){let n;return this.cachedPatterns.has(e)?n=this.cachedPatterns.get(e):(n=(0,s.getShadingPattern)(this.getObject(e)),this.cachedPatterns.set(e,n)),t&&(n.matrix=t),n}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,(0,r.getCurrentTransformInverse)(t),s.PathType.SHADING);const a=(0,r.getCurrentTransformInverse)(t);if(a){const{width:e,height:n}=t.canvas,[r,s,o,l]=i.Util.getAxialAlignedBoundingBox([0,0,e,n],a);this.ctx.fillRect(r,s,o-r,l-s)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,i.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,i.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform(...e),this.baseTransform=(0,r.getCurrentTransform)(this.ctx),t)){const e=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],e,n),this.current.updateRectMinMax((0,r.getCurrentTransform)(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;e.isolated||(0,i.info)("TODO: Support non-isolated groups."),e.knockout&&(0,i.warn)("Knockout groups not supported.");const n=(0,r.getCurrentTransform)(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let s=i.Util.getAxialAlignedBoundingBox(e.bbox,(0,r.getCurrentTransform)(t));const a=[0,0,t.canvas.width,t.canvas.height];s=i.Util.intersect(s,a)||[0,0,0,0];const o=Math.floor(s[0]),c=Math.floor(s[1]);let d=Math.max(Math.ceil(s[2])-o,1),h=Math.max(Math.ceil(s[3])-c,1),u=1,p=1;d>l&&(u=d/l,d=l),h>l&&(p=h/l,h=l),this.current.startNewPathAndClipBox([0,0,d,h]);let f="groupAt"+this.groupLevel;e.smask&&(f+="_smask_"+this.smaskCounter++%2);const m=this.cachedCanvases.getCanvas(f,d,h),_=m.context;_.scale(1/u,1/p),_.translate(-o,-c),_.transform(...n),e.smask?this.smaskStack.push({canvas:m.canvas,context:_,offsetX:o,offsetY:c,scaleX:u,scaleY:p,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(o,c),t.scale(u,p),t.save()),g(t,_),this.ctx=_,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const e=(0,r.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...e);const n=i.Util.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,t,n,s,a){if(this.#Le(),m(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(t)&&4===t.length){const s=t[2]-t[0],o=t[3]-t[1];if(a&&this.annotationCanvasMap){(n=n.slice())[4]-=t[0],n[5]-=t[1],(t=t.slice())[0]=t[1]=0,t[2]=s,t[3]=o;const[a,l]=i.Util.singularValueDecompose2dScale((0,r.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,d=Math.ceil(s*this.outputScaleX*c),h=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,h);const{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(e,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(a,0,0,-l,0,o*l),m(this.ctx)}else m(this.ctx),this.ctx.rect(t[0],t[1],s,o),this.ctx.clip(),this.endPath()}this.current=new u(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...s)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#Re(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;(e=this.getObject(e.data,e)).count=t;const n=this.ctx,i=this.processingType3;if(i&&(void 0===i.compiled&&(i.compiled=function(e){const{width:t,height:n}=e;if(t>1e3||n>1e3)return null;const i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),r=t+1;let s,a,o,l=new Uint8Array(r*(n+1));const c=t+7&-8;let d=new Uint8Array(c*n),h=0;for(const t of e.data){let e=128;for(;e>0;)d[h++]=t&e?0:255,e>>=1}let u=0;for(h=0,0!==d[h]&&(l[0]=1,++u),a=1;a<t;a++)d[h]!==d[h+1]&&(l[a]=d[h]?2:1,++u),h++;for(0!==d[h]&&(l[a]=2,++u),s=1;s<n;s++){h=s*c,o=s*r,d[h-c]!==d[h]&&(l[o]=d[h]?1:8,++u);let e=(d[h]?4:0)+(d[h-c]?8:0);for(a=1;a<t;a++)e=(e>>2)+(d[h+1]?4:0)+(d[h-c+1]?8:0),i[e]&&(l[o+a]=i[e],++u),h++;if(d[h-c]!==d[h]&&(l[o+a]=d[h]?2:4,++u),u>1e3)return null}for(h=c*(n-1),o=s*r,0!==d[h]&&(l[o]=8,++u),a=1;a<t;a++)d[h]!==d[h+1]&&(l[o+a]=d[h]?4:8,++u),h++;if(0!==d[h]&&(l[o+a]=4,++u),u>1e3)return null;const p=new Int32Array([0,r,-1,0,-r,0,0,0,1]),f=new Path2D;for(s=0;u&&s<=n;s++){let e=s*r;const n=e+t;for(;e<n&&!l[e];)e++;if(e===n)continue;f.moveTo(e%r,s);const i=e;let a=l[e];do{const t=p[a];do{e+=t}while(!l[e]);const n=l[e];5!==n&&10!==n?(a=n,l[e]=0):(a=n&51*a>>4,l[e]&=a>>2|a<<2),f.lineTo(e%r,e/r|0),l[e]||--u}while(i!==e);--s}return d=null,l=null,function(e){e.save(),e.scale(1/t,-1/n),e.translate(0,-n),e.fill(f),e.beginPath(),e.restore()}}(e)),i.compiled))return void i.compiled(n);const r=this._createMaskCanvas(e),s=r.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(s,r.offsetX,r.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,n=0,s=0,a,o){if(!this.contentVisible)return;e=this.getObject(e.data,e);const l=this.ctx;l.save();const c=(0,r.getCurrentTransform)(l);l.transform(t,n,s,a,0,0);const d=this._createMaskCanvas(e);l.setTransform(1,0,0,1,d.offsetX-c[4],d.offsetY-c[5]);for(let e=0,r=o.length;e<r;e+=2){const r=i.Util.transform(c,[t,n,s,a,o[e],o[e+1]]),[h,u]=i.Util.applyTransform([0,0],r);l.drawImage(d.canvas,h,u)}l.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const t=this.ctx,n=this.current.fillColor,i=this.current.patternFill;for(const a of e){const{data:e,width:o,height:l,transform:c}=a,d=this.cachedCanvases.getCanvas("maskCanvas",o,l),u=d.context;u.save(),f(u,this.getObject(e,a)),u.globalCompositeOperation="source-in",u.fillStyle=i?n.getPattern(u,this,(0,r.getCurrentTransformInverse)(t),s.PathType.FILL):n,u.fillRect(0,0,o,l),u.restore(),t.save(),t.transform(...c),t.scale(1,-1),h(t,d.canvas,0,0,o,l,0,-1,1,1),t.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const t=this.getObject(e);t?this.paintInlineImageXObject(t):(0,i.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(e,t,n,r){if(!this.contentVisible)return;const s=this.getObject(e);if(!s)return void(0,i.warn)("Dependent image isn't ready yet");const a=s.width,o=s.height,l=[];for(let e=0,i=r.length;e<i;e+=2)l.push({transform:[t,0,0,n,r[e],r[e+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(s,l)}applyTransferMapsToCanvas(e){return"none"!==this.current.transferMaps&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if("none"===this.current.transferMaps)return e.bitmap;const{bitmap:t,width:n,height:i}=e,r=this.cachedCanvases.getCanvas("inlineImage",n,i),s=r.context;return s.filter=this.current.transferMaps,s.drawImage(t,0,0),s.filter="none",r.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const t=e.width,n=e.height,i=this.ctx;let s;if(this.save(),o.isNodeJS||(i.filter="none"),i.scale(1/t,-1/n),e.bitmap)s=this.applyTransferMapsToBitmap(e);else if("function"==typeof HTMLElement&&e instanceof HTMLElement||!e.data)s=e;else{const i=this.cachedCanvases.getCanvas("inlineImage",t,n).context;p(i,e),s=this.applyTransferMapsToCanvas(i)}const a=this._scaleImage(s,(0,r.getCurrentTransformInverse)(i));i.imageSmoothingEnabled=y((0,r.getCurrentTransform)(i),e.interpolate),h(i,a.img,0,0,a.paintWidth,a.paintHeight,0,-n,t,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,t){if(!this.contentVisible)return;const n=this.ctx;let i;if(e.bitmap)i=e.bitmap;else{const t=e.width,n=e.height,r=this.cachedCanvases.getCanvas("inlineImage",t,n).context;p(r,e),i=this.applyTransferMapsToCanvas(r)}for(const e of t)n.save(),n.transform(...e.transform),n.scale(1,-1),h(n,i,e.x,e.y,e.w,e.h,0,-1,1,1),n.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,t){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t){"OC"===e?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(t)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){const t=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const n=this.ctx;this.pendingClip&&(t||(this.pendingClip===w?n.clip("evenodd"):n.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),n.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=(0,r.getCurrentTransform)(this.ctx);if(0===e[1]&&0===e[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const t=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),i=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(n,i)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:e}=this.current,{a:t,b:n,c:i,d:r}=this.ctx.getTransform();let s,a;if(0===n&&0===i){const n=Math.abs(t),i=Math.abs(r);if(n===i)if(0===e)s=a=1/n;else{const t=n*e;s=a=t<1?1/t:1}else if(0===e)s=1/n,a=1/i;else{const t=n*e,r=i*e;s=t<1?1/t:1,a=r<1?1/r:1}}else{const o=Math.abs(t*r-n*i),l=Math.hypot(t,n),c=Math.hypot(i,r);if(0===e)s=c/o,a=l/o;else{const t=e*o;s=c>t?c/t:1,a=l>t?l/t:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:n}=this.current,[i,r]=this.getScaleForStroking();if(t.lineWidth=n||1,1===i&&1===r)return void t.stroke();const s=t.getLineDash();if(e&&t.save(),t.scale(i,r),s.length>0){const e=Math.max(i,r);t.setLineDash(s.map((t=>t/e))),t.lineDashOffset/=e}t.stroke(),e&&t.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}t.CanvasGraphics=E;for(const e in i.OPS)void 0!==E.prototype[e]&&(E.prototype[i.OPS[e]]=E.prototype[e])},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TilingPattern=t.PathType=void 0,t.getShadingPattern=function(e){switch(e[0]){case"RadialAxial":return new l(e);case"Mesh":return new h(e);case"Dummy":return new u}throw new Error(`Unknown IR type: ${e[0]}`)};var i=n(1),r=n(6);const s={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function a(e,t){if(!t)return;const n=t[2]-t[0],i=t[3]-t[1],r=new Path2D;r.rect(t[0],t[1],n,i),e.clip(r)}t.PathType=s;class o{constructor(){this.constructor===o&&(0,i.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,i.unreachable)("Abstract method `getPattern` called.")}}class l extends o{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,n,o){let l;if(o===s.STROKE||o===s.FILL){const s=t.current.getClippedPathBoundingBox(o,(0,r.getCurrentTransform)(e))||[0,0,0,0],c=Math.ceil(s[2]-s[0])||1,d=Math.ceil(s[3]-s[1])||1,h=t.cachedCanvases.getCanvas("pattern",c,d,!0),u=h.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-s[0],-s[1]),n=i.Util.transform(n,[1,0,0,1,s[0],s[1]]),u.transform(...t.baseTransform),this.matrix&&u.transform(...this.matrix),a(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),l=e.createPattern(h.canvas,"no-repeat");const p=new DOMMatrix(n);l.setTransform(p)}else a(e,this._bbox),l=this._createGradient(e);return l}}function c(e,t,n,i,r,s,a,o){const l=t.coords,c=t.colors,d=e.data,h=4*e.width;let u;l[n+1]>l[i+1]&&(u=n,n=i,i=u,u=s,s=a,a=u),l[i+1]>l[r+1]&&(u=i,i=r,r=u,u=a,a=o,o=u),l[n+1]>l[i+1]&&(u=n,n=i,i=u,u=s,s=a,a=u);const p=(l[n]+t.offsetX)*t.scaleX,f=(l[n+1]+t.offsetY)*t.scaleY,g=(l[i]+t.offsetX)*t.scaleX,m=(l[i+1]+t.offsetY)*t.scaleY,_=(l[r]+t.offsetX)*t.scaleX,b=(l[r+1]+t.offsetY)*t.scaleY;if(f>=b)return;const v=c[s],y=c[s+1],A=c[s+2],x=c[a],S=c[a+1],w=c[a+2],E=c[o],P=c[o+1],C=c[o+2],k=Math.round(f),T=Math.round(b);let M,L,R,I,F,D,O,N;for(let e=k;e<=T;e++){if(e<m){let t;t=e<f?0:(f-e)/(f-m),M=p-(p-g)*t,L=v-(v-x)*t,R=y-(y-S)*t,I=A-(A-w)*t}else{let t;t=e>b?1:m===b?0:(m-e)/(m-b),M=g-(g-_)*t,L=x-(x-E)*t,R=S-(S-P)*t,I=w-(w-C)*t}let t;t=e<f?0:e>b?1:(f-e)/(f-b),F=p-(p-_)*t,D=v-(v-E)*t,O=y-(y-P)*t,N=A-(A-C)*t;const n=Math.round(Math.min(M,F)),i=Math.round(Math.max(M,F));let r=h*e+4*n;for(let e=n;e<=i;e++)t=(M-e)/(M-F),t<0?t=0:t>1&&(t=1),d[r++]=L-(L-D)*t|0,d[r++]=R-(R-O)*t|0,d[r++]=I-(I-N)*t|0,d[r++]=255}}function d(e,t,n){const i=t.coords,r=t.colors;let s,a;switch(t.type){case"lattice":const o=t.verticesPerRow,l=Math.floor(i.length/o)-1,d=o-1;for(s=0;s<l;s++){let t=s*o;for(let s=0;s<d;s++,t++)c(e,n,i[t],i[t+1],i[t+o],r[t],r[t+1],r[t+o]),c(e,n,i[t+o+1],i[t+1],i[t+o],r[t+o+1],r[t+1],r[t+o])}break;case"triangles":for(s=0,a=i.length;s<a;s+=3)c(e,n,i[s],i[s+1],i[s+2],r[s],r[s+1],r[s+2]);break;default:throw new Error("illegal figure")}}class h extends o{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(e,t,n){const i=Math.floor(this._bounds[0]),r=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-i,a=Math.ceil(this._bounds[3])-r,o=Math.min(Math.ceil(Math.abs(s*e[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(a*e[1]*1.1)),3e3),c=s/o,h=a/l,u={coords:this._coords,colors:this._colors,offsetX:-i,offsetY:-r,scaleX:1/c,scaleY:1/h},p=o+4,f=l+4,g=n.getCanvas("mesh",p,f,!1),m=g.context,_=m.createImageData(o,l);if(t){const e=_.data;for(let n=0,i=e.length;n<i;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2],e[n+3]=255}for(const e of this._figures)d(_,e,u);return m.putImageData(_,2,2),{canvas:g.canvas,offsetX:i-2*c,offsetY:r-2*h,scaleX:c,scaleY:h}}getPattern(e,t,n,o){let l;if(a(e,this._bbox),o===s.SHADING)l=i.Util.singularValueDecompose2dScale((0,r.getCurrentTransform)(e));else if(l=i.Util.singularValueDecompose2dScale(t.baseTransform),this.matrix){const e=i.Util.singularValueDecompose2dScale(this.matrix);l=[l[0]*e[0],l[1]*e[1]]}const c=this._createMeshCanvas(l,o===s.SHADING?null:this._background,t.cachedCanvases);return o!==s.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(c.offsetX,c.offsetY),e.scale(c.scaleX,c.scaleY),e.createPattern(c.canvas,"no-repeat")}}class u extends o{getPattern(){return"hotpink"}}class p{static MAX_PATTERN_SIZE=3e3;constructor(e,t,n,i,r){this.operatorList=e[2],this.matrix=e[3]||[1,0,0,1,0,0],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=t,this.ctx=n,this.canvasGraphicsFactory=i,this.baseTransform=r}createPatternCanvas(e){const t=this.operatorList,n=this.bbox,s=this.xstep,a=this.ystep,o=this.paintType,l=this.tilingType,c=this.color,d=this.canvasGraphicsFactory;(0,i.info)("TilingType: "+l);const h=n[0],u=n[1],p=n[2],f=n[3],g=i.Util.singularValueDecompose2dScale(this.matrix),m=i.Util.singularValueDecompose2dScale(this.baseTransform),_=[g[0]*m[0],g[1]*m[1]],b=this.getSizeAndScale(s,this.ctx.canvas.width,_[0]),v=this.getSizeAndScale(a,this.ctx.canvas.height,_[1]),y=e.cachedCanvases.getCanvas("pattern",b.size,v.size,!0),A=y.context,x=d.createCanvasGraphics(A);x.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(x,o,c);let S=h,w=u,E=p,P=f;return h<0&&(S=0,E+=Math.abs(h)),u<0&&(w=0,P+=Math.abs(u)),A.translate(-b.scale*S,-v.scale*w),x.transform(b.scale,0,0,v.scale,0,0),A.save(),this.clipBbox(x,S,w,E,P),x.baseTransform=(0,r.getCurrentTransform)(x.ctx),x.executeOperatorList(t),x.endDrawing(),{canvas:y.canvas,scaleX:b.scale,scaleY:v.scale,offsetX:S,offsetY:w}}getSizeAndScale(e,t,n){e=Math.abs(e);const i=Math.max(p.MAX_PATTERN_SIZE,t);let r=Math.ceil(e*n);return r>=i?r=i:n=r/e,{scale:n,size:r}}clipBbox(e,t,n,i,s){const a=i-t,o=s-n;e.ctx.rect(t,n,a,o),e.current.updateRectMinMax((0,r.getCurrentTransform)(e.ctx),[t,n,i,s]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){const r=e.ctx,s=e.current;switch(t){case 1:const e=this.ctx;r.fillStyle=e.fillStyle,r.strokeStyle=e.strokeStyle,s.fillColor=e.fillStyle,s.strokeColor=e.strokeStyle;break;case 2:const a=i.Util.makeHexColor(n[0],n[1],n[2]);r.fillStyle=a,r.strokeStyle=a,s.fillColor=a,s.strokeColor=a;break;default:throw new i.FormatError(`Unsupported paint type: ${t}`)}}getPattern(e,t,n,r){let a=n;r!==s.SHADING&&(a=i.Util.transform(a,t.baseTransform),this.matrix&&(a=i.Util.transform(a,this.matrix)));const o=this.createPatternCanvas(t);let l=new DOMMatrix(a);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const c=e.createPattern(o.canvas,"repeat");return c.setTransform(l),c}}t.TilingPattern=p},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertBlackAndWhiteToRGBA=r,t.convertToRGBA=function(e){switch(e.kind){case i.ImageKind.GRAYSCALE_1BPP:return r(e);case i.ImageKind.RGB_24BPP:return function({src:e,srcPos:t=0,dest:n,destPos:r=0,width:s,height:a}){let o=0;const l=e.length>>2,c=new Uint32Array(e.buffer,t,l);if(i.FeatureTest.isLittleEndian){for(;o<l-2;o+=3,r+=4){const e=c[o],t=c[o+1],i=c[o+2];n[r]=4278190080|e,n[r+1]=e>>>24|t<<8|4278190080,n[r+2]=t>>>16|i<<16|4278190080,n[r+3]=i>>>8|4278190080}for(let t=4*o,i=e.length;t<i;t+=3)n[r++]=e[t]|e[t+1]<<8|e[t+2]<<16|4278190080}else{for(;o<l-2;o+=3,r+=4){const e=c[o],t=c[o+1],i=c[o+2];n[r]=255|e,n[r+1]=e<<24|t>>>8|255,n[r+2]=t<<16|i>>>16|255,n[r+3]=i<<8|255}for(let t=4*o,i=e.length;t<i;t+=3)n[r++]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|255}return{srcPos:t,destPos:r}}(e)}return null},t.grayToRGBA=function(e,t){if(i.FeatureTest.isLittleEndian)for(let n=0,i=e.length;n<i;n++)t[n]=65793*e[n]|4278190080;else for(let n=0,i=e.length;n<i;n++)t[n]=16843008*e[n]|255};var i=n(1);function r({src:e,srcPos:t=0,dest:n,width:r,height:s,nonBlackColor:a=4294967295,inverseDecode:o=!1}){const l=i.FeatureTest.isLittleEndian?4278190080:255,[c,d]=o?[a,l]:[l,a],h=r>>3,u=7&r,p=e.length;n=new Uint32Array(n.buffer);let f=0;for(let i=0;i<s;i++){for(const i=t+h;t<i;t++){const i=t<p?e[t]:255;n[f++]=128&i?d:c,n[f++]=64&i?d:c,n[f++]=32&i?d:c,n[f++]=16&i?d:c,n[f++]=8&i?d:c,n[f++]=4&i?d:c,n[f++]=2&i?d:c,n[f++]=1&i?d:c}if(0===u)continue;const i=t<p?e[t++]:255;for(let e=0;e<u;e++)n[f++]=i&1<<7-e?d:c}return{srcPos:t,destPos:f}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;const n=Object.create(null);t.GlobalWorkerOptions=n,n.workerPort=null,n.workerSrc=""},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;var i=n(1);function r(e){switch(e instanceof Error||"object"==typeof e&&null!==e||(0,i.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new i.AbortException(e.message);case"MissingPDFException":return new i.MissingPDFException(e.message);case"PasswordException":return new i.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new i.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new i.UnknownErrorException(e.message,e.details);default:return new i.UnknownErrorException(e.message,e.toString())}}t.MessageHandler=class{constructor(e,t,n){this.sourceName=e,this.targetName=t,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=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#Ie(t);if(t.callback){const e=t.callbackId,n=this.callbackCapabilities[e];if(!n)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],1===t.callback)n.resolve(t.data);else{if(2!==t.callback)throw new Error("Unexpected callback case");n.reject(r(t.reason))}return}const i=this.actionHandler[t.action];if(!i)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,s=t.sourceName;new Promise((function(e){e(i(t.data))})).then((function(i){n.postMessage({sourceName:e,targetName:s,callback:1,callbackId:t.callbackId,data:i})}),(function(i){n.postMessage({sourceName:e,targetName:s,callback:2,callbackId:t.callbackId,reason:r(i)})}))}else t.streamId?this.#Fe(t):i(t.data)},n.addEventListener("message",this._onComObjOnMessage)}on(e,t){const n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){const r=this.callbackId++,s=new i.PromiseCapability;this.callbackCapabilities[r]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},n)}catch(e){s.reject(e)}return s.promise}sendWithStream(e,t,n,s){const a=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:n=>{const r=new i.PromiseCapability;return this.streamControllers[a]={controller:n,startCall:r,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:o,targetName:l,action:e,streamId:a,data:t,desiredSize:n.desiredSize},s),r.promise},pull:e=>{const t=new i.PromiseCapability;return this.streamControllers[a].pullCall=t,c.postMessage({sourceName:o,targetName:l,stream:6,streamId:a,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,i.assert)(e instanceof Error,"cancel must have a valid reason");const t=new i.PromiseCapability;return this.streamControllers[a].cancelCall=t,this.streamControllers[a].isClosed=!0,c.postMessage({sourceName:o,targetName:l,stream:1,streamId:a,reason:r(e)}),t.promise}},n)}#Fe(e){const t=e.streamId,n=this.sourceName,s=e.sourceName,a=this.comObj,o=this,l=this.actionHandler[e.action],c={enqueue(e,r=1,o){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=r,l>0&&this.desiredSize<=0&&(this.sinkCapability=new i.PromiseCapability,this.ready=this.sinkCapability.promise),a.postMessage({sourceName:n,targetName:s,stream:4,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:n,targetName:s,stream:3,streamId:t}),delete o.streamSinks[t])},error(e){(0,i.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:n,targetName:s,stream:5,streamId:t,reason:r(e)}))},sinkCapability:new i.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[t]=c,new Promise((function(t){t(l(e.data,c))})).then((function(){a.postMessage({sourceName:n,targetName:s,stream:8,streamId:t,success:!0})}),(function(e){a.postMessage({sourceName:n,targetName:s,stream:8,streamId:t,reason:r(e)})}))}#Ie(e){const t=e.streamId,n=this.sourceName,s=e.sourceName,a=this.comObj,o=this.streamControllers[t],l=this.streamSinks[t];switch(e.stream){case 8:e.success?o.startCall.resolve():o.startCall.reject(r(e.reason));break;case 7:e.success?o.pullCall.resolve():o.pullCall.reject(r(e.reason));break;case 6:if(!l){a.postMessage({sourceName:n,targetName:s,stream:7,streamId:t,success:!0});break}l.desiredSize<=0&&e.desiredSize>0&&l.sinkCapability.resolve(),l.desiredSize=e.desiredSize,new Promise((function(e){e(l.onPull?.())})).then((function(){a.postMessage({sourceName:n,targetName:s,stream:7,streamId:t,success:!0})}),(function(e){a.postMessage({sourceName:n,targetName:s,stream:7,streamId:t,reason:r(e)})}));break;case 4:if((0,i.assert)(o,"enqueue should have stream controller"),o.isClosed)break;o.controller.enqueue(e.chunk);break;case 3:if((0,i.assert)(o,"close should have stream controller"),o.isClosed)break;o.isClosed=!0,o.controller.close(),this.#De(o,t);break;case 5:(0,i.assert)(o,"error should have stream controller"),o.controller.error(r(e.reason)),this.#De(o,t);break;case 2:e.success?o.cancelCall.resolve():o.cancelCall.reject(r(e.reason)),this.#De(o,t);break;case 1:if(!l)break;new Promise((function(t){t(l.onCancel?.(r(e.reason)))})).then((function(){a.postMessage({sourceName:n,targetName:s,stream:2,streamId:t,success:!0})}),(function(e){a.postMessage({sourceName:n,targetName:s,stream:2,streamId:t,reason:r(e)})})),l.sinkCapability.reject(r(e.reason)),l.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async#De(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var i=n(1);t.Metadata=class{#Oe;#Ne;constructor({parsedData:e,rawData:t}){this.#Oe=e,this.#Ne=t}getRaw(){return this.#Ne}get(e){return this.#Oe.get(e)??null}getAll(){return(0,i.objectFromMap)(this.#Oe)}has(e){return this.#Oe.has(e)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalContentConfig=void 0;var i=n(1),r=n(8);const s=Symbol("INTERNAL");class a{#je=!0;constructor(e,t){this.name=e,this.intent=t}get visible(){return this.#je}_setVisible(e,t){e!==s&&(0,i.unreachable)("Internal method `_setVisible` called."),this.#je=t}}t.OptionalContentConfig=class{#Be=null;#Ue=new Map;#Ve=null;#He=null;constructor(e){if(this.name=null,this.creator=null,null!==e){this.name=e.name,this.creator=e.creator,this.#He=e.order;for(const t of e.groups)this.#Ue.set(t.id,new a(t.name,t.intent));if("OFF"===e.baseState)for(const e of this.#Ue.values())e._setVisible(s,!1);for(const t of e.on)this.#Ue.get(t)._setVisible(s,!0);for(const t of e.off)this.#Ue.get(t)._setVisible(s,!1);this.#Ve=this.getHash()}}#ze(e){const t=e.length;if(t<2)return!0;const n=e[0];for(let r=1;r<t;r++){const t=e[r];let s;if(Array.isArray(t))s=this.#ze(t);else{if(!this.#Ue.has(t))return(0,i.warn)(`Optional content group not found: ${t}`),!0;s=this.#Ue.get(t).visible}switch(n){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return"And"===n}isVisible(e){if(0===this.#Ue.size)return!0;if(!e)return(0,i.warn)("Optional content group not defined."),!0;if("OCG"===e.type)return this.#Ue.has(e.id)?this.#Ue.get(e.id).visible:((0,i.warn)(`Optional content group not found: ${e.id}`),!0);if("OCMD"===e.type){if(e.expression)return this.#ze(e.expression);if(!e.policy||"AnyOn"===e.policy){for(const t of e.ids){if(!this.#Ue.has(t))return(0,i.warn)(`Optional content group not found: ${t}`),!0;if(this.#Ue.get(t).visible)return!0}return!1}if("AllOn"===e.policy){for(const t of e.ids){if(!this.#Ue.has(t))return(0,i.warn)(`Optional content group not found: ${t}`),!0;if(!this.#Ue.get(t).visible)return!1}return!0}if("AnyOff"===e.policy){for(const t of e.ids){if(!this.#Ue.has(t))return(0,i.warn)(`Optional content group not found: ${t}`),!0;if(!this.#Ue.get(t).visible)return!0}return!1}if("AllOff"===e.policy){for(const t of e.ids){if(!this.#Ue.has(t))return(0,i.warn)(`Optional content group not found: ${t}`),!0;if(this.#Ue.get(t).visible)return!1}return!0}return(0,i.warn)(`Unknown optional content policy ${e.policy}.`),!0}return(0,i.warn)(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0){this.#Ue.has(e)?(this.#Ue.get(e)._setVisible(s,!!t),this.#Be=null):(0,i.warn)(`Optional content group not found: ${e}`)}get hasInitialVisibility(){return this.getHash()===this.#Ve}getOrder(){return this.#Ue.size?this.#He?this.#He.slice():[...this.#Ue.keys()]:null}getGroups(){return this.#Ue.size>0?(0,i.objectFromMap)(this.#Ue):null}getGroup(e){return this.#Ue.get(e)||null}getHash(){if(null!==this.#Be)return this.#Be;const e=new r.MurmurHash3_64;for(const[t,n]of this.#Ue)e.update(`${t}:${n.visible}`);return this.#Be=e.hexdigest()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDataTransportStream=void 0;var i=n(1),r=n(6);t.PDFDataTransportStream=class{constructor({length:e,initialData:t,progressiveDone:n=!1,contentDispositionFilename:r=null,disableRange:s=!1,disableStream:a=!1},o){if((0,i.assert)(o,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=n,this._contentDispositionFilename=r,t?.length>0){const e=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=o,this._isStreamingSupported=!a,this._isRangeSupported=!s,this._contentLength=e,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(((e,t)=>{this._onReceiveData({begin:e,chunk:t})})),this._pdfDataRangeTransport.addProgressListener(((e,t)=>{this._onProgress({loaded:e,total:t})})),this._pdfDataRangeTransport.addProgressiveReadListener((e=>{this._onReceiveData({chunk:e})})),this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:e,chunk:t}){const n=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const t=this._rangeReaders.some((function(t){return t._begin===e&&(t._enqueue(n),!0)}));(0,i.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){void 0===e.total?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new s(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new a(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}};class s{constructor(e,t,n=!1,i=null){this._stream=e,this._done=n||!1,this._filename=(0,r.isPdfFile)(i)?i:null,this._queuedChunks=t||[],this._loaded=0;for(const e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=new i.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class a{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=new i.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaText=void 0;class n{static textContent(e){const t=[],i={items:t,styles:Object.create(null)};return function e(i){if(!i)return;let r=null;const s=i.name;if("#text"===s)r=i.value;else{if(!n.shouldBuildText(s))return;i?.attributes?.textContent?r=i.attributes.textContent:i.value&&(r=i.value)}if(null!==r&&t.push({str:r}),i.children)for(const t of i.children)e(t)}(e),i}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}t.XfaText=n},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStandardFontDataFactory=t.NodeFilterFactory=t.NodeCanvasFactory=t.NodeCMapReaderFactory=void 0;var i=n(7);const r=function(e){return new Promise(((t,n)=>{__webpack_require__(172).readFile(e,((e,i)=>{!e&&i?t(new Uint8Array(i)):n(new Error(e))}))}))};class s extends i.BaseFilterFactory{}t.NodeFilterFactory=s;class a extends i.BaseCanvasFactory{_createCanvas(e,t){return __webpack_require__(414).createCanvas(e,t)}}t.NodeCanvasFactory=a;class o extends i.BaseCMapReaderFactory{_fetchData(e,t){return r(e).then((e=>({cMapData:e,compressionType:t})))}}t.NodeCMapReaderFactory=o;class l extends i.BaseStandardFontDataFactory{_fetchData(e){return r(e)}}t.NodeStandardFontDataFactory=l},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0;var i=n(1),r=n(22);const s=__webpack_require__(172),a=__webpack_require__(1),o=__webpack_require__(779),l=__webpack_require__(558),c=/^file:\/\/\/[a-zA-Z]:\//;t.PDFNodeStream=class{constructor(e){this.source=e,this.url=function(e){const t=l.parse(e);return"file:"===t.protocol||t.host?t:/^[a-z]:[/\\]/i.test(e)?l.parse(`file:///${e}`):(t.host||(t.protocol="file:"),t)}(e.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new g(this):new p(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=this.isFsUrl?new m(this,e,t):new f(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class d{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=new i.PromiseCapability,this._headersCapability=new i.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 e=this._readableStream.read();return null===e?(this._readCapability=new i.PromiseCapability,this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new i.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class h{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new i.PromiseCapability;const t=e.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=new i.PromiseCapability,this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function u(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class p extends d{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new i.MissingPDFException(`Missing PDF "${this._url}".`);return this._storedError=e,void this._headersCapability.reject(e)}this._headersCapability.resolve(),this._setReadableStream(t);const n=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:s,suggestedLength:a}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=a||this._contentLength,this._filename=(0,r.extractFilenameFromHeader)(n)};this._request=null,"http:"===this._url.protocol?this._request=a.request(u(this._url,e.httpHeaders),t):this._request=o.request(u(this._url,e.httpHeaders),t),this._request.on("error",(e=>{this._storedError=e,this._headersCapability.reject(e)})),this._request.end()}}class f extends h{constructor(e,t,n){super(e),this._httpHeaders={};for(const t in e.httpHeaders){const n=e.httpHeaders[t];void 0!==n&&(this._httpHeaders[t]=n)}this._httpHeaders.Range=`bytes=${t}-${n-1}`;const r=e=>{if(404!==e.statusCode)this._setReadableStream(e);else{const e=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=e}};this._request=null,"http:"===this._url.protocol?this._request=a.request(u(this._url,this._httpHeaders),r):this._request=o.request(u(this._url,this._httpHeaders),r),this._request.on("error",(e=>{this._storedError=e})),this._request.end()}}class g extends d{constructor(e){super(e);let t=decodeURIComponent(this._url.path);c.test(this._url.href)&&(t=t.replace(/^\//,"")),s.lstat(t,((e,n)=>{if(e)return"ENOENT"===e.code&&(e=new i.MissingPDFException(`Missing PDF "${t}".`)),this._storedError=e,void this._headersCapability.reject(e);this._contentLength=n.size,this._setReadableStream(s.createReadStream(t)),this._headersCapability.resolve()}))}}class m extends h{constructor(e,t,n){super(e);let i=decodeURIComponent(this._url.path);c.test(this._url.href)&&(i=i.replace(/^\//,"")),this._setReadableStream(s.createReadStream(i,{start:t,end:n-1}))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseStatusError=function(e,t){return 404===e||0===e&&t.startsWith("file:")?new i.MissingPDFException('Missing PDF "'+t+'".'):new i.UnexpectedResponseException(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)},t.extractFilenameFromHeader=function(e){const t=e("Content-Disposition");if(t){let e=(0,r.getFilenameFromContentDispositionHeader)(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if((0,s.isPdfFile)(e))return e}return null},t.validateRangeRequestCapabilities=function({getResponseHeader:e,isHttp:t,rangeChunkSize:n,disableRange:i}){const r={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(e("Content-Length"),10);return Number.isInteger(s)?(r.suggestedLength=s,s<=2*n||i||!t||"bytes"!==e("Accept-Ranges")||"identity"!==(e("Content-Encoding")||"identity")||(r.allowRangeRequests=!0),r):r},t.validateResponseStatus=function(e){return 200===e||206===e};var i=n(1),r=n(23),s=n(6)},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let t=!0,n=r("filename\\*","i").exec(e);if(n){n=n[1];let e=o(n);return e=unescape(e),e=l(e),e=c(e),a(e)}if(n=function(e){const t=[];let n;const i=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=i.exec(e));){let[,e,i,r]=n;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[i,r]}const s=[];for(let e=0;e<t.length&&e in t;++e){let[n,i]=t[e];i=o(i),n&&(i=unescape(i),0===e&&(i=l(i))),s.push(i)}return s.join("")}(e),n)return a(c(n));if(n=r("filename","i").exec(e),n){n=n[1];let e=o(n);return e=c(e),a(e)}function r(e,t){return new RegExp("(?:^|;)\\s*"+e+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',t)}function s(e,n){if(e){if(!/^[\x00-\xFF]+$/.test(n))return n;try{const r=new TextDecoder(e,{fatal:!0}),s=(0,i.stringToBytes)(n);n=r.decode(s),t=!1}catch{}}return n}function a(e){return t&&/[\x80-\xff]/.test(e)&&(e=s("utf-8",e),t&&(e=s("iso-8859-1",e))),e}function o(e){if(e.startsWith('"')){const t=e.slice(1).split('\\"');for(let e=0;e<t.length;++e){const n=t[e].indexOf('"');-1!==n&&(t[e]=t[e].slice(0,n),t.length=e+1),t[e]=t[e].replaceAll(/\\(.)/g,"$1")}e=t.join('"')}return e}function l(e){const t=e.indexOf("'");return-1===t?e:s(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,""))}function c(e){return!e.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(e,t,n,i){if("q"===n||"Q"===n)return s(t,i=(i=i.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(e,t){return String.fromCharCode(parseInt(t,16))})));try{i=atob(i)}catch{}return s(t,i)}))}return""};var i=n(1)},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNetworkStream=void 0;var i=n(1),r=n(22);class s{constructor(e,t={}){this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null),this.withCredentials=t.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,n){const i={begin:e,end:t};for(const e in n)i[e]=n[e];return this.request(i)}requestFull(e){return this.request(e)}request(e){const t=new XMLHttpRequest,n=this.currXhrId++,i=this.pendingRequests[n]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const e in this.httpHeaders){const n=this.httpHeaders[e];void 0!==n&&t.setRequestHeader(e,n)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),i.expectedStatus=206):i.expectedStatus=200,t.responseType="arraybuffer",e.onError&&(t.onerror=function(n){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),i.onHeadersReceived=e.onHeadersReceived,i.onDone=e.onDone,i.onError=e.onError,i.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){const n=this.pendingRequests[e];n&&n.onProgress?.(t)}onStateChange(e,t){const n=this.pendingRequests[e];if(!n)return;const r=n.xhr;if(r.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==r.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===r.status&&this.isHttp)return void n.onError?.(r.status);const s=r.status||200;if((200!==s||206!==n.expectedStatus)&&s!==n.expectedStatus)return void n.onError?.(r.status);const a=function(e){const t=e.response;return"string"!=typeof t?t:(0,i.stringToBytes)(t).buffer}(r);if(206===s){const e=r.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);n.onDone({begin:parseInt(t[1],10),chunk:a})}else a?n.onDone({begin:0,chunk:a}):n.onError?.(r.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}t.PDFNetworkStream=class{constructor(e){this._source=e,this._manager=new s(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new a(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const n=new o(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class a{constructor(e,t){this._manager=e;const n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(n),this._headersReceivedCapability=new i.PromiseCapability,this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e),n=e=>t.getResponseHeader(e),{allowRangeRequests:i,suggestedLength:s}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=(0,r.extractFilenameFromHeader)(n),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=(0,r.createResponseStatusError)(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=new i.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class o{constructor(e,t,n){this._manager=e;const i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,n,i),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(e){const t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=(0,r.createResponseStatusError)(e,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=new i.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var i=n(1),r=n(22);function s(e,t,n){return{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function a(e){const t=new Headers;for(const n in e){const i=e[n];void 0!==i&&t.append(n,i)}return t}function o(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:((0,i.warn)(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}t.PDFFetchStream=class{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new l(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new c(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class l{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=new i.PromiseCapability,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=a(this._stream.httpHeaders);const n=t.url;fetch(n,s(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,r.validateResponseStatus)(e.status))throw(0,r.createResponseStatusError)(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:s,suggestedLength:a}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=a||this._contentLength,this._filename=(0,r.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new i.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:o(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class c{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;const o=e.source;this._withCredentials=o.withCredentials||!1,this._readCapability=new i.PromiseCapability,this._isStreamingSupported=!o.disableStream,this._abortController=new AbortController,this._headers=a(this._stream.httpHeaders),this._headers.append("Range",`bytes=${t}-${n-1}`);const l=o.url;fetch(l,s(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,r.validateResponseStatus)(e.status))throw(0,r.createResponseStatusError)(e.status,l);this._readCapability.resolve(),this._reader=e.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:o(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayerRenderTask=void 0,t.renderTextLayer=function(e){e.textContentSource||!e.textContent&&!e.textContentStream||((0,r.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),e.textContentSource=e.textContent||e.textContentStream);const{container:t,viewport:n}=e,i=getComputedStyle(t),s=i.getPropertyValue("visibility"),a=parseFloat(i.getPropertyValue("--scale-factor"));"visible"===s&&(!a||Math.abs(a-n.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const o=new d(e);return o._render(),o},t.updateTextLayer=function({container:e,viewport:t,textDivs:n,textDivProperties:i,isOffscreenCanvasSupported:s,mustRotate:a=!0,mustRescale:l=!0}){if(a&&(0,r.setLayerDimensions)(e,{rotation:t.rotation}),l){const e=o(0,s),r={prevFontSize:null,prevFontFamily:null,div:null,scale:t.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:e};for(const e of n)r.properties=i.get(e),r.div=e,c(r)}};var i=n(1),r=n(6);const s=30,a=new Map;function o(e,t){let n;if(t&&i.FeatureTest.isOffscreenCanvasSupported)n=new OffscreenCanvas(e,e).getContext("2d",{alpha:!1});else{const t=document.createElement("canvas");t.width=t.height=e,n=t.getContext("2d",{alpha:!1})}return n}function l(e,t,n){const r=document.createElement("span"),l={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};e._textDivs.push(r);const c=i.Util.transform(e._transform,t.transform);let d=Math.atan2(c[1],c[0]);const h=n[t.fontName];h.vertical&&(d+=Math.PI/2);const u=Math.hypot(c[2],c[3]),p=u*function(e,t){const n=a.get(e);if(n)return n;const i=o(s,t);i.font=`30px ${e}`;const r=i.measureText("");let l=r.fontBoundingBoxAscent,c=Math.abs(r.fontBoundingBoxDescent);if(l){const t=l/(l+c);return a.set(e,t),i.canvas.width=i.canvas.height=0,t}i.strokeStyle="red",i.clearRect(0,0,s,s),i.strokeText("g",0,0);let d=i.getImageData(0,0,s,s).data;c=0;for(let e=d.length-1-3;e>=0;e-=4)if(d[e]>0){c=Math.ceil(e/4/s);break}i.clearRect(0,0,s,s),i.strokeText("A",0,s),d=i.getImageData(0,0,s,s).data,l=0;for(let e=0,t=d.length;e<t;e+=4)if(d[e]>0){l=s-Math.floor(e/4/s);break}if(i.canvas.width=i.canvas.height=0,l){const t=l/(l+c);return a.set(e,t),t}return a.set(e,.8),.8}(h.fontFamily,e._isOffscreenCanvasSupported);let f,g;0===d?(f=c[4],g=c[5]-p):(f=c[4]+p*Math.sin(d),g=c[5]-p*Math.cos(d));const m="calc(var(--scale-factor)*",_=r.style;e._container===e._rootContainer?(_.left=`${(100*f/e._pageWidth).toFixed(2)}%`,_.top=`${(100*g/e._pageHeight).toFixed(2)}%`):(_.left=`${m}${f.toFixed(2)}px)`,_.top=`${m}${g.toFixed(2)}px)`),_.fontSize=`${m}${u.toFixed(2)}px)`,_.fontFamily=h.fontFamily,l.fontSize=u,r.setAttribute("role","presentation"),r.textContent=t.str,r.dir=t.dir,e._fontInspectorEnabled&&(r.dataset.fontName=t.fontName),0!==d&&(l.angle=d*(180/Math.PI));let b=!1;if(t.str.length>1)b=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(b=!0)}b&&(l.canvasWidth=h.vertical?t.height:t.width),e._textDivProperties.set(r,l),e._isReadableStream&&e._layoutText(r)}function c(e){const{div:t,scale:n,properties:i,ctx:r,prevFontSize:s,prevFontFamily:a}=e,{style:o}=t;let l="";if(0!==i.canvasWidth&&i.hasText){const{fontFamily:c}=o,{canvasWidth:d,fontSize:h}=i;s===h&&a===c||(r.font=`${h*n}px ${c}`,e.prevFontSize=h,e.prevFontFamily=c);const{width:u}=r.measureText(t.textContent);u>0&&(l=`scaleX(${d*n/u})`)}0!==i.angle&&(l=`rotate(${i.angle}deg) ${l}`),l.length>0&&(o.transform=l)}class d{constructor({textContentSource:e,container:t,viewport:n,textDivs:s,textDivProperties:a,textContentItemsStr:l,isOffscreenCanvasSupported:c}){this._textContentSource=e,this._isReadableStream=e instanceof ReadableStream,this._container=this._rootContainer=t,this._textDivs=s||[],this._textContentItemsStr=l||[],this._isOffscreenCanvasSupported=c,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=a||new WeakMap,this._canceled=!1,this._capability=new i.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:n.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:o(0,c)};const{pageWidth:d,pageHeight:h,pageX:u,pageY:p}=n.rawDims;this._transform=[1,0,0,-1,-u,p+h],this._pageWidth=d,this._pageHeight=h,(0,r.setLayerDimensions)(t,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 i.AbortException("TextLayer task cancelled.")).catch((()=>{})),this._reader=null),this._capability.reject(new i.AbortException("TextLayer task cancelled."))}_processItems(e,t){for(const n of e)if(void 0!==n.str)this._textContentItemsStr.push(n.str),l(this,n,t);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const e=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==n.id&&this._container.setAttribute("id",`${n.id}`),e.append(this._container)}else"endMarkedContent"===n.type&&(this._container=this._container.parentNode)}_layoutText(e){const t=this._layoutTextParams.properties=this._textDivProperties.get(e);if(this._layoutTextParams.div=e,c(this._layoutTextParams),t.hasText&&this._container.append(e),t.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this._container.append(e)}}_render(){const e=new i.PromiseCapability;let t=Object.create(null);if(this._isReadableStream){const n=()=>{this._reader.read().then((({value:i,done:r})=>{r?e.resolve():(Object.assign(t,i.styles),this._processItems(i.items,t),n())}),e.reject)};this._reader=this._textContentSource.getReader(),n()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:t,styles:n}=this._textContentSource;this._processItems(t,n),e.resolve()}}e.promise.then((()=>{t=null,function(e){if(e._canceled)return;const t=e._textDivs,n=e._capability;if(t.length>1e5)n.resolve();else{if(!e._isReadableStream)for(const n of t)e._layoutText(n);n.resolve()}}(this)}),this._capability.reject)}}t.TextLayerRenderTask=d},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditorLayer=void 0;var i=n(1),r=n(4),s=n(5),a=n(28),o=n(33),l=n(6);class c{#We;#qe=!1;#$e=null;#Ge=this.pointerup.bind(this);#Xe=this.pointerdown.bind(this);#Ke=new Map;#Ye=!1;#Qe=!1;#Je=!1;#Ze;static _initialized=!1;constructor(e){c._initialized||(c._initialized=!0,a.FreeTextEditor.initialize(e.l10n),o.InkEditor.initialize(e.l10n)),e.uiManager.registerEditorTypes([a.FreeTextEditor,o.InkEditor]),this.#Ze=e.uiManager,this.pageIndex=e.pageIndex,this.div=e.div,this.#We=e.accessibilityManager,this.#$e=e.annotationLayer,this.viewport=e.viewport,this.#Ze.addLayer(this)}get isEmpty(){return 0===this.#Ke.size}updateToolbar(e){this.#Ze.updateToolbar(e)}updateMode(e=this.#Ze.getMode()){this.#et(),e===i.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),this.#Ze.unselectAll(),e!==i.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",e===i.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",e===i.AnnotationEditorType.INK),this.div.hidden=!1)}addInkEditorIfNeeded(e){if(e||this.#Ze.getMode()===i.AnnotationEditorType.INK){if(!e)for(const e of this.#Ke.values())if(e.isEmpty())return void e.setInBackground();this.#tt({offsetX:0,offsetY:0}).setInBackground()}}setEditingState(e){this.#Ze.setEditingState(e)}addCommands(e){this.#Ze.addCommands(e)}enable(){this.div.style.pointerEvents="auto";const e=new Set;for(const t of this.#Ke.values())t.enableEditing(),t.annotationElementId&&e.add(t.annotationElementId);if(!this.#$e)return;const t=this.#$e.getEditableAnnotations();for(const n of t){if(n.hide(),this.#Ze.isDeletedAnnotationElement(n.data.id))continue;if(e.has(n.data.id))continue;const t=this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}}disable(){this.#Je=!0,this.div.style.pointerEvents="none";const e=new Set;for(const t of this.#Ke.values())t.disableEditing(),t.annotationElementId&&null===t.serialize()?(this.getEditableAnnotation(t.annotationElementId)?.show(),t.remove()):e.add(t.annotationElementId);if(this.#$e){const t=this.#$e.getEditableAnnotations();for(const n of t){const{id:t}=n.data;e.has(t)||this.#Ze.isDeletedAnnotationElement(t)||n.show()}}this.#et(),this.isEmpty&&(this.div.hidden=!0),this.#Je=!1}getEditableAnnotation(e){return this.#$e?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#Ze.getActive()!==e&&this.#Ze.setActiveEditor(e)}enableClick(){this.div.addEventListener("pointerdown",this.#Xe),this.div.addEventListener("pointerup",this.#Ge)}disableClick(){this.div.removeEventListener("pointerdown",this.#Xe),this.div.removeEventListener("pointerup",this.#Ge)}attach(e){this.#Ke.set(e.id,e);const{annotationElementId:t}=e;t&&this.#Ze.isDeletedAnnotationElement(t)&&this.#Ze.removeDeletedAnnotationElement(e)}detach(e){this.#Ke.delete(e.id),this.#We?.removePointerInTextLayer(e.contentDiv),!this.#Je&&e.annotationElementId&&this.#Ze.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#Ze.removeEditor(e),e.div.style.display="none",setTimeout((()=>{e.div.style.display="",e.div.remove(),e.isAttachedToDOM=!1,document.activeElement===document.body&&this.#Ze.focusMainContainer()}),0),this.#Qe||this.addInkEditorIfNeeded(!1)}#nt(e){e.parent!==this&&(e.annotationElementId&&(this.#Ze.addDeletedAnnotationElement(e.annotationElementId),r.AnnotationEditor.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(this.#nt(e),this.#Ze.addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}this.moveEditorInDOM(e),e.onceAdded(),this.#Ze.addToAnnotationStorage(e)}moveEditorInDOM(e){this.#We?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?e.rebuild():this.add(e)}getNextId(){return this.#Ze.getId()}#it(e){switch(this.#Ze.getMode()){case i.AnnotationEditorType.FREETEXT:return new a.FreeTextEditor(e);case i.AnnotationEditorType.INK:return new o.InkEditor(e)}return null}deserialize(e){switch(e.annotationType??e.annotationEditorType){case i.AnnotationEditorType.FREETEXT:return a.FreeTextEditor.deserialize(e,this,this.#Ze);case i.AnnotationEditorType.INK:return o.InkEditor.deserialize(e,this,this.#Ze)}return null}#tt(e){const t=this.getNextId(),n=this.#it({parent:this,id:t,x:e.offsetX,y:e.offsetY,uiManager:this.#Ze});return n&&this.add(n),n}setSelected(e){this.#Ze.setSelected(e)}toggleSelected(e){this.#Ze.toggleSelected(e)}isSelected(e){return this.#Ze.isSelected(e)}unselect(e){this.#Ze.unselect(e)}pointerup(e){const{isMac:t}=i.FeatureTest.platform;0!==e.button||e.ctrlKey&&t||e.target===this.div&&this.#Ye&&(this.#Ye=!1,this.#qe?this.#tt(e):this.#qe=!0)}pointerdown(e){const{isMac:t}=i.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;this.#Ye=!0;const n=this.#Ze.getActive();this.#qe=!n||n.isEmpty()}drop(e){const t=e.dataTransfer.getData("text/plain"),n=this.#Ze.getEditor(t);if(!n)return;e.preventDefault(),e.dataTransfer.dropEffect="move",this.#nt(n);const i=this.div.getBoundingClientRect(),r=e.clientX-i.x,s=e.clientY-i.y;n.translate(r-n.startX,s-n.startY),this.moveEditorInDOM(n),n.div.focus()}dragover(e){e.preventDefault()}destroy(){this.#Ze.getActive()?.parent===this&&this.#Ze.setActiveEditor(null);for(const e of this.#Ke.values())this.#We?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#Ke.clear(),this.#Ze.removeLayer(this)}#et(){this.#Qe=!0;for(const e of this.#Ke.values())e.isEmpty()&&e.remove();this.#Qe=!1}render({viewport:e}){this.viewport=e,(0,l.setLayerDimensions)(this.div,e),(0,s.bindEvents)(this,this.div,["dragover","drop"]);for(const e of this.#Ze.getEditors(this.pageIndex))this.add(e);this.updateMode()}update({viewport:e}){this.#Ze.commitOrRemove(),this.viewport=e,(0,l.setLayerDimensions)(this.div,{rotation:e.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}}t.AnnotationEditorLayer=c},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FreeTextEditor=void 0;var i=n(1),r=n(5),s=n(4),a=n(29);class o extends s.AnnotationEditor{#rt=this.editorDivBlur.bind(this);#st=this.editorDivFocus.bind(this);#at=this.editorDivInput.bind(this);#ot=this.editorDivKeydown.bind(this);#lt;#ct="";#dt=`${this.id}-editor`;#ht;#ut=null;static _freeTextDefaultContent="";static _l10nPromise;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){return(0,i.shadow)(this,"_keyboardManager",new r.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],o.prototype.commitOrRemove,!0],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],o.prototype.commitOrRemove]]))}static _type="freetext";constructor(e){super({...e,name:"freeTextEditor"}),this.#lt=e.color||o._defaultColor||s.AnnotationEditor._defaultLineColor,this.#ht=e.fontSize||o._defaultFontSize}static initialize(e){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map((t=>[t,e.get(t)])));const t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case i.AnnotationEditorParamsType.FREETEXT_SIZE:o._defaultFontSize=t;break;case i.AnnotationEditorParamsType.FREETEXT_COLOR:o._defaultColor=t}}updateParams(e,t){switch(e){case i.AnnotationEditorParamsType.FREETEXT_SIZE:this.#pt(t);break;case i.AnnotationEditorParamsType.FREETEXT_COLOR:this.#ft(t)}}static get defaultPropertiesToUpdate(){return[[i.AnnotationEditorParamsType.FREETEXT_SIZE,o._defaultFontSize],[i.AnnotationEditorParamsType.FREETEXT_COLOR,o._defaultColor||s.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[i.AnnotationEditorParamsType.FREETEXT_SIZE,this.#ht],[i.AnnotationEditorParamsType.FREETEXT_COLOR,this.#lt]]}#pt(e){const t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--scale-factor))`,this.translate(0,-(e-this.#ht)*this.parentScale),this.#ht=e,this.#gt()},n=this.#ht;this.addCommands({cmd:()=>{t(e)},undo:()=>{t(n)},mustExec:!0,type:i.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#ft(e){const t=this.#lt;this.addCommands({cmd:()=>{this.#lt=this.editorDiv.style.color=e},undo:()=>{this.#lt=this.editorDiv.style.color=t},mustExec:!0,type:i.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}getInitialTranslation(){const e=this.parentScale;return[-o._internalPadding*e,-(o._internalPadding+this.#ht)*e]}rebuild(){super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(i.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#ot),this.editorDiv.addEventListener("focus",this.#st),this.editorDiv.addEventListener("blur",this.#rt),this.editorDiv.addEventListener("input",this.#at))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#dt),this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",this.#ot),this.editorDiv.removeEventListener("focus",this.#st),this.editorDiv.removeEventListener("blur",this.#rt),this.editorDiv.removeEventListener("input",this.#at),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(e){super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){this.width?this.#mt():(this.enableEditMode(),this.editorDiv.focus())}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing"),super.remove()}#_t(){const e=this.editorDiv.getElementsByTagName("div");if(0===e.length)return this.editorDiv.innerText;const t=[];for(const n of e)t.push(n.innerText.replace(/\r\n?|\n/,""));return t.join("\n")}#gt(){const[e,t]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:e,div:t}=this,i=t.style.display;t.style.display="hidden",e.div.append(this.div),n=t.getBoundingClientRect(),t.remove(),t.style.display=i}this.width=n.width/e,this.height=n.height/t}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#ct,t=this.#ct=this.#_t().trimEnd();if(e===t)return;const n=e=>{this.#ct=e,e?(this.#bt(),this.rebuild(),this.#gt()):this.remove()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),this.#gt()}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(e){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&"Enter"===e.key&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(e){o._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#dt),this.enableEditing(),o._l10nPromise.get("editor_free_text2_aria_label").then((e=>this.editorDiv?.setAttribute("aria-label",e))),o._l10nPromise.get("free_text2_default_content").then((e=>this.editorDiv?.setAttribute("default-content",e))),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#ht}px * var(--scale-factor))`,n.color=this.#lt,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,r.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[n,i]=this.parentDimensions;if(this.annotationElementId){const[r]=this.getInitialTranslation();this.setAt(e*n,t*i,r,r)}else this.setAt(e*n,t*i,this.width*n,this.height*i);this.#bt(),this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0;return this.div}#bt(){if(this.editorDiv.replaceChildren(),this.#ct)for(const e of this.#ct.split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}get contentDiv(){return this.editorDiv}static deserialize(e,t,n){let r=null;if(e instanceof a.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:t,fontColor:n},rect:s,rotation:a,id:o},textContent:l,parent:{page:{pageNumber:c}}}=e;if(!l||0===l.length)return null;r=e={annotationType:i.AnnotationEditorType.FREETEXT,color:Array.from(n),fontSize:t,value:l.join("\n"),pageIndex:c-1,rect:s,rotation:a,id:o,deleted:!1}}const s=super.deserialize(e,t,n);return s.#ht=e.fontSize,s.#lt=i.Util.makeHexColor(...e.color),s.#ct=e.value,s.annotationElementId=e.id||null,s.#ut=r,s}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const t=o._internalPadding*this.parentScale,n=this.getRect(t,t),r=s.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#lt),a={annotationType:i.AnnotationEditorType.FREETEXT,color:r,fontSize:this.#ht,value:this.#ct,pageIndex:this.pageIndex,rect:n,rotation:this.rotation};return e?a:this.annotationElementId&&!this.#vt(a)?null:(a.id=this.annotationElementId,a)}#vt(e){const{value:t,fontSize:n,color:i,rect:r,pageIndex:s}=this.#ut;return e.value!==t||e.fontSize!==n||e.rect.some(((e,t)=>Math.abs(e-r[t])>=1))||e.color.some(((e,t)=>e!==i[t]))||e.pageIndex!==s}#mt(e=!1){if(!this.annotationElementId)return;if(this.#gt(),!e&&(0===this.width||0===this.height))return void setTimeout((()=>this.#mt(!0)),0);const t=o._internalPadding*this.parentScale;this.#ut.rect=this.getRect(t,t)}}t.FreeTextEditor=o},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InkAnnotationElement=t.FreeTextAnnotationElement=t.AnnotationLayer=void 0;var i=n(1),r=n(6),s=n(3),a=n(30),o=n(31);const l=1e3,c=new WeakSet;function d(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class h{static create(e){switch(e.data.annotationType){case i.AnnotationType.LINK:return new p(e);case i.AnnotationType.TEXT:return new f(e);case i.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new m(e);case"Btn":return e.data.radioButton?new v(e):e.data.checkBox?new b(e):new y(e);case"Ch":return new A(e);case"Sig":return new _(e)}return new g(e);case i.AnnotationType.POPUP:return new x(e);case i.AnnotationType.FREETEXT:return new w(e);case i.AnnotationType.LINE:return new E(e);case i.AnnotationType.SQUARE:return new P(e);case i.AnnotationType.CIRCLE:return new C(e);case i.AnnotationType.POLYLINE:return new k(e);case i.AnnotationType.CARET:return new M(e);case i.AnnotationType.INK:return new L(e);case i.AnnotationType.POLYGON:return new T(e);case i.AnnotationType.HIGHLIGHT:return new R(e);case i.AnnotationType.UNDERLINE:return new I(e);case i.AnnotationType.SQUIGGLY:return new F(e);case i.AnnotationType.STRIKEOUT:return new D(e);case i.AnnotationType.STAMP:return new O(e);case i.AnnotationType.FILEATTACHMENT:return new N(e);default:return new u(e)}}}class u{constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:i=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(n)),i&&(this.quadrilaterals=this._createQuadrilaterals(n))}_createContainer(e){const{data:t,parent:{page:n,viewport:r}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",t.id),s.style.zIndex=this.parent.zIndex++,this.data.popupRef&&s.setAttribute("aria-haspopup","dialog"),t.noRotate&&s.classList.add("norotate");const{pageWidth:a,pageHeight:o,pageX:l,pageY:c}=r.rawDims;if(!t.rect||this instanceof x){const{rotation:e}=t;return t.hasOwnCanvas||0===e||this.setRotation(e,s),s}const{width:h,height:u}=d(t.rect),p=i.Util.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]);if(!e&&t.borderStyle.width>0){s.style.borderWidth=`${t.borderStyle.width}px`;const e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;if(e>0||n>0){const t=`calc(${e}px * var(--scale-factor)) / calc(${n}px * var(--scale-factor))`;s.style.borderRadius=t}else if(this instanceof v){const e=`calc(${h}px * var(--scale-factor)) / calc(${u}px * var(--scale-factor))`;s.style.borderRadius=e}switch(t.borderStyle.style){case i.AnnotationBorderStyleType.SOLID:s.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:s.style.borderStyle="dashed";break;case i.AnnotationBorderStyleType.BEVELED:(0,i.warn)("Unimplemented border style: beveled");break;case i.AnnotationBorderStyleType.INSET:(0,i.warn)("Unimplemented border style: inset");break;case i.AnnotationBorderStyleType.UNDERLINE:s.style.borderBottomStyle="solid"}const r=t.borderColor||null;r?s.style.borderColor=i.Util.makeHexColor(0|r[0],0|r[1],0|r[2]):s.style.borderWidth=0}s.style.left=100*(p[0]-l)/a+"%",s.style.top=100*(p[1]-c)/o+"%";const{rotation:f}=t;return t.hasOwnCanvas||0===f?(s.style.width=100*h/a+"%",s.style.height=100*u/o+"%"):this.setRotation(f,s),s}setRotation(e,t=this.container){const{pageWidth:n,pageHeight:i}=this.parent.viewport.rawDims,{width:r,height:s}=d(this.data.rect);let a,o;e%180==0?(a=100*r/n,o=100*s/i):(a=100*s/n,o=100*r/i),t.style.width=`${a}%`,t.style.height=`${o}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(e,t,n)=>{const i=n.detail[e];n.target.style[t]=a.ColorConverters[`${i[0]}_HTML`](i.slice(1))};return(0,i.shadow)(this,"_commonActions",{display:e=>{const t=e.detail.display%2==1;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:t,print:0===e.detail.display||3===e.detail.display})},print:e=>{this.annotationStorage.setValue(this.data.id,{print:e.detail.print})},hidden:e=>{this.container.style.visibility=e.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:e.detail.hidden})},focus:e=>{setTimeout((()=>e.target.focus({preventScroll:!1})),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.detail.readonly?e.target.setAttribute("readonly",""):e.target.removeAttribute("readonly")},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:e=>{const t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){const n=this._commonActions;for(const i of Object.keys(t.detail)){const r=e[i]||n[i];r?.(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const n=this._commonActions;for(const[i,r]of Object.entries(t)){const s=n[i];s&&(s({detail:{[i]:r},target:e}),delete t[i])}}_createQuadrilaterals(e=!1){if(!this.data.quadPoints)return null;const t=[],n=this.data.rect;let i=null;for(const n of this.data.quadPoints)this.data.rect=[n[2].x,n[2].y,n[1].x,n[1].y],t.push(this._createContainer(e)),i||=this.data.rect;return this.data.rect=n,this.firstQuadRect=i,t}_createPopup(){const{container:e,data:t}=this;e.setAttribute("aria-haspopup","dialog");const n=new x({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:this.firstQuadRect||t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation},parent:this.parent,elements:[this]});this.parent.div.append(n.render())}_renderQuadrilaterals(e){for(const t of this.quadrilaterals)t.classList.add(e);return this.quadrilaterals}render(){(0,i.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const n=[];if(this._fieldObjects){const r=this._fieldObjects[e];if(r)for(const{page:e,id:s,exportValues:a}of r){if(-1===e)continue;if(s===t)continue;const r="string"==typeof a?a:null,o=document.querySelector(`[data-element-id="${s}"]`);!o||c.has(o)?n.push({id:s,exportValue:r,domElement:o}):(0,i.warn)(`_getElementsByName - element not allowed: ${s}`)}return n}for(const i of document.getElementsByName(e)){const{exportValue:e}=i,r=i.getAttribute("data-element-id");r!==t&&c.has(i)&&n.push({id:r,exportValue:e,domElement:i})}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.quadrilaterals||this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}}class p extends u{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let i=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),i=!0):e.action?(this._bindNamedAction(n,e.action),i=!0):e.attachment?(this._bindAttachment(n,e.attachment),i=!0):e.setOCGState?(this.#yt(n,e.setOCGState),i=!0):e.dest?(this._bindLink(n,e.dest),i=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),i=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(n,""),i=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map(((e,t)=>{const i=0===t?n:n.cloneNode();return e.append(i),e})):(this.container.classList.add("linkAnnotation"),i&&this.container.append(n),this.container)}#At(){this.container.setAttribute("data-internal-link","")}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&this.#At()}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),this.#At()}_bindAttachment(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,t.content,t.filename),!1),this.#At()}#yt(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),this.#At()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(t.actions)){const r=n.get(i);r&&(e[r]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:i}}),!1))}e.onclick||(e.onclick=()=>!1),this.#At()}_bindResetFormAction(e,t){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),this.#At(),!this._fieldObjects)return(0,i.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(n||(e.onclick=()=>!1));e.onclick=()=>{n?.();const{fields:e,refs:r,include:s}=t,a=[];if(0!==e.length||0!==r.length){const t=new Set(r);for(const n of e){const e=this._fieldObjects[n]||[];for(const{id:n}of e)t.add(n)}for(const e of Object.values(this._fieldObjects))for(const n of e)t.has(n.id)===s&&a.push(n)}else for(const e of Object.values(this._fieldObjects))a.push(...e);const o=this.annotationStorage,l=[];for(const e of a){const{id:t}=e;switch(l.push(t),e.type){case"text":{const n=e.defaultValue||"";o.setValue(t,{value:n});break}case"checkbox":case"radiobutton":{const n=e.defaultValue===e.exportValues;o.setValue(t,{value:n});break}case"combobox":case"listbox":{const n=e.defaultValue||"";o.setValue(t,{value:n});break}default:continue}const n=document.querySelector(`[data-element-id="${t}"]`);n&&(c.has(n)?n.dispatchEvent(new Event("resetform")):(0,i.warn)(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}}),!1}}}class f extends u{constructor(e){super(e,{isRenderable:!!(e.data.popupRef||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str)})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.popupRef||this._createPopup(),this.container.append(e),this.container}}class g extends u{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&("CANVAS"===e.previousSibling?.nodeName&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){const{isWin:t,isMac:n}=i.FeatureTest.platform;return t&&e.ctrlKey||n&&e.metaKey}_setEventListener(e,t,n,i){t.includes("mouse")?e.addEventListener(t,(e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:i(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})})):e.addEventListener(t,(e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:i(e)}})}))}_setEventListeners(e,t,n){for(const[i,r]of t)("Action"===r||this.data.actions?.[r])&&this._setEventListener(e,i,r,n)}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":i.Util.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const{fontColor:t}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,r=e.style;let s;const a=e=>Math.round(10*e)/10;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(i.LINE_FACTOR*n))||1);s=Math.min(n,a(t/i.LINE_FACTOR))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);s=Math.min(n,a(e/i.LINE_FACTOR))}r.fontSize=`calc(${s}px * var(--scale-factor))`,r.color=i.Util.makeHexColor(t[0],t[1],t[2]),null!==this.data.textAlignment&&(r.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class m extends g{constructor(e){super(e,{isRenderable:e.renderForms||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,n,i){const r=this.annotationStorage;for(const s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[t]=n),r.setValue(s.id,{[i]:n})}render(){const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const i=e.getValue(t,{value:this.data.fieldValue});let r=i.value||"";const s=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;s&&r.length>s&&(r=r.slice(0,s));let a=i.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const o={userValue:r,formattedValue:a,lastCommittedValue:null,commitKey:1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=a??r,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",a??r),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),c.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.baseFieldName||this.data.fieldName,n.tabIndex=l,this._setRequired(n,this.data.required),s&&(n.maxLength=s),n.addEventListener("input",(i=>{e.setValue(t,{value:i.target.value}),this.setPropertyOnSiblings(n,"value",i.target.value,"value"),o.formattedValue=null})),n.addEventListener("resetform",(e=>{const t=this.data.defaultFieldValue??"";n.value=o.userValue=t,o.formattedValue=null}));let d=e=>{const{formattedValue:t}=o;null!=t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",(e=>{const{target:t}=e;o.userValue&&(t.value=o.userValue),o.lastCommittedValue=t.value,o.commitKey=1})),n.addEventListener("updatefromsandbox",(n=>{this.showElementAndHideCanvas(n.target);const i={value(n){o.userValue=n.detail.value??"",e.setValue(t,{value:o.userValue.toString()}),n.target.value=o.userValue},formattedValue(n){const{formattedValue:i}=n.detail;o.formattedValue=i,null!=i&&n.target!==document.activeElement&&(n.target.value=i),e.setValue(t,{formattedValue:i})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{const{charLimit:i}=n.detail,{target:r}=n;if(0===i)return void r.removeAttribute("maxLength");r.setAttribute("maxLength",i);let s=o.userValue;!s||s.length<=i||(s=s.slice(0,i),r.value=o.userValue=s,e.setValue(t,{value:s}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:s,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}}))}};this._dispatchEventFromSandbox(i,n)})),n.addEventListener("keydown",(e=>{o.commitKey=1;let n=-1;if("Escape"===e.key?n=0:"Enter"!==e.key||this.data.multiLine?"Tab"===e.key&&(o.commitKey=3):n=2,-1===n)return;const{value:i}=e.target;o.lastCommittedValue!==i&&(o.lastCommittedValue=i,o.userValue=i,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,willCommit:!0,commitKey:n,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))}));const i=d;d=null,n.addEventListener("blur",(e=>{if(!e.relatedTarget)return;const{value:n}=e.target;o.userValue=n,o.lastCommittedValue!==n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:n,willCommit:!0,commitKey:o.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),i(e)})),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",(e=>{o.lastCommittedValue=null;const{data:n,target:i}=e,{value:r,selectionStart:s,selectionEnd:a}=i;let l=s,c=a;switch(e.inputType){case"deleteWordBackward":{const e=r.substring(0,s).match(/\w*[^\w]*$/);e&&(l-=e[0].length);break}case"deleteWordForward":{const e=r.substring(s).match(/^[^\w]*\w*/);e&&(c+=e[0].length);break}case"deleteContentBackward":s===a&&(l-=1);break;case"deleteContentForward":s===a&&(c+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:r,change:n||"",willCommit:!1,selStart:l,selEnd:c}})})),this._setEventListeners(n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.value))}if(d&&n.addEventListener("blur",d),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/s;n.classList.add("comb"),n.style.letterSpacing=`calc(${e}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 _ extends g{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class b extends g{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,n=t.id;let i=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;"string"==typeof i&&(i="Off"!==i,e.setValue(n,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");return c.add(r),r.setAttribute("data-element-id",n),r.disabled=t.readOnly,this._setRequired(r,this.data.required),r.type="checkbox",r.name=t.baseFieldName||t.fieldName,i&&r.setAttribute("checked",!0),r.setAttribute("exportValue",t.exportValue),r.tabIndex=l,r.addEventListener("change",(i=>{const{name:r,checked:s}=i.target;for(const i of this._getElementsByName(r,n)){const n=s&&i.exportValue===t.exportValue;i.domElement&&(i.domElement.checked=n),e.setValue(i.id,{value:n})}e.setValue(n,{value:s})})),r.addEventListener("resetform",(e=>{const n=t.defaultFieldValue||"Off";e.target.checked=n===t.exportValue})),this.enableScripting&&this.hasJSActions&&(r.addEventListener("updatefromsandbox",(t=>{const i={value(t){t.target.checked="Off"!==t.detail.value,e.setValue(n,{value:t.target.checked})}};this._dispatchEventFromSandbox(i,t)})),this._setEventListeners(r,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class v extends g{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,n=t.id;let i=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;"string"==typeof i&&(i=i!==t.buttonValue,e.setValue(n,{value:i}));const r=document.createElement("input");if(c.add(r),r.setAttribute("data-element-id",n),r.disabled=t.readOnly,this._setRequired(r,this.data.required),r.type="radio",r.name=t.baseFieldName||t.fieldName,i&&r.setAttribute("checked",!0),r.tabIndex=l,r.addEventListener("change",(t=>{const{name:i,checked:r}=t.target;for(const t of this._getElementsByName(i,n))e.setValue(t.id,{value:!1});e.setValue(n,{value:r})})),r.addEventListener("resetform",(e=>{const n=t.defaultFieldValue;e.target.checked=null!=n&&n===t.buttonValue})),this.enableScripting&&this.hasJSActions){const i=t.buttonValue;r.addEventListener("updatefromsandbox",(t=>{const r={value:t=>{const r=i===t.detail.value;for(const i of this._getElementsByName(t.target.name)){const t=r&&i.id===n;i.domElement&&(i.domElement.checked=t),e.setValue(i.id,{value:t})}}};this._dispatchEventFromSandbox(r,t)})),this._setEventListeners(r,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))}return this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class y extends p{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(e.title=this.data.alternativeText);const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",(e=>{this._dispatchEventFromSandbox({},e)}))),e}}class A extends g{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),i=document.createElement("select");c.add(i),i.setAttribute("data-element-id",t),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.baseFieldName||this.data.fieldName,i.tabIndex=l;let r=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",(e=>{const t=this.data.defaultFieldValue;for(const e of i.options)e.selected=e.value===t}));for(const e of this.data.options){const t=document.createElement("option");t.textContent=e.displayValue,t.value=e.exportValue,n.value.includes(e.exportValue)&&(t.setAttribute("selected",!0),r=!1),i.append(t)}let s=null;if(r){const e=document.createElement("option");e.value=" ",e.setAttribute("hidden",!0),e.setAttribute("selected",!0),i.prepend(e),s=()=>{e.remove(),i.removeEventListener("input",s),s=null},i.addEventListener("input",s)}const a=e=>{const t=e?"value":"textContent",{options:n,multiple:r}=i;return r?Array.prototype.filter.call(n,(e=>e.selected)).map((e=>e[t])):-1===n.selectedIndex?null:n[n.selectedIndex][t]};let o=a(!1);const d=e=>{const t=e.target.options;return Array.prototype.map.call(t,(e=>({displayValue:e.textContent,exportValue:e.value})))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",(n=>{const r={value(n){s?.();const r=n.detail.value,l=new Set(Array.isArray(r)?r:[r]);for(const e of i.options)e.selected=l.has(e.value);e.setValue(t,{value:a(!0)}),o=a(!1)},multipleSelection(e){i.multiple=!0},remove(n){const r=i.options,s=n.detail.remove;r[s].selected=!1,i.remove(s),r.length>0&&-1===Array.prototype.findIndex.call(r,(e=>e.selected))&&(r[0].selected=!0),e.setValue(t,{value:a(!0),items:d(n)}),o=a(!1)},clear(n){for(;0!==i.length;)i.remove(0);e.setValue(t,{value:null,items:[]}),o=a(!1)},insert(n){const{index:r,displayValue:s,exportValue:l}=n.detail.insert,c=i.children[r],h=document.createElement("option");h.textContent=s,h.value=l,c?c.before(h):i.append(h),e.setValue(t,{value:a(!0),items:d(n)}),o=a(!1)},items(n){const{items:r}=n.detail;for(;0!==i.length;)i.remove(0);for(const e of r){const{displayValue:t,exportValue:n}=e,r=document.createElement("option");r.textContent=t,r.value=n,i.append(r)}i.options.length>0&&(i.options[0].selected=!0),e.setValue(t,{value:a(!0),items:d(n)}),o=a(!1)},indices(n){const i=new Set(n.detail.indices);for(const e of n.target.options)e.selected=i.has(e.index);e.setValue(t,{value:a(!0)}),o=a(!1)},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(r,n)})),i.addEventListener("input",(n=>{const i=a(!0);e.setValue(t,{value:i}),n.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:o,changeEx:i,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(i,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(e=>e.target.value))):i.addEventListener("input",(function(n){e.setValue(t,{value:a(!0)})})),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class x extends u{constructor(e){const{data:t,elements:n}=e;super(e,{isRenderable:!!(t.titleObj?.str||t.contentsObj?.str||t.richText?.str)}),this.elements=n}render(){this.container.classList.add("popupAnnotation");const e=new S({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}),t=[];for(const n of this.elements)n.popup=e,t.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",t.join(",")),this.container}}class S{#xt=null;#St=this.#wt.bind(this);#Et=this.#Pt.bind(this);#Ct=this.#kt.bind(this);#lt=null;#ne=null;#Tt=null;#Mt=null;#Lt=null;#Rt=null;#It=!1;#Ft=null;#Dt=null;#Ot=null;#Nt=null;#jt=!1;constructor({container:e,color:t,elements:n,titleObj:i,modificationDate:s,contentsObj:a,richText:o,parent:l,rect:c,parentRect:d,open:h}){this.#ne=e,this.#Nt=i,this.#Tt=a,this.#Ot=o,this.#Lt=l,this.#lt=t,this.#Dt=c,this.#Rt=d,this.#Mt=n;const u=r.PDFDateString.toDateObject(s);u&&(this.#xt=l.l10n.get("annotation_date_string",{date:u.toLocaleDateString(),time:u.toLocaleTimeString()})),this.trigger=n.flatMap((e=>e.getElementsToTriggerPopup()));for(const e of this.trigger)e.addEventListener("click",this.#Ct),e.addEventListener("mouseenter",this.#Et),e.addEventListener("mouseleave",this.#St);this.#ne.hidden=!0,h&&this.#kt()}render(){if(this.#Ft)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:r,pageY:s}}}=this.#Lt,a=this.#Ft=document.createElement("div");if(a.className="popup",this.#lt){const e=a.style.outlineColor=i.Util.makeHexColor(...this.#lt);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))a.style.backgroundColor=`color-mix(in srgb, ${e} 30%, white)`;else{const e=.7;a.style.backgroundColor=i.Util.makeHexColor(...this.#lt.map((t=>Math.floor(e*(255-t)+t))))}}const l=document.createElement("span");l.className="header";const c=document.createElement("h1");if(l.append(c),({dir:c.dir,str:c.textContent}=this.#Nt),a.append(l),this.#xt){const e=document.createElement("span");e.classList.add("popupDate"),this.#xt.then((t=>{e.textContent=t})),l.append(e)}const d=this.#Tt,h=this.#Ot;if(!h?.str||d?.str&&d.str!==h.str){const e=this._formatContents(d);a.append(e)}else o.XfaLayer.render({xfaHtml:h.html,intent:"richText",div:a}),a.lastChild.classList.add("richText","popupContent");let u=!!this.#Rt,p=u?this.#Rt:this.#Dt;for(const e of this.#Mt)if(!p||null!==i.Util.intersect(e.data.rect,p)){p=e.data.rect,u=!0;break}const f=i.Util.normalizeRect([p[0],e[3]-p[1]+e[1],p[2],e[3]-p[3]+e[1]]),g=u?p[2]-p[0]+5:0,m=f[0]+g,_=f[1],{style:b}=this.#ne;b.left=100*(m-r)/t+"%",b.top=100*(_-s)/n+"%",this.#ne.append(a)}_formatContents({str:e,dir:t}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=t;const i=e.split(/(?:\r\n?|\n)/);for(let e=0,t=i.length;e<t;++e){const r=i[e];n.append(document.createTextNode(r)),e<t-1&&n.append(document.createElement("br"))}return n}#kt(){this.#It=!this.#It,this.#It?(this.#Pt(),this.#ne.addEventListener("click",this.#Ct)):(this.#wt(),this.#ne.removeEventListener("click",this.#Ct))}#Pt(){this.#Ft||this.render(),this.isVisible?this.#It&&this.#ne.classList.add("focused"):(this.#ne.hidden=!1,this.#ne.style.zIndex=parseInt(this.#ne.style.zIndex)+1e3)}#wt(){this.#ne.classList.remove("focused"),this.#It||(this.#ne.hidden=!0,this.#ne.style.zIndex=parseInt(this.#ne.style.zIndex)-1e3)}forceHide(){this.#jt=this.isVisible,this.#jt&&(this.#ne.hidden=!0)}maybeShow(){this.#jt&&(this.#jt=!1,this.#ne.hidden=!1)}get isVisible(){return!1===this.#ne.hidden}}class w extends u{constructor(e){super(e,{isRenderable:!!(e.data.popupRef||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0}),this.textContent=e.data.textContent,this.annotationEditorType=i.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const n=document.createElement("span");n.textContent=t,e.append(n)}this.container.append(e)}return this.data.popupRef||this._createPopup(),this.container}}t.FreeTextAnnotationElement=w;class E extends u{#Bt=null;constructor(e){super(e,{isRenderable:!!(e.data.popupRef||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const e=this.data,{width:t,height:n}=d(e.rect),i=this.svgFactory.create(t,n,!0),r=this.#Bt=this.svgFactory.createElement("svg:line");return r.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),r.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),r.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),r.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),r.setAttribute("stroke-width",e.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),i.append(r),this.container.append(i),e.popupRef||this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Bt}addHighlightArea(){this.container.classList.add("highlightArea")}}class P extends u{#Ut=null;constructor(e){super(e,{isRenderable:!!(e.data.popupRef||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const e=this.data,{width:t,height:n}=d(e.rect),i=this.svgFactory.create(t,n,!0),r=e.borderStyle.width,s=this.#Ut=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",r/2),s.setAttribute("y",r/2),s.setAttribute("width",t-r),s.setAttribute("height",n-r),s.setAttribute("stroke-width",r||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),i.append(s),this.container.append(i),e.popupRef||this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Ut}addHighlightArea(){this.container.classList.add("highlightArea")}}class C extends u{#Vt=null;constructor(e){super(e,{isRenderable:!!(e.data.popupRef||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const e=this.data,{width:t,height:n}=d(e.rect),i=this.svgFactory.create(t,n,!0),r=e.borderStyle.width,s=this.#Vt=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",t/2),s.setAttribute("cy",n/2),s.setAttribute("rx",t/2-r/2),s.setAttribute("ry",n/2-r/2),s.setAttribute("stroke-width",r||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),i.append(s),this.container.append(i),e.popupRef||this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Vt}addHighlightArea(){this.container.classList.add("highlightArea")}}class k extends u{#Ht=null;constructor(e){super(e,{isRenderable:!!(e.data.popupRef||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const e=this.data,{width:t,height:n}=d(e.rect),i=this.svgFactory.create(t,n,!0);let r=[];for(const t of e.vertices){const n=t.x-e.rect[0],i=e.rect[3]-t.y;r.push(n+","+i)}r=r.join(" ");const s=this.#Ht=this.svgFactory.createElement(this.svgElementName);return s.setAttribute("points",r),s.setAttribute("stroke-width",e.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),i.append(s),this.container.append(i),e.popupRef||this._createPopup(s,e),this.container}getElementsToTriggerPopup(){return this.#Ht}addHighlightArea(){this.container.classList.add("highlightArea")}}class T extends k{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class M extends u{constructor(e){super(e,{isRenderable:!!(e.data.popupRef||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),this.data.popupRef||this._createPopup(),this.container}}class L extends u{#zt=[];constructor(e){super(e,{isRenderable:!!(e.data.popupRef||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=i.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const e=this.data,{width:t,height:n}=d(e.rect),i=this.svgFactory.create(t,n,!0);for(const t of e.inkLists){let n=[];for(const i of t){const t=i.x-e.rect[0],r=e.rect[3]-i.y;n.push(`${t},${r}`)}n=n.join(" ");const r=this.svgFactory.createElement(this.svgElementName);this.#zt.push(r),r.setAttribute("points",n),r.setAttribute("stroke-width",e.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),e.popupRef||this._createPopup(r,e),i.append(r)}return this.container.append(i),this.container}getElementsToTriggerPopup(){return this.#zt}addHighlightArea(){this.container.classList.add("highlightArea")}}t.InkAnnotationElement=L;class R extends u{constructor(e){super(e,{isRenderable:!!(e.data.popupRef||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.popupRef||this._createPopup(),this.quadrilaterals?this._renderQuadrilaterals("highlightAnnotation"):(this.container.classList.add("highlightAnnotation"),this.container)}}class I extends u{constructor(e){super(e,{isRenderable:!!(e.data.popupRef||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.popupRef||this._createPopup(),this.quadrilaterals?this._renderQuadrilaterals("underlineAnnotation"):(this.container.classList.add("underlineAnnotation"),this.container)}}class F extends u{constructor(e){super(e,{isRenderable:!!(e.data.popupRef||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.popupRef||this._createPopup(),this.quadrilaterals?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.classList.add("squigglyAnnotation"),this.container)}}class D extends u{constructor(e){super(e,{isRenderable:!!(e.data.popupRef||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.popupRef||this._createPopup(),this.quadrilaterals?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.classList.add("strikeoutAnnotation"),this.container)}}class O extends u{constructor(e){super(e,{isRenderable:!!(e.data.popupRef||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),this.data.popupRef||this._createPopup(),this.container}}class N extends u{#Wt=null;constructor(e){super(e,{isRenderable:!0});const{filename:t,content:n}=this.data.file;this.filename=(0,r.getFilenameFromUrl)(t,!0),this.content=n,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:t,content:n})}render(){let e;return this.container.classList.add("fileAttachmentAnnotation"),this.data.hasAppearance?e=document.createElement("div"):(e=document.createElement("img"),e.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(this.data.name)?"paperclip":"pushpin"}.svg`),e.classList.add("popupTriggerArea"),e.addEventListener("dblclick",this._download.bind(this)),this.#Wt=e,!this.data.popupRef&&(this.data.titleObj?.str||this.data.contentsObj?.str||this.data.richText)&&this._createPopup(),this.container.append(e),this.container}getElementsToTriggerPopup(){return this.#Wt}addHighlightArea(){this.container.classList.add("highlightArea")}_download(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}t.AnnotationLayer=class{#We=null;#qt=null;#$t=new Map;constructor({div:e,accessibilityManager:t,annotationCanvasMap:i,l10n:r,page:s,viewport:a}){this.div=e,this.#We=t,this.#qt=i,this.l10n=r,this.page=s,this.viewport=a,this.zIndex=0;const{NullL10n:o}=n(32);this.l10n||=o}#Gt(e,t){const n=e.firstChild||e;n.id=`${r.AnnotationPrefix}${t}`,this.div.append(e),this.#We?.moveElementInDOM(this.div,e,n,!1)}async render(e){const{annotations:t}=e,n=this.div;(0,r.setLayerDimensions)(n,this.viewport);const a=new Map,o={data:null,layer:n,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new r.DOMSVGFactory,annotationStorage:e.annotationStorage||new s.AnnotationStorage,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const e of t){if(e.noHTML)continue;const t=e.annotationType===i.AnnotationType.POPUP;if(t){const t=a.get(e.id);if(!t)continue;o.elements=t}else{const{width:t,height:n}=d(e.rect);if(t<=0||n<=0)continue}o.data=e;const n=h.create(o);if(!n.isRenderable)continue;if(!t&&e.popupRef){const t=a.get(e.popupRef);t?t.push(n):a.set(e.popupRef,[n])}n.annotationEditorType>0&&this.#$t.set(n.data.id,n);const r=n.render();if(e.hidden&&(r.style.visibility="hidden"),Array.isArray(r))for(const t of r)this.#Gt(t,e.id);else this.#Gt(r,e.id)}this.#Xt(),await this.l10n.translate(n)}update({viewport:e}){const t=this.div;this.viewport=e,(0,r.setLayerDimensions)(t,{rotation:e.rotation}),this.#Xt(),t.hidden=!1}#Xt(){if(!this.#qt)return;const e=this.div;for(const[t,n]of this.#qt){const i=e.querySelector(`[data-annotation-id="${t}"]`);if(!i)continue;const{firstChild:r}=i;r?"CANVAS"===r.nodeName?r.replaceWith(n):r.before(n):i.append(n)}this.#qt.clear()}getEditableAnnotations(){return Array.from(this.#$t.values())}getEditableAnnotation(e){return this.#$t.get(e)}}},(e,t)=>{function n(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}Object.defineProperty(t,"__esModule",{value:!0}),t.ColorConverters=void 0,t.ColorConverters=class{static CMYK_G([e,t,n,i]){return["G",1-Math.min(1,.3*e+.59*n+.11*t+i)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_HTML([e]){const t=n(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return["G",.3*e+.59*t+.11*n]}static RGB_HTML([e,t,i]){return`#${n(e)}${n(t)}${n(i)}`}static T_HTML(){return"#00000000"}static CMYK_RGB([e,t,n,i]){return["RGB",1-Math.min(1,e+i),1-Math.min(1,n+i),1-Math.min(1,t+i)]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){const i=1-e,r=1-t,s=1-n;return["CMYK",i,r,s,Math.min(i,r,s)]}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayer=void 0;var i=n(19);t.XfaLayer=class{static setupStorage(e,t,n,i,r){const s=i.getValue(t,{value:null});switch(n.name){case"textarea":if(null!==s.value&&(e.textContent=s.value),"print"===r)break;e.addEventListener("input",(e=>{i.setValue(t,{value:e.target.value})}));break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(s.value===n.attributes.xfaOn?e.setAttribute("checked",!0):s.value===n.attributes.xfaOff&&e.removeAttribute("checked"),"print"===r)break;e.addEventListener("change",(e=>{i.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})}))}else{if(null!==s.value&&e.setAttribute("value",s.value),"print"===r)break;e.addEventListener("input",(e=>{i.setValue(t,{value:e.target.value})}))}break;case"select":if(null!==s.value)for(const e of n.children)e.attributes.value===s.value&&(e.attributes.selected=!0);e.addEventListener("input",(e=>{const n=e.target.options,r=-1===n.selectedIndex?"":n[n.selectedIndex].value;i.setValue(t,{value:r})}))}}static setAttributes({html:e,element:t,storage:n=null,intent:i,linkService:r}){const{attributes:s}=t,a=e instanceof HTMLAnchorElement;"radio"===s.type&&(s.name=`${s.name}-${i}`);for(const[t,n]of Object.entries(s))if(null!=n)switch(t){case"class":n.length&&e.setAttribute(t,n.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",n);break;case"style":Object.assign(e.style,n);break;case"textContent":e.textContent=n;break;default:(!a||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,n)}a&&r.addLinkAttributes(e,s.href,s.newWindow),n&&s.dataId&&this.setupStorage(e,s.dataId,t,n)}static render(e){const t=e.annotationStorage,n=e.linkService,r=e.xfaHtml,s=e.intent||"display",a=document.createElement(r.name);r.attributes&&this.setAttributes({html:a,element:r,intent:s,linkService:n});const o=[[r,-1,a]],l=e.div;if(l.append(a),e.viewport){const t=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=t}"richText"!==s&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){const[e,r,a]=o.at(-1);if(r+1===e.children.length){o.pop();continue}const l=e.children[++o.at(-1)[1]];if(null===l)continue;const{name:d}=l;if("#text"===d){const e=document.createTextNode(l.value);c.push(e),a.append(e);continue}let h;if(h=l?.attributes?.xmlns?document.createElementNS(l.attributes.xmlns,d):document.createElement(d),a.append(h),l.attributes&&this.setAttributes({html:h,element:l,storage:t,intent:s,linkService:n}),l.children&&l.children.length>0)o.push([l,-1,h]);else if(l.value){const e=document.createTextNode(l.value);i.XfaText.shouldBuildText(d)&&c.push(e),h.append(e)}}for(const e of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))e.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NullL10n=void 0,t.getL10nFallback=i;const n={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",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…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image"};function i(e,t){switch(e){case"find_match_count":e=`find_match_count[${1===t.total?"one":"other"}]`;break;case"find_match_count_limit":e=`find_match_count_limit[${1===t.limit?"one":"other"}]`}return n[e]||""}n.print_progress_percent="{{progress}}%";const r={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",get:async(e,t=null,n=i(e,t))=>function(e,t){return t?e.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,((e,n)=>n in t?t[n]:"{{"+n+"}}")):e}(n,t),async translate(e){}};t.NullL10n=r},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InkEditor=void 0;var i=n(1),r=n(4),s=n(29),a=n(5);const o=16;class l extends r.AnnotationEditor{#Kt=0;#Yt=0;#Qt=0;#Jt=this.canvasContextMenu.bind(this);#Zt=this.canvasPointermove.bind(this);#en=this.canvasPointerleave.bind(this);#tn=this.canvasPointerup.bind(this);#nn=this.canvasPointerdown.bind(this);#in=new Path2D;#rn=!1;#sn=!1;#an=!1;#on=null;#ln=0;#cn=0;#dn=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _l10nPromise;static _type="ink";constructor(e){super({...e,name:"inkEditor"}),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(e){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map((t=>[t,e.get(t)])))}static updateDefaultParams(e,t){switch(e){case i.AnnotationEditorParamsType.INK_THICKNESS:l._defaultThickness=t;break;case i.AnnotationEditorParamsType.INK_COLOR:l._defaultColor=t;break;case i.AnnotationEditorParamsType.INK_OPACITY:l._defaultOpacity=t/100}}updateParams(e,t){switch(e){case i.AnnotationEditorParamsType.INK_THICKNESS:this.#hn(t);break;case i.AnnotationEditorParamsType.INK_COLOR:this.#ft(t);break;case i.AnnotationEditorParamsType.INK_OPACITY:this.#un(t)}}static get defaultPropertiesToUpdate(){return[[i.AnnotationEditorParamsType.INK_THICKNESS,l._defaultThickness],[i.AnnotationEditorParamsType.INK_COLOR,l._defaultColor||r.AnnotationEditor._defaultLineColor],[i.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*l._defaultOpacity)]]}get propertiesToUpdate(){return[[i.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||l._defaultThickness],[i.AnnotationEditorParamsType.INK_COLOR,this.color||l._defaultColor||r.AnnotationEditor._defaultLineColor],[i.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??l._defaultOpacity))]]}#hn(e){const t=this.thickness;this.addCommands({cmd:()=>{this.thickness=e,this.#pn()},undo:()=>{this.thickness=t,this.#pn()},mustExec:!0,type:i.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#ft(e){const t=this.color;this.addCommands({cmd:()=>{this.color=e,this.#fn()},undo:()=>{this.color=t,this.#fn()},mustExec:!0,type:i.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#un(e){e/=100;const t=this.opacity;this.addCommands({cmd:()=>{this.opacity=e,this.#fn()},undo:()=>{this.opacity=t,this.#fn()},mustExec:!0,type:i.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){super.rebuild(),null!==this.div&&(this.canvas||(this.#gn(),this.#mn()),this.isAttachedToDOM||(this.parent.add(this),this.#_n()),this.#pn())}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#on.disconnect(),this.#on=null,super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&null===e&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){const[e,t]=this.parentDimensions,n=this.width*e,i=this.height*t;this.setDimensions(n,i)}enableEditMode(){this.#rn||null===this.canvas||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",this.#nn))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#nn))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#bn(){const{parentRotation:e,parentDimensions:[t,n]}=this;switch(e){case 90:return[0,n,n,t];case 180:return[t,n,t,n];case 270:return[t,0,n,t];default:return[0,0,t,n]}}#vn(){const{ctx:e,color:t,opacity:n,thickness:i,parentScale:r,scaleFactor:s}=this;e.lineWidth=i*r/s,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle=`${t}${(0,a.opacityToHex)(n)}`}#yn(e,t){this.canvas.addEventListener("contextmenu",this.#Jt),this.canvas.addEventListener("pointerleave",this.#en),this.canvas.addEventListener("pointermove",this.#Zt),this.canvas.addEventListener("pointerup",this.#tn),this.canvas.removeEventListener("pointerdown",this.#nn),this.isEditing=!0,this.#an||(this.#an=!0,this.#_n(),this.thickness||=l._defaultThickness,this.color||=l._defaultColor||r.AnnotationEditor._defaultLineColor,this.opacity??=l._defaultOpacity),this.currentPath.push([e,t]),this.#sn=!1,this.#vn(),this.#dn=()=>{this.#An(),this.#dn&&window.requestAnimationFrame(this.#dn)},window.requestAnimationFrame(this.#dn)}#xn(e,t){const[n,i]=this.currentPath.at(-1);if(this.currentPath.length>1&&e===n&&t===i)return;const r=this.currentPath;let s=this.#in;if(r.push([e,t]),this.#sn=!0,r.length<=2)return s.moveTo(...r[0]),void s.lineTo(e,t);3===r.length&&(this.#in=s=new Path2D,s.moveTo(...r[0])),this.#Sn(s,...r.at(-3),...r.at(-2),e,t)}#wn(){if(0===this.currentPath.length)return;const e=this.currentPath.at(-1);this.#in.lineTo(...e)}#En(e,t){let n;if(this.#dn=null,e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height),this.#xn(e,t),this.#wn(),1!==this.currentPath.length)n=this.#Pn();else{const i=[e,t];n=[[i,i.slice(),i.slice(),i]]}const i=this.#in,r=this.currentPath;this.currentPath=[],this.#in=new Path2D,this.addCommands({cmd:()=>{this.allRawPaths.push(r),this.paths.push(n),this.bezierPath2D.push(i),this.rebuild()},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#gn(),this.#mn()),this.#pn())},mustExec:!0})}#An(){if(!this.#sn)return;this.#sn=!1,Math.ceil(this.thickness*this.parentScale);const e=this.currentPath.slice(-3),t=e.map((e=>e[0])),n=e.map((e=>e[1])),{ctx:i}=(Math.min(...t),Math.max(...t),Math.min(...n),Math.max(...n),this);i.save(),i.clearRect(0,0,this.canvas.width,this.canvas.height);for(const e of this.bezierPath2D)i.stroke(e);i.stroke(this.#in),i.restore()}#Sn(e,t,n,i,r,s,a){const o=(t+i)/2,l=(n+r)/2,c=(i+s)/2,d=(r+a)/2;e.bezierCurveTo(o+2*(i-o)/3,l+2*(r-l)/3,c+2*(i-c)/3,d+2*(r-d)/3,c,d)}#Pn(){const e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];const t=[];let n,[i,r]=e[0];for(n=1;n<e.length-2;n++){const[s,a]=e[n],[o,l]=e[n+1],c=(s+o)/2,d=(a+l)/2,h=[i+2*(s-i)/3,r+2*(a-r)/3],u=[c+2*(s-c)/3,d+2*(a-d)/3];t.push([[i,r],h,u,[c,d]]),[i,r]=[c,d]}const[s,a]=e[n],[o,l]=e[n+1],c=[i+2*(s-i)/3,r+2*(a-r)/3],d=[o+2*(s-o)/3,l+2*(a-l)/3];return t.push([[i,r],c,d,[o,l]]),t}#fn(){if(this.isEmpty())return void this.#Cn();this.#vn();const{canvas:e,ctx:t}=this;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),this.#Cn();for(const e of this.bezierPath2D)t.stroke(e)}commit(){this.#rn||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#rn=!0,this.div.classList.add("disabled"),this.#pn(!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus({preventScroll:!0}))}focusin(e){super.focusin(e),this.enableEditMode()}canvasPointerdown(e){0===e.button&&this.isInEditMode()&&!this.#rn&&(this.setInForeground(),e.preventDefault(),"mouse"!==e.type&&this.div.focus(),this.#yn(e.offsetX,e.offsetY))}canvasContextMenu(e){e.preventDefault()}canvasPointermove(e){e.preventDefault(),this.#xn(e.offsetX,e.offsetY)}canvasPointerup(e){e.preventDefault(),this.#kn(e)}canvasPointerleave(e){this.#kn(e)}#kn(e){this.canvas.removeEventListener("pointerleave",this.#en),this.canvas.removeEventListener("pointermove",this.#Zt),this.canvas.removeEventListener("pointerup",this.#tn),this.canvas.addEventListener("pointerdown",this.#nn),setTimeout((()=>{this.canvas.removeEventListener("contextmenu",this.#Jt)}),10),this.#En(e.offsetX,e.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#gn(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",l._l10nPromise.get("editor_ink_canvas_aria_label").then((e=>this.canvas?.setAttribute("aria-label",e))),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#mn(){this.#on=new ResizeObserver((e=>{const t=e[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)})),this.#on.observe(this.div)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),l._l10nPromise.get("editor_ink2_aria_label").then((e=>this.div?.setAttribute("aria-label",e)));const[n,i,r,s]=this.#bn();if(this.setAt(n,i,0,0),this.setDims(r,s),this.#gn(),this.width){const[n,i]=this.parentDimensions;this.setAt(e*n,t*i,this.width*n,this.height*i),this.#an=!0,this.#_n(),this.setDims(this.width*n,this.height*i),this.#fn(),this.#Tn(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#mn(),this.div}#_n(){if(!this.#an)return;const[e,t]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*t),this.#Cn()}setDimensions(e,t){const n=Math.round(e),i=Math.round(t);if(this.#ln===n&&this.#cn===i)return;this.#ln=n,this.#cn=i,this.canvas.style.visibility="hidden",this.#Kt&&Math.abs(this.#Kt-e/t)>.01&&(t=Math.ceil(e/this.#Kt),this.setDims(e,t));const[r,s]=this.parentDimensions;this.width=e/r,this.height=t/s,this.#rn&&this.#Mn(e,t),this.#_n(),this.#fn(),this.canvas.style.visibility="visible",this.fixDims()}#Mn(e,t){const n=this.#Ln(),i=(e-n)/this.#Qt,r=(t-n)/this.#Yt;this.scaleFactor=Math.min(i,r)}#Cn(){const e=this.#Ln()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}static#Rn(e){const t=new Path2D;for(let n=0,i=e.length;n<i;n++){const[i,r,s,a]=e[n];0===n&&t.moveTo(...i),t.bezierCurveTo(r[0],r[1],s[0],s[1],a[0],a[1])}return t}static#In(e,t,n){const[i,r,s,a]=t;switch(n){case 0:for(let t=0,n=e.length;t<n;t+=2)e[t]+=i,e[t+1]=a-e[t+1];break;case 90:for(let t=0,n=e.length;t<n;t+=2){const n=e[t];e[t]=e[t+1]+i,e[t+1]=n+r}break;case 180:for(let t=0,n=e.length;t<n;t+=2)e[t]=s-e[t],e[t+1]+=r;break;case 270:for(let t=0,n=e.length;t<n;t+=2){const n=e[t];e[t]=s-e[t+1],e[t+1]=a-n}break;default:throw new Error("Invalid rotation")}return e}static#Fn(e,t,n){const[i,r,s,a]=t;switch(n){case 0:for(let t=0,n=e.length;t<n;t+=2)e[t]-=i,e[t+1]=a-e[t+1];break;case 90:for(let t=0,n=e.length;t<n;t+=2){const n=e[t];e[t]=e[t+1]-r,e[t+1]=n-i}break;case 180:for(let t=0,n=e.length;t<n;t+=2)e[t]=s-e[t],e[t+1]-=r;break;case 270:for(let t=0,n=e.length;t<n;t+=2){const n=e[t];e[t]=a-e[t+1],e[t+1]=s-n}break;default:throw new Error("Invalid rotation")}return e}#Dn(e,t,n,i){const r=[],s=this.thickness/2,a=e*t+s,o=e*n+s;for(const t of this.paths){const n=[],s=[];for(let i=0,r=t.length;i<r;i++){const[l,c,d,h]=t[i],u=e*l[0]+a,p=e*l[1]+o,f=e*c[0]+a,g=e*c[1]+o,m=e*d[0]+a,_=e*d[1]+o,b=e*h[0]+a,v=e*h[1]+o;0===i&&(n.push(u,p),s.push(u,p)),n.push(f,g,m,_,b,v),s.push(f,g),i===r-1&&s.push(b,v)}r.push({bezier:l.#In(n,i,this.rotation),points:l.#In(s,i,this.rotation)})}return r}#On(){let e=1/0,t=-1/0,n=1/0,r=-1/0;for(const s of this.paths)for(const[a,o,l,c]of s){const s=i.Util.bezierBoundingBox(...a,...o,...l,...c);e=Math.min(e,s[0]),n=Math.min(n,s[1]),t=Math.max(t,s[2]),r=Math.max(r,s[3])}return[e,n,t,r]}#Ln(){return this.#rn?Math.ceil(this.thickness*this.parentScale):0}#pn(e=!1){if(this.isEmpty())return;if(!this.#rn)return void this.#fn();const t=this.#On(),n=this.#Ln();this.#Qt=Math.max(o,t[2]-t[0]),this.#Yt=Math.max(o,t[3]-t[1]);const i=Math.ceil(n+this.#Qt*this.scaleFactor),r=Math.ceil(n+this.#Yt*this.scaleFactor),[s,a]=this.parentDimensions;this.width=i/s,this.height=r/a,this.#Kt=i/r,this.#Tn();const l=this.translationX,c=this.translationY;this.translationX=-t[0],this.translationY=-t[1],this.#_n(),this.#fn(),this.#ln=i,this.#cn=r,this.setDims(i,r);const d=e?n/this.scaleFactor/2:0;this.translate(l-this.translationX-d,c-this.translationY-d)}#Tn(){const{style:e}=this.div;this.#Kt>=1?(e.minHeight="16px",e.minWidth=`${Math.round(this.#Kt*o)}px`):(e.minWidth="16px",e.minHeight=`${Math.round(o/this.#Kt)}px`)}static deserialize(e,t,n){if(e instanceof s.InkAnnotationElement)return null;const r=super.deserialize(e,t,n);r.thickness=e.thickness,r.color=i.Util.makeHexColor(...e.color),r.opacity=e.opacity;const[a,c]=r.pageDimensions,d=r.width*a,h=r.height*c,u=r.parentScale,p=e.thickness/2;r.#Kt=d/h,r.#rn=!0,r.#ln=Math.round(d),r.#cn=Math.round(h);const{paths:f,rect:g,rotation:m}=e;for(let{bezier:e}of f){e=l.#Fn(e,g,m);const t=[];r.paths.push(t);let n=u*(e[0]-p),i=u*(e[1]-p);for(let r=2,s=e.length;r<s;r+=6){const s=u*(e[r]-p),a=u*(e[r+1]-p),o=u*(e[r+2]-p),l=u*(e[r+3]-p),c=u*(e[r+4]-p),d=u*(e[r+5]-p);t.push([[n,i],[s,a],[o,l],[c,d]]),n=c,i=d}const s=this.#Rn(t);r.bezierPath2D.push(s)}const _=r.#On();return r.#Qt=Math.max(o,_[2]-_[0]),r.#Yt=Math.max(o,_[3]-_[1]),r.#Mn(d,h),r}serialize(){if(this.isEmpty())return null;const e=this.getRect(0,0),t=r.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:i.AnnotationEditorType.INK,color:t,thickness:this.thickness,opacity:this.opacity,paths:this.#Dn(this.scaleFactor/this.parentScale,this.translationX,this.translationY,e),pageIndex:this.pageIndex,rect:e,rotation:this.rotation}}}t.InkEditor=l},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var i=n(6),r=n(1),s=n(10);const a="normal",o="#000000",l=["butt","round","square"],c=["miter","round","bevel"],d=function(e,t="",n=!1){if(URL.createObjectURL&&"undefined"!=typeof Blob&&!n)return URL.createObjectURL(new Blob([e],{type:t}));const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let r=`data:${t};base64,`;for(let t=0,n=e.length;t<n;t+=3){const s=255&e[t],a=255&e[t+1],o=255&e[t+2];r+=i[s>>2]+i[(3&s)<<4|a>>4]+i[t+1<n?(15&a)<<2|o>>6:64]+i[t+2<n?63&o:64]}return r},h=function(){const e=new Uint8Array([137,80,78,71,13,10,26,10]),t=new Int32Array(256);for(let e=0;e<256;e++){let n=e;for(let e=0;e<8;e++)n=1&n?3988292384^n>>1&2147483647:n>>1&2147483647;t[e]=n}function n(e,n,i,r){let s=r;const a=n.length;i[s]=a>>24&255,i[s+1]=a>>16&255,i[s+2]=a>>8&255,i[s+3]=255&a,s+=4,i[s]=255&e.charCodeAt(0),i[s+1]=255&e.charCodeAt(1),i[s+2]=255&e.charCodeAt(2),i[s+3]=255&e.charCodeAt(3),s+=4,i.set(n,s),s+=n.length;const o=function(e,n,i){let r=-1;for(let s=n;s<i;s++){const n=255&(r^e[s]);r=r>>>8^t[n]}return-1^r}(i,r+4,s);i[s]=o>>24&255,i[s+1]=o>>16&255,i[s+2]=o>>8&255,i[s+3]=255&o}function i(e){let t=e.length;const n=65535,i=Math.ceil(t/n),r=new Uint8Array(2+t+5*i+4);let s=0;r[s++]=120,r[s++]=156;let a=0;for(;t>n;)r[s++]=0,r[s++]=255,r[s++]=255,r[s++]=0,r[s++]=0,r.set(e.subarray(a,a+n),s),s+=n,a+=n,t-=n;r[s++]=1,r[s++]=255&t,r[s++]=t>>8&255,r[s++]=255&~t,r[s++]=(65535&~t)>>8&255,r.set(e.subarray(a),s),s+=e.length-a;const o=function(e,t,n){let i=1,r=0;for(let t=0;t<n;++t)i=(i+(255&e[t]))%65521,r=(r+i)%65521;return r<<16|i}(e,0,e.length);return r[s++]=o>>24&255,r[s++]=o>>16&255,r[s++]=o>>8&255,r[s++]=255&o,r}return function(t,a,o){return function(t,a,o,l){const c=t.width,h=t.height;let u,p,f;const g=t.data;switch(a){case r.ImageKind.GRAYSCALE_1BPP:p=0,u=1,f=c+7>>3;break;case r.ImageKind.RGB_24BPP:p=2,u=8,f=3*c;break;case r.ImageKind.RGBA_32BPP:p=6,u=8,f=4*c;break;default:throw new Error("invalid format")}const m=new Uint8Array((1+f)*h);let _=0,b=0;for(let e=0;e<h;++e)m[_++]=0,m.set(g.subarray(b,b+f),_),b+=f,_+=f;if(a===r.ImageKind.GRAYSCALE_1BPP&&l){_=0;for(let e=0;e<h;e++){_++;for(let e=0;e<f;e++)m[_++]^=255}}const v=new Uint8Array([c>>24&255,c>>16&255,c>>8&255,255&c,h>>24&255,h>>16&255,h>>8&255,255&h,u,p,0,0,0]),y=function(e){if(!s.isNodeJS)return i(e);try{let t;t=parseInt(process.versions.node)>=8?e:Buffer.from(e);const n=__webpack_require__(258).deflateSync(t,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(e){(0,r.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return i(e)}(m),A=e.length+36+v.length+y.length,x=new Uint8Array(A);let S=0;return x.set(e,S),S+=e.length,n("IHDR",v,x,S),S+=12+v.length,n("IDATA",y,x,S),S+=12+y.length,n("IEND",new Uint8Array(0),x,S),d(x,"image/png",o)}(t,void 0===t.kind?r.ImageKind.GRAYSCALE_1BPP:t.kind,a,o)}}();class u{constructor(){this.fontSizeScale=1,this.fontWeight=a,this.fontSize=0,this.textMatrix=r.IDENTITY_MATRIX,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=r.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=o,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(e,t){this.x=e,this.y=t}}function p(e){if(Number.isInteger(e))return e.toString();const t=e.toFixed(10);let n=t.length-1;if("0"!==t[n])return t;do{n--}while("0"===t[n]);return t.substring(0,"."===t[n]?n:n+1)}function f(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":`scale(${p(e[0])} ${p(e[3])})`;if(e[0]===e[3]&&e[1]===-e[2])return`rotate(${p(180*Math.acos(e[0])/Math.PI)})`}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return`translate(${p(e[4])} ${p(e[5])})`;return`matrix(${p(e[0])} ${p(e[1])} ${p(e[2])} ${p(e[3])} ${p(e[4])} ${p(e[5])})`}let g=0,m=0,_=0;t.SVGGraphics=class{constructor(e,t,n=!1){(0,i.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new i.DOMSVGFactory,this.current=new u,this.transformMatrix=r.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=e,this.objs=t,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!n,this._operatorIdMapping=[];for(const e in r.OPS)this._operatorIdMapping[r.OPS[e]]=e}getObject(e,t=null){return"string"==typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}save(){this.transformStack.push(this.transformMatrix);const e=this.current;this.extraStack.push(e),this.current=e.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(e){this.save(),this.executeOpTree(e),this.restore()}loadDependencies(e){const t=e.fnArray,n=e.argsArray;for(let e=0,i=t.length;e<i;e++)if(t[e]===r.OPS.dependency)for(const t of n[e]){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(e,t,n,i,s,a){const o=[e,t,n,i,s,a];this.transformMatrix=r.Util.transform(this.transformMatrix,o),this.tgrp=null}getSVG(e,t){this.viewport=t;const n=this._initialize(t);return this.loadDependencies(e).then((()=>(this.transformMatrix=r.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(e)),n)))}convertOpList(e){const t=this._operatorIdMapping,n=e.argsArray,i=e.fnArray,r=[];for(let e=0,s=i.length;e<s;e++){const s=i[e];r.push({fnId:s,fn:t[s],args:n[e]})}return function(e){let t=[];const n=[];for(const i of e)"save"!==i.fn?"restore"===i.fn?t=n.pop():t.push(i):(t.push({fnId:92,fn:"group",items:[]}),n.push(t),t=t.at(-1).items);return t}(r)}executeOpTree(e){for(const t of e){const e=t.fn,n=t.fnId,i=t.args;switch(0|n){case r.OPS.beginText:this.beginText();break;case r.OPS.dependency:break;case r.OPS.setLeading:this.setLeading(i);break;case r.OPS.setLeadingMoveText:this.setLeadingMoveText(i[0],i[1]);break;case r.OPS.setFont:this.setFont(i);break;case r.OPS.showText:case r.OPS.showSpacedText:this.showText(i[0]);break;case r.OPS.endText:this.endText();break;case r.OPS.moveText:this.moveText(i[0],i[1]);break;case r.OPS.setCharSpacing:this.setCharSpacing(i[0]);break;case r.OPS.setWordSpacing:this.setWordSpacing(i[0]);break;case r.OPS.setHScale:this.setHScale(i[0]);break;case r.OPS.setTextMatrix:this.setTextMatrix(i[0],i[1],i[2],i[3],i[4],i[5]);break;case r.OPS.setTextRise:this.setTextRise(i[0]);break;case r.OPS.setTextRenderingMode:this.setTextRenderingMode(i[0]);break;case r.OPS.setLineWidth:this.setLineWidth(i[0]);break;case r.OPS.setLineJoin:this.setLineJoin(i[0]);break;case r.OPS.setLineCap:this.setLineCap(i[0]);break;case r.OPS.setMiterLimit:this.setMiterLimit(i[0]);break;case r.OPS.setFillRGBColor:this.setFillRGBColor(i[0],i[1],i[2]);break;case r.OPS.setStrokeRGBColor:this.setStrokeRGBColor(i[0],i[1],i[2]);break;case r.OPS.setStrokeColorN:this.setStrokeColorN(i);break;case r.OPS.setFillColorN:this.setFillColorN(i);break;case r.OPS.shadingFill:this.shadingFill(i[0]);break;case r.OPS.setDash:this.setDash(i[0],i[1]);break;case r.OPS.setRenderingIntent:this.setRenderingIntent(i[0]);break;case r.OPS.setFlatness:this.setFlatness(i[0]);break;case r.OPS.setGState:this.setGState(i[0]);break;case r.OPS.fill:this.fill();break;case r.OPS.eoFill:this.eoFill();break;case r.OPS.stroke:this.stroke();break;case r.OPS.fillStroke:this.fillStroke();break;case r.OPS.eoFillStroke:this.eoFillStroke();break;case r.OPS.clip:this.clip("nonzero");break;case r.OPS.eoClip:this.clip("evenodd");break;case r.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case r.OPS.paintImageXObject:this.paintImageXObject(i[0]);break;case r.OPS.paintInlineImageXObject:this.paintInlineImageXObject(i[0]);break;case r.OPS.paintImageMaskXObject:this.paintImageMaskXObject(i[0]);break;case r.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(i[0],i[1]);break;case r.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case r.OPS.closePath:this.closePath();break;case r.OPS.closeStroke:this.closeStroke();break;case r.OPS.closeFillStroke:this.closeFillStroke();break;case r.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case r.OPS.nextLine:this.nextLine();break;case r.OPS.transform:this.transform(i[0],i[1],i[2],i[3],i[4],i[5]);break;case r.OPS.constructPath:this.constructPath(i[0],i[1]);break;case r.OPS.endPath:this.endPath();break;case 92:this.group(t.items);break;default:(0,r.warn)(`Unimplemented operator ${e}`)}}}setWordSpacing(e){this.current.wordSpacing=e}setCharSpacing(e){this.current.charSpacing=e}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(e,t,n,i,r,s){const a=this.current;a.textMatrix=a.lineMatrix=[e,t,n,i,r,s],a.textMatrixScale=Math.hypot(e,t),a.x=a.lineX=0,a.y=a.lineY=0,a.xcoords=[],a.ycoords=[],a.tspan=this.svgFactory.createElement("svg:tspan"),a.tspan.setAttributeNS(null,"font-family",a.fontFamily),a.tspan.setAttributeNS(null,"font-size",`${p(a.fontSize)}px`),a.tspan.setAttributeNS(null,"y",p(-a.y)),a.txtElement=this.svgFactory.createElement("svg:text"),a.txtElement.append(a.tspan)}beginText(){const e=this.current;e.x=e.lineX=0,e.y=e.lineY=0,e.textMatrix=r.IDENTITY_MATRIX,e.lineMatrix=r.IDENTITY_MATRIX,e.textMatrixScale=1,e.tspan=this.svgFactory.createElement("svg:tspan"),e.txtElement=this.svgFactory.createElement("svg:text"),e.txtgrp=this.svgFactory.createElement("svg:g"),e.xcoords=[],e.ycoords=[]}moveText(e,t){const n=this.current;n.x=n.lineX+=e,n.y=n.lineY+=t,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",`${p(n.fontSize)}px`),n.tspan.setAttributeNS(null,"y",p(-n.y))}showText(e){const t=this.current,n=t.font,i=t.fontSize;if(0===i)return;const s=t.fontSizeScale,l=t.charSpacing,c=t.wordSpacing,d=t.fontDirection,h=t.textHScale*d,u=n.vertical,g=u?1:-1,m=n.defaultVMetrics,_=i*t.fontMatrix[0];let b=0;for(const r of e){if(null===r){b+=d*c;continue}if("number"==typeof r){b+=g*r*i/1e3;continue}const e=(r.isSpace?c:0)+l,a=r.fontChar;let o,h,p,f=r.width;if(u){let e;const t=r.vmetric||m;e=r.vmetric?t[1]:.5*f,e=-e*_;const n=t[2]*_;f=t?-t[0]:f,o=e/s,h=(b+n)/s}else o=b/s,h=0;(r.isInFont||n.missingFile)&&(t.xcoords.push(t.x+o),u&&t.ycoords.push(-t.y+h),t.tspan.textContent+=a),p=u?f*_-e*d:f*_+e*d,b+=p}t.tspan.setAttributeNS(null,"x",t.xcoords.map(p).join(" ")),u?t.tspan.setAttributeNS(null,"y",t.ycoords.map(p).join(" ")):t.tspan.setAttributeNS(null,"y",p(-t.y)),u?t.y-=b:t.x+=b*h,t.tspan.setAttributeNS(null,"font-family",t.fontFamily),t.tspan.setAttributeNS(null,"font-size",`${p(t.fontSize)}px`),"normal"!==t.fontStyle&&t.tspan.setAttributeNS(null,"font-style",t.fontStyle),t.fontWeight!==a&&t.tspan.setAttributeNS(null,"font-weight",t.fontWeight);const v=t.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;if(v===r.TextRenderingMode.FILL||v===r.TextRenderingMode.FILL_STROKE?(t.fillColor!==o&&t.tspan.setAttributeNS(null,"fill",t.fillColor),t.fillAlpha<1&&t.tspan.setAttributeNS(null,"fill-opacity",t.fillAlpha)):t.textRenderingMode===r.TextRenderingMode.ADD_TO_PATH?t.tspan.setAttributeNS(null,"fill","transparent"):t.tspan.setAttributeNS(null,"fill","none"),v===r.TextRenderingMode.STROKE||v===r.TextRenderingMode.FILL_STROKE){const e=1/(t.textMatrixScale||1);this._setStrokeAttributes(t.tspan,e)}let y=t.textMatrix;0!==t.textRise&&(y=y.slice(),y[5]+=t.textRise),t.txtElement.setAttributeNS(null,"transform",`${f(y)} scale(${p(h)}, -1)`),t.txtElement.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),t.txtElement.append(t.tspan),t.txtgrp.append(t.txtElement),this._ensureTransformGroup().append(t.txtElement)}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}addFontStyle(e){if(!e.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const t=d(e.data,e.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${e.loadedName}"; src: url(${t}); }\n`}setFont(e){const t=this.current,n=this.commonObjs.get(e[0]);let i=e[1];t.font=n,!this.embedFonts||n.missingFile||this.embeddedFonts[n.loadedName]||(this.addFontStyle(n),this.embeddedFonts[n.loadedName]=n),t.fontMatrix=n.fontMatrix||r.FONT_IDENTITY_MATRIX;let s="normal";n.black?s="900":n.bold&&(s="bold");const a=n.italic?"italic":"normal";i<0?(i=-i,t.fontDirection=-1):t.fontDirection=1,t.fontSize=i,t.fontFamily=n.loadedName,t.fontWeight=s,t.fontStyle=a,t.tspan=this.svgFactory.createElement("svg:tspan"),t.tspan.setAttributeNS(null,"y",p(-t.y)),t.xcoords=[],t.ycoords=[]}endText(){const e=this.current;e.textRenderingMode&r.TextRenderingMode.ADD_TO_PATH_FLAG&&e.txtElement?.hasChildNodes()&&(e.element=e.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(e){e>0&&(this.current.lineWidth=e)}setLineCap(e){this.current.lineCap=l[e]}setLineJoin(e){this.current.lineJoin=c[e]}setMiterLimit(e){this.current.miterLimit=e}setStrokeAlpha(e){this.current.strokeAlpha=e}setStrokeRGBColor(e,t,n){this.current.strokeColor=r.Util.makeHexColor(e,t,n)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,n){this.current.fillColor=r.Util.makeHexColor(e,t,n),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(e){this.current.strokeColor=this._makeColorN_Pattern(e)}setFillColorN(e){this.current.fillColor=this._makeColorN_Pattern(e)}shadingFill(e){const{width:t,height:n}=this.viewport,i=r.Util.inverseTransform(this.transformMatrix),[s,a,o,l]=r.Util.getAxialAlignedBoundingBox([0,0,t,n],i),c=this.svgFactory.createElement("svg:rect");c.setAttributeNS(null,"x",s),c.setAttributeNS(null,"y",a),c.setAttributeNS(null,"width",o-s),c.setAttributeNS(null,"height",l-a),c.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&c.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(c)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){const t=e[1],n=e[2],i=e[3]||r.IDENTITY_MATRIX,[s,a,o,l]=e[4],c=e[5],d=e[6],h=e[7],u="shading"+_++,[p,f,g,m]=r.Util.normalizeRect([...r.Util.applyTransform([s,a],i),...r.Util.applyTransform([o,l],i)]),[b,v]=r.Util.singularValueDecompose2dScale(i),y=c*b,A=d*v,x=this.svgFactory.createElement("svg:pattern");x.setAttributeNS(null,"id",u),x.setAttributeNS(null,"patternUnits","userSpaceOnUse"),x.setAttributeNS(null,"width",y),x.setAttributeNS(null,"height",A),x.setAttributeNS(null,"x",`${p}`),x.setAttributeNS(null,"y",`${f}`);const S=this.svg,w=this.transformMatrix,E=this.current.fillColor,P=this.current.strokeColor,C=this.svgFactory.create(g-p,m-f);if(this.svg=C,this.transformMatrix=i,2===h){const e=r.Util.makeHexColor(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(n)),this.svg=S,this.transformMatrix=w,this.current.fillColor=E,this.current.strokeColor=P,x.append(C.childNodes[0]),this.defs.append(x),`url(#${u})`}_makeShadingPattern(e){switch("string"==typeof e&&(e=this.objs.get(e)),e[0]){case"RadialAxial":const t="shading"+_++,n=e[3];let i;switch(e[1]){case"axial":const n=e[4],r=e[5];i=this.svgFactory.createElement("svg:linearGradient"),i.setAttributeNS(null,"id",t),i.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),i.setAttributeNS(null,"x1",n[0]),i.setAttributeNS(null,"y1",n[1]),i.setAttributeNS(null,"x2",r[0]),i.setAttributeNS(null,"y2",r[1]);break;case"radial":const s=e[4],a=e[5],o=e[6],l=e[7];i=this.svgFactory.createElement("svg:radialGradient"),i.setAttributeNS(null,"id",t),i.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),i.setAttributeNS(null,"cx",a[0]),i.setAttributeNS(null,"cy",a[1]),i.setAttributeNS(null,"r",l),i.setAttributeNS(null,"fx",s[0]),i.setAttributeNS(null,"fy",s[1]),i.setAttributeNS(null,"fr",o);break;default:throw new Error(`Unknown RadialAxial type: ${e[1]}`)}for(const e of n){const t=this.svgFactory.createElement("svg:stop");t.setAttributeNS(null,"offset",e[0]),t.setAttributeNS(null,"stop-color",e[1]),i.append(t)}return this.defs.append(i),`url(#${t})`;case"Mesh":return(0,r.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${e[0]}`)}}setDash(e,t){this.current.dashArray=e,this.current.dashPhase=t}constructPath(e,t){const n=this.current;let i=n.x,s=n.y,a=[],o=0;for(const n of e)switch(0|n){case r.OPS.rectangle:i=t[o++],s=t[o++];const e=i+t[o++],n=s+t[o++];a.push("M",p(i),p(s),"L",p(e),p(s),"L",p(e),p(n),"L",p(i),p(n),"Z");break;case r.OPS.moveTo:i=t[o++],s=t[o++],a.push("M",p(i),p(s));break;case r.OPS.lineTo:i=t[o++],s=t[o++],a.push("L",p(i),p(s));break;case r.OPS.curveTo:i=t[o+4],s=t[o+5],a.push("C",p(t[o]),p(t[o+1]),p(t[o+2]),p(t[o+3]),p(i),p(s)),o+=6;break;case r.OPS.curveTo2:a.push("C",p(i),p(s),p(t[o]),p(t[o+1]),p(t[o+2]),p(t[o+3])),i=t[o+2],s=t[o+3],o+=4;break;case r.OPS.curveTo3:i=t[o+2],s=t[o+3],a.push("C",p(t[o]),p(t[o+1]),p(i),p(s),p(i),p(s)),o+=4;break;case r.OPS.closePath:a.push("Z")}a=a.join(" "),n.path&&e.length>0&&e[0]!==r.OPS.rectangle&&e[0]!==r.OPS.moveTo?a=n.path.getAttributeNS(null,"d")+a:(n.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(n.path)),n.path.setAttributeNS(null,"d",a),n.path.setAttributeNS(null,"fill","none"),n.element=n.path,n.setCurrentPoint(i,s)}endPath(){const e=this.current;if(e.path=null,!this.pendingClip)return;if(!e.element)return void(this.pendingClip=null);const t="clippath"+g++,n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",t),n.setAttributeNS(null,"transform",f(this.transformMatrix));const i=e.element.cloneNode(!0);if("evenodd"===this.pendingClip?i.setAttributeNS(null,"clip-rule","evenodd"):i.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,n.append(i),this.defs.append(n),e.activeClipUrl){e.clipGroup=null;for(const e of this.extraStack)e.clipGroup=null;n.setAttributeNS(null,"clip-path",e.activeClipUrl)}e.activeClipUrl=`url(#${t})`,this.tgrp=null}clip(e){this.pendingClip=e}closePath(){const e=this.current;if(e.path){const t=`${e.path.getAttributeNS(null,"d")}Z`;e.path.setAttributeNS(null,"d",t)}}setLeading(e){this.current.leading=-e}setTextRise(e){this.current.textRise=e}setTextRenderingMode(e){this.current.textRenderingMode=e}setHScale(e){this.current.textHScale=e/100}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){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,r.warn)(`Unimplemented graphic state operator ${t}`)}}fill(){const e=this.current;e.element&&(e.element.setAttributeNS(null,"fill",e.fillColor),e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha),this.endPath())}stroke(){const e=this.current;e.element&&(this._setStrokeAttributes(e.element),e.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(e,t=1){const n=this.current;let i=n.dashArray;1!==t&&i.length>0&&(i=i.map((function(e){return t*e}))),e.setAttributeNS(null,"stroke",n.strokeColor),e.setAttributeNS(null,"stroke-opacity",n.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",p(n.miterLimit)),e.setAttributeNS(null,"stroke-linecap",n.lineCap),e.setAttributeNS(null,"stroke-linejoin",n.lineJoin),e.setAttributeNS(null,"stroke-width",p(t*n.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",i.map(p).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",p(t*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 e=this.svgFactory.createElement("svg:rect");e.setAttributeNS(null,"x","0"),e.setAttributeNS(null,"y","0"),e.setAttributeNS(null,"width","1px"),e.setAttributeNS(null,"height","1px"),e.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(e)}paintImageXObject(e){const t=this.getObject(e);t?this.paintInlineImageXObject(t):(0,r.warn)(`Dependent image with object ID ${e} is not ready yet`)}paintInlineImageXObject(e,t){const n=e.width,i=e.height,r=h(e,this.forceDataSchema,!!t),s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y","0"),s.setAttributeNS(null,"width",p(n)),s.setAttributeNS(null,"height",p(i)),this.current.element=s,this.clip("nonzero");const a=this.svgFactory.createElement("svg:image");a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r),a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y",p(-i)),a.setAttributeNS(null,"width",p(n)+"px"),a.setAttributeNS(null,"height",p(i)+"px"),a.setAttributeNS(null,"transform",`scale(${p(1/n)} ${p(-1/i)})`),t?t.append(a):this._ensureTransformGroup().append(a)}paintImageMaskXObject(e){const t=this.getObject(e.data,e);if(t.bitmap)return void(0,r.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");const n=this.current,i=t.width,s=t.height,a=n.fillColor;n.maskId="mask"+m++;const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",n.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0"),l.setAttributeNS(null,"y","0"),l.setAttributeNS(null,"width",p(i)),l.setAttributeNS(null,"height",p(s)),l.setAttributeNS(null,"fill",a),l.setAttributeNS(null,"mask",`url(#${n.maskId})`),this.defs.append(o),this._ensureTransformGroup().append(l),this.paintInlineImageXObject(t,o)}paintFormXObjectBegin(e,t){if(Array.isArray(e)&&6===e.length&&this.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t){const e=t[2]-t[0],n=t[3]-t[1],i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x",t[0]),i.setAttributeNS(null,"y",t[1]),i.setAttributeNS(null,"width",p(e)),i.setAttributeNS(null,"height",p(n)),this.current.element=i,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(e){const t=this.svgFactory.create(e.width,e.height),n=this.svgFactory.createElement("svg:defs");t.append(n),this.defs=n;const i=this.svgFactory.createElement("svg:g");return i.setAttributeNS(null,"transform",f(e.transform)),t.append(i),this.svg=i,t}_ensureClipGroup(){if(!this.current.clipGroup){const e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(e),this.current.clipGroup=e}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",f(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}],__webpack_module_cache__={};function __w_pdfjs_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__w_pdfjs_require__),n.exports}var __nested_webpack_exports__={};return(()=>{var e=__nested_webpack_exports__;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AbortException",{enumerable:!0,get:function(){return t.AbortException}}),Object.defineProperty(e,"AnnotationEditorLayer",{enumerable:!0,get:function(){return s.AnnotationEditorLayer}}),Object.defineProperty(e,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return t.AnnotationEditorParamsType}}),Object.defineProperty(e,"AnnotationEditorType",{enumerable:!0,get:function(){return t.AnnotationEditorType}}),Object.defineProperty(e,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return a.AnnotationEditorUIManager}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}}),Object.defineProperty(e,"AnnotationMode",{enumerable:!0,get:function(){return t.AnnotationMode}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return t.CMapCompressionType}}),Object.defineProperty(e,"FeatureTest",{enumerable:!0,get:function(){return t.FeatureTest}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(e,"ImageKind",{enumerable:!0,get:function(){return t.ImageKind}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return t.InvalidPDFException}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return t.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return t.OPS}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return i.PDFDateString}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return t.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return t.PermissionFlag}}),Object.defineProperty(e,"PixelsPerInch",{enumerable:!0,get:function(){return i.PixelsPerInch}}),Object.defineProperty(e,"PromiseCapability",{enumerable:!0,get:function(){return t.PromiseCapability}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return i.RenderingCancelledException}}),e.SVGGraphics=void 0,Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return t.UnexpectedResponseException}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return t.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return t.VerbosityLevel}}),Object.defineProperty(e,"XfaLayer",{enumerable:!0,get:function(){return c.XfaLayer}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return t.createValidAbsoluteUrl}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return i.getFilenameFromUrl}}),Object.defineProperty(e,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return i.getPdfFilenameFromUrl}}),Object.defineProperty(e,"getXfaPageViewport",{enumerable:!0,get:function(){return i.getXfaPageViewport}}),Object.defineProperty(e,"isDataScheme",{enumerable:!0,get:function(){return i.isDataScheme}}),Object.defineProperty(e,"isPdfFile",{enumerable:!0,get:function(){return i.isPdfFile}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return i.loadScript}}),Object.defineProperty(e,"normalizeUnicode",{enumerable:!0,get:function(){return t.normalizeUnicode}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return r.renderTextLayer}}),Object.defineProperty(e,"setLayerDimensions",{enumerable:!0,get:function(){return i.setLayerDimensions}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return t.shadow}}),Object.defineProperty(e,"updateTextLayer",{enumerable:!0,get:function(){return r.updateTextLayer}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return n.version}});var t=__w_pdfjs_require__(1),n=__w_pdfjs_require__(2),i=__w_pdfjs_require__(6),r=__w_pdfjs_require__(26),s=__w_pdfjs_require__(27),a=__w_pdfjs_require__(5),o=__w_pdfjs_require__(29),l=__w_pdfjs_require__(14),c=__w_pdfjs_require__(31);const d=__w_pdfjs_require__(34).SVGGraphics;e.SVGGraphics=d})(),__nested_webpack_exports__})(),module.exports=factory()},963:(e,t,n)=>{var i;globalThis,i=()=>(()=>{"use strict";var e=[,(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFindController=t.FindState=void 0;var i=n(2),r=n(3),s=n(4);const a={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};t.FindState=a;const o={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},l=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]);let c;const d=/\p{M}+/gu,h=/([.*+?^${}()|[\]\\])|(\p{P})|(\s+)|(\p{M})|(\p{L})/gu,u=/([^\p{M}])\p{M}*$/u,p=/^\p{M}*([^\p{M}])/u,f=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,g=new Map,m=new Map;let _=null,b=null;function v(e){const t=[];let n,i;for(;null!==(n=f.exec(e));){let{index:e}=n;for(const i of n[0]){let n=g.get(i);n||(n=i.normalize("NFD").length,g.set(i,n)),t.push([n,e++])}}if(0===t.length&&_)i=_;else if(t.length>0&&b)i=b;else{const e=`([${Object.keys(o).join("")}])|([${(0,r.getNormalizeWithNFKC)()}])|((?:゙|゚)\\n)|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|((?:\\p{Ideographic}|[぀-ヿ])\\n)|(\\n)`;i=0===t.length?_=new RegExp(e+"|(\\u0000)","gum"):b=new RegExp(e+"|([\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f])","gum")}const s=[];for(;null!==(n=d.exec(e));)s.push([n[0].length,n.index]);let a=e.normalize("NFD");const l=[[0,0]];let c=0,h=0,u=0,p=0,v=0,y=!1;return a=a.replace(i,((e,n,i,r,a,d,f,g,_,b)=>{if(b-=p,n){const e=o[n],t=e.length;for(let e=1;e<t;e++)l.push([b-u+e,u-e]);return u-=t-1,e}if(i){let e=m.get(i);e||(e=i.normalize("NFKC"),m.set(i,e));const t=e.length;for(let e=1;e<t;e++)l.push([b-u+e,u-e]);return u-=t-1,e}if(r)return y=!0,b+v===s[c]?.[1]?++c:(l.push([b-1-u+1,u-1]),u-=1,p+=1),l.push([b-u+1,u]),p+=1,v+=1,r.charAt(0);if(a){const e=a.endsWith("\n"),t=e?a.length-2:a.length;y=!0;let n=t;b+v===s[c]?.[1]&&(n-=s[c][0],++c);for(let e=1;e<=n;e++)l.push([b-1-u+e,u-e]);return u-=n,p+=n,e?(b+=t-1,l.push([b-u+1,1+u]),u+=1,p+=1,v+=1,a.slice(0,t)):a}if(d){const e=d.length-2;return l.push([b-u+e,1+u]),u+=1,p+=1,v+=1,d.slice(0,-2)}if(f){const e=f.length-1;return l.push([b-u+e,u]),p+=1,v+=1,f.slice(0,-1)}if(g)return l.push([b-u+1,u-1]),u-=1,p+=1,v+=1," ";if(b+v===t[h]?.[1]){const e=t[h][0]-1;++h;for(let t=1;t<=e;t++)l.push([b-(u-t),u-t]);u-=e,p+=e}return _})),l.push([a.length,u]),[a,l,y]}function y(e,t,n){if(!e)return[t,n];const r=t,s=t+n-1;let a=(0,i.binarySearchFirstItem)(e,(e=>e[0]>=r));e[a][0]>r&&--a;let o=(0,i.binarySearchFirstItem)(e,(e=>e[0]>=s),a);e[o][0]>s&&--o;const l=r+e[a][1];return[l,s+e[o][1]+1-l]}t.PDFFindController=class{#Nn=null;#jn=!0;#Bn=0;constructor({linkService:e,eventBus:t,updateMatchesCountOnProgress:n=!0}){this._linkService=e,this._eventBus=t,this.#jn=n,this.onIsPageVisible=null,this.#Un(),t._on("find",this.#Vn.bind(this)),t._on("findbarclose",this.#Hn.bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this.#Nn}setDocument(e){this._pdfDocument&&this.#Un(),e&&(this._pdfDocument=e,this._firstPageCapability.resolve())}#Vn(e){if(!e)return;!1===e.phraseSearch&&(console.error("The `phraseSearch`-parameter was removed, please provide an Array of strings in the `query`-parameter instead."),"string"==typeof e.query&&(e.query=e.query.match(/\S+/g)));const t=this._pdfDocument,{type:n}=e;(null===this.#Nn||this.#zn(e))&&(this._dirtyMatch=!0),this.#Nn=e,"highlightallchange"!==n&&this.#Wn(a.PENDING),this._firstPageCapability.promise.then((()=>{if(!this._pdfDocument||t&&this._pdfDocument!==t)return;this.#_t();const e=!this._highlightMatches,i=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),n?this._dirtyMatch?this.#qn():"again"===n?(this.#qn(),e&&this.#Nn.highlightAll&&this.#$n()):"highlightallchange"===n?(i?this.#qn():this._highlightMatches=!0,this.#$n()):this.#qn():this._findTimeout=setTimeout((()=>{this.#qn(),this._findTimeout=null}),250)}))}scrollMatchIntoView({element:e=null,selectedLeft:t=0,pageIndex:n=-1,matchIndex:r=-1}){if(!this._scrollMatches||!e)return;if(-1===r||r!==this._selected.matchIdx)return;if(-1===n||n!==this._selected.pageIdx)return;this._scrollMatches=!1;const s={top:-50,left:t+-400};(0,i.scrollIntoView)(e,s,!0)}#Un(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],this.#Bn=0,this.#Nn=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=new s.PromiseCapability}get#Gn(){const{query:e}=this.#Nn;return"string"==typeof e?(e!==this._rawQuery&&(this._rawQuery=e,[this._normalizedQuery]=v(e)),this._normalizedQuery):(e||[]).filter((e=>!!e)).map((e=>v(e)[0]))}#zn(e){const t=e.query,n=this.#Nn.query,i=typeof t;if(i!==typeof n)return!0;if("string"===i){if(t!==n)return!0}else if(JSON.stringify(t)!==JSON.stringify(n))return!0;switch(e.type){case"again":const e=this._selected.pageIdx+1,t=this._linkService;return e>=1&&e<=t.pagesCount&&e!==t.page&&!(this.onIsPageVisible?.(e)??1);case"highlightallchange":return!1}return!0}#Xn(e,t,n){let i=e.slice(0,t).match(u);if(i){const n=e.charCodeAt(t),s=i[1].charCodeAt(0);if((0,r.getCharacterType)(n)===(0,r.getCharacterType)(s))return!1}if(i=e.slice(t+n).match(p),i){const s=e.charCodeAt(t+n-1),a=i[1].charCodeAt(0);if((0,r.getCharacterType)(s)===(0,r.getCharacterType)(a))return!1}return!0}#Kn(e,t,n,i){const r=this._pageMatches[n]=[],s=this._pageMatchesLength[n]=[];if(!e)return;const a=this._pageDiffs[n];let o;for(;null!==(o=e.exec(i));){if(t&&!this.#Xn(i,o.index,o[0].length))continue;const[e,n]=y(a,o.index,o[0].length);n&&(r.push(e),s.push(n))}}#Yn(e,t){const{matchDiacritics:n}=this.#Nn;let i=!1;return(e=e.replaceAll(h,((e,r,s,a,o,c)=>r?`[ ]*\\${r}[ ]*`:s?`[ ]*${s}[ ]*`:a?"[ ]+":n?o||c:o?l.has(o.charCodeAt(0))?o:"":t?(i=!0,`${c}\\p{M}*`):c))).endsWith("[ ]*")&&(e=e.slice(0,e.length-4)),n&&t&&(c||=String.fromCharCode(...l),i=!0,e=`${e}(?=[${c}]|[^\\p{M}]|$)`),[i,e]}#Qn(e){let t=this.#Gn;if(0===t.length)return;const{caseSensitive:n,entireWord:i}=this.#Nn,r=this._pageContents[e],s=this._hasDiacritics[e];let a=!1;"string"==typeof t?[a,t]=this.#Yn(t,s):t=t.sort().reverse().map((e=>{const[t,n]=this.#Yn(e,s);return a||=t,`(${n})`})).join("|"),t=t?new RegExp(t,`g${a?"u":""}${n?"":"i"}`):null,this.#Kn(t,i,e,r),this.#Nn.highlightAll&&this.#Jn(e),this._resumePageIdx===e&&(this._resumePageIdx=null,this.#Zn());const o=this._pageMatches[e].length;this._matchesCountTotal+=o,this.#jn?o>0&&this.#ei():++this.#Bn===this._linkService.pagesCount&&this.#ei()}#_t(){if(this._extractTextPromises.length>0)return;let e=Promise.resolve();const t={disableNormalization:!0};for(let n=0,i=this._linkService.pagesCount;n<i;n++){const i=new s.PromiseCapability;this._extractTextPromises[n]=i.promise,e=e.then((()=>this._pdfDocument.getPage(n+1).then((e=>e.getTextContent(t))).then((e=>{const t=[];for(const n of e.items)t.push(n.str),n.hasEOL&&t.push("\n");[this._pageContents[n],this._pageDiffs[n],this._hasDiacritics[n]]=v(t.join("")),i.resolve()}),(e=>{console.error(`Unable to get text content for page ${n+1}`,e),this._pageContents[n]="",this._pageDiffs[n]=null,this._hasDiacritics[n]=!1,i.resolve()}))))}}#Jn(e){this._scrollMatches&&this._selected.pageIdx===e&&(this._linkService.page=e+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:e})}#$n(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}#qn(){const e=this.#Nn.findPrevious,t=this._linkService.page-1,n=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=t,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,this.#Bn=0,this._matchesCountTotal=0,this.#$n();for(let e=0;e<n;e++)this._pendingFindMatches.has(e)||(this._pendingFindMatches.add(e),this._extractTextPromises[e].then((()=>{this._pendingFindMatches.delete(e),this.#Qn(e)})))}if(0===this.#Gn.length)return void this.#Wn(a.FOUND);if(this._resumePageIdx)return;const i=this._offset;if(this._pagesToSearch=n,null!==i.matchIdx){const t=this._pageMatches[i.pageIdx].length;if(!e&&i.matchIdx+1<t||e&&i.matchIdx>0)return i.matchIdx=e?i.matchIdx-1:i.matchIdx+1,void this.#ti(!0);this.#ni(e)}this.#Zn()}#ii(e){const t=this._offset,n=e.length,i=this.#Nn.findPrevious;return n?(t.matchIdx=i?n-1:0,this.#ti(!0),!0):(this.#ni(i),!!(t.wrapped&&(t.matchIdx=null,this._pagesToSearch<0))&&(this.#ti(!1),!0))}#Zn(){null!==this._resumePageIdx&&console.error("There can only be one pending page.");let e=null;do{const t=this._offset.pageIdx;if(e=this._pageMatches[t],!e){this._resumePageIdx=t;break}}while(!this.#ii(e))}#ni(e){const t=this._offset,n=this._linkService.pagesCount;t.pageIdx=e?t.pageIdx-1:t.pageIdx+1,t.matchIdx=null,this._pagesToSearch--,(t.pageIdx>=n||t.pageIdx<0)&&(t.pageIdx=e?n-1:0,t.wrapped=!0)}#ti(e=!1){let t=a.NOT_FOUND;const n=this._offset.wrapped;if(this._offset.wrapped=!1,e){const e=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,t=n?a.WRAPPED:a.FOUND,-1!==e&&e!==this._selected.pageIdx&&this.#Jn(e)}this.#Wn(t,this.#Nn.findPrevious),-1!==this._selected.pageIdx&&(this._scrollMatches=!0,this.#Jn(this._selected.pageIdx))}#Hn(e){const t=this._pdfDocument;this._firstPageCapability.promise.then((()=>{!this._pdfDocument||t&&this._pdfDocument!==t||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),this.#Wn(a.FOUND),this._highlightMatches=!1,this.#$n())}))}#ri(){const{pageIdx:e,matchIdx:t}=this._selected;let n=0,i=this._matchesCountTotal;if(-1!==t){for(let t=0;t<e;t++)n+=this._pageMatches[t]?.length||0;n+=t+1}return(n<1||n>i)&&(n=i=0),{current:n,total:i}}#ei(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this.#ri()})}#Wn(e,t=!1){(this.#jn||this.#Bn===this._linkService.pagesCount&&e!==a.PENDING)&&this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:e,previous:t,matchesCount:this.#ri(),rawQuery:this.#Nn?.query??null})}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.animationStarted=t.VERTICAL_PADDING=t.UNKNOWN_SCALE=t.TextLayerMode=t.SpreadMode=t.SidebarView=t.ScrollMode=t.SCROLLBAR_PADDING=t.RenderingStates=t.ProgressBar=t.PresentationModeState=t.OutputScale=t.MIN_SCALE=t.MAX_SCALE=t.MAX_AUTO_SCALE=t.DEFAULT_SCALE_VALUE=t.DEFAULT_SCALE_DELTA=t.DEFAULT_SCALE=t.CursorTool=t.AutoPrintRegExp=void 0,t.apiPageLayoutToViewerModes=function(e){let t=i.VERTICAL,n=r.NONE;switch(e){case"SinglePage":t=i.PAGE;break;case"OneColumn":break;case"TwoPageLeft":t=i.PAGE;case"TwoColumnLeft":n=r.ODD;break;case"TwoPageRight":t=i.PAGE;case"TwoColumnRight":n=r.EVEN}return{scrollMode:t,spreadMode:n}},t.apiPageModeToSidebarView=function(e){switch(e){case"UseNone":return n.NONE;case"UseThumbs":return n.THUMBS;case"UseOutlines":return n.OUTLINE;case"UseAttachments":return n.ATTACHMENTS;case"UseOC":return n.LAYERS}return n.NONE},t.approximateFraction=function(e){if(Math.floor(e)===e)return[e,1];const t=1/e;if(t>8)return[1,8];if(Math.floor(t)===t)return[1,t];const n=e>1?t:e;let i,r=0,s=1,a=1,o=1;for(;;){const e=r+a,t=s+o;if(t>8)break;n<=e/t?(a=e,o=t):(r=e,s=t)}return i=n-r/s<a/o-n?n===e?[r,s]:[s,r]:n===e?[a,o]:[o,a],i},t.backtrackBeforeAllVisibleElements=o,t.binarySearchFirstItem=a,t.docStyle=void 0,t.getActiveOrFocusedElement=function(){let e=document,t=e.activeElement||e.querySelector(":focus");for(;t?.shadowRoot;)e=t.shadowRoot,t=e.activeElement||e.querySelector(":focus");return t},t.getPageSizeInches=function({view:e,userUnit:t,rotate:n}){const[i,r,s,a]=e,o=n%180!=0,l=(s-i)/72*t,c=(a-r)/72*t;return{width:o?c:l,height:o?l:c}},t.getVisibleElements=function({scrollEl:e,views:t,sortByVisibility:n=!1,horizontal:i=!1,rtl:r=!1}){const s=e.scrollTop,l=s+e.clientHeight,c=e.scrollLeft,d=c+e.clientWidth,h=[],u=new Set,p=t.length;let f=a(t,i?function(e){const t=e.div,n=t.offsetLeft+t.clientLeft,i=n+t.clientWidth;return r?n<d:i>c}:function(e){const t=e.div;return t.offsetTop+t.clientTop+t.clientHeight>s});f>0&&f<p&&!i&&(f=o(f,t,s));let g=i?d:-1;for(let e=f;e<p;e++){const n=t[e],r=n.div,a=r.offsetLeft+r.clientLeft,o=r.offsetTop+r.clientTop,p=r.clientWidth,f=r.clientHeight,m=a+p,_=o+f;if(-1===g)_>=l&&(g=_);else if((i?a:o)>g)break;if(_<=s||o>=l||m<=c||a>=d)continue;const b=Math.max(0,s-o)+Math.max(0,_-l),v=(p-(Math.max(0,c-a)+Math.max(0,m-d)))/p,y=(f-b)/f*v*100|0;h.push({id:n.id,x:a,y:o,view:n,percent:y,widthPercent:100*v|0}),u.add(n.id)}const m=h[0],_=h.at(-1);return n&&h.sort((function(e,t){const n=e.percent-t.percent;return Math.abs(n)>.001?-n:e.id-t.id})),{first:m,last:_,views:h,ids:u}},t.isPortraitOrientation=function(e){return e.width<=e.height},t.isValidRotation=function(e){return Number.isInteger(e)&&e%90==0},t.isValidScrollMode=function(e){return Number.isInteger(e)&&Object.values(i).includes(e)&&e!==i.UNKNOWN},t.isValidSpreadMode=function(e){return Number.isInteger(e)&&Object.values(r).includes(e)&&e!==r.UNKNOWN},t.noContextMenuHandler=function(e){e.preventDefault()},t.normalizeWheelEventDelta=function(e){const t=e.deltaMode;let n=l(e);return t===WheelEvent.DOM_DELTA_PIXEL?n/=900:t===WheelEvent.DOM_DELTA_LINE&&(n/=30),n},t.normalizeWheelEventDirection=l,t.parseQueryString=function(e){const t=new Map;for(const[n,i]of new URLSearchParams(e))t.set(n.toLowerCase(),i);return t},t.removeNullCharacters=function(e,t=!1){return"string"!=typeof e?(console.error("The argument must be a string."),e):(t&&(e=e.replaceAll(s," ")),e.replaceAll("\0",""))},t.roundToDivide=function(e,t){const n=e%t;return 0===n?e:Math.round(e-n+t)},t.scrollIntoView=function(e,t,n=!1){let i=e.offsetParent;if(!i)return void console.error("offsetParent is not set -- cannot scroll");let r=e.offsetTop+e.clientTop,s=e.offsetLeft+e.clientLeft;for(;i.clientHeight===i.scrollHeight&&i.clientWidth===i.scrollWidth||n&&(i.classList.contains("markedContent")||"hidden"===getComputedStyle(i).overflow);)if(r+=i.offsetTop,s+=i.offsetLeft,i=i.offsetParent,!i)return;t&&(void 0!==t.top&&(r+=t.top),void 0!==t.left&&(s+=t.left,i.scrollLeft=s)),i.scrollTop=r},t.toggleCheckedBtn=function(e,t,n=null){e.classList.toggle("toggled",t),e.setAttribute("aria-checked",t),n?.classList.toggle("hidden",!t)},t.toggleExpandedBtn=function(e,t,n=null){e.classList.toggle("toggled",t),e.setAttribute("aria-expanded",t),n?.classList.toggle("hidden",!t)},t.watchScroll=function(e,t){const n=function(n){r||(r=window.requestAnimationFrame((function(){r=null;const n=e.scrollLeft,s=i.lastX;n!==s&&(i.right=n>s),i.lastX=n;const a=e.scrollTop,o=i.lastY;a!==o&&(i.down=a>o),i.lastY=a,t(i)})))},i={right:!0,down:!0,lastX:e.scrollLeft,lastY:e.scrollTop,_eventHandler:n};let r=null;return e.addEventListener("scroll",n,!0),i},t.DEFAULT_SCALE_VALUE="auto",t.DEFAULT_SCALE=1,t.DEFAULT_SCALE_DELTA=1.1,t.MIN_SCALE=.1,t.MAX_SCALE=10,t.UNKNOWN_SCALE=0,t.MAX_AUTO_SCALE=1.25,t.SCROLLBAR_PADDING=40,t.VERTICAL_PADDING=5,t.RenderingStates={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},t.PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};const n={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4};t.SidebarView=n,t.TextLayerMode={DISABLE:0,ENABLE:1,ENABLE_PERMISSIONS:2};const i={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3};t.ScrollMode=i;const r={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};t.SpreadMode=r,t.CursorTool={SELECT:0,HAND:1,ZOOM:2},t.AutoPrintRegExp=/\bprint\s*\(/,t.OutputScale=class{constructor(){const e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return 1!==this.sx||1!==this.sy}};const s=/[\x01-\x1F]/g;function a(e,t,n=0){let i=n,r=e.length-1;if(r<0||!t(e[r]))return e.length;if(t(e[i]))return i;for(;i<r;){const n=i+r>>1;t(e[n])?r=n:i=n+1}return i}function o(e,t,n){if(e<2)return e;let i=t[e].div,r=i.offsetTop+i.clientTop;r>=n&&(i=t[e-1].div,r=i.offsetTop+i.clientTop);for(let n=e-2;n>=0&&(i=t[n].div,!(i.offsetTop+i.clientTop+i.clientHeight<=r));--n)e=n;return e}function l(e){let t=Math.hypot(e.deltaX,e.deltaY);const n=Math.atan2(e.deltaY,e.deltaX);return-.25*Math.PI<n&&n<.75*Math.PI&&(t=-t),t}const c=new Promise((function(e){window.requestAnimationFrame(e)}));t.animationStarted=c;const d=document.documentElement.style;t.docStyle=d,t.ProgressBar=class{#si=null;#ai=null;#oi=0;#li=null;#je=!0;constructor(e){this.#si=e.classList,this.#li=e.style}get percent(){return this.#oi}set percent(e){var t;this.#oi=(t=e,0,100,Math.min(Math.max(t,0),100)),isNaN(e)?this.#si.add("indeterminate"):(this.#si.remove("indeterminate"),this.#li.setProperty("--progressBar-percent",`${this.#oi}%`))}setWidth(e){if(!e)return;const t=e.parentNode.offsetWidth-e.offsetWidth;t>0&&this.#li.setProperty("--progressBar-end-offset",`${t}px`)}setDisableAutoFetch(e=5e3){isNaN(this.#oi)||(this.#ai&&clearTimeout(this.#ai),this.show(),this.#ai=setTimeout((()=>{this.#ai=null,this.hide()}),e))}hide(){this.#je&&(this.#je=!1,this.#si.add("hidden"))}show(){this.#je||(this.#je=!0,this.#si.remove("hidden"))}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterType=void 0,t.getCharacterType=function(e){return function(e){return e<11904}(e)?function(e){return 0==(65408&e)}(e)?function(e){return 32===e||9===e||13===e||10===e}(e)?n.SPACE:function(e){return e>=97&&e<=122||e>=65&&e<=90}(e)||function(e){return e>=48&&e<=57}(e)||95===e?n.ALPHA_LETTER:n.PUNCT:function(e){return 3584==(65408&e)}(e)?n.THAI_LETTER:160===e?n.SPACE:n.ALPHA_LETTER:function(e){return e>=13312&&e<=40959||e>=63744&&e<=64255}(e)?n.HAN_LETTER:function(e){return e>=12448&&e<=12543}(e)?n.KATAKANA_LETTER:function(e){return e>=12352&&e<=12447}(e)?n.HIRAGANA_LETTER:function(e){return e>=65376&&e<=65439}(e)?n.HALFWIDTH_KATAKANA_LETTER:n.ALPHA_LETTER},t.getNormalizeWithNFKC=function(){return i||=" ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩",i};const n={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};let i;t.CharacterType=n},e=>{let t;t="undefined"!=typeof window&&window["pdfjs-dist/build/pdf"]?window["pdfjs-dist/build/pdf"]:n(299),e.exports=t},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLinkService=t.PDFLinkService=t.LinkTarget=void 0;var i=n(2);const r={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};function s(e,{url:t,target:n,rel:s,enabled:a=!0}={}){if(!t||"string"!=typeof t)throw new Error('A valid "url" parameter must provided.');const o=(0,i.removeNullCharacters)(t);a?e.href=e.title=o:(e.href="",e.title=`Disabled: ${o}`,e.onclick=()=>!1);let l="";switch(n){case r.NONE:break;case r.SELF:l="_self";break;case r.BLANK:l="_blank";break;case r.PARENT:l="_parent";break;case r.TOP:l="_top"}e.target=l,e.rel="string"==typeof s?s:"noopener noreferrer nofollow"}t.LinkTarget=r;class a{#ci=new Map;constructor({eventBus:e,externalLinkTarget:t=null,externalLinkRel:n=null,ignoreDestinationZoom:i=!1}={}){this.eventBus=e,this.externalLinkTarget=t,this.externalLinkRel=n,this.externalLinkEnabled=!0,this._ignoreDestinationZoom=i,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(e,t=null){this.baseUrl=t,this.pdfDocument=e,this.#ci.clear()}setViewer(e){this.pdfViewer=e}setHistory(e){this.pdfHistory=e}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(e){this.pdfViewer.currentPageNumber=e}get rotation(){return this.pdfViewer.pagesRotation}set rotation(e){this.pdfViewer.pagesRotation=e}get isInPresentationMode(){return this.pdfViewer.isInPresentationMode}#di(e,t=null,n){const i=n[0];let r;if("object"==typeof i&&null!==i){if(r=this._cachedPageNumber(i),!r)return void this.pdfDocument.getPageIndex(i).then((r=>{this.cachePageRef(r+1,i),this.#di(e,t,n)})).catch((()=>{console.error(`PDFLinkService.#goToDestinationHelper: "${i}" is not a valid page reference, for dest="${e}".`)}))}else{if(!Number.isInteger(i))return void console.error(`PDFLinkService.#goToDestinationHelper: "${i}" is not a valid destination reference, for dest="${e}".`);r=i+1}!r||r<1||r>this.pagesCount?console.error(`PDFLinkService.#goToDestinationHelper: "${r}" is not a valid page number, for dest="${e}".`):(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:t,explicitDest:n,pageNumber:r})),this.pdfViewer.scrollPageIntoView({pageNumber:r,destArray:n,ignoreDestinationZoom:this._ignoreDestinationZoom}))}async goToDestination(e){if(!this.pdfDocument)return;let t,n;"string"==typeof e?(t=e,n=await this.pdfDocument.getDestination(e)):(t=null,n=await e),Array.isArray(n)?this.#di(e,t,n):console.error(`PDFLinkService.goToDestination: "${n}" is not a valid destination array, for dest="${e}".`)}goToPage(e){if(!this.pdfDocument)return;const t="string"==typeof e&&this.pdfViewer.pageLabelToPageNumber(e)||0|e;Number.isInteger(t)&&t>0&&t<=this.pagesCount?(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(t)),this.pdfViewer.scrollPageIntoView({pageNumber:t})):console.error(`PDFLinkService.goToPage: "${e}" is not a valid page.`)}addLinkAttributes(e,t,n=!1){s(e,{url:t,target:n?r.BLANK:this.externalLinkTarget,rel:this.externalLinkRel,enabled:this.externalLinkEnabled})}getDestinationHash(e){if("string"==typeof e){if(e.length>0)return this.getAnchorUrl("#"+escape(e))}else if(Array.isArray(e)){const t=JSON.stringify(e);if(t.length>0)return this.getAnchorUrl("#"+escape(t))}return this.getAnchorUrl("")}getAnchorUrl(e){return this.baseUrl?this.baseUrl+e:e}setHash(e){if(!this.pdfDocument)return;let t,n;if(e.includes("=")){const r=(0,i.parseQueryString)(e);if(r.has("search")){const e=r.get("search").replaceAll('"',""),t="true"===r.get("phrase");this.eventBus.dispatch("findfromurlhash",{source:this,query:t?e:e.match(/\S+/g)})}if(r.has("page")&&(t=0|r.get("page")||1),r.has("zoom")){const e=r.get("zoom").split(","),t=e[0],i=parseFloat(t);t.includes("Fit")?"Fit"===t||"FitB"===t?n=[null,{name:t}]:"FitH"===t||"FitBH"===t||"FitV"===t||"FitBV"===t?n=[null,{name:t},e.length>1?0|e[1]:null]:"FitR"===t?5!==e.length?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):n=[null,{name:t},0|e[1],0|e[2],0|e[3],0|e[4]]:console.error(`PDFLinkService.setHash: "${t}" is not a valid zoom value.`):n=[null,{name:"XYZ"},e.length>1?0|e[1]:null,e.length>2?0|e[2]:null,i?i/100:t]}n?this.pdfViewer.scrollPageIntoView({pageNumber:t||this.page,destArray:n,allowNegativeOffset:!0}):t&&(this.page=t),r.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:r.get("pagemode")}),r.has("nameddest")&&this.goToDestination(r.get("nameddest"))}else{n=unescape(e);try{n=JSON.parse(n),Array.isArray(n)||(n=n.toString())}catch{}if("string"==typeof n||a.#hi(n))return void this.goToDestination(n);console.error(`PDFLinkService.setHash: "${unescape(e)}" is not a valid destination.`)}}executeNamedAction(e){switch(e){case"GoBack":this.pdfHistory?.back();break;case"GoForward":this.pdfHistory?.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}this.eventBus.dispatch("namedaction",{source:this,action:e})}async executeSetOCGState(e){const t=this.pdfDocument,n=await this.pdfViewer.optionalContentConfigPromise;if(t!==this.pdfDocument)return;let i;for(const t of e.state){switch(t){case"ON":case"OFF":case"Toggle":i=t;continue}switch(i){case"ON":n.setVisibility(t,!0);break;case"OFF":n.setVisibility(t,!1);break;case"Toggle":const e=n.getGroup(t);e&&n.setVisibility(t,!e.visible)}}this.pdfViewer.optionalContentConfigPromise=Promise.resolve(n)}cachePageRef(e,t){if(!t)return;const n=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;this.#ci.set(n,e)}_cachedPageNumber(e){if(!e)return null;const t=0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`;return this.#ci.get(t)||null}static#hi(e){if(!Array.isArray(e))return!1;const t=e.length;if(t<2)return!1;const n=e[0];if(!("object"==typeof n&&Number.isInteger(n.num)&&Number.isInteger(n.gen)||Number.isInteger(n)&&n>=0))return!1;const i=e[1];if("object"!=typeof i||"string"!=typeof i.name)return!1;let r=!0;switch(i.name){case"XYZ":if(5!==t)return!1;break;case"Fit":case"FitB":return 2===t;case"FitH":case"FitBH":case"FitV":case"FitBV":if(3!==t)return!1;break;case"FitR":if(6!==t)return!1;r=!1;break;default:return!1}for(let n=2;n<t;n++){const t=e[n];if(!("number"==typeof t||r&&null===t))return!1}return!0}}t.PDFLinkService=a,t.SimpleLinkService=class{constructor(){this.externalLinkEnabled=!0}get pagesCount(){return 0}get page(){return 0}set page(e){}get rotation(){return 0}set rotation(e){}get isInPresentationMode(){return!1}async goToDestination(e){}goToPage(e){}addLinkAttributes(e,t,n=!1){s(e,{url:t,enabled:this.externalLinkEnabled})}getDestinationHash(e){return"#"}getAnchorUrl(e){return"#"}setHash(e){}executeNamedAction(e){}executeSetOCGState(e){}cachePageRef(e,t){}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationLayerBuilder=void 0;var i=n(4),r=n(7),s=n(2);t.AnnotationLayerBuilder=class{#ui=null;constructor({pageDiv:e,pdfPage:t,linkService:n,downloadManager:i,annotationStorage:s=null,imageResourcesPath:a="",renderForms:o=!0,l10n:l=r.NullL10n,enableScripting:c=!1,hasJSActionsPromise:d=null,fieldObjectsPromise:h=null,annotationCanvasMap:u=null,accessibilityManager:p=null}){this.pageDiv=e,this.pdfPage=t,this.linkService=n,this.downloadManager=i,this.imageResourcesPath=a,this.renderForms=o,this.l10n=l,this.annotationStorage=s,this.enableScripting=c,this._hasJSActionsPromise=d||Promise.resolve(!1),this._fieldObjectsPromise=h||Promise.resolve(null),this._annotationCanvasMap=u,this._accessibilityManager=p,this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=n.eventBus}async render(e,t="display"){if(this.div){if(this._cancelled||!this.annotationLayer)return;return void this.annotationLayer.update({viewport:e.clone({dontFlip:!0})})}const[n,r,a]=await Promise.all([this.pdfPage.getAnnotations({intent:t}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;const o=this.div=document.createElement("div");o.className="annotationLayer",this.pageDiv.append(o),0!==n.length?(this.annotationLayer=new i.AnnotationLayer({div:o,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,l10n:this.l10n,page:this.pdfPage,viewport:e.clone({dontFlip:!0})}),await this.annotationLayer.render({annotations:n,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:r,fieldObjects:a}),this.linkService.isInPresentationMode&&this.#pi(s.PresentationModeState.FULLSCREEN),this.#ui||(this.#ui=e=>{this.#pi(e.state)},this._eventBus?._on("presentationmodechanged",this.#ui))):this.hide()}cancel(){this._cancelled=!0,this.#ui&&(this._eventBus?._off("presentationmodechanged",this.#ui),this.#ui=null)}hide(){this.div&&(this.div.hidden=!0)}#pi(e){if(!this.div)return;let t=!1;switch(e){case s.PresentationModeState.FULLSCREEN:t=!0;break;case s.PresentationModeState.NORMAL:break;default:return}for(const e of this.div.childNodes)e.hasAttribute("data-internal-link")||(e.inert=t)}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NullL10n=void 0,t.getL10nFallback=i;const n={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",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…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image"};function i(e,t){switch(e){case"find_match_count":e=`find_match_count[${1===t.total?"one":"other"}]`;break;case"find_match_count_limit":e=`find_match_count_limit[${1===t.limit?"one":"other"}]`}return n[e]||""}n.print_progress_percent="{{progress}}%";const r={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",get:async(e,t=null,n=i(e,t))=>function(e,t){return t?e.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,((e,n)=>n in t?t[n]:"{{"+n+"}}")):e}(n,t),async translate(e){}};t.NullL10n=r},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DownloadManager=void 0;var i=n(4);function r(e,t){const n=document.createElement("a");if(!n.click)throw new Error('DownloadManager: "a.click()" is not supported.');n.href=e,n.target="_parent","download"in n&&(n.download=t),(document.body||document.documentElement).append(n),n.click(),n.remove()}t.DownloadManager=class{#fi=new WeakMap;downloadUrl(e,t,n){(0,i.createValidAbsoluteUrl)(e,"http://example.com")?r(e+"#pdfjs.action=download",t):console.error(`downloadUrl - not a valid URL: ${e}`)}downloadData(e,t,n){r(URL.createObjectURL(new Blob([e],{type:n})),t)}openOrDownloadData(e,t,n){const r=(0,i.isPdfFile)(n)?"application/pdf":"";return this.downloadData(t,n,r),!1}download(e,t,n,i){r(URL.createObjectURL(e),n)}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WaitOnType=t.EventBus=t.AutomationEventBus=void 0,t.waitOnEventOrTimeout=function({target:e,name:t,delay:r=0}){return new Promise((function(s,a){if("object"!=typeof e||!t||"string"!=typeof t||!(Number.isInteger(r)&&r>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function o(n){e instanceof i?e._off(t,l):e.removeEventListener(t,l),d&&clearTimeout(d),s(n)}const l=o.bind(null,n.EVENT);e instanceof i?e._on(t,l):e.addEventListener(t,l);const c=o.bind(null,n.TIMEOUT),d=setTimeout(c,r)}))};const n={EVENT:"event",TIMEOUT:"timeout"};t.WaitOnType=n;class i{#a=Object.create(null);on(e,t,n=null){this._on(e,t,{external:!0,once:n?.once})}off(e,t,n=null){this._off(e,t,{external:!0,once:n?.once})}dispatch(e,t){const n=this.#a[e];if(!n||0===n.length)return;let i;for(const{listener:r,external:s,once:a}of n.slice(0))a&&this._off(e,r),s?(i||=[]).push(r):r(t);if(i){for(const e of i)e(t);i=null}}_on(e,t,n=null){(this.#a[e]||=[]).push({listener:t,external:!0===n?.external,once:!0===n?.once})}_off(e,t,n=null){const i=this.#a[e];if(i)for(let e=0,n=i.length;e<n;e++)if(i[e].listener===t)return void i.splice(e,1)}}t.EventBus=i,t.AutomationEventBus=class extends i{dispatch(e,t){throw new Error("Not implemented: AutomationEventBus.dispatch")}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GenericL10n=void 0,n(11);var i=n(7);const r={en:"en-US",es:"es-ES",fy:"fy-NL",ga:"ga-IE",gu:"gu-IN",hi:"hi-IN",hy:"hy-AM",nb:"nb-NO",ne:"ne-NP",nn:"nn-NO",pa:"pa-IN",pt:"pt-PT",sv:"sv-SE",zh:"zh-CN"};t.GenericL10n=class{constructor(e){const{webL10n:t}=document;this._lang=e,this._ready=new Promise(((n,i)=>{var s;t.setLanguage((s=e,r[s?.toLowerCase()]||s),(()=>{n(t)}))}))}async getLanguage(){return(await this._ready).getLanguage()}async getDirection(){return(await this._ready).getDirection()}async get(e,t=null,n=(0,i.getL10nFallback)(e,t)){return(await this._ready).get(e,t,n)}async translate(e){return(await this._ready).translate(e)}}},()=>{document.webL10n=function(e,t){var n={},i="",r="textContent",s="",a={},o="loading",l=!0;function c(e,t,n){t=t||function(e){},n=n||function(){};var i=new XMLHttpRequest;i.open("GET",e,l),i.overrideMimeType&&i.overrideMimeType("text/plain; charset=utf-8"),i.onreadystatechange=function(){4==i.readyState&&(200==i.status||0===i.status?t(i.responseText):n())},i.onerror=n,i.ontimeout=n;try{i.send(null)}catch(e){n()}}function d(e,t,s,a){var o=e.replace(/[^\/]*$/,"")||"./";function l(e){return e.lastIndexOf("\\")<0?e:e.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}c(e,(function(e){i+=e,function(e,i){var a={},d=/^\s*|\s*$/,h=/^\s*#|^\s*$/,u=/^\s*\[(.*)\]\s*$/,p=/^\s*@import\s+url\((.*)\)\s*$/i,f=/^([^=\s]*)\s*=\s*(.+)$/;function g(e,n,i){var r=e.replace(d,"").split(/[\r\n]+/),s="*",c=t.split("-",1)[0],g=!1,_="";!function e(){for(;;){if(!r.length)return void i();var d=r.shift();if(!h.test(d)){if(n){if(_=u.exec(d)){s=_[1].toLowerCase(),g="*"!==s&&s!==t&&s!==c;continue}if(g)continue;if(_=p.exec(d))return void m(o+_[1],e)}var b=d.match(f);b&&3==b.length&&(a[b[1]]=l(b[2]))}}}()}function m(e,t){c(e,(function(e){g(e,!1,t)}),(function(){console.warn(e+" not found."),t()}))}g(e,!0,(function(){!function(e){for(var t in e){var i,a,o=t.lastIndexOf(".");o>0?(i=t.substring(0,o),a=t.substring(o+1)):(i=t,a=r),n[i]||(n[i]={}),n[i][a]=e[t]}s&&s()}(a)}))}(e)}),a)}function h(e,t,i){var r=n[e];if(!r){if(console.warn("#"+e+" is undefined."),!i)return null;r=i}var s={};for(var a in r){var o=r[a];o=p(o=u(o,t,e,a),t,e),s[a]=o}return s}function u(e,t,i,r){var s=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(e);if(!s||!s.length)return e;var o,l=s[1],c=s[2];return t&&c in t?o=t[c]:c in n&&(o=n[c]),l in a&&(e=(0,a[l])(e,o,i,r)),e}function p(e,t,i){return e.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(e,r){return t&&r in t?t[r]:r in n?n[r]:(console.log("argument {{"+r+"}} for #"+i+" is undefined."),e)}))}function f(e){var n=function(e){if(!e)return{};var t=e.getAttribute("data-l10n-id"),n=e.getAttribute("data-l10n-args"),i={};if(n)try{i=JSON.parse(n)}catch(e){console.warn("could not parse arguments for #"+t)}return{id:t,args:i}}(e);if(n.id){var i=h(n.id,n.args);if(i){if(i[r]){if(0===function(e){if(e.children)return e.children.length;if(void 0!==e.childElementCount)return e.childElementCount;for(var t=0,n=0;n<e.childNodes.length;n++)t+=1===e.nodeType?1:0;return t}(e))e[r]=i[r];else{for(var s=e.childNodes,a=!1,o=0,l=s.length;o<l;o++)3===s[o].nodeType&&/\S/.test(s[o].nodeValue)&&(a?s[o].nodeValue="":(s[o].nodeValue=i[r],a=!0));if(!a){var c=t.createTextNode(i[r]);e.prepend(c)}}delete i[r]}for(var d in i)e[d]=i[d]}else console.warn("#"+n.id+" is undefined.")}}return a.plural=function(e,t,i,o){var l=parseFloat(t);if(isNaN(l))return e;if(o!=r)return e;a._pluralRules||(a._pluralRules=function(e){function t(e,t){return-1!==t.indexOf(e)}function n(e,t,n){return t<=e&&e<=n}var i={0:function(e){return"other"},1:function(e){return n(e%100,3,10)?"few":0===e?"zero":n(e%100,11,99)?"many":2==e?"two":1==e?"one":"other"},2:function(e){return 0!==e&&e%10==0?"many":2==e?"two":1==e?"one":"other"},3:function(e){return 1==e?"one":"other"},4:function(e){return n(e,0,1)?"one":"other"},5:function(e){return n(e,0,2)&&2!=e?"one":"other"},6:function(e){return 0===e?"zero":e%10==1&&e%100!=11?"one":"other"},7:function(e){return 2==e?"two":1==e?"one":"other"},8:function(e){return n(e,3,6)?"few":n(e,7,10)?"many":2==e?"two":1==e?"one":"other"},9:function(e){return 0===e||1!=e&&n(e%100,1,19)?"few":1==e?"one":"other"},10:function(e){return n(e%10,2,9)&&!n(e%100,11,19)?"few":e%10!=1||n(e%100,11,19)?"other":"one"},11:function(e){return n(e%10,2,4)&&!n(e%100,12,14)?"few":e%10==0||n(e%10,5,9)||n(e%100,11,14)?"many":e%10==1&&e%100!=11?"one":"other"},12:function(e){return n(e,2,4)?"few":1==e?"one":"other"},13:function(e){return n(e%10,2,4)&&!n(e%100,12,14)?"few":1!=e&&n(e%10,0,1)||n(e%10,5,9)||n(e%100,12,14)?"many":1==e?"one":"other"},14:function(e){return n(e%100,3,4)?"few":e%100==2?"two":e%100==1?"one":"other"},15:function(e){return 0===e||n(e%100,2,10)?"few":n(e%100,11,19)?"many":1==e?"one":"other"},16:function(e){return e%10==1&&11!=e?"one":"other"},17:function(e){return 3==e?"few":0===e?"zero":6==e?"many":2==e?"two":1==e?"one":"other"},18:function(e){return 0===e?"zero":n(e,0,2)&&0!==e&&2!=e?"one":"other"},19:function(e){return n(e,2,10)?"few":n(e,0,1)?"one":"other"},20:function(e){return!n(e%10,3,4)&&e%10!=9||n(e%100,10,19)||n(e%100,70,79)||n(e%100,90,99)?e%1e6==0&&0!==e?"many":e%10!=2||t(e%100,[12,72,92])?e%10!=1||t(e%100,[11,71,91])?"other":"one":"two":"few"},21:function(e){return 0===e?"zero":1==e?"one":"other"},22:function(e){return n(e,0,1)||n(e,11,99)?"one":"other"},23:function(e){return n(e%10,1,2)||e%20==0?"one":"other"},24:function(e){return n(e,3,10)||n(e,13,19)?"few":t(e,[2,12])?"two":t(e,[1,11])?"one":"other"}},r={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3}[e.replace(/-.*$/,"")];return r in i?i[r]:(console.warn("plural form unknown for ["+e+"]"),function(){return"other"})}(s));var c="["+a._pluralRules(l)+"]";return 0===l&&i+"[zero]"in n?e=n[i+"[zero]"][o]:1==l&&i+"[one]"in n?e=n[i+"[one]"][o]:2==l&&i+"[two]"in n?e=n[i+"[two]"][o]:i+c in n?e=n[i+c][o]:i+"[other]"in n&&(e=n[i+"[other]"][o]),e},{get:function(e,t,n){var i,s=e.lastIndexOf("."),a=r;s>0&&(a=e.substring(s+1),e=e.substring(0,s)),n&&((i={})[a]=n);var o=h(e,t,i);return o&&a in o?o[a]:"{{"+e+"}}"},getData:function(){return n},getText:function(){return i},getLanguage:function(){return s},setLanguage:function(e,r){!function(e,r){e&&(e=e.toLowerCase()),r=r||function(){},n={},i="",s="",s=e;var a=t.querySelectorAll('link[type="application/l10n"]'),l=a.length;if(0!==l){var c,h,u=0;h=function(){++u>=l&&(r(),o="complete")};for(var p=0;p<l;p++)new _(a[p]).load(e,h)}else{var f=(c=t.querySelector('script[type="application/l10n"]'))?JSON.parse(c.innerHTML):null;if(f&&f.locales&&f.default_locale){if(console.log("using the embedded JSON directory, early way out"),!(n=f.locales[e])){var g=f.default_locale.toLowerCase();for(var m in f.locales){if((m=m.toLowerCase())===e){n=f.locales[e];break}m===g&&(n=f.locales[g])}}r()}else console.log("no resource to load, early way out");o="complete"}function _(e){var t=e.href;this.load=function(e,n){d(t,e,n,(function(){console.warn(t+" not found."),console.warn('"'+e+'" resource not found'),s="",n()}))}}}(e,(function(){r&&r()}))},getDirection:function(){var e=s.split("-",1)[0];return["ar","he","fa","ps","ur"].indexOf(e)>=0?"rtl":"ltr"},translate:function(e){for(var n=function(e){return e?e.querySelectorAll("*[data-l10n-id]"):[]}(e=e||t.documentElement),i=n.length,r=0;r<i;r++)f(n[r]);f(e)},getReadyState:function(){return o},ready:function(n){n&&("complete"==o||"interactive"==o?e.setTimeout((function(){n()})):t.addEventListener&&t.addEventListener("localized",(function e(){t.removeEventListener("localized",e),n()})))}}}(window,document)},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFHistory=void 0,t.isDestArraysEqual=o,t.isDestHashesEqual=a;var i=n(2),r=n(9);function s(){return document.location.hash}function a(e,t){return"string"==typeof e&&"string"==typeof t&&(e===t||(0,i.parseQueryString)(e).get("nameddest")===t)}function o(e,t){function n(e,t){if(typeof e!=typeof t)return!1;if(Array.isArray(e)||Array.isArray(t))return!1;if(null!==e&&"object"==typeof e&&null!==t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!n(e[i],t[i]))return!1;return!0}return e===t||Number.isNaN(e)&&Number.isNaN(t)}if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(let i=0,r=e.length;i<r;i++)if(!n(e[i],t[i]))return!1;return!0}t.PDFHistory=class{constructor({linkService:e,eventBus:t}){this.linkService=e,this.eventBus=t,this._initialized=!1,this._fingerprint="",this.reset(),this._boundEvents=null,this.eventBus._on("pagesinit",(()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",(e=>{this._isPagesLoaded=!!e.pagesCount}),{once:!0})}))}initialize({fingerprint:e,resetHistory:t=!1,updateUrl:n=!1}){if(!e||"string"!=typeof e)return void console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');this._initialized&&this.reset();const i=""!==this._fingerprint&&this._fingerprint!==e;this._fingerprint=e,this._updateUrl=!0===n,this._initialized=!0,this._bindEvents();const r=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=s(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this._isValidState(r,!0)||t){const{hash:e,page:n,rotation:r}=this._parseCurrentHash(!0);return!e||i||t?void this._pushOrReplaceState(null,!0):void this._pushOrReplaceState({hash:e,page:n,rotation:r},!0)}const a=r.destination;this._updateInternalState(a,r.uid,!0),void 0!==a.rotation&&(this._initialRotation=a.rotation),a.dest?(this._initialBookmark=JSON.stringify(a.dest),this._destination.page=null):a.hash?this._initialBookmark=a.hash:a.page&&(this._initialBookmark=`page=${a.page}`)}reset(){this._initialized&&(this._pageHide(),this._initialized=!1,this._unbindEvents()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:e=null,explicitDest:t,pageNumber:n}){if(!this._initialized)return;if(e&&"string"!=typeof e)return void console.error(`PDFHistory.push: "${e}" is not a valid namedDest parameter.`);if(!Array.isArray(t))return void console.error(`PDFHistory.push: "${t}" is not a valid explicitDest parameter.`);if(!this._isValidPage(n)&&(null!==n||this._destination))return void console.error(`PDFHistory.push: "${n}" is not a valid pageNumber parameter.`);const i=e||JSON.stringify(t);if(!i)return;let r=!1;if(this._destination&&(a(this._destination.hash,i)||o(this._destination.dest,t))){if(this._destination.page)return;r=!0}this._popStateInProgress&&!r||(this._pushOrReplaceState({dest:t,hash:i,page:n,rotation:this.linkService.rotation},r),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then((()=>{this._popStateInProgress=!1}))))}pushPage(e){this._initialized&&(this._isValidPage(e)?this._destination?.page!==e&&(this._popStateInProgress||(this._pushOrReplaceState({dest:null,hash:`page=${e}`,page:e,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then((()=>{this._popStateInProgress=!1}))))):console.error(`PDFHistory.pushPage: "${e}" is not a valid page number.`))}pushCurrentPosition(){this._initialized&&!this._popStateInProgress&&this._tryPushCurrentPosition()}back(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;this._isValidState(e)&&e.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;this._isValidState(e)&&e.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}_pushOrReplaceState(e,t=!1){const n=t||!this._destination,i={fingerprint:this._fingerprint,uid:n?this._uid:this._uid+1,destination:e};let r;if(this._updateInternalState(e,i.uid),this._updateUrl&&e?.hash){const t=document.location.href.split("#")[0];t.startsWith("file://")||(r=`${t}#${e.hash}`)}n?window.history.replaceState(i,"",r):window.history.pushState(i,"",r)}_tryPushCurrentPosition(e=!1){if(!this._position)return;let t=this._position;if(e&&(t=Object.assign(Object.create(null),this._position),t.temporary=!0),!this._destination)return void this._pushOrReplaceState(t);if(this._destination.temporary)return void this._pushOrReplaceState(t,!0);if(this._destination.hash===t.hash)return;if(!this._destination.page&&this._numPositionUpdates<=50)return;let n=!1;if(this._destination.page>=t.first&&this._destination.page<=t.page){if(void 0!==this._destination.dest||!this._destination.first)return;n=!0}this._pushOrReplaceState(t,n)}_isValidPage(e){return Number.isInteger(e)&&e>0&&e<=this.linkService.pagesCount}_isValidState(e,t=!1){if(!e)return!1;if(e.fingerprint!==this._fingerprint){if(!t)return!1;{if("string"!=typeof e.fingerprint||e.fingerprint.length!==this._fingerprint.length)return!1;const[t]=performance.getEntriesByType("navigation");if("reload"!==t?.type)return!1}}return!(!Number.isInteger(e.uid)||e.uid<0)&&null!==e.destination&&"object"==typeof e.destination}_updateInternalState(e,t,n=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),n&&e?.temporary&&delete e.temporary,this._destination=e,this._uid=t,this._maxUid=Math.max(this._maxUid,t),this._numPositionUpdates=0}_parseCurrentHash(e=!1){const t=unescape(s()).substring(1),n=(0,i.parseQueryString)(t),r=n.get("nameddest")||"";let a=0|n.get("page");return(!this._isValidPage(a)||e&&r.length>0)&&(a=null),{hash:t,page:a,rotation:this.linkService.rotation}}_updateViewarea({location:e}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:e.pdfOpenParams.substring(1),page:this.linkService.page,first:e.pageNumber,rotation:e.rotation},this._popStateInProgress||(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout((()=>{this._popStateInProgress||this._tryPushCurrentPosition(!0),this._updateViewareaTimeout=null}),1e3))}_popState({state:e}){const t=s(),n=this._currentHash!==t;if(this._currentHash=t,!e){this._uid++;const{hash:e,page:t,rotation:n}=this._parseCurrentHash();return void this._pushOrReplaceState({hash:e,page:t,rotation:n},!0)}if(!this._isValidState(e))return;this._popStateInProgress=!0,n&&(this._blockHashChange++,(0,r.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:1e3}).then((()=>{this._blockHashChange--})));const a=e.destination;this._updateInternalState(a,e.uid,!0),(0,i.isValidRotation)(a.rotation)&&(this.linkService.rotation=a.rotation),a.dest?this.linkService.goToDestination(a.dest):a.hash?this.linkService.setHash(a.hash):a.page&&(this.linkService.page=a.page),Promise.resolve().then((()=>{this._popStateInProgress=!1}))}_pageHide(){this._destination&&!this._destination.temporary||this._tryPushCurrentPosition()}_bindEvents(){this._boundEvents||(this._boundEvents={updateViewarea:this._updateViewarea.bind(this),popState:this._popState.bind(this),pageHide:this._pageHide.bind(this)},this.eventBus._on("updateviewarea",this._boundEvents.updateViewarea),window.addEventListener("popstate",this._boundEvents.popState),window.addEventListener("pagehide",this._boundEvents.pageHide))}_unbindEvents(){this._boundEvents&&(this.eventBus._off("updateviewarea",this._boundEvents.updateViewarea),window.removeEventListener("popstate",this._boundEvents.popState),window.removeEventListener("pagehide",this._boundEvents.pageHide),this._boundEvents=null)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFPageView=void 0;var i=n(4),r=n(2),s=n(14),a=n(6),o=n(15),l=n(7),c=n(5),d=n(16),h=n(17),u=n(18),p=n(19),f=n(20);const g=o.compatibilityParams.maxCanvasPixels||16777216,m=()=>({annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new c.SimpleLinkService}});t.PDFPageView=class{#gi=i.AnnotationMode.ENABLE_FORMS;#mi=null;#_i=null;#bi=null;#vi=null;#yi=r.RenderingStates.INITIAL;#Ai=r.TextLayerMode.ENABLE;#xi={directDrawing:!0,initialOptionalContent:!0,regularAnnotations:!0};#Si=new WeakMap;constructor(e){const t=e.container,n=e.defaultViewport;this.id=e.id,this.renderingId="page"+this.id,this.#mi=e.layerProperties||m,this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=e.scale||r.DEFAULT_SCALE,this.viewport=n,this.pdfPageRotate=n.rotation,this._optionalContentConfigPromise=e.optionalContentConfigPromise||null,this.hasRestrictedScaling=!1,this.#Ai=e.textLayerMode??r.TextLayerMode.ENABLE,this.#gi=e.annotationMode??i.AnnotationMode.ENABLE_FORMS,this.imageResourcesPath=e.imageResourcesPath||"",this.useOnlyCssZoom=e.useOnlyCssZoom||!1,this.isOffscreenCanvasSupported=e.isOffscreenCanvasSupported??!0,this.maxCanvasPixels=e.maxCanvasPixels||g,this.pageColors=e.pageColors||null,this.eventBus=e.eventBus,this.renderingQueue=e.renderingQueue,this.l10n=e.l10n||l.NullL10n,this.renderTask=null,this.resume=null,this._isStandalone=!this.renderingQueue?.hasViewer(),this._container=t,this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.zoomLayer=null,this.xfaLayer=null,this.structTreeLayer=null;const s=document.createElement("div");if(s.className="page",s.setAttribute("data-page-number",this.id),s.setAttribute("role","region"),this.l10n.get("page_landmark",{page:this.id}).then((e=>{s.setAttribute("aria-label",e)})),this.div=s,this.#wi(),t?.append(s),this._isStandalone){t?.style.setProperty("--scale-factor",this.scale*i.PixelsPerInch.PDF_TO_CSS_UNITS);const{optionalContentConfigPromise:n}=e;n&&n.then((e=>{n===this._optionalContentConfigPromise&&(this.#xi.initialOptionalContent=e.hasInitialVisibility)}))}}get renderingState(){return this.#yi}set renderingState(e){if(e!==this.#yi)switch(this.#yi=e,this.#_i&&(clearTimeout(this.#_i),this.#_i=null),e){case r.RenderingStates.PAUSED:this.div.classList.remove("loading");break;case r.RenderingStates.RUNNING:this.div.classList.add("loadingIcon"),this.#_i=setTimeout((()=>{this.div.classList.add("loading"),this.#_i=null}),0);break;case r.RenderingStates.INITIAL:case r.RenderingStates.FINISHED:this.div.classList.remove("loadingIcon","loading")}}#wi(){const{viewport:e}=this;if(this.pdfPage){if(this.#bi===e.rotation)return;this.#bi=e.rotation}(0,i.setLayerDimensions)(this.div,e,!0,!1)}setPdfPage(e){!this._isStandalone||"CanvasText"!==this.pageColors?.foreground&&"Canvas"!==this.pageColors?.background||this._container?.style.setProperty("--hcm-highligh-filter",e.filterFactory.addHighlightHCMFilter("CanvasText","Canvas","HighlightText","Highlight")),this.pdfPage=e,this.pdfPageRotate=e.rotate;const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:this.scale*i.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:t}),this.#wi(),this.reset()}destroy(){this.reset(),this.pdfPage?.cleanup()}get _textHighlighter(){return(0,i.shadow)(this,"_textHighlighter",new u.TextHighlighter({pageIndex:this.id-1,eventBus:this.eventBus,findController:this.#mi().findController}))}async#Ei(){let e=null;try{await this.annotationLayer.render(this.viewport,"display")}catch(t){console.error(`#renderAnnotationLayer: "${t}".`),e=t}finally{this.eventBus.dispatch("annotationlayerrendered",{source:this,pageNumber:this.id,error:e})}}async#Pi(){let e=null;try{await this.annotationEditorLayer.render(this.viewport,"display")}catch(t){console.error(`#renderAnnotationEditorLayer: "${t}".`),e=t}finally{this.eventBus.dispatch("annotationeditorlayerrendered",{source:this,pageNumber:this.id,error:e})}}async#Ci(){let e=null;try{const e=await this.xfaLayer.render(this.viewport,"display");e?.textDivs&&this._textHighlighter&&this.#ki(e.textDivs)}catch(t){console.error(`#renderXfaLayer: "${t}".`),e=t}finally{this.eventBus.dispatch("xfalayerrendered",{source:this,pageNumber:this.id,error:e})}}async#Ti(){const{pdfPage:e,textLayer:t,viewport:n}=this;if(!t)return;let r=null;try{if(!t.renderingDone){const n=e.streamTextContent({includeMarkedContent:!0,disableNormalization:!0});t.setTextContentSource(n)}await t.render(n)}catch(e){if(e instanceof i.AbortException)return;console.error(`#renderTextLayer: "${e}".`),r=e}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.id,numTextDivs:t.numTextDivs,error:r}),this.#Mi()}async#Mi(){if(!this.textLayer)return;this.structTreeLayer||=new d.StructTreeLayerBuilder;const e=await(this.structTreeLayer.renderingDone?null:this.pdfPage.getStructTree()),t=this.structTreeLayer?.render(e);t&&this.canvas?.append(t),this.structTreeLayer?.show()}async#ki(e){const t=await this.pdfPage.getTextContent(),n=[];for(const e of t.items)n.push(e.str);this._textHighlighter.setTextMapping(e,n),this._textHighlighter.enable()}_resetZoomLayer(e=!1){if(!this.zoomLayer)return;const t=this.zoomLayer.firstChild;this.#Si.delete(t),t.width=0,t.height=0,e&&this.zoomLayer.remove(),this.zoomLayer=null}reset({keepZoomLayer:e=!1,keepAnnotationLayer:t=!1,keepAnnotationEditorLayer:n=!1,keepXfaLayer:i=!1,keepTextLayer:s=!1}={}){this.cancelRendering({keepAnnotationLayer:t,keepAnnotationEditorLayer:n,keepXfaLayer:i,keepTextLayer:s}),this.renderingState=r.RenderingStates.INITIAL;const a=this.div,o=a.childNodes,l=e&&this.zoomLayer||null,c=t&&this.annotationLayer?.div||null,d=n&&this.annotationEditorLayer?.div||null,h=i&&this.xfaLayer?.div||null,u=s&&this.textLayer?.div||null;for(let e=o.length-1;e>=0;e--){const t=o[e];switch(t){case l:case c:case d:case h:case u:continue}t.remove()}a.removeAttribute("data-loaded"),c&&this.annotationLayer.hide(),d&&this.annotationEditorLayer.hide(),h&&this.xfaLayer.hide(),u&&this.textLayer.hide(),this.structTreeLayer?.hide(),l||(this.canvas&&(this.#Si.delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer())}update({scale:e=0,rotation:t=null,optionalContentConfigPromise:n=null,drawingDelay:s=-1}){this.scale=e||this.scale,"number"==typeof t&&(this.rotation=t),n instanceof Promise&&(this._optionalContentConfigPromise=n,n.then((e=>{n===this._optionalContentConfigPromise&&(this.#xi.initialOptionalContent=e.hasInitialVisibility)}))),this.#xi.directDrawing=!0;const a=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:this.scale*i.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:a}),this.#wi(),this._isStandalone&&this._container?.style.setProperty("--scale-factor",this.viewport.scale);let o=!1;if(this.canvas&&this.maxCanvasPixels>0){const{width:e,height:t}=this.viewport,{sx:n,sy:i}=this.outputScale;(Math.floor(e)*n|0)*(Math.floor(t)*i|0)>this.maxCanvasPixels&&(o=!0)}const l=this.useOnlyCssZoom||this.hasRestrictedScaling&&o,c=!l&&s>=0&&s<1e3;if(this.canvas){if(c||l){if(c&&this.renderingState!==r.RenderingStates.FINISHED&&(this.cancelRendering({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:s}),this.renderingState=r.RenderingStates.FINISHED,this.#xi.directDrawing=!1),this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!c,hideTextLayer:c}),c)return;return void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this.#vi})}this.zoomLayer||this.canvas.hidden||(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform({target:this.zoomLayer.firstChild}),this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0})}cancelRendering({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:t=!1,keepXfaLayer:n=!1,keepTextLayer:i=!1,cancelExtraDelay:r=0}={}){this.renderTask&&(this.renderTask.cancel(r),this.renderTask=null),this.resume=null,!this.textLayer||i&&this.textLayer.div||(this.textLayer.cancel(),this.textLayer=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),!this.annotationLayer||e&&this.annotationLayer.div||(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),!this.annotationEditorLayer||t&&this.annotationEditorLayer.div||(this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),!this.xfaLayer||n&&this.xfaLayer.div||(this.xfaLayer.cancel(),this.xfaLayer=null,this._textHighlighter?.disable())}cssTransform({target:e,redrawAnnotationLayer:t=!1,redrawAnnotationEditorLayer:n=!1,redrawXfaLayer:i=!1,redrawTextLayer:r=!1,hideTextLayer:s=!1}){if(!e.hasAttribute("zooming")){e.setAttribute("zooming",!0);const{style:t}=e;t.width=t.height=""}const a=this.#Si.get(e);if(this.viewport!==a){const t=this.viewport.rotation-a.rotation,n=Math.abs(t);let i=1,r=1;if(90===n||270===n){const{width:e,height:t}=this.viewport;i=t/e,r=e/t}e.style.transform=`rotate(${t}deg) scale(${i}, ${r})`}t&&this.annotationLayer&&this.#Ei(),n&&this.annotationEditorLayer&&this.#Pi(),i&&this.xfaLayer&&this.#Ci(),this.textLayer&&(s?(this.textLayer.hide(),this.structTreeLayer?.hide()):r&&this.#Ti())}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,t){return this.viewport.convertToPdfPoint(e,t)}async#Li(e,t=null){if(e===this.renderTask&&(this.renderTask=null),t instanceof i.RenderingCancelledException)this.#vi=null;else if(this.#vi=t,this.renderingState=r.RenderingStates.FINISHED,this._resetZoomLayer(!0),this.#xi.regularAnnotations=!e.separateAnnots,this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!1,timestamp:performance.now(),error:this.#vi}),t)throw t}async draw(){this.renderingState!==r.RenderingStates.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:e,l10n:t,pageColors:n,pdfPage:o,viewport:l}=this;if(!o)throw this.renderingState=r.RenderingStates.FINISHED,new Error("pdfPage is not loaded");this.renderingState=r.RenderingStates.RUNNING;const c=document.createElement("div");if(c.classList.add("canvasWrapper"),e.append(c),this.textLayer||this.#Ai===r.TextLayerMode.DISABLE||o.isPureXfa||(this._accessibilityManager||=new h.TextAccessibilityManager,this.textLayer=new p.TextLayerBuilder({highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,enablePermissions:this.#Ai===r.TextLayerMode.ENABLE_PERMISSIONS}),e.append(this.textLayer.div)),!this.annotationLayer&&this.#gi!==i.AnnotationMode.DISABLE){const{annotationStorage:n,downloadManager:r,enableScripting:s,fieldObjectsPromise:l,hasJSActionsPromise:c,linkService:d}=this.#mi();this._annotationCanvasMap||=new Map,this.annotationLayer=new a.AnnotationLayerBuilder({pageDiv:e,pdfPage:o,annotationStorage:n,imageResourcesPath:this.imageResourcesPath,renderForms:this.#gi===i.AnnotationMode.ENABLE_FORMS,linkService:d,downloadManager:r,l10n:t,enableScripting:s,hasJSActionsPromise:c,fieldObjectsPromise:l,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager})}const{width:d,height:u}=l,g=document.createElement("canvas");g.setAttribute("role","presentation"),g.hidden=!0;const m=!(!n?.background||!n?.foreground);let _=e=>{m&&!e||(g.hidden=!1,_=null)};c.append(g),this.canvas=g;const b=g.getContext("2d",{alpha:!1}),v=this.outputScale=new r.OutputScale;if(this.useOnlyCssZoom){const e=l.clone({scale:i.PixelsPerInch.PDF_TO_CSS_UNITS});v.sx*=e.width/d,v.sy*=e.height/u}if(this.maxCanvasPixels>0){const e=d*u,t=Math.sqrt(this.maxCanvasPixels/e);v.sx>t||v.sy>t?(v.sx=t,v.sy=t,this.hasRestrictedScaling=!0):this.hasRestrictedScaling=!1}const y=(0,r.approximateFraction)(v.sx),A=(0,r.approximateFraction)(v.sy);g.width=(0,r.roundToDivide)(d*v.sx,y[0]),g.height=(0,r.roundToDivide)(u*v.sy,A[0]);const{style:x}=g;x.width=(0,r.roundToDivide)(d,y[1])+"px",x.height=(0,r.roundToDivide)(u,A[1])+"px",this.#Si.set(g,l);const S={canvasContext:b,transform:v.scaled?[v.sx,0,0,v.sy,0,0]:null,viewport:l,annotationMode:this.#gi,optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:n},w=this.renderTask=this.pdfPage.render(S);w.onContinue=e=>{if(_?.(!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this))return this.renderingState=r.RenderingStates.PAUSED,void(this.resume=()=>{this.renderingState=r.RenderingStates.RUNNING,e()});e()};const E=w.promise.then((async()=>{if(_?.(!0),await this.#Li(w),this.#Ti(),this.annotationLayer&&await this.#Ei(),!this.annotationEditorLayer){const{annotationEditorUIManager:n}=this.#mi();if(!n)return;this.annotationEditorLayer=new s.AnnotationEditorLayerBuilder({uiManager:n,pageDiv:e,pdfPage:o,l10n:t,accessibilityManager:this._accessibilityManager,annotationLayer:this.annotationLayer?.annotationLayer})}this.#Pi()}),(e=>(e instanceof i.RenderingCancelledException||_?.(!0),this.#Li(w,e))));if(o.isPureXfa){if(this.xfaLayer)this.xfaLayer.div&&e.append(this.xfaLayer.div);else{const{annotationStorage:t,linkService:n}=this.#mi();this.xfaLayer=new f.XfaLayerBuilder({pageDiv:e,pdfPage:o,annotationStorage:t,linkService:n})}this.#Ci()}return e.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),E}setPageLabel(e){this.pageLabel="string"==typeof e?e:null,null!==this.pageLabel?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){const{directDrawing:e,initialOptionalContent:t,regularAnnotations:n}=this.#xi;return e&&t&&n?this.canvas:null}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditorLayerBuilder=void 0;var i=n(4),r=n(7);t.AnnotationEditorLayerBuilder=class{#$e=null;#Ze;constructor(e){this.pageDiv=e.pageDiv,this.pdfPage=e.pdfPage,this.accessibilityManager=e.accessibilityManager,this.l10n=e.l10n||r.NullL10n,this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,this.#Ze=e.uiManager,this.#$e=e.annotationLayer||null}async render(e,t="display"){if("display"!==t)return;if(this._cancelled)return;const n=e.clone({dontFlip:!0});if(this.div)return this.annotationEditorLayer.update({viewport:n}),void this.show();const r=this.div=document.createElement("div");r.className="annotationEditorLayer",r.tabIndex=0,r.hidden=!0,this.pageDiv.append(r),this.annotationEditorLayer=new i.AnnotationEditorLayer({uiManager:this.#Ze,div:r,accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:n,annotationLayer:this.#$e});const s={viewport:n,div:r,annotations:null,intent:t};this.annotationEditorLayer.render(s),this.show()}cancel(){this._cancelled=!0,this.div&&(this.pageDiv=null,this.annotationEditorLayer.destroy(),this.div.remove())}hide(){this.div&&(this.div.hidden=!0)}show(){this.div&&!this.annotationEditorLayer.isEmpty&&(this.div.hidden=!1)}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.compatibilityParams=t.OptionKind=t.AppOptions=void 0;const n=Object.create(null);t.compatibilityParams=n;{const e=navigator.userAgent||"",t=navigator.platform||"",i=navigator.maxTouchPoints||1,r=/Android/.test(e);(/\b(iPad|iPhone|iPod)(?=;)/.test(e)||"MacIntel"===t&&i>1||r)&&(n.maxCanvasPixels=5242880)}const i={VIEWER:2,API:4,WORKER:8,PREFERENCE:128};t.OptionKind=i;const r={annotationEditorMode:{value:0,kind:i.VIEWER+i.PREFERENCE},annotationMode:{value:2,kind:i.VIEWER+i.PREFERENCE},cursorToolOnLoad:{value:0,kind:i.VIEWER+i.PREFERENCE},defaultZoomDelay:{value:400,kind:i.VIEWER+i.PREFERENCE},defaultZoomValue:{value:"",kind:i.VIEWER+i.PREFERENCE},disableHistory:{value:!1,kind:i.VIEWER},disablePageLabels:{value:!1,kind:i.VIEWER+i.PREFERENCE},enablePermissions:{value:!1,kind:i.VIEWER+i.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:i.VIEWER+i.PREFERENCE},enableScripting:{value:!0,kind:i.VIEWER+i.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:i.VIEWER},externalLinkTarget:{value:0,kind:i.VIEWER+i.PREFERENCE},historyUpdateUrl:{value:!1,kind:i.VIEWER+i.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:i.VIEWER+i.PREFERENCE},imageResourcesPath:{value:"./images/",kind:i.VIEWER},maxCanvasPixels:{value:16777216,kind:i.VIEWER},forcePageColors:{value:!1,kind:i.VIEWER+i.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:i.VIEWER+i.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:i.VIEWER+i.PREFERENCE},pdfBugEnabled:{value:!1,kind:i.VIEWER+i.PREFERENCE},printResolution:{value:150,kind:i.VIEWER},sidebarViewOnLoad:{value:-1,kind:i.VIEWER+i.PREFERENCE},scrollModeOnLoad:{value:-1,kind:i.VIEWER+i.PREFERENCE},spreadModeOnLoad:{value:-1,kind:i.VIEWER+i.PREFERENCE},textLayerMode:{value:1,kind:i.VIEWER+i.PREFERENCE},useOnlyCssZoom:{value:!1,kind:i.VIEWER+i.PREFERENCE},viewerCssTheme:{value:0,kind:i.VIEWER+i.PREFERENCE},viewOnLoad:{value:0,kind:i.VIEWER+i.PREFERENCE},cMapPacked:{value:!0,kind:i.API},cMapUrl:{value:"../web/cmaps/",kind:i.API},disableAutoFetch:{value:!1,kind:i.API+i.PREFERENCE},disableFontFace:{value:!1,kind:i.API+i.PREFERENCE},disableRange:{value:!1,kind:i.API+i.PREFERENCE},disableStream:{value:!1,kind:i.API+i.PREFERENCE},docBaseUrl:{value:"",kind:i.API},enableXfa:{value:!0,kind:i.API+i.PREFERENCE},fontExtraProperties:{value:!1,kind:i.API},isEvalSupported:{value:!0,kind:i.API},isOffscreenCanvasSupported:{value:!0,kind:i.API},maxImageSize:{value:-1,kind:i.API},pdfBug:{value:!1,kind:i.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:i.API},verbosity:{value:1,kind:i.API},workerPort:{value:null,kind:i.WORKER},workerSrc:{value:"../build/pdf.worker.js",kind:i.WORKER}};r.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:i.VIEWER},r.disablePreferences={value:!1,kind:i.VIEWER},r.locale={value:navigator.language||"en-US",kind:i.VIEWER},r.sandboxBundleSrc={value:"../build/pdf.sandbox.js",kind:i.VIEWER};const s=Object.create(null);class a{constructor(){throw new Error("Cannot initialize AppOptions.")}static get(e){const t=s[e];if(void 0!==t)return t;const i=r[e];return void 0!==i?n[e]??i.value:void 0}static getAll(e=null){const t=Object.create(null);for(const a in r){const o=r[a];if(e){if(0==(e&o.kind))continue;if(e===i.PREFERENCE){const e=o.value,n=typeof e;if("boolean"===n||"string"===n||"number"===n&&Number.isInteger(e)){t[a]=e;continue}throw new Error(`Invalid type for preference: ${a}`)}}const l=s[a];t[a]=void 0!==l?l:n[a]??o.value}return t}static set(e,t){s[e]=t}static setAll(e){for(const t in e)s[t]=e[t]}static remove(e){delete s[e]}}t.AppOptions=a,a._hasUserOptions=function(){return Object.keys(s).length>0}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StructTreeLayerBuilder=void 0;const n={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},i=/^H(\d+)$/;t.StructTreeLayerBuilder=class{#Ri=void 0;get renderingDone(){return void 0!==this.#Ri}render(e){if(void 0!==this.#Ri)return this.#Ri;const t=this.#Ii(e);return t?.classList.add("structTree"),this.#Ri=t}hide(){this.#Ri&&!this.#Ri.hidden&&(this.#Ri.hidden=!0)}show(){this.#Ri?.hidden&&(this.#Ri.hidden=!1)}#Fi(e,t){void 0!==e.alt&&t.setAttribute("aria-label",e.alt),void 0!==e.id&&t.setAttribute("aria-owns",e.id),void 0!==e.lang&&t.setAttribute("lang",e.lang)}#Ii(e){if(!e)return null;const t=document.createElement("span");if("role"in e){const{role:r}=e,s=r.match(i);s?(t.setAttribute("role","heading"),t.setAttribute("aria-level",s[1])):n[r]&&t.setAttribute("role",n[r])}if(this.#Fi(e,t),e.children)if(1===e.children.length&&"id"in e.children[0])this.#Fi(e.children[0],t);else for(const n of e.children)t.append(this.#Ii(n));return t}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextAccessibilityManager=void 0;var i=n(2);class r{#Di=!1;#Oi=null;#Ni=new Map;#ji=new Map;setTextMapping(e){this.#Oi=e}static#Bi(e,t){const n=e.getBoundingClientRect(),i=t.getBoundingClientRect();if(0===n.width&&0===n.height)return 1;if(0===i.width&&0===i.height)return-1;const r=n.y,s=n.y+n.height,a=n.y+n.height/2,o=i.y,l=i.y+i.height,c=i.y+i.height/2;return a<=o&&c>=s?-1:c<=r&&a>=l?1:n.x+n.width/2-(i.x+i.width/2)}enable(){if(this.#Di)throw new Error("TextAccessibilityManager is already enabled.");if(!this.#Oi)throw new Error("Text divs and strings have not been set.");if(this.#Di=!0,this.#Oi=this.#Oi.slice(),this.#Oi.sort(r.#Bi),this.#Ni.size>0){const e=this.#Oi;for(const[t,n]of this.#Ni)document.getElementById(t)?this.#Ui(t,e[n]):this.#Ni.delete(t)}for(const[e,t]of this.#ji)this.addPointerInTextLayer(e,t);this.#ji.clear()}disable(){this.#Di&&(this.#ji.clear(),this.#Oi=null,this.#Di=!1)}removePointerInTextLayer(e){if(!this.#Di)return void this.#ji.delete(e);const t=this.#Oi;if(!t||0===t.length)return;const{id:n}=e,i=this.#Ni.get(n);if(void 0===i)return;const r=t[i];this.#Ni.delete(n);let s=r.getAttribute("aria-owns");s?.includes(n)&&(s=s.split(" ").filter((e=>e!==n)).join(" "),s?r.setAttribute("aria-owns",s):(r.removeAttribute("aria-owns"),r.setAttribute("role","presentation")))}#Ui(e,t){const n=t.getAttribute("aria-owns");n?.includes(e)||t.setAttribute("aria-owns",n?`${n} ${e}`:e),t.removeAttribute("role")}addPointerInTextLayer(e,t){const{id:n}=e;if(!n)return;if(!this.#Di)return void this.#ji.set(e,t);t&&this.removePointerInTextLayer(e);const s=this.#Oi;if(!s||0===s.length)return;const a=(0,i.binarySearchFirstItem)(s,(t=>r.#Bi(e,t)<0)),o=Math.max(0,a-1);this.#Ui(n,s[o]),this.#Ni.set(n,o)}moveElementInDOM(e,t,n,s){if(this.addPointerInTextLayer(n,s),!e.hasChildNodes())return void e.append(t);const a=Array.from(e.childNodes).filter((e=>e!==t));if(0===a.length)return;const o=n||t,l=(0,i.binarySearchFirstItem)(a,(e=>r.#Bi(o,e)<0));0===l?a[0].before(t):a[l-1].after(t)}}t.TextAccessibilityManager=r},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextHighlighter=void 0,t.TextHighlighter=class{constructor({findController:e,eventBus:t,pageIndex:n}){this.findController=e,this.matches=[],this.eventBus=t,this.pageIdx=n,this._onUpdateTextLayerMatches=null,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(e,t){this.textDivs=e,this.textContentItemsStr=t}enable(){if(!this.textDivs||!this.textContentItemsStr)throw new Error("Text divs and strings have not been set.");if(this.enabled)throw new Error("TextHighlighter is already enabled.");this.enabled=!0,this._onUpdateTextLayerMatches||(this._onUpdateTextLayerMatches=e=>{e.pageIndex!==this.pageIdx&&-1!==e.pageIndex||this._updateMatches()},this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches)),this._updateMatches()}disable(){this.enabled&&(this.enabled=!1,this._onUpdateTextLayerMatches&&(this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches),this._onUpdateTextLayerMatches=null),this._updateMatches(!0))}_convertMatches(e,t){if(!e)return[];const{textContentItemsStr:n}=this;let i=0,r=0;const s=n.length-1,a=[];for(let o=0,l=e.length;o<l;o++){let l=e[o];for(;i!==s&&l>=r+n[i].length;)r+=n[i].length,i++;i===n.length&&console.error("Could not find a matching mapping");const c={begin:{divIdx:i,offset:l-r}};for(l+=t[o];i!==s&&l>r+n[i].length;)r+=n[i].length,i++;c.end={divIdx:i,offset:l-r},a.push(c)}return a}_renderMatches(e){if(0===e.length)return;const{findController:t,pageIdx:n}=this,{textContentItemsStr:i,textDivs:r}=this,s=n===t.selected.pageIdx,a=t.selected.matchIdx;let o=null;const l=void 0;function c(e,t){const n=e.divIdx;return r[n].textContent="",d(n,0,e.offset,t)}function d(e,t,n,s){let a=r[e];if(a.nodeType===Node.TEXT_NODE){const t=document.createElement("span");a.before(t),t.append(a),r[e]=t,a=t}const o=i[e].substring(t,n),l=document.createTextNode(o);if(s){const e=document.createElement("span");return e.className=`${s} appended`,e.append(l),a.append(e),s.includes("selected")?e.offsetLeft:0}return a.append(l),0}let h=a,u=h+1;if(t.state.highlightAll)h=0,u=e.length;else if(!s)return;let p=-1,f=-1;for(let i=h;i<u;i++){const h=e[i],u=h.begin;if(u.divIdx===p&&u.offset===f)continue;p=u.divIdx,f=u.offset;const g=h.end,m=s&&i===a,_=m?" selected":"";let b=0;if(o&&u.divIdx===o.divIdx?d(o.divIdx,o.offset,u.offset):(null!==o&&d(o.divIdx,o.offset,l),c(u)),u.divIdx===g.divIdx)b=d(u.divIdx,u.offset,g.offset,"highlight"+_);else{b=d(u.divIdx,u.offset,l,"highlight begin"+_);for(let e=u.divIdx+1,t=g.divIdx;e<t;e++)r[e].className="highlight middle"+_;c(g,"highlight end"+_)}o=g,m&&t.scrollMatchIntoView({element:r[u.divIdx],selectedLeft:b,pageIndex:n,matchIndex:a})}o&&d(o.divIdx,o.offset,l)}_updateMatches(e=!1){if(!this.enabled&&!e)return;const{findController:t,matches:n,pageIdx:i}=this,{textContentItemsStr:r,textDivs:s}=this;let a=-1;for(const e of n){for(let t=Math.max(a,e.begin.divIdx),n=e.end.divIdx;t<=n;t++){const e=s[t];e.textContent=r[t],e.className=""}a=e.end.divIdx+1}if(!t?.highlightMatches||e)return;const o=t.pageMatches[i]||null,l=t.pageMatchesLength[i]||null;this.matches=this._convertMatches(o,l),this._renderMatches(this.matches)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayerBuilder=void 0;var i=n(4),r=n(2);t.TextLayerBuilder=class{#Vi=!1;#Hi=0;#zi=0;#Wi=null;constructor({highlighter:e=null,accessibilityManager:t=null,isOffscreenCanvasSupported:n=!0,enablePermissions:i=!1}){this.textContentItemsStr=[],this.renderingDone=!1,this.textDivs=[],this.textDivProperties=new WeakMap,this.textLayerRenderTask=null,this.highlighter=e,this.accessibilityManager=t,this.isOffscreenCanvasSupported=n,this.#Vi=!0===i,this.div=document.createElement("div"),this.div.className="textLayer",this.hide()}#qi(){this.renderingDone=!0;const e=document.createElement("div");e.className="endOfContent",this.div.append(e),this.#$i()}get numTextDivs(){return this.textDivs.length}async render(e){if(!this.#Wi)throw new Error('No "textContentSource" parameter specified.');const t=e.scale*(globalThis.devicePixelRatio||1),{rotation:n}=e;if(this.renderingDone){const r=n!==this.#Hi,s=t!==this.#zi;return(r||s)&&(this.hide(),(0,i.updateTextLayer)({container:this.div,viewport:e,textDivs:this.textDivs,textDivProperties:this.textDivProperties,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,mustRescale:s,mustRotate:r}),this.#zi=t,this.#Hi=n),void this.show()}this.cancel(),this.highlighter?.setTextMapping(this.textDivs,this.textContentItemsStr),this.accessibilityManager?.setTextMapping(this.textDivs),this.textLayerRenderTask=(0,i.renderTextLayer)({textContentSource:this.#Wi,container:this.div,viewport:e,textDivs:this.textDivs,textDivProperties:this.textDivProperties,textContentItemsStr:this.textContentItemsStr,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported}),await this.textLayerRenderTask.promise,this.#qi(),this.#zi=t,this.#Hi=n,this.show(),this.accessibilityManager?.enable()}hide(){this.div.hidden||(this.highlighter?.disable(),this.div.hidden=!0)}show(){this.div.hidden&&this.renderingDone&&(this.div.hidden=!1,this.highlighter?.enable())}cancel(){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this.highlighter?.disable(),this.accessibilityManager?.disable(),this.textContentItemsStr.length=0,this.textDivs.length=0,this.textDivProperties=new WeakMap}setTextContentSource(e){this.cancel(),this.#Wi=e}#$i(){const{div:e}=this;e.addEventListener("mousedown",(t=>{const n=e.querySelector(".endOfContent");if(!n)return;let i=t.target!==e;if(i&&="none"!==getComputedStyle(n).getPropertyValue("-moz-user-select"),i){const i=e.getBoundingClientRect(),r=Math.max(0,(t.pageY-i.top)/i.height);n.style.top=(100*r).toFixed(2)+"%"}n.classList.add("active")})),e.addEventListener("mouseup",(()=>{const t=e.querySelector(".endOfContent");t&&(t.style.top="",t.classList.remove("active"))})),e.addEventListener("copy",(e=>{if(!this.#Vi){const t=document.getSelection();e.clipboardData.setData("text/plain",(0,r.removeNullCharacters)((0,i.normalizeUnicode)(t.toString())))}e.preventDefault(),e.stopPropagation()}))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayerBuilder=void 0;var i=n(4);t.XfaLayerBuilder=class{constructor({pageDiv:e,pdfPage:t,annotationStorage:n=null,linkService:i,xfaHtml:r=null}){this.pageDiv=e,this.pdfPage=t,this.annotationStorage=n,this.linkService=i,this.xfaHtml=r,this.div=null,this._cancelled=!1}async render(e,t="display"){if("print"===t){const n={viewport:e.clone({dontFlip:!0}),div:this.div,xfaHtml:this.xfaHtml,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:t},r=document.createElement("div");return this.pageDiv.append(r),n.div=r,i.XfaLayer.render(n)}const n=await this.pdfPage.getXfa();if(this._cancelled||!n)return{textDivs:[]};const r={viewport:e.clone({dontFlip:!0}),div:this.div,xfaHtml:n,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:t};return this.div?i.XfaLayer.update(r):(this.div=document.createElement("div"),this.pageDiv.append(this.div),r.div=this.div,i.XfaLayer.render(r))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFScriptingManager=void 0;var i=n(2),r=n(4);t.PDFScriptingManager=class{#Gi=null;#Xi=null;#Ki=null;#H=null;#Yi=null;#Qi=null;#Ji=null;#Zi=!1;#er=null;#tr=null;constructor({eventBus:e,sandboxBundleSrc:t=null,externalServices:i=null,docProperties:r=null}){this.#H=e,this.#er=t,this.#Yi=i,this.#Ki=r;const s=n(22);this.#Yi||={createScripting:e=>new s.GenericScripting(e.sandboxBundleSrc)},this.#Ki||=e=>s.docProperties(e),i||window.addEventListener("updatefromsandbox",(e=>{this.#H.dispatch("updatefromsandbox",{source:window,detail:e.detail})}))}setViewer(e){this.#Ji=e}async setDocument(e){if(this.#Qi&&await this.#nr(),this.#Qi=e,!e)return;const[t,n,i]=await Promise.all([e.getFieldObjects(),e.getCalculationOrderIds(),e.getJSActions()]);if(t||i){if(e===this.#Qi){try{this.#tr=this.#ir()}catch(e){return console.error(`setDocument: "${e.message}".`),void await this.#nr()}this._internalEvents.set("updatefromsandbox",(e=>{e?.source===window&&this.#rr(e.detail)})),this._internalEvents.set("dispatcheventinsandbox",(e=>{this.#tr?.dispatchEventInSandbox(e.detail)})),this._internalEvents.set("pagechanging",(({pageNumber:e,previous:t})=>{e!==t&&(this.#sr(t),this.#ar(e))})),this._internalEvents.set("pagerendered",(({pageNumber:e})=>{this._pageOpenPending.has(e)&&e===this.#Ji.currentPageNumber&&this.#ar(e)})),this._internalEvents.set("pagesdestroy",(async()=>{await this.#sr(this.#Ji.currentPageNumber),await(this.#tr?.dispatchEventInSandbox({id:"doc",name:"WillClose"})),this.#Gi?.resolve()}));for(const[e,t]of this._internalEvents)this.#H._on(e,t);try{const r=await this.#Ki(e);if(e!==this.#Qi)return;await this.#tr.createSandbox({objects:t,calculationOrder:n,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...r,actions:i}}),this.#H.dispatch("sandboxcreated",{source:this})}catch(e){return console.error(`setDocument: "${e.message}".`),void await this.#nr()}await(this.#tr?.dispatchEventInSandbox({id:"doc",name:"Open"})),await this.#ar(this.#Ji.currentPageNumber,!0),Promise.resolve().then((()=>{e===this.#Qi&&(this.#Zi=!0)}))}}else await this.#nr()}async dispatchWillSave(){return this.#tr?.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(){return this.#tr?.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(){return this.#tr?.dispatchEventInSandbox({id:"doc",name:"WillPrint"})}async dispatchDidPrint(){return this.#tr?.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get destroyPromise(){return this.#Xi?.promise||null}get ready(){return this.#Zi}get _internalEvents(){return(0,r.shadow)(this,"_internalEvents",new Map)}get _pageOpenPending(){return(0,r.shadow)(this,"_pageOpenPending",new Set)}get _visitedPages(){return(0,r.shadow)(this,"_visitedPages",new Map)}async#rr(e){const t=this.#Ji,n=t.isInPresentationMode||t.isChangingPresentationMode,{id:r,siblings:s,command:a,value:o}=e;if(!r){switch(a){case"clear":console.clear();break;case"error":console.error(o);break;case"layout":if(!n){const e=(0,i.apiPageLayoutToViewerModes)(o);t.spreadMode=e.spreadMode}break;case"page-num":t.currentPageNumber=o+1;break;case"print":await t.pagesPromise,this.#H.dispatch("print",{source:this});break;case"println":console.log(o);break;case"zoom":n||(t.currentScaleValue=o);break;case"SaveAs":this.#H.dispatch("download",{source:this});break;case"FirstPage":t.currentPageNumber=1;break;case"LastPage":t.currentPageNumber=t.pagesCount;break;case"NextPage":t.nextPage();break;case"PrevPage":t.previousPage();break;case"ZoomViewIn":n||t.increaseScale();break;case"ZoomViewOut":n||t.decreaseScale()}return}if(n&&e.focus)return;delete e.id,delete e.siblings;const l=s?[r,...s]:[r];for(const t of l){const n=document.querySelector(`[data-element-id="${t}"]`);n?n.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:e})):this.#Qi?.annotationStorage.setValue(t,e)}}async#ar(e,t=!1){const n=this.#Qi,s=this._visitedPages;if(t&&(this.#Gi=new r.PromiseCapability),!this.#Gi)return;const a=this.#Ji.getPageView(e-1);if(a?.renderingState!==i.RenderingStates.FINISHED)return void this._pageOpenPending.add(e);this._pageOpenPending.delete(e);const o=(async()=>{const t=await(s.has(e)?null:a.pdfPage?.getJSActions());n===this.#Qi&&await(this.#tr?.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:e,actions:t}))})();s.set(e,o)}async#sr(e){const t=this.#Qi,n=this._visitedPages;if(!this.#Gi)return;if(this._pageOpenPending.has(e))return;const i=n.get(e);i&&(n.set(e,null),await i,t===this.#Qi&&await(this.#tr?.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:e})))}#ir(){if(this.#Xi=new r.PromiseCapability,this.#tr)throw new Error("#initScripting: Scripting already exists.");return this.#Yi.createScripting({sandboxBundleSrc:this.#er})}async#nr(){if(!this.#tr)return this.#Qi=null,void this.#Xi?.resolve();this.#Gi&&(await Promise.race([this.#Gi.promise,new Promise((e=>{setTimeout(e,1e3)}))]).catch((()=>{})),this.#Gi=null),this.#Qi=null;try{await this.#tr.destroySandbox()}catch{}for(const[e,t]of this._internalEvents)this.#H._off(e,t);this._internalEvents.clear(),this._pageOpenPending.clear(),this._visitedPages.clear(),this.#tr=null,this.#Zi=!1,this.#Xi?.resolve()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GenericScripting=void 0,t.docProperties=async function(e){const t="".split("#")[0];let{info:n,metadata:r,contentDispositionFilename:s,contentLength:a}=await e.getMetadata();if(!a){const{length:t}=await e.getDownloadInfo();a=t}return{...n,baseURL:t,filesize:a,filename:s||(0,i.getPdfFilenameFromUrl)(""),metadata:r?.getRaw(),authors:r?.get("dc:creator"),numPages:e.numPages,URL:""}};var i=n(4);t.GenericScripting=class{constructor(e){this._ready=(0,i.loadScript)(e,!0).then((()=>window.pdfjsSandbox.QuickJSSandbox()))}async createSandbox(e){(await this._ready).create(e)}async dispatchEventInSandbox(e){const t=await this._ready;setTimeout((()=>t.dispatchEvent(e)),0)}async destroySandbox(){(await this._ready).nukeSandbox()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFSinglePageViewer=void 0;var i=n(2),r=n(24);class s extends r.PDFViewer{_resetView(){super._resetView(),this._scrollMode=i.ScrollMode.PAGE,this._spreadMode=i.SpreadMode.NONE}set scrollMode(e){}_updateScrollMode(){}set spreadMode(e){}_updateSpreadMode(){}}t.PDFSinglePageViewer=s},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PagesCountLimit=t.PDFViewer=t.PDFPageViewBuffer=void 0;var i=n(4),r=n(2),s=n(7),a=n(13),o=n(25),l=n(5);const c={FORCE_SCROLL_MODE_PAGE:15e3,FORCE_LAZY_PAGE_INIT:7500,PAUSE_EAGER_PAGE_INIT:250};function d(e){return Object.values(i.AnnotationEditorType).includes(e)&&e!==i.AnnotationEditorType.DISABLE}t.PagesCountLimit=c;class h{#or=new Set;#lr=0;constructor(e){this.#lr=e}push(e){const t=this.#or;t.has(e)&&t.delete(e),t.add(e),t.size>this.#lr&&this.#cr()}resize(e,t=null){this.#lr=e;const n=this.#or;if(t){const e=n.size;let i=1;for(const r of n)if(t.has(r.id)&&(n.delete(r),n.add(r)),++i>e)break}for(;n.size>this.#lr;)this.#cr()}has(e){return this.#or.has(e)}[Symbol.iterator](){return this.#or.keys()}#cr(){const e=this.#or.keys().next().value;e?.destroy(),this.#or.delete(e)}}t.PDFPageViewBuffer=h,t.PDFViewer=class{#dr=null;#hr=i.AnnotationEditorType.NONE;#ur=null;#gi=i.AnnotationMode.ENABLE_FORMS;#pr=null;#fr=null;#Vi=!1;#gr=!1;#mr=null;#_r=!1;#br=0;#vr=new ResizeObserver(this.#yr.bind(this));#Ar=null;#xr=null;#Sr=null;#Ai=r.TextLayerMode.ENABLE;constructor(e){const t="3.8.162";if(i.version!==t)throw new Error(`The API version "${i.version}" does not match the Viewer version "${t}".`);if(this.container=e.container,this.viewer=e.viewer||e.container.firstElementChild,"DIV"!==this.container?.tagName||"DIV"!==this.viewer?.tagName)throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&"absolute"!==getComputedStyle(this.container).position)throw new Error("The `container` must be absolutely positioned.");this.#vr.observe(this.container),this.eventBus=e.eventBus,this.linkService=e.linkService||new l.SimpleLinkService,this.downloadManager=e.downloadManager||null,this.findController=e.findController||null,this.findController&&(this.findController.onIsPageVisible=e=>this._getVisiblePages().ids.has(e)),this._scriptingManager=e.scriptingManager||null,this.#Ai=e.textLayerMode??r.TextLayerMode.ENABLE,this.#gi=e.annotationMode??i.AnnotationMode.ENABLE_FORMS,this.#hr=e.annotationEditorMode??i.AnnotationEditorType.NONE,this.imageResourcesPath=e.imageResourcesPath||"",this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1,this.removePageBorders=e.removePageBorders||!1,this.useOnlyCssZoom=e.useOnlyCssZoom||!1,this.isOffscreenCanvasSupported=e.isOffscreenCanvasSupported??!0,this.maxCanvasPixels=e.maxCanvasPixels,this.l10n=e.l10n||s.NullL10n,this.#Vi=e.enablePermissions||!1,this.pageColors=e.pageColors||null,this.defaultRenderingQueue=!e.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new o.PDFRenderingQueue,this.renderingQueue.setViewer(this)):this.renderingQueue=e.renderingQueue,this.scroll=(0,r.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=r.PresentationModeState.UNKNOWN,this._onBeforeDraw=this._onAfterDraw=null,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),this.#wr(),this.eventBus._on("thumbnailrendered",(({pageNumber:e,pdfPage:t})=>{const n=this._pages[e-1];this.#dr.has(n)||t?.cleanup()}))}get pagesCount(){return this._pages.length}getPageView(e){return this._pages[e]}getCachedPageViews(){return new Set(this.#dr)}get pageViewsReady(){return this._pagesCapability.settled&&this._pages.every((e=>e?.pdfPage))}get renderForms(){return this.#gi===i.AnnotationMode.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(e){if(!Number.isInteger(e))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(e,!0)||console.error(`currentPageNumber: "${e}" is not a valid page.`))}_setCurrentPageNumber(e,t=!1){if(this._currentPageNumber===e)return t&&this.#Er(),!0;if(!(0<e&&e<=this.pagesCount))return!1;const n=this._currentPageNumber;return this._currentPageNumber=e,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:e,pageLabel:this._pageLabels?.[e-1]??null,previous:n}),t&&this.#Er(),!0}get currentPageLabel(){return this._pageLabels?.[this._currentPageNumber-1]??null}set currentPageLabel(e){if(!this.pdfDocument)return;let t=0|e;if(this._pageLabels){const n=this._pageLabels.indexOf(e);n>=0&&(t=n+1)}this._setCurrentPageNumber(t,!0)||console.error(`currentPageLabel: "${e}" is not a valid page.`)}get currentScale(){return this._currentScale!==r.UNKNOWN_SCALE?this._currentScale:r.DEFAULT_SCALE}set currentScale(e){if(isNaN(e))throw new Error("Invalid numeric scale.");this.pdfDocument&&this.#Pr(e,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(e){this.pdfDocument&&this.#Pr(e,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!(0,r.isValidRotation)(e))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument)return;if((e%=360)<0&&(e+=360),this._pagesRotation===e)return;this._pagesRotation=e;const t=this._currentPageNumber;this.refresh(!0,{rotation:e}),this._currentScaleValue&&this.#Pr(this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:e,pageNumber:t}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}#mi(){const e=this;return{get annotationEditorUIManager(){return e.#ur},get annotationStorage(){return e.pdfDocument?.annotationStorage},get downloadManager(){return e.downloadManager},get enableScripting(){return!!e._scriptingManager},get fieldObjectsPromise(){return e.pdfDocument?.getFieldObjects()},get findController(){return e.findController},get hasJSActionsPromise(){return e.pdfDocument?.hasJSActions()},get linkService(){return e.linkService}}}#Cr(e){const t={annotationEditorMode:this.#hr,annotationMode:this.#gi,textLayerMode:this.#Ai};return e?(e.includes(i.PermissionFlag.COPY)||this.#Ai!==r.TextLayerMode.ENABLE||(t.textLayerMode=r.TextLayerMode.ENABLE_PERMISSIONS),e.includes(i.PermissionFlag.MODIFY_CONTENTS)||(t.annotationEditorMode=i.AnnotationEditorType.DISABLE),e.includes(i.PermissionFlag.MODIFY_ANNOTATIONS)||e.includes(i.PermissionFlag.FILL_INTERACTIVE_FORMS)||this.#gi!==i.AnnotationMode.ENABLE_FORMS||(t.annotationMode=i.AnnotationMode.ENABLE),t):t}#kr(){if("hidden"===document.visibilityState||!this.container.offsetParent||0===this._getVisiblePages().views.length)return Promise.resolve();const e=new Promise((e=>{this.#xr=()=>{"hidden"===document.visibilityState&&(e(),document.removeEventListener("visibilitychange",this.#xr),this.#xr=null)},document.addEventListener("visibilitychange",this.#xr)}));return Promise.race([this._onePageRenderedCapability.promise,e])}async getAllText(){const e=[],t=[];for(let n=1,i=this.pdfDocument.numPages;n<=i;++n){if(this.#_r)return null;t.length=0;const i=await this.pdfDocument.getPage(n),{items:s}=await i.getTextContent();for(const e of s)e.str&&t.push(e.str),e.hasEOL&&t.push("\n");e.push((0,r.removeNullCharacters)(t.join("")))}return e.join("\n")}#Tr(e,t){const n=document.getSelection(),{focusNode:i,anchorNode:s}=n;if(s&&i&&n.containsNode(this.#mr)){if(this.#gr||e===r.TextLayerMode.ENABLE_PERMISSIONS)return t.preventDefault(),void t.stopPropagation();this.#gr=!0;const n=this.container.style.cursor;this.container.style.cursor="wait";const i=e=>this.#_r="Escape"===e.key;window.addEventListener("keydown",i),this.getAllText().then((async e=>{null!==e&&await navigator.clipboard.writeText(e)})).catch((e=>{console.warn(`Something goes wrong when extracting the text: ${e.message}`)})).finally((()=>{this.#gr=!1,this.#_r=!1,window.removeEventListener("keydown",i),this.container.style.cursor=n})),t.preventDefault(),t.stopPropagation()}}setDocument(e){if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),this.findController?.setDocument(null),this._scriptingManager?.setDocument(null),this.#ur&&(this.#ur.destroy(),this.#ur=null)),this.pdfDocument=e,!e)return;const t=e.numPages,n=e.getPage(1),s=e.getOptionalContentConfig(),o=this.#Vi?e.getPermissions():Promise.resolve();if(t>c.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const e=this._scrollMode=r.ScrollMode.PAGE;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e})}this._pagesCapability.promise.then((()=>{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:t})}),(()=>{})),this._onBeforeDraw=e=>{const t=this._pages[e.pageNumber-1];t&&this.#dr.push(t)},this.eventBus._on("pagerender",this._onBeforeDraw),this._onAfterDraw=e=>{e.cssTransform||this._onePageRenderedCapability.settled||(this._onePageRenderedCapability.resolve({timestamp:e.timestamp}),this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null,this.#xr&&(document.removeEventListener("visibilitychange",this.#xr),this.#xr=null))},this.eventBus._on("pagerendered",this._onAfterDraw),Promise.all([n,o]).then((([n,o])=>{if(e!==this.pdfDocument)return;this._firstPageCapability.resolve(n),this._optionalContentConfigPromise=s;const{annotationEditorMode:l,annotationMode:h,textLayerMode:u}=this.#Cr(o);if(u!==r.TextLayerMode.DISABLE){const e=this.#mr=document.createElement("div");e.id="hiddenCopyElement",this.viewer.before(e)}if(l!==i.AnnotationEditorType.DISABLE){const t=l;e.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):d(t)?(this.#ur=new i.AnnotationEditorUIManager(this.container,this.eventBus,e?.annotationStorage),t!==i.AnnotationEditorType.NONE&&this.#ur.updateMode(t)):console.error(`Invalid AnnotationEditor mode: ${t}`)}const p=this.#mi.bind(this),f=this._scrollMode===r.ScrollMode.PAGE?null:this.viewer,g=this.currentScale,m=n.getViewport({scale:g*i.PixelsPerInch.PDF_TO_CSS_UNITS});this.viewer.style.setProperty("--scale-factor",m.scale),"CanvasText"!==this.pageColors?.foreground&&"Canvas"!==this.pageColors?.background||this.viewer.style.setProperty("--hcm-highligh-filter",e.filterFactory.addHighlightHCMFilter("CanvasText","Canvas","HighlightText","Highlight"));for(let e=1;e<=t;++e){const t=new a.PDFPageView({container:f,eventBus:this.eventBus,id:e,scale:g,defaultViewport:m.clone(),optionalContentConfigPromise:s,renderingQueue:this.renderingQueue,textLayerMode:u,annotationMode:h,imageResourcesPath:this.imageResourcesPath,useOnlyCssZoom:this.useOnlyCssZoom,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,maxCanvasPixels:this.maxCanvasPixels,pageColors:this.pageColors,l10n:this.l10n,layerProperties:p});this._pages.push(t)}const _=this._pages[0];_&&(_.setPdfPage(n),this.linkService.cachePageRef(1,n.ref)),this._scrollMode===r.ScrollMode.PAGE?this.#Mr():this._spreadMode!==r.SpreadMode.NONE&&this._updateSpreadMode(),this.#kr().then((async()=>{if(this.findController?.setDocument(e),this._scriptingManager?.setDocument(e),this.#mr&&(this.#fr=this.#Tr.bind(this,u),document.addEventListener("copy",this.#fr)),this.#ur&&this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:this.#hr}),e.loadingParams.disableAutoFetch||t>c.FORCE_LAZY_PAGE_INIT)return void this._pagesCapability.resolve();let n=t-1;if(n<=0)this._pagesCapability.resolve();else for(let i=2;i<=t;++i){const t=e.getPage(i).then((e=>{const t=this._pages[i-1];t.pdfPage||t.setPdfPage(e),this.linkService.cachePageRef(i,e.ref),0==--n&&this._pagesCapability.resolve()}),(e=>{console.error(`Unable to get page ${i} to initialize viewer`,e),0==--n&&this._pagesCapability.resolve()}));i%c.PAUSE_EAGER_PAGE_INIT==0&&await t}})),this.eventBus.dispatch("pagesinit",{source:this}),e.getMetadata().then((({info:t})=>{e===this.pdfDocument&&t.Language&&(this.viewer.lang=t.Language)})),this.defaultRenderingQueue&&this.update()})).catch((e=>{console.error("Unable to initialize viewer",e),this._pagesCapability.reject(e)}))}setPageLabels(e){if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let e=0,t=this._pages.length;e<t;e++)this._pages[e].setPageLabel(this._pageLabels?.[e]??null)}}_resetView(){this._pages=[],this._currentPageNumber=1,this._currentScale=r.UNKNOWN_SCALE,this._currentScaleValue=null,this._pageLabels=null,this.#dr=new h(10),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=new i.PromiseCapability,this._onePageRenderedCapability=new i.PromiseCapability,this._pagesCapability=new i.PromiseCapability,this._scrollMode=r.ScrollMode.VERTICAL,this._previousScrollMode=r.ScrollMode.UNKNOWN,this._spreadMode=r.SpreadMode.NONE,this.#Ar={previousPageNumber:1,scrollDown:!0,pages:[]},this._onBeforeDraw&&(this.eventBus._off("pagerender",this._onBeforeDraw),this._onBeforeDraw=null),this._onAfterDraw&&(this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null),this.#xr&&(document.removeEventListener("visibilitychange",this.#xr),this.#xr=null),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),this.#mr&&(document.removeEventListener("copy",this.#fr),this.#fr=null,this.#mr.remove(),this.#mr=null)}#Mr(){if(this._scrollMode!==r.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const e=this._currentPageNumber,t=this.#Ar,n=this.viewer;if(n.textContent="",t.pages.length=0,this._spreadMode!==r.SpreadMode.NONE||this.isInPresentationMode){const i=new Set,r=this._spreadMode-1;-1===r?i.add(e-1):e%2!==r?(i.add(e-1),i.add(e)):(i.add(e-2),i.add(e-1));const s=document.createElement("div");if(s.className="spread",this.isInPresentationMode){const e=document.createElement("div");e.className="dummyPage",s.append(e)}for(const e of i){const n=this._pages[e];n&&(s.append(n.div),t.pages.push(n))}n.append(s)}else{const i=this._pages[e-1];n.append(i.div),t.pages.push(i)}t.scrollDown=e>=t.previousPageNumber,t.previousPageNumber=e}_scrollUpdate(){0!==this.pagesCount&&this.update()}#Lr(e,t=null){const{div:n,id:i}=e;if(this._currentPageNumber!==i&&this._setCurrentPageNumber(i),this._scrollMode===r.ScrollMode.PAGE&&(this.#Mr(),this.update()),!t&&!this.isInPresentationMode){const e=n.offsetLeft+n.clientLeft,i=e+n.clientWidth,{scrollLeft:s,clientWidth:a}=this.container;(this._scrollMode===r.ScrollMode.HORIZONTAL||e<s||i>s+a)&&(t={left:0,top:0})}(0,r.scrollIntoView)(n,t),!this._currentScaleValue&&this._location&&(this._location=null)}#Rr(e){return e===this._currentScale||Math.abs(e-this._currentScale)<1e-15}#Ir(e,t,{noScroll:n=!1,preset:r=!1,drawingDelay:s=-1}){if(this._currentScaleValue=t.toString(),this.#Rr(e))return void(r&&this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:t}));this.viewer.style.setProperty("--scale-factor",e*i.PixelsPerInch.PDF_TO_CSS_UNITS);const a=s>=0&&s<1e3;if(this.refresh(!0,{scale:e,drawingDelay:a?s:-1}),a&&(this.#Sr=setTimeout((()=>{this.#Sr=null,this.refresh()}),s)),this._currentScale=e,!n){let e,t=this._currentPageNumber;!this._location||this.isInPresentationMode||this.isChangingPresentationMode||(t=this._location.pageNumber,e=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:t,destArray:e,allowNegativeOffset:!0})}this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:r?t:void 0}),this.defaultRenderingQueue&&this.update()}get#Fr(){return this._spreadMode!==r.SpreadMode.NONE&&this._scrollMode!==r.ScrollMode.HORIZONTAL?2:1}#Pr(e,t){let n=parseFloat(e);if(n>0)t.preset=!1,this.#Ir(n,e,t);else{const i=this._pages[this._currentPageNumber-1];if(!i)return;let s=r.SCROLLBAR_PADDING,a=r.VERTICAL_PADDING;this.isInPresentationMode?(s=a=4,this._spreadMode!==r.SpreadMode.NONE&&(s*=2)):this.removePageBorders?s=a=0:this._scrollMode===r.ScrollMode.HORIZONTAL&&([s,a]=[a,s]);const o=(this.container.clientWidth-s)/i.width*i.scale/this.#Fr,l=(this.container.clientHeight-a)/i.height*i.scale;switch(e){case"page-actual":n=1;break;case"page-width":n=o;break;case"page-height":n=l;break;case"page-fit":n=Math.min(o,l);break;case"auto":const t=(0,r.isPortraitOrientation)(i)?o:Math.min(l,o);n=Math.min(r.MAX_AUTO_SCALE,t);break;default:return void console.error(`#setScale: "${e}" is an unknown zoom value.`)}t.preset=!0,this.#Ir(n,e,t)}}#Er(){const e=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&this.#Pr(this._currentScaleValue,{noScroll:!0}),this.#Lr(e)}pageLabelToPageNumber(e){if(!this._pageLabels)return null;const t=this._pageLabels.indexOf(e);return t<0?null:t+1}scrollPageIntoView({pageNumber:e,destArray:t=null,allowNegativeOffset:n=!1,ignoreDestinationZoom:s=!1}){if(!this.pdfDocument)return;const a=Number.isInteger(e)&&this._pages[e-1];if(!a)return void console.error(`scrollPageIntoView: "${e}" is not a valid pageNumber parameter.`);if(this.isInPresentationMode||!t)return void this._setCurrentPageNumber(e,!0);let o,l,c=0,d=0,h=0,u=0;const p=a.rotation%180!=0,f=(p?a.height:a.width)/a.scale/i.PixelsPerInch.PDF_TO_CSS_UNITS,g=(p?a.width:a.height)/a.scale/i.PixelsPerInch.PDF_TO_CSS_UNITS;let m=0;switch(t[1].name){case"XYZ":c=t[2],d=t[3],m=t[4],c=null!==c?c:0,d=null!==d?d:g;break;case"Fit":case"FitB":m="page-fit";break;case"FitH":case"FitBH":d=t[2],m="page-width",null===d&&this._location?(c=this._location.left,d=this._location.top):("number"!=typeof d||d<0)&&(d=g);break;case"FitV":case"FitBV":c=t[2],h=f,u=g,m="page-height";break;case"FitR":c=t[2],d=t[3],h=t[4]-c,u=t[5]-d;let e=r.SCROLLBAR_PADDING,n=r.VERTICAL_PADDING;this.removePageBorders&&(e=n=0),o=(this.container.clientWidth-e)/h/i.PixelsPerInch.PDF_TO_CSS_UNITS,l=(this.container.clientHeight-n)/u/i.PixelsPerInch.PDF_TO_CSS_UNITS,m=Math.min(Math.abs(o),Math.abs(l));break;default:return void console.error(`scrollPageIntoView: "${t[1].name}" is not a valid destination type.`)}if(s||(m&&m!==this._currentScale?this.currentScaleValue=m:this._currentScale===r.UNKNOWN_SCALE&&(this.currentScaleValue=r.DEFAULT_SCALE_VALUE)),"page-fit"===m&&!t[4])return void this.#Lr(a);const _=[a.viewport.convertToViewportPoint(c,d),a.viewport.convertToViewportPoint(c+h,d+u)];let b=Math.min(_[0][0],_[1][0]),v=Math.min(_[0][1],_[1][1]);n||(b=Math.max(b,0),v=Math.max(v,0)),this.#Lr(a,{left:b,top:v})}_updateLocation(e){const t=this._currentScale,n=this._currentScaleValue,i=parseFloat(n)===t?Math.round(1e4*t)/100:n,r=e.id,s=this._pages[r-1],a=this.container,o=s.getPagePoint(a.scrollLeft-e.x,a.scrollTop-e.y),l=Math.round(o[0]),c=Math.round(o[1]);let d=`#page=${r}`;this.isInPresentationMode||(d+=`&zoom=${i},${l},${c}`),this._location={pageNumber:r,scale:i,top:c,left:l,rotation:this._pagesRotation,pdfOpenParams:d}}update(){const e=this._getVisiblePages(),t=e.views,n=t.length;if(0===n)return;const i=Math.max(10,2*n+1);this.#dr.resize(i,e.ids),this.renderingQueue.renderHighestPriority(e);const s=this._spreadMode===r.SpreadMode.NONE&&(this._scrollMode===r.ScrollMode.PAGE||this._scrollMode===r.ScrollMode.VERTICAL),a=this._currentPageNumber;let o=!1;for(const e of t){if(e.percent<100)break;if(e.id===a&&s){o=!0;break}}this._setCurrentPageNumber(o?a:t[0].id),this._updateLocation(e.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(e){return this.container.contains(e)}focus(){this.container.focus()}get _isContainerRtl(){return"rtl"===getComputedStyle(this.container).direction}get isInPresentationMode(){return this.presentationModeState===r.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===r.PresentationModeState.CHANGING}get isHorizontalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const e=this._scrollMode===r.ScrollMode.PAGE?this.#Ar.pages:this._pages,t=this._scrollMode===r.ScrollMode.HORIZONTAL,n=t&&this._isContainerRtl;return(0,r.getVisibleElements)({scrollEl:this.container,views:e,sortByVisibility:!0,horizontal:t,rtl:n})}cleanup(){for(const e of this._pages)e.renderingState!==r.RenderingStates.FINISHED&&e.reset()}_cancelRendering(){for(const e of this._pages)e.cancelRendering()}async#Dr(e){if(e.pdfPage)return e.pdfPage;try{const t=await this.pdfDocument.getPage(e.id);return e.pdfPage||e.setPdfPage(t),this.linkService._cachedPageNumber?.(t.ref)||this.linkService.cachePageRef(e.id,t.ref),t}catch(e){return console.error("Unable to get page for page view",e),null}}#Or(e){if(1===e.first?.id)return!0;if(e.last?.id===this.pagesCount)return!1;switch(this._scrollMode){case r.ScrollMode.PAGE:return this.#Ar.scrollDown;case r.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down}forceRendering(e){const t=e||this._getVisiblePages(),n=this.#Or(t),i=this._spreadMode!==r.SpreadMode.NONE&&this._scrollMode!==r.ScrollMode.HORIZONTAL,s=this.renderingQueue.getHighestPriority(t,this._pages,n,i);return!!s&&(this.#Dr(s).then((()=>{this.renderingQueue.renderView(s)})),!0)}get hasEqualPageSizes(){const e=this._pages[0];for(let t=1,n=this._pages.length;t<n;++t){const n=this._pages[t];if(n.width!==e.width||n.height!==e.height)return!1}return!0}getPagesOverview(){let e;return this._pages.map((t=>{const n=t.pdfPage.getViewport({scale:1}),i=(0,r.isPortraitOrientation)(n);if(void 0===e)e=i;else if(this.enablePrintAutoRotate&&i!==e)return{width:n.height,height:n.width,rotation:(n.rotation-90)%360};return{width:n.width,height:n.height,rotation:n.rotation}}))}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig()):Promise.resolve(null)}set optionalContentConfigPromise(e){if(!(e instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${e}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=e,this.refresh(!1,{optionalContentConfigPromise:e}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:e}))}get scrollMode(){return this._scrollMode}set scrollMode(e){if(this._scrollMode!==e){if(!(0,r.isValidScrollMode)(e))throw new Error(`Invalid scroll mode: ${e}`);this.pagesCount>c.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=e,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(e=null){const t=this._scrollMode,n=this.viewer;n.classList.toggle("scrollHorizontal",t===r.ScrollMode.HORIZONTAL),n.classList.toggle("scrollWrapped",t===r.ScrollMode.WRAPPED),this.pdfDocument&&e&&(t===r.ScrollMode.PAGE?this.#Mr():this._previousScrollMode===r.ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&this.#Pr(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(e,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(e){if(this._spreadMode!==e){if(!(0,r.isValidSpreadMode)(e))throw new Error(`Invalid spread mode: ${e}`);this._spreadMode=e,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:e}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(e=null){if(!this.pdfDocument)return;const t=this.viewer,n=this._pages;if(this._scrollMode===r.ScrollMode.PAGE)this.#Mr();else if(t.textContent="",this._spreadMode===r.SpreadMode.NONE)for(const e of this._pages)t.append(e.div);else{const e=this._spreadMode-1;let i=null;for(let r=0,s=n.length;r<s;++r)null===i?(i=document.createElement("div"),i.className="spread",t.append(i)):r%2===e&&(i=i.cloneNode(!1),t.append(i)),i.append(n[r].div)}e&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&this.#Pr(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(e,!0),this.update())}_getPageAdvance(e,t=!1){switch(this._scrollMode){case r.ScrollMode.WRAPPED:{const{views:n}=this._getVisiblePages(),i=new Map;for(const{id:e,y:t,percent:r,widthPercent:s}of n){if(0===r||s<100)continue;let n=i.get(t);n||i.set(t,n||=[]),n.push(e)}for(const n of i.values()){const i=n.indexOf(e);if(-1===i)continue;const r=n.length;if(1===r)break;if(t)for(let t=i-1,r=0;t>=r;t--){const i=n[t],r=n[t+1]-1;if(i<r)return e-r}else for(let t=i+1,s=r;t<s;t++){const i=n[t],r=n[t-1]+1;if(i>r)return r-e}if(t){const t=n[0];if(t<e)return e-t+1}else{const t=n[r-1];if(t>e)return t-e+1}break}break}case r.ScrollMode.HORIZONTAL:break;case r.ScrollMode.PAGE:case r.ScrollMode.VERTICAL:{if(this._spreadMode===r.SpreadMode.NONE)break;const n=this._spreadMode-1;if(t&&e%2!==n)break;if(!t&&e%2===n)break;const{views:i}=this._getVisiblePages(),s=t?e-1:e+1;for(const{id:e,percent:t,widthPercent:n}of i)if(e===s){if(t>0&&100===n)return 2;break}break}}return 1}nextPage(){const e=this._currentPageNumber,t=this.pagesCount;if(e>=t)return!1;const n=this._getPageAdvance(e,!1)||1;return this.currentPageNumber=Math.min(e+n,t),!0}previousPage(){const e=this._currentPageNumber;if(e<=1)return!1;const t=this._getPageAdvance(e,!0)||1;return this.currentPageNumber=Math.max(e-t,1),!0}increaseScale({drawingDelay:e,scaleFactor:t,steps:n}={}){if(!this.pdfDocument)return;let i=this._currentScale;if(t>1)i=Math.round(i*t*100)/100;else{n??=1;do{i=Math.ceil(10*(i*r.DEFAULT_SCALE_DELTA).toFixed(2))/10}while(--n>0&&i<r.MAX_SCALE)}this.#Pr(Math.min(r.MAX_SCALE,i),{noScroll:!1,drawingDelay:e})}decreaseScale({drawingDelay:e,scaleFactor:t,steps:n}={}){if(!this.pdfDocument)return;let i=this._currentScale;if(t>0&&t<1)i=Math.round(i*t*100)/100;else{n??=1;do{i=Math.floor(10*(i/r.DEFAULT_SCALE_DELTA).toFixed(2))/10}while(--n>0&&i>r.MIN_SCALE)}this.#Pr(Math.max(r.MIN_SCALE,i),{noScroll:!1,drawingDelay:e})}#wr(e=this.container.clientHeight){e!==this.#br&&(this.#br=e,r.docStyle.setProperty("--viewer-container-height",`${e}px`))}#yr(e){for(const t of e)if(t.target===this.container){this.#wr(Math.floor(t.borderBoxSize[0].blockSize)),this.#pr=null;break}}get containerTopLeft(){return this.#pr||=[this.container.offsetTop,this.container.offsetLeft]}get annotationEditorMode(){return this.#ur?this.#hr:i.AnnotationEditorType.DISABLE}set annotationEditorMode(e){if(!this.#ur)throw new Error("The AnnotationEditor is not enabled.");if(this.#hr!==e){if(!d(e))throw new Error(`Invalid AnnotationEditor mode: ${e}`);this.pdfDocument&&(this.#hr=e,this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:e}),this.#ur.updateMode(e))}}set annotationEditorParams({type:e,value:t}){if(!this.#ur)throw new Error("The AnnotationEditor is not enabled.");this.#ur.updateParams(e,t)}refresh(e=!1,t=Object.create(null)){if(this.pdfDocument){for(const e of this._pages)e.update(t);null!==this.#Sr&&(clearTimeout(this.#Sr),this.#Sr=null),e||this.update()}}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFRenderingQueue=void 0;var i=n(4),r=n(2);t.PDFRenderingQueue=class{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(e){this.pdfViewer=e}setThumbnailViewer(e){this.pdfThumbnailViewer=e}isHighestPriority(e){return this.highestPriorityPage===e.renderingId}renderHighestPriority(e){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),this.pdfViewer.forceRendering(e)||this.isThumbnailViewEnabled&&this.pdfThumbnailViewer?.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),3e4))}getHighestPriority(e,t,n,i=!1){const r=e.views,s=r.length;if(0===s)return null;for(let e=0;e<s;e++){const t=r[e].view;if(!this.isViewFinished(t))return t}const a=e.first.id,o=e.last.id;if(o-a+1>s){const i=e.ids;for(let e=1,r=o-a;e<r;e++){const r=n?a+e:o-e;if(i.has(r))continue;const s=t[r-1];if(!this.isViewFinished(s))return s}}let l=n?o:a-2,c=t[l];return c&&!this.isViewFinished(c)||i&&(l+=n?1:-1,c=t[l],c&&!this.isViewFinished(c))?c:null}isViewFinished(e){return e.renderingState===r.RenderingStates.FINISHED}renderView(e){switch(e.renderingState){case r.RenderingStates.FINISHED:return!1;case r.RenderingStates.PAUSED:this.highestPriorityPage=e.renderingId,e.resume();break;case r.RenderingStates.RUNNING:this.highestPriorityPage=e.renderingId;break;case r.RenderingStates.INITIAL:this.highestPriorityPage=e.renderingId,e.draw().finally((()=>{this.renderHighestPriority()})).catch((e=>{e instanceof i.RenderingCancelledException||console.error(`renderView: "${e}"`)}))}return!0}}}],t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,i),s.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AnnotationLayerBuilder",{enumerable:!0,get:function(){return a.AnnotationLayerBuilder}}),Object.defineProperty(e,"DownloadManager",{enumerable:!0,get:function(){return o.DownloadManager}}),Object.defineProperty(e,"EventBus",{enumerable:!0,get:function(){return l.EventBus}}),Object.defineProperty(e,"FindState",{enumerable:!0,get:function(){return t.FindState}}),Object.defineProperty(e,"GenericL10n",{enumerable:!0,get:function(){return c.GenericL10n}}),Object.defineProperty(e,"LinkTarget",{enumerable:!0,get:function(){return n.LinkTarget}}),Object.defineProperty(e,"NullL10n",{enumerable:!0,get:function(){return d.NullL10n}}),Object.defineProperty(e,"PDFFindController",{enumerable:!0,get:function(){return t.PDFFindController}}),Object.defineProperty(e,"PDFHistory",{enumerable:!0,get:function(){return h.PDFHistory}}),Object.defineProperty(e,"PDFLinkService",{enumerable:!0,get:function(){return n.PDFLinkService}}),Object.defineProperty(e,"PDFPageView",{enumerable:!0,get:function(){return u.PDFPageView}}),Object.defineProperty(e,"PDFScriptingManager",{enumerable:!0,get:function(){return p.PDFScriptingManager}}),Object.defineProperty(e,"PDFSinglePageViewer",{enumerable:!0,get:function(){return f.PDFSinglePageViewer}}),Object.defineProperty(e,"PDFViewer",{enumerable:!0,get:function(){return g.PDFViewer}}),Object.defineProperty(e,"ProgressBar",{enumerable:!0,get:function(){return s.ProgressBar}}),Object.defineProperty(e,"RenderingStates",{enumerable:!0,get:function(){return s.RenderingStates}}),Object.defineProperty(e,"ScrollMode",{enumerable:!0,get:function(){return s.ScrollMode}}),Object.defineProperty(e,"SimpleLinkService",{enumerable:!0,get:function(){return n.SimpleLinkService}}),Object.defineProperty(e,"SpreadMode",{enumerable:!0,get:function(){return s.SpreadMode}}),Object.defineProperty(e,"StructTreeLayerBuilder",{enumerable:!0,get:function(){return m.StructTreeLayerBuilder}}),Object.defineProperty(e,"TextLayerBuilder",{enumerable:!0,get:function(){return _.TextLayerBuilder}}),Object.defineProperty(e,"XfaLayerBuilder",{enumerable:!0,get:function(){return b.XfaLayerBuilder}}),Object.defineProperty(e,"parseQueryString",{enumerable:!0,get:function(){return s.parseQueryString}});var t=i(1),n=i(5),s=i(2),a=i(6),o=i(8),l=i(9),c=i(10),d=i(7),h=i(12),u=i(13),p=i(21),f=i(23),g=i(24),m=i(16),_=i(19),b=i(20)})(),r})(),e.exports=i()},921:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,i=n?Symbol.for("react.element"):60103,r=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,o=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,d=n?Symbol.for("react.async_mode"):60111,h=n?Symbol.for("react.concurrent_mode"):60111,u=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,_=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,v=n?Symbol.for("react.responder"):60118,y=n?Symbol.for("react.scope"):60119;function A(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case d:case h:case s:case o:case a:case p:return e;default:switch(e=e&&e.$$typeof){case c:case u:case m:case g:case l:return e;default:return t}}case r:return t}}}function x(e){return A(e)===h}t.AsyncMode=d,t.ConcurrentMode=h,t.ContextConsumer=c,t.ContextProvider=l,t.Element=i,t.ForwardRef=u,t.Fragment=s,t.Lazy=m,t.Memo=g,t.Portal=r,t.Profiler=o,t.StrictMode=a,t.Suspense=p,t.isAsyncMode=function(e){return x(e)||A(e)===d},t.isConcurrentMode=x,t.isContextConsumer=function(e){return A(e)===c},t.isContextProvider=function(e){return A(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return A(e)===u},t.isFragment=function(e){return A(e)===s},t.isLazy=function(e){return A(e)===m},t.isMemo=function(e){return A(e)===g},t.isPortal=function(e){return A(e)===r},t.isProfiler=function(e){return A(e)===o},t.isStrictMode=function(e){return A(e)===a},t.isSuspense=function(e){return A(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===h||e===o||e===a||e===p||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===l||e.$$typeof===c||e.$$typeof===u||e.$$typeof===b||e.$$typeof===v||e.$$typeof===y||e.$$typeof===_)},t.typeOf=A},864:(e,t,n)=>{"use strict";e.exports=n(921)},379:e=>{"use strict";var t=[];function n(e){for(var n=-1,i=0;i<t.length;i++)if(t[i].identifier===e){n=i;break}return n}function i(e,i){for(var s={},a=[],o=0;o<e.length;o++){var l=e[o],c=i.base?l[0]+i.base:l[0],d=s[c]||0,h="".concat(c," ").concat(d);s[c]=d+1;var u=n(h),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(p);else{var f=r(p,i);i.byIndex=o,t.splice(o,0,{identifier:h,updater:f,references:1})}a.push(h)}return a}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var s=i(e=e||[],r=r||{});return function(e){e=e||[];for(var a=0;a<s.length;a++){var o=n(s[a]);t[o].references--}for(var l=i(e,r),c=0;c<s.length;c++){var d=n(s[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=l}}},569:e=>{"use strict";var t={};e.exports=function(e,n){var i=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},216:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,r&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},396:(e,t,n)=>{"use strict";e.exports=n.p+"ff2dfa442d903d9d5e30.gif"},414:()=>{},172:()=>{},1:()=>{},779:()=>{},558:()=>{},258:()=>{}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&!e;)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),__webpack_require__.b=document.baseURI||self.location.href,__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";var e={};__webpack_require__.r(e),__webpack_require__.d(e,{Children:()=>qe,Component:()=>F,Fragment:()=>I,PureComponent:()=>Be,StrictMode:()=>Mt,Suspense:()=>Ye,SuspenseList:()=>Ze,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>At,cloneElement:()=>Et,createContext:()=>ie,createElement:()=>M,createFactory:()=>St,createPortal:()=>it,createRef:()=>R,default:()=>Ot,findDOMNode:()=>Ct,flushSync:()=>Tt,forwardRef:()=>ze,hydrate:()=>ht,isValidElement:()=>wt,lazy:()=>Je,memo:()=>Ue,render:()=>dt,startTransition:()=>Lt,unmountComponentAtNode:()=>Pt,unstable_batchedUpdates:()=>kt,useCallback:()=>we,useContext:()=>Ee,useDebugValue:()=>Pe,useDeferredValue:()=>Rt,useEffect:()=>ve,useErrorBoundary:()=>Ce,useId:()=>ke,useImperativeHandle:()=>xe,useInsertionEffect:()=>Ft,useLayoutEffect:()=>ye,useMemo:()=>Se,useReducer:()=>be,useRef:()=>Ae,useState:()=>_e,useSyncExternalStore:()=>Dt,useTransition:()=>It,version:()=>xt});var t=__webpack_require__(299),n=__webpack_require__(379),i=__webpack_require__.n(n),r=__webpack_require__(795),s=__webpack_require__.n(r),a=__webpack_require__(569),o=__webpack_require__.n(a),l=__webpack_require__(565),c=__webpack_require__.n(l),d=__webpack_require__(216),h=__webpack_require__.n(d),u=__webpack_require__(589),p=__webpack_require__.n(u),f=__webpack_require__(282),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=o().bind(null,"head"),g.domAPI=s(),g.insertStyleElement=h(),i()(f.Z,g),f.Z&&f.Z.locals&&f.Z.locals;var m,_,b,v,y,A,x,S,w={},E=[],P=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,C=Array.isArray;function k(e,t){for(var n in t)e[n]=t[n];return e}function T(e){var t=e.parentNode;t&&t.removeChild(e)}function M(e,t,n){var i,r,s,a={};for(s in t)"key"==s?i=t[s]:"ref"==s?r=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?m.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return L(e,a,i,r,null)}function L(e,t,n,i,r){var s={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++b:r};return null==r&&null!=_.vnode&&_.vnode(s),s}function R(){return{current:null}}function I(e){return e.children}function F(e,t){this.props=e,this.context=t}function D(e,t){if(null==t)return e.__?D(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?D(e):null}function O(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return O(e)}}function N(e){(!e.__d&&(e.__d=!0)&&v.push(e)&&!j.__r++||y!==_.debounceRendering)&&((y=_.debounceRendering)||A)(j)}function j(){var e,t,n,i,r,s,a,o,l;for(v.sort(x);e=v.shift();)e.__d&&(t=v.length,i=void 0,r=void 0,s=void 0,o=(a=(n=e).__v).__e,(l=n.__P)&&(i=[],r=[],(s=k({},a)).__v=a.__v+1,X(l,a,s,n.__n,void 0!==l.ownerSVGElement,null!=a.__h?[o]:null,i,null==o?D(a):o,a.__h,r),K(i,a,r),a.__e!=o&&O(a)),v.length>t&&v.sort(x));j.__r=0}function B(e,t,n,i,r,s,a,o,l,c,d){var h,u,p,f,g,m,_,b,v,y,A=0,x=i&&i.__k||E,S=x.length,P=S,k=t.length;for(n.__k=[],h=0;h<k;h++)null!=(f=n.__k[h]=null==(f=t[h])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?L(null,f,null,null,f):C(f)?L(I,{children:f},null,null,null):f.__b>0?L(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)&&(f.__=n,f.__b=n.__b+1,-1===(b=z(f,x,_=h+A,P))?p=w:(p=x[b]||w,x[b]=void 0,P--),X(e,f,p,r,s,a,o,l,c,d),g=f.__e,(u=f.ref)&&p.ref!=u&&(p.ref&&Q(p.ref,null,f),d.push(u,f.__c||g,f)),null!=g&&(null==m&&(m=g),y=!(v=p===w||null===p.__v)&&b===_,v?-1==b&&A--:b!==_&&(b===_+1?(A++,y=!0):b>_?P>k-_?(A+=b-_,y=!0):A--:A=b<_&&b==_-1?b-_:0),_=h+A,y=y||b==h&&!v,"function"!=typeof f.type||b===_&&p.__k!==f.__k?"function"==typeof f.type||y?void 0!==f.__d?(l=f.__d,f.__d=void 0):l=g.nextSibling:l=H(e,g,l):l=U(f,l,e),"function"==typeof n.type&&(n.__d=l)));for(n.__e=m,h=S;h--;)null!=x[h]&&("function"==typeof n.type&&null!=x[h].__e&&x[h].__e==n.__d&&(n.__d=x[h].__e.nextSibling),J(x[h],x[h]))}function U(e,t,n){for(var i,r=e.__k,s=0;r&&s<r.length;s++)(i=r[s])&&(i.__=e,t="function"==typeof i.type?U(i,t,n):H(n,i.__e,t));return t}function V(e,t){return t=t||[],null==e||"boolean"==typeof e||(C(e)?e.some((function(e){V(e,t)})):t.push(e)),t}function H(e,t,n){return null==n||n.parentNode!==e?e.insertBefore(t,null):t==n&&null!=t.parentNode||e.insertBefore(t,n),t.nextSibling}function z(e,t,n,i){var r=e.key,s=e.type,a=n-1,o=n+1,l=t[n];if(null===l||l&&r==l.key&&s===l.type)return n;if(i>(null!=l?1:0))for(;a>=0||o<t.length;){if(a>=0){if((l=t[a])&&r==l.key&&s===l.type)return a;a--}if(o<t.length){if((l=t[o])&&r==l.key&&s===l.type)return o;o++}}return-1}function W(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||P.test(t)?n:n+"px"}function q(e,t,n,i,r){var s;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||W(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||W(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])s=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?i||e.addEventListener(t,s?G:$,s):e.removeEventListener(t,s?G:$,s);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function $(e){return this.l[e.type+!1](_.event?_.event(e):e)}function G(e){return this.l[e.type+!0](_.event?_.event(e):e)}function X(e,t,n,i,r,s,a,o,l,c){var d,h,u,p,f,g,m,b,v,y,A,x,S,w,E,P=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,o=t.__e=n.__e,t.__h=null,s=[o]),(d=_.__b)&&d(t);try{e:if("function"==typeof P){if(b=t.props,v=(d=P.contextType)&&i[d.__c],y=d?v?v.props.value:d.__:i,n.__c?m=(h=t.__c=n.__c).__=h.__E:("prototype"in P&&P.prototype.render?t.__c=h=new P(b,y):(t.__c=h=new F(b,y),h.constructor=P,h.render=Z),v&&v.sub(h),h.props=b,h.state||(h.state={}),h.context=y,h.__n=i,u=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=k({},h.__s)),k(h.__s,P.getDerivedStateFromProps(b,h.__s))),p=h.props,f=h.state,h.__v=t,u)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==P.getDerivedStateFromProps&&b!==p&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,y),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),A=0;A<h._sb.length;A++)h.__h.push(h._sb[A]);h._sb=[],h.__h.length&&a.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,y),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(p,f,g)}))}if(h.context=y,h.props=b,h.__P=e,h.__e=!1,x=_.__r,S=0,"prototype"in P&&P.prototype.render){for(h.state=h.__s,h.__d=!1,x&&x(t),d=h.render(h.props,h.state,h.context),w=0;w<h._sb.length;w++)h.__h.push(h._sb[w]);h._sb=[]}else do{h.__d=!1,x&&x(t),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++S<25);h.state=h.__s,null!=h.getChildContext&&(i=k(k({},i),h.getChildContext())),u||null==h.getSnapshotBeforeUpdate||(g=h.getSnapshotBeforeUpdate(p,f)),B(e,C(E=null!=d&&d.type===I&&null==d.key?d.props.children:d)?E:[E],t,n,i,r,s,a,o,l,c),h.base=t.__e,t.__h=null,h.__h.length&&a.push(h),m&&(h.__E=h.__=null)}else null==s&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Y(n.__e,t,n,i,r,s,a,l,c);(d=_.diffed)&&d(t)}catch(e){t.__v=null,(l||null!=s)&&(t.__e=o,t.__h=!!l,s[s.indexOf(o)]=null),_.__e(e,t,n)}}function K(e,t,n){for(var i=0;i<n.length;i++)Q(n[i],n[++i],n[++i]);_.__c&&_.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){_.__e(e,t.__v)}}))}function Y(e,t,n,i,r,s,a,o,l){var c,d,h,u=n.props,p=t.props,f=t.type,g=0;if("svg"===f&&(r=!0),null!=s)for(;g<s.length;g++)if((c=s[g])&&"setAttribute"in c==!!f&&(f?c.localName===f:3===c.nodeType)){e=c,s[g]=null;break}if(null==e){if(null===f)return document.createTextNode(p);e=r?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,p.is&&p),s=null,o=!1}if(null===f)u===p||o&&e.data===p||(e.data=p);else{if(s=s&&m.call(e.childNodes),d=(u=n.props||w).dangerouslySetInnerHTML,h=p.dangerouslySetInnerHTML,!o){if(null!=s)for(u={},g=0;g<e.attributes.length;g++)u[e.attributes[g].name]=e.attributes[g].value;(h||d)&&(h&&(d&&h.__html==d.__html||h.__html===e.innerHTML)||(e.innerHTML=h&&h.__html||""))}if(function(e,t,n,i,r){var s;for(s in n)"children"===s||"key"===s||s in t||q(e,s,null,n[s],i);for(s in t)r&&"function"!=typeof t[s]||"children"===s||"key"===s||"value"===s||"checked"===s||n[s]===t[s]||q(e,s,t[s],n[s],i)}(e,p,u,r,o),h)t.__k=[];else if(B(e,C(g=t.props.children)?g:[g],t,n,i,r&&"foreignObject"!==f,s,a,s?s[0]:n.__k&&D(n,0),o,l),null!=s)for(g=s.length;g--;)null!=s[g]&&T(s[g]);o||("value"in p&&void 0!==(g=p.value)&&(g!==e.value||"progress"===f&&!g||"option"===f&&g!==u.value)&&q(e,"value",g,u.value,!1),"checked"in p&&void 0!==(g=p.checked)&&g!==e.checked&&q(e,"checked",g,u.checked,!1))}return e}function Q(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){_.__e(e,n)}}function J(e,t,n){var i,r;if(_.unmount&&_.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Q(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){_.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&J(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||T(e.__e),e.__=e.__e=e.__d=void 0}function Z(e,t,n){return this.constructor(e,n)}function ee(e,t,n){var i,r,s,a;_.__&&_.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],a=[],X(t,e=(!i&&n||t).__k=M(I,null,[e]),r||w,w,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?m.call(t.childNodes):null,s,!i&&n?n:r?r.__e:t.firstChild,i,a),K(s,e,a)}function te(e,t){ee(e,t,te)}function ne(e,t,n){var i,r,s,a,o=k({},e.props);for(s in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?r=t[s]:o[s]=void 0===t[s]&&void 0!==a?a[s]:t[s];return arguments.length>2&&(o.children=arguments.length>3?m.call(arguments,2):n),L(e.type,o,i||e.key,r||e.ref,null)}function ie(e,t){var n={__c:t="__cC"+S++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,N(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}m=E.slice,_={__e:function(e,t,n,i){for(var r,s,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((s=r.constructor)&&null!=s.getDerivedStateFromError&&(r.setState(s.getDerivedStateFromError(e)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(t){e=t}throw e}},b=0,F.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=k({},this.state),"function"==typeof e&&(e=e(k({},n),this.props)),e&&k(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),N(this))},F.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),N(this))},F.prototype.render=I,v=[],A="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,x=function(e,t){return e.__v.__b-t.__v.__b},j.__r=0,S=0;var re,se,ae,oe,le=0,ce=[],de=[],he=_.__b,ue=_.__r,pe=_.diffed,fe=_.__c,ge=_.unmount;function me(e,t){_.__h&&_.__h(se,e,le||t),le=0;var n=se.__H||(se.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:de}),n.__[e]}function _e(e){return le=1,be(De,e)}function be(e,t,n){var i=me(re++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):De(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=se,!se.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!s||s.call(this,e,t,n);var a=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&i.__c.props===e)&&(!s||s.call(this,e,t,n))};se.u=!0;var s=se.shouldComponentUpdate,a=se.componentWillUpdate;se.componentWillUpdate=function(e,t,n){if(this.__e){var i=s;s=void 0,r(e,t,n),s=i}a&&a.call(this,e,t,n)},se.shouldComponentUpdate=r}return i.__N||i.__}function ve(e,t){var n=me(re++,3);!_.__s&&Fe(n.__H,t)&&(n.__=e,n.i=t,se.__H.__h.push(n))}function ye(e,t){var n=me(re++,4);!_.__s&&Fe(n.__H,t)&&(n.__=e,n.i=t,se.__h.push(n))}function Ae(e){return le=5,Se((function(){return{current:e}}),[])}function xe(e,t,n){le=6,ye((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function Se(e,t){var n=me(re++,7);return Fe(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function we(e,t){return le=8,Se((function(){return e}),t)}function Ee(e){var t=se.context[e.__c],n=me(re++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(se)),t.props.value):e.__}function Pe(e,t){_.useDebugValue&&_.useDebugValue(t?t(e):e)}function Ce(e){var t=me(re++,10),n=_e();return t.__=e,se.componentDidCatch||(se.componentDidCatch=function(e,i){t.__&&t.__(e,i),n[1](e)}),[n[0],function(){n[1](void 0)}]}function ke(){var e=me(re++,11);if(!e.__){for(var t=se.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Te(){for(var e;e=ce.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Re),e.__H.__h.forEach(Ie),e.__H.__h=[]}catch(t){e.__H.__h=[],_.__e(t,e.__v)}}_.__b=function(e){se=null,he&&he(e)},_.__r=function(e){ue&&ue(e),re=0;var t=(se=e.__c).__H;t&&(ae===se?(t.__h=[],se.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=de,e.__N=e.i=void 0}))):(t.__h.forEach(Re),t.__h.forEach(Ie),t.__h=[],re=0)),ae=se},_.diffed=function(e){pe&&pe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ce.push(t)&&oe===_.requestAnimationFrame||((oe=_.requestAnimationFrame)||Le)(Te)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==de&&(e.__=e.__V),e.i=void 0,e.__V=de}))),ae=se=null},_.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Re),e.__h=e.__h.filter((function(e){return!e.__||Ie(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],_.__e(n,e.__v)}})),fe&&fe(e,t)},_.unmount=function(e){ge&&ge(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Re(e)}catch(e){t=e}})),n.__H=void 0,t&&_.__e(t,n.__v))};var Me="function"==typeof requestAnimationFrame;function Le(e){var t,n=function(){clearTimeout(i),Me&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);Me&&(t=requestAnimationFrame(n))}function Re(e){var t=se,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),se=t}function Ie(e){var t=se;e.__c=e.__(),se=t}function Fe(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function De(e,t){return"function"==typeof t?t(e):t}function Oe(e,t){for(var n in t)e[n]=t[n];return e}function Ne(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var i in t)if("__source"!==i&&e[i]!==t[i])return!0;return!1}function je(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function Be(e){this.props=e}function Ue(e,t){function n(e){var n=this.props.ref,i=n==e.ref;return!i&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!i:Ne(this.props,e)}function i(t){return this.shouldComponentUpdate=n,M(e,t)}return i.displayName="Memo("+(e.displayName||e.name)+")",i.prototype.isReactComponent=!0,i.__f=!0,i}(Be.prototype=new F).isPureReactComponent=!0,Be.prototype.shouldComponentUpdate=function(e,t){return Ne(this.props,e)||Ne(this.state,t)};var Ve=_.__b;_.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ve&&Ve(e)};var He="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ze(e){function t(t){var n=Oe({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=He,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var We=function(e,t){return null==e?null:V(V(e).map(t))},qe={map:We,forEach:We,count:function(e){return e?V(e).length:0},only:function(e){var t=V(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:V},$e=_.__e;_.__e=function(e,t,n,i){if(e.then)for(var r,s=t;s=s.__;)if((r=s.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);$e(e,t,n,i)};var Ge=_.unmount;function Xe(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=Oe({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Xe(e,t,n)}))),e}function Ke(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return Ke(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function Ye(){this.__u=0,this.t=null,this.__b=null}function Qe(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Je(e){var t,n,i;function r(r){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){i=e})),i)throw i;if(!n)throw t;return M(n,r)}return r.displayName="Lazy",r.__f=!0,r}function Ze(){this.u=null,this.o=null}_.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),Ge&&Ge(e)},(Ye.prototype=new F).__c=function(e,t){var n=t.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var r=Qe(i.__v),s=!1,a=function(){s||(s=!0,n.__R=null,r?r(o):o())};n.__R=a;var o=function(){if(!--i.__u){if(i.state.__a){var e=i.state.__a;i.__v.__k[0]=Ke(e,e.__c.__P,e.__c.__O)}var t;for(i.setState({__a:i.__b=null});t=i.t.pop();)t.forceUpdate()}},l=!0===t.__h;i.__u++||l||i.setState({__a:i.__b=i.__v.__k[0]}),e.then(a,a)},Ye.prototype.componentWillUnmount=function(){this.t=[]},Ye.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=Xe(this.__b,n,i.__O=i.__P)}this.__b=null}var r=t.__a&&M(I,null,e.fallback);return r&&(r.__h=null),[M(I,null,t.__a?null:e.children),r]};var et=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function tt(e){return this.getChildContext=function(){return e.context},e.children}function nt(e){var t=this,n=e.i;t.componentWillUnmount=function(){ee(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),ee(M(tt,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function it(e,t){var n=M(nt,{__v:e,i:t});return n.containerInfo=t,n}(Ze.prototype=new F).__a=function(e){var t=this,n=Qe(t.__v),i=t.o.get(e);return i[0]++,function(r){var s=function(){t.props.revealOrder?(i.push(r),et(t,e,i)):r()};n?n(s):s()}},Ze.prototype.render=function(e){this.u=null,this.o=new Map;var t=V(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Ze.prototype.componentDidUpdate=Ze.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){et(e,n,t)}))};var rt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,st=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,at=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ot=/[A-Z0-9]/g,lt="undefined"!=typeof document,ct=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function dt(e,t,n){return null==t.__k&&(t.textContent=""),ee(e,t),"function"==typeof n&&n(),e?e.__c:null}function ht(e,t,n){return te(e,t),"function"==typeof n&&n(),e?e.__c:null}F.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(F.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var ut=_.event;function pt(){}function ft(){return this.cancelBubble}function gt(){return this.defaultPrevented}_.event=function(e){return ut&&(e=ut(e)),e.persist=pt,e.isPropagationStopped=ft,e.isDefaultPrevented=gt,e.nativeEvent=e};var mt,_t={enumerable:!1,configurable:!0,get:function(){return this.class}},bt=_.vnode;_.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,i={};for(var r in t){var s=t[r];if(!("value"===r&&"defaultValue"in t&&null==s||lt&&"children"===r&&"noscript"===n||"class"===r||"className"===r)){var a=r.toLowerCase();"defaultValue"===r&&"value"in t&&null==t.value?r="value":"download"===r&&!0===s?s="":"ondoubleclick"===a?r="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||ct(t.type)?"onfocus"===a?r="onfocusin":"onblur"===a?r="onfocusout":at.test(r)?r=a:-1===n.indexOf("-")&&st.test(r)?r=r.replace(ot,"-$&").toLowerCase():null===s&&(s=void 0):a=r="oninput","oninput"===a&&i[r=a]&&(r="oninputCapture"),i[r]=s}}"select"==n&&i.multiple&&Array.isArray(i.value)&&(i.value=V(t.children).forEach((function(e){e.props.selected=-1!=i.value.indexOf(e.props.value)}))),"select"==n&&null!=i.defaultValue&&(i.value=V(t.children).forEach((function(e){e.props.selected=i.multiple?-1!=i.defaultValue.indexOf(e.props.value):i.defaultValue==e.props.value}))),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",_t)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(e),e.$$typeof=rt,bt&&bt(e)};var vt=_.__r;_.__r=function(e){vt&&vt(e),mt=e.__c};var yt=_.diffed;_.diffed=function(e){yt&&yt(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),mt=null};var At={ReactCurrentDispatcher:{current:{readContext:function(e){return mt.__n[e.__c].props.value}}}},xt="17.0.2";function St(e){return M.bind(null,e)}function wt(e){return!!e&&e.$$typeof===rt}function Et(e){return wt(e)?ne.apply(null,arguments):e}function Pt(e){return!!e.__k&&(ee(null,e),!0)}function Ct(e){return e&&(e.base||1===e.nodeType&&e)||null}var kt=function(e,t){return e(t)},Tt=function(e,t){return e(t)},Mt=I;function Lt(e){e()}function Rt(e){return e}function It(){return[!1,Lt]}var Ft=ye;function Dt(e,t){var n=t(),i=_e({h:{__:n,v:t}}),r=i[0].h,s=i[1];return ye((function(){r.__=n,r.v=t,je(r.__,t())||s({h:r})}),[e,n,t]),ve((function(){return je(r.__,r.v())||s({h:r}),e((function(){je(r.__,r.v())||s({h:r})}))}),[e]),n}var Ot={useState:_e,useId:ke,useReducer:be,useEffect:ve,useLayoutEffect:ye,useInsertionEffect:Ft,useTransition:It,useDeferredValue:Rt,useSyncExternalStore:Dt,startTransition:Lt,useRef:Ae,useImperativeHandle:xe,useMemo:Se,useCallback:we,useContext:Ee,useDebugValue:Pe,version:"17.0.2",Children:qe,render:dt,hydrate:ht,unmountComponentAtNode:Pt,createPortal:it,createElement:M,createContext:ie,createFactory:St,cloneElement:Et,createRef:R,Fragment:I,isValidElement:wt,findDOMNode:Ct,Component:F,PureComponent:Be,memo:Ue,forwardRef:ze,flushSync:Tt,unstable_batchedUpdates:kt,StrictMode:Mt,Suspense:Ye,SuspenseList:Ze,lazy:Je,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:At},Nt=!!e.useInsertionEffect&&e.useInsertionEffect||function(e){return e()},jt={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Bt(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Ut=/[A-Z]|^ms/g,Vt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ht=function(e){return 45===e.charCodeAt(1)},zt=function(e){return null!=e&&"boolean"!=typeof e},Wt=Bt((function(e){return Ht(e)?e:e.replace(Ut,"-$&").toLowerCase()})),qt=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Vt,(function(e,t,n){return Gt={name:t,styles:n,next:Gt},t}))}return 1===jt[e]||Ht(e)||"number"!=typeof t||0===t?t:t+"px"};function $t(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return Gt={name:n.name,styles:n.styles,next:Gt},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)Gt={name:i.name,styles:i.styles,next:Gt},i=i.next;return n.styles+";"}return function(e,t,n){var i="";if(Array.isArray(n))for(var r=0;r<n.length;r++)i+=$t(e,t,n[r])+";";else for(var s in n){var a=n[s];if("object"!=typeof a)null!=t&&void 0!==t[a]?i+=s+"{"+t[a]+"}":zt(a)&&(i+=Wt(s)+":"+qt(s,a)+";");else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var o=$t(e,t,a);switch(s){case"animation":case"animationName":i+=Wt(s)+":"+o+";";break;default:i+=s+"{"+o+"}"}}else for(var l=0;l<a.length;l++)zt(a[l])&&(i+=Wt(s)+":"+qt(s,a[l])+";")}return i}(e,t,n);case"function":if(void 0!==e){var r=Gt,s=n(e);return Gt=r,$t(e,t,s)}}if(null==t)return n;var a=t[n];return void 0!==a?a:n}var Gt,Xt=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Kt=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var i=!0,r="";Gt=void 0;var s=e[0];null==s||void 0===s.raw?(i=!1,r+=$t(n,t,s)):r+=s[0];for(var a=1;a<e.length;a++)r+=$t(n,t,e[a]),i&&(r+=s[a]);Xt.lastIndex=0;for(var o,l="";null!==(o=Xt.exec(r));)l+="-"+o[1];var c=function(e){for(var t,n=0,i=0,r=e.length;r>=4;++i,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+l;return{name:c,styles:r,next:Gt}},Yt=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),Qt=Math.abs,Jt=String.fromCharCode,Zt=Object.assign;function en(e){return e.trim()}function tn(e,t,n){return e.replace(t,n)}function nn(e,t){return e.indexOf(t)}function rn(e,t){return 0|e.charCodeAt(t)}function sn(e,t,n){return e.slice(t,n)}function an(e){return e.length}function on(e){return e.length}function ln(e,t){return t.push(e),e}var cn=1,dn=1,hn=0,un=0,pn=0,fn="";function gn(e,t,n,i,r,s,a){return{value:e,root:t,parent:n,type:i,props:r,children:s,line:cn,column:dn,length:a,return:""}}function mn(e,t){return Zt(gn("",null,null,"",null,null,0),e,{length:-e.length},t)}function _n(){return pn=un>0?rn(fn,--un):0,dn--,10===pn&&(dn=1,cn--),pn}function bn(){return pn=un<hn?rn(fn,un++):0,dn++,10===pn&&(dn=1,cn++),pn}function vn(){return rn(fn,un)}function yn(){return un}function An(e,t){return sn(fn,e,t)}function xn(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Sn(e){return cn=dn=1,hn=an(fn=e),un=0,[]}function wn(e){return fn="",e}function En(e){return en(An(un-1,kn(91===e?e+2:40===e?e+1:e)))}function Pn(e){for(;(pn=vn())&&pn<33;)bn();return xn(e)>2||xn(pn)>3?"":" "}function Cn(e,t){for(;--t&&bn()&&!(pn<48||pn>102||pn>57&&pn<65||pn>70&&pn<97););return An(e,yn()+(t<6&&32==vn()&&32==bn()))}function kn(e){for(;bn();)switch(pn){case e:return un;case 34:case 39:34!==e&&39!==e&&kn(pn);break;case 40:41===e&&kn(e);break;case 92:bn()}return un}function Tn(e,t){for(;bn()&&e+pn!==57&&(e+pn!==84||47!==vn()););return"/*"+An(t,un-1)+"*"+Jt(47===e?e:bn())}function Mn(e){for(;!xn(vn());)bn();return An(e,un)}var Ln="-ms-",Rn="-moz-",In="-webkit-",Fn="comm",Dn="rule",On="decl",Nn="@keyframes";function jn(e,t){for(var n="",i=on(e),r=0;r<i;r++)n+=t(e[r],r,e,t)||"";return n}function Bn(e,t,n,i){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case On:return e.return=e.return||e.value;case Fn:return"";case Nn:return e.return=e.value+"{"+jn(e.children,i)+"}";case Dn:e.value=e.props.join(",")}return an(n=jn(e.children,i))?e.return=e.value+"{"+n+"}":""}function Un(e){return wn(Vn("",null,null,null,[""],e=Sn(e),0,[0],e))}function Vn(e,t,n,i,r,s,a,o,l){for(var c=0,d=0,h=a,u=0,p=0,f=0,g=1,m=1,_=1,b=0,v="",y=r,A=s,x=i,S=v;m;)switch(f=b,b=bn()){case 40:if(108!=f&&58==rn(S,h-1)){-1!=nn(S+=tn(En(b),"&","&\f"),"&\f")&&(_=-1);break}case 34:case 39:case 91:S+=En(b);break;case 9:case 10:case 13:case 32:S+=Pn(f);break;case 92:S+=Cn(yn()-1,7);continue;case 47:switch(vn()){case 42:case 47:ln(zn(Tn(bn(),yn()),t,n),l);break;default:S+="/"}break;case 123*g:o[c++]=an(S)*_;case 125*g:case 59:case 0:switch(b){case 0:case 125:m=0;case 59+d:-1==_&&(S=tn(S,/\f/g,"")),p>0&&an(S)-h&&ln(p>32?Wn(S+";",i,n,h-1):Wn(tn(S," ","")+";",i,n,h-2),l);break;case 59:S+=";";default:if(ln(x=Hn(S,t,n,c,d,r,o,v,y=[],A=[],h),s),123===b)if(0===d)Vn(S,t,x,x,y,s,h,o,A);else switch(99===u&&110===rn(S,3)?100:u){case 100:case 108:case 109:case 115:Vn(e,x,x,i&&ln(Hn(e,x,x,0,0,r,o,v,r,y=[],h),A),r,A,h,o,i?y:A);break;default:Vn(S,x,x,x,[""],A,0,o,A)}}c=d=p=0,g=_=1,v=S="",h=a;break;case 58:h=1+an(S),p=f;default:if(g<1)if(123==b)--g;else if(125==b&&0==g++&&125==_n())continue;switch(S+=Jt(b),b*g){case 38:_=d>0?1:(S+="\f",-1);break;case 44:o[c++]=(an(S)-1)*_,_=1;break;case 64:45===vn()&&(S+=En(bn())),u=vn(),d=h=an(v=S+=Mn(yn())),b++;break;case 45:45===f&&2==an(S)&&(g=0)}}return s}function Hn(e,t,n,i,r,s,a,o,l,c,d){for(var h=r-1,u=0===r?s:[""],p=on(u),f=0,g=0,m=0;f<i;++f)for(var _=0,b=sn(e,h+1,h=Qt(g=a[f])),v=e;_<p;++_)(v=en(g>0?u[_]+" "+b:tn(b,/&\f/g,u[_])))&&(l[m++]=v);return gn(e,t,n,0===r?Dn:o,l,c,d)}function zn(e,t,n){return gn(e,t,n,Fn,Jt(pn),sn(e,2,-2),0)}function Wn(e,t,n,i){return gn(e,t,n,On,sn(e,0,i),sn(e,i+1,-1),i)}var qn=function(e,t,n){for(var i=0,r=0;i=r,r=vn(),38===i&&12===r&&(t[n]=1),!xn(r);)bn();return An(e,un)},$n=new WeakMap,Gn=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,i=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||$n.get(n))&&!i){$n.set(e,!0);for(var r=[],s=function(e,t){return wn(function(e,t){var n=-1,i=44;do{switch(xn(i)){case 0:38===i&&12===vn()&&(t[n]=1),e[n]+=qn(un-1,t,n);break;case 2:e[n]+=En(i);break;case 4:if(44===i){e[++n]=58===vn()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Jt(i)}}while(i=bn());return e}(Sn(e),t))}(t,r),a=n.props,o=0,l=0;o<s.length;o++)for(var c=0;c<a.length;c++,l++)e.props[l]=r[o]?s[o].replace(/&\f/g,a[c]):a[c]+" "+s[o]}}},Xn=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Kn(e,t){switch(function(e,t){return 45^rn(e,0)?(((t<<2^rn(e,0))<<2^rn(e,1))<<2^rn(e,2))<<2^rn(e,3):0}(e,t)){case 5103:return In+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return In+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return In+e+Rn+e+Ln+e+e;case 6828:case 4268:return In+e+Ln+e+e;case 6165:return In+e+Ln+"flex-"+e+e;case 5187:return In+e+tn(e,/(\w+).+(:[^]+)/,In+"box-$1$2"+Ln+"flex-$1$2")+e;case 5443:return In+e+Ln+"flex-item-"+tn(e,/flex-|-self/,"")+e;case 4675:return In+e+Ln+"flex-line-pack"+tn(e,/align-content|flex-|-self/,"")+e;case 5548:return In+e+Ln+tn(e,"shrink","negative")+e;case 5292:return In+e+Ln+tn(e,"basis","preferred-size")+e;case 6060:return In+"box-"+tn(e,"-grow","")+In+e+Ln+tn(e,"grow","positive")+e;case 4554:return In+tn(e,/([^-])(transform)/g,"$1"+In+"$2")+e;case 6187:return tn(tn(tn(e,/(zoom-|grab)/,In+"$1"),/(image-set)/,In+"$1"),e,"")+e;case 5495:case 3959:return tn(e,/(image-set\([^]*)/,In+"$1$`$1");case 4968:return tn(tn(e,/(.+:)(flex-)?(.*)/,In+"box-pack:$3"+Ln+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+In+e+e;case 4095:case 3583:case 4068:case 2532:return tn(e,/(.+)-inline(.+)/,In+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(an(e)-1-t>6)switch(rn(e,t+1)){case 109:if(45!==rn(e,t+4))break;case 102:return tn(e,/(.+:)(.+)-([^]+)/,"$1"+In+"$2-$3$1"+Rn+(108==rn(e,t+3)?"$3":"$2-$3"))+e;case 115:return~nn(e,"stretch")?Kn(tn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==rn(e,t+1))break;case 6444:switch(rn(e,an(e)-3-(~nn(e,"!important")&&10))){case 107:return tn(e,":",":"+In)+e;case 101:return tn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+In+(45===rn(e,14)?"inline-":"")+"box$3$1"+In+"$2$3$1"+Ln+"$2box$3")+e}break;case 5936:switch(rn(e,t+11)){case 114:return In+e+Ln+tn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return In+e+Ln+tn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return In+e+Ln+tn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return In+e+Ln+e+e}return e}var Yn=[function(e,t,n,i){if(e.length>-1&&!e.return)switch(e.type){case On:e.return=Kn(e.value,e.length);break;case Nn:return jn([mn(e,{value:tn(e.value,"@","@"+In)})],i);case Dn:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return jn([mn(e,{props:[tn(t,/:(read-\w+)/,":-moz-$1")]})],i);case"::placeholder":return jn([mn(e,{props:[tn(t,/:(plac\w+)/,":"+In+"input-$1")]}),mn(e,{props:[tn(t,/:(plac\w+)/,":-moz-$1")]}),mn(e,{props:[tn(t,/:(plac\w+)/,Ln+"input-$1")]})],i)}return""}))}}],Qn=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i,r,s=e.stylisPlugins||Yn,a={},o=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;o.push(e)}));var l,c,d,h,u=[Bn,(h=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&h(e)})],p=(c=[Gn,Xn].concat(s,u),d=on(c),function(e,t,n,i){for(var r="",s=0;s<d;s++)r+=c[s](e,t,n,i)||"";return r});r=function(e,t,n,i){l=n,jn(Un(e?e+"{"+t.styles+"}":t.styles),p),i&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Yt({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:r};return f.sheet.hydrate(o),f};function Jn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Kt(t)}__webpack_require__(679),__webpack_require__.p;const Zn=__webpack_require__.p+"9c36754c195ca83d24a39e75ef3821c0.svg",ei=(__webpack_require__.p,__webpack_require__.p,__webpack_require__.p+"c6ac6e95ae6fe2f0391da8fa2e9c8554.svg"),ti=__webpack_require__.p+"e19e4765f223f61db42d28f92ddbcd4e.svg",ni=__webpack_require__.p+"1d66d40875fa58261ff4b850e8cba7cc.svg",ii=__webpack_require__.p+"79ee5b45e590be841daeba9d60e7db6e.svg",ri=__webpack_require__.p+"4c63cae958b5685dfd85cda1b06787fe.svg";var si=0;function ai(e,t,n,i,r,s){var a,o,l={};for(o in t)"ref"==o?a=t[o]:l[o]=t[o];var c={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--si,__source:r,__self:s};if("function"==typeof e&&(a=e.defaultProps))for(o in a)void 0===l[o]&&(l[o]=a[o]);return _.vnode&&_.vnode(c),c}var oi=function(e,t,n){var i=e.key+"-"+t.name;!1===n&&void 0===e.registered[i]&&(e.registered[i]=t.styles)},li={}.hasOwnProperty,ci=ie("undefined"!=typeof HTMLElement?Qn({key:"css"}):null);ci.Provider;var di,hi=function(e){return ze((function(t,n){var i=Ee(ci);return e(t,i,n)}))},ui=ie({}),pi="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",fi=function(e,t){var n={};for(var i in t)li.call(t,i)&&(n[i]=t[i]);return n[pi]=e,n},gi=function(e){var t=e.cache,n=e.serialized,i=e.isStringTag;return oi(t,n,i),Nt((function(){return function(e,t,n){oi(e,t,n);var i=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+i:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,i)})),null},mi=hi((function(e,t,n){var i=e.css;"string"==typeof i&&void 0!==t.registered[i]&&(i=t.registered[i]);var r=e[pi],s=[i],a="";"string"==typeof e.className?a=function(e,t,n){var i="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):i+=n+" "})),i}(t.registered,s,e.className):null!=e.className&&(a=e.className+" ");var o=Kt(s,void 0,Ee(ui));a+=t.key+"-"+o.name;var l={};for(var c in e)li.call(e,c)&&"css"!==c&&c!==pi&&(l[c]=e[c]);return l.ref=n,l.className=a,M(I,null,M(gi,{cache:t,serialized:o,isStringTag:"string"==typeof r}),M(r,l))})),_i=I;function bi(e,t,n){return li.call(t,"css")?ai(mi,fi(e,t),n):ai(e,t,n)}function vi(e,t,n){return li.call(t,"css")?ai(mi,fi(e,t),n):ai(e,t,n)}var yi,Ai,xi,Si,wi,Ei,Pi,Ci=Jn(di||(yi=["\n position: relative;\n display: inline-block;\n font-family: Lato;\n font-size: 14px;\n &:hover::after {\n content: attr(data-tooltip); // use data-tooltip instead of title\n position: absolute;\n z-index: 999999;\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n padding: 5px;\n color: #fff;\n background-color: #333;\n border-radius: 3px;\n white-space: nowrap;\n }\n"],Ai||(Ai=yi.slice(0)),di=Object.freeze(Object.defineProperties(yi,{raw:{value:Object.freeze(Ai)}})))),ki=function(e){var t=e.children,n=e.title;return bi("div",{css:Ci,"data-tooltip":n,children:t})};function Ti(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Mi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Li(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}void 0===xi&&(xi=0),Jn(Si||(Si=Li(["\n position: relative;\n display: inline-block;\n"])));var Ri=Jn(wi||(wi=Li(["\n display: none;\n position: absolute;\n background-color: #f9f9f9;\n min-width: 160px;\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n z-index: 1;\n"]))),Ii=Jn(Ei||(Ei=Li(["\n padding: 0;\n margin: 0;\n border: none;\n box-sizing: border-box;\n display: flex;\n font-family: Lato;\n"]))),Fi=Jn(Pi||(Pi=Li(["\n ",";\n display: block;\n"])),Ri);const Di=function(e){var t=e.title,n=e.child,i=e.marginTop,r=Ti(_e(!1),2),s=r[0],a=r[1],o=Ti(_e(!1),2),l=o[0],c=o[1],d=Ae(null);return ve(function(e,t,n,i){return function(){e||n.current&&(t(!0),["click","touchstart"].forEach((function(e){document.addEventListener("click",(function(e){n.current.contains(e.target)||i(!1)}))})))}}(l,c,d,a)),bi("div",{style:"z-index:9999",css:Ii,ref:d,children:vi("div",{css:Ii,onClick:function(){return a(!s)},children:[t,bi("div",{onClick:function(e){e.stopPropagation(),a(!1)},css:s?Fi:Ri,style:{marginTop:i||48},children:n})]})})};var Oi,Ni,ji,Bi,Ui,Vi,Hi,zi,Wi=function(e,t){var n;return function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];clearTimeout(n),n=setTimeout((function(){e.apply(null,r)}),t)}},qi=function(e){var t=e.src,n=e.alt,i=28;return"sm"===e.size&&(i=8),bi("img",{onClick:e.onClick,css:Jn({width:i,height:i,cursor:"pointer",display:"flex"}),src:t,alt:n})};function $i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Gi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Xi=Jn(Oi||(Oi=Gi(["\n font-size: 16px;\n height: 12px;\n border: none;\n font-weight: 600;\n color: #5b5b5b;\n background: transparent;\n width: 36px;\n text-align: right; // This line was added\n &:focus {\n outline: none;\n }\n"]))),Ki=Jn(Ni||(Ni=Gi(["\n display: flex;\n align-items: center;\n font-weight: 600;\n"]))),Yi=Jn(ji||(ji=Gi(["\n background: #f3f3f3;\n display: flex;\n align-items: center;\n padding: 2px 8px;\n border-radius: 4px;\n"]))),Qi=Jn(Bi||(Bi=Gi(["\n display: flex;\n align-items: center;\n cursor: pointer;\n margin-right: 20px;\n"]))),Ji=Jn(Ui||(Ui=Gi(["\n margin-right: 8px;\n color: #5b5b5b;\n"]))),Zi=Jn(Vi||(Vi=Gi(["\n margin-right: 12px;\n"]))),er=Jn(Hi||(Hi=Gi(["\n margin: 8px 0;\n"]))),tr=Jn(zi||(zi=Gi(["\n padding: 8px 16px;\n cursor: pointer;\n &:hover {\n background-color: #e7e7e7;\n }\n"]))),nr=function(e){return Math.floor(100*e)};const ir=function(e){e.appRef,e.pdfProxyObj;var t=e.pdfViewerObj,n=e.viewerContainerRef,i=(e.leftPanelEnabled,Ae("100")),r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return $i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(_e(100),2),s=r[0],a=r[1],o=Wi((function(){if(t&&t.currentScale<9.9){var e=Math.min(t.currentScale+.1,9999);t.currentScale=e,a(nr(e))}}),5),l=Wi((function(){if(t&&t.currentScale>.1){var e=Math.max(t.currentScale-.1,.1);t.currentScale=e,a(nr(e))}}),5),c=Wi((function(e){var n,i=e.target.value,r=null===(n=parseInt(i,10))||void 0===n?void 0:n.toFixed(0);!isNaN(r)&&r&&(t.currentScale=r/100,a(r))}),5),d=function(e){t.currentScale=e,i.current.value=(100*e).toFixed(0)};return ve((function(){i&&(i.current.value=100)}),[i]),ve((function(){if(t){var e=function(e){if(e.ctrlKey){e.preventDefault();var n=e.deltaY<0?.05:-.05,i=Math.min(Math.max(t.currentScale+n,.1),99.999);t.currentScale=i,a(nr(i))}},i=n.current;return i.addEventListener("wheel",e,{passive:!1}),function(){i.removeEventListener("wheel",e)}}}),[t,a]),bi("div",{css:Ki,children:vi("div",{css:Yi,children:[bi("input",{value:s,css:Xi,ref:i,onChange:c,type:"text"}),bi(Di,{marginTop:28,title:vi("div",{css:Qi,children:[bi("div",{css:Ji,children:"%"}),bi(qi,{size:"sm",src:ri,alt:"arrow down"})]}),child:vi("div",{css:er,children:[bi("div",{css:tr,onClick:function(){return d(.1)},children:"10%"}),bi("div",{css:tr,onClick:function(){return d(.25)},children:"25%"}),bi("div",{css:tr,onClick:function(){return d(.5)},children:"50%"}),bi("div",{css:tr,onClick:function(){return d(1)},children:"100%"}),bi("div",{css:tr,onClick:function(){return d(1.25)},children:"125%"}),bi("div",{css:tr,onClick:function(){return d(1.5)},children:"150%"}),bi("div",{css:tr,onClick:function(){return d(2)},children:"200%"}),bi("div",{css:tr,onClick:function(){return d(4)},children:"400%"}),bi("div",{css:tr,onClick:function(){return d(8)},children:"800%"}),bi("div",{css:tr,onClick:function(){return d(16)},children:"1600%"}),bi("div",{css:tr,onClick:function(){return d(64)},children:"6400%"})]})}),bi("div",{css:Zi,children:bi(ki,{title:"Zoom in",children:bi(qi,{onClick:o,src:ii,alt:"Zoom in"})})}),bi(ki,{title:"Zoom out",children:bi(qi,{onClick:l,src:ni,alt:"Zoom out"})})]})})},rr=__webpack_require__.p+"50842dfca45fc95070e4fdd2259db45c.svg",sr=__webpack_require__.p+"e80893668bffe9e8e3c09306c073cf30.svg",ar=__webpack_require__.p+"1c0b882b730b22fbd7d42b68bd0a970e.svg";var or,lr=Jn(or||(or=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n padding: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n border-radius: 8px;\n &:hover {\n background-color: #e7e7e7;\n }\n"])));const cr=function(e){var t=e.icon,n=e.title,i=e.iconAlt,r=e.onClick;return bi(ki,{title:n,children:bi("div",{onClick:r,css:lr,children:bi(qi,{src:t,alt:i})})})};var dr,hr,ur,pr;function fr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var gr=Jn(dr||(dr=fr(["\n display: flex;\n align-items: center;\n padding: 0 16px;\n cursor: pointer;\n &:hover {\n background-color: #e7e7e7;\n }\n"]))),mr=Jn(hr||(hr=fr(["\n margin-left: 8px;\n"]))),_r=Jn(ur||(ur=fr(["\n\n"]))),br=Jn(pr||(pr=fr(["\n margin: 12px 16px;\n"])));const vr=function(e){var t=e.pdfViewerObj,n=(e.eventBusRef,function(e){e?t.pagesRotation+=90:t.pagesRotation-=90});return bi(_i,{children:bi(Di,{title:bi(cr,{title:"View controls",iconAlt:"View controls",icon:rr}),child:vi("div",{css:_r,children:[bi("h4",{css:br,children:"Page orientation"}),vi("div",{css:gr,onClick:function(){return n(!0)},children:[bi(qi,{src:sr,alt:"Rotate clockwise"}),bi("p",{css:mr,children:"Rotate clockwise"})]}),vi("div",{css:gr,onClick:function(){return n(!1)},children:[bi(qi,{src:ar,alt:"Rotate counterclockwise"}),bi("p",{css:mr,children:"Rotate counterclockwise"})]})]})})})};var yr,Ar;function xr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Sr=function(){return bi("div",{css:Jn(yr||(yr=xr(["\n width: 1px;\n background-color: #ccc;\n margin: 12px 12px;\n "])))})},wr=function(e){var t=e.children;return bi("div",{css:Jn({display:"flex",background:"white",height:50,margin:"0 12px",justifyContent:"space-between"}),children:t})},Er=Jn(Ar||(Ar=xr(["\n\tdisplay: flex;\n"])));const Pr=function(e){var t=e.appRef,n=e.tools,i=e.pdfProxyObj,r=e.pdfViewerObj,s=e.onSearch,a=e.onPanel,o=e.onDownload,l=e.leftPanelEnabled,c=e.eventBusRef,d=e.viewerContainerRef;return vi(wr,{children:[vi("div",{css:Er,children:[(null==n?void 0:n.includes("download"))&&vi(_i,{children:[bi(cr,{onClick:o,title:"Download",iconAlt:"Download",icon:ti}),bi(Sr,{})]}),n.includes("thumbnails")&&bi(cr,{onClick:a,title:"Panel",iconAlt:"Panel",icon:ei}),n.includes("rotation")&&bi(vr,{eventBusRef:c,pdfViewerObj:r}),n.includes("zoom")&&vi(_i,{children:[bi(Sr,{}),bi(ir,{leftPanelEnabled:l,pdfProxyObj:i,appRef:t,viewerContainerRef:d,pdfViewerObj:r})]})]}),n.includes("search")&&bi(cr,{onClick:s,title:"Search",iconAlt:"Search",icon:Zn})]})},Cr=__webpack_require__.p+"3659a716673b2dd214d961c5feb3caa6.svg",kr=__webpack_require__.p+"536890911d2db783d87b77a39b74f396.svg";var Tr,Mr,Lr,Rr,Ir,Fr,Dr,Or,Nr,jr,Br;function Ur(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Vr=Jn(Tr||(Tr=Ur(["\n background: #f1f3f5;\n width: 300px;\n flex-shrink: 0;\n flex-grow: 0;\n font-family: Lato;\n font-size: 14px;\n color: #5b5b5b;\n"]))),Hr=Jn(Mr||(Mr=Ur(["\n display: none;\n"]))),zr=Jn(Lr||(Lr=Ur(["\n display: flex;\n"]))),Wr=Jn(Rr||(Rr=Ur(["\n width: 100%;\n padding: 4px;\n"]))),qr=Jn(Ir||(Ir=Ur(["\n position: absolute;\n right: 8px;\n border: none;\n background: none;\n margin-top: 5px;\n cursor: pointer;\n"]))),$r=Jn(Fr||(Fr=Ur(["\n padding: 8px;\n"]))),Gr=Jn(Dr||(Dr=Ur(["\n margin-top: 8px;\n"]))),Xr=Jn(Or||(Or=Ur(["\n margin-left: 4px;\n margin-right: 4px;\n"]))),Kr=Jn(Nr||(Nr=Ur(["\n opacity: 0.5;\n margin-top: 16px;\n margin-bottom: 16px;\n"]))),Yr=Jn(jr||(jr=Ur(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"]))),Qr=Jn(Br||(Br=Ur(["\n display: flex;\n"])));const Jr=function(e){var t=e.showSearch,n=e.searchText,i=e.onChange,r=e.matchesCount,s=e.onNext,a=e.onPrev,o=e.onToggleWholeWord,l=e.matchWholeWord,c=e.onToggleCaseSensitive,d=e.caseSensitive,h=e.onClear,u=Ae("");return bi("div",{css:t?Vr:Hr,children:vi("div",{css:$r,children:[bi("div",{children:vi("div",{css:zr,children:[bi("input",{css:Wr,ref:u,onChange:i,placeholder:"Search document"}),!!n&&bi("button",{css:qr,onClick:function(){u.current.value="",h()},children:"✖"})]})}),vi("div",{css:Gr,children:[bi("input",{value:d,onClick:c,type:"checkbox",id:"caseSensitive"}),bi("label",{css:Xr,htmlFor:"caseSensitive",children:"Case sensitive"}),bi("input",{value:l,onClick:o,type:"checkbox",id:"wholeWord"}),bi("label",{css:Xr,htmlFor:"wholeWord",children:"Whole word"}),!!n&&vi(_i,{children:[bi("hr",{css:Kr}),vi("div",{css:Yr,children:[vi("div",{children:[r," results found"]}),vi("div",{css:Qr,children:[bi("div",{onClick:a,children:bi(qi,{src:Cr,alt:"Arrow left"})}),bi("div",{onClick:s,children:bi(qi,{src:kr,alt:"Arrow right"})})]})]})]})]})]})})};var Zr,es,ts,ns,is,rs,ss=__webpack_require__(963),as="pdfjs-dist/build/pdf.sandbox.js",os=Jn(Zr||(Zr=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n overflow: auto;\n position: absolute;\n height: calc(100% - 50px);\n\tborder-right: 1px solid #c6c6c6;\n\tborder-left: 1px solid #c6c6c6;\n\tbackground: #eaecee;\n"]))),ls=function(e){var n,i=e.setPdfProxyObj,r=e.setPdfViewerObj,s=e.file,a=e.viewerContainerRef,o=e.eventBusRef,l=e.setMatchesCount,c=e.setActivePage,d=e.leftPanelEnabled,h=e.rightPanelEnabled,u=e.setFileLoadFailError;return ve((function(){if(s&&a.current){var e=a.current,n=new ss.EventBus;o.current=n;var d=new ss.PDFLinkService({eventBus:n,externalLinkTarget:2}),h=new ss.PDFFindController({eventBus:n,linkService:d}),p=new ss.PDFScriptingManager({eventBus:n,sandboxBundleSrc:as}),f=new ss.PDFViewer({container:e,eventBus:n,linkService:d,findController:h,scriptingManager:p});r(f),d.setViewer(f),p.setViewer(f),n.on("pagesinit",(function(){f.currentScaleValue="page-width"})),n.on("updatefindmatchescount",(function(e){var t=e.matchesCount;console.log(t,"matchescount"),l(null==t?void 0:t.total)})),n.on("pagechanging",(function(e){var t=e.pageNumber;c(t);var n=document.getElementById("thumbnail-".concat(t));n&&n.scrollIntoView()})),t.getDocument(s).promise.then((function(e){console.log(e,"loadedPdfDocument",e.numPages),i(e),f.setDocument(e),d.setDocument(e,null)}),(function(e){u(null==e?void 0:e.message),console.error(e,"error man")}))}}),[s]),ve((function(){function e(){document.hidden?console.log("Page is hidden"):(console.log("page is showing"),function(){if(s&&a.current){var e=a.current,n=new ss.EventBus;o.current=n;var d=new ss.PDFLinkService({eventBus:n,externalLinkTarget:2}),h=new ss.PDFFindController({eventBus:n,linkService:d}),p=new ss.PDFScriptingManager({eventBus:n,sandboxBundleSrc:as}),f=new ss.PDFViewer({container:e,eventBus:n,linkService:d,findController:h,scriptingManager:p});r(f),d.setViewer(f),p.setViewer(f),n.on("pagesinit",(function(){f.currentScaleValue="page-width"})),n.on("updatefindmatchescount",(function(e){var t=e.matchesCount;console.log(t,"matchescount"),l(null==t?void 0:t.total)})),n.on("pagechanging",(function(e){var t=e.pageNumber;c(t);var n=document.getElementById("thumbnail-".concat(t));n&&n.scrollIntoView()})),t.getDocument(s).promise.then((function(e){console.log(e,"loadedPdfDocument",e.numPages),i(e),f.setDocument(e),d.setDocument(e,null)}),(function(e){u(null==e?void 0:e.message),console.error(e,"reason",null==e?void 0:e.message)}))}}())}return console.log("start change"),document.addEventListener("visibilitychange",e),function(){return document.removeEventListener("visibilitychange",e)}}),[]),bi("div",{children:bi("div",{ref:a,id:"viewerContainer",css:os,style:{width:"calc(100% - ".concat((n=0,d&&(n+=300),h&&(n+=300),n),"px)")},children:bi("div",{id:"viewer",class:"pdfViewer"})})})};function cs(e){return cs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cs(e)}function ds(){ds=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var s=t&&t.prototype instanceof u?t:u,a=Object.create(s.prototype),o=new E(r||[]);return i(a,"_invoke",{value:A(e,n,o)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var h={};function u(){}function p(){}function f(){}var g={};l(g,s,(function(){return this}));var m=Object.getPrototypeOf,_=m&&m(m(P([])));_&&_!==t&&n.call(_,s)&&(g=_);var b=f.prototype=u.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function r(i,s,a,o){var l=d(e[i],e,s);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==cs(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,a,o)}),(function(e){r("throw",e,a,o)})):t.resolve(h).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,o)}))}o(l.arg)}var s;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return s=s?s.then(i,i):i()}})}function A(e,t,n){var i="suspendedStart";return function(r,s){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw s;return{value:void 0,done:!0}}for(n.method=r,n.arg=s;;){var a=n.delegate;if(a){var o=x(a,n);if(o){if(o===h)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=d(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function x(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var r=d(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,h;var s=r.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function P(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:C}}function C(){return{value:void 0,done:!0}}return p.prototype=f,i(b,"constructor",{value:f,configurable:!0}),i(f,"constructor",{value:p,configurable:!0}),p.displayName=l(f,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,l(e,o,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},v(y.prototype),l(y.prototype,a,(function(){return this})),e.AsyncIterator=y,e.async=function(t,n,i,r,s){void 0===s&&(s=Promise);var a=new y(c(t,n,i,r),s);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(b),l(b,o,"Generator"),l(b,s,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=P,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var o=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(o&&l){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(o){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var s=r;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=e,a.arg=t,s?(this.method="next",this.next=s.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;w(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:P(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function hs(e,t,n,i,r,s,a){try{var o=e[s](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(i,r)}function us(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ps=Jn(es||(es=us(["\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 20px;\n cursor: pointer;\n\tfont-family: Lato;\n\tcolor: #8b8b8b;\n"]))),fs=Jn(ts||(ts=us(["\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 20px;\n cursor: pointer;\n\tfont-family: Lato;\n\tcolor: #3183c8;\n"]))),gs=Jn(ns||(ns=us(["\n padding-bottom: 4px;\n"]))),ms=Jn(is||(is=us(["\n padding-bottom: 4px;\n\tborder-bottom: 2px solid #3183c8;\n"]))),_s=Jn(rs||(rs=us(["\n position: relative;\n"]))),bs=function(e){var t=e.pdfProxyObj,n=e.activePage,i=e.pageNum,r=e.scale,s=e.onThumbnailClick,a=Ae(null);return ve((function(){var e=function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var s=e.apply(t,n);function a(e){hs(s,i,r,a,o,"next",e)}function o(e){hs(s,i,r,a,o,"throw",e)}a(void 0)}))}}(ds().mark((function e(){var n,s,o;return ds().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getPage(i);case 2:if(n=e.sent,s=n.getViewport({scale:r}),a.current.width=s.width,a.current.height=s.height,o=a.current.getContext("2d")){e.next=9;break}throw new Error("Failed to get canvas context");case 9:return e.next=11,n.render({canvasContext:o,viewport:s}).promise;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[i,r,t]),vi("div",{id:"thumbnail-".concat(i),css:n===i?fs:ps,onClick:function(){return s(i)},children:[bi("canvas",{css:n===i?ms:gs,class:"canvas-page",ref:a}),bi("div",{style:{fontSize:"0.8rem",marginTop:"0.5rem"},children:i})]})};const vs=function(e){var t=e.activePage,n=e.pdf,i=e.scale,r=e.onThumbnailClick,s=e.pdfProxyObj,a=null==s?void 0:s.numPages;if(!a)return bi("div",{children:"Loading..."});var o=Array.from({length:a},(function(e,a){return bi(bs,{activePage:t,pdf:n,pdfProxyObj:s,pageNum:a+1,scale:i,onThumbnailClick:r},a)}));return bi("div",{css:_s,children:o})},ys=__webpack_require__.p+"15cba32d3c729060a92912d969d1cc2c.svg";var As,xs,Ss,ws,Es;function Ps(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Cs(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}__webpack_require__.p;var ks=Jn(As||(As=Cs(["\n -webkit-appearance: none; /* Override default CSS styles */\n appearance: none;\n width: 100%; /* Full width */\n height: 4px; /* Specified height */\n border-radius: 5px; \n background: #3183c8; /* Grey background */\n outline: none; /* Remove outline */\n opacity: 0.7; /* Set transparency (it will look lighter) */\n -webkit-transition: .2s; /* 0.2 seconds transition on hover */\n transition: opacity .2s;\n\n /* For thumb of the slider */\n ::-webkit-slider-thumb {\n -webkit-appearance: none; /* Override default look */\n appearance: none;\n width: 20px; /* Set a specific slider handle width */\n height: 20px; /* Slider handle height */\n background: #3183c8; /* blue background */\n cursor: pointer; /* Cursor on hover */\n border-radius: 50%; \n }\n\n /* For thumb of the slider in Firefox */\n ::-moz-range-thumb {\n width: 20px; /* Set a specific slider handle width */\n height: 20px; /* Slider handle height */\n background: #3183c8; /* blue background */\n cursor: pointer; /* Cursor on hover */\n border-radius: 50%; \n }\n"]))),Ts=Jn(xs||(xs=Cs(["\n display: flex;\n font-size: 20px;\n align-items: center;\n"]))),Ms=Jn(Ss||(Ss=Cs(["\n margin-top: 16px;\n position: sticky;\n top: 0;\n z-index: 2;\n background: #f1f3f5;\n width: 100%;\n display: flex;\n justify-content: center;\n"]))),Ls=Jn(ws||(ws=Cs(["\n font-size: 12px;\n font-weight: 600;\n margin-right: 4px;\n"]))),Rs=Jn(Es||(Es=Cs(["\n margin-left: 4px;\n"])));const Is=function(e){var t=e.setActivePage,n=e.activePage,i=e.pdf,r=e.tools,s=e.pdfProxyObj,a=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ps(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ps(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(_e(2),2),o=a[0],l=a[1];return vi(_i,{children:[(null==r?void 0:r.includes("thumbnail-zoom"))&&bi("div",{css:Ms,children:vi("div",{css:Ts,children:[bi("label",{css:Ls,children:"—"}),bi("input",{css:ks,value:o,onChange:function(e){var t=parseInt(e.target.value);l(t)},type:"range",id:"scale",name:"scale",min:"0",max:"10"}),bi("label",{css:Rs,children:"+"})]})}),bi(vs,{activePage:n,pdfProxyObj:s,pdf:i,scale:o/10,onThumbnailClick:function(e){t(e),console.log(e,"num here 12",i),i.scrollPageIntoView({pageNumber:e})}})]})},Fs=__webpack_require__.p+"3eb1d80899f968c9398d1c08a5350b2d.svg";function Ds(e){return Ds="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ds(e)}var Os,Ns;function js(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Bs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?js(Object(n),!0).forEach((function(t){Us(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Us(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Ds(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==Ds(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ds(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return o}}(e,t)||Hs(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hs(e,t){if(e){if("string"==typeof e)return zs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zs(e,t):void 0}}function zs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Ws(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var qs=Jn(Os||(Os=Ws(["\n display: flex;\n"]))),$s=Jn(Ns||(Ns=Ws(["\n display: flex;\n"])));const Gs=function(e){var t=e.pdf,n=e.setActivePage,i=Vs(_e([]),2),r=i[0],s=i[1],a={applyBookmarkButtons:we((function(e){document.querySelectorAll(".page").forEach((function(t,n){var i=document.createElement("img");i.src=Fs,i.style.position="absolute",i.style.top="10px",i.style.right="10px",i.style.zIndex=9999999,i.style.width="40px",i.style.cursor="pointer",i.onclick=function(){return e(n+1)},i.className="bookmark-icon bookmark-icon-".concat(n+1),t.appendChild(i)}))}),[]),removeBookmarkButtons:we((function(){document.querySelectorAll(".bookmark-icon").forEach((function(e){e.parentNode.removeChild(e)}))}),[])},o=a.applyBookmarkButtons,l=a.removeBookmarkButtons,c=Vs(_e(!1),2),d=c[0],h=c[1],u=function(e){console.log(e,"pageNumber"),s((function(t){return t.map((function(e){return e.pageNumber})).indexOf(e)>-1?(document.querySelector(".bookmark-icon-".concat(e)).src=Fs,t.filter((function(t){return t.pageNumber!==e}))):(document.querySelector(".bookmark-icon-".concat(e)).src=ys,[].concat(function(e){if(Array.isArray(e))return zs(e)}(n=t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||Hs(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[{pageNumber:e,title:"Untitled"}]));var n}))};return vi(_i,{children:[bi("h3",{children:"Bookmarks"}),vi("div",{css:qs,children:[bi("input",{onChange:function(e){var t,n;null!==(t=e.target)&&void 0!==t&&t.checked?o(u):l(),console.log(e.target.value,"value bro",e.checked,null===(n=e.target)||void 0===n?void 0:n.checked)},id:"view-bookmark",type:"checkbox"}),bi("label",{htmlFor:"view-bookmark",children:"View bookmark on page"})]}),r.map((function(e){var i=Vs(_e(!1),2),r=i[0],a=i[1],o=Vs(_e(e.title),2),l=o[0],c=o[1];return vi("div",{onMouseEnter:function(){return h(!0)},onMouseLeave:function(){return h(!1)},css:$s,children:[vi("div",{onClick:function(){n(e.pageNumber),t.scrollPageIntoView({pageNumber:e.pageNumber})},children:[vi("h3",{children:["Page ",e.pageNumber]}),r?vi("div",{children:[bi("input",{type:"text",value:l,onChange:function(e){c(e.target.value)}}),bi("button",{onClick:function(){a(!1),s((function(t){return t.map((function(t){return t.pageNumber===e.pageNumber?Bs(Bs({},t),{},{title:l}):t}))}))},children:"Save"}),bi("button",{onClick:function(){a(!1),c(e.title)},children:"Cancel"})]}):bi("p",{children:e.title})]}),!r&&d&&bi(Di,{title:bi(qi,{src:rr,alt:"View controls"}),child:vi("div",{children:[bi("p",{onClick:function(){a(!0)},children:"Rename"}),bi("p",{onClick:function(){return u(e.pageNumber)},children:"Delete"})]})})]},e.pageNumber)}))]})};var Xs,Ks,Ys;function Qs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Js(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Jn(Xs||(Xs=Js(["\n display: flex;\n"])));var Zs=Jn(Ks||(Ks=Js(["\n background: #f1f3f5;\n width: 300px;\n overflow: auto;\n flex-grow: 0;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n"]))),ea=Jn(Ys||(Ys=Js(["\n background: orange;\n display: none;\n"])));const ta=function(e){var t=e.showPanel,n=e.tools,i=e.setActivePage,r=e.activePage,s=e.pdf,a=e.pdfProxyObj,o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Qs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qs(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(_e(0),2),l=o[0];return o[1],vi("div",{css:t?Zs:ea,children:[0===l&&n.includes("thumbnails")&&bi(Is,{tools:n,setActivePage:i,activePage:r,pdf:s,pdfProxyObj:a}),1===l&&bi(Gs,{setActivePage:i,pdf:s})]})};var na,ia,ra,sa,aa;function oa(e){return oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oa(e)}function la(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ca(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ca(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ca(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function da(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ha=Jn(na||(na=da(["\ndisplay: flex;\nwidth: 100%;\nheight: 100%;\n"]))),ua=Jn(ia||(ia=da(["\n height: 100%;\n width: 100%;\n"]))),pa=(Jn(ra||(ra=da(["\n height: 100%;\n width: calc(100% - 400px);\n background: red;\n position: relative;\n"]))),Jn(sa||(sa=da(["\n height: calc(100vh - 50px);\n width: 100vw;\n"])))),fa=Jn(aa||(aa=da(["\n\tfont-family: Lato;\n\tmargin: 0 8px;\n\ttext-align: center;\n"])));t.GlobalWorkerOptions.workerSrc="//cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(t.version,"/pdf.worker.js"),ee(ai((function(){var e=la(_e(0),2),t=e[0],n=e[1],i=la(_e(""),2),r=i[0],s=i[1],a=la(_e(""),2),o=a[0],l=a[1],c=Ae(null),d=la(_e(null),2),h=d[0],u=d[1],p=la(_e(null),2),f=p[0],g=p[1],m=Ae(null),_=la(_e(null),2),b=_[0],v=_[1],y=la(_e(""),2),A=y[0],x=y[1],S=la(_e(!1),2),w=S[0],E=S[1],P=la(_e(!0),2),C=P[0],k=P[1],T=la(_e(1),2),M=T[0],L=T[1],R=la(_e([]),2),I=R[0],F=R[1],D=function(e){console.log(h,"pdfProxyObj"),h?h.getData().then((function(t){var n=new Blob([new Uint8Array(t)],{type:"application/pdf"}),i=URL.createObjectURL(n),r=document.createElement("a");r.href=i,r.download=e||A||"file.pdf",r.click()})):console.log("No PDF loaded to download")};console.log(I,"tools"),ve((function(){window.addEventListener("message",(function(e){"object"===oa(e.data)&&e.data.file&&v(e.data.file),"object"===oa(e.data)&&e.data.fileName&&x(e.data.fileName),"object"===oa(e.data)&&e.data.tools&&F(e.data.tools)}),!1),window.addEventListener("click",(function(e){var t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window.parent});window.parent.document.dispatchEvent(t)}))}),[]),ve((function(){var e=function(e){e.data&&"download"===e.data.type&&D(e.data.name)};return window.addEventListener("message",e,!1),function(){window.removeEventListener("message",e)}}),[D]);var O=la(_e(!1),2),N=O[0],j=O[1],B=la(_e(!1),2),U=B[0],V=B[1],H=Wi((function(e,t,n){var i;null===(i=c.current)||void 0===i||i.dispatch("find",{type:"",query:e.target.value,caseSensitive:"boolean"==typeof n?n:U,entireWord:"boolean"==typeof t?t:N,highlightAll:!0,findPrevious:!1,matchDiacritics:!0}),l(e.target.value)}),100),z=Ae(null);return console.log(r,"fileLoadFailError"),vi("div",r?{css:fa,children:[bi("h1",{children:"Failed to load the PDF."}),bi("p",{children:r})]}:{ref:z,css:pa,children:[bi(Pr,{tools:I,onDownload:D,pdfProxyObj:h,appRef:z,eventBusRef:c,viewerContainerRef:m,pdfViewerObj:f,onSearch:function(){E((function(){return!w}))},onPanel:function(){k((function(){return!C}))},leftPanelEnabled:C}),vi("div",{css:ha,children:[I.includes("thumbnails")&&bi(ta,{tools:I,setActivePage:L,activePage:M,pdfProxyObj:h,pdf:f,showPanel:C}),bi("div",{css:ua,children:bi(ls,{fileLoadFailError:r,setFileLoadFailError:s,rightPanelEnabled:w,leftPanelEnabled:C,setActivePage:L,setPdfProxyObj:u,setMatchesCount:n,eventBusRef:c,viewerContainerRef:m,setPdfViewerObj:g,file:b})}),bi(Jr,{onClear:function(){H({target:{value:""}})},onToggleWholeWord:function(){var e=!N;H({target:{value:o}},e),j((function(){return e}))},searchText:o,onNext:function(){var e;null===(e=c.current)||void 0===e||e.dispatch("find",{type:"again",query:o,caseSensitive:U,entireWord:N,highlightAll:!0,findPrevious:!1,matchDiacritics:!0})},onPrev:function(){var e;null===(e=c.current)||void 0===e||e.dispatch("find",{type:"again",query:o,caseSensitive:U,entireWord:N,highlightAll:!0,findPrevious:!0,matchDiacritics:!0})},matchesCount:t,matchWholeWord:N,onChange:H,showSearch:w,caseSensitive:U,onToggleCaseSensitive:function(){var e=!U;H({target:{value:o}},void 0,e),V((function(){return e}))}})]})]})}),{}),document.getElementById("app"))})()})();