@xframework-ca-test/cli 1.0.32 → 1.0.34

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 (377) hide show
  1. package/dist/ui/assets/AIVision-0025192f.js +4 -0
  2. package/dist/ui/assets/AccountDetails-42610e44.js +1 -0
  3. package/dist/ui/assets/AccountDetails-5b4cd3f7.js +1 -0
  4. package/dist/ui/assets/AccountServices-f68f471d.js +1 -0
  5. package/dist/ui/assets/AccountsList-262479cf.js +1 -0
  6. package/dist/ui/assets/ActionLink-9db8b1c2.js +1 -0
  7. package/dist/ui/assets/AdaptableCard-3d1e1f96.js +1 -0
  8. package/dist/ui/assets/AddAccount-2cd72664.js +1 -0
  9. package/dist/ui/assets/AddEditFile-6ae10d57.js +1 -0
  10. package/dist/ui/assets/AddEditTranslation-3812ff0f.js +1 -0
  11. package/dist/ui/assets/AiApiLogList-1eac39b7.js +1 -0
  12. package/dist/ui/assets/AiCa-2e90495f.js +1 -0
  13. package/dist/ui/assets/Alert-59d09a99.js +1 -0
  14. package/dist/ui/assets/ApiService-df126758.js +1 -0
  15. package/dist/ui/assets/AppLandingPage-afcea727.js +4 -0
  16. package/dist/ui/assets/AuditLogsList-ea37686b.js +1 -0
  17. package/dist/ui/assets/Auth0Callback-00729568.js +1 -0
  18. package/dist/ui/assets/BarCodes-4ff49536.js +1 -0
  19. package/dist/ui/assets/BlankLayout-7085ab88.js +1 -0
  20. package/dist/ui/assets/{BrainServices-a4bb698e.js → BrainServices-4cb93af5.js} +1 -1
  21. package/dist/ui/assets/CalendarList-689ed66a.js +2 -0
  22. package/dist/ui/assets/CalendarList-f4a9aa21.css +8 -0
  23. package/dist/ui/assets/CategoryList-a6d01041.js +1 -0
  24. package/dist/ui/assets/CategoryList-c03f4259.js +1 -0
  25. package/dist/ui/assets/ChatContainer-fec7b84d.js +1 -0
  26. package/dist/ui/assets/ChatsList-4b3194e4.js +1 -0
  27. package/dist/ui/assets/Check-af681a30.js +1 -0
  28. package/dist/ui/assets/CheckInVideo-aa9f50b2.js +6 -0
  29. package/dist/ui/assets/ClassicLayout-a9866742.js +2 -0
  30. package/dist/ui/assets/CompanyList-94119d71.js +1 -0
  31. package/dist/ui/assets/{CompanyService-1bf7c3c8.js → CompanyService-491a9cc1.js} +1 -1
  32. package/dist/ui/assets/{Component-59e4c14b.js → Component-566d01e0.js} +1 -1
  33. package/dist/ui/assets/ConfirmDialog-2838a642.js +1 -0
  34. package/dist/ui/assets/ContactDetails-c9dc0ed1.js +1 -0
  35. package/dist/ui/assets/{ContactService-92281a90.js → ContactService-8afcaeb7.js} +1 -1
  36. package/dist/ui/assets/ContactsList-5b06c9b8.js +1 -0
  37. package/dist/ui/assets/CountiesList-18b23cf7.js +1 -0
  38. package/dist/ui/assets/CountyDetails-ea024f14.js +1 -0
  39. package/dist/ui/assets/CourseDetails-8a5f8d63.js +1 -0
  40. package/dist/ui/assets/CourseList-3564fec3.js +1 -0
  41. package/dist/ui/assets/{CourseService-f0dc3bf1.js → CourseService-29ad460c.js} +1 -1
  42. package/dist/ui/assets/CreateSignature-c22e4a71.js +7 -0
  43. package/dist/ui/assets/{CustomerInfoField-fff65ace.js → CustomerInfoField-4bf880e2.js} +1 -1
  44. package/dist/ui/assets/DeckedLayout-610fe851.js +1 -0
  45. package/dist/ui/assets/DensitySelector-5d2e901f.js +1 -0
  46. package/dist/ui/assets/{DepartmentServices-3d56a9e7.js → DepartmentServices-a53e998b.js} +1 -1
  47. package/dist/ui/assets/{DigitalSignature-fff42e33.js → DigitalSignature-69eaf80c.js} +1 -1
  48. package/dist/ui/assets/{DocumemtManagementService-6501a5c1.js → DocumemtManagementService-85cde51a.js} +1 -1
  49. package/dist/ui/assets/DocumentActivity-bc938c61.js +1 -0
  50. package/dist/ui/assets/DocumentLayout-a12982d7.js +1 -0
  51. package/dist/ui/assets/DocumentList2-9c8c6284.js +23 -0
  52. package/dist/ui/assets/DocumentLists-1cdaae06.js +1 -0
  53. package/dist/ui/assets/DocumentUserSigned-f7371fc5.js +7 -0
  54. package/dist/ui/assets/DocumentsList-3b25907c.js +1 -0
  55. package/dist/ui/assets/DoubleSidedImage-b4bd3915.js +1 -0
  56. package/dist/ui/assets/{Drawer-949c18c6.js → Drawer-4f97e662.js} +1 -1
  57. package/dist/ui/assets/DynamicDashboard-0a41d287.js +1 -0
  58. package/dist/ui/assets/{DynamicTablesService-963fe77b.js → DynamicTablesService-6aa57f52.js} +1 -1
  59. package/dist/ui/assets/EditAccount-e42d66af.js +1 -0
  60. package/dist/ui/assets/EditLead-c8c9760a.js +1 -0
  61. package/dist/ui/assets/FaqItems-25d66543.js +6 -0
  62. package/dist/ui/assets/{FileManagementServices-25fd64c5.js → FileManagementServices-19b47568.js} +1 -1
  63. package/dist/ui/assets/{FolderOpen-88bfcc74.js → FolderOpen-7b0e2ac0.js} +1 -1
  64. package/dist/ui/assets/FormContainer-9a52b9e8.js +1 -0
  65. package/dist/ui/assets/{GeneralSettings-a7f805e8.js → GeneralSettings-c8c2f051.js} +5 -5
  66. package/dist/ui/assets/GenericPage-81e41302.js +1 -0
  67. package/dist/ui/assets/GridMapDetails-38f50b3c.js +1 -0
  68. package/dist/ui/assets/HorizontalMenuContent-fd559f4d.js +1 -0
  69. package/dist/ui/assets/{ImportFile-3f60d715.js → ImportFile-026b1771.js} +1 -1
  70. package/dist/ui/assets/{InlineSignaturePad-09c06619.js → InlineSignaturePad-f5630151.js} +1 -1
  71. package/dist/ui/assets/InvoicesList-9723bc5a.js +1 -0
  72. package/dist/ui/assets/{KeyVaultService-874d83fe.js → KeyVaultService-9608f0ff.js} +1 -1
  73. package/dist/ui/assets/LeadDetails-8cdaae0e.js +1 -0
  74. package/dist/ui/assets/{LeadSourceService-e46fa85e.js → LeadSourceService-cf71ea64.js} +1 -1
  75. package/dist/ui/assets/LeadsList-1ec20a77.js +1 -0
  76. package/dist/ui/assets/Logo-dd6f7656.js +1 -0
  77. package/dist/ui/assets/MapView-dcab88b3.js +1 -0
  78. package/dist/ui/assets/MarketingPage-998d10b0.js +4 -0
  79. package/dist/ui/assets/MenuNew-79fc95f3.js +1 -0
  80. package/dist/ui/assets/{MenuTable-c2c65021.js → MenuTable-f69e0fe4.js} +1 -1
  81. package/dist/ui/assets/MessageInput-07fcc5cb.js +21 -0
  82. package/dist/ui/assets/MessagesList-21d2b034.js +1 -0
  83. package/dist/ui/assets/ModernLayout-05af7cf7.js +1 -0
  84. package/dist/ui/assets/{NoData-8c485a3a.js → NoData-4cc4af03.js} +1 -1
  85. package/dist/ui/assets/Notify-8fb74d48.js +1 -0
  86. package/dist/ui/assets/OpportunitiesList-2f96958f.js +1 -0
  87. package/dist/ui/assets/OpportunityDetails-aaec3200.js +1 -0
  88. package/dist/ui/assets/{OpportunityServices-fa4fabfd.js → OpportunityServices-c4510dd2.js} +1 -1
  89. package/dist/ui/assets/OpportunityStatus-ea3b5ee2.js +1 -0
  90. package/dist/ui/assets/PageBreadcrumb-cf54a6e9.js +1 -0
  91. package/dist/ui/assets/{Password-d9294711.js → Password-21414dc6.js} +1 -1
  92. package/dist/ui/assets/PasswordInput-333c82ca.js +1 -0
  93. package/dist/ui/assets/{PreferenceService-75bf9db6.js → PreferenceService-d2b3e003.js} +1 -1
  94. package/dist/ui/assets/Profile-8c9fd2fc.js +1 -0
  95. package/dist/ui/assets/{ReportEditor-8880f57e.js → ReportEditor-4e4f6d53.js} +3 -3
  96. package/dist/ui/assets/{ReportViewer-9f1080f7.js → ReportViewer-616d3cfc.js} +30 -30
  97. package/dist/ui/assets/RoleEdit-a076ea85.js +1 -0
  98. package/dist/ui/assets/RoleForm-47691f91.js +1 -0
  99. package/dist/ui/assets/{RoleNew-49fadb16.js → RoleNew-e86a1513.js} +1 -1
  100. package/dist/ui/assets/{RoleService-7008da2c.js → RoleService-2f9ed883.js} +1 -1
  101. package/dist/ui/assets/ScheduleCycle-0ae23631.js +1 -0
  102. package/dist/ui/assets/{ScheduleService-7228f0a3.js → ScheduleService-41a88c41.js} +1 -1
  103. package/dist/ui/assets/ScreenList-8f58150b.js +1 -0
  104. package/dist/ui/assets/Settings-fc91c9d2.js +2 -0
  105. package/dist/ui/assets/{SetupWizard-4172e377.js → SetupWizard-d1363582.js} +1 -1
  106. package/dist/ui/assets/SimpleLayout-77cfb778.js +1 -0
  107. package/dist/ui/assets/StackedSideLayout-2f1ee9d1.js +1 -0
  108. package/dist/ui/assets/StickyFooter-3e569b80.js +1 -0
  109. package/dist/ui/assets/SupportRequets-0ecd4ab8.js +1 -0
  110. package/dist/ui/assets/{Switcher-c8648037.js → Switcher-e2fba588.js} +1 -1
  111. package/dist/ui/assets/TimeLogApprovalDataList-7b49a432.js +1 -0
  112. package/dist/ui/assets/TimeLogApprovalList-78cab2b6.js +1 -0
  113. package/dist/ui/assets/TimeLogList-592b29aa.js +1 -0
  114. package/dist/ui/assets/{TimeLogService-cd7b2f61.js → TimeLogService-83166cbc.js} +1 -1
  115. package/dist/ui/assets/TimesheetsList-d1520efb.js +1 -0
  116. package/dist/ui/assets/TranslationList-88d7d5d7.js +1 -0
  117. package/dist/ui/assets/TweaksPanel-bc10bc47.js +112 -0
  118. package/dist/ui/assets/{Upload-fb34ce03.js → Upload-be937eb6.js} +4 -4
  119. package/dist/ui/assets/UserEdit-1f8208f3.js +1 -0
  120. package/dist/ui/assets/UserForm-e9b56aff.js +1 -0
  121. package/dist/ui/assets/{UserNew-b36c342c.js → UserNew-31fa258f.js} +1 -1
  122. package/dist/ui/assets/{UserService-047aef51.js → UserService-1b93ceb0.js} +1 -1
  123. package/dist/ui/assets/ViewTimeLogForApproval-ae077050.js +1 -0
  124. package/dist/ui/assets/Views-1359da48.js +1 -0
  125. package/dist/ui/assets/WelcomeList-dc8666ec.js +9 -0
  126. package/dist/ui/assets/WidgetLayoutsService-49730609.js +1 -0
  127. package/dist/ui/assets/{WrapperCell-a7981b07.js → WrapperCell-3d5592cf.js} +1 -1
  128. package/dist/ui/assets/actioncell-6b5ebd6c.js +1 -0
  129. package/dist/ui/assets/{ar-3c9c213e.js → ar-fb4f0ea8.js} +1 -1
  130. package/dist/ui/assets/calendarList-ac838a86.js +2 -0
  131. package/dist/ui/assets/{cjs-162261df.js → cjs-998de55c.js} +1 -1
  132. package/dist/ui/assets/createSvgIcon-aba65987.js +1 -0
  133. package/dist/ui/assets/documentsList-4e2e061e.js +1 -0
  134. package/dist/ui/assets/{es-be649ede.js → es-cd58d3ad.js} +1 -1
  135. package/dist/ui/assets/{esm-f306d015.js → esm-c40433f8.js} +1 -1
  136. package/dist/ui/assets/gridList-e1571c87.js +1 -0
  137. package/dist/ui/assets/gridMapTable-d95f9c70.js +1 -0
  138. package/dist/ui/assets/{index-f6be0390.js → index-00a8eb64.js} +1 -1
  139. package/dist/ui/assets/index-04438b6b.js +22 -0
  140. package/dist/ui/assets/index-058738bc.js +1 -0
  141. package/dist/ui/assets/{index-e4c6057f.js → index-0b08ce18.js} +1 -1
  142. package/dist/ui/assets/index-0d730815.js +4 -0
  143. package/dist/ui/assets/index-0efcf53a.js +1 -0
  144. package/dist/ui/assets/index-0f432250.js +1 -0
  145. package/dist/ui/assets/{index-cebd880b.js → index-0fd6e996.js} +1 -1
  146. package/dist/ui/assets/{index-49a94e54.js → index-11297f4a.js} +1 -1
  147. package/dist/ui/assets/index-14c1c1d7.js +1 -0
  148. package/dist/ui/assets/index-15e1f4be.js +1 -0
  149. package/dist/ui/assets/index-16586c21.js +1 -0
  150. package/dist/ui/assets/index-19346c14.js +1 -0
  151. package/dist/ui/assets/{index-16bb10a6.js → index-1dc2b9d2.js} +1 -1
  152. package/dist/ui/assets/index-211fbe21.js +1 -0
  153. package/dist/ui/assets/index-23e16bff.js +1 -0
  154. package/dist/ui/assets/index-27aef8b5.js +1 -0
  155. package/dist/ui/assets/{index-36228db5.js → index-289b3fd9.js} +1 -1
  156. package/dist/ui/assets/{index-a22a3546.js → index-2dae59b1.js} +1 -1
  157. package/dist/ui/assets/index-353fd6dd.js +1 -0
  158. package/dist/ui/assets/{index-ea125a16.js → index-359d245d.js} +1 -1
  159. package/dist/ui/assets/{index-c62ac197.js → index-3b5ce20a.js} +70 -62
  160. package/dist/ui/assets/index-3b929ba4.js +34 -0
  161. package/dist/ui/assets/index-42e3a337.js +1 -0
  162. package/dist/ui/assets/index-44b6de3a.js +1 -0
  163. package/dist/ui/assets/index-46d3ca9a.js +7 -0
  164. package/dist/ui/assets/{index-e3cc723f.js → index-49016ad0.js} +1 -1
  165. package/dist/ui/assets/index-51132258.js +1 -0
  166. package/dist/ui/assets/{index-dc103f22.js → index-52963879.js} +1 -1
  167. package/dist/ui/assets/{index-fcc1c999.js → index-533fd007.js} +1 -1
  168. package/dist/ui/assets/index-59ec468b.js +13 -0
  169. package/dist/ui/assets/index-5e2d5279.js +1 -0
  170. package/dist/ui/assets/{index-d17da176.js → index-62f95885.js} +1 -1
  171. package/dist/ui/assets/index-659c6412.js +1 -0
  172. package/dist/ui/assets/index-6873dfc3.js +1 -0
  173. package/dist/ui/assets/index-69a68d9e.js +1 -0
  174. package/dist/ui/assets/index-6a6902c7.js +1 -0
  175. package/dist/ui/assets/index-7596c6bb.js +1 -0
  176. package/dist/ui/assets/{index-47dcc43a.js → index-8045c5f0.js} +1 -1
  177. package/dist/ui/assets/{index-b028e652.js → index-8677acd1.js} +1 -1
  178. package/dist/ui/assets/{index-42e65911.js → index-88c52b97.js} +1 -1
  179. package/dist/ui/assets/index-89cfefab.js +1 -0
  180. package/dist/ui/assets/{index-bea4c3dc.js → index-8c0643fd.js} +1 -1
  181. package/dist/ui/assets/index-8d5b6a1f.js +1 -0
  182. package/dist/ui/assets/index-8d5d70f9.js +1 -0
  183. package/dist/ui/assets/{index-9b41371d.js → index-91505016.js} +1 -1
  184. package/dist/ui/assets/{index-ffc00dbb.js → index-92314073.js} +1 -1
  185. package/dist/ui/assets/index-985cf3f6.js +1 -0
  186. package/dist/ui/assets/index-a14e51de.js +1 -0
  187. package/dist/ui/assets/index-a733f80b.js +1 -0
  188. package/dist/ui/assets/index-a84d5808.js +1 -0
  189. package/dist/ui/assets/index-acac6006.js +1 -0
  190. package/dist/ui/assets/index-b0ef7ac3.js +1 -0
  191. package/dist/ui/assets/index-b6ef5984.js +1 -0
  192. package/dist/ui/assets/{index-fc9071e0.js → index-bd4edda3.js} +1 -1
  193. package/dist/ui/assets/{index-0ec72c4b.js → index-c29b8474.js} +1 -1
  194. package/dist/ui/assets/index-c88c7790.js +19 -0
  195. package/dist/ui/assets/index-ce89a95e.css +7 -0
  196. package/dist/ui/assets/index-d221d69e.js +1 -0
  197. package/dist/ui/assets/{index-f1576468.js → index-d33facae.js} +1 -1
  198. package/dist/ui/assets/index-e46c57a5.js +1 -0
  199. package/dist/ui/assets/index-e863817c.js +1 -0
  200. package/dist/ui/assets/index-f4af2342.js +1 -0
  201. package/dist/ui/assets/{index-77e820d0.js → index-fc9f8c4b.js} +1 -1
  202. package/dist/ui/assets/{index-ec2010d2.js → index-ff23edc5.js} +1 -1
  203. package/dist/ui/assets/{index.esm-70ab539c.js → index.esm-b2d342b5.js} +1 -1
  204. package/dist/ui/assets/liveLocation-8e0bb2f3.js +1 -0
  205. package/dist/ui/assets/{mapView-ab35acaa.js → mapView-c8063ed6.js} +1 -1
  206. package/dist/ui/assets/modeuls-setup-4b06843c.js +1 -0
  207. package/dist/ui/assets/{permissionHoc-6f787658.js → permissionHoc-0818bfb0.js} +1 -1
  208. package/dist/ui/assets/{react-21134174.js → react-12ddbe48.js} +1 -1
  209. package/dist/ui/assets/{react-4d5dc208.js → react-61e0b284.js} +1 -1
  210. package/dist/ui/assets/{strongPassword-bbec776a.js → strongPassword-6bc8786f.js} +1 -1
  211. package/dist/ui/assets/{styles-0608350c.js → styles-b7ae7bf6.js} +1 -1
  212. package/dist/ui/assets/{tableV2-4d1c9fd2.js → tableV2-99c808c0.js} +1 -1
  213. package/dist/ui/assets/tableV3-24eed052.js +1 -0
  214. package/dist/ui/assets/ticketRequestDetails-8b299fbd.js +1 -0
  215. package/dist/ui/assets/{useDidUpdate-25c4d4ed.js → useDidUpdate-de319a18.js} +1 -1
  216. package/dist/ui/assets/{useDrop-02b0e5d7.js → useDrop-8f0d11a7.js} +1 -1
  217. package/dist/ui/assets/useFilteredData-e8fad668.js +1 -0
  218. package/dist/ui/assets/{usePermission-d94b4984.js → usePermission-4689548c.js} +1 -1
  219. package/dist/ui/assets/{vendor-charts-eccea5d1.js → vendor-charts-4be0b5ab.js} +1 -1
  220. package/dist/ui/assets/{vendor-codemirror-c8203b49.js → vendor-codemirror-1a1216c9.js} +11 -11
  221. package/dist/ui/assets/{vendor-devex-33a39e11.js → vendor-devex-4076ffeb.js} +2 -2
  222. package/dist/ui/assets/{vendor-excel-ee8fc4e5.js → vendor-excel-3b3553df.js} +1 -1
  223. package/dist/ui/assets/{vendor-i18n-2fcb1983.js → vendor-i18n-b89304ef.js} +1 -1
  224. package/dist/ui/assets/vendor-mui-98daa63f.js +185 -0
  225. package/dist/ui/assets/{vendor-pdf-b2a5d8b1.js → vendor-pdf-3c29882d.js} +1 -1
  226. package/dist/ui/assets/withHeaderItem-df2cc5d9.js +1 -0
  227. package/dist/ui/assets/{zh-cn-1881e930.js → zh-cn-13c6c696.js} +1 -1
  228. package/dist/ui/config.js +16 -20
  229. package/dist/ui/index.html +9 -9
  230. package/dist/ui/manifest.json +2 -2
  231. package/index.bundle.js +23 -9
  232. package/package.json +1 -1
  233. package/dist/ui/assets/AIVision-4f515575.js +0 -4
  234. package/dist/ui/assets/AccountDetails-2b42d262.js +0 -1
  235. package/dist/ui/assets/AccountDetails-492dee8f.js +0 -1
  236. package/dist/ui/assets/AccountServices-62599aae.js +0 -1
  237. package/dist/ui/assets/AccountsList-fe7cb5f9.js +0 -1
  238. package/dist/ui/assets/ActionLink-33e476e1.js +0 -1
  239. package/dist/ui/assets/AdaptableCard-df7695d6.js +0 -1
  240. package/dist/ui/assets/AddAccount-a05910e8.js +0 -1
  241. package/dist/ui/assets/AddEditFile-063c229b.js +0 -1
  242. package/dist/ui/assets/AddEditTranslation-43beae49.js +0 -1
  243. package/dist/ui/assets/AiApiLogList-a488921d.js +0 -1
  244. package/dist/ui/assets/AiCa-9c1b25b2.js +0 -1
  245. package/dist/ui/assets/Alert-7dfbd254.js +0 -1
  246. package/dist/ui/assets/ApiService-2b99757f.js +0 -1
  247. package/dist/ui/assets/AppLandingPage-3956cf0c.js +0 -4
  248. package/dist/ui/assets/AuditLogsList-7a2ce37d.js +0 -1
  249. package/dist/ui/assets/Auth0Callback-b943f19f.js +0 -1
  250. package/dist/ui/assets/BarCodes-17ed5da4.js +0 -1
  251. package/dist/ui/assets/BlankLayout-2f6e1153.js +0 -1
  252. package/dist/ui/assets/CalendarList-25834ddb.css +0 -11
  253. package/dist/ui/assets/CalendarList-72739043.js +0 -2
  254. package/dist/ui/assets/CategoryList-9f82e9a3.js +0 -1
  255. package/dist/ui/assets/CategoryList-c97891e7.js +0 -1
  256. package/dist/ui/assets/ChatContainer-4a38b179.js +0 -1
  257. package/dist/ui/assets/ChatsList-6c2c3e2f.js +0 -1
  258. package/dist/ui/assets/Check-71f21a49.js +0 -1
  259. package/dist/ui/assets/CheckInVideo-cb5fa9a2.js +0 -6
  260. package/dist/ui/assets/ClassicLayout-7d09e5ac.js +0 -1
  261. package/dist/ui/assets/CompanyList-9532f511.js +0 -1
  262. package/dist/ui/assets/ConfirmDialog-3202eb3d.js +0 -1
  263. package/dist/ui/assets/ContactDetails-3b70919b.js +0 -1
  264. package/dist/ui/assets/ContactsList-e9ac0fa3.js +0 -1
  265. package/dist/ui/assets/CountiesList-6ad338a5.js +0 -1
  266. package/dist/ui/assets/CountyDetails-22d4bc89.js +0 -1
  267. package/dist/ui/assets/CourseDetails-18040b49.js +0 -1
  268. package/dist/ui/assets/CourseList-e502f89d.js +0 -1
  269. package/dist/ui/assets/CreateSignature-375d191b.js +0 -7
  270. package/dist/ui/assets/DeckedLayout-909ac220.js +0 -1
  271. package/dist/ui/assets/DensitySelector-a2c1c68f.js +0 -1
  272. package/dist/ui/assets/DocumentActivity-d63dacec.js +0 -1
  273. package/dist/ui/assets/DocumentLayout-637075fd.js +0 -1
  274. package/dist/ui/assets/DocumentList2-518d2fa4.js +0 -23
  275. package/dist/ui/assets/DocumentLists-2da9ff88.js +0 -1
  276. package/dist/ui/assets/DocumentUserSigned-27bfa6e6.js +0 -7
  277. package/dist/ui/assets/DocumentsList-9f56db71.js +0 -1
  278. package/dist/ui/assets/DoubleSidedImage-ae98733b.js +0 -1
  279. package/dist/ui/assets/DynamicDashboard-6f177244.js +0 -1
  280. package/dist/ui/assets/EditAccount-1c1a8318.js +0 -1
  281. package/dist/ui/assets/EditLead-cc38d2a2.js +0 -1
  282. package/dist/ui/assets/FaqItems-c1c85af7.js +0 -6
  283. package/dist/ui/assets/FormContainer-91c2b0e4.js +0 -1
  284. package/dist/ui/assets/GenericPage-25a5d92a.js +0 -1
  285. package/dist/ui/assets/GridMapDetails-851a5781.js +0 -1
  286. package/dist/ui/assets/HorizontalMenuContent-96da38e1.js +0 -1
  287. package/dist/ui/assets/InvoicesList-8e66a112.js +0 -1
  288. package/dist/ui/assets/LeadDetails-ad63b3df.js +0 -1
  289. package/dist/ui/assets/LeadsList-bd7d9804.js +0 -1
  290. package/dist/ui/assets/Logo-3f3c9ee6.js +0 -1
  291. package/dist/ui/assets/MapView-afd1c913.js +0 -1
  292. package/dist/ui/assets/MarketingPage-89a860b1.js +0 -4
  293. package/dist/ui/assets/MenuEdit-d6e0d64c.js +0 -1
  294. package/dist/ui/assets/MessageInput-6dc83761.js +0 -21
  295. package/dist/ui/assets/MessagesList-966b69c5.js +0 -1
  296. package/dist/ui/assets/ModernLayout-03f30574.js +0 -1
  297. package/dist/ui/assets/Notify-bb3ce372.js +0 -1
  298. package/dist/ui/assets/OpportunitiesList-62eb34f6.js +0 -1
  299. package/dist/ui/assets/OpportunityDetails-356a8580.js +0 -1
  300. package/dist/ui/assets/OpportunityStatus-fa8108ea.js +0 -1
  301. package/dist/ui/assets/PasswordInput-8619a9df.js +0 -1
  302. package/dist/ui/assets/Profile-9104808b.js +0 -1
  303. package/dist/ui/assets/RoleEdit-98a6410b.js +0 -1
  304. package/dist/ui/assets/RoleForm-cc251eba.js +0 -1
  305. package/dist/ui/assets/ScheduleCycle-22c8e809.js +0 -1
  306. package/dist/ui/assets/ScreenList-9f7afa1c.js +0 -1
  307. package/dist/ui/assets/SidePanelContent-6b13836f.js +0 -1
  308. package/dist/ui/assets/SimpleLayout-d5445c0d.js +0 -2
  309. package/dist/ui/assets/StackedSideLayout-51127dc5.js +0 -1
  310. package/dist/ui/assets/StickyFooter-5b934274.js +0 -1
  311. package/dist/ui/assets/SupportRequets-be6542a9.js +0 -1
  312. package/dist/ui/assets/TimeLogApprovalDataList-c16d8bae.js +0 -1
  313. package/dist/ui/assets/TimeLogApprovalList-f6a75a20.js +0 -1
  314. package/dist/ui/assets/TimeLogList-ea288cce.js +0 -1
  315. package/dist/ui/assets/TimesheetsList-4a20e96c.js +0 -1
  316. package/dist/ui/assets/TranslationList-7a989333.js +0 -1
  317. package/dist/ui/assets/UserEdit-87262ea5.js +0 -1
  318. package/dist/ui/assets/UserForm-31fdd3b3.js +0 -1
  319. package/dist/ui/assets/ViewTimeLogForApproval-43b24a1a.js +0 -1
  320. package/dist/ui/assets/Views-74429e81.js +0 -1
  321. package/dist/ui/assets/WelcomeList-6c693eae.js +0 -9
  322. package/dist/ui/assets/actioncell-17e12e21.js +0 -1
  323. package/dist/ui/assets/calendarList-511b4d8f.js +0 -2
  324. package/dist/ui/assets/createSvgIcon-c5fc0d04.js +0 -1
  325. package/dist/ui/assets/documentsList-ac2c91ec.js +0 -1
  326. package/dist/ui/assets/dxicons-4c1b2089.ttf +0 -0
  327. package/dist/ui/assets/dxicons-ade3c9ed.woff2 +0 -0
  328. package/dist/ui/assets/dxicons-b4cd1226.woff +0 -0
  329. package/dist/ui/assets/gridList-cb9a14b1.js +0 -1
  330. package/dist/ui/assets/gridMapTable-c19770a8.js +0 -1
  331. package/dist/ui/assets/index-1d60e514.js +0 -1
  332. package/dist/ui/assets/index-26466d9d.js +0 -1
  333. package/dist/ui/assets/index-289cfedb.js +0 -1
  334. package/dist/ui/assets/index-2ce5b358.js +0 -1
  335. package/dist/ui/assets/index-307ce6d7.js +0 -1
  336. package/dist/ui/assets/index-36ba4ea7.js +0 -1
  337. package/dist/ui/assets/index-3f02e05a.js +0 -1
  338. package/dist/ui/assets/index-44662933.js +0 -13
  339. package/dist/ui/assets/index-51ee35f9.js +0 -1
  340. package/dist/ui/assets/index-54372d82.js +0 -1
  341. package/dist/ui/assets/index-569a9d2c.js +0 -1
  342. package/dist/ui/assets/index-62de659f.js +0 -13
  343. package/dist/ui/assets/index-6589dd2d.js +0 -1
  344. package/dist/ui/assets/index-6b6d0f06.js +0 -1
  345. package/dist/ui/assets/index-6c618440.js +0 -1
  346. package/dist/ui/assets/index-785ad361.js +0 -1
  347. package/dist/ui/assets/index-7df8779c.js +0 -1
  348. package/dist/ui/assets/index-82c9477e.js +0 -1
  349. package/dist/ui/assets/index-8ab45286.js +0 -1
  350. package/dist/ui/assets/index-8c229076.css +0 -7
  351. package/dist/ui/assets/index-a205cfed.js +0 -34
  352. package/dist/ui/assets/index-a23f9c87.js +0 -1
  353. package/dist/ui/assets/index-a455424a.js +0 -1
  354. package/dist/ui/assets/index-a4f78ee1.js +0 -1
  355. package/dist/ui/assets/index-aaad94c2.js +0 -1
  356. package/dist/ui/assets/index-b1b6b0f6.js +0 -1
  357. package/dist/ui/assets/index-c1f92742.js +0 -4
  358. package/dist/ui/assets/index-c2088808.js +0 -1
  359. package/dist/ui/assets/index-cbc29fa8.js +0 -1
  360. package/dist/ui/assets/index-cd2b7d32.js +0 -1
  361. package/dist/ui/assets/index-cf3804f1.js +0 -19
  362. package/dist/ui/assets/index-d0ef2cc2.js +0 -1
  363. package/dist/ui/assets/index-d1145737.js +0 -7
  364. package/dist/ui/assets/index-d58fb185.js +0 -1
  365. package/dist/ui/assets/index-d5b5a7e1.js +0 -1
  366. package/dist/ui/assets/index-daeff047.js +0 -1
  367. package/dist/ui/assets/index-ded3b055.js +0 -1
  368. package/dist/ui/assets/index-ede23a2b.js +0 -1
  369. package/dist/ui/assets/index-f8144346.js +0 -1
  370. package/dist/ui/assets/index-fd68b510.js +0 -1
  371. package/dist/ui/assets/index-fe3409ae.js +0 -1
  372. package/dist/ui/assets/liveLocation-646eef95.js +0 -1
  373. package/dist/ui/assets/modeuls-setup-402f891e.js +0 -1
  374. package/dist/ui/assets/tableV3-3d2f4952.js +0 -1
  375. package/dist/ui/assets/ticketRequestDetails-f78147f7.js +0 -1
  376. package/dist/ui/assets/vendor-mui-69397583.js +0 -185
  377. package/dist/ui/menudata/menus.json +0 -606
@@ -1,4 +1,4 @@
1
- var dv=Object.defineProperty;var uv=(d,t,e)=>t in d?dv(d,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[t]=e;var k=(d,t,e)=>(uv(d,typeof t!="symbol"?t+"":t,e),e),jg=(d,t,e)=>{if(!t.has(d))throw TypeError("Cannot "+e)};var n=(d,t,e)=>(jg(d,t,"read from private field"),e?e.call(d):t.get(d)),f=(d,t,e)=>{if(t.has(d))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(d):t.set(d,e)},p=(d,t,e,s)=>(jg(d,t,"write to private field"),s?s.call(d,e):t.set(d,e),e);var Ht=(d,t,e,s)=>({set _(i){p(d,t,i,e)},get _(){return n(d,t,s)}}),b=(d,t,e)=>(jg(d,t,"access private method"),e);import{j as Dt}from"./vendor-mui-69397583.js";import{g as fv,r as $}from"./vendor-react-ece1c85f.js";const pv="modulepreload",gv=function(d){return"/"+d},Vb={},mv=function(t,e,s){if(!e||e.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(e.map(r=>{if(r=gv(r),r in Vb)return;Vb[r]=!0;const a=r.endsWith(".css"),o=a?'[rel="stylesheet"]':"";if(!!s)for(let c=i.length-1;c>=0;c--){const u=i[c];if(u.href===r&&(!a||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${o}`))return;const h=document.createElement("link");if(h.rel=a?"stylesheet":pv,a||(h.as="script",h.crossOrigin=""),h.href=r,document.head.appendChild(h),a)return new Promise((c,u)=>{h.addEventListener("load",c),h.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t()).catch(r=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r})};var bv=function(){},yv=bv;const Ae=fv(yv),Te=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),Qg=[.001,0,0,.001,0,0],Gg=1.35,ns={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},gi={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Xh="pdfjs_internal_editor_",z={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},J={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},Ry={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},ee={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Wh={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Mt={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},to={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},ku={ERRORS:0,WARNINGS:1,INFOS:5},mh={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},Hu={moveTo:0,lineTo:1,curveTo:2,closePath:3},ky={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let kg=ku.WARNINGS;function Av(d){Number.isInteger(d)&&(kg=d)}function wv(){return kg}function Dg(d){kg>=ku.INFOS&&console.info(`Info: ${d}`)}function V(d){kg>=ku.WARNINGS&&console.warn(`Warning: ${d}`)}function ft(d){throw new Error(d)}function Z(d,t){d||ft(t)}function vv(d){switch(d==null?void 0:d.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function _b(d,t=null,e=null){if(!d)return null;if(e&&typeof d=="string"){if(e.addDefaultProtocol&&d.startsWith("www.")){const i=d.match(/\./g);(i==null?void 0:i.length)>=2&&(d=`http://${d}`)}if(e.tryConvertEncoding)try{d=Tv(d)}catch{}}const s=t?URL.parse(d,t):URL.parse(d);return vv(s)?s:null}function Cb(d,t,e=!1){const s=URL.parse(d);return s?(s.hash=t,s.href):e&&_b(d,"http://example.com")?d.split("#",1)[0]+`${t?`#${t}`:""}`:""}function q(d,t,e,s=!1){return Object.defineProperty(d,t,{value:e,enumerable:!s,configurable:!0,writable:!1}),e}const Ka=function(){function t(e,s){this.message=e,this.name=s}return t.prototype=new Error,t.constructor=t,t}();class Wb extends Ka{constructor(t,e){super(t,"PasswordException"),this.code=e}}class zg extends Ka{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Pf extends Ka{constructor(t){super(t,"InvalidPDFException")}}class qh extends Ka{constructor(t,e,s){super(t,"ResponseException"),this.status=e,this.missing=s}}class Ev extends Ka{constructor(t){super(t,"FormatError")}}class an extends Ka{constructor(t){super(t,"AbortException")}}function Dy(d){(typeof d!="object"||(d==null?void 0:d.length)===void 0)&&ft("Invalid argument for bytesToString");const t=d.length,e=8192;if(t<e)return String.fromCharCode.apply(null,d);const s=[];for(let i=0;i<t;i+=e){const r=Math.min(i+e,t),a=d.subarray(i,r);s.push(String.fromCharCode.apply(null,a))}return s.join("")}function Du(d){typeof d!="string"&&ft("Invalid argument for stringToBytes");const t=d.length,e=new Uint8Array(t);for(let s=0;s<t;++s)e[s]=d.charCodeAt(s)&255;return e}function Sv(d){return String.fromCharCode(d>>24&255,d>>16&255,d>>8&255,d&255)}function _v(){const d=new Uint8Array(4);return d[0]=1,new Uint32Array(d.buffer,0,1)[0]===1}function Cv(){try{return new Function(""),!0}catch{return!1}}class Zt{static get isLittleEndian(){return q(this,"isLittleEndian",_v())}static get isEvalSupported(){return q(this,"isEvalSupported",Cv())}static get isOffscreenCanvasSupported(){return q(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return q(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:t,userAgent:e}=navigator;return q(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){var t,e;return q(this,"isCSSRoundSupported",(e=(t=globalThis.CSS)==null?void 0:t.supports)==null?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const Vg=Array.from(Array(256).keys(),d=>d.toString(16).padStart(2,"0"));var bo,Yu,ec,Zg;class O{static makeHexColor(t,e,s){return`#${Vg[t]}${Vg[e]}${Vg[s]}`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,e){let s;t[0]?(t[0]<0&&(s=e[0],e[0]=e[2],e[2]=s),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(s=e[1],e[1]=e[3],e[3]=s),e[1]*=t[3],e[3]*=t[3]):(s=e[0],e[0]=e[1],e[1]=s,s=e[2],e[2]=e[3],e[3]=s,t[1]<0&&(s=e[1],e[1]=e[3],e[3]=s),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(s=e[0],e[0]=e[2],e[2]=s),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,s=0){const i=t[s],r=t[s+1];t[s]=i*e[0]+r*e[2]+e[4],t[s+1]=i*e[1]+r*e[3]+e[5]}static applyTransformToBezier(t,e,s=0){const i=e[0],r=e[1],a=e[2],o=e[3],l=e[4],h=e[5];for(let c=0;c<6;c+=2){const u=t[s+c],g=t[s+c+1];t[s+c]=u*i+g*a+l,t[s+c+1]=u*r+g*o+h}}static applyInverseTransform(t,e){const s=t[0],i=t[1],r=e[0]*e[3]-e[1]*e[2];t[0]=(s*e[3]-i*e[2]+e[2]*e[5]-e[4]*e[3])/r,t[1]=(-s*e[1]+i*e[0]+e[4]*e[1]-e[5]*e[0])/r}static axialAlignedBoundingBox(t,e,s){const i=e[0],r=e[1],a=e[2],o=e[3],l=e[4],h=e[5],c=t[0],u=t[1],g=t[2],m=t[3];let A=i*c+l,y=A,v=i*g+l,w=v,E=o*u+h,S=E,_=o*m+h,C=_;if(r!==0||a!==0){const T=r*c,x=r*g,P=a*u,R=a*m;A+=P,w+=P,v+=R,y+=R,E+=T,C+=T,_+=x,S+=x}s[0]=Math.min(s[0],A,v,y,w),s[1]=Math.min(s[1],E,_,S,C),s[2]=Math.max(s[2],A,v,y,w),s[3]=Math.max(s[3],E,_,S,C)}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const s=t[0],i=t[1],r=t[2],a=t[3],o=s**2+i**2,l=s*r+i*a,h=r**2+a**2,c=(o+h)/2,u=Math.sqrt(c**2-(o*h-l**2));e[0]=Math.sqrt(c+u||1),e[1]=Math.sqrt(c-u||1)}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const s=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(s>i)return null;const r=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return r>a?null:[s,r,i,a]}static pointBoundingBox(t,e,s){s[0]=Math.min(s[0],t),s[1]=Math.min(s[1],e),s[2]=Math.max(s[2],t),s[3]=Math.max(s[3],e)}static rectBoundingBox(t,e,s,i,r){r[0]=Math.min(r[0],t,s),r[1]=Math.min(r[1],e,i),r[2]=Math.max(r[2],t,s),r[3]=Math.max(r[3],e,i)}static bezierBoundingBox(t,e,s,i,r,a,o,l,h){h[0]=Math.min(h[0],t,o),h[1]=Math.min(h[1],e,l),h[2]=Math.max(h[2],t,o),h[3]=Math.max(h[3],e,l),b(this,ec,Zg).call(this,t,s,r,o,e,i,a,l,3*(-t+3*(s-r)+o),6*(t-2*s+r),3*(s-t),h),b(this,ec,Zg).call(this,t,s,r,o,e,i,a,l,3*(-e+3*(i-a)+l),6*(e-2*i+a),3*(i-e),h)}}bo=new WeakSet,Yu=function(t,e,s,i,r,a,o,l,h,c){if(h<=0||h>=1)return;const u=1-h,g=h*h,m=g*h,A=u*(u*(u*t+3*h*e)+3*g*s)+m*i,y=u*(u*(u*r+3*h*a)+3*g*o)+m*l;c[0]=Math.min(c[0],A),c[1]=Math.min(c[1],y),c[2]=Math.max(c[2],A),c[3]=Math.max(c[3],y)},ec=new WeakSet,Zg=function(t,e,s,i,r,a,o,l,h,c,u,g){if(Math.abs(h)<1e-12){Math.abs(c)>=1e-12&&b(this,bo,Yu).call(this,t,e,s,i,r,a,o,l,-u/c,g);return}const m=c**2-4*u*h;if(m<0)return;const A=Math.sqrt(m),y=2*h;b(this,bo,Yu).call(this,t,e,s,i,r,a,o,l,(-c+A)/y,g),b(this,bo,Yu).call(this,t,e,s,i,r,a,o,l,(-c-A)/y,g)},f(O,bo),f(O,ec);function Tv(d){return decodeURIComponent(escape(d))}let Wg=null,Xb=null;function My(d){return Wg||(Wg=/([\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,Xb=new Map([["ſt","ſt"]])),d.replaceAll(Wg,(t,e,s)=>e?e.normalize("NFKC"):Xb.get(s))}function Tb(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const d=new Uint8Array(32);return crypto.getRandomValues(d),Dy(d)}const xb="pdfjs_internal_id_";function xv(d,t,e){if(!Array.isArray(e)||e.length<2)return!1;const[s,i,...r]=e;if(!d(s)&&!Number.isInteger(s)||!t(i))return!1;const a=r.length;let o=!0;switch(i.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return a===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(a!==4)return!1;o=!1;break;default:return!1}for(const l of r)if(!(typeof l=="number"||o&&l===null))return!1;return!0}function ye(d,t,e){return Math.min(Math.max(d,t),e)}function Ly(d){return Uint8Array.prototype.toBase64?d.toBase64():btoa(Dy(d))}function Pv(d){return Uint8Array.fromBase64?Uint8Array.fromBase64(d):Du(atob(d))}typeof Promise.try!="function"&&(Promise.try=function(d,...t){return new Promise(e=>{e(d(...t))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(d){return d.reduce((t,e)=>t+e,0)});class Yh{static textContent(t){const e=[],s={items:e,styles:Object.create(null)};function i(r){var l;if(!r)return;let a=null;const o=r.name;if(o==="#text")a=r.value;else if(Yh.shouldBuildText(o))(l=r==null?void 0:r.attributes)!=null&&l.textContent?a=r.attributes.textContent:r.value&&(a=r.value);else return;if(a!==null&&e.push({str:a}),!!r.children)for(const h of r.children)i(h)}return i(t),s}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}class Pb{static setupStorage(t,e,s,i,r){const a=i.getValue(e,{value:null});switch(s.name){case"textarea":if(a.value!==null&&(t.textContent=a.value),r==="print")break;t.addEventListener("input",o=>{i.setValue(e,{value:o.target.value})});break;case"input":if(s.attributes.type==="radio"||s.attributes.type==="checkbox"){if(a.value===s.attributes.xfaOn?t.setAttribute("checked",!0):a.value===s.attributes.xfaOff&&t.removeAttribute("checked"),r==="print")break;t.addEventListener("change",o=>{i.setValue(e,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&t.setAttribute("value",a.value),r==="print")break;t.addEventListener("input",o=>{i.setValue(e,{value:o.target.value})})}break;case"select":if(a.value!==null){t.setAttribute("value",a.value);for(const o of s.children)o.attributes.value===a.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}t.addEventListener("input",o=>{const l=o.target.options,h=l.selectedIndex===-1?"":l[l.selectedIndex].value;i.setValue(e,{value:h})});break}}static setAttributes({html:t,element:e,storage:s=null,intent:i,linkService:r}){const{attributes:a}=e,o=t instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${i}`);for(const[l,h]of Object.entries(a))if(h!=null)switch(l){case"class":h.length&&t.setAttribute(l,h.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",h);break;case"style":Object.assign(t.style,h);break;case"textContent":t.textContent=h;break;default:(!o||l!=="href"&&l!=="newWindow")&&t.setAttribute(l,h)}o&&r.addLinkAttributes(t,a.href,a.newWindow),s&&a.dataId&&this.setupStorage(t,a.dataId,e,s)}static render(t){var u,g;const e=t.annotationStorage,s=t.linkService,i=t.xfaHtml,r=t.intent||"display",a=document.createElement(i.name);i.attributes&&this.setAttributes({html:a,element:i,intent:r,linkService:s});const o=r!=="richText",l=t.div;if(l.append(a),t.viewport){const m=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=m}o&&l.setAttribute("class","xfaLayer xfaFont");const h=[];if(i.children.length===0){if(i.value){const m=document.createTextNode(i.value);a.append(m),o&&Yh.shouldBuildText(i.name)&&h.push(m)}return{textDivs:h}}const c=[[i,-1,a]];for(;c.length>0;){const[m,A,y]=c.at(-1);if(A+1===m.children.length){c.pop();continue}const v=m.children[++c.at(-1)[1]];if(v===null)continue;const{name:w}=v;if(w==="#text"){const S=document.createTextNode(v.value);h.push(S),y.append(S);continue}const E=(u=v==null?void 0:v.attributes)!=null&&u.xmlns?document.createElementNS(v.attributes.xmlns,w):document.createElement(w);if(y.append(E),v.attributes&&this.setAttributes({html:E,element:v,storage:e,intent:r,linkService:s}),((g=v.children)==null?void 0:g.length)>0)c.push([v,-1,E]);else if(v.value){const S=document.createTextNode(v.value);o&&Yh.shouldBuildText(w)&&h.push(S),E.append(S)}}for(const m of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:h}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const bi="http://www.w3.org/2000/svg",br=class br{};k(br,"CSS",96),k(br,"PDF",72),k(br,"PDF_TO_CSS_UNITS",br.CSS/br.PDF);let on=br;async function Ah(d,t="text"){if(Ch(d,document.baseURI)){const e=await fetch(d);if(!e.ok)throw new Error(e.statusText);switch(t){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"json":return e.json()}return e.text()}return new Promise((e,s)=>{const i=new XMLHttpRequest;i.open("GET",d,!0),i.responseType=t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(t){case"arraybuffer":case"blob":case"json":e(i.response);return}e(i.responseText);return}s(new Error(i.statusText))}},i.send(null)})}class Mu{constructor({viewBox:t,userUnit:e,scale:s,rotation:i,offsetX:r=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=t,this.userUnit=e,this.scale=s,this.rotation=i,this.offsetX=r,this.offsetY=a,s*=e;const l=(t[2]+t[0])/2,h=(t[3]+t[1])/2;let c,u,g,m;switch(i%=360,i<0&&(i+=360),i){case 180:c=-1,u=0,g=0,m=1;break;case 90:c=0,u=1,g=1,m=0;break;case 270:c=0,u=-1,g=-1,m=0;break;case 0:c=1,u=0,g=0,m=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(g=-g,m=-m);let A,y,v,w;c===0?(A=Math.abs(h-t[1])*s+r,y=Math.abs(l-t[0])*s+a,v=(t[3]-t[1])*s,w=(t[2]-t[0])*s):(A=Math.abs(l-t[0])*s+r,y=Math.abs(h-t[1])*s+a,v=(t[2]-t[0])*s,w=(t[3]-t[1])*s),this.transform=[c*s,u*s,g*s,m*s,A-c*s*l-g*s*h,y-u*s*l-m*s*h],this.width=v,this.height=w}get rawDims(){const t=this.viewBox;return q(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:s=this.offsetX,offsetY:i=this.offsetY,dontFlip:r=!1}={}){return new Mu({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:s,offsetY:i,dontFlip:r})}convertToViewportPoint(t,e){const s=[t,e];return O.applyTransform(s,this.transform),s}convertToViewportRectangle(t){const e=[t[0],t[1]];O.applyTransform(e,this.transform);const s=[t[2],t[3]];return O.applyTransform(s,this.transform),[e[0],e[1],s[0],s[1]]}convertToPdfPoint(t,e){const s=[t,e];return O.applyInverseTransform(s,this.transform),s}}class Mg extends Ka{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}function Lu(d){const t=d.length;let e=0;for(;e<t&&d[e].trim()==="";)e++;return d.substring(e,e+5).toLowerCase()==="data:"}function Lg(d){return typeof d=="string"&&/\.pdf$/i.test(d)}function Iy(d){return[d]=d.split(/[#?]/,1),d.substring(d.lastIndexOf("/")+1)}function Fy(d,t="document.pdf"){if(typeof d!="string")return t;if(Lu(d))return V('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const s=(o=>{try{return new URL(o)}catch{try{return new URL(decodeURIComponent(o))}catch{try{return new URL(o,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(o),"https://foo.bar")}catch{return null}}}}})(d);if(!s)return t;const i=o=>{try{let l=decodeURIComponent(o);return l.includes("/")?(l=l.split("/").at(-1),l.test(/^\.pdf$/i)?l:o):l}catch{return o}},r=/\.pdf$/i,a=s.pathname.split("/").at(-1);if(r.test(a))return i(a);if(s.searchParams.size>0){const o=Array.from(s.searchParams.values()).reverse();for(const h of o)if(r.test(h))return i(h);const l=Array.from(s.searchParams.keys()).reverse();for(const h of l)if(r.test(h))return i(h)}if(s.hash){const l=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(s.hash);if(l)return i(l[0])}return t}class qb{constructor(){k(this,"started",Object.create(null));k(this,"times",[])}time(t){t in this.started&&V(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||V(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:s}of this.times)e=Math.max(s.length,e);for(const{name:s,start:i,end:r}of this.times)t.push(`${s.padEnd(e)} ${r-i}ms
1
+ var dv=Object.defineProperty;var uv=(d,t,e)=>t in d?dv(d,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[t]=e;var k=(d,t,e)=>(uv(d,typeof t!="symbol"?t+"":t,e),e),jg=(d,t,e)=>{if(!t.has(d))throw TypeError("Cannot "+e)};var n=(d,t,e)=>(jg(d,t,"read from private field"),e?e.call(d):t.get(d)),f=(d,t,e)=>{if(t.has(d))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(d):t.set(d,e)},p=(d,t,e,s)=>(jg(d,t,"write to private field"),s?s.call(d,e):t.set(d,e),e);var Ht=(d,t,e,s)=>({set _(i){p(d,t,i,e)},get _(){return n(d,t,s)}}),b=(d,t,e)=>(jg(d,t,"access private method"),e);import{j as Dt}from"./vendor-mui-98daa63f.js";import{g as fv,r as $}from"./vendor-react-ece1c85f.js";const pv="modulepreload",gv=function(d){return"/"+d},Vb={},mv=function(t,e,s){if(!e||e.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(e.map(r=>{if(r=gv(r),r in Vb)return;Vb[r]=!0;const a=r.endsWith(".css"),o=a?'[rel="stylesheet"]':"";if(!!s)for(let c=i.length-1;c>=0;c--){const u=i[c];if(u.href===r&&(!a||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${o}`))return;const h=document.createElement("link");if(h.rel=a?"stylesheet":pv,a||(h.as="script",h.crossOrigin=""),h.href=r,document.head.appendChild(h),a)return new Promise((c,u)=>{h.addEventListener("load",c),h.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t()).catch(r=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r})};var bv=function(){},yv=bv;const Ae=fv(yv),Te=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),Qg=[.001,0,0,.001,0,0],Gg=1.35,ns={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},gi={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Xh="pdfjs_internal_editor_",z={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},J={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},Ry={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},ee={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Wh={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Mt={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},to={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},ku={ERRORS:0,WARNINGS:1,INFOS:5},mh={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},Hu={moveTo:0,lineTo:1,curveTo:2,closePath:3},ky={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let kg=ku.WARNINGS;function Av(d){Number.isInteger(d)&&(kg=d)}function wv(){return kg}function Dg(d){kg>=ku.INFOS&&console.info(`Info: ${d}`)}function V(d){kg>=ku.WARNINGS&&console.warn(`Warning: ${d}`)}function ft(d){throw new Error(d)}function Z(d,t){d||ft(t)}function vv(d){switch(d==null?void 0:d.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function _b(d,t=null,e=null){if(!d)return null;if(e&&typeof d=="string"){if(e.addDefaultProtocol&&d.startsWith("www.")){const i=d.match(/\./g);(i==null?void 0:i.length)>=2&&(d=`http://${d}`)}if(e.tryConvertEncoding)try{d=Tv(d)}catch{}}const s=t?URL.parse(d,t):URL.parse(d);return vv(s)?s:null}function Cb(d,t,e=!1){const s=URL.parse(d);return s?(s.hash=t,s.href):e&&_b(d,"http://example.com")?d.split("#",1)[0]+`${t?`#${t}`:""}`:""}function q(d,t,e,s=!1){return Object.defineProperty(d,t,{value:e,enumerable:!s,configurable:!0,writable:!1}),e}const Ka=function(){function t(e,s){this.message=e,this.name=s}return t.prototype=new Error,t.constructor=t,t}();class Wb extends Ka{constructor(t,e){super(t,"PasswordException"),this.code=e}}class zg extends Ka{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Pf extends Ka{constructor(t){super(t,"InvalidPDFException")}}class qh extends Ka{constructor(t,e,s){super(t,"ResponseException"),this.status=e,this.missing=s}}class Ev extends Ka{constructor(t){super(t,"FormatError")}}class an extends Ka{constructor(t){super(t,"AbortException")}}function Dy(d){(typeof d!="object"||(d==null?void 0:d.length)===void 0)&&ft("Invalid argument for bytesToString");const t=d.length,e=8192;if(t<e)return String.fromCharCode.apply(null,d);const s=[];for(let i=0;i<t;i+=e){const r=Math.min(i+e,t),a=d.subarray(i,r);s.push(String.fromCharCode.apply(null,a))}return s.join("")}function Du(d){typeof d!="string"&&ft("Invalid argument for stringToBytes");const t=d.length,e=new Uint8Array(t);for(let s=0;s<t;++s)e[s]=d.charCodeAt(s)&255;return e}function Sv(d){return String.fromCharCode(d>>24&255,d>>16&255,d>>8&255,d&255)}function _v(){const d=new Uint8Array(4);return d[0]=1,new Uint32Array(d.buffer,0,1)[0]===1}function Cv(){try{return new Function(""),!0}catch{return!1}}class Zt{static get isLittleEndian(){return q(this,"isLittleEndian",_v())}static get isEvalSupported(){return q(this,"isEvalSupported",Cv())}static get isOffscreenCanvasSupported(){return q(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return q(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:t,userAgent:e}=navigator;return q(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){var t,e;return q(this,"isCSSRoundSupported",(e=(t=globalThis.CSS)==null?void 0:t.supports)==null?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const Vg=Array.from(Array(256).keys(),d=>d.toString(16).padStart(2,"0"));var bo,Yu,ec,Zg;class O{static makeHexColor(t,e,s){return`#${Vg[t]}${Vg[e]}${Vg[s]}`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,e){let s;t[0]?(t[0]<0&&(s=e[0],e[0]=e[2],e[2]=s),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(s=e[1],e[1]=e[3],e[3]=s),e[1]*=t[3],e[3]*=t[3]):(s=e[0],e[0]=e[1],e[1]=s,s=e[2],e[2]=e[3],e[3]=s,t[1]<0&&(s=e[1],e[1]=e[3],e[3]=s),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(s=e[0],e[0]=e[2],e[2]=s),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,s=0){const i=t[s],r=t[s+1];t[s]=i*e[0]+r*e[2]+e[4],t[s+1]=i*e[1]+r*e[3]+e[5]}static applyTransformToBezier(t,e,s=0){const i=e[0],r=e[1],a=e[2],o=e[3],l=e[4],h=e[5];for(let c=0;c<6;c+=2){const u=t[s+c],g=t[s+c+1];t[s+c]=u*i+g*a+l,t[s+c+1]=u*r+g*o+h}}static applyInverseTransform(t,e){const s=t[0],i=t[1],r=e[0]*e[3]-e[1]*e[2];t[0]=(s*e[3]-i*e[2]+e[2]*e[5]-e[4]*e[3])/r,t[1]=(-s*e[1]+i*e[0]+e[4]*e[1]-e[5]*e[0])/r}static axialAlignedBoundingBox(t,e,s){const i=e[0],r=e[1],a=e[2],o=e[3],l=e[4],h=e[5],c=t[0],u=t[1],g=t[2],m=t[3];let A=i*c+l,y=A,v=i*g+l,w=v,E=o*u+h,S=E,_=o*m+h,C=_;if(r!==0||a!==0){const T=r*c,x=r*g,P=a*u,R=a*m;A+=P,w+=P,v+=R,y+=R,E+=T,C+=T,_+=x,S+=x}s[0]=Math.min(s[0],A,v,y,w),s[1]=Math.min(s[1],E,_,S,C),s[2]=Math.max(s[2],A,v,y,w),s[3]=Math.max(s[3],E,_,S,C)}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const s=t[0],i=t[1],r=t[2],a=t[3],o=s**2+i**2,l=s*r+i*a,h=r**2+a**2,c=(o+h)/2,u=Math.sqrt(c**2-(o*h-l**2));e[0]=Math.sqrt(c+u||1),e[1]=Math.sqrt(c-u||1)}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const s=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(s>i)return null;const r=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return r>a?null:[s,r,i,a]}static pointBoundingBox(t,e,s){s[0]=Math.min(s[0],t),s[1]=Math.min(s[1],e),s[2]=Math.max(s[2],t),s[3]=Math.max(s[3],e)}static rectBoundingBox(t,e,s,i,r){r[0]=Math.min(r[0],t,s),r[1]=Math.min(r[1],e,i),r[2]=Math.max(r[2],t,s),r[3]=Math.max(r[3],e,i)}static bezierBoundingBox(t,e,s,i,r,a,o,l,h){h[0]=Math.min(h[0],t,o),h[1]=Math.min(h[1],e,l),h[2]=Math.max(h[2],t,o),h[3]=Math.max(h[3],e,l),b(this,ec,Zg).call(this,t,s,r,o,e,i,a,l,3*(-t+3*(s-r)+o),6*(t-2*s+r),3*(s-t),h),b(this,ec,Zg).call(this,t,s,r,o,e,i,a,l,3*(-e+3*(i-a)+l),6*(e-2*i+a),3*(i-e),h)}}bo=new WeakSet,Yu=function(t,e,s,i,r,a,o,l,h,c){if(h<=0||h>=1)return;const u=1-h,g=h*h,m=g*h,A=u*(u*(u*t+3*h*e)+3*g*s)+m*i,y=u*(u*(u*r+3*h*a)+3*g*o)+m*l;c[0]=Math.min(c[0],A),c[1]=Math.min(c[1],y),c[2]=Math.max(c[2],A),c[3]=Math.max(c[3],y)},ec=new WeakSet,Zg=function(t,e,s,i,r,a,o,l,h,c,u,g){if(Math.abs(h)<1e-12){Math.abs(c)>=1e-12&&b(this,bo,Yu).call(this,t,e,s,i,r,a,o,l,-u/c,g);return}const m=c**2-4*u*h;if(m<0)return;const A=Math.sqrt(m),y=2*h;b(this,bo,Yu).call(this,t,e,s,i,r,a,o,l,(-c+A)/y,g),b(this,bo,Yu).call(this,t,e,s,i,r,a,o,l,(-c-A)/y,g)},f(O,bo),f(O,ec);function Tv(d){return decodeURIComponent(escape(d))}let Wg=null,Xb=null;function My(d){return Wg||(Wg=/([\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,Xb=new Map([["ſt","ſt"]])),d.replaceAll(Wg,(t,e,s)=>e?e.normalize("NFKC"):Xb.get(s))}function Tb(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const d=new Uint8Array(32);return crypto.getRandomValues(d),Dy(d)}const xb="pdfjs_internal_id_";function xv(d,t,e){if(!Array.isArray(e)||e.length<2)return!1;const[s,i,...r]=e;if(!d(s)&&!Number.isInteger(s)||!t(i))return!1;const a=r.length;let o=!0;switch(i.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return a===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(a!==4)return!1;o=!1;break;default:return!1}for(const l of r)if(!(typeof l=="number"||o&&l===null))return!1;return!0}function ye(d,t,e){return Math.min(Math.max(d,t),e)}function Ly(d){return Uint8Array.prototype.toBase64?d.toBase64():btoa(Dy(d))}function Pv(d){return Uint8Array.fromBase64?Uint8Array.fromBase64(d):Du(atob(d))}typeof Promise.try!="function"&&(Promise.try=function(d,...t){return new Promise(e=>{e(d(...t))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(d){return d.reduce((t,e)=>t+e,0)});class Yh{static textContent(t){const e=[],s={items:e,styles:Object.create(null)};function i(r){var l;if(!r)return;let a=null;const o=r.name;if(o==="#text")a=r.value;else if(Yh.shouldBuildText(o))(l=r==null?void 0:r.attributes)!=null&&l.textContent?a=r.attributes.textContent:r.value&&(a=r.value);else return;if(a!==null&&e.push({str:a}),!!r.children)for(const h of r.children)i(h)}return i(t),s}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}class Pb{static setupStorage(t,e,s,i,r){const a=i.getValue(e,{value:null});switch(s.name){case"textarea":if(a.value!==null&&(t.textContent=a.value),r==="print")break;t.addEventListener("input",o=>{i.setValue(e,{value:o.target.value})});break;case"input":if(s.attributes.type==="radio"||s.attributes.type==="checkbox"){if(a.value===s.attributes.xfaOn?t.setAttribute("checked",!0):a.value===s.attributes.xfaOff&&t.removeAttribute("checked"),r==="print")break;t.addEventListener("change",o=>{i.setValue(e,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&t.setAttribute("value",a.value),r==="print")break;t.addEventListener("input",o=>{i.setValue(e,{value:o.target.value})})}break;case"select":if(a.value!==null){t.setAttribute("value",a.value);for(const o of s.children)o.attributes.value===a.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}t.addEventListener("input",o=>{const l=o.target.options,h=l.selectedIndex===-1?"":l[l.selectedIndex].value;i.setValue(e,{value:h})});break}}static setAttributes({html:t,element:e,storage:s=null,intent:i,linkService:r}){const{attributes:a}=e,o=t instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${i}`);for(const[l,h]of Object.entries(a))if(h!=null)switch(l){case"class":h.length&&t.setAttribute(l,h.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",h);break;case"style":Object.assign(t.style,h);break;case"textContent":t.textContent=h;break;default:(!o||l!=="href"&&l!=="newWindow")&&t.setAttribute(l,h)}o&&r.addLinkAttributes(t,a.href,a.newWindow),s&&a.dataId&&this.setupStorage(t,a.dataId,e,s)}static render(t){var u,g;const e=t.annotationStorage,s=t.linkService,i=t.xfaHtml,r=t.intent||"display",a=document.createElement(i.name);i.attributes&&this.setAttributes({html:a,element:i,intent:r,linkService:s});const o=r!=="richText",l=t.div;if(l.append(a),t.viewport){const m=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=m}o&&l.setAttribute("class","xfaLayer xfaFont");const h=[];if(i.children.length===0){if(i.value){const m=document.createTextNode(i.value);a.append(m),o&&Yh.shouldBuildText(i.name)&&h.push(m)}return{textDivs:h}}const c=[[i,-1,a]];for(;c.length>0;){const[m,A,y]=c.at(-1);if(A+1===m.children.length){c.pop();continue}const v=m.children[++c.at(-1)[1]];if(v===null)continue;const{name:w}=v;if(w==="#text"){const S=document.createTextNode(v.value);h.push(S),y.append(S);continue}const E=(u=v==null?void 0:v.attributes)!=null&&u.xmlns?document.createElementNS(v.attributes.xmlns,w):document.createElement(w);if(y.append(E),v.attributes&&this.setAttributes({html:E,element:v,storage:e,intent:r,linkService:s}),((g=v.children)==null?void 0:g.length)>0)c.push([v,-1,E]);else if(v.value){const S=document.createTextNode(v.value);o&&Yh.shouldBuildText(w)&&h.push(S),E.append(S)}}for(const m of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:h}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const bi="http://www.w3.org/2000/svg",br=class br{};k(br,"CSS",96),k(br,"PDF",72),k(br,"PDF_TO_CSS_UNITS",br.CSS/br.PDF);let on=br;async function Ah(d,t="text"){if(Ch(d,document.baseURI)){const e=await fetch(d);if(!e.ok)throw new Error(e.statusText);switch(t){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"json":return e.json()}return e.text()}return new Promise((e,s)=>{const i=new XMLHttpRequest;i.open("GET",d,!0),i.responseType=t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(t){case"arraybuffer":case"blob":case"json":e(i.response);return}e(i.responseText);return}s(new Error(i.statusText))}},i.send(null)})}class Mu{constructor({viewBox:t,userUnit:e,scale:s,rotation:i,offsetX:r=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=t,this.userUnit=e,this.scale=s,this.rotation=i,this.offsetX=r,this.offsetY=a,s*=e;const l=(t[2]+t[0])/2,h=(t[3]+t[1])/2;let c,u,g,m;switch(i%=360,i<0&&(i+=360),i){case 180:c=-1,u=0,g=0,m=1;break;case 90:c=0,u=1,g=1,m=0;break;case 270:c=0,u=-1,g=-1,m=0;break;case 0:c=1,u=0,g=0,m=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(g=-g,m=-m);let A,y,v,w;c===0?(A=Math.abs(h-t[1])*s+r,y=Math.abs(l-t[0])*s+a,v=(t[3]-t[1])*s,w=(t[2]-t[0])*s):(A=Math.abs(l-t[0])*s+r,y=Math.abs(h-t[1])*s+a,v=(t[2]-t[0])*s,w=(t[3]-t[1])*s),this.transform=[c*s,u*s,g*s,m*s,A-c*s*l-g*s*h,y-u*s*l-m*s*h],this.width=v,this.height=w}get rawDims(){const t=this.viewBox;return q(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:s=this.offsetX,offsetY:i=this.offsetY,dontFlip:r=!1}={}){return new Mu({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:s,offsetY:i,dontFlip:r})}convertToViewportPoint(t,e){const s=[t,e];return O.applyTransform(s,this.transform),s}convertToViewportRectangle(t){const e=[t[0],t[1]];O.applyTransform(e,this.transform);const s=[t[2],t[3]];return O.applyTransform(s,this.transform),[e[0],e[1],s[0],s[1]]}convertToPdfPoint(t,e){const s=[t,e];return O.applyInverseTransform(s,this.transform),s}}class Mg extends Ka{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}function Lu(d){const t=d.length;let e=0;for(;e<t&&d[e].trim()==="";)e++;return d.substring(e,e+5).toLowerCase()==="data:"}function Lg(d){return typeof d=="string"&&/\.pdf$/i.test(d)}function Iy(d){return[d]=d.split(/[#?]/,1),d.substring(d.lastIndexOf("/")+1)}function Fy(d,t="document.pdf"){if(typeof d!="string")return t;if(Lu(d))return V('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const s=(o=>{try{return new URL(o)}catch{try{return new URL(decodeURIComponent(o))}catch{try{return new URL(o,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(o),"https://foo.bar")}catch{return null}}}}})(d);if(!s)return t;const i=o=>{try{let l=decodeURIComponent(o);return l.includes("/")?(l=l.split("/").at(-1),l.test(/^\.pdf$/i)?l:o):l}catch{return o}},r=/\.pdf$/i,a=s.pathname.split("/").at(-1);if(r.test(a))return i(a);if(s.searchParams.size>0){const o=Array.from(s.searchParams.values()).reverse();for(const h of o)if(r.test(h))return i(h);const l=Array.from(s.searchParams.keys()).reverse();for(const h of l)if(r.test(h))return i(h)}if(s.hash){const l=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(s.hash);if(l)return i(l[0])}return t}class qb{constructor(){k(this,"started",Object.create(null));k(this,"times",[])}time(t){t in this.started&&V(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||V(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:s}of this.times)e=Math.max(s.length,e);for(const{name:s,start:i,end:r}of this.times)t.push(`${s.padEnd(e)} ${r-i}ms
2
2
  `);return t.join("")}}function Ch(d,t){const e=t?URL.parse(d,t):URL.parse(d);return(e==null?void 0:e.protocol)==="http:"||(e==null?void 0:e.protocol)==="https:"}function as(d){d.preventDefault()}function Tt(d){d.preventDefault(),d.stopPropagation()}function Rv(d){console.log("Deprecated API usage: "+d)}var sc;class Kh{static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;n(this,sc)||p(this,sc,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=n(this,sc).exec(t);if(!e)return null;const s=parseInt(e[1],10);let i=parseInt(e[2],10);i=i>=1&&i<=12?i-1:0;let r=parseInt(e[3],10);r=r>=1&&r<=31?r:1;let a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const h=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let u=parseInt(e[9],10)||0;return u=u>=0&&u<=59?u:0,h==="-"?(a+=c,o+=u):h==="+"&&(a-=c,o-=u),new Date(Date.UTC(s,i,r,a,o,l))}}sc=new WeakMap,f(Kh,sc,void 0);function Ny(d,{scale:t=1,rotation:e=0}){const{width:s,height:i}=d.attributes.style,r=[0,0,parseInt(s),parseInt(i)];return new Mu({viewBox:r,userUnit:1,scale:t,rotation:e})}function wh(d){if(d.startsWith("#")){const t=parseInt(d.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return d.startsWith("rgb(")?d.slice(4,-1).split(",").map(t=>parseInt(t)):d.startsWith("rgba(")?d.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(V(`Not a valid color format: "${d}"`),[0,0,0])}function kv(d){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const e of d.keys()){t.style.color=e;const s=window.getComputedStyle(t).color;d.set(e,wh(s))}t.remove()}function Ct(d){const{a:t,b:e,c:s,d:i,e:r,f:a}=d.getTransform();return[t,e,s,i,r,a]}function js(d){const{a:t,b:e,c:s,d:i,e:r,f:a}=d.getTransform().invertSelf();return[t,e,s,i,r,a]}function dr(d,t,e=!1,s=!0){if(t instanceof Mu){const{pageWidth:i,pageHeight:r}=t.rawDims,{style:a}=d,o=Zt.isCSSRoundSupported,l=`var(--total-scale-factor) * ${i}px`,h=`var(--total-scale-factor) * ${r}px`,c=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,u=o?`round(down, ${h}, var(--scale-round-y))`:`calc(${h})`;!e||t.rotation%180===0?(a.width=c,a.height=u):(a.width=u,a.height=c)}s&&d.setAttribute("data-main-rotation",t.rotation)}class Us{constructor(){const{pixelRatio:t}=Us;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,s,i,r=-1){let a=1/0,o=1/0,l=1/0;s=Us.capPixels(s,r),s>0&&(a=Math.sqrt(s/(t*e))),i!==-1&&(o=i/t,l=i/e);const h=Math.min(a,o,l);return this.sx>h||this.sy>h?(this.sx=h,this.sy=h,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const s=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,s):s}return t}}const Rf=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class Dv{static get isDarkMode(){var t;return q(this,"isDarkMode",!!((t=window==null?void 0:window.matchMedia)!=null&&t.call(window,"(prefers-color-scheme: dark)").matches))}}class Oy{static get commentForegroundColor(){const t=document.createElement("span");t.classList.add("comment","sidebar");const{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);const{color:s}=window.getComputedStyle(t);return t.remove(),q(this,"commentForegroundColor",wh(s))}}function By(d,t,e,s){s=Math.min(Math.max(s??1,0),1);const i=255*(1-s);return d=Math.round(d*s+i),t=Math.round(t*s+i),e=Math.round(e*s+i),[d,t,e]}function Yb(d,t){const e=d[0]/255,s=d[1]/255,i=d[2]/255,r=Math.max(e,s,i),a=Math.min(e,s,i),o=(r+a)/2;if(r===a)t[0]=t[1]=0;else{const l=r-a;switch(t[1]=o<.5?l/(r+a):l/(2-r-a),r){case e:t[0]=((s-i)/l+(s<i?6:0))*60;break;case s:t[0]=((i-e)/l+2)*60;break;case i:t[0]=((e-s)/l+4)*60;break}}t[2]=o}function tm(d,t){const e=d[0],s=d[1],i=d[2],r=(1-Math.abs(2*i-1))*s,a=r*(1-Math.abs(e/60%2-1)),o=i-r/2;switch(Math.floor(e/60)){case 0:t[0]=r+o,t[1]=a+o,t[2]=o;break;case 1:t[0]=a+o,t[1]=r+o,t[2]=o;break;case 2:t[0]=o,t[1]=r+o,t[2]=a+o;break;case 3:t[0]=o,t[1]=a+o,t[2]=r+o;break;case 4:t[0]=a+o,t[1]=o,t[2]=r+o;break;case 5:case 6:t[0]=r+o,t[1]=o,t[2]=a+o;break}}function Kb(d){return d<=.03928?d/12.92:((d+.055)/1.055)**2.4}function Jb(d,t,e){tm(d,e),e.map(Kb);const s=.2126*e[0]+.7152*e[1]+.0722*e[2];tm(t,e),e.map(Kb);const i=.2126*e[0]+.7152*e[1]+.0722*e[2];return s>i?(s+.05)/(i+.05):(i+.05)/(s+.05)}const Qb=new Map;function Hy(d,t){const e=d[0]+d[1]*256+d[2]*65536+t[0]*16777216+t[1]*4294967296+t[2]*1099511627776;let s=Qb.get(e);if(s)return s;const i=new Float32Array(9),r=i.subarray(0,3),a=i.subarray(3,6);Yb(d,a);const o=i.subarray(6,9);Yb(t,o);const l=o[2]<.5,h=l?12:4.5;if(a[2]=l?Math.sqrt(a[2]):1-Math.sqrt(1-a[2]),Jb(a,o,r)<h){let c,u;l?(c=a[2],u=1):(c=0,u=a[2]);const g=.005;for(;u-c>g;){const m=a[2]=(c+u)/2;l===Jb(a,o,r)<h?c=m:u=m}a[2]=l?u:c}return tm(a,r),s=O.makeHexColor(Math.round(r[0]*255),Math.round(r[1]*255),Math.round(r[2]*255)),Qb.set(e,s),s}function Rb({html:d,dir:t,className:e},s){const i=document.createDocumentFragment();if(typeof d=="string"){const r=document.createElement("p");r.dir=t||"auto";const a=d.split(/(?:\r\n?|\n)/);for(let o=0,l=a.length;o<l;++o){const h=a[o];r.append(document.createTextNode(h)),o<l-1&&r.append(document.createElement("br"))}i.append(r)}else Pb.render({xfaHtml:d,div:i,intent:"richText"});i.firstChild.classList.add("richText",e),s.append(i)}var dn,un,hs,cs,ic,fn,yo,Ao,nc,Uf,Uy,$f,$y,jf,jy,pn,eo,wr,Th;const wi=class wi{constructor(t){f(this,$f);f(this,jf);f(this,pn);f(this,wr);f(this,dn,null);f(this,un,null);f(this,hs,void 0);f(this,cs,null);f(this,ic,null);f(this,fn,null);f(this,yo,null);f(this,Ao,null);p(this,hs,t),n(wi,nc)||p(wi,nc,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 t=p(this,dn,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=n(this,hs)._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",as,{signal:e}),t.addEventListener("pointerdown",b(wi,Uf,Uy),{signal:e}));const s=p(this,cs,document.createElement("div"));s.className="buttons",t.append(s);const i=n(this,hs).toolbarPosition;if(i){const{style:r}=t,a=n(this,hs)._uiManager.direction==="ltr"?1-i[0]:i[0];r.insetInlineEnd=`${100*a}%`,r.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return n(this,dn)}hide(){var t;n(this,dn).classList.add("hidden"),(t=n(this,un))==null||t.hideDropdown()}show(){var t,e;n(this,dn).classList.remove("hidden"),(t=n(this,ic))==null||t.shown(),(e=n(this,fn))==null||e.shown()}addDeleteButton(){const{editorType:t,_uiManager:e}=n(this,hs),s=document.createElement("button");s.classList.add("basic","deleteButton"),s.tabIndex=0,s.setAttribute("data-l10n-id",n(wi,nc)[t]),b(this,pn,eo).call(this,s)&&s.addEventListener("click",i=>{e.delete()},{signal:e._signal}),n(this,cs).append(s)}async addAltText(t){const e=await t.render();b(this,pn,eo).call(this,e),n(this,cs).append(e,n(this,wr,Th)),p(this,ic,t)}addComment(t,e=null){if(n(this,fn))return;const s=t.renderForToolbar();if(!s)return;b(this,pn,eo).call(this,s);const i=p(this,yo,n(this,wr,Th));e?(n(this,cs).insertBefore(s,e),n(this,cs).insertBefore(i,e)):n(this,cs).append(s,i),p(this,fn,t),t.toolbar=this}addColorPicker(t){if(n(this,un))return;p(this,un,t);const e=t.renderButton();b(this,pn,eo).call(this,e),n(this,cs).append(e,n(this,wr,Th))}async addEditSignatureButton(t){const e=p(this,Ao,await t.renderEditButton(n(this,hs)));b(this,pn,eo).call(this,e),n(this,cs).append(e,n(this,wr,Th))}removeButton(t){var e,s;switch(t){case"comment":(e=n(this,fn))==null||e.removeToolbarCommentButton(),p(this,fn,null),(s=n(this,yo))==null||s.remove(),p(this,yo,null);break}}async addButton(t,e){switch(t){case"colorPicker":this.addColorPicker(e);break;case"altText":await this.addAltText(e);break;case"editSignature":await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(e);break}}async addButtonBefore(t,e,s){const i=n(this,cs).querySelector(s);i&&t==="comment"&&this.addComment(e,i)}updateEditSignatureButton(t){n(this,Ao)&&(n(this,Ao).title=t)}remove(){var t;n(this,dn).remove(),(t=n(this,un))==null||t.destroy(),p(this,un,null)}};dn=new WeakMap,un=new WeakMap,hs=new WeakMap,cs=new WeakMap,ic=new WeakMap,fn=new WeakMap,yo=new WeakMap,Ao=new WeakMap,nc=new WeakMap,Uf=new WeakSet,Uy=function(t){t.stopPropagation()},$f=new WeakSet,$y=function(t){n(this,hs)._focusEventsAllowed=!1,Tt(t)},jf=new WeakSet,jy=function(t){n(this,hs)._focusEventsAllowed=!0,Tt(t)},pn=new WeakSet,eo=function(t){const e=n(this,hs)._uiManager._signal;return!(e instanceof AbortSignal)||e.aborted?!1:(t.addEventListener("focusin",b(this,$f,$y).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",b(this,jf,jy).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",as,{signal:e}),!0)},wr=new WeakSet,Th=function(){const t=document.createElement("div");return t.className="divider",t},f(wi,Uf),f(wi,nc,null);let em=wi;var rc,vr,Ei,Gf,Gy,zf,zy,ac,sm;class Mv{constructor(t){f(this,Gf);f(this,zf);f(this,ac);f(this,rc,null);f(this,vr,null);f(this,Ei,void 0);p(this,Ei,t)}show(t,e,s){const[i,r]=b(this,zf,zy).call(this,e,s),{style:a}=n(this,vr)||p(this,vr,b(this,Gf,Gy).call(this));t.append(n(this,vr)),a.insetInlineEnd=`${100*i}%`,a.top=`calc(${100*r}% + var(--editor-toolbar-vert-offset))`}hide(){n(this,vr).remove()}}rc=new WeakMap,vr=new WeakMap,Ei=new WeakMap,Gf=new WeakSet,Gy=function(){const t=p(this,vr,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const e=n(this,Ei)._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",as,{signal:e});const s=p(this,rc,document.createElement("div"));return s.className="buttons",t.append(s),n(this,Ei).hasCommentManager()&&b(this,ac,sm).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{n(this,Ei).commentSelection("floating_button")}),b(this,ac,sm).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{n(this,Ei).highlightSelection("floating_button")}),t},zf=new WeakSet,zy=function(t,e){let s=0,i=0;for(const r of t){const a=r.y+r.height;if(a<s)continue;const o=r.x+(e?r.width:0);if(a>s){i=o,s=a;continue}e?o>i&&(i=o):o<i&&(i=o)}return[e?1-i:i,s]},ac=new WeakSet,sm=function(t,e,s,i){const r=document.createElement("button");r.classList.add("basic",t),r.tabIndex=0,r.setAttribute("data-l10n-id",e);const a=document.createElement("span");r.append(a),a.className="visuallyHidden",a.setAttribute("data-l10n-id",s);const o=n(this,Ei)._signal;o instanceof AbortSignal&&!o.aborted&&(r.addEventListener("contextmenu",as,{signal:o}),r.addEventListener("click",i,{signal:o})),n(this,rc).append(r)};function Vy(d,t,e){for(const s of e)t.addEventListener(s,d[s].bind(d))}var Vf;class Lv{constructor(){f(this,Vf,0)}get id(){return`${Xh}${Ht(this,Vf)._++}`}}Vf=new WeakMap;var wo,oc,ue,vo,Ku;const Ub=class Ub{constructor(){f(this,vo);f(this,wo,Tb());f(this,oc,0);f(this,ue,null)}static get _isSVGFittingCanvas(){const t='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>',s=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=t;const r=i.decode().then(()=>(s.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(s.getImageData(0,0,1,1).data.buffer)[0]===0));return q(this,"_isSVGFittingCanvas",r)}async getFromFile(t){const{lastModified:e,name:s,size:i,type:r}=t;return b(this,vo,Ku).call(this,`${e}_${s}_${i}_${r}`,t)}async getFromUrl(t){return b(this,vo,Ku).call(this,t,t)}async getFromBlob(t,e){const s=await e;return b(this,vo,Ku).call(this,t,s)}async getFromId(t){n(this,ue)||p(this,ue,new Map);const e=n(this,ue).get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:s}=e;return delete e.blobPromise,this.getFromBlob(e.id,s)}return this.getFromUrl(e.url)}getFromCanvas(t,e){n(this,ue)||p(this,ue,new Map);let s=n(this,ue).get(t);if(s!=null&&s.bitmap)return s.refCounter+=1,s;const i=new OffscreenCanvas(e.width,e.height);return i.getContext("2d").drawImage(e,0,0),s={bitmap:i.transferToImageBitmap(),id:`image_${n(this,wo)}_${Ht(this,oc)._++}`,refCounter:1,isSvg:!1},n(this,ue).set(t,s),n(this,ue).set(s.id,s),s}getSvgUrl(t){const e=n(this,ue).get(t);return e!=null&&e.isSvg?e.svgUrl:null}deleteId(t){var i;n(this,ue)||p(this,ue,new Map);const e=n(this,ue).get(t);if(!e||(e.refCounter-=1,e.refCounter!==0))return;const{bitmap:s}=e;if(!e.url&&!e.file){const r=new OffscreenCanvas(s.width,s.height);r.getContext("bitmaprenderer").transferFromImageBitmap(s),e.blobPromise=r.convertToBlob()}(i=s.close)==null||i.call(s),e.bitmap=null}isValidId(t){return t.startsWith(`image_${n(this,wo)}_`)}};wo=new WeakMap,oc=new WeakMap,ue=new WeakMap,vo=new WeakSet,Ku=async function(t,e){n(this,ue)||p(this,ue,new Map);let s=n(this,ue).get(t);if(s===null)return null;if(s!=null&&s.bitmap)return s.refCounter+=1,s;try{s||(s={bitmap:null,id:`image_${n(this,wo)}_${Ht(this,oc)._++}`,refCounter:0,isSvg:!1});let i;if(typeof e=="string"?(s.url=e,i=await Ah(e,"blob")):e instanceof File?i=s.file=e:e instanceof Blob&&(i=e),i.type==="image/svg+xml"){const r=Ub._isSVGFittingCanvas,a=new FileReader,o=new Image,l=new Promise((h,c)=>{o.onload=()=>{s.bitmap=o,s.isSvg=!0,h()},a.onload=async()=>{const u=s.svgUrl=a.result;o.src=await r?`${u}#svgView(preserveAspectRatio(none))`:u},o.onerror=a.onerror=c});a.readAsDataURL(i),await l}else s.bitmap=await createImageBitmap(i);s.refCounter=1}catch(i){V(i),s=null}return n(this,ue).set(t,s),s&&n(this,ue).set(s.id,s),s};let im=Ub;var Lt,gn,lc,_t;class Iv{constructor(t=128){f(this,Lt,[]);f(this,gn,!1);f(this,lc,void 0);f(this,_t,-1);p(this,lc,t)}add({cmd:t,undo:e,post:s,mustExec:i,type:r=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(i&&t(),n(this,gn))return;const l={cmd:t,undo:e,post:s,type:r};if(n(this,_t)===-1){n(this,Lt).length>0&&(n(this,Lt).length=0),p(this,_t,0),n(this,Lt).push(l);return}if(a&&n(this,Lt)[n(this,_t)].type===r){o&&(l.undo=n(this,Lt)[n(this,_t)].undo),n(this,Lt)[n(this,_t)]=l;return}const h=n(this,_t)+1;h===n(this,lc)?n(this,Lt).splice(0,1):(p(this,_t,h),h<n(this,Lt).length&&n(this,Lt).splice(h)),n(this,Lt).push(l)}undo(){if(n(this,_t)===-1)return;p(this,gn,!0);const{undo:t,post:e}=n(this,Lt)[n(this,_t)];t(),e==null||e(),p(this,gn,!1),p(this,_t,n(this,_t)-1)}redo(){if(n(this,_t)<n(this,Lt).length-1){p(this,_t,n(this,_t)+1),p(this,gn,!0);const{cmd:t,post:e}=n(this,Lt)[n(this,_t)];t(),e==null||e(),p(this,gn,!1)}}hasSomethingToUndo(){return n(this,_t)!==-1}hasSomethingToRedo(){return n(this,_t)<n(this,Lt).length-1}cleanType(t){if(n(this,_t)!==-1){for(let e=n(this,_t);e>=0;e--)if(n(this,Lt)[e].type!==t){n(this,Lt).splice(e+1,n(this,_t)-e),p(this,_t,e);return}n(this,Lt).length=0,p(this,_t,-1)}}destroy(){p(this,Lt,null)}}Lt=new WeakMap,gn=new WeakMap,lc=new WeakMap,_t=new WeakMap;var Wf,Wy;class Iu{constructor(t){f(this,Wf);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=Zt.platform;for(const[s,i,r={}]of t)for(const a of s){const o=a.startsWith("mac+");e&&o?(this.callbacks.set(a.slice(4),{callback:i,options:r}),this.allKeys.add(a.split("+").at(-1))):!e&&!o&&(this.callbacks.set(a,{callback:i,options:r}),this.allKeys.add(a.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const s=this.callbacks.get(b(this,Wf,Wy).call(this,e));if(!s)return;const{callback:i,options:{bubbles:r=!1,args:a=[],checker:o=null}}=s;o&&!o(t,e)||(i.bind(t,...a,e)(),r||Tt(e))}}Wf=new WeakSet,Wy=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e};const Xf=class Xf{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return kv(t),q(this,"_colors",t)}convert(t){const e=wh(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[s,i]of this._colors)if(i.every((r,a)=>r===e[a]))return Xf._colorsMapping.get(s);return e}getHexCode(t){const e=this._colors.get(t);return e?O.makeHexColor(...e):t}};k(Xf,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let nm=Xf;var Eo,Ue,So,Pt,$t,_o,ds,Co,us,fe,mn,bn,To,yn,Vs,fs,Er,hc,cc,xo,dc,Ws,An,Po,wn,Xs,qf,vn,Ro,uc,En,Sr,ko,Sn,fc,Nt,it,Si,_n,Cn,pc,Do,gc,Tn,qs,_i,mc,bc,ps,Mo,Ju,yc,rm,Yf,Xy,Kf,qy,_r,xh,Jf,Yy,Qf,Ky,Zf,Jy,Ac,am,tp,Qy,wc,om,vc,lm,ep,Zy,se,ve,Cs,yi,sp,tA,ip,eA,Ec,hm,np,sA,Cr,Ph,Sc,cm;const ho=class ho{constructor(t,e,s,i,r,a,o,l,h,c,u,g,m,A,y,v){f(this,Mo);f(this,yc);f(this,Yf);f(this,Kf);f(this,_r);f(this,Jf);f(this,Qf);f(this,Zf);f(this,Ac);f(this,tp);f(this,wc);f(this,vc);f(this,ep);f(this,se);f(this,Cs);f(this,sp);f(this,ip);f(this,Ec);f(this,np);f(this,Cr);f(this,Sc);f(this,Eo,new AbortController);f(this,Ue,null);f(this,So,null);f(this,Pt,new Map);f(this,$t,new Map);f(this,_o,null);f(this,ds,null);f(this,Co,null);f(this,us,new Iv);f(this,fe,null);f(this,mn,null);f(this,bn,null);f(this,To,0);f(this,yn,new Set);f(this,Vs,null);f(this,fs,null);f(this,Er,new Set);k(this,"_editorUndoBar",null);f(this,hc,!1);f(this,cc,!1);f(this,xo,!1);f(this,dc,null);f(this,Ws,null);f(this,An,null);f(this,Po,null);f(this,wn,!1);f(this,Xs,null);f(this,qf,new Lv);f(this,vn,!1);f(this,Ro,!1);f(this,uc,!1);f(this,En,null);f(this,Sr,null);f(this,ko,null);f(this,Sn,null);f(this,fc,null);f(this,Nt,z.NONE);f(this,it,new Set);f(this,Si,null);f(this,_n,null);f(this,Cn,null);f(this,pc,null);f(this,Do,null);f(this,gc,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});f(this,Tn,[0,0]);f(this,qs,null);f(this,_i,null);f(this,mc,null);f(this,bc,null);f(this,ps,null);const w=this._signal=n(this,Eo).signal;p(this,_i,t),p(this,mc,e),p(this,bc,s),p(this,_o,i),p(this,fe,r),p(this,_n,a),p(this,Do,l),this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:w}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:w}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:w}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:w}),o._on("setpreference",this.onSetPreference.bind(this),{signal:w}),o._on("switchannotationeditorparams",E=>this.updateParams(E.type,E.value),{signal:w}),window.addEventListener("pointerdown",()=>{p(this,Ro,!0)},{capture:!0,signal:w}),window.addEventListener("pointerup",()=>{p(this,Ro,!1)},{capture:!0,signal:w}),b(this,Jf,Yy).call(this),b(this,ep,Zy).call(this),b(this,Ac,am).call(this),p(this,ds,l.annotationStorage),p(this,dc,l.filterFactory),p(this,Cn,h),p(this,Po,c||null),p(this,hc,u),p(this,cc,g),p(this,xo,m),p(this,fc,A||null),this.viewParameters={realScale:on.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=y||null,this._supportsPinchToZoom=v!==!1,r==null||r.setSidebarUiManager(this)}static get _keyboardManager(){const t=ho.prototype,e=a=>n(a,_i).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),s=(a,{target:o})=>{if(o instanceof HTMLInputElement){const{type:l}=o;return l!=="text"&&l!=="number"}return!0},i=this.TRANSLATE_SMALL,r=this.TRANSLATE_BIG;return q(this,"_keyboardManager",new Iu([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:s}],[["ctrl+z","mac+meta+z"],t.undo,{checker:s}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:s}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:s}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&n(a,_i).contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&n(a,_i).contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:e}]]))}destroy(){var t,e,s,i,r,a,o,l,h;(t=n(this,ps))==null||t.resolve(),p(this,ps,null),(e=n(this,Eo))==null||e.abort(),p(this,Eo,null),this._signal=null;for(const c of n(this,$t).values())c.destroy();n(this,$t).clear(),n(this,Pt).clear(),n(this,Er).clear(),(s=n(this,Sn))==null||s.clear(),p(this,Ue,null),n(this,it).clear(),n(this,us).destroy(),(i=n(this,_o))==null||i.destroy(),(r=n(this,fe))==null||r.destroy(),(a=n(this,_n))==null||a.destroy(),(o=n(this,Xs))==null||o.hide(),p(this,Xs,null),(l=n(this,ko))==null||l.destroy(),p(this,ko,null),p(this,So,null),n(this,Ws)&&(clearTimeout(n(this,Ws)),p(this,Ws,null)),n(this,qs)&&(clearTimeout(n(this,qs)),p(this,qs,null)),(h=this._editorUndoBar)==null||h.destroy(),p(this,Do,null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return n(this,fc)}get useNewAltTextFlow(){return n(this,cc)}get useNewAltTextWhenAddingImage(){return n(this,xo)}get hcmFilter(){return q(this,"hcmFilter",n(this,Cn)?n(this,dc).addHCMFilter(n(this,Cn).foreground,n(this,Cn).background):"none")}get direction(){return q(this,"direction",getComputedStyle(n(this,_i)).direction)}get _highlightColors(){return q(this,"_highlightColors",n(this,Po)?new Map(n(this,Po).split(",").map(t=>(t=t.split("=").map(e=>e.trim()),t[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return q(this,"highlightColors",null);const e=new Map,s=!!n(this,Cn);for(const[i,r]of t){const a=i.endsWith("_HCM");if(s&&a){e.set(i.replace("_HCM",""),r);continue}!s&&!a&&e.set(i,r)}return q(this,"highlightColors",e)}get highlightColorNames(){return q(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),p(this,bn,t)}setMainHighlightColorPicker(t){p(this,ko,t)}editAltText(t,e=!1){var s;(s=n(this,_o))==null||s.editAltText(this,t,e)}hasCommentManager(){return!!n(this,fe)}editComment(t,e,s,i){var r;(r=n(this,fe))==null||r.showDialog(this,t,e,s,i)}selectComment(t,e){const s=n(this,$t).get(t),i=s==null?void 0:s.getEditorByUID(e);i==null||i.toggleComment(!0,!0)}updateComment(t){var e;(e=n(this,fe))==null||e.updateComment(t.getData())}updatePopupColor(t){var e;(e=n(this,fe))==null||e.updatePopupColor(t)}removeComment(t){var e;(e=n(this,fe))==null||e.removeComments([t.uid])}toggleComment(t,e,s=void 0){var i;(i=n(this,fe))==null||i.toggleCommentPopup(t,e,s)}makeCommentColor(t,e){var s;return t&&((s=n(this,fe))==null?void 0:s.makeCommentColor(t,e))||null}getCommentDialogElement(){var t;return((t=n(this,fe))==null?void 0:t.dialogElement)||null}async waitForEditorsRendered(t){if(n(this,$t).has(t-1))return;const{resolve:e,promise:s}=Promise.withResolvers(),i=r=>{r.pageNumber===t&&(this._eventBus._off("editorsrendered",i),e())};this._eventBus.on("editorsrendered",i),await s}getSignature(t){var e;(e=n(this,_n))==null||e.getSignature({uiManager:this,editor:t})}get signatureManager(){return n(this,_n)}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){switch(t){case"enableNewAltTextWhenAddingImage":p(this,xo,e);break}}onPageChanging({pageNumber:t}){p(this,To,t-1)}focusMainContainer(){n(this,_i).focus()}findParent(t,e){for(const s of n(this,$t).values()){const{x:i,y:r,width:a,height:o}=s.div.getBoundingClientRect();if(t>=i&&t<=i+a&&e>=r&&e<=r+o)return s}return null}disableUserSelect(t=!1){n(this,mc).classList.toggle("noUserSelect",t)}addShouldRescale(t){n(this,Er).add(t)}removeShouldRescale(t){n(this,Er).delete(t)}onScaleChanging({scale:t}){var e;this.commitOrRemove(),this.viewParameters.realScale=t*on.PDF_TO_CSS_UNITS;for(const s of n(this,Er))s.onScaleChanging();(e=n(this,bn))==null||e.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t="",e=!1){const s=document.getSelection();if(!s||s.isCollapsed)return;const{anchorNode:i,anchorOffset:r,focusNode:a,focusOffset:o}=s,l=s.toString(),c=b(this,Mo,Ju).call(this,s).closest(".textLayer"),u=this.getSelectionBoxes(c);if(!u)return;s.empty();const g=b(this,yc,rm).call(this,c),m=n(this,Nt)===z.NONE,A=()=>{const y=g==null?void 0:g.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:u,anchorNode:i,anchorOffset:r,focusNode:a,focusOffset:o,text:l});m&&this.showAllEditors("highlight",!0,!0),e&&(y==null||y.editComment())};if(m){this.switchToMode(z.HIGHLIGHT,A);return}A()}commentSelection(t=""){this.highlightSelection(t,!0)}getAndRemoveDataFromAnnotationStorage(t){if(!n(this,ds))return null;const e=`${Xh}${t}`,s=n(this,ds).getRawValue(e);return s&&n(this,ds).remove(e),s}addToAnnotationStorage(t){!t.isEmpty()&&n(this,ds)&&!n(this,ds).has(t.id)&&n(this,ds).setValue(t.id,t)}a11yAlert(t,e=null){const s=n(this,bc);s&&(s.setAttribute("data-l10n-id",t),e?s.setAttribute("data-l10n-args",JSON.stringify(e)):s.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,n(this,wn)&&(p(this,wn,!1),b(this,_r,xh).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of n(this,it))if(e.div.contains(t)){p(this,Sr,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!n(this,Sr))return;const[t,e]=n(this,Sr);p(this,Sr,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){b(this,Ac,am).call(this),b(this,wc,om).call(this)}removeEditListeners(){b(this,tp,Qy).call(this),b(this,vc,lm).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const s of n(this,fs))if(s.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const e of t.dataTransfer.items)for(const s of n(this,fs))if(s.isHandlingMimeForPasting(e.type)){s.paste(e,this.currentLayer),t.preventDefault();return}}copy(t){var s;if(t.preventDefault(),(s=n(this,Ue))==null||s.commitOrRemove(),!this.hasSelection)return;const e=[];for(const i of n(this,it)){const r=i.serialize(!0);r&&e.push(r)}e.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const r of e.items)for(const a of n(this,fs))if(a.isHandlingMimeForPasting(r.type)){a.paste(r,this.currentLayer);return}let s=e.getData("application/pdfjs");if(!s)return;try{s=JSON.parse(s)}catch(r){V(`paste: "${r.message}".`);return}if(!Array.isArray(s))return;this.unselectAll();const i=this.currentLayer;try{const r=[];for(const l of s){const h=await i.deserialize(l);if(!h)return;r.push(h)}const a=()=>{for(const l of r)b(this,Ec,hm).call(this,l);b(this,Sc,cm).call(this,r)},o=()=>{for(const l of r)l.remove()};this.addCommands({cmd:a,undo:o,mustExec:!0})}catch(r){V(`paste: "${r.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),n(this,Nt)!==z.NONE&&!this.isEditorHandlingKeyboard&&ho._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,n(this,wn)&&(p(this,wn,!1),b(this,_r,xh).call(this,"main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}setEditingState(t){t?(b(this,Qf,Ky).call(this),b(this,wc,om).call(this),b(this,se,ve).call(this,{isEditing:n(this,Nt)!==z.NONE,isEmpty:b(this,Cr,Ph).call(this),hasSomethingToUndo:n(this,us).hasSomethingToUndo(),hasSomethingToRedo:n(this,us).hasSomethingToRedo(),hasSelectedEditor:!1})):(b(this,Zf,Jy).call(this),b(this,vc,lm).call(this),b(this,se,ve).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!n(this,fs)){p(this,fs,t);for(const e of n(this,fs))b(this,Cs,yi).call(this,e.defaultPropertiesToUpdate)}}getId(){return n(this,qf).id}get currentLayer(){return n(this,$t).get(n(this,To))}getLayer(t){return n(this,$t).get(t)}get currentPageIndex(){return n(this,To)}addLayer(t){n(this,$t).set(t.pageIndex,t),n(this,vn)?t.enable():t.disable()}removeLayer(t){n(this,$t).delete(t.pageIndex)}async updateMode(t,e=null,s=!1,i=!1,r=!1){var a,o,l,h,c,u;if(n(this,Nt)!==t&&!(n(this,ps)&&(await n(this,ps).promise,!n(this,ps)))){if(p(this,ps,Promise.withResolvers()),(a=n(this,bn))==null||a.commitOrRemove(),n(this,Nt)===z.POPUP&&((o=n(this,fe))==null||o.hideSidebar()),(l=n(this,fe))==null||l.destroyPopup(),p(this,Nt,t),t===z.NONE){this.setEditingState(!1),b(this,ip,eA).call(this);for(const g of n(this,Pt).values())g.hideStandaloneCommentButton();(h=this._editorUndoBar)==null||h.hide(),this.toggleComment(null),n(this,ps).resolve();return}for(const g of n(this,Pt).values())g.addStandaloneCommentButton();t===z.SIGNATURE&&await((c=n(this,_n))==null?void 0:c.loadSignatures()),this.setEditingState(!0),await b(this,sp,tA).call(this),this.unselectAll();for(const g of n(this,$t).values())g.updateMode(t);if(t===z.POPUP){n(this,So)||p(this,So,await n(this,Do).getAnnotationsByType(new Set(n(this,fs).map(A=>A._editorType))));const g=new Set,m=[];for(const A of n(this,Pt).values()){const{annotationElementId:y,hasComment:v,deleted:w}=A;y&&g.add(y),v&&!w&&m.push(A.getData())}for(const A of n(this,So)){const{id:y,popupRef:v,contentsObj:w}=A;v&&(w!=null&&w.str)&&!g.has(y)&&!n(this,yn).has(y)&&m.push(A)}(u=n(this,fe))==null||u.showSidebar(m)}if(!e){s&&this.addNewEditorFromKeyboard(),n(this,ps).resolve();return}for(const g of n(this,Pt).values())g.uid===e?(this.setSelected(g),r?g.editComment():i?g.enterInEditMode():g.focus()):g.unselect();n(this,ps).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==n(this,Nt)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(n(this,fs)){switch(t){case J.CREATE:this.currentLayer.addNewEditor(e);return;case J.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(n(this,pc)||p(this,pc,new Map)).set(t,e),this.showAllEditors("highlight",e);break}if(this.hasSelection)for(const s of n(this,it))s.updateParams(t,e);else for(const s of n(this,fs))s.updateDefaultParams(t,e)}}showAllEditors(t,e,s=!1){var r;for(const a of n(this,Pt).values())a.editorType===t&&a.show(e);(((r=n(this,pc))==null?void 0:r.get(J.HIGHLIGHT_SHOW_ALL))??!0)!==e&&b(this,Cs,yi).call(this,[[J.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(n(this,uc)!==t){p(this,uc,t);for(const e of n(this,$t).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}*getEditors(t){for(const e of n(this,Pt).values())e.pageIndex===t&&(yield e)}getEditor(t){return n(this,Pt).get(t)}addEditor(t){n(this,Pt).set(t.id,t)}removeEditor(t){var e,s;t.div.contains(document.activeElement)&&(n(this,Ws)&&clearTimeout(n(this,Ws)),p(this,Ws,setTimeout(()=>{this.focusMainContainer(),p(this,Ws,null)},0))),n(this,Pt).delete(t.id),t.annotationElementId&&((e=n(this,Sn))==null||e.delete(t.annotationElementId)),this.unselect(t),(!t.annotationElementId||!n(this,yn).has(t.annotationElementId))&&((s=n(this,ds))==null||s.remove(t.id))}addDeletedAnnotationElement(t){n(this,yn).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return n(this,yn).has(t)}removeDeletedAnnotationElement(t){n(this,yn).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){n(this,Ue)!==t&&(p(this,Ue,t),t&&b(this,Cs,yi).call(this,t.propertiesToUpdate))}updateUI(t){n(this,np,sA)===t&&b(this,Cs,yi).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){b(this,Cs,yi).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(n(this,it).has(t)){n(this,it).delete(t),t.unselect(),b(this,se,ve).call(this,{hasSelectedEditor:this.hasSelection});return}n(this,it).add(t),t.select(),b(this,Cs,yi).call(this,t.propertiesToUpdate),b(this,se,ve).call(this,{hasSelectedEditor:!0})}setSelected(t){var e;this.updateToolbar({mode:t.mode,editId:t.id}),(e=n(this,bn))==null||e.commitOrRemove();for(const s of n(this,it))s!==t&&s.unselect();n(this,it).clear(),n(this,it).add(t),t.select(),b(this,Cs,yi).call(this,t.propertiesToUpdate),b(this,se,ve).call(this,{hasSelectedEditor:!0})}isSelected(t){return n(this,it).has(t)}get firstSelectedEditor(){return n(this,it).values().next().value}unselect(t){t.unselect(),n(this,it).delete(t),b(this,se,ve).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return n(this,it).size!==0}get isEnterHandled(){return n(this,it).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var t;n(this,us).undo(),b(this,se,ve).call(this,{hasSomethingToUndo:n(this,us).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:b(this,Cr,Ph).call(this)}),(t=this._editorUndoBar)==null||t.hide()}redo(){n(this,us).redo(),b(this,se,ve).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:n(this,us).hasSomethingToRedo(),isEmpty:b(this,Cr,Ph).call(this)})}addCommands(t){n(this,us).add(t),b(this,se,ve).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:b(this,Cr,Ph).call(this)})}cleanUndoStack(t){n(this,us).cleanType(t)}delete(){var r;this.commitOrRemove();const t=(r=this.currentLayer)==null?void 0:r.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const e=t?[t]:[...n(this,it)],s=()=>{var a;(a=this._editorUndoBar)==null||a.show(i,e.length===1?e[0].editorType:e.length);for(const o of e)o.remove()},i=()=>{for(const a of e)b(this,Ec,hm).call(this,a)};this.addCommands({cmd:s,undo:i,mustExec:!0})}commitOrRemove(){var t;(t=n(this,Ue))==null||t.commitOrRemove()}hasSomethingToControl(){return n(this,Ue)||this.hasSelection}selectAll(){for(const t of n(this,it))t.commit();b(this,Sc,cm).call(this,n(this,Pt).values())}unselectAll(){var t;if(!(n(this,Ue)&&(n(this,Ue).commitOrRemove(),n(this,Nt)!==z.NONE))&&!((t=n(this,bn))!=null&&t.commitOrRemove())&&this.hasSelection){for(const e of n(this,it))e.unselect();n(this,it).clear(),b(this,se,ve).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e,s=!1){if(s||this.commitOrRemove(),!this.hasSelection)return;n(this,Tn)[0]+=t,n(this,Tn)[1]+=e;const[i,r]=n(this,Tn),a=[...n(this,it)],o=1e3;n(this,qs)&&clearTimeout(n(this,qs)),p(this,qs,setTimeout(()=>{p(this,qs,null),n(this,Tn)[0]=n(this,Tn)[1]=0,this.addCommands({cmd:()=>{for(const l of a)n(this,Pt).has(l.id)&&(l.translateInPage(i,r),l.translationDone())},undo:()=>{for(const l of a)n(this,Pt).has(l.id)&&(l.translateInPage(-i,-r),l.translationDone())},mustExec:!1})},o));for(const l of a)l.translateInPage(t,e),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),p(this,Vs,new Map);for(const t of n(this,it))n(this,Vs).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!n(this,Vs))return!1;this.disableUserSelect(!1);const t=n(this,Vs);p(this,Vs,null);let e=!1;for(const[{x:i,y:r,pageIndex:a},o]of t)o.newX=i,o.newY=r,o.newPageIndex=a,e||(e=i!==o.savedX||r!==o.savedY||a!==o.savedPageIndex);if(!e)return!1;const s=(i,r,a,o)=>{if(n(this,Pt).has(i.id)){const l=n(this,$t).get(o);l?i._setParentAndPosition(l,r,a):(i.pageIndex=o,i.x=r,i.y=a)}};return this.addCommands({cmd:()=>{for(const[i,{newX:r,newY:a,newPageIndex:o}]of t)s(i,r,a,o)},undo:()=>{for(const[i,{savedX:r,savedY:a,savedPageIndex:o}]of t)s(i,r,a,o)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(n(this,Vs))for(const s of n(this,Vs).keys())s.drag(t,e)}rebuild(t){if(t.parent===null){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){var t;return((t=this.getActive())==null?void 0:t.shouldGetKeyboardEvents())||n(this,it).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return n(this,Ue)===t}getActive(){return n(this,Ue)}getMode(){return n(this,Nt)}isEditingMode(){return n(this,Nt)!==z.NONE}get imageManager(){return q(this,"imageManager",new im)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let h=0,c=e.rangeCount;h<c;h++)if(!t.contains(e.getRangeAt(h).commonAncestorContainer))return null;const{x:s,y:i,width:r,height:a}=t.getBoundingClientRect();let o;switch(t.getAttribute("data-main-rotation")){case"90":o=(h,c,u,g)=>({x:(c-i)/a,y:1-(h+u-s)/r,width:g/a,height:u/r});break;case"180":o=(h,c,u,g)=>({x:1-(h+u-s)/r,y:1-(c+g-i)/a,width:u/r,height:g/a});break;case"270":o=(h,c,u,g)=>({x:1-(c+g-i)/a,y:(h-s)/r,width:g/a,height:u/r});break;default:o=(h,c,u,g)=>({x:(h-s)/r,y:(c-i)/a,width:u/r,height:g/a});break}const l=[];for(let h=0,c=e.rangeCount;h<c;h++){const u=e.getRangeAt(h);if(!u.collapsed)for(const{x:g,y:m,width:A,height:y}of u.getClientRects())A===0||y===0||l.push(o(g,m,A,y))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:t,id:e}){(n(this,Co)||p(this,Co,new Map)).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){var e;(e=n(this,Co))==null||e.delete(t)}renderAnnotationElement(t){var i;const e=(i=n(this,Co))==null?void 0:i.get(t.data.id);if(!e)return;const s=n(this,ds).getRawValue(e);s&&(n(this,Nt)===z.NONE&&!s.hasBeenModified||s.renderAnnotationElement(t))}setMissingCanvas(t,e,s){var r;const i=(r=n(this,Sn))==null?void 0:r.get(t);i&&(i.setCanvas(e,s),n(this,Sn).delete(t))}addMissingCanvas(t,e){(n(this,Sn)||p(this,Sn,new Map)).set(t,e)}};Eo=new WeakMap,Ue=new WeakMap,So=new WeakMap,Pt=new WeakMap,$t=new WeakMap,_o=new WeakMap,ds=new WeakMap,Co=new WeakMap,us=new WeakMap,fe=new WeakMap,mn=new WeakMap,bn=new WeakMap,To=new WeakMap,yn=new WeakMap,Vs=new WeakMap,fs=new WeakMap,Er=new WeakMap,hc=new WeakMap,cc=new WeakMap,xo=new WeakMap,dc=new WeakMap,Ws=new WeakMap,An=new WeakMap,Po=new WeakMap,wn=new WeakMap,Xs=new WeakMap,qf=new WeakMap,vn=new WeakMap,Ro=new WeakMap,uc=new WeakMap,En=new WeakMap,Sr=new WeakMap,ko=new WeakMap,Sn=new WeakMap,fc=new WeakMap,Nt=new WeakMap,it=new WeakMap,Si=new WeakMap,_n=new WeakMap,Cn=new WeakMap,pc=new WeakMap,Do=new WeakMap,gc=new WeakMap,Tn=new WeakMap,qs=new WeakMap,_i=new WeakMap,mc=new WeakMap,bc=new WeakMap,ps=new WeakMap,Mo=new WeakSet,Ju=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},yc=new WeakSet,rm=function(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const s of n(this,$t).values())if(s.hasTextLayer(t))return s;return null},Yf=new WeakSet,Xy=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const s=b(this,Mo,Ju).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(s);i&&(n(this,Xs)||p(this,Xs,new Mv(this)),n(this,Xs).show(s,i,this.direction==="ltr"))},Kf=new WeakSet,qy=function(){var r,a,o;const t=document.getSelection();if(!t||t.isCollapsed){n(this,Si)&&((r=n(this,Xs))==null||r.hide(),p(this,Si,null),b(this,se,ve).call(this,{hasSelectedText:!1}));return}const{anchorNode:e}=t;if(e===n(this,Si))return;const i=b(this,Mo,Ju).call(this,t).closest(".textLayer");if(!i){n(this,Si)&&((a=n(this,Xs))==null||a.hide(),p(this,Si,null),b(this,se,ve).call(this,{hasSelectedText:!1}));return}if((o=n(this,Xs))==null||o.hide(),p(this,Si,e),b(this,se,ve).call(this,{hasSelectedText:!0}),!(n(this,Nt)!==z.HIGHLIGHT&&n(this,Nt)!==z.NONE)&&(n(this,Nt)===z.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),p(this,wn,this.isShiftKeyDown),!this.isShiftKeyDown)){const l=n(this,Nt)===z.HIGHLIGHT?b(this,yc,rm).call(this,i):null;if(l==null||l.toggleDrawing(),n(this,Ro)){const h=new AbortController,c=this.combinedSignal(h),u=g=>{g.type==="pointerup"&&g.button!==0||(h.abort(),l==null||l.toggleDrawing(!0),g.type==="pointerup"&&b(this,_r,xh).call(this,"main_toolbar"))};window.addEventListener("pointerup",u,{signal:c}),window.addEventListener("blur",u,{signal:c})}else l==null||l.toggleDrawing(!0),b(this,_r,xh).call(this,"main_toolbar")}},_r=new WeakSet,xh=function(t=""){n(this,Nt)===z.HIGHLIGHT?this.highlightSelection(t):n(this,hc)&&b(this,Yf,Xy).call(this)},Jf=new WeakSet,Yy=function(){document.addEventListener("selectionchange",b(this,Kf,qy).bind(this),{signal:this._signal})},Qf=new WeakSet,Ky=function(){if(n(this,An))return;p(this,An,new AbortController);const t=this.combinedSignal(n(this,An));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},Zf=new WeakSet,Jy=function(){var t;(t=n(this,An))==null||t.abort(),p(this,An,null)},Ac=new WeakSet,am=function(){if(n(this,En))return;p(this,En,new AbortController);const t=this.combinedSignal(n(this,En));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},tp=new WeakSet,Qy=function(){var t;(t=n(this,En))==null||t.abort(),p(this,En,null)},wc=new WeakSet,om=function(){if(n(this,mn))return;p(this,mn,new AbortController);const t=this.combinedSignal(n(this,mn));document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})},vc=new WeakSet,lm=function(){var t;(t=n(this,mn))==null||t.abort(),p(this,mn,null)},ep=new WeakSet,Zy=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},se=new WeakSet,ve=function(t){Object.entries(t).some(([s,i])=>n(this,gc)[s]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(n(this,gc),t)}),n(this,Nt)===z.HIGHLIGHT&&t.hasSelectedEditor===!1&&b(this,Cs,yi).call(this,[[J.HIGHLIGHT_FREE,!0]]))},Cs=new WeakSet,yi=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},sp=new WeakSet,tA=async function(){if(!n(this,vn)){p(this,vn,!0);const t=[];for(const e of n(this,$t).values())t.push(e.enable());await Promise.all(t);for(const e of n(this,Pt).values())e.enable()}},ip=new WeakSet,eA=function(){if(this.unselectAll(),n(this,vn)){p(this,vn,!1);for(const t of n(this,$t).values())t.disable();for(const t of n(this,Pt).values())t.disable()}},Ec=new WeakSet,hm=function(t){const e=n(this,$t).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},np=new WeakSet,sA=function(){let t=null;for(t of n(this,it));return t},Cr=new WeakSet,Ph=function(){if(n(this,Pt).size===0)return!0;if(n(this,Pt).size===1)for(const t of n(this,Pt).values())return t.isEmpty();return!1},Sc=new WeakSet,cm=function(t){for(const e of n(this,it))e.unselect();n(this,it).clear();for(const e of t)e.isEmpty()||(n(this,it).add(e),e.select());b(this,se,ve).call(this,{hasSelectedEditor:this.hasSelection})},k(ho,"TRANSLATE_SMALL",1),k(ho,"TRANSLATE_BIG",10);let ur=ho;var Vt,Ys,Ts,Lo,Ks,$e,Io,Js,Re,Ci,Tr,Qs,xn,xr,Rh,Fo,Qu;const Ee=class Ee{constructor(t){f(this,xr);f(this,Fo);f(this,Vt,null);f(this,Ys,!1);f(this,Ts,null);f(this,Lo,null);f(this,Ks,null);f(this,$e,null);f(this,Io,!1);f(this,Js,null);f(this,Re,null);f(this,Ci,null);f(this,Tr,null);f(this,Qs,!1);p(this,Re,t),p(this,Qs,t._uiManager.useNewAltTextFlow),n(Ee,xn)||p(Ee,xn,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(t){Ee._l10n??(Ee._l10n=t)}async render(){const t=p(this,Ts,document.createElement("button"));t.className="altText",t.tabIndex="0";const e=p(this,Lo,document.createElement("span"));t.append(e),n(this,Qs)?(t.classList.add("new"),t.setAttribute("data-l10n-id",n(Ee,xn).missing),e.setAttribute("data-l10n-id",n(Ee,xn)["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const s=n(this,Re)._uiManager._signal;t.addEventListener("contextmenu",as,{signal:s}),t.addEventListener("pointerdown",r=>r.stopPropagation(),{signal:s});const i=r=>{r.preventDefault(),n(this,Re)._uiManager.editAltText(n(this,Re)),n(this,Qs)&&n(this,Re)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:n(this,xr,Rh)}})};return t.addEventListener("click",i,{capture:!0,signal:s}),t.addEventListener("keydown",r=>{r.target===t&&r.key==="Enter"&&(p(this,Io,!0),i(r))},{signal:s}),await b(this,Fo,Qu).call(this),t}finish(){n(this,Ts)&&(n(this,Ts).focus({focusVisible:n(this,Io)}),p(this,Io,!1))}isEmpty(){return n(this,Qs)?n(this,Vt)===null:!n(this,Vt)&&!n(this,Ys)}hasData(){return n(this,Qs)?n(this,Vt)!==null||!!n(this,Ci):this.isEmpty()}get guessedText(){return n(this,Ci)}async setGuessedText(t){n(this,Vt)===null&&(p(this,Ci,t),p(this,Tr,await Ee._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),b(this,Fo,Qu).call(this))}toggleAltTextBadge(t=!1){var e;if(!n(this,Qs)||n(this,Vt)){(e=n(this,Js))==null||e.remove(),p(this,Js,null);return}if(!n(this,Js)){const s=p(this,Js,document.createElement("div"));s.className="noAltTextBadge",n(this,Re).div.append(s)}n(this,Js).classList.toggle("hidden",!t)}serialize(t){let e=n(this,Vt);return!t&&n(this,Ci)===e&&(e=n(this,Tr)),{altText:e,decorative:n(this,Ys),guessedText:n(this,Ci),textWithDisclaimer:n(this,Tr)}}get data(){return{altText:n(this,Vt),decorative:n(this,Ys)}}set data({altText:t,decorative:e,guessedText:s,textWithDisclaimer:i,cancel:r=!1}){s&&(p(this,Ci,s),p(this,Tr,i)),!(n(this,Vt)===t&&n(this,Ys)===e)&&(r||(p(this,Vt,t),p(this,Ys,e)),b(this,Fo,Qu).call(this))}toggle(t=!1){n(this,Ts)&&(!t&&n(this,$e)&&(clearTimeout(n(this,$e)),p(this,$e,null)),n(this,Ts).disabled=!t)}shown(){n(this,Re)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:n(this,xr,Rh)}})}destroy(){var t,e;(t=n(this,Ts))==null||t.remove(),p(this,Ts,null),p(this,Lo,null),p(this,Ks,null),(e=n(this,Js))==null||e.remove(),p(this,Js,null)}};Vt=new WeakMap,Ys=new WeakMap,Ts=new WeakMap,Lo=new WeakMap,Ks=new WeakMap,$e=new WeakMap,Io=new WeakMap,Js=new WeakMap,Re=new WeakMap,Ci=new WeakMap,Tr=new WeakMap,Qs=new WeakMap,xn=new WeakMap,xr=new WeakSet,Rh=function(){return n(this,Vt)&&"added"||n(this,Vt)===null&&this.guessedText&&"review"||"missing"},Fo=new WeakSet,Qu=async function(){var i,r,a;const t=n(this,Ts);if(!t)return;if(n(this,Qs)){if(t.classList.toggle("done",!!n(this,Vt)),t.setAttribute("data-l10n-id",n(Ee,xn)[n(this,xr,Rh)]),(i=n(this,Lo))==null||i.setAttribute("data-l10n-id",n(Ee,xn)[`${n(this,xr,Rh)}-label`]),!n(this,Vt)){(r=n(this,Ks))==null||r.remove();return}}else{if(!n(this,Vt)&&!n(this,Ys)){t.classList.remove("done"),(a=n(this,Ks))==null||a.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=n(this,Ks);if(!e){p(this,Ks,e=document.createElement("span")),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=`alt-text-tooltip-${n(this,Re).id}`;const o=100,l=n(this,Re)._uiManager._signal;l.addEventListener("abort",()=>{clearTimeout(n(this,$e)),p(this,$e,null)},{once:!0}),t.addEventListener("mouseenter",()=>{p(this,$e,setTimeout(()=>{p(this,$e,null),n(this,Ks).classList.add("show"),n(this,Re)._reportTelemetry({action:"alt_text_tooltip"})},o))},{signal:l}),t.addEventListener("mouseleave",()=>{var h;n(this,$e)&&(clearTimeout(n(this,$e)),p(this,$e,null)),(h=n(this,Ks))==null||h.classList.remove("show")},{signal:l})}n(this,Ys)?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=n(this,Vt)),e.parentNode||t.append(e);const s=n(this,Re).getElementForAltText();s==null||s.setAttribute("aria-describedby",e.id)},f(Ee,xn,null),k(Ee,"_l10n",null);let kf=Ee;var ie,gs,Pr,gt,_c,Rr,xs,kr,Dr,Mr,Cc,dm;class Uu{constructor(t){f(this,Cc);f(this,ie,null);f(this,gs,null);f(this,Pr,!1);f(this,gt,null);f(this,_c,null);f(this,Rr,null);f(this,xs,null);f(this,kr,null);f(this,Dr,!1);f(this,Mr,null);p(this,gt,t)}renderForToolbar(){const t=p(this,gs,document.createElement("button"));return t.className="comment",b(this,Cc,dm).call(this,t,!1)}renderForStandalone(){const t=p(this,ie,document.createElement("button"));t.className="annotationCommentButton";const e=n(this,gt).commentButtonPosition;if(e){const{style:s}=t;s.insetInlineEnd=`calc(${100*(n(this,gt)._uiManager.direction==="ltr"?1-e[0]:e[0])}% - var(--comment-button-dim))`,s.top=`calc(${100*e[1]}% - var(--comment-button-dim))`;const i=n(this,gt).commentButtonColor;i&&(s.backgroundColor=i)}return b(this,Cc,dm).call(this,t,!0)}focusButton(){setTimeout(()=>{var t;(t=n(this,ie)??n(this,gs))==null||t.focus()},0)}onUpdatedColor(){if(!n(this,ie))return;const t=n(this,gt).commentButtonColor;t&&(n(this,ie).style.backgroundColor=t),n(this,gt)._uiManager.updatePopupColor(n(this,gt))}get commentButtonWidth(){var t;return(((t=n(this,ie))==null?void 0:t.getBoundingClientRect().width)??0)/n(this,gt).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(n(this,Mr))return n(this,Mr);if(!n(this,ie))return null;const{x:t,y:e,height:s}=n(this,ie).getBoundingClientRect(),{x:i,y:r,width:a,height:o}=n(this,gt).parent.boundingClientRect;return[(t-i)/a,(e+s-r)/o]}set commentPopupPositionInLayer(t){p(this,Mr,t)}hasDefaultPopupPosition(){return n(this,Mr)===null}removeStandaloneCommentButton(){var t;(t=n(this,ie))==null||t.remove(),p(this,ie,null)}removeToolbarCommentButton(){var t;(t=n(this,gs))==null||t.remove(),p(this,gs,null)}setCommentButtonStates({selected:t,hasPopup:e}){n(this,ie)&&(n(this,ie).classList.toggle("selected",t),n(this,ie).ariaExpanded=e)}edit(t){const e=this.commentPopupPositionInLayer;let s,i;if(e)[s,i]=e;else{[s,i]=n(this,gt).commentButtonPosition;const{width:c,height:u,x:g,y:m}=n(this,gt);s=g+s*c,i=m+i*u}const r=n(this,gt).parent.boundingClientRect,{x:a,y:o,width:l,height:h}=r;n(this,gt)._uiManager.editComment(n(this,gt),a+s*l,o+i*h,{...t,parentDimensions:r})}finish(){n(this,gs)&&(n(this,gs).focus({focusVisible:n(this,Pr)}),p(this,Pr,!1))}isDeleted(){return n(this,Dr)||n(this,xs)===""}isEmpty(){return n(this,xs)===null}hasBeenEdited(){return this.isDeleted()||n(this,xs)!==n(this,_c)}serialize(){return this.data}get data(){return{text:n(this,xs),richText:n(this,Rr),date:n(this,kr),deleted:this.isDeleted()}}set data(t){if(t!==n(this,xs)&&p(this,Rr,null),t===null){p(this,xs,""),p(this,Dr,!0);return}p(this,xs,t),p(this,kr,new Date),p(this,Dr,!1)}setInitialText(t,e=null){p(this,_c,t),this.data=t,p(this,kr,null),p(this,Rr,e)}shown(){}destroy(){var t,e;(t=n(this,gs))==null||t.remove(),p(this,gs,null),(e=n(this,ie))==null||e.remove(),p(this,ie,null),p(this,xs,""),p(this,Rr,null),p(this,kr,null),p(this,gt,null),p(this,Pr,!1),p(this,Dr,!1)}}ie=new WeakMap,gs=new WeakMap,Pr=new WeakMap,gt=new WeakMap,_c=new WeakMap,Rr=new WeakMap,xs=new WeakMap,kr=new WeakMap,Dr=new WeakMap,Mr=new WeakMap,Cc=new WeakSet,dm=function(t,e){if(!n(this,gt)._uiManager.hasCommentManager())return null;t.tabIndex="0",t.ariaHasPopup="dialog",e?(t.ariaControls="commentPopup",t.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(t.ariaControlsElements=[n(this,gt)._uiManager.getCommentDialogElement()],t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button"));const s=n(this,gt)._uiManager._signal;if(!(s instanceof AbortSignal)||s.aborted)return t;t.addEventListener("contextmenu",as,{signal:s}),e&&(t.addEventListener("focusin",r=>{n(this,gt)._focusEventsAllowed=!1,Tt(r)},{capture:!0,signal:s}),t.addEventListener("focusout",r=>{n(this,gt)._focusEventsAllowed=!0,Tt(r)},{capture:!0,signal:s})),t.addEventListener("pointerdown",r=>r.stopPropagation(),{signal:s});const i=r=>{r.preventDefault(),t===n(this,gs)?this.edit():n(this,gt).toggleComment(!0)};return t.addEventListener("click",i,{capture:!0,signal:s}),t.addEventListener("keydown",r=>{r.target===t&&r.key==="Enter"&&(p(this,Pr,!0),i(r))},{signal:s}),t.addEventListener("pointerenter",()=>{n(this,gt).toggleComment(!1,!0)},{signal:s}),t.addEventListener("pointerleave",()=>{n(this,gt).toggleComment(!1,!1)},{signal:s}),t};var No,Lr,Tc,xc,Pc,Rc,kc,Ti,Ir,xi,Fr,Pi,rp,iA,ap,nA,op,rA;const $b=class $b{constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:s=null,onPinchStart:i=null,onPinching:r=null,onPinchEnd:a=null,signal:o}){f(this,rp);f(this,ap);f(this,op);f(this,No,void 0);f(this,Lr,!1);f(this,Tc,null);f(this,xc,void 0);f(this,Pc,void 0);f(this,Rc,void 0);f(this,kc,void 0);f(this,Ti,null);f(this,Ir,void 0);f(this,xi,null);f(this,Fr,void 0);f(this,Pi,null);p(this,No,t),p(this,Tc,s),p(this,xc,e),p(this,Pc,i),p(this,Rc,r),p(this,kc,a),p(this,Fr,new AbortController),p(this,Ir,AbortSignal.any([o,n(this,Fr).signal])),t.addEventListener("touchstart",b(this,rp,iA).bind(this),{passive:!1,signal:n(this,Ir)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Us.pixelRatio}destroy(){var t,e;(t=n(this,Fr))==null||t.abort(),p(this,Fr,null),(e=n(this,Ti))==null||e.abort(),p(this,Ti,null)}};No=new WeakMap,Lr=new WeakMap,Tc=new WeakMap,xc=new WeakMap,Pc=new WeakMap,Rc=new WeakMap,kc=new WeakMap,Ti=new WeakMap,Ir=new WeakMap,xi=new WeakMap,Fr=new WeakMap,Pi=new WeakMap,rp=new WeakSet,iA=function(t){var i,r,a;if((i=n(this,xc))!=null&&i.call(this))return;if(t.touches.length===1){if(n(this,Ti))return;const o=p(this,Ti,new AbortController),l=AbortSignal.any([n(this,Ir),o.signal]),h=n(this,No),c={capture:!0,signal:l,passive:!1},u=g=>{var m;g.pointerType==="touch"&&((m=n(this,Ti))==null||m.abort(),p(this,Ti,null))};h.addEventListener("pointerdown",g=>{g.pointerType==="touch"&&(Tt(g),u(g))},c),h.addEventListener("pointerup",u,c),h.addEventListener("pointercancel",u,c);return}if(!n(this,Pi)){p(this,Pi,new AbortController);const o=AbortSignal.any([n(this,Ir),n(this,Pi).signal]),l=n(this,No),h={signal:o,capture:!1,passive:!1};l.addEventListener("touchmove",b(this,ap,nA).bind(this),h);const c=b(this,op,rA).bind(this);l.addEventListener("touchend",c,h),l.addEventListener("touchcancel",c,h),h.capture=!0,l.addEventListener("pointerdown",Tt,h),l.addEventListener("pointermove",Tt,h),l.addEventListener("pointercancel",Tt,h),l.addEventListener("pointerup",Tt,h),(r=n(this,Pc))==null||r.call(this)}if(Tt(t),t.touches.length!==2||(a=n(this,Tc))!=null&&a.call(this)){p(this,xi,null);return}let[e,s]=t.touches;e.identifier>s.identifier&&([e,s]=[s,e]),p(this,xi,{touch0X:e.screenX,touch0Y:e.screenY,touch1X:s.screenX,touch1Y:s.screenY})},ap=new WeakSet,nA=function(t){var _;if(!n(this,xi)||t.touches.length!==2)return;Tt(t);let[e,s]=t.touches;e.identifier>s.identifier&&([e,s]=[s,e]);const{screenX:i,screenY:r}=e,{screenX:a,screenY:o}=s,l=n(this,xi),{touch0X:h,touch0Y:c,touch1X:u,touch1Y:g}=l,m=u-h,A=g-c,y=a-i,v=o-r,w=Math.hypot(y,v)||1,E=Math.hypot(m,A)||1;if(!n(this,Lr)&&Math.abs(E-w)<=$b.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=i,l.touch0Y=r,l.touch1X=a,l.touch1Y=o,!n(this,Lr)){p(this,Lr,!0);return}const S=[(i+a)/2,(r+o)/2];(_=n(this,Rc))==null||_.call(this,S,E,w)},op=new WeakSet,rA=function(t){var e;t.touches.length>=2||(n(this,Pi)&&(n(this,Pi).abort(),p(this,Pi,null),(e=n(this,kc))==null||e.call(this)),n(this,xi)&&(Tt(t),p(this,xi,null),p(this,Lr,!1)))};let Jh=$b;var Nr,Ps,wt,ct,Ri,Oo,Pn,Dc,ne,Or,ki,Zs,Rn,Mc,Br,je,Lc,Hr,Di,ti,Bo,Ho,ms,Ur,Ic,lp,Fc,um,Nc,fm,Uo,Zu,hp,aA,cp,oA,Oc,pm,$o,tf,Bc,gm,dp,lA,up,hA,fp,cA,Hc,mm,pp,dA,Uc,bm,gp,uA,mp,fA,bp,pA,$c,ym,$r,kh;const W=class W{constructor(t){f(this,Fc);f(this,Uo);f(this,hp);f(this,cp);f(this,Oc);f(this,$o);f(this,Bc);f(this,dp);f(this,up);f(this,fp);f(this,Hc);f(this,pp);f(this,Uc);f(this,gp);f(this,mp);f(this,bp);f(this,$c);f(this,$r);f(this,Nr,null);f(this,Ps,null);f(this,wt,null);f(this,ct,null);f(this,Ri,null);f(this,Oo,!1);f(this,Pn,null);f(this,Dc,"");f(this,ne,null);f(this,Or,null);f(this,ki,null);f(this,Zs,null);f(this,Rn,null);f(this,Mc,"");f(this,Br,!1);f(this,je,null);f(this,Lc,!1);f(this,Hr,!1);f(this,Di,!1);f(this,ti,null);f(this,Bo,0);f(this,Ho,0);f(this,ms,null);f(this,Ur,null);k(this,"isSelected",!1);k(this,"_isCopy",!1);k(this,"_editToolbar",null);k(this,"_initialOptions",Object.create(null));k(this,"_initialData",null);k(this,"_isVisible",!0);k(this,"_uiManager",null);k(this,"_focusEventsAllowed",!0);f(this,Ic,!1);f(this,lp,W._zIndex++);this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null,this.annotationElementId=t.annotationElementId||null,this.creationDate=t.creationDate||new Date,this.modificationDate=t.modificationDate||null;const{rotation:e,rawDims:{pageWidth:s,pageHeight:i,pageX:r,pageY:a}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[s,i],this.pageTranslation=[r,a];const[o,l]=this.parentDimensions;this.x=t.x/o,this.y=t.y/l,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const t=W.prototype._resizeWithKeyboard,e=ur.TRANSLATE_SMALL,s=ur.TRANSLATE_BIG;return q(this,"_resizerKeyboardManager",new Iu([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-s,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[s,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-s]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,s]}],[["Escape","mac+Escape"],W.prototype._stopResizingWithKeyboard]]))}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 q(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new Fv({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(W._l10n??(W._l10n=t),W._l10nResizer||(W._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"})),W._borderLineWidth!==-1)return;const s=getComputedStyle(document.documentElement);W._borderLineWidth=parseFloat(s.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){ft("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return n(this,Ic)}set _isDraggable(t){var e;p(this,Ic,t),(e=this.div)==null||e.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(t*2),this.y+=this.width*t/(e*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(t*2),this.y-=this.width*t/(e*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=n(this,lp)}setParent(t){var e;t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(b(this,$r,kh).call(this),(e=n(this,Zs))==null||e.remove(),p(this,Zs,null)),this.parent=t}focusin(t){this._focusEventsAllowed&&(n(this,Br)?p(this,Br,!1):this.parent.setSelected(this))}focusout(t){var s;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const e=t.relatedTarget;e!=null&&e.closest(`#${this.id}`)||(t.preventDefault(),(s=this.parent)!=null&&s.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,s,i){const[r,a]=this.parentDimensions;[s,i]=this.screenToPageTranslation(s,i),this.x=(t+s)/r,this.y=(e+i)/a,this.fixAndSetPosition()}_moveAfterPaste(t,e){const[s,i]=this.parentDimensions;this.setAt(t*s,e*i,this.width*s,this.height*i),this._onTranslated()}translate(t,e){b(this,Fc,um).call(this,this.parentDimensions,t,e)}translateInPage(t,e){n(this,je)||p(this,je,[this.x,this.y,this.width,this.height]),b(this,Fc,um).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){n(this,je)||p(this,je,[this.x,this.y,this.width,this.height]);const{div:s,parentDimensions:[i,r]}=this;if(this.x+=t/i,this.y+=e/r,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:g}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,g)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this;const[l,h]=this.getBaseTranslation();a+=l,o+=h;const{style:c}=s;c.left=`${(100*a).toFixed(2)}%`,c.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o),s.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!n(this,je)&&(n(this,je)[0]!==this.x||n(this,je)[1]!==this.y)}get _hasBeenResized(){return!!n(this,je)&&(n(this,je)[2]!==this.width||n(this,je)[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:s}=W,i=s/t,r=s/e;switch(this.rotation){case 90:return[-i,r];case 180:return[i,r];case 270:return[i,-r];default:return[-i,-r]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:e},pageDimensions:[s,i]}=this;let{x:r,y:a,width:o,height:l}=this;if(o*=s,l*=i,r*=s,a*=i,this._mustFixPosition)switch(t){case 0:r=ye(r,0,s-o),a=ye(a,0,i-l);break;case 90:r=ye(r,0,s-l),a=ye(a,o,i);break;case 180:r=ye(r,o,s),a=ye(a,l,i);break;case 270:r=ye(r,l,s),a=ye(a,0,i-o);break}this.x=r/=s,this.y=a/=i;const[h,c]=this.getBaseTranslation();r+=h,a+=c,e.left=`${(100*r).toFixed(2)}%`,e.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(t,e){var s;return b(s=W,Nc,fm).call(s,t,e,this.parentRotation)}pageTranslationToScreen(t,e){var s;return b(s=W,Nc,fm).call(s,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,s]}=this;return[e*t,s*t]}setDims(){const{div:{style:t},width:e,height:s}=this;t.width=`${(100*e).toFixed(2)}%`,t.height=`${(100*s).toFixed(2)}%`}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(t*1e4)/1e4}_onResizing(){}altTextFinish(){var t;(t=n(this,wt))==null||t.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||n(this,Hr))return this._editToolbar;this._editToolbar=new em(this),this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[e,s]of t)await this._editToolbar.addButton(e,s);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){var t;(t=this._editToolbar)==null||t.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){var t;(t=this._editToolbar)==null||t.removeButton("comment")}removeEditToolbar(){var t,e;(t=this._editToolbar)==null||t.remove(),this._editToolbar=null,(e=n(this,wt))==null||e.destroy()}addContainer(t){var s;const e=(s=this._editToolbar)==null?void 0:s.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return n(this,wt)||(kf.initialize(W._l10n),p(this,wt,new kf(this)),n(this,Nr)&&(n(this,wt).data=n(this,Nr),p(this,Nr,null))),n(this,wt)}get altTextData(){var t;return(t=n(this,wt))==null?void 0:t.data}set altTextData(t){n(this,wt)&&(n(this,wt).data=t)}get guessedAltText(){var t;return(t=n(this,wt))==null?void 0:t.guessedText}async setGuessedAltText(t){var e;await((e=n(this,wt))==null?void 0:e.setGuessedText(t))}serializeAltText(t){var e;return(e=n(this,wt))==null?void 0:e.serialize(t)}hasAltText(){return!!n(this,wt)&&!n(this,wt).isEmpty()}hasAltTextData(){var t;return((t=n(this,wt))==null?void 0:t.hasData())??!1}focusCommentButton(){var t;(t=n(this,ct))==null||t.focusButton()}addCommentButton(){return n(this,ct)||p(this,ct,new Uu(this))}addStandaloneCommentButton(){if(n(this,Ri)){this._uiManager.isEditingMode()&&n(this,Ri).classList.remove("hidden");return}this.hasComment&&(p(this,Ri,n(this,ct).renderForStandalone()),this.div.append(n(this,Ri)))}removeStandaloneCommentButton(){n(this,ct).removeStandaloneCommentButton(),p(this,Ri,null)}hideStandaloneCommentButton(){var t;(t=n(this,Ri))==null||t.classList.add("hidden")}get comment(){const{data:{richText:t,text:e,date:s,deleted:i}}=n(this,ct);return{text:e,richText:t,date:s,deleted:i,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(t){n(this,ct)||p(this,ct,new Uu(this)),n(this,ct).data=t,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:t,popupRef:e,richText:s}){if(!e||(n(this,ct)||p(this,ct,new Uu(this)),n(this,ct).setInitialText(t,s),!this.annotationElementId))return;const i=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);i&&this.updateFromAnnotationLayer(i)}get hasEditedComment(){var t;return(t=n(this,ct))==null?void 0:t.hasBeenEdited()}get hasDeletedComment(){var t;return(t=n(this,ct))==null?void 0:t.isDeleted()}get hasComment(){return!!n(this,ct)&&!n(this,ct).isEmpty()&&!n(this,ct).isDeleted()}async editComment(t){n(this,ct)||p(this,ct,new Uu(this)),n(this,ct).edit(t)}toggleComment(t,e=void 0){this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){n(this,ct).setSelectedButton(t)}addComment(t){if(this.hasEditedComment){const[,,,i]=t.rect,[r]=this.pageDimensions,[a]=this.pageTranslation,o=a+r+1,l=i-100,h=o+180;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[o,l,h,i]}}}updateFromAnnotationLayer({popup:{contents:t,deleted:e}}){n(this,ct).data=e?null:t}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){var a;const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=n(this,Oo)?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),b(this,Uc,bm).call(this);const[e,s]=this.parentDimensions;this.parentRotation%180!==0&&(t.style.maxWidth=`${(100*s/e).toFixed(2)}%`,t.style.maxHeight=`${(100*e/s).toFixed(2)}%`);const[i,r]=this.getInitialTranslation();return this.translate(i,r),Vy(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(n(this,Ur)||p(this,Ur,new Jh({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:b(this,dp,lA).bind(this),onPinching:b(this,up,hA).bind(this),onPinchEnd:b(this,fp,cA).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),(a=this._uiManager._editorUndoBar)==null||a.hide(),t}pointerdown(t){const{isMac:e}=Zt.platform;if(t.button!==0||t.ctrlKey&&e){t.preventDefault();return}if(p(this,Br,!0),this._isDraggable){b(this,pp,dA).call(this,t);return}b(this,Hc,mm).call(this,t)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){n(this,ti)&&clearTimeout(n(this,ti)),p(this,ti,setTimeout(()=>{var t;p(this,ti,null),(t=this.parent)==null||t.moveEditorInDOM(this)},0))}_setParentAndPosition(t,e,s){t.changeParent(this),this.x=e,this.y=s,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e,s=this.rotation){const i=this.parentScale,[r,a]=this.pageDimensions,[o,l]=this.pageTranslation,h=t/i,c=e/i,u=this.x*r,g=this.y*a,m=this.width*r,A=this.height*a;switch(s){case 0:return[u+h+o,a-g-c-A+l,u+h+m+o,a-g-c+l];case 90:return[u+c+o,a-g+h+l,u+c+A+o,a-g+h+m+l];case 180:return[u-h-m+o,a-g+c+l,u-h+o,a-g+c+A+l];case 270:return[u-c-A+o,a-g-h-m+l,u-c+o,a-g-h+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[s,i,r,a]=t,o=r-s,l=a-i;switch(this.rotation){case 0:return[s,e-a,o,l];case 90:return[s,e-i,l,o];case 180:return[r,e-i,o,l];case 270:return[r,e-a,l,o];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&W._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){var t;(t=n(this,ct))==null||t.onUpdatedColor()}getData(){const{comment:{text:t,color:e,date:s,opacity:i,deleted:r,richText:a},uid:o,pageIndex:l,creationDate:h,modificationDate:c}=this;return{id:o,pageIndex:l,rect:this.getPDFRect(),richText:a,contentsObj:{str:t},creationDate:h,modificationDate:s||c,popupRef:!r,color:e,opacity:i}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),p(this,Hr,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),p(this,Hr,!1),!0):!1}isInEditMode(){return n(this,Hr)}shouldGetKeyboardEvents(){return n(this,Di)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:s,right:i}=this.getClientDimensions(),{innerHeight:r,innerWidth:a}=window;return e<a&&i>0&&t<r&&s>0}rebuild(){b(this,Uc,bm).call(this)}rotate(t){}resize(){}serializeDeleted(){var t;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:((t=this._initialData)==null?void 0:t.popupRef)||""}}serialize(t=!1,e=null){var s;return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:((s=this._initialData)==null?void 0:s.popupRef)||""}}static async deserialize(t,e,s){const i=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:s,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});i.rotation=t.rotation,p(i,Nr,t.accessibilityData),i._isCopy=t.isCopy||!1;const[r,a]=i.pageDimensions,[o,l,h,c]=i.getRectInCurrentCoords(t.rect,a);return i.x=o/r,i.y=l/a,i.width=h/r,i.height=c/a,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var t,e;if((t=n(this,Rn))==null||t.abort(),p(this,Rn,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),n(this,ti)&&(clearTimeout(n(this,ti)),p(this,ti,null)),b(this,$r,kh).call(this),this.removeEditToolbar(),n(this,ms)){for(const s of n(this,ms).values())clearTimeout(s);p(this,ms,null)}this.parent=null,(e=n(this,Ur))==null||e.destroy(),p(this,Ur,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(b(this,hp,aA).call(this),n(this,ne).classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[t,e]}=this,[s,i,r,a]=this.getPDFRect();return[W._round(s+(r-s)*t),W._round(i+(a-i)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return n(this,ct).commentPopupPositionInLayer}set commentPopupPosition(t){n(this,ct).commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return n(this,ct).hasDefaultPopupPosition()}get commentButtonWidth(){return n(this,ct).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){n(this,ct).setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),p(this,ki,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=n(this,ne).children;if(!n(this,Ps)){p(this,Ps,Array.from(e));const a=b(this,gp,uA).bind(this),o=b(this,mp,fA).bind(this),l=this._uiManager._signal;for(const h of n(this,Ps)){const c=h.getAttribute("data-resizer-name");h.setAttribute("role","spinbutton"),h.addEventListener("keydown",a,{signal:l}),h.addEventListener("blur",o,{signal:l}),h.addEventListener("focus",b(this,bp,pA).bind(this,c),{signal:l}),h.setAttribute("data-l10n-id",W._l10nResizer[c])}}const s=n(this,Ps)[0];let i=0;for(const a of e){if(a===s)break;i++}const r=(360-this.rotation+this.parentRotation)%360/90*(n(this,Ps).length/4);if(r!==i){if(r<i)for(let o=0;o<i-r;o++)n(this,ne).append(n(this,ne).firstChild);else if(r>i)for(let o=0;o<r-i;o++)n(this,ne).firstChild.before(n(this,ne).lastChild);let a=0;for(const o of e){const h=n(this,Ps)[a++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",W._l10nResizer[h])}}b(this,$c,ym).call(this,0),p(this,Di,!0),n(this,ne).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){n(this,Di)&&b(this,Bc,gm).call(this,n(this,Mc),{deltaX:t,deltaY:e,fromKeyboard:!0})}_stopResizingWithKeyboard(){b(this,$r,kh).call(this),this.div.focus()}select(){var t,e,s;if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),(t=this.div)==null||t.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var i,r;(i=this.div)!=null&&i.classList.contains("selectedEditor")&&((r=this._editToolbar)==null||r.show())});return}(e=this._editToolbar)==null||e.show(),(s=n(this,wt))==null||s.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>{var t;return(t=this.div)==null?void 0:t.focus({preventScroll:!0})},0)}unselect(){var t,e,s,i,r;this.isSelected&&(this.isSelected=!1,(t=n(this,ne))==null||t.classList.add("hidden"),(e=this.div)==null||e.classList.remove("selectedEditor"),(s=this.div)!=null&&s.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(i=this._editToolbar)==null||i.hide(),(r=n(this,wt))==null||r.toggleAltTextBadge(!0),this.hasComment&&this._uiManager.toggleComment(this,!1,!1))}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){t.target.nodeName!=="BUTTON"&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return n(this,Lc)}set isEditing(t){p(this,Lc,t),this.parent&&(t?(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(t,e=!1){if(e){n(this,ms)||p(this,ms,new Map);const{action:s}=t;let i=n(this,ms).get(s);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),n(this,ms).delete(s),n(this,ms).size===0&&p(this,ms,null)},W._telemetryTimeout),n(this,ms).set(s,i);return}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),p(this,Oo,!1)}disable(){this.div&&(this.div.tabIndex=-1),p(this,Oo,!0)}updateFakeAnnotationElement(t){if(!n(this,Zs)&&!this.deleted){p(this,Zs,t.addFakeAnnotation(this));return}if(this.deleted){n(this,Zs).remove(),p(this,Zs,null);return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&n(this,Zs).updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let e=t.container.querySelector(".annotationContent");if(!e)e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);else if(e.nodeName==="CANVAS"){const s=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),s.before(e)}return e}resetAnnotationElement(t){const{firstChild:e}=t.container;(e==null?void 0:e.nodeName)==="DIV"&&e.classList.contains("annotationContent")&&e.remove()}};Nr=new WeakMap,Ps=new WeakMap,wt=new WeakMap,ct=new WeakMap,Ri=new WeakMap,Oo=new WeakMap,Pn=new WeakMap,Dc=new WeakMap,ne=new WeakMap,Or=new WeakMap,ki=new WeakMap,Zs=new WeakMap,Rn=new WeakMap,Mc=new WeakMap,Br=new WeakMap,je=new WeakMap,Lc=new WeakMap,Hr=new WeakMap,Di=new WeakMap,ti=new WeakMap,Bo=new WeakMap,Ho=new WeakMap,ms=new WeakMap,Ur=new WeakMap,Ic=new WeakMap,lp=new WeakMap,Fc=new WeakSet,um=function([t,e],s,i){[s,i]=this.screenToPageTranslation(s,i),this.x+=s/t,this.y+=i/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},Nc=new WeakSet,fm=function(t,e,s){switch(s){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}},Uo=new WeakSet,Zu=function(t){switch(t){case 90:{const[e,s]=this.pageDimensions;return[0,-e/s,s/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,s]=this.pageDimensions;return[0,e/s,-s/e,0]}default:return[1,0,0,1]}},hp=new WeakSet,aA=function(){if(n(this,ne))return;p(this,ne,document.createElement("div")),n(this,ne).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const s of t){const i=document.createElement("div");n(this,ne).append(i),i.classList.add("resizer",s),i.setAttribute("data-resizer-name",s),i.addEventListener("pointerdown",b(this,cp,oA).bind(this,s),{signal:e}),i.addEventListener("contextmenu",as,{signal:e}),i.tabIndex=-1}this.div.prepend(n(this,ne))},cp=new WeakSet,oA=function(t,e){var c;e.preventDefault();const{isMac:s}=Zt.platform;if(e.button!==0||e.ctrlKey&&s)return;(c=n(this,wt))==null||c.toggle(!1);const i=this._isDraggable;this._isDraggable=!1,p(this,Or,[e.screenX,e.screenY]);const r=new AbortController,a=this._uiManager.combinedSignal(r);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",b(this,Bc,gm).bind(this,t),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",Tt,{passive:!1,signal:a}),window.addEventListener("contextmenu",as,{signal:a}),p(this,ki,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const o=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const h=()=>{var u;r.abort(),this.parent.togglePointerEvents(!0),(u=n(this,wt))==null||u.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=o,this.div.style.cursor=l,b(this,$o,tf).call(this)};window.addEventListener("pointerup",h,{signal:a}),window.addEventListener("blur",h,{signal:a})},Oc=new WeakSet,pm=function(t,e,s,i){this.width=s,this.height=i,this.x=t,this.y=e,this.setDims(),this.fixAndSetPosition(),this._onResized()},$o=new WeakSet,tf=function(){if(!n(this,ki))return;const{savedX:t,savedY:e,savedWidth:s,savedHeight:i}=n(this,ki);p(this,ki,null);const r=this.x,a=this.y,o=this.width,l=this.height;r===t&&a===e&&o===s&&l===i||this.addCommands({cmd:b(this,Oc,pm).bind(this,r,a,o,l),undo:b(this,Oc,pm).bind(this,t,e,s,i),mustExec:!0})},Bc=new WeakSet,gm=function(t,e){const[s,i]=this.parentDimensions,r=this.x,a=this.y,o=this.width,l=this.height,h=W.MIN_SIZE/s,c=W.MIN_SIZE/i,u=b(this,Uo,Zu).call(this,this.rotation),g=(N,I)=>[u[0]*N+u[2]*I,u[1]*N+u[3]*I],m=b(this,Uo,Zu).call(this,360-this.rotation),A=(N,I)=>[m[0]*N+m[2]*I,m[1]*N+m[3]*I];let y,v,w=!1,E=!1;switch(t){case"topLeft":w=!0,y=(N,I)=>[0,0],v=(N,I)=>[N,I];break;case"topMiddle":y=(N,I)=>[N/2,0],v=(N,I)=>[N/2,I];break;case"topRight":w=!0,y=(N,I)=>[N,0],v=(N,I)=>[0,I];break;case"middleRight":E=!0,y=(N,I)=>[N,I/2],v=(N,I)=>[0,I/2];break;case"bottomRight":w=!0,y=(N,I)=>[N,I],v=(N,I)=>[0,0];break;case"bottomMiddle":y=(N,I)=>[N/2,I],v=(N,I)=>[N/2,0];break;case"bottomLeft":w=!0,y=(N,I)=>[0,I],v=(N,I)=>[N,0];break;case"middleLeft":E=!0,y=(N,I)=>[0,I/2],v=(N,I)=>[N,I/2];break}const S=y(o,l),_=v(o,l);let C=g(..._);const T=W._round(r+C[0]),x=W._round(a+C[1]);let P=1,R=1,D,M;if(e.fromKeyboard)({deltaX:D,deltaY:M}=e);else{const{screenX:N,screenY:I}=e,[Y,Q]=n(this,Or);[D,M]=this.screenToPageTranslation(N-Y,I-Q),n(this,Or)[0]=N,n(this,Or)[1]=I}if([D,M]=A(D/s,M/i),w){const N=Math.hypot(o,l);P=R=Math.max(Math.min(Math.hypot(_[0]-S[0]-D,_[1]-S[1]-M)/N,1/o,1/l),h/o,c/l)}else E?P=ye(Math.abs(_[0]-S[0]-D),h,1)/o:R=ye(Math.abs(_[1]-S[1]-M),c,1)/l;const L=W._round(o*P),j=W._round(l*R);C=g(...v(L,j));const F=T-C[0],G=x-C[1];n(this,je)||p(this,je,[this.x,this.y,this.width,this.height]),this.width=L,this.height=j,this.x=F,this.y=G,this.setDims(),this.fixAndSetPosition(),this._onResizing()},dp=new WeakSet,lA=function(){var t;p(this,ki,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(t=n(this,wt))==null||t.toggle(!1),this.parent.togglePointerEvents(!1)},up=new WeakSet,hA=function(t,e,s){let r=.7*(s/e)+1-.7;if(r===1)return;const a=b(this,Uo,Zu).call(this,this.rotation),o=(T,x)=>[a[0]*T+a[2]*x,a[1]*T+a[3]*x],[l,h]=this.parentDimensions,c=this.x,u=this.y,g=this.width,m=this.height,A=W.MIN_SIZE/l,y=W.MIN_SIZE/h;r=Math.max(Math.min(r,1/g,1/m),A/g,y/m);const v=W._round(g*r),w=W._round(m*r);if(v===g&&w===m)return;n(this,je)||p(this,je,[c,u,g,m]);const E=o(g/2,m/2),S=W._round(c+E[0]),_=W._round(u+E[1]),C=o(v/2,w/2);this.x=S-C[0],this.y=_-C[1],this.width=v,this.height=w,this.setDims(),this.fixAndSetPosition(),this._onResizing()},fp=new WeakSet,cA=function(){var t;(t=n(this,wt))==null||t.toggle(!0),this.parent.togglePointerEvents(!0),b(this,$o,tf).call(this)},Hc=new WeakSet,mm=function(t){const{isMac:e}=Zt.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},pp=new WeakSet,dA=function(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let s=!1;const i=new AbortController,r=this._uiManager.combinedSignal(i),a={capture:!0,passive:!1,signal:r},o=h=>{i.abort(),p(this,Pn,null),p(this,Br,!1),this._uiManager.endDragSession()||b(this,Hc,mm).call(this,h),s&&this._onStopDragging()};e&&(p(this,Bo,t.clientX),p(this,Ho,t.clientY),p(this,Pn,t.pointerId),p(this,Dc,t.pointerType),window.addEventListener("pointermove",h=>{s||(s=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:c,clientY:u,pointerId:g}=h;if(g!==n(this,Pn)){Tt(h);return}const[m,A]=this.screenToPageTranslation(c-n(this,Bo),u-n(this,Ho));p(this,Bo,c),p(this,Ho,u),this._uiManager.dragSelectedEditors(m,A)},a),window.addEventListener("touchmove",Tt,a),window.addEventListener("pointerdown",h=>{h.pointerType===n(this,Dc)&&(n(this,Ur)||h.isPrimary)&&o(h),Tt(h)},a));const l=h=>{if(!n(this,Pn)||n(this,Pn)===h.pointerId){o(h);return}Tt(h)};window.addEventListener("pointerup",l,{signal:r}),window.addEventListener("blur",l,{signal:r})},Uc=new WeakSet,bm=function(){if(n(this,Rn)||!this.div)return;p(this,Rn,new AbortController);const t=this._uiManager.combinedSignal(n(this,Rn));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},gp=new WeakSet,uA=function(t){W._resizerKeyboardManager.exec(this,t)},mp=new WeakSet,fA=function(t){var e;n(this,Di)&&((e=t.relatedTarget)==null?void 0:e.parentNode)!==n(this,ne)&&b(this,$r,kh).call(this)},bp=new WeakSet,pA=function(t){p(this,Mc,n(this,Di)?t:"")},$c=new WeakSet,ym=function(t){if(n(this,Ps))for(const e of n(this,Ps))e.tabIndex=t},$r=new WeakSet,kh=function(){p(this,Di,!1),b(this,$c,ym).call(this,-1),b(this,$o,tf).call(this)},f(W,Nc),k(W,"_l10n",null),k(W,"_l10nResizer",null),k(W,"_borderLineWidth",-1),k(W,"_colorManager",new nm),k(W,"_zIndex",1),k(W,"_telemetryTimeout",1e3);let mt=W;class Fv extends mt{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const Zb=3285377520,os=4294901760,Gs=65535;class gA{constructor(t){this.h1=t?t&4294967295:Zb,this.h2=t?t&4294967295:Zb}update(t){let e,s;if(typeof t=="string"){e=new Uint8Array(t.length*2),s=0;for(let y=0,v=t.length;y<v;y++){const w=t.charCodeAt(y);w<=255?e[s++]=w:(e[s++]=w>>>8,e[s++]=w&255)}}else if(ArrayBuffer.isView(t))e=t.slice(),s=e.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const i=s>>2,r=s-i*4,a=new Uint32Array(e.buffer,0,i);let o=0,l=0,h=this.h1,c=this.h2;const u=3432918353,g=461845907,m=u&Gs,A=g&Gs;for(let y=0;y<i;y++)y&1?(o=a[y],o=o*u&os|o*m&Gs,o=o<<15|o>>>17,o=o*g&os|o*A&Gs,h^=o,h=h<<13|h>>>19,h=h*5+3864292196):(l=a[y],l=l*u&os|l*m&Gs,l=l<<15|l>>>17,l=l*g&os|l*A&Gs,c^=l,c=c<<13|c>>>19,c=c*5+3864292196);switch(o=0,r){case 3:o^=e[i*4+2]<<16;case 2:o^=e[i*4+1]<<8;case 1:o^=e[i*4],o=o*u&os|o*m&Gs,o=o<<15|o>>>17,o=o*g&os|o*A&Gs,i&1?h^=o:c^=o}this.h1=h,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&os|t*36045&Gs,e=e*4283543511&os|((e<<16|t>>>16)*2950163797&os)>>>16,t^=e>>>1,t=t*444984403&os|t*60499&Gs,e=e*3301882366&os|((e<<16|t>>>16)*3120437893&os)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const Am=Object.freeze({map:null,hash:"",transfer:void 0});var jr,Gr,Mi,re,yp,mA;class kb{constructor(){f(this,yp);f(this,jr,!1);f(this,Gr,null);f(this,Mi,null);f(this,re,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const s=n(this,re).get(t);return s===void 0?e:Object.assign(e,s)}getRawValue(t){return n(this,re).get(t)}remove(t){const e=n(this,re).get(t);if(e!==void 0&&(e instanceof mt&&n(this,Mi).delete(e.annotationElementId),n(this,re).delete(t),n(this,re).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(const s of n(this,re).values())if(s instanceof mt)return;this.onAnnotationEditor(null)}}setValue(t,e){const s=n(this,re).get(t);let i=!1;if(s!==void 0)for(const[r,a]of Object.entries(e))s[r]!==a&&(i=!0,s[r]=a);else i=!0,n(this,re).set(t,e);i&&b(this,yp,mA).call(this),e instanceof mt&&((n(this,Mi)||p(this,Mi,new Map)).set(e.annotationElementId,e),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(e.constructor._type))}has(t){return n(this,re).has(t)}get size(){return n(this,re).size}resetModified(){n(this,jr)&&(p(this,jr,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new bA(this)}get serializable(){if(n(this,re).size===0)return Am;const t=new Map,e=new gA,s=[],i=Object.create(null);let r=!1;for(const[a,o]of n(this,re)){const l=o instanceof mt?o.serialize(!1,i):o;l&&(t.set(a,l),e.update(`${a}:${JSON.stringify(l)}`),r||(r=!!l.bitmap))}if(r)for(const a of t.values())a.bitmap&&s.push(a.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:s}:Am}get editorStats(){let t=null;const e=new Map;let s=0,i=0;for(const r of n(this,re).values()){if(!(r instanceof mt)){r.popup&&(r.popup.deleted?i+=1:s+=1);continue}r.isCommentDeleted?i+=1:r.hasEditedComment&&(s+=1);const a=r.telemetryFinalData;if(!a)continue;const{type:o}=a;e.has(o)||e.set(o,Object.getPrototypeOf(r).constructor),t||(t=Object.create(null));const l=t[o]||(t[o]=new Map);for(const[h,c]of Object.entries(a)){if(h==="type")continue;let u=l.get(h);u||(u=new Map,l.set(h,u));const g=u.get(c)??0;u.set(c,g+1)}}if((i>0||s>0)&&(t||(t=Object.create(null)),t.comments={deleted:i,edited:s}),!t)return null;for(const[r,a]of e)t[r]=a.computeTelemetryFinalData(t[r]);return t}resetModifiedIds(){p(this,Gr,null)}updateEditor(t,e){var i;const s=(i=n(this,Mi))==null?void 0:i.get(t);return s?(s.updateFromAnnotationLayer(e),!0):!1}getEditor(t){var e;return((e=n(this,Mi))==null?void 0:e.get(t))||null}get modifiedIds(){if(n(this,Gr))return n(this,Gr);const t=[];if(n(this,Mi))for(const e of n(this,Mi).values())e.serialize()&&t.push(e.annotationElementId);return p(this,Gr,{ids:new Set(t),hash:t.join(",")})}[Symbol.iterator](){return n(this,re).entries()}}jr=new WeakMap,Gr=new WeakMap,Mi=new WeakMap,re=new WeakMap,yp=new WeakSet,mA=function(){n(this,jr)||(p(this,jr,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var jc;class bA extends kb{constructor(e){super();f(this,jc,void 0);const{map:s,hash:i,transfer:r}=e.serializable,a=structuredClone(s,r?{transfer:r}:null);p(this,jc,{map:a,hash:i,transfer:r})}get print(){ft("Should not call PrintAnnotationStorage.print")}get serializable(){return n(this,jc)}get modifiedIds(){return q(this,"modifiedIds",{ids:new Set,hash:""})}}jc=new WeakMap;var jo;class Nv{constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){f(this,jo,new Set);this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),n(this,jo).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:s}){if(!(!t||n(this,jo).has(t.loadedName))){if(Z(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:r,style:a}=t,o=new FontFace(i,r,a);this.addNativeFontFace(o);try{await o.load(),n(this,jo).add(i),s==null||s(t)}catch{V(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}ft("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const s=t.createNativeFontFace();if(s){this.addNativeFontFace(s);try{await s.loaded}catch(i){throw V(`Failed to load font '${s.family}': '${i}'.`),t.disableFontFace=!0,i}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(s=>{const i=this._queueLoadingCallback(s);this._prepareFontLoadEvent(t,i)})}}get isFontLoadingAPISupported(){var e;const t=!!((e=this._document)!=null&&e.fonts);return q(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){return q(this,"isSyncFontLoadingSupported",Te||Zt.platform.isFirefox)}_queueLoadingCallback(t){function e(){for(Z(!i.done,"completeRequest() cannot be called twice."),i.done=!0;s.length>0&&s[0].done;){const r=s.shift();setTimeout(r.callback,0)}}const{loadingRequests:s}=this,i={done:!1,complete:e,callback:t};return s.push(i),i}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return q(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function s(_,C){return _.charCodeAt(C)<<24|_.charCodeAt(C+1)<<16|_.charCodeAt(C+2)<<8|_.charCodeAt(C+3)&255}function i(_,C,T,x){const P=_.substring(0,C),R=_.substring(C+T);return P+x+R}let r,a;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let h=0;function c(_,C){if(++h>30){V("Load test font never loaded."),C();return}if(l.font="30px "+_,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){C();return}setTimeout(c.bind(null,_,C))}const u=`lt${Date.now()}${this.loadTestFontId++}`;let g=this._loadTestFont;g=i(g,976,u.length,u);const A=16,y=1482184792;let v=s(g,A);for(r=0,a=u.length-3;r<a;r+=4)v=v-y+s(u,r)|0;r<u.length&&(v=v-y+s(u+"XXX",r)|0),g=i(g,A,4,Sv(v));const w=`url(data:font/opentype;base64,${btoa(g)});`,E=`@font-face {font-family:"${u}";src:${w}}`;this.insertRule(E);const S=this._document.createElement("div");S.style.visibility="hidden",S.style.width=S.style.height="10px",S.style.position="absolute",S.style.top=S.style.left="0px";for(const _ of[t.loadedName,u]){const C=this._document.createElement("span");C.textContent="Hi",C.style.fontFamily=_,S.append(C)}this._document.body.append(S),c(u,()=>{S.remove(),e.complete()})}}jo=new WeakMap;var rt;class Ov{constructor(t,e=null,s,i){f(this,rt,void 0);this.compiledGlyphs=Object.create(null),p(this,rt,t),this._inspectFont=e,s&&Object.assign(this,s),i&&(this.charProcOperatorList=i)}createNativeFontFace(){var e;if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const s={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(s.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,s)}return(e=this._inspectFont)==null||e.call(this,this),t}createFontFaceRule(){var s;if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${Ly(this.data)});`;let e;if(!this.cssFontInfo)e=`@font-face {font-family:"${this.loadedName}";src:${t}}`;else{let i=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(i+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),e=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${i}src:${t}}`}return(s=this._inspectFont)==null||s.call(this,this,t),e}getPathGenerator(t,e){if(this.compiledGlyphs[e]!==void 0)return this.compiledGlyphs[e];const s=this.loadedName+"_path_"+e;let i;try{i=t.get(s)}catch(a){V(`getPathGenerator - ignoring character: "${a}".`)}const r=new Path2D(i||"");return this.fontExtraProperties||t.delete(s),this.compiledGlyphs[e]=r}get black(){return n(this,rt).black}get bold(){return n(this,rt).bold}get disableFontFace(){return n(this,rt).disableFontFace??!1}get fontExtraProperties(){return n(this,rt).fontExtraProperties??!1}get isInvalidPDFjsFont(){return n(this,rt).isInvalidPDFjsFont}get isType3Font(){return n(this,rt).isType3Font}get italic(){return n(this,rt).italic}get missingFile(){return n(this,rt).missingFile}get remeasure(){return n(this,rt).remeasure}get vertical(){return n(this,rt).vertical}get ascent(){return n(this,rt).ascent}get defaultWidth(){return n(this,rt).defaultWidth}get descent(){return n(this,rt).descent}get bbox(){return n(this,rt).bbox}get fontMatrix(){return n(this,rt).fontMatrix}get fallbackName(){return n(this,rt).fallbackName}get loadedName(){return n(this,rt).loadedName}get mimetype(){return n(this,rt).mimetype}get name(){return n(this,rt).name}get data(){return n(this,rt).data}clearData(){n(this,rt).clearData()}get cssFontInfo(){return n(this,rt).cssFontInfo}get systemFontInfo(){return n(this,rt).systemFontInfo}get defaultVMetrics(){return n(this,rt).defaultVMetrics}}rt=new WeakMap;function Bv(d){if(d instanceof URL)return d.href;if(typeof d=="string"){if(Te)return d;const t=URL.parse(d,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.")}function Hv(d){if(Te&&typeof Buffer<"u"&&d instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(d instanceof Uint8Array&&d.byteLength===d.buffer.byteLength)return d;if(typeof d=="string")return Du(d);if(d instanceof ArrayBuffer||ArrayBuffer.isView(d)||typeof d=="object"&&!isNaN(d==null?void 0:d.length))return new Uint8Array(d);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function $u(d){if(typeof d!="string")return null;if(d.endsWith("/"))return d;throw new Error(`Invalid factory url: "${d}" must include trailing slash.`)}const wm=d=>typeof d=="object"&&Number.isInteger(d==null?void 0:d.num)&&d.num>=0&&Number.isInteger(d==null?void 0:d.gen)&&d.gen>=0,Uv=d=>typeof d=="object"&&typeof(d==null?void 0:d.name)=="string",yA=xv.bind(null,wm,Uv);var Li,Ap;class $v{constructor(){f(this,Li,new Map);f(this,Ap,Promise.resolve())}postMessage(t,e){const s={data:structuredClone(t,e?{transfer:e}:null)};n(this,Ap).then(()=>{for(const[i]of n(this,Li))i.call(this,s)})}addEventListener(t,e,s=null){let i=null;if((s==null?void 0:s.signal)instanceof AbortSignal){const{signal:r}=s;if(r.aborted){V("LoopbackPort - cannot use an `aborted` signal.");return}const a=()=>this.removeEventListener(t,e);i=()=>r.removeEventListener("abort",a),r.addEventListener("abort",a)}n(this,Li).set(e,i)}removeEventListener(t,e){const s=n(this,Li).get(e);s==null||s(),n(this,Li).delete(e)}terminate(){for(const[,t]of n(this,Li))t==null||t();n(this,Li).clear()}}Li=new WeakMap,Ap=new WeakMap;const ju={DATA:1,ERROR:2},Ft={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function ty(){}function xe(d){if(d instanceof an||d instanceof Pf||d instanceof Wb||d instanceof qh||d instanceof zg)return d;switch(d instanceof Error||typeof d=="object"&&d!==null||ft('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),d.name){case"AbortException":return new an(d.message);case"InvalidPDFException":return new Pf(d.message);case"PasswordException":return new Wb(d.message,d.code);case"ResponseException":return new qh(d.message,d.status,d.missing);case"UnknownErrorException":return new zg(d.message,d.details)}return new zg(d.message,d.toString())}var Go,wp,AA,vp,wA,Ep,vA,zo,ef;class Dh{constructor(t,e,s){f(this,wp);f(this,vp);f(this,Ep);f(this,zo);f(this,Go,new AbortController);this.sourceName=t,this.targetName=e,this.comObj=s,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),s.addEventListener("message",b(this,wp,AA).bind(this),{signal:n(this,Go).signal})}on(t,e){const s=this.actionHandler;if(s[t])throw new Error(`There is already an actionName called "${t}"`);s[t]=e}send(t,e,s){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},s)}sendWithPromise(t,e,s){const i=this.callbackId++,r=Promise.withResolvers();this.callbackCapabilities[i]=r;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:e},s)}catch(a){r.reject(a)}return r.promise}sendWithStream(t,e,s,i){const r=this.streamId++,a=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:h=>{const c=Promise.withResolvers();return this.streamControllers[r]={controller:h,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:a,targetName:o,action:t,streamId:r,data:e,desiredSize:h.desiredSize},i),c.promise},pull:h=>{const c=Promise.withResolvers();return this.streamControllers[r].pullCall=c,l.postMessage({sourceName:a,targetName:o,stream:Ft.PULL,streamId:r,desiredSize:h.desiredSize}),c.promise},cancel:h=>{Z(h instanceof Error,"cancel must have a valid reason");const c=Promise.withResolvers();return this.streamControllers[r].cancelCall=c,this.streamControllers[r].isClosed=!0,l.postMessage({sourceName:a,targetName:o,stream:Ft.CANCEL,streamId:r,reason:xe(h)}),c.promise}},s)}destroy(){var t;(t=n(this,Go))==null||t.abort(),p(this,Go,null)}}Go=new WeakMap,wp=new WeakSet,AA=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){b(this,Ep,vA).call(this,t);return}if(t.callback){const s=t.callbackId,i=this.callbackCapabilities[s];if(!i)throw new Error(`Cannot resolve callback ${s}`);if(delete this.callbackCapabilities[s],t.callback===ju.DATA)i.resolve(t.data);else if(t.callback===ju.ERROR)i.reject(xe(t.reason));else throw new Error("Unexpected callback case");return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const s=this.sourceName,i=t.sourceName,r=this.comObj;Promise.try(e,t.data).then(function(a){r.postMessage({sourceName:s,targetName:i,callback:ju.DATA,callbackId:t.callbackId,data:a})},function(a){r.postMessage({sourceName:s,targetName:i,callback:ju.ERROR,callbackId:t.callbackId,reason:xe(a)})});return}if(t.streamId){b(this,vp,wA).call(this,t);return}e(t.data)},vp=new WeakSet,wA=function(t){const e=t.streamId,s=this.sourceName,i=t.sourceName,r=this.comObj,a=this,o=this.actionHandler[t.action],l={enqueue(h,c=1,u){if(this.isCancelled)return;const g=this.desiredSize;this.desiredSize-=c,g>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),r.postMessage({sourceName:s,targetName:i,stream:Ft.ENQUEUE,streamId:e,chunk:h},u)},close(){this.isCancelled||(this.isCancelled=!0,r.postMessage({sourceName:s,targetName:i,stream:Ft.CLOSE,streamId:e}),delete a.streamSinks[e])},error(h){Z(h instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,r.postMessage({sourceName:s,targetName:i,stream:Ft.ERROR,streamId:e,reason:xe(h)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[e]=l,Promise.try(o,t.data,l).then(function(){r.postMessage({sourceName:s,targetName:i,stream:Ft.START_COMPLETE,streamId:e,success:!0})},function(h){r.postMessage({sourceName:s,targetName:i,stream:Ft.START_COMPLETE,streamId:e,reason:xe(h)})})},Ep=new WeakSet,vA=function(t){const e=t.streamId,s=this.sourceName,i=t.sourceName,r=this.comObj,a=this.streamControllers[e],o=this.streamSinks[e];switch(t.stream){case Ft.START_COMPLETE:t.success?a.startCall.resolve():a.startCall.reject(xe(t.reason));break;case Ft.PULL_COMPLETE:t.success?a.pullCall.resolve():a.pullCall.reject(xe(t.reason));break;case Ft.PULL:if(!o){r.postMessage({sourceName:s,targetName:i,stream:Ft.PULL_COMPLETE,streamId:e,success:!0});break}o.desiredSize<=0&&t.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=t.desiredSize,Promise.try(o.onPull||ty).then(function(){r.postMessage({sourceName:s,targetName:i,stream:Ft.PULL_COMPLETE,streamId:e,success:!0})},function(h){r.postMessage({sourceName:s,targetName:i,stream:Ft.PULL_COMPLETE,streamId:e,reason:xe(h)})});break;case Ft.ENQUEUE:if(Z(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(t.chunk);break;case Ft.CLOSE:if(Z(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),b(this,zo,ef).call(this,a,e);break;case Ft.ERROR:Z(a,"error should have stream controller"),a.controller.error(xe(t.reason)),b(this,zo,ef).call(this,a,e);break;case Ft.CANCEL_COMPLETE:t.success?a.cancelCall.resolve():a.cancelCall.reject(xe(t.reason)),b(this,zo,ef).call(this,a,e);break;case Ft.CANCEL:if(!o)break;const l=xe(t.reason);Promise.try(o.onCancel||ty,l).then(function(){r.postMessage({sourceName:s,targetName:i,stream:Ft.CANCEL_COMPLETE,streamId:e,success:!0})},function(h){r.postMessage({sourceName:s,targetName:i,stream:Ft.CANCEL_COMPLETE,streamId:e,reason:xe(h)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},zo=new WeakSet,ef=async function(t,e){var s,i,r;await Promise.allSettled([(s=t.startCall)==null?void 0:s.promise,(i=t.pullCall)==null?void 0:i.promise,(r=t.cancelCall)==null?void 0:r.promise]),delete this.streamControllers[e]};var Gc;class EA{constructor({enableHWA:t=!1}){f(this,Gc,!1);p(this,Gc,t)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const s=this._createCanvas(t,e);return{canvas:s,context:s.getContext("2d",{willReadFrequently:!n(this,Gc)})}}reset(t,e,s){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||s<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=s}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){ft("Abstract method `_createCanvas` called.")}}Gc=new WeakMap;class jv extends EA{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const s=this._document.createElement("canvas");return s.width=t,s.height=e,s}}class SA{constructor({baseUrl:t=null,isCompressed:e=!0}){this.baseUrl=t,this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(e).then(s=>({cMapData:s,isCompressed:this.isCompressed})).catch(s=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)})}async _fetch(t){ft("Abstract method `_fetch` called.")}}class ey extends SA{async _fetch(t){const e=await Ah(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):Du(e)}}class _A{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,s,i,r){return"none"}destroy(t=!1){}}var zr,Vo,Ii,Fi,pe,Vr,Wr,Wt,de,Xr,Mh,kn,so,Wo,sf,Dn,io,Sp,CA,zc,vm,Mn,no,qr,Lh,Yr,Ih,Vc,Em,Kr,Fh;class Gv extends _A{constructor({docId:e,ownerDocument:s=globalThis.document}){super();f(this,Wt);f(this,Xr);f(this,kn);f(this,Wo);f(this,Dn);f(this,Sp);f(this,zc);f(this,Mn);f(this,qr);f(this,Yr);f(this,Vc);f(this,Kr);f(this,zr,void 0);f(this,Vo,void 0);f(this,Ii,void 0);f(this,Fi,void 0);f(this,pe,void 0);f(this,Vr,void 0);f(this,Wr,0);p(this,Fi,e),p(this,pe,s)}addFilter(e){if(!e)return"none";let s=n(this,Wt,de).get(e);if(s)return s;const[i,r,a]=b(this,Wo,sf).call(this,e),o=e.length===1?i:`${i}${r}${a}`;if(s=n(this,Wt,de).get(o),s)return n(this,Wt,de).set(e,s),s;const l=`g_${n(this,Fi)}_transfer_map_${Ht(this,Wr)._++}`,h=b(this,Dn,io).call(this,l);n(this,Wt,de).set(e,h),n(this,Wt,de).set(o,h);const c=b(this,Mn,no).call(this,l);return b(this,Yr,Ih).call(this,i,r,a,c),h}addHCMFilter(e,s){var A;const i=`${e}-${s}`,r="base";let a=n(this,Xr,Mh).get(r);if((a==null?void 0:a.key)===i||(a?((A=a.filter)==null||A.remove(),a.key=i,a.url="none",a.filter=null):(a={key:i,url:"none",filter:null},n(this,Xr,Mh).set(r,a)),!e||!s))return a.url;const o=b(this,Kr,Fh).call(this,e);e=O.makeHexColor(...o);const l=b(this,Kr,Fh).call(this,s);if(s=O.makeHexColor(...l),n(this,kn,so).style.color="",e==="#000000"&&s==="#ffffff"||e===s)return a.url;const h=new Array(256);for(let y=0;y<=255;y++){const v=y/255;h[y]=v<=.03928?v/12.92:((v+.055)/1.055)**2.4}const c=h.join(","),u=`g_${n(this,Fi)}_hcm_filter`,g=a.filter=b(this,Mn,no).call(this,u);b(this,Yr,Ih).call(this,c,c,c,g),b(this,zc,vm).call(this,g);const m=(y,v)=>{const w=o[y]/255,E=l[y]/255,S=new Array(v+1);for(let _=0;_<=v;_++)S[_]=w+_/v*(E-w);return S.join(",")};return b(this,Yr,Ih).call(this,m(0,5),m(1,5),m(2,5),g),a.url=b(this,Dn,io).call(this,u),a.url}addAlphaFilter(e){let s=n(this,Wt,de).get(e);if(s)return s;const[i]=b(this,Wo,sf).call(this,[e]),r=`alpha_${i}`;if(s=n(this,Wt,de).get(r),s)return n(this,Wt,de).set(e,s),s;const a=`g_${n(this,Fi)}_alpha_map_${Ht(this,Wr)._++}`,o=b(this,Dn,io).call(this,a);n(this,Wt,de).set(e,o),n(this,Wt,de).set(r,o);const l=b(this,Mn,no).call(this,a);return b(this,Vc,Em).call(this,i,l),o}addLuminosityFilter(e){let s=n(this,Wt,de).get(e||"luminosity");if(s)return s;let i,r;if(e?([i]=b(this,Wo,sf).call(this,[e]),r=`luminosity_${i}`):r="luminosity",s=n(this,Wt,de).get(r),s)return n(this,Wt,de).set(e,s),s;const a=`g_${n(this,Fi)}_luminosity_map_${Ht(this,Wr)._++}`,o=b(this,Dn,io).call(this,a);n(this,Wt,de).set(e,o),n(this,Wt,de).set(r,o);const l=b(this,Mn,no).call(this,a);return b(this,Sp,CA).call(this,l),e&&b(this,Vc,Em).call(this,i,l),o}addHighlightHCMFilter(e,s,i,r,a){var E;const o=`${s}-${i}-${r}-${a}`;let l=n(this,Xr,Mh).get(e);if((l==null?void 0:l.key)===o||(l?((E=l.filter)==null||E.remove(),l.key=o,l.url="none",l.filter=null):(l={key:o,url:"none",filter:null},n(this,Xr,Mh).set(e,l)),!s||!i))return l.url;const[h,c]=[s,i].map(b(this,Kr,Fh).bind(this));let u=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),g=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[m,A]=[r,a].map(b(this,Kr,Fh).bind(this));g<u&&([u,g,m,A]=[g,u,A,m]),n(this,kn,so).style.color="";const y=(S,_,C)=>{const T=new Array(256),x=(g-u)/C,P=S/255,R=(_-S)/(255*C);let D=0;for(let M=0;M<=C;M++){const L=Math.round(u+M*x),j=P+M*R;for(let F=D;F<=L;F++)T[F]=j;D=L+1}for(let M=D;M<256;M++)T[M]=T[D-1];return T.join(",")},v=`g_${n(this,Fi)}_hcm_${e}_filter`,w=l.filter=b(this,Mn,no).call(this,v);return b(this,zc,vm).call(this,w),b(this,Yr,Ih).call(this,y(m[0],A[0],5),y(m[1],A[1],5),y(m[2],A[2],5),w),l.url=b(this,Dn,io).call(this,v),l.url}destroy(e=!1){var s,i,r,a;e&&((s=n(this,Vr))!=null&&s.size)||((i=n(this,Ii))==null||i.parentNode.parentNode.remove(),p(this,Ii,null),(r=n(this,Vo))==null||r.clear(),p(this,Vo,null),(a=n(this,Vr))==null||a.clear(),p(this,Vr,null),p(this,Wr,0))}}zr=new WeakMap,Vo=new WeakMap,Ii=new WeakMap,Fi=new WeakMap,pe=new WeakMap,Vr=new WeakMap,Wr=new WeakMap,Wt=new WeakSet,de=function(){return n(this,Vo)||p(this,Vo,new Map)},Xr=new WeakSet,Mh=function(){return n(this,Vr)||p(this,Vr,new Map)},kn=new WeakSet,so=function(){if(!n(this,Ii)){const e=n(this,pe).createElement("div"),{style:s}=e;s.visibility="hidden",s.contain="strict",s.width=s.height=0,s.position="absolute",s.top=s.left=0,s.zIndex=-1;const i=n(this,pe).createElementNS(bi,"svg");i.setAttribute("width",0),i.setAttribute("height",0),p(this,Ii,n(this,pe).createElementNS(bi,"defs")),e.append(i),i.append(n(this,Ii)),n(this,pe).body.append(e)}return n(this,Ii)},Wo=new WeakSet,sf=function(e){if(e.length===1){const h=e[0],c=new Array(256);for(let g=0;g<256;g++)c[g]=h[g]/255;const u=c.join(",");return[u,u,u]}const[s,i,r]=e,a=new Array(256),o=new Array(256),l=new Array(256);for(let h=0;h<256;h++)a[h]=s[h]/255,o[h]=i[h]/255,l[h]=r[h]/255;return[a.join(","),o.join(","),l.join(",")]},Dn=new WeakSet,io=function(e){if(n(this,zr)===void 0){p(this,zr,"");const s=n(this,pe).URL;s!==n(this,pe).baseURI&&(Lu(s)?V('#createUrl: ignore "data:"-URL for performance reasons.'):p(this,zr,Cb(s,"")))}return`url(${n(this,zr)}#${e})`},Sp=new WeakSet,CA=function(e){const s=n(this,pe).createElementNS(bi,"feColorMatrix");s.setAttribute("type","matrix"),s.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(s)},zc=new WeakSet,vm=function(e){const s=n(this,pe).createElementNS(bi,"feColorMatrix");s.setAttribute("type","matrix"),s.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(s)},Mn=new WeakSet,no=function(e){const s=n(this,pe).createElementNS(bi,"filter");return s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("id",e),n(this,kn,so).append(s),s},qr=new WeakSet,Lh=function(e,s,i){const r=n(this,pe).createElementNS(bi,s);r.setAttribute("type","discrete"),r.setAttribute("tableValues",i),e.append(r)},Yr=new WeakSet,Ih=function(e,s,i,r){const a=n(this,pe).createElementNS(bi,"feComponentTransfer");r.append(a),b(this,qr,Lh).call(this,a,"feFuncR",e),b(this,qr,Lh).call(this,a,"feFuncG",s),b(this,qr,Lh).call(this,a,"feFuncB",i)},Vc=new WeakSet,Em=function(e,s){const i=n(this,pe).createElementNS(bi,"feComponentTransfer");s.append(i),b(this,qr,Lh).call(this,i,"feFuncA",e)},Kr=new WeakSet,Fh=function(e){return n(this,kn,so).style.color=e,wh(getComputedStyle(n(this,kn,so)).getPropertyValue("color"))};class TA{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(s=>{throw new Error(`Unable to load font data at: ${e}`)})}async _fetch(t){ft("Abstract method `_fetch` called.")}}class sy extends TA{async _fetch(t){const e=await Ah(t,"arraybuffer");return new Uint8Array(e)}}class xA{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!t)throw new Error("Wasm filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(s=>{throw new Error(`Unable to load wasm data at: ${e}`)})}async _fetch(t){ft("Abstract method `_fetch` called.")}}class iy extends xA{async _fetch(t){const e=await Ah(t,"arraybuffer");return new Uint8Array(e)}}Te&&V("Please use the `legacy` build in Node.js environments.");async function Db(d){const e=await process.getBuiltinModule("fs").promises.readFile(d);return new Uint8Array(e)}class zv extends _A{}class Vv extends EA{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t,e)}}class Wv extends SA{async _fetch(t){return Db(t)}}class Xv extends TA{async _fetch(t){return Db(t)}}class qv extends xA{async _fetch(t){return Db(t)}}const Za="__forcedDependency",{floor:ny,ceil:ry}=Math;function Gu(d,t,e,s,i,r){d[t*4+0]=Math.min(d[t*4+0],e),d[t*4+1]=Math.min(d[t*4+1],s),d[t*4+2]=Math.max(d[t*4+2],i),d[t*4+3]=Math.max(d[t*4+3],r)}const Sm=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];var Xo,Ln;class Yv{constructor(t,e){f(this,Xo,void 0);f(this,Ln,void 0);p(this,Xo,t),p(this,Ln,e)}get length(){return n(this,Xo).length}isEmpty(t){return n(this,Xo)[t]===Sm}minX(t){return n(this,Ln)[t*4+0]/256}minY(t){return n(this,Ln)[t*4+1]/256}maxX(t){return(n(this,Ln)[t*4+2]+1)/256}maxY(t){return(n(this,Ln)[t*4+3]+1)/256}}Xo=new WeakMap,Ln=new WeakMap;const zu=(d,t)=>{if(!d)return;let e=d.get(t);return e||(e={dependencies:new Set,isRenderingOperation:!1},d.set(t,e)),e};var ke,De,Jr,Rs,Qr,Ni,nt,at,Oi,Me,Wc,qo,Zr,ta,Bi,ge,ei,Xc,_m;class Kv{constructor(t,e,s=!1){f(this,Xc);f(this,ke,{__proto__:null});f(this,De,{__proto__:null,transform:[],moveText:[],sameLineText:[],[Za]:[]});f(this,Jr,new Map);f(this,Rs,[]);f(this,Qr,[]);f(this,Ni,[[1,0,0,1,0,0]]);f(this,nt,[-1/0,-1/0,1/0,1/0]);f(this,at,new Float64Array([1/0,1/0,-1/0,-1/0]));f(this,Oi,-1);f(this,Me,new Set);f(this,Wc,new Map);f(this,qo,new Map);f(this,Zr,void 0);f(this,ta,void 0);f(this,Bi,void 0);f(this,ge,void 0);f(this,ei,void 0);p(this,Zr,t.width),p(this,ta,t.height),b(this,Xc,_m).call(this,e),s&&p(this,ei,new Map)}growOperationsCount(t){t>=n(this,ge).length&&b(this,Xc,_m).call(this,t,n(this,ge))}save(t){return p(this,ke,{__proto__:n(this,ke)}),p(this,De,{__proto__:n(this,De),transform:{__proto__:n(this,De).transform},moveText:{__proto__:n(this,De).moveText},sameLineText:{__proto__:n(this,De).sameLineText},[Za]:{__proto__:n(this,De)[Za]}}),p(this,nt,{__proto__:n(this,nt)}),n(this,Rs).push(t),this}restore(t){var i;const e=Object.getPrototypeOf(n(this,ke));if(e===null)return this;p(this,ke,e),p(this,De,Object.getPrototypeOf(n(this,De))),p(this,nt,Object.getPrototypeOf(n(this,nt)));const s=n(this,Rs).pop();return s!==void 0&&((i=zu(n(this,ei),t))==null||i.dependencies.add(s),n(this,ge)[t]=n(this,ge)[s]),this}recordOpenMarker(t){return n(this,Rs).push(t),this}getOpenMarker(){return n(this,Rs).length===0?null:n(this,Rs).at(-1)}recordCloseMarker(t){var s;const e=n(this,Rs).pop();return e!==void 0&&((s=zu(n(this,ei),t))==null||s.dependencies.add(e),n(this,ge)[t]=n(this,ge)[e]),this}beginMarkedContent(t){return n(this,Qr).push(t),this}endMarkedContent(t){var s;const e=n(this,Qr).pop();return e!==void 0&&((s=zu(n(this,ei),t))==null||s.dependencies.add(e),n(this,ge)[t]=n(this,ge)[e]),this}pushBaseTransform(t){return n(this,Ni).push(O.multiplyByDOMMatrix(n(this,Ni).at(-1),t.getTransform())),this}popBaseTransform(){return n(this,Ni).length>1&&n(this,Ni).pop(),this}recordSimpleData(t,e){return n(this,ke)[t]=e,this}recordIncrementalData(t,e){return n(this,De)[t].push(e),this}resetIncrementalData(t,e){return n(this,De)[t].length=0,this}recordNamedData(t,e){return n(this,Jr).set(t,e),this}recordSimpleDataFromNamed(t,e,s){n(this,ke)[t]=n(this,Jr).get(e)??s}recordFutureForcedDependency(t,e){return this.recordIncrementalData(Za,e),this}inheritSimpleDataAsFutureForcedDependencies(t){for(const e of t)e in n(this,ke)&&this.recordFutureForcedDependency(e,n(this,ke)[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of n(this,Me))this.recordFutureForcedDependency(Za,t);return this}resetBBox(t){return n(this,Oi)!==t&&(p(this,Oi,t),n(this,at)[0]=1/0,n(this,at)[1]=1/0,n(this,at)[2]=-1/0,n(this,at)[3]=-1/0),this}recordClipBox(t,e,s,i,r,a){const o=O.multiplyByDOMMatrix(n(this,Ni).at(-1),e.getTransform()),l=[1/0,1/0,-1/0,-1/0];O.axialAlignedBoundingBox([s,r,i,a],o,l);const h=O.intersect(n(this,nt),l);return h?(n(this,nt)[0]=h[0],n(this,nt)[1]=h[1],n(this,nt)[2]=h[2],n(this,nt)[3]=h[3]):(n(this,nt)[0]=n(this,nt)[1]=1/0,n(this,nt)[2]=n(this,nt)[3]=-1/0),this}recordBBox(t,e,s,i,r,a){const o=n(this,nt);if(o[0]===1/0)return this;const l=O.multiplyByDOMMatrix(n(this,Ni).at(-1),e.getTransform());if(o[0]===-1/0)return O.axialAlignedBoundingBox([s,r,i,a],l,n(this,at)),this;const h=[1/0,1/0,-1/0,-1/0];return O.axialAlignedBoundingBox([s,r,i,a],l,h),n(this,at)[0]=Math.min(n(this,at)[0],Math.max(h[0],o[0])),n(this,at)[1]=Math.min(n(this,at)[1],Math.max(h[1],o[1])),n(this,at)[2]=Math.max(n(this,at)[2],Math.min(h[2],o[2])),n(this,at)[3]=Math.max(n(this,at)[3],Math.min(h[3],o[3])),this}recordCharacterBBox(t,e,s,i=1,r=0,a=0,o){const l=s.bbox;let h,c;if(l&&(h=l[2]!==l[0]&&l[3]!==l[1]&&n(this,qo).get(s),h!==!1&&(c=[0,0,0,0],O.axialAlignedBoundingBox(l,s.fontMatrix,c),(i!==1||r!==0||a!==0)&&O.scaleMinMax([i,0,0,-i,r,a],c),h)))return this.recordBBox(t,e,c[0],c[2],c[1],c[3]);if(!o)return this.recordFullPageBBox(t);const u=o();return l&&c&&h===void 0&&(h=c[0]<=r-u.actualBoundingBoxLeft&&c[2]>=r+u.actualBoundingBoxRight&&c[1]<=a-u.actualBoundingBoxAscent&&c[3]>=a+u.actualBoundingBoxDescent,n(this,qo).set(s,h),h)?this.recordBBox(t,e,c[0],c[2],c[1],c[3]):this.recordBBox(t,e,r-u.actualBoundingBoxLeft,r+u.actualBoundingBoxRight,a-u.actualBoundingBoxAscent,a+u.actualBoundingBoxDescent)}recordFullPageBBox(t){return n(this,at)[0]=Math.max(0,n(this,nt)[0]),n(this,at)[1]=Math.max(0,n(this,nt)[1]),n(this,at)[2]=Math.min(n(this,Zr),n(this,nt)[2]),n(this,at)[3]=Math.min(n(this,ta),n(this,nt)[3]),this}getSimpleIndex(t){return n(this,ke)[t]}recordDependencies(t,e){const s=n(this,Me),i=n(this,ke),r=n(this,De);for(const a of e)a in n(this,ke)?s.add(i[a]):a in r&&r[a].forEach(s.add,s);return this}recordNamedDependency(t,e){return n(this,Jr).has(e)&&n(this,Me).add(n(this,Jr).get(e)),this}recordOperation(t,e=!1){if(this.recordDependencies(t,[Za]),n(this,ei)){const s=zu(n(this,ei),t),{dependencies:i}=s;n(this,Me).forEach(i.add,i),n(this,Rs).forEach(i.add,i),n(this,Qr).forEach(i.add,i),i.delete(t),s.isRenderingOperation=!0}if(n(this,Oi)===t){const s=ny(n(this,at)[0]*256/n(this,Zr)),i=ny(n(this,at)[1]*256/n(this,ta)),r=ry(n(this,at)[2]*256/n(this,Zr)),a=ry(n(this,at)[3]*256/n(this,ta));Gu(n(this,Bi),t,s,i,r,a);for(const o of n(this,Me))o!==t&&Gu(n(this,Bi),o,s,i,r,a);for(const o of n(this,Rs))o!==t&&Gu(n(this,Bi),o,s,i,r,a);for(const o of n(this,Qr))o!==t&&Gu(n(this,Bi),o,s,i,r,a);e||(n(this,Me).clear(),p(this,Oi,-1))}return this}recordShowTextOperation(t,e=!1){const s=Array.from(n(this,Me));this.recordOperation(t,e),this.recordIncrementalData("sameLineText",t);for(const i of s)this.recordIncrementalData("sameLineText",i);return this}bboxToClipBoxDropOperation(t,e=!1){return n(this,Oi)===t&&(p(this,Oi,-1),n(this,nt)[0]=Math.max(n(this,nt)[0],n(this,at)[0]),n(this,nt)[1]=Math.max(n(this,nt)[1],n(this,at)[1]),n(this,nt)[2]=Math.min(n(this,nt)[2],n(this,at)[2]),n(this,nt)[3]=Math.min(n(this,nt)[3],n(this,at)[3]),e||n(this,Me).clear()),this}_takePendingDependencies(){const t=n(this,Me);return p(this,Me,new Set),t}_extractOperation(t){const e=n(this,Wc).get(t);return n(this,Wc).delete(t),e}_pushPendingDependencies(t){for(const e of t)n(this,Me).add(e)}take(){return n(this,qo).clear(),new Yv(n(this,ge),n(this,Bi))}takeDebugMetadata(){return n(this,ei)}}ke=new WeakMap,De=new WeakMap,Jr=new WeakMap,Rs=new WeakMap,Qr=new WeakMap,Ni=new WeakMap,nt=new WeakMap,at=new WeakMap,Oi=new WeakMap,Me=new WeakMap,Wc=new WeakMap,qo=new WeakMap,Zr=new WeakMap,ta=new WeakMap,Bi=new WeakMap,ge=new WeakMap,ei=new WeakMap,Xc=new WeakSet,_m=function(t,e){const s=new ArrayBuffer(t*4);p(this,Bi,new Uint8ClampedArray(s)),p(this,ge,new Uint32Array(s)),e&&e.length>0?(n(this,ge).set(e),n(this,ge).fill(Sm,e.length)):n(this,ge).fill(Sm)};var dt,Rt,ks,Yo,Ko;const jb=class jb{constructor(t,e,s){f(this,dt,void 0);f(this,Rt,void 0);f(this,ks,void 0);f(this,Yo,0);f(this,Ko,0);if(t instanceof jb&&n(t,ks)===!!s)return t;p(this,dt,t),p(this,Rt,e),p(this,ks,!!s)}growOperationsCount(){throw new Error("Unreachable")}save(t){return Ht(this,Ko)._++,n(this,dt).save(n(this,Rt)),this}restore(t){return n(this,Ko)>0&&(n(this,dt).restore(n(this,Rt)),Ht(this,Ko)._--),this}recordOpenMarker(t){return Ht(this,Yo)._++,this}getOpenMarker(){return n(this,Yo)>0?n(this,Rt):n(this,dt).getOpenMarker()}recordCloseMarker(t){return Ht(this,Yo)._--,this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return n(this,dt).pushBaseTransform(t),this}popBaseTransform(){return n(this,dt).popBaseTransform(),this}recordSimpleData(t,e){return n(this,dt).recordSimpleData(t,n(this,Rt)),this}recordIncrementalData(t,e){return n(this,dt).recordIncrementalData(t,n(this,Rt)),this}resetIncrementalData(t,e){return n(this,dt).resetIncrementalData(t,n(this,Rt)),this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,s){return n(this,dt).recordSimpleDataFromNamed(t,e,n(this,Rt)),this}recordFutureForcedDependency(t,e){return n(this,dt).recordFutureForcedDependency(t,n(this,Rt)),this}inheritSimpleDataAsFutureForcedDependencies(t){return n(this,dt).inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return n(this,dt).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return n(this,ks)||n(this,dt).resetBBox(n(this,Rt)),this}recordClipBox(t,e,s,i,r,a){return n(this,ks)||n(this,dt).recordClipBox(n(this,Rt),e,s,i,r,a),this}recordBBox(t,e,s,i,r,a){return n(this,ks)||n(this,dt).recordBBox(n(this,Rt),e,s,i,r,a),this}recordCharacterBBox(t,e,s,i,r,a,o){return n(this,ks)||n(this,dt).recordCharacterBBox(n(this,Rt),e,s,i,r,a,o),this}recordFullPageBBox(t){return n(this,ks)||n(this,dt).recordFullPageBBox(n(this,Rt)),this}getSimpleIndex(t){return n(this,dt).getSimpleIndex(t)}recordDependencies(t,e){return n(this,dt).recordDependencies(n(this,Rt),e),this}recordNamedDependency(t,e){return n(this,dt).recordNamedDependency(n(this,Rt),e),this}recordOperation(t){return n(this,dt).recordOperation(n(this,Rt),!0),this}recordShowTextOperation(t){return n(this,dt).recordShowTextOperation(n(this,Rt),!0),this}bboxToClipBoxDropOperation(t){return n(this,ks)||n(this,dt).bboxToClipBoxDropOperation(n(this,Rt),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}};dt=new WeakMap,Rt=new WeakMap,ks=new WeakMap,Yo=new WeakMap,Ko=new WeakMap;let Df=jb;const ls={stroke:["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],fill:["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],imageXObject:["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],rawFillPath:["filter","fillColor","fillAlpha"],showText:["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],transform:["transform"],transformAndFill:["transform","fillColor"]},le={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function Cm(d,t){if(!t)return;const e=t[2]-t[0],s=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],e,s),d.clip(i)}class Mb{isModifyingCurrentTransform(){return!1}getPattern(){ft("Abstract method `getPattern` called.")}}class Jv extends Mb{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;this._type==="axial"?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const s of this._colorStops)e.addColorStop(s[0],s[1]);return e}getPattern(t,e,s,i){let r;if(i===le.STROKE||i===le.FILL){const a=e.current.getClippedPathBoundingBox(i,Ct(t))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,l=Math.ceil(a[3]-a[1])||1,h=e.cachedCanvases.getCanvas("pattern",o,l),c=h.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(-a[0],-a[1]),s=O.transform(s,[1,0,0,1,a[0],a[1]]),c.transform(...e.baseTransform),this.matrix&&c.transform(...this.matrix),Cm(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),r=t.createPattern(h.canvas,"no-repeat");const u=new DOMMatrix(s);r.setTransform(u)}else Cm(t,this._bbox),r=this._createGradient(t);return r}}function Xg(d,t,e,s,i,r,a,o){const l=t.coords,h=t.colors,c=d.data,u=d.width*4;let g;l[e+1]>l[s+1]&&(g=e,e=s,s=g,g=r,r=a,a=g),l[s+1]>l[i+1]&&(g=s,s=i,i=g,g=a,a=o,o=g),l[e+1]>l[s+1]&&(g=e,e=s,s=g,g=r,r=a,a=g);const m=(l[e]+t.offsetX)*t.scaleX,A=(l[e+1]+t.offsetY)*t.scaleY,y=(l[s]+t.offsetX)*t.scaleX,v=(l[s+1]+t.offsetY)*t.scaleY,w=(l[i]+t.offsetX)*t.scaleX,E=(l[i+1]+t.offsetY)*t.scaleY;if(A>=E)return;const S=h[r],_=h[r+1],C=h[r+2],T=h[a],x=h[a+1],P=h[a+2],R=h[o],D=h[o+1],M=h[o+2],L=Math.round(A),j=Math.round(E);let F,G,N,I,Y,Q,Gt,Oe;for(let tt=L;tt<=j;tt++){if(tt<v){const ht=tt<A?0:(A-tt)/(A-v);F=m-(m-y)*ht,G=S-(S-T)*ht,N=_-(_-x)*ht,I=C-(C-P)*ht}else{let ht;tt>E?ht=1:v===E?ht=0:ht=(v-tt)/(v-E),F=y-(y-w)*ht,G=T-(T-R)*ht,N=x-(x-D)*ht,I=P-(P-M)*ht}let st;tt<A?st=0:tt>E?st=1:st=(A-tt)/(A-E),Y=m-(m-w)*st,Q=S-(S-R)*st,Gt=_-(_-D)*st,Oe=C-(C-M)*st;const zt=Math.round(Math.min(F,Y)),te=Math.round(Math.max(F,Y));let he=u*tt+zt*4;for(let ht=zt;ht<=te;ht++)st=(F-ht)/(F-Y),st<0?st=0:st>1&&(st=1),c[he++]=G-(G-Q)*st|0,c[he++]=N-(N-Gt)*st|0,c[he++]=I-(I-Oe)*st|0,c[he++]=255}}function Qv(d,t,e){const s=t.coords,i=t.colors;let r,a;switch(t.type){case"lattice":const o=t.verticesPerRow,l=Math.floor(s.length/o)-1,h=o-1;for(r=0;r<l;r++){let c=r*o;for(let u=0;u<h;u++,c++)Xg(d,e,s[c],s[c+1],s[c+o],i[c],i[c+1],i[c+o]),Xg(d,e,s[c+o+1],s[c+1],s[c+o],i[c+o+1],i[c+1],i[c+o])}break;case"triangles":for(r=0,a=s.length;r<a;r+=3)Xg(d,e,s[r],s[r+1],s[r+2],i[r],i[r+1],i[r+2]);break;default:throw new Error("illegal figure")}}class Zv extends Mb{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null}_createMeshCanvas(t,e,s){const o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),h=Math.ceil(this._bounds[2])-o,c=Math.ceil(this._bounds[3])-l,u=Math.min(Math.ceil(Math.abs(h*t[0]*1.1)),3e3),g=Math.min(Math.ceil(Math.abs(c*t[1]*1.1)),3e3),m=h/u,A=c/g,y={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-l,scaleX:1/m,scaleY:1/A},v=u+2*2,w=g+2*2,E=s.getCanvas("mesh",v,w),S=E.context,_=S.createImageData(u,g);if(e){const T=_.data;for(let x=0,P=T.length;x<P;x+=4)T[x]=e[0],T[x+1]=e[1],T[x+2]=e[2],T[x+3]=255}for(const T of this._figures)Qv(_,T,y);return S.putImageData(_,2,2),{canvas:E.canvas,offsetX:o-2*m,offsetY:l-2*A,scaleX:m,scaleY:A}}isModifyingCurrentTransform(){return!0}getPattern(t,e,s,i){Cm(t,this._bbox);const r=new Float32Array(2);if(i===le.SHADING)O.singularValueDecompose2dScale(Ct(t),r);else if(this.matrix){O.singularValueDecompose2dScale(this.matrix,r);const[o,l]=r;O.singularValueDecompose2dScale(e.baseTransform,r),r[0]*=o,r[1]*=l}else O.singularValueDecompose2dScale(e.baseTransform,r);const a=this._createMeshCanvas(r,i===le.SHADING?null:this._background,e.cachedCanvases);return i!==le.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(a.offsetX,a.offsetY),t.scale(a.scaleX,a.scaleY),t.createPattern(a.canvas,"no-repeat")}}class t0 extends Mb{getPattern(){return"hotpink"}}function e0(d){switch(d[0]){case"RadialAxial":return new Jv(d);case"Mesh":return new Zv(d);case"Dummy":return new t0}throw new Error(`Unknown IR type: ${d[0]}`)}const ay={COLORED:1,UNCOLORED:2},_p=class _p{constructor(t,e,s,i){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=e,this.canvasGraphicsFactory=s,this.baseTransform=i}createPatternCanvas(t,e){var Q,Gt;const{bbox:s,operatorList:i,paintType:r,tilingType:a,color:o,canvasGraphicsFactory:l}=this;let{xstep:h,ystep:c}=this;h=Math.abs(h),c=Math.abs(c),Dg("TilingType: "+a);const u=s[0],g=s[1],m=s[2],A=s[3],y=m-u,v=A-g,w=new Float32Array(2);O.singularValueDecompose2dScale(this.matrix,w);const[E,S]=w;O.singularValueDecompose2dScale(this.baseTransform,w);const _=E*w[0],C=S*w[1];let T=y,x=v,P=!1,R=!1;const D=Math.ceil(h*_),M=Math.ceil(c*C),L=Math.ceil(y*_),j=Math.ceil(v*C);D>=L?T=h:P=!0,M>=j?x=c:R=!0;const F=this.getSizeAndScale(T,this.ctx.canvas.width,_),G=this.getSizeAndScale(x,this.ctx.canvas.height,C),N=t.cachedCanvases.getCanvas("pattern",F.size,G.size),I=N.context,Y=l.createCanvasGraphics(I,e);if(Y.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(Y,r,o),I.translate(-F.scale*u,-G.scale*g),Y.transform(0,F.scale,0,0,G.scale,0,0),I.save(),(Q=Y.dependencyTracker)==null||Q.save(),this.clipBbox(Y,u,g,m,A),Y.baseTransform=Ct(Y.ctx),Y.executeOperatorList(i),Y.endDrawing(),(Gt=Y.dependencyTracker)==null||Gt.restore(),I.restore(),P||R){const Oe=N.canvas;P&&(T=h),R&&(x=c);const tt=this.getSizeAndScale(T,this.ctx.canvas.width,_),st=this.getSizeAndScale(x,this.ctx.canvas.height,C),zt=tt.size,te=st.size,he=t.cachedCanvases.getCanvas("pattern-workaround",zt,te),ht=he.context,vs=P?Math.floor(y/h):0,$s=R?Math.floor(v/c):0;for(let mi=0;mi<=vs;mi++)for(let we=0;we<=$s;we++)ht.drawImage(Oe,zt*mi,te*we,zt,te,0,0,zt,te);return{canvas:he.canvas,scaleX:tt.scale,scaleY:st.scale,offsetX:u,offsetY:g}}return{canvas:N.canvas,scaleX:F.scale,scaleY:G.scale,offsetX:u,offsetY:g}}getSizeAndScale(t,e,s){const i=Math.max(_p.MAX_PATTERN_SIZE,e);let r=Math.ceil(t*s);return r>=i?r=i:s=r/t,{scale:s,size:r}}clipBbox(t,e,s,i,r){const a=i-e,o=r-s;t.ctx.rect(e,s,a,o),O.axialAlignedBoundingBox([e,s,i,r],Ct(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,s){const i=t.ctx,r=t.current;switch(e){case ay.COLORED:const{fillStyle:a,strokeStyle:o}=this.ctx;i.fillStyle=r.fillColor=a,i.strokeStyle=r.strokeColor=o;break;case ay.UNCOLORED:i.fillStyle=i.strokeStyle=s,r.fillColor=r.strokeColor=s;break;default:throw new Ev(`Unsupported paint type: ${e}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,e,s,i,r){let a=s;i!==le.SHADING&&(a=O.transform(a,e.baseTransform),this.matrix&&(a=O.transform(a,this.matrix)));const o=this.createPatternCanvas(e,r);let l=new DOMMatrix(a);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const h=t.createPattern(o.canvas,"repeat");return h.setTransform(l),h}};k(_p,"MAX_PATTERN_SIZE",3e3);let Tm=_p;function s0({src:d,srcPos:t=0,dest:e,width:s,height:i,nonBlackColor:r=4294967295,inverseDecode:a=!1}){const o=Zt.isLittleEndian?4278190080:255,[l,h]=a?[r,o]:[o,r],c=s>>3,u=s&7,g=d.length;e=new Uint32Array(e.buffer);let m=0;for(let A=0;A<i;A++){for(const v=t+c;t<v;t++){const w=t<g?d[t]:255;e[m++]=w&128?h:l,e[m++]=w&64?h:l,e[m++]=w&32?h:l,e[m++]=w&16?h:l,e[m++]=w&8?h:l,e[m++]=w&4?h:l,e[m++]=w&2?h:l,e[m++]=w&1?h:l}if(u===0)continue;const y=t<g?d[t++]:255;for(let v=0;v<u;v++)e[m++]=y&1<<7-v?h:l}return{srcPos:t,destPos:m}}const oy=16,ly=100,i0=15,hy=10,Ne=16,qg=new DOMMatrix,rs=new Float32Array(2),lo=new Float32Array([1/0,1/0,-1/0,-1/0]);function n0(d,t){if(d._removeMirroring)throw new Error("Context is already forwarding operations.");d.__originalSave=d.save,d.__originalRestore=d.restore,d.__originalRotate=d.rotate,d.__originalScale=d.scale,d.__originalTranslate=d.translate,d.__originalTransform=d.transform,d.__originalSetTransform=d.setTransform,d.__originalResetTransform=d.resetTransform,d.__originalClip=d.clip,d.__originalMoveTo=d.moveTo,d.__originalLineTo=d.lineTo,d.__originalBezierCurveTo=d.bezierCurveTo,d.__originalRect=d.rect,d.__originalClosePath=d.closePath,d.__originalBeginPath=d.beginPath,d._removeMirroring=()=>{d.save=d.__originalSave,d.restore=d.__originalRestore,d.rotate=d.__originalRotate,d.scale=d.__originalScale,d.translate=d.__originalTranslate,d.transform=d.__originalTransform,d.setTransform=d.__originalSetTransform,d.resetTransform=d.__originalResetTransform,d.clip=d.__originalClip,d.moveTo=d.__originalMoveTo,d.lineTo=d.__originalLineTo,d.bezierCurveTo=d.__originalBezierCurveTo,d.rect=d.__originalRect,d.closePath=d.__originalClosePath,d.beginPath=d.__originalBeginPath,delete d._removeMirroring},d.save=function(){t.save(),this.__originalSave()},d.restore=function(){t.restore(),this.__originalRestore()},d.translate=function(e,s){t.translate(e,s),this.__originalTranslate(e,s)},d.scale=function(e,s){t.scale(e,s),this.__originalScale(e,s)},d.transform=function(e,s,i,r,a,o){t.transform(e,s,i,r,a,o),this.__originalTransform(e,s,i,r,a,o)},d.setTransform=function(e,s,i,r,a,o){t.setTransform(e,s,i,r,a,o),this.__originalSetTransform(e,s,i,r,a,o)},d.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},d.rotate=function(e){t.rotate(e),this.__originalRotate(e)},d.clip=function(e){t.clip(e),this.__originalClip(e)},d.moveTo=function(e,s){t.moveTo(e,s),this.__originalMoveTo(e,s)},d.lineTo=function(e,s){t.lineTo(e,s),this.__originalLineTo(e,s)},d.bezierCurveTo=function(e,s,i,r,a,o){t.bezierCurveTo(e,s,i,r,a,o),this.__originalBezierCurveTo(e,s,i,r,a,o)},d.rect=function(e,s,i,r){t.rect(e,s,i,r),this.__originalRect(e,s,i,r)},d.closePath=function(){t.closePath(),this.__originalClosePath()},d.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class r0{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,s){let i;return this.cache[t]!==void 0?(i=this.cache[t],this.canvasFactory.reset(i,e,s)):(i=this.canvasFactory.create(e,s),this.cache[t]=i),i}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function Vu(d,t,e,s,i,r,a,o,l,h){const[c,u,g,m,A,y]=Ct(d);if(u===0&&g===0){const E=a*c+A,S=Math.round(E),_=o*m+y,C=Math.round(_),T=(a+l)*c+A,x=Math.abs(Math.round(T)-S)||1,P=(o+h)*m+y,R=Math.abs(Math.round(P)-C)||1;return d.setTransform(Math.sign(c),0,0,Math.sign(m),S,C),d.drawImage(t,e,s,i,r,0,0,x,R),d.setTransform(c,u,g,m,A,y),[x,R]}if(c===0&&m===0){const E=o*g+A,S=Math.round(E),_=a*u+y,C=Math.round(_),T=(o+h)*g+A,x=Math.abs(Math.round(T)-S)||1,P=(a+l)*u+y,R=Math.abs(Math.round(P)-C)||1;return d.setTransform(0,Math.sign(u),Math.sign(g),0,S,C),d.drawImage(t,e,s,i,r,0,0,R,x),d.setTransform(c,u,g,m,A,y),[R,x]}d.drawImage(t,e,s,i,r,a,o,l,h);const v=Math.hypot(c,u),w=Math.hypot(g,m);return[v*l,w*h]}class cy{constructor(t,e,s){k(this,"alphaIsShape",!1);k(this,"fontSize",0);k(this,"fontSizeScale",1);k(this,"textMatrix",null);k(this,"textMatrixScale",1);k(this,"fontMatrix",Qg);k(this,"leading",0);k(this,"x",0);k(this,"y",0);k(this,"lineX",0);k(this,"lineY",0);k(this,"charSpacing",0);k(this,"wordSpacing",0);k(this,"textHScale",1);k(this,"textRenderingMode",ee.FILL);k(this,"textRise",0);k(this,"fillColor","#000000");k(this,"strokeColor","#000000");k(this,"patternFill",!1);k(this,"patternStroke",!1);k(this,"fillAlpha",1);k(this,"strokeAlpha",1);k(this,"lineWidth",1);k(this,"activeSMask",null);k(this,"transferMaps","none");s==null||s(this),this.clipBox=new Float32Array([0,0,t,e]),this.minMax=lo.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=le.FILL,e=null){const s=this.minMax.slice();if(t===le.STROKE){e||ft("Stroke bounding box must include transform."),O.singularValueDecompose2dScale(e,rs);const i=rs[0]*this.lineWidth/2,r=rs[1]*this.lineWidth/2;s[0]-=i,s[1]-=r,s[2]+=i,s[3]+=r}return s}updateClipFromPath(){const t=O.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(lo,0)}getClippedPathBoundingBox(t=le.FILL,e=null){return O.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function dy(d,t){if(t instanceof ImageData){d.putImageData(t,0,0);return}const e=t.height,s=t.width,i=e%Ne,r=(e-i)/Ne,a=i===0?r:r+1,o=d.createImageData(s,Ne);let l=0,h;const c=t.data,u=o.data;let g,m,A,y;if(t.kind===Wh.GRAYSCALE_1BPP){const v=c.byteLength,w=new Uint32Array(u.buffer,0,u.byteLength>>2),E=w.length,S=s+7>>3,_=4294967295,C=Zt.isLittleEndian?4278190080:255;for(g=0;g<a;g++){for(A=g<r?Ne:i,h=0,m=0;m<A;m++){const T=v-l;let x=0;const P=T>S?s:T*8-7,R=P&-8;let D=0,M=0;for(;x<R;x+=8)M=c[l++],w[h++]=M&128?_:C,w[h++]=M&64?_:C,w[h++]=M&32?_:C,w[h++]=M&16?_:C,w[h++]=M&8?_:C,w[h++]=M&4?_:C,w[h++]=M&2?_:C,w[h++]=M&1?_:C;for(;x<P;x++)D===0&&(M=c[l++],D=128),w[h++]=M&D?_:C,D>>=1}for(;h<E;)w[h++]=0;d.putImageData(o,0,g*Ne)}}else if(t.kind===Wh.RGBA_32BPP){for(m=0,y=s*Ne*4,g=0;g<r;g++)u.set(c.subarray(l,l+y)),l+=y,d.putImageData(o,0,m),m+=Ne;g<a&&(y=s*i*4,u.set(c.subarray(l,l+y)),d.putImageData(o,0,m))}else if(t.kind===Wh.RGB_24BPP)for(A=Ne,y=s*A,g=0;g<a;g++){for(g>=r&&(A=i,y=s*A),h=0,m=y;m--;)u[h++]=c[l++],u[h++]=c[l++],u[h++]=c[l++],u[h++]=255;d.putImageData(o,0,g*Ne)}else throw new Error(`bad image kind: ${t.kind}`)}function uy(d,t){if(t.bitmap){d.drawImage(t.bitmap,0,0);return}const e=t.height,s=t.width,i=e%Ne,r=(e-i)/Ne,a=i===0?r:r+1,o=d.createImageData(s,Ne);let l=0;const h=t.data,c=o.data;for(let u=0;u<a;u++){const g=u<r?Ne:i;({srcPos:l}=s0({src:h,srcPos:l,dest:c,width:s,height:g,nonBlackColor:0})),d.putImageData(o,0,u*Ne)}}function vh(d,t){const e=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const s of e)d[s]!==void 0&&(t[s]=d[s]);d.setLineDash!==void 0&&(t.setLineDash(d.getLineDash()),t.lineDashOffset=d.lineDashOffset)}function Wu(d){d.strokeStyle=d.fillStyle="#000000",d.fillRule="nonzero",d.globalAlpha=1,d.lineWidth=1,d.lineCap="butt",d.lineJoin="miter",d.miterLimit=10,d.globalCompositeOperation="source-over",d.font="10px sans-serif",d.setLineDash!==void 0&&(d.setLineDash([]),d.lineDashOffset=0);const{filter:t}=d;t!=="none"&&t!==""&&(d.filter="none")}function fy(d,t){if(t)return!0;O.singularValueDecompose2dScale(d,rs);const e=Math.fround(Us.pixelRatio*on.PDF_TO_CSS_UNITS);return rs[0]<=e&&rs[1]<=e}const a0=["butt","round","square"],o0=["miter","round","bevel"],l0={},py={};var qc,xm,Yc,Pm,Kc,Rm;const Gb=class Gb{constructor(t,e,s,i,r,{optionalContentConfig:a,markedContentStack:o=null},l,h,c){f(this,qc);f(this,Yc);f(this,Kc);this.ctx=t,this.current=new cy(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=s,this.canvasFactory=i,this.filterFactory=r,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=o||[],this.optionalContentConfig=a,this.cachedCanvases=new r0(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=h,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=c??null}getObject(t,e,s=null){var i;return typeof e=="string"?((i=this.dependencyTracker)==null||i.recordNamedDependency(t,e),e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e)):s}beginDrawing({transform:t,viewport:e,transparency:s=!1,background:i=null}){const r=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,r,a),this.ctx.fillStyle=o,s){const l=this.cachedCanvases.getCanvas("transparent",r,a);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...Ct(this.compositeCtx))}this.ctx.save(),Wu(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=Ct(this.ctx)}executeOperatorList(t,e,s,i,r){var w;const a=t.argsArray,o=t.fnArray;let l=e||0;const h=a.length;if(h===l)return l;const c=h-l>hy&&typeof s=="function",u=c?Date.now()+i0:0;let g=0;const m=this.commonObjs,A=this.objs;let y,v;for(;;){if(i!==void 0&&l===i.nextBreakPoint)return i.breakIt(l,s),l;if(!r||r(l))if(y=o[l],v=a[l]??null,y!==mh.dependency)v===null?this[y](l):this[y](l,...v);else for(const E of v){(w=this.dependencyTracker)==null||w.recordNamedData(E,l);const S=E.startsWith("g_")?m:A;if(!S.has(E))return S.get(E,s),l}if(l++,l===h)return l;if(c&&++g>hy){if(Date.now()>u)return s(),l;g=0}}}endDrawing(){b(this,qc,xm).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),b(this,Yc,Pm).call(this)}_scaleImage(t,e){const s=t.width??t.displayWidth,i=t.height??t.displayHeight;let r=Math.max(Math.hypot(e[0],e[1]),1),a=Math.max(Math.hypot(e[2],e[3]),1),o=s,l=i,h="prescale1",c,u;for(;r>2&&o>1||a>2&&l>1;){let g=o,m=l;r>2&&o>1&&(g=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),r/=o/g),a>2&&l>1&&(m=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,a/=l/m),c=this.cachedCanvases.getCanvas(h,g,m),u=c.context,u.clearRect(0,0,g,m),u.drawImage(t,0,0,o,l,0,0,g,m),t=c.canvas,o=g,l=m,h=h==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:o,paintHeight:l}}_createMaskCanvas(t,e){var D,M;const s=this.ctx,{width:i,height:r}=e,a=this.current.fillColor,o=this.current.patternFill,l=Ct(s);let h,c,u,g;if((e.bitmap||e.data)&&e.count>1){const L=e.bitmap||e.data.buffer;c=JSON.stringify(o?l:[l.slice(0,4),a]),h=this._cachedBitmapsMap.get(L),h||(h=new Map,this._cachedBitmapsMap.set(L,h));const j=h.get(c);if(j&&!o){const F=Math.round(Math.min(l[0],l[2])+l[4]),G=Math.round(Math.min(l[1],l[3])+l[5]);return(D=this.dependencyTracker)==null||D.recordDependencies(t,ls.transformAndFill),{canvas:j,offsetX:F,offsetY:G}}u=j}u||(g=this.cachedCanvases.getCanvas("maskCanvas",i,r),uy(g.context,e));let m=O.transform(l,[1/i,0,0,-1/r,0,0]);m=O.transform(m,[1,0,0,1,0,-r]);const A=lo.slice();O.axialAlignedBoundingBox([0,0,i,r],m,A);const[y,v,w,E]=A,S=Math.round(w-y)||1,_=Math.round(E-v)||1,C=this.cachedCanvases.getCanvas("fillCanvas",S,_),T=C.context,x=y,P=v;T.translate(-x,-P),T.transform(...m),u||(u=this._scaleImage(g.canvas,js(T)),u=u.img,h&&o&&h.set(c,u)),T.imageSmoothingEnabled=fy(Ct(T),e.interpolate),Vu(T,u,0,0,u.width,u.height,0,0,i,r),T.globalCompositeOperation="source-in";const R=O.transform(js(T),[1,0,0,1,-x,-P]);return T.fillStyle=o?a.getPattern(s,this,R,le.FILL,t):a,T.fillRect(0,0,i,r),h&&!o&&(this.cachedCanvases.delete("fillCanvas"),h.set(c,C.canvas)),(M=this.dependencyTracker)==null||M.recordDependencies(t,ls.transformAndFill),{canvas:C.canvas,offsetX:Math.round(x),offsetY:Math.round(P)}}setLineWidth(t,e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("lineWidth",t),e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(t,e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("lineCap",t),this.ctx.lineCap=a0[e]}setLineJoin(t,e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("lineJoin",t),this.ctx.lineJoin=o0[e]}setMiterLimit(t,e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("miterLimit",t),this.ctx.miterLimit=e}setDash(t,e,s){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("dash",t);const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(e),i.lineDashOffset=s)}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){var s,i,r,a,o;for(const[l,h]of e)switch(l){case"LW":this.setLineWidth(t,h);break;case"LC":this.setLineCap(t,h);break;case"LJ":this.setLineJoin(t,h);break;case"ML":this.setMiterLimit(t,h);break;case"D":this.setDash(t,h[0],h[1]);break;case"RI":this.setRenderingIntent(t,h);break;case"FL":this.setFlatness(t,h);break;case"Font":this.setFont(t,h[0],h[1]);break;case"CA":(s=this.dependencyTracker)==null||s.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=h;break;case"ca":(i=this.dependencyTracker)==null||i.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=h;break;case"BM":(r=this.dependencyTracker)==null||r.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=h;break;case"SMask":(a=this.dependencyTracker)==null||a.recordSimpleData("SMask",t),this.current.activeSMask=h?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":(o=this.dependencyTracker)==null||o.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(h);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(t){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,s=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(i,e,s);this.suspendedCtx=this.ctx;const a=this.ctx=r.context;a.setTransform(this.suspendedCtx.getTransform()),vh(this.suspendedCtx,a),n0(a,this.suspendedCtx),this.setGState(t,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),vh(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,s=this.suspendedCtx;this.composeSMask(s,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,e,s,i){const r=i[0],a=i[1],o=i[2]-r,l=i[3]-a;o===0||l===0||(this.genericComposeSMask(e.context,s,o,l,e.subtype,e.backdrop,e.transferMap,r,a,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(s.canvas,0,0),t.restore())}genericComposeSMask(t,e,s,i,r,a,o,l,h,c,u){let g=t.canvas,m=l-c,A=h-u;if(a)if(m<0||A<0||m+s>g.width||A+i>g.height){const v=this.cachedCanvases.getCanvas("maskExtension",s,i),w=v.context;w.drawImage(g,-m,-A),w.globalCompositeOperation="destination-atop",w.fillStyle=a,w.fillRect(0,0,s,i),w.globalCompositeOperation="source-over",g=v.canvas,m=A=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const v=new Path2D;v.rect(m,A,s,i),t.clip(v),t.globalCompositeOperation="destination-atop",t.fillStyle=a,t.fillRect(m,A,s,i),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),r==="Alpha"&&o?e.filter=this.filterFactory.addAlphaFilter(o):r==="Luminosity"&&(e.filter=this.filterFactory.addLuminosityFilter(o));const y=new Path2D;y.rect(l,h,s,i),e.clip(y),e.globalCompositeOperation="destination-in",e.drawImage(g,m,A,s,i,l,h,s,i),e.restore()}save(t){var s;this.inSMaskMode&&vh(this.ctx,this.suspendedCtx),this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone(),(s=this.dependencyTracker)==null||s.save(t)}restore(t){var e;if((e=this.dependencyTracker)==null||e.restore(t),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&vh(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(t,e,s,i,r,a,o){var l;(l=this.dependencyTracker)==null||l.recordIncrementalData("transform",t),this.ctx.transform(e,s,i,r,a,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,s,i){let[r]=s;if(!i){r||(r=s[0]=new Path2D),this[e](t,r);return}if(this.dependencyTracker!==null){const a=e===mh.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,i[0]-a,i[2]+a,i[1]-a,i[3]+a).recordDependencies(t,["transform"])}if(!(r instanceof Path2D)){const a=s[0]=new Path2D;for(let o=0,l=r.length;o<l;)switch(r[o++]){case Hu.moveTo:a.moveTo(r[o++],r[o++]);break;case Hu.lineTo:a.lineTo(r[o++],r[o++]);break;case Hu.curveTo:a.bezierCurveTo(r[o++],r[o++],r[o++],r[o++],r[o++],r[o++]);break;case Hu.closePath:a.closePath();break;default:V(`Unrecognized drawing path operator: ${r[o-1]}`);break}r=a}O.axialAlignedBoundingBox(i,Ct(this.ctx),this.current.minMax),this[e](t,r),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,e,s=!0){var a;const i=this.ctx,r=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof r=="object"&&(r!=null&&r.getPattern)){const o=r.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=r.getPattern(i,this,js(i),le.STROKE,t),o){const l=new Path2D;l.addPath(e,i.getTransform().invertSelf().multiplySelf(o)),e=l}this.rescaleAndStroke(e,!1),i.restore()}else this.rescaleAndStroke(e,!0);(a=this.dependencyTracker)==null||a.recordDependencies(t,ls.stroke),s&&this.consumePath(t,e,this.current.getClippedPathBoundingBox(le.STROKE,Ct(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(t,e){this.stroke(t,e)}fill(t,e,s=!0){var h,c,u;const i=this.ctx,r=this.current.fillColor,a=this.current.patternFill;let o=!1;if(a){const g=r.isModifyingCurrentTransform()?i.getTransform():null;if((h=this.dependencyTracker)==null||h.save(t),i.save(),i.fillStyle=r.getPattern(i,this,js(i),le.FILL,t),g){const m=new Path2D;m.addPath(e,i.getTransform().invertSelf().multiplySelf(g)),e=m}o=!0}const l=this.current.getClippedPathBoundingBox();this.contentVisible&&l!==null&&(this.pendingEOFill?(i.fill(e,"evenodd"),this.pendingEOFill=!1):i.fill(e)),(c=this.dependencyTracker)==null||c.recordDependencies(t,ls.fill),o&&(i.restore(),(u=this.dependencyTracker)==null||u.restore(t)),s&&this.consumePath(t,e,l)}eoFill(t,e){this.pendingEOFill=!0,this.fill(t,e)}fillStroke(t,e){this.fill(t,e,!1),this.stroke(t,e,!1),this.consumePath(t,e)}eoFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}closeFillStroke(t,e){this.fillStroke(t,e)}closeEOFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}endPath(t,e){this.consumePath(t,e)}rawFillPath(t,e){var s;this.ctx.fill(e),(s=this.dependencyTracker)==null||s.recordDependencies(t,ls.rawFillPath).recordOperation(t)}clip(t){var e;(e=this.dependencyTracker)==null||e.recordFutureForcedDependency("clipMode",t),this.pendingClip=l0}eoClip(t){var e;(e=this.dependencyTracker)==null||e.recordFutureForcedDependency("clipMode",t),this.pendingClip=py}beginText(t){var e;this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,(e=this.dependencyTracker)==null||e.recordOpenMarker(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){const e=this.pendingTextPaths,s=this.ctx;if(this.dependencyTracker){const{dependencyTracker:i}=this;e!==void 0&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",t),i.recordCloseMarker(t)}if(e!==void 0){const i=new Path2D,r=s.getTransform().invertSelf();for(const{transform:a,x:o,y:l,fontSize:h,path:c}of e)c&&i.addPath(c,new DOMMatrix(a).preMultiplySelf(r).translate(o,l).scale(h,-h));s.clip(i)}delete this.pendingTextPaths}setCharSpacing(t,e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("charSpacing",t),this.current.charSpacing=e}setWordSpacing(t,e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("wordSpacing",t),this.current.wordSpacing=e}setHScale(t,e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("hScale",t),this.current.textHScale=e/100}setLeading(t,e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("leading",t),this.current.leading=-e}setFont(t,e,s){var u,g;(u=this.dependencyTracker)==null||u.recordSimpleData("font",t).recordSimpleDataFromNamed("fontObj",e,t);const i=this.commonObjs.get(e),r=this.current;if(!i)throw new Error(`Can't find font for ${e}`);if(r.fontMatrix=i.fontMatrix||Qg,(r.fontMatrix[0]===0||r.fontMatrix[3]===0)&&V("Invalid font matrix for font "+e),s<0?(s=-s,r.fontDirection=-1):r.fontDirection=1,this.current.font=i,this.current.fontSize=s,i.isType3Font)return;const a=i.loadedName||"sans-serif",o=((g=i.systemFontInfo)==null?void 0:g.css)||`"${a}", ${i.fallbackName}`;let l="normal";i.black?l="900":i.bold&&(l="bold");const h=i.italic?"italic":"normal";let c=s;s<oy?c=oy:s>ly&&(c=ly),this.current.fontSizeScale=s/c,this.ctx.font=`${h} ${l} ${c}px ${o}`}setTextRenderingMode(t,e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=e}setTextRise(t,e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("textRise",t),this.current.textRise=e}moveText(t,e,s){var i;(i=this.dependencyTracker)==null||i.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=s}setLeadingMoveText(t,e,s){this.setLeading(t,-s),this.moveText(t,e,s)}setTextMatrix(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("textMatrix",t);const{current:s}=this;s.textMatrix=e,s.textMatrixScale=Math.hypot(e[0],e[1]),s.x=s.lineX=0,s.y=s.lineY=0}nextLine(t){var e;this.moveText(t,0,this.current.leading),(e=this.dependencyTracker)==null||e.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??t)}paintChar(t,e,s,i,r,a){var w,E,S,_;const o=this.ctx,l=this.current,h=l.font,c=l.textRenderingMode,u=l.fontSize/l.fontSizeScale,g=c&ee.FILL_STROKE_MASK,m=!!(c&ee.ADD_TO_PATH_FLAG),A=l.patternFill&&!h.missingFile,y=l.patternStroke&&!h.missingFile;let v;if((h.disableFontFace||m||A||y)&&!h.missingFile&&(v=h.getPathGenerator(this.commonObjs,e)),v&&(h.disableFontFace||A||y)){o.save(),o.translate(s,i),o.scale(u,-u),(w=this.dependencyTracker)==null||w.recordCharacterBBox(t,o,h);let C;if(g===ee.FILL||g===ee.FILL_STROKE)if(r){C=o.getTransform(),o.setTransform(...r);const T=b(this,Kc,Rm).call(this,v,C,r);o.fill(T)}else o.fill(v);if(g===ee.STROKE||g===ee.FILL_STROKE)if(a){C||(C=o.getTransform()),o.setTransform(...a);const{a:T,b:x,c:P,d:R}=C,D=O.inverseTransform(a),M=O.transform([T,x,P,R,0,0],D);O.singularValueDecompose2dScale(M,rs),o.lineWidth*=Math.max(rs[0],rs[1])/u,o.stroke(b(this,Kc,Rm).call(this,v,C,a))}else o.lineWidth/=u,o.stroke(v);o.restore()}else(g===ee.FILL||g===ee.FILL_STROKE)&&(o.fillText(e,s,i),(E=this.dependencyTracker)==null||E.recordCharacterBBox(t,o,h,u,s,i,()=>o.measureText(e))),(g===ee.STROKE||g===ee.FILL_STROKE)&&(this.dependencyTracker&&((S=this.dependencyTracker)==null||S.recordCharacterBBox(t,o,h,u,s,i,()=>o.measureText(e)).recordDependencies(t,ls.stroke)),o.strokeText(e,s,i));m&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Ct(o),x:s,y:i,fontSize:u,path:v}),(_=this.dependencyTracker)==null||_.recordCharacterBBox(t,o,h,u,s,i))}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let s=!1;for(let i=3;i<e.length;i+=4)if(e[i]>0&&e[i]<255){s=!0;break}return q(this,"isFontSubpixelAAEnabled",s)}showText(t,e){var P,R,D,M;this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,ls.showText).resetBBox(t),this.current.textRenderingMode&ee.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());const s=this.current,i=s.font;if(i.isType3Font){this.showType3Text(t,e),(P=this.dependencyTracker)==null||P.recordShowTextOperation(t);return}const r=s.fontSize;if(r===0){(R=this.dependencyTracker)==null||R.recordOperation(t);return}const a=this.ctx,o=s.fontSizeScale,l=s.charSpacing,h=s.wordSpacing,c=s.fontDirection,u=s.textHScale*c,g=e.length,m=i.vertical,A=m?1:-1,y=i.defaultVMetrics,v=r*s.fontMatrix[0],w=s.textRenderingMode===ee.FILL&&!i.disableFontFace&&!s.patternFill;a.save(),s.textMatrix&&a.transform(...s.textMatrix),a.translate(s.x,s.y+s.textRise),c>0?a.scale(u,-1):a.scale(u,1);let E,S;if(s.patternFill){a.save();const L=s.fillColor.getPattern(a,this,js(a),le.FILL,t);E=Ct(a),a.restore(),a.fillStyle=L}if(s.patternStroke){a.save();const L=s.strokeColor.getPattern(a,this,js(a),le.STROKE,t);S=Ct(a),a.restore(),a.strokeStyle=L}let _=s.lineWidth;const C=s.textMatrixScale;if(C===0||_===0){const L=s.textRenderingMode&ee.FILL_STROKE_MASK;(L===ee.STROKE||L===ee.FILL_STROKE)&&(_=this.getSinglePixelWidth())}else _/=C;if(o!==1&&(a.scale(o,o),_/=o),a.lineWidth=_,i.isInvalidPDFjsFont){const L=[];let j=0;for(const G of e)L.push(G.unicode),j+=G.width;const F=L.join("");if(a.fillText(F,0,0),this.dependencyTracker!==null){const G=a.measureText(F);this.dependencyTracker.recordBBox(t,this.ctx,-G.actualBoundingBoxLeft,G.actualBoundingBoxRight,-G.actualBoundingBoxAscent,G.actualBoundingBoxDescent).recordShowTextOperation(t)}s.x+=j*v*u,a.restore(),this.compose();return}let T=0,x;for(x=0;x<g;++x){const L=e[x];if(typeof L=="number"){T+=A*L*r/1e3;continue}let j=!1;const F=(L.isSpace?h:0)+l,G=L.fontChar,N=L.accent;let I,Y,Q=L.width;if(m){const tt=L.vmetric||y,st=-(L.vmetric?tt[1]:Q*.5)*v,zt=tt[2]*v;Q=tt?-tt[0]:Q,I=st/o,Y=(T+zt)/o}else I=T/o,Y=0;let Gt;if(i.remeasure&&Q>0){Gt=a.measureText(G);const tt=Gt.width*1e3/r*o;if(Q<tt&&this.isFontSubpixelAAEnabled){const st=Q/tt;j=!0,a.save(),a.scale(st,1),I/=st}else Q!==tt&&(I+=(Q-tt)/2e3*r/o)}if(this.contentVisible&&(L.isInFont||i.missingFile)){if(w&&!N)a.fillText(G,I,Y),(D=this.dependencyTracker)==null||D.recordCharacterBBox(t,a,Gt?{bbox:null}:i,r/o,I,Y,()=>Gt??a.measureText(G));else if(this.paintChar(t,G,I,Y,E,S),N){const tt=I+r*N.offset.x/o,st=Y-r*N.offset.y/o;this.paintChar(t,N.fontChar,tt,st,E,S)}}const Oe=m?Q*v-F*c:Q*v+F*c;T+=Oe,j&&a.restore()}m?s.y-=T:s.x+=T*u,a.restore(),this.compose(),(M=this.dependencyTracker)==null||M.recordShowTextOperation(t)}showType3Text(t,e){const s=this.ctx,i=this.current,r=i.font,a=i.fontSize,o=i.fontDirection,l=r.vertical?1:-1,h=i.charSpacing,c=i.wordSpacing,u=i.textHScale*o,g=i.fontMatrix||Qg,m=e.length,A=i.textRenderingMode===ee.INVISIBLE;let y,v,w,E;if(A||a===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,s.save(),i.textMatrix&&s.transform(...i.textMatrix),s.translate(i.x,i.y+i.textRise),s.scale(u,o);const S=this.dependencyTracker;for(this.dependencyTracker=S?new Df(S,t):null,y=0;y<m;++y){if(v=e[y],typeof v=="number"){E=l*v*a/1e3,this.ctx.translate(E,0),i.x+=E*u;continue}const _=(v.isSpace?c:0)+h,C=r.charProcOperatorList[v.operatorListId];C?this.contentVisible&&(this.save(),s.scale(a,a),s.transform(...g),this.executeOperatorList(C),this.restore()):V(`Type3 character "${v.operatorListId}" is not available.`);const T=[v.width,0];O.applyTransform(T,g),w=T[0]*a+_,s.translate(w,0),i.x+=w*u}s.restore(),S&&(this.dependencyTracker=S)}setCharWidth(t,e,s){}setCharWidthAndBounds(t,e,s,i,r,a,o){var h;const l=new Path2D;l.rect(i,r,a-i,o-r),this.ctx.clip(l),(h=this.dependencyTracker)==null||h.recordBBox(t,this.ctx,i,a,r,o).recordClipBox(t,this.ctx,i,a,r,o),this.endPath(t)}getColorN_Pattern(t,e){let s;if(e[0]==="TilingPattern"){const i=this.baseTransform||Ct(this.ctx),r={createCanvasGraphics:(a,o)=>new Gb(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new Df(this.dependencyTracker,o,!0):null)};s=new Tm(e,this.ctx,r,i)}else s=this._getPattern(t,e[1],e[2]);return s}setStrokeColorN(t,...e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("strokeColor",t),this.current.strokeColor=this.getColorN_Pattern(t,e),this.current.patternStroke=!0}setFillColorN(t,...e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("fillColor",t),this.current.fillColor=this.getColorN_Pattern(t,e),this.current.patternFill=!0}setStrokeRGBColor(t,e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}setStrokeTransparent(t){var e;(e=this.dependencyTracker)==null||e.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1}setFillTransparent(t){var e;(e=this.dependencyTracker)==null||e.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e,s=null){let i;return this.cachedPatterns.has(e)?i=this.cachedPatterns.get(e):(i=e0(this.getObject(t,e)),this.cachedPatterns.set(e,i)),s&&(i.matrix=s),i}shadingFill(t,e){var a;if(!this.contentVisible)return;const s=this.ctx;this.save(t);const i=this._getPattern(t,e);s.fillStyle=i.getPattern(s,this,js(s),le.SHADING,t);const r=js(s);if(r){const{width:o,height:l}=s.canvas,h=lo.slice();O.axialAlignedBoundingBox([0,0,o,l],r,h);const[c,u,g,m]=h;this.ctx.fillRect(c,u,g-c,m-u)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);(a=this.dependencyTracker)==null||a.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,ls.transform).recordDependencies(t,ls.fill).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t)}beginInlineImage(){ft("Should not call beginInlineImage")}beginImageData(){ft("Should not call beginImageData")}paintFormXObjectBegin(t,e,s){var i;if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),e&&this.transform(t,...e),this.baseTransform=Ct(this.ctx),s)){O.axialAlignedBoundingBox(s,this.baseTransform,this.current.minMax);const[r,a,o,l]=s,h=new Path2D;h.rect(r,a,o-r,l-a),this.ctx.clip(h),(i=this.dependencyTracker)==null||i.recordClipBox(t,this.ctx,r,o,a,l),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,e){var S;if(!this.contentVisible)return;this.save(t),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const s=this.ctx;e.isolated||Dg("TODO: Support non-isolated groups."),e.knockout&&V("Knockout groups not supported.");const i=Ct(s);if(e.matrix&&s.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let r=lo.slice();O.axialAlignedBoundingBox(e.bbox,Ct(s),r);const a=[0,0,s.canvas.width,s.canvas.height];r=O.intersect(r,a)||[0,0,0,0];const o=Math.floor(r[0]),l=Math.floor(r[1]),h=Math.max(Math.ceil(r[2])-o,1),c=Math.max(Math.ceil(r[3])-l,1);this.current.startNewPathAndClipBox([0,0,h,c]);let u="groupAt"+this.groupLevel;e.smask&&(u+="_smask_"+this.smaskCounter++%2);const g=this.cachedCanvases.getCanvas(u,h,c),m=g.context;m.translate(-o,-l),m.transform(...i);let A=new Path2D;const[y,v,w,E]=e.bbox;if(A.rect(y,v,w-y,E-v),e.matrix){const _=new Path2D;_.addPath(A,new DOMMatrix(e.matrix)),A=_}m.clip(A),e.smask&&this.smaskStack.push({canvas:g.canvas,context:m,offsetX:o,offsetY:l,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}),(!e.smask||this.dependencyTracker)&&(s.setTransform(1,0,0,1,0,0),s.translate(o,l),s.save()),vh(s,m),this.ctx=m,(S=this.dependencyTracker)==null||S.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(s),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(s),this.groupLevel++}endGroup(t,e){var r;if(!this.contentVisible)return;this.groupLevel--;const s=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,(r=this.dependencyTracker)==null||r.popBaseTransform(),e.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const a=Ct(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...a);const o=lo.slice();O.axialAlignedBoundingBox([0,0,s.canvas.width,s.canvas.height],a,o),this.ctx.drawImage(s.canvas,0,0),this.ctx.restore(),this.compose(o)}}beginAnnotation(t,e,s,i,r,a){if(b(this,qc,xm).call(this),Wu(this.ctx),this.ctx.save(),this.save(t),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),s){const o=s[2]-s[0],l=s[3]-s[1];if(a&&this.annotationCanvasMap){i=i.slice(),i[4]-=s[0],i[5]-=s[1],s=s.slice(),s[0]=s[1]=0,s[2]=o,s[3]=l,O.singularValueDecompose2dScale(Ct(this.ctx),rs);const{viewportScale:h}=this,c=Math.ceil(o*this.outputScaleX*h),u=Math.ceil(l*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(c,u);const{canvas:g,context:m}=this.annotationCanvas;this.annotationCanvasMap.set(e,g),this.annotationCanvas.savedCtx=this.ctx,this.ctx=m,this.ctx.save(),this.ctx.setTransform(rs[0],0,0,-rs[1],0,l*rs[1]),Wu(this.ctx)}else{Wu(this.ctx),this.endPath(t);const h=new Path2D;h.rect(s[0],s[1],o,l),this.ctx.clip(h)}}this.current=new cy(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(t,...i),this.transform(t,...r)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),b(this,Yc,Pm).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t,e){var o;if(!this.contentVisible)return;const s=e.count;e=this.getObject(t,e.data,e),e.count=s;const i=this.ctx,r=this._createMaskCanvas(t,e),a=r.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(a,r.offsetX,r.offsetY),(o=this.dependencyTracker)==null||o.resetBBox(t).recordBBox(t,this.ctx,r.offsetX,r.offsetX+a.width,r.offsetY,r.offsetY+a.height).recordOperation(t),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,s,i=0,r=0,a,o){var u,g,m;if(!this.contentVisible)return;e=this.getObject(t,e.data,e);const l=this.ctx;l.save();const h=Ct(l);l.transform(s,i,r,a,0,0);const c=this._createMaskCanvas(t,e);l.setTransform(1,0,0,1,c.offsetX-h[4],c.offsetY-h[5]),(u=this.dependencyTracker)==null||u.resetBBox(t);for(let A=0,y=o.length;A<y;A+=2){const v=O.transform(h,[s,i,r,a,o[A],o[A+1]]);l.drawImage(c.canvas,v[4],v[5]),(g=this.dependencyTracker)==null||g.recordBBox(t,this.ctx,v[4],v[4]+c.canvas.width,v[5],v[5]+c.canvas.height)}l.restore(),this.compose(),(m=this.dependencyTracker)==null||m.recordOperation(t)}paintImageMaskXObjectGroup(t,e){var a,o,l;if(!this.contentVisible)return;const s=this.ctx,i=this.current.fillColor,r=this.current.patternFill;(a=this.dependencyTracker)==null||a.resetBBox(t).recordDependencies(t,ls.transformAndFill);for(const h of e){const{data:c,width:u,height:g,transform:m}=h,A=this.cachedCanvases.getCanvas("maskCanvas",u,g),y=A.context;y.save();const v=this.getObject(t,c,h);uy(y,v),y.globalCompositeOperation="source-in",y.fillStyle=r?i.getPattern(y,this,js(s),le.FILL,t):i,y.fillRect(0,0,u,g),y.restore(),s.save(),s.transform(...m),s.scale(1,-1),Vu(s,A.canvas,0,0,u,g,0,-1,1,1),(o=this.dependencyTracker)==null||o.recordBBox(t,s,0,u,0,g),s.restore()}this.compose(),(l=this.dependencyTracker)==null||l.recordOperation(t)}paintImageXObject(t,e){if(!this.contentVisible)return;const s=this.getObject(t,e);if(!s){V("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t,s)}paintImageXObjectRepeat(t,e,s,i,r){if(!this.contentVisible)return;const a=this.getObject(t,e);if(!a){V("Dependent image isn't ready yet");return}const o=a.width,l=a.height,h=[];for(let c=0,u=r.length;c<u;c+=2)h.push({transform:[s,0,0,i,r[c],r[c+1]],x:0,y:0,w:o,h:l});this.paintInlineImageXObjectGroup(t,a,h)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:e,width:s,height:i}=t,r=this.cachedCanvases.getCanvas("inlineImage",s,i),a=r.context;return a.filter=this.current.transferMaps,a.drawImage(e,0,0),a.filter="none",r.canvas}paintInlineImageXObject(t,e){var h;if(!this.contentVisible)return;const s=e.width,i=e.height,r=this.ctx;this.save(t);const{filter:a}=r;a!=="none"&&a!==""&&(r.filter="none"),r.scale(1/s,-1/i);let o;if(e.bitmap)o=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)o=e;else{const u=this.cachedCanvases.getCanvas("inlineImage",s,i).context;dy(u,e),o=this.applyTransferMapsToCanvas(u)}const l=this._scaleImage(o,js(r));r.imageSmoothingEnabled=fy(Ct(r),e.interpolate),(h=this.dependencyTracker)==null||h.resetBBox(t).recordBBox(t,r,0,s,-i,0).recordDependencies(t,ls.imageXObject).recordOperation(t),Vu(r,l.img,0,0,l.paintWidth,l.paintHeight,0,-i,s,i),this.compose(),this.restore(t)}paintInlineImageXObjectGroup(t,e,s){var a,o,l;if(!this.contentVisible)return;const i=this.ctx;let r;if(e.bitmap)r=e.bitmap;else{const h=e.width,c=e.height,g=this.cachedCanvases.getCanvas("inlineImage",h,c).context;dy(g,e),r=this.applyTransferMapsToCanvas(g)}(a=this.dependencyTracker)==null||a.resetBBox(t);for(const h of s)i.save(),i.transform(...h.transform),i.scale(1,-1),Vu(i,r,h.x,h.y,h.w,h.h,0,-1,1,1),(o=this.dependencyTracker)==null||o.recordBBox(t,i,0,1,-1,0),i.restore();(l=this.dependencyTracker)==null||l.recordOperation(t),this.compose()}paintSolidColorImageMask(t){var e;this.contentVisible&&((e=this.dependencyTracker)==null||e.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,ls.fill).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t,e){}markPointProps(t,e,s){}beginMarkedContent(t,e){var s;(s=this.dependencyTracker)==null||s.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e,s){var i;(i=this.dependencyTracker)==null||i.beginMarkedContent(t),e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(s)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){var e;(e=this.dependencyTracker)==null||e.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,e,s){var a,o;const i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(s);const r=this.ctx;this.pendingClip?(i||(this.pendingClip===py?r.clip(e,"evenodd"):r.clip(e)),this.pendingClip=null,(a=this.dependencyTracker)==null||a.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):(o=this.dependencyTracker)==null||o.recordOperation(t),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Ct(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),s=Math.hypot(t[0],t[2]),i=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(s,i)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:e,b:s,c:i,d:r}=this.ctx.getTransform();let a,o;if(s===0&&i===0){const l=Math.abs(e),h=Math.abs(r);if(l===h)if(t===0)a=o=1/l;else{const c=l*t;a=o=c<1?1/c:1}else if(t===0)a=1/l,o=1/h;else{const c=l*t,u=h*t;a=c<1?1/c:1,o=u<1?1/u:1}}else{const l=Math.abs(e*r-s*i),h=Math.hypot(e,s),c=Math.hypot(i,r);if(t===0)a=c/l,o=h/l;else{const u=t*l;a=c>u?c/u:1,o=h>u?h/u:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:s,current:{lineWidth:i}}=this,[r,a]=this.getScaleForStroking();if(r===a){s.lineWidth=(i||1)*r,s.stroke(t);return}const o=s.getLineDash();e&&s.save(),s.scale(r,a),qg.a=1/r,qg.d=1/a;const l=new Path2D;if(l.addPath(t,qg),o.length>0){const h=Math.max(r,a);s.setLineDash(o.map(c=>c/h)),s.lineDashOffset/=h}s.lineWidth=i||1,s.stroke(l),e&&s.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};qc=new WeakSet,xm=function(){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)},Yc=new WeakSet,Pm=function(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}},Kc=new WeakSet,Rm=function(t,e,s){const i=new Path2D;return i.addPath(t,new DOMMatrix(s).invertSelf().multiplySelf(e)),i};let po=Gb;for(const d in mh)po.prototype[d]!==void 0&&(po.prototype[mh[d]]=po.prototype[d]);var Jo,Qo,Jc,Zo,nf;const co=class co{constructor(t){f(this,Zo);f(this,Jo,void 0);f(this,Qo,void 0);f(this,Jc,void 0);p(this,Jo,t),p(this,Qo,new DataView(n(this,Jo))),p(this,Jc,new TextDecoder)}static write(t){const e=new TextEncoder,s={};let i=0;for(const h of co.strings){const c=e.encode(t[h]);s[h]=c,i+=4+c.length}const r=new ArrayBuffer(i),a=new Uint8Array(r),o=new DataView(r);let l=0;for(const h of co.strings){const c=s[h],u=c.length;o.setUint32(l,u),a.set(c,l+4),l+=4+u}return Z(l===r.byteLength,"CssFontInfo.write: Buffer overflow"),r}get fontFamily(){return b(this,Zo,nf).call(this,0)}get fontWeight(){return b(this,Zo,nf).call(this,1)}get italicAngle(){return b(this,Zo,nf).call(this,2)}};Jo=new WeakMap,Qo=new WeakMap,Jc=new WeakMap,Zo=new WeakSet,nf=function(t){Z(t<co.strings.length,"Invalid string index");let e=0;for(let i=0;i<t;i++)e+=n(this,Qo).getUint32(e)+4;const s=n(this,Qo).getUint32(e);return n(this,Jc).decode(new Uint8Array(n(this,Jo),e+4,s))},k(co,"strings",["fontFamily","fontWeight","italicAngle"]);let Mf=co;var In,si,ea,sa,Nh;const uo=class uo{constructor(t){f(this,sa);f(this,In,void 0);f(this,si,void 0);f(this,ea,void 0);p(this,In,t),p(this,si,new DataView(n(this,In))),p(this,ea,new TextDecoder)}static write(t){const e=new TextEncoder,s={};let i=0;for(const g of uo.strings){const m=e.encode(t[g]);s[g]=m,i+=4+m.length}i+=4;let r,a,o=1+i;t.style&&(r=e.encode(t.style.style),a=e.encode(t.style.weight),o+=4+r.length+4+a.length);const l=new ArrayBuffer(o),h=new Uint8Array(l),c=new DataView(l);let u=0;c.setUint8(u++,t.guessFallback?1:0),c.setUint32(u,0),u+=4,i=0;for(const g of uo.strings){const m=s[g],A=m.length;i+=4+A,c.setUint32(u,A),h.set(m,u+4),u+=4+A}return c.setUint32(u-i-4,i),t.style&&(c.setUint32(u,r.length),h.set(r,u+4),u+=4+r.length,c.setUint32(u,a.length),h.set(a,u+4),u+=4+a.length),Z(u<=l.byteLength,"SubstitionInfo.write: Buffer overflow"),l.transferToFixedLength(u)}get guessFallback(){return n(this,si).getUint8(0)!==0}get css(){return b(this,sa,Nh).call(this,0)}get loadedName(){return b(this,sa,Nh).call(this,1)}get baseFontName(){return b(this,sa,Nh).call(this,2)}get src(){return b(this,sa,Nh).call(this,3)}get style(){let t=1;t+=4+n(this,si).getUint32(t);const e=n(this,si).getUint32(t),s=n(this,ea).decode(new Uint8Array(n(this,In),t+4,e));t+=4+e;const i=n(this,si).getUint32(t),r=n(this,ea).decode(new Uint8Array(n(this,In),t+4,i));return{style:s,weight:r}}};In=new WeakMap,si=new WeakMap,ea=new WeakMap,sa=new WeakSet,Nh=function(t){Z(t<uo.strings.length,"Invalid string index");let e=5;for(let i=0;i<t;i++)e+=n(this,si).getUint32(e)+4;const s=n(this,si).getUint32(e);return n(this,ea).decode(new Uint8Array(n(this,In),e+4,s))},k(uo,"strings",["css","loadedName","baseFontName","src"]);let Lf=uo;var tl,el,sl,il,Ge,ii,Qc,ot,ze,Ss,nl,rf,ia,Oh;const X=class X{constructor({data:t,extra:e}){f(this,ze);f(this,nl);f(this,ia);f(this,ii,void 0);f(this,Qc,void 0);f(this,ot,void 0);p(this,ii,t),p(this,Qc,new TextDecoder),p(this,ot,new DataView(n(this,ii))),e&&Object.assign(this,e)}get black(){return b(this,ze,Ss).call(this,0)}get bold(){return b(this,ze,Ss).call(this,1)}get disableFontFace(){return b(this,ze,Ss).call(this,2)}get fontExtraProperties(){return b(this,ze,Ss).call(this,3)}get isInvalidPDFjsFont(){return b(this,ze,Ss).call(this,4)}get isType3Font(){return b(this,ze,Ss).call(this,5)}get italic(){return b(this,ze,Ss).call(this,6)}get missingFile(){return b(this,ze,Ss).call(this,7)}get remeasure(){return b(this,ze,Ss).call(this,8)}get vertical(){return b(this,ze,Ss).call(this,9)}get ascent(){return b(this,nl,rf).call(this,0)}get defaultWidth(){return b(this,nl,rf).call(this,1)}get descent(){return b(this,nl,rf).call(this,2)}get bbox(){let t=n(X,el);if(n(this,ot).getUint8(t)===0)return;t+=1;const s=[];for(let i=0;i<4;i++)s.push(n(this,ot).getInt16(t,!0)),t+=2;return s}get fontMatrix(){let t=n(X,sl);if(n(this,ot).getUint8(t)===0)return;t+=1;const s=[];for(let i=0;i<6;i++)s.push(n(this,ot).getFloat64(t,!0)),t+=8;return s}get defaultVMetrics(){let t=n(X,il);if(n(this,ot).getUint8(t)===0)return;t+=1;const s=[];for(let i=0;i<3;i++)s.push(n(this,ot).getInt16(t,!0)),t+=2;return s}get fallbackName(){return b(this,ia,Oh).call(this,0)}get loadedName(){return b(this,ia,Oh).call(this,1)}get mimetype(){return b(this,ia,Oh).call(this,2)}get name(){return b(this,ia,Oh).call(this,3)}get data(){let t=n(X,Ge);const e=n(this,ot).getUint32(t);t+=4+e;const s=n(this,ot).getUint32(t);t+=4+s;const i=n(this,ot).getUint32(t);t+=4+i;const r=n(this,ot).getUint32(t);if(r!==0)return new Uint8Array(n(this,ii),t+4,r)}clearData(){let t=n(X,Ge);const e=n(this,ot).getUint32(t);t+=4+e;const s=n(this,ot).getUint32(t);t+=4+s;const i=n(this,ot).getUint32(t);t+=4+i;const r=n(this,ot).getUint32(t);new Uint8Array(n(this,ii),t+4,r).fill(0),n(this,ot).setUint32(t,0)}get cssFontInfo(){let t=n(X,Ge);const e=n(this,ot).getUint32(t);t+=4+e;const s=n(this,ot).getUint32(t);t+=4+s;const i=n(this,ot).getUint32(t);if(i===0)return null;const r=new Uint8Array(i);return r.set(new Uint8Array(n(this,ii),t+4,i)),new Mf(r.buffer)}get systemFontInfo(){let t=n(X,Ge);const e=n(this,ot).getUint32(t);t+=4+e;const s=n(this,ot).getUint32(t);if(s===0)return null;const i=new Uint8Array(s);return i.set(new Uint8Array(n(this,ii),t+4,s)),new Lf(i.buffer)}static write(t){const e=t.systemFontInfo?Lf.write(t.systemFontInfo):null,s=t.cssFontInfo?Mf.write(t.cssFontInfo):null,i=new TextEncoder,r={};let a=0;for(const y of X.strings)r[y]=i.encode(t[y]),a+=4+r[y].length;const o=n(X,Ge)+4+a+4+(e?e.byteLength:0)+4+(s?s.byteLength:0)+4+(t.data?t.data.length:0),l=new ArrayBuffer(o),h=new Uint8Array(l),c=new DataView(l);let u=0;const g=X.bools.length;let m=0,A=0;for(let y=0;y<g;y++){const v=t[X.bools[y]];m|=(v===void 0?0:v?2:1)<<A,A+=2,(A===8||y===g-1)&&(c.setUint8(u++,m),m=0,A=0)}Z(u===n(X,tl),"FontInfo.write: Boolean properties offset mismatch");for(const y of X.numbers)c.setFloat64(u,t[y]),u+=8;if(Z(u===n(X,el),"FontInfo.write: Number properties offset mismatch"),t.bbox){c.setUint8(u++,4);for(const y of t.bbox)c.setInt16(u,y,!0),u+=2}else c.setUint8(u++,0),u+=2*4;if(Z(u===n(X,sl),"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){c.setUint8(u++,6);for(const y of t.fontMatrix)c.setFloat64(u,y,!0),u+=8}else c.setUint8(u++,0),u+=8*6;if(Z(u===n(X,il),"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){c.setUint8(u++,1);for(const y of t.defaultVMetrics)c.setInt16(u,y,!0),u+=2}else c.setUint8(u++,0),u+=3*2;Z(u===n(X,Ge),"FontInfo.write: DefaultVMetrics properties offset mismatch"),c.setUint32(n(X,Ge),0),u+=4;for(const y of X.strings){const v=r[y],w=v.length;c.setUint32(u,w),h.set(v,u+4),u+=4+w}if(c.setUint32(n(X,Ge),u-n(X,Ge)-4),!e)c.setUint32(u,0),u+=4;else{const y=e.byteLength;c.setUint32(u,y),Z(u+4+y<=l.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),h.set(new Uint8Array(e),u+4),u+=4+y}if(!s)c.setUint32(u,0),u+=4;else{const y=s.byteLength;c.setUint32(u,y),Z(u+4+y<=l.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),h.set(new Uint8Array(s),u+4),u+=4+y}return t.data===void 0?(c.setUint32(u,0),u+=4):(c.setUint32(u,t.data.length),h.set(t.data,u+4),u+=4+t.data.length),Z(u<=l.byteLength,"FontInfo.write: Buffer overflow"),l.transferToFixedLength(u)}};tl=new WeakMap,el=new WeakMap,sl=new WeakMap,il=new WeakMap,Ge=new WeakMap,ii=new WeakMap,Qc=new WeakMap,ot=new WeakMap,ze=new WeakSet,Ss=function(t){Z(t<X.bools.length,"Invalid boolean index");const e=Math.floor(t/4),s=t*2%8,i=n(this,ot).getUint8(e)>>s&3;return i===0?void 0:i===2},nl=new WeakSet,rf=function(t){return Z(t<X.numbers.length,"Invalid number index"),n(this,ot).getFloat64(n(X,tl)+t*8)},ia=new WeakSet,Oh=function(t){Z(t<X.strings.length,"Invalid string index");let e=n(X,Ge)+4;for(let r=0;r<t;r++)e+=n(this,ot).getUint32(e)+4;const s=n(this,ot).getUint32(e),i=new Uint8Array(s);return i.set(new Uint8Array(n(this,ii),e+4,s)),n(this,Qc).decode(i)},k(X,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),k(X,"numbers",["ascent","defaultWidth","descent"]),k(X,"strings",["fallbackName","loadedName","mimetype","name"]),f(X,tl,Math.ceil(X.bools.length*2/8)),f(X,el,n(X,tl)+X.numbers.length*8),f(X,sl,n(X,el)+1+2*4),f(X,il,n(X,sl)+1+8*6),f(X,Ge,n(X,il)+1+2*3);let km=X;var Zc,td;class Hs{static get workerPort(){return n(this,Zc)}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");p(this,Zc,t)}static get workerSrc(){return n(this,td)}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");p(this,td,t)}}Zc=new WeakMap,td=new WeakMap,f(Hs,Zc,null),f(Hs,td,"");var rl,ed;class h0{constructor({parsedData:t,rawData:e}){f(this,rl,void 0);f(this,ed,void 0);p(this,rl,t),p(this,ed,e)}getRaw(){return n(this,ed)}get(t){return n(this,rl).get(t)??null}[Symbol.iterator](){return n(this,rl).entries()}}rl=new WeakMap,ed=new WeakMap;const ro=Symbol("INTERNAL");var sd,id,nd,al;class c0{constructor(t,{name:e,intent:s,usage:i,rbGroups:r}){f(this,sd,!1);f(this,id,!1);f(this,nd,!1);f(this,al,!0);p(this,sd,!!(t&ns.DISPLAY)),p(this,id,!!(t&ns.PRINT)),this.name=e,this.intent=s,this.usage=i,this.rbGroups=r}get visible(){if(n(this,nd))return n(this,al);if(!n(this,al))return!1;const{print:t,view:e}=this.usage;return n(this,sd)?(e==null?void 0:e.viewState)!=="OFF":n(this,id)?(t==null?void 0:t.printState)!=="OFF":!0}_setVisible(t,e,s=!1){t!==ro&&ft("Internal method `_setVisible` called."),p(this,nd,s),p(this,al,e)}}sd=new WeakMap,id=new WeakMap,nd=new WeakMap,al=new WeakMap;var Fn,lt,ol,ll,rd,Dm;class d0{constructor(t,e=ns.DISPLAY){f(this,rd);f(this,Fn,null);f(this,lt,new Map);f(this,ol,null);f(this,ll,null);if(this.renderingIntent=e,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,p(this,ll,t.order);for(const s of t.groups)n(this,lt).set(s.id,new c0(e,s));if(t.baseState==="OFF")for(const s of n(this,lt).values())s._setVisible(ro,!1);for(const s of t.on)n(this,lt).get(s)._setVisible(ro,!0);for(const s of t.off)n(this,lt).get(s)._setVisible(ro,!1);p(this,ol,this.getHash())}}isVisible(t){if(n(this,lt).size===0)return!0;if(!t)return Dg("Optional content group not defined."),!0;if(t.type==="OCG")return n(this,lt).has(t.id)?n(this,lt).get(t.id).visible:(V(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return b(this,rd,Dm).call(this,t.expression);if(!t.policy||t.policy==="AnyOn"){for(const e of t.ids){if(!n(this,lt).has(e))return V(`Optional content group not found: ${e}`),!0;if(n(this,lt).get(e).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const e of t.ids){if(!n(this,lt).has(e))return V(`Optional content group not found: ${e}`),!0;if(!n(this,lt).get(e).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const e of t.ids){if(!n(this,lt).has(e))return V(`Optional content group not found: ${e}`),!0;if(!n(this,lt).get(e).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const e of t.ids){if(!n(this,lt).has(e))return V(`Optional content group not found: ${e}`),!0;if(n(this,lt).get(e).visible)return!1}return!0}return V(`Unknown optional content policy ${t.policy}.`),!0}return V(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0,s=!0){var r;const i=n(this,lt).get(t);if(!i){V(`Optional content group not found: ${t}`);return}if(s&&e&&i.rbGroups.length)for(const a of i.rbGroups)for(const o of a)o!==t&&((r=n(this,lt).get(o))==null||r._setVisible(ro,!1,!0));i._setVisible(ro,!!e,!0),p(this,Fn,null)}setOCGState({state:t,preserveRB:e}){let s;for(const i of t){switch(i){case"ON":case"OFF":case"Toggle":s=i;continue}const r=n(this,lt).get(i);if(r)switch(s){case"ON":this.setVisibility(i,!0,e);break;case"OFF":this.setVisibility(i,!1,e);break;case"Toggle":this.setVisibility(i,!r.visible,e);break}}p(this,Fn,null)}get hasInitialVisibility(){return n(this,ol)===null||this.getHash()===n(this,ol)}getOrder(){return n(this,lt).size?n(this,ll)?n(this,ll).slice():[...n(this,lt).keys()]:null}getGroup(t){return n(this,lt).get(t)||null}getHash(){if(n(this,Fn)!==null)return n(this,Fn);const t=new gA;for(const[e,s]of n(this,lt))t.update(`${e}:${s.visible}`);return p(this,Fn,t.hexdigest())}[Symbol.iterator](){return n(this,lt).entries()}}Fn=new WeakMap,lt=new WeakMap,ol=new WeakMap,ll=new WeakMap,rd=new WeakSet,Dm=function(t){const e=t.length;if(e<2)return!0;const s=t[0];for(let i=1;i<e;i++){const r=t[i];let a;if(Array.isArray(r))a=b(this,rd,Dm).call(this,r);else if(n(this,lt).has(r))a=n(this,lt).get(r).visible;else return V(`Optional content group not found: ${r}`),!0;switch(s){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return s==="And"};class u0{constructor(t,{disableRange:e=!1,disableStream:s=!1}){Z(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:i,initialData:r,progressiveDone:a,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,(r==null?void 0:r.length)>0){const l=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!s,this._isRangeSupported=!e,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((l,h)=>{this._onReceiveData({begin:l,chunk:h})}),t.addProgressListener((l,h)=>{this._onProgress({loaded:l,total:h})}),t.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:e}){const s=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(s):this._queuedChunks.push(s);else{const i=this._rangeReaders.some(function(r){return r._begin!==t?!1:(r._enqueue(s),!0)});Z(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}_onProgress(t){var e,s,i,r;t.total===void 0?(s=(e=this._rangeReaders[0])==null?void 0:e.onProgress)==null||s.call(e,{loaded:t.loaded}):(r=(i=this._fullRequestReader)==null?void 0:i.onProgress)==null||r.call(i,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;(t=this._fullRequestReader)==null||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){Z(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new f0(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new p0(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(s),s}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const s of this._rangeReaders.slice(0))s.cancel(t);this._pdfDataRangeTransport.abort()}}class f0{constructor(t,e,s=!1,i=null){this._stream=t,this._done=s||!1,this._filename=Lg(i)?i:null,this._queuedChunks=e||[],this._loaded=0;for(const r of this._queuedChunks)this._loaded+=r.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class p0{constructor(t,e,s){this._stream=t,this._begin=e,this._end=s,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const s of this._requests)s.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 t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function g0(d){let t=!0,e=s("filename\\*","i").exec(d);if(e){e=e[1];let c=o(e);return c=unescape(c),c=l(c),c=h(c),r(c)}if(e=a(d),e){const c=h(e);return r(c)}if(e=s("filename","i").exec(d),e){e=e[1];let c=o(e);return c=h(c),r(c)}function s(c,u){return new RegExp("(?:^|;)\\s*"+c+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',u)}function i(c,u){if(c){if(!/^[\x00-\xFF]+$/.test(u))return u;try{const g=new TextDecoder(c,{fatal:!0}),m=Du(u);u=g.decode(m),t=!1}catch{}}return u}function r(c){return t&&/[\x80-\xff]/.test(c)&&(c=i("utf-8",c),t&&(c=i("iso-8859-1",c))),c}function a(c){const u=[];let g;const m=s("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(g=m.exec(c))!==null;){let[,y,v,w]=g;if(y=parseInt(y,10),y in u){if(y===0)break;continue}u[y]=[v,w]}const A=[];for(let y=0;y<u.length&&y in u;++y){let[v,w]=u[y];w=o(w),v&&(w=unescape(w),y===0&&(w=l(w))),A.push(w)}return A.join("")}function o(c){if(c.startsWith('"')){const u=c.slice(1).split('\\"');for(let g=0;g<u.length;++g){const m=u[g].indexOf('"');m!==-1&&(u[g]=u[g].slice(0,m),u.length=g+1),u[g]=u[g].replaceAll(/\\(.)/g,"$1")}c=u.join('"')}return c}function l(c){const u=c.indexOf("'");if(u===-1)return c;const g=c.slice(0,u),A=c.slice(u+1).replace(/^[^']*'/,"");return i(g,A)}function h(c){return!c.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(c)?c:c.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(u,g,m,A){if(m==="q"||m==="Q")return A=A.replaceAll("_"," "),A=A.replaceAll(/=([0-9a-fA-F]{2})/g,function(y,v){return String.fromCharCode(parseInt(v,16))}),i(g,A);try{A=atob(A)}catch{}return i(g,A)})}return""}function PA(d,t){const e=new Headers;if(!d||!t||typeof t!="object")return e;for(const s in t){const i=t[s];i!==void 0&&e.append(s,i)}return e}function Ig(d){var t;return((t=URL.parse(d))==null?void 0:t.origin)??null}function RA({responseHeaders:d,isHttp:t,rangeChunkSize:e,disableRange:s}){const i={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(d.get("Content-Length"),10);return!Number.isInteger(r)||(i.suggestedLength=r,r<=2*e)||s||!t||d.get("Accept-Ranges")!=="bytes"||(d.get("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function kA(d){const t=d.get("Content-Disposition");if(t){let e=g0(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if(Lg(e))return e}return null}function Fu(d,t){return new qh(`Unexpected server response (${d}) while retrieving PDF "${t}".`,d,d===404||d===0&&t.startsWith("file:"))}function DA(d){return d===200||d===206}function MA(d,t,e){return{method:"GET",headers:d,signal:e.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function LA(d){return d instanceof Uint8Array?d.buffer:d instanceof ArrayBuffer?d:(V(`getArrayBuffer - unexpected data format: ${d}`),new Uint8Array(d).buffer)}class m0{constructor(t){k(this,"_responseOrigin",null);this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=PA(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return Z(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new b0(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new y0(this,t,e);return this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}}class b0{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange;const s=new Headers(t.headers),i=e.url;fetch(i,MA(s,this._withCredentials,this._abortController)).then(r=>{if(t._responseOrigin=Ig(r.url),!DA(r.status))throw Fu(r.status,i);this._reader=r.body.getReader(),this._headersCapability.resolve();const a=r.headers,{allowRangeRequests:o,suggestedLength:l}=RA({responseHeaders:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=l||this._contentLength,this._filename=kA(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new an("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var s;await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,(s=this.onProgress)==null||s.call(this,{loaded:this._loaded,total:this._contentLength}),{value:LA(t),done:!1})}cancel(t){var e;(e=this._reader)==null||e.cancel(t),this._abortController.abort()}}class y0{constructor(t,e,s){this._stream=t,this._reader=null,this._loaded=0;const i=t.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;const r=new Headers(t.headers);r.append("Range",`bytes=${e}-${s-1}`);const a=i.url;fetch(a,MA(r,this._withCredentials,this._abortController)).then(o=>{const l=Ig(o.url);if(l!==t._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${t._responseOrigin}".`);if(!DA(o.status))throw Fu(o.status,a);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var s;await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,(s=this.onProgress)==null||s.call(this,{loaded:this._loaded}),{value:LA(t),done:!1})}cancel(t){var e;(e=this._reader)==null||e.cancel(t),this._abortController.abort()}}const Yg=200,Kg=206;function A0(d){const t=d.response;return typeof t!="string"?t:Du(t).buffer}class w0{constructor({url:t,httpHeaders:e,withCredentials:s}){k(this,"_responseOrigin",null);this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=PA(this.isHttp,e),this.withCredentials=s||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const e=new XMLHttpRequest,s=this.currXhrId++,i=this.pendingRequests[s]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const[r,a]of this.headers)e.setRequestHeader(r,a);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),i.expectedStatus=Kg):i.expectedStatus=Yg,e.responseType="arraybuffer",Z(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>{t.onError(e.status)},e.onreadystatechange=this.onStateChange.bind(this,s),e.onprogress=this.onProgress.bind(this,s),i.onHeadersReceived=t.onHeadersReceived,i.onDone=t.onDone,i.onError=t.onError,i.onProgress=t.onProgress,e.send(null),s}onProgress(t,e){var i;const s=this.pendingRequests[t];s&&((i=s.onProgress)==null||i.call(s,e))}onStateChange(t,e){const s=this.pendingRequests[t];if(!s)return;const i=s.xhr;if(i.readyState>=2&&s.onHeadersReceived&&(s.onHeadersReceived(),delete s.onHeadersReceived),i.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],i.status===0&&this.isHttp){s.onError(i.status);return}const r=i.status||Yg;if(!(r===Yg&&s.expectedStatus===Kg)&&r!==s.expectedStatus){s.onError(i.status);return}const o=A0(i);if(r===Kg){const l=i.getResponseHeader("Content-Range"),h=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);h?s.onDone({begin:parseInt(h[1],10),chunk:o}):(V('Missing or invalid "Content-Range" header.'),s.onError(0))}else o?s.onDone({begin:0,chunk:o}):s.onError(i.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class v0{constructor(t){this._source=t,this._manager=new w0(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return Z(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new E0(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const s=new S0(this._manager,t,e);return s.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}}class E0{constructor(t,e){this._manager=t,this._url=e.url,this._fullRequestId=t.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=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t);this._manager._responseOrigin=Ig(e.responseURL);const s=e.getAllResponseHeaders(),i=new Headers(s?s.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(o=>{const[l,...h]=o.split(": ");return[l,h.join(": ")]}):[]),{allowRangeRequests:r,suggestedLength:a}=RA({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=kA(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=Fu(t,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(t){var e;(e=this.onProgress)==null||e.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._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 t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class S0{constructor(t,e,s){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,end:s,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(){var e;const t=Ig((e=this._manager.getRequestXhr(this._requestId))==null?void 0:e.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){var t;(t=this.onClosed)==null||t.call(this,this)}_onDone(t){const e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(const s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??(this._storedError=Fu(t,this._url));for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||(e=this.onProgress)==null||e.call(this,{loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const _0=/^[a-z][a-z0-9\-+.]+:/i;function C0(d){if(_0.test(d))return new URL(d);const t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(d))}class T0{constructor(t){this.source=t,this.url=C0(t.url),Z(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return Z(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new x0(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new P0(this,t,e);return this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}}class x0{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const s=process.getBuiltinModule("fs");s.promises.lstat(this._url).then(i=>{this._contentLength=i.size,this._setReadableStream(s.createReadStream(this._url)),this._headersCapability.resolve()},i=>{i.code==="ENOENT"&&(i=Fu(0,this._url.href)),this._storedError=i,this._headersCapability.reject(i)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var s;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,(s=this.onProgress)==null||s.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new an("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class P0{constructor(t,e,s){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const i=t.source;this._isStreamingSupported=!i.disableStream;const r=process.getBuiltinModule("fs");this._setReadableStream(r.createReadStream(this._url,{start:e,end:s-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){var s;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,(s=this.onProgress)==null||s.call(this,{loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const Eh=Symbol("INITIAL_DATA");var Ve,ad,Mm;class IA{constructor(){f(this,ad);f(this,Ve,Object.create(null))}get(t,e=null){if(e){const i=b(this,ad,Mm).call(this,t);return i.promise.then(()=>e(i.data)),null}const s=n(this,Ve)[t];if(!s||s.data===Eh)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return s.data}has(t){const e=n(this,Ve)[t];return!!e&&e.data!==Eh}delete(t){const e=n(this,Ve)[t];return!e||e.data===Eh?!1:(delete n(this,Ve)[t],!0)}resolve(t,e=null){const s=b(this,ad,Mm).call(this,t);s.data=e,s.resolve()}clear(){var t;for(const e in n(this,Ve)){const{data:s}=n(this,Ve)[e];(t=s==null?void 0:s.bitmap)==null||t.close()}p(this,Ve,Object.create(null))}*[Symbol.iterator](){for(const t in n(this,Ve)){const{data:e}=n(this,Ve)[t];e!==Eh&&(yield[t,e])}}}Ve=new WeakMap,ad=new WeakSet,Mm=function(t){var e;return(e=n(this,Ve))[t]||(e[t]={...Promise.withResolvers(),data:Eh})};const R0=1e5,gy=30;var xy,Nn,Le,od,ld,na,Hi,hd,cd,ra,hl,cl,On,dl,dd,ul,aa,ud,fd,Et,fl,oa,pd,Bn,pl,Cp,FA,Tp,NA,gd,Lm,gl,af,md,Im,xp,OA,Pp,BA;let Qh=(Et=class{constructor({textContentSource:t,container:e,viewport:s}){f(this,Cp);f(this,Tp);f(this,gd);f(this,Nn,Promise.withResolvers());f(this,Le,null);f(this,od,!1);f(this,ld,!!((xy=globalThis.FontInspector)!=null&&xy.enabled));f(this,na,null);f(this,Hi,null);f(this,hd,0);f(this,cd,0);f(this,ra,null);f(this,hl,null);f(this,cl,0);f(this,On,0);f(this,dl,Object.create(null));f(this,dd,[]);f(this,ul,null);f(this,aa,[]);f(this,ud,new WeakMap);f(this,fd,null);var l;if(t instanceof ReadableStream)p(this,ul,t);else if(typeof t=="object")p(this,ul,new ReadableStream({start(h){h.enqueue(t),h.close()}}));else throw new Error('No "textContentSource" parameter specified.');p(this,Le,p(this,hl,e)),p(this,On,s.scale*Us.pixelRatio),p(this,cl,s.rotation),p(this,Hi,{div:null,properties:null,ctx:null});const{pageWidth:i,pageHeight:r,pageX:a,pageY:o}=s.rawDims;p(this,fd,[1,0,0,-1,-a,o+r]),p(this,cd,i),p(this,hd,r),b(l=Et,xp,OA).call(l),dr(e,s),n(this,Nn).promise.finally(()=>{n(Et,pl).delete(this),p(this,Hi,null),p(this,dl,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=Zt.platform;return q(this,"fontFamilyMap",new Map([["sans-serif",`${t&&e?"Calibri, ":""}sans-serif`],["monospace",`${t&&e?"Lucida Console, ":""}monospace`]]))}render(){const t=()=>{n(this,ra).read().then(({value:e,done:s})=>{if(s){n(this,Nn).resolve();return}n(this,na)??p(this,na,e.lang),Object.assign(n(this,dl),e.styles),b(this,Cp,FA).call(this,e.items),t()},n(this,Nn).reject)};return p(this,ra,n(this,ul).getReader()),n(Et,pl).add(this),t(),n(this,Nn).promise}update({viewport:t,onBefore:e=null}){var r;const s=t.scale*Us.pixelRatio,i=t.rotation;if(i!==n(this,cl)&&(e==null||e(),p(this,cl,i),dr(n(this,hl),{rotation:i})),s!==n(this,On)){e==null||e(),p(this,On,s);const a={div:null,properties:null,ctx:b(r=Et,gl,af).call(r,n(this,na))};for(const o of n(this,aa))a.properties=n(this,ud).get(o),a.div=o,b(this,gd,Lm).call(this,a)}}cancel(){var e;const t=new an("TextLayer task cancelled.");(e=n(this,ra))==null||e.cancel(t).catch(()=>{}),p(this,ra,null),n(this,Nn).reject(t)}get textDivs(){return n(this,aa)}get textContentItemsStr(){return n(this,dd)}static cleanup(){if(!(n(this,pl).size>0)){n(this,fl).clear();for(const{canvas:t}of n(this,oa).values())t.remove();n(this,oa).clear()}}},Nn=new WeakMap,Le=new WeakMap,od=new WeakMap,ld=new WeakMap,na=new WeakMap,Hi=new WeakMap,hd=new WeakMap,cd=new WeakMap,ra=new WeakMap,hl=new WeakMap,cl=new WeakMap,On=new WeakMap,dl=new WeakMap,dd=new WeakMap,ul=new WeakMap,aa=new WeakMap,ud=new WeakMap,fd=new WeakMap,fl=new WeakMap,oa=new WeakMap,pd=new WeakMap,Bn=new WeakMap,pl=new WeakMap,Cp=new WeakSet,FA=function(t){var i,r;if(n(this,od))return;(r=n(this,Hi)).ctx??(r.ctx=b(i=Et,gl,af).call(i,n(this,na)));const e=n(this,aa),s=n(this,dd);for(const a of t){if(e.length>R0){V("Ignoring additional textDivs for performance reasons."),p(this,od,!0);return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const o=n(this,Le);p(this,Le,document.createElement("span")),n(this,Le).classList.add("markedContent"),a.id&&n(this,Le).setAttribute("id",`${a.id}`),o.append(n(this,Le))}else a.type==="endMarkedContent"&&p(this,Le,n(this,Le).parentNode);continue}s.push(a.str),b(this,Tp,NA).call(this,a)}},Tp=new WeakSet,NA=function(t){var y;const e=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};n(this,aa).push(e);const i=O.transform(n(this,fd),t.transform);let r=Math.atan2(i[1],i[0]);const a=n(this,dl)[t.fontName];a.vertical&&(r+=Math.PI/2);let o=n(this,ld)&&a.fontSubstitution||a.fontFamily;o=Et.fontFamilyMap.get(o)||o;const l=Math.hypot(i[2],i[3]),h=l*b(y=Et,Pp,BA).call(y,o,a,n(this,na));let c,u;r===0?(c=i[4],u=i[5]-h):(c=i[4]+h*Math.sin(r),u=i[5]-h*Math.cos(r));const g="calc(var(--total-scale-factor) *",m=e.style;n(this,Le)===n(this,hl)?(m.left=`${(100*c/n(this,cd)).toFixed(2)}%`,m.top=`${(100*u/n(this,hd)).toFixed(2)}%`):(m.left=`${g}${c.toFixed(2)}px)`,m.top=`${g}${u.toFixed(2)}px)`),m.fontSize=`${g}${(n(Et,Bn)*l).toFixed(2)}px)`,m.fontFamily=o,s.fontSize=l,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,n(this,ld)&&(e.dataset.fontName=a.fontSubstitutionLoadedName||t.fontName),r!==0&&(s.angle=r*(180/Math.PI));let A=!1;if(t.str.length>1)A=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const v=Math.abs(t.transform[0]),w=Math.abs(t.transform[3]);v!==w&&Math.max(v,w)/Math.min(v,w)>1.5&&(A=!0)}if(A&&(s.canvasWidth=a.vertical?t.height:t.width),n(this,ud).set(e,s),n(this,Hi).div=e,n(this,Hi).properties=s,b(this,gd,Lm).call(this,n(this,Hi)),s.hasText&&n(this,Le).append(e),s.hasEOL){const v=document.createElement("br");v.setAttribute("role","presentation"),n(this,Le).append(v)}},gd=new WeakSet,Lm=function(t){var o;const{div:e,properties:s,ctx:i}=t,{style:r}=e;let a="";if(n(Et,Bn)>1&&(a=`scale(${1/n(Et,Bn)})`),s.canvasWidth!==0&&s.hasText){const{fontFamily:l}=r,{canvasWidth:h,fontSize:c}=s;b(o=Et,md,Im).call(o,i,c*n(this,On),l);const{width:u}=i.measureText(e.textContent);u>0&&(a=`scaleX(${h*n(this,On)/u}) ${a}`)}s.angle!==0&&(a=`rotate(${s.angle}deg) ${a}`),a.length>0&&(r.transform=a)},gl=new WeakSet,af=function(t=null){let e=n(this,oa).get(t||(t=""));if(!e){const s=document.createElement("canvas");s.className="hiddenCanvasElement",s.lang=t,document.body.append(s),e=s.getContext("2d",{alpha:!1,willReadFrequently:!0}),n(this,oa).set(t,e),n(this,pd).set(e,{size:0,family:""})}return e},md=new WeakSet,Im=function(t,e,s){const i=n(this,pd).get(t);e===i.size&&s===i.family||(t.font=`${e}px ${s}`,i.size=e,i.family=s)},xp=new WeakSet,OA=function(){if(n(this,Bn)!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),p(this,Bn,t.getBoundingClientRect().height),t.remove()},Pp=new WeakSet,BA=function(t,e,s){const i=n(this,fl).get(t);if(i)return i;const r=b(this,gl,af).call(this,s);r.canvas.width=r.canvas.height=gy,b(this,md,Im).call(this,r,gy,t);const a=r.measureText(""),o=a.fontBoundingBoxAscent,l=Math.abs(a.fontBoundingBoxDescent);r.canvas.width=r.canvas.height=0;let h=.8;return o?h=o/(o+l):(Zt.platform.isFirefox&&V("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?h=e.ascent:e.descent&&(h=1+e.descent)),n(this,fl).set(t,h),h},f(Et,gl),f(Et,md),f(Et,xp),f(Et,Pp),f(Et,fl,new Map),f(Et,oa,new Map),f(Et,pd,new WeakMap),f(Et,Bn,null),f(Et,pl,new Set),Et);const k0=100;function Lb(d={}){typeof d=="string"||d instanceof URL?d={url:d}:(d instanceof ArrayBuffer||ArrayBuffer.isView(d))&&(d={data:d});const t=new Fm,{docId:e}=t,s=d.url?Bv(d.url):null,i=d.data?Hv(d.data):null,r=d.httpHeaders||null,a=d.withCredentials===!0,o=d.password??null,l=d.range instanceof Ib?d.range:null,h=Number.isInteger(d.rangeChunkSize)&&d.rangeChunkSize>0?d.rangeChunkSize:2**16;let c=d.worker instanceof bh?d.worker:null;const u=d.verbosity,g=typeof d.docBaseUrl=="string"&&!Lu(d.docBaseUrl)?d.docBaseUrl:null,m=$u(d.cMapUrl),A=d.cMapPacked!==!1,y=d.CMapReaderFactory||(Te?Wv:ey),v=$u(d.iccUrl),w=$u(d.standardFontDataUrl),E=d.StandardFontDataFactory||(Te?Xv:sy),S=$u(d.wasmUrl),_=d.WasmFactory||(Te?qv:iy),C=d.stopAtErrors!==!0,T=Number.isInteger(d.maxImageSize)&&d.maxImageSize>-1?d.maxImageSize:-1,x=d.isEvalSupported!==!1,P=typeof d.isOffscreenCanvasSupported=="boolean"?d.isOffscreenCanvasSupported:!Te,R=typeof d.isImageDecoderSupported=="boolean"?d.isImageDecoderSupported:!Te&&(Zt.platform.isFirefox||!globalThis.chrome),D=Number.isInteger(d.canvasMaxAreaInBytes)?d.canvasMaxAreaInBytes:-1,M=typeof d.disableFontFace=="boolean"?d.disableFontFace:Te,L=d.fontExtraProperties===!0,j=d.enableXfa===!0,F=d.ownerDocument||globalThis.document,G=d.disableRange===!0,N=d.disableStream===!0,I=d.disableAutoFetch===!0,Y=d.pdfBug===!0,Q=d.CanvasFactory||(Te?Vv:jv),Gt=d.FilterFactory||(Te?zv:Gv),Oe=d.enableHWA===!0,tt=d.useWasm!==!1,st=l?l.length:d.length??NaN,zt=typeof d.useSystemFonts=="boolean"?d.useSystemFonts:!Te&&!M,te=typeof d.useWorkerFetch=="boolean"?d.useWorkerFetch:!!(y===ey&&E===sy&&_===iy&&m&&w&&S&&Ch(m,document.baseURI)&&Ch(w,document.baseURI)&&Ch(S,document.baseURI)),he=null;Av(u);const ht={canvasFactory:new Q({ownerDocument:F,enableHWA:Oe}),filterFactory:new Gt({docId:e,ownerDocument:F}),cMapReaderFactory:te?null:new y({baseUrl:m,isCompressed:A}),standardFontDataFactory:te?null:new E({baseUrl:w}),wasmFactory:te?null:new _({baseUrl:S})};c||(c=bh.create({verbosity:u,port:Hs.workerPort}),t._worker=c);const vs={docId:e,apiVersion:"5.4.296",data:i,password:o,disableAutoFetch:I,rangeChunkSize:h,length:st,docBaseUrl:g,enableXfa:j,evaluatorOptions:{maxImageSize:T,disableFontFace:M,ignoreErrors:C,isEvalSupported:x,isOffscreenCanvasSupported:P,isImageDecoderSupported:R,canvasMaxAreaInBytes:D,fontExtraProperties:L,useSystemFonts:zt,useWasm:tt,useWorkerFetch:te,cMapUrl:m,iccUrl:v,standardFontDataUrl:w,wasmUrl:S}},$s={ownerDocument:F,pdfBug:Y,styleElement:he,loadingParams:{disableAutoFetch:I,enableXfa:j}};return c.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const mi=c.messageHandler.sendWithPromise("GetDocRequest",vs,i?[i.buffer]:null);let we;if(l)we=new u0(l,{disableRange:G,disableStream:N});else if(!i){if(!s)throw new Error("getDocument - no `url` parameter provided.");const bt=Ch(s)?m0:Te?T0:v0;we=new bt({url:s,length:st,httpHeaders:r,withCredentials:a,rangeChunkSize:h,disableRange:G,disableStream:N})}return mi.then(bt=>{if(t.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const yt=new Dh(e,bt,c.port),Bt=new L0(yt,t,we,$s,ht,Oe);t._transport=Bt,yt.send("Ready",null)})}).catch(t._capability.reject),t}var Rp;const kp=class kp{constructor(){k(this,"_capability",Promise.withResolvers());k(this,"_transport",null);k(this,"_worker",null);k(this,"docId",`d${Ht(kp,Rp)._++}`);k(this,"destroyed",!1);k(this,"onPassword",null);k(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var t,e,s,i;this.destroyed=!0;try{(t=this._worker)!=null&&t.port&&(this._worker._pendingDestroy=!0),await((e=this._transport)==null?void 0:e.destroy())}catch(r){throw(s=this._worker)!=null&&s.port&&delete this._worker._pendingDestroy,r}this._transport=null,(i=this._worker)==null||i.destroy(),this._worker=null}async getData(){return this._transport.getData()}};Rp=new WeakMap,f(kp,Rp,0);let Fm=kp;var la,bd,yd,Ad,wd,Py;let Ib=(Py=class{constructor(t,e,s=!1,i=null){f(this,la,Promise.withResolvers());f(this,bd,[]);f(this,yd,[]);f(this,Ad,[]);f(this,wd,[]);this.length=t,this.initialData=e,this.progressiveDone=s,this.contentDispositionFilename=i}addRangeListener(t){n(this,wd).push(t)}addProgressListener(t){n(this,Ad).push(t)}addProgressiveReadListener(t){n(this,yd).push(t)}addProgressiveDoneListener(t){n(this,bd).push(t)}onDataRange(t,e){for(const s of n(this,wd))s(t,e)}onDataProgress(t,e){n(this,la).promise.then(()=>{for(const s of n(this,Ad))s(t,e)})}onDataProgressiveRead(t){n(this,la).promise.then(()=>{for(const e of n(this,yd))e(t)})}onDataProgressiveDone(){n(this,la).promise.then(()=>{for(const t of n(this,bd))t()})}transportReady(){n(this,la).resolve()}requestDataRange(t,e){ft("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}},la=new WeakMap,bd=new WeakMap,yd=new WeakMap,Ad=new WeakMap,wd=new WeakMap,Py);class D0{constructor(t,e){this._pdfInfo=t,this._transport=e}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 q(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAnnotationsByType(t,e){return this._transport.getAnnotationsByType(t,e)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}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()}}var Ui,ha,Bh;class M0{constructor(t,e,s,i=!1){f(this,ha);f(this,Ui,!1);this._pageIndex=t,this._pageInfo=e,this._transport=s,this._stats=i?new qb:null,this._pdfBug=i,this.commonObjs=s.commonObjs,this.objs=new IA,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:t,rotation:e=this.rotate,offsetX:s=0,offsetY:i=0,dontFlip:r=!1}={}){return new Mu({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:s,offsetY:i,dontFlip:r})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return q(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return((t=this._transport._htmlForXfa)==null?void 0:t.children[this._pageIndex])||null}render({canvasContext:t,canvas:e=t.canvas,viewport:s,intent:i="display",annotationMode:r=gi.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:h=null,pageColors:c=null,printAnnotationStorage:u=null,isEditing:g=!1,recordOperations:m=!1,operationsFilter:A=null}){var R,D,M;(R=this._stats)==null||R.time("Overall");const y=this._transport.getRenderingIntent(i,r,u,g),{renderingIntent:v,cacheKey:w}=y;p(this,Ui,!1),l||(l=this._transport.getOptionalContentConfig(v));let E=this._intentStates.get(w);E||(E=Object.create(null),this._intentStates.set(w,E)),E.streamReaderCancelTimeout&&(clearTimeout(E.streamReaderCancelTimeout),E.streamReaderCancelTimeout=null);const S=!!(v&ns.PRINT);E.displayReadyCapability||(E.displayReadyCapability=Promise.withResolvers(),E.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(D=this._stats)==null||D.time("Page Request"),this._pumpOperatorList(y));const _=!!(this._pdfBug&&((M=globalThis.StepperManager)!=null&&M.enabled)),C=!this.recordedBBoxes&&(m||_),T=L=>{var j,F;if(E.renderTasks.delete(x),C){const G=(j=x.gfx)==null?void 0:j.dependencyTracker.take();G&&(x.stepper&&x.stepper.setOperatorBBoxes(G,x.gfx.dependencyTracker.takeDebugMetadata()),m&&(this.recordedBBoxes=G))}S&&p(this,Ui,!0),b(this,ha,Bh).call(this),L?(x.capability.reject(L),this._abortOperatorList({intentState:E,reason:L instanceof Error?L:new Error(L)})):x.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(F=globalThis.Stats)!=null&&F.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},x=new Nm({callback:T,params:{canvas:e,canvasContext:t,dependencyTracker:C?new Kv(e,E.operatorList.length,_):null,viewport:s,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:E.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!S,pdfBug:this._pdfBug,pageColors:c,enableHWA:this._transport.enableHWA,operationsFilter:A});(E.renderTasks||(E.renderTasks=new Set)).add(x);const P=x.task;return Promise.all([E.displayReadyCapability.promise,l]).then(([L,j])=>{var F;if(this.destroyed){T();return}if((F=this._stats)==null||F.time("Rendering"),!(j.renderingIntent&v))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");x.initializeGraphics({transparency:L,optionalContentConfig:j}),x.operatorListChanged()}).catch(T),P}getOperatorList({intent:t="display",annotationMode:e=gi.ENABLE,printAnnotationStorage:s=null,isEditing:i=!1}={}){var h;function r(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}const a=this._transport.getRenderingIntent(t,e,s,i,!0);let o=this._intentStates.get(a.cacheKey);o||(o=Object.create(null),this._intentStates.set(a.cacheKey,o));let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=r,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||(o.renderTasks=new Set)).add(l),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(h=this._stats)==null||h.time("Page Request"),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:e===!0},{highWaterMark:100,size(i){return i.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(s=>Yh.textContent(s));const e=this.streamTextContent(t);return new Promise(function(s,i){function r(){a.read().then(function({value:l,done:h}){if(h){s(o);return}o.lang??(o.lang=l.lang),Object.assign(o.styles,l.styles),o.items.push(...l.items),r()},i)}const a=e.getReader(),o={items:[],styles:Object.create(null),lang:null};r()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const s of e.renderTasks)t.push(s.completed),s.cancel();return this.objs.clear(),p(this,Ui,!1),Promise.all(t)}cleanup(t=!1){p(this,Ui,!0);const e=b(this,ha,Bh).call(this);return t&&e&&this._stats&&(this._stats=new qb),e}_startRenderPage(t,e){var i,r;const s=this._intentStates.get(e);s&&((i=this._stats)==null||i.timeEnd("Page Request"),(r=s.displayReadyCapability)==null||r.resolve(t))}_renderPageChunk(t,e){for(let s=0,i=t.length;s<i;s++)e.operatorList.fnArray.push(t.fnArray[s]),e.operatorList.argsArray.push(t.argsArray[s]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const s of e.renderTasks)s.operatorListChanged();t.lastChunk&&b(this,ha,Bh).call(this)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:s,modifiedIds:i}){const{map:r,transfer:a}=s,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:r,modifiedIds:i},a).getReader(),h=this._intentStates.get(e);h.streamReader=l;const c=()=>{l.read().then(({value:u,done:g})=>{if(g){h.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(u,h),c())},u=>{if(h.streamReader=null,!this._transport.destroyed){if(h.operatorList){h.operatorList.lastChunk=!0;for(const g of h.renderTasks)g.operatorListChanged();b(this,ha,Bh).call(this)}if(h.displayReadyCapability)h.displayReadyCapability.reject(u);else if(h.opListReadCapability)h.opListReadCapability.reject(u);else throw u}})};c()}_abortOperatorList({intentState:t,reason:e,force:s=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!s){if(t.renderTasks.size>0)return;if(e instanceof Mg){let i=k0;e.extraDelay>0&&e.extraDelay<1e3&&(i+=e.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},i);return}}if(t.streamReader.cancel(new an(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[i,r]of this._intentStates)if(r===t){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}Ui=new WeakMap,ha=new WeakSet,Bh=function(){if(!n(this,Ui)||this.destroyed)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),p(this,Ui,!1),!0};var Hn,Ds,$i,ca,Dp,da,ua,ml,of,Mp,HA,Lp,UA,fa,Hh,bl,lf;const At=class At{constructor({name:t=null,port:e=null,verbosity:s=wv()}={}){f(this,ml);f(this,Mp);f(this,Lp);f(this,fa);f(this,Hn,Promise.withResolvers());f(this,Ds,null);f(this,$i,null);f(this,ca,null);if(this.name=t,this.destroyed=!1,this.verbosity=s,e){if(n(At,ua).has(e))throw new Error("Cannot use more than one PDFWorker per port.");n(At,ua).set(e,this),b(this,Mp,HA).call(this,e)}else b(this,Lp,UA).call(this)}get promise(){return n(this,Hn).promise}get port(){return n(this,$i)}get messageHandler(){return n(this,Ds)}destroy(){var t,e;this.destroyed=!0,(t=n(this,ca))==null||t.terminate(),p(this,ca,null),n(At,ua).delete(n(this,$i)),p(this,$i,null),(e=n(this,Ds))==null||e.destroy(),p(this,Ds,null)}static create(t){const e=n(this,ua).get(t==null?void 0:t.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new At(t)}static get workerSrc(){if(Hs.workerSrc)return Hs.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return q(this,"_setupFakeWorkerGlobal",(async()=>n(this,bl,lf)?n(this,bl,lf):(await mv(()=>import(this.workerSrc),[])).WorkerMessageHandler)())}};Hn=new WeakMap,Ds=new WeakMap,$i=new WeakMap,ca=new WeakMap,Dp=new WeakMap,da=new WeakMap,ua=new WeakMap,ml=new WeakSet,of=function(){n(this,Hn).resolve(),n(this,Ds).send("configure",{verbosity:this.verbosity})},Mp=new WeakSet,HA=function(t){p(this,$i,t),p(this,Ds,new Dh("main","worker",t)),n(this,Ds).on("ready",()=>{}),b(this,ml,of).call(this)},Lp=new WeakSet,UA=function(){if(n(At,da)||n(At,bl,lf)){b(this,fa,Hh).call(this);return}let{workerSrc:t}=At;try{At._isSameOrigin(window.location,t)||(t=At._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),s=new Dh("main","worker",e),i=()=>{r.abort(),s.destroy(),e.terminate(),this.destroyed?n(this,Hn).reject(new Error("Worker was destroyed")):b(this,fa,Hh).call(this)},r=new AbortController;e.addEventListener("error",()=>{n(this,ca)||i()},{signal:r.signal}),s.on("test",o=>{if(r.abort(),this.destroyed||!o){i();return}p(this,Ds,s),p(this,$i,e),p(this,ca,e),b(this,ml,of).call(this)}),s.on("ready",o=>{if(r.abort(),this.destroyed){i();return}try{a()}catch{b(this,fa,Hh).call(this)}});const a=()=>{const o=new Uint8Array;s.send("test",o,[o.buffer])};a();return}catch{Dg("The worker has been disabled.")}b(this,fa,Hh).call(this)},fa=new WeakSet,Hh=function(){n(At,da)||(V("Setting up fake worker."),p(At,da,!0)),At._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){n(this,Hn).reject(new Error("Worker was destroyed"));return}const e=new $v;p(this,$i,e);const s=`fake${Ht(At,Dp)._++}`,i=new Dh(s+"_worker",s,e);t.setup(i,e),p(this,Ds,new Dh(s,s+"_worker",e)),b(this,ml,of).call(this)}).catch(t=>{n(this,Hn).reject(new Error(`Setting up fake worker failed: "${t.message}".`))})},bl=new WeakSet,lf=function(){var t;try{return((t=globalThis.pdfjsWorker)==null?void 0:t.WorkerMessageHandler)||null}catch{return null}},f(At,bl),f(At,Dp,0),f(At,da,!1),f(At,ua,new WeakMap),Te&&(p(At,da,!0),Hs.workerSrc||(Hs.workerSrc="./pdf.worker.mjs")),At._isSameOrigin=(t,e)=>{const s=URL.parse(t);if(!(s!=null&&s.origin)||s.origin==="null")return!1;const i=new URL(e,s);return s.origin===i.origin},At._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},At.fromPort=t=>{if(Rv("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!(t!=null&&t.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return At.create(t)};let bh=At;var ji,ni,yl,Al,Gi,pa,Uh;class L0{constructor(t,e,s,i,r,a){f(this,pa);f(this,ji,new Map);f(this,ni,new Map);f(this,yl,new Map);f(this,Al,new Map);f(this,Gi,null);this.messageHandler=t,this.loadingTask=e,this.commonObjs=new IA,this.fontLoader=new Nv({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.cMapReaderFactory=r.cMapReaderFactory,this.standardFontDataFactory=r.standardFontDataFactory,this.wasmFactory=r.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=s,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=a,this.setupMessageHandler()}get annotationStorage(){return q(this,"annotationStorage",new kb)}getRenderingIntent(t,e=gi.ENABLE,s=null,i=!1,r=!1){let a=ns.DISPLAY,o=Am;switch(t){case"any":a=ns.ANY;break;case"display":break;case"print":a=ns.PRINT;break;default:V(`getRenderingIntent - invalid intent: ${t}`)}const l=a&ns.PRINT&&s instanceof bA?s:this.annotationStorage;switch(e){case gi.DISABLE:a+=ns.ANNOTATIONS_DISABLE;break;case gi.ENABLE:break;case gi.ENABLE_FORMS:a+=ns.ANNOTATIONS_FORMS;break;case gi.ENABLE_STORAGE:a+=ns.ANNOTATIONS_STORAGE,o=l.serializable;break;default:V(`getRenderingIntent - invalid annotationMode: ${e}`)}i&&(a+=ns.IS_EDITING),r&&(a+=ns.OPLIST);const{ids:h,hash:c}=l.modifiedIds,u=[a,o.hash,c];return{renderingIntent:a,cacheKey:u.join("_"),annotationStorageSerializable:o,modifiedIds:h}}destroy(){var s;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(s=n(this,Gi))==null||s.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const i of n(this,ni).values())t.push(i._destroy());n(this,ni).clear(),n(this,yl).clear(),n(this,Al).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{var i,r;this.commonObjs.clear(),this.fontLoader.clear(),n(this,ji).clear(),this.filterFactory.destroy(),Qh.cleanup(),(i=this._networkStream)==null||i.cancelAllRequests(new an("Worker was terminated.")),(r=this.messageHandler)==null||r.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(s,i)=>{Z(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=r=>{this._lastProgress={loaded:r.loaded,total:r.total}},i.onPull=()=>{this._fullReader.read().then(function({value:r,done:a}){if(a){i.close();return}Z(r instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(r),1,[r])}).catch(r=>{i.error(r)})},i.onCancel=r=>{this._fullReader.cancel(r),i.ready.catch(a=>{if(!this.destroyed)throw a})}}),t.on("ReaderHeadersReady",async s=>{var o;await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:r,contentLength:a}=this._fullReader;return(!i||!r)&&(this._lastProgress&&((o=e.onProgress)==null||o.call(e,this._lastProgress)),this._fullReader.onProgress=l=>{var h;(h=e.onProgress)==null||h.call(e,{loaded:l.loaded,total:l.total})}),{isStreamingSupported:i,isRangeSupported:r,contentLength:a}}),t.on("GetRangeReader",(s,i)=>{Z(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(s.begin,s.end);if(!r){i.close();return}i.onPull=()=>{r.read().then(function({value:a,done:o}){if(o){i.close();return}Z(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{i.error(a)})},i.onCancel=a=>{r.cancel(a),i.ready.catch(o=>{if(!this.destroyed)throw o})}}),t.on("GetDoc",({pdfInfo:s})=>{this._numPages=s.numPages,this._htmlForXfa=s.htmlForXfa,delete s.htmlForXfa,e._capability.resolve(new D0(s,this))}),t.on("DocException",s=>{e._capability.reject(xe(s))}),t.on("PasswordRequest",s=>{p(this,Gi,Promise.withResolvers());try{if(!e.onPassword)throw xe(s);const i=r=>{r instanceof Error?n(this,Gi).reject(r):n(this,Gi).resolve({password:r})};e.onPassword(i,s.code)}catch(i){n(this,Gi).reject(i)}return n(this,Gi).promise}),t.on("DataLoaded",s=>{var i;(i=e.onProgress)==null||i.call(e,{loaded:s.length,total:s.length}),this.downloadInfoCapability.resolve(s)}),t.on("StartRenderPage",s=>{if(this.destroyed)return;n(this,ni).get(s.pageIndex)._startRenderPage(s.transparency,s.cacheKey)}),t.on("commonobj",([s,i,r])=>{var a;if(this.destroyed||this.commonObjs.has(s))return null;switch(i){case"Font":if("error"in r){const u=r.error;V(`Error during font loading: ${u}`),this.commonObjs.resolve(s,u);break}const o=new km(r),l=this._params.pdfBug&&((a=globalThis.FontInspector)!=null&&a.enabled)?(u,g)=>globalThis.FontInspector.fontAdded(u,g):null,h=new Ov(o,l,r.extra,r.charProcOperatorList);this.fontLoader.bind(h).catch(()=>t.sendWithPromise("FontFallback",{id:s})).finally(()=>{!h.fontExtraProperties&&h.data&&h.clearData(),this.commonObjs.resolve(s,h)});break;case"CopyLocalImage":const{imageRef:c}=r;Z(c,"The imageRef must be defined.");for(const u of n(this,ni).values())for(const[,g]of u.objs)if((g==null?void 0:g.ref)===c)return g.dataLen?(this.commonObjs.resolve(s,structuredClone(g)),g.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(s,r);break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),t.on("obj",([s,i,r,a])=>{var l;if(this.destroyed)return;const o=n(this,ni).get(i);if(!o.objs.has(s)){if(o._intentStates.size===0){(l=a==null?void 0:a.bitmap)==null||l.close();return}switch(r){case"Image":case"Pattern":o.objs.resolve(s,a);break;default:throw new Error(`Got unknown object type ${r}`)}}}),t.on("DocProgress",s=>{var i;this.destroyed||(i=e.onProgress)==null||i.call(e,{loaded:s.loaded,total:s.total})}),t.on("FetchBinaryData",async s=>{if(this.destroyed)throw new Error("Worker was destroyed.");const i=this[s.type];if(!i)throw new Error(`${s.type} not initialized, see the \`useWorkerFetch\` parameter.`);return i.fetch(s)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var s;this.annotationStorage.size<=0&&V("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:((s=this._fullReader)==null?void 0:s.filename)??null},e).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,s=n(this,yl).get(e);if(s)return s;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(r=>{if(this.destroyed)throw new Error("Transport destroyed");r.refStr&&n(this,Al).set(r.refStr,t);const a=new M0(e,r,this,this._params.pdfBug);return n(this,ni).set(e,a),a});return n(this,yl).set(e,i),i}getPageIndex(t){return wm(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return b(this,pa,Uh).call(this,"GetFieldObjects")}hasJSActions(){return b(this,pa,Uh).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAnnotationsByType(t,e){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:e})}getDocJSActions(){return b(this,pa,Uh).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return b(this,pa,Uh).call(this,"GetOptionalContentConfig").then(e=>new d0(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=n(this,ji).get(t);if(e)return e;const s=this.messageHandler.sendWithPromise(t,null).then(i=>{var r,a;return{info:i[0],metadata:i[1]?new h0(i[1]):null,contentDispositionFilename:((r=this._fullReader)==null?void 0:r.filename)??null,contentLength:((a=this._fullReader)==null?void 0:a.contentLength)??null}});return n(this,ji).set(t,s),s}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of n(this,ni).values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),n(this,ji).clear(),this.filterFactory.destroy(!0),Qh.cleanup()}}cachedPageNumber(t){if(!wm(t))return null;const e=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return n(this,Al).get(e)??null}}ji=new WeakMap,ni=new WeakMap,yl=new WeakMap,Al=new WeakMap,Gi=new WeakMap,pa=new WeakSet,Uh=function(t,e=null){const s=n(this,ji).get(t);if(s)return s;const i=this.messageHandler.sendWithPromise(t,e);return n(this,ji).set(t,i),i};var Un;class I0{constructor(t){f(this,Un,null);k(this,"onContinue",null);k(this,"onError",null);p(this,Un,t)}get promise(){return n(this,Un).capability.promise}cancel(t=0){n(this,Un).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=n(this,Un).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=n(this,Un);return t.form||t.canvas&&(e==null?void 0:e.size)>0}}Un=new WeakMap;var $n,ga;const yr=class yr{constructor({callback:t,params:e,objs:s,commonObjs:i,annotationCanvasMap:r,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:h,useRequestAnimationFrame:c=!1,pdfBug:u=!1,pageColors:g=null,enableHWA:m=!1,operationsFilter:A=null}){f(this,$n,null);this.callback=t,this.params=e,this.objs=s,this.commonObjs=i,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=h,this._pdfBug=u,this.pageColors=g,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=c===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new I0(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=e.canvas,this._canvasContext=e.canvas?null:e.canvasContext,this._enableHWA=m,this._dependencyTracker=e.dependencyTracker,this._operationsFilter=A}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){var l,h;if(this.cancelled)return;if(this._canvas){if(n(yr,ga).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.");n(yr,ga).add(this._canvas)}this._pdfBug&&((l=globalThis.StepperManager)!=null&&l.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:s,transform:i,background:r,dependencyTracker:a}=this.params,o=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new po(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors,a),this.gfx.beginDrawing({transform:i,viewport:s,transparency:t,background:r}),this.operatorListIdx=0,this.graphicsReady=!0,(h=this.graphicsReadyCallback)==null||h.call(this)}cancel(t=null,e=0){var s,i,r;this.running=!1,this.cancelled=!0,(s=this.gfx)==null||s.endDrawing(),n(this,$n)&&(window.cancelAnimationFrame(n(this,$n)),p(this,$n,null)),n(yr,ga).delete(this._canvas),t||(t=new Mg(`Rendering cancelled, page ${this._pageIndex+1}`,e)),this.callback(t),(r=(i=this.task).onError)==null||r.call(i,t)}operatorListChanged(){var t,e;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(t=this.gfx.dependencyTracker)==null||t.growOperationsCount(this.operatorList.fnArray.length),(e=this.stepper)==null||e.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?p(this,$n,window.requestAnimationFrame(()=>{p(this,$n,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(),n(yr,ga).delete(this._canvas),this.callback())))}};$n=new WeakMap,ga=new WeakMap,f(yr,ga,new WeakSet);let Nm=yr;const $A="5.4.296",jA="f56dc8601";var We,ma,wl,jt,vd,vl,zi,Ed,jn,Ms,Sd,_d,Om,Cd,Bm,Td,Hm,Vi,pr,Ip,GA,ri,cn;const Pe=class Pe{constructor({editor:t=null,uiManager:e=null}){f(this,_d);f(this,Cd);f(this,Td);f(this,Vi);f(this,Ip);f(this,ri);f(this,We,null);f(this,ma,null);f(this,wl,void 0);f(this,jt,null);f(this,vd,!1);f(this,vl,!1);f(this,zi,null);f(this,Ed,void 0);f(this,jn,null);f(this,Ms,null);var s,i;t?(p(this,vl,!1),p(this,zi,t)):p(this,vl,!0),p(this,Ms,(t==null?void 0:t._uiManager)||e),p(this,Ed,n(this,Ms)._eventBus),p(this,wl,((s=t==null?void 0:t.color)==null?void 0:s.toUpperCase())||((i=n(this,Ms))==null?void 0:i.highlightColors.values().next().value)||"#FFFF98"),n(Pe,Sd)||p(Pe,Sd,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"}))}static get _keyboardManager(){return q(this,"_keyboardManager",new Iu([[["Escape","mac+Escape"],Pe.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Pe.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Pe.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Pe.prototype._moveToPrevious],[["Home","mac+Home"],Pe.prototype._moveToBeginning],[["End","mac+End"],Pe.prototype._moveToEnd]]))}renderButton(){const t=p(this,We,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",n(this,zi)&&(t.ariaControls=`${n(this,zi).id}_colorpicker_dropdown`);const e=n(this,Ms)._signal;t.addEventListener("click",b(this,Vi,pr).bind(this),{signal:e}),t.addEventListener("keydown",b(this,Td,Hm).bind(this),{signal:e});const s=p(this,ma,document.createElement("span"));return s.className="swatch",s.ariaHidden="true",s.style.backgroundColor=n(this,wl),t.append(s),t}renderMainDropdown(){const t=p(this,jt,b(this,_d,Om).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===n(this,We)){b(this,Vi,pr).call(this,t);return}const e=t.target.getAttribute("data-color");e&&b(this,Cd,Bm).call(this,e,t)}_moveToNext(t){var e,s;if(!n(this,ri,cn)){b(this,Vi,pr).call(this,t);return}if(t.target===n(this,We)){(e=n(this,jt).firstChild)==null||e.focus();return}(s=t.target.nextSibling)==null||s.focus()}_moveToPrevious(t){var e,s;if(t.target===((e=n(this,jt))==null?void 0:e.firstChild)||t.target===n(this,We)){n(this,ri,cn)&&this._hideDropdownFromKeyboard();return}n(this,ri,cn)||b(this,Vi,pr).call(this,t),(s=t.target.previousSibling)==null||s.focus()}_moveToBeginning(t){var e;if(!n(this,ri,cn)){b(this,Vi,pr).call(this,t);return}(e=n(this,jt).firstChild)==null||e.focus()}_moveToEnd(t){var e;if(!n(this,ri,cn)){b(this,Vi,pr).call(this,t);return}(e=n(this,jt).lastChild)==null||e.focus()}hideDropdown(){var t,e;(t=n(this,jt))==null||t.classList.add("hidden"),n(this,We).ariaExpanded="false",(e=n(this,jn))==null||e.abort(),p(this,jn,null)}_hideDropdownFromKeyboard(){var t;if(!n(this,vl)){if(!n(this,ri,cn)){(t=n(this,zi))==null||t.unselect();return}this.hideDropdown(),n(this,We).focus({preventScroll:!0,focusVisible:n(this,vd)})}}updateColor(t){if(n(this,ma)&&(n(this,ma).style.backgroundColor=t),!n(this,jt))return;const e=n(this,Ms).highlightColors.values();for(const s of n(this,jt).children)s.ariaSelected=e.next().value===t.toUpperCase()}destroy(){var t,e;(t=n(this,We))==null||t.remove(),p(this,We,null),p(this,ma,null),(e=n(this,jt))==null||e.remove(),p(this,jt,null)}};We=new WeakMap,ma=new WeakMap,wl=new WeakMap,jt=new WeakMap,vd=new WeakMap,vl=new WeakMap,zi=new WeakMap,Ed=new WeakMap,jn=new WeakMap,Ms=new WeakMap,Sd=new WeakMap,_d=new WeakSet,Om=function(){const t=document.createElement("div"),e=n(this,Ms)._signal;t.addEventListener("contextmenu",as,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),n(this,zi)&&(t.id=`${n(this,zi).id}_colorpicker_dropdown`);for(const[s,i]of n(this,Ms).highlightColors){const r=document.createElement("button");r.tabIndex="0",r.role="option",r.setAttribute("data-color",i),r.title=s,r.setAttribute("data-l10n-id",n(Pe,Sd)[s]);const a=document.createElement("span");r.append(a),a.className="swatch",a.style.backgroundColor=i,r.ariaSelected=i===n(this,wl),r.addEventListener("click",b(this,Cd,Bm).bind(this,i),{signal:e}),t.append(r)}return t.addEventListener("keydown",b(this,Td,Hm).bind(this),{signal:e}),t},Cd=new WeakSet,Bm=function(t,e){e.stopPropagation(),n(this,Ed).dispatch("switchannotationeditorparams",{source:this,type:J.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)},Td=new WeakSet,Hm=function(t){Pe._keyboardManager.exec(this,t)},Vi=new WeakSet,pr=function(t){if(n(this,ri,cn)){this.hideDropdown();return}if(p(this,vd,t.detail===0),n(this,jn)||(p(this,jn,new AbortController),window.addEventListener("pointerdown",b(this,Ip,GA).bind(this),{signal:n(this,Ms).combinedSignal(n(this,jn))})),n(this,We).ariaExpanded="true",n(this,jt)){n(this,jt).classList.remove("hidden");return}const e=p(this,jt,b(this,_d,Om).call(this));n(this,We).append(e)},Ip=new WeakSet,GA=function(t){var e;(e=n(this,jt))!=null&&e.contains(t.target)||this.hideDropdown()},ri=new WeakSet,cn=function(){return n(this,jt)&&!n(this,jt).classList.contains("hidden")},f(Pe,Sd,null);let Zh=Pe;var ai,xd,El,Pd;const Ar=class Ar{constructor(t){f(this,ai,null);f(this,xd,null);f(this,El,null);p(this,xd,t),p(this,El,t._uiManager),n(Ar,Pd)||p(Ar,Pd,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(n(this,ai))return n(this,ai);const{editorType:t,colorType:e,colorValue:s}=n(this,xd),i=p(this,ai,document.createElement("input"));return i.type="color",i.value=s||"#000000",i.className="basicColorPicker",i.tabIndex=0,i.setAttribute("data-l10n-id",n(Ar,Pd)[t]),i.addEventListener("input",()=>{n(this,El).updateParams(e,i.value)},{signal:n(this,El)._signal}),i}update(t){n(this,ai)&&(n(this,ai).value=t)}destroy(){var t;(t=n(this,ai))==null||t.remove(),p(this,ai,null)}hideDropdown(){}};ai=new WeakMap,xd=new WeakMap,El=new WeakMap,Pd=new WeakMap,f(Ar,Pd,null);let If=Ar;function my(d){return Math.floor(Math.max(0,Math.min(1,d))*255).toString(16).padStart(2,"0")}function Sh(d){return Math.max(0,Math.min(255,255*d))}class by{static CMYK_G([t,e,s,i]){return["G",1-Math.min(1,.3*t+.59*s+.11*e+i)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=Sh(t),[t,t,t]}static G_HTML([t]){const e=my(t);return`#${e}${e}${e}`}static RGB_G([t,e,s]){return["G",.3*t+.59*e+.11*s]}static RGB_rgb(t){return t.map(Sh)}static RGB_HTML(t){return`#${t.map(my).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,s,i]){return["RGB",1-Math.min(1,t+i),1-Math.min(1,s+i),1-Math.min(1,e+i)]}static CMYK_rgb([t,e,s,i]){return[Sh(1-Math.min(1,t+i)),Sh(1-Math.min(1,s+i)),Sh(1-Math.min(1,e+i))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,s]){const i=1-t,r=1-e,a=1-s,o=Math.min(i,r,a);return["CMYK",i,r,a,o]}}class F0{create(t,e,s=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),s||(i.setAttribute("width",`${t}px`),i.setAttribute("height",`${e}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${t} ${e}`),i}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){ft("Abstract method `_createSVG` called.")}}class tc extends F0{_createSVG(t){return document.createElementNS(bi,t)}}const N0=9,qa=new WeakSet,O0=new Date().getTimezoneOffset()*60*1e3;class yy{static create(t){switch(t.data.annotationType){case Mt.LINK:return new Fb(t);case Mt.TEXT:return new H0(t);case Mt.WIDGET:switch(t.data.fieldType){case"Tx":return new U0(t);case"Btn":return t.data.radioButton?new WA(t):t.data.checkBox?new j0(t):new G0(t);case"Ch":return new z0(t);case"Sig":return new $0(t)}return new Ja(t);case Mt.POPUP:return new $m(t);case Mt.FREETEXT:return new JA(t);case Mt.LINE:return new W0(t);case Mt.SQUARE:return new X0(t);case Mt.CIRCLE:return new q0(t);case Mt.POLYLINE:return new QA(t);case Mt.CARET:return new K0(t);case Mt.INK:return new Nb(t);case Mt.POLYGON:return new Y0(t);case Mt.HIGHLIGHT:return new ZA(t);case Mt.UNDERLINE:return new J0(t);case Mt.SQUIGGLY:return new Q0(t);case Mt.STRIKEOUT:return new Z0(t);case Mt.STAMP:return new tw(t);case Mt.FILEATTACHMENT:return new tE(t);default:return new xt(t)}}}var ba,Sl,bs,Rd,Um;const zb=class zb{constructor(t,{isRenderable:e=!1,ignoreBorder:s=!1,createQuadrilaterals:i=!1}={}){f(this,Rd);f(this,ba,null);f(this,Sl,!1);f(this,bs,null);this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableComment=t.enableComment,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(s)),i&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:e}){return!!(t!=null&&t.str||e!=null&&e.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return zb._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){var s;const{data:t}=this,e=(s=this.annotationStorage)==null?void 0:s.getEditor(t.id);return e?e.getData():t}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){var o;const t=(o=this.annotationStorage)==null?void 0:o.getEditor(this.data.id);if(t)return t.commentButtonPositionInPage;const{quadPoints:e,inkLists:s,rect:i}=this.data;let r=-1/0,a=-1/0;if((e==null?void 0:e.length)>=8){for(let l=0;l<e.length;l+=8)e[l+1]>a?(a=e[l+1],r=e[l+2]):e[l+1]===a&&(r=Math.max(r,e[l+2]));return[r,a]}if((s==null?void 0:s.length)>=1){for(const l of s)for(let h=0,c=l.length;h<c;h+=2)l[h+1]>a?(a=l[h+1],r=l[h]):l[h+1]===a&&(r=Math.max(r,l[h]));if(r!==1/0)return[r,a]}return i?[i[2],i[3]]:null}_normalizePoint(t){const{page:{view:e},viewport:{rawDims:{pageWidth:s,pageHeight:i,pageX:r,pageY:a}}}=this.parent;return t[1]=e[3]-t[1]+e[1],t[0]=100*(t[0]-r)/s,t[1]=100*(t[1]-a)/i,t}get commentText(){var e,s,i;const{data:t}=this;return((s=(e=this.annotationStorage.getRawValue(`${Xh}${t.id}`))==null?void 0:e.popup)==null?void 0:s.contents)||((i=t.contentsObj)==null?void 0:i.str)||""}set commentText(t){const{data:e}=this,s={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(e.id,{popup:s})||this.annotationStorage.setValue(`${Xh}${e.id}`,{id:e.id,annotationType:e.annotationType,pageIndex:this.parent.page._pageIndex,popup:s,popupRef:e.popupRef,modificationDate:new Date}),t||this.removePopup()}removePopup(){var t,e;(e=((t=n(this,bs))==null?void 0:t.popup)||this.popup)==null||e.remove(),p(this,bs,this.popup=null)}updateEdited(t){var r;if(!this.container)return;t.rect&&(n(this,ba)||p(this,ba,{rect:this.data.rect.slice(0)}));const{rect:e,popup:s}=t;e&&b(this,Rd,Um).call(this,e);let i=((r=n(this,bs))==null?void 0:r.popup)||this.popup;!i&&(s!=null&&s.text)&&(this._createPopup(s),i=n(this,bs).popup),i&&(i.updateEdited(t),s!=null&&s.deleted&&(i.remove(),p(this,bs,null),this.popup=null))}resetEdited(){var t;n(this,ba)&&(b(this,Rd,Um).call(this,n(this,ba).rect),(t=n(this,bs))==null||t.popup.resetEdited(),p(this,ba,null))}_createContainer(t){const{data:e,parent:{page:s,viewport:i}}=this,r=document.createElement("section");r.setAttribute("data-annotation-id",e.id),!(this instanceof Ja)&&!(this instanceof Fb)&&(r.tabIndex=0);const{style:a}=r;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,e.alternativeText&&(r.title=e.alternativeText),e.noRotate&&r.classList.add("norotate"),!e.rect||this instanceof $m){const{rotation:y}=e;return!e.hasOwnCanvas&&y!==0&&this.setRotation(y,r),r}const{width:o,height:l}=this;if(!t&&e.borderStyle.width>0){a.borderWidth=`${e.borderStyle.width}px`;const y=e.borderStyle.horizontalCornerRadius,v=e.borderStyle.verticalCornerRadius;if(y>0||v>0){const E=`calc(${y}px * var(--total-scale-factor)) / calc(${v}px * var(--total-scale-factor))`;a.borderRadius=E}else if(this instanceof WA){const E=`calc(${o}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;a.borderRadius=E}switch(e.borderStyle.style){case to.SOLID:a.borderStyle="solid";break;case to.DASHED:a.borderStyle="dashed";break;case to.BEVELED:V("Unimplemented border style: beveled");break;case to.INSET:V("Unimplemented border style: inset");break;case to.UNDERLINE:a.borderBottomStyle="solid";break}const w=e.borderColor||null;w?(p(this,Sl,!0),a.borderColor=O.makeHexColor(w[0]|0,w[1]|0,w[2]|0)):a.borderWidth=0}const h=O.normalizeRect([e.rect[0],s.view[3]-e.rect[1]+s.view[1],e.rect[2],s.view[3]-e.rect[3]+s.view[1]]),{pageWidth:c,pageHeight:u,pageX:g,pageY:m}=i.rawDims;a.left=`${100*(h[0]-g)/c}%`,a.top=`${100*(h[1]-m)/u}%`;const{rotation:A}=e;return e.hasOwnCanvas||A===0?(a.width=`${100*o/c}%`,a.height=`${100*l/u}%`):this.setRotation(A,r),r}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:s,pageHeight:i}=this.parent.viewport.rawDims;let{width:r,height:a}=this;t%180!==0&&([r,a]=[a,r]),e.style.width=`${100*r/s}%`,e.style.height=`${100*a/i}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(e,s,i)=>{const r=i.detail[e],a=r[0],o=r.slice(1);i.target.style[s]=by[`${a}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[s]:by[`${a}_rgb`](o)})};return q(this,"_commonActions",{display:e=>{const{display:s}=e.detail,i=s%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:s===1||s===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:s}=e.detail;this.container.style.visibility=s?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:s,noView:s})},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=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:e=>{const s=e.detail.rotation;this.setRotation(s),this.annotationStorage.setValue(this.data.id,{rotation:s})}})}_dispatchEventFromSandbox(t,e){const s=this._commonActions;for(const i of Object.keys(e.detail)){const r=t[i]||s[i];r==null||r(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const s=this._commonActions;for(const[i,r]of Object.entries(e)){const a=s[i];if(a){const o={detail:{[i]:r},target:t};a(o),delete e[i]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,s,i,r]=this.data.rect.map(y=>Math.fround(y));if(t.length===8){const[y,v,w,E]=t.subarray(2,6);if(i===y&&r===v&&e===w&&s===E)return}const{style:a}=this.container;let o;if(n(this,Sl)){const{borderColor:y,borderWidth:v}=a;a.borderWidth=0,o=["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="${y}" stroke-width="${v}">`],this.container.classList.add("hasBorder")}const l=i-e,h=r-s,{svgFactory:c}=this,u=c.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0),u.role="none";const g=c.createElement("defs");u.append(g);const m=c.createElement("clipPath"),A=`clippath_${this.data.id}`;m.setAttribute("id",A),m.setAttribute("clipPathUnits","objectBoundingBox"),g.append(m);for(let y=2,v=t.length;y<v;y+=8){const w=t[y],E=t[y+1],S=t[y+2],_=t[y+3],C=c.createElement("rect"),T=(S-e)/l,x=(r-E)/h,P=(w-S)/l,R=(E-_)/h;C.setAttribute("x",T),C.setAttribute("y",x),C.setAttribute("width",P),C.setAttribute("height",R),m.append(C),o==null||o.push(`<rect vector-effect="non-scaling-stroke" x="${T}" y="${x}" width="${P}" height="${R}"/>`)}n(this,Sl)&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(u),this.container.style.clipPath=`url(#${A})`}_createPopup(t=null){const{data:e}=this;let s,i;t?(s={str:t.text},i=t.date):(s=e.contentsObj,i=e.modificationDate);const r=p(this,bs,new $m({data:{color:e.color,titleObj:e.titleObj,modificationDate:i,contentsObj:s,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}));this.parent._commentManager||this.parent.div.append(r.render())}get hasPopupElement(){return!!(n(this,bs)||this.popup||this.data.popupRef)}get extraPopupElement(){return n(this,bs)}render(){ft("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const s=[];if(this._fieldObjects){const i=this._fieldObjects[t];if(i)for(const{page:r,id:a,exportValues:o}of i){if(r===-1||a===e)continue;const l=typeof o=="string"?o:null,h=document.querySelector(`[data-element-id="${a}"]`);if(h&&!qa.has(h)){V(`_getElementsByName - element not allowed: ${a}`);continue}s.push({id:a,exportValue:l,domElement:h})}return s}for(const i of document.getElementsByName(t)){const{exportValue:r}=i,a=i.getAttribute("data-element-id");a!==e&&qa.has(i)&&s.push({id:a,exportValue:r,domElement:i})}return s}show(){var t;this.container&&(this.container.hidden=!1),(t=this.popup)==null||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),(t=this.popup)==null||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{var s;(s=this.linkService.eventBus)==null||s.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};ba=new WeakMap,Sl=new WeakMap,bs=new WeakMap,Rd=new WeakSet,Um=function(t){const{container:{style:e},data:{rect:s,rotation:i},parent:{viewport:{rawDims:{pageWidth:r,pageHeight:a,pageX:o,pageY:l}}}}=this;s==null||s.splice(0,4,...t),e.left=`${100*(t[0]-o)/r}%`,e.top=`${100*(a-t[3]+l)/a}%`,i===0?(e.width=`${100*(t[2]-t[0])/r}%`,e.height=`${100*(t[3]-t[1])/a}%`):this.setRotation(i)};let xt=zb;class B0 extends xt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.editor=t.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:t}=this;t.hasComment&&(this._createPopup(t.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(t){this.editor.comment=t,t||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.container.remove(),this.container=null,this.removePopup()}}var Wi,gr,Fp,zA,Np,VA;class Fb extends xt{constructor(e,s=null){super(e,{isRenderable:!0,ignoreBorder:!!(s!=null&&s.ignoreBorder),createQuadrilaterals:!0});f(this,Wi);f(this,Fp);f(this,Np);this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:s}=this,i=document.createElement("a");i.setAttribute("data-element-id",e.id);let r=!1;return e.url?(s.addLinkAttributes(i,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(i,e.action,e.overlaidText),r=!0):e.attachment?(b(this,Fp,zA).call(this,i,e.attachment,e.overlaidText,e.attachmentDest),r=!0):e.setOCGState?(b(this,Np,VA).call(this,i,e.setOCGState,e.overlaidText),r=!0):e.dest?(this._bindLink(i,e.dest,e.overlaidText),r=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,e),r=!0),e.resetForm?(this._bindResetFormAction(i,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(i,""),r=!0)),this.container.classList.add("linkAnnotation"),r&&this.container.append(i),this.container}_bindLink(e,s,i=""){e.href=this.linkService.getDestinationHash(s),e.onclick=()=>(s&&this.linkService.goToDestination(s),!1),(s||s==="")&&b(this,Wi,gr).call(this),i&&(e.title=i)}_bindNamedAction(e,s,i=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(s),!1),i&&(e.title=i),b(this,Wi,gr).call(this)}_bindJSAction(e,s){e.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(s.actions)){const a=i.get(r);a&&(e[a]=()=>{var o;return(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:s.id,name:r}}),!1})}s.overlaidText&&(e.title=s.overlaidText),e.onclick||(e.onclick=()=>!1),b(this,Wi,gr).call(this)}_bindResetFormAction(e,s){const i=e.onclick;if(i||(e.href=this.linkService.getAnchorUrl("")),b(this,Wi,gr).call(this),!this._fieldObjects){V('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(e.onclick=()=>!1);return}e.onclick=()=>{var u;i==null||i();const{fields:r,refs:a,include:o}=s,l=[];if(r.length!==0||a.length!==0){const g=new Set(a);for(const m of r){const A=this._fieldObjects[m]||[];for(const{id:y}of A)g.add(y)}for(const m of Object.values(this._fieldObjects))for(const A of m)g.has(A.id)===o&&l.push(A)}else for(const g of Object.values(this._fieldObjects))l.push(...g);const h=this.annotationStorage,c=[];for(const g of l){const{id:m}=g;switch(c.push(m),g.type){case"text":{const y=g.defaultValue||"";h.setValue(m,{value:y});break}case"checkbox":case"radiobutton":{const y=g.defaultValue===g.exportValues;h.setValue(m,{value:y});break}case"combobox":case"listbox":{const y=g.defaultValue||"";h.setValue(m,{value:y});break}default:continue}const A=document.querySelector(`[data-element-id="${m}"]`);if(A){if(!qa.has(A)){V(`_bindResetFormAction - element not allowed: ${m}`);continue}}else continue;A.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((u=this.linkService.eventBus)==null||u.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:c,name:"ResetForm"}})),!1}}}Wi=new WeakSet,gr=function(){this.container.setAttribute("data-internal-link","")},Fp=new WeakSet,zA=function(e,s,i="",r=null){e.href=this.linkService.getAnchorUrl(""),s.description?e.title=s.description:i&&(e.title=i),e.onclick=()=>{var a;return(a=this.downloadManager)==null||a.openOrDownloadData(s.content,s.filename,r),!1},b(this,Wi,gr).call(this)},Np=new WeakSet,VA=function(e,s,i=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(s),!1),i&&(e.title=i),b(this,Wi,gr).call(this)};class H0 extends xt{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class Ja extends xt{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&(((e=t.previousSibling)==null?void 0:e.nodeName)==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Zt.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,s,i,r){s.includes("mouse")?t.addEventListener(s,a=>{var o;(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:r(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):t.addEventListener(s,a=>{var o;if(s==="blur"){if(!e.focused||!a.relatedTarget)return;e.focused=!1}else if(s==="focus"){if(e.focused)return;e.focused=!0}r&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:r(a)}}))})}_setEventListeners(t,e,s,i){var r,a,o;for(const[l,h]of s)(h==="Action"||(r=this.data.actions)!=null&&r[h])&&((h==="Focus"||h==="Blur")&&(e||(e={focused:!1})),this._setEventListener(t,e,l,h,i),h==="Focus"&&!((a=this.data.actions)!=null&&a.Blur)?this._setEventListener(t,e,"blur","Blur",null):h==="Blur"&&!((o=this.data.actions)!=null&&o.Focus)&&this._setEventListener(t,e,"focus","Focus",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=e===null?"transparent":O.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:s}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||N0,r=t.style;let a;const o=2,l=h=>Math.round(10*h)/10;if(this.data.multiLine){const h=Math.abs(this.data.rect[3]-this.data.rect[1]-o),c=Math.round(h/(Gg*i))||1,u=h/c;a=Math.min(i,l(u/Gg))}else{const h=Math.abs(this.data.rect[3]-this.data.rect[1]-o);a=Math.min(i,l(h/Gg))}r.fontSize=`calc(${a}px * var(--total-scale-factor))`,r.color=O.makeHexColor(s[0],s[1],s[2]),this.data.textAlignment!==null&&(r.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class U0 extends Ja{constructor(t){const e=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:e})}setPropertyOnSiblings(t,e,s,i){const r=this.annotationStorage;for(const a of this._getElementsByName(t.name,t.id))a.domElement&&(a.domElement[e]=s),r.setValue(a.id,{[i]:s})}render(){var i,r;const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let s=null;if(this.renderForms){const a=t.getValue(e,{value:this.data.fieldValue});let o=a.value||"";const l=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;l&&o.length>l&&(o=o.slice(0,l));let h=a.formattedValue||((i=this.data.textContent)==null?void 0:i.join(`
3
3
  `))||null;h&&this.data.comb&&(h=h.replaceAll(/\s+/g,""));const c={userValue:o,formattedValue:h,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(s=document.createElement("textarea"),s.textContent=h??o,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type=this.data.password?"password":"text",s.setAttribute("value",h??o),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(s.hidden=!0),qa.add(s),s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=0;const{datetimeFormat:u,datetimeType:g,timeStep:m}=this.data,A=!!g&&this.enableScripting;u&&(s.title=u),this._setRequired(s,this.data.required),l&&(s.maxLength=l),s.addEventListener("input",v=>{t.setValue(e,{value:v.target.value}),this.setPropertyOnSiblings(s,"value",v.target.value,"value"),c.formattedValue=null}),s.addEventListener("resetform",v=>{const w=this.data.defaultFieldValue??"";s.value=c.userValue=w,c.formattedValue=null});let y=v=>{const{formattedValue:w}=c;w!=null&&(v.target.value=w),v.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",w=>{var S;if(c.focused)return;const{target:E}=w;if(A&&(E.type=g,m&&(E.step=m)),c.userValue){const _=c.userValue;if(A)if(g==="time"){const C=new Date(_),T=[C.getHours(),C.getMinutes(),C.getSeconds()];E.value=T.map(x=>x.toString().padStart(2,"0")).join(":")}else E.value=new Date(_-O0).toISOString().split(g==="date"?"T":".",1)[0];else E.value=_}c.lastCommittedValue=E.value,c.commitKey=1,(S=this.data.actions)!=null&&S.Focus||(c.focused=!0)}),s.addEventListener("updatefromsandbox",w=>{this.showElementAndHideCanvas(w.target);const E={value(S){c.userValue=S.detail.value??"",A||t.setValue(e,{value:c.userValue.toString()}),S.target.value=c.userValue},formattedValue(S){const{formattedValue:_}=S.detail;c.formattedValue=_,_!=null&&S.target!==document.activeElement&&(S.target.value=_);const C={formattedValue:_};A&&(C.value=_),t.setValue(e,C)},selRange(S){S.target.setSelectionRange(...S.detail.selRange)},charLimit:S=>{var x;const{charLimit:_}=S.detail,{target:C}=S;if(_===0){C.removeAttribute("maxLength");return}C.setAttribute("maxLength",_);let T=c.userValue;!T||T.length<=_||(T=T.slice(0,_),C.value=c.userValue=T,t.setValue(e,{value:T}),(x=this.linkService.eventBus)==null||x.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:T,willCommit:!0,commitKey:1,selStart:C.selectionStart,selEnd:C.selectionEnd}}))}};this._dispatchEventFromSandbox(E,w)}),s.addEventListener("keydown",w=>{var _;c.commitKey=1;let E=-1;if(w.key==="Escape"?E=0:w.key==="Enter"&&!this.data.multiLine?E=2:w.key==="Tab"&&(c.commitKey=3),E===-1)return;const{value:S}=w.target;c.lastCommittedValue!==S&&(c.lastCommittedValue=S,c.userValue=S,(_=this.linkService.eventBus)==null||_.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:S,willCommit:!0,commitKey:E,selStart:w.target.selectionStart,selEnd:w.target.selectionEnd}}))});const v=y;y=null,s.addEventListener("blur",w=>{var _,C;if(!c.focused||!w.relatedTarget)return;(_=this.data.actions)!=null&&_.Blur||(c.focused=!1);const{target:E}=w;let{value:S}=E;if(A){if(S&&g==="time"){const T=S.split(":").map(x=>parseInt(x,10));S=new Date(2e3,0,1,T[0],T[1],T[2]||0).valueOf(),E.step=""}else S.includes("T")||(S=`${S}T00:00`),S=new Date(S).valueOf();E.type="text"}c.userValue=S,c.lastCommittedValue!==S&&((C=this.linkService.eventBus)==null||C.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:S,willCommit:!0,commitKey:c.commitKey,selStart:w.target.selectionStart,selEnd:w.target.selectionEnd}})),v(w)}),(r=this.data.actions)!=null&&r.Keystroke&&s.addEventListener("beforeinput",w=>{var R;c.lastCommittedValue=null;const{data:E,target:S}=w,{value:_,selectionStart:C,selectionEnd:T}=S;let x=C,P=T;switch(w.inputType){case"deleteWordBackward":{const D=_.substring(0,C).match(/\w*[^\w]*$/);D&&(x-=D[0].length);break}case"deleteWordForward":{const D=_.substring(C).match(/^[^\w]*\w*/);D&&(P+=D[0].length);break}case"deleteContentBackward":C===T&&(x-=1);break;case"deleteContentForward":C===T&&(P+=1);break}w.preventDefault(),(R=this.linkService.eventBus)==null||R.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:_,change:E||"",willCommit:!1,selStart:x,selEnd:P}})}),this._setEventListeners(s,c,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],w=>w.target.value)}if(y&&s.addEventListener("blur",y),this.data.comb){const w=(this.data.rect[2]-this.data.rect[0])/l;s.classList.add("comb"),s.style.letterSpacing=`calc(${w}px * var(--total-scale-factor) - 1ch)`}}else s=document.createElement("div"),s.textContent=this.data.fieldValue,s.style.verticalAlign="middle",s.style.display="table-cell",this.data.hasOwnCanvas&&(s.hidden=!0);return this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class $0 extends Ja{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class j0 extends Ja{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,s=e.id;let i=t.getValue(s,{value:e.exportValue===e.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",t.setValue(s,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");return qa.add(r),r.setAttribute("data-element-id",s),r.disabled=e.readOnly,this._setRequired(r,this.data.required),r.type="checkbox",r.name=e.fieldName,i&&r.setAttribute("checked",!0),r.setAttribute("exportValue",e.exportValue),r.tabIndex=0,r.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const h of this._getElementsByName(o,s)){const c=l&&h.exportValue===e.exportValue;h.domElement&&(h.domElement.checked=c),t.setValue(h.id,{value:c})}t.setValue(s,{value:l})}),r.addEventListener("resetform",a=>{const o=e.defaultFieldValue||"Off";a.target.checked=o===e.exportValue}),this.enableScripting&&this.hasJSActions&&(r.addEventListener("updatefromsandbox",a=>{const o={value(l){l.target.checked=l.detail.value!=="Off",t.setValue(s,{value:l.target.checked})}};this._dispatchEventFromSandbox(o,a)}),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class WA extends Ja{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,s=e.id;let i=t.getValue(s,{value:e.fieldValue===e.buttonValue}).value;if(typeof i=="string"&&(i=i!==e.buttonValue,t.setValue(s,{value:i})),i)for(const a of this._getElementsByName(e.fieldName,s))t.setValue(a.id,{value:!1});const r=document.createElement("input");if(qa.add(r),r.setAttribute("data-element-id",s),r.disabled=e.readOnly,this._setRequired(r,this.data.required),r.type="radio",r.name=e.fieldName,i&&r.setAttribute("checked",!0),r.tabIndex=0,r.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const h of this._getElementsByName(o,s))t.setValue(h.id,{value:!1});t.setValue(s,{value:l})}),r.addEventListener("resetform",a=>{const o=e.defaultFieldValue;a.target.checked=o!=null&&o===e.buttonValue}),this.enableScripting&&this.hasJSActions){const a=e.buttonValue;r.addEventListener("updatefromsandbox",o=>{const l={value:h=>{const c=a===h.detail.value;for(const u of this._getElementsByName(h.target.name)){const g=c&&u.id===s;u.domElement&&(u.domElement.checked=g),t.setValue(u.id,{value:g})}}};this._dispatchEventFromSandbox(l,o)}),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}return this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class G0 extends Fb{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",s=>{this._dispatchEventFromSandbox({},s)})),t}}class z0 extends Ja{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,s=t.getValue(e,{value:this.data.fieldValue}),i=document.createElement("select");qa.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=0;let r=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",c=>{const u=this.data.defaultFieldValue;for(const g of i.options)g.selected=g.value===u});for(const c of this.data.options){const u=document.createElement("option");u.textContent=c.displayValue,u.value=c.exportValue,s.value.includes(c.exportValue)&&(u.setAttribute("selected",!0),r=!1),i.append(u)}let a=null;if(r){const c=document.createElement("option");c.value=" ",c.setAttribute("hidden",!0),c.setAttribute("selected",!0),i.prepend(c),a=()=>{c.remove(),i.removeEventListener("input",a),a=null},i.addEventListener("input",a)}const o=c=>{const u=c?"value":"textContent",{options:g,multiple:m}=i;return m?Array.prototype.filter.call(g,A=>A.selected).map(A=>A[u]):g.selectedIndex===-1?null:g[g.selectedIndex][u]};let l=o(!1);const h=c=>{const u=c.target.options;return Array.prototype.map.call(u,g=>({displayValue:g.textContent,exportValue:g.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",c=>{const u={value(g){a==null||a();const m=g.detail.value,A=new Set(Array.isArray(m)?m:[m]);for(const y of i.options)y.selected=A.has(y.value);t.setValue(e,{value:o(!0)}),l=o(!1)},multipleSelection(g){i.multiple=!0},remove(g){const m=i.options,A=g.detail.remove;m[A].selected=!1,i.remove(A),m.length>0&&Array.prototype.findIndex.call(m,v=>v.selected)===-1&&(m[0].selected=!0),t.setValue(e,{value:o(!0),items:h(g)}),l=o(!1)},clear(g){for(;i.length!==0;)i.remove(0);t.setValue(e,{value:null,items:[]}),l=o(!1)},insert(g){const{index:m,displayValue:A,exportValue:y}=g.detail.insert,v=i.children[m],w=document.createElement("option");w.textContent=A,w.value=y,v?v.before(w):i.append(w),t.setValue(e,{value:o(!0),items:h(g)}),l=o(!1)},items(g){const{items:m}=g.detail;for(;i.length!==0;)i.remove(0);for(const A of m){const{displayValue:y,exportValue:v}=A,w=document.createElement("option");w.textContent=y,w.value=v,i.append(w)}i.options.length>0&&(i.options[0].selected=!0),t.setValue(e,{value:o(!0),items:h(g)}),l=o(!1)},indices(g){const m=new Set(g.detail.indices);for(const A of g.target.options)A.selected=m.has(A.index);t.setValue(e,{value:o(!0)}),l=o(!1)},editable(g){g.target.disabled=!g.detail.editable}};this._dispatchEventFromSandbox(u,c)}),i.addEventListener("input",c=>{var m;const u=o(!0),g=o(!1);t.setValue(e,{value:u}),c.preventDefault(),(m=this.linkService.eventBus)==null||m.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:l,change:g,changeEx:u,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],c=>c.target.value)):i.addEventListener("input",function(c){t.setValue(e,{value:o(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}var kd,jm;class $m extends xt{constructor(e){const{data:s,elements:i,parent:r}=e,a=!!r._commentManager;super(e,{isRenderable:!a&&xt._hasPopupData(s)});f(this,kd);if(this.elements=i,a&&xt._hasPopupData(s)){const o=this.popup=b(this,kd,jm).call(this);for(const l of i)l.popup=o}else this.popup=null}render(){const{container:e}=this;e.classList.add("popupAnnotation"),e.role="comment";const s=this.popup=b(this,kd,jm).call(this),i=[];for(const r of this.elements)r.popup=s,r.container.ariaHasPopup="dialog",i.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(r=>`${xb}${r}`).join(",")),this.container}}kd=new WeakSet,jm=function(){return new V0({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})};var Xe,Gn,Op,Bp,_l,Cl,kt,oi,zn,ya,Tl,xl,li,qe,Xi,qi,Xt,Yi,Vn,Dd,Ki,Pl,Aa,Wn,me,Xn,Rl,hf,Md,Gm,Ld,zm,Id,Vm,kl,cf,Fd,Wm,Hp,XA,Up,qA,$p,YA,jp,KA,Dl,df,Ml,uf,Nd,Xm;class V0{constructor({container:t,color:e,elements:s,titleObj:i,modificationDate:r,contentsObj:a,richText:o,parent:l,rect:h,parentRect:c,open:u,commentManager:g=null}){f(this,Rl);f(this,Md);f(this,Ld);f(this,Id);f(this,kl);f(this,Fd);f(this,Hp);f(this,Up);f(this,$p);f(this,jp);f(this,Dl);f(this,Ml);f(this,Nd);f(this,Xe,null);f(this,Gn,b(this,$p,YA).bind(this));f(this,Op,b(this,Nd,Xm).bind(this));f(this,Bp,b(this,Ml,uf).bind(this));f(this,_l,b(this,Dl,df).bind(this));f(this,Cl,null);f(this,kt,null);f(this,oi,null);f(this,zn,null);f(this,ya,null);f(this,Tl,null);f(this,xl,null);f(this,li,!1);f(this,qe,null);f(this,Xi,null);f(this,qi,null);f(this,Xt,null);f(this,Yi,null);f(this,Vn,null);f(this,Dd,null);f(this,Ki,null);f(this,Pl,null);f(this,Aa,null);f(this,Wn,!1);f(this,me,null);f(this,Xn,null);p(this,kt,t),p(this,Pl,i),p(this,oi,a),p(this,Ki,o),p(this,Tl,l),p(this,Cl,e),p(this,Dd,h),p(this,xl,c),p(this,ya,s),p(this,Xe,g),p(this,me,s[0]),p(this,zn,Kh.toDateObject(r)),this.trigger=s.flatMap(m=>m.getElementsToTriggerPopup()),g?this.renderCommentButton():(b(this,Rl,hf).call(this),n(this,kt).hidden=!0,u&&b(this,Dl,df).call(this))}renderCommentButton(){if(n(this,Xt)||(n(this,Yi)||b(this,Md,Gm).call(this),!n(this,Yi)))return;const{signal:t}=p(this,Xi,new AbortController),e=!!n(this,me).extraPopupElement,s=()=>{n(this,Xe).toggleCommentPopup(this,!0,void 0,!e)},i=()=>{n(this,Xe).toggleCommentPopup(this,!1,!0,!e)},r=()=>{n(this,Xe).toggleCommentPopup(this,!1,!1)};if(e){p(this,Xt,n(this,me).container);for(const a of this.trigger)a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.addEventListener("keydown",n(this,Gn),{signal:t}),a.addEventListener("click",s,{signal:t}),a.addEventListener("pointerenter",i,{signal:t}),a.addEventListener("pointerleave",r,{signal:t}),a.classList.add("popupTriggerArea")}else{const a=p(this,Xt,document.createElement("button"));a.className="annotationCommentButton";const o=n(this,me).container;a.style.zIndex=o.style.zIndex+1,a.tabIndex=0,a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.setAttribute("data-l10n-id","pdfjs-show-comment-button"),b(this,Id,Vm).call(this),b(this,Ld,zm).call(this),a.addEventListener("keydown",n(this,Gn),{signal:t}),a.addEventListener("click",s,{signal:t}),a.addEventListener("pointerenter",i,{signal:t}),a.addEventListener("pointerleave",r,{signal:t}),o.after(a)}}get commentButtonColor(){const{color:t,opacity:e}=n(this,me).commentData;return t?n(this,Tl)._commentManager.makeCommentColor(t,e):null}focusCommentButton(){setTimeout(()=>{var t;(t=n(this,Xt))==null||t.focus()},0)}getData(){const{richText:t,color:e,opacity:s,creationDate:i,modificationDate:r}=n(this,me).commentData;return{contentsObj:{str:this.comment},richText:t,color:e,opacity:s,creationDate:i,modificationDate:r}}get elementBeforePopup(){return n(this,Xt)}get comment(){return n(this,Xn)||p(this,Xn,n(this,me).commentText),n(this,Xn)}set comment(t){t!==this.comment&&(n(this,me).commentText=p(this,Xn,t))}get parentBoundingClientRect(){return n(this,me).layer.getBoundingClientRect()}setCommentButtonStates({selected:t,hasPopup:e}){n(this,Xt)&&(n(this,Xt).classList.toggle("selected",t),n(this,Xt).ariaExpanded=e)}setSelectedCommentButton(t){n(this,Xt).classList.toggle("selected",t)}get commentPopupPosition(){if(n(this,Vn))return n(this,Vn);const{x:t,y:e,height:s}=n(this,Xt).getBoundingClientRect(),{x:i,y:r,width:a,height:o}=n(this,me).layer.getBoundingClientRect();return[(t-i)/a,(e+s-r)/o]}set commentPopupPosition(t){p(this,Vn,t)}hasDefaultPopupPosition(){return n(this,Vn)===null}get commentButtonPosition(){return n(this,Yi)}get commentButtonWidth(){return n(this,Xt).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(t){const[e,s]=n(this,Vn)||this.commentButtonPosition.map(h=>h/100),i=this.parentBoundingClientRect,{x:r,y:a,width:o,height:l}=i;n(this,Xe).showDialog(null,this,r+e*o,a+s*l,{...t,parentDimensions:i})}render(){var s,i;if(n(this,qe))return;const t=p(this,qe,document.createElement("div"));if(t.className="popup",n(this,Cl)){const r=t.style.outlineColor=O.makeHexColor(...n(this,Cl));t.style.backgroundColor=`color-mix(in srgb, ${r} 30%, white)`}const e=document.createElement("span");if(e.className="header",(s=n(this,Pl))!=null&&s.str){const r=document.createElement("span");r.className="title",e.append(r),{dir:r.dir,str:r.textContent}=n(this,Pl)}if(t.append(e),n(this,zn)){const r=document.createElement("time");r.className="popupDate",r.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),r.setAttribute("data-l10n-args",JSON.stringify({dateObj:n(this,zn).valueOf()})),r.dateTime=n(this,zn).toISOString(),e.append(r)}Rb({html:n(this,kl,cf)||n(this,oi).str,dir:(i=n(this,oi))==null?void 0:i.dir,className:"popupContent"},t),n(this,kt).append(t)}updateEdited({rect:t,popup:e,deleted:s}){var i;if(n(this,Xe)){s?(this.remove(),p(this,Xn,null)):e&&(e.deleted?this.remove():(b(this,Id,Vm).call(this),p(this,Xn,e.text))),t&&(p(this,Yi,null),b(this,Md,Gm).call(this),b(this,Ld,zm).call(this));return}if(s||e!=null&&e.deleted){this.remove();return}b(this,Rl,hf).call(this),n(this,Aa)||p(this,Aa,{contentsObj:n(this,oi),richText:n(this,Ki)}),t&&p(this,qi,null),e&&e.text&&(p(this,Ki,b(this,Up,qA).call(this,e.text)),p(this,zn,Kh.toDateObject(e.date)),p(this,oi,null)),(i=n(this,qe))==null||i.remove(),p(this,qe,null)}resetEdited(){var t;n(this,Aa)&&({contentsObj:Ht(this,oi)._,richText:Ht(this,Ki)._}=n(this,Aa),p(this,Aa,null),(t=n(this,qe))==null||t.remove(),p(this,qe,null),p(this,qi,null))}remove(){var t,e,s;if((t=n(this,Xi))==null||t.abort(),p(this,Xi,null),(e=n(this,qe))==null||e.remove(),p(this,qe,null),p(this,Wn,!1),p(this,li,!1),(s=n(this,Xt))==null||s.remove(),p(this,Xt,null),this.trigger)for(const i of this.trigger)i.classList.remove("popupTriggerArea")}forceHide(){p(this,Wn,this.isVisible),n(this,Wn)&&(n(this,kt).hidden=!0)}maybeShow(){n(this,Xe)||(b(this,Rl,hf).call(this),n(this,Wn)&&(n(this,qe)||b(this,Ml,uf).call(this),p(this,Wn,!1),n(this,kt).hidden=!1))}get isVisible(){return n(this,Xe)?!1:n(this,kt).hidden===!1}}Xe=new WeakMap,Gn=new WeakMap,Op=new WeakMap,Bp=new WeakMap,_l=new WeakMap,Cl=new WeakMap,kt=new WeakMap,oi=new WeakMap,zn=new WeakMap,ya=new WeakMap,Tl=new WeakMap,xl=new WeakMap,li=new WeakMap,qe=new WeakMap,Xi=new WeakMap,qi=new WeakMap,Xt=new WeakMap,Yi=new WeakMap,Vn=new WeakMap,Dd=new WeakMap,Ki=new WeakMap,Pl=new WeakMap,Aa=new WeakMap,Wn=new WeakMap,me=new WeakMap,Xn=new WeakMap,Rl=new WeakSet,hf=function(){var e;if(n(this,Xi))return;p(this,Xi,new AbortController);const{signal:t}=n(this,Xi);for(const s of this.trigger)s.addEventListener("click",n(this,_l),{signal:t}),s.addEventListener("pointerenter",n(this,Bp),{signal:t}),s.addEventListener("pointerleave",n(this,Op),{signal:t}),s.classList.add("popupTriggerArea");for(const s of n(this,ya))(e=s.container)==null||e.addEventListener("keydown",n(this,Gn),{signal:t})},Md=new WeakSet,Gm=function(){const t=n(this,ya).find(e=>e.hasCommentButton);t&&p(this,Yi,t._normalizePoint(t.commentButtonPosition))},Ld=new WeakSet,zm=function(){if(n(this,me).extraPopupElement&&!n(this,me).editor)return;this.renderCommentButton();const[t,e]=n(this,Yi),{style:s}=n(this,Xt);s.left=`calc(${t}%)`,s.top=`calc(${e}% - var(--comment-button-dim))`},Id=new WeakSet,Vm=function(){n(this,me).extraPopupElement||(this.renderCommentButton(),n(this,Xt).style.backgroundColor=this.commentButtonColor||"")},kl=new WeakSet,cf=function(){const t=n(this,Ki),e=n(this,oi);return t!=null&&t.str&&(!(e!=null&&e.str)||e.str===t.str)&&n(this,Ki).html||null},Fd=new WeakSet,Wm=function(){var t,e,s;return((s=(e=(t=n(this,kl,cf))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:s.fontSize)||0},Hp=new WeakSet,XA=function(){var t,e,s;return((s=(e=(t=n(this,kl,cf))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:s.color)||null},Up=new WeakSet,qA=function(t){const e=[],s={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},i={style:{color:n(this,Hp,XA),fontSize:n(this,Fd,Wm)?`calc(${n(this,Fd,Wm)}px * var(--total-scale-factor))`:""}};for(const r of t.split(`
4
4
  `))e.push({name:"span",value:r,attributes:i});return s},$p=new WeakSet,YA=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&n(this,li))&&b(this,Dl,df).call(this)},jp=new WeakSet,KA=function(){if(n(this,qi)!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:s,pageX:i,pageY:r}}}=n(this,Tl);let a=!!n(this,xl),o=a?n(this,xl):n(this,Dd);for(const A of n(this,ya))if(!o||O.intersect(A.data.rect,o)!==null){o=A.data.rect,a=!0;break}const l=O.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]),h=5,c=a?o[2]-o[0]+h:0,u=l[0]+c,g=l[1];p(this,qi,[100*(u-i)/e,100*(g-r)/s]);const{style:m}=n(this,kt);m.left=`${n(this,qi)[0]}%`,m.top=`${n(this,qi)[1]}%`},Dl=new WeakSet,df=function(){if(n(this,Xe)){n(this,Xe).toggleCommentPopup(this,!1);return}p(this,li,!n(this,li)),n(this,li)?(b(this,Ml,uf).call(this),n(this,kt).addEventListener("click",n(this,_l)),n(this,kt).addEventListener("keydown",n(this,Gn))):(b(this,Nd,Xm).call(this),n(this,kt).removeEventListener("click",n(this,_l)),n(this,kt).removeEventListener("keydown",n(this,Gn)))},Ml=new WeakSet,uf=function(){n(this,qe)||this.render(),this.isVisible?n(this,li)&&n(this,kt).classList.add("focused"):(b(this,jp,KA).call(this),n(this,kt).hidden=!1,n(this,kt).style.zIndex=parseInt(n(this,kt).style.zIndex)+1e3)},Nd=new WeakSet,Xm=function(){n(this,kt).classList.remove("focused"),!(n(this,li)||!this.isVisible)&&(n(this,kt).hidden=!0,n(this,kt).style.zIndex=parseInt(n(this,kt).style.zIndex)-1e3)};class JA extends xt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=z.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const s=document.createElement("span");s.textContent=e,t.append(s)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var Od;class W0 extends xt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});f(this,Od,null)}render(){this.container.classList.add("lineAnnotation");const{data:e,width:s,height:i}=this,r=this.svgFactory.create(s,i,!0),a=p(this,Od,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"),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,Od)}addHighlightArea(){this.container.classList.add("highlightArea")}}Od=new WeakMap;var Bd;class X0 extends xt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});f(this,Bd,null)}render(){this.container.classList.add("squareAnnotation");const{data:e,width:s,height:i}=this,r=this.svgFactory.create(s,i,!0),a=e.borderStyle.width,o=p(this,Bd,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",s-a),o.setAttribute("height",i-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),r.append(o),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,Bd)}addHighlightArea(){this.container.classList.add("highlightArea")}}Bd=new WeakMap;var Hd;class q0 extends xt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});f(this,Hd,null)}render(){this.container.classList.add("circleAnnotation");const{data:e,width:s,height:i}=this,r=this.svgFactory.create(s,i,!0),a=e.borderStyle.width,o=p(this,Hd,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",s/2),o.setAttribute("cy",i/2),o.setAttribute("rx",s/2-a/2),o.setAttribute("ry",i/2-a/2),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),r.append(o),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,Hd)}addHighlightArea(){this.container.classList.add("highlightArea")}}Hd=new WeakMap;var Ud;class QA extends xt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});f(this,Ud,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,vertices:s,borderStyle:i,popupRef:r},width:a,height:o}=this;if(!s)return this.container;const l=this.svgFactory.create(a,o,!0);let h=[];for(let u=0,g=s.length;u<g;u+=2){const m=s[u]-e[0],A=e[3]-s[u+1];h.push(`${m},${A}`)}h=h.join(" ");const c=p(this,Ud,this.svgFactory.createElement(this.svgElementName));return c.setAttribute("points",h),c.setAttribute("stroke-width",i.width||1),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),l.append(c),this.container.append(l),!r&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,Ud)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ud=new WeakMap;class Y0 extends QA{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class K0 extends xt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var $d,wa,jd,qm;class Nb extends xt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});f(this,jd);f(this,$d,null);f(this,wa,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?z.HIGHLIGHT:z.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,rotation:s,inkLists:i,borderStyle:r,popupRef:a}}=this,{transform:o,width:l,height:h}=b(this,jd,qm).call(this,s,e),c=this.svgFactory.create(l,h,!0),u=p(this,$d,this.svgFactory.createElement("svg:g"));c.append(u),u.setAttribute("stroke-width",r.width||1),u.setAttribute("stroke-linecap","round"),u.setAttribute("stroke-linejoin","round"),u.setAttribute("stroke-miterlimit",10),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),u.setAttribute("transform",o);for(let g=0,m=i.length;g<m;g++){const A=this.svgFactory.createElement(this.svgElementName);n(this,wa).push(A),A.setAttribute("points",i[g].join(",")),u.append(A)}return!a&&this.hasPopupData&&this._createPopup(),this.container.append(c),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);const{thickness:s,points:i,rect:r}=e,a=n(this,$d);if(s>=0&&a.setAttribute("stroke-width",s||1),i)for(let o=0,l=n(this,wa).length;o<l;o++)n(this,wa)[o].setAttribute("points",i[o].join(","));if(r){const{transform:o,width:l,height:h}=b(this,jd,qm).call(this,this.data.rotation,r);a.parentElement.setAttribute("viewBox",`0 0 ${l} ${h}`),a.setAttribute("transform",o)}}getElementsToTriggerPopup(){return n(this,wa)}addHighlightArea(){this.container.classList.add("highlightArea")}}$d=new WeakMap,wa=new WeakMap,jd=new WeakSet,qm=function(e,s){switch(e){case 90:return{transform:`rotate(90) translate(${-s[0]},${s[1]}) scale(1,-1)`,width:s[3]-s[1],height:s[2]-s[0]};case 180:return{transform:`rotate(180) translate(${-s[2]},${s[1]}) scale(1,-1)`,width:s[2]-s[0],height:s[3]-s[1]};case 270:return{transform:`rotate(270) translate(${-s[2]},${s[3]}) scale(1,-1)`,width:s[3]-s[1],height:s[2]-s[0]};default:return{transform:`translate(${-s[0]},${s[3]}) scale(1,-1)`,width:s[2]-s[0],height:s[3]-s[1]}}};class ZA extends xt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=z.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const s=document.createElement("mark");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class J0 extends xt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),t){const s=document.createElement("u");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class Q0 extends xt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),t){const s=document.createElement("u");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class Z0 extends xt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),t){const s=document.createElement("s");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class tw extends xt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=z.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var Gd,zd,Ym;class tE extends xt{constructor(e){var i;super(e,{isRenderable:!0});f(this,zd);f(this,Gd,null);const{file:s}=this.data;this.filename=s.filename,this.content=s.content,(i=this.linkService.eventBus)==null||i.dispatch("fileattachmentannotation",{source:this,...s})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:s}=this;let i;s.hasAppearance||s.fillAlpha===0?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(s.name)?"paperclip":"pushpin"}.svg`,s.fillAlpha&&s.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(s.fillAlpha*100)}%);`)),i.addEventListener("dblclick",b(this,zd,Ym).bind(this)),p(this,Gd,i);const{isMac:r}=Zt.platform;return e.addEventListener("keydown",a=>{a.key==="Enter"&&(r?a.metaKey:a.ctrlKey)&&b(this,zd,Ym).call(this)}),!s.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),e.append(i),e}getElementsToTriggerPopup(){return n(this,Gd)}addHighlightArea(){this.container.classList.add("highlightArea")}}Gd=new WeakMap,zd=new WeakSet,Ym=function(){var e;(e=this.downloadManager)==null||e.openOrDownloadData(this.content,this.filename)};var Ll,va,Il,qn,Vd,Ea,Wd,Km,Xd,Jm,qd;let Ob=(qd=class{constructor({div:t,accessibilityManager:e,annotationCanvasMap:s,annotationEditorUIManager:i,page:r,viewport:a,structTreeLayer:o,commentManager:l,linkService:h,annotationStorage:c}){f(this,Wd);f(this,Xd);f(this,Ll,null);f(this,va,null);f(this,Il,null);f(this,qn,new Map);f(this,Vd,null);f(this,Ea,null);this.div=t,p(this,Ll,e),p(this,va,s),p(this,Vd,o||null),p(this,Ea,h||null),p(this,Il,c||new kb),this.page=r,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=i,this._commentManager=l||null}hasEditableAnnotations(){return n(this,qn).size>0}async render(t){var a,o,l;const{annotations:e}=t,s=this.div;dr(s,this.viewport);const i=new Map,r={data:null,layer:s,linkService:n(this,Ea),downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new tc,annotationStorage:n(this,Il),enableComment:t.enableComment===!0,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const h of e){if(h.noHTML)continue;const c=h.annotationType===Mt.POPUP;if(c){const m=i.get(h.id);if(!m)continue;r.elements=m}else if(h.rect[2]===h.rect[0]||h.rect[3]===h.rect[1])continue;r.data=h;const u=yy.create(r);if(!u.isRenderable)continue;if(!c&&h.popupRef){const m=i.get(h.popupRef);m?m.push(u):i.set(h.popupRef,[u])}const g=u.render();h.hidden&&(g.style.visibility="hidden"),await b(this,Wd,Km).call(this,g,h.id,r.elements),(o=(a=u.extraPopupElement)==null?void 0:a.popup)==null||o.renderCommentButton(),u._isEditable&&(n(this,qn).set(u.data.id,u),(l=this._annotationEditorUIManager)==null||l.renderAnnotationElement(u))}b(this,Xd,Jm).call(this)}async addLinkAnnotations(t){const e={data:null,layer:this.div,linkService:n(this,Ea),svgFactory:new tc,parent:this};for(const s of t){s.borderStyle||(s.borderStyle=qd._defaultBorderStyle),e.data=s;const i=yy.create(e);if(!i.isRenderable)continue;const r=i.render();await b(this,Wd,Km).call(this,r,s.id,null)}}update({viewport:t}){const e=this.div;this.viewport=t,dr(e,{rotation:t.rotation}),b(this,Xd,Jm).call(this),e.hidden=!1}getEditableAnnotations(){return Array.from(n(this,qn).values())}getEditableAnnotation(t){return n(this,qn).get(t)}addFakeAnnotation(t){var o;const{div:e}=this,{id:s,rotation:i}=t,r=new B0({data:{id:s,rect:t.getPDFRect(),rotation:i},editor:t,layer:e,parent:this,enableComment:!!this._commentManager,linkService:n(this,Ea),annotationStorage:n(this,Il)}),a=r.render();return e.append(a),(o=n(this,Ll))==null||o.moveElementInDOM(e,a,a,!1),r.createOrUpdatePopup(),r}static get _defaultBorderStyle(){return q(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:to.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},Ll=new WeakMap,va=new WeakMap,Il=new WeakMap,qn=new WeakMap,Vd=new WeakMap,Ea=new WeakMap,Wd=new WeakSet,Km=async function(t,e,s){var o,l;const i=t.firstChild||t,r=i.id=`${xb}${e}`,a=await((o=n(this,Vd))==null?void 0:o.getAriaAttributes(r));if(a)for(const[h,c]of a)i.setAttribute(h,c);s?s.at(-1).container.after(t):(this.div.append(t),(l=n(this,Ll))==null||l.moveElementInDOM(this.div,t,i,!1))},Xd=new WeakSet,Jm=function(){var e;if(!n(this,va))return;const t=this.div;for(const[s,i]of n(this,va)){const r=t.querySelector(`[data-annotation-id="${s}"]`);if(!r)continue;i.className="annotationContent";const{firstChild:a}=r;a?a.nodeName==="CANVAS"?a.replaceWith(i):a.classList.contains("annotationContent")?a.after(i):a.before(i):r.append(i);const o=n(this,qn).get(s);o&&(o._hasNoCanvas?((e=this._annotationEditorUIManager)==null||e.setMissingCanvas(s,r.id,i),o._hasNoCanvas=!1):o.canvas=i)}n(this,va).clear()},qd);const Xu=/\r\n?|\n/g;var Ye,Yd,Sa,Ke,Gp,ew,zp,sw,Vp,iw,Fl,ff,Nl,pf,Ol,gf,Wp,nw,Kd,Zm,Xp,rw;const pt=class pt extends mt{constructor(e){super({...e,name:"freeTextEditor"});f(this,Gp);f(this,zp);f(this,Vp);f(this,Fl);f(this,Ol);f(this,Wp);f(this,Xp);f(this,Ye,"");f(this,Yd,`${this.id}-editor`);f(this,Sa,null);f(this,Ke,void 0);k(this,"_colorPicker",null);this.color=e.color||pt._defaultColor||mt._defaultLineColor,p(this,Ke,e.fontSize||pt._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static get _keyboardManager(){const e=pt.prototype,s=a=>a.isEmpty(),i=ur.TRANSLATE_SMALL,r=ur.TRANSLATE_BIG;return q(this,"_keyboardManager",new Iu([[["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:[-i,0],checker:s}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-r,0],checker:s}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[i,0],checker:s}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[r,0],checker:s}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:s}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-r],checker:s}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,i],checker:s}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,r],checker:s}]]))}static initialize(e,s){mt.initialize(e,s);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,s){switch(e){case J.FREETEXT_SIZE:pt._defaultFontSize=s;break;case J.FREETEXT_COLOR:pt._defaultColor=s;break}}updateParams(e,s){switch(e){case J.FREETEXT_SIZE:b(this,Gp,ew).call(this,s);break;case J.FREETEXT_COLOR:b(this,zp,sw).call(this,s);break}}static get defaultPropertiesToUpdate(){return[[J.FREETEXT_SIZE,pt._defaultFontSize],[J.FREETEXT_COLOR,pt._defaultColor||mt._defaultLineColor]]}get propertiesToUpdate(){return[[J.FREETEXT_SIZE,n(this,Ke)],[J.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new If(this)),[["colorPicker",this._colorPicker]]}get colorType(){return J.FREETEXT_COLOR}onUpdatedColor(){var e;this.editorDiv.style.color=this.color,(e=this._colorPicker)==null||e.update(this.color),super.onUpdatedColor()}_translateEmpty(e,s){this._uiManager.translateSelectedEditors(e,s,!0)}getInitialTranslation(){const e=this.parentScale;return[-pt._internalPadding*e,-(pt._internalPadding+n(this,Ke))*e]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(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"),p(this,Sa,new AbortController);const e=this._uiManager.combinedSignal(n(this,Sa));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(){var e;return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",n(this,Yd)),this._isDraggable=!0,(e=n(this,Sa))==null||e.abort(),p(this,Sa,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){var s;this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),(s=this._initialOptions)!=null&&s.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()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=n(this,Ye),s=p(this,Ye,b(this,Vp,iw).call(this).trimEnd());if(e===s)return;const i=r=>{if(p(this,Ye,r),!r){this.remove();return}b(this,Ol,gf).call(this),this._uiManager.rebuild(this),b(this,Fl,ff).call(this)};this.addCommands({cmd:()=>{i(s)},undo:()=>{i(e)},mustExec:!1}),b(this,Fl,ff).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){pt._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,s;(this._isCopy||this.annotationElementId)&&(e=this.x,s=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",n(this,Yd)),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(${n(this,Ke)}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[r,a]=this.parentDimensions;if(this.annotationElementId){const{position:o}=this._initialData;let[l,h]=this.getInitialTranslation();[l,h]=this.pageTranslationToScreen(l,h);const[c,u]=this.pageDimensions,[g,m]=this.pageTranslation;let A,y;switch(this.rotation){case 0:A=e+(o[0]-g)/c,y=s+this.height-(o[1]-m)/u;break;case 90:A=e+(o[0]-g)/c,y=s-(o[1]-m)/u,[l,h]=[h,-l];break;case 180:A=e-this.width+(o[0]-g)/c,y=s-(o[1]-m)/u,[l,h]=[-l,-h];break;case 270:A=e+(o[0]-g-this.height*u)/c,y=s+(o[1]-m-this.width*c)/u,[l,h]=[-h,l];break}this.setAt(A*r,y*a,l,h)}else this._moveAfterPaste(e,s);b(this,Ol,gf).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(e){var A,y,v;const s=e.clipboardData||window.clipboardData,{types:i}=s;if(i.length===1&&i[0]==="text/plain")return;e.preventDefault();const r=b(A=pt,Kd,Zm).call(A,s.getData("text")||"").replaceAll(Xu,`