@verdocs/web-sdk 1.0.22 → 1.1.0

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 (401) hide show
  1. package/README.md +1 -0
  2. package/dist/cjs/Token-65a1dc17.js +71 -0
  3. package/dist/{esm/Content-97cad4ea.js → cjs/Transport-68c8b1f4.js} +431 -378
  4. package/dist/cjs/buffer-es6-ce0cdd81.js +1974 -0
  5. package/dist/cjs/index-4bf5cc66.js +46 -0
  6. package/dist/cjs/{index-83ab34ef.js → index-6fc067b7.js} +50 -51
  7. package/dist/cjs/loader.cjs.js +3 -3
  8. package/dist/cjs/search-box_5.cjs.entry.js +283 -0
  9. package/dist/cjs/search-tabs.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-auth.cjs.entry.js +175 -0
  11. package/dist/cjs/verdocs-button_2.cjs.entry.js +98 -0
  12. package/dist/cjs/verdocs-document-status.cjs.entry.js +54 -0
  13. package/dist/cjs/verdocs-dropdown_12.cjs.entry.js +21168 -0
  14. package/dist/cjs/verdocs-initial-dialog.cjs.entry.js +243 -0
  15. package/dist/cjs/verdocs-loader.cjs.entry.js +19 -0
  16. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +48 -0
  17. package/dist/cjs/verdocs-organization-card.cjs.entry.js +22 -0
  18. package/dist/cjs/verdocs-search.cjs.entry.js +19 -0
  19. package/dist/cjs/verdocs-sign.cjs.entry.js +496 -0
  20. package/dist/cjs/verdocs-signature-dialog.cjs.entry.js +239 -0
  21. package/dist/cjs/verdocs-template-card.cjs.entry.js +38 -0
  22. package/dist/cjs/verdocs-template-tags.cjs.entry.js +20 -0
  23. package/dist/cjs/verdocs-toggle.cjs.entry.js +36 -0
  24. package/dist/cjs/verdocs-upload-dialog.cjs.entry.js +123 -0
  25. package/dist/cjs/verdocs-web-sdk.cjs.js +3 -3
  26. package/dist/collection/collection-manifest.json +28 -9
  27. package/dist/collection/components/controls/verdocs-button/verdocs-button.css +64 -0
  28. package/dist/collection/components/controls/verdocs-button/verdocs-button.js +133 -0
  29. package/dist/collection/components/controls/verdocs-button/verdocs-button.stories.js +20 -0
  30. package/dist/collection/components/controls/verdocs-document-status/check.svg +3 -0
  31. package/dist/collection/components/controls/{document-status-indicator/pending-icon.svg → verdocs-document-status/pending.svg} +0 -0
  32. package/dist/collection/components/controls/{document-status-indicator/cancelled-icon.svg → verdocs-document-status/stop.svg} +0 -0
  33. package/dist/collection/components/controls/verdocs-document-status/verdocs-document-status.css +18 -0
  34. package/dist/collection/components/controls/{document-status-indicator/document-status-indicator.js → verdocs-document-status/verdocs-document-status.js} +17 -17
  35. package/dist/collection/components/controls/verdocs-document-status/verdocs-document-status.stories.js +15 -0
  36. package/dist/collection/components/controls/{document-status-indicator/declined-icon.svg → verdocs-document-status/x.svg} +0 -0
  37. package/dist/collection/components/controls/{dropdown-menu → verdocs-dropdown}/down-arrow.svg +0 -0
  38. package/dist/collection/components/controls/{dropdown-menu/dropdown-menu.css → verdocs-dropdown/verdocs-dropdown.css} +17 -32
  39. package/dist/collection/components/controls/{dropdown-menu/dropdown-menu.js → verdocs-dropdown/verdocs-dropdown.js} +25 -32
  40. package/dist/collection/components/controls/{dropdown-menu/dropdown-menu.stories.js → verdocs-dropdown/verdocs-dropdown.stories.js} +5 -9
  41. package/dist/collection/components/controls/verdocs-loader/verdocs-loader.css +45 -0
  42. package/dist/collection/components/controls/verdocs-loader/verdocs-loader.js +13 -0
  43. package/dist/collection/components/controls/verdocs-loader/verdocs-loader.stories.js +8 -0
  44. package/dist/collection/components/{elements/org-popup → controls/verdocs-organization-card}/user-group.svg +0 -0
  45. package/dist/collection/components/{elements/org-popup/org-popup.css → controls/verdocs-organization-card/verdocs-organization-card.css} +13 -35
  46. package/dist/collection/components/controls/verdocs-organization-card/verdocs-organization-card.js +60 -0
  47. package/dist/collection/components/controls/verdocs-organization-card/verdocs-organization-card.stories.js +22 -0
  48. package/dist/collection/components/{elements/template-card/actions-icon.svg → controls/verdocs-template-card/actions.svg} +0 -0
  49. package/dist/collection/components/{elements/template-card/email-icon.svg → controls/verdocs-template-card/email.svg} +0 -0
  50. package/dist/collection/components/{elements/template-card/pages-icon.svg → controls/verdocs-template-card/pages.svg} +0 -0
  51. package/dist/collection/components/controls/verdocs-template-card/star.svg +10 -0
  52. package/dist/collection/components/controls/verdocs-template-card/verdocs-template-card.css +64 -0
  53. package/dist/collection/components/controls/verdocs-template-card/verdocs-template-card.js +58 -0
  54. package/dist/collection/components/controls/verdocs-template-card/verdocs-template-card.stories.js +49 -0
  55. package/dist/collection/components/controls/verdocs-template-tags/verdocs-template-tags.css +19 -0
  56. package/dist/collection/components/controls/verdocs-template-tags/verdocs-template-tags.js +34 -0
  57. package/dist/collection/components/controls/verdocs-template-tags/verdocs-template-tags.stories.js +10 -0
  58. package/dist/collection/components/controls/verdocs-text-input/test/verdocs-text-input.js +8 -0
  59. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.css +30 -0
  60. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.js +224 -0
  61. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.stories.js +31 -0
  62. package/dist/collection/components/controls/{toggle-icon-buttons/grid-view.svg → verdocs-toggle/grid.svg} +0 -0
  63. package/dist/collection/components/controls/{toggle-icon-buttons/list-view.svg → verdocs-toggle/list.svg} +0 -0
  64. package/dist/collection/components/controls/{toggle-icon-buttons/toggle-icon-buttons.css → verdocs-toggle/verdocs-toggle.css} +11 -21
  65. package/dist/collection/components/controls/{toggle-icon-buttons/toggle-icon-buttons.js → verdocs-toggle/verdocs-toggle.js} +11 -7
  66. package/dist/collection/components/controls/{toggle-icon-buttons/toggle-icon-buttons.stories.js → verdocs-toggle/verdocs-toggle.stories.js} +12 -12
  67. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.css +86 -0
  68. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js +329 -0
  69. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.stories.js +18 -0
  70. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.css +48 -0
  71. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js +146 -0
  72. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.stories.js +20 -0
  73. package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.css +86 -0
  74. package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.js +325 -0
  75. package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.stories.js +18 -0
  76. package/dist/collection/components/dialogs/verdocs-upload-dialog/paperclip.svg +3 -0
  77. package/dist/collection/components/dialogs/verdocs-upload-dialog/trash.svg +3 -0
  78. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.css +99 -0
  79. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.js +163 -0
  80. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.stories.js +18 -0
  81. package/dist/collection/components/elements/search-box/search-box.js +3 -0
  82. package/dist/collection/components/elements/search-box/search-box.stories.js +1 -1
  83. package/dist/collection/components/elements/search-quick-functions/search-quick-functions.js +3 -0
  84. package/dist/collection/components/elements/search-quick-functions/search-quick-functions.stories.js +1 -1
  85. package/dist/collection/components/elements/search-recent/search-recent.js +16 -8
  86. package/dist/collection/components/elements/search-recent/search-recent.stories.js +2 -2
  87. package/dist/collection/components/elements/search-saved/search-saved.js +15 -3
  88. package/dist/collection/components/elements/search-saved/search-saved.stories.js +2 -2
  89. package/dist/collection/components/elements/search-starred/search-starred.js +25 -2
  90. package/dist/collection/components/elements/search-starred/search-starred.stories.js +2 -2
  91. package/dist/collection/components/elements/search-tabs/search-tabs.stories.js +1 -1
  92. package/dist/collection/components/elements/verdocs-field-attachment/paperclip.svg +3 -0
  93. package/dist/collection/components/elements/verdocs-field-attachment/verdocs-field-attachment.css +21 -0
  94. package/dist/collection/components/elements/verdocs-field-attachment/verdocs-field-attachment.js +163 -0
  95. package/dist/collection/components/elements/verdocs-field-attachment/verdocs-field-attachment.stories.js +8 -0
  96. package/dist/collection/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.css +41 -0
  97. package/dist/collection/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.js +131 -0
  98. package/dist/collection/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.stories.js +11 -0
  99. package/dist/collection/components/elements/verdocs-field-date/verdocs-field-date.css +294 -0
  100. package/dist/collection/components/elements/verdocs-field-date/verdocs-field-date.js +245 -0
  101. package/dist/collection/components/elements/verdocs-field-date/verdocs-field-date.stories.js +31 -0
  102. package/dist/collection/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.css +40 -0
  103. package/dist/collection/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.js +216 -0
  104. package/dist/collection/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.stories.js +14 -0
  105. package/dist/collection/components/elements/verdocs-field-initial/verdocs-field-initial.css +38 -0
  106. package/dist/collection/components/elements/verdocs-field-initial/verdocs-field-initial.js +155 -0
  107. package/dist/collection/components/elements/verdocs-field-initial/verdocs-field-initial.stories.js +10 -0
  108. package/dist/collection/components/elements/verdocs-field-payment/verdocs-field-payment.css +56 -0
  109. package/dist/collection/components/elements/verdocs-field-payment/verdocs-field-payment.js +363 -0
  110. package/dist/collection/components/elements/verdocs-field-payment/verdocs-field-payment.stories.js +8 -0
  111. package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.css +58 -0
  112. package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.js +174 -0
  113. package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.stories.js +13 -0
  114. package/dist/collection/components/elements/verdocs-field-signature/verdocs-field-signature.css +39 -0
  115. package/dist/collection/components/elements/verdocs-field-signature/verdocs-field-signature.js +155 -0
  116. package/dist/collection/components/elements/verdocs-field-signature/verdocs-field-signature.stories.js +10 -0
  117. package/dist/collection/components/elements/verdocs-field-textarea/verdocs-field-textarea.css +32 -0
  118. package/dist/collection/components/elements/verdocs-field-textarea/verdocs-field-textarea.js +233 -0
  119. package/dist/collection/components/elements/verdocs-field-textarea/verdocs-field-textarea.stories.js +14 -0
  120. package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.css +32 -0
  121. package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.js +233 -0
  122. package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.stories.js +14 -0
  123. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.css +60 -0
  124. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +241 -0
  125. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.stories.js +19 -0
  126. package/dist/collection/components/embeds/verdocs-search/verdocs-search.css +25 -0
  127. package/dist/collection/components/embeds/verdocs-search/verdocs-search.js +19 -0
  128. package/dist/collection/components/embeds/{search-embed/search-embed.stories.js → verdocs-search/verdocs-search.stories.js} +2 -2
  129. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.css +125 -0
  130. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +408 -0
  131. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js +19 -0
  132. package/dist/collection/components/embeds/verdocs-view/verdocs-view.css +53 -0
  133. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +297 -0
  134. package/dist/collection/components/embeds/verdocs-view/verdocs-view.stories.js +21 -0
  135. package/dist/custom-elements/index.d.ts +156 -42
  136. package/dist/custom-elements/index.js +21822 -12481
  137. package/dist/custom-elements.json +555 -87
  138. package/dist/docs.json +2804 -369
  139. package/dist/esm/Token-a058076d.js +69 -0
  140. package/dist/{cjs/Content-e1c04dfa.js → esm/Transport-797d3c59.js} +426 -379
  141. package/dist/esm/buffer-es6-681a33da.js +1972 -0
  142. package/dist/esm/index-2b1938ea.js +39 -0
  143. package/dist/esm/{index-792f07a6.js → index-80d1b936.js} +51 -51
  144. package/dist/esm/loader.js +3 -3
  145. package/dist/esm/search-box_5.entry.js +275 -0
  146. package/dist/esm/search-tabs.entry.js +1 -1
  147. package/dist/esm/verdocs-auth.entry.js +171 -0
  148. package/dist/esm/verdocs-button_2.entry.js +93 -0
  149. package/dist/esm/verdocs-document-status.entry.js +50 -0
  150. package/dist/esm/verdocs-dropdown_12.entry.js +21153 -0
  151. package/dist/esm/verdocs-initial-dialog.entry.js +239 -0
  152. package/dist/esm/verdocs-loader.entry.js +15 -0
  153. package/dist/esm/verdocs-ok-dialog.entry.js +44 -0
  154. package/dist/esm/verdocs-organization-card.entry.js +18 -0
  155. package/dist/esm/verdocs-search.entry.js +15 -0
  156. package/dist/esm/verdocs-sign.entry.js +492 -0
  157. package/dist/esm/verdocs-signature-dialog.entry.js +235 -0
  158. package/dist/esm/verdocs-template-card.entry.js +34 -0
  159. package/dist/esm/verdocs-template-tags.entry.js +16 -0
  160. package/dist/esm/verdocs-toggle.entry.js +32 -0
  161. package/dist/esm/verdocs-upload-dialog.entry.js +119 -0
  162. package/dist/esm/verdocs-web-sdk.js +3 -3
  163. package/dist/esm-es5/Token-a058076d.js +1 -0
  164. package/dist/esm-es5/Transport-797d3c59.js +1 -0
  165. package/dist/esm-es5/buffer-es6-681a33da.js +7 -0
  166. package/dist/esm-es5/index-2b1938ea.js +1 -0
  167. package/dist/esm-es5/index-80d1b936.js +1 -0
  168. package/dist/esm-es5/loader.js +1 -1
  169. package/dist/esm-es5/search-box_5.entry.js +1 -0
  170. package/dist/esm-es5/search-tabs.entry.js +1 -1
  171. package/dist/esm-es5/verdocs-auth.entry.js +1 -0
  172. package/dist/esm-es5/verdocs-button_2.entry.js +1 -0
  173. package/dist/esm-es5/verdocs-document-status.entry.js +1 -0
  174. package/dist/esm-es5/verdocs-dropdown_12.entry.js +23 -0
  175. package/dist/esm-es5/verdocs-initial-dialog.entry.js +1 -0
  176. package/dist/esm-es5/verdocs-loader.entry.js +1 -0
  177. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -0
  178. package/dist/esm-es5/verdocs-organization-card.entry.js +1 -0
  179. package/dist/esm-es5/verdocs-search.entry.js +1 -0
  180. package/dist/esm-es5/verdocs-sign.entry.js +1 -0
  181. package/dist/esm-es5/verdocs-signature-dialog.entry.js +1 -0
  182. package/dist/esm-es5/verdocs-template-card.entry.js +1 -0
  183. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -0
  184. package/dist/esm-es5/verdocs-toggle.entry.js +1 -0
  185. package/dist/esm-es5/verdocs-upload-dialog.entry.js +1 -0
  186. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  187. package/dist/types/components/controls/verdocs-button/verdocs-button.d.ts +32 -0
  188. package/dist/types/components/controls/verdocs-button/verdocs-button.stories.d.ts +9 -0
  189. package/dist/types/components/controls/verdocs-document-status/verdocs-document-status.d.ts +11 -0
  190. package/dist/types/components/controls/{document-status-indicator/document-status-indicator.stories.d.ts → verdocs-document-status/verdocs-document-status.stories.d.ts} +1 -1
  191. package/dist/types/components/controls/{dropdown-menu/dropdown-menu.d.ts → verdocs-dropdown/verdocs-dropdown.d.ts} +3 -6
  192. package/dist/types/components/controls/verdocs-dropdown/verdocs-dropdown.stories.d.ts +7 -0
  193. package/dist/types/components/controls/verdocs-loader/verdocs-loader.d.ts +3 -0
  194. package/dist/types/components/controls/verdocs-loader/verdocs-loader.stories.d.ts +4 -0
  195. package/dist/types/components/controls/verdocs-organization-card/verdocs-organization-card.d.ts +11 -0
  196. package/dist/types/components/controls/verdocs-organization-card/verdocs-organization-card.stories.d.ts +6 -0
  197. package/dist/types/components/controls/verdocs-template-card/verdocs-template-card.d.ts +11 -0
  198. package/dist/types/components/{elements/template-card/template-card.stories.d.ts → controls/verdocs-template-card/verdocs-template-card.stories.d.ts} +1 -2
  199. package/dist/types/components/controls/verdocs-template-tags/verdocs-template-tags.d.ts +10 -0
  200. package/dist/types/components/controls/{tags-indicator/tags-indicator.stories.d.ts → verdocs-template-tags/verdocs-template-tags.stories.d.ts} +1 -1
  201. package/dist/types/components/controls/verdocs-text-input/test/verdocs-text-input.d.ts +1 -0
  202. package/dist/types/components/controls/verdocs-text-input/verdocs-text-input.d.ts +54 -0
  203. package/dist/types/components/controls/verdocs-text-input/verdocs-text-input.stories.d.ts +13 -0
  204. package/dist/types/components/controls/{toggle-icon-buttons/toggle-icon-buttons.d.ts → verdocs-toggle/verdocs-toggle.d.ts} +2 -2
  205. package/dist/types/components/controls/{toggle-icon-buttons/toggle-icon-buttons.stories.d.ts → verdocs-toggle/verdocs-toggle.stories.d.ts} +1 -1
  206. package/dist/types/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.d.ts +36 -0
  207. package/dist/types/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.stories.d.ts +8 -0
  208. package/dist/types/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.d.ts +32 -0
  209. package/dist/types/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.stories.d.ts +10 -0
  210. package/dist/types/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.d.ts +36 -0
  211. package/dist/types/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.stories.d.ts +8 -0
  212. package/dist/types/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.d.ts +34 -0
  213. package/dist/types/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.stories.d.ts +8 -0
  214. package/dist/types/components/elements/search-box/search-box.d.ts +3 -0
  215. package/dist/types/components/elements/search-box/search-box.stories.d.ts +1 -1
  216. package/dist/types/components/elements/search-quick-functions/search-quick-functions.d.ts +3 -0
  217. package/dist/types/components/elements/search-quick-functions/search-quick-functions.stories.d.ts +1 -1
  218. package/dist/types/components/elements/search-recent/search-recent.d.ts +4 -0
  219. package/dist/types/components/elements/search-recent/search-recent.stories.d.ts +1 -1
  220. package/dist/types/components/elements/search-saved/search-saved.d.ts +4 -0
  221. package/dist/types/components/elements/search-saved/search-saved.stories.d.ts +1 -1
  222. package/dist/types/components/elements/search-starred/search-starred.d.ts +6 -1
  223. package/dist/types/components/elements/search-starred/search-starred.stories.d.ts +1 -1
  224. package/dist/types/components/elements/search-tabs/search-tabs.stories.d.ts +1 -1
  225. package/dist/types/components/elements/verdocs-field-attachment/verdocs-field-attachment.d.ts +33 -0
  226. package/dist/types/components/elements/verdocs-field-attachment/verdocs-field-attachment.stories.d.ts +4 -0
  227. package/dist/types/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.d.ts +31 -0
  228. package/dist/types/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.stories.d.ts +7 -0
  229. package/dist/types/components/elements/verdocs-field-date/verdocs-field-date.d.ts +53 -0
  230. package/dist/types/components/elements/verdocs-field-date/verdocs-field-date.stories.d.ts +10 -0
  231. package/dist/types/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.d.ts +48 -0
  232. package/dist/types/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.stories.d.ts +10 -0
  233. package/dist/types/components/elements/verdocs-field-initial/verdocs-field-initial.d.ts +31 -0
  234. package/dist/types/components/elements/verdocs-field-initial/verdocs-field-initial.stories.d.ts +6 -0
  235. package/dist/types/components/elements/verdocs-field-payment/verdocs-field-payment.d.ts +53 -0
  236. package/dist/types/components/elements/verdocs-field-payment/verdocs-field-payment.stories.d.ts +4 -0
  237. package/dist/types/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.d.ts +38 -0
  238. package/dist/types/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.stories.d.ts +9 -0
  239. package/dist/types/components/elements/verdocs-field-signature/verdocs-field-signature.d.ts +31 -0
  240. package/dist/types/components/elements/verdocs-field-signature/verdocs-field-signature.stories.d.ts +6 -0
  241. package/dist/types/components/elements/verdocs-field-textarea/verdocs-field-textarea.d.ts +52 -0
  242. package/dist/types/components/elements/verdocs-field-textarea/verdocs-field-textarea.stories.d.ts +10 -0
  243. package/dist/types/components/elements/verdocs-field-textbox/verdocs-field-textbox.d.ts +52 -0
  244. package/dist/types/components/elements/{org-popup/org-popup.stories.d.ts → verdocs-field-textbox/verdocs-field-textbox.stories.d.ts} +6 -4
  245. package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +69 -0
  246. package/dist/types/components/embeds/verdocs-auth/verdocs-auth.stories.d.ts +9 -0
  247. package/dist/types/components/embeds/verdocs-search/verdocs-search.d.ts +3 -0
  248. package/dist/types/components/embeds/{search-embed/search-embed.stories.d.ts → verdocs-search/verdocs-search.stories.d.ts} +1 -1
  249. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +46 -0
  250. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.stories.d.ts +9 -0
  251. package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +77 -0
  252. package/dist/types/components/embeds/verdocs-view/verdocs-view.stories.d.ts +6 -0
  253. package/dist/types/components.d.ts +1195 -246
  254. package/dist/types/stencil-public-runtime.d.ts +6 -4
  255. package/dist/typings.d.ts +4 -0
  256. package/dist/verdocs-web-sdk/p-0956a3bc.system.entry.js +1 -0
  257. package/dist/verdocs-web-sdk/p-24236b87.entry.js +1 -0
  258. package/dist/verdocs-web-sdk/p-29abe078.js +1 -0
  259. package/dist/verdocs-web-sdk/p-2ded0974.entry.js +1 -0
  260. package/dist/verdocs-web-sdk/{p-4455e25e.entry.js → p-30d908ea.entry.js} +1 -1
  261. package/dist/verdocs-web-sdk/p-37b07203.system.js +1 -0
  262. package/dist/verdocs-web-sdk/p-3a102b59.entry.js +1 -0
  263. package/dist/verdocs-web-sdk/p-3b2cd409.system.entry.js +1 -0
  264. package/dist/verdocs-web-sdk/p-3c70c740.system.js +1 -0
  265. package/dist/verdocs-web-sdk/p-403cb7cf.js +1 -0
  266. package/dist/verdocs-web-sdk/p-4a538cbc.js +1 -0
  267. package/dist/verdocs-web-sdk/p-5a6041c0.entry.js +1 -0
  268. package/dist/verdocs-web-sdk/p-62ec194f.js +1 -0
  269. package/dist/verdocs-web-sdk/p-6327fd83.entry.js +1 -0
  270. package/dist/verdocs-web-sdk/p-7f9a96d5.system.entry.js +1 -0
  271. package/dist/verdocs-web-sdk/p-80c7bc0c.system.entry.js +1 -0
  272. package/dist/verdocs-web-sdk/{p-feb2f9c2.system.entry.js → p-81b15287.system.entry.js} +1 -1
  273. package/dist/verdocs-web-sdk/p-82f4cb67.system.entry.js +1 -0
  274. package/dist/verdocs-web-sdk/p-83dbc583.entry.js +1 -0
  275. package/dist/verdocs-web-sdk/p-853e30f2.system.entry.js +1 -0
  276. package/dist/verdocs-web-sdk/p-8739595c.system.js +1 -0
  277. package/dist/verdocs-web-sdk/p-89f5fc2b.entry.js +1 -0
  278. package/dist/verdocs-web-sdk/p-94d6f88f.system.entry.js +1 -0
  279. package/dist/verdocs-web-sdk/p-993a0a23.system.entry.js +1 -0
  280. package/dist/verdocs-web-sdk/p-9a896baf.system.entry.js +1 -0
  281. package/dist/verdocs-web-sdk/p-a415926b.system.entry.js +1 -0
  282. package/dist/verdocs-web-sdk/p-a4fc6ad9.entry.js +1 -0
  283. package/dist/verdocs-web-sdk/p-a73a1ff8.system.entry.js +1 -0
  284. package/dist/verdocs-web-sdk/p-aec93cc9.entry.js +1 -0
  285. package/dist/verdocs-web-sdk/p-b07ae79f.entry.js +1 -0
  286. package/dist/verdocs-web-sdk/p-b13ee3be.entry.js +1 -0
  287. package/dist/verdocs-web-sdk/p-ba8a7e2d.system.entry.js +1 -0
  288. package/dist/verdocs-web-sdk/p-bdfa7db9.system.entry.js +23 -0
  289. package/dist/verdocs-web-sdk/p-cdae8dba.entry.js +1 -0
  290. package/dist/verdocs-web-sdk/p-cec7e9ea.js +1 -0
  291. package/dist/verdocs-web-sdk/p-d03d748c.entry.js +1 -0
  292. package/dist/verdocs-web-sdk/p-d299cd16.system.entry.js +1 -0
  293. package/dist/verdocs-web-sdk/p-d82dc646.system.entry.js +1 -0
  294. package/dist/verdocs-web-sdk/p-d9474f48.system.js +7 -0
  295. package/dist/verdocs-web-sdk/p-eaffa4b1.entry.js +1 -0
  296. package/dist/verdocs-web-sdk/p-ee14709c.system.js +1 -0
  297. package/dist/verdocs-web-sdk/p-f4786f62.entry.js +23 -0
  298. package/dist/verdocs-web-sdk/p-fae1351f.system.entry.js +1 -0
  299. package/dist/verdocs-web-sdk/p-fc3d921f.system.js +1 -0
  300. package/dist/verdocs-web-sdk/p-fcfe34db.entry.js +1 -0
  301. package/dist/verdocs-web-sdk/verdocs-web-sdk.css +1 -1
  302. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  303. package/dist/verdocs-web-sdk/verdocs-web-sdk.js +1 -1
  304. package/package.json +26 -19
  305. package/dist/cjs/document-status-indicator.cjs.entry.js +0 -51
  306. package/dist/cjs/dropdown-menu.cjs.entry.js +0 -1807
  307. package/dist/cjs/org-popup.cjs.entry.js +0 -25
  308. package/dist/cjs/pdf-viewer.cjs.entry.js +0 -13677
  309. package/dist/cjs/search-box.cjs.entry.js +0 -60
  310. package/dist/cjs/search-embed.cjs.entry.js +0 -19
  311. package/dist/cjs/search-quick-functions.cjs.entry.js +0 -31
  312. package/dist/cjs/search-recent.cjs.entry.js +0 -39
  313. package/dist/cjs/search-saved.cjs.entry.js +0 -39
  314. package/dist/cjs/search-starred.cjs.entry.js +0 -46
  315. package/dist/cjs/tags-indicator.cjs.entry.js +0 -20
  316. package/dist/cjs/template-card.cjs.entry.js +0 -28
  317. package/dist/cjs/toggle-icon-buttons.cjs.entry.js +0 -32
  318. package/dist/collection/api/endpoint.js +0 -1
  319. package/dist/collection/components/controls/document-status-indicator/document-status-indicator.css +0 -23
  320. package/dist/collection/components/controls/document-status-indicator/document-status-indicator.stories.js +0 -12
  321. package/dist/collection/components/controls/document-status-indicator/finished-icon.svg +0 -1
  322. package/dist/collection/components/controls/tags-indicator/tags-indicator.css +0 -34
  323. package/dist/collection/components/controls/tags-indicator/tags-indicator.js +0 -55
  324. package/dist/collection/components/controls/tags-indicator/tags-indicator.stories.js +0 -13
  325. package/dist/collection/components/elements/org-popup/org-popup.js +0 -80
  326. package/dist/collection/components/elements/org-popup/org-popup.stories.js +0 -20
  327. package/dist/collection/components/elements/template-card/star-icon.svg +0 -1
  328. package/dist/collection/components/elements/template-card/template-card.css +0 -90
  329. package/dist/collection/components/elements/template-card/template-card.js +0 -74
  330. package/dist/collection/components/elements/template-card/template-card.stories.js +0 -21
  331. package/dist/collection/components/embeds/search-embed/search-embed.css +0 -3
  332. package/dist/collection/components/embeds/search-embed/search-embed.js +0 -15
  333. package/dist/collection/components/pdf-viewer/pdf-viewer.css +0 -20
  334. package/dist/collection/components/pdf-viewer/pdf-viewer.js +0 -278
  335. package/dist/esm/document-status-indicator.entry.js +0 -47
  336. package/dist/esm/dropdown-menu.entry.js +0 -1803
  337. package/dist/esm/org-popup.entry.js +0 -21
  338. package/dist/esm/pdf-viewer.entry.js +0 -13673
  339. package/dist/esm/search-box.entry.js +0 -56
  340. package/dist/esm/search-embed.entry.js +0 -15
  341. package/dist/esm/search-quick-functions.entry.js +0 -27
  342. package/dist/esm/search-recent.entry.js +0 -35
  343. package/dist/esm/search-saved.entry.js +0 -35
  344. package/dist/esm/search-starred.entry.js +0 -42
  345. package/dist/esm/tags-indicator.entry.js +0 -16
  346. package/dist/esm/template-card.entry.js +0 -24
  347. package/dist/esm/toggle-icon-buttons.entry.js +0 -28
  348. package/dist/esm-es5/Content-97cad4ea.js +0 -1
  349. package/dist/esm-es5/document-status-indicator.entry.js +0 -1
  350. package/dist/esm-es5/dropdown-menu.entry.js +0 -1
  351. package/dist/esm-es5/index-792f07a6.js +0 -1
  352. package/dist/esm-es5/org-popup.entry.js +0 -1
  353. package/dist/esm-es5/pdf-viewer.entry.js +0 -23
  354. package/dist/esm-es5/search-box.entry.js +0 -1
  355. package/dist/esm-es5/search-embed.entry.js +0 -1
  356. package/dist/esm-es5/search-quick-functions.entry.js +0 -1
  357. package/dist/esm-es5/search-recent.entry.js +0 -1
  358. package/dist/esm-es5/search-saved.entry.js +0 -1
  359. package/dist/esm-es5/search-starred.entry.js +0 -1
  360. package/dist/esm-es5/tags-indicator.entry.js +0 -1
  361. package/dist/esm-es5/template-card.entry.js +0 -1
  362. package/dist/esm-es5/toggle-icon-buttons.entry.js +0 -1
  363. package/dist/types/api/endpoint.d.ts +0 -1
  364. package/dist/types/components/controls/document-status-indicator/document-status-indicator.d.ts +0 -11
  365. package/dist/types/components/controls/dropdown-menu/dropdown-menu.stories.d.ts +0 -11
  366. package/dist/types/components/controls/tags-indicator/tags-indicator.d.ts +0 -18
  367. package/dist/types/components/elements/org-popup/org-popup.d.ts +0 -18
  368. package/dist/types/components/elements/template-card/template-card.d.ts +0 -18
  369. package/dist/types/components/embeds/search-embed/search-embed.d.ts +0 -3
  370. package/dist/types/components/pdf-viewer/pdf-viewer.d.ts +0 -36
  371. package/dist/verdocs-web-sdk/p-010729d1.system.entry.js +0 -1
  372. package/dist/verdocs-web-sdk/p-04ddabdc.system.entry.js +0 -1
  373. package/dist/verdocs-web-sdk/p-082ac880.system.entry.js +0 -1
  374. package/dist/verdocs-web-sdk/p-2e3b87aa.entry.js +0 -1
  375. package/dist/verdocs-web-sdk/p-2e3de14e.entry.js +0 -1
  376. package/dist/verdocs-web-sdk/p-46e67698.system.entry.js +0 -1
  377. package/dist/verdocs-web-sdk/p-4d53801c.entry.js +0 -1
  378. package/dist/verdocs-web-sdk/p-4f6c5df8.entry.js +0 -1
  379. package/dist/verdocs-web-sdk/p-4f726e43.system.entry.js +0 -1
  380. package/dist/verdocs-web-sdk/p-52a0475a.system.entry.js +0 -1
  381. package/dist/verdocs-web-sdk/p-598e9062.entry.js +0 -1
  382. package/dist/verdocs-web-sdk/p-5f583dee.entry.js +0 -1
  383. package/dist/verdocs-web-sdk/p-6b117db2.entry.js +0 -1
  384. package/dist/verdocs-web-sdk/p-6ecfe697.entry.js +0 -1
  385. package/dist/verdocs-web-sdk/p-7cd7db96.system.entry.js +0 -1
  386. package/dist/verdocs-web-sdk/p-826ce4d6.entry.js +0 -1
  387. package/dist/verdocs-web-sdk/p-852fb42b.system.entry.js +0 -1
  388. package/dist/verdocs-web-sdk/p-8fb7a85d.system.entry.js +0 -1
  389. package/dist/verdocs-web-sdk/p-92c467d9.system.entry.js +0 -1
  390. package/dist/verdocs-web-sdk/p-93409f60.entry.js +0 -1
  391. package/dist/verdocs-web-sdk/p-a8ac52f9.entry.js +0 -1
  392. package/dist/verdocs-web-sdk/p-be074c7d.entry.js +0 -23
  393. package/dist/verdocs-web-sdk/p-c7794fd6.system.entry.js +0 -23
  394. package/dist/verdocs-web-sdk/p-c8740fbb.js +0 -1
  395. package/dist/verdocs-web-sdk/p-d0b756a0.system.js +0 -1
  396. package/dist/verdocs-web-sdk/p-df83ddb8.system.entry.js +0 -1
  397. package/dist/verdocs-web-sdk/p-e724fc95.system.js +0 -1
  398. package/dist/verdocs-web-sdk/p-e7f1e5e6.js +0 -1
  399. package/dist/verdocs-web-sdk/p-e7f803f7.system.js +0 -1
  400. package/dist/verdocs-web-sdk/p-e9754f6b.entry.js +0 -1
  401. package/dist/verdocs-web-sdk/p-fe3ceb31.system.entry.js +0 -1
@@ -0,0 +1,23 @@
1
+ import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./p-403cb7cf.js";import{g as getAugmentedNamespace,c as createCommonjsModule,a as getDefaultExportFromCjs,b as commonjsGlobal,d as commonjsRequire,p as process_1}from"./p-cec7e9ea.js";import{B as Buffer}from"./p-29abe078.js";var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce((function(t,e){return t.concat([e+"-"+start,e+"-"+end])}),[]),placements=[].concat(basePlacements,[auto]).reduce((function(t,e){return t.concat([e,e+"-"+start,e+"-"+end])}),[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(t){return t?(t.nodeName||"").toLowerCase():null}function getWindow(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function isElement(t){return t instanceof getWindow(t).Element||t instanceof Element}function isHTMLElement(t){return t instanceof getWindow(t).HTMLElement||t instanceof HTMLElement}function isShadowRoot(t){return"undefined"!=typeof ShadowRoot&&(t instanceof getWindow(t).ShadowRoot||t instanceof ShadowRoot)}function applyStyles(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},s=e.attributes[t]||{},n=e.elements[t];isHTMLElement(n)&&getNodeName(n)&&(Object.assign(n.style,i),Object.keys(s).forEach((function(t){var e=s[t];!1===e?n.removeAttribute(t):n.setAttribute(t,!0===e?"":e)})))}))}function effect$2(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var s=e.elements[t],n=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});isHTMLElement(s)&&getNodeName(s)&&(Object.assign(s.style,r),Object.keys(n).forEach((function(t){s.removeAttribute(t)})))}))}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(t){return t.split("-")[0]}var max=Math.max,min=Math.min,round=Math.round;function getBoundingClientRect(t,e){void 0===e&&(e=!1);var i=t.getBoundingClientRect(),s=1,n=1;if(isHTMLElement(t)&&e){var r=t.offsetHeight,o=t.offsetWidth;o>0&&(s=round(i.width)/o||1),r>0&&(n=round(i.height)/r||1)}return{width:i.width/s,height:i.height/n,top:i.top/n,right:i.right/s,bottom:i.bottom/n,left:i.left/s,x:i.left/s,y:i.top/n}}function getLayoutRect(t){var e=getBoundingClientRect(t),i=t.offsetWidth,s=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:s}}function contains(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&isShadowRoot(i)){var s=e;do{if(s&&t.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function getComputedStyle(t){return getWindow(t).getComputedStyle(t)}function isTableElement(t){return["table","td","th"].indexOf(getNodeName(t))>=0}function getDocumentElement(t){return((isElement(t)?t.ownerDocument:t.document)||window.document).documentElement}function getParentNode(t){return"html"===getNodeName(t)?t:t.assignedSlot||t.parentNode||(isShadowRoot(t)?t.host:null)||getDocumentElement(t)}function getTrueOffsetParent(t){return isHTMLElement(t)&&"fixed"!==getComputedStyle(t).position?t.offsetParent:null}function getContainingBlock(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&isHTMLElement(t)&&"fixed"===getComputedStyle(t).position)return null;for(var i=getParentNode(t);isHTMLElement(i)&&["html","body"].indexOf(getNodeName(i))<0;){var s=getComputedStyle(i);if("none"!==s.transform||"none"!==s.perspective||"paint"===s.contain||-1!==["transform","perspective"].indexOf(s.willChange)||e&&"filter"===s.willChange||e&&s.filter&&"none"!==s.filter)return i;i=i.parentNode}return null}function getOffsetParent(t){for(var e=getWindow(t),i=getTrueOffsetParent(t);i&&isTableElement(i)&&"static"===getComputedStyle(i).position;)i=getTrueOffsetParent(i);return i&&("html"===getNodeName(i)||"body"===getNodeName(i)&&"static"===getComputedStyle(i).position)?e:i||getContainingBlock(t)||e}function getMainAxisFromPlacement(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function within(t,e,i){return max(t,min(e,i))}function withinMaxClamp(t,e,i){var s=within(t,e,i);return s>i?i:s}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(t){return Object.assign({},getFreshSideObject(),t)}function expandToHashMap(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}var toPaddingObject=function(t,e){return mergePaddingObject("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:expandToHashMap(t,basePlacements))};function arrow(t){var e,i=t.state,s=t.name,n=t.options,r=i.elements.arrow,o=i.modifiersData.popperOffsets,a=getBasePlacement(i.placement),h=getMainAxisFromPlacement(a),c=[left,right].indexOf(a)>=0?"height":"width";if(r&&o){var l=toPaddingObject(n.padding,i),d=getLayoutRect(r),u="y"===h?top:left,f="y"===h?bottom:right,p=i.rects.reference[c]+i.rects.reference[h]-o[h]-i.rects.popper[c],g=o[h]-i.rects.reference[h],m=getOffsetParent(r),b=m?"y"===h?m.clientHeight||0:m.clientWidth||0:0,A=b/2-d[c]/2+(p/2-g/2),v=within(l[u],A,b-d[c]-l[f]);i.modifiersData[s]=((e={})[h]=v,e.centerOffset=v-A,e)}}function effect$1(t){var e=t.state,i=t.options.element,s=void 0===i?"[data-popper-arrow]":i;null!=s&&("string"!=typeof s||(s=e.elements.popper.querySelector(s)))&&contains(e.elements.popper,s)&&(e.elements.arrow=s)}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(t){return t.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(t){var e=t.y,i=window.devicePixelRatio||1;return{x:round(t.x*i)/i||0,y:round(e*i)/i||0}}function mapToStyles(t){var e,i=t.popper,s=t.popperRect,n=t.placement,r=t.variation,o=t.offsets,a=t.position,h=t.gpuAcceleration,c=t.adaptive,l=t.roundOffsets,d=t.isFixed,u=o.x,f=void 0===u?0:u,p=o.y,g=void 0===p?0:p,m="function"==typeof l?l({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var b=o.hasOwnProperty("x"),A=o.hasOwnProperty("y"),v=left,w=top,k=window;if(c){var y=getOffsetParent(i),x="clientHeight",_="clientWidth";y===getWindow(i)&&"static"!==getComputedStyle(y=getDocumentElement(i)).position&&"absolute"===a&&(x="scrollHeight",_="scrollWidth"),y=y,(n===top||(n===left||n===right)&&r===end)&&(w=bottom,g-=(d&&k.visualViewport?k.visualViewport.height:y[x])-s.height,g*=h?1:-1),n!==left&&(n!==top&&n!==bottom||r!==end)||(v=right,f-=(d&&k.visualViewport?k.visualViewport.width:y[_])-s.width,f*=h?1:-1)}var D,P=Object.assign({position:a},c&&unsetSides),M=!0===l?roundOffsetsByDPR({x:f,y:g}):{x:f,y:g};return f=M.x,g=M.y,Object.assign({},P,h?((D={})[w]=A?"0":"",D[v]=b?"0":"",D.transform=(k.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",D):((e={})[w]=A?g+"px":"",e[v]=b?f+"px":"",e.transform="",e))}function computeStyles(t){var e=t.state,i=t.options,s=i.gpuAcceleration,n=void 0===s||s,r=i.adaptive,o=void 0===r||r,a=i.roundOffsets,h=void 0===a||a,c={placement:getBasePlacement(e.placement),variation:getVariation(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,mapToStyles(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:h})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,mapToStyles(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:h})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(t){var e=t.state,i=t.instance,s=t.options,n=s.scroll,r=void 0===n||n,o=s.resize,a=void 0===o||o,h=getWindow(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach((function(t){t.addEventListener("scroll",i.update,passive)})),a&&h.addEventListener("resize",i.update,passive),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",i.update,passive)})),a&&h.removeEventListener("resize",i.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(t){return t.replace(/left|right|bottom|top/g,(function(t){return hash$1[t]}))}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(t){return t.replace(/start|end/g,(function(t){return hash[t]}))}function getWindowScroll(t){var e=getWindow(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function getWindowScrollBarX(t){return getBoundingClientRect(getDocumentElement(t)).left+getWindowScroll(t).scrollLeft}function getViewportRect(t){var e=getWindow(t),i=getDocumentElement(t),s=e.visualViewport,n=i.clientWidth,r=i.clientHeight,o=0,a=0;return s&&(n=s.width,r=s.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=s.offsetLeft,a=s.offsetTop)),{width:n,height:r,x:o+getWindowScrollBarX(t),y:a}}function getDocumentRect(t){var e,i=getDocumentElement(t),s=getWindowScroll(t),n=null==(e=t.ownerDocument)?void 0:e.body,r=max(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=max(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-s.scrollLeft+getWindowScrollBarX(t),h=-s.scrollTop;return"rtl"===getComputedStyle(n||i).direction&&(a+=max(i.clientWidth,n?n.clientWidth:0)-r),{width:r,height:o,x:a,y:h}}function isScrollParent(t){var e=getComputedStyle(t);return/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function getScrollParent(t){return["html","body","#document"].indexOf(getNodeName(t))>=0?t.ownerDocument.body:isHTMLElement(t)&&isScrollParent(t)?t:getScrollParent(getParentNode(t))}function listScrollParents(t,e){var i;void 0===e&&(e=[]);var s=getScrollParent(t),n=s===(null==(i=t.ownerDocument)?void 0:i.body),r=getWindow(s),o=n?[r].concat(r.visualViewport||[],isScrollParent(s)?s:[]):s,a=e.concat(o);return n?a:a.concat(listScrollParents(getParentNode(o)))}function rectToClientRect(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function getInnerBoundingClientRect(t){var e=getBoundingClientRect(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function getClientRectFromMixedType(t,e){return e===viewport?rectToClientRect(getViewportRect(t)):isElement(e)?getInnerBoundingClientRect(e):rectToClientRect(getDocumentRect(getDocumentElement(t)))}function getClippingParents(t){var e=listScrollParents(getParentNode(t)),i=["absolute","fixed"].indexOf(getComputedStyle(t).position)>=0&&isHTMLElement(t)?getOffsetParent(t):t;return isElement(i)?e.filter((function(t){return isElement(t)&&contains(t,i)&&"body"!==getNodeName(t)})):[]}function getClippingRect(t,e,i){var s="clippingParents"===e?getClippingParents(t):[].concat(e),n=[].concat(s,[i]),r=n.reduce((function(e,i){var s=getClientRectFromMixedType(t,i);return e.top=max(s.top,e.top),e.right=min(s.right,e.right),e.bottom=min(s.bottom,e.bottom),e.left=max(s.left,e.left),e}),getClientRectFromMixedType(t,n[0]));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function computeOffsets(t){var e,i=t.reference,s=t.element,n=t.placement,r=n?getBasePlacement(n):null,o=n?getVariation(n):null,a=i.x+i.width/2-s.width/2,h=i.y+i.height/2-s.height/2;switch(r){case top:e={x:a,y:i.y-s.height};break;case bottom:e={x:a,y:i.y+i.height};break;case right:e={x:i.x+i.width,y:h};break;case left:e={x:i.x-s.width,y:h};break;default:e={x:i.x,y:i.y}}var c=r?getMainAxisFromPlacement(r):null;if(null!=c){var l="y"===c?"height":"width";switch(o){case start:e[c]=e[c]-(i[l]/2-s[l]/2);break;case end:e[c]=e[c]+(i[l]/2-s[l]/2)}}return e}function detectOverflow(t,e){void 0===e&&(e={});var i=e.placement,s=void 0===i?t.placement:i,n=e.boundary,r=void 0===n?clippingParents:n,o=e.rootBoundary,a=void 0===o?viewport:o,h=e.elementContext,c=void 0===h?popper:h,l=e.altBoundary,d=void 0!==l&&l,u=e.padding,f=void 0===u?0:u,p=mergePaddingObject("number"!=typeof f?f:expandToHashMap(f,basePlacements)),g=t.rects.popper,m=t.elements[d?c===popper?reference:popper:c],b=getClippingRect(isElement(m)?m:m.contextElement||getDocumentElement(t.elements.popper),r,a),A=getBoundingClientRect(t.elements.reference),v=computeOffsets({reference:A,element:g,strategy:"absolute",placement:s}),w=rectToClientRect(Object.assign({},g,v)),k=c===popper?w:A,y={top:b.top-k.top+p.top,bottom:k.bottom-b.bottom+p.bottom,left:b.left-k.left+p.left,right:k.right-b.right+p.right},x=t.modifiersData.offset;if(c===popper&&x){var _=x[s];Object.keys(y).forEach((function(t){var e=[right,bottom].indexOf(t)>=0?1:-1,i=[top,bottom].indexOf(t)>=0?"y":"x";y[t]+=_[i]*e}))}return y}function computeAutoPlacement(t,e){void 0===e&&(e={});var i=e.boundary,s=e.rootBoundary,n=e.padding,r=e.flipVariations,o=e.allowedAutoPlacements,a=void 0===o?placements:o,h=getVariation(e.placement),c=h?r?variationPlacements:variationPlacements.filter((function(t){return getVariation(t)===h})):basePlacements,l=c.filter((function(t){return a.indexOf(t)>=0}));0===l.length&&(l=c);var d=l.reduce((function(e,r){return e[r]=detectOverflow(t,{placement:r,boundary:i,rootBoundary:s,padding:n})[getBasePlacement(r)],e}),{});return Object.keys(d).sort((function(t,e){return d[t]-d[e]}))}function getExpandedFallbackPlacements(t){if(getBasePlacement(t)===auto)return[];var e=getOppositePlacement(t);return[getOppositeVariationPlacement(t),e,getOppositeVariationPlacement(e)]}function flip(t){var e=t.state,i=t.options,s=t.name;if(!e.modifiersData[s]._skip){for(var n=i.mainAxis,r=void 0===n||n,o=i.altAxis,a=void 0===o||o,h=i.fallbackPlacements,c=i.padding,l=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,g=i.allowedAutoPlacements,m=e.options.placement,b=getBasePlacement(m),A=h||(b!==m&&p?getExpandedFallbackPlacements(m):[getOppositePlacement(m)]),v=[m].concat(A).reduce((function(t,i){return t.concat(getBasePlacement(i)===auto?computeAutoPlacement(e,{placement:i,boundary:l,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):i)}),[]),w=e.rects.reference,k=e.rects.popper,y=new Map,x=!0,_=v[0],D=0;D<v.length;D++){var P=v[D],M=getBasePlacement(P),O=getVariation(P)===start,E=[top,bottom].indexOf(M)>=0,S=E?"width":"height",C=detectOverflow(e,{placement:P,boundary:l,rootBoundary:d,altBoundary:u,padding:c}),F=E?O?right:left:O?bottom:top;w[S]>k[S]&&(F=getOppositePlacement(F));var T=getOppositePlacement(F),R=[];if(r&&R.push(C[M]<=0),a&&R.push(C[F]<=0,C[T]<=0),R.every((function(t){return t}))){_=P,x=!1;break}y.set(P,R)}if(x)for(var I=function(t){var e=v.find((function(e){var i=y.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return _=e,"break"},L=p?3:1;L>0&&"break"!==I(L);L--);e.placement!==_&&(e.modifiersData[s]._skip=!0,e.placement=_,e.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function isAnySideFullyClipped(t){return[top,right,bottom,left].some((function(e){return t[e]>=0}))}function hide(t){var e=t.state,i=t.name,s=e.rects.reference,n=e.rects.popper,r=e.modifiersData.preventOverflow,o=detectOverflow(e,{elementContext:"reference"}),a=detectOverflow(e,{altBoundary:!0}),h=getSideOffsets(o,s),c=getSideOffsets(a,n,r),l=isAnySideFullyClipped(h),d=isAnySideFullyClipped(c);e.modifiersData[i]={referenceClippingOffsets:h,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":d})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(t,e,i){var s=getBasePlacement(t),n=[left,top].indexOf(s)>=0?-1:1,r="function"==typeof i?i(Object.assign({},e,{placement:t})):i,o=r[0],a=r[1];return o=o||0,a=(a||0)*n,[left,right].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function offset(t){var e=t.state,i=t.name,s=t.options.offset,n=void 0===s?[0,0]:s,r=placements.reduce((function(t,i){return t[i]=distanceAndSkiddingToXY(i,e.rects,n),t}),{}),o=r[e.placement],a=o.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=o.x,e.modifiersData.popperOffsets.y+=a),e.modifiersData[i]=r}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(t){var e=t.state;e.modifiersData[t.name]=computeOffsets({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(t){return"x"===t?"y":"x"}function preventOverflow(t){var e=t.state,i=t.options,s=t.name,n=i.mainAxis,r=void 0===n||n,o=i.altAxis,a=void 0!==o&&o,h=i.tether,c=void 0===h||h,l=i.tetherOffset,d=void 0===l?0:l,u=detectOverflow(e,{boundary:i.boundary,rootBoundary:i.rootBoundary,padding:i.padding,altBoundary:i.altBoundary}),f=getBasePlacement(e.placement),p=getVariation(e.placement),g=!p,m=getMainAxisFromPlacement(f),b=getAltAxis(m),A=e.modifiersData.popperOffsets,v=e.rects.reference,w=e.rects.popper,k="function"==typeof d?d(Object.assign({},e.rects,{placement:e.placement})):d,y="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),x=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,_={x:0,y:0};if(A){if(r){var D,P="y"===m?top:left,M="y"===m?bottom:right,O="y"===m?"height":"width",E=A[m],S=E+u[P],C=E-u[M],F=c?-w[O]/2:0,T=p===start?v[O]:w[O],R=p===start?-w[O]:-v[O],I=e.elements.arrow,L=c&&I?getLayoutRect(I):{width:0,height:0},N=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:getFreshSideObject(),j=N[P],$=N[M],B=within(0,v[O],L[O]),U=g?v[O]/2-F-B-j-y.mainAxis:T-B-j-y.mainAxis,W=g?-v[O]/2+F+B+$+y.mainAxis:R+B+$+y.mainAxis,V=e.elements.arrow&&getOffsetParent(e.elements.arrow),G=null!=(D=null==x?void 0:x[m])?D:0,q=E+W-G,H=within(c?min(S,E+U-G-(V?"y"===m?V.clientTop||0:V.clientLeft||0:0)):S,E,c?max(C,q):C);A[m]=H,_[m]=H-E}if(a){var z,Y=A[b],X="y"===b?"height":"width",Q=Y+u["x"===m?top:left],K=Y-u["x"===m?bottom:right],J=-1!==[top,left].indexOf(f),Z=null!=(z=null==x?void 0:x[b])?z:0,tt=J?Q:Y-v[X]-w[X]-Z+y.altAxis,et=J?Y+v[X]+w[X]-Z-y.altAxis:K,it=c&&J?withinMaxClamp(tt,Y,et):within(c?tt:Q,Y,c?et:K);A[b]=it,_[b]=it-Y}e.modifiersData[s]=_}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function getNodeScroll(t){return t!==getWindow(t)&&isHTMLElement(t)?getHTMLElementScroll(t):getWindowScroll(t)}function isElementScaled(t){var e=t.getBoundingClientRect(),i=round(e.width)/t.offsetWidth||1,s=round(e.height)/t.offsetHeight||1;return 1!==i||1!==s}function getCompositeRect(t,e,i){void 0===i&&(i=!1);var s=isHTMLElement(e),n=isHTMLElement(e)&&isElementScaled(e),r=getDocumentElement(e),o=getBoundingClientRect(t,n),a={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(s||!s&&!i)&&(("body"!==getNodeName(e)||isScrollParent(r))&&(a=getNodeScroll(e)),isHTMLElement(e)?((h=getBoundingClientRect(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):r&&(h.x=getWindowScrollBarX(r))),{x:o.left+a.scrollLeft-h.x,y:o.top+a.scrollTop-h.y,width:o.width,height:o.height}}function order(t){var e=new Map,i=new Set,s=[];function n(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var s=e.get(t);s&&n(s)}})),s.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||n(t)})),s}function orderModifiers(t){var e=order(t);return modifierPhases.reduce((function(t,i){return t.concat(e.filter((function(t){return t.phase===i})))}),[])}function debounce(t){var e;return function(){return e||(e=new Promise((function(i){Promise.resolve().then((function(){e=void 0,i(t())}))}))),e}}function mergeByName(t){var e=t.reduce((function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function popperGenerator(t){void 0===t&&(t={});var e=t.defaultModifiers,i=void 0===e?[]:e,s=t.defaultOptions,n=void 0===s?DEFAULT_OPTIONS:s;return function(t,e,s){void 0===s&&(s=n);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,n),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},o=[],a=!1,h={state:r,setOptions:function(s){var a="function"==typeof s?s(r.options):s;c(),r.options=Object.assign({},n,r.options,a),r.scrollParents={reference:isElement(t)?listScrollParents(t):t.contextElement?listScrollParents(t.contextElement):[],popper:listScrollParents(e)};var l=orderModifiers(mergeByName([].concat(i,r.options.modifiers)));return r.orderedModifiers=l.filter((function(t){return t.enabled})),r.orderedModifiers.forEach((function(t){var e=t.options,i=t.effect;if("function"==typeof i){var s=i({state:r,name:t.name,instance:h,options:void 0===e?{}:e});o.push(s||function(){})}})),h.update()},forceUpdate:function(){if(!a){var t=r.elements,e=t.reference,i=t.popper;if(areValidElements(e,i)){r.rects={reference:getCompositeRect(e,getOffsetParent(i),"fixed"===r.options.strategy),popper:getLayoutRect(i)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach((function(t){return r.modifiersData[t.name]=Object.assign({},t.data)}));for(var s=0;s<r.orderedModifiers.length;s++)if(!0!==r.reset){var n=r.orderedModifiers[s],o=n.fn,c=n.options;"function"==typeof o&&(r=o({state:r,options:void 0===c?{}:c,name:n.name,instance:h})||r)}else r.reset=!1,s=-1}}},update:debounce((function(){return new Promise((function(t){h.forceUpdate(),t(r)}))})),destroy:function(){c(),a=!0}};if(!areValidElements(t,e))return h;function c(){o.forEach((function(t){return t()})),o=[]}return h.setOptions(s).then((function(t){!a&&s.onFirstUpdate&&s.onFirstUpdate(t)})),h}}var defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1],createPopper=popperGenerator({defaultModifiers});const SortDown='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#50BE80"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>\n',verdocsDropdownCss="verdocs-dropdown{font-family:sans-serif;font-family:var(--verdocs-font);display:block}verdocs-dropdown .arrow{width:32px;height:26px;background:#fff;cursor:pointer;border-radius:4px;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;border:1px solid #ccc;-ms-flex-pack:center;justify-content:center}verdocs-dropdown .arrow svg{fill:var(--verdocs-primary-color);-webkit-transition:0.3s;transition:0.3s}verdocs-dropdown .items{width:200px;display:none;z-index:10000;border-radius:5px;background:#33364b;border:1px solid #654dcb}verdocs-dropdown .items[data-show]{display:block}verdocs-dropdown .option{width:100%;color:#fff;border:none;display:block;text-align:left;background:none;padding:10px 20px}verdocs-dropdown .option:hover{cursor:pointer;background:var(--verdocs-primary-color)}verdocs-dropdown .option[disabled]{color:#aaa}verdocs-dropdown .option[disabled]:hover{color:#aaa;cursor:inherit;background:transparent}verdocs-dropdown.open .items{display:block}verdocs-dropdown.open .arrow{background:#4c56cb;border:1px solid #707ae5}verdocs-dropdown.open .arrow svg{-webkit-transform:scaleY(-1);transform:scaleY(-1);fill:#fff}";let VerdocsDropdown=class{constructor(t){registerInstance(this,t),this.optionSelected=createEvent(this,"optionSelected",7),this.options=[]}componentWillLoad(){this.isOpen=!!this.open}componentDidLoad(){this.popper=createPopper(this.dropdownButton,this.dropdownMenu,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,10]}}]})}handleSelectOption(t){this.isOpen=!1,this.optionSelected.emit(t),this.hide()}showDropdown(){var t,e;this.isOpen=!0,this.dropdownMenu.setAttribute("data-show",""),this.dropdownMenu.removeAttribute("aria-hidden"),null===(t=this.popper)||void 0===t||t.setOptions((t=>({...t,modifiers:[...t.modifiers,{name:"eventListeners",enabled:!0}]}))),null===(e=this.popper)||void 0===e||e.update()}handleHideDropdown(t){var e,i;"button"===(null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.localName)&&"arrow"===(null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.className)||this.hide()}toggleDropdown(){this.isOpen?this.hide():this.showDropdown()}hide(){var t;this.isOpen=!1,this.dropdownMenu.removeAttribute("data-show"),this.dropdownMenu.setAttribute("aria-hidden","true"),null===(t=this.popper)||void 0===t||t.setOptions((t=>({...t,modifiers:[...t.modifiers,{name:"eventListeners",enabled:!1}]})))}render(){var t;return h(Host,{class:{storybook:!!(null===window||void 0===window?void 0:window.STORYBOOK_ENV),open:!!this.isOpen}},h("button",{class:"arrow",innerHTML:SortDown,"aria-label":"Open Menu",onClick:()=>this.toggleDropdown(),onBlur:t=>this.handleHideDropdown(t),ref:t=>this.dropdownButton=t}),h("div",{class:"items","aria-hidden":!this.open,ref:t=>this.dropdownMenu=t},null===(t=this.options)||void 0===t?void 0:t.map((t=>h("button",{onClick:()=>this.handleSelectOption(t),class:"option",disabled:t.disabled},t.label)))))}};VerdocsDropdown.style=verdocsDropdownCss;const Paperclip='<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">\n <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" />\n</svg>\n',verdocsFieldAttachmentCss="verdocs-field-attachment{font-family:sans-serif;font-family:var(--verdocs-font);width:24px;height:24px;display:block;font-size:11px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-attachment span{width:20px;cursor:pointer}verdocs-field-attachment.required span{border:1px solid var(--verdocs-required-color)}verdocs-field-attachment.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";let VerdocsFieldAttachment=class{constructor(t){registerInstance(this,t),this.fieldChange=createEvent(this,"fieldChange",7),this.order=1,this.value="",this.required=!1,this.disabled=!1}async focusField(){this.handleShow()}handleShow(){this.dialog=document.createElement("verdocs-upload-dialog"),this.dialog.open=!0,this.dialog.addEventListener("cancel",(()=>{var t;console.log("cancel"),null===(t=this.dialog)||void 0===t||t.remove()})),document.addEventListener("done",(t=>{var e;console.log("done",t),null===(e=this.dialog)||void 0===e||e.remove()})),document.body.append(this.dialog)}render(){return h(Host,{class:{required:this.required}},h("span",{innerHTML:Paperclip,onClick:()=>this.handleShow()}))}};VerdocsFieldAttachment.style=verdocsFieldAttachmentCss;const verdocsFieldCheckboxCss='@charset "UTF-8";verdocs-field-checkbox{font-family:sans-serif;font-family:var(--verdocs-font);font-size:11px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-checkbox label>input[type=checkbox]{display:none}verdocs-field-checkbox label>input[type=checkbox]+*::before{content:"";display:block;vertical-align:bottom;width:14px;height:14px;border-radius:2px;border:1px solid rgba(0, 0, 0, 0.2);-ms-flex-negative:0;flex-shrink:0}verdocs-field-checkbox label>input[type=checkbox]:checked+*{color:var(--verdocs-primary-color)}verdocs-field-checkbox label>input[type=checkbox]:checked+*::before{content:"✓";color:white;text-align:center;background:var(--verdocs-primary-color);border-color:var(--verdocs-primary-color)}verdocs-field-checkbox.required label>input[type=checkbox]+*::before{border:1px solid var(--verdocs-required-color)}verdocs-field-checkbox.hide{display:none}verdocs-field-checkbox.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}';let VerdocsFieldCheckbox=class{constructor(t){registerInstance(this,t),this.fieldChange=createEvent(this,"fieldChange",7),this.order=1,this.value=!1,this.required=!1,this.disabled=!1}handleChange(t){this.fieldChange.emit(t.target.checked)}render(){return h(Host,{class:{required:this.required}},h("label",null,h("input",{type:"checkbox",tabIndex:this.order,checked:this.value,disabled:this.disabled,required:this.required,onChange:t=>this.handleChange(t)}),h("span",null)))}};function hasProperty(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function lastItemOf(t){return t[t.length-1]}function pushUnique(t,...e){return e.forEach((e=>{t.includes(e)||t.push(e)})),t}function stringToArray(t,e){return t?t.split(e):[]}function isInRange(t,e,i){return(void 0===e||t>=e)&&(void 0===i||t<=i)}function limitToRange(t,e,i){return t<e?e:t>i?i:t}function createTagRepeat(t,e,i={},s=0,n=""){n+=`<${Object.keys(i).reduce(((t,e)=>{let n=i[e];return"function"==typeof n&&(n=n(s)),`${t} ${e}="${n}"`}),t)}></${t}>`;const r=s+1;return r<e?createTagRepeat(t,e,i,r,n):n}function optimizeTemplateHTML(t){return t.replace(/>\s+/g,">").replace(/\s+</,"<")}function stripTime(t){return new Date(t).setHours(0,0,0,0)}function today(){return(new Date).setHours(0,0,0,0)}function dateValue(...t){switch(t.length){case 0:return today();case 1:return stripTime(t[0])}const e=new Date(0);return e.setFullYear(...t),e.setHours(0,0,0,0)}function addDays(t,e){const i=new Date(t);return i.setDate(i.getDate()+e)}function addWeeks(t,e){return addDays(t,7*e)}function addMonths(t,e){const i=new Date(t),s=i.getMonth()+e;let n=s%12;n<0&&(n+=12);const r=i.setMonth(s);return i.getMonth()!==n?i.setDate(0):r}function addYears(t,e){const i=new Date(t),s=i.getMonth(),n=i.setFullYear(i.getFullYear()+e);return 1===s&&2===i.getMonth()?i.setDate(0):n}function dayDiff(t,e){return(t-e+7)%7}function dayOfTheWeekOf(t,e,i=0){const s=new Date(t).getDay();return addDays(t,dayDiff(e,i)-dayDiff(s,i))}function getWeek(t){const e=dayOfTheWeekOf(t,4,1),i=dayOfTheWeekOf(new Date(e).setMonth(0,4),4,1);return Math.round((e-i)/6048e5)+1}function startOfYearPeriod(t,e){const i=new Date(t).getFullYear();return Math.floor(i/e)*e}function regularizeDate(t,e,i){if(1!==e&&2!==e)return t;const s=new Date(t);return 1===e?i?s.setMonth(s.getMonth()+1,0):s.setDate(1):i?s.setFullYear(s.getFullYear()+1,0,0):s.setMonth(0,1),s.setHours(0,0,0,0)}VerdocsFieldCheckbox.style=verdocsFieldCheckboxCss;const reFormatTokens=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,reNonDateParts=/[\s!-/:-@[-`{-~年月日]+/;let knownFormats={};const parseFns={y:(t,e)=>new Date(t).setFullYear(parseInt(e,10)),m(t,e,i){const s=new Date(t);let n=parseInt(e,10)-1;if(isNaN(n)){if(!e)return NaN;const t=e.toLowerCase(),s=e=>e.toLowerCase().startsWith(t);if(n=i.monthsShort.findIndex(s),n<0&&(n=i.months.findIndex(s)),n<0)return NaN}return s.setMonth(n),s.getMonth()!==normalizeMonth(n)?s.setDate(0):s.getTime()},d:(t,e)=>new Date(t).setDate(parseInt(e,10))},formatFns={d:t=>t.getDate(),dd:t=>padZero(t.getDate(),2),D:(t,e)=>e.daysShort[t.getDay()],DD:(t,e)=>e.days[t.getDay()],m:t=>t.getMonth()+1,mm:t=>padZero(t.getMonth()+1,2),M:(t,e)=>e.monthsShort[t.getMonth()],MM:(t,e)=>e.months[t.getMonth()],y:t=>t.getFullYear(),yy:t=>padZero(t.getFullYear(),2).slice(-2),yyyy:t=>padZero(t.getFullYear(),4)};function normalizeMonth(t){return t>-1?t%12:normalizeMonth(t+12)}function padZero(t,e){return t.toString().padStart(e,"0")}function parseFormatString(t){if("string"!=typeof t)throw new Error("Invalid date format.");if(t in knownFormats)return knownFormats[t];const e=t.split(reFormatTokens),i=t.match(new RegExp(reFormatTokens,"g"));if(0===e.length||!i)throw new Error("Invalid date format.");const s=i.map((t=>formatFns[t])),n=Object.keys(parseFns).reduce(((t,e)=>(i.find((t=>"D"!==t[0]&&t[0].toLowerCase()===e))&&t.push(e),t)),[]);return knownFormats[t]={parser(t,e){const s=t.split(reNonDateParts).reduce(((t,e,s)=>{if(e.length>0&&i[s]){const n=i[s][0];"M"===n?t.m=e:"D"!==n&&(t[n]=e)}return t}),{});return n.reduce(((t,i)=>{const n=parseFns[i](t,s[i],e);return isNaN(n)?t:n}),today())},formatter:(t,i)=>s.reduce(((s,n,r)=>s+`${e[r]}${n(t,i)}`),"")+lastItemOf(e)}}function parseDate(t,e,i){if(t instanceof Date||"number"==typeof t){const e=stripTime(t);return isNaN(e)?void 0:e}if(t){if("today"===t)return today();if(e&&e.toValue){const s=e.toValue(t,e,i);return isNaN(s)?void 0:stripTime(s)}return parseFormatString(e).parser(t,i)}}function formatDate(t,e,i){if(isNaN(t)||!t&&0!==t)return"";const s="number"==typeof t?new Date(t):t;return e.toDisplay?e.toDisplay(s,e,i):parseFormatString(e).formatter(s,i)}const range=document.createRange();function parseHTML(t){return range.createContextualFragment(t)}function getParent(t){return t.parentElement||(t.parentNode instanceof ShadowRoot?t.parentNode.host:void 0)}function isActiveElement(t){return t.getRootNode().activeElement===t}function hideElement(t){"none"!==t.style.display&&(t.style.display&&(t.dataset.styleDisplay=t.style.display),t.style.display="none")}function showElement(t){"none"===t.style.display&&(t.dataset.styleDisplay?(t.style.display=t.dataset.styleDisplay,delete t.dataset.styleDisplay):t.style.display="")}function emptyChildNodes(t){t.firstChild&&(t.removeChild(t.firstChild),emptyChildNodes(t))}function replaceChildNodes(t,e){emptyChildNodes(t),e instanceof DocumentFragment?t.appendChild(e):"string"==typeof e?t.appendChild(parseHTML(e)):"function"==typeof e.forEach&&e.forEach((e=>{t.appendChild(e)}))}const listenerRegistry=new WeakMap,{addEventListener,removeEventListener}=EventTarget.prototype;function registerListeners(t,e){let i=listenerRegistry.get(t);i||(i=[],listenerRegistry.set(t,i)),e.forEach((t=>{addEventListener.call(...t),i.push(t)}))}function unregisterListeners(t){let e=listenerRegistry.get(t);e&&(e.forEach((t=>{removeEventListener.call(...t)})),listenerRegistry.delete(t))}if(!Event.prototype.composedPath){const t=(e,i=[])=>{let s;return i.push(e),e.parentNode?s=e.parentNode:e.host?s=e.host:e.defaultView&&(s=e.defaultView),s?t(s,i):i};Event.prototype.composedPath=function(){return t(this.target)}}function findFromPath(t,e,i){const[s,...n]=t;return e(s)?s:s!==i&&"HTML"!==s.tagName&&0!==n.length?findFromPath(n,e,i):void 0}function findElementInEventPath(t,e){const i="function"==typeof e?e:t=>t instanceof Element&&t.matches(e);return findFromPath(t.composedPath(),i,t.currentTarget)}const locales={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},defaultOptions={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,calendarWeeks:!1,clearBtn:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayBtn:!1,todayBtnMode:0,todayHighlight:!1,updateOnBlur:!0,weekStart:0},{language:defaultLang,format:defaultFormat,weekStart:defaultWeekStart}=defaultOptions;function sanitizeDOW(t,e){return t.length<6&&e>=0&&e<7?pushUnique(t,e):t}function calcEndOfWeek(t){return(t+6)%7}function validateDate(t,e,i,s){const n=parseDate(t,e,i);return void 0!==n?n:s}function validateViewId(t,e,i=3){const s=parseInt(t,10);return s>=0&&s<=i?s:e}function processOptions(t,e){const i=Object.assign({},t),s={},n=e.constructor.locales,r=e.rangeSideIndex;let{format:o,language:a,locale:h,maxDate:c,maxView:l,minDate:d,pickLevel:u,startView:f,weekStart:p}=e.config||{};if(i.language){let t;if(i.language!==a&&(n[i.language]?t=i.language:(t=i.language.split("-")[0],void 0===n[t]&&(t=!1))),delete i.language,t){a=s.language=t;const e=h||n[defaultLang];h=Object.assign({format:defaultFormat,weekStart:defaultWeekStart},n[defaultLang]),a!==defaultLang&&Object.assign(h,n[a]),s.locale=h,o===e.format&&(o=s.format=h.format),p===e.weekStart&&(p=s.weekStart=h.weekStart,s.weekEnd=calcEndOfWeek(h.weekStart))}}if(i.format){const t="function"==typeof i.format.toDisplay,e="function"==typeof i.format.toValue,n=reFormatTokens.test(i.format);(t&&e||n)&&(o=s.format=i.format),delete i.format}let g=u;void 0!==i.pickLevel&&(g=validateViewId(i.pickLevel,2),delete i.pickLevel),g!==u&&(g>u&&(void 0===i.minDate&&(i.minDate=d),void 0===i.maxDate&&(i.maxDate=c)),i.datesDisabled||(i.datesDisabled=[]),u=s.pickLevel=g);let m=d,b=c;if(void 0!==i.minDate){const t=dateValue(0,0,1);m=null===i.minDate?t:validateDate(i.minDate,o,h,m),m!==t&&(m=regularizeDate(m,u,!1)),delete i.minDate}if(void 0!==i.maxDate&&(b=null===i.maxDate?void 0:validateDate(i.maxDate,o,h,b),void 0!==b&&(b=regularizeDate(b,u,!0)),delete i.maxDate),b<m?(d=s.minDate=b,c=s.maxDate=m):(d!==m&&(d=s.minDate=m),c!==b&&(c=s.maxDate=b)),i.datesDisabled&&(s.datesDisabled=i.datesDisabled.reduce(((t,e)=>{const i=parseDate(e,o,h);return void 0!==i?pushUnique(t,regularizeDate(i,u,r)):t}),[]),delete i.datesDisabled),void 0!==i.defaultViewDate){const t=parseDate(i.defaultViewDate,o,h);void 0!==t&&(s.defaultViewDate=t),delete i.defaultViewDate}if(void 0!==i.weekStart){const t=Number(i.weekStart)%7;isNaN(t)||(p=s.weekStart=t,s.weekEnd=calcEndOfWeek(t)),delete i.weekStart}if(i.daysOfWeekDisabled&&(s.daysOfWeekDisabled=i.daysOfWeekDisabled.reduce(sanitizeDOW,[]),delete i.daysOfWeekDisabled),i.daysOfWeekHighlighted&&(s.daysOfWeekHighlighted=i.daysOfWeekHighlighted.reduce(sanitizeDOW,[]),delete i.daysOfWeekHighlighted),void 0!==i.maxNumberOfDates){const t=parseInt(i.maxNumberOfDates,10);t>=0&&(s.maxNumberOfDates=t,s.multidate=1!==t),delete i.maxNumberOfDates}i.dateDelimiter&&(s.dateDelimiter=String(i.dateDelimiter),delete i.dateDelimiter);let A=l;void 0!==i.maxView&&(A=validateViewId(i.maxView,l),delete i.maxView),A=u>A?u:A,A!==l&&(l=s.maxView=A);let v=f;if(void 0!==i.startView&&(v=validateViewId(i.startView,v),delete i.startView),v<u?v=u:v>l&&(v=l),v!==f&&(s.startView=v),i.prevArrow){const t=parseHTML(i.prevArrow);t.childNodes.length>0&&(s.prevArrow=t.childNodes),delete i.prevArrow}if(i.nextArrow){const t=parseHTML(i.nextArrow);t.childNodes.length>0&&(s.nextArrow=t.childNodes),delete i.nextArrow}if(void 0!==i.disableTouchKeyboard&&(s.disableTouchKeyboard="ontouchstart"in document&&!!i.disableTouchKeyboard,delete i.disableTouchKeyboard),i.orientation){const t=i.orientation.toLowerCase().split(/\s+/g);s.orientation={x:t.find((t=>"left"===t||"right"===t))||"auto",y:t.find((t=>"top"===t||"bottom"===t))||"auto"},delete i.orientation}if(void 0!==i.todayBtnMode){switch(i.todayBtnMode){case 0:case 1:s.todayBtnMode=i.todayBtnMode}delete i.todayBtnMode}return Object.keys(i).forEach((t=>{void 0!==i[t]&&hasProperty(defaultOptions,t)&&(s[t]=i[t])})),s}const pickerTemplate=optimizeTemplateHTML('<div class="datepicker">\n <div class="datepicker-picker">\n <div class="datepicker-header">\n <div class="datepicker-title"></div>\n <div class="datepicker-controls">\n <button type="button" class="%buttonClass% prev-btn"></button>\n <button type="button" class="%buttonClass% view-switch"></button>\n <button type="button" class="%buttonClass% next-btn"></button>\n </div>\n </div>\n <div class="datepicker-main"></div>\n <div class="datepicker-footer">\n <div class="datepicker-controls">\n <button type="button" class="%buttonClass% today-btn"></button>\n <button type="button" class="%buttonClass% clear-btn"></button>\n </div>\n </div>\n </div>\n</div>'),daysTemplate=optimizeTemplateHTML(`<div class="days">\n <div class="days-of-week">${createTagRepeat("span",7,{class:"dow"})}</div>\n <div class="datepicker-grid">${createTagRepeat("span",42)}</div>\n</div>`),calendarWeeksTemplate=optimizeTemplateHTML(`<div class="calendar-weeks">\n <div class="days-of-week"><span class="dow"></span></div>\n <div class="weeks">${createTagRepeat("span",6,{class:"week"})}</div>\n</div>`);class View{constructor(t,e){Object.assign(this,e,{picker:t,element:parseHTML('<div class="datepicker-view"></div>').firstChild,selected:[]}),this.init(this.picker.datepicker.config)}init(t){void 0!==t.pickLevel&&(this.isMinView=this.id===t.pickLevel),this.setOptions(t),this.updateFocus(),this.updateSelection()}performBeforeHook(t,e,i){let s=this.beforeShow(new Date(i));switch(typeof s){case"boolean":s={enabled:s};break;case"string":s={classes:s}}if(s){if(!1===s.enabled&&(t.classList.add("disabled"),pushUnique(this.disabled,e)),s.classes){const i=s.classes.split(/\s+/);t.classList.add(...i),i.includes("disabled")&&pushUnique(this.disabled,e)}s.content&&replaceChildNodes(t,s.content)}}}class DaysView extends View{constructor(t){super(t,{id:0,name:"days",cellClass:"day"})}init(t,e=!0){if(e){const t=parseHTML(daysTemplate).firstChild;this.dow=t.firstChild,this.grid=t.lastChild,this.element.appendChild(t)}super.init(t)}setOptions(t){let e;if(hasProperty(t,"minDate")&&(this.minDate=t.minDate),hasProperty(t,"maxDate")&&(this.maxDate=t.maxDate),t.datesDisabled&&(this.datesDisabled=t.datesDisabled),t.daysOfWeekDisabled&&(this.daysOfWeekDisabled=t.daysOfWeekDisabled,e=!0),t.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=t.daysOfWeekHighlighted),void 0!==t.todayHighlight&&(this.todayHighlight=t.todayHighlight),void 0!==t.weekStart&&(this.weekStart=t.weekStart,this.weekEnd=t.weekEnd,e=!0),t.locale){const i=this.locale=t.locale;this.dayNames=i.daysMin,this.switchLabelFormat=i.titleFormat,e=!0}if(void 0!==t.beforeShowDay&&(this.beforeShow="function"==typeof t.beforeShowDay?t.beforeShowDay:void 0),void 0!==t.calendarWeeks)if(t.calendarWeeks&&!this.calendarWeeks){const t=parseHTML(calendarWeeksTemplate).firstChild;this.calendarWeeks={element:t,dow:t.firstChild,weeks:t.lastChild},this.element.insertBefore(t,this.element.firstChild)}else this.calendarWeeks&&!t.calendarWeeks&&(this.element.removeChild(this.calendarWeeks.element),this.calendarWeeks=null);void 0!==t.showDaysOfWeek&&(t.showDaysOfWeek?(showElement(this.dow),this.calendarWeeks&&showElement(this.calendarWeeks.dow)):(hideElement(this.dow),this.calendarWeeks&&hideElement(this.calendarWeeks.dow))),e&&Array.from(this.dow.children).forEach(((t,e)=>{const i=(this.weekStart+e)%7;t.textContent=this.dayNames[i],t.className=this.daysOfWeekDisabled.includes(i)?"dow disabled":"dow"}))}updateFocus(){const t=new Date(this.picker.viewDate),e=t.getFullYear(),i=t.getMonth(),s=dateValue(e,i,1),n=dayOfTheWeekOf(s,this.weekStart,this.weekStart);this.first=s,this.last=dateValue(e,i+1,0),this.start=n,this.focused=this.picker.viewDate}updateSelection(){const{dates:t,rangepicker:e}=this.picker.datepicker;this.selected=t,e&&(this.range=e.dates)}render(){this.today=this.todayHighlight?today():void 0,this.disabled=[...this.datesDisabled];const t=formatDate(this.focused,this.switchLabelFormat,this.locale);if(this.picker.setViewSwitchLabel(t),this.picker.setPrevBtnDisabled(this.first<=this.minDate),this.picker.setNextBtnDisabled(this.last>=this.maxDate),this.calendarWeeks){const t=dayOfTheWeekOf(this.first,1,1);Array.from(this.calendarWeeks.weeks.children).forEach(((e,i)=>{e.textContent=getWeek(addWeeks(t,i))}))}Array.from(this.grid.children).forEach(((t,e)=>{const i=t.classList,s=addDays(this.start,e),n=new Date(s),r=n.getDay();if(t.className=`datepicker-cell ${this.cellClass}`,t.dataset.date=s,t.textContent=n.getDate(),s<this.first?i.add("prev"):s>this.last&&i.add("next"),this.today===s&&i.add("today"),(s<this.minDate||s>this.maxDate||this.disabled.includes(s))&&i.add("disabled"),this.daysOfWeekDisabled.includes(r)&&(i.add("disabled"),pushUnique(this.disabled,s)),this.daysOfWeekHighlighted.includes(r)&&i.add("highlighted"),this.range){const[t,e]=this.range;s>t&&s<e&&i.add("range"),s===t&&i.add("range-start"),s===e&&i.add("range-end")}this.selected.includes(s)&&i.add("selected"),s===this.focused&&i.add("focused"),this.beforeShow&&this.performBeforeHook(t,s,s)}))}refresh(){const[t,e]=this.range||[];this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach((t=>{t.classList.remove("range","range-start","range-end","selected","focused")})),Array.from(this.grid.children).forEach((i=>{const s=Number(i.dataset.date),n=i.classList;s>t&&s<e&&n.add("range"),s===t&&n.add("range-start"),s===e&&n.add("range-end"),this.selected.includes(s)&&n.add("selected"),s===this.focused&&n.add("focused")}))}refreshFocus(){const t=Math.round((this.focused-this.start)/864e5);this.grid.querySelectorAll(".focused").forEach((t=>{t.classList.remove("focused")})),this.grid.children[t].classList.add("focused")}}function computeMonthRange(t,e){if(!t||!t[0]||!t[1])return;const[[i,s],[n,r]]=t;return i>e||n<e?void 0:[i===e?s:-1,n===e?r:12]}class MonthsView extends View{constructor(t){super(t,{id:1,name:"months",cellClass:"month"})}init(t,e=!0){e&&(this.grid=this.element,this.element.classList.add("months","datepicker-grid"),this.grid.appendChild(parseHTML(createTagRepeat("span",12,{"data-month":t=>t})))),super.init(t)}setOptions(t){if(t.locale&&(this.monthNames=t.locale.monthsShort),hasProperty(t,"minDate"))if(void 0===t.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const e=new Date(t.minDate);this.minYear=e.getFullYear(),this.minMonth=e.getMonth(),this.minDate=e.setDate(1)}if(hasProperty(t,"maxDate"))if(void 0===t.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const e=new Date(t.maxDate);this.maxYear=e.getFullYear(),this.maxMonth=e.getMonth(),this.maxDate=dateValue(this.maxYear,this.maxMonth+1,0)}this.isMinView?t.datesDisabled&&(this.datesDisabled=t.datesDisabled):this.datesDisabled=[],void 0!==t.beforeShowMonth&&(this.beforeShow="function"==typeof t.beforeShowMonth?t.beforeShowMonth:void 0)}updateFocus(){const t=new Date(this.picker.viewDate);this.year=t.getFullYear(),this.focused=t.getMonth()}updateSelection(){const{dates:t,rangepicker:e}=this.picker.datepicker;this.selected=t.reduce(((t,e)=>{const i=new Date(e),s=i.getFullYear(),n=i.getMonth();return void 0===t[s]?t[s]=[n]:pushUnique(t[s],n),t}),{}),e&&e.dates&&(this.range=e.dates.map((t=>{const e=new Date(t);return isNaN(e)?void 0:[e.getFullYear(),e.getMonth()]})))}render(){this.disabled=this.datesDisabled.reduce(((t,e)=>{const i=new Date(e);return this.year===i.getFullYear()&&t.push(i.getMonth()),t}),[]),this.picker.setViewSwitchLabel(this.year),this.picker.setPrevBtnDisabled(this.year<=this.minYear),this.picker.setNextBtnDisabled(this.year>=this.maxYear);const t=this.selected[this.year]||[],e=this.year<this.minYear||this.year>this.maxYear,i=this.year===this.minYear,s=this.year===this.maxYear,n=computeMonthRange(this.range,this.year);Array.from(this.grid.children).forEach(((r,o)=>{const a=r.classList,h=dateValue(this.year,o,1);if(r.className=`datepicker-cell ${this.cellClass}`,this.isMinView&&(r.dataset.date=h),r.textContent=this.monthNames[o],(e||i&&o<this.minMonth||s&&o>this.maxMonth||this.disabled.includes(o))&&a.add("disabled"),n){const[t,e]=n;o>t&&o<e&&a.add("range"),o===t&&a.add("range-start"),o===e&&a.add("range-end")}t.includes(o)&&a.add("selected"),o===this.focused&&a.add("focused"),this.beforeShow&&this.performBeforeHook(r,o,h)}))}refresh(){const t=this.selected[this.year]||[],[e,i]=computeMonthRange(this.range,this.year)||[];this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach((t=>{t.classList.remove("range","range-start","range-end","selected","focused")})),Array.from(this.grid.children).forEach(((s,n)=>{const r=s.classList;n>e&&n<i&&r.add("range"),n===e&&r.add("range-start"),n===i&&r.add("range-end"),t.includes(n)&&r.add("selected"),n===this.focused&&r.add("focused")}))}refreshFocus(){this.grid.querySelectorAll(".focused").forEach((t=>{t.classList.remove("focused")})),this.grid.children[this.focused].classList.add("focused")}}function toTitleCase(t){return[...t].reduce(((t,e,i)=>t+(i?e:e.toUpperCase())),"")}class YearsView extends View{constructor(t,e){super(t,e)}init(t,e=!0){e&&(this.navStep=10*this.step,this.beforeShowOption=`beforeShow${toTitleCase(this.cellClass)}`,this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid"),this.grid.appendChild(parseHTML(createTagRepeat("span",12)))),super.init(t)}setOptions(t){if(hasProperty(t,"minDate")&&(void 0===t.minDate?this.minYear=this.minDate=void 0:(this.minYear=startOfYearPeriod(t.minDate,this.step),this.minDate=dateValue(this.minYear,0,1))),hasProperty(t,"maxDate")&&(void 0===t.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=startOfYearPeriod(t.maxDate,this.step),this.maxDate=dateValue(this.maxYear,11,31))),this.isMinView?t.datesDisabled&&(this.datesDisabled=t.datesDisabled):this.datesDisabled=[],void 0!==t[this.beforeShowOption]){const e=t[this.beforeShowOption];this.beforeShow="function"==typeof e?e:void 0}}updateFocus(){const t=new Date(this.picker.viewDate),e=startOfYearPeriod(t,this.navStep),i=e+9*this.step;this.first=e,this.last=i,this.start=e-this.step,this.focused=startOfYearPeriod(t,this.step)}updateSelection(){const{dates:t,rangepicker:e}=this.picker.datepicker;this.selected=t.reduce(((t,e)=>pushUnique(t,startOfYearPeriod(e,this.step))),[]),e&&e.dates&&(this.range=e.dates.map((t=>{if(void 0!==t)return startOfYearPeriod(t,this.step)})))}render(){this.disabled=this.datesDisabled.map((t=>new Date(t).getFullYear())),this.picker.setViewSwitchLabel(`${this.first}-${this.last}`),this.picker.setPrevBtnDisabled(this.first<=this.minYear),this.picker.setNextBtnDisabled(this.last>=this.maxYear),Array.from(this.grid.children).forEach(((t,e)=>{const i=t.classList,s=this.start+e*this.step,n=dateValue(s,0,1);if(t.className=`datepicker-cell ${this.cellClass}`,this.isMinView&&(t.dataset.date=n),t.textContent=t.dataset.year=s,0===e?i.add("prev"):11===e&&i.add("next"),(s<this.minYear||s>this.maxYear||this.disabled.includes(s))&&i.add("disabled"),this.range){const[t,e]=this.range;s>t&&s<e&&i.add("range"),s===t&&i.add("range-start"),s===e&&i.add("range-end")}this.selected.includes(s)&&i.add("selected"),s===this.focused&&i.add("focused"),this.beforeShow&&this.performBeforeHook(t,s,n)}))}refresh(){const[t,e]=this.range||[];this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach((t=>{t.classList.remove("range","range-start","range-end","selected","focused")})),Array.from(this.grid.children).forEach((i=>{const s=Number(i.textContent),n=i.classList;s>t&&s<e&&n.add("range"),s===t&&n.add("range-start"),s===e&&n.add("range-end"),this.selected.includes(s)&&n.add("selected"),s===this.focused&&n.add("focused")}))}refreshFocus(){const t=Math.round((this.focused-this.start)/this.step);this.grid.querySelectorAll(".focused").forEach((t=>{t.classList.remove("focused")})),this.grid.children[t].classList.add("focused")}}function triggerDatepickerEvent(t,e){const i={date:t.getDate(),viewDate:new Date(t.picker.viewDate),viewId:t.picker.currentView.id,datepicker:t};t.element.dispatchEvent(new CustomEvent(e,{detail:i}))}function goToPrevOrNext(t,e){const{minDate:i,maxDate:s}=t.config,{currentView:n,viewDate:r}=t.picker;let o;switch(n.id){case 0:o=addMonths(r,e);break;case 1:o=addYears(r,e);break;default:o=addYears(r,e*n.navStep)}o=limitToRange(o,i,s),t.picker.changeFocus(o).render()}function switchView(t){const e=t.picker.currentView.id;e!==t.config.maxView&&t.picker.changeView(e+1).render()}function unfocus(t){t.config.updateOnBlur?t.update({revert:!0}):t.refresh("input"),t.hide()}function goToSelectedMonthOrYear(t,e){const i=t.picker,s=new Date(i.viewDate),n=i.currentView.id,r=1===n?addMonths(s,e-s.getMonth()):addYears(s,e-s.getFullYear());i.changeFocus(r).changeView(n-1).render()}function onClickTodayBtn(t){const e=t.picker,i=today();if(1===t.config.todayBtnMode){if(t.config.autohide)return void t.setDate(i);t.setDate(i,{render:!1}),e.update()}e.viewDate!==i&&e.changeFocus(i),e.changeView(0).render()}function onClickClearBtn(t){t.setDate({clear:!0})}function onClickViewSwitch(t){switchView(t)}function onClickPrevBtn(t){goToPrevOrNext(t,-1)}function onClickNextBtn(t){goToPrevOrNext(t,1)}function onClickView(t,e){const i=findElementInEventPath(e,".datepicker-cell");if(!i||i.classList.contains("disabled"))return;const{id:s,isMinView:n}=t.picker.currentView;n?t.setDate(Number(i.dataset.date)):goToSelectedMonthOrYear(t,Number(1===s?i.dataset.month:i.dataset.year))}function onMousedownPicker(t){t.preventDefault()}const orientClasses=["left","top","right","bottom"].reduce(((t,e)=>(t[e]=`datepicker-orient-${e}`,t)),{}),toPx=t=>t?`${t}px`:t;function processPickerOptions(t,e){if(void 0!==e.title&&(e.title?(t.controls.title.textContent=e.title,showElement(t.controls.title)):(t.controls.title.textContent="",hideElement(t.controls.title))),e.prevArrow){const i=t.controls.prevBtn;emptyChildNodes(i),e.prevArrow.forEach((t=>{i.appendChild(t.cloneNode(!0))}))}if(e.nextArrow){const i=t.controls.nextBtn;emptyChildNodes(i),e.nextArrow.forEach((t=>{i.appendChild(t.cloneNode(!0))}))}if(e.locale&&(t.controls.todayBtn.textContent=e.locale.today,t.controls.clearBtn.textContent=e.locale.clear),void 0!==e.todayBtn&&(e.todayBtn?showElement(t.controls.todayBtn):hideElement(t.controls.todayBtn)),hasProperty(e,"minDate")||hasProperty(e,"maxDate")){const{minDate:e,maxDate:i}=t.datepicker.config;t.controls.todayBtn.disabled=!isInRange(today(),e,i)}void 0!==e.clearBtn&&(e.clearBtn?showElement(t.controls.clearBtn):hideElement(t.controls.clearBtn))}function computeResetViewDate(t){const{dates:e,config:i}=t;return limitToRange(e.length>0?lastItemOf(e):i.defaultViewDate,i.minDate,i.maxDate)}function setViewDate(t,e){const i=new Date(t.viewDate),s=new Date(e),{id:n,year:r,first:o,last:a}=t.currentView,h=s.getFullYear();switch(t.viewDate=e,h!==i.getFullYear()&&triggerDatepickerEvent(t.datepicker,"changeYear"),s.getMonth()!==i.getMonth()&&triggerDatepickerEvent(t.datepicker,"changeMonth"),n){case 0:return e<o||e>a;case 1:return h!==r;default:return h<o||h>a}}function getTextDirection(t){return window.getComputedStyle(t).direction}function findScrollParents(t){const e=getParent(t);if(e!==document.body&&e)return"visible"!==window.getComputedStyle(e).overflow?e:findScrollParents(e)}class Picker{constructor(t){const{config:e}=this.datepicker=t,i=pickerTemplate.replace(/%buttonClass%/g,e.buttonClass),s=this.element=parseHTML(i).firstChild,[n,r,o]=s.firstChild.children,a=n.firstElementChild,[h,c,l]=n.lastElementChild.children,[d,u]=o.firstChild.children,f={title:a,prevBtn:h,viewSwitch:c,nextBtn:l,todayBtn:d,clearBtn:u};this.main=r,this.controls=f,s.classList.add("datepicker-"+(t.inline?"inline":"dropdown")),processPickerOptions(this,e),this.viewDate=computeResetViewDate(t),registerListeners(t,[[s,"mousedown",onMousedownPicker],[r,"click",onClickView.bind(null,t)],[f.viewSwitch,"click",onClickViewSwitch.bind(null,t)],[f.prevBtn,"click",onClickPrevBtn.bind(null,t)],[f.nextBtn,"click",onClickNextBtn.bind(null,t)],[f.todayBtn,"click",onClickTodayBtn.bind(null,t)],[f.clearBtn,"click",onClickClearBtn.bind(null,t)]]),this.views=[new DaysView(this),new MonthsView(this),new YearsView(this,{id:2,name:"years",cellClass:"year",step:1}),new YearsView(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[e.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),e.container?e.container.appendChild(this.element):t.inputField.after(this.element)}setOptions(t){processPickerOptions(this,t),this.views.forEach((e=>{e.init(t,!1)})),this.currentView.render()}detach(){this.element.remove()}show(){if(this.active)return;const{datepicker:t,element:e}=this;if(t.inline)e.classList.add("active");else{const i=getTextDirection(t.inputField);i!==getTextDirection(getParent(e))?e.dir=i:e.dir&&e.removeAttribute("dir"),e.style.visiblity="hidden",e.classList.add("active"),this.place(),e.style.visiblity="",t.config.disableTouchKeyboard&&t.inputField.blur()}this.active=!0,triggerDatepickerEvent(t,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,triggerDatepickerEvent(this.datepicker,"hide"))}place(){const{classList:t,offsetParent:e,style:i}=this.element,{config:s,inputField:n}=this.datepicker,{width:r,height:o}=this.element.getBoundingClientRect(),{left:a,top:h,right:c,bottom:l,width:d,height:u}=n.getBoundingClientRect();let{x:f,y:p}=s.orientation,g=a,m=h;if(e!==document.body&&e){const t=e.getBoundingClientRect();g-=t.left-e.scrollLeft,m-=t.top-e.scrollTop}else g+=window.scrollX,m+=window.scrollY;const b=findScrollParents(n);let A=0,v=0,{clientWidth:w,clientHeight:k}=document.documentElement;if(b){const t=b.getBoundingClientRect();t.top>0&&(v=t.top),t.left>0&&(A=t.left),t.right<w&&(w=t.right),t.bottom<k&&(k=t.bottom)}let y=0;"auto"===f&&(a<A?(f="left",y=A-a):a+r>w?(f="right",w<c&&(y=w-c)):f="rtl"===getTextDirection(n)?c-r<A?"left":"right":"left"),"right"===f&&(g+=d-r),g+=y,"auto"===p&&(p=h-o>v&&l+o>k?"top":"bottom"),"top"===p?m-=o:m+=u,t.remove(...Object.values(orientClasses)),t.add(orientClasses[f],orientClasses[p]),i.left=toPx(g),i.top=toPx(m)}setViewSwitchLabel(t){this.controls.viewSwitch.textContent=t}setPrevBtnDisabled(t){this.controls.prevBtn.disabled=t}setNextBtnDisabled(t){this.controls.nextBtn.disabled=t}changeView(t){const e=this.currentView,i=this.views[t];return i.id!==e.id&&(this.currentView=i,this._renderMethod="render",triggerDatepickerEvent(this.datepicker,"changeView"),this.main.replaceChild(i.element,e.element)),this}changeFocus(t){return this._renderMethod=setViewDate(this,t)?"render":"refreshFocus",this.views.forEach((t=>{t.updateFocus()})),this}update(){const t=computeResetViewDate(this.datepicker);return this._renderMethod=setViewDate(this,t)?"render":"refresh",this.views.forEach((t=>{t.updateFocus(),t.updateSelection()})),this}render(t=!0){const e=t&&this._renderMethod||"render";delete this._renderMethod,this.currentView[e]()}}function findNextAvailableOne(t,e,i,s,n,r){if(isInRange(t,n,r))return s(t)?findNextAvailableOne(e(t,i),e,i,s,n,r):t}function moveByArrowKey(t,e,i,s){const n=t.picker,r=n.currentView,o=r.step||1;let a,h,c=n.viewDate;switch(r.id){case 0:c=s?addDays(c,7*i):e.ctrlKey||e.metaKey?addYears(c,i):addDays(c,i),a=addDays,h=t=>r.disabled.includes(t);break;case 1:c=addMonths(c,s?4*i:i),a=addMonths,h=t=>{const e=new Date(t),{year:i,disabled:s}=r;return e.getFullYear()===i&&s.includes(e.getMonth())};break;default:c=addYears(c,i*(s?4:1)*o),a=addYears,h=t=>r.disabled.includes(startOfYearPeriod(t,o))}c=findNextAvailableOne(c,a,i<0?-o:o,h,r.minDate,r.maxDate),void 0!==c&&n.changeFocus(c).render()}function onKeydown(t,e){const i=e.key;if("Tab"===i)return void unfocus(t);const s=t.picker,{id:n,isMinView:r}=s.currentView;if(s.active){if(t.editMode)return void("Enter"===i?t.exitEditMode({update:!0,autohide:t.config.autohide}):"Escape"===i&&s.hide());if("ArrowLeft"===i)if(e.ctrlKey||e.metaKey)goToPrevOrNext(t,-1);else{if(e.shiftKey)return void t.enterEditMode();moveByArrowKey(t,e,-1,!1)}else if("ArrowRight"===i)if(e.ctrlKey||e.metaKey)goToPrevOrNext(t,1);else{if(e.shiftKey)return void t.enterEditMode();moveByArrowKey(t,e,1,!1)}else if("ArrowUp"===i)if(e.ctrlKey||e.metaKey)switchView(t);else{if(e.shiftKey)return void t.enterEditMode();moveByArrowKey(t,e,-1,!0)}else if("ArrowDown"===i){if(e.shiftKey&&!e.ctrlKey&&!e.metaKey)return void t.enterEditMode();moveByArrowKey(t,e,1,!0)}else{if("Enter"!==i)return void("Escape"===i?s.hide():"Backspace"!==i&&"Delete"!==i&&(1!==i.length||e.ctrlKey||e.metaKey)||t.enterEditMode());if(r)return void t.setDate(s.viewDate);s.changeView(n-1).render()}}else{if("ArrowDown"!==i)return void("Enter"===i?t.update():"Escape"===i&&s.show());s.show()}e.preventDefault()}function onFocus(t){t.config.showOnFocus&&!t._showing&&t.show()}function onMousedown(t,e){const i=e.target;(t.picker.active||t.config.showOnClick)&&(i._active=isActiveElement(i),i._clicking=setTimeout((()=>{delete i._active,delete i._clicking}),2e3))}function onClickInput(t,e){const i=e.target;i._clicking&&(clearTimeout(i._clicking),delete i._clicking,i._active&&t.enterEditMode(),delete i._active,t.config.showOnClick&&t.show())}function onPaste(t,e){e.clipboardData.types.includes("text/plain")&&t.enterEditMode()}function onClickOutside(t,e){const{element:i,picker:s}=t;if(!s.active&&!isActiveElement(i))return;const n=s.element;findElementInEventPath(e,(t=>t===i||t===n))||unfocus(t)}function stringifyDates(t,e){return t.map((t=>formatDate(t,e.format,e.locale))).join(e.dateDelimiter)}function processInputDates(t,e,i=!1){const{config:s,dates:n,rangeSideIndex:r}=t;if(0===e.length)return i?[]:void 0;let o=e.reduce(((t,e)=>{let i=parseDate(e,s.format,s.locale);return void 0===i||(i=regularizeDate(i,s.pickLevel,r),!isInRange(i,s.minDate,s.maxDate)||t.includes(i)||s.datesDisabled.includes(i)||!(s.pickLevel>0)&&s.daysOfWeekDisabled.includes(new Date(i).getDay())||t.push(i)),t}),[]);return 0!==o.length?(s.multidate&&!i&&(o=o.reduce(((t,e)=>(n.includes(e)||t.push(e),t)),n.filter((t=>!o.includes(t))))),s.maxNumberOfDates&&o.length>s.maxNumberOfDates?o.slice(-1*s.maxNumberOfDates):o):void 0}function refreshUI(t,e=3,i=!0){const{config:s,picker:n,inputField:r}=t;if(2&e){const t=n.active?s.pickLevel:s.startView;n.update().changeView(t).render(i)}1&e&&r&&(r.value=stringifyDates(t.dates,s))}function setDate(t,e,i){let{clear:s,render:n,autohide:r,revert:o}=i;void 0===n&&(n=!0),n?void 0===r&&(r=t.config.autohide):r=!1;const a=processInputDates(t,e,s);(a||o)&&(a&&a.toString()!==t.dates.toString()?(t.dates=a,refreshUI(t,n?3:1),triggerDatepickerEvent(t,"changeDate")):refreshUI(t,1),r&&t.hide())}class Datepicker{constructor(t,e={},i){t.datepicker=this,this.element=t;const s=this.config=Object.assign({buttonClass:e.buttonClass&&String(e.buttonClass)||"button",container:null,defaultViewDate:today(),maxDate:void 0,minDate:void 0},processOptions(defaultOptions,this)),n=this.inline="INPUT"!==t.tagName;let r,o;if(n?s.container=t:(e.container&&(s.container=e.container instanceof HTMLElement?e.container:document.querySelector(e.container)),r=this.inputField=t,r.classList.add("datepicker-input")),i){const t=i.inputs.indexOf(r),e=i.datepickers;if(t<0||t>1||!Array.isArray(e))throw Error("Invalid rangepicker object.");e[t]=this,Object.defineProperty(this,"rangepicker",{get:()=>i}),Object.defineProperty(this,"rangeSideIndex",{get:()=>t})}this._options=e,Object.assign(s,processOptions(e,this)),n?(o=stringToArray(t.dataset.date,s.dateDelimiter),delete t.dataset.date):o=stringToArray(r.value,s.dateDelimiter),this.dates=[];const a=processInputDates(this,o);a&&a.length>0&&(this.dates=a),r&&(r.value=stringifyDates(this.dates,s));const h=this.picker=new Picker(this);if(n)this.show();else{const t=onClickOutside.bind(null,this);registerListeners(this,[[r,"keydown",onKeydown.bind(null,this)],[r,"focus",onFocus.bind(null,this)],[r,"mousedown",onMousedown.bind(null,this)],[r,"click",onClickInput.bind(null,this)],[r,"paste",onPaste.bind(null,this)],[document,"mousedown",t],[document,"touchstart",t],[window,"resize",h.place.bind(h)]])}}static formatDate(t,e,i){return formatDate(t,e,i&&locales[i]||locales.en)}static parseDate(t,e,i){return parseDate(t,e,i&&locales[i]||locales.en)}static get locales(){return locales}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(t){const e=this.picker,i=processOptions(t,this);Object.assign(this._options,t),Object.assign(this.config,i),e.setOptions(i),refreshUI(this,3)}show(){if(this.inputField){if(this.inputField.disabled)return;isActiveElement(this.inputField)||this.config.disableTouchKeyboard||(this._showing=!0,this.inputField.focus(),delete this._showing)}this.picker.show()}hide(){this.inline||(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}destroy(){return this.hide(),unregisterListeners(this),this.picker.detach(),this.inline||this.inputField.classList.remove("datepicker-input"),delete this.element.datepicker,this}getDate(t){const e=t?e=>formatDate(e,t,this.config.locale):t=>new Date(t);return this.config.multidate?this.dates.map(e):this.dates.length>0?e(this.dates[0]):void 0}setDate(...t){const e=[...t],i={},s=lastItemOf(t);"object"!=typeof s||Array.isArray(s)||s instanceof Date||!s||Object.assign(i,e.pop()),setDate(this,Array.isArray(e[0])?e[0]:e,i)}update(t){if(this.inline)return;const e=Object.assign(t||{},{clear:!0,render:!0});setDate(this,stringToArray(this.inputField.value,this.config.dateDelimiter),e)}refresh(t,e=!1){let i;t&&"string"!=typeof t&&(e=t,t=void 0),i="picker"===t?2:"input"===t?1:3,refreshUI(this,i,!e)}enterEditMode(){this.inline||!this.picker.active||this.editMode||(this.editMode=!0,this.inputField.classList.add("in-edit"))}exitEditMode(t){if(this.inline||!this.editMode)return;const e=Object.assign({update:!1},t);delete this.editMode,this.inputField.classList.remove("in-edit"),e.update&&this.update(e)}}const verdocsFieldDateCss=".datepicker{display:none}.datepicker.active{display:block}.datepicker-dropdown{position:absolute;top:0;left:0;z-index:20;padding-top:4px}.datepicker-dropdown.datepicker-orient-top{padding-top:0;padding-bottom:4px}.datepicker-picker{display:inline-block;border-radius:4px;background-color:white}.datepicker-dropdown .datepicker-picker{-webkit-box-shadow:0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);box-shadow:0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1)}.datepicker-picker span{display:block;-ms-flex:1;flex:1;border:0;border-radius:4px;cursor:default;text-align:center;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.datepicker-main{padding:2px}.datepicker-footer{-webkit-box-shadow:inset 0 1px 1px rgba(10, 10, 10, 0.1);box-shadow:inset 0 1px 1px rgba(10, 10, 10, 0.1);background-color:whitesmoke}.datepicker-grid,.datepicker-view .days-of-week,.datepicker-view,.datepicker-controls{display:-ms-flexbox;display:flex}.datepicker-grid{-ms-flex-wrap:wrap;flex-wrap:wrap}.datepicker-view .days .datepicker-cell,.datepicker-view .dow{-ms-flex-preferred-size:14.2857142857%;flex-basis:14.2857142857%}.datepicker-view.datepicker-grid .datepicker-cell{-ms-flex-preferred-size:25%;flex-basis:25%}.datepicker-cell,.datepicker-view .week{height:2.25rem;line-height:2.25rem}.datepicker-title{-webkit-box-shadow:inset 0 -1px 1px rgba(10, 10, 10, 0.1);box-shadow:inset 0 -1px 1px rgba(10, 10, 10, 0.1);background-color:whitesmoke;padding:0.375rem 0.75rem;text-align:center;font-weight:700}.datepicker-header .datepicker-controls{padding:2px 2px 0}.datepicker-controls .button{display:-ms-inline-flexbox;display:inline-flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin:0;border:1px solid #dbdbdb;border-radius:4px;-webkit-box-shadow:none;box-shadow:none;background-color:white;cursor:pointer;padding:calc(0.375em - 1px) 0.75em;height:2.25em;vertical-align:top;text-align:center;line-height:1.5;white-space:nowrap;color:#363636;font-size:1rem}.datepicker-controls .button:focus,.datepicker-controls .button:active{outline:none}.datepicker-controls .button:hover{border-color:#b5b5b5;color:#363636}.datepicker-controls .button:focus{border-color:#3273dc;color:#363636}.datepicker-controls .button:focus:not(:active){-webkit-box-shadow:0 0 0 0.125em rgba(50, 115, 220, 0.25);box-shadow:0 0 0 0.125em rgba(50, 115, 220, 0.25)}.datepicker-controls .button:active{border-color:#4a4a4a;color:#363636}.datepicker-controls .button[disabled]{cursor:not-allowed}.datepicker-header .datepicker-controls .button{border-color:transparent;font-weight:bold}.datepicker-header .datepicker-controls .button:hover{background-color:#f9f9f9}.datepicker-header .datepicker-controls .button:focus:not(:active){-webkit-box-shadow:0 0 0 0.125em rgba(255, 255, 255, 0.25);box-shadow:0 0 0 0.125em rgba(255, 255, 255, 0.25)}.datepicker-header .datepicker-controls .button:active{background-color:#f2f2f2}.datepicker-header .datepicker-controls .button[disabled]{-webkit-box-shadow:none;box-shadow:none}.datepicker-footer .datepicker-controls .button{margin:calc(0.375rem - 1px) 0.375rem;border-radius:2px;width:100%;font-size:0.75rem}.datepicker-controls .view-switch{-ms-flex:auto;flex:auto}.datepicker-controls .prev-btn,.datepicker-controls .next-btn{padding-right:0.375rem;padding-left:0.375rem;width:2.25rem}.datepicker-controls .prev-btn.disabled,.datepicker-controls .next-btn.disabled{visibility:hidden}.datepicker-view .dow{height:1.5rem;line-height:1.5rem;font-size:0.875rem;font-weight:700}.datepicker-view .week{width:2.25rem;color:#b5b5b5;font-size:0.75rem}@media (max-width: 22.5rem){.datepicker-view .week{width:1.96875rem}}.datepicker-grid{width:15.75rem}@media (max-width: 22.5rem){.calendar-weeks+.days .datepicker-grid{width:13.78125rem}}.datepicker-cell:not(.disabled):hover{background-color:#f9f9f9;cursor:pointer}.datepicker-cell.focused:not(.selected){background-color:#e8e8e8}.datepicker-cell.selected,.datepicker-cell.selected:hover{background-color:#3273dc;color:#fff;font-weight:600}.datepicker-cell.disabled{color:#dbdbdb}.datepicker-cell.prev:not(.disabled),.datepicker-cell.next:not(.disabled){color:#7a7a7a}.datepicker-cell.prev.selected,.datepicker-cell.next.selected{color:#e6e6e6}.datepicker-cell.highlighted:not(.selected):not(.range):not(.today){border-radius:0;background-color:whitesmoke}.datepicker-cell.highlighted:not(.selected):not(.range):not(.today):not(.disabled):hover{background-color:#eeeeee}.datepicker-cell.highlighted:not(.selected):not(.range):not(.today).focused{background-color:#e8e8e8}.datepicker-cell.today:not(.selected){background-color:#00d1b2}.datepicker-cell.today:not(.selected):not(.disabled){color:#fff}.datepicker-cell.today.focused:not(.selected){background-color:#00c4a7}.datepicker-cell.range-end:not(.selected),.datepicker-cell.range-start:not(.selected){background-color:#b5b5b5;color:#fff}.datepicker-cell.range-end.focused:not(.selected),.datepicker-cell.range-start.focused:not(.selected){background-color:#afafaf}.datepicker-cell.range-start{border-radius:4px 0 0 4px}.datepicker-cell.range-end{border-radius:0 4px 4px 0}.datepicker-cell.range{border-radius:0;background-color:#dbdbdb}.datepicker-cell.range:not(.disabled):not(.focused):not(.today):hover{background-color:#d5d5d5}.datepicker-cell.range.disabled{color:#c2c2c2}.datepicker-cell.range.focused{background-color:#cfcfcf}.datepicker-view.datepicker-grid .datepicker-cell{height:4.5rem;line-height:4.5rem}.datepicker-input.in-edit{border-color:#2366d1}.datepicker-input.in-edit:focus,.datepicker-input.in-edit:active{-webkit-box-shadow:0 0 0.25em 0.25em rgba(35, 102, 209, 0.2);box-shadow:0 0 0.25em 0.25em rgba(35, 102, 209, 0.2)}verdocs-field-date{font-family:sans-serif;font-family:var(--verdocs-font);width:64px;height:15px;display:block;font-size:11px;position:relative;letter-spacing:0.3px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-date input{-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px;border:1px solid #ccc;-webkit-appearance:none;-moz-appearance:none;appearance:none}verdocs-field-date input.hide{display:none}verdocs-field-date.required input{border:1px solid var(--verdocs-required-color)}verdocs-field-date.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";let VerdocsFieldDate=class{constructor(t){registerInstance(this,t),this.fieldFocus=createEvent(this,"fieldFocus",7),this.fieldBlur=createEvent(this,"fieldBlur",7),this.fieldChange=createEvent(this,"fieldChange",7),this.fieldInput=createEvent(this,"fieldInput",7),this.placeholder="Select Date",this.order=1,this.value="",this.required=!1,this.disabled=!1,this.focused=!1}async focusField(){this.focused=!0,this.el.focus(),this.fieldFocus.emit(!0)}componentDidLoad(){new Datepicker(this.el,{autohide:!0,todayHighlight:!0}),this.el.addEventListener("changeDate",(t=>{console.log("changeDate",t.detail.date.toISOString())}))}handleBlur(){this.focused=!1,this.fieldBlur.emit(!0)}handleFocus(){this.focused=!0,this.fieldFocus.emit(!0)}handleChange(t){this.fieldChange.emit(t.target.value)}handleInput(t){this.fieldInput.emit(t.target.value)}render(){return h(Host,{class:{focused:this.focused,required:this.required,storybook:!!(null===window||void 0===window?void 0:window.STORYBOOK_ENV)}},h("input",{type:"text",value:"",placeholder:this.placeholder,required:this.required,ref:t=>this.el=t,onBlur:()=>this.handleBlur(),onFocus:()=>this.handleFocus(),onChange:t=>this.handleChange(t),onInput:t=>this.handleInput(t)}))}};VerdocsFieldDate.style=verdocsFieldDateCss;const verdocsFieldDropdownCss="verdocs-field-dropdown{font-family:sans-serif;font-family:var(--verdocs-font);width:85px;height:20px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-dropdown select{position:absolute;background:linear-gradient(55deg, transparent 50%, #333 50%), linear-gradient(125deg, #333 50%, transparent 50%), linear-gradient(to right, transparent, transparent);background-position:calc(100% - 7px) 4px, calc(100% - 3px) 4px, 100% 0;background-size:5px 5px, 5px 5px, 2.5em 2.5em;background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;font-size:11px;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-dropdown select:focus{outline:none}verdocs-field-dropdown select.hide{display:none}verdocs-field-dropdown.required select{border:1px solid var(--verdocs-required-color)}verdocs-field-dropdown.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";let VerdocsFieldDropdown=class{constructor(t){registerInstance(this,t),this.fieldFocus=createEvent(this,"fieldFocus",7),this.fieldBlur=createEvent(this,"fieldBlur",7),this.fieldChange=createEvent(this,"fieldChange",7),this.options=[],this.required=!1,this.order=1,this.disabled=!1,this.value="",this.focused=!1}async focusField(){this.focused=!0,this.el.focus(),this.fieldFocus.emit(!0)}handleBlur(){this.focused=!1,this.fieldBlur.emit(!0)}handleFocus(){this.focused=!0,this.fieldFocus.emit(!0)}handleChange(t){this.fieldChange.emit(t.target.value)}render(){return h(Host,{class:{focused:this.focused,required:this.required}},h("select",{tabIndex:this.order,disabled:this.disabled,ref:t=>this.el=t,onChange:t=>this.handleChange(t),onBlur:()=>this.handleBlur(),onFocus:()=>this.handleFocus()},h("option",{value:""},"Select..."),this.options.map((t=>h("option",{value:t.id,selected:t.value===this.value},t.value)))))}};VerdocsFieldDropdown.style=verdocsFieldDropdownCss;const verdocsFieldInitialCss="verdocs-field-initial{font-family:sans-serif;font-family:var(--verdocs-font);width:83px;height:36px;display:block;font-size:11px;letter-spacing:0.3px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-initial img{display:block;max-width:100%;max-height:100%}verdocs-field-initial button{-webkit-box-sizing:border-box;box-sizing:border-box;border:none;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-initial button.hide{display:none}verdocs-field-initial.required{border:1px solid var(--verdocs-required-color)}verdocs-field-initial.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";let VerdocsFieldInitial=class{constructor(t){registerInstance(this,t),this.adopt=createEvent(this,"adopt",7),this.cancel=createEvent(this,"cancel",7),this.required=!1,this.fullName="",this.value=""}async focusField(){this.handleShow()}handleShow(){this.dialog=document.createElement("verdocs-initial-dialog"),this.dialog.open=!0,this.dialog.fullName=this.fullName,this.dialog.addEventListener("cancel",(()=>{var t;console.log("cancel"),null===(t=this.dialog)||void 0===t||t.remove()})),document.addEventListener("adopt",(t=>{var e;console.log("adopt",t),null===(e=this.dialog)||void 0===e||e.remove()})),document.body.append(this.dialog)}render(){return h(Host,{class:{required:this.required}},""!==this.value?h("img",{src:this.value,alt:"Initials"}):h("button",{class:{},onClick:()=>this.handleShow()},"Initial"))}};VerdocsFieldInitial.style=verdocsFieldInitialCss;const verdocsFieldPaymentCss="verdocs-field-payment{font-family:sans-serif;font-family:var(--verdocs-font);width:24px;height:24px;display:block;font-size:11px;position:relative;border:1px solid #cfa;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-payment button,verdocs-field-payment div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-field-payment button{color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-payment button.hide{display:none}verdocs-field-payment input{float:left;font-family:Arial, sans-serif}verdocs-field-payment select{position:absolute;font-family:Arial, sans-serif;background:linear-gradient(55deg, transparent 50%, #333 50%), linear-gradient(125deg, #333 50%, transparent 50%), linear-gradient(to right, transparent, transparent);background-position:calc(100% - 7px) 4px, calc(100% - 3px) 4px, 100% 0;background-size:5px 5px, 5px 5px, 2.5em 2.5em;background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none}verdocs-field-payment .frame{width:100%;height:100%;background-size:contain;text-align:left}verdocs-field-payment .frame img{position:absolute;height:auto;width:100%}verdocs-field-payment.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";let VerdocsFieldPayment=class{constructor(t){registerInstance(this,t),this.signatureComplete=createEvent(this,"signatureComplete",7),this.initialComplete=createEvent(this,"initialComplete",7),this.focused=!1,this.signed=!1,this.signatureUrl="",this._fields=[],this.signatureFile=null,this.initialFile=null,this.focusOrderNumber=-1,this.focusFieldName="",this.activeElement=null,this.showError={pageNum:-1,fieldIndex:-1,type:null},this.dialogOpened=!1,this.closeAllErrors=!1,this.fieldsMap={},this.fieldsForCurrentSigner=[],this.fontSize=11,this.averageFontWidth=5,this.requiredFields=[]}componentWillLoad(){if(console.log("sign field",this.field),this.recipients&&this.recipients.length>0){const t=this.recipients.find((t=>"preparer"===t.type));console.log("Found preparer",t),t&&(this.preparedMessage=`Prepared by ${t.full_name}`)}}render(){return h(Host,{class:{focused:this.focused,storybook:!!(null===window||void 0===window?void 0:window.STORYBOOK_ENV)}},h("button",{class:{hide:this.signed}},"Payment"),h("div",this.signed?{class:"frame"}:{style:{display:"none"}}),h("img",{width:"100%",height:"100%",src:this.signatureUrl}))}};VerdocsFieldPayment.style=verdocsFieldPaymentCss;const verdocsFieldRadioButtonCss='verdocs-field-radio-button{font-family:sans-serif;font-family:var(--verdocs-font);width:14px;height:14px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:100%}verdocs-field-radio-button input[type=radio]{position:absolute;opacity:0}verdocs-field-radio-button input[type=radio]+label:before{content:"";background:#f4f4f4;border-radius:100%;border:1px solid rgba(0, 0, 0, 0.2);display:inline-block;width:13px;height:13px;position:relative;top:2px;margin-right:2px;vertical-align:top;cursor:pointer;text-align:center;-webkit-transition:all 250ms ease;transition:all 250ms ease}verdocs-field-radio-button input[type=radio]:checked+label:before{background-color:#55bc81;-webkit-box-shadow:inset 0 0 0 2px #f4f4f4;box-shadow:inset 0 0 0 2px #f4f4f4}verdocs-field-radio-button input[type=radio]:focus+label:before{outline:none;border-color:#55bc81}verdocs-field-radio-button input[type=radio]:disabled+label:before{-webkit-box-shadow:inset 0 0 0 4px #f4f4f4;box-shadow:inset 0 0 0 4px #f4f4f4;border-color:#b4b4b4;background:#b4b4b4}verdocs-field-radio-button input[type=radio]+label:empty:before{margin-right:0}verdocs-field-radio-button.required input[type=radio]+label:before{border:1px solid var(--verdocs-required-color)}verdocs-field-radio-button.hide{display:none}verdocs-field-radio-button.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}';let VerdocsFieldRadioButton=class{constructor(t){registerInstance(this,t),this.fieldChange=createEvent(this,"fieldChange",7),this.order=1,this.checked=!1,this.value="",this.name="",this.required=!1,this.disabled=!1}handleChange(t){console.log("changed",t),this.fieldChange.emit(t.target.checked)}render(){return h(Host,{class:{required:this.required,storybook:!!(null===window||void 0===window?void 0:window.STORYBOOK_ENV)}},h("input",{type:"radio",tabIndex:this.order,value:this.value,name:this.name,id:`${this.name}=${this.value}`,checked:this.checked,disabled:this.disabled,required:this.required,onChange:t=>this.handleChange(t)}),h("label",{htmlFor:`${this.name}=${this.value}`}))}};VerdocsFieldRadioButton.style=verdocsFieldRadioButtonCss;const verdocsFieldSignatureCss="verdocs-field-signature{font-family:sans-serif;font-family:var(--verdocs-font);width:83px;height:36px;display:block;font-size:11px;position:relative;letter-spacing:0.3px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-signature img{display:block;max-width:100%;max-height:100%}verdocs-field-signature button{-webkit-box-sizing:border-box;box-sizing:border-box;border:none;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-signature button.hide{display:none}verdocs-field-signature.required{border:1px solid var(--verdocs-required-color)}verdocs-field-signature.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";let VerdocsFieldSignature=class{constructor(t){registerInstance(this,t),this.adopt=createEvent(this,"adopt",7),this.cancel=createEvent(this,"cancel",7),this.required=!1,this.fullName="",this.value=""}async focusField(){this.handleShow()}handleShow(){this.dialog=document.createElement("verdocs-signature-dialog"),this.dialog.open=!0,this.dialog.fullName=this.fullName,this.dialog.addEventListener("cancel",(()=>{var t;console.log("cancel"),null===(t=this.dialog)||void 0===t||t.remove()})),document.addEventListener("adopt",(t=>{var e;console.log("adopt",t),null===(e=this.dialog)||void 0===e||e.remove()})),document.body.append(this.dialog)}render(){return h(Host,{class:{required:this.required}},""!==this.value?h("img",{src:this.value,alt:"Signature"}):h("button",{class:{},onClick:()=>this.handleShow()},"Signature"))}};VerdocsFieldSignature.style=verdocsFieldSignatureCss;const verdocsFieldTextareaCss="verdocs-field-textarea{font-family:sans-serif;font-family:var(--verdocs-font);width:150px;height:15px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-textarea textarea{-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textarea textarea.hide{display:none}verdocs-field-textarea.required{border:1px solid var(--verdocs-required-color)}verdocs-field-textarea.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";let VerdocsFieldTextarea=class{constructor(t){registerInstance(this,t),this.fieldFocus=createEvent(this,"fieldFocus",7),this.fieldBlur=createEvent(this,"fieldBlur",7),this.fieldChange=createEvent(this,"fieldChange",7),this.fieldInput=createEvent(this,"fieldInput",7),this.placeholder="",this.order=1,this.value="",this.required=!1,this.disabled=!1,this.focused=!1}async focusField(){this.focused=!0,this.el.focus(),this.fieldFocus.emit(!0)}handleBlur(){this.focused=!1,this.fieldBlur.emit(!0)}handleFocus(){this.focused=!0,this.fieldFocus.emit(!0)}handleChange(t){this.fieldChange.emit(t.target.value)}handleInput(t){this.fieldInput.emit(t.target.value)}render(){return h(Host,{class:{focused:this.focused,required:this.required,storybook:!!(null===window||void 0===window?void 0:window.STORYBOOK_ENV)}},h("textarea",{placeholder:this.placeholder||"",tabIndex:this.order,value:this.value,disabled:this.disabled,required:this.required,ref:t=>this.el=t,onBlur:()=>this.handleBlur(),onFocus:()=>this.handleFocus(),onChange:t=>this.handleChange(t),onInput:t=>this.handleInput(t)}))}};VerdocsFieldTextarea.style=verdocsFieldTextareaCss;const verdocsFieldTextboxCss="verdocs-field-textbox{font-family:sans-serif;font-family:var(--verdocs-font);width:150px;height:15px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-textbox input{-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textbox input.hide{display:none}verdocs-field-textbox.required{border:1px solid var(--verdocs-required-color)}verdocs-field-textbox.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";let VerdocsFieldTextbox=class{constructor(t){registerInstance(this,t),this.fieldFocus=createEvent(this,"fieldFocus",7),this.fieldBlur=createEvent(this,"fieldBlur",7),this.fieldChange=createEvent(this,"fieldChange",7),this.fieldInput=createEvent(this,"fieldInput",7),this.placeholder="",this.order=1,this.value="",this.required=!1,this.disabled=!1,this.focused=!1}async focusField(){this.focused=!0,this.el.focus(),this.fieldFocus.emit(!0)}handleBlur(){this.focused=!1,this.fieldBlur.emit(!0)}handleFocus(){this.focused=!0,this.fieldFocus.emit(!0)}handleChange(t){this.fieldChange.emit(t.target.value)}handleInput(t){this.fieldInput.emit(t.target.value)}render(){return h(Host,{class:{focused:this.focused,required:this.required}},h("input",{type:"text",placeholder:this.placeholder||"",tabIndex:this.order,value:this.value,disabled:this.disabled,required:this.required,ref:t=>this.el=t,onBlur:()=>this.handleBlur(),onFocus:()=>this.handleFocus(),onChange:t=>this.handleChange(t),onInput:t=>this.handleInput(t)}))}};VerdocsFieldTextbox.style=verdocsFieldTextboxCss;const _nodeResolve_empty={},_nodeResolve_empty$1=Object.freeze({__proto__:null,default:_nodeResolve_empty}),require$$5=getAugmentedNamespace(_nodeResolve_empty$1);var pdf=createCommonjsModule((function(module,exports){
2
+ /**
3
+ * @licstart The following is the entire license notice for the
4
+ * Javascript code in this page
5
+ *
6
+ * Copyright 2021 Mozilla Foundation
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * @licend The above is the entire license notice for the
21
+ * Javascript code in this page
22
+ */
23
+ var factory;factory=function(){return(()=>{var __webpack_modules__=[,(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.LinkTarget=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=void 0,e.addLinkAttributes=function(t,{url:e,target:i,rel:n,enabled:r=!0}={}){(0,s.assert)(e&&"string"==typeof e,'addLinkAttributes: A valid "url" parameter must provided.');const o=(0,s.removeNullCharacters)(e);r?t.href=t.title=o:(t.href="",t.title=`Disabled: ${o}`,t.onclick=()=>!1);let h="";switch(i){case a.NONE:break;case a.SELF:h="_self";break;case a.BLANK:h="_blank";break;case a.PARENT:h="_parent";break;case a.TOP:h="_top"}t.target=h,t.rel="string"==typeof n?n:"noopener noreferrer nofollow"},e.deprecated=function(t){console.log("Deprecated API usage: "+t)},e.getFilenameFromUrl=function(t){const e=t.indexOf("#"),i=t.indexOf("?"),s=Math.min(e>0?e:t.length,i>0?i:t.length);return t.substring(t.lastIndexOf("/",s)+1,s)},e.getPdfFilenameFromUrl=function(t,e="document.pdf"){if("string"!=typeof t)return e;if(h(t))return(0,s.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let r=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(r&&(r=r[0],r.includes("%")))try{r=i.exec(decodeURIComponent(r))[0]}catch(t){}return r||e},e.getXfaPageViewport=function(t,{scale:e=1,rotation:i=0}){const{width:s,height:n}=t.attributes.style,r=[0,0,parseInt(s),parseInt(n)];return new o({viewBox:r,scale:e,rotation:i})},e.isDataScheme=h,e.isPdfFile=function(t){return"string"==typeof t&&/\.pdf$/i.test(t)},e.isValidFetchUrl=c,e.loadScript=function(t,e=!1){return new Promise(((i,s)=>{const n=document.createElement("script");n.src=t,n.onload=function(t){e&&n.remove(),i(t)},n.onerror=function(){s(new Error(`Cannot load script at: ${n.src}`))},(document.head||document.documentElement).appendChild(n)}))};var s=i(2),n=i(5);async function r(t,e=!1){if(c(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);return e?new Uint8Array(await i.arrayBuffer()):(0,s.stringToBytes)(await i.text())}return new Promise(((i,n)=>{const r=new XMLHttpRequest;r.open("GET",t,!0),e&&(r.responseType="arraybuffer"),r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(200===r.status||0===r.status){let t;if(e&&r.response?t=new Uint8Array(r.response):!e&&r.responseText&&(t=(0,s.stringToBytes)(r.responseText)),t)return void i(t)}n(new Error(r.statusText))}},r.send(null)}))}e.PixelsPerInch={CSS:96,PDF:72,get PDF_TO_CSS_UNITS(){return(0,s.shadow)(this,"PDF_TO_CSS_UNITS",this.CSS/this.PDF)}},e.DOMCanvasFactory=class extends n.BaseCanvasFactory{constructor({ownerDocument:t=globalThis.document}={}){super(),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}},e.DOMCMapReaderFactory=class extends n.BaseCMapReaderFactory{_fetchData(t,e){return r(t,this.isCompressed).then((t=>({cMapData:t,compressionType:e})))}},e.DOMStandardFontDataFactory=class extends n.BaseStandardFontDataFactory{_fetchData(t){return r(t,!0)}},e.DOMSVGFactory=class extends n.BaseSVGFactory{_createSVG(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}};class o{constructor({viewBox:t,scale:e,rotation:i,offsetX:s=0,offsetY:n=0,dontFlip:r=!1}){this.viewBox=t,this.scale=e,this.rotation=i,this.offsetX=s,this.offsetY=n;const o=(t[2]+t[0])/2,a=(t[3]+t[1])/2;let h,c,l,d,u,f,p,g;switch((i%=360)<0&&(i+=360),i){case 180:h=-1,c=0,l=0,d=1;break;case 90:h=0,c=1,l=1,d=0;break;case 270:h=0,c=-1,l=-1,d=0;break;case 0:h=1,c=0,l=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}r&&(l=-l,d=-d),0===h?(u=Math.abs(a-t[1])*e+s,f=Math.abs(o-t[0])*e+n,p=Math.abs(t[3]-t[1])*e,g=Math.abs(t[2]-t[0])*e):(u=Math.abs(o-t[0])*e+s,f=Math.abs(a-t[1])*e+n,p=Math.abs(t[2]-t[0])*e,g=Math.abs(t[3]-t[1])*e),this.transform=[h*e,c*e,l*e,d*e,u-h*e*o-l*e*a,f-c*e*o-d*e*a],this.width=p,this.height=g}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:s=this.offsetY,dontFlip:n=!1}={}){return new o({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:s,dontFlip:n})}convertToViewportPoint(t,e){return s.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=s.Util.applyTransform([t[0],t[1]],this.transform),i=s.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return s.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=o,e.RenderingCancelledException=class extends s.BaseException{constructor(t,e){super(t,"RenderingCancelledException"),this.type=e}};const a={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};function h(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function c(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch(t){return!1}}let l;e.LinkTarget=a,e.StatTimer=class{constructor(){this.started=Object.create(null),this.times=[]}time(t){t in this.started&&(0,s.warn)(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,s.warn)(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const t of this.times){const i=t.name;i.length>e&&(e=i.length)}for(const i of this.times){const s=i.end-i.start;t.push(`${i.name.padEnd(e)} ${s}ms\n`)}return t.join("")}},e.PDFDateString=class{static toDateObject(t){if(!t||!(0,s.isString)(t))return null;l||(l=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=l.exec(t);if(!e)return null;const i=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let r=parseInt(e[3],10);r=r>=1&&r<=31?r:1;let o=parseInt(e[4],10);o=o>=0&&o<=23?o:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let h=parseInt(e[6],10);h=h>=0&&h<=59?h:0;const c=e[7]||"Z";let d=parseInt(e[8],10);d=d>=0&&d<=23?d:0;let u=parseInt(e[9],10)||0;return u=u>=0&&u<=59?u:0,"-"===c?(o+=d,a+=u):"+"===c&&(o-=d,a-=u),new Date(Date.UTC(i,n,r,o,a,h))}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.UNSUPPORTED_FEATURES=e.TextRenderingMode=e.StreamType=e.RenderingIntentFlag=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.IsLittleEndianCached=e.IsEvalSupportedCached=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FontType=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.AnnotationType=e.AnnotationStateModelType=e.AnnotationReviewState=e.AnnotationReplyType=e.AnnotationMode=e.AnnotationMarkedState=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0,e.arrayByteLength=f,e.arraysToBytes=function(t){const e=t.length;if(1===e&&t[0]instanceof Uint8Array)return t[0];let i=0;for(let s=0;s<e;s++)i+=f(t[s]);let s=0;const n=new Uint8Array(i);for(let i=0;i<e;i++){let e=t[i];e instanceof Uint8Array||(e="string"==typeof e?u(e):new Uint8Array(e));const r=e.byteLength;n.set(e,s),s+=r}return n},e.assert=a,e.bytesToString=function(t){a(null!==t&&"object"==typeof t&&void 0!==t.length,"Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const s=[];for(let n=0;n<e;n+=i){const r=Math.min(n+i,e),o=t.subarray(n,r);s.push(String.fromCharCode.apply(null,o))}return s.join("")},e.createObjectURL=function(t,e="",i=!1){if(URL.createObjectURL&&"undefined"!=typeof Blob&&!i)return URL.createObjectURL(new Blob([t],{type:e}));const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let n=`data:${e};base64,`;for(let e=0,i=t.length;e<i;e+=3){const r=255&t[e],o=255&t[e+1],a=255&t[e+2];n+=s[r>>2]+s[(3&r)<<4|o>>4]+s[e+1<i?(15&o)<<2|a>>6:64]+s[e+2<i?63&a:64]}return n},e.createPromiseCapability=function(){const t=Object.create(null);let e=!1;return Object.defineProperty(t,"settled",{get:()=>e}),t.promise=new Promise((function(i,s){t.resolve=function(t){e=!0,i(t)},t.reject=function(t){e=!0,s(t)}})),t},e.createValidAbsoluteUrl=function(t,e=null,i=null){if(!t)return null;try{if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e&&e.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=b(t)}catch(t){}}const s=e?new URL(t,e):new URL(t);if(function(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(s))return s}catch(t){}return null},e.escapeString=function(t){return t.replace(/([()\\\n\r])/g,(t=>"\n"===t?"\\n":"\r"===t?"\\r":`\\${t}`))},e.getModificationDate=function(t=new Date){return[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")},e.getVerbosityLevel=function(){return n},e.info=function(t){n>=s.INFOS&&console.log(`Info: ${t}`)},e.isArrayBuffer=function(t){return"object"==typeof t&&null!==t&&void 0!==t.byteLength},e.isArrayEqual=function(t,e){if(t.length!==e.length)return!1;for(let i=0,s=t.length;i<s;i++)if(t[i]!==e[i])return!1;return!0},e.isAscii=function(t){return/^[\x00-\x7F]*$/.test(t)},e.isBool=function(t){return"boolean"==typeof t},e.isNum=function(t){return"number"==typeof t},e.isSameOrigin=function(t,e){let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch(t){return!1}const s=new URL(e,i);return i.origin===s.origin},e.isString=function(t){return"string"==typeof t},e.objectFromMap=function(t){const e=Object.create(null);for(const[i,s]of t)e[i]=s;return e},e.objectSize=function(t){return Object.keys(t).length},e.removeNullCharacters=function(t,e=!1){return"string"!=typeof t?(r("The argument for removeNullCharacters must be a string."),t):(e&&(t=t.replace(d," ")),t.replace(l,""))},e.setVerbosityLevel=function(t){Number.isInteger(t)&&(n=t)},e.shadow=h,e.string32=function(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)},e.stringToBytes=u,e.stringToPDFString=function(t){const e=t.length,i=[];if("þ"===t[0]&&"ÿ"===t[1])for(let s=2;s<e;s+=2)i.push(String.fromCharCode(t.charCodeAt(s)<<8|t.charCodeAt(s+1)));else if("ÿ"===t[0]&&"þ"===t[1])for(let s=2;s<e;s+=2)i.push(String.fromCharCode(t.charCodeAt(s+1)<<8|t.charCodeAt(s)));else for(let s=0;s<e;++s){const e=m[t.charCodeAt(s)];i.push(e?String.fromCharCode(e):t.charAt(s))}return i.join("")},e.stringToUTF16BEString=function(t){const e=["þÿ"];for(let i=0,s=t.length;i<s;i++){const s=t.charCodeAt(i);e.push(String.fromCharCode(s>>8&255),String.fromCharCode(255&s))}return e.join("")},e.stringToUTF8String=b,e.unreachable=o,e.utf8StringToString=function(t){return unescape(encodeURIComponent(t))},e.warn=r,i(3),e.IDENTITY_MATRIX=[1,0,0,1,0,0],e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],e.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},e.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},e.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},e.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},e.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},e.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},e.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"},e.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"},e.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"},e.AnnotationReplyType={GROUP:"Group",REPLY:"R"},e.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},e.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864},e.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},e.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},e.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},e.PageActionEventType={O:"PageOpen",C:"PageClose"},e.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"},e.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};const s={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=s,e.CMapCompressionType={NONE:0,BINARY:1,STREAM:2},e.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},e.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"},e.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let n=s.WARNINGS;function r(t){n>=s.WARNINGS&&console.log(`Warning: ${t}`)}function o(t){throw new Error(t)}function a(t,e){t||o(e)}function h(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!1}),i}const c=function(){function t(e,i){this.constructor===t&&o("Cannot initialize BaseException."),this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();e.BaseException=c,e.PasswordException=class extends c{constructor(t,e){super(t,"PasswordException"),this.code=e}},e.UnknownErrorException=class extends c{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},e.InvalidPDFException=class extends c{constructor(t){super(t,"InvalidPDFException")}},e.MissingPDFException=class extends c{constructor(t){super(t,"MissingPDFException")}},e.UnexpectedResponseException=class extends c{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}},e.FormatError=class extends c{constructor(t){super(t,"FormatError")}},e.AbortException=class extends c{constructor(t){super(t,"AbortException")}};const l=/\x00+/g,d=/[\x01-\x1F]/g;function u(t){a("string"==typeof t,"Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let s=0;s<e;++s)i[s]=255&t.charCodeAt(s);return i}function f(t){return void 0!==t.length?t.length:(a(void 0!==t.byteLength,"arrayByteLength - invalid argument."),t.byteLength)}e.IsLittleEndianCached={get value(){return h(this,"value",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}},e.IsEvalSupportedCached={get value(){return h(this,"value",function(){try{return new Function(""),!0}catch(t){return!1}}())}};const p=[...Array(256).keys()].map((t=>t.toString(16).padStart(2,"0")));class g{static makeHexColor(t,e,i){return`#${p[t]}${p[e]}${p[i]}`}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){const i=g.applyTransform(t,e),s=g.applyTransform(t.slice(2,4),e),n=g.applyTransform([t[0],t[3]],e),r=g.applyTransform([t[2],t[1]],e);return[Math.min(i[0],s[0],n[0],r[0]),Math.min(i[1],s[1],n[1],r[1]),Math.max(i[0],s[0],n[0],r[0]),Math.max(i[1],s[1],n[1],r[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static apply3dTransform(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2],t[3]*e[0]+t[4]*e[1]+t[5]*e[2],t[6]*e[0]+t[7]*e[1]+t[8]*e[2]]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],s=t[2]*e[1]+t[3]*e[3],n=(i+s)/2,r=Math.sqrt((i+s)**2-4*(i*s-(t[2]*e[0]+t[3]*e[2])*(t[0]*e[1]+t[1]*e[3])))/2,o=n-r||1;return[Math.sqrt(n+r||1),Math.sqrt(o)]}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){function i(t,e){return t-e}const s=[t[0],t[2],e[0],e[2]].sort(i),n=[t[1],t[3],e[1],e[3]].sort(i),r=[];return t=g.normalizeRect(t),e=g.normalizeRect(e),s[0]===t[0]&&s[1]===e[0]||s[0]===e[0]&&s[1]===t[0]?(r[0]=s[1],r[2]=s[2],n[0]===t[1]&&n[1]===e[1]||n[0]===e[1]&&n[1]===t[1]?(r[1]=n[1],r[3]=n[2],r):null):null}static bezierBoundingBox(t,e,i,s,n,r,o,a){const h=[],c=[[],[]];let l,d,u,f,p,g,m,b;for(let c=0;c<2;++c)if(0===c?(d=6*t-12*i+6*n,l=-3*t+9*i-9*n+3*o,u=3*i-3*t):(d=6*e-12*s+6*r,l=-3*e+9*s-9*r+3*a,u=3*s-3*e),Math.abs(l)<1e-12){if(Math.abs(d)<1e-12)continue;f=-u/d,0<f&&f<1&&h.push(f)}else m=d*d-4*u*l,b=Math.sqrt(m),m<0||(p=(-d+b)/(2*l),0<p&&p<1&&h.push(p),g=(-d-b)/(2*l),0<g&&g<1&&h.push(g));let A,v=h.length;const w=v;for(;v--;)f=h[v],A=1-f,c[0][v]=A*A*A*t+3*A*A*f*i+3*A*f*f*n+f*f*f*o,c[1][v]=A*A*A*e+3*A*A*f*s+3*A*f*f*r+f*f*f*a;return c[0][w]=t,c[1][w]=e,c[0][w+1]=o,c[1][w+1]=a,c[0].length=c[1].length=w+2,[Math.min(...c[0]),Math.min(...c[1]),Math.max(...c[0]),Math.max(...c[1])]}}e.Util=g;const m=[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 b(t){return decodeURIComponent(escape(t))}},(t,e,i)=>{i(4)},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNodeJS=void 0,e.isNodeJS=!("object"!=typeof process_1||process_1+""!="[object process]"||process_1.versions.nw||process_1.versions.electron&&process_1.type&&"browser"!==process_1.type)},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;var s=i(2);class n{constructor(){this.constructor===n&&(0,s.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d")}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){(0,s.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=n;class r{constructor({baseUrl:t=null,isCompressed:e=!1}){this.constructor===r&&(0,s.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetchData(e,this.isCompressed?s.CMapCompressionType.BINARY:s.CMapCompressionType.NONE).catch((()=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)}))}_fetchData(t,e){(0,s.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=r;class o{constructor({baseUrl:t=null}){this.constructor===o&&(0,s.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetchData(e).catch((()=>{throw new Error(`Unable to load font data at: ${e}`)}))}_fetchData(t){(0,s.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=o;class a{constructor(){this.constructor===a&&(0,s.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),i.setAttribute("width",`${t}px`),i.setAttribute("height",`${e}px`),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${t} ${e}`),i}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,s.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=a},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,exports.version=void 0;var _util=__w_pdfjs_require__(2),_display_utils=__w_pdfjs_require__(1),_font_loader=__w_pdfjs_require__(7),_node_utils=__w_pdfjs_require__(8),_annotation_storage=__w_pdfjs_require__(9),_canvas=__w_pdfjs_require__(10),_worker_options=__w_pdfjs_require__(12),_is_node=__w_pdfjs_require__(4),_message_handler=__w_pdfjs_require__(13),_metadata=__w_pdfjs_require__(14),_optional_content_config=__w_pdfjs_require__(15),_transport_stream=__w_pdfjs_require__(16),_xfa_text=__w_pdfjs_require__(17);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DefaultCanvasFactory=_is_node.isNodeJS?_node_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_is_node.isNodeJS?_node_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultStandardFontDataFactory=_is_node.isNodeJS?_node_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;let createPDFNetworkStream;function setPDFNetworkStreamFactory(t){createPDFNetworkStream=t}function getDocument(t){const e=new PDFDocumentLoadingTask;let i;if("string"==typeof t||t instanceof URL)i={url:t};else if((0,_util.isArrayBuffer)(t))i={data:t};else if(t instanceof PDFDataRangeTransport)i={range:t};else{if("object"!=typeof t)throw new Error("Invalid parameter in getDocument, need either string, URL, Uint8Array, or parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");i=t}const s=Object.create(null);let n=null,r=null;for(const t in i){const e=i[t];switch(t){case"url":if("undefined"!=typeof window)try{s[t]=new URL(e,window.location).href;continue}catch(t){(0,_util.warn)(`Cannot create valid URL: "${t}".`)}else if("string"==typeof e||e instanceof URL){s[t]=e.toString();continue}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":n=e;continue;case"worker":r=e;continue;case"data":if(_is_node.isNodeJS&&void 0!==Buffer&&e instanceof Buffer)s[t]=new Uint8Array(e);else{if(e instanceof Uint8Array)break;if("string"==typeof e)s[t]=(0,_util.stringToBytes)(e);else if("object"!=typeof e||null===e||isNaN(e.length)){if(!(0,_util.isArrayBuffer)(e))throw new Error("Invalid PDF binary data: either typed array, string, or array-like object is expected in the data property.");s[t]=new Uint8Array(e)}else s[t]=new Uint8Array(e)}continue}s[t]=e}if(s.rangeChunkSize=s.rangeChunkSize||DEFAULT_RANGE_CHUNK_SIZE,s.CMapReaderFactory=s.CMapReaderFactory||DefaultCMapReaderFactory,s.StandardFontDataFactory=s.StandardFontDataFactory||DefaultStandardFontDataFactory,s.ignoreErrors=!0!==s.stopAtErrors,s.fontExtraProperties=!0===s.fontExtraProperties,s.pdfBug=!0===s.pdfBug,s.enableXfa=!0===s.enableXfa,("string"!=typeof s.docBaseUrl||(0,_display_utils.isDataScheme)(s.docBaseUrl))&&(s.docBaseUrl=null),Number.isInteger(s.maxImageSize)||(s.maxImageSize=-1),"boolean"!=typeof s.useWorkerFetch&&(s.useWorkerFetch=s.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&s.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory),"boolean"!=typeof s.isEvalSupported&&(s.isEvalSupported=!0),"boolean"!=typeof s.disableFontFace&&(s.disableFontFace=_is_node.isNodeJS),"boolean"!=typeof s.useSystemFonts&&(s.useSystemFonts=!_is_node.isNodeJS&&!s.disableFontFace),void 0===s.ownerDocument&&(s.ownerDocument=globalThis.document),"boolean"!=typeof s.disableRange&&(s.disableRange=!1),"boolean"!=typeof s.disableStream&&(s.disableStream=!1),"boolean"!=typeof s.disableAutoFetch&&(s.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(s.verbosity),!r){const t={verbosity:s.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};r=t.port?PDFWorker.fromPort(t):new PDFWorker(t),e._worker=r}const o=e.docId;return r.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");const t=_fetchDocument(r,s,n,o),i=new Promise((function(t){let e;n?e=new _transport_stream.PDFDataTransportStream({length:s.length,initialData:s.initialData,progressiveDone:s.progressiveDone,contentDispositionFilename:s.contentDispositionFilename,disableRange:s.disableRange,disableStream:s.disableStream},n):s.data||(e=createPDFNetworkStream({url:s.url,length:s.length,httpHeaders:s.httpHeaders,withCredentials:s.withCredentials,rangeChunkSize:s.rangeChunkSize,disableRange:s.disableRange,disableStream:s.disableStream})),t(e)}));return Promise.all([t,i]).then((function([t,i]){if(e.destroyed)throw new Error("Loading aborted");const n=new _message_handler.MessageHandler(o,t,r.port),a=new WorkerTransport(n,e,i,s);e._transport=a,n.send("Ready",null)}))})).catch(e._capability.reject),e}async function _fetchDocument(t,e,i,s){if(t.destroyed)throw new Error("Worker was destroyed");i&&(e.length=i.length,e.initialData=i.initialData,e.progressiveDone=i.progressiveDone,e.contentDispositionFilename=i.contentDispositionFilename);const n=await t.messageHandler.sendWithPromise("GetDocRequest",{docId:s,apiVersion:"2.12.313",source:{data:e.data,url:e.url,password:e.password,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize,length:e.length},maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,docBaseUrl:e.docBaseUrl,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,fontExtraProperties:e.fontExtraProperties,enableXfa:e.enableXfa,useSystemFonts:e.useSystemFonts,cMapUrl:e.useWorkerFetch?e.cMapUrl:null,standardFontDataUrl:e.useWorkerFetch?e.standardFontDataUrl:null});if(t.destroyed)throw new Error("Worker was destroyed");return n}exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;class PDFDocumentLoadingTask{static get idCounters(){return(0,_util.shadow)(this,"idCounters",{doc:0})}constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+PDFDocumentLoadingTask.idCounters.doc++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=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(t,e,i=!1,s=null){this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=s,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const i of this._progressListeners)i(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t,this._transport=e,Object.defineProperty(this,"fingerprint",{get(){return(0,_display_utils.deprecated)("`PDFDocumentProxy.fingerprint`, please use `PDFDocumentProxy.fingerprints` instead."),this.fingerprints[0]}}),Object.defineProperty(this,"getStats",{value:async()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getStats`, please use the `PDFDocumentProxy.stats`-getter instead."),this.stats||{streamTypes:{},fontTypes:{}})})}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get stats(){return this._transport.stats}get isPureXfa(){return!!this._transport._htmlForXfa}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}saveDocument(){return this._transport.annotationStorage.size<=0&&(0,_display_utils.deprecated)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this._transport.saveDocument()}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(t,e,i,s,n=!1){this._pageIndex=t,this._pageInfo=e,this._ownerDocument=s,this._transport=i,this._stats=n?new _display_utils.StatTimer:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this._intentStates=new Map,this._annotationPromises=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:s=0,dontFlip:n=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:s,dontFlip:n})}getAnnotations({intent:t="display"}={}){const e=this._transport.getRenderingIntent(t);let i=this._annotationPromises.get(e.cacheKey);return i||(i=this._transport.getAnnotations(this._pageIndex,e.renderingIntent),this._annotationPromises.set(e.cacheKey,i),i=i.then((t=>{for(const e of t)void 0!==e.titleObj&&Object.defineProperty(e,"title",{get:()=>((0,_display_utils.deprecated)("`title`-property on annotation, please use `titleObj` instead."),e.titleObj.str)}),void 0!==e.contentsObj&&Object.defineProperty(e,"contents",{get:()=>((0,_display_utils.deprecated)("`contents`-property on annotation, please use `contentsObj` instead."),e.contentsObj.str)});return t}))),i}getJSActions(){return this._jsActionsPromise||=this._transport.getPageJSActions(this._pageIndex)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:e,intent:i="display",annotationMode:s=_util.AnnotationMode.ENABLE,transform:n=null,imageLayer:r=null,canvasFactory:o=null,background:a=null,optionalContentConfigPromise:h=null,annotationCanvasMap:c=null}){void 0!==arguments[0]?.renderInteractiveForms&&((0,_display_utils.deprecated)("render no longer accepts the `renderInteractiveForms`-option, please use the `annotationMode`-option instead."),!0===arguments[0].renderInteractiveForms&&s===_util.AnnotationMode.ENABLE&&(s=_util.AnnotationMode.ENABLE_FORMS)),void 0!==arguments[0]?.includeAnnotationStorage&&((0,_display_utils.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, please use the `annotationMode`-option instead."),!0===arguments[0].includeAnnotationStorage&&s===_util.AnnotationMode.ENABLE&&(s=_util.AnnotationMode.ENABLE_STORAGE)),this._stats&&this._stats.time("Overall");const l=this._transport.getRenderingIntent(i,s);this.pendingCleanup=!1,h||(h=this._transport.getOptionalContentConfig());let d=this._intentStates.get(l.cacheKey);d||(d=Object.create(null),this._intentStates.set(l.cacheKey,d)),d.streamReaderCancelTimeout&&(clearTimeout(d.streamReaderCancelTimeout),d.streamReaderCancelTimeout=null);const u=o||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),f=!!(l.renderingIntent&_util.RenderingIntentFlag.PRINT);d.displayReadyCapability||(d.displayReadyCapability=(0,_util.createPromiseCapability)(),d.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(l));const p=t=>{d.renderTasks.delete(g),(this.cleanupAfterRender||f)&&(this.pendingCleanup=!0),this._tryCleanup(),t?(g.capability.reject(t),this._abortOperatorList({intentState:d,reason:t instanceof Error?t:new Error(t)})):g.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},g=new InternalRenderTask({callback:p,params:{canvasContext:t,viewport:e,transform:n,imageLayer:r,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:d.operatorList,pageIndex:this._pageIndex,canvasFactory:u,useRequestAnimationFrame:!f,pdfBug:this._pdfBug});(d.renderTasks||=new Set).add(g);const m=g.task;return Promise.all([d.displayReadyCapability.promise,h]).then((([t,e])=>{this.pendingCleanup?p():(this._stats&&this._stats.time("Rendering"),g.initializeGraphics({transparency:t,optionalContentConfig:e}),g.operatorListChanged())})).catch(p),m}getOperatorList({intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE}={}){const i=this._transport.getRenderingIntent(t,e,!0);let s,n=this._intentStates.get(i.cacheKey);return n||(n=Object.create(null),this._intentStates.set(i.cacheKey,n)),n.opListReadCapability||(s=Object.create(null),s.operatorListChanged=function(){n.operatorList.lastChunk&&(n.opListReadCapability.resolve(n.operatorList),n.renderTasks.delete(s))},n.opListReadCapability=(0,_util.createPromiseCapability)(),(n.renderTasks||=new Set).add(s),n.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(i)),n.opListReadCapability.promise}streamTextContent({normalizeWhitespace:t=!1,disableCombineTextItems:e=!1,includeMarkedContent:i=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,normalizeWhitespace:!0===t,combineTextItems:!0!==e,includeMarkedContent:!0===i},{highWaterMark:100,size:t=>t.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then((t=>_xfa_text.XfaText.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,i){const s=e.getReader(),n={items:[],styles:Object.create(null)};!function e(){s.read().then((function({value:i,done:s}){s?t(n):(Object.assign(n.styles,i.styles),n.items.push(...i.items),e())}),i)}()}))}getStructTree(){return this._structTreePromise||=this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,this.pendingCleanup=!1,Promise.all(t)}cleanup(t=!1){return this.pendingCleanup=!0,this._tryCleanup(t)}_tryCleanup(t=!1){if(!this.pendingCleanup)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,t&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,!0}_startRenderPage(t,e){const i=this._intentStates.get(e);i&&(this._stats&&this._stats.timeEnd("Page Request"),i.displayReadyCapability&&i.displayReadyCapability.resolve(t))}_renderPageChunk(t,e){for(let i=0,s=t.length;i<s;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk;for(const t of e.renderTasks)t.operatorListChanged();t.lastChunk&&this._tryCleanup()}_pumpOperatorList({renderingIntent:t,cacheKey:e}){const i=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:t&_util.RenderingIntentFlag.ANNOTATIONS_STORAGE?this._transport.annotationStorage.serializable:null}).getReader(),s=this._intentStates.get(e);s.streamReader=i;const n=()=>{i.read().then((({value:t,done:e})=>{e?s.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,s),n())}),(t=>{if(s.streamReader=null,!this._transport.destroyed){if(s.operatorList){s.operatorList.lastChunk=!0;for(const t of s.renderTasks)t.operatorListChanged();this._tryCleanup()}if(s.displayReadyCapability)s.displayReadyCapability.reject(t);else{if(!s.opListReadCapability)throw t;s.opListReadCapability.reject(t)}}}))};n()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(!i){if(t.renderTasks.size>0)return;if(e instanceof _display_utils.RenderingCancelledException)return void(t.streamReaderCancelTimeout=setTimeout((()=>{this._abortOperatorList({intentState:t,reason:e,force:!0}),t.streamReaderCancelTimeout=null}),RENDERING_CANCELLED_TIMEOUT))}if(t.streamReader.cancel(new _util.AbortException(e.message)).catch((()=>{})),t.streamReader=null,!this._transport.destroyed){for(const[e,i]of this._intentStates)if(i===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){this._listeners=[],this._deferred=Promise.resolve()}postMessage(t,e){const i={data:function(t){if(globalThis.structuredClone)return globalThis.structuredClone(t,e);const i=new WeakMap;return function t(s){if("function"==typeof s||"symbol"==typeof s||s instanceof URL)throw new Error(`LoopbackPort.postMessage - cannot clone: ${s?.toString()}`);if("object"!=typeof s||null===s)return s;if(i.has(s))return i.get(s);let n,r;if((n=s.buffer)&&(0,_util.isArrayBuffer)(n))return r=e?.includes(n)?new s.constructor(n,s.byteOffset,s.byteLength):new s.constructor(s),i.set(s,r),r;if(s instanceof Map){r=new Map,i.set(s,r);for(const[e,i]of s)r.set(e,t(i));return r}if(s instanceof Set){r=new Set,i.set(s,r);for(const e of s)r.add(t(e));return r}r=Array.isArray(s)?[]:Object.create(null),i.set(s,r);for(const e in s){let i,n=s;for(;!(i=Object.getOwnPropertyDescriptor(n,e));)n=Object.getPrototypeOf(n);void 0!==i.value&&("function"!=typeof i.value||s.hasOwnProperty?.(e))&&(r[e]=t(i.value))}return r}(t)}(t)};this._deferred.then((()=>{for(const t of this._listeners)t.call(this,i)}))}addEventListener(t,e){this._listeners.push(e)}removeEventListener(t,e){const i=this._listeners.indexOf(e);this._listeners.splice(i,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(_is_node.isNodeJS&&"function"==typeof commonjsRequire)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){const t=document?.currentScript?.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.createCDNWrapper=function(t){return URL.createObjectURL(new Blob([`importScripts("${t}");`]))};class PDFWorker{static get _workerPorts(){return(0,_util.shadow)(this,"_workerPorts",new WeakMap)}constructor({name:t=null,port:e=null,verbosity:i=(0,_util.getVerbosityLevel)()}={}){if(e&&PDFWorker._workerPorts.has(e))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,e)return PDFWorker._workerPorts.set(e,this),void this._initializeFromPort(e);this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new _message_handler.MessageHandler("main","worker",t),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve()}_initialize(){if("undefined"!=typeof Worker&&!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let t=PDFWorker.workerSrc;try{(0,_util.isSameOrigin)(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t),i=new _message_handler.MessageHandler("main","worker",e),s=()=>{e.removeEventListener("error",n),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},n=()=>{this._webWorker||s()};e.addEventListener("error",n),i.on("test",(t=>{e.removeEventListener("error",n),this.destroyed?s():t?(this._messageHandler=i,this._port=e,this._webWorker=e,this._readyCapability.resolve(),i.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),i.destroy(),e.terminate())})),i.on("ready",(()=>{if(e.removeEventListener("error",n),this.destroyed)s();else try{r()}catch(t){this._setupFakeWorker()}}));const r=()=>{const t=new Uint8Array([255]);try{i.send("test",t,[t.buffer])}catch(e){(0,_util.warn)("Cannot use postMessage transfers."),t[0]=0,i.send("test",t)}};return void r()}catch(t){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then((t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new LoopbackPort;this._port=e;const i="fake"+PDFWorkerUtil.fakeWorkerId++,s=new _message_handler.MessageHandler(i+"_worker",i,e);t.setup(s,e);const n=new _message_handler.MessageHandler(i,i+"_worker",e);this._messageHandler=n,this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})})).catch((t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker._workerPorts.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this._workerPorts.has(t.port)?this._workerPorts.get(t.port):new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch(t){return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&"function"==typeof commonjsRequire){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,PDFWorker.getWorkerSrc=function(){return(0,_display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead."),this.workerSrc};class WorkerTransport{#t=null;#e=new Map;#i=new Map;#s=null;constructor(t,e,i,s){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:e.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:s.ownerDocument,styleElement:s.styleElement}),this._params=s,s.useWorkerFetch||(this.CMapReaderFactory=new s.CMapReaderFactory({baseUrl:s.cMapUrl,isCompressed:s.cMapPacked}),this.StandardFontDataFactory=new s.StandardFontDataFactory({baseUrl:s.standardFontDataUrl})),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}get stats(){return this.#t}getRenderingIntent(t,e=_util.AnnotationMode.ENABLE,i=!1){let s=_util.RenderingIntentFlag.DISPLAY,n="";switch(t){case"any":s=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":s=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case _util.AnnotationMode.DISABLE:s+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:s+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:s+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,n=this.annotationStorage.lastModified;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${e}`)}return i&&(s+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:s,cacheKey:`${s}_${n}`}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const e of this.#e.values())t.push(e._destroy());this.#e.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then((()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#s=null,this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null,this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then((function({value:t,done:i}){i?e.close():((0,_util.assert)((0,_util.isArrayBuffer)(t),"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}})),t.on("ReaderHeadersReady",(()=>{const t=(0,_util.createPromiseCapability)(),i=this._fullReader;return i.headersReady.then((()=>{i.isStreamingSupported&&i.isRangeSupported||(this._lastProgress&&e.onProgress?.(this._lastProgress),i.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}),t.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})}),t.reject),t.promise})),t.on("GetRangeReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);i?(e.onPull=()=>{i.read().then((function({value:t,done:i}){i?e.close():((0,_util.assert)((0,_util.isArrayBuffer)(t),"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{i.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}):e.close()})),t.on("GetDoc",(({pdfInfo:t})=>{this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,e._capability.resolve(new PDFDocumentProxy(t,this))})),t.on("DocException",(function(t){let i;switch(t.name){case"PasswordException":i=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":i=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":i=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":i=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":i=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}e._capability.reject(i)})),t.on("PasswordRequest",(t=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),e.onPassword){const i=t=>{this._passwordCapability.resolve({password:t})};try{e.onPassword(i,t.code)}catch(t){this._passwordCapability.reject(t)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.promise})),t.on("DataLoaded",(t=>{e.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(t=>{this.destroyed||this.#e.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(([e,i,s])=>{if(!this.destroyed&&!this.commonObjs.has(e))switch(i){case"Font":const n=this._params;if("error"in s){const t=s.error;(0,_util.warn)(`Error during font loading: ${t}`),this.commonObjs.resolve(e,t);break}let r=null;n.pdfBug&&globalThis.FontInspector?.enabled&&(r={registerFont(t,e){globalThis.FontInspector.fontAdded(t,e)}});const o=new _font_loader.FontFaceObject(s,{isEvalSupported:n.isEvalSupported,disableFontFace:n.disableFontFace,ignoreErrors:n.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:r});this.fontLoader.bind(o).catch((()=>t.sendWithPromise("FontFallback",{id:e}))).finally((()=>{!n.fontExtraProperties&&o.data&&(o.data=null),this.commonObjs.resolve(e,o)}));break;case"FontPath":case"Image":this.commonObjs.resolve(e,s);break;default:throw new Error(`Got unknown common object type ${i}`)}})),t.on("obj",(([t,e,i,s])=>{if(this.destroyed)return;const n=this.#e.get(e);if(!n.objs.has(t))switch(i){case"Image":n.objs.resolve(t,s),s?.data?.length>8e6&&(n.cleanupAfterRender=!0);break;case"Pattern":n.objs.resolve(t,s);break;default:throw new Error(`Got unknown object type ${i}`)}})),t.on("DocProgress",(t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})})),t.on("DocStats",(t=>{this.destroyed||(this.#t=Object.freeze({streamTypes:Object.freeze(t.streamTypes),fontTypes:Object.freeze(t.fontTypes)}))})),t.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.CMapReaderFactory?this.CMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.StandardFontDataFactory?this.StandardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}_onUnsupportedFeature({featureId:t}){this.destroyed||this.loadingTask.onUnsupportedFeature?.(t)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request"));const e=t-1,i=this.#i.get(e);if(i)return i;const s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((t=>{if(this.destroyed)throw new Error("Transport destroyed");const i=new PDFPageProxy(e,t,this,this._params.ownerDocument,this._params.pdfBug);return this.#e.set(e,i),i}));return this.#i.set(e,s),s}getPageIndex(t){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:t})}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}saveDocument(){return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:this._fullReader?.filename??null}).finally((()=>{this.annotationStorage.resetModified()}))}getFieldObjects(){return this._getFieldObjectsPromise||=this.messageHandler.sendWithPromise("GetFieldObjects",null)}hasJSActions(){return this._hasJSActionsPromise||=this.messageHandler.sendWithPromise("HasJSActions",null)}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((t=>new _optional_content_config.OptionalContentConfig(t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return this.#s||=this.messageHandler.sendWithPromise("GetMetadata",null).then((t=>({info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(await this.messageHandler.sendWithPromise("Cleanup",null),!this.destroyed){for(const t of this.#e.values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#s=null,this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null}}get loadingParams(){const t=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t.disableAutoFetch,enableXfa:t.enableXfa})}}class PDFObjects{constructor(){this._objs=Object.create(null)}_ensureObj(t){return this._objs[t]?this._objs[t]:this._objs[t]={capability:(0,_util.createPromiseCapability)(),data:null,resolved:!1}}get(t,e=null){if(e)return this._ensureObj(t).capability.promise.then(e),null;const i=this._objs[t];if(!i||!i.resolved)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){return this._objs[t]?.resolved||!1}resolve(t,e){const i=this._ensureObj(t);i.resolved=!0,i.data=e,i.capability.resolve(e)}clear(){this._objs=Object.create(null)}}class RenderTask{constructor(t){this._internalRenderTask=t,this.onContinue=null}get promise(){return this._internalRenderTask.capability.promise}cancel(){this._internalRenderTask.cancel()}}exports.RenderTask=RenderTask;class InternalRenderTask{static get canvasInUse(){return(0,_util.shadow)(this,"canvasInUse",new WeakSet)}constructor({callback:t,params:e,objs:i,commonObjs:s,annotationCanvasMap:n,operatorList:r,pageIndex:o,canvasFactory:a,useRequestAnimationFrame:h=!1,pdfBug:c=!1}){this.callback=t,this.params=e,this.objs=i,this.commonObjs=s,this.annotationCanvasMap=n,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=o,this.canvasFactory=a,this._pdfBug=c,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===h&&"undefined"!=typeof window,this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=e.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.canvasInUse.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.canvasInUse.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:i,viewport:s,transform:n,imageLayer:r,background:o}=this.params;this.gfx=new _canvas.CanvasGraphics(i,this.commonObjs,this.objs,this.canvasFactory,r,e,this.annotationCanvasMap),this.gfx.beginDrawing({transform:n,viewport:s,transparency:t,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}cancel(t=null){this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&InternalRenderTask.canvasInUse.delete(this._canvas),this.callback(t||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas"))}operatorListChanged(){this.graphicsReady?(this.stepper&&this.stepper.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame((()=>{this._nextBound().catch(this._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._canvas&&InternalRenderTask.canvasInUse.delete(this._canvas),this.callback())))}}const version="2.12.313";exports.version=version;const build="a2ae56f39";exports.build=build},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0;var s=i(2);class n{constructor({docId:t,onUnsupportedFeature:e,ownerDocument:i=globalThis.document,styleElement:r=null}){this.constructor===n&&(0,s.unreachable)("Cannot initialize BaseFontLoader."),this.docId=t,this._onUnsupportedFeature=e,this._document=i,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(t){this.nativeFontFaces.push(t),this._document.fonts.add(t)}insertRule(t){let e=this.styleElement;e||(e=this.styleElement=this._document.createElement("style"),e.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,this._document.documentElement.getElementsByTagName("head")[0].appendChild(e));const i=e.sheet;i.insertRule(t,i.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(t){if(t.attached||t.missingFile)return;if(t.attached=!0,this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw this._onUnsupportedFeature({featureId:s.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,s.warn)(`Failed to load font '${e.family}': '${i}'.`),t.disableFontFace=!0,i}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise((i=>{const s=this._queueLoadingCallback(i);this._prepareFontLoadEvent([e],[t],s)}))}}_queueLoadingCallback(t){(0,s.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){return(0,s.shadow)(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){(0,s.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,s.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(t,e,i){(0,s.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let r;e.FontLoader=r,e.FontLoader=r=class extends n{constructor(t){super(t),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){let t=!1;return("undefined"==typeof navigator||/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent)?.[1]>=14)&&(t=!0),(0,s.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const e=this.loadingContext,i={id:"pdfjs-font-loading-"+e.nextRequestId++,done:!1,complete:function(){for((0,s.assert)(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.requests.length>0&&e.requests[0].done;){const t=e.requests.shift();setTimeout(t.callback,0)}},callback:t};return e.requests.push(i),i}get _loadTestFont(){return(0,s.shadow)(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e,i){function n(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function r(t,e,i,s){return t.substring(0,e)+s+t.substring(e+i)}let o,a;const h=this._document.createElement("canvas");h.width=1,h.height=1;const c=h.getContext("2d");let l=0;const d=`lt${Date.now()}${this.loadTestFontId++}`;let u=this._loadTestFont;u=r(u,976,d.length,d);const f=1482184792;let p=n(u,16);for(o=0,a=d.length-3;o<a;o+=4)p=p-f+n(d,o)|0;o<d.length&&(p=p-f+n(d+"XXX",o)|0),u=r(u,16,4,(0,s.string32)(p));const g=`url(data:font/opentype;base64,${btoa(u)});`;this.insertRule(`@font-face {font-family:"${d}";src:${g}}`);const m=[];for(const t of e)m.push(t.loadedName);m.push(d);const b=this._document.createElement("div");b.style.visibility="hidden",b.style.width=b.style.height="10px",b.style.position="absolute",b.style.top=b.style.left="0px";for(const t of m){const e=this._document.createElement("span");e.textContent="Hi",e.style.fontFamily=t,b.appendChild(e)}this._document.body.appendChild(b),function t(e,i){if(l++,l>30)return(0,s.warn)("Load test font never loaded."),void i();c.font="30px "+e,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0?i():setTimeout(t.bind(null,e,i))}(d,(()=>{b.remove(),i.complete()}))}},e.FontFaceObject=class{constructor(t,{isEvalSupported:e=!0,disableFontFace:i=!1,ignoreErrors:s=!1,onUnsupportedFeature:n,fontRegistry:r=null}){this.compiledGlyphs=Object.create(null);for(const e in t)this[e]=t[e];this.isEvalSupported=!1!==e,this.disableFontFace=!0===i,this.ignoreErrors=!0===s,this._onUnsupportedFeature=n,this.fontRegistry=r}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=(0,s.bytesToString)(this.data),e=`url(data:${this.mimetype};base64,${btoa(t)});`;let i;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else i=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,e),i}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(t){if(!this.ignoreErrors)throw t;return this._onUnsupportedFeature({featureId:s.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,s.warn)(`getPathGenerator - ignoring character: "${t}".`),this.compiledGlyphs[e]=function(){}}if(this.isEvalSupported&&s.IsEvalSupportedCached.value){const t=[];for(const e of i){const i=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",i,");\n")}return this.compiledGlyphs[e]=new Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(const s of i)"scale"===s.cmd&&(s.args=[e,-e]),t[s.cmd].apply(t,s.args)}}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeStandardFontDataFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;var s=i(5),n=i(4),r=i(2);let o=class{constructor(){(0,r.unreachable)("Not implemented: NodeCanvasFactory")}};e.NodeCanvasFactory=o;let a=class{constructor(){(0,r.unreachable)("Not implemented: NodeCMapReaderFactory")}};e.NodeCMapReaderFactory=a;let h=class{constructor(){(0,r.unreachable)("Not implemented: NodeStandardFontDataFactory")}};if(e.NodeStandardFontDataFactory=h,n.isNodeJS){const t=function(t){return new Promise(((e,i)=>{require$$5.readFile(t,((t,s)=>{!t&&s?e(new Uint8Array(s)):i(new Error(t))}))}))};e.NodeCanvasFactory=o=class extends s.BaseCanvasFactory{_createCanvas(t,e){return require$$5.createCanvas(t,e)}},e.NodeCMapReaderFactory=a=class extends s.BaseCMapReaderFactory{_fetchData(e,i){return t(e).then((t=>({cMapData:t,compressionType:i})))}},e.NodeStandardFontDataFactory=h=class extends s.BaseStandardFontDataFactory{_fetchData(e){return t(e)}}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationStorage=void 0;var s=i(2);e.AnnotationStorage=class{constructor(){this._storage=new Map,this._timeStamp=Date.now(),this._modified=!1,this.onSetModified=null,this.onResetModified=null}getValue(t,e){const i=this._storage.get(t);return void 0===i?e:Object.assign(e,i)}setValue(t,e){const i=this._storage.get(t);let s=!1;if(void 0!==i)for(const[t,n]of Object.entries(e))i[t]!==n&&(s=!0,i[t]=n);else s=!0,this._storage.set(t,e);s&&(this._timeStamp=Date.now(),this._setModified())}getAll(){return this._storage.size>0?(0,s.objectFromMap)(this._storage):null}get size(){return this._storage.size}_setModified(){this._modified||(this._modified=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this._modified&&(this._modified=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get serializable(){return this._storage.size>0?this._storage:null}get lastModified(){return this._timeStamp.toString()}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0;var s=i(2),n=i(11),r=i(1);const o=4096,a=16;function h(t){if(!t.mozCurrentTransform){t._originalSave=t.save,t._originalRestore=t.restore,t._originalRotate=t.rotate,t._originalScale=t.scale,t._originalTranslate=t.translate,t._originalTransform=t.transform,t._originalSetTransform=t.setTransform,t._originalResetTransform=t.resetTransform,t._transformMatrix=t._transformMatrix||[1,0,0,1,0,0],t._transformStack=[];try{const e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),"lineWidth");t._setLineWidth=e.set,t._getLineWidth=e.get,Object.defineProperty(t,"lineWidth",{set:function(t){this._setLineWidth(1.000001*t)},get:function(){return this._getLineWidth()}})}catch(t){}Object.defineProperty(t,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(t,"mozCurrentTransformInverse",{get:function(){const[t,e,i,s,n,r]=this._transformMatrix,o=t*s-e*i,a=e*i-t*s;return[s/o,e/a,i/a,t/o,(s*n-i*r)/a,(e*n-t*r)/o]}}),t.save=function(){const t=this._transformMatrix;this._transformStack.push(t),this._transformMatrix=t.slice(0,6),this._originalSave()},t.restore=function(){const t=this._transformStack.pop();t&&(this._transformMatrix=t,this._originalRestore())},t.translate=function(t,e){const i=this._transformMatrix;i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this._originalTranslate(t,e)},t.scale=function(t,e){const i=this._transformMatrix;i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this._originalScale(t,e)},t.transform=function(e,i,s,n,r,o){const a=this._transformMatrix;this._transformMatrix=[a[0]*e+a[2]*i,a[1]*e+a[3]*i,a[0]*s+a[2]*n,a[1]*s+a[3]*n,a[0]*r+a[2]*o+a[4],a[1]*r+a[3]*o+a[5]],t._originalTransform(e,i,s,n,r,o)},t.setTransform=function(e,i,s,n,r,o){this._transformMatrix=[e,i,s,n,r,o],t._originalSetTransform(e,i,s,n,r,o)},t.resetTransform=function(){this._transformMatrix=[1,0,0,1,0,0],t._originalResetTransform()},t.rotate=function(t){const e=Math.cos(t),i=Math.sin(t),s=this._transformMatrix;this._transformMatrix=[s[0]*e+s[2]*i,s[1]*e+s[3]*i,s[0]*-i+s[2]*e,s[1]*-i+s[3]*e,s[4],s[5]],this._originalRotate(t)}}}class c{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i,s){let n;return void 0!==this.cache[t]?(n=this.cache[t],this.canvasFactory.reset(n,e,i),n.context.setTransform(1,0,0,1,0,0)):(n=this.canvasFactory.create(e,i),this.cache[t]=n),s&&h(n.context),n}clear(){for(const t in this.cache)this.canvasFactory.destroy(this.cache[t]),delete this.cache[t]}}class l{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=s.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=s.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=s.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps=null,this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,i){[e,i]=s.Util.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateCurvePathMinMax(t,e,i,n,r,o,a,h,c){const l=s.Util.bezierBoundingBox(e,i,n,r,o,a,h,c);this.updatePathMinMax(t,l[0],l[1]),this.updatePathMinMax(t,l[2],l[3])}getPathBoundingBox(t=n.PathType.FILL,e=null){const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===n.PathType.STROKE){e||(0,s.unreachable)("Stroke bounding box must include transform.");const t=s.Util.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,r=t[1]*this.lineWidth/2;i[0]-=n,i[1]-=r,i[2]+=n,i[3]+=r}return i}updateClipFromPath(){const t=s.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(t=n.PathType.FILL,e=null){return s.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function d(t,e,i=null){if("undefined"!=typeof ImageData&&e instanceof ImageData)return void t.putImageData(e,0,0);const n=e.height,r=e.width,o=n%a,h=(n-o)/a,c=0===o?h:h+1,l=t.createImageData(r,a);let d,u=0;const f=e.data,p=l.data;let g,m,b,A,v,w,k,y;if(i)switch(i.length){case 1:v=i[0],w=i[0],k=i[0],y=i[0];break;case 4:v=i[0],w=i[1],k=i[2],y=i[3]}if(e.kind===s.ImageKind.GRAYSCALE_1BPP){const e=f.byteLength,i=new Uint32Array(p.buffer,0,p.byteLength>>2),n=i.length,A=r+7>>3;let v=4294967295,w=s.IsLittleEndianCached.value?4278190080:255;for(y&&255===y[0]&&0===y[255]&&([v,w]=[w,v]),g=0;g<c;g++){for(b=g<h?a:o,d=0,m=0;m<b;m++){const t=e-u;let s=0;const n=t>A?r:8*t-7,o=-8&n;let a=0,h=0;for(;s<o;s+=8)h=f[u++],i[d++]=128&h?v:w,i[d++]=64&h?v:w,i[d++]=32&h?v:w,i[d++]=16&h?v:w,i[d++]=8&h?v:w,i[d++]=4&h?v:w,i[d++]=2&h?v:w,i[d++]=1&h?v:w;for(;s<n;s++)0===a&&(h=f[u++],a=128),i[d++]=h&a?v:w,a>>=1}for(;d<n;)i[d++]=0;t.putImageData(l,0,g*a)}}else if(e.kind===s.ImageKind.RGBA_32BPP){const e=!!(v||w||k);for(m=0,A=r*a*4,g=0;g<h;g++){if(p.set(f.subarray(u,u+A)),u+=A,e)for(let t=0;t<A;t+=4)v&&(p[t+0]=v[p[t+0]]),w&&(p[t+1]=w[p[t+1]]),k&&(p[t+2]=k[p[t+2]]);t.putImageData(l,0,m),m+=a}if(g<c){if(A=r*o*4,p.set(f.subarray(u,u+A)),e)for(let t=0;t<A;t+=4)v&&(p[t+0]=v[p[t+0]]),w&&(p[t+1]=w[p[t+1]]),k&&(p[t+2]=k[p[t+2]]);t.putImageData(l,0,m)}}else{if(e.kind!==s.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);{const e=!!(v||w||k);for(b=a,A=r*b,g=0;g<c;g++){for(g>=h&&(b=o,A=r*b),d=0,m=A;m--;)p[d++]=f[u++],p[d++]=f[u++],p[d++]=f[u++],p[d++]=255;if(e)for(let t=0;t<d;t+=4)v&&(p[t+0]=v[p[t+0]]),w&&(p[t+1]=w[p[t+1]]),k&&(p[t+2]=k[p[t+2]]);t.putImageData(l,0,g*a)}}}}function u(t,e){const i=e.height,s=e.width,n=i%a,r=(i-n)/a,o=0===n?r:r+1,h=t.createImageData(s,a);let c=0;const l=e.data,d=h.data;for(let e=0;e<o;e++){const i=e<r?a:n;let o=3;for(let t=0;t<i;t++){let t,e=0;for(let i=0;i<s;i++)e||(t=l[c++],e=128),d[o]=t&e?0:255,o+=4,e>>=1}t.putImageData(h,0,e*a)}}function f(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(let s=0,n=i.length;s<n;s++){const n=i[s];void 0!==t[n]&&(e[n]=t[n])}void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function p(t){t.strokeStyle="#000000",t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0)}function g(t,e,i,s){const n=t.length;for(let r=3;r<n;r+=4){const n=t[r];if(0===n)t[r-3]=e,t[r-2]=i,t[r-1]=s;else if(n<255){const o=255-n;t[r-3]=t[r-3]*n+e*o>>8,t[r-2]=t[r-2]*n+i*o>>8,t[r-1]=t[r-1]*n+s*o>>8}}}function m(t,e,i){const s=t.length;for(let n=3;n<s;n+=4)e[n]=e[n]*(i?i[t[n]]:t[n])*.00392156862745098|0}function b(t,e,i){const s=t.length;for(let n=3;n<s;n+=4){const s=77*t[n-3]+152*t[n-2]+28*t[n-1];e[n]=i?e[n]*i[s>>8]>>8:e[n]*s>>16}}function A(t,e){const i=s.Util.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*r.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==e?e:i[0]<=n||i[1]<=n}const v=["butt","round","square"],w=["miter","round","bevel"],k={},y={};class x{constructor(t,e,i,s,n,r,o){this.ctx=t,this.current=new l(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=s,this.imageLayer=n,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=[],this.optionalContentConfig=r,this.cachedCanvases=new c(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,t&&h(t),this._cachedGetSinglePixelWidth=null}beginDrawing({transform:t,viewport:e,transparency:i=!1,background:s=null}){const n=this.ctx.canvas.width,r=this.ctx.canvas.height;if(this.ctx.save(),this.ctx.fillStyle=s||"rgb(255, 255, 255)",this.ctx.fillRect(0,0,n,r),this.ctx.restore(),i){const t=this.cachedCanvases.getCanvas("transparent",n,r,!0);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform.apply(this.ctx,this.compositeCtx.mozCurrentTransform)}this.ctx.save(),p(this.ctx),t&&(this.ctx.transform.apply(this.ctx,t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform.apply(this.ctx,e.transform),this.viewportScale=e.scale,this.baseTransform=this.ctx.mozCurrentTransform.slice(),this._combinedScaleFactor=Math.hypot(this.baseTransform[0],this.baseTransform[2]),this.imageLayer&&this.imageLayer.beginLayout()}executeOperatorList(t,e,i,n){const r=t.argsArray,o=t.fnArray;let a=e||0;const h=r.length;if(h===a)return a;const c=h-a>10&&"function"==typeof i,l=c?Date.now()+15:0;let d=0;const u=this.commonObjs,f=this.objs;let p;for(;;){if(void 0!==n&&a===n.nextBreakPoint)return n.breakIt(a,i),a;if(p=o[a],p!==s.OPS.dependency)this[p].apply(this,r[a]);else for(const t of r[a]){const e=t.startsWith("g_")?u:f;if(!e.has(t))return e.get(t,i),a}if(a++,a===h)return a;if(c&&++d>10){if(Date.now()>l)return i(),a;d=0}}}endDrawing(){for(;this.stateStack.length||null!==this.current.activeSMask;)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),this.cachedCanvases.clear(),this.cachedPatterns.clear(),this.imageLayer&&this.imageLayer.endLayout()}_scaleImage(t,e){const i=t.width,s=t.height;let n,r,o=Math.max(Math.hypot(e[0],e[1]),1),a=Math.max(Math.hypot(e[2],e[3]),1),h=i,c=s,l="prescale1";for(;o>2&&h>1||a>2&&c>1;){let e=h,i=c;o>2&&h>1&&(e=Math.ceil(h/2),o/=h/e),a>2&&c>1&&(i=Math.ceil(c/2),a/=c/i),n=this.cachedCanvases.getCanvas(l,e,i),r=n.context,r.clearRect(0,0,e,i),r.drawImage(t,0,0,h,c,0,0,e,i),t=n.canvas,h=e,c=i,l="prescale1"===l?"prescale2":"prescale1"}return{img:t,paintWidth:h,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,i=t.width,r=t.height,o=this.current.fillColor,a=this.current.patternFill,h=this.cachedCanvases.getCanvas("maskCanvas",i,r);u(h.context,t);let c=s.Util.transform(e.mozCurrentTransform,[1/i,0,0,-1/r,0,0]);c=s.Util.transform(c,[1,0,0,1,0,-r]);const l=s.Util.applyTransform([0,0],c),d=s.Util.applyTransform([i,r],c),f=s.Util.normalizeRect([l[0],l[1],d[0],d[1]]),p=Math.ceil(f[2]-f[0]),g=Math.ceil(f[3]-f[1]),m=this.cachedCanvases.getCanvas("fillCanvas",p,g,!0),b=m.context,v=Math.min(l[0],d[0]),w=Math.min(l[1],d[1]);b.translate(-v,-w),b.transform.apply(b,c);const k=this._scaleImage(h.canvas,b.mozCurrentTransformInverse);b.imageSmoothingEnabled=A(b.mozCurrentTransform,t.interpolate),b.drawImage(k.img,0,0,k.img.width,k.img.height,0,0,i,r),b.globalCompositeOperation="source-in";const y=s.Util.transform(b.mozCurrentTransformInverse,[1,0,0,1,-v,-w]);return b.fillStyle=a?o.getPattern(e,this,y,n.PathType.FILL):o,b.fillRect(0,0,i,r),{canvas:m.canvas,offsetX:Math.round(v),offsetY:Math.round(w)}}setLineWidth(t){this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=v[t]}setLineJoin(t){this.ctx.lineJoin=w[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(let e=0,i=t.length;e<i;e++){const i=t[e],s=i[1];switch(i[0]){case"LW":this.setLineWidth(s);break;case"LC":this.setLineCap(s);break;case"LJ":this.setLineJoin(s);break;case"ML":this.setMiterLimit(s);break;case"D":this.setDash(s[0],s[1]);break;case"RI":this.setRenderingIntent(s);break;case"FL":this.setFlatness(s);break;case"Font":this.setFont(s[0],s[1]);break;case"CA":this.current.strokeAlpha=i[1];break;case"ca":this.current.fillAlpha=i[1],this.ctx.globalAlpha=i[1];break;case"BM":this.ctx.globalCompositeOperation=s;break;case"SMask":this.current.activeSMask=s?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.current.transferMaps=s}}}checkSMaskState(){const t=!!this.suspendedCtx;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.suspendedCtx)throw new Error("beginSMaskMode called while already in smask mode");const t=this.cachedCanvases.getCanvas("smaskGroupAt"+this.groupLevel,this.ctx.canvas.width,this.ctx.canvas.height,!0);this.suspendedCtx=this.ctx,this.ctx=t.context;const e=this.ctx;e.setTransform.apply(e,this.suspendedCtx.mozCurrentTransform),f(this.suspendedCtx,e),function(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,s,n,r,o){e.transform(t,i,s,n,r,o),this.__originalTransform(t,i,s,n,r,o)},t.setTransform=function(t,i,s,n,r,o){e.setTransform(t,i,s,n,r,o),this.__originalSetTransform(t,i,s,n,r,o)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},t.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},t.bezierCurveTo=function(t,i,s,n,r,o){e.bezierCurveTo(t,i,s,n,r,o),this.__originalBezierCurveTo(t,i,s,n,r,o)},t.rect=function(t,i,s,n){e.rect(t,i,s,n),this.__originalRect(t,i,s,n)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(e,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.suspendedCtx)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),f(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.current.activeSMask=null,this.suspendedCtx=null}compose(t){this.current.activeSMask&&(t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height],function(t,e,i,s){const n=s[0],r=s[1],o=s[2]-n,a=s[3]-r;0!==o&&0!==a&&(function(t,e,i,s,n,r,o,a,h,c,l){const d=!!r,u=d?r[0]:0,f=d?r[1]:0,p=d?r[2]:0;let A;A="Luminosity"===n?b:m;const v=Math.min(s,Math.ceil(1048576/i));for(let n=0;n<s;n+=v){const r=Math.min(v,s-n),m=t.getImageData(a-c,n+(h-l),i,r),b=e.getImageData(a,n+h,i,r);d&&g(m.data,u,f,p),A(m.data,b.data,o),e.putImageData(b,a,n+h)}}(e.context,i,o,a,e.subtype,e.backdrop,e.transferMap,n,r,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}(this.suspendedCtx,this.current.activeSMask,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore())}save(){this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.current.activeSMask&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,s,n,r){this.ctx.transform(t,e,i,s,n,r),this._cachedGetSinglePixelWidth=null}constructPath(t,e){const i=this.ctx,n=this.current;let r,o,a=n.x,h=n.y;for(let c=0,l=0,d=t.length;c<d;c++)switch(0|t[c]){case s.OPS.rectangle:a=e[l++],h=e[l++];const t=e[l++],c=e[l++],d=a+t,u=h+c;i.moveTo(a,h),0===t||0===c?i.lineTo(d,u):(i.lineTo(d,h),i.lineTo(d,u),i.lineTo(a,u)),n.updatePathMinMax(i.mozCurrentTransform,a,h),n.updatePathMinMax(i.mozCurrentTransform,d,u),i.closePath();break;case s.OPS.moveTo:a=e[l++],h=e[l++],i.moveTo(a,h),n.updatePathMinMax(i.mozCurrentTransform,a,h);break;case s.OPS.lineTo:a=e[l++],h=e[l++],i.lineTo(a,h),n.updatePathMinMax(i.mozCurrentTransform,a,h);break;case s.OPS.curveTo:r=a,o=h,a=e[l+4],h=e[l+5],i.bezierCurveTo(e[l],e[l+1],e[l+2],e[l+3],a,h),n.updateCurvePathMinMax(i.mozCurrentTransform,r,o,e[l],e[l+1],e[l+2],e[l+3],a,h),l+=6;break;case s.OPS.curveTo2:r=a,o=h,i.bezierCurveTo(a,h,e[l],e[l+1],e[l+2],e[l+3]),n.updateCurvePathMinMax(i.mozCurrentTransform,r,o,a,h,e[l],e[l+1],e[l+2],e[l+3]),a=e[l+2],h=e[l+3],l+=4;break;case s.OPS.curveTo3:r=a,o=h,a=e[l+2],h=e[l+3],i.bezierCurveTo(e[l],e[l+1],a,h,a,h),n.updateCurvePathMinMax(i.mozCurrentTransform,r,o,e[l],e[l+1],a,h,a,h),l+=4;break;case s.OPS.closePath:i.closePath()}n.setCurrentPoint(a,h)}closePath(){this.ctx.closePath()}stroke(t){t=void 0===t||t;const e=this.ctx,i=this.current.strokeColor;if(e.globalAlpha=this.current.strokeAlpha,this.contentVisible)if("object"==typeof i&&i?.getPattern){const t=this.getSinglePixelWidth();e.save(),e.strokeStyle=i.getPattern(e,this,e.mozCurrentTransformInverse,n.PathType.STROKE),e.lineWidth=Math.max(t,this.current.lineWidth),e.stroke(),e.restore()}else{const t=this.getSinglePixelWidth();t<0&&-t>=this.current.lineWidth?(e.save(),e.resetTransform(),e.lineWidth=Math.round(this._combinedScaleFactor),e.stroke(),e.restore()):(e.lineWidth=Math.max(t,this.current.lineWidth),e.stroke())}t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t){t=void 0===t||t;const e=this.ctx,i=this.current.fillColor;let s=!1;this.current.patternFill&&(e.save(),e.fillStyle=i.getPattern(e,this,e.mozCurrentTransformInverse,n.PathType.FILL),s=!0);const r=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==r&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),s&&e.restore(),t&&this.consumePath(r)}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=k}eoClip(){this.pendingClip=y}beginText(){this.current.textMatrix=s.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(let i=0;i<t.length;i++){const s=t[i];e.setTransform.apply(e,s.transform),e.translate(s.x,s.y),s.addToPath(e,s.fontSize)}e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){const i=this.commonObjs.get(t),n=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(n.fontMatrix=i.fontMatrix||s.FONT_IDENTITY_MATRIX,0!==n.fontMatrix[0]&&0!==n.fontMatrix[3]||(0,s.warn)("Invalid font matrix for font "+t),e<0?(e=-e,n.fontDirection=-1):n.fontDirection=1,this.current.font=i,this.current.fontSize=e,i.isType3Font)return;let r="normal";i.black?r="900":i.bold&&(r="bold");const o=i.italic?"italic":"normal",a=`"${i.loadedName||"sans-serif"}", ${i.fallbackName}`;let h=e;e<16?h=16:e>100&&(h=100),this.current.fontSizeScale=e/h,this.ctx.font=`${o} ${r} ${h}px ${a}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,s,n,r){this.current.textMatrix=[t,e,i,s,n,r],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,n,r){const o=this.ctx,a=this.current,h=a.font,c=a.textRenderingMode,l=a.fontSize/a.fontSizeScale,d=c&s.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&s.TextRenderingMode.ADD_TO_PATH_FLAG),f=a.patternFill&&!h.missingFile;let p;(h.disableFontFace||u||f)&&(p=h.getPathGenerator(this.commonObjs,t)),h.disableFontFace||f?(o.save(),o.translate(e,i),o.beginPath(),p(o,l),n&&o.setTransform.apply(o,n),d!==s.TextRenderingMode.FILL&&d!==s.TextRenderingMode.FILL_STROKE||o.fill(),d!==s.TextRenderingMode.STROKE&&d!==s.TextRenderingMode.FILL_STROKE||(r&&(o.resetTransform(),o.lineWidth=Math.round(this._combinedScaleFactor)),o.stroke()),o.restore()):(d!==s.TextRenderingMode.FILL&&d!==s.TextRenderingMode.FILL_STROKE||o.fillText(t,e,i),d!==s.TextRenderingMode.STROKE&&d!==s.TextRenderingMode.FILL_STROKE||(r?(o.save(),o.moveTo(e,i),o.resetTransform(),o.lineWidth=Math.round(this._combinedScaleFactor),o.strokeText(t,0,0),o.restore()):o.strokeText(t,e,i))),u&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:o.mozCurrentTransform,x:e,y:i,fontSize:l,addToPath:p})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){i=!0;break}return(0,s.shadow)(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const r=e.fontSize;if(0===r)return;const o=this.ctx,a=e.fontSizeScale,h=e.charSpacing,c=e.wordSpacing,l=e.fontDirection,d=e.textHScale*l,u=t.length,f=i.vertical,p=f?1:-1,g=i.defaultVMetrics,m=r*e.fontMatrix[0],b=e.textRenderingMode===s.TextRenderingMode.FILL&&!i.disableFontFace&&!e.patternFill;let A;if(o.save(),o.transform.apply(o,e.textMatrix),o.translate(e.x,e.y+e.textRise),o.scale(d,l>0?-1:1),e.patternFill){o.save();const t=e.fillColor.getPattern(o,this,o.mozCurrentTransformInverse,n.PathType.FILL);A=o.mozCurrentTransform,o.restore(),o.fillStyle=t}let v=e.lineWidth,w=!1;const k=e.textMatrixScale;if(0===k||0===v){const t=e.textRenderingMode&s.TextRenderingMode.FILL_STROKE_MASK;t!==s.TextRenderingMode.STROKE&&t!==s.TextRenderingMode.FILL_STROKE||(this._cachedGetSinglePixelWidth=null,v=this.getSinglePixelWidth(),w=v<0)}else v/=k;1!==a&&(o.scale(a,a),v/=a),o.lineWidth=v;let y,x=0;for(y=0;y<u;++y){const e=t[y];if((0,s.isNum)(e)){x+=p*e*r/1e3;continue}let n=!1;const d=(e.isSpace?c:0)+h,u=e.fontChar,v=e.accent;let k,_,D,P=e.width;if(f){const t=e.vmetric||g,i=-(e.vmetric?t[1]:.5*P)*m;P=t?-t[0]:P,k=i/a,_=(x+t[2]*m)/a}else k=x/a,_=0;if(i.remeasure&&P>0){const t=1e3*o.measureText(u).width/r*a;if(P<t&&this.isFontSubpixelAAEnabled){const e=P/t;n=!0,o.save(),o.scale(e,1),k/=e}else P!==t&&(k+=(P-t)/2e3*r/a)}this.contentVisible&&(e.isInFont||i.missingFile)&&(b&&!v?o.fillText(u,k,_):(this.paintChar(u,k,_,A,w),v&&this.paintChar(v.fontChar,k+r*v.offset.x/a,_-r*v.offset.y/a,A,w))),D=f?P*m-d*l:P*m+d*l,x+=D,n&&o.restore()}f?e.y-=x:e.x+=x*d,o.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,n=i.font,r=i.fontSize,o=i.fontDirection,a=n.vertical?1:-1,h=i.charSpacing,c=i.wordSpacing,l=i.textHScale*o,d=i.fontMatrix||s.FONT_IDENTITY_MATRIX,u=t.length;let f,p,g,m;if(i.textRenderingMode!==s.TextRenderingMode.INVISIBLE&&0!==r){for(this._cachedGetSinglePixelWidth=null,e.save(),e.transform.apply(e,i.textMatrix),e.translate(i.x,i.y),e.scale(l,o),f=0;f<u;++f){if(p=t[f],(0,s.isNum)(p)){m=a*p*r/1e3,this.ctx.translate(m,0),i.x+=m*l;continue}const o=(p.isSpace?c:0)+h,u=n.charProcOperatorList[p.operatorListId];u?(this.contentVisible&&(this.processingType3=p,this.save(),e.scale(r,r),e.transform.apply(e,d),this.executeOperatorList(u),this.restore()),g=s.Util.applyTransform([p.width,0],d)[0]*r+o,e.translate(g,0),i.x+=g*l):(0,s.warn)(`Type3 character "${p.operatorListId}" is not available.`)}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,s,n,r){this.ctx.rect(i,s,n-i,r-s),this.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const i=t[1],s=this.baseTransform||this.ctx.mozCurrentTransform.slice();e=new n.TilingPattern(t,i,this.ctx,{createCanvasGraphics:t=>new x(t,this.commonObjs,this.objs,this.canvasFactory)},s)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,i){const n=s.Util.makeHexColor(t,e,i);this.ctx.strokeStyle=n,this.current.strokeColor=n}setFillRGBColor(t,e,i){const n=s.Util.makeHexColor(t,e,i);this.ctx.fillStyle=n,this.current.fillColor=n,this.current.patternFill=!1}_getPattern(t,e=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=(0,n.getShadingPattern)(this.objs.get(t)),this.cachedPatterns.set(t,i)),e&&(i.matrix=e),i}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,e.mozCurrentTransformInverse,n.PathType.SHADING);const r=e.mozCurrentTransformInverse;if(r){const t=e.canvas,i=t.width,n=t.height,o=s.Util.applyTransform([0,0],r),a=s.Util.applyTransform([0,n],r),h=s.Util.applyTransform([i,0],r),c=s.Util.applyTransform([i,n],r),l=Math.min(o[0],a[0],h[0],c[0]),d=Math.min(o[1],a[1],h[1],c[1]),u=Math.max(o[0],a[0],h[0],c[0]),f=Math.max(o[1],a[1],h[1],c[1]);this.ctx.fillRect(l,d,u-l,f-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,s.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,s.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(t)&&6===t.length&&this.transform.apply(this,t),this.baseTransform=this.ctx.mozCurrentTransform,e)&&(this.ctx.rect(e[0],e[1],e[2]-e[0],e[3]-e[1]),this.current.updatePathMinMax(this.ctx.mozCurrentTransform,e[0],e[1]),this.current.updatePathMinMax(this.ctx.mozCurrentTransform,e[2],e[3]),this.clip(),this.endPath())}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save();const e=this.suspendedCtx;this.current.activeSMask&&(this.suspendedCtx=null,this.current.activeSMask=null);const i=this.ctx;t.isolated||(0,s.info)("TODO: Support non-isolated groups."),t.knockout&&(0,s.warn)("Knockout groups not supported.");const n=i.mozCurrentTransform;if(t.matrix&&i.transform.apply(i,t.matrix),!t.bbox)throw new Error("Bounding box is required.");let r=s.Util.getAxialAlignedBoundingBox(t.bbox,i.mozCurrentTransform);r=s.Util.intersect(r,[0,0,i.canvas.width,i.canvas.height])||[0,0,0,0];const a=Math.floor(r[0]),h=Math.floor(r[1]);let c=Math.max(Math.ceil(r[2])-a,1),l=Math.max(Math.ceil(r[3])-h,1),d=1,u=1;c>o&&(d=c/o,c=o),l>o&&(u=l/o,l=o),this.current.startNewPathAndClipBox([0,0,c,l]);let p="groupAt"+this.groupLevel;t.smask&&(p+="_smask_"+this.smaskCounter++%2);const g=this.cachedCanvases.getCanvas(p,c,l,!0),m=g.context;m.scale(1/d,1/u),m.translate(-a,-h),m.transform.apply(m,n),t.smask?this.smaskStack.push({canvas:g.canvas,context:m,offsetX:a,offsetY:h,scaleX:d,scaleY:u,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(i.setTransform(1,0,0,1,0,0),i.translate(a,h),i.scale(d,u),i.save()),f(i,m),this.ctx=m,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push({ctx:i,suspendedCtx:e}),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,{ctx:i,suspendedCtx:n}=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,n&&(this.suspendedCtx=n),t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=this.ctx.mozCurrentTransform;this.restore(),this.ctx.save(),this.ctx.setTransform.apply(this.ctx,t);const i=s.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotations(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)}endAnnotations(){this.restore()}beginAnnotation(t,e,i,n,r){if(this.save(),Array.isArray(e)&&4===e.length){const n=e[2]-e[0],o=e[3]-e[1];if(r&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=n,e[3]=o;const[r,a]=s.Util.singularValueDecompose2dScale(this.ctx.mozCurrentTransform),{viewportScale:c}=this,l=Math.ceil(n*this.outputScaleX*c),d=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(l,d);const{canvas:u,context:f}=this.annotationCanvas;u.style.width=`calc(${n}px * var(--viewport-scale-factor))`,u.style.height=`calc(${o}px * var(--viewport-scale-factor))`,this.annotationCanvasMap.set(t,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=f,this.ctx.setTransform(r,0,0,-a,0,o*a),h(this.ctx),p(this.ctx)}else p(this.ctx),this.ctx.rect(e[0],e[1],n,o),this.clip(),this.endPath()}this.current=new l(this.ctx.canvas.width,this.ctx.canvas.height),this.transform.apply(this,i),this.transform.apply(this,n)}endAnnotation(){this.annotationCanvas&&(this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas),this.restore()}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=this.ctx,i=t.width,s=t.height,n=this.processingType3;if(n&&void 0===n.compiled&&(n.compiled=i<=1e3&&s<=1e3?function(t){const e=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=t.width,s=t.height,n=i+1;let r,o,a,h;const c=new Uint8Array(n*(s+1)),l=i+7&-8,d=t.data,u=new Uint8Array(l*s);let f=0;for(r=0,o=d.length;r<o;r++){const t=d[r];let e=128;for(;e>0;)u[f++]=t&e?0:255,e>>=1}let p=0;for(f=0,0!==u[f]&&(c[0]=1,++p),a=1;a<i;a++)u[f]!==u[f+1]&&(c[a]=u[f]?2:1,++p),f++;for(0!==u[f]&&(c[a]=2,++p),r=1;r<s;r++){f=r*l,h=r*n,u[f-l]!==u[f]&&(c[h]=u[f]?1:8,++p);let t=(u[f]?4:0)+(u[f-l]?8:0);for(a=1;a<i;a++)t=(t>>2)+(u[f+1]?4:0)+(u[f-l+1]?8:0),e[t]&&(c[h+a]=e[t],++p),f++;if(u[f-l]!==u[f]&&(c[h+a]=u[f]?2:4,++p),p>1e3)return null}for(f=l*(s-1),h=r*n,0!==u[f]&&(c[h]=8,++p),a=1;a<i;a++)u[f]!==u[f+1]&&(c[h+a]=u[f]?4:8,++p),f++;if(0!==u[f]&&(c[h+a]=4,++p),p>1e3)return null;const g=new Int32Array([0,n,-1,0,-n,0,0,0,1]),m=[];for(r=0;p&&r<=s;r++){let t=r*n;const e=t+i;for(;t<e&&!c[t];)t++;if(t===e)continue;const s=[t%n,r],o=t;let a=c[t];do{const e=g[a];do{t+=e}while(!c[t]);const i=c[t];5!==i&&10!==i?(a=i,c[t]=0):(a=i&51*a>>4,c[t]&=a>>2|a<<2),s.push(t%n,t/n|0),c[t]||--p}while(o!==t);m.push(s),--r}return function(t){t.save(),t.scale(1/i,-1/s),t.translate(0,-s),t.beginPath();for(let e=0,i=m.length;e<i;e++){const i=m[e];t.moveTo(i[0],i[1]);for(let e=2,s=i.length;e<s;e+=2)t.lineTo(i[e],i[e+1])}t.fill(),t.beginPath(),t.restore()}}({data:t.data,width:i,height:s}):null),n?.compiled)return void n.compiled(e);const r=this._createMaskCanvas(t),o=r.canvas;e.save(),e.setTransform(1,0,0,1,0,0),e.drawImage(o,r.offsetX,r.offsetY),e.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i=0,n=0,r,o){if(!this.contentVisible)return;const a=this.ctx;a.save();const h=a.mozCurrentTransform;a.transform(e,i,n,r,0,0);const c=this._createMaskCanvas(t);a.setTransform(1,0,0,1,0,0);for(let t=0,l=o.length;t<l;t+=2){const l=s.Util.transform(h,[e,i,n,r,o[t],o[t+1]]),[d,u]=s.Util.applyTransform([0,0],l);a.drawImage(c.canvas,d,u)}a.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,s=this.current.patternFill;for(let r=0,o=t.length;r<o;r++){const o=t[r],a=o.width,h=o.height,c=this.cachedCanvases.getCanvas("maskCanvas",a,h),l=c.context;l.save(),u(l,o),l.globalCompositeOperation="source-in",l.fillStyle=s?i.getPattern(l,this,e.mozCurrentTransformInverse,n.PathType.FILL):i,l.fillRect(0,0,a,h),l.restore(),e.save(),e.transform.apply(e,o.transform),e.scale(1,-1),e.drawImage(c.canvas,0,0,a,h,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);e?this.paintInlineImageXObject(e):(0,s.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;const r=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);if(!r)return void(0,s.warn)("Dependent image isn't ready yet");const o=r.width,a=r.height,h=[];for(let t=0,s=n.length;t<s;t+=2)h.push({transform:[e,0,0,i,n[t],n[t+1]],x:0,y:0,w:o,h:a});this.paintInlineImageXObjectGroup(r,h)}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,s=this.ctx;let n;if(this.save(),s.scale(1/e,-1/i),"function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)n=t;else{const s=this.cachedCanvases.getCanvas("inlineImage",e,i);d(s.context,t,this.current.transferMaps),n=s.canvas}const r=this._scaleImage(n,s.mozCurrentTransformInverse);if(s.imageSmoothingEnabled=A(s.mozCurrentTransform,t.interpolate),s.drawImage(r.img,0,0,r.paintWidth,r.paintHeight,0,-i,e,i),this.imageLayer){const n=this.getCanvasPosition(0,-i);this.imageLayer.appendImage({imgData:t,left:n[0],top:n[1],width:e/s.mozCurrentTransformInverse[0],height:i/s.mozCurrentTransformInverse[3]})}this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx,s=t.width,n=t.height,r=this.cachedCanvases.getCanvas("inlineImage",s,n);d(r.context,t,this.current.transferMaps);for(let o=0,a=e.length;o<a;o++){const a=e[o];if(i.save(),i.transform.apply(i,a.transform),i.scale(1,-1),i.drawImage(r.canvas,a.x,a.y,a.w,a.h,0,-1,1,1),this.imageLayer){const e=this.getCanvasPosition(a.x,a.y);this.imageLayer.appendImage({imgData:t,left:e[0],top:e[1],width:s,height:n})}i.restore()}this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){this.markedContentStack.push("OC"===t?{visible:this.optionalContentConfig.isVisible(e)}:{visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const e=this.ctx;this.pendingClip&&(this.pendingClip===y?e.clip("evenodd"):e.clip(),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),e.beginPath()}getSinglePixelWidth(){if(null===this._cachedGetSinglePixelWidth){const t=this.ctx.mozCurrentTransform,e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=t[0]**2+t[2]**2,s=t[1]**2+t[3]**2,n=Math.sqrt(Math.max(i,s))/e;this._cachedGetSinglePixelWidth=i!==s&&this._combinedScaleFactor*n>1?-this._combinedScaleFactor*n:e>Number.EPSILON?n:1}return this._cachedGetSinglePixelWidth}getCanvasPosition(t,e){const i=this.ctx.mozCurrentTransform;return[i[0]*t+i[2]*e+i[4],i[1]*t+i[3]*e+i[5]]}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}e.CanvasGraphics=x;for(const t in s.OPS)void 0!==x.prototype[t]&&(x.prototype[s.OPS[t]]=x.prototype[t])},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TilingPattern=e.PathType=void 0,e.getShadingPattern=function(t){switch(t[0]){case"RadialAxial":return new a(t);case"Mesh":return new l(t);case"Dummy":return new d}throw new Error(`Unknown IR type: ${t[0]}`)};var s=i(2);const n={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function r(t,e){if(!e||"undefined"==typeof Path2D)return;const i=e[2]-e[0],s=e[3]-e[1],n=new Path2D;n.rect(e[0],e[1],i,s),t.clip(n)}e.PathType=n;class o{constructor(){this.constructor===o&&(0,s.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,s.unreachable)("Abstract method `getPattern` called.")}}class a extends o{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(t,e,i,o){let a;if(o===n.STROKE||o===n.FILL){const n=e.current.getClippedPathBoundingBox(o,t.mozCurrentTransform)||[0,0,0,0],h=Math.ceil(n[2]-n[0])||1,c=Math.ceil(n[3]-n[1])||1,l=e.cachedCanvases.getCanvas("pattern",h,c,!0),d=l.context;d.clearRect(0,0,d.canvas.width,d.canvas.height),d.beginPath(),d.rect(0,0,d.canvas.width,d.canvas.height),d.translate(-n[0],-n[1]),i=s.Util.transform(i,[1,0,0,1,n[0],n[1]]),d.transform.apply(d,e.baseTransform),this.matrix&&d.transform.apply(d,this.matrix),r(d,this._bbox),d.fillStyle=this._createGradient(d),d.fill(),a=t.createPattern(l.canvas,"no-repeat");const u=new DOMMatrix(i);try{a.setTransform(u)}catch(t){(0,s.warn)(`RadialAxialShadingPattern.getPattern: "${t?.message}".`)}}else r(t,this._bbox),a=this._createGradient(t);return a}}function h(t,e,i,s,n,r,o,a){const h=e.coords,c=e.colors,l=t.data,d=4*t.width;let u;h[i+1]>h[s+1]&&(u=i,i=s,s=u,u=r,r=o,o=u),h[s+1]>h[n+1]&&(u=s,s=n,n=u,u=o,o=a,a=u),h[i+1]>h[s+1]&&(u=i,i=s,s=u,u=r,r=o,o=u);const f=(h[i]+e.offsetX)*e.scaleX,p=(h[i+1]+e.offsetY)*e.scaleY,g=(h[s]+e.offsetX)*e.scaleX,m=(h[s+1]+e.offsetY)*e.scaleY,b=(h[n]+e.offsetX)*e.scaleX,A=(h[n+1]+e.offsetY)*e.scaleY;if(p>=A)return;const v=c[r],w=c[r+1],k=c[r+2],y=c[o],x=c[o+1],_=c[o+2],D=c[a],P=c[a+1],M=c[a+2],O=Math.round(p),E=Math.round(A);let S,C,F,T,R,I,L,N;for(let t=O;t<=E;t++){if(t<m){let e;e=t<p?0:(p-t)/(p-m),S=f-(f-g)*e,C=v-(v-y)*e,F=w-(w-x)*e,T=k-(k-_)*e}else{let e;e=t>A?1:m===A?0:(m-t)/(m-A),S=g-(g-b)*e,C=y-(y-D)*e,F=x-(x-P)*e,T=_-(_-M)*e}let e;e=t<p?0:t>A?1:(p-t)/(p-A),R=f-(f-b)*e,I=v-(v-D)*e,L=w-(w-P)*e,N=k-(k-M)*e;const i=Math.round(Math.min(S,R)),s=Math.round(Math.max(S,R));let n=d*t+4*i;for(let t=i;t<=s;t++)e=(S-t)/(S-R),e<0?e=0:e>1&&(e=1),l[n++]=C-(C-I)*e|0,l[n++]=F-(F-L)*e|0,l[n++]=T-(T-N)*e|0,l[n++]=255}}function c(t,e,i){const s=e.coords,n=e.colors;let r,o;switch(e.type){case"lattice":const a=e.verticesPerRow,c=Math.floor(s.length/a)-1,l=a-1;for(r=0;r<c;r++){let e=r*a;for(let r=0;r<l;r++,e++)h(t,i,s[e],s[e+1],s[e+a],n[e],n[e+1],n[e+a]),h(t,i,s[e+a+1],s[e+1],s[e+a],n[e+a+1],n[e+1],n[e+a])}break;case"triangles":for(r=0,o=s.length;r<o;r+=3)h(t,i,s[r],s[r+1],s[r+2],n[r],n[r+1],n[r+2]);break;default:throw new Error("illegal figure")}}class l extends o{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,i){const s=Math.floor(this._bounds[0]),n=Math.floor(this._bounds[1]),r=Math.ceil(this._bounds[2])-s,o=Math.ceil(this._bounds[3])-n,a=Math.min(Math.ceil(Math.abs(r*t[0]*1.1)),3e3),h=Math.min(Math.ceil(Math.abs(o*t[1]*1.1)),3e3),l=r/a,d=o/h,u={coords:this._coords,colors:this._colors,offsetX:-s,offsetY:-n,scaleX:1/l,scaleY:1/d},f=i.getCanvas("mesh",a+4,h+4,!1),p=f.context,g=p.createImageData(a,h);if(e){const t=g.data;for(let i=0,s=t.length;i<s;i+=4)t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=255}for(const t of this._figures)c(g,t,u);return p.putImageData(g,2,2),{canvas:f.canvas,offsetX:s-2*l,offsetY:n-2*d,scaleX:l,scaleY:d}}getPattern(t,e,i,o){let a;if(r(t,this._bbox),o===n.SHADING)a=s.Util.singularValueDecompose2dScale(t.mozCurrentTransform);else if(a=s.Util.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=s.Util.singularValueDecompose2dScale(this.matrix);a=[a[0]*t[0],a[1]*t[1]]}const h=this._createMeshCanvas(a,o===n.SHADING?null:this._background,e.cachedCanvases);return o!==n.SHADING&&(t.setTransform.apply(t,e.baseTransform),this.matrix&&t.transform.apply(t,this.matrix)),t.translate(h.offsetX,h.offsetY),t.scale(h.scaleX,h.scaleY),t.createPattern(h.canvas,"no-repeat")}}class d extends o{getPattern(){return"hotpink"}}class u{static get MAX_PATTERN_SIZE(){return(0,s.shadow)(this,"MAX_PATTERN_SIZE",3e3)}constructor(t,e,i,s,n){this.operatorList=t[2],this.matrix=t[3]||[1,0,0,1,0,0],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=i,this.canvasGraphicsFactory=s,this.baseTransform=n}createPatternCanvas(t){const e=this.operatorList,i=this.bbox,n=this.xstep,r=this.ystep,o=this.paintType,a=this.color,h=this.canvasGraphicsFactory;(0,s.info)("TilingType: "+this.tilingType);const c=i[0],l=i[1],d=i[2],u=i[3],f=s.Util.singularValueDecompose2dScale(this.matrix),p=s.Util.singularValueDecompose2dScale(this.baseTransform),g=[f[0]*p[0],f[1]*p[1]],m=this.getSizeAndScale(n,this.ctx.canvas.width,g[0]),b=this.getSizeAndScale(r,this.ctx.canvas.height,g[1]),A=t.cachedCanvases.getCanvas("pattern",m.size,b.size,!0),v=A.context,w=h.createCanvasGraphics(v);w.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(w,o,a);let k=c,y=l,x=d,_=u;return c<0&&(k=0,x+=Math.abs(c)),l<0&&(y=0,_+=Math.abs(l)),v.translate(-m.scale*k,-b.scale*y),w.transform(m.scale,0,0,b.scale,0,0),this.clipBbox(w,k,y,x,_),w.baseTransform=w.ctx.mozCurrentTransform.slice(),w.executeOperatorList(e),w.endDrawing(),{canvas:A.canvas,scaleX:m.scale,scaleY:b.scale,offsetX:k,offsetY:y}}getSizeAndScale(t,e,i){t=Math.abs(t);const s=Math.max(u.MAX_PATTERN_SIZE,e);let n=Math.ceil(t*i);return n>=s?n=s:i=n/t,{scale:i,size:n}}clipBbox(t,e,i,s,n){t.ctx.rect(e,i,s-e,n-i),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,r=t.current;switch(e){case 1:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,r.fillColor=t.fillStyle,r.strokeColor=t.strokeStyle;break;case 2:const o=s.Util.makeHexColor(i[0],i[1],i[2]);n.fillStyle=o,n.strokeStyle=o,r.fillColor=o,r.strokeColor=o;break;default:throw new s.FormatError(`Unsupported paint type: ${e}`)}}getPattern(t,e,i,r){let o=i;r!==n.SHADING&&(o=s.Util.transform(o,e.baseTransform),this.matrix&&(o=s.Util.transform(o,this.matrix)));const a=this.createPatternCanvas(e);let h=new DOMMatrix(o);h=h.translate(a.offsetX,a.offsetY),h=h.scale(1/a.scaleX,1/a.scaleY);const c=t.createPattern(a.canvas,"repeat");try{c.setTransform(h)}catch(t){(0,s.warn)(`TilingPattern.getPattern: "${t?.message}".`)}return c}}e.TilingPattern=u},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;const i=Object.create(null);e.GlobalWorkerOptions=i,i.workerPort=void 0===i.workerPort?null:i.workerPort,i.workerSrc=void 0===i.workerSrc?"":i.workerSrc},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;var s=i(2);function n(t){if(!(t instanceof Error||"object"==typeof t&&null!==t))return(0,s.warn)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t;switch(t.name){case"AbortException":return new s.AbortException(t.message);case"MissingPDFException":return new s.MissingPDFException(t.message);case"PasswordException":return new s.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new s.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new s.UnknownErrorException(t.message,t.details);default:return new s.UnknownErrorException(t.message,t.toString())}}e.MessageHandler=class{constructor(t,e,i){this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream)return void this._processStreamMessage(e);if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],1===e.callback)i.resolve(e.data);else{if(2!==e.callback)throw new Error("Unexpected callback case");i.reject(n(e.reason))}return}const s=this.actionHandler[e.action];if(!s)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,r=e.sourceName;new Promise((function(t){t(s(e.data))})).then((function(s){i.postMessage({sourceName:t,targetName:r,callback:1,callbackId:e.callbackId,data:s})}),(function(s){i.postMessage({sourceName:t,targetName:r,callback:2,callbackId:e.callbackId,reason:n(s)})}))}else e.streamId?this._createStreamSink(e):s(e.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const n=this.callbackId++,r=(0,s.createPromiseCapability)();this.callbackCapabilities[n]=r;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},i)}catch(t){r.reject(t)}return r.promise}sendWithStream(t,e,i,r){const o=this.streamId++,a=this.sourceName,h=this.targetName,c=this.comObj;return new ReadableStream({start:i=>{const n=(0,s.createPromiseCapability)();return this.streamControllers[o]={controller:i,startCall:n,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:a,targetName:h,action:t,streamId:o,data:e,desiredSize:i.desiredSize},r),n.promise},pull:t=>{const e=(0,s.createPromiseCapability)();return this.streamControllers[o].pullCall=e,c.postMessage({sourceName:a,targetName:h,stream:6,streamId:o,desiredSize:t.desiredSize}),e.promise},cancel:t=>{(0,s.assert)(t instanceof Error,"cancel must have a valid reason");const e=(0,s.createPromiseCapability)();return this.streamControllers[o].cancelCall=e,this.streamControllers[o].isClosed=!0,c.postMessage({sourceName:a,targetName:h,stream:1,streamId:o,reason:n(t)}),e.promise}},i)}_createStreamSink(t){const e=t.streamId,i=this.sourceName,r=t.sourceName,o=this.comObj,a=this,h=this.actionHandler[t.action],c={enqueue(t,n=1,a){if(this.isCancelled)return;const h=this.desiredSize;this.desiredSize-=n,h>0&&this.desiredSize<=0&&(this.sinkCapability=(0,s.createPromiseCapability)(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:i,targetName:r,stream:4,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:3,streamId:e}),delete a.streamSinks[e])},error(t){(0,s.assert)(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:5,streamId:e,reason:n(t)}))},sinkCapability:(0,s.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[e]=c,new Promise((function(e){e(h(t.data,c))})).then((function(){o.postMessage({sourceName:i,targetName:r,stream:8,streamId:e,success:!0})}),(function(t){o.postMessage({sourceName:i,targetName:r,stream:8,streamId:e,reason:n(t)})}))}_processStreamMessage(t){const e=t.streamId,i=this.sourceName,r=t.sourceName,o=this.comObj,a=this.streamControllers[e],h=this.streamSinks[e];switch(t.stream){case 8:t.success?a.startCall.resolve():a.startCall.reject(n(t.reason));break;case 7:t.success?a.pullCall.resolve():a.pullCall.reject(n(t.reason));break;case 6:if(!h){o.postMessage({sourceName:i,targetName:r,stream:7,streamId:e,success:!0});break}h.desiredSize<=0&&t.desiredSize>0&&h.sinkCapability.resolve(),h.desiredSize=t.desiredSize,new Promise((function(t){t(h.onPull&&h.onPull())})).then((function(){o.postMessage({sourceName:i,targetName:r,stream:7,streamId:e,success:!0})}),(function(t){o.postMessage({sourceName:i,targetName:r,stream:7,streamId:e,reason:n(t)})}));break;case 4:if((0,s.assert)(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(t.chunk);break;case 3:if((0,s.assert)(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),this._deleteStreamController(a,e);break;case 5:(0,s.assert)(a,"error should have stream controller"),a.controller.error(n(t.reason)),this._deleteStreamController(a,e);break;case 2:t.success?a.cancelCall.resolve():a.cancelCall.reject(n(t.reason)),this._deleteStreamController(a,e);break;case 1:if(!h)break;new Promise((function(e){e(h.onCancel&&h.onCancel(n(t.reason)))})).then((function(){o.postMessage({sourceName:i,targetName:r,stream:2,streamId:e,success:!0})}),(function(t){o.postMessage({sourceName:i,targetName:r,stream:2,streamId:e,reason:n(t)})})),h.sinkCapability.reject(n(t.reason)),h.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(t,e){await Promise.allSettled([t.startCall&&t.startCall.promise,t.pullCall&&t.pullCall.promise,t.cancelCall&&t.cancelCall.promise]),delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var s=i(2);e.Metadata=class{#n;#r;constructor({parsedData:t,rawData:e}){this.#n=t,this.#r=e}getRaw(){return this.#r}get(t){return this.#n.get(t)??null}getAll(){return(0,s.objectFromMap)(this.#n)}has(t){return this.#n.has(t)}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalContentConfig=void 0;var s=i(2);class n{constructor(t,e){this.visible=!0,this.name=t,this.intent=e}}e.OptionalContentConfig=class{constructor(t){if(this.name=null,this.creator=null,this._order=null,this._groups=new Map,null!==t){this.name=t.name,this.creator=t.creator,this._order=t.order;for(const e of t.groups)this._groups.set(e.id,new n(e.name,e.intent));if("OFF"===t.baseState)for(const t of this._groups)t.visible=!1;for(const e of t.on)this._groups.get(e).visible=!0;for(const e of t.off)this._groups.get(e).visible=!1}}_evaluateVisibilityExpression(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;n<e;n++){const e=t[n];let r;if(Array.isArray(e))r=this._evaluateVisibilityExpression(e);else{if(!this._groups.has(e))return(0,s.warn)(`Optional content group not found: ${e}`),!0;r=this._groups.get(e).visible}switch(i){case"And":if(!r)return!1;break;case"Or":if(r)return!0;break;case"Not":return!r;default:return!0}}return"And"===i}isVisible(t){if(0===this._groups.size)return!0;if(!t)return(0,s.warn)("Optional content group not defined."),!0;if("OCG"===t.type)return this._groups.has(t.id)?this._groups.get(t.id).visible:((0,s.warn)(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this._evaluateVisibilityExpression(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!this._groups.has(e))return(0,s.warn)(`Optional content group not found: ${e}`),!0;if(this._groups.get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!this._groups.has(e))return(0,s.warn)(`Optional content group not found: ${e}`),!0;if(!this._groups.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!this._groups.has(e))return(0,s.warn)(`Optional content group not found: ${e}`),!0;if(!this._groups.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!this._groups.has(e))return(0,s.warn)(`Optional content group not found: ${e}`),!0;if(this._groups.get(e).visible)return!1}return!0}return(0,s.warn)(`Unknown optional content policy ${t.policy}.`),!0}return(0,s.warn)(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0){this._groups.has(t)?this._groups.get(t).visible=!!e:(0,s.warn)(`Optional content group not found: ${t}`)}getOrder(){return this._groups.size?this._order?this._order.slice():Array.from(this._groups.keys()):null}getGroups(){return this._groups.size>0?(0,s.objectFromMap)(this._groups):null}getGroup(t){return this._groups.get(t)||null}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0;var s=i(2),n=i(1);e.PDFDataTransportStream=class{constructor(t,e){(0,s.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=t.progressiveDone||!1,this._contentDispositionFilename=t.contentDispositionFilename||null;const i=t.initialData;if(i?.length>0){const t=new Uint8Array(i).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._contentLength=t.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})})),this._pdfDataRangeTransport.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})})),this._pdfDataRangeTransport.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})})),this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}_onReceiveData(t){const e=new Uint8Array(t.chunk).buffer;if(void 0===t.begin)this._fullRequestReader?this._fullRequestReader._enqueue(e):this._queuedChunks.push(e);else{const i=this._rangeReaders.some((function(i){return i._begin===t.begin&&(i._enqueue(e),!0)}));(0,s.assert)(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){if(void 0===t.total){const e=this._rangeReaders[0];e?.onProgress&&e.onProgress({loaded:t.loaded})}else{const e=this._fullRequestReader;e?.onProgress&&e.onProgress({loaded:t.loaded,total:t.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,s.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new r(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new o(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}};class r{constructor(t,e,i=!1,s=null){this._stream=t,this._done=i||!1,this._filename=(0,n.isPdfFile)(s)?s:null,this._queuedChunks=e||[],this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=(0,s.createPromiseCapability)();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class o{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,s.createPromiseCapability)();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaText=void 0;class i{static textContent(t){const e=[],s={items:e,styles:Object.create(null)};return function t(s){if(!s)return;let n=null;const r=s.name;if("#text"===r)n=s.value;else{if(!i.shouldBuildText(r))return;s?.attributes?.textContent?n=s.attributes.textContent:s.value&&(n=s.value)}if(null!==n&&e.push({str:n}),s.children)for(const e of s.children)t(e)}(t),s}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=i},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationLayer=void 0;var s=i(2),n=i(1),r=i(9),o=i(19),a=i(20);const h=1e3,c=new WeakSet;class l{static create(t){switch(t.data.annotationType){case s.AnnotationType.LINK:return new u(t);case s.AnnotationType.TEXT:return new f(t);case s.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new g(t);case"Btn":return t.data.radioButton?new b(t):t.data.checkBox?new m(t):new A(t);case"Ch":return new v(t)}return new p(t);case s.AnnotationType.POPUP:return new w(t);case s.AnnotationType.FREETEXT:return new y(t);case s.AnnotationType.LINE:return new x(t);case s.AnnotationType.SQUARE:return new _(t);case s.AnnotationType.CIRCLE:return new D(t);case s.AnnotationType.POLYLINE:return new P(t);case s.AnnotationType.CARET:return new O(t);case s.AnnotationType.INK:return new E(t);case s.AnnotationType.POLYGON:return new M(t);case s.AnnotationType.HIGHLIGHT:return new S(t);case s.AnnotationType.UNDERLINE:return new C(t);case s.AnnotationType.SQUIGGLY:return new F(t);case s.AnnotationType.STRIKEOUT:return new T(t);case s.AnnotationType.STAMP:return new R(t);case s.AnnotationType.FILEATTACHMENT:return new I(t);default:return new d(t)}}}class d{constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:s=!1}={}){this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.page=t.page,this.viewport=t.viewport,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this._mouseState=t.mouseState,e&&(this.container=this._createContainer(i)),s&&(this.quadrilaterals=this._createQuadrilaterals(i))}_createContainer(t=!1){const e=this.data,i=this.page,n=this.viewport,r=document.createElement("section");let o=e.rect[2]-e.rect[0],a=e.rect[3]-e.rect[1];r.setAttribute("data-annotation-id",e.id);const h=s.Util.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]);if(e.hasOwnCanvas){const t=n.transform.slice(),[e,i]=s.Util.singularValueDecompose2dScale(t);o=Math.ceil(o*e),a=Math.ceil(a*i),h[0]*=e,h[1]*=i;for(let e=0;e<4;e++)t[e]=Math.sign(t[e]);r.style.transform=`matrix(${t.join(",")})`}else r.style.transform=`matrix(${n.transform.join(",")})`;if(r.style.transformOrigin=`${-h[0]}px ${-h[1]}px`,!t&&e.borderStyle.width>0){r.style.borderWidth=`${e.borderStyle.width}px`,e.borderStyle.style!==s.AnnotationBorderStyleType.UNDERLINE&&(o-=2*e.borderStyle.width,a-=2*e.borderStyle.width);const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;switch((t>0||i>0)&&(r.style.borderRadius=`${t}px / ${i}px`),e.borderStyle.style){case s.AnnotationBorderStyleType.SOLID:r.style.borderStyle="solid";break;case s.AnnotationBorderStyleType.DASHED:r.style.borderStyle="dashed";break;case s.AnnotationBorderStyleType.BEVELED:(0,s.warn)("Unimplemented border style: beveled");break;case s.AnnotationBorderStyleType.INSET:(0,s.warn)("Unimplemented border style: inset");break;case s.AnnotationBorderStyleType.UNDERLINE:r.style.borderBottomStyle="solid"}e.borderColor||e.color?r.style.borderColor=s.Util.makeHexColor(0|e.color[0],0|e.color[1],0|e.color[2]):r.style.borderWidth=0}return r.style.left=`${h[0]}px`,r.style.top=`${h[1]}px`,e.hasOwnCanvas?r.style.width=r.style.height="auto":(r.style.width=`${o}px`,r.style.height=`${a}px`),r}_createQuadrilaterals(t=!1){if(!this.data.quadPoints)return null;const e=[],i=this.data.rect;for(const i of this.data.quadPoints)this.data.rect=[i[2].x,i[2].y,i[1].x,i[1].y],e.push(this._createContainer(t));return this.data.rect=i,e}_createPopup(t,e){let i=this.container;this.quadrilaterals&&(t=t||this.quadrilaterals,i=this.quadrilaterals[0]),t||((t=document.createElement("div")).style.height=i.style.height,t.style.width=i.style.width,i.appendChild(t));const s=new k({container:i,trigger:t,color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,hideWrapper:!0}).render();s.style.left=i.style.width,i.appendChild(s)}_renderQuadrilaterals(t){for(const e of this.quadrilaterals)e.className=t;return this.quadrilaterals}render(){(0,s.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const i=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:t,id:r,exportValues:o}of n){if(-1===t)continue;if(r===e)continue;const n="string"==typeof o?o:null,a=document.getElementById(r);!a||c.has(a)?i.push({id:r,exportValue:n,domElement:a}):(0,s.warn)(`_getElementsByName - element not allowed: ${r}`)}return i}for(const s of document.getElementsByName(t)){const{id:t,exportValue:n}=s;t!==e&&c.has(s)&&i.push({id:t,exportValue:n,domElement:s})}return i}static get platform(){const t="undefined"!=typeof navigator?navigator.platform:"";return(0,s.shadow)(this,"platform",{isWin:t.includes("Win"),isMac:t.includes("Mac")})}}class u extends d{constructor(t,e=null){super(t,{isRenderable:!!(t.data.url||t.data.dest||t.data.action||t.data.isTooltipOnly||t.data.resetForm||t.data.actions&&(t.data.actions.Action||t.data.actions["Mouse Up"]||t.data.actions["Mouse Down"])),ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0})}render(){const{data:t,linkService:e}=this,i=document.createElement("a");if(t.url)e.addLinkAttributes||(0,s.warn)("LinkAnnotationElement.render - missing `addLinkAttributes`-method on the `linkService`-instance."),e.addLinkAttributes?.(i,t.url,t.newWindow);else if(t.action)this._bindNamedAction(i,t.action);else if(t.dest)this._bindLink(i,t.dest);else{let e=!1;t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(e=!0,this._bindJSAction(i,t)),t.resetForm?this._bindResetFormAction(i,t.resetForm):e||this._bindLink(i,"")}return this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map(((t,e)=>{const s=0===e?i:i.cloneNode();return t.appendChild(s),t})):(this.container.className="linkAnnotation",this.container.appendChild(i),this.container)}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&(t.className="internalLink")}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),t.className="internalLink"}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const s of Object.keys(e.actions)){const n=i.get(s);n&&(t[n]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:s}}),!1))}t.onclick||(t.onclick=()=>!1),t.className="internalLink"}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),t.className="internalLink",!this._fieldObjects)return(0,s.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{i&&i();const{fields:t,refs:s,include:n}=e,r=[];if(0!==t.length||0!==s.length){const e=new Set(s);for(const i of t){const t=this._fieldObjects[i]||[];for(const{id:i}of t)e.add(i)}for(const t of Object.values(this._fieldObjects))for(const i of t)e.has(i.id)===n&&r.push(i)}else for(const t of Object.values(this._fieldObjects))r.push(...t);const o=this.annotationStorage,a=[];for(const t of r){const{id:e}=t;switch(a.push(e),t.type){case"text":{const i=t.defaultValue||"";o.setValue(e,{value:i,valueAsString:i});break}case"checkbox":case"radiobutton":o.setValue(e,{value:t.defaultValue===t.exportValues});break;case"combobox":case"listbox":o.setValue(e,{value:t.defaultValue||""});break;default:continue}const i=document.getElementById(e);i&&c.has(i)&&i.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:a,name:"ResetForm"}}),!1}}}class f extends d{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str)})}render(){this.container.className="textAnnotation";const t=document.createElement("img");return t.style.height=this.container.style.height,t.style.width=this.container.style.width,t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.alt="[{{type}} Annotation]",t.dataset.l10nId="text_annotation_type",t.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(t,this.data),this.container.appendChild(t),this.container}}class p extends d{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}_getKeyModifier(t){const{isWin:e,isMac:i}=d.platform;return e&&t.ctrlKey||i&&t.metaKey}_setEventListener(t,e,i,s){e.includes("mouse")?t.addEventListener(e,(t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(e,(t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:t.target.checked}})}))}_setEventListeners(t,e,i){for(const[s,n]of e)("Action"===n||this.data.actions?.[n])&&this._setEventListener(t,s,n,i)}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":s.Util.makeHexColor(e[0],e[1],e[2])}_dispatchEventFromSandbox(t,e){const i=(t,e,i)=>{const s=i.detail[t];i.target.style[e]=o.ColorConverters[`${s[0]}_HTML`](s.slice(1))},s={display:t=>{const e=t.detail.display%2==1;t.target.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:e,print:0===t.detail.display||3===t.detail.display})},print:t=>{this.annotationStorage.setValue(this.data.id,{print:t.detail.print})},hidden:t=>{t.target.style.visibility=t.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:t.detail.hidden})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.detail.readonly?t.target.setAttribute("readonly",""):t.target.removeAttribute("readonly")},required:t=>{t.detail.required?t.target.setAttribute("required",""):t.target.removeAttribute("required")},bgColor:t=>{i("bgColor","backgroundColor",t)},fillColor:t=>{i("fillColor","backgroundColor",t)},fgColor:t=>{i("fgColor","color",t)},textColor:t=>{i("textColor","color",t)},borderColor:t=>{i("borderColor","borderColor",t)},strokeColor:t=>{i("strokeColor","borderColor",t)}};for(const i of Object.keys(e.detail)){const n=t[i]||s[i];n&&n(e)}}}class g extends p{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,s){const n=this.annotationStorage;for(const r of this._getElementsByName(t.name,t.id))r.domElement&&(r.domElement[e]=i),n.setValue(r.id,{[s]:i})}render(){const t=this.annotationStorage,e=this.data.id;this.container.className="textWidgetAnnotation";let i=null;if(this.renderForms){const s=t.getValue(e,{value:this.data.fieldValue,valueAsString:this.data.fieldValue}),n=s.valueAsString||s.value||"",r={userValue:null,formattedValue:null,beforeInputSelectionRange:null,beforeInputValue:null};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=n):(i=document.createElement("input"),i.type="text",i.setAttribute("value",n)),c.add(i),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=h,r.userValue=n,i.setAttribute("id",e),i.addEventListener("input",(s=>{t.setValue(e,{value:s.target.value}),this.setPropertyOnSiblings(i,"value",s.target.value,"value")})),i.addEventListener("resetform",(()=>{i.value=r.userValue=this.data.defaultFieldValue||"",delete r.formattedValue}));let o=t=>{r.formattedValue&&(t.target.value=r.formattedValue),t.target.scrollLeft=0,r.beforeInputSelectionRange=null};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",(t=>{r.userValue&&(t.target.value=r.userValue)})),i.addEventListener("updatefromsandbox",(i=>{this._dispatchEventFromSandbox({value(i){r.userValue=i.detail.value||"",t.setValue(e,{value:r.userValue.toString()}),r.formattedValue||(i.target.value=r.userValue)},valueAsString(i){r.formattedValue=i.detail.valueAsString||"",i.target!==document.activeElement&&(i.target.value=r.formattedValue),t.setValue(e,{formattedValue:r.formattedValue})},selRange(t){const[e,i]=t.detail.selRange;e>=0&&i<t.target.value.length&&t.target.setSelectionRange(e,i)}},i)})),i.addEventListener("keydown",(t=>{r.beforeInputValue=t.target.value;let i=-1;"Escape"===t.key?i=0:"Enter"===t.key?i=2:"Tab"===t.key&&(i=3),-1!==i&&(r.userValue=t.target.value,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:t.target.value,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}));const s=o;o=null,i.addEventListener("blur",(t=>{this._mouseState.isDown&&(r.userValue=t.target.value,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:t.target.value,willCommit:!0,commitKey:1,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})),s(t)})),i.addEventListener("mousedown",(t=>{r.beforeInputValue=t.target.value,r.beforeInputSelectionRange=null})),i.addEventListener("keyup",(t=>{t.target.selectionStart===t.target.selectionEnd&&(r.beforeInputSelectionRange=null)})),i.addEventListener("select",(t=>{r.beforeInputSelectionRange=[t.target.selectionStart,t.target.selectionEnd]})),this.data.actions?.Keystroke&&i.addEventListener("input",(t=>{let i=-1,s=-1;r.beforeInputSelectionRange&&([i,s]=r.beforeInputSelectionRange),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r.beforeInputValue,change:t.data,willCommit:!1,selStart:i,selEnd:s}})})),this._setEventListeners(i,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}if(o&&i.addEventListener("blur",o),null!==this.data.maxLen&&(i.maxLength=this.data.maxLen),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;i.classList.add("comb"),i.style.letterSpacing=`calc(${t}px - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell";return this._setTextStyle(i),this._setBackgroundColor(i),this.container.appendChild(i),this.container}_setTextStyle(t){const{fontSize:e,fontColor:i}=this.data.defaultAppearanceData,n=t.style;e&&(n.fontSize=`${e}px`),n.color=s.Util.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(n.textAlign=["left","center","right"][this.data.textAlignment])}}class m extends p{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let s=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"==typeof s&&(s="Off"!==s,t.setValue(i,{value:s})),this.container.className="buttonWidgetAnnotation checkBox";const n=document.createElement("input");return c.add(n),n.disabled=e.readOnly,n.type="checkbox",n.name=e.fieldName,s&&n.setAttribute("checked",!0),n.setAttribute("id",i),n.setAttribute("exportValue",e.exportValue),n.tabIndex=h,n.addEventListener("change",(s=>{const{name:n,checked:r}=s.target;for(const s of this._getElementsByName(n,i)){const i=r&&s.exportValue===e.exportValue;s.domElement&&(s.domElement.checked=i),t.setValue(s.id,{value:i})}t.setValue(i,{value:r})})),n.addEventListener("resetform",(t=>{t.target.checked=(e.defaultFieldValue||"Off")===e.exportValue})),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",(e=>{this._dispatchEventFromSandbox({value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}},e)})),this._setEventListeners(n,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))),this._setBackgroundColor(n),this.container.appendChild(n),this.container}}class b extends p{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const t=this.annotationStorage,e=this.data,i=e.id;let s=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;"string"==typeof s&&(s=s!==e.buttonValue,t.setValue(i,{value:s}));const n=document.createElement("input");if(c.add(n),n.disabled=e.readOnly,n.type="radio",n.name=e.fieldName,s&&n.setAttribute("checked",!0),n.setAttribute("id",i),n.tabIndex=h,n.addEventListener("change",(e=>{const{name:s,checked:n}=e.target;for(const e of this._getElementsByName(s,i))t.setValue(e.id,{value:!1});t.setValue(i,{value:n})})),n.addEventListener("resetform",(t=>{const i=e.defaultFieldValue;t.target.checked=null!=i&&i===e.buttonValue})),this.enableScripting&&this.hasJSActions){const s=e.buttonValue;n.addEventListener("updatefromsandbox",(e=>{this._dispatchEventFromSandbox({value:e=>{const n=s===e.detail.value;for(const s of this._getElementsByName(e.target.name)){const e=n&&s.id===i;s.domElement&&(s.domElement.checked=e),t.setValue(s.id,{value:e})}}},e)})),this._setEventListeners(n,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}return this._setBackgroundColor(n),this.container.appendChild(n),this.container}}class A extends u{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();return t.className="buttonWidgetAnnotation pushButton",this.data.alternativeText&&(t.title=this.data.alternativeText),t}}class v extends p{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const t=this.annotationStorage,e=this.data.id;t.getValue(e,{value:this.data.fieldValue.length>0?this.data.fieldValue[0]:void 0});let{fontSize:i}=this.data.defaultAppearanceData;i||(i=9);const s=`calc(${i}px * var(--zoom-factor))`,n=document.createElement("select");c.add(n),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.setAttribute("id",e),n.tabIndex=h,n.style.fontSize=`${i}px`,this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",(()=>{const t=this.data.defaultFieldValue;for(const e of n.options)e.selected=e.value===t}));for(const t of this.data.options){const e=document.createElement("option");e.textContent=t.displayValue,e.value=t.exportValue,this.data.combo&&(e.style.fontSize=s),this.data.fieldValue.includes(t.exportValue)&&e.setAttribute("selected",!0),n.appendChild(e)}const r=(t,e)=>{const i=e?"value":"textContent",s=t.target.options;return t.target.multiple?Array.prototype.filter.call(s,(t=>t.selected)).map((t=>t[i])):-1===s.selectedIndex?null:s[s.selectedIndex][i]},o=t=>Array.prototype.map.call(t.target.options,(t=>({displayValue:t.textContent,exportValue:t.value})));return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",(i=>{this._dispatchEventFromSandbox({value(i){const s=i.detail.value,o=new Set(Array.isArray(s)?s:[s]);for(const t of n.options)t.selected=o.has(t.value);t.setValue(e,{value:r(i,!0)})},multipleSelection(t){n.multiple=!0},remove(i){const s=n.options,a=i.detail.remove;s[a].selected=!1,n.remove(a),s.length>0&&-1===Array.prototype.findIndex.call(s,(t=>t.selected))&&(s[0].selected=!0),t.setValue(e,{value:r(i,!0),items:o(i)})},clear(i){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]})},insert(i){const{index:s,displayValue:a,exportValue:h}=i.detail.insert,c=document.createElement("option");c.textContent=a,c.value=h,n.insertBefore(c,n.children[s]),t.setValue(e,{value:r(i,!0),items:o(i)})},items(i){const{items:s}=i.detail;for(;0!==n.length;)n.remove(0);for(const t of s){const{displayValue:e,exportValue:i}=t,s=document.createElement("option");s.textContent=e,s.value=i,n.appendChild(s)}n.options.length>0&&(n.options[0].selected=!0),t.setValue(e,{value:r(i,!0),items:o(i)})},indices(i){const s=new Set(i.detail.indices);for(const t of i.target.options)t.selected=s.has(t.index);t.setValue(e,{value:r(i,!0)})},editable(t){t.target.disabled=!t.detail.editable}},i)})),n.addEventListener("input",(i=>{const s=r(i,!0),n=r(i,!1);t.setValue(e,{value:s}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,changeEx:s,willCommit:!0,commitKey:1,keyDown:!1}})})),this._setEventListeners(n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],(t=>t.target.checked))):n.addEventListener("input",(function(i){t.setValue(e,{value:r(i)})})),this._setBackgroundColor(n),this.container.appendChild(n),this.container}}class w extends d{constructor(t){super(t,{isRenderable:!!(t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str)})}render(){if(this.container.className="popupAnnotation",["Line","Square","Circle","PolyLine","Polygon","Ink"].includes(this.data.parentType))return this.container;const t=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(0===t.length)return this.container;const e=new k({container:this.container,trigger:Array.from(t),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),i=this.page,n=s.Util.normalizeRect([this.data.parentRect[0],i.view[3]-this.data.parentRect[1]+i.view[1],this.data.parentRect[2],i.view[3]-this.data.parentRect[3]+i.view[1]]),r=n[0]+this.data.parentRect[2]-this.data.parentRect[0],o=n[1];return this.container.style.transformOrigin=`${-r}px ${-o}px`,this.container.style.left=`${r}px`,this.container.style.top=`${o}px`,this.container.appendChild(e.render()),this.container}}class k{constructor(t){this.container=t.container,this.trigger=t.trigger,this.color=t.color,this.titleObj=t.titleObj,this.modificationDate=t.modificationDate,this.contentsObj=t.contentsObj,this.richText=t.richText,this.hideWrapper=t.hideWrapper||!1,this.pinned=!1}render(){const t=document.createElement("div");t.className="popupWrapper",this.hideElement=this.hideWrapper?t:this.container,this.hideElement.hidden=!0;const e=document.createElement("div");e.className="popup";const i=this.color;i&&(e.style.backgroundColor=s.Util.makeHexColor(0|.7*(255-i[0])+i[0],0|.7*(255-i[1])+i[1],0|.7*(255-i[2])+i[2]));const r=document.createElement("h1");r.dir=this.titleObj.dir,r.textContent=this.titleObj.str,e.appendChild(r);const o=n.PDFDateString.toDateObject(this.modificationDate);if(o){const t=document.createElement("span");t.className="popupDate",t.textContent="{{date}}, {{time}}",t.dataset.l10nId="annotation_date_string",t.dataset.l10nArgs=JSON.stringify({date:o.toLocaleDateString(),time:o.toLocaleTimeString()}),e.appendChild(t)}if(!this.richText?.str||this.contentsObj?.str&&this.contentsObj.str!==this.richText.str){const t=this._formatContents(this.contentsObj);e.appendChild(t)}else a.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:e}),e.lastChild.className="richText popupContent";Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const t of this.trigger)t.addEventListener("click",this._toggle.bind(this)),t.addEventListener("mouseover",this._show.bind(this,!1)),t.addEventListener("mouseout",this._hide.bind(this,!1));return e.addEventListener("click",this._hide.bind(this,!0)),t.appendChild(e),t}_formatContents({str:t,dir:e}){const i=document.createElement("p");i.className="popupContent",i.dir=e;const s=t.split(/(?:\r\n?|\n)/);for(let t=0,e=s.length;t<e;++t)i.appendChild(document.createTextNode(s[t])),t<e-1&&i.appendChild(document.createElement("br"));return i}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(t=!1){t&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex+=1)}_hide(t=!0){t&&(this.pinned=!1),this.hideElement.hidden||this.pinned||(this.hideElement.hidden=!0,this.container.style.zIndex-=1)}}class y extends d{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){return this.container.className="freeTextAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class x extends d{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){this.container.className="lineAnnotation";const t=this.data,e=this.svgFactory.create(t.rect[2]-t.rect[0],t.rect[3]-t.rect[1]),i=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),i.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),i.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),i.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),i.setAttribute("stroke-width",t.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),e.appendChild(i),this.container.append(e),this._createPopup(i,t),this.container}}class _ extends d{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){this.container.className="squareAnnotation";const t=this.data,e=t.rect[2]-t.rect[0],i=t.rect[3]-t.rect[1],s=this.svgFactory.create(e,i),n=t.borderStyle.width,r=this.svgFactory.createElement("svg:rect");return r.setAttribute("x",n/2),r.setAttribute("y",n/2),r.setAttribute("width",e-n),r.setAttribute("height",i-n),r.setAttribute("stroke-width",n||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),s.appendChild(r),this.container.append(s),this._createPopup(r,t),this.container}}class D extends d{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){this.container.className="circleAnnotation";const t=this.data,e=t.rect[2]-t.rect[0],i=t.rect[3]-t.rect[1],s=this.svgFactory.create(e,i),n=t.borderStyle.width,r=this.svgFactory.createElement("svg:ellipse");return r.setAttribute("cx",e/2),r.setAttribute("cy",i/2),r.setAttribute("rx",e/2-n/2),r.setAttribute("ry",i/2-n/2),r.setAttribute("stroke-width",n||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),s.appendChild(r),this.container.append(s),this._createPopup(r,t),this.container}}class P extends d{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const t=this.data,e=this.svgFactory.create(t.rect[2]-t.rect[0],t.rect[3]-t.rect[1]);let i=[];for(const e of t.vertices)i.push(e.x-t.rect[0]+","+(t.rect[3]-e.y));i=i.join(" ");const s=this.svgFactory.createElement(this.svgElementName);return s.setAttribute("points",i),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),e.appendChild(s),this.container.append(e),this._createPopup(s,t),this.container}}class M extends P{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class O extends d{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class E extends d{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const t=this.data,e=this.svgFactory.create(t.rect[2]-t.rect[0],t.rect[3]-t.rect[1]);for(const i of t.inkLists){let s=[];for(const e of i)s.push(`${e.x-t.rect[0]},${t.rect[3]-e.y}`);s=s.join(" ");const n=this.svgFactory.createElement(this.svgElementName);n.setAttribute("points",s),n.setAttribute("stroke-width",t.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),this._createPopup(n,t),e.appendChild(n)}return this.container.append(e),this.container}}class S extends d{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("highlightAnnotation"):(this.container.className="highlightAnnotation",this.container)}}class C extends d{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("underlineAnnotation"):(this.container.className="underlineAnnotation",this.container)}}class F extends d{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.className="squigglyAnnotation",this.container)}}class T extends d{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.className="strikeoutAnnotation",this.container)}}class R extends d{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class I extends d{constructor(t){super(t,{isRenderable:!0});const{filename:e,content:i}=this.data.file;this.filename=(0,n.getFilenameFromUrl)(e),this.content=i,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,id:(0,s.stringToPDFString)(e),filename:e,content:i})}render(){this.container.className="fileAttachmentAnnotation";const t=document.createElement("div");return t.style.height=this.container.style.height,t.style.width=this.container.style.width,t.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&(this.data.titleObj?.str||this.data.contentsObj?.str||this.data.richText)&&this._createPopup(t,this.data),this.container.appendChild(t),this.container}_download(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}e.AnnotationLayer=class{static render(t){const e=[],i=[];for(const n of t.annotations)n&&(n.annotationType!==s.AnnotationType.POPUP?e.push(n):i.push(n));i.length&&e.push(...i);const o=t.div;for(const i of e){const e=l.create({data:i,layer:o,page:t.page,viewport:t.viewport,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new n.DOMSVGFactory,annotationStorage:t.annotationStorage||new r.AnnotationStorage,enableScripting:t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,mouseState:t.mouseState||{isDown:!1}});if(e.isRenderable){const t=e.render();if(i.hidden&&(t.style.visibility="hidden"),Array.isArray(t))for(const e of t)o.appendChild(e);else e instanceof w?o.prepend(t):o.appendChild(t)}}this.#o(o,t.annotationCanvasMap)}static update(t){const{page:e,viewport:i,annotations:n,annotationCanvasMap:r,div:o}=t,a=i.transform,h=`matrix(${a.join(",")})`;let c,l;for(const t of n){const i=o.querySelectorAll(`[data-annotation-id="${t.id}"]`);if(i)for(const n of i)if(t.hasOwnCanvas){const i=s.Util.normalizeRect([t.rect[0],e.view[3]-t.rect[1]+e.view[1],t.rect[2],e.view[3]-t.rect[3]+e.view[1]]);if(!l){c=Math.abs(a[0]||a[1]);const t=a.slice();for(let e=0;e<4;e++)t[e]=Math.sign(t[e]);l=`matrix(${t.join(",")})`}const r=i[0]*c,o=i[1]*c;n.style.left=`${r}px`,n.style.top=`${o}px`,n.style.transformOrigin=`${-r}px ${-o}px`,n.style.transform=l}else n.style.transform=h}this.#o(o,r),o.hidden=!1}static#o(t,e){if(e){for(const[i,s]of e){const e=t.querySelector(`[data-annotation-id="${i}"]`);if(!e)continue;const{firstChild:n}=e;"CANVAS"===n.nodeName?e.replaceChild(s,n):e.insertBefore(s,n)}e.clear()}}}},(t,e)=>{function i(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorConverters=void 0,e.ColorConverters=class{static CMYK_G([t,e,i,s]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+s)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_HTML([t]){const e=i(t);return`#${e}${e}${e}`}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_HTML([t,e,s]){return`#${i(t)}${i(e)}${i(s)}`}static T_HTML(){return"#00000000"}static CMYK_RGB([t,e,i,s]){return["RGB",1-Math.min(1,t+s),1-Math.min(1,i+s),1-Math.min(1,e+s)]}static CMYK_HTML(t){return this.RGB_HTML(this.CMYK_RGB(t))}static RGB_CMYK([t,e,i]){const s=1-t,n=1-e,r=1-i;return["CMYK",s,n,r,Math.min(s,n,r)]}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaLayer=void 0;var s=i(2),n=i(17);e.XfaLayer=class{static setupStorage(t,e,i,s,n){const r=s.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==r.value&&(t.textContent=r.value),"print"===n)break;t.addEventListener("input",(t=>{s.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(r.value===i.attributes.xfaOn?t.setAttribute("checked",!0):r.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===n)break;t.addEventListener("change",(t=>{s.setValue(e,{value:t.target.getAttribute(t.target.checked?"xfaOn":"xfaOff")})}))}else{if(null!==r.value&&t.setAttribute("value",r.value),"print"===n)break;t.addEventListener("input",(t=>{s.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==r.value)for(const t of i.children)t.attributes.value===r.value&&(t.attributes.selected=!0);t.addEventListener("input",(t=>{const i=t.target.options;s.setValue(e,{value:-1===i.selectedIndex?"":i[i.selectedIndex].value})}))}}static setAttributes({html:t,element:e,storage:i=null,intent:n,linkService:r}){const{attributes:o}=e,a=t instanceof HTMLAnchorElement;"radio"===o.type&&(o.name=`${o.name}-${n}`);for(const[e,i]of Object.entries(o))if(null!=i&&"dataId"!==e)if("style"!==e)if("textContent"===e)t.textContent=i;else if("class"===e)i.length&&t.setAttribute(e,i.join(" "));else{if(a&&("href"===e||"newWindow"===e))continue;t.setAttribute(e,i)}else Object.assign(t.style,i);a&&(r.addLinkAttributes||(0,s.warn)("XfaLayer.setAttribute - missing `addLinkAttributes`-method on the `linkService`-instance."),r.addLinkAttributes?.(t,o.href,o.newWindow)),i&&o.dataId&&this.setupStorage(t,o.dataId,e,i)}static render(t){const e=t.annotationStorage,i=t.linkService,s=t.xfaHtml,r=t.intent||"display",o=document.createElement(s.name);s.attributes&&this.setAttributes({html:o,element:s,intent:r,linkService:i});const a=[[s,-1,o]],h=t.div;if(h.appendChild(o),t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;h.style.transform=e}"richText"!==r&&h.setAttribute("class","xfaLayer xfaFont");const c=[];for(;a.length>0;){const[t,s,o]=a[a.length-1];if(s+1===t.children.length){a.pop();continue}const h=t.children[++a[a.length-1][1]];if(null===h)continue;const{name:l}=h;if("#text"===l){const t=document.createTextNode(h.value);c.push(t),o.appendChild(t);continue}let d;if(d=h?.attributes?.xmlns?document.createElementNS(h.attributes.xmlns,l):document.createElement(l),o.appendChild(d),h.attributes&&this.setAttributes({html:d,element:h,storage:e,intent:r,linkService:i}),h.children&&h.children.length>0)a.push([h,-1,d]);else if(h.value){const t=document.createTextNode(h.value);n.XfaText.shouldBuildText(l)&&c.push(t),d.appendChild(t)}}for(const t of h.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.renderTextLayer=function(t){const e=new d({textContent:t.textContent,textContentStream:t.textContentStream,container:t.container,viewport:t.viewport,textDivs:t.textDivs,textContentItemsStr:t.textContentItemsStr,enhanceTextSelection:t.enhanceTextSelection});return e._render(t.timeout),e};var s=i(2);const n=30,r=new Map,o=/^\s+$/g;function a(t,e,i,a){const h=document.createElement("span"),c=t._enhanceTextSelection?{angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1}:{angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL};t._textDivs.push(h);const l=s.Util.transform(t._viewport.transform,e.transform);let d=Math.atan2(l[1],l[0]);const u=i[e.fontName];u.vertical&&(d+=Math.PI/2);const f=Math.hypot(l[2],l[3]),p=f*function(t,e){const i=r.get(t);if(i)return i;e.save(),e.font=`30px ${t}`;const s=e.measureText("");let o=s.fontBoundingBoxAscent,a=Math.abs(s.fontBoundingBoxDescent);if(o){e.restore();const i=o/(o+a);return r.set(t,i),i}e.strokeStyle="red",e.clearRect(0,0,n,n),e.strokeText("g",0,0);let h=e.getImageData(0,0,n,n).data;a=0;for(let t=h.length-1-3;t>=0;t-=4)if(h[t]>0){a=Math.ceil(t/4/n);break}e.clearRect(0,0,n,n),e.strokeText("A",0,n),h=e.getImageData(0,0,n,n).data,o=0;for(let t=0,e=h.length;t<e;t+=4)if(h[t]>0){o=n-Math.floor(t/4/n);break}if(e.restore(),o){const e=o/(o+a);return r.set(t,e),e}return r.set(t,.8),.8}(u.fontFamily,a);let g,m;0===d?(g=l[4],m=l[5]-p):(g=l[4]+p*Math.sin(d),m=l[5]-p*Math.cos(d)),h.style.left=`${g}px`,h.style.top=`${m}px`,h.style.fontSize=`${f}px`,h.style.fontFamily=u.fontFamily,h.setAttribute("role","presentation"),h.textContent=e.str,h.dir=e.dir,t._fontInspectorEnabled&&(h.dataset.fontName=e.fontName),0!==d&&(c.angle=d*(180/Math.PI));let b=!1;if(e.str.length>1||t._enhanceTextSelection&&o.test(e.str))b=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),i=Math.abs(e.transform[3]);t!==i&&Math.max(t,i)/Math.min(t,i)>1.5&&(b=!0)}if(b&&(c.canvasWidth=u.vertical?e.height*t._viewport.scale:e.width*t._viewport.scale),t._textDivProperties.set(h,c),t._textContentStream&&t._layoutText(h),t._enhanceTextSelection&&c.hasText){let i=1,n=0;0!==d&&(i=Math.cos(d),n=Math.sin(d));const r=(u.vertical?e.height:e.width)*t._viewport.scale,o=f;let a,c;0!==d?(a=[i,n,-n,i,g,m],c=s.Util.getAxialAlignedBoundingBox([0,0,r,o],a)):c=[g,m,g+r,m+o],t._bounds.push({left:c[0],top:c[1],right:c[2],bottom:c[3],div:h,size:[r,o],m:a})}}function h(t){if(t._canceled)return;const e=t._textDivs,i=t._capability,s=e.length;if(s>1e5)return t._renderingDone=!0,void i.resolve();if(!t._textContentStream)for(let i=0;i<s;i++)t._layoutText(e[i]);t._renderingDone=!0,i.resolve()}function c(t,e,i){let s=0;for(let n=0;n<i;n++){const i=t[e++];i>0&&(s=s?Math.min(i,s):i)}return s}function l(t,e){e.sort((function(t,e){return t.x1-e.x1||t.index-e.index}));const i=[{start:-1/0,end:1/0,boundary:{x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0}}];for(const t of e){let e=0;for(;e<i.length&&i[e].end<=t.y1;)e++;let s,n,r=i.length-1;for(;r>=0&&i[r].start>=t.y2;)r--;let o,a,h=-1/0;for(o=e;o<=r;o++){let e;s=i[o],n=s.boundary,e=n.x2>t.x1?n.index>t.index?n.x1New:t.x1:void 0===n.x2New?(n.x2+t.x1)/2:n.x2New,e>h&&(h=e)}for(t.x1New=h,o=e;o<=r;o++)s=i[o],n=s.boundary,void 0===n.x2New?n.x2>t.x1?n.index>t.index&&(n.x2New=n.x2):n.x2New=h:n.x2New>h&&(n.x2New=Math.max(h,n.x2));const c=[];let l=null;for(o=e;o<=r;o++){s=i[o],n=s.boundary;const e=n.x2>t.x2?n:t;l===e?c[c.length-1].end=s.end:(c.push({start:s.start,end:s.end,boundary:e}),l=e)}for(i[e].start<t.y1&&(c[0].start=t.y1,c.unshift({start:i[e].start,end:t.y1,boundary:i[e].boundary})),t.y2<i[r].end&&(c[c.length-1].end=t.y2,c.push({start:t.y2,end:i[r].end,boundary:i[r].boundary})),o=e;o<=r;o++){if(s=i[o],n=s.boundary,void 0!==n.x2New)continue;let t=!1;for(a=e-1;!t&&a>=0&&i[a].start>=n.y1;a--)t=i[a].boundary===n;for(a=r+1;!t&&a<i.length&&i[a].end<=n.y2;a++)t=i[a].boundary===n;for(a=0;!t&&a<c.length;a++)t=c[a].boundary===n;t||(n.x2New=h)}Array.prototype.splice.apply(i,[e,r-e+1].concat(c))}for(const e of i){const i=e.boundary;void 0===i.x2New&&(i.x2New=Math.max(t,i.x2))}}class d{constructor({textContent:t,textContentStream:e,container:i,viewport:n,textDivs:r,textContentItemsStr:o,enhanceTextSelection:a}){this._textContent=t,this._textContentStream=e,this._container=i,this._document=i.ownerDocument,this._viewport=n,this._textDivs=r||[],this._textContentItemsStr=o||[],this._enhanceTextSelection=!!a,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._layoutTextLastFontSize=null,this._layoutTextLastFontFamily=null,this._layoutTextCtx=null,this._textDivProperties=new WeakMap,this._renderingDone=!1,this._canceled=!1,this._capability=(0,s.createPromiseCapability)(),this._renderTimer=null,this._bounds=[],this._capability.promise.finally((()=>{this._enhanceTextSelection||(this._textDivProperties=null),this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=null)})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new s.AbortException("TextLayer task cancelled.")).catch((()=>{})),this._reader=null),null!==this._renderTimer&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))}_processItems(t,e){for(let i=0,s=t.length;i<s;i++)if(void 0!==t[i].str)this._textContentItemsStr.push(t[i].str),a(this,t[i],e,this._layoutTextCtx);else if("beginMarkedContentProps"===t[i].type||"beginMarkedContent"===t[i].type){const e=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==t[i].id&&this._container.setAttribute("id",`${t[i].id}`),e.appendChild(this._container)}else"endMarkedContent"===t[i].type&&(this._container=this._container.parentNode)}_layoutText(t){const e=this._textDivProperties.get(t);let i="";if(0!==e.canvasWidth&&e.hasText){const{fontSize:s,fontFamily:n}=t.style;s===this._layoutTextLastFontSize&&n===this._layoutTextLastFontFamily||(this._layoutTextCtx.font=`${s} ${n}`,this._layoutTextLastFontSize=s,this._layoutTextLastFontFamily=n);const{width:r}=this._layoutTextCtx.measureText(t.textContent);if(r>0){const t=e.canvasWidth/r;this._enhanceTextSelection&&(e.scale=t),i=`scaleX(${t})`}}if(0!==e.angle&&(i=`rotate(${e.angle}deg) ${i}`),i.length>0&&(this._enhanceTextSelection&&(e.originalTransform=i),t.style.transform=i),e.hasText&&this._container.appendChild(t),e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),this._container.appendChild(t)}}_render(t=0){const e=(0,s.createPromiseCapability)();let i=Object.create(null);const r=this._document.createElement("canvas");if(r.height=r.width=n,r.mozOpaque=!0,this._layoutTextCtx=r.getContext("2d",{alpha:!1}),this._textContent)this._processItems(this._textContent.items,this._textContent.styles),e.resolve();else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');{const t=()=>{this._reader.read().then((({value:s,done:n})=>{n?e.resolve():(Object.assign(i,s.styles),this._processItems(s.items,i),t())}),e.reject)};this._reader=this._textContentStream.getReader(),t()}}e.promise.then((()=>{i=null,t?this._renderTimer=setTimeout((()=>{h(this),this._renderTimer=null}),t):h(this)}),this._capability.reject)}expandTextDivs(t=!1){if(!this._enhanceTextSelection||!this._renderingDone)return;null!==this._bounds&&(function(t){const e=t._bounds,i=t._viewport,n=function(t,e,i){const s=i.map((function(t,e){return{x1:t.left,y1:t.top,x2:t.right,y2:t.bottom,index:e,x1New:void 0,x2New:void 0}}));l(t,s);const n=new Array(i.length);for(const t of s)n[t.index]={left:t.x1New,top:0,right:t.x2New,bottom:0};i.map((function(e,i){const r=n[i],o=s[i];o.x1=e.top,o.y1=t-r.right,o.x2=e.bottom,o.y2=t-r.left,o.index=i,o.x1New=void 0,o.x2New=void 0})),l(e,s);for(const t of s){const e=t.index;n[e].top=t.x1New,n[e].bottom=t.x2New}return n}(i.width,i.height,e);for(let i=0;i<n.length;i++){const r=e[i].div,o=t._textDivProperties.get(r);if(0===o.angle){o.paddingLeft=e[i].left-n[i].left,o.paddingTop=e[i].top-n[i].top,o.paddingRight=n[i].right-e[i].right,o.paddingBottom=n[i].bottom-e[i].bottom,t._textDivProperties.set(r,o);continue}const a=n[i],h=e[i],l=h.m,d=l[0],u=l[1],f=[[0,0],[0,h.size[1]],[h.size[0],0],h.size],p=new Float64Array(64);for(let t=0,e=f.length;t<e;t++){const e=s.Util.applyTransform(f[t],l);p[t+0]=d&&(a.left-e[0])/d,p[t+4]=u&&(a.top-e[1])/u,p[t+8]=d&&(a.right-e[0])/d,p[t+12]=u&&(a.bottom-e[1])/u,p[t+16]=u&&(a.left-e[0])/-u,p[t+20]=d&&(a.top-e[1])/d,p[t+24]=u&&(a.right-e[0])/-u,p[t+28]=d&&(a.bottom-e[1])/d,p[t+32]=d&&(a.left-e[0])/-d,p[t+36]=u&&(a.top-e[1])/-u,p[t+40]=d&&(a.right-e[0])/-d,p[t+44]=u&&(a.bottom-e[1])/-u,p[t+48]=u&&(a.left-e[0])/u,p[t+52]=d&&(a.top-e[1])/-d,p[t+56]=u&&(a.right-e[0])/u,p[t+60]=d&&(a.bottom-e[1])/-d}const g=1+Math.min(Math.abs(d),Math.abs(u));o.paddingLeft=c(p,32,16)/g,o.paddingTop=c(p,48,16)/g,o.paddingRight=c(p,0,16)/g,o.paddingBottom=c(p,16,16)/g,t._textDivProperties.set(r,o)}}(this),this._bounds=null);const e=[],i=[];for(let s=0,n=this._textDivs.length;s<n;s++){const n=this._textDivs[s],r=this._textDivProperties.get(n);r.hasText&&(t?(e.length=0,i.length=0,r.originalTransform&&e.push(r.originalTransform),r.paddingTop>0?(i.push(`${r.paddingTop}px`),e.push(`translateY(${-r.paddingTop}px)`)):i.push(0),i.push(r.paddingRight>0?r.paddingRight/r.scale+"px":0),i.push(r.paddingBottom>0?`${r.paddingBottom}px`:0),r.paddingLeft>0?(i.push(r.paddingLeft/r.scale+"px"),e.push(`translateX(${-r.paddingLeft/r.scale}px)`)):i.push(0),n.style.padding=i.join(" "),e.length&&(n.style.transform=e.join(" "))):(n.style.padding=null,n.style.transform=r.originalTransform))}}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0;var s=i(2),n=i(1),r=i(4);let o=class{constructor(){(0,s.unreachable)("Not implemented: SVGGraphics")}};e.SVGGraphics=o;{const t={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},i="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/1999/xlink",l=["butt","round","square"],d=["miter","round","bevel"],u=function(){const t=new Uint8Array([137,80,78,71,13,10,26,10]),e=new Int32Array(256);for(let t=0;t<256;t++){let i=t;for(let t=0;t<8;t++)i=1&i?3988292384^i>>1&2147483647:i>>1&2147483647;e[t]=i}function i(t,i,s,n){let r=n;const o=i.length;s[r]=o>>24&255,s[r+1]=o>>16&255,s[r+2]=o>>8&255,s[r+3]=255&o,r+=4,s[r]=255&t.charCodeAt(0),s[r+1]=255&t.charCodeAt(1),s[r+2]=255&t.charCodeAt(2),s[r+3]=255&t.charCodeAt(3),r+=4,s.set(i,r),r+=i.length;const a=function(t,i,s){let n=-1;for(let r=i;r<s;r++)n=n>>>8^e[255&(n^t[r])];return-1^n}(s,n+4,r);s[r]=a>>24&255,s[r+1]=a>>16&255,s[r+2]=a>>8&255,s[r+3]=255&a}function n(t){let e=t.length;const i=65535,s=Math.ceil(e/i),n=new Uint8Array(2+e+5*s+4);let r=0;n[r++]=120,n[r++]=156;let o=0;for(;e>i;)n[r++]=0,n[r++]=255,n[r++]=255,n[r++]=0,n[r++]=0,n.set(t.subarray(o,o+i),r),r+=i,o+=i,e-=i;n[r++]=1,n[r++]=255&e,n[r++]=e>>8&255,n[r++]=255&~e,n[r++]=(65535&~e)>>8&255,n.set(t.subarray(o),r),r+=t.length-o;const a=function(t,e,i){let s=1,n=0;for(let e=0;e<i;++e)s=(s+(255&t[e]))%65521,n=(n+s)%65521;return n<<16|s}(t,0,t.length);return n[r++]=a>>24&255,n[r++]=a>>16&255,n[r++]=a>>8&255,n[r++]=255&a,n}return function(e,o,a){return function(e,o,a,h){const c=e.width,l=e.height;let d,u,f;const p=e.data;switch(o){case s.ImageKind.GRAYSCALE_1BPP:u=0,d=1,f=c+7>>3;break;case s.ImageKind.RGB_24BPP:u=2,d=8,f=3*c;break;case s.ImageKind.RGBA_32BPP:u=6,d=8,f=4*c;break;default:throw new Error("invalid format")}const g=new Uint8Array((1+f)*l);let m=0,b=0;for(let t=0;t<l;++t)g[m++]=0,g.set(p.subarray(b,b+f),m),b+=f,m+=f;if(o===s.ImageKind.GRAYSCALE_1BPP&&h){m=0;for(let t=0;t<l;t++){m++;for(let t=0;t<f;t++)g[m++]^=255}}const A=new Uint8Array([c>>24&255,c>>16&255,c>>8&255,255&c,l>>24&255,l>>16&255,l>>8&255,255&l,d,u,0,0,0]),v=function(t){if(!r.isNodeJS)return n(t);try{let e;e=parseInt(process_1.versions.node)>=8?t:Buffer.from(t);const i=require$$5.deflateSync(e,{level:9});return i instanceof Uint8Array?i:new Uint8Array(i)}catch(t){(0,s.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return n(t)}(g),w=new Uint8Array(t.length+36+A.length+v.length);let k=0;return w.set(t,k),k+=t.length,i("IHDR",A,w,k),k+=12+A.length,i("IDATA",v,w,k),k+=12+v.length,i("IEND",new Uint8Array(0),w,k),(0,s.createObjectURL)(w,"image/png",a)}(e,void 0===e.kind?s.ImageKind.GRAYSCALE_1BPP:e.kind,o,a)}}();class f{constructor(){this.fontSizeScale=1,this.fontWeight=t.fontWeight,this.fontSize=0,this.textMatrix=s.IDENTITY_MATRIX,this.fontMatrix=s.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=s.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=t.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(t,e){this.x=t,this.y=e}}function a(t){if(Number.isInteger(t))return t.toString();const e=t.toFixed(10);let i=e.length-1;if("0"!==e[i])return e;do{i--}while("0"===e[i]);return e.substring(0,"."===e[i]?i:i+1)}function h(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":`scale(${a(t[0])} ${a(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2])return`rotate(${a(180*Math.acos(t[0])/Math.PI)})`}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${a(t[4])} ${a(t[5])})`;return`matrix(${a(t[0])} ${a(t[1])} ${a(t[2])} ${a(t[3])} ${a(t[4])} ${a(t[5])})`}let p=0,g=0,m=0;e.SVGGraphics=o=class{constructor(t,e,i=!1){this.svgFactory=new n.DOMSVGFactory,this.current=new f,this.transformMatrix=s.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=t,this.objs=e,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!i,this._operatorIdMapping=[];for(const t in s.OPS)this._operatorIdMapping[s.OPS[t]]=t}save(){this.transformStack.push(this.transformMatrix);const t=this.current;this.extraStack.push(t),this.current=t.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(t){this.save(),this.executeOpTree(t),this.restore()}loadDependencies(t){const e=t.fnArray,i=t.argsArray;for(let t=0,n=e.length;t<n;t++)if(e[t]===s.OPS.dependency)for(const e of i[t]){const t=e.startsWith("g_")?this.commonObjs:this.objs,i=new Promise((i=>{t.get(e,i)}));this.current.dependencies.push(i)}return Promise.all(this.current.dependencies)}transform(t,e,i,n,r,o){this.transformMatrix=s.Util.transform(this.transformMatrix,[t,e,i,n,r,o]),this.tgrp=null}getSVG(t,e){this.viewport=e;const i=this._initialize(e);return this.loadDependencies(t).then((()=>(this.transformMatrix=s.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(t)),i)))}convertOpList(t){const e=this._operatorIdMapping,i=t.argsArray,s=t.fnArray,n=[];for(let t=0,r=s.length;t<r;t++){const r=s[t];n.push({fnId:r,fn:e[r],args:i[t]})}return function(t){let e=[];const i=[];for(const s of t)"save"!==s.fn?"restore"===s.fn?e=i.pop():e.push(s):(e.push({fnId:92,fn:"group",items:[]}),i.push(e),e=e[e.length-1].items);return e}(n)}executeOpTree(t){for(const e of t){const t=e.fn,i=e.args;switch(0|e.fnId){case s.OPS.beginText:this.beginText();break;case s.OPS.dependency:break;case s.OPS.setLeading:this.setLeading(i);break;case s.OPS.setLeadingMoveText:this.setLeadingMoveText(i[0],i[1]);break;case s.OPS.setFont:this.setFont(i);break;case s.OPS.showText:case s.OPS.showSpacedText:this.showText(i[0]);break;case s.OPS.endText:this.endText();break;case s.OPS.moveText:this.moveText(i[0],i[1]);break;case s.OPS.setCharSpacing:this.setCharSpacing(i[0]);break;case s.OPS.setWordSpacing:this.setWordSpacing(i[0]);break;case s.OPS.setHScale:this.setHScale(i[0]);break;case s.OPS.setTextMatrix:this.setTextMatrix(i[0],i[1],i[2],i[3],i[4],i[5]);break;case s.OPS.setTextRise:this.setTextRise(i[0]);break;case s.OPS.setTextRenderingMode:this.setTextRenderingMode(i[0]);break;case s.OPS.setLineWidth:this.setLineWidth(i[0]);break;case s.OPS.setLineJoin:this.setLineJoin(i[0]);break;case s.OPS.setLineCap:this.setLineCap(i[0]);break;case s.OPS.setMiterLimit:this.setMiterLimit(i[0]);break;case s.OPS.setFillRGBColor:this.setFillRGBColor(i[0],i[1],i[2]);break;case s.OPS.setStrokeRGBColor:this.setStrokeRGBColor(i[0],i[1],i[2]);break;case s.OPS.setStrokeColorN:this.setStrokeColorN(i);break;case s.OPS.setFillColorN:this.setFillColorN(i);break;case s.OPS.shadingFill:this.shadingFill(i[0]);break;case s.OPS.setDash:this.setDash(i[0],i[1]);break;case s.OPS.setRenderingIntent:this.setRenderingIntent(i[0]);break;case s.OPS.setFlatness:this.setFlatness(i[0]);break;case s.OPS.setGState:this.setGState(i[0]);break;case s.OPS.fill:this.fill();break;case s.OPS.eoFill:this.eoFill();break;case s.OPS.stroke:this.stroke();break;case s.OPS.fillStroke:this.fillStroke();break;case s.OPS.eoFillStroke:this.eoFillStroke();break;case s.OPS.clip:this.clip("nonzero");break;case s.OPS.eoClip:this.clip("evenodd");break;case s.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case s.OPS.paintImageXObject:this.paintImageXObject(i[0]);break;case s.OPS.paintInlineImageXObject:this.paintInlineImageXObject(i[0]);break;case s.OPS.paintImageMaskXObject:this.paintImageMaskXObject(i[0]);break;case s.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(i[0],i[1]);break;case s.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case s.OPS.closePath:this.closePath();break;case s.OPS.closeStroke:this.closeStroke();break;case s.OPS.closeFillStroke:this.closeFillStroke();break;case s.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case s.OPS.nextLine:this.nextLine();break;case s.OPS.transform:this.transform(i[0],i[1],i[2],i[3],i[4],i[5]);break;case s.OPS.constructPath:this.constructPath(i[0],i[1]);break;case s.OPS.endPath:this.endPath();break;case 92:this.group(e.items);break;default:(0,s.warn)(`Unimplemented operator ${t}`)}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,i,s,n,r){const o=this.current;o.textMatrix=o.lineMatrix=[t,e,i,s,n,r],o.textMatrixScale=Math.hypot(t,e),o.x=o.lineX=0,o.y=o.lineY=0,o.xcoords=[],o.ycoords=[],o.tspan=this.svgFactory.createElement("svg:tspan"),o.tspan.setAttributeNS(null,"font-family",o.fontFamily),o.tspan.setAttributeNS(null,"font-size",`${a(o.fontSize)}px`),o.tspan.setAttributeNS(null,"y",a(-o.y)),o.txtElement=this.svgFactory.createElement("svg:text"),o.txtElement.appendChild(o.tspan)}beginText(){const t=this.current;t.x=t.lineX=0,t.y=t.lineY=0,t.textMatrix=s.IDENTITY_MATRIX,t.lineMatrix=s.IDENTITY_MATRIX,t.textMatrixScale=1,t.tspan=this.svgFactory.createElement("svg:tspan"),t.txtElement=this.svgFactory.createElement("svg:text"),t.txtgrp=this.svgFactory.createElement("svg:g"),t.xcoords=[],t.ycoords=[]}moveText(t,e){const i=this.current;i.x=i.lineX+=t,i.y=i.lineY+=e,i.xcoords=[],i.ycoords=[],i.tspan=this.svgFactory.createElement("svg:tspan"),i.tspan.setAttributeNS(null,"font-family",i.fontFamily),i.tspan.setAttributeNS(null,"font-size",`${a(i.fontSize)}px`),i.tspan.setAttributeNS(null,"y",a(-i.y))}showText(e){const n=this.current,r=n.font,o=n.fontSize;if(0===o)return;const c=n.fontSizeScale,l=n.charSpacing,d=n.wordSpacing,u=n.fontDirection,f=n.textHScale*u,p=r.vertical,g=p?1:-1,m=r.defaultVMetrics,b=o*n.fontMatrix[0];let A=0;for(const t of e){if(null===t){A+=u*d;continue}if((0,s.isNum)(t)){A+=g*t*o/1e3;continue}const e=(t.isSpace?d:0)+l,i=t.fontChar;let a,h,f,v=t.width;if(p){let e;const i=t.vmetric||m;e=t.vmetric?i[1]:.5*v,e=-e*b,v=i?-i[0]:v,a=e/c,h=(A+i[2]*b)/c}else a=A/c,h=0;(t.isInFont||r.missingFile)&&(n.xcoords.push(n.x+a),p&&n.ycoords.push(-n.y+h),n.tspan.textContent+=i),f=p?v*b-e*u:v*b+e*u,A+=f}n.tspan.setAttributeNS(null,"x",n.xcoords.map(a).join(" ")),n.tspan.setAttributeNS(null,"y",p?n.ycoords.map(a).join(" "):a(-n.y)),p?n.y-=A:n.x+=A*f,n.tspan.setAttributeNS(null,"font-family",n.fontFamily),n.tspan.setAttributeNS(null,"font-size",`${a(n.fontSize)}px`),n.fontStyle!==t.fontStyle&&n.tspan.setAttributeNS(null,"font-style",n.fontStyle),n.fontWeight!==t.fontWeight&&n.tspan.setAttributeNS(null,"font-weight",n.fontWeight);const v=n.textRenderingMode&s.TextRenderingMode.FILL_STROKE_MASK;v===s.TextRenderingMode.FILL||v===s.TextRenderingMode.FILL_STROKE?(n.fillColor!==t.fillColor&&n.tspan.setAttributeNS(null,"fill",n.fillColor),n.fillAlpha<1&&n.tspan.setAttributeNS(null,"fill-opacity",n.fillAlpha)):n.tspan.setAttributeNS(null,"fill",n.textRenderingMode===s.TextRenderingMode.ADD_TO_PATH?"transparent":"none"),(v===s.TextRenderingMode.STROKE||v===s.TextRenderingMode.FILL_STROKE)&&this._setStrokeAttributes(n.tspan,1/(n.textMatrixScale||1));let w=n.textMatrix;0!==n.textRise&&(w=w.slice(),w[5]+=n.textRise),n.txtElement.setAttributeNS(null,"transform",`${h(w)} scale(${a(f)}, -1)`),n.txtElement.setAttributeNS(i,"xml:space","preserve"),n.txtElement.appendChild(n.tspan),n.txtgrp.appendChild(n.txtElement),this._ensureTransformGroup().appendChild(n.txtElement)}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}addFontStyle(t){if(!t.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.appendChild(this.cssStyle));const e=(0,s.createObjectURL)(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${t.loadedName}"; src: url(${e}); }\n`}setFont(t){const e=this.current,i=this.commonObjs.get(t[0]);let n=t[1];e.font=i,!this.embedFonts||i.missingFile||this.embeddedFonts[i.loadedName]||(this.addFontStyle(i),this.embeddedFonts[i.loadedName]=i),e.fontMatrix=i.fontMatrix||s.FONT_IDENTITY_MATRIX;let r="normal";i.black?r="900":i.bold&&(r="bold");const o=i.italic?"italic":"normal";n<0?(n=-n,e.fontDirection=-1):e.fontDirection=1,e.fontSize=n,e.fontFamily=i.loadedName,e.fontWeight=r,e.fontStyle=o,e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"y",a(-e.y)),e.xcoords=[],e.ycoords=[]}endText(){const t=this.current;t.textRenderingMode&s.TextRenderingMode.ADD_TO_PATH_FLAG&&t.txtElement?.hasChildNodes()&&(t.element=t.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(t){t>0&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=l[t]}setLineJoin(t){this.current.lineJoin=d[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,i){this.current.strokeColor=s.Util.makeHexColor(t,e,i)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,i){this.current.fillColor=s.Util.makeHexColor(t,e,i),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}shadingFill(t){const e=this.viewport.width,i=this.viewport.height,n=s.Util.inverseTransform(this.transformMatrix),r=s.Util.applyTransform([0,0],n),o=s.Util.applyTransform([0,i],n),a=s.Util.applyTransform([e,0],n),h=s.Util.applyTransform([e,i],n),c=Math.min(r[0],o[0],a[0],h[0]),l=Math.min(r[1],o[1],a[1],h[1]),d=Math.max(r[0],o[0],a[0],h[0]),u=Math.max(r[1],o[1],a[1],h[1]),f=this.svgFactory.createElement("svg:rect");f.setAttributeNS(null,"x",c),f.setAttributeNS(null,"y",l),f.setAttributeNS(null,"width",d-c),f.setAttributeNS(null,"height",u-l),f.setAttributeNS(null,"fill",this._makeShadingPattern(t)),this.current.fillAlpha<1&&f.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().appendChild(f)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){const e=t[1],i=t[2],n=t[3]||s.IDENTITY_MATRIX,[r,o,a,h]=t[4],c=t[5],l=t[6],d=t[7],u="shading"+m++,[f,p,g,b]=s.Util.normalizeRect([...s.Util.applyTransform([r,o],n),...s.Util.applyTransform([a,h],n)]),[A,v]=s.Util.singularValueDecompose2dScale(n),w=c*A,k=l*v,y=this.svgFactory.createElement("svg:pattern");y.setAttributeNS(null,"id",u),y.setAttributeNS(null,"patternUnits","userSpaceOnUse"),y.setAttributeNS(null,"width",w),y.setAttributeNS(null,"height",k),y.setAttributeNS(null,"x",`${f}`),y.setAttributeNS(null,"y",`${p}`);const x=this.svg,_=this.transformMatrix,D=this.current.fillColor,P=this.current.strokeColor,M=this.svgFactory.create(g-f,b-p);if(this.svg=M,this.transformMatrix=n,2===d){const t=s.Util.makeHexColor(...e);this.current.fillColor=t,this.current.strokeColor=t}return this.executeOpTree(this.convertOpList(i)),this.svg=x,this.transformMatrix=_,this.current.fillColor=D,this.current.strokeColor=P,y.appendChild(M.childNodes[0]),this.defs.appendChild(y),`url(#${u})`}_makeShadingPattern(t){switch("string"==typeof t&&(t=this.objs.get(t)),t[0]){case"RadialAxial":const e="shading"+m++,i=t[3];let n;switch(t[1]){case"axial":const i=t[4],s=t[5];n=this.svgFactory.createElement("svg:linearGradient"),n.setAttributeNS(null,"id",e),n.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),n.setAttributeNS(null,"x1",i[0]),n.setAttributeNS(null,"y1",i[1]),n.setAttributeNS(null,"x2",s[0]),n.setAttributeNS(null,"y2",s[1]);break;case"radial":const r=t[4],o=t[5],a=t[6],h=t[7];n=this.svgFactory.createElement("svg:radialGradient"),n.setAttributeNS(null,"id",e),n.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),n.setAttributeNS(null,"cx",o[0]),n.setAttributeNS(null,"cy",o[1]),n.setAttributeNS(null,"r",h),n.setAttributeNS(null,"fx",r[0]),n.setAttributeNS(null,"fy",r[1]),n.setAttributeNS(null,"fr",a);break;default:throw new Error(`Unknown RadialAxial type: ${t[1]}`)}for(const t of i){const e=this.svgFactory.createElement("svg:stop");e.setAttributeNS(null,"offset",t[0]),e.setAttributeNS(null,"stop-color",t[1]),n.appendChild(e)}return this.defs.appendChild(n),`url(#${e})`;case"Mesh":return(0,s.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${t[0]}`)}}setDash(t,e){this.current.dashArray=t,this.current.dashPhase=e}constructPath(t,e){const i=this.current;let n=i.x,r=i.y,o=[],h=0;for(const i of t)switch(0|i){case s.OPS.rectangle:n=e[h++],r=e[h++];const t=n+e[h++],i=r+e[h++];o.push("M",a(n),a(r),"L",a(t),a(r),"L",a(t),a(i),"L",a(n),a(i),"Z");break;case s.OPS.moveTo:n=e[h++],r=e[h++],o.push("M",a(n),a(r));break;case s.OPS.lineTo:n=e[h++],r=e[h++],o.push("L",a(n),a(r));break;case s.OPS.curveTo:n=e[h+4],r=e[h+5],o.push("C",a(e[h]),a(e[h+1]),a(e[h+2]),a(e[h+3]),a(n),a(r)),h+=6;break;case s.OPS.curveTo2:o.push("C",a(n),a(r),a(e[h]),a(e[h+1]),a(e[h+2]),a(e[h+3])),n=e[h+2],r=e[h+3],h+=4;break;case s.OPS.curveTo3:n=e[h+2],r=e[h+3],o.push("C",a(e[h]),a(e[h+1]),a(n),a(r),a(n),a(r)),h+=4;break;case s.OPS.closePath:o.push("Z")}o=o.join(" "),i.path&&t.length>0&&t[0]!==s.OPS.rectangle&&t[0]!==s.OPS.moveTo?o=i.path.getAttributeNS(null,"d")+o:(i.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(i.path)),i.path.setAttributeNS(null,"d",o),i.path.setAttributeNS(null,"fill","none"),i.element=i.path,i.setCurrentPoint(n,r)}endPath(){const t=this.current;if(t.path=null,!this.pendingClip)return;if(!t.element)return void(this.pendingClip=null);const e="clippath"+p++,i=this.svgFactory.createElement("svg:clipPath");i.setAttributeNS(null,"id",e),i.setAttributeNS(null,"transform",h(this.transformMatrix));const s=t.element.cloneNode(!0);if(s.setAttributeNS(null,"clip-rule","evenodd"===this.pendingClip?"evenodd":"nonzero"),this.pendingClip=null,i.appendChild(s),this.defs.appendChild(i),t.activeClipUrl){t.clipGroup=null;for(const t of this.extraStack)t.clipGroup=null;i.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl=`url(#${e})`,this.tgrp=null}clip(t){this.pendingClip=t}closePath(){const t=this.current;if(t.path){const e=`${t.path.getAttributeNS(null,"d")}Z`;t.path.setAttributeNS(null,"d",e)}}setLeading(t){this.current.leading=-t}setTextRise(t){this.current.textRise=t}setTextRenderingMode(t){this.current.textRenderingMode=t}setHScale(t){this.current.textHScale=t/100}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i);break;case"CA":this.setStrokeAlpha(i);break;case"ca":this.setFillAlpha(i);break;default:(0,s.warn)(`Unimplemented graphic state operator ${e}`)}}fill(){const t=this.current;t.element&&(t.element.setAttributeNS(null,"fill",t.fillColor),t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha),this.endPath())}stroke(){const t=this.current;t.element&&(this._setStrokeAttributes(t.element),t.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(t,e=1){const i=this.current;let s=i.dashArray;1!==e&&s.length>0&&(s=s.map((function(t){return e*t}))),t.setAttributeNS(null,"stroke",i.strokeColor),t.setAttributeNS(null,"stroke-opacity",i.strokeAlpha),t.setAttributeNS(null,"stroke-miterlimit",a(i.miterLimit)),t.setAttributeNS(null,"stroke-linecap",i.lineCap),t.setAttributeNS(null,"stroke-linejoin",i.lineJoin),t.setAttributeNS(null,"stroke-width",a(e*i.lineWidth)+"px"),t.setAttributeNS(null,"stroke-dasharray",s.map(a).join(" ")),t.setAttributeNS(null,"stroke-dashoffset",a(e*i.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0"),t.setAttributeNS(null,"y","0"),t.setAttributeNS(null,"width","1px"),t.setAttributeNS(null,"height","1px"),t.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().appendChild(t)}paintImageXObject(t){const e=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);e?this.paintInlineImageXObject(e):(0,s.warn)(`Dependent image with object ID ${t} is not ready yet`)}paintInlineImageXObject(t,e){const i=t.width,s=t.height,n=u(t,this.forceDataSchema,!!e),r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x","0"),r.setAttributeNS(null,"y","0"),r.setAttributeNS(null,"width",a(i)),r.setAttributeNS(null,"height",a(s)),this.current.element=r,this.clip("nonzero");const o=this.svgFactory.createElement("svg:image");o.setAttributeNS(c,"xlink:href",n),o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y",a(-s)),o.setAttributeNS(null,"width",a(i)+"px"),o.setAttributeNS(null,"height",a(s)+"px"),o.setAttributeNS(null,"transform",`scale(${a(1/i)} ${a(-1/s)})`),e?e.appendChild(o):this._ensureTransformGroup().appendChild(o)}paintImageMaskXObject(t){const e=this.current,i=t.width,s=t.height,n=e.fillColor;e.maskId="mask"+g++;const r=this.svgFactory.createElement("svg:mask");r.setAttributeNS(null,"id",e.maskId);const o=this.svgFactory.createElement("svg:rect");o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","0"),o.setAttributeNS(null,"width",a(i)),o.setAttributeNS(null,"height",a(s)),o.setAttributeNS(null,"fill",n),o.setAttributeNS(null,"mask",`url(#${e.maskId})`),this.defs.appendChild(r),this._ensureTransformGroup().appendChild(o),this.paintInlineImageXObject(t,r)}paintFormXObjectBegin(t,e){if(Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e){const t=e[2]-e[0],i=e[3]-e[1],s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x",e[0]),s.setAttributeNS(null,"y",e[1]),s.setAttributeNS(null,"width",a(t)),s.setAttributeNS(null,"height",a(i)),this.current.element=s,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(t){const e=this.svgFactory.create(t.width,t.height),i=this.svgFactory.createElement("svg:defs");e.appendChild(i),this.defs=i;const s=this.svgFactory.createElement("svg:g");return s.setAttributeNS(null,"transform",h(t.transform)),e.appendChild(s),this.svg=s,e}_ensureClipGroup(){if(!this.current.clipGroup){const t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(t),this.current.clipGroup=t}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",h(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0;var s=i(2),n=i(24);const r=require$$5,o=require$$5,a=require$$5,h=require$$5,c=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class{constructor(t){this.source=t,this.url=function(t){const e=h.parse(t);return"file:"===e.protocol||e.host?e:/^[a-z]:[/\\]/i.test(t)?h.parse(`file:///${t}`):(e.host||(e.protocol="file:"),e)}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new g(this):new f(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new m(this,t,e):new p(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class l{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=(0,s.createPromiseCapability)(),this._headersCapability=(0,s.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=(0,s.createPromiseCapability)(),this.read()):(this._loaded+=t.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new s.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class d{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,s.createPromiseCapability)(),this._isStreamingSupported=!t.source.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=(0,s.createPromiseCapability)(),this.read()):(this._loaded+=t.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function u(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class f extends l{constructor(t){super(t);const e=e=>{if(404===e.statusCode){const t=new s.MissingPDFException(`Missing PDF "${this._url}".`);return this._storedError=t,void this._headersCapability.reject(t)}this._headersCapability.resolve(),this._setReadableStream(e);const i=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:r,suggestedLength:o}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=o||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(i)};this._request=null,this._request="http:"===this._url.protocol?o.request(u(this._url,t.httpHeaders),e):a.request(u(this._url,t.httpHeaders),e),this._request.on("error",(t=>{this._storedError=t,this._headersCapability.reject(t)})),this._request.end()}}class p extends d{constructor(t,e,i){super(t),this._httpHeaders={};for(const e in t.httpHeaders){const i=t.httpHeaders[e];void 0!==i&&(this._httpHeaders[e]=i)}this._httpHeaders.Range=`bytes=${e}-${i-1}`;const n=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new s.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t}};this._request=null,this._request="http:"===this._url.protocol?o.request(u(this._url,this._httpHeaders),n):a.request(u(this._url,this._httpHeaders),n),this._request.on("error",(t=>{this._storedError=t})),this._request.end()}}class g extends l{constructor(t){super(t);let e=decodeURIComponent(this._url.path);c.test(this._url.href)&&(e=e.replace(/^\//,"")),r.lstat(e,((t,i)=>{if(t)return"ENOENT"===t.code&&(t=new s.MissingPDFException(`Missing PDF "${e}".`)),this._storedError=t,void this._headersCapability.reject(t);this._contentLength=i.size,this._setReadableStream(r.createReadStream(e)),this._headersCapability.resolve()}))}}class m extends d{constructor(t,e,i){super(t);let s=decodeURIComponent(this._url.path);c.test(this._url.href)&&(s=s.replace(/^\//,"")),this._setReadableStream(r.createReadStream(s,{start:e,end:i-1}))}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=function(t,e){return 404===t||0===t&&e.startsWith("file:")?new s.MissingPDFException('Missing PDF "'+e+'".'):new s.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)},e.extractFilenameFromHeader=function(t){const e=t("Content-Disposition");if(e){let t=(0,n.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(t){}if((0,r.isPdfFile)(t))return t}return null},e.validateRangeRequestCapabilities=function({getResponseHeader:t,isHttp:e,rangeChunkSize:i,disableRange:n}){(0,s.assert)(i>0,"Range chunk size must be larger than zero");const r={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(t("Content-Length"),10);return Number.isInteger(o)?(r.suggestedLength=o,o<=2*i||n||!e||"bytes"!==t("Accept-Ranges")||"identity"!==(t("Content-Encoding")||"identity")||(r.allowRangeRequests=!0),r):r},e.validateResponseStatus=function(t){return 200===t||206===t};var s=i(2),n=i(25),r=i(1)},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=function(t){let e=!0,i=n("filename\\*","i").exec(t);if(i){i=i[1];let t=a(i);return t=unescape(t),t=h(t),t=c(t),o(t)}if(i=function(t){const e=[];let i;const s=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=s.exec(t));){let[,t,s,n]=i;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[s,n]}const r=[];for(let t=0;t<e.length&&t in e;++t){let[i,s]=e[t];s=a(s),i&&(s=unescape(s),0===t&&(s=h(s))),r.push(s)}return r.join("")}(t),i)return o(c(i));if(i=n("filename","i").exec(t),i){i=i[1];let t=a(i);return t=c(t),o(t)}function n(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function r(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const n=new TextDecoder(t,{fatal:!0}),r=(0,s.stringToBytes)(i);i=n.decode(r),e=!1}catch(s){if(/^utf-?8$/i.test(t))try{i=decodeURIComponent(escape(i)),e=!1}catch(t){}}}return i}function o(t){return e&&/[\x80-\xff]/.test(t)&&(t=r("utf-8",t),e&&(t=r("iso-8859-1",t))),t}function a(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const i=e[t].indexOf('"');-1!==i&&(e[t]=e[t].slice(0,i),e.length=t+1),e[t]=e[t].replace(/\\(.)/g,"$1")}t=e.join('"')}return t}function h(t){const e=t.indexOf("'");return-1===e?t:r(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function c(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,i,s){if("q"===i||"Q"===i)return r(e,s=(s=s.replace(/_/g," ")).replace(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})));try{s=atob(s)}catch(t){}return r(e,s)}))}return""};var s=i(2)},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0;var s=i(2),n=i(24);class r{constructor(t,e={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.getXhr=e.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,i){const s={begin:t,end:e};for(const t in i)s[t]=i[t];return this.request(s)}requestFull(t){return this.request(t)}request(t){const e=this.getXhr(),i=this.currXhrId++,s=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const t in this.httpHeaders){const i=this.httpHeaders[t];void 0!==i&&e.setRequestHeader(t,i)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),s.expectedStatus=206):s.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),s.onHeadersReceived=t.onHeadersReceived,s.onDone=t.onDone,s.onError=t.onError,s.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){const i=this.pendingRequests[t];i&&i.onProgress?.(e)}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const n=i.xhr;if(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==n.readyState)return;if(!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void i.onError?.(n.status);const r=n.status||200;if((200!==r||206!==i.expectedStatus)&&r!==i.expectedStatus)return void i.onError?.(n.status);const o=function(t){const e=t.response;return"string"!=typeof e?e:(0,s.stringToBytes)(e).buffer}(n);if(206===r){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:o})}else o?i.onDone({begin:0,chunk:o}):i.onError?.(n.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}e.PDFNetworkStream=class{constructor(t){this._source=t,this._manager=new r(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new o(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new a(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class o{constructor(t,e){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(i),this._headersReceivedCapability=(0,s.createPromiseCapability)(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),i=t=>e.getResponseHeader(t),{allowRangeRequests:s,suggestedLength:r}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=r||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=(0,n.createResponseStatusError)(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=(0,s.createPromiseCapability)();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class a{constructor(t,e,i){this._manager=t;const s={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,s),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=(0,n.createResponseStatusError)(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,s.createPromiseCapability)();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0;var s=i(2),n=i(24);function r(t,e,i){return{method:"GET",headers:t,signal:i?.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function o(t){const e=new Headers;for(const i in t){const s=t[i];void 0!==s&&e.append(i,s)}return e}e.PDFFetchStream=class{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new a(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new h(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class a{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=(0,s.createPromiseCapability)(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._headers=o(this._stream.httpHeaders);const i=e.url;fetch(i,r(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.createResponseStatusError)(t.status,i);this._reader=t.body.getReader(),this._headersCapability.resolve();const e=e=>t.headers.get(e),{allowRangeRequests:r,suggestedLength:o}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=o||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new s.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._reader&&this._reader.cancel(t),this._abortController&&this._abortController.abort()}}class h{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const a=t.source;this._withCredentials=a.withCredentials||!1,this._readCapability=(0,s.createPromiseCapability)(),this._isStreamingSupported=!a.disableStream,"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._headers=o(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-${i-1}`);const h=a.url;fetch(h,r(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.createResponseStatusError)(t.status,h);this._readCapability.resolve(),this._reader=t.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._reader&&this._reader.cancel(t),this._abortController&&this._abortController.abort()}}}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var i=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](i,i.exports,__w_pdfjs_require__),i.exports}var __webpack_exports__={};return(()=>{var t=__webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return n.AnnotationLayer}}),Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return i.AnnotationMode}}),Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return i.CMapCompressionType}}),Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return r.GlobalWorkerOptions}}),Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return i.InvalidPDFException}}),Object.defineProperty(t,"LinkTarget",{enumerable:!0,get:function(){return e.LinkTarget}}),Object.defineProperty(t,"LoopbackPort",{enumerable:!0,get:function(){return s.LoopbackPort}}),Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return i.MissingPDFException}}),Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return i.OPS}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return s.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return e.PDFDateString}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return s.PDFWorker}}),Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return i.PasswordResponses}}),Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return i.PermissionFlag}}),Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return e.PixelsPerInch}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return e.RenderingCancelledException}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return h.SVGGraphics}}),Object.defineProperty(t,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return i.UNSUPPORTED_FEATURES}}),Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return i.UnexpectedResponseException}}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return i.Util}}),Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return i.VerbosityLevel}}),Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return c.XfaLayer}}),Object.defineProperty(t,"addLinkAttributes",{enumerable:!0,get:function(){return e.addLinkAttributes}}),Object.defineProperty(t,"build",{enumerable:!0,get:function(){return s.build}}),Object.defineProperty(t,"createObjectURL",{enumerable:!0,get:function(){return i.createObjectURL}}),Object.defineProperty(t,"createPromiseCapability",{enumerable:!0,get:function(){return i.createPromiseCapability}}),Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return i.createValidAbsoluteUrl}}),Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return s.getDocument}}),Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return e.getFilenameFromUrl}}),Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return e.getPdfFilenameFromUrl}}),Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return e.getXfaPageViewport}}),Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return e.isPdfFile}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return e.loadScript}}),Object.defineProperty(t,"removeNullCharacters",{enumerable:!0,get:function(){return i.removeNullCharacters}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return a.renderTextLayer}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return i.shadow}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return s.version}});var e=__w_pdfjs_require__(1),i=__w_pdfjs_require__(2),s=__w_pdfjs_require__(6),n=__w_pdfjs_require__(18),r=__w_pdfjs_require__(12),o=__w_pdfjs_require__(4),a=__w_pdfjs_require__(21),h=__w_pdfjs_require__(22),c=__w_pdfjs_require__(20);if(o.isNodeJS){const{PDFNodeStream:t}=__w_pdfjs_require__(23);(0,s.setPDFNetworkStreamFactory)((e=>new t(e)))}else{const{PDFNetworkStream:t}=__w_pdfjs_require__(26),{PDFFetchStream:i}=__w_pdfjs_require__(27);(0,s.setPDFNetworkStreamFactory)((s=>(0,e.isValidFetchUrl)(s.url)?new i(s):new t(s)))}})(),__webpack_exports__})()},module.exports=factory()}));const pdf$1=getDefaultExportFromCjs(pdf),integerSequence=(t,e)=>Array(e).fill(1).map(((e,i)=>i+t)),verdocsViewCss="verdocs-view{font-family:sans-serif;font-family:var(--verdocs-font);display:-ms-flexbox;display:flex;background:#ccc;min-height:600px;position:relative;padding:0 0 20px 0;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-view div,verdocs-view canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-view .container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-view button.test{color:#fff;cursor:pointer;padding:5px 10px;border-radius:4px;background:#5a5767;border:1px solid #ccc}verdocs-view .load-progress{position:absolute;top:0;left:0;right:0;height:6px;z-index:2000;background:#000}verdocs-view .load-progress .bar{height:6px;background:#50be80}#verdocs-pdf-viewer-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}#verdocs-pdf-viewer-container canvas{background:white;max-width:100%;margin:15px 0 0 0}",CANVAS_MARGIN=15,PDF_WORKER_URL=`https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdf.version}/pdf.worker.min.js`,CMAPS_URL=`https://unpkg.com/pdfjs-dist@${pdf.version}/cmaps/`;console.log("[VIEW] Loading PDF-JS",{PDF_WORKER_URL,CMAPS_URL}),pdf$1.GlobalWorkerOptions.workerSrc=PDF_WORKER_URL;let VerdocsView=class{constructor(t){registerInstance(this,t),this.pageRendered=createEvent(this,"pageRendered",7),this.pageLoaded=createEvent(this,"pageLoaded",7),this.pageChange=createEvent(this,"pageChange",7),this.pageInit=createEvent(this,"pageInit",7),this.scaleChange=createEvent(this,"scaleChange",7),this.documentRendered=createEvent(this,"documentRendered",7),this.numPages=1,this.fingerprint=null,this.rotation=0,this.token=null,this.loadProgress=0,this.pagesRendered=[]}doSrc(t,e){t!==e&&this.loadAndRender(t)}isRotated(t){return 0!==t&&t%180!=0}async renderPages(){const t=integerSequence(1,this.numPages);for await(let e of t){const t=e-1;console.log("[VIEW] Rendering page",e);const i=await this.pdfDocument.getPage(e),[s,n,r,o]=i.view,a=i.rotate,h=i.getViewport({scale:1/.75}),c=document.createElement("canvas"),l=c.getContext("2d");c.height=h.height,c.width=h.width,await i.render({canvasContext:l,viewport:h}),this.pdfContainer.appendChild(c);const d=c.width,u=c.height,f=r-s,p=o-n;this.pagesRendered.sort(((t,e)=>t.pageNumber-e.pageNumber));const g=this.pagesRendered.filter((t=>t.pageNumber<e)).pop(),m=((null==g?void 0:g.canvasBottom)||0)+CANVAS_MARGIN,b={pageNumber:e,width:d,height:u,originalWidth:this.isRotated(a)?p:f,originalHeight:this.isRotated(a)?f:p,xRatio:d/f,yRatio:u/p,canvasTop:m,canvasLeft:CANVAS_MARGIN,canvasRight:CANVAS_MARGIN+d,canvasBottom:m+u};this.pagesRendered[t]?this.pagesRendered[t]=b:this.pagesRendered.push(b);const A={pages:this.pagesRendered,numPages:this.numPages,numRendered:this.pagesRendered.length,canvasContainer:this.pdfContainer};this.pageRendered.emit(A),e>=this.numPages&&(console.log("[VIEW] Done rendering"),this.pagesRendered.sort(((t,e)=>t.pageNumber-e.pageNumber)),this.documentRendered.emit(A))}}componentDidLoad(){this.pdfContainer=document.getElementById("verdocs-pdf-viewer-container"),this.source&&this.loadAndRender(this.source)}onProgress(t){this.loadProgress=Math.floor(100*t.loaded/t.total)}loadAndRender(t){console.log("[VIEW] Loading",t);const e=pdf$1.getDocument({url:t,withCredentials:!0,cMapUrl:CMAPS_URL,cMapPacked:!0,verbosity:pdf.VerbosityLevel.WARNINGS,httpHeaders:this.token?{Authorization:`Bearer ${this.token}`}:{}},null,null,this.onProgress);e.onProgress=this.onProgress,e.promise.then((t=>{this.loadProgress=100,this.numPages=t.numPages,this.fingerprint=t.fingerprints[0],console.log(`[VIEW] Got PDF document fingerprint "${this.fingerprint}, ${this.numPages} pages`,t),this.pdfDocument=t,this.renderPages().catch((t=>console.log("Rendering error",t)))}))}render(){return h("div",{class:"container"},this.loadProgress<100?h("verdocs-loader",null):h("div",{style:{display:"none"}}),h("div",{id:"verdocs-pdf-viewer-container"}))}get component(){return getElement(this)}static get watchers(){return{source:["doSrc"]}}};VerdocsView.style=verdocsViewCss;export{VerdocsDropdown as verdocs_dropdown,VerdocsFieldAttachment as verdocs_field_attachment,VerdocsFieldCheckbox as verdocs_field_checkbox,VerdocsFieldDate as verdocs_field_date,VerdocsFieldDropdown as verdocs_field_dropdown,VerdocsFieldInitial as verdocs_field_initial,VerdocsFieldPayment as verdocs_field_payment,VerdocsFieldRadioButton as verdocs_field_radio_button,VerdocsFieldSignature as verdocs_field_signature,VerdocsFieldTextarea as verdocs_field_textarea,VerdocsFieldTextbox as verdocs_field_textbox,VerdocsView as verdocs_view}