@dragon708/docmind-markdown 1.2.1 → 1.2.3

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 (2249) hide show
  1. package/node_modules/@cognipeer/to-markdown/LICENSE +21 -0
  2. package/node_modules/@cognipeer/to-markdown/README.md +310 -0
  3. package/node_modules/@cognipeer/to-markdown/dist/converters/archive.d.ts +15 -0
  4. package/node_modules/@cognipeer/to-markdown/dist/converters/archive.d.ts.map +1 -0
  5. package/node_modules/@cognipeer/to-markdown/dist/converters/archive.js +81 -0
  6. package/node_modules/@cognipeer/to-markdown/dist/converters/archive.js.map +1 -0
  7. package/node_modules/@cognipeer/to-markdown/dist/converters/docx.d.ts +7 -0
  8. package/node_modules/@cognipeer/to-markdown/dist/converters/docx.d.ts.map +1 -0
  9. package/node_modules/@cognipeer/to-markdown/dist/converters/docx.js +21 -0
  10. package/node_modules/@cognipeer/to-markdown/dist/converters/docx.js.map +1 -0
  11. package/node_modules/@cognipeer/to-markdown/dist/converters/html.d.ts +13 -0
  12. package/node_modules/@cognipeer/to-markdown/dist/converters/html.d.ts.map +1 -0
  13. package/node_modules/@cognipeer/to-markdown/dist/converters/html.js +113 -0
  14. package/node_modules/@cognipeer/to-markdown/dist/converters/html.js.map +1 -0
  15. package/node_modules/@cognipeer/to-markdown/dist/converters/media.d.ts +15 -0
  16. package/node_modules/@cognipeer/to-markdown/dist/converters/media.d.ts.map +1 -0
  17. package/node_modules/@cognipeer/to-markdown/dist/converters/media.js +54 -0
  18. package/node_modules/@cognipeer/to-markdown/dist/converters/media.js.map +1 -0
  19. package/node_modules/@cognipeer/to-markdown/dist/converters/notebook.d.ts +7 -0
  20. package/node_modules/@cognipeer/to-markdown/dist/converters/notebook.d.ts.map +1 -0
  21. package/node_modules/@cognipeer/to-markdown/dist/converters/notebook.js +44 -0
  22. package/node_modules/@cognipeer/to-markdown/dist/converters/notebook.js.map +1 -0
  23. package/node_modules/@cognipeer/to-markdown/dist/converters/pdf.d.ts +7 -0
  24. package/node_modules/@cognipeer/to-markdown/dist/converters/pdf.d.ts.map +1 -0
  25. package/node_modules/@cognipeer/to-markdown/dist/converters/pdf.js +11 -0
  26. package/node_modules/@cognipeer/to-markdown/dist/converters/pdf.js.map +1 -0
  27. package/node_modules/@cognipeer/to-markdown/dist/converters/spreadsheet.d.ts +13 -0
  28. package/node_modules/@cognipeer/to-markdown/dist/converters/spreadsheet.d.ts.map +1 -0
  29. package/node_modules/@cognipeer/to-markdown/dist/converters/spreadsheet.js +41 -0
  30. package/node_modules/@cognipeer/to-markdown/dist/converters/spreadsheet.js.map +1 -0
  31. package/node_modules/@cognipeer/to-markdown/dist/converters/text.d.ts +21 -0
  32. package/node_modules/@cognipeer/to-markdown/dist/converters/text.d.ts.map +1 -0
  33. package/node_modules/@cognipeer/to-markdown/dist/converters/text.js +54 -0
  34. package/node_modules/@cognipeer/to-markdown/dist/converters/text.js.map +1 -0
  35. package/node_modules/@cognipeer/to-markdown/dist/converters/xml.d.ts +7 -0
  36. package/node_modules/@cognipeer/to-markdown/dist/converters/xml.d.ts.map +1 -0
  37. package/node_modules/@cognipeer/to-markdown/dist/converters/xml.js +72 -0
  38. package/node_modules/@cognipeer/to-markdown/dist/converters/xml.js.map +1 -0
  39. package/node_modules/@cognipeer/to-markdown/dist/index.cjs +1739 -0
  40. package/node_modules/@cognipeer/to-markdown/dist/index.cjs.map +1 -0
  41. package/node_modules/@cognipeer/to-markdown/dist/index.d.ts +46 -0
  42. package/node_modules/@cognipeer/to-markdown/dist/index.d.ts.map +1 -0
  43. package/node_modules/@cognipeer/to-markdown/dist/index.js +1733 -0
  44. package/node_modules/@cognipeer/to-markdown/dist/index.js.map +1 -0
  45. package/node_modules/@cognipeer/to-markdown/dist/types/index.d.ts +78 -0
  46. package/node_modules/@cognipeer/to-markdown/dist/types/index.d.ts.map +1 -0
  47. package/node_modules/@cognipeer/to-markdown/dist/types/index.js +27 -0
  48. package/node_modules/@cognipeer/to-markdown/dist/types/index.js.map +1 -0
  49. package/node_modules/@cognipeer/to-markdown/dist/utils/fileDetection.d.ts +12 -0
  50. package/node_modules/@cognipeer/to-markdown/dist/utils/fileDetection.d.ts.map +1 -0
  51. package/node_modules/@cognipeer/to-markdown/dist/utils/fileDetection.js +75 -0
  52. package/node_modules/@cognipeer/to-markdown/dist/utils/fileDetection.js.map +1 -0
  53. package/node_modules/@cognipeer/to-markdown/dist/utils/markdown.d.ts +13 -0
  54. package/node_modules/@cognipeer/to-markdown/dist/utils/markdown.d.ts.map +1 -0
  55. package/node_modules/@cognipeer/to-markdown/dist/utils/markdown.js +60 -0
  56. package/node_modules/@cognipeer/to-markdown/dist/utils/markdown.js.map +1 -0
  57. package/node_modules/@cognipeer/to-markdown/package.json +96 -0
  58. package/node_modules/@opendocsg/pdf2md/LICENSE +21 -0
  59. package/node_modules/@opendocsg/pdf2md/README.md +52 -0
  60. package/node_modules/@opendocsg/pdf2md/lib/models/Annotation.js +34 -0
  61. package/node_modules/@opendocsg/pdf2md/lib/models/HeadlineFinder.js +40 -0
  62. package/node_modules/@opendocsg/pdf2md/lib/models/LineConverter.js +156 -0
  63. package/node_modules/@opendocsg/pdf2md/lib/models/LineItem.js +29 -0
  64. package/node_modules/@opendocsg/pdf2md/lib/models/LineItemBlock.js +32 -0
  65. package/node_modules/@opendocsg/pdf2md/lib/models/Metadata.js +15 -0
  66. package/node_modules/@opendocsg/pdf2md/lib/models/Page.js +7 -0
  67. package/node_modules/@opendocsg/pdf2md/lib/models/PageItem.js +11 -0
  68. package/node_modules/@opendocsg/pdf2md/lib/models/ParseResult.js +8 -0
  69. package/node_modules/@opendocsg/pdf2md/lib/models/ParsedElements.js +15 -0
  70. package/node_modules/@opendocsg/pdf2md/lib/models/StashingStream.js +72 -0
  71. package/node_modules/@opendocsg/pdf2md/lib/models/TextItem.js +18 -0
  72. package/node_modules/@opendocsg/pdf2md/lib/models/TextItemLineGrouper.js +34 -0
  73. package/node_modules/@opendocsg/pdf2md/lib/models/Word.js +7 -0
  74. package/node_modules/@opendocsg/pdf2md/lib/models/markdown/BlockType.js +176 -0
  75. package/node_modules/@opendocsg/pdf2md/lib/models/markdown/WordFormat.js +23 -0
  76. package/node_modules/@opendocsg/pdf2md/lib/models/markdown/WordType.js +29 -0
  77. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/ToLineItemBlockTransformation.js +29 -0
  78. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/ToLineItemTransformation.js +29 -0
  79. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/ToMarkdown.js +42 -0
  80. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/ToTextBlocks.js +27 -0
  81. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/ToTextItemTransformation.js +29 -0
  82. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/Transformation.js +30 -0
  83. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/line-item/CompactLines.js +79 -0
  84. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/line-item/DetectHeaders.js +134 -0
  85. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/line-item/DetectListItems.js +62 -0
  86. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/line-item/DetectTOC.js +351 -0
  87. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/line-item/RemoveRepetitiveElements.js +97 -0
  88. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/line-item/VerticalToHorizontal.js +75 -0
  89. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/line-item-block/DetectCodeQuoteBlocks.js +51 -0
  90. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/line-item-block/DetectListLevels.js +59 -0
  91. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/line-item-block/GatherBlocks.js +87 -0
  92. package/node_modules/@opendocsg/pdf2md/lib/models/transformations/text-item/CalculateGlobalStats.js +113 -0
  93. package/node_modules/@opendocsg/pdf2md/lib/pdf2md-cli.js +66 -0
  94. package/node_modules/@opendocsg/pdf2md/lib/pdf2md.js +43 -0
  95. package/node_modules/@opendocsg/pdf2md/lib/util/cli.js +43 -0
  96. package/node_modules/@opendocsg/pdf2md/lib/util/page-item-functions.js +34 -0
  97. package/node_modules/@opendocsg/pdf2md/lib/util/page-number-functions.js +116 -0
  98. package/node_modules/@opendocsg/pdf2md/lib/util/pdf.js +112 -0
  99. package/node_modules/@opendocsg/pdf2md/lib/util/string-functions.js +116 -0
  100. package/node_modules/@opendocsg/pdf2md/lib/util/transformations.js +46 -0
  101. package/node_modules/@opendocsg/pdf2md/package.json +60 -0
  102. package/node_modules/@opendocsg/pdf2md/test/convert.spec.js +15 -0
  103. package/node_modules/@opendocsg/pdf2md/test/models/HeadlineFinder.spec.js +92 -0
  104. package/node_modules/@opendocsg/pdf2md/test/models/StashingStream.spec.js +95 -0
  105. package/node_modules/@opendocsg/pdf2md/test/util/cli.spec.js +84 -0
  106. package/node_modules/@opendocsg/pdf2md/test/util/page-number-functions.spec.js +85 -0
  107. package/node_modules/@opendocsg/pdf2md/test/util/string-functions.spec.js +211 -0
  108. package/node_modules/@opendocsg/pdf2md/types/pdf2md.d.ts +49 -0
  109. package/node_modules/@tokenizer/token/README.md +19 -0
  110. package/node_modules/@tokenizer/token/index.d.ts +30 -0
  111. package/node_modules/@tokenizer/token/package.json +33 -0
  112. package/node_modules/adler-32/LICENSE +201 -0
  113. package/node_modules/adler-32/README.md +140 -0
  114. package/node_modules/adler-32/adler32.js +92 -0
  115. package/node_modules/adler-32/package.json +35 -0
  116. package/node_modules/adler-32/types/index.d.ts +14 -0
  117. package/node_modules/adler-32/types/tsconfig.json +15 -0
  118. package/node_modules/adler-32/types/tslint.json +14 -0
  119. package/node_modules/adm-zip/LICENSE +21 -0
  120. package/node_modules/adm-zip/README.md +87 -0
  121. package/node_modules/adm-zip/adm-zip.js +949 -0
  122. package/node_modules/adm-zip/headers/entryHeader.js +377 -0
  123. package/node_modules/adm-zip/headers/index.js +2 -0
  124. package/node_modules/adm-zip/headers/mainHeader.js +130 -0
  125. package/node_modules/adm-zip/methods/deflater.js +33 -0
  126. package/node_modules/adm-zip/methods/index.js +3 -0
  127. package/node_modules/adm-zip/methods/inflater.js +34 -0
  128. package/node_modules/adm-zip/methods/zipcrypto.js +175 -0
  129. package/node_modules/adm-zip/package.json +54 -0
  130. package/node_modules/adm-zip/util/constants.js +142 -0
  131. package/node_modules/adm-zip/util/decoder.js +5 -0
  132. package/node_modules/adm-zip/util/errors.js +63 -0
  133. package/node_modules/adm-zip/util/fattr.js +76 -0
  134. package/node_modules/adm-zip/util/index.js +5 -0
  135. package/node_modules/adm-zip/util/utils.js +339 -0
  136. package/node_modules/adm-zip/zipEntry.js +405 -0
  137. package/node_modules/adm-zip/zipFile.js +446 -0
  138. package/node_modules/boolbase/README.md +10 -0
  139. package/node_modules/boolbase/index.js +8 -0
  140. package/node_modules/boolbase/package.json +23 -0
  141. package/node_modules/cfb/LICENSE +201 -0
  142. package/node_modules/cfb/README.md +161 -0
  143. package/node_modules/cfb/cfb.js +1979 -0
  144. package/node_modules/cfb/dist/LICENSE +201 -0
  145. package/node_modules/cfb/dist/cfb.js +1979 -0
  146. package/node_modules/cfb/dist/cfb.min.js +3 -0
  147. package/node_modules/cfb/dist/cfb.min.map +1 -0
  148. package/node_modules/cfb/dist/xlscfb.js +1856 -0
  149. package/node_modules/cfb/package.json +68 -0
  150. package/node_modules/cfb/types/index.d.ts +128 -0
  151. package/node_modules/cfb/types/tsconfig.json +15 -0
  152. package/node_modules/cfb/xlscfb.flow.js +1856 -0
  153. package/node_modules/cheerio/LICENSE +21 -0
  154. package/node_modules/cheerio/Readme.md +229 -0
  155. package/node_modules/cheerio/dist/browser/api/attributes.d.ts +385 -0
  156. package/node_modules/cheerio/dist/browser/api/attributes.d.ts.map +1 -0
  157. package/node_modules/cheerio/dist/browser/api/attributes.js +636 -0
  158. package/node_modules/cheerio/dist/browser/api/attributes.js.map +1 -0
  159. package/node_modules/cheerio/dist/browser/api/css.d.ts +42 -0
  160. package/node_modules/cheerio/dist/browser/api/css.d.ts.map +1 -0
  161. package/node_modules/cheerio/dist/browser/api/css.js +116 -0
  162. package/node_modules/cheerio/dist/browser/api/css.js.map +1 -0
  163. package/node_modules/cheerio/dist/browser/api/extract.d.ts +27 -0
  164. package/node_modules/cheerio/dist/browser/api/extract.d.ts.map +1 -0
  165. package/node_modules/cheerio/dist/browser/api/extract.js +42 -0
  166. package/node_modules/cheerio/dist/browser/api/extract.js.map +1 -0
  167. package/node_modules/cheerio/dist/browser/api/forms.d.ts +36 -0
  168. package/node_modules/cheerio/dist/browser/api/forms.d.ts.map +1 -0
  169. package/node_modules/cheerio/dist/browser/api/forms.js +81 -0
  170. package/node_modules/cheerio/dist/browser/api/forms.js.map +1 -0
  171. package/node_modules/cheerio/dist/browser/api/manipulation.d.ts +528 -0
  172. package/node_modules/cheerio/dist/browser/api/manipulation.d.ts.map +1 -0
  173. package/node_modules/cheerio/dist/browser/api/manipulation.js +831 -0
  174. package/node_modules/cheerio/dist/browser/api/manipulation.js.map +1 -0
  175. package/node_modules/cheerio/dist/browser/api/traversing.d.ts +657 -0
  176. package/node_modules/cheerio/dist/browser/api/traversing.d.ts.map +1 -0
  177. package/node_modules/cheerio/dist/browser/api/traversing.js +857 -0
  178. package/node_modules/cheerio/dist/browser/api/traversing.js.map +1 -0
  179. package/node_modules/cheerio/dist/browser/cheerio.d.ts +85 -0
  180. package/node_modules/cheerio/dist/browser/cheerio.d.ts.map +1 -0
  181. package/node_modules/cheerio/dist/browser/cheerio.js +58 -0
  182. package/node_modules/cheerio/dist/browser/cheerio.js.map +1 -0
  183. package/node_modules/cheerio/dist/browser/index-browser.d.mts.map +1 -0
  184. package/node_modules/cheerio/dist/browser/index-browser.mjs.map +1 -0
  185. package/node_modules/cheerio/dist/browser/index.d.ts +5 -0
  186. package/node_modules/cheerio/dist/browser/index.js +3 -0
  187. package/node_modules/cheerio/dist/browser/load-parse.d.ts +20 -0
  188. package/node_modules/cheerio/dist/browser/load-parse.d.ts.map +1 -0
  189. package/node_modules/cheerio/dist/browser/load-parse.js +28 -0
  190. package/node_modules/cheerio/dist/browser/load-parse.js.map +1 -0
  191. package/node_modules/cheerio/dist/browser/load.d.ts +91 -0
  192. package/node_modules/cheerio/dist/browser/load.d.ts.map +1 -0
  193. package/node_modules/cheerio/dist/browser/load.js +129 -0
  194. package/node_modules/cheerio/dist/browser/load.js.map +1 -0
  195. package/node_modules/cheerio/dist/browser/options.d.ts +98 -0
  196. package/node_modules/cheerio/dist/browser/options.d.ts.map +1 -0
  197. package/node_modules/cheerio/dist/browser/options.js +34 -0
  198. package/node_modules/cheerio/dist/browser/options.js.map +1 -0
  199. package/node_modules/cheerio/dist/browser/package.json +3 -0
  200. package/node_modules/cheerio/dist/browser/parse.d.ts +18 -0
  201. package/node_modules/cheerio/dist/browser/parse.d.ts.map +1 -0
  202. package/node_modules/cheerio/dist/browser/parse.js +73 -0
  203. package/node_modules/cheerio/dist/browser/parse.js.map +1 -0
  204. package/node_modules/cheerio/dist/browser/parsers/parse5-adapter.d.ts +20 -0
  205. package/node_modules/cheerio/dist/browser/parsers/parse5-adapter.d.ts.map +1 -0
  206. package/node_modules/cheerio/dist/browser/parsers/parse5-adapter.js +50 -0
  207. package/node_modules/cheerio/dist/browser/parsers/parse5-adapter.js.map +1 -0
  208. package/node_modules/cheerio/dist/browser/slim.d.ts +25 -0
  209. package/node_modules/cheerio/dist/browser/slim.d.ts.map +1 -0
  210. package/node_modules/cheerio/dist/browser/slim.js +22 -0
  211. package/node_modules/cheerio/dist/browser/slim.js.map +1 -0
  212. package/node_modules/cheerio/dist/browser/static.d.ts +112 -0
  213. package/node_modules/cheerio/dist/browser/static.d.ts.map +1 -0
  214. package/node_modules/cheerio/dist/browser/static.js +204 -0
  215. package/node_modules/cheerio/dist/browser/static.js.map +1 -0
  216. package/node_modules/cheerio/dist/browser/types.d.ts +21 -0
  217. package/node_modules/cheerio/dist/browser/types.d.ts.map +1 -0
  218. package/node_modules/cheerio/dist/browser/types.js +3 -0
  219. package/node_modules/cheerio/dist/browser/types.js.map +1 -0
  220. package/node_modules/cheerio/dist/browser/utils.d.ts +55 -0
  221. package/node_modules/cheerio/dist/browser/utils.d.ts.map +1 -0
  222. package/node_modules/cheerio/dist/browser/utils.js +84 -0
  223. package/node_modules/cheerio/dist/browser/utils.js.map +1 -0
  224. package/node_modules/cheerio/dist/commonjs/api/attributes.d.ts +385 -0
  225. package/node_modules/cheerio/dist/commonjs/api/attributes.d.ts.map +1 -0
  226. package/node_modules/cheerio/dist/commonjs/api/attributes.js +647 -0
  227. package/node_modules/cheerio/dist/commonjs/api/attributes.js.map +1 -0
  228. package/node_modules/cheerio/dist/commonjs/api/css.d.ts +42 -0
  229. package/node_modules/cheerio/dist/commonjs/api/css.d.ts.map +1 -0
  230. package/node_modules/cheerio/dist/commonjs/api/css.js +119 -0
  231. package/node_modules/cheerio/dist/commonjs/api/css.js.map +1 -0
  232. package/node_modules/cheerio/dist/commonjs/api/extract.d.ts +27 -0
  233. package/node_modules/cheerio/dist/commonjs/api/extract.d.ts.map +1 -0
  234. package/node_modules/cheerio/dist/commonjs/api/extract.js +45 -0
  235. package/node_modules/cheerio/dist/commonjs/api/extract.js.map +1 -0
  236. package/node_modules/cheerio/dist/commonjs/api/forms.d.ts +36 -0
  237. package/node_modules/cheerio/dist/commonjs/api/forms.d.ts.map +1 -0
  238. package/node_modules/cheerio/dist/commonjs/api/forms.js +85 -0
  239. package/node_modules/cheerio/dist/commonjs/api/forms.js.map +1 -0
  240. package/node_modules/cheerio/dist/commonjs/api/manipulation.d.ts +528 -0
  241. package/node_modules/cheerio/dist/commonjs/api/manipulation.d.ts.map +1 -0
  242. package/node_modules/cheerio/dist/commonjs/api/manipulation.js +850 -0
  243. package/node_modules/cheerio/dist/commonjs/api/manipulation.js.map +1 -0
  244. package/node_modules/cheerio/dist/commonjs/api/traversing.d.ts +657 -0
  245. package/node_modules/cheerio/dist/commonjs/api/traversing.d.ts.map +1 -0
  246. package/node_modules/cheerio/dist/commonjs/api/traversing.js +914 -0
  247. package/node_modules/cheerio/dist/commonjs/api/traversing.js.map +1 -0
  248. package/node_modules/cheerio/dist/commonjs/cheerio.d.ts +85 -0
  249. package/node_modules/cheerio/dist/commonjs/cheerio.d.ts.map +1 -0
  250. package/node_modules/cheerio/dist/commonjs/cheerio.js +95 -0
  251. package/node_modules/cheerio/dist/commonjs/cheerio.js.map +1 -0
  252. package/node_modules/cheerio/dist/commonjs/index.d.ts +104 -0
  253. package/node_modules/cheerio/dist/commonjs/index.d.ts.map +1 -0
  254. package/node_modules/cheerio/dist/commonjs/index.js +250 -0
  255. package/node_modules/cheerio/dist/commonjs/index.js.map +1 -0
  256. package/node_modules/cheerio/dist/commonjs/load-parse.d.ts +20 -0
  257. package/node_modules/cheerio/dist/commonjs/load-parse.d.ts.map +1 -0
  258. package/node_modules/cheerio/dist/commonjs/load-parse.js +34 -0
  259. package/node_modules/cheerio/dist/commonjs/load-parse.js.map +1 -0
  260. package/node_modules/cheerio/dist/commonjs/load.d.ts +91 -0
  261. package/node_modules/cheerio/dist/commonjs/load.d.ts.map +1 -0
  262. package/node_modules/cheerio/dist/commonjs/load.js +165 -0
  263. package/node_modules/cheerio/dist/commonjs/load.js.map +1 -0
  264. package/node_modules/cheerio/dist/commonjs/options.d.ts +98 -0
  265. package/node_modules/cheerio/dist/commonjs/options.d.ts.map +1 -0
  266. package/node_modules/cheerio/dist/commonjs/options.js +37 -0
  267. package/node_modules/cheerio/dist/commonjs/options.js.map +1 -0
  268. package/node_modules/cheerio/dist/commonjs/package.json +3 -0
  269. package/node_modules/cheerio/dist/commonjs/parse.d.ts +18 -0
  270. package/node_modules/cheerio/dist/commonjs/parse.d.ts.map +1 -0
  271. package/node_modules/cheerio/dist/commonjs/parse.js +77 -0
  272. package/node_modules/cheerio/dist/commonjs/parse.js.map +1 -0
  273. package/node_modules/cheerio/dist/commonjs/parsers/parse5-adapter.d.ts +20 -0
  274. package/node_modules/cheerio/dist/commonjs/parsers/parse5-adapter.d.ts.map +1 -0
  275. package/node_modules/cheerio/dist/commonjs/parsers/parse5-adapter.js +54 -0
  276. package/node_modules/cheerio/dist/commonjs/parsers/parse5-adapter.js.map +1 -0
  277. package/node_modules/cheerio/dist/commonjs/slim.d.ts +25 -0
  278. package/node_modules/cheerio/dist/commonjs/slim.d.ts.map +1 -0
  279. package/node_modules/cheerio/dist/commonjs/slim.js +30 -0
  280. package/node_modules/cheerio/dist/commonjs/slim.js.map +1 -0
  281. package/node_modules/cheerio/dist/commonjs/static.d.ts +112 -0
  282. package/node_modules/cheerio/dist/commonjs/static.d.ts.map +1 -0
  283. package/node_modules/cheerio/dist/commonjs/static.js +214 -0
  284. package/node_modules/cheerio/dist/commonjs/static.js.map +1 -0
  285. package/node_modules/cheerio/dist/commonjs/types.d.ts +21 -0
  286. package/node_modules/cheerio/dist/commonjs/types.d.ts.map +1 -0
  287. package/node_modules/cheerio/dist/commonjs/types.js +4 -0
  288. package/node_modules/cheerio/dist/commonjs/types.js.map +1 -0
  289. package/node_modules/cheerio/dist/commonjs/utils.d.ts +55 -0
  290. package/node_modules/cheerio/dist/commonjs/utils.d.ts.map +1 -0
  291. package/node_modules/cheerio/dist/commonjs/utils.js +91 -0
  292. package/node_modules/cheerio/dist/commonjs/utils.js.map +1 -0
  293. package/node_modules/cheerio/dist/esm/api/attributes.d.ts +385 -0
  294. package/node_modules/cheerio/dist/esm/api/attributes.d.ts.map +1 -0
  295. package/node_modules/cheerio/dist/esm/api/attributes.js +636 -0
  296. package/node_modules/cheerio/dist/esm/api/attributes.js.map +1 -0
  297. package/node_modules/cheerio/dist/esm/api/css.d.ts +42 -0
  298. package/node_modules/cheerio/dist/esm/api/css.d.ts.map +1 -0
  299. package/node_modules/cheerio/dist/esm/api/css.js +116 -0
  300. package/node_modules/cheerio/dist/esm/api/css.js.map +1 -0
  301. package/node_modules/cheerio/dist/esm/api/extract.d.ts +27 -0
  302. package/node_modules/cheerio/dist/esm/api/extract.d.ts.map +1 -0
  303. package/node_modules/cheerio/dist/esm/api/extract.js +42 -0
  304. package/node_modules/cheerio/dist/esm/api/extract.js.map +1 -0
  305. package/node_modules/cheerio/dist/esm/api/forms.d.ts +36 -0
  306. package/node_modules/cheerio/dist/esm/api/forms.d.ts.map +1 -0
  307. package/node_modules/cheerio/dist/esm/api/forms.js +81 -0
  308. package/node_modules/cheerio/dist/esm/api/forms.js.map +1 -0
  309. package/node_modules/cheerio/dist/esm/api/manipulation.d.ts +528 -0
  310. package/node_modules/cheerio/dist/esm/api/manipulation.d.ts.map +1 -0
  311. package/node_modules/cheerio/dist/esm/api/manipulation.js +831 -0
  312. package/node_modules/cheerio/dist/esm/api/manipulation.js.map +1 -0
  313. package/node_modules/cheerio/dist/esm/api/traversing.d.ts +657 -0
  314. package/node_modules/cheerio/dist/esm/api/traversing.d.ts.map +1 -0
  315. package/node_modules/cheerio/dist/esm/api/traversing.js +857 -0
  316. package/node_modules/cheerio/dist/esm/api/traversing.js.map +1 -0
  317. package/node_modules/cheerio/dist/esm/cheerio.d.ts +85 -0
  318. package/node_modules/cheerio/dist/esm/cheerio.d.ts.map +1 -0
  319. package/node_modules/cheerio/dist/esm/cheerio.js +58 -0
  320. package/node_modules/cheerio/dist/esm/cheerio.js.map +1 -0
  321. package/node_modules/cheerio/dist/esm/index.d.ts +104 -0
  322. package/node_modules/cheerio/dist/esm/index.d.ts.map +1 -0
  323. package/node_modules/cheerio/dist/esm/index.js +202 -0
  324. package/node_modules/cheerio/dist/esm/index.js.map +1 -0
  325. package/node_modules/cheerio/dist/esm/load-parse.d.ts +20 -0
  326. package/node_modules/cheerio/dist/esm/load-parse.d.ts.map +1 -0
  327. package/node_modules/cheerio/dist/esm/load-parse.js +28 -0
  328. package/node_modules/cheerio/dist/esm/load-parse.js.map +1 -0
  329. package/node_modules/cheerio/dist/esm/load.d.ts +91 -0
  330. package/node_modules/cheerio/dist/esm/load.d.ts.map +1 -0
  331. package/node_modules/cheerio/dist/esm/load.js +129 -0
  332. package/node_modules/cheerio/dist/esm/load.js.map +1 -0
  333. package/node_modules/cheerio/dist/esm/options.d.ts +98 -0
  334. package/node_modules/cheerio/dist/esm/options.d.ts.map +1 -0
  335. package/node_modules/cheerio/dist/esm/options.js +34 -0
  336. package/node_modules/cheerio/dist/esm/options.js.map +1 -0
  337. package/node_modules/cheerio/dist/esm/package.json +3 -0
  338. package/node_modules/cheerio/dist/esm/parse.d.ts +18 -0
  339. package/node_modules/cheerio/dist/esm/parse.d.ts.map +1 -0
  340. package/node_modules/cheerio/dist/esm/parse.js +73 -0
  341. package/node_modules/cheerio/dist/esm/parse.js.map +1 -0
  342. package/node_modules/cheerio/dist/esm/parsers/parse5-adapter.d.ts +20 -0
  343. package/node_modules/cheerio/dist/esm/parsers/parse5-adapter.d.ts.map +1 -0
  344. package/node_modules/cheerio/dist/esm/parsers/parse5-adapter.js +50 -0
  345. package/node_modules/cheerio/dist/esm/parsers/parse5-adapter.js.map +1 -0
  346. package/node_modules/cheerio/dist/esm/slim.d.ts +25 -0
  347. package/node_modules/cheerio/dist/esm/slim.d.ts.map +1 -0
  348. package/node_modules/cheerio/dist/esm/slim.js +22 -0
  349. package/node_modules/cheerio/dist/esm/slim.js.map +1 -0
  350. package/node_modules/cheerio/dist/esm/static.d.ts +112 -0
  351. package/node_modules/cheerio/dist/esm/static.d.ts.map +1 -0
  352. package/node_modules/cheerio/dist/esm/static.js +204 -0
  353. package/node_modules/cheerio/dist/esm/static.js.map +1 -0
  354. package/node_modules/cheerio/dist/esm/types.d.ts +21 -0
  355. package/node_modules/cheerio/dist/esm/types.d.ts.map +1 -0
  356. package/node_modules/cheerio/dist/esm/types.js +3 -0
  357. package/node_modules/cheerio/dist/esm/types.js.map +1 -0
  358. package/node_modules/cheerio/dist/esm/utils.d.ts +55 -0
  359. package/node_modules/cheerio/dist/esm/utils.d.ts.map +1 -0
  360. package/node_modules/cheerio/dist/esm/utils.js +84 -0
  361. package/node_modules/cheerio/dist/esm/utils.js.map +1 -0
  362. package/node_modules/cheerio/package.json +182 -0
  363. package/node_modules/cheerio/src/api/attributes.ts +1145 -0
  364. package/node_modules/cheerio/src/api/css.ts +224 -0
  365. package/node_modules/cheerio/src/api/extract.ts +92 -0
  366. package/node_modules/cheerio/src/api/forms.ts +103 -0
  367. package/node_modules/cheerio/src/api/manipulation.ts +1115 -0
  368. package/node_modules/cheerio/src/api/traversing.ts +1175 -0
  369. package/node_modules/cheerio/src/cheerio.ts +143 -0
  370. package/node_modules/cheerio/src/index-browser.mts +10 -0
  371. package/node_modules/cheerio/src/index.ts +294 -0
  372. package/node_modules/cheerio/src/load-parse.ts +39 -0
  373. package/node_modules/cheerio/src/load.ts +282 -0
  374. package/node_modules/cheerio/src/options.ts +136 -0
  375. package/node_modules/cheerio/src/parse.ts +105 -0
  376. package/node_modules/cheerio/src/parsers/parse5-adapter.ts +66 -0
  377. package/node_modules/cheerio/src/slim.ts +33 -0
  378. package/node_modules/cheerio/src/static.ts +312 -0
  379. package/node_modules/cheerio/src/types.ts +58 -0
  380. package/node_modules/cheerio/src/utils.ts +99 -0
  381. package/node_modules/cheerio-select/LICENSE +11 -0
  382. package/node_modules/cheerio-select/README.md +18 -0
  383. package/node_modules/cheerio-select/lib/esm/helpers.d.ts +5 -0
  384. package/node_modules/cheerio-select/lib/esm/helpers.d.ts.map +1 -0
  385. package/node_modules/cheerio-select/lib/esm/helpers.js +20 -0
  386. package/node_modules/cheerio-select/lib/esm/helpers.js.map +1 -0
  387. package/node_modules/cheerio-select/lib/esm/index.d.ts +12 -0
  388. package/node_modules/cheerio-select/lib/esm/index.d.ts.map +1 -0
  389. package/node_modules/cheerio-select/lib/esm/index.js +241 -0
  390. package/node_modules/cheerio-select/lib/esm/index.js.map +1 -0
  391. package/node_modules/cheerio-select/lib/esm/package.json +1 -0
  392. package/node_modules/cheerio-select/lib/esm/positionals.d.ts +10 -0
  393. package/node_modules/cheerio-select/lib/esm/positionals.d.ts.map +1 -0
  394. package/node_modules/cheerio-select/lib/esm/positionals.js +47 -0
  395. package/node_modules/cheerio-select/lib/esm/positionals.js.map +1 -0
  396. package/node_modules/cheerio-select/lib/helpers.d.ts +5 -0
  397. package/node_modules/cheerio-select/lib/helpers.d.ts.map +1 -0
  398. package/node_modules/cheerio-select/lib/helpers.js +26 -0
  399. package/node_modules/cheerio-select/lib/helpers.js.map +1 -0
  400. package/node_modules/cheerio-select/lib/index.d.ts +12 -0
  401. package/node_modules/cheerio-select/lib/index.d.ts.map +1 -0
  402. package/node_modules/cheerio-select/lib/index.js +302 -0
  403. package/node_modules/cheerio-select/lib/index.js.map +1 -0
  404. package/node_modules/cheerio-select/lib/positionals.d.ts +10 -0
  405. package/node_modules/cheerio-select/lib/positionals.d.ts.map +1 -0
  406. package/node_modules/cheerio-select/lib/positionals.js +52 -0
  407. package/node_modules/cheerio-select/lib/positionals.js.map +1 -0
  408. package/node_modules/cheerio-select/package.json +76 -0
  409. package/node_modules/codepage/LICENSE +201 -0
  410. package/node_modules/codepage/README.md +350 -0
  411. package/node_modules/codepage/bits/10000.js +2 -0
  412. package/node_modules/codepage/bits/10001.js +115 -0
  413. package/node_modules/codepage/bits/10002.js +253 -0
  414. package/node_modules/codepage/bits/10003.js +183 -0
  415. package/node_modules/codepage/bits/10004.js +2 -0
  416. package/node_modules/codepage/bits/10005.js +2 -0
  417. package/node_modules/codepage/bits/10006.js +2 -0
  418. package/node_modules/codepage/bits/10007.js +2 -0
  419. package/node_modules/codepage/bits/10008.js +167 -0
  420. package/node_modules/codepage/bits/10010.js +2 -0
  421. package/node_modules/codepage/bits/10017.js +2 -0
  422. package/node_modules/codepage/bits/10021.js +2 -0
  423. package/node_modules/codepage/bits/10029.js +2 -0
  424. package/node_modules/codepage/bits/10079.js +2 -0
  425. package/node_modules/codepage/bits/10081.js +2 -0
  426. package/node_modules/codepage/bits/10082.js +2 -0
  427. package/node_modules/codepage/bits/1010.js +2 -0
  428. package/node_modules/codepage/bits/1026.js +2 -0
  429. package/node_modules/codepage/bits/1047.js +2 -0
  430. package/node_modules/codepage/bits/1132.js +2 -0
  431. package/node_modules/codepage/bits/1140.js +2 -0
  432. package/node_modules/codepage/bits/1141.js +2 -0
  433. package/node_modules/codepage/bits/1142.js +2 -0
  434. package/node_modules/codepage/bits/1143.js +2 -0
  435. package/node_modules/codepage/bits/1144.js +2 -0
  436. package/node_modules/codepage/bits/1145.js +2 -0
  437. package/node_modules/codepage/bits/1146.js +2 -0
  438. package/node_modules/codepage/bits/1147.js +2 -0
  439. package/node_modules/codepage/bits/1148.js +2 -0
  440. package/node_modules/codepage/bits/1149.js +2 -0
  441. package/node_modules/codepage/bits/1250.js +2 -0
  442. package/node_modules/codepage/bits/1251.js +2 -0
  443. package/node_modules/codepage/bits/1252.js +2 -0
  444. package/node_modules/codepage/bits/1253.js +2 -0
  445. package/node_modules/codepage/bits/1254.js +2 -0
  446. package/node_modules/codepage/bits/1255.js +2 -0
  447. package/node_modules/codepage/bits/1256.js +2 -0
  448. package/node_modules/codepage/bits/1257.js +2 -0
  449. package/node_modules/codepage/bits/1258.js +2 -0
  450. package/node_modules/codepage/bits/1361.js +231 -0
  451. package/node_modules/codepage/bits/20000.js +193 -0
  452. package/node_modules/codepage/bits/20001.js +217 -0
  453. package/node_modules/codepage/bits/20002.js +167 -0
  454. package/node_modules/codepage/bits/20003.js +213 -0
  455. package/node_modules/codepage/bits/20004.js +193 -0
  456. package/node_modules/codepage/bits/20005.js +223 -0
  457. package/node_modules/codepage/bits/20105.js +2 -0
  458. package/node_modules/codepage/bits/20106.js +2 -0
  459. package/node_modules/codepage/bits/20107.js +2 -0
  460. package/node_modules/codepage/bits/20108.js +2 -0
  461. package/node_modules/codepage/bits/20261.js +31 -0
  462. package/node_modules/codepage/bits/20269.js +2 -0
  463. package/node_modules/codepage/bits/20273.js +2 -0
  464. package/node_modules/codepage/bits/20277.js +2 -0
  465. package/node_modules/codepage/bits/20278.js +2 -0
  466. package/node_modules/codepage/bits/20280.js +2 -0
  467. package/node_modules/codepage/bits/20284.js +2 -0
  468. package/node_modules/codepage/bits/20285.js +2 -0
  469. package/node_modules/codepage/bits/20290.js +2 -0
  470. package/node_modules/codepage/bits/20297.js +2 -0
  471. package/node_modules/codepage/bits/20420.js +2 -0
  472. package/node_modules/codepage/bits/20423.js +2 -0
  473. package/node_modules/codepage/bits/20424.js +2 -0
  474. package/node_modules/codepage/bits/20833.js +2 -0
  475. package/node_modules/codepage/bits/20838.js +2 -0
  476. package/node_modules/codepage/bits/20866.js +2 -0
  477. package/node_modules/codepage/bits/20871.js +2 -0
  478. package/node_modules/codepage/bits/20880.js +2 -0
  479. package/node_modules/codepage/bits/20905.js +2 -0
  480. package/node_modules/codepage/bits/20924.js +2 -0
  481. package/node_modules/codepage/bits/20932.js +189 -0
  482. package/node_modules/codepage/bits/20936.js +167 -0
  483. package/node_modules/codepage/bits/20949.js +183 -0
  484. package/node_modules/codepage/bits/21025.js +2 -0
  485. package/node_modules/codepage/bits/21027.js +2 -0
  486. package/node_modules/codepage/bits/21866.js +2 -0
  487. package/node_modules/codepage/bits/28591.js +2 -0
  488. package/node_modules/codepage/bits/28592.js +2 -0
  489. package/node_modules/codepage/bits/28593.js +2 -0
  490. package/node_modules/codepage/bits/28594.js +2 -0
  491. package/node_modules/codepage/bits/28595.js +2 -0
  492. package/node_modules/codepage/bits/28596.js +2 -0
  493. package/node_modules/codepage/bits/28597.js +2 -0
  494. package/node_modules/codepage/bits/28598.js +2 -0
  495. package/node_modules/codepage/bits/28599.js +2 -0
  496. package/node_modules/codepage/bits/28600.js +2 -0
  497. package/node_modules/codepage/bits/28601.js +2 -0
  498. package/node_modules/codepage/bits/28603.js +2 -0
  499. package/node_modules/codepage/bits/28604.js +2 -0
  500. package/node_modules/codepage/bits/28605.js +2 -0
  501. package/node_modules/codepage/bits/28606.js +2 -0
  502. package/node_modules/codepage/bits/29001.js +2 -0
  503. package/node_modules/codepage/bits/37.js +2 -0
  504. package/node_modules/codepage/bits/38598.js +2 -0
  505. package/node_modules/codepage/bits/437.js +2 -0
  506. package/node_modules/codepage/bits/47451.js +2 -0
  507. package/node_modules/codepage/bits/500.js +2 -0
  508. package/node_modules/codepage/bits/50220.js +395 -0
  509. package/node_modules/codepage/bits/50221.js +395 -0
  510. package/node_modules/codepage/bits/50222.js +395 -0
  511. package/node_modules/codepage/bits/50225.js +259 -0
  512. package/node_modules/codepage/bits/50227.js +257 -0
  513. package/node_modules/codepage/bits/51932.js +171 -0
  514. package/node_modules/codepage/bits/51936.js +257 -0
  515. package/node_modules/codepage/bits/51949.js +183 -0
  516. package/node_modules/codepage/bits/52936.js +7 -0
  517. package/node_modules/codepage/bits/54936.js +257 -0
  518. package/node_modules/codepage/bits/57002.js +39 -0
  519. package/node_modules/codepage/bits/57003.js +23 -0
  520. package/node_modules/codepage/bits/57004.js +7 -0
  521. package/node_modules/codepage/bits/57005.js +15 -0
  522. package/node_modules/codepage/bits/57006.js +23 -0
  523. package/node_modules/codepage/bits/57007.js +21 -0
  524. package/node_modules/codepage/bits/57008.js +17 -0
  525. package/node_modules/codepage/bits/57009.js +13 -0
  526. package/node_modules/codepage/bits/57010.js +15 -0
  527. package/node_modules/codepage/bits/57011.js +17 -0
  528. package/node_modules/codepage/bits/620.js +2 -0
  529. package/node_modules/codepage/bits/708.js +2 -0
  530. package/node_modules/codepage/bits/720.js +2 -0
  531. package/node_modules/codepage/bits/737.js +2 -0
  532. package/node_modules/codepage/bits/775.js +2 -0
  533. package/node_modules/codepage/bits/808.js +2 -0
  534. package/node_modules/codepage/bits/850.js +2 -0
  535. package/node_modules/codepage/bits/852.js +2 -0
  536. package/node_modules/codepage/bits/855.js +2 -0
  537. package/node_modules/codepage/bits/857.js +2 -0
  538. package/node_modules/codepage/bits/858.js +2 -0
  539. package/node_modules/codepage/bits/860.js +2 -0
  540. package/node_modules/codepage/bits/861.js +2 -0
  541. package/node_modules/codepage/bits/862.js +2 -0
  542. package/node_modules/codepage/bits/863.js +2 -0
  543. package/node_modules/codepage/bits/864.js +2 -0
  544. package/node_modules/codepage/bits/865.js +2 -0
  545. package/node_modules/codepage/bits/866.js +2 -0
  546. package/node_modules/codepage/bits/869.js +2 -0
  547. package/node_modules/codepage/bits/870.js +2 -0
  548. package/node_modules/codepage/bits/872.js +2 -0
  549. package/node_modules/codepage/bits/874.js +2 -0
  550. package/node_modules/codepage/bits/875.js +2 -0
  551. package/node_modules/codepage/bits/895.js +2 -0
  552. package/node_modules/codepage/bits/932.js +95 -0
  553. package/node_modules/codepage/bits/936.js +257 -0
  554. package/node_modules/codepage/bits/949.js +253 -0
  555. package/node_modules/codepage/bits/950.js +179 -0
  556. package/node_modules/codepage/cptable.js +4651 -0
  557. package/node_modules/codepage/cputils.js +528 -0
  558. package/node_modules/codepage/dist/cpexcel.full.js +1506 -0
  559. package/node_modules/codepage/dist/sbcs.full.js +639 -0
  560. package/node_modules/codepage/package.json +72 -0
  561. package/node_modules/codepage/types/index.d.ts +39 -0
  562. package/node_modules/codepage/types/tsconfig.json +15 -0
  563. package/node_modules/codepage/types/tslint.json +11 -0
  564. package/node_modules/crc-32/LICENSE +201 -0
  565. package/node_modules/crc-32/README.md +200 -0
  566. package/node_modules/crc-32/bin/crc32.njs +105 -0
  567. package/node_modules/crc-32/crc32.js +115 -0
  568. package/node_modules/crc-32/crc32c.js +115 -0
  569. package/node_modules/crc-32/package.json +43 -0
  570. package/node_modules/crc-32/types/index.d.ts +14 -0
  571. package/node_modules/crc-32/types/tsconfig.json +14 -0
  572. package/node_modules/crc-32/types/tslint.json +11 -0
  573. package/node_modules/css-select/LICENSE +11 -0
  574. package/node_modules/css-select/README.md +264 -0
  575. package/node_modules/css-select/lib/attributes.d.ts +7 -0
  576. package/node_modules/css-select/lib/attributes.d.ts.map +1 -0
  577. package/node_modules/css-select/lib/attributes.js +236 -0
  578. package/node_modules/css-select/lib/attributes.js.map +1 -0
  579. package/node_modules/css-select/lib/compile.d.ts +13 -0
  580. package/node_modules/css-select/lib/compile.d.ts.map +1 -0
  581. package/node_modules/css-select/lib/compile.js +151 -0
  582. package/node_modules/css-select/lib/compile.js.map +1 -0
  583. package/node_modules/css-select/lib/esm/attributes.d.ts +7 -0
  584. package/node_modules/css-select/lib/esm/attributes.d.ts.map +1 -0
  585. package/node_modules/css-select/lib/esm/attributes.js +222 -0
  586. package/node_modules/css-select/lib/esm/attributes.js.map +1 -0
  587. package/node_modules/css-select/lib/esm/compile.d.ts +13 -0
  588. package/node_modules/css-select/lib/esm/compile.d.ts.map +1 -0
  589. package/node_modules/css-select/lib/esm/compile.js +115 -0
  590. package/node_modules/css-select/lib/esm/compile.js.map +1 -0
  591. package/node_modules/css-select/lib/esm/general.d.ts +3 -0
  592. package/node_modules/css-select/lib/esm/general.d.ts.map +1 -0
  593. package/node_modules/css-select/lib/esm/general.js +144 -0
  594. package/node_modules/css-select/lib/esm/general.js.map +1 -0
  595. package/node_modules/css-select/lib/esm/helpers/cache.d.ts +12 -0
  596. package/node_modules/css-select/lib/esm/helpers/cache.d.ts.map +1 -0
  597. package/node_modules/css-select/lib/esm/helpers/cache.js +41 -0
  598. package/node_modules/css-select/lib/esm/helpers/cache.js.map +1 -0
  599. package/node_modules/css-select/lib/esm/helpers/querying.d.ts +24 -0
  600. package/node_modules/css-select/lib/esm/helpers/querying.d.ts.map +1 -0
  601. package/node_modules/css-select/lib/esm/helpers/querying.js +105 -0
  602. package/node_modules/css-select/lib/esm/helpers/querying.js.map +1 -0
  603. package/node_modules/css-select/lib/esm/helpers/selectors.d.ts +20 -0
  604. package/node_modules/css-select/lib/esm/helpers/selectors.d.ts.map +1 -0
  605. package/node_modules/css-select/lib/esm/helpers/selectors.js +103 -0
  606. package/node_modules/css-select/lib/esm/helpers/selectors.js.map +1 -0
  607. package/node_modules/css-select/lib/esm/index.d.ts +50 -0
  608. package/node_modules/css-select/lib/esm/index.d.ts.map +1 -0
  609. package/node_modules/css-select/lib/esm/index.js +115 -0
  610. package/node_modules/css-select/lib/esm/index.js.map +1 -0
  611. package/node_modules/css-select/lib/esm/package.json +1 -0
  612. package/node_modules/css-select/lib/esm/pseudo-selectors/aliases.d.ts +5 -0
  613. package/node_modules/css-select/lib/esm/pseudo-selectors/aliases.d.ts.map +1 -0
  614. package/node_modules/css-select/lib/esm/pseudo-selectors/aliases.js +35 -0
  615. package/node_modules/css-select/lib/esm/pseudo-selectors/aliases.js.map +1 -0
  616. package/node_modules/css-select/lib/esm/pseudo-selectors/filters.d.ts +4 -0
  617. package/node_modules/css-select/lib/esm/pseudo-selectors/filters.d.ts.map +1 -0
  618. package/node_modules/css-select/lib/esm/pseudo-selectors/filters.js +143 -0
  619. package/node_modules/css-select/lib/esm/pseudo-selectors/filters.js.map +1 -0
  620. package/node_modules/css-select/lib/esm/pseudo-selectors/index.d.ts +8 -0
  621. package/node_modules/css-select/lib/esm/pseudo-selectors/index.d.ts.map +1 -0
  622. package/node_modules/css-select/lib/esm/pseudo-selectors/index.js +40 -0
  623. package/node_modules/css-select/lib/esm/pseudo-selectors/index.js.map +1 -0
  624. package/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.d.ts +6 -0
  625. package/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.d.ts.map +1 -0
  626. package/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.js +79 -0
  627. package/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.js.map +1 -0
  628. package/node_modules/css-select/lib/esm/pseudo-selectors/subselects.d.ts +9 -0
  629. package/node_modules/css-select/lib/esm/pseudo-selectors/subselects.d.ts.map +1 -0
  630. package/node_modules/css-select/lib/esm/pseudo-selectors/subselects.js +94 -0
  631. package/node_modules/css-select/lib/esm/pseudo-selectors/subselects.js.map +1 -0
  632. package/node_modules/css-select/lib/esm/sort.d.ts +12 -0
  633. package/node_modules/css-select/lib/esm/sort.d.ts.map +1 -0
  634. package/node_modules/css-select/lib/esm/sort.js +79 -0
  635. package/node_modules/css-select/lib/esm/sort.js.map +1 -0
  636. package/node_modules/css-select/lib/esm/types.d.ts +167 -0
  637. package/node_modules/css-select/lib/esm/types.d.ts.map +1 -0
  638. package/node_modules/css-select/lib/esm/types.js +2 -0
  639. package/node_modules/css-select/lib/esm/types.js.map +1 -0
  640. package/node_modules/css-select/lib/general.d.ts +3 -0
  641. package/node_modules/css-select/lib/general.d.ts.map +1 -0
  642. package/node_modules/css-select/lib/general.js +148 -0
  643. package/node_modules/css-select/lib/general.js.map +1 -0
  644. package/node_modules/css-select/lib/helpers/cache.d.ts +12 -0
  645. package/node_modules/css-select/lib/helpers/cache.d.ts.map +1 -0
  646. package/node_modules/css-select/lib/helpers/cache.js +45 -0
  647. package/node_modules/css-select/lib/helpers/cache.js.map +1 -0
  648. package/node_modules/css-select/lib/helpers/querying.d.ts +24 -0
  649. package/node_modules/css-select/lib/helpers/querying.d.ts.map +1 -0
  650. package/node_modules/css-select/lib/helpers/querying.js +111 -0
  651. package/node_modules/css-select/lib/helpers/querying.js.map +1 -0
  652. package/node_modules/css-select/lib/helpers/selectors.d.ts +20 -0
  653. package/node_modules/css-select/lib/helpers/selectors.d.ts.map +1 -0
  654. package/node_modules/css-select/lib/helpers/selectors.js +111 -0
  655. package/node_modules/css-select/lib/helpers/selectors.js.map +1 -0
  656. package/node_modules/css-select/lib/index.d.ts +50 -0
  657. package/node_modules/css-select/lib/index.d.ts.map +1 -0
  658. package/node_modules/css-select/lib/index.js +154 -0
  659. package/node_modules/css-select/lib/index.js.map +1 -0
  660. package/node_modules/css-select/lib/pseudo-selectors/aliases.d.ts +5 -0
  661. package/node_modules/css-select/lib/pseudo-selectors/aliases.d.ts.map +1 -0
  662. package/node_modules/css-select/lib/pseudo-selectors/aliases.js +34 -0
  663. package/node_modules/css-select/lib/pseudo-selectors/aliases.js.map +1 -0
  664. package/node_modules/css-select/lib/pseudo-selectors/filters.d.ts +4 -0
  665. package/node_modules/css-select/lib/pseudo-selectors/filters.d.ts.map +1 -0
  666. package/node_modules/css-select/lib/pseudo-selectors/filters.js +157 -0
  667. package/node_modules/css-select/lib/pseudo-selectors/filters.js.map +1 -0
  668. package/node_modules/css-select/lib/pseudo-selectors/index.d.ts +8 -0
  669. package/node_modules/css-select/lib/pseudo-selectors/index.d.ts.map +1 -0
  670. package/node_modules/css-select/lib/pseudo-selectors/index.js +46 -0
  671. package/node_modules/css-select/lib/pseudo-selectors/index.js.map +1 -0
  672. package/node_modules/css-select/lib/pseudo-selectors/pseudos.d.ts +6 -0
  673. package/node_modules/css-select/lib/pseudo-selectors/pseudos.d.ts.map +1 -0
  674. package/node_modules/css-select/lib/pseudo-selectors/pseudos.js +93 -0
  675. package/node_modules/css-select/lib/pseudo-selectors/pseudos.js.map +1 -0
  676. package/node_modules/css-select/lib/pseudo-selectors/subselects.d.ts +9 -0
  677. package/node_modules/css-select/lib/pseudo-selectors/subselects.d.ts.map +1 -0
  678. package/node_modules/css-select/lib/pseudo-selectors/subselects.js +112 -0
  679. package/node_modules/css-select/lib/pseudo-selectors/subselects.js.map +1 -0
  680. package/node_modules/css-select/lib/sort.d.ts +12 -0
  681. package/node_modules/css-select/lib/sort.d.ts.map +1 -0
  682. package/node_modules/css-select/lib/sort.js +84 -0
  683. package/node_modules/css-select/lib/sort.js.map +1 -0
  684. package/node_modules/css-select/lib/types.d.ts +167 -0
  685. package/node_modules/css-select/lib/types.d.ts.map +1 -0
  686. package/node_modules/css-select/lib/types.js +3 -0
  687. package/node_modules/css-select/lib/types.js.map +1 -0
  688. package/node_modules/css-select/package.json +81 -0
  689. package/node_modules/css-what/LICENSE +11 -0
  690. package/node_modules/css-what/lib/commonjs/index.d.ts +4 -0
  691. package/node_modules/css-what/lib/commonjs/index.d.ts.map +1 -0
  692. package/node_modules/css-what/lib/commonjs/index.js +23 -0
  693. package/node_modules/css-what/lib/commonjs/parse.d.ts +20 -0
  694. package/node_modules/css-what/lib/commonjs/parse.d.ts.map +1 -0
  695. package/node_modules/css-what/lib/commonjs/parse.js +425 -0
  696. package/node_modules/css-what/lib/commonjs/stringify.d.ts +8 -0
  697. package/node_modules/css-what/lib/commonjs/stringify.d.ts.map +1 -0
  698. package/node_modules/css-what/lib/commonjs/stringify.js +138 -0
  699. package/node_modules/css-what/lib/commonjs/types.d.ts +70 -0
  700. package/node_modules/css-what/lib/commonjs/types.d.ts.map +1 -0
  701. package/node_modules/css-what/lib/commonjs/types.js +42 -0
  702. package/node_modules/css-what/lib/es/index.d.ts +4 -0
  703. package/node_modules/css-what/lib/es/index.d.ts.map +1 -0
  704. package/node_modules/css-what/lib/es/index.js +3 -0
  705. package/node_modules/css-what/lib/es/parse.d.ts +20 -0
  706. package/node_modules/css-what/lib/es/parse.d.ts.map +1 -0
  707. package/node_modules/css-what/lib/es/parse.js +420 -0
  708. package/node_modules/css-what/lib/es/stringify.d.ts +8 -0
  709. package/node_modules/css-what/lib/es/stringify.d.ts.map +1 -0
  710. package/node_modules/css-what/lib/es/stringify.js +126 -0
  711. package/node_modules/css-what/lib/es/types.d.ts +70 -0
  712. package/node_modules/css-what/lib/es/types.d.ts.map +1 -0
  713. package/node_modules/css-what/lib/es/types.js +39 -0
  714. package/node_modules/css-what/package.json +59 -0
  715. package/node_modules/css-what/readme.md +69 -0
  716. package/node_modules/dom-serializer/LICENSE +11 -0
  717. package/node_modules/dom-serializer/README.md +109 -0
  718. package/node_modules/dom-serializer/lib/esm/foreignNames.d.ts +3 -0
  719. package/node_modules/dom-serializer/lib/esm/foreignNames.d.ts.map +1 -0
  720. package/node_modules/dom-serializer/lib/esm/foreignNames.js +100 -0
  721. package/node_modules/dom-serializer/lib/esm/index.d.ts +52 -0
  722. package/node_modules/dom-serializer/lib/esm/index.d.ts.map +1 -0
  723. package/node_modules/dom-serializer/lib/esm/index.js +190 -0
  724. package/node_modules/dom-serializer/lib/esm/package.json +1 -0
  725. package/node_modules/dom-serializer/lib/foreignNames.d.ts +3 -0
  726. package/node_modules/dom-serializer/lib/foreignNames.d.ts.map +1 -0
  727. package/node_modules/dom-serializer/lib/foreignNames.js +103 -0
  728. package/node_modules/dom-serializer/lib/index.d.ts +52 -0
  729. package/node_modules/dom-serializer/lib/index.d.ts.map +1 -0
  730. package/node_modules/dom-serializer/lib/index.js +229 -0
  731. package/node_modules/dom-serializer/package.json +69 -0
  732. package/node_modules/domelementtype/LICENSE +11 -0
  733. package/node_modules/domelementtype/lib/esm/index.d.ts +48 -0
  734. package/node_modules/domelementtype/lib/esm/index.d.ts.map +1 -0
  735. package/node_modules/domelementtype/lib/esm/index.js +51 -0
  736. package/node_modules/domelementtype/lib/esm/package.json +1 -0
  737. package/node_modules/domelementtype/lib/index.d.ts +48 -0
  738. package/node_modules/domelementtype/lib/index.d.ts.map +1 -0
  739. package/node_modules/domelementtype/lib/index.js +55 -0
  740. package/node_modules/domelementtype/package.json +54 -0
  741. package/node_modules/domelementtype/readme.md +1 -0
  742. package/node_modules/domhandler/LICENSE +11 -0
  743. package/node_modules/domhandler/lib/esm/index.d.ts +76 -0
  744. package/node_modules/domhandler/lib/esm/index.d.ts.map +1 -0
  745. package/node_modules/domhandler/lib/esm/index.js +146 -0
  746. package/node_modules/domhandler/lib/esm/node.d.ts +245 -0
  747. package/node_modules/domhandler/lib/esm/node.d.ts.map +1 -0
  748. package/node_modules/domhandler/lib/esm/node.js +338 -0
  749. package/node_modules/domhandler/lib/esm/package.json +1 -0
  750. package/node_modules/domhandler/lib/index.d.ts +76 -0
  751. package/node_modules/domhandler/lib/index.d.ts.map +1 -0
  752. package/node_modules/domhandler/lib/index.js +165 -0
  753. package/node_modules/domhandler/lib/node.d.ts +245 -0
  754. package/node_modules/domhandler/lib/node.d.ts.map +1 -0
  755. package/node_modules/domhandler/lib/node.js +474 -0
  756. package/node_modules/domhandler/package.json +73 -0
  757. package/node_modules/domhandler/readme.md +92 -0
  758. package/node_modules/domutils/LICENSE +11 -0
  759. package/node_modules/domutils/lib/esm/feeds.d.ts +71 -0
  760. package/node_modules/domutils/lib/esm/feeds.d.ts.map +1 -0
  761. package/node_modules/domutils/lib/esm/feeds.js +183 -0
  762. package/node_modules/domutils/lib/esm/feeds.js.map +1 -0
  763. package/node_modules/domutils/lib/esm/helpers.d.ts +59 -0
  764. package/node_modules/domutils/lib/esm/helpers.d.ts.map +1 -0
  765. package/node_modules/domutils/lib/esm/helpers.js +136 -0
  766. package/node_modules/domutils/lib/esm/helpers.js.map +1 -0
  767. package/node_modules/domutils/lib/esm/index.d.ts +10 -0
  768. package/node_modules/domutils/lib/esm/index.d.ts.map +1 -0
  769. package/node_modules/domutils/lib/esm/index.js +10 -0
  770. package/node_modules/domutils/lib/esm/index.js.map +1 -0
  771. package/node_modules/domutils/lib/esm/legacy.d.ts +79 -0
  772. package/node_modules/domutils/lib/esm/legacy.d.ts.map +1 -0
  773. package/node_modules/domutils/lib/esm/legacy.js +152 -0
  774. package/node_modules/domutils/lib/esm/legacy.js.map +1 -0
  775. package/node_modules/domutils/lib/esm/manipulation.d.ts +49 -0
  776. package/node_modules/domutils/lib/esm/manipulation.d.ts.map +1 -0
  777. package/node_modules/domutils/lib/esm/manipulation.js +134 -0
  778. package/node_modules/domutils/lib/esm/manipulation.js.map +1 -0
  779. package/node_modules/domutils/lib/esm/package.json +1 -0
  780. package/node_modules/domutils/lib/esm/querying.d.ts +64 -0
  781. package/node_modules/domutils/lib/esm/querying.d.ts.map +1 -0
  782. package/node_modules/domutils/lib/esm/querying.js +142 -0
  783. package/node_modules/domutils/lib/esm/querying.js.map +1 -0
  784. package/node_modules/domutils/lib/esm/stringify.d.ts +46 -0
  785. package/node_modules/domutils/lib/esm/stringify.d.ts.map +1 -0
  786. package/node_modules/domutils/lib/esm/stringify.js +81 -0
  787. package/node_modules/domutils/lib/esm/stringify.js.map +1 -0
  788. package/node_modules/domutils/lib/esm/traversal.d.ts +67 -0
  789. package/node_modules/domutils/lib/esm/traversal.d.ts.map +1 -0
  790. package/node_modules/domutils/lib/esm/traversal.js +112 -0
  791. package/node_modules/domutils/lib/esm/traversal.js.map +1 -0
  792. package/node_modules/domutils/lib/feeds.d.ts +71 -0
  793. package/node_modules/domutils/lib/feeds.d.ts.map +1 -0
  794. package/node_modules/domutils/lib/feeds.js +190 -0
  795. package/node_modules/domutils/lib/feeds.js.map +1 -0
  796. package/node_modules/domutils/lib/helpers.d.ts +59 -0
  797. package/node_modules/domutils/lib/helpers.d.ts.map +1 -0
  798. package/node_modules/domutils/lib/helpers.js +142 -0
  799. package/node_modules/domutils/lib/helpers.js.map +1 -0
  800. package/node_modules/domutils/lib/index.d.ts +10 -0
  801. package/node_modules/domutils/lib/index.d.ts.map +1 -0
  802. package/node_modules/domutils/lib/index.js +33 -0
  803. package/node_modules/domutils/lib/index.js.map +1 -0
  804. package/node_modules/domutils/lib/legacy.d.ts +79 -0
  805. package/node_modules/domutils/lib/legacy.d.ts.map +1 -0
  806. package/node_modules/domutils/lib/legacy.js +168 -0
  807. package/node_modules/domutils/lib/legacy.js.map +1 -0
  808. package/node_modules/domutils/lib/manipulation.d.ts +49 -0
  809. package/node_modules/domutils/lib/manipulation.d.ts.map +1 -0
  810. package/node_modules/domutils/lib/manipulation.js +142 -0
  811. package/node_modules/domutils/lib/manipulation.js.map +1 -0
  812. package/node_modules/domutils/lib/querying.d.ts +64 -0
  813. package/node_modules/domutils/lib/querying.d.ts.map +1 -0
  814. package/node_modules/domutils/lib/querying.js +155 -0
  815. package/node_modules/domutils/lib/querying.js.map +1 -0
  816. package/node_modules/domutils/lib/stringify.d.ts +46 -0
  817. package/node_modules/domutils/lib/stringify.d.ts.map +1 -0
  818. package/node_modules/domutils/lib/stringify.js +91 -0
  819. package/node_modules/domutils/lib/stringify.js.map +1 -0
  820. package/node_modules/domutils/lib/traversal.d.ts +67 -0
  821. package/node_modules/domutils/lib/traversal.d.ts.map +1 -0
  822. package/node_modules/domutils/lib/traversal.js +125 -0
  823. package/node_modules/domutils/lib/traversal.js.map +1 -0
  824. package/node_modules/domutils/package.json +79 -0
  825. package/node_modules/domutils/readme.md +31 -0
  826. package/node_modules/encoding-sniffer/LICENSE +18 -0
  827. package/node_modules/encoding-sniffer/README.md +68 -0
  828. package/node_modules/encoding-sniffer/dist/commonjs/index.d.ts +31 -0
  829. package/node_modules/encoding-sniffer/dist/commonjs/index.d.ts.map +1 -0
  830. package/node_modules/encoding-sniffer/dist/commonjs/index.js +72 -0
  831. package/node_modules/encoding-sniffer/dist/commonjs/index.js.map +1 -0
  832. package/node_modules/encoding-sniffer/dist/commonjs/package.json +3 -0
  833. package/node_modules/encoding-sniffer/dist/commonjs/sniffer.d.ts +148 -0
  834. package/node_modules/encoding-sniffer/dist/commonjs/sniffer.d.ts.map +1 -0
  835. package/node_modules/encoding-sniffer/dist/commonjs/sniffer.js +990 -0
  836. package/node_modules/encoding-sniffer/dist/commonjs/sniffer.js.map +1 -0
  837. package/node_modules/encoding-sniffer/dist/esm/index.d.ts +31 -0
  838. package/node_modules/encoding-sniffer/dist/esm/index.d.ts.map +1 -0
  839. package/node_modules/encoding-sniffer/dist/esm/index.js +63 -0
  840. package/node_modules/encoding-sniffer/dist/esm/index.js.map +1 -0
  841. package/node_modules/encoding-sniffer/dist/esm/package.json +3 -0
  842. package/node_modules/encoding-sniffer/dist/esm/sniffer.d.ts +148 -0
  843. package/node_modules/encoding-sniffer/dist/esm/sniffer.d.ts.map +1 -0
  844. package/node_modules/encoding-sniffer/dist/esm/sniffer.js +985 -0
  845. package/node_modules/encoding-sniffer/dist/esm/sniffer.js.map +1 -0
  846. package/node_modules/encoding-sniffer/package.json +94 -0
  847. package/node_modules/encoding-sniffer/sniffer.d.ts +2 -0
  848. package/node_modules/encoding-sniffer/sniffer.js +3 -0
  849. package/node_modules/entities/LICENSE +11 -0
  850. package/node_modules/entities/lib/decode.d.ts +211 -0
  851. package/node_modules/entities/lib/decode.d.ts.map +1 -0
  852. package/node_modules/entities/lib/decode.js +536 -0
  853. package/node_modules/entities/lib/decode.js.map +1 -0
  854. package/node_modules/entities/lib/decode_codepoint.d.ts +19 -0
  855. package/node_modules/entities/lib/decode_codepoint.d.ts.map +1 -0
  856. package/node_modules/entities/lib/decode_codepoint.js +76 -0
  857. package/node_modules/entities/lib/decode_codepoint.js.map +1 -0
  858. package/node_modules/entities/lib/encode.d.ts +22 -0
  859. package/node_modules/entities/lib/encode.d.ts.map +1 -0
  860. package/node_modules/entities/lib/encode.js +77 -0
  861. package/node_modules/entities/lib/encode.js.map +1 -0
  862. package/node_modules/entities/lib/escape.d.ts +43 -0
  863. package/node_modules/entities/lib/escape.d.ts.map +1 -0
  864. package/node_modules/entities/lib/escape.js +122 -0
  865. package/node_modules/entities/lib/escape.js.map +1 -0
  866. package/node_modules/entities/lib/esm/decode.d.ts +211 -0
  867. package/node_modules/entities/lib/esm/decode.d.ts.map +1 -0
  868. package/node_modules/entities/lib/esm/decode.js +496 -0
  869. package/node_modules/entities/lib/esm/decode.js.map +1 -0
  870. package/node_modules/entities/lib/esm/decode_codepoint.d.ts +19 -0
  871. package/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +1 -0
  872. package/node_modules/entities/lib/esm/decode_codepoint.js +71 -0
  873. package/node_modules/entities/lib/esm/decode_codepoint.js.map +1 -0
  874. package/node_modules/entities/lib/esm/encode.d.ts +22 -0
  875. package/node_modules/entities/lib/esm/encode.d.ts.map +1 -0
  876. package/node_modules/entities/lib/esm/encode.js +69 -0
  877. package/node_modules/entities/lib/esm/encode.js.map +1 -0
  878. package/node_modules/entities/lib/esm/escape.d.ts +43 -0
  879. package/node_modules/entities/lib/esm/escape.d.ts.map +1 -0
  880. package/node_modules/entities/lib/esm/escape.js +116 -0
  881. package/node_modules/entities/lib/esm/escape.js.map +1 -0
  882. package/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +3 -0
  883. package/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +1 -0
  884. package/node_modules/entities/lib/esm/generated/decode-data-html.js +7 -0
  885. package/node_modules/entities/lib/esm/generated/decode-data-html.js.map +1 -0
  886. package/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +3 -0
  887. package/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +1 -0
  888. package/node_modules/entities/lib/esm/generated/decode-data-xml.js +7 -0
  889. package/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +1 -0
  890. package/node_modules/entities/lib/esm/generated/encode-html.d.ts +8 -0
  891. package/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +1 -0
  892. package/node_modules/entities/lib/esm/generated/encode-html.js +10 -0
  893. package/node_modules/entities/lib/esm/generated/encode-html.js.map +1 -0
  894. package/node_modules/entities/lib/esm/index.d.ts +96 -0
  895. package/node_modules/entities/lib/esm/index.d.ts.map +1 -0
  896. package/node_modules/entities/lib/esm/index.js +99 -0
  897. package/node_modules/entities/lib/esm/index.js.map +1 -0
  898. package/node_modules/entities/lib/esm/package.json +1 -0
  899. package/node_modules/entities/lib/generated/decode-data-html.d.ts +3 -0
  900. package/node_modules/entities/lib/generated/decode-data-html.d.ts.map +1 -0
  901. package/node_modules/entities/lib/generated/decode-data-html.js +9 -0
  902. package/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
  903. package/node_modules/entities/lib/generated/decode-data-xml.d.ts +3 -0
  904. package/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +1 -0
  905. package/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
  906. package/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
  907. package/node_modules/entities/lib/generated/encode-html.d.ts +8 -0
  908. package/node_modules/entities/lib/generated/encode-html.d.ts.map +1 -0
  909. package/node_modules/entities/lib/generated/encode-html.js +12 -0
  910. package/node_modules/entities/lib/generated/encode-html.js.map +1 -0
  911. package/node_modules/entities/lib/index.d.ts +96 -0
  912. package/node_modules/entities/lib/index.d.ts.map +1 -0
  913. package/node_modules/entities/lib/index.js +126 -0
  914. package/node_modules/entities/lib/index.js.map +1 -0
  915. package/node_modules/entities/package.json +90 -0
  916. package/node_modules/entities/readme.md +122 -0
  917. package/node_modules/enumify/.npmignore +2 -0
  918. package/node_modules/enumify/README.md +93 -0
  919. package/node_modules/enumify/lib/enumify.js +209 -0
  920. package/node_modules/enumify/package.json +31 -0
  921. package/node_modules/file-type/browser.d.ts +50 -0
  922. package/node_modules/file-type/browser.js +49 -0
  923. package/node_modules/file-type/core.d.ts +386 -0
  924. package/node_modules/file-type/core.js +1465 -0
  925. package/node_modules/file-type/index.d.ts +27 -0
  926. package/node_modules/file-type/index.js +32 -0
  927. package/node_modules/file-type/license +9 -0
  928. package/node_modules/file-type/package.json +215 -0
  929. package/node_modules/file-type/readme.md +470 -0
  930. package/node_modules/file-type/supported.js +279 -0
  931. package/node_modules/file-type/util.js +40 -0
  932. package/node_modules/htmlparser2/LICENSE +18 -0
  933. package/node_modules/htmlparser2/README.md +171 -0
  934. package/node_modules/htmlparser2/WritableStream.js +3 -0
  935. package/node_modules/htmlparser2/dist/commonjs/Parser.d.ts +198 -0
  936. package/node_modules/htmlparser2/dist/commonjs/Parser.d.ts.map +1 -0
  937. package/node_modules/htmlparser2/dist/commonjs/Parser.js +527 -0
  938. package/node_modules/htmlparser2/dist/commonjs/Parser.js.map +1 -0
  939. package/node_modules/htmlparser2/dist/commonjs/Tokenizer.d.ts +126 -0
  940. package/node_modules/htmlparser2/dist/commonjs/Tokenizer.d.ts.map +1 -0
  941. package/node_modules/htmlparser2/dist/commonjs/Tokenizer.js +805 -0
  942. package/node_modules/htmlparser2/dist/commonjs/Tokenizer.js.map +1 -0
  943. package/node_modules/htmlparser2/dist/commonjs/WritableStream.d.ts +15 -0
  944. package/node_modules/htmlparser2/dist/commonjs/WritableStream.d.ts.map +1 -0
  945. package/node_modules/htmlparser2/dist/commonjs/WritableStream.js +36 -0
  946. package/node_modules/htmlparser2/dist/commonjs/WritableStream.js.map +1 -0
  947. package/node_modules/htmlparser2/dist/commonjs/index.d.ts +54 -0
  948. package/node_modules/htmlparser2/dist/commonjs/index.d.ts.map +1 -0
  949. package/node_modules/htmlparser2/dist/commonjs/index.js +123 -0
  950. package/node_modules/htmlparser2/dist/commonjs/index.js.map +1 -0
  951. package/node_modules/htmlparser2/dist/commonjs/package.json +3 -0
  952. package/node_modules/htmlparser2/dist/esm/Parser.d.ts +198 -0
  953. package/node_modules/htmlparser2/dist/esm/Parser.d.ts.map +1 -0
  954. package/node_modules/htmlparser2/dist/esm/Parser.js +490 -0
  955. package/node_modules/htmlparser2/dist/esm/Parser.js.map +1 -0
  956. package/node_modules/htmlparser2/dist/esm/Tokenizer.d.ts +126 -0
  957. package/node_modules/htmlparser2/dist/esm/Tokenizer.d.ts.map +1 -0
  958. package/node_modules/htmlparser2/dist/esm/Tokenizer.js +801 -0
  959. package/node_modules/htmlparser2/dist/esm/Tokenizer.js.map +1 -0
  960. package/node_modules/htmlparser2/dist/esm/WritableStream.d.ts +15 -0
  961. package/node_modules/htmlparser2/dist/esm/WritableStream.d.ts.map +1 -0
  962. package/node_modules/htmlparser2/dist/esm/WritableStream.js +32 -0
  963. package/node_modules/htmlparser2/dist/esm/WritableStream.js.map +1 -0
  964. package/node_modules/htmlparser2/dist/esm/index.d.ts +54 -0
  965. package/node_modules/htmlparser2/dist/esm/index.d.ts.map +1 -0
  966. package/node_modules/htmlparser2/dist/esm/index.js +74 -0
  967. package/node_modules/htmlparser2/dist/esm/index.js.map +1 -0
  968. package/node_modules/htmlparser2/dist/esm/package.json +3 -0
  969. package/node_modules/htmlparser2/node_modules/entities/LICENSE +11 -0
  970. package/node_modules/htmlparser2/node_modules/entities/decode.d.ts +3 -0
  971. package/node_modules/htmlparser2/node_modules/entities/decode.js +3 -0
  972. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode-codepoint.d.ts +19 -0
  973. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode-codepoint.d.ts.map +1 -0
  974. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
  975. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode-codepoint.js.map +1 -0
  976. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode.d.ts +205 -0
  977. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode.d.ts.map +1 -0
  978. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode.js +568 -0
  979. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode.js.map +1 -0
  980. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/encode.d.ts +22 -0
  981. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/encode.d.ts.map +1 -0
  982. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/encode.js +92 -0
  983. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/encode.js.map +1 -0
  984. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/escape.d.ts +46 -0
  985. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/escape.d.ts.map +1 -0
  986. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/escape.js +138 -0
  987. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/escape.js.map +1 -0
  988. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-html.d.ts +2 -0
  989. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-html.d.ts.map +1 -0
  990. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
  991. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-html.js.map +1 -0
  992. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-xml.d.ts +2 -0
  993. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-xml.d.ts.map +1 -0
  994. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
  995. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-xml.js.map +1 -0
  996. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/encode-html.d.ts +3 -0
  997. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/encode-html.d.ts.map +1 -0
  998. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/encode-html.js +14 -0
  999. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/encode-html.js.map +1 -0
  1000. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/index.d.ts +96 -0
  1001. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/index.d.ts.map +1 -0
  1002. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/index.js +131 -0
  1003. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/index.js.map +1 -0
  1004. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/bin-trie-flags.d.ts +17 -0
  1005. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/bin-trie-flags.d.ts.map +1 -0
  1006. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
  1007. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js.map +1 -0
  1008. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/decode-shared.d.ts +2 -0
  1009. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/decode-shared.d.ts.map +1 -0
  1010. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
  1011. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/decode-shared.js.map +1 -0
  1012. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/encode-shared.d.ts +32 -0
  1013. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/encode-shared.d.ts.map +1 -0
  1014. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/encode-shared.js +94 -0
  1015. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/encode-shared.js.map +1 -0
  1016. package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/package.json +3 -0
  1017. package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode-codepoint.d.ts +19 -0
  1018. package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode-codepoint.d.ts.map +1 -0
  1019. package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode-codepoint.js +72 -0
  1020. package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode-codepoint.js.map +1 -0
  1021. package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode.d.ts +205 -0
  1022. package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode.d.ts.map +1 -0
  1023. package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode.js +554 -0
  1024. package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode.js.map +1 -0
  1025. package/node_modules/htmlparser2/node_modules/entities/dist/esm/encode.d.ts +22 -0
  1026. package/node_modules/htmlparser2/node_modules/entities/dist/esm/encode.d.ts.map +1 -0
  1027. package/node_modules/htmlparser2/node_modules/entities/dist/esm/encode.js +88 -0
  1028. package/node_modules/htmlparser2/node_modules/entities/dist/esm/encode.js.map +1 -0
  1029. package/node_modules/htmlparser2/node_modules/entities/dist/esm/escape.d.ts +46 -0
  1030. package/node_modules/htmlparser2/node_modules/entities/dist/esm/escape.d.ts.map +1 -0
  1031. package/node_modules/htmlparser2/node_modules/entities/dist/esm/escape.js +134 -0
  1032. package/node_modules/htmlparser2/node_modules/entities/dist/esm/escape.js.map +1 -0
  1033. package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-html.d.ts +2 -0
  1034. package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-html.d.ts.map +1 -0
  1035. package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-html.js +4 -0
  1036. package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-html.js.map +1 -0
  1037. package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-xml.d.ts +2 -0
  1038. package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-xml.d.ts.map +1 -0
  1039. package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-xml.js +4 -0
  1040. package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-xml.js.map +1 -0
  1041. package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/encode-html.d.ts +3 -0
  1042. package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/encode-html.d.ts.map +1 -0
  1043. package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/encode-html.js +11 -0
  1044. package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/encode-html.js.map +1 -0
  1045. package/node_modules/htmlparser2/node_modules/entities/dist/esm/index.d.ts +96 -0
  1046. package/node_modules/htmlparser2/node_modules/entities/dist/esm/index.d.ts.map +1 -0
  1047. package/node_modules/htmlparser2/node_modules/entities/dist/esm/index.js +107 -0
  1048. package/node_modules/htmlparser2/node_modules/entities/dist/esm/index.js.map +1 -0
  1049. package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/bin-trie-flags.d.ts +17 -0
  1050. package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/bin-trie-flags.d.ts.map +1 -0
  1051. package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/bin-trie-flags.js +18 -0
  1052. package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/bin-trie-flags.js.map +1 -0
  1053. package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/decode-shared.d.ts +2 -0
  1054. package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/decode-shared.d.ts.map +1 -0
  1055. package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/decode-shared.js +28 -0
  1056. package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/decode-shared.js.map +1 -0
  1057. package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/encode-shared.d.ts +32 -0
  1058. package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/encode-shared.d.ts.map +1 -0
  1059. package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/encode-shared.js +91 -0
  1060. package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/encode-shared.js.map +1 -0
  1061. package/node_modules/htmlparser2/node_modules/entities/dist/esm/package.json +3 -0
  1062. package/node_modules/htmlparser2/node_modules/entities/escape.d.ts +3 -0
  1063. package/node_modules/htmlparser2/node_modules/entities/escape.js +3 -0
  1064. package/node_modules/htmlparser2/node_modules/entities/package.json +120 -0
  1065. package/node_modules/htmlparser2/node_modules/entities/readme.md +143 -0
  1066. package/node_modules/htmlparser2/node_modules/entities/src/decode-codepoint.ts +81 -0
  1067. package/node_modules/htmlparser2/node_modules/entities/src/decode.ts +685 -0
  1068. package/node_modules/htmlparser2/node_modules/entities/src/encode.ts +93 -0
  1069. package/node_modules/htmlparser2/node_modules/entities/src/escape.ts +161 -0
  1070. package/node_modules/htmlparser2/node_modules/entities/src/generated/.eslintrc.json +10 -0
  1071. package/node_modules/htmlparser2/node_modules/entities/src/generated/decode-data-html.ts +6 -0
  1072. package/node_modules/htmlparser2/node_modules/entities/src/generated/decode-data-xml.ts +6 -0
  1073. package/node_modules/htmlparser2/node_modules/entities/src/generated/encode-html.ts +17 -0
  1074. package/node_modules/htmlparser2/node_modules/entities/src/index.ts +187 -0
  1075. package/node_modules/htmlparser2/node_modules/entities/src/internal/bin-trie-flags.ts +16 -0
  1076. package/node_modules/htmlparser2/node_modules/entities/src/internal/decode-shared.ts +30 -0
  1077. package/node_modules/htmlparser2/node_modules/entities/src/internal/encode-shared.ts +121 -0
  1078. package/node_modules/htmlparser2/package.json +113 -0
  1079. package/node_modules/htmlparser2/src/Parser.ts +663 -0
  1080. package/node_modules/htmlparser2/src/Tokenizer.ts +877 -0
  1081. package/node_modules/htmlparser2/src/WritableStream.ts +43 -0
  1082. package/node_modules/htmlparser2/src/index.ts +115 -0
  1083. package/node_modules/iconv-lite/.github/dependabot.yml +11 -0
  1084. package/node_modules/iconv-lite/.idea/codeStyles/Project.xml +47 -0
  1085. package/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +5 -0
  1086. package/node_modules/iconv-lite/.idea/iconv-lite.iml +12 -0
  1087. package/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +6 -0
  1088. package/node_modules/iconv-lite/.idea/modules.xml +8 -0
  1089. package/node_modules/iconv-lite/.idea/vcs.xml +6 -0
  1090. package/node_modules/iconv-lite/Changelog.md +212 -0
  1091. package/node_modules/iconv-lite/LICENSE +21 -0
  1092. package/node_modules/iconv-lite/README.md +130 -0
  1093. package/node_modules/iconv-lite/encodings/dbcs-codec.js +597 -0
  1094. package/node_modules/iconv-lite/encodings/dbcs-data.js +188 -0
  1095. package/node_modules/iconv-lite/encodings/index.js +23 -0
  1096. package/node_modules/iconv-lite/encodings/internal.js +198 -0
  1097. package/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
  1098. package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  1099. package/node_modules/iconv-lite/encodings/sbcs-data.js +179 -0
  1100. package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  1101. package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  1102. package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  1103. package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  1104. package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  1105. package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  1106. package/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  1107. package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  1108. package/node_modules/iconv-lite/encodings/utf16.js +197 -0
  1109. package/node_modules/iconv-lite/encodings/utf32.js +319 -0
  1110. package/node_modules/iconv-lite/encodings/utf7.js +290 -0
  1111. package/node_modules/iconv-lite/lib/bom-handling.js +52 -0
  1112. package/node_modules/iconv-lite/lib/index.d.ts +41 -0
  1113. package/node_modules/iconv-lite/lib/index.js +180 -0
  1114. package/node_modules/iconv-lite/lib/streams.js +109 -0
  1115. package/node_modules/iconv-lite/package.json +44 -0
  1116. package/node_modules/ieee754/LICENSE +11 -0
  1117. package/node_modules/ieee754/README.md +51 -0
  1118. package/node_modules/ieee754/index.d.ts +10 -0
  1119. package/node_modules/ieee754/index.js +85 -0
  1120. package/node_modules/ieee754/package.json +52 -0
  1121. package/node_modules/image-size/LICENSE +9 -0
  1122. package/node_modules/image-size/Readme.md +198 -0
  1123. package/node_modules/image-size/bin/image-size.js +48 -0
  1124. package/node_modules/image-size/dist/detector.cjs +964 -0
  1125. package/node_modules/image-size/dist/detector.d.mts +6 -0
  1126. package/node_modules/image-size/dist/detector.d.ts +6 -0
  1127. package/node_modules/image-size/dist/detector.mjs +962 -0
  1128. package/node_modules/image-size/dist/fromFile.cjs +1056 -0
  1129. package/node_modules/image-size/dist/fromFile.d.mts +9 -0
  1130. package/node_modules/image-size/dist/fromFile.d.ts +9 -0
  1131. package/node_modules/image-size/dist/fromFile.mjs +1032 -0
  1132. package/node_modules/image-size/dist/index.cjs +998 -0
  1133. package/node_modules/image-size/dist/index.d.mts +3 -0
  1134. package/node_modules/image-size/dist/index.d.ts +3 -0
  1135. package/node_modules/image-size/dist/index.mjs +991 -0
  1136. package/node_modules/image-size/dist/lookup.cjs +994 -0
  1137. package/node_modules/image-size/dist/lookup.d.mts +13 -0
  1138. package/node_modules/image-size/dist/lookup.d.ts +13 -0
  1139. package/node_modules/image-size/dist/lookup.mjs +991 -0
  1140. package/node_modules/image-size/dist/types/bmp.cjs +19 -0
  1141. package/node_modules/image-size/dist/types/bmp.d.mts +5 -0
  1142. package/node_modules/image-size/dist/types/bmp.d.ts +5 -0
  1143. package/node_modules/image-size/dist/types/bmp.mjs +17 -0
  1144. package/node_modules/image-size/dist/types/cur.cjs +60 -0
  1145. package/node_modules/image-size/dist/types/cur.d.mts +5 -0
  1146. package/node_modules/image-size/dist/types/cur.d.ts +5 -0
  1147. package/node_modules/image-size/dist/types/cur.mjs +58 -0
  1148. package/node_modules/image-size/dist/types/dds.cjs +17 -0
  1149. package/node_modules/image-size/dist/types/dds.d.mts +5 -0
  1150. package/node_modules/image-size/dist/types/dds.d.ts +5 -0
  1151. package/node_modules/image-size/dist/types/dds.mjs +15 -0
  1152. package/node_modules/image-size/dist/types/gif.cjs +19 -0
  1153. package/node_modules/image-size/dist/types/gif.d.mts +5 -0
  1154. package/node_modules/image-size/dist/types/gif.d.ts +5 -0
  1155. package/node_modules/image-size/dist/types/gif.mjs +17 -0
  1156. package/node_modules/image-size/dist/types/heif.cjs +86 -0
  1157. package/node_modules/image-size/dist/types/heif.d.mts +5 -0
  1158. package/node_modules/image-size/dist/types/heif.d.ts +5 -0
  1159. package/node_modules/image-size/dist/types/heif.mjs +84 -0
  1160. package/node_modules/image-size/dist/types/icns.cjs +90 -0
  1161. package/node_modules/image-size/dist/types/icns.d.mts +5 -0
  1162. package/node_modules/image-size/dist/types/icns.d.ts +5 -0
  1163. package/node_modules/image-size/dist/types/icns.mjs +88 -0
  1164. package/node_modules/image-size/dist/types/ico.cjs +47 -0
  1165. package/node_modules/image-size/dist/types/ico.d.mts +5 -0
  1166. package/node_modules/image-size/dist/types/ico.d.ts +5 -0
  1167. package/node_modules/image-size/dist/types/ico.mjs +45 -0
  1168. package/node_modules/image-size/dist/types/index.cjs +942 -0
  1169. package/node_modules/image-size/dist/types/index.d.mts +7 -0
  1170. package/node_modules/image-size/dist/types/index.d.ts +7 -0
  1171. package/node_modules/image-size/dist/types/index.mjs +939 -0
  1172. package/node_modules/image-size/dist/types/interface.cjs +2 -0
  1173. package/node_modules/image-size/dist/types/interface.d.mts +15 -0
  1174. package/node_modules/image-size/dist/types/interface.d.ts +15 -0
  1175. package/node_modules/image-size/dist/types/interface.mjs +1 -0
  1176. package/node_modules/image-size/dist/types/j2c.cjs +18 -0
  1177. package/node_modules/image-size/dist/types/j2c.d.mts +5 -0
  1178. package/node_modules/image-size/dist/types/j2c.d.ts +5 -0
  1179. package/node_modules/image-size/dist/types/j2c.mjs +16 -0
  1180. package/node_modules/image-size/dist/types/jp2.cjs +50 -0
  1181. package/node_modules/image-size/dist/types/jp2.d.mts +5 -0
  1182. package/node_modules/image-size/dist/types/jp2.d.ts +5 -0
  1183. package/node_modules/image-size/dist/types/jp2.mjs +48 -0
  1184. package/node_modules/image-size/dist/types/jpg.cjs +118 -0
  1185. package/node_modules/image-size/dist/types/jpg.d.mts +5 -0
  1186. package/node_modules/image-size/dist/types/jpg.d.ts +5 -0
  1187. package/node_modules/image-size/dist/types/jpg.mjs +116 -0
  1188. package/node_modules/image-size/dist/types/jxl-stream.cjs +80 -0
  1189. package/node_modules/image-size/dist/types/jxl-stream.d.mts +5 -0
  1190. package/node_modules/image-size/dist/types/jxl-stream.d.ts +5 -0
  1191. package/node_modules/image-size/dist/types/jxl-stream.mjs +78 -0
  1192. package/node_modules/image-size/dist/types/jxl.cjs +155 -0
  1193. package/node_modules/image-size/dist/types/jxl.d.mts +5 -0
  1194. package/node_modules/image-size/dist/types/jxl.d.ts +5 -0
  1195. package/node_modules/image-size/dist/types/jxl.mjs +153 -0
  1196. package/node_modules/image-size/dist/types/ktx.cjs +26 -0
  1197. package/node_modules/image-size/dist/types/ktx.d.mts +5 -0
  1198. package/node_modules/image-size/dist/types/ktx.d.ts +5 -0
  1199. package/node_modules/image-size/dist/types/ktx.mjs +24 -0
  1200. package/node_modules/image-size/dist/types/png.cjs +41 -0
  1201. package/node_modules/image-size/dist/types/png.d.mts +5 -0
  1202. package/node_modules/image-size/dist/types/png.d.ts +5 -0
  1203. package/node_modules/image-size/dist/types/png.mjs +39 -0
  1204. package/node_modules/image-size/dist/types/pnm.cjs +72 -0
  1205. package/node_modules/image-size/dist/types/pnm.d.mts +5 -0
  1206. package/node_modules/image-size/dist/types/pnm.d.ts +5 -0
  1207. package/node_modules/image-size/dist/types/pnm.mjs +70 -0
  1208. package/node_modules/image-size/dist/types/psd.cjs +18 -0
  1209. package/node_modules/image-size/dist/types/psd.d.mts +5 -0
  1210. package/node_modules/image-size/dist/types/psd.d.ts +5 -0
  1211. package/node_modules/image-size/dist/types/psd.mjs +16 -0
  1212. package/node_modules/image-size/dist/types/svg.cjs +97 -0
  1213. package/node_modules/image-size/dist/types/svg.d.mts +5 -0
  1214. package/node_modules/image-size/dist/types/svg.d.ts +5 -0
  1215. package/node_modules/image-size/dist/types/svg.mjs +95 -0
  1216. package/node_modules/image-size/dist/types/tga.cjs +21 -0
  1217. package/node_modules/image-size/dist/types/tga.d.mts +5 -0
  1218. package/node_modules/image-size/dist/types/tga.d.ts +5 -0
  1219. package/node_modules/image-size/dist/types/tga.mjs +19 -0
  1220. package/node_modules/image-size/dist/types/tiff.cjs +142 -0
  1221. package/node_modules/image-size/dist/types/tiff.d.mts +5 -0
  1222. package/node_modules/image-size/dist/types/tiff.d.ts +5 -0
  1223. package/node_modules/image-size/dist/types/tiff.mjs +140 -0
  1224. package/node_modules/image-size/dist/types/utils.cjs +60 -0
  1225. package/node_modules/image-size/dist/types/utils.d.mts +18 -0
  1226. package/node_modules/image-size/dist/types/utils.d.ts +18 -0
  1227. package/node_modules/image-size/dist/types/utils.mjs +47 -0
  1228. package/node_modules/image-size/dist/types/webp.cjs +63 -0
  1229. package/node_modules/image-size/dist/types/webp.d.mts +5 -0
  1230. package/node_modules/image-size/dist/types/webp.d.ts +5 -0
  1231. package/node_modules/image-size/dist/types/webp.mjs +61 -0
  1232. package/node_modules/image-size/dist/utils/bit-reader.cjs +43 -0
  1233. package/node_modules/image-size/dist/utils/bit-reader.d.mts +12 -0
  1234. package/node_modules/image-size/dist/utils/bit-reader.d.ts +12 -0
  1235. package/node_modules/image-size/dist/utils/bit-reader.mjs +41 -0
  1236. package/node_modules/image-size/package.json +104 -0
  1237. package/node_modules/mime-db/HISTORY.md +507 -0
  1238. package/node_modules/mime-db/LICENSE +23 -0
  1239. package/node_modules/mime-db/README.md +100 -0
  1240. package/node_modules/mime-db/db.json +8519 -0
  1241. package/node_modules/mime-db/index.js +12 -0
  1242. package/node_modules/mime-db/package.json +60 -0
  1243. package/node_modules/mime-types/HISTORY.md +397 -0
  1244. package/node_modules/mime-types/LICENSE +23 -0
  1245. package/node_modules/mime-types/README.md +113 -0
  1246. package/node_modules/mime-types/index.js +188 -0
  1247. package/node_modules/mime-types/package.json +44 -0
  1248. package/node_modules/minimist/.eslintrc +29 -0
  1249. package/node_modules/minimist/.github/FUNDING.yml +12 -0
  1250. package/node_modules/minimist/.nycrc +14 -0
  1251. package/node_modules/minimist/CHANGELOG.md +298 -0
  1252. package/node_modules/minimist/LICENSE +18 -0
  1253. package/node_modules/minimist/README.md +121 -0
  1254. package/node_modules/minimist/example/parse.js +4 -0
  1255. package/node_modules/minimist/index.js +263 -0
  1256. package/node_modules/minimist/package.json +75 -0
  1257. package/node_modules/minimist/test/all_bool.js +34 -0
  1258. package/node_modules/minimist/test/bool.js +177 -0
  1259. package/node_modules/minimist/test/dash.js +43 -0
  1260. package/node_modules/minimist/test/default_bool.js +37 -0
  1261. package/node_modules/minimist/test/dotted.js +24 -0
  1262. package/node_modules/minimist/test/kv_short.js +32 -0
  1263. package/node_modules/minimist/test/long.js +33 -0
  1264. package/node_modules/minimist/test/num.js +38 -0
  1265. package/node_modules/minimist/test/parse.js +209 -0
  1266. package/node_modules/minimist/test/parse_modified.js +11 -0
  1267. package/node_modules/minimist/test/proto.js +64 -0
  1268. package/node_modules/minimist/test/short.js +69 -0
  1269. package/node_modules/minimist/test/stop_early.js +17 -0
  1270. package/node_modules/minimist/test/unknown.js +104 -0
  1271. package/node_modules/minimist/test/whitespace.js +10 -0
  1272. package/node_modules/music-metadata/LICENSE.txt +9 -0
  1273. package/node_modules/music-metadata/README.md +878 -0
  1274. package/node_modules/music-metadata/lib/ParseError.d.ts +87 -0
  1275. package/node_modules/music-metadata/lib/ParseError.js +38 -0
  1276. package/node_modules/music-metadata/lib/ParserFactory.d.ts +44 -0
  1277. package/node_modules/music-metadata/lib/ParserFactory.js +141 -0
  1278. package/node_modules/music-metadata/lib/aiff/AiffLoader.d.ts +2 -0
  1279. package/node_modules/music-metadata/lib/aiff/AiffLoader.js +8 -0
  1280. package/node_modules/music-metadata/lib/aiff/AiffParser.d.ts +15 -0
  1281. package/node_modules/music-metadata/lib/aiff/AiffParser.js +104 -0
  1282. package/node_modules/music-metadata/lib/aiff/AiffTagMap.d.ts +4 -0
  1283. package/node_modules/music-metadata/lib/aiff/AiffTagMap.js +15 -0
  1284. package/node_modules/music-metadata/lib/aiff/AiffToken.d.ts +48 -0
  1285. package/node_modules/music-metadata/lib/aiff/AiffToken.js +58 -0
  1286. package/node_modules/music-metadata/lib/apev2/APEv2Parser.d.ts +46 -0
  1287. package/node_modules/music-metadata/lib/apev2/APEv2Parser.js +176 -0
  1288. package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.d.ts +4 -0
  1289. package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.js +83 -0
  1290. package/node_modules/music-metadata/lib/apev2/APEv2Token.d.ts +99 -0
  1291. package/node_modules/music-metadata/lib/apev2/APEv2Token.js +116 -0
  1292. package/node_modules/music-metadata/lib/apev2/Apev2Loader.d.ts +2 -0
  1293. package/node_modules/music-metadata/lib/apev2/Apev2Loader.js +8 -0
  1294. package/node_modules/music-metadata/lib/asf/AsfGuid.d.ts +83 -0
  1295. package/node_modules/music-metadata/lib/asf/AsfGuid.js +109 -0
  1296. package/node_modules/music-metadata/lib/asf/AsfLoader.d.ts +2 -0
  1297. package/node_modules/music-metadata/lib/asf/AsfLoader.js +8 -0
  1298. package/node_modules/music-metadata/lib/asf/AsfObject.d.ts +325 -0
  1299. package/node_modules/music-metadata/lib/asf/AsfObject.js +347 -0
  1300. package/node_modules/music-metadata/lib/asf/AsfParser.d.ts +17 -0
  1301. package/node_modules/music-metadata/lib/asf/AsfParser.js +134 -0
  1302. package/node_modules/music-metadata/lib/asf/AsfTagMapper.d.ts +7 -0
  1303. package/node_modules/music-metadata/lib/asf/AsfTagMapper.js +92 -0
  1304. package/node_modules/music-metadata/lib/asf/AsfUtil.d.ts +4 -0
  1305. package/node_modules/music-metadata/lib/asf/AsfUtil.js +32 -0
  1306. package/node_modules/music-metadata/lib/common/BasicParser.d.ts +17 -0
  1307. package/node_modules/music-metadata/lib/common/BasicParser.js +13 -0
  1308. package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.d.ts +10 -0
  1309. package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.js +17 -0
  1310. package/node_modules/music-metadata/lib/common/CombinedTagMapper.d.ts +19 -0
  1311. package/node_modules/music-metadata/lib/common/CombinedTagMapper.js +50 -0
  1312. package/node_modules/music-metadata/lib/common/FourCC.d.ts +6 -0
  1313. package/node_modules/music-metadata/lib/common/FourCC.js +25 -0
  1314. package/node_modules/music-metadata/lib/common/GenericTagMapper.d.ts +51 -0
  1315. package/node_modules/music-metadata/lib/common/GenericTagMapper.js +51 -0
  1316. package/node_modules/music-metadata/lib/common/GenericTagTypes.d.ts +34 -0
  1317. package/node_modules/music-metadata/lib/common/GenericTagTypes.js +133 -0
  1318. package/node_modules/music-metadata/lib/common/MetadataCollector.d.ts +86 -0
  1319. package/node_modules/music-metadata/lib/common/MetadataCollector.js +307 -0
  1320. package/node_modules/music-metadata/lib/common/Util.d.ts +56 -0
  1321. package/node_modules/music-metadata/lib/common/Util.js +152 -0
  1322. package/node_modules/music-metadata/lib/core.d.ts +75 -0
  1323. package/node_modules/music-metadata/lib/core.js +126 -0
  1324. package/node_modules/music-metadata/lib/dsdiff/DsdiffLoader.d.ts +2 -0
  1325. package/node_modules/music-metadata/lib/dsdiff/DsdiffLoader.js +8 -0
  1326. package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.d.ts +29 -0
  1327. package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js +154 -0
  1328. package/node_modules/music-metadata/lib/dsdiff/DsdiffToken.d.ts +9 -0
  1329. package/node_modules/music-metadata/lib/dsdiff/DsdiffToken.js +18 -0
  1330. package/node_modules/music-metadata/lib/dsf/DsfChunk.d.ts +87 -0
  1331. package/node_modules/music-metadata/lib/dsf/DsfChunk.js +50 -0
  1332. package/node_modules/music-metadata/lib/dsf/DsfLoader.d.ts +2 -0
  1333. package/node_modules/music-metadata/lib/dsf/DsfLoader.js +8 -0
  1334. package/node_modules/music-metadata/lib/dsf/DsfParser.d.ts +24 -0
  1335. package/node_modules/music-metadata/lib/dsf/DsfParser.js +57 -0
  1336. package/node_modules/music-metadata/lib/ebml/EbmlIterator.d.ts +67 -0
  1337. package/node_modules/music-metadata/lib/ebml/EbmlIterator.js +218 -0
  1338. package/node_modules/music-metadata/lib/ebml/types.d.ts +37 -0
  1339. package/node_modules/music-metadata/lib/ebml/types.js +8 -0
  1340. package/node_modules/music-metadata/lib/flac/FlacLoader.d.ts +2 -0
  1341. package/node_modules/music-metadata/lib/flac/FlacLoader.js +8 -0
  1342. package/node_modules/music-metadata/lib/flac/FlacParser.d.ts +29 -0
  1343. package/node_modules/music-metadata/lib/flac/FlacParser.js +125 -0
  1344. package/node_modules/music-metadata/lib/flac/FlacToken.d.ts +45 -0
  1345. package/node_modules/music-metadata/lib/flac/FlacToken.js +63 -0
  1346. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.d.ts +17 -0
  1347. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +137 -0
  1348. package/node_modules/music-metadata/lib/id3v1/ID3v1TagMap.d.ts +4 -0
  1349. package/node_modules/music-metadata/lib/id3v1/ID3v1TagMap.js +18 -0
  1350. package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.d.ts +17 -0
  1351. package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js +56 -0
  1352. package/node_modules/music-metadata/lib/id3v2/FrameHeader.d.ts +31 -0
  1353. package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +73 -0
  1354. package/node_modules/music-metadata/lib/id3v2/FrameParser.d.ts +92 -0
  1355. package/node_modules/music-metadata/lib/id3v2/FrameParser.js +470 -0
  1356. package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.d.ts +9 -0
  1357. package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.js +46 -0
  1358. package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.d.ts +14 -0
  1359. package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js +195 -0
  1360. package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.d.ts +11 -0
  1361. package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.js +17 -0
  1362. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.d.ts +33 -0
  1363. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.js +169 -0
  1364. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.d.ts +111 -0
  1365. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +146 -0
  1366. package/node_modules/music-metadata/lib/iff/index.d.ts +33 -0
  1367. package/node_modules/music-metadata/lib/iff/index.js +16 -0
  1368. package/node_modules/music-metadata/lib/index.d.ts +22 -0
  1369. package/node_modules/music-metadata/lib/index.js +53 -0
  1370. package/node_modules/music-metadata/lib/lrc/LyricsParser.d.ts +9 -0
  1371. package/node_modules/music-metadata/lib/lrc/LyricsParser.js +45 -0
  1372. package/node_modules/music-metadata/lib/lyrics3/Lyrics3.d.ts +3 -0
  1373. package/node_modules/music-metadata/lib/lyrics3/Lyrics3.js +17 -0
  1374. package/node_modules/music-metadata/lib/matroska/MatroskaDtd.d.ts +8 -0
  1375. package/node_modules/music-metadata/lib/matroska/MatroskaDtd.js +283 -0
  1376. package/node_modules/music-metadata/lib/matroska/MatroskaLoader.d.ts +2 -0
  1377. package/node_modules/music-metadata/lib/matroska/MatroskaLoader.js +8 -0
  1378. package/node_modules/music-metadata/lib/matroska/MatroskaParser.d.ts +19 -0
  1379. package/node_modules/music-metadata/lib/matroska/MatroskaParser.js +143 -0
  1380. package/node_modules/music-metadata/lib/matroska/MatroskaTagMapper.d.ts +4 -0
  1381. package/node_modules/music-metadata/lib/matroska/MatroskaTagMapper.js +32 -0
  1382. package/node_modules/music-metadata/lib/matroska/types.d.ts +142 -0
  1383. package/node_modules/music-metadata/lib/matroska/types.js +27 -0
  1384. package/node_modules/music-metadata/lib/mp4/Atom.d.ts +16 -0
  1385. package/node_modules/music-metadata/lib/mp4/Atom.js +65 -0
  1386. package/node_modules/music-metadata/lib/mp4/AtomToken.d.ts +487 -0
  1387. package/node_modules/music-metadata/lib/mp4/AtomToken.js +524 -0
  1388. package/node_modules/music-metadata/lib/mp4/MP4Parser.d.ts +32 -0
  1389. package/node_modules/music-metadata/lib/mp4/MP4Parser.js +647 -0
  1390. package/node_modules/music-metadata/lib/mp4/MP4TagMapper.d.ts +8 -0
  1391. package/node_modules/music-metadata/lib/mp4/MP4TagMapper.js +123 -0
  1392. package/node_modules/music-metadata/lib/mp4/Mp4Loader.d.ts +2 -0
  1393. package/node_modules/music-metadata/lib/mp4/Mp4Loader.js +8 -0
  1394. package/node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.d.ts +27 -0
  1395. package/node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.js +28 -0
  1396. package/node_modules/music-metadata/lib/mpeg/MpegLoader.d.ts +2 -0
  1397. package/node_modules/music-metadata/lib/mpeg/MpegLoader.js +8 -0
  1398. package/node_modules/music-metadata/lib/mpeg/MpegParser.d.ts +62 -0
  1399. package/node_modules/music-metadata/lib/mpeg/MpegParser.js +569 -0
  1400. package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.d.ts +57 -0
  1401. package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.js +64 -0
  1402. package/node_modules/music-metadata/lib/mpeg/XingTag.d.ts +44 -0
  1403. package/node_modules/music-metadata/lib/mpeg/XingTag.js +65 -0
  1404. package/node_modules/music-metadata/lib/musepack/MusepackConentError.d.ts +15 -0
  1405. package/node_modules/music-metadata/lib/musepack/MusepackConentError.js +3 -0
  1406. package/node_modules/music-metadata/lib/musepack/MusepackLoader.d.ts +2 -0
  1407. package/node_modules/music-metadata/lib/musepack/MusepackLoader.js +8 -0
  1408. package/node_modules/music-metadata/lib/musepack/MusepackParser.d.ts +4 -0
  1409. package/node_modules/music-metadata/lib/musepack/MusepackParser.js +30 -0
  1410. package/node_modules/music-metadata/lib/musepack/sv7/BitReader.d.ts +13 -0
  1411. package/node_modules/music-metadata/lib/musepack/sv7/BitReader.js +46 -0
  1412. package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.d.ts +8 -0
  1413. package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.js +47 -0
  1414. package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.d.ts +28 -0
  1415. package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.js +39 -0
  1416. package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.d.ts +6 -0
  1417. package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.js +56 -0
  1418. package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.d.ts +42 -0
  1419. package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js +82 -0
  1420. package/node_modules/music-metadata/lib/ogg/OggLoader.d.ts +2 -0
  1421. package/node_modules/music-metadata/lib/ogg/OggLoader.js +8 -0
  1422. package/node_modules/music-metadata/lib/ogg/OggParser.d.ts +27 -0
  1423. package/node_modules/music-metadata/lib/ogg/OggParser.js +125 -0
  1424. package/node_modules/music-metadata/lib/ogg/OggToken.d.ts +83 -0
  1425. package/node_modules/music-metadata/lib/ogg/OggToken.js +41 -0
  1426. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.d.ts +29 -0
  1427. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.js +74 -0
  1428. package/node_modules/music-metadata/lib/ogg/opus/Opus.d.ts +63 -0
  1429. package/node_modules/music-metadata/lib/ogg/opus/Opus.js +27 -0
  1430. package/node_modules/music-metadata/lib/ogg/opus/OpusStream.d.ts +24 -0
  1431. package/node_modules/music-metadata/lib/ogg/opus/OpusStream.js +56 -0
  1432. package/node_modules/music-metadata/lib/ogg/speex/Speex.d.ts +36 -0
  1433. package/node_modules/music-metadata/lib/ogg/speex/Speex.js +28 -0
  1434. package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.d.ts +20 -0
  1435. package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.js +31 -0
  1436. package/node_modules/music-metadata/lib/ogg/theora/Theora.d.ts +20 -0
  1437. package/node_modules/music-metadata/lib/ogg/theora/Theora.js +20 -0
  1438. package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.d.ts +25 -0
  1439. package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.js +39 -0
  1440. package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.d.ts +68 -0
  1441. package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.js +83 -0
  1442. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.d.ts +12 -0
  1443. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js +29 -0
  1444. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.d.ts +53 -0
  1445. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.js +136 -0
  1446. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.d.ts +7 -0
  1447. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.js +133 -0
  1448. package/node_modules/music-metadata/lib/riff/RiffChunk.d.ts +16 -0
  1449. package/node_modules/music-metadata/lib/riff/RiffChunk.js +28 -0
  1450. package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.d.ts +10 -0
  1451. package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.js +34 -0
  1452. package/node_modules/music-metadata/lib/type.d.ts +661 -0
  1453. package/node_modules/music-metadata/lib/type.js +2 -0
  1454. package/node_modules/music-metadata/lib/wav/BwfChunk.d.ts +17 -0
  1455. package/node_modules/music-metadata/lib/wav/BwfChunk.js +26 -0
  1456. package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +94 -0
  1457. package/node_modules/music-metadata/lib/wav/WaveChunk.js +78 -0
  1458. package/node_modules/music-metadata/lib/wav/WaveLoader.d.ts +2 -0
  1459. package/node_modules/music-metadata/lib/wav/WaveLoader.js +8 -0
  1460. package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +24 -0
  1461. package/node_modules/music-metadata/lib/wav/WaveParser.js +170 -0
  1462. package/node_modules/music-metadata/lib/wavpack/WavPackLoader.d.ts +2 -0
  1463. package/node_modules/music-metadata/lib/wavpack/WavPackLoader.js +8 -0
  1464. package/node_modules/music-metadata/lib/wavpack/WavPackParser.d.ts +30 -0
  1465. package/node_modules/music-metadata/lib/wavpack/WavPackParser.js +109 -0
  1466. package/node_modules/music-metadata/lib/wavpack/WavPackToken.d.ts +60 -0
  1467. package/node_modules/music-metadata/lib/wavpack/WavPackToken.js +70 -0
  1468. package/node_modules/music-metadata/node_modules/file-type/core.d.ts +253 -0
  1469. package/node_modules/music-metadata/node_modules/file-type/core.js +2899 -0
  1470. package/node_modules/music-metadata/node_modules/file-type/index.d.ts +98 -0
  1471. package/node_modules/music-metadata/node_modules/file-type/index.js +163 -0
  1472. package/node_modules/music-metadata/node_modules/file-type/license +9 -0
  1473. package/node_modules/music-metadata/node_modules/file-type/package.json +290 -0
  1474. package/node_modules/music-metadata/node_modules/file-type/readme.md +667 -0
  1475. package/node_modules/music-metadata/node_modules/file-type/supported.js +360 -0
  1476. package/node_modules/music-metadata/node_modules/file-type/util.js +60 -0
  1477. package/node_modules/music-metadata/node_modules/strtok3/LICENSE.txt +21 -0
  1478. package/node_modules/music-metadata/node_modules/strtok3/README.md +399 -0
  1479. package/node_modules/music-metadata/node_modules/strtok3/lib/AbstractTokenizer.d.ts +76 -0
  1480. package/node_modules/music-metadata/node_modules/strtok3/lib/AbstractTokenizer.js +111 -0
  1481. package/node_modules/music-metadata/node_modules/strtok3/lib/BlobTokenizer.d.ts +29 -0
  1482. package/node_modules/music-metadata/node_modules/strtok3/lib/BlobTokenizer.js +53 -0
  1483. package/node_modules/music-metadata/node_modules/strtok3/lib/BufferTokenizer.d.ts +29 -0
  1484. package/node_modules/music-metadata/node_modules/strtok3/lib/BufferTokenizer.js +52 -0
  1485. package/node_modules/music-metadata/node_modules/strtok3/lib/FileTokenizer.d.ts +37 -0
  1486. package/node_modules/music-metadata/node_modules/strtok3/lib/FileTokenizer.js +61 -0
  1487. package/node_modules/music-metadata/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +34 -0
  1488. package/node_modules/music-metadata/node_modules/strtok3/lib/ReadStreamTokenizer.js +107 -0
  1489. package/node_modules/music-metadata/node_modules/strtok3/lib/core.d.ts +40 -0
  1490. package/node_modules/music-metadata/node_modules/strtok3/lib/core.js +62 -0
  1491. package/node_modules/music-metadata/node_modules/strtok3/lib/index.d.ts +16 -0
  1492. package/node_modules/music-metadata/node_modules/strtok3/lib/index.js +22 -0
  1493. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/AbstractStreamReader.d.ts +54 -0
  1494. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/AbstractStreamReader.js +71 -0
  1495. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Deferred.d.ts +6 -0
  1496. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Deferred.js +10 -0
  1497. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Errors.d.ts +10 -0
  1498. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Errors.js +16 -0
  1499. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/StreamReader.d.ts +29 -0
  1500. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/StreamReader.js +83 -0
  1501. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamByobReader.d.ts +14 -0
  1502. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamByobReader.js +27 -0
  1503. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamDefaultReader.d.ts +19 -0
  1504. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamDefaultReader.js +62 -0
  1505. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +14 -0
  1506. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReader.js +13 -0
  1507. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReaderFactory.d.ts +5 -0
  1508. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReaderFactory.js +19 -0
  1509. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/index.d.ts +6 -0
  1510. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/index.js +5 -0
  1511. package/node_modules/music-metadata/node_modules/strtok3/lib/types.d.ts +139 -0
  1512. package/node_modules/music-metadata/node_modules/strtok3/lib/types.js +1 -0
  1513. package/node_modules/music-metadata/node_modules/strtok3/package.json +94 -0
  1514. package/node_modules/music-metadata/node_modules/token-types/LICENSE.txt +9 -0
  1515. package/node_modules/music-metadata/node_modules/token-types/README.md +120 -0
  1516. package/node_modules/music-metadata/node_modules/token-types/lib/index.d.ts +135 -0
  1517. package/node_modules/music-metadata/node_modules/token-types/lib/index.js +401 -0
  1518. package/node_modules/music-metadata/node_modules/token-types/package.json +81 -0
  1519. package/node_modules/music-metadata/package.json +156 -0
  1520. package/node_modules/nth-check/LICENSE +11 -0
  1521. package/node_modules/nth-check/README.md +136 -0
  1522. package/node_modules/nth-check/lib/compile.d.ts +55 -0
  1523. package/node_modules/nth-check/lib/compile.d.ts.map +1 -0
  1524. package/node_modules/nth-check/lib/compile.js +121 -0
  1525. package/node_modules/nth-check/lib/compile.js.map +1 -0
  1526. package/node_modules/nth-check/lib/esm/compile.d.ts +55 -0
  1527. package/node_modules/nth-check/lib/esm/compile.d.ts.map +1 -0
  1528. package/node_modules/nth-check/lib/esm/compile.js +113 -0
  1529. package/node_modules/nth-check/lib/esm/compile.js.map +1 -0
  1530. package/node_modules/nth-check/lib/esm/index.d.ts +59 -0
  1531. package/node_modules/nth-check/lib/esm/index.d.ts.map +1 -0
  1532. package/node_modules/nth-check/lib/esm/index.js +63 -0
  1533. package/node_modules/nth-check/lib/esm/index.js.map +1 -0
  1534. package/node_modules/nth-check/lib/esm/package.json +1 -0
  1535. package/node_modules/nth-check/lib/esm/parse.d.ts +9 -0
  1536. package/node_modules/nth-check/lib/esm/parse.d.ts.map +1 -0
  1537. package/node_modules/nth-check/lib/esm/parse.js +73 -0
  1538. package/node_modules/nth-check/lib/esm/parse.js.map +1 -0
  1539. package/node_modules/nth-check/lib/index.d.ts +59 -0
  1540. package/node_modules/nth-check/lib/index.d.ts.map +1 -0
  1541. package/node_modules/nth-check/lib/index.js +70 -0
  1542. package/node_modules/nth-check/lib/index.js.map +1 -0
  1543. package/node_modules/nth-check/lib/parse.d.ts +9 -0
  1544. package/node_modules/nth-check/lib/parse.d.ts.map +1 -0
  1545. package/node_modules/nth-check/lib/parse.js +77 -0
  1546. package/node_modules/nth-check/lib/parse.js.map +1 -0
  1547. package/node_modules/nth-check/package.json +78 -0
  1548. package/node_modules/papaparse/.eslintrc.js +280 -0
  1549. package/node_modules/papaparse/.github/workflows/node.js.yml +29 -0
  1550. package/node_modules/papaparse/Gruntfile.js +27 -0
  1551. package/node_modules/papaparse/LICENSE +20 -0
  1552. package/node_modules/papaparse/README.md +77 -0
  1553. package/node_modules/papaparse/bower.json +40 -0
  1554. package/node_modules/papaparse/package.json +58 -0
  1555. package/node_modules/papaparse/papaparse.js +1945 -0
  1556. package/node_modules/papaparse/papaparse.min.js +7 -0
  1557. package/node_modules/papaparse/player/player.css +1045 -0
  1558. package/node_modules/papaparse/player/player.html +79 -0
  1559. package/node_modules/papaparse/player/player.js +181 -0
  1560. package/node_modules/papaparse/tests/.eslintrc.js +12 -0
  1561. package/node_modules/papaparse/tests/long-sample.csv +8 -0
  1562. package/node_modules/papaparse/tests/node-tests.js +302 -0
  1563. package/node_modules/papaparse/tests/sample-header.csv +3 -0
  1564. package/node_modules/papaparse/tests/sample.csv +2 -0
  1565. package/node_modules/papaparse/tests/test-cases.js +2840 -0
  1566. package/node_modules/papaparse/tests/test.js +20 -0
  1567. package/node_modules/papaparse/tests/tests.html +22 -0
  1568. package/node_modules/papaparse/tests/utf-8-bom-sample.csv +2 -0
  1569. package/node_modules/papaparse/tests/verylong-sample.csv +2001 -0
  1570. package/node_modules/parse5/LICENSE +19 -0
  1571. package/node_modules/parse5/README.md +38 -0
  1572. package/node_modules/parse5/dist/cjs/common/doctype.d.ts +4 -0
  1573. package/node_modules/parse5/dist/cjs/common/doctype.js +118 -0
  1574. package/node_modules/parse5/dist/cjs/common/error-codes.d.ts +67 -0
  1575. package/node_modules/parse5/dist/cjs/common/error-codes.js +66 -0
  1576. package/node_modules/parse5/dist/cjs/common/foreign-content.d.ts +9 -0
  1577. package/node_modules/parse5/dist/cjs/common/foreign-content.js +237 -0
  1578. package/node_modules/parse5/dist/cjs/common/html.d.ts +289 -0
  1579. package/node_modules/parse5/dist/cjs/common/html.js +528 -0
  1580. package/node_modules/parse5/dist/cjs/common/token.d.ts +84 -0
  1581. package/node_modules/parse5/dist/cjs/common/token.js +24 -0
  1582. package/node_modules/parse5/dist/cjs/common/unicode.d.ts +42 -0
  1583. package/node_modules/parse5/dist/cjs/common/unicode.js +70 -0
  1584. package/node_modules/parse5/dist/cjs/index.d.ts +71 -0
  1585. package/node_modules/parse5/dist/cjs/index.js +54 -0
  1586. package/node_modules/parse5/dist/cjs/package.json +1 -0
  1587. package/node_modules/parse5/dist/cjs/parser/formatting-element-list.d.ts +36 -0
  1588. package/node_modules/parse5/dist/cjs/parser/formatting-element-list.js +114 -0
  1589. package/node_modules/parse5/dist/cjs/parser/index.d.ts +221 -0
  1590. package/node_modules/parse5/dist/cjs/parser/index.js +3240 -0
  1591. package/node_modules/parse5/dist/cjs/parser/open-element-stack.d.ts +53 -0
  1592. package/node_modules/parse5/dist/cjs/parser/open-element-stack.js +328 -0
  1593. package/node_modules/parse5/dist/cjs/serializer/index.d.ts +60 -0
  1594. package/node_modules/parse5/dist/cjs/serializer/index.js +172 -0
  1595. package/node_modules/parse5/dist/cjs/tokenizer/index.d.ts +247 -0
  1596. package/node_modules/parse5/dist/cjs/tokenizer/index.js +2714 -0
  1597. package/node_modules/parse5/dist/cjs/tokenizer/preprocessor.d.ts +36 -0
  1598. package/node_modules/parse5/dist/cjs/tokenizer/preprocessor.js +200 -0
  1599. package/node_modules/parse5/dist/cjs/tree-adapters/default.d.ts +84 -0
  1600. package/node_modules/parse5/dist/cjs/tree-adapters/default.js +176 -0
  1601. package/node_modules/parse5/dist/cjs/tree-adapters/interface.d.ts +255 -0
  1602. package/node_modules/parse5/dist/cjs/tree-adapters/interface.js +2 -0
  1603. package/node_modules/parse5/dist/common/doctype.d.ts +4 -0
  1604. package/node_modules/parse5/dist/common/doctype.js +114 -0
  1605. package/node_modules/parse5/dist/common/error-codes.d.ts +67 -0
  1606. package/node_modules/parse5/dist/common/error-codes.js +63 -0
  1607. package/node_modules/parse5/dist/common/foreign-content.d.ts +9 -0
  1608. package/node_modules/parse5/dist/common/foreign-content.js +228 -0
  1609. package/node_modules/parse5/dist/common/html.d.ts +289 -0
  1610. package/node_modules/parse5/dist/common/html.js +523 -0
  1611. package/node_modules/parse5/dist/common/token.d.ts +84 -0
  1612. package/node_modules/parse5/dist/common/token.js +20 -0
  1613. package/node_modules/parse5/dist/common/unicode.d.ts +42 -0
  1614. package/node_modules/parse5/dist/common/unicode.js +62 -0
  1615. package/node_modules/parse5/dist/index.d.ts +71 -0
  1616. package/node_modules/parse5/dist/index.js +42 -0
  1617. package/node_modules/parse5/dist/parser/formatting-element-list.d.ts +36 -0
  1618. package/node_modules/parse5/dist/parser/formatting-element-list.js +110 -0
  1619. package/node_modules/parse5/dist/parser/index.d.ts +221 -0
  1620. package/node_modules/parse5/dist/parser/index.js +3245 -0
  1621. package/node_modules/parse5/dist/parser/open-element-stack.d.ts +53 -0
  1622. package/node_modules/parse5/dist/parser/open-element-stack.js +324 -0
  1623. package/node_modules/parse5/dist/serializer/index.d.ts +60 -0
  1624. package/node_modules/parse5/dist/serializer/index.js +168 -0
  1625. package/node_modules/parse5/dist/tokenizer/index.d.ts +247 -0
  1626. package/node_modules/parse5/dist/tokenizer/index.js +2710 -0
  1627. package/node_modules/parse5/dist/tokenizer/preprocessor.d.ts +36 -0
  1628. package/node_modules/parse5/dist/tokenizer/preprocessor.js +196 -0
  1629. package/node_modules/parse5/dist/tree-adapters/default.d.ts +84 -0
  1630. package/node_modules/parse5/dist/tree-adapters/default.js +173 -0
  1631. package/node_modules/parse5/dist/tree-adapters/interface.d.ts +255 -0
  1632. package/node_modules/parse5/dist/tree-adapters/interface.js +1 -0
  1633. package/node_modules/parse5/node_modules/entities/LICENSE +11 -0
  1634. package/node_modules/parse5/node_modules/entities/decode.d.ts +1 -0
  1635. package/node_modules/parse5/node_modules/entities/decode.js +3 -0
  1636. package/node_modules/parse5/node_modules/entities/dist/commonjs/decode-codepoint.d.ts +19 -0
  1637. package/node_modules/parse5/node_modules/entities/dist/commonjs/decode-codepoint.d.ts.map +1 -0
  1638. package/node_modules/parse5/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
  1639. package/node_modules/parse5/node_modules/entities/dist/commonjs/decode-codepoint.js.map +1 -0
  1640. package/node_modules/parse5/node_modules/entities/dist/commonjs/decode.d.ts +209 -0
  1641. package/node_modules/parse5/node_modules/entities/dist/commonjs/decode.d.ts.map +1 -0
  1642. package/node_modules/parse5/node_modules/entities/dist/commonjs/decode.js +511 -0
  1643. package/node_modules/parse5/node_modules/entities/dist/commonjs/decode.js.map +1 -0
  1644. package/node_modules/parse5/node_modules/entities/dist/commonjs/encode.d.ts +22 -0
  1645. package/node_modules/parse5/node_modules/entities/dist/commonjs/encode.d.ts.map +1 -0
  1646. package/node_modules/parse5/node_modules/entities/dist/commonjs/encode.js +73 -0
  1647. package/node_modules/parse5/node_modules/entities/dist/commonjs/encode.js.map +1 -0
  1648. package/node_modules/parse5/node_modules/entities/dist/commonjs/escape.d.ts +43 -0
  1649. package/node_modules/parse5/node_modules/entities/dist/commonjs/escape.d.ts.map +1 -0
  1650. package/node_modules/parse5/node_modules/entities/dist/commonjs/escape.js +121 -0
  1651. package/node_modules/parse5/node_modules/entities/dist/commonjs/escape.js.map +1 -0
  1652. package/node_modules/parse5/node_modules/entities/dist/commonjs/generated/decode-data-html.d.ts +2 -0
  1653. package/node_modules/parse5/node_modules/entities/dist/commonjs/generated/decode-data-html.d.ts.map +1 -0
  1654. package/node_modules/parse5/node_modules/entities/dist/commonjs/generated/decode-data-html.js +10 -0
  1655. package/node_modules/parse5/node_modules/entities/dist/commonjs/generated/decode-data-html.js.map +1 -0
  1656. package/node_modules/parse5/node_modules/entities/dist/commonjs/generated/decode-data-xml.d.ts +2 -0
  1657. package/node_modules/parse5/node_modules/entities/dist/commonjs/generated/decode-data-xml.d.ts.map +1 -0
  1658. package/node_modules/parse5/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +10 -0
  1659. package/node_modules/parse5/node_modules/entities/dist/commonjs/generated/decode-data-xml.js.map +1 -0
  1660. package/node_modules/parse5/node_modules/entities/dist/commonjs/generated/encode-html.d.ts +8 -0
  1661. package/node_modules/parse5/node_modules/entities/dist/commonjs/generated/encode-html.d.ts.map +1 -0
  1662. package/node_modules/parse5/node_modules/entities/dist/commonjs/generated/encode-html.js +13 -0
  1663. package/node_modules/parse5/node_modules/entities/dist/commonjs/generated/encode-html.js.map +1 -0
  1664. package/node_modules/parse5/node_modules/entities/dist/commonjs/index.d.ts +96 -0
  1665. package/node_modules/parse5/node_modules/entities/dist/commonjs/index.d.ts.map +1 -0
  1666. package/node_modules/parse5/node_modules/entities/dist/commonjs/index.js +131 -0
  1667. package/node_modules/parse5/node_modules/entities/dist/commonjs/index.js.map +1 -0
  1668. package/node_modules/parse5/node_modules/entities/dist/commonjs/package.json +3 -0
  1669. package/node_modules/parse5/node_modules/entities/dist/esm/decode-codepoint.d.ts +19 -0
  1670. package/node_modules/parse5/node_modules/entities/dist/esm/decode-codepoint.d.ts.map +1 -0
  1671. package/node_modules/parse5/node_modules/entities/dist/esm/decode-codepoint.js +72 -0
  1672. package/node_modules/parse5/node_modules/entities/dist/esm/decode-codepoint.js.map +1 -0
  1673. package/node_modules/parse5/node_modules/entities/dist/esm/decode.d.ts +209 -0
  1674. package/node_modules/parse5/node_modules/entities/dist/esm/decode.d.ts.map +1 -0
  1675. package/node_modules/parse5/node_modules/entities/dist/esm/decode.js +497 -0
  1676. package/node_modules/parse5/node_modules/entities/dist/esm/decode.js.map +1 -0
  1677. package/node_modules/parse5/node_modules/entities/dist/esm/encode.d.ts +22 -0
  1678. package/node_modules/parse5/node_modules/entities/dist/esm/encode.d.ts.map +1 -0
  1679. package/node_modules/parse5/node_modules/entities/dist/esm/encode.js +69 -0
  1680. package/node_modules/parse5/node_modules/entities/dist/esm/encode.js.map +1 -0
  1681. package/node_modules/parse5/node_modules/entities/dist/esm/escape.d.ts +43 -0
  1682. package/node_modules/parse5/node_modules/entities/dist/esm/escape.d.ts.map +1 -0
  1683. package/node_modules/parse5/node_modules/entities/dist/esm/escape.js +117 -0
  1684. package/node_modules/parse5/node_modules/entities/dist/esm/escape.js.map +1 -0
  1685. package/node_modules/parse5/node_modules/entities/dist/esm/generated/decode-data-html.d.ts +2 -0
  1686. package/node_modules/parse5/node_modules/entities/dist/esm/generated/decode-data-html.d.ts.map +1 -0
  1687. package/node_modules/parse5/node_modules/entities/dist/esm/generated/decode-data-html.js +7 -0
  1688. package/node_modules/parse5/node_modules/entities/dist/esm/generated/decode-data-html.js.map +1 -0
  1689. package/node_modules/parse5/node_modules/entities/dist/esm/generated/decode-data-xml.d.ts +2 -0
  1690. package/node_modules/parse5/node_modules/entities/dist/esm/generated/decode-data-xml.d.ts.map +1 -0
  1691. package/node_modules/parse5/node_modules/entities/dist/esm/generated/decode-data-xml.js +7 -0
  1692. package/node_modules/parse5/node_modules/entities/dist/esm/generated/decode-data-xml.js.map +1 -0
  1693. package/node_modules/parse5/node_modules/entities/dist/esm/generated/encode-html.d.ts +8 -0
  1694. package/node_modules/parse5/node_modules/entities/dist/esm/generated/encode-html.d.ts.map +1 -0
  1695. package/node_modules/parse5/node_modules/entities/dist/esm/generated/encode-html.js +10 -0
  1696. package/node_modules/parse5/node_modules/entities/dist/esm/generated/encode-html.js.map +1 -0
  1697. package/node_modules/parse5/node_modules/entities/dist/esm/index.d.ts +96 -0
  1698. package/node_modules/parse5/node_modules/entities/dist/esm/index.d.ts.map +1 -0
  1699. package/node_modules/parse5/node_modules/entities/dist/esm/index.js +107 -0
  1700. package/node_modules/parse5/node_modules/entities/dist/esm/index.js.map +1 -0
  1701. package/node_modules/parse5/node_modules/entities/dist/esm/package.json +3 -0
  1702. package/node_modules/parse5/node_modules/entities/escape.d.ts +1 -0
  1703. package/node_modules/parse5/node_modules/entities/escape.js +3 -0
  1704. package/node_modules/parse5/node_modules/entities/package.json +118 -0
  1705. package/node_modules/parse5/node_modules/entities/readme.md +122 -0
  1706. package/node_modules/parse5/node_modules/entities/src/decode-codepoint.ts +81 -0
  1707. package/node_modules/parse5/node_modules/entities/src/decode.spec.ts +320 -0
  1708. package/node_modules/parse5/node_modules/entities/src/decode.ts +620 -0
  1709. package/node_modules/parse5/node_modules/entities/src/encode.spec.ts +78 -0
  1710. package/node_modules/parse5/node_modules/entities/src/encode.ts +77 -0
  1711. package/node_modules/parse5/node_modules/entities/src/escape.spec.ts +14 -0
  1712. package/node_modules/parse5/node_modules/entities/src/escape.ts +148 -0
  1713. package/node_modules/parse5/node_modules/entities/src/generated/.eslintrc.json +10 -0
  1714. package/node_modules/parse5/node_modules/entities/src/generated/decode-data-html.ts +8 -0
  1715. package/node_modules/parse5/node_modules/entities/src/generated/decode-data-xml.ts +8 -0
  1716. package/node_modules/parse5/node_modules/entities/src/generated/encode-html.ts +17 -0
  1717. package/node_modules/parse5/node_modules/entities/src/index.spec.ts +125 -0
  1718. package/node_modules/parse5/node_modules/entities/src/index.ts +188 -0
  1719. package/node_modules/parse5/package.json +50 -0
  1720. package/node_modules/parse5-htmlparser2-tree-adapter/LICENSE +19 -0
  1721. package/node_modules/parse5-htmlparser2-tree-adapter/README.md +34 -0
  1722. package/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.d.ts +6 -0
  1723. package/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.js +214 -0
  1724. package/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/package.json +1 -0
  1725. package/node_modules/parse5-htmlparser2-tree-adapter/dist/index.d.ts +6 -0
  1726. package/node_modules/parse5-htmlparser2-tree-adapter/dist/index.js +213 -0
  1727. package/node_modules/parse5-htmlparser2-tree-adapter/package.json +40 -0
  1728. package/node_modules/parse5-parser-stream/LICENSE +19 -0
  1729. package/node_modules/parse5-parser-stream/README.md +34 -0
  1730. package/node_modules/parse5-parser-stream/dist/cjs/index.d.ts +85 -0
  1731. package/node_modules/parse5-parser-stream/dist/cjs/index.js +90 -0
  1732. package/node_modules/parse5-parser-stream/dist/cjs/package.json +1 -0
  1733. package/node_modules/parse5-parser-stream/dist/index.d.ts +85 -0
  1734. package/node_modules/parse5-parser-stream/dist/index.js +86 -0
  1735. package/node_modules/parse5-parser-stream/package.json +39 -0
  1736. package/node_modules/peek-readable/LICENSE +21 -0
  1737. package/node_modules/peek-readable/README.md +93 -0
  1738. package/node_modules/peek-readable/lib/Deferred.d.ts +6 -0
  1739. package/node_modules/peek-readable/lib/Deferred.js +14 -0
  1740. package/node_modules/peek-readable/lib/EndOfFileStream.d.ts +7 -0
  1741. package/node_modules/peek-readable/lib/EndOfFileStream.js +13 -0
  1742. package/node_modules/peek-readable/lib/StreamReader.d.ts +47 -0
  1743. package/node_modules/peek-readable/lib/StreamReader.js +134 -0
  1744. package/node_modules/peek-readable/lib/index.d.ts +2 -0
  1745. package/node_modules/peek-readable/lib/index.js +7 -0
  1746. package/node_modules/peek-readable/package.json +87 -0
  1747. package/node_modules/readable-web-to-node-stream/README.md +70 -0
  1748. package/node_modules/readable-web-to-node-stream/lib/index.d.ts +39 -0
  1749. package/node_modules/readable-web-to-node-stream/lib/index.js +73 -0
  1750. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/LICENSE +47 -0
  1751. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/README.md +116 -0
  1752. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/_stream_duplex.js +4 -0
  1753. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/_stream_passthrough.js +4 -0
  1754. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/_stream_readable.js +4 -0
  1755. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/_stream_transform.js +4 -0
  1756. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/_stream_writable.js +4 -0
  1757. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js +52 -0
  1758. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js +157 -0
  1759. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/compose.js +194 -0
  1760. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/destroy.js +290 -0
  1761. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/duplex.js +143 -0
  1762. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/duplexify.js +378 -0
  1763. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +286 -0
  1764. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/from.js +98 -0
  1765. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/lazy_transform.js +51 -0
  1766. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/legacy.js +89 -0
  1767. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/operators.js +457 -0
  1768. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/passthrough.js +39 -0
  1769. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js +471 -0
  1770. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/readable.js +1290 -0
  1771. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/state.js +39 -0
  1772. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/transform.js +180 -0
  1773. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/utils.js +327 -0
  1774. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/streams/writable.js +819 -0
  1775. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/internal/validators.js +530 -0
  1776. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/ours/browser.js +35 -0
  1777. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/ours/errors.js +343 -0
  1778. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/ours/index.js +65 -0
  1779. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/ours/primordials.js +124 -0
  1780. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/ours/util/inspect.js +55 -0
  1781. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/ours/util.js +148 -0
  1782. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/stream/promises.js +43 -0
  1783. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/stream.js +143 -0
  1784. package/node_modules/readable-web-to-node-stream/node_modules/readable-stream/package.json +88 -0
  1785. package/node_modules/readable-web-to-node-stream/node_modules/safe-buffer/LICENSE +21 -0
  1786. package/node_modules/readable-web-to-node-stream/node_modules/safe-buffer/README.md +584 -0
  1787. package/node_modules/readable-web-to-node-stream/node_modules/safe-buffer/index.d.ts +187 -0
  1788. package/node_modules/readable-web-to-node-stream/node_modules/safe-buffer/index.js +65 -0
  1789. package/node_modules/readable-web-to-node-stream/node_modules/safe-buffer/package.json +51 -0
  1790. package/node_modules/readable-web-to-node-stream/node_modules/string_decoder/LICENSE +48 -0
  1791. package/node_modules/readable-web-to-node-stream/node_modules/string_decoder/README.md +47 -0
  1792. package/node_modules/readable-web-to-node-stream/node_modules/string_decoder/lib/string_decoder.js +296 -0
  1793. package/node_modules/readable-web-to-node-stream/node_modules/string_decoder/package.json +34 -0
  1794. package/node_modules/readable-web-to-node-stream/package.json +84 -0
  1795. package/node_modules/sax/LICENSE.md +55 -0
  1796. package/node_modules/sax/README.md +227 -0
  1797. package/node_modules/sax/lib/sax.js +1848 -0
  1798. package/node_modules/sax/package.json +34 -0
  1799. package/node_modules/ssf/LICENSE +201 -0
  1800. package/node_modules/ssf/README.md +119 -0
  1801. package/node_modules/ssf/package.json +57 -0
  1802. package/node_modules/ssf/ssf.flow.js +980 -0
  1803. package/node_modules/ssf/ssf.js +966 -0
  1804. package/node_modules/ssf/types/index.d.ts +56 -0
  1805. package/node_modules/ssf/types/tsconfig.json +15 -0
  1806. package/node_modules/strtok3/LICENSE +15 -0
  1807. package/node_modules/strtok3/README.md +304 -0
  1808. package/node_modules/strtok3/lib/AbstractTokenizer.d.ts +69 -0
  1809. package/node_modules/strtok3/lib/AbstractTokenizer.js +104 -0
  1810. package/node_modules/strtok3/lib/BufferTokenizer.d.ts +26 -0
  1811. package/node_modules/strtok3/lib/BufferTokenizer.js +55 -0
  1812. package/node_modules/strtok3/lib/FileTokenizer.d.ts +22 -0
  1813. package/node_modules/strtok3/lib/FileTokenizer.js +55 -0
  1814. package/node_modules/strtok3/lib/FsPromise.d.ts +18 -0
  1815. package/node_modules/strtok3/lib/FsPromise.js +79 -0
  1816. package/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +28 -0
  1817. package/node_modules/strtok3/lib/ReadStreamTokenizer.js +98 -0
  1818. package/node_modules/strtok3/lib/core.d.ts +23 -0
  1819. package/node_modules/strtok3/lib/core.js +29 -0
  1820. package/node_modules/strtok3/lib/index.d.ts +15 -0
  1821. package/node_modules/strtok3/lib/index.js +27 -0
  1822. package/node_modules/strtok3/lib/types.d.ts +103 -0
  1823. package/node_modules/strtok3/lib/types.js +2 -0
  1824. package/node_modules/strtok3/package.json +103 -0
  1825. package/node_modules/token-types/LICENSE +7 -0
  1826. package/node_modules/token-types/README.md +115 -0
  1827. package/node_modules/token-types/lib/index.d.ts +150 -0
  1828. package/node_modules/token-types/lib/index.js +455 -0
  1829. package/node_modules/token-types/package.json +93 -0
  1830. package/node_modules/undici/LICENSE +21 -0
  1831. package/node_modules/undici/README.md +741 -0
  1832. package/node_modules/undici/docs/docs/api/Agent.md +84 -0
  1833. package/node_modules/undici/docs/docs/api/BalancedPool.md +99 -0
  1834. package/node_modules/undici/docs/docs/api/CacheStorage.md +30 -0
  1835. package/node_modules/undici/docs/docs/api/CacheStore.md +164 -0
  1836. package/node_modules/undici/docs/docs/api/Client.md +285 -0
  1837. package/node_modules/undici/docs/docs/api/ClientStats.md +27 -0
  1838. package/node_modules/undici/docs/docs/api/Connector.md +115 -0
  1839. package/node_modules/undici/docs/docs/api/ContentType.md +57 -0
  1840. package/node_modules/undici/docs/docs/api/Cookies.md +101 -0
  1841. package/node_modules/undici/docs/docs/api/Debug.md +62 -0
  1842. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +315 -0
  1843. package/node_modules/undici/docs/docs/api/Dispatcher.md +1392 -0
  1844. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +159 -0
  1845. package/node_modules/undici/docs/docs/api/Errors.md +49 -0
  1846. package/node_modules/undici/docs/docs/api/EventSource.md +45 -0
  1847. package/node_modules/undici/docs/docs/api/Fetch.md +60 -0
  1848. package/node_modules/undici/docs/docs/api/GlobalInstallation.md +139 -0
  1849. package/node_modules/undici/docs/docs/api/H2CClient.md +263 -0
  1850. package/node_modules/undici/docs/docs/api/MockAgent.md +603 -0
  1851. package/node_modules/undici/docs/docs/api/MockCallHistory.md +197 -0
  1852. package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +43 -0
  1853. package/node_modules/undici/docs/docs/api/MockClient.md +81 -0
  1854. package/node_modules/undici/docs/docs/api/MockErrors.md +12 -0
  1855. package/node_modules/undici/docs/docs/api/MockPool.md +555 -0
  1856. package/node_modules/undici/docs/docs/api/Pool.md +84 -0
  1857. package/node_modules/undici/docs/docs/api/PoolStats.md +35 -0
  1858. package/node_modules/undici/docs/docs/api/ProxyAgent.md +229 -0
  1859. package/node_modules/undici/docs/docs/api/RedirectHandler.md +93 -0
  1860. package/node_modules/undici/docs/docs/api/RetryAgent.md +50 -0
  1861. package/node_modules/undici/docs/docs/api/RetryHandler.md +118 -0
  1862. package/node_modules/undici/docs/docs/api/RoundRobinPool.md +145 -0
  1863. package/node_modules/undici/docs/docs/api/SnapshotAgent.md +616 -0
  1864. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +274 -0
  1865. package/node_modules/undici/docs/docs/api/Util.md +25 -0
  1866. package/node_modules/undici/docs/docs/api/WebSocket.md +141 -0
  1867. package/node_modules/undici/docs/docs/api/api-lifecycle.md +91 -0
  1868. package/node_modules/undici/docs/docs/best-practices/client-certificate.md +64 -0
  1869. package/node_modules/undici/docs/docs/best-practices/crawling.md +58 -0
  1870. package/node_modules/undici/docs/docs/best-practices/mocking-request.md +190 -0
  1871. package/node_modules/undici/docs/docs/best-practices/proxy.md +127 -0
  1872. package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +224 -0
  1873. package/node_modules/undici/docs/docs/best-practices/writing-tests.md +63 -0
  1874. package/node_modules/undici/index-fetch.js +65 -0
  1875. package/node_modules/undici/index.d.ts +3 -0
  1876. package/node_modules/undici/index.js +234 -0
  1877. package/node_modules/undici/lib/api/abort-signal.js +59 -0
  1878. package/node_modules/undici/lib/api/api-connect.js +110 -0
  1879. package/node_modules/undici/lib/api/api-pipeline.js +252 -0
  1880. package/node_modules/undici/lib/api/api-request.js +214 -0
  1881. package/node_modules/undici/lib/api/api-stream.js +209 -0
  1882. package/node_modules/undici/lib/api/api-upgrade.js +111 -0
  1883. package/node_modules/undici/lib/api/index.js +7 -0
  1884. package/node_modules/undici/lib/api/readable.js +580 -0
  1885. package/node_modules/undici/lib/cache/memory-cache-store.js +234 -0
  1886. package/node_modules/undici/lib/cache/sqlite-cache-store.js +461 -0
  1887. package/node_modules/undici/lib/core/connect.js +137 -0
  1888. package/node_modules/undici/lib/core/constants.js +143 -0
  1889. package/node_modules/undici/lib/core/diagnostics.js +227 -0
  1890. package/node_modules/undici/lib/core/errors.js +477 -0
  1891. package/node_modules/undici/lib/core/request.js +438 -0
  1892. package/node_modules/undici/lib/core/socks5-client.js +407 -0
  1893. package/node_modules/undici/lib/core/socks5-utils.js +203 -0
  1894. package/node_modules/undici/lib/core/symbols.js +75 -0
  1895. package/node_modules/undici/lib/core/tree.js +160 -0
  1896. package/node_modules/undici/lib/core/util.js +992 -0
  1897. package/node_modules/undici/lib/dispatcher/agent.js +158 -0
  1898. package/node_modules/undici/lib/dispatcher/balanced-pool.js +219 -0
  1899. package/node_modules/undici/lib/dispatcher/client-h1.js +1610 -0
  1900. package/node_modules/undici/lib/dispatcher/client-h2.js +995 -0
  1901. package/node_modules/undici/lib/dispatcher/client.js +659 -0
  1902. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +165 -0
  1903. package/node_modules/undici/lib/dispatcher/dispatcher.js +48 -0
  1904. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +146 -0
  1905. package/node_modules/undici/lib/dispatcher/fixed-queue.js +135 -0
  1906. package/node_modules/undici/lib/dispatcher/h2c-client.js +51 -0
  1907. package/node_modules/undici/lib/dispatcher/pool-base.js +214 -0
  1908. package/node_modules/undici/lib/dispatcher/pool.js +118 -0
  1909. package/node_modules/undici/lib/dispatcher/proxy-agent.js +318 -0
  1910. package/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
  1911. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +137 -0
  1912. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +249 -0
  1913. package/node_modules/undici/lib/encoding/index.js +33 -0
  1914. package/node_modules/undici/lib/global.js +50 -0
  1915. package/node_modules/undici/lib/handler/cache-handler.js +578 -0
  1916. package/node_modules/undici/lib/handler/cache-revalidation-handler.js +124 -0
  1917. package/node_modules/undici/lib/handler/decorator-handler.js +67 -0
  1918. package/node_modules/undici/lib/handler/deduplication-handler.js +460 -0
  1919. package/node_modules/undici/lib/handler/redirect-handler.js +238 -0
  1920. package/node_modules/undici/lib/handler/retry-handler.js +394 -0
  1921. package/node_modules/undici/lib/handler/unwrap-handler.js +100 -0
  1922. package/node_modules/undici/lib/handler/wrap-handler.js +105 -0
  1923. package/node_modules/undici/lib/interceptor/cache.js +495 -0
  1924. package/node_modules/undici/lib/interceptor/decompress.js +259 -0
  1925. package/node_modules/undici/lib/interceptor/deduplicate.js +117 -0
  1926. package/node_modules/undici/lib/interceptor/dns.js +571 -0
  1927. package/node_modules/undici/lib/interceptor/dump.js +112 -0
  1928. package/node_modules/undici/lib/interceptor/redirect.js +21 -0
  1929. package/node_modules/undici/lib/interceptor/response-error.js +95 -0
  1930. package/node_modules/undici/lib/interceptor/retry.js +19 -0
  1931. package/node_modules/undici/lib/llhttp/.gitkeep +0 -0
  1932. package/node_modules/undici/lib/llhttp/constants.d.ts +195 -0
  1933. package/node_modules/undici/lib/llhttp/constants.js +531 -0
  1934. package/node_modules/undici/lib/llhttp/llhttp-wasm.js +15 -0
  1935. package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +15 -0
  1936. package/node_modules/undici/lib/llhttp/utils.d.ts +2 -0
  1937. package/node_modules/undici/lib/llhttp/utils.js +12 -0
  1938. package/node_modules/undici/lib/mock/mock-agent.js +232 -0
  1939. package/node_modules/undici/lib/mock/mock-call-history.js +248 -0
  1940. package/node_modules/undici/lib/mock/mock-client.js +68 -0
  1941. package/node_modules/undici/lib/mock/mock-errors.js +29 -0
  1942. package/node_modules/undici/lib/mock/mock-interceptor.js +209 -0
  1943. package/node_modules/undici/lib/mock/mock-pool.js +68 -0
  1944. package/node_modules/undici/lib/mock/mock-symbols.js +32 -0
  1945. package/node_modules/undici/lib/mock/mock-utils.js +486 -0
  1946. package/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
  1947. package/node_modules/undici/lib/mock/snapshot-agent.js +353 -0
  1948. package/node_modules/undici/lib/mock/snapshot-recorder.js +588 -0
  1949. package/node_modules/undici/lib/mock/snapshot-utils.js +158 -0
  1950. package/node_modules/undici/lib/util/cache.js +407 -0
  1951. package/node_modules/undici/lib/util/date.js +653 -0
  1952. package/node_modules/undici/lib/util/promise.js +28 -0
  1953. package/node_modules/undici/lib/util/runtime-features.js +124 -0
  1954. package/node_modules/undici/lib/util/stats.js +32 -0
  1955. package/node_modules/undici/lib/util/timers.js +425 -0
  1956. package/node_modules/undici/lib/web/cache/cache.js +864 -0
  1957. package/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
  1958. package/node_modules/undici/lib/web/cache/util.js +45 -0
  1959. package/node_modules/undici/lib/web/cookies/constants.js +12 -0
  1960. package/node_modules/undici/lib/web/cookies/index.js +199 -0
  1961. package/node_modules/undici/lib/web/cookies/parse.js +322 -0
  1962. package/node_modules/undici/lib/web/cookies/util.js +282 -0
  1963. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +399 -0
  1964. package/node_modules/undici/lib/web/eventsource/eventsource.js +501 -0
  1965. package/node_modules/undici/lib/web/eventsource/util.js +29 -0
  1966. package/node_modules/undici/lib/web/fetch/LICENSE +21 -0
  1967. package/node_modules/undici/lib/web/fetch/body.js +509 -0
  1968. package/node_modules/undici/lib/web/fetch/constants.js +131 -0
  1969. package/node_modules/undici/lib/web/fetch/data-url.js +596 -0
  1970. package/node_modules/undici/lib/web/fetch/formdata-parser.js +575 -0
  1971. package/node_modules/undici/lib/web/fetch/formdata.js +259 -0
  1972. package/node_modules/undici/lib/web/fetch/global.js +40 -0
  1973. package/node_modules/undici/lib/web/fetch/headers.js +719 -0
  1974. package/node_modules/undici/lib/web/fetch/index.js +2397 -0
  1975. package/node_modules/undici/lib/web/fetch/request.js +1115 -0
  1976. package/node_modules/undici/lib/web/fetch/response.js +641 -0
  1977. package/node_modules/undici/lib/web/fetch/util.js +1520 -0
  1978. package/node_modules/undici/lib/web/infra/index.js +229 -0
  1979. package/node_modules/undici/lib/web/subresource-integrity/Readme.md +9 -0
  1980. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +307 -0
  1981. package/node_modules/undici/lib/web/webidl/index.js +1006 -0
  1982. package/node_modules/undici/lib/web/websocket/connection.js +329 -0
  1983. package/node_modules/undici/lib/web/websocket/constants.js +126 -0
  1984. package/node_modules/undici/lib/web/websocket/events.js +331 -0
  1985. package/node_modules/undici/lib/web/websocket/frame.js +133 -0
  1986. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +118 -0
  1987. package/node_modules/undici/lib/web/websocket/receiver.js +450 -0
  1988. package/node_modules/undici/lib/web/websocket/sender.js +109 -0
  1989. package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +104 -0
  1990. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +497 -0
  1991. package/node_modules/undici/lib/web/websocket/util.js +347 -0
  1992. package/node_modules/undici/lib/web/websocket/websocket.js +751 -0
  1993. package/node_modules/undici/package.json +152 -0
  1994. package/node_modules/undici/scripts/strip-comments.js +10 -0
  1995. package/node_modules/undici/types/README.md +6 -0
  1996. package/node_modules/undici/types/agent.d.ts +32 -0
  1997. package/node_modules/undici/types/api.d.ts +43 -0
  1998. package/node_modules/undici/types/balanced-pool.d.ts +30 -0
  1999. package/node_modules/undici/types/cache-interceptor.d.ts +179 -0
  2000. package/node_modules/undici/types/cache.d.ts +36 -0
  2001. package/node_modules/undici/types/client-stats.d.ts +15 -0
  2002. package/node_modules/undici/types/client.d.ts +123 -0
  2003. package/node_modules/undici/types/connector.d.ts +36 -0
  2004. package/node_modules/undici/types/content-type.d.ts +21 -0
  2005. package/node_modules/undici/types/cookies.d.ts +30 -0
  2006. package/node_modules/undici/types/diagnostics-channel.d.ts +74 -0
  2007. package/node_modules/undici/types/dispatcher.d.ts +273 -0
  2008. package/node_modules/undici/types/env-http-proxy-agent.d.ts +22 -0
  2009. package/node_modules/undici/types/errors.d.ts +177 -0
  2010. package/node_modules/undici/types/eventsource.d.ts +66 -0
  2011. package/node_modules/undici/types/fetch.d.ts +231 -0
  2012. package/node_modules/undici/types/formdata.d.ts +114 -0
  2013. package/node_modules/undici/types/global-dispatcher.d.ts +9 -0
  2014. package/node_modules/undici/types/global-origin.d.ts +7 -0
  2015. package/node_modules/undici/types/h2c-client.d.ts +73 -0
  2016. package/node_modules/undici/types/handlers.d.ts +14 -0
  2017. package/node_modules/undici/types/header.d.ts +160 -0
  2018. package/node_modules/undici/types/index.d.ts +91 -0
  2019. package/node_modules/undici/types/interceptors.d.ts +80 -0
  2020. package/node_modules/undici/types/mock-agent.d.ts +68 -0
  2021. package/node_modules/undici/types/mock-call-history.d.ts +111 -0
  2022. package/node_modules/undici/types/mock-client.d.ts +27 -0
  2023. package/node_modules/undici/types/mock-errors.d.ts +12 -0
  2024. package/node_modules/undici/types/mock-interceptor.d.ts +94 -0
  2025. package/node_modules/undici/types/mock-pool.d.ts +27 -0
  2026. package/node_modules/undici/types/patch.d.ts +29 -0
  2027. package/node_modules/undici/types/pool-stats.d.ts +19 -0
  2028. package/node_modules/undici/types/pool.d.ts +41 -0
  2029. package/node_modules/undici/types/proxy-agent.d.ts +29 -0
  2030. package/node_modules/undici/types/readable.d.ts +68 -0
  2031. package/node_modules/undici/types/retry-agent.d.ts +8 -0
  2032. package/node_modules/undici/types/retry-handler.d.ts +125 -0
  2033. package/node_modules/undici/types/round-robin-pool.d.ts +41 -0
  2034. package/node_modules/undici/types/snapshot-agent.d.ts +109 -0
  2035. package/node_modules/undici/types/socks5-proxy-agent.d.ts +25 -0
  2036. package/node_modules/undici/types/util.d.ts +18 -0
  2037. package/node_modules/undici/types/utility.d.ts +7 -0
  2038. package/node_modules/undici/types/webidl.d.ts +347 -0
  2039. package/node_modules/undici/types/websocket.d.ts +188 -0
  2040. package/node_modules/unpdf/LICENSE +21 -0
  2041. package/node_modules/unpdf/README.md +371 -0
  2042. package/node_modules/unpdf/dist/index.cjs +340 -0
  2043. package/node_modules/unpdf/dist/index.d.cts +152 -0
  2044. package/node_modules/unpdf/dist/index.d.mts +152 -0
  2045. package/node_modules/unpdf/dist/index.d.ts +152 -0
  2046. package/node_modules/unpdf/dist/index.mjs +328 -0
  2047. package/node_modules/unpdf/dist/pdfjs.d.mts +1 -0
  2048. package/node_modules/unpdf/dist/pdfjs.d.ts +1 -0
  2049. package/node_modules/unpdf/dist/pdfjs.mjs +1 -0
  2050. package/node_modules/unpdf/dist/types/src/display/annotation_layer.d.ts +271 -0
  2051. package/node_modules/unpdf/dist/types/src/display/annotation_storage.d.ts +94 -0
  2052. package/node_modules/unpdf/dist/types/src/display/api.d.ts +1595 -0
  2053. package/node_modules/unpdf/dist/types/src/display/api_utils.d.ts +13 -0
  2054. package/node_modules/unpdf/dist/types/src/display/canvas.d.ts +207 -0
  2055. package/node_modules/unpdf/dist/types/src/display/canvas_dependency_tracker.d.ts +160 -0
  2056. package/node_modules/unpdf/dist/types/src/display/canvas_factory.d.ts +27 -0
  2057. package/node_modules/unpdf/dist/types/src/display/cmap_reader_factory.d.ts +25 -0
  2058. package/node_modules/unpdf/dist/types/src/display/content_disposition.d.ts +7 -0
  2059. package/node_modules/unpdf/dist/types/src/display/display_utils.d.ts +280 -0
  2060. package/node_modules/unpdf/dist/types/src/display/draw_layer.d.ts +26 -0
  2061. package/node_modules/unpdf/dist/types/src/display/editor/alt_text.d.ts +34 -0
  2062. package/node_modules/unpdf/dist/types/src/display/editor/annotation_editor_layer.d.ts +232 -0
  2063. package/node_modules/unpdf/dist/types/src/display/editor/color_picker.d.ts +39 -0
  2064. package/node_modules/unpdf/dist/types/src/display/editor/comment.d.ts +47 -0
  2065. package/node_modules/unpdf/dist/types/src/display/editor/draw.d.ts +121 -0
  2066. package/node_modules/unpdf/dist/types/src/display/editor/drawers/contour.d.ts +3 -0
  2067. package/node_modules/unpdf/dist/types/src/display/editor/drawers/freedraw.d.ts +32 -0
  2068. package/node_modules/unpdf/dist/types/src/display/editor/drawers/highlight.d.ts +37 -0
  2069. package/node_modules/unpdf/dist/types/src/display/editor/drawers/inkdraw.d.ts +129 -0
  2070. package/node_modules/unpdf/dist/types/src/display/editor/drawers/outline.d.ts +19 -0
  2071. package/node_modules/unpdf/dist/types/src/display/editor/drawers/signaturedraw.d.ts +79 -0
  2072. package/node_modules/unpdf/dist/types/src/display/editor/editor.d.ts +575 -0
  2073. package/node_modules/unpdf/dist/types/src/display/editor/freetext.d.ts +63 -0
  2074. package/node_modules/unpdf/dist/types/src/display/editor/highlight.d.ts +76 -0
  2075. package/node_modules/unpdf/dist/types/src/display/editor/ink.d.ts +42 -0
  2076. package/node_modules/unpdf/dist/types/src/display/editor/signature.d.ts +77 -0
  2077. package/node_modules/unpdf/dist/types/src/display/editor/stamp.d.ts +49 -0
  2078. package/node_modules/unpdf/dist/types/src/display/editor/toolbar.d.ts +26 -0
  2079. package/node_modules/unpdf/dist/types/src/display/editor/tools.d.ts +448 -0
  2080. package/node_modules/unpdf/dist/types/src/display/fetch_stream.d.ts +60 -0
  2081. package/node_modules/unpdf/dist/types/src/display/filter_factory.d.ts +29 -0
  2082. package/node_modules/unpdf/dist/types/src/display/font_loader.d.ts +65 -0
  2083. package/node_modules/unpdf/dist/types/src/display/metadata.d.ts +10 -0
  2084. package/node_modules/unpdf/dist/types/src/display/network.d.ts +86 -0
  2085. package/node_modules/unpdf/dist/types/src/display/network_utils.d.ts +15 -0
  2086. package/node_modules/unpdf/dist/types/src/display/node_stream.d.ts +54 -0
  2087. package/node_modules/unpdf/dist/types/src/display/node_utils.d.ts +32 -0
  2088. package/node_modules/unpdf/dist/types/src/display/optional_content_config.d.ts +18 -0
  2089. package/node_modules/unpdf/dist/types/src/display/pattern_helper.d.ts +75 -0
  2090. package/node_modules/unpdf/dist/types/src/display/pdf_objects.d.ts +40 -0
  2091. package/node_modules/unpdf/dist/types/src/display/standard_fontdata_factory.d.ts +20 -0
  2092. package/node_modules/unpdf/dist/types/src/display/svg_factory.d.ts +14 -0
  2093. package/node_modules/unpdf/dist/types/src/display/text_layer.d.ts +85 -0
  2094. package/node_modules/unpdf/dist/types/src/display/touch_manager.d.ts +18 -0
  2095. package/node_modules/unpdf/dist/types/src/display/transport_stream.d.ts +67 -0
  2096. package/node_modules/unpdf/dist/types/src/display/wasm_factory.d.ts +20 -0
  2097. package/node_modules/unpdf/dist/types/src/display/worker_options.d.ts +25 -0
  2098. package/node_modules/unpdf/dist/types/src/display/xfa_layer.d.ts +47 -0
  2099. package/node_modules/unpdf/dist/types/src/display/xfa_text.d.ts +21 -0
  2100. package/node_modules/unpdf/dist/types/src/interfaces.d.ts +122 -0
  2101. package/node_modules/unpdf/dist/types/src/pdf.d.ts +63 -0
  2102. package/node_modules/unpdf/dist/types/src/shared/image_utils.d.ts +17 -0
  2103. package/node_modules/unpdf/dist/types/src/shared/message_handler.d.ts +48 -0
  2104. package/node_modules/unpdf/dist/types/src/shared/murmurhash3.d.ts +7 -0
  2105. package/node_modules/unpdf/dist/types/src/shared/obj-bin-transform.d.ts +64 -0
  2106. package/node_modules/unpdf/dist/types/src/shared/scripting_utils.d.ts +18 -0
  2107. package/node_modules/unpdf/dist/types/src/shared/util.d.ts +415 -0
  2108. package/node_modules/unpdf/dist/types/web/annotation_editor_layer_builder.d.ts +65 -0
  2109. package/node_modules/unpdf/dist/types/web/annotation_layer_builder.d.ts +108 -0
  2110. package/node_modules/unpdf/dist/types/web/app_options.d.ts +16 -0
  2111. package/node_modules/unpdf/dist/types/web/autolinker.d.ts +28 -0
  2112. package/node_modules/unpdf/dist/types/web/base_pdf_page_view.d.ts +28 -0
  2113. package/node_modules/unpdf/dist/types/web/comment_manager.d.ts +20 -0
  2114. package/node_modules/unpdf/dist/types/web/download_manager.d.ts +13 -0
  2115. package/node_modules/unpdf/dist/types/web/draw_layer_builder.d.ts +34 -0
  2116. package/node_modules/unpdf/dist/types/web/event_utils.d.ts +77 -0
  2117. package/node_modules/unpdf/dist/types/web/generic_scripting.d.ts +8 -0
  2118. package/node_modules/unpdf/dist/types/web/genericl10n.d.ts +22 -0
  2119. package/node_modules/unpdf/dist/types/web/interfaces.d.ts +174 -0
  2120. package/node_modules/unpdf/dist/types/web/l10n.d.ts +34 -0
  2121. package/node_modules/unpdf/dist/types/web/pdf_find_controller.d.ts +134 -0
  2122. package/node_modules/unpdf/dist/types/web/pdf_find_utils.d.ts +16 -0
  2123. package/node_modules/unpdf/dist/types/web/pdf_history.d.ts +116 -0
  2124. package/node_modules/unpdf/dist/types/web/pdf_link_service.d.ts +147 -0
  2125. package/node_modules/unpdf/dist/types/web/pdf_page_detail_view.d.ts +33 -0
  2126. package/node_modules/unpdf/dist/types/web/pdf_page_view.d.ts +243 -0
  2127. package/node_modules/unpdf/dist/types/web/pdf_rendering_queue.d.ts +54 -0
  2128. package/node_modules/unpdf/dist/types/web/pdf_scripting_manager.component.d.ts +5 -0
  2129. package/node_modules/unpdf/dist/types/web/pdf_scripting_manager.d.ts +57 -0
  2130. package/node_modules/unpdf/dist/types/web/pdf_single_page_viewer.d.ts +7 -0
  2131. package/node_modules/unpdf/dist/types/web/pdf_thumbnail_view.d.ts +132 -0
  2132. package/node_modules/unpdf/dist/types/web/pdf_thumbnail_viewer.d.ts +117 -0
  2133. package/node_modules/unpdf/dist/types/web/pdf_viewer.component.d.ts +23 -0
  2134. package/node_modules/unpdf/dist/types/web/pdf_viewer.d.ts +616 -0
  2135. package/node_modules/unpdf/dist/types/web/struct_tree_layer_builder.d.ts +25 -0
  2136. package/node_modules/unpdf/dist/types/web/text_accessibility.d.ts +44 -0
  2137. package/node_modules/unpdf/dist/types/web/text_highlighter.d.ts +63 -0
  2138. package/node_modules/unpdf/dist/types/web/text_layer_builder.d.ts +65 -0
  2139. package/node_modules/unpdf/dist/types/web/ui_utils.d.ts +273 -0
  2140. package/node_modules/unpdf/dist/types/web/xfa_layer_builder.d.ts +50 -0
  2141. package/node_modules/unpdf/package.json +92 -0
  2142. package/node_modules/whatwg-encoding/LICENSE.txt +7 -0
  2143. package/node_modules/whatwg-encoding/README.md +50 -0
  2144. package/node_modules/whatwg-encoding/lib/labels-to-names.json +217 -0
  2145. package/node_modules/whatwg-encoding/lib/supported-names.json +38 -0
  2146. package/node_modules/whatwg-encoding/lib/whatwg-encoding.js +60 -0
  2147. package/node_modules/whatwg-encoding/package.json +32 -0
  2148. package/node_modules/whatwg-mimetype/LICENSE.txt +7 -0
  2149. package/node_modules/whatwg-mimetype/README.md +101 -0
  2150. package/node_modules/whatwg-mimetype/lib/mime-type-parameters.js +70 -0
  2151. package/node_modules/whatwg-mimetype/lib/mime-type.js +127 -0
  2152. package/node_modules/whatwg-mimetype/lib/parser.js +105 -0
  2153. package/node_modules/whatwg-mimetype/lib/serializer.js +25 -0
  2154. package/node_modules/whatwg-mimetype/lib/utils.js +60 -0
  2155. package/node_modules/whatwg-mimetype/package.json +45 -0
  2156. package/node_modules/wmf/LICENSE +201 -0
  2157. package/node_modules/wmf/README.md +92 -0
  2158. package/node_modules/wmf/dist/wmf.js +2 -0
  2159. package/node_modules/wmf/dist/wmf.js.map +1 -0
  2160. package/node_modules/wmf/dist/wmf.node.js +2 -0
  2161. package/node_modules/wmf/dist/wmf.node.js.map +1 -0
  2162. package/node_modules/wmf/package.json +68 -0
  2163. package/node_modules/word/CONTRIBUTING.md +61 -0
  2164. package/node_modules/word/LICENSE +201 -0
  2165. package/node_modules/word/README.md +2 -0
  2166. package/node_modules/word/package.json +29 -0
  2167. package/node_modules/word/word.js +1 -0
  2168. package/node_modules/xlsx/CHANGELOG.md +264 -0
  2169. package/node_modules/xlsx/LICENSE +201 -0
  2170. package/node_modules/xlsx/README.md +4504 -0
  2171. package/node_modules/xlsx/bin/xlsx.njs +310 -0
  2172. package/node_modules/xlsx/bower.json +22 -0
  2173. package/node_modules/xlsx/dist/LICENSE +201 -0
  2174. package/node_modules/xlsx/dist/cpexcel.full.mjs +1502 -0
  2175. package/node_modules/xlsx/dist/cpexcel.js +1506 -0
  2176. package/node_modules/xlsx/dist/shim.min.js +2 -0
  2177. package/node_modules/xlsx/dist/xlsx.core.min.js +15 -0
  2178. package/node_modules/xlsx/dist/xlsx.core.min.map +1 -0
  2179. package/node_modules/xlsx/dist/xlsx.extendscript.js +24642 -0
  2180. package/node_modules/xlsx/dist/xlsx.full.min.js +22 -0
  2181. package/node_modules/xlsx/dist/xlsx.full.min.map +1 -0
  2182. package/node_modules/xlsx/dist/xlsx.mini.min.js +9 -0
  2183. package/node_modules/xlsx/dist/xlsx.mini.min.map +1 -0
  2184. package/node_modules/xlsx/dist/xlsx.zahl.js +4 -0
  2185. package/node_modules/xlsx/dist/xlsx.zahl.mjs +2 -0
  2186. package/node_modules/xlsx/formats.png +0 -0
  2187. package/node_modules/xlsx/legend.png +0 -0
  2188. package/node_modules/xlsx/package.json +101 -0
  2189. package/node_modules/xlsx/types/index.d.ts +900 -0
  2190. package/node_modules/xlsx/types/tsconfig.json +15 -0
  2191. package/node_modules/xlsx/xlsx.js +24486 -0
  2192. package/node_modules/xlsx/xlsx.mjs +24597 -0
  2193. package/node_modules/xlsx/xlsxworker.js +14 -0
  2194. package/node_modules/xml2js/LICENSE +19 -0
  2195. package/node_modules/xml2js/README.md +507 -0
  2196. package/node_modules/xml2js/lib/bom.js +12 -0
  2197. package/node_modules/xml2js/lib/builder.js +127 -0
  2198. package/node_modules/xml2js/lib/defaults.js +72 -0
  2199. package/node_modules/xml2js/lib/parser.js +395 -0
  2200. package/node_modules/xml2js/lib/processors.js +34 -0
  2201. package/node_modules/xml2js/lib/xml2js.bc.js +28337 -0
  2202. package/node_modules/xml2js/lib/xml2js.js +39 -0
  2203. package/node_modules/xml2js/node_modules/xmlbuilder/CHANGELOG.md +470 -0
  2204. package/node_modules/xml2js/node_modules/xmlbuilder/LICENSE +21 -0
  2205. package/node_modules/xml2js/node_modules/xmlbuilder/README.md +86 -0
  2206. package/node_modules/xml2js/node_modules/xmlbuilder/appveyor.yml +20 -0
  2207. package/node_modules/xml2js/node_modules/xmlbuilder/lib/Derivation.js +10 -0
  2208. package/node_modules/xml2js/node_modules/xmlbuilder/lib/DocumentPosition.js +12 -0
  2209. package/node_modules/xml2js/node_modules/xmlbuilder/lib/NodeType.js +23 -0
  2210. package/node_modules/xml2js/node_modules/xmlbuilder/lib/OperationType.js +11 -0
  2211. package/node_modules/xml2js/node_modules/xmlbuilder/lib/Utility.js +83 -0
  2212. package/node_modules/xml2js/node_modules/xmlbuilder/lib/WriterState.js +10 -0
  2213. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLAttribute.js +108 -0
  2214. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLCData.js +36 -0
  2215. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLCharacterData.js +79 -0
  2216. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLComment.js +36 -0
  2217. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js +64 -0
  2218. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js +16 -0
  2219. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMImplementation.js +32 -0
  2220. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMStringList.js +28 -0
  2221. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDAttList.js +55 -0
  2222. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDElement.js +38 -0
  2223. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDEntity.js +97 -0
  2224. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDNotation.js +52 -0
  2225. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDeclaration.js +43 -0
  2226. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocType.js +186 -0
  2227. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocument.js +242 -0
  2228. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocumentCB.js +528 -0
  2229. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocumentFragment.js +24 -0
  2230. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDummy.js +31 -0
  2231. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLElement.js +298 -0
  2232. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js +58 -0
  2233. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNode.js +785 -0
  2234. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNodeFilter.js +48 -0
  2235. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNodeList.js +28 -0
  2236. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js +49 -0
  2237. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLRaw.js +35 -0
  2238. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLStreamWriter.js +176 -0
  2239. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLStringWriter.js +35 -0
  2240. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLStringifier.js +240 -0
  2241. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLText.js +69 -0
  2242. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLTypeInfo.js +21 -0
  2243. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLUserDataHandler.js +16 -0
  2244. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLWriterBase.js +428 -0
  2245. package/node_modules/xml2js/node_modules/xmlbuilder/lib/index.js +65 -0
  2246. package/node_modules/xml2js/node_modules/xmlbuilder/package.json +39 -0
  2247. package/node_modules/xml2js/node_modules/xmlbuilder/typings/index.d.ts +153 -0
  2248. package/node_modules/xml2js/package.json +93 -0
  2249. package/package.json +55 -2
@@ -0,0 +1 @@
1
+ void 0===globalThis.DOMMatrix&&(globalThis.DOMMatrix=class{}),void 0===globalThis.FinalizationRegistry&&(globalThis.FinalizationRegistry=class{register(){}unregister(){}}),globalThis.navigator??={},globalThis.navigator.platform??="",globalThis.navigator.userAgent??="",void 0===Promise.withResolvers&&(Promise.withResolvers=function(){let e,t;return{promise:new Promise((i,n)=>{e=i,t=n}),resolve:e,reject:t}});const e=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),t=[.001,0,0,.001,0,0],i=1.35,n=.35,a=.25925925925925924,s=1,r=2,o=4,l=8,c=16,h=64,d=128,u=256,g="pdfjs_internal_editor_",f=3,p=9,m=13,b=15,y=101,w={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},x=0,S=4,v=1,C=2,k=3,T={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},F="Group",E="R",M=1,D=2,O=4,_=16,R=32,N=128,L=512,U=1,j=2,$=4096,H=8192,X=32768,q=65536,z=131072,W=1048576,G=2097152,V=8388608,K=16777216,Y=1,J=2,Z=3,Q=4,ee=5,te={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"},ie={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},ne={O:"PageOpen",C:"PageClose"},ae=1,se=5,re=1,oe=2,le=3,ce=4,he=5,de=6,ue=7,ge=8,fe=9,pe=10,me=11,be=12,ye=13,we=14,Ae=15,xe=16,Se=17,ve=18,Ce=19,ke=20,Te=21,Fe=22,Ie=23,Ee=24,Me=25,De=26,Oe=27,_e=28,Pe=29,Re=30,Be=31,Ne=32,Le=33,Ue=34,je=35,$e=36,He=37,Xe=38,qe=39,ze=40,We=41,Ge=42,Ve=43,Ke=44,Ye=45,Je=46,Ze=47,Qe=48,et=49,tt=50,it=51,nt=52,at=53,st=54,rt=55,ot=56,lt=57,ct=58,ht=59,dt=60,ut=61,gt=62,ft=63,pt=64,mt=65,bt=66,yt=67,wt=68,At=69,xt=70,St=71,vt=72,Ct=73,kt=74,Tt=75,Ft=76,It=77,Et=80,Mt=81,Dt=83,Ot=84,_t=85,Pt=86,Rt=87,Bt=88,Nt=89,Lt=90,Ut=91,jt=92,$t=93,Ht=94,Xt=0,qt=1,zt=2,Wt=3,Gt=1,Vt=2;let Kt=ae;function info$1(e){Kt>=se&&console.info(`Info: ${e}`)}function warn$1(e){Kt>=ae&&console.warn(`Warning: ${e}`)}function unreachable$1(e){throw new Error(e)}function assert$1(e,t){e||unreachable$1(t)}function createValidAbsoluteUrl$1(e,t=null,i=null){if(!e)return null;if(i&&"string"==typeof e){if(i.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);t?.length>=2&&(e=`http://${e}`)}if(i.tryConvertEncoding)try{e=stringToUTF8String$1(e)}catch{}}const n=t?URL.parse(e,t):URL.parse(e);return function(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n)?n:null}function shadow$1(e,t,i,n=!1){return Object.defineProperty(e,t,{value:i,enumerable:!n,configurable:!0,writable:!1}),i}const Yt=function(){function BaseException(e,t){this.message=e,this.name=t}return BaseException.prototype=new Error,BaseException.constructor=BaseException,BaseException}();let Jt=class extends Yt{constructor(e,t){super(e,"PasswordException"),this.code=t}},Zt=class extends Yt{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}},Qt=class extends Yt{constructor(e){super(e,"InvalidPDFException")}},ei=class extends Yt{constructor(e,t,i){super(e,"ResponseException"),this.status=t,this.missing=i}},ti=class extends Yt{constructor(e){super(e,"FormatError")}},ii=class extends Yt{constructor(e){super(e,"AbortException")}};function bytesToString$1(e){"object"==typeof e&&void 0!==e?.length||unreachable$1("Invalid argument for bytesToString");const t=e.length,i=8192;if(t<i)return String.fromCharCode.apply(null,e);const n=[];for(let a=0;a<t;a+=i){const s=Math.min(a+i,t),r=e.subarray(a,s);n.push(String.fromCharCode.apply(null,r))}return n.join("")}function stringToBytes$1(e){"string"!=typeof e&&unreachable$1("Invalid argument for stringToBytes");const t=e.length,i=new Uint8Array(t);for(let n=0;n<t;++n)i[n]=255&e.charCodeAt(n);return i}function string32$1(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function objectSize(e){return Object.keys(e).length}class FeatureTest{static get isLittleEndian(){return shadow$1(this,"isLittleEndian",function(){const e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow$1(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return shadow$1(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return shadow$1(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get platform(){const{platform:e,userAgent:t}=navigator;return shadow$1(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){return shadow$1(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const ni=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0"));let ai=class{static makeHexColor(e,t,i){return`#${ni[e]}${ni[t]}${ni[i]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let i;e[0]?(e[0]<0&&(i=t[0],t[0]=t[2],t[2]=i),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(i=t[1],t[1]=t[3],t[3]=i),t[1]*=e[3],t[3]*=e[3]):(i=t[0],t[0]=t[1],t[1]=i,i=t[2],t[2]=t[3],t[3]=i,e[1]<0&&(i=t[1],t[1]=t[3],t[3]=i),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(i=t[0],t[0]=t[2],t[2]=i),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,i=0){const n=e[i],a=e[i+1];e[i]=n*t[0]+a*t[2]+t[4],e[i+1]=n*t[1]+a*t[3]+t[5]}static applyTransformToBezier(e,t,i=0){const n=t[0],a=t[1],s=t[2],r=t[3],o=t[4],l=t[5];for(let t=0;t<6;t+=2){const c=e[i+t],h=e[i+t+1];e[i+t]=c*n+h*s+o,e[i+t+1]=c*a+h*r+l}}static applyInverseTransform(e,t){const i=e[0],n=e[1],a=t[0]*t[3]-t[1]*t[2];e[0]=(i*t[3]-n*t[2]+t[2]*t[5]-t[4]*t[3])/a,e[1]=(-i*t[1]+n*t[0]+t[4]*t[1]-t[5]*t[0])/a}static axialAlignedBoundingBox(e,t,i){const n=t[0],a=t[1],s=t[2],r=t[3],o=t[4],l=t[5],c=e[0],h=e[1],d=e[2],u=e[3];let g=n*c+o,f=g,p=n*d+o,m=p,b=r*h+l,y=b,w=r*u+l,x=w;if(0!==a||0!==s){const e=a*c,t=a*d,i=s*h,n=s*u;g+=i,m+=i,p+=n,f+=n,b+=e,x+=e,w+=t,y+=t}i[0]=Math.min(i[0],g,p,f,m),i[1]=Math.min(i[1],b,w,y,x),i[2]=Math.max(i[2],g,p,f,m),i[3]=Math.max(i[3],b,w,y,x)}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){const i=e[0],n=e[1],a=e[2],s=e[3],r=i**2+n**2,o=i*a+n*s,l=a**2+s**2,c=(r+l)/2,h=Math.sqrt(c**2-(r*l-o**2));t[0]=Math.sqrt(c+h||1),t[1]=Math.sqrt(c-h||1)}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const i=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),n=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(i>n)return null;const a=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return a>s?null:[i,a,n,s]}static pointBoundingBox(e,t,i){i[0]=Math.min(i[0],e),i[1]=Math.min(i[1],t),i[2]=Math.max(i[2],e),i[3]=Math.max(i[3],t)}static rectBoundingBox(e,t,i,n,a){a[0]=Math.min(a[0],e,i),a[1]=Math.min(a[1],t,n),a[2]=Math.max(a[2],e,i),a[3]=Math.max(a[3],t,n)}static#e(e,t,i,n,a,s,r,o,l,c){if(l<=0||l>=1)return;const h=1-l,d=l*l,u=d*l,g=h*(h*(h*e+3*l*t)+3*d*i)+u*n,f=h*(h*(h*a+3*l*s)+3*d*r)+u*o;c[0]=Math.min(c[0],g),c[1]=Math.min(c[1],f),c[2]=Math.max(c[2],g),c[3]=Math.max(c[3],f)}static#t(e,t,i,n,a,s,r,o,l,c,h,d){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&this.#e(e,t,i,n,a,s,r,o,-h/c,d));const u=c**2-4*h*l;if(u<0)return;const g=Math.sqrt(u),f=2*l;this.#e(e,t,i,n,a,s,r,o,(-c+g)/f,d),this.#e(e,t,i,n,a,s,r,o,(-c-g)/f,d)}static bezierBoundingBox(e,t,i,n,a,s,r,o,l){l[0]=Math.min(l[0],e,r),l[1]=Math.min(l[1],t,o),l[2]=Math.max(l[2],e,r),l[3]=Math.max(l[3],t,o),this.#t(e,i,a,r,t,n,s,o,3*(3*(i-a)-e+r),6*(e-2*i+a),3*(i-e),l),this.#t(e,i,a,r,t,n,s,o,3*(3*(n-s)-t+o),6*(t-2*n+s),3*(n-t),l)}};const si=[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 stringToPDFString(e,t=!1){if(e[0]>="ï"){let i;if("þ"===e[0]&&"ÿ"===e[1]?(i="utf-16be",e.length%2==1&&(e=e.slice(0,-1))):"ÿ"===e[0]&&"þ"===e[1]?(i="utf-16le",e.length%2==1&&(e=e.slice(0,-1))):"ï"===e[0]&&"»"===e[1]&&"¿"===e[2]&&(i="utf-8"),i)try{const n=new TextDecoder(i,{fatal:!0}),a=stringToBytes$1(e),s=n.decode(a);return t||!s.includes("")?s:s.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g,"")}catch(e){warn$1(`stringToPDFString: "${e}".`)}}const i=[];for(let n=0,a=e.length;n<a;n++){const s=e.charCodeAt(n);if(!t&&27===s){for(;++n<a&&27!==e.charCodeAt(n););continue}const r=si[s];i.push(r?String.fromCharCode(r):e.charAt(n))}return i.join("")}function stringToUTF8String$1(e){return decodeURIComponent(escape(e))}function utf8StringToString(e){return unescape(encodeURIComponent(e))}function isArrayEqual(e,t){if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;i++)if(e[i]!==t[i])return!1;return!0}function getModificationDate(e=new Date){e instanceof Date||(e=new Date(e));return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")}let ri=null,oi=null;function MathClamp$1(e,t,i){return Math.min(Math.max(e,t),i)}function toHexUtil(e){return Uint8Array.prototype.toHex?e.toHex():Array.from(e,e=>ni[e]).join("")}"function"!=typeof Promise.try&&(Promise.try=function(e,...t){return new Promise(i=>{i(e(...t))})}),"function"!=typeof Math.sumPrecise&&(Math.sumPrecise=function(e){return e.reduce((e,t)=>e+t,0)});const li=Symbol("CIRCULAR_REF"),ci=Symbol("EOF");let hi=Object.create(null),di=Object.create(null),ui=Object.create(null);class Name{constructor(e){this.name=e}static get(e){return di[e]||=new Name(e)}}class Cmd{constructor(e){this.cmd=e}static get(e){return hi[e]||=new Cmd(e)}}const nonSerializable=function(){return nonSerializable};class Dict{constructor(e=null){this._map=new Map,this.xref=e,this.objId=null,this.suppressEncryption=!1,this.__nonSerializable__=nonSerializable}assignXref(e){this.xref=e}get size(){return this._map.size}get(e,t,i){let n=this._map.get(e);return void 0===n&&void 0!==t&&(n=this._map.get(t),void 0===n&&void 0!==i&&(n=this._map.get(i))),n instanceof Ref&&this.xref?this.xref.fetch(n,this.suppressEncryption):n}async getAsync(e,t,i){let n=this._map.get(e);return void 0===n&&void 0!==t&&(n=this._map.get(t),void 0===n&&void 0!==i&&(n=this._map.get(i))),n instanceof Ref&&this.xref?this.xref.fetchAsync(n,this.suppressEncryption):n}getArray(e,t,i){let n=this._map.get(e);if(void 0===n&&void 0!==t&&(n=this._map.get(t),void 0===n&&void 0!==i&&(n=this._map.get(i))),n instanceof Ref&&this.xref&&(n=this.xref.fetch(n,this.suppressEncryption)),Array.isArray(n)){n=n.slice();for(let e=0,t=n.length;e<t;e++)n[e]instanceof Ref&&this.xref&&(n[e]=this.xref.fetch(n[e],this.suppressEncryption))}return n}getRaw(e){return this._map.get(e)}getKeys(){return[...this._map.keys()]}getRawValues(){return[...this._map.values()]}set(e,t){this._map.set(e,t)}setIfNotExists(e,t){this.has(e)||this.set(e,t)}setIfNumber(e,t){"number"==typeof t&&this.set(e,t)}setIfArray(e,t){(Array.isArray(t)||ArrayBuffer.isView(t))&&this.set(e,t)}setIfDefined(e,t){null!=t&&this.set(e,t)}setIfName(e,t){"string"==typeof t?this.set(e,Name.get(t)):t instanceof Name&&this.set(e,t)}has(e){return this._map.has(e)}*[Symbol.iterator](){for(const[e,t]of this._map)yield[e,t instanceof Ref&&this.xref?this.xref.fetch(t,this.suppressEncryption):t]}static get empty(){const e=new Dict(null);return e.set=(e,t)=>{unreachable$1("Should not call `set` on the empty dictionary.")},shadow$1(this,"empty",e)}static merge({xref:e,dictArray:t,mergeSubDicts:i=!1}){const n=new Dict(e),a=new Map;for(const e of t)if(e instanceof Dict)for(const[t,n]of e._map){let e=a.get(t);if(void 0===e)e=[],a.set(t,e);else if(!(i&&n instanceof Dict))continue;e.push(n)}for(const[t,i]of a){if(1===i.length||!(i[0]instanceof Dict)){n._map.set(t,i[0]);continue}const a=new Dict(e);for(const e of i)for(const[t,i]of e._map)a._map.has(t)||a._map.set(t,i);a.size>0&&n._map.set(t,a)}return a.clear(),n.size>0?n:Dict.empty}clone(){const e=new Dict(this.xref);for(const t of this.getKeys())e.set(t,this.getRaw(t));return e}delete(e){this._map.delete(e)}}class Ref{constructor(e,t){this.num=e,this.gen=t}toString(){return 0===this.gen?`${this.num}R`:`${this.num}R${this.gen}`}static fromString(e){const t=ui[e];if(t)return t;const i=/^(\d+)R(\d*)$/.exec(e);return i&&"0"!==i[1]?ui[e]=new Ref(parseInt(i[1]),i[2]?parseInt(i[2]):0):null}static get(e,t){const i=0===t?`${e}R`:`${e}R${t}`;return ui[i]||=new Ref(e,t)}}class RefSet{constructor(e=null){this._set=new Set(e?._set)}has(e){return this._set.has(e.toString())}put(e){this._set.add(e.toString())}remove(e){this._set.delete(e.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}}class RefSetCache{constructor(){this._map=new Map}get size(){return this._map.size}get(e){return this._map.get(e.toString())}has(e){return this._map.has(e.toString())}put(e,t){this._map.set(e.toString(),t)}putAlias(e,t){this._map.set(e.toString(),this.get(t))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}*values(){yield*this._map.values()}*items(){for(const[e,t]of this._map)yield[Ref.fromString(e),t]}}function isName(e,t){return e instanceof Name&&(void 0===t||e.name===t)}function isCmd(e,t){return e instanceof Cmd&&(void 0===t||e.cmd===t)}function isDict(e,t){return e instanceof Dict&&(void 0===t||isName(e.get("Type"),t))}function isRefsEqual(e,t){return e.num===t.num&&e.gen===t.gen}class BaseStream{get length(){unreachable$1("Abstract getter `length` accessed")}get isEmpty(){unreachable$1("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return shadow$1(this,"isDataLoaded",!0)}getByte(){unreachable$1("Abstract method `getByte` called")}getBytes(e){unreachable$1("Abstract method `getBytes` called")}async getImageData(e,t){return this.getBytes(e,t)}async asyncGetBytes(){unreachable$1("Abstract method `asyncGetBytes` called")}get isAsync(){return!1}get isAsyncDecoder(){return!1}get canAsyncDecodeImageFromBuffer(){return!1}async getTransferableImage(){return null}peekByte(){const e=this.getByte();return-1!==e&&this.pos--,e}peekBytes(e){const t=this.getBytes(e);return this.pos-=t.length,t}getUint16(){const e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t}getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}getByteRange(e,t){unreachable$1("Abstract method `getByteRange` called")}getString(e){return bytesToString$1(this.getBytes(e))}skip(e){this.pos+=e||1}reset(){unreachable$1("Abstract method `reset` called")}moveStart(){unreachable$1("Abstract method `moveStart` called")}makeSubStream(e,t,i=null){unreachable$1("Abstract method `makeSubStream` called")}getBaseStreams(){return null}}const gi=/^[1-9]\.\d$/,fi=2**31-1,pi=[1,0,0,1,0,0],mi=["ColorSpace","ExtGState","Font","Pattern","Properties","Shading","XObject"],bi=["ExtGState","Font","Properties","XObject"];function getLookupTableFactory(e){let t;return function(){return e&&(t=Object.create(null),e(t),e=null),t}}class MissingDataException extends Yt{constructor(e,t){super(`Missing data [${e}, ${t})`,"MissingDataException"),this.begin=e,this.end=t}}class ParserEOFException extends Yt{constructor(e){super(e,"ParserEOFException")}}class XRefEntryException extends Yt{constructor(e){super(e,"XRefEntryException")}}class XRefParseException extends Yt{constructor(e){super(e,"XRefParseException")}}function arrayBuffersToBytes(e){const t=e.length;if(0===t)return new Uint8Array(0);if(1===t)return new Uint8Array(e[0]);let i=0;for(let n=0;n<t;n++)i+=e[n].byteLength;const n=new Uint8Array(i);let a=0;for(let i=0;i<t;i++){const t=new Uint8Array(e[i]);n.set(t,a),a+=t.byteLength}return n}async function fetchBinaryData(e){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch file "${e}" with "${t.statusText}".`);return new Uint8Array(await t.arrayBuffer())}function getInheritableProperty({dict:e,key:t,getArray:i=!1,stopWhenFound:n=!0}){let a;const s=new RefSet;for(;e instanceof Dict&&(!e.objId||!s.has(e.objId));){e.objId&&s.put(e.objId);const r=i?e.getArray(t):e.get(t);if(void 0!==r){if(n)return r;(a||=[]).push(r)}e=e.get("Parent")}return a}const yi=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function toRomanNumerals(e,t=!1){assert$1(Number.isInteger(e)&&e>0,"The number should be a positive integer.");const i="M".repeat(e/1e3|0)+yi[e%1e3/100|0]+yi[10+(e%100/10|0)]+yi[20+e%10];return t?i.toLowerCase():i}function log2(e){return e>0?Math.ceil(Math.log2(e)):0}function readInt8(e,t){return e[t]<<24>>24}function readInt16(e,t){return(e[t]<<24|e[t+1]<<16)>>16}function readUint16(e,t){return e[t]<<8|e[t+1]}function readUint32(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function isWhiteSpace(e){return 32===e||9===e||13===e||10===e}function isNumberArray(e,t){return Array.isArray(e)?(null===t||e.length===t)&&e.every(e=>"number"==typeof e):ArrayBuffer.isView(e)&&!(e instanceof BigInt64Array||e instanceof BigUint64Array)&&(null===t||e.length===t)}function lookupMatrix(e,t){return isNumberArray(e,6)?e:t}function lookupRect(e,t){return isNumberArray(e,4)?e:t}function lookupNormalRect(e,t){return isNumberArray(e,4)?ai.normalizeRect(e):t}function parseXFAPath(e){const t=/(.+)\[(\d+)\]$/;return e.split(".").map(e=>{const i=e.match(t);return i?{name:i[1],pos:parseInt(i[2],10)}:{name:e,pos:0}})}function escapePDFName(e){const t=[];let i=0;for(let n=0,a=e.length;n<a;n++){const a=e.charCodeAt(n);(a<33||a>126||35===a||40===a||41===a||60===a||62===a||91===a||93===a||123===a||125===a||47===a||37===a)&&(i<n&&t.push(e.substring(i,n)),t.push(`#${a.toString(16)}`),i=n+1)}return 0===t.length?e:(i<e.length&&t.push(e.substring(i,e.length)),t.join(""))}function escapeString(e){return e.replaceAll(/([()\\\n\r])/g,e=>"\n"===e?"\\n":"\r"===e?"\\r":`\\${e}`)}function _collectJS(e,t,i,n){if(!e)return;let a=null;if(e instanceof Ref){if(n.has(e))return;a=e,n.put(a),e=t.fetch(e)}if(Array.isArray(e))for(const a of e)_collectJS(a,t,i,n);else if(e instanceof Dict){if(isName(e.get("S"),"JavaScript")){const t=e.get("JS");let n;t instanceof BaseStream?n=t.getString():"string"==typeof t&&(n=t),n&&=stringToPDFString(n,!0).replaceAll("\0",""),n&&i.push(n.trim())}_collectJS(e.getRaw("Next"),t,i,n)}a&&n.remove(a)}function collectActions(e,t,i){const n=Object.create(null),a=getInheritableProperty({dict:t,key:"AA",stopWhenFound:!1});if(a)for(let t=a.length-1;t>=0;t--){const s=a[t];if(s instanceof Dict)for(const t of s.getKeys()){const a=i[t];if(!a)continue;const r=[];_collectJS(s.getRaw(t),e,r,new RefSet),r.length>0&&(n[a]=r)}}if(t.has("A")){const i=[];_collectJS(t.get("A"),e,i,new RefSet),i.length>0&&(n.Action=i)}return objectSize(n)>0?n:null}const wi={60:"&lt;",62:"&gt;",38:"&amp;",34:"&quot;",39:"&apos;"};function*codePointIter(e){for(let t=0,i=e.length;t<i;t++){const i=e.codePointAt(t);i>55295&&(i<57344||i>65533)&&t++,yield i}}function encodeToXmlString(e){const t=[];let i=0;for(let n=0,a=e.length;n<a;n++){const a=e.codePointAt(n);if(32<=a&&a<=126){const s=wi[a];s&&(i<n&&t.push(e.substring(i,n)),t.push(s),i=n+1)}else i<n&&t.push(e.substring(i,n)),t.push(`&#x${a.toString(16).toUpperCase()};`),a>55295&&(a<57344||a>65533)&&n++,i=n+1}return 0===t.length?e:(i<e.length&&t.push(e.substring(i,e.length)),t.join(""))}function validateFontName(e,t=!1){const i=/^("|').*("|')$/.exec(e);if(i&&i[1]===i[2]){if(new RegExp(`[^\\\\]${i[1]}`).test(e.slice(1,-1)))return t&&warn$1(`FontFamily contains unescaped ${i[1]}: ${e}.`),!1}else for(const i of e.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(i)||!/^[\w-\\]+$/.test(i))return t&&warn$1(`FontFamily contains invalid <custom-ident>: ${e}.`),!1;return!0}function validateCSSFont(e){const t=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:i,fontWeight:n,italicAngle:a}=e;if(!validateFontName(i,!0))return!1;const s=n?n.toString():"";e.fontWeight=t.has(s)?s:"400";const r=parseFloat(a);return e.italicAngle=isNaN(r)||r<-90||r>90?"14":a.toString(),!0}function recoverJsURL(e){const t=new RegExp("^\\s*("+["app.launchURL","window.open","xfa.host.gotoURL"].join("|").replaceAll(".","\\.")+")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))","i").exec(e);return t?.[2]?{url:t[2],newWindow:"app.launchURL"===t[1]&&"true"===t[3]}:null}function numberToString(e){if(Number.isInteger(e))return e.toString();const t=Math.round(100*e);return t%100==0?(t/100).toString():t%10==0?e.toFixed(1):e.toFixed(2)}function getNewAnnotationsMap(e){if(!e)return null;const t=new Map;for(const[i,n]of e){if(!i.startsWith(g))continue;let e=t.get(n.pageIndex);e||(e=[],t.set(n.pageIndex,e)),e.push(n)}return t.size>0?t:null}function stringToAsciiOrUTF16BE(e){return null==e||function(e){if("string"!=typeof e)return!1;return!e||/^[\x00-\x7F]*$/.test(e)}(e)?e:stringToUTF16String(e,!0)}function stringToUTF16HexString(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e.charCodeAt(i);t.push(ni[n>>8&255],ni[255&n])}return t.join("")}function stringToUTF16String(e,t=!1){const i=[];t&&i.push("þÿ");for(let t=0,n=e.length;t<n;t++){const n=e.charCodeAt(t);i.push(String.fromCharCode(n>>8&255),String.fromCharCode(255&n))}return i.join("")}function getRotationMatrix(e,t,i){switch(e){case 90:return[0,1,-1,0,t,0];case 180:return[-1,0,0,-1,t,i];case 270:return[0,-1,1,0,0,i];default:throw new Error("Invalid rotation")}}function getSizeInBytes(e){return Math.ceil(Math.ceil(Math.log2(1+e))/8)}class QCMS{static#i=null;static _memory=null;static _mustAddAlpha=!1;static _destBuffer=null;static _destOffset=0;static _destLength=0;static _cssColor="";static _makeHexColor=null;static get _memoryArray(){const e=this.#i;return e?.byteLength?e:this.#i=new Uint8Array(this._memory.buffer)}}let Ai;const xi="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&xi.decode();let Si=null;function getUint8ArrayMemory0(){return null!==Si&&0!==Si.byteLength||(Si=new Uint8Array(Ai.memory.buffer)),Si}let vi=0;function passArray8ToWasm0(e,t){const i=t(1*e.length,1)>>>0;return getUint8ArrayMemory0().set(e,i/1),vi=e.length,i}const Ci=Object.freeze({RGB8:0,0:"RGB8",RGBA8:1,1:"RGBA8",BGRA8:2,2:"BGRA8",Gray8:3,3:"Gray8",GrayA8:4,4:"GrayA8",CMYK:5,5:"CMYK"}),ki=Object.freeze({Perceptual:0,0:"Perceptual",RelativeColorimetric:1,1:"RelativeColorimetric",Saturation:2,2:"Saturation",AbsoluteColorimetric:3,3:"AbsoluteColorimetric"});function __wbg_get_imports(){const e={wbg:{}};return e.wbg.__wbg_copyresult_b08ee7d273f295dd=function(e,t){!function(e,t){const{_mustAddAlpha:i,_destBuffer:n,_destOffset:a,_destLength:s,_memoryArray:r}=QCMS;if(t!==s)if(i)for(let i=e,s=e+t,o=a;i<s;i+=3,o+=4)n[o]=r[i],n[o+1]=r[i+1],n[o+2]=r[i+2],n[o+3]=255;else for(let i=e,s=e+t,o=a;i<s;i+=3,o+=4)n[o]=r[i],n[o+1]=r[i+1],n[o+2]=r[i+2];else n.set(r.subarray(e,e+t),a)}(e>>>0,t>>>0)},e.wbg.__wbg_copyrgb_d60ce17bb05d9b67=function(e){!function(e){const{_destBuffer:t,_destOffset:i,_memoryArray:n}=QCMS;t[i]=n[e],t[i+1]=n[e+1],t[i+2]=n[e+2]}(e>>>0)},e.wbg.__wbg_makecssRGB_893bf0cd9fdb302d=function(e){!function(e){const{_memoryArray:t}=QCMS;QCMS._cssColor=QCMS._makeHexColor(t[e],t[e+1],t[e+2])}(e>>>0)},e.wbg.__wbindgen_init_externref_table=function(){const e=Ai.__wbindgen_export_0,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},e.wbg.__wbindgen_throw=function(e,t){throw new Error((i=e,n=t,i>>>=0,xi.decode(getUint8ArrayMemory0().subarray(i,i+n))));var i,n},e}function initSync(e){if(void 0!==Ai)return Ai;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module:e}=e):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const t=__wbg_get_imports();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));return function(e){return Ai=e.exports,Si=null,Ai.__wbindgen_start(),Ai}(new WebAssembly.Instance(e,t))}class ColorSpace{static#n=new Uint8ClampedArray(3);constructor(e,t){this.name=e,this.numComps=t}getRgb(e,t,i=new Uint8ClampedArray(3)){return this.getRgbItem(e,t,i,0),i}getRgbHex(e,t){const i=this.getRgb(e,t,ColorSpace.#n);return ai.makeHexColor(i[0],i[1],i[2])}getRgbItem(e,t,i,n){unreachable$1("Should not call ColorSpace.getRgbItem")}getRgbBuffer(e,t,i,n,a,s,r){unreachable$1("Should not call ColorSpace.getRgbBuffer")}getOutputLength(e,t){unreachable$1("Should not call ColorSpace.getOutputLength")}isPassthrough(e){return!1}isDefaultDecode(e,t){return ColorSpace.isDefaultDecode(e,this.numComps)}fillRgb(e,t,i,n,a,s,r,o,l){const c=t*i;let h=null;const d=1<<r,u=i!==a||t!==n;if(this.isPassthrough(r))h=o;else if(1===this.numComps&&c>d&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){const t=r<=8?new Uint8Array(d):new Uint16Array(d);for(let e=0;e<d;e++)t[e]=e;const i=new Uint8ClampedArray(3*d);if(this.getRgbBuffer(t,0,d,i,0,r,0),u){h=new Uint8Array(3*c);let e=0;for(let t=0;t<c;++t){const n=3*o[t];h[e++]=i[n],h[e++]=i[n+1],h[e++]=i[n+2]}}else{let t=0;for(let n=0;n<c;++n){const a=3*o[n];e[t++]=i[a],e[t++]=i[a+1],e[t++]=i[a+2],t+=l}}}else u?(h=new Uint8ClampedArray(3*c),this.getRgbBuffer(o,0,c,h,0,r,0)):this.getRgbBuffer(o,0,n*s,e,0,r,l);if(h)if(u)!function(e,t,i,n,a,s,r){r=1!==r?0:r;const o=i/a,l=n/s;let c,h=0;const d=new Uint16Array(a),u=3*i;for(let e=0;e<a;e++)d[e]=3*Math.floor(e*o);for(let i=0;i<s;i++){const n=Math.floor(i*l)*u;for(let i=0;i<a;i++)c=n+d[i],t[h++]=e[c++],t[h++]=e[c++],t[h++]=e[c++],h+=r}}(h,e,t,i,n,a,l);else{let t=0,i=0;for(let a=0,r=n*s;a<r;a++)e[t++]=h[i++],e[t++]=h[i++],e[t++]=h[i++],t+=l}}get usesZeroToOneRange(){return shadow$1(this,"usesZeroToOneRange",!0)}static isDefaultDecode(e,t){if(!Array.isArray(e))return!0;if(2*t!==e.length)return warn$1("The decode map is not the correct length"),!0;for(let t=0,i=e.length;t<i;t+=2)if(0!==e[t]||1!==e[t+1])return!1;return!0}}class AlternateCS extends ColorSpace{constructor(e,t,i){super("Alternate",e),this.base=t,this.tintFn=i,this.tmpBuf=new Float32Array(t.numComps)}getRgbItem(e,t,i,n){const a=this.tmpBuf;this.tintFn(e,t,a,0),this.base.getRgbItem(a,0,i,n)}getRgbBuffer(e,t,i,n,a,s,r){const o=this.tintFn,l=this.base,c=1/((1<<s)-1),h=l.numComps,d=l.usesZeroToOneRange,u=(l.isPassthrough(8)||!d)&&0===r;let g=u?a:0;const f=u?n:new Uint8ClampedArray(h*i),p=this.numComps,m=new Float32Array(p),b=new Float32Array(h);let y,w;for(y=0;y<i;y++){for(w=0;w<p;w++)m[w]=e[t++]*c;if(o(m,0,b,0),d)for(w=0;w<h;w++)f[g++]=255*b[w];else l.getRgbItem(b,0,f,g),g+=h}u||l.getRgbBuffer(f,0,i,n,a,8,r)}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps/this.numComps,t)}}class PatternCS extends ColorSpace{constructor(e){super("Pattern",null),this.base=e}isDefaultDecode(e,t){unreachable$1("Should not call PatternCS.isDefaultDecode")}}class IndexedCS extends ColorSpace{constructor(e,t,i){super("Indexed",1),this.base=e,this.highVal=t;const n=e.numComps*(t+1);if(this.lookup=new Uint8Array(n),i instanceof BaseStream){const e=i.getBytes(n);this.lookup.set(e)}else{if("string"!=typeof i)throw new ti(`IndexedCS - unrecognized lookup table: ${i}`);for(let e=0;e<n;++e)this.lookup[e]=255&i.charCodeAt(e)}}getRgbItem(e,t,i,n){const{base:a,highVal:s,lookup:r}=this,o=MathClamp$1(Math.round(e[t]),0,s)*a.numComps;a.getRgbBuffer(r,o,1,i,n,8,0)}getRgbBuffer(e,t,i,n,a,s,r){const{base:o,highVal:l,lookup:c}=this,{numComps:h}=o,d=o.getOutputLength(h,r);for(let s=0;s<i;++s){const i=MathClamp$1(Math.round(e[t++]),0,l)*h;o.getRgbBuffer(c,i,1,n,a,8,r),a+=d}}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps,t)}isDefaultDecode(e,t){return!Array.isArray(e)||(2!==e.length?(warn$1("Decode map length is not correct"),!0):!Number.isInteger(t)||t<1?(warn$1("Bits per component is not correct"),!0):0===e[0]&&e[1]===(1<<t)-1)}}class DeviceGrayCS extends ColorSpace{constructor(){super("DeviceGray",1)}getRgbItem(e,t,i,n){const a=255*e[t];i[n]=i[n+1]=i[n+2]=a}getRgbBuffer(e,t,i,n,a,s,r){const o=255/((1<<s)-1);let l=t,c=a;for(let t=0;t<i;++t){const t=o*e[l++];n[c++]=t,n[c++]=t,n[c++]=t,c+=r}}getOutputLength(e,t){return e*(3+t)}}class DeviceRgbCS extends ColorSpace{constructor(){super("DeviceRGB",3)}getRgbItem(e,t,i,n){i[n]=255*e[t],i[n+1]=255*e[t+1],i[n+2]=255*e[t+2]}getRgbBuffer(e,t,i,n,a,s,r){if(8===s&&0===r)return void n.set(e.subarray(t,t+3*i),a);const o=255/((1<<s)-1);let l=t,c=a;for(let t=0;t<i;++t)n[c++]=o*e[l++],n[c++]=o*e[l++],n[c++]=o*e[l++],c+=r}getOutputLength(e,t){return e*(3+t)/3|0}isPassthrough(e){return 8===e}}class DeviceRgbaCS extends ColorSpace{constructor(){super("DeviceRGBA",4)}getOutputLength(e,t){return 4*e}isPassthrough(e){return 8===e}fillRgb(e,t,i,n,a,s,r,o,l){i!==a||t!==n?function(e,t,i,n,a,s,r){const o=i/a,l=n/s;let c=0;const h=new Uint16Array(a);if(1===r){for(let e=0;e<a;e++)h[e]=Math.floor(e*o);const n=new Uint32Array(e.buffer),r=new Uint32Array(t.buffer),d=FeatureTest.isLittleEndian?16777215:4294967040;for(let e=0;e<s;e++){const t=n.subarray(Math.floor(e*l)*i);for(let e=0;e<a;e++)r[c++]|=t[h[e]]&d}}else{const n=4,r=i*n;for(let e=0;e<a;e++)h[e]=Math.floor(e*o)*n;for(let i=0;i<s;i++){const n=e.subarray(Math.floor(i*l)*r);for(let e=0;e<a;e++){const i=h[e];t[c++]=n[i],t[c++]=n[i+1],t[c++]=n[i+2]}}}}(o,e,t,i,n,a,l):function(e,t,i){if(1===i){const i=new Uint32Array(e.buffer),n=new Uint32Array(t.buffer),a=FeatureTest.isLittleEndian?16777215:4294967040;for(let e=0,t=i.length;e<t;e++)n[e]|=i[e]&a}else{let i=0;for(let n=0,a=e.length;n<a;n+=4)t[i++]=e[n],t[i++]=e[n+1],t[i++]=e[n+2]}}(o,e,l)}}class DeviceCmykCS extends ColorSpace{constructor(){super("DeviceCMYK",4)}#a(e,t,i,n,a){const s=e[t]*i,r=e[t+1]*i,o=e[t+2]*i,l=e[t+3]*i;n[a]=255+s*(-4.387332384609988*s+54.48615194189176*r+18.82290502165302*o+212.25662451639585*l-285.2331026137004)+r*(1.7149763477362134*r-5.6096736904047315*o+-17.873870861415444*l-5.497006427196366)+o*(-2.5217340131683033*o-21.248923337353073*l+17.5119270841813)+l*(-21.86122147463605*l-189.48180835922747),n[a+1]=255+s*(8.841041422036149*s+60.118027045597366*r+6.871425592049007*o+31.159100130055922*l-79.2970844816548)+r*(-15.310361306967817*r+17.575251261109482*o+131.35250912493976*l-190.9453302588951)+o*(4.444339102852739*o+9.8632861493405*l-24.86741582555878)+l*(-20.737325471181034*l-187.80453709719578),n[a+2]=255+s*(.8842522430003296*s+8.078677503112928*r+30.89978309703729*o-.23883238689178934*l-14.183576799673286)+r*(10.49593273432072*r+63.02378494754052*o+50.606957656360734*l-112.23884253719248)+o*(.03296041114873217*o+115.60384449646641*l-193.58209356861505)+l*(-22.33816807309886*l-180.12613974708367)}getRgbItem(e,t,i,n){this.#a(e,t,1,i,n)}getRgbBuffer(e,t,i,n,a,s,r){const o=1/((1<<s)-1);for(let s=0;s<i;s++)this.#a(e,t,o,n,a),t+=4,a+=3+r}getOutputLength(e,t){return e/4*(3+t)|0}}class CalGrayCS extends ColorSpace{constructor(e,t,i){if(super("CalGray",1),!e)throw new ti("WhitePoint missing - required for color space CalGray");if([this.XW,this.YW,this.ZW]=e,[this.XB,this.YB,this.ZB]=t||[0,0,0],this.G=i||1,this.XW<0||this.ZW<0||1!==this.YW)throw new ti(`Invalid WhitePoint components for ${this.name}, no fallback available`);(this.XB<0||this.YB<0||this.ZB<0)&&(info$1(`Invalid BlackPoint for ${this.name}, falling back to default.`),this.XB=this.YB=this.ZB=0),0===this.XB&&0===this.YB&&0===this.ZB||warn$1(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`),this.G<1&&(info$1(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`),this.G=1)}#a(e,t,i,n,a){const s=(e[t]*a)**this.G,r=this.YW*s,o=Math.max(295.8*r**.3333333333333333-40.8,0);i[n]=o,i[n+1]=o,i[n+2]=o}getRgbItem(e,t,i,n){this.#a(e,t,i,n,1)}getRgbBuffer(e,t,i,n,a,s,r){const o=1/((1<<s)-1);for(let s=0;s<i;++s)this.#a(e,t,n,a,o),t+=1,a+=3+r}getOutputLength(e,t){return e*(3+t)}}class CalRGBCS extends ColorSpace{static#s=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]);static#r=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]);static#o=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]);static#l=new Float32Array([1,1,1]);static#c=new Float32Array(3);static#h=new Float32Array(3);static#d=new Float32Array(3);static#u=(24/116)**3/8;constructor(e,t,i,n){if(super("CalRGB",3),!e)throw new ti("WhitePoint missing - required for color space CalRGB");const[a,s,r]=this.whitePoint=e,[o,l,c]=this.blackPoint=t||new Float32Array(3);if([this.GR,this.GG,this.GB]=i||new Float32Array([1,1,1]),[this.MXA,this.MYA,this.MZA,this.MXB,this.MYB,this.MZB,this.MXC,this.MYC,this.MZC]=n||new Float32Array([1,0,0,0,1,0,0,0,1]),a<0||r<0||1!==s)throw new ti(`Invalid WhitePoint components for ${this.name}, no fallback available`);(o<0||l<0||c<0)&&(info$1(`Invalid BlackPoint for ${this.name} [${o}, ${l}, ${c}], falling back to default.`),this.blackPoint=new Float32Array(3)),(this.GR<0||this.GG<0||this.GB<0)&&(info$1(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`),this.GR=this.GG=this.GB=1)}#g(e,t,i){i[0]=e[0]*t[0]+e[1]*t[1]+e[2]*t[2],i[1]=e[3]*t[0]+e[4]*t[1]+e[5]*t[2],i[2]=e[6]*t[0]+e[7]*t[1]+e[8]*t[2]}#f(e,t,i){i[0]=1*t[0]/e[0],i[1]=1*t[1]/e[1],i[2]=1*t[2]/e[2]}#p(e,t,i){i[0]=.95047*t[0]/e[0],i[1]=1*t[1]/e[1],i[2]=1.08883*t[2]/e[2]}#m(e){return e<=.0031308?MathClamp$1(12.92*e,0,1):e>=.99554525?1:MathClamp$1(1.055*e**(1/2.4)-.055,0,1)}#b(e){return e<0?-this.#b(-e):e>8?((e+16)/116)**3:e*CalRGBCS.#u}#y(e,t,i){if(0===e[0]&&0===e[1]&&0===e[2])return i[0]=t[0],i[1]=t[1],void(i[2]=t[2]);const n=this.#b(0),a=(1-n)/(1-this.#b(e[0])),s=1-a,r=(1-n)/(1-this.#b(e[1])),o=1-r,l=(1-n)/(1-this.#b(e[2])),c=1-l;i[0]=t[0]*a+s,i[1]=t[1]*r+o,i[2]=t[2]*l+c}#w(e,t,i){if(1===e[0]&&1===e[2])return i[0]=t[0],i[1]=t[1],void(i[2]=t[2]);const n=i;this.#g(CalRGBCS.#s,t,n);const a=CalRGBCS.#c;this.#f(e,n,a),this.#g(CalRGBCS.#r,a,i)}#A(e,t,i){const n=i;this.#g(CalRGBCS.#s,t,n);const a=CalRGBCS.#c;this.#p(e,n,a),this.#g(CalRGBCS.#r,a,i)}#a(e,t,i,n,a){const s=MathClamp$1(e[t]*a,0,1),r=MathClamp$1(e[t+1]*a,0,1),o=MathClamp$1(e[t+2]*a,0,1),l=1===s?1:s**this.GR,c=1===r?1:r**this.GG,h=1===o?1:o**this.GB,d=this.MXA*l+this.MXB*c+this.MXC*h,u=this.MYA*l+this.MYB*c+this.MYC*h,g=this.MZA*l+this.MZB*c+this.MZC*h,f=CalRGBCS.#h;f[0]=d,f[1]=u,f[2]=g;const p=CalRGBCS.#d;this.#w(this.whitePoint,f,p);const m=CalRGBCS.#h;this.#y(this.blackPoint,p,m);const b=CalRGBCS.#d;this.#A(CalRGBCS.#l,m,b);const y=CalRGBCS.#h;this.#g(CalRGBCS.#o,b,y),i[n]=255*this.#m(y[0]),i[n+1]=255*this.#m(y[1]),i[n+2]=255*this.#m(y[2])}getRgbItem(e,t,i,n){this.#a(e,t,i,n,1)}getRgbBuffer(e,t,i,n,a,s,r){const o=1/((1<<s)-1);for(let s=0;s<i;++s)this.#a(e,t,n,a,o),t+=3,a+=3+r}getOutputLength(e,t){return e*(3+t)/3|0}}class LabCS extends ColorSpace{constructor(e,t,i){if(super("Lab",3),!e)throw new ti("WhitePoint missing - required for color space Lab");if([this.XW,this.YW,this.ZW]=e,[this.amin,this.amax,this.bmin,this.bmax]=i||[-100,100,-100,100],[this.XB,this.YB,this.ZB]=t||[0,0,0],this.XW<0||this.ZW<0||1!==this.YW)throw new ti("Invalid WhitePoint components, no fallback available");(this.XB<0||this.YB<0||this.ZB<0)&&(info$1("Invalid BlackPoint, falling back to default"),this.XB=this.YB=this.ZB=0),(this.amin>this.amax||this.bmin>this.bmax)&&(info$1("Invalid Range, falling back to defaults"),this.amin=-100,this.amax=100,this.bmin=-100,this.bmax=100)}#x(e){return e>=6/29?e**3:108/841*(e-4/29)}#S(e,t,i,n){return i+e*(n-i)/t}#a(e,t,i,n,a){let s=e[t],r=e[t+1],o=e[t+2];!1!==i&&(s=this.#S(s,i,0,100),r=this.#S(r,i,this.amin,this.amax),o=this.#S(o,i,this.bmin,this.bmax)),r>this.amax?r=this.amax:r<this.amin&&(r=this.amin),o>this.bmax?o=this.bmax:o<this.bmin&&(o=this.bmin);const l=(s+16)/116,c=l+r/500,h=l-o/200,d=this.XW*this.#x(c),u=this.YW*this.#x(l),g=this.ZW*this.#x(h);let f,p,m;this.ZW<1?(f=3.1339*d+-1.617*u+-.4906*g,p=-.9785*d+1.916*u+.0333*g,m=.072*d+-.229*u+1.4057*g):(f=3.2406*d+-1.5372*u+-.4986*g,p=-.9689*d+1.8758*u+.0415*g,m=.0557*d+-.204*u+1.057*g),n[a]=255*Math.sqrt(f),n[a+1]=255*Math.sqrt(p),n[a+2]=255*Math.sqrt(m)}getRgbItem(e,t,i,n){this.#a(e,t,!1,i,n)}getRgbBuffer(e,t,i,n,a,s,r){const o=(1<<s)-1;for(let s=0;s<i;s++)this.#a(e,t,o,n,a),t+=3,a+=3+r}getOutputLength(e,t){return e*(3+t)/3|0}isDefaultDecode(e,t){return!0}get usesZeroToOneRange(){return shadow$1(this,"usesZeroToOneRange",!1)}}function fetchSync(e){const t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),t.response}class IccColorSpace extends ColorSpace{#v;#C;static#k=!0;static#T=null;static#F=null;constructor(e,t,i){if(!IccColorSpace.isUsable)throw new Error("No ICC color space support");let n;switch(super(t,i),i){case 1:n=Ci.Gray8,this.#C=(e,t,i)=>function(e,t,i){Ai.qcms_convert_one(e,t,i)}(this.#v,255*e[t],i);break;case 3:n=Ci.RGB8,this.#C=(e,t,i)=>function(e,t,i,n,a){Ai.qcms_convert_three(e,t,i,n,a)}(this.#v,255*e[t],255*e[t+1],255*e[t+2],i);break;case 4:n=Ci.CMYK,this.#C=(e,t,i)=>function(e,t,i,n,a,s){Ai.qcms_convert_four(e,t,i,n,a,s)}(this.#v,255*e[t],255*e[t+1],255*e[t+2],255*e[t+3],i);break;default:throw new Error(`Unsupported number of components: ${i}`)}if(this.#v=function(e,t,i){const n=passArray8ToWasm0(e,Ai.__wbindgen_malloc),a=vi;return Ai.qcms_transformer_from_memory(n,a,t,i)>>>0}(e,n,ki.Perceptual),!this.#v)throw new Error("Failed to create ICC color space");IccColorSpace.#F||=new FinalizationRegistry(e=>{!function(e){Ai.qcms_drop_transformer(e)}(e)}),IccColorSpace.#F.register(this,this.#v)}getRgbHex(e,t){return this.#C(e,t,!0),QCMS._cssColor}getRgbItem(e,t,i,n){QCMS._destBuffer=i,QCMS._destOffset=n,QCMS._destLength=3,this.#C(e,t,!1),QCMS._destBuffer=null}getRgbBuffer(e,t,i,n,a,s,r){if(e=e.subarray(t,t+i*this.numComps),8!==s){const t=255/((1<<s)-1);for(let i=0,n=e.length;i<n;i++)e[i]*=t}QCMS._mustAddAlpha=r&&n.buffer===e.buffer,QCMS._destBuffer=n,QCMS._destOffset=a,QCMS._destLength=i*(3+r),function(e,t){const i=passArray8ToWasm0(t,Ai.__wbindgen_malloc),n=vi;Ai.qcms_convert_array(e,i,n)}(this.#v,e),QCMS._mustAddAlpha=!1,QCMS._destBuffer=null}getOutputLength(e,t){return e/this.numComps*(3+t)|0}static setOptions({useWasm:e,useWorkerFetch:t,wasmUrl:i}){t?(this.#k=e,this.#T=i):this.#k=!1}static get isUsable(){let e=!1;if(this.#k)if(this.#T)try{this._module=initSync({module:fetchSync(`${this.#T}qcms_bg.wasm`)}),e=!!this._module,QCMS._memory=this._module.memory,QCMS._makeHexColor=ai.makeHexColor}catch(e){warn$1(`ICCBased color space: "${e}".`)}else warn$1("No ICC color space support due to missing `wasmUrl` API option");return shadow$1(this,"isUsable",e)}}class CmykICCBasedCS extends IccColorSpace{static#I;constructor(){super(new Uint8Array(fetchSync(`${CmykICCBasedCS.#I}CGATS001Compat-v2-micro.icc`)),"DeviceCMYK",4)}static setOptions({iccUrl:e}){this.#I=e}static get isUsable(){let e=!1;return IccColorSpace.isUsable&&(this.#I?e=!0:warn$1("No CMYK ICC profile support due to missing `iccUrl` API option")),shadow$1(this,"isUsable",e)}}class Stream extends BaseStream{constructor(e,t,i,n){super(),this.bytes=e instanceof Uint8Array?e:new Uint8Array(e),this.start=t||0,this.pos=this.start,this.end=t+i||this.bytes.length,this.dict=n}get length(){return this.end-this.start}get isEmpty(){return 0===this.length}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(e){const t=this.bytes,i=this.pos,n=this.end;if(!e)return t.subarray(i,n);let a=i+e;return a>n&&(a=n),this.pos=a,t.subarray(i,a)}getByteRange(e,t){return e<0&&(e=0),t>this.end&&(t=this.end),this.bytes.subarray(e,t)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(e,t,i=null){return new Stream(this.bytes.buffer,e,t,i)}}class StringStream extends Stream{constructor(e){super(stringToBytes$1(e))}}class NullStream extends Stream{constructor(){super(new Uint8Array(0))}}class ChunkedStream extends Stream{constructor(e,t,i){super(new Uint8Array(e),0,e,null),this.chunkSize=t,this._loadedChunks=new Set,this.numChunks=Math.ceil(e/t),this.manager=i,this.progressiveDataLength=0,this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){const e=[];for(let t=0,i=this.numChunks;t<i;++t)this._loadedChunks.has(t)||e.push(t);return e}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(e,t){const i=this.chunkSize;if(e%i!==0)throw new Error(`Bad begin offset: ${e}`);const n=e+t.byteLength;if(n%i!==0&&n!==this.bytes.length)throw new Error(`Bad end offset: ${n}`);this.bytes.set(new Uint8Array(t),e);const a=Math.floor(e/i),s=Math.floor((n-1)/i)+1;for(let e=a;e<s;++e)this._loadedChunks.add(e)}onReceiveProgressiveData(e){let t=this.progressiveDataLength;const i=Math.floor(t/this.chunkSize);this.bytes.set(new Uint8Array(e),t),t+=e.byteLength,this.progressiveDataLength=t;const n=t>=this.end?this.numChunks:Math.floor(t/this.chunkSize);for(let e=i;e<n;++e)this._loadedChunks.add(e)}ensureByte(e){if(e<this.progressiveDataLength)return;const t=Math.floor(e/this.chunkSize);if(!(t>this.numChunks)&&t!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(t))throw new MissingDataException(e,e+1);this.lastSuccessfulEnsureByteChunk=t}}ensureRange(e,t){if(e>=t)return;if(t<=this.progressiveDataLength)return;const i=Math.floor(e/this.chunkSize);if(i>this.numChunks)return;const n=Math.min(Math.floor((t-1)/this.chunkSize)+1,this.numChunks);for(let a=i;a<n;++a)if(!this._loadedChunks.has(a))throw new MissingDataException(e,t)}nextEmptyChunk(e){const t=this.numChunks;for(let i=0;i<t;++i){const n=(e+i)%t;if(!this._loadedChunks.has(n))return n}return null}hasChunk(e){return this._loadedChunks.has(e)}getByte(){const e=this.pos;return e>=this.end?-1:(e>=this.progressiveDataLength&&this.ensureByte(e),this.bytes[this.pos++])}getBytes(e){const t=this.bytes,i=this.pos,n=this.end;if(!e)return n>this.progressiveDataLength&&this.ensureRange(i,n),t.subarray(i,n);let a=i+e;return a>n&&(a=n),a>this.progressiveDataLength&&this.ensureRange(i,a),this.pos=a,t.subarray(i,a)}getByteRange(e,t){return e<0&&(e=0),t>this.end&&(t=this.end),t>this.progressiveDataLength&&this.ensureRange(e,t),this.bytes.subarray(e,t)}makeSubStream(e,t,i=null){function ChunkedStreamSubstream(){}t?e+t>this.progressiveDataLength&&this.ensureRange(e,e+t):e>=this.progressiveDataLength&&this.ensureByte(e),ChunkedStreamSubstream.prototype=Object.create(this),ChunkedStreamSubstream.prototype.getMissingChunks=function(){const e=this.chunkSize,t=Math.floor(this.start/e),i=Math.floor((this.end-1)/e)+1,n=[];for(let e=t;e<i;++e)this._loadedChunks.has(e)||n.push(e);return n},Object.defineProperty(ChunkedStreamSubstream.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks||0===this.getMissingChunks().length},configurable:!0});const n=new ChunkedStreamSubstream;return n.pos=n.start=e,n.end=e+t||this.end,n.dict=i,n}getBaseStreams(){return[this]}}class ChunkedStreamManager{constructor(e,t){this.length=t.length,this.chunkSize=t.rangeChunkSize,this.stream=new ChunkedStream(this.length,this.chunkSize,this),this.pdfNetworkStream=e,this.disableAutoFetch=t.disableAutoFetch,this.msgHandler=t.msgHandler,this.currRequestId=0,this._chunksNeededByRequest=new Map,this._requestsByChunk=new Map,this._promisesByRequest=new Map,this.progressiveDataLength=0,this.aborted=!1,this._loadedStreamCapability=Promise.withResolvers()}sendRequest(e,t){const i=this.pdfNetworkStream.getRangeReader(e,t);i.isStreamingSupported||(i.onProgress=this.onProgress.bind(this));let n=[],a=0;return new Promise((e,t)=>{const readChunk=({value:s,done:r})=>{try{if(r){const t=arrayBuffersToBytes(n);return n=null,void e(t)}a+=s.byteLength,i.isStreamingSupported&&this.onProgress({loaded:a}),n.push(s),i.read().then(readChunk,t)}catch(e){t(e)}};i.read().then(readChunk,t)}).then(t=>{this.aborted||this.onReceiveData({chunk:t,begin:e})})}requestAllChunks(e=!1){if(!e){const e=this.stream.getMissingChunks();this._requestChunks(e)}return this._loadedStreamCapability.promise}_requestChunks(e){const t=this.currRequestId++,i=new Set;this._chunksNeededByRequest.set(t,i);for(const t of e)this.stream.hasChunk(t)||i.add(t);if(0===i.size)return Promise.resolve();const n=Promise.withResolvers();this._promisesByRequest.set(t,n);const a=[];for(const e of i){let i=this._requestsByChunk.get(e);i||(i=[],this._requestsByChunk.set(e,i),a.push(e)),i.push(t)}if(a.length>0){const e=this.groupChunks(a);for(const t of e){const e=t.beginChunk*this.chunkSize,i=Math.min(t.endChunk*this.chunkSize,this.length);this.sendRequest(e,i).catch(n.reject)}}return n.promise.catch(e=>{if(!this.aborted)throw e})}getStream(){return this.stream}requestRange(e,t){t=Math.min(t,this.length);const i=this.getBeginChunk(e),n=this.getEndChunk(t),a=[];for(let e=i;e<n;++e)a.push(e);return this._requestChunks(a)}requestRanges(e=[]){const t=[];for(const i of e){const e=this.getBeginChunk(i.begin),n=this.getEndChunk(i.end);for(let i=e;i<n;++i)t.includes(i)||t.push(i)}return t.sort((e,t)=>e-t),this._requestChunks(t)}groupChunks(e){const t=[];let i=-1,n=-1;for(let a=0,s=e.length;a<s;++a){const s=e[a];i<0&&(i=s),n>=0&&n+1!==s&&(t.push({beginChunk:i,endChunk:n+1}),i=s),a+1===e.length&&t.push({beginChunk:i,endChunk:s+1}),n=s}return t}onProgress(e){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}onReceiveData(e){const t=e.chunk,i=void 0===e.begin,n=i?this.progressiveDataLength:e.begin,a=n+t.byteLength,s=Math.floor(n/this.chunkSize),r=a<this.length?Math.floor(a/this.chunkSize):Math.ceil(a/this.chunkSize);i?(this.stream.onReceiveProgressiveData(t),this.progressiveDataLength=a):this.stream.onReceiveData(n,t),this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);const o=[];for(let e=s;e<r;++e){const t=this._requestsByChunk.get(e);if(t){this._requestsByChunk.delete(e);for(const i of t){const t=this._chunksNeededByRequest.get(i);t.has(e)&&t.delete(e),t.size>0||o.push(i)}}}if(!this.disableAutoFetch&&0===this._requestsByChunk.size){let e;if(1===this.stream.numChunksLoaded){const t=this.stream.numChunks-1;this.stream.hasChunk(t)||(e=t)}else e=this.stream.nextEmptyChunk(r);Number.isInteger(e)&&this._requestChunks([e])}for(const e of o){const t=this._promisesByRequest.get(e);this._promisesByRequest.delete(e),t.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(e){this._loadedStreamCapability.reject(e)}getBeginChunk(e){return Math.floor(e/this.chunkSize)}getEndChunk(e){return Math.floor((e-1)/this.chunkSize)+1}abort(e){this.aborted=!0,this.pdfNetworkStream?.cancelAllRequests(e);for(const t of this._promisesByRequest.values())t.reject(e)}}function convertToRGBA(e){switch(e.kind){case v:return convertBlackAndWhiteToRGBA$1(e);case C:return function({src:e,srcPos:t=0,dest:i,destPos:n=0,width:a,height:s}){let r=0;const o=a*s*3,l=o>>2,c=new Uint32Array(e.buffer,t,l);if(FeatureTest.isLittleEndian){for(;r<l-2;r+=3,n+=4){const e=c[r],t=c[r+1],a=c[r+2];i[n]=4278190080|e,i[n+1]=e>>>24|t<<8|4278190080,i[n+2]=t>>>16|a<<16|4278190080,i[n+3]=a>>>8|4278190080}for(let a=4*r,s=t+o;a<s;a+=3)i[n++]=e[a]|e[a+1]<<8|e[a+2]<<16|4278190080}else{for(;r<l-2;r+=3,n+=4){const e=c[r],t=c[r+1],a=c[r+2];i[n]=255|e,i[n+1]=e<<24|t>>>8|255,i[n+2]=t<<16|a>>>16|255,i[n+3]=a<<8|255}for(let a=4*r,s=t+o;a<s;a+=3)i[n++]=e[a]<<24|e[a+1]<<16|e[a+2]<<8|255}return{srcPos:t+o,destPos:n}}(e)}return null}function convertBlackAndWhiteToRGBA$1({src:e,srcPos:t=0,dest:i,width:n,height:a,nonBlackColor:s=4294967295,inverseDecode:r=!1}){const o=FeatureTest.isLittleEndian?4278190080:255,[l,c]=r?[s,o]:[o,s],h=n>>3,d=7&n,u=e.length;i=new Uint32Array(i.buffer);let g=0;for(let n=0;n<a;n++){for(const n=t+h;t<n;t++){const n=t<u?e[t]:255;i[g++]=128&n?c:l,i[g++]=64&n?c:l,i[g++]=32&n?c:l,i[g++]=16&n?c:l,i[g++]=8&n?c:l,i[g++]=4&n?c:l,i[g++]=2&n?c:l,i[g++]=1&n?c:l}if(0===d)continue;const n=t<u?e[t++]:255;for(let e=0;e<d;e++)i[g++]=n&1<<7-e?c:l}return{srcPos:t,destPos:g}}class ImageResizer{static#E=2048;static#M=FeatureTest.isImageDecoderSupported;constructor(e,t){this._imgData=e,this._isMask=t}static get canUseImageDecoder(){return shadow$1(this,"canUseImageDecoder",this.#M?ImageDecoder.isTypeSupported("image/bmp"):Promise.resolve(!1))}static needsToBeResized(e,t){if(e<=this.#E&&t<=this.#E)return!1;const{MAX_DIM:i}=this;if(e>i||t>i)return!0;const n=e*t;if(this._hasMaxArea)return n>this.MAX_AREA;if(n<this.#E**2)return!1;if(this._areGoodDims(e,t))return this.#E=Math.max(this.#E,Math.floor(Math.sqrt(e*t))),!1;this.#E=this._guessMax(this.#E,i,128,0);return n>(this.MAX_AREA=this.#E**2)}static getReducePowerForJPX(e,t,i){const n=e*t,a=2**30/(4*i);if(!this.needsToBeResized(e,t))return n>a?Math.ceil(Math.log2(n/a)):0;const{MAX_DIM:s,MAX_AREA:r}=this,o=Math.max(e/s,t/s,Math.sqrt(n/Math.min(a,r)));return Math.ceil(Math.log2(o))}static get MAX_DIM(){return shadow$1(this,"MAX_DIM",this._guessMax(2048,65537,0,1))}static get MAX_AREA(){return this._hasMaxArea=!0,shadow$1(this,"MAX_AREA",this._guessMax(this.#E,this.MAX_DIM,128,0)**2)}static set MAX_AREA(e){e>=0&&(this._hasMaxArea=!0,shadow$1(this,"MAX_AREA",e))}static setOptions({canvasMaxAreaInBytes:e=-1,isImageDecoderSupported:t=!1}){this._hasMaxArea||(this.MAX_AREA=e>>2),this.#M=t}static _areGoodDims(e,t){try{const i=new OffscreenCanvas(e,t),n=i.getContext("2d");n.fillRect(0,0,1,1);const a=n.getImageData(0,0,1,1).data[3];return i.width=i.height=1,0!==a}catch{return!1}}static _guessMax(e,t,i,n){for(;e+i+1<t;){const i=Math.floor((e+t)/2),a=n||i;this._areGoodDims(i,a)?e=i:t=i}return e}static async createImage(e,t=!1){return new ImageResizer(e,t)._createImage()}async _createImage(){const{_imgData:e}=this,{width:t,height:i}=e;if(t*i*4>fi){const e=this.#D();if(e)return e}const n=this._encodeBMP();let a,s;await ImageResizer.canUseImageDecoder?(a=new ImageDecoder({data:n,type:"image/bmp",preferAnimation:!1,transfer:[n.buffer]}),s=a.decode().catch(e=>(warn$1(`BMP image decoding failed: ${e}`),createImageBitmap(new Blob([this._encodeBMP().buffer],{type:"image/bmp"})))).finally(()=>{a.close()})):s=createImageBitmap(new Blob([n.buffer],{type:"image/bmp"}));const{MAX_AREA:r,MAX_DIM:o}=ImageResizer,l=Math.max(t/o,i/o,Math.sqrt(t*i/r)),c=Math.max(l,2),h=Math.round(10*(l+1.25))/10/c,d=Math.floor(Math.log2(h)),u=new Array(d+2).fill(2);u[0]=c,u.splice(-1,1,h/(1<<d));let g=t,f=i;const p=await s;let m=p.image||p;for(const e of u){const t=g,i=f;g=Math.floor(g/e)-1,f=Math.floor(f/e)-1;const n=new OffscreenCanvas(g,f);n.getContext("2d").drawImage(m,0,0,t,i,0,0,g,f),m.close(),m=n.transferToImageBitmap()}return e.data=null,e.bitmap=m,e.width=g,e.height=f,e}#D(){const{_imgData:e}=this,{data:t,width:i,height:n,kind:a}=e,s=i*n*4,r=Math.ceil(Math.log2(s/fi)),o=i>>r,l=n>>r;let c,h=n;try{c=new Uint8Array(s)}catch{let e=Math.floor(Math.log2(s+1));for(;;)try{c=new Uint8Array(2**e-1);break}catch{e-=1}h=Math.floor((2**e-1)/(4*i));const t=i*h*4;t<c.length&&(c=new Uint8Array(t))}const d=new Uint32Array(c.buffer),u=new Uint32Array(o*l);let g=0,f=0;const p=Math.ceil(n/h),m=n%h===0?n:n%h;for(let e=0;e<p;e++){const n=e<p-1?h:m;({srcPos:g}=convertToRGBA({kind:a,src:t,dest:d,width:i,height:n,inverseDecode:this._isMask,srcPos:g}));for(let e=0,t=n>>r;e<t;e++){const t=d.subarray((e<<r)*i);for(let e=0;e<o;e++)u[f++]=t[e<<r]}}if(ImageResizer.needsToBeResized(o,l))return e.data=u,e.width=o,e.height=l,e.kind=k,null;const b=new OffscreenCanvas(o,l);return b.getContext("2d",{willReadFrequently:!0}).putImageData(new ImageData(new Uint8ClampedArray(u.buffer),o,l),0,0),e.data=null,e.bitmap=b.transferToImageBitmap(),e.width=o,e.height=l,e}_encodeBMP(){const{width:e,height:t,kind:i}=this._imgData;let n,a=this._imgData.data,s=new Uint8Array(0),r=s,o=0;switch(i){case v:{n=1,s=new Uint8Array(this._isMask?[255,255,255,255,0,0,0,0]:[0,0,0,0,255,255,255,255]);const i=e+7>>3,r=i+3&-4;if(i!==r){const e=new Uint8Array(r*t);let n=0;for(let s=0,o=t*i;s<o;s+=i,n+=r)e.set(a.subarray(s,s+i),n);a=e}break}case C:if(n=24,3&e){const i=3*e,n=i+3&-4,s=n-i,r=new Uint8Array(n*t);let o=0;for(let e=0,n=t*i;e<n;e+=i){const t=a.subarray(e,e+i);for(let e=0;e<i;e+=3)r[o++]=t[e+2],r[o++]=t[e+1],r[o++]=t[e];o+=s}a=r}else for(let e=0,t=a.length;e<t;e+=3){const t=a[e];a[e]=a[e+2],a[e+2]=t}break;case k:n=32,o=3,r=new Uint8Array(68);const i=new DataView(r.buffer);FeatureTest.isLittleEndian?(i.setUint32(0,255,!0),i.setUint32(4,65280,!0),i.setUint32(8,16711680,!0),i.setUint32(12,4278190080,!0)):(i.setUint32(0,4278190080,!0),i.setUint32(4,16711680,!0),i.setUint32(8,65280,!0),i.setUint32(12,255,!0));break;default:throw new Error("invalid format")}let l=0;const c=40+r.length,h=14+c+s.length+a.length,d=new Uint8Array(h),u=new DataView(d.buffer);return u.setUint16(l,19778,!0),l+=2,u.setUint32(l,h,!0),l+=4,u.setUint32(l,0,!0),l+=4,u.setUint32(l,14+c+s.length,!0),l+=4,u.setUint32(l,c,!0),l+=4,u.setInt32(l,e,!0),l+=4,u.setInt32(l,-t,!0),l+=4,u.setUint16(l,1,!0),l+=2,u.setUint16(l,n,!0),l+=2,u.setUint32(l,o,!0),l+=4,u.setUint32(l,0,!0),l+=4,u.setInt32(l,0,!0),l+=4,u.setInt32(l,0,!0),l+=4,u.setUint32(l,s.length/4,!0),l+=4,u.setUint32(l,0,!0),l+=4,d.set(r,l),l+=r.length,d.set(s,l),l+=s.length,d.set(a,l),d}}const Ti=new Uint8Array(0);class DecodeStream extends BaseStream{constructor(e){if(super(),this._rawMinBufferLength=e||0,this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=Ti,this.minBufferLength=512,e)for(;this.minBufferLength<e;)this.minBufferLength*=2}get isEmpty(){for(;!this.eof&&0===this.bufferLength;)this.readBlock();return 0===this.bufferLength}ensureBuffer(e){const t=this.buffer;if(e<=t.byteLength)return t;let i=this.minBufferLength;for(;i<e;)i*=2;const n=new Uint8Array(i);return n.set(t),this.buffer=n}getByte(){const e=this.pos;for(;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}getBytes(e,t=null){const i=this.pos;let n;if(e){for(this.ensureBuffer(i+e),n=i+e;!this.eof&&this.bufferLength<n;)this.readBlock(t);const a=this.bufferLength;n>a&&(n=a)}else{for(;!this.eof;)this.readBlock(t);n=this.bufferLength}return this.pos=n,this.buffer.subarray(i,n)}async getImageData(e,t){if(!this.canAsyncDecodeImageFromBuffer)return this.isAsyncDecoder?this.decodeImage(null,t):this.getBytes(e,t);const i=await this.stream.asyncGetBytes();return this.decodeImage(i,t)}reset(){this.pos=0}makeSubStream(e,t,i=null){if(void 0===t)for(;!this.eof;)this.readBlock();else{const i=e+t;for(;this.bufferLength<=i&&!this.eof;)this.readBlock()}return new Stream(this.buffer,e,t,i)}getBaseStreams(){return this.str?this.str.getBaseStreams():null}}class StreamsSequenceStream extends DecodeStream{constructor(e,t=null){e=e.filter(e=>e instanceof BaseStream);let i=0;for(const t of e)i+=t instanceof DecodeStream?t._rawMinBufferLength:t.length;super(i),this.streams=e,this._onError=t}readBlock(){const e=this.streams;if(0===e.length)return void(this.eof=!0);const t=e.shift();let i;try{i=t.getBytes()}catch(e){if(this._onError)return void this._onError(e,t.dict?.objId);throw e}const n=this.bufferLength,a=n+i.length;this.ensureBuffer(a).set(i,n),this.bufferLength=a}getBaseStreams(){const e=[];for(const t of this.streams){const i=t.getBaseStreams();i&&e.push(...i)}return e.length>0?e:null}}class ColorSpaceUtils{static parse({cs:e,xref:t,resources:i=null,pdfFunctionFactory:n,globalColorSpaceCache:a,localColorSpaceCache:s,asyncIfNotCached:r=!1}){const o={xref:t,resources:i,pdfFunctionFactory:n,globalColorSpaceCache:a,localColorSpaceCache:s};let l,c,h;if(e instanceof Ref){c=e;const i=a.getByRef(c)||s.getByRef(c);if(i)return i;e=t.fetch(e)}if(e instanceof Name){l=e.name;const t=s.getByName(l);if(t)return t}try{h=this.#O(e,o)}catch(e){if(r&&!(e instanceof MissingDataException))return Promise.reject(e);throw e}return(l||c)&&(s.set(l,c,h),c&&a.set(null,c,h)),r?Promise.resolve(h):h}static#_(e,t){const{globalColorSpaceCache:i}=t;let n;if(e instanceof Ref){n=e;const t=i.getByRef(n);if(t)return t}const a=this.#O(e,t);return n&&i.set(null,n,a),a}static#O(e,t){const{xref:i,resources:n,pdfFunctionFactory:a,globalColorSpaceCache:s}=t;if((e=i.fetchIfRef(e))instanceof Name)switch(e.name){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"DeviceRGBA":return this.rgba;case"CMYK":case"DeviceCMYK":return this.cmyk;case"Pattern":return new PatternCS(null);default:if(n instanceof Dict){const i=n.get("ColorSpace");if(i instanceof Dict){const n=i.get(e.name);if(n){if(n instanceof Name)return this.#O(n,t);e=n;break}}}return warn$1(`Unrecognized ColorSpace: ${e.name}`),this.gray}if(Array.isArray(e)){const n=i.fetchIfRef(e[0]).name;let r,o,l,c,h,d;switch(n){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"CMYK":case"DeviceCMYK":return this.cmyk;case"CalGray":return r=i.fetchIfRef(e[1]),c=r.getArray("WhitePoint"),h=r.getArray("BlackPoint"),d=r.get("Gamma"),new CalGrayCS(c,h,d);case"CalRGB":r=i.fetchIfRef(e[1]),c=r.getArray("WhitePoint"),h=r.getArray("BlackPoint"),d=r.getArray("Gamma");const u=r.getArray("Matrix");return new CalRGBCS(c,h,d,u);case"ICCBased":const g=e[1]instanceof Ref;if(g){const t=s.getByRef(e[1]);if(t)return t}const f=i.fetchIfRef(e[1]),p=f.dict;if(o=p.get("N"),IccColorSpace.isUsable)try{const t=new IccColorSpace(f.getBytes(),"ICCBased",o);return g&&s.set(null,e[1],t),t}catch(t){if(t instanceof MissingDataException)throw t;warn$1(`ICCBased color space (${e[1]}): "${t}".`)}const m=p.getRaw("Alternate");if(m){const e=this.#_(m,t);if(e.numComps===o)return e;warn$1("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(1===o)return this.gray;if(3===o)return this.rgb;if(4===o)return this.cmyk;break;case"Pattern":return l=e[1]||null,l&&(l=this.#_(l,t)),new PatternCS(l);case"I":case"Indexed":l=this.#_(e[1],t);const b=MathClamp$1(i.fetchIfRef(e[2]),0,255),y=i.fetchIfRef(e[3]);return new IndexedCS(l,b,y);case"Separation":case"DeviceN":const w=i.fetchIfRef(e[1]);o=Array.isArray(w)?w.length:1,l=this.#_(e[2],t);const x=a.create(e[3]);return new AlternateCS(o,l,x);case"Lab":r=i.fetchIfRef(e[1]),c=r.getArray("WhitePoint"),h=r.getArray("BlackPoint");const S=r.getArray("Range");return new LabCS(c,h,S);default:return warn$1(`Unimplemented ColorSpace object: ${n}`),this.gray}}return warn$1(`Unrecognized ColorSpace object: ${e}`),this.gray}static get gray(){return shadow$1(this,"gray",new DeviceGrayCS)}static get rgb(){return shadow$1(this,"rgb",new DeviceRgbCS)}static get rgba(){return shadow$1(this,"rgba",new DeviceRgbaCS)}static get cmyk(){if(CmykICCBasedCS.isUsable)try{return shadow$1(this,"cmyk",new CmykICCBasedCS)}catch{warn$1("CMYK fallback: DeviceCMYK")}return shadow$1(this,"cmyk",new DeviceCmykCS)}}class JpegError extends Yt{constructor(e){super(e,"JpegError")}}class DNLMarkerError extends Yt{constructor(e,t){super(e,"DNLMarkerError"),this.scanLines=t}}class EOIMarkerError extends Yt{constructor(e){super(e,"EOIMarkerError")}}const Fi=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),Ii=4017,Ei=799,Mi=3406,Di=2276,Oi=1567,_i=3784,Pi=5793,Ri=2896;function buildHuffmanTable(e,t){let i,n,a=0,s=16;for(;s>0&&!e[s-1];)s--;const r=[{children:[],index:0}];let o,l=r[0];for(i=0;i<s;i++){for(n=0;n<e[i];n++){for(l=r.pop(),l.children[l.index]=t[a];l.index>0;)l=r.pop();for(l.index++,r.push(l);r.length<=i;)r.push(o={children:[],index:0}),l.children[l.index]=o.children,l=o;a++}i+1<s&&(r.push(o={children:[],index:0}),l.children[l.index]=o.children,l=o)}return r[0].children}function getBlockBufferOffset(e,t,i){return 64*((e.blocksPerLine+1)*t+i)}function decodeScan(e,t,i,n,a,s,r,o,l,c=!1){const h=i.mcusPerLine,d=i.progressive,u=t;let g=0,f=0;function readBit(){if(f>0)return f--,g>>f&1;if(g=e[t++],255===g){const n=e[t++];if(n){if(220===n&&c){const n=readUint16(e,t+=2);if(t+=2,n>0&&n!==i.scanLines)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",n)}else if(217===n){if(c){const e=y*(8===i.precision?8:0);if(e>0&&Math.round(i.scanLines/e)>=5)throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",e)}throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data")}throw new JpegError(`unexpected marker ${(g<<8|n).toString(16)}`)}}return f=7,g>>>7}function decodeHuffman(e){let t=e;for(;;){switch(t=t[readBit()],typeof t){case"number":return t;case"object":continue}throw new JpegError("invalid huffman sequence")}}function receive(e){let t=0;for(;e>0;)t=t<<1|readBit(),e--;return t}function receiveAndExtend(e){if(1===e)return 1===readBit()?1:-1;const t=receive(e);return t>=1<<e-1?t:t+(-1<<e)+1}let p=0;let m,b=0;let y=0;function decodeMcu(e,t,i,n,a){const s=i%h;y=(i/h|0)*e.v+n;const r=s*e.h+a;t(e,getBlockBufferOffset(e,y,r))}function decodeBlock(e,t,i){y=i/e.blocksPerLine|0;const n=i%e.blocksPerLine;t(e,getBlockBufferOffset(e,y,n))}const w=n.length;let x,S,v,C,k,T;T=d?0===s?0===o?function(e,t){const i=decodeHuffman(e.huffmanTableDC),n=0===i?0:receiveAndExtend(i)<<l;e.blockData[t]=e.pred+=n}:function(e,t){e.blockData[t]|=readBit()<<l}:0===o?function(e,t){if(p>0)return void p--;let i=s;const n=r;for(;i<=n;){const n=decodeHuffman(e.huffmanTableAC),a=15&n,s=n>>4;if(0===a){if(s<15){p=receive(s)+(1<<s)-1;break}i+=16;continue}i+=s;const r=Fi[i];e.blockData[t+r]=receiveAndExtend(a)*(1<<l),i++}}:function(e,t){let i=s;const n=r;let a,o,c=0;for(;i<=n;){const n=t+Fi[i],s=e.blockData[n]<0?-1:1;switch(b){case 0:if(o=decodeHuffman(e.huffmanTableAC),a=15&o,c=o>>4,0===a)c<15?(p=receive(c)+(1<<c),b=4):(c=16,b=1);else{if(1!==a)throw new JpegError("invalid ACn encoding");m=receiveAndExtend(a),b=c?2:3}continue;case 1:case 2:e.blockData[n]?e.blockData[n]+=s*(readBit()<<l):(c--,0===c&&(b=2===b?3:0));break;case 3:e.blockData[n]?e.blockData[n]+=s*(readBit()<<l):(e.blockData[n]=m<<l,b=0);break;case 4:e.blockData[n]&&(e.blockData[n]+=s*(readBit()<<l))}i++}4===b&&(p--,0===p&&(b=0))}:function(e,t){const i=decodeHuffman(e.huffmanTableDC),n=0===i?0:receiveAndExtend(i);e.blockData[t]=e.pred+=n;let a=1;for(;a<64;){const i=decodeHuffman(e.huffmanTableAC),n=15&i,s=i>>4;if(0===n){if(s<15)break;a+=16;continue}a+=s;const r=Fi[a];e.blockData[t+r]=receiveAndExtend(n),a++}};let F,E=0;const M=1===w?n[0].blocksPerLine*n[0].blocksPerColumn:h*i.mcusPerColumn;let D,O;for(;E<=M;){const i=a?Math.min(M-E,a):M;if(i>0){for(S=0;S<w;S++)n[S].pred=0;if(p=0,1===w)for(x=n[0],k=0;k<i;k++)decodeBlock(x,T,E),E++;else for(k=0;k<i;k++){for(S=0;S<w;S++)for(x=n[S],D=x.h,O=x.v,v=0;v<O;v++)for(C=0;C<D;C++)decodeMcu(x,T,E,v,C);E++}}if(f=0,F=findNextFileMarker(e,t),!F)break;if(F.invalid){warn$1(`decodeScan - ${i>0?"unexpected":"excessive"} MCU data, current marker is: ${F.invalid}`),t=F.offset}if(!(F.marker>=65488&&F.marker<=65495))break;t+=2}return t-u}function quantizeAndInverse(e,t,i){const n=e.quantizationTable,a=e.blockData;let s,r,o,l,c,h,d,u,g,f,p,m,b,y,w,x,S;if(!n)throw new JpegError("missing required Quantization Table.");for(let e=0;e<64;e+=8)g=a[t+e],f=a[t+e+1],p=a[t+e+2],m=a[t+e+3],b=a[t+e+4],y=a[t+e+5],w=a[t+e+6],x=a[t+e+7],g*=n[e],0!==(f|p|m|b|y|w|x)?(f*=n[e+1],p*=n[e+2],m*=n[e+3],b*=n[e+4],y*=n[e+5],w*=n[e+6],x*=n[e+7],s=Pi*g+128>>8,r=Pi*b+128>>8,o=p,l=w,c=Ri*(f-x)+128>>8,u=Ri*(f+x)+128>>8,h=m<<4,d=y<<4,s=s+r+1>>1,r=s-r,S=o*_i+l*Oi+128>>8,o=o*Oi-l*_i+128>>8,l=S,c=c+d+1>>1,d=c-d,u=u+h+1>>1,h=u-h,s=s+l+1>>1,l=s-l,r=r+o+1>>1,o=r-o,S=c*Di+u*Mi+2048>>12,c=c*Mi-u*Di+2048>>12,u=S,S=h*Ei+d*Ii+2048>>12,h=h*Ii-d*Ei+2048>>12,d=S,i[e]=s+u,i[e+7]=s-u,i[e+1]=r+d,i[e+6]=r-d,i[e+2]=o+h,i[e+5]=o-h,i[e+3]=l+c,i[e+4]=l-c):(S=Pi*g+512>>10,i[e]=S,i[e+1]=S,i[e+2]=S,i[e+3]=S,i[e+4]=S,i[e+5]=S,i[e+6]=S,i[e+7]=S);for(let e=0;e<8;++e)g=i[e],f=i[e+8],p=i[e+16],m=i[e+24],b=i[e+32],y=i[e+40],w=i[e+48],x=i[e+56],0!==(f|p|m|b|y|w|x)?(s=Pi*g+2048>>12,r=Pi*b+2048>>12,o=p,l=w,c=Ri*(f-x)+2048>>12,u=Ri*(f+x)+2048>>12,h=m,d=y,s=4112+(s+r+1>>1),r=s-r,S=o*_i+l*Oi+2048>>12,o=o*Oi-l*_i+2048>>12,l=S,c=c+d+1>>1,d=c-d,u=u+h+1>>1,h=u-h,s=s+l+1>>1,l=s-l,r=r+o+1>>1,o=r-o,S=c*Di+u*Mi+2048>>12,c=c*Mi-u*Di+2048>>12,u=S,S=h*Ei+d*Ii+2048>>12,h=h*Ii-d*Ei+2048>>12,d=S,g=s+u,x=s-u,f=r+d,w=r-d,p=o+h,y=o-h,m=l+c,b=l-c,g<16?g=0:g>=4080?g=255:g>>=4,f<16?f=0:f>=4080?f=255:f>>=4,p<16?p=0:p>=4080?p=255:p>>=4,m<16?m=0:m>=4080?m=255:m>>=4,b<16?b=0:b>=4080?b=255:b>>=4,y<16?y=0:y>=4080?y=255:y>>=4,w<16?w=0:w>=4080?w=255:w>>=4,x<16?x=0:x>=4080?x=255:x>>=4,a[t+e]=g,a[t+e+8]=f,a[t+e+16]=p,a[t+e+24]=m,a[t+e+32]=b,a[t+e+40]=y,a[t+e+48]=w,a[t+e+56]=x):(S=Pi*g+8192>>14,S=S<-2040?0:S>=2024?255:S+2056>>4,a[t+e]=S,a[t+e+8]=S,a[t+e+16]=S,a[t+e+24]=S,a[t+e+32]=S,a[t+e+40]=S,a[t+e+48]=S,a[t+e+56]=S)}function buildComponentData(e,t){const i=t.blocksPerLine,n=t.blocksPerColumn,a=new Int16Array(64);for(let e=0;e<n;e++)for(let n=0;n<i;n++){quantizeAndInverse(t,getBlockBufferOffset(t,e,n),a)}return t.blockData}function findNextFileMarker(e,t,i=t){const n=e.length-1;let a=i<t?i:t;if(t>=n)return null;const s=readUint16(e,t);if(s>=65472&&s<=65534)return{invalid:null,marker:s,offset:t};let r=readUint16(e,a);for(;!(r>=65472&&r<=65534);){if(++a>=n)return null;r=readUint16(e,a)}return{invalid:s.toString(16),marker:r,offset:a}}function prepareComponents(e){const t=Math.ceil(e.samplesPerLine/8/e.maxH),i=Math.ceil(e.scanLines/8/e.maxV);for(const n of e.components){const a=Math.ceil(Math.ceil(e.samplesPerLine/8)*n.h/e.maxH),s=Math.ceil(Math.ceil(e.scanLines/8)*n.v/e.maxV),r=t*n.h,o=64*(i*n.v)*(r+1);n.blockData=new Int16Array(o),n.blocksPerLine=a,n.blocksPerColumn=s}e.mcusPerLine=t,e.mcusPerColumn=i}function readDataBlock(e,t){const i=readUint16(e,t);let n=(t+=2)+i-2;const a=findNextFileMarker(e,n,t);a?.invalid&&(warn$1("readDataBlock - incorrect length, current marker is: "+a.invalid),n=a.offset);const s=e.subarray(t,n);return{appData:s,oldOffset:t,newOffset:t+s.length}}function skipData(e,t){const i=readUint16(e,t),n=(t+=2)+i-2,a=findNextFileMarker(e,n,t);return a?.invalid?a.offset:n}class JpegImage{constructor({decodeTransform:e=null,colorTransform:t=-1}={}){this._decodeTransform=e,this._colorTransform=t}static canUseImageDecoder(e,t=-1){let i=null,n=0,a=null,s=readUint16(e,n);if(n+=2,65496!==s)throw new JpegError("SOI not found");s=readUint16(e,n),n+=2;e:for(;65497!==s;){switch(s){case 65505:const{appData:t,oldOffset:r,newOffset:o}=readDataBlock(e,n);if(n=o,69===t[0]&&120===t[1]&&105===t[2]&&102===t[3]&&0===t[4]&&0===t[5]){if(i)throw new JpegError("Duplicate EXIF-blocks found.");i={exifStart:r+6,exifEnd:o}}s=readUint16(e,n),n+=2;continue;case 65472:case 65473:case 65474:a=e[n+7];break e;case 65535:255!==e[n]&&n--}n=skipData(e,n),s=readUint16(e,n),n+=2}return 4===a||3===a&&0===t?null:i||{}}parse(e,{dnlScanLines:t=null}={}){let i,n,a=0,s=null,r=null,o=0;const l=[],c=[],h=[];let d=readUint16(e,a);if(a+=2,65496!==d)throw new JpegError("SOI not found");d=readUint16(e,a),a+=2;e:for(;65497!==d;){let u,g,f;switch(d){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:const{appData:p,newOffset:m}=readDataBlock(e,a);a=m,65504===d&&74===p[0]&&70===p[1]&&73===p[2]&&70===p[3]&&0===p[4]&&(s={version:{major:p[5],minor:p[6]},densityUnits:p[7],xDensity:p[8]<<8|p[9],yDensity:p[10]<<8|p[11],thumbWidth:p[12],thumbHeight:p[13],thumbData:p.subarray(14,14+3*p[12]*p[13])}),65518===d&&65===p[0]&&100===p[1]&&111===p[2]&&98===p[3]&&101===p[4]&&(r={version:p[5]<<8|p[6],flags0:p[7]<<8|p[8],flags1:p[9]<<8|p[10],transformCode:p[11]});break;case 65499:const b=readUint16(e,a);a+=2;const y=b+a-2;let w;for(;a<y;){const t=e[a++],i=new Uint16Array(64);if(t>>4){if(t>>4!=1)throw new JpegError("DQT - invalid table spec");for(g=0;g<64;g++)w=Fi[g],i[w]=readUint16(e,a),a+=2}else for(g=0;g<64;g++)w=Fi[g],i[w]=e[a++];l[15&t]=i}break;case 65472:case 65473:case 65474:if(i)throw new JpegError("Only single frame JPEGs supported");a+=2,i={},i.extended=65473===d,i.progressive=65474===d,i.precision=e[a++];const x=readUint16(e,a);a+=2,i.scanLines=t||x,i.samplesPerLine=readUint16(e,a),a+=2,i.components=[],i.componentIds={};const S=e[a++];let v=0,C=0;for(u=0;u<S;u++){const t=e[a],n=e[a+1]>>4,s=15&e[a+1];v<n&&(v=n),C<s&&(C=s);const r=e[a+2];f=i.components.push({h:n,v:s,quantizationId:r,quantizationTable:null}),i.componentIds[t]=f-1,a+=3}i.maxH=v,i.maxV=C,prepareComponents(i);break;case 65476:const k=readUint16(e,a);for(a+=2,u=2;u<k;){const t=e[a++],i=new Uint8Array(16);let n=0;for(g=0;g<16;g++,a++)n+=i[g]=e[a];const s=new Uint8Array(n);for(g=0;g<n;g++,a++)s[g]=e[a];u+=17+n,(t>>4?c:h)[15&t]=buildHuffmanTable(i,s)}break;case 65501:a+=2,n=readUint16(e,a),a+=2;break;case 65498:const T=1===++o&&!t;a+=2;const F=e[a++],E=[];for(u=0;u<F;u++){const t=e[a++],n=i.componentIds[t],s=i.components[n];s.index=t;const r=e[a++];s.huffmanTableDC=h[r>>4],s.huffmanTableAC=c[15&r],E.push(s)}const M=e[a++],D=e[a++],O=e[a++];try{a+=decodeScan(e,a,i,E,n,M,D,O>>4,15&O,T)}catch(t){if(t instanceof DNLMarkerError)return warn$1(`${t.message} -- attempting to re-parse the JPEG image.`),this.parse(e,{dnlScanLines:t.scanLines});if(t instanceof EOIMarkerError){warn$1(`${t.message} -- ignoring the rest of the image data.`);break e}throw t}break;case 65500:a+=4;break;case 65535:255!==e[a]&&a--;break;default:const _=findNextFileMarker(e,a-2,a-3);if(_?.invalid){warn$1("JpegImage.parse - unexpected data, current marker is: "+_.invalid),a=_.offset;break}if(!_||a>=e.length-1){warn$1("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new JpegError("JpegImage.parse - unknown marker: "+d.toString(16))}d=readUint16(e,a),a+=2}if(!i)throw new JpegError("JpegImage.parse - no frame data found.");this.width=i.samplesPerLine,this.height=i.scanLines,this.jfif=s,this.adobe=r,this.components=[];for(const e of i.components){const t=l[e.quantizationId];t&&(e.quantizationTable=t),this.components.push({index:e.index,output:buildComponentData(0,e),scaleX:e.h/i.maxH,scaleY:e.v/i.maxV,blocksPerLine:e.blocksPerLine,blocksPerColumn:e.blocksPerColumn})}this.numComponents=this.components.length}_getLinearizedBlockData(e,t,i=!1){const n=this.width/e,a=this.height/t;let s,r,o,l,c,h,d,u,g,f,p,m=0;const b=this.components.length,y=e*t*b,w=new Uint8ClampedArray(y),x=new Uint32Array(e),S=4294967288;let v;for(d=0;d<b;d++){if(s=this.components[d],r=s.scaleX*n,o=s.scaleY*a,m=d,p=s.output,l=s.blocksPerLine+1<<3,r!==v){for(c=0;c<e;c++)u=0|c*r,x[c]=(u&S)<<3|7&u;v=r}for(h=0;h<t;h++)for(u=0|h*o,f=l*(u&S)|(7&u)<<3,c=0;c<e;c++)w[m]=p[f+x[c]],m+=b}let C=this._decodeTransform;if(i||4!==b||C||(C=new Int32Array([-256,255,-256,255,-256,255,-256,255])),C)for(d=0;d<y;)for(u=0,g=0;u<b;u++,d++,g+=2)w[d]=(w[d]*C[g]>>8)+C[g+1];return w}get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform&&(82!==this.components[0].index||71!==this.components[1].index||66!==this.components[2].index):1===this._colorTransform}_convertYccToRgb(e){let t,i,n;for(let a=0,s=e.length;a<s;a+=3)t=e[a],i=e[a+1],n=e[a+2],e[a]=t-179.456+1.402*n,e[a+1]=t+135.459-.344*i-.714*n,e[a+2]=t-226.816+1.772*i;return e}_convertYccToRgba(e,t){for(let i=0,n=0,a=e.length;i<a;i+=3,n+=4){const a=e[i],s=e[i+1],r=e[i+2];t[n]=a-179.456+1.402*r,t[n+1]=a+135.459-.344*s-.714*r,t[n+2]=a-226.816+1.772*s,t[n+3]=255}return t}_convertYcckToRgb(e){return this._convertYcckToCmyk(e),this._convertCmykToRgb(e)}_convertYcckToRgba(e){return this._convertYcckToCmyk(e),this._convertCmykToRgba(e)}_convertYcckToCmyk(e){let t,i,n;for(let a=0,s=e.length;a<s;a+=4)t=e[a],i=e[a+1],n=e[a+2],e[a]=434.456-t-1.402*n,e[a+1]=119.541-t+.344*i+.714*n,e[a+2]=481.816-t-1.772*i;return e}_convertCmykToRgb(e){const t=e.length/4;return ColorSpaceUtils.cmyk.getRgbBuffer(e,0,t,e,0,8,0),e.subarray(0,3*t)}_convertCmykToRgba(e){if(ColorSpaceUtils.cmyk.getRgbBuffer(e,0,e.length/4,e,0,8,1),ColorSpaceUtils.cmyk instanceof DeviceCmykCS)for(let t=3,i=e.length;t<i;t+=4)e[t]=255;return e}getData({width:e,height:t,forceRGBA:i=!1,forceRGB:n=!1,isSourcePDF:a=!1}){if(this.numComponents>4)throw new JpegError("Unsupported color mode");const s=this._getLinearizedBlockData(e,t,a);if(1===this.numComponents&&(i||n)){const e=s.length*(i?4:3),t=new Uint8ClampedArray(e);let n=0;if(i)!function(e,t){if(FeatureTest.isLittleEndian)for(let i=0,n=e.length;i<n;i++)t[i]=65793*e[i]|4278190080;else for(let i=0,n=e.length;i<n;i++)t[i]=16843008*e[i]|255}(s,new Uint32Array(t.buffer));else for(const e of s)t[n++]=e,t[n++]=e,t[n++]=e;return t}if(3===this.numComponents&&this._isColorConversionNeeded){if(i){const e=new Uint8ClampedArray(s.length/3*4);return this._convertYccToRgba(s,e)}return this._convertYccToRgb(s)}if(4===this.numComponents){if(this._isColorConversionNeeded)return i?this._convertYcckToRgba(s):n?this._convertYcckToRgb(s):this._convertYcckToCmyk(s);if(i)return this._convertCmykToRgba(s);if(n)return this._convertCmykToRgb(s)}return s}}class JpegStream extends DecodeStream{static#M=FeatureTest.isImageDecoderSupported;constructor(e,t,i){super(t),this.stream=e,this.dict=e.dict,this.maybeLength=t,this.params=i}static get canUseImageDecoder(){return shadow$1(this,"canUseImageDecoder",this.#M?ImageDecoder.isTypeSupported("image/jpeg"):Promise.resolve(!1))}static setOptions({isImageDecoderSupported:e=!1}){this.#M=e}get bytes(){return shadow$1(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){this.decodeImage()}get jpegOptions(){const e={decodeTransform:void 0,colorTransform:void 0},t=this.dict.getArray("D","Decode");if((this.forceRGBA||this.forceRGB)&&Array.isArray(t)){const i=this.dict.get("BPC","BitsPerComponent")||8,n=t.length,a=new Int32Array(n);let s=!1;const r=(1<<i)-1;for(let e=0;e<n;e+=2)a[e]=256*(t[e+1]-t[e])|0,a[e+1]=t[e]*r|0,256===a[e]&&0===a[e+1]||(s=!0);s&&(e.decodeTransform=a)}if(this.params instanceof Dict){const t=this.params.get("ColorTransform");Number.isInteger(t)&&(e.colorTransform=t)}return shadow$1(this,"jpegOptions",e)}#P(e){for(let t=0,i=e.length-1;t<i;t++)if(255===e[t]&&216===e[t+1]){t>0&&(e=e.subarray(t));break}return e}decodeImage(e){if(this.eof)return this.buffer;e=this.#P(e||this.bytes);const t=new JpegImage(this.jpegOptions);t.parse(e);const i=t.getData({width:this.drawWidth,height:this.drawHeight,forceRGBA:this.forceRGBA,forceRGB:this.forceRGB,isSourcePDF:!0});return this.buffer=i,this.bufferLength=i.length,this.eof=!0,this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}async getTransferableImage(){if(!await JpegStream.canUseImageDecoder)return null;const e=this.jpegOptions;if(e.decodeTransform)return null;let t;try{const i=this.canAsyncDecodeImageFromBuffer&&await this.stream.asyncGetBytes()||this.bytes;if(!i)return null;let n=this.#P(i);const a=JpegImage.canUseImageDecoder(n,e.colorTransform);return a?(a.exifStart&&(n=n.slice(),n.fill(0,a.exifStart,a.exifEnd)),t=new ImageDecoder({data:n,type:"image/jpeg",preferAnimation:!1}),(await t.decode()).image):null}catch(e){return warn$1(`getTransferableImage - failed: "${e}".`),null}finally{t?.close()}}}class JpxError extends Yt{constructor(e){super(e,"JpxError")}}class JpxImage{static#R=null;static#B=null;static#N=null;static#k=!0;static#L=!0;static#T=null;static setOptions({handler:e,useWasm:t,useWorkerFetch:i,wasmUrl:n}){this.#k=t,this.#L=i,this.#T=n,i||(this.#B=e)}static async#U(e){}static async#j(e,t,i){}static async decode(e,{numComponents:t=4,isIndexedColormap:i=!1,smaskInData:n=!1,reducePower:a=0}={}){const s=await this.#N;if(!s)throw new JpxError("OpenJPEG failed to initialize");let r;try{const o=e.length;r=s._malloc(o),s.writeArrayToMemory(e,r);if(s._jp2_decode(r,o,t>0?t:0,!!i,!!n,a)){const{errorMessages:e}=s;if(e)throw delete s.errorMessages,new JpxError(e);throw new JpxError("Unknown error")}const{imageData:l}=s;return s.imageData=null,l}finally{r&&s._free(r)}}static cleanup(){this.#N=null}static parseImageProperties(e){let t=e.getByte();for(;t>=0;){const i=t;t=e.getByte();if(65361===(i<<8|t)){e.skip(4);const t=e.getInt32()>>>0,i=e.getInt32()>>>0,n=e.getInt32()>>>0,a=e.getInt32()>>>0;e.skip(16);return{width:t-n,height:i-a,bitsPerComponent:8,componentsCount:e.getUint16()}}}throw new JpxError("No size marker found in JPX stream")}}function addState(e,t,i,n,a){let s=e;for(let e=0,i=t.length-1;e<i;e++){const i=t[e];s=s[i]||=[]}s[t.at(-1)]={checkFn:i,iterateFn:n,processFn:a}}const Bi=[];addState(Bi,[pe,be,Pt,me],null,function(e,t){const i=e.fnArray,n=(t-(e.iCurr-3))%4;switch(n){case 0:return i[t]===pe;case 1:return i[t]===be;case 2:return i[t]===Pt;case 3:return i[t]===me}throw new Error(`iterateInlineImageGroup - invalid pos: ${n}`)},function(e,t){const i=e.fnArray,n=e.argsArray,a=e.iCurr,s=a-3,r=a-2,o=a-1,l=Math.min(Math.floor((t-s)/4),200);if(l<10)return t-(t-s)%4;let c=0;const h=[];let d=0,u=1,g=1;for(let e=0;e<l;e++){const t=n[r+(e<<2)],i=n[o+(e<<2)][0];u+i.width>1e3&&(c=Math.max(c,u),g+=d+2,u=0,d=0),h.push({transform:t,x:u,y:g,w:i.width,h:i.height}),u+=i.width+2,d=Math.max(d,i.height)}const f=Math.max(c,u)+1,p=g+d+1,m=new Uint8Array(f*p*4),b=f<<2;for(let e=0;e<l;e++){const t=n[o+(e<<2)][0].data,i=h[e].w<<2;let a=0,s=h[e].x+h[e].y*f<<2;m.set(t.subarray(0,i),s-b);for(let n=0,r=h[e].h;n<r;n++)m.set(t.subarray(a,a+i),s),a+=i,s+=b;for(m.set(t.subarray(a-i,a),s);s>=0;)t[s-4]=t[s],t[s-3]=t[s+1],t[s-2]=t[s+2],t[s-1]=t[s+3],t[s+i]=t[s+i-4],t[s+i+1]=t[s+i-3],t[s+i+2]=t[s+i-2],t[s+i+3]=t[s+i-1],s-=b}const y={width:f,height:p};if(e.isOffscreenCanvasSupported){const e=new OffscreenCanvas(f,p);e.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(m.buffer),f,p),0,0),y.bitmap=e.transferToImageBitmap(),y.data=null}else y.kind=k,y.data=m;return i.splice(s,4*l,Rt),n.splice(s,4*l,[y,h]),s+1}),addState(Bi,[pe,be,Dt,me],null,function(e,t){const i=e.fnArray,n=(t-(e.iCurr-3))%4;switch(n){case 0:return i[t]===pe;case 1:return i[t]===be;case 2:return i[t]===Dt;case 3:return i[t]===me}throw new Error(`iterateImageMaskGroup - invalid pos: ${n}`)},function(e,t){const i=e.fnArray,n=e.argsArray,a=e.iCurr,s=a-3,r=a-2,o=a-1;let l=Math.floor((t-s)/4);if(l<10)return t-(t-s)%4;let c,h,d=!1;const u=n[o][0],g=n[r][0],f=n[r][1],p=n[r][2],m=n[r][3];if(f===p){d=!0,c=r+4;let e=o+4;for(let t=1;t<l;t++,c+=4,e+=4)if(h=n[c],n[e][0]!==u||h[0]!==g||h[1]!==f||h[2]!==p||h[3]!==m){t<10?d=!1:l=t;break}}if(d){l=Math.min(l,1e3);const e=new Float32Array(2*l);c=r;for(let t=0;t<l;t++,c+=4)h=n[c],e[t<<1]=h[4],e[1+(t<<1)]=h[5];i.splice(s,4*l,Nt),n.splice(s,4*l,[u,g,f,p,m,e])}else{l=Math.min(l,100);const e=[];for(let t=0;t<l;t++){h=n[r+(t<<2)];const i=n[o+(t<<2)][0];e.push({data:i.data,width:i.width,height:i.height,interpolate:i.interpolate,count:i.count,transform:h})}i.splice(s,4*l,Ot),n.splice(s,4*l,[e])}return s+1}),addState(Bi,[pe,be,_t,me],function(e){const t=e.argsArray,i=e.iCurr-2;return 0===t[i][1]&&0===t[i][2]},function(e,t){const i=e.fnArray,n=e.argsArray,a=(t-(e.iCurr-3))%4;switch(a){case 0:return i[t]===pe;case 1:if(i[t]!==be)return!1;const a=e.iCurr-2,s=n[a][0],r=n[a][3];return n[t][0]===s&&0===n[t][1]&&0===n[t][2]&&n[t][3]===r;case 2:if(i[t]!==_t)return!1;const o=n[e.iCurr-1][0];return n[t][0]===o;case 3:return i[t]===me}throw new Error(`iterateImageGroup - invalid pos: ${a}`)},function(e,t){const i=e.fnArray,n=e.argsArray,a=e.iCurr,s=a-3,r=a-2,o=n[a-1][0],l=n[r][0],c=n[r][3],h=Math.min(Math.floor((t-s)/4),1e3);if(h<3)return t-(t-s)%4;const d=new Float32Array(2*h);let u=r;for(let e=0;e<h;e++,u+=4){const t=n[u];d[e<<1]=t[4],d[1+(e<<1)]=t[5]}const g=[o,l,c,d];return i.splice(s,4*h,Bt),n.splice(s,4*h,g),s+1}),addState(Bi,[Be,He,Ge,Ke,Ne],null,function(e,t){const i=e.fnArray,n=e.argsArray,a=(t-(e.iCurr-4))%5;switch(a){case 0:return i[t]===Be;case 1:return i[t]===He;case 2:return i[t]===Ge;case 3:if(i[t]!==Ke)return!1;const a=e.iCurr-3,s=n[a][0],r=n[a][1];return n[t][0]===s&&n[t][1]===r;case 4:return i[t]===Ne}throw new Error(`iterateShowTextGroup - invalid pos: ${a}`)},function(e,t){const i=e.fnArray,n=e.argsArray,a=e.iCurr,s=a-4,r=a-3,o=a-2,l=a-1,c=a,h=n[r][0],d=n[r][1];let u=Math.min(Math.floor((t-s)/5),1e3);if(u<3)return t-(t-s)%5;let g=s;s>=4&&i[s-4]===i[r]&&i[s-3]===i[o]&&i[s-2]===i[l]&&i[s-1]===i[c]&&n[s-4][0]===h&&n[s-4][1]===d&&(u++,g-=5);let f=g+4;for(let e=1;e<u;e++)i.splice(f,3),n.splice(f,3),f+=2;return f+1}),addState(Bi,[pe,be,Ut,me],e=>{const t=e.argsArray,i=t[e.iCurr-1][0];if(i!==ke&&i!==Te&&i!==Ee&&i!==Me&&i!==De&&i!==Oe)return!0;const n=t[e.iCurr-2];return 1===n[0]&&0===n[1]&&0===n[2]&&1===n[3]},()=>!1,(e,t)=>{const{fnArray:i,argsArray:n}=e,a=e.iCurr,s=a-3,r=a-2,o=n[a-1],l=n[r],[,[c],h]=o;if(h){ai.scaleMinMax(l,h);for(let e=0,t=c.length;e<t;)switch(c[e++]){case Xt:case qt:ai.applyTransform(c,l,e),e+=2;break;case zt:ai.applyTransformToBezier(c,l,e),e+=6}}return i.splice(s,4,Ut),n.splice(s,4,o),s+1});class NullOptimizer{constructor(e){this.queue=e}_optimize(){}push(e,t){this.queue.fnArray.push(e),this.queue.argsArray.push(t),this._optimize()}flush(){}reset(){}}class QueueOptimizer extends NullOptimizer{constructor(e){super(e),this.state=null,this.context={iCurr:0,fnArray:e.fnArray,argsArray:e.argsArray,isOffscreenCanvasSupported:OperatorList.isOffscreenCanvasSupported},this.match=null,this.lastProcessed=0}_optimize(){const e=this.queue.fnArray;let t=this.lastProcessed,i=e.length,n=this.state,a=this.match;if(!n&&!a&&t+1===i&&!Bi[e[t]])return void(this.lastProcessed=i);const s=this.context;for(;t<i;){if(a){if((0,a.iterateFn)(s,t)){t++;continue}if(t=(0,a.processFn)(s,t+1),i=e.length,a=null,n=null,t>=i)break}n=(n||Bi)[e[t]],n&&!Array.isArray(n)?(s.iCurr=t,t++,!n.checkFn||(0,n.checkFn)(s)?(a=n,n=null):n=null):t++}this.state=n,this.match=a,this.lastProcessed=t}flush(){for(;this.match;){const e=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,e),this.match=null,this.state=null,this._optimize()}}reset(){this.state=null,this.match=null,this.lastProcessed=0}}class OperatorList{static CHUNK_SIZE=1e3;static CHUNK_SIZE_ABOUT=this.CHUNK_SIZE-5;static isOffscreenCanvasSupported=!1;constructor(e=0,t){this._streamSink=t,this.fnArray=[],this.argsArray=[],this.optimizer=!t||e&u?new NullOptimizer(this):new QueueOptimizer(this),this.dependencies=new Set,this._totalLength=0,this.weight=0,this._resolved=t?null:Promise.resolve()}static setOptions({isOffscreenCanvasSupported:e}){this.isOffscreenCanvasSupported=e}get length(){return this.argsArray.length}get ready(){return this._resolved||this._streamSink.ready}get totalLength(){return this._totalLength+this.length}addOp(e,t){this.optimizer.push(e,t),this.weight++,this._streamSink&&(this.weight>=OperatorList.CHUNK_SIZE||this.weight>=OperatorList.CHUNK_SIZE_ABOUT&&(e===me||e===Ne))&&this.flush()}addImageOps(e,t,i,n=!1){n&&(this.addOp(pe),this.addOp(fe,[[["SMask",!1]]])),void 0!==i&&this.addOp(xt,["OC",i]),this.addOp(e,t),void 0!==i&&this.addOp(St,[]),n&&this.addOp(me)}addDependency(e){this.dependencies.has(e)||(this.dependencies.add(e),this.addOp(re,[e]))}addDependencies(e){for(const t of e)this.addDependency(t)}addOpList(e){if(e instanceof OperatorList){for(const t of e.dependencies)this.dependencies.add(t);for(let t=0,i=e.length;t<i;t++)this.addOp(e.fnArray[t],e.argsArray[t])}else warn$1('addOpList - ignoring invalid "opList" parameter.')}getIR(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}}get _transfers(){const e=[],{fnArray:t,argsArray:i,length:n}=this;for(let a=0;a<n;a++)switch(t[a]){case Pt:case Rt:case Dt:{const{bitmap:t,data:n}=i[a][0];(t||n?.buffer)&&e.push(t||n.buffer);break}case Ut:{const[,[t],n]=i[a];t&&e.push(t.buffer,n.buffer);break}case kt:const[t,n]=i[a];t&&e.push(t.buffer),n&&e.push(n.buffer);break;case Ge:e.push(i[a][0].buffer)}return e}flush(e=!1,t=null){this.optimizer.flush();const i=this.length;this._totalLength+=i,this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:e,separateAnnots:t,length:i},1,this._transfers),this.dependencies.clear(),this.fnArray.length=0,this.argsArray.length=0,this.weight=0,this.optimizer.reset()}}function hexToInt(e,t){let i=0;for(let n=0;n<=t;n++)i=i<<8|e[n];return i>>>0}function hexToStr(e,t){return 1===t?String.fromCharCode(e[0],e[1]):3===t?String.fromCharCode(e[0],e[1],e[2],e[3]):String.fromCharCode(...e.subarray(0,t+1))}function addHex(e,t,i){let n=0;for(let a=i;a>=0;a--)n+=e[a]+t[a],e[a]=255&n,n>>=8}function incHex(e,t){let i=1;for(let n=t;n>=0&&i>0;n--)i+=e[n],e[n]=255&i,i>>=8}const Ni=16;class BinaryCMapStream{constructor(e){this.buffer=e,this.pos=0,this.end=e.length,this.tmpBuf=new Uint8Array(19)}readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]}readNumber(){let e,t=0;do{const i=this.readByte();if(i<0)throw new ti("unexpected EOF in bcmap");e=!(128&i),t=t<<7|127&i}while(!e);return t}readSigned(){const e=this.readNumber();return 1&e?~(e>>>1):e>>>1}readHex(e,t){e.set(this.buffer.subarray(this.pos,this.pos+t+1)),this.pos+=t+1}readHexNumber(e,t){let i;const n=this.tmpBuf;let a=0;do{const e=this.readByte();if(e<0)throw new ti("unexpected EOF in bcmap");i=!(128&e),n[a++]=127&e}while(!i);let s=t,r=0,o=0;for(;s>=0;){for(;o<8&&n.length>0;)r|=n[--a]<<o,o+=7;e[s]=255&r,s--,r>>=8,o-=8}}readHexSigned(e,t){this.readHexNumber(e,t);const i=1&e[t]?255:0;let n=0;for(let a=0;a<=t;a++)n=(1&n)<<8|e[a],e[a]=n>>1^i}readString(){const e=this.readNumber(),t=new Array(e);for(let i=0;i<e;i++)t[i]=this.readNumber();return String.fromCharCode(...t)}}class BinaryCMapReader{async process(e,t,i){const n=new BinaryCMapStream(e),a=n.readByte();t.vertical=!!(1&a);let s=null;const r=new Uint8Array(Ni),o=new Uint8Array(Ni),l=new Uint8Array(Ni),c=new Uint8Array(Ni),h=new Uint8Array(Ni);let d,u;for(;(u=n.readByte())>=0;){const e=u>>5;if(7===e){switch(31&u){case 0:n.readString();break;case 1:s=n.readString()}continue}const i=!!(16&u),a=15&u;if(a+1>Ni)throw new Error("BinaryCMapReader.process: Invalid dataSize.");const g=1,f=n.readNumber();switch(e){case 0:n.readHex(r,a),n.readHexNumber(o,a),addHex(o,r,a),t.addCodespaceRange(a+1,hexToInt(r,a),hexToInt(o,a));for(let e=1;e<f;e++)incHex(o,a),n.readHexNumber(r,a),addHex(r,o,a),n.readHexNumber(o,a),addHex(o,r,a),t.addCodespaceRange(a+1,hexToInt(r,a),hexToInt(o,a));break;case 1:n.readHex(r,a),n.readHexNumber(o,a),addHex(o,r,a),n.readNumber();for(let e=1;e<f;e++)incHex(o,a),n.readHexNumber(r,a),addHex(r,o,a),n.readHexNumber(o,a),addHex(o,r,a),n.readNumber();break;case 2:n.readHex(l,a),d=n.readNumber(),t.mapOne(hexToInt(l,a),d);for(let e=1;e<f;e++)incHex(l,a),i||(n.readHexNumber(h,a),addHex(l,h,a)),d=n.readSigned()+(d+1),t.mapOne(hexToInt(l,a),d);break;case 3:n.readHex(r,a),n.readHexNumber(o,a),addHex(o,r,a),d=n.readNumber(),t.mapCidRange(hexToInt(r,a),hexToInt(o,a),d);for(let e=1;e<f;e++)incHex(o,a),i?r.set(o):(n.readHexNumber(r,a),addHex(r,o,a)),n.readHexNumber(o,a),addHex(o,r,a),d=n.readNumber(),t.mapCidRange(hexToInt(r,a),hexToInt(o,a),d);break;case 4:n.readHex(l,g),n.readHex(c,a),t.mapOne(hexToInt(l,g),hexToStr(c,a));for(let e=1;e<f;e++)incHex(l,g),i||(n.readHexNumber(h,g),addHex(l,h,g)),incHex(c,a),n.readHexSigned(h,a),addHex(c,h,a),t.mapOne(hexToInt(l,g),hexToStr(c,a));break;case 5:n.readHex(r,g),n.readHexNumber(o,g),addHex(o,r,g),n.readHex(c,a),t.mapBfRange(hexToInt(r,g),hexToInt(o,g),hexToStr(c,a));for(let e=1;e<f;e++)incHex(o,g),i?r.set(o):(n.readHexNumber(r,g),addHex(r,o,g)),n.readHexNumber(o,g),addHex(o,r,g),n.readHex(c,a),t.mapBfRange(hexToInt(r,g),hexToInt(o,g),hexToStr(c,a));break;default:throw new Error(`BinaryCMapReader.process - unknown type: ${e}`)}}return s?i(s):t}}class Ascii85Stream extends DecodeStream{constructor(e,t){t&&(t*=.8),super(t),this.str=e,this.dict=e.dict,this.input=new Uint8Array(5)}readBlock(){const e=this.str;let t=e.getByte();for(;isWhiteSpace(t);)t=e.getByte();if(-1===t||126===t)return void(this.eof=!0);const i=this.bufferLength;let n,a;if(122===t){for(n=this.ensureBuffer(i+4),a=0;a<4;++a)n[i+a]=0;this.bufferLength+=4}else{const s=this.input;for(s[0]=t,a=1;a<5;++a){for(t=e.getByte();isWhiteSpace(t);)t=e.getByte();if(s[a]=t,-1===t||126===t)break}if(n=this.ensureBuffer(i+a-1),this.bufferLength+=a-1,a<5){for(;a<5;++a)s[a]=117;this.eof=!0}let r=0;for(a=0;a<5;++a)r=85*r+(s[a]-33);for(a=3;a>=0;--a)n[i+a]=255&r,r>>=8}}}class AsciiHexStream extends DecodeStream{constructor(e,t){t&&(t*=.5),super(t),this.str=e,this.dict=e.dict,this.firstDigit=-1}readBlock(){const e=this.str.getBytes(8e3);if(!e.length)return void(this.eof=!0);const t=e.length+1>>1,i=this.ensureBuffer(this.bufferLength+t);let n=this.bufferLength,a=this.firstDigit;for(const t of e){let e;if(t>=48&&t<=57)e=15&t;else{if(!(t>=65&&t<=70||t>=97&&t<=102)){if(62===t){this.eof=!0;break}continue}e=9+(15&t)}a<0?a=e:(i[n++]=a<<4|e,a=-1)}a>=0&&this.eof&&(i[n++]=a<<4,a=-1),this.firstDigit=a,this.bufferLength=n}}const ji=-1,$i=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],Hi=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],Xi=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],qi=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],zi=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],Wi=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];class CCITTFaxDecoder{constructor(e,t={}){if("function"!=typeof e?.next)throw new Error('CCITTFaxDecoder - invalid "source" parameter.');let i;for(this.source=e,this.eof=!1,this.encoding=t.K||0,this.eoline=t.EndOfLine||!1,this.byteAlign=t.EncodedByteAlign||!1,this.columns=t.Columns||1728,this.rows=t.Rows||0,this.eoblock=t.EndOfBlock??!0,this.black=t.BlackIs1||!1,this.codingLine=new Uint32Array(this.columns+1),this.refLine=new Uint32Array(this.columns+2),this.codingLine[0]=this.columns,this.codingPos=0,this.row=0,this.nextLine2D=this.encoding<0,this.inputBits=0,this.inputBuf=0,this.outputBits=0,this.rowsDone=!1;0===(i=this._lookBits(12));)this._eatBits(1);1===i&&this._eatBits(12),this.encoding>0&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1))}readNextChar(){if(this.eof)return-1;const e=this.refLine,t=this.codingLine,i=this.columns;let n,a,s,r,o;if(0===this.outputBits){if(this.rowsDone&&(this.eof=!0),this.eof)return-1;let s,o,l;if(this.err=!1,this.nextLine2D){for(r=0;t[r]<i;++r)e[r]=t[r];for(e[r++]=i,e[r]=i,t[0]=0,this.codingPos=0,n=0,a=0;t[this.codingPos]<i;)switch(s=this._getTwoDimCode(),s){case 0:this._addPixels(e[n+1],a),e[n+1]<i&&(n+=2);break;case 1:if(s=o=0,a){do{s+=l=this._getBlackCode()}while(l>=64);do{o+=l=this._getWhiteCode()}while(l>=64)}else{do{s+=l=this._getWhiteCode()}while(l>=64);do{o+=l=this._getBlackCode()}while(l>=64)}for(this._addPixels(t[this.codingPos]+s,a),t[this.codingPos]<i&&this._addPixels(t[this.codingPos]+o,1^a);e[n]<=t[this.codingPos]&&e[n]<i;)n+=2;break;case 7:if(this._addPixels(e[n]+3,a),a^=1,t[this.codingPos]<i)for(++n;e[n]<=t[this.codingPos]&&e[n]<i;)n+=2;break;case 5:if(this._addPixels(e[n]+2,a),a^=1,t[this.codingPos]<i)for(++n;e[n]<=t[this.codingPos]&&e[n]<i;)n+=2;break;case 3:if(this._addPixels(e[n]+1,a),a^=1,t[this.codingPos]<i)for(++n;e[n]<=t[this.codingPos]&&e[n]<i;)n+=2;break;case 2:if(this._addPixels(e[n],a),a^=1,t[this.codingPos]<i)for(++n;e[n]<=t[this.codingPos]&&e[n]<i;)n+=2;break;case 8:if(this._addPixelsNeg(e[n]-3,a),a^=1,t[this.codingPos]<i)for(n>0?--n:++n;e[n]<=t[this.codingPos]&&e[n]<i;)n+=2;break;case 6:if(this._addPixelsNeg(e[n]-2,a),a^=1,t[this.codingPos]<i)for(n>0?--n:++n;e[n]<=t[this.codingPos]&&e[n]<i;)n+=2;break;case 4:if(this._addPixelsNeg(e[n]-1,a),a^=1,t[this.codingPos]<i)for(n>0?--n:++n;e[n]<=t[this.codingPos]&&e[n]<i;)n+=2;break;case ji:this._addPixels(i,0),this.eof=!0;break;default:info$1("bad 2d code"),this._addPixels(i,0),this.err=!0}}else for(t[0]=0,this.codingPos=0,a=0;t[this.codingPos]<i;){if(s=0,a)do{s+=l=this._getBlackCode()}while(l>=64);else do{s+=l=this._getWhiteCode()}while(l>=64);this._addPixels(t[this.codingPos]+s,a),a^=1}let c=!1;if(this.byteAlign&&(this.inputBits&=-8),this.eoblock||this.row!==this.rows-1){if(s=this._lookBits(12),this.eoline)for(;s!==ji&&1!==s;)this._eatBits(1),s=this._lookBits(12);else for(;0===s;)this._eatBits(1),s=this._lookBits(12);1===s?(this._eatBits(12),c=!0):s===ji&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1)),this.eoblock&&c&&this.byteAlign){if(s=this._lookBits(12),1===s){if(this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1)),this.encoding>=0)for(r=0;r<4;++r)s=this._lookBits(12),1!==s&&info$1("bad rtc code: "+s),this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){if(s=this._lookBits(13),s===ji)return this.eof=!0,-1;if(s>>1==1)break;this._eatBits(1)}this._eatBits(12),this.encoding>0&&(this._eatBits(1),this.nextLine2D=!(1&s))}this.outputBits=t[0]>0?t[this.codingPos=0]:t[this.codingPos=1],this.row++}if(this.outputBits>=8)o=1&this.codingPos?0:255,this.outputBits-=8,0===this.outputBits&&t[this.codingPos]<i&&(this.codingPos++,this.outputBits=t[this.codingPos]-t[this.codingPos-1]);else{s=8,o=0;do{if("number"!=typeof this.outputBits)throw new ti('Invalid /CCITTFaxDecode data, "outputBits" must be a number.');this.outputBits>s?(o<<=s,1&this.codingPos||(o|=255>>8-s),this.outputBits-=s,s=0):(o<<=this.outputBits,1&this.codingPos||(o|=255>>8-this.outputBits),s-=this.outputBits,this.outputBits=0,t[this.codingPos]<i?(this.codingPos++,this.outputBits=t[this.codingPos]-t[this.codingPos-1]):s>0&&(o<<=s,s=0))}while(s)}return this.black&&(o^=255),o}_addPixels(e,t){const i=this.codingLine;let n=this.codingPos;e>i[n]&&(e>this.columns&&(info$1("row is wrong length"),this.err=!0,e=this.columns),1&n^t&&++n,i[n]=e),this.codingPos=n}_addPixelsNeg(e,t){const i=this.codingLine;let n=this.codingPos;if(e>i[n])e>this.columns&&(info$1("row is wrong length"),this.err=!0,e=this.columns),1&n^t&&++n,i[n]=e;else if(e<i[n]){for(e<0&&(info$1("invalid code"),this.err=!0,e=0);n>0&&e<i[n-1];)--n;i[n]=e}this.codingPos=n}_findTableCode(e,t,i,n){const a=n||0;for(let n=e;n<=t;++n){let e=this._lookBits(n);if(e===ji)return[!0,1,!1];if(n<t&&(e<<=t-n),!a||e>=a){const t=i[e-a];if(t[0]===n)return this._eatBits(n),[!0,t[1],!0]}}return[!1,0,!1]}_getTwoDimCode(){let e,t=0;if(this.eoblock){if(t=this._lookBits(7),e=$i[t],e?.[0]>0)return this._eatBits(e[0]),e[1]}else{const e=this._findTableCode(1,7,$i);if(e[0]&&e[2])return e[1]}return info$1("Bad two dim code"),ji}_getWhiteCode(){let e,t=0;if(this.eoblock){if(t=this._lookBits(12),t===ji)return 1;if(e=t>>5?Xi[t>>3]:Hi[t],e[0]>0)return this._eatBits(e[0]),e[1]}else{let e=this._findTableCode(1,9,Xi);if(e[0])return e[1];if(e=this._findTableCode(11,12,Hi),e[0])return e[1]}return info$1("bad white code"),this._eatBits(1),1}_getBlackCode(){let e,t;if(this.eoblock){if(e=this._lookBits(13),e===ji)return 1;if(t=e>>7?!(e>>9)&&e>>7?zi[(e>>1)-64]:Wi[e>>7]:qi[e],t[0]>0)return this._eatBits(t[0]),t[1]}else{let e=this._findTableCode(2,6,Wi);if(e[0])return e[1];if(e=this._findTableCode(7,12,zi,64),e[0])return e[1];if(e=this._findTableCode(10,13,qi),e[0])return e[1]}return info$1("bad black code"),this._eatBits(1),1}_lookBits(e){let t;for(;this.inputBits<e;){if(-1===(t=this.source.next()))return 0===this.inputBits?ji:this.inputBuf<<e-this.inputBits&65535>>16-e;this.inputBuf=this.inputBuf<<8|t,this.inputBits+=8}return this.inputBuf>>this.inputBits-e&65535>>16-e}_eatBits(e){(this.inputBits-=e)<0&&(this.inputBits=0)}}class CCITTFaxStream extends DecodeStream{constructor(e,t,i){super(t),this.str=e,this.dict=e.dict,i instanceof Dict||(i=Dict.empty);const n={next:()=>e.getByte()};this.ccittFaxDecoder=new CCITTFaxDecoder(n,{K:i.get("K"),EndOfLine:i.get("EndOfLine"),EncodedByteAlign:i.get("EncodedByteAlign"),Columns:i.get("Columns"),Rows:i.get("Rows"),EndOfBlock:i.get("EndOfBlock"),BlackIs1:i.get("BlackIs1")})}readBlock(){for(;!this.eof;){const e=this.ccittFaxDecoder.readNextChar();if(-1===e)return void(this.eof=!0);this.ensureBuffer(this.bufferLength+1),this.buffer[this.bufferLength++]=e}}}const Gi=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Vi=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),Ki=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),Yi=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],Ji=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];class FlateStream extends DecodeStream{constructor(e,t){super(t),this.str=e,this.dict=e.dict;const i=e.getByte(),n=e.getByte();if(-1===i||-1===n)throw new ti(`Invalid header in flate stream: ${i}, ${n}`);if(8!=(15&i))throw new ti(`Unknown compression method in flate stream: ${i}, ${n}`);if(((i<<8)+n)%31!=0)throw new ti(`Bad FCHECK in flate stream: ${i}, ${n}`);if(32&n)throw new ti(`FDICT bit set in flate stream: ${i}, ${n}`);this.codeSize=0,this.codeBuf=0}async getImageData(e,t){const i=await this.asyncGetBytes();return i?i.length<=e?i:i.subarray(0,e):this.getBytes(e)}async asyncGetBytes(){this.str.reset();const e=this.str.getBytes();try{const{readable:t,writable:i}=new DecompressionStream("deflate"),n=i.getWriter();await n.ready,n.write(e).then(async()=>{await n.ready,await n.close()}).catch(()=>{});const a=[];let s=0;for await(const e of t)a.push(e),s+=e.byteLength;const r=new Uint8Array(s);let o=0;for(const e of a)r.set(e,o),o+=e.byteLength;return r}catch{return this.str=new Stream(e,2,e.length,this.str.dict),this.reset(),null}}get isAsync(){return!0}getBits(e){const t=this.str;let i,n=this.codeSize,a=this.codeBuf;for(;n<e;){if(-1===(i=t.getByte()))throw new ti("Bad encoding in flate stream");a|=i<<n,n+=8}return i=a&(1<<e)-1,this.codeBuf=a>>e,this.codeSize=n-=e,i}getCode(e){const t=this.str,i=e[0],n=e[1];let a,s=this.codeSize,r=this.codeBuf;for(;s<n&&-1!==(a=t.getByte());)r|=a<<s,s+=8;const o=i[r&(1<<n)-1],l=o>>16,c=65535&o;if(l<1||s<l)throw new ti("Bad encoding in flate stream");return this.codeBuf=r>>l,this.codeSize=s-l,c}generateHuffmanTable(e){const t=e.length;let i,n=0;for(i=0;i<t;++i)e[i]>n&&(n=e[i]);const a=1<<n,s=new Int32Array(a);for(let r=1,o=0,l=2;r<=n;++r,o<<=1,l<<=1)for(let n=0;n<t;++n)if(e[n]===r){let e=0,t=o;for(i=0;i<r;++i)e=e<<1|1&t,t>>=1;for(i=e;i<a;i+=l)s[i]=r<<16|n;++o}return[s,n]}#$(e){info$1(e),this.eof=!0}readBlock(){let e,t,i;const n=this.str;try{t=this.getBits(3)}catch(e){return void this.#$(e.message)}if(1&t&&(this.eof=!0),t>>=1,0===t){let t;if(-1===(t=n.getByte()))return void this.#$("Bad block header in flate stream");let i=t;if(-1===(t=n.getByte()))return void this.#$("Bad block header in flate stream");if(i|=t<<8,-1===(t=n.getByte()))return void this.#$("Bad block header in flate stream");let a=t;if(-1===(t=n.getByte()))return void this.#$("Bad block header in flate stream");if(a|=t<<8,a!==(65535&~i)&&(0!==i||0!==a))throw new ti("Bad uncompressed block length in flate stream");this.codeBuf=0,this.codeSize=0;const s=this.bufferLength,r=s+i;if(e=this.ensureBuffer(r),this.bufferLength=r,0===i)-1===n.peekByte()&&(this.eof=!0);else{const t=n.getBytes(i);e.set(t,s),t.length<i&&(this.eof=!0)}return}let a,s;if(1===t)a=Yi,s=Ji;else{if(2!==t)throw new ti("Unknown block type in flate stream");{const e=this.getBits(5)+257,t=this.getBits(5)+1,n=this.getBits(4)+4,r=new Uint8Array(Gi.length);let o;for(o=0;o<n;++o)r[Gi[o]]=this.getBits(3);const l=this.generateHuffmanTable(r);i=0,o=0;const c=e+t,h=new Uint8Array(c);let d,u,g;for(;o<c;){const e=this.getCode(l);if(16===e)d=2,u=3,g=i;else if(17===e)d=3,u=3,g=i=0;else{if(18!==e){h[o++]=i=e;continue}d=7,u=11,g=i=0}let t=this.getBits(d)+u;for(;t-- >0;)h[o++]=g}a=this.generateHuffmanTable(h.subarray(0,e)),s=this.generateHuffmanTable(h.subarray(e,c))}}e=this.buffer;let r=e?e.length:0,o=this.bufferLength;for(;;){let t=this.getCode(a);if(t<256){o+1>=r&&(e=this.ensureBuffer(o+1),r=e.length),e[o++]=t;continue}if(256===t)return void(this.bufferLength=o);t-=257,t=Vi[t];let n=t>>16;n>0&&(n=this.getBits(n)),i=(65535&t)+n,t=this.getCode(s),t=Ki[t],n=t>>16,n>0&&(n=this.getBits(n));const l=(65535&t)+n;o+i>=r&&(e=this.ensureBuffer(o+i),r=e.length);for(let t=0;t<i;++t,++o)e[o]=e[o-l]}}}const Zi=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];class ArithmeticDecoder{constructor(e,t,i){this.data=e,this.bp=t,this.dataEnd=i,this.chigh=e[t],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}byteIn(){const e=this.data;let t=this.bp;255===e[t]?e[t+1]>143?(this.clow+=65280,this.ct=8):(t++,this.clow+=e[t]<<9,this.ct=7,this.bp=t):(t++,this.clow+=t<this.dataEnd?e[t]<<8:65280,this.ct=8,this.bp=t),this.clow>65535&&(this.chigh+=this.clow>>16,this.clow&=65535)}readBit(e,t){let i=e[t]>>1,n=1&e[t];const a=Zi[i],s=a.qe;let r,o=this.a-s;if(this.chigh<s)o<s?(o=s,r=n,i=a.nmps):(o=s,r=1^n,1===a.switchFlag&&(n=r),i=a.nlps);else{if(this.chigh-=s,32768&o)return this.a=o,n;o<s?(r=1^n,1===a.switchFlag&&(n=r),i=a.nlps):(r=n,i=a.nmps)}do{0===this.ct&&this.byteIn(),o<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--}while(!(32768&o));return this.a=o,e[t]=i<<1|n,r}}class Jbig2Error extends Yt{constructor(e){super(e,"Jbig2Error")}}class ContextCache{getContexts(e){return e in this?this[e]:this[e]=new Int8Array(65536)}}class DecodingContext{constructor(e,t,i){this.data=e,this.start=t,this.end=i}get decoder(){return shadow$1(this,"decoder",new ArithmeticDecoder(this.data,this.start,this.end))}get contextCache(){return shadow$1(this,"contextCache",new ContextCache)}}function decodeInteger(e,t,i){const n=e.getContexts(t);let a=1;function readBits(e){let t=0;for(let s=0;s<e;s++){const e=i.readBit(n,a);a=a<256?a<<1|e:511&(a<<1|e)|256,t=t<<1|e}return t>>>0}const s=readBits(1),r=readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(32)+4436:readBits(12)+340:readBits(8)+84:readBits(6)+20:readBits(4)+4:readBits(2);let o;return 0===s?o=r:r>0&&(o=-r),o>=-2147483648&&o<=fi?o:null}function decodeIAID(e,t,i){const n=e.getContexts("IAID");let a=1;for(let e=0;e<i;e++){a=a<<1|t.readBit(n,a)}return i<31?a&(1<<i)-1:2147483647&a}const Qi=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"PatternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],en=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],tn=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],nn=[39717,1941,229,405];function decodeBitmap(e,t,i,n,a,s,r,o){if(e){return decodeMMRBitmap(new Reader(o.data,o.start,o.end),t,i,!1)}if(0===n&&!a&&4===r.length&&3===r[0].x&&-1===r[0].y&&-3===r[1].x&&-1===r[1].y&&2===r[2].x&&-2===r[2].y&&-2===r[3].x&&-2===r[3].y)return function(e,t,i){const n=i.decoder,a=i.contextCache.getContexts("GB"),s=[];let r,o,l,c,h,d,u;for(o=0;o<t;o++)for(h=s[o]=new Uint8Array(e),d=o<1?h:s[o-1],u=o<2?h:s[o-2],r=u[0]<<13|u[1]<<12|u[2]<<11|d[0]<<7|d[1]<<6|d[2]<<5|d[3]<<4,l=0;l<e;l++)h[l]=c=n.readBit(a,r),r=(31735&r)<<1|(l+3<e?u[l+3]<<11:0)|(l+4<e?d[l+4]<<4:0)|c;return s}(t,i,o);const l=en[n].concat(r);l.sort((e,t)=>e.y-t.y||e.x-t.x);const c=l.length,h=new Int8Array(c),d=new Int8Array(c),u=[];let g,f,p=0,m=0,b=0,y=0;for(f=0;f<c;f++)h[f]=l[f].x,d[f]=l[f].y,m=Math.min(m,l[f].x),b=Math.max(b,l[f].x),y=Math.min(y,l[f].y),f<c-1&&l[f].y===l[f+1].y&&l[f].x===l[f+1].x-1?p|=1<<c-1-f:u.push(f);const w=u.length,x=new Int8Array(w),S=new Int8Array(w),v=new Uint16Array(w);for(g=0;g<w;g++)f=u[g],x[g]=l[f].x,S[g]=l[f].y,v[g]=1<<c-1-f;const C=-m,k=-y,T=t-b,F=nn[n];let E=new Uint8Array(t);const M=[],D=o.decoder,O=o.contextCache.getContexts("GB");let _,R,N,L,U,j=0,$=0;for(let e=0;e<i;e++){if(a){if(j^=D.readBit(O,F),j){M.push(E);continue}}for(E=new Uint8Array(E),M.push(E),_=0;_<t;_++){if(_>=C&&_<T&&e>=k)for($=$<<1&p,f=0;f<w;f++)R=e+S[f],N=_+x[f],L=M[R][N],L&&(L=v[f],$|=L);else for($=0,U=c-1,f=0;f<c;f++,U--)N=_+h[f],N>=0&&N<t&&(R=e+d[f],R>=0&&(L=M[R][N],L&&($|=L<<U)));const i=D.readBit(O,$);E[_]=i}}return M}function decodeRefinement(e,t,i,n,a,s,r,o,l){let c=tn[i].coding;0===i&&(c=c.concat([o[0]]));const h=c.length,d=new Int32Array(h),u=new Int32Array(h);let g;for(g=0;g<h;g++)d[g]=c[g].x,u[g]=c[g].y;let f=tn[i].reference;0===i&&(f=f.concat([o[1]]));const p=f.length,m=new Int32Array(p),b=new Int32Array(p);for(g=0;g<p;g++)m[g]=f[g].x,b[g]=f[g].y;const y=n[0].length,w=n.length,x=[],S=l.decoder,v=l.contextCache.getContexts("GR");for(let i=0;i<t;i++){const t=new Uint8Array(e);x.push(t);for(let r=0;r<e;r++){let o,l,c=0;for(g=0;g<h;g++)o=i+u[g],l=r+d[g],o<0||l<0||l>=e?c<<=1:c=c<<1|x[o][l];for(g=0;g<p;g++)o=i+b[g]-s,l=r+m[g]-a,o<0||o>=w||l<0||l>=y?c<<=1:c=c<<1|n[o][l];const f=S.readBit(v,c);t[r]=f}}return x}function decodeTextRegion(e,t,i,n,a,s,r,o,l,c,h,d,u,g,f,p,m,b,y){if(e&&t)throw new Jbig2Error("refinement with Huffman is not supported");const w=[];let x,S;for(x=0;x<n;x++)S=new Uint8Array(i),a&&S.fill(a),w.push(S);const v=m.decoder,C=m.contextCache;let k=e?-g.tableDeltaT.decode(y):-decodeInteger(C,"IADT",v),T=0;for(x=0;x<s;){k+=e?g.tableDeltaT.decode(y):decodeInteger(C,"IADT",v);T+=e?g.tableFirstS.decode(y):decodeInteger(C,"IAFS",v);let n=T;for(;;){let a=0;r>1&&(a=e?y.readBits(b):decodeInteger(C,"IAIT",v));const s=r*k+a,T=e?g.symbolIDTable.decode(y):decodeIAID(C,v,l),F=t&&(e?y.readBit():decodeInteger(C,"IARI",v));let E=o[T],M=E[0].length,D=E.length;if(F){const e=decodeInteger(C,"IARDW",v),t=decodeInteger(C,"IARDH",v);M+=e,D+=t,E=decodeRefinement(M,D,f,E,(e>>1)+decodeInteger(C,"IARDX",v),(t>>1)+decodeInteger(C,"IARDY",v),0,p,m)}let O=0;c?1&d?O=D-1:n+=D-1:d>1?n+=M-1:O=M-1;const _=s-(1&d?0:D-1),R=n-(2&d?M-1:0);let N,L,U;if(c)for(N=0;N<D;N++){if(S=w[R+N],!S)continue;U=E[N];const e=Math.min(i-_,M);switch(u){case 0:for(L=0;L<e;L++)S[_+L]|=U[L];break;case 2:for(L=0;L<e;L++)S[_+L]^=U[L];break;default:throw new Jbig2Error(`operator ${u} is not supported`)}}else for(L=0;L<D;L++)if(S=w[_+L],S)switch(U=E[L],u){case 0:for(N=0;N<M;N++)S[R+N]|=U[N];break;case 2:for(N=0;N<M;N++)S[R+N]^=U[N];break;default:throw new Jbig2Error(`operator ${u} is not supported`)}x++;const j=e?g.tableDeltaS.decode(y):decodeInteger(C,"IADS",v);if(null===j)break;n+=O+j+h}}return w}function readSegmentHeader(e,t){const i={};i.number=readUint32(e,t);const n=e[t+4],a=63&n;if(!Qi[a])throw new Jbig2Error("invalid segment type: "+a);i.type=a,i.typeName=Qi[a],i.deferredNonRetain=!!(128&n);const s=!!(64&n),r=e[t+5];let o=r>>5&7;const l=[31&r];let c=t+6;if(7===r){o=536870911&readUint32(e,c-1),c+=3;let t=o+7>>3;for(l[0]=e[c++];--t>0;)l.push(e[c++])}else if(5===r||6===r)throw new Jbig2Error("invalid referred-to flags");i.retainBits=l;let h=4;i.number<=256?h=1:i.number<=65536&&(h=2);const d=[];let u,g;for(u=0;u<o;u++){let t;t=1===h?e[c]:2===h?readUint16(e,c):readUint32(e,c),d.push(t),c+=h}if(i.referredTo=d,s?(i.pageAssociation=readUint32(e,c),c+=4):i.pageAssociation=e[c++],i.length=readUint32(e,c),c+=4,4294967295===i.length){if(38!==a)throw new Jbig2Error("invalid unknown segment length");{const t=readRegionSegmentInformation(e,c),n=!!(1&e[c+an]),a=6,s=new Uint8Array(a);for(n||(s[0]=255,s[1]=172),s[2]=t.height>>>24&255,s[3]=t.height>>16&255,s[4]=t.height>>8&255,s[5]=255&t.height,u=c,g=e.length;u<g;u++){let t=0;for(;t<a&&s[t]===e[u+t];)t++;if(t===a){i.length=u+a;break}}if(4294967295===i.length)throw new Jbig2Error("segment end was not found")}}return i.headerEnd=c,i}function readSegments(e,t,i,n){const a=[];let s=i;for(;s<n;){const i=readSegmentHeader(t,s);s=i.headerEnd;const n={header:i,data:t};if(e.randomAccess||(n.start=s,s+=i.length,n.end=s),a.push(n),51===i.type)break}if(e.randomAccess)for(let e=0,t=a.length;e<t;e++)a[e].start=s,s+=a[e].header.length,a[e].end=s;return a}function readRegionSegmentInformation(e,t){return{width:readUint32(e,t),height:readUint32(e,t+4),x:readUint32(e,t+8),y:readUint32(e,t+12),combinationOperator:7&e[t+16]}}const an=17;function processSegment(e,t){const i=e.header,n=e.data,a=e.end;let s,r,o,l,c=e.start;switch(i.type){case 0:const e={},t=readUint16(n,c);if(e.huffman=!!(1&t),e.refinement=!!(2&t),e.huffmanDHSelector=t>>2&3,e.huffmanDWSelector=t>>4&3,e.bitmapSizeSelector=t>>6&1,e.aggregationInstancesSelector=t>>7&1,e.bitmapCodingContextUsed=!!(256&t),e.bitmapCodingContextRetained=!!(512&t),e.template=t>>10&3,e.refinementTemplate=t>>12&1,c+=2,!e.huffman){for(l=0===e.template?4:1,r=[],o=0;o<l;o++)r.push({x:readInt8(n,c),y:readInt8(n,c+1)}),c+=2;e.at=r}if(e.refinement&&!e.refinementTemplate){for(r=[],o=0;o<2;o++)r.push({x:readInt8(n,c),y:readInt8(n,c+1)}),c+=2;e.refinementAt=r}e.numberOfExportedSymbols=readUint32(n,c),c+=4,e.numberOfNewSymbols=readUint32(n,c),c+=4,s=[e,i.number,i.referredTo,n,c,a];break;case 6:case 7:const h={};h.info=readRegionSegmentInformation(n,c),c+=an;const d=readUint16(n,c);if(c+=2,h.huffman=!!(1&d),h.refinement=!!(2&d),h.logStripSize=d>>2&3,h.stripSize=1<<h.logStripSize,h.referenceCorner=d>>4&3,h.transposed=!!(64&d),h.combinationOperator=d>>7&3,h.defaultPixelValue=d>>9&1,h.dsOffset=d<<17>>27,h.refinementTemplate=d>>15&1,h.huffman){const e=readUint16(n,c);c+=2,h.huffmanFS=3&e,h.huffmanDS=e>>2&3,h.huffmanDT=e>>4&3,h.huffmanRefinementDW=e>>6&3,h.huffmanRefinementDH=e>>8&3,h.huffmanRefinementDX=e>>10&3,h.huffmanRefinementDY=e>>12&3,h.huffmanRefinementSizeSelector=!!(16384&e)}if(h.refinement&&!h.refinementTemplate){for(r=[],o=0;o<2;o++)r.push({x:readInt8(n,c),y:readInt8(n,c+1)}),c+=2;h.refinementAt=r}h.numberOfSymbolInstances=readUint32(n,c),c+=4,s=[h,i.referredTo,n,c,a];break;case 16:const u={},g=n[c++];u.mmr=!!(1&g),u.template=g>>1&3,u.patternWidth=n[c++],u.patternHeight=n[c++],u.maxPatternIndex=readUint32(n,c),c+=4,s=[u,i.number,n,c,a];break;case 22:case 23:const f={};f.info=readRegionSegmentInformation(n,c),c+=an;const p=n[c++];f.mmr=!!(1&p),f.template=p>>1&3,f.enableSkip=!!(8&p),f.combinationOperator=p>>4&7,f.defaultPixelValue=p>>7&1,f.gridWidth=readUint32(n,c),c+=4,f.gridHeight=readUint32(n,c),c+=4,f.gridOffsetX=4294967295&readUint32(n,c),c+=4,f.gridOffsetY=4294967295&readUint32(n,c),c+=4,f.gridVectorX=readUint16(n,c),c+=2,f.gridVectorY=readUint16(n,c),c+=2,s=[f,i.referredTo,n,c,a];break;case 38:case 39:const m={};m.info=readRegionSegmentInformation(n,c),c+=an;const b=n[c++];if(m.mmr=!!(1&b),m.template=b>>1&3,m.prediction=!!(8&b),!m.mmr){for(l=0===m.template?4:1,r=[],o=0;o<l;o++)r.push({x:readInt8(n,c),y:readInt8(n,c+1)}),c+=2;m.at=r}s=[m,n,c,a];break;case 48:const y={width:readUint32(n,c),height:readUint32(n,c+4),resolutionX:readUint32(n,c+8),resolutionY:readUint32(n,c+12)};4294967295===y.height&&delete y.height;const w=n[c+16];readUint16(n,c+17),y.lossless=!!(1&w),y.refinement=!!(2&w),y.defaultPixelValue=w>>2&1,y.combinationOperator=w>>3&3,y.requiresBuffer=!!(32&w),y.combinationOperatorOverride=!!(64&w),s=[y];break;case 49:case 50:case 51:case 62:break;case 53:s=[i.number,n,c,a];break;default:throw new Jbig2Error(`segment type ${i.typeName}(${i.type}) is not implemented`)}const h="on"+i.typeName;h in t&&t[h].apply(t,s)}function processSegments(e,t){for(let i=0,n=e.length;i<n;i++)processSegment(e[i],t)}class SimpleSegmentVisitor{onPageInformation(e){this.currentPageInfo=e;const t=e.width+7>>3,i=new Uint8ClampedArray(t*e.height);e.defaultPixelValue&&i.fill(255),this.buffer=i}drawBitmap(e,t){const i=this.currentPageInfo,n=e.width,a=e.height,s=i.width+7>>3,r=i.combinationOperatorOverride?e.combinationOperator:i.combinationOperator,o=this.buffer,l=128>>(7&e.x);let c,h,d,u,g=e.y*s+(e.x>>3);switch(r){case 0:for(c=0;c<a;c++){for(d=l,u=g,h=0;h<n;h++)t[c][h]&&(o[u]|=d),d>>=1,d||(d=128,u++);g+=s}break;case 2:for(c=0;c<a;c++){for(d=l,u=g,h=0;h<n;h++)t[c][h]&&(o[u]^=d),d>>=1,d||(d=128,u++);g+=s}break;default:throw new Jbig2Error(`operator ${r} is not supported`)}}onImmediateGenericRegion(e,t,i,n){const a=e.info,s=new DecodingContext(t,i,n),r=decodeBitmap(e.mmr,a.width,a.height,e.template,e.prediction,0,e.at,s);this.drawBitmap(a,r)}onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion(...arguments)}onSymbolDictionary(e,t,i,n,a,s){let r,o;e.huffman&&(r=function(e,t,i){let n,a,s,r,o=0;switch(e.huffmanDHSelector){case 0:case 1:n=getStandardTable(e.huffmanDHSelector+4);break;case 3:n=getCustomHuffmanTable(o,t,i),o++;break;default:throw new Jbig2Error("invalid Huffman DH selector")}switch(e.huffmanDWSelector){case 0:case 1:a=getStandardTable(e.huffmanDWSelector+2);break;case 3:a=getCustomHuffmanTable(o,t,i),o++;break;default:throw new Jbig2Error("invalid Huffman DW selector")}e.bitmapSizeSelector?(s=getCustomHuffmanTable(o,t,i),o++):s=getStandardTable(1);r=e.aggregationInstancesSelector?getCustomHuffmanTable(o,t,i):getStandardTable(1);return{tableDeltaHeight:n,tableDeltaWidth:a,tableBitmapSize:s,tableAggregateInstances:r}}(e,i,this.customTables),o=new Reader(n,a,s));let l=this.symbols;l||(this.symbols=l={});const c=[];for(const e of i){const t=l[e];t&&c.push(...t)}const h=new DecodingContext(n,a,s);l[t]=function(e,t,i,n,a,s,r,o,l,c,h,d){if(e&&t)throw new Jbig2Error("symbol refinement with Huffman is not supported");const u=[];let g=0,f=log2(i.length+n);const p=h.decoder,m=h.contextCache;let b,y;for(e&&(b=getStandardTable(1),y=[],f=Math.max(f,1));u.length<n;){g+=e?s.tableDeltaHeight.decode(d):decodeInteger(m,"IADH",p);let n=0,a=0;const b=e?y.length:0;for(;;){const b=e?s.tableDeltaWidth.decode(d):decodeInteger(m,"IADW",p);if(null===b)break;let w;if(n+=b,a+=n,t){const a=decodeInteger(m,"IAAI",p);if(a>1)w=decodeTextRegion(e,t,n,g,0,a,1,i.concat(u),f,0,0,1,0,s,l,c,h,0,d);else{const e=decodeIAID(m,p,f),t=decodeInteger(m,"IARDX",p),a=decodeInteger(m,"IARDY",p);w=decodeRefinement(n,g,l,e<i.length?i[e]:u[e-i.length],t,a,0,c,h)}u.push(w)}else e?y.push(n):(w=decodeBitmap(!1,n,g,r,!1,0,o,h),u.push(w))}if(e&&!t){const e=s.tableBitmapSize.decode(d);let t;if(d.byteAlign(),0===e)t=readUncompressedBitmap(d,a,g);else{const i=d.end,n=d.position+e;d.end=n,t=decodeMMRBitmap(d,a,g,!1),d.end=i,d.position=n}const i=y.length;if(b===i-1)u.push(t);else{let e,n,a,s,r,o=0;for(e=b;e<i;e++){for(s=y[e],a=o+s,r=[],n=0;n<g;n++)r.push(t[n].subarray(o,a));u.push(r),o=a}}}}const w=[],x=[];let S,v,C=!1;const k=i.length+n;for(;x.length<k;){let t=e?b.decode(d):decodeInteger(m,"IAEX",p);for(;t--;)x.push(C);C=!C}for(S=0,v=i.length;S<v;S++)x[S]&&w.push(i[S]);for(let e=0;e<n;S++,e++)x[S]&&w.push(u[e]);return w}(e.huffman,e.refinement,c,e.numberOfNewSymbols,e.numberOfExportedSymbols,r,e.template,e.at,e.refinementTemplate,e.refinementAt,h,o)}onImmediateTextRegion(e,t,i,n,a){const s=e.info;let r,o;const l=this.symbols,c=[];for(const e of t){const t=l[e];t&&c.push(...t)}const h=log2(c.length);e.huffman&&(o=new Reader(i,n,a),r=function(e,t,i,n,a){const s=[];for(let e=0;e<=34;e++){const t=a.readBits(4);s.push(new HuffmanLine([e,t,0,0]))}const r=new HuffmanTable(s,!1);s.length=0;for(let e=0;e<n;){const t=r.decode(a);if(t>=32){let i,n,r;switch(t){case 32:if(0===e)throw new Jbig2Error("no previous value in symbol ID table");n=a.readBits(2)+3,i=s[e-1].prefixLength;break;case 33:n=a.readBits(3)+3,i=0;break;case 34:n=a.readBits(7)+11,i=0;break;default:throw new Jbig2Error("invalid code length in symbol ID table")}for(r=0;r<n;r++)s.push(new HuffmanLine([e,i,0,0])),e++}else s.push(new HuffmanLine([e,t,0,0])),e++}a.byteAlign();const o=new HuffmanTable(s,!1);let l,c,h,d=0;switch(e.huffmanFS){case 0:case 1:l=getStandardTable(e.huffmanFS+6);break;case 3:l=getCustomHuffmanTable(d,t,i),d++;break;default:throw new Jbig2Error("invalid Huffman FS selector")}switch(e.huffmanDS){case 0:case 1:case 2:c=getStandardTable(e.huffmanDS+8);break;case 3:c=getCustomHuffmanTable(d,t,i),d++;break;default:throw new Jbig2Error("invalid Huffman DS selector")}switch(e.huffmanDT){case 0:case 1:case 2:h=getStandardTable(e.huffmanDT+11);break;case 3:h=getCustomHuffmanTable(d,t,i),d++;break;default:throw new Jbig2Error("invalid Huffman DT selector")}if(e.refinement)throw new Jbig2Error("refinement with Huffman is not supported");return{symbolIDTable:o,tableFirstS:l,tableDeltaS:c,tableDeltaT:h}}(e,t,this.customTables,c.length,o));const d=new DecodingContext(i,n,a),u=decodeTextRegion(e.huffman,e.refinement,s.width,s.height,e.defaultPixelValue,e.numberOfSymbolInstances,e.stripSize,c,h,e.transposed,e.dsOffset,e.referenceCorner,e.combinationOperator,r,e.refinementTemplate,e.refinementAt,d,e.logStripSize,o);this.drawBitmap(s,u)}onImmediateLosslessTextRegion(){this.onImmediateTextRegion(...arguments)}onPatternDictionary(e,t,i,n,a){let s=this.patterns;s||(this.patterns=s={});const r=new DecodingContext(i,n,a);s[t]=function(e,t,i,n,a,s){const r=[];e||(r.push({x:-t,y:0}),0===a&&r.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2}));const o=decodeBitmap(e,(n+1)*t,i,a,!1,0,r,s),l=[];for(let e=0;e<=n;e++){const n=[],a=t*e,s=a+t;for(let e=0;e<i;e++)n.push(o[e].subarray(a,s));l.push(n)}return l}(e.mmr,e.patternWidth,e.patternHeight,e.maxPatternIndex,e.template,r)}onImmediateHalftoneRegion(e,t,i,n,a){const s=this.patterns[t[0]],r=e.info,o=new DecodingContext(i,n,a),l=function(e,t,i,n,a,s,r,o,l,c,h,d,u,g,f){if(r)throw new Jbig2Error("skip is not supported");if(0!==o)throw new Jbig2Error(`operator "${o}" is not supported in halftone region`);const p=[];let m,b,y;for(m=0;m<a;m++)y=new Uint8Array(n),s&&y.fill(s),p.push(y);const w=t.length,x=t[0],S=x[0].length,v=x.length,C=log2(w),k=[];e||(k.push({x:i<=1?3:2,y:-1}),0===i&&k.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2}));const T=[];let F,E,M,D,O,_,R,N,L,U,j;for(e&&(F=new Reader(f.data,f.start,f.end)),m=C-1;m>=0;m--)E=e?decodeMMRBitmap(F,l,c,!0):decodeBitmap(!1,l,c,i,!1,0,k,f),T[m]=E;for(M=0;M<c;M++)for(D=0;D<l;D++){for(O=0,_=0,b=C-1;b>=0;b--)O^=T[b][M][D],_|=O<<b;if(R=t[_],N=h+M*g+D*u>>8,L=d+M*u-D*g>>8,N>=0&&N+S<=n&&L>=0&&L+v<=a)for(m=0;m<v;m++)for(j=p[L+m],U=R[m],b=0;b<S;b++)j[N+b]|=U[b];else{let e,t;for(m=0;m<v;m++)if(t=L+m,!(t<0||t>=a))for(j=p[t],U=R[m],b=0;b<S;b++)e=N+b,e>=0&&e<n&&(j[e]|=U[b])}}return p}(e.mmr,s,e.template,r.width,r.height,e.defaultPixelValue,e.enableSkip,e.combinationOperator,e.gridWidth,e.gridHeight,e.gridOffsetX,e.gridOffsetY,e.gridVectorX,e.gridVectorY,o);this.drawBitmap(r,l)}onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion(...arguments)}onTables(e,t,i,n){let a=this.customTables;a||(this.customTables=a={}),a[e]=function(e,t,i){const n=e[t],a=4294967295&readUint32(e,t+1),s=4294967295&readUint32(e,t+5),r=new Reader(e,t+9,i),o=1+(n>>1&7),l=1+(n>>4&7),c=[];let h,d,u=a;do{h=r.readBits(o),d=r.readBits(l),c.push(new HuffmanLine([u,h,d,0])),u+=1<<d}while(u<s);h=r.readBits(o),c.push(new HuffmanLine([a-1,h,32,0,"lower"])),h=r.readBits(o),c.push(new HuffmanLine([s,h,32,0])),1&n&&(h=r.readBits(o),c.push(new HuffmanLine([h,0])));return new HuffmanTable(c,!1)}(t,i,n)}}class HuffmanLine{constructor(e){2===e.length?(this.isOOB=!0,this.rangeLow=0,this.prefixLength=e[0],this.rangeLength=0,this.prefixCode=e[1],this.isLowerRange=!1):(this.isOOB=!1,this.rangeLow=e[0],this.prefixLength=e[1],this.rangeLength=e[2],this.prefixCode=e[3],this.isLowerRange="lower"===e[4])}}class HuffmanTreeNode{constructor(e){this.children=[],e?(this.isLeaf=!0,this.rangeLength=e.rangeLength,this.rangeLow=e.rangeLow,this.isLowerRange=e.isLowerRange,this.isOOB=e.isOOB):this.isLeaf=!1}buildTree(e,t){const i=e.prefixCode>>t&1;if(t<=0)this.children[i]=new HuffmanTreeNode(e);else{let n=this.children[i];n||(this.children[i]=n=new HuffmanTreeNode(null)),n.buildTree(e,t-1)}}decodeNode(e){if(this.isLeaf){if(this.isOOB)return null;const t=e.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-t:t)}const t=this.children[e.readBit()];if(!t)throw new Jbig2Error("invalid Huffman data");return t.decodeNode(e)}}class HuffmanTable{constructor(e,t){t||this.assignPrefixCodes(e),this.rootNode=new HuffmanTreeNode(null);for(let t=0,i=e.length;t<i;t++){const i=e[t];i.prefixLength>0&&this.rootNode.buildTree(i,i.prefixLength-1)}}decode(e){return this.rootNode.decodeNode(e)}assignPrefixCodes(e){const t=e.length;let i=0;for(let n=0;n<t;n++)i=Math.max(i,e[n].prefixLength);const n=new Uint32Array(i+1);for(let i=0;i<t;i++)n[e[i].prefixLength]++;let a,s,r,o=1,l=0;for(n[0]=0;o<=i;){for(l=l+n[o-1]<<1,a=l,s=0;s<t;)r=e[s],r.prefixLength===o&&(r.prefixCode=a,a++),s++;o++}}}const sn={};function getStandardTable(e){let t,i=sn[e];if(i)return i;switch(e){case 1:t=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:t=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:t=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,"lower"],[75,7,32,126],[6,62]];break;case 4:t=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:t=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,"lower"],[76,6,32,62]];break;case 6:t=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,"lower"],[2048,6,32,63]];break;case 7:t=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,"lower"],[2048,5,32,31]];break;case 8:t=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,"lower"],[1670,9,32,511],[2,1]];break;case 9:t=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,"lower"],[3339,9,32,511],[2,0]];break;case 10:t=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,"lower"],[4166,8,32,255],[2,2]];break;case 11:t=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:t=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:t=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:t=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:t=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,"lower"],[25,7,32,127]];break;default:throw new Jbig2Error(`standard table B.${e} does not exist`)}for(let e=0,i=t.length;e<i;e++)t[e]=new HuffmanLine(t[e]);return i=new HuffmanTable(t,!0),sn[e]=i,i}class Reader{constructor(e,t,i){this.data=e,this.start=t,this.end=i,this.position=t,this.shift=-1,this.currentByte=0}readBit(){if(this.shift<0){if(this.position>=this.end)throw new Jbig2Error("end of data while reading bit");this.currentByte=this.data[this.position++],this.shift=7}const e=this.currentByte>>this.shift&1;return this.shift--,e}readBits(e){let t,i=0;for(t=e-1;t>=0;t--)i|=this.readBit()<<t;return i}byteAlign(){this.shift=-1}next(){return this.position>=this.end?-1:this.data[this.position++]}}function getCustomHuffmanTable(e,t,i){let n=0;for(let a=0,s=t.length;a<s;a++){const s=i[t[a]];if(s){if(e===n)return s;n++}}throw new Jbig2Error("can't find custom Huffman table")}function readUncompressedBitmap(e,t,i){const n=[];for(let a=0;a<i;a++){const i=new Uint8Array(t);n.push(i);for(let n=0;n<t;n++)i[n]=e.readBit();e.byteAlign()}return n}function decodeMMRBitmap(e,t,i,n){const a=new CCITTFaxDecoder(e,{K:-1,Columns:t,Rows:i,BlackIs1:!0,EndOfBlock:n}),s=[];let r,o=!1;for(let e=0;e<i;e++){const e=new Uint8Array(t);s.push(e);let i=-1;for(let n=0;n<t;n++)i<0&&(r=a.readNextChar(),-1===r&&(r=0,o=!0),i=7),e[n]=r>>i&1,i--}if(n&&!o){const e=5;for(let t=0;t<e&&-1!==a.readNextChar();t++);}return s}class Jbig2Image{parseChunks(e){return function(e){const t=new SimpleSegmentVisitor;for(let i=0,n=e.length;i<n;i++){const n=e[i];processSegments(readSegments({},n.data,n.start,n.end),t)}return t.buffer}(e)}parse(e){throw new Error("Not implemented: Jbig2Image.parse")}}class Jbig2Stream extends DecodeStream{constructor(e,t,i){super(t),this.stream=e,this.dict=e.dict,this.maybeLength=t,this.params=i}get bytes(){return shadow$1(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){this.decodeImage()}decodeImage(e){if(this.eof)return this.buffer;e||=this.bytes;const t=new Jbig2Image,i=[];if(this.params instanceof Dict){const e=this.params.get("JBIG2Globals");if(e instanceof BaseStream){const t=e.getBytes();i.push({data:t,start:0,end:t.length})}}i.push({data:e,start:0,end:e.length});const n=t.parseChunks(i),a=n.length;for(let e=0;e<a;e++)n[e]^=255;return this.buffer=n,this.bufferLength=a,this.eof=!0,this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}}class JpxStream extends DecodeStream{constructor(e,t,i){super(t),this.stream=e,this.dict=e.dict,this.maybeLength=t,this.params=i}get bytes(){return shadow$1(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(e){unreachable$1("JpxStream.readBlock")}get isAsyncDecoder(){return!0}async decodeImage(e,t){return this.eof||(e||=this.bytes,this.buffer=await JpxImage.decode(e,t),this.bufferLength=this.buffer.length,this.eof=!0),this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}}class LZWStream extends DecodeStream{constructor(e,t,i){super(t),this.str=e,this.dict=e.dict,this.cachedData=0,this.bitsCached=0;const n=4096,a={earlyChange:i,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(n),dictionaryLengths:new Uint16Array(n),dictionaryPrevCodes:new Uint16Array(n),currentSequence:new Uint8Array(n),currentSequenceLength:0};for(let e=0;e<256;++e)a.dictionaryValues[e]=e,a.dictionaryLengths[e]=1;this.lzwState=a}readBits(e){let t=this.bitsCached,i=this.cachedData;for(;t<e;){const e=this.str.getByte();if(-1===e)return this.eof=!0,null;i=i<<8|e,t+=8}return this.bitsCached=t-=e,this.cachedData=i,this.lastCode=null,i>>>t&(1<<e)-1}readBlock(){let e,t,i,n=1024;const a=this.lzwState;if(!a)return;const s=a.earlyChange;let r=a.nextCode;const o=a.dictionaryValues,l=a.dictionaryLengths,c=a.dictionaryPrevCodes;let h=a.codeLength,d=a.prevCode;const u=a.currentSequence;let g=a.currentSequenceLength,f=0,p=this.bufferLength,m=this.ensureBuffer(this.bufferLength+n);for(e=0;e<512;e++){const e=this.readBits(h),a=g>0;if(e<256)u[0]=e,g=1;else{if(!(e>=258)){if(256===e){h=9,r=258,g=0;continue}this.eof=!0,delete this.lzwState;break}if(e<r)for(g=l[e],t=g-1,i=e;t>=0;t--)u[t]=o[i],i=c[i];else u[g++]=u[0]}if(a&&(c[r]=d,l[r]=l[d]+1,o[r]=u[0],r++,h=r+s&r+s-1?h:0|Math.min(Math.log(r+s)/.6931471805599453+1,12)),d=e,f+=g,n<f){do{n+=512}while(n<f);m=this.ensureBuffer(this.bufferLength+n)}for(t=0;t<g;t++)m[p++]=u[t]}a.nextCode=r,a.codeLength=h,a.prevCode=d,a.currentSequenceLength=g,this.bufferLength=p}}class PredictorStream extends DecodeStream{constructor(e,t,i){if(super(t),!(i instanceof Dict))return e;const n=this.predictor=i.get("Predictor")||1;if(n<=1)return e;if(2!==n&&(n<10||n>15))throw new ti(`Unsupported predictor: ${n}`);this.readBlock=2===n?this.readBlockTiff:this.readBlockPng,this.str=e,this.dict=e.dict;const a=this.colors=i.get("Colors")||1,s=this.bits=i.get("BPC","BitsPerComponent")||8,r=this.columns=i.get("Columns")||1;return this.pixBytes=a*s+7>>3,this.rowBytes=r*a*s+7>>3,this}readBlockTiff(){const e=this.rowBytes,t=this.bufferLength,i=this.ensureBuffer(t+e),n=this.bits,a=this.colors,s=this.str.getBytes(e);if(this.eof=!s.length,this.eof)return;let r,o=0,l=0,c=0,h=0,d=t;if(1===n&&1===a)for(r=0;r<e;++r){let e=s[r]^o;e^=e>>1,e^=e>>2,e^=e>>4,o=(1&e)<<7,i[d++]=e}else if(8===n){for(r=0;r<a;++r)i[d++]=s[r];for(;r<e;++r)i[d]=i[d-a]+s[r],d++}else if(16===n){const t=2*a;for(r=0;r<t;++r)i[d++]=s[r];for(;r<e;r+=2){const e=((255&s[r])<<8)+(255&s[r+1])+((255&i[d-t])<<8)+(255&i[d-t+1]);i[d++]=e>>8&255,i[d++]=255&e}}else{const e=new Uint8Array(a+1),d=(1<<n)-1;let u=0,g=t;const f=this.columns;for(r=0;r<f;++r)for(let t=0;t<a;++t)c<n&&(o=o<<8|255&s[u++],c+=8),e[t]=e[t]+(o>>c-n)&d,c-=n,l=l<<n|e[t],h+=n,h>=8&&(i[g++]=l>>h-8&255,h-=8);h>0&&(i[g++]=(l<<8-h)+(o&(1<<8-h)-1))}this.bufferLength+=e}readBlockPng(){const e=this.rowBytes,t=this.pixBytes,i=this.str.getByte(),n=this.str.getBytes(e);if(this.eof=!n.length,this.eof)return;const a=this.bufferLength,s=this.ensureBuffer(a+e);let r=s.subarray(a-e,a);0===r.length&&(r=new Uint8Array(e));let o,l,c,h=a;switch(i){case 0:for(o=0;o<e;++o)s[h++]=n[o];break;case 1:for(o=0;o<t;++o)s[h++]=n[o];for(;o<e;++o)s[h]=s[h-t]+n[o]&255,h++;break;case 2:for(o=0;o<e;++o)s[h++]=r[o]+n[o]&255;break;case 3:for(o=0;o<t;++o)s[h++]=(r[o]>>1)+n[o];for(;o<e;++o)s[h]=(r[o]+s[h-t]>>1)+n[o]&255,h++;break;case 4:for(o=0;o<t;++o)l=r[o],c=n[o],s[h++]=l+c;for(;o<e;++o){l=r[o];const e=r[o-t],i=s[h-t],a=i+l-e;let d=a-i;d<0&&(d=-d);let u=a-l;u<0&&(u=-u);let g=a-e;g<0&&(g=-g),c=n[o],s[h++]=d<=u&&d<=g?i+c:u<=g?l+c:e+c}break;default:throw new ti(`Unsupported predictor: ${i}`)}this.bufferLength+=e}}class RunLengthStream extends DecodeStream{constructor(e,t){super(t),this.str=e,this.dict=e.dict}readBlock(){const e=this.str.getBytes(2);if(!e||e.length<2||128===e[0])return void(this.eof=!0);let t,i=this.bufferLength,n=e[0];if(n<128){if(t=this.ensureBuffer(i+n+1),t[i++]=e[1],n>0){const e=this.str.getBytes(n);t.set(e,i),i+=n}}else n=257-n,t=this.ensureBuffer(i+n+1),t.fill(e[1],i,i+n),i+=n;this.bufferLength=i}}class Parser{constructor({lexer:e,xref:t,allowStreams:i=!1,recoveryMode:n=!1}){this.lexer=e,this.xref=t,this.allowStreams=i,this.recoveryMode=n,this.imageCache=Object.create(null),this._imageId=0,this.refill()}refill(){this.buf1=this.lexer.getObj(),this.buf2=this.lexer.getObj()}shift(){this.buf2 instanceof Cmd&&"ID"===this.buf2.cmd?(this.buf1=this.buf2,this.buf2=null):(this.buf1=this.buf2,this.buf2=this.lexer.getObj())}tryShift(){try{return this.shift(),!0}catch(e){if(e instanceof MissingDataException)throw e;return!1}}getObj(e=null){const t=this.buf1;if(this.shift(),t instanceof Cmd)switch(t.cmd){case"BI":return this.makeInlineImage(e);case"[":const i=[];for(;!isCmd(this.buf1,"]")&&this.buf1!==ci;)i.push(this.getObj(e));if(this.buf1===ci){if(this.recoveryMode)return i;throw new ParserEOFException("End of file inside array.")}return this.shift(),i;case"<<":const n=new Dict(this.xref);for(;!isCmd(this.buf1,">>")&&this.buf1!==ci;){if(!(this.buf1 instanceof Name)){info$1("Malformed dictionary: key must be a name object"),this.shift();continue}const t=this.buf1.name;if(this.shift(),this.buf1===ci)break;n.set(t,this.getObj(e))}if(this.buf1===ci){if(this.recoveryMode)return n;throw new ParserEOFException("End of file inside dictionary.")}return isCmd(this.buf2,"stream")?this.allowStreams?this.makeStream(n,e):n:(this.shift(),n);default:return t}if(Number.isInteger(t)){if(Number.isInteger(this.buf1)&&isCmd(this.buf2,"R")){const e=Ref.get(t,this.buf1);return this.shift(),this.shift(),e}return t}return"string"==typeof t&&e?e.decryptString(t):t}findDefaultInlineStreamEnd(e){const{knownCommands:t}=this.lexer,i=e.pos;let n,a,s=0;for(;-1!==(n=e.getByte());)if(0===s)s=69===n?1:0;else if(1===s)s=73===n?2:0;else if(32===n||10===n||13===n){a=e.pos;const i=e.peekBytes(15),r=i.length;if(0===r)break;for(let e=0;e<r;e++)if(n=i[e],(0!==n||0===i[e+1])&&10!==n&&13!==n&&(n<32||n>127)){s=0;break}if(2!==s)continue;if(!t){warn$1("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");continue}const o=new Lexer(new Stream(e.peekBytes(75)),t);o._hexStringWarn=()=>{};let l=0;for(;;){const e=o.getObj();if(e===ci){s=0;break}if(e instanceof Cmd){const i=t[e.cmd];if(!i){s=0;break}if(i.variableArgs?l<=i.numArgs:l===i.numArgs)break;l=0;continue}l++}if(2===s)break}else s=0;-1===n&&(warn$1("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker"),a&&(warn$1('... trying to recover by using the last "EI" occurrence.'),e.skip(-(e.pos-a))));let r=4;return e.skip(-r),n=e.peekByte(),e.skip(r),isWhiteSpace(n)||r--,e.pos-r-i}findDCTDecodeInlineStreamEnd(e){const t=e.pos;let i,n,a=!1;for(;-1!==(i=e.getByte());)if(255===i){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:a=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:n=e.getUint16(),n>2?e.skip(n-2):e.skip(-2)}if(a)break}const s=e.pos-t;return-1===i?(warn$1("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead."),e.skip(-s),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),s)}findASCII85DecodeInlineStreamEnd(e){const t=e.pos;let i;for(;-1!==(i=e.getByte());)if(126===i){const t=e.pos;for(i=e.peekByte();isWhiteSpace(i);)e.skip(),i=e.peekByte();if(62===i){e.skip();break}if(e.pos>t){const t=e.peekBytes(2);if(69===t[0]&&73===t[1])break}}const n=e.pos-t;return-1===i?(warn$1("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead."),e.skip(-n),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),n)}findASCIIHexDecodeInlineStreamEnd(e){const t=e.pos;let i;for(;-1!==(i=e.getByte())&&62!==i;);const n=e.pos-t;return-1===i?(warn$1("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead."),e.skip(-n),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),n)}inlineStreamSkipEI(e){let t,i=0;for(;-1!==(t=e.getByte());)if(0===i)i=69===t?1:0;else if(1===i)i=73===t?2:0;else if(2===i)break}makeInlineImage(e){const t=this.lexer,i=t.stream,n=Object.create(null);let a;for(;!isCmd(this.buf1,"ID")&&this.buf1!==ci;){if(!(this.buf1 instanceof Name))throw new ti("Dictionary key must be a name object");const t=this.buf1.name;if(this.shift(),this.buf1===ci)break;n[t]=this.getObj(e)}-1!==t.beginInlineImagePos&&(a=i.pos-t.beginInlineImagePos);const s=this.xref.fetchIfRef(n.F||n.Filter);let r;if(s instanceof Name)r=s.name;else if(Array.isArray(s)){const e=this.xref.fetchIfRef(s[0]);e instanceof Name&&(r=e.name)}const o=i.pos;let l,c;switch(r){case"DCT":case"DCTDecode":l=this.findDCTDecodeInlineStreamEnd(i);break;case"A85":case"ASCII85Decode":l=this.findASCII85DecodeInlineStreamEnd(i);break;case"AHx":case"ASCIIHexDecode":l=this.findASCIIHexDecodeInlineStreamEnd(i);break;default:l=this.findDefaultInlineStreamEnd(i)}if(l<1e3&&a>0){const e=i.pos;i.pos=t.beginInlineImagePos,c=function(e){const t=[],i=e.length;let n=0;for(;n<i-1;)t.push(e[n++]<<8|e[n++]);return n<i&&t.push(e[n]),i+"_"+String.fromCharCode.apply(null,t)}(i.getBytes(a+l)),i.pos=e;const n=this.imageCache[c];if(void 0!==n)return this.buf2=Cmd.get("EI"),this.shift(),n.reset(),n}const h=new Dict(this.xref);for(const e in n)h.set(e,n[e]);let d=i.makeSubStream(o,l,h);return e&&(d=e.createStream(d,l)),d=this.filter(d,h,l),d.dict=h,void 0!==c&&(d.cacheKey="inline_img_"+ ++this._imageId,this.imageCache[c]=d),this.buf2=Cmd.get("EI"),this.shift(),d}#H(e){const{stream:t}=this.lexer;t.pos=e;const i=new Uint8Array([101,110,100]),n=i.length,a=[new Uint8Array([115,116,114,101,97,109]),new Uint8Array([115,116,101,97,109]),new Uint8Array([115,116,114,101,97])],s=9-n;for(;t.pos<t.end;){const r=t.peekBytes(2048),o=r.length-9;if(o<=0)break;let l=0;for(;l<o;){let o=0;for(;o<n&&r[l+o]===i[o];)o++;if(o>=n){let n=!1;for(const e of a){const t=e.length;let a=0;for(;a<t&&r[l+o+a]===e[a];)a++;if(a>=s){n=!0;break}if(a>=t){isWhiteSpace(r[l+o+a])&&(info$1(`Found "${bytesToString$1([...i,...e])}" when searching for endstream command.`),n=!0);break}}if(n)return t.pos+=l,t.pos-e}l++}t.pos+=o}return-1}makeStream(e,t){const i=this.lexer;let n=i.stream;i.skipToNextLine();const a=n.pos-1;let s=e.get("Length");if(Number.isInteger(s)||(info$1(`Bad length "${s&&s.toString()}" in stream.`),s=0),n.pos=a+s,i.nextChar(),this.tryShift()&&isCmd(this.buf2,"endstream"))this.shift();else{if(s=this.#H(a),s<0)throw new ti("Missing endstream command.");i.nextChar(),this.shift(),this.shift()}return this.shift(),n=n.makeSubStream(a,s,e),t&&(n=t.createStream(n,s)),n=this.filter(n,e,s),n.dict=e,n}filter(e,t,i){let n=t.get("F","Filter"),a=t.get("DP","DecodeParms");if(n instanceof Name)return Array.isArray(a)&&warn$1("/DecodeParms should not be an Array, when /Filter is a Name."),this.makeFilter(e,n.name,i,a);let s=i;if(Array.isArray(n)){const t=n,i=a;for(let r=0,o=t.length;r<o;++r){if(n=this.xref.fetchIfRef(t[r]),!(n instanceof Name))throw new ti(`Bad filter name "${n}"`);a=null,Array.isArray(i)&&r in i&&(a=this.xref.fetchIfRef(i[r])),e=this.makeFilter(e,n.name,s,a),s=null}}return e}makeFilter(e,t,i,n){if(0===i)return warn$1(`Empty "${t}" stream.`),new NullStream;try{switch(t){case"Fl":case"FlateDecode":return n?new PredictorStream(new FlateStream(e,i),i,n):new FlateStream(e,i);case"LZW":case"LZWDecode":let t=1;return n?(n.has("EarlyChange")&&(t=n.get("EarlyChange")),new PredictorStream(new LZWStream(e,i,t),i,n)):new LZWStream(e,i,t);case"DCT":case"DCTDecode":return new JpegStream(e,i,n);case"JPX":case"JPXDecode":return new JpxStream(e,i,n);case"A85":case"ASCII85Decode":return new Ascii85Stream(e,i);case"AHx":case"ASCIIHexDecode":return new AsciiHexStream(e,i);case"CCF":case"CCITTFaxDecode":return new CCITTFaxStream(e,i,n);case"RL":case"RunLengthDecode":return new RunLengthStream(e,i);case"JBIG2Decode":return new Jbig2Stream(e,i,n)}return warn$1(`Filter "${t}" is not supported.`),e}catch(e){if(e instanceof MissingDataException)throw e;return warn$1(`Invalid stream: "${e}"`),new NullStream}}}const rn=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function toHexDigit(e){return e>=48&&e<=57?15&e:e>=65&&e<=70||e>=97&&e<=102?9+(15&e):-1}class Lexer{constructor(e,t=null){this.stream=e,this.nextChar(),this.strBuf=[],this.knownCommands=t,this._hexStringNumWarn=0,this.beginInlineImagePos=-1}nextChar(){return this.currentChar=this.stream.getByte()}peekChar(){return this.stream.peekByte()}getNumber(){let e=this.currentChar,t=!1,i=0,n=1;if(45===e?(n=-1,e=this.nextChar(),45===e&&(e=this.nextChar())):43===e&&(e=this.nextChar()),10===e||13===e)do{e=this.nextChar()}while(10===e||13===e);if(46===e&&(i=10,e=this.nextChar()),e<48||e>57){const t=`Invalid number: ${String.fromCharCode(e)} (charCode ${e})`;if(isWhiteSpace(e)||40===e||60===e||-1===e)return info$1(`Lexer.getNumber - "${t}".`),0;throw new ti(t)}let a=e-48,s=0,r=1;for(;(e=this.nextChar())>=0;)if(e>=48&&e<=57){const n=e-48;t?s=10*s+n:(0!==i&&(i*=10),a=10*a+n)}else if(46===e){if(0!==i)break;i=1}else if(45===e)warn$1("Badly formatted number: minus sign in the middle");else{if(69!==e&&101!==e)break;if(e=this.peekChar(),43===e||45===e)r=45===e?-1:1,this.nextChar();else if(e<48||e>57)break;t=!0}return 0!==i&&(a/=i),t&&(a*=10**(r*s)),n*a}getString(){let e=1,t=!1;const i=this.strBuf;i.length=0;let n=this.nextChar();for(;;){let a=!1;switch(0|n){case-1:warn$1("Unterminated string"),t=!0;break;case 40:++e,i.push("(");break;case 41:0===--e?(this.nextChar(),t=!0):i.push(")");break;case 92:switch(n=this.nextChar(),n){case-1:warn$1("Unterminated string"),t=!0;break;case 110:i.push("\n");break;case 114:i.push("\r");break;case 116:i.push("\t");break;case 98:i.push("\b");break;case 102:i.push("\f");break;case 92:case 40:case 41:i.push(String.fromCharCode(n));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let e=15&n;n=this.nextChar(),a=!0,n>=48&&n<=55&&(e=(e<<3)+(15&n),n=this.nextChar(),n>=48&&n<=55&&(a=!1,e=(e<<3)+(15&n))),i.push(String.fromCharCode(e));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:i.push(String.fromCharCode(n))}break;default:i.push(String.fromCharCode(n))}if(t)break;a||(n=this.nextChar())}return i.join("")}getName(){let e,t;const i=this.strBuf;for(i.length=0;(e=this.nextChar())>=0&&!rn[e];)if(35===e){if(e=this.nextChar(),rn[e]){warn$1("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number."),i.push("#");break}const n=toHexDigit(e);if(-1!==n){t=e,e=this.nextChar();const a=toHexDigit(e);if(-1===a){if(warn$1(`Lexer_getName: Illegal digit (${String.fromCharCode(e)}) in hexadecimal number.`),i.push("#",String.fromCharCode(t)),rn[e])break;i.push(String.fromCharCode(e));continue}i.push(String.fromCharCode(n<<4|a))}else i.push("#",String.fromCharCode(e))}else i.push(String.fromCharCode(e));return i.length>127&&warn$1(`Name token is longer than allowed by the spec: ${i.length}`),Name.get(i.join(""))}_hexStringWarn(e){5!==this._hexStringNumWarn++?this._hexStringNumWarn>5||warn$1(`getHexString - ignoring invalid character: ${e}`):warn$1("getHexString - ignoring additional invalid characters.")}getHexString(){const e=this.strBuf;e.length=0;let t=this.currentChar,i=-1,n=-1;for(this._hexStringNumWarn=0;;){if(t<0){warn$1("Unterminated hex string");break}if(62===t){this.nextChar();break}1!==rn[t]?(n=toHexDigit(t),-1===n?this._hexStringWarn(t):-1===i?i=n:(e.push(String.fromCharCode(i<<4|n)),i=-1),t=this.nextChar()):t=this.nextChar()}return-1!==i&&e.push(String.fromCharCode(i<<4)),e.join("")}getObj(){let e=!1,t=this.currentChar;for(;;){if(t<0)return ci;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(1!==rn[t])break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:return this.nextChar(),Cmd.get("[");case 93:return this.nextChar(),Cmd.get("]");case 60:return t=this.nextChar(),60===t?(this.nextChar(),Cmd.get("<<")):this.getHexString();case 62:return t=this.nextChar(),62===t?(this.nextChar(),Cmd.get(">>")):Cmd.get(">");case 123:return this.nextChar(),Cmd.get("{");case 125:return this.nextChar(),Cmd.get("}");case 41:throw this.nextChar(),new ti(`Illegal character: ${t}`)}let i=String.fromCharCode(t);if(t<32||t>127){const e=this.peekChar();if(e>=32&&e<=127)return this.nextChar(),Cmd.get(i)}const n=this.knownCommands;let a=void 0!==n?.[i];for(;(t=this.nextChar())>=0&&!rn[t];){const e=i+String.fromCharCode(t);if(a&&void 0===n[e])break;if(128===i.length)throw new ti(`Command token too long: ${i.length}`);i=e,a=void 0!==n?.[i]}return"true"===i||"false"!==i&&("null"===i?null:("BI"===i&&(this.beginInlineImagePos=this.stream.pos),Cmd.get(i)))}skipToNextLine(){let e=this.currentChar;for(;e>=0;){if(13===e){e=this.nextChar(),10===e&&this.nextChar();break}if(10===e){this.nextChar();break}e=this.nextChar()}}}class Linearization{static create(e){function getInt(e,t,i=!1){const n=e.get(t);if(Number.isInteger(n)&&(i?n>=0:n>0))return n;throw new Error(`The "${t}" parameter in the linearization dictionary is invalid.`)}const t=new Parser({lexer:new Lexer(e),xref:null}),i=t.getObj(),n=t.getObj(),a=t.getObj(),s=t.getObj();let r,o;if(!(Number.isInteger(i)&&Number.isInteger(n)&&isCmd(a,"obj")&&s instanceof Dict&&"number"==typeof(r=s.get("Linearized"))&&r>0))return null;if((o=getInt(s,"L"))!==e.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:o,hints:function(e){const t=e.get("H");let i;if(Array.isArray(t)&&(2===(i=t.length)||4===i)){for(let e=0;e<i;e++){const i=t[e];if(!(Number.isInteger(i)&&i>0))throw new Error(`Hint (${e}) in the linearization dictionary is invalid.`)}return t}throw new Error("Hint array in the linearization dictionary is invalid.")}(s),objectNumberFirst:getInt(s,"O"),endFirst:getInt(s,"E"),numPages:getInt(s,"N"),mainXRefEntriesOffset:getInt(s,"T"),pageFirst:s.has("P")?getInt(s,"P",!0):0}}}const on=["Adobe-GB1-UCS2","Adobe-CNS1-UCS2","Adobe-Japan1-UCS2","Adobe-Korea1-UCS2","78-EUC-H","78-EUC-V","78-H","78-RKSJ-H","78-RKSJ-V","78-V","78ms-RKSJ-H","78ms-RKSJ-V","83pv-RKSJ-H","90ms-RKSJ-H","90ms-RKSJ-V","90msp-RKSJ-H","90msp-RKSJ-V","90pv-RKSJ-H","90pv-RKSJ-V","Add-H","Add-RKSJ-H","Add-RKSJ-V","Add-V","Adobe-CNS1-0","Adobe-CNS1-1","Adobe-CNS1-2","Adobe-CNS1-3","Adobe-CNS1-4","Adobe-CNS1-5","Adobe-CNS1-6","Adobe-GB1-0","Adobe-GB1-1","Adobe-GB1-2","Adobe-GB1-3","Adobe-GB1-4","Adobe-GB1-5","Adobe-Japan1-0","Adobe-Japan1-1","Adobe-Japan1-2","Adobe-Japan1-3","Adobe-Japan1-4","Adobe-Japan1-5","Adobe-Japan1-6","Adobe-Korea1-0","Adobe-Korea1-1","Adobe-Korea1-2","B5-H","B5-V","B5pc-H","B5pc-V","CNS-EUC-H","CNS-EUC-V","CNS1-H","CNS1-V","CNS2-H","CNS2-V","ETHK-B5-H","ETHK-B5-V","ETen-B5-H","ETen-B5-V","ETenms-B5-H","ETenms-B5-V","EUC-H","EUC-V","Ext-H","Ext-RKSJ-H","Ext-RKSJ-V","Ext-V","GB-EUC-H","GB-EUC-V","GB-H","GB-V","GBK-EUC-H","GBK-EUC-V","GBK2K-H","GBK2K-V","GBKp-EUC-H","GBKp-EUC-V","GBT-EUC-H","GBT-EUC-V","GBT-H","GBT-V","GBTpc-EUC-H","GBTpc-EUC-V","GBpc-EUC-H","GBpc-EUC-V","H","HKdla-B5-H","HKdla-B5-V","HKdlb-B5-H","HKdlb-B5-V","HKgccs-B5-H","HKgccs-B5-V","HKm314-B5-H","HKm314-B5-V","HKm471-B5-H","HKm471-B5-V","HKscs-B5-H","HKscs-B5-V","Hankaku","Hiragana","KSC-EUC-H","KSC-EUC-V","KSC-H","KSC-Johab-H","KSC-Johab-V","KSC-V","KSCms-UHC-H","KSCms-UHC-HW-H","KSCms-UHC-HW-V","KSCms-UHC-V","KSCpc-EUC-H","KSCpc-EUC-V","Katakana","NWP-H","NWP-V","RKSJ-H","RKSJ-V","Roman","UniCNS-UCS2-H","UniCNS-UCS2-V","UniCNS-UTF16-H","UniCNS-UTF16-V","UniCNS-UTF32-H","UniCNS-UTF32-V","UniCNS-UTF8-H","UniCNS-UTF8-V","UniGB-UCS2-H","UniGB-UCS2-V","UniGB-UTF16-H","UniGB-UTF16-V","UniGB-UTF32-H","UniGB-UTF32-V","UniGB-UTF8-H","UniGB-UTF8-V","UniJIS-UCS2-H","UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-V","UniJIS-UCS2-V","UniJIS-UTF16-H","UniJIS-UTF16-V","UniJIS-UTF32-H","UniJIS-UTF32-V","UniJIS-UTF8-H","UniJIS-UTF8-V","UniJIS2004-UTF16-H","UniJIS2004-UTF16-V","UniJIS2004-UTF32-H","UniJIS2004-UTF32-V","UniJIS2004-UTF8-H","UniJIS2004-UTF8-V","UniJISPro-UCS2-HW-V","UniJISPro-UCS2-V","UniJISPro-UTF8-V","UniJISX0213-UTF32-H","UniJISX0213-UTF32-V","UniJISX02132004-UTF32-H","UniJISX02132004-UTF32-V","UniKS-UCS2-H","UniKS-UCS2-V","UniKS-UTF16-H","UniKS-UTF16-V","UniKS-UTF32-H","UniKS-UTF32-V","UniKS-UTF8-H","UniKS-UTF8-V","V","WP-Symbol"],ln=2**24-1;class CMap{constructor(e=!1){this.codespaceRanges=[[],[],[],[]],this.numCodespaceRanges=0,this._map=[],this.name="",this.vertical=!1,this.useCMap=null,this.builtInCMap=e}addCodespaceRange(e,t,i){this.codespaceRanges[e-1].push(t,i),this.numCodespaceRanges++}mapCidRange(e,t,i){if(t-e>ln)throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");for(;e<=t;)this._map[e++]=i++}mapBfRange(e,t,i){if(t-e>ln)throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");const n=i.length-1;for(;e<=t;){this._map[e++]=i;const t=i.charCodeAt(n)+1;t>255?i=i.substring(0,n-1)+String.fromCharCode(i.charCodeAt(n-1)+1)+"\0":i=i.substring(0,n)+String.fromCharCode(t)}}mapBfRangeToArray(e,t,i){if(t-e>ln)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");const n=i.length;let a=0;for(;e<=t&&a<n;)this._map[e]=i[a++],++e}mapOne(e,t){this._map[e]=t}lookup(e){return this._map[e]}contains(e){return void 0!==this._map[e]}forEach(e){const t=this._map,i=t.length;if(i<=65536)for(let n=0;n<i;n++)void 0!==t[n]&&e(n,t[n]);else for(const i in t)e(i,t[i])}charCodeOf(e){const t=this._map;if(t.length<=65536)return t.indexOf(e);for(const i in t)if(t[i]===e)return 0|i;return-1}getMap(){return this._map}readCharCode(e,t,i){let n=0;const a=this.codespaceRanges;for(let s=0,r=a.length;s<r;s++){n=(n<<8|e.charCodeAt(t+s))>>>0;const r=a[s];for(let e=0,t=r.length;e<t;){const t=r[e++],a=r[e++];if(n>=t&&n<=a)return i.charcode=n,void(i.length=s+1)}}i.charcode=0,i.length=1}getCharCodeLength(e){const t=this.codespaceRanges;for(let i=0,n=t.length;i<n;i++){const n=t[i];for(let t=0,a=n.length;t<a;){const a=n[t++],s=n[t++];if(e>=a&&e<=s)return i+1}}return 1}get length(){return this._map.length}get isIdentityCMap(){if("Identity-H"!==this.name&&"Identity-V"!==this.name)return!1;if(65536!==this._map.length)return!1;for(let e=0;e<65536;e++)if(this._map[e]!==e)return!1;return!0}}class IdentityCMap extends CMap{constructor(e,t){super(),this.vertical=e,this.addCodespaceRange(t,0,65535)}mapCidRange(e,t,i){unreachable$1("should not call mapCidRange")}mapBfRange(e,t,i){unreachable$1("should not call mapBfRange")}mapBfRangeToArray(e,t,i){unreachable$1("should not call mapBfRangeToArray")}mapOne(e,t){unreachable$1("should not call mapCidOne")}lookup(e){return Number.isInteger(e)&&e<=65535?e:void 0}contains(e){return Number.isInteger(e)&&e<=65535}forEach(e){for(let t=0;t<=65535;t++)e(t,t)}charCodeOf(e){return Number.isInteger(e)&&e<=65535?e:-1}getMap(){const e=new Array(65536);for(let t=0;t<=65535;t++)e[t]=t;return e}get length(){return 65536}get isIdentityCMap(){unreachable$1("should not access .isIdentityCMap")}}function strToInt(e){let t=0;for(let i=0;i<e.length;i++)t=t<<8|e.charCodeAt(i);return t>>>0}function expectString(e){if("string"!=typeof e)throw new ti("Malformed CMap: expected string.")}function expectInt(e){if(!Number.isInteger(e))throw new ti("Malformed CMap: expected int.")}function parseBfChar(e,t){for(;;){let i=t.getObj();if(i===ci)break;if(isCmd(i,"endbfchar"))return;expectString(i);const n=strToInt(i);i=t.getObj(),expectString(i);const a=i;e.mapOne(n,a)}}function parseBfRange(e,t){for(;;){let i=t.getObj();if(i===ci)break;if(isCmd(i,"endbfrange"))return;expectString(i);const n=strToInt(i);i=t.getObj(),expectString(i);const a=strToInt(i);if(i=t.getObj(),Number.isInteger(i)||"string"==typeof i){const t=Number.isInteger(i)?String.fromCharCode(i):i;e.mapBfRange(n,a,t)}else{if(!isCmd(i,"["))break;{i=t.getObj();const s=[];for(;!isCmd(i,"]")&&i!==ci;)s.push(i),i=t.getObj();e.mapBfRangeToArray(n,a,s)}}}throw new ti("Invalid bf range.")}function parseCidChar(e,t){for(;;){let i=t.getObj();if(i===ci)break;if(isCmd(i,"endcidchar"))return;expectString(i);const n=strToInt(i);i=t.getObj(),expectInt(i);const a=i;e.mapOne(n,a)}}function parseCidRange(e,t){for(;;){let i=t.getObj();if(i===ci)break;if(isCmd(i,"endcidrange"))return;expectString(i);const n=strToInt(i);i=t.getObj(),expectString(i);const a=strToInt(i);i=t.getObj(),expectInt(i);const s=i;e.mapCidRange(n,a,s)}}function parseCodespaceRange(e,t){for(;;){let i=t.getObj();if(i===ci)break;if(isCmd(i,"endcodespacerange"))return;if("string"!=typeof i)break;const n=strToInt(i);if(i=t.getObj(),"string"!=typeof i)break;const a=strToInt(i);e.addCodespaceRange(i.length,n,a)}throw new ti("Invalid codespace range.")}function parseWMode(e,t){const i=t.getObj();Number.isInteger(i)&&(e.vertical=!!i)}function parseCMapName(e,t){const i=t.getObj();i instanceof Name&&(e.name=i.name)}async function parseCMap(e,t,i,n){let a,s;e:for(;;)try{const i=t.getObj();if(i===ci)break;if(i instanceof Name)"WMode"===i.name?parseWMode(e,t):"CMapName"===i.name&&parseCMapName(e,t),a=i;else if(i instanceof Cmd)switch(i.cmd){case"endcmap":break e;case"usecmap":a instanceof Name&&(s=a.name);break;case"begincodespacerange":parseCodespaceRange(e,t);break;case"beginbfchar":parseBfChar(e,t);break;case"begincidchar":parseCidChar(e,t);break;case"beginbfrange":parseBfRange(e,t);break;case"begincidrange":parseCidRange(e,t)}}catch(e){if(e instanceof MissingDataException)throw e;warn$1("Invalid cMap data: "+e);continue}return!n&&s&&(n=s),n?extendCMap(e,i,n):e}async function extendCMap(e,t,i){if(e.useCMap=await createBuiltInCMap(i,t),0===e.numCodespaceRanges){const t=e.useCMap.codespaceRanges;for(let i=0;i<t.length;i++)e.codespaceRanges[i]=t[i].slice();e.numCodespaceRanges=e.useCMap.numCodespaceRanges}return e.useCMap.forEach(function(t,i){e.contains(t)||e.mapOne(t,i)}),e}async function createBuiltInCMap(e,t){if("Identity-H"===e)return new IdentityCMap(!1,2);if("Identity-V"===e)return new IdentityCMap(!0,2);if(!on.includes(e))throw new Error("Unknown CMap name: "+e);if(!t)throw new Error("Built-in CMap parameters are not provided.");const{cMapData:i,isCompressed:n}=await t(e),a=new CMap(!0);if(n)return(new BinaryCMapReader).process(i,a,e=>extendCMap(a,t,e));const s=new Lexer(new Stream(i));return parseCMap(a,s,t,null)}class CMapFactory{static async create({encoding:e,fetchBuiltInCMap:t,useCMap:i}){if(e instanceof Name)return createBuiltInCMap(e.name,t);if(e instanceof BaseStream){const n=await parseCMap(new CMap,new Lexer(e),t,i);return n.isIdentityCMap?createBuiltInCMap(n.name,t):n}throw new Error("Encoding required.")}}const cn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],hn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","centoldstyle","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","","threequartersemdash","","questionsmall","","","","","Ethsmall","","","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","","","","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hypheninferior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","asuperior","centsuperior","","","","","Aacutesmall","Agravesmall","Acircumflexsmall","Adieresissmall","Atildesmall","Aringsmall","Ccedillasmall","Eacutesmall","Egravesmall","Ecircumflexsmall","Edieresissmall","Iacutesmall","Igravesmall","Icircumflexsmall","Idieresissmall","Ntildesmall","Oacutesmall","Ogravesmall","Ocircumflexsmall","Odieresissmall","Otildesmall","Uacutesmall","Ugravesmall","Ucircumflexsmall","Udieresissmall","","eightsuperior","fourinferior","threeinferior","sixinferior","eightinferior","seveninferior","Scaronsmall","","centinferior","twoinferior","","Dieresissmall","","Caronsmall","osuperior","fiveinferior","","commainferior","periodinferior","Yacutesmall","","dollarinferior","","","Thornsmall","","nineinferior","zeroinferior","Zcaronsmall","AEsmall","Oslashsmall","questiondownsmall","oneinferior","Lslashsmall","","","","","","","Cedillasmall","","","","","","OEsmall","figuredash","hyphensuperior","","","","","exclamdownsmall","","Ydieresissmall","","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","ninesuperior","zerosuperior","","esuperior","rsuperior","tsuperior","","","isuperior","ssuperior","dsuperior","","","","","","lsuperior","Ogoneksmall","Brevesmall","Macronsmall","bsuperior","nsuperior","msuperior","commasuperior","periodsuperior","Dotaccentsmall","Ringsmall","","","",""],dn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","space","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron"],un=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls","","","",""],gn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","bullet","Euro","bullet","quotesinglbase","florin","quotedblbase","ellipsis","dagger","daggerdbl","circumflex","perthousand","Scaron","guilsinglleft","OE","bullet","Zcaron","bullet","bullet","quoteleft","quoteright","quotedblleft","quotedblright","bullet","endash","emdash","tilde","trademark","scaron","guilsinglright","oe","bullet","zcaron","Ydieresis","space","exclamdown","cent","sterling","currency","yen","brokenbar","section","dieresis","copyright","ordfeminine","guillemotleft","logicalnot","hyphen","registered","macron","degree","plusminus","twosuperior","threesuperior","acute","mu","paragraph","periodcentered","cedilla","onesuperior","ordmasculine","guillemotright","onequarter","onehalf","threequarters","questiondown","Agrave","Aacute","Acircumflex","Atilde","Adieresis","Aring","AE","Ccedilla","Egrave","Eacute","Ecircumflex","Edieresis","Igrave","Iacute","Icircumflex","Idieresis","Eth","Ntilde","Ograve","Oacute","Ocircumflex","Otilde","Odieresis","multiply","Oslash","Ugrave","Uacute","Ucircumflex","Udieresis","Yacute","Thorn","germandbls","agrave","aacute","acircumflex","atilde","adieresis","aring","ae","ccedilla","egrave","eacute","ecircumflex","edieresis","igrave","iacute","icircumflex","idieresis","eth","ntilde","ograve","oacute","ocircumflex","otilde","odieresis","divide","oslash","ugrave","uacute","ucircumflex","udieresis","yacute","thorn","ydieresis"],fn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","universal","numbersign","existential","percent","ampersand","suchthat","parenleft","parenright","asteriskmath","plus","comma","minus","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","congruent","Alpha","Beta","Chi","Delta","Epsilon","Phi","Gamma","Eta","Iota","theta1","Kappa","Lambda","Mu","Nu","Omicron","Pi","Theta","Rho","Sigma","Tau","Upsilon","sigma1","Omega","Xi","Psi","Zeta","bracketleft","therefore","bracketright","perpendicular","underscore","radicalex","alpha","beta","chi","delta","epsilon","phi","gamma","eta","iota","phi1","kappa","lambda","mu","nu","omicron","pi","theta","rho","sigma","tau","upsilon","omega1","omega","xi","psi","zeta","braceleft","bar","braceright","similar","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Euro","Upsilon1","minute","lessequal","fraction","infinity","florin","club","diamond","heart","spade","arrowboth","arrowleft","arrowup","arrowright","arrowdown","degree","plusminus","second","greaterequal","multiply","proportional","partialdiff","bullet","divide","notequal","equivalence","approxequal","ellipsis","arrowvertex","arrowhorizex","carriagereturn","aleph","Ifraktur","Rfraktur","weierstrass","circlemultiply","circleplus","emptyset","intersection","union","propersuperset","reflexsuperset","notsubset","propersubset","reflexsubset","element","notelement","angle","gradient","registerserif","copyrightserif","trademarkserif","product","radical","dotmath","logicalnot","logicaland","logicalor","arrowdblboth","arrowdblleft","arrowdblup","arrowdblright","arrowdbldown","lozenge","angleleft","registersans","copyrightsans","trademarksans","summation","parenlefttp","parenleftex","parenleftbt","bracketlefttp","bracketleftex","bracketleftbt","bracelefttp","braceleftmid","braceleftbt","braceex","","angleright","integral","integraltp","integralex","integralbt","parenrighttp","parenrightex","parenrightbt","bracketrighttp","bracketrightex","bracketrightbt","bracerighttp","bracerightmid","bracerightbt",""],pn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","a1","a2","a202","a3","a4","a5","a119","a118","a117","a11","a12","a13","a14","a15","a16","a105","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27","a28","a6","a7","a8","a9","a10","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40","a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53","a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66","a67","a68","a69","a70","a71","a72","a73","a74","a203","a75","a204","a76","a77","a78","a79","a81","a82","a83","a84","a97","a98","a99","a100","","a89","a90","a93","a94","a91","a92","a205","a85","a206","a86","a87","a88","a95","a96","","","","","","","","","","","","","","","","","","","","a101","a102","a103","a104","a106","a107","a108","a112","a111","a110","a109","a120","a121","a122","a123","a124","a125","a126","a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137","a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148","a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159","a160","a161","a163","a164","a196","a165","a192","a166","a167","a168","a169","a170","a171","a172","a173","a162","a174","a175","a176","a177","a178","a179","a193","a180","a199","a181","a200","a182","","a201","a183","a184","a197","a185","a194","a198","a186","a195","a187","a188","a189","a190","a191",""];function getEncoding(e){switch(e){case"WinAnsiEncoding":return gn;case"StandardEncoding":return un;case"MacRomanEncoding":return dn;case"SymbolSetEncoding":return fn;case"ZapfDingbatsEncoding":return pn;case"ExpertEncoding":return cn;case"MacExpertEncoding":return hn;default:return null}}const mn=getLookupTableFactory(function(e){e.A=65,e.AE=198,e.AEacute=508,e.AEmacron=482,e.AEsmall=63462,e.Aacute=193,e.Aacutesmall=63457,e.Abreve=258,e.Abreveacute=7854,e.Abrevecyrillic=1232,e.Abrevedotbelow=7862,e.Abrevegrave=7856,e.Abrevehookabove=7858,e.Abrevetilde=7860,e.Acaron=461,e.Acircle=9398,e.Acircumflex=194,e.Acircumflexacute=7844,e.Acircumflexdotbelow=7852,e.Acircumflexgrave=7846,e.Acircumflexhookabove=7848,e.Acircumflexsmall=63458,e.Acircumflextilde=7850,e.Acute=63177,e.Acutesmall=63412,e.Acyrillic=1040,e.Adblgrave=512,e.Adieresis=196,e.Adieresiscyrillic=1234,e.Adieresismacron=478,e.Adieresissmall=63460,e.Adotbelow=7840,e.Adotmacron=480,e.Agrave=192,e.Agravesmall=63456,e.Ahookabove=7842,e.Aiecyrillic=1236,e.Ainvertedbreve=514,e.Alpha=913,e.Alphatonos=902,e.Amacron=256,e.Amonospace=65313,e.Aogonek=260,e.Aring=197,e.Aringacute=506,e.Aringbelow=7680,e.Aringsmall=63461,e.Asmall=63329,e.Atilde=195,e.Atildesmall=63459,e.Aybarmenian=1329,e.B=66,e.Bcircle=9399,e.Bdotaccent=7682,e.Bdotbelow=7684,e.Becyrillic=1041,e.Benarmenian=1330,e.Beta=914,e.Bhook=385,e.Blinebelow=7686,e.Bmonospace=65314,e.Brevesmall=63220,e.Bsmall=63330,e.Btopbar=386,e.C=67,e.Caarmenian=1342,e.Cacute=262,e.Caron=63178,e.Caronsmall=63221,e.Ccaron=268,e.Ccedilla=199,e.Ccedillaacute=7688,e.Ccedillasmall=63463,e.Ccircle=9400,e.Ccircumflex=264,e.Cdot=266,e.Cdotaccent=266,e.Cedillasmall=63416,e.Chaarmenian=1353,e.Cheabkhasiancyrillic=1212,e.Checyrillic=1063,e.Chedescenderabkhasiancyrillic=1214,e.Chedescendercyrillic=1206,e.Chedieresiscyrillic=1268,e.Cheharmenian=1347,e.Chekhakassiancyrillic=1227,e.Cheverticalstrokecyrillic=1208,e.Chi=935,e.Chook=391,e.Circumflexsmall=63222,e.Cmonospace=65315,e.Coarmenian=1361,e.Csmall=63331,e.D=68,e.DZ=497,e.DZcaron=452,e.Daarmenian=1332,e.Dafrican=393,e.Dcaron=270,e.Dcedilla=7696,e.Dcircle=9401,e.Dcircumflexbelow=7698,e.Dcroat=272,e.Ddotaccent=7690,e.Ddotbelow=7692,e.Decyrillic=1044,e.Deicoptic=1006,e.Delta=8710,e.Deltagreek=916,e.Dhook=394,e.Dieresis=63179,e.DieresisAcute=63180,e.DieresisGrave=63181,e.Dieresissmall=63400,e.Digammagreek=988,e.Djecyrillic=1026,e.Dlinebelow=7694,e.Dmonospace=65316,e.Dotaccentsmall=63223,e.Dslash=272,e.Dsmall=63332,e.Dtopbar=395,e.Dz=498,e.Dzcaron=453,e.Dzeabkhasiancyrillic=1248,e.Dzecyrillic=1029,e.Dzhecyrillic=1039,e.E=69,e.Eacute=201,e.Eacutesmall=63465,e.Ebreve=276,e.Ecaron=282,e.Ecedillabreve=7708,e.Echarmenian=1333,e.Ecircle=9402,e.Ecircumflex=202,e.Ecircumflexacute=7870,e.Ecircumflexbelow=7704,e.Ecircumflexdotbelow=7878,e.Ecircumflexgrave=7872,e.Ecircumflexhookabove=7874,e.Ecircumflexsmall=63466,e.Ecircumflextilde=7876,e.Ecyrillic=1028,e.Edblgrave=516,e.Edieresis=203,e.Edieresissmall=63467,e.Edot=278,e.Edotaccent=278,e.Edotbelow=7864,e.Efcyrillic=1060,e.Egrave=200,e.Egravesmall=63464,e.Eharmenian=1335,e.Ehookabove=7866,e.Eightroman=8551,e.Einvertedbreve=518,e.Eiotifiedcyrillic=1124,e.Elcyrillic=1051,e.Elevenroman=8554,e.Emacron=274,e.Emacronacute=7702,e.Emacrongrave=7700,e.Emcyrillic=1052,e.Emonospace=65317,e.Encyrillic=1053,e.Endescendercyrillic=1186,e.Eng=330,e.Enghecyrillic=1188,e.Enhookcyrillic=1223,e.Eogonek=280,e.Eopen=400,e.Epsilon=917,e.Epsilontonos=904,e.Ercyrillic=1056,e.Ereversed=398,e.Ereversedcyrillic=1069,e.Escyrillic=1057,e.Esdescendercyrillic=1194,e.Esh=425,e.Esmall=63333,e.Eta=919,e.Etarmenian=1336,e.Etatonos=905,e.Eth=208,e.Ethsmall=63472,e.Etilde=7868,e.Etildebelow=7706,e.Euro=8364,e.Ezh=439,e.Ezhcaron=494,e.Ezhreversed=440,e.F=70,e.Fcircle=9403,e.Fdotaccent=7710,e.Feharmenian=1366,e.Feicoptic=996,e.Fhook=401,e.Fitacyrillic=1138,e.Fiveroman=8548,e.Fmonospace=65318,e.Fourroman=8547,e.Fsmall=63334,e.G=71,e.GBsquare=13191,e.Gacute=500,e.Gamma=915,e.Gammaafrican=404,e.Gangiacoptic=1002,e.Gbreve=286,e.Gcaron=486,e.Gcedilla=290,e.Gcircle=9404,e.Gcircumflex=284,e.Gcommaaccent=290,e.Gdot=288,e.Gdotaccent=288,e.Gecyrillic=1043,e.Ghadarmenian=1346,e.Ghemiddlehookcyrillic=1172,e.Ghestrokecyrillic=1170,e.Gheupturncyrillic=1168,e.Ghook=403,e.Gimarmenian=1331,e.Gjecyrillic=1027,e.Gmacron=7712,e.Gmonospace=65319,e.Grave=63182,e.Gravesmall=63328,e.Gsmall=63335,e.Gsmallhook=667,e.Gstroke=484,e.H=72,e.H18533=9679,e.H18543=9642,e.H18551=9643,e.H22073=9633,e.HPsquare=13259,e.Haabkhasiancyrillic=1192,e.Hadescendercyrillic=1202,e.Hardsigncyrillic=1066,e.Hbar=294,e.Hbrevebelow=7722,e.Hcedilla=7720,e.Hcircle=9405,e.Hcircumflex=292,e.Hdieresis=7718,e.Hdotaccent=7714,e.Hdotbelow=7716,e.Hmonospace=65320,e.Hoarmenian=1344,e.Horicoptic=1e3,e.Hsmall=63336,e.Hungarumlaut=63183,e.Hungarumlautsmall=63224,e.Hzsquare=13200,e.I=73,e.IAcyrillic=1071,e.IJ=306,e.IUcyrillic=1070,e.Iacute=205,e.Iacutesmall=63469,e.Ibreve=300,e.Icaron=463,e.Icircle=9406,e.Icircumflex=206,e.Icircumflexsmall=63470,e.Icyrillic=1030,e.Idblgrave=520,e.Idieresis=207,e.Idieresisacute=7726,e.Idieresiscyrillic=1252,e.Idieresissmall=63471,e.Idot=304,e.Idotaccent=304,e.Idotbelow=7882,e.Iebrevecyrillic=1238,e.Iecyrillic=1045,e.Ifraktur=8465,e.Igrave=204,e.Igravesmall=63468,e.Ihookabove=7880,e.Iicyrillic=1048,e.Iinvertedbreve=522,e.Iishortcyrillic=1049,e.Imacron=298,e.Imacroncyrillic=1250,e.Imonospace=65321,e.Iniarmenian=1339,e.Iocyrillic=1025,e.Iogonek=302,e.Iota=921,e.Iotaafrican=406,e.Iotadieresis=938,e.Iotatonos=906,e.Ismall=63337,e.Istroke=407,e.Itilde=296,e.Itildebelow=7724,e.Izhitsacyrillic=1140,e.Izhitsadblgravecyrillic=1142,e.J=74,e.Jaarmenian=1345,e.Jcircle=9407,e.Jcircumflex=308,e.Jecyrillic=1032,e.Jheharmenian=1355,e.Jmonospace=65322,e.Jsmall=63338,e.K=75,e.KBsquare=13189,e.KKsquare=13261,e.Kabashkircyrillic=1184,e.Kacute=7728,e.Kacyrillic=1050,e.Kadescendercyrillic=1178,e.Kahookcyrillic=1219,e.Kappa=922,e.Kastrokecyrillic=1182,e.Kaverticalstrokecyrillic=1180,e.Kcaron=488,e.Kcedilla=310,e.Kcircle=9408,e.Kcommaaccent=310,e.Kdotbelow=7730,e.Keharmenian=1364,e.Kenarmenian=1343,e.Khacyrillic=1061,e.Kheicoptic=998,e.Khook=408,e.Kjecyrillic=1036,e.Klinebelow=7732,e.Kmonospace=65323,e.Koppacyrillic=1152,e.Koppagreek=990,e.Ksicyrillic=1134,e.Ksmall=63339,e.L=76,e.LJ=455,e.LL=63167,e.Lacute=313,e.Lambda=923,e.Lcaron=317,e.Lcedilla=315,e.Lcircle=9409,e.Lcircumflexbelow=7740,e.Lcommaaccent=315,e.Ldot=319,e.Ldotaccent=319,e.Ldotbelow=7734,e.Ldotbelowmacron=7736,e.Liwnarmenian=1340,e.Lj=456,e.Ljecyrillic=1033,e.Llinebelow=7738,e.Lmonospace=65324,e.Lslash=321,e.Lslashsmall=63225,e.Lsmall=63340,e.M=77,e.MBsquare=13190,e.Macron=63184,e.Macronsmall=63407,e.Macute=7742,e.Mcircle=9410,e.Mdotaccent=7744,e.Mdotbelow=7746,e.Menarmenian=1348,e.Mmonospace=65325,e.Msmall=63341,e.Mturned=412,e.Mu=924,e.N=78,e.NJ=458,e.Nacute=323,e.Ncaron=327,e.Ncedilla=325,e.Ncircle=9411,e.Ncircumflexbelow=7754,e.Ncommaaccent=325,e.Ndotaccent=7748,e.Ndotbelow=7750,e.Nhookleft=413,e.Nineroman=8552,e.Nj=459,e.Njecyrillic=1034,e.Nlinebelow=7752,e.Nmonospace=65326,e.Nowarmenian=1350,e.Nsmall=63342,e.Ntilde=209,e.Ntildesmall=63473,e.Nu=925,e.O=79,e.OE=338,e.OEsmall=63226,e.Oacute=211,e.Oacutesmall=63475,e.Obarredcyrillic=1256,e.Obarreddieresiscyrillic=1258,e.Obreve=334,e.Ocaron=465,e.Ocenteredtilde=415,e.Ocircle=9412,e.Ocircumflex=212,e.Ocircumflexacute=7888,e.Ocircumflexdotbelow=7896,e.Ocircumflexgrave=7890,e.Ocircumflexhookabove=7892,e.Ocircumflexsmall=63476,e.Ocircumflextilde=7894,e.Ocyrillic=1054,e.Odblacute=336,e.Odblgrave=524,e.Odieresis=214,e.Odieresiscyrillic=1254,e.Odieresissmall=63478,e.Odotbelow=7884,e.Ogoneksmall=63227,e.Ograve=210,e.Ogravesmall=63474,e.Oharmenian=1365,e.Ohm=8486,e.Ohookabove=7886,e.Ohorn=416,e.Ohornacute=7898,e.Ohorndotbelow=7906,e.Ohorngrave=7900,e.Ohornhookabove=7902,e.Ohorntilde=7904,e.Ohungarumlaut=336,e.Oi=418,e.Oinvertedbreve=526,e.Omacron=332,e.Omacronacute=7762,e.Omacrongrave=7760,e.Omega=8486,e.Omegacyrillic=1120,e.Omegagreek=937,e.Omegaroundcyrillic=1146,e.Omegatitlocyrillic=1148,e.Omegatonos=911,e.Omicron=927,e.Omicrontonos=908,e.Omonospace=65327,e.Oneroman=8544,e.Oogonek=490,e.Oogonekmacron=492,e.Oopen=390,e.Oslash=216,e.Oslashacute=510,e.Oslashsmall=63480,e.Osmall=63343,e.Ostrokeacute=510,e.Otcyrillic=1150,e.Otilde=213,e.Otildeacute=7756,e.Otildedieresis=7758,e.Otildesmall=63477,e.P=80,e.Pacute=7764,e.Pcircle=9413,e.Pdotaccent=7766,e.Pecyrillic=1055,e.Peharmenian=1354,e.Pemiddlehookcyrillic=1190,e.Phi=934,e.Phook=420,e.Pi=928,e.Piwrarmenian=1363,e.Pmonospace=65328,e.Psi=936,e.Psicyrillic=1136,e.Psmall=63344,e.Q=81,e.Qcircle=9414,e.Qmonospace=65329,e.Qsmall=63345,e.R=82,e.Raarmenian=1356,e.Racute=340,e.Rcaron=344,e.Rcedilla=342,e.Rcircle=9415,e.Rcommaaccent=342,e.Rdblgrave=528,e.Rdotaccent=7768,e.Rdotbelow=7770,e.Rdotbelowmacron=7772,e.Reharmenian=1360,e.Rfraktur=8476,e.Rho=929,e.Ringsmall=63228,e.Rinvertedbreve=530,e.Rlinebelow=7774,e.Rmonospace=65330,e.Rsmall=63346,e.Rsmallinverted=641,e.Rsmallinvertedsuperior=694,e.S=83,e.SF010000=9484,e.SF020000=9492,e.SF030000=9488,e.SF040000=9496,e.SF050000=9532,e.SF060000=9516,e.SF070000=9524,e.SF080000=9500,e.SF090000=9508,e.SF100000=9472,e.SF110000=9474,e.SF190000=9569,e.SF200000=9570,e.SF210000=9558,e.SF220000=9557,e.SF230000=9571,e.SF240000=9553,e.SF250000=9559,e.SF260000=9565,e.SF270000=9564,e.SF280000=9563,e.SF360000=9566,e.SF370000=9567,e.SF380000=9562,e.SF390000=9556,e.SF400000=9577,e.SF410000=9574,e.SF420000=9568,e.SF430000=9552,e.SF440000=9580,e.SF450000=9575,e.SF460000=9576,e.SF470000=9572,e.SF480000=9573,e.SF490000=9561,e.SF500000=9560,e.SF510000=9554,e.SF520000=9555,e.SF530000=9579,e.SF540000=9578,e.Sacute=346,e.Sacutedotaccent=7780,e.Sampigreek=992,e.Scaron=352,e.Scarondotaccent=7782,e.Scaronsmall=63229,e.Scedilla=350,e.Schwa=399,e.Schwacyrillic=1240,e.Schwadieresiscyrillic=1242,e.Scircle=9416,e.Scircumflex=348,e.Scommaaccent=536,e.Sdotaccent=7776,e.Sdotbelow=7778,e.Sdotbelowdotaccent=7784,e.Seharmenian=1357,e.Sevenroman=8550,e.Shaarmenian=1351,e.Shacyrillic=1064,e.Shchacyrillic=1065,e.Sheicoptic=994,e.Shhacyrillic=1210,e.Shimacoptic=1004,e.Sigma=931,e.Sixroman=8549,e.Smonospace=65331,e.Softsigncyrillic=1068,e.Ssmall=63347,e.Stigmagreek=986,e.T=84,e.Tau=932,e.Tbar=358,e.Tcaron=356,e.Tcedilla=354,e.Tcircle=9417,e.Tcircumflexbelow=7792,e.Tcommaaccent=354,e.Tdotaccent=7786,e.Tdotbelow=7788,e.Tecyrillic=1058,e.Tedescendercyrillic=1196,e.Tenroman=8553,e.Tetsecyrillic=1204,e.Theta=920,e.Thook=428,e.Thorn=222,e.Thornsmall=63486,e.Threeroman=8546,e.Tildesmall=63230,e.Tiwnarmenian=1359,e.Tlinebelow=7790,e.Tmonospace=65332,e.Toarmenian=1337,e.Tonefive=444,e.Tonesix=388,e.Tonetwo=423,e.Tretroflexhook=430,e.Tsecyrillic=1062,e.Tshecyrillic=1035,e.Tsmall=63348,e.Twelveroman=8555,e.Tworoman=8545,e.U=85,e.Uacute=218,e.Uacutesmall=63482,e.Ubreve=364,e.Ucaron=467,e.Ucircle=9418,e.Ucircumflex=219,e.Ucircumflexbelow=7798,e.Ucircumflexsmall=63483,e.Ucyrillic=1059,e.Udblacute=368,e.Udblgrave=532,e.Udieresis=220,e.Udieresisacute=471,e.Udieresisbelow=7794,e.Udieresiscaron=473,e.Udieresiscyrillic=1264,e.Udieresisgrave=475,e.Udieresismacron=469,e.Udieresissmall=63484,e.Udotbelow=7908,e.Ugrave=217,e.Ugravesmall=63481,e.Uhookabove=7910,e.Uhorn=431,e.Uhornacute=7912,e.Uhorndotbelow=7920,e.Uhorngrave=7914,e.Uhornhookabove=7916,e.Uhorntilde=7918,e.Uhungarumlaut=368,e.Uhungarumlautcyrillic=1266,e.Uinvertedbreve=534,e.Ukcyrillic=1144,e.Umacron=362,e.Umacroncyrillic=1262,e.Umacrondieresis=7802,e.Umonospace=65333,e.Uogonek=370,e.Upsilon=933,e.Upsilon1=978,e.Upsilonacutehooksymbolgreek=979,e.Upsilonafrican=433,e.Upsilondieresis=939,e.Upsilondieresishooksymbolgreek=980,e.Upsilonhooksymbol=978,e.Upsilontonos=910,e.Uring=366,e.Ushortcyrillic=1038,e.Usmall=63349,e.Ustraightcyrillic=1198,e.Ustraightstrokecyrillic=1200,e.Utilde=360,e.Utildeacute=7800,e.Utildebelow=7796,e.V=86,e.Vcircle=9419,e.Vdotbelow=7806,e.Vecyrillic=1042,e.Vewarmenian=1358,e.Vhook=434,e.Vmonospace=65334,e.Voarmenian=1352,e.Vsmall=63350,e.Vtilde=7804,e.W=87,e.Wacute=7810,e.Wcircle=9420,e.Wcircumflex=372,e.Wdieresis=7812,e.Wdotaccent=7814,e.Wdotbelow=7816,e.Wgrave=7808,e.Wmonospace=65335,e.Wsmall=63351,e.X=88,e.Xcircle=9421,e.Xdieresis=7820,e.Xdotaccent=7818,e.Xeharmenian=1341,e.Xi=926,e.Xmonospace=65336,e.Xsmall=63352,e.Y=89,e.Yacute=221,e.Yacutesmall=63485,e.Yatcyrillic=1122,e.Ycircle=9422,e.Ycircumflex=374,e.Ydieresis=376,e.Ydieresissmall=63487,e.Ydotaccent=7822,e.Ydotbelow=7924,e.Yericyrillic=1067,e.Yerudieresiscyrillic=1272,e.Ygrave=7922,e.Yhook=435,e.Yhookabove=7926,e.Yiarmenian=1349,e.Yicyrillic=1031,e.Yiwnarmenian=1362,e.Ymonospace=65337,e.Ysmall=63353,e.Ytilde=7928,e.Yusbigcyrillic=1130,e.Yusbigiotifiedcyrillic=1132,e.Yuslittlecyrillic=1126,e.Yuslittleiotifiedcyrillic=1128,e.Z=90,e.Zaarmenian=1334,e.Zacute=377,e.Zcaron=381,e.Zcaronsmall=63231,e.Zcircle=9423,e.Zcircumflex=7824,e.Zdot=379,e.Zdotaccent=379,e.Zdotbelow=7826,e.Zecyrillic=1047,e.Zedescendercyrillic=1176,e.Zedieresiscyrillic=1246,e.Zeta=918,e.Zhearmenian=1338,e.Zhebrevecyrillic=1217,e.Zhecyrillic=1046,e.Zhedescendercyrillic=1174,e.Zhedieresiscyrillic=1244,e.Zlinebelow=7828,e.Zmonospace=65338,e.Zsmall=63354,e.Zstroke=437,e.a=97,e.aabengali=2438,e.aacute=225,e.aadeva=2310,e.aagujarati=2694,e.aagurmukhi=2566,e.aamatragurmukhi=2622,e.aarusquare=13059,e.aavowelsignbengali=2494,e.aavowelsigndeva=2366,e.aavowelsigngujarati=2750,e.abbreviationmarkarmenian=1375,e.abbreviationsigndeva=2416,e.abengali=2437,e.abopomofo=12570,e.abreve=259,e.abreveacute=7855,e.abrevecyrillic=1233,e.abrevedotbelow=7863,e.abrevegrave=7857,e.abrevehookabove=7859,e.abrevetilde=7861,e.acaron=462,e.acircle=9424,e.acircumflex=226,e.acircumflexacute=7845,e.acircumflexdotbelow=7853,e.acircumflexgrave=7847,e.acircumflexhookabove=7849,e.acircumflextilde=7851,e.acute=180,e.acutebelowcmb=791,e.acutecmb=769,e.acutecomb=769,e.acutedeva=2388,e.acutelowmod=719,e.acutetonecmb=833,e.acyrillic=1072,e.adblgrave=513,e.addakgurmukhi=2673,e.adeva=2309,e.adieresis=228,e.adieresiscyrillic=1235,e.adieresismacron=479,e.adotbelow=7841,e.adotmacron=481,e.ae=230,e.aeacute=509,e.aekorean=12624,e.aemacron=483,e.afii00208=8213,e.afii08941=8356,e.afii10017=1040,e.afii10018=1041,e.afii10019=1042,e.afii10020=1043,e.afii10021=1044,e.afii10022=1045,e.afii10023=1025,e.afii10024=1046,e.afii10025=1047,e.afii10026=1048,e.afii10027=1049,e.afii10028=1050,e.afii10029=1051,e.afii10030=1052;e.afii10031=1053,e.afii10032=1054,e.afii10033=1055,e.afii10034=1056,e.afii10035=1057,e.afii10036=1058,e.afii10037=1059,e.afii10038=1060,e.afii10039=1061,e.afii10040=1062,e.afii10041=1063,e.afii10042=1064,e.afii10043=1065,e.afii10044=1066,e.afii10045=1067,e.afii10046=1068,e.afii10047=1069,e.afii10048=1070,e.afii10049=1071,e.afii10050=1168,e.afii10051=1026,e.afii10052=1027,e.afii10053=1028,e.afii10054=1029,e.afii10055=1030,e.afii10056=1031,e.afii10057=1032,e.afii10058=1033,e.afii10059=1034,e.afii10060=1035,e.afii10061=1036,e.afii10062=1038,e.afii10063=63172,e.afii10064=63173,e.afii10065=1072,e.afii10066=1073,e.afii10067=1074,e.afii10068=1075,e.afii10069=1076,e.afii10070=1077,e.afii10071=1105,e.afii10072=1078,e.afii10073=1079,e.afii10074=1080,e.afii10075=1081,e.afii10076=1082,e.afii10077=1083,e.afii10078=1084,e.afii10079=1085,e.afii10080=1086,e.afii10081=1087,e.afii10082=1088,e.afii10083=1089,e.afii10084=1090,e.afii10085=1091,e.afii10086=1092,e.afii10087=1093,e.afii10088=1094,e.afii10089=1095,e.afii10090=1096,e.afii10091=1097,e.afii10092=1098,e.afii10093=1099,e.afii10094=1100,e.afii10095=1101,e.afii10096=1102,e.afii10097=1103,e.afii10098=1169,e.afii10099=1106,e.afii10100=1107,e.afii10101=1108,e.afii10102=1109,e.afii10103=1110,e.afii10104=1111,e.afii10105=1112,e.afii10106=1113,e.afii10107=1114,e.afii10108=1115,e.afii10109=1116,e.afii10110=1118,e.afii10145=1039,e.afii10146=1122,e.afii10147=1138,e.afii10148=1140,e.afii10192=63174,e.afii10193=1119,e.afii10194=1123,e.afii10195=1139,e.afii10196=1141,e.afii10831=63175,e.afii10832=63176,e.afii10846=1241,e.afii299=8206,e.afii300=8207,e.afii301=8205,e.afii57381=1642,e.afii57388=1548,e.afii57392=1632,e.afii57393=1633,e.afii57394=1634,e.afii57395=1635,e.afii57396=1636,e.afii57397=1637,e.afii57398=1638,e.afii57399=1639,e.afii57400=1640,e.afii57401=1641,e.afii57403=1563,e.afii57407=1567,e.afii57409=1569,e.afii57410=1570,e.afii57411=1571,e.afii57412=1572,e.afii57413=1573,e.afii57414=1574,e.afii57415=1575,e.afii57416=1576,e.afii57417=1577,e.afii57418=1578,e.afii57419=1579,e.afii57420=1580,e.afii57421=1581,e.afii57422=1582,e.afii57423=1583,e.afii57424=1584,e.afii57425=1585,e.afii57426=1586,e.afii57427=1587,e.afii57428=1588,e.afii57429=1589,e.afii57430=1590,e.afii57431=1591,e.afii57432=1592,e.afii57433=1593,e.afii57434=1594,e.afii57440=1600,e.afii57441=1601,e.afii57442=1602,e.afii57443=1603,e.afii57444=1604,e.afii57445=1605,e.afii57446=1606,e.afii57448=1608,e.afii57449=1609,e.afii57450=1610,e.afii57451=1611,e.afii57452=1612,e.afii57453=1613,e.afii57454=1614,e.afii57455=1615,e.afii57456=1616,e.afii57457=1617,e.afii57458=1618,e.afii57470=1607,e.afii57505=1700,e.afii57506=1662,e.afii57507=1670,e.afii57508=1688,e.afii57509=1711,e.afii57511=1657,e.afii57512=1672,e.afii57513=1681,e.afii57514=1722,e.afii57519=1746,e.afii57534=1749,e.afii57636=8362,e.afii57645=1470,e.afii57658=1475,e.afii57664=1488,e.afii57665=1489,e.afii57666=1490,e.afii57667=1491,e.afii57668=1492,e.afii57669=1493,e.afii57670=1494,e.afii57671=1495,e.afii57672=1496,e.afii57673=1497,e.afii57674=1498,e.afii57675=1499,e.afii57676=1500,e.afii57677=1501,e.afii57678=1502,e.afii57679=1503,e.afii57680=1504,e.afii57681=1505,e.afii57682=1506,e.afii57683=1507,e.afii57684=1508,e.afii57685=1509,e.afii57686=1510,e.afii57687=1511,e.afii57688=1512,e.afii57689=1513,e.afii57690=1514,e.afii57694=64298,e.afii57695=64299,e.afii57700=64331,e.afii57705=64287,e.afii57716=1520,e.afii57717=1521,e.afii57718=1522,e.afii57723=64309,e.afii57793=1460,e.afii57794=1461,e.afii57795=1462,e.afii57796=1467,e.afii57797=1464,e.afii57798=1463,e.afii57799=1456,e.afii57800=1458,e.afii57801=1457,e.afii57802=1459,e.afii57803=1474,e.afii57804=1473,e.afii57806=1465,e.afii57807=1468,e.afii57839=1469,e.afii57841=1471,e.afii57842=1472,e.afii57929=700,e.afii61248=8453,e.afii61289=8467,e.afii61352=8470,e.afii61573=8236,e.afii61574=8237,e.afii61575=8238,e.afii61664=8204,e.afii63167=1645,e.afii64937=701,e.agrave=224,e.agujarati=2693,e.agurmukhi=2565,e.ahiragana=12354,e.ahookabove=7843,e.aibengali=2448,e.aibopomofo=12574,e.aideva=2320,e.aiecyrillic=1237,e.aigujarati=2704,e.aigurmukhi=2576,e.aimatragurmukhi=2632,e.ainarabic=1593,e.ainfinalarabic=65226,e.aininitialarabic=65227,e.ainmedialarabic=65228,e.ainvertedbreve=515,e.aivowelsignbengali=2504,e.aivowelsigndeva=2376,e.aivowelsigngujarati=2760,e.akatakana=12450,e.akatakanahalfwidth=65393,e.akorean=12623,e.alef=1488,e.alefarabic=1575,e.alefdageshhebrew=64304,e.aleffinalarabic=65166,e.alefhamzaabovearabic=1571,e.alefhamzaabovefinalarabic=65156,e.alefhamzabelowarabic=1573,e.alefhamzabelowfinalarabic=65160,e.alefhebrew=1488,e.aleflamedhebrew=64335,e.alefmaddaabovearabic=1570,e.alefmaddaabovefinalarabic=65154,e.alefmaksuraarabic=1609,e.alefmaksurafinalarabic=65264,e.alefmaksurainitialarabic=65267,e.alefmaksuramedialarabic=65268,e.alefpatahhebrew=64302,e.alefqamatshebrew=64303,e.aleph=8501,e.allequal=8780,e.alpha=945,e.alphatonos=940,e.amacron=257,e.amonospace=65345,e.ampersand=38,e.ampersandmonospace=65286,e.ampersandsmall=63270,e.amsquare=13250,e.anbopomofo=12578,e.angbopomofo=12580,e.angbracketleft=12296,e.angbracketright=12297,e.angkhankhuthai=3674,e.angle=8736,e.anglebracketleft=12296,e.anglebracketleftvertical=65087,e.anglebracketright=12297,e.anglebracketrightvertical=65088,e.angleleft=9001,e.angleright=9002,e.angstrom=8491,e.anoteleia=903,e.anudattadeva=2386,e.anusvarabengali=2434,e.anusvaradeva=2306,e.anusvaragujarati=2690,e.aogonek=261,e.apaatosquare=13056,e.aparen=9372,e.apostrophearmenian=1370,e.apostrophemod=700,e.apple=63743,e.approaches=8784,e.approxequal=8776,e.approxequalorimage=8786,e.approximatelyequal=8773,e.araeaekorean=12686,e.araeakorean=12685,e.arc=8978,e.arighthalfring=7834,e.aring=229,e.aringacute=507,e.aringbelow=7681,e.arrowboth=8596,e.arrowdashdown=8675,e.arrowdashleft=8672,e.arrowdashright=8674,e.arrowdashup=8673,e.arrowdblboth=8660,e.arrowdbldown=8659,e.arrowdblleft=8656,e.arrowdblright=8658,e.arrowdblup=8657,e.arrowdown=8595,e.arrowdownleft=8601,e.arrowdownright=8600,e.arrowdownwhite=8681,e.arrowheaddownmod=709,e.arrowheadleftmod=706,e.arrowheadrightmod=707,e.arrowheadupmod=708,e.arrowhorizex=63719,e.arrowleft=8592,e.arrowleftdbl=8656,e.arrowleftdblstroke=8653,e.arrowleftoverright=8646,e.arrowleftwhite=8678,e.arrowright=8594,e.arrowrightdblstroke=8655,e.arrowrightheavy=10142,e.arrowrightoverleft=8644,e.arrowrightwhite=8680,e.arrowtableft=8676,e.arrowtabright=8677,e.arrowup=8593,e.arrowupdn=8597,e.arrowupdnbse=8616,e.arrowupdownbase=8616,e.arrowupleft=8598,e.arrowupleftofdown=8645,e.arrowupright=8599,e.arrowupwhite=8679,e.arrowvertex=63718,e.asciicircum=94,e.asciicircummonospace=65342,e.asciitilde=126,e.asciitildemonospace=65374,e.ascript=593,e.ascriptturned=594,e.asmallhiragana=12353,e.asmallkatakana=12449,e.asmallkatakanahalfwidth=65383,e.asterisk=42,e.asteriskaltonearabic=1645,e.asteriskarabic=1645,e.asteriskmath=8727,e.asteriskmonospace=65290,e.asterisksmall=65121,e.asterism=8258,e.asuperior=63209,e.asymptoticallyequal=8771,e.at=64,e.atilde=227,e.atmonospace=65312,e.atsmall=65131,e.aturned=592,e.aubengali=2452,e.aubopomofo=12576,e.audeva=2324,e.augujarati=2708,e.augurmukhi=2580,e.aulengthmarkbengali=2519,e.aumatragurmukhi=2636,e.auvowelsignbengali=2508,e.auvowelsigndeva=2380,e.auvowelsigngujarati=2764,e.avagrahadeva=2365,e.aybarmenian=1377,e.ayin=1506,e.ayinaltonehebrew=64288,e.ayinhebrew=1506,e.b=98,e.babengali=2476,e.backslash=92,e.backslashmonospace=65340,e.badeva=2348,e.bagujarati=2732,e.bagurmukhi=2604,e.bahiragana=12400,e.bahtthai=3647,e.bakatakana=12496,e.bar=124,e.barmonospace=65372,e.bbopomofo=12549,e.bcircle=9425,e.bdotaccent=7683,e.bdotbelow=7685,e.beamedsixteenthnotes=9836,e.because=8757,e.becyrillic=1073,e.beharabic=1576,e.behfinalarabic=65168,e.behinitialarabic=65169,e.behiragana=12409,e.behmedialarabic=65170,e.behmeeminitialarabic=64671,e.behmeemisolatedarabic=64520,e.behnoonfinalarabic=64621,e.bekatakana=12505,e.benarmenian=1378,e.bet=1489,e.beta=946,e.betasymbolgreek=976,e.betdagesh=64305,e.betdageshhebrew=64305,e.bethebrew=1489,e.betrafehebrew=64332,e.bhabengali=2477,e.bhadeva=2349,e.bhagujarati=2733,e.bhagurmukhi=2605,e.bhook=595,e.bihiragana=12403,e.bikatakana=12499,e.bilabialclick=664,e.bindigurmukhi=2562,e.birusquare=13105,e.blackcircle=9679,e.blackdiamond=9670,e.blackdownpointingtriangle=9660,e.blackleftpointingpointer=9668,e.blackleftpointingtriangle=9664,e.blacklenticularbracketleft=12304,e.blacklenticularbracketleftvertical=65083,e.blacklenticularbracketright=12305,e.blacklenticularbracketrightvertical=65084,e.blacklowerlefttriangle=9699,e.blacklowerrighttriangle=9698,e.blackrectangle=9644,e.blackrightpointingpointer=9658,e.blackrightpointingtriangle=9654,e.blacksmallsquare=9642,e.blacksmilingface=9787,e.blacksquare=9632,e.blackstar=9733,e.blackupperlefttriangle=9700,e.blackupperrighttriangle=9701,e.blackuppointingsmalltriangle=9652,e.blackuppointingtriangle=9650,e.blank=9251,e.blinebelow=7687,e.block=9608,e.bmonospace=65346,e.bobaimaithai=3610,e.bohiragana=12412,e.bokatakana=12508,e.bparen=9373,e.bqsquare=13251,e.braceex=63732,e.braceleft=123,e.braceleftbt=63731,e.braceleftmid=63730,e.braceleftmonospace=65371,e.braceleftsmall=65115,e.bracelefttp=63729,e.braceleftvertical=65079,e.braceright=125,e.bracerightbt=63742,e.bracerightmid=63741,e.bracerightmonospace=65373,e.bracerightsmall=65116,e.bracerighttp=63740,e.bracerightvertical=65080,e.bracketleft=91,e.bracketleftbt=63728,e.bracketleftex=63727,e.bracketleftmonospace=65339,e.bracketlefttp=63726,e.bracketright=93,e.bracketrightbt=63739,e.bracketrightex=63738,e.bracketrightmonospace=65341,e.bracketrighttp=63737,e.breve=728,e.brevebelowcmb=814,e.brevecmb=774,e.breveinvertedbelowcmb=815,e.breveinvertedcmb=785,e.breveinverteddoublecmb=865,e.bridgebelowcmb=810,e.bridgeinvertedbelowcmb=826,e.brokenbar=166,e.bstroke=384,e.bsuperior=63210,e.btopbar=387,e.buhiragana=12406,e.bukatakana=12502,e.bullet=8226,e.bulletinverse=9688,e.bulletoperator=8729,e.bullseye=9678,e.c=99,e.caarmenian=1390,e.cabengali=2458,e.cacute=263,e.cadeva=2330,e.cagujarati=2714,e.cagurmukhi=2586,e.calsquare=13192,e.candrabindubengali=2433,e.candrabinducmb=784,e.candrabindudeva=2305,e.candrabindugujarati=2689,e.capslock=8682,e.careof=8453,e.caron=711,e.caronbelowcmb=812,e.caroncmb=780,e.carriagereturn=8629,e.cbopomofo=12568,e.ccaron=269,e.ccedilla=231,e.ccedillaacute=7689,e.ccircle=9426,e.ccircumflex=265,e.ccurl=597,e.cdot=267,e.cdotaccent=267,e.cdsquare=13253,e.cedilla=184,e.cedillacmb=807,e.cent=162,e.centigrade=8451,e.centinferior=63199,e.centmonospace=65504,e.centoldstyle=63394,e.centsuperior=63200,e.chaarmenian=1401,e.chabengali=2459,e.chadeva=2331,e.chagujarati=2715,e.chagurmukhi=2587,e.chbopomofo=12564,e.cheabkhasiancyrillic=1213,e.checkmark=10003,e.checyrillic=1095,e.chedescenderabkhasiancyrillic=1215,e.chedescendercyrillic=1207,e.chedieresiscyrillic=1269,e.cheharmenian=1395,e.chekhakassiancyrillic=1228,e.cheverticalstrokecyrillic=1209,e.chi=967,e.chieuchacirclekorean=12919,e.chieuchaparenkorean=12823,e.chieuchcirclekorean=12905,e.chieuchkorean=12618,e.chieuchparenkorean=12809,e.chochangthai=3594,e.chochanthai=3592,e.chochingthai=3593,e.chochoethai=3596,e.chook=392,e.cieucacirclekorean=12918,e.cieucaparenkorean=12822,e.cieuccirclekorean=12904,e.cieuckorean=12616,e.cieucparenkorean=12808,e.cieucuparenkorean=12828,e.circle=9675,e.circlecopyrt=169,e.circlemultiply=8855,e.circleot=8857,e.circleplus=8853,e.circlepostalmark=12342,e.circlewithlefthalfblack=9680,e.circlewithrighthalfblack=9681,e.circumflex=710,e.circumflexbelowcmb=813,e.circumflexcmb=770,e.clear=8999,e.clickalveolar=450,e.clickdental=448,e.clicklateral=449,e.clickretroflex=451,e.club=9827,e.clubsuitblack=9827,e.clubsuitwhite=9831,e.cmcubedsquare=13220,e.cmonospace=65347,e.cmsquaredsquare=13216,e.coarmenian=1409,e.colon=58,e.colonmonetary=8353,e.colonmonospace=65306,e.colonsign=8353,e.colonsmall=65109,e.colontriangularhalfmod=721,e.colontriangularmod=720,e.comma=44,e.commaabovecmb=787,e.commaaboverightcmb=789,e.commaaccent=63171,e.commaarabic=1548,e.commaarmenian=1373,e.commainferior=63201,e.commamonospace=65292,e.commareversedabovecmb=788,e.commareversedmod=701,e.commasmall=65104,e.commasuperior=63202,e.commaturnedabovecmb=786,e.commaturnedmod=699,e.compass=9788,e.congruent=8773,e.contourintegral=8750,e.control=8963,e.controlACK=6,e.controlBEL=7,e.controlBS=8,e.controlCAN=24,e.controlCR=13,e.controlDC1=17,e.controlDC2=18,e.controlDC3=19,e.controlDC4=20,e.controlDEL=127,e.controlDLE=16,e.controlEM=25,e.controlENQ=5,e.controlEOT=4,e.controlESC=27,e.controlETB=23,e.controlETX=3,e.controlFF=12,e.controlFS=28,e.controlGS=29,e.controlHT=9,e.controlLF=10,e.controlNAK=21,e.controlNULL=0,e.controlRS=30,e.controlSI=15,e.controlSO=14,e.controlSOT=2,e.controlSTX=1,e.controlSUB=26,e.controlSYN=22,e.controlUS=31,e.controlVT=11,e.copyright=169,e.copyrightsans=63721,e.copyrightserif=63193,e.cornerbracketleft=12300,e.cornerbracketlefthalfwidth=65378,e.cornerbracketleftvertical=65089,e.cornerbracketright=12301,e.cornerbracketrighthalfwidth=65379,e.cornerbracketrightvertical=65090,e.corporationsquare=13183,e.cosquare=13255,e.coverkgsquare=13254,e.cparen=9374,e.cruzeiro=8354,e.cstretched=663,e.curlyand=8911,e.curlyor=8910,e.currency=164,e.cyrBreve=63185,e.cyrFlex=63186,e.cyrbreve=63188,e.cyrflex=63189,e.d=100,e.daarmenian=1380,e.dabengali=2470,e.dadarabic=1590,e.dadeva=2342,e.dadfinalarabic=65214,e.dadinitialarabic=65215,e.dadmedialarabic=65216,e.dagesh=1468,e.dageshhebrew=1468,e.dagger=8224,e.daggerdbl=8225,e.dagujarati=2726,e.dagurmukhi=2598,e.dahiragana=12384,e.dakatakana=12480,e.dalarabic=1583,e.dalet=1491,e.daletdagesh=64307,e.daletdageshhebrew=64307,e.dalethebrew=1491,e.dalfinalarabic=65194,e.dammaarabic=1615,e.dammalowarabic=1615,e.dammatanaltonearabic=1612,e.dammatanarabic=1612,e.danda=2404,e.dargahebrew=1447,e.dargalefthebrew=1447,e.dasiapneumatacyrilliccmb=1157,e.dblGrave=63187,e.dblanglebracketleft=12298,e.dblanglebracketleftvertical=65085,e.dblanglebracketright=12299,e.dblanglebracketrightvertical=65086,e.dblarchinvertedbelowcmb=811,e.dblarrowleft=8660,e.dblarrowright=8658,e.dbldanda=2405,e.dblgrave=63190,e.dblgravecmb=783,e.dblintegral=8748,e.dbllowline=8215,e.dbllowlinecmb=819,e.dbloverlinecmb=831,e.dblprimemod=698,e.dblverticalbar=8214,e.dblverticallineabovecmb=782,e.dbopomofo=12553,e.dbsquare=13256,e.dcaron=271,e.dcedilla=7697,e.dcircle=9427,e.dcircumflexbelow=7699,e.dcroat=273,e.ddabengali=2465,e.ddadeva=2337,e.ddagujarati=2721,e.ddagurmukhi=2593,e.ddalarabic=1672,e.ddalfinalarabic=64393,e.dddhadeva=2396,e.ddhabengali=2466,e.ddhadeva=2338,e.ddhagujarati=2722,e.ddhagurmukhi=2594,e.ddotaccent=7691,e.ddotbelow=7693,e.decimalseparatorarabic=1643,e.decimalseparatorpersian=1643,e.decyrillic=1076,e.degree=176,e.dehihebrew=1453,e.dehiragana=12391,e.deicoptic=1007,e.dekatakana=12487,e.deleteleft=9003,e.deleteright=8998,e.delta=948,e.deltaturned=397,e.denominatorminusonenumeratorbengali=2552,e.dezh=676,e.dhabengali=2471,e.dhadeva=2343,e.dhagujarati=2727,e.dhagurmukhi=2599,e.dhook=599,e.dialytikatonos=901,e.dialytikatonoscmb=836,e.diamond=9830,e.diamondsuitwhite=9826,e.dieresis=168,e.dieresisacute=63191,e.dieresisbelowcmb=804,e.dieresiscmb=776,e.dieresisgrave=63192,e.dieresistonos=901,e.dihiragana=12386,e.dikatakana=12482,e.dittomark=12291,e.divide=247,e.divides=8739,e.divisionslash=8725,e.djecyrillic=1106,e.dkshade=9619,e.dlinebelow=7695,e.dlsquare=13207,e.dmacron=273,e.dmonospace=65348,e.dnblock=9604,e.dochadathai=3598,e.dodekthai=3604,e.dohiragana=12393,e.dokatakana=12489,e.dollar=36;e.dollarinferior=63203,e.dollarmonospace=65284,e.dollaroldstyle=63268,e.dollarsmall=65129,e.dollarsuperior=63204,e.dong=8363,e.dorusquare=13094,e.dotaccent=729,e.dotaccentcmb=775,e.dotbelowcmb=803,e.dotbelowcomb=803,e.dotkatakana=12539,e.dotlessi=305,e.dotlessj=63166,e.dotlessjstrokehook=644,e.dotmath=8901,e.dottedcircle=9676,e.doubleyodpatah=64287,e.doubleyodpatahhebrew=64287,e.downtackbelowcmb=798,e.downtackmod=725,e.dparen=9375,e.dsuperior=63211,e.dtail=598,e.dtopbar=396,e.duhiragana=12389,e.dukatakana=12485,e.dz=499,e.dzaltone=675,e.dzcaron=454,e.dzcurl=677,e.dzeabkhasiancyrillic=1249,e.dzecyrillic=1109,e.dzhecyrillic=1119,e.e=101,e.eacute=233,e.earth=9793,e.ebengali=2447,e.ebopomofo=12572,e.ebreve=277,e.ecandradeva=2317,e.ecandragujarati=2701,e.ecandravowelsigndeva=2373,e.ecandravowelsigngujarati=2757,e.ecaron=283,e.ecedillabreve=7709,e.echarmenian=1381,e.echyiwnarmenian=1415,e.ecircle=9428,e.ecircumflex=234,e.ecircumflexacute=7871,e.ecircumflexbelow=7705,e.ecircumflexdotbelow=7879,e.ecircumflexgrave=7873,e.ecircumflexhookabove=7875,e.ecircumflextilde=7877,e.ecyrillic=1108,e.edblgrave=517,e.edeva=2319,e.edieresis=235,e.edot=279,e.edotaccent=279,e.edotbelow=7865,e.eegurmukhi=2575,e.eematragurmukhi=2631,e.efcyrillic=1092,e.egrave=232,e.egujarati=2703,e.eharmenian=1383,e.ehbopomofo=12573,e.ehiragana=12360,e.ehookabove=7867,e.eibopomofo=12575,e.eight=56,e.eightarabic=1640,e.eightbengali=2542,e.eightcircle=9319,e.eightcircleinversesansserif=10129,e.eightdeva=2414,e.eighteencircle=9329,e.eighteenparen=9349,e.eighteenperiod=9369,e.eightgujarati=2798,e.eightgurmukhi=2670,e.eighthackarabic=1640,e.eighthangzhou=12328,e.eighthnotebeamed=9835,e.eightideographicparen=12839,e.eightinferior=8328,e.eightmonospace=65304,e.eightoldstyle=63288,e.eightparen=9339,e.eightperiod=9359,e.eightpersian=1784,e.eightroman=8567,e.eightsuperior=8312,e.eightthai=3672,e.einvertedbreve=519,e.eiotifiedcyrillic=1125,e.ekatakana=12456,e.ekatakanahalfwidth=65396,e.ekonkargurmukhi=2676,e.ekorean=12628,e.elcyrillic=1083,e.element=8712,e.elevencircle=9322,e.elevenparen=9342,e.elevenperiod=9362,e.elevenroman=8570,e.ellipsis=8230,e.ellipsisvertical=8942,e.emacron=275,e.emacronacute=7703,e.emacrongrave=7701,e.emcyrillic=1084,e.emdash=8212,e.emdashvertical=65073,e.emonospace=65349,e.emphasismarkarmenian=1371,e.emptyset=8709,e.enbopomofo=12579,e.encyrillic=1085,e.endash=8211,e.endashvertical=65074,e.endescendercyrillic=1187,e.eng=331,e.engbopomofo=12581,e.enghecyrillic=1189,e.enhookcyrillic=1224,e.enspace=8194,e.eogonek=281,e.eokorean=12627,e.eopen=603,e.eopenclosed=666,e.eopenreversed=604,e.eopenreversedclosed=606,e.eopenreversedhook=605,e.eparen=9376,e.epsilon=949,e.epsilontonos=941,e.equal=61,e.equalmonospace=65309,e.equalsmall=65126,e.equalsuperior=8316,e.equivalence=8801,e.erbopomofo=12582,e.ercyrillic=1088,e.ereversed=600,e.ereversedcyrillic=1101,e.escyrillic=1089,e.esdescendercyrillic=1195,e.esh=643,e.eshcurl=646,e.eshortdeva=2318,e.eshortvowelsigndeva=2374,e.eshreversedloop=426,e.eshsquatreversed=645,e.esmallhiragana=12359,e.esmallkatakana=12455,e.esmallkatakanahalfwidth=65386,e.estimated=8494,e.esuperior=63212,e.eta=951,e.etarmenian=1384,e.etatonos=942,e.eth=240,e.etilde=7869,e.etildebelow=7707,e.etnahtafoukhhebrew=1425,e.etnahtafoukhlefthebrew=1425,e.etnahtahebrew=1425,e.etnahtalefthebrew=1425,e.eturned=477,e.eukorean=12641,e.euro=8364,e.evowelsignbengali=2503,e.evowelsigndeva=2375,e.evowelsigngujarati=2759,e.exclam=33,e.exclamarmenian=1372,e.exclamdbl=8252,e.exclamdown=161,e.exclamdownsmall=63393,e.exclammonospace=65281,e.exclamsmall=63265,e.existential=8707,e.ezh=658,e.ezhcaron=495,e.ezhcurl=659,e.ezhreversed=441,e.ezhtail=442,e.f=102,e.fadeva=2398,e.fagurmukhi=2654,e.fahrenheit=8457,e.fathaarabic=1614,e.fathalowarabic=1614,e.fathatanarabic=1611,e.fbopomofo=12552,e.fcircle=9429,e.fdotaccent=7711,e.feharabic=1601,e.feharmenian=1414,e.fehfinalarabic=65234,e.fehinitialarabic=65235,e.fehmedialarabic=65236,e.feicoptic=997,e.female=9792,e.ff=64256,e.f_f=64256,e.ffi=64259,e.f_f_i=64259,e.ffl=64260,e.f_f_l=64260,e.fi=64257,e.f_i=64257,e.fifteencircle=9326,e.fifteenparen=9346,e.fifteenperiod=9366,e.figuredash=8210,e.filledbox=9632,e.filledrect=9644,e.finalkaf=1498,e.finalkafdagesh=64314,e.finalkafdageshhebrew=64314,e.finalkafhebrew=1498,e.finalmem=1501,e.finalmemhebrew=1501,e.finalnun=1503,e.finalnunhebrew=1503,e.finalpe=1507,e.finalpehebrew=1507,e.finaltsadi=1509,e.finaltsadihebrew=1509,e.firsttonechinese=713,e.fisheye=9673,e.fitacyrillic=1139,e.five=53,e.fivearabic=1637,e.fivebengali=2539,e.fivecircle=9316,e.fivecircleinversesansserif=10126,e.fivedeva=2411,e.fiveeighths=8541,e.fivegujarati=2795,e.fivegurmukhi=2667,e.fivehackarabic=1637,e.fivehangzhou=12325,e.fiveideographicparen=12836,e.fiveinferior=8325,e.fivemonospace=65301,e.fiveoldstyle=63285,e.fiveparen=9336,e.fiveperiod=9356,e.fivepersian=1781,e.fiveroman=8564,e.fivesuperior=8309,e.fivethai=3669,e.fl=64258,e.f_l=64258,e.florin=402,e.fmonospace=65350,e.fmsquare=13209,e.fofanthai=3615,e.fofathai=3613,e.fongmanthai=3663,e.forall=8704,e.four=52,e.fourarabic=1636,e.fourbengali=2538,e.fourcircle=9315,e.fourcircleinversesansserif=10125,e.fourdeva=2410,e.fourgujarati=2794,e.fourgurmukhi=2666,e.fourhackarabic=1636,e.fourhangzhou=12324,e.fourideographicparen=12835,e.fourinferior=8324,e.fourmonospace=65300,e.fournumeratorbengali=2551,e.fouroldstyle=63284,e.fourparen=9335,e.fourperiod=9355,e.fourpersian=1780,e.fourroman=8563,e.foursuperior=8308,e.fourteencircle=9325,e.fourteenparen=9345,e.fourteenperiod=9365,e.fourthai=3668,e.fourthtonechinese=715,e.fparen=9377,e.fraction=8260,e.franc=8355,e.g=103,e.gabengali=2455,e.gacute=501,e.gadeva=2327,e.gafarabic=1711,e.gaffinalarabic=64403,e.gafinitialarabic=64404,e.gafmedialarabic=64405,e.gagujarati=2711,e.gagurmukhi=2583,e.gahiragana=12364,e.gakatakana=12460,e.gamma=947,e.gammalatinsmall=611,e.gammasuperior=736,e.gangiacoptic=1003,e.gbopomofo=12557,e.gbreve=287,e.gcaron=487,e.gcedilla=291,e.gcircle=9430,e.gcircumflex=285,e.gcommaaccent=291,e.gdot=289,e.gdotaccent=289,e.gecyrillic=1075,e.gehiragana=12370,e.gekatakana=12466,e.geometricallyequal=8785,e.gereshaccenthebrew=1436,e.gereshhebrew=1523,e.gereshmuqdamhebrew=1437,e.germandbls=223,e.gershayimaccenthebrew=1438,e.gershayimhebrew=1524,e.getamark=12307,e.ghabengali=2456,e.ghadarmenian=1394,e.ghadeva=2328,e.ghagujarati=2712,e.ghagurmukhi=2584,e.ghainarabic=1594,e.ghainfinalarabic=65230,e.ghaininitialarabic=65231,e.ghainmedialarabic=65232,e.ghemiddlehookcyrillic=1173,e.ghestrokecyrillic=1171,e.gheupturncyrillic=1169,e.ghhadeva=2394,e.ghhagurmukhi=2650,e.ghook=608,e.ghzsquare=13203,e.gihiragana=12366,e.gikatakana=12462,e.gimarmenian=1379,e.gimel=1490,e.gimeldagesh=64306,e.gimeldageshhebrew=64306,e.gimelhebrew=1490,e.gjecyrillic=1107,e.glottalinvertedstroke=446,e.glottalstop=660,e.glottalstopinverted=662,e.glottalstopmod=704,e.glottalstopreversed=661,e.glottalstopreversedmod=705,e.glottalstopreversedsuperior=740,e.glottalstopstroke=673,e.glottalstopstrokereversed=674,e.gmacron=7713,e.gmonospace=65351,e.gohiragana=12372,e.gokatakana=12468,e.gparen=9378,e.gpasquare=13228,e.gradient=8711,e.grave=96,e.gravebelowcmb=790,e.gravecmb=768,e.gravecomb=768,e.gravedeva=2387,e.gravelowmod=718,e.gravemonospace=65344,e.gravetonecmb=832,e.greater=62,e.greaterequal=8805,e.greaterequalorless=8923,e.greatermonospace=65310,e.greaterorequivalent=8819,e.greaterorless=8823,e.greateroverequal=8807,e.greatersmall=65125,e.gscript=609,e.gstroke=485,e.guhiragana=12368,e.guillemotleft=171,e.guillemotright=187,e.guilsinglleft=8249,e.guilsinglright=8250,e.gukatakana=12464,e.guramusquare=13080,e.gysquare=13257,e.h=104,e.haabkhasiancyrillic=1193,e.haaltonearabic=1729,e.habengali=2489,e.hadescendercyrillic=1203,e.hadeva=2361,e.hagujarati=2745,e.hagurmukhi=2617,e.haharabic=1581,e.hahfinalarabic=65186,e.hahinitialarabic=65187,e.hahiragana=12399,e.hahmedialarabic=65188,e.haitusquare=13098,e.hakatakana=12495,e.hakatakanahalfwidth=65418,e.halantgurmukhi=2637,e.hamzaarabic=1569,e.hamzalowarabic=1569,e.hangulfiller=12644,e.hardsigncyrillic=1098,e.harpoonleftbarbup=8636,e.harpoonrightbarbup=8640,e.hasquare=13258,e.hatafpatah=1458,e.hatafpatah16=1458,e.hatafpatah23=1458,e.hatafpatah2f=1458,e.hatafpatahhebrew=1458,e.hatafpatahnarrowhebrew=1458,e.hatafpatahquarterhebrew=1458,e.hatafpatahwidehebrew=1458,e.hatafqamats=1459,e.hatafqamats1b=1459,e.hatafqamats28=1459,e.hatafqamats34=1459,e.hatafqamatshebrew=1459,e.hatafqamatsnarrowhebrew=1459,e.hatafqamatsquarterhebrew=1459,e.hatafqamatswidehebrew=1459,e.hatafsegol=1457,e.hatafsegol17=1457,e.hatafsegol24=1457,e.hatafsegol30=1457,e.hatafsegolhebrew=1457,e.hatafsegolnarrowhebrew=1457,e.hatafsegolquarterhebrew=1457,e.hatafsegolwidehebrew=1457,e.hbar=295,e.hbopomofo=12559,e.hbrevebelow=7723,e.hcedilla=7721,e.hcircle=9431,e.hcircumflex=293,e.hdieresis=7719,e.hdotaccent=7715,e.hdotbelow=7717,e.he=1492,e.heart=9829,e.heartsuitblack=9829,e.heartsuitwhite=9825,e.hedagesh=64308,e.hedageshhebrew=64308,e.hehaltonearabic=1729,e.heharabic=1607,e.hehebrew=1492,e.hehfinalaltonearabic=64423,e.hehfinalalttwoarabic=65258,e.hehfinalarabic=65258,e.hehhamzaabovefinalarabic=64421,e.hehhamzaaboveisolatedarabic=64420,e.hehinitialaltonearabic=64424,e.hehinitialarabic=65259,e.hehiragana=12408,e.hehmedialaltonearabic=64425,e.hehmedialarabic=65260,e.heiseierasquare=13179,e.hekatakana=12504,e.hekatakanahalfwidth=65421,e.hekutaarusquare=13110,e.henghook=615,e.herutusquare=13113,e.het=1495,e.hethebrew=1495,e.hhook=614,e.hhooksuperior=689,e.hieuhacirclekorean=12923,e.hieuhaparenkorean=12827,e.hieuhcirclekorean=12909,e.hieuhkorean=12622,e.hieuhparenkorean=12813,e.hihiragana=12402,e.hikatakana=12498,e.hikatakanahalfwidth=65419,e.hiriq=1460,e.hiriq14=1460,e.hiriq21=1460,e.hiriq2d=1460,e.hiriqhebrew=1460,e.hiriqnarrowhebrew=1460,e.hiriqquarterhebrew=1460,e.hiriqwidehebrew=1460,e.hlinebelow=7830,e.hmonospace=65352,e.hoarmenian=1392,e.hohipthai=3627,e.hohiragana=12411,e.hokatakana=12507,e.hokatakanahalfwidth=65422,e.holam=1465,e.holam19=1465,e.holam26=1465,e.holam32=1465,e.holamhebrew=1465,e.holamnarrowhebrew=1465,e.holamquarterhebrew=1465,e.holamwidehebrew=1465,e.honokhukthai=3630,e.hookabovecomb=777,e.hookcmb=777,e.hookpalatalizedbelowcmb=801,e.hookretroflexbelowcmb=802,e.hoonsquare=13122,e.horicoptic=1001,e.horizontalbar=8213,e.horncmb=795,e.hotsprings=9832,e.house=8962,e.hparen=9379,e.hsuperior=688,e.hturned=613,e.huhiragana=12405,e.huiitosquare=13107,e.hukatakana=12501,e.hukatakanahalfwidth=65420,e.hungarumlaut=733,e.hungarumlautcmb=779,e.hv=405,e.hyphen=45,e.hypheninferior=63205,e.hyphenmonospace=65293,e.hyphensmall=65123,e.hyphensuperior=63206,e.hyphentwo=8208,e.i=105,e.iacute=237,e.iacyrillic=1103,e.ibengali=2439,e.ibopomofo=12583,e.ibreve=301,e.icaron=464,e.icircle=9432,e.icircumflex=238,e.icyrillic=1110,e.idblgrave=521,e.ideographearthcircle=12943,e.ideographfirecircle=12939,e.ideographicallianceparen=12863,e.ideographiccallparen=12858,e.ideographiccentrecircle=12965,e.ideographicclose=12294,e.ideographiccomma=12289,e.ideographiccommaleft=65380,e.ideographiccongratulationparen=12855,e.ideographiccorrectcircle=12963,e.ideographicearthparen=12847,e.ideographicenterpriseparen=12861,e.ideographicexcellentcircle=12957,e.ideographicfestivalparen=12864,e.ideographicfinancialcircle=12950,e.ideographicfinancialparen=12854,e.ideographicfireparen=12843,e.ideographichaveparen=12850,e.ideographichighcircle=12964,e.ideographiciterationmark=12293,e.ideographiclaborcircle=12952,e.ideographiclaborparen=12856,e.ideographicleftcircle=12967,e.ideographiclowcircle=12966,e.ideographicmedicinecircle=12969,e.ideographicmetalparen=12846,e.ideographicmoonparen=12842,e.ideographicnameparen=12852,e.ideographicperiod=12290,e.ideographicprintcircle=12958,e.ideographicreachparen=12867,e.ideographicrepresentparen=12857,e.ideographicresourceparen=12862,e.ideographicrightcircle=12968,e.ideographicsecretcircle=12953,e.ideographicselfparen=12866,e.ideographicsocietyparen=12851,e.ideographicspace=12288,e.ideographicspecialparen=12853,e.ideographicstockparen=12849,e.ideographicstudyparen=12859,e.ideographicsunparen=12848,e.ideographicsuperviseparen=12860,e.ideographicwaterparen=12844,e.ideographicwoodparen=12845,e.ideographiczero=12295,e.ideographmetalcircle=12942,e.ideographmooncircle=12938,e.ideographnamecircle=12948,e.ideographsuncircle=12944,e.ideographwatercircle=12940,e.ideographwoodcircle=12941,e.ideva=2311,e.idieresis=239,e.idieresisacute=7727,e.idieresiscyrillic=1253,e.idotbelow=7883,e.iebrevecyrillic=1239,e.iecyrillic=1077,e.ieungacirclekorean=12917,e.ieungaparenkorean=12821,e.ieungcirclekorean=12903,e.ieungkorean=12615,e.ieungparenkorean=12807,e.igrave=236,e.igujarati=2695,e.igurmukhi=2567,e.ihiragana=12356,e.ihookabove=7881,e.iibengali=2440,e.iicyrillic=1080,e.iideva=2312,e.iigujarati=2696,e.iigurmukhi=2568,e.iimatragurmukhi=2624,e.iinvertedbreve=523,e.iishortcyrillic=1081,e.iivowelsignbengali=2496,e.iivowelsigndeva=2368,e.iivowelsigngujarati=2752,e.ij=307,e.ikatakana=12452,e.ikatakanahalfwidth=65394,e.ikorean=12643,e.ilde=732,e.iluyhebrew=1452,e.imacron=299,e.imacroncyrillic=1251,e.imageorapproximatelyequal=8787,e.imatragurmukhi=2623,e.imonospace=65353,e.increment=8710,e.infinity=8734,e.iniarmenian=1387,e.integral=8747,e.integralbottom=8993,e.integralbt=8993,e.integralex=63733,e.integraltop=8992,e.integraltp=8992,e.intersection=8745,e.intisquare=13061,e.invbullet=9688,e.invcircle=9689,e.invsmileface=9787,e.iocyrillic=1105,e.iogonek=303,e.iota=953,e.iotadieresis=970,e.iotadieresistonos=912,e.iotalatin=617,e.iotatonos=943,e.iparen=9380,e.irigurmukhi=2674,e.ismallhiragana=12355,e.ismallkatakana=12451,e.ismallkatakanahalfwidth=65384,e.issharbengali=2554,e.istroke=616,e.isuperior=63213,e.iterationhiragana=12445,e.iterationkatakana=12541,e.itilde=297,e.itildebelow=7725,e.iubopomofo=12585,e.iucyrillic=1102,e.ivowelsignbengali=2495,e.ivowelsigndeva=2367,e.ivowelsigngujarati=2751,e.izhitsacyrillic=1141,e.izhitsadblgravecyrillic=1143,e.j=106,e.jaarmenian=1393,e.jabengali=2460,e.jadeva=2332,e.jagujarati=2716,e.jagurmukhi=2588,e.jbopomofo=12560,e.jcaron=496,e.jcircle=9433,e.jcircumflex=309,e.jcrossedtail=669,e.jdotlessstroke=607,e.jecyrillic=1112,e.jeemarabic=1580,e.jeemfinalarabic=65182,e.jeeminitialarabic=65183,e.jeemmedialarabic=65184,e.jeharabic=1688,e.jehfinalarabic=64395,e.jhabengali=2461,e.jhadeva=2333,e.jhagujarati=2717,e.jhagurmukhi=2589,e.jheharmenian=1403,e.jis=12292,e.jmonospace=65354,e.jparen=9381,e.jsuperior=690,e.k=107,e.kabashkircyrillic=1185,e.kabengali=2453,e.kacute=7729,e.kacyrillic=1082,e.kadescendercyrillic=1179,e.kadeva=2325,e.kaf=1499,e.kafarabic=1603,e.kafdagesh=64315,e.kafdageshhebrew=64315,e.kaffinalarabic=65242,e.kafhebrew=1499,e.kafinitialarabic=65243,e.kafmedialarabic=65244,e.kafrafehebrew=64333,e.kagujarati=2709,e.kagurmukhi=2581,e.kahiragana=12363,e.kahookcyrillic=1220,e.kakatakana=12459,e.kakatakanahalfwidth=65398,e.kappa=954,e.kappasymbolgreek=1008,e.kapyeounmieumkorean=12657,e.kapyeounphieuphkorean=12676,e.kapyeounpieupkorean=12664,e.kapyeounssangpieupkorean=12665,e.karoriisquare=13069,e.kashidaautoarabic=1600,e.kashidaautonosidebearingarabic=1600,e.kasmallkatakana=12533,e.kasquare=13188,e.kasraarabic=1616,e.kasratanarabic=1613,e.kastrokecyrillic=1183,e.katahiraprolongmarkhalfwidth=65392,e.kaverticalstrokecyrillic=1181,e.kbopomofo=12558,e.kcalsquare=13193,e.kcaron=489,e.kcedilla=311,e.kcircle=9434,e.kcommaaccent=311,e.kdotbelow=7731,e.keharmenian=1412,e.kehiragana=12369,e.kekatakana=12465,e.kekatakanahalfwidth=65401,e.kenarmenian=1391,e.kesmallkatakana=12534,e.kgreenlandic=312,e.khabengali=2454,e.khacyrillic=1093,e.khadeva=2326,e.khagujarati=2710,e.khagurmukhi=2582,e.khaharabic=1582,e.khahfinalarabic=65190,e.khahinitialarabic=65191,e.khahmedialarabic=65192,e.kheicoptic=999,e.khhadeva=2393,e.khhagurmukhi=2649,e.khieukhacirclekorean=12920,e.khieukhaparenkorean=12824,e.khieukhcirclekorean=12906,e.khieukhkorean=12619,e.khieukhparenkorean=12810,e.khokhaithai=3586,e.khokhonthai=3589,e.khokhuatthai=3587,e.khokhwaithai=3588,e.khomutthai=3675,e.khook=409,e.khorakhangthai=3590,e.khzsquare=13201,e.kihiragana=12365,e.kikatakana=12461,e.kikatakanahalfwidth=65399,e.kiroguramusquare=13077,e.kiromeetorusquare=13078,e.kirosquare=13076,e.kiyeokacirclekorean=12910,e.kiyeokaparenkorean=12814,e.kiyeokcirclekorean=12896,e.kiyeokkorean=12593,e.kiyeokparenkorean=12800,e.kiyeoksioskorean=12595;e.kjecyrillic=1116,e.klinebelow=7733,e.klsquare=13208,e.kmcubedsquare=13222,e.kmonospace=65355,e.kmsquaredsquare=13218,e.kohiragana=12371,e.kohmsquare=13248,e.kokaithai=3585,e.kokatakana=12467,e.kokatakanahalfwidth=65402,e.kooposquare=13086,e.koppacyrillic=1153,e.koreanstandardsymbol=12927,e.koroniscmb=835,e.kparen=9382,e.kpasquare=13226,e.ksicyrillic=1135,e.ktsquare=13263,e.kturned=670,e.kuhiragana=12367,e.kukatakana=12463,e.kukatakanahalfwidth=65400,e.kvsquare=13240,e.kwsquare=13246,e.l=108,e.labengali=2482,e.lacute=314,e.ladeva=2354,e.lagujarati=2738,e.lagurmukhi=2610,e.lakkhangyaothai=3653,e.lamaleffinalarabic=65276,e.lamalefhamzaabovefinalarabic=65272,e.lamalefhamzaaboveisolatedarabic=65271,e.lamalefhamzabelowfinalarabic=65274,e.lamalefhamzabelowisolatedarabic=65273,e.lamalefisolatedarabic=65275,e.lamalefmaddaabovefinalarabic=65270,e.lamalefmaddaaboveisolatedarabic=65269,e.lamarabic=1604,e.lambda=955,e.lambdastroke=411,e.lamed=1500,e.lameddagesh=64316,e.lameddageshhebrew=64316,e.lamedhebrew=1500,e.lamfinalarabic=65246,e.lamhahinitialarabic=64714,e.laminitialarabic=65247,e.lamjeeminitialarabic=64713,e.lamkhahinitialarabic=64715,e.lamlamhehisolatedarabic=65010,e.lammedialarabic=65248,e.lammeemhahinitialarabic=64904,e.lammeeminitialarabic=64716,e.largecircle=9711,e.lbar=410,e.lbelt=620,e.lbopomofo=12556,e.lcaron=318,e.lcedilla=316,e.lcircle=9435,e.lcircumflexbelow=7741,e.lcommaaccent=316,e.ldot=320,e.ldotaccent=320,e.ldotbelow=7735,e.ldotbelowmacron=7737,e.leftangleabovecmb=794,e.lefttackbelowcmb=792,e.less=60,e.lessequal=8804,e.lessequalorgreater=8922,e.lessmonospace=65308,e.lessorequivalent=8818,e.lessorgreater=8822,e.lessoverequal=8806,e.lesssmall=65124,e.lezh=622,e.lfblock=9612,e.lhookretroflex=621,e.lira=8356,e.liwnarmenian=1388,e.lj=457,e.ljecyrillic=1113,e.ll=63168,e.lladeva=2355,e.llagujarati=2739,e.llinebelow=7739,e.llladeva=2356,e.llvocalicbengali=2529,e.llvocalicdeva=2401,e.llvocalicvowelsignbengali=2531,e.llvocalicvowelsigndeva=2403,e.lmiddletilde=619,e.lmonospace=65356,e.lmsquare=13264,e.lochulathai=3628,e.logicaland=8743,e.logicalnot=172,e.logicalnotreversed=8976,e.logicalor=8744,e.lolingthai=3621,e.longs=383,e.lowlinecenterline=65102,e.lowlinecmb=818,e.lowlinedashed=65101,e.lozenge=9674,e.lparen=9383,e.lslash=322,e.lsquare=8467,e.lsuperior=63214,e.ltshade=9617,e.luthai=3622,e.lvocalicbengali=2444,e.lvocalicdeva=2316,e.lvocalicvowelsignbengali=2530,e.lvocalicvowelsigndeva=2402,e.lxsquare=13267,e.m=109,e.mabengali=2478,e.macron=175,e.macronbelowcmb=817,e.macroncmb=772,e.macronlowmod=717,e.macronmonospace=65507,e.macute=7743,e.madeva=2350,e.magujarati=2734,e.magurmukhi=2606,e.mahapakhhebrew=1444,e.mahapakhlefthebrew=1444,e.mahiragana=12414,e.maichattawalowleftthai=63637,e.maichattawalowrightthai=63636,e.maichattawathai=3659,e.maichattawaupperleftthai=63635,e.maieklowleftthai=63628,e.maieklowrightthai=63627,e.maiekthai=3656,e.maiekupperleftthai=63626,e.maihanakatleftthai=63620,e.maihanakatthai=3633,e.maitaikhuleftthai=63625,e.maitaikhuthai=3655,e.maitholowleftthai=63631,e.maitholowrightthai=63630,e.maithothai=3657,e.maithoupperleftthai=63629,e.maitrilowleftthai=63634,e.maitrilowrightthai=63633,e.maitrithai=3658,e.maitriupperleftthai=63632,e.maiyamokthai=3654,e.makatakana=12510,e.makatakanahalfwidth=65423,e.male=9794,e.mansyonsquare=13127,e.maqafhebrew=1470,e.mars=9794,e.masoracirclehebrew=1455,e.masquare=13187,e.mbopomofo=12551,e.mbsquare=13268,e.mcircle=9436,e.mcubedsquare=13221,e.mdotaccent=7745,e.mdotbelow=7747,e.meemarabic=1605,e.meemfinalarabic=65250,e.meeminitialarabic=65251,e.meemmedialarabic=65252,e.meemmeeminitialarabic=64721,e.meemmeemisolatedarabic=64584,e.meetorusquare=13133,e.mehiragana=12417,e.meizierasquare=13182,e.mekatakana=12513,e.mekatakanahalfwidth=65426,e.mem=1502,e.memdagesh=64318,e.memdageshhebrew=64318,e.memhebrew=1502,e.menarmenian=1396,e.merkhahebrew=1445,e.merkhakefulahebrew=1446,e.merkhakefulalefthebrew=1446,e.merkhalefthebrew=1445,e.mhook=625,e.mhzsquare=13202,e.middledotkatakanahalfwidth=65381,e.middot=183,e.mieumacirclekorean=12914,e.mieumaparenkorean=12818,e.mieumcirclekorean=12900,e.mieumkorean=12609,e.mieumpansioskorean=12656,e.mieumparenkorean=12804,e.mieumpieupkorean=12654,e.mieumsioskorean=12655,e.mihiragana=12415,e.mikatakana=12511,e.mikatakanahalfwidth=65424,e.minus=8722,e.minusbelowcmb=800,e.minuscircle=8854,e.minusmod=727,e.minusplus=8723,e.minute=8242,e.miribaarusquare=13130,e.mirisquare=13129,e.mlonglegturned=624,e.mlsquare=13206,e.mmcubedsquare=13219,e.mmonospace=65357,e.mmsquaredsquare=13215,e.mohiragana=12418,e.mohmsquare=13249,e.mokatakana=12514,e.mokatakanahalfwidth=65427,e.molsquare=13270,e.momathai=3617,e.moverssquare=13223,e.moverssquaredsquare=13224,e.mparen=9384,e.mpasquare=13227,e.mssquare=13235,e.msuperior=63215,e.mturned=623,e.mu=181,e.mu1=181,e.muasquare=13186,e.muchgreater=8811,e.muchless=8810,e.mufsquare=13196,e.mugreek=956,e.mugsquare=13197,e.muhiragana=12416,e.mukatakana=12512,e.mukatakanahalfwidth=65425,e.mulsquare=13205,e.multiply=215,e.mumsquare=13211,e.munahhebrew=1443,e.munahlefthebrew=1443,e.musicalnote=9834,e.musicalnotedbl=9835,e.musicflatsign=9837,e.musicsharpsign=9839,e.mussquare=13234,e.muvsquare=13238,e.muwsquare=13244,e.mvmegasquare=13241,e.mvsquare=13239,e.mwmegasquare=13247,e.mwsquare=13245,e.n=110,e.nabengali=2472,e.nabla=8711,e.nacute=324,e.nadeva=2344,e.nagujarati=2728,e.nagurmukhi=2600,e.nahiragana=12394,e.nakatakana=12490,e.nakatakanahalfwidth=65413,e.napostrophe=329,e.nasquare=13185,e.nbopomofo=12555,e.nbspace=160,e.ncaron=328,e.ncedilla=326,e.ncircle=9437,e.ncircumflexbelow=7755,e.ncommaaccent=326,e.ndotaccent=7749,e.ndotbelow=7751,e.nehiragana=12397,e.nekatakana=12493,e.nekatakanahalfwidth=65416,e.newsheqelsign=8362,e.nfsquare=13195,e.ngabengali=2457,e.ngadeva=2329,e.ngagujarati=2713,e.ngagurmukhi=2585,e.ngonguthai=3591,e.nhiragana=12435,e.nhookleft=626,e.nhookretroflex=627,e.nieunacirclekorean=12911,e.nieunaparenkorean=12815,e.nieuncieuckorean=12597,e.nieuncirclekorean=12897,e.nieunhieuhkorean=12598,e.nieunkorean=12596,e.nieunpansioskorean=12648,e.nieunparenkorean=12801,e.nieunsioskorean=12647,e.nieuntikeutkorean=12646,e.nihiragana=12395,e.nikatakana=12491,e.nikatakanahalfwidth=65414,e.nikhahitleftthai=63641,e.nikhahitthai=3661,e.nine=57,e.ninearabic=1641,e.ninebengali=2543,e.ninecircle=9320,e.ninecircleinversesansserif=10130,e.ninedeva=2415,e.ninegujarati=2799,e.ninegurmukhi=2671,e.ninehackarabic=1641,e.ninehangzhou=12329,e.nineideographicparen=12840,e.nineinferior=8329,e.ninemonospace=65305,e.nineoldstyle=63289,e.nineparen=9340,e.nineperiod=9360,e.ninepersian=1785,e.nineroman=8568,e.ninesuperior=8313,e.nineteencircle=9330,e.nineteenparen=9350,e.nineteenperiod=9370,e.ninethai=3673,e.nj=460,e.njecyrillic=1114,e.nkatakana=12531,e.nkatakanahalfwidth=65437,e.nlegrightlong=414,e.nlinebelow=7753,e.nmonospace=65358,e.nmsquare=13210,e.nnabengali=2467,e.nnadeva=2339,e.nnagujarati=2723,e.nnagurmukhi=2595,e.nnnadeva=2345,e.nohiragana=12398,e.nokatakana=12494,e.nokatakanahalfwidth=65417,e.nonbreakingspace=160,e.nonenthai=3603,e.nonuthai=3609,e.noonarabic=1606,e.noonfinalarabic=65254,e.noonghunnaarabic=1722,e.noonghunnafinalarabic=64415,e.nooninitialarabic=65255,e.noonjeeminitialarabic=64722,e.noonjeemisolatedarabic=64587,e.noonmedialarabic=65256,e.noonmeeminitialarabic=64725,e.noonmeemisolatedarabic=64590,e.noonnoonfinalarabic=64653,e.notcontains=8716,e.notelement=8713,e.notelementof=8713,e.notequal=8800,e.notgreater=8815,e.notgreaternorequal=8817,e.notgreaternorless=8825,e.notidentical=8802,e.notless=8814,e.notlessnorequal=8816,e.notparallel=8742,e.notprecedes=8832,e.notsubset=8836,e.notsucceeds=8833,e.notsuperset=8837,e.nowarmenian=1398,e.nparen=9385,e.nssquare=13233,e.nsuperior=8319,e.ntilde=241,e.nu=957,e.nuhiragana=12396,e.nukatakana=12492,e.nukatakanahalfwidth=65415,e.nuktabengali=2492,e.nuktadeva=2364,e.nuktagujarati=2748,e.nuktagurmukhi=2620,e.numbersign=35,e.numbersignmonospace=65283,e.numbersignsmall=65119,e.numeralsigngreek=884,e.numeralsignlowergreek=885,e.numero=8470,e.nun=1504,e.nundagesh=64320,e.nundageshhebrew=64320,e.nunhebrew=1504,e.nvsquare=13237,e.nwsquare=13243,e.nyabengali=2462,e.nyadeva=2334,e.nyagujarati=2718,e.nyagurmukhi=2590,e.o=111,e.oacute=243,e.oangthai=3629,e.obarred=629,e.obarredcyrillic=1257,e.obarreddieresiscyrillic=1259,e.obengali=2451,e.obopomofo=12571,e.obreve=335,e.ocandradeva=2321,e.ocandragujarati=2705,e.ocandravowelsigndeva=2377,e.ocandravowelsigngujarati=2761,e.ocaron=466,e.ocircle=9438,e.ocircumflex=244,e.ocircumflexacute=7889,e.ocircumflexdotbelow=7897,e.ocircumflexgrave=7891,e.ocircumflexhookabove=7893,e.ocircumflextilde=7895,e.ocyrillic=1086,e.odblacute=337,e.odblgrave=525,e.odeva=2323,e.odieresis=246,e.odieresiscyrillic=1255,e.odotbelow=7885,e.oe=339,e.oekorean=12634,e.ogonek=731,e.ogonekcmb=808,e.ograve=242,e.ogujarati=2707,e.oharmenian=1413,e.ohiragana=12362,e.ohookabove=7887,e.ohorn=417,e.ohornacute=7899,e.ohorndotbelow=7907,e.ohorngrave=7901,e.ohornhookabove=7903,e.ohorntilde=7905,e.ohungarumlaut=337,e.oi=419,e.oinvertedbreve=527,e.okatakana=12458,e.okatakanahalfwidth=65397,e.okorean=12631,e.olehebrew=1451,e.omacron=333,e.omacronacute=7763,e.omacrongrave=7761,e.omdeva=2384,e.omega=969,e.omega1=982,e.omegacyrillic=1121,e.omegalatinclosed=631,e.omegaroundcyrillic=1147,e.omegatitlocyrillic=1149,e.omegatonos=974,e.omgujarati=2768,e.omicron=959,e.omicrontonos=972,e.omonospace=65359,e.one=49,e.onearabic=1633,e.onebengali=2535,e.onecircle=9312,e.onecircleinversesansserif=10122,e.onedeva=2407,e.onedotenleader=8228,e.oneeighth=8539,e.onefitted=63196,e.onegujarati=2791,e.onegurmukhi=2663,e.onehackarabic=1633,e.onehalf=189,e.onehangzhou=12321,e.oneideographicparen=12832,e.oneinferior=8321,e.onemonospace=65297,e.onenumeratorbengali=2548,e.oneoldstyle=63281,e.oneparen=9332,e.oneperiod=9352,e.onepersian=1777,e.onequarter=188,e.oneroman=8560,e.onesuperior=185,e.onethai=3665,e.onethird=8531,e.oogonek=491,e.oogonekmacron=493,e.oogurmukhi=2579,e.oomatragurmukhi=2635,e.oopen=596,e.oparen=9386,e.openbullet=9702,e.option=8997,e.ordfeminine=170,e.ordmasculine=186,e.orthogonal=8735,e.oshortdeva=2322,e.oshortvowelsigndeva=2378,e.oslash=248,e.oslashacute=511,e.osmallhiragana=12361,e.osmallkatakana=12457,e.osmallkatakanahalfwidth=65387,e.ostrokeacute=511,e.osuperior=63216,e.otcyrillic=1151,e.otilde=245,e.otildeacute=7757,e.otildedieresis=7759,e.oubopomofo=12577,e.overline=8254,e.overlinecenterline=65098,e.overlinecmb=773,e.overlinedashed=65097,e.overlinedblwavy=65100,e.overlinewavy=65099,e.overscore=175,e.ovowelsignbengali=2507,e.ovowelsigndeva=2379,e.ovowelsigngujarati=2763,e.p=112,e.paampssquare=13184,e.paasentosquare=13099,e.pabengali=2474,e.pacute=7765,e.padeva=2346,e.pagedown=8671,e.pageup=8670,e.pagujarati=2730,e.pagurmukhi=2602,e.pahiragana=12401,e.paiyannoithai=3631,e.pakatakana=12497,e.palatalizationcyrilliccmb=1156,e.palochkacyrillic=1216,e.pansioskorean=12671,e.paragraph=182,e.parallel=8741,e.parenleft=40,e.parenleftaltonearabic=64830,e.parenleftbt=63725,e.parenleftex=63724,e.parenleftinferior=8333,e.parenleftmonospace=65288,e.parenleftsmall=65113,e.parenleftsuperior=8317,e.parenlefttp=63723,e.parenleftvertical=65077,e.parenright=41,e.parenrightaltonearabic=64831,e.parenrightbt=63736,e.parenrightex=63735,e.parenrightinferior=8334,e.parenrightmonospace=65289,e.parenrightsmall=65114,e.parenrightsuperior=8318,e.parenrighttp=63734,e.parenrightvertical=65078,e.partialdiff=8706,e.paseqhebrew=1472,e.pashtahebrew=1433,e.pasquare=13225,e.patah=1463,e.patah11=1463,e.patah1d=1463,e.patah2a=1463,e.patahhebrew=1463,e.patahnarrowhebrew=1463,e.patahquarterhebrew=1463,e.patahwidehebrew=1463,e.pazerhebrew=1441,e.pbopomofo=12550,e.pcircle=9439,e.pdotaccent=7767,e.pe=1508,e.pecyrillic=1087,e.pedagesh=64324,e.pedageshhebrew=64324,e.peezisquare=13115,e.pefinaldageshhebrew=64323,e.peharabic=1662,e.peharmenian=1402,e.pehebrew=1508,e.pehfinalarabic=64343,e.pehinitialarabic=64344,e.pehiragana=12410,e.pehmedialarabic=64345,e.pekatakana=12506,e.pemiddlehookcyrillic=1191,e.perafehebrew=64334,e.percent=37,e.percentarabic=1642,e.percentmonospace=65285,e.percentsmall=65130,e.period=46,e.periodarmenian=1417,e.periodcentered=183,e.periodhalfwidth=65377,e.periodinferior=63207,e.periodmonospace=65294,e.periodsmall=65106,e.periodsuperior=63208,e.perispomenigreekcmb=834,e.perpendicular=8869,e.perthousand=8240,e.peseta=8359,e.pfsquare=13194,e.phabengali=2475,e.phadeva=2347,e.phagujarati=2731,e.phagurmukhi=2603,e.phi=966,e.phi1=981,e.phieuphacirclekorean=12922,e.phieuphaparenkorean=12826,e.phieuphcirclekorean=12908,e.phieuphkorean=12621,e.phieuphparenkorean=12812,e.philatin=632,e.phinthuthai=3642,e.phisymbolgreek=981,e.phook=421,e.phophanthai=3614,e.phophungthai=3612,e.phosamphaothai=3616,e.pi=960,e.pieupacirclekorean=12915,e.pieupaparenkorean=12819,e.pieupcieuckorean=12662,e.pieupcirclekorean=12901,e.pieupkiyeokkorean=12658,e.pieupkorean=12610,e.pieupparenkorean=12805,e.pieupsioskiyeokkorean=12660,e.pieupsioskorean=12612,e.pieupsiostikeutkorean=12661,e.pieupthieuthkorean=12663,e.pieuptikeutkorean=12659,e.pihiragana=12404,e.pikatakana=12500,e.pisymbolgreek=982,e.piwrarmenian=1411,e.planckover2pi=8463,e.planckover2pi1=8463,e.plus=43,e.plusbelowcmb=799,e.pluscircle=8853,e.plusminus=177,e.plusmod=726,e.plusmonospace=65291,e.plussmall=65122,e.plussuperior=8314,e.pmonospace=65360,e.pmsquare=13272,e.pohiragana=12413,e.pointingindexdownwhite=9759,e.pointingindexleftwhite=9756,e.pointingindexrightwhite=9758,e.pointingindexupwhite=9757,e.pokatakana=12509,e.poplathai=3611,e.postalmark=12306,e.postalmarkface=12320,e.pparen=9387,e.precedes=8826,e.prescription=8478,e.primemod=697,e.primereversed=8245,e.product=8719,e.projective=8965,e.prolongedkana=12540,e.propellor=8984,e.propersubset=8834,e.propersuperset=8835,e.proportion=8759,e.proportional=8733,e.psi=968,e.psicyrillic=1137,e.psilipneumatacyrilliccmb=1158,e.pssquare=13232,e.puhiragana=12407,e.pukatakana=12503,e.pvsquare=13236,e.pwsquare=13242,e.q=113,e.qadeva=2392,e.qadmahebrew=1448,e.qafarabic=1602,e.qaffinalarabic=65238,e.qafinitialarabic=65239,e.qafmedialarabic=65240,e.qamats=1464,e.qamats10=1464,e.qamats1a=1464,e.qamats1c=1464,e.qamats27=1464,e.qamats29=1464,e.qamats33=1464,e.qamatsde=1464,e.qamatshebrew=1464,e.qamatsnarrowhebrew=1464,e.qamatsqatanhebrew=1464,e.qamatsqatannarrowhebrew=1464,e.qamatsqatanquarterhebrew=1464,e.qamatsqatanwidehebrew=1464,e.qamatsquarterhebrew=1464,e.qamatswidehebrew=1464,e.qarneyparahebrew=1439,e.qbopomofo=12561,e.qcircle=9440,e.qhook=672,e.qmonospace=65361,e.qof=1511,e.qofdagesh=64327,e.qofdageshhebrew=64327,e.qofhebrew=1511,e.qparen=9388,e.quarternote=9833,e.qubuts=1467,e.qubuts18=1467,e.qubuts25=1467,e.qubuts31=1467,e.qubutshebrew=1467,e.qubutsnarrowhebrew=1467,e.qubutsquarterhebrew=1467,e.qubutswidehebrew=1467,e.question=63,e.questionarabic=1567,e.questionarmenian=1374,e.questiondown=191,e.questiondownsmall=63423,e.questiongreek=894,e.questionmonospace=65311,e.questionsmall=63295,e.quotedbl=34,e.quotedblbase=8222,e.quotedblleft=8220,e.quotedblmonospace=65282,e.quotedblprime=12318,e.quotedblprimereversed=12317,e.quotedblright=8221,e.quoteleft=8216,e.quoteleftreversed=8219,e.quotereversed=8219,e.quoteright=8217,e.quoterightn=329,e.quotesinglbase=8218,e.quotesingle=39,e.quotesinglemonospace=65287,e.r=114,e.raarmenian=1404,e.rabengali=2480,e.racute=341,e.radeva=2352,e.radical=8730,e.radicalex=63717,e.radoverssquare=13230,e.radoverssquaredsquare=13231,e.radsquare=13229,e.rafe=1471,e.rafehebrew=1471,e.ragujarati=2736,e.ragurmukhi=2608,e.rahiragana=12425,e.rakatakana=12521,e.rakatakanahalfwidth=65431,e.ralowerdiagonalbengali=2545,e.ramiddlediagonalbengali=2544,e.ramshorn=612,e.ratio=8758,e.rbopomofo=12566,e.rcaron=345,e.rcedilla=343,e.rcircle=9441,e.rcommaaccent=343,e.rdblgrave=529,e.rdotaccent=7769,e.rdotbelow=7771,e.rdotbelowmacron=7773,e.referencemark=8251,e.reflexsubset=8838,e.reflexsuperset=8839,e.registered=174,e.registersans=63720,e.registerserif=63194,e.reharabic=1585,e.reharmenian=1408,e.rehfinalarabic=65198,e.rehiragana=12428,e.rekatakana=12524;e.rekatakanahalfwidth=65434,e.resh=1512,e.reshdageshhebrew=64328,e.reshhebrew=1512,e.reversedtilde=8765,e.reviahebrew=1431,e.reviamugrashhebrew=1431,e.revlogicalnot=8976,e.rfishhook=638,e.rfishhookreversed=639,e.rhabengali=2525,e.rhadeva=2397,e.rho=961,e.rhook=637,e.rhookturned=635,e.rhookturnedsuperior=693,e.rhosymbolgreek=1009,e.rhotichookmod=734,e.rieulacirclekorean=12913,e.rieulaparenkorean=12817,e.rieulcirclekorean=12899,e.rieulhieuhkorean=12608,e.rieulkiyeokkorean=12602,e.rieulkiyeoksioskorean=12649,e.rieulkorean=12601,e.rieulmieumkorean=12603,e.rieulpansioskorean=12652,e.rieulparenkorean=12803,e.rieulphieuphkorean=12607,e.rieulpieupkorean=12604,e.rieulpieupsioskorean=12651,e.rieulsioskorean=12605,e.rieulthieuthkorean=12606,e.rieultikeutkorean=12650,e.rieulyeorinhieuhkorean=12653,e.rightangle=8735,e.righttackbelowcmb=793,e.righttriangle=8895,e.rihiragana=12426,e.rikatakana=12522,e.rikatakanahalfwidth=65432,e.ring=730,e.ringbelowcmb=805,e.ringcmb=778,e.ringhalfleft=703,e.ringhalfleftarmenian=1369,e.ringhalfleftbelowcmb=796,e.ringhalfleftcentered=723,e.ringhalfright=702,e.ringhalfrightbelowcmb=825,e.ringhalfrightcentered=722,e.rinvertedbreve=531,e.rittorusquare=13137,e.rlinebelow=7775,e.rlongleg=636,e.rlonglegturned=634,e.rmonospace=65362,e.rohiragana=12429,e.rokatakana=12525,e.rokatakanahalfwidth=65435,e.roruathai=3619,e.rparen=9389,e.rrabengali=2524,e.rradeva=2353,e.rragurmukhi=2652,e.rreharabic=1681,e.rrehfinalarabic=64397,e.rrvocalicbengali=2528,e.rrvocalicdeva=2400,e.rrvocalicgujarati=2784,e.rrvocalicvowelsignbengali=2500,e.rrvocalicvowelsigndeva=2372,e.rrvocalicvowelsigngujarati=2756,e.rsuperior=63217,e.rtblock=9616,e.rturned=633,e.rturnedsuperior=692,e.ruhiragana=12427,e.rukatakana=12523,e.rukatakanahalfwidth=65433,e.rupeemarkbengali=2546,e.rupeesignbengali=2547,e.rupiah=63197,e.ruthai=3620,e.rvocalicbengali=2443,e.rvocalicdeva=2315,e.rvocalicgujarati=2699,e.rvocalicvowelsignbengali=2499,e.rvocalicvowelsigndeva=2371,e.rvocalicvowelsigngujarati=2755,e.s=115,e.sabengali=2488,e.sacute=347,e.sacutedotaccent=7781,e.sadarabic=1589,e.sadeva=2360,e.sadfinalarabic=65210,e.sadinitialarabic=65211,e.sadmedialarabic=65212,e.sagujarati=2744,e.sagurmukhi=2616,e.sahiragana=12373,e.sakatakana=12469,e.sakatakanahalfwidth=65403,e.sallallahoualayhewasallamarabic=65018,e.samekh=1505,e.samekhdagesh=64321,e.samekhdageshhebrew=64321,e.samekhhebrew=1505,e.saraaathai=3634,e.saraaethai=3649,e.saraaimaimalaithai=3652,e.saraaimaimuanthai=3651,e.saraamthai=3635,e.saraathai=3632,e.saraethai=3648,e.saraiileftthai=63622,e.saraiithai=3637,e.saraileftthai=63621,e.saraithai=3636,e.saraothai=3650,e.saraueeleftthai=63624,e.saraueethai=3639,e.saraueleftthai=63623,e.sarauethai=3638,e.sarauthai=3640,e.sarauuthai=3641,e.sbopomofo=12569,e.scaron=353,e.scarondotaccent=7783,e.scedilla=351,e.schwa=601,e.schwacyrillic=1241,e.schwadieresiscyrillic=1243,e.schwahook=602,e.scircle=9442,e.scircumflex=349,e.scommaaccent=537,e.sdotaccent=7777,e.sdotbelow=7779,e.sdotbelowdotaccent=7785,e.seagullbelowcmb=828,e.second=8243,e.secondtonechinese=714,e.section=167,e.seenarabic=1587,e.seenfinalarabic=65202,e.seeninitialarabic=65203,e.seenmedialarabic=65204,e.segol=1462,e.segol13=1462,e.segol1f=1462,e.segol2c=1462,e.segolhebrew=1462,e.segolnarrowhebrew=1462,e.segolquarterhebrew=1462,e.segoltahebrew=1426,e.segolwidehebrew=1462,e.seharmenian=1405,e.sehiragana=12379,e.sekatakana=12475,e.sekatakanahalfwidth=65406,e.semicolon=59,e.semicolonarabic=1563,e.semicolonmonospace=65307,e.semicolonsmall=65108,e.semivoicedmarkkana=12444,e.semivoicedmarkkanahalfwidth=65439,e.sentisquare=13090,e.sentosquare=13091,e.seven=55,e.sevenarabic=1639,e.sevenbengali=2541,e.sevencircle=9318,e.sevencircleinversesansserif=10128,e.sevendeva=2413,e.seveneighths=8542,e.sevengujarati=2797,e.sevengurmukhi=2669,e.sevenhackarabic=1639,e.sevenhangzhou=12327,e.sevenideographicparen=12838,e.seveninferior=8327,e.sevenmonospace=65303,e.sevenoldstyle=63287,e.sevenparen=9338,e.sevenperiod=9358,e.sevenpersian=1783,e.sevenroman=8566,e.sevensuperior=8311,e.seventeencircle=9328,e.seventeenparen=9348,e.seventeenperiod=9368,e.seventhai=3671,e.sfthyphen=173,e.shaarmenian=1399,e.shabengali=2486,e.shacyrillic=1096,e.shaddaarabic=1617,e.shaddadammaarabic=64609,e.shaddadammatanarabic=64606,e.shaddafathaarabic=64608,e.shaddakasraarabic=64610,e.shaddakasratanarabic=64607,e.shade=9618,e.shadedark=9619,e.shadelight=9617,e.shademedium=9618,e.shadeva=2358,e.shagujarati=2742,e.shagurmukhi=2614,e.shalshelethebrew=1427,e.shbopomofo=12565,e.shchacyrillic=1097,e.sheenarabic=1588,e.sheenfinalarabic=65206,e.sheeninitialarabic=65207,e.sheenmedialarabic=65208,e.sheicoptic=995,e.sheqel=8362,e.sheqelhebrew=8362,e.sheva=1456,e.sheva115=1456,e.sheva15=1456,e.sheva22=1456,e.sheva2e=1456,e.shevahebrew=1456,e.shevanarrowhebrew=1456,e.shevaquarterhebrew=1456,e.shevawidehebrew=1456,e.shhacyrillic=1211,e.shimacoptic=1005,e.shin=1513,e.shindagesh=64329,e.shindageshhebrew=64329,e.shindageshshindot=64300,e.shindageshshindothebrew=64300,e.shindageshsindot=64301,e.shindageshsindothebrew=64301,e.shindothebrew=1473,e.shinhebrew=1513,e.shinshindot=64298,e.shinshindothebrew=64298,e.shinsindot=64299,e.shinsindothebrew=64299,e.shook=642,e.sigma=963,e.sigma1=962,e.sigmafinal=962,e.sigmalunatesymbolgreek=1010,e.sihiragana=12375,e.sikatakana=12471,e.sikatakanahalfwidth=65404,e.siluqhebrew=1469,e.siluqlefthebrew=1469,e.similar=8764,e.sindothebrew=1474,e.siosacirclekorean=12916,e.siosaparenkorean=12820,e.sioscieuckorean=12670,e.sioscirclekorean=12902,e.sioskiyeokkorean=12666,e.sioskorean=12613,e.siosnieunkorean=12667,e.siosparenkorean=12806,e.siospieupkorean=12669,e.siostikeutkorean=12668,e.six=54,e.sixarabic=1638,e.sixbengali=2540,e.sixcircle=9317,e.sixcircleinversesansserif=10127,e.sixdeva=2412,e.sixgujarati=2796,e.sixgurmukhi=2668,e.sixhackarabic=1638,e.sixhangzhou=12326,e.sixideographicparen=12837,e.sixinferior=8326,e.sixmonospace=65302,e.sixoldstyle=63286,e.sixparen=9337,e.sixperiod=9357,e.sixpersian=1782,e.sixroman=8565,e.sixsuperior=8310,e.sixteencircle=9327,e.sixteencurrencydenominatorbengali=2553,e.sixteenparen=9347,e.sixteenperiod=9367,e.sixthai=3670,e.slash=47,e.slashmonospace=65295,e.slong=383,e.slongdotaccent=7835,e.smileface=9786,e.smonospace=65363,e.sofpasuqhebrew=1475,e.softhyphen=173,e.softsigncyrillic=1100,e.sohiragana=12381,e.sokatakana=12477,e.sokatakanahalfwidth=65407,e.soliduslongoverlaycmb=824,e.solidusshortoverlaycmb=823,e.sorusithai=3625,e.sosalathai=3624,e.sosothai=3595,e.sosuathai=3626,e.space=32,e.spacehackarabic=32,e.spade=9824,e.spadesuitblack=9824,e.spadesuitwhite=9828,e.sparen=9390,e.squarebelowcmb=827,e.squarecc=13252,e.squarecm=13213,e.squarediagonalcrosshatchfill=9641,e.squarehorizontalfill=9636,e.squarekg=13199,e.squarekm=13214,e.squarekmcapital=13262,e.squareln=13265,e.squarelog=13266,e.squaremg=13198,e.squaremil=13269,e.squaremm=13212,e.squaremsquared=13217,e.squareorthogonalcrosshatchfill=9638,e.squareupperlefttolowerrightfill=9639,e.squareupperrighttolowerleftfill=9640,e.squareverticalfill=9637,e.squarewhitewithsmallblack=9635,e.srsquare=13275,e.ssabengali=2487,e.ssadeva=2359,e.ssagujarati=2743,e.ssangcieuckorean=12617,e.ssanghieuhkorean=12677,e.ssangieungkorean=12672,e.ssangkiyeokkorean=12594,e.ssangnieunkorean=12645,e.ssangpieupkorean=12611,e.ssangsioskorean=12614,e.ssangtikeutkorean=12600,e.ssuperior=63218,e.sterling=163,e.sterlingmonospace=65505,e.strokelongoverlaycmb=822,e.strokeshortoverlaycmb=821,e.subset=8834,e.subsetnotequal=8842,e.subsetorequal=8838,e.succeeds=8827,e.suchthat=8715,e.suhiragana=12377,e.sukatakana=12473,e.sukatakanahalfwidth=65405,e.sukunarabic=1618,e.summation=8721,e.sun=9788,e.superset=8835,e.supersetnotequal=8843,e.supersetorequal=8839,e.svsquare=13276,e.syouwaerasquare=13180,e.t=116,e.tabengali=2468,e.tackdown=8868,e.tackleft=8867,e.tadeva=2340,e.tagujarati=2724,e.tagurmukhi=2596,e.taharabic=1591,e.tahfinalarabic=65218,e.tahinitialarabic=65219,e.tahiragana=12383,e.tahmedialarabic=65220,e.taisyouerasquare=13181,e.takatakana=12479,e.takatakanahalfwidth=65408,e.tatweelarabic=1600,e.tau=964,e.tav=1514,e.tavdages=64330,e.tavdagesh=64330,e.tavdageshhebrew=64330,e.tavhebrew=1514,e.tbar=359,e.tbopomofo=12554,e.tcaron=357,e.tccurl=680,e.tcedilla=355,e.tcheharabic=1670,e.tchehfinalarabic=64379,e.tchehinitialarabic=64380,e.tchehmedialarabic=64381,e.tcircle=9443,e.tcircumflexbelow=7793,e.tcommaaccent=355,e.tdieresis=7831,e.tdotaccent=7787,e.tdotbelow=7789,e.tecyrillic=1090,e.tedescendercyrillic=1197,e.teharabic=1578,e.tehfinalarabic=65174,e.tehhahinitialarabic=64674,e.tehhahisolatedarabic=64524,e.tehinitialarabic=65175,e.tehiragana=12390,e.tehjeeminitialarabic=64673,e.tehjeemisolatedarabic=64523,e.tehmarbutaarabic=1577,e.tehmarbutafinalarabic=65172,e.tehmedialarabic=65176,e.tehmeeminitialarabic=64676,e.tehmeemisolatedarabic=64526,e.tehnoonfinalarabic=64627,e.tekatakana=12486,e.tekatakanahalfwidth=65411,e.telephone=8481,e.telephoneblack=9742,e.telishagedolahebrew=1440,e.telishaqetanahebrew=1449,e.tencircle=9321,e.tenideographicparen=12841,e.tenparen=9341,e.tenperiod=9361,e.tenroman=8569,e.tesh=679,e.tet=1496,e.tetdagesh=64312,e.tetdageshhebrew=64312,e.tethebrew=1496,e.tetsecyrillic=1205,e.tevirhebrew=1435,e.tevirlefthebrew=1435,e.thabengali=2469,e.thadeva=2341,e.thagujarati=2725,e.thagurmukhi=2597,e.thalarabic=1584,e.thalfinalarabic=65196,e.thanthakhatlowleftthai=63640,e.thanthakhatlowrightthai=63639,e.thanthakhatthai=3660,e.thanthakhatupperleftthai=63638,e.theharabic=1579,e.thehfinalarabic=65178,e.thehinitialarabic=65179,e.thehmedialarabic=65180,e.thereexists=8707,e.therefore=8756,e.theta=952,e.theta1=977,e.thetasymbolgreek=977,e.thieuthacirclekorean=12921,e.thieuthaparenkorean=12825,e.thieuthcirclekorean=12907,e.thieuthkorean=12620,e.thieuthparenkorean=12811,e.thirteencircle=9324,e.thirteenparen=9344,e.thirteenperiod=9364,e.thonangmonthothai=3601,e.thook=429,e.thophuthaothai=3602,e.thorn=254,e.thothahanthai=3607,e.thothanthai=3600,e.thothongthai=3608,e.thothungthai=3606,e.thousandcyrillic=1154,e.thousandsseparatorarabic=1644,e.thousandsseparatorpersian=1644,e.three=51,e.threearabic=1635,e.threebengali=2537,e.threecircle=9314,e.threecircleinversesansserif=10124,e.threedeva=2409,e.threeeighths=8540,e.threegujarati=2793,e.threegurmukhi=2665,e.threehackarabic=1635,e.threehangzhou=12323,e.threeideographicparen=12834,e.threeinferior=8323,e.threemonospace=65299,e.threenumeratorbengali=2550,e.threeoldstyle=63283,e.threeparen=9334,e.threeperiod=9354,e.threepersian=1779,e.threequarters=190,e.threequartersemdash=63198,e.threeroman=8562,e.threesuperior=179,e.threethai=3667,e.thzsquare=13204,e.tihiragana=12385,e.tikatakana=12481,e.tikatakanahalfwidth=65409,e.tikeutacirclekorean=12912,e.tikeutaparenkorean=12816,e.tikeutcirclekorean=12898,e.tikeutkorean=12599,e.tikeutparenkorean=12802,e.tilde=732,e.tildebelowcmb=816,e.tildecmb=771,e.tildecomb=771,e.tildedoublecmb=864,e.tildeoperator=8764,e.tildeoverlaycmb=820,e.tildeverticalcmb=830,e.timescircle=8855,e.tipehahebrew=1430,e.tipehalefthebrew=1430,e.tippigurmukhi=2672,e.titlocyrilliccmb=1155,e.tiwnarmenian=1407,e.tlinebelow=7791,e.tmonospace=65364,e.toarmenian=1385,e.tohiragana=12392,e.tokatakana=12488,e.tokatakanahalfwidth=65412,e.tonebarextrahighmod=741,e.tonebarextralowmod=745,e.tonebarhighmod=742,e.tonebarlowmod=744,e.tonebarmidmod=743,e.tonefive=445,e.tonesix=389,e.tonetwo=424,e.tonos=900,e.tonsquare=13095,e.topatakthai=3599,e.tortoiseshellbracketleft=12308,e.tortoiseshellbracketleftsmall=65117,e.tortoiseshellbracketleftvertical=65081,e.tortoiseshellbracketright=12309,e.tortoiseshellbracketrightsmall=65118,e.tortoiseshellbracketrightvertical=65082,e.totaothai=3605,e.tpalatalhook=427,e.tparen=9391,e.trademark=8482,e.trademarksans=63722,e.trademarkserif=63195,e.tretroflexhook=648,e.triagdn=9660,e.triaglf=9668,e.triagrt=9658,e.triagup=9650,e.ts=678,e.tsadi=1510,e.tsadidagesh=64326,e.tsadidageshhebrew=64326,e.tsadihebrew=1510,e.tsecyrillic=1094,e.tsere=1461,e.tsere12=1461,e.tsere1e=1461,e.tsere2b=1461,e.tserehebrew=1461,e.tserenarrowhebrew=1461,e.tserequarterhebrew=1461,e.tserewidehebrew=1461,e.tshecyrillic=1115,e.tsuperior=63219,e.ttabengali=2463,e.ttadeva=2335,e.ttagujarati=2719,e.ttagurmukhi=2591,e.tteharabic=1657,e.ttehfinalarabic=64359,e.ttehinitialarabic=64360,e.ttehmedialarabic=64361,e.tthabengali=2464,e.tthadeva=2336,e.tthagujarati=2720,e.tthagurmukhi=2592,e.tturned=647,e.tuhiragana=12388,e.tukatakana=12484,e.tukatakanahalfwidth=65410,e.tusmallhiragana=12387,e.tusmallkatakana=12483,e.tusmallkatakanahalfwidth=65391,e.twelvecircle=9323,e.twelveparen=9343,e.twelveperiod=9363,e.twelveroman=8571,e.twentycircle=9331,e.twentyhangzhou=21316,e.twentyparen=9351,e.twentyperiod=9371,e.two=50,e.twoarabic=1634,e.twobengali=2536,e.twocircle=9313,e.twocircleinversesansserif=10123,e.twodeva=2408,e.twodotenleader=8229,e.twodotleader=8229,e.twodotleadervertical=65072,e.twogujarati=2792,e.twogurmukhi=2664,e.twohackarabic=1634,e.twohangzhou=12322,e.twoideographicparen=12833,e.twoinferior=8322,e.twomonospace=65298,e.twonumeratorbengali=2549,e.twooldstyle=63282,e.twoparen=9333,e.twoperiod=9353,e.twopersian=1778,e.tworoman=8561,e.twostroke=443,e.twosuperior=178,e.twothai=3666,e.twothirds=8532,e.u=117,e.uacute=250,e.ubar=649,e.ubengali=2441,e.ubopomofo=12584,e.ubreve=365,e.ucaron=468,e.ucircle=9444,e.ucircumflex=251,e.ucircumflexbelow=7799,e.ucyrillic=1091,e.udattadeva=2385,e.udblacute=369,e.udblgrave=533,e.udeva=2313,e.udieresis=252,e.udieresisacute=472,e.udieresisbelow=7795,e.udieresiscaron=474,e.udieresiscyrillic=1265,e.udieresisgrave=476,e.udieresismacron=470,e.udotbelow=7909,e.ugrave=249,e.ugujarati=2697,e.ugurmukhi=2569,e.uhiragana=12358,e.uhookabove=7911,e.uhorn=432,e.uhornacute=7913,e.uhorndotbelow=7921,e.uhorngrave=7915,e.uhornhookabove=7917,e.uhorntilde=7919,e.uhungarumlaut=369,e.uhungarumlautcyrillic=1267,e.uinvertedbreve=535,e.ukatakana=12454,e.ukatakanahalfwidth=65395,e.ukcyrillic=1145,e.ukorean=12636,e.umacron=363,e.umacroncyrillic=1263,e.umacrondieresis=7803,e.umatragurmukhi=2625,e.umonospace=65365,e.underscore=95,e.underscoredbl=8215,e.underscoremonospace=65343,e.underscorevertical=65075,e.underscorewavy=65103,e.union=8746,e.universal=8704,e.uogonek=371,e.uparen=9392,e.upblock=9600,e.upperdothebrew=1476,e.upsilon=965,e.upsilondieresis=971,e.upsilondieresistonos=944,e.upsilonlatin=650,e.upsilontonos=973,e.uptackbelowcmb=797,e.uptackmod=724,e.uragurmukhi=2675,e.uring=367,e.ushortcyrillic=1118,e.usmallhiragana=12357,e.usmallkatakana=12453,e.usmallkatakanahalfwidth=65385,e.ustraightcyrillic=1199,e.ustraightstrokecyrillic=1201,e.utilde=361,e.utildeacute=7801,e.utildebelow=7797,e.uubengali=2442,e.uudeva=2314,e.uugujarati=2698,e.uugurmukhi=2570,e.uumatragurmukhi=2626,e.uuvowelsignbengali=2498,e.uuvowelsigndeva=2370,e.uuvowelsigngujarati=2754,e.uvowelsignbengali=2497,e.uvowelsigndeva=2369,e.uvowelsigngujarati=2753,e.v=118,e.vadeva=2357,e.vagujarati=2741,e.vagurmukhi=2613,e.vakatakana=12535,e.vav=1493,e.vavdagesh=64309,e.vavdagesh65=64309,e.vavdageshhebrew=64309,e.vavhebrew=1493,e.vavholam=64331,e.vavholamhebrew=64331,e.vavvavhebrew=1520,e.vavyodhebrew=1521,e.vcircle=9445,e.vdotbelow=7807,e.vecyrillic=1074,e.veharabic=1700,e.vehfinalarabic=64363,e.vehinitialarabic=64364,e.vehmedialarabic=64365,e.vekatakana=12537,e.venus=9792,e.verticalbar=124,e.verticallineabovecmb=781,e.verticallinebelowcmb=809,e.verticallinelowmod=716,e.verticallinemod=712,e.vewarmenian=1406,e.vhook=651,e.vikatakana=12536,e.viramabengali=2509,e.viramadeva=2381,e.viramagujarati=2765,e.visargabengali=2435,e.visargadeva=2307,e.visargagujarati=2691,e.vmonospace=65366,e.voarmenian=1400,e.voicediterationhiragana=12446,e.voicediterationkatakana=12542,e.voicedmarkkana=12443,e.voicedmarkkanahalfwidth=65438,e.vokatakana=12538,e.vparen=9393,e.vtilde=7805,e.vturned=652,e.vuhiragana=12436,e.vukatakana=12532,e.w=119,e.wacute=7811,e.waekorean=12633,e.wahiragana=12431,e.wakatakana=12527,e.wakatakanahalfwidth=65436,e.wakorean=12632,e.wasmallhiragana=12430,e.wasmallkatakana=12526,e.wattosquare=13143,e.wavedash=12316,e.wavyunderscorevertical=65076,e.wawarabic=1608,e.wawfinalarabic=65262,e.wawhamzaabovearabic=1572,e.wawhamzaabovefinalarabic=65158,e.wbsquare=13277,e.wcircle=9446,e.wcircumflex=373,e.wdieresis=7813,e.wdotaccent=7815,e.wdotbelow=7817,e.wehiragana=12433,e.weierstrass=8472,e.wekatakana=12529,e.wekorean=12638,e.weokorean=12637,e.wgrave=7809,e.whitebullet=9702,e.whitecircle=9675,e.whitecircleinverse=9689,e.whitecornerbracketleft=12302,e.whitecornerbracketleftvertical=65091,e.whitecornerbracketright=12303,e.whitecornerbracketrightvertical=65092,e.whitediamond=9671,e.whitediamondcontainingblacksmalldiamond=9672,e.whitedownpointingsmalltriangle=9663;e.whitedownpointingtriangle=9661,e.whiteleftpointingsmalltriangle=9667,e.whiteleftpointingtriangle=9665,e.whitelenticularbracketleft=12310,e.whitelenticularbracketright=12311,e.whiterightpointingsmalltriangle=9657,e.whiterightpointingtriangle=9655,e.whitesmallsquare=9643,e.whitesmilingface=9786,e.whitesquare=9633,e.whitestar=9734,e.whitetelephone=9743,e.whitetortoiseshellbracketleft=12312,e.whitetortoiseshellbracketright=12313,e.whiteuppointingsmalltriangle=9653,e.whiteuppointingtriangle=9651,e.wihiragana=12432,e.wikatakana=12528,e.wikorean=12639,e.wmonospace=65367,e.wohiragana=12434,e.wokatakana=12530,e.wokatakanahalfwidth=65382,e.won=8361,e.wonmonospace=65510,e.wowaenthai=3623,e.wparen=9394,e.wring=7832,e.wsuperior=695,e.wturned=653,e.wynn=447,e.x=120,e.xabovecmb=829,e.xbopomofo=12562,e.xcircle=9447,e.xdieresis=7821,e.xdotaccent=7819,e.xeharmenian=1389,e.xi=958,e.xmonospace=65368,e.xparen=9395,e.xsuperior=739,e.y=121,e.yaadosquare=13134,e.yabengali=2479,e.yacute=253,e.yadeva=2351,e.yaekorean=12626,e.yagujarati=2735,e.yagurmukhi=2607,e.yahiragana=12420,e.yakatakana=12516,e.yakatakanahalfwidth=65428,e.yakorean=12625,e.yamakkanthai=3662,e.yasmallhiragana=12419,e.yasmallkatakana=12515,e.yasmallkatakanahalfwidth=65388,e.yatcyrillic=1123,e.ycircle=9448,e.ycircumflex=375,e.ydieresis=255,e.ydotaccent=7823,e.ydotbelow=7925,e.yeharabic=1610,e.yehbarreearabic=1746,e.yehbarreefinalarabic=64431,e.yehfinalarabic=65266,e.yehhamzaabovearabic=1574,e.yehhamzaabovefinalarabic=65162,e.yehhamzaaboveinitialarabic=65163,e.yehhamzaabovemedialarabic=65164,e.yehinitialarabic=65267,e.yehmedialarabic=65268,e.yehmeeminitialarabic=64733,e.yehmeemisolatedarabic=64600,e.yehnoonfinalarabic=64660,e.yehthreedotsbelowarabic=1745,e.yekorean=12630,e.yen=165,e.yenmonospace=65509,e.yeokorean=12629,e.yeorinhieuhkorean=12678,e.yerahbenyomohebrew=1450,e.yerahbenyomolefthebrew=1450,e.yericyrillic=1099,e.yerudieresiscyrillic=1273,e.yesieungkorean=12673,e.yesieungpansioskorean=12675,e.yesieungsioskorean=12674,e.yetivhebrew=1434,e.ygrave=7923,e.yhook=436,e.yhookabove=7927,e.yiarmenian=1397,e.yicyrillic=1111,e.yikorean=12642,e.yinyang=9775,e.yiwnarmenian=1410,e.ymonospace=65369,e.yod=1497,e.yoddagesh=64313,e.yoddageshhebrew=64313,e.yodhebrew=1497,e.yodyodhebrew=1522,e.yodyodpatahhebrew=64287,e.yohiragana=12424,e.yoikorean=12681,e.yokatakana=12520,e.yokatakanahalfwidth=65430,e.yokorean=12635,e.yosmallhiragana=12423,e.yosmallkatakana=12519,e.yosmallkatakanahalfwidth=65390,e.yotgreek=1011,e.yoyaekorean=12680,e.yoyakorean=12679,e.yoyakthai=3618,e.yoyingthai=3597,e.yparen=9396,e.ypogegrammeni=890,e.ypogegrammenigreekcmb=837,e.yr=422,e.yring=7833,e.ysuperior=696,e.ytilde=7929,e.yturned=654,e.yuhiragana=12422,e.yuikorean=12684,e.yukatakana=12518,e.yukatakanahalfwidth=65429,e.yukorean=12640,e.yusbigcyrillic=1131,e.yusbigiotifiedcyrillic=1133,e.yuslittlecyrillic=1127,e.yuslittleiotifiedcyrillic=1129,e.yusmallhiragana=12421,e.yusmallkatakana=12517,e.yusmallkatakanahalfwidth=65389,e.yuyekorean=12683,e.yuyeokorean=12682,e.yyabengali=2527,e.yyadeva=2399,e.z=122,e.zaarmenian=1382,e.zacute=378,e.zadeva=2395,e.zagurmukhi=2651,e.zaharabic=1592,e.zahfinalarabic=65222,e.zahinitialarabic=65223,e.zahiragana=12374,e.zahmedialarabic=65224,e.zainarabic=1586,e.zainfinalarabic=65200,e.zakatakana=12470,e.zaqefgadolhebrew=1429,e.zaqefqatanhebrew=1428,e.zarqahebrew=1432,e.zayin=1494,e.zayindagesh=64310,e.zayindageshhebrew=64310,e.zayinhebrew=1494,e.zbopomofo=12567,e.zcaron=382,e.zcircle=9449,e.zcircumflex=7825,e.zcurl=657,e.zdot=380,e.zdotaccent=380,e.zdotbelow=7827,e.zecyrillic=1079,e.zedescendercyrillic=1177,e.zedieresiscyrillic=1247,e.zehiragana=12380,e.zekatakana=12476,e.zero=48,e.zeroarabic=1632,e.zerobengali=2534,e.zerodeva=2406,e.zerogujarati=2790,e.zerogurmukhi=2662,e.zerohackarabic=1632,e.zeroinferior=8320,e.zeromonospace=65296,e.zerooldstyle=63280,e.zeropersian=1776,e.zerosuperior=8304,e.zerothai=3664,e.zerowidthjoiner=65279,e.zerowidthnonjoiner=8204,e.zerowidthspace=8203,e.zeta=950,e.zhbopomofo=12563,e.zhearmenian=1386,e.zhebrevecyrillic=1218,e.zhecyrillic=1078,e.zhedescendercyrillic=1175,e.zhedieresiscyrillic=1245,e.zihiragana=12376,e.zikatakana=12472,e.zinorhebrew=1454,e.zlinebelow=7829,e.zmonospace=65370,e.zohiragana=12382,e.zokatakana=12478,e.zparen=9397,e.zretroflexhook=656,e.zstroke=438,e.zuhiragana=12378,e.zukatakana=12474,e[".notdef"]=0,e.angbracketleftbig=9001,e.angbracketleftBig=9001,e.angbracketleftbigg=9001,e.angbracketleftBigg=9001,e.angbracketrightBig=9002,e.angbracketrightbig=9002,e.angbracketrightBigg=9002,e.angbracketrightbigg=9002,e.arrowhookleft=8618,e.arrowhookright=8617,e.arrowlefttophalf=8636,e.arrowleftbothalf=8637,e.arrownortheast=8599,e.arrownorthwest=8598,e.arrowrighttophalf=8640,e.arrowrightbothalf=8641,e.arrowsoutheast=8600,e.arrowsouthwest=8601,e.backslashbig=8726,e.backslashBig=8726,e.backslashBigg=8726,e.backslashbigg=8726,e.bardbl=8214,e.bracehtipdownleft=65079,e.bracehtipdownright=65079,e.bracehtipupleft=65080,e.bracehtipupright=65080,e.braceleftBig=123,e.braceleftbig=123,e.braceleftbigg=123,e.braceleftBigg=123,e.bracerightBig=125,e.bracerightbig=125,e.bracerightbigg=125,e.bracerightBigg=125,e.bracketleftbig=91,e.bracketleftBig=91,e.bracketleftbigg=91,e.bracketleftBigg=91,e.bracketrightBig=93,e.bracketrightbig=93,e.bracketrightbigg=93,e.bracketrightBigg=93,e.ceilingleftbig=8968,e.ceilingleftBig=8968,e.ceilingleftBigg=8968,e.ceilingleftbigg=8968,e.ceilingrightbig=8969,e.ceilingrightBig=8969,e.ceilingrightbigg=8969,e.ceilingrightBigg=8969,e.circledotdisplay=8857,e.circledottext=8857,e.circlemultiplydisplay=8855,e.circlemultiplytext=8855,e.circleplusdisplay=8853,e.circleplustext=8853,e.contintegraldisplay=8750,e.contintegraltext=8750,e.coproductdisplay=8720,e.coproducttext=8720,e.floorleftBig=8970,e.floorleftbig=8970,e.floorleftbigg=8970,e.floorleftBigg=8970,e.floorrightbig=8971,e.floorrightBig=8971,e.floorrightBigg=8971,e.floorrightbigg=8971,e.hatwide=770,e.hatwider=770,e.hatwidest=770,e.intercal=7488,e.integraldisplay=8747,e.integraltext=8747,e.intersectiondisplay=8898,e.intersectiontext=8898,e.logicalanddisplay=8743,e.logicalandtext=8743,e.logicalordisplay=8744,e.logicalortext=8744,e.parenleftBig=40,e.parenleftbig=40,e.parenleftBigg=40,e.parenleftbigg=40,e.parenrightBig=41,e.parenrightbig=41,e.parenrightBigg=41,e.parenrightbigg=41,e.prime=8242,e.productdisplay=8719,e.producttext=8719,e.radicalbig=8730,e.radicalBig=8730,e.radicalBigg=8730,e.radicalbigg=8730,e.radicalbt=8730,e.radicaltp=8730,e.radicalvertex=8730,e.slashbig=47,e.slashBig=47,e.slashBigg=47,e.slashbigg=47,e.summationdisplay=8721,e.summationtext=8721,e.tildewide=732,e.tildewider=732,e.tildewidest=732,e.uniondisplay=8899,e.unionmultidisplay=8846,e.unionmultitext=8846,e.unionsqdisplay=8852,e.unionsqtext=8852,e.uniontext=8899,e.vextenddouble=8741,e.vextendsingle=8739}),bn=getLookupTableFactory(function(e){e.space=32,e.a1=9985,e.a2=9986,e.a202=9987,e.a3=9988,e.a4=9742,e.a5=9990,e.a119=9991,e.a118=9992,e.a117=9993,e.a11=9755,e.a12=9758,e.a13=9996,e.a14=9997,e.a15=9998,e.a16=9999,e.a105=1e4,e.a17=10001,e.a18=10002,e.a19=10003,e.a20=10004,e.a21=10005,e.a22=10006,e.a23=10007,e.a24=10008,e.a25=10009,e.a26=10010,e.a27=10011,e.a28=10012,e.a6=10013,e.a7=10014,e.a8=10015,e.a9=10016,e.a10=10017,e.a29=10018,e.a30=10019,e.a31=10020,e.a32=10021,e.a33=10022,e.a34=10023,e.a35=9733,e.a36=10025,e.a37=10026,e.a38=10027,e.a39=10028,e.a40=10029,e.a41=10030,e.a42=10031,e.a43=10032,e.a44=10033,e.a45=10034,e.a46=10035,e.a47=10036,e.a48=10037,e.a49=10038,e.a50=10039,e.a51=10040,e.a52=10041,e.a53=10042,e.a54=10043,e.a55=10044,e.a56=10045,e.a57=10046,e.a58=10047,e.a59=10048,e.a60=10049,e.a61=10050,e.a62=10051,e.a63=10052,e.a64=10053,e.a65=10054,e.a66=10055,e.a67=10056,e.a68=10057,e.a69=10058,e.a70=10059,e.a71=9679,e.a72=10061,e.a73=9632,e.a74=10063,e.a203=10064,e.a75=10065,e.a204=10066,e.a76=9650,e.a77=9660,e.a78=9670,e.a79=10070,e.a81=9687,e.a82=10072,e.a83=10073,e.a84=10074,e.a97=10075,e.a98=10076,e.a99=10077,e.a100=10078,e.a101=10081,e.a102=10082,e.a103=10083,e.a104=10084,e.a106=10085,e.a107=10086,e.a108=10087,e.a112=9827,e.a111=9830,e.a110=9829,e.a109=9824,e.a120=9312,e.a121=9313,e.a122=9314,e.a123=9315,e.a124=9316,e.a125=9317,e.a126=9318,e.a127=9319,e.a128=9320,e.a129=9321,e.a130=10102,e.a131=10103,e.a132=10104,e.a133=10105,e.a134=10106,e.a135=10107,e.a136=10108,e.a137=10109,e.a138=10110,e.a139=10111,e.a140=10112,e.a141=10113,e.a142=10114,e.a143=10115,e.a144=10116,e.a145=10117,e.a146=10118,e.a147=10119,e.a148=10120,e.a149=10121,e.a150=10122,e.a151=10123,e.a152=10124,e.a153=10125,e.a154=10126,e.a155=10127,e.a156=10128,e.a157=10129,e.a158=10130,e.a159=10131,e.a160=10132,e.a161=8594,e.a163=8596,e.a164=8597,e.a196=10136,e.a165=10137,e.a192=10138,e.a166=10139,e.a167=10140,e.a168=10141,e.a169=10142,e.a170=10143,e.a171=10144,e.a172=10145,e.a173=10146,e.a162=10147,e.a174=10148,e.a175=10149,e.a176=10150,e.a177=10151,e.a178=10152,e.a179=10153,e.a193=10154,e.a180=10155,e.a199=10156,e.a181=10157,e.a200=10158,e.a182=10159,e.a201=10161,e.a183=10162,e.a184=10163,e.a197=10164,e.a185=10165,e.a194=10166,e.a198=10167,e.a186=10168,e.a195=10169,e.a187=10170,e.a188=10171,e.a189=10172,e.a190=10173,e.a191=10174,e.a89=10088,e.a90=10089,e.a93=10090,e.a94=10091,e.a91=10092,e.a92=10093,e.a205=10094,e.a85=10095,e.a206=10096,e.a86=10097,e.a87=10098,e.a88=10099,e.a95=10100,e.a96=10101,e[".notdef"]=0}),yn=getLookupTableFactory(function(e){e[63721]=169,e[63193]=169,e[63720]=174,e[63194]=174,e[63722]=8482,e[63195]=8482,e[63729]=9127,e[63730]=9128,e[63731]=9129,e[63740]=9131,e[63741]=9132,e[63742]=9133,e[63726]=9121,e[63727]=9122,e[63728]=9123,e[63737]=9124,e[63738]=9125,e[63739]=9126,e[63723]=9115,e[63724]=9116,e[63725]=9117,e[63734]=9118,e[63735]=9119,e[63736]=9120});function getUnicodeForGlyph(e,t){let i=t[e];if(void 0!==i)return i;if(!e)return-1;if("u"===e[0]){const t=e.length;let n;if(7===t&&"n"===e[1]&&"i"===e[2])n=e.substring(3);else{if(!(t>=5&&t<=7))return-1;n=e.substring(1)}if(n===n.toUpperCase()&&(i=parseInt(n,16),i>=0))return i}return-1}const wn=[[0,127],[128,255],[256,383],[384,591],[592,687,7424,7551,7552,7615],[688,767,42752,42783],[768,879,7616,7679],[880,1023],[11392,11519],[1024,1279,1280,1327,11744,11775,42560,42655],[1328,1423],[1424,1535],[42240,42559],[1536,1791,1872,1919],[1984,2047],[2304,2431],[2432,2559],[2560,2687],[2688,2815],[2816,2943],[2944,3071],[3072,3199],[3200,3327],[3328,3455],[3584,3711],[3712,3839],[4256,4351,11520,11567],[6912,7039],[4352,4607],[7680,7935,11360,11391,42784,43007],[7936,8191],[8192,8303,11776,11903],[8304,8351],[8352,8399],[8400,8447],[8448,8527],[8528,8591],[8592,8703,10224,10239,10496,10623,11008,11263],[8704,8959,10752,11007,10176,10223,10624,10751],[8960,9215],[9216,9279],[9280,9311],[9312,9471],[9472,9599],[9600,9631],[9632,9727],[9728,9983],[9984,10175],[12288,12351],[12352,12447],[12448,12543,12784,12799],[12544,12591,12704,12735],[12592,12687],[43072,43135],[12800,13055],[13056,13311],[44032,55215],[55296,57343],[67840,67871],[19968,40959,11904,12031,12032,12255,12272,12287,13312,19903,131072,173791,12688,12703],[57344,63743],[12736,12783,63744,64255,194560,195103],[64256,64335],[64336,65023],[65056,65071],[65040,65055],[65104,65135],[65136,65279],[65280,65519],[65520,65535],[3840,4095],[1792,1871],[1920,1983],[3456,3583],[4096,4255],[4608,4991,4992,5023,11648,11743],[5024,5119],[5120,5759],[5760,5791],[5792,5887],[6016,6143],[6144,6319],[10240,10495],[40960,42127],[5888,5919,5920,5951,5952,5983,5984,6015],[66304,66351],[66352,66383],[66560,66639],[118784,119039,119040,119295,119296,119375],[119808,120831],[1044480,1048573],[65024,65039,917760,917999],[917504,917631],[6400,6479],[6480,6527],[6528,6623],[6656,6687],[11264,11359],[11568,11647],[19904,19967],[43008,43055],[65536,65663,65664,65791,65792,65855],[65856,65935],[66432,66463],[66464,66527],[66640,66687],[66688,66735],[67584,67647],[68096,68191],[119552,119647],[73728,74751,74752,74879],[119648,119679],[7040,7103],[7168,7247],[7248,7295],[43136,43231],[43264,43311],[43312,43359],[43520,43615],[65936,65999],[66e3,66047],[66208,66271,66176,66207,67872,67903],[127024,127135,126976,127023]];function getUnicodeRangeFor(e,t=-1){if(-1!==t){const i=wn[t];for(let n=0,a=i.length;n<a;n+=2)if(e>=i[n]&&e<=i[n+1])return t}for(let t=0,i=wn.length;t<i;t++){const i=wn[t];for(let n=0,a=i.length;n<a;n+=2)if(e>=i[n]&&e<=i[n+1])return t}return-1}const An=new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$","u"),xn=new Map;const Sn=!0,vn=1,Cn=2,kn=4,Tn=32,Fn=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function recoverGlyphName(e,t){if(void 0!==t[e])return e;const i=getUnicodeForGlyph(e,t);if(-1!==i)for(const e in t)if(t[e]===i)return e;return info$1("Unable to recover a standard glyph name for: "+e),e}function type1FontGlyphMapping(e,t,i){const n=Object.create(null);let a,s,r;const o=!!(e.flags&kn);if(e.isInternalFont)for(r=t,s=0;s<r.length;s++)a=i.indexOf(r[s]),n[s]=a>=0?a:0;else if(e.baseEncodingName)for(r=getEncoding(e.baseEncodingName),s=0;s<r.length;s++)a=i.indexOf(r[s]),n[s]=a>=0?a:0;else if(o)for(s in t)n[s]=t[s];else for(r=un,s=0;s<r.length;s++)a=i.indexOf(r[s]),n[s]=a>=0?a:0;const l=e.differences;let c;if(l)for(s in l){const e=l[s];if(a=i.indexOf(e),-1===a){c||(c=mn());const t=recoverGlyphName(e,c);t!==e&&(a=i.indexOf(t))}n[s]=a>=0?a:0}return n}function normalizeFontName(e){return e.replaceAll(/[,_]/g,"-").replaceAll(/\s/g,"")}const In=getLookupTableFactory(e=>{e[8211]=65074,e[8212]=65073,e[8229]=65072,e[8230]=65049,e[12289]=65041,e[12290]=65042,e[12296]=65087,e[12297]=65088,e[12298]=65085,e[12299]=65086,e[12300]=65089,e[12301]=65090,e[12302]=65091,e[12303]=65092,e[12304]=65083,e[12305]=65084,e[12308]=65081,e[12309]=65082,e[12310]=65047,e[12311]=65048,e[65103]=65076,e[65281]=65045,e[65288]=65077,e[65289]=65078,e[65292]=65040,e[65306]=65043,e[65307]=65044,e[65311]=65046,e[65339]=65095,e[65341]=65096,e[65343]=65075,e[65371]=65079,e[65373]=65080});const En=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],Mn=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Dn=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"],On=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],_n=391,Pn=[null,{id:"hstem",min:2,stackClearing:!0,stem:!0},null,{id:"vstem",min:2,stackClearing:!0,stem:!0},{id:"vmoveto",min:1,stackClearing:!0},{id:"rlineto",min:2,resetStack:!0},{id:"hlineto",min:1,resetStack:!0},{id:"vlineto",min:1,resetStack:!0},{id:"rrcurveto",min:6,resetStack:!0},null,{id:"callsubr",min:1,undefStack:!0},{id:"return",min:0,undefStack:!0},null,null,{id:"endchar",min:0,stackClearing:!0},null,null,null,{id:"hstemhm",min:2,stackClearing:!0,stem:!0},{id:"hintmask",min:0,stackClearing:!0},{id:"cntrmask",min:0,stackClearing:!0},{id:"rmoveto",min:2,stackClearing:!0},{id:"hmoveto",min:1,stackClearing:!0},{id:"vstemhm",min:2,stackClearing:!0,stem:!0},{id:"rcurveline",min:8,resetStack:!0},{id:"rlinecurve",min:8,resetStack:!0},{id:"vvcurveto",min:4,resetStack:!0},{id:"hhcurveto",min:4,resetStack:!0},null,{id:"callgsubr",min:1,undefStack:!0},{id:"vhcurveto",min:4,resetStack:!0},{id:"hvcurveto",min:4,resetStack:!0}],Rn=[null,null,null,{id:"and",min:2,stackDelta:-1},{id:"or",min:2,stackDelta:-1},{id:"not",min:1,stackDelta:0},null,null,null,{id:"abs",min:1,stackDelta:0},{id:"add",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]+e[t-1]}},{id:"sub",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]-e[t-1]}},{id:"div",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]/e[t-1]}},null,{id:"neg",min:1,stackDelta:0,stackFn(e,t){e[t-1]=-e[t-1]}},{id:"eq",min:2,stackDelta:-1},null,null,{id:"drop",min:1,stackDelta:-1},null,{id:"put",min:2,stackDelta:-2},{id:"get",min:1,stackDelta:0},{id:"ifelse",min:4,stackDelta:-3},{id:"random",min:0,stackDelta:1},{id:"mul",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]*e[t-1]}},null,{id:"sqrt",min:1,stackDelta:0},{id:"dup",min:1,stackDelta:1},{id:"exch",min:2,stackDelta:0},{id:"index",min:2,stackDelta:0},{id:"roll",min:3,stackDelta:-2},null,null,null,{id:"hflex",min:7,resetStack:!0},{id:"flex",min:13,resetStack:!0},{id:"hflex1",min:9,resetStack:!0},{id:"flex1",min:11,resetStack:!0}];class CFFParser{constructor(e,t,i){this.bytes=e.getBytes(),this.properties=t,this.seacAnalysisEnabled=!!i}parse(){const e=this.properties,t=new CFF;this.cff=t;const i=this.parseHeader(),n=this.parseIndex(i.endPos),a=this.parseIndex(n.endPos),s=this.parseIndex(a.endPos),r=this.parseIndex(s.endPos),o=this.parseDict(a.obj.get(0)),l=this.createDict(CFFTopDict,o,t.strings);t.header=i.obj,t.names=this.parseNameIndex(n.obj),t.strings=this.parseStringIndex(s.obj),t.topDict=l,t.globalSubrIndex=r.obj,this.parsePrivateDict(t.topDict),t.isCIDFont=l.hasName("ROS");const c=l.getByName("CharStrings"),h=this.parseIndex(c).obj,d=l.getByName("FontMatrix");d&&(e.fontMatrix=d);const u=l.getByName("FontBBox");let g,f;if(u&&(e.ascent=Math.max(u[3],u[1]),e.descent=Math.min(u[1],u[3]),e.ascentScaled=!0),t.isCIDFont){const e=this.parseIndex(l.getByName("FDArray")).obj;for(let i=0,n=e.count;i<n;++i){const n=e.get(i),a=this.createDict(CFFTopDict,this.parseDict(n),t.strings);this.parsePrivateDict(a),t.fdArray.push(a)}f=null,g=this.parseCharsets(l.getByName("charset"),h.count,t.strings,!0),t.fdSelect=this.parseFDSelect(l.getByName("FDSelect"),h.count)}else g=this.parseCharsets(l.getByName("charset"),h.count,t.strings,!1),f=this.parseEncoding(l.getByName("Encoding"),e,t.strings,g.charset);t.charset=g,t.encoding=f;const p=this.parseCharStrings({charStrings:h,localSubrIndex:l.privateDict.subrsIndex,globalSubrIndex:r.obj,fdSelect:t.fdSelect,fdArray:t.fdArray,privateDict:l.privateDict});return t.charStrings=p.charStrings,t.seacs=p.seacs,t.widths=p.widths,t}parseHeader(){let e=this.bytes;const t=e.length;let i=0;for(;i<t&&1!==e[i];)++i;if(i>=t)throw new ti("Invalid CFF header");0!==i&&(info$1("cff data is shifted"),e=e.subarray(i),this.bytes=e);const n=e[0],a=e[1],s=e[2],r=e[3];return{obj:new CFFHeader(n,a,s,r),endPos:s}}parseDict(e){let t=0;function parseOperand(){let i=e[t++];return 30===i?function(){let i="";const n=15,a=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],s=e.length;for(;t<s;){const s=e[t++],r=s>>4,o=15&s;if(r===n)break;if(i+=a[r],o===n)break;i+=a[o]}return parseFloat(i)}():28===i?(i=readInt16(e,t),t+=2,i):29===i?(i=e[t++],i=i<<8|e[t++],i=i<<8|e[t++],i=i<<8|e[t++],i):i>=32&&i<=246?i-139:i>=247&&i<=250?256*(i-247)+e[t++]+108:i>=251&&i<=254?-256*(i-251)-e[t++]-108:(warn$1('CFFParser_parseDict: "'+i+'" is a reserved command.'),NaN)}let i=[];const n=[];t=0;const a=e.length;for(;t<a;){let a=e[t];a<=21?(12===a&&(a=a<<8|e[++t]),n.push([a,i]),i=[],++t):i.push(parseOperand())}return n}parseIndex(e){const t=new CFFIndex,i=this.bytes,n=i[e++]<<8|i[e++],a=[];let s,r,o=e;if(0!==n){const t=i[e++],l=e+(n+1)*t-1;for(s=0,r=n+1;s<r;++s){let n=0;for(let a=0;a<t;++a)n<<=8,n+=i[e++];a.push(l+n)}o=a[n]}for(s=0,r=a.length-1;s<r;++s){const e=a[s],n=a[s+1];t.add(i.subarray(e,n))}return{obj:t,endPos:o}}parseNameIndex(e){const t=[];for(let i=0,n=e.count;i<n;++i){const n=e.get(i);t.push(bytesToString$1(n))}return t}parseStringIndex(e){const t=new CFFStrings;for(let i=0,n=e.count;i<n;++i){const n=e.get(i);t.add(bytesToString$1(n))}return t}createDict(e,t,i){const n=new e(i);for(const[e,i]of t)n.setByKey(e,i);return n}parseCharString(e,t,i,n){if(!t||e.callDepth>10)return!1;let a=e.stackSize;const s=e.stack;let r=t.length;for(let o=0;o<r;){const l=t[o++];let c=null;if(12===l){const e=t[o++];0===e?(t[o-2]=139,t[o-1]=22,a=0):c=Rn[e]}else if(28===l)s[a]=readInt16(t,o),o+=2,a++;else if(14===l){if(a>=4&&(a-=4,this.seacAnalysisEnabled))return e.seac=s.slice(a,a+4),!1;c=Pn[l]}else if(l>=32&&l<=246)s[a]=l-139,a++;else if(l>=247&&l<=254)s[a]=l<251?(l-247<<8)+t[o]+108:-(l-251<<8)-t[o]-108,o++,a++;else if(255===l)s[a]=(t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3])/65536,o+=4,a++;else if(19===l||20===l){if(e.hints+=a>>1,0===e.hints){t.copyWithin(o-1,o,-1),o-=1,r-=1;continue}o+=e.hints+7>>3,a%=2,c=Pn[l]}else{if(10===l||29===l){const t=10===l?i:n;if(!t)return c=Pn[l],warn$1("Missing subrsIndex for "+c.id),!1;let r=32768;t.count<1240?r=107:t.count<33900&&(r=1131);const o=s[--a]+r;if(o<0||o>=t.count||isNaN(o))return c=Pn[l],warn$1("Out of bounds subrIndex for "+c.id),!1;e.stackSize=a,e.callDepth++;if(!this.parseCharString(e,t.get(o),i,n))return!1;e.callDepth--,a=e.stackSize;continue}if(11===l)return e.stackSize=a,!0;if(0===l&&o===t.length)t[o-1]=14,c=Pn[14];else{if(9===l){t.copyWithin(o-1,o,-1),o-=1,r-=1;continue}c=Pn[l]}}if(c){if(c.stem&&(e.hints+=a>>1,3===l||23===l?e.hasVStems=!0:!e.hasVStems||1!==l&&18!==l||(warn$1("CFF stem hints are in wrong order"),t[o-1]=1===l?3:23)),"min"in c&&!e.undefStack&&a<c.min)return warn$1("Not enough parameters for "+c.id+"; actual: "+a+", expected: "+c.min),0===a&&(t[o-1]=14,!0);e.firstStackClearing&&c.stackClearing&&(e.firstStackClearing=!1,a-=c.min,a>=2&&c.stem?a%=2:a>1&&warn$1("Found too many parameters for stack-clearing command"),a>0&&(e.width=s[a-1])),"stackDelta"in c?("stackFn"in c&&c.stackFn(s,a),a+=c.stackDelta):c.stackClearing?a=0:c.resetStack?(a=0,e.undefStack=!1):c.undefStack&&(a=0,e.undefStack=!0,e.firstStackClearing=!1)}}return r<t.length&&t.fill(14,r),e.stackSize=a,!0}parseCharStrings({charStrings:e,localSubrIndex:t,globalSubrIndex:i,fdSelect:n,fdArray:a,privateDict:s}){const r=[],o=[],l=e.count;for(let c=0;c<l;c++){const l=e.get(c),h={callDepth:0,stackSize:0,stack:[],undefStack:!0,hints:0,firstStackClearing:!0,seac:null,width:null,hasVStems:!1};let d=!0,u=null,g=s;if(n&&a.length){const e=n.getFDIndex(c);-1===e&&(warn$1("Glyph index is not in fd select."),d=!1),e>=a.length&&(warn$1("Invalid fd index for glyph index."),d=!1),d&&(g=a[e].privateDict,u=g.subrsIndex)}else t&&(u=t);if(d&&(d=this.parseCharString(h,l,u,i)),null!==h.width){const e=g.getByName("nominalWidthX");o[c]=e+h.width}else{const e=g.getByName("defaultWidthX");o[c]=e}null!==h.seac&&(r[c]=h.seac),d||e.set(c,new Uint8Array([14]))}return{charStrings:e,seacs:r,widths:o}}emptyPrivateDictionary(e){const t=this.createDict(CFFPrivateDict,[],e.strings);e.setByKey(18,[0,0]),e.privateDict=t}parsePrivateDict(e){if(!e.hasName("Private"))return void this.emptyPrivateDictionary(e);const t=e.getByName("Private");if(!Array.isArray(t)||2!==t.length)return void e.removeByName("Private");const i=t[0],n=t[1];if(0===i||n>=this.bytes.length)return void this.emptyPrivateDictionary(e);const a=n+i,s=this.bytes.subarray(n,a),r=this.parseDict(s),o=this.createDict(CFFPrivateDict,r,e.strings);if(e.privateDict=o,0===o.getByName("ExpansionFactor")&&o.setByName("ExpansionFactor",.06),!o.getByName("Subrs"))return;const l=o.getByName("Subrs"),c=n+l;if(0===l||c>=this.bytes.length)return void this.emptyPrivateDictionary(e);const h=this.parseIndex(c);o.subrsIndex=h.obj}parseCharsets(e,t,i,n){if(0===e)return new CFFCharset(!0,Ln.ISO_ADOBE,En);if(1===e)return new CFFCharset(!0,Ln.EXPERT,Mn);if(2===e)return new CFFCharset(!0,Ln.EXPERT_SUBSET,Dn);const a=this.bytes,s=e,r=a[e++],o=[n?0:".notdef"];let l,c,h;switch(t-=1,r){case 0:for(h=0;h<t;h++)l=a[e++]<<8|a[e++],o.push(n?l:i.get(l));break;case 1:for(;o.length<=t;)for(l=a[e++]<<8|a[e++],c=a[e++],h=0;h<=c;h++)o.push(n?l++:i.get(l++));break;case 2:for(;o.length<=t;)for(l=a[e++]<<8|a[e++],c=a[e++]<<8|a[e++],h=0;h<=c;h++)o.push(n?l++:i.get(l++));break;default:throw new ti("Unknown charset format")}const d=e,u=a.subarray(s,d);return new CFFCharset(!1,r,o,u)}parseEncoding(e,t,i,n){const a=Object.create(null),s=this.bytes;let r,o,l,c=!1,h=null;if(0===e||1===e){c=!0,r=e;const t=e?cn:un;for(o=0,l=n.length;o<l;o++){const e=t.indexOf(n[o]);-1!==e&&(a[e]=o)}}else{const t=e;switch(r=s[e++],127&r){case 0:const t=s[e++];for(o=1;o<=t;o++)a[s[e++]]=o;break;case 1:const i=s[e++];let n=1;for(o=0;o<i;o++){const t=s[e++],i=s[e++];for(let e=t;e<=t+i;e++)a[e]=n++}break;default:throw new ti(`Unknown encoding format: ${r} in CFF`)}const l=e;128&r&&(s[t]&=127,function(){const t=s[e++];for(o=0;o<t;o++){const t=s[e++],r=(s[e++]<<8)+(255&s[e++]);a[t]=n.indexOf(i.get(r))}}()),h=s.subarray(t,l)}return r&=127,new CFFEncoding(c,r,a,h)}parseFDSelect(e,t){const i=this.bytes,n=i[e++],a=[];let s;switch(n){case 0:for(s=0;s<t;++s){const t=i[e++];a.push(t)}break;case 3:const r=i[e++]<<8|i[e++];for(s=0;s<r;++s){let t=i[e++]<<8|i[e++];0===s&&0!==t&&(warn$1("parseFDSelect: The first range must have a first GID of 0 -- trying to recover."),t=0);const n=i[e++],r=i[e]<<8|i[e+1];for(let e=t;e<r;++e)a.push(n)}e+=2;break;default:throw new ti(`parseFDSelect: Unknown format "${n}".`)}if(a.length!==t)throw new ti("parseFDSelect: Invalid font data.");return new CFFFDSelect(n,a)}}class CFF{constructor(){this.header=null,this.names=[],this.topDict=null,this.strings=new CFFStrings,this.globalSubrIndex=null,this.encoding=null,this.charset=null,this.charStrings=null,this.fdArray=[],this.fdSelect=null,this.isCIDFont=!1}duplicateFirstGlyph(){if(this.charStrings.count>=65535)return void warn$1("Not enough space in charstrings to duplicate first glyph.");const e=this.charStrings.get(0);this.charStrings.add(e),this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}hasGlyphId(e){if(e<0||e>=this.charStrings.count)return!1;return this.charStrings.get(e).length>0}}class CFFHeader{constructor(e,t,i,n){this.major=e,this.minor=t,this.hdrSize=i,this.offSize=n}}class CFFStrings{constructor(){this.strings=[]}get(e){return e>=0&&e<=390?On[e]:e-_n<=this.strings.length?this.strings[e-_n]:On[0]}getSID(e){let t=On.indexOf(e);return-1!==t?t:(t=this.strings.indexOf(e),-1!==t?t+_n:-1)}add(e){this.strings.push(e)}get count(){return this.strings.length}}class CFFIndex{constructor(){this.objects=[],this.length=0}add(e){this.length+=e.length,this.objects.push(e)}set(e,t){this.length+=t.length-this.objects[e].length,this.objects[e]=t}get(e){return this.objects[e]}get count(){return this.objects.length}}class CFFDict{constructor(e,t){this.keyToNameMap=e.keyToNameMap,this.nameToKeyMap=e.nameToKeyMap,this.defaults=e.defaults,this.types=e.types,this.opcodes=e.opcodes,this.order=e.order,this.strings=t,this.values=Object.create(null)}setByKey(e,t){if(!(e in this.keyToNameMap))return!1;if(0===t.length)return!0;for(const i of t)if(isNaN(i))return warn$1(`Invalid CFFDict value: "${t}" for key "${e}".`),!0;const i=this.types[e];return"num"!==i&&"sid"!==i&&"offset"!==i||(t=t[0]),this.values[e]=t,!0}setByName(e,t){if(!(e in this.nameToKeyMap))throw new ti(`Invalid dictionary name "${e}"`);this.values[this.nameToKeyMap[e]]=t}hasName(e){return this.nameToKeyMap[e]in this.values}getByName(e){if(!(e in this.nameToKeyMap))throw new ti(`Invalid dictionary name ${e}"`);const t=this.nameToKeyMap[e];return t in this.values?this.values[t]:this.defaults[t]}removeByName(e){delete this.values[this.nameToKeyMap[e]]}static createTables(e){const t={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(const i of e){const e=Array.isArray(i[0])?(i[0][0]<<8)+i[0][1]:i[0];t.keyToNameMap[e]=i[1],t.nameToKeyMap[i[1]]=e,t.types[e]=i[2],t.defaults[e]=i[3],t.opcodes[e]=Array.isArray(i[0])?i[0]:[i[0]],t.order.push(e)}return t}}const Bn=[[[12,30],"ROS",["sid","sid","num"],null],[[12,20],"SyntheticBase","num",null],[0,"version","sid",null],[1,"Notice","sid",null],[[12,0],"Copyright","sid",null],[2,"FullName","sid",null],[3,"FamilyName","sid",null],[4,"Weight","sid",null],[[12,1],"isFixedPitch","num",0],[[12,2],"ItalicAngle","num",0],[[12,3],"UnderlinePosition","num",-100],[[12,4],"UnderlineThickness","num",50],[[12,5],"PaintType","num",0],[[12,6],"CharstringType","num",2],[[12,7],"FontMatrix",["num","num","num","num","num","num"],[.001,0,0,.001,0,0]],[13,"UniqueID","num",null],[5,"FontBBox",["num","num","num","num"],[0,0,0,0]],[[12,8],"StrokeWidth","num",0],[14,"XUID","array",null],[15,"charset","offset",0],[16,"Encoding","offset",0],[17,"CharStrings","offset",0],[18,"Private",["offset","offset"],null],[[12,21],"PostScript","sid",null],[[12,22],"BaseFontName","sid",null],[[12,23],"BaseFontBlend","delta",null],[[12,31],"CIDFontVersion","num",0],[[12,32],"CIDFontRevision","num",0],[[12,33],"CIDFontType","num",0],[[12,34],"CIDCount","num",8720],[[12,35],"UIDBase","num",null],[[12,37],"FDSelect","offset",null],[[12,36],"FDArray","offset",null],[[12,38],"FontName","sid",null]];class CFFTopDict extends CFFDict{static get tables(){return shadow$1(this,"tables",this.createTables(Bn))}constructor(e){super(CFFTopDict.tables,e),this.privateDict=null}}const Nn=[[6,"BlueValues","delta",null],[7,"OtherBlues","delta",null],[8,"FamilyBlues","delta",null],[9,"FamilyOtherBlues","delta",null],[[12,9],"BlueScale","num",.039625],[[12,10],"BlueShift","num",7],[[12,11],"BlueFuzz","num",1],[10,"StdHW","num",null],[11,"StdVW","num",null],[[12,12],"StemSnapH","delta",null],[[12,13],"StemSnapV","delta",null],[[12,14],"ForceBold","num",0],[[12,17],"LanguageGroup","num",0],[[12,18],"ExpansionFactor","num",.06],[[12,19],"initialRandomSeed","num",0],[20,"defaultWidthX","num",0],[21,"nominalWidthX","num",0],[19,"Subrs","offset",null]];class CFFPrivateDict extends CFFDict{static get tables(){return shadow$1(this,"tables",this.createTables(Nn))}constructor(e){super(CFFPrivateDict.tables,e),this.subrsIndex=null}}const Ln={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2};class CFFCharset{constructor(e,t,i,n){this.predefined=e,this.format=t,this.charset=i,this.raw=n}}class CFFEncoding{constructor(e,t,i,n){this.predefined=e,this.format=t,this.encoding=i,this.raw=n}}class CFFFDSelect{constructor(e,t){this.format=e,this.fdSelect=t}getFDIndex(e){return e<0||e>=this.fdSelect.length?-1:this.fdSelect[e]}}class CFFOffsetTracker{constructor(){this.offsets=Object.create(null)}isTracking(e){return e in this.offsets}track(e,t){if(e in this.offsets)throw new ti(`Already tracking location of ${e}`);this.offsets[e]=t}offset(e){for(const t in this.offsets)this.offsets[t]+=e}setEntryLocation(e,t,i){if(!(e in this.offsets))throw new ti(`Not tracking location of ${e}`);const n=i.data,a=this.offsets[e];for(let e=0,i=t.length;e<i;++e){const i=5*e+a,s=i+1,r=i+2,o=i+3,l=i+4;if(29!==n[i]||0!==n[s]||0!==n[r]||0!==n[o]||0!==n[l])throw new ti("writing to an offset that is not empty");const c=t[e];n[i]=29,n[s]=c>>24&255,n[r]=c>>16&255,n[o]=c>>8&255,n[l]=255&c}}}class CFFCompiler{constructor(e){this.cff=e}compile(){const e=this.cff,t={data:[],length:0,add(e){try{this.data.push(...e)}catch{this.data=this.data.concat(e)}this.length=this.data.length}},i=this.compileHeader(e.header);t.add(i);const n=this.compileNameIndex(e.names);if(t.add(n),e.isCIDFont&&e.topDict.hasName("FontMatrix")){const t=e.topDict.getByName("FontMatrix");e.topDict.removeByName("FontMatrix");for(const i of e.fdArray){let e=t.slice(0);i.hasName("FontMatrix")&&(e=ai.transform(e,i.getByName("FontMatrix"))),i.setByName("FontMatrix",e)}}const a=e.topDict.getByName("XUID");a?.length>16&&e.topDict.removeByName("XUID"),e.topDict.setByName("charset",0);let s=this.compileTopDicts([e.topDict],t.length,e.isCIDFont);t.add(s.output);const r=s.trackers[0],o=this.compileStringIndex(e.strings.strings);t.add(o);const l=this.compileIndex(e.globalSubrIndex);if(t.add(l),e.encoding&&e.topDict.hasName("Encoding"))if(e.encoding.predefined)r.setEntryLocation("Encoding",[e.encoding.format],t);else{const i=this.compileEncoding(e.encoding);r.setEntryLocation("Encoding",[t.length],t),t.add(i)}const c=this.compileCharset(e.charset,e.charStrings.count,e.strings,e.isCIDFont);r.setEntryLocation("charset",[t.length],t),t.add(c);const h=this.compileCharStrings(e.charStrings);if(r.setEntryLocation("CharStrings",[t.length],t),t.add(h),e.isCIDFont){r.setEntryLocation("FDSelect",[t.length],t);const i=this.compileFDSelect(e.fdSelect);t.add(i),s=this.compileTopDicts(e.fdArray,t.length,!0),r.setEntryLocation("FDArray",[t.length],t),t.add(s.output);const n=s.trackers;this.compilePrivateDicts(e.fdArray,n,t)}return this.compilePrivateDicts([e.topDict],[r],t),t.add([0]),t.data}encodeNumber(e){return Number.isInteger(e)?this.encodeInteger(e):this.encodeFloat(e)}static get EncodeFloatRegExp(){return shadow$1(this,"EncodeFloatRegExp",/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/)}encodeFloat(e){let t=e.toString();const i=CFFCompiler.EncodeFloatRegExp.exec(t);if(i){const n=parseFloat("1e"+((i[2]?+i[2]:0)+i[1].length));t=(Math.round(e*n)/n).toString()}let n,a,s="";for(n=0,a=t.length;n<a;++n){const e=t[n];s+="e"===e?"-"===t[++n]?"c":"b":"."===e?"a":"-"===e?"e":e}s+=1&s.length?"f":"ff";const r=[30];for(n=0,a=s.length;n<a;n+=2)r.push(parseInt(s.substring(n,n+2),16));return r}encodeInteger(e){let t;return t=e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?[28,e>>8&255,255&e]:[29,e>>24&255,e>>16&255,e>>8&255,255&e],t}compileHeader(e){return[e.major,e.minor,4,e.offSize]}compileNameIndex(e){const t=new CFFIndex;for(const i of e){const e=Math.min(i.length,127);let n=new Array(e);for(let t=0;t<e;t++){let e=i[t];(e<"!"||e>"~"||"["===e||"]"===e||"("===e||")"===e||"{"===e||"}"===e||"<"===e||">"===e||"/"===e||"%"===e)&&(e="_"),n[t]=e}n=n.join(""),""===n&&(n="Bad_Font_Name"),t.add(stringToBytes$1(n))}return this.compileIndex(t)}compileTopDicts(e,t,i){const n=[];let a=new CFFIndex;for(const s of e){i&&(s.removeByName("CIDFontVersion"),s.removeByName("CIDFontRevision"),s.removeByName("CIDFontType"),s.removeByName("CIDCount"),s.removeByName("UIDBase"));const e=new CFFOffsetTracker,r=this.compileDict(s,e);n.push(e),a.add(r),e.offset(t)}return a=this.compileIndex(a,n),{trackers:n,output:a}}compilePrivateDicts(e,t,i){for(let n=0,a=e.length;n<a;++n){const a=e[n],s=a.privateDict;if(!s||!a.hasName("Private"))throw new ti("There must be a private dictionary.");const r=new CFFOffsetTracker,o=this.compileDict(s,r);let l=i.length;if(r.offset(l),o.length||(l=0),t[n].setEntryLocation("Private",[o.length,l],i),i.add(o),s.subrsIndex&&s.hasName("Subrs")){const e=this.compileIndex(s.subrsIndex);r.setEntryLocation("Subrs",[o.length],i),i.add(e)}}}compileDict(e,t){const i=[];for(const n of e.order){if(!(n in e.values))continue;let a=e.values[n],s=e.types[n];if(Array.isArray(s)||(s=[s]),Array.isArray(a)||(a=[a]),0!==a.length){for(let r=0,o=s.length;r<o;++r){const o=s[r],l=a[r];switch(o){case"num":case"sid":i.push(...this.encodeNumber(l));break;case"offset":const s=e.keyToNameMap[n];t.isTracking(s)||t.track(s,i.length),i.push(29,0,0,0,0);break;case"array":case"delta":i.push(...this.encodeNumber(l));for(let e=1,t=a.length;e<t;++e)i.push(...this.encodeNumber(a[e]));break;default:throw new ti(`Unknown data type of ${o}`)}}i.push(...e.opcodes[n])}}return i}compileStringIndex(e){const t=new CFFIndex;for(const i of e)t.add(stringToBytes$1(i));return this.compileIndex(t)}compileCharStrings(e){const t=new CFFIndex;for(let i=0;i<e.count;i++){const n=e.get(i);0!==n.length?t.add(n):t.add(new Uint8Array([139,14]))}return this.compileIndex(t)}compileCharset(e,t,i,n){let a;const s=t-1;if(n){const e=s-1;a=new Uint8Array([2,0,1,e>>8&255,255&e])}else{a=new Uint8Array(1+2*s),a[0]=0;let t=0;const n=e.charset.length;let r=!1;for(let s=1;s<a.length;s+=2){let o=0;if(t<n){const n=e.charset[t++];o=i.getSID(n),-1===o&&(o=0,r||(r=!0,warn$1(`Couldn't find ${n} in CFF strings`)))}a[s]=o>>8&255,a[s+1]=255&o}}return this.compileTypedArray(a)}compileEncoding(e){return this.compileTypedArray(e.raw)}compileFDSelect(e){const t=e.format;let i,n;switch(t){case 0:for(i=new Uint8Array(1+e.fdSelect.length),i[0]=t,n=0;n<e.fdSelect.length;n++)i[n+1]=e.fdSelect[n];break;case 3:const a=0;let s=e.fdSelect[0];const r=[t,0,0,a>>8&255,255&a,s];for(n=1;n<e.fdSelect.length;n++){const t=e.fdSelect[n];t!==s&&(r.push(n>>8&255,255&n,t),s=t)}const o=(r.length-3)/3;r[1]=o>>8&255,r[2]=255&o,r.push(n>>8&255,255&n),i=new Uint8Array(r)}return this.compileTypedArray(i)}compileTypedArray(e){return Array.from(e)}compileIndex(e,t=[]){const i=e.objects,n=i.length;if(0===n)return[0,0];const a=[n>>8&255,255&n];let s,r,o=1;for(s=0;s<n;++s)o+=i[s].length;r=o<256?1:o<65536?2:o<16777216?3:4,a.push(r);let l=1;for(s=0;s<n+1;s++)1===r?a.push(255&l):2===r?a.push(l>>8&255,255&l):3===r?a.push(l>>16&255,l>>8&255,255&l):a.push(l>>>24&255,l>>16&255,l>>8&255,255&l),i[s]&&(l+=i[s].length);for(s=0;s<n;s++)t[s]&&t[s].offset(a.length),a.push(...i[s]);return a}}const Un=getLookupTableFactory(function(e){e["Times-Roman"]="Times-Roman",e.Helvetica="Helvetica",e.Courier="Courier",e.Symbol="Symbol",e["Times-Bold"]="Times-Bold",e["Helvetica-Bold"]="Helvetica-Bold",e["Courier-Bold"]="Courier-Bold",e.ZapfDingbats="ZapfDingbats",e["Times-Italic"]="Times-Italic",e["Helvetica-Oblique"]="Helvetica-Oblique",e["Courier-Oblique"]="Courier-Oblique",e["Times-BoldItalic"]="Times-BoldItalic",e["Helvetica-BoldOblique"]="Helvetica-BoldOblique",e["Courier-BoldOblique"]="Courier-BoldOblique",e.ArialNarrow="Helvetica",e["ArialNarrow-Bold"]="Helvetica-Bold",e["ArialNarrow-BoldItalic"]="Helvetica-BoldOblique",e["ArialNarrow-Italic"]="Helvetica-Oblique",e.ArialBlack="Helvetica",e["ArialBlack-Bold"]="Helvetica-Bold",e["ArialBlack-BoldItalic"]="Helvetica-BoldOblique",e["ArialBlack-Italic"]="Helvetica-Oblique",e["Arial-Black"]="Helvetica",e["Arial-Black-Bold"]="Helvetica-Bold",e["Arial-Black-BoldItalic"]="Helvetica-BoldOblique",e["Arial-Black-Italic"]="Helvetica-Oblique",e.Arial="Helvetica",e["Arial-Bold"]="Helvetica-Bold",e["Arial-BoldItalic"]="Helvetica-BoldOblique",e["Arial-Italic"]="Helvetica-Oblique",e.ArialMT="Helvetica",e["Arial-BoldItalicMT"]="Helvetica-BoldOblique",e["Arial-BoldMT"]="Helvetica-Bold",e["Arial-ItalicMT"]="Helvetica-Oblique",e["Arial-BoldItalicMT-BoldItalic"]="Helvetica-BoldOblique",e["Arial-BoldMT-Bold"]="Helvetica-Bold",e["Arial-ItalicMT-Italic"]="Helvetica-Oblique",e.ArialUnicodeMS="Helvetica",e["ArialUnicodeMS-Bold"]="Helvetica-Bold",e["ArialUnicodeMS-BoldItalic"]="Helvetica-BoldOblique",e["ArialUnicodeMS-Italic"]="Helvetica-Oblique",e["Courier-BoldItalic"]="Courier-BoldOblique",e["Courier-Italic"]="Courier-Oblique",e.CourierNew="Courier",e["CourierNew-Bold"]="Courier-Bold",e["CourierNew-BoldItalic"]="Courier-BoldOblique",e["CourierNew-Italic"]="Courier-Oblique",e["CourierNewPS-BoldItalicMT"]="Courier-BoldOblique",e["CourierNewPS-BoldMT"]="Courier-Bold",e["CourierNewPS-ItalicMT"]="Courier-Oblique",e.CourierNewPSMT="Courier",e["Helvetica-BoldItalic"]="Helvetica-BoldOblique",e["Helvetica-Italic"]="Helvetica-Oblique",e["HelveticaLTStd-Bold"]="Helvetica-Bold",e["Symbol-Bold"]="Symbol",e["Symbol-BoldItalic"]="Symbol",e["Symbol-Italic"]="Symbol",e.TimesNewRoman="Times-Roman",e["TimesNewRoman-Bold"]="Times-Bold",e["TimesNewRoman-BoldItalic"]="Times-BoldItalic",e["TimesNewRoman-Italic"]="Times-Italic",e.TimesNewRomanPS="Times-Roman",e["TimesNewRomanPS-Bold"]="Times-Bold",e["TimesNewRomanPS-BoldItalic"]="Times-BoldItalic",e["TimesNewRomanPS-BoldItalicMT"]="Times-BoldItalic",e["TimesNewRomanPS-BoldMT"]="Times-Bold",e["TimesNewRomanPS-Italic"]="Times-Italic",e["TimesNewRomanPS-ItalicMT"]="Times-Italic",e.TimesNewRomanPSMT="Times-Roman",e["TimesNewRomanPSMT-Bold"]="Times-Bold",e["TimesNewRomanPSMT-BoldItalic"]="Times-BoldItalic",e["TimesNewRomanPSMT-Italic"]="Times-Italic"}),jn=getLookupTableFactory(function(e){e.Courier="FoxitFixed.pfb",e["Courier-Bold"]="FoxitFixedBold.pfb",e["Courier-BoldOblique"]="FoxitFixedBoldItalic.pfb",e["Courier-Oblique"]="FoxitFixedItalic.pfb",e.Helvetica="LiberationSans-Regular.ttf",e["Helvetica-Bold"]="LiberationSans-Bold.ttf",e["Helvetica-BoldOblique"]="LiberationSans-BoldItalic.ttf",e["Helvetica-Oblique"]="LiberationSans-Italic.ttf",e["Times-Roman"]="FoxitSerif.pfb",e["Times-Bold"]="FoxitSerifBold.pfb",e["Times-BoldItalic"]="FoxitSerifBoldItalic.pfb",e["Times-Italic"]="FoxitSerifItalic.pfb",e.Symbol="FoxitSymbol.pfb",e.ZapfDingbats="FoxitDingbats.pfb",e["LiberationSans-Regular"]="LiberationSans-Regular.ttf",e["LiberationSans-Bold"]="LiberationSans-Bold.ttf",e["LiberationSans-Italic"]="LiberationSans-Italic.ttf",e["LiberationSans-BoldItalic"]="LiberationSans-BoldItalic.ttf"}),$n=getLookupTableFactory(function(e){e.Calibri="Helvetica",e["Calibri-Bold"]="Helvetica-Bold",e["Calibri-BoldItalic"]="Helvetica-BoldOblique",e["Calibri-Italic"]="Helvetica-Oblique",e.CenturyGothic="Helvetica",e["CenturyGothic-Bold"]="Helvetica-Bold",e["CenturyGothic-BoldItalic"]="Helvetica-BoldOblique",e["CenturyGothic-Italic"]="Helvetica-Oblique",e.ComicSansMS="Comic Sans MS",e["ComicSansMS-Bold"]="Comic Sans MS-Bold",e["ComicSansMS-BoldItalic"]="Comic Sans MS-BoldItalic",e["ComicSansMS-Italic"]="Comic Sans MS-Italic",e.GillSansMT="Helvetica",e["GillSansMT-Bold"]="Helvetica-Bold",e["GillSansMT-BoldItalic"]="Helvetica-BoldOblique",e["GillSansMT-Italic"]="Helvetica-Oblique",e.Impact="Helvetica",e["ItcSymbol-Bold"]="Helvetica-Bold",e["ItcSymbol-BoldItalic"]="Helvetica-BoldOblique",e["ItcSymbol-Book"]="Helvetica",e["ItcSymbol-BookItalic"]="Helvetica-Oblique",e["ItcSymbol-Medium"]="Helvetica",e["ItcSymbol-MediumItalic"]="Helvetica-Oblique",e.LucidaConsole="Courier",e["LucidaConsole-Bold"]="Courier-Bold",e["LucidaConsole-BoldItalic"]="Courier-BoldOblique",e["LucidaConsole-Italic"]="Courier-Oblique",e["LucidaSans-Demi"]="Helvetica-Bold",e["MS-Gothic"]="MS Gothic",e["MS-Gothic-Bold"]="MS Gothic-Bold",e["MS-Gothic-BoldItalic"]="MS Gothic-BoldItalic",e["MS-Gothic-Italic"]="MS Gothic-Italic",e["MS-Mincho"]="MS Mincho",e["MS-Mincho-Bold"]="MS Mincho-Bold",e["MS-Mincho-BoldItalic"]="MS Mincho-BoldItalic",e["MS-Mincho-Italic"]="MS Mincho-Italic",e["MS-PGothic"]="MS PGothic",e["MS-PGothic-Bold"]="MS PGothic-Bold",e["MS-PGothic-BoldItalic"]="MS PGothic-BoldItalic",e["MS-PGothic-Italic"]="MS PGothic-Italic",e["MS-PMincho"]="MS PMincho",e["MS-PMincho-Bold"]="MS PMincho-Bold",e["MS-PMincho-BoldItalic"]="MS PMincho-BoldItalic",e["MS-PMincho-Italic"]="MS PMincho-Italic",e.NuptialScript="Times-Italic",e.SegoeUISymbol="Helvetica"}),Hn=getLookupTableFactory(function(e){e["Adobe Jenson"]=!0,e["Adobe Text"]=!0,e.Albertus=!0,e.Aldus=!0,e.Alexandria=!0,e.Algerian=!0,e["American Typewriter"]=!0,e.Antiqua=!0,e.Apex=!0,e.Arno=!0,e.Aster=!0,e.Aurora=!0,e.Baskerville=!0,e.Bell=!0,e.Bembo=!0,e["Bembo Schoolbook"]=!0,e.Benguiat=!0,e["Berkeley Old Style"]=!0,e["Bernhard Modern"]=!0,e["Berthold City"]=!0,e.Bodoni=!0,e["Bauer Bodoni"]=!0,e["Book Antiqua"]=!0,e.Bookman=!0,e["Bordeaux Roman"]=!0,e["Californian FB"]=!0,e.Calisto=!0,e.Calvert=!0,e.Capitals=!0,e.Cambria=!0,e.Cartier=!0,e.Caslon=!0,e.Catull=!0,e.Centaur=!0,e["Century Old Style"]=!0,e["Century Schoolbook"]=!0,e.Chaparral=!0,e["Charis SIL"]=!0,e.Cheltenham=!0,e["Cholla Slab"]=!0,e.Clarendon=!0,e.Clearface=!0,e.Cochin=!0,e.Colonna=!0,e["Computer Modern"]=!0,e["Concrete Roman"]=!0,e.Constantia=!0,e["Cooper Black"]=!0,e.Corona=!0,e.Ecotype=!0,e.Egyptienne=!0,e.Elephant=!0,e.Excelsior=!0,e.Fairfield=!0,e["FF Scala"]=!0,e.Folkard=!0,e.Footlight=!0,e.FreeSerif=!0,e["Friz Quadrata"]=!0,e.Garamond=!0,e.Gentium=!0,e.Georgia=!0,e.Gloucester=!0,e["Goudy Old Style"]=!0,e["Goudy Schoolbook"]=!0,e["Goudy Pro Font"]=!0,e.Granjon=!0,e["Guardian Egyptian"]=!0,e.Heather=!0,e.Hercules=!0,e["High Tower Text"]=!0,e.Hiroshige=!0,e["Hoefler Text"]=!0,e["Humana Serif"]=!0,e.Imprint=!0,e["Ionic No. 5"]=!0,e.Janson=!0,e.Joanna=!0,e.Korinna=!0,e.Lexicon=!0,e.LiberationSerif=!0,e["Liberation Serif"]=!0,e["Linux Libertine"]=!0,e.Literaturnaya=!0,e.Lucida=!0,e["Lucida Bright"]=!0,e.Melior=!0,e.Memphis=!0,e.Miller=!0,e.Minion=!0,e.Modern=!0,e["Mona Lisa"]=!0,e["Mrs Eaves"]=!0,e["MS Serif"]=!0,e["Museo Slab"]=!0,e["New York"]=!0,e["Nimbus Roman"]=!0,e["NPS Rawlinson Roadway"]=!0,e.NuptialScript=!0,e.Palatino=!0,e.Perpetua=!0,e.Plantin=!0,e["Plantin Schoolbook"]=!0,e.Playbill=!0,e["Poor Richard"]=!0,e["Rawlinson Roadway"]=!0,e.Renault=!0,e.Requiem=!0,e.Rockwell=!0,e.Roman=!0,e["Rotis Serif"]=!0,e.Sabon=!0,e.Scala=!0,e.Seagull=!0,e.Sistina=!0,e.Souvenir=!0,e.STIX=!0,e["Stone Informal"]=!0,e["Stone Serif"]=!0,e.Sylfaen=!0,e.Times=!0,e.Trajan=!0,e["Trinité"]=!0,e["Trump Mediaeval"]=!0,e.Utopia=!0,e["Vale Type"]=!0,e["Bitstream Vera"]=!0,e["Vera Serif"]=!0,e.Versailles=!0,e.Wanted=!0,e.Weiss=!0,e["Wide Latin"]=!0,e.Windsor=!0,e.XITS=!0}),Xn=getLookupTableFactory(function(e){e.Dingbats=!0,e.Symbol=!0,e.ZapfDingbats=!0,e.Wingdings=!0,e["Wingdings-Bold"]=!0,e["Wingdings-Regular"]=!0}),qn=getLookupTableFactory(function(e){e[2]=10,e[3]=32,e[4]=33,e[5]=34,e[6]=35,e[7]=36,e[8]=37,e[9]=38,e[10]=39,e[11]=40,e[12]=41,e[13]=42,e[14]=43,e[15]=44,e[16]=45,e[17]=46,e[18]=47,e[19]=48,e[20]=49,e[21]=50,e[22]=51,e[23]=52,e[24]=53,e[25]=54,e[26]=55,e[27]=56,e[28]=57,e[29]=58,e[30]=894,e[31]=60,e[32]=61,e[33]=62,e[34]=63,e[35]=64,e[36]=65,e[37]=66,e[38]=67,e[39]=68,e[40]=69,e[41]=70,e[42]=71,e[43]=72,e[44]=73,e[45]=74,e[46]=75,e[47]=76,e[48]=77,e[49]=78,e[50]=79,e[51]=80,e[52]=81,e[53]=82,e[54]=83,e[55]=84,e[56]=85,e[57]=86,e[58]=87,e[59]=88,e[60]=89,e[61]=90,e[62]=91,e[63]=92,e[64]=93,e[65]=94,e[66]=95,e[67]=96,e[68]=97,e[69]=98,e[70]=99,e[71]=100,e[72]=101,e[73]=102,e[74]=103,e[75]=104,e[76]=105,e[77]=106,e[78]=107,e[79]=108,e[80]=109,e[81]=110,e[82]=111,e[83]=112,e[84]=113,e[85]=114,e[86]=115,e[87]=116,e[88]=117,e[89]=118,e[90]=119,e[91]=120,e[92]=121,e[93]=122,e[94]=123,e[95]=124,e[96]=125,e[97]=126,e[98]=196,e[99]=197,e[100]=199,e[101]=201,e[102]=209,e[103]=214,e[104]=220,e[105]=225,e[106]=224,e[107]=226,e[108]=228,e[109]=227,e[110]=229,e[111]=231,e[112]=233,e[113]=232,e[114]=234,e[115]=235,e[116]=237,e[117]=236,e[118]=238,e[119]=239,e[120]=241,e[121]=243,e[122]=242,e[123]=244,e[124]=246,e[125]=245,e[126]=250,e[127]=249,e[128]=251,e[129]=252,e[130]=8224,e[131]=176,e[132]=162,e[133]=163,e[134]=167,e[135]=8226,e[136]=182,e[137]=223,e[138]=174,e[139]=169,e[140]=8482,e[141]=180,e[142]=168,e[143]=8800,e[144]=198,e[145]=216,e[146]=8734,e[147]=177,e[148]=8804,e[149]=8805,e[150]=165,e[151]=181,e[152]=8706,e[153]=8721,e[154]=8719,e[156]=8747,e[157]=170,e[158]=186,e[159]=8486,e[160]=230,e[161]=248,e[162]=191,e[163]=161,e[164]=172,e[165]=8730,e[166]=402,e[167]=8776,e[168]=8710,e[169]=171,e[170]=187,e[171]=8230,e[179]=8220,e[180]=8221,e[181]=8216,e[182]=8217,e[200]=193,e[203]=205,e[207]=211,e[210]=218,e[223]=711,e[224]=321,e[225]=322,e[226]=352,e[227]=353,e[228]=381,e[229]=382,e[233]=221,e[234]=253,e[252]=263,e[253]=268,e[254]=269,e[258]=258,e[260]=260,e[261]=261,e[265]=280,e[266]=281,e[267]=282,e[268]=283,e[269]=313,e[275]=323,e[276]=324,e[278]=328,e[283]=344,e[284]=345,e[285]=346,e[286]=347,e[292]=367,e[295]=377,e[296]=378,e[298]=380,e[305]=963,e[306]=964,e[307]=966,e[308]=8215,e[309]=8252,e[310]=8319,e[311]=8359,e[312]=8592,e[313]=8593,e[337]=9552,e[493]=1039,e[494]=1040,e[570]=1040,e[571]=1041,e[572]=1042,e[573]=1043,e[574]=1044,e[575]=1045,e[576]=1046,e[577]=1047,e[578]=1048,e[579]=1049,e[580]=1050,e[581]=1051,e[582]=1052,e[583]=1053,e[584]=1054,e[585]=1055,e[586]=1056,e[587]=1057,e[588]=1058,e[589]=1059,e[590]=1060,e[591]=1061,e[592]=1062,e[593]=1063,e[594]=1064,e[595]=1065,e[596]=1066,e[597]=1067,e[598]=1068,e[599]=1069,e[600]=1070,e[672]=1488,e[673]=1489,e[674]=1490,e[675]=1491,e[676]=1492,e[677]=1493,e[678]=1494,e[679]=1495,e[680]=1496,e[681]=1497,e[682]=1498,e[683]=1499,e[684]=1500,e[685]=1501,e[686]=1502,e[687]=1503,e[688]=1504,e[689]=1505,e[690]=1506,e[691]=1507,e[692]=1508,e[693]=1509,e[694]=1510,e[695]=1511,e[696]=1512,e[697]=1513,e[698]=1514,e[705]=1524,e[706]=8362,e[710]=64288,e[711]=64298,e[759]=1617,e[761]=1776,e[763]=1778,e[775]=1652,e[777]=1764,e[778]=1780,e[779]=1781,e[780]=1782,e[782]=771,e[783]=64726,e[786]=8363,e[788]=8532,e[790]=768,e[791]=769,e[792]=768,e[795]=803,e[797]=64336,e[798]=64337,e[799]=64342,e[800]=64343,e[801]=64344,e[802]=64345,e[803]=64362,e[804]=64363,e[805]=64364,e[2424]=7821,e[2425]=7822,e[2426]=7823,e[2427]=7824,e[2428]=7825,e[2429]=7826,e[2430]=7827,e[2433]=7682,e[2678]=8045,e[2679]=8046,e[2830]=1552,e[2838]=686,e[2840]=751,e[2842]=753,e[2843]=754,e[2844]=755,e[2846]=757,e[2856]=767,e[2857]=848,e[2858]=849,e[2862]=853,e[2863]=854,e[2864]=855,e[2865]=861,e[2866]=862,e[2906]=7460,e[2908]=7462,e[2909]=7463,e[2910]=7464,e[2912]=7466,e[2913]=7467,e[2914]=7468,e[2916]=7470,e[2917]=7471,e[2918]=7472,e[2920]=7474,e[2921]=7475,e[2922]=7476,e[2924]=7478,e[2925]=7479,e[2926]=7480,e[2928]=7482,e[2929]=7483,e[2930]=7484,e[2932]=7486,e[2933]=7487,e[2934]=7488,e[2936]=7490,e[2937]=7491,e[2938]=7492,e[2940]=7494,e[2941]=7495,e[2942]=7496,e[2944]=7498,e[2946]=7500,e[2948]=7502,e[2950]=7504,e[2951]=7505,e[2952]=7506,e[2954]=7508,e[2955]=7509,e[2956]=7510,e[2958]=7512,e[2959]=7513,e[2960]=7514,e[2962]=7516,e[2963]=7517,e[2964]=7518,e[2966]=7520,e[2967]=7521,e[2968]=7522,e[2970]=7524,e[2971]=7525,e[2972]=7526,e[2974]=7528,e[2975]=7529,e[2976]=7530,e[2978]=1537,e[2979]=1538,e[2980]=1539,e[2982]=1549,e[2983]=1551,e[2984]=1552,e[2986]=1554,e[2987]=1555,e[2988]=1556,e[2990]=1623,e[2991]=1624,e[2995]=1775,e[2999]=1791,e[3002]=64290,e[3003]=64291,e[3004]=64292,e[3006]=64294,e[3007]=64295,e[3008]=64296,e[3011]=1900,e[3014]=8223,e[3015]=8244,e[3017]=7532,e[3018]=7533,e[3019]=7534,e[3075]=7590,e[3076]=7591,e[3079]=7594,e[3080]=7595,e[3083]=7598,e[3084]=7599,e[3087]=7602,e[3088]=7603,e[3091]=7606,e[3092]=7607,e[3095]=7610,e[3096]=7611,e[3099]=7614,e[3100]=7615,e[3103]=7618,e[3104]=7619,e[3107]=8337,e[3108]=8338,e[3116]=1884,e[3119]=1885,e[3120]=1885,e[3123]=1886,e[3124]=1886,e[3127]=1887,e[3128]=1887,e[3131]=1888,e[3132]=1888,e[3135]=1889,e[3136]=1889,e[3139]=1890,e[3140]=1890,e[3143]=1891,e[3144]=1891,e[3147]=1892,e[3148]=1892,e[3153]=580,e[3154]=581,e[3157]=584,e[3158]=585,e[3161]=588,e[3162]=589,e[3165]=891,e[3166]=892,e[3169]=1274,e[3170]=1275,e[3173]=1278,e[3174]=1279,e[3181]=7622,e[3182]=7623,e[3282]=11799,e[3316]=578,e[3379]=42785,e[3393]=1159,e[3416]=8377}),zn=getLookupTableFactory(function(e){e[227]=322,e[264]=261,e[291]=346}),Wn=getLookupTableFactory(function(e){e[1]=32,e[4]=65,e[5]=192,e[6]=193,e[9]=196,e[17]=66,e[18]=67,e[21]=268,e[24]=68,e[28]=69,e[29]=200,e[30]=201,e[32]=282,e[38]=70,e[39]=71,e[44]=72,e[47]=73,e[48]=204,e[49]=205,e[58]=74,e[60]=75,e[62]=76,e[68]=77,e[69]=78,e[75]=79,e[76]=210,e[80]=214,e[87]=80,e[89]=81,e[90]=82,e[92]=344,e[94]=83,e[97]=352,e[100]=84,e[104]=85,e[109]=220,e[115]=86,e[116]=87,e[121]=88,e[122]=89,e[124]=221,e[127]=90,e[129]=381,e[258]=97,e[259]=224,e[260]=225,e[263]=228,e[268]=261,e[271]=98,e[272]=99,e[273]=263,e[275]=269,e[282]=100,e[286]=101,e[287]=232,e[288]=233,e[290]=283,e[295]=281,e[296]=102,e[336]=103,e[346]=104,e[349]=105,e[350]=236,e[351]=237,e[361]=106,e[364]=107,e[367]=108,e[371]=322,e[373]=109,e[374]=110,e[381]=111,e[382]=242,e[383]=243,e[386]=246,e[393]=112,e[395]=113,e[396]=114,e[398]=345,e[400]=115,e[401]=347,e[403]=353,e[410]=116,e[437]=117,e[442]=252,e[448]=118,e[449]=119,e[454]=120,e[455]=121,e[457]=253,e[460]=122,e[462]=382,e[463]=380,e[853]=44,e[855]=58,e[856]=46,e[876]=47,e[878]=45,e[882]=45,e[894]=40,e[895]=41,e[896]=91,e[897]=93,e[923]=64,e[940]=163,e[1004]=48,e[1005]=49,e[1006]=50,e[1007]=51,e[1008]=52,e[1009]=53,e[1010]=54,e[1011]=55,e[1012]=56,e[1013]=57,e[1081]=37,e[1085]=43,e[1086]=45});function getStandardFontName(e){const t=normalizeFontName(e);return Un()[t]}function isKnownFontName(e){const t=normalizeFontName(e);return!!(Un()[t]||$n()[t]||Hn()[t]||Xn()[t])}class ToUnicodeMap{constructor(e=[]){this._map=e}get length(){return this._map.length}forEach(e){for(const t in this._map)e(t,this._map[t].codePointAt(0))}has(e){return void 0!==this._map[e]}get(e){return this._map[e]}charCodeOf(e){const t=this._map;if(t.length<=65536)return t.indexOf(e);for(const i in t)if(t[i]===e)return 0|i;return-1}amend(e){for(const t in e)this._map[t]=e[t]}}class IdentityToUnicodeMap{constructor(e,t){this.firstChar=e,this.lastChar=t}get length(){return this.lastChar+1-this.firstChar}forEach(e){for(let t=this.firstChar,i=this.lastChar;t<=i;t++)e(t,t)}has(e){return this.firstChar<=e&&e<=this.lastChar}get(e){if(this.firstChar<=e&&e<=this.lastChar)return String.fromCharCode(e)}charCodeOf(e){return Number.isInteger(e)&&e>=this.firstChar&&e<=this.lastChar?e:-1}amend(e){unreachable$1("Should not call amend()")}}class CFFFont{constructor(e,t){this.properties=t;const i=new CFFParser(e,t,Sn);this.cff=i.parse(),this.cff.duplicateFirstGlyph();const n=new CFFCompiler(this.cff);this.seacs=this.cff.seacs;try{this.data=n.compile()}catch{warn$1("Failed to compile font "+t.loadedName),this.data=e}this._createBuiltInEncoding()}get numGlyphs(){return this.cff.charStrings.count}getCharset(){return this.cff.charset.charset}getGlyphMapping(){const e=this.cff,t=this.properties,{cidToGidMap:i,cMap:n}=t,a=e.charset.charset;let s,r;if(t.composite){let t,o;if(i?.length>0){t=Object.create(null);for(let e=0,n=i.length;e<n;e++){const n=i[e];void 0!==n&&(t[n]=e)}}if(s=Object.create(null),e.isCIDFont)for(r=0;r<a.length;r++){const e=a[r];o=n.charCodeOf(e),void 0!==t?.[o]&&(o=t[o]),s[o]=r}else for(r=0;r<e.charStrings.count;r++)o=n.charCodeOf(r),s[o]=r;return s}let o=e.encoding?e.encoding.encoding:null;return t.isInternalFont&&(o=t.defaultEncoding),s=type1FontGlyphMapping(t,o,a),s}hasGlyphId(e){return this.cff.hasGlyphId(e)}_createBuiltInEncoding(){const{charset:e,encoding:t}=this.cff;if(!e||!t)return;const i=e.charset,n=t.encoding,a=[];for(const e in n){const t=n[e];if(t>=0){const n=i[t];n&&(a[e]=n)}}a.length>0&&(this.properties.builtInEncoding=a)}}function getFloat214(e,t){return readInt16(e,t)/16384}function getSubroutineBias(e){const t=e.length;let i=32768;return t<1240?i=107:t<33900&&(i=1131),i}function parseCmap(e,t,i){const n=1===readUint16(e,t+2)?readUint32(e,t+8):readUint32(e,t+16),a=readUint16(e,t+n);let s,r,o;if(4===a){readUint16(e,t+n+2);const i=readUint16(e,t+n+6)>>1;for(r=t+n+14,s=[],o=0;o<i;o++,r+=2)s[o]={end:readUint16(e,r)};for(r+=2,o=0;o<i;o++,r+=2)s[o].start=readUint16(e,r);for(o=0;o<i;o++,r+=2)s[o].idDelta=readUint16(e,r);for(o=0;o<i;o++,r+=2){let t=readUint16(e,r);if(0!==t){s[o].ids=[];for(let i=0,n=s[o].end-s[o].start+1;i<n;i++)s[o].ids[i]=readUint16(e,r+t),t+=2}}return s}if(12===a){const i=readUint32(e,t+n+12);for(r=t+n+16,s=[],o=0;o<i;o++)t=readUint32(e,r),s.push({start:t,end:readUint32(e,r+4),idDelta:readUint32(e,r+8)-t}),r+=12;return s}throw new ti(`unsupported cmap: ${a}`)}function parseCff(e,t,i,n){const a=new CFFParser(new Stream(e,t,i-t),{},n).parse();return{glyphs:a.charStrings.objects,subrs:a.topDict.privateDict?.subrsIndex?.objects,gsubrs:a.globalSubrIndex?.objects,isCFFCIDFont:a.isCIDFont,fdSelect:a.fdSelect,fdArray:a.fdArray}}function lookupCmap(e,t){const i=t.codePointAt(0);let n=0,a=0,s=e.length-1;for(;a<s;){const t=a+s+1>>1;i<e[t].start?s=t-1:a=t}return e[a].start<=i&&i<=e[a].end&&(n=e[a].idDelta+(e[a].ids?e[a].ids[i-e[a].start]:i)&65535),{charCode:i,glyphId:n}}function compileGlyf(e,t,i){function moveTo(e,i){r&&t.add("L",r),r=[e,i],t.add("M",[e,i])}function lineTo(e,i){t.add("L",[e,i])}function quadraticCurveTo(e,i,n,a){t.add("Q",[e,i,n,a])}let n=0;const a=readInt16(e,n);let s,r=null,o=0,l=0;if(n+=10,a<0)do{s=readUint16(e,n);const a=readUint16(e,n+2);let r,c;n+=4,1&s?(2&s?(r=readInt16(e,n),c=readInt16(e,n+2)):(r=readUint16(e,n),c=readUint16(e,n+2)),n+=4):2&s?(r=readInt8(e,n++),c=readInt8(e,n++)):(r=e[n++],c=e[n++]),2&s?(o=r,l=c):(o=0,l=0);let h=1,d=1,u=0,g=0;8&s?(h=d=getFloat214(e,n),n+=2):64&s?(h=getFloat214(e,n),d=getFloat214(e,n+2),n+=4):128&s&&(h=getFloat214(e,n),u=getFloat214(e,n+2),g=getFloat214(e,n+4),d=getFloat214(e,n+6),n+=8);const f=i.glyphs[a];f&&(t.save(),t.transform([h,u,g,d,o,l]),compileGlyf(f,t,i),t.restore())}while(32&s);else{const t=[];let i,r;for(i=0;i<a;i++)t.push(readUint16(e,n)),n+=2;n+=2+readUint16(e,n);const c=t.at(-1)+1,h=[];for(;h.length<c;){s=e[n++];let t=1;for(8&s&&(t+=e[n++]);t-- >0;)h.push({flags:s})}for(i=0;i<c;i++){switch(18&h[i].flags){case 0:o+=readInt16(e,n),n+=2;break;case 2:o-=e[n++];break;case 18:o+=e[n++]}h[i].x=o}for(i=0;i<c;i++){switch(36&h[i].flags){case 0:l+=readInt16(e,n),n+=2;break;case 4:l-=e[n++];break;case 36:l+=e[n++]}h[i].y=l}let d=0;for(n=0;n<a;n++){const e=t[n],a=h.slice(d,e+1);if(1&a[0].flags)a.push(a[0]);else if(1&a.at(-1).flags)a.unshift(a.at(-1));else{const e={flags:1,x:(a[0].x+a.at(-1).x)/2,y:(a[0].y+a.at(-1).y)/2};a.unshift(e),a.push(e)}for(moveTo(a[0].x,a[0].y),i=1,r=a.length;i<r;i++)1&a[i].flags?lineTo(a[i].x,a[i].y):1&a[i+1].flags?(quadraticCurveTo(a[i].x,a[i].y,a[i+1].x,a[i+1].y),i++):quadraticCurveTo(a[i].x,a[i].y,(a[i].x+a[i+1].x)/2,(a[i].y+a[i+1].y)/2);d=e+1}}}function compileCharString(e,t,i,n){function moveTo(e,i){l&&t.add("L",l),l=[e,i],t.add("M",[e,i])}function lineTo(e,i){t.add("L",[e,i])}function bezierCurveTo(e,i,n,a,s,r){t.add("C",[e,i,n,a,s,r])}const a=[];let s=0,r=0,o=0,l=null;!function parse(e){let l=0;for(;l<e.length;){let c,h,d,u,g,f,p,m,b,y=!1,w=e[l++];switch(w){case 1:case 3:case 18:case 23:o+=a.length>>1,y=!0;break;case 4:r+=a.pop(),moveTo(s,r),y=!0;break;case 5:for(;a.length>0;)s+=a.shift(),r+=a.shift(),lineTo(s,r);break;case 6:for(;a.length>0&&(s+=a.shift(),lineTo(s,r),0!==a.length);)r+=a.shift(),lineTo(s,r);break;case 7:for(;a.length>0&&(r+=a.shift(),lineTo(s,r),0!==a.length);)s+=a.shift(),lineTo(s,r);break;case 8:for(;a.length>0;)c=s+a.shift(),d=r+a.shift(),h=c+a.shift(),u=d+a.shift(),s=h+a.shift(),r=u+a.shift(),bezierCurveTo(c,d,h,u,s,r);break;case 10:if(m=a.pop(),b=null,i.isCFFCIDFont){const e=i.fdSelect.getFDIndex(n);if(e>=0&&e<i.fdArray.length){const t=i.fdArray[e];let n;t.privateDict?.subrsIndex&&(n=t.privateDict.subrsIndex.objects),n&&(m+=getSubroutineBias(n),b=n[m])}else warn$1("Invalid fd index for glyph index.")}else b=i.subrs[m+i.subrsBias];b&&parse(b);break;case 11:return;case 12:switch(w=e[l++],w){case 34:c=s+a.shift(),h=c+a.shift(),g=r+a.shift(),s=h+a.shift(),bezierCurveTo(c,r,h,g,s,g),c=s+a.shift(),h=c+a.shift(),s=h+a.shift(),bezierCurveTo(c,g,h,r,s,r);break;case 35:c=s+a.shift(),d=r+a.shift(),h=c+a.shift(),u=d+a.shift(),s=h+a.shift(),r=u+a.shift(),bezierCurveTo(c,d,h,u,s,r),c=s+a.shift(),d=r+a.shift(),h=c+a.shift(),u=d+a.shift(),s=h+a.shift(),r=u+a.shift(),bezierCurveTo(c,d,h,u,s,r),a.pop();break;case 36:c=s+a.shift(),g=r+a.shift(),h=c+a.shift(),f=g+a.shift(),s=h+a.shift(),bezierCurveTo(c,g,h,f,s,f),c=s+a.shift(),h=c+a.shift(),p=f+a.shift(),s=h+a.shift(),bezierCurveTo(c,f,h,p,s,r);break;case 37:const e=s,t=r;c=s+a.shift(),d=r+a.shift(),h=c+a.shift(),u=d+a.shift(),s=h+a.shift(),r=u+a.shift(),bezierCurveTo(c,d,h,u,s,r),c=s+a.shift(),d=r+a.shift(),h=c+a.shift(),u=d+a.shift(),s=h,r=u,Math.abs(s-e)>Math.abs(r-t)?s+=a.shift():r+=a.shift(),bezierCurveTo(c,d,h,u,s,r);break;default:throw new ti(`unknown operator: 12 ${w}`)}break;case 14:if(a.length>=4){const e=a.pop(),n=a.pop();r=a.pop(),s=a.pop(),t.save(),t.translate(s,r);let o=lookupCmap(i.cmap,String.fromCharCode(i.glyphNameMap[un[e]]));compileCharString(i.glyphs[o.glyphId],t,i,o.glyphId),t.restore(),o=lookupCmap(i.cmap,String.fromCharCode(i.glyphNameMap[un[n]])),compileCharString(i.glyphs[o.glyphId],t,i,o.glyphId)}return;case 19:case 20:o+=a.length>>1,l+=o+7>>3,y=!0;break;case 21:r+=a.pop(),s+=a.pop(),moveTo(s,r),y=!0;break;case 22:s+=a.pop(),moveTo(s,r),y=!0;break;case 24:for(;a.length>2;)c=s+a.shift(),d=r+a.shift(),h=c+a.shift(),u=d+a.shift(),s=h+a.shift(),r=u+a.shift(),bezierCurveTo(c,d,h,u,s,r);s+=a.shift(),r+=a.shift(),lineTo(s,r);break;case 25:for(;a.length>6;)s+=a.shift(),r+=a.shift(),lineTo(s,r);c=s+a.shift(),d=r+a.shift(),h=c+a.shift(),u=d+a.shift(),s=h+a.shift(),r=u+a.shift(),bezierCurveTo(c,d,h,u,s,r);break;case 26:for(a.length%2&&(s+=a.shift());a.length>0;)c=s,d=r+a.shift(),h=c+a.shift(),u=d+a.shift(),s=h,r=u+a.shift(),bezierCurveTo(c,d,h,u,s,r);break;case 27:for(a.length%2&&(r+=a.shift());a.length>0;)c=s+a.shift(),d=r,h=c+a.shift(),u=d+a.shift(),s=h+a.shift(),r=u,bezierCurveTo(c,d,h,u,s,r);break;case 28:a.push(readInt16(e,l)),l+=2;break;case 29:m=a.pop()+i.gsubrsBias,b=i.gsubrs[m],b&&parse(b);break;case 30:for(;a.length>0&&(c=s,d=r+a.shift(),h=c+a.shift(),u=d+a.shift(),s=h+a.shift(),r=u+(1===a.length?a.shift():0),bezierCurveTo(c,d,h,u,s,r),0!==a.length);)c=s+a.shift(),d=r,h=c+a.shift(),u=d+a.shift(),r=u+a.shift(),s=h+(1===a.length?a.shift():0),bezierCurveTo(c,d,h,u,s,r);break;case 31:for(;a.length>0&&(c=s+a.shift(),d=r,h=c+a.shift(),u=d+a.shift(),r=u+a.shift(),s=h+(1===a.length?a.shift():0),bezierCurveTo(c,d,h,u,s,r),0!==a.length);)c=s,d=r+a.shift(),h=c+a.shift(),u=d+a.shift(),s=h+a.shift(),r=u+(1===a.length?a.shift():0),bezierCurveTo(c,d,h,u,s,r);break;default:if(w<32)throw new ti(`unknown operator: ${w}`);w<247?a.push(w-139):w<251?a.push(256*(w-247)+e[l++]+108):w<255?a.push(256*-(w-251)-e[l++]-108):(a.push((e[l]<<24|e[l+1]<<16|e[l+2]<<8|e[l+3])/65536),l+=4)}y&&(a.length=0)}}(e)}class Commands{cmds=[];transformStack=[];currentTransform=[1,0,0,1,0,0];add(e,t){if(t){const{currentTransform:i}=this;for(let e=0,n=t.length;e<n;e+=2)ai.applyTransform(t,i,e);this.cmds.push(`${e}${t.join(" ")}`)}else this.cmds.push(e)}transform(e){this.currentTransform=ai.transform(this.currentTransform,e)}translate(e,t){this.transform([1,0,0,1,e,t])}save(){this.transformStack.push(this.currentTransform.slice())}restore(){this.currentTransform=this.transformStack.pop()||[1,0,0,1,0,0]}getSVG(){return this.cmds.join("")}}class CompiledFont{constructor(e){this.fontMatrix=e,this.compiledGlyphs=Object.create(null),this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(e){const{charCode:t,glyphId:i}=lookupCmap(this.cmap,e);let n,a=this.compiledGlyphs[i];if(void 0===a){try{a=this.compileGlyph(this.glyphs[i],i)}catch(e){a="",n=e}this.compiledGlyphs[i]=a}if(this.compiledCharCodeToGlyphId[t]??=i,n)throw n;return a}compileGlyph(e,i){if(!e?.length||14===e[0])return"";let n=this.fontMatrix;if(this.isCFFCIDFont){const e=this.fdSelect.getFDIndex(i);if(e>=0&&e<this.fdArray.length){n=this.fdArray[e].getByName("FontMatrix")||t}else warn$1("Invalid fd index for glyph index.")}assert$1(isNumberArray(n,6),"Expected a valid fontMatrix.");const a=new Commands;return a.transform(n.slice()),this.compileGlyphImpl(e,a,i),a.add("Z"),a.getSVG()}compileGlyphImpl(){unreachable$1("Children classes should implement this.")}hasBuiltPath(e){const{charCode:t,glyphId:i}=lookupCmap(this.cmap,e);return void 0!==this.compiledGlyphs[i]&&void 0!==this.compiledCharCodeToGlyphId[t]}}class TrueTypeCompiled extends CompiledFont{constructor(e,t,i){super(i||[488e-6,0,0,488e-6,0,0]),this.glyphs=e,this.cmap=t}compileGlyphImpl(e,t){compileGlyf(e,t,this)}}class Type2Compiled extends CompiledFont{constructor(e,t,i){super(i||[.001,0,0,.001,0,0]),this.glyphs=e.glyphs,this.gsubrs=e.gsubrs||[],this.subrs=e.subrs||[],this.cmap=t,this.glyphNameMap=mn(),this.gsubrsBias=getSubroutineBias(this.gsubrs),this.subrsBias=getSubroutineBias(this.subrs),this.isCFFCIDFont=e.isCFFCIDFont,this.fdSelect=e.fdSelect,this.fdArray=e.fdArray}compileGlyphImpl(e,t,i){compileCharString(e,t,this,i)}}class FontRendererFactory{static create(e,t){const i=new Uint8Array(e.data);let n,a,s,r,o,l;const c=readUint16(i,4);for(let e=0,h=12;e<c;e++,h+=16){const e=bytesToString$1(i.subarray(h,h+4)),c=readUint32(i,h+8),d=readUint32(i,h+12);switch(e){case"cmap":n=parseCmap(i,c);break;case"glyf":a=i.subarray(c,c+d);break;case"loca":s=i.subarray(c,c+d);break;case"head":l=readUint16(i,c+18),o=readUint16(i,c+50);break;case"CFF ":r=parseCff(i,c,c+d,t)}}if(a){const t=l?[1/l,0,0,1/l,0,0]:e.fontMatrix;return new TrueTypeCompiled(function(e,t,i){let n,a;i?(n=4,a=readUint32):(n=2,a=(e,t)=>2*readUint16(e,t));const s=[];let r=a(t,0);for(let i=n;i<t.length;i+=n){const n=a(t,i);s.push(e.subarray(r,n)),r=n}return s}(a,s,o),n,t)}return new Type2Compiled(r,n,e.fontMatrix)}}const Gn=getLookupTableFactory(function(e){e.Courier=600,e["Courier-Bold"]=600,e["Courier-BoldOblique"]=600,e["Courier-Oblique"]=600,e.Helvetica=getLookupTableFactory(function(e){e.space=278,e.exclam=278,e.quotedbl=355,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=667,e.quoteright=222,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=278,e.semicolon=278,e.less=584,e.equal=584,e.greater=584,e.question=556,e.at=1015,e.A=667,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=500,e.K=667,e.L=556,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=278,e.backslash=278,e.bracketright=278,e.asciicircum=469,e.underscore=556,e.quoteleft=222,e.a=556,e.b=556,e.c=500,e.d=556,e.e=556,e.f=278,e.g=556,e.h=556,e.i=222,e.j=222,e.k=500,e.l=222,e.m=833,e.n=556,e.o=556,e.p=556,e.q=556,e.r=333,e.s=500,e.t=278,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=500,e.braceleft=334,e.bar=260,e.braceright=334,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=191,e.quotedblleft=333,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=537,e.bullet=350,e.quotesinglbase=222,e.quotedblbase=333,e.quotedblright=333,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=556,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=222,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=556,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=667,e.aacute=556,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=500,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=500,e.aring=556,e.Ncommaaccent=722,e.lacute=222,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=500,e.scedilla=500,e.iacute=278,e.lozenge=471,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=556,e.Amacron=667,e.rcaron=333,e.ccedilla=500,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=643,e.Umacron=722,e.uring=556,e.threesuperior=333,e.Ograve=778,e.Agrave=667,e.Abreve=667,e.multiply=584,e.uacute=556,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=500,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=260,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=333,e.omacron=556,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=222,e.tcaron=317,e.eogonek=556,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=556,e.zacute=500,e.iogonek=222,e.Oacute=778,e.oacute=556,e.amacron=556,e.sacute=500,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=333,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=556,e.Eogonek=667,e.dcroat=556,e.threequarters=834,e.Scedilla=667,e.lcaron=299,e.Kcommaaccent=667,e.Lacute=556,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=556,e.onehalf=834,e.lessequal=549,e.ocircumflex=556,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=556,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=556,e.Ccaron=722,e.ugrave=556,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=556,e.Rcommaaccent=722,e.Lcommaaccent=556,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=500,e.minus=584,e.Icircumflex=278,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=584,e.odieresis=556,e.udieresis=556,e.notequal=549,e.gcommaaccent=556,e.eth=556,e.zcaron=500,e.ncommaaccent=556,e.onesuperior=333,e.imacron=278,e.Euro=556}),e["Helvetica-Bold"]=getLookupTableFactory(function(e){e.space=278,e.exclam=333,e.quotedbl=474,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=722,e.quoteright=278,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=333,e.semicolon=333,e.less=584,e.equal=584,e.greater=584,e.question=611,e.at=975,e.A=722,e.B=722,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=556,e.K=722,e.L=611,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=584,e.underscore=556,e.quoteleft=278,e.a=556,e.b=611,e.c=556,e.d=611,e.e=556,e.f=333,e.g=611,e.h=611,e.i=278,e.j=278,e.k=556,e.l=278,e.m=889,e.n=611,e.o=611,e.p=611,e.q=611,e.r=389,e.s=556,e.t=333,e.u=611,e.v=556,e.w=778,e.x=556,e.y=556,e.z=500,e.braceleft=389,e.bar=280,e.braceright=389,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=238,e.quotedblleft=500,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=611,e.fl=611,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=556,e.bullet=350,e.quotesinglbase=278,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=611,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=278,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=611,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=722,e.aacute=556,e.Ucircumflex=722,e.yacute=556,e.scommaaccent=556,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=611,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=556,e.aring=556,e.Ncommaaccent=722,e.lacute=278,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=556,e.scedilla=556,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=611,e.acircumflex=556,e.Amacron=722,e.rcaron=389,e.ccedilla=556,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=743,e.Umacron=722,e.uring=611,e.threesuperior=333,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=584,e.uacute=611,e.Tcaron=611,e.partialdiff=494,e.ydieresis=556,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=556,e.nacute=611,e.umacron=611,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=280,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=611,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=389,e.eogonek=556,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=556,e.zacute=500,e.iogonek=278,e.Oacute=778,e.oacute=611,e.amacron=556,e.sacute=556,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=611,e.twosuperior=333,e.Odieresis=778,e.mu=611,e.igrave=278,e.ohungarumlaut=611,e.Eogonek=667,e.dcroat=611,e.threequarters=834,e.Scedilla=667,e.lcaron=400,e.Kcommaaccent=722,e.Lacute=611,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=611,e.onehalf=834,e.lessequal=549,e.ocircumflex=611,e.ntilde=611,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=611,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=611,e.Ccaron=722,e.ugrave=611,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=611,e.Rcommaaccent=722,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=556,e.minus=584,e.Icircumflex=278,e.ncaron=611,e.tcommaaccent=333,e.logicalnot=584,e.odieresis=611,e.udieresis=611,e.notequal=549,e.gcommaaccent=611,e.eth=611,e.zcaron=500,e.ncommaaccent=611,e.onesuperior=333,e.imacron=278,e.Euro=556}),e["Helvetica-BoldOblique"]=getLookupTableFactory(function(e){e.space=278,e.exclam=333,e.quotedbl=474,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=722,e.quoteright=278,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=333,e.semicolon=333,e.less=584,e.equal=584,e.greater=584,e.question=611,e.at=975,e.A=722,e.B=722,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=556,e.K=722,e.L=611,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=584,e.underscore=556,e.quoteleft=278,e.a=556,e.b=611,e.c=556,e.d=611,e.e=556,e.f=333,e.g=611,e.h=611,e.i=278,e.j=278,e.k=556,e.l=278,e.m=889,e.n=611,e.o=611,e.p=611,e.q=611,e.r=389,e.s=556,e.t=333,e.u=611,e.v=556,e.w=778,e.x=556,e.y=556,e.z=500,e.braceleft=389,e.bar=280,e.braceright=389,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=238,e.quotedblleft=500,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=611,e.fl=611,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=556,e.bullet=350,e.quotesinglbase=278,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=611,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=278,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=611,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=722,e.aacute=556,e.Ucircumflex=722,e.yacute=556,e.scommaaccent=556,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=611,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=556,e.aring=556,e.Ncommaaccent=722,e.lacute=278,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=556,e.scedilla=556,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=611,e.acircumflex=556,e.Amacron=722,e.rcaron=389,e.ccedilla=556,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=743,e.Umacron=722,e.uring=611,e.threesuperior=333,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=584,e.uacute=611,e.Tcaron=611,e.partialdiff=494,e.ydieresis=556,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=556,e.nacute=611,e.umacron=611,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=280,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=611,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=389,e.eogonek=556,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=556,e.zacute=500,e.iogonek=278,e.Oacute=778,e.oacute=611,e.amacron=556,e.sacute=556,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=611,e.twosuperior=333,e.Odieresis=778,e.mu=611,e.igrave=278,e.ohungarumlaut=611,e.Eogonek=667,e.dcroat=611,e.threequarters=834,e.Scedilla=667,e.lcaron=400,e.Kcommaaccent=722,e.Lacute=611,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=611,e.onehalf=834,e.lessequal=549,e.ocircumflex=611,e.ntilde=611,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=611,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=611,e.Ccaron=722,e.ugrave=611,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=611,e.Rcommaaccent=722,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=556,e.minus=584,e.Icircumflex=278,e.ncaron=611,e.tcommaaccent=333,e.logicalnot=584,e.odieresis=611,e.udieresis=611,e.notequal=549,e.gcommaaccent=611,e.eth=611,e.zcaron=500,e.ncommaaccent=611,e.onesuperior=333,e.imacron=278,e.Euro=556}),e["Helvetica-Oblique"]=getLookupTableFactory(function(e){e.space=278,e.exclam=278,e.quotedbl=355,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=667,e.quoteright=222,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=278,e.semicolon=278,e.less=584,e.equal=584,e.greater=584,e.question=556,e.at=1015,e.A=667,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=500,e.K=667,e.L=556,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=278,e.backslash=278,e.bracketright=278,e.asciicircum=469,e.underscore=556,e.quoteleft=222,e.a=556,e.b=556,e.c=500,e.d=556,e.e=556,e.f=278,e.g=556,e.h=556,e.i=222,e.j=222,e.k=500,e.l=222,e.m=833,e.n=556,e.o=556,e.p=556,e.q=556,e.r=333,e.s=500,e.t=278,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=500,e.braceleft=334,e.bar=260,e.braceright=334,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=191,e.quotedblleft=333,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=537,e.bullet=350,e.quotesinglbase=222,e.quotedblbase=333,e.quotedblright=333,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=556,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=222,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=556,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=667,e.aacute=556,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=500,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=500,e.aring=556,e.Ncommaaccent=722,e.lacute=222,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=500,e.scedilla=500,e.iacute=278,e.lozenge=471,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=556,e.Amacron=667,e.rcaron=333,e.ccedilla=500,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=643,e.Umacron=722,e.uring=556,e.threesuperior=333,e.Ograve=778,e.Agrave=667,e.Abreve=667,e.multiply=584,e.uacute=556,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=500,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=260,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=333,e.omacron=556,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=222,e.tcaron=317,e.eogonek=556,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=556,e.zacute=500,e.iogonek=222,e.Oacute=778,e.oacute=556,e.amacron=556,e.sacute=500,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=333,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=556,e.Eogonek=667,e.dcroat=556,e.threequarters=834,e.Scedilla=667,e.lcaron=299,e.Kcommaaccent=667,e.Lacute=556,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=556,e.onehalf=834,e.lessequal=549,e.ocircumflex=556,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=556,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=556,e.Ccaron=722,e.ugrave=556,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=556,e.Rcommaaccent=722,e.Lcommaaccent=556,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=500,e.minus=584,e.Icircumflex=278,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=584,e.odieresis=556,e.udieresis=556,e.notequal=549,e.gcommaaccent=556,e.eth=556,e.zcaron=500,e.ncommaaccent=556,e.onesuperior=333,e.imacron=278,e.Euro=556}),e.Symbol=getLookupTableFactory(function(e){e.space=250,e.exclam=333,e.universal=713,e.numbersign=500,e.existential=549,e.percent=833,e.ampersand=778,e.suchthat=439,e.parenleft=333,e.parenright=333,e.asteriskmath=500,e.plus=549,e.comma=250,e.minus=549,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=278,e.semicolon=278,e.less=549,e.equal=549,e.greater=549,e.question=444,e.congruent=549,e.Alpha=722,e.Beta=667,e.Chi=722,e.Delta=612,e.Epsilon=611,e.Phi=763,e.Gamma=603,e.Eta=722,e.Iota=333,e.theta1=631,e.Kappa=722,e.Lambda=686,e.Mu=889,e.Nu=722,e.Omicron=722,e.Pi=768,e.Theta=741,e.Rho=556,e.Sigma=592,e.Tau=611,e.Upsilon=690,e.sigma1=439,e.Omega=768,e.Xi=645,e.Psi=795,e.Zeta=611,e.bracketleft=333,e.therefore=863,e.bracketright=333,e.perpendicular=658,e.underscore=500,e.radicalex=500,e.alpha=631,e.beta=549,e.chi=549,e.delta=494,e.epsilon=439,e.phi=521,e.gamma=411,e.eta=603,e.iota=329,e.phi1=603,e.kappa=549,e.lambda=549,e.mu=576,e.nu=521,e.omicron=549,e.pi=549,e.theta=521,e.rho=549,e.sigma=603,e.tau=439,e.upsilon=576,e.omega1=713,e.omega=686,e.xi=493,e.psi=686,e.zeta=494,e.braceleft=480,e.bar=200,e.braceright=480,e.similar=549,e.Euro=750,e.Upsilon1=620,e.minute=247,e.lessequal=549,e.fraction=167,e.infinity=713,e.florin=500,e.club=753,e.diamond=753,e.heart=753,e.spade=753,e.arrowboth=1042,e.arrowleft=987,e.arrowup=603,e.arrowright=987,e.arrowdown=603,e.degree=400,e.plusminus=549,e.second=411,e.greaterequal=549,e.multiply=549,e.proportional=713,e.partialdiff=494,e.bullet=460,e.divide=549,e.notequal=549,e.equivalence=549,e.approxequal=549,e.ellipsis=1e3,e.arrowvertex=603,e.arrowhorizex=1e3,e.carriagereturn=658,e.aleph=823,e.Ifraktur=686,e.Rfraktur=795,e.weierstrass=987,e.circlemultiply=768,e.circleplus=768,e.emptyset=823,e.intersection=768,e.union=768,e.propersuperset=713,e.reflexsuperset=713,e.notsubset=713,e.propersubset=713,e.reflexsubset=713,e.element=713,e.notelement=713,e.angle=768,e.gradient=713,e.registerserif=790,e.copyrightserif=790,e.trademarkserif=890,e.product=823,e.radical=549,e.dotmath=250,e.logicalnot=713,e.logicaland=603,e.logicalor=603,e.arrowdblboth=1042,e.arrowdblleft=987,e.arrowdblup=603,e.arrowdblright=987,e.arrowdbldown=603,e.lozenge=494,e.angleleft=329,e.registersans=790,e.copyrightsans=790,e.trademarksans=786,e.summation=713,e.parenlefttp=384,e.parenleftex=384,e.parenleftbt=384,e.bracketlefttp=384,e.bracketleftex=384,e.bracketleftbt=384,e.bracelefttp=494,e.braceleftmid=494,e.braceleftbt=494,e.braceex=494,e.angleright=329,e.integral=274,e.integraltp=686,e.integralex=686,e.integralbt=686,e.parenrighttp=384,e.parenrightex=384,e.parenrightbt=384,e.bracketrighttp=384,e.bracketrightex=384,e.bracketrightbt=384,e.bracerighttp=494,e.bracerightmid=494,e.bracerightbt=494,e.apple=790}),e["Times-Roman"]=getLookupTableFactory(function(e){e.space=250,e.exclam=333,e.quotedbl=408,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=564,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=278,e.semicolon=278,e.less=564,e.equal=564,e.greater=564,e.question=444,e.at=921,e.A=722,e.B=667,e.C=667,e.D=722,e.E=611,e.F=556,e.G=722,e.H=722,e.I=333,e.J=389,e.K=722,e.L=611,e.M=889,e.N=722,e.O=722,e.P=556,e.Q=722,e.R=667,e.S=556,e.T=611,e.U=722,e.V=722,e.W=944,e.X=722,e.Y=722,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=469,e.underscore=500,e.quoteleft=333,e.a=444,e.b=500,e.c=444,e.d=500,e.e=444,e.f=333,e.g=500,e.h=500,e.i=278,e.j=278,e.k=500,e.l=278,e.m=778,e.n=500,e.o=500,e.p=500,e.q=500,e.r=333,e.s=389,e.t=278,e.u=500,e.v=500,e.w=722,e.x=500,e.y=500,e.z=444,e.braceleft=480,e.bar=200,e.braceright=480,e.asciitilde=541,e.exclamdown=333,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=180,e.quotedblleft=444,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=453,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=444,e.quotedblright=444,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=444,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=889,e.ordfeminine=276,e.Lslash=611,e.Oslash=722,e.OE=889,e.ordmasculine=310,e.ae=667,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=500,e.Idieresis=333,e.eacute=444,e.abreve=444,e.uhungarumlaut=500,e.ecaron=444,e.Ydieresis=722,e.divide=564,e.Yacute=722,e.Acircumflex=722,e.aacute=444,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=444,e.Uacute=722,e.uogonek=500,e.Edieresis=611,e.Dcroat=722,e.commaaccent=250,e.copyright=760,e.Emacron=611,e.ccaron=444,e.aring=444,e.Ncommaaccent=722,e.lacute=278,e.agrave=444,e.Tcommaaccent=611,e.Cacute=667,e.atilde=444,e.Edotaccent=611,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=471,e.Rcaron=667,e.Gcommaaccent=722,e.ucircumflex=500,e.acircumflex=444,e.Amacron=722,e.rcaron=333,e.ccedilla=444,e.Zdotaccent=611,e.Thorn=556,e.Omacron=722,e.Racute=667,e.Sacute=556,e.dcaron=588,e.Umacron=722,e.uring=500,e.threesuperior=300,e.Ograve=722,e.Agrave=722,e.Abreve=722,e.multiply=564,e.uacute=500,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=611,e.adieresis=444,e.edieresis=444,e.cacute=444,e.nacute=500,e.umacron=500,e.Ncaron=722,e.Iacute=333,e.plusminus=564,e.brokenbar=200,e.registered=760,e.Gbreve=722,e.Idotaccent=333,e.summation=600,e.Egrave=611,e.racute=333,e.omacron=500,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=326,e.eogonek=444,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=444,e.zacute=444,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=444,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=500,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=611,e.dcroat=500,e.threequarters=750,e.Scedilla=556,e.lcaron=344,e.Kcommaaccent=722,e.Lacute=611,e.trademark=980,e.edotaccent=444,e.Igrave=333,e.Imacron=333,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=500,e.Uhungarumlaut=722,e.Eacute=611,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=500,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=667,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=722,e.zdotaccent=444,e.Ecaron=611,e.Iogonek=333,e.kcommaaccent=500,e.minus=564,e.Icircumflex=333,e.ncaron=500,e.tcommaaccent=278,e.logicalnot=564,e.odieresis=500,e.udieresis=500,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=444,e.ncommaaccent=500,e.onesuperior=300,e.imacron=278,e.Euro=500}),e["Times-Bold"]=getLookupTableFactory(function(e){e.space=250,e.exclam=333,e.quotedbl=555,e.numbersign=500,e.dollar=500,e.percent=1e3,e.ampersand=833,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=570,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=570,e.equal=570,e.greater=570,e.question=500,e.at=930,e.A=722,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=778,e.I=389,e.J=500,e.K=778,e.L=667,e.M=944,e.N=722,e.O=778,e.P=611,e.Q=778,e.R=722,e.S=556,e.T=667,e.U=722,e.V=722,e.W=1e3,e.X=722,e.Y=722,e.Z=667,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=581,e.underscore=500,e.quoteleft=333,e.a=500,e.b=556,e.c=444,e.d=556,e.e=444,e.f=333,e.g=500,e.h=556,e.i=278,e.j=333,e.k=556,e.l=278,e.m=833,e.n=556,e.o=500,e.p=556,e.q=556,e.r=444,e.s=389,e.t=333,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=444,e.braceleft=394,e.bar=220,e.braceright=394,e.asciitilde=520,e.exclamdown=333,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=278,e.quotedblleft=500,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=540,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=300,e.Lslash=667,e.Oslash=778,e.OE=1e3,e.ordmasculine=330,e.ae=722,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=556,e.Idieresis=389,e.eacute=444,e.abreve=500,e.uhungarumlaut=556,e.ecaron=444,e.Ydieresis=722,e.divide=570,e.Yacute=722,e.Acircumflex=722,e.aacute=500,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=747,e.Emacron=667,e.ccaron=444,e.aring=500,e.Ncommaaccent=722,e.lacute=278,e.agrave=500,e.Tcommaaccent=667,e.Cacute=722,e.atilde=500,e.Edotaccent=667,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=500,e.Amacron=722,e.rcaron=444,e.ccedilla=444,e.Zdotaccent=667,e.Thorn=611,e.Omacron=778,e.Racute=722,e.Sacute=556,e.dcaron=672,e.Umacron=722,e.uring=556,e.threesuperior=300,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=570,e.uacute=556,e.Tcaron=667,e.partialdiff=494,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=389,e.plusminus=570,e.brokenbar=220,e.registered=747,e.Gbreve=778,e.Idotaccent=389,e.summation=600,e.Egrave=667,e.racute=444,e.omacron=500,e.Zacute=667,e.Zcaron=667,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=416,e.eogonek=444,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=444,e.zacute=444,e.iogonek=278,e.Oacute=778,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=300,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=667,e.dcroat=556,e.threequarters=750,e.Scedilla=556,e.lcaron=394,e.Kcommaaccent=778,e.Lacute=667,e.trademark=1e3,e.edotaccent=444,e.Igrave=389,e.Imacron=389,e.Lcaron=667,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=778,e.degree=400,e.ograve=500,e.Ccaron=722,e.ugrave=556,e.radical=549,e.Dcaron=722,e.rcommaaccent=444,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=722,e.Lcommaaccent=667,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=444,e.Ecaron=667,e.Iogonek=389,e.kcommaaccent=556,e.minus=570,e.Icircumflex=389,e.ncaron=556,e.tcommaaccent=333,e.logicalnot=570,e.odieresis=500,e.udieresis=556,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=444,e.ncommaaccent=556,e.onesuperior=300,e.imacron=278,e.Euro=500}),e["Times-BoldItalic"]=getLookupTableFactory(function(e){e.space=250,e.exclam=389,e.quotedbl=555,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=570,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=570,e.equal=570,e.greater=570,e.question=500,e.at=832,e.A=667,e.B=667,e.C=667,e.D=722,e.E=667,e.F=667,e.G=722,e.H=778,e.I=389,e.J=500,e.K=667,e.L=611,e.M=889,e.N=722,e.O=722,e.P=611,e.Q=722,e.R=667,e.S=556,e.T=611,e.U=722,e.V=667,e.W=889,e.X=667,e.Y=611,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=570,e.underscore=500,e.quoteleft=333,e.a=500,e.b=500,e.c=444,e.d=500,e.e=444,e.f=333,e.g=500,e.h=556,e.i=278,e.j=278,e.k=500,e.l=278,e.m=778,e.n=556,e.o=500,e.p=500,e.q=500,e.r=389,e.s=389,e.t=278,e.u=556,e.v=444,e.w=667,e.x=500,e.y=444,e.z=389,e.braceleft=348,e.bar=220,e.braceright=348,e.asciitilde=570,e.exclamdown=389,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=278,e.quotedblleft=500,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=500,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=944,e.ordfeminine=266,e.Lslash=611,e.Oslash=722,e.OE=944,e.ordmasculine=300,e.ae=722,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=500,e.Idieresis=389,e.eacute=444,e.abreve=500,e.uhungarumlaut=556,e.ecaron=444,e.Ydieresis=611,e.divide=570,e.Yacute=611,e.Acircumflex=667,e.aacute=500,e.Ucircumflex=722,e.yacute=444,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=747,e.Emacron=667,e.ccaron=444,e.aring=500,e.Ncommaaccent=722,e.lacute=278,e.agrave=500,e.Tcommaaccent=611,e.Cacute=667,e.atilde=500,e.Edotaccent=667,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=494,e.Rcaron=667,e.Gcommaaccent=722,e.ucircumflex=556,e.acircumflex=500,e.Amacron=667,e.rcaron=389,e.ccedilla=444,e.Zdotaccent=611,e.Thorn=611,e.Omacron=722,e.Racute=667,e.Sacute=556,e.dcaron=608,e.Umacron=722,e.uring=556,e.threesuperior=300,e.Ograve=722,e.Agrave=667,e.Abreve=667,e.multiply=570,e.uacute=556,e.Tcaron=611,e.partialdiff=494,e.ydieresis=444,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=389,e.plusminus=570,e.brokenbar=220,e.registered=747,e.Gbreve=722,e.Idotaccent=389,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=500,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=366,e.eogonek=444,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=444,e.zacute=389,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=576,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=667,e.dcroat=500,e.threequarters=750,e.Scedilla=556,e.lcaron=382,e.Kcommaaccent=667,e.Lacute=611,e.trademark=1e3,e.edotaccent=444,e.Igrave=389,e.Imacron=389,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=556,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=667,e.Lcommaaccent=611,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=722,e.zdotaccent=389,e.Ecaron=667,e.Iogonek=389,e.kcommaaccent=500,e.minus=606,e.Icircumflex=389,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=606,e.odieresis=500,e.udieresis=556,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=389,e.ncommaaccent=556,e.onesuperior=300,e.imacron=278,e.Euro=500}),e["Times-Italic"]=getLookupTableFactory(function(e){e.space=250,e.exclam=333,e.quotedbl=420,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=675,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=675,e.equal=675,e.greater=675,e.question=500,e.at=920,e.A=611,e.B=611,e.C=667,e.D=722,e.E=611,e.F=611,e.G=722,e.H=722,e.I=333,e.J=444,e.K=667,e.L=556,e.M=833,e.N=667,e.O=722,e.P=611,e.Q=722,e.R=611,e.S=500,e.T=556,e.U=722,e.V=611,e.W=833,e.X=611,e.Y=556,e.Z=556,e.bracketleft=389,e.backslash=278,e.bracketright=389,e.asciicircum=422,e.underscore=500,e.quoteleft=333,e.a=500,e.b=500,e.c=444,e.d=500,e.e=444,e.f=278,e.g=500,e.h=500,e.i=278,e.j=278,e.k=444,e.l=278,e.m=722,e.n=500,e.o=500,e.p=500,e.q=500,e.r=389,e.s=389,e.t=278,e.u=500,e.v=444,e.w=667,e.x=444,e.y=444,e.z=389,e.braceleft=400,e.bar=275,e.braceright=400,e.asciitilde=541,e.exclamdown=389,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=214,e.quotedblleft=556,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=523,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=556,e.quotedblright=556,e.guillemotright=500,e.ellipsis=889,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=889,e.AE=889,e.ordfeminine=276,e.Lslash=556,e.Oslash=722,e.OE=944,e.ordmasculine=310,e.ae=667,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=667,e.germandbls=500,e.Idieresis=333,e.eacute=444,e.abreve=500,e.uhungarumlaut=500,e.ecaron=444,e.Ydieresis=556,e.divide=675,e.Yacute=556,e.Acircumflex=611,e.aacute=500,e.Ucircumflex=722,e.yacute=444,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=500,e.Edieresis=611,e.Dcroat=722,e.commaaccent=250,e.copyright=760,e.Emacron=611,e.ccaron=444,e.aring=500,e.Ncommaaccent=667,e.lacute=278,e.agrave=500,e.Tcommaaccent=556,e.Cacute=667,e.atilde=500,e.Edotaccent=611,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=471,e.Rcaron=611,e.Gcommaaccent=722,e.ucircumflex=500,e.acircumflex=500,e.Amacron=611,e.rcaron=389,e.ccedilla=444,e.Zdotaccent=556,e.Thorn=611,e.Omacron=722,e.Racute=611,e.Sacute=500,e.dcaron=544,e.Umacron=722,e.uring=500,e.threesuperior=300,e.Ograve=722,e.Agrave=611,e.Abreve=611,e.multiply=675,e.uacute=500,e.Tcaron=556,e.partialdiff=476,e.ydieresis=444,e.Nacute=667,e.icircumflex=278,e.Ecircumflex=611,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=500,e.umacron=500,e.Ncaron=667,e.Iacute=333,e.plusminus=675,e.brokenbar=275,e.registered=760,e.Gbreve=722,e.Idotaccent=333,e.summation=600,e.Egrave=611,e.racute=389,e.omacron=500,e.Zacute=556,e.Zcaron=556,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=300,e.eogonek=444,e.Uogonek=722,e.Aacute=611,e.Adieresis=611,e.egrave=444,e.zacute=389,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=500,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=611,e.dcroat=500,e.threequarters=750,e.Scedilla=500,e.lcaron=300,e.Kcommaaccent=667,e.Lacute=556,e.trademark=980,e.edotaccent=444,e.Igrave=333,e.Imacron=333,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=500,e.Uhungarumlaut=722,e.Eacute=611,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=500,e.Scommaaccent=500,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=500,e.radical=453,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=667,e.otilde=500,e.Rcommaaccent=611,e.Lcommaaccent=556,e.Atilde=611,e.Aogonek=611,e.Aring=611,e.Otilde=722,e.zdotaccent=389,e.Ecaron=611,e.Iogonek=333,e.kcommaaccent=444,e.minus=675,e.Icircumflex=333,e.ncaron=500,e.tcommaaccent=278,e.logicalnot=675,e.odieresis=500,e.udieresis=500,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=389,e.ncommaaccent=500,e.onesuperior=300,e.imacron=278,e.Euro=500}),e.ZapfDingbats=getLookupTableFactory(function(e){e.space=278,e.a1=974,e.a2=961,e.a202=974,e.a3=980,e.a4=719,e.a5=789,e.a119=790,e.a118=791,e.a117=690,e.a11=960,e.a12=939,e.a13=549,e.a14=855,e.a15=911,e.a16=933,e.a105=911,e.a17=945,e.a18=974,e.a19=755,e.a20=846,e.a21=762,e.a22=761,e.a23=571,e.a24=677,e.a25=763,e.a26=760,e.a27=759,e.a28=754,e.a6=494,e.a7=552,e.a8=537,e.a9=577,e.a10=692,e.a29=786,e.a30=788,e.a31=788,e.a32=790,e.a33=793,e.a34=794,e.a35=816,e.a36=823,e.a37=789,e.a38=841,e.a39=823,e.a40=833,e.a41=816,e.a42=831,e.a43=923,e.a44=744,e.a45=723,e.a46=749,e.a47=790,e.a48=792,e.a49=695,e.a50=776,e.a51=768,e.a52=792,e.a53=759,e.a54=707,e.a55=708,e.a56=682,e.a57=701,e.a58=826,e.a59=815,e.a60=789,e.a61=789,e.a62=707,e.a63=687,e.a64=696,e.a65=689,e.a66=786,e.a67=787,e.a68=713,e.a69=791,e.a70=785,e.a71=791,e.a72=873,e.a73=761,e.a74=762,e.a203=762,e.a75=759,e.a204=759,e.a76=892,e.a77=892,e.a78=788,e.a79=784,e.a81=438,e.a82=138,e.a83=277,e.a84=415,e.a97=392,e.a98=392,e.a99=668,e.a100=668,e.a89=390,e.a90=390,e.a93=317,e.a94=317,e.a91=276,e.a92=276,e.a205=509,e.a85=509,e.a206=410,e.a86=410,e.a87=234,e.a88=234,e.a95=334,e.a96=334,e.a101=732,e.a102=544,e.a103=544,e.a104=910,e.a106=667,e.a107=760,e.a108=760,e.a112=776,e.a111=595,e.a110=694,e.a109=626,e.a120=788,e.a121=788,e.a122=788,e.a123=788,e.a124=788,e.a125=788,e.a126=788,e.a127=788,e.a128=788,e.a129=788,e.a130=788,e.a131=788,e.a132=788,e.a133=788,e.a134=788,e.a135=788,e.a136=788,e.a137=788,e.a138=788,e.a139=788,e.a140=788,e.a141=788,e.a142=788,e.a143=788,e.a144=788,e.a145=788,e.a146=788,e.a147=788,e.a148=788,e.a149=788,e.a150=788,e.a151=788,e.a152=788,e.a153=788,e.a154=788,e.a155=788,e.a156=788,e.a157=788,e.a158=788,e.a159=788,e.a160=894,e.a161=838,e.a163=1016,e.a164=458,e.a196=748,e.a165=924,e.a192=748,e.a166=918,e.a167=927,e.a168=928,e.a169=928,e.a170=834,e.a171=873,e.a172=828,e.a173=924,e.a162=924,e.a174=917,e.a175=930,e.a176=931,e.a177=463,e.a178=883,e.a179=836,e.a193=836,e.a180=867,e.a199=867,e.a181=696,e.a200=696,e.a182=874,e.a201=874,e.a183=760,e.a184=946,e.a197=771,e.a185=865,e.a194=771,e.a198=888,e.a186=967,e.a195=888,e.a187=831,e.a188=873,e.a189=927,e.a190=970,e.a191=918})}),Vn=getLookupTableFactory(function(e){e.Courier={ascent:629,descent:-157,capHeight:562,xHeight:-426},e["Courier-Bold"]={ascent:629,descent:-157,capHeight:562,xHeight:439},e["Courier-Oblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426},e["Courier-BoldOblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426},e.Helvetica={ascent:718,descent:-207,capHeight:718,xHeight:523},e["Helvetica-Bold"]={ascent:718,descent:-207,capHeight:718,xHeight:532},e["Helvetica-Oblique"]={ascent:718,descent:-207,capHeight:718,xHeight:523},e["Helvetica-BoldOblique"]={ascent:718,descent:-207,capHeight:718,xHeight:532},e["Times-Roman"]={ascent:683,descent:-217,capHeight:662,xHeight:450},e["Times-Bold"]={ascent:683,descent:-217,capHeight:676,xHeight:461},e["Times-Italic"]={ascent:683,descent:-217,capHeight:653,xHeight:441},e["Times-BoldItalic"]={ascent:683,descent:-217,capHeight:669,xHeight:462},e.Symbol={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN},e.ZapfDingbats={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN}});class GlyfTable{constructor({glyfTable:e,isGlyphLocationsLong:t,locaTable:i,numGlyphs:n}){this.glyphs=[];const a=new DataView(i.buffer,i.byteOffset,i.byteLength),s=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t?4:2;let o=t?a.getUint32(0):2*a.getUint16(0),l=0;for(let e=0;e<n;e++){l+=r;const e=t?a.getUint32(l):2*a.getUint16(l);if(e===o){this.glyphs.push(new Glyph({}));continue}const i=Glyph.parse(o,s);this.glyphs.push(i),o=e}}getSize(){return Math.sumPrecise(this.glyphs.map(e=>e.getSize()+3&-4))}write(){const e=this.getSize(),t=new DataView(new ArrayBuffer(e)),i=e>131070,n=i?4:2,a=new DataView(new ArrayBuffer((this.glyphs.length+1)*n));i?a.setUint32(0,0):a.setUint16(0,0);let s=0,r=0;for(const e of this.glyphs)s+=e.write(s,t),s=s+3&-4,r+=n,i?a.setUint32(r,s):a.setUint16(r,s>>1);return{isLocationLong:i,loca:new Uint8Array(a.buffer),glyf:new Uint8Array(t.buffer)}}scale(e){for(let t=0,i=this.glyphs.length;t<i;t++)this.glyphs[t].scale(e[t])}}class Glyph{constructor({header:e=null,simple:t=null,composites:i=null}){this.header=e,this.simple=t,this.composites=i}static parse(e,t){const[i,n]=GlyphHeader.parse(e,t);if(e+=i,n.numberOfContours<0){const i=[];for(;;){const[n,a]=CompositeGlyph.parse(e,t);if(e+=n,i.push(a),!(32&a.flags))break}return new Glyph({header:n,composites:i})}const a=SimpleGlyph.parse(e,t,n.numberOfContours);return new Glyph({header:n,simple:a})}getSize(){if(!this.header)return 0;const e=this.simple?this.simple.getSize():Math.sumPrecise(this.composites.map(e=>e.getSize()));return this.header.getSize()+e}write(e,t){if(!this.header)return 0;const i=e;if(e+=this.header.write(e,t),this.simple)e+=this.simple.write(e,t);else for(const i of this.composites)e+=i.write(e,t);return e-i}scale(e){if(!this.header)return;const t=(this.header.xMin+this.header.xMax)/2;if(this.header.scale(t,e),this.simple)this.simple.scale(t,e);else for(const i of this.composites)i.scale(t,e)}}class GlyphHeader{constructor({numberOfContours:e,xMin:t,yMin:i,xMax:n,yMax:a}){this.numberOfContours=e,this.xMin=t,this.yMin=i,this.xMax=n,this.yMax=a}static parse(e,t){return[10,new GlyphHeader({numberOfContours:t.getInt16(e),xMin:t.getInt16(e+2),yMin:t.getInt16(e+4),xMax:t.getInt16(e+6),yMax:t.getInt16(e+8)})]}getSize(){return 10}write(e,t){return t.setInt16(e,this.numberOfContours),t.setInt16(e+2,this.xMin),t.setInt16(e+4,this.yMin),t.setInt16(e+6,this.xMax),t.setInt16(e+8,this.yMax),10}scale(e,t){this.xMin=Math.round(e+(this.xMin-e)*t),this.xMax=Math.round(e+(this.xMax-e)*t)}}class Contour{constructor({flags:e,xCoordinates:t,yCoordinates:i}){this.xCoordinates=t,this.yCoordinates=i,this.flags=e}}class SimpleGlyph{constructor({contours:e,instructions:t}){this.contours=e,this.instructions=t}static parse(e,t,i){const n=[];for(let a=0;a<i;a++){const i=t.getUint16(e);e+=2,n.push(i)}const a=n[i-1]+1,s=t.getUint16(e);e+=2;const r=new Uint8Array(t).slice(e,e+s);e+=s;const o=[];for(let i=0;i<a;e++,i++){let n=t.getUint8(e);if(o.push(n),8&n){const a=t.getUint8(++e);n^=8;for(let e=0;e<a;e++)o.push(n);i+=a}}const l=[];let c=[],h=[],d=[];const u=[];let g=0,f=0;for(let i=0;i<a;i++){const a=o[i];if(2&a){const i=t.getUint8(e++);f+=16&a?i:-i,c.push(f)}else 16&a||(f+=t.getInt16(e),e+=2),c.push(f);n[g]===i&&(g++,l.push(c),c=[])}f=0,g=0;for(let i=0;i<a;i++){const a=o[i];if(4&a){const i=t.getUint8(e++);f+=32&a?i:-i,h.push(f)}else 32&a||(f+=t.getInt16(e),e+=2),h.push(f);d.push(1&a|64&a),n[g]===i&&(c=l[g],g++,u.push(new Contour({flags:d,xCoordinates:c,yCoordinates:h})),h=[],d=[])}return new SimpleGlyph({contours:u,instructions:r})}getSize(){let e=2*this.contours.length+2+this.instructions.length,t=0,i=0;for(const n of this.contours){e+=n.flags.length;for(let a=0,s=n.xCoordinates.length;a<s;a++){const s=n.xCoordinates[a],r=n.yCoordinates[a];let o=Math.abs(s-t);o>255?e+=2:o>0&&(e+=1),t=s,o=Math.abs(r-i),o>255?e+=2:o>0&&(e+=1),i=r}}return e}write(e,t){const i=e,n=[],a=[],s=[];let r=0,o=0;for(const i of this.contours){for(let e=0,t=i.xCoordinates.length;e<t;e++){let t=i.flags[e];const l=i.xCoordinates[e];let c=l-r;if(0===c)t|=16,n.push(0);else{const e=Math.abs(c);e<=255?(t|=c>=0?18:2,n.push(e)):n.push(c)}r=l;const h=i.yCoordinates[e];if(c=h-o,0===c)t|=32,a.push(0);else{const e=Math.abs(c);e<=255?(t|=c>=0?36:4,a.push(e)):a.push(c)}o=h,s.push(t)}t.setUint16(e,n.length-1),e+=2}t.setUint16(e,this.instructions.length),e+=2,this.instructions.length&&(new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e),e+=this.instructions.length);for(const i of s)t.setUint8(e++,i);for(let i=0,a=n.length;i<a;i++){const a=n[i],r=s[i];2&r?t.setUint8(e++,a):16&r||(t.setInt16(e,a),e+=2)}for(let i=0,n=a.length;i<n;i++){const n=a[i],r=s[i];4&r?t.setUint8(e++,n):32&r||(t.setInt16(e,n),e+=2)}return e-i}scale(e,t){for(const i of this.contours)if(0!==i.xCoordinates.length)for(let n=0,a=i.xCoordinates.length;n<a;n++)i.xCoordinates[n]=Math.round(e+(i.xCoordinates[n]-e)*t)}}class CompositeGlyph{constructor({flags:e,glyphIndex:t,argument1:i,argument2:n,transf:a,instructions:s}){this.flags=e,this.glyphIndex=t,this.argument1=i,this.argument2=n,this.transf=a,this.instructions=s}static parse(e,t){const i=e,n=[];let a=t.getUint16(e);const s=t.getUint16(e+2);let r,o;e+=4,1&a?(2&a?(r=t.getInt16(e),o=t.getInt16(e+2)):(r=t.getUint16(e),o=t.getUint16(e+2)),e+=4,a^=1):(2&a?(r=t.getInt8(e),o=t.getInt8(e+1)):(r=t.getUint8(e),o=t.getUint8(e+1)),e+=2),8&a?(n.push(t.getUint16(e)),e+=2):64&a?(n.push(t.getUint16(e),t.getUint16(e+2)),e+=4):128&a&&(n.push(t.getUint16(e),t.getUint16(e+2),t.getUint16(e+4),t.getUint16(e+6)),e+=8);let l=null;if(256&a){const i=t.getUint16(e);e+=2,l=new Uint8Array(t).slice(e,e+i),e+=i}return[e-i,new CompositeGlyph({flags:a,glyphIndex:s,argument1:r,argument2:o,transf:n,instructions:l})]}getSize(){let e=4+2*this.transf.length;return 256&this.flags&&(e+=2+this.instructions.length),e+=2,2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(e+=2):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(e+=2),e}write(e,t){const i=e;return 2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(this.flags|=1):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(this.flags|=1),t.setUint16(e,this.flags),t.setUint16(e+2,this.glyphIndex),e+=4,1&this.flags?(2&this.flags?(t.setInt16(e,this.argument1),t.setInt16(e+2,this.argument2)):(t.setUint16(e,this.argument1),t.setUint16(e+2,this.argument2)),e+=4):(t.setUint8(e,this.argument1),t.setUint8(e+1,this.argument2),e+=2),256&this.flags&&(t.setUint16(e,this.instructions.length),e+=2,this.instructions.length&&(new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e),e+=this.instructions.length)),e-i}scale(e,t){}}function writeInt16(e,t,i){e[t]=i>>8&255,e[t+1]=255&i}function writeInt32(e,t,i){e[t]=i>>24&255,e[t+1]=i>>16&255,e[t+2]=i>>8&255,e[t+3]=255&i}function writeData(e,t,i){if(i instanceof Uint8Array)e.set(i,t);else if("string"==typeof i)for(let n=0,a=i.length;n<a;n++)e[t++]=255&i.charCodeAt(n);else for(const n of i)e[t++]=255&n}class OpenTypeFileBuilder{constructor(e){this.sfnt=e,this.tables=Object.create(null)}static getSearchParams(e,t){let i=1,n=0;for(;(i^e)>i;)i<<=1,n++;const a=i*t;return{range:a,entry:n,rangeShift:t*e-a}}toArray(){let e=this.sfnt;const t=this.tables,i=Object.keys(t);i.sort();const n=i.length;let a,s,r,o,l,c=12+16*n;const h=[c];for(a=0;a<n;a++){o=t[i[a]];c+=(o.length+3&-4)>>>0,h.push(c)}const d=new Uint8Array(c);for(a=0;a<n;a++)o=t[i[a]],writeData(d,h[a],o);"true"===e&&(e=string32$1(65536)),d[0]=255&e.charCodeAt(0),d[1]=255&e.charCodeAt(1),d[2]=255&e.charCodeAt(2),d[3]=255&e.charCodeAt(3),writeInt16(d,4,n);const u=OpenTypeFileBuilder.getSearchParams(n,16);for(writeInt16(d,6,u.range),writeInt16(d,8,u.entry),writeInt16(d,10,u.rangeShift),c=12,a=0;a<n;a++){l=i[a],d[c]=255&l.charCodeAt(0),d[c+1]=255&l.charCodeAt(1),d[c+2]=255&l.charCodeAt(2),d[c+3]=255&l.charCodeAt(3);let e=0;for(s=h[a],r=h[a+1];s<r;s+=4){e=e+readUint32(d,s)>>>0}writeInt32(d,c+4,e),writeInt32(d,c+8,h[a]),writeInt32(d,c+12,t[l].length),c+=16}return d}addTable(e,t){if(e in this.tables)throw new Error("Table "+e+" already exists");this.tables[e]=t}}const Kn=[4],Yn=[5],Jn=[6],Zn=[7],Qn=[8],ea=[12,35],ta=[14],ia=[21],na=[22],aa=[30],sa=[31];class Type1CharString{constructor(){this.width=0,this.lsb=0,this.flexing=!1,this.output=[],this.stack=[]}convert(e,t,i){const n=e.length;let a,s,r,o=!1;for(let l=0;l<n;l++){let n=e[l];if(n<32){switch(12===n&&(n=(n<<8)+e[++l]),n){case 1:case 3:case 9:case 3072:case 3073:case 3074:case 3105:this.stack=[];break;case 4:if(this.flexing){if(this.stack.length<1){o=!0;break}const e=this.stack.pop();this.stack.push(0,e);break}o=this.executeCommand(1,Kn);break;case 5:o=this.executeCommand(2,Yn);break;case 6:o=this.executeCommand(1,Jn);break;case 7:o=this.executeCommand(1,Zn);break;case 8:o=this.executeCommand(6,Qn);break;case 10:if(this.stack.length<1){o=!0;break}if(r=this.stack.pop(),!t[r]){o=!0;break}o=this.convert(t[r],t,i);break;case 11:return o;case 13:if(this.stack.length<2){o=!0;break}a=this.stack.pop(),s=this.stack.pop(),this.lsb=s,this.width=a,this.stack.push(a,s),o=this.executeCommand(2,na);break;case 14:this.output.push(ta[0]);break;case 21:if(this.flexing)break;o=this.executeCommand(2,ia);break;case 22:if(this.flexing){this.stack.push(0);break}o=this.executeCommand(1,na);break;case 30:o=this.executeCommand(4,aa);break;case 31:o=this.executeCommand(4,sa);break;case 3078:if(i){const e=this.stack.at(-5);this.seac=this.stack.splice(-4,4),this.seac[0]+=this.lsb-e,o=this.executeCommand(0,ta)}else o=this.executeCommand(4,ta);break;case 3079:if(this.stack.length<4){o=!0;break}this.stack.pop(),a=this.stack.pop();const e=this.stack.pop();s=this.stack.pop(),this.lsb=s,this.width=a,this.stack.push(a,s,e),o=this.executeCommand(3,ia);break;case 3084:if(this.stack.length<2){o=!0;break}const l=this.stack.pop(),c=this.stack.pop();this.stack.push(c/l);break;case 3088:if(this.stack.length<2){o=!0;break}r=this.stack.pop();const h=this.stack.pop();if(0===r&&3===h){const e=this.stack.splice(-17,17);this.stack.push(e[2]+e[0],e[3]+e[1],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14]),o=this.executeCommand(13,ea,!0),this.flexing=!1,this.stack.push(e[15],e[16])}else 1===r&&0===h&&(this.flexing=!0);break;case 3089:break;default:warn$1('Unknown type 1 charstring command of "'+n+'"')}if(o)break}else n<=246?n-=139:n=n<=250?256*(n-247)+e[++l]+108:n<=254?-256*(n-251)-e[++l]-108:(255&e[++l])<<24|(255&e[++l])<<16|(255&e[++l])<<8|255&e[++l],this.stack.push(n)}return o}executeCommand(e,t,i){const n=this.stack.length;if(e>n)return!0;const a=n-e;for(let e=a;e<n;e++){let t=this.stack[e];Number.isInteger(t)?this.output.push(28,t>>8&255,255&t):(t=65536*t|0,this.output.push(255,t>>24&255,t>>16&255,t>>8&255,255&t))}return this.output.push(...t),i?this.stack.splice(a,e):this.stack.length=0,!1}}function isHexDigit(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function decrypt(e,t,i){if(i>=e.length)return new Uint8Array(0);let n,a,s=0|t;for(n=0;n<i;n++)s=52845*(e[n]+s)+22719&65535;const r=e.length-i,o=new Uint8Array(r);for(n=i,a=0;a<r;n++,a++){const t=e[n];o[a]=t^s>>8,s=52845*(t+s)+22719&65535}return o}function isSpecial(e){return 47===e||91===e||93===e||123===e||125===e||40===e||41===e}class Type1Parser{constructor(e,t,i){if(t){const t=e.getBytes(),i=!((isHexDigit(t[0])||isWhiteSpace(t[0]))&&isHexDigit(t[1])&&isHexDigit(t[2])&&isHexDigit(t[3])&&isHexDigit(t[4])&&isHexDigit(t[5])&&isHexDigit(t[6])&&isHexDigit(t[7]));e=new Stream(i?decrypt(t,55665,4):function(e,t,i){let n=0|t;const a=e.length,s=new Uint8Array(a>>>1);let r,o;for(r=0,o=0;r<a;r++){const t=e[r];if(!isHexDigit(t))continue;let i;for(r++;r<a&&!isHexDigit(i=e[r]);)r++;if(r<a){const e=parseInt(String.fromCharCode(t,i),16);s[o++]=e^n>>8,n=52845*(e+n)+22719&65535}}return s.slice(i,o)}(t,55665,4))}this.seacAnalysisEnabled=!!i,this.stream=e,this.nextChar()}readNumberArray(){this.getToken();const e=[];for(;;){const t=this.getToken();if(null===t||"]"===t||"}"===t)break;e.push(parseFloat(t||0))}return e}readNumber(){const e=this.getToken();return parseFloat(e||0)}readInt(){const e=this.getToken();return 0|parseInt(e||0,10)}readBoolean(){return"true"===this.getToken()?1:0}nextChar(){return this.currentChar=this.stream.getByte()}prevChar(){return this.stream.skip(-2),this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(-1===t)return null;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!isWhiteSpace(t))break;t=this.nextChar()}if(isSpecial(t))return this.nextChar(),String.fromCharCode(t);let i="";do{i+=String.fromCharCode(t),t=this.nextChar()}while(t>=0&&!isWhiteSpace(t)&&!isSpecial(t));return i}readCharStrings(e,t){return-1===t?e:decrypt(e,4330,t)}extractFontProgram(e){const t=this.stream,i=[],n=[],a=Object.create(null);a.lenIV=4;const s={subrs:[],charstrings:[],properties:{privateData:a}};let r,o,l,c;for(;null!==(r=this.getToken());)if("/"===r)switch(r=this.getToken(),r){case"CharStrings":for(this.getToken(),this.getToken(),this.getToken(),this.getToken();r=this.getToken(),null!==r&&"end"!==r;){if("/"!==r)continue;const e=this.getToken();o=this.readInt(),this.getToken(),l=o>0?t.getBytes(o):new Uint8Array(0),c=s.properties.privateData.lenIV;const i=this.readCharStrings(l,c);this.nextChar(),r=this.getToken(),"noaccess"===r?this.getToken():"/"===r&&this.prevChar(),n.push({glyph:e,encoded:i})}break;case"Subrs":for(this.readInt(),this.getToken();"dup"===this.getToken();){const e=this.readInt();o=this.readInt(),this.getToken(),l=o>0?t.getBytes(o):new Uint8Array(0),c=s.properties.privateData.lenIV;const n=this.readCharStrings(l,c);this.nextChar(),r=this.getToken(),"noaccess"===r&&this.getToken(),i[e]=n}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":const e=this.readNumberArray();e.length>0&&e.length,0;break;case"StemSnapH":case"StemSnapV":s.properties.privateData[r]=this.readNumberArray();break;case"StdHW":case"StdVW":s.properties.privateData[r]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":s.properties.privateData[r]=this.readNumber();break;case"ExpansionFactor":s.properties.privateData[r]=this.readNumber()||.06;break;case"ForceBold":s.properties.privateData[r]=this.readBoolean()}for(const{encoded:t,glyph:a}of n){const n=new Type1CharString,r=n.convert(t,i,this.seacAnalysisEnabled);let o=n.output;r&&(o=[14]);const l={glyphName:a,charstring:o,width:n.width,lsb:n.lsb,seac:n.seac};if(".notdef"===a?s.charstrings.unshift(l):s.charstrings.push(l),e.builtInEncoding){const t=e.builtInEncoding.indexOf(a);t>-1&&void 0===e.widths[t]&&t>=e.firstChar&&t<=e.lastChar&&(e.widths[t]=n.width)}}return s}extractFontHeader(e){let t;for(;null!==(t=this.getToken());)if("/"===t)switch(t=this.getToken(),t){case"FontMatrix":const i=this.readNumberArray();e.fontMatrix=i;break;case"Encoding":const n=this.getToken();let a;if(/^\d+$/.test(n)){a=[];const e=0|parseInt(n,10);this.getToken();for(let i=0;i<e;i++){for(t=this.getToken();"dup"!==t&&"def"!==t;)if(t=this.getToken(),null===t)return;if("def"===t)break;const e=this.readInt();this.getToken();const i=this.getToken();a[e]=i,this.getToken()}}else a=getEncoding(n);e.builtInEncoding=a;break;case"FontBBox":const s=this.readNumberArray();e.ascent=Math.max(s[3],s[1]),e.descent=Math.min(s[1],s[3]),e.ascentScaled=!0}}}function findBlock(e,t,i){const n=e.length,a=t.length,s=n-a;let r=i,o=!1;for(;r<s;){let i=0;for(;i<a&&e[r+i]===t[i];)i++;if(i>=a){for(r+=i;r<n&&isWhiteSpace(e[r]);)r++;o=!0;break}r++}return{found:o,length:r}}class Type1Font{constructor(e,t,i){let n=i.length1;i.length2;let a=t.peekBytes(6);const s=128===a[0]&&1===a[1];s&&(t.skip(6),n=a[5]<<24|a[4]<<16|a[3]<<8|a[2]);const r=function(e,t){const i=[101,101,120,101,99],n=e.pos;let a,s,r,o;try{a=e.getBytes(t),s=a.length}catch{}if(s===t&&(r=findBlock(a,i,t-2*i.length),r.found&&r.length===t))return{stream:new Stream(a),length:t};for(warn$1('Invalid "Length1" property in Type1 font -- trying to recover.'),e.pos=n;r=findBlock(e.peekBytes(2048),i,0),0!==r.length;)if(e.pos+=r.length,r.found){o=e.pos-n;break}return e.pos=n,o?{stream:new Stream(e.getBytes(o)),length:o}:(warn$1('Unable to recover "Length1" property in Type1 font -- using as is.'),{stream:new Stream(e.getBytes(t)),length:t})}(t,n);new Type1Parser(r.stream,!1,Sn).extractFontHeader(i),s&&(a=t.getBytes(6),a[5],a[4],a[3],a[2]);const o=function(e){const t=e.getBytes();if(0===t.length)throw new ti("getEexecBlock - no font program found.");return{stream:new Stream(t),length:t.length}}(t),l=new Type1Parser(o.stream,!0,Sn).extractFontProgram(i);for(const e in l.properties)i[e]=l.properties[e];const c=l.charstrings,h=this.getType2Charstrings(c),d=this.getType2Subrs(l.subrs);this.charstrings=c,this.data=this.wrap(e,h,this.charstrings,d,i),this.seacs=this.getSeacs(l.charstrings)}get numGlyphs(){return this.charstrings.length+1}getCharset(){const e=[".notdef"];for(const{glyphName:t}of this.charstrings)e.push(t);return e}getGlyphMapping(e){const t=this.charstrings;if(e.composite){const i=Object.create(null);for(let n=0,a=t.length;n<a;n++){i[e.cMap.charCodeOf(n)]=n+1}return i}const i=[".notdef"];let n,a;for(a=0;a<t.length;a++)i.push(t[a].glyphName);const s=e.builtInEncoding;if(s){n=Object.create(null);for(const e in s)a=i.indexOf(s[e]),a>=0&&(n[e]=a)}return type1FontGlyphMapping(e,n,i)}hasGlyphId(e){if(e<0||e>=this.numGlyphs)return!1;if(0===e)return!0;return this.charstrings[e-1].charstring.length>0}getSeacs(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];n.seac&&(t[i+1]=n.seac)}return t}getType2Charstrings(e){const t=[];for(const i of e)t.push(i.charstring);return t}getType2Subrs(e){let t=0;const i=e.length;t=i<1133?107:i<33769?1131:32768;const n=[];let a;for(a=0;a<t;a++)n.push([11]);for(a=0;a<i;a++)n.push(e[a]);return n}wrap(e,t,i,n,a){const s=new CFF;s.header=new CFFHeader(1,0,4,4),s.names=[e];const r=new CFFTopDict;r.setByName("version",391),r.setByName("Notice",392),r.setByName("FullName",393),r.setByName("FamilyName",394),r.setByName("Weight",395),r.setByName("Encoding",null),r.setByName("FontMatrix",a.fontMatrix),r.setByName("FontBBox",a.bbox),r.setByName("charset",null),r.setByName("CharStrings",null),r.setByName("Private",null),s.topDict=r;const o=new CFFStrings;o.add("Version 0.11"),o.add("See original notice"),o.add(e),o.add(e),o.add("Medium"),s.strings=o,s.globalSubrIndex=new CFFIndex;const l=t.length,c=[".notdef"];let h,d;for(h=0;h<l;h++){const e=i[h].glyphName;-1===On.indexOf(e)&&o.add(e),c.push(e)}s.charset=new CFFCharset(!1,0,c);const u=new CFFIndex;for(u.add([139,14]),h=0;h<l;h++)u.add(t[h]);s.charStrings=u;const g=new CFFPrivateDict;g.setByName("Subrs",null);const f=["BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StemSnapH","StemSnapV","BlueShift","BlueFuzz","BlueScale","LanguageGroup","ExpansionFactor","ForceBold","StdHW","StdVW"];for(h=0,d=f.length;h<d;h++){const e=f[h];if(!(e in a.privateData))continue;const t=a.privateData[e];if(Array.isArray(t))for(let e=t.length-1;e>0;e--)t[e]-=t[e-1];g.setByName(e,t)}s.topDict.privateDict=g;const p=new CFFIndex;for(h=0,d=n.length;h<d;h++)p.add(n[h]);g.subrsIndex=p;return new CFFCompiler(s).compile()}}const ra=[[57344,63743],[1048576,1114109]],oa=1e3,la=["ascent","bbox","black","bold","charProcOperatorList","cssFontInfo","data","defaultVMetrics","defaultWidth","descent","disableFontFace","fallbackName","fontExtraProperties","fontMatrix","isInvalidPDFjsFont","isType3Font","italic","loadedName","mimetype","missingFile","name","remeasure","systemFontInfo","vertical"],ca=["cMap","composite","defaultEncoding","differences","isMonospace","isSerifFont","isSymbolicFont","seacMap","subtype","toFontChar","toUnicode","type","vmetrics","widths"];function adjustWidths(e){if(!e.fontMatrix)return;if(e.fontMatrix[0]===t[0])return;const i=.001/e.fontMatrix[0],n=e.widths;for(const e in n)n[e]*=i;e.defaultWidth*=i}function amendFallbackToUnicode(e){if(!e.fallbackToUnicode)return;if(e.toUnicode instanceof IdentityToUnicodeMap)return;const t=[];for(const i in e.fallbackToUnicode)e.toUnicode.has(i)||(t[i]=e.fallbackToUnicode[i]);t.length>0&&e.toUnicode.amend(t)}class fonts_Glyph{constructor(e,t,i,n,a,s,r,o,l){this.originalCharCode=e,this.fontChar=t,this.unicode=i,this.accent=n,this.width=a,this.vmetric=s,this.operatorListId=r,this.isSpace=o,this.isInFont=l}get category(){return shadow$1(this,"category",function(e){const t=xn.get(e);if(t)return t;const i=e.match(An),n={isWhitespace:!!i?.[1],isZeroWidthDiacritic:!!i?.[2],isInvisibleFormatMark:!!i?.[3]};return xn.set(e,n),n}(this.unicode),!0)}}function int16(e,t){return(e<<8)+t}function writeSignedInt16(e,t,i){e[t+1]=i,e[t]=i>>>8}function signedInt16(e,t){const i=(e<<8)+t;return 32768&i?i-65536:i}function string16(e){return String.fromCharCode(e>>8&255,255&e)}function safeString16(e){return e>32767?e=32767:e<-32768&&(e=-32768),String.fromCharCode(e>>8&255,255&e)}function isTrueTypeCollectionFile(e){return"ttcf"===bytesToString$1(e.peekBytes(4))}function getFontFileType(e,{type:t,subtype:i,composite:n}){let a,s;return function(e){const t=e.peekBytes(4);return 65536===readUint32(t,0)||"true"===bytesToString$1(t)}(e)||isTrueTypeCollectionFile(e)?a=n?"CIDFontType2":"TrueType":!function(e){return"OTTO"===bytesToString$1(e.peekBytes(4))}(e)?!function(e){const t=e.peekBytes(2);return 37===t[0]&&33===t[1]||128===t[0]&&1===t[1]}(e)?!function(e){const t=e.peekBytes(4);return t[0]>=1&&t[3]>=1&&t[3]<=4}(e)?(warn$1("getFontFileType: Unable to detect correct font file Type/Subtype."),a=t,s=i):n?(a="CIDFontType0",s="CIDFontType0C"):(a="MMType1"===t?"MMType1":"Type1",s="Type1C"):a=n?"CIDFontType0":"MMType1"===t?"MMType1":"Type1":a=n?"CIDFontType2":"OpenType",[a,s]}function applyStandardFontGlyphMap(e,t){for(const i in t)e[+i]=t[i]}function buildToFontChar(e,t,i){const n=[];let a;for(let i=0,s=e.length;i<s;i++)a=getUnicodeForGlyph(e[i],t),-1!==a&&(n[i]=a);for(const e in i)a=getUnicodeForGlyph(i[e],t),-1!==a&&(n[+e]=a);return n}function isMacNameRecord(e){return 1===e.platform&&0===e.encoding&&0===e.language}function isWinNameRecord(e){return 3===e.platform&&1===e.encoding&&1033===e.language}function convertCidString(e,t,i=!1){switch(t.length){case 1:return t.charCodeAt(0);case 2:return t.charCodeAt(0)<<8|t.charCodeAt(1)}const n=`Unsupported CID string (charCode ${e}): "${t}".`;if(i)throw new ti(n);return warn$1(n),t}function adjustMapping(e,t,i,n){const a=Object.create(null),s=new Map,r=[],o=new Set;let l=0;let c=ra[l][0],h=ra[l][1];const isInPrivateArea=e=>ra[0][0]<=e&&e<=ra[0][1]||ra[1][0]<=e&&e<=ra[1][1];let d=null;for(const u in e){let g=e[u];if(!t(g))continue;if(c>h){if(l++,l>=ra.length){warn$1("Ran out of space in font private use area.");break}c=ra[l][0],h=ra[l][1]}const f=c++;0===g&&(g=i);let p=n.get(u);if("string"==typeof p)if(1===p.length)p=p.codePointAt(0);else{if(!d){d=new Map;for(let e=64256;e<=64335;e++){const t=String.fromCharCode(e).normalize("NFKD");t.length>1&&d.set(t,e)}}p=d.get(p)||p.codePointAt(0)}!p||isInPrivateArea(p)||o.has(g)||(s.set(p,g),o.add(g)),a[f]=g,r[u]=f}return{toFontChar:r,charCodeToGlyphId:a,toUnicodeExtraMap:s,nextAvailableFontCharCode:c}}function createCmapTable(e,t,i){const n=function(e,t,i){const n=[];for(const t in e)e[t]>=i||n.push({fontCharCode:0|t,glyphId:e[t]});if(t)for(const[e,a]of t)a>=i||n.push({fontCharCode:e,glyphId:a});0===n.length&&n.push({fontCharCode:0,glyphId:0}),n.sort((e,t)=>e.fontCharCode-t.fontCharCode);const a=[],s=n.length;for(let e=0;e<s;){const t=n[e].fontCharCode,i=[n[e].glyphId];++e;let r=t;for(;e<s&&r+1===n[e].fontCharCode&&(i.push(n[e].glyphId),++r,++e,65535!==r););a.push([t,r,i])}return a}(e,t,i),a=n.at(-1)[1]>65535?2:1;let s,r,o,l,c="\0\0"+string16(a)+"\0\0"+string32$1(4+8*a);for(s=n.length-1;s>=0&&!(n[s][0]<=65535);--s);const h=s+1;n[s][0]<65535&&65535===n[s][1]&&(n[s][1]=65534);const d=n[s][1]<65535?1:0,u=h+d,g=OpenTypeFileBuilder.getSearchParams(u,2);let f,p,m,b,y="",w="",x="",S="",v="",C=0;for(s=0,r=h;s<r;s++){f=n[s],p=f[0],m=f[1],y+=string16(p),w+=string16(m),b=f[2];let e=!0;for(o=1,l=b.length;o<l;++o)if(b[o]!==b[o-1]+1){e=!1;break}if(e){x+=string16(b[0]-p&65535),S+=string16(0)}else{const e=2*(u-s)+2*C;for(C+=m-p+1,x+=string16(0),S+=string16(e),o=0,l=b.length;o<l;++o)v+=string16(b[o])}}d>0&&(w+="ÿÿ",y+="ÿÿ",x+="\0",S+="\0\0");const k="\0\0"+string16(2*u)+string16(g.range)+string16(g.entry)+string16(g.rangeShift)+w+"\0\0"+y+x+S+v;let T="",F="";if(a>1){for(c+="\0\0\n"+string32$1(4+8*a+4+k.length),T="",s=0,r=n.length;s<r;s++){f=n[s],p=f[0],b=f[2];let e=b[0];for(o=1,l=b.length;o<l;++o)b[o]!==b[o-1]+1&&(m=f[0]+o-1,T+=string32$1(p)+string32$1(m)+string32$1(e),p=m+1,e=b[o]);T+=string32$1(p)+string32$1(f[1])+string32$1(e)}F="\0\f\0\0"+string32$1(T.length+16)+"\0\0\0\0"+string32$1(T.length/12)}return c+"\0"+string16(k.length+4)+k+F+T}function createOS2Table(e,t,i){i||={unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};let n=0,a=0,s=0,r=0,o=null,l=0,c=-1;if(t){for(let e in t)if(e|=0,(o>e||!o)&&(o=e),l<e&&(l=e),c=getUnicodeRangeFor(e,c),c<32)n|=1<<c;else if(c<64)a|=1<<c-32;else if(c<96)s|=1<<c-64;else{if(!(c<123))throw new ti("Unicode ranges Bits > 123 are reserved for internal usage");r|=1<<c-96}l>65535&&(l=65535)}else o=0,l=255;const h=e.bbox||[0,0,0,0],d=i.unitsPerEm||(e.fontMatrix?1/Math.max(...e.fontMatrix.slice(0,4).map(Math.abs)):1e3),u=e.ascentScaled?1:d/oa,g=i.ascent||Math.round(u*(e.ascent||h[3]));let f=i.descent||Math.round(u*(e.descent||h[1]));f>0&&e.descent>0&&h[1]<0&&(f=-f);const p=i.yMax||g,m=-i.yMin||-f;return"\0$ô\0\0\0Š»\0\0\0ŒŠ»\0\0ß\x001\0\0\0\0"+String.fromCharCode(e.fixedPitch?9:0)+"\0\0\0\0\0\0"+string32$1(n)+string32$1(a)+string32$1(s)+string32$1(r)+"*21*"+string16(e.italicAngle?1:0)+string16(o||e.firstChar)+string16(l||e.lastChar)+string16(g)+string16(f)+"\0d"+string16(p)+string16(m)+"\0\0\0\0\0\0\0\0"+string16(e.xHeight)+string16(e.capHeight)+string16(0)+string16(o||e.firstChar)+"\0"}function createPostTable(e){return"\0\0\0"+string32$1(Math.floor(65536*e.italicAngle))+"\0\0\0\0"+string32$1(e.fixedPitch?1:0)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function createPostscriptName(e){return e.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g,"").slice(0,63)}function createNameTable(e,t){t||(t=[[],[]]);const i=[t[0][0]||"Original licence",t[0][1]||e,t[0][2]||"Unknown",t[0][3]||"uniqueID",t[0][4]||e,t[0][5]||"Version 0.11",t[0][6]||createPostscriptName(e),t[0][7]||"Unknown",t[0][8]||"Unknown",t[0][9]||"Unknown"],n=[];let a,s,r,o,l;for(a=0,s=i.length;a<s;a++){l=t[1][a]||i[a];const e=[];for(r=0,o=l.length;r<o;r++)e.push(string16(l.charCodeAt(r)));n.push(e.join(""))}const c=[i,n],h=["\0","\0"],d=["\0\0","\0"],u=["\0\0","\t"],g=i.length*h.length;let f="\0\0"+string16(g)+string16(12*g+6),p=0;for(a=0,s=h.length;a<s;a++){const e=c[a];for(r=0,o=e.length;r<o;r++){l=e[r];f+=h[a]+d[a]+u[a]+string16(r)+string16(l.length)+string16(p),p+=l.length}}return f+=i.join("")+n.join(""),f}class Font{constructor(e,t,i,n){this.name=e,this.psName=null,this.mimetype=null,this.disableFontFace=n.disableFontFace,this.fontExtraProperties=n.fontExtraProperties,this.loadedName=i.loadedName,this.isType3Font=i.isType3Font,this.missingFile=!1,this.cssFontInfo=i.cssFontInfo,this._charsCache=Object.create(null),this._glyphCache=Object.create(null);let a=!!(i.flags&Cn);if(!a&&!i.isSimulatedFlags){const t=Un(),i=$n(),n=Hn();for(const s of e.split("+")){let e=s.replaceAll(/[,_]/g,"-");if(e=t[e]||i[e]||e,e=e.split("-",1)[0],n[e]){a=!0;break}}}this.isSerifFont=a,this.isSymbolicFont=!!(i.flags&kn),this.isMonospace=!!(i.flags&vn);let{type:s,subtype:r}=i;this.type=s,this.subtype=r,this.systemFontInfo=i.systemFontInfo;const o=e.match(/^InvalidPDFjsFont_(.*)_\d+$/);if(this.isInvalidPDFjsFont=!!o,this.isInvalidPDFjsFont?this.fallbackName=o[1]:this.isMonospace?this.fallbackName="monospace":this.isSerifFont?this.fallbackName="serif":this.fallbackName="sans-serif",this.systemFontInfo?.guessFallback&&(this.systemFontInfo.guessFallback=!1,this.systemFontInfo.css+=`,${this.fallbackName}`),this.differences=i.differences,this.widths=i.widths,this.defaultWidth=i.defaultWidth,this.composite=i.composite,this.cMap=i.cMap,this.capHeight=i.capHeight/oa,this.ascent=i.ascent/oa,this.descent=i.descent/oa,this.lineHeight=this.ascent-this.descent,this.fontMatrix=i.fontMatrix,this.bbox=i.bbox,this.defaultEncoding=i.defaultEncoding,this.toUnicode=i.toUnicode,this.toFontChar=[],"Type3"===i.type){for(let e=0;e<256;e++)this.toFontChar[e]=this.differences[e]||i.defaultEncoding[e];return}if(this.cidEncoding=i.cidEncoding||"",this.vertical=!!i.vertical,this.vertical&&(this.vmetrics=i.vmetrics,this.defaultVMetrics=i.defaultVMetrics),!t||t.isEmpty)return t&&warn$1('Font file is empty in "'+e+'" ('+this.loadedName+")"),void this.fallbackToSystemFont(i);let l;[s,r]=getFontFileType(t,i),s===this.type&&r===this.subtype||info$1(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${s}/${r}.`);try{switch(s){case"MMType1":info$1("MMType1 font ("+e+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";const n="Type1C"===r||"CIDFontType0C"===r?new CFFFont(t,i):new Type1Font(e,t,i);adjustWidths(i),l=this.convert(e,n,i);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype",l=this.checkAndRepair(e,t,i),adjustWidths(i),this.isOpenType&&(s="OpenType");break;default:throw new ti(`Font ${s} is not supported`)}}catch(e){return warn$1(e),void this.fallbackToSystemFont(i)}amendFallbackToUnicode(i),this.data=l,this.type=s,this.subtype=r,this.fontMatrix=i.fontMatrix,this.widths=i.widths,this.defaultWidth=i.defaultWidth,this.toUnicode=i.toUnicode,this.seacMap=i.seacMap}get renderer(){return shadow$1(this,"renderer",FontRendererFactory.create(this,Sn))}exportData(){const e=Object.create(null);for(const t of la){const i=this[t];void 0!==i&&(e[t]=i)}if(!this.fontExtraProperties)return{data:e};const t=Object.create(null);for(const e of ca){const i=this[e];void 0!==i&&(t[e]=i)}return{data:e,extra:t}}fallbackToSystemFont(e){this.missingFile=!0;const{name:t,type:i}=this;let n=normalizeFontName(t);const a=Un(),s=$n(),r=!!a[n],o=!(!s[n]||!a[s[n]]);n=a[n]||s[n]||n;const l=Vn()[n];l&&(isNaN(this.ascent)&&(this.ascent=l.ascent/oa),isNaN(this.descent)&&(this.descent=l.descent/oa),isNaN(this.capHeight)&&(this.capHeight=l.capHeight/oa)),this.bold=/bold/gi.test(n),this.italic=/oblique|italic/gi.test(n),this.black=/Black/g.test(t);const c=/Narrow/g.test(t);if(this.remeasure=(!r||c)&&Object.keys(this.widths).length>0,(r||o)&&"CIDFontType2"===i&&this.cidEncoding.startsWith("Identity-")){const i=e.cidToGidMap,n=[];if(applyStandardFontGlyphMap(n,qn()),/Arial-?Black/i.test(t)?applyStandardFontGlyphMap(n,zn()):/Calibri/i.test(t)&&applyStandardFontGlyphMap(n,Wn()),i){for(const e in n){const t=n[e];void 0!==i[t]&&(n[+e]=i[t])}i.length!==this.toUnicode.length&&e.hasIncludedToUnicodeMap&&this.toUnicode instanceof IdentityToUnicodeMap&&this.toUnicode.forEach(function(e,t){const a=n[e];void 0===i[a]&&(n[+e]=t)})}this.toUnicode instanceof IdentityToUnicodeMap||this.toUnicode.forEach(function(e,t){n[+e]=t}),this.toFontChar=n,this.toUnicode=new ToUnicodeMap(n)}else if(/Symbol/i.test(n))this.toFontChar=buildToFontChar(fn,mn(),this.differences);else if(/Dingbats/i.test(n))this.toFontChar=buildToFontChar(pn,bn(),this.differences);else if(r||o){const e=buildToFontChar(this.defaultEncoding,mn(),this.differences);"CIDFontType2"!==i||this.cidEncoding.startsWith("Identity-")||this.toUnicode instanceof IdentityToUnicodeMap||this.toUnicode.forEach(function(t,i){e[+t]=i}),this.toFontChar=e}else{const e=mn(),i=[];this.toUnicode.forEach((t,n)=>{if(!this.composite){const i=getUnicodeForGlyph(this.differences[t]||this.defaultEncoding[t],e);-1!==i&&(n=i)}i[+t]=n}),this.composite&&this.toUnicode instanceof IdentityToUnicodeMap&&/Tahoma|Verdana/i.test(t)&&applyStandardFontGlyphMap(i,qn()),this.toFontChar=i}amendFallbackToUnicode(e),this.loadedName=n.split("-",1)[0]}checkAndRepair(e,t,i){const n=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "];function readTables(e,t){const i=Object.create(null);i["OS/2"]=null,i.cmap=null,i.head=null,i.hhea=null,i.hmtx=null,i.maxp=null,i.name=null,i.post=null;for(let a=0;a<t;a++){const t=readTableEntry(e);n.includes(t.tag)&&(0!==t.length&&(i[t.tag]=t))}return i}function readTableEntry(e){const t=e.getString(4),i=e.getInt32()>>>0,n=e.getInt32()>>>0,a=e.getInt32()>>>0,s=e.pos;e.pos=e.start||0,e.skip(n);const r=e.getBytes(a);return e.pos=s,"head"===t&&(r[8]=r[9]=r[10]=r[11]=0,r[17]|=32),{tag:t,checksum:i,length:a,offset:n,data:r}}function readOpenTypeHeader(e){return{version:e.getString(4),numTables:e.getUint16(),searchRange:e.getUint16(),entrySelector:e.getUint16(),rangeShift:e.getUint16()}}function sanitizeGlyph(e,t,i,n,a,s){const r={length:0,sizeOfInstructions:0};if(t<0||t>=e.length||i>e.length||i-t<=12)return r;const o=e.subarray(t,i),l=signedInt16(o[2],o[3]),c=signedInt16(o[4],o[5]),h=signedInt16(o[6],o[7]),d=signedInt16(o[8],o[9]);l>h&&(writeSignedInt16(o,2,h),writeSignedInt16(o,6,l)),c>d&&(writeSignedInt16(o,4,d),writeSignedInt16(o,8,c));const u=signedInt16(o[0],o[1]);if(u<0)return u<-1||(n.set(o,a),r.length=o.length),r;let g,f=10,p=0;for(g=0;g<u;g++){p=(o[f]<<8|o[f+1])+1,f+=2}const m=f,b=o[f]<<8|o[f+1];r.sizeOfInstructions=b,f+=2+b;const y=f;let w=0;for(g=0;g<p;g++){const e=o[f++];192&e&&(o[f-1]=63&e);let t=2;2&e?t=1:16&e&&(t=0);let i=2;4&e?i=1:32&e&&(i=0);const n=t+i;if(w+=n,8&e){const e=o[f++];0===e&&(o[f-1]^=8),g+=e,w+=e*n}}if(0===w)return r;let x=f+w;return x>o.length?r:!s&&b>0?(n.set(o.subarray(0,m),a),n.set([0,0],a+m),n.set(o.subarray(y,x),a+m+2),x-=b,o.length-x>3&&(x=x+3&-4),r.length=x,r):o.length-x>3?(x=x+3&-4,n.set(o.subarray(0,x),a),r.length=x,r):(n.set(o,a),r.length=o.length,r)}function readNameTable(e){const i=(t.start||0)+e.offset;t.pos=i;const n=[[],[]],a=[],s=e.length,r=i+s;if(0!==t.getUint16()||s<6)return[n,a];const o=t.getUint16(),l=t.getUint16();let c,h;for(c=0;c<o&&t.pos+12<=r;c++){const e={platform:t.getUint16(),encoding:t.getUint16(),language:t.getUint16(),name:t.getUint16(),length:t.getUint16(),offset:t.getUint16()};(isMacNameRecord(e)||isWinNameRecord(e))&&a.push(e)}for(c=0,h=a.length;c<h;c++){const e=a[c];if(e.length<=0)continue;const s=i+l+e.offset;if(s+e.length>r)continue;t.pos=s;const o=e.name;if(e.encoding){let i="";for(let n=0,a=e.length;n<a;n+=2)i+=String.fromCharCode(t.getUint16());n[1][o]=i}else n[0][o]=t.getString(e.length)}return[n,a]}const a=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,-1,-1,1,-1,-999,0,1,0,-1,-2,0,-1,-2,-1,-1,0,-1,-1,0,0,-999,-999,-1,-1,-1,-1,-2,-999,-2,-2,-999,0,-2,-2,0,0,-2,0,-2,0,0,0,-2,-1,-1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];function sanitizeTTProgram(e,t){let i,n,s,r,o,l=e.data,c=0,h=0,d=0;const u=[],g=[],f=[];let p=t.tooComplexToFollowFunctions,m=!1,b=0,y=0;for(let e=l.length;c<e;){const e=l[c++];if(64===e)if(n=l[c++],m||y)c+=n;else for(i=0;i<n;i++)u.push(l[c++]);else if(65===e)if(n=l[c++],m||y)c+=2*n;else for(i=0;i<n;i++)s=l[c++],u.push(s<<8|l[c++]);else if(176==(248&e))if(n=e-176+1,m||y)c+=n;else for(i=0;i<n;i++)u.push(l[c++]);else if(184==(248&e))if(n=e-184+1,m||y)c+=2*n;else for(i=0;i<n;i++)s=l[c++],u.push(signedInt16(s,l[c++]));else if(43!==e||p)if(44!==e||p){if(45===e)if(m)m=!1,h=c;else{if(o=g.pop(),!o)return warn$1("TT: ENDF bad stack"),void(t.hintsValid=!1);r=f.pop(),l=o.data,c=o.i,t.functionsStackDeltas[r]=u.length-o.stackTop}else if(137===e)(m||y)&&(warn$1("TT: nested IDEFs not allowed"),p=!0),m=!0,d=c;else if(88===e)++b;else if(27===e)y=b;else if(89===e)y===b&&(y=0),--b;else if(28===e&&!m&&!y){const e=u.at(-1);e>0&&(c+=e-1)}}else(m||y)&&(warn$1("TT: nested FDEFs not allowed"),p=!0),m=!0,d=c,r=u.pop(),t.functionsDefined[r]={data:l,i:c};else if(!m&&!y)if(r=u.at(-1),isNaN(r))info$1("TT: CALL empty stack (or invalid entry).");else if(t.functionsUsed[r]=!0,r in t.functionsStackDeltas){const e=u.length+t.functionsStackDeltas[r];if(e<0)return warn$1("TT: CALL invalid functions stack delta."),void(t.hintsValid=!1);u.length=e}else if(r in t.functionsDefined&&!f.includes(r)){if(g.push({data:l,i:c,stackTop:u.length-1}),f.push(r),o=t.functionsDefined[r],!o)return warn$1("TT: CALL non-existent function"),void(t.hintsValid=!1);l=o.data,c=o.i}if(!m&&!y){let t=0;for(e<=142?t=a[e]:e>=192&&e<=223?t=-1:e>=224&&(t=-2),e>=113&&e<=117&&(n=u.pop(),isNaN(n)||(t=2*-n));t<0&&u.length>0;)u.pop(),t++;for(;t>0;)u.push(NaN),t--}}t.tooComplexToFollowFunctions=p;const w=[l];c>l.length&&w.push(new Uint8Array(c-l.length)),d>h&&(warn$1("TT: complementing a missing function tail"),w.push(new Uint8Array([34,45]))),function(e,t){if(t.length>1){let i,n,a=0;for(i=0,n=t.length;i<n;i++)a+=t[i].length;a=a+3&-4;const s=new Uint8Array(a);let r=0;for(i=0,n=t.length;i<n;i++)s.set(t[i],r),r+=t[i].length;e.data=s,e.length=a}}(e,w)}let s,r,o,l;if(isTrueTypeCollectionFile(t=new Stream(new Uint8Array(t.getBytes())))){const e=function(e,t){const{numFonts:i,offsetTable:n}=function(e){const t=e.getString(4);assert$1("ttcf"===t,"Must be a TrueType Collection font.");const i=e.getUint16(),n=e.getUint16(),a=e.getInt32()>>>0,s=[];for(let t=0;t<a;t++)s.push(e.getInt32()>>>0);const r={ttcTag:t,majorVersion:i,minorVersion:n,numFonts:a,offsetTable:s};switch(i){case 1:return r;case 2:return r.dsigTag=e.getInt32()>>>0,r.dsigLength=e.getInt32()>>>0,r.dsigOffset=e.getInt32()>>>0,r}throw new ti(`Invalid TrueType Collection majorVersion: ${i}.`)}(e),a=t.split("+");let s;for(let r=0;r<i;r++){e.pos=(e.start||0)+n[r];const i=readOpenTypeHeader(e),o=readTables(e,i.numTables);if(!o.name)throw new ti('TrueType Collection font must contain a "name" table.');const[l]=readNameTable(o.name);for(let e=0,n=l.length;e<n;e++)for(let n=0,r=l[e].length;n<r;n++){const r=l[e][n]?.replaceAll(/\s/g,"");if(r){if(r===t)return{header:i,tables:o};if(!(a.length<2))for(const e of a)r===e&&(s={name:e,header:i,tables:o})}}}if(s)return warn$1(`TrueType Collection does not contain "${t}" font, falling back to "${s.name}" font instead.`),{header:s.header,tables:s.tables};throw new ti(`TrueType Collection does not contain "${t}" font.`)}(t,this.name);s=e.header,r=e.tables}else s=readOpenTypeHeader(t),r=readTables(t,s.numTables);const c=!r["CFF "];if(c){if(!r.loca)throw new ti('Required "loca" table is not found');r.glyf||(warn$1('Required "glyf" table is not found -- trying to recover.'),r.glyf={tag:"glyf",data:new Uint8Array(0)}),this.isOpenType=!1}else{const t=i.composite&&(i.cidToGidMap?.length>0||!(i.cMap instanceof IdentityCMap));if("OTTO"===s.version&&!t||!r.head||!r.hhea||!r.maxp||!r.post)return l=new Stream(r["CFF "].data),o=new CFFFont(l,i),this.convert(e,o,i);delete r.glyf,delete r.loca,delete r.fpgm,delete r.prep,delete r["cvt "],this.isOpenType=!0}if(!r.maxp)throw new ti('Required "maxp" table is not found');t.pos=(t.start||0)+r.maxp.offset;let h=t.getInt32();const d=t.getUint16();if(65536!==h&&20480!==h){if(6===r.maxp.length)h=20480;else{if(!(r.maxp.length>=32))throw new ti('"maxp" table has a wrong version number');h=65536}u=r.maxp.data,f=h,u[(g=0)+3]=255&f,u[g+2]=f>>>8,u[g+1]=f>>>16,u[g]=f>>>24}var u,g,f;if(i.scaleFactors?.length===d&&c){const{scaleFactors:e}=i,t=int16(r.head.data[50],r.head.data[51]),n=new GlyfTable({glyfTable:r.glyf.data,isGlyphLocationsLong:t,locaTable:r.loca.data,numGlyphs:d});n.scale(e);const{glyf:a,loca:s,isLocationLong:o}=n.write();r.glyf.data=a,r.loca.data=s,o!==!!t&&(r.head.data[50]=0,r.head.data[51]=o?1:0);const l=r.hmtx.data;for(let t=0;t<d;t++){const i=4*t,n=Math.round(e[t]*int16(l[i],l[i+1]));l[i]=n>>8&255,l[i+1]=255&n;writeSignedInt16(l,i+2,Math.round(e[t]*signedInt16(l[i+2],l[i+3])))}}let p=d+1,m=!0;p>65535&&(m=!1,p=d,warn$1("Not enough space in glyfs to duplicate first glyph."));let b=0,y=0;if(h>=65536&&r.maxp.length>=32){t.pos+=8;t.getUint16()>2&&(r.maxp.data[14]=0,r.maxp.data[15]=2),t.pos+=4,b=t.getUint16(),t.pos+=4,y=t.getUint16()}r.maxp.data[4]=p>>8,r.maxp.data[5]=255&p;const w=function(e,t,i,n){const a={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};if(e&&sanitizeTTProgram(e,a),t&&sanitizeTTProgram(t,a),e&&function(e,t){if(!e.tooComplexToFollowFunctions){if(e.functionsDefined.length>t)return warn$1("TT: more functions defined than expected"),void(e.hintsValid=!1);for(let i=0,n=e.functionsUsed.length;i<n;i++){if(i>t)return warn$1("TT: invalid function id: "+i),void(e.hintsValid=!1);if(e.functionsUsed[i]&&!e.functionsDefined[i])return warn$1("TT: undefined function: "+i),void(e.hintsValid=!1)}}}(a,n),i&&1&i.length){const e=new Uint8Array(i.length+1);e.set(i.data),i.data=e}return a.hintsValid}(r.fpgm,r.prep,r["cvt "],b);if(w||(delete r.fpgm,delete r.prep,delete r["cvt "]),function(e,t,i,n,a,s){if(!t)return void(i&&(i.data=null));e.pos=(e.start||0)+t.offset,e.pos+=4,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2;const r=e.getUint16();e.pos+=8,e.pos+=2;let o=e.getUint16();if(0!==r){2&int16(n.data[44],n.data[45])||(t.data[22]=0,t.data[23]=0)}o>a&&(info$1(`The numOfMetrics (${o}) should not be greater than the numGlyphs (${a}).`),o=a,t.data[34]=(65280&o)>>8,t.data[35]=255&o);const l=a-o-(i.length-4*o>>1);if(l>0){const e=new Uint8Array(i.length+2*l);e.set(i.data),s&&(e[i.length]=i.data[2],e[i.length+1]=i.data[3]),i.data=e}}(t,r.hhea,r.hmtx,r.head,p,m),!r.head)throw new ti('Required "head" table is not found');!function(e,t,i){const n=e.data,a=(s=n[0],r=n[1],o=n[2],l=n[3],(s<<24)+(r<<16)+(o<<8)+l);var s,r,o,l;a>>16!=1&&(info$1("Attempting to fix invalid version in head table: "+a),n[0]=0,n[1]=1,n[2]=0,n[3]=0);const c=int16(n[50],n[51]);if(c<0||c>1){info$1("Attempting to fix invalid indexToLocFormat in head table: "+c);const e=t+1;if(i===e<<1)n[50]=0,n[51]=0;else{if(i!==e<<2)throw new ti("Could not fix indexToLocFormat: "+c);n[50]=0,n[51]=1}}}(r.head,d,c?r.loca.length:0);let x=Object.create(null);if(c){const e=int16(r.head.data[50],r.head.data[51]),t=function(e,t,i,n,a,s,r){let o,l,c;n?(o=4,l=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]},c=function(e,t,i){e[t]=i>>>24&255,e[t+1]=i>>16&255,e[t+2]=i>>8&255,e[t+3]=255&i}):(o=2,l=function(e,t){return e[t]<<9|e[t+1]<<1},c=function(e,t,i){e[t]=i>>9&255,e[t+1]=i>>1&255});const h=s?i+1:i,d=o*(1+h),u=new Uint8Array(d);u.set(e.data.subarray(0,d)),e.data=u;const g=t.data,f=g.length,p=new Uint8Array(f);let m,b;const y=[];for(m=0,b=0;m<i+1;m++,b+=o){let e=l(u,b);e>f&&(e=f),y.push({index:m,offset:e,endOffset:0})}for(y.sort((e,t)=>e.offset-t.offset),m=0;m<i;m++)y[m].endOffset=y[m+1].offset;for(y.sort((e,t)=>e.index-t.index),m=0;m<i;m++){const{offset:e,endOffset:t}=y[m];if(0!==e||0!==t)break;const i=y[m+1].offset;if(0!==i){y[m].endOffset=i;break}}const w=y.at(-2);0!==w.offset&&0===w.endOffset&&(w.endOffset=f);const x=Object.create(null);let S=0;for(c(u,0,S),m=0,b=o;m<i;m++,b+=o){const e=sanitizeGlyph(g,y[m].offset,y[m].endOffset,p,S,a),t=e.length;0===t&&(x[m]=!0),e.sizeOfInstructions>r&&(r=e.sizeOfInstructions),S+=t,c(u,b,S)}if(0===S){const e=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(m=0,b=o;m<h;m++,b+=o)c(u,b,e.length);t.data=e}else if(s){const i=l(u,o);p.length>i+S?t.data=p.subarray(0,i+S):(t.data=new Uint8Array(i+S),t.data.set(p.subarray(0,S))),t.data.set(p.subarray(0,i),S),c(e.data,u.length-o,S+i)}else t.data=p.subarray(0,S);return{missingGlyphs:x,maxSizeOfInstructions:r}}(r.loca,r.glyf,d,e,w,m,y);x=t.missingGlyphs,h>=65536&&r.maxp.length>=32&&(r.maxp.data[26]=t.maxSizeOfInstructions>>8,r.maxp.data[27]=255&t.maxSizeOfInstructions)}if(!r.hhea)throw new ti('Required "hhea" table is not found');0===r.hhea.data[10]&&0===r.hhea.data[11]&&(r.hhea.data[10]=255,r.hhea.data[11]=255);const S={unitsPerEm:int16(r.head.data[18],r.head.data[19]),yMax:signedInt16(r.head.data[42],r.head.data[43]),yMin:signedInt16(r.head.data[38],r.head.data[39]),ascent:signedInt16(r.hhea.data[4],r.hhea.data[5]),descent:signedInt16(r.hhea.data[6],r.hhea.data[7]),lineGap:signedInt16(r.hhea.data[8],r.hhea.data[9])};this.ascent=S.ascent/S.unitsPerEm,this.descent=S.descent/S.unitsPerEm,this.lineGap=S.lineGap/S.unitsPerEm,this.cssFontInfo?.lineHeight?(this.lineHeight=this.cssFontInfo.metrics.lineHeight,this.lineGap=this.cssFontInfo.metrics.lineGap):this.lineHeight=this.ascent-this.descent+this.lineGap,r.post&&function(e,i,n){const a=(t.start||0)+e.offset;t.pos=a;const s=a+e.length,r=t.getInt32();let o;t.skip(28);let l,c=!0;switch(r){case 65536:o=Fn;break;case 131072:const e=t.getUint16();if(e!==n){c=!1;break}const a=[];for(l=0;l<e;++l){const e=t.getUint16();if(e>=32768){c=!1;break}a.push(e)}if(!c)break;const h=[],d=[];for(;t.pos<s;){const e=t.getByte();for(d.length=e,l=0;l<e;++l)d[l]=String.fromCharCode(t.getByte());h.push(d.join(""))}for(o=[],l=0;l<e;++l){const e=a[l];e<258?o.push(Fn[e]):o.push(h[e-258])}break;case 196608:break;default:warn$1("Unknown/unsupported post table version "+r),c=!1,i.defaultEncoding&&(o=i.defaultEncoding)}i.glyphNames=o}(r.post,i,d),r.post={tag:"post",data:createPostTable(i)};const v=Object.create(null);function hasGlyph(e){return!x[e]}if(i.composite){const e=i.cidToGidMap||[],t=0===e.length;i.cMap.forEach(function(i,n){if("string"==typeof n&&(n=convertCidString(i,n,!0)),n>65535)throw new ti("Max size of CID is 65,535");let a=-1;t?a=n:void 0!==e[n]&&(a=e[n]),a>=0&&a<d&&hasGlyph(a)&&(v[i]=a)})}else{const e=function(e,t,i,n){if(!e)return warn$1("No cmap table available."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};let a,s=(t.start||0)+e.offset;t.pos=s,t.skip(2);const r=t.getUint16();let o,l=!1;for(let e=0;e<r;e++){const a=t.getUint16(),s=t.getUint16(),c=t.getInt32()>>>0;let h=!1;if(o?.platformId!==a||o?.encodingId!==s){if(0!==a||0!==s&&1!==s&&3!==s)if(1===a&&0===s)h=!0;else if(3!==a||1!==s||!n&&o){if(i&&3===a&&0===s){h=!0;let i=!0;if(e<r-1){const e=t.peekBytes(2);int16(e[0],e[1])<a&&(i=!1)}i&&(l=!0)}}else h=!0,i||(l=!0);else h=!0;if(h&&(o={platformId:a,encodingId:s,offset:c}),l)break}}if(o&&(t.pos=s+o.offset),!o||-1===t.peekByte())return warn$1("Could not find a preferred cmap table."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};const c=t.getUint16();let h=!1;const d=[];let u,g;if(0===c){for(t.skip(4),u=0;u<256;u++){const e=t.getByte();e&&d.push({charCode:u,glyphId:e})}h=!0}else if(2===c){t.skip(4);const e=[];let i=0;for(let n=0;n<256;n++){const n=t.getUint16()>>3;e.push(n),i=Math.max(n,i)}const n=[];for(let e=0;e<=i;e++)n.push({firstCode:t.getUint16(),entryCount:t.getUint16(),idDelta:signedInt16(t.getByte(),t.getByte()),idRangePos:t.pos+t.getUint16()});for(let i=0;i<256;i++)if(0===e[i])t.pos=n[0].idRangePos+2*i,g=t.getUint16(),d.push({charCode:i,glyphId:g});else{const a=n[e[i]];for(u=0;u<a.entryCount;u++){const e=(i<<8)+u+a.firstCode;t.pos=a.idRangePos+2*u,g=t.getUint16(),0!==g&&(g=(g+a.idDelta)%65536),d.push({charCode:e,glyphId:g})}}}else if(4===c){t.skip(4);const e=t.getUint16()>>1;t.skip(6);const i=[];let n;for(n=0;n<e;n++)i.push({end:t.getUint16()});for(t.skip(2),n=0;n<e;n++)i[n].start=t.getUint16();for(n=0;n<e;n++)i[n].delta=t.getUint16();let r,o=0;for(n=0;n<e;n++){a=i[n];const s=t.getUint16();s?(r=(s>>1)-(e-n),a.offsetIndex=r,o=Math.max(o,r+a.end-a.start+1)):a.offsetIndex=-1}const l=[];for(u=0;u<o;u++)l.push(t.getUint16());for(n=0;n<e;n++){a=i[n],s=a.start;const e=a.end,t=a.delta;for(r=a.offsetIndex,u=s;u<=e;u++)65535!==u&&(g=r<0?u:l[r+u-s],g=g+t&65535,d.push({charCode:u,glyphId:g}))}}else if(6===c){t.skip(4);const e=t.getUint16(),i=t.getUint16();for(u=0;u<i;u++){g=t.getUint16();const i=e+u;d.push({charCode:i,glyphId:g})}}else{if(12!==c)return warn$1("cmap table has unsupported format: "+c),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};{t.skip(10);const e=t.getInt32()>>>0;for(u=0;u<e;u++){const e=t.getInt32()>>>0,i=t.getInt32()>>>0;let n=t.getInt32()>>>0;for(let t=e;t<=i;t++)d.push({charCode:t,glyphId:n++})}}}d.sort((e,t)=>e.charCode-t.charCode);const f=[],p=new Set;for(const e of d){const{charCode:t}=e;p.has(t)||(p.add(t),f.push(e))}return{platformId:o.platformId,encodingId:o.encodingId,mappings:f,hasShortCmap:h}}(r.cmap,t,this.isSymbolicFont,i.hasEncoding),n=e.platformId,a=e.encodingId,s=e.mappings;let o=[],l=!1;if(!i.hasEncoding||"MacRomanEncoding"!==i.baseEncodingName&&"WinAnsiEncoding"!==i.baseEncodingName||(o=getEncoding(i.baseEncodingName)),i.hasEncoding&&!this.isSymbolicFont&&(3===n&&1===a||1===n&&0===a)){const e=mn();for(let t=0;t<256;t++){let r;if(r=void 0!==this.differences[t]?this.differences[t]:o.length&&""!==o[t]?o[t]:un[t],!r)continue;const l=recoverGlyphName(r,e);let c;if(3===n&&1===a?c=e[l]:1===n&&0===a&&(c=dn.indexOf(l)),void 0===c){if(!i.glyphNames&&i.hasIncludedToUnicodeMap&&!(this.toUnicode instanceof IdentityToUnicodeMap)){const e=this.toUnicode.get(t);e&&(c=e.codePointAt(0))}if(void 0===c)continue}for(const e of s)if(e.charCode===c){v[t]=e.glyphId;break}}}else if(0===n){for(const e of s)v[e.charCode]=e.glyphId;l=!0}else if(3===n&&0===a)for(const e of s){let t=e.charCode;t>=61440&&t<=61695&&(t&=255),v[t]=e.glyphId}else for(const e of s)v[e.charCode]=e.glyphId;if(i.glyphNames&&(o.length||this.differences.length))for(let e=0;e<256;++e){if(!l&&void 0!==v[e])continue;const t=this.differences[e]||o[e];if(!t)continue;const n=i.glyphNames.indexOf(t);n>0&&hasGlyph(n)&&(v[e]=n)}}0===v.length&&(v[0]=0);let C=p-1;if(m||(C=0),!i.cssFontInfo){const e=adjustMapping(v,hasGlyph,C,this.toUnicode);this.toFontChar=e.toFontChar,r.cmap={tag:"cmap",data:createCmapTable(e.charCodeToGlyphId,e.toUnicodeExtraMap,p)},r["OS/2"]&&function(e,t){t.pos=(t.start||0)+e.offset;const i=t.getUint16();t.skip(60);const n=t.getUint16();return!(i<4&&768&n)&&(!(t.getUint16()>t.getUint16())&&(t.skip(6),0!==t.getUint16()&&(e.data[8]=e.data[9]=0,!0)))}(r["OS/2"],t)||(r["OS/2"]={tag:"OS/2",data:createOS2Table(i,e.charCodeToGlyphId,S)})}if(!c)try{l=new Stream(r["CFF "].data);o=new CFFParser(l,i,Sn).parse(),o.duplicateFirstGlyph();const e=new CFFCompiler(o);r["CFF "].data=e.compile()}catch{warn$1("Failed to compile font "+i.loadedName)}if(r.name){const[t,n]=readNameTable(r.name);r.name.data=createNameTable(e,t),this.psName=t[0][6]||null,i.composite||function(e,t,i){if(e.isInternalFont)return;if(e.hasIncludedToUnicodeMap)return;if(e.hasEncoding)return;if(e.toUnicode instanceof IdentityToUnicodeMap)return;if(!t)return;if(0===i.length)return;if(e.defaultEncoding===gn)return;for(const e of i)if(!isWinNameRecord(e))return;const n=gn,a=[],s=mn();for(const e in n){const t=n[e];if(""===t)continue;const i=s[t];void 0!==i&&(a[e]=String.fromCharCode(i))}a.length>0&&e.toUnicode.amend(a)}(i,this.isSymbolicFont,n)}else r.name={tag:"name",data:createNameTable(this.name)};const k=new OpenTypeFileBuilder(s.version);for(const e in r)k.addTable(e,r[e].data);return k.toArray()}convert(e,i,n){n.fixedPitch=!1,n.builtInEncoding&&function(e,t){if(e.isInternalFont)return;if(e.hasIncludedToUnicodeMap)return;if(t===e.defaultEncoding)return;if(e.toUnicode instanceof IdentityToUnicodeMap)return;const i=[],n=mn();for(const a in t){if(e.hasEncoding&&(e.baseEncodingName||void 0!==e.differences[a]))continue;const s=getUnicodeForGlyph(t[a],n);-1!==s&&(i[a]=String.fromCharCode(s))}i.length>0&&e.toUnicode.amend(i)}(n,n.builtInEncoding);let a=1;i instanceof CFFFont&&(a=i.numGlyphs-1);const s=i.getGlyphMapping(n);let r=null,o=s,l=null;n.cssFontInfo||(r=adjustMapping(s,i.hasGlyphId.bind(i),a,this.toUnicode),this.toFontChar=r.toFontChar,o=r.charCodeToGlyphId,l=r.toUnicodeExtraMap);const c=i.numGlyphs;function getCharCodes(e,t){let i=null;for(const n in e)t===e[n]&&(i||=[]).push(0|n);return i}function createCharCode(e,t){for(const i in e)if(t===e[i])return 0|i;return r.charCodeToGlyphId[r.nextAvailableFontCharCode]=t,r.nextAvailableFontCharCode++}const h=i.seacs;if(r&&h?.length){const e=n.fontMatrix||t,a=i.getCharset(),o=Object.create(null);for(let t in h){t|=0;const i=h[t],n=un[i[2]],l=un[i[3]],c=a.indexOf(n),d=a.indexOf(l);if(c<0||d<0)continue;const u={x:i[0]*e[0]+i[1]*e[2]+e[4],y:i[0]*e[1]+i[1]*e[3]+e[5]},g=getCharCodes(s,t);if(g)for(const e of g){const t=r.charCodeToGlyphId,i=createCharCode(t,c),n=createCharCode(t,d);o[e]={baseFontCharCode:i,accentFontCharCode:n,accentOffset:u}}}n.seacMap=o}const d=n.fontMatrix?1/Math.max(...n.fontMatrix.slice(0,4).map(Math.abs)):1e3,u=new OpenTypeFileBuilder("OTTO");return u.addTable("CFF ",i.data),u.addTable("OS/2",createOS2Table(n,o)),u.addTable("cmap",createCmapTable(o,l,c)),u.addTable("head","\0\0\0\0\0\0\0\0\0\0_<õ\0\0"+safeString16(d)+"\0\0\0\0ž\v~'\0\0\0\0ž\v~'\0\0"+safeString16(n.descent)+"ÿ"+safeString16(n.ascent)+string16(n.italicAngle?2:0)+"\0\0\0\0\0\0\0"),u.addTable("hhea","\0\0\0"+safeString16(n.ascent)+safeString16(n.descent)+"\0\0ÿÿ\0\0\0\0\0\0"+safeString16(n.capHeight)+safeString16(Math.tan(n.italicAngle)*n.xHeight)+"\0\0\0\0\0\0\0\0\0\0\0\0"+string16(c)),u.addTable("hmtx",function(){const e=i.charstrings,t=i.cff?i.cff.widths:null;let n="\0\0\0\0";for(let i=1,a=c;i<a;i++){let a=0;if(e){const t=e[i-1];a="width"in t?t.width:0}else t&&(a=Math.ceil(t[i]||0));n+=string16(a)+string16(0)}return n}()),u.addTable("maxp","\0\0P\0"+string16(c)),u.addTable("name",createNameTable(e)),u.addTable("post",createPostTable(n)),u.toArray()}get _spaceWidth(){const e=["space","minus","one","i","I"];let t;for(const i of e){if(i in this.widths){t=this.widths[i];break}const e=mn()[i];let n=0;if(this.composite&&this.cMap.contains(e)&&(n=this.cMap.lookup(e),"string"==typeof n&&(n=convertCidString(e,n))),!n&&this.toUnicode&&(n=this.toUnicode.charCodeOf(e)),n<=0&&(n=e),t=this.widths[n],t)break}return shadow$1(this,"_spaceWidth",t||this.defaultWidth)}_charToGlyph(e,t=!1){let i,n,a,s=this._glyphCache[e];if(s?.isSpace===t)return s;let r=e;this.cMap?.contains(e)&&(r=this.cMap.lookup(e),"string"==typeof r&&(r=convertCidString(e,r))),n=this.widths[r],"number"!=typeof n&&(n=this.defaultWidth);const o=this.vmetrics?.[r];let l=this.toUnicode.get(e)||e;"number"==typeof l&&(l=String.fromCharCode(l));let c=void 0!==this.toFontChar[e];if(i=this.toFontChar[e]||e,this.missingFile){const t=this.differences[e]||this.defaultEncoding[e];".notdef"!==t&&""!==t||"Type1"!==this.type||(i=32,""===t&&(n||=this._spaceWidth,l=String.fromCharCode(i))),i=(h=i)>=65520&&h<=65535?0:h>=62976&&h<=63743?yn()[h]||h:173===h?45:h}var h;this.isType3Font&&(a=i);let d=null;if(this.seacMap?.[e]){c=!0;const t=this.seacMap[e];i=t.baseFontCharCode,d={fontChar:String.fromCodePoint(t.accentFontCharCode),offset:t.accentOffset}}let u="";if("number"==typeof i&&(i<=1114111?u=String.fromCodePoint(i):warn$1(`charToGlyph - invalid fontCharCode: ${i}`)),this.missingFile&&this.vertical&&1===u.length){const e=In()[u.charCodeAt(0)];e&&(u=l=String.fromCharCode(e))}return s=new fonts_Glyph(e,u,l,d,n,o,a,t,c),this._glyphCache[e]=s}charsToGlyphs(e){let t=this._charsCache[e];if(t)return t;if(t=[],this.cMap){const i=Object.create(null),n=e.length;let a=0;for(;a<n;){this.cMap.readCharCode(e,a,i);const{charcode:n,length:s}=i;a+=s;const r=this._charToGlyph(n,1===s&&32===e.charCodeAt(a-1));t.push(r)}}else for(let i=0,n=e.length;i<n;++i){const n=e.charCodeAt(i),a=this._charToGlyph(n,32===n);t.push(a)}return this._charsCache[e]=t}getCharPositions(e){const t=[];if(this.cMap){const i=Object.create(null);let n=0;for(;n<e.length;){this.cMap.readCharCode(e,n,i);const a=i.length;t.push([n,n+a]),n+=a}}else for(let i=0,n=e.length;i<n;++i)t.push([i,i+1]);return t}get glyphCacheValues(){return Object.values(this._glyphCache)}encodeString(e){const t=[],i=[],hasCurrentBufErrors=()=>t.length%2==1,n=this.toUnicode instanceof IdentityToUnicodeMap?e=>this.toUnicode.charCodeOf(e):e=>this.toUnicode.charCodeOf(String.fromCodePoint(e));for(let a=0,s=e.length;a<s;a++){const s=e.codePointAt(a);if(s>55295&&(s<57344||s>65533)&&a++,this.toUnicode){const e=n(s);if(-1!==e){hasCurrentBufErrors()&&(t.push(i.join("")),i.length=0);for(let t=(this.cMap?this.cMap.getCharCodeLength(e):1)-1;t>=0;t--)i.push(String.fromCharCode(e>>8*t&255));continue}}hasCurrentBufErrors()||(t.push(i.join("")),i.length=0),i.push(String.fromCodePoint(s))}return t.push(i.join("")),t}}class ErrorFont{constructor(e){this.error=e,this.loadedName="g_font_error",this.missingFile=!0}charsToGlyphs(){return[]}encodeString(e){return[e]}exportData(){return{error:this.error}}}const ha=2,da=3,ua=4,ga=5,fa=6,pa=7;class Pattern{constructor(){unreachable$1("Cannot initialize Pattern.")}static parseShading(e,t,i,n,a,s){const r=e instanceof BaseStream?e.dict:e,o=r.get("ShadingType");try{switch(o){case ha:case da:return new RadialAxialShading(r,t,i,n,a,s);case ua:case ga:case fa:case pa:return new MeshShading(e,t,i,n,a,s);default:throw new ti("Unsupported ShadingType: "+o)}}catch(e){if(e instanceof MissingDataException)throw e;return warn$1(e),new DummyShading}}}class BaseShading{static SMALL_NUMBER=1e-6;getIR(){unreachable$1("Abstract method `getIR` called.")}}class RadialAxialShading extends BaseShading{constructor(e,t,i,n,a,s){super(),this.shadingType=e.get("ShadingType");let r=0;if(this.shadingType===ha?r=4:this.shadingType===da&&(r=6),this.coordsArr=e.getArray("Coords"),!isNumberArray(this.coordsArr,r))throw new ti("RadialAxialShading: Invalid /Coords array.");const o=ColorSpaceUtils.parse({cs:e.getRaw("CS")||e.getRaw("ColorSpace"),xref:t,resources:i,pdfFunctionFactory:n,globalColorSpaceCache:a,localColorSpaceCache:s});this.bbox=lookupNormalRect(e.getArray("BBox"),null);let l=0,c=1;const h=e.getArray("Domain");isNumberArray(h,2)&&([l,c]=h);let d=!1,u=!1;const g=e.getArray("Extend");var f,p;if(f=g,p=2,Array.isArray(f)&&f.length===p&&f.every(e=>"boolean"==typeof e)&&([d,u]=g),!(this.shadingType!==da||d&&u)){const[e,t,i,n,a,s]=this.coordsArr,r=Math.hypot(e-n,t-a);i<=s+r&&s<=i+r&&warn$1("Unsupported radial gradient.")}this.extendStart=d,this.extendEnd=u;const m=e.getRaw("Function"),b=n.create(m,!0),y=(c-l)/840,w=this.colorStops=[];if(l>=c||y<=0)return void info$1("Bad shading domain.");const x=new Float32Array(o.numComps),S=new Float32Array(1);let v=0;S[0]=l,b(S,0,x,0);const C=new Uint8ClampedArray(3);o.getRgb(x,0,C);let[k,T,F]=C;w.push([0,ai.makeHexColor(k,T,F)]);let E=1;S[0]=l+y,b(S,0,x,0),o.getRgb(x,0,C);let[M,D,O]=C,_=M-k+1,R=D-T+1,N=O-F+1,L=M-k-1,U=D-T-1,j=O-F-1;for(let e=2;e<840;e++){S[0]=l+e*y,b(S,0,x,0),o.getRgb(x,0,C);const[t,i,n]=C,a=e-v;_=Math.min(_,(t-k+1)/a),R=Math.min(R,(i-T+1)/a),N=Math.min(N,(n-F+1)/a),L=Math.max(L,(t-k-1)/a),U=Math.max(U,(i-T-1)/a),j=Math.max(j,(n-F-1)/a);if(!(L<=_&&U<=R&&j<=N)){const e=ai.makeHexColor(M,D,O);w.push([E/840,e]),_=t-M+1,R=i-D+1,N=n-O+1,L=t-M-1,U=i-D-1,j=n-O-1,v=E,k=M,T=D,F=O}E=e,M=t,D=i,O=n}w.push([1,ai.makeHexColor(M,D,O)]);let $="transparent";e.has("Background")&&($=o.getRgbHex(e.get("Background"),0)),d||(w.unshift([0,$]),w[1][0]+=BaseShading.SMALL_NUMBER),u||(w.at(-1)[0]-=BaseShading.SMALL_NUMBER,w.push([1,$])),this.colorStops=w}getIR(){const{coordsArr:e,shadingType:t}=this;let i,n,a,s,r;return t===ha?(n=[e[0],e[1]],a=[e[2],e[3]],s=null,r=null,i="axial"):t===da?(n=[e[0],e[1]],a=[e[3],e[4]],s=e[2],r=e[5],i="radial"):unreachable$1(`getPattern type unknown: ${t}`),["RadialAxial",i,this.bbox,this.colorStops,n,a,s,r]}}class MeshStreamReader{constructor(e,t){this.stream=e,this.context=t,this.buffer=0,this.bufferLength=0;const i=t.numComps;this.tmpCompsBuf=new Float32Array(i);const n=t.colorSpace.numComps;this.tmpCsCompsBuf=t.colorFn?new Float32Array(n):this.tmpCompsBuf}get hasData(){if(this.stream.end)return this.stream.pos<this.stream.end;if(this.bufferLength>0)return!0;const e=this.stream.getByte();return!(e<0)&&(this.buffer=e,this.bufferLength=8,!0)}readBits(e){const{stream:t}=this;let{buffer:i,bufferLength:n}=this;if(32===e){if(0===n)return t.getInt32()>>>0;i=i<<24|t.getByte()<<16|t.getByte()<<8|t.getByte();const e=t.getByte();return this.buffer=e&(1<<n)-1,(i<<8-n|(255&e)>>n)>>>0}if(8===e&&0===n)return t.getByte();for(;n<e;)i=i<<8|t.getByte(),n+=8;return n-=e,this.bufferLength=n,this.buffer=i&(1<<n)-1,i>>n}align(){this.buffer=0,this.bufferLength=0}readFlag(){return this.readBits(this.context.bitsPerFlag)}readCoordinate(){const{bitsPerCoordinate:e,decode:t}=this.context,i=this.readBits(e),n=this.readBits(e),a=e<32?1/((1<<e)-1):2.3283064365386963e-10;return[i*a*(t[1]-t[0])+t[0],n*a*(t[3]-t[2])+t[2]]}readComponents(){const{bitsPerComponent:e,colorFn:t,colorSpace:i,decode:n,numComps:a}=this.context,s=e<32?1/((1<<e)-1):2.3283064365386963e-10,r=this.tmpCompsBuf;for(let t=0,i=4;t<a;t++,i+=2){const a=this.readBits(e);r[t]=a*s*(n[i+1]-n[i])+n[i]}const o=this.tmpCsCompsBuf;return t?.(r,0,o,0),i.getRgb(o,0)}}let ma=Object.create(null);function getB(e){return ma[e]||=function(e){const t=[];for(let i=0;i<=e;i++){const n=i/e,a=1-n;t.push(new Float32Array([a**3,3*n*a**2,3*n**2*a,n**3]))}return t}(e)}class MeshShading extends BaseShading{static MIN_SPLIT_PATCH_CHUNKS_AMOUNT=3;static MAX_SPLIT_PATCH_CHUNKS_AMOUNT=20;static TRIANGLE_DENSITY=20;constructor(e,t,i,n,a,s){if(super(),!(e instanceof BaseStream))throw new ti("Mesh data is not a stream");const r=e.dict;this.shadingType=r.get("ShadingType"),this.bbox=lookupNormalRect(r.getArray("BBox"),null);const o=ColorSpaceUtils.parse({cs:r.getRaw("CS")||r.getRaw("ColorSpace"),xref:t,resources:i,pdfFunctionFactory:n,globalColorSpaceCache:a,localColorSpaceCache:s});this.background=r.has("Background")?o.getRgb(r.get("Background"),0):null;const l=r.getRaw("Function"),c=l?n.create(l,!0):null;this.coords=[],this.colors=[],this.figures=[];const h={bitsPerCoordinate:r.get("BitsPerCoordinate"),bitsPerComponent:r.get("BitsPerComponent"),bitsPerFlag:r.get("BitsPerFlag"),decode:r.getArray("Decode"),colorFn:c,colorSpace:o,numComps:c?1:o.numComps},d=new MeshStreamReader(e,h);let u=!1;switch(this.shadingType){case ua:this._decodeType4Shading(d);break;case ga:const e=0|r.get("VerticesPerRow");if(e<2)throw new ti("Invalid VerticesPerRow");this._decodeType5Shading(d,e);break;case fa:this._decodeType6Shading(d),u=!0;break;case pa:this._decodeType7Shading(d),u=!0;break;default:unreachable$1("Unsupported mesh type.")}if(u){this._updateBounds();for(let e=0,t=this.figures.length;e<t;e++)this._buildFigureFromPatch(e)}this._updateBounds(),this._packData()}_decodeType4Shading(e){const t=this.coords,i=this.colors,n=[];let a=0;for(;e.hasData;){const s=e.readFlag(),r=e.readCoordinate(),o=e.readComponents();if(0===a){if(!(0<=s&&s<=2))throw new ti("Unknown type4 flag");switch(s){case 0:a=3;break;case 1:n.push(n.at(-2),n.at(-1)),a=1;break;case 2:n.push(n.at(-3),n.at(-1)),a=1}}n.push(t.length),t.push(r),i.push(o),a--,e.align()}this.figures.push({type:"triangles",coords:new Int32Array(n),colors:new Int32Array(n)})}_decodeType5Shading(e,t){const i=this.coords,n=this.colors,a=[];for(;e.hasData;){const t=e.readCoordinate(),s=e.readComponents();a.push(i.length),i.push(t),n.push(s)}this.figures.push({type:"lattice",coords:new Int32Array(a),colors:new Int32Array(a),verticesPerRow:t})}_decodeType6Shading(e){const t=this.coords,i=this.colors,n=new Int32Array(16),a=new Int32Array(4);for(;e.hasData;){const s=e.readFlag();if(!(0<=s&&s<=3))throw new ti("Unknown type6 flag");const r=t.length;for(let i=0,n=0!==s?8:12;i<n;i++)t.push(e.readCoordinate());const o=i.length;for(let t=0,n=0!==s?2:4;t<n;t++)i.push(e.readComponents());let l,c,h,d;switch(s){case 0:n[12]=r+3,n[13]=r+4,n[14]=r+5,n[15]=r+6,n[8]=r+2,n[11]=r+7,n[4]=r+1,n[7]=r+8,n[0]=r,n[1]=r+11,n[2]=r+10,n[3]=r+9,a[2]=o+1,a[3]=o+2,a[0]=o,a[1]=o+3;break;case 1:l=n[12],c=n[13],h=n[14],d=n[15],n[12]=d,n[13]=r+0,n[14]=r+1,n[15]=r+2,n[8]=h,n[11]=r+3,n[4]=c,n[7]=r+4,n[0]=l,n[1]=r+7,n[2]=r+6,n[3]=r+5,l=a[2],c=a[3],a[2]=c,a[3]=o,a[0]=l,a[1]=o+1;break;case 2:l=n[15],c=n[11],n[12]=n[3],n[13]=r+0,n[14]=r+1,n[15]=r+2,n[8]=n[7],n[11]=r+3,n[4]=c,n[7]=r+4,n[0]=l,n[1]=r+7,n[2]=r+6,n[3]=r+5,l=a[3],a[2]=a[1],a[3]=o,a[0]=l,a[1]=o+1;break;case 3:n[12]=n[0],n[13]=r+0,n[14]=r+1,n[15]=r+2,n[8]=n[1],n[11]=r+3,n[4]=n[2],n[7]=r+4,n[0]=n[3],n[1]=r+7,n[2]=r+6,n[3]=r+5,a[2]=a[0],a[3]=o,a[0]=a[1],a[1]=o+1}n[5]=t.length,t.push([(-4*t[n[0]][0]-t[n[15]][0]+6*(t[n[4]][0]+t[n[1]][0])-2*(t[n[12]][0]+t[n[3]][0])+3*(t[n[13]][0]+t[n[7]][0]))/9,(-4*t[n[0]][1]-t[n[15]][1]+6*(t[n[4]][1]+t[n[1]][1])-2*(t[n[12]][1]+t[n[3]][1])+3*(t[n[13]][1]+t[n[7]][1]))/9]),n[6]=t.length,t.push([(-4*t[n[3]][0]-t[n[12]][0]+6*(t[n[2]][0]+t[n[7]][0])-2*(t[n[0]][0]+t[n[15]][0])+3*(t[n[4]][0]+t[n[14]][0]))/9,(-4*t[n[3]][1]-t[n[12]][1]+6*(t[n[2]][1]+t[n[7]][1])-2*(t[n[0]][1]+t[n[15]][1])+3*(t[n[4]][1]+t[n[14]][1]))/9]),n[9]=t.length,t.push([(-4*t[n[12]][0]-t[n[3]][0]+6*(t[n[8]][0]+t[n[13]][0])-2*(t[n[0]][0]+t[n[15]][0])+3*(t[n[11]][0]+t[n[1]][0]))/9,(-4*t[n[12]][1]-t[n[3]][1]+6*(t[n[8]][1]+t[n[13]][1])-2*(t[n[0]][1]+t[n[15]][1])+3*(t[n[11]][1]+t[n[1]][1]))/9]),n[10]=t.length,t.push([(-4*t[n[15]][0]-t[n[0]][0]+6*(t[n[11]][0]+t[n[14]][0])-2*(t[n[12]][0]+t[n[3]][0])+3*(t[n[2]][0]+t[n[8]][0]))/9,(-4*t[n[15]][1]-t[n[0]][1]+6*(t[n[11]][1]+t[n[14]][1])-2*(t[n[12]][1]+t[n[3]][1])+3*(t[n[2]][1]+t[n[8]][1]))/9]),this.figures.push({type:"patch",coords:new Int32Array(n),colors:new Int32Array(a)})}}_decodeType7Shading(e){const t=this.coords,i=this.colors,n=new Int32Array(16),a=new Int32Array(4);for(;e.hasData;){const s=e.readFlag();if(!(0<=s&&s<=3))throw new ti("Unknown type7 flag");const r=t.length;for(let i=0,n=0!==s?12:16;i<n;i++)t.push(e.readCoordinate());const o=i.length;for(let t=0,n=0!==s?2:4;t<n;t++)i.push(e.readComponents());let l,c,h,d;switch(s){case 0:n[12]=r+3,n[13]=r+4,n[14]=r+5,n[15]=r+6,n[8]=r+2,n[9]=r+13,n[10]=r+14,n[11]=r+7,n[4]=r+1,n[5]=r+12,n[6]=r+15,n[7]=r+8,n[0]=r,n[1]=r+11,n[2]=r+10,n[3]=r+9,a[2]=o+1,a[3]=o+2,a[0]=o,a[1]=o+3;break;case 1:l=n[12],c=n[13],h=n[14],d=n[15],n[12]=d,n[13]=r+0,n[14]=r+1,n[15]=r+2,n[8]=h,n[9]=r+9,n[10]=r+10,n[11]=r+3,n[4]=c,n[5]=r+8,n[6]=r+11,n[7]=r+4,n[0]=l,n[1]=r+7,n[2]=r+6,n[3]=r+5,l=a[2],c=a[3],a[2]=c,a[3]=o,a[0]=l,a[1]=o+1;break;case 2:l=n[15],c=n[11],n[12]=n[3],n[13]=r+0,n[14]=r+1,n[15]=r+2,n[8]=n[7],n[9]=r+9,n[10]=r+10,n[11]=r+3,n[4]=c,n[5]=r+8,n[6]=r+11,n[7]=r+4,n[0]=l,n[1]=r+7,n[2]=r+6,n[3]=r+5,l=a[3],a[2]=a[1],a[3]=o,a[0]=l,a[1]=o+1;break;case 3:n[12]=n[0],n[13]=r+0,n[14]=r+1,n[15]=r+2,n[8]=n[1],n[9]=r+9,n[10]=r+10,n[11]=r+3,n[4]=n[2],n[5]=r+8,n[6]=r+11,n[7]=r+4,n[0]=n[3],n[1]=r+7,n[2]=r+6,n[3]=r+5,a[2]=a[0],a[3]=o,a[0]=a[1],a[1]=o+1}this.figures.push({type:"patch",coords:new Int32Array(n),colors:new Int32Array(a)})}}_buildFigureFromPatch(e){const t=this.figures[e];assert$1("patch"===t.type,"Unexpected patch mesh figure");const i=this.coords,n=this.colors,a=t.coords,s=t.colors,r=Math.min(i[a[0]][0],i[a[3]][0],i[a[12]][0],i[a[15]][0]),o=Math.min(i[a[0]][1],i[a[3]][1],i[a[12]][1],i[a[15]][1]),l=Math.max(i[a[0]][0],i[a[3]][0],i[a[12]][0],i[a[15]][0]),c=Math.max(i[a[0]][1],i[a[3]][1],i[a[12]][1],i[a[15]][1]);let h=Math.ceil((l-r)*MeshShading.TRIANGLE_DENSITY/(this.bounds[2]-this.bounds[0]));h=MathClamp$1(h,MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);let d=Math.ceil((c-o)*MeshShading.TRIANGLE_DENSITY/(this.bounds[3]-this.bounds[1]));d=MathClamp$1(d,MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);const u=h+1,g=new Int32Array((d+1)*u),f=new Int32Array((d+1)*u);let p=0;const m=new Uint8Array(3),b=new Uint8Array(3),y=n[s[0]],w=n[s[1]],x=n[s[2]],S=n[s[3]],v=getB(d),C=getB(h);for(let e=0;e<=d;e++){m[0]=(y[0]*(d-e)+x[0]*e)/d|0,m[1]=(y[1]*(d-e)+x[1]*e)/d|0,m[2]=(y[2]*(d-e)+x[2]*e)/d|0,b[0]=(w[0]*(d-e)+S[0]*e)/d|0,b[1]=(w[1]*(d-e)+S[1]*e)/d|0,b[2]=(w[2]*(d-e)+S[2]*e)/d|0;for(let t=0;t<=h;t++,p++){if(!(0!==e&&e!==d||0!==t&&t!==h))continue;let s=0,r=0,o=0;for(let n=0;n<=3;n++)for(let l=0;l<=3;l++,o++){const c=v[e][n]*C[t][l];s+=i[a[o]][0]*c,r+=i[a[o]][1]*c}g[p]=i.length,i.push([s,r]),f[p]=n.length;const l=new Uint8Array(3);l[0]=(m[0]*(h-t)+b[0]*t)/h|0,l[1]=(m[1]*(h-t)+b[1]*t)/h|0,l[2]=(m[2]*(h-t)+b[2]*t)/h|0,n.push(l)}}g[0]=a[0],f[0]=s[0],g[h]=a[3],f[h]=s[1],g[u*d]=a[12],f[u*d]=s[2],g[u*d+h]=a[15],f[u*d+h]=s[3],this.figures[e]={type:"lattice",coords:g,colors:f,verticesPerRow:u}}_updateBounds(){let e=this.coords[0][0],t=this.coords[0][1],i=e,n=t;for(let a=1,s=this.coords.length;a<s;a++){const s=this.coords[a][0],r=this.coords[a][1];e=e>s?s:e,t=t>r?r:t,i=i<s?s:i,n=n<r?r:n}this.bounds=[e,t,i,n]}_packData(){let e,t,i,n;const a=this.coords,s=new Float32Array(2*a.length);for(e=0,i=0,t=a.length;e<t;e++){const t=a[e];s[i++]=t[0],s[i++]=t[1]}this.coords=s;const r=this.colors,o=new Uint8Array(3*r.length);for(e=0,i=0,t=r.length;e<t;e++){const t=r[e];o[i++]=t[0],o[i++]=t[1],o[i++]=t[2]}this.colors=o;const l=this.figures;for(e=0,t=l.length;e<t;e++){const t=l[e],a=t.coords,s=t.colors;for(i=0,n=a.length;i<n;i++)a[i]*=2,s[i]*=3}}getIR(){const{bounds:e}=this;if(e[2]-e[0]===0||e[3]-e[1]===0)throw new ti(`Invalid MeshShading bounds: [${e}].`);return["Mesh",this.shadingType,this.coords,this.colors,this.figures,e,this.bbox,this.background]}}class DummyShading extends BaseShading{getIR(){return["Dummy"]}}function getTilingPatternIR(e,t,i){const n=lookupMatrix(t.getArray("Matrix"),pi),a=lookupNormalRect(t.getArray("BBox"),null);if(!a||a[2]-a[0]===0||a[3]-a[1]===0)throw new ti("Invalid getTilingPatternIR /BBox array.");const s=t.get("XStep");if("number"!=typeof s)throw new ti("Invalid getTilingPatternIR /XStep value.");const r=t.get("YStep");if("number"!=typeof r)throw new ti("Invalid getTilingPatternIR /YStep value.");const o=t.get("PaintType");if(!Number.isInteger(o))throw new ti("Invalid getTilingPatternIR /PaintType value.");const l=t.get("TilingType");if(!Number.isInteger(l))throw new ti("Invalid getTilingPatternIR /TilingType value.");return["TilingPattern",i,e,n,a,s,r,o,l]}const ba=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.54657,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.73293,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.9121,.86943,.79795,.88198,.77958,.70864,.81055,.90399,.88653,.96017,.82577,.77892,.78257,.97507,1.54657,.97507,.85284,.89552,.90176,.88762,.8785,.75241,.8785,.90518,.95015,.77618,.8785,.88401,.91916,.86304,.88401,.91488,.8785,.8801,.8785,.8785,.91343,.7173,1.04106,.8785,.85075,.95794,.82616,.85162,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.12401,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.73293,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.9121,.86943,.86943,.86943,.86943,.86943,.85284,.87508,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.88762,.88762,.88762,.88762,.88762,.88762,.8715,.75241,.90518,.90518,.90518,.90518,.88401,.88401,.88401,.88401,.8785,.8785,.8801,.8801,.8801,.8801,.8801,.90747,.89049,.8785,.8785,.8785,.8785,.85162,.8785,.85162,.83908,.88762,.83908,.88762,.83908,.88762,.73293,.75241,.73293,.75241,.73293,.75241,.73293,.75241,.87289,.83016,.88506,.93125,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.81921,.77618,.81921,.77618,.81921,.77618,1,1,.87356,.8785,.91075,.89608,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76229,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.79468,.91926,.88175,.70823,.94903,.9121,.8785,1,1,.9121,.8785,.87802,.88656,.8785,.86943,.8801,.86943,.8801,.86943,.8801,.87402,.89291,.77958,.91343,1,1,.77958,.91343,.70864,.7173,.70864,.7173,.70864,.7173,.70864,.7173,1,1,.81055,.75841,.81055,1.06452,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.96017,.95794,.77892,.85162,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.88762,.77539,.8715,.87508,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70674,.98387,.94721,1.33431,1.45894,.95161,1.06303,.83908,.80352,.57184,.6965,.56289,.82001,.56029,.81235,1.02988,.83908,.7762,.68156,.80367,.73133,.78257,.87356,.86943,.95958,.75727,.89019,1.04924,.9121,.7648,.86943,.87356,.79795,.78275,.81055,.77892,.9762,.82577,.99819,.84896,.95958,.77892,.96108,1.01407,.89049,1.02988,.94211,.96108,.8936,.84021,.87842,.96399,.79109,.89049,1.00813,1.02988,.86077,.87445,.92099,.84723,.86513,.8801,.75638,.85714,.78216,.79586,.87965,.94211,.97747,.78287,.97926,.84971,1.02988,.94211,.8801,.94211,.84971,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90264,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.90518,1,1,1,1,1,1,1,1,1,1,1,1,.90548,1,1,1,1,1,1,.96017,.95794,.96017,.95794,.96017,.95794,.77892,.85162,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.92794,.87012,.87012,.87012,.89552,.89552,1.42259,.71143,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.93835,.83406,.91133,.84107,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90527,1.81055,.90527,1.81055,1.31006,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],ya={lineHeight:1.2207,lineGap:.2207},wa=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.56239,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.71805,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.90872,.85938,.79795,.87068,.77958,.69766,.81055,.90399,.88653,.96068,.82577,.77892,.78257,.97507,1.529,.97507,.85284,.89552,.90176,.94908,.86411,.74012,.86411,.88323,.95015,.86411,.86331,.88401,.91916,.86304,.88401,.9039,.86331,.86331,.86411,.86411,.90464,.70852,1.04106,.86331,.84372,.95794,.82616,.84548,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.19129,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.71805,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.90872,.85938,.85938,.85938,.85938,.85938,.85284,.87068,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.94908,.94908,.94908,.94908,.94908,.94908,.85887,.74012,.88323,.88323,.88323,.88323,.88401,.88401,.88401,.88401,.8785,.86331,.86331,.86331,.86331,.86331,.86331,.90747,.89049,.86331,.86331,.86331,.86331,.84548,.86411,.84548,.83908,.94908,.83908,.94908,.83908,.94908,.71805,.74012,.71805,.74012,.71805,.74012,.71805,.74012,.87289,.79538,.88506,.92726,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.81921,.86411,.81921,.86411,.81921,.86411,1,1,.87356,.86331,.91075,.8777,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76467,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.77312,.91926,.88175,.70823,.94903,.90872,.86331,1,1,.90872,.86331,.86906,.88116,.86331,.85938,.86331,.85938,.86331,.85938,.86331,.87402,.86549,.77958,.90464,1,1,.77958,.90464,.69766,.70852,.69766,.70852,.69766,.70852,.69766,.70852,1,1,.81055,.75841,.81055,1.06452,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.96068,.95794,.77892,.84548,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.94908,.77539,.85887,.87068,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70088,.98387,.94721,1.33431,1.45894,.95161,1.48387,.83908,.80352,.57118,.6965,.56347,.79179,.55853,.80346,1.02988,.83908,.7762,.67174,.86036,.73133,.78257,.87356,.86441,.95958,.75727,.89019,1.04924,.90872,.74889,.85938,.87891,.79795,.7957,.81055,.77892,.97447,.82577,.97466,.87179,.95958,.77892,.94252,.95612,.8753,1.02988,.92733,.94252,.87411,.84021,.8728,.95612,.74081,.8753,1.02189,1.02988,.84814,.87445,.91822,.84723,.85668,.86331,.81344,.87581,.76422,.82046,.96057,.92733,.99375,.78022,.95452,.86015,1.02988,.92733,.86331,.92733,.86015,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90631,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.88323,1,1,1,1,1,1,1,1,1,1,1,1,.85174,1,1,1,1,1,1,.96068,.95794,.96068,.95794,.96068,.95794,.77892,.84548,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.89807,.87012,.87012,.87012,.89552,.89552,1.42259,.71094,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.92972,.83406,.91133,.83326,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90616,1.81055,.90527,1.81055,1.3107,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Aa={lineHeight:1.2207,lineGap:.2207},xa=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39543,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.72346,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89249,.84118,.77452,.85374,.75186,.67789,.79776,.88844,.85066,.94309,.77818,.7306,.76659,1.10369,1.38313,1.10369,1.06139,.89552,.8739,.9245,.9245,.83203,.9245,.85865,1.09842,.9245,.9245,1.03297,1.07692,.90918,1.03297,.94959,.9245,.92274,.9245,.9245,1.02933,.77832,1.20562,.9245,.8916,.98986,.86621,.89453,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.16359,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.72346,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89249,.84118,.84118,.84118,.84118,.84118,.85284,.84557,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.9245,.9245,.9245,.9245,.9245,.9245,.84843,.83203,.85865,.85865,.85865,.85865,.82601,.82601,.82601,.82601,.94469,.9245,.92274,.92274,.92274,.92274,.92274,.90747,.86651,.9245,.9245,.9245,.9245,.89453,.9245,.89453,.8675,.9245,.8675,.9245,.8675,.9245,.72346,.83203,.72346,.83203,.72346,.83203,.72346,.83203,.85193,.8875,.86477,.99034,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.81105,.9245,.81105,.9245,.81105,.9245,1,1,.86275,.9245,.90872,.93591,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77896,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.9375,.98156,.93407,.77261,1.11429,.89249,.9245,1,1,.89249,.9245,.92534,.86698,.9245,.84118,.92274,.84118,.92274,.84118,.92274,.8667,.86291,.75186,1.02933,1,1,.75186,1.02933,.67789,.77832,.67789,.77832,.67789,.77832,.67789,.77832,1,1,.79776,.97655,.79776,1.23023,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.94309,.98986,.7306,.89453,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.9245,.76318,.84843,.84557,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67009,.96334,.93695,1.35191,1.40909,.95161,1.48387,.8675,.90861,.6192,.7363,.64824,.82411,.56321,.85696,1.23516,.8675,.81552,.7286,.84134,.73206,.76659,.86275,.84369,.90685,.77892,.85871,1.02638,.89249,.75828,.84118,.85984,.77452,.76466,.79776,.7306,.90782,.77818,.903,.87291,.90685,.7306,.99058,1.03667,.94635,1.23516,.9849,.99058,.92393,.8916,.942,1.03667,.75026,.94635,1.0297,1.23516,.90918,.94048,.98217,.89746,.84153,.92274,.82507,.88832,.84438,.88178,1.03525,.9849,1.00225,.78086,.97248,.89404,1.23516,.9849,.92274,.9849,.89404,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.89693,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.85865,1,1,1,1,1,1,1,1,1,1,1,1,.90933,1,1,1,1,1,1,.94309,.98986,.94309,.98986,.94309,.98986,.7306,.89453,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.68994,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.97858,.82616,.91133,.83437,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90572,1.81055,.90749,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85284,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Sa={lineHeight:1.2207,lineGap:.2207},va=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39016,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.73834,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89385,.85122,.77452,.86503,.75186,.68887,.79776,.88844,.85066,.94258,.77818,.7306,.76659,1.10369,1.39016,1.10369,1.06139,.89552,.8739,.86128,.94469,.8457,.94469,.89464,1.09842,.84636,.94469,1.03297,1.07692,.90918,1.03297,.95897,.94469,.9482,.94469,.94469,1.04692,.78223,1.20562,.94469,.90332,.98986,.86621,.90527,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.08707,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.73834,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89385,.85122,.85122,.85122,.85122,.85122,.85284,.85311,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.86128,.86128,.86128,.86128,.86128,.86128,.8693,.8457,.89464,.89464,.89464,.89464,.82601,.82601,.82601,.82601,.94469,.94469,.9482,.9482,.9482,.9482,.9482,.90747,.86651,.94469,.94469,.94469,.94469,.90527,.94469,.90527,.8675,.86128,.8675,.86128,.8675,.86128,.73834,.8457,.73834,.8457,.73834,.8457,.73834,.8457,.85193,.92454,.86477,.9921,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.81105,.84636,.81105,.84636,.81105,.84636,1,1,.86275,.94469,.90872,.95786,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77741,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.90452,.98156,1.11842,.77261,1.11429,.89385,.94469,1,1,.89385,.94469,.95877,.86901,.94469,.85122,.9482,.85122,.9482,.85122,.9482,.8667,.90016,.75186,1.04692,1,1,.75186,1.04692,.68887,.78223,.68887,.78223,.68887,.78223,.68887,.78223,1,1,.79776,.92188,.79776,1.23023,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.94258,.98986,.7306,.90527,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.86128,.76318,.8693,.85311,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67742,.96334,.93695,1.35191,1.40909,.95161,1.48387,.86686,.90861,.62267,.74359,.65649,.85498,.56963,.88254,1.23516,.8675,.81552,.75443,.84503,.73206,.76659,.86275,.85122,.90685,.77892,.85746,1.02638,.89385,.75657,.85122,.86275,.77452,.74171,.79776,.7306,.95165,.77818,.89772,.88831,.90685,.7306,.98142,1.02191,.96576,1.23516,.99018,.98142,.9236,.89258,.94035,1.02191,.78848,.96576,.9561,1.23516,.90918,.92578,.95424,.89746,.83969,.9482,.80113,.89442,.85208,.86155,.98022,.99018,1.00452,.81209,.99247,.89181,1.23516,.99018,.9482,.99018,.89181,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.88844,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89464,1,1,1,1,1,1,1,1,1,1,1,1,.96766,1,1,1,1,1,1,.94258,.98986,.94258,.98986,.94258,.98986,.7306,.90527,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.69043,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.99331,.82616,.91133,.84286,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90527,1.81055,.90527,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1.07185,.99413,.96334,1.08065,1,1,1,1,1,1,1,1,1,1,1],Ca={lineHeight:1.2207,lineGap:.2207},ka=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.03374,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.00042,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.03828,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00034,.99977,1,.99997,1.00026,1.00078,1.00036,.99973,1.00013,1.0006,.99977,.99977,.99988,.85148,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,1.00069,1.00022,.99977,1.00001,.99984,1.00026,1.00001,1.00024,1.00001,.9999,1,1.0006,1.00001,1.00041,.99962,1.00026,1.0006,.99995,1.00041,.99942,.99973,.99927,1.00082,.99902,1.00026,1.00087,1.0006,1.00069,.99973,.99867,.99973,.9993,1.00026,1.00049,1.00056,1,.99988,.99935,.99995,.99954,1.00055,.99945,1.00032,1.0006,.99995,1.00026,.99995,1.00032,1.00001,1.00008,.99971,1.00019,.9994,1.00001,1.0006,1.00044,.99973,1.00023,1.00047,1,.99942,.99561,.99989,1.00035,.99977,1.00035,.99977,1.00019,.99944,1.00001,1.00021,.99926,1.00035,1.00035,.99942,1.00048,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.99989,1.00057,1.00001,.99936,1.00052,1.00012,.99996,1.00043,1,1.00035,.9994,.99976,1.00035,.99973,1.00052,1.00041,1.00119,1.00037,.99973,1.00002,.99986,1.00041,1.00041,.99902,.9996,1.00034,.99999,1.00026,.99999,1.00026,.99973,1.00052,.99973,1,.99973,1.00041,1.00075,.9994,1.0003,.99999,1,1.00041,.99955,1,.99915,.99973,.99973,1.00026,1.00119,.99955,.99973,1.0006,.99911,1.0006,1.00026,.99972,1.00026,.99902,1.00041,.99973,.99999,1,1,1.00038,1.0005,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,1.00047,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],Ta={lineHeight:1.2,lineGap:.2},Fa=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.0044,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99971,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.01011,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99977,1,1,1.00026,.99969,.99972,.99981,.9998,1.0006,.99977,.99977,1.00022,.91155,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,.99966,1.00022,1.00032,1.00001,.99944,1.00026,1.00001,.99968,1.00001,1.00047,1,1.0006,1.00001,.99981,1.00101,1.00026,1.0006,.99948,.99981,1.00064,.99973,.99942,1.00101,1.00061,1.00026,1.00069,1.0006,1.00014,.99973,1.01322,.99973,1.00065,1.00026,1.00012,.99923,1,1.00064,1.00076,.99948,1.00055,1.00063,1.00007,.99943,1.0006,.99948,1.00026,.99948,.99943,1.00001,1.00001,1.00029,1.00038,1.00035,1.00001,1.0006,1.0006,.99973,.99978,1.00001,1.00057,.99989,.99967,.99964,.99967,.99977,.99999,.99977,1.00038,.99977,1.00001,.99973,1.00066,.99967,.99967,1.00041,.99998,.99999,.99977,1.00022,.99967,1.00001,.99977,1.00026,.99964,1.00031,1.00001,.99999,.99999,1,1.00023,1,1,.99999,1.00035,1.00001,.99999,.99973,.99977,.99999,1.00058,.99973,.99973,.99955,.9995,1.00026,1.00026,1.00032,.99989,1.00034,.99999,1.00026,1.00026,1.00026,.99973,.45998,.99973,1.00026,.99973,1.00001,.99999,.99982,.99994,.99996,1,1.00042,1.00044,1.00029,1.00023,.99973,.99973,1.00026,.99949,1.00002,.99973,1.0006,1.0006,1.0006,.99975,1.00026,1.00026,1.00032,.98685,.99973,1.00026,1,1,.99966,1.00044,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1,.99973,.99971,.99978,1,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00098,1,1,1,1.00049,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],Ia={lineHeight:1.35,lineGap:.2},Ea=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.0288,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,.99946,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.06311,.99973,1.00024,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,1.00041,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.89547,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00001,1,1.00054,.99977,1.00084,1.00007,.99973,1.00013,.99924,1.00001,1.00001,.99945,.91221,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00001,.99999,.99977,.99933,1.00022,1.00054,1.00001,1.00065,1.00026,1.00001,1.0001,1.00001,1.00052,1,1.0006,1.00001,.99945,.99897,.99968,.99924,1.00036,.99945,.99949,1,1.0006,.99897,.99918,.99968,.99911,.99924,1,.99962,1.01487,1,1.0005,.99973,1.00012,1.00043,1,.99995,.99994,1.00036,.99947,1.00019,1.00063,1.00025,.99924,1.00036,.99973,1.00036,1.00025,1.00001,1.00001,1.00027,1.0001,1.00068,1.00001,1.0006,1.0006,1,1.00008,.99957,.99972,.9994,.99954,.99975,1.00051,1.00001,1.00019,1.00001,1.0001,.99986,1.00001,1.00001,1.00038,.99954,.99954,.9994,1.00066,.99999,.99977,1.00022,1.00054,1.00001,.99977,1.00026,.99975,1.0001,1.00001,.99993,.9995,.99955,1.00016,.99978,.99974,1.00019,1.00022,.99955,1.00053,.99973,1.00089,1.00005,.99967,1.00048,.99973,1.00002,1.00034,.99973,.99973,.99964,1.00006,1.00066,.99947,.99973,.98894,.99973,1,.44898,1,.99946,1,1.00039,1.00082,.99991,.99991,.99985,1.00022,1.00023,1.00061,1.00006,.99966,.99973,.99973,.99973,1.00019,1.0008,1,.99924,.99924,.99924,.99983,1.00044,.99973,.99964,.98332,1,.99973,1,1,.99962,.99895,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,1.00423,.99925,.99999,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00049,1,1.00245,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,1.00003,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],Ma={lineHeight:1.35,lineGap:.2},Da=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.04596,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,1.00019,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.02572,.99973,1.00005,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,.99999,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.84533,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99928,1,.99977,1.00013,1.00055,.99947,.99945,.99941,.99924,1.00001,1.00001,1.0004,.91621,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00005,.99999,.99977,1.00015,1.00022,.99977,1.00001,.99973,1.00026,1.00001,1.00019,1.00001,.99946,1,1.0006,1.00001,.99978,1.00045,.99973,.99924,1.00023,.99978,.99966,1,1.00065,1.00045,1.00019,.99973,.99973,.99924,1,1,.96499,1,1.00055,.99973,1.00008,1.00027,1,.9997,.99995,1.00023,.99933,1.00019,1.00015,1.00031,.99924,1.00023,.99973,1.00023,1.00031,1.00001,.99928,1.00029,1.00092,1.00035,1.00001,1.0006,1.0006,1,.99988,.99975,1,1.00082,.99561,.9996,1.00035,1.00001,.99962,1.00001,1.00092,.99964,1.00001,.99963,.99999,1.00035,1.00035,1.00082,.99962,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.9996,.99967,1.00001,1.00034,1.00074,1.00054,1.00053,1.00063,.99971,.99962,1.00035,.99975,.99977,.99973,1.00043,.99953,1.0007,.99915,.99973,1.00008,.99892,1.00073,1.00073,1.00114,.99915,1.00073,.99955,.99973,1.00092,.99973,1,.99998,1,1.0003,1,1.00043,1.00001,.99969,1.0003,1,1.00035,1.00001,.9995,1,1.00092,.99973,.99973,.99973,1.0007,.9995,1,.99924,1.0006,.99924,.99972,1.00062,.99973,1.00114,1.00073,1,.99955,1,1,1.00047,.99968,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,.99925,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Oa={lineHeight:1.2,lineGap:.2},_a=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,719,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,785,556,556,278,722,556,556,611,278,611,278,611,385,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,465,722,333,853,906,474,825,927,838,278,722,722,601,719,667,611,722,778,278,722,667,833,722,644,778,722,667,600,611,667,821,667,809,802,278,667,615,451,611,278,582,615,610,556,606,475,460,611,541,278,558,556,612,556,445,611,766,619,520,684,446,582,715,576,753,845,278,582,611,582,845,667,669,885,567,711,667,278,276,556,1094,1062,875,610,722,622,719,722,719,722,567,712,667,904,626,719,719,610,702,833,722,778,719,667,722,611,622,854,667,730,703,1005,1019,870,979,719,711,1031,719,556,618,615,417,635,556,709,497,615,615,500,635,740,604,611,604,611,556,490,556,875,556,615,581,833,844,729,854,615,552,854,583,556,556,611,417,552,556,278,281,278,969,906,611,500,615,556,604,778,611,487,447,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1094,556,885,489,1115,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333],Pa=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Ra=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,740,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,782,556,556,278,722,556,556,611,278,611,278,611,396,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,333,722,333,854,906,473,844,930,847,278,722,722,610,671,667,611,722,778,278,722,667,833,722,657,778,718,667,590,611,667,822,667,829,781,278,667,620,479,611,278,591,620,621,556,610,479,492,611,558,278,566,556,603,556,450,611,712,605,532,664,409,591,704,578,773,834,278,591,611,591,834,667,667,886,614,719,667,278,278,556,1094,1042,854,622,719,677,719,722,708,722,614,722,667,927,643,719,719,615,687,833,722,778,719,667,722,611,677,781,667,729,708,979,989,854,1e3,708,719,1042,729,556,619,604,534,618,556,736,510,611,611,507,622,740,604,611,611,611,556,889,556,885,556,646,583,889,935,707,854,594,552,865,589,556,556,611,469,563,556,278,278,278,969,906,611,507,619,556,611,778,611,575,467,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1104,556,885,516,1146,1e3,768,600,834,834,834,834,999,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333],Ba=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Na=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,625,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,733,444,500,222,667,500,500,556,222,556,222,556,281,556,400,556,222,722,556,722,556,722,556,615,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,354,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,789,846,389,794,865,775,222,667,667,570,671,667,611,722,778,278,667,667,833,722,648,778,725,667,600,611,667,837,667,831,761,278,667,570,439,555,222,550,570,571,500,556,439,463,555,542,222,500,492,548,500,447,556,670,573,486,603,374,550,652,546,728,779,222,550,556,550,779,667,667,843,544,708,667,278,278,500,1066,982,844,589,715,639,724,667,651,667,544,704,667,917,614,715,715,589,686,833,722,778,725,667,722,611,639,795,667,727,673,920,923,805,886,651,694,1022,682,556,562,522,493,553,556,688,465,556,556,472,564,686,550,556,556,556,500,833,500,835,500,572,518,830,851,621,736,526,492,752,534,556,556,556,378,496,500,222,222,222,910,828,556,472,565,500,556,778,556,492,339,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1083,1e3,768,600,834,834,834,834,1e3,500,998,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,584,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285],La=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Ua=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,615,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,735,444,500,222,667,500,500,556,222,556,222,556,292,556,334,556,222,722,556,722,556,722,556,604,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,375,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,784,838,384,774,855,752,222,667,667,551,668,667,611,722,778,278,667,668,833,722,650,778,722,667,618,611,667,798,667,835,748,278,667,578,446,556,222,547,578,575,500,557,446,441,556,556,222,500,500,576,500,448,556,690,569,482,617,395,547,648,525,713,781,222,547,556,547,781,667,667,865,542,719,667,278,278,500,1057,1010,854,583,722,635,719,667,656,667,542,677,667,923,604,719,719,583,656,833,722,778,719,667,722,611,635,760,667,740,667,917,938,792,885,656,719,1010,722,556,573,531,365,583,556,669,458,559,559,438,583,688,552,556,542,556,500,458,500,823,500,573,521,802,823,625,719,521,510,750,542,556,556,556,365,510,500,222,278,222,906,812,556,438,559,500,552,778,556,489,411,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1073,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285],ja=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],$a=[1.36898,1,1,.72706,.80479,.83734,.98894,.99793,.9897,.93884,.86209,.94292,.94292,1.16661,1.02058,.93582,.96694,.93582,1.19137,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.78076,.78076,1.02058,1.02058,1.02058,.72851,.78966,.90838,.83637,.82391,.96376,.80061,.86275,.8768,.95407,1.0258,.73901,.85022,.83655,1.0156,.95546,.92179,.87107,.92179,.82114,.8096,.89713,.94438,.95353,.94083,.91905,.90406,.9446,.94292,1.18777,.94292,1.02058,.89903,.90088,.94938,.97898,.81093,.97571,.94938,1.024,.9577,.95933,.98621,1.0474,.97455,.98981,.9672,.95933,.9446,.97898,.97407,.97646,.78036,1.10208,.95442,.95298,.97579,.9332,.94039,.938,.80687,1.01149,.80687,1.02058,.80479,.99793,.99793,.99793,.99793,1.01149,1.00872,.90088,.91882,1.0213,.8361,1.02058,.62295,.54324,.89022,1.08595,1,1,.90088,1,.97455,.93582,.90088,1,1.05686,.8361,.99642,.99642,.99642,.72851,.90838,.90838,.90838,.90838,.90838,.90838,.868,.82391,.80061,.80061,.80061,.80061,1.0258,1.0258,1.0258,1.0258,.97484,.95546,.92179,.92179,.92179,.92179,.92179,1.02058,.92179,.94438,.94438,.94438,.94438,.90406,.86958,.98225,.94938,.94938,.94938,.94938,.94938,.94938,.9031,.81093,.94938,.94938,.94938,.94938,.98621,.98621,.98621,.98621,.93969,.95933,.9446,.9446,.9446,.9446,.9446,1.08595,.9446,.95442,.95442,.95442,.95442,.94039,.97898,.94039,.90838,.94938,.90838,.94938,.90838,.94938,.82391,.81093,.82391,.81093,.82391,.81093,.82391,.81093,.96376,.84313,.97484,.97571,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.8768,.9577,.8768,.9577,.8768,.9577,1,1,.95407,.95933,.97069,.95933,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,.887,1.01591,.73901,1.0474,1,1,.97455,.83655,.98981,1,1,.83655,.73977,.83655,.73903,.84638,1.033,.95546,.95933,1,1,.95546,.95933,.8271,.95417,.95933,.92179,.9446,.92179,.9446,.92179,.9446,.936,.91964,.82114,.97646,1,1,.82114,.97646,.8096,.78036,.8096,.78036,1,1,.8096,.78036,1,1,.89713,.77452,.89713,1.10208,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94083,.97579,.90406,.94039,.90406,.9446,.938,.9446,.938,.9446,.938,1,.99793,.90838,.94938,.868,.9031,.92179,.9446,1,1,.89713,1.10208,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90989,.9358,.91945,.83181,.75261,.87992,.82976,.96034,.83689,.97268,1.0078,.90838,.83637,.8019,.90157,.80061,.9446,.95407,.92436,1.0258,.85022,.97153,1.0156,.95546,.89192,.92179,.92361,.87107,.96318,.89713,.93704,.95638,.91905,.91709,.92796,1.0258,.93704,.94836,1.0373,.95933,1.0078,.95871,.94836,.96174,.92601,.9498,.98607,.95776,.95933,1.05453,1.0078,.98275,.9314,.95617,.91701,1.05993,.9446,.78367,.9553,1,.86832,1.0128,.95871,.99394,.87548,.96361,.86774,1.0078,.95871,.9446,.95871,.86774,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.94083,.97579,.94083,.97579,.94083,.97579,.90406,.94039,.96694,1,.89903,1,1,1,.93582,.93582,.93582,1,.908,.908,.918,.94219,.94219,.96544,1,1.285,1,1,.81079,.81079,1,1,.74854,1,1,1,1,.99793,1,1,1,.65,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.17173,1,.80535,.76169,1.02058,1.0732,1.05486,1,1,1.30692,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.16161,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Ha={lineHeight:1.2,lineGap:.2},Xa=[1.36898,1,1,.66227,.80779,.81625,.97276,.97276,.97733,.92222,.83266,.94292,.94292,1.16148,1.02058,.93582,.96694,.93582,1.17337,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.78076,.78076,1.02058,1.02058,1.02058,.71541,.76813,.85576,.80591,.80729,.94299,.77512,.83655,.86523,.92222,.98621,.71743,.81698,.79726,.98558,.92222,.90637,.83809,.90637,.80729,.76463,.86275,.90699,.91605,.9154,.85308,.85458,.90531,.94292,1.21296,.94292,1.02058,.89903,1.18616,.99613,.91677,.78216,.91677,.90083,.98796,.9135,.92168,.95381,.98981,.95298,.95381,.93459,.92168,.91513,.92004,.91677,.95077,.748,1.04502,.91677,.92061,.94236,.89544,.89364,.9,.80687,.8578,.80687,1.02058,.80779,.97276,.97276,.97276,.97276,.8578,.99973,1.18616,.91339,1.08074,.82891,1.02058,.55509,.71526,.89022,1.08595,1,1,1.18616,1,.96736,.93582,1.18616,1,1.04864,.82711,.99043,.99043,.99043,.71541,.85576,.85576,.85576,.85576,.85576,.85576,.845,.80729,.77512,.77512,.77512,.77512,.98621,.98621,.98621,.98621,.95961,.92222,.90637,.90637,.90637,.90637,.90637,1.02058,.90251,.90699,.90699,.90699,.90699,.85458,.83659,.94951,.99613,.99613,.99613,.99613,.99613,.99613,.85811,.78216,.90083,.90083,.90083,.90083,.95381,.95381,.95381,.95381,.9135,.92168,.91513,.91513,.91513,.91513,.91513,1.08595,.91677,.91677,.91677,.91677,.91677,.89364,.92332,.89364,.85576,.99613,.85576,.99613,.85576,.99613,.80729,.78216,.80729,.78216,.80729,.78216,.80729,.78216,.94299,.76783,.95961,.91677,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.86523,.9135,.86523,.9135,.86523,.9135,1,1,.92222,.92168,.92222,.92168,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.86036,.97096,.71743,.98981,1,1,.95298,.79726,.95381,1,1,.79726,.6894,.79726,.74321,.81691,1.0006,.92222,.92168,1,1,.92222,.92168,.79464,.92098,.92168,.90637,.91513,.90637,.91513,.90637,.91513,.909,.87514,.80729,.95077,1,1,.80729,.95077,.76463,.748,.76463,.748,1,1,.76463,.748,1,1,.86275,.72651,.86275,1.04502,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.9154,.94236,.85458,.89364,.85458,.90531,.9,.90531,.9,.90531,.9,1,.97276,.85576,.99613,.845,.85811,.90251,.91677,1,1,.86275,1.04502,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.00899,1.30628,.85576,.80178,.66862,.7927,.69323,.88127,.72459,.89711,.95381,.85576,.80591,.7805,.94729,.77512,.90531,.92222,.90637,.98621,.81698,.92655,.98558,.92222,.85359,.90637,.90976,.83809,.94523,.86275,.83509,.93157,.85308,.83392,.92346,.98621,.83509,.92886,.91324,.92168,.95381,.90646,.92886,.90557,.86847,.90276,.91324,.86842,.92168,.99531,.95381,.9224,.85408,.92699,.86847,1.0051,.91513,.80487,.93481,1,.88159,1.05214,.90646,.97355,.81539,.89398,.85923,.95381,.90646,.91513,.90646,.85923,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9154,.94236,.9154,.94236,.9154,.94236,.85458,.89364,.96694,1,.89903,1,1,1,.91782,.91782,.91782,1,.896,.896,.896,.9332,.9332,.95973,1,1.26,1,1,.80479,.80178,1,1,.85633,1,1,1,1,.97276,1,1,1,.698,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.14542,1,.79199,.78694,1.02058,1.03493,1.05486,1,1,1.23026,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.20006,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],qa={lineHeight:1.2,lineGap:.2},za=[1.36898,1,1,.65507,.84943,.85639,.88465,.88465,.86936,.88307,.86948,.85283,.85283,1.06383,1.02058,.75945,.9219,.75945,1.17337,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.75945,.75945,1.02058,1.02058,1.02058,.69046,.70926,.85158,.77812,.76852,.89591,.70466,.76125,.80094,.86822,.83864,.728,.77212,.79475,.93637,.87514,.8588,.76013,.8588,.72421,.69866,.77598,.85991,.80811,.87832,.78112,.77512,.8562,1.0222,1.18417,1.0222,1.27014,.89903,1.15012,.93859,.94399,.846,.94399,.81453,1.0186,.94219,.96017,1.03075,1.02175,.912,1.03075,.96998,.96017,.93859,.94399,.94399,.95493,.746,1.12658,.94578,.91,.979,.882,.882,.83,.85034,.83537,.85034,1.02058,.70869,.88465,.88465,.88465,.88465,.83537,.90083,1.15012,.9161,.94565,.73541,1.02058,.53609,.69353,.79519,1.08595,1,1,1.15012,1,.91974,.75945,1.15012,1,.9446,.73361,.9005,.9005,.9005,.62864,.85158,.85158,.85158,.85158,.85158,.85158,.773,.76852,.70466,.70466,.70466,.70466,.83864,.83864,.83864,.83864,.90561,.87514,.8588,.8588,.8588,.8588,.8588,1.02058,.85751,.85991,.85991,.85991,.85991,.77512,.76013,.88075,.93859,.93859,.93859,.93859,.93859,.93859,.8075,.846,.81453,.81453,.81453,.81453,.82424,.82424,.82424,.82424,.9278,.96017,.93859,.93859,.93859,.93859,.93859,1.08595,.8562,.94578,.94578,.94578,.94578,.882,.94578,.882,.85158,.93859,.85158,.93859,.85158,.93859,.76852,.846,.76852,.846,.76852,.846,.76852,.846,.89591,.8544,.90561,.94399,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.80094,.94219,.80094,.94219,.80094,.94219,1,1,.86822,.96017,.86822,.96017,.83864,.82424,.83864,.82424,.83864,.82424,.83864,1.03075,.83864,.82424,.81402,1.02738,.728,1.02175,1,1,.912,.79475,1.03075,1,1,.79475,.83911,.79475,.66266,.80553,1.06676,.87514,.96017,1,1,.87514,.96017,.86865,.87396,.96017,.8588,.93859,.8588,.93859,.8588,.93859,.867,.84759,.72421,.95493,1,1,.72421,.95493,.69866,.746,.69866,.746,1,1,.69866,.746,1,1,.77598,.88417,.77598,1.12658,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.87832,.979,.77512,.882,.77512,.8562,.83,.8562,.83,.8562,.83,1,.88465,.85158,.93859,.773,.8075,.85751,.8562,1,1,.77598,1.12658,1.15012,1.15012,1.15012,1.15012,1.15012,1.15313,1.15012,1.15012,1.15012,1.08106,1.03901,.85158,.77025,.62264,.7646,.65351,.86026,.69461,.89947,1.03075,.85158,.77812,.76449,.88836,.70466,.8562,.86822,.8588,.83864,.77212,.85308,.93637,.87514,.82352,.8588,.85701,.76013,.89058,.77598,.8156,.82565,.78112,.77899,.89386,.83864,.8156,.9486,.92388,.96186,1.03075,.91123,.9486,.93298,.878,.93942,.92388,.84596,.96186,.95119,1.03075,.922,.88787,.95829,.88,.93559,.93859,.78815,.93758,1,.89217,1.03737,.91123,.93969,.77487,.85769,.86799,1.03075,.91123,.93859,.91123,.86799,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87832,.979,.87832,.979,.87832,.979,.77512,.882,.9219,1,.89903,1,1,1,.87321,.87321,.87321,1,1.027,1.027,1.027,.86847,.86847,.79121,1,1.124,1,1,.73572,.73572,1,1,.85034,1,1,1,1,.88465,1,1,1,.669,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.04828,1,.74948,.75187,1.02058,.98391,1.02119,1,1,1.06233,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05233,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Wa={lineHeight:1.2,lineGap:.2},Ga=[1.36898,1,1,.76305,.82784,.94935,.89364,.92241,.89073,.90706,.98472,.85283,.85283,1.0664,1.02058,.74505,.9219,.74505,1.23456,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.74505,.74505,1.02058,1.02058,1.02058,.73002,.72601,.91755,.8126,.80314,.92222,.73764,.79726,.83051,.90284,.86023,.74,.8126,.84869,.96518,.91115,.8858,.79761,.8858,.74498,.73914,.81363,.89591,.83659,.89633,.85608,.8111,.90531,1.0222,1.22736,1.0222,1.27014,.89903,.90088,.86667,1.0231,.896,1.01411,.90083,1.05099,1.00512,.99793,1.05326,1.09377,.938,1.06226,1.00119,.99793,.98714,1.0231,1.01231,.98196,.792,1.19137,.99074,.962,1.01915,.926,.942,.856,.85034,.92006,.85034,1.02058,.69067,.92241,.92241,.92241,.92241,.92006,.9332,.90088,.91882,.93484,.75339,1.02058,.56866,.54324,.79519,1.08595,1,1,.90088,1,.95325,.74505,.90088,1,.97198,.75339,.91009,.91009,.91009,.66466,.91755,.91755,.91755,.91755,.91755,.91755,.788,.80314,.73764,.73764,.73764,.73764,.86023,.86023,.86023,.86023,.92915,.91115,.8858,.8858,.8858,.8858,.8858,1.02058,.8858,.89591,.89591,.89591,.89591,.8111,.79611,.89713,.86667,.86667,.86667,.86667,.86667,.86667,.86936,.896,.90083,.90083,.90083,.90083,.84224,.84224,.84224,.84224,.97276,.99793,.98714,.98714,.98714,.98714,.98714,1.08595,.89876,.99074,.99074,.99074,.99074,.942,1.0231,.942,.91755,.86667,.91755,.86667,.91755,.86667,.80314,.896,.80314,.896,.80314,.896,.80314,.896,.92222,.93372,.92915,1.01411,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.83051,1.00512,.83051,1.00512,.83051,1.00512,1,1,.90284,.99793,.90976,.99793,.86023,.84224,.86023,.84224,.86023,.84224,.86023,1.05326,.86023,.84224,.82873,1.07469,.74,1.09377,1,1,.938,.84869,1.06226,1,1,.84869,.83704,.84869,.81441,.85588,1.08927,.91115,.99793,1,1,.91115,.99793,.91887,.90991,.99793,.8858,.98714,.8858,.98714,.8858,.98714,.894,.91434,.74498,.98196,1,1,.74498,.98196,.73914,.792,.73914,.792,1,1,.73914,.792,1,1,.81363,.904,.81363,1.19137,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89633,1.01915,.8111,.942,.8111,.90531,.856,.90531,.856,.90531,.856,1,.92241,.91755,.86667,.788,.86936,.8858,.89876,1,1,.81363,1.19137,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90388,1.03901,.92138,.78105,.7154,.86169,.80513,.94007,.82528,.98612,1.06226,.91755,.8126,.81884,.92819,.73764,.90531,.90284,.8858,.86023,.8126,.91172,.96518,.91115,.83089,.8858,.87791,.79761,.89297,.81363,.88157,.89992,.85608,.81992,.94307,.86023,.88157,.95308,.98699,.99793,1.06226,.95817,.95308,.97358,.928,.98088,.98699,.92761,.99793,.96017,1.06226,.986,.944,.95978,.938,.96705,.98714,.80442,.98972,1,.89762,1.04552,.95817,.99007,.87064,.91879,.88888,1.06226,.95817,.98714,.95817,.88888,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89633,1.01915,.89633,1.01915,.89633,1.01915,.8111,.942,.9219,1,.89903,1,1,1,.93173,.93173,.93173,1,1.06304,1.06304,1.06904,.89903,.89903,.80549,1,1.156,1,1,.76575,.76575,1,1,.72458,1,1,1,1,.92241,1,1,1,.619,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.07257,1,.74705,.71119,1.02058,1.024,1.02119,1,1,1.1536,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05638,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Va={lineHeight:1.2,lineGap:.2},Ka=[1.76738,1,1,.99297,.9824,1.04016,1.06497,1.03424,.97529,1.17647,1.23203,1.1085,1.1085,1.16939,1.2107,.9754,1.21408,.9754,1.59578,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,.81378,.81378,1.2107,1.2107,1.2107,.71703,.97847,.97363,.88776,.8641,1.02096,.79795,.85132,.914,1.06085,1.1406,.8007,.89858,.83693,1.14889,1.09398,.97489,.92094,.97489,.90399,.84041,.95923,1.00135,1,1.06467,.98243,.90996,.99361,1.1085,1.56942,1.1085,1.2107,.74627,.94282,.96752,1.01519,.86304,1.01359,.97278,1.15103,1.01359,.98561,1.02285,1.02285,1.00527,1.02285,1.0302,.99041,1.0008,1.01519,1.01359,1.02258,.79104,1.16862,.99041,.97454,1.02511,.99298,.96752,.95801,.94856,1.16579,.94856,1.2107,.9824,1.03424,1.03424,1,1.03424,1.16579,.8727,1.3871,1.18622,1.10818,1.04478,1.2107,1.18622,.75155,.94994,1.28826,1.21408,1.21408,.91056,1,.91572,.9754,.64663,1.18328,1.24866,1.04478,1.14169,1.15749,1.17389,.71703,.97363,.97363,.97363,.97363,.97363,.97363,.93506,.8641,.79795,.79795,.79795,.79795,1.1406,1.1406,1.1406,1.1406,1.02096,1.09398,.97426,.97426,.97426,.97426,.97426,1.2107,.97489,1.00135,1.00135,1.00135,1.00135,.90996,.92094,1.02798,.96752,.96752,.96752,.96752,.96752,.96752,.93136,.86304,.97278,.97278,.97278,.97278,1.02285,1.02285,1.02285,1.02285,.97122,.99041,1,1,1,1,1,1.28826,1.0008,.99041,.99041,.99041,.99041,.96752,1.01519,.96752,.97363,.96752,.97363,.96752,.97363,.96752,.8641,.86304,.8641,.86304,.8641,.86304,.8641,.86304,1.02096,1.03057,1.02096,1.03517,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.914,1.01359,.914,1.01359,.914,1.01359,1,1,1.06085,.98561,1.06085,1.00879,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,.97138,1.08692,.8007,1.02285,1,1,1.00527,.83693,1.02285,1,1,.83693,.9455,.83693,.90418,.83693,1.13005,1.09398,.99041,1,1,1.09398,.99041,.96692,1.09251,.99041,.97489,1.0008,.97489,1.0008,.97489,1.0008,.93994,.97931,.90399,1.02258,1,1,.90399,1.02258,.84041,.79104,.84041,.79104,.84041,.79104,.84041,.79104,1,1,.95923,1.07034,.95923,1.16862,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.06467,1.02511,.90996,.96752,.90996,.99361,.95801,.99361,.95801,.99361,.95801,1.07733,1.03424,.97363,.96752,.93506,.93136,.97489,1.0008,1,1,.95923,1.16862,1.15103,1.15103,1.01173,1.03959,.75953,.81378,.79912,1.15103,1.21994,.95161,.87815,1.01149,.81525,.7676,.98167,1.01134,1.02546,.84097,1.03089,1.18102,.97363,.88776,.85134,.97826,.79795,.99361,1.06085,.97489,1.1406,.89858,1.0388,1.14889,1.09398,.86039,.97489,1.0595,.92094,.94793,.95923,.90996,.99346,.98243,1.02112,.95493,1.1406,.90996,1.03574,1.02597,1.0008,1.18102,1.06628,1.03574,1.0192,1.01932,1.00886,.97531,1.0106,1.0008,1.13189,1.18102,1.02277,.98683,1.0016,.99561,1.07237,1.0008,.90434,.99921,.93803,.8965,1.23085,1.06628,1.04983,.96268,1.0499,.98439,1.18102,1.06628,1.0008,1.06628,.98439,.79795,1,1,1,1,1,1,1,1,1,1,1,1,1.09466,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.97278,1,1,1,1,1,1,1,1,1,1,1,1,1.02065,1,1,1,1,1,1,1.06467,1.02511,1.06467,1.02511,1.06467,1.02511,.90996,.96752,1,1.21408,.89903,1,1,.75155,1.04394,1.04394,1.04394,1.04394,.98633,.98633,.98633,.73047,.73047,1.20642,.91211,1.25635,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.12454,.93503,1.03424,1.19687,1.03424,1,1,1,.771,1,1,1.15749,1.15749,1.15749,1.10948,.86279,.94434,.86279,.94434,.86182,1,1,1.16897,1,.96085,.90137,1.2107,1.18416,1.13973,.69825,.9716,2.10339,1.29004,1.29004,1.21172,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18874,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.09193,1.09193,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Ya={lineHeight:1.33008,lineGap:0},Ja=[1.76738,1,1,.98946,1.03959,1.04016,1.02809,1.036,.97639,1.10953,1.23203,1.11144,1.11144,1.16939,1.21237,.9754,1.21261,.9754,1.59754,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,.81378,.81378,1.21237,1.21237,1.21237,.73541,.97847,.97363,.89723,.87897,1.0426,.79429,.85292,.91149,1.05815,1.1406,.79631,.90128,.83853,1.04396,1.10615,.97552,.94436,.97552,.88641,.80527,.96083,1.00135,1,1.06777,.9817,.91142,.99361,1.11144,1.57293,1.11144,1.21237,.74627,1.31818,1.06585,.97042,.83055,.97042,.93503,1.1261,.97042,.97922,1.14236,.94552,1.01054,1.14236,1.02471,.97922,.94165,.97042,.97042,1.0276,.78929,1.1261,.97922,.95874,1.02197,.98507,.96752,.97168,.95107,1.16579,.95107,1.21237,1.03959,1.036,1.036,1,1.036,1.16579,.87357,1.31818,1.18754,1.26781,1.05356,1.21237,1.18622,.79487,.94994,1.29004,1.24047,1.24047,1.31818,1,.91484,.9754,1.31818,1.1349,1.24866,1.05356,1.13934,1.15574,1.17389,.73541,.97363,.97363,.97363,.97363,.97363,.97363,.94385,.87897,.79429,.79429,.79429,.79429,1.1406,1.1406,1.1406,1.1406,1.0426,1.10615,.97552,.97552,.97552,.97552,.97552,1.21237,.97552,1.00135,1.00135,1.00135,1.00135,.91142,.94436,.98721,1.06585,1.06585,1.06585,1.06585,1.06585,1.06585,.96705,.83055,.93503,.93503,.93503,.93503,1.14236,1.14236,1.14236,1.14236,.93125,.97922,.94165,.94165,.94165,.94165,.94165,1.29004,.94165,.97922,.97922,.97922,.97922,.96752,.97042,.96752,.97363,1.06585,.97363,1.06585,.97363,1.06585,.87897,.83055,.87897,.83055,.87897,.83055,.87897,.83055,1.0426,1.0033,1.0426,.97042,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.91149,.97042,.91149,.97042,.91149,.97042,1,1,1.05815,.97922,1.05815,.97922,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,.97441,1.04302,.79631,1.01582,1,1,1.01054,.83853,1.14236,1,1,.83853,1.09125,.83853,.90418,.83853,1.19508,1.10615,.97922,1,1,1.10615,.97922,1.01034,1.10466,.97922,.97552,.94165,.97552,.94165,.97552,.94165,.91602,.91981,.88641,1.0276,1,1,.88641,1.0276,.80527,.78929,.80527,.78929,.80527,.78929,.80527,.78929,1,1,.96083,1.05403,.95923,1.16862,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.06777,1.02197,.91142,.96752,.91142,.99361,.97168,.99361,.97168,.99361,.97168,1.23199,1.036,.97363,1.06585,.94385,.96705,.97552,.94165,1,1,.96083,1.1261,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,.95161,1.27126,1.00811,.83284,.77702,.99137,.95253,1.0347,.86142,1.07205,1.14236,.97363,.89723,.86869,1.09818,.79429,.99361,1.05815,.97552,1.1406,.90128,1.06662,1.04396,1.10615,.84918,.97552,1.04694,.94436,.98015,.96083,.91142,1.00356,.9817,1.01945,.98999,1.1406,.91142,1.04961,.9898,1.00639,1.14236,1.07514,1.04961,.99607,1.02897,1.008,.9898,.95134,1.00639,1.11121,1.14236,1.00518,.97981,1.02186,1,1.08578,.94165,.99314,.98387,.93028,.93377,1.35125,1.07514,1.10687,.93491,1.04232,1.00351,1.14236,1.07514,.94165,1.07514,1.00351,.79429,1,1,1,1,1,1,1,1,1,1,1,1,1.09097,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.93503,1,1,1,1,1,1,1,1,1,1,1,1,.96609,1,1,1,1,1,1,1.06777,1.02197,1.06777,1.02197,1.06777,1.02197,.91142,.96752,1,1.21261,.89903,1,1,.75155,1.04745,1.04745,1.04745,1.04394,.98633,.98633,.98633,.72959,.72959,1.20502,.91406,1.26514,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.09125,.93327,1.03336,1.16541,1.036,1,1,1,.771,1,1,1.15574,1.15574,1.15574,1.15574,.86364,.94434,.86279,.94434,.86224,1,1,1.16798,1,.96085,.90068,1.21237,1.18416,1.13904,.69825,.9716,2.10339,1.29004,1.29004,1.21339,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18775,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.13269,1.13269,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Za={lineHeight:1.33008,lineGap:0},Qa=[1.76738,1,1,.98946,1.14763,1.05365,1.06234,.96927,.92586,1.15373,1.18414,.91349,.91349,1.07403,1.17308,.78383,1.20088,.78383,1.42531,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78383,.78383,1.17308,1.17308,1.17308,.77349,.94565,.94729,.85944,.88506,.9858,.74817,.80016,.88449,.98039,.95782,.69238,.89898,.83231,.98183,1.03989,.96924,.86237,.96924,.80595,.74524,.86091,.95402,.94143,.98448,.8858,.83089,.93285,1.0949,1.39016,1.0949,1.45994,.74627,1.04839,.97454,.97454,.87207,.97454,.87533,1.06151,.97454,1.00176,1.16484,1.08132,.98047,1.16484,1.02989,1.01054,.96225,.97454,.97454,1.06598,.79004,1.16344,1.00351,.94629,.9973,.91016,.96777,.9043,.91082,.92481,.91082,1.17308,.95748,.96927,.96927,1,.96927,.92481,.80597,1.04839,1.23393,1.1781,.9245,1.17308,1.20808,.63218,.94261,1.24822,1.09971,1.09971,1.04839,1,.85273,.78032,1.04839,1.09971,1.22326,.9245,1.09836,1.13525,1.15222,.70424,.94729,.94729,.94729,.94729,.94729,.94729,.85498,.88506,.74817,.74817,.74817,.74817,.95782,.95782,.95782,.95782,.9858,1.03989,.96924,.96924,.96924,.96924,.96924,1.17308,.96924,.95402,.95402,.95402,.95402,.83089,.86237,.88409,.97454,.97454,.97454,.97454,.97454,.97454,.92916,.87207,.87533,.87533,.87533,.87533,.93146,.93146,.93146,.93146,.93854,1.01054,.96225,.96225,.96225,.96225,.96225,1.24822,.8761,1.00351,1.00351,1.00351,1.00351,.96777,.97454,.96777,.94729,.97454,.94729,.97454,.94729,.97454,.88506,.87207,.88506,.87207,.88506,.87207,.88506,.87207,.9858,.95391,.9858,.97454,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.88449,.97454,.88449,.97454,.88449,.97454,1,1,.98039,1.00176,.98039,1.00176,.95782,.93146,.95782,.93146,.95782,.93146,.95782,1.16484,.95782,.93146,.84421,1.12761,.69238,1.08132,1,1,.98047,.83231,1.16484,1,1,.84723,1.04861,.84723,.78755,.83231,1.23736,1.03989,1.01054,1,1,1.03989,1.01054,.9857,1.03849,1.01054,.96924,.96225,.96924,.96225,.96924,.96225,.92383,.90171,.80595,1.06598,1,1,.80595,1.06598,.74524,.79004,.74524,.79004,.74524,.79004,.74524,.79004,1,1,.86091,1.02759,.85771,1.16344,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.98448,.9973,.83089,.96777,.83089,.93285,.9043,.93285,.9043,.93285,.9043,1.31868,.96927,.94729,.97454,.85498,.92916,.96924,.8761,1,1,.86091,1.16344,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,.81965,.81965,.94729,.78032,.71022,.90883,.84171,.99877,.77596,1.05734,1.2,.94729,.85944,.82791,.9607,.74817,.93285,.98039,.96924,.95782,.89898,.98316,.98183,1.03989,.78614,.96924,.97642,.86237,.86075,.86091,.83089,.90082,.8858,.97296,1.01284,.95782,.83089,1.0976,1.04,1.03342,1.2,1.0675,1.0976,.98205,1.03809,1.05097,1.04,.95364,1.03342,1.05401,1.2,1.02148,1.0119,1.04724,1.0127,1.02732,.96225,.8965,.97783,.93574,.94818,1.30679,1.0675,1.11826,.99821,1.0557,1.0326,1.2,1.0675,.96225,1.0675,1.0326,.74817,1,1,1,1,1,1,1,1,1,1,1,1,1.03754,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87533,1,1,1,1,1,1,1,1,1,1,1,1,.98705,1,1,1,1,1,1,.98448,.9973,.98448,.9973,.98448,.9973,.83089,.96777,1,1.20088,.89903,1,1,.75155,.94945,.94945,.94945,.94945,1.12317,1.12317,1.12317,.67603,.67603,1.15621,.73584,1.21191,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87709,.96927,1.01473,.96927,1,1,1,.77295,1,1,1.09836,1.09836,1.09836,1.01522,.86321,.94434,.8649,.94434,.86182,1,1,1.083,1,.91578,.86438,1.17308,1.18416,1.14589,.69825,.97622,1.96791,1.24822,1.24822,1.17308,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.17984,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10742,1.10742,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],es={lineHeight:1.33008,lineGap:0},ts=[1.76738,1,1,.98594,1.02285,1.10454,1.06234,.96927,.92037,1.19985,1.2046,.90616,.90616,1.07152,1.1714,.78032,1.20088,.78032,1.40246,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78032,.78032,1.1714,1.1714,1.1714,.80597,.94084,.96706,.85944,.85734,.97093,.75842,.79936,.88198,.9831,.95782,.71387,.86969,.84636,1.07796,1.03584,.96924,.83968,.96924,.82826,.79649,.85771,.95132,.93119,.98965,.88433,.8287,.93365,1.08612,1.3638,1.08612,1.45786,.74627,.80499,.91484,1.05707,.92383,1.05882,.9403,1.12654,1.05882,1.01756,1.09011,1.09011,.99414,1.09011,1.034,1.01756,1.05356,1.05707,1.05882,1.04399,.84863,1.21968,1.01756,.95801,1.00068,.91797,.96777,.9043,.90351,.92105,.90351,1.1714,.85337,.96927,.96927,.99912,.96927,.92105,.80597,1.2434,1.20808,1.05937,.90957,1.1714,1.20808,.75155,.94261,1.24644,1.09971,1.09971,.84751,1,.85273,.78032,.61584,1.05425,1.17914,.90957,1.08665,1.11593,1.14169,.73381,.96706,.96706,.96706,.96706,.96706,.96706,.86035,.85734,.75842,.75842,.75842,.75842,.95782,.95782,.95782,.95782,.97093,1.03584,.96924,.96924,.96924,.96924,.96924,1.1714,.96924,.95132,.95132,.95132,.95132,.8287,.83968,.89049,.91484,.91484,.91484,.91484,.91484,.91484,.93575,.92383,.9403,.9403,.9403,.9403,.8717,.8717,.8717,.8717,1.00527,1.01756,1.05356,1.05356,1.05356,1.05356,1.05356,1.24644,.95923,1.01756,1.01756,1.01756,1.01756,.96777,1.05707,.96777,.96706,.91484,.96706,.91484,.96706,.91484,.85734,.92383,.85734,.92383,.85734,.92383,.85734,.92383,.97093,1.0969,.97093,1.05882,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.88198,1.05882,.88198,1.05882,.88198,1.05882,1,1,.9831,1.01756,.9831,1.01756,.95782,.8717,.95782,.8717,.95782,.8717,.95782,1.09011,.95782,.8717,.84784,1.11551,.71387,1.09011,1,1,.99414,.84636,1.09011,1,1,.84636,1.0536,.84636,.94298,.84636,1.23297,1.03584,1.01756,1,1,1.03584,1.01756,1.00323,1.03444,1.01756,.96924,1.05356,.96924,1.05356,.96924,1.05356,.93066,.98293,.82826,1.04399,1,1,.82826,1.04399,.79649,.84863,.79649,.84863,.79649,.84863,.79649,.84863,1,1,.85771,1.17318,.85771,1.21968,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.98965,1.00068,.8287,.96777,.8287,.93365,.9043,.93365,.9043,.93365,.9043,1.08571,.96927,.96706,.91484,.86035,.93575,.96924,.95923,1,1,.85771,1.21968,1.11437,1.11437,.93109,.91202,.60411,.84164,.55572,1.01173,.97361,.81818,.81818,.96635,.78032,.72727,.92366,.98601,1.03405,.77968,1.09799,1.2,.96706,.85944,.85638,.96491,.75842,.93365,.9831,.96924,.95782,.86969,.94152,1.07796,1.03584,.78437,.96924,.98715,.83968,.83491,.85771,.8287,.94492,.88433,.9287,1.0098,.95782,.8287,1.0625,.98248,1.03424,1.2,1.01071,1.0625,.95246,1.03809,1.04912,.98248,1.00221,1.03424,1.05443,1.2,1.04785,.99609,1.00169,1.05176,.99346,1.05356,.9087,1.03004,.95542,.93117,1.23362,1.01071,1.07831,1.02512,1.05205,1.03502,1.2,1.01071,1.05356,1.01071,1.03502,.75842,1,1,1,1,1,1,1,1,1,1,1,1,1.03719,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9403,1,1,1,1,1,1,1,1,1,1,1,1,1.04021,1,1,1,1,1,1,.98965,1.00068,.98965,1.00068,.98965,1.00068,.8287,.96777,1,1.20088,.89903,1,1,.75155,1.03077,1.03077,1.03077,1.03077,1.13196,1.13196,1.13196,.67428,.67428,1.16039,.73291,1.20996,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87796,.96927,1.01518,.96927,1,1,1,.77295,1,1,1.10539,1.10539,1.11358,1.06967,.86279,.94434,.86279,.94434,.86182,1,1,1.083,1,.91578,.86507,1.1714,1.18416,1.14589,.69825,.97622,1.9697,1.24822,1.24822,1.17238,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18083,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10938,1.10938,1,1,1,1.05425,1.09971,1.09971,1.09971,1,1,1,1,1,1,1,1,1,1,1],is={lineHeight:1.33008,lineGap:0},ns=getLookupTableFactory(function(e){e["MyriadPro-Regular"]=e["PdfJS-Fallback-Regular"]={name:"LiberationSans-Regular",factors:Ga,baseWidths:Ua,baseMapping:ja,metrics:Va},e["MyriadPro-Bold"]=e["PdfJS-Fallback-Bold"]={name:"LiberationSans-Bold",factors:$a,baseWidths:_a,baseMapping:Pa,metrics:Ha},e["MyriadPro-It"]=e["MyriadPro-Italic"]=e["PdfJS-Fallback-Italic"]={name:"LiberationSans-Italic",factors:za,baseWidths:Na,baseMapping:La,metrics:Wa},e["MyriadPro-BoldIt"]=e["MyriadPro-BoldItalic"]=e["PdfJS-Fallback-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:Xa,baseWidths:Ra,baseMapping:Ba,metrics:qa},e.ArialMT=e.Arial=e["Arial-Regular"]={name:"LiberationSans-Regular",baseWidths:Ua,baseMapping:ja},e["Arial-BoldMT"]=e["Arial-Bold"]={name:"LiberationSans-Bold",baseWidths:_a,baseMapping:Pa},e["Arial-ItalicMT"]=e["Arial-Italic"]={name:"LiberationSans-Italic",baseWidths:Na,baseMapping:La},e["Arial-BoldItalicMT"]=e["Arial-BoldItalic"]={name:"LiberationSans-BoldItalic",baseWidths:Ra,baseMapping:Ba},e["Calibri-Regular"]={name:"LiberationSans-Regular",factors:va,baseWidths:Ua,baseMapping:ja,metrics:Ca},e["Calibri-Bold"]={name:"LiberationSans-Bold",factors:ba,baseWidths:_a,baseMapping:Pa,metrics:ya},e["Calibri-Italic"]={name:"LiberationSans-Italic",factors:xa,baseWidths:Na,baseMapping:La,metrics:Sa},e["Calibri-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:wa,baseWidths:Ra,baseMapping:Ba,metrics:Aa},e["Segoeui-Regular"]={name:"LiberationSans-Regular",factors:ts,baseWidths:Ua,baseMapping:ja,metrics:is},e["Segoeui-Bold"]={name:"LiberationSans-Bold",factors:Ka,baseWidths:_a,baseMapping:Pa,metrics:Ya},e["Segoeui-Italic"]={name:"LiberationSans-Italic",factors:Qa,baseWidths:Na,baseMapping:La,metrics:es},e["Segoeui-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:Ja,baseWidths:Ra,baseMapping:Ba,metrics:Za},e["Helvetica-Regular"]=e.Helvetica={name:"LiberationSans-Regular",factors:Da,baseWidths:Ua,baseMapping:ja,metrics:Oa},e["Helvetica-Bold"]={name:"LiberationSans-Bold",factors:ka,baseWidths:_a,baseMapping:Pa,metrics:Ta},e["Helvetica-Italic"]={name:"LiberationSans-Italic",factors:Ea,baseWidths:Na,baseMapping:La,metrics:Ma},e["Helvetica-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:Fa,baseWidths:Ra,baseMapping:Ba,metrics:Ia}});function getXfaFontName(e){const t=normalizeFontName(e);return ns()[t]}function getXfaFontDict(e){const t=function(e){const t=getXfaFontName(e);if(!t)return null;const{baseWidths:i,baseMapping:n,factors:a}=t,s=a?i.map((e,t)=>e*a[t]):i;let r,o=-2;const l=[];for(const[e,t]of n.map((e,t)=>[e,t]).sort(([e],[t])=>e-t))-1!==e&&(e===o+1?(r.push(s[t]),o+=1):(o=e,r=[s[t]],l.push(e,r)));return l}(e),i=new Dict(null);i.set("BaseFont",Name.get(e)),i.set("Type",Name.get("Font")),i.set("Subtype",Name.get("CIDFontType2")),i.set("Encoding",Name.get("Identity-H")),i.set("CIDToGIDMap",Name.get("Identity")),i.set("W",t),i.set("FirstChar",t[0]),i.set("LastChar",t.at(-2)+t.at(-1).length-1);const n=new Dict(null);i.set("FontDescriptor",n);const a=new Dict(null);return a.set("Ordering","Identity"),a.set("Registry","Adobe"),a.set("Supplement",0),i.set("CIDSystemInfo",a),i}class PostScriptParser{constructor(e){this.lexer=e,this.operators=[],this.token=null,this.prev=null}nextToken(){this.prev=this.token,this.token=this.lexer.getToken()}accept(e){return this.token.type===e&&(this.nextToken(),!0)}expect(e){if(this.accept(e))return!0;throw new ti(`Unexpected symbol: found ${this.token.type} expected ${e}.`)}parse(){return this.nextToken(),this.expect(as.LBRACE),this.parseBlock(),this.expect(as.RBRACE),this.operators}parseBlock(){for(;;)if(this.accept(as.NUMBER))this.operators.push(this.prev.value);else if(this.accept(as.OPERATOR))this.operators.push(this.prev.value);else{if(!this.accept(as.LBRACE))return;this.parseCondition()}}parseCondition(){const e=this.operators.length;if(this.operators.push(null,null),this.parseBlock(),this.expect(as.RBRACE),this.accept(as.IF))this.operators[e]=this.operators.length,this.operators[e+1]="jz";else{if(!this.accept(as.LBRACE))throw new ti("PS Function: error parsing conditional.");{const t=this.operators.length;this.operators.push(null,null);const i=this.operators.length;this.parseBlock(),this.expect(as.RBRACE),this.expect(as.IFELSE),this.operators[t]=this.operators.length,this.operators[t+1]="j",this.operators[e]=i,this.operators[e+1]="jz"}}}}const as={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5};class PostScriptToken{static get opCache(){return shadow$1(this,"opCache",Object.create(null))}constructor(e,t){this.type=e,this.value=t}static getOperator(e){return PostScriptToken.opCache[e]||=new PostScriptToken(as.OPERATOR,e)}static get LBRACE(){return shadow$1(this,"LBRACE",new PostScriptToken(as.LBRACE,"{"))}static get RBRACE(){return shadow$1(this,"RBRACE",new PostScriptToken(as.RBRACE,"}"))}static get IF(){return shadow$1(this,"IF",new PostScriptToken(as.IF,"IF"))}static get IFELSE(){return shadow$1(this,"IFELSE",new PostScriptToken(as.IFELSE,"IFELSE"))}}class PostScriptLexer{constructor(e){this.stream=e,this.nextChar(),this.strBuf=[]}nextChar(){return this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(t<0)return ci;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!isWhiteSpace(t))break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new PostScriptToken(as.NUMBER,this.getNumber());case 123:return this.nextChar(),PostScriptToken.LBRACE;case 125:return this.nextChar(),PostScriptToken.RBRACE}const i=this.strBuf;for(i.length=0,i[0]=String.fromCharCode(t);(t=this.nextChar())>=0&&(t>=65&&t<=90||t>=97&&t<=122);)i.push(String.fromCharCode(t));const n=i.join("");switch(n.toLowerCase()){case"if":return PostScriptToken.IF;case"ifelse":return PostScriptToken.IFELSE;default:return PostScriptToken.getOperator(n)}}getNumber(){let e=this.currentChar;const t=this.strBuf;for(t.length=0,t[0]=String.fromCharCode(e);(e=this.nextChar())>=0&&(e>=48&&e<=57||45===e||46===e);)t.push(String.fromCharCode(e));const i=parseFloat(t.join(""));if(isNaN(i))throw new ti(`Invalid floating point number: ${i}`);return i}}class BaseLocalCache{constructor(e){this._onlyRefs=!0===e?.onlyRefs,this._onlyRefs||(this._nameRefMap=new Map,this._imageMap=new Map),this._imageCache=new RefSetCache}getByName(e){this._onlyRefs&&unreachable$1("Should not call `getByName` method.");const t=this._nameRefMap.get(e);return t?this.getByRef(t):this._imageMap.get(e)||null}getByRef(e){return this._imageCache.get(e)||null}set(e,t,i){unreachable$1("Abstract method `set` called.")}}class LocalImageCache extends BaseLocalCache{set(e,t=null,i){if("string"!=typeof e)throw new Error('LocalImageCache.set - expected "name" argument.');if(t){if(this._imageCache.has(t))return;return this._nameRefMap.set(e,t),void this._imageCache.put(t,i)}this._imageMap.has(e)||this._imageMap.set(e,i)}}class LocalColorSpaceCache extends BaseLocalCache{set(e=null,t=null,i){if("string"!=typeof e&&!t)throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');if(t){if(this._imageCache.has(t))return;return null!==e&&this._nameRefMap.set(e,t),void this._imageCache.put(t,i)}this._imageMap.has(e)||this._imageMap.set(e,i)}}class LocalFunctionCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,i){if(!t)throw new Error('LocalFunctionCache.set - expected "ref" argument.');this._imageCache.has(t)||this._imageCache.put(t,i)}}class LocalGStateCache extends BaseLocalCache{set(e,t=null,i){if("string"!=typeof e)throw new Error('LocalGStateCache.set - expected "name" argument.');if(t){if(this._imageCache.has(t))return;return this._nameRefMap.set(e,t),void this._imageCache.put(t,i)}this._imageMap.has(e)||this._imageMap.set(e,i)}}class LocalTilingPatternCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,i){if(!t)throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');this._imageCache.has(t)||this._imageCache.put(t,i)}}class RegionalImageCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,i){if(!t)throw new Error('RegionalImageCache.set - expected "ref" argument.');this._imageCache.has(t)||this._imageCache.put(t,i)}}class GlobalColorSpaceCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,i){if(!t)throw new Error('GlobalColorSpaceCache.set - expected "ref" argument.');this._imageCache.has(t)||this._imageCache.put(t,i)}clear(){this._imageCache.clear()}}class GlobalImageCache{static NUM_PAGES_THRESHOLD=2;static MIN_IMAGES_TO_CACHE=10;static MAX_BYTE_SIZE=5e7;#X=new RefSet;constructor(){this._refCache=new RefSetCache,this._imageCache=new RefSetCache}get#q(){let e=0;for(const t of this._imageCache)e+=t.byteSize;return e}get#z(){return!(this._imageCache.size<GlobalImageCache.MIN_IMAGES_TO_CACHE)&&!(this.#q<GlobalImageCache.MAX_BYTE_SIZE)}shouldCache(e,t){let i=this._refCache.get(e);return i||(i=new Set,this._refCache.put(e,i)),i.add(t),!(i.size<GlobalImageCache.NUM_PAGES_THRESHOLD)&&!(!this._imageCache.has(e)&&this.#z)}addDecodeFailed(e){this.#X.put(e)}hasDecodeFailed(e){return this.#X.has(e)}addByteSize(e,t){const i=this._imageCache.get(e);i&&(i.byteSize||(i.byteSize=t))}getData(e,t){const i=this._refCache.get(e);if(!i)return null;if(i.size<GlobalImageCache.NUM_PAGES_THRESHOLD)return null;const n=this._imageCache.get(e);return n?(i.add(t),n):null}setData(e,t){if(!this._refCache.has(e))throw new Error('GlobalImageCache.setData - expected "shouldCache" to have been called.');this._imageCache.has(e)||(this.#z?warn$1("GlobalImageCache.setData - cache limit reached."):this._imageCache.put(e,t))}clear(e=!1){e||(this.#X.clear(),this._refCache.clear()),this._imageCache.clear()}}class PDFFunctionFactory{constructor({xref:e,isEvalSupported:t=!0}){this.xref=e,this.isEvalSupported=!1!==t}create(e,t=!1){let i,n;if(e instanceof Ref?i=e:e instanceof Dict?i=e.objId:e instanceof BaseStream&&(i=e.dict?.objId),i){const e=this._localFunctionCache.getByRef(i);if(e)return e}const a=this.xref.fetchIfRef(e);if(Array.isArray(a)){if(!t)throw new Error('PDFFunctionFactory.create - expected "parseArray" argument.');n=PDFFunction.parseArray(this,a)}else n=PDFFunction.parse(this,a);return i&&this._localFunctionCache.set(null,i,n),n}get _localFunctionCache(){return shadow$1(this,"_localFunctionCache",new LocalFunctionCache)}}function toNumberArray(e){return Array.isArray(e)?isNumberArray(e,null)?e:e.map(e=>+e):null}class PDFFunction{static getSampleArray(e,t,i,n){let a,s,r=1;for(a=0,s=e.length;a<s;a++)r*=e[a];r*=t;const o=new Array(r);let l=0,c=0;const h=1/(2**i-1),d=n.getBytes((r*i+7)/8);let u=0;for(a=0;a<r;a++){for(;l<i;)c<<=8,c|=d[u++],l+=8;l-=i,o[a]=(c>>l)*h,c&=(1<<l)-1}return o}static parse(e,t){const i=t.dict||t;switch(i.get("FunctionType")){case 0:return this.constructSampled(e,t,i);case 1:break;case 2:return this.constructInterpolated(e,i);case 3:return this.constructStiched(e,i);case 4:return this.constructPostScript(e,t,i)}throw new ti("Unknown type of function")}static parseArray(e,t){const{xref:i}=e,n=[];for(const a of t)n.push(this.parse(e,i.fetchIfRef(a)));return function(e,t,i,a){for(let s=0,r=n.length;s<r;s++)n[s](e,t,i,a+s)}}static constructSampled(e,t,i){function toMultiArray(e){const t=e.length,i=[];let n=0;for(let a=0;a<t;a+=2)i[n++]=[e[a],e[a+1]];return i}function interpolate(e,t,i,n,a){return n+(a-n)/(i-t)*(e-t)}let n=toNumberArray(i.getArray("Domain")),a=toNumberArray(i.getArray("Range"));if(!n||!a)throw new ti("No domain or range");const s=n.length/2,r=a.length/2;n=toMultiArray(n),a=toMultiArray(a);const o=toNumberArray(i.getArray("Size")),l=i.get("BitsPerSample"),c=i.get("Order")||1;1!==c&&info$1("No support for cubic spline interpolation: "+c);let h=toNumberArray(i.getArray("Encode"));if(h)h=toMultiArray(h);else{h=[];for(let e=0;e<s;++e)h.push([0,o[e]-1])}let d=toNumberArray(i.getArray("Decode"));d=d?toMultiArray(d):a;const u=this.getSampleArray(o,r,l,t);return function(e,t,i,l){const c=1<<s,g=new Float64Array(c).fill(1),f=new Uint32Array(c);let p,m,b=r,y=1;for(p=0;p<s;++p){const i=n[p][0],a=n[p][1];let s=interpolate(MathClamp$1(e[t+p],i,a),i,a,h[p][0],h[p][1]);const r=o[p];s=MathClamp$1(s,0,r-1);const l=s<r-1?Math.floor(s):s-1,d=l+1-s,u=s-l,w=l*b,x=w+b;for(m=0;m<c;m++)m&y?(g[m]*=u,f[m]+=x):(g[m]*=d,f[m]+=w);b*=r,y<<=1}for(m=0;m<r;++m){let e=0;for(p=0;p<c;p++)e+=u[f[p]+m]*g[p];e=interpolate(e,0,1,d[m][0],d[m][1]),i[l+m]=MathClamp$1(e,a[m][0],a[m][1])}}}static constructInterpolated(e,t){const i=toNumberArray(t.getArray("C0"))||[0],n=toNumberArray(t.getArray("C1"))||[1],a=t.get("N"),s=[];for(let e=0,t=i.length;e<t;++e)s.push(n[e]-i[e]);const r=s.length;return function(e,t,n,o){const l=1===a?e[t]:e[t]**a;for(let e=0;e<r;++e)n[o+e]=i[e]+l*s[e]}}static constructStiched(e,t){const i=toNumberArray(t.getArray("Domain"));if(!i)throw new ti("No domain");if(1!==i.length/2)throw new ti("Bad domain for stiched function");const{xref:n}=e,a=[];for(const i of t.get("Functions"))a.push(this.parse(e,n.fetchIfRef(i)));const s=toNumberArray(t.getArray("Bounds")),r=toNumberArray(t.getArray("Encode")),o=new Float32Array(1);return function(e,t,n,l){const c=MathClamp$1(e[t],i[0],i[1]),h=s.length;let d;for(d=0;d<h&&!(c<s[d]);++d);let u=i[0];d>0&&(u=s[d-1]);let g=i[1];d<s.length&&(g=s[d]);const f=r[2*d],p=r[2*d+1];o[0]=u===g?f:f+(c-u)*(p-f)/(g-u),a[d](o,0,n,l)}}static constructPostScript(e,t,i){const n=toNumberArray(i.getArray("Domain")),a=toNumberArray(i.getArray("Range"));if(!n)throw new ti("No domain.");if(!a)throw new ti("No range.");const s=new PostScriptLexer(t),r=new PostScriptParser(s).parse();if(e.isEvalSupported&&FeatureTest.isEvalSupported){const e=(new PostScriptCompiler).compile(r,n,a);if(e)return new Function("src","srcOffset","dest","destOffset",e)}info$1("Unable to compile PS function");const o=a.length>>1,l=n.length>>1,c=new PostScriptEvaluator(r),h=Object.create(null);let d=8192;const u=new Float32Array(l);return function(e,t,i,n){let s,r,g="";const f=u;for(s=0;s<l;s++)r=e[t+s],f[s]=r,g+=r+"_";const p=h[g];if(void 0!==p)return void i.set(p,n);const m=new Float32Array(o),b=c.execute(f),y=b.length-o;for(s=0;s<o;s++){r=b[y+s];let e=a[2*s];r<e?r=e:(e=a[2*s+1],r>e&&(r=e)),m[s]=r}d>0&&(d--,h[g]=m),i.set(m,n)}}}function isPDFFunction(e){let t;if(e instanceof Dict)t=e;else{if(!(e instanceof BaseStream))return!1;t=e.dict}return t.has("FunctionType")}class PostScriptStack{static MAX_STACK_SIZE=100;constructor(e){this.stack=e?Array.from(e):[]}push(e){if(this.stack.length>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");this.stack.push(e)}pop(){if(this.stack.length<=0)throw new Error("PostScript function stack underflow.");return this.stack.pop()}copy(e){if(this.stack.length+e>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");const t=this.stack;for(let i=t.length-e,n=e-1;n>=0;n--,i++)t.push(t[i])}index(e){this.push(this.stack[this.stack.length-e-1])}roll(e,t){const i=this.stack,n=i.length-e,a=i.length-1,s=n+(t-Math.floor(t/e)*e);for(let e=n,t=a;e<t;e++,t--){const n=i[e];i[e]=i[t],i[t]=n}for(let e=n,t=s-1;e<t;e++,t--){const n=i[e];i[e]=i[t],i[t]=n}for(let e=s,t=a;e<t;e++,t--){const n=i[e];i[e]=i[t],i[t]=n}}}class PostScriptEvaluator{constructor(e){this.operators=e}execute(e){const t=new PostScriptStack(e);let i=0;const n=this.operators,a=n.length;let s,r,o;for(;i<a;)if(s=n[i++],"number"!=typeof s)switch(s){case"jz":o=t.pop(),r=t.pop(),r||(i=o);break;case"j":r=t.pop(),i=r;break;case"abs":r=t.pop(),t.push(Math.abs(r));break;case"add":o=t.pop(),r=t.pop(),t.push(r+o);break;case"and":o=t.pop(),r=t.pop(),"boolean"==typeof r&&"boolean"==typeof o?t.push(r&&o):t.push(r&o);break;case"atan":o=t.pop(),r=t.pop(),r=Math.atan2(r,o)/Math.PI*180,r<0&&(r+=360),t.push(r);break;case"bitshift":o=t.pop(),r=t.pop(),r>0?t.push(r<<o):t.push(r>>o);break;case"ceiling":r=t.pop(),t.push(Math.ceil(r));break;case"copy":r=t.pop(),t.copy(r);break;case"cos":r=t.pop(),t.push(Math.cos(r%360/180*Math.PI));break;case"cvi":r=0|t.pop(),t.push(r);break;case"cvr":break;case"div":o=t.pop(),r=t.pop(),t.push(r/o);break;case"dup":t.copy(1);break;case"eq":o=t.pop(),r=t.pop(),t.push(r===o);break;case"exch":t.roll(2,1);break;case"exp":o=t.pop(),r=t.pop(),t.push(r**o);break;case"false":t.push(!1);break;case"floor":r=t.pop(),t.push(Math.floor(r));break;case"ge":o=t.pop(),r=t.pop(),t.push(r>=o);break;case"gt":o=t.pop(),r=t.pop(),t.push(r>o);break;case"idiv":o=t.pop(),r=t.pop(),t.push(r/o|0);break;case"index":r=t.pop(),t.index(r);break;case"le":o=t.pop(),r=t.pop(),t.push(r<=o);break;case"ln":r=t.pop(),t.push(Math.log(r));break;case"log":r=t.pop(),t.push(Math.log10(r));break;case"lt":o=t.pop(),r=t.pop(),t.push(r<o);break;case"mod":o=t.pop(),r=t.pop(),t.push(r%o);break;case"mul":o=t.pop(),r=t.pop(),t.push(r*o);break;case"ne":o=t.pop(),r=t.pop(),t.push(r!==o);break;case"neg":r=t.pop(),t.push(-r);break;case"not":r=t.pop(),"boolean"==typeof r?t.push(!r):t.push(~r);break;case"or":o=t.pop(),r=t.pop(),"boolean"==typeof r&&"boolean"==typeof o?t.push(r||o):t.push(r|o);break;case"pop":t.pop();break;case"roll":o=t.pop(),r=t.pop(),t.roll(r,o);break;case"round":r=t.pop(),t.push(Math.round(r));break;case"sin":r=t.pop(),t.push(Math.sin(r%360/180*Math.PI));break;case"sqrt":r=t.pop(),t.push(Math.sqrt(r));break;case"sub":o=t.pop(),r=t.pop(),t.push(r-o);break;case"true":t.push(!0);break;case"truncate":r=t.pop(),r=r<0?Math.ceil(r):Math.floor(r),t.push(r);break;case"xor":o=t.pop(),r=t.pop(),"boolean"==typeof r&&"boolean"==typeof o?t.push(r!==o):t.push(r^o);break;default:throw new ti(`Unknown operator ${s}`)}else t.push(s);return t.stack}}class AstNode{constructor(e){this.type=e}visit(e){unreachable$1("abstract method")}}class AstArgument extends AstNode{constructor(e,t,i){super("args"),this.index=e,this.min=t,this.max=i}visit(e){e.visitArgument(this)}}class AstLiteral extends AstNode{constructor(e){super("literal"),this.number=e,this.min=e,this.max=e}visit(e){e.visitLiteral(this)}}class AstBinaryOperation extends AstNode{constructor(e,t,i,n,a){super("binary"),this.op=e,this.arg1=t,this.arg2=i,this.min=n,this.max=a}visit(e){e.visitBinaryOperation(this)}}class AstMin extends AstNode{constructor(e,t){super("max"),this.arg=e,this.min=e.min,this.max=t}visit(e){e.visitMin(this)}}class AstVariable extends AstNode{constructor(e,t,i){super("var"),this.index=e,this.min=t,this.max=i}visit(e){e.visitVariable(this)}}class AstVariableDefinition extends AstNode{constructor(e,t){super("definition"),this.variable=e,this.arg=t}visit(e){e.visitVariableDefinition(this)}}class ExpressionBuilderVisitor{constructor(){this.parts=[]}visitArgument(e){this.parts.push("Math.max(",e.min,", Math.min(",e.max,", src[srcOffset + ",e.index,"]))")}visitVariable(e){this.parts.push("v",e.index)}visitLiteral(e){this.parts.push(e.number)}visitBinaryOperation(e){this.parts.push("("),e.arg1.visit(this),this.parts.push(" ",e.op," "),e.arg2.visit(this),this.parts.push(")")}visitVariableDefinition(e){this.parts.push("var "),e.variable.visit(this),this.parts.push(" = "),e.arg.visit(this),this.parts.push(";")}visitMin(e){this.parts.push("Math.min("),e.arg.visit(this),this.parts.push(", ",e.max,")")}toString(){return this.parts.join("")}}function buildAddOperation(e,t){return"literal"===t.type&&0===t.number?e:"literal"===e.type&&0===e.number?t:"literal"===t.type&&"literal"===e.type?new AstLiteral(e.number+t.number):new AstBinaryOperation("+",e,t,e.min+t.min,e.max+t.max)}function buildMulOperation(e,t){if("literal"===t.type){if(0===t.number)return new AstLiteral(0);if(1===t.number)return e;if("literal"===e.type)return new AstLiteral(e.number*t.number)}if("literal"===e.type){if(0===e.number)return new AstLiteral(0);if(1===e.number)return t}const i=Math.min(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max),n=Math.max(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max);return new AstBinaryOperation("*",e,t,i,n)}function buildSubOperation(e,t){if("literal"===t.type){if(0===t.number)return e;if("literal"===e.type)return new AstLiteral(e.number-t.number)}return"binary"===t.type&&"-"===t.op&&"literal"===e.type&&1===e.number&&"literal"===t.arg1.type&&1===t.arg1.number?t.arg2:new AstBinaryOperation("-",e,t,e.min-t.max,e.max-t.min)}function buildMinOperation(e,t){return e.min>=t?new AstLiteral(t):e.max<=t?e:new AstMin(e,t)}class PostScriptCompiler{compile(e,t,i){const n=[],a=[],s=t.length>>1,r=i.length>>1;let o,l,c,h,d,u,g,f,p=0;for(let e=0;e<s;e++)n.push(new AstArgument(e,t[2*e],t[2*e+1]));for(let t=0,i=e.length;t<i;t++)if(f=e[t],"number"!=typeof f)switch(f){case"add":if(n.length<2)return null;h=n.pop(),c=n.pop(),n.push(buildAddOperation(c,h));break;case"cvr":if(n.length<1)return null;break;case"mul":if(n.length<2)return null;h=n.pop(),c=n.pop(),n.push(buildMulOperation(c,h));break;case"sub":if(n.length<2)return null;h=n.pop(),c=n.pop(),n.push(buildSubOperation(c,h));break;case"exch":if(n.length<2)return null;d=n.pop(),u=n.pop(),n.push(d,u);break;case"pop":if(n.length<1)return null;n.pop();break;case"index":if(n.length<1)return null;if(c=n.pop(),"literal"!==c.type)return null;if(o=c.number,o<0||!Number.isInteger(o)||n.length<o)return null;if(d=n[n.length-o-1],"literal"===d.type||"var"===d.type){n.push(d);break}g=new AstVariable(p++,d.min,d.max),n[n.length-o-1]=g,n.push(g),a.push(new AstVariableDefinition(g,d));break;case"dup":if(n.length<1)return null;if("number"==typeof e[t+1]&&"gt"===e[t+2]&&e[t+3]===t+7&&"jz"===e[t+4]&&"pop"===e[t+5]&&e[t+6]===e[t+1]){c=n.pop(),n.push(buildMinOperation(c,e[t+1])),t+=6;break}if(d=n.at(-1),"literal"===d.type||"var"===d.type){n.push(d);break}g=new AstVariable(p++,d.min,d.max),n[n.length-1]=g,n.push(g),a.push(new AstVariableDefinition(g,d));break;case"roll":if(n.length<2)return null;if(h=n.pop(),c=n.pop(),"literal"!==h.type||"literal"!==c.type)return null;if(l=h.number,o=c.number,o<=0||!Number.isInteger(o)||!Number.isInteger(l)||n.length<o)return null;if(l=(l%o+o)%o,0===l)break;n.push(...n.splice(n.length-o,o-l));break;default:return null}else n.push(new AstLiteral(f));if(n.length!==r)return null;const m=[];for(const e of a){const t=new ExpressionBuilderVisitor;e.visit(t),m.push(t.toString())}for(let e=0,t=n.length;e<t;e++){const t=n[e],a=new ExpressionBuilderVisitor;t.visit(a);const s=i[2*e],r=i[2*e+1],o=[a.toString()];s>t.min&&(o.unshift("Math.max(",s,", "),o.push(")")),r<t.max&&(o.unshift("Math.min(",r,", "),o.push(")")),o.unshift("dest[destOffset + ",e,"] = "),o.push(";"),m.push(o.join(""))}return m.join("\n")}}const ss=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],rs=["AN","AN","AN","AN","AN","AN","ON","ON","AL","ET","ET","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL"];function isOdd(e){return!!(1&e)}function isEven(e){return!(1&e)}function findUnequal(e,t,i){let n,a;for(n=t,a=e.length;n<a;++n)if(e[n]!==i)return n;return n}function reverseValues(e,t,i){for(let n=t,a=i-1;n<a;++n,--a){const t=e[n];e[n]=e[a],e[a]=t}}function createBidiText(e,t,i=!1){let n="ltr";return i?n="ttb":t||(n="rtl"),{str:e,dir:n}}const os=[],ls=[];function bidi(e,t=-1,i=!1){let n=!0;const a=e.length;if(0===a||i)return createBidiText(e,n,i);os.length=a,ls.length=a;let s,r,o=0;for(s=0;s<a;++s){os[s]=e.charAt(s);const t=e.charCodeAt(s);let i="L";t<=255?i=ss[t]:1424<=t&&t<=1524?i="R":1536<=t&&t<=1791?(i=rs[255&t],i||warn$1("Bidi: invalid Unicode character "+t.toString(16))):(1792<=t&&t<=2220||64336<=t&&t<=65023||65136<=t&&t<=65279)&&(i="AL"),"R"!==i&&"AL"!==i&&"AN"!==i||o++,ls[s]=i}if(0===o)return n=!0,createBidiText(e,n);-1===t&&(o/a<.3&&a>4?(n=!0,t=0):(n=!1,t=1));const l=[];for(s=0;s<a;++s)l[s]=t;const c=isOdd(t)?"R":"L",h=c,d=h;let u,g=h;for(s=0;s<a;++s)"NSM"===ls[s]?ls[s]=g:g=ls[s];for(g=h,s=0;s<a;++s)u=ls[s],"EN"===u?ls[s]="AL"===g?"AN":"EN":"R"!==u&&"L"!==u&&"AL"!==u||(g=u);for(s=0;s<a;++s)u=ls[s],"AL"===u&&(ls[s]="R");for(s=1;s<a-1;++s)"ES"===ls[s]&&"EN"===ls[s-1]&&"EN"===ls[s+1]&&(ls[s]="EN"),"CS"!==ls[s]||"EN"!==ls[s-1]&&"AN"!==ls[s-1]||ls[s+1]!==ls[s-1]||(ls[s]=ls[s-1]);for(s=0;s<a;++s)if("EN"===ls[s]){for(let e=s-1;e>=0&&"ET"===ls[e];--e)ls[e]="EN";for(let e=s+1;e<a&&"ET"===ls[e];++e)ls[e]="EN"}for(s=0;s<a;++s)u=ls[s],"WS"!==u&&"ES"!==u&&"ET"!==u&&"CS"!==u||(ls[s]="ON");for(g=h,s=0;s<a;++s)u=ls[s],"EN"===u?ls[s]="L"===g?"L":"EN":"R"!==u&&"L"!==u||(g=u);for(s=0;s<a;++s)if("ON"===ls[s]){const e=findUnequal(ls,s+1,"ON");let t=h;s>0&&(t=ls[s-1]);let i=d;e+1<a&&(i=ls[e+1]),"L"!==t&&(t="R"),"L"!==i&&(i="R"),t===i&&ls.fill(t,s,e),s=e-1}for(s=0;s<a;++s)"ON"===ls[s]&&(ls[s]=c);for(s=0;s<a;++s)u=ls[s],isEven(l[s])?"R"===u?l[s]+=1:"AN"!==u&&"EN"!==u||(l[s]+=2):"L"!==u&&"AN"!==u&&"EN"!==u||(l[s]+=1);let f,p=-1,m=99;for(s=0,r=l.length;s<r;++s)f=l[s],p<f&&(p=f),m>f&&isOdd(f)&&(m=f);for(f=p;f>=m;--f){let e=-1;for(s=0,r=l.length;s<r;++s)l[s]<f?e>=0&&(reverseValues(os,e,s),e=-1):e<0&&(e=s);e>=0&&reverseValues(os,e,l.length)}for(s=0,r=os.length;s<r;++s){const e=os[s];"<"!==e&&">"!==e||(os[s]="")}return createBidiText(os.join(""),n)}let cs=class CssFontInfo{#R;#W;#G;static strings=["fontFamily","fontWeight","italicAngle"];static write(e){const t=new TextEncoder,i={};let n=0;for(const a of CssFontInfo.strings){const s=t.encode(e[a]);i[a]=s,n+=4+s.length}const a=new ArrayBuffer(n),s=new Uint8Array(a),r=new DataView(a);let o=0;for(const e of CssFontInfo.strings){const t=i[e],n=t.length;r.setUint32(o,n),s.set(t,o+4),o+=4+n}return assert$1(o===a.byteLength,"CssFontInfo.write: Buffer overflow"),a}constructor(e){this.#R=e,this.#W=new DataView(this.#R),this.#G=new TextDecoder}#V(e){assert$1(e<CssFontInfo.strings.length,"Invalid string index");let t=0;for(let i=0;i<e;i++)t+=this.#W.getUint32(t)+4;const i=this.#W.getUint32(t);return this.#G.decode(new Uint8Array(this.#R,t+4,i))}get fontFamily(){return this.#V(0)}get fontWeight(){return this.#V(1)}get italicAngle(){return this.#V(2)}},hs=class SystemFontInfo{#R;#W;#G;static strings=["css","loadedName","baseFontName","src"];static write(e){const t=new TextEncoder,i={};let n=0;for(const a of SystemFontInfo.strings){const s=t.encode(e[a]);i[a]=s,n+=4+s.length}n+=4;let a,s,r=1+n;e.style&&(a=t.encode(e.style.style),s=t.encode(e.style.weight),r+=4+a.length+4+s.length);const o=new ArrayBuffer(r),l=new Uint8Array(o),c=new DataView(o);let h=0;c.setUint8(h++,e.guessFallback?1:0),c.setUint32(h,0),h+=4,n=0;for(const e of SystemFontInfo.strings){const t=i[e],a=t.length;n+=4+a,c.setUint32(h,a),l.set(t,h+4),h+=4+a}return c.setUint32(h-n-4,n),e.style&&(c.setUint32(h,a.length),l.set(a,h+4),h+=4+a.length,c.setUint32(h,s.length),l.set(s,h+4),h+=4+s.length),assert$1(h<=o.byteLength,"SubstitionInfo.write: Buffer overflow"),o.transferToFixedLength(h)}constructor(e){this.#R=e,this.#W=new DataView(this.#R),this.#G=new TextDecoder}get guessFallback(){return 0!==this.#W.getUint8(0)}#V(e){assert$1(e<SystemFontInfo.strings.length,"Invalid string index");let t=5;for(let i=0;i<e;i++)t+=this.#W.getUint32(t)+4;const i=this.#W.getUint32(t);return this.#G.decode(new Uint8Array(this.#R,t+4,i))}get css(){return this.#V(0)}get loadedName(){return this.#V(1)}get baseFontName(){return this.#V(2)}get src(){return this.#V(3)}get style(){let e=1;e+=4+this.#W.getUint32(e);const t=this.#W.getUint32(e),i=this.#G.decode(new Uint8Array(this.#R,e+4,t));e+=4+t;const n=this.#W.getUint32(e);return{style:i,weight:this.#G.decode(new Uint8Array(this.#R,e+4,n))}}},ds=class FontInfo{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static#K=Math.ceil(2*this.bools.length/8);static#Y=this.#K+8*this.numbers.length;static#J=this.#Y+1+8;static#Z=this.#J+1+48;static#Q=this.#Z+1+6;#R;#G;#W;constructor({data:e,extra:t}){this.#R=e,this.#G=new TextDecoder,this.#W=new DataView(this.#R),t&&Object.assign(this,t)}#ee(e){assert$1(e<FontInfo.bools.length,"Invalid boolean index");const t=Math.floor(e/4),i=2*e%8,n=this.#W.getUint8(t)>>i&3;return 0===n?void 0:2===n}get black(){return this.#ee(0)}get bold(){return this.#ee(1)}get disableFontFace(){return this.#ee(2)}get fontExtraProperties(){return this.#ee(3)}get isInvalidPDFjsFont(){return this.#ee(4)}get isType3Font(){return this.#ee(5)}get italic(){return this.#ee(6)}get missingFile(){return this.#ee(7)}get remeasure(){return this.#ee(8)}get vertical(){return this.#ee(9)}#te(e){return assert$1(e<FontInfo.numbers.length,"Invalid number index"),this.#W.getFloat64(FontInfo.#K+8*e)}get ascent(){return this.#te(0)}get defaultWidth(){return this.#te(1)}get descent(){return this.#te(2)}get bbox(){let e=FontInfo.#Y;if(0===this.#W.getUint8(e))return;e+=1;const t=[];for(let i=0;i<4;i++)t.push(this.#W.getInt16(e,!0)),e+=2;return t}get fontMatrix(){let e=FontInfo.#J;if(0===this.#W.getUint8(e))return;e+=1;const t=[];for(let i=0;i<6;i++)t.push(this.#W.getFloat64(e,!0)),e+=8;return t}get defaultVMetrics(){let e=FontInfo.#Z;if(0===this.#W.getUint8(e))return;e+=1;const t=[];for(let i=0;i<3;i++)t.push(this.#W.getInt16(e,!0)),e+=2;return t}#V(e){assert$1(e<FontInfo.strings.length,"Invalid string index");let t=FontInfo.#Q+4;for(let i=0;i<e;i++)t+=this.#W.getUint32(t)+4;const i=this.#W.getUint32(t),n=new Uint8Array(i);return n.set(new Uint8Array(this.#R,t+4,i)),this.#G.decode(n)}get fallbackName(){return this.#V(0)}get loadedName(){return this.#V(1)}get mimetype(){return this.#V(2)}get name(){return this.#V(3)}get data(){let e=FontInfo.#Q;e+=4+this.#W.getUint32(e);e+=4+this.#W.getUint32(e);e+=4+this.#W.getUint32(e);const t=this.#W.getUint32(e);if(0!==t)return new Uint8Array(this.#R,e+4,t)}clearData(){let e=FontInfo.#Q;e+=4+this.#W.getUint32(e);e+=4+this.#W.getUint32(e);e+=4+this.#W.getUint32(e);const t=this.#W.getUint32(e);new Uint8Array(this.#R,e+4,t).fill(0),this.#W.setUint32(e,0)}get cssFontInfo(){let e=FontInfo.#Q;e+=4+this.#W.getUint32(e);e+=4+this.#W.getUint32(e);const t=this.#W.getUint32(e);if(0===t)return null;const i=new Uint8Array(t);return i.set(new Uint8Array(this.#R,e+4,t)),new cs(i.buffer)}get systemFontInfo(){let e=FontInfo.#Q;e+=4+this.#W.getUint32(e);const t=this.#W.getUint32(e);if(0===t)return null;const i=new Uint8Array(t);return i.set(new Uint8Array(this.#R,e+4,t)),new hs(i.buffer)}static write(e){const t=e.systemFontInfo?hs.write(e.systemFontInfo):null,i=e.cssFontInfo?cs.write(e.cssFontInfo):null,n=new TextEncoder,a={};let s=0;for(const t of FontInfo.strings)a[t]=n.encode(e[t]),s+=4+a[t].length;const r=FontInfo.#Q+4+s+4+(t?t.byteLength:0)+4+(i?i.byteLength:0)+4+(e.data?e.data.length:0),o=new ArrayBuffer(r),l=new Uint8Array(o),c=new DataView(o);let h=0;const d=FontInfo.bools.length;let u=0,g=0;for(let t=0;t<d;t++){const i=e[FontInfo.bools[t]];u|=(void 0===i?0:i?2:1)<<g,g+=2,8!==g&&t!==d-1||(c.setUint8(h++,u),u=0,g=0)}assert$1(h===FontInfo.#K,"FontInfo.write: Boolean properties offset mismatch");for(const t of FontInfo.numbers)c.setFloat64(h,e[t]),h+=8;if(assert$1(h===FontInfo.#Y,"FontInfo.write: Number properties offset mismatch"),e.bbox){c.setUint8(h++,4);for(const t of e.bbox)c.setInt16(h,t,!0),h+=2}else c.setUint8(h++,0),h+=8;if(assert$1(h===FontInfo.#J,"FontInfo.write: BBox properties offset mismatch"),e.fontMatrix){c.setUint8(h++,6);for(const t of e.fontMatrix)c.setFloat64(h,t,!0),h+=8}else c.setUint8(h++,0),h+=48;if(assert$1(h===FontInfo.#Z,"FontInfo.write: FontMatrix properties offset mismatch"),e.defaultVMetrics){c.setUint8(h++,1);for(const t of e.defaultVMetrics)c.setInt16(h,t,!0),h+=2}else c.setUint8(h++,0),h+=6;assert$1(h===FontInfo.#Q,"FontInfo.write: DefaultVMetrics properties offset mismatch"),c.setUint32(FontInfo.#Q,0),h+=4;for(const e of FontInfo.strings){const t=a[e],i=t.length;c.setUint32(h,i),l.set(t,h+4),h+=4+i}if(c.setUint32(FontInfo.#Q,h-FontInfo.#Q-4),t){const e=t.byteLength;c.setUint32(h,e),assert$1(h+4+e<=o.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),l.set(new Uint8Array(t),h+4),h+=4+e}else c.setUint32(h,0),h+=4;if(i){const e=i.byteLength;c.setUint32(h,e),assert$1(h+4+e<=o.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),l.set(new Uint8Array(i),h+4),h+=4+e}else c.setUint32(h,0),h+=4;return void 0===e.data?(c.setUint32(h,0),h+=4):(c.setUint32(h,e.data.length),l.set(e.data,h+4),h+=4+e.data.length),assert$1(h<=o.byteLength,"FontInfo.write: Buffer overflow"),o.transferToFixedLength(h)}};const us={style:"normal",weight:"normal"},gs={style:"normal",weight:"bold"},fs={style:"italic",weight:"normal"},ps={style:"italic",weight:"bold"},ms=new Map([["Times-Roman",{local:["Times New Roman","Times-Roman","Times","Liberation Serif","Nimbus Roman","Nimbus Roman L","Tinos","Thorndale","TeX Gyre Termes","FreeSerif","Linux Libertine O","Libertinus Serif","DejaVu Serif","Bitstream Vera Serif","Ubuntu"],style:us,ultimate:"serif"}],["Times-Bold",{alias:"Times-Roman",style:gs,ultimate:"serif"}],["Times-Italic",{alias:"Times-Roman",style:fs,ultimate:"serif"}],["Times-BoldItalic",{alias:"Times-Roman",style:ps,ultimate:"serif"}],["Helvetica",{local:["Helvetica","Helvetica Neue","Arial","Arial Nova","Liberation Sans","Arimo","Nimbus Sans","Nimbus Sans L","A030","TeX Gyre Heros","FreeSans","DejaVu Sans","Albany","Bitstream Vera Sans","Arial Unicode MS","Microsoft Sans Serif","Apple Symbols","Cantarell"],path:"LiberationSans-Regular.ttf",style:us,ultimate:"sans-serif"}],["Helvetica-Bold",{alias:"Helvetica",path:"LiberationSans-Bold.ttf",style:gs,ultimate:"sans-serif"}],["Helvetica-Oblique",{alias:"Helvetica",path:"LiberationSans-Italic.ttf",style:fs,ultimate:"sans-serif"}],["Helvetica-BoldOblique",{alias:"Helvetica",path:"LiberationSans-BoldItalic.ttf",style:ps,ultimate:"sans-serif"}],["Courier",{local:["Courier","Courier New","Liberation Mono","Nimbus Mono","Nimbus Mono L","Cousine","Cumberland","TeX Gyre Cursor","FreeMono","Linux Libertine Mono O","Libertinus Mono"],style:us,ultimate:"monospace"}],["Courier-Bold",{alias:"Courier",style:gs,ultimate:"monospace"}],["Courier-Oblique",{alias:"Courier",style:fs,ultimate:"monospace"}],["Courier-BoldOblique",{alias:"Courier",style:ps,ultimate:"monospace"}],["ArialBlack",{local:["Arial Black"],style:{style:"normal",weight:"900"},fallback:"Helvetica-Bold"}],["ArialBlack-Bold",{alias:"ArialBlack"}],["ArialBlack-Italic",{alias:"ArialBlack",style:{style:"italic",weight:"900"},fallback:"Helvetica-BoldOblique"}],["ArialBlack-BoldItalic",{alias:"ArialBlack-Italic"}],["ArialNarrow",{local:["Arial Narrow","Liberation Sans Narrow","Helvetica Condensed","Nimbus Sans Narrow","TeX Gyre Heros Cn"],style:us,fallback:"Helvetica"}],["ArialNarrow-Bold",{alias:"ArialNarrow",style:gs,fallback:"Helvetica-Bold"}],["ArialNarrow-Italic",{alias:"ArialNarrow",style:fs,fallback:"Helvetica-Oblique"}],["ArialNarrow-BoldItalic",{alias:"ArialNarrow",style:ps,fallback:"Helvetica-BoldOblique"}],["Calibri",{local:["Calibri","Carlito"],style:us,fallback:"Helvetica"}],["Calibri-Bold",{alias:"Calibri",style:gs,fallback:"Helvetica-Bold"}],["Calibri-Italic",{alias:"Calibri",style:fs,fallback:"Helvetica-Oblique"}],["Calibri-BoldItalic",{alias:"Calibri",style:ps,fallback:"Helvetica-BoldOblique"}],["Wingdings",{local:["Wingdings","URW Dingbats"],style:us}],["Wingdings-Regular",{alias:"Wingdings"}],["Wingdings-Bold",{alias:"Wingdings"}]]),bs=new Map([["Arial-Black","ArialBlack"]]);function getFamilyName(e){const t=new Set(["thin","extralight","ultralight","demilight","semilight","light","book","regular","normal","medium","demibold","semibold","bold","extrabold","ultrabold","black","heavy","extrablack","ultrablack","roman","italic","oblique","ultracondensed","extracondensed","condensed","semicondensed","normal","semiexpanded","expanded","extraexpanded","ultraexpanded","bolditalic"]);return e.split(/[- ,+]+/g).filter(e=>!t.has(e.toLowerCase())).join(" ")}function generateFont({alias:e,local:t,path:i,fallback:n,style:a,ultimate:s},r,o,l=!0,c=!0,h=""){const d={style:null,ultimate:null};if(t){const e=h?` ${h}`:"";for(const i of t)r.push(`local(${i}${e})`)}if(e){const t=ms.get(e),s=h||function(e){switch(e){case gs:return"Bold";case fs:return"Italic";case ps:return"Bold Italic";default:if("bold"===e?.weight)return"Bold";if("italic"===e?.style)return"Italic"}return""}(a);Object.assign(d,generateFont(t,r,o,l&&!n,c&&!i,s))}if(a&&(d.style=a),s&&(d.ultimate=s),l&&n){const e=ms.get(n),{ultimate:t}=generateFont(e,r,o,l,c&&!i,h);d.ultimate||=t}return c&&i&&o&&r.push(`url(${o}${i})`),d}function getFontSubstitution(e,t,i,n,a,s){if(n.startsWith("InvalidPDFjsFont_"))return null;"TrueType"!==s&&"Type1"!==s||!/^[A-Z]{6}\+/.test(n)||(n=n.slice(7));const r=n=normalizeFontName(n);let o=e.get(r);if(o)return o;let l=ms.get(n);if(!l)for(const[e,t]of bs)if(n.startsWith(e)){n=`${t}${n.substring(e.length)}`,l=ms.get(n);break}let c=!1;l||(l=ms.get(a),c=!0);const h=`${t.getDocId()}_s${t.createFontId()}`;if(!l){if(!validateFontName(n))return warn$1(`Cannot substitute the font because of its name: ${n}`),e.set(r,null),null;const t=/bold/gi.test(n),i=/oblique|italic/gi.test(n),a=t&&i&&ps||t&&gs||i&&fs||us;return o={css:`"${getFamilyName(n)}",${h}`,guessFallback:!0,loadedName:h,baseFontName:n,src:`local(${n})`,style:a},e.set(r,o),o}const d=[];c&&validateFontName(n)&&d.push(`local(${n})`);const{style:u,ultimate:g}=generateFont(l,d,i),f=null===g,p=f?"":`,${g}`;return o={css:`"${getFamilyName(n)}",${h}${p}`,guessFallback:f,loadedName:h,baseFontName:n,src:d.join(","),style:u},e.set(r,o),o}const ys=3285377520,ws=4294901760,As=65535;let xs=class{constructor(e){this.h1=e?4294967295&e:ys,this.h2=e?4294967295&e:ys}update(e){let t,i;if("string"==typeof e){t=new Uint8Array(2*e.length),i=0;for(let n=0,a=e.length;n<a;n++){const a=e.charCodeAt(n);a<=255?t[i++]=a:(t[i++]=a>>>8,t[i++]=255&a)}}else{if(!ArrayBuffer.isView(e))throw new Error("Invalid data format, must be a string or TypedArray.");t=e.slice(),i=t.byteLength}const n=i>>2,a=i-4*n,s=new Uint32Array(t.buffer,0,n);let r=0,o=0,l=this.h1,c=this.h2;const h=3432918353,d=461845907,u=11601,g=13715;for(let e=0;e<n;e++)1&e?(r=s[e],r=r*h&ws|r*u&As,r=r<<15|r>>>17,r=r*d&ws|r*g&As,l^=r,l=l<<13|l>>>19,l=5*l+3864292196):(o=s[e],o=o*h&ws|o*u&As,o=o<<15|o>>>17,o=o*d&ws|o*g&As,c^=o,c=c<<13|c>>>19,c=5*c+3864292196);switch(r=0,a){case 3:r^=t[4*n+2]<<16;case 2:r^=t[4*n+1]<<8;case 1:r^=t[4*n],r=r*h&ws|r*u&As,r=r<<15|r>>>17,r=r*d&ws|r*g&As,1&n?l^=r:c^=r}this.h1=l,this.h2=c}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&ws|36045*e&As,t=4283543511*t&ws|(2950163797*(t<<16|e>>>16)&ws)>>>16,e^=t>>>1,e=444984403*e&ws|60499*e&As,t=3301882366*t&ws|(3120437893*(t<<16|e>>>16)&ws)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}};function resizeImageMask(e,t,i,n,a,s){const r=a*s;let o;o=t<=8?new Uint8Array(r):t<=16?new Uint16Array(r):new Uint32Array(r);const l=i/a,c=n/s;let h,d,u,g,f=0;const p=new Uint16Array(a),m=i;for(h=0;h<a;h++)p[h]=Math.floor(h*l);for(h=0;h<s;h++)for(u=Math.floor(h*c)*m,d=0;d<a;d++)g=u+p[d],o[f++]=e[g];return o}class PDFImage{constructor({xref:e,res:t,image:i,isInline:n=!1,smask:a=null,mask:s=null,isMask:r=!1,pdfFunctionFactory:o,globalColorSpaceCache:l,localColorSpaceCache:c}){this.image=i;const h=i.dict,d=h.get("F","Filter");let u;if(d instanceof Name)u=d.name;else if(Array.isArray(d)){const t=e.fetchIfRef(d[0]);t instanceof Name&&(u=t.name)}switch(u){case"JPXDecode":({width:i.width,height:i.height,componentsCount:i.numComps,bitsPerComponent:i.bitsPerComponent}=JpxImage.parseImageProperties(i.stream)),i.stream.reset();const e=ImageResizer.getReducePowerForJPX(i.width,i.height,i.numComps);if(this.jpxDecoderOptions={numComponents:0,isIndexedColormap:!1,smaskInData:h.has("SMaskInData"),reducePower:e},e){const t=2**e;i.width=Math.ceil(i.width/t),i.height=Math.ceil(i.height/t)}break;case"JBIG2Decode":i.bitsPerComponent=1,i.numComps=1}let g=h.get("W","Width"),f=h.get("H","Height");if(Number.isInteger(i.width)&&i.width>0&&Number.isInteger(i.height)&&i.height>0&&(i.width!==g||i.height!==f))warn$1("PDFImage - using the Width/Height of the image data, rather than the image dictionary."),g=i.width,f=i.height;else{const e="number"==typeof g&&g>0,t="number"==typeof f&&f>0;if(!e||!t){if(!i.fallbackDims)throw new ti(`Invalid image width: ${g} or height: ${f}`);warn$1("PDFImage - using the Width/Height of the parent image, for SMask/Mask data."),e||(g=i.fallbackDims.width),t||(f=i.fallbackDims.height)}}this.width=g,this.height=f,this.interpolate=h.get("I","Interpolate"),this.imageMask=h.get("IM","ImageMask")||!1,this.matte=h.get("Matte")||!1;let p=i.bitsPerComponent;if(!p&&(p=h.get("BPC","BitsPerComponent"),!p)){if(!this.imageMask)throw new ti(`Bits per component missing in image: ${this.imageMask}`);p=1}if(this.bpc=p,!this.imageMask){let a=h.getRaw("CS")||h.getRaw("ColorSpace");const s=!!a;if(s)this.jpxDecoderOptions?.smaskInData&&(a=Name.get("DeviceRGBA"));else if(this.jpxDecoderOptions)a=Name.get("DeviceRGBA");else switch(i.numComps){case 1:a=Name.get("DeviceGray");break;case 3:a=Name.get("DeviceRGB");break;case 4:a=Name.get("DeviceCMYK");break;default:throw new Error(`Images with ${i.numComps} color components not supported.`)}this.colorSpace=ColorSpaceUtils.parse({cs:a,xref:e,resources:n?t:null,pdfFunctionFactory:o,globalColorSpaceCache:l,localColorSpaceCache:c}),this.numComps=this.colorSpace.numComps,this.jpxDecoderOptions&&(this.jpxDecoderOptions.numComponents=s?this.numComps:0,this.jpxDecoderOptions.isIndexedColormap="Indexed"===this.colorSpace.name)}if(this.decode=h.getArray("D","Decode"),this.needsDecode=!1,this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,p)||r&&!ColorSpace.isDefaultDecode(this.decode,1))){this.needsDecode=!0;const e=(1<<p)-1;this.decodeCoefficients=[],this.decodeAddends=[];const t="Indexed"===this.colorSpace?.name;for(let i=0,n=0;i<this.decode.length;i+=2,++n){const a=this.decode[i],s=this.decode[i+1];this.decodeCoefficients[n]=t?(s-a)/e:s-a,this.decodeAddends[n]=t?a:e*a}}if(a)a.fallbackDims??={width:g,height:f},this.smask=new PDFImage({xref:e,res:t,image:a,isInline:n,pdfFunctionFactory:o,globalColorSpaceCache:l,localColorSpaceCache:c});else if(s)if(s instanceof BaseStream){s.dict.get("IM","ImageMask")?(s.fallbackDims??={width:g,height:f},this.mask=new PDFImage({xref:e,res:t,image:s,isInline:n,isMask:!0,pdfFunctionFactory:o,globalColorSpaceCache:l,localColorSpaceCache:c})):warn$1("Ignoring /Mask in image without /ImageMask.")}else this.mask=s}static async buildImage({xref:e,res:t,image:i,isInline:n=!1,pdfFunctionFactory:a,globalColorSpaceCache:s,localColorSpaceCache:r}){const o=i;let l=null,c=null;const h=i.dict.get("SMask"),d=i.dict.get("Mask");return h?h instanceof BaseStream?l=h:warn$1("Unsupported /SMask format."):d&&(d instanceof BaseStream||Array.isArray(d)?c=d:warn$1("Unsupported /Mask format.")),new PDFImage({xref:e,res:t,image:o,isInline:n,smask:l,mask:c,pdfFunctionFactory:a,globalColorSpaceCache:s,localColorSpaceCache:r})}static async createMask({image:e,isOffscreenCanvasSupported:t=!1}){const{dict:i}=e,n=i.get("W","Width"),a=i.get("H","Height"),s=i.get("I","Interpolate"),r=i.getArray("D","Decode"),o=r?.[0]>0,l=(n+7>>3)*a,c=e.getBytes(l),h=1===n&&1===a&&o===(0===c.length||!!(128&c[0]));if(h)return{isSingleOpaquePixel:h};if(t){if(ImageResizer.needsToBeResized(n,a)){const e=new Uint8ClampedArray(n*a*4);return convertBlackAndWhiteToRGBA$1({src:c,dest:e,width:n,height:a,nonBlackColor:0,inverseDecode:o}),ImageResizer.createImage({kind:k,data:e,width:n,height:a,interpolate:s})}const e=new OffscreenCanvas(n,a),t=e.getContext("2d"),i=t.createImageData(n,a);convertBlackAndWhiteToRGBA$1({src:c,dest:i.data,width:n,height:a,nonBlackColor:0,inverseDecode:o}),t.putImageData(i,0,0);return{data:null,width:n,height:a,interpolate:s,bitmap:e.transferToImageBitmap()}}const d=c.byteLength;let u;if(e instanceof DecodeStream&&(!o||l===d)?u=c:o?(u=new Uint8Array(l),u.set(c),u.fill(255,d)):u=new Uint8Array(c),o)for(let e=0;e<d;e++)u[e]^=255;return{data:u,width:n,height:a,interpolate:s}}get drawWidth(){return Math.max(this.width,this.smask?.width||0,this.mask?.width||0)}get drawHeight(){return Math.max(this.height,this.smask?.height||0,this.mask?.height||0)}decodeBuffer(e){const t=this.bpc,i=this.numComps,n=this.decodeAddends,a=this.decodeCoefficients,s=(1<<t)-1;let r,o;if(1===t){for(r=0,o=e.length;r<o;r++)e[r]=+!e[r];return}let l=0;for(r=0,o=this.width*this.height;r<o;r++)for(let t=0;t<i;t++)e[l]=MathClamp$1(n[t]+e[l]*a[t],0,s),l++}getComponents(e){const t=this.bpc;if(8===t)return e;const i=this.width,n=this.height,a=this.numComps,s=i*n*a;let r,o=0;r=t<=8?new Uint8Array(s):t<=16?new Uint16Array(s):new Uint32Array(s);const l=i*a,c=(1<<t)-1;let h,d,u=0;if(1===t){let t,i,a;for(let s=0;s<n;s++){for(i=u+(-8&l),a=u+l;u<i;)d=e[o++],r[u]=d>>7&1,r[u+1]=d>>6&1,r[u+2]=d>>5&1,r[u+3]=d>>4&1,r[u+4]=d>>3&1,r[u+5]=d>>2&1,r[u+6]=d>>1&1,r[u+7]=1&d,u+=8;if(u<a)for(d=e[o++],t=128;u<a;)r[u++]=+!!(d&t),t>>=1}}else{let i=0;for(d=0,u=0,h=s;u<h;++u){for(u%l===0&&(d=0,i=0);i<t;)d=d<<8|e[o++],i+=8;const n=i-t;let a=d>>n;a<0?a=0:a>c&&(a=c),r[u]=a,d&=(1<<n)-1,i=n}}return r}async fillOpacity(e,t,i,n,a){const s=this.smask,r=this.mask;let o,l,c,h,d,u;if(s)l=s.width,c=s.height,o=new Uint8ClampedArray(l*c),await s.fillGrayBuffer(o),l===t&&c===i||(o=resizeImageMask(o,s.bpc,l,c,t,i));else if(r)if(r instanceof PDFImage){for(l=r.width,c=r.height,o=new Uint8ClampedArray(l*c),r.numComps=1,await r.fillGrayBuffer(o),h=0,d=l*c;h<d;++h)o[h]=255-o[h];l===t&&c===i||(o=resizeImageMask(o,r.bpc,l,c,t,i))}else{if(!Array.isArray(r))throw new ti("Unknown mask format.");{o=new Uint8ClampedArray(t*i);const e=this.numComps;for(h=0,d=t*i;h<d;++h){let t=0;const i=h*e;for(u=0;u<e;++u){const e=a[i+u],n=2*u;if(e<r[n]||e>r[n+1]){t=255;break}}o[h]=t}}}if(o)for(h=0,u=3,d=t*n;h<d;++h,u+=4)e[u]=o[h];else for(h=0,u=3,d=t*n;h<d;++h,u+=4)e[u]=255}undoPreblend(e,t,i){const n=this.smask?.matte;if(!n)return;const a=this.colorSpace.getRgb(n,0),s=a[0],r=a[1],o=a[2],l=t*i*4;for(let t=0;t<l;t+=4){const i=e[t+3];if(0===i){e[t]=255,e[t+1]=255,e[t+2]=255;continue}const n=255/i;e[t]=(e[t]-s)*n+s,e[t+1]=(e[t+1]-r)*n+r,e[t+2]=(e[t+2]-o)*n+o}}async createImageData(e=!1,t=!1){const i=this.drawWidth,n=this.drawHeight,a={width:i,height:n,interpolate:this.interpolate,kind:0,data:null},s=this.numComps,r=this.width,o=this.height,l=this.bpc,c=r*s*l+7>>3,h=t&&ImageResizer.needsToBeResized(i,n);if(!this.smask&&!this.mask&&"DeviceRGBA"===this.colorSpace.name){a.kind=k;const e=a.data=await this.getImageBytes(o*r*4,{});return t?h?ImageResizer.createImage(a,!1):this.createBitmap(k,i,n,e):a}if(!e){let e;if("DeviceGray"===this.colorSpace.name&&1===l?e=v:"DeviceRGB"!==this.colorSpace.name||8!==l||this.needsDecode||(e=C),e&&!this.smask&&!this.mask&&i===r&&n===o){const s=await this.#ie(r,o);if(s)return s;const l=await this.getImageBytes(o*c,{});if(t)return h?ImageResizer.createImage({data:l,kind:e,width:i,height:n,interpolate:this.interpolate},this.needsDecode):this.createBitmap(e,r,o,l);if(a.kind=e,a.data=l,this.needsDecode){assert$1(e===v,"PDFImage.createImageData: The image must be grayscale.");const t=a.data;for(let e=0,i=t.length;e<i;e++)t[e]^=255}return a}if(this.image instanceof JpegStream&&!this.smask&&!this.mask&&!this.needsDecode){let e=o*c;if(t&&!h){let t=!1;switch(this.colorSpace.name){case"DeviceGray":e*=4,t=!0;break;case"DeviceRGB":e=e/3*4,t=!0;break;case"DeviceCMYK":t=!0}if(t){const t=await this.#ie(i,n);if(t)return t;const a=await this.getImageBytes(e,{drawWidth:i,drawHeight:n,forceRGBA:!0});return this.createBitmap(k,i,n,a)}}else switch(this.colorSpace.name){case"DeviceGray":e*=3;case"DeviceRGB":case"DeviceCMYK":return a.kind=C,a.data=await this.getImageBytes(e,{drawWidth:i,drawHeight:n,forceRGB:!0}),h?ImageResizer.createImage(a):a}}}const d=await this.getImageBytes(o*c,{internal:!0}),u=0|d.length/c*n/o,g=this.getComponents(d);let f,p,m,b,y,w;if(t&&!h&&(m=new OffscreenCanvas(i,n),b=m.getContext("2d"),y=b.createImageData(i,n),w=y.data),a.kind=k,e||this.smask||this.mask)t&&!h||(w=new Uint8ClampedArray(i*n*4)),f=1,p=!0,await this.fillOpacity(w,i,n,u,g);else{if(!t||h)a.kind=C,w=new Uint8ClampedArray(i*n*3),f=0;else{new Uint32Array(w.buffer).fill(FeatureTest.isLittleEndian?4278190080:255),f=1}p=!1}if(this.needsDecode&&this.decodeBuffer(g),this.colorSpace.fillRgb(w,r,o,i,n,u,l,g,f),p&&this.undoPreblend(w,i,u),t&&!h){b.putImageData(y,0,0);return{data:null,width:i,height:n,bitmap:m.transferToImageBitmap(),interpolate:this.interpolate}}return a.data=w,h?ImageResizer.createImage(a):a}async fillGrayBuffer(e){const t=this.numComps;if(1!==t)throw new ti(`Reading gray scale from a color image: ${t}`);const i=this.width,n=this.height,a=this.bpc,s=i*t*a+7>>3,r=await this.getImageBytes(n*s,{internal:!0}),o=this.getComponents(r);let l,c;if(1===a){if(c=i*n,this.needsDecode)for(l=0;l<c;++l)e[l]=o[l]-1&255;else for(l=0;l<c;++l)e[l]=255&-o[l];return}this.needsDecode&&this.decodeBuffer(o),c=i*n;const h=255/((1<<a)-1);for(l=0;l<c;++l)e[l]=h*o[l]}createBitmap(e,t,i,n){const a=new OffscreenCanvas(t,i),s=a.getContext("2d");let r;e===k?r=new ImageData(n,t,i):(r=s.createImageData(t,i),convertToRGBA({kind:e,src:n,dest:new Uint32Array(r.data.buffer),width:t,height:i,inverseDecode:this.needsDecode})),s.putImageData(r,0,0);return{data:null,width:t,height:i,bitmap:a.transferToImageBitmap(),interpolate:this.interpolate}}async#ie(e,t){const i=await this.image.getTransferableImage();return i?{data:null,width:e,height:t,bitmap:i,interpolate:this.interpolate}:null}async getImageBytes(e,{drawWidth:t,drawHeight:i,forceRGBA:n=!1,forceRGB:a=!1,internal:s=!1}){this.image.reset(),this.image.drawWidth=t||this.width,this.image.drawHeight=i||this.height,this.image.forceRGBA=!!n,this.image.forceRGB=!!a;const r=await this.image.getImageData(e,this.jpxDecoderOptions);return s||this.image instanceof DecodeStream?r:(assert$1(r instanceof Uint8Array,'PDFImage.getImageBytes: Unsupported "imageBytes" type.'),new Uint8Array(r))}}const Ss=Object.freeze({maxImageSize:-1,disableFontFace:!1,ignoreErrors:!1,isEvalSupported:!0,isOffscreenCanvasSupported:!1,isImageDecoderSupported:!1,canvasMaxAreaInBytes:-1,fontExtraProperties:!1,useSystemFonts:!0,useWasm:!0,useWorkerFetch:!0,cMapUrl:null,iccUrl:null,standardFontDataUrl:null,wasmUrl:null}),vs=1,Cs=2,ks=Promise.resolve();function normalizeBlendMode(e,t=!1){if(Array.isArray(e)){for(const t of e){const e=normalizeBlendMode(t,!0);if(e)return e}return warn$1(`Unsupported blend mode Array: ${e}`),"source-over"}if(!(e instanceof Name))return t?null:"source-over";switch(e.name){case"Normal":case"Compatible":return"source-over";case"Multiply":return"multiply";case"Screen":return"screen";case"Overlay":return"overlay";case"Darken":return"darken";case"Lighten":return"lighten";case"ColorDodge":return"color-dodge";case"ColorBurn":return"color-burn";case"HardLight":return"hard-light";case"SoftLight":return"soft-light";case"Difference":return"difference";case"Exclusion":return"exclusion";case"Hue":return"hue";case"Saturation":return"saturation";case"Color":return"color";case"Luminosity":return"luminosity"}return t?null:(warn$1(`Unsupported blend mode: ${e.name}`),"source-over")}function addCachedImageOps(e,{objId:t,fn:i,args:n,optionalContent:a,hasMask:s}){t&&e.addDependency(t),e.addImageOps(i,n,a,s),i===Dt&&n[0]?.count>0&&n[0].count++}class TimeSlotManager{static TIME_SLOT_DURATION_MS=20;static CHECK_TIME_EVERY=100;constructor(){this.reset()}check(){return!(++this.checked<TimeSlotManager.CHECK_TIME_EVERY)&&(this.checked=0,this.endTime<=Date.now())}reset(){this.endTime=Date.now()+TimeSlotManager.TIME_SLOT_DURATION_MS,this.checked=0}}class PartialEvaluator{constructor({xref:e,handler:t,pageIndex:i,idFactory:n,fontCache:a,builtInCMapCache:s,standardFontDataCache:r,globalColorSpaceCache:o,globalImageCache:l,systemFontCache:c,options:h=null}){this.xref=e,this.handler=t,this.pageIndex=i,this.idFactory=n,this.fontCache=a,this.builtInCMapCache=s,this.standardFontDataCache=r,this.globalColorSpaceCache=o,this.globalImageCache=l,this.systemFontCache=c,this.options=h||Ss,this.type3FontRefs=null,this._regionalImageCache=new RegionalImageCache,this._fetchBuiltInCMapBound=this.fetchBuiltInCMap.bind(this)}get _pdfFunctionFactory(){return shadow$1(this,"_pdfFunctionFactory",new PDFFunctionFactory({xref:this.xref,isEvalSupported:this.options.isEvalSupported}))}get parsingType3Font(){return!!this.type3FontRefs}clone(e=null){const t=Object.create(this);return t.options=Object.assign(Object.create(null),this.options,e),t}hasBlendModes(e,t){if(!(e instanceof Dict))return!1;if(e.objId&&t.has(e.objId))return!1;const i=new RefSet(t);e.objId&&i.put(e.objId);const n=[e],a=this.xref;for(;n.length;){const e=n.shift(),t=e.get("ExtGState");if(t instanceof Dict)for(let e of t.getRawValues()){if(e instanceof Ref){if(i.has(e))continue;try{e=a.fetch(e)}catch(t){i.put(e),info$1(`hasBlendModes - ignoring ExtGState: "${t}".`);continue}}if(!(e instanceof Dict))continue;e.objId&&i.put(e.objId);const t=e.get("BM");if(t instanceof Name){if("Normal"!==t.name)return!0}else if(void 0!==t&&Array.isArray(t))for(const e of t)if(e instanceof Name&&"Normal"!==e.name)return!0}const s=e.get("XObject");if(s instanceof Dict)for(let e of s.getRawValues()){if(e instanceof Ref){if(i.has(e))continue;try{e=a.fetch(e)}catch(t){i.put(e),info$1(`hasBlendModes - ignoring XObject: "${t}".`);continue}}if(!(e instanceof BaseStream))continue;e.dict.objId&&i.put(e.dict.objId);const t=e.dict.get("Resources");t instanceof Dict&&(t.objId&&i.has(t.objId)||(n.push(t),t.objId&&i.put(t.objId)))}}for(const e of i)t.put(e);return!1}async fetchBuiltInCMap(e){const t=this.builtInCMapCache.get(e);if(t)return t;let i;return i=this.options.useWorkerFetch?{cMapData:await fetchBinaryData(`${this.options.cMapUrl}${e}.bcmap`),isCompressed:!0}:await this.handler.sendWithPromise("FetchBinaryData",{type:"cMapReaderFactory",name:e}),this.builtInCMapCache.set(e,i),i}async fetchStandardFontData(e){const t=this.standardFontDataCache.get(e);if(t)return new Stream(t);if(this.options.useSystemFonts&&"Symbol"!==e&&"ZapfDingbats"!==e)return null;const i=jn()[e];let n;try{n=this.options.useWorkerFetch?await fetchBinaryData(`${this.options.standardFontDataUrl}${i}`):await this.handler.sendWithPromise("FetchBinaryData",{type:"standardFontDataFactory",filename:i})}catch(e){return warn$1(e),null}return this.standardFontDataCache.set(e,n),new Stream(n)}async buildFormXObject(e,t,i,n,a,s,r,o){const{dict:l}=t,c=lookupMatrix(l.getArray("Matrix"),null),h=lookupNormalRect(l.getArray("BBox"),null);let d,u;l.has("OC")&&(d=await this.parseMarkedContentProps(l.get("OC"),e)),void 0!==d&&n.addOp(xt,["OC",d]);const g=l.get("Group");if(g){u={matrix:c,bbox:h,smask:i,isolated:!1,knockout:!1};let t=null;if(isName(g.get("S"),"Transparency")&&(u.isolated=g.get("I")||!1,u.knockout=g.get("K")||!1,g.has("CS"))){const i=this._getColorSpace(g.getRaw("CS"),e,r);t=i instanceof ColorSpace?i:await this._handleColorSpace(i)}i?.backdrop&&(t||=ColorSpaceUtils.rgb,i.backdrop=t.getRgbHex(i.backdrop,0)),n.addOp(Ft,[u])}const f=[c&&new Float32Array(c),!g&&h&&new Float32Array(h)||null];n.addOp(kt,f);const p=l.get("Resources");await this.getOperatorList({stream:t,task:a,resources:p instanceof Dict?p:e,operatorList:n,initialState:s,prevRefs:o}),n.addOp(Tt,[]),g&&n.addOp(It,[u]),void 0!==d&&n.addOp(St,[])}_sendImgData(e,t,i=!1){const n=t?[t.bitmap||t.data.buffer]:null;return this.parsingType3Font||i?this.handler.send("commonobj",[e,"Image",t],n):this.handler.send("obj",[e,this.pageIndex,"Image",t],n)}async buildPaintImageXObject({resources:e,image:t,isInline:i=!1,operatorList:n,cacheKey:a,localImageCache:s,localColorSpaceCache:r}){const{maxImageSize:o,ignoreErrors:l,isOffscreenCanvasSupported:c}=this.options,{dict:h}=t,d=h.objId,u=h.get("W","Width"),g=h.get("H","Height");if(!u||"number"!=typeof u||!g||"number"!=typeof g)return void warn$1("Image dimensions are missing, or not numbers.");if(-1!==o&&u*g>o){const e="Image exceeded maximum allowed size and was removed.";if(!l)throw new Error(e);return void warn$1(e)}let f;h.has("OC")&&(f=await this.parseMarkedContentProps(h.get("OC"),e));let p,m,b;if(h.get("IM","ImageMask")||!1){if(p=await PDFImage.createMask({image:t,isOffscreenCanvasSupported:c&&!this.parsingType3Font}),p.isSingleOpaquePixel){if(m=Lt,b=[],n.addImageOps(m,b,f),a){const e={fn:m,args:b,optionalContent:f};s.set(a,d,e),d&&this._regionalImageCache.set(null,d,e)}return}if(this.parsingType3Font)return b=function({data:e,width:t,height:i}){if(t>1e3||i>1e3)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),a=t+1,s=new Uint8Array(a*(i+1));let r,o,l;const c=t+7&-8,h=new Uint8Array(c*i);let d=0;for(const t of e){let e=128;for(;e>0;)h[d++]=t&e?0:255,e>>=1}let u=0;for(d=0,0!==h[d]&&(s[0]=1,++u),o=1;o<t;o++)h[d]!==h[d+1]&&(s[o]=h[d]?2:1,++u),d++;for(0!==h[d]&&(s[o]=2,++u),r=1;r<i;r++){d=r*c,l=r*a,h[d-c]!==h[d]&&(s[l]=h[d]?1:8,++u);let e=(h[d]?4:0)+(h[d-c]?8:0);for(o=1;o<t;o++)e=(e>>2)+(h[d+1]?4:0)+(h[d-c+1]?8:0),n[e]&&(s[l+o]=n[e],++u),d++;if(h[d-c]!==h[d]&&(s[l+o]=h[d]?2:4,++u),u>1e3)return null}for(d=c*(i-1),l=r*a,0!==h[d]&&(s[l]=8,++u),o=1;o<t;o++)h[d]!==h[d+1]&&(s[l+o]=h[d]?4:8,++u),d++;if(0!==h[d]&&(s[l+o]=4,++u),u>1e3)return null;const g=new Int32Array([0,a,-1,0,-a,0,0,0,1]),f=[],{a:p,b:m,c:b,d:y,e:w,f:x}=(new DOMMatrix).scaleSelf(1/t,-1/i).translateSelf(0,-i);for(r=0;u&&r<=i;r++){let e=r*a;const i=e+t;for(;e<i&&!s[e];)e++;if(e===i)continue;let n=e%a,o=r;f.push(Xt,p*n+b*o+w,m*n+y*o+x);const l=e;let c=s[e];do{const t=g[c];do{e+=t}while(!s[e]);const i=s[e];5!==i&&10!==i?(c=i,s[e]=0):(c=i&51*c>>4,s[e]&=c>>2|c<<2),n=e%a,o=e/a|0,f.push(qt,p*n+b*o+w,m*n+y*o+x),s[e]||--u}while(l!==e);--r}return[Ht,[new Float32Array(f)],new Float32Array([0,0,t,i])]}(p),b?void n.addImageOps(Ut,b,f):(warn$1("Cannot compile Type3 glyph."),void n.addImageOps(Dt,[p],f));const e=`mask_${this.idFactory.createObjId()}`;if(n.addDependency(e),p.dataLen=p.bitmap?p.width*p.height*4:p.data.length,this._sendImgData(e,p),m=Dt,b=[{data:e,width:p.width,height:p.height,interpolate:p.interpolate,count:1}],n.addImageOps(m,b,f),a){const t={objId:e,fn:m,args:b,optionalContent:f};s.set(a,d,t),d&&this._regionalImageCache.set(null,d,t)}return}const y=h.has("SMask")||h.has("Mask");if(i&&u+g<200&&!y){try{const a=new PDFImage({xref:this.xref,res:e,image:t,isInline:i,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:r});p=await a.createImageData(!0,!1),n.addImageOps(Pt,[p],f)}catch(e){const t=`Unable to decode inline image: "${e}".`;if(!l)throw new Error(t);warn$1(t)}return}let w=`img_${this.idFactory.createObjId()}`,x=!1,S=null;if(this.parsingType3Font?w=`${this.idFactory.getDocId()}_type3_${w}`:a&&d&&(x=this.globalImageCache.shouldCache(d,this.pageIndex),x&&(assert$1(!i,"Cannot cache an inline image globally."),w=`${this.idFactory.getDocId()}_${w}`)),n.addDependency(w),m=_t,b=[w,u,g],n.addImageOps(m,b,f,y),x){if(S={objId:w,fn:m,args:b,optionalContent:f,hasMask:y,byteSize:0},this.globalImageCache.hasDecodeFailed(d))return this.globalImageCache.setData(d,S),void this._sendImgData(w,null,x);if(u*g>25e4||y){const e=await this.handler.sendWithPromise("commonobj",[w,"CopyLocalImage",{imageRef:d}]);if(e)return this.globalImageCache.setData(d,S),void this.globalImageCache.addByteSize(d,e)}}if(PDFImage.buildImage({xref:this.xref,res:e,image:t,isInline:i,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:r}).then(async e=>(p=await e.createImageData(!1,c),p.dataLen=p.bitmap?p.width*p.height*4:p.data.length,p.ref=d,x&&this.globalImageCache.addByteSize(d,p.dataLen),this._sendImgData(w,p,x))).catch(e=>(warn$1(`Unable to decode image "${w}": "${e}".`),d&&this.globalImageCache.addDecodeFailed(d),this._sendImgData(w,null,x))),a){const e={objId:w,fn:m,args:b,optionalContent:f,hasMask:y};s.set(a,d,e),d&&(this._regionalImageCache.set(null,d,e),x&&(assert$1(S,"The global cache-data must be available."),this.globalImageCache.setData(d,S)))}}handleSMask(e,t,i,n,a,s,r){const o=e.get("G"),l={subtype:e.get("S").name,backdrop:e.get("BC")},c=e.get("TR");if(isPDFFunction(c)){const e=this._pdfFunctionFactory.create(c),t=new Uint8Array(256),i=new Float32Array(1);for(let n=0;n<256;n++)i[0]=n/255,e(i,0,i,0),t[n]=255*i[0]|0;l.transferMap=t}return this.buildFormXObject(t,o,l,i,n,a.state.clone({newPath:!0}),s,r)}handleTransferFunction(e){let t;if(Array.isArray(e))t=e;else{if(!isPDFFunction(e))return null;t=[e]}const i=[];let n=0,a=0;for(const e of t){const t=this.xref.fetchIfRef(e);if(n++,isName(t,"Identity")){i.push(null);continue}if(!isPDFFunction(t))return null;const s=this._pdfFunctionFactory.create(t),r=new Uint8Array(256),o=new Float32Array(1);for(let e=0;e<256;e++)o[0]=e/255,s(o,0,o,0),r[e]=255*o[0]|0;i.push(r),a++}return 1!==n&&4!==n||0===a?null:i}handleTilingType(e,t,i,n,a,s,r,o){const l=new OperatorList,c=Dict.merge({xref:this.xref,dictArray:[a.get("Resources"),i]});return this.getOperatorList({stream:n,task:r,resources:c,operatorList:l}).then(function(){const i=l.getIR(),n=getTilingPatternIR(i,a,t);s.addDependencies(l.dependencies),s.addOp(e,n),a.objId&&o.set(null,a.objId,{operatorListIR:i,dict:a})}).catch(e=>{if(!(e instanceof ii)){if(!this.options.ignoreErrors)throw e;warn$1(`handleTilingType - ignoring pattern: "${e}".`)}})}async handleSetFont(e,t,i,n,a,s,r=null,o=null){const l=t?.[0]instanceof Name?t[0].name:null,c=await this.loadFont(l,i,e,a,r,o);return c.font.isType3Font&&n.addDependencies(c.type3Dependencies),s.font=c.font,c.send(this.handler),c.loadedName}handleText(e,t){const i=t.font,n=i.charsToGlyphs(e);if(i.data){(!!(t.textRenderingMode&S)||"Pattern"===t.fillColorSpace.name||i.disableFontFace)&&PartialEvaluator.buildFontPaths(i,n,this.handler,this.options)}return n}ensureStateFont(e){if(e.font)return;const t=new ti("Missing setFont (Tf) operator before text rendering operator.");if(!this.options.ignoreErrors)throw t;warn$1(`ensureStateFont: "${t}".`)}async setGState({resources:e,gState:t,operatorList:i,cacheKey:n,task:a,stateManager:s,localGStateCache:r,localColorSpaceCache:o,seenRefs:l}){const c=t.objId;let h=!0;const d=[];let u=Promise.resolve();for(const[n,r]of t)switch(n){case"Type":break;case"LW":if("number"!=typeof r){warn$1(`Invalid LW (line width): ${r}`);break}d.push([n,Math.abs(r)]);break;case"LC":case"LJ":case"ML":case"D":case"RI":case"FL":case"CA":case"ca":d.push([n,r]);break;case"Font":h=!1,u=u.then(()=>this.handleSetFont(e,null,r[0],i,a,s.state).then(function(e){i.addDependency(e),d.push([n,[e,r[1]]])}));break;case"BM":d.push([n,normalizeBlendMode(r)]);break;case"SMask":if(isName(r,"None")){d.push([n,!1]);break}r instanceof Dict?(h=!1,u=u.then(()=>this.handleSMask(r,e,i,a,s,o,l)),d.push([n,!0])):warn$1("Unsupported SMask type");break;case"TR":const t=this.handleTransferFunction(r);d.push([n,t]);break;case"OP":case"op":case"OPM":case"BG":case"BG2":case"UCR":case"UCR2":case"TR2":case"HT":case"SM":case"SA":case"AIS":case"TK":info$1("graphic state operator "+n);break;default:info$1("Unknown graphic state operator "+n)}await u,d.length>0&&i.addOp(fe,[d]),h&&r.set(n,c,d)}loadFont(e,t,i,n,a=null,s=null){const errorFont=async()=>new TranslatedFont({loadedName:"g_font_error",font:new ErrorFont(`Font "${e}" is not available.`),dict:t});let r;if(t)t instanceof Ref&&(r=t);else{const t=i.get("Font");t&&(r=t.getRaw(e))}if(r){if(this.type3FontRefs?.has(r))return errorFont();if(this.fontCache.has(r))return this.fontCache.get(r);try{t=this.xref.fetchIfRef(r)}catch(e){warn$1(`loadFont - lookup failed: "${e}".`)}}if(!(t instanceof Dict)){if(!this.options.ignoreErrors&&!this.parsingType3Font)return warn$1(`Font "${e}" is not available.`),errorFont();warn$1(`Font "${e}" is not available -- attempting to fallback to a default font.`),t=a||PartialEvaluator.fallbackFontDict}if(t.cacheKey&&this.fontCache.has(t.cacheKey))return this.fontCache.get(t.cacheKey);const{promise:o,resolve:l}=Promise.withResolvers();let c;try{c=this.preEvaluateFont(t),c.cssFontInfo=s}catch(e){return warn$1(`loadFont - preEvaluateFont failed: "${e}".`),errorFont()}const{descriptor:h,hash:d}=c,u=r instanceof Ref;let g;if(d&&h instanceof Dict){const e=h.fontAliases||=Object.create(null);if(e[d]){const t=e[d].aliasRef;if(u&&t&&this.fontCache.has(t))return this.fontCache.putAlias(r,t),this.fontCache.get(r)}else e[d]={fontID:this.idFactory.createFontId()};u&&(e[d].aliasRef=r),g=e[d].fontID}else g=this.idFactory.createFontId();return assert$1(g?.startsWith("f"),'The "fontID" must be (correctly) defined.'),u?this.fontCache.put(r,o):(t.cacheKey=`cacheKey_${g}`,this.fontCache.put(t.cacheKey,o)),t.loadedName=`${this.idFactory.getDocId()}_${g}`,this.translateFont(c).then(async e=>{const a=new TranslatedFont({loadedName:t.loadedName,font:e,dict:t});if(e.isType3Font)try{await a.loadType3Data(this,i,n)}catch(e){throw new Error(`Type3 font load error: ${e}`)}l(a)}).catch(e=>{warn$1(`loadFont - translateFont failed: "${e}".`),l(new TranslatedFont({loadedName:t.loadedName,font:new ErrorFont(e?.message),dict:t}))}),o}buildPath(e,t,i){const{pathMinMax:n,pathBuffer:a}=i;switch(0|e){case Ce:{const e=i.currentPointX=t[0],s=i.currentPointY=t[1],r=t[2],o=t[3],l=e+r,c=s+o;0===r||0===o?a.push(Xt,e,s,qt,l,c,Wt):a.push(Xt,e,s,qt,l,s,qt,l,c,qt,e,c,Wt),ai.rectBoundingBox(e,s,l,c,n);break}case ye:{const e=i.currentPointX=t[0],s=i.currentPointY=t[1];a.push(Xt,e,s),ai.pointBoundingBox(e,s,n);break}case we:{const e=i.currentPointX=t[0],s=i.currentPointY=t[1];a.push(qt,e,s),ai.pointBoundingBox(e,s,n);break}case Ae:{const e=i.currentPointX,s=i.currentPointY,[r,o,l,c,h,d]=t;i.currentPointX=h,i.currentPointY=d,a.push(zt,r,o,l,c,h,d),ai.bezierBoundingBox(e,s,r,o,l,c,h,d,n);break}case xe:{const e=i.currentPointX,s=i.currentPointY,[r,o,l,c]=t;i.currentPointX=l,i.currentPointY=c,a.push(zt,e,s,r,o,l,c),ai.bezierBoundingBox(e,s,e,s,r,o,l,c,n);break}case Se:{const e=i.currentPointX,s=i.currentPointY,[r,o,l,c]=t;i.currentPointX=l,i.currentPointY=c,a.push(zt,r,o,l,c,l,c),ai.bezierBoundingBox(e,s,r,o,l,c,l,c,n);break}case ve:a.push(Wt)}}_getColorSpace(e,t,i){return ColorSpaceUtils.parse({cs:e,xref:this.xref,resources:t,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:i,asyncIfNotCached:!0})}async _handleColorSpace(e){try{return await e}catch(e){if(e instanceof ii)return null;if(this.options.ignoreErrors)return warn$1(`_handleColorSpace - ignoring ColorSpace: "${e}".`),null;throw e}}parseShading({shading:e,resources:t,localColorSpaceCache:i,localShadingPatternCache:n}){let a,s=n.get(e);if(s)return s;try{a=Pattern.parseShading(e,this.xref,t,this._pdfFunctionFactory,this.globalColorSpaceCache,i).getIR()}catch(t){if(t instanceof ii)return null;if(this.options.ignoreErrors)return warn$1(`parseShading - ignoring shading: "${t}".`),n.set(e,null),null;throw t}return s=`pattern_${this.idFactory.createObjId()}`,this.parsingType3Font&&(s=`${this.idFactory.getDocId()}_type3_${s}`),n.set(e,s),this.parsingType3Font?this.handler.send("commonobj",[s,"Pattern",a]):this.handler.send("obj",[s,this.pageIndex,"Pattern",a]),s}handleColorN(e,t,i,n,a,s,r,o,l,c){const h=i.pop();if(h instanceof Name){const d=a.getRaw(h.name),u=d instanceof Ref&&l.getByRef(d);if(u)try{const a=n.base?n.base.getRgbHex(i,0):null,s=getTilingPatternIR(u.operatorListIR,u.dict,a);return void e.addOp(t,s)}catch{}const g=this.xref.fetchIfRef(d);if(g){const a=g instanceof BaseStream?g.dict:g,h=a.get("PatternType");if(h===vs){const o=n.base?n.base.getRgbHex(i,0):null;return this.handleTilingType(t,o,s,g,a,e,r,l)}if(h===Cs){const i=a.get("Shading"),n=this.parseShading({shading:i,resources:s,localColorSpaceCache:o,localShadingPatternCache:c});if(n){const i=lookupMatrix(a.getArray("Matrix"),null);e.addOp(t,["Shading",n,i])}return}throw new ti(`Unknown PatternType: ${h}`)}}throw new ti(`Unknown PatternName: ${h}`)}_parseVisibilityExpression(e,t,i){if(++t>10)return void warn$1("Visibility expression is too deeply nested");const n=e.length,a=this.xref.fetchIfRef(e[0]);if(!(n<2)&&a instanceof Name){switch(a.name){case"And":case"Or":case"Not":i.push(a.name);break;default:return void warn$1(`Invalid operator ${a.name} in visibility expression`)}for(let a=1;a<n;a++){const n=e[a],s=this.xref.fetchIfRef(n);if(Array.isArray(s)){const e=[];i.push(e),this._parseVisibilityExpression(s,t,e)}else n instanceof Ref&&i.push(n.toString())}}else warn$1("Invalid visibility expression")}async parseMarkedContentProps(e,t){let i;if(e instanceof Name){i=t.get("Properties").get(e.name)}else{if(!(e instanceof Dict))throw new ti("Optional content properties malformed.");i=e}const n=i.get("Type")?.name;if("OCG"===n)return{type:n,id:i.objId};if("OCMD"===n){const e=i.get("VE");if(Array.isArray(e)){const t=[];if(this._parseVisibilityExpression(e,0,t),t.length>0)return{type:"OCMD",expression:t}}const t=i.get("OCGs");if(Array.isArray(t)||t instanceof Dict){const e=[];if(Array.isArray(t))for(const i of t)e.push(i.toString());else e.push(t.objId);return{type:n,ids:e,policy:i.get("P")instanceof Name?i.get("P").name:null,expression:null}}if(t instanceof Ref)return{type:n,id:t.toString()}}return null}getOperatorList({stream:e,task:t,resources:i,operatorList:n,initialState:a=null,fallbackFontDict:s=null,prevRefs:r=null}){const o=e.dict?.objId,l=new RefSet(r);if(o){if(r?.has(o))throw new Error(`getOperatorList - ignoring circular reference: ${o}`);l.put(o)}if(i||=Dict.empty,a||=new EvalState,!n)throw new Error('getOperatorList: missing "operatorList" parameter');const c=this,h=this.xref,d=new LocalImageCache,u=new LocalColorSpaceCache,g=new LocalGStateCache,f=new LocalTilingPatternCache,p=new Map,m=i.get("XObject")||Dict.empty,b=i.get("Pattern")||Dict.empty,y=new StateManager(a),w=new EvaluatorPreprocessor(e,h,y),x=new TimeSlotManager;function closePendingRestoreOPS(e){for(let e=0,t=w.savedStatesDepth;e<t;e++)n.addOp(me,[])}return new Promise(function promiseBody(e,a){const next=function(t){Promise.all([t,n.ready]).then(function(){try{promiseBody(e,a)}catch(e){a(e)}},a)};t.ensureNotTerminated(),x.reset();const r={};let o,S,v,C,k,T;for(;!(o=x.check())&&(r.args=null,w.read(r));){let e=r.args,a=r.fn;switch(0|a){case bt:if(T=e[0]instanceof Name,k=e[0].name,T){const t=d.getByName(k);if(t){addCachedImageOps(n,t),e=null;continue}}return void next(new Promise(function(e,a){if(!T)throw new ti("XObject must be referred to by name.");let s=m.getRaw(k);if(s instanceof Ref){const t=d.getByRef(s)||c._regionalImageCache.getByRef(s)||c.globalImageCache.getData(s,c.pageIndex);if(t)return addCachedImageOps(n,t),void e();s=h.fetch(s)}if(!(s instanceof BaseStream))throw new ti("XObject should be a stream");const r=s.dict.get("Subtype");if(!(r instanceof Name))throw new ti("XObject should have a Name subtype");if("Form"===r.name)return y.save(),void c.buildFormXObject(i,s,null,n,t,y.state.clone({newPath:!0}),u,l).then(function(){y.restore(),e()},a);if("Image"!==r.name){if("PS"!==r.name)throw new ti(`Unhandled XObject subtype ${r.name}`);info$1("Ignored XObject subtype PS"),e()}else c.buildPaintImageXObject({resources:i,image:s,operatorList:n,cacheKey:k,localImageCache:d,localColorSpaceCache:u}).then(e,a)}).catch(function(e){if(!(e instanceof ii)){if(!c.options.ignoreErrors)throw e;warn$1(`getOperatorList - ignoring XObject: "${e}".`)}}));case He:const r=e[1];return void next(c.handleSetFont(i,e,null,n,t,y.state,s).then(function(e){n.addDependency(e),n.addOp(He,[e,r])}));case mt:const o=e[0].cacheKey;if(o){const t=d.getByName(o);if(t){addCachedImageOps(n,t),e=null;continue}}return void next(c.buildPaintImageXObject({resources:i,image:e[0],isInline:!0,operatorList:n,cacheKey:o,localImageCache:d,localColorSpaceCache:u}));case Ke:if(!y.state.font){c.ensureStateFont(y.state);continue}e[0]=c.handleText(e[0],y.state);break;case Ye:if(!y.state.font){c.ensureStateFont(y.state);continue}const w=[],x=y.state;for(const t of e[0])"string"==typeof t?w.push(...c.handleText(t,x)):"number"==typeof t&&w.push(t);e[0]=w,a=Ke;break;case Je:if(!y.state.font){c.ensureStateFont(y.state);continue}n.addOp(Ve),e[0]=c.handleText(e[0],y.state),a=Ke;break;case Ze:if(!y.state.font){c.ensureStateFont(y.state);continue}n.addOp(Ve),n.addOp(Ue,[e.shift()]),n.addOp(Le,[e.shift()]),e[0]=c.handleText(e[0],y.state),a=Ke;break;case Xe:y.state.textRenderingMode=e[0];break;case it:{const t=c._getColorSpace(e[0],i,u);if(t instanceof ColorSpace){y.state.fillColorSpace=t;continue}return void next(c._handleColorSpace(t).then(e=>{y.state.fillColorSpace=e||ColorSpaceUtils.gray}))}case tt:{const t=c._getColorSpace(e[0],i,u);if(t instanceof ColorSpace){y.state.strokeColorSpace=t;continue}return void next(c._handleColorSpace(t).then(e=>{y.state.strokeColorSpace=e||ColorSpaceUtils.gray}))}case st:C=y.state.fillColorSpace,e=[C.getRgbHex(e,0)],a=ht;break;case nt:C=y.state.strokeColorSpace,e=[C.getRgbHex(e,0)],a=ct;break;case lt:y.state.fillColorSpace=ColorSpaceUtils.gray,e=[ColorSpaceUtils.gray.getRgbHex(e,0)],a=ht;break;case ot:y.state.strokeColorSpace=ColorSpaceUtils.gray,e=[ColorSpaceUtils.gray.getRgbHex(e,0)],a=ct;break;case ut:y.state.fillColorSpace=ColorSpaceUtils.cmyk,e=[ColorSpaceUtils.cmyk.getRgbHex(e,0)],a=ht;break;case dt:y.state.strokeColorSpace=ColorSpaceUtils.cmyk,e=[ColorSpaceUtils.cmyk.getRgbHex(e,0)],a=ct;break;case ht:y.state.fillColorSpace=ColorSpaceUtils.rgb,e=[ColorSpaceUtils.rgb.getRgbHex(e,0)];break;case ct:y.state.strokeColorSpace=ColorSpaceUtils.rgb,e=[ColorSpaceUtils.rgb.getRgbHex(e,0)];break;case rt:if(C=y.state.patternFillColorSpace,!C){if(isNumberArray(e,null)){e=[ColorSpaceUtils.gray.getRgbHex(e,0)],a=ht;break}e=[],a=$t;break}if("Pattern"===C.name)return void next(c.handleColorN(n,rt,e,C,b,i,t,u,f,p));e=[C.getRgbHex(e,0)],a=ht;break;case at:if(C=y.state.patternStrokeColorSpace,!C){if(isNumberArray(e,null)){e=[ColorSpaceUtils.gray.getRgbHex(e,0)],a=ct;break}e=[],a=jt;break}if("Pattern"===C.name)return void next(c.handleColorN(n,at,e,C,b,i,t,u,f,p));e=[C.getRgbHex(e,0)],a=ct;break;case gt:let F;try{const t=i.get("Shading");if(!t)throw new ti("No shading resource found");if(F=t.get(e[0].name),!F)throw new ti("No shading object found")}catch(e){if(e instanceof ii)continue;if(c.options.ignoreErrors){warn$1(`getOperatorList - ignoring Shading: "${e}".`);continue}throw e}const E=c.parseShading({shading:F,resources:i,localColorSpaceCache:u,localShadingPatternCache:p});if(!E)continue;e=[E],a=gt;break;case fe:if(T=e[0]instanceof Name,k=e[0].name,T){const t=g.getByName(k);if(t){t.length>0&&n.addOp(fe,[t]),e=null;continue}}return void next(new Promise(function(e,a){if(!T)throw new ti("GState must be referred to by name.");const s=i.get("ExtGState");if(!(s instanceof Dict))throw new ti("ExtGState should be a dictionary.");const r=s.get(k);if(!(r instanceof Dict))throw new ti("GState should be a dictionary.");c.setGState({resources:i,gState:r,operatorList:n,cacheKey:k,task:t,stateManager:y,localGStateCache:g,localColorSpaceCache:u,seenRefs:l}).then(e,a)}).catch(function(e){if(!(e instanceof ii)){if(!c.options.ignoreErrors)throw e;warn$1(`getOperatorList - ignoring ExtGState: "${e}".`)}}));case oe:{const[t]=e;if("number"!=typeof t){warn$1(`Invalid setLineWidth: ${t}`);continue}e[0]=Math.abs(t);break}case de:{const t=e[1];if("number"!=typeof t){warn$1(`Invalid setDash: ${t}`);continue}const i=e[0];if(!Array.isArray(i)){warn$1(`Invalid setDash: ${i}`);continue}i.some(e=>"number"!=typeof e)&&(e[0]=i.filter(e=>"number"==typeof e));break}case ye:case we:case Ae:case xe:case Se:case ve:case Ce:c.buildPath(a,e,y.state);continue;case ke:case Te:case Fe:case Ie:case Ee:case Me:case De:case Oe:case _e:{const{state:{pathBuffer:e,pathMinMax:t}}=y;a!==Te&&a!==De&&a!==Oe||e.push(Wt),0===e.length?n.addOp(Ut,[a,[null],null]):(n.addOp(Ut,[a,[new Float32Array(e)],t.slice()]),e.length=0,t.set([1/0,1/0,-1/0,-1/0],0));continue}case Ge:n.addOp(a,[new Float32Array(e)]);continue;case yt:case wt:case vt:case Ct:continue;case xt:if(!(e[0]instanceof Name)){warn$1(`Expected name for beginMarkedContentProps arg0=${e[0]}`),n.addOp(xt,["OC",null]);continue}if("OC"===e[0].name)return void next(c.parseMarkedContentProps(e[1],i).then(e=>{n.addOp(xt,["OC",e])}).catch(e=>{if(!(e instanceof ii)){if(c.options.ignoreErrors)return warn$1(`getOperatorList - ignoring beginMarkedContentProps: "${e}".`),void n.addOp(xt,["OC",null]);throw e}}));e=[e[0].name,e[1]instanceof Dict?e[1].get("MCID"):null];break;default:if(null!==e){for(S=0,v=e.length;S<v&&!(e[S]instanceof Dict);S++);if(S<v){warn$1("getOperatorList - ignoring operator: "+a);continue}}}n.addOp(a,e)}o?next(ks):(closePendingRestoreOPS(),e())}).catch(e=>{if(!(e instanceof ii)){if(this.options.ignoreErrors)return warn$1(`getOperatorList - ignoring errors during "${t.name}" task: "${e}".`),void closePendingRestoreOPS();throw e}})}getTextContent({stream:e,task:i,resources:n,stateManager:a=null,includeMarkedContent:s=!1,sink:r,seenStyles:o=new Set,viewBox:l,lang:c=null,markedContentData:h=null,disableNormalization:d=!1,keepWhiteSpace:u=!1,prevRefs:g=null,intersector:f=null}){const p=e.dict?.objId,m=new RefSet(g);if(p){if(g?.has(p))throw new Error(`getTextContent - ignoring circular reference: ${p}`);m.put(p)}n||=Dict.empty,a||=new StateManager(new TextState),s&&(h||={level:0});const b={items:[],styles:Object.create(null),lang:c},y={initialized:!1,str:[],totalWidth:0,totalHeight:0,width:0,height:0,vertical:!1,prevTransform:null,textAdvanceScale:0,spaceInFlowMin:0,spaceInFlowMax:0,trackingSpaceMin:1/0,negativeSpaceMax:-1/0,notASpace:-1/0,transform:null,fontName:null,hasEOL:!1},w=[" "," "];let x=0;function saveLastChar(e){const t=(x+1)%2,i=" "!==w[x]&&" "===w[t];return w[x]=e,x=t,!u&&i}function shouldAddWhitepsace(){return!u&&" "!==w[x]&&" "===w[(x+1)%2]}function resetLastChars(){w[0]=w[1]=" ",x=0}const S=this,v=this.xref,C=[];let k=null;const T=new LocalImageCache,F=new LocalGStateCache,E=new EvaluatorPreprocessor(e,v,a);let M;function pushWhitespace({width:e=0,height:t=0,transform:i=y.prevTransform,fontName:n=y.fontName}){f?.addExtraChar(" "),b.items.push({str:" ",dir:"ltr",width:e,height:t,transform:i,fontName:n,hasEOL:!1})}function getCurrentTextTransform(){const e=M.font,i=[M.fontSize*M.textHScale,0,0,M.fontSize,0,M.textRise];if(e.isType3Font&&(M.fontSize<=1||e.isCharBBox)&&!isArrayEqual(M.fontMatrix,t)){const t=e.bbox[3]-e.bbox[1];t>0&&(i[3]*=t*M.fontMatrix[3])}return ai.transform(M.ctm,ai.transform(M.textMatrix,i))}function ensureTextContentItem(){if(y.initialized)return y;const{font:e,loadedName:t}=M;if(!o.has(t)&&(o.add(t),b.styles[t]={fontFamily:e.fallbackName,ascent:e.ascent,descent:e.descent,vertical:e.vertical},S.options.fontExtraProperties&&e.systemFontInfo)){const i=b.styles[t];i.fontSubstitution=e.systemFontInfo.css,i.fontSubstitutionLoadedName=e.systemFontInfo.loadedName}y.fontName=t;const i=y.transform=getCurrentTextTransform();e.vertical?(y.width=y.totalWidth=Math.hypot(i[0],i[1]),y.height=y.totalHeight=0,y.vertical=!0):(y.width=y.totalWidth=0,y.height=y.totalHeight=Math.hypot(i[2],i[3]),y.vertical=!1);const n=Math.hypot(M.textLineMatrix[0],M.textLineMatrix[1]),a=Math.hypot(M.ctm[0],M.ctm[1]);y.textAdvanceScale=a*n;const{fontSize:s}=M;return y.trackingSpaceMin=.102*s,y.notASpace=.03*s,y.negativeSpaceMax=-.2*s,y.spaceInFlowMin=.102*s,y.spaceInFlowMax=.6*s,y.hasEOL=!1,y.initialized=!0,y}function updateAdvanceScale(){if(!y.initialized)return;const e=Math.hypot(M.textLineMatrix[0],M.textLineMatrix[1]),t=Math.hypot(M.ctm[0],M.ctm[1])*e;t!==y.textAdvanceScale&&(y.vertical?(y.totalHeight+=y.height*y.textAdvanceScale,y.height=0):(y.totalWidth+=y.width*y.textAdvanceScale,y.width=0),y.textAdvanceScale=t)}function runBidiTransform(e){let t=e.str.join("");var i;d||(i=t,ri||(ri=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,oi=new Map([["ſt","ſt"]])),t=i.replaceAll(ri,(e,t,i)=>t?t.normalize("NFKC"):oi.get(i)));const n=bidi(t,-1,e.vertical);return{str:n.str,dir:n.dir,width:Math.abs(e.totalWidth),height:Math.abs(e.totalHeight),transform:e.transform,fontName:e.fontName,hasEOL:e.hasEOL}}async function handleSetFont(e,a){const s=await S.loadFont(e,a,n,i);M.loadedName=s.loadedName,M.font=s.font,M.fontMatrix=s.font.fontMatrix||t}function applyInverseRotation(e,t,i){const n=Math.hypot(i[0],i[1]);return[(i[0]*e+i[1]*t)/n,(i[2]*e+i[3]*t)/n]}function compareWithLastPosition(e){const t=getCurrentTextTransform();let i=t[4],n=t[5];if(M.font?.vertical){if(i<l[0]||i>l[2]||n+e<l[1]||n>l[3])return!1}else if(i+e<l[0]||i>l[2]||n<l[1]||n>l[3])return!1;if(!M.font||!y.prevTransform)return!0;let a=y.prevTransform[4],s=y.prevTransform[5];if(a===i&&s===n)return!0;let r=-1;switch(t[0]&&0===t[1]&&0===t[2]?r=t[0]>0?0:180:t[1]&&0===t[0]&&0===t[3]&&(r=t[1]>0?90:270),r){case 0:break;case 90:[i,n]=[n,i],[a,s]=[s,a];break;case 180:[i,n,a,s]=[-i,-n,-a,-s];break;case 270:[i,n]=[-n,-i],[a,s]=[-s,-a];break;default:[i,n]=applyInverseRotation(i,n,t),[a,s]=applyInverseRotation(a,s,y.prevTransform)}if(M.font.vertical){const e=(s-n)/y.textAdvanceScale,t=i-a,r=Math.sign(y.height);return e<r*y.negativeSpaceMax?Math.abs(t)>.5*y.width?(appendEOL(),!0):(resetLastChars(),flushTextContentItem(),!0):Math.abs(t)>y.width?(appendEOL(),!0):(e<=r*y.notASpace&&resetLastChars(),e<=r*y.trackingSpaceMin?shouldAddWhitepsace()?(resetLastChars(),flushTextContentItem(),pushWhitespace({height:Math.abs(e)})):y.height+=e:addFakeSpaces(e,y.prevTransform,r)||(0===y.str.length?(resetLastChars(),pushWhitespace({height:Math.abs(e)})):y.height+=e),Math.abs(t)>.25*y.width&&flushTextContentItem(),!0)}const o=(i-a)/y.textAdvanceScale,c=n-s,h=Math.sign(y.width);return o<h*y.negativeSpaceMax?Math.abs(c)>.5*y.height?(appendEOL(),!0):(resetLastChars(),flushTextContentItem(),!0):Math.abs(c)>y.height?(appendEOL(),!0):(o<=h*y.notASpace&&resetLastChars(),o<=h*y.trackingSpaceMin?shouldAddWhitepsace()?(resetLastChars(),flushTextContentItem(),pushWhitespace({width:Math.abs(o)})):y.width+=o:addFakeSpaces(o,y.prevTransform,h)||(0===y.str.length?(resetLastChars(),pushWhitespace({width:Math.abs(o)})):y.width+=o),Math.abs(c)>.25*y.height&&flushTextContentItem(),!0)}function buildTextContentItem({chars:e,extraSpacing:t}){const i=M.font;if(!e){const e=M.charSpacing+t;return e&&(i.vertical?M.translateTextMatrix(0,-e):M.translateTextMatrix(e*M.textHScale,0)),void(u&&compareWithLastPosition(0))}const n=i.charsToGlyphs(e),a=M.fontMatrix[0]*M.fontSize;for(let e=0,s=n.length;e<s;e++){const r=n[e],{category:o,originalCharCode:l}=r;if(o.isInvisibleFormatMark)continue;let c=M.charSpacing+(e+1===s?t:0),h=r.width;i.vertical&&(h=r.vmetric?r.vmetric[0]:-h);let d=h*a;if(32===l&&(c+=M.wordSpacing),!u&&o.isWhitespace){i.vertical?(c+=-d,M.translateTextMatrix(0,-c)):(c+=d,M.translateTextMatrix(c*M.textHScale,0)),saveLastChar(" ");continue}if(!o.isZeroWidthDiacritic&&!compareWithLastPosition(d)){i.vertical?M.translateTextMatrix(0,d):M.translateTextMatrix(d*M.textHScale,0);continue}const g=ensureTextContentItem();o.isZeroWidthDiacritic&&(d=0),i.vertical?(f?.addGlyph(getCurrentTextTransform(),0,d,r.unicode),M.translateTextMatrix(0,d),d=Math.abs(d),g.height+=d):(d*=M.textHScale,f?.addGlyph(getCurrentTextTransform(),d,0,r.unicode),M.translateTextMatrix(d,0),g.width+=d),d&&(g.prevTransform=getCurrentTextTransform());const p=r.unicode;saveLastChar(p)&&(g.str.push(" "),f?.addExtraChar(" ")),f||g.str.push(p),c&&(i.vertical?M.translateTextMatrix(0,-c):M.translateTextMatrix(c*M.textHScale,0))}}function appendEOL(){f?.addExtraChar("\n"),resetLastChars(),y.initialized?(y.hasEOL=!0,flushTextContentItem()):b.items.push({str:"",dir:"ltr",width:0,height:0,transform:getCurrentTextTransform(),fontName:M.loadedName,hasEOL:!0})}function addFakeSpaces(e,t,i){if(i*y.spaceInFlowMin<=e&&e<=i*y.spaceInFlowMax)return y.initialized&&(resetLastChars(),y.str.push(" "),f?.addExtraChar(" ")),!1;const n=y.fontName;let a=0;return y.vertical&&(a=e,e=0),flushTextContentItem(),resetLastChars(),pushWhitespace({width:Math.abs(e),height:Math.abs(a),transform:t||getCurrentTextTransform(),fontName:n}),!0}function flushTextContentItem(){y.initialized&&y.str&&(y.vertical?y.totalHeight+=y.height*y.textAdvanceScale:y.totalWidth+=y.width*y.textAdvanceScale,b.items.push(runBidiTransform(y)),y.initialized=!1,y.str.length=0)}function enqueueChunk(e=!1){const t=b.items.length;0!==t&&(e&&t<10||(r?.enqueue(b,t),b.items=[],b.styles=Object.create(null)))}const D=new TimeSlotManager;return new Promise(function promiseBody(e,t){const next=function(i){enqueueChunk(!0),Promise.all([i,r?.ready]).then(function(){try{promiseBody(e,t)}catch(e){t(e)}},t)};i.ensureNotTerminated(),D.reset();const g={};let f,p,y,w=[];for(;!(f=D.check())&&(w.length=0,g.args=w,E.read(g));){const e=M;M=a.state;const t=g.fn;switch(w=g.args,0|t){case He:const t=w[0].name,g=w[1];if(M.font&&t===M.fontName&&g===M.fontSize)break;return flushTextContentItem(),M.fontName=t,M.fontSize=g,void next(handleSetFont(t,null));case qe:M.textRise=w[0];break;case je:M.textHScale=w[0]/100;break;case $e:M.leading=w[0];break;case ze:M.translateTextLineMatrix(w[0],w[1]),M.textMatrix=M.textLineMatrix.slice();break;case We:M.leading=-w[1],M.translateTextLineMatrix(w[0],w[1]),M.textMatrix=M.textLineMatrix.slice();break;case Ve:M.carriageReturn();break;case Ge:M.setTextMatrix(w[0],w[1],w[2],w[3],w[4],w[5]),M.setTextLineMatrix(w[0],w[1],w[2],w[3],w[4],w[5]),updateAdvanceScale();break;case Le:M.charSpacing=w[0];break;case Ue:M.wordSpacing=w[0];break;case Be:M.textMatrix=pi.slice(),M.textLineMatrix=pi.slice();break;case Ye:if(!a.state.font){S.ensureStateFont(a.state);continue}const f=(M.font.vertical?1:-1)*M.fontSize/1e3,x=w[0];for(let e=0,t=x.length;e<t;e++){const t=x[e];if("string"==typeof t)C.push(t);else if("number"==typeof t&&0!==t){const e=C.join("");C.length=0,buildTextContentItem({chars:e,extraSpacing:t*f})}}if(C.length>0){const e=C.join("");C.length=0,buildTextContentItem({chars:e,extraSpacing:0})}break;case Ke:if(!a.state.font){S.ensureStateFont(a.state);continue}buildTextContentItem({chars:w[0],extraSpacing:0});break;case Je:if(!a.state.font){S.ensureStateFont(a.state);continue}M.carriageReturn(),buildTextContentItem({chars:w[0],extraSpacing:0});break;case Ze:if(!a.state.font){S.ensureStateFont(a.state);continue}M.wordSpacing=w[0],M.charSpacing=w[1],M.carriageReturn(),buildTextContentItem({chars:w[2],extraSpacing:0});break;case bt:if(flushTextContentItem(),k??=n.get("XObject")||Dict.empty,y=w[0]instanceof Name,p=w[0].name,y&&T.getByName(p))break;return void next(new Promise(function(e,t){if(!y)throw new ti("XObject must be referred to by name.");let g=k.getRaw(p);if(g instanceof Ref){if(T.getByRef(g))return void e();if(S.globalImageCache.getData(g,S.pageIndex))return void e();g=v.fetch(g)}if(!(g instanceof BaseStream))throw new ti("XObject should be a stream");const{dict:f}=g,b=f.get("Subtype");if(!(b instanceof Name))throw new ti("XObject should have a Name subtype");if("Form"!==b.name)return T.set(p,f.objId,!0),void e();const w=a.state.clone(),x=new StateManager(w),C=lookupMatrix(f.getArray("Matrix"),null);C&&x.transform(C);const F=f.get("Resources");enqueueChunk();const E={enqueueInvoked:!1,enqueue(e,t){this.enqueueInvoked=!0,r.enqueue(e,t)},get desiredSize(){return r.desiredSize??0},get ready(){return r.ready}};S.getTextContent({stream:g,task:i,resources:F instanceof Dict?F:n,stateManager:x,includeMarkedContent:s,sink:r&&E,seenStyles:o,viewBox:l,lang:c,markedContentData:h,disableNormalization:d,keepWhiteSpace:u,prevRefs:m}).then(function(){E.enqueueInvoked||T.set(p,f.objId,!0),e()},t)}).catch(function(e){if(!(e instanceof ii)){if(!S.options.ignoreErrors)throw e;warn$1(`getTextContent - ignoring XObject: "${e}".`)}}));case fe:if(y=w[0]instanceof Name,p=w[0].name,y&&F.getByName(p))break;return void next(new Promise(function(e,t){if(!y)throw new ti("GState must be referred to by name.");const i=n.get("ExtGState");if(!(i instanceof Dict))throw new ti("ExtGState should be a dictionary.");const a=i.get(p);if(!(a instanceof Dict))throw new ti("GState should be a dictionary.");const s=a.get("Font");if(!s)return F.set(p,a.objId,!0),void e();flushTextContentItem(),M.fontName=null,M.fontSize=s[1],handleSetFont(null,s[0]).then(e,t)}).catch(function(e){if(!(e instanceof ii)){if(!S.options.ignoreErrors)throw e;warn$1(`getTextContent - ignoring ExtGState: "${e}".`)}}));case At:flushTextContentItem(),s&&(h.level++,b.items.push({type:"beginMarkedContent",tag:w[0]instanceof Name?w[0].name:null}));break;case xt:if(flushTextContentItem(),s){h.level++;let e=null;w[1]instanceof Dict&&(e=w[1].get("MCID")),b.items.push({type:"beginMarkedContentProps",id:Number.isInteger(e)?`${S.idFactory.getPageObjId()}_mc${e}`:null,tag:w[0]instanceof Name?w[0].name:null})}break;case St:if(flushTextContentItem(),s){if(0===h.level)break;h.level--,b.items.push({type:"endMarkedContent"})}break;case me:!e||e.font===M.font&&e.fontSize===M.fontSize&&e.fontName===M.fontName||flushTextContentItem()}if(b.items.length>=(r?.desiredSize??1)){f=!0;break}}f?next(ks):(flushTextContentItem(),enqueueChunk(),e())}).catch(e=>{if(!(e instanceof ii)){if(this.options.ignoreErrors)return warn$1(`getTextContent - ignoring errors during "${i.name}" task: "${e}".`),flushTextContentItem(),void enqueueChunk();throw e}})}async extractDataStructures(e,t){const i=this.xref;let n;const a=this.readToUnicode(t.toUnicode);if(t.composite){const i=e.get("CIDSystemInfo");i instanceof Dict&&(t.cidSystemInfo={registry:stringToPDFString(i.get("Registry")),ordering:stringToPDFString(i.get("Ordering")),supplement:i.get("Supplement")});try{const t=e.get("CIDToGIDMap");t instanceof BaseStream&&(n=t.getBytes())}catch(e){if(!this.options.ignoreErrors)throw e;warn$1(`extractDataStructures - ignoring CIDToGIDMap data: "${e}".`)}}const s=[];let r,o=null;if(e.has("Encoding")){if(r=e.get("Encoding"),r instanceof Dict){if(o=r.get("BaseEncoding"),o=o instanceof Name?o.name:null,r.has("Differences")){const e=r.get("Differences");let t=0;for(const n of e){const e=i.fetchIfRef(n);if("number"==typeof e)t=e;else{if(!(e instanceof Name))throw new ti(`Invalid entry in 'Differences' array: ${e}`);s[t++]=e.name}}}}else if(r instanceof Name)o=r.name;else{const e="Encoding is not a Name nor a Dict";if(!this.options.ignoreErrors)throw new ti(e);warn$1(e)}"MacRomanEncoding"!==o&&"MacExpertEncoding"!==o&&"WinAnsiEncoding"!==o&&(o=null)}const l=!t.file||t.isInternalFont,c=Xn()[t.name];if(o&&l&&c&&(o=null),o)t.defaultEncoding=getEncoding(o);else{let e=!!(t.flags&kn);const i=!!(t.flags&Tn);"TrueType"===t.type&&e&&i&&0!==s.length&&(t.flags&=-5,e=!1),r=un,"TrueType"!==t.type||i||(r=gn),(e||c)&&(r=dn,l&&(/Symbol/i.test(t.name)?r=fn:/Dingbats/i.test(t.name)?r=pn:/Wingdings/i.test(t.name)&&(r=gn))),t.defaultEncoding=r}t.differences=s,t.baseEncodingName=o,t.hasEncoding=!!o||s.length>0,t.dict=e,t.toUnicode=await a;const h=await this.buildToUnicode(t);return t.toUnicode=h,n&&(t.cidToGidMap=this.readCidToGidMap(n,h)),t}_simpleFontToUnicode(e,t=!1){assert$1(!e.composite,"Must be a simple font.");const i=[],n=e.defaultEncoding.slice(),a=e.baseEncodingName,s=e.differences;for(const e in s){const t=s[e];".notdef"!==t&&(n[e]=t)}const r=mn();for(const s in n){let o=n[s];if(""===o)continue;let l=r[o];if(void 0!==l){i[s]=String.fromCharCode(l);continue}let c=0;switch(o[0]){case"G":3===o.length&&(c=parseInt(o.substring(1),16));break;case"g":5===o.length&&(c=parseInt(o.substring(1),16));break;case"C":case"c":if(o.length>=3&&o.length<=4){const i=o.substring(1);if(t){c=parseInt(i,16);break}if(c=+i,Number.isNaN(c)&&Number.isInteger(parseInt(i,16)))return this._simpleFontToUnicode(e,!0)}break;case"u":l=getUnicodeForGlyph(o,r),-1!==l&&(c=l);break;default:switch(o){case"f_h":case"f_t":case"T_h":i[s]=o.replaceAll("_","");continue}}if(c>0&&c<=1114111&&Number.isInteger(c)){if(a&&c===+s){const e=getEncoding(a);if(e&&(o=e[s])){i[s]=String.fromCharCode(r[o]);continue}}i[s]=String.fromCodePoint(c)}}return i}async buildToUnicode(e){if(e.hasIncludedToUnicodeMap=e.toUnicode?.length>0,e.hasIncludedToUnicodeMap)return!e.composite&&e.hasEncoding&&(e.fallbackToUnicode=this._simpleFontToUnicode(e)),e.toUnicode;if(!e.composite)return new ToUnicodeMap(this._simpleFontToUnicode(e));if(e.composite&&(e.cMap.builtInCMap&&!(e.cMap instanceof IdentityCMap)||"Adobe"===e.cidSystemInfo?.registry&&("GB1"===e.cidSystemInfo.ordering||"CNS1"===e.cidSystemInfo.ordering||"Japan1"===e.cidSystemInfo.ordering||"Korea1"===e.cidSystemInfo.ordering))){const{registry:t,ordering:i}=e.cidSystemInfo,n=Name.get(`${t}-${i}-UCS2`),a=await CMapFactory.create({encoding:n,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),s=[],r=[];return e.cMap.forEach(function(e,t){if(t>65535)throw new ti("Max size of CID is 65,535");const i=a.lookup(t);if(i){r.length=0;for(let e=0,t=i.length;e<t;e+=2)r.push((i.charCodeAt(e)<<8)+i.charCodeAt(e+1));s[e]=String.fromCharCode(...r)}}),new ToUnicodeMap(s)}return new IdentityToUnicodeMap(e.firstChar,e.lastChar)}async readToUnicode(e){if(!e)return null;if(e instanceof Name){const t=await CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});return t instanceof IdentityCMap?new IdentityToUnicodeMap(0,65535):new ToUnicodeMap(t.getMap())}if(e instanceof BaseStream)try{const t=await CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});if(t instanceof IdentityCMap)return new IdentityToUnicodeMap(0,65535);const i=new Array(t.length);return t.forEach(function(e,t){if("number"==typeof t)return void(i[e]=String.fromCodePoint(t));t.length%2!=0&&(t="\0"+t);const n=[];for(let e=0;e<t.length;e+=2){const i=t.charCodeAt(e)<<8|t.charCodeAt(e+1);if(55296!=(63488&i)){n.push(i);continue}e+=2;const a=t.charCodeAt(e)<<8|t.charCodeAt(e+1);n.push(((1023&i)<<10)+(1023&a)+65536)}i[e]=String.fromCodePoint(...n)}),new ToUnicodeMap(i)}catch(e){if(e instanceof ii)return null;if(this.options.ignoreErrors)return warn$1(`readToUnicode - ignoring ToUnicode data: "${e}".`),null;throw e}return null}readCidToGidMap(e,t){const i=[];for(let n=0,a=e.length;n<a;n++){const a=e[n++]<<8|e[n],s=n>>1;(0!==a||t.has(s))&&(i[s]=a)}return i}extractWidths(e,t,i){const n=this.xref;let a=[],s=0;const r=[];let o;if(i.composite){const t=e.get("DW");s="number"==typeof t?Math.ceil(t):1e3;const l=e.get("W");if(Array.isArray(l))for(let e=0,t=l.length;e<t;e++){let t=n.fetchIfRef(l[e++]);if(!Number.isInteger(t))break;const i=n.fetchIfRef(l[e]);if(Array.isArray(i))for(const e of i){const i=n.fetchIfRef(e);"number"==typeof i&&(a[t]=i),t++}else{if(!Number.isInteger(i))break;{const s=n.fetchIfRef(l[++e]);if("number"!=typeof s)continue;for(let e=t;e<=i;e++)a[e]=s}}}if(i.vertical){const t=e.getArray("DW2");let i=isNumberArray(t,2)?t:[880,-1e3];if(o=[i[1],.5*s,i[0]],i=e.get("W2"),Array.isArray(i))for(let e=0,t=i.length;e<t;e++){let t=n.fetchIfRef(i[e++]);if(!Number.isInteger(t))break;const a=n.fetchIfRef(i[e]);if(Array.isArray(a))for(let e=0,i=a.length;e<i;e++){const i=[n.fetchIfRef(a[e++]),n.fetchIfRef(a[e++]),n.fetchIfRef(a[e])];isNumberArray(i,null)&&(r[t]=i),t++}else{if(!Number.isInteger(a))break;{const s=[n.fetchIfRef(i[++e]),n.fetchIfRef(i[++e]),n.fetchIfRef(i[++e])];if(!isNumberArray(s,null))continue;for(let e=t;e<=a;e++)r[e]=s}}}}}else{const r=e.get("Widths");if(Array.isArray(r)){let e=i.firstChar;for(const t of r){const i=n.fetchIfRef(t);"number"==typeof i&&(a[e]=i),e++}const o=t.get("MissingWidth");s="number"==typeof o?o:0}else{const t=e.get("BaseFont");if(t instanceof Name){const e=this.getBaseFontMetrics(t.name);a=this.buildCharCodeToWidth(e.widths,i),s=e.defaultWidth}}}let l=!0,c=s;for(const e in a){const t=a[e];if(t)if(c){if(c!==t){l=!1;break}}else c=t}l?i.flags|=vn:i.flags&=-2,i.defaultWidth=s,i.widths=a,i.defaultVMetrics=o,i.vmetrics=r}isSerifFont(e){const t=e.split("-",1)[0];return t in Hn()||/serif/gi.test(t)}getBaseFontMetrics(e){let t=0,i=Object.create(null),n=!1;let a=Un()[e]||e;const s=Gn();a in s||(a=this.isSerifFont(e)?"Times-Roman":"Helvetica");const r=s[a];return"number"==typeof r?(t=r,n=!0):i=r(),{defaultWidth:t,monospace:n,widths:i}}buildCharCodeToWidth(e,t){const i=Object.create(null),n=t.differences,a=t.defaultEncoding;for(let t=0;t<256;t++)t in n&&e[n[t]]?i[t]=e[n[t]]:t in a&&e[a[t]]&&(i[t]=e[a[t]]);return i}preEvaluateFont(e){const t=e;let i=e.get("Subtype");if(!(i instanceof Name))throw new ti("invalid font Subtype");let n,a=!1;if("Type0"===i.name){const t=e.get("DescendantFonts");if(!t)throw new ti("Descendant fonts are not specified");if(!((e=Array.isArray(t)?this.xref.fetchIfRef(t[0]):t)instanceof Dict))throw new ti("Descendant font is not a dictionary.");if(i=e.get("Subtype"),!(i instanceof Name))throw new ti("invalid font Subtype");a=!0}let s=e.get("FirstChar");Number.isInteger(s)||(s=0);let r=e.get("LastChar");Number.isInteger(r)||(r=a?65535:255);const o=e.get("FontDescriptor"),l=e.get("ToUnicode")||t.get("ToUnicode");if(o){n=new xs;const i=t.getRaw("Encoding");if(i instanceof Name)n.update(i.name);else if(i instanceof Ref)n.update(i.toString());else if(i instanceof Dict)for(const e of i.getRawValues())if(e instanceof Name)n.update(e.name);else if(e instanceof Ref)n.update(e.toString());else if(Array.isArray(e)){const t=e.length,i=new Array(t);for(let n=0;n<t;n++){const t=e[n];t instanceof Name?i[n]=t.name:("number"==typeof t||t instanceof Ref)&&(i[n]=t.toString())}n.update(i.join())}if(n.update(`${s}-${r}`),l instanceof BaseStream){const e=l.str||l,t=e.buffer?new Uint8Array(e.buffer.buffer,0,e.bufferLength):new Uint8Array(e.bytes.buffer,e.start,e.end-e.start);n.update(t)}else l instanceof Name&&n.update(l.name);const o=e.get("Widths")||t.get("Widths");if(Array.isArray(o)){const e=[];for(const t of o)("number"==typeof t||t instanceof Ref)&&e.push(t.toString());n.update(e.join())}if(a){n.update("compositeFont");const i=e.get("W")||t.get("W");if(Array.isArray(i)){const e=[];for(const t of i)if("number"==typeof t||t instanceof Ref)e.push(t.toString());else if(Array.isArray(t)){const i=[];for(const e of t)("number"==typeof e||e instanceof Ref)&&i.push(e.toString());e.push(`[${i.join()}]`)}n.update(e.join())}const a=e.getRaw("CIDToGIDMap")||t.getRaw("CIDToGIDMap");a instanceof Name?n.update(a.name):a instanceof Ref?n.update(a.toString()):a instanceof BaseStream&&n.update(a.peekBytes())}}return{descriptor:o,dict:e,baseDict:t,composite:a,type:i.name,firstChar:s,lastChar:r,toUnicode:l,hash:n?n.hexdigest():""}}async translateFont({descriptor:e,dict:i,baseDict:n,composite:a,type:s,firstChar:r,lastChar:o,toUnicode:l,cssFontInfo:c}){const h="Type3"===s;if(!e){if(!h){let e=i.get("BaseFont");if(!(e instanceof Name))throw new ti("Base font is not specified");e=e.name.replaceAll(/[,_]/g,"-");const t=this.getBaseFontMetrics(e),a=e.split("-",1)[0],c=(this.isSerifFont(a)?Cn:0)|(t.monospace?vn:0)|(Xn()[a]?kn:Tn),d={type:s,name:e,loadedName:n.loadedName,systemFontInfo:null,widths:t.widths,defaultWidth:t.defaultWidth,isSimulatedFlags:!0,flags:c,firstChar:r,lastChar:o,toUnicode:l,xHeight:0,capHeight:0,italicAngle:0,isType3Font:h},u=i.get("Widths"),g=getStandardFontName(e);let f=null;g&&(f=await this.fetchStandardFontData(g),d.isInternalFont=!!f),!d.isInternalFont&&this.options.useSystemFonts&&(d.systemFontInfo=getFontSubstitution(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,e,g,s));const p=await this.extractDataStructures(i,d);if(Array.isArray(u)){const e=[];let t=r;for(const i of u){const n=this.xref.fetchIfRef(i);"number"==typeof n&&(e[t]=n),t++}p.widths=e}else p.widths=this.buildCharCodeToWidth(t.widths,p);return new Font(e,f,p,this.options)}e=Dict.empty}let d=e.get("FontName"),u=i.get("BaseFont");"string"==typeof d&&(d=Name.get(d)),"string"==typeof u&&(u=Name.get(u));const g=d?.name,f=u?.name;if(h?g||(d=Name.get(s)):g!==f&&(info$1(`The FontDescriptor's FontName is "${g}" but should be the same as the Font's BaseFont "${f}".`),g&&f&&(f.startsWith(g)||!isKnownFontName(g)&&isKnownFontName(f))&&(d=null),d||=u),!(d instanceof Name))throw new ti("invalid font name");let p,m,b,y,w;try{if(p=e.get("FontFile","FontFile2","FontFile3"),p){if(!(p instanceof BaseStream))throw new ti("FontFile should be a stream");if(p.isEmpty)throw new ti("FontFile is empty")}}catch(e){if(!this.options.ignoreErrors)throw e;warn$1(`translateFont - fetching "${d.name}" font file: "${e}".`),p=null}let x=!1,S=null,v=null;if(p){if(p.dict){const e=p.dict.get("Subtype");e instanceof Name&&(m=e.name),b=p.dict.get("Length1"),y=p.dict.get("Length2"),w=p.dict.get("Length3")}}else if(c){const e=getXfaFontName(d.name);e&&(c.fontFamily=`${c.fontFamily}-PdfJS-XFA`,c.metrics=e.metrics||null,S=e.factors||null,p=await this.fetchStandardFontData(e.name),x=!!p,n=i=getXfaFontDict(d.name),a=!0)}else if(!h){const e=getStandardFontName(d.name);e&&(p=await this.fetchStandardFontData(e),x=!!p),!x&&this.options.useSystemFonts&&(v=getFontSubstitution(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,d.name,e,s))}const C=lookupMatrix(i.getArray("FontMatrix"),t),k=lookupNormalRect(e.getArray("FontBBox")||i.getArray("FontBBox"),h?[0,0,0,0]:void 0);let T=e.get("Ascent");"number"!=typeof T&&(T=void 0);let F=e.get("Descent");"number"!=typeof F&&(F=void 0);let E=e.get("XHeight");"number"!=typeof E&&(E=0);let M=e.get("CapHeight");"number"!=typeof M&&(M=0);let D=e.get("Flags");Number.isInteger(D)||(D=0);let O=e.get("ItalicAngle");"number"!=typeof O&&(O=0);const _={type:s,name:d.name,subtype:m,file:p,length1:b,length2:y,length3:w,isInternalFont:x,loadedName:n.loadedName,composite:a,fixedPitch:!1,fontMatrix:C,firstChar:r,lastChar:o,toUnicode:l,bbox:k,ascent:T,descent:F,xHeight:E,capHeight:M,flags:D,italicAngle:O,isType3Font:h,cssFontInfo:c,scaleFactors:S,systemFontInfo:v};if(a){const e=n.get("Encoding");e instanceof Name&&(_.cidEncoding=e.name);const t=await CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});_.cMap=t,_.vertical=_.cMap.vertical}const R=await this.extractDataStructures(i,_);return this.extractWidths(i,e,R),new Font(d.name,p,R,this.options)}static buildFontPaths(e,t,i,n){function buildPath(t){const a=`${e.loadedName}_path_${t}`;try{if(e.renderer.hasBuiltPath(t))return;i.send("commonobj",[a,"FontPath",e.renderer.getPathJs(t)])}catch(e){if(n.ignoreErrors)return void warn$1(`buildFontPaths - ignoring ${a} glyph: "${e}".`);throw e}}for(const e of t){buildPath(e.fontChar);const t=e.accent;t?.fontChar&&buildPath(t.fontChar)}}static get fallbackFontDict(){const e=new Dict;return e.set("BaseFont",Name.get("Helvetica")),e.set("Type",Name.get("FallbackType")),e.set("Subtype",Name.get("FallbackType")),e.set("Encoding",Name.get("WinAnsiEncoding")),shadow$1(this,"fallbackFontDict",e)}}class TranslatedFont{#ne=!1;#ae=null;constructor({loadedName:e,font:t,dict:i}){this.loadedName=e,this.font=t,this.dict=i,this.type3Dependencies=t.isType3Font?new Set:null}send(e){if(this.#ne)return;this.#ne=!0;const t=this.font.exportData(),i=[];t.data&&(t.data.charProcOperatorList&&(t.charProcOperatorList=t.data.charProcOperatorList),t.data=ds.write(t.data),i.push(t.data)),e.send("commonobj",[this.loadedName,"Font",t],i)}fallback(e,t){this.font.data&&(this.font.disableFontFace=!0,PartialEvaluator.buildFontPaths(this.font,this.font.glyphCacheValues,e,t))}loadType3Data(e,t,i){if(this.#ae)return this.#ae;const{font:n,type3Dependencies:a}=this;assert$1(n.isType3Font,"Must be a Type3 font.");const s=e.clone({ignoreErrors:!1}),r=new RefSet(e.type3FontRefs);this.dict.objId&&!r.has(this.dict.objId)&&r.put(this.dict.objId),s.type3FontRefs=r;let o=Promise.resolve();const l=this.dict.get("CharProcs"),c=this.dict.get("Resources")||t,h=Object.create(null),[d,u,g,f]=n.bbox,p=g-d,m=f-u,b=Math.hypot(p,m);for(const e of l.getKeys())o=o.then(()=>{const t=l.get(e),n=new OperatorList;return s.getOperatorList({stream:t,task:i,resources:c,operatorList:n}).then(()=>{switch(n.fnArray[0]){case et:this.#se(n,b);break;case Qe:b||this.#re(n)}h[e]=n.getIR();for(const e of n.dependencies)a.add(e)}).catch(function(t){warn$1(`Type3 font resource "${e}" is not available.`);const i=new OperatorList;h[e]=i.getIR()})});return this.#ae=o.then(()=>{n.charProcOperatorList=h,this._bbox&&(n.isCharBBox=!0,n.bbox=this._bbox)}),this.#ae}#se(e,t=NaN){const i=ai.normalizeRect(e.argsArray[0].slice(2)),n=i[2]-i[0],a=i[3]-i[1],s=Math.hypot(n,a);0===n||0===a?(e.fnArray.splice(0,1),e.argsArray.splice(0,1)):(0===t||Math.round(s/t)>=10)&&(this._bbox??=[1/0,1/0,-1/0,-1/0],ai.rectBoundingBox(...i,this._bbox));let r=0,o=e.length;for(;r<o;){switch(e.fnArray[r]){case et:break;case tt:case it:case nt:case at:case st:case rt:case ot:case lt:case ct:case ht:case dt:case ut:case gt:case ue:e.fnArray.splice(r,1),e.argsArray.splice(r,1),o--;continue;case fe:const[t]=e.argsArray[r];let i=0,n=t.length;for(;i<n;){const[e]=t[i];switch(e){case"TR":case"TR2":case"HT":case"BG":case"BG2":case"UCR":case"UCR2":t.splice(i,1),n--;continue}i++}}r++}}#re(e){let t=1;const i=e.length;for(;t<i;){if(e.fnArray[t]===Ut){const i=e.argsArray[t][2];this._bbox??=[1/0,1/0,-1/0,-1/0],ai.rectBoundingBox(...i,this._bbox)}t++}}}class StateManager{constructor(e=new EvalState){this.state=e,this.stateStack=[]}save(){const e=this.state;this.stateStack.push(this.state),this.state=e.clone()}restore(){const e=this.stateStack.pop();e&&(this.state=e)}transform(e){this.state.ctm=ai.transform(this.state.ctm,e)}}class TextState{constructor(){this.ctm=new Float32Array(pi),this.fontName=null,this.fontSize=0,this.loadedName=null,this.font=null,this.fontMatrix=t,this.textMatrix=pi.slice(),this.textLineMatrix=pi.slice(),this.charSpacing=0,this.wordSpacing=0,this.leading=0,this.textHScale=1,this.textRise=0}setTextMatrix(e,t,i,n,a,s){const r=this.textMatrix;r[0]=e,r[1]=t,r[2]=i,r[3]=n,r[4]=a,r[5]=s}setTextLineMatrix(e,t,i,n,a,s){const r=this.textLineMatrix;r[0]=e,r[1]=t,r[2]=i,r[3]=n,r[4]=a,r[5]=s}translateTextMatrix(e,t){const i=this.textMatrix;i[4]=i[0]*e+i[2]*t+i[4],i[5]=i[1]*e+i[3]*t+i[5]}translateTextLineMatrix(e,t){const i=this.textLineMatrix;i[4]=i[0]*e+i[2]*t+i[4],i[5]=i[1]*e+i[3]*t+i[5]}carriageReturn(){this.translateTextLineMatrix(0,-this.leading),this.textMatrix=this.textLineMatrix.slice()}clone(){const e=Object.create(this);return e.textMatrix=this.textMatrix.slice(),e.textLineMatrix=this.textLineMatrix.slice(),e.fontMatrix=this.fontMatrix.slice(),e}}class EvalState{constructor(){this.ctm=new Float32Array(pi),this.font=null,this.textRenderingMode=x,this._fillColorSpace=this._strokeColorSpace=ColorSpaceUtils.gray,this.patternFillColorSpace=null,this.patternStrokeColorSpace=null,this.currentPointX=this.currentPointY=0,this.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0]),this.pathBuffer=[]}get fillColorSpace(){return this._fillColorSpace}set fillColorSpace(e){this._fillColorSpace=this.patternFillColorSpace=e}get strokeColorSpace(){return this._strokeColorSpace}set strokeColorSpace(e){this._strokeColorSpace=this.patternStrokeColorSpace=e}clone({newPath:e=!1}={}){const t=Object.create(this);return e&&(t.pathBuffer=[],t.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0])),t}}class EvaluatorPreprocessor{static get opMap(){return shadow$1(this,"opMap",Object.assign(Object.create(null),{w:{id:oe,numArgs:1,variableArgs:!1},J:{id:le,numArgs:1,variableArgs:!1},j:{id:ce,numArgs:1,variableArgs:!1},M:{id:he,numArgs:1,variableArgs:!1},d:{id:de,numArgs:2,variableArgs:!1},ri:{id:ue,numArgs:1,variableArgs:!1},i:{id:ge,numArgs:1,variableArgs:!1},gs:{id:fe,numArgs:1,variableArgs:!1},q:{id:pe,numArgs:0,variableArgs:!1},Q:{id:me,numArgs:0,variableArgs:!1},cm:{id:be,numArgs:6,variableArgs:!1},m:{id:ye,numArgs:2,variableArgs:!1},l:{id:we,numArgs:2,variableArgs:!1},c:{id:Ae,numArgs:6,variableArgs:!1},v:{id:xe,numArgs:4,variableArgs:!1},y:{id:Se,numArgs:4,variableArgs:!1},h:{id:ve,numArgs:0,variableArgs:!1},re:{id:Ce,numArgs:4,variableArgs:!1},S:{id:ke,numArgs:0,variableArgs:!1},s:{id:Te,numArgs:0,variableArgs:!1},f:{id:Fe,numArgs:0,variableArgs:!1},F:{id:Fe,numArgs:0,variableArgs:!1},"f*":{id:Ie,numArgs:0,variableArgs:!1},B:{id:Ee,numArgs:0,variableArgs:!1},"B*":{id:Me,numArgs:0,variableArgs:!1},b:{id:De,numArgs:0,variableArgs:!1},"b*":{id:Oe,numArgs:0,variableArgs:!1},n:{id:_e,numArgs:0,variableArgs:!1},W:{id:Pe,numArgs:0,variableArgs:!1},"W*":{id:Re,numArgs:0,variableArgs:!1},BT:{id:Be,numArgs:0,variableArgs:!1},ET:{id:Ne,numArgs:0,variableArgs:!1},Tc:{id:Le,numArgs:1,variableArgs:!1},Tw:{id:Ue,numArgs:1,variableArgs:!1},Tz:{id:je,numArgs:1,variableArgs:!1},TL:{id:$e,numArgs:1,variableArgs:!1},Tf:{id:He,numArgs:2,variableArgs:!1},Tr:{id:Xe,numArgs:1,variableArgs:!1},Ts:{id:qe,numArgs:1,variableArgs:!1},Td:{id:ze,numArgs:2,variableArgs:!1},TD:{id:We,numArgs:2,variableArgs:!1},Tm:{id:Ge,numArgs:6,variableArgs:!1},"T*":{id:Ve,numArgs:0,variableArgs:!1},Tj:{id:Ke,numArgs:1,variableArgs:!1},TJ:{id:Ye,numArgs:1,variableArgs:!1},"'":{id:Je,numArgs:1,variableArgs:!1},'"':{id:Ze,numArgs:3,variableArgs:!1},d0:{id:Qe,numArgs:2,variableArgs:!1},d1:{id:et,numArgs:6,variableArgs:!1},CS:{id:tt,numArgs:1,variableArgs:!1},cs:{id:it,numArgs:1,variableArgs:!1},SC:{id:nt,numArgs:4,variableArgs:!0},SCN:{id:at,numArgs:33,variableArgs:!0},sc:{id:st,numArgs:4,variableArgs:!0},scn:{id:rt,numArgs:33,variableArgs:!0},G:{id:ot,numArgs:1,variableArgs:!1},g:{id:lt,numArgs:1,variableArgs:!1},RG:{id:ct,numArgs:3,variableArgs:!1},rg:{id:ht,numArgs:3,variableArgs:!1},K:{id:dt,numArgs:4,variableArgs:!1},k:{id:ut,numArgs:4,variableArgs:!1},sh:{id:gt,numArgs:1,variableArgs:!1},BI:{id:ft,numArgs:0,variableArgs:!1},ID:{id:pt,numArgs:0,variableArgs:!1},EI:{id:mt,numArgs:1,variableArgs:!1},Do:{id:bt,numArgs:1,variableArgs:!1},MP:{id:yt,numArgs:1,variableArgs:!1},DP:{id:wt,numArgs:2,variableArgs:!1},BMC:{id:At,numArgs:1,variableArgs:!1},BDC:{id:xt,numArgs:2,variableArgs:!1},EMC:{id:St,numArgs:0,variableArgs:!1},BX:{id:vt,numArgs:0,variableArgs:!1},EX:{id:Ct,numArgs:0,variableArgs:!1},BM:null,BD:null,true:null,fa:null,fal:null,fals:null,false:null,nu:null,nul:null,null:null}))}static MAX_INVALID_PATH_OPS=10;constructor(e,t,i=new StateManager){this.parser=new Parser({lexer:new Lexer(e,EvaluatorPreprocessor.opMap),xref:t}),this.stateManager=i,this.nonProcessedArgs=[],this._isPathOp=!1,this._numInvalidPathOPS=0}get savedStatesDepth(){return this.stateManager.stateStack.length}read(e){let t=e.args;for(;;){const i=this.parser.getObj();if(i instanceof Cmd){const n=i.cmd,a=EvaluatorPreprocessor.opMap[n];if(!a){warn$1(`Unknown command "${n}".`);continue}const s=a.id,r=a.numArgs;let o=null!==t?t.length:0;if(this._isPathOp||(this._numInvalidPathOPS=0),this._isPathOp=s>=ye&&s<=_e,a.variableArgs)o>r&&info$1(`Command ${n}: expected [0, ${r}] args, but received ${o} args.`);else{if(o!==r){const e=this.nonProcessedArgs;for(;o>r;)e.push(t.shift()),o--;for(;o<r&&0!==e.length;)null===t&&(t=[]),t.unshift(e.pop()),o++}if(o<r){const e=`command ${n}: expected ${r} args, but received ${o} args.`;if(this._isPathOp&&++this._numInvalidPathOPS>EvaluatorPreprocessor.MAX_INVALID_PATH_OPS)throw new ti(`Invalid ${e}`);warn$1(`Skipping ${e}`),null!==t&&(t.length=0);continue}}return this.preprocessCommand(s,t),e.fn=s,e.args=t,!0}if(i===ci)return!1;if(null!==i&&(null===t&&(t=[]),t.push(i),t.length>33))throw new ti("Too many arguments")}}preprocessCommand(e,t){switch(0|e){case pe:this.stateManager.save();break;case me:this.stateManager.restore();break;case be:this.stateManager.transform(t)}}}class DefaultAppearanceEvaluator extends EvaluatorPreprocessor{constructor(e){super(new StringStream(e))}parse(){const e={fn:0,args:[]},t={fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3)};try{for(;e.args.length=0,this.read(e);){if(0!==this.savedStatesDepth)continue;const{fn:i,args:n}=e;switch(0|i){case He:const[e,i]=n;e instanceof Name&&(t.fontName=e.name),"number"==typeof i&&i>0&&(t.fontSize=i);break;case ht:ColorSpaceUtils.rgb.getRgbItem(n,0,t.fontColor,0);break;case lt:ColorSpaceUtils.gray.getRgbItem(n,0,t.fontColor,0);break;case ut:ColorSpaceUtils.cmyk.getRgbItem(n,0,t.fontColor,0)}}}catch(e){warn$1(`parseDefaultAppearance - ignoring errors: "${e}".`)}return t}}function parseDefaultAppearance(e){return new DefaultAppearanceEvaluator(e).parse()}class AppearanceStreamEvaluator extends EvaluatorPreprocessor{constructor(e,t,i,n){super(e),this.stream=e,this.evaluatorOptions=t,this.xref=i,this.globalColorSpaceCache=n,this.resources=e.dict?.get("Resources")}parse(){const e={fn:0,args:[]};let t={scaleFactor:1,fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3),fillColorSpace:ColorSpaceUtils.gray},i=!1;const n=[];try{for(;e.args.length=0,!i&&this.read(e);){const{fn:a,args:s}=e;switch(0|a){case pe:n.push({scaleFactor:t.scaleFactor,fontSize:t.fontSize,fontName:t.fontName,fontColor:t.fontColor.slice(),fillColorSpace:t.fillColorSpace});break;case me:t=n.pop()||t;break;case Ge:t.scaleFactor*=Math.hypot(s[0],s[1]);break;case He:const[e,a]=s;e instanceof Name&&(t.fontName=e.name),"number"==typeof a&&a>0&&(t.fontSize=a*t.scaleFactor);break;case it:t.fillColorSpace=ColorSpaceUtils.parse({cs:s[0],xref:this.xref,resources:this.resources,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:this._localColorSpaceCache});break;case st:t.fillColorSpace.getRgbItem(s,0,t.fontColor,0);break;case ht:ColorSpaceUtils.rgb.getRgbItem(s,0,t.fontColor,0);break;case lt:ColorSpaceUtils.gray.getRgbItem(s,0,t.fontColor,0);break;case ut:ColorSpaceUtils.cmyk.getRgbItem(s,0,t.fontColor,0);break;case Ke:case Ye:case Je:case Ze:i=!0}}}catch(e){warn$1(`parseAppearanceStream - ignoring errors: "${e}".`)}return this.stream.reset(),delete t.scaleFactor,delete t.fillColorSpace,t}get _localColorSpaceCache(){return shadow$1(this,"_localColorSpaceCache",new LocalColorSpaceCache)}get _pdfFunctionFactory(){return shadow$1(this,"_pdfFunctionFactory",new PDFFunctionFactory({xref:this.xref,isEvalSupported:this.evaluatorOptions.isEvalSupported}))}}function getPdfColor(e,t){if(e[0]===e[1]&&e[1]===e[2]){return`${numberToString(e[0]/255)} ${t?"g":"G"}`}return Array.from(e,e=>numberToString(e/255)).join(" ")+" "+(t?"rg":"RG")}class FakeUnicodeFont{constructor(e,t){this.xref=e,this.widths=null,this.firstChar=1/0,this.lastChar=-1/0,this.fontFamily=t;const i=new OffscreenCanvas(1,1);this.ctxMeasure=i.getContext("2d",{willReadFrequently:!0}),FakeUnicodeFont._fontNameId||(FakeUnicodeFont._fontNameId=1),this.fontName=Name.get(`InvalidPDFjsFont_${t}_${FakeUnicodeFont._fontNameId++}`)}get fontDescriptorRef(){if(!FakeUnicodeFont._fontDescriptorRef){const e=new Dict(this.xref);e.setIfName("Type","FontDescriptor"),e.set("FontName",this.fontName),e.set("FontFamily","MyriadPro Regular"),e.set("FontBBox",[0,0,0,0]),e.setIfName("FontStretch","Normal"),e.set("FontWeight",400),e.set("ItalicAngle",0),FakeUnicodeFont._fontDescriptorRef=this.xref.getNewPersistentRef(e)}return FakeUnicodeFont._fontDescriptorRef}get descendantFontRef(){const e=new Dict(this.xref);e.set("BaseFont",this.fontName),e.setIfName("Type","Font"),e.setIfName("Subtype","CIDFontType0"),e.setIfName("CIDToGIDMap","Identity"),e.set("FirstChar",this.firstChar),e.set("LastChar",this.lastChar),e.set("FontDescriptor",this.fontDescriptorRef),e.set("DW",1e3);const t=[],i=[...this.widths.entries()].sort();let n=null,a=null;for(const[e,s]of i)n?e===n+a.length?a.push(s):(t.push(n,a),n=e,a=[s]):(n=e,a=[s]);n&&t.push(n,a),e.set("W",t);const s=new Dict(this.xref);return s.set("Ordering","Identity"),s.set("Registry","Adobe"),s.set("Supplement",0),e.set("CIDSystemInfo",s),this.xref.getNewPersistentRef(e)}get baseFontRef(){const e=new Dict(this.xref);return e.set("BaseFont",this.fontName),e.setIfName("Type","Font"),e.setIfName("Subtype","Type0"),e.setIfName("Encoding","Identity-H"),e.set("DescendantFonts",[this.descendantFontRef]),e.setIfName("ToUnicode","Identity-H"),this.xref.getNewPersistentRef(e)}get resources(){const e=new Dict(this.xref),t=new Dict(this.xref);return t.set(this.fontName.name,this.baseFontRef),e.set("Font",t),e}_createContext(){return this.widths=new Map,this.ctxMeasure.font=`1000px ${this.fontFamily}`,this.ctxMeasure}createFontResources(e){const t=this._createContext();for(const i of e.split(/\r\n?|\n/))for(const e of i.split("")){const i=e.charCodeAt(0);if(this.widths.has(i))continue;const n=t.measureText(e),a=Math.ceil(n.width);this.widths.set(i,a),this.firstChar=Math.min(i,this.firstChar),this.lastChar=Math.max(i,this.lastChar)}return this.resources}static getFirstPositionInfo(e,t,a){const[s,r,o,l]=e;let c=o-s,h=l-r;t%180!=0&&([c,h]=[h,c]);const d=i*a;return{coords:[0,h+n*a-d],bbox:[0,0,c,h],matrix:0!==t?getRotationMatrix(t,h,d):void 0}}createAppearance(e,t,a,s,r,o){const l=this._createContext(),c=[];let h=-1/0;for(const t of e.split(/\r\n?|\n/)){c.push(t);const e=l.measureText(t).width;h=Math.max(h,e);for(const e of codePointIter(t)){const t=String.fromCodePoint(e);let i=this.widths.get(e);if(void 0===i){const n=l.measureText(t);i=Math.ceil(n.width),this.widths.set(e,i),this.firstChar=Math.min(e,this.firstChar),this.lastChar=Math.max(e,this.lastChar)}}}h*=s/1e3;const[d,u,g,f]=t;let p=g-d,m=f-u;a%180!=0&&([p,m]=[m,p]);let b=1;h>p&&(b=p/h);let y=1;const w=i*s,x=n*s,S=w*c.length;S>m&&(y=m/S);const v=s*Math.min(b,y),C=["q",`0 0 ${numberToString(p)} ${numberToString(m)} re W n`,"BT",`1 0 0 1 0 ${numberToString(m+x)} Tm 0 Tc ${getPdfColor(r,!0)}`,`/${this.fontName.name} ${numberToString(v)} Tf`],{resources:k}=this;if(1!==(o="number"==typeof o&&o>=0&&o<=1?o:1)){C.push("/R0 gs");const e=new Dict(this.xref),t=new Dict(this.xref);t.set("ca",o),t.set("CA",o),t.setIfName("Type","ExtGState"),e.set("R0",t),k.set("ExtGState",e)}const T=numberToString(w);for(const e of c)C.push(`0 -${T} Td <${stringToUTF16HexString(e)}> Tj`);C.push("ET","Q");const F=C.join("\n"),E=new Dict(this.xref);if(E.setIfName("Subtype","Form"),E.setIfName("Type","XObject"),E.set("BBox",[0,0,p,m]),E.set("Length",F.length),E.set("Resources",k),a){const e=getRotationMatrix(a,p,m);E.set("Matrix",e)}const M=new StringStream(F);return M.dict=E,M}}const Ts=["m/d","m/d/yy","mm/dd/yy","mm/yy","d-mmm","d-mmm-yy","dd-mmm-yy","yy-mm-dd","mmm-yy","mmmm-yy","mmm d, yyyy","mmmm d, yyyy","m/d/yy h:MM tt","m/d/yy HH:MM"],Fs=["HH:MM","h:MM tt","HH:MM:ss","h:MM:ss tt"];class NameOrNumberTree{constructor(e,t,i){this.root=e,this.xref=t,this._type=i}getAll(){const e=new Map;if(!this.root)return e;const t=this.xref,i=new RefSet;i.put(this.root);const n=[this.root];for(;n.length>0;){const a=t.fetchIfRef(n.shift());if(!(a instanceof Dict))continue;if(a.has("Kids")){const e=a.get("Kids");if(!Array.isArray(e))continue;for(const t of e){if(i.has(t))throw new ti(`Duplicate entry in "${this._type}" tree.`);n.push(t),i.put(t)}continue}const s=a.get(this._type);if(Array.isArray(s))for(let i=0,n=s.length;i<n;i+=2)e.set(t.fetchIfRef(s[i]),t.fetchIfRef(s[i+1]))}return e}getRaw(e){if(!this.root)return null;const t=this.xref;let i=t.fetchIfRef(this.root),n=0;for(;i.has("Kids");){if(++n>10)return warn$1(`Search depth limit reached for "${this._type}" tree.`),null;const a=i.get("Kids");if(!Array.isArray(a))return null;let s=0,r=a.length-1;for(;s<=r;){const n=s+r>>1,o=t.fetchIfRef(a[n]),l=o.get("Limits");if(e<t.fetchIfRef(l[0]))r=n-1;else{if(!(e>t.fetchIfRef(l[1]))){i=o;break}s=n+1}}if(s>r)return null}const a=i.get(this._type);if(Array.isArray(a)){let i=0,n=a.length-2;for(;i<=n;){const s=i+n>>1,r=s+(1&s),o=t.fetchIfRef(a[r]);if(e<o)n=r-2;else{if(!(e>o))return a[r+1];i=r+2}}}return null}get(e){return this.xref.fetchIfRef(this.getRaw(e))}}class NameTree extends NameOrNumberTree{constructor(e,t){super(e,t,"Names")}}class NumberTree extends NameOrNumberTree{constructor(e,t){super(e,t,"Nums")}}function clearGlobalCaches(){ma=Object.create(null),hi=Object.create(null),di=Object.create(null),ui=Object.create(null),xn.clear(),JpxImage.cleanup()}function pickPlatformItem(e){return e instanceof Dict?e.has("UF")?e.get("UF"):e.has("F")?e.get("F"):e.has("Unix")?e.get("Unix"):e.has("Mac")?e.get("Mac"):e.has("DOS")?e.get("DOS"):null:null}class FileSpec{#oe=!1;constructor(e,t,i=!1){e instanceof Dict&&(this.xref=t,this.root=e,e.has("FS")&&(this.fs=e.get("FS")),e.has("RF")&&warn$1("Related file specifications are not supported"),i||(e.has("EF")?this.#oe=!0:warn$1("Non-embedded file specifications are not supported")))}get filename(){let e="";const t=pickPlatformItem(this.root);return t&&"string"==typeof t&&(e=stringToPDFString(t,!0).replaceAll("\\\\","\\").replaceAll("\\/","/").replaceAll("\\","/")),shadow$1(this,"filename",e||"unnamed")}get content(){if(!this.#oe)return null;this._contentRef||=pickPlatformItem(this.root?.get("EF"));let e=null;if(this._contentRef){const t=this.xref.fetchIfRef(this._contentRef);t instanceof BaseStream?e=t.getBytes():warn$1("Embedded file specification points to non-existing/invalid content")}else warn$1("Embedded file specification does not have any content");return e}get description(){let e="";const t=this.root?.get("Desc");return t&&"string"==typeof t&&(e=stringToPDFString(t)),shadow$1(this,"description",e)}get serializable(){return{rawFilename:this.filename,filename:(e=this.filename,e.substring(e.lastIndexOf("/")+1)),content:this.content,description:this.description};var e}}const Is=0,Es=-2,Ms=-3,Ds=-4,Os=-5,_s=-6,Rs=-9;function isWhitespace(e,t){const i=e[t];return" "===i||"\n"===i||"\r"===i||"\t"===i}class XMLParserBase{_resolveEntities(e){return e.replaceAll(/&([^;]+);/g,(e,t)=>{if("#x"===t.substring(0,2))return String.fromCodePoint(parseInt(t.substring(2),16));if("#"===t.substring(0,1))return String.fromCodePoint(parseInt(t.substring(1),10));switch(t){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"';case"apos":return"'"}return this.onResolveEntity(t)})}_parseContent(e,t){const i=[];let n=t;function skipWs(){for(;n<e.length&&isWhitespace(e,n);)++n}for(;n<e.length&&!isWhitespace(e,n)&&">"!==e[n]&&"/"!==e[n];)++n;const a=e.substring(t,n);for(skipWs();n<e.length&&">"!==e[n]&&"/"!==e[n]&&"?"!==e[n];){skipWs();let t="",a="";for(;n<e.length&&!isWhitespace(e,n)&&"="!==e[n];)t+=e[n],++n;if(skipWs(),"="!==e[n])return null;++n,skipWs();const s=e[n];if('"'!==s&&"'"!==s)return null;const r=e.indexOf(s,++n);if(r<0)return null;a=e.substring(n,r),i.push({name:t,value:this._resolveEntities(a)}),n=r+1,skipWs()}return{name:a,attributes:i,parsed:n-t}}_parseProcessingInstruction(e,t){let i=t;for(;i<e.length&&!isWhitespace(e,i)&&">"!==e[i]&&"?"!==e[i]&&"/"!==e[i];)++i;const n=e.substring(t,i);!function(){for(;i<e.length&&isWhitespace(e,i);)++i}();const a=i;for(;i<e.length&&("?"!==e[i]||">"!==e[i+1]);)++i;return{name:n,value:e.substring(a,i),parsed:i-t}}parseXml(e){let t=0;for(;t<e.length;){let i=t;if("<"===e[t]){++i;let t;switch(e[i]){case"/":if(++i,t=e.indexOf(">",i),t<0)return void this.onError(Rs);this.onEndElement(e.substring(i,t)),i=t+1;break;case"?":++i;const n=this._parseProcessingInstruction(e,i);if("?>"!==e.substring(i+n.parsed,i+n.parsed+2))return void this.onError(Ms);this.onPi(n.name,n.value),i+=n.parsed+2;break;case"!":if("--"===e.substring(i+1,i+3)){if(t=e.indexOf("--\x3e",i+3),t<0)return void this.onError(Os);this.onComment(e.substring(i+3,t)),i=t+3}else if("[CDATA["===e.substring(i+1,i+8)){if(t=e.indexOf("]]>",i+8),t<0)return void this.onError(Es);this.onCdata(e.substring(i+8,t)),i=t+3}else{if("DOCTYPE"!==e.substring(i+1,i+8))return void this.onError(_s);{const n=e.indexOf("[",i+8);let a=!1;if(t=e.indexOf(">",i+8),t<0)return void this.onError(Ds);if(n>0&&t>n){if(t=e.indexOf("]>",i+8),t<0)return void this.onError(Ds);a=!0}const s=e.substring(i+8,t+(a?1:0));this.onDoctype(s),i=t+(a?2:1)}}break;default:const a=this._parseContent(e,i);if(null===a)return void this.onError(_s);let s=!1;if("/>"===e.substring(i+a.parsed,i+a.parsed+2))s=!0;else if(">"!==e.substring(i+a.parsed,i+a.parsed+1))return void this.onError(Rs);this.onBeginElement(a.name,a.attributes,s),i+=a.parsed+(s?2:1)}}else{for(;i<e.length&&"<"!==e[i];)i++;const n=e.substring(t,i);this.onText(this._resolveEntities(n))}t=i}}onResolveEntity(e){return`&${e};`}onPi(e,t){}onComment(e){}onCdata(e){}onDoctype(e){}onText(e){}onBeginElement(e,t,i){}onEndElement(e){}onError(e){}}class SimpleDOMNode{constructor(e,t){this.nodeName=e,this.nodeValue=t,Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){return this.childNodes?.[0]}get nextSibling(){const e=this.parentNode.childNodes;if(!e)return;const t=e.indexOf(this);return-1!==t?e[t+1]:void 0}get textContent(){return this.childNodes?this.childNodes.map(e=>e.textContent).join(""):this.nodeValue||""}get children(){return this.childNodes||[]}hasChildNodes(){return this.childNodes?.length>0}searchNode(e,t){if(t>=e.length)return this;const i=e[t];if(i.name.startsWith("#")&&t<e.length-1)return this.searchNode(e,t+1);const n=[];let a=this;for(;;){if(i.name===a.nodeName){if(0!==i.pos){if(0===n.length)return null;{const[s]=n.pop();let r=0;for(const n of s.childNodes)if(i.name===n.nodeName){if(r===i.pos)return n.searchNode(e,t+1);r++}return a.searchNode(e,t+1)}}{const i=a.searchNode(e,t+1);if(null!==i)return i}}if(a.childNodes?.length>0)n.push([a,0]),a=a.childNodes[0];else{if(0===n.length)return null;for(;0!==n.length;){const[e,t]=n.pop(),i=t+1;if(i<e.childNodes.length){n.push([e,i]),a=e.childNodes[i];break}}if(0===n.length)return null}}}dump(e){if("#text"!==this.nodeName){if(e.push(`<${this.nodeName}`),this.attributes)for(const t of this.attributes)e.push(` ${t.name}="${encodeToXmlString(t.value)}"`);if(this.hasChildNodes()){e.push(">");for(const t of this.childNodes)t.dump(e);e.push(`</${this.nodeName}>`)}else this.nodeValue?e.push(`>${encodeToXmlString(this.nodeValue)}</${this.nodeName}>`):e.push("/>")}else e.push(encodeToXmlString(this.nodeValue))}}class SimpleXMLParser extends XMLParserBase{constructor({hasAttributes:e=!1,lowerCaseName:t=!1}){super(),this._currentFragment=null,this._stack=null,this._errorCode=Is,this._hasAttributes=e,this._lowerCaseName=t}parseFromString(e){if(this._currentFragment=[],this._stack=[],this._errorCode=Is,this.parseXml(e),this._errorCode!==Is)return;const[t]=this._currentFragment;return t?{documentElement:t}:void 0}onText(e){if(function(e){for(let t=0,i=e.length;t<i;t++)if(!isWhitespace(e,t))return!1;return!0}(e))return;const t=new SimpleDOMNode("#text",e);this._currentFragment.push(t)}onCdata(e){const t=new SimpleDOMNode("#text",e);this._currentFragment.push(t)}onBeginElement(e,t,i){this._lowerCaseName&&(e=e.toLowerCase());const n=new SimpleDOMNode(e);n.childNodes=[],this._hasAttributes&&(n.attributes=t),this._currentFragment.push(n),i||(this._stack.push(this._currentFragment),this._currentFragment=n.childNodes)}onEndElement(e){this._currentFragment=this._stack.pop()||[];const t=this._currentFragment.at(-1);if(!t)return null;for(const e of t.childNodes)e.parentNode=t;return t}onError(e){this._errorCode=e}}class MetadataParser{constructor(e){e=this._repair(e);const t=new SimpleXMLParser({lowerCaseName:!0}).parseFromString(e);this._metadataMap=new Map,this._data=e,t&&this._parse(t)}_repair(e){return e.replace(/^[^<]+/,"").replaceAll(/>\\376\\377([^<]+)/g,function(e,t){const i=t.replaceAll(/\\([0-3])([0-7])([0-7])/g,function(e,t,i,n){return String.fromCharCode(64*t+8*i+1*n)}).replaceAll(/&(amp|apos|gt|lt|quot);/g,function(e,t){switch(t){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error(`_repair: ${t} isn't defined.`)}),n=[">"];for(let e=0,t=i.length;e<t;e+=2){const t=256*i.charCodeAt(e)+i.charCodeAt(e+1);t>=32&&t<127&&60!==t&&62!==t&&38!==t?n.push(String.fromCharCode(t)):n.push("&#x"+(65536+t).toString(16).substring(1)+";")}return n.join("")})}_getSequence(e){const t=e.nodeName;return"rdf:bag"!==t&&"rdf:seq"!==t&&"rdf:alt"!==t?null:e.childNodes.filter(e=>"rdf:li"===e.nodeName)}_parseArray(e){if(!e.hasChildNodes())return;const[t]=e.childNodes,i=this._getSequence(t)||[];this._metadataMap.set(e.nodeName,i.map(e=>e.textContent.trim()))}_parse(e){let t=e.documentElement;if("rdf:rdf"!==t.nodeName)for(t=t.firstChild;t&&"rdf:rdf"!==t.nodeName;)t=t.nextSibling;if(t&&"rdf:rdf"===t.nodeName&&t.hasChildNodes())for(const e of t.childNodes)if("rdf:description"===e.nodeName)for(const t of e.childNodes){const e=t.nodeName;switch(e){case"#text":continue;case"dc:creator":case"dc:subject":this._parseArray(t);continue}this._metadataMap.set(e,t.textContent.trim())}}get serializable(){return{parsedData:this._metadataMap,rawData:this._data}}}const Bs=1,Ns=2,Ls=3,Us=4,js=5;class StructTreeRoot{constructor(e,t,i){this.xref=e,this.dict=t,this.ref=i instanceof Ref?i:null,this.roleMap=new Map,this.structParentIds=null}init(){this.readRoleMap()}#le(e,t,i){if(!(e instanceof Ref)||t<0)return;this.structParentIds||=new RefSetCache;let n=this.structParentIds.get(e);n||(n=[],this.structParentIds.put(e,n)),n.push([t,i])}addAnnotationIdToPage(e,t){this.#le(e,t,Us)}readRoleMap(){const e=this.dict.get("RoleMap");if(e instanceof Dict)for(const[t,i]of e)i instanceof Name&&this.roleMap.set(t,i.name)}static async canCreateStructureTree({catalogRef:e,pdfManager:t,newAnnotationsByPage:i}){if(!(e instanceof Ref))return warn$1("Cannot save the struct tree: no catalog reference."),!1;let n=0,a=!0;for(const[e,s]of i){const{ref:i}=await t.getPage(e);if(!(i instanceof Ref)){warn$1(`Cannot save the struct tree: page ${e} has no ref.`),a=!0;break}for(const e of s)e.accessibilityData?.type&&(e.parentTreeId=n++,a=!1)}if(a){for(const e of i.values())for(const t of e)delete t.parentTreeId;return!1}return!0}static async createStructureTree({newAnnotationsByPage:e,xref:t,catalogRef:i,pdfManager:n,changes:a}){const s=await n.ensureCatalog("cloneDict"),r=new RefSetCache;r.put(i,s);const o=t.getNewTemporaryRef();s.set("StructTreeRoot",o);const l=new Dict(t);l.set("Type",Name.get("StructTreeRoot"));const c=t.getNewTemporaryRef();l.set("ParentTree",c);const h=[];l.set("K",h),r.put(o,l);const d=new Dict(t),u=[];d.set("Nums",u);const g=await this.#ce({newAnnotationsByPage:e,structTreeRootRef:o,structTreeRoot:null,kids:h,nums:u,xref:t,pdfManager:n,changes:a,cache:r});l.set("ParentTreeNextKey",g),r.put(c,d);for(const[e,t]of r.items())a.put(e,{data:t})}async canUpdateStructTree({pdfManager:e,newAnnotationsByPage:t}){if(!this.ref)return warn$1("Cannot update the struct tree: no root reference."),!1;let i=this.dict.get("ParentTreeNextKey");if(!Number.isInteger(i)||i<0)return warn$1("Cannot update the struct tree: invalid next key."),!1;const n=this.dict.get("ParentTree");if(!(n instanceof Dict))return warn$1("Cannot update the struct tree: ParentTree isn't a dict."),!1;const a=n.get("Nums");if(!Array.isArray(a))return warn$1("Cannot update the struct tree: nums isn't an array."),!1;const s=new NumberTree(n,this.xref);for(const i of t.keys()){const{pageDict:t}=await e.getPage(i);if(!t.has("StructParents"))continue;const n=t.get("StructParents");if(!Number.isInteger(n)||!Array.isArray(s.get(n)))return warn$1(`Cannot save the struct tree: page ${i} has a wrong id.`),!1}let r=!0;for(const[n,a]of t){const{pageDict:t}=await e.getPage(n);StructTreeRoot.#he({elements:a,xref:this.xref,pageDict:t,numberTree:s});for(const e of a)e.accessibilityData?.type&&(e.accessibilityData.structParent>=0||(e.parentTreeId=i++),r=!1)}if(r){for(const e of t.values())for(const t of e)delete t.parentTreeId,delete t.structTreeParent;return!1}return!0}async updateStructureTree({newAnnotationsByPage:e,pdfManager:t,changes:i}){const{ref:n,xref:a}=this,s=this.dict.clone(),r=new RefSetCache;r.put(n,s);let o,l=s.getRaw("ParentTree");l instanceof Ref?o=a.fetch(l):(o=l,l=a.getNewTemporaryRef(),s.set("ParentTree",l)),o=o.clone(),r.put(l,o);let c=o.getRaw("Nums"),h=null;c instanceof Ref&&(h=c,c=a.fetch(h)),c=c.slice(),h||o.set("Nums",c);const d=await StructTreeRoot.#ce({newAnnotationsByPage:e,structTreeRootRef:n,structTreeRoot:this,kids:null,nums:c,xref:a,pdfManager:t,changes:i,cache:r});if(-1!==d){s.set("ParentTreeNextKey",d),h&&r.put(h,c);for(const[e,t]of r.items())i.put(e,{data:t})}}static async#ce({newAnnotationsByPage:e,structTreeRootRef:t,structTreeRoot:i,kids:n,nums:a,xref:s,pdfManager:r,changes:o,cache:l}){const c=Name.get("OBJR");let h,d=-1;for(const[u,g]of e){const e=await r.getPage(u),{ref:f}=e,p=f instanceof Ref;for(const{accessibilityData:r,ref:m,parentTreeId:b,structTreeParent:y}of g){if(!r?.type)continue;const{structParent:g}=r;if(i&&Number.isInteger(g)&&g>=0){let t=(h||=new Map).get(u);if(void 0===t){t=new StructTreePage(i,e.pageDict).collectObjects(f),h.set(u,t)}const n=t?.get(g);if(n){const e=s.fetch(n).clone();StructTreeRoot.#de(e,r),o.put(n,{data:e});continue}}d=Math.max(d,b);const w=s.getNewTemporaryRef(),x=new Dict(s);StructTreeRoot.#de(x,r),await this.#ue({structTreeParent:y,tagDict:x,newTagRef:w,structTreeRootRef:t,fallbackKids:n,xref:s,cache:l});const S=new Dict(s);x.set("K",S),S.set("Type",c),p&&S.set("Pg",f),S.set("Obj",m),l.put(w,x),a.push(b,w)}}return d+1}static#de(e,{type:t,title:i,lang:n,alt:a,expanded:s,actualText:r}){e.set("S",Name.get(t)),i&&e.set("T",stringToAsciiOrUTF16BE(i)),n&&e.set("Lang",stringToAsciiOrUTF16BE(n)),a&&e.set("Alt",stringToAsciiOrUTF16BE(a)),s&&e.set("E",stringToAsciiOrUTF16BE(s)),r&&e.set("ActualText",stringToAsciiOrUTF16BE(r))}static#he({elements:e,xref:t,pageDict:i,numberTree:n}){const a=new Map;for(const t of e)if(t.structTreeParentId){const e=parseInt(t.structTreeParentId.split("_mc")[1],10);let i=a.get(e);i||(i=[],a.set(e,i)),i.push(t)}const s=i.get("StructParents");if(!Number.isInteger(s))return;const r=n.get(s),updateElement=(e,i,n)=>{const s=a.get(e);if(s){const e=i.getRaw("P"),a=t.fetchIfRef(e);if(e instanceof Ref&&a instanceof Dict){const e={ref:n,dict:i};for(const t of s)t.structTreeParent=e}return!0}return!1};for(const e of r){if(!(e instanceof Ref))continue;const i=t.fetch(e),n=i.get("K");if(Number.isInteger(n))updateElement(n,i,e);else if(Array.isArray(n))for(let a of n){if(a=t.fetchIfRef(a),Number.isInteger(a)&&updateElement(a,i,e))break;if(!(a instanceof Dict))continue;if(!isName(a.get("Type"),"MCR"))break;const n=a.get("MCID");if(Number.isInteger(n)&&updateElement(n,i,e))break}}}static async#ue({structTreeParent:e,tagDict:t,newTagRef:i,structTreeRootRef:n,fallbackKids:a,xref:s,cache:r}){let o,l=null;e?(({ref:l}=e),o=e.dict.getRaw("P")||n):o=n,t.set("P",o);const c=s.fetchIfRef(o);if(!c)return void a.push(i);let h=r.get(o);h||(h=c.clone(),r.put(o,h));const d=h.getRaw("K");let u=d instanceof Ref?r.get(d):null;if(!u){u=s.fetchIfRef(d),u=Array.isArray(u)?u.slice():[d];const e=s.getNewTemporaryRef();h.set("K",e),r.put(e,u)}const g=u.indexOf(l);u.splice(g>=0?g+1:u.length,0,i)}}class StructElementNode{constructor(e,t){this.tree=e,this.xref=e.xref,this.dict=t,this.kids=[],this.parseKids()}get role(){const e=this.dict.get("S"),t=e instanceof Name?e.name:"",{root:i}=this.tree;return i.roleMap.get(t)??t}parseKids(){let e=null;const t=this.dict.getRaw("Pg");t instanceof Ref&&(e=t.toString());const i=this.dict.get("K");if(Array.isArray(i))for(const t of i){const i=this.parseKid(e,this.xref.fetchIfRef(t));i&&this.kids.push(i)}else{const t=this.parseKid(e,i);t&&this.kids.push(t)}}parseKid(e,t){if(Number.isInteger(t))return this.tree.pageDict.objId!==e?null:new StructElement({type:Bs,mcid:t,pageObjId:e});if(!(t instanceof Dict))return null;const i=t.getRaw("Pg");i instanceof Ref&&(e=i.toString());const n=t.get("Type")instanceof Name?t.get("Type").name:null;if("MCR"===n){if(this.tree.pageDict.objId!==e)return null;const i=t.getRaw("Stm");return new StructElement({type:Ns,refObjId:i instanceof Ref?i.toString():null,pageObjId:e,mcid:t.get("MCID")})}if("OBJR"===n){if(this.tree.pageDict.objId!==e)return null;const i=t.getRaw("Obj");return new StructElement({type:Ls,refObjId:i instanceof Ref?i.toString():null,pageObjId:e})}return new StructElement({type:js,dict:t})}}class StructElement{constructor({type:e,dict:t=null,mcid:i=null,pageObjId:n=null,refObjId:a=null}){this.type=e,this.dict=t,this.mcid=i,this.pageObjId=n,this.refObjId=a,this.parentNode=null}}class StructTreePage{constructor(e,t){this.root=e,this.xref=e?.xref??null,this.rootDict=e?.dict??null,this.pageDict=t,this.nodes=[]}collectObjects(e){if(!(this.root&&this.rootDict&&e instanceof Ref))return null;const t=this.rootDict.get("ParentTree");if(!t)return null;const i=this.root.structParentIds?.get(e);if(!i)return null;const n=new Map,a=new NumberTree(t,this.xref);for(const[e]of i){const t=a.getRaw(e);t instanceof Ref&&n.set(e,t)}return n}parse(e){if(!(this.root&&this.rootDict&&e instanceof Ref))return;const t=this.rootDict.get("ParentTree");if(!t)return;const i=this.pageDict.get("StructParents"),n=this.root.structParentIds?.get(e);if(!Number.isInteger(i)&&!n)return;const a=new Map,s=new NumberTree(t,this.xref);if(Number.isInteger(i)){const e=s.get(i);if(Array.isArray(e))for(const t of e)t instanceof Ref&&this.addNode(this.xref.fetch(t),a)}if(n)for(const[e,t]of n){const i=s.get(e);if(i){const e=this.addNode(this.xref.fetchIfRef(i),a);1===e?.kids?.length&&e.kids[0].type===Ls&&(e.kids[0].type=t)}}}addNode(e,t,i=0){if(i>40)return warn$1("StructTree MAX_DEPTH reached."),null;if(!(e instanceof Dict))return null;if(t.has(e))return t.get(e);const n=new StructElementNode(this,e);t.set(e,n);const a=e.get("P");if(!(a instanceof Dict)||isName(a.get("Type"),"StructTreeRoot"))return this.addTopLevelNode(e,n)||t.delete(e),n;const s=this.addNode(a,t,i+1);if(!s)return n;let r=!1;for(const t of s.kids)t.type===js&&t.dict===e&&(t.parentNode=n,r=!0);return r||t.delete(e),n}addTopLevelNode(e,t){const i=this.rootDict.get("K");if(!i)return!1;if(i instanceof Dict)return i.objId===e.objId&&(this.nodes[0]=t,!0);if(!Array.isArray(i))return!0;let n=!1;for(let a=0;a<i.length;a++){const s=i[a];s?.toString()===e.objId&&(this.nodes[a]=t,n=!0)}return n}get serializable(){function nodeToSerializable(e,t,i=0){if(i>40)return void warn$1("StructTree too deep to be fully serialized.");const n=Object.create(null);n.role=e.role,n.children=[],t.children.push(n);let a=e.dict.get("Alt");"string"!=typeof a&&(a=e.dict.get("ActualText")),"string"==typeof a&&(n.alt=stringToPDFString(a));const s=e.dict.get("A");if(s instanceof Dict){const e=lookupNormalRect(s.getArray("BBox"),null);if(e)n.bbox=e;else{const e=s.get("Width"),t=s.get("Height");"number"==typeof e&&e>0&&"number"==typeof t&&t>0&&(n.bbox=[0,0,e,t])}}const r=e.dict.get("Lang");"string"==typeof r&&(n.lang=stringToPDFString(r));for(const t of e.kids){const e=t.type===js?t.parentNode:null;e?nodeToSerializable(e,n,i+1):t.type===Bs||t.type===Ns?n.children.push({type:"content",id:`p${t.pageObjId}_mc${t.mcid}`}):t.type===Ls?n.children.push({type:"object",id:t.refObjId}):t.type===Us&&n.children.push({type:"annotation",id:`pdfjs_internal_id_${t.refObjId}`})}}const e=Object.create(null);e.children=[],e.role="Root";for(const t of this.nodes)t&&nodeToSerializable(t,e);return e}}const $s=function(e,t,i){if(!Array.isArray(i)||i.length<2)return!1;const[n,a,...s]=i;if(!e(n)&&!Number.isInteger(n))return!1;if(!t(a))return!1;const r=s.length;let o=!0;switch(a.name){case"XYZ":if(r<2||r>3)return!1;break;case"Fit":case"FitB":return 0===r;case"FitH":case"FitBH":case"FitV":case"FitBV":if(r>1)return!1;break;case"FitR":if(4!==r)return!1;o=!1;break;default:return!1}for(const e of s)if(!("number"==typeof e||o&&null===e))return!1;return!0}.bind(null,e=>e instanceof Ref,isName);function fetchDest(e){return e instanceof Dict&&(e=e.get("D")),$s(e)?e:null}function fetchRemoteDest(e){let t=e.get("D");if(t){if(t instanceof Name&&(t=t.name),"string"==typeof t)return stringToPDFString(t,!0);if($s(t))return JSON.stringify(t)}return null}class Catalog{#ge=null;#fe=null;builtInCMapCache=new Map;fontCache=new RefSetCache;globalColorSpaceCache=new GlobalColorSpaceCache;globalImageCache=new GlobalImageCache;nonBlendModesSet=new RefSet;pageDictCache=new RefSetCache;pageIndexCache=new RefSetCache;pageKidsCountCache=new RefSetCache;standardFontDataCache=new Map;systemFontCache=new Map;constructor(e,t){if(this.pdfManager=e,this.xref=t,this.#fe=t.getCatalogObj(),!(this.#fe instanceof Dict))throw new ti("Catalog object is not a dictionary.");this.toplevelPagesDict}cloneDict(){return this.#fe.clone()}get version(){const e=this.#fe.get("Version");if(e instanceof Name){if(gi.test(e.name))return shadow$1(this,"version",e.name);warn$1(`Invalid PDF catalog version: ${e.name}`)}return shadow$1(this,"version",null)}get lang(){const e=this.#fe.get("Lang");return shadow$1(this,"lang",e&&"string"==typeof e?stringToPDFString(e):null)}get needsRendering(){const e=this.#fe.get("NeedsRendering");return shadow$1(this,"needsRendering","boolean"==typeof e&&e)}get collection(){let e=null;try{const t=this.#fe.get("Collection");t instanceof Dict&&t.size>0&&(e=t)}catch(e){if(e instanceof MissingDataException)throw e;info$1("Cannot fetch Collection entry; assuming no collection is present.")}return shadow$1(this,"collection",e)}get acroForm(){let e=null;try{const t=this.#fe.get("AcroForm");t instanceof Dict&&t.size>0&&(e=t)}catch(e){if(e instanceof MissingDataException)throw e;info$1("Cannot fetch AcroForm entry; assuming no forms are present.")}return shadow$1(this,"acroForm",e)}get acroFormRef(){const e=this.#fe.getRaw("AcroForm");return shadow$1(this,"acroFormRef",e instanceof Ref?e:null)}get metadata(){const e=this.#fe.getRaw("Metadata");if(!(e instanceof Ref))return shadow$1(this,"metadata",null);let t=null;try{const i=this.xref.fetch(e,!this.xref.encrypt?.encryptMetadata);if(i instanceof BaseStream&&i.dict instanceof Dict){const e=i.dict.get("Type"),n=i.dict.get("Subtype");if(isName(e,"Metadata")&&isName(n,"XML")){const e=stringToUTF8String$1(i.getString());e&&(t=new MetadataParser(e).serializable)}}}catch(e){if(e instanceof MissingDataException)throw e;info$1(`Skipping invalid Metadata: "${e}".`)}return shadow$1(this,"metadata",t)}get markInfo(){let e=null;try{e=this.#pe()}catch(e){if(e instanceof MissingDataException)throw e;warn$1("Unable to read mark info.")}return shadow$1(this,"markInfo",e)}#pe(){const e=this.#fe.get("MarkInfo");if(!(e instanceof Dict))return null;const t={Marked:!1,UserProperties:!1,Suspects:!1};for(const i in t){const n=e.get(i);"boolean"==typeof n&&(t[i]=n)}return t}get structTreeRoot(){let e=null;try{e=this.#me()}catch(e){if(e instanceof MissingDataException)throw e;warn$1("Unable read to structTreeRoot info.")}return shadow$1(this,"structTreeRoot",e)}#me(){const e=this.#fe.getRaw("StructTreeRoot"),t=this.xref.fetchIfRef(e);if(!(t instanceof Dict))return null;const i=new StructTreeRoot(this.xref,t,e);return i.init(),i}get toplevelPagesDict(){const e=this.#fe.get("Pages");if(!(e instanceof Dict))throw new ti("Invalid top-level pages dictionary.");return shadow$1(this,"toplevelPagesDict",e)}get documentOutline(){let e=null;try{e=this.#be()}catch(e){if(e instanceof MissingDataException)throw e;warn$1("Unable to read document outline.")}return shadow$1(this,"documentOutline",e)}#be(){let e=this.#fe.get("Outlines");if(!(e instanceof Dict))return null;if(e=e.getRaw("First"),!(e instanceof Ref))return null;const t={items:[]},i=[{obj:e,parent:t}],n=new RefSet;n.put(e);const a=this.xref,s=new Uint8ClampedArray(3);for(;i.length>0;){const t=i.shift(),r=a.fetchIfRef(t.obj);if(null===r)continue;r.has("Title")||warn$1("Invalid outline item encountered.");const o={url:null,dest:null,action:null};Catalog.parseDestDictionary({destDict:r,resultObj:o,docBaseUrl:this.baseUrl,docAttachments:this.attachments});const l=r.get("Title"),c=r.get("F")||0,h=r.getArray("C"),d=r.get("Count");let u=s;!isNumberArray(h,3)||0===h[0]&&0===h[1]&&0===h[2]||(u=ColorSpaceUtils.rgb.getRgb(h,0));const g={action:o.action,attachment:o.attachment,dest:o.dest,url:o.url,unsafeUrl:o.unsafeUrl,newWindow:o.newWindow,setOCGState:o.setOCGState,title:"string"==typeof l?stringToPDFString(l):"",color:u,count:Number.isInteger(d)?d:void 0,bold:!!(2&c),italic:!!(1&c),items:[]};t.parent.items.push(g),e=r.getRaw("First"),e instanceof Ref&&!n.has(e)&&(i.push({obj:e,parent:g}),n.put(e)),e=r.getRaw("Next"),e instanceof Ref&&!n.has(e)&&(i.push({obj:e,parent:t.parent}),n.put(e))}return t.items.length>0?t.items:null}get permissions(){let e=null;try{e=this.#ye()}catch(e){if(e instanceof MissingDataException)throw e;warn$1("Unable to read permissions.")}return shadow$1(this,"permissions",e)}#ye(){const e=this.xref.trailer.get("Encrypt");if(!(e instanceof Dict))return null;let t=e.get("P");if("number"!=typeof t)return null;t+=2**32;const i=[];for(const e in w){const n=w[e];t&n&&i.push(n)}return i}get optionalContentConfig(){let e=null;try{const t=this.#fe.get("OCProperties");if(!t)return shadow$1(this,"optionalContentConfig",null);const i=t.get("D");if(!i)return shadow$1(this,"optionalContentConfig",null);const n=t.get("OCGs");if(!Array.isArray(n))return shadow$1(this,"optionalContentConfig",null);const a=new RefSetCache;for(const e of n)e instanceof Ref&&!a.has(e)&&a.put(e,this.#we(e));e=this.#Ae(i,a)}catch(e){if(e instanceof MissingDataException)throw e;warn$1(`Unable to read optional content config: ${e}`)}return shadow$1(this,"optionalContentConfig",e)}#we(e){const t=this.xref.fetch(e),i={id:e.toString(),name:null,intent:null,usage:{print:null,view:null},rbGroups:[]},n=t.get("Name");"string"==typeof n&&(i.name=stringToPDFString(n));let a=t.getArray("Intent");Array.isArray(a)||(a=[a]),a.every(e=>e instanceof Name)&&(i.intent=a.map(e=>e.name));const s=t.get("Usage");if(!(s instanceof Dict))return i;const r=i.usage,o=s.get("Print");if(o instanceof Dict){const e=o.get("PrintState");if(e instanceof Name)switch(e.name){case"ON":case"OFF":r.print={printState:e.name}}}const l=s.get("View");if(l instanceof Dict){const e=l.get("ViewState");if(e instanceof Name)switch(e.name){case"ON":case"OFF":r.view={viewState:e.name}}}return i}#Ae(e,t){function parseOnOff(e){const i=[];if(Array.isArray(e))for(const n of e)n instanceof Ref&&t.has(n)&&i.push(n.toString());return i}function parseOrder(e,i=0){if(!Array.isArray(e))return null;const a=[];for(const s of e){if(s instanceof Ref&&t.has(s)){n.put(s),a.push(s.toString());continue}const e=parseNestedOrder(s,i);e&&a.push(e)}if(i>0)return a;const s=[];for(const[e]of t.items())n.has(e)||s.push(e.toString());return s.length&&a.push({name:null,order:s}),a}function parseNestedOrder(e,t){if(++t>a)return warn$1("parseNestedOrder - reached MAX_NESTED_LEVELS."),null;const n=i.fetchIfRef(e);if(!Array.isArray(n))return null;const s=i.fetchIfRef(n[0]);if("string"!=typeof s)return null;const r=parseOrder(n.slice(1),t);return r?.length?{name:stringToPDFString(s),order:r}:null}const i=this.xref,n=new RefSet,a=10;return function(e){if(Array.isArray(e))for(const n of e){const e=i.fetchIfRef(n);if(!Array.isArray(e)||!e.length)continue;const a=new Set;for(const i of e)i instanceof Ref&&t.has(i)&&!a.has(i.toString())&&(a.add(i.toString()),t.get(i).rbGroups.push(a))}}(e.get("RBGroups")),{name:"string"==typeof e.get("Name")?stringToPDFString(e.get("Name")):null,creator:"string"==typeof e.get("Creator")?stringToPDFString(e.get("Creator")):null,baseState:e.get("BaseState")instanceof Name?e.get("BaseState").name:null,on:parseOnOff(e.get("ON")),off:parseOnOff(e.get("OFF")),order:parseOrder(e.get("Order")),groups:[...t]}}setActualNumPages(e=null){this.#ge=e}get hasActualNumPages(){return null!==this.#ge}get _pagesCount(){const e=this.toplevelPagesDict.get("Count");if(!Number.isInteger(e))throw new ti("Page count in top-level pages dictionary is not an integer.");return shadow$1(this,"_pagesCount",e)}get numPages(){return this.#ge??this._pagesCount}get destinations(){const e=this.#xe(),t=Object.create(null);for(const i of e)if(i instanceof NameTree)for(const[e,n]of i.getAll()){const i=fetchDest(n);i&&(t[stringToPDFString(e,!0)]=i)}else if(i instanceof Dict)for(const[e,n]of i){const i=fetchDest(n);i&&(t[stringToPDFString(e,!0)]||=i)}return shadow$1(this,"destinations",t)}getDestination(e){if(this.hasOwnProperty("destinations"))return this.destinations[e]??null;const t=this.#xe();for(const i of t)if(i instanceof NameTree||i instanceof Dict){const t=fetchDest(i.get(e));if(t)return t}if(t.length){const t=this.destinations[e];if(t)return t}return null}#xe(){const e=this.#fe.get("Names"),t=[];return e?.has("Dests")&&t.push(new NameTree(e.getRaw("Dests"),this.xref)),this.#fe.has("Dests")&&t.push(this.#fe.get("Dests")),t}get pageLabels(){let e=null;try{e=this.#Se()}catch(e){if(e instanceof MissingDataException)throw e;warn$1("Unable to read page labels.")}return shadow$1(this,"pageLabels",e)}#Se(){const e=this.#fe.getRaw("PageLabels");if(!e)return null;const t=new Array(this.numPages);let i=null,n="";const a=new NumberTree(e,this.xref).getAll();let s="",r=1;for(let e=0,o=this.numPages;e<o;e++){const o=a.get(e);if(void 0!==o){if(!(o instanceof Dict))throw new ti("PageLabel is not a dictionary.");if(o.has("Type")&&!isName(o.get("Type"),"PageLabel"))throw new ti("Invalid type in PageLabel dictionary.");if(o.has("S")){const e=o.get("S");if(!(e instanceof Name))throw new ti("Invalid style in PageLabel dictionary.");i=e.name}else i=null;if(o.has("P")){const e=o.get("P");if("string"!=typeof e)throw new ti("Invalid prefix in PageLabel dictionary.");n=stringToPDFString(e)}else n="";if(o.has("St")){const e=o.get("St");if(!(Number.isInteger(e)&&e>=1))throw new ti("Invalid start in PageLabel dictionary.");r=e}else r=1}switch(i){case"D":s=r;break;case"R":case"r":s=toRomanNumerals(r,"r"===i);break;case"A":case"a":const e=26,t="a"===i?97:65,n=r-1;s=String.fromCharCode(t+n%e).repeat(Math.floor(n/e)+1);break;default:if(i)throw new ti(`Invalid style "${i}" in PageLabel dictionary.`);s=""}t[e]=n+s,r++}return t}get pageLayout(){const e=this.#fe.get("PageLayout");let t="";if(e instanceof Name)switch(e.name){case"SinglePage":case"OneColumn":case"TwoColumnLeft":case"TwoColumnRight":case"TwoPageLeft":case"TwoPageRight":t=e.name}return shadow$1(this,"pageLayout",t)}get pageMode(){const e=this.#fe.get("PageMode");let t="UseNone";if(e instanceof Name)switch(e.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"FullScreen":case"UseOC":case"UseAttachments":t=e.name}return shadow$1(this,"pageMode",t)}get viewerPreferences(){const e=this.#fe.get("ViewerPreferences");if(!(e instanceof Dict))return shadow$1(this,"viewerPreferences",null);let t=null;for(const[i,n]of e){let e;switch(i){case"HideToolbar":case"HideMenubar":case"HideWindowUI":case"FitWindow":case"CenterWindow":case"DisplayDocTitle":case"PickTrayByPDFSize":"boolean"==typeof n&&(e=n);break;case"NonFullScreenPageMode":if(n instanceof Name)switch(n.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"UseOC":e=n.name;break;default:e="UseNone"}break;case"Direction":if(n instanceof Name)switch(n.name){case"L2R":case"R2L":e=n.name;break;default:e="L2R"}break;case"ViewArea":case"ViewClip":case"PrintArea":case"PrintClip":if(n instanceof Name)switch(n.name){case"MediaBox":case"CropBox":case"BleedBox":case"TrimBox":case"ArtBox":e=n.name;break;default:e="CropBox"}break;case"PrintScaling":if(n instanceof Name)switch(n.name){case"None":case"AppDefault":e=n.name;break;default:e="AppDefault"}break;case"Duplex":if(n instanceof Name)switch(n.name){case"Simplex":case"DuplexFlipShortEdge":case"DuplexFlipLongEdge":e=n.name;break;default:e="None"}break;case"PrintPageRange":if(Array.isArray(n)&&n.length%2==0){n.every((e,t,i)=>Number.isInteger(e)&&e>0&&(0===t||e>=i[t-1])&&e<=this.numPages)&&(e=n)}break;case"NumCopies":Number.isInteger(n)&&n>0&&(e=n);break;default:warn$1(`Ignoring non-standard key in ViewerPreferences: ${i}.`);continue}void 0!==e?(t??=Object.create(null),t[i]=e):warn$1(`Bad value, for key "${i}", in ViewerPreferences: ${n}.`)}return shadow$1(this,"viewerPreferences",t)}get openAction(){const e=this.#fe.get("OpenAction"),t=Object.create(null);if(e instanceof Dict){const i=new Dict(this.xref);i.set("A",e);const n={url:null,dest:null,action:null};Catalog.parseDestDictionary({destDict:i,resultObj:n}),Array.isArray(n.dest)?t.dest=n.dest:n.action&&(t.action=n.action)}else $s(e)&&(t.dest=e);return shadow$1(this,"openAction",objectSize(t)>0?t:null)}get attachments(){const e=this.#fe.get("Names");let t=null;if(e instanceof Dict&&e.has("EmbeddedFiles")){const i=new NameTree(e.getRaw("EmbeddedFiles"),this.xref);for(const[e,n]of i.getAll()){const i=new FileSpec(n,this.xref);t??=Object.create(null),t[stringToPDFString(e,!0)]=i.serializable}}return shadow$1(this,"attachments",t)}get xfaImages(){const e=this.#fe.get("Names");let t=null;if(e instanceof Dict&&e.has("XFAImages")){const i=new NameTree(e.getRaw("XFAImages"),this.xref);for(const[e,n]of i.getAll())n instanceof BaseStream&&(t??=new Map,t.set(stringToPDFString(e,!0),n.getBytes()))}return shadow$1(this,"xfaImages",t)}#ve(){const e=this.#fe.get("Names");let t=null;function appendIfJavaScriptDict(e,i){if(!(i instanceof Dict))return;if(!isName(i.get("S"),"JavaScript"))return;let n=i.get("JS");if(n instanceof BaseStream)n=n.getString();else if("string"!=typeof n)return;n=stringToPDFString(n,!0).replaceAll("\0",""),n&&(t||=new Map).set(e,n)}if(e instanceof Dict&&e.has("JavaScript")){const t=new NameTree(e.getRaw("JavaScript"),this.xref);for(const[e,i]of t.getAll())appendIfJavaScriptDict(stringToPDFString(e,!0),i)}const i=this.#fe.get("OpenAction");return i&&appendIfJavaScriptDict("OpenAction",i),t}get jsActions(){const e=this.#ve();let t=collectActions(this.xref,this.#fe,ie);if(e){t||=Object.create(null);for(const[i,n]of e)i in t?t[i].push(n):t[i]=[n]}return shadow$1(this,"jsActions",t)}async cleanup(e=!1){clearGlobalCaches(),this.globalColorSpaceCache.clear(),this.globalImageCache.clear(e),this.pageKidsCountCache.clear(),this.pageIndexCache.clear(),this.pageDictCache.clear(),this.nonBlendModesSet.clear();for(const{dict:e}of await Promise.all(this.fontCache))delete e.cacheKey;this.fontCache.clear(),this.builtInCMapCache.clear(),this.standardFontDataCache.clear(),this.systemFontCache.clear()}async getPageDict(e){const t=[this.toplevelPagesDict],i=new RefSet,n=this.#fe.getRaw("Pages");n instanceof Ref&&i.put(n);const a=this.xref,s=this.pageKidsCountCache,r=this.pageIndexCache,o=this.pageDictCache;let l=0;for(;t.length;){const n=t.pop();if(n instanceof Ref){const c=s.get(n);if(c>=0&&l+c<=e){l+=c;continue}if(i.has(n))throw new ti("Pages tree contains circular reference.");i.put(n);const h=await(o.get(n)||a.fetchAsync(n));if(h instanceof Dict){let t=h.getRaw("Type");if(t instanceof Ref&&(t=await a.fetchAsync(t)),isName(t,"Page")||!h.has("Kids")){if(s.has(n)||s.put(n,1),r.has(n)||r.put(n,l),l===e)return[h,n];l++;continue}}t.push(h);continue}if(!(n instanceof Dict))throw new ti("Page dictionary kid reference points to wrong type of object.");const{objId:c}=n;let h=n.getRaw("Count");if(h instanceof Ref&&(h=await a.fetchAsync(h)),Number.isInteger(h)&&h>=0&&(c&&!s.has(c)&&s.put(c,h),l+h<=e)){l+=h;continue}let d=n.getRaw("Kids");if(d instanceof Ref&&(d=await a.fetchAsync(d)),!Array.isArray(d)){let t=n.getRaw("Type");if(t instanceof Ref&&(t=await a.fetchAsync(t)),isName(t,"Page")||!n.has("Kids")){if(l===e)return[n,null];l++;continue}throw new ti("Page dictionary kids object is not an array.")}for(let e=d.length-1;e>=0;e--){const i=d[e];t.push(i),n===this.toplevelPagesDict&&i instanceof Ref&&!o.has(i)&&o.put(i,a.fetchAsync(i))}}throw new Error(`Page index ${e} not found.`)}async getAllPageDicts(e=!1){const{ignoreErrors:t}=this.pdfManager.evaluatorOptions,i=[{currentNode:this.toplevelPagesDict,posInKids:0}],n=new RefSet,a=this.#fe.getRaw("Pages");a instanceof Ref&&n.put(a);const s=new Map,r=this.xref,o=this.pageIndexCache;let l=0;function addPageDict(e,t){t&&!o.has(t)&&o.put(t,l),s.set(l++,[e,t])}function addPageError(i){if(i instanceof XRefEntryException&&!e)throw i;e&&t&&0===l&&(warn$1(`getAllPageDicts - Skipping invalid first page: "${i}".`),i=Dict.empty),s.set(l++,[i,null])}for(;i.length>0;){const e=i.at(-1),{currentNode:t,posInKids:a}=e;let s=t.getRaw("Kids");if(s instanceof Ref)try{s=await r.fetchAsync(s)}catch(e){addPageError(e);break}if(!Array.isArray(s)){addPageError(new ti("Page dictionary kids object is not an array."));break}if(a>=s.length){i.pop();continue}const o=s[a];let l;if(o instanceof Ref){if(n.has(o)){addPageError(new ti("Pages tree contains circular reference."));break}n.put(o);try{l=await r.fetchAsync(o)}catch(e){addPageError(e);break}}else l=o;if(!(l instanceof Dict)){addPageError(new ti("Page dictionary kid reference points to wrong type of object."));break}let c=l.getRaw("Type");if(c instanceof Ref)try{c=await r.fetchAsync(c)}catch(e){addPageError(e);break}isName(c,"Page")||!l.has("Kids")?addPageDict(l,o instanceof Ref?o:null):i.push({currentNode:l,posInKids:0}),e.posInKids++}return s}getPageIndex(e){const t=this.pageIndexCache.get(e);if(void 0!==t)return Promise.resolve(t);const i=this.xref;let n=0;const next=t=>function(t){let n,a=0;return i.fetchAsync(t).then(function(i){if(isRefsEqual(t,e)&&!isDict(i,"Page")&&!(i instanceof Dict&&!i.has("Type")&&i.has("Contents")))throw new ti("The reference does not point to a /Page dictionary.");if(!i)return null;if(!(i instanceof Dict))throw new ti("Node must be a dictionary.");return n=i.getRaw("Parent"),i.getAsync("Parent")}).then(function(e){if(!e)return null;if(!(e instanceof Dict))throw new ti("Parent must be a dictionary.");return e.getAsync("Kids")}).then(function(e){if(!e)return null;const s=[];let r=!1;for(const n of e){if(!(n instanceof Ref))throw new ti("Kid must be a reference.");if(isRefsEqual(n,t)){r=!0;break}s.push(i.fetchAsync(n).then(function(e){if(!(e instanceof Dict))throw new ti("Kid node must be a dictionary.");e.has("Count")?a+=e.get("Count"):a++}))}if(!r)throw new ti("Kid reference not found in parent's kids.");return Promise.all(s).then(()=>[a,n])})}(t).then(t=>{if(!t)return this.pageIndexCache.put(e,n),n;const[i,a]=t;return n+=i,next(a)});return next(e)}get baseUrl(){const e=this.#fe.get("URI");if(e instanceof Dict){const t=e.get("Base");if("string"==typeof t){const e=createValidAbsoluteUrl$1(t,null,{tryConvertEncoding:!0});if(e)return shadow$1(this,"baseUrl",e.href)}}return shadow$1(this,"baseUrl",this.pdfManager.docBaseUrl)}static parseDestDictionary({destDict:e,resultObj:t,docBaseUrl:i=null,docAttachments:n=null}){if(!(e instanceof Dict))return void warn$1("parseDestDictionary: `destDict` must be a dictionary.");let a,s,r=e.get("A");if(r instanceof Dict||(e.has("Dest")?r=e.get("Dest"):(r=e.get("AA"),r instanceof Dict&&(r.has("D")?r=r.get("D"):r.has("U")&&(r=r.get("U"))))),r instanceof Dict){const e=r.get("S");if(!(e instanceof Name))return void warn$1("parseDestDictionary: Invalid type in Action dictionary.");const i=e.name;switch(i){case"ResetForm":const e=r.get("Flags"),o=!(1&("number"==typeof e?e:0)),l=[],c=[];for(const e of r.get("Fields")||[])e instanceof Ref?c.push(e.toString()):"string"==typeof e&&l.push(stringToPDFString(e));t.resetForm={fields:l,refs:c,include:o};break;case"URI":a=r.get("URI"),a instanceof Name&&(a="/"+a.name);break;case"GoTo":s=r.get("D");break;case"Launch":case"GoToR":const h=r.get("F");if(h instanceof Dict){const e=new FileSpec(h,null,!0),{rawFilename:t}=e.serializable;a=t}else"string"==typeof h&&(a=h);const d=fetchRemoteDest(r);d&&"string"==typeof a&&(a=a.split("#",1)[0]+"#"+d);const u=r.get("NewWindow");"boolean"==typeof u&&(t.newWindow=u);break;case"GoToE":const g=r.get("T");let f;if(n&&g instanceof Dict){const e=g.get("R"),t=g.get("N");isName(e,"C")&&"string"==typeof t&&(f=n[stringToPDFString(t,!0)])}if(f){t.attachment=f;const e=fetchRemoteDest(r);e&&(t.attachmentDest=e)}else warn$1('parseDestDictionary - unimplemented "GoToE" action.');break;case"Named":const p=r.get("N");p instanceof Name&&(t.action=p.name);break;case"SetOCGState":const m=r.get("State"),b=r.get("PreserveRB");if(!Array.isArray(m)||0===m.length)break;const y=[];for(const e of m)if(e instanceof Name)switch(e.name){case"ON":case"OFF":case"Toggle":y.push(e.name)}else e instanceof Ref&&y.push(e.toString());if(y.length!==m.length)break;t.setOCGState={state:y,preserveRB:"boolean"!=typeof b||b};break;case"JavaScript":const w=r.get("JS");let x;w instanceof BaseStream?x=w.getString():"string"==typeof w&&(x=w);const S=x&&recoverJsURL(stringToPDFString(x,!0));if(S){a=S.url,t.newWindow=S.newWindow;break}default:if("JavaScript"===i||"SubmitForm"===i)break;warn$1(`parseDestDictionary - unsupported action: "${i}".`)}}else e.has("Dest")&&(s=e.get("Dest"));if("string"==typeof a){const e=createValidAbsoluteUrl$1(a,i,{addDefaultProtocol:!0,tryConvertEncoding:!0});e&&(t.url=e.href),t.unsafeUrl=a}s&&(s instanceof Name&&(s=s.name),"string"==typeof s?t.dest=stringToPDFString(s,!0):$s(s)&&(t.dest=s))}}function mayHaveChildren(e){return e instanceof Ref||e instanceof Dict||e instanceof BaseStream||Array.isArray(e)}function addChildren(e,t){if(e instanceof Dict)e=e.getRawValues();else if(e instanceof BaseStream)e=e.dict.getRawValues();else if(!Array.isArray(e))return;for(const i of e)mayHaveChildren(i)&&t.push(i)}class ObjectLoader{refSet=new RefSet;constructor(e,t,i){this.dict=e,this.keys=t,this.xref=i}async load(){const{keys:e,dict:t}=this,i=[];for(const n of e){const e=t.getRaw(n);void 0!==e&&i.push(e)}await this.#Ce(i),this.refSet=null}async#Ce(e){const t=[],i=[];for(;e.length;){let n=e.pop();if(n instanceof Ref){if(this.refSet.has(n))continue;try{this.refSet.put(n),n=this.xref.fetch(n)}catch(e){if(!(e instanceof MissingDataException))return warn$1(`ObjectLoader.#walk - requesting all data: "${e}".`),void await this.xref.stream.manager.requestAllChunks();t.push(n),i.push({begin:e.begin,end:e.end})}}if(n instanceof BaseStream){const e=n.getBaseStreams();if(e){let a=!1;for(const t of e)t.isDataLoaded||(a=!0,i.push({begin:t.start,end:t.end}));a&&t.push(n)}}addChildren(n,e)}if(i.length){await this.xref.stream.manager.requestRanges(i);for(const e of t)e instanceof Ref&&this.refSet.remove(e);await this.#Ce(t)}}static async load(e,t,i){if(i.stream.isDataLoaded)return;const n=new ObjectLoader(e,t,i);await n.load()}}const Hs=Symbol(),Xs=Symbol(),qs=Symbol(),zs=Symbol(),Ws=Symbol(),Gs=Symbol(),Vs=Symbol(),Ks=Symbol(),Ys=Symbol(),Js=Symbol("content"),Zs=Symbol("data"),Qs=Symbol(),er=Symbol("extra"),tr=Symbol(),ir=Symbol(),nr=Symbol(),ar=Symbol(),sr=Symbol(),rr=Symbol(),or=Symbol(),lr=Symbol(),cr=Symbol(),hr=Symbol(),dr=Symbol(),ur=Symbol(),gr=Symbol(),fr=Symbol(),pr=Symbol(),mr=Symbol(),br=Symbol(),yr=Symbol(),wr=Symbol(),Ar=Symbol(),xr=Symbol(),Sr=Symbol(),vr=Symbol(),Cr=Symbol(),kr=Symbol(),Tr=Symbol(),Fr=Symbol(),Ir=Symbol(),Er=Symbol(),Mr=Symbol(),Dr=Symbol(),Or=Symbol(),_r=Symbol("namespaceId"),Pr=Symbol("nodeName"),Rr=Symbol(),Nr=Symbol(),Lr=Symbol(),Ur=Symbol(),jr=Symbol(),$r=Symbol(),Hr=Symbol(),Xr=Symbol(),qr=Symbol("root"),zr=Symbol(),Wr=Symbol(),Gr=Symbol(),Vr=Symbol(),Kr=Symbol(),Yr=Symbol(),Jr=Symbol(),Zr=Symbol(),Qr=Symbol(),eo=Symbol(),to=Symbol(),io=Symbol("uid"),no=Symbol(),ao={config:{id:0,check:e=>e.startsWith("http://www.xfa.org/schema/xci/")},connectionSet:{id:1,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-connection-set/")},datasets:{id:2,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-data/")},form:{id:3,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-form/")},localeSet:{id:4,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-locale-set/")},pdf:{id:5,check:e=>"http://ns.adobe.com/xdp/pdf/"===e},signature:{id:6,check:e=>"http://www.w3.org/2000/09/xmldsig#"===e},sourceSet:{id:7,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-source-set/")},stylesheet:{id:8,check:e=>"http://www.w3.org/1999/XSL/Transform"===e},template:{id:9,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-template/")},xdc:{id:10,check:e=>e.startsWith("http://www.xfa.org/schema/xdc/")},xdp:{id:11,check:e=>"http://ns.adobe.com/xdp/"===e},xfdf:{id:12,check:e=>"http://ns.adobe.com/xfdf/"===e},xhtml:{id:13,check:e=>"http://www.w3.org/1999/xhtml"===e},xmpmeta:{id:14,check:e=>"http://ns.adobe.com/xmpmeta/"===e}},so={pt:e=>e,cm:e=>e/2.54*72,mm:e=>e/25.4*72,in:e=>72*e,px:e=>e},ro=/([+-]?\d+\.?\d*)(.*)/;function stripQuotes(e){return e.startsWith("'")||e.startsWith('"')?e.slice(1,-1):e}function getInteger({data:e,defaultValue:t,validate:i}){if(!e)return t;e=e.trim();const n=parseInt(e,10);return!isNaN(n)&&i(n)?n:t}function getFloat({data:e,defaultValue:t,validate:i}){if(!e)return t;e=e.trim();const n=parseFloat(e);return!isNaN(n)&&i(n)?n:t}function getKeyword({data:e,defaultValue:t,validate:i}){return e&&i(e=e.trim())?e:t}function getStringOption(e,t){return getKeyword({data:e,defaultValue:t[0],validate:e=>t.includes(e)})}function getMeasurement(e,t="0"){if(t||="0",!e)return getMeasurement(t);const i=e.trim().match(ro);if(!i)return getMeasurement(t);const[,n,a]=i,s=parseFloat(n);if(isNaN(s))return getMeasurement(t);if(0===s)return 0;const r=so[a];return r?r(s):s}function getRatio(e){if(!e)return{num:1,den:1};const t=e.split(":",2).map(e=>parseFloat(e.trim())).filter(e=>!isNaN(e));if(1===t.length&&t.push(1),0===t.length)return{num:1,den:1};const[i,n]=t;return{num:i,den:n}}function getRelevant(e){return e?e.trim().split(/\s+/).map(e=>({excluded:"-"===e[0],viewname:e.substring(1)})):[]}class HTMLResult{static get FAILURE(){return shadow$1(this,"FAILURE",new HTMLResult(!1,null,null,null))}static get EMPTY(){return shadow$1(this,"EMPTY",new HTMLResult(!0,null,null,null))}constructor(e,t,i,n){this.success=e,this.html=t,this.bbox=i,this.breakNode=n}isBreak(){return!!this.breakNode}static breakNode(e){return new HTMLResult(!1,null,null,e)}static success(e,t=null){return new HTMLResult(!0,e,t,null)}}class FontFinder{constructor(e){this.fonts=new Map,this.cache=new Map,this.warned=new Set,this.defaultFont=null,this.add(e)}add(e,t=null){for(const t of e)this.addPdfFont(t);for(const e of this.fonts.values())e.regular||(e.regular=e.italic||e.bold||e.bolditalic);if(!t||0===t.size)return;const i=this.fonts.get("PdfJS-Fallback-PdfJS-XFA");for(const e of t)this.fonts.set(e,i)}addPdfFont(e){const t=e.cssFontInfo,i=t.fontFamily;let n=this.fonts.get(i);n||(n=Object.create(null),this.fonts.set(i,n),this.defaultFont||(this.defaultFont=n));let a="";const s=parseFloat(t.fontWeight);0!==parseFloat(t.italicAngle)?a=s>=700?"bolditalic":"italic":s>=700&&(a="bold"),a||((e.name.includes("Bold")||e.psName?.includes("Bold"))&&(a="bold"),(e.name.includes("Italic")||e.name.endsWith("It")||e.psName?.includes("Italic")||e.psName?.endsWith("It"))&&(a+="italic")),a||(a="regular"),n[a]=e}getDefault(){return this.defaultFont}find(e,t=!0){let i=this.fonts.get(e)||this.cache.get(e);if(i)return i;const n=/,|-|_| |bolditalic|bold|italic|regular|it/gi;let a=e.replaceAll(n,"");if(i=this.fonts.get(a),i)return this.cache.set(e,i),i;a=a.toLowerCase();const s=[];for(const[e,t]of this.fonts.entries())e.replaceAll(n,"").toLowerCase().startsWith(a)&&s.push(t);if(0===s.length)for(const[,e]of this.fonts.entries())e.regular.name?.replaceAll(n,"").toLowerCase().startsWith(a)&&s.push(e);if(0===s.length){a=a.replaceAll(/psmt|mt/gi,"");for(const[e,t]of this.fonts.entries())e.replaceAll(n,"").toLowerCase().startsWith(a)&&s.push(t)}if(0===s.length)for(const e of this.fonts.values())e.regular.name?.replaceAll(n,"").toLowerCase().startsWith(a)&&s.push(e);return s.length>=1?(1!==s.length&&t&&warn$1(`XFA - Too many choices to guess the correct font: ${e}`),this.cache.set(e,s[0]),s[0]):(t&&!this.warned.has(e)&&(this.warned.add(e),warn$1(`XFA - Cannot find the font: ${e}`)),null)}}function selectFont(e,t){return"italic"===e.posture?"bold"===e.weight?t.bolditalic:t.italic:"bold"===e.weight?t.bold:t.regular}class text_FontInfo{constructor(e,t,i,n){if(this.lineHeight=i,this.paraMargin=t||{top:0,bottom:0,left:0,right:0},!e)return void([this.pdfFont,this.xfaFont]=this.defaultFont(n));this.xfaFont={typeface:e.typeface,posture:e.posture,weight:e.weight,size:e.size,letterSpacing:e.letterSpacing};const a=n.find(e.typeface);a?(this.pdfFont=selectFont(e,a),this.pdfFont||([this.pdfFont,this.xfaFont]=this.defaultFont(n))):[this.pdfFont,this.xfaFont]=this.defaultFont(n)}defaultFont(e){const t=e.find("Helvetica",!1)||e.find("Myriad Pro",!1)||e.find("Arial",!1)||e.getDefault();if(t?.regular){const e=t.regular;return[e,{typeface:e.cssFontInfo.fontFamily,posture:"normal",weight:"normal",size:10,letterSpacing:0}]}return[null,{typeface:"Courier",posture:"normal",weight:"normal",size:10,letterSpacing:0}]}}class FontSelector{constructor(e,t,i,n){this.fontFinder=n,this.stack=[new text_FontInfo(e,t,i,n)]}pushData(e,t,i){const n=this.stack.at(-1);for(const t of["typeface","posture","weight","size","letterSpacing"])e[t]||(e[t]=n.xfaFont[t]);for(const e of["top","bottom","left","right"])isNaN(t[e])&&(t[e]=n.paraMargin[e]);const a=new text_FontInfo(e,t,i||n.lineHeight,this.fontFinder);a.pdfFont||(a.pdfFont=n.pdfFont),this.stack.push(a)}popFont(){this.stack.pop()}topFont(){return this.stack.at(-1)}}class TextMeasure{constructor(e,t,i,n){this.glyphs=[],this.fontSelector=new FontSelector(e,t,i,n),this.extraHeight=0}pushData(e,t,i){this.fontSelector.pushData(e,t,i)}popFont(e){return this.fontSelector.popFont()}addPara(){const e=this.fontSelector.topFont();this.extraHeight+=e.paraMargin.top+e.paraMargin.bottom}addString(e){if(!e)return;const t=this.fontSelector.topFont(),i=t.xfaFont.size;if(t.pdfFont){const n=t.xfaFont.letterSpacing,a=t.pdfFont,s=a.lineHeight||1.2,r=t.lineHeight||Math.max(1.2,s)*i,o=s-(void 0===a.lineGap?.2:a.lineGap),l=Math.max(1,o)*i,c=i/1e3,h=a.defaultWidth||a.charsToGlyphs(" ")[0].width;for(const t of e.split(/[\u2029\n]/)){const e=a.encodeString(t).join(""),i=a.charsToGlyphs(e);for(const e of i){const t=e.width||h;this.glyphs.push([t*c+n,r,l,e.unicode,!1])}this.glyphs.push([0,0,0,"\n",!0])}return void this.glyphs.pop()}for(const t of e.split(/[\u2029\n]/)){for(const e of t.split(""))this.glyphs.push([i,1.2*i,i,e,!1]);this.glyphs.push([0,0,0,"\n",!0])}this.glyphs.pop()}compute(e){let t=-1,i=0,n=0,a=0,s=0,r=0,o=!1,l=!0;for(let c=0,h=this.glyphs.length;c<h;c++){const[h,d,u,g,f]=this.glyphs[c],p=" "===g,m=l?u:d;f?(n=Math.max(n,s),s=0,a+=r,r=m,t=-1,i=0,l=!1):p?s+h>e?(n=Math.max(n,s),s=0,a+=r,r=m,t=-1,i=0,o=!0,l=!1):(r=Math.max(m,r),i=s,s+=h,t=c):s+h>e?(a+=r,r=m,-1!==t?(c=t,n=Math.max(n,i),s=0,t=-1,i=0):(n=Math.max(n,s),s=h),o=!0,l=!1):(s+=h,r=Math.max(m,r))}return n=Math.max(n,s),a+=r+this.extraHeight,{width:1.02*n,height:a,isBroken:o}}}const oo=/^[^.[]+/,lo=/^[^\]]+/,co=0,ho=1,uo=2,go=3,fo=4,po=new Map([["$data",(e,t)=>e.datasets?e.datasets.data:e],["$record",(e,t)=>(e.datasets?e.datasets.data:e)[ur]()[0]],["$template",(e,t)=>e.template],["$connectionSet",(e,t)=>e.connectionSet],["$form",(e,t)=>e.form],["$layout",(e,t)=>e.layout],["$host",(e,t)=>e.host],["$dataWindow",(e,t)=>e.dataWindow],["$event",(e,t)=>e.event],["!",(e,t)=>e.datasets],["$xfa",(e,t)=>e],["xfa",(e,t)=>e],["$",(e,t)=>t]]),mo=new WeakMap;function parseIndex(e){return"*"===(e=e.trim())?1/0:parseInt(e,10)||0}function parseExpression(e,t,i=!0){let n=e.match(oo);if(!n)return null;let[a]=n;const s=[{name:a,cacheName:"."+a,index:0,js:null,formCalc:null,operator:co}];let r=a.length;for(;r<e.length;){const o=r;if("["===e.charAt(r++)){if(n=e.slice(r).match(lo),!n)return warn$1("XFA - Invalid index in SOM expression"),null;s.at(-1).index=parseIndex(n[0]),r+=n[0].length+1;continue}let l;switch(e.charAt(r)){case".":if(!t)return null;r++,l=ho;break;case"#":r++,l=uo;break;case"[":if(i)return warn$1("XFA - SOM expression contains a FormCalc subexpression which is not supported for now."),null;l=go;break;case"(":if(i)return warn$1("XFA - SOM expression contains a JavaScript subexpression which is not supported for now."),null;l=fo;break;default:l=co}if(n=e.slice(r).match(oo),!n)break;[a]=n,r+=a.length,s.push({name:a,cacheName:e.slice(o,r),operator:l,index:0,js:null,formCalc:null})}return s}function searchNode(e,t,i,n=!0,a=!0){const s=parseExpression(i,n);if(!s)return null;const r=po.get(s[0].name);let o,l=0;r?(o=!0,e=[r(e,t)],l=1):(o=null===t,e=[t||e]);for(let i=s.length;l<i;l++){const{name:i,cacheName:n,operator:r,index:c}=s[l],h=[];for(const t of e){if(!t.isXFAObject)continue;let e,s;if(a&&(s=mo.get(t),s||(s=new Map,mo.set(t,s)),e=s.get(n)),!e){switch(r){case co:e=t[or](i,!1);break;case ho:e=t[or](i,!0);break;case uo:e=t[rr](i),e=e.isXFAObjectArray?e.children:[e]}a&&s.set(n,e)}e.length>0&&h.push(e)}if(0===h.length&&!o&&0===l){const i=t[mr]();if(!(t=i))return null;l=-1,e=[t];continue}e=isFinite(c)?h.filter(e=>c<e.length).map(e=>e[c]):h.flat()}return 0===e.length?null:e}function createDataNode(e,t,i){const n=parseExpression(i);if(!n)return null;if(n.some(e=>e.operator===ho))return null;const a=po.get(n[0].name);let s=0;a?(e=a(e,t),s=1):e=t||e;for(let t=n.length;s<t;s++){const{name:t,operator:i,index:a}=n[s];if(!isFinite(a))return n[s].index=0,e.createNodes(n.slice(s));let r;switch(i){case co:r=e[or](t,!1);break;case ho:r=e[or](t,!0);break;case uo:r=e[rr](t),r=r.isXFAObjectArray?r.children:[r]}if(0===r.length)return e.createNodes(n.slice(s));if(!(a<r.length))return n[s].index=a-r.length,e.createNodes(n.slice(s));{const t=r[a];if(!t.isXFAObject)return warn$1("XFA - Cannot create a node."),null;e=t}}return null}const bo=Symbol(),yo=Symbol(),wo=Symbol(),Ao=Symbol("_children"),xo=Symbol(),So=Symbol(),vo=Symbol(),Co=Symbol(),ko=Symbol(),Fo=Symbol(),Io=Symbol(),Eo=Symbol(),Mo=Symbol(),Do=Symbol("parent"),Oo=Symbol(),_o=Symbol(),Po=Symbol();let Ro=0;const Bo=ao.datasets.id;class XFAObject{constructor(e,t,i=!1){this[_r]=e,this[Pr]=t,this[Io]=i,this[Do]=null,this[Ao]=[],this[io]=`${t}${Ro++}`,this[yr]=null}get isXFAObject(){return!0}get isXFAObjectArray(){return!1}createNodes(e){let t=this,i=null;for(const{name:n,index:a}of e){for(let e=0,s=isFinite(a)?a:0;e<=s;e++){const e=t[_r]===Bo?-1:t[_r];i=new XmlObject(e,n),t[qs](i)}t=i}return i}[Nr](e){if(!this[Io]||!this[Lr](e))return!1;const t=e[Pr],i=this[t];if(!(i instanceof XFAObjectArray))return null!==i&&this[Xr](i),this[t]=e,this[qs](e),!0;if(i.push(e))return this[qs](e),!0;let n="";return this.id?n=` (id: ${this.id})`:this.name&&(n=` (name: ${this.name} ${this.h.value})`),warn$1(`XFA - node "${this[Pr]}"${n} has already enough "${t}"!`),!1}[Lr](e){return this.hasOwnProperty(e[Pr])&&e[_r]===this[_r]}[Fr](){return!1}[Hs](){return!1}[vr](){return!1}[Cr](){return!1}[$r](){this.para&&this[br]()[er].paraStack.pop()}[Hr](){this[br]()[er].paraStack.push(this.para)}[Gr](e){this.id&&this[_r]===ao.template.id&&e.set(this.id,this)}[br](){return this[yr].template}[Ir](){return!1}[Er](){return!1}[qs](e){e[Do]=this,this[Ao].push(e),!e[yr]&&this[yr]&&(e[yr]=this[yr])}[Xr](e){const t=this[Ao].indexOf(e);this[Ao].splice(t,1)}[wr](){return this.hasOwnProperty("value")}[Kr](e){}[Ur](e){}[tr](){}[Ws](e){delete this[Io],this[Vs]&&(e.clean(this[Vs]),delete this[Vs])}[xr](e){return this[Ao].indexOf(e)}[Sr](e,t){t[Do]=this,this[Ao].splice(e,0,t),!t[yr]&&this[yr]&&(t[yr]=this[yr])}[Mr](){return!this.name}[Or](){return""}[Jr](){return 0===this[Ao].length?this[Js]:this[Ao].map(e=>e[Jr]()).join("")}get[wo](){const e=Object.getPrototypeOf(this);if(!e._attributes){const t=e._attributes=new Set;for(const e of Object.getOwnPropertyNames(this)){if(null===this[e]||this[e]instanceof XFAObject||this[e]instanceof XFAObjectArray)break;t.add(e)}}return shadow$1(this,wo,e._attributes)}[Tr](e){let t=this;for(;t;){if(t===e)return!0;t=t[mr]()}return!1}[mr](){return this[Do]}[pr](){return this[mr]()}[ur](e=null){return e?this[e]:this[Ao]}[Qs](){const e=Object.create(null);this[Js]&&(e.$content=this[Js]);for(const t of Object.getOwnPropertyNames(this)){const i=this[t];null!==i&&(i instanceof XFAObject?e[t]=i[Qs]():i instanceof XFAObjectArray?i.isEmpty()||(e[t]=i.dump()):e[t]=i)}return e}[to](){return null}[Qr](){return HTMLResult.EMPTY}*[gr](){for(const e of this[ur]())yield e}*[Co](e,t){for(const i of this[gr]())if(!e||t===e.has(i[Pr])){const e=this[sr](),t=i[Qr](e);t.success||(this[er].failingNode=i),yield t}}[ir](){return null}[Xs](e,t){this[er].children.push(e)}[sr](){}[zs]({filter:e=null,include:t=!0}){if(this[er].generator){const e=this[sr](),t=this[er].failingNode[Qr](e);if(!t.success)return t;t.html&&this[Xs](t.html,t.bbox),delete this[er].failingNode}else this[er].generator=this[Co](e,t);for(;;){const e=this[er].generator.next();if(e.done)break;const t=e.value;if(!t.success)return t;t.html&&this[Xs](t.html,t.bbox)}return this[er].generator=null,HTMLResult.EMPTY}[Vr](e){this[_o]=new Set(Object.keys(e))}[Fo](e){const t=this[wo],i=this[_o];return[...e].filter(e=>t.has(e)&&!i.has(e))}[zr](e,t=new Set){for(const i of this[Ao])i[Oo](e,t)}[Oo](e,t){const i=this[ko](e,t);i?this[bo](i,e,t):this[zr](e,t)}[ko](e,t){const{use:i,usehref:n}=this;if(!i&&!n)return null;let a=null,s=null,r=null,o=i;if(n?(o=n,n.startsWith("#som(")&&n.endsWith(")")?s=n.slice(5,-1):n.startsWith(".#som(")&&n.endsWith(")")?s=n.slice(6,-1):n.startsWith("#")?r=n.slice(1):n.startsWith(".#")&&(r=n.slice(2))):i.startsWith("#")?r=i.slice(1):s=i,this.use=this.usehref="",r?a=e.get(r):(a=searchNode(e.get(qr),this,s,!0,!1),a&&(a=a[0])),!a)return warn$1(`XFA - Invalid prototype reference: ${o}.`),null;if(a[Pr]!==this[Pr])return warn$1(`XFA - Incompatible prototype: ${a[Pr]} !== ${this[Pr]}.`),null;if(t.has(a))return warn$1("XFA - Cycle detected in prototypes use."),null;t.add(a);const l=a[ko](e,t);return l&&a[bo](l,e,t),a[zr](e,t),t.delete(a),a}[bo](e,t,i){if(i.has(e))return void warn$1("XFA - Cycle detected in prototypes use.");!this[Js]&&e[Js]&&(this[Js]=e[Js]);new Set(i).add(e);for(const t of this[Fo](e[_o]))this[t]=e[t],this[_o]&&this[_o].add(t);for(const n of Object.getOwnPropertyNames(this)){if(this[wo].has(n))continue;const a=this[n],s=e[n];if(a instanceof XFAObjectArray){for(const e of a[Ao])e[Oo](t,i);for(let n=a[Ao].length,r=s[Ao].length;n<r;n++){const s=e[Ao][n][Ks]();if(!a.push(s))break;s[Do]=this,this[Ao].push(s),s[Oo](t,i)}}else if(null===a){if(null!==s){const e=s[Ks]();e[Do]=this,this[n]=e,this[Ao].push(e),e[Oo](t,i)}}else a[zr](t,i),s&&a[bo](s,t,i)}}static[xo](e){return Array.isArray(e)?e.map(e=>XFAObject[xo](e)):"object"==typeof e&&null!==e?Object.assign({},e):e}[Ks](){const e=Object.create(Object.getPrototypeOf(this));for(const t of Object.getOwnPropertySymbols(this))try{e[t]=this[t]}catch{shadow$1(e,t,this[t])}e[io]=`${e[Pr]}${Ro++}`,e[Ao]=[];for(const t of Object.getOwnPropertyNames(this)){if(this[wo].has(t)){e[t]=XFAObject[xo](this[t]);continue}const i=this[t];e[t]=i instanceof XFAObjectArray?new XFAObjectArray(i[Eo]):null}for(const t of this[Ao]){const i=t[Pr],n=t[Ks]();e[Ao].push(n),n[Do]=e,null===e[i]?e[i]=n:e[i][Ao].push(n)}return e}[ur](e=null){return e?this[Ao].filter(t=>t[Pr]===e):this[Ao]}[rr](e){return this[e]}[or](e,t,i=!0){return Array.from(this[lr](e,t,i))}*[lr](e,t,i=!0){if("parent"!==e){for(const i of this[Ao])i[Pr]===e&&(yield i),i.name===e&&(yield i),(t||i[Mr]())&&(yield*i[lr](e,t,!1));i&&this[wo].has(e)&&(yield new XFAAttribute(this,e,this[e]))}else yield this[Do]}}class XFAObjectArray{constructor(e=1/0){this[Eo]=e,this[Ao]=[]}get isXFAObject(){return!1}get isXFAObjectArray(){return!0}push(e){return this[Ao].length<=this[Eo]?(this[Ao].push(e),!0):(warn$1(`XFA - node "${e[Pr]}" accepts no more than ${this[Eo]} children`),!1)}isEmpty(){return 0===this[Ao].length}dump(){return 1===this[Ao].length?this[Ao][0][Qs]():this[Ao].map(e=>e[Qs]())}[Ks](){const e=new XFAObjectArray(this[Eo]);return e[Ao]=this[Ao].map(e=>e[Ks]()),e}get children(){return this[Ao]}clear(){this[Ao].length=0}}class XFAAttribute{constructor(e,t,i){this[Do]=e,this[Pr]=t,this[Js]=i,this[Ys]=!1,this[io]="attribute"+Ro++}[mr](){return this[Do]}[kr](){return!0}[cr](){return this[Js].trim()}[Kr](e){e=e.value||"",this[Js]=e.toString()}[Jr](){return this[Js]}[Tr](e){return this[Do]===e||this[Do][Tr](e)}}class XmlObject extends XFAObject{constructor(e,t,i={}){if(super(e,t),this[Js]="",this[So]=null,"#text"!==t){const e=new Map;this[yo]=e;for(const[t,n]of Object.entries(i))e.set(t,new XFAAttribute(this,t,n));if(i.hasOwnProperty(Rr)){const e=i[Rr].xfa.dataNode;void 0!==e&&("dataGroup"===e?this[So]=!1:"dataValue"===e&&(this[So]=!0))}}this[Ys]=!1}[eo](e){const t=this[Pr];if("#text"===t)return void e.push(encodeToXmlString(this[Js]));const i=utf8StringToString(t),n=this[_r]===Bo?"xfa:":"";e.push(`<${n}${i}`);for(const[t,i]of this[yo].entries()){const n=utf8StringToString(t);e.push(` ${n}="${encodeToXmlString(i[Js])}"`)}if(null!==this[So]&&(this[So]?e.push(' xfa:dataNode="dataValue"'):e.push(' xfa:dataNode="dataGroup"')),this[Js]||0!==this[Ao].length){if(e.push(">"),this[Js])"string"==typeof this[Js]?e.push(encodeToXmlString(this[Js])):this[Js][eo](e);else for(const t of this[Ao])t[eo](e);e.push(`</${n}${i}>`)}else e.push("/>")}[Nr](e){if(this[Js]){const e=new XmlObject(this[_r],"#text");this[qs](e),e[Js]=this[Js],this[Js]=""}return this[qs](e),!0}[Ur](e){this[Js]+=e}[tr](){if(this[Js]&&this[Ao].length>0){const e=new XmlObject(this[_r],"#text");this[qs](e),e[Js]=this[Js],delete this[Js]}}[Qr](){return"#text"===this[Pr]?HTMLResult.success({name:"#text",value:this[Js]}):HTMLResult.EMPTY}[ur](e=null){return e?this[Ao].filter(t=>t[Pr]===e):this[Ao]}[ar](){return this[yo]}[rr](e){const t=this[yo].get(e);return void 0!==t?t:this[ur](e)}*[lr](e,t){const i=this[yo].get(e);i&&(yield i);for(const i of this[Ao])i[Pr]===e&&(yield i),t&&(yield*i[lr](e,t))}*[nr](e,t){const i=this[yo].get(e);!i||t&&i[Ys]||(yield i);for(const i of this[Ao])yield*i[nr](e,t)}*[dr](e,t,i){for(const n of this[Ao])n[Pr]!==e||i&&n[Ys]||(yield n),t&&(yield*n[dr](e,t,i))}[kr](){return null===this[So]?0===this[Ao].length||this[Ao][0][_r]===ao.xhtml.id:this[So]}[cr](){return null===this[So]?0===this[Ao].length?this[Js].trim():this[Ao][0][_r]===ao.xhtml.id?this[Ao][0][Jr]().trim():null:this[Js].trim()}[Kr](e){e=e.value||"",this[Js]=e.toString()}[Qs](e=!1){const t=Object.create(null);e&&(t.$ns=this[_r]),this[Js]&&(t.$content=this[Js]),t.$name=this[Pr],t.children=[];for(const i of this[Ao])t.children.push(i[Qs](e));t.attributes=Object.create(null);for(const[e,i]of this[yo])t.attributes[e]=i[Js];return t}}class ContentObject extends XFAObject{constructor(e,t){super(e,t),this[Js]=""}[Ur](e){this[Js]+=e}[tr](){}}class OptionObject extends ContentObject{constructor(e,t,i){super(e,t),this[Mo]=i}[tr](){this[Js]=getKeyword({data:this[Js],defaultValue:this[Mo][0],validate:e=>this[Mo].includes(e)})}[Ws](e){super[Ws](e),delete this[Mo]}}class StringObject extends ContentObject{[tr](){this[Js]=this[Js].trim()}}class IntegerObject extends ContentObject{constructor(e,t,i,n){super(e,t),this[vo]=i,this[Po]=n}[tr](){this[Js]=getInteger({data:this[Js],defaultValue:this[vo],validate:this[Po]})}[Ws](e){super[Ws](e),delete this[vo],delete this[Po]}}class Option01 extends IntegerObject{constructor(e,t){super(e,t,0,e=>1===e)}}class Option10 extends IntegerObject{constructor(e,t){super(e,t,1,e=>0===e)}}function measureToString(e){return"string"==typeof e?"0px":Number.isInteger(e)?`${e}px`:`${e.toFixed(2)}px`}const No={anchorType(e,t){const i=e[pr]();if(i&&(!i.layout||"position"===i.layout))switch("transform"in t||(t.transform=""),e.anchorType){case"bottomCenter":t.transform+="translate(-50%, -100%)";break;case"bottomLeft":t.transform+="translate(0,-100%)";break;case"bottomRight":t.transform+="translate(-100%,-100%)";break;case"middleCenter":t.transform+="translate(-50%,-50%)";break;case"middleLeft":t.transform+="translate(0,-50%)";break;case"middleRight":t.transform+="translate(-100%,-50%)";break;case"topCenter":t.transform+="translate(-50%,0)";break;case"topRight":t.transform+="translate(-100%,0)"}},dimensions(e,t){const i=e[pr]();let n=e.w;const a=e.h;if(i.layout?.includes("row")){const t=i[er],a=e.colSpan;let s;-1===a?(s=Math.sumPrecise(t.columnWidths.slice(t.currentColumn)),t.currentColumn=0):(s=Math.sumPrecise(t.columnWidths.slice(t.currentColumn,t.currentColumn+a)),t.currentColumn=(t.currentColumn+e.colSpan)%t.columnWidths.length),isNaN(s)||(n=e.w=s)}t.width=""!==n?measureToString(n):"auto",t.height=""!==a?measureToString(a):"auto"},position(e,t){const i=e[pr]();i?.layout&&"position"!==i.layout||(t.position="absolute",t.left=measureToString(e.x),t.top=measureToString(e.y))},rotate(e,t){e.rotate&&("transform"in t||(t.transform=""),t.transform+=`rotate(-${e.rotate}deg)`,t.transformOrigin="top left")},presence(e,t){switch(e.presence){case"invisible":t.visibility="hidden";break;case"hidden":case"inactive":t.display="none"}},hAlign(e,t){if("para"===e[Pr])switch(e.hAlign){case"justifyAll":t.textAlign="justify-all";break;case"radix":t.textAlign="left";break;default:t.textAlign=e.hAlign}else switch(e.hAlign){case"left":t.alignSelf="start";break;case"center":t.alignSelf="center";break;case"right":t.alignSelf="end"}},margin(e,t){e.margin&&(t.margin=e.margin[to]().margin)}};function setMinMaxDimensions(e,t){"position"===e[pr]().layout&&(e.minW>0&&(t.minWidth=measureToString(e.minW)),e.maxW>0&&(t.maxWidth=measureToString(e.maxW)),e.minH>0&&(t.minHeight=measureToString(e.minH)),e.maxH>0&&(t.maxHeight=measureToString(e.maxH)))}function layoutText(e,t,i,n,a,s){const r=new TextMeasure(t,i,n,a);return"string"==typeof e?r.addString(e):e[jr](r),r.compute(s)}function layoutNode(e,t){let i=null,n=null,a=!1;if((!e.w||!e.h)&&e.value){let s=0,r=0;e.margin&&(s=e.margin.leftInset+e.margin.rightInset,r=e.margin.topInset+e.margin.bottomInset);let o=null,l=null;e.para&&(l=Object.create(null),o=""===e.para.lineHeight?null:e.para.lineHeight,l.top=""===e.para.spaceAbove?0:e.para.spaceAbove,l.bottom=""===e.para.spaceBelow?0:e.para.spaceBelow,l.left=""===e.para.marginLeft?0:e.para.marginLeft,l.right=""===e.para.marginRight?0:e.para.marginRight);let c=e.font;if(!c){const t=e[br]();let i=e[mr]();for(;i&&i!==t;){if(i.font){c=i.font;break}i=i[mr]()}}const h=(e.w||t.width)-s,d=e[yr].fontFinder;if(e.value.exData&&e.value.exData[Js]&&"text/html"===e.value.exData.contentType){const t=layoutText(e.value.exData[Js],c,l,o,d,h);n=t.width,i=t.height,a=t.isBroken}else{const t=e.value[Jr]();if(t){const e=layoutText(t,c,l,o,d,h);n=e.width,i=e.height,a=e.isBroken}}null===n||e.w||(n+=s),null===i||e.h||(i+=r)}return{w:n,h:i,isBroken:a}}function computeBbox(e,t,i){let n;if(""!==e.w&&""!==e.h)n=[e.x,e.y,e.w,e.h];else{if(!i)return null;let a=e.w;if(""===a){if(0===e.maxW){const t=e[pr]();a="position"===t.layout&&""!==t.w?0:e.minW}else a=Math.min(e.maxW,i.width);t.attributes.style.width=measureToString(a)}let s=e.h;if(""===s){if(0===e.maxH){const t=e[pr]();s="position"===t.layout&&""!==t.h?0:e.minH}else s=Math.min(e.maxH,i.height);t.attributes.style.height=measureToString(s)}n=[e.x,e.y,a,s]}return n}function fixDimensions(e){const t=e[pr]();if(t.layout?.includes("row")){const i=t[er],n=e.colSpan;let a;a=-1===n?Math.sumPrecise(i.columnWidths.slice(i.currentColumn)):Math.sumPrecise(i.columnWidths.slice(i.currentColumn,i.currentColumn+n)),isNaN(a)||(e.w=a)}t.layout&&"position"!==t.layout&&(e.x=e.y=0),"table"===e.layout&&""===e.w&&Array.isArray(e.columnWidths)&&(e.w=Math.sumPrecise(e.columnWidths))}function layoutClass(e){switch(e.layout){case"position":default:return"xfaPosition";case"lr-tb":return"xfaLrTb";case"rl-row":return"xfaRlRow";case"rl-tb":return"xfaRlTb";case"row":return"xfaRow";case"table":return"xfaTable";case"tb":return"xfaTb"}}function toStyle(e,...t){const i=Object.create(null);for(const n of t){const t=e[n];if(null!==t)if(No.hasOwnProperty(n))No[n](e,i);else if(t instanceof XFAObject){const e=t[to]();e?Object.assign(i,e):warn$1(`(DEBUG) - XFA - style for ${n} not implemented yet`)}}return i}function createWrapper(e,t){const{attributes:i}=t,{style:n}=i,a={name:"div",attributes:{class:["xfaWrapper"],style:Object.create(null)},children:[]};if(i.class.push("xfaWrapped"),e.border){const{widths:i,insets:s}=e.border[er];let r,o,l=s[0],c=s[3];const h=s[0]+s[2],d=s[1]+s[3];switch(e.border.hand){case"even":l-=i[0]/2,c-=i[3]/2,r=`calc(100% + ${(i[1]+i[3])/2-d}px)`,o=`calc(100% + ${(i[0]+i[2])/2-h}px)`;break;case"left":l-=i[0],c-=i[3],r=`calc(100% + ${i[1]+i[3]-d}px)`,o=`calc(100% + ${i[0]+i[2]-h}px)`;break;case"right":r=d?`calc(100% - ${d}px)`:"100%",o=h?`calc(100% - ${h}px)`:"100%"}const u=["xfaBorder"];isPrintOnly(e.border)&&u.push("xfaPrintOnly");const g={name:"div",attributes:{class:u,style:{top:`${l}px`,left:`${c}px`,width:r,height:o}},children:[]};for(const e of["border","borderWidth","borderColor","borderRadius","borderStyle"])void 0!==n[e]&&(g.attributes.style[e]=n[e],delete n[e]);a.children.push(g,t)}else a.children.push(t);for(const e of["background","backgroundClip","top","left","width","height","minWidth","minHeight","maxWidth","maxHeight","transform","transformOrigin","visibility"])void 0!==n[e]&&(a.attributes.style[e]=n[e],delete n[e]);return a.attributes.style.position="absolute"===n.position?"absolute":"relative",delete n.position,n.alignSelf&&(a.attributes.style.alignSelf=n.alignSelf,delete n.alignSelf),a}function fixTextIndent(e){const t=getMeasurement(e.textIndent,"0px");if(t>=0)return;const i="padding"+("left"===("right"===e.textAlign?"right":"left")?"Left":"Right"),n=getMeasurement(e[i],"0px");e[i]=n-t+"px"}function setAccess(e,t){switch(e.access){case"nonInteractive":t.push("xfaNonInteractive");break;case"readOnly":t.push("xfaReadOnly");break;case"protected":t.push("xfaDisabled")}}function isPrintOnly(e){return e.relevant.length>0&&!e.relevant[0].excluded&&"print"===e.relevant[0].viewname}function getCurrentPara(e){const t=e[br]()[er].paraStack;return t.length?t.at(-1):null}function setPara(e,t,i){if(i.attributes.class?.includes("xfaRich")){t&&(""===e.h&&(t.height="auto"),""===e.w&&(t.width="auto"));const n=getCurrentPara(e);if(n){const e=i.attributes.style;switch(e.display="flex",e.flexDirection="column",n.vAlign){case"top":e.justifyContent="start";break;case"bottom":e.justifyContent="end";break;case"middle":e.justifyContent="center"}const t=n[to]();for(const[i,n]of Object.entries(t))i in e||(e[i]=n)}}}function setFontFamily(e,t,i,n){if(!i)return void delete n.fontFamily;const a=stripQuotes(e.typeface);n.fontFamily=`"${a}"`;const s=i.find(a);if(s){const{fontFamily:i}=s.regular.cssFontInfo;i!==a&&(n.fontFamily=`"${i}"`);const r=getCurrentPara(t);if(r&&""!==r.lineHeight)return;if(n.lineHeight)return;const o=selectFont(e,s);o&&(n.lineHeight=Math.max(1.2,o.lineHeight))}}function fixURL(e){const t=createValidAbsoluteUrl$1(e,null,{addDefaultProtocol:!0,tryConvertEncoding:!0});return t?t.href:null}function createLine(e,t){return{name:"div",attributes:{class:["lr-tb"===e.layout?"xfaLr":"xfaRl"]},children:t}}function flushHTML(e){if(!e[er])return null;const t={name:"div",attributes:e[er].attributes,children:e[er].children};if(e[er].failingNode){const i=e[er].failingNode[ir]();i&&(e.layout.endsWith("-tb")?t.children.push(createLine(e,[i])):t.children.push(i))}return 0===t.children.length?null:t}function addHTML(e,t,i){const n=e[er],a=n.availableSpace,[s,r,o,l]=i;switch(e.layout){case"position":n.width=Math.max(n.width,s+o),n.height=Math.max(n.height,r+l),n.children.push(t);break;case"lr-tb":case"rl-tb":n.line&&1!==n.attempt||(n.line=createLine(e,[]),n.children.push(n.line),n.numberInLine=0),n.numberInLine+=1,n.line.children.push(t),0===n.attempt?(n.currentWidth+=o,n.height=Math.max(n.height,n.prevHeight+l)):(n.currentWidth=o,n.prevHeight=n.height,n.height+=l,n.attempt=0),n.width=Math.max(n.width,n.currentWidth);break;case"rl-row":case"row":{n.children.push(t),n.width+=o,n.height=Math.max(n.height,l);const e=measureToString(n.height);for(const t of n.children)t.attributes.style.height=e;break}case"table":case"tb":n.width=MathClamp$1(o,n.width,a.width),n.height+=l,n.children.push(t)}}function getAvailableSpace(e){const t=e[er].availableSpace,i=e.margin?e.margin.topInset+e.margin.bottomInset:0,n=e.margin?e.margin.leftInset+e.margin.rightInset:0;switch(e.layout){case"lr-tb":case"rl-tb":return 0===e[er].attempt?{width:t.width-n-e[er].currentWidth,height:t.height-i-e[er].prevHeight}:{width:t.width-n,height:t.height-i-e[er].height};case"rl-row":case"row":return{width:Math.sumPrecise(e[er].columnWidths.slice(e[er].currentColumn)),height:t.height-n};case"table":case"tb":return{width:t.width-n,height:t.height-i-e[er].height};default:return t}}function checkDimensions(e,t){if(null===e[br]()[er].firstUnsplittable)return!0;if(0===e.w||0===e.h)return!0;const i=e[pr](),n=i[er]?.attempt||0,[,a,s,r]=function(e){let t,i,n=""===e.w?NaN:e.w,a=""===e.h?NaN:e.h,[s,r]=[0,0];switch(e.anchorType||""){case"bottomCenter":[s,r]=[n/2,a];break;case"bottomLeft":[s,r]=[0,a];break;case"bottomRight":[s,r]=[n,a];break;case"middleCenter":[s,r]=[n/2,a/2];break;case"middleLeft":[s,r]=[0,a/2];break;case"middleRight":[s,r]=[n,a/2];break;case"topCenter":[s,r]=[n/2,0];break;case"topRight":[s,r]=[n,0]}switch(e.rotate||0){case 0:[t,i]=[-s,-r];break;case 90:[t,i]=[-r,s],[n,a]=[a,-n];break;case 180:[t,i]=[s,r],[n,a]=[-n,-a];break;case 270:[t,i]=[r,-s],[n,a]=[-a,n]}return[e.x+t+Math.min(0,n),e.y+i+Math.min(0,a),Math.abs(n),Math.abs(a)]}(e);switch(i.layout){case"lr-tb":case"rl-tb":return 0===n?e[br]()[er].noLayoutFailure?""!==e.w?Math.round(s-t.width)<=2:t.width>2:!(""!==e.h&&Math.round(r-t.height)>2)&&(""!==e.w?Math.round(s-t.width)<=2||0===i[er].numberInLine&&t.height>2:t.width>2):!!e[br]()[er].noLayoutFailure||!(""!==e.h&&Math.round(r-t.height)>2)&&((""===e.w||Math.round(s-t.width)<=2||!i[Er]())&&t.height>2);case"table":case"tb":return!!e[br]()[er].noLayoutFailure||(""===e.h||e[Ir]()?(""===e.w||Math.round(s-t.width)<=2||!i[Er]())&&t.height>2:Math.round(r-t.height)<=2);case"position":if(e[br]()[er].noLayoutFailure)return!0;if(""===e.h||Math.round(r+a-t.height)<=2)return!0;return r+a>e[br]()[er].currentContentArea.h;case"rl-row":case"row":return!!e[br]()[er].noLayoutFailure||(""===e.h||Math.round(r-t.height)<=2);default:return!0}}const Lo=ao.template.id,Uo="http://www.w3.org/2000/svg",jo=/^H(\d+)$/,$o=new Set(["image/gif","image/jpeg","image/jpg","image/pjpeg","image/png","image/apng","image/x-png","image/bmp","image/x-ms-bmp","image/tiff","image/tif","application/octet-stream"]),Ho=[[[66,77],"image/bmp"],[[255,216,255],"image/jpeg"],[[73,73,42,0],"image/tiff"],[[77,77,0,42],"image/tiff"],[[71,73,70,56,57,97],"image/gif"],[[137,80,78,71,13,10,26,10],"image/png"]];function getBorderDims(e){if(!e||!e.border)return{w:0,h:0};const t=e.border[hr]();return t?{w:t.widths[0]+t.widths[2]+t.insets[0]+t.insets[2],h:t.widths[1]+t.widths[3]+t.insets[1]+t.insets[3]}:{w:0,h:0}}function hasMargin(e){return e.margin&&(e.margin.topInset||e.margin.rightInset||e.margin.bottomInset||e.margin.leftInset)}function _setValue(e,t){if(!e.value){const t=new Value({});e[qs](t),e.value=t}e.value[Kr](t)}function*getContainedChildren(e){for(const t of e[ur]())t instanceof SubformSet?yield*t[gr]():yield t}function isRequired(e){return"error"===e.validate?.nullTest}function setTabIndex(e){for(;e;){if(!e.traversal)return void(e[Yr]=e[mr]()[Yr]);if(e[Yr])return;let t=null;for(const i of e.traversal[ur]())if("next"===i.operation){t=i;break}if(!t||!t.ref)return void(e[Yr]=e[mr]()[Yr]);const i=e[br]();e[Yr]=++i[Yr];const n=i[Wr](t.ref,e);if(!n)return;e=n[0]}}function applyAssist(e,t){const i=e.assist;if(i){const e=i[Qr]();e&&(t.title=e);const n=i.role.match(jo);if(n){const e="heading",i=n[1];t.role=e,t["aria-level"]=i}}if("table"===e.layout)t.role="table";else if("row"===e.layout)t.role="row";else{const i=e[mr]();"row"===i.layout&&(t.role="TH"===i.assist?.role?"columnheader":"cell")}}function ariaLabel(e){if(!e.assist)return null;const t=e.assist;return t.speak&&""!==t.speak[Js]?t.speak[Js]:t.toolTip?t.toolTip[Js]:null}function valueToHtml(e){return HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:Object.create(null)},children:[{name:"span",attributes:{style:Object.create(null)},value:e}]})}function setFirstUnsplittable(e){const t=e[br]();null===t[er].firstUnsplittable&&(t[er].firstUnsplittable=e,t[er].noLayoutFailure=!0)}function unsetFirstUnsplittable(e){const t=e[br]();t[er].firstUnsplittable===e&&(t[er].noLayoutFailure=!1)}function handleBreak(e){if(e[er])return!1;if(e[er]=Object.create(null),"auto"===e.targetType)return!1;const t=e[br]();let i=null;if(e.target){if(i=t[Wr](e.target,e[mr]()),!i)return!1;i=i[0]}const{currentPageArea:n,currentContentArea:a}=t[er];if("pageArea"===e.targetType)return i instanceof PageArea||(i=null),e.startNew?(e[er].target=i||n,!0):!(!i||i===n)&&(e[er].target=i,!0);i instanceof ContentArea||(i=null);const s=i&&i[mr]();let r,o=s;if(e.startNew)if(i){const e=s.contentArea.children,t=e.indexOf(a),n=e.indexOf(i);-1!==t&&t<n&&(o=null),r=n-1}else r=n.contentArea.children.indexOf(a);else{if(!i||i===a)return!1;r=s.contentArea.children.indexOf(i)-1,o=s===n?null:s}return e[er].target=o,e[er].index=r,!0}function handleOverflow(e,t,i){const n=e[br](),a=n[er].noLayoutFailure,s=t[pr];t[pr]=()=>e,n[er].noLayoutFailure=!0;const r=t[Qr](i);e[Xs](r.html,r.bbox),n[er].noLayoutFailure=a,t[pr]=s}class AppearanceFilter extends StringObject{constructor(e){super(Lo,"appearanceFilter"),this.id=e.id||"",this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||""}}class Arc extends XFAObject{constructor(e){super(Lo,"arc",!0),this.circular=getInteger({data:e.circular,defaultValue:0,validate:e=>1===e}),this.hand=getStringOption(e.hand,["even","left","right"]),this.id=e.id||"",this.startAngle=getFloat({data:e.startAngle,defaultValue:0,validate:e=>!0}),this.sweepAngle=getFloat({data:e.sweepAngle,defaultValue:360,validate:e=>!0}),this.use=e.use||"",this.usehref=e.usehref||"",this.edge=null,this.fill=null}[Qr](){const e=this.edge||new Edge({}),t=e[to](),i=Object.create(null);let n;"visible"===this.fill?.presence?Object.assign(i,this.fill[to]()):i.fill="transparent",i.strokeWidth=measureToString("visible"===e.presence?e.thickness:0),i.stroke=t.color;const a={xmlns:Uo,style:{width:"100%",height:"100%",overflow:"visible"}};if(360===this.sweepAngle)n={name:"ellipse",attributes:{xmlns:Uo,cx:"50%",cy:"50%",rx:"50%",ry:"50%",style:i}};else{const e=this.startAngle*Math.PI/180,t=this.sweepAngle*Math.PI/180,s=this.sweepAngle>180?1:0,[r,o,l,c]=[50*(1+Math.cos(e)),50*(1-Math.sin(e)),50*(1+Math.cos(e+t)),50*(1-Math.sin(e+t))];n={name:"path",attributes:{xmlns:Uo,d:`M ${r} ${o} A 50 50 0 ${s} 0 ${l} ${c}`,vectorEffect:"non-scaling-stroke",style:i}},Object.assign(a,{viewBox:"0 0 100 100",preserveAspectRatio:"none"})}const s={name:"svg",children:[n],attributes:a};return hasMargin(this[mr]()[mr]())?HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[s]}):(s.attributes.style.position="absolute",HTMLResult.success(s))}}class Area extends XFAObject{constructor(e){super(Lo,"area",!0),this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e}),this.id=e.id||"",this.name=e.name||"",this.relevant=getRelevant(e.relevant),this.use=e.use||"",this.usehref=e.usehref||"",this.x=getMeasurement(e.x,"0pt"),this.y=getMeasurement(e.y,"0pt"),this.desc=null,this.extras=null,this.area=new XFAObjectArray,this.draw=new XFAObjectArray,this.exObject=new XFAObjectArray,this.exclGroup=new XFAObjectArray,this.field=new XFAObjectArray,this.subform=new XFAObjectArray,this.subformSet=new XFAObjectArray}*[gr](){yield*getContainedChildren(this)}[Mr](){return!0}[Cr](){return!0}[Xs](e,t){const[i,n,a,s]=t;this[er].width=Math.max(this[er].width,i+a),this[er].height=Math.max(this[er].height,n+s),this[er].children.push(e)}[sr](){return this[er].availableSpace}[Qr](e){const t=toStyle(this,"position"),i={style:t,id:this[io],class:["xfaArea"]};isPrintOnly(this)&&i.class.push("xfaPrintOnly"),this.name&&(i.xfaName=this.name);const n=[];this[er]={children:n,width:0,height:0,availableSpace:e};const a=this[zs]({filter:new Set(["area","draw","field","exclGroup","subform","subformSet"]),include:!0});if(!a.success)return a.isBreak()?a:(delete this[er],HTMLResult.FAILURE);t.width=measureToString(this[er].width),t.height=measureToString(this[er].height);const s={name:"div",attributes:i,children:n},r=[this.x,this.y,this[er].width,this[er].height];return delete this[er],HTMLResult.success(s,r)}}class Assist extends XFAObject{constructor(e){super(Lo,"assist",!0),this.id=e.id||"",this.role=e.role||"",this.use=e.use||"",this.usehref=e.usehref||"",this.speak=null,this.toolTip=null}[Qr](){return this.toolTip?.[Js]||null}}class Barcode extends XFAObject{constructor(e){super(Lo,"barcode",!0),this.charEncoding=getKeyword({data:e.charEncoding?e.charEncoding.toLowerCase():"",defaultValue:"",validate:e=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(e)||e.match(/iso-8859-\d{2}/)}),this.checksum=getStringOption(e.checksum,["none","1mod10","1mod10_1mod11","2mod10","auto"]),this.dataColumnCount=getInteger({data:e.dataColumnCount,defaultValue:-1,validate:e=>e>=0}),this.dataLength=getInteger({data:e.dataLength,defaultValue:-1,validate:e=>e>=0}),this.dataPrep=getStringOption(e.dataPrep,["none","flateCompress"]),this.dataRowCount=getInteger({data:e.dataRowCount,defaultValue:-1,validate:e=>e>=0}),this.endChar=e.endChar||"",this.errorCorrectionLevel=getInteger({data:e.errorCorrectionLevel,defaultValue:-1,validate:e=>e>=0&&e<=8}),this.id=e.id||"",this.moduleHeight=getMeasurement(e.moduleHeight,"5mm"),this.moduleWidth=getMeasurement(e.moduleWidth,"0.25mm"),this.printCheckDigit=getInteger({data:e.printCheckDigit,defaultValue:0,validate:e=>1===e}),this.rowColumnRatio=getRatio(e.rowColumnRatio),this.startChar=e.startChar||"",this.textLocation=getStringOption(e.textLocation,["below","above","aboveEmbedded","belowEmbedded","none"]),this.truncate=getInteger({data:e.truncate,defaultValue:0,validate:e=>1===e}),this.type=getStringOption(e.type?e.type.toLowerCase():"",["aztec","codabar","code2of5industrial","code2of5interleaved","code2of5matrix","code2of5standard","code3of9","code3of9extended","code11","code49","code93","code128","code128a","code128b","code128c","code128sscc","datamatrix","ean8","ean8add2","ean8add5","ean13","ean13add2","ean13add5","ean13pwcd","fim","logmars","maxicode","msi","pdf417","pdf417macro","plessey","postauscust2","postauscust3","postausreplypaid","postausstandard","postukrm4scc","postusdpbc","postusimb","postusstandard","postus5zip","qrcode","rfid","rss14","rss14expanded","rss14limited","rss14stacked","rss14stackedomni","rss14truncated","telepen","ucc128","ucc128random","ucc128sscc","upca","upcaadd2","upcaadd5","upcapwcd","upce","upceadd2","upceadd5","upcean2","upcean5","upsmaxicode"]),this.upsMode=getStringOption(e.upsMode,["usCarrier","internationalCarrier","secureSymbol","standardSymbol"]),this.use=e.use||"",this.usehref=e.usehref||"",this.wideNarrowRatio=getRatio(e.wideNarrowRatio),this.encrypt=null,this.extras=null}}class Bind extends XFAObject{constructor(e){super(Lo,"bind",!0),this.match=getStringOption(e.match,["once","dataRef","global","none"]),this.ref=e.ref||"",this.picture=null}}class BindItems extends XFAObject{constructor(e){super(Lo,"bindItems"),this.connection=e.connection||"",this.labelRef=e.labelRef||"",this.ref=e.ref||"",this.valueRef=e.valueRef||""}}class Bookend extends XFAObject{constructor(e){super(Lo,"bookend"),this.id=e.id||"",this.leader=e.leader||"",this.trailer=e.trailer||"",this.use=e.use||"",this.usehref=e.usehref||""}}class BooleanElement extends Option01{constructor(e){super(Lo,"boolean"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}[Qr](e){return valueToHtml(1===this[Js]?"1":"0")}}class Border extends XFAObject{constructor(e){super(Lo,"border",!0),this.break=getStringOption(e.break,["close","open"]),this.hand=getStringOption(e.hand,["even","left","right"]),this.id=e.id||"",this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(e.relevant),this.use=e.use||"",this.usehref=e.usehref||"",this.corner=new XFAObjectArray(4),this.edge=new XFAObjectArray(4),this.extras=null,this.fill=null,this.margin=null}[hr](){if(!this[er]){const e=this.edge.children.slice();if(e.length<4){const t=e.at(-1)||new Edge({});for(let i=e.length;i<4;i++)e.push(t)}const t=e.map(e=>e.thickness),i=[0,0,0,0];this.margin&&(i[0]=this.margin.topInset,i[1]=this.margin.rightInset,i[2]=this.margin.bottomInset,i[3]=this.margin.leftInset),this[er]={widths:t,insets:i,edges:e}}return this[er]}[to](){const{edges:e}=this[hr](),t=e.map(e=>{const t=e[to]();return t.color||="#000000",t}),i=Object.create(null);if(this.margin&&Object.assign(i,this.margin[to]()),"visible"===this.fill?.presence&&Object.assign(i,this.fill[to]()),this.corner.children.some(e=>0!==e.radius)){const e=this.corner.children.map(e=>e[to]());if(2===e.length||3===e.length){const t=e.at(-1);for(let i=e.length;i<4;i++)e.push(t)}i.borderRadius=e.map(e=>e.radius).join(" ")}switch(this.presence){case"invisible":case"hidden":i.borderStyle="";break;case"inactive":i.borderStyle="none";break;default:i.borderStyle=t.map(e=>e.style).join(" ")}return i.borderWidth=t.map(e=>e.width).join(" "),i.borderColor=t.map(e=>e.color).join(" "),i}}class Break extends XFAObject{constructor(e){super(Lo,"break",!0),this.after=getStringOption(e.after,["auto","contentArea","pageArea","pageEven","pageOdd"]),this.afterTarget=e.afterTarget||"",this.before=getStringOption(e.before,["auto","contentArea","pageArea","pageEven","pageOdd"]),this.beforeTarget=e.beforeTarget||"",this.bookendLeader=e.bookendLeader||"",this.bookendTrailer=e.bookendTrailer||"",this.id=e.id||"",this.overflowLeader=e.overflowLeader||"",this.overflowTarget=e.overflowTarget||"",this.overflowTrailer=e.overflowTrailer||"",this.startNew=getInteger({data:e.startNew,defaultValue:0,validate:e=>1===e}),this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null}}class BreakAfter extends XFAObject{constructor(e){super(Lo,"breakAfter",!0),this.id=e.id||"",this.leader=e.leader||"",this.startNew=getInteger({data:e.startNew,defaultValue:0,validate:e=>1===e}),this.target=e.target||"",this.targetType=getStringOption(e.targetType,["auto","contentArea","pageArea"]),this.trailer=e.trailer||"",this.use=e.use||"",this.usehref=e.usehref||"",this.script=null}}class BreakBefore extends XFAObject{constructor(e){super(Lo,"breakBefore",!0),this.id=e.id||"",this.leader=e.leader||"",this.startNew=getInteger({data:e.startNew,defaultValue:0,validate:e=>1===e}),this.target=e.target||"",this.targetType=getStringOption(e.targetType,["auto","contentArea","pageArea"]),this.trailer=e.trailer||"",this.use=e.use||"",this.usehref=e.usehref||"",this.script=null}[Qr](e){return this[er]={},HTMLResult.FAILURE}}class Button extends XFAObject{constructor(e){super(Lo,"button",!0),this.highlight=getStringOption(e.highlight,["inverted","none","outline","push"]),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null}[Qr](e){const t=this[mr]()[mr](),i={name:"button",attributes:{id:this[io],class:["xfaButton"],style:{}},children:[]};for(const e of t.event.children){if("click"!==e.activity||!e.script)continue;const t=recoverJsURL(e.script[Js]);if(!t)continue;const n=fixURL(t.url);n&&i.children.push({name:"a",attributes:{id:"link"+this[io],href:n,newWindow:t.newWindow,class:["xfaLink"],style:{}},children:[]})}return HTMLResult.success(i)}}class Calculate extends XFAObject{constructor(e){super(Lo,"calculate",!0),this.id=e.id||"",this.override=getStringOption(e.override,["disabled","error","ignore","warning"]),this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null,this.message=null,this.script=null}}class Caption extends XFAObject{constructor(e){super(Lo,"caption",!0),this.id=e.id||"",this.placement=getStringOption(e.placement,["left","bottom","inline","right","top"]),this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]),this.reserve=Math.ceil(getMeasurement(e.reserve)),this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null,this.font=null,this.margin=null,this.para=null,this.value=null}[Kr](e){_setValue(this,e)}[hr](e){if(!this[er]){let{width:t,height:i}=e;switch(this.placement){case"left":case"right":case"inline":t=this.reserve<=0?t:this.reserve;break;case"top":case"bottom":i=this.reserve<=0?i:this.reserve}this[er]=layoutNode(this,{width:t})}return this[er]}[Qr](e){if(!this.value)return HTMLResult.EMPTY;this[Hr]();const t=this.value[Qr](e).html;if(!t)return this[$r](),HTMLResult.EMPTY;const i=this.reserve;if(this.reserve<=0){const{w:t,h:i}=this[hr](e);switch(this.placement){case"left":case"right":case"inline":this.reserve=t;break;case"top":case"bottom":this.reserve=i}}const n=[];"string"==typeof t?n.push({name:"#text",value:t}):n.push(t);const a=toStyle(this,"font","margin","visibility");switch(this.placement){case"left":case"right":this.reserve>0&&(a.width=measureToString(this.reserve));break;case"top":case"bottom":this.reserve>0&&(a.height=measureToString(this.reserve))}return setPara(this,null,t),this[$r](),this.reserve=i,HTMLResult.success({name:"div",attributes:{style:a,class:["xfaCaption"]},children:n})}}class Certificate extends StringObject{constructor(e){super(Lo,"certificate"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}}class Certificates extends XFAObject{constructor(e){super(Lo,"certificates",!0),this.credentialServerPolicy=getStringOption(e.credentialServerPolicy,["optional","required"]),this.id=e.id||"",this.url=e.url||"",this.urlPolicy=e.urlPolicy||"",this.use=e.use||"",this.usehref=e.usehref||"",this.encryption=null,this.issuers=null,this.keyUsage=null,this.oids=null,this.signing=null,this.subjectDNs=null}}class CheckButton extends XFAObject{constructor(e){super(Lo,"checkButton",!0),this.id=e.id||"",this.mark=getStringOption(e.mark,["default","check","circle","cross","diamond","square","star"]),this.shape=getStringOption(e.shape,["square","round"]),this.size=getMeasurement(e.size,"10pt"),this.use=e.use||"",this.usehref=e.usehref||"",this.border=null,this.extras=null,this.margin=null}[Qr](e){const t=toStyle(this,"margin"),i=measureToString(this.size);let n,a,s;t.width=t.height=i;const r=this[mr]()[mr](),o=r.items.children.length&&r.items.children[0][Qr]().html||[],l={on:(void 0!==o[0]?o[0]:"on").toString(),off:(void 0!==o[1]?o[1]:"off").toString()},c=(r.value?.[Jr]()||"off")===l.on||void 0,h=r[pr](),d=r[io];let u;h instanceof ExclGroup?(s=h[io],n="radio",a="xfaRadio",u=h[Zs]?.[io]||h[io]):(n="checkbox",a="xfaCheckbox",u=r[Zs]?.[io]||r[io]);const g={name:"input",attributes:{class:[a],style:t,fieldId:d,dataId:u,type:n,checked:c,xfaOn:l.on,xfaOff:l.off,"aria-label":ariaLabel(r),"aria-required":!1}};return s&&(g.attributes.name=s),isRequired(r)&&(g.attributes["aria-required"]=!0,g.attributes.required=!0),HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[g]})}}class ChoiceList extends XFAObject{constructor(e){super(Lo,"choiceList",!0),this.commitOn=getStringOption(e.commitOn,["select","exit"]),this.id=e.id||"",this.open=getStringOption(e.open,["userControl","always","multiSelect","onEntry"]),this.textEntry=getInteger({data:e.textEntry,defaultValue:0,validate:e=>1===e}),this.use=e.use||"",this.usehref=e.usehref||"",this.border=null,this.extras=null,this.margin=null}[Qr](e){const t=toStyle(this,"border","margin"),i=this[mr]()[mr](),n={fontSize:`calc(${i.font?.size||10}px * var(--total-scale-factor))`},a=[];if(i.items.children.length>0){const e=i.items;let t=0,s=0;2===e.children.length&&(t=e.children[0].save,s=1-t);const r=e.children[t][Qr]().html,o=e.children[s][Qr]().html;let l=!1;const c=i.value?.[Jr]()||"";for(let e=0,t=r.length;e<t;e++){const t={name:"option",attributes:{value:o[e]||r[e],style:n},value:r[e]};o[e]===c&&(t.attributes.selected=l=!0),a.push(t)}l||a.splice(0,0,{name:"option",attributes:{hidden:!0,selected:!0},value:" "})}const s={class:["xfaSelect"],fieldId:i[io],dataId:i[Zs]?.[io]||i[io],style:t,"aria-label":ariaLabel(i),"aria-required":!1};return isRequired(i)&&(s["aria-required"]=!0,s.required=!0),"multiSelect"===this.open&&(s.multiple=!0),HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[{name:"select",children:a,attributes:s}]})}}class Color extends XFAObject{constructor(e){super(Lo,"color",!0),this.cSpace=getStringOption(e.cSpace,["SRGB"]),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.value=e.value?function(e,t=[0,0,0]){let[i,n,a]=t;if(!e)return{r:i,g:n,b:a};const s=e.split(",",3).map(e=>MathClamp$1(parseInt(e.trim(),10),0,255)).map(e=>isNaN(e)?0:e);return s.length<3||([i,n,a]=s),{r:i,g:n,b:a}}(e.value):"",this.extras=null}[wr](){return!1}[to](){return this.value?ai.makeHexColor(this.value.r,this.value.g,this.value.b):null}}class Comb extends XFAObject{constructor(e){super(Lo,"comb"),this.id=e.id||"",this.numberOfCells=getInteger({data:e.numberOfCells,defaultValue:0,validate:e=>e>=0}),this.use=e.use||"",this.usehref=e.usehref||""}}class Connect extends XFAObject{constructor(e){super(Lo,"connect",!0),this.connection=e.connection||"",this.id=e.id||"",this.ref=e.ref||"",this.usage=getStringOption(e.usage,["exportAndImport","exportOnly","importOnly"]),this.use=e.use||"",this.usehref=e.usehref||"",this.picture=null}}class ContentArea extends XFAObject{constructor(e){super(Lo,"contentArea",!0),this.h=getMeasurement(e.h),this.id=e.id||"",this.name=e.name||"",this.relevant=getRelevant(e.relevant),this.use=e.use||"",this.usehref=e.usehref||"",this.w=getMeasurement(e.w),this.x=getMeasurement(e.x,"0pt"),this.y=getMeasurement(e.y,"0pt"),this.desc=null,this.extras=null}[Qr](e){const t={left:measureToString(this.x),top:measureToString(this.y),width:measureToString(this.w),height:measureToString(this.h)},i=["xfaContentarea"];return isPrintOnly(this)&&i.push("xfaPrintOnly"),HTMLResult.success({name:"div",children:[],attributes:{style:t,class:i,id:this[io]}})}}class Corner extends XFAObject{constructor(e){super(Lo,"corner",!0),this.id=e.id||"",this.inverted=getInteger({data:e.inverted,defaultValue:0,validate:e=>1===e}),this.join=getStringOption(e.join,["square","round"]),this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]),this.radius=getMeasurement(e.radius),this.stroke=getStringOption(e.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]),this.thickness=getMeasurement(e.thickness,"0.5pt"),this.use=e.use||"",this.usehref=e.usehref||"",this.color=null,this.extras=null}[to](){const e=toStyle(this,"visibility");return e.radius=measureToString("square"===this.join?0:this.radius),e}}class DateElement extends ContentObject{constructor(e){super(Lo,"date"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}[tr](){const e=this[Js].trim();this[Js]=e?new Date(e):null}[Qr](e){return valueToHtml(this[Js]?this[Js].toString():"")}}class DateTime extends ContentObject{constructor(e){super(Lo,"dateTime"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}[tr](){const e=this[Js].trim();this[Js]=e?new Date(e):null}[Qr](e){return valueToHtml(this[Js]?this[Js].toString():"")}}class DateTimeEdit extends XFAObject{constructor(e){super(Lo,"dateTimeEdit",!0),this.hScrollPolicy=getStringOption(e.hScrollPolicy,["auto","off","on"]),this.id=e.id||"",this.picker=getStringOption(e.picker,["host","none"]),this.use=e.use||"",this.usehref=e.usehref||"",this.border=null,this.comb=null,this.extras=null,this.margin=null}[Qr](e){const t=toStyle(this,"border","font","margin"),i=this[mr]()[mr](),n={name:"input",attributes:{type:"text",fieldId:i[io],dataId:i[Zs]?.[io]||i[io],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(i),"aria-required":!1}};return isRequired(i)&&(n.attributes["aria-required"]=!0,n.attributes.required=!0),HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[n]})}}class Decimal extends ContentObject{constructor(e){super(Lo,"decimal"),this.fracDigits=getInteger({data:e.fracDigits,defaultValue:2,validate:e=>!0}),this.id=e.id||"",this.leadDigits=getInteger({data:e.leadDigits,defaultValue:-1,validate:e=>!0}),this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}[tr](){const e=parseFloat(this[Js].trim());this[Js]=isNaN(e)?null:e}[Qr](e){return valueToHtml(null!==this[Js]?this[Js].toString():"")}}class DefaultUi extends XFAObject{constructor(e){super(Lo,"defaultUi",!0),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null}}class Desc extends XFAObject{constructor(e){super(Lo,"desc",!0),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.boolean=new XFAObjectArray,this.date=new XFAObjectArray,this.dateTime=new XFAObjectArray,this.decimal=new XFAObjectArray,this.exData=new XFAObjectArray,this.float=new XFAObjectArray,this.image=new XFAObjectArray,this.integer=new XFAObjectArray,this.text=new XFAObjectArray,this.time=new XFAObjectArray}}class DigestMethod extends OptionObject{constructor(e){super(Lo,"digestMethod",["","SHA1","SHA256","SHA512","RIPEMD160"]),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||""}}class DigestMethods extends XFAObject{constructor(e){super(Lo,"digestMethods",!0),this.id=e.id||"",this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||"",this.digestMethod=new XFAObjectArray}}class Draw extends XFAObject{constructor(e){super(Lo,"draw",!0),this.anchorType=getStringOption(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e}),this.h=e.h?getMeasurement(e.h):"",this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=e.id||"",this.locale=e.locale||"",this.maxH=getMeasurement(e.maxH,"0pt"),this.maxW=getMeasurement(e.maxW,"0pt"),this.minH=getMeasurement(e.minH,"0pt"),this.minW=getMeasurement(e.minW,"0pt"),this.name=e.name||"",this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(e.relevant),this.rotate=getInteger({data:e.rotate,defaultValue:0,validate:e=>e%90==0}),this.use=e.use||"",this.usehref=e.usehref||"",this.w=e.w?getMeasurement(e.w):"",this.x=getMeasurement(e.x,"0pt"),this.y=getMeasurement(e.y,"0pt"),this.assist=null,this.border=null,this.caption=null,this.desc=null,this.extras=null,this.font=null,this.keep=null,this.margin=null,this.para=null,this.traversal=null,this.ui=null,this.value=null,this.setProperty=new XFAObjectArray}[Kr](e){_setValue(this,e)}[Qr](e){if(setTabIndex(this),"hidden"===this.presence||"inactive"===this.presence)return HTMLResult.EMPTY;fixDimensions(this),this[Hr]();const t=this.w,i=this.h,{w:n,h:a,isBroken:s}=layoutNode(this,e);if(n&&""===this.w){if(s&&this[pr]()[Er]())return this[$r](),HTMLResult.FAILURE;this.w=n}if(a&&""===this.h&&(this.h=a),setFirstUnsplittable(this),!checkDimensions(this,e))return this.w=t,this.h=i,this[$r](),HTMLResult.FAILURE;unsetFirstUnsplittable(this);const r=toStyle(this,"font","hAlign","dimensions","position","presence","rotate","anchorType","border","margin");setMinMaxDimensions(this,r),r.margin&&(r.padding=r.margin,delete r.margin);const o=["xfaDraw"];this.font&&o.push("xfaFont"),isPrintOnly(this)&&o.push("xfaPrintOnly");const l={style:r,id:this[io],class:o};this.name&&(l.xfaName=this.name);const c={name:"div",attributes:l,children:[]};applyAssist(this,l);const h=computeBbox(this,c,e),d=this.value?this.value[Qr](e).html:null;return null===d?(this.w=t,this.h=i,this[$r](),HTMLResult.success(createWrapper(this,c),h)):(c.children.push(d),setPara(this,r,d),this.w=t,this.h=i,this[$r](),HTMLResult.success(createWrapper(this,c),h))}}class Edge extends XFAObject{constructor(e){super(Lo,"edge",!0),this.cap=getStringOption(e.cap,["square","butt","round"]),this.id=e.id||"",this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]),this.stroke=getStringOption(e.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]),this.thickness=getMeasurement(e.thickness,"0.5pt"),this.use=e.use||"",this.usehref=e.usehref||"",this.color=null,this.extras=null}[to](){const e=toStyle(this,"visibility");if(Object.assign(e,{linecap:this.cap,width:measureToString(this.thickness),color:this.color?this.color[to]():"#000000",style:""}),"visible"!==this.presence)e.style="none";else switch(this.stroke){case"solid":e.style="solid";break;case"dashDot":case"dashDotDot":case"dashed":e.style="dashed";break;case"dotted":e.style="dotted";break;case"embossed":e.style="ridge";break;case"etched":e.style="groove";break;case"lowered":e.style="inset";break;case"raised":e.style="outset"}return e}}class Encoding extends OptionObject{constructor(e){super(Lo,"encoding",["adbe.x509.rsa_sha1","adbe.pkcs7.detached","adbe.pkcs7.sha1"]),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||""}}class Encodings extends XFAObject{constructor(e){super(Lo,"encodings",!0),this.id=e.id||"",this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||"",this.encoding=new XFAObjectArray}}class Encrypt extends XFAObject{constructor(e){super(Lo,"encrypt",!0),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.certificate=null}}class EncryptData extends XFAObject{constructor(e){super(Lo,"encryptData",!0),this.id=e.id||"",this.operation=getStringOption(e.operation,["encrypt","decrypt"]),this.target=e.target||"",this.use=e.use||"",this.usehref=e.usehref||"",this.filter=null,this.manifest=null}}class Encryption extends XFAObject{constructor(e){super(Lo,"encryption",!0),this.id=e.id||"",this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||"",this.certificate=new XFAObjectArray}}class EncryptionMethod extends OptionObject{constructor(e){super(Lo,"encryptionMethod",["","AES256-CBC","TRIPLEDES-CBC","AES128-CBC","AES192-CBC"]),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||""}}class EncryptionMethods extends XFAObject{constructor(e){super(Lo,"encryptionMethods",!0),this.id=e.id||"",this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||"",this.encryptionMethod=new XFAObjectArray}}let Xo=class extends XFAObject{constructor(e){super(Lo,"event",!0),this.activity=getStringOption(e.activity,["click","change","docClose","docReady","enter","exit","full","indexChange","initialize","mouseDown","mouseEnter","mouseExit","mouseUp","postExecute","postOpen","postPrint","postSave","postSign","postSubmit","preExecute","preOpen","prePrint","preSave","preSign","preSubmit","ready","validationState"]),this.id=e.id||"",this.listen=getStringOption(e.listen,["refOnly","refAndDescendents"]),this.name=e.name||"",this.ref=e.ref||"",this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null,this.encryptData=null,this.execute=null,this.script=null,this.signData=null,this.submit=null}};class ExData extends ContentObject{constructor(e){super(Lo,"exData"),this.contentType=e.contentType||"",this.href=e.href||"",this.id=e.id||"",this.maxLength=getInteger({data:e.maxLength,defaultValue:-1,validate:e=>e>=-1}),this.name=e.name||"",this.rid=e.rid||"",this.transferEncoding=getStringOption(e.transferEncoding,["none","base64","package"]),this.use=e.use||"",this.usehref=e.usehref||""}[vr](){return"text/html"===this.contentType}[Nr](e){return("text/html"===this.contentType&&e[_r]===ao.xhtml.id||"text/xml"===this.contentType)&&(this[Js]=e,!0)}[Qr](e){return"text/html"===this.contentType&&this[Js]?this[Js][Qr](e):HTMLResult.EMPTY}}class ExObject extends XFAObject{constructor(e){super(Lo,"exObject",!0),this.archive=e.archive||"",this.classId=e.classId||"",this.codeBase=e.codeBase||"",this.codeType=e.codeType||"",this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null,this.boolean=new XFAObjectArray,this.date=new XFAObjectArray,this.dateTime=new XFAObjectArray,this.decimal=new XFAObjectArray,this.exData=new XFAObjectArray,this.exObject=new XFAObjectArray,this.float=new XFAObjectArray,this.image=new XFAObjectArray,this.integer=new XFAObjectArray,this.text=new XFAObjectArray,this.time=new XFAObjectArray}}class ExclGroup extends XFAObject{constructor(e){super(Lo,"exclGroup",!0),this.access=getStringOption(e.access,["open","nonInteractive","protected","readOnly"]),this.accessKey=e.accessKey||"",this.anchorType=getStringOption(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e}),this.h=e.h?getMeasurement(e.h):"",this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=e.id||"",this.layout=getStringOption(e.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]),this.maxH=getMeasurement(e.maxH,"0pt"),this.maxW=getMeasurement(e.maxW,"0pt"),this.minH=getMeasurement(e.minH,"0pt"),this.minW=getMeasurement(e.minW,"0pt"),this.name=e.name||"",this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(e.relevant),this.use=e.use||"",this.usehref=e.usehref||"",this.w=e.w?getMeasurement(e.w):"",this.x=getMeasurement(e.x,"0pt"),this.y=getMeasurement(e.y,"0pt"),this.assist=null,this.bind=null,this.border=null,this.calculate=null,this.caption=null,this.desc=null,this.extras=null,this.margin=null,this.para=null,this.traversal=null,this.validate=null,this.connect=new XFAObjectArray,this.event=new XFAObjectArray,this.field=new XFAObjectArray,this.setProperty=new XFAObjectArray}[Cr](){return!0}[wr](){return!0}[Kr](e){for(const t of this.field.children){if(!t.value){const e=new Value({});t[qs](e),t.value=e}t.value[Kr](e)}}[Er](){return this.layout.endsWith("-tb")&&0===this[er].attempt&&this[er].numberInLine>0||this[mr]()[Er]()}[Ir](){const e=this[pr]();return!!e[Ir]()&&(void 0!==this[er]._isSplittable?this[er]._isSplittable:"position"===this.layout||this.layout.includes("row")?(this[er]._isSplittable=!1,!1):(!e.layout?.endsWith("-tb")||0===e[er].numberInLine)&&(this[er]._isSplittable=!0,!0))}[ir](){return flushHTML(this)}[Xs](e,t){addHTML(this,e,t)}[sr](){return getAvailableSpace(this)}[Qr](e){if(setTabIndex(this),"hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return HTMLResult.EMPTY;fixDimensions(this);const t=[],i={id:this[io],class:[]};setAccess(this,i.class),this[er]||=Object.create(null),Object.assign(this[er],{children:t,attributes:i,attempt:0,line:null,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,e.width),height:Math.min(this.h||1/0,e.height)},width:0,height:0,prevHeight:0,currentWidth:0});const n=this[Ir]();if(n||setFirstUnsplittable(this),!checkDimensions(this,e))return HTMLResult.FAILURE;const a=new Set(["field"]);if(this.layout.includes("row")){const e=this[pr]().columnWidths;Array.isArray(e)&&e.length>0&&(this[er].columnWidths=e,this[er].currentColumn=0)}const s=toStyle(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),r=["xfaExclgroup"],o=layoutClass(this);o&&r.push(o),isPrintOnly(this)&&r.push("xfaPrintOnly"),i.style=s,i.class=r,this.name&&(i.xfaName=this.name),this[Hr]();const l="lr-tb"===this.layout||"rl-tb"===this.layout,c=l?2:1;for(;this[er].attempt<c;this[er].attempt++){l&&1===this[er].attempt&&(this[er].numberInLine=0);const e=this[zs]({filter:a,include:!0});if(e.success)break;if(e.isBreak())return this[$r](),e;if(l&&0===this[er].attempt&&0===this[er].numberInLine&&!this[br]()[er].noLayoutFailure){this[er].attempt=c;break}}if(this[$r](),n||unsetFirstUnsplittable(this),this[er].attempt===c)return n||delete this[er],HTMLResult.FAILURE;let h=0,d=0;this.margin&&(h=this.margin.leftInset+this.margin.rightInset,d=this.margin.topInset+this.margin.bottomInset);const u=Math.max(this[er].width+h,this.w||0),g=Math.max(this[er].height+d,this.h||0),f=[this.x,this.y,u,g];""===this.w&&(s.width=measureToString(u)),""===this.h&&(s.height=measureToString(g));const p={name:"div",attributes:i,children:t};return applyAssist(this,i),delete this[er],HTMLResult.success(createWrapper(this,p),f)}}class Execute extends XFAObject{constructor(e){super(Lo,"execute"),this.connection=e.connection||"",this.executeType=getStringOption(e.executeType,["import","remerge"]),this.id=e.id||"",this.runAt=getStringOption(e.runAt,["client","both","server"]),this.use=e.use||"",this.usehref=e.usehref||""}}class Extras extends XFAObject{constructor(e){super(Lo,"extras",!0),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||"",this.boolean=new XFAObjectArray,this.date=new XFAObjectArray,this.dateTime=new XFAObjectArray,this.decimal=new XFAObjectArray,this.exData=new XFAObjectArray,this.extras=new XFAObjectArray,this.float=new XFAObjectArray,this.image=new XFAObjectArray,this.integer=new XFAObjectArray,this.text=new XFAObjectArray,this.time=new XFAObjectArray}}class Field extends XFAObject{constructor(e){super(Lo,"field",!0),this.access=getStringOption(e.access,["open","nonInteractive","protected","readOnly"]),this.accessKey=e.accessKey||"",this.anchorType=getStringOption(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e}),this.h=e.h?getMeasurement(e.h):"",this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=e.id||"",this.locale=e.locale||"",this.maxH=getMeasurement(e.maxH,"0pt"),this.maxW=getMeasurement(e.maxW,"0pt"),this.minH=getMeasurement(e.minH,"0pt"),this.minW=getMeasurement(e.minW,"0pt"),this.name=e.name||"",this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(e.relevant),this.rotate=getInteger({data:e.rotate,defaultValue:0,validate:e=>e%90==0}),this.use=e.use||"",this.usehref=e.usehref||"",this.w=e.w?getMeasurement(e.w):"",this.x=getMeasurement(e.x,"0pt"),this.y=getMeasurement(e.y,"0pt"),this.assist=null,this.bind=null,this.border=null,this.calculate=null,this.caption=null,this.desc=null,this.extras=null,this.font=null,this.format=null,this.items=new XFAObjectArray(2),this.keep=null,this.margin=null,this.para=null,this.traversal=null,this.ui=null,this.validate=null,this.value=null,this.bindItems=new XFAObjectArray,this.connect=new XFAObjectArray,this.event=new XFAObjectArray,this.setProperty=new XFAObjectArray}[Cr](){return!0}[Kr](e){_setValue(this,e)}[Qr](e){if(setTabIndex(this),!this.ui){let e;switch(this.ui=new Ui({}),this.ui[yr]=this[yr],this[qs](this.ui),this.items.children.length){case 0:e=new TextEdit({}),this.ui.textEdit=e;break;case 1:e=new CheckButton({}),this.ui.checkButton=e;break;case 2:e=new ChoiceList({}),this.ui.choiceList=e}this.ui[qs](e)}if(!this.ui||"hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return HTMLResult.EMPTY;this.caption&&delete this.caption[er],this[Hr]();const t=this.caption?this.caption[Qr](e).html:null,i=this.w,n=this.h;let a=0,s=0;this.margin&&(a=this.margin.leftInset+this.margin.rightInset,s=this.margin.topInset+this.margin.bottomInset);let r=null;if(""===this.w||""===this.h){let t=null,i=null,n=0,o=0;if(this.ui.checkButton)n=o=this.ui.checkButton.size;else{const{w:t,h:i}=layoutNode(this,e);null!==t?(n=t,o=i):o=function(e,t=!1){let i=null;if(e){const t=stripQuotes(e.typeface),n=e[yr].fontFinder.find(t);i=selectFont(e,n)}if(!i)return{lineHeight:12,lineGap:2,lineNoGap:10};const n=e.size||10,a=i.lineHeight?Math.max(t?0:1.2,i.lineHeight):1.2,s=void 0===i.lineGap?.2:i.lineGap;return{lineHeight:a*n,lineGap:s*n,lineNoGap:Math.max(1,a-s)*n}}(this.font,!0).lineNoGap}if(r=getBorderDims(this.ui[hr]()),n+=r.w,o+=r.h,this.caption){const{w:a,h:s,isBroken:r}=this.caption[hr](e);if(r&&this[pr]()[Er]())return this[$r](),HTMLResult.FAILURE;switch(t=a,i=s,this.caption.placement){case"left":case"right":case"inline":t+=n;break;case"top":case"bottom":i+=o}}else t=n,i=o;t&&""===this.w&&(t+=a,this.w=Math.min(this.maxW<=0?1/0:this.maxW,this.minW+1<t?t:this.minW)),i&&""===this.h&&(i+=s,this.h=Math.min(this.maxH<=0?1/0:this.maxH,this.minH+1<i?i:this.minH))}if(this[$r](),fixDimensions(this),setFirstUnsplittable(this),!checkDimensions(this,e))return this.w=i,this.h=n,this[$r](),HTMLResult.FAILURE;unsetFirstUnsplittable(this);const o=toStyle(this,"font","dimensions","position","rotate","anchorType","presence","margin","hAlign");setMinMaxDimensions(this,o);const l=["xfaField"];this.font&&l.push("xfaFont"),isPrintOnly(this)&&l.push("xfaPrintOnly");const c={style:o,id:this[io],class:l};o.margin&&(o.padding=o.margin,delete o.margin),setAccess(this,l),this.name&&(c.xfaName=this.name);const h=[],d={name:"div",attributes:c,children:h};applyAssist(this,c);const u=this.border?this.border[to]():null,g=computeBbox(this,d,e),f=this.ui[Qr]().html;if(!f)return Object.assign(o,u),HTMLResult.success(createWrapper(this,d),g);this[Yr]&&(f.children?.[0]?f.children[0].attributes.tabindex=this[Yr]:f.attributes.tabindex=this[Yr]),f.attributes.style||=Object.create(null);let p=null;if(this.ui.button?(1===f.children.length&&([p]=f.children.splice(0,1)),Object.assign(f.attributes.style,u)):Object.assign(o,u),h.push(f),this.value)if(this.ui.imageEdit)f.children.push(this.value[Qr]().html);else if(!this.ui.button){let e="";if(this.value.exData)e=this.value.exData[Jr]();else if(this.value.text)e=this.value.text[hr]();else{const t=this.value[Qr]().html;null!==t&&(e=t.children[0].value)}this.ui.textEdit&&this.value.text?.maxChars&&(f.children[0].attributes.maxLength=this.value.text.maxChars),e&&(this.ui.numericEdit&&(e=parseFloat(e),e=isNaN(e)?"":e.toString()),"textarea"===f.children[0].name?f.children[0].attributes.textContent=e:f.children[0].attributes.value=e)}if(!this.ui.imageEdit&&f.children?.[0]&&this.h){r=r||getBorderDims(this.ui[hr]());let t=0;if(this.caption&&["top","bottom"].includes(this.caption.placement)){t=this.caption.reserve,t<=0&&(t=this.caption[hr](e).h);const i=this.h-t-s-r.h;f.children[0].attributes.style.height=measureToString(i)}else f.children[0].attributes.style.height="100%"}if(p&&f.children.push(p),!t)return f.attributes.class&&f.attributes.class.push("xfaLeft"),this.w=i,this.h=n,HTMLResult.success(createWrapper(this,d),g);if(this.ui.button)return o.padding&&delete o.padding,"div"===t.name&&(t.name="span"),f.children.push(t),HTMLResult.success(d,g);switch(this.ui.checkButton&&(t.attributes.class[0]="xfaCaptionForCheckButton"),f.attributes.class||=[],f.children.splice(0,0,t),this.caption.placement){case"left":case"inline":f.attributes.class.push("xfaLeft");break;case"right":f.attributes.class.push("xfaRight");break;case"top":f.attributes.class.push("xfaTop");break;case"bottom":f.attributes.class.push("xfaBottom")}return this.w=i,this.h=n,HTMLResult.success(createWrapper(this,d),g)}}class Fill extends XFAObject{constructor(e){super(Lo,"fill",!0),this.id=e.id||"",this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]),this.use=e.use||"",this.usehref=e.usehref||"",this.color=null,this.extras=null,this.linear=null,this.pattern=null,this.radial=null,this.solid=null,this.stipple=null}[to](){const e=this[mr](),t=e[mr]()[mr](),i=Object.create(null);let n="color",a=n;e instanceof Border&&(n="background-color",a="background",t instanceof Ui&&(i.backgroundColor="white")),(e instanceof Rectangle||e instanceof Arc)&&(n=a="fill",i.fill="white");for(const e of Object.getOwnPropertyNames(this)){if("extras"===e||"color"===e)continue;const t=this[e];if(!(t instanceof XFAObject))continue;const s=t[to](this.color);return s&&(i[s.startsWith("#")?n:a]=s),i}if(this.color?.value){const e=this.color[to]();i[e.startsWith("#")?n:a]=e}return i}}class Filter extends XFAObject{constructor(e){super(Lo,"filter",!0),this.addRevocationInfo=getStringOption(e.addRevocationInfo,["","required","optional","none"]),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||"",this.version=getInteger({data:this.version,defaultValue:5,validate:e=>e>=1&&e<=5}),this.appearanceFilter=null,this.certificates=null,this.digestMethods=null,this.encodings=null,this.encryptionMethods=null,this.handler=null,this.lockDocument=null,this.mdp=null,this.reasons=null,this.timeStamp=null}}class Float extends ContentObject{constructor(e){super(Lo,"float"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}[tr](){const e=parseFloat(this[Js].trim());this[Js]=isNaN(e)?null:e}[Qr](e){return valueToHtml(null!==this[Js]?this[Js].toString():"")}}class template_Font extends XFAObject{constructor(e){super(Lo,"font",!0),this.baselineShift=getMeasurement(e.baselineShift),this.fontHorizontalScale=getFloat({data:e.fontHorizontalScale,defaultValue:100,validate:e=>e>=0}),this.fontVerticalScale=getFloat({data:e.fontVerticalScale,defaultValue:100,validate:e=>e>=0}),this.id=e.id||"",this.kerningMode=getStringOption(e.kerningMode,["none","pair"]),this.letterSpacing=getMeasurement(e.letterSpacing,"0"),this.lineThrough=getInteger({data:e.lineThrough,defaultValue:0,validate:e=>1===e||2===e}),this.lineThroughPeriod=getStringOption(e.lineThroughPeriod,["all","word"]),this.overline=getInteger({data:e.overline,defaultValue:0,validate:e=>1===e||2===e}),this.overlinePeriod=getStringOption(e.overlinePeriod,["all","word"]),this.posture=getStringOption(e.posture,["normal","italic"]),this.size=getMeasurement(e.size,"10pt"),this.typeface=e.typeface||"Courier",this.underline=getInteger({data:e.underline,defaultValue:0,validate:e=>1===e||2===e}),this.underlinePeriod=getStringOption(e.underlinePeriod,["all","word"]),this.use=e.use||"",this.usehref=e.usehref||"",this.weight=getStringOption(e.weight,["normal","bold"]),this.extras=null,this.fill=null}[Ws](e){super[Ws](e),this[yr].usedTypefaces.add(this.typeface)}[to](){const e=toStyle(this,"fill"),t=e.color;return t&&("#000000"===t?delete e.color:t.startsWith("#")||(e.background=t,e.backgroundClip="text",e.color="transparent")),this.baselineShift&&(e.verticalAlign=measureToString(this.baselineShift)),e.fontKerning="none"===this.kerningMode?"none":"normal",e.letterSpacing=measureToString(this.letterSpacing),0!==this.lineThrough&&(e.textDecoration="line-through",2===this.lineThrough&&(e.textDecorationStyle="double")),0!==this.overline&&(e.textDecoration="overline",2===this.overline&&(e.textDecorationStyle="double")),e.fontStyle=this.posture,e.fontSize=measureToString(.99*this.size),setFontFamily(this,this,this[yr].fontFinder,e),0!==this.underline&&(e.textDecoration="underline",2===this.underline&&(e.textDecorationStyle="double")),e.fontWeight=this.weight,e}}class Format extends XFAObject{constructor(e){super(Lo,"format",!0),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null,this.picture=null}}class Handler extends StringObject{constructor(e){super(Lo,"handler"),this.id=e.id||"",this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||""}}class Hyphenation extends XFAObject{constructor(e){super(Lo,"hyphenation"),this.excludeAllCaps=getInteger({data:e.excludeAllCaps,defaultValue:0,validate:e=>1===e}),this.excludeInitialCap=getInteger({data:e.excludeInitialCap,defaultValue:0,validate:e=>1===e}),this.hyphenate=getInteger({data:e.hyphenate,defaultValue:0,validate:e=>1===e}),this.id=e.id||"",this.pushCharacterCount=getInteger({data:e.pushCharacterCount,defaultValue:3,validate:e=>e>=0}),this.remainCharacterCount=getInteger({data:e.remainCharacterCount,defaultValue:3,validate:e=>e>=0}),this.use=e.use||"",this.usehref=e.usehref||"",this.wordCharacterCount=getInteger({data:e.wordCharacterCount,defaultValue:7,validate:e=>e>=0})}}let qo=class extends StringObject{constructor(e){super(Lo,"image"),this.aspect=getStringOption(e.aspect,["fit","actual","height","none","width"]),this.contentType=e.contentType||"",this.href=e.href||"",this.id=e.id||"",this.name=e.name||"",this.transferEncoding=getStringOption(e.transferEncoding,["base64","none","package"]),this.use=e.use||"",this.usehref=e.usehref||""}[Qr](){if(this.contentType&&!$o.has(this.contentType.toLowerCase()))return HTMLResult.EMPTY;let e=this[yr].images?.get(this.href);if(!e&&(this.href||!this[Js]))return HTMLResult.EMPTY;var t;if(e||"base64"!==this.transferEncoding||(t=this[Js],e=Uint8Array.fromBase64?Uint8Array.fromBase64(t):stringToBytes$1(atob(t))),!e)return HTMLResult.EMPTY;if(!this.contentType){for(const[t,i]of Ho)if(e.length>t.length&&t.every((t,i)=>t===e[i])){this.contentType=i;break}if(!this.contentType)return HTMLResult.EMPTY}const i=new Blob([e],{type:this.contentType});let n;switch(this.aspect){case"fit":case"actual":break;case"height":n={height:"100%",objectFit:"fill"};break;case"none":n={width:"100%",height:"100%",objectFit:"fill"};break;case"width":n={width:"100%",objectFit:"fill"}}const a=this[mr]();return HTMLResult.success({name:"img",attributes:{class:["xfaImage"],style:n,src:URL.createObjectURL(i),alt:a?ariaLabel(a[mr]()):null}})}};class ImageEdit extends XFAObject{constructor(e){super(Lo,"imageEdit",!0),this.data=getStringOption(e.data,["link","embed"]),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.border=null,this.extras=null,this.margin=null}[Qr](e){return"embed"===this.data?HTMLResult.success({name:"div",children:[],attributes:{}}):HTMLResult.EMPTY}}class Integer extends ContentObject{constructor(e){super(Lo,"integer"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}[tr](){const e=parseInt(this[Js].trim(),10);this[Js]=isNaN(e)?null:e}[Qr](e){return valueToHtml(null!==this[Js]?this[Js].toString():"")}}class Issuers extends XFAObject{constructor(e){super(Lo,"issuers",!0),this.id=e.id||"",this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||"",this.certificate=new XFAObjectArray}}class Items extends XFAObject{constructor(e){super(Lo,"items",!0),this.id=e.id||"",this.name=e.name||"",this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]),this.ref=e.ref||"",this.save=getInteger({data:e.save,defaultValue:0,validate:e=>1===e}),this.use=e.use||"",this.usehref=e.usehref||"",this.boolean=new XFAObjectArray,this.date=new XFAObjectArray,this.dateTime=new XFAObjectArray,this.decimal=new XFAObjectArray,this.exData=new XFAObjectArray,this.float=new XFAObjectArray,this.image=new XFAObjectArray,this.integer=new XFAObjectArray,this.text=new XFAObjectArray,this.time=new XFAObjectArray}[Qr](){const e=[];for(const t of this[ur]())e.push(t[Jr]());return HTMLResult.success(e)}}class Keep extends XFAObject{constructor(e){super(Lo,"keep",!0),this.id=e.id||"";const t=["none","contentArea","pageArea"];this.intact=getStringOption(e.intact,t),this.next=getStringOption(e.next,t),this.previous=getStringOption(e.previous,t),this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null}}class KeyUsage extends XFAObject{constructor(e){super(Lo,"keyUsage");const t=["","yes","no"];this.crlSign=getStringOption(e.crlSign,t),this.dataEncipherment=getStringOption(e.dataEncipherment,t),this.decipherOnly=getStringOption(e.decipherOnly,t),this.digitalSignature=getStringOption(e.digitalSignature,t),this.encipherOnly=getStringOption(e.encipherOnly,t),this.id=e.id||"",this.keyAgreement=getStringOption(e.keyAgreement,t),this.keyCertSign=getStringOption(e.keyCertSign,t),this.keyEncipherment=getStringOption(e.keyEncipherment,t),this.nonRepudiation=getStringOption(e.nonRepudiation,t),this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||""}}class Line extends XFAObject{constructor(e){super(Lo,"line",!0),this.hand=getStringOption(e.hand,["even","left","right"]),this.id=e.id||"",this.slope=getStringOption(e.slope,["\\","/"]),this.use=e.use||"",this.usehref=e.usehref||"",this.edge=null}[Qr](){const e=this[mr]()[mr](),t=this.edge||new Edge({}),i=t[to](),n=Object.create(null),a="visible"===t.presence?t.thickness:0;let s,r,o,l;n.strokeWidth=measureToString(a),n.stroke=i.color;let c="100%",h="100%";e.w<=a?([s,r,o,l]=["50%",0,"50%","100%"],c=n.strokeWidth):e.h<=a?([s,r,o,l]=[0,"50%","100%","50%"],h=n.strokeWidth):"\\"===this.slope?[s,r,o,l]=[0,0,"100%","100%"]:[s,r,o,l]=[0,"100%","100%",0];const d={name:"svg",children:[{name:"line",attributes:{xmlns:Uo,x1:s,y1:r,x2:o,y2:l,style:n}}],attributes:{xmlns:Uo,width:c,height:h,style:{overflow:"visible"}}};return hasMargin(e)?HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[d]}):(d.attributes.style.position="absolute",HTMLResult.success(d))}}class Linear extends XFAObject{constructor(e){super(Lo,"linear",!0),this.id=e.id||"",this.type=getStringOption(e.type,["toRight","toBottom","toLeft","toTop"]),this.use=e.use||"",this.usehref=e.usehref||"",this.color=null,this.extras=null}[to](e){e=e?e[to]():"#FFFFFF";return`linear-gradient(${this.type.replace(/([RBLT])/," $1").toLowerCase()}, ${e}, ${this.color?this.color[to]():"#000000"})`}}class LockDocument extends ContentObject{constructor(e){super(Lo,"lockDocument"),this.id=e.id||"",this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||""}[tr](){this[Js]=getStringOption(this[Js],["auto","0","1"])}}class Manifest extends XFAObject{constructor(e){super(Lo,"manifest",!0),this.action=getStringOption(e.action,["include","all","exclude"]),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null,this.ref=new XFAObjectArray}}class Margin extends XFAObject{constructor(e){super(Lo,"margin",!0),this.bottomInset=getMeasurement(e.bottomInset,"0"),this.id=e.id||"",this.leftInset=getMeasurement(e.leftInset,"0"),this.rightInset=getMeasurement(e.rightInset,"0"),this.topInset=getMeasurement(e.topInset,"0"),this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null}[to](){return{margin:measureToString(this.topInset)+" "+measureToString(this.rightInset)+" "+measureToString(this.bottomInset)+" "+measureToString(this.leftInset)}}}class Mdp extends XFAObject{constructor(e){super(Lo,"mdp"),this.id=e.id||"",this.permissions=getInteger({data:e.permissions,defaultValue:2,validate:e=>1===e||3===e}),this.signatureType=getStringOption(e.signatureType,["filler","author"]),this.use=e.use||"",this.usehref=e.usehref||""}}class Medium extends XFAObject{constructor(e){super(Lo,"medium"),this.id=e.id||"",this.imagingBBox=function(e){const t=-1;if(!e)return{x:t,y:t,width:t,height:t};const i=e.split(",",4).map(e=>getMeasurement(e.trim(),"-1"));if(i.length<4||i[2]<0||i[3]<0)return{x:t,y:t,width:t,height:t};const[n,a,s,r]=i;return{x:n,y:a,width:s,height:r}}(e.imagingBBox),this.long=getMeasurement(e.long),this.orientation=getStringOption(e.orientation,["portrait","landscape"]),this.short=getMeasurement(e.short),this.stock=e.stock||"",this.trayIn=getStringOption(e.trayIn,["auto","delegate","pageFront"]),this.trayOut=getStringOption(e.trayOut,["auto","delegate"]),this.use=e.use||"",this.usehref=e.usehref||""}}class Message extends XFAObject{constructor(e){super(Lo,"message",!0),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.text=new XFAObjectArray}}class NumericEdit extends XFAObject{constructor(e){super(Lo,"numericEdit",!0),this.hScrollPolicy=getStringOption(e.hScrollPolicy,["auto","off","on"]),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.border=null,this.comb=null,this.extras=null,this.margin=null}[Qr](e){const t=toStyle(this,"border","font","margin"),i=this[mr]()[mr](),n={name:"input",attributes:{type:"text",fieldId:i[io],dataId:i[Zs]?.[io]||i[io],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(i),"aria-required":!1}};return isRequired(i)&&(n.attributes["aria-required"]=!0,n.attributes.required=!0),HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[n]})}}class Occur extends XFAObject{constructor(e){super(Lo,"occur",!0),this.id=e.id||"",this.initial=""!==e.initial?getInteger({data:e.initial,defaultValue:"",validate:e=>!0}):"",this.max=""!==e.max?getInteger({data:e.max,defaultValue:1,validate:e=>!0}):"",this.min=""!==e.min?getInteger({data:e.min,defaultValue:1,validate:e=>!0}):"",this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null}[Ws](){const e=this[mr](),t=this.min;""===this.min&&(this.min=e instanceof PageArea||e instanceof PageSet?0:1),""===this.max&&(this.max=""===t?e instanceof PageArea||e instanceof PageSet?-1:1:this.min),-1!==this.max&&this.max<this.min&&(this.max=this.min),""===this.initial&&(this.initial=e instanceof Template?1:this.min)}}class Oid extends StringObject{constructor(e){super(Lo,"oid"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}}class Oids extends XFAObject{constructor(e){super(Lo,"oids",!0),this.id=e.id||"",this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||"",this.oid=new XFAObjectArray}}class Overflow extends XFAObject{constructor(e){super(Lo,"overflow"),this.id=e.id||"",this.leader=e.leader||"",this.target=e.target||"",this.trailer=e.trailer||"",this.use=e.use||"",this.usehref=e.usehref||""}[hr](){if(!this[er]){const e=this[mr](),t=this[br](),i=t[Wr](this.target,e),n=t[Wr](this.leader,e),a=t[Wr](this.trailer,e);this[er]={target:i?.[0]||null,leader:n?.[0]||null,trailer:a?.[0]||null,addLeader:!1,addTrailer:!1}}return this[er]}}class PageArea extends XFAObject{constructor(e){super(Lo,"pageArea",!0),this.blankOrNotBlank=getStringOption(e.blankOrNotBlank,["any","blank","notBlank"]),this.id=e.id||"",this.initialNumber=getInteger({data:e.initialNumber,defaultValue:1,validate:e=>!0}),this.name=e.name||"",this.numbered=getInteger({data:e.numbered,defaultValue:1,validate:e=>!0}),this.oddOrEven=getStringOption(e.oddOrEven,["any","even","odd"]),this.pagePosition=getStringOption(e.pagePosition,["any","first","last","only","rest"]),this.relevant=getRelevant(e.relevant),this.use=e.use||"",this.usehref=e.usehref||"",this.desc=null,this.extras=null,this.medium=null,this.occur=null,this.area=new XFAObjectArray,this.contentArea=new XFAObjectArray,this.draw=new XFAObjectArray,this.exclGroup=new XFAObjectArray,this.field=new XFAObjectArray,this.subform=new XFAObjectArray}[Dr](){return this[er]?!this.occur||-1===this.occur.max||this[er].numberOfUse<this.occur.max:(this[er]={numberOfUse:0},!0)}[Gs](){delete this[er]}[fr](){this[er]||={numberOfUse:0};const e=this[mr]();return"orderedOccurrence"===e.relation&&this[Dr]()?(this[er].numberOfUse+=1,this):e[fr]()}[sr](){return this[er].space||{width:0,height:0}}[Qr](){this[er]||={numberOfUse:1};const e=[];this[er].children=e;const t=Object.create(null);if(this.medium&&this.medium.short&&this.medium.long){if(t.width=measureToString(this.medium.short),t.height=measureToString(this.medium.long),this[er].space={width:this.medium.short,height:this.medium.long},"landscape"===this.medium.orientation){const e=t.width;t.width=t.height,t.height=e,this[er].space={width:this.medium.long,height:this.medium.short}}}else warn$1("XFA - No medium specified in pageArea: please file a bug.");return this[zs]({filter:new Set(["area","draw","field","subform"]),include:!0}),this[zs]({filter:new Set(["contentArea"]),include:!0}),HTMLResult.success({name:"div",children:e,attributes:{class:["xfaPage"],id:this[io],style:t,xfaName:this.name}})}}class PageSet extends XFAObject{constructor(e){super(Lo,"pageSet",!0),this.duplexImposition=getStringOption(e.duplexImposition,["longEdge","shortEdge"]),this.id=e.id||"",this.name=e.name||"",this.relation=getStringOption(e.relation,["orderedOccurrence","duplexPaginated","simplexPaginated"]),this.relevant=getRelevant(e.relevant),this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null,this.occur=null,this.pageArea=new XFAObjectArray,this.pageSet=new XFAObjectArray}[Gs](){for(const e of this.pageArea.children)e[Gs]();for(const e of this.pageSet.children)e[Gs]()}[Dr](){return!this.occur||-1===this.occur.max||this[er].numberOfUse<this.occur.max}[fr](){if(this[er]||={numberOfUse:1,pageIndex:-1,pageSetIndex:-1},"orderedOccurrence"===this.relation){if(this[er].pageIndex+1<this.pageArea.children.length){this[er].pageIndex+=1;return this.pageArea.children[this[er].pageIndex][fr]()}if(this[er].pageSetIndex+1<this.pageSet.children.length)return this[er].pageSetIndex+=1,this.pageSet.children[this[er].pageSetIndex][fr]();if(this[Dr]())return this[er].numberOfUse+=1,this[er].pageIndex=-1,this[er].pageSetIndex=-1,this[fr]();const e=this[mr]();return e instanceof PageSet?e[fr]():(this[Gs](),this[fr]())}const e=this[br]()[er].pageNumber,t=e%2==0?"even":"odd",i=0===e?"first":"rest";let n=this.pageArea.children.find(e=>e.oddOrEven===t&&e.pagePosition===i);return n||(n=this.pageArea.children.find(e=>"any"===e.oddOrEven&&e.pagePosition===i),n||(n=this.pageArea.children.find(e=>"any"===e.oddOrEven&&"any"===e.pagePosition),n||this.pageArea.children[0]))}}class Para extends XFAObject{constructor(e){super(Lo,"para",!0),this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=e.id||"",this.lineHeight=e.lineHeight?getMeasurement(e.lineHeight,"0pt"):"",this.marginLeft=e.marginLeft?getMeasurement(e.marginLeft,"0pt"):"",this.marginRight=e.marginRight?getMeasurement(e.marginRight,"0pt"):"",this.orphans=getInteger({data:e.orphans,defaultValue:0,validate:e=>e>=0}),this.preserve=e.preserve||"",this.radixOffset=e.radixOffset?getMeasurement(e.radixOffset,"0pt"):"",this.spaceAbove=e.spaceAbove?getMeasurement(e.spaceAbove,"0pt"):"",this.spaceBelow=e.spaceBelow?getMeasurement(e.spaceBelow,"0pt"):"",this.tabDefault=e.tabDefault?getMeasurement(this.tabDefault):"",this.tabStops=(e.tabStops||"").trim().split(/\s+/).map((e,t)=>t%2==1?getMeasurement(e):e),this.textIndent=e.textIndent?getMeasurement(e.textIndent,"0pt"):"",this.use=e.use||"",this.usehref=e.usehref||"",this.vAlign=getStringOption(e.vAlign,["top","bottom","middle"]),this.widows=getInteger({data:e.widows,defaultValue:0,validate:e=>e>=0}),this.hyphenation=null}[to](){const e=toStyle(this,"hAlign");return""!==this.marginLeft&&(e.paddingLeft=measureToString(this.marginLeft)),""!==this.marginRight&&(e.paddingRight=measureToString(this.marginRight)),""!==this.spaceAbove&&(e.paddingTop=measureToString(this.spaceAbove)),""!==this.spaceBelow&&(e.paddingBottom=measureToString(this.spaceBelow)),""!==this.textIndent&&(e.textIndent=measureToString(this.textIndent),fixTextIndent(e)),this.lineHeight>0&&(e.lineHeight=measureToString(this.lineHeight)),""!==this.tabDefault&&(e.tabSize=measureToString(this.tabDefault)),this.tabStops.length,this.hyphenatation&&Object.assign(e,this.hyphenatation[to]()),e}}class PasswordEdit extends XFAObject{constructor(e){super(Lo,"passwordEdit",!0),this.hScrollPolicy=getStringOption(e.hScrollPolicy,["auto","off","on"]),this.id=e.id||"",this.passwordChar=e.passwordChar||"*",this.use=e.use||"",this.usehref=e.usehref||"",this.border=null,this.extras=null,this.margin=null}}class template_Pattern extends XFAObject{constructor(e){super(Lo,"pattern",!0),this.id=e.id||"",this.type=getStringOption(e.type,["crossHatch","crossDiagonal","diagonalLeft","diagonalRight","horizontal","vertical"]),this.use=e.use||"",this.usehref=e.usehref||"",this.color=null,this.extras=null}[to](e){e=e?e[to]():"#FFFFFF";const t=this.color?this.color[to]():"#000000",i="repeating-linear-gradient",n=`${e},${e} 5px,${t} 5px,${t} 10px`;switch(this.type){case"crossHatch":return`${i}(to top,${n}) ${i}(to right,${n})`;case"crossDiagonal":return`${i}(45deg,${n}) ${i}(-45deg,${n})`;case"diagonalLeft":return`${i}(45deg,${n})`;case"diagonalRight":return`${i}(-45deg,${n})`;case"horizontal":return`${i}(to top,${n})`;case"vertical":return`${i}(to right,${n})`}return""}}class Picture extends StringObject{constructor(e){super(Lo,"picture"),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||""}}class Proto extends XFAObject{constructor(e){super(Lo,"proto",!0),this.appearanceFilter=new XFAObjectArray,this.arc=new XFAObjectArray,this.area=new XFAObjectArray,this.assist=new XFAObjectArray,this.barcode=new XFAObjectArray,this.bindItems=new XFAObjectArray,this.bookend=new XFAObjectArray,this.boolean=new XFAObjectArray,this.border=new XFAObjectArray,this.break=new XFAObjectArray,this.breakAfter=new XFAObjectArray,this.breakBefore=new XFAObjectArray,this.button=new XFAObjectArray,this.calculate=new XFAObjectArray,this.caption=new XFAObjectArray,this.certificate=new XFAObjectArray,this.certificates=new XFAObjectArray,this.checkButton=new XFAObjectArray,this.choiceList=new XFAObjectArray,this.color=new XFAObjectArray,this.comb=new XFAObjectArray,this.connect=new XFAObjectArray,this.contentArea=new XFAObjectArray,this.corner=new XFAObjectArray,this.date=new XFAObjectArray,this.dateTime=new XFAObjectArray,this.dateTimeEdit=new XFAObjectArray,this.decimal=new XFAObjectArray,this.defaultUi=new XFAObjectArray,this.desc=new XFAObjectArray,this.digestMethod=new XFAObjectArray,this.digestMethods=new XFAObjectArray,this.draw=new XFAObjectArray,this.edge=new XFAObjectArray,this.encoding=new XFAObjectArray,this.encodings=new XFAObjectArray,this.encrypt=new XFAObjectArray,this.encryptData=new XFAObjectArray,this.encryption=new XFAObjectArray,this.encryptionMethod=new XFAObjectArray,this.encryptionMethods=new XFAObjectArray,this.event=new XFAObjectArray,this.exData=new XFAObjectArray,this.exObject=new XFAObjectArray,this.exclGroup=new XFAObjectArray,this.execute=new XFAObjectArray,this.extras=new XFAObjectArray,this.field=new XFAObjectArray,this.fill=new XFAObjectArray,this.filter=new XFAObjectArray,this.float=new XFAObjectArray,this.font=new XFAObjectArray,this.format=new XFAObjectArray,this.handler=new XFAObjectArray,this.hyphenation=new XFAObjectArray,this.image=new XFAObjectArray,this.imageEdit=new XFAObjectArray,this.integer=new XFAObjectArray,this.issuers=new XFAObjectArray,this.items=new XFAObjectArray,this.keep=new XFAObjectArray,this.keyUsage=new XFAObjectArray,this.line=new XFAObjectArray,this.linear=new XFAObjectArray,this.lockDocument=new XFAObjectArray,this.manifest=new XFAObjectArray,this.margin=new XFAObjectArray,this.mdp=new XFAObjectArray,this.medium=new XFAObjectArray,this.message=new XFAObjectArray,this.numericEdit=new XFAObjectArray,this.occur=new XFAObjectArray,this.oid=new XFAObjectArray,this.oids=new XFAObjectArray,this.overflow=new XFAObjectArray,this.pageArea=new XFAObjectArray,this.pageSet=new XFAObjectArray,this.para=new XFAObjectArray,this.passwordEdit=new XFAObjectArray,this.pattern=new XFAObjectArray,this.picture=new XFAObjectArray,this.radial=new XFAObjectArray,this.reason=new XFAObjectArray,this.reasons=new XFAObjectArray,this.rectangle=new XFAObjectArray,this.ref=new XFAObjectArray,this.script=new XFAObjectArray,this.setProperty=new XFAObjectArray,this.signData=new XFAObjectArray,this.signature=new XFAObjectArray,this.signing=new XFAObjectArray,this.solid=new XFAObjectArray,this.speak=new XFAObjectArray,this.stipple=new XFAObjectArray,this.subform=new XFAObjectArray,this.subformSet=new XFAObjectArray,this.subjectDN=new XFAObjectArray,this.subjectDNs=new XFAObjectArray,this.submit=new XFAObjectArray,this.text=new XFAObjectArray,this.textEdit=new XFAObjectArray,this.time=new XFAObjectArray,this.timeStamp=new XFAObjectArray,this.toolTip=new XFAObjectArray,this.traversal=new XFAObjectArray,this.traverse=new XFAObjectArray,this.ui=new XFAObjectArray,this.validate=new XFAObjectArray,this.value=new XFAObjectArray,this.variables=new XFAObjectArray}}class Radial extends XFAObject{constructor(e){super(Lo,"radial",!0),this.id=e.id||"",this.type=getStringOption(e.type,["toEdge","toCenter"]),this.use=e.use||"",this.usehref=e.usehref||"",this.color=null,this.extras=null}[to](e){e=e?e[to]():"#FFFFFF";const t=this.color?this.color[to]():"#000000";return`radial-gradient(circle at center, ${"toEdge"===this.type?`${e},${t}`:`${t},${e}`})`}}class Reason extends StringObject{constructor(e){super(Lo,"reason"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}}class Reasons extends XFAObject{constructor(e){super(Lo,"reasons",!0),this.id=e.id||"",this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||"",this.reason=new XFAObjectArray}}class Rectangle extends XFAObject{constructor(e){super(Lo,"rectangle",!0),this.hand=getStringOption(e.hand,["even","left","right"]),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.corner=new XFAObjectArray(4),this.edge=new XFAObjectArray(4),this.fill=null}[Qr](){const e=this.edge.children.length?this.edge.children[0]:new Edge({}),t=e[to](),i=Object.create(null);"visible"===this.fill?.presence?Object.assign(i,this.fill[to]()):i.fill="transparent",i.strokeWidth=measureToString("visible"===e.presence?e.thickness:0),i.stroke=t.color;const n=(this.corner.children.length?this.corner.children[0]:new Corner({}))[to](),a={name:"svg",children:[{name:"rect",attributes:{xmlns:Uo,width:"100%",height:"100%",x:0,y:0,rx:n.radius,ry:n.radius,style:i}}],attributes:{xmlns:Uo,style:{overflow:"visible"},width:"100%",height:"100%"}};return hasMargin(this[mr]()[mr]())?HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[a]}):(a.attributes.style.position="absolute",HTMLResult.success(a))}}class RefElement extends StringObject{constructor(e){super(Lo,"ref"),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||""}}class Script extends StringObject{constructor(e){super(Lo,"script"),this.binding=e.binding||"",this.contentType=e.contentType||"",this.id=e.id||"",this.name=e.name||"",this.runAt=getStringOption(e.runAt,["client","both","server"]),this.use=e.use||"",this.usehref=e.usehref||""}}class SetProperty extends XFAObject{constructor(e){super(Lo,"setProperty"),this.connection=e.connection||"",this.ref=e.ref||"",this.target=e.target||""}}class SignData extends XFAObject{constructor(e){super(Lo,"signData",!0),this.id=e.id||"",this.operation=getStringOption(e.operation,["sign","clear","verify"]),this.ref=e.ref||"",this.target=e.target||"",this.use=e.use||"",this.usehref=e.usehref||"",this.filter=null,this.manifest=null}}class Signature extends XFAObject{constructor(e){super(Lo,"signature",!0),this.id=e.id||"",this.type=getStringOption(e.type,["PDF1.3","PDF1.6"]),this.use=e.use||"",this.usehref=e.usehref||"",this.border=null,this.extras=null,this.filter=null,this.manifest=null,this.margin=null}}class Signing extends XFAObject{constructor(e){super(Lo,"signing",!0),this.id=e.id||"",this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||"",this.certificate=new XFAObjectArray}}class Solid extends XFAObject{constructor(e){super(Lo,"solid",!0),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null}[to](e){return e?e[to]():"#FFFFFF"}}class Speak extends StringObject{constructor(e){super(Lo,"speak"),this.disable=getInteger({data:e.disable,defaultValue:0,validate:e=>1===e}),this.id=e.id||"",this.priority=getStringOption(e.priority,["custom","caption","name","toolTip"]),this.rid=e.rid||"",this.use=e.use||"",this.usehref=e.usehref||""}}class Stipple extends XFAObject{constructor(e){super(Lo,"stipple",!0),this.id=e.id||"",this.rate=getInteger({data:e.rate,defaultValue:50,validate:e=>e>=0&&e<=100}),this.use=e.use||"",this.usehref=e.usehref||"",this.color=null,this.extras=null}[to](e){const t=this.rate/100;return ai.makeHexColor(Math.round(e.value.r*(1-t)+this.value.r*t),Math.round(e.value.g*(1-t)+this.value.g*t),Math.round(e.value.b*(1-t)+this.value.b*t))}}class Subform extends XFAObject{constructor(e){super(Lo,"subform",!0),this.access=getStringOption(e.access,["open","nonInteractive","protected","readOnly"]),this.allowMacro=getInteger({data:e.allowMacro,defaultValue:0,validate:e=>1===e}),this.anchorType=getStringOption(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e}),this.columnWidths=(e.columnWidths||"").trim().split(/\s+/).map(e=>"-1"===e?-1:getMeasurement(e)),this.h=e.h?getMeasurement(e.h):"",this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=e.id||"",this.layout=getStringOption(e.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]),this.locale=e.locale||"",this.maxH=getMeasurement(e.maxH,"0pt"),this.maxW=getMeasurement(e.maxW,"0pt"),this.mergeMode=getStringOption(e.mergeMode,["consumeData","matchTemplate"]),this.minH=getMeasurement(e.minH,"0pt"),this.minW=getMeasurement(e.minW,"0pt"),this.name=e.name||"",this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(e.relevant),this.restoreState=getStringOption(e.restoreState,["manual","auto"]),this.scope=getStringOption(e.scope,["name","none"]),this.use=e.use||"",this.usehref=e.usehref||"",this.w=e.w?getMeasurement(e.w):"",this.x=getMeasurement(e.x,"0pt"),this.y=getMeasurement(e.y,"0pt"),this.assist=null,this.bind=null,this.bookend=null,this.border=null,this.break=null,this.calculate=null,this.desc=null,this.extras=null,this.keep=null,this.margin=null,this.occur=null,this.overflow=null,this.pageSet=null,this.para=null,this.traversal=null,this.validate=null,this.variables=null,this.area=new XFAObjectArray,this.breakAfter=new XFAObjectArray,this.breakBefore=new XFAObjectArray,this.connect=new XFAObjectArray,this.draw=new XFAObjectArray,this.event=new XFAObjectArray,this.exObject=new XFAObjectArray,this.exclGroup=new XFAObjectArray,this.field=new XFAObjectArray,this.proto=new XFAObjectArray,this.setProperty=new XFAObjectArray,this.subform=new XFAObjectArray,this.subformSet=new XFAObjectArray}[pr](){const e=this[mr]();return e instanceof SubformSet?e[pr]():e}[Cr](){return!0}[Er](){return this.layout.endsWith("-tb")&&0===this[er].attempt&&this[er].numberInLine>0||this[mr]()[Er]()}*[gr](){yield*getContainedChildren(this)}[ir](){return flushHTML(this)}[Xs](e,t){addHTML(this,e,t)}[sr](){return getAvailableSpace(this)}[Ir](){const e=this[pr]();return!!e[Ir]()&&(void 0!==this[er]._isSplittable?this[er]._isSplittable:"position"===this.layout||this.layout.includes("row")||this.keep&&"none"!==this.keep.intact?(this[er]._isSplittable=!1,!1):(!e.layout?.endsWith("-tb")||0===e[er].numberInLine)&&(this[er]._isSplittable=!0,!0))}[Qr](e){if(setTabIndex(this),this.break){if("auto"!==this.break.after||""!==this.break.afterTarget){const e=new BreakAfter({targetType:this.break.after,target:this.break.afterTarget,startNew:this.break.startNew.toString()});e[yr]=this[yr],this[qs](e),this.breakAfter.push(e)}if("auto"!==this.break.before||""!==this.break.beforeTarget){const e=new BreakBefore({targetType:this.break.before,target:this.break.beforeTarget,startNew:this.break.startNew.toString()});e[yr]=this[yr],this[qs](e),this.breakBefore.push(e)}if(""!==this.break.overflowTarget){const e=new Overflow({target:this.break.overflowTarget,leader:this.break.overflowLeader,trailer:this.break.overflowTrailer});e[yr]=this[yr],this[qs](e),this.overflow.push(e)}this[Xr](this.break),this.break=null}if("hidden"===this.presence||"inactive"===this.presence)return HTMLResult.EMPTY;if((this.breakBefore.children.length>1||this.breakAfter.children.length>1)&&warn$1("XFA - Several breakBefore or breakAfter in subforms: please file a bug."),this.breakBefore.children.length>=1){const e=this.breakBefore.children[0];if(handleBreak(e))return HTMLResult.breakNode(e)}if(this[er]?.afterBreakAfter)return HTMLResult.EMPTY;fixDimensions(this);const t=[],i={id:this[io],class:[]};setAccess(this,i.class),this[er]||=Object.create(null),Object.assign(this[er],{children:t,line:null,attributes:i,attempt:0,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,e.width),height:Math.min(this.h||1/0,e.height)},width:0,height:0,prevHeight:0,currentWidth:0});const n=this[br](),a=n[er].noLayoutFailure,s=this[Ir]();if(s||setFirstUnsplittable(this),!checkDimensions(this,e))return HTMLResult.FAILURE;const r=new Set(["area","draw","exclGroup","field","subform","subformSet"]);if(this.layout.includes("row")){const e=this[pr]().columnWidths;Array.isArray(e)&&e.length>0&&(this[er].columnWidths=e,this[er].currentColumn=0)}const o=toStyle(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),l=["xfaSubform"],c=layoutClass(this);if(c&&l.push(c),i.style=o,i.class=l,this.name&&(i.xfaName=this.name),this.overflow){const t=this.overflow[hr]();t.addLeader&&(t.addLeader=!1,handleOverflow(this,t.leader,e))}this[Hr]();const h="lr-tb"===this.layout||"rl-tb"===this.layout,d=h?2:1;for(;this[er].attempt<d;this[er].attempt++){h&&1===this[er].attempt&&(this[er].numberInLine=0);const e=this[zs]({filter:r,include:!0});if(e.success)break;if(e.isBreak())return this[$r](),e;if(h&&0===this[er].attempt&&0===this[er].numberInLine&&!n[er].noLayoutFailure){this[er].attempt=d;break}}if(this[$r](),s||unsetFirstUnsplittable(this),n[er].noLayoutFailure=a,this[er].attempt===d)return this.overflow&&(this[br]()[er].overflowNode=this.overflow),s||delete this[er],HTMLResult.FAILURE;if(this.overflow){const t=this.overflow[hr]();t.addTrailer&&(t.addTrailer=!1,handleOverflow(this,t.trailer,e))}let u=0,g=0;this.margin&&(u=this.margin.leftInset+this.margin.rightInset,g=this.margin.topInset+this.margin.bottomInset);const f=Math.max(this[er].width+u,this.w||0),p=Math.max(this[er].height+g,this.h||0),m=[this.x,this.y,f,p];if(""===this.w&&(o.width=measureToString(f)),""===this.h&&(o.height=measureToString(p)),("0px"===o.width||"0px"===o.height)&&0===t.length)return HTMLResult.EMPTY;const b={name:"div",attributes:i,children:t};applyAssist(this,i);const y=HTMLResult.success(createWrapper(this,b),m);if(this.breakAfter.children.length>=1){const e=this.breakAfter.children[0];if(handleBreak(e))return this[er].afterBreakAfter=y,HTMLResult.breakNode(e)}return delete this[er],y}}class SubformSet extends XFAObject{constructor(e){super(Lo,"subformSet",!0),this.id=e.id||"",this.name=e.name||"",this.relation=getStringOption(e.relation,["ordered","choice","unordered"]),this.relevant=getRelevant(e.relevant),this.use=e.use||"",this.usehref=e.usehref||"",this.bookend=null,this.break=null,this.desc=null,this.extras=null,this.occur=null,this.overflow=null,this.breakAfter=new XFAObjectArray,this.breakBefore=new XFAObjectArray,this.subform=new XFAObjectArray,this.subformSet=new XFAObjectArray}*[gr](){yield*getContainedChildren(this)}[pr](){let e=this[mr]();for(;!(e instanceof Subform);)e=e[mr]();return e}[Cr](){return!0}}class SubjectDN extends ContentObject{constructor(e){super(Lo,"subjectDN"),this.delimiter=e.delimiter||",",this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}[tr](){this[Js]=new Map(this[Js].split(this.delimiter).map(e=>((e=e.split("=",2))[0]=e[0].trim(),e)))}}class SubjectDNs extends XFAObject{constructor(e){super(Lo,"subjectDNs",!0),this.id=e.id||"",this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||"",this.subjectDN=new XFAObjectArray}}class Submit extends XFAObject{constructor(e){super(Lo,"submit",!0),this.embedPDF=getInteger({data:e.embedPDF,defaultValue:0,validate:e=>1===e}),this.format=getStringOption(e.format,["xdp","formdata","pdf","urlencoded","xfd","xml"]),this.id=e.id||"",this.target=e.target||"",this.textEncoding=getKeyword({data:e.textEncoding?e.textEncoding.toLowerCase():"",defaultValue:"",validate:e=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(e)||e.match(/iso-8859-\d{2}/)}),this.use=e.use||"",this.usehref=e.usehref||"",this.xdpContent=e.xdpContent||"",this.encrypt=null,this.encryptData=new XFAObjectArray,this.signData=new XFAObjectArray}}class Template extends XFAObject{constructor(e){super(Lo,"template",!0),this.baseProfile=getStringOption(e.baseProfile,["full","interactiveForms"]),this.extras=null,this.subform=new XFAObjectArray}[tr](){0===this.subform.children.length&&warn$1("XFA - No subforms in template node."),this.subform.children.length>=2&&warn$1("XFA - Several subforms in template node: please file a bug."),this[Yr]=5e3}[Ir](){return!0}[Wr](e,t){return e.startsWith("#")?[this[Ar].get(e.slice(1))]:searchNode(this,t,e,!0,!0)}*[Zr](){if(!this.subform.children.length)return HTMLResult.success({name:"div",children:[]});this[er]={overflowNode:null,firstUnsplittable:null,currentContentArea:null,currentPageArea:null,noLayoutFailure:!1,pageNumber:1,pagePosition:"first",oddOrEven:"odd",blankOrNotBlank:"nonBlank",paraStack:[]};const e=this.subform.children[0];e.pageSet[Gs]();const t=e.pageSet.pageArea.children,i={name:"div",children:[]};let n=null,a=null,s=null;if(e.breakBefore.children.length>=1?(a=e.breakBefore.children[0],s=a.target):e.subform.children.length>=1&&e.subform.children[0].breakBefore.children.length>=1?(a=e.subform.children[0].breakBefore.children[0],s=a.target):e.break?.beforeTarget?(a=e.break,s=a.beforeTarget):e.subform.children.length>=1&&e.subform.children[0].break?.beforeTarget&&(a=e.subform.children[0].break,s=a.beforeTarget),a){const e=this[Wr](s,a[mr]());e instanceof PageArea&&(n=e,a[er]={})}n||=t[0],n[er]={numberOfUse:1};const r=n[mr]();let o;r[er]={numberOfUse:1,pageIndex:r.pageArea.children.indexOf(n),pageSetIndex:0};let l=null,c=null,h=!0,d=0,u=0;for(;;){if(h)d=0;else if(i.children.pop(),3===++d)return warn$1("XFA - Something goes wrong: please file a bug."),i;o=null,this[er].currentPageArea=n;const t=n[Qr]().html;i.children.push(t),l&&(this[er].noLayoutFailure=!0,t.children.push(l[Qr](n[er].space).html),l=null),c&&(this[er].noLayoutFailure=!0,t.children.push(c[Qr](n[er].space).html),c=null);const a=n.contentArea.children,s=t.children.filter(e=>e.attributes.class.includes("xfaContentarea"));h=!1,this[er].firstUnsplittable=null,this[er].noLayoutFailure=!1;const flush=t=>{const i=e[ir]();i&&(h||=i.children?.length>0,s[t].children.push(i))};for(let t=u,n=a.length;t<n;t++){const n=this[er].currentContentArea=a[t],r={width:n.w,height:n.h};u=0,l&&(s[t].children.push(l[Qr](r).html),l=null),c&&(s[t].children.push(c[Qr](r).html),c=null);const d=e[Qr](r);if(d.success)return d.html?(h||=d.html.children?.length>0,s[t].children.push(d.html)):!h&&i.children.length>1&&i.children.pop(),i;if(d.isBreak()){const e=d.breakNode;if(flush(t),"auto"===e.targetType)continue;e.leader&&(l=this[Wr](e.leader,e[mr]()),l=l?l[0]:null),e.trailer&&(c=this[Wr](e.trailer,e[mr]()),c=c?c[0]:null),"pageArea"===e.targetType?(o=e[er].target,t=1/0):e[er].target?(o=e[er].target,u=e[er].index+1,t=1/0):t=e[er].index;continue}if(this[er].overflowNode){const e=this[er].overflowNode;this[er].overflowNode=null;const i=e[hr](),n=i.target;i.addLeader=null!==i.leader,i.addTrailer=null!==i.trailer,flush(t);const s=t;if(t=1/0,n instanceof PageArea)o=n;else if(n instanceof ContentArea){const e=a.indexOf(n);-1!==e?e>s?t=e-1:u=e:(o=n[mr](),u=o.contentArea.children.indexOf(n))}continue}flush(t)}this[er].pageNumber+=1,o&&(o[Dr]()?o[er].numberOfUse+=1:o=null),n=o||n[fr](),yield null}}}class Text extends ContentObject{constructor(e){super(Lo,"text"),this.id=e.id||"",this.maxChars=getInteger({data:e.maxChars,defaultValue:0,validate:e=>e>=0}),this.name=e.name||"",this.rid=e.rid||"",this.use=e.use||"",this.usehref=e.usehref||""}[Hs](){return!0}[Nr](e){return e[_r]===ao.xhtml.id?(this[Js]=e,!0):(warn$1(`XFA - Invalid content in Text: ${e[Pr]}.`),!1)}[Ur](e){this[Js]instanceof XFAObject||super[Ur](e)}[tr](){"string"==typeof this[Js]&&(this[Js]=this[Js].replaceAll("\r\n","\n"))}[hr](){return"string"==typeof this[Js]?this[Js].split(/[\u2029\u2028\n]/).filter(e=>!!e).join("\n"):this[Js][Jr]()}[Qr](e){if("string"==typeof this[Js]){const e=valueToHtml(this[Js]).html;return this[Js].includes("\u2029")?(e.name="div",e.children=[],this[Js].split("\u2029").map(e=>e.split(/[\u2028\n]/).flatMap(e=>[{name:"span",value:e},{name:"br"}])).forEach(t=>{e.children.push({name:"p",children:t})})):/[\u2028\n]/.test(this[Js])&&(e.name="div",e.children=[],this[Js].split(/[\u2028\n]/).forEach(t=>{e.children.push({name:"span",value:t},{name:"br"})})),HTMLResult.success(e)}return this[Js][Qr](e)}}class TextEdit extends XFAObject{constructor(e){super(Lo,"textEdit",!0),this.allowRichText=getInteger({data:e.allowRichText,defaultValue:0,validate:e=>1===e}),this.hScrollPolicy=getStringOption(e.hScrollPolicy,["auto","off","on"]),this.id=e.id||"",this.multiLine=getInteger({data:e.multiLine,defaultValue:"",validate:e=>0===e||1===e}),this.use=e.use||"",this.usehref=e.usehref||"",this.vScrollPolicy=getStringOption(e.vScrollPolicy,["auto","off","on"]),this.border=null,this.comb=null,this.extras=null,this.margin=null}[Qr](e){const t=toStyle(this,"border","font","margin");let i;const n=this[mr]()[mr]();return""===this.multiLine&&(this.multiLine=n instanceof Draw?1:0),i=1===this.multiLine?{name:"textarea",attributes:{dataId:n[Zs]?.[io]||n[io],fieldId:n[io],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(n),"aria-required":!1}}:{name:"input",attributes:{type:"text",dataId:n[Zs]?.[io]||n[io],fieldId:n[io],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(n),"aria-required":!1}},isRequired(n)&&(i.attributes["aria-required"]=!0,i.attributes.required=!0),HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[i]})}}class Time extends StringObject{constructor(e){super(Lo,"time"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}[tr](){const e=this[Js].trim();this[Js]=e?new Date(e):null}[Qr](e){return valueToHtml(this[Js]?this[Js].toString():"")}}class TimeStamp extends XFAObject{constructor(e){super(Lo,"timeStamp"),this.id=e.id||"",this.server=e.server||"",this.type=getStringOption(e.type,["optional","required"]),this.use=e.use||"",this.usehref=e.usehref||""}}class ToolTip extends StringObject{constructor(e){super(Lo,"toolTip"),this.id=e.id||"",this.rid=e.rid||"",this.use=e.use||"",this.usehref=e.usehref||""}}class Traversal extends XFAObject{constructor(e){super(Lo,"traversal",!0),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null,this.traverse=new XFAObjectArray}}class Traverse extends XFAObject{constructor(e){super(Lo,"traverse",!0),this.id=e.id||"",this.operation=getStringOption(e.operation,["next","back","down","first","left","right","up"]),this.ref=e.ref||"",this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null,this.script=null}get name(){return this.operation}[Mr](){return!1}}class Ui extends XFAObject{constructor(e){super(Lo,"ui",!0),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null,this.picture=null,this.barcode=null,this.button=null,this.checkButton=null,this.choiceList=null,this.dateTimeEdit=null,this.defaultUi=null,this.imageEdit=null,this.numericEdit=null,this.passwordEdit=null,this.signature=null,this.textEdit=null}[hr](){if(void 0===this[er]){for(const e of Object.getOwnPropertyNames(this)){if("extras"===e||"picture"===e)continue;const t=this[e];if(t instanceof XFAObject)return this[er]=t,t}this[er]=null}return this[er]}[Qr](e){const t=this[hr]();return t?t[Qr](e):HTMLResult.EMPTY}}class Validate extends XFAObject{constructor(e){super(Lo,"validate",!0),this.formatTest=getStringOption(e.formatTest,["warning","disabled","error"]),this.id=e.id||"",this.nullTest=getStringOption(e.nullTest,["disabled","error","warning"]),this.scriptTest=getStringOption(e.scriptTest,["error","disabled","warning"]),this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null,this.message=null,this.picture=null,this.script=null}}class Value extends XFAObject{constructor(e){super(Lo,"value",!0),this.id=e.id||"",this.override=getInteger({data:e.override,defaultValue:0,validate:e=>1===e}),this.relevant=getRelevant(e.relevant),this.use=e.use||"",this.usehref=e.usehref||"",this.arc=null,this.boolean=null,this.date=null,this.dateTime=null,this.decimal=null,this.exData=null,this.float=null,this.image=null,this.integer=null,this.line=null,this.rectangle=null,this.text=null,this.time=null}[Kr](e){const t=this[mr]();if(t instanceof Field&&t.ui?.imageEdit)return this.image||(this.image=new qo({}),this[qs](this.image)),void(this.image[Js]=e[Js]);const i=e[Pr];if(null===this[i]){for(const e of Object.getOwnPropertyNames(this)){const t=this[e];t instanceof XFAObject&&(this[e]=null,this[Xr](t))}this[e[Pr]]=e,this[qs](e)}else this[i][Js]=e[Js]}[Jr](){if(this.exData)return"string"==typeof this.exData[Js]?this.exData[Js].trim():this.exData[Js][Jr]().trim();for(const e of Object.getOwnPropertyNames(this)){if("image"===e)continue;const t=this[e];if(t instanceof XFAObject)return(t[Js]||"").toString().trim()}return null}[Qr](e){for(const t of Object.getOwnPropertyNames(this)){const i=this[t];if(i instanceof XFAObject)return i[Qr](e)}return HTMLResult.EMPTY}}class Variables extends XFAObject{constructor(e){super(Lo,"variables",!0),this.id=e.id||"",this.use=e.use||"",this.usehref=e.usehref||"",this.boolean=new XFAObjectArray,this.date=new XFAObjectArray,this.dateTime=new XFAObjectArray,this.decimal=new XFAObjectArray,this.exData=new XFAObjectArray,this.float=new XFAObjectArray,this.image=new XFAObjectArray,this.integer=new XFAObjectArray,this.manifest=new XFAObjectArray,this.script=new XFAObjectArray,this.text=new XFAObjectArray,this.time=new XFAObjectArray}[Mr](){return!0}}class TemplateNamespace{static[no](e,t){if(TemplateNamespace.hasOwnProperty(e)){const i=TemplateNamespace[e](t);return i[Vr](t),i}}static appearanceFilter(e){return new AppearanceFilter(e)}static arc(e){return new Arc(e)}static area(e){return new Area(e)}static assist(e){return new Assist(e)}static barcode(e){return new Barcode(e)}static bind(e){return new Bind(e)}static bindItems(e){return new BindItems(e)}static bookend(e){return new Bookend(e)}static boolean(e){return new BooleanElement(e)}static border(e){return new Border(e)}static break(e){return new Break(e)}static breakAfter(e){return new BreakAfter(e)}static breakBefore(e){return new BreakBefore(e)}static button(e){return new Button(e)}static calculate(e){return new Calculate(e)}static caption(e){return new Caption(e)}static certificate(e){return new Certificate(e)}static certificates(e){return new Certificates(e)}static checkButton(e){return new CheckButton(e)}static choiceList(e){return new ChoiceList(e)}static color(e){return new Color(e)}static comb(e){return new Comb(e)}static connect(e){return new Connect(e)}static contentArea(e){return new ContentArea(e)}static corner(e){return new Corner(e)}static date(e){return new DateElement(e)}static dateTime(e){return new DateTime(e)}static dateTimeEdit(e){return new DateTimeEdit(e)}static decimal(e){return new Decimal(e)}static defaultUi(e){return new DefaultUi(e)}static desc(e){return new Desc(e)}static digestMethod(e){return new DigestMethod(e)}static digestMethods(e){return new DigestMethods(e)}static draw(e){return new Draw(e)}static edge(e){return new Edge(e)}static encoding(e){return new Encoding(e)}static encodings(e){return new Encodings(e)}static encrypt(e){return new Encrypt(e)}static encryptData(e){return new EncryptData(e)}static encryption(e){return new Encryption(e)}static encryptionMethod(e){return new EncryptionMethod(e)}static encryptionMethods(e){return new EncryptionMethods(e)}static event(e){return new Xo(e)}static exData(e){return new ExData(e)}static exObject(e){return new ExObject(e)}static exclGroup(e){return new ExclGroup(e)}static execute(e){return new Execute(e)}static extras(e){return new Extras(e)}static field(e){return new Field(e)}static fill(e){return new Fill(e)}static filter(e){return new Filter(e)}static float(e){return new Float(e)}static font(e){return new template_Font(e)}static format(e){return new Format(e)}static handler(e){return new Handler(e)}static hyphenation(e){return new Hyphenation(e)}static image(e){return new qo(e)}static imageEdit(e){return new ImageEdit(e)}static integer(e){return new Integer(e)}static issuers(e){return new Issuers(e)}static items(e){return new Items(e)}static keep(e){return new Keep(e)}static keyUsage(e){return new KeyUsage(e)}static line(e){return new Line(e)}static linear(e){return new Linear(e)}static lockDocument(e){return new LockDocument(e)}static manifest(e){return new Manifest(e)}static margin(e){return new Margin(e)}static mdp(e){return new Mdp(e)}static medium(e){return new Medium(e)}static message(e){return new Message(e)}static numericEdit(e){return new NumericEdit(e)}static occur(e){return new Occur(e)}static oid(e){return new Oid(e)}static oids(e){return new Oids(e)}static overflow(e){return new Overflow(e)}static pageArea(e){return new PageArea(e)}static pageSet(e){return new PageSet(e)}static para(e){return new Para(e)}static passwordEdit(e){return new PasswordEdit(e)}static pattern(e){return new template_Pattern(e)}static picture(e){return new Picture(e)}static proto(e){return new Proto(e)}static radial(e){return new Radial(e)}static reason(e){return new Reason(e)}static reasons(e){return new Reasons(e)}static rectangle(e){return new Rectangle(e)}static ref(e){return new RefElement(e)}static script(e){return new Script(e)}static setProperty(e){return new SetProperty(e)}static signData(e){return new SignData(e)}static signature(e){return new Signature(e)}static signing(e){return new Signing(e)}static solid(e){return new Solid(e)}static speak(e){return new Speak(e)}static stipple(e){return new Stipple(e)}static subform(e){return new Subform(e)}static subformSet(e){return new SubformSet(e)}static subjectDN(e){return new SubjectDN(e)}static subjectDNs(e){return new SubjectDNs(e)}static submit(e){return new Submit(e)}static template(e){return new Template(e)}static text(e){return new Text(e)}static textEdit(e){return new TextEdit(e)}static time(e){return new Time(e)}static timeStamp(e){return new TimeStamp(e)}static toolTip(e){return new ToolTip(e)}static traversal(e){return new Traversal(e)}static traverse(e){return new Traverse(e)}static ui(e){return new Ui(e)}static validate(e){return new Validate(e)}static value(e){return new Value(e)}static variables(e){return new Variables(e)}}const zo=ao.datasets.id;function createText(e){const t=new Text({});return t[Js]=e,t}class Binder{constructor(e){this.root=e,this.datasets=e.datasets,this.data=e.datasets?.data||new XmlObject(ao.datasets.id,"data"),this.emptyMerge=0===this.data[ur]().length,this.root.form=this.form=e.template[Ks]()}_isConsumeData(){return!this.emptyMerge&&this._mergeMode}_isMatchTemplate(){return!this._isConsumeData()}bind(){return this._bindElement(this.form,this.data),this.form}getData(){return this.data}_bindValue(e,t,i){if(e[Zs]=t,e[wr]())if(t[kr]()){const i=t[cr]();e[Kr](createText(i))}else if(e instanceof Field&&"multiSelect"===e.ui?.choiceList?.open){const i=t[ur]().map(e=>e[Js].trim()).join("\n");e[Kr](createText(i))}else this._isConsumeData()&&warn$1("XFA - Nodes haven't the same type.");else!t[kr]()||this._isMatchTemplate()?this._bindElement(e,t):warn$1("XFA - Nodes haven't the same type.")}_findDataByNameToConsume(e,t,i,n){if(!e)return null;let a,s;for(let n=0;n<3;n++){for(a=i[dr](e,!1,!0);s=a.next().value,s;)if(t===s[kr]())return s;if(i[_r]===ao.datasets.id&&"data"===i[Pr])break;i=i[mr]()}return n?(a=this.data[dr](e,!0,!1),s=a.next().value,s||(a=this.data[nr](e,!0),s=a.next().value,s?.[kr]()?s:null)):null}_setProperties(e,t){if(e.hasOwnProperty("setProperty"))for(const{ref:i,target:n,connection:a}of e.setProperty.children){if(a)continue;if(!i)continue;const s=searchNode(this.root,t,i,!1,!1);if(!s){warn$1(`XFA - Invalid reference: ${i}.`);continue}const[r]=s;if(!r[Tr](this.data)){warn$1("XFA - Invalid node: must be a data node.");continue}const o=searchNode(this.root,e,n,!1,!1);if(!o){warn$1(`XFA - Invalid target: ${n}.`);continue}const[l]=o;if(!l[Tr](e)){warn$1("XFA - Invalid target: must be a property or subproperty.");continue}const c=l[mr]();if(l instanceof SetProperty||c instanceof SetProperty){warn$1("XFA - Invalid target: cannot be a setProperty or one of its properties.");continue}if(l instanceof BindItems||c instanceof BindItems){warn$1("XFA - Invalid target: cannot be a bindItems or one of its properties.");continue}const h=r[Jr](),d=l[Pr];if(l instanceof XFAAttribute){const e=Object.create(null);e[d]=h;const t=Reflect.construct(Object.getPrototypeOf(c).constructor,[e]);c[d]=t[d];continue}l.hasOwnProperty(Js)?(l[Zs]=r,l[Js]=h,l[tr]()):warn$1("XFA - Invalid node to use in setProperty")}}_bindItems(e,t){if(!e.hasOwnProperty("items")||!e.hasOwnProperty("bindItems")||e.bindItems.isEmpty())return;for(const t of e.items.children)e[Xr](t);e.items.clear();const i=new Items({}),n=new Items({});e[qs](i),e.items.push(i),e[qs](n),e.items.push(n);for(const{ref:a,labelRef:s,valueRef:r,connection:o}of e.bindItems.children){if(o)continue;if(!a)continue;const e=searchNode(this.root,t,a,!1,!1);if(e)for(const t of e){if(!t[Tr](this.datasets)){warn$1(`XFA - Invalid ref (${a}): must be a datasets child.`);continue}const e=searchNode(this.root,t,s,!0,!1);if(!e){warn$1(`XFA - Invalid label: ${s}.`);continue}const[o]=e;if(!o[Tr](this.datasets)){warn$1("XFA - Invalid label: must be a datasets child.");continue}const l=searchNode(this.root,t,r,!0,!1);if(!l){warn$1(`XFA - Invalid value: ${r}.`);continue}const[c]=l;if(!c[Tr](this.datasets)){warn$1("XFA - Invalid value: must be a datasets child.");continue}const h=createText(o[Jr]()),d=createText(c[Jr]());i[qs](h),i.text.push(h),n[qs](d),n.text.push(d)}else warn$1(`XFA - Invalid reference: ${a}.`)}}_bindOccurrences(e,t,i){let n;if(t.length>1&&(n=e[Ks](),n[Xr](n.occur),n.occur=null),this._bindValue(e,t[0],i),this._setProperties(e,t[0]),this._bindItems(e,t[0]),1===t.length)return;const a=e[mr](),s=e[Pr],r=a[xr](e);for(let e=1,o=t.length;e<o;e++){const o=t[e],l=n[Ks]();a[s].push(l),a[Sr](r+e,l),this._bindValue(l,o,i),this._setProperties(l,o),this._bindItems(l,o)}}_createOccurrences(e){if(!this.emptyMerge)return;const{occur:t}=e;if(!t||t.initial<=1)return;const i=e[mr](),n=e[Pr];if(!(i[n]instanceof XFAObjectArray))return;let a;a=e.name?i[n].children.filter(t=>t.name===e.name).length:i[n].children.length;const s=i[xr](e)+1,r=t.initial-a;if(r){const t=e[Ks]();t[Xr](t.occur),t.occur=null,i[n].push(t),i[Sr](s,t);for(let e=1;e<r;e++){const a=t[Ks]();i[n].push(a),i[Sr](s+e,a)}}}_getOccurInfo(e){const{name:t,occur:i}=e;if(!i||!t)return[1,1];const n=-1===i.max?1/0:i.max;return[i.min,n]}_setAndBind(e,t){this._setProperties(e,t),this._bindItems(e,t),this._bindElement(e,t)}_bindElement(e,t){const i=[];this._createOccurrences(e);for(const n of e[ur]()){if(n[Zs])continue;if(void 0===this._mergeMode&&"subform"===n[Pr]){this._mergeMode="consumeData"===n.mergeMode;const e=t[ur]();if(e.length>0)this._bindOccurrences(n,[e[0]],null);else if(this.emptyMerge){const e=t[_r]===zo?-1:t[_r],i=n[Zs]=new XmlObject(e,n.name||"root");t[qs](i),this._bindElement(n,i)}continue}if(!n[Cr]())continue;let e=!1,a=null,s=null,r=null;if(n.bind){switch(n.bind.match){case"none":this._setAndBind(n,t);continue;case"global":e=!0;break;case"dataRef":if(!n.bind.ref){warn$1(`XFA - ref is empty in node ${n[Pr]}.`),this._setAndBind(n,t);continue}s=n.bind.ref}n.bind.picture&&(a=n.bind.picture[Js])}const[o,l]=this._getOccurInfo(n);if(s){if(r=searchNode(this.root,t,s,!0,!1),null===r){if(r=createDataNode(this.data,t,s),!r)continue;this._isConsumeData()&&(r[Ys]=!0),this._setAndBind(n,r);continue}this._isConsumeData()&&(r=r.filter(e=>!e[Ys])),r.length>l?r=r.slice(0,l):0===r.length&&(r=null),r&&this._isConsumeData()&&r.forEach(e=>{e[Ys]=!0})}else{if(!n.name){this._setAndBind(n,t);continue}if(this._isConsumeData()){const i=[];for(;i.length<l;){const a=this._findDataByNameToConsume(n.name,n[wr](),t,e);if(!a)break;a[Ys]=!0,i.push(a)}r=i.length>0?i:null}else{if(r=t[dr](n.name,!1,this.emptyMerge).next().value,!r){if(0===o){i.push(n);continue}const e=t[_r]===zo?-1:t[_r];r=n[Zs]=new XmlObject(e,n.name),this.emptyMerge&&(r[Ys]=!0),t[qs](r),this._setAndBind(n,r);continue}this.emptyMerge&&(r[Ys]=!0),r=[r]}}r?this._bindOccurrences(n,r,a):o>0?this._setAndBind(n,t):i.push(n)}i.forEach(e=>e[mr]()[Xr](e))}}class DataHandler{constructor(e,t){this.data=t,this.dataset=e.datasets||null}serialize(e){const t=[[-1,this.data[ur]()]];for(;t.length>0;){const i=t.at(-1),[n,a]=i;if(n+1===a.length){t.pop();continue}const s=a[++i[0]],r=e.get(s[io]);if(r)s[Kr](r);else{const t=s[ar]();for(const i of t.values()){const t=e.get(i[io]);if(t){i[Kr](t);break}}}const o=s[ur]();o.length>0&&t.push([-1,o])}const i=['<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">'];if(this.dataset)for(const e of this.dataset[ur]())"data"!==e[Pr]&&e[eo](i);return this.data[eo](i),i.push("</xfa:datasets>"),i.join("")}}const Wo=ao.config.id;class Acrobat extends XFAObject{constructor(e){super(Wo,"acrobat",!0),this.acrobat7=null,this.autoSave=null,this.common=null,this.validate=null,this.validateApprovalSignatures=null,this.submitUrl=new XFAObjectArray}}class Acrobat7 extends XFAObject{constructor(e){super(Wo,"acrobat7",!0),this.dynamicRender=null}}class ADBE_JSConsole extends OptionObject{constructor(e){super(Wo,"ADBE_JSConsole",["delegate","Enable","Disable"])}}class ADBE_JSDebugger extends OptionObject{constructor(e){super(Wo,"ADBE_JSDebugger",["delegate","Enable","Disable"])}}class AddSilentPrint extends Option01{constructor(e){super(Wo,"addSilentPrint")}}class AddViewerPreferences extends Option01{constructor(e){super(Wo,"addViewerPreferences")}}class AdjustData extends Option10{constructor(e){super(Wo,"adjustData")}}class AdobeExtensionLevel extends IntegerObject{constructor(e){super(Wo,"adobeExtensionLevel",0,e=>e>=1&&e<=8)}}class Agent extends XFAObject{constructor(e){super(Wo,"agent",!0),this.name=e.name?e.name.trim():"",this.common=new XFAObjectArray}}class AlwaysEmbed extends ContentObject{constructor(e){super(Wo,"alwaysEmbed")}}class Amd extends StringObject{constructor(e){super(Wo,"amd")}}class config_Area extends XFAObject{constructor(e){super(Wo,"area"),this.level=getInteger({data:e.level,defaultValue:0,validate:e=>e>=1&&e<=3}),this.name=getStringOption(e.name,["","barcode","coreinit","deviceDriver","font","general","layout","merge","script","signature","sourceSet","templateCache"])}}class Attributes extends OptionObject{constructor(e){super(Wo,"attributes",["preserve","delegate","ignore"])}}class AutoSave extends OptionObject{constructor(e){super(Wo,"autoSave",["disabled","enabled"])}}class Base extends StringObject{constructor(e){super(Wo,"base")}}class BatchOutput extends XFAObject{constructor(e){super(Wo,"batchOutput"),this.format=getStringOption(e.format,["none","concat","zip","zipCompress"])}}class BehaviorOverride extends ContentObject{constructor(e){super(Wo,"behaviorOverride")}[tr](){this[Js]=new Map(this[Js].trim().split(/\s+/).filter(e=>e.includes(":")).map(e=>e.split(":",2)))}}class Cache extends XFAObject{constructor(e){super(Wo,"cache",!0),this.templateCache=null}}class Change extends Option01{constructor(e){super(Wo,"change")}}class Common extends XFAObject{constructor(e){super(Wo,"common",!0),this.data=null,this.locale=null,this.localeSet=null,this.messaging=null,this.suppressBanner=null,this.template=null,this.validationMessaging=null,this.versionControl=null,this.log=new XFAObjectArray}}class Compress extends XFAObject{constructor(e){super(Wo,"compress"),this.scope=getStringOption(e.scope,["imageOnly","document"])}}class CompressLogicalStructure extends Option01{constructor(e){super(Wo,"compressLogicalStructure")}}class CompressObjectStream extends Option10{constructor(e){super(Wo,"compressObjectStream")}}class Compression extends XFAObject{constructor(e){super(Wo,"compression",!0),this.compressLogicalStructure=null,this.compressObjectStream=null,this.level=null,this.type=null}}class Config extends XFAObject{constructor(e){super(Wo,"config",!0),this.acrobat=null,this.present=null,this.trace=null,this.agent=new XFAObjectArray}}class Conformance extends OptionObject{constructor(e){super(Wo,"conformance",["A","B"])}}class ContentCopy extends Option01{constructor(e){super(Wo,"contentCopy")}}class Copies extends IntegerObject{constructor(e){super(Wo,"copies",1,e=>e>=1)}}class Creator extends StringObject{constructor(e){super(Wo,"creator")}}class CurrentPage extends IntegerObject{constructor(e){super(Wo,"currentPage",0,e=>e>=0)}}class Data extends XFAObject{constructor(e){super(Wo,"data",!0),this.adjustData=null,this.attributes=null,this.incrementalLoad=null,this.outputXSL=null,this.range=null,this.record=null,this.startNode=null,this.uri=null,this.window=null,this.xsl=null,this.excludeNS=new XFAObjectArray,this.transform=new XFAObjectArray}}class Debug extends XFAObject{constructor(e){super(Wo,"debug",!0),this.uri=null}}class DefaultTypeface extends ContentObject{constructor(e){super(Wo,"defaultTypeface"),this.writingScript=getStringOption(e.writingScript,["*","Arabic","Cyrillic","EastEuropeanRoman","Greek","Hebrew","Japanese","Korean","Roman","SimplifiedChinese","Thai","TraditionalChinese","Vietnamese"])}}class Destination extends OptionObject{constructor(e){super(Wo,"destination",["pdf","pcl","ps","webClient","zpl"])}}class DocumentAssembly extends Option01{constructor(e){super(Wo,"documentAssembly")}}class Driver extends XFAObject{constructor(e){super(Wo,"driver",!0),this.name=e.name?e.name.trim():"",this.fontInfo=null,this.xdc=null}}class DuplexOption extends OptionObject{constructor(e){super(Wo,"duplexOption",["simplex","duplexFlipLongEdge","duplexFlipShortEdge"])}}class DynamicRender extends OptionObject{constructor(e){super(Wo,"dynamicRender",["forbidden","required"])}}class Embed extends Option01{constructor(e){super(Wo,"embed")}}class config_Encrypt extends Option01{constructor(e){super(Wo,"encrypt")}}class config_Encryption extends XFAObject{constructor(e){super(Wo,"encryption",!0),this.encrypt=null,this.encryptionLevel=null,this.permissions=null}}class EncryptionLevel extends OptionObject{constructor(e){super(Wo,"encryptionLevel",["40bit","128bit"])}}class Enforce extends StringObject{constructor(e){super(Wo,"enforce")}}class Equate extends XFAObject{constructor(e){super(Wo,"equate"),this.force=getInteger({data:e.force,defaultValue:1,validate:e=>0===e}),this.from=e.from||"",this.to=e.to||""}}class EquateRange extends XFAObject{constructor(e){super(Wo,"equateRange"),this.from=e.from||"",this.to=e.to||"",this._unicodeRange=e.unicodeRange||""}get unicodeRange(){const e=[],t=/U\+([0-9a-fA-F]+)/,i=this._unicodeRange;for(let n of i.split(",").map(e=>e.trim()).filter(e=>!!e))n=n.split("-",2).map(e=>{const i=e.match(t);return i?parseInt(i[1],16):0}),1===n.length&&n.push(n[0]),e.push(n);return shadow$1(this,"unicodeRange",e)}}class Exclude extends ContentObject{constructor(e){super(Wo,"exclude")}[tr](){this[Js]=this[Js].trim().split(/\s+/).filter(e=>e&&["calculate","close","enter","exit","initialize","ready","validate"].includes(e))}}class ExcludeNS extends StringObject{constructor(e){super(Wo,"excludeNS")}}class FlipLabel extends OptionObject{constructor(e){super(Wo,"flipLabel",["usePrinterSetting","on","off"])}}class config_FontInfo extends XFAObject{constructor(e){super(Wo,"fontInfo",!0),this.embed=null,this.map=null,this.subsetBelow=null,this.alwaysEmbed=new XFAObjectArray,this.defaultTypeface=new XFAObjectArray,this.neverEmbed=new XFAObjectArray}}class FormFieldFilling extends Option01{constructor(e){super(Wo,"formFieldFilling")}}class GroupParent extends StringObject{constructor(e){super(Wo,"groupParent")}}class IfEmpty extends OptionObject{constructor(e){super(Wo,"ifEmpty",["dataValue","dataGroup","ignore","remove"])}}class IncludeXDPContent extends StringObject{constructor(e){super(Wo,"includeXDPContent")}}class IncrementalLoad extends OptionObject{constructor(e){super(Wo,"incrementalLoad",["none","forwardOnly"])}}class IncrementalMerge extends Option01{constructor(e){super(Wo,"incrementalMerge")}}class Interactive extends Option01{constructor(e){super(Wo,"interactive")}}class Jog extends OptionObject{constructor(e){super(Wo,"jog",["usePrinterSetting","none","pageSet"])}}class LabelPrinter extends XFAObject{constructor(e){super(Wo,"labelPrinter",!0),this.name=getStringOption(e.name,["zpl","dpl","ipl","tcpl"]),this.batchOutput=null,this.flipLabel=null,this.fontInfo=null,this.xdc=null}}class Layout extends OptionObject{constructor(e){super(Wo,"layout",["paginate","panel"])}}class Level extends IntegerObject{constructor(e){super(Wo,"level",0,e=>e>0)}}class Linearized extends Option01{constructor(e){super(Wo,"linearized")}}class Locale extends StringObject{constructor(e){super(Wo,"locale")}}class LocaleSet extends StringObject{constructor(e){super(Wo,"localeSet")}}class Log extends XFAObject{constructor(e){super(Wo,"log",!0),this.mode=null,this.threshold=null,this.to=null,this.uri=null}}class MapElement extends XFAObject{constructor(e){super(Wo,"map",!0),this.equate=new XFAObjectArray,this.equateRange=new XFAObjectArray}}class MediumInfo extends XFAObject{constructor(e){super(Wo,"mediumInfo",!0),this.map=null}}class config_Message extends XFAObject{constructor(e){super(Wo,"message",!0),this.msgId=null,this.severity=null}}class Messaging extends XFAObject{constructor(e){super(Wo,"messaging",!0),this.message=new XFAObjectArray}}class Mode extends OptionObject{constructor(e){super(Wo,"mode",["append","overwrite"])}}class ModifyAnnots extends Option01{constructor(e){super(Wo,"modifyAnnots")}}class MsgId extends IntegerObject{constructor(e){super(Wo,"msgId",1,e=>e>=1)}}class NameAttr extends StringObject{constructor(e){super(Wo,"nameAttr")}}class NeverEmbed extends ContentObject{constructor(e){super(Wo,"neverEmbed")}}class NumberOfCopies extends IntegerObject{constructor(e){super(Wo,"numberOfCopies",null,e=>e>=2&&e<=5)}}class OpenAction extends XFAObject{constructor(e){super(Wo,"openAction",!0),this.destination=null}}class Output extends XFAObject{constructor(e){super(Wo,"output",!0),this.to=null,this.type=null,this.uri=null}}class OutputBin extends StringObject{constructor(e){super(Wo,"outputBin")}}class OutputXSL extends XFAObject{constructor(e){super(Wo,"outputXSL",!0),this.uri=null}}class Overprint extends OptionObject{constructor(e){super(Wo,"overprint",["none","both","draw","field"])}}class Packets extends StringObject{constructor(e){super(Wo,"packets")}[tr](){"*"!==this[Js]&&(this[Js]=this[Js].trim().split(/\s+/).filter(e=>["config","datasets","template","xfdf","xslt"].includes(e)))}}class PageOffset extends XFAObject{constructor(e){super(Wo,"pageOffset"),this.x=getInteger({data:e.x,defaultValue:"useXDCSetting",validate:e=>!0}),this.y=getInteger({data:e.y,defaultValue:"useXDCSetting",validate:e=>!0})}}class PageRange extends StringObject{constructor(e){super(Wo,"pageRange")}[tr](){const e=this[Js].trim().split(/\s+/).map(e=>parseInt(e,10)),t=[];for(let i=0,n=e.length;i<n;i+=2)t.push(e.slice(i,i+2));this[Js]=t}}class Pagination extends OptionObject{constructor(e){super(Wo,"pagination",["simplex","duplexShortEdge","duplexLongEdge"])}}class PaginationOverride extends OptionObject{constructor(e){super(Wo,"paginationOverride",["none","forceDuplex","forceDuplexLongEdge","forceDuplexShortEdge","forceSimplex"])}}class Part extends IntegerObject{constructor(e){super(Wo,"part",1,e=>!1)}}class Pcl extends XFAObject{constructor(e){super(Wo,"pcl",!0),this.name=e.name||"",this.batchOutput=null,this.fontInfo=null,this.jog=null,this.mediumInfo=null,this.outputBin=null,this.pageOffset=null,this.staple=null,this.xdc=null}}class Pdf extends XFAObject{constructor(e){super(Wo,"pdf",!0),this.name=e.name||"",this.adobeExtensionLevel=null,this.batchOutput=null,this.compression=null,this.creator=null,this.encryption=null,this.fontInfo=null,this.interactive=null,this.linearized=null,this.openAction=null,this.pdfa=null,this.producer=null,this.renderPolicy=null,this.scriptModel=null,this.silentPrint=null,this.submitFormat=null,this.tagged=null,this.version=null,this.viewerPreferences=null,this.xdc=null}}class Pdfa extends XFAObject{constructor(e){super(Wo,"pdfa",!0),this.amd=null,this.conformance=null,this.includeXDPContent=null,this.part=null}}class Permissions extends XFAObject{constructor(e){super(Wo,"permissions",!0),this.accessibleContent=null,this.change=null,this.contentCopy=null,this.documentAssembly=null,this.formFieldFilling=null,this.modifyAnnots=null,this.plaintextMetadata=null,this.print=null,this.printHighQuality=null}}class PickTrayByPDFSize extends Option01{constructor(e){super(Wo,"pickTrayByPDFSize")}}class config_Picture extends StringObject{constructor(e){super(Wo,"picture")}}class PlaintextMetadata extends Option01{constructor(e){super(Wo,"plaintextMetadata")}}class Presence extends OptionObject{constructor(e){super(Wo,"presence",["preserve","dissolve","dissolveStructure","ignore","remove"])}}class Present extends XFAObject{constructor(e){super(Wo,"present",!0),this.behaviorOverride=null,this.cache=null,this.common=null,this.copies=null,this.destination=null,this.incrementalMerge=null,this.layout=null,this.output=null,this.overprint=null,this.pagination=null,this.paginationOverride=null,this.script=null,this.validate=null,this.xdp=null,this.driver=new XFAObjectArray,this.labelPrinter=new XFAObjectArray,this.pcl=new XFAObjectArray,this.pdf=new XFAObjectArray,this.ps=new XFAObjectArray,this.submitUrl=new XFAObjectArray,this.webClient=new XFAObjectArray,this.zpl=new XFAObjectArray}}class Print extends Option01{constructor(e){super(Wo,"print")}}class PrintHighQuality extends Option01{constructor(e){super(Wo,"printHighQuality")}}class PrintScaling extends OptionObject{constructor(e){super(Wo,"printScaling",["appdefault","noScaling"])}}class PrinterName extends StringObject{constructor(e){super(Wo,"printerName")}}class Producer extends StringObject{constructor(e){super(Wo,"producer")}}class Ps extends XFAObject{constructor(e){super(Wo,"ps",!0),this.name=e.name||"",this.batchOutput=null,this.fontInfo=null,this.jog=null,this.mediumInfo=null,this.outputBin=null,this.staple=null,this.xdc=null}}let Go=class extends ContentObject{constructor(e){super(Wo,"range")}[tr](){this[Js]=this[Js].split(",",2).map(e=>e.split("-").map(e=>parseInt(e.trim(),10))).filter(e=>e.every(e=>!isNaN(e))).map(e=>(1===e.length&&e.push(e[0]),e))}};class Record extends ContentObject{constructor(e){super(Wo,"record")}[tr](){this[Js]=this[Js].trim();const e=parseInt(this[Js],10);!isNaN(e)&&e>=0&&(this[Js]=e)}}class Relevant extends ContentObject{constructor(e){super(Wo,"relevant")}[tr](){this[Js]=this[Js].trim().split(/\s+/)}}class Rename extends ContentObject{constructor(e){super(Wo,"rename")}[tr](){this[Js]=this[Js].trim(),(this[Js].toLowerCase().startsWith("xml")||new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*","u").test(this[Js]))&&warn$1("XFA - Rename: invalid XFA name")}}class RenderPolicy extends OptionObject{constructor(e){super(Wo,"renderPolicy",["server","client"])}}class RunScripts extends OptionObject{constructor(e){super(Wo,"runScripts",["both","client","none","server"])}}class config_Script extends XFAObject{constructor(e){super(Wo,"script",!0),this.currentPage=null,this.exclude=null,this.runScripts=null}}class ScriptModel extends OptionObject{constructor(e){super(Wo,"scriptModel",["XFA","none"])}}class Severity extends OptionObject{constructor(e){super(Wo,"severity",["ignore","error","information","trace","warning"])}}class SilentPrint extends XFAObject{constructor(e){super(Wo,"silentPrint",!0),this.addSilentPrint=null,this.printerName=null}}class Staple extends XFAObject{constructor(e){super(Wo,"staple"),this.mode=getStringOption(e.mode,["usePrinterSetting","on","off"])}}class StartNode extends StringObject{constructor(e){super(Wo,"startNode")}}class StartPage extends IntegerObject{constructor(e){super(Wo,"startPage",0,e=>!0)}}class SubmitFormat extends OptionObject{constructor(e){super(Wo,"submitFormat",["html","delegate","fdf","xml","pdf"])}}class SubmitUrl extends StringObject{constructor(e){super(Wo,"submitUrl")}}class SubsetBelow extends IntegerObject{constructor(e){super(Wo,"subsetBelow",100,e=>e>=0&&e<=100)}}class SuppressBanner extends Option01{constructor(e){super(Wo,"suppressBanner")}}class Tagged extends Option01{constructor(e){super(Wo,"tagged")}}class config_Template extends XFAObject{constructor(e){super(Wo,"template",!0),this.base=null,this.relevant=null,this.startPage=null,this.uri=null,this.xsl=null}}class Threshold extends OptionObject{constructor(e){super(Wo,"threshold",["trace","error","information","warning"])}}class To extends OptionObject{constructor(e){super(Wo,"to",["null","memory","stderr","stdout","system","uri"])}}class TemplateCache extends XFAObject{constructor(e){super(Wo,"templateCache"),this.maxEntries=getInteger({data:e.maxEntries,defaultValue:5,validate:e=>e>=0})}}class Trace extends XFAObject{constructor(e){super(Wo,"trace",!0),this.area=new XFAObjectArray}}class Transform extends XFAObject{constructor(e){super(Wo,"transform",!0),this.groupParent=null,this.ifEmpty=null,this.nameAttr=null,this.picture=null,this.presence=null,this.rename=null,this.whitespace=null}}class Type extends OptionObject{constructor(e){super(Wo,"type",["none","ascii85","asciiHex","ccittfax","flate","lzw","runLength","native","xdp","mergedXDP"])}}class Uri extends StringObject{constructor(e){super(Wo,"uri")}}class config_Validate extends OptionObject{constructor(e){super(Wo,"validate",["preSubmit","prePrint","preExecute","preSave"])}}class ValidateApprovalSignatures extends ContentObject{constructor(e){super(Wo,"validateApprovalSignatures")}[tr](){this[Js]=this[Js].trim().split(/\s+/).filter(e=>["docReady","postSign"].includes(e))}}class ValidationMessaging extends OptionObject{constructor(e){super(Wo,"validationMessaging",["allMessagesIndividually","allMessagesTogether","firstMessageOnly","noMessages"])}}class Version extends OptionObject{constructor(e){super(Wo,"version",["1.7","1.6","1.5","1.4","1.3","1.2"])}}class VersionControl extends XFAObject{constructor(e){super(Wo,"VersionControl"),this.outputBelow=getStringOption(e.outputBelow,["warn","error","update"]),this.sourceAbove=getStringOption(e.sourceAbove,["warn","error"]),this.sourceBelow=getStringOption(e.sourceBelow,["update","maintain"])}}class ViewerPreferences extends XFAObject{constructor(e){super(Wo,"viewerPreferences",!0),this.ADBE_JSConsole=null,this.ADBE_JSDebugger=null,this.addViewerPreferences=null,this.duplexOption=null,this.enforce=null,this.numberOfCopies=null,this.pageRange=null,this.pickTrayByPDFSize=null,this.printScaling=null}}class WebClient extends XFAObject{constructor(e){super(Wo,"webClient",!0),this.name=e.name?e.name.trim():"",this.fontInfo=null,this.xdc=null}}class Whitespace extends OptionObject{constructor(e){super(Wo,"whitespace",["preserve","ltrim","normalize","rtrim","trim"])}}class Window extends ContentObject{constructor(e){super(Wo,"window")}[tr](){const e=this[Js].split(",",2).map(e=>parseInt(e.trim(),10));e.some(e=>isNaN(e))?this[Js]=[0,0]:(1===e.length&&e.push(e[0]),this[Js]=e)}}class Xdc extends XFAObject{constructor(e){super(Wo,"xdc",!0),this.uri=new XFAObjectArray,this.xsl=new XFAObjectArray}}class Xdp extends XFAObject{constructor(e){super(Wo,"xdp",!0),this.packets=null}}class Xsl extends XFAObject{constructor(e){super(Wo,"xsl",!0),this.debug=null,this.uri=null}}class Zpl extends XFAObject{constructor(e){super(Wo,"zpl",!0),this.name=e.name?e.name.trim():"",this.batchOutput=null,this.flipLabel=null,this.fontInfo=null,this.xdc=null}}class ConfigNamespace{static[no](e,t){if(ConfigNamespace.hasOwnProperty(e))return ConfigNamespace[e](t)}static acrobat(e){return new Acrobat(e)}static acrobat7(e){return new Acrobat7(e)}static ADBE_JSConsole(e){return new ADBE_JSConsole(e)}static ADBE_JSDebugger(e){return new ADBE_JSDebugger(e)}static addSilentPrint(e){return new AddSilentPrint(e)}static addViewerPreferences(e){return new AddViewerPreferences(e)}static adjustData(e){return new AdjustData(e)}static adobeExtensionLevel(e){return new AdobeExtensionLevel(e)}static agent(e){return new Agent(e)}static alwaysEmbed(e){return new AlwaysEmbed(e)}static amd(e){return new Amd(e)}static area(e){return new config_Area(e)}static attributes(e){return new Attributes(e)}static autoSave(e){return new AutoSave(e)}static base(e){return new Base(e)}static batchOutput(e){return new BatchOutput(e)}static behaviorOverride(e){return new BehaviorOverride(e)}static cache(e){return new Cache(e)}static change(e){return new Change(e)}static common(e){return new Common(e)}static compress(e){return new Compress(e)}static compressLogicalStructure(e){return new CompressLogicalStructure(e)}static compressObjectStream(e){return new CompressObjectStream(e)}static compression(e){return new Compression(e)}static config(e){return new Config(e)}static conformance(e){return new Conformance(e)}static contentCopy(e){return new ContentCopy(e)}static copies(e){return new Copies(e)}static creator(e){return new Creator(e)}static currentPage(e){return new CurrentPage(e)}static data(e){return new Data(e)}static debug(e){return new Debug(e)}static defaultTypeface(e){return new DefaultTypeface(e)}static destination(e){return new Destination(e)}static documentAssembly(e){return new DocumentAssembly(e)}static driver(e){return new Driver(e)}static duplexOption(e){return new DuplexOption(e)}static dynamicRender(e){return new DynamicRender(e)}static embed(e){return new Embed(e)}static encrypt(e){return new config_Encrypt(e)}static encryption(e){return new config_Encryption(e)}static encryptionLevel(e){return new EncryptionLevel(e)}static enforce(e){return new Enforce(e)}static equate(e){return new Equate(e)}static equateRange(e){return new EquateRange(e)}static exclude(e){return new Exclude(e)}static excludeNS(e){return new ExcludeNS(e)}static flipLabel(e){return new FlipLabel(e)}static fontInfo(e){return new config_FontInfo(e)}static formFieldFilling(e){return new FormFieldFilling(e)}static groupParent(e){return new GroupParent(e)}static ifEmpty(e){return new IfEmpty(e)}static includeXDPContent(e){return new IncludeXDPContent(e)}static incrementalLoad(e){return new IncrementalLoad(e)}static incrementalMerge(e){return new IncrementalMerge(e)}static interactive(e){return new Interactive(e)}static jog(e){return new Jog(e)}static labelPrinter(e){return new LabelPrinter(e)}static layout(e){return new Layout(e)}static level(e){return new Level(e)}static linearized(e){return new Linearized(e)}static locale(e){return new Locale(e)}static localeSet(e){return new LocaleSet(e)}static log(e){return new Log(e)}static map(e){return new MapElement(e)}static mediumInfo(e){return new MediumInfo(e)}static message(e){return new config_Message(e)}static messaging(e){return new Messaging(e)}static mode(e){return new Mode(e)}static modifyAnnots(e){return new ModifyAnnots(e)}static msgId(e){return new MsgId(e)}static nameAttr(e){return new NameAttr(e)}static neverEmbed(e){return new NeverEmbed(e)}static numberOfCopies(e){return new NumberOfCopies(e)}static openAction(e){return new OpenAction(e)}static output(e){return new Output(e)}static outputBin(e){return new OutputBin(e)}static outputXSL(e){return new OutputXSL(e)}static overprint(e){return new Overprint(e)}static packets(e){return new Packets(e)}static pageOffset(e){return new PageOffset(e)}static pageRange(e){return new PageRange(e)}static pagination(e){return new Pagination(e)}static paginationOverride(e){return new PaginationOverride(e)}static part(e){return new Part(e)}static pcl(e){return new Pcl(e)}static pdf(e){return new Pdf(e)}static pdfa(e){return new Pdfa(e)}static permissions(e){return new Permissions(e)}static pickTrayByPDFSize(e){return new PickTrayByPDFSize(e)}static picture(e){return new config_Picture(e)}static plaintextMetadata(e){return new PlaintextMetadata(e)}static presence(e){return new Presence(e)}static present(e){return new Present(e)}static print(e){return new Print(e)}static printHighQuality(e){return new PrintHighQuality(e)}static printScaling(e){return new PrintScaling(e)}static printerName(e){return new PrinterName(e)}static producer(e){return new Producer(e)}static ps(e){return new Ps(e)}static range(e){return new Go(e)}static record(e){return new Record(e)}static relevant(e){return new Relevant(e)}static rename(e){return new Rename(e)}static renderPolicy(e){return new RenderPolicy(e)}static runScripts(e){return new RunScripts(e)}static script(e){return new config_Script(e)}static scriptModel(e){return new ScriptModel(e)}static severity(e){return new Severity(e)}static silentPrint(e){return new SilentPrint(e)}static staple(e){return new Staple(e)}static startNode(e){return new StartNode(e)}static startPage(e){return new StartPage(e)}static submitFormat(e){return new SubmitFormat(e)}static submitUrl(e){return new SubmitUrl(e)}static subsetBelow(e){return new SubsetBelow(e)}static suppressBanner(e){return new SuppressBanner(e)}static tagged(e){return new Tagged(e)}static template(e){return new config_Template(e)}static templateCache(e){return new TemplateCache(e)}static threshold(e){return new Threshold(e)}static to(e){return new To(e)}static trace(e){return new Trace(e)}static transform(e){return new Transform(e)}static type(e){return new Type(e)}static uri(e){return new Uri(e)}static validate(e){return new config_Validate(e)}static validateApprovalSignatures(e){return new ValidateApprovalSignatures(e)}static validationMessaging(e){return new ValidationMessaging(e)}static version(e){return new Version(e)}static versionControl(e){return new VersionControl(e)}static viewerPreferences(e){return new ViewerPreferences(e)}static webClient(e){return new WebClient(e)}static whitespace(e){return new Whitespace(e)}static window(e){return new Window(e)}static xdc(e){return new Xdc(e)}static xdp(e){return new Xdp(e)}static xsl(e){return new Xsl(e)}static zpl(e){return new Zpl(e)}}const Vo=ao.connectionSet.id;class ConnectionSet extends XFAObject{constructor(e){super(Vo,"connectionSet",!0),this.wsdlConnection=new XFAObjectArray,this.xmlConnection=new XFAObjectArray,this.xsdConnection=new XFAObjectArray}}class EffectiveInputPolicy extends XFAObject{constructor(e){super(Vo,"effectiveInputPolicy"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}}class EffectiveOutputPolicy extends XFAObject{constructor(e){super(Vo,"effectiveOutputPolicy"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}}class Operation extends StringObject{constructor(e){super(Vo,"operation"),this.id=e.id||"",this.input=e.input||"",this.name=e.name||"",this.output=e.output||"",this.use=e.use||"",this.usehref=e.usehref||""}}class RootElement extends StringObject{constructor(e){super(Vo,"rootElement"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}}class SoapAction extends StringObject{constructor(e){super(Vo,"soapAction"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}}class SoapAddress extends StringObject{constructor(e){super(Vo,"soapAddress"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}}class connection_set_Uri extends StringObject{constructor(e){super(Vo,"uri"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}}class WsdlAddress extends StringObject{constructor(e){super(Vo,"wsdlAddress"),this.id=e.id||"",this.name=e.name||"",this.use=e.use||"",this.usehref=e.usehref||""}}class WsdlConnection extends XFAObject{constructor(e){super(Vo,"wsdlConnection",!0),this.dataDescription=e.dataDescription||"",this.name=e.name||"",this.effectiveInputPolicy=null,this.effectiveOutputPolicy=null,this.operation=null,this.soapAction=null,this.soapAddress=null,this.wsdlAddress=null}}class XmlConnection extends XFAObject{constructor(e){super(Vo,"xmlConnection",!0),this.dataDescription=e.dataDescription||"",this.name=e.name||"",this.uri=null}}class XsdConnection extends XFAObject{constructor(e){super(Vo,"xsdConnection",!0),this.dataDescription=e.dataDescription||"",this.name=e.name||"",this.rootElement=null,this.uri=null}}class ConnectionSetNamespace{static[no](e,t){if(ConnectionSetNamespace.hasOwnProperty(e))return ConnectionSetNamespace[e](t)}static connectionSet(e){return new ConnectionSet(e)}static effectiveInputPolicy(e){return new EffectiveInputPolicy(e)}static effectiveOutputPolicy(e){return new EffectiveOutputPolicy(e)}static operation(e){return new Operation(e)}static rootElement(e){return new RootElement(e)}static soapAction(e){return new SoapAction(e)}static soapAddress(e){return new SoapAddress(e)}static uri(e){return new connection_set_Uri(e)}static wsdlAddress(e){return new WsdlAddress(e)}static wsdlConnection(e){return new WsdlConnection(e)}static xmlConnection(e){return new XmlConnection(e)}static xsdConnection(e){return new XsdConnection(e)}}const Ko=ao.datasets.id;class datasets_Data extends XmlObject{constructor(e){super(Ko,"data",e)}[Fr](){return!0}}class Datasets extends XFAObject{constructor(e){super(Ko,"datasets",!0),this.data=null,this.Signature=null}[Nr](e){const t=e[Pr];("data"===t&&e[_r]===Ko||"Signature"===t&&e[_r]===ao.signature.id)&&(this[t]=e),this[qs](e)}}class DatasetsNamespace{static[no](e,t){if(DatasetsNamespace.hasOwnProperty(e))return DatasetsNamespace[e](t)}static datasets(e){return new Datasets(e)}static data(e){return new datasets_Data(e)}}const Yo=ao.localeSet.id;class CalendarSymbols extends XFAObject{constructor(e){super(Yo,"calendarSymbols",!0),this.name="gregorian",this.dayNames=new XFAObjectArray(2),this.eraNames=null,this.meridiemNames=null,this.monthNames=new XFAObjectArray(2)}}class CurrencySymbol extends StringObject{constructor(e){super(Yo,"currencySymbol"),this.name=getStringOption(e.name,["symbol","isoname","decimal"])}}class CurrencySymbols extends XFAObject{constructor(e){super(Yo,"currencySymbols",!0),this.currencySymbol=new XFAObjectArray(3)}}class DatePattern extends StringObject{constructor(e){super(Yo,"datePattern"),this.name=getStringOption(e.name,["full","long","med","short"])}}class DatePatterns extends XFAObject{constructor(e){super(Yo,"datePatterns",!0),this.datePattern=new XFAObjectArray(4)}}class DateTimeSymbols extends ContentObject{constructor(e){super(Yo,"dateTimeSymbols")}}class Day extends StringObject{constructor(e){super(Yo,"day")}}class DayNames extends XFAObject{constructor(e){super(Yo,"dayNames",!0),this.abbr=getInteger({data:e.abbr,defaultValue:0,validate:e=>1===e}),this.day=new XFAObjectArray(7)}}class Era extends StringObject{constructor(e){super(Yo,"era")}}class EraNames extends XFAObject{constructor(e){super(Yo,"eraNames",!0),this.era=new XFAObjectArray(2)}}class locale_set_Locale extends XFAObject{constructor(e){super(Yo,"locale",!0),this.desc=e.desc||"",this.name="isoname",this.calendarSymbols=null,this.currencySymbols=null,this.datePatterns=null,this.dateTimeSymbols=null,this.numberPatterns=null,this.numberSymbols=null,this.timePatterns=null,this.typeFaces=null}}class locale_set_LocaleSet extends XFAObject{constructor(e){super(Yo,"localeSet",!0),this.locale=new XFAObjectArray}}class Meridiem extends StringObject{constructor(e){super(Yo,"meridiem")}}class MeridiemNames extends XFAObject{constructor(e){super(Yo,"meridiemNames",!0),this.meridiem=new XFAObjectArray(2)}}class Month extends StringObject{constructor(e){super(Yo,"month")}}class MonthNames extends XFAObject{constructor(e){super(Yo,"monthNames",!0),this.abbr=getInteger({data:e.abbr,defaultValue:0,validate:e=>1===e}),this.month=new XFAObjectArray(12)}}class NumberPattern extends StringObject{constructor(e){super(Yo,"numberPattern"),this.name=getStringOption(e.name,["full","long","med","short"])}}class NumberPatterns extends XFAObject{constructor(e){super(Yo,"numberPatterns",!0),this.numberPattern=new XFAObjectArray(4)}}class NumberSymbol extends StringObject{constructor(e){super(Yo,"numberSymbol"),this.name=getStringOption(e.name,["decimal","grouping","percent","minus","zero"])}}class NumberSymbols extends XFAObject{constructor(e){super(Yo,"numberSymbols",!0),this.numberSymbol=new XFAObjectArray(5)}}class TimePattern extends StringObject{constructor(e){super(Yo,"timePattern"),this.name=getStringOption(e.name,["full","long","med","short"])}}class TimePatterns extends XFAObject{constructor(e){super(Yo,"timePatterns",!0),this.timePattern=new XFAObjectArray(4)}}class TypeFace extends XFAObject{constructor(e){super(Yo,"typeFace",!0),this.name=""|e.name}}class TypeFaces extends XFAObject{constructor(e){super(Yo,"typeFaces",!0),this.typeFace=new XFAObjectArray}}class LocaleSetNamespace{static[no](e,t){if(LocaleSetNamespace.hasOwnProperty(e))return LocaleSetNamespace[e](t)}static calendarSymbols(e){return new CalendarSymbols(e)}static currencySymbol(e){return new CurrencySymbol(e)}static currencySymbols(e){return new CurrencySymbols(e)}static datePattern(e){return new DatePattern(e)}static datePatterns(e){return new DatePatterns(e)}static dateTimeSymbols(e){return new DateTimeSymbols(e)}static day(e){return new Day(e)}static dayNames(e){return new DayNames(e)}static era(e){return new Era(e)}static eraNames(e){return new EraNames(e)}static locale(e){return new locale_set_Locale(e)}static localeSet(e){return new locale_set_LocaleSet(e)}static meridiem(e){return new Meridiem(e)}static meridiemNames(e){return new MeridiemNames(e)}static month(e){return new Month(e)}static monthNames(e){return new MonthNames(e)}static numberPattern(e){return new NumberPattern(e)}static numberPatterns(e){return new NumberPatterns(e)}static numberSymbol(e){return new NumberSymbol(e)}static numberSymbols(e){return new NumberSymbols(e)}static timePattern(e){return new TimePattern(e)}static timePatterns(e){return new TimePatterns(e)}static typeFace(e){return new TypeFace(e)}static typeFaces(e){return new TypeFaces(e)}}const Jo=ao.signature.id;class signature_Signature extends XFAObject{constructor(e){super(Jo,"signature",!0)}}class SignatureNamespace{static[no](e,t){if(SignatureNamespace.hasOwnProperty(e))return SignatureNamespace[e](t)}static signature(e){return new signature_Signature(e)}}const Zo=ao.stylesheet.id;class Stylesheet extends XFAObject{constructor(e){super(Zo,"stylesheet",!0)}}class StylesheetNamespace{static[no](e,t){if(StylesheetNamespace.hasOwnProperty(e))return StylesheetNamespace[e](t)}static stylesheet(e){return new Stylesheet(e)}}const Qo=ao.xdp.id;class xdp_Xdp extends XFAObject{constructor(e){super(Qo,"xdp",!0),this.uuid=e.uuid||"",this.timeStamp=e.timeStamp||"",this.config=null,this.connectionSet=null,this.datasets=null,this.localeSet=null,this.stylesheet=new XFAObjectArray,this.template=null}[Lr](e){const t=ao[e[Pr]];return t&&e[_r]===t.id}}class XdpNamespace{static[no](e,t){if(XdpNamespace.hasOwnProperty(e))return XdpNamespace[e](t)}static xdp(e){return new xdp_Xdp(e)}}const el=ao.xhtml.id,tl=Symbol(),il=new Set(["color","font","font-family","font-size","font-stretch","font-style","font-weight","margin","margin-bottom","margin-left","margin-right","margin-top","letter-spacing","line-height","orphans","page-break-after","page-break-before","page-break-inside","tab-interval","tab-stop","text-align","text-decoration","text-indent","vertical-align","widows","kerning-mode","xfa-font-horizontal-scale","xfa-font-vertical-scale","xfa-spacerun","xfa-tab-stops"]),nl=new Map([["page-break-after","breakAfter"],["page-break-before","breakBefore"],["page-break-inside","breakInside"],["kerning-mode",e=>"none"===e?"none":"normal"],["xfa-font-horizontal-scale",e=>`scaleX(${Math.max(0,parseInt(e)/100).toFixed(2)})`],["xfa-font-vertical-scale",e=>`scaleY(${Math.max(0,parseInt(e)/100).toFixed(2)})`],["xfa-spacerun",""],["xfa-tab-stops",""],["font-size",(e,t)=>measureToString(.99*(e=t.fontSize=Math.abs(getMeasurement(e))))],["letter-spacing",e=>measureToString(getMeasurement(e))],["line-height",e=>measureToString(getMeasurement(e))],["margin",e=>measureToString(getMeasurement(e))],["margin-bottom",e=>measureToString(getMeasurement(e))],["margin-left",e=>measureToString(getMeasurement(e))],["margin-right",e=>measureToString(getMeasurement(e))],["margin-top",e=>measureToString(getMeasurement(e))],["text-indent",e=>measureToString(getMeasurement(e))],["font-family",e=>e],["vertical-align",e=>measureToString(getMeasurement(e))]]),al=/\s+/g,sl=/[\r\n]+/g,rl=/\r\n?/g;function mapStyle(e,t,i){const n=Object.create(null);if(!e)return n;const a=Object.create(null);for(const[t,i]of e.split(";").map(e=>e.split(":",2))){const e=nl.get(t);if(""===e)continue;let s=i;e&&(s="string"==typeof e?e:e(i,a)),t.endsWith("scale")?n.transform=n.transform?`${n[t]} ${s}`:s:n[t.replaceAll(/-([a-zA-Z])/g,(e,t)=>t.toUpperCase())]=s}if(n.fontFamily&&setFontFamily({typeface:n.fontFamily,weight:n.fontWeight||"normal",posture:n.fontStyle||"normal",size:a.fontSize||0},t,t[yr].fontFinder,n),i&&n.verticalAlign&&"0px"!==n.verticalAlign&&n.fontSize){const e=.583,t=.333,i=getMeasurement(n.fontSize);n.fontSize=measureToString(i*e),n.verticalAlign=measureToString(Math.sign(getMeasurement(n.verticalAlign))*i*t)}return i&&n.fontSize&&(n.fontSize=`calc(${n.fontSize} * var(--total-scale-factor))`),fixTextIndent(n),n}const ol=new Set(["body","html"]);class XhtmlObject extends XmlObject{constructor(e,t){super(el,t),this[tl]=!1,this.style=e.style||""}[Ws](e){var t;super[Ws](e),this.style=(t=this).style?t.style.split(";").filter(e=>!!e.trim()).map(e=>e.split(":",2).map(e=>e.trim())).filter(([e,i])=>("font-family"===e&&t[yr].usedTypefaces.add(i),il.has(e))).map(e=>e.join(":")).join(";"):""}[Hs](){return!ol.has(this[Pr])}[Ur](e,t=!1){t?this[tl]=!0:(e=e.replaceAll(sl,""),this.style.includes("xfa-spacerun:yes")||(e=e.replaceAll(al," "))),e&&(this[Js]+=e)}[jr](e,t=!0){const i=Object.create(null),n={top:NaN,bottom:NaN,left:NaN,right:NaN};let a=null;for(const[e,t]of this.style.split(";").map(e=>e.split(":",2)))switch(e){case"font-family":i.typeface=stripQuotes(t);break;case"font-size":i.size=getMeasurement(t);break;case"font-weight":i.weight=t;break;case"font-style":i.posture=t;break;case"letter-spacing":i.letterSpacing=getMeasurement(t);break;case"margin":const e=t.split(/ \t/).map(e=>getMeasurement(e));switch(e.length){case 1:n.top=n.bottom=n.left=n.right=e[0];break;case 2:n.top=n.bottom=e[0],n.left=n.right=e[1];break;case 3:n.top=e[0],n.bottom=e[2],n.left=n.right=e[1];break;case 4:n.top=e[0],n.left=e[1],n.bottom=e[2],n.right=e[3]}break;case"margin-top":n.top=getMeasurement(t);break;case"margin-bottom":n.bottom=getMeasurement(t);break;case"margin-left":n.left=getMeasurement(t);break;case"margin-right":n.right=getMeasurement(t);break;case"line-height":a=getMeasurement(t)}if(e.pushData(i,n,a),this[Js])e.addString(this[Js]);else for(const t of this[ur]())"#text"!==t[Pr]?t[jr](e):e.addString(t[Js]);t&&e.popFont()}[Qr](e){const t=[];if(this[er]={children:t},this[zs]({}),0===t.length&&!this[Js])return HTMLResult.EMPTY;let i;return i=this[tl]?this[Js]?this[Js].replaceAll(rl,"\n"):void 0:this[Js]||void 0,HTMLResult.success({name:this[Pr],attributes:{href:this.href,style:mapStyle(this.style,this,this[tl])},children:t,value:i})}}class A extends XhtmlObject{constructor(e){super(e,"a"),this.href=fixURL(e.href)||""}}class B extends XhtmlObject{constructor(e){super(e,"b")}[jr](e){e.pushFont({weight:"bold"}),super[jr](e),e.popFont()}}class Body extends XhtmlObject{constructor(e){super(e,"body")}[Qr](e){const t=super[Qr](e),{html:i}=t;return i?(i.name="div",i.attributes.class=["xfaRich"],t):HTMLResult.EMPTY}}class Br extends XhtmlObject{constructor(e){super(e,"br")}[Jr](){return"\n"}[jr](e){e.addString("\n")}[Qr](e){return HTMLResult.success({name:"br"})}}class Html extends XhtmlObject{constructor(e){super(e,"html")}[Qr](e){const t=[];if(this[er]={children:t},this[zs]({}),0===t.length)return HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},value:this[Js]||""});if(1===t.length){const e=t[0];if(e.attributes?.class.includes("xfaRich"))return HTMLResult.success(e)}return HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},children:t})}}class I extends XhtmlObject{constructor(e){super(e,"i")}[jr](e){e.pushFont({posture:"italic"}),super[jr](e),e.popFont()}}class Li extends XhtmlObject{constructor(e){super(e,"li")}}class Ol extends XhtmlObject{constructor(e){super(e,"ol")}}class P extends XhtmlObject{constructor(e){super(e,"p")}[jr](e){super[jr](e,!1),e.addString("\n"),e.addPara(),e.popFont()}[Jr](){return this[mr]()[ur]().at(-1)===this?super[Jr]():super[Jr]()+"\n"}}class Span extends XhtmlObject{constructor(e){super(e,"span")}}class Sub extends XhtmlObject{constructor(e){super(e,"sub")}}class Sup extends XhtmlObject{constructor(e){super(e,"sup")}}class Ul extends XhtmlObject{constructor(e){super(e,"ul")}}class XhtmlNamespace{static[no](e,t){if(XhtmlNamespace.hasOwnProperty(e))return XhtmlNamespace[e](t)}static a(e){return new A(e)}static b(e){return new B(e)}static body(e){return new Body(e)}static br(e){return new Br(e)}static html(e){return new Html(e)}static i(e){return new I(e)}static li(e){return new Li(e)}static ol(e){return new Ol(e)}static p(e){return new P(e)}static span(e){return new Span(e)}static sub(e){return new Sub(e)}static sup(e){return new Sup(e)}static ul(e){return new Ul(e)}}const ll={config:ConfigNamespace,connection:ConnectionSetNamespace,datasets:DatasetsNamespace,localeSet:LocaleSetNamespace,signature:SignatureNamespace,stylesheet:StylesheetNamespace,template:TemplateNamespace,xdp:XdpNamespace,xhtml:XhtmlNamespace};class UnknownNamespace{constructor(e){this.namespaceId=e}[no](e,t){return new XmlObject(this.namespaceId,e,t)}}class Root extends XFAObject{constructor(e){super(-1,"root",Object.create(null)),this.element=null,this[Ar]=e}[Nr](e){return this.element=e,!0}[tr](){super[tr](),this.element.template instanceof Template&&(this[Ar].set(qr,this.element),this.element.template[zr](this[Ar]),this.element.template[Ar]=this[Ar])}}class Empty extends XFAObject{constructor(){super(-1,"",Object.create(null))}[Nr](e){return!1}}class Builder{constructor(e=null){this._namespaceStack=[],this._nsAgnosticLevel=0,this._namespacePrefixes=new Map,this._namespaces=new Map,this._nextNsId=Math.max(...Object.values(ao).map(({id:e})=>e)),this._currentNamespace=e||new UnknownNamespace(++this._nextNsId)}buildRoot(e){return new Root(e)}build({nsPrefix:e,name:t,attributes:i,namespace:n,prefixes:a}){const s=null!==n;if(s&&(this._namespaceStack.push(this._currentNamespace),this._currentNamespace=this._searchNamespace(n)),a&&this._addNamespacePrefix(a),i.hasOwnProperty(Rr)){const e=ll.datasets,t=i[Rr];let n=null;for(const[i,a]of Object.entries(t)){if(this._getNamespaceToUse(i)===e){n={xfa:a};break}}n?i[Rr]=n:delete i[Rr]}const r=this._getNamespaceToUse(e),o=r?.[no](t,i)||new Empty;return o[Fr]()&&this._nsAgnosticLevel++,(s||a||o[Fr]())&&(o[Vs]={hasNamespace:s,prefixes:a,nsAgnostic:o[Fr]()}),o}isNsAgnostic(){return this._nsAgnosticLevel>0}_searchNamespace(e){let t=this._namespaces.get(e);if(t)return t;for(const[i,{check:n}]of Object.entries(ao))if(n(e)){if(t=ll[i],t)return this._namespaces.set(e,t),t;break}return t=new UnknownNamespace(++this._nextNsId),this._namespaces.set(e,t),t}_addNamespacePrefix(e){for(const{prefix:t,value:i}of e){const e=this._searchNamespace(i);let n=this._namespacePrefixes.get(t);n||(n=[],this._namespacePrefixes.set(t,n)),n.push(e)}}_getNamespaceToUse(e){if(!e)return this._currentNamespace;const t=this._namespacePrefixes.get(e);return t?.length>0?t.at(-1):(warn$1(`Unknown namespace prefix: ${e}.`),null)}clean(e){const{hasNamespace:t,prefixes:i,nsAgnostic:n}=e;t&&(this._currentNamespace=this._namespaceStack.pop()),i&&i.forEach(({prefix:e})=>{this._namespacePrefixes.get(e).pop()}),n&&this._nsAgnosticLevel--}}class XFAParser extends XMLParserBase{constructor(e=null,t=!1){super(),this._builder=new Builder(e),this._stack=[],this._globalData={usedTypefaces:new Set},this._ids=new Map,this._current=this._builder.buildRoot(this._ids),this._errorCode=Is,this._whiteRegex=/^\s+$/,this._nbsps=/\xa0+/g,this._richText=t}parse(e){if(this.parseXml(e),this._errorCode===Is)return this._current[tr](),this._current.element}onText(e){e=e.replace(this._nbsps,e=>e.slice(1)+" "),this._richText||this._current[Hs]()?this._current[Ur](e,this._richText):this._whiteRegex.test(e)||this._current[Ur](e.trim())}onCdata(e){this._current[Ur](e)}_mkAttributes(e,t){let i=null,n=null;const a=Object.create({});for(const{name:s,value:r}of e)if("xmlns"===s)i?warn$1(`XFA - multiple namespace definition in <${t}>`):i=r;else if(s.startsWith("xmlns:")){const e=s.substring(6);n??=[],n.push({prefix:e,value:r})}else{const e=s.indexOf(":");if(-1===e)a[s]=r;else{const t=a[Rr]??=Object.create(null),[i,n]=[s.slice(0,e),s.slice(e+1)];(t[i]||=Object.create(null))[n]=r}}return[i,n,a]}_getNameAndPrefix(e,t){const i=e.indexOf(":");return-1===i?[e,null]:[e.substring(i+1),t?"":e.substring(0,i)]}onBeginElement(e,t,i){const[n,a,s]=this._mkAttributes(t,e),[r,o]=this._getNameAndPrefix(e,this._builder.isNsAgnostic()),l=this._builder.build({nsPrefix:o,name:r,attributes:s,namespace:n,prefixes:a});if(l[yr]=this._globalData,i)return l[tr](),this._current[Nr](l)&&l[Gr](this._ids),void l[Ws](this._builder);this._stack.push(this._current),this._current=l}onEndElement(e){const t=this._current;if(t[vr]()&&"string"==typeof t[Js]){const e=new XFAParser;e._globalData=this._globalData;const i=e.parse(t[Js]);t[Js]=null,t[Nr](i)}t[tr](),this._current=this._stack.pop(),this._current[Nr](t)&&t[Gr](this._ids),t[Ws](this._builder)}onError(e){this._errorCode=e}}class XFAFactory{constructor(e){try{this.root=(new XFAParser).parse(XFAFactory._createDocument(e));const t=new Binder(this.root);this.form=t.bind(),this.dataHandler=new DataHandler(this.root,t.getData()),this.form[yr].template=this.form}catch(e){warn$1(`XFA - an error occurred during parsing and binding: ${e}`)}}isValid(){return!(!this.root||!this.form)}_createPagesHelper(){const e=this.form[Zr]();return new Promise((t,i)=>{const nextIteration=()=>{try{const i=e.next();i.done?t(i.value):setTimeout(nextIteration,0)}catch(e){i(e)}};setTimeout(nextIteration,0)})}async _createPages(){try{this.pages=await this._createPagesHelper(),this.dims=this.pages.children.map(e=>{const{width:t,height:i}=e.attributes.style;return[0,0,parseInt(t),parseInt(i)]})}catch(e){warn$1(`XFA - an error occurred during layout: ${e}`)}}getBoundingBox(e){return this.dims[e]}async getNumPages(){return this.pages||await this._createPages(),this.dims.length}setImages(e){this.form[yr].images=e}setFonts(e){this.form[yr].fontFinder=new FontFinder(e);const t=[];for(let e of this.form[yr].usedTypefaces){e=stripQuotes(e);this.form[yr].fontFinder.find(e)||t.push(e)}return t.length>0?t:null}appendFonts(e,t){this.form[yr].fontFinder.add(e,t)}async getPages(){this.pages||await this._createPages();const e=this.pages;return this.pages=null,e}serializeData(e){return this.dataHandler.serialize(e)}static _createDocument(e){return e["/xdp:xdp"]?Object.values(e).join(""):e["xdp:xdp"]}static getRichTextAsHtml(e){if(!e||"string"!=typeof e)return null;try{let t=new XFAParser(XhtmlNamespace,!0).parse(e);if(!["body","xhtml"].includes(t[Pr])){const e=XhtmlNamespace.body({});e[qs](t),t=e}const i=t[Qr]();if(!i.success)return null;const{html:n}=i,{attributes:a}=n;return a&&(a.class&&(a.class=a.class.filter(e=>!e.startsWith("xfa"))),a.dir="auto"),{html:n,str:t[Jr]()}}catch(e){warn$1(`XFA - an error occurred during parsing of rich text: ${e}`)}return null}}class AnnotationFactory{static createGlobals(e){return Promise.all([e.ensureCatalog("acroForm"),e.ensureDoc("xfaDatasets"),e.ensureCatalog("structTreeRoot"),e.ensureCatalog("baseUrl"),e.ensureCatalog("attachments"),e.ensureCatalog("globalColorSpaceCache")]).then(([t,i,n,a,s,r])=>({pdfManager:e,acroForm:t instanceof Dict?t:Dict.empty,xfaDatasets:i,structTreeRoot:n,baseUrl:a,attachments:s,globalColorSpaceCache:r}),e=>(warn$1(`createGlobals: "${e}".`),null))}static async create(e,t,i,n,a,s,r,o){const l=a?await this._getPageIndex(e,t,i.pdfManager):null;return i.pdfManager.ensure(this,"_create",[e,t,i,n,a,s,r,l,o])}static _create(e,t,i,n,a=!1,s=null,r=null,o=null,l=null){const c=e.fetchIfRef(t);if(!(c instanceof Dict))return;let h=c.get("Subtype");if(h=h instanceof Name?h.name:null,r&&!r.has(T[h.toUpperCase()]))return null;const{acroForm:d,pdfManager:u}=i,g=t instanceof Ref?t.toString():`annot_${n.createObjId()}`,f={xref:e,ref:t,dict:c,subtype:h,id:g,annotationGlobals:i,collectFields:a,orphanFields:s,needAppearances:!a&&!0===d.get("NeedAppearances"),pageIndex:o,evaluatorOptions:u.evaluatorOptions,pageRef:l};switch(h){case"Link":return new LinkAnnotation(f);case"Text":return new TextAnnotation(f);case"Widget":let e=getInheritableProperty({dict:c,key:"FT"});switch(e=e instanceof Name?e.name:null,e){case"Tx":return new TextWidgetAnnotation(f);case"Btn":return new ButtonWidgetAnnotation(f);case"Ch":return new ChoiceWidgetAnnotation(f);case"Sig":return new SignatureWidgetAnnotation(f)}return warn$1(`Unimplemented widget field type "${e}", falling back to base field type.`),new WidgetAnnotation(f);case"Popup":return new PopupAnnotation(f);case"FreeText":return new FreeTextAnnotation(f);case"Line":return new LineAnnotation(f);case"Square":return new SquareAnnotation(f);case"Circle":return new CircleAnnotation(f);case"PolyLine":return new PolylineAnnotation(f);case"Polygon":return new PolygonAnnotation(f);case"Caret":return new CaretAnnotation(f);case"Ink":return new InkAnnotation(f);case"Highlight":return new HighlightAnnotation(f);case"Underline":return new UnderlineAnnotation(f);case"Squiggly":return new SquigglyAnnotation(f);case"StrikeOut":return new StrikeOutAnnotation(f);case"Stamp":return new StampAnnotation(f);case"FileAttachment":return new FileAttachmentAnnotation(f);default:return a||warn$1(h?`Unimplemented annotation type "${h}", falling back to base annotation.`:"Annotation is missing the required /Subtype."),new Annotation(f)}}static async _getPageIndex(e,t,i){try{const n=await e.fetchIfRefAsync(t);if(!(n instanceof Dict))return-1;const a=n.getRaw("P");if(a instanceof Ref)try{return await i.ensureCatalog("getPageIndex",[a])}catch(e){info$1(`_getPageIndex -- not a valid page reference: "${e}".`)}if(n.has("Kids"))return-1;const s=await i.ensureDoc("numPages");for(let e=0;e<s;e++){const n=await i.getPage(e),a=await i.ensure(n,"annotations");for(const i of a)if(i instanceof Ref&&isRefsEqual(i,t))return e}}catch(e){warn$1(`_getPageIndex: "${e}".`)}return-1}static generateImages(e,t,i){if(!i)return warn$1("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images."),null;let n;for(const{bitmapId:i,bitmap:a}of e)a&&(n||=new Map,n.set(i,StampAnnotation.createImage(a,t)));return n}static async saveNewAnnotations(e,t,i,n,a){const s=e.xref;let r;const o=[],{isOffscreenCanvasSupported:l}=e.options;for(const c of i)if(!c.deleted)switch(c.annotationType){case f:if(!r){const e=new Dict(s);e.setIfName("BaseFont","Helvetica"),e.setIfName("Type","Font"),e.setIfName("Subtype","Type1"),e.setIfName("Encoding","WinAnsiEncoding"),r=s.getNewTemporaryRef(),a.put(r,{data:e})}o.push(FreeTextAnnotation.createNewAnnotation(s,c,a,{evaluator:e,task:t,baseFontRef:r}));break;case p:c.quadPoints?o.push(HighlightAnnotation.createNewAnnotation(s,c,a)):o.push(InkAnnotation.createNewAnnotation(s,c,a));break;case b:o.push(InkAnnotation.createNewAnnotation(s,c,a));break;case m:const i=l?await(n?.get(c.bitmapId)):null;if(i?.imageStream){const{imageStream:e,smaskStream:t}=i;if(t){const i=s.getNewTemporaryRef();a.put(i,{data:t}),e.dict.set("SMask",i)}const n=i.imageRef=s.getNewTemporaryRef();a.put(n,{data:e}),i.imageStream=i.smaskStream=null}o.push(StampAnnotation.createNewAnnotation(s,c,a,{image:i}));break;case y:o.push(StampAnnotation.createNewAnnotation(s,c,a,{}))}return{annotations:(await Promise.all(o)).flat()}}static async printNewAnnotations(e,t,i,n,a){if(!n)return null;const{options:s,xref:r}=t,o=[];for(const l of n)if(!l.deleted)switch(l.annotationType){case f:o.push(FreeTextAnnotation.createNewPrintAnnotation(e,r,l,{evaluator:t,task:i,evaluatorOptions:s}));break;case p:l.quadPoints?o.push(HighlightAnnotation.createNewPrintAnnotation(e,r,l,{evaluatorOptions:s})):o.push(InkAnnotation.createNewPrintAnnotation(e,r,l,{evaluatorOptions:s}));break;case b:o.push(InkAnnotation.createNewPrintAnnotation(e,r,l,{evaluatorOptions:s}));break;case m:const n=s.isOffscreenCanvasSupported?await(a?.get(l.bitmapId)):null;if(n?.imageStream){const{imageStream:e,smaskStream:t}=n;t&&e.dict.set("SMask",t),n.imageRef=new JpegStream(e,e.length),n.imageStream=n.smaskStream=null}o.push(StampAnnotation.createNewPrintAnnotation(e,r,l,{image:n,evaluatorOptions:s}));break;case y:o.push(StampAnnotation.createNewPrintAnnotation(e,r,l,{evaluatorOptions:s}))}return Promise.all(o)}}function getRgbColor(e,t=new Uint8ClampedArray(3)){if(!Array.isArray(e))return t;const i=t||new Uint8ClampedArray(3);switch(e.length){case 0:return null;case 1:return ColorSpaceUtils.gray.getRgbItem(e,0,i,0),i;case 3:return ColorSpaceUtils.rgb.getRgbItem(e,0,i,0),i;case 4:return ColorSpaceUtils.cmyk.getRgbItem(e,0,i,0),i;default:return t}}function getPdfColorArray(e,t=null){return e&&Array.from(e,e=>e/255)||t}function getQuadPoints(e,t){const i=e.getArray("QuadPoints");if(!isNumberArray(i,null)||0===i.length||i.length%8>0)return null;const n=new Float32Array(i.length);for(let e=0,a=i.length;e<a;e+=8){const[a,s,r,o,l,c,h,d]=i.slice(e,e+8),u=Math.min(a,r,l,h),g=Math.max(a,r,l,h),f=Math.min(s,o,c,d),p=Math.max(s,o,c,d);if(null!==t&&(u<t[0]||g>t[2]||f<t[1]||p>t[3]))return null;n.set([u,p,g,p,u,f,g,f],e)}return n}function getTransformMatrix(e,t,i){const n=new Float32Array([1/0,1/0,-1/0,-1/0]);ai.axialAlignedBoundingBox(t,i,n);const[a,s,r,o]=n;if(a===r||s===o)return[1,0,0,1,e[0],e[1]];const l=(e[2]-e[0])/(r-a),c=(e[3]-e[1])/(o-s);return[l,0,0,c,e[0]-a*l,e[1]-s*c]}class Annotation{constructor(e){const{dict:t,xref:i,annotationGlobals:n,ref:a,orphanFields:s}=e,r=s?.get(a);r&&t.set("Parent",r),this.setTitle(t.get("T")),this.setContents(t.get("Contents")),this.setModificationDate(t.get("M")),this.setFlags(t.get("F")),this.setRectangle(t.getArray("Rect")),this.setColor(t.getArray("C")),this.setBorderStyle(t),this.setAppearance(t),this.setOptionalContent(t);const o=t.get("MK");this.setBorderAndBackgroundColors(o),this.setRotation(o,t),this.ref=e.ref instanceof Ref?e.ref:null,this._streams=[],this.appearance&&this._streams.push(this.appearance);const l=!!(this.flags&N),c=!!(this.flags&L);if(this.data={annotationFlags:this.flags,borderStyle:this.borderStyle,color:this.color,backgroundColor:this.backgroundColor,borderColor:this.borderColor,rotation:this.rotation,contentsObj:this._contents,hasAppearance:!!this.appearance,id:e.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:e.subtype,hasOwnCanvas:!1,noRotate:!!(this.flags&_),noHTML:l&&c,isEditable:!1,structParent:-1},n.structTreeRoot){let i=t.get("StructParent");this.data.structParent=i=Number.isInteger(i)&&i>=0?i:-1,n.structTreeRoot.addAnnotationIdToPage(e.pageRef,i)}if(e.collectFields){const n=t.get("Kids");if(Array.isArray(n)){const e=[];for(const t of n)t instanceof Ref&&e.push(t.toString());0!==e.length&&(this.data.kidIds=e)}this.data.actions=collectActions(i,t,te),this.data.fieldName=this._constructFieldName(t),this.data.pageIndex=e.pageIndex}const h=t.get("IT");h instanceof Name&&(this.data.it=h.name),this._isOffscreenCanvasSupported=e.evaluatorOptions.isOffscreenCanvasSupported,this._fallbackFontDict=null,this._needAppearances=!1}_hasFlag(e,t){return!!(e&t)}_buildFlags(e,t){let{flags:i}=this;if(void 0===e){if(void 0===t)return;return t?-5&i:-3&i|O}return e?(i|=O,t?-33&i|D:-3&i|R):(i&=-35,t?-5&i:i|O)}_isViewable(e){return!this._hasFlag(e,M)&&!this._hasFlag(e,R)}_isPrintable(e){return this._hasFlag(e,O)&&!this._hasFlag(e,D)&&!this._hasFlag(e,M)}mustBeViewed(e,t){const i=e?.get(this.data.id)?.noView;return void 0!==i?!i:this.viewable&&!this._hasFlag(this.flags,D)}mustBePrinted(e){const t=e?.get(this.data.id)?.noPrint;return void 0!==t?!t:this.printable}mustBeViewedWhenEditing(e,t=null){return e?!this.data.isEditable:!t?.has(this.data.id)}get viewable(){return null!==this.data.quadPoints&&(0===this.flags||this._isViewable(this.flags))}get printable(){return null!==this.data.quadPoints&&(0!==this.flags&&this._isPrintable(this.flags))}_parseStringHelper(e){const t="string"==typeof e?stringToPDFString(e):"";return{str:t,dir:t&&"rtl"===bidi(t).dir?"rtl":"ltr"}}setDefaultAppearance(e){const{dict:t,annotationGlobals:i}=e,n=getInheritableProperty({dict:t,key:"DA"})||i.acroForm.get("DA");this._defaultAppearance="string"==typeof n?n:"",this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance)}setTitle(e){this._title=this._parseStringHelper(e)}setContents(e){this._contents=this._parseStringHelper(e)}setModificationDate(e){this.modificationDate="string"==typeof e?e:null}setFlags(e){this.flags=Number.isInteger(e)&&e>0?e:0,this.flags&M&&"Annotation"!==this.constructor.name&&(this.flags^=M)}hasFlag(e){return this._hasFlag(this.flags,e)}setRectangle(e){this.rectangle=lookupNormalRect(e,[0,0,0,0])}setColor(e){this.color=getRgbColor(e)}setLineEndings(e){if(this.lineEndings=["None","None"],Array.isArray(e)&&2===e.length)for(let t=0;t<2;t++){const i=e[t];if(i instanceof Name)switch(i.name){case"None":continue;case"Square":case"Circle":case"Diamond":case"OpenArrow":case"ClosedArrow":case"Butt":case"ROpenArrow":case"RClosedArrow":case"Slash":this.lineEndings[t]=i.name;continue}warn$1(`Ignoring invalid lineEnding: ${i}`)}}setRotation(e,t){this.rotation=0;let i=e instanceof Dict?e.get("R")||0:t.get("Rotate")||0;Number.isInteger(i)&&0!==i&&(i%=360,i<0&&(i+=360),i%90==0&&(this.rotation=i))}setBorderAndBackgroundColors(e){e instanceof Dict?(this.borderColor=getRgbColor(e.getArray("BC"),null),this.backgroundColor=getRgbColor(e.getArray("BG"),null)):this.borderColor=this.backgroundColor=null}setBorderStyle(e){if(this.borderStyle=new AnnotationBorderStyle,e instanceof Dict)if(e.has("BS")){const t=e.get("BS");if(t instanceof Dict){const e=t.get("Type");e&&!isName(e,"Border")||(this.borderStyle.setWidth(t.get("W"),this.rectangle),this.borderStyle.setStyle(t.get("S")),this.borderStyle.setDashArray(t.getArray("D")))}}else if(e.has("Border")){const t=e.getArray("Border");Array.isArray(t)&&t.length>=3&&(this.borderStyle.setHorizontalCornerRadius(t[0]),this.borderStyle.setVerticalCornerRadius(t[1]),this.borderStyle.setWidth(t[2],this.rectangle),4===t.length&&this.borderStyle.setDashArray(t[3],!0))}else this.borderStyle.setWidth(0)}setAppearance(e){this.appearance=null;const t=e.get("AP");if(!(t instanceof Dict))return;const i=t.get("N");if(i instanceof BaseStream)return void(this.appearance=i);if(!(i instanceof Dict))return;const n=e.get("AS");if(!(n instanceof Name&&i.has(n.name)))return;const a=i.get(n.name);a instanceof BaseStream&&(this.appearance=a)}setOptionalContent(e){this.oc=null;const t=e.get("OC");t instanceof Name?warn$1("setOptionalContent: Support for /Name-entry is not implemented."):t instanceof Dict&&(this.oc=t)}async loadResources(e,t){const i=await t.dict.getAsync("Resources");return i&&await ObjectLoader.load(i,e,i.xref),i}async getOperatorList(e,t,i,n){const{hasOwnCanvas:a,id:s,rect:o}=this.data;let l=this.appearance;const c=!!(a&&i&r);if(c&&(0===this.width||0===this.height))return this.data.hasOwnCanvas=!1,{opList:new OperatorList,separateForm:!1,separateCanvas:!1};if(!l){if(!c)return{opList:new OperatorList,separateForm:!1,separateCanvas:!1};l=new StringStream(""),l.dict=new Dict}const h=l.dict,d=await this.loadResources(mi,l),u=lookupRect(h.getArray("BBox"),[0,0,1,1]),g=lookupMatrix(h.getArray("Matrix"),pi),f=getTransformMatrix(o,u,g),p=new OperatorList;let m;return this.oc&&(m=await e.parseMarkedContentProps(this.oc,null)),void 0!==m&&p.addOp(xt,["OC",m]),p.addOp(Et,[s,o,f,g,c]),await e.getOperatorList({stream:l,task:t,resources:d,operatorList:p,fallbackFontDict:this._fallbackFontDict}),p.addOp(Mt,[]),void 0!==m&&p.addOp(St,[]),this.reset(),{opList:p,separateForm:!1,separateCanvas:c}}async save(e,t,i,n){return null}get overlaysTextContent(){return!1}get hasTextContent(){return!1}async extractTextContent(e,t,i){if(!this.appearance)return;const n=await this.loadResources(bi,this.appearance),a=[],s=[];let r=null;const o={desiredSize:Math.Infinity,ready:!0,enqueue(e,t){for(const t of e.items)void 0!==t.str&&(r||=t.transform.slice(-2),s.push(t.str),t.hasEOL&&(a.push(s.join("").trimEnd()),s.length=0))}};if(await e.getTextContent({stream:this.appearance,task:t,resources:n,includeMarkedContent:!0,keepWhiteSpace:!0,sink:o,viewBox:i}),this.reset(),s.length&&a.push(s.join("").trimEnd()),a.length>1||a[0]){const e=this.appearance.dict,t=lookupRect(e.getArray("BBox"),null),i=lookupMatrix(e.getArray("Matrix"),null);this.data.textPosition=this._transformPoint(r,t,i),this.data.textContent=a}}_transformPoint(e,t,i){const{rect:n}=this.data;t||=[0,0,1,1],i||=[1,0,0,1,0,0];const a=getTransformMatrix(n,t,i);a[4]-=n[0],a[5]-=n[1];const s=e.slice();return ai.applyTransform(s,a),ai.applyTransform(s,i),s}getFieldObject(){return this.data.kidIds?{id:this.data.id,actions:this.data.actions,name:this.data.fieldName,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,type:"",kidIds:this.data.kidIds,page:this.data.pageIndex,rotation:this.rotation}:null}reset(){for(const e of this._streams)e.reset()}_constructFieldName(e){if(!e.has("T")&&!e.has("Parent"))return warn$1("Unknown field name, falling back to empty field name."),"";if(!e.has("Parent"))return stringToPDFString(e.get("T"));const t=[];e.has("T")&&t.unshift(stringToPDFString(e.get("T")));let i=e;const n=new RefSet;for(e.objId&&n.put(e.objId);i.has("Parent")&&(i=i.get("Parent"),i instanceof Dict&&(!i.objId||!n.has(i.objId)));)i.objId&&n.put(i.objId),i.has("T")&&t.unshift(stringToPDFString(i.get("T")));return t.join(".")}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class AnnotationBorderStyle{constructor(){this.width=1,this.rawWidth=1,this.style=Y,this.dashArray=[3],this.horizontalCornerRadius=0,this.verticalCornerRadius=0}setWidth(e,t=[0,0,0,0]){if(e instanceof Name)this.width=0;else if("number"==typeof e){if(e>0){this.rawWidth=e;const i=(t[2]-t[0])/2,n=(t[3]-t[1])/2;i>0&&n>0&&(e>i||e>n)&&(warn$1(`AnnotationBorderStyle.setWidth - ignoring width: ${e}`),e=1)}this.width=e}}setStyle(e){if(e instanceof Name)switch(e.name){case"S":this.style=Y;break;case"D":this.style=J;break;case"B":this.style=Z;break;case"I":this.style=Q;break;case"U":this.style=ee}}setDashArray(e,t=!1){if(Array.isArray(e)){let i=!0,n=!0;for(const t of e){if(!(+t>=0)){i=!1;break}t>0&&(n=!1)}0===e.length||i&&!n?(this.dashArray=e,t&&this.setStyle(Name.get("D"))):this.width=0}else e&&(this.width=0)}setHorizontalCornerRadius(e){Number.isInteger(e)&&(this.horizontalCornerRadius=e)}setVerticalCornerRadius(e){Number.isInteger(e)&&(this.verticalCornerRadius=e)}}class MarkupAnnotation extends Annotation{constructor(e){super(e);const{dict:t}=e;if(t.has("IRT")){const e=t.getRaw("IRT");this.data.inReplyTo=e instanceof Ref?e.toString():null;const i=t.get("RT");this.data.replyType=i instanceof Name?i.name:E}let i=null;if(this.data.replyType===F){const e=t.get("IRT");this.setTitle(e.get("T")),this.data.titleObj=this._title,this.setContents(e.get("Contents")),this.data.contentsObj=this._contents,e.has("CreationDate")?(this.setCreationDate(e.get("CreationDate")),this.data.creationDate=this.creationDate):this.data.creationDate=null,e.has("M")?(this.setModificationDate(e.get("M")),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,i=e.getRaw("Popup"),e.has("C")?(this.setColor(e.getArray("C")),this.data.color=this.color):this.data.color=null}else this.data.titleObj=this._title,this.setCreationDate(t.get("CreationDate")),this.data.creationDate=this.creationDate,i=t.getRaw("Popup"),t.has("C")||(this.data.color=null);this.data.popupRef=i instanceof Ref?i.toString():null,t.has("RC")&&(this.data.richText=XFAFactory.getRichTextAsHtml(t.get("RC")))}setCreationDate(e){this.creationDate="string"==typeof e?e:null}_setDefaultAppearance({xref:e,extra:t,strokeColor:i,fillColor:n,blendMode:a,strokeAlpha:s,fillAlpha:r,pointsCallback:o}){const l=this.data.rect=[1/0,1/0,-1/0,-1/0],c=["q"];t&&c.push(t),i&&c.push(`${i[0]} ${i[1]} ${i[2]} RG`),n&&c.push(`${n[0]} ${n[1]} ${n[2]} rg`);const h=this.data.quadPoints||Float32Array.from([this.rectangle[0],this.rectangle[3],this.rectangle[2],this.rectangle[3],this.rectangle[0],this.rectangle[1],this.rectangle[2],this.rectangle[1]]);for(let e=0,t=h.length;e<t;e+=8){const t=o(c,h.subarray(e,e+8));ai.rectBoundingBox(...t,l)}c.push("Q");const d=new Dict(e),u=new Dict(e);u.setIfName("Subtype","Form");const g=new StringStream(c.join(" "));g.dict=u,d.set("Fm0",g);const f=new Dict(e);a&&f.setIfName("BM",a),f.setIfNumber("CA",s),f.setIfNumber("ca",r);const p=new Dict(e);p.set("GS0",f);const m=new Dict(e);m.set("ExtGState",p),m.set("XObject",d);const b=new Dict(e);b.set("Resources",m),b.set("BBox",l),this.appearance=new StringStream("/GS0 gs /Fm0 Do"),this.appearance.dict=b,this._streams.push(this.appearance,g)}static async createNewAnnotation(e,t,i,n){const a=t.ref||=e.getNewTemporaryRef(),s=await this.createNewAppearanceStream(t,e,n);let r;if(s){const n=e.getNewTemporaryRef();r=this.createNewDict(t,e,{apRef:n}),i.put(n,{data:s})}else r=this.createNewDict(t,e,{});Number.isInteger(t.parentTreeId)&&r.set("StructParent",t.parentTreeId),i.put(a,{data:r});const o={ref:a},{popup:l}=t;if(l){if(l.deleted)return r.delete("Popup"),r.delete("Contents"),r.delete("RC"),o;const t=l.ref||=e.getNewTemporaryRef();l.parent=a;const n=PopupAnnotation.createNewDict(l,e);return i.put(t,{data:n}),r.setIfDefined("Contents",stringToAsciiOrUTF16BE(l.contents)),r.set("Popup",t),[o,{ref:t}]}return o}static async createNewPrintAnnotation(e,t,i,n){const a=await this.createNewAppearanceStream(i,t,n),s=this.createNewDict(i,t,a?{ap:a}:{}),r=new this.prototype.constructor({dict:s,xref:t,annotationGlobals:e,evaluatorOptions:n.evaluatorOptions});return i.ref&&(r.ref=r.refToReplace=i.ref),r}}class WidgetAnnotation extends Annotation{constructor(e){super(e);const{dict:t,xref:i,annotationGlobals:n}=e,a=this.data;this._needAppearances=e.needAppearances,a.annotationType=T.WIDGET,void 0===a.fieldName&&(a.fieldName=this._constructFieldName(t)),void 0===a.actions&&(a.actions=collectActions(i,t,te));let s=getInheritableProperty({dict:t,key:"V",getArray:!0});a.fieldValue=this._decodeFormValue(s);const r=getInheritableProperty({dict:t,key:"DV",getArray:!0});if(a.defaultFieldValue=this._decodeFormValue(r),void 0===s&&n.xfaDatasets){const e=this._title.str;e&&(this._hasValueFromXFA=!0,a.fieldValue=s=n.xfaDatasets.getValue(e))}void 0===s&&null!==a.defaultFieldValue&&(a.fieldValue=a.defaultFieldValue),a.alternativeText=stringToPDFString(t.get("TU")||""),this.setDefaultAppearance(e),a.hasAppearance||=this._needAppearances&&void 0!==a.fieldValue&&null!==a.fieldValue;const o=getInheritableProperty({dict:t,key:"FT"});a.fieldType=o instanceof Name?o.name:null;const l=getInheritableProperty({dict:t,key:"DR"}),c=n.acroForm.get("DR"),h=this.appearance?.dict.get("Resources");this._fieldResources={localResources:l,acroFormResources:c,appearanceResources:h,mergedResources:Dict.merge({xref:i,dictArray:[l,h,c],mergeSubDicts:!0})},a.fieldFlags=getInheritableProperty({dict:t,key:"Ff"}),(!Number.isInteger(a.fieldFlags)||a.fieldFlags<0)&&(a.fieldFlags=0),a.password=this.hasFieldFlag(H),a.readOnly=this.hasFieldFlag(U),a.required=this.hasFieldFlag(j),a.hidden=this._hasFlag(a.annotationFlags,D)||this._hasFlag(a.annotationFlags,R)}_decodeFormValue(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e).map(e=>stringToPDFString(e)):e instanceof Name?stringToPDFString(e.name):"string"==typeof e?stringToPDFString(e):null}hasFieldFlag(e){return!!(this.data.fieldFlags&e)}_isViewable(e){return!0}mustBeViewed(e,t){return t?this.viewable:super.mustBeViewed(e,t)&&!this._hasFlag(this.flags,R)}getRotationMatrix(e){let t=e?.get(this.data.id)?.rotation;return void 0===t&&(t=this.rotation),0===t?pi:getRotationMatrix(t,this.width,this.height)}getBorderAndBackgroundAppearances(e){let t=e?.get(this.data.id)?.rotation;if(void 0===t&&(t=this.rotation),!this.backgroundColor&&!this.borderColor)return"";const i=0===t||180===t?`0 0 ${this.width} ${this.height} re`:`0 0 ${this.height} ${this.width} re`;let n="";if(this.backgroundColor&&(n=`${getPdfColor(this.backgroundColor,!0)} ${i} f `),this.borderColor){n+=`${this.borderStyle.width||1} w ${getPdfColor(this.borderColor,!1)} ${i} S `}return n}async getOperatorList(e,t,i,n){if(i&c&&!(this instanceof SignatureWidgetAnnotation)&&!this.data.noHTML&&!this.data.hasOwnCanvas)return{opList:new OperatorList,separateForm:!0,separateCanvas:!1};if(!this._hasText)return super.getOperatorList(e,t,i,n);const a=await this._getAppearance(e,t,i,n);if(this.appearance&&null===a)return super.getOperatorList(e,t,i,n);const s=new OperatorList;if(!this._defaultAppearance||null===a)return{opList:s,separateForm:!1,separateCanvas:!1};const o=!!(this.data.hasOwnCanvas&&i&r),l=[0,0,this.width,this.height],h=getTransformMatrix(this.data.rect,l,[1,0,0,1,0,0]);let d;this.oc&&(d=await e.parseMarkedContentProps(this.oc,null)),void 0!==d&&s.addOp(xt,["OC",d]),s.addOp(Et,[this.data.id,this.data.rect,h,this.getRotationMatrix(n),o]);const u=new StringStream(a);return await e.getOperatorList({stream:u,task:t,resources:this._fieldResources.mergedResources,operatorList:s}),s.addOp(Mt,[]),void 0!==d&&s.addOp(St,[]),{opList:s,separateForm:!1,separateCanvas:o}}_getMKDict(e){const t=new Dict(null);return e&&t.set("R",e),t.setIfArray("BC",getPdfColorArray(this.borderColor)),t.setIfArray("BG",getPdfColorArray(this.backgroundColor)),t.size>0?t:null}amendSavedDict(e,t){}setValue(e,t,i,n){const{dict:a,ref:s}=function(e,t,i){const n=new RefSet,a=e,s={dict:null,ref:null};for(;e instanceof Dict&&!n.has(t)&&(n.put(t),!e.has("T"));){if(!((t=e.getRaw("Parent"))instanceof Ref))return s;e=i.fetch(t)}return e instanceof Dict&&e!==a&&(s.dict=e,s.ref=t),s}(e,this.ref,i);if(a){if(!n.has(s)){const e=a.clone();return e.set("V",t),n.put(s,{data:e}),e}}else e.set("V",t);return null}async save(e,t,i,n){const a=i?.get(this.data.id),s=this._buildFlags(a?.noView,a?.noPrint);let r=a?.value,o=a?.rotation;if(r===this.data.fieldValue||void 0===r){if(!this._hasValueFromXFA&&void 0===o&&void 0===s)return;r||=this.data.fieldValue}if(void 0===o&&!this._hasValueFromXFA&&Array.isArray(r)&&Array.isArray(this.data.fieldValue)&&isArrayEqual(r,this.data.fieldValue)&&void 0===s)return;void 0===o&&(o=this.rotation);let c=null;if(!this._needAppearances&&(c=await this._getAppearance(e,t,l,i),null===c&&void 0===s))return;let h=!1;c?.needAppearances&&(h=!0,c=null);const{xref:d}=e,u=d.fetchIfRef(this.ref);if(!(u instanceof Dict))return;const g=new Dict(d);for(const e of u.getKeys())"AP"!==e&&g.set(e,u.getRaw(e));if(void 0!==s&&(g.set("F",s),null===c&&!h)){const e=u.getRaw("AP");e&&g.set("AP",e)}const f={path:this.data.fieldName,value:r},p=this.setValue(g,Array.isArray(r)?r.map(stringToAsciiOrUTF16BE):stringToAsciiOrUTF16BE(r),d,n);this.amendSavedDict(i,p||g);const m=this._getMKDict(o);if(m&&g.set("MK",m),n.put(this.ref,{data:g,xfa:f,needAppearances:h}),null!==c){const e=d.getNewTemporaryRef(),t=new Dict(d);g.set("AP",t),t.set("N",e);const a=this._getSaveFieldResources(d),s=new StringStream(c),r=s.dict=new Dict(d);r.setIfName("Subtype","Form"),r.set("Resources",a);const l=o%180==0?[0,0,this.width,this.height]:[0,0,this.height,this.width];r.set("BBox",l);const h=this.getRotationMatrix(i);h!==pi&&r.set("Matrix",h),n.put(e,{data:s,xfa:null,needAppearances:!1})}g.set("M",`D:${getModificationDate()}`)}async _getAppearance(e,t,i,n){if(this.data.password)return null;const s=n?.get(this.data.id);let r,o;if(s&&(r=s.formattedValue||s.value,o=s.rotation),void 0===o&&void 0===r&&!this._needAppearances&&(!this._hasValueFromXFA||this.appearance))return null;const c=this.getBorderAndBackgroundAppearances(n);if(void 0===r&&(r=this.data.fieldValue,!r))return`/Tx BMC q ${c}Q EMC`;if(Array.isArray(r)&&1===r.length&&(r=r[0]),assert$1("string"==typeof r,"Expected `value` to be a string."),r=r.trimEnd(),this.data.combo){const e=this.data.options.find(({exportValue:e})=>r===e);r=e?.displayValue||r}if(""===r)return`/Tx BMC q ${c}Q EMC`;void 0===o&&(o=this.rotation);let h,d=-1;this.data.multiLine?(h=r.split(/\r\n?|\n/).map(e=>e.normalize("NFC")),d=h.length):h=[r.replace(/\r\n?|\n/,"").normalize("NFC")];let{width:u,height:g}=this;90!==o&&270!==o||([u,g]=[g,u]),this._defaultAppearance||(this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance="/Helvetica 0 Tf 0 g"));let f,p,m,b=await WidgetAnnotation._getFontData(e,t,this.data.defaultAppearanceData,this._fieldResources.mergedResources);const y=[];let w=!1;for(const e of h){const t=b.encodeString(e);t.length>1&&(w=!0),y.push(t.join(""))}if(w&&i&l)return{needAppearances:!0};if(w&&this._isOffscreenCanvasSupported){const i=this.data.comb?"monospace":"sans-serif",n=new FakeUnicodeFont(e.xref,i),a=n.createFontResources(h.join("")),s=a.getRaw("Font");if(this._fieldResources.mergedResources.has("Font")){const e=this._fieldResources.mergedResources.get("Font");for(const t of s.getKeys())e.set(t,s.getRaw(t))}else this._fieldResources.mergedResources.set("Font",s);const o=n.fontName.name;b=await WidgetAnnotation._getFontData(e,t,{fontName:o,fontSize:0},a);for(let e=0,t=y.length;e<t;e++)y[e]=stringToUTF16String(h[e]);const l=Object.assign(Object.create(null),this.data.defaultAppearanceData);this.data.defaultAppearanceData.fontSize=0,this.data.defaultAppearanceData.fontName=o,[f,p,m]=this._computeFontSize(g-2,u-4,r,b,d),this.data.defaultAppearanceData=l}else this._isOffscreenCanvasSupported||warn$1("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly."),[f,p,m]=this._computeFontSize(g-2,u-4,r,b,d);let x=b.descent;x=isNaN(x)?a*m:Math.max(a*m,Math.abs(x)*p);const S=Math.min(Math.floor((g-p)/2),1),v=this.data.textAlignment;if(this.data.multiLine)return this._getMultilineAppearance(f,y,b,p,u,g,v,2,S,x,m,n);if(this.data.comb)return this._getCombAppearance(f,b,y[0],p,u,g,2,S,x,m,n);const C=S+x;if(0===v||v>2)return`/Tx BMC q ${c}BT `+f+` 1 0 0 1 ${numberToString(2)} ${numberToString(C)} Tm (${escapeString(y[0])}) Tj ET Q EMC`;return`/Tx BMC q ${c}BT `+f+` 1 0 0 1 0 0 Tm ${this._renderText(y[0],b,p,u,v,{shift:0},2,C)} ET Q EMC`}static async _getFontData(e,t,i,n){const a=new OperatorList,s={font:null,clone(){return this}},{fontName:r,fontSize:o}=i;return await e.handleSetFont(n,[r&&Name.get(r),o],null,a,t,s,null),s.font}_getTextWidth(e,t){return Math.sumPrecise(t.charsToGlyphs(e).map(e=>e.width))/1e3}_computeFontSize(e,t,n,a,s){let{fontSize:r}=this.data.defaultAppearanceData,o=(r||12)*i,l=Math.round(e/o);if(!r){const roundWithTwoDigits=e=>Math.floor(100*e)/100;if(-1===s){const s=this._getTextWidth(n,a);r=roundWithTwoDigits(Math.min(e/i,t/s)),l=1}else{const c=n.split(/\r\n?|\n/),h=[];for(const e of c){const t=a.encodeString(e).join(""),i=a.charsToGlyphs(t),n=a.getCharPositions(t);h.push({line:t,glyphs:i,positions:n})}const isTooBig=i=>{let n=0;for(const s of h){if(n+=this._splitLine(null,a,i,t,s).length*i,n>e)return!0}return!1};for(l=Math.max(l,s);o=e/l,r=roundWithTwoDigits(o/i),isTooBig(r);)l++}const{fontName:c,fontColor:h}=this.data.defaultAppearanceData;this._defaultAppearance=function({fontSize:e,fontName:t,fontColor:i}){return`/${escapePDFName(t)} ${e} Tf ${getPdfColor(i,!0)}`}({fontSize:r,fontName:c,fontColor:h})}return[this._defaultAppearance,r,e/l]}_renderText(e,t,i,n,a,s,r,o){let l;if(1===a){l=(n-this._getTextWidth(e,t)*i)/2}else if(2===a){l=n-this._getTextWidth(e,t)*i-r}else l=r;const c=numberToString(l-s.shift);return s.shift=l,`${c} ${o=numberToString(o)} Td (${escapeString(e)}) Tj`}_getSaveFieldResources(e){const{localResources:t,appearanceResources:i,acroFormResources:n}=this._fieldResources,a=this.data.defaultAppearanceData?.fontName;if(!a)return t||Dict.empty;for(const e of[t,i])if(e instanceof Dict){const t=e.get("Font");if(t instanceof Dict&&t.has(a))return e}if(n instanceof Dict){const i=n.get("Font");if(i instanceof Dict&&i.has(a)){const n=new Dict(e);n.set(a,i.getRaw(a));const s=new Dict(e);return s.set("Font",n),Dict.merge({xref:e,dictArray:[s,t],mergeSubDicts:!0})}}return t||Dict.empty}getFieldObject(){return null}}class TextWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);const{dict:t}=e;t.has("PMD")&&(this.flags|=D,this.data.hidden=!0,warn$1("Barcodes are not supported")),this.data.hasOwnCanvas=this.data.readOnly&&!this.data.noHTML,this._hasText=!0,"string"!=typeof this.data.fieldValue&&(this.data.fieldValue="");let i=getInheritableProperty({dict:t,key:"Q"});(!Number.isInteger(i)||i<0||i>2)&&(i=null),this.data.textAlignment=i;let n=getInheritableProperty({dict:t,key:"MaxLen"});(!Number.isInteger(n)||n<0)&&(n=0),this.data.maxLen=n,this.data.multiLine=this.hasFieldFlag($),this.data.comb=this.hasFieldFlag(K)&&!this.data.multiLine&&!this.data.password&&!this.hasFieldFlag(W)&&0!==this.data.maxLen,this.data.doNotScroll=this.hasFieldFlag(V);const{data:{actions:a}}=this;if(!a)return;const s=/^AF(Date|Time)_(?:Keystroke|Format)(?:Ex)?\(['"]?([^'"]+)['"]?\);$/;let r=!1;(1===a.Format?.length&&1===a.Keystroke?.length&&s.test(a.Format[0])&&s.test(a.Keystroke[0])||0===a.Format?.length&&1===a.Keystroke?.length&&s.test(a.Keystroke[0])||0===a.Keystroke?.length&&1===a.Format?.length&&s.test(a.Format[0]))&&(r=!0);const o=[];a.Format&&o.push(...a.Format),a.Keystroke&&o.push(...a.Keystroke),r&&(delete a.Keystroke,a.Format=o);for(const e of o){const t=e.match(s);if(!t)continue;const i="Date"===t[1];let n=t[2];const a=parseInt(n,10);if(isNaN(a)||Math.floor(Math.log10(a))+1!==t[2].length||(n=(i?Ts:Fs)[a]??n),this.data.datetimeFormat=n,!r)break;if(i){/HH|MM|ss|h/.test(n)?(this.data.datetimeType="datetime-local",this.data.timeStep=/ss/.test(n)?1:60):this.data.datetimeType="date";break}this.data.datetimeType="time",this.data.timeStep=/ss/.test(n)?1:60;break}}get hasTextContent(){return!!this.appearance&&!this._needAppearances}_getCombAppearance(e,t,i,n,a,s,r,o,l,c,h){const d=a/this.data.maxLen,u=this.getBorderAndBackgroundAppearances(h),g=[],f=t.getCharPositions(i);for(const[e,t]of f)g.push(`(${escapeString(i.substring(e,t))}) Tj`);const p=g.join(` ${numberToString(d)} 0 Td `);return`/Tx BMC q ${u}BT `+e+` 1 0 0 1 ${numberToString(r)} ${numberToString(o+l)} Tm ${p} ET Q EMC`}_getMultilineAppearance(e,t,i,n,a,s,r,o,l,c,h,d){const u=[],g=a-2*o,f={shift:0};for(let e=0,s=t.length;e<s;e++){const s=t[e],d=this._splitLine(s,i,n,g);for(let t=0,s=d.length;t<s;t++){const s=d[t],g=0===e&&0===t?-l-(h-c):-h;u.push(this._renderText(s,i,n,a,r,f,o,g))}}const p=this.getBorderAndBackgroundAppearances(d),m=u.join("\n");return`/Tx BMC q ${p}BT `+e+` 1 0 0 1 0 ${numberToString(s)} Tm ${m} ET Q EMC`}_splitLine(e,t,i,n,a={}){e=a.line||e;const s=a.glyphs||t.charsToGlyphs(e);if(s.length<=1)return[e];const r=a.positions||t.getCharPositions(e),o=i/1e3,l=[];let c=-1,h=-1,d=-1,u=0,g=0;for(let t=0,i=s.length;t<i;t++){const[i,a]=r[t],f=s[t],p=f.width*o;" "===f.unicode?g+p>n?(l.push(e.substring(u,i)),u=i,g=p,c=-1,d=-1):(g+=p,c=i,h=a,d=t):g+p>n?-1!==c?(l.push(e.substring(u,h)),u=h,t=d+1,c=-1,g=0):(l.push(e.substring(u,i)),u=i,g=p):g+=p}return u<e.length&&l.push(e.substring(u,e.length)),l}async extractTextContent(e,t,i){await super.extractTextContent(e,t,i);const n=this.data.textContent;if(!n)return;const a=n.join("\n");if(a===this.data.fieldValue)return;const s=a.replaceAll(/([.*+?^${}()|[\]\\])|(\s+)/g,(e,t)=>t?`\\${t}`:"\\s+");new RegExp(`^\\s*${s}\\s*$`).test(this.data.fieldValue)&&(this.data.textContent=this.data.fieldValue.split("\n"))}getFieldObject(){return{id:this.data.id,value:this.data.fieldValue,defaultValue:this.data.defaultFieldValue||"",multiline:this.data.multiLine,password:this.data.password,charLimit:this.data.maxLen,comb:this.data.comb,editable:!this.data.readOnly,hidden:this.data.hidden,name:this.data.fieldName,rect:this.data.rect,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,datetimeFormat:this.data.datetimeFormat,hasDatetimeHTML:!!this.data.datetimeType,type:"text"}}}class ButtonWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e),this.checkedAppearance=null,this.uncheckedAppearance=null;const t=this.hasFieldFlag(X),i=this.hasFieldFlag(q);this.data.checkBox=!t&&!i,this.data.radioButton=t&&!i,this.data.pushButton=i,this.data.isTooltipOnly=!1,this.data.checkBox?this._processCheckBox(e):this.data.radioButton?this._processRadioButton(e):this.data.pushButton?(this.data.hasOwnCanvas=!0,this.data.noHTML=!1,this._processPushButton(e)):warn$1("Invalid field flags for button widget annotation")}async getOperatorList(e,t,i,n){if(this.data.pushButton)return super.getOperatorList(e,t,i,!1,n);let a=null,s=null;if(n){const e=n.get(this.data.id);a=e?e.value:null,s=e?e.rotation:null}if(null===a&&this.appearance)return super.getOperatorList(e,t,i,n);null==a&&(a=this.data.checkBox?this.data.fieldValue===this.data.exportValue:this.data.fieldValue===this.data.buttonValue);const r=a?this.checkedAppearance:this.uncheckedAppearance;if(r){const a=this.appearance,o=lookupMatrix(r.dict.getArray("Matrix"),pi);s&&r.dict.set("Matrix",this.getRotationMatrix(n)),this.appearance=r;const l=super.getOperatorList(e,t,i,n);return this.appearance=a,r.dict.set("Matrix",o),l}return{opList:new OperatorList,separateForm:!1,separateCanvas:!1}}async save(e,t,i,n){this.data.checkBox?this._saveCheckbox(e,t,i,n):this.data.radioButton&&this._saveRadioButton(e,t,i,n)}async _saveCheckbox(e,t,i,n){if(!i)return;const a=i.get(this.data.id),s=this._buildFlags(a?.noView,a?.noPrint);let r=a?.rotation,o=a?.value;if(void 0===r&&void 0===s){if(void 0===o)return;if(this.data.fieldValue===this.data.exportValue===o)return}let l=e.xref.fetchIfRef(this.ref);if(!(l instanceof Dict))return;l=l.clone(),void 0===r&&(r=this.rotation),void 0===o&&(o=this.data.fieldValue===this.data.exportValue);const c={path:this.data.fieldName,value:o?this.data.exportValue:""},h=Name.get(o?this.data.exportValue:"Off");this.setValue(l,h,e.xref,n),l.set("AS",h),l.set("M",`D:${getModificationDate()}`),void 0!==s&&l.set("F",s);const d=this._getMKDict(r);d&&l.set("MK",d),n.put(this.ref,{data:l,xfa:c,needAppearances:!1})}async _saveRadioButton(e,t,i,n){if(!i)return;const a=i.get(this.data.id),s=this._buildFlags(a?.noView,a?.noPrint);let r=a?.rotation,o=a?.value;if(void 0===r&&void 0===s){if(void 0===o)return;if(this.data.fieldValue===this.data.buttonValue===o)return}let l=e.xref.fetchIfRef(this.ref);if(!(l instanceof Dict))return;l=l.clone(),void 0===o&&(o=this.data.fieldValue===this.data.buttonValue),void 0===r&&(r=this.rotation);const c={path:this.data.fieldName,value:o?this.data.buttonValue:""},h=Name.get(o?this.data.buttonValue:"Off");o&&this.setValue(l,h,e.xref,n),l.set("AS",h),l.set("M",`D:${getModificationDate()}`),void 0!==s&&l.set("F",s);const d=this._getMKDict(r);d&&l.set("MK",d),n.put(this.ref,{data:l,xfa:c,needAppearances:!1})}_getDefaultCheckedAppearance(e,t){const{width:i,height:n}=this,a=[0,0,i,n],s=.8*Math.min(i,n);let r,o;"check"===t?(r={width:.755*s,height:.705*s},o="3"):"disc"===t?(r={width:.791*s,height:.705*s},o="l"):unreachable$1(`_getDefaultCheckedAppearance - unsupported type: ${t}`);const l=`q BT /PdfJsZaDb ${s} Tf 0 g ${numberToString((i-r.width)/2)} ${numberToString((n-r.height)/2)} Td (${o}) Tj ET Q`,c=new Dict(e.xref);c.set("FormType",1),c.setIfName("Subtype","Form"),c.setIfName("Type","XObject"),c.set("BBox",a),c.set("Matrix",[1,0,0,1,0,0]),c.set("Length",l.length);const h=new Dict(e.xref),d=new Dict(e.xref);d.set("PdfJsZaDb",this.fallbackFontDict),h.set("Font",d),c.set("Resources",h),this.checkedAppearance=new StringStream(l),this.checkedAppearance.dict=c,this._streams.push(this.checkedAppearance)}_processCheckBox(e){const t=e.dict.get("AP");if(!(t instanceof Dict))return;const i=t.get("N");if(!(i instanceof Dict))return;const n=this._decodeFormValue(e.dict.get("AS"));"string"==typeof n&&(this.data.fieldValue=n);const a=null!==this.data.fieldValue&&"Off"!==this.data.fieldValue?this.data.fieldValue:"Yes",s=this._decodeFormValue(i.getKeys());if(0===s.length)s.push("Off",a);else if(1===s.length)"Off"===s[0]?s.push(a):s.unshift("Off");else if(s.includes(a))s.length=0,s.push("Off",a);else{const e=s.find(e=>"Off"!==e);s.length=0,s.push("Off",e)}s.includes(this.data.fieldValue)||(this.data.fieldValue="Off"),this.data.exportValue=s[1];const r=i.get(this.data.exportValue);this.checkedAppearance=r instanceof BaseStream?r:null;const o=i.get("Off");this.uncheckedAppearance=o instanceof BaseStream?o:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,"check"),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict,null===this.data.defaultFieldValue&&(this.data.defaultFieldValue="Off")}_processRadioButton(e){this.data.buttonValue=null;const t=e.dict.get("Parent");if(t instanceof Dict){this.parent=e.dict.getRaw("Parent");const i=t.get("V");i instanceof Name&&(this.data.fieldValue=this._decodeFormValue(i))}const i=e.dict.get("AP");if(!(i instanceof Dict))return;const n=i.get("N");if(!(n instanceof Dict))return;for(const e of n.getKeys())if("Off"!==e){this.data.buttonValue=this._decodeFormValue(e);break}const a=n.get(this.data.buttonValue);this.checkedAppearance=a instanceof BaseStream?a:null;const s=n.get("Off");this.uncheckedAppearance=s instanceof BaseStream?s:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,"disc"),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict,null===this.data.defaultFieldValue&&(this.data.defaultFieldValue="Off")}_processPushButton(e){const{dict:t,annotationGlobals:i}=e;t.has("A")||t.has("AA")||this.data.alternativeText?(this.data.isTooltipOnly=!t.has("A")&&!t.has("AA"),Catalog.parseDestDictionary({destDict:t,resultObj:this.data,docBaseUrl:i.baseUrl,docAttachments:i.attachments})):warn$1("Push buttons without action dictionaries are not supported")}getFieldObject(){let e,t="button";return this.data.checkBox?(t="checkbox",e=this.data.exportValue):this.data.radioButton&&(t="radiobutton",e=this.data.buttonValue),{id:this.data.id,value:this.data.fieldValue||"Off",defaultValue:this.data.defaultFieldValue,exportValues:e,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,hidden:this.data.hidden,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:t}}get fallbackFontDict(){const e=new Dict;return e.setIfName("BaseFont","ZapfDingbats"),e.setIfName("Type","FallbackType"),e.setIfName("Subtype","FallbackType"),e.setIfName("Encoding","ZapfDingbatsEncoding"),shadow$1(this,"fallbackFontDict",e)}}class ChoiceWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);const{dict:t,xref:i}=e;this.indices=t.getArray("I"),this.hasIndices=Array.isArray(this.indices)&&this.indices.length>0,this.data.options=[];const n=getInheritableProperty({dict:t,key:"Opt"});if(Array.isArray(n))for(let e=0,t=n.length;e<t;e++){const t=i.fetchIfRef(n[e]),a=Array.isArray(t);this.data.options[e]={exportValue:this._decodeFormValue(a?i.fetchIfRef(t[0]):t),displayValue:this._decodeFormValue(a?i.fetchIfRef(t[1]):t)}}if(this.hasIndices){this.data.fieldValue=[];const e=this.data.options.length;for(const t of this.indices)Number.isInteger(t)&&t>=0&&t<e&&this.data.fieldValue.push(this.data.options[t].exportValue)}else"string"==typeof this.data.fieldValue?this.data.fieldValue=[this.data.fieldValue]:this.data.fieldValue||=[];0===this.data.options.length&&this.data.fieldValue.length>0&&(this.data.options=this.data.fieldValue.map(e=>({exportValue:e,displayValue:e}))),this.data.combo=this.hasFieldFlag(z),this.data.multiSelect=this.hasFieldFlag(G),this._hasText=!0}getFieldObject(){const e=this.data.combo?"combobox":"listbox",t=this.data.fieldValue.length>0?this.data.fieldValue[0]:null;return{id:this.data.id,value:t,defaultValue:this.data.defaultFieldValue,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,numItems:this.data.fieldValue.length,multipleSelection:this.data.multiSelect,hidden:this.data.hidden,actions:this.data.actions,items:this.data.options,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:e}}amendSavedDict(e,t){if(!this.hasIndices)return;let i=e?.get(this.data.id)?.value;Array.isArray(i)||(i=[i]);const n=[],{options:a}=this.data;for(let e=0,t=0,s=a.length;e<s;e++)a[e].exportValue===i[t]&&(n.push(e),t+=1);t.set("I",n)}async _getAppearance(e,t,n,a){if(this.data.combo)return super._getAppearance(e,t,n,a);let s,r;const o=a?.get(this.data.id);if(o&&(r=o.rotation,s=o.value),void 0===r&&void 0===s&&!this._needAppearances)return null;void 0===s?s=this.data.fieldValue:Array.isArray(s)||(s=[s]);let{width:l,height:c}=this;90!==r&&270!==r||([l,c]=[c,l]);const h=this.data.options.length,d=[];for(let e=0;e<h;e++){const{exportValue:t}=this.data.options[e];s.includes(t)&&d.push(e)}this._defaultAppearance||(this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance="/Helvetica 0 Tf 0 g"));const u=await WidgetAnnotation._getFontData(e,t,this.data.defaultAppearanceData,this._fieldResources.mergedResources);let g,{fontSize:f}=this.data.defaultAppearanceData;if(f)g=this._defaultAppearance;else{const e=(c-1)/h;let t,i=-1;for(const{displayValue:e}of this.data.options){const n=this._getTextWidth(e,u);n>i&&(i=n,t=e)}[g,f]=this._computeFontSize(e,l-4,t,u,-1)}const p=f*i,m=(p-f)/2,b=Math.floor(c/p);let y=0;if(d.length>0){const e=Math.min(...d),t=Math.max(...d);y=Math.max(0,t-b+1),y>e&&(y=e)}const w=Math.min(y+b+1,h),x=["/Tx BMC q",`1 1 ${l} ${c} re W n`];if(d.length){x.push("0.600006 0.756866 0.854904 rg");for(const e of d)y<=e&&e<w&&x.push(`1 ${c-(e-y+1)*p} ${l} ${p} re f`)}x.push("BT",g,`1 0 0 1 0 ${c} Tm`);const S={shift:0};for(let e=y;e<w;e++){const{displayValue:t}=this.data.options[e],i=e===y?m:0;x.push(this._renderText(t,u,f,l,0,S,2,-p+i))}return x.push("ET Q EMC"),x.join("\n")}}class SignatureWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e),this.data.fieldValue=null,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!this.data.hasOwnCanvas}getFieldObject(){return{id:this.data.id,value:null,page:this.data.pageIndex,type:"signature"}}}class TextAnnotation extends MarkupAnnotation{constructor(e){super(e),this.data.noRotate=!0,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;const{dict:t}=e;this.data.annotationType=T.TEXT,this.data.hasAppearance?this.data.name="NoIcon":(this.data.rect[1]=this.data.rect[3]-22,this.data.rect[2]=this.data.rect[0]+22,this.data.name=t.has("Name")?t.get("Name").name:"Note"),t.has("State")?(this.data.state=t.get("State")||null,this.data.stateModel=t.get("StateModel")||null):(this.data.state=null,this.data.stateModel=null)}}class LinkAnnotation extends Annotation{constructor(e){super(e);const{dict:t,annotationGlobals:i}=e;this.data.annotationType=T.LINK,this.data.noHTML=!1;const n=getQuadPoints(t,this.rectangle);n&&(this.data.quadPoints=n),this.data.borderColor||=this.data.color,Catalog.parseDestDictionary({destDict:t,resultObj:this.data,docBaseUrl:i.baseUrl,docAttachments:i.attachments})}get overlaysTextContent(){return!0}}class PopupAnnotation extends Annotation{constructor(e){super(e);const{dict:t}=e;this.data.annotationType=T.POPUP,this.data.noHTML=!1,0!==this.width&&0!==this.height||(this.data.rect=null);let i=t.get("Parent");if(!i)return void warn$1("Popup annotation has a missing or invalid parent annotation.");this.data.parentRect=lookupNormalRect(i.getArray("Rect"),null),this.data.creationDate=i.get("CreationDate")||"";if(isName(i.get("RT"),F)&&(i=i.get("IRT")),i.has("M")?(this.setModificationDate(i.get("M")),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,i.has("C")?(this.setColor(i.getArray("C")),this.data.color=this.color):this.data.color=null,!this.viewable){const e=i.get("F");this._isViewable(e)&&this.setFlags(e)}this.setTitle(i.get("T")),this.data.titleObj=this._title,this.setContents(i.get("Contents")),this.data.contentsObj=this._contents,i.has("RC")&&(this.data.richText=XFAFactory.getRichTextAsHtml(i.get("RC"))),this.data.open=!!t.get("Open")}static createNewDict(e,t,i){const{oldAnnotation:n,rect:a,parent:s}=e,r=n||new Dict(t);return r.setIfNotExists("Type",Name.get("Annot")),r.setIfNotExists("Subtype",Name.get("Popup")),r.setIfNotExists("Open",!1),r.setIfArray("Rect",a),r.set("Parent",s),r}static async createNewAppearanceStream(e,t,i){return null}}class FreeTextAnnotation extends MarkupAnnotation{constructor(e){super(e),this.data.hasOwnCanvas=this.data.noRotate,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1;const{annotationGlobals:t,evaluatorOptions:i,xref:n}=e;if(this.data.annotationType=T.FREETEXT,this.setDefaultAppearance(e),this._hasAppearance=!!this.appearance,this._hasAppearance){const{fontColor:e,fontSize:a}=function(e,t,i,n){return new AppearanceStreamEvaluator(e,t,i,n).parse()}(this.appearance,i,n,t.globalColorSpaceCache);this.data.defaultAppearanceData.fontColor=e,this.data.defaultAppearanceData.fontSize=a||10}else{this.data.defaultAppearanceData.fontSize||=10;const{fontColor:t,fontSize:i}=this.data.defaultAppearanceData;if(this._contents.str){this.data.textContent=this._contents.str.split(/\r\n?|\n/).map(e=>e.trimEnd());const{coords:e,bbox:t,matrix:n}=FakeUnicodeFont.getFirstPositionInfo(this.rectangle,this.rotation,i);this.data.textPosition=this._transformPoint(e,t,n)}if(this._isOffscreenCanvasSupported){const a=e.dict.get("CA"),s=new FakeUnicodeFont(n,"sans-serif");this.appearance=s.createAppearance(this._contents.str,this.rectangle,this.rotation,i,t,a),this._streams.push(this.appearance)}else warn$1("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.")}}get hasTextContent(){return this._hasAppearance}static createNewDict(e,t,{apRef:i,ap:n}){const{color:a,date:s,fontSize:r,oldAnnotation:o,rect:l,rotation:c,user:h,value:d}=e,u=o||new Dict(t);u.setIfNotExists("Type",Name.get("Annot")),u.setIfNotExists("Subtype",Name.get("FreeText")),u.set(o?"M":"CreationDate",`D:${getModificationDate(s)}`),o&&u.delete("RC"),u.setIfArray("Rect",l);const g=`/Helv ${r} Tf ${getPdfColor(a,!0)}`;if(u.set("DA",g),u.setIfDefined("Contents",stringToAsciiOrUTF16BE(d)),u.setIfNotExists("F",4),u.setIfNotExists("Border",[0,0,0]),u.setIfNumber("Rotate",c),u.setIfDefined("T",stringToAsciiOrUTF16BE(h)),i||n){const e=new Dict(t);u.set("AP",e),e.set("N",i||n)}return u}static async createNewAppearanceStream(e,t,n){const{baseFontRef:a,evaluator:s,task:r}=n,{color:o,fontSize:l,rect:c,rotation:h,value:d}=e;if(!o)return null;const u=new Dict(t),g=new Dict(t);if(a)g.set("Helv",a);else{const e=new Dict(t);e.setIfName("BaseFont","Helvetica"),e.setIfName("Type","Font"),e.setIfName("Subtype","Type1"),e.setIfName("Encoding","WinAnsiEncoding"),g.set("Helv",e)}u.set("Font",g);const f=await WidgetAnnotation._getFontData(s,r,{fontName:"Helv",fontSize:l},u),[p,m,b,y]=c;let w=b-p,x=y-m;h%180!=0&&([w,x]=[x,w]);const S=d.split("\n"),v=l/1e3;let C=-1/0;const k=[];for(let e of S){const t=f.encodeString(e);if(t.length>1)return null;e=t.join(""),k.push(e);let i=0;const n=f.charsToGlyphs(e);for(const e of n)i+=e.width*v;C=Math.max(C,i)}let T=1;C>w&&(T=w/C);let F=1;const E=i*l,M=1*l,D=E*S.length;D>x&&(F=x/D);const O=l*Math.min(T,F);let _,R,N;switch(h){case 0:N=[1,0,0,1],R=[c[0],c[1],w,x],_=[c[0],c[3]-M];break;case 90:N=[0,1,-1,0],R=[c[1],-c[2],w,x],_=[c[1],-c[0]-M];break;case 180:N=[-1,0,0,-1],R=[-c[2],-c[3],w,x],_=[-c[2],-c[1]-M];break;case 270:N=[0,-1,1,0],R=[-c[3],c[0],w,x],_=[-c[3],c[2]-M]}const L=["q",`${N.join(" ")} 0 0 cm`,`${R.join(" ")} re W n`,"BT",`${getPdfColor(o,!0)}`,`0 Tc /Helv ${numberToString(O)} Tf`];L.push(`${_.join(" ")} Td (${escapeString(k[0])}) Tj`);const U=numberToString(E);for(let e=1,t=k.length;e<t;e++){const t=k[e];L.push(`0 -${U} Td (${escapeString(t)}) Tj`)}L.push("ET","Q");const j=L.join("\n"),$=new Dict(t);$.set("FormType",1),$.setIfName("Subtype","Form"),$.setIfName("Type","XObject"),$.set("BBox",c),$.set("Resources",u),$.set("Matrix",[1,0,0,1,-c[0],-c[1]]);const H=new StringStream(j);return H.dict=$,H}}class LineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:i}=e;this.data.annotationType=T.LINE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;const n=lookupRect(t.getArray("L"),[0,0,0,0]);if(this.data.lineCoordinates=ai.normalizeRect(n),this.setLineEndings(t.getArray("LE")),this.data.lineEndings=this.lineEndings,!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),a=t.get("CA"),s=getPdfColorArray(getRgbColor(t.getArray("IC"),null)),r=s?a:null,o=this.borderStyle.width||1,l=2*o,c=[this.data.lineCoordinates[0]-l,this.data.lineCoordinates[1]-l,this.data.lineCoordinates[2]+l,this.data.lineCoordinates[3]+l];ai.intersect(this.rectangle,c)||(this.rectangle=c),this._setDefaultAppearance({xref:i,extra:`${o} w`,strokeColor:e,fillColor:s,strokeAlpha:a,fillAlpha:r,pointsCallback:(e,t)=>(e.push(`${n[0]} ${n[1]} m`,`${n[2]} ${n[3]} l`,"S"),[t[0]-o,t[7]-o,t[2]+o,t[3]+o])})}}}class SquareAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:i}=e;if(this.data.annotationType=T.SQUARE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),n=t.get("CA"),a=getPdfColorArray(getRgbColor(t.getArray("IC"),null)),s=a?n:null;if(0===this.borderStyle.width&&!a)return;this._setDefaultAppearance({xref:i,extra:`${this.borderStyle.width} w`,strokeColor:e,fillColor:a,strokeAlpha:n,fillAlpha:s,pointsCallback:(e,t)=>{const i=t[4]+this.borderStyle.width/2,n=t[5]+this.borderStyle.width/2,s=t[6]-t[4]-this.borderStyle.width,r=t[3]-t[7]-this.borderStyle.width;return e.push(`${i} ${n} ${s} ${r} re`),a?e.push("B"):e.push("S"),[t[0],t[7],t[2],t[3]]}})}}}class CircleAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:i}=e;if(this.data.annotationType=T.CIRCLE,!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),n=t.get("CA"),a=getPdfColorArray(getRgbColor(t.getArray("IC"),null)),s=a?n:null;if(0===this.borderStyle.width&&!a)return;const r=4/3*Math.tan(Math.PI/8);this._setDefaultAppearance({xref:i,extra:`${this.borderStyle.width} w`,strokeColor:e,fillColor:a,strokeAlpha:n,fillAlpha:s,pointsCallback:(e,t)=>{const i=t[0]+this.borderStyle.width/2,n=t[1]-this.borderStyle.width/2,s=t[6]-this.borderStyle.width/2,o=t[7]+this.borderStyle.width/2,l=i+(s-i)/2,c=n+(o-n)/2,h=(s-i)/2*r,d=(o-n)/2*r;return e.push(`${l} ${o} m`,`${l+h} ${o} ${s} ${c+d} ${s} ${c} c`,`${s} ${c-d} ${l+h} ${n} ${l} ${n} c`,`${l-h} ${n} ${i} ${c-d} ${i} ${c} c`,`${i} ${c+d} ${l-h} ${o} ${l} ${o} c`,"h"),a?e.push("B"):e.push("S"),[t[0],t[7],t[2],t[3]]}})}}}class PolylineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:i}=e;this.data.annotationType=T.POLYLINE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,this.data.vertices=null,this instanceof PolygonAnnotation||(this.setLineEndings(t.getArray("LE")),this.data.lineEndings=this.lineEndings);const n=t.getArray("Vertices");if(!isNumberArray(n,null))return;const a=this.data.vertices=Float32Array.from(n);if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),n=t.get("CA");let s,r=getRgbColor(t.getArray("IC"),null);r&&(r=getPdfColorArray(r)),s=r?this.color?r.every((t,i)=>t===e[i])?"f":"B":"f":"S";const o=this.borderStyle.width||1,l=2*o,c=[1/0,1/0,-1/0,-1/0];for(let e=0,t=a.length;e<t;e+=2)ai.rectBoundingBox(a[e]-l,a[e+1]-l,a[e]+l,a[e+1]+l,c);ai.intersect(this.rectangle,c)||(this.rectangle=c),this._setDefaultAppearance({xref:i,extra:`${o} w`,strokeColor:e,strokeAlpha:n,fillColor:r,fillAlpha:r?n:null,pointsCallback:(e,t)=>{for(let t=0,i=a.length;t<i;t+=2)e.push(`${a[t]} ${a[t+1]} ${0===t?"m":"l"}`);return e.push(s),[t[0],t[7],t[2],t[3]]}})}}}class PolygonAnnotation extends PolylineAnnotation{constructor(e){super(e),this.data.annotationType=T.POLYGON}}class CaretAnnotation extends MarkupAnnotation{constructor(e){super(e),this.data.annotationType=T.CARET}}class InkAnnotation extends MarkupAnnotation{constructor(e){super(e),this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;const{dict:t,xref:i}=e;this.data.annotationType=T.INK,this.data.inkLists=[],this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1,this.data.opacity=t.get("CA")||1;const n=t.getArray("InkList");if(Array.isArray(n)){for(let e=0,t=n.length;e<t;++e){if(!Array.isArray(n[e]))continue;const t=new Float32Array(n[e].length);this.data.inkLists.push(t);for(let a=0,s=n[e].length;a<s;a+=2){const s=i.fetchIfRef(n[e][a]),r=i.fetchIfRef(n[e][a+1]);"number"==typeof s&&"number"==typeof r&&(t[a]=s,t[a+1]=r)}}if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),n=t.get("CA"),a=this.borderStyle.width||1,s=2*a,r=[1/0,1/0,-1/0,-1/0];for(const e of this.data.inkLists)for(let t=0,i=e.length;t<i;t+=2)ai.rectBoundingBox(e[t]-s,e[t+1]-s,e[t]+s,e[t+1]+s,r);ai.intersect(this.rectangle,r)||(this.rectangle=r),this._setDefaultAppearance({xref:i,extra:`${a} w`,strokeColor:e,strokeAlpha:n,pointsCallback:(e,t)=>{for(const t of this.data.inkLists){for(let i=0,n=t.length;i<n;i+=2)e.push(`${t[i]} ${t[i+1]} ${0===i?"m":"l"}`);e.push("S")}return[t[0],t[7],t[2],t[3]]}})}}}static createNewDict(e,t,{apRef:i,ap:n}){const{oldAnnotation:a,color:s,date:r,opacity:o,paths:l,outlines:c,rect:h,rotation:d,thickness:u,user:g}=e,f=a||new Dict(t);if(f.setIfNotExists("Type",Name.get("Annot")),f.setIfNotExists("Subtype",Name.get("Ink")),f.set(a?"M":"CreationDate",`D:${getModificationDate(r)}`),f.setIfArray("Rect",h),f.setIfArray("InkList",c?.points||l?.points),f.setIfNotExists("F",4),f.setIfNumber("Rotate",d),f.setIfDefined("T",stringToAsciiOrUTF16BE(g)),c&&f.setIfName("IT","InkHighlight"),u>0){const e=new Dict(t);f.set("BS",e),e.set("W",u)}if(f.setIfArray("C",getPdfColorArray(s)),f.setIfNumber("CA",o),n||i){const e=new Dict(t);f.set("AP",e),e.set("N",i||n)}return f}static async createNewAppearanceStream(e,t,i){if(e.outlines)return this.createNewAppearanceStreamForHighlight(e,t,i);const{color:n,rect:a,paths:s,thickness:r,opacity:o}=e;if(!n)return null;const l=[`${r} w 1 J 1 j`,`${getPdfColor(n,!1)}`];1!==o&&l.push("/R0 gs");for(const e of s.lines){l.push(`${numberToString(e[4])} ${numberToString(e[5])} m`);for(let t=6,i=e.length;t<i;t+=6)if(isNaN(e[t]))l.push(`${numberToString(e[t+4])} ${numberToString(e[t+5])} l`);else{const[i,n,a,s,r,o]=e.slice(t,t+6);l.push([i,n,a,s,r,o].map(numberToString).join(" ")+" c")}6===e.length&&l.push(`${numberToString(e[4])} ${numberToString(e[5])} l`)}l.push("S");const c=l.join("\n"),h=new Dict(t);if(h.set("FormType",1),h.setIfName("Subtype","Form"),h.setIfName("Type","XObject"),h.set("BBox",a),h.set("Length",c.length),1!==o){const e=new Dict(t),i=new Dict(t),n=new Dict(t);n.set("CA",o),n.setIfName("Type","ExtGState"),i.set("R0",n),e.set("ExtGState",i),h.set("Resources",e)}const d=new StringStream(c);return d.dict=h,d}static async createNewAppearanceStreamForHighlight(e,t,i){const{color:n,rect:a,outlines:{outline:s},opacity:r}=e;if(!n)return null;const o=[`${getPdfColor(n,!0)}`,"/R0 gs"];o.push(`${numberToString(s[4])} ${numberToString(s[5])} m`);for(let e=6,t=s.length;e<t;e+=6)if(isNaN(s[e]))o.push(`${numberToString(s[e+4])} ${numberToString(s[e+5])} l`);else{const[t,i,n,a,r,l]=s.slice(e,e+6);o.push([t,i,n,a,r,l].map(numberToString).join(" ")+" c")}o.push("h f");const l=o.join("\n"),c=new Dict(t);c.set("FormType",1),c.setIfName("Subtype","Form"),c.setIfName("Type","XObject"),c.set("BBox",a),c.set("Length",l.length);const h=new Dict(t),d=new Dict(t);h.set("ExtGState",d),c.set("Resources",h);const u=new Dict(t);d.set("R0",u),u.setIfName("BM","Multiply"),1!==r&&(u.set("ca",r),u.setIfName("Type","ExtGState"));const g=new StringStream(l);return g.dict=c,g}}class HighlightAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:i}=e;this.data.annotationType=T.HIGHLIGHT,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1,this.data.opacity=t.get("CA")||1;if(this.data.quadPoints=getQuadPoints(t,null)){const e=this.appearance?.dict.get("Resources");if(!this.appearance||!e?.has("ExtGState")){this.appearance&&warn$1("HighlightAnnotation - ignoring built-in appearance stream.");const e=getPdfColorArray(this.color,[1,1,0]),n=t.get("CA");this._setDefaultAppearance({xref:i,fillColor:e,blendMode:"Multiply",fillAlpha:n,pointsCallback:(e,t)=>(e.push(`${t[0]} ${t[1]} m`,`${t[2]} ${t[3]} l`,`${t[6]} ${t[7]} l`,`${t[4]} ${t[5]} l`,"f"),[t[0],t[7],t[2],t[3]])})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}static createNewDict(e,t,{apRef:i,ap:n}){const{color:a,date:s,oldAnnotation:r,opacity:o,rect:l,rotation:c,user:h,quadPoints:d}=e,u=r||new Dict(t);if(u.setIfNotExists("Type",Name.get("Annot")),u.setIfNotExists("Subtype",Name.get("Highlight")),u.set(r?"M":"CreationDate",`D:${getModificationDate(s)}`),u.setIfArray("Rect",l),u.setIfNotExists("F",4),u.setIfNotExists("Border",[0,0,0]),u.setIfNumber("Rotate",c),u.setIfArray("QuadPoints",d),u.setIfArray("C",getPdfColorArray(a)),u.setIfNumber("CA",o),u.setIfDefined("T",stringToAsciiOrUTF16BE(h)),i||n){const e=new Dict(t);u.set("AP",e),e.set("N",i||n)}return u}static async createNewAppearanceStream(e,t,i){const{color:n,rect:a,outlines:s,opacity:r}=e;if(!n)return null;const o=[`${getPdfColor(n,!0)}`,"/R0 gs"],l=[];for(const e of s){l.length=0,l.push(`${numberToString(e[0])} ${numberToString(e[1])} m`);for(let t=2,i=e.length;t<i;t+=2)l.push(`${numberToString(e[t])} ${numberToString(e[t+1])} l`);l.push("h"),o.push(l.join("\n"))}o.push("f*");const c=o.join("\n"),h=new Dict(t);h.set("FormType",1),h.setIfName("Subtype","Form"),h.setIfName("Type","XObject"),h.set("BBox",a),h.set("Length",c.length);const d=new Dict(t),u=new Dict(t);d.set("ExtGState",u),h.set("Resources",d);const g=new Dict(t);u.set("R0",g),g.setIfName("BM","Multiply"),1!==r&&(g.set("ca",r),g.setIfName("Type","ExtGState"));const f=new StringStream(c);return f.dict=h,f}}class UnderlineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:i}=e;this.data.annotationType=T.UNDERLINE;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),n=t.get("CA");this._setDefaultAppearance({xref:i,extra:"[] 0 d 0.571 w",strokeColor:e,strokeAlpha:n,pointsCallback:(e,t)=>(e.push(`${t[4]} ${t[5]+1.3} m`,`${t[6]} ${t[7]+1.3} l`,"S"),[t[0],t[7],t[2],t[3]])})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}}class SquigglyAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:i}=e;this.data.annotationType=T.SQUIGGLY;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),n=t.get("CA");this._setDefaultAppearance({xref:i,extra:"[] 0 d 1 w",strokeColor:e,strokeAlpha:n,pointsCallback:(e,t)=>{const i=(t[1]-t[5])/6;let n=i,a=t[4];const s=t[5],r=t[6];e.push(`${a} ${s+n} m`);do{a+=2,n=0===n?i:0,e.push(`${a} ${s+n} l`)}while(a<r);return e.push("S"),[t[4],s-2*i,r,s+2*i]}})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}}class StrikeOutAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:i}=e;this.data.annotationType=T.STRIKEOUT;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),n=t.get("CA");this._setDefaultAppearance({xref:i,extra:"[] 0 d 1 w",strokeColor:e,strokeAlpha:n,pointsCallback:(e,t)=>(e.push((t[0]+t[4])/2+" "+(t[1]+t[5])/2+" m",(t[2]+t[6])/2+" "+(t[3]+t[7])/2+" l","S"),[t[0],t[7],t[2],t[3]])})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}}class StampAnnotation extends MarkupAnnotation{#ke=null;constructor(e){super(e),this.data.annotationType=T.STAMP,this.data.hasOwnCanvas=this.data.noRotate,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1}mustBeViewedWhenEditing(e,t=null){return e?!this.data.isEditable||(this.#ke??=this.data.hasOwnCanvas,this.data.hasOwnCanvas=!0,!0):(null!==this.#ke&&(this.data.hasOwnCanvas=this.#ke,this.#ke=null),!t?.has(this.data.id))}static async createImage(e,t){const{width:i,height:n}=e,a=new OffscreenCanvas(i,n),s=a.getContext("2d",{alpha:!0});s.drawImage(e,0,0);const r=s.getImageData(0,0,i,n).data,o=new Uint32Array(r.buffer),l=o.some(FeatureTest.isLittleEndian?e=>e>>>24!=255:e=>!!(255&~e));l&&(s.fillStyle="white",s.fillRect(0,0,i,n),s.drawImage(e,0,0));const c=a.convertToBlob({type:"image/jpeg",quality:1}).then(e=>e.arrayBuffer()),h=Name.get("XObject"),d=Name.get("Image"),u=new Dict(t);u.set("Type",h),u.set("Subtype",d),u.set("BitsPerComponent",8),u.setIfName("ColorSpace","DeviceRGB"),u.setIfName("Filter","DCTDecode"),u.set("BBox",[0,0,i,n]),u.set("Width",i),u.set("Height",n);let g=null;if(l){const e=new Uint8Array(o.length);if(FeatureTest.isLittleEndian)for(let t=0,i=o.length;t<i;t++)e[t]=o[t]>>>24;else for(let t=0,i=o.length;t<i;t++)e[t]=255&o[t];const a=new Dict(t);a.set("Type",h),a.set("Subtype",d),a.set("BitsPerComponent",8),a.setIfName("ColorSpace","DeviceGray"),a.set("Width",i),a.set("Height",n),g=new Stream(e,0,0,a)}return{imageStream:new Stream(await c,0,0,u),smaskStream:g,width:i,height:n}}static createNewDict(e,t,{apRef:i,ap:n}){const{date:a,oldAnnotation:s,rect:r,rotation:o,user:l}=e,c=s||new Dict(t);if(c.setIfNotExists("Type",Name.get("Annot")),c.setIfNotExists("Subtype",Name.get("Stamp")),c.set(s?"M":"CreationDate",`D:${getModificationDate(a)}`),c.setIfArray("Rect",r),c.setIfNotExists("F",4),c.setIfNotExists("Border",[0,0,0]),c.setIfNumber("Rotate",o),c.setIfDefined("T",stringToAsciiOrUTF16BE(l)),i||n){const e=new Dict(t);c.set("AP",e),e.set("N",i||n)}return c}static async#Te(e,t){const{areContours:i,color:n,rect:a,lines:s,thickness:r}=e;if(!n)return null;const o=[`${r} w 1 J 1 j`,`${getPdfColor(n,i)}`];for(const e of s){o.push(`${numberToString(e[4])} ${numberToString(e[5])} m`);for(let t=6,i=e.length;t<i;t+=6)if(isNaN(e[t]))o.push(`${numberToString(e[t+4])} ${numberToString(e[t+5])} l`);else{const[i,n,a,s,r,l]=e.slice(t,t+6);o.push([i,n,a,s,r,l].map(numberToString).join(" ")+" c")}6===e.length&&o.push(`${numberToString(e[4])} ${numberToString(e[5])} l`)}o.push(i?"F":"S");const l=o.join("\n"),c=new Dict(t);c.set("FormType",1),c.setIfName("Subtype","Form"),c.setIfName("Type","XObject"),c.set("BBox",a),c.set("Length",l.length);const h=new StringStream(l);return h.dict=c,h}static async createNewAppearanceStream(e,t,i){if(e.oldAnnotation)return null;if(e.isSignature)return this.#Te(e,t);const{rotation:n}=e,{imageRef:a,width:s,height:r}=i.image,o=new Dict(t),l=new Dict(t);o.set("XObject",l),l.set("Im0",a);const c=`q ${s} 0 0 ${r} 0 0 cm /Im0 Do Q`,h=new Dict(t);if(h.set("FormType",1),h.setIfName("Subtype","Form"),h.setIfName("Type","XObject"),h.set("BBox",[0,0,s,r]),h.set("Resources",o),n){const e=getRotationMatrix(n,s,r);h.set("Matrix",e)}const d=new StringStream(c);return d.dict=h,d}}class FileAttachmentAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:i}=e,n=new FileSpec(t.get("FS"),i);this.data.annotationType=T.FILEATTACHMENT,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,this.data.file=n.serializable;const a=t.get("Name");this.data.name=a instanceof Name?stringToPDFString(a.name):"PushPin";const s=t.get("ca");this.data.fillAlpha="number"==typeof s&&s>=0&&s<=1?s:null}}const cl={get r(){return shadow$1(this,"r",new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]))},get k(){return shadow$1(this,"k",new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]))}};function calculateMD5(e,t,i){let n=1732584193,a=-271733879,s=-1732584194,r=271733878;const o=i+72&-64,l=new Uint8Array(o);let c,h;for(c=0;c<i;++c)l[c]=e[t++];l[c++]=128;const d=o-8;c<d&&(c=d),l[c++]=i<<3&255,l[c++]=i>>5&255,l[c++]=i>>13&255,l[c++]=i>>21&255,l[c++]=i>>>29&255,c+=3;const u=new Int32Array(16),{k:g,r:f}=cl;for(c=0;c<o;){for(h=0;h<16;++h,c+=4)u[h]=l[c]|l[c+1]<<8|l[c+2]<<16|l[c+3]<<24;let e,t,i=n,o=a,d=s,p=r;for(h=0;h<64;++h){h<16?(e=o&d|~o&p,t=h):h<32?(e=p&o|~p&d,t=5*h+1&15):h<48?(e=o^d^p,t=3*h+5&15):(e=d^(o|~p),t=7*h&15);const n=p,a=i+e+g[h]+u[t]|0,s=f[h];p=d,d=o,o=o+(a<<s|a>>>32-s)|0,i=n}n=n+i|0,a=a+o|0,s=s+d|0,r=r+p|0}return new Uint8Array([255&n,n>>8&255,n>>16&255,n>>>24&255,255&a,a>>8&255,a>>16&255,a>>>24&255,255&s,s>>8&255,s>>16&255,s>>>24&255,255&r,r>>8&255,r>>16&255,r>>>24&255])}function decodeString(e){try{return stringToUTF8String$1(e)}catch(t){return warn$1(`UTF-8 decoding failed: "${t}".`),e}}class DatasetXMLParser extends SimpleXMLParser{constructor(e){super(e),this.node=null}onEndElement(e){const t=super.onEndElement(e);if(t&&"xfa:datasets"===e)throw this.node=t,new Error("Aborting DatasetXMLParser.")}}class DatasetReader{constructor(e){if(e.datasets)this.node=new SimpleXMLParser({hasAttributes:!0}).parseFromString(e.datasets).documentElement;else{const t=new DatasetXMLParser({hasAttributes:!0});try{t.parseFromString(e["xdp:xdp"])}catch{}this.node=t.node}}getValue(e){if(!this.node||!e)return"";const t=this.node.searchNode(parseXFAPath(e),0);if(!t)return"";const i=t.firstChild;return"value"===i?.nodeName?t.children.map(e=>decodeString(e.textContent)):decodeString(t.textContent)}}class SingleIntersector{#Fe;#Ie=1/0;#Ee=1/0;#Me=-1/0;#De=-1/0;#Oe=null;#_e=[];#Pe=[];#Re=-1;#Be=!1;constructor(e){this.#Fe=e;const t=e.data.quadPoints;if(t){for(let e=0,i=t.length;e<i;e+=8)this.#Ie=Math.min(this.#Ie,t[e]),this.#Me=Math.max(this.#Me,t[e+2]),this.#Ee=Math.min(this.#Ee,t[e+5]),this.#De=Math.max(this.#De,t[e+1]);t.length>8&&(this.#Oe=t)}else[this.#Ie,this.#Ee,this.#Me,this.#De]=e.data.rect}overlaps(e){return!(this.#Ie>=e.#Me||this.#Me<=e.#Ie||this.#Ee>=e.#De||this.#De<=e.#Ee)}#Ne(e,t){if(this.#Ie>=e||this.#Me<=e||this.#Ee>=t||this.#De<=t)return!1;const i=this.#Oe;if(!i)return!0;if(this.#Re>=0){const n=this.#Re;if(!(i[n]>=e||i[n+2]<=e||i[n+5]>=t||i[n+1]<=t))return!0;this.#Re=-1}for(let n=0,a=i.length;n<a;n+=8)if(!(i[n]>=e||i[n+2]<=e||i[n+5]>=t||i[n+1]<=t))return this.#Re=n,!0;return!1}addGlyph(e,t,i){return this.#Ne(e,t)?(this.#Pe.length>0&&(this.#_e.push(this.#Pe.join("")),this.#Pe.length=0),this.#_e.push(i),this.#Be=!0,!0):(this.disableExtraChars(),!1)}addExtraChar(e){this.#Be&&this.#Pe.push(e)}disableExtraChars(){this.#Be&&(this.#Be=!1,this.#Pe.length=0)}setText(){this.#Fe.data.overlaidText=this.#_e.join("")}}class Intersector{#Le=new Map;constructor(e){for(const t of e){if(!t.data.quadPoints&&!t.data.rect)continue;const e=new SingleIntersector(t);for(const[t,i]of this.#Le)t.overlaps(e)&&(i?i.add(e):this.#Le.set(t,new Set([e])));this.#Le.set(e,null)}}addGlyph(e,t,i,n){const a=e[4]+t/2,s=e[5]+i/2;let r;for(const[e,t]of this.#Le)r?r.has(e)?e.addGlyph(a,s,n):e.disableExtraChars():e.addGlyph(a,s,n)&&(r=t)}addExtraChar(e){for(const t of this.#Le.keys())t.addExtraChar(e)}setText(){for(const e of this.#Le.keys())e.setText()}}class Word64{constructor(e,t){this.high=0|e,this.low=0|t}and(e){this.high&=e.high,this.low&=e.low}xor(e){this.high^=e.high,this.low^=e.low}shiftRight(e){e>=32?(this.low=this.high>>>e-32|0,this.high=0):(this.low=this.low>>>e|this.high<<32-e,this.high=this.high>>>e|0)}rotateRight(e){let t,i;32&e?(i=this.low,t=this.high):(t=this.low,i=this.high),e&=31,this.low=t>>>e|i<<32-e,this.high=i>>>e|t<<32-e}not(){this.high=~this.high,this.low=~this.low}add(e){const t=(this.low>>>0)+(e.low>>>0);let i=(this.high>>>0)+(e.high>>>0);t>4294967295&&(i+=1),this.low=0|t,this.high=0|i}copyTo(e,t){e[t]=this.high>>>24&255,e[t+1]=this.high>>16&255,e[t+2]=this.high>>8&255,e[t+3]=255&this.high,e[t+4]=this.low>>>24&255,e[t+5]=this.low>>16&255,e[t+6]=this.low>>8&255,e[t+7]=255&this.low}assign(e){this.high=e.high,this.low=e.low}}const hl={get k(){return shadow$1(this,"k",[new Word64(1116352408,3609767458),new Word64(1899447441,602891725),new Word64(3049323471,3964484399),new Word64(3921009573,2173295548),new Word64(961987163,4081628472),new Word64(1508970993,3053834265),new Word64(2453635748,2937671579),new Word64(2870763221,3664609560),new Word64(3624381080,2734883394),new Word64(310598401,1164996542),new Word64(607225278,1323610764),new Word64(1426881987,3590304994),new Word64(1925078388,4068182383),new Word64(2162078206,991336113),new Word64(2614888103,633803317),new Word64(3248222580,3479774868),new Word64(3835390401,2666613458),new Word64(4022224774,944711139),new Word64(264347078,2341262773),new Word64(604807628,2007800933),new Word64(770255983,1495990901),new Word64(1249150122,1856431235),new Word64(1555081692,3175218132),new Word64(1996064986,2198950837),new Word64(2554220882,3999719339),new Word64(2821834349,766784016),new Word64(2952996808,2566594879),new Word64(3210313671,3203337956),new Word64(3336571891,1034457026),new Word64(3584528711,2466948901),new Word64(113926993,3758326383),new Word64(338241895,168717936),new Word64(666307205,1188179964),new Word64(773529912,1546045734),new Word64(1294757372,1522805485),new Word64(1396182291,2643833823),new Word64(1695183700,2343527390),new Word64(1986661051,1014477480),new Word64(2177026350,1206759142),new Word64(2456956037,344077627),new Word64(2730485921,1290863460),new Word64(2820302411,3158454273),new Word64(3259730800,3505952657),new Word64(3345764771,106217008),new Word64(3516065817,3606008344),new Word64(3600352804,1432725776),new Word64(4094571909,1467031594),new Word64(275423344,851169720),new Word64(430227734,3100823752),new Word64(506948616,1363258195),new Word64(659060556,3750685593),new Word64(883997877,3785050280),new Word64(958139571,3318307427),new Word64(1322822218,3812723403),new Word64(1537002063,2003034995),new Word64(1747873779,3602036899),new Word64(1955562222,1575990012),new Word64(2024104815,1125592928),new Word64(2227730452,2716904306),new Word64(2361852424,442776044),new Word64(2428436474,593698344),new Word64(2756734187,3733110249),new Word64(3204031479,2999351573),new Word64(3329325298,3815920427),new Word64(3391569614,3928383900),new Word64(3515267271,566280711),new Word64(3940187606,3454069534),new Word64(4118630271,4000239992),new Word64(116418474,1914138554),new Word64(174292421,2731055270),new Word64(289380356,3203993006),new Word64(460393269,320620315),new Word64(685471733,587496836),new Word64(852142971,1086792851),new Word64(1017036298,365543100),new Word64(1126000580,2618297676),new Word64(1288033470,3409855158),new Word64(1501505948,4234509866),new Word64(1607167915,987167468),new Word64(1816402316,1246189591)])}};function ch(e,t,i,n,a){e.assign(t),e.and(i),a.assign(t),a.not(),a.and(n),e.xor(a)}function maj(e,t,i,n,a){e.assign(t),e.and(i),a.assign(t),a.and(n),e.xor(a),a.assign(i),a.and(n),e.xor(a)}function sigma(e,t,i){e.assign(t),e.rotateRight(28),i.assign(t),i.rotateRight(34),e.xor(i),i.assign(t),i.rotateRight(39),e.xor(i)}function sigmaPrime(e,t,i){e.assign(t),e.rotateRight(14),i.assign(t),i.rotateRight(18),e.xor(i),i.assign(t),i.rotateRight(41),e.xor(i)}function littleSigma(e,t,i){e.assign(t),e.rotateRight(1),i.assign(t),i.rotateRight(8),e.xor(i),i.assign(t),i.shiftRight(7),e.xor(i)}function littleSigmaPrime(e,t,i){e.assign(t),e.rotateRight(19),i.assign(t),i.rotateRight(61),e.xor(i),i.assign(t),i.shiftRight(6),e.xor(i)}function calculateSHA512(e,t,i,n=!1){let a,s,r,o,l,c,h,d;n?(a=new Word64(3418070365,3238371032),s=new Word64(1654270250,914150663),r=new Word64(2438529370,812702999),o=new Word64(355462360,4144912697),l=new Word64(1731405415,4290775857),c=new Word64(2394180231,1750603025),h=new Word64(3675008525,1694076839),d=new Word64(1203062813,3204075428)):(a=new Word64(1779033703,4089235720),s=new Word64(3144134277,2227873595),r=new Word64(1013904242,4271175723),o=new Word64(2773480762,1595750129),l=new Word64(1359893119,2917565137),c=new Word64(2600822924,725511199),h=new Word64(528734635,4215389547),d=new Word64(1541459225,327033209));const u=128*Math.ceil((i+17)/128),g=new Uint8Array(u);let f,p;for(f=0;f<i;++f)g[f]=e[t++];g[f++]=128;const m=u-16;f<m&&(f=m),f+=11,g[f++]=i>>>29&255,g[f++]=i>>21&255,g[f++]=i>>13&255,g[f++]=i>>5&255,g[f++]=i<<3&255;const b=new Array(80);for(f=0;f<80;f++)b[f]=new Word64(0,0);const{k:y}=hl;let w=new Word64(0,0),x=new Word64(0,0),S=new Word64(0,0),v=new Word64(0,0),C=new Word64(0,0),k=new Word64(0,0),T=new Word64(0,0),F=new Word64(0,0);const E=new Word64(0,0),M=new Word64(0,0),D=new Word64(0,0),O=new Word64(0,0);let _,R;for(f=0;f<u;){for(p=0;p<16;++p)b[p].high=g[f]<<24|g[f+1]<<16|g[f+2]<<8|g[f+3],b[p].low=g[f+4]<<24|g[f+5]<<16|g[f+6]<<8|g[f+7],f+=8;for(p=16;p<80;++p)_=b[p],littleSigmaPrime(_,b[p-2],O),_.add(b[p-7]),littleSigma(D,b[p-15],O),_.add(D),_.add(b[p-16]);for(w.assign(a),x.assign(s),S.assign(r),v.assign(o),C.assign(l),k.assign(c),T.assign(h),F.assign(d),p=0;p<80;++p)E.assign(F),sigmaPrime(D,C,O),E.add(D),ch(D,C,k,T,O),E.add(D),E.add(y[p]),E.add(b[p]),sigma(M,w,O),maj(D,w,x,S,O),M.add(D),_=F,F=T,T=k,k=C,v.add(E),C=v,v=S,S=x,x=w,_.assign(E),_.add(M),w=_;a.add(w),s.add(x),r.add(S),o.add(v),l.add(C),c.add(k),h.add(T),d.add(F)}return n?(R=new Uint8Array(48),a.copyTo(R,0),s.copyTo(R,8),r.copyTo(R,16),o.copyTo(R,24),l.copyTo(R,32),c.copyTo(R,40)):(R=new Uint8Array(64),a.copyTo(R,0),s.copyTo(R,8),r.copyTo(R,16),o.copyTo(R,24),l.copyTo(R,32),c.copyTo(R,40),h.copyTo(R,48),d.copyTo(R,56)),R}function calculateSHA384(e,t,i){return calculateSHA512(e,t,i,!0)}const dl={get k(){return shadow$1(this,"k",[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])}};function rotr(e,t){return e>>>t|e<<32-t}function calculate_sha256_ch(e,t,i){return e&t^~e&i}function calculate_sha256_maj(e,t,i){return e&t^e&i^t&i}function calculate_sha256_sigma(e){return rotr(e,2)^rotr(e,13)^rotr(e,22)}function calculate_sha256_sigmaPrime(e){return rotr(e,6)^rotr(e,11)^rotr(e,25)}function calculate_sha256_littleSigma(e){return rotr(e,7)^rotr(e,18)^e>>>3}function calculate_sha256_littleSigmaPrime(e){return rotr(e,17)^rotr(e,19)^e>>>10}function calculateSHA256(e,t,i){let n=1779033703,a=3144134277,s=1013904242,r=2773480762,o=1359893119,l=2600822924,c=528734635,h=1541459225;const d=64*Math.ceil((i+9)/64),u=new Uint8Array(d);let g,f;for(g=0;g<i;++g)u[g]=e[t++];u[g++]=128;const p=d-8;g<p&&(g=p),g+=3,u[g++]=i>>>29&255,u[g++]=i>>21&255,u[g++]=i>>13&255,u[g++]=i>>5&255,u[g++]=i<<3&255;const m=new Uint32Array(64),{k:b}=dl;for(g=0;g<d;){for(f=0;f<16;++f)m[f]=u[g]<<24|u[g+1]<<16|u[g+2]<<8|u[g+3],g+=4;for(f=16;f<64;++f)m[f]=calculate_sha256_littleSigmaPrime(m[f-2])+m[f-7]+calculate_sha256_littleSigma(m[f-15])+m[f-16]|0;let e,t,i=n,d=a,p=s,y=r,w=o,x=l,S=c,v=h;for(f=0;f<64;++f)e=v+calculate_sha256_sigmaPrime(w)+calculate_sha256_ch(w,x,S)+b[f]+m[f],t=calculate_sha256_sigma(i)+calculate_sha256_maj(i,d,p),v=S,S=x,x=w,w=y+e|0,y=p,p=d,d=i,i=e+t|0;n=n+i|0,a=a+d|0,s=s+p|0,r=r+y|0,o=o+w|0,l=l+x|0,c=c+S|0,h=h+v|0}return new Uint8Array([n>>24&255,n>>16&255,n>>8&255,255&n,a>>24&255,a>>16&255,a>>8&255,255&a,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r,o>>24&255,o>>16&255,o>>8&255,255&o,l>>24&255,l>>16&255,l>>8&255,255&l,c>>24&255,c>>16&255,c>>8&255,255&c,h>>24&255,h>>16&255,h>>8&255,255&h])}class DecryptStream extends DecodeStream{constructor(e,t,i){super(t),this.str=e,this.dict=e.dict,this.decrypt=i,this.nextChunk=null,this.initialized=!1}readBlock(){let e;if(this.initialized?e=this.nextChunk:(e=this.str.getBytes(512),this.initialized=!0),!e?.length)return void(this.eof=!0);this.nextChunk=this.str.getBytes(512);const t=this.nextChunk?.length>0;e=(0,this.decrypt)(e,!t);const i=this.bufferLength,n=i+e.length;this.ensureBuffer(n).set(e,i),this.bufferLength=n}}class ARCFourCipher{constructor(e){this.a=0,this.b=0;const t=new Uint8Array(256),i=e.length;for(let e=0;e<256;++e)t[e]=e;for(let n=0,a=0;n<256;++n){const s=t[n];a=a+s+e[n%i]&255,t[n]=t[a],t[a]=s}this.s=t}encryptBlock(e){let t=this.a,i=this.b;const n=this.s,a=e.length,s=new Uint8Array(a);for(let r=0;r<a;++r){t=t+1&255;const a=n[t];i=i+a&255;const o=n[i];n[t]=o,n[i]=a,s[r]=e[r]^n[a+o&255]}return this.a=t,this.b=i,s}decryptBlock(e){return this.encryptBlock(e)}encrypt(e){return this.encryptBlock(e)}}class NullCipher{decryptBlock(e){return e}encrypt(e){return e}}class AESBaseCipher{_s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]);_inv_s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]);_mix=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795]);_mixCol=new Uint8Array(256).map((e,t)=>t<128?t<<1:t<<1^27);constructor(){this.buffer=new Uint8Array(16),this.bufferPosition=0}_expandKey(e){unreachable$1("Cannot call `_expandKey` on the base class")}_decrypt(e,t){let i,n,a;const s=new Uint8Array(16);s.set(e);for(let e=0,i=this._keySize;e<16;++e,++i)s[e]^=t[i];for(let e=this._cyclesOfRepetition-1;e>=1;--e){i=s[13],s[13]=s[9],s[9]=s[5],s[5]=s[1],s[1]=i,i=s[14],n=s[10],s[14]=s[6],s[10]=s[2],s[6]=i,s[2]=n,i=s[15],n=s[11],a=s[7],s[15]=s[3],s[11]=i,s[7]=n,s[3]=a;for(let e=0;e<16;++e)s[e]=this._inv_s[s[e]];for(let i=0,n=16*e;i<16;++i,++n)s[i]^=t[n];for(let e=0;e<16;e+=4){const t=this._mix[s[e]],n=this._mix[s[e+1]],a=this._mix[s[e+2]],r=this._mix[s[e+3]];i=t^n>>>8^n<<24^a>>>16^a<<16^r>>>24^r<<8,s[e]=i>>>24&255,s[e+1]=i>>16&255,s[e+2]=i>>8&255,s[e+3]=255&i}}i=s[13],s[13]=s[9],s[9]=s[5],s[5]=s[1],s[1]=i,i=s[14],n=s[10],s[14]=s[6],s[10]=s[2],s[6]=i,s[2]=n,i=s[15],n=s[11],a=s[7],s[15]=s[3],s[11]=i,s[7]=n,s[3]=a;for(let e=0;e<16;++e)s[e]=this._inv_s[s[e]],s[e]^=t[e];return s}_encrypt(e,t){const i=this._s;let n,a,s;const r=new Uint8Array(16);r.set(e);for(let e=0;e<16;++e)r[e]^=t[e];for(let e=1;e<this._cyclesOfRepetition;e++){for(let e=0;e<16;++e)r[e]=i[r[e]];s=r[1],r[1]=r[5],r[5]=r[9],r[9]=r[13],r[13]=s,s=r[2],a=r[6],r[2]=r[10],r[6]=r[14],r[10]=s,r[14]=a,s=r[3],a=r[7],n=r[11],r[3]=r[15],r[7]=s,r[11]=a,r[15]=n;for(let e=0;e<16;e+=4){const t=r[e],i=r[e+1],a=r[e+2],s=r[e+3];n=t^i^a^s,r[e]^=n^this._mixCol[t^i],r[e+1]^=n^this._mixCol[i^a],r[e+2]^=n^this._mixCol[a^s],r[e+3]^=n^this._mixCol[s^t]}for(let i=0,n=16*e;i<16;++i,++n)r[i]^=t[n]}for(let e=0;e<16;++e)r[e]=i[r[e]];s=r[1],r[1]=r[5],r[5]=r[9],r[9]=r[13],r[13]=s,s=r[2],a=r[6],r[2]=r[10],r[6]=r[14],r[10]=s,r[14]=a,s=r[3],a=r[7],n=r[11],r[3]=r[15],r[7]=s,r[11]=a,r[15]=n;for(let e=0,i=this._keySize;e<16;++e,++i)r[e]^=t[i];return r}_decryptBlock2(e,t){const i=e.length;let n=this.buffer,a=this.bufferPosition;const s=[];let r=this.iv;for(let t=0;t<i;++t){if(n[a]=e[t],++a,a<16)continue;const i=this._decrypt(n,this._key);for(let e=0;e<16;++e)i[e]^=r[e];r=n,s.push(i),n=new Uint8Array(16),a=0}if(this.buffer=n,this.bufferLength=a,this.iv=r,0===s.length)return new Uint8Array(0);let o=16*s.length;if(t){const e=s.at(-1);let t=e[15];if(t<=16){for(let i=15,n=16-t;i>=n;--i)if(e[i]!==t){t=0;break}o-=t,s[s.length-1]=e.subarray(0,16-t)}}const l=new Uint8Array(o);for(let e=0,t=0,i=s.length;e<i;++e,t+=16)l.set(s[e],t);return l}decryptBlock(e,t,i=null){const n=e.length,a=this.buffer;let s=this.bufferPosition;if(i)this.iv=i;else{for(let t=0;s<16&&t<n;++t,++s)a[s]=e[t];if(s<16)return this.bufferLength=s,new Uint8Array(0);this.iv=a,e=e.subarray(16)}return this.buffer=new Uint8Array(16),this.bufferLength=0,this.decryptBlock=this._decryptBlock2,this.decryptBlock(e,t)}encrypt(e,t){const i=e.length;let n=this.buffer,a=this.bufferPosition;const s=[];t||=new Uint8Array(16);for(let r=0;r<i;++r){if(n[a]=e[r],++a,a<16)continue;for(let e=0;e<16;++e)n[e]^=t[e];const i=this._encrypt(n,this._key);t=i,s.push(i),n=new Uint8Array(16),a=0}if(this.buffer=n,this.bufferLength=a,this.iv=t,0===s.length)return new Uint8Array(0);const r=16*s.length,o=new Uint8Array(r);for(let e=0,t=0,i=s.length;e<i;++e,t+=16)o.set(s[e],t);return o}}class AES128Cipher extends AESBaseCipher{_rcon=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141]);constructor(e){super(),this._cyclesOfRepetition=10,this._keySize=160,this._key=this._expandKey(e)}_expandKey(e){const t=this._s,i=this._rcon,n=new Uint8Array(176);n.set(e);for(let e=16,a=1;e<176;++a){let s=n[e-3],r=n[e-2],o=n[e-1],l=n[e-4];s=t[s],r=t[r],o=t[o],l=t[l],s^=i[a];for(let t=0;t<4;++t)n[e]=s^=n[e-16],e++,n[e]=r^=n[e-16],e++,n[e]=o^=n[e-16],e++,n[e]=l^=n[e-16],e++}return n}}class AES256Cipher extends AESBaseCipher{constructor(e){super(),this._cyclesOfRepetition=14,this._keySize=224,this._key=this._expandKey(e)}_expandKey(e){const t=this._s,i=new Uint8Array(240);i.set(e);let n,a,s,r,o=1;for(let e=32,l=1;e<240;++l){e%32==16?(n=t[n],a=t[a],s=t[s],r=t[r]):e%32==0&&(n=i[e-3],a=i[e-2],s=i[e-1],r=i[e-4],n=t[n],a=t[a],s=t[s],r=t[r],n^=o,(o<<=1)>=256&&(o=255&(27^o)));for(let t=0;t<4;++t)i[e]=n^=i[e-32],e++,i[e]=a^=i[e-32],e++,i[e]=s^=i[e-32],e++,i[e]=r^=i[e-32],e++}return i}}class PDFBase{_hash(e,t,i){unreachable$1("Abstract method `_hash` called")}checkOwnerPassword(e,t,i,n){const a=new Uint8Array(e.length+56);a.set(e,0),a.set(t,e.length),a.set(i,e.length+t.length);return isArrayEqual(this._hash(e,a,i),n)}checkUserPassword(e,t,i){const n=new Uint8Array(e.length+8);n.set(e,0),n.set(t,e.length);return isArrayEqual(this._hash(e,n,[]),i)}getOwnerKey(e,t,i,n){const a=new Uint8Array(e.length+56);a.set(e,0),a.set(t,e.length),a.set(i,e.length+t.length);const s=this._hash(e,a,i);return new AES256Cipher(s).decryptBlock(n,!1,new Uint8Array(16))}getUserKey(e,t,i){const n=new Uint8Array(e.length+8);n.set(e,0),n.set(t,e.length);const a=this._hash(e,n,[]);return new AES256Cipher(a).decryptBlock(i,!1,new Uint8Array(16))}}class PDF17 extends PDFBase{_hash(e,t,i){return calculateSHA256(t,0,t.length)}}class PDF20 extends PDFBase{_hash(e,t,i){let n=calculateSHA256(t,0,t.length).subarray(0,32),a=[0],s=0;for(;s<64||a.at(-1)>s-32;){const t=e.length+n.length+i.length,r=new Uint8Array(t);let o=0;r.set(e,o),o+=e.length,r.set(n,o),o+=n.length,r.set(i,o);const l=new Uint8Array(64*t);for(let e=0,i=0;e<64;e++,i+=t)l.set(r,i);a=new AES128Cipher(n.subarray(0,16)).encrypt(l,n.subarray(16,32));const c=Math.sumPrecise(a.slice(0,16))%3;0===c?n=calculateSHA256(a,0,a.length):1===c?n=calculateSHA384(a,0,a.length):2===c&&(n=calculateSHA512(a,0,a.length)),s++}return n.subarray(0,32)}}class CipherTransform{constructor(e,t){this.StringCipherConstructor=e,this.StreamCipherConstructor=t}createStream(e,t){const i=new this.StreamCipherConstructor;return new DecryptStream(e,t,function(e,t){return i.decryptBlock(e,t)})}decryptString(e){const t=new this.StringCipherConstructor;let i=stringToBytes$1(e);return i=t.decryptBlock(i,!0),bytesToString$1(i)}encryptString(e){const t=new this.StringCipherConstructor;if(t instanceof AESBaseCipher){const i=16-e.length%16;e+=String.fromCharCode(i).repeat(i);const n=new Uint8Array(16);crypto.getRandomValues(n);let a=stringToBytes$1(e);a=t.encrypt(a,n);const s=new Uint8Array(16+a.length);return s.set(n),s.set(a,16),bytesToString$1(s)}let i=stringToBytes$1(e);return i=t.encrypt(i),bytesToString$1(i)}}class CipherTransformFactory{static get _defaultPasswordBytes(){return shadow$1(this,"_defaultPasswordBytes",new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]))}#Ue(e,t,i,n,a,s,r,o,l,c,h,d){if(t){const e=Math.min(127,t.length);t=t.subarray(0,e)}else t=[];const u=6===e?new PDF20:new PDF17;return u.checkUserPassword(t,o,r)?u.getUserKey(t,l,h):t.length&&u.checkOwnerPassword(t,n,s,i)?u.getOwnerKey(t,a,s,c):null}#je(e,t,i,n,a,s,r,o){const l=40+i.length+e.length,c=new Uint8Array(l);let h,d,u=0;if(t)for(d=Math.min(32,t.length);u<d;++u)c[u]=t[u];for(h=0;u<32;)c[u++]=CipherTransformFactory._defaultPasswordBytes[h++];c.set(i,u),u+=i.length,c[u++]=255&a,c[u++]=a>>8&255,c[u++]=a>>16&255,c[u++]=a>>>24&255,c.set(e,u),u+=e.length,s>=4&&!o&&(c.fill(255,u,u+4),u+=4);let g=calculateMD5(c,0,u);const f=r>>3;if(s>=3)for(h=0;h<50;++h)g=calculateMD5(g,0,f);const p=g.subarray(0,f);let m,b;if(s>=3){u=0,c.set(CipherTransformFactory._defaultPasswordBytes,u),u+=32,c.set(e,u),u+=e.length,m=new ARCFourCipher(p),b=m.encryptBlock(calculateMD5(c,0,u)),d=p.length;const t=new Uint8Array(d);for(h=1;h<=19;++h){for(let e=0;e<d;++e)t[e]=p[e]^h;m=new ARCFourCipher(t),b=m.encryptBlock(b)}}else m=new ARCFourCipher(p),b=m.encryptBlock(CipherTransformFactory._defaultPasswordBytes);return b.every((e,t)=>n[t]===e)?p:null}#$e(e,t,i,n){const a=new Uint8Array(32);let s=0;const r=Math.min(32,e.length);for(;s<r;++s)a[s]=e[s];let o=0;for(;s<32;)a[s++]=CipherTransformFactory._defaultPasswordBytes[o++];let l=calculateMD5(a,0,s);const c=n>>3;if(i>=3)for(o=0;o<50;++o)l=calculateMD5(l,0,l.length);let h,d;if(i>=3){d=t;const e=new Uint8Array(c);for(o=19;o>=0;o--){for(let t=0;t<c;++t)e[t]=l[t]^o;h=new ARCFourCipher(e),d=h.encryptBlock(d)}}else h=new ARCFourCipher(l.subarray(0,c)),d=h.encryptBlock(t);return d}#He(e,t,i,n=!1){const a=i.length,s=new Uint8Array(a+9);s.set(i);let r=a;s[r++]=255&e,s[r++]=e>>8&255,s[r++]=e>>16&255,s[r++]=255&t,s[r++]=t>>8&255,n&&(s[r++]=115,s[r++]=65,s[r++]=108,s[r++]=84);return calculateMD5(s,0,r).subarray(0,Math.min(a+5,16))}#Xe(e,t,i,n,a){if(!(t instanceof Name))throw new ti("Invalid crypt filter name.");const s=this,r=e.get(t.name),o=r?.get("CFM");if(!o||"None"===o.name)return function(){return new NullCipher};if("V2"===o.name)return function(){return new ARCFourCipher(s.#He(i,n,a,!1))};if("AESV2"===o.name)return function(){return new AES128Cipher(s.#He(i,n,a,!0))};if("AESV3"===o.name)return function(){return new AES256Cipher(a)};throw new ti("Unknown crypto method")}constructor(e,t,i){const n=e.get("Filter");if(!isName(n,"Standard"))throw new ti("unknown encryption method");this.filterName=n.name,this.dict=e;const a=e.get("V");if(!Number.isInteger(a)||1!==a&&2!==a&&4!==a&&5!==a)throw new ti("unsupported encryption algorithm");this.algorithm=a;let s=e.get("Length");if(!s)if(a<=3)s=40;else{const t=e.get("CF"),i=e.get("StmF");if(t instanceof Dict&&i instanceof Name){t.suppressEncryption=!0;const e=t.get(i.name);s=e?.get("Length")||128,s<40&&(s<<=3)}}if(!Number.isInteger(s)||s<40||s%8!=0)throw new ti("invalid key length");const r=stringToBytes$1(e.get("O")),o=stringToBytes$1(e.get("U")),l=r.subarray(0,32),c=o.subarray(0,32),h=e.get("P"),d=e.get("R"),u=(4===a||5===a)&&!1!==e.get("EncryptMetadata");this.encryptMetadata=u;const g=stringToBytes$1(t);let f,p;if(i){if(6===d)try{i=utf8StringToString(i)}catch{warn$1("CipherTransformFactory: Unable to convert UTF8 encoded password.")}f=stringToBytes$1(i)}if(5!==a)p=this.#je(g,f,l,c,h,d,s,u);else{const t=r.subarray(32,40),i=r.subarray(40,48),n=o.subarray(0,48),a=o.subarray(32,40),s=o.subarray(40,48),h=stringToBytes$1(e.get("OE")),u=stringToBytes$1(e.get("UE")),g=stringToBytes$1(e.get("Perms"));p=this.#Ue(d,f,l,t,i,n,c,a,s,h,u,g)}if(!p){if(!i)throw new Jt("No password given",Gt);const e=this.#$e(f,l,d,s);p=this.#je(g,e,l,c,h,d,s,u)}if(!p)throw new Jt("Incorrect Password",Vt);if(4===a&&p.length<16?(this.encryptionKey=new Uint8Array(16),this.encryptionKey.set(p)):this.encryptionKey=p,a>=4){const t=e.get("CF");t instanceof Dict&&(t.suppressEncryption=!0),this.cf=t,this.stmf=e.get("StmF")||Name.get("Identity"),this.strf=e.get("StrF")||Name.get("Identity"),this.eff=e.get("EFF")||this.stmf}}createCipherTransform(e,t){if(4===this.algorithm||5===this.algorithm)return new CipherTransform(this.#Xe(this.cf,this.strf,e,t,this.encryptionKey),this.#Xe(this.cf,this.stmf,e,t,this.encryptionKey));const i=this.#He(e,t,this.encryptionKey,!1),cipherConstructor=function(){return new ARCFourCipher(i)};return new CipherTransform(cipherConstructor,cipherConstructor)}}class XRef{constructor(e,t){this.stream=e,this.pdfManager=t,this.entries=[],this._xrefStms=new Set,this._cacheMap=new Map,this._pendingRefs=new RefSet,this._newPersistentRefNum=null,this._newTemporaryRefNum=null,this._persistentRefsCache=null}getNewPersistentRef(e){null===this._newPersistentRefNum&&(this._newPersistentRefNum=this.entries.length||1);const t=this._newPersistentRefNum++;return this._cacheMap.set(t,e),Ref.get(t,0)}getNewTemporaryRef(){if(null===this._newTemporaryRefNum&&(this._newTemporaryRefNum=this.entries.length||1,this._newPersistentRefNum)){this._persistentRefsCache=new Map;for(let e=this._newTemporaryRefNum;e<this._newPersistentRefNum;e++)this._persistentRefsCache.set(e,this._cacheMap.get(e)),this._cacheMap.delete(e)}return Ref.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){if(this._newTemporaryRefNum=null,this._persistentRefsCache)for(const[e,t]of this._persistentRefsCache)this._cacheMap.set(e,t);this._persistentRefsCache=null}setStartXRef(e){this.startXRefQueue=[e]}parse(e=!1){let t,i,n;e?(warn$1("Indexing all PDF objects"),t=this.indexObjects()):t=this.readXRef(),t.assignXref(this),this.trailer=t;try{i=t.get("Encrypt")}catch(e){if(e instanceof MissingDataException)throw e;warn$1(`XRef.parse - Invalid "Encrypt" reference: "${e}".`)}if(i instanceof Dict){const e=t.get("ID"),n=e?.length?e[0]:"";i.suppressEncryption=!0,this.encrypt=new CipherTransformFactory(i,n,this.pdfManager.password)}try{n=t.get("Root")}catch(e){if(e instanceof MissingDataException)throw e;warn$1(`XRef.parse - Invalid "Root" reference: "${e}".`)}if(n instanceof Dict)try{if(n.get("Pages")instanceof Dict)return void(this.root=n)}catch(e){if(e instanceof MissingDataException)throw e;warn$1(`XRef.parse - Invalid "Pages" reference: "${e}".`)}if(!e)throw new XRefParseException;throw new Qt("Invalid Root reference.")}processXRefTable(e){"tableState"in this||(this.tableState={entryNum:0,streamPos:e.lexer.stream.pos,parserBuf1:e.buf1,parserBuf2:e.buf2});if(!isCmd(this.readXRefTable(e),"trailer"))throw new ti("Invalid XRef table: could not find trailer dictionary");let t=e.getObj();if(t instanceof Dict||!t.dict||(t=t.dict),!(t instanceof Dict))throw new ti("Invalid XRef table: could not parse trailer dictionary");return delete this.tableState,t}readXRefTable(e){const t=e.lexer.stream,i=this.tableState;let n;for(t.pos=i.streamPos,e.buf1=i.parserBuf1,e.buf2=i.parserBuf2;;){if(!("firstEntryNum"in i)||!("entryCount"in i)){if(isCmd(n=e.getObj(),"trailer"))break;i.firstEntryNum=n,i.entryCount=e.getObj()}let a=i.firstEntryNum;const s=i.entryCount;if(!Number.isInteger(a)||!Number.isInteger(s))throw new ti("Invalid XRef table: wrong types in subsection header");for(let n=i.entryNum;n<s;n++){i.streamPos=t.pos,i.entryNum=n,i.parserBuf1=e.buf1,i.parserBuf2=e.buf2;const r={};r.offset=e.getObj(),r.gen=e.getObj();const o=e.getObj();if(o instanceof Cmd)switch(o.cmd){case"f":r.free=!0;break;case"n":r.uncompressed=!0}if(!Number.isInteger(r.offset)||!Number.isInteger(r.gen)||!r.free&&!r.uncompressed)throw new ti(`Invalid entry in XRef subsection: ${a}, ${s}`);0===n&&r.free&&1===a&&(a=0),this.entries[n+a]||(this.entries[n+a]=r)}i.entryNum=0,i.streamPos=t.pos,i.parserBuf1=e.buf1,i.parserBuf2=e.buf2,delete i.firstEntryNum,delete i.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new ti("Invalid XRef table: unexpected first object");return n}processXRefStream(e){if(!("streamState"in this)){const{dict:t,pos:i}=e,n=t.get("W"),a=t.get("Index")||[0,t.get("Size")];this.streamState={entryRanges:a,byteWidths:n,entryNum:0,streamPos:i}}return this.readXRefStream(e),delete this.streamState,e.dict}readXRefStream(e){const t=this.streamState;e.pos=t.streamPos;const[i,n,a]=t.byteWidths,s=t.entryRanges;for(;s.length>0;){const[r,o]=s;if(!Number.isInteger(r)||!Number.isInteger(o))throw new ti(`Invalid XRef range fields: ${r}, ${o}`);if(!Number.isInteger(i)||!Number.isInteger(n)||!Number.isInteger(a))throw new ti(`Invalid XRef entry fields length: ${r}, ${o}`);for(let s=t.entryNum;s<o;++s){t.entryNum=s,t.streamPos=e.pos;let o=0,l=0,c=0;for(let t=0;t<i;++t){const t=e.getByte();if(-1===t)throw new ti("Invalid XRef byteWidths 'type'.");o=o<<8|t}0===i&&(o=1);for(let t=0;t<n;++t){const t=e.getByte();if(-1===t)throw new ti("Invalid XRef byteWidths 'offset'.");l=l<<8|t}for(let t=0;t<a;++t){const t=e.getByte();if(-1===t)throw new ti("Invalid XRef byteWidths 'generation'.");c=c<<8|t}const h={};switch(h.offset=l,h.gen=c,o){case 0:h.free=!0;break;case 1:h.uncompressed=!0;break;case 2:break;default:throw new ti(`Invalid XRef entry type: ${o}`)}this.entries[r+s]||(this.entries[r+s]=h)}t.entryNum=0,t.streamPos=e.pos,s.splice(0,2)}}indexObjects(){function readToken(e,t){let i="",n=e[t];for(;10!==n&&13!==n&&60!==n&&!(++t>=e.length);)i+=String.fromCharCode(n),n=e[t];return i}function skipUntil(e,t,i){const n=i.length,a=e.length;let s=0;for(;t<a;){let a=0;for(;a<n&&e[t+a]===i[a];)++a;if(a>=n)break;t++,s++}return s}const e=/\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g,t=/\b(startxref|\d+\s+\d+\s+obj)\b/g,i=/^(\d+)\s+(\d+)\s+obj\b/,n=new Uint8Array([116,114,97,105,108,101,114]),a=new Uint8Array([115,116,97,114,116,120,114,101,102]),s=new Uint8Array([47,88,82,101,102]);this.entries.length=0,this._cacheMap.clear();const r=this.stream;r.pos=0;const o=r.getBytes(),l=bytesToString$1(o),c=o.length;let h=r.start;const d=[],u=[];for(;h<c;){let g=o[h];if(9===g||10===g||13===g||32===g){++h;continue}if(37===g){do{if(++h,h>=c)break;g=o[h]}while(10!==g&&13!==g);continue}const f=readToken(o,h);let p;if(f.startsWith("xref")&&(4===f.length||/\s/.test(f[4])))h+=skipUntil(o,h,n),d.push(h),h+=skipUntil(o,h,a);else if(p=i.exec(f)){const t=0|p[1],i=0|p[2],n=h+f.length;let a,d=!1;if(this.entries[t]){if(this.entries[t].gen===i)try{new Parser({lexer:new Lexer(r.makeSubStream(n))}).getObj(),d=!0}catch(e){e instanceof ParserEOFException?warn$1(`indexObjects -- checking object (${f}): "${e}".`):d=!0}}else d=!0;d&&(this.entries[t]={offset:h-r.start,gen:i,uncompressed:!0}),e.lastIndex=n;const g=e.exec(l);if(g){a=e.lastIndex+1-h,"endobj"!==g[1]&&(warn$1(`indexObjects: Found "${g[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`),a-=g[1].length+1)}else a=c-h;const m=o.subarray(h,h+a),b=skipUntil(m,0,s);b<a&&m[b+5]<64&&(u.push(h-r.start),this._xrefStms.add(h-r.start)),h+=a}else if(f.startsWith("trailer")&&(7===f.length||/\s/.test(f[7]))){d.push(h);const e=h+f.length;let i;t.lastIndex=e;const n=t.exec(l);if(n){i=t.lastIndex+1-h,"startxref"!==n[1]&&(warn$1(`indexObjects: Found "${n[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`),i-=n[1].length+1)}else i=c-h;h+=i}else h+=f.length+1}for(const e of u)this.startXRefQueue.push(e),this.readXRef(!0);const g=[];let f,p,m=!1;for(const e of d){r.pos=e;const t=new Parser({lexer:new Lexer(r),xref:this,allowStreams:!0,recoveryMode:!0});if(!isCmd(t.getObj(),"trailer"))continue;const i=t.getObj();i instanceof Dict&&(g.push(i),i.has("Encrypt")&&(m=!0))}for(const e of[...g,"genFallback",...g]){if("genFallback"===e){if(!p)break;this._generationFallback=!0;continue}let t=!1;try{const i=e.get("Root");if(!(i instanceof Dict))continue;const n=i.get("Pages");if(!(n instanceof Dict))continue;const a=n.get("Count");Number.isInteger(a)&&(t=!0)}catch(e){p=e;continue}if(t&&(!m||e.has("Encrypt"))&&e.has("ID"))return e;f=e}if(f)return f;if(this.topDict)return this.topDict;if(!g.length)for(const e in this.entries){if(!Object.hasOwn(this.entries,e))continue;const t=this.entries[e],i=Ref.get(parseInt(e),t.gen);let n;try{n=this.fetch(i)}catch{continue}if(n instanceof BaseStream&&(n=n.dict),n instanceof Dict&&n.has("Root"))return n}throw new Qt("Invalid PDF structure.")}readXRef(e=!1){const t=this.stream,i=new Set;for(;this.startXRefQueue.length;){try{const e=this.startXRefQueue[0];if(i.has(e)){warn$1("readXRef - skipping XRef table since it was already parsed."),this.startXRefQueue.shift();continue}i.add(e),t.pos=e+t.start;const n=new Parser({lexer:new Lexer(t),xref:this,allowStreams:!0});let a,s=n.getObj();if(isCmd(s,"xref"))a=this.processXRefTable(n),this.topDict||(this.topDict=a),s=a.get("XRefStm"),Number.isInteger(s)&&!this._xrefStms.has(s)&&(this._xrefStms.add(s),this.startXRefQueue.push(s));else{if(!Number.isInteger(s))throw new ti("Invalid XRef stream header");if(!(Number.isInteger(n.getObj())&&isCmd(n.getObj(),"obj")&&(s=n.getObj())instanceof BaseStream))throw new ti("Invalid XRef stream");if(a=this.processXRefStream(s),this.topDict||(this.topDict=a),!a)throw new ti("Failed to read XRef stream")}s=a.get("Prev"),Number.isInteger(s)?this.startXRefQueue.push(s):s instanceof Ref&&this.startXRefQueue.push(s.num)}catch(e){if(e instanceof MissingDataException)throw e;info$1("(while reading XRef): "+e)}this.startXRefQueue.shift()}if(this.topDict)return this.topDict;if(!e)throw new XRefParseException}getEntry(e){const t=this.entries[e];return t&&!t.free&&t.offset?t:null}fetchIfRef(e,t=!1){return e instanceof Ref?this.fetch(e,t):e}fetch(e,t=!1){if(!(e instanceof Ref))throw new Error("ref object is not a reference");const i=e.num,n=this._cacheMap.get(i);if(void 0!==n)return n instanceof Dict&&!n.objId&&(n.objId=e.toString()),n;let a=this.getEntry(i);if(null===a)return a;if(this._pendingRefs.has(e))return this._pendingRefs.remove(e),warn$1(`Ignoring circular reference: ${e}.`),li;this._pendingRefs.put(e);try{a=a.uncompressed?this.fetchUncompressed(e,a,t):this.fetchCompressed(e,a,t),this._pendingRefs.remove(e)}catch(t){throw this._pendingRefs.remove(e),t}return a instanceof Dict?a.objId=e.toString():a instanceof BaseStream&&(a.dict.objId=e.toString()),a}fetchUncompressed(e,t,i=!1){const n=e.gen;let a=e.num;if(t.gen!==n){const s=`Inconsistent generation in XRef: ${e}`;if(this._generationFallback&&t.gen<n)return warn$1(s),this.fetchUncompressed(Ref.get(a,t.gen),t,i);throw new XRefEntryException(s)}const s=this.stream.makeSubStream(t.offset+this.stream.start),r=new Parser({lexer:new Lexer(s),xref:this,allowStreams:!0}),o=r.getObj(),l=r.getObj(),c=r.getObj();if(o!==a||l!==n||!(c instanceof Cmd))throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`);if("obj"!==c.cmd){if(c.cmd.startsWith("obj")&&(a=parseInt(c.cmd.substring(3),10),!Number.isNaN(a)))return a;throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`)}return(t=this.encrypt&&!i?r.getObj(this.encrypt.createCipherTransform(a,n)):r.getObj())instanceof BaseStream||this._cacheMap.set(a,t),t}fetchCompressed(e,t,i=!1){const n=t.offset,a=this.fetch(Ref.get(n,0));if(!(a instanceof BaseStream))throw new ti("bad ObjStm stream");const s=a.dict.get("First"),r=a.dict.get("N");if(!Number.isInteger(s)||!Number.isInteger(r))throw new ti("invalid first and n parameters for ObjStm stream");let o=new Parser({lexer:new Lexer(a),xref:this,allowStreams:!0});const l=new Array(r),c=new Array(r);for(let e=0;e<r;++e){const t=o.getObj();if(!Number.isInteger(t))throw new ti(`invalid object number in the ObjStm stream: ${t}`);const i=o.getObj();if(!Number.isInteger(i))throw new ti(`invalid object offset in the ObjStm stream: ${i}`);l[e]=t;const a=this.getEntry(t);a?.offset===n&&a.gen!==e&&(a.gen=e),c[e]=i}const h=(a.start||0)+s,d=new Array(r);for(let e=0;e<r;++e){const t=e<r-1?c[e+1]-c[e]:void 0;if(t<0)throw new ti("Invalid offset in the ObjStm stream.");o=new Parser({lexer:new Lexer(a.makeSubStream(h+c[e],t,a.dict)),xref:this,allowStreams:!0});const i=o.getObj();if(d[e]=i,i instanceof BaseStream)continue;const s=l[e],u=this.entries[s];u&&u.offset===n&&u.gen===e&&this._cacheMap.set(s,i)}if(void 0===(t=d[t.gen]))throw new XRefEntryException(`Bad (compressed) XRef entry: ${e}`);return t}async fetchIfRefAsync(e,t){return e instanceof Ref?this.fetchAsync(e,t):e}async fetchAsync(e,t){try{return this.fetch(e,t)}catch(i){if(!(i instanceof MissingDataException))throw i;return await this.pdfManager.requestRange(i.begin,i.end),this.fetchAsync(e,t)}}getCatalogObj(){return this.root}}const ul=[0,0,612,792];class Page{#qe=!1;#ze=null;constructor({pdfManager:e,xref:t,pageIndex:i,pageDict:n,ref:a,globalIdFactory:s,fontCache:r,builtInCMapCache:o,standardFontDataCache:l,globalColorSpaceCache:c,globalImageCache:h,systemFontCache:d,nonBlendModesSet:u,xfaFactory:g}){this.pdfManager=e,this.pageIndex=i,this.pageDict=n,this.xref=t,this.ref=a,this.fontCache=r,this.builtInCMapCache=o,this.standardFontDataCache=l,this.globalColorSpaceCache=c,this.globalImageCache=h,this.systemFontCache=d,this.nonBlendModesSet=u,this.evaluatorOptions=e.evaluatorOptions,this.xfaFactory=g;const f={obj:0};this._localIdFactory=class extends s{static createObjId(){return`p${i}_${++f.obj}`}static getPageObjId(){return`p${a.toString()}`}}}#We(e){return new PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:this.globalImageCache,systemFontCache:this.systemFontCache,options:this.evaluatorOptions})}#Ge(e,t=!1){const i=getInheritableProperty({dict:this.pageDict,key:e,getArray:t,stopWhenFound:!1});return Array.isArray(i)?1!==i.length&&i[0]instanceof Dict?Dict.merge({xref:this.xref,dictArray:i}):i[0]:i}get content(){return this.pageDict.getArray("Contents")}get resources(){const e=this.#Ge("Resources");return shadow$1(this,"resources",e instanceof Dict?e:Dict.empty)}#Ve(e){if(this.xfaData)return this.xfaData.bbox;const t=lookupNormalRect(this.#Ge(e,!0),null);if(t){if(t[2]-t[0]>0&&t[3]-t[1]>0)return t;warn$1(`Empty, or invalid, /${e} entry.`)}return null}get mediaBox(){return shadow$1(this,"mediaBox",this.#Ve("MediaBox")||ul)}get cropBox(){return shadow$1(this,"cropBox",this.#Ve("CropBox")||this.mediaBox)}get userUnit(){const e=this.pageDict.get("UserUnit");return shadow$1(this,"userUnit","number"==typeof e&&e>0?e:1)}get view(){const{cropBox:e,mediaBox:t}=this;if(e!==t&&!isArrayEqual(e,t)){const i=ai.intersect(e,t);if(i&&i[2]-i[0]>0&&i[3]-i[1]>0)return shadow$1(this,"view",i);warn$1("Empty /CropBox and /MediaBox intersection.")}return shadow$1(this,"view",t)}get rotate(){let e=this.#Ge("Rotate")||0;return e%90!=0?e=0:e>=360?e%=360:e<0&&(e=(e%360+360)%360),shadow$1(this,"rotate",e)}#Ke(e,t){if(!this.evaluatorOptions.ignoreErrors)throw e;warn$1(`getContentStream - ignoring sub-stream (${t}): "${e}".`)}async getContentStream(){const e=await this.pdfManager.ensure(this,"content");return e instanceof BaseStream?e:Array.isArray(e)?new StreamsSequenceStream(e,this.#Ke.bind(this)):new NullStream}get xfaData(){return shadow$1(this,"xfaData",this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}async#Ye(e,t,i){const n=[];for(const a of e)if(a.id){const e=Ref.fromString(a.id);if(!e){warn$1(`A non-linked annotation cannot be modified: ${a.id}`);continue}if(a.deleted){if(t.put(e,e),a.popupRef){const e=Ref.fromString(a.popupRef);e&&t.put(e,e)}continue}if(a.popup?.deleted){const e=Ref.fromString(a.popupRef);e&&t.put(e,e)}i?.put(e),a.ref=e,n.push(this.xref.fetchAsync(e).then(e=>{e instanceof Dict&&(a.oldAnnotation=e.clone())},()=>{warn$1(`Cannot fetch \`oldAnnotation\` for: ${e}.`)})),delete a.id}await Promise.all(n)}async saveNewAnnotations(e,t,i,n,a){if(this.xfaFactory)throw new Error("XFA: Cannot save new annotations.");const s=this.#We(e),r=new RefSetCache,o=new RefSet;await this.#Ye(i,r,o);const l=this.pageDict,c=this.annotations.filter(e=>!(e instanceof Ref&&r.has(e))),h=await AnnotationFactory.saveNewAnnotations(s,t,i,n,a);for(const{ref:e}of h.annotations)e instanceof Ref&&!o.has(e)&&c.push(e);const d=l.clone();d.set("Annots",c),a.put(this.ref,{data:d});for(const e of r)a.put(e,{data:null})}async save(e,t,i,n){const a=this.#We(e),s=await this._parsedAnnotations,r=[];for(const e of s)r.push(e.save(a,t,i,n).catch(function(e){return warn$1(`save - ignoring annotation data during "${t.name}" task: "${e}".`),null}));return Promise.all(r)}async loadResources(e){await(this.#ze??=this.pdfManager.ensure(this,"resources")),await ObjectLoader.load(this.resources,e,this.xref)}async#Je(e,t){const i=e?.get("Resources");return i instanceof Dict&&i.size?(await ObjectLoader.load(i,t,this.xref),Dict.merge({xref:this.xref,dictArray:[i,this.resources],mergeSubDicts:!0})):this.resources}async getOperatorList({handler:e,sink:t,task:i,intent:n,cacheKey:a,annotationStorage:l=null,modifiedIds:u=null}){const f=this.getContentStream(),p=this.loadResources(mi),m=this.#We(e),b=this.xfaFactory?null:getNewAnnotationsMap(l),y=b?.get(this.pageIndex);let w=Promise.resolve(null),x=null;if(y){const e=this.pdfManager.ensureDoc("annotationGlobals");let t;const n=new Set;for(const{bitmapId:e,bitmap:t}of y)!e||t||n.has(e)||n.add(e);const{isOffscreenCanvasSupported:a}=this.evaluatorOptions;if(n.size>0){const e=y.slice();for(const[t,i]of l)t.startsWith(g)&&i.bitmap&&n.has(i.bitmapId)&&e.push(i);t=AnnotationFactory.generateImages(e,this.xref,a)}else t=AnnotationFactory.generateImages(y,this.xref,a);x=new RefSet,w=Promise.all([e,this.#Ye(y,x,null)]).then(([e])=>e?AnnotationFactory.printNewAnnotations(e,m,i,y,t):null)}const S=Promise.all([f,p]).then(async([s])=>{const r=await this.#Je(s.dict,mi),o=new OperatorList(n,t);return e.send("StartRenderPage",{transparency:m.hasBlendModes(r,this.nonBlendModesSet),pageIndex:this.pageIndex,cacheKey:a}),await m.getOperatorList({stream:s,task:i,resources:r,operatorList:o}),o});let[v,C,k]=await Promise.all([S,this._parsedAnnotations,w]);if(k){C=C.filter(e=>!(e.ref&&x.has(e.ref)));for(let e=0,t=k.length;e<t;e++){const i=k[e];if(i.refToReplace){const n=C.findIndex(e=>e.ref&&isRefsEqual(e.ref,i.refToReplace));n>=0&&(C.splice(n,1,i),k.splice(e--,1),t--)}}C=C.concat(k)}if(0===C.length||n&h)return v.flush(!0),{length:v.totalLength};const T=!!(n&c),F=!!(n&d),E=!!(n&s),M=!!(n&r),D=!!(n&o),O=[];for(const e of C)(E||M&&e.mustBeViewed(l,T)&&e.mustBeViewedWhenEditing(F,u)||D&&e.mustBePrinted(l))&&O.push(e.getOperatorList(m,i,n,l).catch(function(e){return warn$1(`getOperatorList - ignoring annotation data during "${i.name}" task: "${e}".`),{opList:null,separateForm:!1,separateCanvas:!1}}));const _=await Promise.all(O);let R=!1,N=!1;for(const{opList:e,separateForm:t,separateCanvas:i}of _)v.addOpList(e),R||=t,N||=i;return v.flush(!0,{form:R,canvas:N}),{length:v.totalLength}}async extractTextContent({handler:e,task:t,includeMarkedContent:i,disableNormalization:n,sink:a,intersector:s=null}){const r=this.getContentStream(),o=this.loadResources(bi),l=this.pdfManager.ensureCatalog("lang"),[c,,h]=await Promise.all([r,o,l]),d=await this.#Je(c.dict,bi);return this.#We(e).getTextContent({stream:c,task:t,resources:d,includeMarkedContent:i,disableNormalization:n,sink:a,viewBox:this.view,lang:h,intersector:s})}async getStructTree(){const e=await this.pdfManager.ensureCatalog("structTreeRoot");if(!e)return null;await this._parsedAnnotations;try{const t=await this.pdfManager.ensure(this,"_parseStructTree",[e]);return await this.pdfManager.ensure(t,"serializable")}catch(e){return warn$1(`getStructTree: "${e}".`),null}}_parseStructTree(e){const t=new StructTreePage(e,this.pageDict);return t.parse(this.ref),t}async getAnnotationsData(e,t,i){const n=await this._parsedAnnotations;if(0===n.length)return n;const a=[],l=[];let c;const h=!!(i&s),d=!!(i&r),u=!!(i&o),g=[];for(const i of n){const n=h||d&&i.viewable;(n||u&&i.printable)&&a.push(i.data),i.hasTextContent&&n?(c??=this.#We(e),l.push(i.extractTextContent(c,t,[-1/0,-1/0,1/0,1/0]).catch(function(e){warn$1(`getAnnotationsData - ignoring textContent during "${t.name}" task: "${e}".`)}))):i.overlaysTextContent&&n&&g.push(i)}if(g.length>0){const i=new Intersector(g);l.push(this.extractTextContent({handler:e,task:t,includeMarkedContent:!1,disableNormalization:!1,sink:null,viewBox:this.view,lang:null,intersector:i}).then(()=>{i.setText()}))}return await Promise.all(l),a}get annotations(){const e=this.#Ge("Annots");return shadow$1(this,"annotations",Array.isArray(e)?e:[])}get _parsedAnnotations(){const e=this.pdfManager.ensure(this,"annotations").then(async e=>{if(0===e.length)return e;const[t,i]=await Promise.all([this.pdfManager.ensureDoc("annotationGlobals"),this.pdfManager.ensureDoc("fieldObjects")]);if(!t)return[];const n=i?.orphanFields,a=[];for(const i of e)a.push(AnnotationFactory.create(this.xref,i,t,this._localIdFactory,!1,n,null,this.ref).catch(function(e){return warn$1(`_parsedAnnotations: "${e}".`),null}));const s=[];let r,o;for(const e of await Promise.all(a))e&&(e instanceof WidgetAnnotation?(o||=[]).push(e):e instanceof PopupAnnotation?(r||=[]).push(e):s.push(e));return o&&s.push(...o),r&&s.push(...r),s});return this.#qe=!0,shadow$1(this,"_parsedAnnotations",e)}get jsActions(){return shadow$1(this,"jsActions",collectActions(this.xref,this.pageDict,ne))}async collectAnnotationsByType(e,t,i,n,a){const{pageIndex:s}=this;if(this.#qe){const e=await this._parsedAnnotations;for(const{data:t}of e)i&&!i.has(t.annotationType)||(t.pageIndex=s,n.push(Promise.resolve(t)));return}const r=await this.pdfManager.ensure(this,"annotations");for(const o of r)n.push(AnnotationFactory.create(this.xref,o,a,this._localIdFactory,!1,null,i,this.ref).then(async i=>{if(!i)return null;if(i.data.pageIndex=s,i.hasTextContent&&i.viewable){const n=this.#We(e);await i.extractTextContent(n,t,[-1/0,-1/0,1/0,1/0])}return i.data}).catch(function(e){return warn$1(`collectAnnotationsByType: "${e}".`),null}))}}const gl=new Uint8Array([37,80,68,70,45]),fl=new Uint8Array([115,116,97,114,116,120,114,101,102]),pl=new Uint8Array([101,110,100,111,98,106]);function find(e,t,i=1024,n=!1){const a=t.length,s=e.peekBytes(i),r=s.length-a;if(r<=0)return!1;if(n){const i=a-1;let n=s.length-1;for(;n>=i;){let r=0;for(;r<a&&s[n-r]===t[i-r];)r++;if(r>=a)return e.pos+=n-i,!0;n--}}else{let i=0;for(;i<=r;){let n=0;for(;n<a&&s[i+n]===t[n];)n++;if(n>=a)return e.pos+=i,!0;i++}}return!1}class PDFDocument{#Ze=new Map;#Qe=null;constructor(e,t){if(t.length<=0)throw new Qt("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=e,this.stream=t,this.xref=new XRef(t,e);const i={font:0};this._globalIdFactory=class{static getDocId(){return`g_${e.docId}`}static createFontId(){return"f"+ ++i.font}static createObjId(){unreachable$1("Abstract method `createObjId` called.")}static getPageObjId(){unreachable$1("Abstract method `getPageObjId` called.")}}}parse(e){this.xref.parse(e),this.catalog=new Catalog(this.pdfManager,this.xref)}get linearization(){let e=null;try{e=Linearization.create(this.stream)}catch(e){if(e instanceof MissingDataException)throw e;info$1(e)}return shadow$1(this,"linearization",e)}get startXRef(){const e=this.stream;let t=0;if(this.linearization){if(e.reset(),find(e,pl)){e.skip(6);let i=e.peekByte();for(;isWhiteSpace(i);)e.pos++,i=e.peekByte();t=e.pos-e.start}}else{const i=1024,n=fl.length;let a=!1,s=e.end;for(;!a&&s>0;)s-=i-n,s<0&&(s=0),e.pos=s,a=find(e,fl,i,!0);if(a){let i;e.skip(9);do{i=e.getByte()}while(isWhiteSpace(i));let n="";for(;i>=32&&i<=57;)n+=String.fromCharCode(i),i=e.getByte();t=parseInt(n,10),isNaN(t)&&(t=0)}}return shadow$1(this,"startXRef",t)}checkHeader(){const e=this.stream;if(e.reset(),!find(e,gl))return;e.moveStart(),e.skip(gl.length);let t,i="";for(;(t=e.getByte())>32&&i.length<7;)i+=String.fromCharCode(t);gi.test(i)?this.#Qe=i:warn$1(`Invalid PDF header version: ${i}`)}parseStartXRef(){this.xref.setStartXRef(this.startXRef)}get numPages(){let e=0;return e=this.catalog.hasActualNumPages?this.catalog.numPages:this.xfaFactory?this.xfaFactory.getNumPages():this.linearization?this.linearization.numPages:this.catalog.numPages,shadow$1(this,"numPages",e)}#et(e,t=0){return!!Array.isArray(e)&&e.every(e=>{if(!((e=this.xref.fetchIfRef(e))instanceof Dict))return!1;if(e.has("Kids"))return++t>10?(warn$1("#hasOnlyDocumentSignatures: maximum recursion depth reached"),!1):this.#et(e.get("Kids"),t);const i=isName(e.get("FT"),"Sig"),n=e.get("Rect"),a=Array.isArray(n)&&n.every(e=>0===e);return i&&a})}#tt(e,t,i=new RefSet){if(Array.isArray(e))for(let n of e){if(n instanceof Ref){if(i.has(n))continue;i.put(n)}if(n=this.xref.fetchIfRef(n),!(n instanceof Dict))continue;if(n.has("Kids")){this.#tt(n.get("Kids"),t,i);continue}if(!isName(n.get("FT"),"Sig"))continue;const e=n.get("V");if(!(e instanceof Dict))continue;const a=e.get("SubFilter");a instanceof Name&&t.add(a.name)}}get _xfaStreams(){const{acroForm:e}=this.catalog;if(!e)return null;const t=e.get("XFA"),i=new Map(["xdp:xdp","template","datasets","config","connectionSet","localeSet","stylesheet","/xdp:xdp"].map(e=>[e,null]));if(t instanceof BaseStream&&!t.isEmpty)return i.set("xdp:xdp",t),i;if(!Array.isArray(t)||0===t.length)return null;for(let e=0,n=t.length;e<n;e+=2){let a;if(a=0===e?"xdp:xdp":e===n-2?"/xdp:xdp":t[e],!i.has(a))continue;const s=this.xref.fetchIfRef(t[e+1]);s instanceof BaseStream&&!s.isEmpty&&i.set(a,s)}return i}get xfaDatasets(){const e=this._xfaStreams;if(!e)return shadow$1(this,"xfaDatasets",null);for(const t of["datasets","xdp:xdp"]){const i=e.get(t);if(i)try{const e=stringToUTF8String$1(i.getString());return shadow$1(this,"xfaDatasets",new DatasetReader({[t]:e}))}catch{warn$1("XFA - Invalid utf-8 string.");break}}return shadow$1(this,"xfaDatasets",null)}get xfaData(){const e=this._xfaStreams;if(!e)return null;const t=Object.create(null);for(const[i,n]of e)if(n)try{t[i]=stringToUTF8String$1(n.getString())}catch{return warn$1("XFA - Invalid utf-8 string."),null}return t}get xfaFactory(){let e;return this.pdfManager.enableXfa&&this.catalog.needsRendering&&this.formInfo.hasXfa&&!this.formInfo.hasAcroForm&&(e=this.xfaData),shadow$1(this,"xfaFactory",e?new XFAFactory(e):null)}get isPureXfa(){return!!this.xfaFactory&&this.xfaFactory.isValid()}get htmlForXfa(){return this.xfaFactory?this.xfaFactory.getPages():null}async#it(){const e=await this.pdfManager.ensureCatalog("xfaImages");e&&this.xfaFactory.setImages(e)}async#nt(e,t){const i=await this.pdfManager.ensureCatalog("acroForm");if(!i)return;const n=await i.getAsync("DR");if(!(n instanceof Dict))return;await ObjectLoader.load(n,["Font"],this.xref);const a=n.get("Font");if(!(a instanceof Dict))return;const s=Object.assign(Object.create(null),this.pdfManager.evaluatorOptions,{useSystemFonts:!1}),{builtInCMapCache:r,fontCache:o,standardFontDataCache:l}=this.catalog,c=new PartialEvaluator({xref:this.xref,handler:e,pageIndex:-1,idFactory:this._globalIdFactory,fontCache:o,builtInCMapCache:r,standardFontDataCache:l,options:s}),h=new OperatorList,d=[],u={get font(){return d.at(-1)},set font(e){d.push(e)},clone(){return this}},parseFont=(e,i,a)=>c.handleSetFont(n,[Name.get(e),1],null,h,t,u,i,a).catch(e=>(warn$1(`loadXfaFonts: "${e}".`),null)),g=[];for(const[e,t]of a){const i=t.get("FontDescriptor");if(!(i instanceof Dict))continue;let n=i.get("FontFamily");n=n.replaceAll(/[ ]+(\d)/g,"$1");const a={fontFamily:n,fontWeight:i.get("FontWeight"),italicAngle:-i.get("ItalicAngle")};validateCSSFont(a)&&g.push(parseFont(e,null,a))}await Promise.all(g);const f=this.xfaFactory.setFonts(d);if(!f)return;s.ignoreErrors=!0,g.length=0,d.length=0;const p=new Set;for(const e of f)getXfaFontName(`${e}-Regular`)||p.add(e);p.size&&f.push("PdfJS-Fallback");for(const e of f)if(!p.has(e))for(const t of[{name:"Regular",fontWeight:400,italicAngle:0},{name:"Bold",fontWeight:700,italicAngle:0},{name:"Italic",fontWeight:400,italicAngle:12},{name:"BoldItalic",fontWeight:700,italicAngle:12}]){const i=`${e}-${t.name}`;g.push(parseFont(i,getXfaFontDict(i),{fontFamily:e,fontWeight:t.fontWeight,italicAngle:t.italicAngle}))}await Promise.all(g),this.xfaFactory.appendFonts(d,p)}loadXfaResources(e,t){return Promise.all([this.#nt(e,t).catch(()=>{}),this.#it()])}serializeXfaData(e){return this.xfaFactory?this.xfaFactory.serializeData(e):null}get version(){return this.catalog.version||this.#Qe}get formInfo(){const e={hasFields:!1,hasAcroForm:!1,hasXfa:!1,hasSignatures:!1},{acroForm:t}=this.catalog;if(!t)return shadow$1(this,"formInfo",e);try{const i=t.get("Fields"),n=Array.isArray(i)&&i.length>0;e.hasFields=n;const a=t.get("XFA");e.hasXfa=Array.isArray(a)&&a.length>0||a instanceof BaseStream&&!a.isEmpty;const s=!!(1&t.get("SigFlags")),r=s&&this.#et(i);e.hasAcroForm=n&&!r,e.hasSignatures=s}catch(e){if(e instanceof MissingDataException)throw e;warn$1(`Cannot fetch form information: "${e}".`)}return shadow$1(this,"formInfo",e)}get documentInfo(){const{catalog:e,formInfo:t,xref:i}=this,n={PDFFormatVersion:this.version,Language:e.lang,EncryptFilterName:i.encrypt?.filterName??null,IsLinearized:!!this.linearization,IsAcroFormPresent:t.hasAcroForm,IsXFAPresent:t.hasXfa,IsCollectionPresent:!!e.collection,IsSignaturesPresent:t.hasSignatures};let a;try{a=i.trailer.get("Info")}catch(e){if(e instanceof MissingDataException)throw e;info$1("The document information dictionary is invalid.")}if(!(a instanceof Dict))return shadow$1(this,"documentInfo",n);for(const[e,t]of a){switch(e){case"Title":case"Author":case"Subject":case"Keywords":case"Creator":case"Producer":case"CreationDate":case"ModDate":if("string"==typeof t){n[e]=stringToPDFString(t);continue}break;case"Trapped":if(t instanceof Name){n[e]=t;continue}break;default:let i;switch(typeof t){case"string":i=stringToPDFString(t);break;case"number":case"boolean":i=t;break;default:t instanceof Name&&(i=t)}if(void 0===i){warn$1(`Bad value, for custom key "${e}", in Info: ${t}.`);continue}n.Custom??=Object.create(null),n.Custom[e]=i;continue}warn$1(`Bad value, for key "${e}", in Info: ${t}.`)}return shadow$1(this,"documentInfo",n)}get fingerprints(){const e="\0".repeat(16);function validate(t){return"string"==typeof t&&16===t.length&&t!==e}const t=this.xref.trailer.get("ID");let i,n;return Array.isArray(t)&&validate(t[0])?(i=stringToBytes$1(t[0]),t[1]!==t[0]&&validate(t[1])&&(n=stringToBytes$1(t[1]))):i=calculateMD5(this.stream.getByteRange(0,1024),0,1024),shadow$1(this,"fingerprints",[toHexUtil(i),n?toHexUtil(n):null])}async#at(e){const{catalog:t,linearization:i,xref:n}=this,a=Ref.get(i.objectNumberFirst,0);try{const e=await n.fetchAsync(a);if(e instanceof Dict){let i=e.getRaw("Type");if(i instanceof Ref&&(i=await n.fetchAsync(i)),isName(i,"Page")||!e.has("Type")&&!e.has("Kids")&&e.has("Contents"))return t.pageKidsCountCache.has(a)||t.pageKidsCountCache.put(a,1),t.pageIndexCache.has(a)||t.pageIndexCache.put(a,0),[e,a]}throw new ti("The Linearization dictionary doesn't point to a valid Page dictionary.")}catch(i){return warn$1(`_getLinearizationPage: "${i.message}".`),t.getPageDict(e)}}getPage(e){const t=this.#Ze.get(e);if(t)return t;const{catalog:i,linearization:n,xfaFactory:a}=this;let s;return s=a?Promise.resolve([Dict.empty,null]):n?.pageFirst===e?this.#at(e):i.getPageDict(e),s=s.then(([t,n])=>new Page({pdfManager:this.pdfManager,xref:this.xref,pageIndex:e,pageDict:t,ref:n,globalIdFactory:this._globalIdFactory,fontCache:i.fontCache,builtInCMapCache:i.builtInCMapCache,standardFontDataCache:i.standardFontDataCache,globalColorSpaceCache:i.globalColorSpaceCache,globalImageCache:i.globalImageCache,systemFontCache:i.systemFontCache,nonBlendModesSet:i.nonBlendModesSet,xfaFactory:a})),this.#Ze.set(e,s),s}async checkFirstPage(e=!1){if(!e)try{await this.getPage(0)}catch(e){if(e instanceof XRefEntryException)throw this.#Ze.delete(0),await this.cleanup(),new XRefParseException}}async checkLastPage(e=!1){const{catalog:t,pdfManager:i}=this;let n;t.setActualNumPages();try{if(await Promise.all([i.ensureDoc("xfaFactory"),i.ensureDoc("linearization"),i.ensureCatalog("numPages")]),this.xfaFactory)return;if(n=this.linearization?this.linearization.numPages:t.numPages,!Number.isInteger(n))throw new ti("Page count is not an integer.");if(n<=1)return;await this.getPage(n-1)}catch(a){if(this.#Ze.delete(n-1),await this.cleanup(),a instanceof XRefEntryException&&!e)throw new XRefParseException;let s;warn$1(`checkLastPage - invalid /Pages tree /Count: ${n}.`);try{s=await t.getAllPageDicts(e)}catch(i){if(i instanceof XRefEntryException&&!e)throw new XRefParseException;return void t.setActualNumPages(1)}for(const[e,[n,a]]of s){let s;n instanceof Error?(s=Promise.reject(n),s.catch(()=>{})):s=Promise.resolve(new Page({pdfManager:i,xref:this.xref,pageIndex:e,pageDict:n,ref:a,globalIdFactory:this._globalIdFactory,fontCache:t.fontCache,builtInCMapCache:t.builtInCMapCache,standardFontDataCache:t.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:t.globalImageCache,systemFontCache:t.systemFontCache,nonBlendModesSet:t.nonBlendModesSet,xfaFactory:null})),this.#Ze.set(e,s)}t.setActualNumPages(s.size)}}async fontFallback(e,t){const{catalog:i,pdfManager:n}=this;for(const a of await Promise.all(i.fontCache))if(a.loadedName===e)return void a.fallback(t,n.evaluatorOptions)}async cleanup(e=!1){return this.catalog?this.catalog.cleanup(e):clearGlobalCaches()}async#st(e,t,i,n,a,s,r){const{xref:o}=this;if(!(i instanceof Ref)||s.has(i))return;s.put(i);const l=await o.fetchAsync(i);if(!(l instanceof Dict))return;let c=await l.getAsync("Subtype");if(c=c instanceof Name?c.name:null,"Link"===c)return;if(l.has("T")){const t=stringToPDFString(await l.getAsync("T"));e=""===e?t:`${e}.${t}`}else{let i=l;for(;;){if(i=i.getRaw("Parent")||t,i instanceof Ref){if(s.has(i))break;i=await o.fetchAsync(i)}if(!(i instanceof Dict))break;if(i.has("T")){const t=stringToPDFString(await i.getAsync("T"));e=""===e?t:`${e}.${t}`;break}}}if(t&&!l.has("Parent")&&isName(l.get("Subtype"),"Widget")&&r.put(i,t),n.has(e)||n.set(e,[]),n.get(e).push(AnnotationFactory.create(o,i,a,null,!0,r,null,null).then(e=>e?.getFieldObject()).catch(function(e){return warn$1(`#collectFieldObjects: "${e}".`),null})),!l.has("Kids"))return;const h=await l.getAsync("Kids");if(Array.isArray(h))for(const t of h)await this.#st(e,i,t,n,a,s,r)}get fieldObjects(){return shadow$1(this,"fieldObjects",this.pdfManager.ensureDoc("formInfo").then(async e=>{if(!e.hasFields)return null;const t=await this.annotationGlobals;if(!t)return null;const{acroForm:i}=t,n=new RefSet,a=Object.create(null),s=new Map,r=new RefSetCache;for(const e of i.get("Fields"))await this.#st("",null,e,s,t,n,r);const o=[];for(const[e,t]of s)o.push(Promise.all(t).then(t=>{(t=t.filter(e=>!!e)).length>0&&(a[e]=t)}));return await Promise.all(o),{allFields:objectSize(a)>0?a:null,orphanFields:r}}))}get hasJSActions(){return shadow$1(this,"hasJSActions",this.pdfManager.ensureDoc("_parseHasJSActions"))}async _parseHasJSActions(){const[e,t]=await Promise.all([this.pdfManager.ensureCatalog("jsActions"),this.pdfManager.ensureDoc("fieldObjects")]);return!!e||!!t?.allFields&&Object.values(t.allFields).some(e=>e.some(e=>null!==e.actions))}get calculationOrderIds(){const e=this.catalog.acroForm?.get("CO");if(!Array.isArray(e)||0===e.length)return shadow$1(this,"calculationOrderIds",null);const t=[];for(const i of e)i instanceof Ref&&t.push(i.toString());return shadow$1(this,"calculationOrderIds",t.length?t:null)}get annotationGlobals(){return shadow$1(this,"annotationGlobals",AnnotationFactory.createGlobals(this.pdfManager))}}class BasePdfManager{constructor({docBaseUrl:e,docId:t,enableXfa:i,evaluatorOptions:n,handler:a,password:s}){this._docBaseUrl=function(e){if(e){const t=createValidAbsoluteUrl$1(e);if(t)return t.href;warn$1(`Invalid absolute docBaseUrl: "${e}".`)}return null}(e),this._docId=t,this._password=s,this.enableXfa=i,n.isOffscreenCanvasSupported&&=FeatureTest.isOffscreenCanvasSupported,n.isImageDecoderSupported&&=FeatureTest.isImageDecoderSupported,this.evaluatorOptions=Object.freeze(n),ImageResizer.setOptions(n),JpegStream.setOptions(n),OperatorList.setOptions(n);const r={...n,handler:a};JpxImage.setOptions(r),IccColorSpace.setOptions(r),CmykICCBasedCS.setOptions(r)}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){return this._docBaseUrl}ensureDoc(e,t){return this.ensure(this.pdfDocument,e,t)}ensureXRef(e,t){return this.ensure(this.pdfDocument.xref,e,t)}ensureCatalog(e,t){return this.ensure(this.pdfDocument.catalog,e,t)}getPage(e){return this.pdfDocument.getPage(e)}fontFallback(e,t){return this.pdfDocument.fontFallback(e,t)}cleanup(e=!1){return this.pdfDocument.cleanup(e)}async ensure(e,t,i){unreachable$1("Abstract method `ensure` called")}requestRange(e,t){unreachable$1("Abstract method `requestRange` called")}requestLoadedStream(e=!1){unreachable$1("Abstract method `requestLoadedStream` called")}sendProgressiveData(e){unreachable$1("Abstract method `sendProgressiveData` called")}updatePassword(e){this._password=e}terminate(e){unreachable$1("Abstract method `terminate` called")}}class LocalPdfManager extends BasePdfManager{constructor(e){super(e);const t=new Stream(e.source);this.pdfDocument=new PDFDocument(this,t),this._loadedStreamPromise=Promise.resolve(t)}async ensure(e,t,i){const n=e[t];return"function"==typeof n?n.apply(e,i):n}requestRange(e,t){return Promise.resolve()}requestLoadedStream(e=!1){return this._loadedStreamPromise}terminate(e){}}class NetworkPdfManager extends BasePdfManager{constructor(e){super(e),this.streamManager=new ChunkedStreamManager(e.source,{msgHandler:e.handler,length:e.length,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize}),this.pdfDocument=new PDFDocument(this,this.streamManager.getStream())}async ensure(e,t,i){try{const n=e[t];return"function"==typeof n?n.apply(e,i):n}catch(n){if(!(n instanceof MissingDataException))throw n;return await this.requestRange(n.begin,n.end),this.ensure(e,t,i)}}requestRange(e,t){return this.streamManager.requestRange(e,t)}requestLoadedStream(e=!1){return this.streamManager.requestAllChunks(e)}sendProgressiveData(e){this.streamManager.onReceiveData({chunk:e})}terminate(e){this.streamManager.abort(e)}}const ml=1,bl=2,yl=1,wl=2,Al=3,xl=4,Sl=5,vl=6,Cl=7,kl=8;function onFn$1(){}function wrapReason$1(e){if(e instanceof ii||e instanceof Qt||e instanceof Jt||e instanceof ei||e instanceof Zt)return e;switch(e instanceof Error||"object"==typeof e&&null!==e||unreachable$1('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new ii(e.message);case"InvalidPDFException":return new Qt(e.message);case"PasswordException":return new Jt(e.message,e.code);case"ResponseException":return new ei(e.message,e.status,e.missing);case"UnknownErrorException":return new Zt(e.message,e.details)}return new Zt(e.message,e.toString())}let Tl=class{#rt=new AbortController;constructor(e,t,i){this.sourceName=e,this.targetName=t,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),i.addEventListener("message",this.#ot.bind(this),{signal:this.#rt.signal})}#ot({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#lt(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],e.callback===ml)i.resolve(e.data);else{if(e.callback!==bl)throw new Error("Unexpected callback case");i.reject(wrapReason$1(e.reason))}return}const t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const i=this.sourceName,n=e.sourceName,a=this.comObj;return void Promise.try(t,e.data).then(function(t){a.postMessage({sourceName:i,targetName:n,callback:ml,callbackId:e.callbackId,data:t})},function(t){a.postMessage({sourceName:i,targetName:n,callback:bl,callbackId:e.callbackId,reason:wrapReason$1(t)})})}e.streamId?this.#ct(e):t(e.data)}on(e,t){const i=this.actionHandler;if(i[e])throw new Error(`There is already an actionName called "${e}"`);i[e]=t}send(e,t,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},i)}sendWithPromise(e,t,i){const n=this.callbackId++,a=Promise.withResolvers();this.callbackCapabilities[n]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:n,data:t},i)}catch(e){a.reject(e)}return a.promise}sendWithStream(e,t,i,n){const a=this.streamId++,s=this.sourceName,r=this.targetName,o=this.comObj;return new ReadableStream({start:i=>{const l=Promise.withResolvers();return this.streamControllers[a]={controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:s,targetName:r,action:e,streamId:a,data:t,desiredSize:i.desiredSize},n),l.promise},pull:e=>{const t=Promise.withResolvers();return this.streamControllers[a].pullCall=t,o.postMessage({sourceName:s,targetName:r,stream:vl,streamId:a,desiredSize:e.desiredSize}),t.promise},cancel:e=>{assert$1(e instanceof Error,"cancel must have a valid reason");const t=Promise.withResolvers();return this.streamControllers[a].cancelCall=t,this.streamControllers[a].isClosed=!0,o.postMessage({sourceName:s,targetName:r,stream:yl,streamId:a,reason:wrapReason$1(e)}),t.promise}},i)}#ct(e){const t=e.streamId,i=this.sourceName,n=e.sourceName,a=this.comObj,s=this,r=this.actionHandler[e.action],o={enqueue(e,s=1,r){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=s,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),a.postMessage({sourceName:i,targetName:n,stream:xl,streamId:t,chunk:e},r)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:i,targetName:n,stream:Al,streamId:t}),delete s.streamSinks[t])},error(e){assert$1(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:i,targetName:n,stream:Sl,streamId:t,reason:wrapReason$1(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[t]=o,Promise.try(r,e.data,o).then(function(){a.postMessage({sourceName:i,targetName:n,stream:kl,streamId:t,success:!0})},function(e){a.postMessage({sourceName:i,targetName:n,stream:kl,streamId:t,reason:wrapReason$1(e)})})}#lt(e){const t=e.streamId,i=this.sourceName,n=e.sourceName,a=this.comObj,s=this.streamControllers[t],r=this.streamSinks[t];switch(e.stream){case kl:e.success?s.startCall.resolve():s.startCall.reject(wrapReason$1(e.reason));break;case Cl:e.success?s.pullCall.resolve():s.pullCall.reject(wrapReason$1(e.reason));break;case vl:if(!r){a.postMessage({sourceName:i,targetName:n,stream:Cl,streamId:t,success:!0});break}r.desiredSize<=0&&e.desiredSize>0&&r.sinkCapability.resolve(),r.desiredSize=e.desiredSize,Promise.try(r.onPull||onFn$1).then(function(){a.postMessage({sourceName:i,targetName:n,stream:Cl,streamId:t,success:!0})},function(e){a.postMessage({sourceName:i,targetName:n,stream:Cl,streamId:t,reason:wrapReason$1(e)})});break;case xl:if(assert$1(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(e.chunk);break;case Al:if(assert$1(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),this.#ht(s,t);break;case Sl:assert$1(s,"error should have stream controller"),s.controller.error(wrapReason$1(e.reason)),this.#ht(s,t);break;case wl:e.success?s.cancelCall.resolve():s.cancelCall.reject(wrapReason$1(e.reason)),this.#ht(s,t);break;case yl:if(!r)break;const o=wrapReason$1(e.reason);Promise.try(r.onCancel||onFn$1,o).then(function(){a.postMessage({sourceName:i,targetName:n,stream:wl,streamId:t,success:!0})},function(e){a.postMessage({sourceName:i,targetName:n,stream:wl,streamId:t,reason:wrapReason$1(e)})}),r.sinkCapability.reject(o),r.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async#ht(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#rt?.abort(),this.#rt=null}};async function writeObject(e,t,i,{encrypt:n=null}){const a=n?.createCipherTransform(e.num,e.gen);i.push(`${e.num} ${e.gen} obj\n`),t instanceof Dict?await writeDict(t,i,a):t instanceof BaseStream?await writeStream(t,i,a):(Array.isArray(t)||ArrayBuffer.isView(t))&&await writeArray(t,i,a),i.push("\nendobj\n")}async function writeDict(e,t,i){t.push("<<");for(const n of e.getKeys())t.push(` /${escapePDFName(n)} `),await writeValue(e.getRaw(n),t,i);t.push(">>")}async function writeStream(e,t,i){let n=e.getBytes();const{dict:a}=e,[s,r]=await Promise.all([a.getAsync("Filter"),a.getAsync("DecodeParms")]),o=isName(Array.isArray(s)?await a.xref.fetchIfRefAsync(s[0]):s,"FlateDecode");if(n.length>=256||o)try{const e=new CompressionStream("deflate"),t=e.writable.getWriter();await t.ready,t.write(n).then(async()=>{await t.ready,await t.close()}).catch(()=>{});const i=await new Response(e.readable).arrayBuffer();let l,c;n=new Uint8Array(i),s?o||(l=Array.isArray(s)?[Name.get("FlateDecode"),...s]:[Name.get("FlateDecode"),s],r&&(c=Array.isArray(r)?[null,...r]:[null,r])):l=Name.get("FlateDecode"),l&&a.set("Filter",l),c&&a.set("DecodeParms",c)}catch(e){info$1(`writeStream - cannot compress data: "${e}".`)}let l=bytesToString$1(n);i&&(l=i.encryptString(l)),a.set("Length",l.length),await writeDict(a,t,i),t.push(" stream\n",l,"\nendstream")}async function writeArray(e,t,i){t.push("[");let n=!0;for(const a of e)n?n=!1:t.push(" "),await writeValue(a,t,i);t.push("]")}async function writeValue(e,t,i){e instanceof Name?t.push(`/${escapePDFName(e.name)}`):e instanceof Ref?t.push(`${e.num} ${e.gen} R`):Array.isArray(e)||ArrayBuffer.isView(e)?await writeArray(e,t,i):"string"==typeof e?(i&&(e=i.encryptString(e)),t.push(`(${escapeString(e)})`)):"number"==typeof e?t.push(numberToString(e)):"boolean"==typeof e?t.push(e.toString()):e instanceof Dict?await writeDict(e,t,i):e instanceof BaseStream?await writeStream(e,t,i):null===e?t.push("null"):warn$1(`Unhandled value in writer: ${typeof e}, please file a bug.`)}function writeInt(e,t,i,n){for(let a=t+i-1;a>i-1;a--)n[a]=255&e,e>>=8;return i+t}function writeString(e,t,i){const n=e.length;for(let a=0;a<n;a++)i[t+a]=255&e.charCodeAt(a);return t+n}function updateXFA({xfaData:e,xfaDatasetsRef:t,changes:i,xref:n}){if(null===e){e=function(e,t){const i=new SimpleXMLParser({hasAttributes:!0}).parseFromString(e);for(const{xfa:e}of t){if(!e)continue;const{path:t,value:n}=e;if(!t)continue;const a=parseXFAPath(t);let s=i.documentElement.searchNode(a,0);!s&&a.length>1&&(s=i.documentElement.searchNode([a.at(-1)],0)),s?s.childNodes=Array.isArray(n)?n.map(e=>new SimpleDOMNode("value",e)):[new SimpleDOMNode("#text",n)]:warn$1(`Node not found for path: ${t}`)}const n=[];return i.documentElement.dump(n),n.join("")}(n.fetchIfRef(t).getString(),i)}const a=new StringStream(e);a.dict=new Dict(n),a.dict.setIfName("Type","EmbeddedFile"),i.put(t,{data:a})}function getIndexes(e){const t=[];for(const{ref:i}of e)i.num===t.at(-2)+t.at(-1)?t[t.length-1]+=1:t.push(i.num,1);return t}function computeIDs(e,t,i){if(Array.isArray(t.fileIds)&&t.fileIds.length>0){const n=function(e,t){const i=Math.floor(Date.now()/1e3),n=t.filename||"",a=[i.toString(),n,e.toString(),...t.infoMap.values()],s=Math.sumPrecise(a.map(e=>e.length)),r=new Uint8Array(s);let o=0;for(const e of a)o=writeString(e,o,r);return bytesToString$1(calculateMD5(r,0,r.length))}(e,t);i.set("ID",[t.fileIds[0],n])}}async function incrementalUpdate({originalData:e,xrefInfo:t,changes:i,xref:n=null,hasXfa:a=!1,xfaDatasetsRef:s=null,hasXfaDatasetsEntry:r=!1,needAppearances:o,acroFormRef:l=null,acroForm:c=null,xfaData:h=null,useXrefStream:d=!1}){await async function({xref:e,acroForm:t,acroFormRef:i,hasXfa:n,hasXfaDatasetsEntry:a,xfaDatasetsRef:s,needAppearances:r,changes:o}){if(!n||a||s||warn$1("XFA - Cannot save it"),!r&&(!n||!s||a))return;const l=t.clone();if(n&&!a){const e=t.get("XFA").slice();e.splice(2,0,"datasets"),e.splice(3,0,s),l.set("XFA",e)}r&&l.set("NeedAppearances",!0),o.put(i,{data:l})}({xref:n,acroForm:c,acroFormRef:l,hasXfa:a,hasXfaDatasetsEntry:r,xfaDatasetsRef:s,needAppearances:o,changes:i}),a&&updateXFA({xfaData:h,xfaDatasetsRef:s,changes:i,xref:n});const u=function(e,t,i){const n=new Dict(null);n.set("Prev",e.startXRef);const a=e.newRef;return i?(t.put(a,{data:""}),n.set("Size",a.num+1),n.setIfName("Type","XRef")):n.set("Size",a.num),null!==e.rootRef&&n.set("Root",e.rootRef),null!==e.infoRef&&n.set("Info",e.infoRef),null!==e.encryptRef&&n.set("Encrypt",e.encryptRef),n}(t,i,d),g=[],f=await async function(e,t,i=[]){const n=[];for(const[a,{data:s}]of e.items())null!==s&&"string"!=typeof s?(await writeObject(a,s,i,t),n.push({ref:a,data:i.join("")}),i.length=0):n.push({ref:a,data:s});return n.sort((e,t)=>e.ref.num-t.ref.num)}(i,n,g);let p=e.length;const m=e.at(-1);10!==m&&13!==m&&(g.push("\n"),p+=1);for(const{data:e}of f)null!==e&&g.push(e);await(d?async function(e,t,i,n,a){const s=[];let r=0,o=0;for(const{ref:e,data:n}of i){let i;r=Math.max(r,t),null!==n?(i=Math.min(e.gen,65535),s.push([1,t,i]),t+=n.length):(i=Math.min(e.gen+1,65535),s.push([0,0,i])),o=Math.max(o,i)}n.set("Index",getIndexes(i));const l=[1,getSizeInBytes(r),getSizeInBytes(o)];n.set("W",l),computeIDs(t,e,n);const c=Math.sumPrecise(l),h=new Uint8Array(c*s.length),d=new Stream(h);d.dict=n;let u=0;for(const[e,t,i]of s)u=writeInt(e,l[0],u,h),u=writeInt(t,l[1],u,h),u=writeInt(i,l[2],u,h);await writeObject(e.newRef,d,a,{}),a.push("startxref\n",t.toString(),"\n%%EOF\n")}(t,p,f,u,g):async function(e,t,i,n,a){a.push("xref\n");const s=getIndexes(i);let r=0;for(const{ref:e,data:n}of i)e.num===s[r]&&(a.push(`${s[r]} ${s[r+1]}\n`),r+=2),null!==n?(a.push(`${t.toString().padStart(10,"0")} ${Math.min(e.gen,65535).toString().padStart(5,"0")} n\r\n`),t+=n.length):a.push(`0000000000 ${Math.min(e.gen+1,65535).toString().padStart(5,"0")} f\r\n`);computeIDs(t,e,n),a.push("trailer\n"),await writeDict(n,a),a.push("\nstartxref\n",t.toString(),"\n%%EOF\n")}(t,p,f,u,g));const b=e.length+Math.sumPrecise(g.map(e=>e.length)),y=new Uint8Array(b);y.set(e);let w=e.length;for(const e of g)w=writeString(e,w,y);return y}class PDFWorkerStream{constructor(e){this._msgHandler=e,this._contentLength=null,this._fullRequestReader=null,this._rangeRequestReaders=[]}getFullReader(){return assert$1(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once."),this._fullRequestReader=new PDFWorkerStreamReader(this._msgHandler),this._fullRequestReader}getRangeReader(e,t){const i=new PDFWorkerStreamRangeReader(e,t,this._msgHandler);return this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class PDFWorkerStreamReader{constructor(e){this._msgHandler=e,this.onProgress=null,this._contentLength=null,this._isRangeSupported=!1,this._isStreamingSupported=!1;const t=this._msgHandler.sendWithStream("GetReader");this._reader=t.getReader(),this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then(e=>{this._isStreamingSupported=e.isStreamingSupported,this._isRangeSupported=e.isRangeSupported,this._contentLength=e.contentLength})}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){const{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}class PDFWorkerStreamRangeReader{constructor(e,t,i){this._msgHandler=i,this.onProgress=null;const n=this._msgHandler.sendWithStream("GetRangeReader",{begin:e,end:t});this._reader=n.getReader()}get isStreamingSupported(){return!1}async read(){const{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}class WorkerTask{constructor(e){this.name=e,this.terminated=!1,this._capability=Promise.withResolvers()}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}class WorkerMessageHandler{static{"undefined"==typeof window&&!e&&"undefined"!=typeof self&&"function"==typeof self.postMessage&&"onmessage"in self&&this.initializeFromPort(self)}static setup(e,t){let i=!1;e.on("test",t=>{i||(i=!0,e.send("test",t instanceof Uint8Array))}),e.on("configure",e=>{var t;t=e.verbosity,Number.isInteger(t)&&(Kt=t)}),e.on("GetDocRequest",e=>this.createDocumentHandler(e,t))}static createDocumentHandler(e,t){let i,n=!1,a=null;const s=new Set,r=Kt,{docId:o,apiVersion:l}=e,c="5.4.296";if(l!==c)throw new Error(`The API version "${l}" does not match the Worker version "${c}".`);const buildMsg=(e,t)=>`The \`${e}.prototype\` contains unexpected enumerable property "${t}", thus breaking e.g. \`for...in\` iteration of ${e}s.`;for(const e in{})throw new Error(buildMsg("Object",e));for(const e in[])throw new Error(buildMsg("Array",e));const h=o+"_worker";let d=new Tl(h,o,t);function ensureNotTerminated(){if(n)throw new Error("Worker was terminated")}function startWorkerTask(e){s.add(e)}function finishWorkerTask(e){e.finish(),s.delete(e)}async function loadDocument(e){await i.ensureDoc("checkHeader"),await i.ensureDoc("parseStartXRef"),await i.ensureDoc("parse",[e]),await i.ensureDoc("checkFirstPage",[e]),await i.ensureDoc("checkLastPage",[e]);const t=await i.ensureDoc("isPureXfa");if(t){const e=new WorkerTask("loadXfaResources");startWorkerTask(e),await i.ensureDoc("loadXfaResources",[d,e]),finishWorkerTask(e)}const[n,a]=await Promise.all([i.ensureDoc("numPages"),i.ensureDoc("fingerprints")]);return{numPages:n,fingerprints:a,htmlForXfa:t?await i.ensureDoc("htmlForXfa"):null}}function setupDoc(e){function onSuccess(e){ensureNotTerminated(),d.send("GetDoc",{pdfInfo:e})}function onFailure(e){if(ensureNotTerminated(),e instanceof Jt){const t=new WorkerTask(`PasswordException: response ${e.code}`);startWorkerTask(t),d.sendWithPromise("PasswordRequest",e).then(function({password:e}){finishWorkerTask(t),i.updatePassword(e),pdfManagerReady()}).catch(function(){finishWorkerTask(t),d.send("DocException",e)})}else d.send("DocException",wrapReason$1(e))}function pdfManagerReady(){ensureNotTerminated(),loadDocument(!1).then(onSuccess,function(e){ensureNotTerminated(),e instanceof XRefParseException?i.requestLoadedStream().then(function(){ensureNotTerminated(),loadDocument(!0).then(onSuccess,onFailure)}):onFailure(e)})}ensureNotTerminated(),async function({data:e,password:t,disableAutoFetch:i,rangeChunkSize:n,length:s,docBaseUrl:r,enableXfa:l,evaluatorOptions:c}){const h={source:null,disableAutoFetch:i,docBaseUrl:r,docId:o,enableXfa:l,evaluatorOptions:c,handler:d,length:s,password:t,rangeChunkSize:n};if(e)return h.source=e,new LocalPdfManager(h);const u=new PDFWorkerStream(d),g=u.getFullReader(),f=Promise.withResolvers();let p,m=[],b=0;return g.headersReady.then(function(){if(g.isRangeSupported){h.source=u,h.length=g.contentLength,h.disableAutoFetch||=g.isStreamingSupported,p=new NetworkPdfManager(h);for(const e of m)p.sendProgressiveData(e);m=[],f.resolve(p),a=null}}).catch(function(e){f.reject(e),a=null}),new Promise(function(e,t){const readChunk=function({value:e,done:i}){try{if(ensureNotTerminated(),i){if(!p){const e=arrayBuffersToBytes(m);m=[],s&&e.length!==s&&warn$1("reported HTTP length is different from actual"),h.source=e,p=new LocalPdfManager(h),f.resolve(p)}return void(a=null)}b+=e.byteLength,g.isStreamingSupported||d.send("DocProgress",{loaded:b,total:Math.max(b,g.contentLength||0)}),p?p.sendProgressiveData(e):m.push(e),g.read().then(readChunk,t)}catch(e){t(e)}};g.read().then(readChunk,t)}).catch(function(e){f.reject(e),a=null}),a=e=>{u.cancelAllRequests(e)},f.promise}(e).then(function(e){if(n)throw e.terminate(new ii("Worker was terminated.")),new Error("Worker was terminated");i=e,i.requestLoadedStream(!0).then(e=>{d.send("DataLoaded",{length:e.bytes.byteLength})})}).then(pdfManagerReady,onFailure)}return d.on("GetPage",function(e){return i.getPage(e.pageIndex).then(function(e){return Promise.all([i.ensure(e,"rotate"),i.ensure(e,"ref"),i.ensure(e,"userUnit"),i.ensure(e,"view")]).then(function([e,t,i,n]){return{rotate:e,ref:t,refStr:t?.toString()??null,userUnit:i,view:n}})})}),d.on("GetPageIndex",function(e){const t=Ref.get(e.num,e.gen);return i.ensureCatalog("getPageIndex",[t])}),d.on("GetDestinations",function(e){return i.ensureCatalog("destinations")}),d.on("GetDestination",function(e){return i.ensureCatalog("getDestination",[e.id])}),d.on("GetPageLabels",function(e){return i.ensureCatalog("pageLabels")}),d.on("GetPageLayout",function(e){return i.ensureCatalog("pageLayout")}),d.on("GetPageMode",function(e){return i.ensureCatalog("pageMode")}),d.on("GetViewerPreferences",function(e){return i.ensureCatalog("viewerPreferences")}),d.on("GetOpenAction",function(e){return i.ensureCatalog("openAction")}),d.on("GetAttachments",function(e){return i.ensureCatalog("attachments")}),d.on("GetDocJSActions",function(e){return i.ensureCatalog("jsActions")}),d.on("GetPageJSActions",function({pageIndex:e}){return i.getPage(e).then(e=>i.ensure(e,"jsActions"))}),d.on("GetAnnotationsByType",async function({types:e,pageIndexesToSkip:t}){const[n,a]=await Promise.all([i.ensureDoc("numPages"),i.ensureDoc("annotationGlobals")]);if(!a)return null;const s=[],r=[];let o=null;try{for(let l=0,c=n;l<c;l++)t?.has(l)||(o||(o=new WorkerTask("GetAnnotationsByType"),startWorkerTask(o)),s.push(i.getPage(l).then(async t=>t&&t.collectAnnotationsByType(d,o,e,r,a)||[])));await Promise.all(s);return(await Promise.all(r)).filter(e=>!!e)}finally{o&&finishWorkerTask(o)}}),d.on("GetOutline",function(e){return i.ensureCatalog("documentOutline")}),d.on("GetOptionalContentConfig",function(e){return i.ensureCatalog("optionalContentConfig")}),d.on("GetPermissions",function(e){return i.ensureCatalog("permissions")}),d.on("GetMetadata",function(e){return Promise.all([i.ensureDoc("documentInfo"),i.ensureCatalog("metadata")])}),d.on("GetMarkInfo",function(e){return i.ensureCatalog("markInfo")}),d.on("GetData",function(e){return i.requestLoadedStream().then(e=>e.bytes)}),d.on("GetAnnotations",function({pageIndex:e,intent:t}){return i.getPage(e).then(function(i){const n=new WorkerTask(`GetAnnotations: page ${e}`);return startWorkerTask(n),i.getAnnotationsData(d,n,t).then(e=>(finishWorkerTask(n),e),e=>{throw finishWorkerTask(n),e})})}),d.on("GetFieldObjects",function(e){return i.ensureDoc("fieldObjects").then(e=>e?.allFields||null)}),d.on("HasJSActions",function(e){return i.ensureDoc("hasJSActions")}),d.on("GetCalculationOrderIds",function(e){return i.ensureDoc("calculationOrderIds")}),d.on("SaveDocument",async function({isPureXfa:e,numPages:t,annotationStorage:n,filename:a}){const s=[i.requestLoadedStream(),i.ensureCatalog("acroForm"),i.ensureCatalog("acroFormRef"),i.ensureDoc("startXRef"),i.ensureDoc("xref"),i.ensureCatalog("structTreeRoot")],r=new RefSetCache,o=[],l=e?null:getNewAnnotationsMap(n),[c,h,u,g,f,p]=await Promise.all(s),m=f.trailer.getRaw("Root")||null;let b;if(l){p?await p.canUpdateStructTree({pdfManager:i,newAnnotationsByPage:l})&&(b=p):await StructTreeRoot.canCreateStructureTree({catalogRef:m,pdfManager:i,newAnnotationsByPage:l})&&(b=null);const e=AnnotationFactory.generateImages(n.values(),f,i.evaluatorOptions.isOffscreenCanvasSupported),t=void 0===b?o:[];for(const[n,a]of l)t.push(i.getPage(n).then(t=>{const i=new WorkerTask(`Save (editor): page ${n}`);return startWorkerTask(i),t.saveNewAnnotations(d,i,a,e,r).finally(function(){finishWorkerTask(i)})}));null===b?o.push(Promise.all(t).then(async()=>{await StructTreeRoot.createStructureTree({newAnnotationsByPage:l,xref:f,catalogRef:m,pdfManager:i,changes:r})})):b&&o.push(Promise.all(t).then(async()=>{await b.updateStructureTree({newAnnotationsByPage:l,pdfManager:i,changes:r})}))}if(e)o.push(i.ensureDoc("serializeXfaData",[n]));else for(let e=0;e<t;e++)o.push(i.getPage(e).then(function(t){const i=new WorkerTask(`Save: page ${e}`);return startWorkerTask(i),t.save(d,i,n,r).finally(function(){finishWorkerTask(i)})}));const y=await Promise.all(o);let w=null;if(e){if(w=y[0],!w)return c.bytes}else if(0===r.size)return c.bytes;const x=u&&h instanceof Dict&&r.values().some(e=>e.needAppearances),S=h instanceof Dict&&h.get("XFA")||null;let v=null,C=!1;if(Array.isArray(S)){for(let e=0,t=S.length;e<t;e+=2)"datasets"===S[e]&&(v=S[e+1],C=!0);null===v&&(v=f.getNewTemporaryRef())}else S&&warn$1("Unsupported XFA type.");let k=Object.create(null);if(f.trailer){const e=new Map,t=f.trailer.get("Info")||null;if(t instanceof Dict)for(const[i,n]of t)"string"==typeof n&&e.set(i,stringToPDFString(n));k={rootRef:m,encryptRef:f.trailer.getRaw("Encrypt")||null,newRef:f.getNewTemporaryRef(),infoRef:f.trailer.getRaw("Info")||null,infoMap:e,fileIds:f.trailer.get("ID")||null,startXRef:g,filename:a}}return incrementalUpdate({originalData:c.bytes,xrefInfo:k,changes:r,xref:f,hasXfa:!!S,xfaDatasetsRef:v,hasXfaDatasetsEntry:C,needAppearances:x,acroFormRef:u,acroForm:h,xfaData:w,useXrefStream:isDict(f.topDict,"XRef")}).finally(()=>{f.resetNewTemporaryRef()})}),d.on("GetOperatorList",function(e,t){const n=e.pageIndex;i.getPage(n).then(function(i){const a=new WorkerTask(`GetOperatorList: page ${n}`);startWorkerTask(a);const s=r>=se?Date.now():0;i.getOperatorList({handler:d,sink:t,task:a,intent:e.intent,cacheKey:e.cacheKey,annotationStorage:e.annotationStorage,modifiedIds:e.modifiedIds}).then(function(e){finishWorkerTask(a),s&&info$1(`page=${n+1} - getOperatorList: time=${Date.now()-s}ms, len=${e.length}`),t.close()},function(e){finishWorkerTask(a),a.terminated||t.error(e)})})}),d.on("GetTextContent",function(e,t){const{pageIndex:n,includeMarkedContent:a,disableNormalization:s}=e;i.getPage(n).then(function(e){const i=new WorkerTask("GetTextContent: page "+n);startWorkerTask(i);const o=r>=se?Date.now():0;e.extractTextContent({handler:d,task:i,sink:t,includeMarkedContent:a,disableNormalization:s}).then(function(){finishWorkerTask(i),o&&info$1(`page=${n+1} - getTextContent: time=`+(Date.now()-o)+"ms"),t.close()},function(e){finishWorkerTask(i),i.terminated||t.error(e)})})}),d.on("GetStructTree",function(e){return i.getPage(e.pageIndex).then(e=>i.ensure(e,"getStructTree"))}),d.on("FontFallback",function(e){return i.fontFallback(e.id,d)}),d.on("Cleanup",function(e){return i.cleanup(!0)}),d.on("Terminate",function(e){n=!0;const t=[];if(i){i.terminate(new ii("Worker was terminated."));const e=i.cleanup();t.push(e),i=null}else clearGlobalCaches();a?.(new ii("Worker was terminated."));for(const e of s)t.push(e.finished),e.terminate();return Promise.all(t).then(function(){d.destroy(),d=null})}),d.on("Ready",function(t){setupDoc(e),e=null}),h}static initializeFromPort(e){const t=new Tl("worker","main",e);this.setup(t,e),t.send("ready",null)}}globalThis.pdfjsWorker={WorkerMessageHandler:WorkerMessageHandler};const Fl=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),Il=[.001,0,0,.001,0,0],El=1.35,Ml=1,Dl=2,_l=4,Pl=16,Rl=32,Bl=64,Nl=128,Ll=256,jl={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},$l="pdfjs_internal_editor_",Hl={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},Xl={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},ql={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},zl=0,Wl=1,Gl=2,Vl=3,Kl=3,Yl=4,Jl={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Zl={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},Ql=1,ec=2,tc=3,ic=4,nc=5,ac={ERRORS:0,WARNINGS:1,INFOS:5},sc={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},rc=0,oc=1,lc=2,cc=3,hc={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let dc=ac.WARNINGS;function setVerbosityLevel(e){Number.isInteger(e)&&(dc=e)}function getVerbosityLevel(){return dc}function info(e){dc>=ac.INFOS&&console.info(`Info: ${e}`)}function warn(e){dc>=ac.WARNINGS&&console.warn(`Warning: ${e}`)}function unreachable(e){throw new Error(e)}function assert(e,t){e||unreachable(t)}function createValidAbsoluteUrl(e,t=null,i=null){if(!e)return null;if(i&&"string"==typeof e){if(i.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);t?.length>=2&&(e=`http://${e}`)}if(i.tryConvertEncoding)try{e=decodeURIComponent(escape(e))}catch{}}const n=t?URL.parse(e,t):URL.parse(e);return function(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n)?n:null}function updateUrlHash(e,t,i=!1){const n=URL.parse(e);return n?(n.hash=t,n.href):i&&createValidAbsoluteUrl(e,"http://example.com")?e.split("#",1)[0]+""+(t?`#${t}`:""):""}function shadow(e,t,i,n=!1){return Object.defineProperty(e,t,{value:i,enumerable:!n,configurable:!0,writable:!1}),i}const uc=function(){function BaseException(e,t){this.message=e,this.name=t}return BaseException.prototype=new Error,BaseException.constructor=BaseException,BaseException}();class PasswordException extends uc{constructor(e,t){super(e,"PasswordException"),this.code=t}}class UnknownErrorException extends uc{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class InvalidPDFException extends uc{constructor(e){super(e,"InvalidPDFException")}}class ResponseException extends uc{constructor(e,t,i){super(e,"ResponseException"),this.status=t,this.missing=i}}class FormatError extends uc{constructor(e){super(e,"FormatError")}}class AbortException extends uc{constructor(e){super(e,"AbortException")}}function bytesToString(e){"object"==typeof e&&void 0!==e?.length||unreachable("Invalid argument for bytesToString");const t=e.length,i=8192;if(t<i)return String.fromCharCode.apply(null,e);const n=[];for(let a=0;a<t;a+=i){const s=Math.min(a+i,t),r=e.subarray(a,s);n.push(String.fromCharCode.apply(null,r))}return n.join("")}function stringToBytes(e){"string"!=typeof e&&unreachable("Invalid argument for stringToBytes");const t=e.length,i=new Uint8Array(t);for(let n=0;n<t;++n)i[n]=255&e.charCodeAt(n);return i}class util_FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",function(){const e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return shadow(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get platform(){const{platform:e,userAgent:t}=navigator;return shadow(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){return shadow(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const gc=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0"));class Util{static makeHexColor(e,t,i){return`#${gc[e]}${gc[t]}${gc[i]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let i;e[0]?(e[0]<0&&(i=t[0],t[0]=t[2],t[2]=i),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(i=t[1],t[1]=t[3],t[3]=i),t[1]*=e[3],t[3]*=e[3]):(i=t[0],t[0]=t[1],t[1]=i,i=t[2],t[2]=t[3],t[3]=i,e[1]<0&&(i=t[1],t[1]=t[3],t[3]=i),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(i=t[0],t[0]=t[2],t[2]=i),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,i=0){const n=e[i],a=e[i+1];e[i]=n*t[0]+a*t[2]+t[4],e[i+1]=n*t[1]+a*t[3]+t[5]}static applyTransformToBezier(e,t,i=0){const n=t[0],a=t[1],s=t[2],r=t[3],o=t[4],l=t[5];for(let t=0;t<6;t+=2){const c=e[i+t],h=e[i+t+1];e[i+t]=c*n+h*s+o,e[i+t+1]=c*a+h*r+l}}static applyInverseTransform(e,t){const i=e[0],n=e[1],a=t[0]*t[3]-t[1]*t[2];e[0]=(i*t[3]-n*t[2]+t[2]*t[5]-t[4]*t[3])/a,e[1]=(-i*t[1]+n*t[0]+t[4]*t[1]-t[5]*t[0])/a}static axialAlignedBoundingBox(e,t,i){const n=t[0],a=t[1],s=t[2],r=t[3],o=t[4],l=t[5],c=e[0],h=e[1],d=e[2],u=e[3];let g=n*c+o,f=g,p=n*d+o,m=p,b=r*h+l,y=b,w=r*u+l,x=w;if(0!==a||0!==s){const e=a*c,t=a*d,i=s*h,n=s*u;g+=i,m+=i,p+=n,f+=n,b+=e,x+=e,w+=t,y+=t}i[0]=Math.min(i[0],g,p,f,m),i[1]=Math.min(i[1],b,w,y,x),i[2]=Math.max(i[2],g,p,f,m),i[3]=Math.max(i[3],b,w,y,x)}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){const i=e[0],n=e[1],a=e[2],s=e[3],r=i**2+n**2,o=i*a+n*s,l=a**2+s**2,c=(r+l)/2,h=Math.sqrt(c**2-(r*l-o**2));t[0]=Math.sqrt(c+h||1),t[1]=Math.sqrt(c-h||1)}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const i=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),n=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(i>n)return null;const a=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return a>s?null:[i,a,n,s]}static pointBoundingBox(e,t,i){i[0]=Math.min(i[0],e),i[1]=Math.min(i[1],t),i[2]=Math.max(i[2],e),i[3]=Math.max(i[3],t)}static rectBoundingBox(e,t,i,n,a){a[0]=Math.min(a[0],e,i),a[1]=Math.min(a[1],t,n),a[2]=Math.max(a[2],e,i),a[3]=Math.max(a[3],t,n)}static#e(e,t,i,n,a,s,r,o,l,c){if(l<=0||l>=1)return;const h=1-l,d=l*l,u=d*l,g=h*(h*(h*e+3*l*t)+3*d*i)+u*n,f=h*(h*(h*a+3*l*s)+3*d*r)+u*o;c[0]=Math.min(c[0],g),c[1]=Math.min(c[1],f),c[2]=Math.max(c[2],g),c[3]=Math.max(c[3],f)}static#t(e,t,i,n,a,s,r,o,l,c,h,d){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&this.#e(e,t,i,n,a,s,r,o,-h/c,d));const u=c**2-4*h*l;if(u<0)return;const g=Math.sqrt(u),f=2*l;this.#e(e,t,i,n,a,s,r,o,(-c+g)/f,d),this.#e(e,t,i,n,a,s,r,o,(-c-g)/f,d)}static bezierBoundingBox(e,t,i,n,a,s,r,o,l){l[0]=Math.min(l[0],e,r),l[1]=Math.min(l[1],t,o),l[2]=Math.max(l[2],e,r),l[3]=Math.max(l[3],t,o),this.#t(e,i,a,r,t,n,s,o,3*(3*(i-a)-e+r),6*(e-2*i+a),3*(i-e),l),this.#t(e,i,a,r,t,n,s,o,3*(3*(n-s)-t+o),6*(t-2*n+s),3*(n-t),l)}}let fc=null,pc=null;function normalizeUnicode(e){return fc||(fc=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,pc=new Map([["ſt","ſt"]])),e.replaceAll(fc,(e,t,i)=>t?t.normalize("NFKC"):pc.get(i))}function getUuid(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();const e=new Uint8Array(32);return crypto.getRandomValues(e),bytesToString(e)}const mc="pdfjs_internal_id_";function MathClamp(e,t,i){return Math.min(Math.max(e,t),i)}function toBase64Util(e){return Uint8Array.prototype.toBase64?e.toBase64():btoa(bytesToString(e))}"function"!=typeof Promise.try&&(Promise.try=function(e,...t){return new Promise(i=>{i(e(...t))})}),"function"!=typeof Math.sumPrecise&&(Math.sumPrecise=function(e){return e.reduce((e,t)=>e+t,0)});class XfaText{static textContent(e){const t=[],i={items:t,styles:Object.create(null)};return function walk(e){if(!e)return;let i=null;const n=e.name;if("#text"===n)i=e.value;else{if(!XfaText.shouldBuildText(n))return;e?.attributes?.textContent?i=e.attributes.textContent:e.value&&(i=e.value)}if(null!==i&&t.push({str:i}),e.children)for(const t of e.children)walk(t)}(e),i}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}class XfaLayer{static setupStorage(e,t,i,n,a){const s=n.getValue(t,{value:null});switch(i.name){case"textarea":if(null!==s.value&&(e.textContent=s.value),"print"===a)break;e.addEventListener("input",e=>{n.setValue(t,{value:e.target.value})});break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(s.value===i.attributes.xfaOn?e.setAttribute("checked",!0):s.value===i.attributes.xfaOff&&e.removeAttribute("checked"),"print"===a)break;e.addEventListener("change",e=>{n.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})})}else{if(null!==s.value&&e.setAttribute("value",s.value),"print"===a)break;e.addEventListener("input",e=>{n.setValue(t,{value:e.target.value})})}break;case"select":if(null!==s.value){e.setAttribute("value",s.value);for(const e of i.children)e.attributes.value===s.value?e.attributes.selected=!0:e.attributes.hasOwnProperty("selected")&&delete e.attributes.selected}e.addEventListener("input",e=>{const i=e.target.options,a=-1===i.selectedIndex?"":i[i.selectedIndex].value;n.setValue(t,{value:a})})}}static setAttributes({html:e,element:t,storage:i=null,intent:n,linkService:a}){const{attributes:s}=t,r=e instanceof HTMLAnchorElement;"radio"===s.type&&(s.name=`${s.name}-${n}`);for(const[t,i]of Object.entries(s))if(null!=i)switch(t){case"class":i.length&&e.setAttribute(t,i.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",i);break;case"style":Object.assign(e.style,i);break;case"textContent":e.textContent=i;break;default:(!r||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,i)}r&&a.addLinkAttributes(e,s.href,s.newWindow),i&&s.dataId&&this.setupStorage(e,s.dataId,t,i)}static render(e){const t=e.annotationStorage,i=e.linkService,n=e.xfaHtml,a=e.intent||"display",s=document.createElement(n.name);n.attributes&&this.setAttributes({html:s,element:n,intent:a,linkService:i});const r="richText"!==a,o=e.div;if(o.append(s),e.viewport){const t=`matrix(${e.viewport.transform.join(",")})`;o.style.transform=t}r&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const e=document.createTextNode(n.value);s.append(e),r&&XfaText.shouldBuildText(n.name)&&l.push(e)}return{textDivs:l}}const c=[[n,-1,s]];for(;c.length>0;){const[e,n,s]=c.at(-1);if(n+1===e.children.length){c.pop();continue}const o=e.children[++c.at(-1)[1]];if(null===o)continue;const{name:h}=o;if("#text"===h){const e=document.createTextNode(o.value);l.push(e),s.append(e);continue}const d=o?.attributes?.xmlns?document.createElementNS(o.attributes.xmlns,h):document.createElement(h);if(s.append(d),o.attributes&&this.setAttributes({html:d,element:o,storage:t,intent:a,linkService:i}),o.children?.length>0)c.push([o,-1,d]);else if(o.value){const e=document.createTextNode(o.value);r&&XfaText.shouldBuildText(h)&&l.push(e),d.append(e)}}for(const e of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))e.setAttribute("readOnly",!0);return{textDivs:l}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}const bc="http://www.w3.org/2000/svg";class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function fetchData(e,t="text"){if(isValidFetchUrl(e,document.baseURI)){const i=await fetch(e);if(!i.ok)throw new Error(i.statusText);switch(t){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise((i,n)=>{const a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType=t,a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE)if(200!==a.status&&0!==a.status)n(new Error(a.statusText));else{switch(t){case"arraybuffer":case"blob":case"json":return void i(a.response)}i(a.responseText)}},a.send(null)})}class PageViewport{constructor({viewBox:e,userUnit:t,scale:i,rotation:n,offsetX:a=0,offsetY:s=0,dontFlip:r=!1}){this.viewBox=e,this.userUnit=t,this.scale=i,this.rotation=n,this.offsetX=a,this.offsetY=s,i*=t;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,h,d,u,g,f,p,m;switch((n%=360)<0&&(n+=360),n){case 180:c=-1,h=0,d=0,u=1;break;case 90:c=0,h=1,d=1,u=0;break;case 270:c=0,h=-1,d=-1,u=0;break;case 0:c=1,h=0,d=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}r&&(d=-d,u=-u),0===c?(g=Math.abs(l-e[1])*i+a,f=Math.abs(o-e[0])*i+s,p=(e[3]-e[1])*i,m=(e[2]-e[0])*i):(g=Math.abs(o-e[0])*i+a,f=Math.abs(l-e[1])*i+s,p=(e[2]-e[0])*i,m=(e[3]-e[1])*i),this.transform=[c*i,h*i,d*i,u*i,g-c*i*o-d*i*l,f-h*i*o-u*i*l],this.width=p,this.height=m}get rawDims(){const e=this.viewBox;return shadow(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:a=!1}={}){return new PageViewport({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:i,offsetY:n,dontFlip:a})}convertToViewportPoint(e,t){const i=[e,t];return Util.applyTransform(i,this.transform),i}convertToViewportRectangle(e){const t=[e[0],e[1]];Util.applyTransform(t,this.transform);const i=[e[2],e[3]];return Util.applyTransform(i,this.transform),[t[0],t[1],i[0],i[1]]}convertToPdfPoint(e,t){const i=[e,t];return Util.applyInverseTransform(i,this.transform),i}}class RenderingCancelledException extends uc{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function isDataScheme(e){const t=e.length;let i=0;for(;i<t&&""===e[i].trim();)i++;return"data:"===e.substring(i,i+5).toLowerCase()}function isPdfFile(e){return"string"==typeof e&&/\.pdf$/i.test(e)}function getFilenameFromUrl(e){return[e]=e.split(/[#?]/,1),e.substring(e.lastIndexOf("/")+1)}function getPdfFilenameFromUrl(e,t="document.pdf"){if("string"!=typeof e)return t;if(isDataScheme(e))return warn('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const i=(e=>{try{return new URL(e)}catch{try{return new URL(decodeURIComponent(e))}catch{try{return new URL(e,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(e),"https://foo.bar")}catch{return null}}}}})(e);if(!i)return t;const decode=e=>{try{let t=decodeURIComponent(e);return t.includes("/")?(t=t.split("/").at(-1),t.test(/^\.pdf$/i)?t:e):t}catch{return e}},n=/\.pdf$/i,a=i.pathname.split("/").at(-1);if(n.test(a))return decode(a);if(i.searchParams.size>0){const e=Array.from(i.searchParams.values()).reverse();for(const t of e)if(n.test(t))return decode(t);const t=Array.from(i.searchParams.keys()).reverse();for(const e of t)if(n.test(e))return decode(e)}if(i.hash){const e=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(i.hash);if(e)return decode(e[0])}return t}class StatTimer{started=Object.create(null);times=[];time(e){e in this.started&&warn(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||warn(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:e}of this.times)t=Math.max(e.length,t);for(const{name:i,start:n,end:a}of this.times)e.push(`${i.padEnd(t)} ${a-n}ms\n`);return e.join("")}}function isValidFetchUrl(e,t){const i=t?URL.parse(e,t):URL.parse(e);return"http:"===i?.protocol||"https:"===i?.protocol}function noContextMenu(e){e.preventDefault()}function stopEvent(e){e.preventDefault(),e.stopPropagation()}class PDFDateString{static#dt;static toDateObject(e){if(e instanceof Date)return e;if(!e||"string"!=typeof e)return null;this.#dt||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const t=this.#dt.exec(e);if(!t)return null;const i=parseInt(t[1],10);let n=parseInt(t[2],10);n=n>=1&&n<=12?n-1:0;let a=parseInt(t[3],10);a=a>=1&&a<=31?a:1;let s=parseInt(t[4],10);s=s>=0&&s<=23?s:0;let r=parseInt(t[5],10);r=r>=0&&r<=59?r:0;let o=parseInt(t[6],10);o=o>=0&&o<=59?o:0;const l=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let h=parseInt(t[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===l?(s+=c,r+=h):"+"===l&&(s-=c,r-=h),new Date(Date.UTC(i,n,a,s,r,o))}}function getXfaPageViewport(e,{scale:t=1,rotation:i=0}){const{width:n,height:a}=e.attributes.style,s=[0,0,parseInt(n),parseInt(a)];return new PageViewport({viewBox:s,userUnit:1,scale:t,rotation:i})}function getRGB(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(16711680&t)>>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map(e=>parseInt(e)):e.startsWith("rgba(")?e.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(warn(`Not a valid color format: "${e}"`),[0,0,0])}function getCurrentTransform(e){const{a:t,b:i,c:n,d:a,e:s,f:r}=e.getTransform();return[t,i,n,a,s,r]}function getCurrentTransformInverse(e){const{a:t,b:i,c:n,d:a,e:s,f:r}=e.getTransform().invertSelf();return[t,i,n,a,s,r]}function setLayerDimensions(e,t,i=!1,n=!0){if(t instanceof PageViewport){const{pageWidth:n,pageHeight:a}=t.rawDims,{style:s}=e,r=util_FeatureTest.isCSSRoundSupported,o=`var(--total-scale-factor) * ${n}px`,l=`var(--total-scale-factor) * ${a}px`,c=r?`round(down, ${o}, var(--scale-round-x))`:`calc(${o})`,h=r?`round(down, ${l}, var(--scale-round-y))`:`calc(${l})`;i&&t.rotation%180!=0?(s.width=h,s.height=c):(s.width=c,s.height=h)}n&&e.setAttribute("data-main-rotation",t.rotation)}class OutputScale{constructor(){const{pixelRatio:e}=OutputScale;this.sx=e,this.sy=e}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(e,t,i,n,a=-1){let s=1/0,r=1/0,o=1/0;(i=OutputScale.capPixels(i,a))>0&&(s=Math.sqrt(i/(e*t))),-1!==n&&(r=n/e,o=n/t);const l=Math.min(s,r,o);return(this.sx>l||this.sy>l)&&(this.sx=l,this.sy=l,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){const i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,i):i}return e}}const yc=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class ColorScheme{static get isDarkMode(){return shadow(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class CSSConstants{static get commentForegroundColor(){const e=document.createElement("span");e.classList.add("comment","sidebar");const{style:t}=e;t.width=t.height="0",t.display="none",t.color="var(--comment-fg-color)",document.body.append(e);const{color:i}=window.getComputedStyle(e);return e.remove(),shadow(this,"commentForegroundColor",getRGB(i))}}function applyOpacity(e,t,i,n){const a=255*(1-(n=Math.min(Math.max(n??1,0),1)));return[e=Math.round(e*n+a),t=Math.round(t*n+a),i=Math.round(i*n+a)]}function RGBToHSL(e,t){const i=e[0]/255,n=e[1]/255,a=e[2]/255,s=Math.max(i,n,a),r=Math.min(i,n,a),o=(s+r)/2;if(s===r)t[0]=t[1]=0;else{const e=s-r;switch(t[1]=o<.5?e/(s+r):e/(2-s-r),s){case i:t[0]=60*((n-a)/e+(n<a?6:0));break;case n:t[0]=60*((a-i)/e+2);break;case a:t[0]=60*((i-n)/e+4)}}t[2]=o}function HSLToRGB(e,t){const i=e[0],n=e[1],a=e[2],s=(1-Math.abs(2*a-1))*n,r=s*(1-Math.abs(i/60%2-1)),o=a-s/2;switch(Math.floor(i/60)){case 0:t[0]=s+o,t[1]=r+o,t[2]=o;break;case 1:t[0]=r+o,t[1]=s+o,t[2]=o;break;case 2:t[0]=o,t[1]=s+o,t[2]=r+o;break;case 3:t[0]=o,t[1]=r+o,t[2]=s+o;break;case 4:t[0]=r+o,t[1]=o,t[2]=s+o;break;case 5:case 6:t[0]=s+o,t[1]=o,t[2]=r+o}}function computeLuminance(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function contrastRatio(e,t,i){HSLToRGB(e,i),i.map(computeLuminance);const n=.2126*i[0]+.7152*i[1]+.0722*i[2];HSLToRGB(t,i),i.map(computeLuminance);const a=.2126*i[0]+.7152*i[1]+.0722*i[2];return n>a?(n+.05)/(a+.05):(a+.05)/(n+.05)}const wc=new Map;function findContrastColor(e,t){const i=e[0]+256*e[1]+65536*e[2]+16777216*t[0]+4294967296*t[1]+1099511627776*t[2];let n=wc.get(i);if(n)return n;const a=new Float32Array(9),s=a.subarray(0,3),r=a.subarray(3,6);RGBToHSL(e,r);const o=a.subarray(6,9);RGBToHSL(t,o);const l=o[2]<.5,c=l?12:4.5;if(r[2]=l?Math.sqrt(r[2]):1-Math.sqrt(1-r[2]),contrastRatio(r,o,s)<c){let e,t;l?(e=r[2],t=1):(e=0,t=r[2]);const i=.005;for(;t-e>i;){const i=r[2]=(e+t)/2;l===contrastRatio(r,o,s)<c?e=i:t=i}r[2]=l?t:e}return HSLToRGB(r,s),n=Util.makeHexColor(Math.round(255*s[0]),Math.round(255*s[1]),Math.round(255*s[2])),wc.set(i,n),n}function renderRichText({html:e,dir:t,className:i},n){const a=document.createDocumentFragment();if("string"==typeof e){const i=document.createElement("p");i.dir=t||"auto";const n=e.split(/(?:\r\n?|\n)/);for(let e=0,t=n.length;e<t;++e){const a=n[e];i.append(document.createTextNode(a)),e<t-1&&i.append(document.createElement("br"))}a.append(i)}else XfaLayer.render({xfaHtml:e,div:a,intent:"richText"});a.firstChild.classList.add("richText",i),n.append(a)}class EditorToolbar{#ut=null;#gt=null;#ft;#pt=null;#mt=null;#bt=null;#yt=null;#wt=null;static#At=null;constructor(e){this.#ft=e,EditorToolbar.#At||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const e=this.#ut=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const t=this.#ft._uiManager._signal;t instanceof AbortSignal&&!t.aborted&&(e.addEventListener("contextmenu",noContextMenu,{signal:t}),e.addEventListener("pointerdown",EditorToolbar.#xt,{signal:t}));const i=this.#pt=document.createElement("div");i.className="buttons",e.append(i);const n=this.#ft.toolbarPosition;if(n){const{style:t}=e,i="ltr"===this.#ft._uiManager.direction?1-n[0]:n[0];t.insetInlineEnd=100*i+"%",t.top=`calc(${100*n[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#ut}static#xt(e){e.stopPropagation()}#St(e){this.#ft._focusEventsAllowed=!1,stopEvent(e)}#vt(e){this.#ft._focusEventsAllowed=!0,stopEvent(e)}#Ct(e){const t=this.#ft._uiManager._signal;return t instanceof AbortSignal&&!t.aborted&&(e.addEventListener("focusin",this.#St.bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",this.#vt.bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",noContextMenu,{signal:t}),!0)}hide(){this.#ut.classList.add("hidden"),this.#gt?.hideDropdown()}show(){this.#ut.classList.remove("hidden"),this.#mt?.shown(),this.#bt?.shown()}addDeleteButton(){const{editorType:e,_uiManager:t}=this.#ft,i=document.createElement("button");i.classList.add("basic","deleteButton"),i.tabIndex=0,i.setAttribute("data-l10n-id",EditorToolbar.#At[e]),this.#Ct(i)&&i.addEventListener("click",e=>{t.delete()},{signal:t._signal}),this.#pt.append(i)}get#kt(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const t=await e.render();this.#Ct(t),this.#pt.append(t,this.#kt),this.#mt=e}addComment(e,t=null){if(this.#bt)return;const i=e.renderForToolbar();if(!i)return;this.#Ct(i);const n=this.#yt=this.#kt;t?(this.#pt.insertBefore(i,t),this.#pt.insertBefore(n,t)):this.#pt.append(i,n),this.#bt=e,e.toolbar=this}addColorPicker(e){if(this.#gt)return;this.#gt=e;const t=e.renderButton();this.#Ct(t),this.#pt.append(t,this.#kt)}async addEditSignatureButton(e){const t=this.#wt=await e.renderEditButton(this.#ft);this.#Ct(t),this.#pt.append(t,this.#kt)}removeButton(e){if("comment"===e)this.#bt?.removeToolbarCommentButton(),this.#bt=null,this.#yt?.remove(),this.#yt=null}async addButton(e,t){switch(e){case"colorPicker":this.addColorPicker(t);break;case"altText":await this.addAltText(t);break;case"editSignature":await this.addEditSignatureButton(t);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(t)}}async addButtonBefore(e,t,i){const n=this.#pt.querySelector(i);n&&"comment"===e&&this.addComment(t,n)}updateEditSignatureButton(e){this.#wt&&(this.#wt.title=e)}remove(){this.#ut.remove(),this.#gt?.destroy(),this.#gt=null}}class FloatingToolbar{#pt=null;#ut=null;#Tt;constructor(e){this.#Tt=e}#Ft(){const e=this.#ut=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar");const t=this.#Tt._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener("contextmenu",noContextMenu,{signal:t});const i=this.#pt=document.createElement("div");return i.className="buttons",e.append(i),this.#Tt.hasCommentManager()&&this.#It("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#Tt.commentSelection("floating_button")}),this.#It("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#Tt.highlightSelection("floating_button")}),e}#Et(e,t){let i=0,n=0;for(const a of e){const e=a.y+a.height;if(e<i)continue;const s=a.x+(t?a.width:0);e>i?(n=s,i=e):t?s>n&&(n=s):s<n&&(n=s)}return[t?1-n:n,i]}show(e,t,i){const[n,a]=this.#Et(t,i),{style:s}=this.#ut||=this.#Ft();e.append(this.#ut),s.insetInlineEnd=100*n+"%",s.top=`calc(${100*a}% + var(--editor-toolbar-vert-offset))`}hide(){this.#ut.remove()}#It(e,t,i,n){const a=document.createElement("button");a.classList.add("basic",e),a.tabIndex=0,a.setAttribute("data-l10n-id",t);const s=document.createElement("span");a.append(s),s.className="visuallyHidden",s.setAttribute("data-l10n-id",i);const r=this.#Tt._signal;r instanceof AbortSignal&&!r.aborted&&(a.addEventListener("contextmenu",noContextMenu,{signal:r}),a.addEventListener("click",n,{signal:r})),this.#pt.append(a)}}function bindEvents(e,t,i){for(const n of i)t.addEventListener(n,e[n].bind(e))}class IdManager{#Mt=0;get id(){return`${$l}${this.#Mt++}`}}class ImageManager{#Dt=getUuid();#Mt=0;#Ot=null;static get _isSVGFittingCanvas(){const e=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),t=new Image;t.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';return shadow(this,"_isSVGFittingCanvas",t.decode().then(()=>(e.drawImage(t,0,0,1,1,0,0,1,3),0===new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0])))}async#_t(e,t){this.#Ot||=new Map;let i=this.#Ot.get(e);if(null===i)return null;if(i?.bitmap)return i.refCounter+=1,i;try{let e;if(i||={bitmap:null,id:`image_${this.#Dt}_${this.#Mt++}`,refCounter:0,isSvg:!1},"string"==typeof t?(i.url=t,e=await fetchData(t,"blob")):t instanceof File?e=i.file=t:t instanceof Blob&&(e=t),"image/svg+xml"===e.type){const t=ImageManager._isSVGFittingCanvas,n=new FileReader,a=new Image,s=new Promise((e,s)=>{a.onload=()=>{i.bitmap=a,i.isSvg=!0,e()},n.onload=async()=>{const e=i.svgUrl=n.result;a.src=await t?`${e}#svgView(preserveAspectRatio(none))`:e},a.onerror=n.onerror=s});n.readAsDataURL(e),await s}else i.bitmap=await createImageBitmap(e);i.refCounter=1}catch(e){warn(e),i=null}return this.#Ot.set(e,i),i&&this.#Ot.set(i.id,i),i}async getFromFile(e){const{lastModified:t,name:i,size:n,type:a}=e;return this.#_t(`${t}_${i}_${n}_${a}`,e)}async getFromUrl(e){return this.#_t(e,e)}async getFromBlob(e,t){const i=await t;return this.#_t(e,i)}async getFromId(e){this.#Ot||=new Map;const t=this.#Ot.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){const{blobPromise:e}=t;return delete t.blobPromise,this.getFromBlob(t.id,e)}return this.getFromUrl(t.url)}getFromCanvas(e,t){this.#Ot||=new Map;let i=this.#Ot.get(e);if(i?.bitmap)return i.refCounter+=1,i;const n=new OffscreenCanvas(t.width,t.height);return n.getContext("2d").drawImage(t,0,0),i={bitmap:n.transferToImageBitmap(),id:`image_${this.#Dt}_${this.#Mt++}`,refCounter:1,isSvg:!1},this.#Ot.set(e,i),this.#Ot.set(i.id,i),i}getSvgUrl(e){const t=this.#Ot.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#Ot||=new Map;const t=this.#Ot.get(e);if(!t)return;if(t.refCounter-=1,0!==t.refCounter)return;const{bitmap:i}=t;if(!t.url&&!t.file){const e=new OffscreenCanvas(i.width,i.height);e.getContext("bitmaprenderer").transferFromImageBitmap(i),t.blobPromise=e.convertToBlob()}i.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#Dt}_`)}}class CommandManager{#Pt=[];#Rt=!1;#Bt;#Nt=-1;constructor(e=128){this.#Bt=e}add({cmd:e,undo:t,post:i,mustExec:n,type:a=NaN,overwriteIfSameType:s=!1,keepUndo:r=!1}){if(n&&e(),this.#Rt)return;const o={cmd:e,undo:t,post:i,type:a};if(-1===this.#Nt)return this.#Pt.length>0&&(this.#Pt.length=0),this.#Nt=0,void this.#Pt.push(o);if(s&&this.#Pt[this.#Nt].type===a)return r&&(o.undo=this.#Pt[this.#Nt].undo),void(this.#Pt[this.#Nt]=o);const l=this.#Nt+1;l===this.#Bt?this.#Pt.splice(0,1):(this.#Nt=l,l<this.#Pt.length&&this.#Pt.splice(l)),this.#Pt.push(o)}undo(){if(-1===this.#Nt)return;this.#Rt=!0;const{undo:e,post:t}=this.#Pt[this.#Nt];e(),t?.(),this.#Rt=!1,this.#Nt-=1}redo(){if(this.#Nt<this.#Pt.length-1){this.#Nt+=1,this.#Rt=!0;const{cmd:e,post:t}=this.#Pt[this.#Nt];e(),t?.(),this.#Rt=!1}}hasSomethingToUndo(){return-1!==this.#Nt}hasSomethingToRedo(){return this.#Nt<this.#Pt.length-1}cleanType(e){if(-1!==this.#Nt){for(let t=this.#Nt;t>=0;t--)if(this.#Pt[t].type!==e)return this.#Pt.splice(t+1,this.#Nt-t),void(this.#Nt=t);this.#Pt.length=0,this.#Nt=-1}}destroy(){this.#Pt=null}}class KeyboardManager{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=util_FeatureTest.platform;for(const[i,n,a={}]of e)for(const e of i){const i=e.startsWith("mac+");t&&i?(this.callbacks.set(e.slice(4),{callback:n,options:a}),this.allKeys.add(e.split("+").at(-1))):t||i||(this.callbacks.set(e,{callback:n,options:a}),this.allKeys.add(e.split("+").at(-1)))}}#Lt(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;const i=this.callbacks.get(this.#Lt(t));if(!i)return;const{callback:n,options:{bubbles:a=!1,args:s=[],checker:r=null}}=i;r&&!r(e,t)||(n.bind(e,...s,t)(),a||stopEvent(t))}}class ColorManager{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return function(e){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const i of e.keys()){t.style.color=i;const n=window.getComputedStyle(t).color;e.set(i,getRGB(n))}t.remove()}(e),shadow(this,"_colors",e)}convert(e){const t=getRGB(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[e,i]of this._colors)if(i.every((e,i)=>e===t[i]))return ColorManager._colorsMapping.get(e);return t}getHexCode(e){const t=this._colors.get(e);return t?Util.makeHexColor(...t):e}}class AnnotationEditorUIManager{#Ut=new AbortController;#jt=null;#$t=null;#Ht=new Map;#Xt=new Map;#qt=null;#zt=null;#Wt=null;#Gt=new CommandManager;#Vt=null;#Kt=null;#Yt=null;#Jt=0;#Zt=new Set;#Qt=null;#ei=null;#ti=new Set;_editorUndoBar=null;#ii=!1;#ni=!1;#ai=!1;#si=null;#ri=null;#oi=null;#li=null;#ci=!1;#hi=null;#di=new IdManager;#ui=!1;#gi=!1;#fi=!1;#pi=null;#mi=null;#bi=null;#yi=null;#wi=null;#Ai=Hl.NONE;#xi=new Set;#Si=null;#vi=null;#Ci=null;#ki=null;#Ti=null;#Fi={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#Ii=[0,0];#Ei=null;#Mi=null;#Di=null;#Oi=null;#_i=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const e=AnnotationEditorUIManager.prototype,arrowChecker=e=>e.#Mi.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&e.hasSomethingToControl(),textInputChecker=(e,{target:t})=>{if(t instanceof HTMLInputElement){const{type:e}=t;return"text"!==e&&"number"!==e}return!0},t=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return shadow(this,"_keyboardManager",new KeyboardManager([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:textInputChecker}],[["ctrl+z","mac+meta+z"],e.undo,{checker:textInputChecker}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:textInputChecker}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:textInputChecker}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#Mi.contains(t)&&!e.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#Mi.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-t,0],checker:arrowChecker}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:arrowChecker}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[t,0],checker:arrowChecker}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:arrowChecker}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-t],checker:arrowChecker}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:arrowChecker}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,t],checker:arrowChecker}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:arrowChecker}]]))}constructor(e,t,i,n,a,s,r,o,l,c,h,d,u,g,f,p){const m=this._signal=this.#Ut.signal;this.#Mi=e,this.#Di=t,this.#Oi=i,this.#qt=n,this.#Vt=a,this.#vi=s,this.#Ti=o,this._eventBus=r,r._on("editingaction",this.onEditingAction.bind(this),{signal:m}),r._on("pagechanging",this.onPageChanging.bind(this),{signal:m}),r._on("scalechanging",this.onScaleChanging.bind(this),{signal:m}),r._on("rotationchanging",this.onRotationChanging.bind(this),{signal:m}),r._on("setpreference",this.onSetPreference.bind(this),{signal:m}),r._on("switchannotationeditorparams",e=>this.updateParams(e.type,e.value),{signal:m}),window.addEventListener("pointerdown",()=>{this.#gi=!0},{capture:!0,signal:m}),window.addEventListener("pointerup",()=>{this.#gi=!1},{capture:!0,signal:m}),this.#Pi(),this.#Ri(),this.#Bi(),this.#zt=o.annotationStorage,this.#si=o.filterFactory,this.#Ci=l,this.#li=c||null,this.#ii=h,this.#ni=d,this.#ai=u,this.#wi=g||null,this.viewParameters={realScale:PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=f||null,this._supportsPinchToZoom=!1!==p,a?.setSidebarUiManager(this)}destroy(){this.#_i?.resolve(),this.#_i=null,this.#Ut?.abort(),this.#Ut=null,this._signal=null;for(const e of this.#Xt.values())e.destroy();this.#Xt.clear(),this.#Ht.clear(),this.#ti.clear(),this.#yi?.clear(),this.#jt=null,this.#xi.clear(),this.#Gt.destroy(),this.#qt?.destroy(),this.#Vt?.destroy(),this.#vi?.destroy(),this.#hi?.hide(),this.#hi=null,this.#bi?.destroy(),this.#bi=null,this.#$t=null,this.#ri&&(clearTimeout(this.#ri),this.#ri=null),this.#Ei&&(clearTimeout(this.#Ei),this.#Ei=null),this._editorUndoBar?.destroy(),this.#Ti=null}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#wi}get useNewAltTextFlow(){return this.#ni}get useNewAltTextWhenAddingImage(){return this.#ai}get hcmFilter(){return shadow(this,"hcmFilter",this.#Ci?this.#si.addHCMFilter(this.#Ci.foreground,this.#Ci.background):"none")}get direction(){return shadow(this,"direction",getComputedStyle(this.#Mi).direction)}get _highlightColors(){return shadow(this,"_highlightColors",this.#li?new Map(this.#li.split(",").map(e=>((e=e.split("=").map(e=>e.trim()))[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){const{_highlightColors:e}=this;if(!e)return shadow(this,"highlightColors",null);const t=new Map,i=!!this.#Ci;for(const[n,a]of e){const e=n.endsWith("_HCM");i&&e?t.set(n.replace("_HCM",""),a):i||e||t.set(n,a)}return shadow(this,"highlightColors",t)}get highlightColorNames(){return shadow(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;const t=this.highlightColorNames.get(e);return this._highlightColors.get(t)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#Yt=e}setMainHighlightColorPicker(e){this.#bi=e}editAltText(e,t=!1){this.#qt?.editAltText(this,e,t)}hasCommentManager(){return!!this.#Vt}editComment(e,t,i,n){this.#Vt?.showDialog(this,e,t,i,n)}selectComment(e,t){const i=this.#Xt.get(e),n=i?.getEditorByUID(t);n?.toggleComment(!0,!0)}updateComment(e){this.#Vt?.updateComment(e.getData())}updatePopupColor(e){this.#Vt?.updatePopupColor(e)}removeComment(e){this.#Vt?.removeComments([e.uid])}toggleComment(e,t,i=void 0){this.#Vt?.toggleCommentPopup(e,t,i)}makeCommentColor(e,t){return e&&this.#Vt?.makeCommentColor(e,t)||null}getCommentDialogElement(){return this.#Vt?.dialogElement||null}async waitForEditorsRendered(e){if(this.#Xt.has(e-1))return;const{resolve:t,promise:i}=Promise.withResolvers(),onEditorsRendered=i=>{i.pageNumber===e&&(this._eventBus._off("editorsrendered",onEditorsRendered),t())};this._eventBus.on("editorsrendered",onEditorsRendered),await i}getSignature(e){this.#vi?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#vi}switchToMode(e,t){this._eventBus.on("annotationeditormodechanged",t,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch("setpreference",{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){if("enableNewAltTextWhenAddingImage"===e)this.#ai=t}onPageChanging({pageNumber:e}){this.#Jt=e-1}focusMainContainer(){this.#Mi.focus()}findParent(e,t){for(const i of this.#Xt.values()){const{x:n,y:a,width:s,height:r}=i.div.getBoundingClientRect();if(e>=n&&e<=n+s&&t>=a&&t<=a+r)return i}return null}disableUserSelect(e=!1){this.#Di.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#ti.add(e)}removeShouldRescale(e){this.#ti.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*PixelsPerInch.PDF_TO_CSS_UNITS;for(const e of this.#ti)e.onScaleChanging();this.#Yt?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#Ni({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#Li(e){const{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(const t of this.#Xt.values())if(t.hasTextLayer(e))return t;return null}highlightSelection(e="",t=!1){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:n,anchorOffset:a,focusNode:s,focusOffset:r}=i,o=i.toString(),l=this.#Ni(i).closest(".textLayer"),c=this.getSelectionBoxes(l);if(!c)return;i.empty();const h=this.#Li(l),d=this.#Ai===Hl.NONE,callback=()=>{const i=h?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:c,anchorNode:n,anchorOffset:a,focusNode:s,focusOffset:r,text:o});d&&this.showAllEditors("highlight",!0,!0),t&&i?.editComment()};d?this.switchToMode(Hl.HIGHLIGHT,callback):callback()}commentSelection(e=""){this.highlightSelection(e,!0)}#Ui(){const e=document.getSelection();if(!e||e.isCollapsed)return;const t=this.#Ni(e).closest(".textLayer"),i=this.getSelectionBoxes(t);i&&(this.#hi||=new FloatingToolbar(this),this.#hi.show(t,i,"ltr"===this.direction))}getAndRemoveDataFromAnnotationStorage(e){if(!this.#zt)return null;const t=`${$l}${e}`,i=this.#zt.getRawValue(t);return i&&this.#zt.remove(t),i}addToAnnotationStorage(e){e.isEmpty()||!this.#zt||this.#zt.has(e.id)||this.#zt.setValue(e.id,e)}a11yAlert(e,t=null){const i=this.#Oi;i&&(i.setAttribute("data-l10n-id",e),t?i.setAttribute("data-l10n-args",JSON.stringify(t)):i.removeAttribute("data-l10n-args"))}#ji(){const e=document.getSelection();if(!e||e.isCollapsed)return void(this.#Si&&(this.#hi?.hide(),this.#Si=null,this.#$i({hasSelectedText:!1})));const{anchorNode:t}=e;if(t===this.#Si)return;const i=this.#Ni(e).closest(".textLayer");if(i){if(this.#hi?.hide(),this.#Si=t,this.#$i({hasSelectedText:!0}),(this.#Ai===Hl.HIGHLIGHT||this.#Ai===Hl.NONE)&&(this.#Ai===Hl.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#ci=this.isShiftKeyDown,!this.isShiftKeyDown)){const e=this.#Ai===Hl.HIGHLIGHT?this.#Li(i):null;if(e?.toggleDrawing(),this.#gi){const t=new AbortController,i=this.combinedSignal(t),pointerup=i=>{"pointerup"===i.type&&0!==i.button||(t.abort(),e?.toggleDrawing(!0),"pointerup"===i.type&&this.#Hi("main_toolbar"))};window.addEventListener("pointerup",pointerup,{signal:i}),window.addEventListener("blur",pointerup,{signal:i})}else e?.toggleDrawing(!0),this.#Hi("main_toolbar")}}else this.#Si&&(this.#hi?.hide(),this.#Si=null,this.#$i({hasSelectedText:!1}))}#Hi(e=""){this.#Ai===Hl.HIGHLIGHT?this.highlightSelection(e):this.#ii&&this.#Ui()}#Pi(){document.addEventListener("selectionchange",this.#ji.bind(this),{signal:this._signal})}#Xi(){if(this.#oi)return;this.#oi=new AbortController;const e=this.combinedSignal(this.#oi);window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})}#qi(){this.#oi?.abort(),this.#oi=null}blur(){if(this.isShiftKeyDown=!1,this.#ci&&(this.#ci=!1,this.#Hi("main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const t of this.#xi)if(t.div.contains(e)){this.#mi=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#mi)return;const[e,t]=this.#mi;this.#mi=null,t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#Bi(){if(this.#pi)return;this.#pi=new AbortController;const e=this.combinedSignal(this.#pi);window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})}#zi(){this.#pi?.abort(),this.#pi=null}#Wi(){if(this.#Kt)return;this.#Kt=new AbortController;const e=this.combinedSignal(this.#Kt);document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})}#Gi(){this.#Kt?.abort(),this.#Kt=null}#Ri(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})}addEditListeners(){this.#Bi(),this.#Wi()}removeEditListeners(){this.#zi(),this.#Gi()}dragOver(e){for(const{type:t}of e.dataTransfer.items)for(const i of this.#ei)if(i.isHandlingMimeForPasting(t))return e.dataTransfer.dropEffect="copy",void e.preventDefault()}drop(e){for(const t of e.dataTransfer.items)for(const i of this.#ei)if(i.isHandlingMimeForPasting(t.type))return i.paste(t,this.currentLayer),void e.preventDefault()}copy(e){if(e.preventDefault(),this.#jt?.commitOrRemove(),!this.hasSelection)return;const t=[];for(const e of this.#xi){const i=e.serialize(!0);i&&t.push(i)}0!==t.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:t}=e;for(const e of t.items)for(const t of this.#ei)if(t.isHandlingMimeForPasting(e.type))return void t.paste(e,this.currentLayer);let i=t.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(e){return void warn(`paste: "${e.message}".`)}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const e=[];for(const t of i){const i=await n.deserialize(t);if(!i)return;e.push(i)}const cmd=()=>{for(const t of e)this.#Vi(t);this.#Ki(e)},undo=()=>{for(const t of e)t.remove()};this.addCommands({cmd:cmd,undo:undo,mustExec:!0})}catch(e){warn(`paste: "${e.message}".`)}}keydown(e){this.isShiftKeyDown||"Shift"!==e.key||(this.isShiftKeyDown=!0),this.#Ai===Hl.NONE||this.isEditorHandlingKeyboard||AnnotationEditorUIManager._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&"Shift"===e.key&&(this.isShiftKeyDown=!1,this.#ci&&(this.#ci=!1,this.#Hi("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu")}}#$i(e){Object.entries(e).some(([e,t])=>this.#Fi[e]!==t)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#Fi,e)}),this.#Ai===Hl.HIGHLIGHT&&!1===e.hasSelectedEditor&&this.#Yi([[Xl.HIGHLIGHT_FREE,!0]]))}#Yi(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#Xi(),this.#Wi(),this.#$i({isEditing:this.#Ai!==Hl.NONE,isEmpty:this.#Ji(),hasSomethingToUndo:this.#Gt.hasSomethingToUndo(),hasSomethingToRedo:this.#Gt.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#qi(),this.#Gi(),this.#$i({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#ei){this.#ei=e;for(const e of this.#ei)this.#Yi(e.defaultPropertiesToUpdate)}}getId(){return this.#di.id}get currentLayer(){return this.#Xt.get(this.#Jt)}getLayer(e){return this.#Xt.get(e)}get currentPageIndex(){return this.#Jt}addLayer(e){this.#Xt.set(e.pageIndex,e),this.#ui?e.enable():e.disable()}removeLayer(e){this.#Xt.delete(e.pageIndex)}async updateMode(e,t=null,i=!1,n=!1,a=!1){if(this.#Ai!==e&&(!this.#_i||(await this.#_i.promise,this.#_i))){if(this.#_i=Promise.withResolvers(),this.#Yt?.commitOrRemove(),this.#Ai===Hl.POPUP&&this.#Vt?.hideSidebar(),this.#Vt?.destroyPopup(),this.#Ai=e,e===Hl.NONE){this.setEditingState(!1),this.#Zi();for(const e of this.#Ht.values())e.hideStandaloneCommentButton();return this._editorUndoBar?.hide(),this.toggleComment(null),void this.#_i.resolve()}for(const e of this.#Ht.values())e.addStandaloneCommentButton();e===Hl.SIGNATURE&&await(this.#vi?.loadSignatures()),this.setEditingState(!0),await this.#Qi(),this.unselectAll();for(const t of this.#Xt.values())t.updateMode(e);if(e===Hl.POPUP){this.#$t||=await this.#Ti.getAnnotationsByType(new Set(this.#ei.map(e=>e._editorType)));const e=new Set,t=[];for(const i of this.#Ht.values()){const{annotationElementId:n,hasComment:a,deleted:s}=i;n&&e.add(n),a&&!s&&t.push(i.getData())}for(const i of this.#$t){const{id:n,popupRef:a,contentsObj:s}=i;a&&s?.str&&!e.has(n)&&!this.#Zt.has(n)&&t.push(i)}this.#Vt?.showSidebar(t)}if(!t)return i&&this.addNewEditorFromKeyboard(),void this.#_i.resolve();for(const e of this.#Ht.values())e.uid===t?(this.setSelected(e),a?e.editComment():n?e.enterInEditMode():e.focus()):e.unselect();this.#_i.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#Ai&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,t){if(this.#ei){switch(e){case Xl.CREATE:return void this.currentLayer.addNewEditor(t);case Xl.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#ki||=new Map).set(e,t),this.showAllEditors("highlight",t)}if(this.hasSelection)for(const i of this.#xi)i.updateParams(e,t);else for(const i of this.#ei)i.updateDefaultParams(e,t)}}showAllEditors(e,t,i=!1){for(const i of this.#Ht.values())i.editorType===e&&i.show(t);(this.#ki?.get(Xl.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#Yi([[Xl.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#fi!==e){this.#fi=e;for(const t of this.#Xt.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}async#Qi(){if(!this.#ui){this.#ui=!0;const e=[];for(const t of this.#Xt.values())e.push(t.enable());await Promise.all(e);for(const e of this.#Ht.values())e.enable()}}#Zi(){if(this.unselectAll(),this.#ui){this.#ui=!1;for(const e of this.#Xt.values())e.disable();for(const e of this.#Ht.values())e.disable()}}*getEditors(e){for(const t of this.#Ht.values())t.pageIndex===e&&(yield t)}getEditor(e){return this.#Ht.get(e)}addEditor(e){this.#Ht.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#ri&&clearTimeout(this.#ri),this.#ri=setTimeout(()=>{this.focusMainContainer(),this.#ri=null},0)),this.#Ht.delete(e.id),e.annotationElementId&&this.#yi?.delete(e.annotationElementId),this.unselect(e),e.annotationElementId&&this.#Zt.has(e.annotationElementId)||this.#zt?.remove(e.id)}addDeletedAnnotationElement(e){this.#Zt.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#Zt.has(e)}removeDeletedAnnotationElement(e){this.#Zt.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#Vi(e){const t=this.#Xt.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#jt!==e&&(this.#jt=e,e&&this.#Yi(e.propertiesToUpdate))}get#en(){let e=null;for(e of this.#xi);return e}updateUI(e){this.#en===e&&this.#Yi(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#Yi(e.defaultPropertiesToUpdate)}toggleSelected(e){if(this.#xi.has(e))return this.#xi.delete(e),e.unselect(),void this.#$i({hasSelectedEditor:this.hasSelection});this.#xi.add(e),e.select(),this.#Yi(e.propertiesToUpdate),this.#$i({hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.id}),this.#Yt?.commitOrRemove();for(const t of this.#xi)t!==e&&t.unselect();this.#xi.clear(),this.#xi.add(e),e.select(),this.#Yi(e.propertiesToUpdate),this.#$i({hasSelectedEditor:!0})}isSelected(e){return this.#xi.has(e)}get firstSelectedEditor(){return this.#xi.values().next().value}unselect(e){e.unselect(),this.#xi.delete(e),this.#$i({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#xi.size}get isEnterHandled(){return 1===this.#xi.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#Gt.undo(),this.#$i({hasSomethingToUndo:this.#Gt.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Ji()}),this._editorUndoBar?.hide()}redo(){this.#Gt.redo(),this.#$i({hasSomethingToUndo:!0,hasSomethingToRedo:this.#Gt.hasSomethingToRedo(),isEmpty:this.#Ji()})}addCommands(e){this.#Gt.add(e),this.#$i({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Ji()})}cleanUndoStack(e){this.#Gt.cleanType(e)}#Ji(){if(0===this.#Ht.size)return!0;if(1===this.#Ht.size)for(const e of this.#Ht.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();const e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const t=e?[e]:[...this.#xi],undo=()=>{for(const e of t)this.#Vi(e)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(undo,1===t.length?t[0].editorType:t.length);for(const e of t)e.remove()},undo:undo,mustExec:!0})}commitOrRemove(){this.#jt?.commitOrRemove()}hasSomethingToControl(){return this.#jt||this.hasSelection}#Ki(e){for(const e of this.#xi)e.unselect();this.#xi.clear();for(const t of e)t.isEmpty()||(this.#xi.add(t),t.select());this.#$i({hasSelectedEditor:this.hasSelection})}selectAll(){for(const e of this.#xi)e.commit();this.#Ki(this.#Ht.values())}unselectAll(){if((!this.#jt||(this.#jt.commitOrRemove(),this.#Ai===Hl.NONE))&&!this.#Yt?.commitOrRemove()&&this.hasSelection){for(const e of this.#xi)e.unselect();this.#xi.clear(),this.#$i({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#Ii[0]+=e,this.#Ii[1]+=t;const[n,a]=this.#Ii,s=[...this.#xi];this.#Ei&&clearTimeout(this.#Ei),this.#Ei=setTimeout(()=>{this.#Ei=null,this.#Ii[0]=this.#Ii[1]=0,this.addCommands({cmd:()=>{for(const e of s)this.#Ht.has(e.id)&&(e.translateInPage(n,a),e.translationDone())},undo:()=>{for(const e of s)this.#Ht.has(e.id)&&(e.translateInPage(-n,-a),e.translationDone())},mustExec:!1})},1e3);for(const i of s)i.translateInPage(e,t),i.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#Qt=new Map;for(const e of this.#xi)this.#Qt.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#Qt)return!1;this.disableUserSelect(!1);const e=this.#Qt;this.#Qt=null;let t=!1;for(const[{x:i,y:n,pageIndex:a},s]of e)s.newX=i,s.newY=n,s.newPageIndex=a,t||=i!==s.savedX||n!==s.savedY||a!==s.savedPageIndex;if(!t)return!1;const move=(e,t,i,n)=>{if(this.#Ht.has(e.id)){const a=this.#Xt.get(n);a?e._setParentAndPosition(a,t,i):(e.pageIndex=n,e.x=t,e.y=i)}};return this.addCommands({cmd:()=>{for(const[t,{newX:i,newY:n,newPageIndex:a}]of e)move(t,i,n,a)},undo:()=>{for(const[t,{savedX:i,savedY:n,savedPageIndex:a}]of e)move(t,i,n,a)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#Qt)for(const i of this.#Qt.keys())i.drag(e,t)}rebuild(e){if(null===e.parent){const t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#xi.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#jt===e}getActive(){return this.#jt}getMode(){return this.#Ai}isEditingMode(){return this.#Ai!==Hl.NONE}get imageManager(){return shadow(this,"imageManager",new ImageManager)}getSelectionBoxes(e){if(!e)return null;const t=document.getSelection();for(let i=0,n=t.rangeCount;i<n;i++)if(!e.contains(t.getRangeAt(i).commonAncestorContainer))return null;const{x:i,y:n,width:a,height:s}=e.getBoundingClientRect();let r;switch(e.getAttribute("data-main-rotation")){case"90":r=(e,t,r,o)=>({x:(t-n)/s,y:1-(e+r-i)/a,width:o/s,height:r/a});break;case"180":r=(e,t,r,o)=>({x:1-(e+r-i)/a,y:1-(t+o-n)/s,width:r/a,height:o/s});break;case"270":r=(e,t,r,o)=>({x:1-(t+o-n)/s,y:(e-i)/a,width:o/s,height:r/a});break;default:r=(e,t,r,o)=>({x:(e-i)/a,y:(t-n)/s,width:r/a,height:o/s})}const o=[];for(let e=0,i=t.rangeCount;e<i;e++){const i=t.getRangeAt(e);if(!i.collapsed)for(const{x:e,y:t,width:n,height:a}of i.getClientRects())0!==n&&0!==a&&o.push(r(e,t,n,a))}return 0===o.length?null:o}addChangedExistingAnnotation({annotationElementId:e,id:t}){(this.#Wt||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#Wt?.delete(e)}renderAnnotationElement(e){const t=this.#Wt?.get(e.data.id);if(!t)return;const i=this.#zt.getRawValue(t);i&&(this.#Ai!==Hl.NONE||i.hasBeenModified)&&i.renderAnnotationElement(e)}setMissingCanvas(e,t,i){const n=this.#yi?.get(e);n&&(n.setCanvas(t,i),this.#yi.delete(e))}addMissingCanvas(e,t){(this.#yi||=new Map).set(e,t)}}class AltText{#mt=null;#tn=!1;#in=null;#nn=null;#an=null;#sn=null;#rn=!1;#on=null;#ft=null;#ln=null;#cn=null;#hn=!1;static#dn=null;static _l10n=null;constructor(e){this.#ft=e,this.#hn=e._uiManager.useNewAltTextFlow,AltText.#dn||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(e){AltText._l10n??=e}async render(){const e=this.#in=document.createElement("button");e.className="altText",e.tabIndex="0";const t=this.#nn=document.createElement("span");e.append(t),this.#hn?(e.classList.add("new"),e.setAttribute("data-l10n-id",AltText.#dn.missing),t.setAttribute("data-l10n-id",AltText.#dn["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=this.#ft._uiManager._signal;e.addEventListener("contextmenu",noContextMenu,{signal:i}),e.addEventListener("pointerdown",e=>e.stopPropagation(),{signal:i});const onClick=e=>{e.preventDefault(),this.#ft._uiManager.editAltText(this.#ft),this.#hn&&this.#ft._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#un}})};return e.addEventListener("click",onClick,{capture:!0,signal:i}),e.addEventListener("keydown",t=>{t.target===e&&"Enter"===t.key&&(this.#rn=!0,onClick(t))},{signal:i}),await this.#gn(),e}get#un(){return(this.#mt?"added":null===this.#mt&&this.guessedText&&"review")||"missing"}finish(){this.#in&&(this.#in.focus({focusVisible:this.#rn}),this.#rn=!1)}isEmpty(){return this.#hn?null===this.#mt:!this.#mt&&!this.#tn}hasData(){return this.#hn?null!==this.#mt||!!this.#ln:this.isEmpty()}get guessedText(){return this.#ln}async setGuessedText(e){null===this.#mt&&(this.#ln=e,this.#cn=await AltText._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e}),this.#gn())}toggleAltTextBadge(e=!1){if(!this.#hn||this.#mt)return this.#on?.remove(),void(this.#on=null);if(!this.#on){const e=this.#on=document.createElement("div");e.className="noAltTextBadge",this.#ft.div.append(e)}this.#on.classList.toggle("hidden",!e)}serialize(e){let t=this.#mt;return e||this.#ln!==t||(t=this.#cn),{altText:t,decorative:this.#tn,guessedText:this.#ln,textWithDisclaimer:this.#cn}}get data(){return{altText:this.#mt,decorative:this.#tn}}set data({altText:e,decorative:t,guessedText:i,textWithDisclaimer:n,cancel:a=!1}){i&&(this.#ln=i,this.#cn=n),this.#mt===e&&this.#tn===t||(a||(this.#mt=e,this.#tn=t),this.#gn())}toggle(e=!1){this.#in&&(!e&&this.#sn&&(clearTimeout(this.#sn),this.#sn=null),this.#in.disabled=!e)}shown(){this.#ft._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#un}})}destroy(){this.#in?.remove(),this.#in=null,this.#nn=null,this.#an=null,this.#on?.remove(),this.#on=null}async#gn(){const e=this.#in;if(!e)return;if(this.#hn){if(e.classList.toggle("done",!!this.#mt),e.setAttribute("data-l10n-id",AltText.#dn[this.#un]),this.#nn?.setAttribute("data-l10n-id",AltText.#dn[`${this.#un}-label`]),!this.#mt)return void this.#an?.remove()}else{if(!this.#mt&&!this.#tn)return e.classList.remove("done"),void this.#an?.remove();e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=this.#an;if(!t){this.#an=t=document.createElement("span"),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${this.#ft.id}`;const i=100,n=this.#ft._uiManager._signal;n.addEventListener("abort",()=>{clearTimeout(this.#sn),this.#sn=null},{once:!0}),e.addEventListener("mouseenter",()=>{this.#sn=setTimeout(()=>{this.#sn=null,this.#an.classList.add("show"),this.#ft._reportTelemetry({action:"alt_text_tooltip"})},i)},{signal:n}),e.addEventListener("mouseleave",()=>{this.#sn&&(clearTimeout(this.#sn),this.#sn=null),this.#an?.classList.remove("show")},{signal:n})}this.#tn?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=this.#mt),t.parentNode||e.append(t);const i=this.#ft.getElementForAltText();i?.setAttribute("aria-describedby",t.id)}}class Comment{#fn=null;#pn=null;#mn=!1;#ft=null;#bn=null;#yn=null;#_e=null;#wn=null;#An=!1;#xn=null;constructor(e){this.#ft=e}renderForToolbar(){const e=this.#pn=document.createElement("button");return e.className="comment",this.#Ft(e,!1)}renderForStandalone(){const e=this.#fn=document.createElement("button");e.className="annotationCommentButton";const t=this.#ft.commentButtonPosition;if(t){const{style:i}=e;i.insetInlineEnd=`calc(${100*("ltr"===this.#ft._uiManager.direction?1-t[0]:t[0])}% - var(--comment-button-dim))`,i.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;const n=this.#ft.commentButtonColor;n&&(i.backgroundColor=n)}return this.#Ft(e,!0)}focusButton(){setTimeout(()=>{(this.#fn??this.#pn)?.focus()},0)}onUpdatedColor(){if(!this.#fn)return;const e=this.#ft.commentButtonColor;e&&(this.#fn.style.backgroundColor=e),this.#ft._uiManager.updatePopupColor(this.#ft)}get commentButtonWidth(){return(this.#fn?.getBoundingClientRect().width??0)/this.#ft.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#xn)return this.#xn;if(!this.#fn)return null;const{x:e,y:t,height:i}=this.#fn.getBoundingClientRect(),{x:n,y:a,width:s,height:r}=this.#ft.parent.boundingClientRect;return[(e-n)/s,(t+i-a)/r]}set commentPopupPositionInLayer(e){this.#xn=e}hasDefaultPopupPosition(){return null===this.#xn}removeStandaloneCommentButton(){this.#fn?.remove(),this.#fn=null}removeToolbarCommentButton(){this.#pn?.remove(),this.#pn=null}setCommentButtonStates({selected:e,hasPopup:t}){this.#fn&&(this.#fn.classList.toggle("selected",e),this.#fn.ariaExpanded=t)}#Ft(e,t){if(!this.#ft._uiManager.hasCommentManager())return null;e.tabIndex="0",e.ariaHasPopup="dialog",t?(e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(e.ariaControlsElements=[this.#ft._uiManager.getCommentDialogElement()],e.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button"));const i=this.#ft._uiManager._signal;if(!(i instanceof AbortSignal)||i.aborted)return e;e.addEventListener("contextmenu",noContextMenu,{signal:i}),t&&(e.addEventListener("focusin",e=>{this.#ft._focusEventsAllowed=!1,stopEvent(e)},{capture:!0,signal:i}),e.addEventListener("focusout",e=>{this.#ft._focusEventsAllowed=!0,stopEvent(e)},{capture:!0,signal:i})),e.addEventListener("pointerdown",e=>e.stopPropagation(),{signal:i});const onClick=t=>{t.preventDefault(),e===this.#pn?this.edit():this.#ft.toggleComment(!0)};return e.addEventListener("click",onClick,{capture:!0,signal:i}),e.addEventListener("keydown",t=>{t.target===e&&"Enter"===t.key&&(this.#mn=!0,onClick(t))},{signal:i}),e.addEventListener("pointerenter",()=>{this.#ft.toggleComment(!1,!0)},{signal:i}),e.addEventListener("pointerleave",()=>{this.#ft.toggleComment(!1,!1)},{signal:i}),e}edit(e){const t=this.commentPopupPositionInLayer;let i,n;if(t)[i,n]=t;else{[i,n]=this.#ft.commentButtonPosition;const{width:e,height:t,x:a,y:s}=this.#ft;i=a+i*e,n=s+n*t}const a=this.#ft.parent.boundingClientRect,{x:s,y:r,width:o,height:l}=a;this.#ft._uiManager.editComment(this.#ft,s+i*o,r+n*l,{...e,parentDimensions:a})}finish(){this.#pn&&(this.#pn.focus({focusVisible:this.#mn}),this.#mn=!1)}isDeleted(){return this.#An||""===this.#_e}isEmpty(){return null===this.#_e}hasBeenEdited(){return this.isDeleted()||this.#_e!==this.#bn}serialize(){return this.data}get data(){return{text:this.#_e,richText:this.#yn,date:this.#wn,deleted:this.isDeleted()}}set data(e){if(e!==this.#_e&&(this.#yn=null),null===e)return this.#_e="",void(this.#An=!0);this.#_e=e,this.#wn=new Date,this.#An=!1}setInitialText(e,t=null){this.#bn=e,this.data=e,this.#wn=null,this.#yn=t}shown(){}destroy(){this.#pn?.remove(),this.#pn=null,this.#fn?.remove(),this.#fn=null,this.#_e="",this.#yn=null,this.#wn=null,this.#ft=null,this.#mn=!1,this.#An=!1}}class TouchManager{#Mi;#Sn=!1;#vn=null;#Cn;#kn;#Tn;#Fn;#In=null;#En;#Mn=null;#Dn;#On=null;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:i=null,onPinchStart:n=null,onPinching:a=null,onPinchEnd:s=null,signal:r}){this.#Mi=e,this.#vn=i,this.#Cn=t,this.#kn=n,this.#Tn=a,this.#Fn=s,this.#Dn=new AbortController,this.#En=AbortSignal.any([r,this.#Dn.signal]),e.addEventListener("touchstart",this.#_n.bind(this),{passive:!1,signal:this.#En})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/OutputScale.pixelRatio}#_n(e){if(this.#Cn?.())return;if(1===e.touches.length){if(this.#In)return;const e=this.#In=new AbortController,t=AbortSignal.any([this.#En,e.signal]),i=this.#Mi,n={capture:!0,signal:t,passive:!1},cancelPointerDown=e=>{"touch"===e.pointerType&&(this.#In?.abort(),this.#In=null)};return i.addEventListener("pointerdown",e=>{"touch"===e.pointerType&&(stopEvent(e),cancelPointerDown(e))},n),i.addEventListener("pointerup",cancelPointerDown,n),void i.addEventListener("pointercancel",cancelPointerDown,n)}if(!this.#On){this.#On=new AbortController;const e=AbortSignal.any([this.#En,this.#On.signal]),t=this.#Mi,i={signal:e,capture:!1,passive:!1};t.addEventListener("touchmove",this.#Pn.bind(this),i);const n=this.#Rn.bind(this);t.addEventListener("touchend",n,i),t.addEventListener("touchcancel",n,i),i.capture=!0,t.addEventListener("pointerdown",stopEvent,i),t.addEventListener("pointermove",stopEvent,i),t.addEventListener("pointercancel",stopEvent,i),t.addEventListener("pointerup",stopEvent,i),this.#kn?.()}if(stopEvent(e),2!==e.touches.length||this.#vn?.())return void(this.#Mn=null);let[t,i]=e.touches;t.identifier>i.identifier&&([t,i]=[i,t]),this.#Mn={touch0X:t.screenX,touch0Y:t.screenY,touch1X:i.screenX,touch1Y:i.screenY}}#Pn(e){if(!this.#Mn||2!==e.touches.length)return;stopEvent(e);let[t,i]=e.touches;t.identifier>i.identifier&&([t,i]=[i,t]);const{screenX:n,screenY:a}=t,{screenX:s,screenY:r}=i,o=this.#Mn,{touch0X:l,touch0Y:c,touch1X:h,touch1Y:d}=o,u=h-l,g=d-c,f=s-n,p=r-a,m=Math.hypot(f,p)||1,b=Math.hypot(u,g)||1;if(!this.#Sn&&Math.abs(b-m)<=TouchManager.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(o.touch0X=n,o.touch0Y=a,o.touch1X=s,o.touch1Y=r,!this.#Sn)return void(this.#Sn=!0);const y=[(n+s)/2,(a+r)/2];this.#Tn?.(y,b,m)}#Rn(e){e.touches.length>=2||(this.#On&&(this.#On.abort(),this.#On=null,this.#Fn?.()),this.#Mn&&(stopEvent(e),this.#Mn=null,this.#Sn=!1))}destroy(){this.#Dn?.abort(),this.#Dn=null,this.#In?.abort(),this.#In=null}}class AnnotationEditor{#Bn=null;#Nn=null;#mt=null;#bt=null;#fn=null;#Ln=!1;#Un=null;#jn="";#$n=null;#Hn=null;#Xn=null;#qn=null;#zn=null;#Wn="";#Gn=!1;#Vn=null;#Kn=!1;#Yn=!1;#Jn=!1;#Zn=null;#Qn=0;#ea=0;#ta=null;#ia=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#na=!1;#aa=AnnotationEditor._zIndex++;static _borderLineWidth=-1;static _colorManager=new ColorManager;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const e=AnnotationEditor.prototype._resizeWithKeyboard,t=AnnotationEditorUIManager.TRANSLATE_SMALL,i=AnnotationEditorUIManager.TRANSLATE_BIG;return shadow(this,"_resizerKeyboardManager",new KeyboardManager([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,i]}],[["Escape","mac+Escape"],AnnotationEditor.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null;const{rotation:t,rawDims:{pageWidth:i,pageHeight:n,pageX:a,pageY:s}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[a,s];const[r,o]=this.parentDimensions;this.x=e.x/r,this.y=e.y/o,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return shadow(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new FakeEditor({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){if(AnnotationEditor._l10n??=e,AnnotationEditor._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==AnnotationEditor._borderLineWidth)return;const i=getComputedStyle(document.documentElement);AnnotationEditor._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){unreachable("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#na}set _isDraggable(e){this.#na=e,this.div?.classList.toggle("draggable",e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(2*e),this.y+=this.width*e/(2*t);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(2*e),this.y-=this.width*e/(2*t);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#aa}setParent(e){null!==e?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(this.#sa(),this.#qn?.remove(),this.#qn=null),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#Gn?this.#Gn=!1:this.parent.setSelected(this))}focusout(e){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const t=e.relatedTarget;t?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,i,n){const[a,s]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(e+i)/a,this.y=(t+n)/s,this.fixAndSetPosition()}_moveAfterPaste(e,t){const[i,n]=this.parentDimensions;this.setAt(e*i,t*n,this.width*i,this.height*n),this._onTranslated()}#ra([e,t],i,n){[i,n]=this.screenToPageTranslation(i,n),this.x+=i/e,this.y+=n/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,t){this.#ra(this.parentDimensions,e,t)}translateInPage(e,t){this.#Vn||=[this.x,this.y,this.width,this.height],this.#ra(this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){this.#Vn||=[this.x,this.y,this.width,this.height];const{div:i,parentDimensions:[n,a]}=this;if(this.x+=e/n,this.y+=t/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:r}=this;const[o,l]=this.getBaseTranslation();s+=o,r+=l;const{style:c}=i;c.left=`${(100*s).toFixed(2)}%`,c.top=`${(100*r).toFixed(2)}%`,this._onTranslating(s,r),i.scrollIntoView({block:"nearest"})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!this.#Vn&&(this.#Vn[0]!==this.x||this.#Vn[1]!==this.y)}get _hasBeenResized(){return!!this.#Vn&&(this.#Vn[2]!==this.width||this.#Vn[3]!==this.height)}getBaseTranslation(){const[e,t]=this.parentDimensions,{_borderLineWidth:i}=AnnotationEditor,n=i/e,a=i/t;switch(this.rotation){case 90:return[-n,a];case 180:return[n,a];case 270:return[n,-a];default:return[-n,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:t},pageDimensions:[i,n]}=this;let{x:a,y:s,width:r,height:o}=this;if(r*=i,o*=n,a*=i,s*=n,this._mustFixPosition)switch(e){case 0:a=MathClamp(a,0,i-r),s=MathClamp(s,0,n-o);break;case 90:a=MathClamp(a,0,i-o),s=MathClamp(s,r,n);break;case 180:a=MathClamp(a,r,i),s=MathClamp(s,o,n);break;case 270:a=MathClamp(a,o,i),s=MathClamp(s,0,n-r)}this.x=a/=i,this.y=s/=n;const[l,c]=this.getBaseTranslation();a+=l,s+=c,t.left=`${(100*a).toFixed(2)}%`,t.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#oa(e,t,i){switch(i){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(e,t){return AnnotationEditor.#oa(e,t,this.parentRotation)}pageTranslationToScreen(e,t){return AnnotationEditor.#oa(e,t,360-this.parentRotation)}#la(e){switch(e){case 90:{const[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,t]=this.pageDimensions;return[0,e/t,-t/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,i]}=this;return[t*e,i*e]}setDims(){const{div:{style:e},width:t,height:i}=this;e.width=`${(100*t).toFixed(2)}%`,e.height=`${(100*i).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#ca(){if(this.#$n)return;this.#$n=document.createElement("div"),this.#$n.classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(const i of e){const e=document.createElement("div");this.#$n.append(e),e.classList.add("resizer",i),e.setAttribute("data-resizer-name",i),e.addEventListener("pointerdown",this.#ha.bind(this,i),{signal:t}),e.addEventListener("contextmenu",noContextMenu,{signal:t}),e.tabIndex=-1}this.div.prepend(this.#$n)}#ha(e,t){t.preventDefault();const{isMac:i}=util_FeatureTest.platform;if(0!==t.button||t.ctrlKey&&i)return;this.#mt?.toggle(!1);const n=this._isDraggable;this._isDraggable=!1,this.#Hn=[t.screenX,t.screenY];const a=new AbortController,s=this._uiManager.combinedSignal(a);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#da.bind(this,e),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",stopEvent,{passive:!1,signal:s}),window.addEventListener("contextmenu",noContextMenu,{signal:s}),this.#Xn={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const r=this.parent.div.style.cursor,o=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const pointerUpCallback=()=>{a.abort(),this.parent.togglePointerEvents(!0),this.#mt?.toggle(!0),this._isDraggable=n,this.parent.div.style.cursor=r,this.div.style.cursor=o,this.#ua()};window.addEventListener("pointerup",pointerUpCallback,{signal:s}),window.addEventListener("blur",pointerUpCallback,{signal:s})}#ga(e,t,i,n){this.width=i,this.height=n,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#ua(){if(!this.#Xn)return;const{savedX:e,savedY:t,savedWidth:i,savedHeight:n}=this.#Xn;this.#Xn=null;const a=this.x,s=this.y,r=this.width,o=this.height;a===e&&s===t&&r===i&&o===n||this.addCommands({cmd:this.#ga.bind(this,a,s,r,o),undo:this.#ga.bind(this,e,t,i,n),mustExec:!0})}static _round(e){return Math.round(1e4*e)/1e4}#da(e,t){const[i,n]=this.parentDimensions,a=this.x,s=this.y,r=this.width,o=this.height,l=AnnotationEditor.MIN_SIZE/i,c=AnnotationEditor.MIN_SIZE/n,h=this.#la(this.rotation),transf=(e,t)=>[h[0]*e+h[2]*t,h[1]*e+h[3]*t],d=this.#la(360-this.rotation);let u,g,f=!1,p=!1;switch(e){case"topLeft":f=!0,u=(e,t)=>[0,0],g=(e,t)=>[e,t];break;case"topMiddle":u=(e,t)=>[e/2,0],g=(e,t)=>[e/2,t];break;case"topRight":f=!0,u=(e,t)=>[e,0],g=(e,t)=>[0,t];break;case"middleRight":p=!0,u=(e,t)=>[e,t/2],g=(e,t)=>[0,t/2];break;case"bottomRight":f=!0,u=(e,t)=>[e,t],g=(e,t)=>[0,0];break;case"bottomMiddle":u=(e,t)=>[e/2,t],g=(e,t)=>[e/2,0];break;case"bottomLeft":f=!0,u=(e,t)=>[0,t],g=(e,t)=>[e,0];break;case"middleLeft":p=!0,u=(e,t)=>[0,t/2],g=(e,t)=>[e,t/2]}const m=u(r,o),b=g(r,o);let y=transf(...b);const w=AnnotationEditor._round(a+y[0]),x=AnnotationEditor._round(s+y[1]);let S,v,C=1,k=1;if(t.fromKeyboard)({deltaX:S,deltaY:v}=t);else{const{screenX:e,screenY:i}=t,[n,a]=this.#Hn;[S,v]=this.screenToPageTranslation(e-n,i-a),this.#Hn[0]=e,this.#Hn[1]=i}var T,F;if([S,v]=(T=S/i,F=v/n,[d[0]*T+d[2]*F,d[1]*T+d[3]*F]),f){const e=Math.hypot(r,o);C=k=Math.max(Math.min(Math.hypot(b[0]-m[0]-S,b[1]-m[1]-v)/e,1/r,1/o),l/r,c/o)}else p?C=MathClamp(Math.abs(b[0]-m[0]-S),l,1)/r:k=MathClamp(Math.abs(b[1]-m[1]-v),c,1)/o;const E=AnnotationEditor._round(r*C),M=AnnotationEditor._round(o*k);y=transf(...g(E,M));const D=w-y[0],O=x-y[1];this.#Vn||=[this.x,this.y,this.width,this.height],this.width=E,this.height=M,this.x=D,this.y=O,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#mt?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#Yn)return this._editToolbar;this._editToolbar=new EditorToolbar(this),this.div.append(this._editToolbar.render());const{toolbarButtons:e}=this;if(e)for(const[t,i]of e)await this._editToolbar.addButton(t,i);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#mt?.destroy()}addContainer(e){const t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#mt||(AltText.initialize(AnnotationEditor._l10n),this.#mt=new AltText(this),this.#Bn&&(this.#mt.data=this.#Bn,this.#Bn=null)),this.#mt}get altTextData(){return this.#mt?.data}set altTextData(e){this.#mt&&(this.#mt.data=e)}get guessedAltText(){return this.#mt?.guessedText}async setGuessedAltText(e){await(this.#mt?.setGuessedText(e))}serializeAltText(e){return this.#mt?.serialize(e)}hasAltText(){return!!this.#mt&&!this.#mt.isEmpty()}hasAltTextData(){return this.#mt?.hasData()??!1}focusCommentButton(){this.#bt?.focusButton()}addCommentButton(){return this.#bt||=new Comment(this)}addStandaloneCommentButton(){this.#fn?this._uiManager.isEditingMode()&&this.#fn.classList.remove("hidden"):this.hasComment&&(this.#fn=this.#bt.renderForStandalone(),this.div.append(this.#fn))}removeStandaloneCommentButton(){this.#bt.removeStandaloneCommentButton(),this.#fn=null}hideStandaloneCommentButton(){this.#fn?.classList.add("hidden")}get comment(){const{data:{richText:e,text:t,date:i,deleted:n}}=this.#bt;return{text:t,richText:e,date:i,deleted:n,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){this.#bt||=new Comment(this),this.#bt.data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:t,richText:i}){if(!t)return;if(this.#bt||=new Comment(this),this.#bt.setInitialText(e,i),!this.annotationElementId)return;const n=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);n&&this.updateFromAnnotationLayer(n)}get hasEditedComment(){return this.#bt?.hasBeenEdited()}get hasDeletedComment(){return this.#bt?.isDeleted()}get hasComment(){return!!this.#bt&&!this.#bt.isEmpty()&&!this.#bt.isDeleted()}async editComment(e){this.#bt||=new Comment(this),this.#bt.edit(e)}toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){this.#bt.setSelectedButton(e)}addComment(e){if(this.hasEditedComment){const t=180,i=100,[,,,n]=e.rect,[a]=this.pageDimensions,[s]=this.pageTranslation,r=s+a+1,o=n-i,l=r+t;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[r,o,l,n]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:t}}){this.#bt.data=t?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){const e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=this.#Ln?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),this.#fa();const[t,i]=this.parentDimensions;this.parentRotation%180!=0&&(e.style.maxWidth=`${(100*i/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/i).toFixed(2)}%`);const[n,a]=this.getInitialTranslation();return this.translate(n,a),bindEvents(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#ia||=new TouchManager({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#pa.bind(this),onPinching:this.#ma.bind(this),onPinchEnd:this.#ba.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}#pa(){this.#Xn={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#mt?.toggle(!1),this.parent.togglePointerEvents(!1)}#ma(e,t,i){let n=i/t*.7+1-.7;if(1===n)return;const a=this.#la(this.rotation),transf=(e,t)=>[a[0]*e+a[2]*t,a[1]*e+a[3]*t],[s,r]=this.parentDimensions,o=this.x,l=this.y,c=this.width,h=this.height,d=AnnotationEditor.MIN_SIZE/s,u=AnnotationEditor.MIN_SIZE/r;n=Math.max(Math.min(n,1/c,1/h),d/c,u/h);const g=AnnotationEditor._round(c*n),f=AnnotationEditor._round(h*n);if(g===c&&f===h)return;this.#Vn||=[o,l,c,h];const p=transf(c/2,h/2),m=AnnotationEditor._round(o+p[0]),b=AnnotationEditor._round(l+p[1]),y=transf(g/2,f/2);this.x=m-y[0],this.y=b-y[1],this.width=g,this.height=f,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#ba(){this.#mt?.toggle(!0),this.parent.togglePointerEvents(!0),this.#ua()}pointerdown(e){const{isMac:t}=util_FeatureTest.platform;0!==e.button||e.ctrlKey&&t?e.preventDefault():(this.#Gn=!0,this._isDraggable?this.#ya(e):this.#wa(e))}#wa(e){const{isMac:t}=util_FeatureTest.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#ya(e){const{isSelected:t}=this;this._uiManager.setUpDragSession();let i=!1;const n=new AbortController,a=this._uiManager.combinedSignal(n),s={capture:!0,passive:!1,signal:a},cancelDrag=e=>{n.abort(),this.#Un=null,this.#Gn=!1,this._uiManager.endDragSession()||this.#wa(e),i&&this._onStopDragging()};t&&(this.#Qn=e.clientX,this.#ea=e.clientY,this.#Un=e.pointerId,this.#jn=e.pointerType,window.addEventListener("pointermove",e=>{i||(i=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:t,clientY:n,pointerId:a}=e;if(a!==this.#Un)return void stopEvent(e);const[s,r]=this.screenToPageTranslation(t-this.#Qn,n-this.#ea);this.#Qn=t,this.#ea=n,this._uiManager.dragSelectedEditors(s,r)},s),window.addEventListener("touchmove",stopEvent,s),window.addEventListener("pointerdown",e=>{e.pointerType===this.#jn&&(this.#ia||e.isPrimary)&&cancelDrag(e),stopEvent(e)},s));const pointerUpCallback=e=>{this.#Un&&this.#Un!==e.pointerId?stopEvent(e):cancelDrag(e)};window.addEventListener("pointerup",pointerUpCallback,{signal:a}),window.addEventListener("blur",pointerUpCallback,{signal:a})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#Zn&&clearTimeout(this.#Zn),this.#Zn=setTimeout(()=>{this.#Zn=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,i){e.changeParent(this),this.x=t,this.y=i,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,i=this.rotation){const n=this.parentScale,[a,s]=this.pageDimensions,[r,o]=this.pageTranslation,l=e/n,c=t/n,h=this.x*a,d=this.y*s,u=this.width*a,g=this.height*s;switch(i){case 0:return[h+l+r,s-d-c-g+o,h+l+u+r,s-d-c+o];case 90:return[h+c+r,s-d+l+o,h+c+g+r,s-d+l+u+o];case 180:return[h-l-u+r,s-d+c+o,h-l+r,s-d+c+g+o];case 270:return[h-c-g+r,s-d-l-u+o,h-c+r,s-d-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[i,n,a,s]=e,r=a-i,o=s-n;switch(this.rotation){case 0:return[i,t-s,r,o];case 90:return[i,t-n,o,r];case 180:return[a,t-n,r,o];case 270:return[a,t-s,o,r];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&AnnotationEditor._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#bt?.onUpdatedColor()}getData(){const{comment:{text:e,color:t,date:i,opacity:n,deleted:a,richText:s},uid:r,pageIndex:o,creationDate:l,modificationDate:c}=this;return{id:r,pageIndex:o,rect:this.getPDFRect(),richText:s,contentsObj:{str:e},creationDate:l,modificationDate:i||c,popupRef:!a,color:t,opacity:n}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#Yn=!0,!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),this.#Yn=!1,!0)}isInEditMode(){return this.#Yn}shouldGetKeyboardEvents(){return this.#Jn}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:t,bottom:i,right:n}=this.getClientDimensions(),{innerHeight:a,innerWidth:s}=window;return t<s&&n>0&&e<a&&i>0}#fa(){if(this.#zn||!this.div)return;this.#zn=new AbortController;const e=this._uiManager.combinedSignal(this.#zn);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})}rebuild(){this.#fa()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,t=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(e,t,i){const n=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:i,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});n.rotation=e.rotation,n.#Bn=e.accessibilityData,n._isCopy=e.isCopy||!1;const[a,s]=n.pageDimensions,[r,o,l,c]=n.getRectInCurrentCoords(e.rect,s);return n.x=r/a,n.y=o/s,n.width=l/a,n.height=c/s,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.#zn?.abort(),this.#zn=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#Zn&&(clearTimeout(this.#Zn),this.#Zn=null),this.#sa(),this.removeEditToolbar(),this.#ta){for(const e of this.#ta.values())clearTimeout(e);this.#ta=null}this.parent=null,this.#ia?.destroy(),this.#ia=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#ca(),this.#$n.classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return"ltr"===this._uiManager.direction?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[e,t]}=this,[i,n,a,s]=this.getPDFRect();return[AnnotationEditor._round(i+(a-i)*e),AnnotationEditor._round(n+(s-n)*(1-t))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#bt.commentPopupPositionInLayer}set commentPopupPosition(e){this.#bt.commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return this.#bt.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#bt.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){this.#bt.setCommentButtonStates(e)}keydown(e){if(!this.isResizable||e.target!==this.div||"Enter"!==e.key)return;this._uiManager.setSelected(this),this.#Xn={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const t=this.#$n.children;if(!this.#Nn){this.#Nn=Array.from(t);const e=this.#Aa.bind(this),i=this.#xa.bind(this),n=this._uiManager._signal;for(const t of this.#Nn){const a=t.getAttribute("data-resizer-name");t.setAttribute("role","spinbutton"),t.addEventListener("keydown",e,{signal:n}),t.addEventListener("blur",i,{signal:n}),t.addEventListener("focus",this.#Sa.bind(this,a),{signal:n}),t.setAttribute("data-l10n-id",AnnotationEditor._l10nResizer[a])}}const i=this.#Nn[0];let n=0;for(const e of t){if(e===i)break;n++}const a=(360-this.rotation+this.parentRotation)%360/90*(this.#Nn.length/4);if(a!==n){if(a<n)for(let e=0;e<n-a;e++)this.#$n.append(this.#$n.firstChild);else if(a>n)for(let e=0;e<a-n;e++)this.#$n.firstChild.before(this.#$n.lastChild);let e=0;for(const i of t){const t=this.#Nn[e++].getAttribute("data-resizer-name");i.setAttribute("data-l10n-id",AnnotationEditor._l10nResizer[t])}}this.#va(0),this.#Jn=!0,this.#$n.firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#Aa(e){AnnotationEditor._resizerKeyboardManager.exec(this,e)}#xa(e){this.#Jn&&e.relatedTarget?.parentNode!==this.#$n&&this.#sa()}#Sa(e){this.#Wn=this.#Jn?e:""}#va(e){if(this.#Nn)for(const t of this.#Nn)t.tabIndex=e}_resizeWithKeyboard(e,t){this.#Jn&&this.#da(this.#Wn,{deltaX:e,deltaY:t,fromKeyboard:!0})}#sa(){this.#Jn=!1,this.#va(-1),this.#ua()}_stopResizingWithKeyboard(){this.#sa(),this.div.focus()}select(){this.isSelected&&this._editToolbar?this._editToolbar.show():(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar?(this._editToolbar?.show(),this.#mt?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()}))}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#$n?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#mt?.toggleAltTextBadge(!0),this.hasComment&&this._uiManager.toggleComment(this,!1,!1))}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){"BUTTON"!==e.target.nodeName&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#Kn}set isEditing(e){this.#Kn=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){this.#ta||=new Map;const{action:t}=e;let i=this.#ta.get(t);return i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(e),this.#ta.delete(t),0===this.#ta.size&&(this.#ta=null)},AnnotationEditor._telemetryTimeout),void this.#ta.set(t,i)}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#Ln=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#Ln=!0}updateFakeAnnotationElement(e){if(this.#qn||this.deleted)return this.deleted?(this.#qn.remove(),void(this.#qn=null)):void((this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#qn.updateEdited({rect:this.getPDFRect(),popup:this.comment}));this.#qn=e.addFakeAnnotation(this)}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(".annotationContent");if(t){if("CANVAS"===t.nodeName){const e=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.before(t)}}else t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);return t}resetAnnotationElement(e){const{firstChild:t}=e.container;"DIV"===t?.nodeName&&t.classList.contains("annotationContent")&&t.remove()}}class FakeEditor extends AnnotationEditor{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const Ac=3285377520,xc=4294901760,Sc=65535;class MurmurHash3_64{constructor(e){this.h1=e?4294967295&e:Ac,this.h2=e?4294967295&e:Ac}update(e){let t,i;if("string"==typeof e){t=new Uint8Array(2*e.length),i=0;for(let n=0,a=e.length;n<a;n++){const a=e.charCodeAt(n);a<=255?t[i++]=a:(t[i++]=a>>>8,t[i++]=255&a)}}else{if(!ArrayBuffer.isView(e))throw new Error("Invalid data format, must be a string or TypedArray.");t=e.slice(),i=t.byteLength}const n=i>>2,a=i-4*n,s=new Uint32Array(t.buffer,0,n);let r=0,o=0,l=this.h1,c=this.h2;const h=3432918353,d=461845907,u=11601,g=13715;for(let e=0;e<n;e++)1&e?(r=s[e],r=r*h&xc|r*u&Sc,r=r<<15|r>>>17,r=r*d&xc|r*g&Sc,l^=r,l=l<<13|l>>>19,l=5*l+3864292196):(o=s[e],o=o*h&xc|o*u&Sc,o=o<<15|o>>>17,o=o*d&xc|o*g&Sc,c^=o,c=c<<13|c>>>19,c=5*c+3864292196);switch(r=0,a){case 3:r^=t[4*n+2]<<16;case 2:r^=t[4*n+1]<<8;case 1:r^=t[4*n],r=r*h&xc|r*u&Sc,r=r<<15|r>>>17,r=r*d&xc|r*g&Sc,1&n?l^=r:c^=r}this.h1=l,this.h2=c}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&xc|36045*e&Sc,t=4283543511*t&xc|(2950163797*(t<<16|e>>>16)&xc)>>>16,e^=t>>>1,e=444984403*e&xc|60499*e&Sc,t=3301882366*t&xc|(3120437893*(t<<16|e>>>16)&xc)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}const vc=Object.freeze({map:null,hash:"",transfer:void 0});class AnnotationStorage{#Ca=!1;#ka=null;#Ta=null;#Fa=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const i=this.#Fa.get(e);return void 0===i?t:Object.assign(t,i)}getRawValue(e){return this.#Fa.get(e)}remove(e){const t=this.#Fa.get(e);if(void 0!==t&&(t instanceof AnnotationEditor&&this.#Ta.delete(t.annotationElementId),this.#Fa.delete(e),0===this.#Fa.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor)){for(const e of this.#Fa.values())if(e instanceof AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(e,t){const i=this.#Fa.get(e);let n=!1;if(void 0!==i)for(const[e,a]of Object.entries(t))i[e]!==a&&(n=!0,i[e]=a);else n=!0,this.#Fa.set(e,t);n&&this.#Ia(),t instanceof AnnotationEditor&&((this.#Ta||=new Map).set(t.annotationElementId,t),"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type))}has(e){return this.#Fa.has(e)}get size(){return this.#Fa.size}#Ia(){this.#Ca||(this.#Ca=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#Ca&&(this.#Ca=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===this.#Fa.size)return vc;const e=new Map,t=new MurmurHash3_64,i=[],n=Object.create(null);let a=!1;for(const[i,s]of this.#Fa){const r=s instanceof AnnotationEditor?s.serialize(!1,n):s;r&&(e.set(i,r),t.update(`${i}:${JSON.stringify(r)}`),a||=!!r.bitmap)}if(a)for(const t of e.values())t.bitmap&&i.push(t.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:i}:vc}get editorStats(){let e=null;const t=new Map;let i=0,n=0;for(const a of this.#Fa.values()){if(!(a instanceof AnnotationEditor)){a.popup&&(a.popup.deleted?n+=1:i+=1);continue}a.isCommentDeleted?n+=1:a.hasEditedComment&&(i+=1);const s=a.telemetryFinalData;if(!s)continue;const{type:r}=s;t.has(r)||t.set(r,Object.getPrototypeOf(a).constructor),e||=Object.create(null);const o=e[r]||=new Map;for(const[e,t]of Object.entries(s)){if("type"===e)continue;let i=o.get(e);i||(i=new Map,o.set(e,i));const n=i.get(t)??0;i.set(t,n+1)}}if((n>0||i>0)&&(e||=Object.create(null),e.comments={deleted:n,edited:i}),!e)return null;for(const[i,n]of t)e[i]=n.computeTelemetryFinalData(e[i]);return e}resetModifiedIds(){this.#ka=null}updateEditor(e,t){const i=this.#Ta?.get(e);return!!i&&(i.updateFromAnnotationLayer(t),!0)}getEditor(e){return this.#Ta?.get(e)||null}get modifiedIds(){if(this.#ka)return this.#ka;const e=[];if(this.#Ta)for(const t of this.#Ta.values())t.serialize()&&e.push(t.annotationElementId);return this.#ka={ids:new Set(e),hash:e.join(",")}}[Symbol.iterator](){return this.#Fa.entries()}}class PrintAnnotationStorage extends AnnotationStorage{#Ea;constructor(e){super();const{map:t,hash:i,transfer:n}=e.serializable,a=structuredClone(t,n?{transfer:n}:null);this.#Ea={map:a,hash:i,transfer:n}}get print(){unreachable("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#Ea}get modifiedIds(){return shadow(this,"modifiedIds",{ids:new Set,hash:""})}}class FontLoader{#Ma=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#Ma.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:i}){if(e&&!this.#Ma.has(e.loadedName)){if(assert(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:n,style:a}=e,s=new FontFace(t,n,a);this.addNativeFontFace(s);try{await s.load(),this.#Ma.add(t),i?.(e)}catch{warn(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(s)}return}unreachable("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo)return void await this.loadSystemFont(e);if(this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(i){throw warn(`Failed to load font '${t.family}': '${i}'.`),e.disableFontFace=!0,i}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(t=>{const i=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,i)})}}get isFontLoadingAPISupported(){return shadow(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return shadow(this,"isSyncFontLoadingSupported",Fl||util_FeatureTest.platform.isFirefox)}_queueLoadingCallback(e){const{loadingRequests:t}=this,i={done:!1,complete:function(){for(assert(!i.done,"completeRequest() cannot be called twice."),i.done=!0;t.length>0&&t[0].done;){const e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(i),i}get _loadTestFont(){return shadow(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(e,t){function int32(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function spliceString(e,t,i,n){return e.substring(0,t)+n+e.substring(t+i)}let i,n;const a=this._document.createElement("canvas");a.width=1,a.height=1;const s=a.getContext("2d");let r=0;const o=`lt${Date.now()}${this.loadTestFontId++}`;let l=this._loadTestFont;l=spliceString(l,976,o.length,o);const c=1482184792;let h=int32(l,16);for(i=0,n=o.length-3;i<n;i+=4)h=h-c+int32(o,i)|0;var d;i<o.length&&(h=h-c+int32(o+"XXX",i)|0),l=spliceString(l,16,4,(d=h,String.fromCharCode(d>>24&255,d>>16&255,d>>8&255,255&d)));const u=`@font-face {font-family:"${o}";src:${`url(data:font/opentype;base64,${btoa(l)});`}}`;this.insertRule(u);const g=this._document.createElement("div");g.style.visibility="hidden",g.style.width=g.style.height="10px",g.style.position="absolute",g.style.top=g.style.left="0px";for(const t of[e.loadedName,o]){const e=this._document.createElement("span");e.textContent="Hi",e.style.fontFamily=t,g.append(e)}this._document.body.append(g),function isFontReady(e,t){if(++r>30)return warn("Load test font never loaded."),void t();s.font="30px "+e,s.fillText(".",0,20),s.getImageData(0,0,1,1).data[3]>0?t():setTimeout(isFontReady.bind(null,e,t))}(o,()=>{g.remove(),t.complete()})}}class FontFaceObject{#Da;constructor(e,t=null,i,n){this.compiledGlyphs=Object.create(null),this.#Da=e,this._inspectFont=t,i&&Object.assign(this,i),n&&(this.charProcOperatorList=n)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${toBase64Util(this.data)});`;let t;if(this.cssFontInfo){let i=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(i+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${i}src:${e}}`}else t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];const i=this.loadedName+"_path_"+t;let n;try{n=e.get(i)}catch(e){warn(`getPathGenerator - ignoring character: "${e}".`)}const a=new Path2D(n||"");return this.fontExtraProperties||e.delete(i),this.compiledGlyphs[t]=a}get black(){return this.#Da.black}get bold(){return this.#Da.bold}get disableFontFace(){return this.#Da.disableFontFace??!1}get fontExtraProperties(){return this.#Da.fontExtraProperties??!1}get isInvalidPDFjsFont(){return this.#Da.isInvalidPDFjsFont}get isType3Font(){return this.#Da.isType3Font}get italic(){return this.#Da.italic}get missingFile(){return this.#Da.missingFile}get remeasure(){return this.#Da.remeasure}get vertical(){return this.#Da.vertical}get ascent(){return this.#Da.ascent}get defaultWidth(){return this.#Da.defaultWidth}get descent(){return this.#Da.descent}get bbox(){return this.#Da.bbox}get fontMatrix(){return this.#Da.fontMatrix}get fallbackName(){return this.#Da.fallbackName}get loadedName(){return this.#Da.loadedName}get mimetype(){return this.#Da.mimetype}get name(){return this.#Da.name}get data(){return this.#Da.data}clearData(){this.#Da.clearData()}get cssFontInfo(){return this.#Da.cssFontInfo}get systemFontInfo(){return this.#Da.systemFontInfo}get defaultVMetrics(){return this.#Da.defaultVMetrics}}function getFactoryUrlProp(e){if("string"!=typeof e)return null;if(e.endsWith("/"))return e;throw new Error(`Invalid factory url: "${e}" must include trailing slash.`)}const isRefProxy=e=>"object"==typeof e&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0,Cc=function(e,t,i){if(!Array.isArray(i)||i.length<2)return!1;const[n,a,...s]=i;if(!e(n)&&!Number.isInteger(n))return!1;if(!t(a))return!1;const r=s.length;let o=!0;switch(a.name){case"XYZ":if(r<2||r>3)return!1;break;case"Fit":case"FitB":return 0===r;case"FitH":case"FitBH":case"FitV":case"FitBV":if(r>1)return!1;break;case"FitR":if(4!==r)return!1;o=!1;break;default:return!1}for(const e of s)if(!("number"==typeof e||o&&null===e))return!1;return!0}.bind(null,isRefProxy,e=>"object"==typeof e&&"string"==typeof e?.name);class LoopbackPort{#Oa=new Map;#_a=Promise.resolve();postMessage(e,t){const i={data:structuredClone(e,t?{transfer:t}:null)};this.#_a.then(()=>{for(const[e]of this.#Oa)e.call(this,i)})}addEventListener(e,t,i=null){let n=null;if(i?.signal instanceof AbortSignal){const{signal:a}=i;if(a.aborted)return void warn("LoopbackPort - cannot use an `aborted` signal.");const onAbort=()=>this.removeEventListener(e,t);n=()=>a.removeEventListener("abort",onAbort),a.addEventListener("abort",onAbort)}this.#Oa.set(t,n)}removeEventListener(e,t){const i=this.#Oa.get(t);i?.(),this.#Oa.delete(t)}terminate(){for(const[,e]of this.#Oa)e?.();this.#Oa.clear()}}const kc=1,Tc=2,Fc=1,Ic=2,Ec=3,Mc=4,Dc=5,Oc=6,_c=7,Pc=8;function onFn(){}function wrapReason(e){if(e instanceof AbortException||e instanceof InvalidPDFException||e instanceof PasswordException||e instanceof ResponseException||e instanceof UnknownErrorException)return e;switch(e instanceof Error||"object"==typeof e&&null!==e||unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new AbortException(e.message);case"InvalidPDFException":return new InvalidPDFException(e.message);case"PasswordException":return new PasswordException(e.message,e.code);case"ResponseException":return new ResponseException(e.message,e.status,e.missing);case"UnknownErrorException":return new UnknownErrorException(e.message,e.details)}return new UnknownErrorException(e.message,e.toString())}class MessageHandler{#rt=new AbortController;constructor(e,t,i){this.sourceName=e,this.targetName=t,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),i.addEventListener("message",this.#ot.bind(this),{signal:this.#rt.signal})}#ot({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#lt(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],e.callback===kc)i.resolve(e.data);else{if(e.callback!==Tc)throw new Error("Unexpected callback case");i.reject(wrapReason(e.reason))}return}const t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const i=this.sourceName,n=e.sourceName,a=this.comObj;return void Promise.try(t,e.data).then(function(t){a.postMessage({sourceName:i,targetName:n,callback:kc,callbackId:e.callbackId,data:t})},function(t){a.postMessage({sourceName:i,targetName:n,callback:Tc,callbackId:e.callbackId,reason:wrapReason(t)})})}e.streamId?this.#ct(e):t(e.data)}on(e,t){const i=this.actionHandler;if(i[e])throw new Error(`There is already an actionName called "${e}"`);i[e]=t}send(e,t,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},i)}sendWithPromise(e,t,i){const n=this.callbackId++,a=Promise.withResolvers();this.callbackCapabilities[n]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:n,data:t},i)}catch(e){a.reject(e)}return a.promise}sendWithStream(e,t,i,n){const a=this.streamId++,s=this.sourceName,r=this.targetName,o=this.comObj;return new ReadableStream({start:i=>{const l=Promise.withResolvers();return this.streamControllers[a]={controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:s,targetName:r,action:e,streamId:a,data:t,desiredSize:i.desiredSize},n),l.promise},pull:e=>{const t=Promise.withResolvers();return this.streamControllers[a].pullCall=t,o.postMessage({sourceName:s,targetName:r,stream:Oc,streamId:a,desiredSize:e.desiredSize}),t.promise},cancel:e=>{assert(e instanceof Error,"cancel must have a valid reason");const t=Promise.withResolvers();return this.streamControllers[a].cancelCall=t,this.streamControllers[a].isClosed=!0,o.postMessage({sourceName:s,targetName:r,stream:Fc,streamId:a,reason:wrapReason(e)}),t.promise}},i)}#ct(e){const t=e.streamId,i=this.sourceName,n=e.sourceName,a=this.comObj,s=this,r=this.actionHandler[e.action],o={enqueue(e,s=1,r){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=s,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),a.postMessage({sourceName:i,targetName:n,stream:Mc,streamId:t,chunk:e},r)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:i,targetName:n,stream:Ec,streamId:t}),delete s.streamSinks[t])},error(e){assert(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:i,targetName:n,stream:Dc,streamId:t,reason:wrapReason(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[t]=o,Promise.try(r,e.data,o).then(function(){a.postMessage({sourceName:i,targetName:n,stream:Pc,streamId:t,success:!0})},function(e){a.postMessage({sourceName:i,targetName:n,stream:Pc,streamId:t,reason:wrapReason(e)})})}#lt(e){const t=e.streamId,i=this.sourceName,n=e.sourceName,a=this.comObj,s=this.streamControllers[t],r=this.streamSinks[t];switch(e.stream){case Pc:e.success?s.startCall.resolve():s.startCall.reject(wrapReason(e.reason));break;case _c:e.success?s.pullCall.resolve():s.pullCall.reject(wrapReason(e.reason));break;case Oc:if(!r){a.postMessage({sourceName:i,targetName:n,stream:_c,streamId:t,success:!0});break}r.desiredSize<=0&&e.desiredSize>0&&r.sinkCapability.resolve(),r.desiredSize=e.desiredSize,Promise.try(r.onPull||onFn).then(function(){a.postMessage({sourceName:i,targetName:n,stream:_c,streamId:t,success:!0})},function(e){a.postMessage({sourceName:i,targetName:n,stream:_c,streamId:t,reason:wrapReason(e)})});break;case Mc:if(assert(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(e.chunk);break;case Ec:if(assert(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),this.#ht(s,t);break;case Dc:assert(s,"error should have stream controller"),s.controller.error(wrapReason(e.reason)),this.#ht(s,t);break;case Ic:e.success?s.cancelCall.resolve():s.cancelCall.reject(wrapReason(e.reason)),this.#ht(s,t);break;case Fc:if(!r)break;const o=wrapReason(e.reason);Promise.try(r.onCancel||onFn,o).then(function(){a.postMessage({sourceName:i,targetName:n,stream:Ic,streamId:t,success:!0})},function(e){a.postMessage({sourceName:i,targetName:n,stream:Ic,streamId:t,reason:wrapReason(e)})}),r.sinkCapability.reject(o),r.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async#ht(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#rt?.abort(),this.#rt=null}}class BaseCanvasFactory{#Pa=!1;constructor({enableHWA:e=!1}){this.#Pa=e}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(e,t);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!this.#Pa})}}reset(e,t,i){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||i<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=i}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){unreachable("Abstract method `_createCanvas` called.")}}class DOMCanvasFactory extends BaseCanvasFactory{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){const i=this._document.createElement("canvas");return i.width=e,i.height=t,i}}class BaseCMapReaderFactory{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(t).then(e=>({cMapData:e,isCompressed:this.isCompressed})).catch(e=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)})}async _fetch(e){unreachable("Abstract method `_fetch` called.")}}class DOMCMapReaderFactory extends BaseCMapReaderFactory{async _fetch(e){const t=await fetchData(e,this.isCompressed?"arraybuffer":"text");return t instanceof ArrayBuffer?new Uint8Array(t):stringToBytes(t)}}class BaseFilterFactory{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,i,n,a){return"none"}destroy(e=!1){}}class DOMFilterFactory extends BaseFilterFactory{#Ra;#Ba;#Na;#La;#Ua;#ja;#Mt=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#La=e,this.#Ua=t}get#Ot(){return this.#Ba||=new Map}get#$a(){return this.#ja||=new Map}get#Ha(){if(!this.#Na){const e=this.#Ua.createElement("div"),{style:t}=e;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;const i=this.#Ua.createElementNS(bc,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#Na=this.#Ua.createElementNS(bc,"defs"),e.append(i),i.append(this.#Na),this.#Ua.body.append(e)}return this.#Na}#Xa(e){if(1===e.length){const t=e[0],i=new Array(256);for(let e=0;e<256;e++)i[e]=t[e]/255;const n=i.join(",");return[n,n,n]}const[t,i,n]=e,a=new Array(256),s=new Array(256),r=new Array(256);for(let e=0;e<256;e++)a[e]=t[e]/255,s[e]=i[e]/255,r[e]=n[e]/255;return[a.join(","),s.join(","),r.join(",")]}#qa(e){if(void 0===this.#Ra){this.#Ra="";const e=this.#Ua.URL;e!==this.#Ua.baseURI&&(isDataScheme(e)?warn('#createUrl: ignore "data:"-URL for performance reasons.'):this.#Ra=updateUrlHash(e,""))}return`url(${this.#Ra}#${e})`}addFilter(e){if(!e)return"none";let t=this.#Ot.get(e);if(t)return t;const[i,n,a]=this.#Xa(e),s=1===e.length?i:`${i}${n}${a}`;if(t=this.#Ot.get(s),t)return this.#Ot.set(e,t),t;const r=`g_${this.#La}_transfer_map_${this.#Mt++}`,o=this.#qa(r);this.#Ot.set(e,o),this.#Ot.set(s,o);const l=this.#za(r);return this.#Wa(i,n,a,l),o}addHCMFilter(e,t){const i=`${e}-${t}`,n="base";let a=this.#$a.get(n);if(a?.key===i)return a.url;if(a?(a.filter?.remove(),a.key=i,a.url="none",a.filter=null):(a={key:i,url:"none",filter:null},this.#$a.set(n,a)),!e||!t)return a.url;const s=this.#Ga(e);e=Util.makeHexColor(...s);const r=this.#Ga(t);if(t=Util.makeHexColor(...r),this.#Ha.style.color="","#000000"===e&&"#ffffff"===t||e===t)return a.url;const o=new Array(256);for(let e=0;e<=255;e++){const t=e/255;o[e]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const l=o.join(","),c=`g_${this.#La}_hcm_filter`,h=a.filter=this.#za(c);this.#Wa(l,l,l,h),this.#Va(h);const getSteps=(e,t)=>{const i=s[e]/255,n=r[e]/255,a=new Array(t+1);for(let e=0;e<=t;e++)a[e]=i+e/t*(n-i);return a.join(",")};return this.#Wa(getSteps(0,5),getSteps(1,5),getSteps(2,5),h),a.url=this.#qa(c),a.url}addAlphaFilter(e){let t=this.#Ot.get(e);if(t)return t;const[i]=this.#Xa([e]),n=`alpha_${i}`;if(t=this.#Ot.get(n),t)return this.#Ot.set(e,t),t;const a=`g_${this.#La}_alpha_map_${this.#Mt++}`,s=this.#qa(a);this.#Ot.set(e,s),this.#Ot.set(n,s);const r=this.#za(a);return this.#Ka(i,r),s}addLuminosityFilter(e){let t,i,n=this.#Ot.get(e||"luminosity");if(n)return n;if(e?([t]=this.#Xa([e]),i=`luminosity_${t}`):i="luminosity",n=this.#Ot.get(i),n)return this.#Ot.set(e,n),n;const a=`g_${this.#La}_luminosity_map_${this.#Mt++}`,s=this.#qa(a);this.#Ot.set(e,s),this.#Ot.set(i,s);const r=this.#za(a);return this.#Ya(r),e&&this.#Ka(t,r),s}addHighlightHCMFilter(e,t,i,n,a){const s=`${t}-${i}-${n}-${a}`;let r=this.#$a.get(e);if(r?.key===s)return r.url;if(r?(r.filter?.remove(),r.key=s,r.url="none",r.filter=null):(r={key:s,url:"none",filter:null},this.#$a.set(e,r)),!t||!i)return r.url;const[o,l]=[t,i].map(this.#Ga.bind(this));let c=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),h=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[d,u]=[n,a].map(this.#Ga.bind(this));h<c&&([c,h,d,u]=[h,c,u,d]),this.#Ha.style.color="";const getSteps=(e,t,i)=>{const n=new Array(256),a=(h-c)/i,s=e/255,r=(t-e)/(255*i);let o=0;for(let e=0;e<=i;e++){const t=Math.round(c+e*a),i=s+e*r;for(let e=o;e<=t;e++)n[e]=i;o=t+1}for(let e=o;e<256;e++)n[e]=n[o-1];return n.join(",")},g=`g_${this.#La}_hcm_${e}_filter`,f=r.filter=this.#za(g);return this.#Va(f),this.#Wa(getSteps(d[0],u[0],5),getSteps(d[1],u[1],5),getSteps(d[2],u[2],5),f),r.url=this.#qa(g),r.url}destroy(e=!1){e&&this.#ja?.size||(this.#Na?.parentNode.parentNode.remove(),this.#Na=null,this.#Ba?.clear(),this.#Ba=null,this.#ja?.clear(),this.#ja=null,this.#Mt=0)}#Ya(e){const t=this.#Ua.createElementNS(bc,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),e.append(t)}#Va(e){const t=this.#Ua.createElementNS(bc,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(t)}#za(e){const t=this.#Ua.createElementNS(bc,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),this.#Ha.append(t),t}#Ja(e,t,i){const n=this.#Ua.createElementNS(bc,t);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),e.append(n)}#Wa(e,t,i,n){const a=this.#Ua.createElementNS(bc,"feComponentTransfer");n.append(a),this.#Ja(a,"feFuncR",e),this.#Ja(a,"feFuncG",t),this.#Ja(a,"feFuncB",i)}#Ka(e,t){const i=this.#Ua.createElementNS(bc,"feComponentTransfer");t.append(i),this.#Ja(i,"feFuncA",e)}#Ga(e){return this.#Ha.style.color=e,getRGB(getComputedStyle(this.#Ha).getPropertyValue("color"))}}class BaseStandardFontDataFactory{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetch(t).catch(e=>{throw new Error(`Unable to load font data at: ${t}`)})}async _fetch(e){unreachable("Abstract method `_fetch` called.")}}class DOMStandardFontDataFactory extends BaseStandardFontDataFactory{async _fetch(e){const t=await fetchData(e,"arraybuffer");return new Uint8Array(t)}}class BaseWasmFactory{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetch(t).catch(e=>{throw new Error(`Unable to load wasm data at: ${t}`)})}async _fetch(e){unreachable("Abstract method `_fetch` called.")}}class DOMWasmFactory extends BaseWasmFactory{async _fetch(e){const t=await fetchData(e,"arraybuffer");return new Uint8Array(t)}}async function node_utils_fetchData(e){const t=process.getBuiltinModule("fs"),i=await t.promises.readFile(e);return new Uint8Array(i)}class NodeFilterFactory extends BaseFilterFactory{}class NodeCanvasFactory extends BaseCanvasFactory{_createCanvas(e,t){process.getBuiltinModule("module").createRequire(import.meta.url);return new Proxy({},{get:(e,t)=>()=>{throw new Error("@napi-rs/canvas is not available in this environment")}}).createCanvas(e,t)}}class NodeCMapReaderFactory extends BaseCMapReaderFactory{async _fetch(e){return node_utils_fetchData(e)}}class NodeStandardFontDataFactory extends BaseStandardFontDataFactory{async _fetch(e){return node_utils_fetchData(e)}}class NodeWasmFactory extends BaseWasmFactory{async _fetch(e){return node_utils_fetchData(e)}}const Rc="__forcedDependency",{floor:Bc,ceil:Nc}=Math;function expandBBox(e,t,i,n,a,s){e[4*t+0]=Math.min(e[4*t+0],i),e[4*t+1]=Math.min(e[4*t+1],n),e[4*t+2]=Math.max(e[4*t+2],a),e[4*t+3]=Math.max(e[4*t+3],s)}const Lc=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class BBoxReader{#Za;#Qa;constructor(e,t){this.#Za=e,this.#Qa=t}get length(){return this.#Za.length}isEmpty(e){return this.#Za[e]===Lc}minX(e){return this.#Qa[4*e+0]/256}minY(e){return this.#Qa[4*e+1]/256}maxX(e){return(this.#Qa[4*e+2]+1)/256}maxY(e){return(this.#Qa[4*e+3]+1)/256}}const ensureDebugMetadata=(e,t)=>{if(!e)return;let i=e.get(t);return i||(i={dependencies:new Set,isRenderingOperation:!1},e.set(t,i)),i};class CanvasDependencyTracker{#es={__proto__:null};#ts={__proto__:null,transform:[],moveText:[],sameLineText:[],[Rc]:[]};#is=new Map;#ns=[];#as=[];#ss=[[1,0,0,1,0,0]];#rs=[-1/0,-1/0,1/0,1/0];#os=new Float64Array([1/0,1/0,-1/0,-1/0]);#ls=-1;#cs=new Set;#hs=new Map;#ds=new Map;#us;#gs;#fs;#Za;#ps;constructor(e,t,i=!1){this.#us=e.width,this.#gs=e.height,this.#ms(t),i&&(this.#ps=new Map)}growOperationsCount(e){e>=this.#Za.length&&this.#ms(e,this.#Za)}#ms(e,t){const i=new ArrayBuffer(4*e);this.#fs=new Uint8ClampedArray(i),this.#Za=new Uint32Array(i),t&&t.length>0?(this.#Za.set(t),this.#Za.fill(Lc,t.length)):this.#Za.fill(Lc)}save(e){return this.#es={__proto__:this.#es},this.#ts={__proto__:this.#ts,transform:{__proto__:this.#ts.transform},moveText:{__proto__:this.#ts.moveText},sameLineText:{__proto__:this.#ts.sameLineText},[Rc]:{__proto__:this.#ts[Rc]}},this.#rs={__proto__:this.#rs},this.#ns.push(e),this}restore(e){const t=Object.getPrototypeOf(this.#es);if(null===t)return this;this.#es=t,this.#ts=Object.getPrototypeOf(this.#ts),this.#rs=Object.getPrototypeOf(this.#rs);const i=this.#ns.pop();return void 0!==i&&(ensureDebugMetadata(this.#ps,e)?.dependencies.add(i),this.#Za[e]=this.#Za[i]),this}recordOpenMarker(e){return this.#ns.push(e),this}getOpenMarker(){return 0===this.#ns.length?null:this.#ns.at(-1)}recordCloseMarker(e){const t=this.#ns.pop();return void 0!==t&&(ensureDebugMetadata(this.#ps,e)?.dependencies.add(t),this.#Za[e]=this.#Za[t]),this}beginMarkedContent(e){return this.#as.push(e),this}endMarkedContent(e){const t=this.#as.pop();return void 0!==t&&(ensureDebugMetadata(this.#ps,e)?.dependencies.add(t),this.#Za[e]=this.#Za[t]),this}pushBaseTransform(e){return this.#ss.push(Util.multiplyByDOMMatrix(this.#ss.at(-1),e.getTransform())),this}popBaseTransform(){return this.#ss.length>1&&this.#ss.pop(),this}recordSimpleData(e,t){return this.#es[e]=t,this}recordIncrementalData(e,t){return this.#ts[e].push(t),this}resetIncrementalData(e,t){return this.#ts[e].length=0,this}recordNamedData(e,t){return this.#is.set(e,t),this}recordSimpleDataFromNamed(e,t,i){this.#es[e]=this.#is.get(t)??i}recordFutureForcedDependency(e,t){return this.recordIncrementalData(Rc,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(const t of e)t in this.#es&&this.recordFutureForcedDependency(t,this.#es[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const e of this.#cs)this.recordFutureForcedDependency(Rc,e);return this}resetBBox(e){return this.#ls!==e&&(this.#ls=e,this.#os[0]=1/0,this.#os[1]=1/0,this.#os[2]=-1/0,this.#os[3]=-1/0),this}recordClipBox(e,t,i,n,a,s){const r=Util.multiplyByDOMMatrix(this.#ss.at(-1),t.getTransform()),o=[1/0,1/0,-1/0,-1/0];Util.axialAlignedBoundingBox([i,a,n,s],r,o);const l=Util.intersect(this.#rs,o);return l?(this.#rs[0]=l[0],this.#rs[1]=l[1],this.#rs[2]=l[2],this.#rs[3]=l[3]):(this.#rs[0]=this.#rs[1]=1/0,this.#rs[2]=this.#rs[3]=-1/0),this}recordBBox(e,t,i,n,a,s){const r=this.#rs;if(r[0]===1/0)return this;const o=Util.multiplyByDOMMatrix(this.#ss.at(-1),t.getTransform());if(r[0]===-1/0)return Util.axialAlignedBoundingBox([i,a,n,s],o,this.#os),this;const l=[1/0,1/0,-1/0,-1/0];return Util.axialAlignedBoundingBox([i,a,n,s],o,l),this.#os[0]=Math.min(this.#os[0],Math.max(l[0],r[0])),this.#os[1]=Math.min(this.#os[1],Math.max(l[1],r[1])),this.#os[2]=Math.max(this.#os[2],Math.min(l[2],r[2])),this.#os[3]=Math.max(this.#os[3],Math.min(l[3],r[3])),this}recordCharacterBBox(e,t,i,n=1,a=0,s=0,r){const o=i.bbox;let l,c;if(o&&(l=o[2]!==o[0]&&o[3]!==o[1]&&this.#ds.get(i),!1!==l&&(c=[0,0,0,0],Util.axialAlignedBoundingBox(o,i.fontMatrix,c),1===n&&0===a&&0===s||Util.scaleMinMax([n,0,0,-n,a,s],c),l)))return this.recordBBox(e,t,c[0],c[2],c[1],c[3]);if(!r)return this.recordFullPageBBox(e);const h=r();return o&&c&&void 0===l&&(l=c[0]<=a-h.actualBoundingBoxLeft&&c[2]>=a+h.actualBoundingBoxRight&&c[1]<=s-h.actualBoundingBoxAscent&&c[3]>=s+h.actualBoundingBoxDescent,this.#ds.set(i,l),l)?this.recordBBox(e,t,c[0],c[2],c[1],c[3]):this.recordBBox(e,t,a-h.actualBoundingBoxLeft,a+h.actualBoundingBoxRight,s-h.actualBoundingBoxAscent,s+h.actualBoundingBoxDescent)}recordFullPageBBox(e){return this.#os[0]=Math.max(0,this.#rs[0]),this.#os[1]=Math.max(0,this.#rs[1]),this.#os[2]=Math.min(this.#us,this.#rs[2]),this.#os[3]=Math.min(this.#gs,this.#rs[3]),this}getSimpleIndex(e){return this.#es[e]}recordDependencies(e,t){const i=this.#cs,n=this.#es,a=this.#ts;for(const e of t)e in this.#es?i.add(n[e]):e in a&&a[e].forEach(i.add,i);return this}recordNamedDependency(e,t){return this.#is.has(t)&&this.#cs.add(this.#is.get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[Rc]),this.#ps){const t=ensureDebugMetadata(this.#ps,e),{dependencies:i}=t;this.#cs.forEach(i.add,i),this.#ns.forEach(i.add,i),this.#as.forEach(i.add,i),i.delete(e),t.isRenderingOperation=!0}if(this.#ls===e){const i=Bc(256*this.#os[0]/this.#us),n=Bc(256*this.#os[1]/this.#gs),a=Nc(256*this.#os[2]/this.#us),s=Nc(256*this.#os[3]/this.#gs);expandBBox(this.#fs,e,i,n,a,s);for(const t of this.#cs)t!==e&&expandBBox(this.#fs,t,i,n,a,s);for(const t of this.#ns)t!==e&&expandBBox(this.#fs,t,i,n,a,s);for(const t of this.#as)t!==e&&expandBBox(this.#fs,t,i,n,a,s);t||(this.#cs.clear(),this.#ls=-1)}return this}recordShowTextOperation(e,t=!1){const i=Array.from(this.#cs);this.recordOperation(e,t),this.recordIncrementalData("sameLineText",e);for(const e of i)this.recordIncrementalData("sameLineText",e);return this}bboxToClipBoxDropOperation(e,t=!1){return this.#ls===e&&(this.#ls=-1,this.#rs[0]=Math.max(this.#rs[0],this.#os[0]),this.#rs[1]=Math.max(this.#rs[1],this.#os[1]),this.#rs[2]=Math.min(this.#rs[2],this.#os[2]),this.#rs[3]=Math.min(this.#rs[3],this.#os[3]),t||this.#cs.clear()),this}_takePendingDependencies(){const e=this.#cs;return this.#cs=new Set,e}_extractOperation(e){const t=this.#hs.get(e);return this.#hs.delete(e),t}_pushPendingDependencies(e){for(const t of e)this.#cs.add(t)}take(){return this.#ds.clear(),new BBoxReader(this.#Za,this.#fs)}takeDebugMetadata(){return this.#ps}}class CanvasNestedDependencyTracker{#bs;#ys;#ws;#As=0;#xs=0;constructor(e,t,i){if(e instanceof CanvasNestedDependencyTracker&&e.#ws===!!i)return e;this.#bs=e,this.#ys=t,this.#ws=!!i}growOperationsCount(){throw new Error("Unreachable")}save(e){return this.#xs++,this.#bs.save(this.#ys),this}restore(e){return this.#xs>0&&(this.#bs.restore(this.#ys),this.#xs--),this}recordOpenMarker(e){return this.#As++,this}getOpenMarker(){return this.#As>0?this.#ys:this.#bs.getOpenMarker()}recordCloseMarker(e){return this.#As--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return this.#bs.pushBaseTransform(e),this}popBaseTransform(){return this.#bs.popBaseTransform(),this}recordSimpleData(e,t){return this.#bs.recordSimpleData(e,this.#ys),this}recordIncrementalData(e,t){return this.#bs.recordIncrementalData(e,this.#ys),this}resetIncrementalData(e,t){return this.#bs.resetIncrementalData(e,this.#ys),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,i){return this.#bs.recordSimpleDataFromNamed(e,t,this.#ys),this}recordFutureForcedDependency(e,t){return this.#bs.recordFutureForcedDependency(e,this.#ys),this}inheritSimpleDataAsFutureForcedDependencies(e){return this.#bs.inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#bs.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return this.#ws||this.#bs.resetBBox(this.#ys),this}recordClipBox(e,t,i,n,a,s){return this.#ws||this.#bs.recordClipBox(this.#ys,t,i,n,a,s),this}recordBBox(e,t,i,n,a,s){return this.#ws||this.#bs.recordBBox(this.#ys,t,i,n,a,s),this}recordCharacterBBox(e,t,i,n,a,s,r){return this.#ws||this.#bs.recordCharacterBBox(this.#ys,t,i,n,a,s,r),this}recordFullPageBBox(e){return this.#ws||this.#bs.recordFullPageBBox(this.#ys),this}getSimpleIndex(e){return this.#bs.getSimpleIndex(e)}recordDependencies(e,t){return this.#bs.recordDependencies(this.#ys,t),this}recordNamedDependency(e,t){return this.#bs.recordNamedDependency(this.#ys,t),this}recordOperation(e){return this.#bs.recordOperation(this.#ys,!0),this}recordShowTextOperation(e){return this.#bs.recordShowTextOperation(this.#ys,!0),this}bboxToClipBoxDropOperation(e){return this.#ws||this.#bs.bboxToClipBoxDropOperation(this.#ys,!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const Uc=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],jc=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],$c=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],Hc=["filter","fillColor","fillAlpha"],Xc=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],qc=["transform"],zc=["transform","fillColor"],Wc="Fill",Gc="Stroke",Vc="Shading";function applyBoundingBox(e,t){if(!t)return;const i=t[2]-t[0],n=t[3]-t[1],a=new Path2D;a.rect(t[0],t[1],i,n),e.clip(a)}class BaseShadingPattern{isModifyingCurrentTransform(){return!1}getPattern(){unreachable("Abstract method `getPattern` called.")}}class RadialAxialShadingPattern extends BaseShadingPattern{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,i,n){let a;if(n===Gc||n===Wc){const s=t.current.getClippedPathBoundingBox(n,getCurrentTransform(e))||[0,0,0,0],r=Math.ceil(s[2]-s[0])||1,o=Math.ceil(s[3]-s[1])||1,l=t.cachedCanvases.getCanvas("pattern",r,o),c=l.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-s[0],-s[1]),i=Util.transform(i,[1,0,0,1,s[0],s[1]]),c.transform(...t.baseTransform),this.matrix&&c.transform(...this.matrix),applyBoundingBox(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),a=e.createPattern(l.canvas,"no-repeat");const h=new DOMMatrix(i);a.setTransform(h)}else applyBoundingBox(e,this._bbox),a=this._createGradient(e);return a}}function drawTriangle(e,t,i,n,a,s,r,o){const l=t.coords,c=t.colors,h=e.data,d=4*e.width;let u;l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=s,s=r,r=u),l[n+1]>l[a+1]&&(u=n,n=a,a=u,u=r,r=o,o=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=s,s=r,r=u);const g=(l[i]+t.offsetX)*t.scaleX,f=(l[i+1]+t.offsetY)*t.scaleY,p=(l[n]+t.offsetX)*t.scaleX,m=(l[n+1]+t.offsetY)*t.scaleY,b=(l[a]+t.offsetX)*t.scaleX,y=(l[a+1]+t.offsetY)*t.scaleY;if(f>=y)return;const w=c[s],x=c[s+1],S=c[s+2],v=c[r],C=c[r+1],k=c[r+2],T=c[o],F=c[o+1],E=c[o+2],M=Math.round(f),D=Math.round(y);let O,_,R,N,L,U,j,$;for(let e=M;e<=D;e++){if(e<m){const t=e<f?0:(f-e)/(f-m);O=g-(g-p)*t,_=w-(w-v)*t,R=x-(x-C)*t,N=S-(S-k)*t}else{let t;t=e>y?1:m===y?0:(m-e)/(m-y),O=p-(p-b)*t,_=v-(v-T)*t,R=C-(C-F)*t,N=k-(k-E)*t}let t;t=e<f?0:e>y?1:(f-e)/(f-y),L=g-(g-b)*t,U=w-(w-T)*t,j=x-(x-F)*t,$=S-(S-E)*t;const i=Math.round(Math.min(O,L)),n=Math.round(Math.max(O,L));let a=d*e+4*i;for(let e=i;e<=n;e++)t=(O-e)/(O-L),t<0?t=0:t>1&&(t=1),h[a++]=_-(_-U)*t|0,h[a++]=R-(R-j)*t|0,h[a++]=N-(N-$)*t|0,h[a++]=255}}function drawFigure(e,t,i){const n=t.coords,a=t.colors;let s,r;switch(t.type){case"lattice":const o=t.verticesPerRow,l=Math.floor(n.length/o)-1,c=o-1;for(s=0;s<l;s++){let t=s*o;for(let s=0;s<c;s++,t++)drawTriangle(e,i,n[t],n[t+1],n[t+o],a[t],a[t+1],a[t+o]),drawTriangle(e,i,n[t+o+1],n[t+1],n[t+o],a[t+o+1],a[t+1],a[t+o])}break;case"triangles":for(s=0,r=n.length;s<r;s+=3)drawTriangle(e,i,n[s],n[s+1],n[s+2],a[s],a[s+1],a[s+2]);break;default:throw new Error("illegal figure")}}class MeshShadingPattern extends BaseShadingPattern{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,t,i){const n=Math.floor(this._bounds[0]),a=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-n,r=Math.ceil(this._bounds[3])-a,o=Math.min(Math.ceil(Math.abs(s*e[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(r*e[1]*1.1)),3e3),c=s/o,h=r/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-a,scaleX:1/c,scaleY:1/h},u=o+4,g=l+4,f=i.getCanvas("mesh",u,g),p=f.context,m=p.createImageData(o,l);if(t){const e=m.data;for(let i=0,n=e.length;i<n;i+=4)e[i]=t[0],e[i+1]=t[1],e[i+2]=t[2],e[i+3]=255}for(const e of this._figures)drawFigure(m,e,d);p.putImageData(m,2,2);return{canvas:f.canvas,offsetX:n-2*c,offsetY:a-2*h,scaleX:c,scaleY:h}}isModifyingCurrentTransform(){return!0}getPattern(e,t,i,n){applyBoundingBox(e,this._bbox);const a=new Float32Array(2);if(n===Vc)Util.singularValueDecompose2dScale(getCurrentTransform(e),a);else if(this.matrix){Util.singularValueDecompose2dScale(this.matrix,a);const[e,i]=a;Util.singularValueDecompose2dScale(t.baseTransform,a),a[0]*=e,a[1]*=i}else Util.singularValueDecompose2dScale(t.baseTransform,a);const s=this._createMeshCanvas(a,n===Vc?null:this._background,t.cachedCanvases);return n!==Vc&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(s.offsetX,s.offsetY),e.scale(s.scaleX,s.scaleY),e.createPattern(s.canvas,"no-repeat")}}class DummyShadingPattern extends BaseShadingPattern{getPattern(){return"hotpink"}}const Kc=1,Yc=2;class TilingPattern{static MAX_PATTERN_SIZE=3e3;constructor(e,t,i,n){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.ctx=t,this.canvasGraphicsFactory=i,this.baseTransform=n}createPatternCanvas(e,t){const{bbox:i,operatorList:n,paintType:a,tilingType:s,color:r,canvasGraphicsFactory:o}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),info("TilingType: "+s);const h=i[0],d=i[1],u=i[2],g=i[3],f=u-h,p=g-d,m=new Float32Array(2);Util.singularValueDecompose2dScale(this.matrix,m);const[b,y]=m;Util.singularValueDecompose2dScale(this.baseTransform,m);const w=b*m[0],x=y*m[1];let S=f,v=p,C=!1,k=!1;const T=Math.ceil(l*w),F=Math.ceil(c*x);T>=Math.ceil(f*w)?S=l:C=!0,F>=Math.ceil(p*x)?v=c:k=!0;const E=this.getSizeAndScale(S,this.ctx.canvas.width,w),M=this.getSizeAndScale(v,this.ctx.canvas.height,x),D=e.cachedCanvases.getCanvas("pattern",E.size,M.size),O=D.context,_=o.createCanvasGraphics(O,t);if(_.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(_,a,r),O.translate(-E.scale*h,-M.scale*d),_.transform(0,E.scale,0,0,M.scale,0,0),O.save(),_.dependencyTracker?.save(),this.clipBbox(_,h,d,u,g),_.baseTransform=getCurrentTransform(_.ctx),_.executeOperatorList(n),_.endDrawing(),_.dependencyTracker?.restore(),O.restore(),C||k){const t=D.canvas;C&&(S=l),k&&(v=c);const i=this.getSizeAndScale(S,this.ctx.canvas.width,w),n=this.getSizeAndScale(v,this.ctx.canvas.height,x),a=i.size,s=n.size,r=e.cachedCanvases.getCanvas("pattern-workaround",a,s),o=r.context,u=C?Math.floor(f/l):0,g=k?Math.floor(p/c):0;for(let e=0;e<=u;e++)for(let i=0;i<=g;i++)o.drawImage(t,a*e,s*i,a,s,0,0,a,s);return{canvas:r.canvas,scaleX:i.scale,scaleY:n.scale,offsetX:h,offsetY:d}}return{canvas:D.canvas,scaleX:E.scale,scaleY:M.scale,offsetX:h,offsetY:d}}getSizeAndScale(e,t,i){const n=Math.max(TilingPattern.MAX_PATTERN_SIZE,t);let a=Math.ceil(e*i);return a>=n?a=n:i=a/e,{scale:i,size:a}}clipBbox(e,t,i,n,a){const s=n-t,r=a-i;e.ctx.rect(t,i,s,r),Util.axialAlignedBoundingBox([t,i,n,a],getCurrentTransform(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,i){const n=e.ctx,a=e.current;switch(t){case Kc:const{fillStyle:e,strokeStyle:s}=this.ctx;n.fillStyle=a.fillColor=e,n.strokeStyle=a.strokeColor=s;break;case Yc:n.fillStyle=n.strokeStyle=i,a.fillColor=a.strokeColor=i;break;default:throw new FormatError(`Unsupported paint type: ${t}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,t,i,n,a){let s=i;n!==Vc&&(s=Util.transform(s,t.baseTransform),this.matrix&&(s=Util.transform(s,this.matrix)));const r=this.createPatternCanvas(t,a);let o=new DOMMatrix(s);o=o.translate(r.offsetX,r.offsetY),o=o.scale(1/r.scaleX,1/r.scaleY);const l=e.createPattern(r.canvas,"repeat");return l.setTransform(o),l}}function convertBlackAndWhiteToRGBA({src:e,srcPos:t=0,dest:i,width:n,height:a,nonBlackColor:s=4294967295,inverseDecode:r=!1}){const o=util_FeatureTest.isLittleEndian?4278190080:255,[l,c]=r?[s,o]:[o,s],h=n>>3,d=7&n,u=e.length;i=new Uint32Array(i.buffer);let g=0;for(let n=0;n<a;n++){for(const n=t+h;t<n;t++){const n=t<u?e[t]:255;i[g++]=128&n?c:l,i[g++]=64&n?c:l,i[g++]=32&n?c:l,i[g++]=16&n?c:l,i[g++]=8&n?c:l,i[g++]=4&n?c:l,i[g++]=2&n?c:l,i[g++]=1&n?c:l}if(0===d)continue;const n=t<u?e[t++]:255;for(let e=0;e<d;e++)i[g++]=n&1<<7-e?c:l}return{srcPos:t,destPos:g}}const Jc=16,Zc=new DOMMatrix,Qc=new Float32Array(2),eh=new Float32Array([1/0,1/0,-1/0,-1/0]);class CachedCanvases{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,i){let n;return void 0!==this.cache[e]?(n=this.cache[e],this.canvasFactory.reset(n,t,i)):(n=this.canvasFactory.create(t,i),this.cache[e]=n),n}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function drawImageAtIntegerCoords(e,t,i,n,a,s,r,o,l,c){const[h,d,u,g,f,p]=getCurrentTransform(e);if(0===d&&0===u){const m=r*h+f,b=Math.round(m),y=o*g+p,w=Math.round(y),x=(r+l)*h+f,S=Math.abs(Math.round(x)-b)||1,v=(o+c)*g+p,C=Math.abs(Math.round(v)-w)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(g),b,w),e.drawImage(t,i,n,a,s,0,0,S,C),e.setTransform(h,d,u,g,f,p),[S,C]}if(0===h&&0===g){const m=o*u+f,b=Math.round(m),y=r*d+p,w=Math.round(y),x=(o+c)*u+f,S=Math.abs(Math.round(x)-b)||1,v=(r+l)*d+p,C=Math.abs(Math.round(v)-w)||1;return e.setTransform(0,Math.sign(d),Math.sign(u),0,b,w),e.drawImage(t,i,n,a,s,0,0,C,S),e.setTransform(h,d,u,g,f,p),[C,S]}e.drawImage(t,i,n,a,s,r,o,l,c);return[Math.hypot(h,d)*l,Math.hypot(u,g)*c]}class CanvasExtraState{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=Il;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=zl;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(e,t,i){i?.(this),this.clipBox=new Float32Array([0,0,e,t]),this.minMax=eh.slice()}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=Wc,t=null){const i=this.minMax.slice();if(e===Gc){t||unreachable("Stroke bounding box must include transform."),Util.singularValueDecompose2dScale(t,Qc);const e=Qc[0]*this.lineWidth/2,n=Qc[1]*this.lineWidth/2;i[0]-=e,i[1]-=n,i[2]+=e,i[3]+=n}return i}updateClipFromPath(){const e=Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(eh,0)}getClippedPathBoundingBox(e=Wc,t=null){return Util.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function putBinaryImageData(e,t){if(t instanceof ImageData)return void e.putImageData(t,0,0);const i=t.height,n=t.width,a=i%Jc,s=(i-a)/Jc,r=0===a?s:s+1,o=e.createImageData(n,Jc);let l,c=0;const h=t.data,d=o.data;let u,g,f,p;if(t.kind===Jl.GRAYSCALE_1BPP){const t=h.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),p=i.length,m=n+7>>3,b=4294967295,y=util_FeatureTest.isLittleEndian?4278190080:255;for(u=0;u<r;u++){for(f=u<s?Jc:a,l=0,g=0;g<f;g++){const e=t-c;let a=0;const s=e>m?n:8*e-7,r=-8&s;let o=0,d=0;for(;a<r;a+=8)d=h[c++],i[l++]=128&d?b:y,i[l++]=64&d?b:y,i[l++]=32&d?b:y,i[l++]=16&d?b:y,i[l++]=8&d?b:y,i[l++]=4&d?b:y,i[l++]=2&d?b:y,i[l++]=1&d?b:y;for(;a<s;a++)0===o&&(d=h[c++],o=128),i[l++]=d&o?b:y,o>>=1}for(;l<p;)i[l++]=0;e.putImageData(o,0,u*Jc)}}else if(t.kind===Jl.RGBA_32BPP){for(g=0,p=n*Jc*4,u=0;u<s;u++)d.set(h.subarray(c,c+p)),c+=p,e.putImageData(o,0,g),g+=Jc;u<r&&(p=n*a*4,d.set(h.subarray(c,c+p)),e.putImageData(o,0,g))}else{if(t.kind!==Jl.RGB_24BPP)throw new Error(`bad image kind: ${t.kind}`);for(f=Jc,p=n*f,u=0;u<r;u++){for(u>=s&&(f=a,p=n*f),l=0,g=p;g--;)d[l++]=h[c++],d[l++]=h[c++],d[l++]=h[c++],d[l++]=255;e.putImageData(o,0,u*Jc)}}}function putBinaryImageMask(e,t){if(t.bitmap)return void e.drawImage(t.bitmap,0,0);const i=t.height,n=t.width,a=i%Jc,s=(i-a)/Jc,r=0===a?s:s+1,o=e.createImageData(n,Jc);let l=0;const c=t.data,h=o.data;for(let t=0;t<r;t++){const i=t<s?Jc:a;({srcPos:l}=convertBlackAndWhiteToRGBA({src:c,srcPos:l,dest:h,width:n,height:i,nonBlackColor:0})),e.putImageData(o,0,t*Jc)}}function copyCtxState(e,t){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of i)void 0!==e[n]&&(t[n]=e[n]);void 0!==e.setLineDash&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function resetCtxToDefault(e){e.strokeStyle=e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",void 0!==e.setLineDash&&(e.setLineDash([]),e.lineDashOffset=0);const{filter:t}=e;"none"!==t&&""!==t&&(e.filter="none")}function getImageSmoothingEnabled(e,t){if(t)return!0;Util.singularValueDecompose2dScale(e,Qc);const i=Math.fround(OutputScale.pixelRatio*PixelsPerInch.PDF_TO_CSS_UNITS);return Qc[0]<=i&&Qc[1]<=i}const th=["butt","round","square"],ih=["miter","round","bevel"],nh={},ah={};class CanvasGraphics{constructor(e,t,i,n,a,{optionalContentConfig:s,markedContentStack:r=null},o,l,c){this.ctx=e,this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=i,this.canvasFactory=n,this.filterFactory=a,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=r||[],this.optionalContentConfig=s,this.cachedCanvases=new CachedCanvases(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=c??null}getObject(e,t,i=null){return"string"==typeof t?(this.dependencyTracker?.recordNamedDependency(e,t),t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t)):i}beginDrawing({transform:e,viewport:t,transparency:i=!1,background:n=null}){const a=this.ctx.canvas.width,s=this.ctx.canvas.height,r=this.ctx.fillStyle;if(this.ctx.fillStyle=n||"#ffffff",this.ctx.fillRect(0,0,a,s),this.ctx.fillStyle=r,i){const e=this.cachedCanvases.getCanvas("transparent",a,s);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...getCurrentTransform(this.compositeCtx))}this.ctx.save(),resetCtxToDefault(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=getCurrentTransform(this.ctx)}executeOperatorList(e,t,i,n,a){const s=e.argsArray,r=e.fnArray;let o=t||0;const l=s.length;if(l===o)return o;const c=l-o>10&&"function"==typeof i,h=c?Date.now()+15:0;let d=0;const u=this.commonObjs,g=this.objs;let f,p;for(;;){if(void 0!==n&&o===n.nextBreakPoint)return n.breakIt(o,i),o;if(!a||a(o))if(f=r[o],p=s[o]??null,f!==sc.dependency)null===p?this[f](o):this[f](o,...p);else for(const e of p){this.dependencyTracker?.recordNamedData(e,o);const t=e.startsWith("g_")?u:g;if(!t.has(e))return t.get(e,i),o}if(o++,o===l)return o;if(c&&++d>10){if(Date.now()>h)return i(),o;d=0}}}#Ss(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#Ss(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#vs()}#vs(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==e){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){const i=e.width??e.displayWidth,n=e.height??e.displayHeight;let a,s,r=Math.max(Math.hypot(t[0],t[1]),1),o=Math.max(Math.hypot(t[2],t[3]),1),l=i,c=n,h="prescale1";for(;r>2&&l>1||o>2&&c>1;){let t=l,i=c;r>2&&l>1&&(t=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),r/=l/t),o>2&&c>1&&(i=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/i),a=this.cachedCanvases.getCanvas(h,t,i),s=a.context,s.clearRect(0,0,t,i),s.drawImage(e,0,0,l,c,0,0,t,i),e=a.canvas,l=t,c=i,h="prescale1"===h?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}_createMaskCanvas(e,t){const i=this.ctx,{width:n,height:a}=t,s=this.current.fillColor,r=this.current.patternFill,o=getCurrentTransform(i);let l,c,h,d;if((t.bitmap||t.data)&&t.count>1){const i=t.bitmap||t.data.buffer;c=JSON.stringify(r?o:[o.slice(0,4),s]),l=this._cachedBitmapsMap.get(i),l||(l=new Map,this._cachedBitmapsMap.set(i,l));const n=l.get(c);if(n&&!r){const t=Math.round(Math.min(o[0],o[2])+o[4]),i=Math.round(Math.min(o[1],o[3])+o[5]);return this.dependencyTracker?.recordDependencies(e,zc),{canvas:n,offsetX:t,offsetY:i}}h=n}h||(d=this.cachedCanvases.getCanvas("maskCanvas",n,a),putBinaryImageMask(d.context,t));let u=Util.transform(o,[1/n,0,0,-1/a,0,0]);u=Util.transform(u,[1,0,0,1,0,-a]);const g=eh.slice();Util.axialAlignedBoundingBox([0,0,n,a],u,g);const[f,p,m,b]=g,y=Math.round(m-f)||1,w=Math.round(b-p)||1,x=this.cachedCanvases.getCanvas("fillCanvas",y,w),S=x.context,v=f,C=p;S.translate(-v,-C),S.transform(...u),h||(h=this._scaleImage(d.canvas,getCurrentTransformInverse(S)),h=h.img,l&&r&&l.set(c,h)),S.imageSmoothingEnabled=getImageSmoothingEnabled(getCurrentTransform(S),t.interpolate),drawImageAtIntegerCoords(S,h,0,0,h.width,h.height,0,0,n,a),S.globalCompositeOperation="source-in";const k=Util.transform(getCurrentTransformInverse(S),[1,0,0,1,-v,-C]);return S.fillStyle=r?s.getPattern(i,this,k,Wc,e):s,S.fillRect(0,0,n,a),l&&!r&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,x.canvas)),this.dependencyTracker?.recordDependencies(e,zc),{canvas:x.canvas,offsetX:Math.round(v),offsetY:Math.round(C)}}setLineWidth(e,t){this.dependencyTracker?.recordSimpleData("lineWidth",e),t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(e,t){this.dependencyTracker?.recordSimpleData("lineCap",e),this.ctx.lineCap=th[t]}setLineJoin(e,t){this.dependencyTracker?.recordSimpleData("lineJoin",e),this.ctx.lineJoin=ih[t]}setMiterLimit(e,t){this.dependencyTracker?.recordSimpleData("miterLimit",e),this.ctx.miterLimit=t}setDash(e,t,i){this.dependencyTracker?.recordSimpleData("dash",e);const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(t),n.lineDashOffset=i)}setRenderingIntent(e,t){}setFlatness(e,t){}setGState(e,t){for(const[i,n]of t)switch(i){case"LW":this.setLineWidth(e,n);break;case"LC":this.setLineCap(e,n);break;case"LJ":this.setLineJoin(e,n);break;case"ML":this.setMiterLimit(e,n);break;case"D":this.setDash(e,n[0],n[1]);break;case"RI":this.setRenderingIntent(e,n);break;case"FL":this.setFlatness(e,n);break;case"Font":this.setFont(e,n[0],n[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",e),this.current.strokeAlpha=n;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",e),this.ctx.globalAlpha=this.current.fillAlpha=n;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",e),this.ctx.globalCompositeOperation=n;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",e),this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.dependencyTracker?.recordSimpleData("filter",e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(e){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,i=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(n,t,i);this.suspendedCtx=this.ctx;const s=this.ctx=a.context;s.setTransform(this.suspendedCtx.getTransform()),copyCtxState(this.suspendedCtx,s),function(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,i){t.translate(e,i),this.__originalTranslate(e,i)},e.scale=function(e,i){t.scale(e,i),this.__originalScale(e,i)},e.transform=function(e,i,n,a,s,r){t.transform(e,i,n,a,s,r),this.__originalTransform(e,i,n,a,s,r)},e.setTransform=function(e,i,n,a,s,r){t.setTransform(e,i,n,a,s,r),this.__originalSetTransform(e,i,n,a,s,r)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,i){t.moveTo(e,i),this.__originalMoveTo(e,i)},e.lineTo=function(e,i){t.lineTo(e,i),this.__originalLineTo(e,i)},e.bezierCurveTo=function(e,i,n,a,s,r){t.bezierCurveTo(e,i,n,a,s,r),this.__originalBezierCurveTo(e,i,n,a,s,r)},e.rect=function(e,i,n,a){t.rect(e,i,n,a),this.__originalRect(e,i,n,a)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(s,this.suspendedCtx),this.setGState(e,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),copyCtxState(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,t,i,n){const a=n[0],s=n[1],r=n[2]-a,o=n[3]-s;0!==r&&0!==o&&(this.genericComposeSMask(t.context,i,r,o,t.subtype,t.backdrop,t.transferMap,a,s,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(i.canvas,0,0),e.restore())}genericComposeSMask(e,t,i,n,a,s,r,o,l,c,h){let d=e.canvas,u=o-c,g=l-h;if(s)if(u<0||g<0||u+i>d.width||g+n>d.height){const e=this.cachedCanvases.getCanvas("maskExtension",i,n),t=e.context;t.drawImage(d,-u,-g),t.globalCompositeOperation="destination-atop",t.fillStyle=s,t.fillRect(0,0,i,n),t.globalCompositeOperation="source-over",d=e.canvas,u=g=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const t=new Path2D;t.rect(u,g,i,n),e.clip(t),e.globalCompositeOperation="destination-atop",e.fillStyle=s,e.fillRect(u,g,i,n),e.restore()}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),"Alpha"===a&&r?t.filter=this.filterFactory.addAlphaFilter(r):"Luminosity"===a&&(t.filter=this.filterFactory.addLuminosityFilter(r));const f=new Path2D;f.rect(o,l,i,n),t.clip(f),t.globalCompositeOperation="destination-in",t.drawImage(d,u,g,i,n,o,l,i,n),t.restore()}save(e){this.inSMaskMode&&copyCtxState(this.ctx,this.suspendedCtx),this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone(),this.dependencyTracker?.save(e)}restore(e){this.dependencyTracker?.restore(e),0!==this.stateStack.length?(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&copyCtxState(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null):this.inSMaskMode&&this.endSMaskMode()}transform(e,t,i,n,a,s,r){this.dependencyTracker?.recordIncrementalData("transform",e),this.ctx.transform(t,i,n,a,s,r),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,i,n){let[a]=i;if(!n)return a||=i[0]=new Path2D,void this[t](e,a);if(null!==this.dependencyTracker){const i=t===sc.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,n[0]-i,n[2]+i,n[1]-i,n[3]+i).recordDependencies(e,["transform"])}if(!(a instanceof Path2D)){const e=i[0]=new Path2D;for(let t=0,i=a.length;t<i;)switch(a[t++]){case rc:e.moveTo(a[t++],a[t++]);break;case oc:e.lineTo(a[t++],a[t++]);break;case lc:e.bezierCurveTo(a[t++],a[t++],a[t++],a[t++],a[t++],a[t++]);break;case cc:e.closePath();break;default:warn(`Unrecognized drawing path operator: ${a[t-1]}`)}a=e}Util.axialAlignedBoundingBox(n,getCurrentTransform(this.ctx),this.current.minMax),this[t](e,a),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,t,i=!0){const n=this.ctx,a=this.current.strokeColor;if(n.globalAlpha=this.current.strokeAlpha,this.contentVisible)if("object"==typeof a&&a?.getPattern){const i=a.isModifyingCurrentTransform()?n.getTransform():null;if(n.save(),n.strokeStyle=a.getPattern(n,this,getCurrentTransformInverse(n),Gc,e),i){const e=new Path2D;e.addPath(t,n.getTransform().invertSelf().multiplySelf(i)),t=e}this.rescaleAndStroke(t,!1),n.restore()}else this.rescaleAndStroke(t,!0);this.dependencyTracker?.recordDependencies(e,Uc),i&&this.consumePath(e,t,this.current.getClippedPathBoundingBox(Gc,getCurrentTransform(this.ctx))),n.globalAlpha=this.current.fillAlpha}closeStroke(e,t){this.stroke(e,t)}fill(e,t,i=!0){const n=this.ctx,a=this.current.fillColor;let s=!1;if(this.current.patternFill){const i=a.isModifyingCurrentTransform()?n.getTransform():null;if(this.dependencyTracker?.save(e),n.save(),n.fillStyle=a.getPattern(n,this,getCurrentTransformInverse(n),Wc,e),i){const e=new Path2D;e.addPath(t,n.getTransform().invertSelf().multiplySelf(i)),t=e}s=!0}const r=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==r&&(this.pendingEOFill?(n.fill(t,"evenodd"),this.pendingEOFill=!1):n.fill(t)),this.dependencyTracker?.recordDependencies(e,jc),s&&(n.restore(),this.dependencyTracker?.restore(e)),i&&this.consumePath(e,t,r)}eoFill(e,t){this.pendingEOFill=!0,this.fill(e,t)}fillStroke(e,t){this.fill(e,t,!1),this.stroke(e,t,!1),this.consumePath(e,t)}eoFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}closeFillStroke(e,t){this.fillStroke(e,t)}closeEOFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}endPath(e,t){this.consumePath(e,t)}rawFillPath(e,t){this.ctx.fill(t),this.dependencyTracker?.recordDependencies(e,Hc).recordOperation(e)}clip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=nh}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=ah}beginText(e){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(e).resetIncrementalData("sameLineText").resetIncrementalData("moveText",e)}endText(e){const t=this.pendingTextPaths,i=this.ctx;if(this.dependencyTracker){const{dependencyTracker:i}=this;void 0!==t&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",e),i.recordCloseMarker(e)}if(void 0!==t){const e=new Path2D,n=i.getTransform().invertSelf();for(const{transform:i,x:a,y:s,fontSize:r,path:o}of t)o&&e.addPath(o,new DOMMatrix(i).preMultiplySelf(n).translate(a,s).scale(r,-r));i.clip(e)}delete this.pendingTextPaths}setCharSpacing(e,t){this.dependencyTracker?.recordSimpleData("charSpacing",e),this.current.charSpacing=t}setWordSpacing(e,t){this.dependencyTracker?.recordSimpleData("wordSpacing",e),this.current.wordSpacing=t}setHScale(e,t){this.dependencyTracker?.recordSimpleData("hScale",e),this.current.textHScale=t/100}setLeading(e,t){this.dependencyTracker?.recordSimpleData("leading",e),this.current.leading=-t}setFont(e,t,i){this.dependencyTracker?.recordSimpleData("font",e).recordSimpleDataFromNamed("fontObj",t,e);const n=this.commonObjs.get(t),a=this.current;if(!n)throw new Error(`Can't find font for ${t}`);if(a.fontMatrix=n.fontMatrix||Il,0!==a.fontMatrix[0]&&0!==a.fontMatrix[3]||warn("Invalid font matrix for font "+t),i<0?(i=-i,a.fontDirection=-1):a.fontDirection=1,this.current.font=n,this.current.fontSize=i,n.isType3Font)return;const s=n.loadedName||"sans-serif",r=n.systemFontInfo?.css||`"${s}", ${n.fallbackName}`;let o="normal";n.black?o="900":n.bold&&(o="bold");const l=n.italic?"italic":"normal";let c=i;i<16?c=16:i>100&&(c=100),this.current.fontSizeScale=i/c,this.ctx.font=`${l} ${o} ${c}px ${r}`}setTextRenderingMode(e,t){this.dependencyTracker?.recordSimpleData("textRenderingMode",e),this.current.textRenderingMode=t}setTextRise(e,t){this.dependencyTracker?.recordSimpleData("textRise",e),this.current.textRise=t}moveText(e,t,i){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",e),this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=i}setLeadingMoveText(e,t,i){this.setLeading(e,-i),this.moveText(e,t,i)}setTextMatrix(e,t){this.dependencyTracker?.recordSimpleData("textMatrix",e);const{current:i}=this;i.textMatrix=t,i.textMatrixScale=Math.hypot(t[0],t[1]),i.x=i.lineX=0,i.y=i.lineY=0}nextLine(e){this.moveText(e,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??e)}#Cs(e,t,i){const n=new Path2D;return n.addPath(e,new DOMMatrix(i).invertSelf().multiplySelf(t)),n}paintChar(e,t,i,n,a,s){const r=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,h=o.fontSize/o.fontSizeScale,d=c&Kl,u=!!(c&Yl),g=o.patternFill&&!l.missingFile,f=o.patternStroke&&!l.missingFile;let p;if((l.disableFontFace||u||g||f)&&!l.missingFile&&(p=l.getPathGenerator(this.commonObjs,t)),p&&(l.disableFontFace||g||f)){let t;if(r.save(),r.translate(i,n),r.scale(h,-h),this.dependencyTracker?.recordCharacterBBox(e,r,l),d===zl||d===Gl)if(a){t=r.getTransform(),r.setTransform(...a);const e=this.#Cs(p,t,a);r.fill(e)}else r.fill(p);if(d===Wl||d===Gl)if(s){t||=r.getTransform(),r.setTransform(...s);const{a:e,b:i,c:n,d:a}=t,o=Util.inverseTransform(s),l=Util.transform([e,i,n,a,0,0],o);Util.singularValueDecompose2dScale(l,Qc),r.lineWidth*=Math.max(Qc[0],Qc[1])/h,r.stroke(this.#Cs(p,t,s))}else r.lineWidth/=h,r.stroke(p);r.restore()}else d!==zl&&d!==Gl||(r.fillText(t,i,n),this.dependencyTracker?.recordCharacterBBox(e,r,l,h,i,n,()=>r.measureText(t))),d!==Wl&&d!==Gl||(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,r,l,h,i,n,()=>r.measureText(t)).recordDependencies(e,Uc),r.strokeText(t,i,n));if(u){(this.pendingTextPaths||=[]).push({transform:getCurrentTransform(r),x:i,y:n,fontSize:h,path:p}),this.dependencyTracker?.recordCharacterBBox(e,r,l,h,i,n)}}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let i=!1;for(let e=3;e<t.length;e+=4)if(t[e]>0&&t[e]<255){i=!0;break}return shadow(this,"isFontSubpixelAAEnabled",i)}showText(e,t){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,Xc).resetBBox(e),this.current.textRenderingMode&Yl&&this.dependencyTracker.recordFutureForcedDependency("textClip",e).inheritPendingDependenciesAsFutureForcedDependencies());const i=this.current,n=i.font;if(n.isType3Font)return this.showType3Text(e,t),void this.dependencyTracker?.recordShowTextOperation(e);const a=i.fontSize;if(0===a)return void this.dependencyTracker?.recordOperation(e);const s=this.ctx,r=i.fontSizeScale,o=i.charSpacing,l=i.wordSpacing,c=i.fontDirection,h=i.textHScale*c,d=t.length,u=n.vertical,g=u?1:-1,f=n.defaultVMetrics,p=a*i.fontMatrix[0],m=i.textRenderingMode===zl&&!n.disableFontFace&&!i.patternFill;let b,y;if(s.save(),i.textMatrix&&s.transform(...i.textMatrix),s.translate(i.x,i.y+i.textRise),c>0?s.scale(h,-1):s.scale(h,1),i.patternFill){s.save();const t=i.fillColor.getPattern(s,this,getCurrentTransformInverse(s),Wc,e);b=getCurrentTransform(s),s.restore(),s.fillStyle=t}if(i.patternStroke){s.save();const t=i.strokeColor.getPattern(s,this,getCurrentTransformInverse(s),Gc,e);y=getCurrentTransform(s),s.restore(),s.strokeStyle=t}let w=i.lineWidth;const x=i.textMatrixScale;if(0===x||0===w){const e=i.textRenderingMode&Kl;e!==Wl&&e!==Gl||(w=this.getSinglePixelWidth())}else w/=x;if(1!==r&&(s.scale(r,r),w/=r),s.lineWidth=w,n.isInvalidPDFjsFont){const n=[];let a=0;for(const e of t)n.push(e.unicode),a+=e.width;const r=n.join("");if(s.fillText(r,0,0),null!==this.dependencyTracker){const t=s.measureText(r);this.dependencyTracker.recordBBox(e,this.ctx,-t.actualBoundingBoxLeft,t.actualBoundingBoxRight,-t.actualBoundingBoxAscent,t.actualBoundingBoxDescent).recordShowTextOperation(e)}return i.x+=a*p*h,s.restore(),void this.compose()}let S,v=0;for(S=0;S<d;++S){const i=t[S];if("number"==typeof i){v+=g*i*a/1e3;continue}let h=!1;const d=(i.isSpace?l:0)+o,w=i.fontChar,x=i.accent;let C,k,T,F=i.width;if(u){const e=i.vmetric||f,t=-(i.vmetric?e[1]:.5*F)*p,n=e[2]*p;F=e?-e[0]:F,C=t/r,k=(v+n)/r}else C=v/r,k=0;if(n.remeasure&&F>0){T=s.measureText(w);const e=1e3*T.width/a*r;if(F<e&&this.isFontSubpixelAAEnabled){const t=F/e;h=!0,s.save(),s.scale(t,1),C/=t}else F!==e&&(C+=(F-e)/2e3*a/r)}if(this.contentVisible&&(i.isInFont||n.missingFile))if(m&&!x)s.fillText(w,C,k),this.dependencyTracker?.recordCharacterBBox(e,s,T?{bbox:null}:n,a/r,C,k,()=>T??s.measureText(w));else if(this.paintChar(e,w,C,k,b,y),x){const t=C+a*x.offset.x/r,i=k-a*x.offset.y/r;this.paintChar(e,x.fontChar,t,i,b,y)}v+=u?F*p-d*c:F*p+d*c,h&&s.restore()}u?i.y-=v:i.x+=v*h,s.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e)}showType3Text(e,t){const i=this.ctx,n=this.current,a=n.font,s=n.fontSize,r=n.fontDirection,o=a.vertical?1:-1,l=n.charSpacing,c=n.wordSpacing,h=n.textHScale*r,d=n.fontMatrix||Il,u=t.length;let g,f,p,m;if(n.textRenderingMode===Vl||0===s)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),n.textMatrix&&i.transform(...n.textMatrix),i.translate(n.x,n.y+n.textRise),i.scale(h,r);const b=this.dependencyTracker;for(this.dependencyTracker=b?new CanvasNestedDependencyTracker(b,e):null,g=0;g<u;++g){if(f=t[g],"number"==typeof f){m=o*f*s/1e3,this.ctx.translate(m,0),n.x+=m*h;continue}const e=(f.isSpace?c:0)+l,r=a.charProcOperatorList[f.operatorListId];r?this.contentVisible&&(this.save(),i.scale(s,s),i.transform(...d),this.executeOperatorList(r),this.restore()):warn(`Type3 character "${f.operatorListId}" is not available.`);const u=[f.width,0];Util.applyTransform(u,d),p=u[0]*s+e,i.translate(p,0),n.x+=p*h}i.restore(),b&&(this.dependencyTracker=b)}setCharWidth(e,t,i){}setCharWidthAndBounds(e,t,i,n,a,s,r){const o=new Path2D;o.rect(n,a,s-n,r-a),this.ctx.clip(o),this.dependencyTracker?.recordBBox(e,this.ctx,n,s,a,r).recordClipBox(e,this.ctx,n,s,a,r),this.endPath(e)}getColorN_Pattern(e,t){let i;if("TilingPattern"===t[0]){const e=this.baseTransform||getCurrentTransform(this.ctx),n={createCanvasGraphics:(e,t)=>new CanvasGraphics(e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new CanvasNestedDependencyTracker(this.dependencyTracker,t,!0):null)};i=new TilingPattern(t,this.ctx,n,e)}else i=this._getPattern(e,t[1],t[2]);return i}setStrokeColorN(e,...t){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.current.strokeColor=this.getColorN_Pattern(e,t),this.current.patternStroke=!0}setFillColorN(e,...t){this.dependencyTracker?.recordSimpleData("fillColor",e),this.current.fillColor=this.getColorN_Pattern(e,t),this.current.patternFill=!0}setStrokeRGBColor(e,t){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}setStrokeTransparent(e){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,t){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(e){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t,i=null){let n;return this.cachedPatterns.has(t)?n=this.cachedPatterns.get(t):(n=function(e){switch(e[0]){case"RadialAxial":return new RadialAxialShadingPattern(e);case"Mesh":return new MeshShadingPattern(e);case"Dummy":return new DummyShadingPattern}throw new Error(`Unknown IR type: ${e[0]}`)}(this.getObject(e,t)),this.cachedPatterns.set(t,n)),i&&(n.matrix=i),n}shadingFill(e,t){if(!this.contentVisible)return;const i=this.ctx;this.save(e);const n=this._getPattern(e,t);i.fillStyle=n.getPattern(i,this,getCurrentTransformInverse(i),Vc,e);const a=getCurrentTransformInverse(i);if(a){const{width:e,height:t}=i.canvas,n=eh.slice();Util.axialAlignedBoundingBox([0,0,e,t],a,n);const[s,r,o,l]=n;this.ctx.fillRect(s,r,o-s,l-r)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,qc).recordDependencies(e,jc).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){unreachable("Should not call beginInlineImage")}beginImageData(){unreachable("Should not call beginImageData")}paintFormXObjectBegin(e,t,i){if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),t&&this.transform(e,...t),this.baseTransform=getCurrentTransform(this.ctx),i)){Util.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[t,n,a,s]=i,r=new Path2D;r.rect(t,n,a-t,s-n),this.ctx.clip(r),this.dependencyTracker?.recordClipBox(e,this.ctx,t,a,n,s),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,t){if(!this.contentVisible)return;this.save(e),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const i=this.ctx;t.isolated||info("TODO: Support non-isolated groups."),t.knockout&&warn("Knockout groups not supported.");const n=getCurrentTransform(i);if(t.matrix&&i.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let a=eh.slice();Util.axialAlignedBoundingBox(t.bbox,getCurrentTransform(i),a);const s=[0,0,i.canvas.width,i.canvas.height];a=Util.intersect(a,s)||[0,0,0,0];const r=Math.floor(a[0]),o=Math.floor(a[1]),l=Math.max(Math.ceil(a[2])-r,1),c=Math.max(Math.ceil(a[3])-o,1);this.current.startNewPathAndClipBox([0,0,l,c]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);const d=this.cachedCanvases.getCanvas(h,l,c),u=d.context;u.translate(-r,-o),u.transform(...n);let g=new Path2D;const[f,p,m,b]=t.bbox;if(g.rect(f,p,m-f,b-p),t.matrix){const e=new Path2D;e.addPath(g,new DOMMatrix(t.matrix)),g=e}u.clip(g),t.smask&&this.smaskStack.push({canvas:d.canvas,context:u,offsetX:r,offsetY:o,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}),t.smask&&!this.dependencyTracker||(i.setTransform(1,0,0,1,0,0),i.translate(r,o),i.save()),copyCtxState(i,u),this.ctx=u,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(i),this.setGState(e,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(i),this.groupLevel++}endGroup(e,t){if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),t.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const t=getCurrentTransform(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...t);const n=eh.slice();Util.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],t,n),this.ctx.drawImage(i.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,t,i,n,a,s){if(this.#Ss(),resetCtxToDefault(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const a=i[2]-i[0],r=i[3]-i[1];if(s&&this.annotationCanvasMap){(n=n.slice())[4]-=i[0],n[5]-=i[1],(i=i.slice())[0]=i[1]=0,i[2]=a,i[3]=r,Util.singularValueDecompose2dScale(getCurrentTransform(this.ctx),Qc);const{viewportScale:e}=this,s=Math.ceil(a*this.outputScaleX*e),o=Math.ceil(r*this.outputScaleY*e);this.annotationCanvas=this.canvasFactory.create(s,o);const{canvas:l,context:c}=this.annotationCanvas;this.annotationCanvasMap.set(t,l),this.annotationCanvas.savedCtx=this.ctx,this.ctx=c,this.ctx.save(),this.ctx.setTransform(Qc[0],0,0,-Qc[1],0,r*Qc[1]),resetCtxToDefault(this.ctx)}else{resetCtxToDefault(this.ctx),this.endPath(e);const t=new Path2D;t.rect(i[0],i[1],a,r),this.ctx.clip(t)}}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...n),this.transform(e,...a)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),this.#vs(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e,t){if(!this.contentVisible)return;const i=t.count;(t=this.getObject(e,t.data,t)).count=i;const n=this.ctx,a=this._createMaskCanvas(e,t),s=a.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(s,a.offsetX,a.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,a.offsetX,a.offsetX+s.width,a.offsetY,a.offsetY+s.height).recordOperation(e),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,i,n=0,a=0,s,r){if(!this.contentVisible)return;t=this.getObject(e,t.data,t);const o=this.ctx;o.save();const l=getCurrentTransform(o);o.transform(i,n,a,s,0,0);const c=this._createMaskCanvas(e,t);o.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]),this.dependencyTracker?.resetBBox(e);for(let t=0,h=r.length;t<h;t+=2){const h=Util.transform(l,[i,n,a,s,r[t],r[t+1]]);o.drawImage(c.canvas,h[4],h[5]),this.dependencyTracker?.recordBBox(e,this.ctx,h[4],h[4]+c.canvas.width,h[5],h[5]+c.canvas.height)}o.restore(),this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageMaskXObjectGroup(e,t){if(!this.contentVisible)return;const i=this.ctx,n=this.current.fillColor,a=this.current.patternFill;this.dependencyTracker?.resetBBox(e).recordDependencies(e,zc);for(const s of t){const{data:t,width:r,height:o,transform:l}=s,c=this.cachedCanvases.getCanvas("maskCanvas",r,o),h=c.context;h.save();putBinaryImageMask(h,this.getObject(e,t,s)),h.globalCompositeOperation="source-in",h.fillStyle=a?n.getPattern(h,this,getCurrentTransformInverse(i),Wc,e):n,h.fillRect(0,0,r,o),h.restore(),i.save(),i.transform(...l),i.scale(1,-1),drawImageAtIntegerCoords(i,c.canvas,0,0,r,o,0,-1,1,1),this.dependencyTracker?.recordBBox(e,i,0,r,0,o),i.restore()}this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageXObject(e,t){if(!this.contentVisible)return;const i=this.getObject(e,t);i?this.paintInlineImageXObject(e,i):warn("Dependent image isn't ready yet")}paintImageXObjectRepeat(e,t,i,n,a){if(!this.contentVisible)return;const s=this.getObject(e,t);if(!s)return void warn("Dependent image isn't ready yet");const r=s.width,o=s.height,l=[];for(let e=0,t=a.length;e<t;e+=2)l.push({transform:[i,0,0,n,a[e],a[e+1]],x:0,y:0,w:r,h:o});this.paintInlineImageXObjectGroup(e,s,l)}applyTransferMapsToCanvas(e){return"none"!==this.current.transferMaps&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if("none"===this.current.transferMaps)return e.bitmap;const{bitmap:t,width:i,height:n}=e,a=this.cachedCanvases.getCanvas("inlineImage",i,n),s=a.context;return s.filter=this.current.transferMaps,s.drawImage(t,0,0),s.filter="none",a.canvas}paintInlineImageXObject(e,t){if(!this.contentVisible)return;const i=t.width,n=t.height,a=this.ctx;this.save(e);const{filter:s}=a;let r;if("none"!==s&&""!==s&&(a.filter="none"),a.scale(1/i,-1/n),t.bitmap)r=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)r=t;else{const e=this.cachedCanvases.getCanvas("inlineImage",i,n).context;putBinaryImageData(e,t),r=this.applyTransferMapsToCanvas(e)}const o=this._scaleImage(r,getCurrentTransformInverse(a));a.imageSmoothingEnabled=getImageSmoothingEnabled(getCurrentTransform(a),t.interpolate),this.dependencyTracker?.resetBBox(e).recordBBox(e,a,0,i,-n,0).recordDependencies(e,$c).recordOperation(e),drawImageAtIntegerCoords(a,o.img,0,0,o.paintWidth,o.paintHeight,0,-n,i,n),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,t,i){if(!this.contentVisible)return;const n=this.ctx;let a;if(t.bitmap)a=t.bitmap;else{const e=t.width,i=t.height,n=this.cachedCanvases.getCanvas("inlineImage",e,i).context;putBinaryImageData(n,t),a=this.applyTransferMapsToCanvas(n)}this.dependencyTracker?.resetBBox(e);for(const t of i)n.save(),n.transform(...t.transform),n.scale(1,-1),drawImageAtIntegerCoords(n,a,t.x,t.y,t.w,t.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,n,0,1,-1,0),n.restore();this.dependencyTracker?.recordOperation(e),this.compose()}paintSolidColorImageMask(e){this.contentVisible&&(this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,jc).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e,t){}markPointProps(e,t,i){}beginMarkedContent(e,t){this.dependencyTracker?.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t,i){this.dependencyTracker?.beginMarkedContent(e),"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){this.dependencyTracker?.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,t,i){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const a=this.ctx;this.pendingClip?(n||(this.pendingClip===ah?a.clip(t,"evenodd"):a.clip(t)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency("clipPath",e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=getCurrentTransform(this.ctx);if(0===e[1]&&0===e[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const t=Math.abs(e[0]*e[3]-e[2]*e[1]),i=Math.hypot(e[0],e[2]),n=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(i,n)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:e}=this.current,{a:t,b:i,c:n,d:a}=this.ctx.getTransform();let s,r;if(0===i&&0===n){const i=Math.abs(t),n=Math.abs(a);if(i===n)if(0===e)s=r=1/i;else{const t=i*e;s=r=t<1?1/t:1}else if(0===e)s=1/i,r=1/n;else{const t=i*e,a=n*e;s=t<1?1/t:1,r=a<1?1/a:1}}else{const o=Math.abs(t*a-i*n),l=Math.hypot(t,i),c=Math.hypot(n,a);if(0===e)s=c/o,r=l/o;else{const t=e*o;s=c>t?c/t:1,r=l>t?l/t:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=r}return this._cachedScaleForStroking}rescaleAndStroke(e,t){const{ctx:i,current:{lineWidth:n}}=this,[a,s]=this.getScaleForStroking();if(a===s)return i.lineWidth=(n||1)*a,void i.stroke(e);const r=i.getLineDash();t&&i.save(),i.scale(a,s),Zc.a=1/a,Zc.d=1/s;const o=new Path2D;if(o.addPath(e,Zc),r.length>0){const e=Math.max(a,s);i.setLineDash(r.map(t=>t/e)),i.lineDashOffset/=e}i.lineWidth=n||1,i.stroke(o),t&&i.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const e in sc)void 0!==CanvasGraphics.prototype[e]&&(CanvasGraphics.prototype[sc[e]]=CanvasGraphics.prototype[e]);class CssFontInfo{#R;#W;#G;static strings=["fontFamily","fontWeight","italicAngle"];static write(e){const t=new TextEncoder,i={};let n=0;for(const a of CssFontInfo.strings){const s=t.encode(e[a]);i[a]=s,n+=4+s.length}const a=new ArrayBuffer(n),s=new Uint8Array(a),r=new DataView(a);let o=0;for(const e of CssFontInfo.strings){const t=i[e],n=t.length;r.setUint32(o,n),s.set(t,o+4),o+=4+n}return assert(o===a.byteLength,"CssFontInfo.write: Buffer overflow"),a}constructor(e){this.#R=e,this.#W=new DataView(this.#R),this.#G=new TextDecoder}#V(e){assert(e<CssFontInfo.strings.length,"Invalid string index");let t=0;for(let i=0;i<e;i++)t+=this.#W.getUint32(t)+4;const i=this.#W.getUint32(t);return this.#G.decode(new Uint8Array(this.#R,t+4,i))}get fontFamily(){return this.#V(0)}get fontWeight(){return this.#V(1)}get italicAngle(){return this.#V(2)}}class SystemFontInfo{#R;#W;#G;static strings=["css","loadedName","baseFontName","src"];static write(e){const t=new TextEncoder,i={};let n=0;for(const a of SystemFontInfo.strings){const s=t.encode(e[a]);i[a]=s,n+=4+s.length}n+=4;let a,s,r=1+n;e.style&&(a=t.encode(e.style.style),s=t.encode(e.style.weight),r+=4+a.length+4+s.length);const o=new ArrayBuffer(r),l=new Uint8Array(o),c=new DataView(o);let h=0;c.setUint8(h++,e.guessFallback?1:0),c.setUint32(h,0),h+=4,n=0;for(const e of SystemFontInfo.strings){const t=i[e],a=t.length;n+=4+a,c.setUint32(h,a),l.set(t,h+4),h+=4+a}return c.setUint32(h-n-4,n),e.style&&(c.setUint32(h,a.length),l.set(a,h+4),h+=4+a.length,c.setUint32(h,s.length),l.set(s,h+4),h+=4+s.length),assert(h<=o.byteLength,"SubstitionInfo.write: Buffer overflow"),o.transferToFixedLength(h)}constructor(e){this.#R=e,this.#W=new DataView(this.#R),this.#G=new TextDecoder}get guessFallback(){return 0!==this.#W.getUint8(0)}#V(e){assert(e<SystemFontInfo.strings.length,"Invalid string index");let t=5;for(let i=0;i<e;i++)t+=this.#W.getUint32(t)+4;const i=this.#W.getUint32(t);return this.#G.decode(new Uint8Array(this.#R,t+4,i))}get css(){return this.#V(0)}get loadedName(){return this.#V(1)}get baseFontName(){return this.#V(2)}get src(){return this.#V(3)}get style(){let e=1;e+=4+this.#W.getUint32(e);const t=this.#W.getUint32(e),i=this.#G.decode(new Uint8Array(this.#R,e+4,t));e+=4+t;const n=this.#W.getUint32(e);return{style:i,weight:this.#G.decode(new Uint8Array(this.#R,e+4,n))}}}class FontInfo{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static#K=Math.ceil(2*this.bools.length/8);static#Y=this.#K+8*this.numbers.length;static#J=this.#Y+1+8;static#Z=this.#J+1+48;static#Q=this.#Z+1+6;#R;#G;#W;constructor({data:e,extra:t}){this.#R=e,this.#G=new TextDecoder,this.#W=new DataView(this.#R),t&&Object.assign(this,t)}#ee(e){assert(e<FontInfo.bools.length,"Invalid boolean index");const t=Math.floor(e/4),i=2*e%8,n=this.#W.getUint8(t)>>i&3;return 0===n?void 0:2===n}get black(){return this.#ee(0)}get bold(){return this.#ee(1)}get disableFontFace(){return this.#ee(2)}get fontExtraProperties(){return this.#ee(3)}get isInvalidPDFjsFont(){return this.#ee(4)}get isType3Font(){return this.#ee(5)}get italic(){return this.#ee(6)}get missingFile(){return this.#ee(7)}get remeasure(){return this.#ee(8)}get vertical(){return this.#ee(9)}#te(e){return assert(e<FontInfo.numbers.length,"Invalid number index"),this.#W.getFloat64(FontInfo.#K+8*e)}get ascent(){return this.#te(0)}get defaultWidth(){return this.#te(1)}get descent(){return this.#te(2)}get bbox(){let e=FontInfo.#Y;if(0===this.#W.getUint8(e))return;e+=1;const t=[];for(let i=0;i<4;i++)t.push(this.#W.getInt16(e,!0)),e+=2;return t}get fontMatrix(){let e=FontInfo.#J;if(0===this.#W.getUint8(e))return;e+=1;const t=[];for(let i=0;i<6;i++)t.push(this.#W.getFloat64(e,!0)),e+=8;return t}get defaultVMetrics(){let e=FontInfo.#Z;if(0===this.#W.getUint8(e))return;e+=1;const t=[];for(let i=0;i<3;i++)t.push(this.#W.getInt16(e,!0)),e+=2;return t}#V(e){assert(e<FontInfo.strings.length,"Invalid string index");let t=FontInfo.#Q+4;for(let i=0;i<e;i++)t+=this.#W.getUint32(t)+4;const i=this.#W.getUint32(t),n=new Uint8Array(i);return n.set(new Uint8Array(this.#R,t+4,i)),this.#G.decode(n)}get fallbackName(){return this.#V(0)}get loadedName(){return this.#V(1)}get mimetype(){return this.#V(2)}get name(){return this.#V(3)}get data(){let e=FontInfo.#Q;e+=4+this.#W.getUint32(e);e+=4+this.#W.getUint32(e);e+=4+this.#W.getUint32(e);const t=this.#W.getUint32(e);if(0!==t)return new Uint8Array(this.#R,e+4,t)}clearData(){let e=FontInfo.#Q;e+=4+this.#W.getUint32(e);e+=4+this.#W.getUint32(e);e+=4+this.#W.getUint32(e);const t=this.#W.getUint32(e);new Uint8Array(this.#R,e+4,t).fill(0),this.#W.setUint32(e,0)}get cssFontInfo(){let e=FontInfo.#Q;e+=4+this.#W.getUint32(e);e+=4+this.#W.getUint32(e);const t=this.#W.getUint32(e);if(0===t)return null;const i=new Uint8Array(t);return i.set(new Uint8Array(this.#R,e+4,t)),new CssFontInfo(i.buffer)}get systemFontInfo(){let e=FontInfo.#Q;e+=4+this.#W.getUint32(e);const t=this.#W.getUint32(e);if(0===t)return null;const i=new Uint8Array(t);return i.set(new Uint8Array(this.#R,e+4,t)),new SystemFontInfo(i.buffer)}static write(e){const t=e.systemFontInfo?SystemFontInfo.write(e.systemFontInfo):null,i=e.cssFontInfo?CssFontInfo.write(e.cssFontInfo):null,n=new TextEncoder,a={};let s=0;for(const t of FontInfo.strings)a[t]=n.encode(e[t]),s+=4+a[t].length;const r=FontInfo.#Q+4+s+4+(t?t.byteLength:0)+4+(i?i.byteLength:0)+4+(e.data?e.data.length:0),o=new ArrayBuffer(r),l=new Uint8Array(o),c=new DataView(o);let h=0;const d=FontInfo.bools.length;let u=0,g=0;for(let t=0;t<d;t++){const i=e[FontInfo.bools[t]];u|=(void 0===i?0:i?2:1)<<g,g+=2,8!==g&&t!==d-1||(c.setUint8(h++,u),u=0,g=0)}assert(h===FontInfo.#K,"FontInfo.write: Boolean properties offset mismatch");for(const t of FontInfo.numbers)c.setFloat64(h,e[t]),h+=8;if(assert(h===FontInfo.#Y,"FontInfo.write: Number properties offset mismatch"),e.bbox){c.setUint8(h++,4);for(const t of e.bbox)c.setInt16(h,t,!0),h+=2}else c.setUint8(h++,0),h+=8;if(assert(h===FontInfo.#J,"FontInfo.write: BBox properties offset mismatch"),e.fontMatrix){c.setUint8(h++,6);for(const t of e.fontMatrix)c.setFloat64(h,t,!0),h+=8}else c.setUint8(h++,0),h+=48;if(assert(h===FontInfo.#Z,"FontInfo.write: FontMatrix properties offset mismatch"),e.defaultVMetrics){c.setUint8(h++,1);for(const t of e.defaultVMetrics)c.setInt16(h,t,!0),h+=2}else c.setUint8(h++,0),h+=6;assert(h===FontInfo.#Q,"FontInfo.write: DefaultVMetrics properties offset mismatch"),c.setUint32(FontInfo.#Q,0),h+=4;for(const e of FontInfo.strings){const t=a[e],i=t.length;c.setUint32(h,i),l.set(t,h+4),h+=4+i}if(c.setUint32(FontInfo.#Q,h-FontInfo.#Q-4),t){const e=t.byteLength;c.setUint32(h,e),assert(h+4+e<=o.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),l.set(new Uint8Array(t),h+4),h+=4+e}else c.setUint32(h,0),h+=4;if(i){const e=i.byteLength;c.setUint32(h,e),assert(h+4+e<=o.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),l.set(new Uint8Array(i),h+4),h+=4+e}else c.setUint32(h,0),h+=4;return void 0===e.data?(c.setUint32(h,0),h+=4):(c.setUint32(h,e.data.length),l.set(e.data,h+4),h+=4+e.data.length),assert(h<=o.byteLength,"FontInfo.write: Buffer overflow"),o.transferToFixedLength(h)}}class GlobalWorkerOptions{static#ks=null;static#Ts="";static get workerPort(){return this.#ks}static set workerPort(e){if(!("undefined"!=typeof Worker&&e instanceof Worker)&&null!==e)throw new Error("Invalid `workerPort` type.");this.#ks=e}static get workerSrc(){return this.#Ts}static set workerSrc(e){if("string"!=typeof e)throw new Error("Invalid `workerSrc` type.");this.#Ts=e}}class Metadata{#Fs;#Is;constructor({parsedData:e,rawData:t}){this.#Fs=e,this.#Is=t}getRaw(){return this.#Is}get(e){return this.#Fs.get(e)??null}[Symbol.iterator](){return this.#Fs.entries()}}const sh=Symbol("INTERNAL");class OptionalContentGroup{#Es=!1;#Ms=!1;#Ds=!1;#Os=!0;constructor(e,{name:t,intent:i,usage:n,rbGroups:a}){this.#Es=!!(e&Dl),this.#Ms=!!(e&_l),this.name=t,this.intent=i,this.usage=n,this.rbGroups=a}get visible(){if(this.#Ds)return this.#Os;if(!this.#Os)return!1;const{print:e,view:t}=this.usage;return this.#Es?"OFF"!==t?.viewState:!this.#Ms||"OFF"!==e?.printState}_setVisible(e,t,i=!1){e!==sh&&unreachable("Internal method `_setVisible` called."),this.#Ds=i,this.#Os=t}}class OptionalContentConfig{#_s=null;#Ps=new Map;#Rs=null;#Bs=null;constructor(e,t=Dl){if(this.renderingIntent=t,this.name=null,this.creator=null,null!==e){this.name=e.name,this.creator=e.creator,this.#Bs=e.order;for(const i of e.groups)this.#Ps.set(i.id,new OptionalContentGroup(t,i));if("OFF"===e.baseState)for(const e of this.#Ps.values())e._setVisible(sh,!1);for(const t of e.on)this.#Ps.get(t)._setVisible(sh,!0);for(const t of e.off)this.#Ps.get(t)._setVisible(sh,!1);this.#Rs=this.getHash()}}#Ns(e){const t=e.length;if(t<2)return!0;const i=e[0];for(let n=1;n<t;n++){const t=e[n];let a;if(Array.isArray(t))a=this.#Ns(t);else{if(!this.#Ps.has(t))return warn(`Optional content group not found: ${t}`),!0;a=this.#Ps.get(t).visible}switch(i){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return"And"===i}isVisible(e){if(0===this.#Ps.size)return!0;if(!e)return info("Optional content group not defined."),!0;if("OCG"===e.type)return this.#Ps.has(e.id)?this.#Ps.get(e.id).visible:(warn(`Optional content group not found: ${e.id}`),!0);if("OCMD"===e.type){if(e.expression)return this.#Ns(e.expression);if(!e.policy||"AnyOn"===e.policy){for(const t of e.ids){if(!this.#Ps.has(t))return warn(`Optional content group not found: ${t}`),!0;if(this.#Ps.get(t).visible)return!0}return!1}if("AllOn"===e.policy){for(const t of e.ids){if(!this.#Ps.has(t))return warn(`Optional content group not found: ${t}`),!0;if(!this.#Ps.get(t).visible)return!1}return!0}if("AnyOff"===e.policy){for(const t of e.ids){if(!this.#Ps.has(t))return warn(`Optional content group not found: ${t}`),!0;if(!this.#Ps.get(t).visible)return!0}return!1}if("AllOff"===e.policy){for(const t of e.ids){if(!this.#Ps.has(t))return warn(`Optional content group not found: ${t}`),!0;if(this.#Ps.get(t).visible)return!1}return!0}return warn(`Unknown optional content policy ${e.policy}.`),!0}return warn(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,i=!0){const n=this.#Ps.get(e);if(n){if(i&&t&&n.rbGroups.length)for(const t of n.rbGroups)for(const i of t)i!==e&&this.#Ps.get(i)?._setVisible(sh,!1,!0);n._setVisible(sh,!!t,!0),this.#_s=null}else warn(`Optional content group not found: ${e}`)}setOCGState({state:e,preserveRB:t}){let i;for(const n of e){switch(n){case"ON":case"OFF":case"Toggle":i=n;continue}const e=this.#Ps.get(n);if(e)switch(i){case"ON":this.setVisibility(n,!0,t);break;case"OFF":this.setVisibility(n,!1,t);break;case"Toggle":this.setVisibility(n,!e.visible,t)}}this.#_s=null}get hasInitialVisibility(){return null===this.#Rs||this.getHash()===this.#Rs}getOrder(){return this.#Ps.size?this.#Bs?this.#Bs.slice():[...this.#Ps.keys()]:null}getGroup(e){return this.#Ps.get(e)||null}getHash(){if(null!==this.#_s)return this.#_s;const e=new MurmurHash3_64;for(const[t,i]of this.#Ps)e.update(`${t}:${i.visible}`);return this.#_s=e.hexdigest()}[Symbol.iterator](){return this.#Ps.entries()}}class PDFDataTransportStream{constructor(e,{disableRange:t=!1,disableStream:i=!1}){assert(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:n,initialData:a,progressiveDone:s,contentDispositionFilename:r}=e;if(this._queuedChunks=[],this._progressiveDone=s,this._contentDispositionFilename=r,a?.length>0){const e=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!i,this._isRangeSupported=!t,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((e,t)=>{this._onReceiveData({begin:e,chunk:t})}),e.addProgressListener((e,t)=>{this._onProgress({loaded:e,total:t})}),e.addProgressiveReadListener(e=>{this._onReceiveData({chunk:e})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){const i=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{assert(this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(i),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){void 0===e.total?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){assert(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new PDFDataTransportStreamReader(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const i=new PDFDataTransportStreamRangeReader(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}}class PDFDataTransportStreamReader{constructor(e,t,i=!1,n=null){this._stream=e,this._done=i||!1,this._filename=isPdfFile(n)?n:null,this._queuedChunks=t||[],this._loaded=0;for(const e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunks.push(e);this._loaded+=e.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class PDFDataTransportStreamRangeReader{constructor(e,t,i){this._stream=e,this._begin=t,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function createHeaders(e,t){const i=new Headers;if(!e||!t||"object"!=typeof t)return i;for(const e in t){const n=t[e];void 0!==n&&i.append(e,n)}return i}function getResponseOrigin(e){return URL.parse(e)?.origin??null}function validateRangeRequestCapabilities({responseHeaders:e,isHttp:t,rangeChunkSize:i,disableRange:n}){const a={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(e.get("Content-Length"),10);if(!Number.isInteger(s))return a;if(a.suggestedLength=s,s<=2*i)return a;if(n||!t)return a;if("bytes"!==e.get("Accept-Ranges"))return a;return"identity"!==(e.get("Content-Encoding")||"identity")||(a.allowRangeRequests=!0),a}function extractFilenameFromHeader(e){const t=e.get("Content-Disposition");if(t){let e=function(e){let t=!0,i=toParamRegExp("filename\\*","i").exec(e);if(i){i=i[1];let e=rfc2616unquote(i);return e=unescape(e),e=rfc5987decode(e),e=rfc2047decode(e),fixupEncoding(e)}if(i=function(e){const t=[];let i;const n=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=n.exec(e));){let[,e,n,a]=i;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[n,a]}const a=[];for(let e=0;e<t.length&&e in t;++e){let[i,n]=t[e];n=rfc2616unquote(n),i&&(n=unescape(n),0===e&&(n=rfc5987decode(n))),a.push(n)}return a.join("")}(e),i)return fixupEncoding(rfc2047decode(i));if(i=toParamRegExp("filename","i").exec(e),i){i=i[1];let e=rfc2616unquote(i);return e=rfc2047decode(e),fixupEncoding(e)}function toParamRegExp(e,t){return new RegExp("(?:^|;)\\s*"+e+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',t)}function textdecode(e,i){if(e){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const n=new TextDecoder(e,{fatal:!0}),a=stringToBytes(i);i=n.decode(a),t=!1}catch{}}return i}function fixupEncoding(e){return t&&/[\x80-\xff]/.test(e)&&(e=textdecode("utf-8",e),t&&(e=textdecode("iso-8859-1",e))),e}function rfc2616unquote(e){if(e.startsWith('"')){const t=e.slice(1).split('\\"');for(let e=0;e<t.length;++e){const i=t[e].indexOf('"');-1!==i&&(t[e]=t[e].slice(0,i),t.length=e+1),t[e]=t[e].replaceAll(/\\(.)/g,"$1")}e=t.join('"')}return e}function rfc5987decode(e){const t=e.indexOf("'");return-1===t?e:textdecode(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,""))}function rfc2047decode(e){return!e.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(e,t,i,n){if("q"===i||"Q"===i)return textdecode(t,n=(n=n.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))}));try{n=atob(n)}catch{}return textdecode(t,n)})}return""}(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if(isPdfFile(e))return e}return null}function createResponseError(e,t){return new ResponseException(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e,404===e||0===e&&t.startsWith("file:"))}function validateResponseStatus(e){return 200===e||206===e}function createFetchOptions(e,t,i){return{method:"GET",headers:e,signal:i.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function getArrayBuffer(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(warn(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}class PDFFetchStream{_responseOrigin=null;constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=createHeaders(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return assert(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new PDFFetchStreamReader(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const i=new PDFFetchStreamRangeReader(this,e,t);return this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class PDFFetchStreamReader{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange;const i=new Headers(e.headers),n=t.url;fetch(n,createFetchOptions(i,this._withCredentials,this._abortController)).then(t=>{if(e._responseOrigin=getResponseOrigin(t.url),!validateResponseStatus(t.status))throw createResponseError(t.status,n);this._reader=t.body.getReader(),this._headersCapability.resolve();const i=t.headers,{allowRangeRequests:a,suggestedLength:s}=validateRangeRequestCapabilities({responseHeaders:i,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=s||this._contentLength,this._filename=extractFilenameFromHeader(i),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:getArrayBuffer(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class PDFFetchStreamRangeReader{constructor(e,t,i){this._stream=e,this._reader=null,this._loaded=0;const n=e.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController;const a=new Headers(e.headers);a.append("Range",`bytes=${t}-${i-1}`);const s=n.url;fetch(s,createFetchOptions(a,this._withCredentials,this._abortController)).then(t=>{const i=getResponseOrigin(t.url);if(i!==e._responseOrigin)throw new Error(`Expected range response-origin "${i}" to match "${e._responseOrigin}".`);if(!validateResponseStatus(t.status))throw createResponseError(t.status,s);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:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:getArrayBuffer(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class NetworkManager{_responseOrigin=null;constructor({url:e,httpHeaders:t,withCredentials:i}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=createHeaders(this.isHttp,t),this.withCredentials=i||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){const t=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const[e,i]of this.headers)t.setRequestHeader(e,i);return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),n.expectedStatus=206):n.expectedStatus=200,t.responseType="arraybuffer",assert(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>{e.onError(t.status)},t.onreadystatechange=this.onStateChange.bind(this,i),t.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=e.onHeadersReceived,n.onDone=e.onDone,n.onError=e.onError,n.onProgress=e.onProgress,t.send(null),i}onProgress(e,t){const i=this.pendingRequests[e];i&&i.onProgress?.(t)}onStateChange(e,t){const i=this.pendingRequests[e];if(!i)return;const n=i.xhr;if(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==n.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===n.status&&this.isHttp)return void i.onError(n.status);const a=n.status||200;if(!(200===a&&206===i.expectedStatus)&&a!==i.expectedStatus)return void i.onError(n.status);const s=function(e){const t=e.response;return"string"!=typeof t?t:stringToBytes(t).buffer}(n);if(206===a){const e=n.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);t?i.onDone({begin:parseInt(t[1],10),chunk:s}):(warn('Missing or invalid "Content-Range" header.'),i.onError(0))}else s?i.onDone({begin:0,chunk:s}):i.onError(n.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}class PDFNetworkStream{constructor(e){this._source=e,this._manager=new NetworkManager(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return assert(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new PDFNetworkStreamFullRequestReader(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const i=new PDFNetworkStreamRangeRequestReader(this._manager,e,t);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class PDFNetworkStreamFullRequestReader{constructor(e,t){this._manager=e,this._url=t.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e);this._manager._responseOrigin=getResponseOrigin(t.responseURL);const i=t.getAllResponseHeaders(),n=new Headers(i?i.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(e=>{const[t,...i]=e.split(": ");return[t,i.join(": ")]}):[]),{allowRangeRequests:a,suggestedLength:s}=validateRangeRequestCapabilities({responseHeaders:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=extractFilenameFromHeader(n),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e)if(this._requests.length>0){this._requests.shift().resolve({value:e.chunk,done:!1})}else this._cachedChunks.push(e.chunk);if(this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=createResponseError(e,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class PDFNetworkStreamRangeRequestReader{constructor(e,t,i){this._manager=e,this._url=e.url,this._requestId=e.request({begin:t,end:i,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){const e=getResponseOrigin(this._manager.getRequestXhr(this._requestId)?.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(e){const t=e.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunk=t;this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??=createResponseError(e,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const rh=/^[a-z][a-z0-9\-+.]+:/i;class PDFNodeStream{constructor(e){this.source=e,this.url=function(e){if(rh.test(e))return new URL(e);const t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(e))}(e.url),assert("file:"===this.url.protocol,"PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return assert(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new PDFNodeStreamFsFullReader(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const i=new PDFNodeStreamFsRangeReader(this,e,t);return this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class PDFNodeStreamFsFullReader{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const i=process.getBuiltinModule("fs");i.promises.lstat(this._url).then(e=>{this._contentLength=e.size,this._setReadableStream(i.createReadStream(this._url)),this._headersCapability.resolve()},e=>{"ENOENT"===e.code&&(e=createResponseError(0,this._url.href)),this._storedError=e,this._headersCapability.reject(e)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(e).buffer,done:!1}}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class PDFNodeStreamFsRangeReader{constructor(e,t,i){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const n=e.source;this._isStreamingSupported=!n.disableStream;const a=process.getBuiltinModule("fs");this._setReadableStream(a.createReadStream(this._url,{start:t,end:i-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,this.onProgress?.({loaded:this._loaded});return{value:new Uint8Array(e).buffer,done:!1}}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const oh=Symbol("INITIAL_DATA");class PDFObjects{#Ls=Object.create(null);#Us(e){return this.#Ls[e]||={...Promise.withResolvers(),data:oh}}get(e,t=null){if(t){const i=this.#Us(e);return i.promise.then(()=>t(i.data)),null}const i=this.#Ls[e];if(!i||i.data===oh)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return i.data}has(e){const t=this.#Ls[e];return!!t&&t.data!==oh}delete(e){const t=this.#Ls[e];return!(!t||t.data===oh)&&(delete this.#Ls[e],!0)}resolve(e,t=null){const i=this.#Us(e);i.data=t,i.resolve()}clear(){for(const e in this.#Ls){const{data:t}=this.#Ls[e];t?.bitmap?.close()}this.#Ls=Object.create(null)}*[Symbol.iterator](){for(const e in this.#Ls){const{data:t}=this.#Ls[e];t!==oh&&(yield[e,t])}}}class TextLayer{#js=Promise.withResolvers();#Mi=null;#$s=!1;#Hs=!!globalThis.FontInspector?.enabled;#Xs=null;#qs=null;#zs=0;#Ws=0;#Gs=null;#Vs=null;#Ks=0;#Ys=0;#Js=Object.create(null);#Zs=[];#Qs=null;#er=[];#tr=new WeakMap;#ir=null;static#nr=new Map;static#ar=new Map;static#sr=new WeakMap;static#rr=null;static#or=new Set;constructor({textContentSource:e,container:t,viewport:i}){if(e instanceof ReadableStream)this.#Qs=e;else{if("object"!=typeof e)throw new Error('No "textContentSource" parameter specified.');this.#Qs=new ReadableStream({start(t){t.enqueue(e),t.close()}})}this.#Mi=this.#Vs=t,this.#Ys=i.scale*OutputScale.pixelRatio,this.#Ks=i.rotation,this.#qs={div:null,properties:null,ctx:null};const{pageWidth:n,pageHeight:a,pageX:s,pageY:r}=i.rawDims;this.#ir=[1,0,0,-1,-s,r+a],this.#Ws=n,this.#zs=a,TextLayer.#lr(),setLayerDimensions(t,i),this.#js.promise.finally(()=>{TextLayer.#or.delete(this),this.#qs=null,this.#Js=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:t}=util_FeatureTest.platform;return shadow(this,"fontFamilyMap",new Map([["sans-serif",(e&&t?"Calibri, ":"")+"sans-serif"],["monospace",(e&&t?"Lucida Console, ":"")+"monospace"]]))}render(){const pump=()=>{this.#Gs.read().then(({value:e,done:t})=>{t?this.#js.resolve():(this.#Xs??=e.lang,Object.assign(this.#Js,e.styles),this.#cr(e.items),pump())},this.#js.reject)};return this.#Gs=this.#Qs.getReader(),TextLayer.#or.add(this),pump(),this.#js.promise}update({viewport:e,onBefore:t=null}){const i=e.scale*OutputScale.pixelRatio,n=e.rotation;if(n!==this.#Ks&&(t?.(),this.#Ks=n,setLayerDimensions(this.#Vs,{rotation:n})),i!==this.#Ys){t?.(),this.#Ys=i;const e={div:null,properties:null,ctx:TextLayer.#hr(this.#Xs)};for(const t of this.#er)e.properties=this.#tr.get(t),e.div=t,this.#dr(e)}}cancel(){const e=new AbortException("TextLayer task cancelled.");this.#Gs?.cancel(e).catch(()=>{}),this.#Gs=null,this.#js.reject(e)}get textDivs(){return this.#er}get textContentItemsStr(){return this.#Zs}#cr(e){if(this.#$s)return;this.#qs.ctx??=TextLayer.#hr(this.#Xs);const t=this.#er,i=this.#Zs;for(const n of e){if(t.length>1e5)return warn("Ignoring additional textDivs for performance reasons."),void(this.#$s=!0);if(void 0!==n.str)i.push(n.str),this.#ur(n);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const e=this.#Mi;this.#Mi=document.createElement("span"),this.#Mi.classList.add("markedContent"),n.id&&this.#Mi.setAttribute("id",`${n.id}`),e.append(this.#Mi)}else"endMarkedContent"===n.type&&(this.#Mi=this.#Mi.parentNode)}}#ur(e){const t=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};this.#er.push(t);const n=Util.transform(this.#ir,e.transform);let a=Math.atan2(n[1],n[0]);const s=this.#Js[e.fontName];s.vertical&&(a+=Math.PI/2);let r=this.#Hs&&s.fontSubstitution||s.fontFamily;r=TextLayer.fontFamilyMap.get(r)||r;const o=Math.hypot(n[2],n[3]),l=o*TextLayer.#gr(r,s,this.#Xs);let c,h;0===a?(c=n[4],h=n[5]-l):(c=n[4]+l*Math.sin(a),h=n[5]-l*Math.cos(a));const d="calc(var(--total-scale-factor) *",u=t.style;this.#Mi===this.#Vs?(u.left=`${(100*c/this.#Ws).toFixed(2)}%`,u.top=`${(100*h/this.#zs).toFixed(2)}%`):(u.left=`${d}${c.toFixed(2)}px)`,u.top=`${d}${h.toFixed(2)}px)`),u.fontSize=`${d}${(TextLayer.#rr*o).toFixed(2)}px)`,u.fontFamily=r,i.fontSize=o,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,this.#Hs&&(t.dataset.fontName=s.fontSubstitutionLoadedName||e.fontName),0!==a&&(i.angle=a*(180/Math.PI));let g=!1;if(e.str.length>1)g=!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&&(g=!0)}if(g&&(i.canvasWidth=s.vertical?e.height:e.width),this.#tr.set(t,i),this.#qs.div=t,this.#qs.properties=i,this.#dr(this.#qs),i.hasText&&this.#Mi.append(t),i.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this.#Mi.append(e)}}#dr(e){const{div:t,properties:i,ctx:n}=e,{style:a}=t;let s="";if(TextLayer.#rr>1&&(s=`scale(${1/TextLayer.#rr})`),0!==i.canvasWidth&&i.hasText){const{fontFamily:e}=a,{canvasWidth:r,fontSize:o}=i;TextLayer.#fr(n,o*this.#Ys,e);const{width:l}=n.measureText(t.textContent);l>0&&(s=`scaleX(${r*this.#Ys/l}) ${s}`)}0!==i.angle&&(s=`rotate(${i.angle}deg) ${s}`),s.length>0&&(a.transform=s)}static cleanup(){if(!(this.#or.size>0)){this.#nr.clear();for(const{canvas:e}of this.#ar.values())e.remove();this.#ar.clear()}}static#hr(e=null){let t=this.#ar.get(e||="");if(!t){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=e,document.body.append(i),t=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#ar.set(e,t),this.#sr.set(t,{size:0,family:""})}return t}static#fr(e,t,i){const n=this.#sr.get(e);t===n.size&&i===n.family||(e.font=`${t}px ${i}`,n.size=t,n.family=i)}static#lr(){if(null!==this.#rr)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),this.#rr=e.getBoundingClientRect().height,e.remove()}static#gr(e,t,i){const n=this.#nr.get(e);if(n)return n;const a=this.#hr(i);a.canvas.width=a.canvas.height=30,this.#fr(a,30,e);const s=a.measureText(""),r=s.fontBoundingBoxAscent,o=Math.abs(s.fontBoundingBoxDescent);a.canvas.width=a.canvas.height=0;let l=.8;return r?l=r/(r+o):(util_FeatureTest.platform.isFirefox&&warn("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),t.ascent?l=t.ascent:t.descent&&(l=1+t.descent)),this.#nr.set(e,l),l}}function getDocument(e={}){"string"==typeof e||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t=new PDFDocumentLoadingTask,{docId:i}=t,n=e.url?function(e){if(e instanceof URL)return e.href;if("string"==typeof e){if(Fl)return e;const t=URL.parse(e,window.location);if(t)return t.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(e.url):null,a=e.data?function(e){if(Fl&&"undefined"!=typeof Buffer&&e instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if("string"==typeof e)return stringToBytes(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||"object"==typeof e&&!isNaN(e?.length))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(e.data):null,s=e.httpHeaders||null,r=!0===e.withCredentials,o=e.password??null,l=e.range instanceof PDFDataRangeTransport?e.range:null,c=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:65536;let h=e.worker instanceof PDFWorker?e.worker:null;const d=e.verbosity,u="string"!=typeof e.docBaseUrl||isDataScheme(e.docBaseUrl)?null:e.docBaseUrl,g=getFactoryUrlProp(e.cMapUrl),f=!1!==e.cMapPacked,p=e.CMapReaderFactory||(Fl?NodeCMapReaderFactory:DOMCMapReaderFactory),m=getFactoryUrlProp(e.iccUrl),b=getFactoryUrlProp(e.standardFontDataUrl),y=e.StandardFontDataFactory||(Fl?NodeStandardFontDataFactory:DOMStandardFontDataFactory),w=getFactoryUrlProp(e.wasmUrl),x=e.WasmFactory||(Fl?NodeWasmFactory:DOMWasmFactory),S=!0!==e.stopAtErrors,v=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,C=!1!==e.isEvalSupported,k="boolean"==typeof e.isOffscreenCanvasSupported?e.isOffscreenCanvasSupported:!Fl,T="boolean"==typeof e.isImageDecoderSupported?e.isImageDecoderSupported:!Fl&&(util_FeatureTest.platform.isFirefox||!globalThis.chrome),F=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,E="boolean"==typeof e.disableFontFace?e.disableFontFace:Fl,M=!0===e.fontExtraProperties,D=!0===e.enableXfa,O=e.ownerDocument||globalThis.document,_=!0===e.disableRange,R=!0===e.disableStream,N=!0===e.disableAutoFetch,L=!0===e.pdfBug,U=e.CanvasFactory||(Fl?NodeCanvasFactory:DOMCanvasFactory),j=e.FilterFactory||(Fl?NodeFilterFactory:DOMFilterFactory),$=!0===e.enableHWA,H=!1!==e.useWasm,X=l?l.length:e.length??NaN,q="boolean"==typeof e.useSystemFonts?e.useSystemFonts:!Fl&&!E,z="boolean"==typeof e.useWorkerFetch?e.useWorkerFetch:!!(p===DOMCMapReaderFactory&&y===DOMStandardFontDataFactory&&x===DOMWasmFactory&&g&&b&&w&&isValidFetchUrl(g,document.baseURI)&&isValidFetchUrl(b,document.baseURI)&&isValidFetchUrl(w,document.baseURI));setVerbosityLevel(d);const W={canvasFactory:new U({ownerDocument:O,enableHWA:$}),filterFactory:new j({docId:i,ownerDocument:O}),cMapReaderFactory:z?null:new p({baseUrl:g,isCompressed:f}),standardFontDataFactory:z?null:new y({baseUrl:b}),wasmFactory:z?null:new x({baseUrl:w})};h||(h=PDFWorker.create({verbosity:d,port:GlobalWorkerOptions.workerPort}),t._worker=h);const G={docId:i,apiVersion:"5.4.296",data:a,password:o,disableAutoFetch:N,rangeChunkSize:c,length:X,docBaseUrl:u,enableXfa:D,evaluatorOptions:{maxImageSize:v,disableFontFace:E,ignoreErrors:S,isEvalSupported:C,isOffscreenCanvasSupported:k,isImageDecoderSupported:T,canvasMaxAreaInBytes:F,fontExtraProperties:M,useSystemFonts:q,useWasm:H,useWorkerFetch:z,cMapUrl:g,iccUrl:m,standardFontDataUrl:b,wasmUrl:w}},V={ownerDocument:O,pdfBug:L,styleElement:null,loadingParams:{disableAutoFetch:N,enableXfa:D}};return h.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const e=h.messageHandler.sendWithPromise("GetDocRequest",G,a?[a.buffer]:null);let o;if(l)o=new PDFDataTransportStream(l,{disableRange:_,disableStream:R});else if(!a){if(!n)throw new Error("getDocument - no `url` parameter provided.");const e=isValidFetchUrl(n)?PDFFetchStream:Fl?PDFNodeStream:PDFNetworkStream;o=new e({url:n,length:X,httpHeaders:s,withCredentials:r,rangeChunkSize:c,disableRange:_,disableStream:R})}return e.then(e=>{if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const n=new MessageHandler(i,e,h.port),a=new WorkerTransport(n,t,o,V,W,$);t._transport=a,n.send("Ready",null)})}).catch(t._capability.reject),t}class PDFDocumentLoadingTask{static#La=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId="d"+PDFDocumentLoadingTask.#La++;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await(this._transport?.destroy())}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}}class PDFDataRangeTransport{#js=Promise.withResolvers();#pr=[];#mr=[];#br=[];#yr=[];constructor(e,t,i=!1,n=null){this.length=e,this.initialData=t,this.progressiveDone=i,this.contentDispositionFilename=n}addRangeListener(e){this.#yr.push(e)}addProgressListener(e){this.#br.push(e)}addProgressiveReadListener(e){this.#mr.push(e)}addProgressiveDoneListener(e){this.#pr.push(e)}onDataRange(e,t){for(const i of this.#yr)i(e,t)}onDataProgress(e,t){this.#js.promise.then(()=>{for(const i of this.#br)i(e,t)})}onDataProgressiveRead(e){this.#js.promise.then(()=>{for(const t of this.#mr)t(e)})}onDataProgressiveDone(){this.#js.promise.then(()=>{for(const e of this.#pr)e()})}transportReady(){this.#js.resolve()}requestDataRange(e,t){unreachable("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class PDFDocumentProxy{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return shadow(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAnnotationsByType(e,t){return this._transport.getAnnotationsByType(e,t)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class PDFPageProxy{#wr=!1;constructor(e,t,i,n=!1){this._pageIndex=e,this._pageInfo=t,this._transport=i,this._stats=n?new StatTimer:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new PDFObjects,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:a=!1}={}){return new PageViewport({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:i,offsetY:n,dontFlip:a})}getAnnotations({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return shadow(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,canvas:t=e.canvas,viewport:i,intent:n="display",annotationMode:a=jl.ENABLE,transform:s=null,background:r=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:h=null,isEditing:d=!1,recordOperations:u=!1,operationsFilter:g=null}){this._stats?.time("Overall");const f=this._transport.getRenderingIntent(n,a,h,d),{renderingIntent:p,cacheKey:m}=f;this.#wr=!1,o||=this._transport.getOptionalContentConfig(p);let b=this._intentStates.get(m);b||(b=Object.create(null),this._intentStates.set(m,b)),b.streamReaderCancelTimeout&&(clearTimeout(b.streamReaderCancelTimeout),b.streamReaderCancelTimeout=null);const y=!!(p&_l);b.displayReadyCapability||(b.displayReadyCapability=Promise.withResolvers(),b.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(f));const w=Boolean(this._pdfBug&&globalThis.StepperManager?.enabled),x=!this.recordedBBoxes&&(u||w),complete=e=>{if(b.renderTasks.delete(S),x){const e=S.gfx?.dependencyTracker.take();e&&(S.stepper&&S.stepper.setOperatorBBoxes(e,S.gfx.dependencyTracker.takeDebugMetadata()),u&&(this.recordedBBoxes=e))}y&&(this.#wr=!0),this.#Ar(),e?(S.capability.reject(e),this._abortOperatorList({intentState:b,reason:e instanceof Error?e:new Error(e)})):S.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},S=new InternalRenderTask({callback:complete,params:{canvas:t,canvasContext:e,dependencyTracker:x?new CanvasDependencyTracker(t,b.operatorList.length,w):null,viewport:i,transform:s,background:r},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:b.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!y,pdfBug:this._pdfBug,pageColors:c,enableHWA:this._transport.enableHWA,operationsFilter:g});(b.renderTasks||=new Set).add(S);const v=S.task;return Promise.all([b.displayReadyCapability.promise,o]).then(([e,t])=>{if(this.destroyed)complete();else{if(this._stats?.time("Rendering"),!(t.renderingIntent&p))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");S.initializeGraphics({transparency:e,optionalContentConfig:t}),S.operatorListChanged()}}).catch(complete),v}getOperatorList({intent:e="display",annotationMode:t=jl.ENABLE,printAnnotationStorage:i=null,isEditing:n=!1}={}){const a=this._transport.getRenderingIntent(e,t,i,n,!0);let s,r=this._intentStates.get(a.cacheKey);return r||(r=Object.create(null),this._intentStates.set(a.cacheKey,r)),r.opListReadCapability||(s=Object.create(null),s.operatorListChanged=function(){r.operatorList.lastChunk&&(r.opListReadCapability.resolve(r.operatorList),r.renderTasks.delete(s))},r.opListReadCapability=Promise.withResolvers(),(r.renderTasks||=new Set).add(s),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(a)),r.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===e,disableNormalization:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(e=>XfaText.textContent(e));const t=this.streamTextContent(e);return new Promise(function(e,i){const n=t.getReader(),a={items:[],styles:Object.create(null),lang:null};!function pump(){n.read().then(function({value:t,done:i}){i?e(a):(a.lang??=t.lang,Object.assign(a.styles,t.styles),a.items.push(...t.items),pump())},i)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const i of t.renderTasks)e.push(i.completed),i.cancel();return this.objs.clear(),this.#wr=!1,Promise.all(e)}cleanup(e=!1){this.#wr=!0;const t=this.#Ar();return e&&t&&(this._stats&&=new StatTimer),t}#Ar(){if(!this.#wr||this.destroyed)return!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#wr=!1,!0}_startRenderPage(e,t){const i=this._intentStates.get(t);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let i=0,n=e.length;i<n;i++)t.operatorList.fnArray.push(e.fnArray[i]),t.operatorList.argsArray.push(e.argsArray[i]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(const e of t.renderTasks)e.operatorListChanged();e.lastChunk&&this.#Ar()}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:i,modifiedIds:n}){const{map:a,transfer:s}=i,r=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:a,modifiedIds:n},s).getReader(),o=this._intentStates.get(t);o.streamReader=r;const pump=()=>{r.read().then(({value:e,done:t})=>{t?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,o),pump())},e=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const e of o.renderTasks)e.operatorListChanged();this.#Ar()}if(o.displayReadyCapability)o.displayReadyCapability.reject(e);else{if(!o.opListReadCapability)throw e;o.opListReadCapability.reject(e)}}})};pump()}_abortOperatorList({intentState:e,reason:t,force:i=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!i){if(e.renderTasks.size>0)return;if(t instanceof RenderingCancelledException){let i=100;return t.extraDelay>0&&t.extraDelay<1e3&&(i+=t.extraDelay),void(e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},i))}}if(e.streamReader.cancel(new AbortException(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[t,i]of this._intentStates)if(i===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}class PDFWorker{#js=Promise.withResolvers();#xr=null;#ks=null;#Sr=null;static#vr=0;static#Cr=!0;static#kr=new WeakMap;static{Fl&&(this.#Cr=!0,GlobalWorkerOptions.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(e,t)=>{const i=URL.parse(e);if(!i?.origin||"null"===i.origin)return!1;const n=new URL(t,i);return i.origin===n.origin},this._createCDNWrapper=e=>{const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))},this.fromPort=e=>{var t;if(t="`PDFWorker.fromPort` - please use `PDFWorker.create` instead.",console.log("Deprecated API usage: "+t),!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.create(e)}}constructor({name:e=null,port:t=null,verbosity:i=getVerbosityLevel()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=i,t){if(PDFWorker.#kr.has(t))throw new Error("Cannot use more than one PDFWorker per port.");PDFWorker.#kr.set(t,this),this.#Tr(t)}else this.#Fr()}get promise(){return this.#js.promise}#Ir(){this.#js.resolve(),this.#xr.send("configure",{verbosity:this.verbosity})}get port(){return this.#ks}get messageHandler(){return this.#xr}#Tr(e){this.#ks=e,this.#xr=new MessageHandler("main","worker",e),this.#xr.on("ready",()=>{}),this.#Ir()}#Fr(){if(PDFWorker.#Cr||PDFWorker.#Er)return void this.#Mr();let{workerSrc:e}=PDFWorker;try{PDFWorker._isSameOrigin(window.location,e)||(e=PDFWorker._createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e,{type:"module"}),i=new MessageHandler("main","worker",t),terminateEarly=()=>{n.abort(),i.destroy(),t.terminate(),this.destroyed?this.#js.reject(new Error("Worker was destroyed")):this.#Mr()},n=new AbortController;t.addEventListener("error",()=>{this.#Sr||terminateEarly()},{signal:n.signal}),i.on("test",e=>{n.abort(),!this.destroyed&&e?(this.#xr=i,this.#ks=t,this.#Sr=t,this.#Ir()):terminateEarly()}),i.on("ready",e=>{if(n.abort(),this.destroyed)terminateEarly();else try{sendTest()}catch{this.#Mr()}});const sendTest=()=>{const e=new Uint8Array;i.send("test",e,[e.buffer])};return void sendTest()}catch{info("The worker has been disabled.")}this.#Mr()}#Mr(){PDFWorker.#Cr||(warn("Setting up fake worker."),PDFWorker.#Cr=!0),PDFWorker._setupFakeWorkerGlobal.then(e=>{if(this.destroyed)return void this.#js.reject(new Error("Worker was destroyed"));const t=new LoopbackPort;this.#ks=t;const i="fake"+PDFWorker.#vr++,n=new MessageHandler(i+"_worker",i,t);e.setup(n,t),this.#xr=new MessageHandler(i,i+"_worker",t),this.#Ir()}).catch(e=>{this.#js.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this.#Sr?.terminate(),this.#Sr=null,PDFWorker.#kr.delete(this.#ks),this.#ks=null,this.#xr?.destroy(),this.#xr=null}static create(e){const t=this.#kr.get(e?.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new PDFWorker(e)}static get workerSrc(){if(GlobalWorkerOptions.workerSrc)return GlobalWorkerOptions.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#Er(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return shadow(this,"_setupFakeWorkerGlobal",(async()=>{if(this.#Er)return this.#Er;return(await import(this.workerSrc)).WorkerMessageHandler})())}}class WorkerTransport{#Dr=new Map;#Or=new Map;#Ze=new Map;#_r=new Map;#Pr=null;constructor(e,t,i,n,a,s){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new FontLoader({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=a.canvasFactory,this.filterFactory=a.filterFactory,this.cMapReaderFactory=a.cMapReaderFactory,this.standardFontDataFactory=a.standardFontDataFactory,this.wasmFactory=a.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=s,this.setupMessageHandler()}#Rr(e,t=null){const i=this.#Dr.get(e);if(i)return i;const n=this.messageHandler.sendWithPromise(e,t);return this.#Dr.set(e,n),n}get annotationStorage(){return shadow(this,"annotationStorage",new AnnotationStorage)}getRenderingIntent(e,t=jl.ENABLE,i=null,n=!1,a=!1){let s=Dl,r=vc;switch(e){case"any":s=Ml;break;case"display":break;case"print":s=_l;break;default:warn(`getRenderingIntent - invalid intent: ${e}`)}const o=s&_l&&i instanceof PrintAnnotationStorage?i:this.annotationStorage;switch(t){case jl.DISABLE:s+=Bl;break;case jl.ENABLE:break;case jl.ENABLE_FORMS:s+=Pl;break;case jl.ENABLE_STORAGE:s+=Rl,r=o.serializable;break;default:warn(`getRenderingIntent - invalid annotationMode: ${t}`)}n&&(s+=Nl),a&&(s+=Ll);const{ids:l,hash:c}=o.modifiedIds;return{renderingIntent:s,cacheKey:[s,r.hash,c].join("_"),annotationStorageSerializable:r,modifiedIds:l}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#Pr?.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const t of this.#Or.values())e.push(t._destroy());this.#Or.clear(),this.#Ze.clear(),this.#_r.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#Dr.clear(),this.filterFactory.destroy(),TextLayer.cleanup(),this._networkStream?.cancelAllRequests(new AbortException("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(e,t)=>{assert(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then(function({value:e,done:i}){i?t.close():(assert(e instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on("ReaderHeadersReady",async e=>{await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:n,contentLength:a}=this._fullReader;return i&&n||(this._lastProgress&&t.onProgress?.(this._lastProgress),this._fullReader.onProgress=e=>{t.onProgress?.({loaded:e.loaded,total:e.total})}),{isStreamingSupported:i,isRangeSupported:n,contentLength:a}}),e.on("GetRangeReader",(e,t)=>{assert(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(e.begin,e.end);i?(t.onPull=()=>{i.read().then(function({value:e,done:i}){i?t.close():(assert(e instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{i.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}):t.close()}),e.on("GetDoc",({pdfInfo:e})=>{this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new PDFDocumentProxy(e,this))}),e.on("DocException",e=>{t._capability.reject(wrapReason(e))}),e.on("PasswordRequest",e=>{this.#Pr=Promise.withResolvers();try{if(!t.onPassword)throw wrapReason(e);const updatePassword=e=>{e instanceof Error?this.#Pr.reject(e):this.#Pr.resolve({password:e})};t.onPassword(updatePassword,e.code)}catch(e){this.#Pr.reject(e)}return this.#Pr.promise}),e.on("DataLoaded",e=>{t.onProgress?.({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on("StartRenderPage",e=>{if(this.destroyed)return;this.#Or.get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)}),e.on("commonobj",([t,i,n])=>{if(this.destroyed)return null;if(this.commonObjs.has(t))return null;switch(i){case"Font":if("error"in n){const e=n.error;warn(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}const a=new FontInfo(n),s=this._params.pdfBug&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,r=new FontFaceObject(a,s,n.extra,n.charProcOperatorList);this.fontLoader.bind(r).catch(()=>e.sendWithPromise("FontFallback",{id:t})).finally(()=>{!r.fontExtraProperties&&r.data&&r.clearData(),this.commonObjs.resolve(t,r)});break;case"CopyLocalImage":const{imageRef:o}=n;assert(o,"The imageRef must be defined.");for(const e of this.#Or.values())for(const[,i]of e.objs)if(i?.ref===o)return i.dataLen?(this.commonObjs.resolve(t,structuredClone(i)),i.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(t,n);break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),e.on("obj",([e,t,i,n])=>{if(this.destroyed)return;const a=this.#Or.get(t);if(!a.objs.has(e))if(0!==a._intentStates.size)switch(i){case"Image":case"Pattern":a.objs.resolve(e,n);break;default:throw new Error(`Got unknown object type ${i}`)}else n?.bitmap?.close()}),e.on("DocProgress",e=>{this.destroyed||t.onProgress?.({loaded:e.loaded,total:e.total})}),e.on("FetchBinaryData",async e=>{if(this.destroyed)throw new Error("Worker was destroyed.");const t=this[e.type];if(!t)throw new Error(`${e.type} not initialized, see the \`useWorkerFetch\` parameter.`);return t.fetch(e)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&warn("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,i=this.#Ze.get(t);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&this.#_r.set(i.refStr,e);const n=new PDFPageProxy(t,i,this,this._params.pdfBug);return this.#Or.set(t,n),n});return this.#Ze.set(t,n),n}getPageIndex(e){return isRefProxy(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return this.#Rr("GetFieldObjects")}hasJSActions(){return this.#Rr("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!=typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAnnotationsByType(e,t){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:e,pageIndexesToSkip:t})}getDocJSActions(){return this.#Rr("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#Rr("GetOptionalContentConfig").then(t=>new OptionalContentConfig(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=this.#Dr.get(e);if(t)return t;const i=this.messageHandler.sendWithPromise(e,null).then(e=>({info:e[0],metadata:e[1]?new Metadata(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#Dr.set(e,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of this.#Or.values()){if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`)}this.commonObjs.clear(),e||this.fontLoader.clear(),this.#Dr.clear(),this.filterFactory.destroy(!0),TextLayer.cleanup()}}cachedPageNumber(e){if(!isRefProxy(e))return null;const t=0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`;return this.#_r.get(t)??null}}class RenderTask{#Br=null;onContinue=null;onError=null;constructor(e){this.#Br=e}get promise(){return this.#Br.capability.promise}cancel(e=0){this.#Br.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#Br.operatorList;if(!e)return!1;const{annotationCanvasMap:t}=this.#Br;return e.form||e.canvas&&t?.size>0}}class InternalRenderTask{#Nr=null;static#Lr=new WeakSet;constructor({callback:e,params:t,objs:i,commonObjs:n,annotationCanvasMap:a,operatorList:s,pageIndex:r,canvasFactory:o,filterFactory:l,useRequestAnimationFrame:c=!1,pdfBug:h=!1,pageColors:d=null,enableHWA:u=!1,operationsFilter:g=null}){this.callback=e,this.params=t,this.objs=i,this.commonObjs=n,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=r,this.canvasFactory=o,this.filterFactory=l,this._pdfBug=h,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=u,this._dependencyTracker=t.dependencyTracker,this._operationsFilter=g}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#Lr.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.#Lr.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{viewport:i,transform:n,background:a,dependencyTracker:s}=this.params,r=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new CanvasGraphics(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors,s),this.gfx.beginDrawing({transform:n,viewport:i,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#Nr&&(window.cancelAnimationFrame(this.#Nr),this.#Nr=null),InternalRenderTask.#Lr.delete(this._canvas),e||=new RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,t),this.callback(e),this.task.onError?.(e)}operatorListChanged(){this.graphicsReady?(this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#Nr=window.requestAnimationFrame(()=>{this.#Nr=null,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._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),InternalRenderTask.#Lr.delete(this._canvas),this.callback())))}}const lh="5.4.296",hh="f56dc8601";class ColorPicker{#Ur=null;#jr=null;#$r;#Hr=null;#Xr=!1;#qr=!1;#ft=null;#zr;#Wr=null;#Tt=null;static#Gr=null;static get _keyboardManager(){return shadow(this,"_keyboardManager",new KeyboardManager([[["Escape","mac+Escape"],ColorPicker.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],ColorPicker.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],ColorPicker.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],ColorPicker.prototype._moveToPrevious],[["Home","mac+Home"],ColorPicker.prototype._moveToBeginning],[["End","mac+End"],ColorPicker.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:t=null}){e?(this.#qr=!1,this.#ft=e):this.#qr=!0,this.#Tt=e?._uiManager||t,this.#zr=this.#Tt._eventBus,this.#$r=e?.color?.toUpperCase()||this.#Tt?.highlightColors.values().next().value||"#FFFF98",ColorPicker.#Gr||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const e=this.#Ur=document.createElement("button");e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",this.#ft&&(e.ariaControls=`${this.#ft.id}_colorpicker_dropdown`);const t=this.#Tt._signal;e.addEventListener("click",this.#Vr.bind(this),{signal:t}),e.addEventListener("keydown",this.#Kr.bind(this),{signal:t});const i=this.#jr=document.createElement("span");return i.className="swatch",i.ariaHidden="true",i.style.backgroundColor=this.#$r,e.append(i),e}renderMainDropdown(){const e=this.#Hr=this.#Yr();return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}#Yr(){const e=document.createElement("div"),t=this.#Tt._signal;e.addEventListener("contextmenu",noContextMenu,{signal:t}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#ft&&(e.id=`${this.#ft.id}_colorpicker_dropdown`);for(const[i,n]of this.#Tt.highlightColors){const a=document.createElement("button");a.tabIndex="0",a.role="option",a.setAttribute("data-color",n),a.title=i,a.setAttribute("data-l10n-id",ColorPicker.#Gr[i]);const s=document.createElement("span");a.append(s),s.className="swatch",s.style.backgroundColor=n,a.ariaSelected=n===this.#$r,a.addEventListener("click",this.#Jr.bind(this,n),{signal:t}),e.append(a)}return e.addEventListener("keydown",this.#Kr.bind(this),{signal:t}),e}#Jr(e,t){t.stopPropagation(),this.#zr.dispatch("switchannotationeditorparams",{source:this,type:Xl.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)}_colorSelectFromKeyboard(e){if(e.target===this.#Ur)return void this.#Vr(e);const t=e.target.getAttribute("data-color");t&&this.#Jr(t,e)}_moveToNext(e){this.#Zr?e.target!==this.#Ur?e.target.nextSibling?.focus():this.#Hr.firstChild?.focus():this.#Vr(e)}_moveToPrevious(e){e.target!==this.#Hr?.firstChild&&e.target!==this.#Ur?(this.#Zr||this.#Vr(e),e.target.previousSibling?.focus()):this.#Zr&&this._hideDropdownFromKeyboard()}_moveToBeginning(e){this.#Zr?this.#Hr.firstChild?.focus():this.#Vr(e)}_moveToEnd(e){this.#Zr?this.#Hr.lastChild?.focus():this.#Vr(e)}#Kr(e){ColorPicker._keyboardManager.exec(this,e)}#Vr(e){if(this.#Zr)return void this.hideDropdown();if(this.#Xr=0===e.detail,this.#Wr||(this.#Wr=new AbortController,window.addEventListener("pointerdown",this.#xt.bind(this),{signal:this.#Tt.combinedSignal(this.#Wr)})),this.#Ur.ariaExpanded="true",this.#Hr)return void this.#Hr.classList.remove("hidden");const t=this.#Hr=this.#Yr();this.#Ur.append(t)}#xt(e){this.#Hr?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#Hr?.classList.add("hidden"),this.#Ur.ariaExpanded="false",this.#Wr?.abort(),this.#Wr=null}get#Zr(){return this.#Hr&&!this.#Hr.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#qr||(this.#Zr?(this.hideDropdown(),this.#Ur.focus({preventScroll:!0,focusVisible:this.#Xr})):this.#ft?.unselect())}updateColor(e){if(this.#jr&&(this.#jr.style.backgroundColor=e),!this.#Hr)return;const t=this.#Tt.highlightColors.values();for(const i of this.#Hr.children)i.ariaSelected=t.next().value===e.toUpperCase()}destroy(){this.#Ur?.remove(),this.#Ur=null,this.#jr=null,this.#Hr?.remove(),this.#Hr=null}}class BasicColorPicker{#Qr=null;#ft=null;#Tt=null;static#Gr=null;constructor(e){this.#ft=e,this.#Tt=e._uiManager,BasicColorPicker.#Gr||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#Qr)return this.#Qr;const{editorType:e,colorType:t,colorValue:i}=this.#ft,n=this.#Qr=document.createElement("input");return n.type="color",n.value=i||"#000000",n.className="basicColorPicker",n.tabIndex=0,n.setAttribute("data-l10n-id",BasicColorPicker.#Gr[e]),n.addEventListener("input",()=>{this.#Tt.updateParams(t,n.value)},{signal:this.#Tt._signal}),n}update(e){this.#Qr&&(this.#Qr.value=e)}destroy(){this.#Qr?.remove(),this.#Qr=null}hideDropdown(){}}function makeColorComp(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}function scaleAndClamp(e){return Math.max(0,Math.min(255,255*e))}class ColorConverters{static CMYK_G([e,t,i,n]){return["G",1-Math.min(1,.3*e+.59*i+.11*t+n)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return[e=scaleAndClamp(e),e,e]}static G_HTML([e]){const t=makeColorComp(e);return`#${t}${t}${t}`}static RGB_G([e,t,i]){return["G",.3*e+.59*t+.11*i]}static RGB_rgb(e){return e.map(scaleAndClamp)}static RGB_HTML(e){return`#${e.map(makeColorComp).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,i,n]){return["RGB",1-Math.min(1,e+n),1-Math.min(1,i+n),1-Math.min(1,t+n)]}static CMYK_rgb([e,t,i,n]){return[scaleAndClamp(1-Math.min(1,e+n)),scaleAndClamp(1-Math.min(1,i+n)),scaleAndClamp(1-Math.min(1,t+n))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,i]){const n=1-e,a=1-t,s=1-i;return["CMYK",n,a,s,Math.min(n,a,s)]}}class BaseSVGFactory{create(e,t,i=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width",`${e}px`),n.setAttribute("height",`${t}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${e} ${t}`),n}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){unreachable("Abstract method `_createSVG` called.")}}class DOMSVGFactory extends BaseSVGFactory{_createSVG(e){return document.createElementNS(bc,e)}}const dh=new WeakSet,uh=60*(new Date).getTimezoneOffset()*1e3;class AnnotationElementFactory{static create(e){switch(e.data.annotationType){case Zl.LINK:return new LinkAnnotationElement(e);case Zl.TEXT:return new TextAnnotationElement(e);case Zl.WIDGET:switch(e.data.fieldType){case"Tx":return new TextWidgetAnnotationElement(e);case"Btn":return e.data.radioButton?new RadioButtonWidgetAnnotationElement(e):e.data.checkBox?new CheckboxWidgetAnnotationElement(e):new PushButtonWidgetAnnotationElement(e);case"Ch":return new ChoiceWidgetAnnotationElement(e);case"Sig":return new SignatureWidgetAnnotationElement(e)}return new WidgetAnnotationElement(e);case Zl.POPUP:return new PopupAnnotationElement(e);case Zl.FREETEXT:return new FreeTextAnnotationElement(e);case Zl.LINE:return new LineAnnotationElement(e);case Zl.SQUARE:return new SquareAnnotationElement(e);case Zl.CIRCLE:return new CircleAnnotationElement(e);case Zl.POLYLINE:return new PolylineAnnotationElement(e);case Zl.CARET:return new CaretAnnotationElement(e);case Zl.INK:return new InkAnnotationElement(e);case Zl.POLYGON:return new PolygonAnnotationElement(e);case Zl.HIGHLIGHT:return new HighlightAnnotationElement(e);case Zl.UNDERLINE:return new UnderlineAnnotationElement(e);case Zl.SQUIGGLY:return new SquigglyAnnotationElement(e);case Zl.STRIKEOUT:return new StrikeOutAnnotationElement(e);case Zl.STAMP:return new StampAnnotationElement(e);case Zl.FILEATTACHMENT:return new FileAttachmentAnnotationElement(e);default:return new AnnotationElement(e)}}}class AnnotationElement{#eo=null;#to=!1;#io=null;constructor(e,{isRenderable:t=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:t}){return!(!e?.str&&!t?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return AnnotationElement._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){const{data:e}=this,t=this.annotationStorage?.getEditor(e.id);return t?t.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){const e=this.annotationStorage?.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;const{quadPoints:t,inkLists:i,rect:n}=this.data;let a=-1/0,s=-1/0;if(t?.length>=8){for(let e=0;e<t.length;e+=8)t[e+1]>s?(s=t[e+1],a=t[e+2]):t[e+1]===s&&(a=Math.max(a,t[e+2]));return[a,s]}if(i?.length>=1){for(const e of i)for(let t=0,i=e.length;t<i;t+=2)e[t+1]>s?(s=e[t+1],a=e[t]):e[t+1]===s&&(a=Math.max(a,e[t]));if(a!==1/0)return[a,s]}return n?[n[2],n[3]]:null}_normalizePoint(e){const{page:{view:t},viewport:{rawDims:{pageWidth:i,pageHeight:n,pageX:a,pageY:s}}}=this.parent;return e[1]=t[3]-e[1]+t[1],e[0]=100*(e[0]-a)/i,e[1]=100*(e[1]-s)/n,e}get commentText(){const{data:e}=this;return this.annotationStorage.getRawValue(`${$l}${e.id}`)?.popup?.contents||e.contentsObj?.str||""}set commentText(e){const{data:t}=this,i={deleted:!e,contents:e||""};this.annotationStorage.updateEditor(t.id,{popup:i})||this.annotationStorage.setValue(`${$l}${t.id}`,{id:t.id,annotationType:t.annotationType,pageIndex:this.parent.page._pageIndex,popup:i,popupRef:t.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){(this.#io?.popup||this.popup)?.remove(),this.#io=this.popup=null}updateEdited(e){if(!this.container)return;e.rect&&(this.#eo||={rect:this.data.rect.slice(0)});const{rect:t,popup:i}=e;t&&this.#no(t);let n=this.#io?.popup||this.popup;!n&&i?.text&&(this._createPopup(i),n=this.#io.popup),n&&(n.updateEdited(e),i?.deleted&&(n.remove(),this.#io=null,this.popup=null))}resetEdited(){this.#eo&&(this.#no(this.#eo.rect),this.#io?.popup.resetEdited(),this.#eo=null)}#no(e){const{container:{style:t},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:a,pageHeight:s,pageX:r,pageY:o}}}}=this;i?.splice(0,4,...e),t.left=100*(e[0]-r)/a+"%",t.top=100*(s-e[3]+o)/s+"%",0===n?(t.width=100*(e[2]-e[0])/a+"%",t.height=100*(e[3]-e[1])/s+"%"):this.setRotation(n)}_createContainer(e){const{data:t,parent:{page:i,viewport:n}}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",t.id),this instanceof WidgetAnnotationElement||this instanceof LinkAnnotationElement||(a.tabIndex=0);const{style:s}=a;if(s.zIndex=this.parent.zIndex,this.parent.zIndex+=2,t.alternativeText&&(a.title=t.alternativeText),t.noRotate&&a.classList.add("norotate"),!t.rect||this instanceof PopupAnnotationElement){const{rotation:e}=t;return t.hasOwnCanvas||0===e||this.setRotation(e,a),a}const{width:r,height:o}=this;if(!e&&t.borderStyle.width>0){s.borderWidth=`${t.borderStyle.width}px`;const e=t.borderStyle.horizontalCornerRadius,i=t.borderStyle.verticalCornerRadius;if(e>0||i>0){const t=`calc(${e}px * var(--total-scale-factor)) / calc(${i}px * var(--total-scale-factor))`;s.borderRadius=t}else if(this instanceof RadioButtonWidgetAnnotationElement){const e=`calc(${r}px * var(--total-scale-factor)) / calc(${o}px * var(--total-scale-factor))`;s.borderRadius=e}switch(t.borderStyle.style){case Ql:s.borderStyle="solid";break;case ec:s.borderStyle="dashed";break;case tc:warn("Unimplemented border style: beveled");break;case ic:warn("Unimplemented border style: inset");break;case nc:s.borderBottomStyle="solid"}const n=t.borderColor||null;n?(this.#to=!0,s.borderColor=Util.makeHexColor(0|n[0],0|n[1],0|n[2])):s.borderWidth=0}const l=Util.normalizeRect([t.rect[0],i.view[3]-t.rect[1]+i.view[1],t.rect[2],i.view[3]-t.rect[3]+i.view[1]]),{pageWidth:c,pageHeight:h,pageX:d,pageY:u}=n.rawDims;s.left=100*(l[0]-d)/c+"%",s.top=100*(l[1]-u)/h+"%";const{rotation:g}=t;return t.hasOwnCanvas||0===g?(s.width=100*r/c+"%",s.height=100*o/h+"%"):this.setRotation(g,a),a}setRotation(e,t=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims;let{width:a,height:s}=this;e%180!=0&&([a,s]=[s,a]),t.style.width=100*a/i+"%",t.style.height=100*s/n+"%",t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const setColor=(e,t,i)=>{const n=i.detail[e],a=n[0],s=n.slice(1);i.target.style[t]=ColorConverters[`${a}_HTML`](s),this.annotationStorage.setValue(this.data.id,{[t]:ColorConverters[`${a}_rgb`](s)})};return shadow(this,"_commonActions",{display:e=>{const{display:t}=e.detail,i=t%2==1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===t||2===t})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:t}=e.detail;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:e=>{setColor("bgColor","backgroundColor",e)},fillColor:e=>{setColor("fillColor","backgroundColor",e)},fgColor:e=>{setColor("fgColor","color",e)},textColor:e=>{setColor("textColor","color",e)},borderColor:e=>{setColor("borderColor","borderColor",e)},strokeColor:e=>{setColor("strokeColor","borderColor",e)},rotation:e=>{const t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){const i=this._commonActions;for(const n of Object.keys(t.detail)){const a=e[n]||i[n];a?.(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const i=this._commonActions;for(const[n,a]of Object.entries(t)){const s=i[n];if(s){s({detail:{[n]:a},target:e}),delete t[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,i,n,a]=this.data.rect.map(e=>Math.fround(e));if(8===e.length){const[s,r,o,l]=e.subarray(2,6);if(n===s&&a===r&&t===o&&i===l)return}const{style:s}=this.container;let r;if(this.#to){const{borderColor:e,borderWidth:t}=s;s.borderWidth=0,r=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${e}" stroke-width="${t}">`],this.container.classList.add("hasBorder")}const o=n-t,l=a-i,{svgFactory:c}=this,h=c.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0),h.role="none";const d=c.createElement("defs");h.append(d);const u=c.createElement("clipPath"),g=`clippath_${this.data.id}`;u.setAttribute("id",g),u.setAttribute("clipPathUnits","objectBoundingBox"),d.append(u);for(let i=2,n=e.length;i<n;i+=8){const n=e[i],s=e[i+1],h=e[i+2],d=e[i+3],g=c.createElement("rect"),f=(h-t)/o,p=(a-s)/l,m=(n-h)/o,b=(s-d)/l;g.setAttribute("x",f),g.setAttribute("y",p),g.setAttribute("width",m),g.setAttribute("height",b),u.append(g),r?.push(`<rect vector-effect="non-scaling-stroke" x="${f}" y="${p}" width="${m}" height="${b}"/>`)}this.#to&&(r.push("</g></svg>')"),s.backgroundImage=r.join("")),this.container.append(h),this.container.style.clipPath=`url(#${g})`}_createPopup(e=null){const{data:t}=this;let i,n;e?(i={str:e.text},n=e.date):(i=t.contentsObj,n=t.modificationDate);const a=this.#io=new PopupAnnotationElement({data:{color:t.color,titleObj:t.titleObj,modificationDate:n,contentsObj:i,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]});this.parent._commentManager||this.parent.div.append(a.render())}get hasPopupElement(){return!!(this.#io||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#io}render(){unreachable("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const i=[];if(this._fieldObjects){const n=this._fieldObjects[e];if(n)for(const{page:e,id:a,exportValues:s}of n){if(-1===e)continue;if(a===t)continue;const n="string"==typeof s?s:null,r=document.querySelector(`[data-element-id="${a}"]`);!r||dh.has(r)?i.push({id:a,exportValue:n,domElement:r}):warn(`_getElementsByName - element not allowed: ${a}`)}return i}for(const n of document.getElementsByName(e)){const{exportValue:e}=n,a=n.getAttribute("data-element-id");a!==t&&(dh.has(n)&&i.push({id:a,exportValue:e,domElement:n}))}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class EditorAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.editor=e.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:e}=this;e.hasComment&&(this._createPopup(e.comment),this.extraPopupElement.popup.renderCommentButton())}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(e){this.editor.comment=e,e||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.container.remove(),this.container=null,this.removePopup()}}class LinkAnnotationElement extends AnnotationElement{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,i=document.createElement("a");i.setAttribute("data-element-id",e.id);let n=!1;return e.url?(t.addLinkAttributes(i,e.url,e.newWindow),n=!0):e.action?(this._bindNamedAction(i,e.action,e.overlaidText),n=!0):e.attachment?(this.#ao(i,e.attachment,e.overlaidText,e.attachmentDest),n=!0):e.setOCGState?(this.#so(i,e.setOCGState,e.overlaidText),n=!0):e.dest?(this._bindLink(i,e.dest,e.overlaidText),n=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,e),n=!0),e.resetForm?(this._bindResetFormAction(i,e.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(i),this.container}#ro(){this.container.setAttribute("data-internal-link","")}_bindLink(e,t,i=""){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&this.#ro(),i&&(e.title=i)}_bindNamedAction(e,t,i=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),i&&(e.title=i),this.#ro()}#ao(e,t,i="",n=null){e.href=this.linkService.getAnchorUrl(""),t.description?e.title=t.description:i&&(e.title=i),e.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,n),!1),this.#ro()}#so(e,t,i=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),i&&(e.title=i),this.#ro()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(t.actions)){const a=i.get(n);a&&(e[a]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:n}}),!1))}t.overlaidText&&(e.title=t.overlaidText),e.onclick||(e.onclick=()=>!1),this.#ro()}_bindResetFormAction(e,t){const i=e.onclick;if(i||(e.href=this.linkService.getAnchorUrl("")),this.#ro(),!this._fieldObjects)return warn('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(e.onclick=()=>!1));e.onclick=()=>{i?.();const{fields:e,refs:n,include:a}=t,s=[];if(0!==e.length||0!==n.length){const t=new Set(n);for(const i of e){const e=this._fieldObjects[i]||[];for(const{id:i}of e)t.add(i)}for(const e of Object.values(this._fieldObjects))for(const i of e)t.has(i.id)===a&&s.push(i)}else for(const e of Object.values(this._fieldObjects))s.push(...e);const r=this.annotationStorage,o=[];for(const e of s){const{id:t}=e;switch(o.push(t),e.type){case"text":{const i=e.defaultValue||"";r.setValue(t,{value:i});break}case"checkbox":case"radiobutton":{const i=e.defaultValue===e.exportValues;r.setValue(t,{value:i});break}case"combobox":case"listbox":{const i=e.defaultValue||"";r.setValue(t,{value:i});break}default:continue}const i=document.querySelector(`[data-element-id="${t}"]`);i&&(dh.has(i)?i.dispatchEvent(new Event("resetform")):warn(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}),!1}}}class TextAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class WidgetAnnotationElement extends AnnotationElement{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&("CANVAS"===e.previousSibling?.nodeName&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return util_FeatureTest.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,i,n,a){i.includes("mouse")?e.addEventListener(i,e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:a(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})}):e.addEventListener(i,e=>{if("blur"===i){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if("focus"===i){if(t.focused)return;t.focused=!0}a&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:a(e)}})})}_setEventListeners(e,t,i,n){for(const[a,s]of i)("Action"===s||this.data.actions?.[s])&&("Focus"!==s&&"Blur"!==s||(t||={focused:!1}),this._setEventListener(e,t,a,s,n),"Focus"!==s||this.data.actions?.Blur?"Blur"!==s||this.data.actions?.Focus||this._setEventListener(e,t,"focus","Focus",null):this._setEventListener(e,t,"blur","Blur",null))}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":Util.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,a=e.style;let s;const roundToOneDecimal=e=>Math.round(10*e)/10;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(El*n))||1);s=Math.min(n,roundToOneDecimal(t/El))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);s=Math.min(n,roundToOneDecimal(e/El))}a.fontSize=`calc(${s}px * var(--total-scale-factor))`,a.color=Util.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(a.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class TextWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,i,n){const a=this.annotationStorage;for(const s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[t]=i),a.setValue(s.id,{[n]:i})}render(){const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const n=e.getValue(t,{value:this.data.fieldValue});let a=n.value||"";const s=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;s&&a.length>s&&(a=a.slice(0,s));let r=n.formattedValue||this.data.textContent?.join("\n")||null;r&&this.data.comb&&(r=r.replaceAll(/\s+/g,""));const o={userValue:a,formattedValue:r,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=r??a,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type=this.data.password?"password":"text",i.setAttribute("value",r??a),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),dh.add(i),i.setAttribute("data-element-id",t),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=0;const{datetimeFormat:l,datetimeType:c,timeStep:h}=this.data,d=!!c&&this.enableScripting;l&&(i.title=l),this._setRequired(i,this.data.required),s&&(i.maxLength=s),i.addEventListener("input",n=>{e.setValue(t,{value:n.target.value}),this.setPropertyOnSiblings(i,"value",n.target.value,"value"),o.formattedValue=null}),i.addEventListener("resetform",e=>{const t=this.data.defaultFieldValue??"";i.value=o.userValue=t,o.formattedValue=null});let blurListener=e=>{const{formattedValue:t}=o;null!=t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",e=>{if(o.focused)return;const{target:t}=e;if(d&&(t.type=c,h&&(t.step=h)),o.userValue){const e=o.userValue;if(d)if("time"===c){const i=new Date(e),n=[i.getHours(),i.getMinutes(),i.getSeconds()];t.value=n.map(e=>e.toString().padStart(2,"0")).join(":")}else t.value=new Date(e-uh).toISOString().split("date"===c?"T":".",1)[0];else t.value=e}o.lastCommittedValue=t.value,o.commitKey=1,this.data.actions?.Focus||(o.focused=!0)}),i.addEventListener("updatefromsandbox",i=>{this.showElementAndHideCanvas(i.target);const n={value(i){o.userValue=i.detail.value??"",d||e.setValue(t,{value:o.userValue.toString()}),i.target.value=o.userValue},formattedValue(i){const{formattedValue:n}=i.detail;o.formattedValue=n,null!=n&&i.target!==document.activeElement&&(i.target.value=n);const a={formattedValue:n};d&&(a.value=n),e.setValue(t,a)},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:i=>{const{charLimit:n}=i.detail,{target:a}=i;if(0===n)return void a.removeAttribute("maxLength");a.setAttribute("maxLength",n);let s=o.userValue;!s||s.length<=n||(s=s.slice(0,n),a.value=o.userValue=s,e.setValue(t,{value:s}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:s,willCommit:!0,commitKey:1,selStart:a.selectionStart,selEnd:a.selectionEnd}}))}};this._dispatchEventFromSandbox(n,i)}),i.addEventListener("keydown",e=>{o.commitKey=1;let i=-1;if("Escape"===e.key?i=0:"Enter"!==e.key||this.data.multiLine?"Tab"===e.key&&(o.commitKey=3):i=2,-1===i)return;const{value:n}=e.target;o.lastCommittedValue!==n&&(o.lastCommittedValue=n,o.userValue=n,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:n,willCommit:!0,commitKey:i,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))});const n=blurListener;blurListener=null,i.addEventListener("blur",e=>{if(!o.focused||!e.relatedTarget)return;this.data.actions?.Blur||(o.focused=!1);const{target:i}=e;let{value:a}=i;if(d){if(a&&"time"===c){const e=a.split(":").map(e=>parseInt(e,10));a=new Date(2e3,0,1,e[0],e[1],e[2]||0).valueOf(),i.step=""}else a.includes("T")||(a=`${a}T00:00`),a=new Date(a).valueOf();i.type="text"}o.userValue=a,o.lastCommittedValue!==a&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:a,willCommit:!0,commitKey:o.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),n(e)}),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",e=>{o.lastCommittedValue=null;const{data:i,target:n}=e,{value:a,selectionStart:s,selectionEnd:r}=n;let l=s,c=r;switch(e.inputType){case"deleteWordBackward":{const e=a.substring(0,s).match(/\w*[^\w]*$/);e&&(l-=e[0].length);break}case"deleteWordForward":{const e=a.substring(s).match(/^[^\w]*\w*/);e&&(c+=e[0].length);break}case"deleteContentBackward":s===r&&(l-=1);break;case"deleteContentForward":s===r&&(c+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:a,change:i||"",willCommit:!1,selStart:l,selEnd:c}})}),this._setEventListeners(i,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.value)}if(blurListener&&i.addEventListener("blur",blurListener),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/s;i.classList.add("comb"),i.style.letterSpacing=`calc(${e}px * var(--total-scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class SignatureWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,i=t.id;let n=e.getValue(i,{value:t.exportValue===t.fieldValue}).value;"string"==typeof n&&(n="Off"!==n,e.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const a=document.createElement("input");return dh.add(a),a.setAttribute("data-element-id",i),a.disabled=t.readOnly,this._setRequired(a,this.data.required),a.type="checkbox",a.name=t.fieldName,n&&a.setAttribute("checked",!0),a.setAttribute("exportValue",t.exportValue),a.tabIndex=0,a.addEventListener("change",n=>{const{name:a,checked:s}=n.target;for(const n of this._getElementsByName(a,i)){const i=s&&n.exportValue===t.exportValue;n.domElement&&(n.domElement.checked=i),e.setValue(n.id,{value:i})}e.setValue(i,{value:s})}),a.addEventListener("resetform",e=>{const i=t.defaultFieldValue||"Off";e.target.checked=i===t.exportValue}),this.enableScripting&&this.hasJSActions&&(a.addEventListener("updatefromsandbox",t=>{const n={value(t){t.target.checked="Off"!==t.detail.value,e.setValue(i,{value:t.target.checked})}};this._dispatchEventFromSandbox(n,t)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,i=t.id;let n=e.getValue(i,{value:t.fieldValue===t.buttonValue}).value;if("string"==typeof n&&(n=n!==t.buttonValue,e.setValue(i,{value:n})),n)for(const n of this._getElementsByName(t.fieldName,i))e.setValue(n.id,{value:!1});const a=document.createElement("input");if(dh.add(a),a.setAttribute("data-element-id",i),a.disabled=t.readOnly,this._setRequired(a,this.data.required),a.type="radio",a.name=t.fieldName,n&&a.setAttribute("checked",!0),a.tabIndex=0,a.addEventListener("change",t=>{const{name:n,checked:a}=t.target;for(const t of this._getElementsByName(n,i))e.setValue(t.id,{value:!1});e.setValue(i,{value:a})}),a.addEventListener("resetform",e=>{const i=t.defaultFieldValue;e.target.checked=null!=i&&i===t.buttonValue}),this.enableScripting&&this.hasJSActions){const n=t.buttonValue;a.addEventListener("updatefromsandbox",t=>{const a={value:t=>{const a=n===t.detail.value;for(const n of this._getElementsByName(t.target.name)){const t=a&&n.id===i;n.domElement&&(n.domElement.checked=t),e.setValue(n.id,{value:t})}}};this._dispatchEventFromSandbox(a,t)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)}return this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class PushButtonWidgetAnnotationElement extends LinkAnnotationElement{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({},e)})),e}}class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,i=e.getValue(t,{value:this.data.fieldValue}),n=document.createElement("select");dh.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=0;let a=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",e=>{const t=this.data.defaultFieldValue;for(const e of n.options)e.selected=e.value===t});for(const e of this.data.options){const t=document.createElement("option");t.textContent=e.displayValue,t.value=e.exportValue,i.value.includes(e.exportValue)&&(t.setAttribute("selected",!0),a=!1),n.append(t)}let s=null;if(a){const e=document.createElement("option");e.value=" ",e.setAttribute("hidden",!0),e.setAttribute("selected",!0),n.prepend(e),s=()=>{e.remove(),n.removeEventListener("input",s),s=null},n.addEventListener("input",s)}const getValue=e=>{const t=e?"value":"textContent",{options:i,multiple:a}=n;return a?Array.prototype.filter.call(i,e=>e.selected).map(e=>e[t]):-1===i.selectedIndex?null:i[i.selectedIndex][t]};let r=getValue(!1);const getItems=e=>{const t=e.target.options;return Array.prototype.map.call(t,e=>({displayValue:e.textContent,exportValue:e.value}))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",i=>{const a={value(i){s?.();const a=i.detail.value,o=new Set(Array.isArray(a)?a:[a]);for(const e of n.options)e.selected=o.has(e.value);e.setValue(t,{value:getValue(!0)}),r=getValue(!1)},multipleSelection(e){n.multiple=!0},remove(i){const a=n.options,s=i.detail.remove;if(a[s].selected=!1,n.remove(s),a.length>0){-1===Array.prototype.findIndex.call(a,e=>e.selected)&&(a[0].selected=!0)}e.setValue(t,{value:getValue(!0),items:getItems(i)}),r=getValue(!1)},clear(i){for(;0!==n.length;)n.remove(0);e.setValue(t,{value:null,items:[]}),r=getValue(!1)},insert(i){const{index:a,displayValue:s,exportValue:o}=i.detail.insert,l=n.children[a],c=document.createElement("option");c.textContent=s,c.value=o,l?l.before(c):n.append(c),e.setValue(t,{value:getValue(!0),items:getItems(i)}),r=getValue(!1)},items(i){const{items:a}=i.detail;for(;0!==n.length;)n.remove(0);for(const e of a){const{displayValue:t,exportValue:i}=e,a=document.createElement("option");a.textContent=t,a.value=i,n.append(a)}n.options.length>0&&(n.options[0].selected=!0),e.setValue(t,{value:getValue(!0),items:getItems(i)}),r=getValue(!1)},indices(i){const n=new Set(i.detail.indices);for(const e of i.target.options)e.selected=n.has(e.index);e.setValue(t,{value:getValue(!0)}),r=getValue(!1)},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(a,i)}),n.addEventListener("input",i=>{const n=getValue(!0),a=getValue(!1);e.setValue(t,{value:n}),i.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:r,change:a,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],e=>e.target.value)):n.addEventListener("input",function(i){e.setValue(t,{value:getValue(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class PopupAnnotationElement extends AnnotationElement{constructor(e){const{data:t,elements:i,parent:n}=e,a=!!n._commentManager;if(super(e,{isRenderable:!a&&AnnotationElement._hasPopupData(t)}),this.elements=i,a&&AnnotationElement._hasPopupData(t)){const e=this.popup=this.#oo();for(const t of i)t.popup=e}else this.popup=null}#oo(){return new PopupElement({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,commentManager:this.parent._commentManager})}render(){const{container:e}=this;e.classList.add("popupAnnotation"),e.role="comment";const t=this.popup=this.#oo(),i=[];for(const e of this.elements)e.popup=t,e.container.ariaHasPopup="dialog",i.push(e.data.id),e.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(e=>`${mc}${e}`).join(",")),this.container}}class PopupElement{#Vt=null;#lo=this.#Kr.bind(this);#co=this.#ho.bind(this);#do=this.#uo.bind(this);#go=this.#fo.bind(this);#po=null;#Mi=null;#mo=null;#bo=null;#yo=null;#wo=null;#Ao=null;#xo=!1;#So=null;#vo=null;#Nt=null;#Co=null;#ko=null;#xn=null;#To=null;#yn=null;#Fo=null;#eo=null;#Io=!1;#Eo=null;#Mo=null;constructor({container:e,color:t,elements:i,titleObj:n,modificationDate:a,contentsObj:s,richText:r,parent:o,rect:l,parentRect:c,open:h,commentManager:d=null}){this.#Mi=e,this.#Fo=n,this.#mo=s,this.#yn=r,this.#wo=o,this.#po=t,this.#To=l,this.#Ao=c,this.#yo=i,this.#Vt=d,this.#Eo=i[0],this.#bo=PDFDateString.toDateObject(a),this.trigger=i.flatMap(e=>e.getElementsToTriggerPopup()),d?this.renderCommentButton():(this.#Do(),this.#Mi.hidden=!0,h&&this.#fo())}#Do(){if(this.#vo)return;this.#vo=new AbortController;const{signal:e}=this.#vo;for(const t of this.trigger)t.addEventListener("click",this.#go,{signal:e}),t.addEventListener("pointerenter",this.#do,{signal:e}),t.addEventListener("pointerleave",this.#co,{signal:e}),t.classList.add("popupTriggerArea");for(const t of this.#yo)t.container?.addEventListener("keydown",this.#lo,{signal:e})}#Oo(){const e=this.#yo.find(e=>e.hasCommentButton);e&&(this.#ko=e._normalizePoint(e.commentButtonPosition))}renderCommentButton(){if(this.#Co)return;if(this.#ko||this.#Oo(),!this.#ko)return;const{signal:e}=this.#vo=new AbortController,t=!!this.#Eo.extraPopupElement,togglePopup=()=>{this.#Vt.toggleCommentPopup(this,!0,void 0,!t)},showPopup=()=>{this.#Vt.toggleCommentPopup(this,!1,!0,!t)},hidePopup=()=>{this.#Vt.toggleCommentPopup(this,!1,!1)};if(t){this.#Co=this.#Eo.container;for(const t of this.trigger)t.ariaHasPopup="dialog",t.ariaControls="commentPopup",t.addEventListener("keydown",this.#lo,{signal:e}),t.addEventListener("click",togglePopup,{signal:e}),t.addEventListener("pointerenter",showPopup,{signal:e}),t.addEventListener("pointerleave",hidePopup,{signal:e}),t.classList.add("popupTriggerArea")}else{const t=this.#Co=document.createElement("button");t.className="annotationCommentButton";const i=this.#Eo.container;t.style.zIndex=i.style.zIndex+1,t.tabIndex=0,t.ariaHasPopup="dialog",t.ariaControls="commentPopup",t.setAttribute("data-l10n-id","pdfjs-show-comment-button"),this.#_o(),this.#Po(),t.addEventListener("keydown",this.#lo,{signal:e}),t.addEventListener("click",togglePopup,{signal:e}),t.addEventListener("pointerenter",showPopup,{signal:e}),t.addEventListener("pointerleave",hidePopup,{signal:e}),i.after(t)}}#Po(){if(this.#Eo.extraPopupElement&&!this.#Eo.editor)return;this.renderCommentButton();const[e,t]=this.#ko,{style:i}=this.#Co;i.left=`calc(${e}%)`,i.top=`calc(${t}% - var(--comment-button-dim))`}#_o(){this.#Eo.extraPopupElement||(this.renderCommentButton(),this.#Co.style.backgroundColor=this.commentButtonColor||"")}get commentButtonColor(){const{color:e,opacity:t}=this.#Eo.commentData;return e?this.#wo._commentManager.makeCommentColor(e,t):null}focusCommentButton(){setTimeout(()=>{this.#Co?.focus()},0)}getData(){const{richText:e,color:t,opacity:i,creationDate:n,modificationDate:a}=this.#Eo.commentData;return{contentsObj:{str:this.comment},richText:e,color:t,opacity:i,creationDate:n,modificationDate:a}}get elementBeforePopup(){return this.#Co}get comment(){return this.#Mo||=this.#Eo.commentText,this.#Mo}set comment(e){e!==this.comment&&(this.#Eo.commentText=this.#Mo=e)}get parentBoundingClientRect(){return this.#Eo.layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:t}){this.#Co&&(this.#Co.classList.toggle("selected",e),this.#Co.ariaExpanded=t)}setSelectedCommentButton(e){this.#Co.classList.toggle("selected",e)}get commentPopupPosition(){if(this.#xn)return this.#xn;const{x:e,y:t,height:i}=this.#Co.getBoundingClientRect(),{x:n,y:a,width:s,height:r}=this.#Eo.layer.getBoundingClientRect();return[(e-n)/s,(t+i-a)/r]}set commentPopupPosition(e){this.#xn=e}hasDefaultPopupPosition(){return null===this.#xn}get commentButtonPosition(){return this.#ko}get commentButtonWidth(){return this.#Co.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){const[t,i]=this.#xn||this.commentButtonPosition.map(e=>e/100),n=this.parentBoundingClientRect,{x:a,y:s,width:r,height:o}=n;this.#Vt.showDialog(null,this,a+t*r,s+i*o,{...e,parentDimensions:n})}render(){if(this.#So)return;const e=this.#So=document.createElement("div");if(e.className="popup",this.#po){const t=e.style.outlineColor=Util.makeHexColor(...this.#po);e.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`}const t=document.createElement("span");if(t.className="header",this.#Fo?.str){const e=document.createElement("span");e.className="title",t.append(e),({dir:e.dir,str:e.textContent}=this.#Fo)}if(e.append(t),this.#bo){const e=document.createElement("time");e.className="popupDate",e.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),e.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#bo.valueOf()})),e.dateTime=this.#bo.toISOString(),t.append(e)}renderRichText({html:this.#Ro||this.#mo.str,dir:this.#mo?.dir,className:"popupContent"},e),this.#Mi.append(e)}get#Ro(){const e=this.#yn,t=this.#mo;return!e?.str||t?.str&&t.str!==e.str?null:this.#yn.html||null}get#Bo(){return this.#Ro?.attributes?.style?.fontSize||0}get#No(){return this.#Ro?.attributes?.style?.color||null}#Lo(e){const t=[],i={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},n={style:{color:this.#No,fontSize:this.#Bo?`calc(${this.#Bo}px * var(--total-scale-factor))`:""}};for(const i of e.split("\n"))t.push({name:"span",value:i,attributes:n});return i}#Kr(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||("Enter"===e.key||"Escape"===e.key&&this.#xo)&&this.#fo()}updateEdited({rect:e,popup:t,deleted:i}){if(this.#Vt)return i?(this.remove(),this.#Mo=null):t&&(t.deleted?this.remove():(this.#_o(),this.#Mo=t.text)),void(e&&(this.#ko=null,this.#Oo(),this.#Po()));i||t?.deleted?this.remove():(this.#Do(),this.#eo||={contentsObj:this.#mo,richText:this.#yn},e&&(this.#Nt=null),t&&t.text&&(this.#yn=this.#Lo(t.text),this.#bo=PDFDateString.toDateObject(t.date),this.#mo=null),this.#So?.remove(),this.#So=null)}resetEdited(){this.#eo&&(({contentsObj:this.#mo,richText:this.#yn}=this.#eo),this.#eo=null,this.#So?.remove(),this.#So=null,this.#Nt=null)}remove(){if(this.#vo?.abort(),this.#vo=null,this.#So?.remove(),this.#So=null,this.#Io=!1,this.#xo=!1,this.#Co?.remove(),this.#Co=null,this.trigger)for(const e of this.trigger)e.classList.remove("popupTriggerArea")}#Uo(){if(null!==this.#Nt)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:i,pageX:n,pageY:a}}}=this.#wo;let s=!!this.#Ao,r=s?this.#Ao:this.#To;for(const e of this.#yo)if(!r||null!==Util.intersect(e.data.rect,r)){r=e.data.rect,s=!0;break}const o=Util.normalizeRect([r[0],e[3]-r[1]+e[1],r[2],e[3]-r[3]+e[1]]),l=s?r[2]-r[0]+5:0,c=o[0]+l,h=o[1];this.#Nt=[100*(c-n)/t,100*(h-a)/i];const{style:d}=this.#Mi;d.left=`${this.#Nt[0]}%`,d.top=`${this.#Nt[1]}%`}#fo(){this.#Vt?this.#Vt.toggleCommentPopup(this,!1):(this.#xo=!this.#xo,this.#xo?(this.#uo(),this.#Mi.addEventListener("click",this.#go),this.#Mi.addEventListener("keydown",this.#lo)):(this.#ho(),this.#Mi.removeEventListener("click",this.#go),this.#Mi.removeEventListener("keydown",this.#lo)))}#uo(){this.#So||this.render(),this.isVisible?this.#xo&&this.#Mi.classList.add("focused"):(this.#Uo(),this.#Mi.hidden=!1,this.#Mi.style.zIndex=parseInt(this.#Mi.style.zIndex)+1e3)}#ho(){this.#Mi.classList.remove("focused"),!this.#xo&&this.isVisible&&(this.#Mi.hidden=!0,this.#Mi.style.zIndex=parseInt(this.#Mi.style.zIndex)-1e3)}forceHide(){this.#Io=this.isVisible,this.#Io&&(this.#Mi.hidden=!0)}maybeShow(){this.#Vt||(this.#Do(),this.#Io&&(this.#So||this.#uo(),this.#Io=!1,this.#Mi.hidden=!1))}get isVisible(){return!this.#Vt&&!1===this.#Mi.hidden}}class FreeTextAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Hl.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const i=document.createElement("span");i.textContent=t,e.append(i)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class LineAnnotationElement extends AnnotationElement{#jo=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:e,width:t,height:i}=this,n=this.svgFactory.create(t,i,!0),a=this.#jo=this.svgFactory.createElement("svg:line");return a.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),a.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),a.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),a.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),a.setAttribute("stroke-width",e.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),n.append(a),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#jo}addHighlightArea(){this.container.classList.add("highlightArea")}}class SquareAnnotationElement extends AnnotationElement{#$o=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:e,width:t,height:i}=this,n=this.svgFactory.create(t,i,!0),a=e.borderStyle.width,s=this.#$o=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",a/2),s.setAttribute("y",a/2),s.setAttribute("width",t-a),s.setAttribute("height",i-a),s.setAttribute("stroke-width",a||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#$o}addHighlightArea(){this.container.classList.add("highlightArea")}}class CircleAnnotationElement extends AnnotationElement{#Ho=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:e,width:t,height:i}=this,n=this.svgFactory.create(t,i,!0),a=e.borderStyle.width,s=this.#Ho=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",t/2),s.setAttribute("cy",i/2),s.setAttribute("rx",t/2-a/2),s.setAttribute("ry",i/2-a/2),s.setAttribute("stroke-width",a||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Ho}addHighlightArea(){this.container.classList.add("highlightArea")}}class PolylineAnnotationElement extends AnnotationElement{#Xo=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,vertices:t,borderStyle:i,popupRef:n},width:a,height:s}=this;if(!t)return this.container;const r=this.svgFactory.create(a,s,!0);let o=[];for(let i=0,n=t.length;i<n;i+=2){const n=t[i]-e[0],a=e[3]-t[i+1];o.push(`${n},${a}`)}o=o.join(" ");const l=this.#Xo=this.svgFactory.createElement(this.svgElementName);return l.setAttribute("points",o),l.setAttribute("stroke-width",i.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),r.append(l),this.container.append(r),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Xo}addHighlightArea(){this.container.classList.add("highlightArea")}}class PolygonAnnotationElement extends PolylineAnnotationElement{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class CaretAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class InkAnnotationElement extends AnnotationElement{#qo=null;#zo=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?Hl.HIGHLIGHT:Hl.INK}#Wo(e,t){switch(e){case 90:return{transform:`rotate(90) translate(${-t[0]},${t[1]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};case 180:return{transform:`rotate(180) translate(${-t[2]},${t[1]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]};case 270:return{transform:`rotate(270) translate(${-t[2]},${t[3]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};default:return{transform:`translate(${-t[0]},${t[3]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]}}}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,rotation:t,inkLists:i,borderStyle:n,popupRef:a}}=this,{transform:s,width:r,height:o}=this.#Wo(t,e),l=this.svgFactory.create(r,o,!0),c=this.#qo=this.svgFactory.createElement("svg:g");l.append(c),c.setAttribute("stroke-width",n.width||1),c.setAttribute("stroke-linecap","round"),c.setAttribute("stroke-linejoin","round"),c.setAttribute("stroke-miterlimit",10),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),c.setAttribute("transform",s);for(let e=0,t=i.length;e<t;e++){const t=this.svgFactory.createElement(this.svgElementName);this.#zo.push(t),t.setAttribute("points",i[e].join(",")),c.append(t)}return!a&&this.hasPopupData&&this._createPopup(),this.container.append(l),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);const{thickness:t,points:i,rect:n}=e,a=this.#qo;if(t>=0&&a.setAttribute("stroke-width",t||1),i)for(let e=0,t=this.#zo.length;e<t;e++)this.#zo[e].setAttribute("points",i[e].join(","));if(n){const{transform:e,width:t,height:i}=this.#Wo(this.data.rotation,n);a.parentElement.setAttribute("viewBox",`0 0 ${t} ${i}`),a.setAttribute("transform",e)}}getElementsToTriggerPopup(){return this.#zo}addHighlightArea(){this.container.classList.add("highlightArea")}}class HighlightAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Hl.HIGHLIGHT}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),e){const t=document.createElement("mark");t.classList.add("overlaidText"),t.textContent=e,this.container.append(t)}return this.container}}class UnderlineAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),e){const t=document.createElement("u");t.classList.add("overlaidText"),t.textContent=e,this.container.append(t)}return this.container}}class SquigglyAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),e){const t=document.createElement("u");t.classList.add("overlaidText"),t.textContent=e,this.container.append(t)}return this.container}}class StrikeOutAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),e){const t=document.createElement("s");t.classList.add("overlaidText"),t.textContent=e,this.container.append(t)}return this.container}}class StampAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Hl.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class FileAttachmentAnnotationElement extends AnnotationElement{#Go=null;constructor(e){super(e,{isRenderable:!0});const{file:t}=this.data;this.filename=t.filename,this.content=t.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...t})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:t}=this;let i;t.hasAppearance||0===t.fillAlpha?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?"paperclip":"pushpin"}.svg`,t.fillAlpha&&t.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(100*t.fillAlpha)}%);`)),i.addEventListener("dblclick",this.#Vo.bind(this)),this.#Go=i;const{isMac:n}=util_FeatureTest.platform;return e.addEventListener("keydown",e=>{"Enter"===e.key&&(n?e.metaKey:e.ctrlKey)&&this.#Vo()}),!t.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),e.append(i),e}getElementsToTriggerPopup(){return this.#Go}addHighlightArea(){this.container.classList.add("highlightArea")}#Vo(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class AnnotationLayer{#Ko=null;#Yo=null;#zt=null;#Jo=new Map;#Zo=null;#Qo=null;constructor({div:e,accessibilityManager:t,annotationCanvasMap:i,annotationEditorUIManager:n,page:a,viewport:s,structTreeLayer:r,commentManager:o,linkService:l,annotationStorage:c}){this.div=e,this.#Ko=t,this.#Yo=i,this.#Zo=r||null,this.#Qo=l||null,this.#zt=c||new AnnotationStorage,this.page=a,this.viewport=s,this.zIndex=0,this._annotationEditorUIManager=n,this._commentManager=o||null}hasEditableAnnotations(){return this.#Jo.size>0}async#el(e,t,i){const n=e.firstChild||e,a=n.id=`${mc}${t}`,s=await(this.#Zo?.getAriaAttributes(a));if(s)for(const[e,t]of s)n.setAttribute(e,t);i?i.at(-1).container.after(e):(this.div.append(e),this.#Ko?.moveElementInDOM(this.div,e,n,!1))}async render(e){const{annotations:t}=e,i=this.div;setLayerDimensions(i,this.viewport);const n=new Map,a={data:null,layer:i,linkService:this.#Qo,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new DOMSVGFactory,annotationStorage:this.#zt,enableComment:!0===e.enableComment,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const e of t){if(e.noHTML)continue;const t=e.annotationType===Zl.POPUP;if(t){const t=n.get(e.id);if(!t)continue;a.elements=t}else if(e.rect[2]===e.rect[0]||e.rect[3]===e.rect[1])continue;a.data=e;const i=AnnotationElementFactory.create(a);if(!i.isRenderable)continue;if(!t&&e.popupRef){const t=n.get(e.popupRef);t?t.push(i):n.set(e.popupRef,[i])}const s=i.render();e.hidden&&(s.style.visibility="hidden"),await this.#el(s,e.id,a.elements),i.extraPopupElement?.popup?.renderCommentButton(),i._isEditable&&(this.#Jo.set(i.data.id,i),this._annotationEditorUIManager?.renderAnnotationElement(i))}this.#tl()}async addLinkAnnotations(e){const t={data:null,layer:this.div,linkService:this.#Qo,svgFactory:new DOMSVGFactory,parent:this};for(const i of e){i.borderStyle||=AnnotationLayer._defaultBorderStyle,t.data=i;const e=AnnotationElementFactory.create(t);if(!e.isRenderable)continue;const n=e.render();await this.#el(n,i.id,null)}}update({viewport:e}){const t=this.div;this.viewport=e,setLayerDimensions(t,{rotation:e.rotation}),this.#tl(),t.hidden=!1}#tl(){if(!this.#Yo)return;const e=this.div;for(const[t,i]of this.#Yo){const n=e.querySelector(`[data-annotation-id="${t}"]`);if(!n)continue;i.className="annotationContent";const{firstChild:a}=n;a?"CANVAS"===a.nodeName?a.replaceWith(i):a.classList.contains("annotationContent")?a.after(i):a.before(i):n.append(i);const s=this.#Jo.get(t);s&&(s._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(t,n.id,i),s._hasNoCanvas=!1):s.canvas=i)}this.#Yo.clear()}getEditableAnnotations(){return Array.from(this.#Jo.values())}getEditableAnnotation(e){return this.#Jo.get(e)}addFakeAnnotation(e){const{div:t}=this,{id:i,rotation:n}=e,a=new EditorAnnotationElement({data:{id:i,rect:e.getPDFRect(),rotation:n},editor:e,layer:t,parent:this,enableComment:!!this._commentManager,linkService:this.#Qo,annotationStorage:this.#zt}),s=a.render();return t.append(s),this.#Ko?.moveElementInDOM(t,s,s,!1),a.createOrUpdatePopup(),a}static get _defaultBorderStyle(){return shadow(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:Ql,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}const gh=/\r\n?|\n/g;class FreeTextEditor extends AnnotationEditor{#il="";#nl=`${this.id}-editor`;#al=null;#Bo;_colorPicker=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const e=FreeTextEditor.prototype,arrowChecker=e=>e.isEmpty(),t=AnnotationEditorUIManager.TRANSLATE_SMALL,i=AnnotationEditorUIManager.TRANSLATE_BIG;return shadow(this,"_keyboardManager",new KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-t,0],checker:arrowChecker}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:arrowChecker}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[t,0],checker:arrowChecker}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[i,0],checker:arrowChecker}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-t],checker:arrowChecker}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:arrowChecker}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,t],checker:arrowChecker}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,i],checker:arrowChecker}]]))}static _type="freetext";static _editorType=Hl.FREETEXT;constructor(e){super({...e,name:"freeTextEditor"}),this.color=e.color||FreeTextEditor._defaultColor||AnnotationEditor._defaultLineColor,this.#Bo=e.fontSize||FreeTextEditor._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static initialize(e,t){AnnotationEditor.initialize(e,t);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case Xl.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=t;break;case Xl.FREETEXT_COLOR:FreeTextEditor._defaultColor=t}}updateParams(e,t){switch(e){case Xl.FREETEXT_SIZE:this.#sl(t);break;case Xl.FREETEXT_COLOR:this.#_o(t)}}static get defaultPropertiesToUpdate(){return[[Xl.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[Xl.FREETEXT_COLOR,FreeTextEditor._defaultColor||AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[Xl.FREETEXT_SIZE,this.#Bo],[Xl.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||=new BasicColorPicker(this),[["colorPicker",this._colorPicker]]}get colorType(){return Xl.FREETEXT_COLOR}#sl(e){const setFontsize=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--total-scale-factor))`,this.translate(0,-(e-this.#Bo)*this.parentScale),this.#Bo=e,this.#rl()},t=this.#Bo;this.addCommands({cmd:setFontsize.bind(this,e),undo:setFontsize.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Xl.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}#_o(e){const setColor=e=>{this.color=e,this.onUpdatedColor()},t=this.color;this.addCommands({cmd:setColor.bind(this,e),undo:setColor.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Xl.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){const e=this.parentScale;return[-FreeTextEditor._internalPadding*e,-(FreeTextEditor._internalPadding+this.#Bo)*e]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#al=new AbortController;const e=this._uiManager.combinedSignal(this.#al);return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e}),!0}disableEditMode(){return!!super.disableEditMode()&&(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#nl),this._isDraggable=!0,this.#al?.abort(),this.#al=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0)}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#ol(){const e=[];this.editorDiv.normalize();let t=null;for(const i of this.editorDiv.childNodes)t?.nodeType===Node.TEXT_NODE&&"BR"===i.nodeName||(e.push(FreeTextEditor.#ll(i)),t=i);return e.join("\n")}#rl(){const[e,t]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:e,div:t}=this,n=t.style.display,a=t.classList.contains("hidden");t.classList.remove("hidden"),t.style.display="hidden",e.div.append(this.div),i=t.getBoundingClientRect(),t.remove(),t.style.display=n,t.classList.toggle("hidden",a)}this.rotation%180==this.parentRotation%180?(this.width=i.width/e,this.height=i.height/t):(this.width=i.height/e,this.height=i.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#il,t=this.#il=this.#ol().trimEnd();if(e===t)return;const setText=e=>{this.#il=e,e?(this.#cl(),this._uiManager.rebuild(this),this.#rl()):this.remove()};this.addCommands({cmd:()=>{setText(t)},undo:()=>{setText(e)},mustExec:!1}),this.#rl()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&"Enter"===e.key&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){FreeTextEditor._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let e,t;(this._isCopy||this.annotationElementId)&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#nl),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#Bo}px * var(--total-scale-factor))`,i.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:a}=this._initialData;let[s,r]=this.getInitialTranslation();[s,r]=this.pageTranslationToScreen(s,r);const[o,l]=this.pageDimensions,[c,h]=this.pageTranslation;let d,u;switch(this.rotation){case 0:d=e+(a[0]-c)/o,u=t+this.height-(a[1]-h)/l;break;case 90:d=e+(a[0]-c)/o,u=t-(a[1]-h)/l,[s,r]=[r,-s];break;case 180:d=e-this.width+(a[0]-c)/o,u=t-(a[1]-h)/l,[s,r]=[-s,-r];break;case 270:d=e+(a[0]-c-this.height*l)/o,u=t+(a[1]-h-this.width*o)/l,[s,r]=[-r,s]}this.setAt(d*i,u*n,s,r)}else this._moveAfterPaste(e,t);this.#cl(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#ll(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(gh,"")}editorDivPaste(e){const t=e.clipboardData||window.clipboardData,{types:i}=t;if(1===i.length&&"text/plain"===i[0])return;e.preventDefault();const n=FreeTextEditor.#hl(t.getData("text")||"").replaceAll(gh,"\n");if(!n)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const s=a.getRangeAt(0);if(!n.includes("\n"))return s.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void a.collapseToStart();const{startContainer:r,startOffset:o}=s,l=[],c=[];if(r.nodeType===Node.TEXT_NODE){const e=r.parentElement;if(c.push(r.nodeValue.slice(o).replaceAll(gh,"")),e!==this.editorDiv){let t=l;for(const i of this.editorDiv.childNodes)i!==e?t.push(FreeTextEditor.#ll(i)):t=c}l.push(r.nodeValue.slice(0,o).replaceAll(gh,""))}else if(r===this.editorDiv){let e=l,t=0;for(const i of this.editorDiv.childNodes)t++===o&&(e=c),e.push(FreeTextEditor.#ll(i))}this.#il=`${l.join("\n")}${n}${c.join("\n")}`,this.#cl();const h=new Range;let d=Math.sumPrecise(l.map(e=>e.length));for(const{firstChild:e}of this.editorDiv.childNodes)if(e.nodeType===Node.TEXT_NODE){const t=e.nodeValue.length;if(d<=t){h.setStart(e,d),h.setEnd(e,d);break}d-=t}a.removeAllRanges(),a.addRange(h)}#cl(){if(this.editorDiv.replaceChildren(),this.#il)for(const e of this.#il.split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}#dl(){return this.#il.replaceAll(" "," ")}static#hl(e){return e.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}getPDFRect(){const e=FreeTextEditor._internalPadding*this.parentScale;return this.getRect(e,e)}static async deserialize(e,t,i){let n=null;if(e instanceof FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:t,fontColor:i},rect:a,rotation:s,id:r,popupRef:o,richText:l,contentsObj:c,creationDate:h,modificationDate:d},textContent:u,textPosition:g,parent:{page:{pageNumber:f}}}=e;if(!u||0===u.length)return null;n=e={annotationType:Hl.FREETEXT,color:Array.from(i),fontSize:t,value:u.join("\n"),position:g,pageIndex:f-1,rect:a.slice(0),rotation:s,annotationElementId:r,id:r,deleted:!1,popupRef:o,comment:c?.str||null,richText:l,creationDate:h,modificationDate:d}}const a=await super.deserialize(e,t,i);return a.#Bo=e.fontSize,a.color=Util.makeHexColor(...e.color),a.#il=FreeTextEditor.#hl(e.value),a._initialData=n,e.comment&&a.setCommentData(e),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const t=AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(e),{color:t,fontSize:this.#Bo,value:this.#dl()});return this.addComment(i),e?(i.isCopy=!0,i):this.annotationElementId&&!this.#ul(i)?null:(i.id=this.annotationElementId,i)}#ul(e){const{value:t,fontSize:i,color:n,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==t||e.fontSize!==i||e.color.some((e,t)=>e!==n[t])||e.pageIndex!==a}renderAnnotationElement(e){const t=super.renderAnnotationElement(e);if(!t)return null;const{style:i}=t;i.fontSize=`calc(${this.#Bo}px * var(--total-scale-factor))`,i.color=this.color,t.replaceChildren();for(const e of this.#il.split("\n")){const i=document.createElement("div");i.append(e?document.createTextNode(e):document.createElement("br")),t.append(i)}return e.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:this.#il}}),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}class Outline{static PRECISION=1e-4;toSVGPath(){unreachable("Abstract method `toSVGPath` must be implemented.")}get box(){unreachable("Abstract getter `box` must be implemented.")}serialize(e,t){unreachable("Abstract method `serialize` must be implemented.")}static _rescale(e,t,i,n,a,s){s||=new Float32Array(e.length);for(let r=0,o=e.length;r<o;r+=2)s[r]=t+e[r]*n,s[r+1]=i+e[r+1]*a;return s}static _rescaleAndSwap(e,t,i,n,a,s){s||=new Float32Array(e.length);for(let r=0,o=e.length;r<o;r+=2)s[r]=t+e[r+1]*n,s[r+1]=i+e[r]*a;return s}static _translate(e,t,i,n){n||=new Float32Array(e.length);for(let a=0,s=e.length;a<s;a+=2)n[a]=t+e[a],n[a+1]=i+e[a+1];return n}static svgRound(e){return Math.round(1e4*e)}static _normalizePoint(e,t,i,n,a){switch(a){case 90:return[1-t/i,e/n];case 180:return[1-e/i,1-t/n];case 270:return[t/i,1-e/n];default:return[e/i,t/n]}}static _normalizePagePoint(e,t,i){switch(i){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,i,n,a,s){return[(e+5*i)/6,(t+5*n)/6,(5*i+a)/6,(5*n+s)/6,(i+a)/2,(n+s)/2]}}class FreeDrawOutliner{#gl;#fl=[];#pl;#ml;#bl=[];#yl=new Float32Array(18);#wl;#Al;#xl;#Sl;#vl;#Cl;#kl=[];static#Tl=8;static#Fl=2;static#Il=FreeDrawOutliner.#Tl+FreeDrawOutliner.#Fl;constructor({x:e,y:t},i,n,a,s,r=0){this.#gl=i,this.#Cl=a*n,this.#ml=s,this.#yl.set([NaN,NaN,NaN,NaN,e,t],6),this.#pl=r,this.#Sl=FreeDrawOutliner.#Tl*n,this.#xl=FreeDrawOutliner.#Il*n,this.#vl=n,this.#kl.push(e,t)}isEmpty(){return isNaN(this.#yl[8])}#El(){const e=this.#yl.subarray(4,6),t=this.#yl.subarray(16,18),[i,n,a,s]=this.#gl;return[(this.#wl+(e[0]-t[0])/2-i)/a,(this.#Al+(e[1]-t[1])/2-n)/s,(this.#wl+(t[0]-e[0])/2-i)/a,(this.#Al+(t[1]-e[1])/2-n)/s]}add({x:e,y:t}){this.#wl=e,this.#Al=t;const[i,n,a,s]=this.#gl;let[r,o,l,c]=this.#yl.subarray(8,12);const h=e-l,d=t-c,u=Math.hypot(h,d);if(u<this.#xl)return!1;const g=u-this.#Sl,f=g/u,p=f*h,m=f*d;let b=r,y=o;r=l,o=c,l+=p,c+=m,this.#kl?.push(e,t);const w=p/g,x=-m/g*this.#Cl,S=w*this.#Cl;if(this.#yl.set(this.#yl.subarray(2,8),0),this.#yl.set([l+x,c+S],4),this.#yl.set(this.#yl.subarray(14,18),12),this.#yl.set([l-x,c-S],16),isNaN(this.#yl[6]))return 0===this.#bl.length&&(this.#yl.set([r+x,o+S],2),this.#bl.push(NaN,NaN,NaN,NaN,(r+x-i)/a,(o+S-n)/s),this.#yl.set([r-x,o-S],14),this.#fl.push(NaN,NaN,NaN,NaN,(r-x-i)/a,(o-S-n)/s)),this.#yl.set([b,y,r,o,l,c],6),!this.isEmpty();this.#yl.set([b,y,r,o,l,c],6);return Math.abs(Math.atan2(y-o,b-r)-Math.atan2(m,p))<Math.PI/2?([r,o,l,c]=this.#yl.subarray(2,6),this.#bl.push(NaN,NaN,NaN,NaN,((r+l)/2-i)/a,((o+c)/2-n)/s),[r,o,b,y]=this.#yl.subarray(14,18),this.#fl.push(NaN,NaN,NaN,NaN,((b+r)/2-i)/a,((y+o)/2-n)/s),!0):([b,y,r,o,l,c]=this.#yl.subarray(0,6),this.#bl.push(((b+5*r)/6-i)/a,((y+5*o)/6-n)/s,((5*r+l)/6-i)/a,((5*o+c)/6-n)/s,((r+l)/2-i)/a,((o+c)/2-n)/s),[l,c,r,o,b,y]=this.#yl.subarray(12,18),this.#fl.push(((b+5*r)/6-i)/a,((y+5*o)/6-n)/s,((5*r+l)/6-i)/a,((5*o+c)/6-n)/s,((r+l)/2-i)/a,((o+c)/2-n)/s),!0)}toSVGPath(){if(this.isEmpty())return"";const e=this.#bl,t=this.#fl;if(isNaN(this.#yl[6])&&!this.isEmpty())return this.#Ml();const i=[];i.push(`M${e[4]} ${e[5]}`);for(let t=6;t<e.length;t+=6)isNaN(e[t])?i.push(`L${e[t+4]} ${e[t+5]}`):i.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);this.#Dl(i);for(let e=t.length-6;e>=6;e-=6)isNaN(t[e])?i.push(`L${t[e+4]} ${t[e+5]}`):i.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);return this.#Ol(i),i.join(" ")}#Ml(){const[e,t,i,n]=this.#gl,[a,s,r,o]=this.#El();return`M${(this.#yl[2]-e)/i} ${(this.#yl[3]-t)/n} L${(this.#yl[4]-e)/i} ${(this.#yl[5]-t)/n} L${a} ${s} L${r} ${o} L${(this.#yl[16]-e)/i} ${(this.#yl[17]-t)/n} L${(this.#yl[14]-e)/i} ${(this.#yl[15]-t)/n} Z`}#Ol(e){const t=this.#fl;e.push(`L${t[4]} ${t[5]} Z`)}#Dl(e){const[t,i,n,a]=this.#gl,s=this.#yl.subarray(4,6),r=this.#yl.subarray(16,18),[o,l,c,h]=this.#El();e.push(`L${(s[0]-t)/n} ${(s[1]-i)/a} L${o} ${l} L${c} ${h} L${(r[0]-t)/n} ${(r[1]-i)/a}`)}newFreeDrawOutline(e,t,i,n,a,s){return new FreeDrawOutline(e,t,i,n,a,s)}getOutlines(){const e=this.#bl,t=this.#fl,i=this.#yl,[n,a,s,r]=this.#gl,o=new Float32Array((this.#kl?.length??0)+2);for(let e=0,t=o.length-2;e<t;e+=2)o[e]=(this.#kl[e]-n)/s,o[e+1]=(this.#kl[e+1]-a)/r;if(o[o.length-2]=(this.#wl-n)/s,o[o.length-1]=(this.#Al-a)/r,isNaN(i[6])&&!this.isEmpty())return this.#_l(o);const l=new Float32Array(this.#bl.length+24+this.#fl.length);let c=e.length;for(let t=0;t<c;t+=2)isNaN(e[t])?l[t]=l[t+1]=NaN:(l[t]=e[t],l[t+1]=e[t+1]);c=this.#Pl(l,c);for(let e=t.length-6;e>=6;e-=6)for(let i=0;i<6;i+=2)isNaN(t[e+i])?(l[c]=l[c+1]=NaN,c+=2):(l[c]=t[e+i],l[c+1]=t[e+i+1],c+=2);return this.#Rl(l,c),this.newFreeDrawOutline(l,o,this.#gl,this.#vl,this.#pl,this.#ml)}#_l(e){const t=this.#yl,[i,n,a,s]=this.#gl,[r,o,l,c]=this.#El(),h=new Float32Array(36);return h.set([NaN,NaN,NaN,NaN,(t[2]-i)/a,(t[3]-n)/s,NaN,NaN,NaN,NaN,(t[4]-i)/a,(t[5]-n)/s,NaN,NaN,NaN,NaN,r,o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,(t[16]-i)/a,(t[17]-n)/s,NaN,NaN,NaN,NaN,(t[14]-i)/a,(t[15]-n)/s],0),this.newFreeDrawOutline(h,e,this.#gl,this.#vl,this.#pl,this.#ml)}#Rl(e,t){const i=this.#fl;return e.set([NaN,NaN,NaN,NaN,i[4],i[5]],t),t+6}#Pl(e,t){const i=this.#yl.subarray(4,6),n=this.#yl.subarray(16,18),[a,s,r,o]=this.#gl,[l,c,h,d]=this.#El();return e.set([NaN,NaN,NaN,NaN,(i[0]-a)/r,(i[1]-s)/o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,h,d,NaN,NaN,NaN,NaN,(n[0]-a)/r,(n[1]-s)/o],t),t+24}}class FreeDrawOutline extends Outline{#gl;#Bl=new Float32Array(4);#pl;#ml;#kl;#vl;#Nl;constructor(e,t,i,n,a,s){super(),this.#Nl=e,this.#kl=t,this.#gl=i,this.#vl=n,this.#pl=a,this.#ml=s,this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],this.#Ll(s);const[r,o,l,c]=this.#Bl;for(let t=0,i=e.length;t<i;t+=2)e[t]=(e[t]-r)/l,e[t+1]=(e[t+1]-o)/c;for(let e=0,i=t.length;e<i;e+=2)t[e]=(t[e]-r)/l,t[e+1]=(t[e+1]-o)/c}toSVGPath(){const e=[`M${this.#Nl[4]} ${this.#Nl[5]}`];for(let t=6,i=this.#Nl.length;t<i;t+=6)isNaN(this.#Nl[t])?e.push(`L${this.#Nl[t+4]} ${this.#Nl[t+5]}`):e.push(`C${this.#Nl[t]} ${this.#Nl[t+1]} ${this.#Nl[t+2]} ${this.#Nl[t+3]} ${this.#Nl[t+4]} ${this.#Nl[t+5]}`);return e.push("Z"),e.join(" ")}serialize([e,t,i,n],a){const s=i-e,r=n-t;let o,l;switch(a){case 0:o=Outline._rescale(this.#Nl,e,n,s,-r),l=Outline._rescale(this.#kl,e,n,s,-r);break;case 90:o=Outline._rescaleAndSwap(this.#Nl,e,t,s,r),l=Outline._rescaleAndSwap(this.#kl,e,t,s,r);break;case 180:o=Outline._rescale(this.#Nl,i,t,-s,r),l=Outline._rescale(this.#kl,i,t,-s,r);break;case 270:o=Outline._rescaleAndSwap(this.#Nl,i,n,-s,-r),l=Outline._rescaleAndSwap(this.#kl,i,n,-s,-r)}return{outline:Array.from(o),points:[Array.from(l)]}}#Ll(e){const t=this.#Nl;let i=t[4],n=t[5];const a=[i,n,i,n];let s=i,r=n,o=i,l=n;const c=e?Math.max:Math.min,h=new Float32Array(4);for(let e=6,d=t.length;e<d;e+=6){const d=t[e+4],u=t[e+5];isNaN(t[e])?(Util.pointBoundingBox(d,u,a),r>u?(s=d,r=u):r===u&&(s=c(s,d)),l<u?(o=d,l=u):l===u&&(o=c(o,d))):(h[0]=h[1]=1/0,h[2]=h[3]=-1/0,Util.bezierBoundingBox(i,n,...t.slice(e,e+6),h),Util.rectBoundingBox(h[0],h[1],h[2],h[3],a),r>h[1]?(s=h[0],r=h[1]):r===h[1]&&(s=c(s,h[0])),l<h[3]?(o=h[2],l=h[3]):l===h[3]&&(o=c(o,h[2]))),i=d,n=u}const d=this.#Bl;d[0]=a[0]-this.#pl,d[1]=a[1]-this.#pl,d[2]=a[2]-a[0]+2*this.#pl,d[3]=a[3]-a[1]+2*this.#pl,this.firstPoint=[s,r],this.lastPoint=[o,l]}get box(){return this.#Bl}newOutliner(e,t,i,n,a,s=0){return new FreeDrawOutliner(e,t,i,n,a,s)}getNewOutline(e,t){const[i,n,a,s]=this.#Bl,[r,o,l,c]=this.#gl,h=a*l,d=s*c,u=i*l+r,g=n*c+o,f=this.newOutliner({x:this.#kl[0]*h+u,y:this.#kl[1]*d+g},this.#gl,this.#vl,e,this.#ml,t??this.#pl);for(let e=2;e<this.#kl.length;e+=2)f.add({x:this.#kl[e]*h+u,y:this.#kl[e+1]*d+g});return f.getOutlines()}}class HighlightOutliner{#gl;#Ul;#jl;#$l=[];#Hl=[];constructor(e,t=0,i=0,n=!0){const a=[1/0,1/0,-1/0,-1/0],s=1e-4;for(const{x:i,y:n,width:r,height:o}of e){const e=Math.floor((i-t)/s)*s,l=Math.ceil((i+r+t)/s)*s,c=Math.floor((n-t)/s)*s,h=Math.ceil((n+o+t)/s)*s,d=[e,c,h,!0],u=[l,c,h,!1];this.#$l.push(d,u),Util.rectBoundingBox(e,c,l,h,a)}const r=a[2]-a[0]+2*i,o=a[3]-a[1]+2*i,l=a[0]-i,c=a[1]-i;let h=n?-1/0:1/0,d=1/0;const u=this.#$l.at(n?-1:-2),g=[u[0],u[2]];for(const e of this.#$l){const[t,i,a,s]=e;!s&&n?i<d?(d=i,h=t):i===d&&(h=Math.max(h,t)):s&&!n&&(i<d?(d=i,h=t):i===d&&(h=Math.min(h,t))),e[0]=(t-l)/r,e[1]=(i-c)/o,e[2]=(a-c)/o}this.#gl=new Float32Array([l,c,r,o]),this.#Ul=[h,d],this.#jl=g}getOutlines(){this.#$l.sort((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2]);const e=[];for(const t of this.#$l)t[3]?(e.push(...this.#Xl(t)),this.#ql(t)):(this.#zl(t),e.push(...this.#Xl(t)));return this.#Wl(e)}#Wl(e){const t=[],i=new Set;for(const i of e){const[e,n,a]=i;t.push([e,n,i],[e,a,i])}t.sort((e,t)=>e[1]-t[1]||e[0]-t[0]);for(let e=0,n=t.length;e<n;e+=2){const n=t[e][2],a=t[e+1][2];n.push(a),a.push(n),i.add(n),i.add(a)}const n=[];let a;for(;i.size>0;){const e=i.values().next().value;let[t,s,r,o,l]=e;i.delete(e);let c=t,h=s;for(a=[t,r],n.push(a);;){let e;if(i.has(o))e=o;else{if(!i.has(l))break;e=l}i.delete(e),[t,s,r,o,l]=e,c!==t&&(a.push(c,h,t,h===s?s:r),c=t),h=h===s?r:s}a.push(c,h)}return new HighlightOutline(n,this.#gl,this.#Ul,this.#jl)}#Gl(e){const t=this.#Hl;let i=0,n=t.length-1;for(;i<=n;){const a=i+n>>1,s=t[a][0];if(s===e)return a;s<e?i=a+1:n=a-1}return n+1}#ql([,e,t]){const i=this.#Gl(e);this.#Hl.splice(i,0,[e,t])}#zl([,e,t]){const i=this.#Gl(e);for(let n=i;n<this.#Hl.length;n++){const[i,a]=this.#Hl[n];if(i!==e)break;if(i===e&&a===t)return void this.#Hl.splice(n,1)}for(let n=i-1;n>=0;n--){const[i,a]=this.#Hl[n];if(i!==e)break;if(i===e&&a===t)return void this.#Hl.splice(n,1)}}#Xl(e){const[t,i,n]=e,a=[[t,i,n]],s=this.#Gl(n);for(let e=0;e<s;e++){const[i,n]=this.#Hl[e];for(let e=0,s=a.length;e<s;e++){const[,r,o]=a[e];if(!(n<=r||o<=i))if(r>=i)if(o>n)a[e][1]=n;else{if(1===s)return[];a.splice(e,1),e--,s--}else a[e][2]=i,o>n&&a.push([t,n,o])}}return a}}class HighlightOutline extends Outline{#gl;#Vl;constructor(e,t,i,n){super(),this.#Vl=e,this.#gl=t,this.firstPoint=i,this.lastPoint=n}toSVGPath(){const e=[];for(const t of this.#Vl){let[i,n]=t;e.push(`M${i} ${n}`);for(let a=2;a<t.length;a+=2){const s=t[a],r=t[a+1];s===i?(e.push(`V${r}`),n=r):r===n&&(e.push(`H${s}`),i=s)}e.push("Z")}return e.join(" ")}serialize([e,t,i,n],a){const s=[],r=i-e,o=n-t;for(const t of this.#Vl){const i=new Array(t.length);for(let a=0;a<t.length;a+=2)i[a]=e+t[a]*r,i[a+1]=n-t[a+1]*o;s.push(i)}return s}get box(){return this.#gl}get classNamesForOutlining(){return["highlightOutline"]}}class FreeHighlightOutliner extends FreeDrawOutliner{newFreeDrawOutline(e,t,i,n,a,s){return new FreeHighlightOutline(e,t,i,n,a,s)}}class FreeHighlightOutline extends FreeDrawOutline{newOutliner(e,t,i,n,a,s=0){return new FreeHighlightOutliner(e,t,i,n,a,s)}}class HighlightEditor extends AnnotationEditor{#Kl=null;#Yl=0;#Jl;#Zl=null;#gt=null;#Ql=null;#ec=null;#tc=0;#ic=null;#nc=null;#Mt=null;#ac=!1;#Ul=null;#jl=null;#sc=null;#_e="";#Cl;#rc="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=Hl.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const e=HighlightEditor.prototype;return shadow(this,"_keyboardManager",new KeyboardManager([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:"highlightEditor"}),this.color=e.color||HighlightEditor._defaultColor,this.#Cl=e.thickness||HighlightEditor._defaultThickness,this.opacity=e.opacity||HighlightEditor._defaultOpacity,this.#Jl=e.boxes||null,this.#rc=e.methodOfCreation||"",this.#_e=e.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",e.highlightId>-1?(this.#ac=!0,this.#oc(e),this.#lc()):this.#Jl&&(this.#Kl=e.anchorNode,this.#Yl=e.anchorOffset,this.#ec=e.focusNode,this.#tc=e.focusOffset,this.#cc(),this.#lc(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}get telemetryInitialData(){return{action:"added",type:this.#ac?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:this.#Cl,methodOfCreation:this.#rc}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}#cc(){const e=new HighlightOutliner(this.#Jl,.001);this.#nc=e.getOutlines(),[this.x,this.y,this.width,this.height]=this.#nc.box;const t=new HighlightOutliner(this.#Jl,.0025,.001,"ltr"===this._uiManager.direction);this.#Ql=t.getOutlines();const{firstPoint:i}=this.#nc;this.#Ul=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height];const{lastPoint:n}=this.#Ql;this.#jl=[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height]}#oc({highlightOutlines:e,highlightId:t,clipPathId:i}){this.#nc=e;if(this.#Ql=e.getNewOutline(this.#Cl/2+1.5,.0025),t>=0)this.#Mt=t,this.#Zl=i,this.parent.drawLayer.finalizeDraw(t,{bbox:e.box,path:{d:e.toSVGPath()}}),this.#sc=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#Ql.box,path:{d:this.#Ql.toSVGPath()}},!0);else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#Mt,{bbox:HighlightEditor.#hc(this.#nc.box,(t-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#sc,{bbox:HighlightEditor.#hc(this.#Ql.box,t),path:{d:this.#Ql.toSVGPath()}})}const[n,a,s,r]=e.box;switch(this.rotation){case 0:this.x=n,this.y=a,this.width=s,this.height=r;break;case 90:{const[e,t]=this.parentDimensions;this.x=a,this.y=1-n,this.width=s*t/e,this.height=r*e/t;break}case 180:this.x=1-n,this.y=1-a,this.width=s,this.height=r;break;case 270:{const[e,t]=this.parentDimensions;this.x=1-a,this.y=n,this.width=s*t/e,this.height=r*e/t;break}}const{firstPoint:o}=e;this.#Ul=[(o[0]-n)/s,(o[1]-a)/r];const{lastPoint:l}=this.#Ql;this.#jl=[(l[0]-n)/s,(l[1]-a)/r]}static initialize(e,t){AnnotationEditor.initialize(e,t),HighlightEditor._defaultColor||=t.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(e,t){switch(e){case Xl.HIGHLIGHT_COLOR:HighlightEditor._defaultColor=t;break;case Xl.HIGHLIGHT_THICKNESS:HighlightEditor._defaultThickness=t}}translateInPage(e,t){}get toolbarPosition(){return this.#jl}get commentButtonPosition(){return this.#Ul}updateParams(e,t){switch(e){case Xl.HIGHLIGHT_COLOR:this.#_o(t);break;case Xl.HIGHLIGHT_THICKNESS:this.#dc(t)}}static get defaultPropertiesToUpdate(){return[[Xl.HIGHLIGHT_COLOR,HighlightEditor._defaultColor],[Xl.HIGHLIGHT_THICKNESS,HighlightEditor._defaultThickness]]}get propertiesToUpdate(){return[[Xl.HIGHLIGHT_COLOR,this.color||HighlightEditor._defaultColor],[Xl.HIGHLIGHT_THICKNESS,this.#Cl||HighlightEditor._defaultThickness],[Xl.HIGHLIGHT_FREE,this.#ac]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(this.#Mt,{root:{fill:this.color,"fill-opacity":this.opacity}}),this.#gt?.updateColor(this.color),super.onUpdatedColor()}#_o(e){const setColorAndOpacity=(e,t)=>{this.color=e,this.opacity=t,this.onUpdatedColor()},t=this.color,i=this.opacity;this.addCommands({cmd:setColorAndOpacity.bind(this,e,HighlightEditor._defaultOpacity),undo:setColorAndOpacity.bind(this,t,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Xl.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(e)},!0)}#dc(e){const t=this.#Cl,setThickness=e=>{this.#Cl=e,this.#uc(e)};this.addCommands({cmd:setThickness.bind(this,e),undo:setThickness.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Xl.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)}get toolbarButtons(){if(this._uiManager.highlightColors){return[["colorPicker",this.#gt=new ColorPicker({editor:this})]]}return super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#gc())}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,this.#gc())}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this.#fc(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#lc(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?this.#fc():e&&(this.#lc(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),t&&this.select()}#uc(e){this.#ac&&(this.#oc({highlightOutlines:this.#nc.getNewOutline(e/2)}),this.fixAndSetPosition(),this.setDims(this.width,this.height))}#fc(){null!==this.#Mt&&this.parent&&(this.parent.drawLayer.remove(this.#Mt),this.#Mt=null,this.parent.drawLayer.remove(this.#sc),this.#sc=null)}#lc(e=this.parent){null===this.#Mt&&(({id:this.#Mt,clipPathId:this.#Zl}=e.drawLayer.draw({bbox:this.#nc.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:this.#ac},path:{d:this.#nc.toSVGPath()}},!1,!0)),this.#sc=e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#ac},bbox:this.#Ql.box,path:{d:this.#Ql.toSVGPath()}},this.#ac),this.#ic&&(this.#ic.style.clipPath=this.#Zl))}static#hc([e,t,i,n],a){switch(a){case 90:return[1-t-n,e,n,i];case 180:return[1-e-i,1-t-n,i,n];case 270:return[t,1-e-i,n,i]}return[e,t,i,n]}rotate(e){const{drawLayer:t}=this.parent;let i;this.#ac?(e=(e-this.rotation+360)%360,i=HighlightEditor.#hc(this.#nc.box,e)):i=HighlightEditor.#hc([this.x,this.y,this.width,this.height],e),t.updateProperties(this.#Mt,{bbox:i,root:{"data-main-rotation":e}}),t.updateProperties(this.#sc,{bbox:HighlightEditor.#hc(this.#Ql.box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;const e=super.render();this.#_e&&(e.setAttribute("aria-label",this.#_e),e.setAttribute("role","mark")),this.#ac?e.classList.add("free"):this.div.addEventListener("keydown",this.#pc.bind(this),{signal:this._uiManager._signal});const t=this.#ic=document.createElement("div");return e.append(t),t.setAttribute("aria-hidden","true"),t.className="internal",t.style.clipPath=this.#Zl,this.setDims(this.width,this.height),bindEvents(this,this.#ic,["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#sc,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#sc,{rootClass:{hovered:!1}})}#pc(e){HighlightEditor._keyboardManager.exec(this,e)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#mc(!0);break;case 1:case 3:this.#mc(!1)}}#mc(e){if(!this.#Kl)return;const t=window.getSelection();e?t.setPosition(this.#Kl,this.#Yl):t.setPosition(this.#ec,this.#tc)}select(){super.select(),this.#sc&&this.parent?.drawLayer.updateProperties(this.#sc,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#sc&&(this.parent?.drawLayer.updateProperties(this.#sc,{rootClass:{selected:!1}}),this.#ac||this.#mc(!1))}get _mustFixPosition(){return!this.#ac}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(this.#Mt,{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(this.#sc,{rootClass:{hidden:!e}}))}#gc(){return this.#ac?this.rotation:0}#bc(){if(this.#ac)return null;const[e,t]=this.pageDimensions,[i,n]=this.pageTranslation,a=this.#Jl,s=new Float32Array(8*a.length);let r=0;for(const{x:o,y:l,width:c,height:h}of a){const a=o*e+i,d=(1-l)*t+n;s[r]=s[r+4]=a,s[r+1]=s[r+3]=d,s[r+2]=s[r+6]=a+c*e,s[r+5]=s[r+7]=d-h*t,r+=8}return s}#yc(e){return this.#nc.serialize(e,this.#gc())}static startHighlighting(e,t,{target:i,x:n,y:a}){const{x:s,y:r,width:o,height:l}=i.getBoundingClientRect(),c=new AbortController,h=e.combinedSignal(c),pointerUpCallback=t=>{c.abort(),this.#wc(e,t)};window.addEventListener("blur",pointerUpCallback,{signal:h}),window.addEventListener("pointerup",pointerUpCallback,{signal:h}),window.addEventListener("pointerdown",stopEvent,{capture:!0,passive:!1,signal:h}),window.addEventListener("contextmenu",noContextMenu,{signal:h}),i.addEventListener("pointermove",this.#Ac.bind(this,e),{signal:h}),this._freeHighlight=new FreeHighlightOutliner({x:n,y:a},[s,r,o,l],e.scale,this._defaultThickness/2,t,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0))}static#Ac(e,t){this._freeHighlight.add(t)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#wc(e,t){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(t,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(e,t,i){let n=null;if(e instanceof HighlightAnnotationElement){const{data:{quadPoints:t,rect:i,rotation:a,id:s,color:r,opacity:o,popupRef:l,richText:c,contentsObj:h,creationDate:d,modificationDate:u},parent:{page:{pageNumber:g}}}=e;n=e={annotationType:Hl.HIGHLIGHT,color:Array.from(r),opacity:o,quadPoints:t,boxes:null,pageIndex:g-1,rect:i.slice(0),rotation:a,annotationElementId:s,id:s,deleted:!1,popupRef:l,richText:c,comment:h?.str||null,creationDate:d,modificationDate:u}}else if(e instanceof InkAnnotationElement){const{data:{inkLists:t,rect:i,rotation:a,id:s,color:r,borderStyle:{rawWidth:o},popupRef:l,richText:c,contentsObj:h,creationDate:d,modificationDate:u},parent:{page:{pageNumber:g}}}=e;n=e={annotationType:Hl.HIGHLIGHT,color:Array.from(r),thickness:o,inkLists:t,boxes:null,pageIndex:g-1,rect:i.slice(0),rotation:a,annotationElementId:s,id:s,deleted:!1,popupRef:l,richText:c,comment:h?.str||null,creationDate:d,modificationDate:u}}const{color:a,quadPoints:s,inkLists:r,opacity:o}=e,l=await super.deserialize(e,t,i);l.color=Util.makeHexColor(...a),l.opacity=o||1,r&&(l.#Cl=e.thickness),l._initialData=n,e.comment&&l.setCommentData(e);const[c,h]=l.pageDimensions,[d,u]=l.pageTranslation;if(s){const e=l.#Jl=[];for(let t=0;t<s.length;t+=8)e.push({x:(s[t]-d)/c,y:1-(s[t+1]-u)/h,width:(s[t+2]-s[t])/c,height:(s[t+1]-s[t+5])/h});l.#cc(),l.#lc(),l.rotate(l.rotation)}else if(r){l.#ac=!0;const e=r[0],i={x:e[0]-d,y:h-(e[1]-u)},n=new FreeHighlightOutliner(i,[0,0,c,h],1,l.#Cl/2,!0,.001);for(let t=0,a=e.length;t<a;t+=2)i.x=e[t]-d,i.y=h-(e[t+1]-u),n.add(i);const{id:a,clipPathId:s}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:l.color,"fill-opacity":l._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:n.toSVGPath()}},!0,!0);l.#oc({highlightOutlines:n.getOutlines(),highlightId:a,clipPathId:s}),l.#lc(),l.rotate(l.parentRotation)}return l}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();const t=AnnotationEditor._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i=super.serialize(e);return Object.assign(i,{color:t,opacity:this.opacity,thickness:this.#Cl,quadPoints:this.#bc(),outlines:this.#yc(i.rect)}),this.addComment(i),this.annotationElementId&&!this.#ul(i)?null:(i.id=this.annotationElementId,i)}#ul(e){const{color:t}=this._initialData;return this.hasEditedComment||e.color.some((e,i)=>e!==t[i])}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}}class DrawingOptions{#xc=Object.create(null);updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(const[t,i]of Object.entries(e))t.startsWith("_")||this.updateProperty(t,i)}updateSVGProperty(e,t){this.#xc[e]=t}toSVGProperties(){const e=this.#xc;return this.#xc=Object.create(null),{root:e}}reset(){this.#xc=Object.create(null)}updateAll(e=this){this.updateProperties(e)}clone(){unreachable("Not implemented")}}class DrawingEditor extends AnnotationEditor{#Sc=null;#vc;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#Cc=null;static#kc=null;static#Tc=null;static#Fc=NaN;static#Ic=null;static#Ec=null;static#Mc=NaN;static _INNER_MARGIN=3;constructor(e){super(e),this.#vc=e.mustBeCommitted||!1,this._addOutlines(e)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}_addOutlines(e){e.drawOutlines&&(this.#Dc(e),this.#lc())}#Dc({drawOutlines:e,drawId:t,drawingOptions:i}){this.#Sc=e,this._drawingOptions||=i,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),t>=0?(this._drawId=t,this.parent.drawLayer.finalizeDraw(t,e.defaultProperties)):this._drawId=this.#Oc(e,this.parent),this.#_c(e.box)}#Oc(e,t){const{id:i}=t.drawLayer.draw(DrawingEditor._mergeSVGProperties(this._drawingOptions.toSVGProperties(),e.defaultSVGProperties),!1,!1);return i}static _mergeSVGProperties(e,t){const i=new Set(Object.keys(e));for(const[n,a]of Object.entries(t))i.has(n)?Object.assign(e[n],a):e[n]=a;return e}static getDefaultDrawingOptions(e){unreachable("Not implemented")}static get typesMap(){unreachable("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(e,t){const i=this.typesMap.get(e);i&&this._defaultDrawingOptions.updateProperty(i,t),this._currentParent&&(DrawingEditor.#Cc.updateProperty(i,t),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,t){const i=this.constructor.typesMap.get(e);i&&this._updateProperty(e,i,t)}static get defaultPropertiesToUpdate(){const e=[],t=this._defaultDrawingOptions;for(const[i,n]of this.typesMap)e.push([i,t[n]]);return e}get propertiesToUpdate(){const e=[],{_drawingOptions:t}=this;for(const[i,n]of this.constructor.typesMap)e.push([i,t[n]]);return e}_updateProperty(e,t,i){const n=this._drawingOptions,a=n[t],setter=i=>{n.updateProperty(t,i);const a=this.#Sc.updateProperty(t,i);a&&this.#_c(a),this.parent?.drawLayer.updateProperties(this._drawId,n.toSVGProperties()),e===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:setter.bind(this,i),undo:setter.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,DrawingEditor._mergeSVGProperties(this.#Sc.getPathResizingSVGProperties(this.#Pc()),{bbox:this.#Rc()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,DrawingEditor._mergeSVGProperties(this.#Sc.getPathResizedSVGProperties(this.#Pc()),{bbox:this.#Rc()}))}_onTranslating(e,t){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#Rc()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,DrawingEditor._mergeSVGProperties(this.#Sc.getPathTranslatedSVGProperties(this.#Pc(),this.parentDimensions),{bbox:this.#Rc()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#vc&&(this.#vc=!1,this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){this.#fc(),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#lc(),this.#_c(this.#Sc.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),this.#fc()):e&&(this._uiManager.addShouldRescale(this),this.#lc(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),t&&this.select()}#fc(){null!==this._drawId&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#lc(e=this.parent){null!==this._drawId&&this.parent===e||(null===this._drawId?(this._drawingOptions.updateAll(),this._drawId=this.#Oc(this.#Sc,e)):this.parent.drawLayer.updateParent(this._drawId,e.drawLayer))}#Bc([e,t,i,n]){const{parentDimensions:[a,s],rotation:r}=this;switch(r){case 90:return[t,1-e,i*(s/a),n*(a/s)];case 180:return[1-e,1-t,i,n];case 270:return[1-t,e,i*(s/a),n*(a/s)];default:return[e,t,i,n]}}#Pc(){const{x:e,y:t,width:i,height:n,parentDimensions:[a,s],rotation:r}=this;switch(r){case 90:return[1-t,e,i*(a/s),n*(s/a)];case 180:return[1-e,1-t,i,n];case 270:return[t,1-e,i*(a/s),n*(s/a)];default:return[e,t,i,n]}}#_c(e){[this.x,this.y,this.width,this.height]=this.#Bc(e),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}#Rc(){const{x:e,y:t,width:i,height:n,rotation:a,parentRotation:s,parentDimensions:[r,o]}=this;switch((4*a+s)/90){case 1:return[1-t-n,e,n,i];case 2:return[1-e-i,1-t-n,i,n];case 3:return[t,1-e-i,n,i];case 4:return[e,t-i*(r/o),n*(o/r),i*(r/o)];case 5:return[1-t,e,i*(r/o),n*(o/r)];case 6:return[1-e-n*(o/r),1-t,n*(o/r),i*(r/o)];case 7:return[t-i*(r/o),1-e-n*(o/r),i*(r/o),n*(o/r)];case 8:return[e-i,t-n,i,n];case 9:return[1-t,e-i,n,i];case 10:return[1-e,1-t,i,n];case 11:return[t-n,1-e,n,i];case 12:return[e-n*(o/r),t,n*(o/r),i*(r/o)];case 13:return[1-t-i*(r/o),e-n*(o/r),i*(r/o),n*(o/r)];case 14:return[1-e,1-t-i*(r/o),n*(o/r),i*(r/o)];case 15:return[t,1-e,i*(r/o),n*(o/r)];default:return[e,t,i,n]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,DrawingEditor._mergeSVGProperties({bbox:this.#Rc()},this.#Sc.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#_c(this.#Sc.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e,t;this._isCopy&&(e=this.x,t=this.y);const i=super.render();i.classList.add("draw");const n=document.createElement("div");return i.append(n),n.setAttribute("aria-hidden","true"),n.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,t),i}static createDrawerInstance(e,t,i,n,a){unreachable("Not implemented")}static startDrawing(e,t,i,n){const{target:a,offsetX:s,offsetY:r,pointerId:o,pointerType:l}=n;if(DrawingEditor.#Ic&&DrawingEditor.#Ic!==l)return;const{viewport:{rotation:c}}=e,{width:h,height:d}=a.getBoundingClientRect(),u=DrawingEditor.#kc=new AbortController,g=e.combinedSignal(u);DrawingEditor.#Fc||=o,DrawingEditor.#Ic??=l,window.addEventListener("pointerup",e=>{DrawingEditor.#Fc===e.pointerId?this._endDraw(e):DrawingEditor.#Ec?.delete(e.pointerId)},{signal:g}),window.addEventListener("pointercancel",e=>{DrawingEditor.#Fc===e.pointerId?this._currentParent.endDrawingSession():DrawingEditor.#Ec?.delete(e.pointerId)},{signal:g}),window.addEventListener("pointerdown",e=>{DrawingEditor.#Ic===e.pointerType&&((DrawingEditor.#Ec||=new Set).add(e.pointerId),DrawingEditor.#Cc.isCancellable()&&(DrawingEditor.#Cc.removeLastElement(),DrawingEditor.#Cc.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:g}),window.addEventListener("contextmenu",noContextMenu,{signal:g}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:g}),a.addEventListener("touchmove",e=>{e.timeStamp===DrawingEditor.#Mc&&stopEvent(e)},{signal:g}),e.toggleDrawing(),t._editorUndoBar?.hide(),DrawingEditor.#Cc?e.drawLayer.updateProperties(this._currentDrawId,DrawingEditor.#Cc.startNew(s,r,h,d,c)):(t.updateUIForDefaultProperties(this),DrawingEditor.#Cc=this.createDrawerInstance(s,r,h,d,c),DrawingEditor.#Tc=this.getDefaultDrawingOptions(),this._currentParent=e,({id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(DrawingEditor.#Tc.toSVGProperties(),DrawingEditor.#Cc.defaultSVGProperties),!0,!1)))}static _drawMove(e){if(DrawingEditor.#Mc=-1,!DrawingEditor.#Cc)return;const{offsetX:t,offsetY:i,pointerId:n}=e;DrawingEditor.#Fc===n&&(DrawingEditor.#Ec?.size>=1?this._endDraw(e):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,DrawingEditor.#Cc.add(t,i)),DrawingEditor.#Mc=e.timeStamp,stopEvent(e)))}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,DrawingEditor.#Cc=null,DrawingEditor.#Tc=null,DrawingEditor.#Ic=null,DrawingEditor.#Mc=NaN),DrawingEditor.#kc&&(DrawingEditor.#kc.abort(),DrawingEditor.#kc=null,DrawingEditor.#Fc=NaN,DrawingEditor.#Ec=null)}static _endDraw(e){const t=this._currentParent;if(t){if(t.toggleDrawing(!0),this._cleanup(!1),e?.target===t.div&&t.drawLayer.updateProperties(this._currentDrawId,DrawingEditor.#Cc.end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){const e=DrawingEditor.#Cc,i=this._currentDrawId,n=e.getLastElement();return void t.addCommands({cmd:()=>{t.drawLayer.updateProperties(i,e.setLastElement(n))},undo:()=>{t.drawLayer.updateProperties(i,e.removeLastElement())},mustExec:!1,type:Xl.DRAW_STEP})}this.endDrawing(!1)}}static endDrawing(e){const t=this._currentParent;if(!t)return null;if(t.toggleDrawing(!0),t.cleanUndoStack(Xl.DRAW_STEP),!DrawingEditor.#Cc.isEmpty()){const{pageDimensions:[i,n],scale:a}=t,s=t.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:DrawingEditor.#Cc.getOutlines(i*a,n*a,a,this._INNER_MARGIN),drawingOptions:DrawingEditor.#Tc,mustBeCommitted:!e});return this._cleanup(!0),s}return t.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,t,i,n,a,s){unreachable("Not implemented")}static async deserialize(e,t,i){const{rawDims:{pageWidth:n,pageHeight:a,pageX:s,pageY:r}}=t.viewport,o=this.deserializeDraw(s,r,n,a,this._INNER_MARGIN,e),l=await super.deserialize(e,t,i);return l.createDrawingOptions(e),l.#Dc({drawOutlines:o}),l.#lc(),l.onScaleChanging(),l.rotate(),l}serializeDraw(e){const[t,i]=this.pageTranslation,[n,a]=this.pageDimensions;return this.#Sc.serialize([t,i,n,a],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}}class InkDrawOutliner{#yl=new Float64Array(6);#jo;#Nc;#Ks;#Cl;#kl;#Lc="";#Uc=0;#Vl=new InkDrawOutline;#jc;#$c;constructor(e,t,i,n,a,s){this.#jc=i,this.#$c=n,this.#Ks=a,this.#Cl=s,[e,t]=this.#Hc(e,t);const r=this.#jo=[NaN,NaN,NaN,NaN,e,t];this.#kl=[e,t],this.#Nc=[{line:r,points:this.#kl}],this.#yl.set(r,0)}updateProperty(e,t){"stroke-width"===e&&(this.#Cl=t)}#Hc(e,t){return Outline._normalizePoint(e,t,this.#jc,this.#$c,this.#Ks)}isEmpty(){return!this.#Nc||0===this.#Nc.length}isCancellable(){return this.#kl.length<=10}add(e,t){[e,t]=this.#Hc(e,t);const[i,n,a,s]=this.#yl.subarray(2,6),r=e-a,o=t-s;return Math.hypot(this.#jc*r,this.#$c*o)<=2?null:(this.#kl.push(e,t),isNaN(i)?(this.#yl.set([a,s,e,t],2),this.#jo.push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(this.#yl[0])&&this.#jo.splice(6,6),this.#yl.set([i,n,a,s,e,t],0),this.#jo.push(...Outline.createBezierPoints(i,n,a,s,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){const i=this.add(e,t);return i||(2===this.#kl.length?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,i,n,a){this.#jc=i,this.#$c=n,this.#Ks=a,[e,t]=this.#Hc(e,t);const s=this.#jo=[NaN,NaN,NaN,NaN,e,t];this.#kl=[e,t];const r=this.#Nc.at(-1);return r&&(r.line=new Float32Array(r.line),r.points=new Float32Array(r.points)),this.#Nc.push({line:s,points:this.#kl}),this.#yl.set(s,0),this.#Uc=0,this.toSVGPath(),null}getLastElement(){return this.#Nc.at(-1)}setLastElement(e){return this.#Nc?(this.#Nc.push(e),this.#jo=e.line,this.#kl=e.points,this.#Uc=0,{path:{d:this.toSVGPath()}}):this.#Vl.setLastElement(e)}removeLastElement(){if(!this.#Nc)return this.#Vl.removeLastElement();this.#Nc.pop(),this.#Lc="";for(let e=0,t=this.#Nc.length;e<t;e++){const{line:t,points:i}=this.#Nc[e];this.#jo=t,this.#kl=i,this.#Uc=0,this.toSVGPath()}return{path:{d:this.#Lc}}}toSVGPath(){const e=Outline.svgRound(this.#jo[4]),t=Outline.svgRound(this.#jo[5]);if(2===this.#kl.length)return this.#Lc=`${this.#Lc} M ${e} ${t} Z`,this.#Lc;if(this.#kl.length<=6){const i=this.#Lc.lastIndexOf("M");this.#Lc=`${this.#Lc.slice(0,i)} M ${e} ${t}`,this.#Uc=6}if(4===this.#kl.length){const e=Outline.svgRound(this.#jo[10]),t=Outline.svgRound(this.#jo[11]);return this.#Lc=`${this.#Lc} L ${e} ${t}`,this.#Uc=12,this.#Lc}const i=[];0===this.#Uc&&(i.push(`M ${e} ${t}`),this.#Uc=6);for(let e=this.#Uc,t=this.#jo.length;e<t;e+=6){const[t,n,a,s,r,o]=this.#jo.slice(e,e+6).map(Outline.svgRound);i.push(`C${t} ${n} ${a} ${s} ${r} ${o}`)}return this.#Lc+=i.join(" "),this.#Uc=this.#jo.length,this.#Lc}getOutlines(e,t,i,n){const a=this.#Nc.at(-1);return a.line=new Float32Array(a.line),a.points=new Float32Array(a.points),this.#Vl.build(this.#Nc,e,t,i,this.#Ks,this.#Cl,n),this.#yl=null,this.#jo=null,this.#Nc=null,this.#Lc=null,this.#Vl}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}class InkDrawOutline extends Outline{#Bl;#Xc=0;#pl;#Nc;#jc;#$c;#qc;#Ks;#Cl;build(e,t,i,n,a,s,r){this.#jc=t,this.#$c=i,this.#qc=n,this.#Ks=a,this.#Cl=s,this.#pl=r??0,this.#Nc=e,this.#zc()}get thickness(){return this.#Cl}setLastElement(e){return this.#Nc.push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#Nc.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const e=[];for(const{line:t}of this.#Nc)if(e.push(`M${Outline.svgRound(t[4])} ${Outline.svgRound(t[5])}`),6!==t.length)if(12===t.length&&isNaN(t[6]))e.push(`L${Outline.svgRound(t[10])} ${Outline.svgRound(t[11])}`);else for(let i=6,n=t.length;i<n;i+=6){const[n,a,s,r,o,l]=t.subarray(i,i+6).map(Outline.svgRound);e.push(`C${n} ${a} ${s} ${r} ${o} ${l}`)}else e.push("Z");return e.join("")}serialize([e,t,i,n],a){const s=[],r=[],[o,l,c,h]=this.#Wc();let d,u,g,f,p,m,b,y,w;switch(this.#Ks){case 0:w=Outline._rescale,d=e,u=t+n,g=i,f=-n,p=e+o*i,m=t+(1-l-h)*n,b=e+(o+c)*i,y=t+(1-l)*n;break;case 90:w=Outline._rescaleAndSwap,d=e,u=t,g=i,f=n,p=e+l*i,m=t+o*n,b=e+(l+h)*i,y=t+(o+c)*n;break;case 180:w=Outline._rescale,d=e+i,u=t,g=-i,f=n,p=e+(1-o-c)*i,m=t+l*n,b=e+(1-o)*i,y=t+(l+h)*n;break;case 270:w=Outline._rescaleAndSwap,d=e+i,u=t+n,g=-i,f=-n,p=e+(1-l-h)*i,m=t+(1-o-c)*n,b=e+(1-l)*i,y=t+(1-o)*n}for(const{line:e,points:t}of this.#Nc)s.push(w(e,d,u,g,f,a?new Array(e.length):null)),r.push(w(t,d,u,g,f,a?new Array(t.length):null));return{lines:s,points:r,rect:[p,m,b,y]}}static deserialize(e,t,i,n,a,{paths:{lines:s,points:r},rotation:o,thickness:l}){const c=[];let h,d,u,g,f;switch(o){case 0:f=Outline._rescale,h=-e/i,d=t/n+1,u=1/i,g=-1/n;break;case 90:f=Outline._rescaleAndSwap,h=-t/n,d=-e/i,u=1/n,g=1/i;break;case 180:f=Outline._rescale,h=e/i+1,d=-t/n,u=-1/i,g=1/n;break;case 270:f=Outline._rescaleAndSwap,h=t/n+1,d=e/i+1,u=-1/n,g=-1/i}if(!s){s=[];for(const e of r){const t=e.length;if(2===t){s.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1]]));continue}if(4===t){s.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1],NaN,NaN,NaN,NaN,e[2],e[3]]));continue}const i=new Float32Array(3*(t-2));s.push(i);let[n,a,r,o]=e.subarray(0,4);i.set([NaN,NaN,NaN,NaN,n,a],0);for(let s=4;s<t;s+=2){const t=e[s],l=e[s+1];i.set(Outline.createBezierPoints(n,a,r,o,t,l),3*(s-2)),[n,a,r,o]=[r,o,t,l]}}}for(let e=0,t=s.length;e<t;e++)c.push({line:f(s[e].map(e=>e??NaN),h,d,u,g),points:f(r[e].map(e=>e??NaN),h,d,u,g)});const p=new this.prototype.constructor;return p.build(c,i,n,1,o,l,a),p}#Gc(e=this.#Cl){const t=this.#pl+e/2*this.#qc;return this.#Ks%180==0?[t/this.#jc,t/this.#$c]:[t/this.#$c,t/this.#jc]}#Wc(){const[e,t,i,n]=this.#Bl,[a,s]=this.#Gc(0);return[e+a,t+s,i-2*a,n-2*s]}#zc(){const e=this.#Bl=new Float32Array([1/0,1/0,-1/0,-1/0]);for(const{line:t}of this.#Nc){if(t.length<=12){for(let i=4,n=t.length;i<n;i+=6)Util.pointBoundingBox(t[i],t[i+1],e);continue}let i=t[4],n=t[5];for(let a=6,s=t.length;a<s;a+=6){const[s,r,o,l,c,h]=t.subarray(a,a+6);Util.bezierBoundingBox(i,n,s,r,o,l,c,h,e),i=c,n=h}}const[t,i]=this.#Gc();e[0]=MathClamp(e[0]-t,0,1),e[1]=MathClamp(e[1]-i,0,1),e[2]=MathClamp(e[2]+t,0,1),e[3]=MathClamp(e[3]+i,0,1),e[2]-=e[0],e[3]-=e[1]}get box(){return this.#Bl}updateProperty(e,t){return"stroke-width"===e?this.#dc(t):null}#dc(e){const[t,i]=this.#Gc();this.#Cl=e;const[n,a]=this.#Gc(),[s,r]=[n-t,a-i],o=this.#Bl;return o[0]-=s,o[1]-=r,o[2]+=2*s,o[3]+=2*r,o}updateParentDimensions([e,t],i){const[n,a]=this.#Gc();this.#jc=e,this.#$c=t,this.#qc=i;const[s,r]=this.#Gc(),o=s-n,l=r-a,c=this.#Bl;return c[0]-=o,c[1]-=l,c[2]+=2*o,c[3]+=2*l,c}updateRotation(e){return this.#Xc=e,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#Bl.map(Outline.svgRound).join(" ")}get defaultProperties(){const[e,t]=this.#Bl;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Outline.svgRound(e)} ${Outline.svgRound(t)}`}}}get rotationTransform(){const[,,e,t]=this.#Bl;let i=0,n=0,a=0,s=0,r=0,o=0;switch(this.#Xc){case 90:n=t/e,a=-e/t,r=e;break;case 180:i=-1,s=-1,r=e,o=t;break;case 270:n=-t/e,a=e/t,o=t;break;default:return""}return`matrix(${i} ${n} ${a} ${s} ${Outline.svgRound(r)} ${Outline.svgRound(o)})`}getPathResizingSVGProperties([e,t,i,n]){const[a,s]=this.#Gc(),[r,o,l,c]=this.#Bl;if(Math.abs(l-a)<=Outline.PRECISION||Math.abs(c-s)<=Outline.PRECISION){const a=e+i/2-(r+l/2),s=t+n/2-(o+c/2);return{path:{"transform-origin":`${Outline.svgRound(e)} ${Outline.svgRound(t)}`,transform:`${this.rotationTransform} translate(${a} ${s})`}}}const h=(i-2*a)/(l-2*a),d=(n-2*s)/(c-2*s),u=l/i,g=c/n;return{path:{"transform-origin":`${Outline.svgRound(r)} ${Outline.svgRound(o)}`,transform:`${this.rotationTransform} scale(${u} ${g}) translate(${Outline.svgRound(a)} ${Outline.svgRound(s)}) scale(${h} ${d}) translate(${Outline.svgRound(-a)} ${Outline.svgRound(-s)})`}}}getPathResizedSVGProperties([e,t,i,n]){const[a,s]=this.#Gc(),r=this.#Bl,[o,l,c,h]=r;if(r[0]=e,r[1]=t,r[2]=i,r[3]=n,Math.abs(c-a)<=Outline.PRECISION||Math.abs(h-s)<=Outline.PRECISION){const a=e+i/2-(o+c/2),s=t+n/2-(l+h/2);for(const{line:e,points:t}of this.#Nc)Outline._translate(e,a,s,e),Outline._translate(t,a,s,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Outline.svgRound(e)} ${Outline.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const d=(i-2*a)/(c-2*a),u=(n-2*s)/(h-2*s),g=-d*(o+a)+e+a,f=-u*(l+s)+t+s;if(1!==d||1!==u||0!==g||0!==f)for(const{line:e,points:t}of this.#Nc)Outline._rescale(e,g,f,d,u,e),Outline._rescale(t,g,f,d,u,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Outline.svgRound(e)} ${Outline.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,t],i){const[n,a]=i,s=this.#Bl,r=e-s[0],o=t-s[1];if(this.#jc===n&&this.#$c===a)for(const{line:e,points:t}of this.#Nc)Outline._translate(e,r,o,e),Outline._translate(t,r,o,t);else{const e=this.#jc/n,t=this.#$c/a;this.#jc=n,this.#$c=a;for(const{line:i,points:n}of this.#Nc)Outline._rescale(i,r,o,e,t,i),Outline._rescale(n,r,o,e,t,n);s[2]*=e,s[3]*=t}return s[0]=e,s[1]=t,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${Outline.svgRound(e)} ${Outline.svgRound(t)}`}}}get defaultSVGProperties(){const e=this.#Bl;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${Outline.svgRound(e[0])} ${Outline.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}}class InkDrawingOptions extends DrawingOptions{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:AnnotationEditor._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,t){"stroke-width"===e&&(t??=this["stroke-width"],t*=this._viewParameters.realScale),super.updateSVGProperty(e,t)}clone(){const e=new InkDrawingOptions(this._viewParameters);return e.updateAll(this),e}}class InkEditor extends DrawingEditor{static _type="ink";static _editorType=Hl.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(e,t){AnnotationEditor.initialize(e,t),this._defaultDrawingOptions=new InkDrawingOptions(t.viewParameters)}static getDefaultDrawingOptions(e){const t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return shadow(this,"typesMap",new Map([[Xl.INK_THICKNESS,"stroke-width"],[Xl.INK_COLOR,"stroke"],[Xl.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,t,i,n,a){return new InkDrawOutliner(e,t,i,n,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,t,i,n,a,s){return InkDrawOutline.deserialize(e,t,i,n,a,s)}static async deserialize(e,t,i){let n=null;if(e instanceof InkAnnotationElement){const{data:{inkLists:t,rect:i,rotation:a,id:s,color:r,opacity:o,borderStyle:{rawWidth:l},popupRef:c,richText:h,contentsObj:d,creationDate:u,modificationDate:g},parent:{page:{pageNumber:f}}}=e;n=e={annotationType:Hl.INK,color:Array.from(r),thickness:l,opacity:o,paths:{points:t},boxes:null,pageIndex:f-1,rect:i.slice(0),rotation:a,annotationElementId:s,id:s,deleted:!1,popupRef:c,richText:h,comment:d?.str||null,creationDate:u,modificationDate:g}}const a=await super.deserialize(e,t,i);return a._initialData=n,e.comment&&a.setCommentData(e),a}get toolbarButtons(){return this._colorPicker||=new BasicColorPicker(this),[["colorPicker",this._colorPicker]]}get colorType(){return Xl.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:e,_drawingOptions:t,parent:i}=this;t.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(e,t.toSVGProperties())}static onScaleChangingWhenDrawing(){const e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:t,opacity:i}){this._drawingOptions=InkEditor.getDefaultDrawingOptions({stroke:Util.makeHexColor(...e),"stroke-width":t,"stroke-opacity":i})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:t,points:i}=this.serializeDraw(e),{_drawingOptions:{stroke:n,"stroke-opacity":a,"stroke-width":s}}=this,r=Object.assign(super.serialize(e),{color:AnnotationEditor._colorManager.convert(n),opacity:a,thickness:s,paths:{lines:t,points:i}});return this.addComment(r),e?(r.isCopy=!0,r):this.annotationElementId&&!this.#ul(r)?null:(r.id=this.annotationElementId,r)}#ul(e){const{color:t,thickness:i,opacity:n,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((e,i)=>e!==t[i])||e.thickness!==i||e.opacity!==n||e.pageIndex!==a}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;const{points:t,rect:i}=this.serializeDraw(!1);return e.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:t,popup:this.comment}),null}}class ContourDrawOutline extends InkDrawOutline{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}}class SignatureExtractor{static#Vc={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#Kc(e,t,i,n){return n-=t,0===(i-=e)?n>0?0:4:1===i?n+6:2-n}static#Yc=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#Jc(e,t,i,n,a,s,r){const o=this.#Kc(i,n,a,s);for(let a=0;a<8;a++){const s=(-a+o-r+16)%8;if(0!==e[(i+this.#Yc[2*s])*t+(n+this.#Yc[2*s+1])])return s}return-1}static#Zc(e,t,i,n,a,s,r){const o=this.#Kc(i,n,a,s);for(let a=0;a<8;a++){const s=(a+o+r+16)%8;if(0!==e[(i+this.#Yc[2*s])*t+(n+this.#Yc[2*s+1])])return s}return-1}static#Qc(e,t,i,n){const a=e.length,s=new Int32Array(a);for(let t=0;t<a;t++)s[t]=e[t]<=n?1:0;for(let e=1;e<i-1;e++)s[e*t]=s[e*t+t-1]=0;for(let e=0;e<t;e++)s[e]=s[t*i-1-e]=0;let r,o=1;const l=[];for(let e=1;e<i-1;e++){r=1;for(let i=1;i<t-1;i++){const n=e*t+i,a=s[n];if(0===a)continue;let c=e,h=i;if(1===a&&0===s[n-1])o+=1,h-=1;else{if(!(a>=1&&0===s[n+1])){1!==a&&(r=Math.abs(a));continue}o+=1,h+=1,a>1&&(r=a)}const d=[i,e],u=h===i+1,g={isHole:u,points:d,id:o,parent:0};let f;l.push(g);for(const e of l)if(e.id===r){f=e;break}f?f.isHole?g.parent=u?f.parent:r:g.parent=u?r:f.parent:g.parent=u?r:0;const p=this.#Jc(s,t,e,i,c,h,0);if(-1===p){s[n]=-o,1!==s[n]&&(r=Math.abs(s[n]));continue}let m=this.#Yc[2*p],b=this.#Yc[2*p+1];const y=e+m,w=i+b;c=y,h=w;let x=e,S=i;for(;;){const a=this.#Zc(s,t,x,S,c,h,1);m=this.#Yc[2*a],b=this.#Yc[2*a+1];const l=x+m,u=S+b;d.push(u,l);const g=x*t+S;if(0===s[g+1]?s[g]=-o:1===s[g]&&(s[g]=o),l===e&&u===i&&x===y&&S===w){1!==s[n]&&(r=Math.abs(s[n]));break}c=x,h=S,x=l,S=u}}}return l}static#eh(e,t,i,n){if(i-t<=4){for(let a=t;a<i-2;a+=2)n.push(e[a],e[a+1]);return}const a=e[t],s=e[t+1],r=e[i-4]-a,o=e[i-3]-s,l=Math.hypot(r,o),c=r/l,h=o/l,d=c*s-h*a,u=o/r,g=1/l,f=Math.atan(u),p=Math.cos(f),m=Math.sin(f),b=g*(Math.abs(p)+Math.abs(m)),y=g*(1-b+b**2),w=Math.max(Math.atan(Math.abs(m+p)*y),Math.atan(Math.abs(m-p)*y));let x=0,S=t;for(let n=t+2;n<i-2;n+=2){const t=Math.abs(d-c*e[n+1]+h*e[n]);t>x&&(S=n,x=t)}x>(l*w)**2?(this.#eh(e,t,S+2,n),this.#eh(e,S,i,n)):n.push(a,s)}static#th(e){const t=[],i=e.length;return this.#eh(e,0,i,t),t.push(e[i-2],e[i-1]),t.length<=4?null:t}static#ih(e,t,i,n,a,s){const r=new Float32Array(s**2),o=-2*n**2,l=s>>1;for(let e=0;e<s;e++){const t=(e-l)**2;for(let i=0;i<s;i++)r[e*s+i]=Math.exp((t+(i-l)**2)/o)}const c=new Float32Array(256),h=-2*a**2;for(let e=0;e<256;e++)c[e]=Math.exp(e**2/h);const d=e.length,u=new Uint8Array(d),g=new Uint32Array(256);for(let n=0;n<i;n++)for(let a=0;a<t;a++){const o=n*t+a,h=e[o];let d=0,f=0;for(let o=0;o<s;o++){const u=n+o-l;if(!(u<0||u>=i))for(let i=0;i<s;i++){const n=a+i-l;if(n<0||n>=t)continue;const g=e[u*t+n],p=r[o*s+i]*c[Math.abs(g-h)];d+=g*p,f+=p}}g[u[o]=Math.round(d/f)]++}return[u,g]}static#nh(e){const t=new Uint32Array(256);for(const i of e)t[i]++;return t}static#ah(e){const t=e.length,i=new Uint8ClampedArray(t>>2);let n=-1/0,a=1/0;for(let t=0,s=i.length;t<s;t++){const s=i[t]=e[t<<2];n=Math.max(n,s),a=Math.min(a,s)}const s=255/(n-a);for(let e=0,t=i.length;e<t;e++)i[e]=(i[e]-a)*s;return i}static#sh(e){let t,i=-1/0,n=-1/0;const a=e.findIndex(e=>0!==e);let s=a,r=a;for(t=a;t<256;t++){const a=e[t];a>i&&(t-s>n&&(n=t-s,r=t-1),i=a,s=t)}for(t=r-1;t>=0&&!(e[t]>e[t+1]);t--);return t}static#rh(e){const t=e,{width:i,height:n}=e,{maxDim:a}=this.#Vc;let s=i,r=n;if(i>a||n>a){let o=i,l=n,c=Math.log2(Math.max(i,n)/a);const h=Math.floor(c);c=c===h?h-1:h;for(let i=0;i<c;i++){s=Math.ceil(o/2),r=Math.ceil(l/2);const i=new OffscreenCanvas(s,r);i.getContext("2d").drawImage(e,0,0,o,l,0,0,s,r),o=s,l=r,e!==t&&e.close(),e=i.transferToImageBitmap()}const d=Math.min(a/s,a/r);s=Math.round(s*d),r=Math.round(r*d)}const o=new OffscreenCanvas(s,r).getContext("2d",{willReadFrequently:!0});o.fillStyle="white",o.fillRect(0,0,s,r),o.filter="grayscale(1)",o.drawImage(e,0,0,e.width,e.height,0,0,s,r);const l=o.getImageData(0,0,s,r).data;return[this.#ah(l),s,r]}static extractContoursFromText(e,{fontFamily:t,fontStyle:i,fontWeight:n},a,s,r,o){let l=new OffscreenCanvas(1,1),c=l.getContext("2d",{alpha:!1});const h=c.font=`${i} ${n} 200px ${t}`,{actualBoundingBoxLeft:d,actualBoundingBoxRight:u,actualBoundingBoxAscent:g,actualBoundingBoxDescent:f,fontBoundingBoxAscent:p,fontBoundingBoxDescent:m,width:b}=c.measureText(e),y=1.5,w=Math.ceil(Math.max(Math.abs(d)+Math.abs(u)||0,b)*y),x=Math.ceil(Math.max(Math.abs(g)+Math.abs(f)||200,Math.abs(p)+Math.abs(m)||200)*y);l=new OffscreenCanvas(w,x),c=l.getContext("2d",{alpha:!0,willReadFrequently:!0}),c.font=h,c.filter="grayscale(1)",c.fillStyle="white",c.fillRect(0,0,w,x),c.fillStyle="black",c.fillText(e,.5*w/2,1.5*x/2);const S=this.#ah(c.getImageData(0,0,w,x).data),v=this.#nh(S),C=this.#sh(v),k=this.#Qc(S,w,x,C);return this.processDrawnLines({lines:{curves:k,width:w,height:x},pageWidth:a,pageHeight:s,rotation:r,innerMargin:o,mustSmooth:!0,areContours:!0})}static process(e,t,i,n,a){const[s,r,o]=this.#rh(e),[l,c]=this.#ih(s,r,o,Math.hypot(r,o)*this.#Vc.sigmaSFactor,this.#Vc.sigmaR,this.#Vc.kernelSize),h=this.#sh(c),d=this.#Qc(l,r,o,h);return this.processDrawnLines({lines:{curves:d,width:r,height:o},pageWidth:t,pageHeight:i,rotation:n,innerMargin:a,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:i,rotation:n,innerMargin:a,mustSmooth:s,areContours:r}){n%180!=0&&([t,i]=[i,t]);const{curves:o,width:l,height:c}=e,h=e.thickness??0,d=[],u=Math.min(t/l,i/c),g=u/t,f=u/i,p=[];for(const{points:e}of o){const t=s?this.#th(e):e;if(!t)continue;p.push(t);const i=t.length,n=new Float32Array(i),a=new Float32Array(3*(2===i?2:i-2));if(d.push({line:a,points:n}),2===i){n[0]=t[0]*g,n[1]=t[1]*f,a.set([NaN,NaN,NaN,NaN,n[0],n[1]],0);continue}let[r,o,l,c]=t;r*=g,o*=f,l*=g,c*=f,n.set([r,o,l,c],0),a.set([NaN,NaN,NaN,NaN,r,o],0);for(let e=4;e<i;e+=2){const i=n[e]=t[e]*g,s=n[e+1]=t[e+1]*f;a.set(Outline.createBezierPoints(r,o,l,c,i,s),3*(e-2)),[r,o,l,c]=[l,c,i,s]}}if(0===d.length)return null;const m=r?new ContourDrawOutline:new InkDrawOutline;return m.build(d,t,i,1,n,r?0:h,a),{outline:m,newCurves:p,areContours:r,thickness:h,width:l,height:c}}static async compressSignature({outlines:e,areContours:t,thickness:i,width:n,height:a}){let s,r=1/0,o=-1/0,l=0;for(const t of e){l+=t.length;for(let e=2,i=t.length;e<i;e++){const i=t[e]-t[e-2];r=Math.min(r,i),o=Math.max(o,i)}}s=r>=-128&&o<=127?Int8Array:r>=-32768&&o<=32767?Int16Array:Int32Array;const c=e.length,h=8+3*c,d=new Uint32Array(h);let u=0;d[u++]=h*Uint32Array.BYTES_PER_ELEMENT+(l-2*c)*s.BYTES_PER_ELEMENT,d[u++]=0,d[u++]=n,d[u++]=a,d[u++]=t?0:1,d[u++]=Math.max(0,Math.floor(i??0)),d[u++]=c,d[u++]=s.BYTES_PER_ELEMENT;for(const t of e)d[u++]=t.length-2,d[u++]=t[0],d[u++]=t[1];const g=new CompressionStream("deflate-raw"),f=g.writable.getWriter();await f.ready,f.write(d);const p=s.prototype.constructor;for(const t of e){const e=new p(t.length-2);for(let i=2,n=t.length;i<n;i++)e[i-2]=t[i]-t[i-2];f.write(e)}f.close();const m=await new Response(g.readable).arrayBuffer();return toBase64Util(new Uint8Array(m))}static async decompressSignature(e){try{const i=(t=e,Uint8Array.fromBase64?Uint8Array.fromBase64(t):stringToBytes(atob(t))),{readable:n,writable:a}=new DecompressionStream("deflate-raw"),s=a.getWriter();await s.ready,s.write(i).then(async()=>{await s.ready,await s.close()}).catch(()=>{});let r=null,o=0;for await(const e of n)r||=new Uint8Array(new Uint32Array(e.buffer,0,4)[0]),r.set(e,o),o+=e.length;const l=new Uint32Array(r.buffer,0,r.length>>2),c=l[1];if(0!==c)throw new Error(`Invalid version: ${c}`);const h=l[2],d=l[3],u=0===l[4],g=l[5],f=l[6],p=l[7],m=[],b=(8+3*f)*Uint32Array.BYTES_PER_ELEMENT;let y;switch(p){case Int8Array.BYTES_PER_ELEMENT:y=new Int8Array(r.buffer,b);break;case Int16Array.BYTES_PER_ELEMENT:y=new Int16Array(r.buffer,b);break;case Int32Array.BYTES_PER_ELEMENT:y=new Int32Array(r.buffer,b)}o=0;for(let e=0;e<f;e++){const t=l[3*e+8],i=new Float32Array(t+2);m.push(i);for(let t=0;t<2;t++)i[t]=l[3*e+8+t+1];for(let e=0;e<t;e++)i[e+2]=i[e]+y[o++]}return{areContours:u,thickness:g,outlines:m,width:h,height:d}}catch(e){return warn(`decompressSignature: ${e}`),null}var t}}class SignatureOptions extends DrawingOptions{constructor(){super(),super.updateProperties({fill:AnnotationEditor._defaultLineColor,"stroke-width":0})}clone(){const e=new SignatureOptions;return e.updateAll(this),e}}class DrawnSignatureOptions extends InkDrawingOptions{constructor(e){super(e),super.updateProperties({stroke:AnnotationEditor._defaultLineColor,"stroke-width":1})}clone(){const e=new DrawnSignatureOptions(this._viewParameters);return e.updateAll(this),e}}class SignatureEditor extends DrawingEditor{#oh=!1;#lh=null;#ch=null;#hh=null;static _type="signature";static _editorType=Hl.SIGNATURE;static _defaultDrawingOptions=null;constructor(e){super({...e,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#ch=e.signatureData||null,this.#lh=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(e,t){AnnotationEditor.initialize(e,t),this._defaultDrawingOptions=new SignatureOptions,this._defaultDrawnSignatureOptions=new DrawnSignatureOptions(t.viewParameters)}static getDefaultDrawingOptions(e){const t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!1}static get typesMap(){return shadow(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!this.#lh}}static computeTelemetryFinalData(e){const t=e.get("hasDescription");return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){null!==this._drawId&&super.onScaleChanging()}render(){if(this.div)return this.div;let e,t;const{_isCopy:i}=this;if(i&&(this._isCopy=!1,e=this.x,t=this.y),super.render(),null===this._drawId)if(this.#ch){const{lines:e,mustSmooth:t,areContours:i,description:n,uuid:a,heightInPage:s}=this.#ch,{rawDims:{pageWidth:r,pageHeight:o},rotation:l}=this.parent.viewport,c=SignatureExtractor.processDrawnLines({lines:e,pageWidth:r,pageHeight:o,rotation:l,innerMargin:SignatureEditor._INNER_MARGIN,mustSmooth:t,areContours:i});this.addSignature(c,s,n,a)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:this.#lh||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(e,t)),this.div}setUuid(e){this.#hh=e,this.addEditToolbar()}getUuid(){return this.#hh}get description(){return this.#lh}set description(e){this.#lh=e,this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:e})),super.addEditToolbar().then(t=>{t?.updateEditSignatureButton(e)}))}getSignaturePreview(){const{newCurves:e,areContours:t,thickness:i,width:n,height:a}=this.#ch,s=Math.max(n,a);return{areContours:t,outline:SignatureExtractor.processDrawnLines({lines:{curves:e.map(e=>({points:e})),thickness:i,width:n,height:a},pageWidth:s,pageHeight:s,rotation:0,innerMargin:0,mustSmooth:!1,areContours:t}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(e,t,i,n){const{x:a,y:s}=this,{outline:r}=this.#ch=e;let o;this.#oh=r instanceof ContourDrawOutline,this.description=i,this.#oh?o=SignatureEditor.getDefaultDrawingOptions():(o=SignatureEditor._defaultDrawnSignatureOptions.clone(),o.updateProperties({"stroke-width":r.thickness})),this._addOutlines({drawOutlines:r,drawingOptions:o});const[,l]=this.pageDimensions;let c=t/l;c=c>=1?.5:c,this.width*=c/this.height,this.width>=1&&(c*=.9/this.width,this.width=.9),this.height=c,this.setDims(),this.x=a,this.y=s,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(n),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!n,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(e){const{rawDims:{pageWidth:t,pageHeight:i},rotation:n}=this.parent.viewport;return SignatureExtractor.process(e,t,i,n,SignatureEditor._INNER_MARGIN)}getFromText(e,t){const{rawDims:{pageWidth:i,pageHeight:n},rotation:a}=this.parent.viewport;return SignatureExtractor.extractContoursFromText(e,t,i,n,a,SignatureEditor._INNER_MARGIN)}getDrawnSignature(e){const{rawDims:{pageWidth:t,pageHeight:i},rotation:n}=this.parent.viewport;return SignatureExtractor.processDrawnLines({lines:e,pageWidth:t,pageHeight:i,rotation:n,innerMargin:SignatureEditor._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:e,thickness:t}){e?this._drawingOptions=SignatureEditor.getDefaultDrawingOptions():(this._drawingOptions=SignatureEditor._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":t}))}serialize(e=!1){if(this.isEmpty())return null;const{lines:t,points:i}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":n}}=this,a=Object.assign(super.serialize(e),{isSignature:!0,areContours:this.#oh,color:[0,0,0],thickness:this.#oh?0:n});return this.addComment(a),e?(a.paths={lines:t,points:i},a.uuid=this.#hh,a.isCopy=!0):a.lines=t,this.#lh&&(a.accessibilityData={type:"Figure",alt:this.#lh}),a}static deserializeDraw(e,t,i,n,a,s){return s.areContours?ContourDrawOutline.deserialize(e,t,i,n,a,s):InkDrawOutline.deserialize(e,t,i,n,a,s)}static async deserialize(e,t,i){const n=await super.deserialize(e,t,i);return n.#oh=e.areContours,n.description=e.accessibilityData?.alt||"",n.#hh=e.uuid,n}}class StampEditor extends AnnotationEditor{#dh=null;#uh=null;#gh=null;#fh=null;#ph=null;#mh="";#bh=null;#yh=!1;#wh=null;#Ah=!1;#xh=!1;static _type="stamp";static _editorType=Hl.STAMP;constructor(e){super({...e,name:"stampEditor"}),this.#fh=e.bitmapUrl,this.#ph=e.bitmapFile,this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(e,t){AnnotationEditor.initialize(e,t)}static isHandlingMimeForPasting(e){return yc.includes(e)}static paste(e,t){t.pasteEditor({mode:Hl.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){const t=e.get("hasAltText");return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}#Sh(e,t=!1){e?(this.#dh=e.bitmap,t||(this.#uh=e.id,this.#Ah=e.isSvg),e.file&&(this.#mh=e.file.name),this.#vh()):this.remove()}#Ch(){if(this.#gh=null,this._uiManager.enableWaiting(!1),this.#bh)if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#dh)this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#dh){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(e=null,t=!0){if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:n,width:a,height:s}=e||this.copyCanvas(null,null,!0).imageData,r=await i.guess({name:"altText",request:{data:n,width:a,height:s,channels:n.length/(a*s)}});if(!r)throw new Error("No response from the AI service.");if(r.error)throw new Error("Error from the AI service.");if(r.cancel)return null;if(!r.output)throw new Error("No valid response from the AI service.");const o=r.output;return await this.setGuessedAltText(o),t&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1}),o}#kh(){if(this.#uh)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#uh).then(e=>this.#Sh(e,!0)).finally(()=>this.#Ch());if(this.#fh){const e=this.#fh;return this.#fh=null,this._uiManager.enableWaiting(!0),void(this.#gh=this._uiManager.imageManager.getFromUrl(e).then(e=>this.#Sh(e)).finally(()=>this.#Ch()))}if(this.#ph){const e=this.#ph;return this.#ph=null,this._uiManager.enableWaiting(!0),void(this.#gh=this._uiManager.imageManager.getFromFile(e).then(e=>this.#Sh(e)).finally(()=>this.#Ch()))}const e=document.createElement("input");e.type="file",e.accept=yc.join(",");const t=this._uiManager._signal;this.#gh=new Promise(i=>{e.addEventListener("change",async()=>{if(e.files&&0!==e.files.length){this._uiManager.enableWaiting(!0);const t=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#Sh(t)}else this.remove();i()},{signal:t}),e.addEventListener("cancel",()=>{this.remove(),i()},{signal:t})}).finally(()=>this.#Ch()),e.click()}remove(){this.#uh&&(this.#dh=null,this._uiManager.imageManager.deleteId(this.#uh),this.#bh?.remove(),this.#bh=null,this.#wh&&(clearTimeout(this.#wh),this.#wh=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#uh&&null===this.#bh&&this.#kh(),this.isAttachedToDOM||this.parent.add(this))):this.#uh&&this.#kh()}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(this.#gh||this.#dh||this.#fh||this.#ph||this.#uh||this.#yh)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;return this._isCopy&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#yh||(this.#dh?this.#vh():this.#kh()),this._isCopy&&this._moveAfterPaste(e,t),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,t){const{id:i,bitmap:n}=this._uiManager.imageManager.getFromCanvas(e,t);t.remove(),i&&this._uiManager.imageManager.isValidId(i)&&(this.#uh=i,n&&(this.#dh=n),this.#yh=!1,this.#vh())}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;null!==this.#wh&&clearTimeout(this.#wh);this.#wh=setTimeout(()=>{this.#wh=null,this.#Th()},200)}#vh(){const{div:e}=this;let{width:t,height:i}=this.#dh;const[n,a]=this.pageDimensions,s=.75;if(this.width)t=this.width*n,i=this.height*a;else if(t>s*n||i>s*a){const e=Math.min(s*n/t,s*a/i);t*=e,i*=e}this._uiManager.enableWaiting(!1);const r=this.#bh=document.createElement("canvas");r.setAttribute("role","img"),this.addContainer(r),this.width=t/n,this.height=i/a,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(e.hidden=!1),this.#Th(),this.#xh||(this.parent.addUndoableEditor(this),this.#xh=!0),this._reportTelemetry({action:"inserted_image"}),this.#mh&&this.div.setAttribute("aria-description",this.#mh),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}copyCanvas(e,t,i=!1){e||(e=224);const{width:n,height:a}=this.#dh,s=new OutputScale;let r=this.#dh,o=n,l=a,c=null;if(t){if(n>t||a>t){const e=Math.min(t/n,t/a);o=Math.floor(n*e),l=Math.floor(a*e)}c=document.createElement("canvas");const e=c.width=Math.ceil(o*s.sx),i=c.height=Math.ceil(l*s.sy);this.#Ah||(r=this.#Fh(e,i));const h=c.getContext("2d");h.filter=this._uiManager.hcmFilter;let d="white",u="#cfcfd8";"none"!==this._uiManager.hcmFilter?u="black":ColorScheme.isDarkMode&&(d="#8f8f9d",u="#42414d");const g=15,f=g*s.sx,p=g*s.sy,m=new OffscreenCanvas(2*f,2*p),b=m.getContext("2d");b.fillStyle=d,b.fillRect(0,0,2*f,2*p),b.fillStyle=u,b.fillRect(0,0,f,p),b.fillRect(f,p,f,p),h.fillStyle=h.createPattern(m,"repeat"),h.fillRect(0,0,e,i),h.drawImage(r,0,0,r.width,r.height,0,0,e,i)}let h=null;if(i){let t,i;if(s.symmetric&&r.width<e&&r.height<e)t=r.width,i=r.height;else if(r=this.#dh,n>e||a>e){const s=Math.min(e/n,e/a);t=Math.floor(n*s),i=Math.floor(a*s),this.#Ah||(r=this.#Fh(t,i))}const o=new OffscreenCanvas(t,i).getContext("2d",{willReadFrequently:!0});o.drawImage(r,0,0,r.width,r.height,0,0,t,i),h={width:t,height:i,data:o.getImageData(0,0,t,i).data}}return{canvas:c,width:o,height:l,imageData:h}}#Fh(e,t){const{width:i,height:n}=this.#dh;let a=i,s=n,r=this.#dh;for(;a>2*e||s>2*t;){const i=a,n=s;a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2));const o=new OffscreenCanvas(a,s);o.getContext("2d").drawImage(r,0,0,i,n,0,0,a,s),r=o.transferToImageBitmap()}return r}#Th(){const[e,t]=this.parentDimensions,{width:i,height:n}=this,a=new OutputScale,s=Math.ceil(i*e*a.sx),r=Math.ceil(n*t*a.sy),o=this.#bh;if(!o||o.width===s&&o.height===r)return;o.width=s,o.height=r;const l=this.#Ah?this.#dh:this.#Fh(s,r),c=o.getContext("2d");c.filter=this._uiManager.hcmFilter,c.drawImage(l,0,0,l.width,l.height,0,0,s,r)}#Ih(e){if(e){if(this.#Ah){const e=this._uiManager.imageManager.getSvgUrl(this.#uh);if(e)return e}const e=document.createElement("canvas");({width:e.width,height:e.height}=this.#dh);return e.getContext("2d").drawImage(this.#dh,0,0),e.toDataURL()}if(this.#Ah){const[e,t]=this.pageDimensions,i=Math.round(this.width*e*PixelsPerInch.PDF_TO_CSS_UNITS),n=Math.round(this.height*t*PixelsPerInch.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(i,n);return a.getContext("2d").drawImage(this.#dh,0,0,this.#dh.width,this.#dh.height,0,0,i,n),a.transferToImageBitmap()}return structuredClone(this.#dh)}static async deserialize(e,t,i){let n=null,a=!1;if(e instanceof StampAnnotationElement){const{data:{rect:s,rotation:r,id:o,structParent:l,popupRef:c,richText:h,contentsObj:d,creationDate:u,modificationDate:g},container:f,parent:{page:{pageNumber:p}},canvas:m}=e;let b,y;m?(delete e.canvas,({id:b,bitmap:y}=i.imageManager.getFromCanvas(f.id,m)),m.remove()):(a=!0,e._hasNoCanvas=!0);const w=(await t._structTree.getAriaAttributes(`${mc}${o}`))?.get("aria-label")||"";n=e={annotationType:Hl.STAMP,bitmapId:b,bitmap:y,pageIndex:p-1,rect:s.slice(0),rotation:r,annotationElementId:o,id:o,deleted:!1,accessibilityData:{decorative:!1,altText:w},isSvg:!1,structParent:l,popupRef:c,richText:h,comment:d?.str||null,creationDate:u,modificationDate:g}}const s=await super.deserialize(e,t,i),{rect:r,bitmap:o,bitmapUrl:l,bitmapId:c,isSvg:h,accessibilityData:d}=e;a?(i.addMissingCanvas(e.id,s),s.#yh=!0):c&&i.imageManager.isValidId(c)?(s.#uh=c,o&&(s.#dh=o)):s.#fh=l,s.#Ah=h;const[u,g]=s.pageDimensions;return s.width=(r[2]-r[0])/u,s.height=(r[3]-r[1])/g,d&&(s.altTextData=d),s._initialData=n,e.comment&&s.setCommentData(e),s.#xh=!!n,s}serialize(e=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=Object.assign(super.serialize(e),{bitmapId:this.#uh,isSvg:this.#Ah});if(this.addComment(i),e)return i.bitmapUrl=this.#Ih(!0),i.accessibilityData=this.serializeAltText(!0),i.isCopy=!0,i;const{decorative:n,altText:a}=this.serializeAltText(!1);if(!n&&a&&(i.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){const e=this.#ul(i);return e.isSame?null:(e.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1,i.id=this.annotationElementId,delete i.bitmapId,i)}if(null===t)return i;t.stamps||=new Map;const s=this.#Ah?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(t.stamps.has(this.#uh)){if(this.#Ah){const e=t.stamps.get(this.#uh);s>e.area&&(e.area=s,e.serialized.bitmap.close(),e.serialized.bitmap=this.#Ih(!1))}}else t.stamps.set(this.#uh,{area:s,serialized:i}),i.bitmap=this.#Ih(!1);return i}#ul(e){const{pageIndex:t,accessibilityData:{altText:i}}=this._initialData,n=e.pageIndex===t,a=(e.accessibilityData?.alt||"")===i;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&n&&a,isSameAltText:a}}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}class AnnotationEditorLayer{#Ko;#Eh=!1;#Mh=null;#Dh=null;#Oh=null;#_h=new Map;#Ph=!1;#Rh=!1;#Bh=!1;#Nh=null;#Lh=null;#Uh=null;#jh=null;#$h=null;#Hh=-1;#Tt;static _initialized=!1;static#ei=new Map([FreeTextEditor,InkEditor,StampEditor,HighlightEditor,SignatureEditor].map(e=>[e._editorType,e]));constructor({uiManager:e,pageIndex:t,div:i,structTreeLayer:n,accessibilityManager:a,annotationLayer:s,drawLayer:r,textLayer:o,viewport:l,l10n:c}){const h=[...AnnotationEditorLayer.#ei.values()];if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;for(const t of h)t.initialize(c,e)}e.registerEditorTypes(h),this.#Tt=e,this.pageIndex=t,this.div=i,this.#Ko=a,this.#Mh=s,this.viewport=l,this.#Uh=o,this.drawLayer=r,this._structTree=n,this.#Tt.addLayer(this)}get isEmpty(){return 0===this.#_h.size}get isInvisible(){return this.isEmpty&&this.#Tt.getMode()===Hl.NONE}updateToolbar(e){this.#Tt.updateToolbar(e)}updateMode(e=this.#Tt.getMode()){switch(this.#Xh(),e){case Hl.NONE:return this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case Hl.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Hl.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:t}=this.div;if(t.toggle("nonEditing",!1),e===Hl.POPUP)t.toggle("commentEditing",!0);else{t.toggle("commentEditing",!1);for(const i of AnnotationEditorLayer.#ei.values())t.toggle(`${i._type}Editing`,e===i._editorType)}this.div.hidden=!1}hasTextLayer(e){return e===this.#Uh?.div}setEditingState(e){this.#Tt.setEditingState(e)}addCommands(e){this.#Tt.addCommands(e)}cleanUndoStack(e){this.#Tt.cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#Mh?.div.classList.toggle("disabled",!e)}get#qh(){return 0!==this.#_h.size?this.#_h.values():this.#Tt.getEditors(this.pageIndex)}async enable(){this.#Bh=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),this.#$h?.abort(),this.#$h=null;const e=new Set;for(const t of this.#qh)t.enableEditing(),t.show(!0),t.annotationElementId&&(this.#Tt.removeChangedExistingAnnotation(t),e.add(t.annotationElementId));const t=this.#Mh;if(t)for(const i of t.getEditableAnnotations()){if(i.hide(),this.#Tt.isDeletedAnnotationElement(i.data.id))continue;if(e.has(i.data.id))continue;const t=await this.deserialize(i);t&&(this.addOrRebuild(t),t.enableEditing())}this.#Bh=!1,this.#Tt._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(this.#Rh=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),this.#Uh&&!this.#$h){this.#$h=new AbortController;const e=this.#Tt.combinedSignal(this.#$h);this.#Uh.div.addEventListener("pointerdown",e=>{const{clientX:t,clientY:i,timeStamp:n}=e;if(n-this.#Hh>500)return void(this.#Hh=n);this.#Hh=-1;const{classList:a}=this.div;a.toggle("getElements",!0);const s=document.elementsFromPoint(t,i);if(a.toggle("getElements",!1),!this.div.contains(s[0]))return;let r;const o=new RegExp(`^${$l}[0-9]+$`);for(const e of s)if(o.test(e.id)){r=e.id;break}if(!r)return;const l=this.#_h.get(r);null===l?.annotationElementId&&(e.stopPropagation(),e.preventDefault(),l.dblclick(e))},{signal:e,capture:!0})}const e=this.#Mh;if(e){const t=new Map,i=new Map;for(const n of this.#qh)n.disableEditing(),n.annotationElementId?null===n.serialize()?(i.set(n.annotationElementId,n),this.getEditableAnnotation(n.annotationElementId)?.show(),n.remove()):t.set(n.annotationElementId,n):n.updateFakeAnnotationElement(e);const n=e.getEditableAnnotations();for(const e of n){const{id:n}=e.data;if(this.#Tt.isDeletedAnnotationElement(n)){e.updateEdited({deleted:!0});continue}let a=i.get(n);a?(a.resetAnnotationElement(e),a.show(!1),e.show()):(a=t.get(n),a&&(this.#Tt.addChangedExistingAnnotation(a),a.renderAnnotationElement(e)&&a.show(!1)),e.show())}}this.#Xh(),this.isEmpty&&(this.div.hidden=!0);const{classList:t}=this.div;for(const e of AnnotationEditorLayer.#ei.values())t.remove(`${e._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#Rh=!1}getEditableAnnotation(e){return this.#Mh?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#Tt.getActive()!==e&&this.#Tt.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#Uh?.div&&!this.#jh){this.#jh=new AbortController;const e=this.#Tt.combinedSignal(this.#jh);this.#Uh.div.addEventListener("pointerdown",this.#zh.bind(this),{signal:e}),this.#Uh.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#Uh?.div&&this.#jh&&(this.#jh.abort(),this.#jh=null,this.#Uh.div.classList.remove("highlighting"))}#zh(e){this.#Tt.unselectAll();const{target:t}=e;if(t===this.#Uh.div||("img"===t.getAttribute("role")||t.classList.contains("endOfContent"))&&this.#Uh.div.contains(t)){const{isMac:t}=util_FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;this.#Tt.showAllEditors("highlight",!0,!0),this.#Uh.div.classList.add("free"),this.toggleDrawing(),HighlightEditor.startHighlighting(this,"ltr"===this.#Tt.direction,{target:this.#Uh.div,x:e.x,y:e.y}),this.#Uh.div.addEventListener("pointerup",()=>{this.#Uh.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#Tt._signal}),e.preventDefault()}}enableClick(){if(this.#Dh)return;this.#Dh=new AbortController;const e=this.#Tt.combinedSignal(this.#Dh);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e});const t=this.pointerup.bind(this);this.div.addEventListener("pointerup",t,{signal:e}),this.div.addEventListener("pointercancel",t,{signal:e})}disableClick(){this.#Dh?.abort(),this.#Dh=null}attach(e){this.#_h.set(e.id,e);const{annotationElementId:t}=e;t&&this.#Tt.isDeletedAnnotationElement(t)&&this.#Tt.removeDeletedAnnotationElement(e)}detach(e){this.#_h.delete(e.id),this.#Ko?.removePointerInTextLayer(e.contentDiv),!this.#Rh&&e.annotationElementId&&this.#Tt.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#Tt.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#Tt.addDeletedAnnotationElement(e.annotationElementId),AnnotationEditor.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(e.parent!==this||!e.isAttachedToDOM){if(this.changeParent(e),this.#Tt.addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!this.#Bh),this.#Tt.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;const{activeElement:t}=document;e.div.contains(t)&&!this.#Oh&&(e._focusEventsAllowed=!1,this.#Oh=setTimeout(()=>{this.#Oh=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#Tt._signal}),t.focus())},0)),e._structTreeParentId=this.#Ko?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getEditorByUID(e){for(const t of this.#_h.values())if(t.uid===e)return t;return null}getNextId(){return this.#Tt.getId()}get#Wh(){return AnnotationEditorLayer.#ei.get(this.#Tt.getMode())}combinedSignal(e){return this.#Tt.combinedSignal(e)}#Gh(e){const t=this.#Wh;return t?new t.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#Wh?.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await this.#Tt.updateMode(e.mode);const{offsetX:i,offsetY:n}=this.#Vh(),a=this.getNextId(),s=this.#Gh({parent:this,id:a,x:i,y:n,uiManager:this.#Tt,isCentered:!0,...t});s&&this.add(s)}async deserialize(e){return await(AnnotationEditorLayer.#ei.get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,this.#Tt))||null}createAndAddNewEditor(e,t,i={}){const n=this.getNextId(),a=this.#Gh({parent:this,id:n,x:e.offsetX,y:e.offsetY,uiManager:this.#Tt,isCentered:t,...i});return a&&this.add(a),a}get boundingClientRect(){return this.div.getBoundingClientRect()}#Vh(){const{x:e,y:t,width:i,height:n}=this.boundingClientRect,a=Math.max(0,e),s=Math.max(0,t),r=(a+Math.min(window.innerWidth,e+i))/2-e,o=(s+Math.min(window.innerHeight,t+n))/2-t,[l,c]=this.viewport.rotation%180==0?[r,o]:[o,r];return{offsetX:l,offsetY:c}}addNewEditor(e={}){this.createAndAddNewEditor(this.#Vh(),!0,e)}setSelected(e){this.#Tt.setSelected(e)}toggleSelected(e){this.#Tt.toggleSelected(e)}unselect(e){this.#Tt.unselect(e)}pointerup(e){const{isMac:t}=util_FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;if(!this.#Ph)return;if(this.#Ph=!1,this.#Wh?.isDrawer&&this.#Wh.supportMultipleDrawings)return;if(!this.#Eh)return void(this.#Eh=!0);const i=this.#Tt.getMode();i!==Hl.STAMP&&i!==Hl.SIGNATURE?this.createAndAddNewEditor(e,!1):this.#Tt.unselectAll()}pointerdown(e){if(this.#Tt.getMode()===Hl.HIGHLIGHT&&this.enableTextSelection(),this.#Ph)return void(this.#Ph=!1);const{isMac:t}=util_FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;if(this.#Ph=!0,this.#Wh?.isDrawer)return void this.startDrawingSession(e);const i=this.#Tt.getActive();this.#Eh=!i||i.isEmpty()}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),this.#Nh)return void this.#Wh.startDrawing(this,this.#Tt,!1,e);this.#Tt.setCurrentDrawingSession(this),this.#Nh=new AbortController;const t=this.#Tt.combinedSignal(this.#Nh);this.div.addEventListener("blur",({relatedTarget:e})=>{e&&!this.div.contains(e)&&(this.#Lh=null,this.commitOrRemove())},{signal:t}),this.#Wh.startDrawing(this,this.#Tt,!1,e)}pause(e){if(e){const{activeElement:e}=document;return void(this.div.contains(e)&&(this.#Lh=e))}this.#Lh&&setTimeout(()=>{this.#Lh?.focus(),this.#Lh=null},0)}endDrawingSession(e=!1){return this.#Nh?(this.#Tt.setCurrentDrawingSession(null),this.#Nh.abort(),this.#Nh=null,this.#Lh=null,this.#Wh.endDrawing(e)):null}findNewParent(e,t,i){const n=this.#Tt.findParent(t,i);return null!==n&&n!==this&&(n.changeParent(e),!0)}commitOrRemove(){return!!this.#Nh&&(this.endDrawingSession(),!0)}onScaleChanging(){this.#Nh&&this.#Wh.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#Tt.getActive()?.parent===this&&(this.#Tt.commitOrRemove(),this.#Tt.setActiveEditor(null)),this.#Oh&&(clearTimeout(this.#Oh),this.#Oh=null);for(const e of this.#_h.values())this.#Ko?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#_h.clear(),this.#Tt.removeLayer(this)}#Xh(){for(const e of this.#_h.values())e.isEmpty()&&e.remove()}render({viewport:e}){this.viewport=e,setLayerDimensions(this.div,e);for(const e of this.#Tt.getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:e}){this.#Tt.commitOrRemove(),this.#Xh();const t=this.viewport.rotation,i=e.rotation;if(this.viewport=e,setLayerDimensions(this.div,{rotation:i}),t!==i)for(const e of this.#_h.values())e.rotate(i)}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return this.#Tt.viewParameters.realScale}}class DrawLayer{#wo=null;#Kh=new Map;#Yh=new Map;static#Mt=0;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(this.#wo){if(this.#wo!==e){if(this.#Kh.size>0)for(const t of this.#Kh.values())t.remove(),e.append(t);this.#wo=e}}else this.#wo=e}static get _svgFactory(){return shadow(this,"_svgFactory",new DOMSVGFactory)}static#Jh(e,[t,i,n,a]){const{style:s}=e;s.top=100*i+"%",s.left=100*t+"%",s.width=100*n+"%",s.height=100*a+"%"}#Zh(){const e=DrawLayer._svgFactory.create(1,1,!0);return this.#wo.append(e),e.setAttribute("aria-hidden",!0),e}#Qh(e,t){const i=DrawLayer._svgFactory.createElement("clipPath");e.append(i);const n=`clip_${t}`;i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const a=DrawLayer._svgFactory.createElement("use");return i.append(a),a.setAttribute("href",`#${t}`),a.classList.add("clip"),n}#ed(e,t){for(const[i,n]of Object.entries(t))null===n?e.removeAttribute(i):e.setAttribute(i,n)}draw(e,t=!1,i=!1){const n=DrawLayer.#Mt++,a=this.#Zh(),s=DrawLayer._svgFactory.createElement("defs");a.append(s);const r=DrawLayer._svgFactory.createElement("path");s.append(r);const o=`path_p${this.pageIndex}_${n}`;r.setAttribute("id",o),r.setAttribute("vector-effect","non-scaling-stroke"),t&&this.#Yh.set(n,r);const l=i?this.#Qh(s,o):null,c=DrawLayer._svgFactory.createElement("use");return a.append(c),c.setAttribute("href",`#${o}`),this.updateProperties(a,e),this.#Kh.set(n,a),{id:n,clipPathId:`url(#${l})`}}drawOutline(e,t){const i=DrawLayer.#Mt++,n=this.#Zh(),a=DrawLayer._svgFactory.createElement("defs");n.append(a);const s=DrawLayer._svgFactory.createElement("path");a.append(s);const r=`path_p${this.pageIndex}_${i}`;let o;if(s.setAttribute("id",r),s.setAttribute("vector-effect","non-scaling-stroke"),t){const e=DrawLayer._svgFactory.createElement("mask");a.append(e),o=`mask_p${this.pageIndex}_${i}`,e.setAttribute("id",o),e.setAttribute("maskUnits","objectBoundingBox");const t=DrawLayer._svgFactory.createElement("rect");e.append(t),t.setAttribute("width","1"),t.setAttribute("height","1"),t.setAttribute("fill","white");const n=DrawLayer._svgFactory.createElement("use");e.append(n),n.setAttribute("href",`#${r}`),n.setAttribute("stroke","none"),n.setAttribute("fill","black"),n.setAttribute("fill-rule","nonzero"),n.classList.add("mask")}const l=DrawLayer._svgFactory.createElement("use");n.append(l),l.setAttribute("href",`#${r}`),o&&l.setAttribute("mask",`url(#${o})`);const c=l.cloneNode();return n.append(c),l.classList.add("mainOutline"),c.classList.add("secondaryOutline"),this.updateProperties(n,e),this.#Kh.set(i,n),i}finalizeDraw(e,t){this.#Yh.delete(e),this.updateProperties(e,t)}updateProperties(e,t){if(!t)return;const{root:i,bbox:n,rootClass:a,path:s}=t,r="number"==typeof e?this.#Kh.get(e):e;if(r){if(i&&this.#ed(r,i),n&&DrawLayer.#Jh(r,n),a){const{classList:e}=r;for(const[t,i]of Object.entries(a))e.toggle(t,i)}if(s){const e=r.firstChild.firstChild;this.#ed(e,s)}}}updateParent(e,t){if(t===this)return;const i=this.#Kh.get(e);i&&(t.#wo.append(i),this.#Kh.delete(e),t.#Kh.set(e,i))}remove(e){this.#Yh.delete(e),null!==this.#wo&&(this.#Kh.get(e).remove(),this.#Kh.delete(e))}destroy(){this.#wo=null;for(const e of this.#Kh.values())e.remove();this.#Kh.clear(),this.#Yh.clear()}}globalThis._pdfjsTestingUtils={HighlightOutliner:HighlightOutliner},globalThis.pdfjsLib={AbortException:AbortException,AnnotationEditorLayer:AnnotationEditorLayer,AnnotationEditorParamsType:Xl,AnnotationEditorType:Hl,AnnotationEditorUIManager:AnnotationEditorUIManager,AnnotationLayer:AnnotationLayer,AnnotationMode:jl,AnnotationType:Zl,applyOpacity:applyOpacity,build:hh,ColorPicker:ColorPicker,createValidAbsoluteUrl:createValidAbsoluteUrl,CSSConstants:CSSConstants,DOMSVGFactory:DOMSVGFactory,DrawLayer:DrawLayer,FeatureTest:util_FeatureTest,fetchData:fetchData,findContrastColor:findContrastColor,getDocument:getDocument,getFilenameFromUrl:getFilenameFromUrl,getPdfFilenameFromUrl:getPdfFilenameFromUrl,getRGB:getRGB,getUuid:getUuid,getXfaPageViewport:getXfaPageViewport,GlobalWorkerOptions:GlobalWorkerOptions,ImageKind:Jl,InvalidPDFException:InvalidPDFException,isDataScheme:isDataScheme,isPdfFile:isPdfFile,isValidExplicitDest:Cc,MathClamp:MathClamp,noContextMenu:noContextMenu,normalizeUnicode:normalizeUnicode,OPS:sc,OutputScale:OutputScale,PasswordResponses:hc,PDFDataRangeTransport:PDFDataRangeTransport,PDFDateString:PDFDateString,PDFWorker:PDFWorker,PermissionFlag:ql,PixelsPerInch:PixelsPerInch,RenderingCancelledException:RenderingCancelledException,renderRichText:renderRichText,ResponseException:ResponseException,setLayerDimensions:setLayerDimensions,shadow:shadow,SignatureExtractor:SignatureExtractor,stopEvent:stopEvent,SupportedImageMimeTypes:yc,TextLayer:TextLayer,TouchManager:TouchManager,updateUrlHash:updateUrlHash,Util:Util,VerbosityLevel:ac,version:lh,XfaLayer:XfaLayer};export{AbortException,AnnotationEditorLayer,Xl as AnnotationEditorParamsType,Hl as AnnotationEditorType,AnnotationEditorUIManager,AnnotationLayer,jl as AnnotationMode,Zl as AnnotationType,CSSConstants,ColorPicker,DOMSVGFactory,DrawLayer,util_FeatureTest as FeatureTest,GlobalWorkerOptions,Jl as ImageKind,InvalidPDFException,MathClamp,sc as OPS,OutputScale,PDFDataRangeTransport,PDFDateString,PDFWorker,hc as PasswordResponses,ql as PermissionFlag,PixelsPerInch,RenderingCancelledException,ResponseException,SignatureExtractor,yc as SupportedImageMimeTypes,TextLayer,TouchManager,Util,ac as VerbosityLevel,XfaLayer,applyOpacity,hh as build,createValidAbsoluteUrl,fetchData,findContrastColor,getDocument,getFilenameFromUrl,getPdfFilenameFromUrl,getRGB,getUuid,getXfaPageViewport,isDataScheme,isPdfFile,Cc as isValidExplicitDest,noContextMenu,normalizeUnicode,renderRichText,setLayerDimensions,shadow,stopEvent,updateUrlHash,lh as version};