@openlist-frontend/openlist-frontend 4.1.2 → 4.1.4
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.
- package/dist/VERSION +1 -1
- package/dist/assets/{2fa-CCFlqx2T.js → 2fa-MPgWo9W_.js} +1 -1
- package/dist/assets/2fa-legacy-CDrXBcgT.js +1 -0
- package/dist/{lite/assets/About-BHhRbjVD.js → assets/About-gmZhmLDK.js} +1 -1
- package/dist/{lite/assets/About-legacy-BjZ9a-D4.js → assets/About-legacy-DegyyFdr.js} +1 -1
- package/dist/assets/{AddOrEdit-_zz799sr.js → AddOrEdit-BobWy7Hl.js} +1 -1
- package/dist/assets/{AddOrEdit-CLMCuixr.js → AddOrEdit-ClDZs9Gh.js} +1 -1
- package/dist/assets/AddOrEdit-YlZx1qqY.js +1 -0
- package/dist/{lite/assets/AddOrEdit-legacy-C0H8ZQZM.js → assets/AddOrEdit-legacy-5LdMVFrL.js} +1 -1
- package/dist/assets/AddOrEdit-legacy-D9IfjQvf.js +1 -0
- package/dist/assets/{AddOrEdit-legacy-XB-LJ3hG.js → AddOrEdit-legacy-Qy2JZe59.js} +1 -1
- package/dist/assets/{AddOrEdit-legacy-DOGScAkh.js → AddOrEdit-legacy-THtLJwjH.js} +1 -1
- package/dist/assets/{AddOrEdit-BmuPXl2I.js → AddOrEdit-wA7fnPTI.js} +1 -1
- package/dist/assets/Common-BuBvMCMi.js +1 -0
- package/dist/assets/{Common-legacy-BSf879V4.js → Common-legacy-bSL3GW_M.js} +1 -1
- package/dist/assets/{Copy-CkR5VhSS.js → Copy-ClQyMgrb.js} +1 -1
- package/dist/assets/{Copy-legacy-B9gU0-IV.js → Copy-legacy-BOzeXg7c.js} +1 -1
- package/dist/assets/Decompress-B1i0J0Wj.js +1 -0
- package/dist/assets/{Decompress-legacy-KOaj0s6C.js → Decompress-legacy-AEk_srr0.js} +1 -1
- package/dist/assets/{DeletePopover-GJ24w0i7.js → DeletePopover-4ysUXh3B.js} +1 -1
- package/dist/assets/{DeletePopover-legacy-TcFZ4pFU.js → DeletePopover-legacy-Csf-6V7h.js} +1 -1
- package/dist/assets/File-Calaq_Yl.js +2 -0
- package/dist/assets/{File-legacy-4hdOG1WO.js → File-legacy-DcL_XfRy.js} +1 -1
- package/dist/assets/Folder-BAk1Wm3F.js +115 -0
- package/dist/{lite/assets/Folder-legacy-BNVnRmPi.js → assets/Folder-legacy-BBz8q6vH.js} +2 -2
- package/dist/assets/{FolderTree-DPYLfXD8.js → FolderTree-C7ixGeNd.js} +1 -1
- package/dist/assets/{FolderTree-legacy-hFoXXqpY.js → FolderTree-legacy-BtP457mV.js} +1 -1
- package/dist/assets/Grid-B9N1lK77.js +1 -0
- package/dist/assets/Grid-legacy-DdgU3rUD.js +1 -0
- package/dist/assets/{GridItem-Df9Qe69_.js → GridItem-C-z3N-xp.js} +1 -1
- package/dist/assets/{GridItem-legacy-BNRTqRBe.js → GridItem-legacy-BKwZyzaf.js} +1 -1
- package/dist/assets/{ImageWithError-TZXLWR4X.js → ImageWithError-CLp4z8jl.js} +1 -1
- package/dist/assets/{ImageWithError-legacy-BvWTPQ7s.js → ImageWithError-legacy-ByIifoJ_.js} +1 -1
- package/dist/{lite/assets/Images-Dxj1VqWp.js → assets/Images-CGtIvgHa.js} +1 -1
- package/dist/assets/{Images-legacy-CgvISL4n.js → Images-legacy-CnbH91Sb.js} +1 -1
- package/dist/assets/Layout-DU30Mvuh.js +6 -0
- package/dist/assets/Layout-legacy-CxoncQdH.js +6 -0
- package/dist/assets/List-CYeqfOmD.js +1 -0
- package/dist/assets/List-legacy-BmcDzyTn.js +1 -0
- package/dist/assets/Messenger-BwvjCwX-.js +1 -0
- package/dist/assets/Messenger-legacy-CO-yoy6j.js +1 -0
- package/dist/assets/{Metas-D8Thi3Oi.js → Metas-DwM24bP-.js} +1 -1
- package/dist/assets/{Metas-legacy-VSkPA-vT.js → Metas-legacy-CkkOEw2q.js} +1 -1
- package/dist/assets/{Move-e8lzufO5.js → Move-BngKCQuI.js} +1 -1
- package/dist/assets/{Move-legacy-C9tciy-p.js → Move-legacy-BRxoOior.js} +1 -1
- package/dist/assets/{Other-CgXa7VVq.js → Other-DPfLdvXh.js} +1 -1
- package/dist/{lite/assets/Other-legacy-C_RALd5X.js → assets/Other-legacy-D0jsNqIV.js} +1 -1
- package/dist/assets/PackageDownload--uaHVzQo.js +1 -0
- package/dist/{lite/assets/PackageDownload-legacy-B5w3oqun.js → assets/PackageDownload-legacy-CpeaoO1g.js} +1 -1
- package/dist/assets/{Paginator-C8h2lwF7.js → Paginator-C54JhlYe.js} +1 -1
- package/dist/assets/{Paginator-legacy-COW84j64.js → Paginator-legacy-D_4wDqx5.js} +1 -1
- package/dist/assets/{Password-DEewIi5a.js → Password-CWvJeOiV.js} +1 -1
- package/dist/assets/{Password-legacy-V_8yAgHH.js → Password-legacy-CdFdyh7o.js} +1 -1
- package/dist/{lite/assets/Profile-DYghWMGT.js → assets/Profile-8HEofLfP.js} +1 -1
- package/dist/{lite/assets/Profile-legacy-DPNTXJSe.js → assets/Profile-legacy-D0UFy5xg.js} +1 -1
- package/dist/{lite/assets/PublicKeys-BfcRZzQs.js → assets/PublicKeys-Bie7Qp6M.js} +1 -1
- package/dist/assets/{PublicKeys-legacy-BOKi27PF.js → PublicKeys-legacy-BY3rcj-K.js} +1 -1
- package/dist/assets/{ResponsiveGrid-C5alewH_.js → ResponsiveGrid-BykSwb_j.js} +1 -1
- package/dist/assets/{ResponsiveGrid-legacy-rLzPeoz6.js → ResponsiveGrid-legacy-EuQbkIIN.js} +1 -1
- package/dist/assets/{S3-DqtoY2K6.js → S3-C7yQFSX0.js} +1 -1
- package/dist/{lite/assets/S3-legacy-CQNViT40.js → assets/S3-legacy-BY24Gd6Z.js} +1 -1
- package/dist/assets/{SettingItem-Cr17_PCr.js → SettingItem-ZfXk9TXC.js} +1 -1
- package/dist/assets/{SettingItem-legacy-Um-MX_L3.js → SettingItem-legacy-SQTK5BL5.js} +1 -1
- package/dist/assets/Shares-CE3gOYSL.js +1 -0
- package/dist/assets/Shares-legacy-D2f6zOVL.js +1 -0
- package/dist/assets/Storages-PM5QQYwI.js +1 -0
- package/dist/assets/Storages-legacy-ChDkNwbd.js +1 -0
- package/dist/{lite/assets/Upload-CPukUUlD.js → assets/Upload-DBhdWkNn.js} +1 -1
- package/dist/assets/{Upload-BRjvT-2w.js → Upload-DPicEiWj.js} +1 -1
- package/dist/assets/{Upload-legacy-BVn4wm_0.js → Upload-legacy-BdzG-Rqk.js} +1 -1
- package/dist/assets/{Upload-legacy-D53whrOo.js → Upload-legacy-VhaBhBM-.js} +1 -1
- package/dist/assets/Users-C8FlUcPm.js +1 -0
- package/dist/assets/{Users-legacy-DqI1uzdG.js → Users-legacy-BvpUDdwv.js} +1 -1
- package/dist/assets/{Wether-CFiD0-tm.js → Wether-DQJKqKO1.js} +1 -1
- package/dist/assets/{Wether-legacy-DNtog8xq.js → Wether-legacy-D3X-nyzl.js} +1 -1
- package/dist/assets/aliyun_video-legacy-CfcxNo2d.js +1 -0
- package/dist/assets/aliyun_video-nMhjQCP8.js +1 -0
- package/dist/assets/archive-bQX99ULF.js +1 -0
- package/dist/assets/archive-legacy-CjVZ4qfk.js +1 -0
- package/dist/assets/artplayer-BR-yr-oe.js +6 -0
- package/dist/assets/artplayer-hJ0Nm-8k.css +1 -0
- package/dist/assets/artplayer-legacy-zvFU_rxQ.js +1 -0
- package/dist/{lite/assets/asciinema-BFctz1w1.js → assets/asciinema-0A1-_qGr.js} +1 -1
- package/dist/{lite/assets/asciinema-legacy-ri3UmtC0.js → assets/asciinema-legacy-BYAUa-kP.js} +1 -1
- package/dist/{lite/assets/audio-legacy-Dp7z-JdK.js → assets/audio-legacy-CJzwlnQD.js} +1 -1
- package/dist/assets/audio-tA9tGFJU.js +1 -0
- package/dist/{lite/assets/backup-restore-KcvZd3J3.js → assets/backup-restore-Btk42qDj.js} +1 -1
- package/dist/{lite/assets/backup-restore-legacy-BCfuAkwO.js → assets/backup-restore-legacy-HRodQMvJ.js} +1 -1
- package/dist/assets/entry-CQHbbmfz.js +1 -0
- package/dist/assets/entry-DNrH647C.js +1 -0
- package/dist/assets/entry-legacy-B-kSvqSM.js +1 -0
- package/dist/assets/entry-legacy-CvjIonQ4.js +1 -0
- package/dist/assets/{flash-Bbtu3KV4.js → flash-DZyx3C-0.js} +1 -1
- package/dist/assets/{flash-legacy-C-To8MhN.js → flash-legacy-BIlG-8wc.js} +1 -1
- package/dist/assets/{heic-CODmZLqE.js → heic-Bf1JHcrk.js} +1 -1
- package/dist/assets/{heic-legacy-DkeETeGc.js → heic-legacy-BPw9au8B.js} +1 -1
- package/dist/assets/{helper-DQ6i1N_z.js → helper-B6U9pCyh.js} +1 -1
- package/dist/assets/helper-b8qm2EJc.js +1 -0
- package/dist/assets/helper-legacy-CMhIu_HL.js +1 -0
- package/dist/{lite/assets/helper-legacy-B8loq6km.js → assets/helper-legacy-WpYYwNUo.js} +1 -1
- package/dist/assets/{html-Bv2vfjW6.js → html-COhBaQw3.js} +1 -1
- package/dist/assets/{html-legacy-Dox3i3gp.js → html-legacy-BJVmQUG0.js} +1 -1
- package/dist/{lite/assets/icon-DHjoKQ07.js → assets/icon-DrO_4BG6.js} +1 -1
- package/dist/assets/{icon-legacy-CE7Ss-Ia.js → icon-legacy-BR_-ACI1.js} +1 -1
- package/dist/assets/{image-Di2ob8ur.js → image-D1f596SZ.js} +1 -1
- package/dist/assets/image-legacy-BsyDel7x.js +1 -0
- package/dist/assets/index-B0tNcUjJ.js +21 -0
- package/dist/assets/index-B5iypTJp.js +1 -0
- package/dist/assets/index-BvYgQ7iF.js +14 -0
- package/dist/{lite/assets/index-7skNrC4W.js → assets/index-By4HMKfG.js} +1 -1
- package/dist/{lite/assets/index-Dyl9mACL.js → assets/index-ClfQ1K7A.js} +1 -1
- package/dist/assets/{index-BAx3cJXa.js → index-DJ5441tf.js} +1 -1
- package/dist/{lite/assets/index-DIyzNT5-.js → assets/index-DK9UI-hM.js} +1 -1
- package/dist/assets/index-DKOsdH_t.js +2 -0
- package/dist/assets/{index-D1UgPq5q.js → index-DVKLP7fN.js} +1 -1
- package/dist/assets/{index-BeQW3ZI3.js → index-ZTntABz9.js} +1 -1
- package/dist/assets/{index-legacy-B-rFd7c6.js → index-legacy-1ocYP5Qo.js} +1 -1
- package/dist/{lite/assets/index-legacy-BzDCaMfF.js → assets/index-legacy-BPYQBBdN.js} +1 -1
- package/dist/assets/index-legacy-BUop_2pr.js +1 -0
- package/dist/{lite/assets/index-legacy-C8YlOf7v.js → assets/index-legacy-BWInRj-5.js} +1 -1
- package/dist/assets/index-legacy-CS9X6zvl.js +18 -0
- package/dist/assets/{index-legacy-B4yRbF0f.js → index-legacy-CoOpRRMD.js} +4 -4
- package/dist/assets/index-legacy-D8V8zGXo.js +1 -0
- package/dist/{lite/assets/index-legacy-DFD2MRpv.js → assets/index-legacy-DFvfSXPA.js} +1 -1
- package/dist/assets/{index-legacy-Dd27nSW1.js → index-legacy-DoPUsE8Q.js} +1 -1
- package/dist/{lite/assets/index-legacy-BCi4TNou.js → assets/index-legacy-SIkVkvCk.js} +1 -1
- package/dist/{lite/assets/indexes-BB1FITux.js → assets/indexes-D7m_s7dj.js} +1 -1
- package/dist/assets/{indexes-legacy-Deu5jDN_.js → indexes-legacy-C5lh6zLy.js} +1 -1
- package/dist/assets/{ipa-Budcp4XX.js → ipa-iZfc5ny_.js} +1 -1
- package/dist/assets/{ipa-legacy-CeHInztF.js → ipa-legacy-v-g-4SPo.js} +1 -1
- package/dist/assets/item_type-CyD6qwPS.js +1 -0
- package/dist/assets/{item_type-legacy-NfhfVKtF.js → item_type-legacy-BFH7Oxl9.js} +1 -1
- package/dist/assets/{markdown-Ds7Y4Rtw.js → markdown-BOrQcm-y.js} +1 -1
- package/dist/assets/markdown-legacy-3p8qxq4z.js +1 -0
- package/dist/assets/markdown_with_word_wrap-CahOHjvd.js +1 -0
- package/dist/assets/markdown_with_word_wrap-legacy-BmLd9pEP.js +1 -0
- package/dist/assets/{offline_download-legacy-Isda71Y-.js → offline_download-legacy-Bf3euZLf.js} +1 -1
- package/dist/assets/offline_download-oMg4a0C3.js +1 -0
- package/dist/assets/{pdf-legacy-CLjXYdW0.js → pdf-legacy-MMwEmj0t.js} +1 -1
- package/dist/assets/pdf-unezGBT4.js +1 -0
- package/dist/assets/plist-legacy-sli62gSc.js +1 -0
- package/dist/assets/plist-ts9bst_R.js +1 -0
- package/dist/assets/share-Wfl1CA3s.js +1 -0
- package/dist/assets/share-legacy-Cx-fbxkH.js +1 -0
- package/dist/assets/storage-D_MY-bv8.js +1 -0
- package/dist/assets/storage-legacy-Dj_KTUH1.js +1 -0
- package/dist/{lite/assets/style-B7bXIJsw.js → assets/style-CLimno2e.js} +1 -1
- package/dist/assets/{style-legacy-D7boJcKk.js → style-legacy-Qw_NuL2z.js} +1 -1
- package/dist/assets/{text-editor-5TlMuOsE.js → text-editor-835YdI16.js} +1 -1
- package/dist/{lite/assets/text-editor-legacy-D9zllqsE.js → assets/text-editor-legacy-MXGybM1L.js} +1 -1
- package/dist/assets/{url-DGRkhi-d.js → url-BMjGkiT9.js} +1 -1
- package/dist/assets/url-legacy-CBsQYltk.js +1 -0
- package/dist/assets/{useTitle-legacy-ChUcA9IA.js → useTitle-legacy-CCBAA_c8.js} +1 -1
- package/dist/assets/{useTitle-BxtUm_0q.js → useTitle-v8G69LwI.js} +1 -1
- package/dist/assets/video-BCb4MKbs.js +7 -0
- package/dist/assets/video-legacy-CUKpJmwn.js +9 -0
- package/dist/assets/video360-ClQMqCaO.js +14 -0
- package/dist/assets/{video360-legacy-BdeGQa07.js → video360-legacy-B9h5Ttkj.js} +1 -1
- package/dist/assets/video_box-B0CZUIHx.js +6 -0
- package/dist/assets/video_box-legacy-BhztJ1q2.js +1 -0
- package/dist/i18n.tar.gz +0 -0
- package/dist/index.html +2 -2
- package/dist/lite/VERSION +1 -1
- package/dist/lite/assets/{2fa-B4n3iRBP.js → 2fa-BmBEiSRR.js} +1 -1
- package/dist/lite/assets/2fa-legacy-wGVQ6LRQ.js +1 -0
- package/dist/{assets/About-DV0hpLCc.js → lite/assets/About-CyvwxCH0.js} +1 -1
- package/dist/{assets/About-legacy-HfdMKJgK.js → lite/assets/About-legacy-DuBrDxzH.js} +1 -1
- package/dist/lite/assets/{AddOrEdit-BasDVecN.js → AddOrEdit-C3i-Vuj3.js} +1 -1
- package/dist/lite/assets/{AddOrEdit-DhYONn_j.js → AddOrEdit-C4XMiND9.js} +1 -1
- package/dist/lite/assets/AddOrEdit-CVhCuKJB.js +1 -0
- package/dist/lite/assets/AddOrEdit-legacy-D00_z8Ga.js +1 -0
- package/dist/lite/assets/{AddOrEdit-legacy-D6qm5_c2.js → AddOrEdit-legacy-DGA6bK1N.js} +1 -1
- package/dist/lite/assets/{AddOrEdit-legacy-HZnf7Kal.js → AddOrEdit-legacy-HkyA089d.js} +1 -1
- package/dist/{assets/AddOrEdit-legacy-Cg-OCHgE.js → lite/assets/AddOrEdit-legacy-ISUkxfZ-.js} +1 -1
- package/dist/lite/assets/{AddOrEdit-BCNI2VjN.js → AddOrEdit-vqRen1Bw.js} +1 -1
- package/dist/lite/assets/Common-DGmkJwav.js +1 -0
- package/dist/lite/assets/{Common-legacy-CYvJpufV.js → Common-legacy-CkQHmt1l.js} +1 -1
- package/dist/lite/assets/{Copy-JID2_Td8.js → Copy-BbJLPx_6.js} +1 -1
- package/dist/lite/assets/{Copy-legacy-Pbuk6D31.js → Copy-legacy-B1E9Y375.js} +1 -1
- package/dist/lite/assets/Decompress-DrprJy9c.js +1 -0
- package/dist/lite/assets/{Decompress-legacy--HjmgGbI.js → Decompress-legacy-BoQFH_LG.js} +1 -1
- package/dist/lite/assets/{DeletePopover-BJaYEjR-.js → DeletePopover-D42apEN8.js} +1 -1
- package/dist/lite/assets/{DeletePopover-legacy-BDnF5xDY.js → DeletePopover-legacy-3-H7HjF3.js} +1 -1
- package/dist/lite/assets/File-Kold2EZA.js +2 -0
- package/dist/lite/assets/{File-legacy-DQx9EZEG.js → File-legacy-BDBS8JJW.js} +1 -1
- package/dist/lite/assets/Folder-C1ZBm1No.js +115 -0
- package/dist/{assets/Folder-legacy-Cs8Bp6PW.js → lite/assets/Folder-legacy-Dr6X1E-q.js} +2 -2
- package/dist/lite/assets/{FolderTree-CYeej_v3.js → FolderTree-CTh3_qOS.js} +1 -1
- package/dist/lite/assets/{FolderTree-legacy-Be6l5hdj.js → FolderTree-legacy-DAN7i0-E.js} +1 -1
- package/dist/lite/assets/Grid-BdDsv98y.js +1 -0
- package/dist/lite/assets/Grid-legacy-DsbOUNzM.js +1 -0
- package/dist/lite/assets/{GridItem-DnYpST4w.js → GridItem-CFKmo0Sw.js} +1 -1
- package/dist/lite/assets/{GridItem-legacy-ymOiepIZ.js → GridItem-legacy-DHlY1Xxd.js} +1 -1
- package/dist/lite/assets/{ImageWithError-CH_zPc6U.js → ImageWithError-BqB24ruv.js} +1 -1
- package/dist/lite/assets/{ImageWithError-legacy-nX9fnKWZ.js → ImageWithError-legacy-y8dqCaBH.js} +1 -1
- package/dist/{assets/Images-C6AcZbFh.js → lite/assets/Images-CnHcHWFe.js} +1 -1
- package/dist/lite/assets/{Images-legacy-DuWCwG4V.js → Images-legacy-CttGgF3X.js} +1 -1
- package/dist/lite/assets/Layout-CjSD56n-.js +6 -0
- package/dist/lite/assets/Layout-legacy-BpAjKXAb.js +6 -0
- package/dist/lite/assets/List-BAvJG6dz.js +1 -0
- package/dist/lite/assets/List-legacy-B4FmRG-Z.js +1 -0
- package/dist/lite/assets/Messenger-DBhjR6T3.js +1 -0
- package/dist/lite/assets/Messenger-legacy-BnpqMYOq.js +1 -0
- package/dist/lite/assets/{Metas-BgvlP2sp.js → Metas-CBJ_ShAD.js} +1 -1
- package/dist/lite/assets/{Metas-legacy-BbUm71qS.js → Metas-legacy-BeqdCcC8.js} +1 -1
- package/dist/lite/assets/{Move-BRtPNJy7.js → Move-iYI042CY.js} +1 -1
- package/dist/lite/assets/{Move-legacy-D_29YFjE.js → Move-legacy-CXLW2h8E.js} +1 -1
- package/dist/lite/assets/{Other-hPXGbR_N.js → Other-BTo5lP3X.js} +1 -1
- package/dist/{assets/Other-legacy-DcW5JtXX.js → lite/assets/Other-legacy-DJpgWEZu.js} +1 -1
- package/dist/lite/assets/PackageDownload-BLCc2kgF.js +1 -0
- package/dist/{assets/PackageDownload-legacy-Cb6O_fnj.js → lite/assets/PackageDownload-legacy-B_Qfnhq0.js} +1 -1
- package/dist/lite/assets/{Paginator-Dept2TLt.js → Paginator-B-OvlJcl.js} +1 -1
- package/dist/lite/assets/{Paginator-legacy-o94VgWBO.js → Paginator-legacy-Brr0o-1E.js} +1 -1
- package/dist/lite/assets/{Password-esenZoCw.js → Password-e5jgnibX.js} +1 -1
- package/dist/lite/assets/{Password-legacy-DnFsxOn8.js → Password-legacy-BrmrYkpQ.js} +1 -1
- package/dist/{assets/Profile-B3l5xd0i.js → lite/assets/Profile-Dxw9HCop.js} +1 -1
- package/dist/{assets/Profile-legacy-CmRxhRGj.js → lite/assets/Profile-legacy-DQrqdbeO.js} +1 -1
- package/dist/{assets/PublicKeys-DX8ybApa.js → lite/assets/PublicKeys-T_ouY8oQ.js} +1 -1
- package/dist/lite/assets/{PublicKeys-legacy-BYZl4tZs.js → PublicKeys-legacy-Bs1vMOWk.js} +1 -1
- package/dist/lite/assets/{ResponsiveGrid-D1j1qCSi.js → ResponsiveGrid-VTNos9Q3.js} +1 -1
- package/dist/lite/assets/{ResponsiveGrid-legacy-B8XSyY6D.js → ResponsiveGrid-legacy-B3XB4KcT.js} +1 -1
- package/dist/lite/assets/{S3-FPjsiRYd.js → S3-Ecoo2800.js} +1 -1
- package/dist/{assets/S3-legacy-CaK87Mzi.js → lite/assets/S3-legacy-Bp1LTHZR.js} +1 -1
- package/dist/lite/assets/{SettingItem-D422kS-B.js → SettingItem-EdBZszST.js} +1 -1
- package/dist/lite/assets/{SettingItem-legacy-8p207Kai.js → SettingItem-legacy-DcuCPY8O.js} +1 -1
- package/dist/lite/assets/Shares-DJ4dwZHD.js +1 -0
- package/dist/lite/assets/Shares-legacy-BNeuFsql.js +1 -0
- package/dist/lite/assets/Storages-Xwt1x9AT.js +1 -0
- package/dist/lite/assets/Storages-legacy-DmZm8uvm.js +1 -0
- package/dist/{assets/Upload-8LkMnbyy.js → lite/assets/Upload-B-2NJ_9D.js} +1 -1
- package/dist/lite/assets/{Upload-Cj9EJioJ.js → Upload-Cl6_9Ugt.js} +1 -1
- package/dist/lite/assets/{Upload-legacy-CWqWvwM8.js → Upload-legacy-BeitKlNL.js} +1 -1
- package/dist/lite/assets/{Upload-legacy-DwngiWPp.js → Upload-legacy-CEzjNxY-.js} +1 -1
- package/dist/lite/assets/Users-D5veWkwg.js +1 -0
- package/dist/lite/assets/{Users-legacy-TmQpPKBf.js → Users-legacy-BiefIOlS.js} +1 -1
- package/dist/lite/assets/{Wether-u3K9PAb2.js → Wether-DITzMbFL.js} +1 -1
- package/dist/lite/assets/{Wether-legacy-BUinTlZ_.js → Wether-legacy-CbG7auAA.js} +1 -1
- package/dist/lite/assets/aliyun_video-CYyWa90F.js +1 -0
- package/dist/lite/assets/aliyun_video-legacy-78vtSluh.js +1 -0
- package/dist/lite/assets/archive-GghKG2_F.js +1 -0
- package/dist/lite/assets/archive-legacy-Q8Q7XROJ.js +1 -0
- package/dist/lite/assets/artplayer-Dg3pv1G8.js +6 -0
- package/dist/lite/assets/artplayer-hJ0Nm-8k.css +1 -0
- package/dist/lite/assets/artplayer-legacy-JU1lbWOE.js +1 -0
- package/dist/{assets/asciinema-legacy-2mOQg0U6.js → lite/assets/asciinema-legacy-45DKdJmu.js} +1 -1
- package/dist/{assets/asciinema-DvdgH2WA.js → lite/assets/asciinema-yWwGBqqp.js} +1 -1
- package/dist/lite/assets/audio-CoHN33Nq.js +1 -0
- package/dist/{assets/audio-legacy-l_Xm65sg.js → lite/assets/audio-legacy-D8kZVa0z.js} +1 -1
- package/dist/{assets/backup-restore-DUS-kT8G.js → lite/assets/backup-restore-cXYIE1MJ.js} +1 -1
- package/dist/{assets/backup-restore-legacy-CSCFKDh3.js → lite/assets/backup-restore-legacy-E4EGb8wt.js} +1 -1
- package/dist/lite/assets/entry-62x9OPjI.js +1 -0
- package/dist/lite/assets/entry-YpX1scD8.js +1 -0
- package/dist/lite/assets/entry-legacy-BfC-MLD9.js +1 -0
- package/dist/lite/assets/entry-legacy-C1NyxG4d.js +1 -0
- package/dist/lite/assets/{flash-14bT4xwK.js → flash-Bl79kQiw.js} +1 -1
- package/dist/lite/assets/{flash-legacy-ez6m065e.js → flash-legacy-CqTb95L0.js} +1 -1
- package/dist/lite/assets/{heic-B1nh04EG.js → heic-C7qtoKzI.js} +1 -1
- package/dist/lite/assets/{heic-legacy-BYtoSGaZ.js → heic-legacy-DLchEF2N.js} +1 -1
- package/dist/lite/assets/{helper-BW6klSDw.js → helper-Dlk8y7oL.js} +1 -1
- package/dist/lite/assets/helper-QAlD0cXo.js +1 -0
- package/dist/lite/assets/helper-legacy-BpXPy3aZ.js +1 -0
- package/dist/{assets/helper-legacy-DFSSPEwd.js → lite/assets/helper-legacy-Dnduz_aE.js} +1 -1
- package/dist/lite/assets/{html-BdcePskP.js → html-CkWxU417.js} +1 -1
- package/dist/lite/assets/{html-legacy-Dqjq3KHQ.js → html-legacy-CaXjiIuM.js} +1 -1
- package/dist/{assets/icon-B43O8tOH.js → lite/assets/icon-BZFY9fuK.js} +1 -1
- package/dist/lite/assets/{icon-legacy-DmRfBtUq.js → icon-legacy-fy54up3n.js} +1 -1
- package/dist/lite/assets/{image-BVe350ay.js → image-Dp0-7yIW.js} +1 -1
- package/dist/lite/assets/image-legacy-BTDI9QnK.js +1 -0
- package/dist/lite/assets/index-3N2OqIV6.js +2 -0
- package/dist/{assets/index-BrTsUzIw.js → lite/assets/index-B-NmelxC.js} +1 -1
- package/dist/{assets/index-CEW8OeWP.js → lite/assets/index-BAfmrY7N.js} +1 -1
- package/dist/{assets/index-CyZVpRx7.js → lite/assets/index-BCWlQ1xm.js} +1 -1
- package/dist/lite/assets/{index-CBVGXYte.js → index-C2RHIHtc.js} +1 -1
- package/dist/lite/assets/index-CNZMR1GT.js +21 -0
- package/dist/lite/assets/{index-Pq7HU_X9.js → index-DUl6hczb.js} +1 -1
- package/dist/lite/assets/index-DsSWFirV.js +1 -0
- package/dist/lite/assets/index-DvQYEsdd.js +14 -0
- package/dist/lite/assets/{index-legacy-CiMdb3v0.js → index-legacy-BGUFxny_.js} +4 -4
- package/dist/{assets/index-legacy-DdwhF1y-.js → lite/assets/index-legacy-BVQ2Muq9.js} +1 -1
- package/dist/{assets/index-legacy-n9W7xTEF.js → lite/assets/index-legacy-BbfMcMsh.js} +1 -1
- package/dist/lite/assets/{index-legacy-GVW8cXlt.js → index-legacy-CH9QEyQP.js} +1 -1
- package/dist/{assets/index-legacy-PWFHfG_f.js → lite/assets/index-legacy-CXYN-DZC.js} +1 -1
- package/dist/lite/assets/index-legacy-CwkvHJvM.js +1 -0
- package/dist/{assets/index-legacy-pIG9W8ie.js → lite/assets/index-legacy-DVBgQjo3.js} +1 -1
- package/dist/lite/assets/index-legacy-DgbbakiJ.js +18 -0
- package/dist/lite/assets/{index-legacy-D6EiN71D.js → index-legacy-DpAMCNat.js} +1 -1
- package/dist/lite/assets/index-legacy-qD49SIrt.js +1 -0
- package/dist/lite/assets/{index-BdusgsNY.js → index-xphpXrTh.js} +1 -1
- package/dist/{assets/indexes-D5RI4hok.js → lite/assets/indexes-C2QGQEmM.js} +1 -1
- package/dist/lite/assets/{indexes-legacy-ZlZzSh5d.js → indexes-legacy-B2z54ovo.js} +1 -1
- package/dist/lite/assets/{ipa-DogAlOBe.js → ipa-CnPKZFr6.js} +1 -1
- package/dist/lite/assets/{ipa-legacy-DI5DrPcy.js → ipa-legacy-BlDuCd2E.js} +1 -1
- package/dist/lite/assets/item_type-CyD6qwPS.js +1 -0
- package/dist/lite/assets/{item_type-legacy-NfhfVKtF.js → item_type-legacy-BFH7Oxl9.js} +1 -1
- package/dist/lite/assets/{markdown-CuFWSNkh.js → markdown-DxDjLtUN.js} +1 -1
- package/dist/lite/assets/markdown-legacy-CYi971Lb.js +1 -0
- package/dist/lite/assets/markdown_with_word_wrap-CB62OhjT.js +1 -0
- package/dist/lite/assets/markdown_with_word_wrap-legacy-C0_4CoEM.js +1 -0
- package/dist/lite/assets/offline_download-C_linla8.js +1 -0
- package/dist/lite/assets/{offline_download-legacy-CJN8rTR6.js → offline_download-legacy-DSbsfaZb.js} +1 -1
- package/dist/lite/assets/pdf-D6QoLlhP.js +1 -0
- package/dist/lite/assets/{pdf-legacy-BrqWSaWw.js → pdf-legacy-CjwHF0EY.js} +1 -1
- package/dist/lite/assets/plist-CRAxeKkR.js +1 -0
- package/dist/lite/assets/plist-legacy-CNhq75xq.js +1 -0
- package/dist/lite/assets/share-BRMiJJnc.js +1 -0
- package/dist/lite/assets/share-legacy-CrDD6m--.js +1 -0
- package/dist/lite/assets/storage-D_MY-bv8.js +1 -0
- package/dist/lite/assets/storage-legacy-Dj_KTUH1.js +1 -0
- package/dist/{assets/style-CUQUg6i1.js → lite/assets/style-Cn-hRd7R.js} +1 -1
- package/dist/lite/assets/{style-legacy-DoSk2tIF.js → style-legacy-Dq2e2uFG.js} +1 -1
- package/dist/lite/assets/{text-editor-CoiGG4PX.js → text-editor-CR6F0GfX.js} +1 -1
- package/dist/{assets/text-editor-legacy-Xf4PhAUE.js → lite/assets/text-editor-legacy-BBFHTJOG.js} +1 -1
- package/dist/lite/assets/{url-Dcl3gyG3.js → url-B3NbGwyf.js} +1 -1
- package/dist/lite/assets/url-legacy-DUCG7ifk.js +1 -0
- package/dist/lite/assets/{useTitle-Dta1n-65.js → useTitle-BClow7LS.js} +1 -1
- package/dist/lite/assets/{useTitle-legacy-INEQvCzU.js → useTitle-legacy-Ck1as0cr.js} +1 -1
- package/dist/lite/assets/video-iFR4ftvJ.js +7 -0
- package/dist/lite/assets/video-legacy-BM-JOgVh.js +9 -0
- package/dist/lite/assets/video360-i_8Dd5B7.js +14 -0
- package/dist/lite/assets/{video360-legacy-COkcF2xI.js → video360-legacy-Cee-gJAm.js} +1 -1
- package/dist/lite/assets/video_box-3TB8GlFk.js +6 -0
- package/dist/lite/assets/video_box-legacy-PmY7yzTM.js +1 -0
- package/dist/lite/i18n.tar.gz +0 -0
- package/dist/lite/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/2fa-legacy-Codxb6mv.js +0 -1
- package/dist/assets/AddOrEdit-BmtF6PL2.js +0 -1
- package/dist/assets/AddOrEdit-legacy-B1LNvb98.js +0 -1
- package/dist/assets/Common-CoWHGwOd.js +0 -1
- package/dist/assets/Decompress-DIMOZlAV.js +0 -1
- package/dist/assets/File-D7Un6PzF.js +0 -2
- package/dist/assets/Folder-Bfc7FItx.js +0 -115
- package/dist/assets/Grid-DUzWkp7c.js +0 -1
- package/dist/assets/Grid-legacy-2vmmMwKU.js +0 -1
- package/dist/assets/Layout-D3_tmKhh.js +0 -6
- package/dist/assets/Layout-legacy-_VGTtuc0.js +0 -6
- package/dist/assets/List-BQTlAH9J.js +0 -1
- package/dist/assets/List-legacy-CPauUJZ3.js +0 -1
- package/dist/assets/Messenger-C-fsew5o.js +0 -1
- package/dist/assets/Messenger-legacy-B2er_D6Z.js +0 -1
- package/dist/assets/PackageDownload-BVM2WWTF.js +0 -1
- package/dist/assets/Shares-DEQRJFZT.js +0 -1
- package/dist/assets/Shares-legacy-Bx7jXay8.js +0 -1
- package/dist/assets/Storages-eajll2GJ.js +0 -1
- package/dist/assets/Storages-legacy-BiRv83My.js +0 -1
- package/dist/assets/Users-DOQiYPle.js +0 -1
- package/dist/assets/aliyun_video-I2Lv9JIj.js +0 -1
- package/dist/assets/aliyun_video-legacy-4WrChe7I.js +0 -1
- package/dist/assets/archive-Dlm5WmV0.js +0 -1
- package/dist/assets/archive-legacy-DRm3kPmC.js +0 -1
- package/dist/assets/audio-DFG1ZG35.js +0 -1
- package/dist/assets/entry-8Wf3uEEB.js +0 -1
- package/dist/assets/entry-HsLBgWQ7.js +0 -1
- package/dist/assets/entry-legacy-Dj_dIAWX.js +0 -1
- package/dist/assets/entry-legacy-Dm6T527V.js +0 -1
- package/dist/assets/helper-legacy-0n_zKfVx.js +0 -1
- package/dist/assets/helper-pBRUfh2v.js +0 -1
- package/dist/assets/hls-DSXk01mU.js +0 -6
- package/dist/assets/hls-legacy-ZfJSMWjs.js +0 -8
- package/dist/assets/image-legacy-Bm8gmdQ0.js +0 -1
- package/dist/assets/index-BIqS3B56.js +0 -1
- package/dist/assets/index-C2tuPJaA.js +0 -21
- package/dist/assets/index-D8gw5_F6.js +0 -2
- package/dist/assets/index-dHzUJZqv.js +0 -14
- package/dist/assets/index-legacy-C1hZQoSn.js +0 -18
- package/dist/assets/index-legacy-DbY3jwuO.js +0 -1
- package/dist/assets/index-legacy-DrRldDss.js +0 -1
- package/dist/assets/item_type-CV3e5W3l.js +0 -1
- package/dist/assets/markdown-legacy-CgDYCJGT.js +0 -1
- package/dist/assets/markdown_with_word_wrap-CrcJpycH.js +0 -1
- package/dist/assets/markdown_with_word_wrap-legacy-Dihj0Yer.js +0 -1
- package/dist/assets/offline_download-DxpJvSO1.js +0 -1
- package/dist/assets/pdf-CfMOFvAk.js +0 -1
- package/dist/assets/plist-B2ey-UbE.js +0 -1
- package/dist/assets/plist-legacy-nNU188nf.js +0 -1
- package/dist/assets/share-DNtGrOny.js +0 -1
- package/dist/assets/share-legacy-CByhnUP5.js +0 -1
- package/dist/assets/url-legacy-zjBnPvq3.js +0 -1
- package/dist/assets/video-D8UBexeA.js +0 -7
- package/dist/assets/video-legacy-7ZBagWGT.js +0 -9
- package/dist/assets/video360-S9N_wRGU.js +0 -14
- package/dist/assets/video_box-DeH7KD70.js +0 -6
- package/dist/assets/video_box-legacy-Mw_-05cz.js +0 -8
- package/dist/lite/assets/2fa-legacy-Dj5_dvuI.js +0 -1
- package/dist/lite/assets/AddOrEdit-legacy-D0TWlHkD.js +0 -1
- package/dist/lite/assets/AddOrEdit-sm6uaDIy.js +0 -1
- package/dist/lite/assets/Common-BPK93nYo.js +0 -1
- package/dist/lite/assets/Decompress-C2Lk2JAD.js +0 -1
- package/dist/lite/assets/File-nLFXqvpn.js +0 -2
- package/dist/lite/assets/Folder-B9wfcsQn.js +0 -115
- package/dist/lite/assets/Grid-CJA599oi.js +0 -1
- package/dist/lite/assets/Grid-legacy-NuLJQxTX.js +0 -1
- package/dist/lite/assets/Layout-BCeH3ISX.js +0 -6
- package/dist/lite/assets/Layout-legacy-D-U-qCBj.js +0 -6
- package/dist/lite/assets/List-DWohtCjP.js +0 -1
- package/dist/lite/assets/List-legacy-7wU0oS5r.js +0 -1
- package/dist/lite/assets/Messenger-CsEswEQt.js +0 -1
- package/dist/lite/assets/Messenger-legacy-DrU2G55m.js +0 -1
- package/dist/lite/assets/PackageDownload-wVyvOPV1.js +0 -1
- package/dist/lite/assets/Shares-CNToMiBY.js +0 -1
- package/dist/lite/assets/Shares-legacy-CL4XTLn7.js +0 -1
- package/dist/lite/assets/Storages-DFKh9x2s.js +0 -1
- package/dist/lite/assets/Storages-legacy-DicEAOiz.js +0 -1
- package/dist/lite/assets/Users-BPxeaGf7.js +0 -1
- package/dist/lite/assets/aliyun_video-CW4BMFha.js +0 -1
- package/dist/lite/assets/aliyun_video-legacy-DH_5cfpn.js +0 -1
- package/dist/lite/assets/archive-BFanLdHk.js +0 -1
- package/dist/lite/assets/archive-legacy-CjwJABWB.js +0 -1
- package/dist/lite/assets/audio-Bz0HeFhq.js +0 -1
- package/dist/lite/assets/entry-B9dcANPh.js +0 -1
- package/dist/lite/assets/entry-C3ZspzL4.js +0 -1
- package/dist/lite/assets/entry-legacy-R7kMTo3V.js +0 -1
- package/dist/lite/assets/entry-legacy-eP5WFPw1.js +0 -1
- package/dist/lite/assets/helper-C_i2CKoc.js +0 -1
- package/dist/lite/assets/helper-legacy-Bt9qsJiz.js +0 -1
- package/dist/lite/assets/hls-B55FPkB1.js +0 -6
- package/dist/lite/assets/hls-legacy-Dyv4hjlJ.js +0 -8
- package/dist/lite/assets/image-legacy-CwUFPK2J.js +0 -1
- package/dist/lite/assets/index-B0k0lAAD.js +0 -21
- package/dist/lite/assets/index-CL47_I4K.js +0 -2
- package/dist/lite/assets/index-Dxmkyyam.js +0 -14
- package/dist/lite/assets/index-NPNVo9tx.js +0 -1
- package/dist/lite/assets/index-legacy-BhkNsIf-.js +0 -1
- package/dist/lite/assets/index-legacy-CiHQsOG2.js +0 -1
- package/dist/lite/assets/index-legacy-DG1n7Toc.js +0 -18
- package/dist/lite/assets/item_type-CV3e5W3l.js +0 -1
- package/dist/lite/assets/markdown-legacy-wqCwdPoE.js +0 -1
- package/dist/lite/assets/markdown_with_word_wrap-BbnhIxcj.js +0 -1
- package/dist/lite/assets/markdown_with_word_wrap-legacy-q_qBpxCP.js +0 -1
- package/dist/lite/assets/offline_download-gt_gfzRS.js +0 -1
- package/dist/lite/assets/pdf-BwR8x2Su.js +0 -1
- package/dist/lite/assets/plist-legacy-DysEcNae.js +0 -1
- package/dist/lite/assets/plist-zHbV8bKN.js +0 -1
- package/dist/lite/assets/share-B5zf6Y3e.js +0 -1
- package/dist/lite/assets/share-legacy-DH6yCSyI.js +0 -1
- package/dist/lite/assets/url-legacy-CKEaRjH-.js +0 -1
- package/dist/lite/assets/video-ayusCe4g.js +0 -7
- package/dist/lite/assets/video-legacy-C2hYIYr9.js +0 -9
- package/dist/lite/assets/video360-fBTGc__C.js +0 -14
- package/dist/lite/assets/video_box-DgIi5cnu.js +0 -6
- package/dist/lite/assets/video_box-legacy-DuUpHJiA.js +0 -8
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var j1=Object.defineProperty;var x0=h=>{throw TypeError(h)};var V1=(h,t,e)=>t in h?j1(h,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):h[t]=e;var M=(h,t,e)=>V1(h,typeof t!="symbol"?t+"":t,e),wg=(h,t,e)=>t.has(h)||x0("Cannot "+e);var a=(h,t,e)=>(wg(h,t,"read from private field"),e?e.call(h):t.get(h)),b=(h,t,e)=>t.has(h)?x0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(h):t.set(h,e),p=(h,t,e,i)=>(wg(h,t,"write to private field"),i?i.call(h,e):t.set(h,e),e),m=(h,t,e)=>(wg(h,t,"access private method"),e);var ge=(h,t,e,i)=>({set _(s){p(h,t,s,e)},get _(){return a(h,t,i)}});import{eb as H1,dN as $1,ec as C0,bT as U1,ed as W1,B as ns,ee as z1,N as Oc,C as uf,bV as G1,av as n0,ea as sy,aZ as ny,D as $,bZ as X1,R as Pp,co as ry,dK as ay,ef as Y1,eg as K1,aS as Wn,a8 as Z1,aY as Q1,cU as J1,al as na,au as Tp,ad as Fp,o as oy,aV as ua,aA as Yn,af as q1,S as Uc,O as tE,ae as cl,eh as eE,ei as iE,dm as Ag,ej as sE,aJ as nE,az as rE,K as ly,aF as aE,ek as P0,el as T0,aG as F0,em as oE,I as lE}from"./index-B0k0lAAD.js";const He=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),zg=[.001,0,0,.001,0,0],Eg=1.35,yi={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Bs={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},hy="pdfjs_internal_editor_",J={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101,COMMENT:102},ut={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},hE={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Fe={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Mf={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Zt={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},Zo={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},cg={ERRORS:0,WARNINGS:1,INFOS:5},Ip={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},yf={moveTo:0,lineTo:1,curveTo:2,closePath:3},cE={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let ug=cg.WARNINGS;function uE(h){Number.isInteger(h)&&(ug=h)}function dE(){return ug}function dg(h){ug>=cg.INFOS&&console.log("Info: ".concat(h))}function it(h){ug>=cg.WARNINGS&&console.log("Warning: ".concat(h))}function Pt(h){throw new Error(h)}function Jt(h,t){h||Pt(t)}function fE(h){switch(h==null?void 0:h.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function cy(h,t=null,e=null){if(!h)return null;if(e&&typeof h=="string"){if(e.addDefaultProtocol&&h.startsWith("www.")){const s=h.match(/\./g);(s==null?void 0:s.length)>=2&&(h="http://".concat(h))}if(e.tryConvertEncoding)try{h=bE(h)}catch(s){}}const i=t?URL.parse(h,t):URL.parse(h);return fE(i)?i:null}function uy(h,t,e=!1){const i=URL.parse(h);return i?(i.hash=t,i.href):e&&cy(h,"http://example.com")?h.split("#",1)[0]+"".concat(t?"#".concat(t):""):""}function ct(h,t,e,i=!1){return Object.defineProperty(h,t,{value:e,enumerable:!i,configurable:!0,writable:!1}),e}const Xo=function(){function t(e,i){this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class I0 extends Xo{constructor(t,e){super(t,"PasswordException"),this.code=e}}class Sg extends Xo{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}let Gg=class extends Xo{constructor(t){super(t,"InvalidPDFException")}},Rp=class extends Xo{constructor(t,e,i){super(t,"ResponseException"),this.status=e,this.missing=i}};class pE extends Xo{constructor(t){super(t,"FormatError")}}let ra=class extends Xo{constructor(t){super(t,"AbortException")}};function dy(h){(typeof h!="object"||(h==null?void 0:h.length)===void 0)&&Pt("Invalid argument for bytesToString");const t=h.length,e=8192;if(t<e)return String.fromCharCode.apply(null,h);const i=[];for(let s=0;s<t;s+=e){const n=Math.min(s+e,t),r=h.subarray(s,n);i.push(String.fromCharCode.apply(null,r))}return i.join("")}function df(h){typeof h!="string"&&Pt("Invalid argument for stringToBytes");const t=h.length,e=new Uint8Array(t);for(let i=0;i<t;++i)e[i]=h.charCodeAt(i)&255;return e}function gE(h){return String.fromCharCode(h>>24&255,h>>16&255,h>>8&255,h&255)}function mE(){const h=new Uint8Array(4);return h[0]=1,new Uint32Array(h.buffer,0,1)[0]===1}function vE(){try{return new Function(""),!0}catch(h){return!1}}class Te{static get isLittleEndian(){return ct(this,"isLittleEndian",mE())}static get isEvalSupported(){return ct(this,"isEvalSupported",vE())}static get isOffscreenCanvasSupported(){return ct(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return ct(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:t,userAgent:e}=navigator;return ct(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 ct(this,"isCSSRoundSupported",(e=(t=globalThis.CSS)==null?void 0:t.supports)==null?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const xg=Array.from(Array(256).keys(),h=>h.toString(16).padStart(2,"0"));var Hn,Ug,Nf,Xg;let Q=(Ug=class{static makeHexColor(t,e,i){return"#".concat(xg[t]).concat(xg[e]).concat(xg[i])}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),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 applyTransform(t,e,i=0){const s=t[i],n=t[i+1];t[i]=s*e[0]+n*e[2]+e[4],t[i+1]=s*e[1]+n*e[3]+e[5]}static applyTransformToBezier(t,e,i=0){const s=e[0],n=e[1],r=e[2],o=e[3],l=e[4],c=e[5];for(let u=0;u<6;u+=2){const d=t[i+u],f=t[i+u+1];t[i+u]=d*s+f*r+l,t[i+u+1]=d*n+f*o+c}}static applyInverseTransform(t,e){const i=t[0],s=t[1],n=e[0]*e[3]-e[1]*e[2];t[0]=(i*e[3]-s*e[2]+e[2]*e[5]-e[4]*e[3])/n,t[1]=(-i*e[1]+s*e[0]+e[4]*e[1]-e[5]*e[0])/n}static axialAlignedBoundingBox(t,e,i){const s=e[0],n=e[1],r=e[2],o=e[3],l=e[4],c=e[5],u=t[0],d=t[1],f=t[2],g=t[3];let v=s*u+l,y=v,w=s*f+l,A=w,S=o*d+c,E=S,x=o*g+c,C=x;if(n!==0||r!==0){const P=n*u,F=n*f,I=r*d,T=r*g;v+=I,A+=I,w+=T,y+=T,S+=P,C+=P,x+=F,E+=F}i[0]=Math.min(i[0],v,w,y,A),i[1]=Math.min(i[1],S,x,E,C),i[2]=Math.max(i[2],v,w,y,A),i[3]=Math.max(i[3],S,x,E,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 i=t[0],s=t[1],n=t[2],r=t[3],o=i**2+s**2,l=i*n+s*r,c=n**2+r**2,u=(o+c)/2,d=Math.sqrt(u**2-(o*c-l**2));e[0]=Math.sqrt(u+d||1),e[1]=Math.sqrt(u-d||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 i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),s=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>s)return null;const n=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),r=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return n>r?null:[i,n,s,r]}static pointBoundingBox(t,e,i){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}static rectBoundingBox(t,e,i,s,n){n[0]=Math.min(n[0],t,i),n[1]=Math.min(n[1],e,s),n[2]=Math.max(n[2],t,i),n[3]=Math.max(n[3],e,s)}static bezierBoundingBox(t,e,i,s,n,r,o,l,c){c[0]=Math.min(c[0],t,o),c[1]=Math.min(c[1],e,l),c[2]=Math.max(c[2],t,o),c[3]=Math.max(c[3],e,l),m(this,Hn,Xg).call(this,t,i,n,o,e,s,r,l,3*(-t+3*(i-n)+o),6*(t-2*i+n),3*(i-t),c),m(this,Hn,Xg).call(this,t,i,n,o,e,s,r,l,3*(-e+3*(s-r)+l),6*(e-2*s+r),3*(s-e),c)}},Hn=new WeakSet,Nf=function(t,e,i,s,n,r,o,l,c,u){if(c<=0||c>=1)return;const d=1-c,f=c*c,g=f*c,v=d*(d*(d*t+3*c*e)+3*f*i)+g*s,y=d*(d*(d*n+3*c*r)+3*f*o)+g*l;u[0]=Math.min(u[0],v),u[1]=Math.min(u[1],y),u[2]=Math.max(u[2],v),u[3]=Math.max(u[3],y)},Xg=function(t,e,i,s,n,r,o,l,c,u,d,f){if(Math.abs(c)<1e-12){Math.abs(u)>=1e-12&&m(this,Hn,Nf).call(this,t,e,i,s,n,r,o,l,-d/u,f);return}const g=u**2-4*d*c;if(g<0)return;const v=Math.sqrt(g),y=2*c;m(this,Hn,Nf).call(this,t,e,i,s,n,r,o,l,(-u+v)/y,f),m(this,Hn,Nf).call(this,t,e,i,s,n,r,o,l,(-u-v)/y,f)},b(Ug,Hn),Ug);function bE(h){return decodeURIComponent(escape(h))}let Cg=null,R0=null;function yE(h){return Cg||(Cg=/([\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,R0=new Map([["ſt","ſt"]])),h.replaceAll(Cg,(t,e,i)=>e?e.normalize("NFKC"):R0.get(i))}function fy(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const h=new Uint8Array(32);return crypto.getRandomValues(h),dy(h)}const r0="pdfjs_internal_id_";function wE(h,t,e){if(!Array.isArray(e)||e.length<2)return!1;const[i,s,...n]=e;if(!h(i)&&!Number.isInteger(i)||!t(s))return!1;const r=n.length;let o=!0;switch(s.name){case"XYZ":if(r<2||r>3)return!1;break;case"Fit":case"FitB":return r===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(r>1)return!1;break;case"FitR":if(r!==4)return!1;o=!1;break;default:return!1}for(const l of n)if(!(typeof l=="number"||o&&l===null))return!1;return!0}function $e(h,t,e){return Math.min(Math.max(h,t),e)}function py(h){return Uint8Array.prototype.toBase64?h.toBase64():btoa(dy(h))}function AE(h){return Uint8Array.fromBase64?Uint8Array.fromBase64(h):df(atob(h))}typeof Promise.try!="function"&&(Promise.try=function(h,...t){return new Promise(e=>{e(h(...t))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(h){return h.reduce((t,e)=>t+e,0)});const $s="http://www.w3.org/2000/svg";var ks;let aa=(ks=class{},M(ks,"CSS",96),M(ks,"PDF",72),M(ks,"PDF_TO_CSS_UNITS",ks.CSS/ks.PDF),ks);async function ff(h,t="text"){if(lc(h,document.baseURI)){const e=await fetch(h);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,i)=>{const s=new XMLHttpRequest;s.open("GET",h,!0),s.responseType=t,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(s.status===200||s.status===0){switch(t){case"arraybuffer":case"blob":case"json":e(s.response);return}e(s.responseText);return}i(new Error(s.statusText))}},s.send(null)})}class pf{constructor({viewBox:t,userUnit:e,scale:i,rotation:s,offsetX:n=0,offsetY:r=0,dontFlip:o=!1}){this.viewBox=t,this.userUnit=e,this.scale=i,this.rotation=s,this.offsetX=n,this.offsetY=r,i*=e;const l=(t[2]+t[0])/2,c=(t[3]+t[1])/2;let u,d,f,g;switch(s%=360,s<0&&(s+=360),s){case 180:u=-1,d=0,f=0,g=1;break;case 90:u=0,d=1,f=1,g=0;break;case 270:u=0,d=-1,f=-1,g=0;break;case 0:u=1,d=0,f=0,g=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(f=-f,g=-g);let v,y,w,A;u===0?(v=Math.abs(c-t[1])*i+n,y=Math.abs(l-t[0])*i+r,w=(t[3]-t[1])*i,A=(t[2]-t[0])*i):(v=Math.abs(l-t[0])*i+n,y=Math.abs(c-t[1])*i+r,w=(t[2]-t[0])*i,A=(t[3]-t[1])*i),this.transform=[u*i,d*i,f*i,g*i,v-u*i*l-f*i*c,y-d*i*l-g*i*c],this.width=w,this.height=A}get rawDims(){const t=this.viewBox;return ct(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:i=this.offsetX,offsetY:s=this.offsetY,dontFlip:n=!1}={}){return new pf({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:s,dontFlip:n})}convertToViewportPoint(t,e){const i=[t,e];return Q.applyTransform(i,this.transform),i}convertToViewportRectangle(t){const e=[t[0],t[1]];Q.applyTransform(e,this.transform);const i=[t[2],t[3]];return Q.applyTransform(i,this.transform),[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){const i=[t,e];return Q.applyInverseTransform(i,this.transform),i}}let tc=class extends Xo{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}};function fg(h){const t=h.length;let e=0;for(;e<t&&h[e].trim()==="";)e++;return h.substring(e,e+5).toLowerCase()==="data:"}function a0(h){return typeof h=="string"&&/\.pdf$/i.test(h)}function EE(h){return[h]=h.split(/[#?]/,1),h.substring(h.lastIndexOf("/")+1)}function gy(h,t="document.pdf"){if(typeof h!="string")return t;if(fg(h))return it('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const i=(o=>{try{return new URL(o)}catch(l){try{return new URL(decodeURIComponent(o))}catch(c){try{return new URL(o,"https://foo.bar")}catch(u){try{return new URL(decodeURIComponent(o),"https://foo.bar")}catch(d){return null}}}}})(h);if(!i)return t;const s=o=>{try{let l=decodeURIComponent(o);return l.includes("/")?(l=l.split("/").at(-1),l.test(/^\.pdf$/i)?l:o):l}catch(l){return o}},n=/\.pdf$/i,r=i.pathname.split("/").at(-1);if(n.test(r))return s(r);if(i.searchParams.size>0){const o=Array.from(i.searchParams.values()).reverse();for(const c of o)if(n.test(c))return s(c);const l=Array.from(i.searchParams.keys()).reverse();for(const c of l)if(n.test(c))return s(c)}if(i.hash){const l=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(i.hash);if(l)return s(l[0])}return t}class _0{constructor(){M(this,"started",Object.create(null));M(this,"times",[])}time(t){t in this.started&&it("Timer is already running for ".concat(t)),this.started[t]=Date.now()}timeEnd(t){t in this.started||it("Timer has not been started for ".concat(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:i}of this.times)e=Math.max(i.length,e);for(const{name:i,start:s,end:n}of this.times)t.push("".concat(i.padEnd(e)," ").concat(n-s,"ms\n"));return t.join("")}}function lc(h,t){const e=t?URL.parse(h,t):URL.parse(h);return(e==null?void 0:e.protocol)==="http:"||(e==null?void 0:e.protocol)==="https:"}function Vi(h){h.preventDefault()}function Qt(h){h.preventDefault(),h.stopPropagation()}function SE(h){console.log("Deprecated API usage: "+h)}var Wg,Zc;let Wc=(Wg=class{static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;a(this,Zc)||p(this,Zc,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=a(this,Zc).exec(t);if(!e)return null;const i=parseInt(e[1],10);let s=parseInt(e[2],10);s=s>=1&&s<=12?s-1:0;let n=parseInt(e[3],10);n=n>=1&&n<=31?n:1;let r=parseInt(e[4],10);r=r>=0&&r<=23?r: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 c=e[7]||"Z";let u=parseInt(e[8],10);u=u>=0&&u<=23?u:0;let d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(r+=u,o+=d):c==="+"&&(r-=u,o-=d),new Date(Date.UTC(i,s,n,r,o,l))}},Zc=new WeakMap,b(Wg,Zc),Wg);function my(h,{scale:t=1,rotation:e=0}){const{width:i,height:s}=h.attributes.style,n=[0,0,parseInt(i),parseInt(s)];return new pf({viewBox:n,userUnit:1,scale:t,rotation:e})}function pg(h){if(h.startsWith("#")){const t=parseInt(h.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return h.startsWith("rgb(")?h.slice(4,-1).split(",").map(t=>parseInt(t)):h.startsWith("rgba(")?h.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(it('Not a valid color format: "'.concat(h,'"')),[0,0,0])}function xE(h){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const e of h.keys()){t.style.color=e;const i=window.getComputedStyle(t).color;h.set(e,pg(i))}t.remove()}function Vt(h){const{a:t,b:e,c:i,d:s,e:n,f:r}=h.getTransform();return[t,e,i,s,n,r]}function ls(h){const{a:t,b:e,c:i,d:s,e:n,f:r}=h.getTransform().invertSelf();return[t,e,i,s,n,r]}function Uo(h,t,e=!1,i=!0){if(t instanceof pf){const{pageWidth:s,pageHeight:n}=t.rawDims,{style:r}=h,o=Te.isCSSRoundSupported,l="var(--total-scale-factor) * ".concat(s,"px"),c="var(--total-scale-factor) * ".concat(n,"px"),u=o?"round(down, ".concat(l,", var(--scale-round-x))"):"calc(".concat(l,")"),d=o?"round(down, ".concat(c,", var(--scale-round-y))"):"calc(".concat(c,")");!e||t.rotation%180===0?(r.width=u,r.height=d):(r.width=d,r.height=u)}i&&h.setAttribute("data-main-rotation",t.rotation)}let Wo=class Yg{constructor(){const{pixelRatio:t}=Yg;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,i,s,n=-1){let r=1/0,o=1/0,l=1/0;i=Yg.capPixels(i,n),i>0&&(r=Math.sqrt(i/(t*e))),s!==-1&&(o=s/t,l=s/e);const c=Math.min(r,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,i):i}return t}};const Kg=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];var Qn,Jn,Fi,Ks,Qc,bl,yl,Jc,Hp,vy,Pe,by,yy,Qo,hc;const Gs=class Gs{constructor(t){b(this,Pe);b(this,Qn,null);b(this,Jn,null);b(this,Fi);b(this,Ks,null);b(this,Qc,null);b(this,bl,null);b(this,yl,null);p(this,Fi,t),a(Gs,Jc)||p(Gs,Jc,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,Qn,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=a(this,Fi)._uiManager._signal;t.addEventListener("contextmenu",Vi,{signal:e}),t.addEventListener("pointerdown",m(Gs,Hp,vy),{signal:e});const i=p(this,Ks,document.createElement("div"));i.className="buttons",t.append(i);const s=a(this,Fi).toolbarPosition;if(s){const{style:n}=t,r=a(this,Fi)._uiManager.direction==="ltr"?1-s[0]:s[0];n.insetInlineEnd="".concat(100*r,"%"),n.top="calc(".concat(100*s[1],"% + var(--editor-toolbar-vert-offset))")}return t}get div(){return a(this,Qn)}hide(){var t;a(this,Qn).classList.add("hidden"),(t=a(this,Jn))==null||t.hideDropdown()}show(){var t,e;a(this,Qn).classList.remove("hidden"),(t=a(this,Qc))==null||t.shown(),(e=a(this,bl))==null||e.shown()}addDeleteButton(){const{editorType:t,_uiManager:e}=a(this,Fi),i=document.createElement("button");i.className="delete",i.tabIndex=0,i.setAttribute("data-l10n-id",a(Gs,Jc)[t]),m(this,Pe,Qo).call(this,i),i.addEventListener("click",s=>{e.delete()},{signal:e._signal}),a(this,Ks).append(i)}async addAltText(t){const e=await t.render();m(this,Pe,Qo).call(this,e),a(this,Ks).append(e,a(this,Pe,hc)),p(this,Qc,t)}addComment(t){if(a(this,bl))return;const e=t.render();e&&(m(this,Pe,Qo).call(this,e),a(this,Ks).prepend(e,a(this,Pe,hc)),p(this,bl,t),t.toolbar=this)}addColorPicker(t){if(a(this,Jn))return;p(this,Jn,t);const e=t.renderButton();m(this,Pe,Qo).call(this,e),a(this,Ks).append(e,a(this,Pe,hc))}async addEditSignatureButton(t){const e=p(this,yl,await t.renderEditButton(a(this,Fi)));m(this,Pe,Qo).call(this,e),a(this,Ks).append(e,a(this,Pe,hc))}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}}updateEditSignatureButton(t){a(this,yl)&&(a(this,yl).title=t)}remove(){var t;a(this,Qn).remove(),(t=a(this,Jn))==null||t.destroy(),p(this,Jn,null)}};Qn=new WeakMap,Jn=new WeakMap,Fi=new WeakMap,Ks=new WeakMap,Qc=new WeakMap,bl=new WeakMap,yl=new WeakMap,Jc=new WeakMap,Hp=new WeakSet,vy=function(t){t.stopPropagation()},Pe=new WeakSet,by=function(t){a(this,Fi)._focusEventsAllowed=!1,Qt(t)},yy=function(t){a(this,Fi)._focusEventsAllowed=!0,Qt(t)},Qo=function(t){const e=a(this,Fi)._uiManager._signal;t.addEventListener("focusin",m(this,Pe,by).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",m(this,Pe,yy).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",Vi,{signal:e})},hc=function(){const t=document.createElement("div");return t.className="divider",t},b(Gs,Hp),b(Gs,Jc,null);let Zg=Gs;var qc,xa,Ca,la,wy,Ay,Ey;class CE{constructor(t){b(this,la);b(this,qc,null);b(this,xa,null);b(this,Ca);p(this,Ca,t)}show(t,e,i){const[s,n]=m(this,la,Ay).call(this,e,i),{style:r}=a(this,xa)||p(this,xa,m(this,la,wy).call(this));t.append(a(this,xa)),r.insetInlineEnd="".concat(100*s,"%"),r.top="calc(".concat(100*n,"% + var(--editor-toolbar-vert-offset))")}hide(){a(this,xa).remove()}}qc=new WeakMap,xa=new WeakMap,Ca=new WeakMap,la=new WeakSet,wy=function(){const t=p(this,xa,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",Vi,{signal:a(this,Ca)._signal});const e=p(this,qc,document.createElement("div"));return e.className="buttons",t.append(e),m(this,la,Ey).call(this),t},Ay=function(t,e){let i=0,s=0;for(const n of t){const r=n.y+n.height;if(r<i)continue;const o=n.x+(e?n.width:0);if(r>i){s=o,i=r;continue}e?o>s&&(s=o):o<s&&(s=o)}return[e?1-s:s,i]},Ey=function(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=a(this,Ca)._signal;t.addEventListener("contextmenu",Vi,{signal:i}),t.addEventListener("click",()=>{a(this,Ca).highlightSelection("floating_button")},{signal:i}),a(this,qc).append(t)};function Sy(h,t,e){for(const i of e)t.addEventListener(i,h[i].bind(h))}var $p;class PE{constructor(){b(this,$p,0)}get id(){return"".concat(hy).concat(ge(this,$p)._++)}}$p=new WeakMap;var wl,tu,Re,Al,Of;const A0=class A0{constructor(){b(this,Al);b(this,wl,fy());b(this,tu,0);b(this,Re,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>',i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),s=new Image;s.src=t;const n=s.decode().then(()=>(i.drawImage(s,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return ct(this,"_isSVGFittingCanvas",n)}async getFromFile(t){const{lastModified:e,name:i,size:s,type:n}=t;return m(this,Al,Of).call(this,"".concat(e,"_").concat(i,"_").concat(s,"_").concat(n),t)}async getFromUrl(t){return m(this,Al,Of).call(this,t,t)}async getFromBlob(t,e){const i=await e;return m(this,Al,Of).call(this,t,i)}async getFromId(t){a(this,Re)||p(this,Re,new Map);const e=a(this,Re).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:i}=e;return delete e.blobPromise,this.getFromBlob(e.id,i)}return this.getFromUrl(e.url)}getFromCanvas(t,e){a(this,Re)||p(this,Re,new Map);let i=a(this,Re).get(t);if(i!=null&&i.bitmap)return i.refCounter+=1,i;const s=new OffscreenCanvas(e.width,e.height);return s.getContext("2d").drawImage(e,0,0),i={bitmap:s.transferToImageBitmap(),id:"image_".concat(a(this,wl),"_").concat(ge(this,tu)._++),refCounter:1,isSvg:!1},a(this,Re).set(t,i),a(this,Re).set(i.id,i),i}getSvgUrl(t){const e=a(this,Re).get(t);return e!=null&&e.isSvg?e.svgUrl:null}deleteId(t){var s;a(this,Re)||p(this,Re,new Map);const e=a(this,Re).get(t);if(!e||(e.refCounter-=1,e.refCounter!==0))return;const{bitmap:i}=e;if(!e.url&&!e.file){const n=new OffscreenCanvas(i.width,i.height);n.getContext("bitmaprenderer").transferFromImageBitmap(i),e.blobPromise=n.convertToBlob()}(s=i.close)==null||s.call(i),e.bitmap=null}isValidId(t){return t.startsWith("image_".concat(a(this,wl),"_"))}};wl=new WeakMap,tu=new WeakMap,Re=new WeakMap,Al=new WeakSet,Of=async function(t,e){a(this,Re)||p(this,Re,new Map);let i=a(this,Re).get(t);if(i===null)return null;if(i!=null&&i.bitmap)return i.refCounter+=1,i;try{i||(i={bitmap:null,id:"image_".concat(a(this,wl),"_").concat(ge(this,tu)._++),refCounter:0,isSvg:!1});let s;if(typeof e=="string"?(i.url=e,s=await ff(e,"blob")):e instanceof File?s=i.file=e:e instanceof Blob&&(s=e),s.type==="image/svg+xml"){const n=A0._isSVGFittingCanvas,r=new FileReader,o=new Image,l=new Promise((c,u)=>{o.onload=()=>{i.bitmap=o,i.isSvg=!0,c()},r.onload=async()=>{const d=i.svgUrl=r.result;o.src=await n?"".concat(d,"#svgView(preserveAspectRatio(none))"):d},o.onerror=r.onerror=u});r.readAsDataURL(s),await l}else i.bitmap=await createImageBitmap(s);i.refCounter=1}catch(s){it(s),i=null}return a(this,Re).set(t,i),i&&a(this,Re).set(i.id,i),i};let Qg=A0;var Wt,qn,eu,jt;class TE{constructor(t=128){b(this,Wt,[]);b(this,qn,!1);b(this,eu);b(this,jt,-1);p(this,eu,t)}add({cmd:t,undo:e,post:i,mustExec:s,type:n=NaN,overwriteIfSameType:r=!1,keepUndo:o=!1}){if(s&&t(),a(this,qn))return;const l={cmd:t,undo:e,post:i,type:n};if(a(this,jt)===-1){a(this,Wt).length>0&&(a(this,Wt).length=0),p(this,jt,0),a(this,Wt).push(l);return}if(r&&a(this,Wt)[a(this,jt)].type===n){o&&(l.undo=a(this,Wt)[a(this,jt)].undo),a(this,Wt)[a(this,jt)]=l;return}const c=a(this,jt)+1;c===a(this,eu)?a(this,Wt).splice(0,1):(p(this,jt,c),c<a(this,Wt).length&&a(this,Wt).splice(c)),a(this,Wt).push(l)}undo(){if(a(this,jt)===-1)return;p(this,qn,!0);const{undo:t,post:e}=a(this,Wt)[a(this,jt)];t(),e==null||e(),p(this,qn,!1),p(this,jt,a(this,jt)-1)}redo(){if(a(this,jt)<a(this,Wt).length-1){p(this,jt,a(this,jt)+1),p(this,qn,!0);const{cmd:t,post:e}=a(this,Wt)[a(this,jt)];t(),e==null||e(),p(this,qn,!1)}}hasSomethingToUndo(){return a(this,jt)!==-1}hasSomethingToRedo(){return a(this,jt)<a(this,Wt).length-1}cleanType(t){if(a(this,jt)!==-1){for(let e=a(this,jt);e>=0;e--)if(a(this,Wt)[e].type!==t){a(this,Wt).splice(e+1,a(this,jt)-e),p(this,jt,e);return}a(this,Wt).length=0,p(this,jt,-1)}}destroy(){p(this,Wt,null)}}Wt=new WeakMap,qn=new WeakMap,eu=new WeakMap,jt=new WeakMap;var Up,xy;class gf{constructor(t){b(this,Up);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=Te.platform;for(const[i,s,n={}]of t)for(const r of i){const o=r.startsWith("mac+");e&&o?(this.callbacks.set(r.slice(4),{callback:s,options:n}),this.allKeys.add(r.split("+").at(-1))):!e&&!o&&(this.callbacks.set(r,{callback:s,options:n}),this.allKeys.add(r.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(m(this,Up,xy).call(this,e));if(!i)return;const{callback:s,options:{bubbles:n=!1,args:r=[],checker:o=null}}=i;o&&!o(t,e)||(s.bind(t,...r,e)(),n||Qt(e))}}Up=new WeakSet,xy=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 Wp=class Wp{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return xE(t),ct(this,"_colors",t)}convert(t){const e=pg(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,s]of this._colors)if(s.every((n,r)=>n===e[r]))return Wp._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?Q.makeHexColor(...e):t}};M(Wp,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let Jg=Wp;var El,si,ee,me,Sl,Zs,xl,Ii,Pa,tr,er,Cl,Ta,fs,$i,Fa,iu,su,Pl,nu,ps,ir,Tl,sr,gs,zp,nr,ru,rr,Ia,Fl,ar,au,oe,Et,Qs,or,lr,ou,lu,hr,ms,Js,hu,cu,Ri,jn,V,kf,qg,Cy,Py,Bf,Ty,Fy,Iy,tm,Ry,em,im,_y,Me,Us,Dy,Ly,sm,My,cc,nm;let zc=(jn=class{constructor(t,e,i,s,n,r,o,l,c,u,d,f,g,v,y,w){b(this,V);b(this,El,new AbortController);b(this,si,null);b(this,ee,new Map);b(this,me,new Map);b(this,Sl,null);b(this,Zs,null);b(this,xl,null);b(this,Ii,new TE);b(this,Pa,null);b(this,tr,null);b(this,er,null);b(this,Cl,0);b(this,Ta,new Set);b(this,fs,null);b(this,$i,null);b(this,Fa,new Set);M(this,"_editorUndoBar",null);b(this,iu,!1);b(this,su,!1);b(this,Pl,!1);b(this,nu,null);b(this,ps,null);b(this,ir,null);b(this,Tl,null);b(this,sr,!1);b(this,gs,null);b(this,zp,new PE);b(this,nr,!1);b(this,ru,!1);b(this,rr,null);b(this,Ia,null);b(this,Fl,null);b(this,ar,null);b(this,au,null);b(this,oe,J.NONE);b(this,Et,new Set);b(this,Qs,null);b(this,or,null);b(this,lr,null);b(this,ou,null);b(this,lu,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});b(this,hr,[0,0]);b(this,ms,null);b(this,Js,null);b(this,hu,null);b(this,cu,null);b(this,Ri,null);const A=this._signal=a(this,El).signal;p(this,Js,t),p(this,hu,e),p(this,cu,i),p(this,Sl,s),p(this,Pa,n),p(this,or,r),this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:A}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:A}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:A}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:A}),o._on("setpreference",this.onSetPreference.bind(this),{signal:A}),o._on("switchannotationeditorparams",S=>this.updateParams(S.type,S.value),{signal:A}),m(this,V,Ty).call(this),m(this,V,_y).call(this),m(this,V,tm).call(this),p(this,Zs,l.annotationStorage),p(this,nu,l.filterFactory),p(this,lr,c),p(this,Tl,u||null),p(this,iu,d),p(this,su,f),p(this,Pl,g),p(this,au,v||null),this.viewParameters={realScale:aa.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=y||null,this._supportsPinchToZoom=w!==!1}static get _keyboardManager(){const t=jn.prototype,e=r=>a(r,Js).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&r.hasSomethingToControl(),i=(r,{target:o})=>{if(o instanceof HTMLInputElement){const{type:l}=o;return l!=="text"&&l!=="number"}return!0},s=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return ct(this,"_keyboardManager",new gf([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["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:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(r,{target:o})=>!(o instanceof HTMLButtonElement)&&a(r,Js).contains(o)&&!r.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(r,{target:o})=>!(o instanceof HTMLButtonElement)&&a(r,Js).contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:e}]]))}destroy(){var t,e,i,s,n,r,o,l,c;(t=a(this,Ri))==null||t.resolve(),p(this,Ri,null),(e=a(this,El))==null||e.abort(),p(this,El,null),this._signal=null;for(const u of a(this,me).values())u.destroy();a(this,me).clear(),a(this,ee).clear(),a(this,Fa).clear(),(i=a(this,ar))==null||i.clear(),p(this,si,null),a(this,Et).clear(),a(this,Ii).destroy(),(s=a(this,Sl))==null||s.destroy(),(n=a(this,Pa))==null||n.destroy(),(r=a(this,or))==null||r.destroy(),(o=a(this,gs))==null||o.hide(),p(this,gs,null),(l=a(this,Fl))==null||l.destroy(),p(this,Fl,null),a(this,ps)&&(clearTimeout(a(this,ps)),p(this,ps,null)),a(this,ms)&&(clearTimeout(a(this,ms)),p(this,ms,null)),(c=this._editorUndoBar)==null||c.destroy()}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return a(this,au)}get useNewAltTextFlow(){return a(this,su)}get useNewAltTextWhenAddingImage(){return a(this,Pl)}get hcmFilter(){return ct(this,"hcmFilter",a(this,lr)?a(this,nu).addHCMFilter(a(this,lr).foreground,a(this,lr).background):"none")}get direction(){return ct(this,"direction",getComputedStyle(a(this,Js)).direction)}get _highlightColors(){return ct(this,"_highlightColors",a(this,Tl)?new Map(a(this,Tl).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 ct(this,"highlightColors",null);const e=new Map,i=!!a(this,lr);for(const[s,n]of t){const r=s.endsWith("_HCM");if(i&&r){e.set(s.replace("_HCM",""),n);continue}!i&&!r&&e.set(s,n)}return ct(this,"highlightColors",e)}get highlightColorNames(){return ct(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,er,t)}setMainHighlightColorPicker(t){p(this,Fl,t)}editAltText(t,e=!1){var i;(i=a(this,Sl))==null||i.editAltText(this,t,e)}hasCommentManager(){return!!a(this,Pa)}editComment(t,e){var i;(i=a(this,Pa))==null||i.open(this,t,e)}getSignature(t){var e;(e=a(this,or))==null||e.getSignature({uiManager:this,editor:t})}get signatureManager(){return a(this,or)}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,Pl,e);break}}onPageChanging({pageNumber:t}){p(this,Cl,t-1)}focusMainContainer(){a(this,Js).focus()}findParent(t,e){for(const i of a(this,me).values()){const{x:s,y:n,width:r,height:o}=i.div.getBoundingClientRect();if(t>=s&&t<=s+r&&e>=n&&e<=n+o)return i}return null}disableUserSelect(t=!1){a(this,hu).classList.toggle("noUserSelect",t)}addShouldRescale(t){a(this,Fa).add(t)}removeShouldRescale(t){a(this,Fa).delete(t)}onScaleChanging({scale:t}){var e;this.commitOrRemove(),this.viewParameters.realScale=t*aa.PDF_TO_CSS_UNITS;for(const i of a(this,Fa))i.onScaleChanging();(e=a(this,er))==null||e.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t=""){const e=document.getSelection();if(!e||e.isCollapsed)return;const{anchorNode:i,anchorOffset:s,focusNode:n,focusOffset:r}=e,o=e.toString(),c=m(this,V,kf).call(this,e).closest(".textLayer"),u=this.getSelectionBoxes(c);if(!u)return;e.empty();const d=m(this,V,qg).call(this,c),f=a(this,oe)===J.NONE,g=()=>{d==null||d.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:u,anchorNode:i,anchorOffset:s,focusNode:n,focusOffset:r,text:o}),f&&this.showAllEditors("highlight",!0,!0)};if(f){this.switchToMode(J.HIGHLIGHT,g);return}g()}addToAnnotationStorage(t){!t.isEmpty()&&a(this,Zs)&&!a(this,Zs).has(t.id)&&a(this,Zs).setValue(t.id,t)}a11yAlert(t,e=null){const i=a(this,cu);i&&(i.setAttribute("data-l10n-id",t),e?i.setAttribute("data-l10n-args",JSON.stringify(e)):i.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,a(this,sr)&&(p(this,sr,!1),m(this,V,Bf).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of a(this,Et))if(e.div.contains(t)){p(this,Ia,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!a(this,Ia))return;const[t,e]=a(this,Ia);p(this,Ia,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){m(this,V,tm).call(this),m(this,V,em).call(this)}removeEditListeners(){m(this,V,Ry).call(this),m(this,V,im).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of a(this,$i))if(i.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const e of t.dataTransfer.items)for(const i of a(this,$i))if(i.isHandlingMimeForPasting(e.type)){i.paste(e,this.currentLayer),t.preventDefault();return}}copy(t){var i;if(t.preventDefault(),(i=a(this,si))==null||i.commitOrRemove(),!this.hasSelection)return;const e=[];for(const s of a(this,Et)){const n=s.serialize(!0);n&&e.push(n)}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 n of e.items)for(const r of a(this,$i))if(r.isHandlingMimeForPasting(n.type)){r.paste(n,this.currentLayer);return}let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(n){it('paste: "'.concat(n.message,'".'));return}if(!Array.isArray(i))return;this.unselectAll();const s=this.currentLayer;try{const n=[];for(const l of i){const c=await s.deserialize(l);if(!c)return;n.push(c)}const r=()=>{for(const l of n)m(this,V,sm).call(this,l);m(this,V,nm).call(this,n)},o=()=>{for(const l of n)l.remove()};this.addCommands({cmd:r,undo:o,mustExec:!0})}catch(n){it('paste: "'.concat(n.message,'".'))}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),a(this,oe)!==J.NONE&&!this.isEditorHandlingKeyboard&&jn._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,a(this,sr)&&(p(this,sr,!1),m(this,V,Bf).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}}setEditingState(t){t?(m(this,V,Fy).call(this),m(this,V,em).call(this),m(this,V,Me).call(this,{isEditing:a(this,oe)!==J.NONE,isEmpty:m(this,V,cc).call(this),hasSomethingToUndo:a(this,Ii).hasSomethingToUndo(),hasSomethingToRedo:a(this,Ii).hasSomethingToRedo(),hasSelectedEditor:!1})):(m(this,V,Iy).call(this),m(this,V,im).call(this),m(this,V,Me).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!a(this,$i)){p(this,$i,t);for(const e of a(this,$i))m(this,V,Us).call(this,e.defaultPropertiesToUpdate)}}getId(){return a(this,zp).id}get currentLayer(){return a(this,me).get(a(this,Cl))}getLayer(t){return a(this,me).get(t)}get currentPageIndex(){return a(this,Cl)}addLayer(t){a(this,me).set(t.pageIndex,t),a(this,nr)?t.enable():t.disable()}removeLayer(t){a(this,me).delete(t.pageIndex)}async updateMode(t,e=null,i=!1,s=!1,n=!1){var r,o,l;if(a(this,oe)!==t&&!(a(this,Ri)&&(await a(this,Ri).promise,!a(this,Ri)))){if(p(this,Ri,Promise.withResolvers()),(r=a(this,er))==null||r.commitOrRemove(),p(this,oe,t),t===J.NONE){this.setEditingState(!1),m(this,V,Ly).call(this),(o=this._editorUndoBar)==null||o.hide(),a(this,Ri).resolve();return}t===J.SIGNATURE&&await((l=a(this,or))==null?void 0:l.loadSignatures()),this.setEditingState(!0),await m(this,V,Dy).call(this),this.unselectAll();for(const c of a(this,me).values())c.updateMode(t);if(!e){i&&this.addNewEditorFromKeyboard(),a(this,Ri).resolve();return}for(const c of a(this,ee).values())c.annotationElementId===e||c.id===e?(this.setSelected(c),n?c.editComment():s&&c.enterInEditMode()):c.unselect();a(this,Ri).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==a(this,oe)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(a(this,$i)){switch(t){case ut.CREATE:this.currentLayer.addNewEditor(e);return;case ut.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(a(this,ou)||p(this,ou,new Map)).set(t,e),this.showAllEditors("highlight",e);break}if(this.hasSelection)for(const i of a(this,Et))i.updateParams(t,e);else for(const i of a(this,$i))i.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){var n,r;for(const o of a(this,ee).values())o.editorType===t&&o.show(e);((r=(n=a(this,ou))==null?void 0:n.get(ut.HIGHLIGHT_SHOW_ALL))!=null?r:!0)!==e&&m(this,V,Us).call(this,[[ut.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(a(this,ru)!==t){p(this,ru,t);for(const e of a(this,me).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}getEditors(t){const e=[];for(const i of a(this,ee).values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return a(this,ee).get(t)}addEditor(t){a(this,ee).set(t.id,t)}removeEditor(t){var e,i;t.div.contains(document.activeElement)&&(a(this,ps)&&clearTimeout(a(this,ps)),p(this,ps,setTimeout(()=>{this.focusMainContainer(),p(this,ps,null)},0))),a(this,ee).delete(t.id),t.annotationElementId&&((e=a(this,ar))==null||e.delete(t.annotationElementId)),this.unselect(t),(!t.annotationElementId||!a(this,Ta).has(t.annotationElementId))&&((i=a(this,Zs))==null||i.remove(t.id))}addDeletedAnnotationElement(t){a(this,Ta).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return a(this,Ta).has(t)}removeDeletedAnnotationElement(t){a(this,Ta).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){a(this,si)!==t&&(p(this,si,t),t&&m(this,V,Us).call(this,t.propertiesToUpdate))}updateUI(t){a(this,V,My)===t&&m(this,V,Us).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){m(this,V,Us).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(a(this,Et).has(t)){a(this,Et).delete(t),t.unselect(),m(this,V,Me).call(this,{hasSelectedEditor:this.hasSelection});return}a(this,Et).add(t),t.select(),m(this,V,Us).call(this,t.propertiesToUpdate),m(this,V,Me).call(this,{hasSelectedEditor:!0})}setSelected(t){var e;this.updateToolbar({mode:t.mode,editId:t.id}),(e=a(this,er))==null||e.commitOrRemove();for(const i of a(this,Et))i!==t&&i.unselect();a(this,Et).clear(),a(this,Et).add(t),t.select(),m(this,V,Us).call(this,t.propertiesToUpdate),m(this,V,Me).call(this,{hasSelectedEditor:!0})}isSelected(t){return a(this,Et).has(t)}get firstSelectedEditor(){return a(this,Et).values().next().value}unselect(t){t.unselect(),a(this,Et).delete(t),m(this,V,Me).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return a(this,Et).size!==0}get isEnterHandled(){return a(this,Et).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var t;a(this,Ii).undo(),m(this,V,Me).call(this,{hasSomethingToUndo:a(this,Ii).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:m(this,V,cc).call(this)}),(t=this._editorUndoBar)==null||t.hide()}redo(){a(this,Ii).redo(),m(this,V,Me).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:a(this,Ii).hasSomethingToRedo(),isEmpty:m(this,V,cc).call(this)})}addCommands(t){a(this,Ii).add(t),m(this,V,Me).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:m(this,V,cc).call(this)})}cleanUndoStack(t){a(this,Ii).cleanType(t)}delete(){var n;this.commitOrRemove();const t=(n=this.currentLayer)==null?void 0:n.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const e=t?[t]:[...a(this,Et)],i=()=>{var r;(r=this._editorUndoBar)==null||r.show(s,e.length===1?e[0].editorType:e.length);for(const o of e)o.remove()},s=()=>{for(const r of e)m(this,V,sm).call(this,r)};this.addCommands({cmd:i,undo:s,mustExec:!0})}commitOrRemove(){var t;(t=a(this,si))==null||t.commitOrRemove()}hasSomethingToControl(){return a(this,si)||this.hasSelection}selectAll(){for(const t of a(this,Et))t.commit();m(this,V,nm).call(this,a(this,ee).values())}unselectAll(){var t;if(!(a(this,si)&&(a(this,si).commitOrRemove(),a(this,oe)!==J.NONE))&&!((t=a(this,er))!=null&&t.commitOrRemove())&&this.hasSelection){for(const e of a(this,Et))e.unselect();a(this,Et).clear(),m(this,V,Me).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;a(this,hr)[0]+=t,a(this,hr)[1]+=e;const[s,n]=a(this,hr),r=[...a(this,Et)],o=1e3;a(this,ms)&&clearTimeout(a(this,ms)),p(this,ms,setTimeout(()=>{p(this,ms,null),a(this,hr)[0]=a(this,hr)[1]=0,this.addCommands({cmd:()=>{for(const l of r)a(this,ee).has(l.id)&&(l.translateInPage(s,n),l.translationDone())},undo:()=>{for(const l of r)a(this,ee).has(l.id)&&(l.translateInPage(-s,-n),l.translationDone())},mustExec:!1})},o));for(const l of r)l.translateInPage(t,e),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),p(this,fs,new Map);for(const t of a(this,Et))a(this,fs).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!a(this,fs))return!1;this.disableUserSelect(!1);const t=a(this,fs);p(this,fs,null);let e=!1;for(const[{x:s,y:n,pageIndex:r},o]of t)o.newX=s,o.newY=n,o.newPageIndex=r,e||(e=s!==o.savedX||n!==o.savedY||r!==o.savedPageIndex);if(!e)return!1;const i=(s,n,r,o)=>{if(a(this,ee).has(s.id)){const l=a(this,me).get(o);l?s._setParentAndPosition(l,n,r):(s.pageIndex=o,s.x=n,s.y=r)}};return this.addCommands({cmd:()=>{for(const[s,{newX:n,newY:r,newPageIndex:o}]of t)i(s,n,r,o)},undo:()=>{for(const[s,{savedX:n,savedY:r,savedPageIndex:o}]of t)i(s,n,r,o)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(a(this,fs))for(const i of a(this,fs).keys())i.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())||a(this,Et).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return a(this,si)===t}getActive(){return a(this,si)}getMode(){return a(this,oe)}get imageManager(){return ct(this,"imageManager",new Qg)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let c=0,u=e.rangeCount;c<u;c++)if(!t.contains(e.getRangeAt(c).commonAncestorContainer))return null;const{x:i,y:s,width:n,height:r}=t.getBoundingClientRect();let o;switch(t.getAttribute("data-main-rotation")){case"90":o=(c,u,d,f)=>({x:(u-s)/r,y:1-(c+d-i)/n,width:f/r,height:d/n});break;case"180":o=(c,u,d,f)=>({x:1-(c+d-i)/n,y:1-(u+f-s)/r,width:d/n,height:f/r});break;case"270":o=(c,u,d,f)=>({x:1-(u+f-s)/r,y:(c-i)/n,width:f/r,height:d/n});break;default:o=(c,u,d,f)=>({x:(c-i)/n,y:(u-s)/r,width:d/n,height:f/r});break}const l=[];for(let c=0,u=e.rangeCount;c<u;c++){const d=e.getRangeAt(c);if(!d.collapsed)for(const{x:f,y:g,width:v,height:y}of d.getClientRects())v===0||y===0||l.push(o(f,g,v,y))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:t,id:e}){(a(this,xl)||p(this,xl,new Map)).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){var e;(e=a(this,xl))==null||e.delete(t)}renderAnnotationElement(t){var s;const e=(s=a(this,xl))==null?void 0:s.get(t.data.id);if(!e)return;const i=a(this,Zs).getRawValue(e);i&&(a(this,oe)===J.NONE&&!i.hasBeenModified||i.renderAnnotationElement(t))}setMissingCanvas(t,e,i){var n;const s=(n=a(this,ar))==null?void 0:n.get(t);s&&(s.setCanvas(e,i),a(this,ar).delete(t))}addMissingCanvas(t,e){(a(this,ar)||p(this,ar,new Map)).set(t,e)}},El=new WeakMap,si=new WeakMap,ee=new WeakMap,me=new WeakMap,Sl=new WeakMap,Zs=new WeakMap,xl=new WeakMap,Ii=new WeakMap,Pa=new WeakMap,tr=new WeakMap,er=new WeakMap,Cl=new WeakMap,Ta=new WeakMap,fs=new WeakMap,$i=new WeakMap,Fa=new WeakMap,iu=new WeakMap,su=new WeakMap,Pl=new WeakMap,nu=new WeakMap,ps=new WeakMap,ir=new WeakMap,Tl=new WeakMap,sr=new WeakMap,gs=new WeakMap,zp=new WeakMap,nr=new WeakMap,ru=new WeakMap,rr=new WeakMap,Ia=new WeakMap,Fl=new WeakMap,ar=new WeakMap,au=new WeakMap,oe=new WeakMap,Et=new WeakMap,Qs=new WeakMap,or=new WeakMap,lr=new WeakMap,ou=new WeakMap,lu=new WeakMap,hr=new WeakMap,ms=new WeakMap,Js=new WeakMap,hu=new WeakMap,cu=new WeakMap,Ri=new WeakMap,V=new WeakSet,kf=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},qg=function(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of a(this,me).values())if(i.hasTextLayer(t))return i;return null},Cy=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const i=m(this,V,kf).call(this,t).closest(".textLayer"),s=this.getSelectionBoxes(i);s&&(a(this,gs)||p(this,gs,new CE(this)),a(this,gs).show(i,s,this.direction==="ltr"))},Py=function(){var n,r,o;const t=document.getSelection();if(!t||t.isCollapsed){a(this,Qs)&&((n=a(this,gs))==null||n.hide(),p(this,Qs,null),m(this,V,Me).call(this,{hasSelectedText:!1}));return}const{anchorNode:e}=t;if(e===a(this,Qs))return;const s=m(this,V,kf).call(this,t).closest(".textLayer");if(!s){a(this,Qs)&&((r=a(this,gs))==null||r.hide(),p(this,Qs,null),m(this,V,Me).call(this,{hasSelectedText:!1}));return}if((o=a(this,gs))==null||o.hide(),p(this,Qs,e),m(this,V,Me).call(this,{hasSelectedText:!0}),!(a(this,oe)!==J.HIGHLIGHT&&a(this,oe)!==J.NONE)&&(a(this,oe)===J.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),p(this,sr,this.isShiftKeyDown),!this.isShiftKeyDown)){const l=a(this,oe)===J.HIGHLIGHT?m(this,V,qg).call(this,s):null;l==null||l.toggleDrawing();const c=new AbortController,u=this.combinedSignal(c),d=f=>{f.type==="pointerup"&&f.button!==0||(c.abort(),l==null||l.toggleDrawing(!0),f.type==="pointerup"&&m(this,V,Bf).call(this,"main_toolbar"))};window.addEventListener("pointerup",d,{signal:u}),window.addEventListener("blur",d,{signal:u})}},Bf=function(t=""){a(this,oe)===J.HIGHLIGHT?this.highlightSelection(t):a(this,iu)&&m(this,V,Cy).call(this)},Ty=function(){document.addEventListener("selectionchange",m(this,V,Py).bind(this),{signal:this._signal})},Fy=function(){if(a(this,ir))return;p(this,ir,new AbortController);const t=this.combinedSignal(a(this,ir));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},Iy=function(){var t;(t=a(this,ir))==null||t.abort(),p(this,ir,null)},tm=function(){if(a(this,rr))return;p(this,rr,new AbortController);const t=this.combinedSignal(a(this,rr));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},Ry=function(){var t;(t=a(this,rr))==null||t.abort(),p(this,rr,null)},em=function(){if(a(this,tr))return;p(this,tr,new AbortController);const t=this.combinedSignal(a(this,tr));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})},im=function(){var t;(t=a(this,tr))==null||t.abort(),p(this,tr,null)},_y=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},Me=function(t){Object.entries(t).some(([i,s])=>a(this,lu)[i]!==s)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(a(this,lu),t)}),a(this,oe)===J.HIGHLIGHT&&t.hasSelectedEditor===!1&&m(this,V,Us).call(this,[[ut.HIGHLIGHT_FREE,!0]]))},Us=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},Dy=async function(){if(!a(this,nr)){p(this,nr,!0);const t=[];for(const e of a(this,me).values())t.push(e.enable());await Promise.all(t);for(const e of a(this,ee).values())e.enable()}},Ly=function(){if(this.unselectAll(),a(this,nr)){p(this,nr,!1);for(const t of a(this,me).values())t.disable();for(const t of a(this,ee).values())t.disable()}},sm=function(t){const e=a(this,me).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},My=function(){let t=null;for(t of a(this,Et));return t},cc=function(){if(a(this,ee).size===0)return!0;if(a(this,ee).size===1)for(const t of a(this,ee).values())return t.isEmpty();return!1},nm=function(t){for(const e of a(this,Et))e.unselect();a(this,Et).clear();for(const e of t)e.isEmpty()||(a(this,Et).add(e),e.select());m(this,V,Me).call(this,{hasSelectedEditor:this.hasSelection})},M(jn,"TRANSLATE_SMALL",1),M(jn,"TRANSLATE_BIG",10),jn);var le,vs,Ui,Il,bs,ni,Rl,ys,Xe,qs,Ra,ws,cr,rs,uc,jf;const Ne=class Ne{constructor(t){b(this,rs);b(this,le,null);b(this,vs,!1);b(this,Ui,null);b(this,Il,null);b(this,bs,null);b(this,ni,null);b(this,Rl,!1);b(this,ys,null);b(this,Xe,null);b(this,qs,null);b(this,Ra,null);b(this,ws,!1);p(this,Xe,t),p(this,ws,t._uiManager.useNewAltTextFlow),a(Ne,cr)||p(Ne,cr,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){var e;(e=Ne._l10n)!=null||(Ne._l10n=t)}async render(){const t=p(this,Ui,document.createElement("button"));t.className="altText",t.tabIndex="0";const e=p(this,Il,document.createElement("span"));t.append(e),a(this,ws)?(t.classList.add("new"),t.setAttribute("data-l10n-id",a(Ne,cr).missing),e.setAttribute("data-l10n-id",a(Ne,cr)["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=a(this,Xe)._uiManager._signal;t.addEventListener("contextmenu",Vi,{signal:i}),t.addEventListener("pointerdown",n=>n.stopPropagation(),{signal:i});const s=n=>{n.preventDefault(),a(this,Xe)._uiManager.editAltText(a(this,Xe)),a(this,ws)&&a(this,Xe)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:a(this,rs,uc)}})};return t.addEventListener("click",s,{capture:!0,signal:i}),t.addEventListener("keydown",n=>{n.target===t&&n.key==="Enter"&&(p(this,Rl,!0),s(n))},{signal:i}),await m(this,rs,jf).call(this),t}finish(){a(this,Ui)&&(a(this,Ui).focus({focusVisible:a(this,Rl)}),p(this,Rl,!1))}isEmpty(){return a(this,ws)?a(this,le)===null:!a(this,le)&&!a(this,vs)}hasData(){return a(this,ws)?a(this,le)!==null||!!a(this,qs):this.isEmpty()}get guessedText(){return a(this,qs)}async setGuessedText(t){a(this,le)===null&&(p(this,qs,t),p(this,Ra,await Ne._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),m(this,rs,jf).call(this))}toggleAltTextBadge(t=!1){var e;if(!a(this,ws)||a(this,le)){(e=a(this,ys))==null||e.remove(),p(this,ys,null);return}if(!a(this,ys)){const i=p(this,ys,document.createElement("div"));i.className="noAltTextBadge",a(this,Xe).div.append(i)}a(this,ys).classList.toggle("hidden",!t)}serialize(t){let e=a(this,le);return!t&&a(this,qs)===e&&(e=a(this,Ra)),{altText:e,decorative:a(this,vs),guessedText:a(this,qs),textWithDisclaimer:a(this,Ra)}}get data(){return{altText:a(this,le),decorative:a(this,vs)}}set data({altText:t,decorative:e,guessedText:i,textWithDisclaimer:s,cancel:n=!1}){i&&(p(this,qs,i),p(this,Ra,s)),!(a(this,le)===t&&a(this,vs)===e)&&(n||(p(this,le,t),p(this,vs,e)),m(this,rs,jf).call(this))}toggle(t=!1){a(this,Ui)&&(!t&&a(this,ni)&&(clearTimeout(a(this,ni)),p(this,ni,null)),a(this,Ui).disabled=!t)}shown(){a(this,Xe)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:a(this,rs,uc)}})}destroy(){var t,e;(t=a(this,Ui))==null||t.remove(),p(this,Ui,null),p(this,Il,null),p(this,bs,null),(e=a(this,ys))==null||e.remove(),p(this,ys,null)}};le=new WeakMap,vs=new WeakMap,Ui=new WeakMap,Il=new WeakMap,bs=new WeakMap,ni=new WeakMap,Rl=new WeakMap,ys=new WeakMap,Xe=new WeakMap,qs=new WeakMap,Ra=new WeakMap,ws=new WeakMap,cr=new WeakMap,rs=new WeakSet,uc=function(){return a(this,le)&&"added"||a(this,le)===null&&this.guessedText&&"review"||"missing"},jf=async function(){var s,n,r;const t=a(this,Ui);if(!t)return;if(a(this,ws)){if(t.classList.toggle("done",!!a(this,le)),t.setAttribute("data-l10n-id",a(Ne,cr)[a(this,rs,uc)]),(s=a(this,Il))==null||s.setAttribute("data-l10n-id",a(Ne,cr)["".concat(a(this,rs,uc),"-label")]),!a(this,le)){(n=a(this,bs))==null||n.remove();return}}else{if(!a(this,le)&&!a(this,vs)){t.classList.remove("done"),(r=a(this,bs))==null||r.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=a(this,bs);if(!e){p(this,bs,e=document.createElement("span")),e.className="tooltip",e.setAttribute("role","tooltip"),e.id="alt-text-tooltip-".concat(a(this,Xe).id);const o=100,l=a(this,Xe)._uiManager._signal;l.addEventListener("abort",()=>{clearTimeout(a(this,ni)),p(this,ni,null)},{once:!0}),t.addEventListener("mouseenter",()=>{p(this,ni,setTimeout(()=>{p(this,ni,null),a(this,bs).classList.add("show"),a(this,Xe)._reportTelemetry({action:"alt_text_tooltip"})},o))},{signal:l}),t.addEventListener("mouseleave",()=>{var c;a(this,ni)&&(clearTimeout(a(this,ni)),p(this,ni,null)),(c=a(this,bs))==null||c.classList.remove("show")},{signal:l})}a(this,vs)?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=a(this,le)),e.parentNode||t.append(e);const i=a(this,Xe).getElementForAltText();i==null||i.setAttribute("aria-describedby",e.id)},b(Ne,cr,null),M(Ne,"_l10n",null);let _p=Ne;var As,_a,Wi,uu,tn,_l,ur;class wf{constructor(t){b(this,As,null);b(this,_a,!1);b(this,Wi,null);b(this,uu,null);b(this,tn,null);b(this,_l,null);b(this,ur,!1);p(this,Wi,t),this.toolbar=null}render(){if(!a(this,Wi)._uiManager.hasCommentManager())return null;const t=p(this,As,document.createElement("button"));t.className="comment",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button");const e=a(this,Wi)._uiManager._signal;t.addEventListener("contextmenu",Vi,{signal:e}),t.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:e});const i=s=>{s.preventDefault(),this.edit()};return t.addEventListener("click",i,{capture:!0,signal:e}),t.addEventListener("keydown",s=>{s.target===t&&s.key==="Enter"&&(p(this,_a,!0),i(s))},{signal:e}),t}edit(){const{bottom:t,left:e,right:i}=a(this,Wi).getClientDimensions(),s={top:t};a(this,Wi)._uiManager.direction==="ltr"?s.right=i:s.left=e,a(this,Wi)._uiManager.editComment(a(this,Wi),s)}finish(){a(this,As)&&(a(this,As).focus({focusVisible:a(this,_a)}),p(this,_a,!1))}isDeleted(){return a(this,ur)||a(this,tn)===""}hasBeenEdited(){return this.isDeleted()||a(this,tn)!==a(this,uu)}serialize(){return this.data}get data(){return{text:a(this,tn),date:a(this,_l),deleted:a(this,ur)}}set data(t){if(t===null){p(this,tn,""),p(this,ur,!0);return}p(this,tn,t),p(this,_l,new Date),p(this,ur,!1)}setInitialText(t){p(this,uu,t),this.data=t}toggle(t=!1){a(this,As)&&(a(this,As).disabled=!t)}shown(){}destroy(){var t;(t=a(this,As))==null||t.remove(),p(this,As,null),p(this,tn,""),p(this,_l,null),p(this,Wi,null),p(this,_a,!1),p(this,ur,!1)}}As=new WeakMap,_a=new WeakMap,Wi=new WeakMap,uu=new WeakMap,tn=new WeakMap,_l=new WeakMap,ur=new WeakMap;var Dl,Da,du,fu,pu,gu,mu,en,La,sn,Ma,nn,ha,Oy,ky,By,Ll;let Ny=(Ll=class{constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:i=null,onPinchStart:s=null,onPinching:n=null,onPinchEnd:r=null,signal:o}){b(this,ha);b(this,Dl);b(this,Da,!1);b(this,du,null);b(this,fu);b(this,pu);b(this,gu);b(this,mu);b(this,en,null);b(this,La);b(this,sn,null);b(this,Ma);b(this,nn,null);p(this,Dl,t),p(this,du,i),p(this,fu,e),p(this,pu,s),p(this,gu,n),p(this,mu,r),p(this,Ma,new AbortController),p(this,La,AbortSignal.any([o,a(this,Ma).signal])),t.addEventListener("touchstart",m(this,ha,Oy).bind(this),{passive:!1,signal:a(this,La)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Wo.pixelRatio}destroy(){var t,e;(t=a(this,Ma))==null||t.abort(),p(this,Ma,null),(e=a(this,en))==null||e.abort(),p(this,en,null)}},Dl=new WeakMap,Da=new WeakMap,du=new WeakMap,fu=new WeakMap,pu=new WeakMap,gu=new WeakMap,mu=new WeakMap,en=new WeakMap,La=new WeakMap,sn=new WeakMap,Ma=new WeakMap,nn=new WeakMap,ha=new WeakSet,Oy=function(t){var s,n,r;if((s=a(this,fu))!=null&&s.call(this))return;if(t.touches.length===1){if(a(this,en))return;const o=p(this,en,new AbortController),l=AbortSignal.any([a(this,La),o.signal]),c=a(this,Dl),u={capture:!0,signal:l,passive:!1},d=f=>{var g;f.pointerType==="touch"&&((g=a(this,en))==null||g.abort(),p(this,en,null))};c.addEventListener("pointerdown",f=>{f.pointerType==="touch"&&(Qt(f),d(f))},u),c.addEventListener("pointerup",d,u),c.addEventListener("pointercancel",d,u);return}if(!a(this,nn)){p(this,nn,new AbortController);const o=AbortSignal.any([a(this,La),a(this,nn).signal]),l=a(this,Dl),c={signal:o,capture:!1,passive:!1};l.addEventListener("touchmove",m(this,ha,ky).bind(this),c);const u=m(this,ha,By).bind(this);l.addEventListener("touchend",u,c),l.addEventListener("touchcancel",u,c),c.capture=!0,l.addEventListener("pointerdown",Qt,c),l.addEventListener("pointermove",Qt,c),l.addEventListener("pointercancel",Qt,c),l.addEventListener("pointerup",Qt,c),(n=a(this,pu))==null||n.call(this)}if(Qt(t),t.touches.length!==2||(r=a(this,du))!=null&&r.call(this)){p(this,sn,null);return}let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]),p(this,sn,{touch0X:e.screenX,touch0Y:e.screenY,touch1X:i.screenX,touch1Y:i.screenY})},ky=function(t){var x;if(!a(this,sn)||t.touches.length!==2)return;Qt(t);let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]);const{screenX:s,screenY:n}=e,{screenX:r,screenY:o}=i,l=a(this,sn),{touch0X:c,touch0Y:u,touch1X:d,touch1Y:f}=l,g=d-c,v=f-u,y=r-s,w=o-n,A=Math.hypot(y,w)||1,S=Math.hypot(g,v)||1;if(!a(this,Da)&&Math.abs(S-A)<=Ll.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=s,l.touch0Y=n,l.touch1X=r,l.touch1Y=o,!a(this,Da)){p(this,Da,!0);return}const E=[(s+r)/2,(n+o)/2];(x=a(this,gu))==null||x.call(this,E,S,A)},By=function(t){var e;t.touches.length>=2||(a(this,nn)&&(a(this,nn).abort(),p(this,nn,null),(e=a(this,mu))==null||e.call(this)),a(this,sn)&&(Qt(t),p(this,sn,null),p(this,Da,!1)))},Ll);var Na,zi,Nt,ve,Ml,dr,vu,Oa,be,ka,rn,fr,bu,Ba,ri,yu,ja,an,Es,Nl,Ol,_i,Va,wu,Gp,q,rm,Au,am,Vf,jy,Vy,om,Hf,lm,Hy,$y,Uy,hm,Wy,cm,zy,Gy,Xy,um,dc;const lt=class lt{constructor(t){b(this,q);b(this,Na,null);b(this,zi,null);b(this,Nt,null);b(this,ve,null);b(this,Ml,!1);b(this,dr,null);b(this,vu,"");b(this,Oa,!1);b(this,be,null);b(this,ka,null);b(this,rn,null);b(this,fr,null);b(this,bu,"");b(this,Ba,!1);b(this,ri,null);b(this,yu,!1);b(this,ja,!1);b(this,an,!1);b(this,Es,null);b(this,Nl,0);b(this,Ol,0);b(this,_i,null);b(this,Va,null);M(this,"isSelected",!1);M(this,"_isCopy",!1);M(this,"_editToolbar",null);M(this,"_initialOptions",Object.create(null));M(this,"_initialData",null);M(this,"_isVisible",!0);M(this,"_uiManager",null);M(this,"_focusEventsAllowed",!0);b(this,wu,!1);b(this,Gp,lt._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;const{rotation:e,rawDims:{pageWidth:i,pageHeight:s,pageX:n,pageY:r}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,s],this.pageTranslation=[n,r];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=lt.prototype._resizeWithKeyboard,e=zc.TRANSLATE_SMALL,i=zc.TRANSLATE_BIG;return ct(this,"_resizerKeyboardManager",new gf([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],lt.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 ct(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new FE({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){var s;if((s=lt._l10n)!=null||(lt._l10n=t),lt._l10nResizer||(lt._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"})),lt._borderLineWidth!==-1)return;const i=getComputedStyle(document.documentElement);lt._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Pt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return a(this,wu)}set _isDraggable(t){var e;p(this,wu,t),(e=this.div)==null||e.classList.toggle("draggable",t)}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=a(this,Gp)}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):m(this,q,dc).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&(a(this,Ba)?p(this,Ba,!1):this.parent.setSelected(this))}focusout(t){var i;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const e=t.relatedTarget;e!=null&&e.closest("#".concat(this.id))||(t.preventDefault(),(i=this.parent)!=null&&i.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,s){const[n,r]=this.parentDimensions;[i,s]=this.screenToPageTranslation(i,s),this.x=(t+i)/n,this.y=(e+s)/r,this.fixAndSetPosition()}_moveAfterPaste(t,e){const[i,s]=this.parentDimensions;this.setAt(t*i,e*s,this.width*i,this.height*s),this._onTranslated()}translate(t,e){m(this,q,rm).call(this,this.parentDimensions,t,e)}translateInPage(t,e){a(this,ri)||p(this,ri,[this.x,this.y,this.width,this.height]),m(this,q,rm).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){a(this,ri)||p(this,ri,[this.x,this.y,this.width,this.height]);const{div:i,parentDimensions:[s,n]}=this;if(this.x+=t/s,this.y+=e/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:d,y:f}=this.div.getBoundingClientRect();this.parent.findNewParent(this,d,f)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:r,y:o}=this;const[l,c]=this.getBaseTranslation();r+=l,o+=c;const{style:u}=i;u.left="".concat((100*r).toFixed(2),"%"),u.top="".concat((100*o).toFixed(2),"%"),this._onTranslating(r,o),i.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!a(this,ri)&&(a(this,ri)[0]!==this.x||a(this,ri)[1]!==this.y)}get _hasBeenResized(){return!!a(this,ri)&&(a(this,ri)[2]!==this.width||a(this,ri)[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=lt,s=i/t,n=i/e;switch(this.rotation){case 90:return[-s,n];case 180:return[s,n];case 270:return[s,-n];default:return[-s,-n]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:e},pageDimensions:[i,s]}=this;let{x:n,y:r,width:o,height:l}=this;if(o*=i,l*=s,n*=i,r*=s,this._mustFixPosition)switch(t){case 0:n=$e(n,0,i-o),r=$e(r,0,s-l);break;case 90:n=$e(n,0,i-l),r=$e(r,o,s);break;case 180:n=$e(n,o,i),r=$e(r,l,s);break;case 270:n=$e(n,l,i),r=$e(r,0,s-o);break}this.x=n/=i,this.y=r/=s;const[c,u]=this.getBaseTranslation();n+=c,r+=u,e.left="".concat((100*n).toFixed(2),"%"),e.top="".concat((100*r).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(t,e){var i;return m(i=lt,Au,am).call(i,t,e,this.parentRotation)}pageTranslationToScreen(t,e){var i;return m(i=lt,Au,am).call(i,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,i]}=this;return[e*t,i*t]}setDims(t,e){const[i,s]=this.parentDimensions,{style:n}=this.div;n.width="".concat((100*t/i).toFixed(2),"%"),a(this,Oa)||(n.height="".concat((100*e/s).toFixed(2),"%"))}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,s=i.endsWith("%"),n=!a(this,Oa)&&e.endsWith("%");if(s&&n)return;const[r,o]=this.parentDimensions;s||(t.width="".concat((100*parseFloat(i)/r).toFixed(2),"%")),!a(this,Oa)&&!n&&(t.height="".concat((100*parseFloat(e)/o).toFixed(2),"%"))}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(t*1e4)/1e4}_onResizing(){}altTextFinish(){var t;(t=a(this,Nt))==null||t.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||a(this,ja))return this._editToolbar;this._editToolbar=new Zg(this),this.div.append(this._editToolbar.render()),this._editToolbar.addButton("comment",this.addCommentButton());const{toolbarButtons:t}=this;if(t)for(const[e,i]of t)await this._editToolbar.addButton(e,i);return this._editToolbar.addButton("delete"),this._editToolbar}removeEditToolbar(){var t;this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,(t=a(this,Nt))==null||t.destroy())}addContainer(t){var i;const e=(i=this._editToolbar)==null?void 0:i.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return a(this,Nt)||(_p.initialize(lt._l10n),p(this,Nt,new _p(this)),a(this,Na)&&(a(this,Nt).data=a(this,Na),p(this,Na,null))),a(this,Nt)}get altTextData(){var t;return(t=a(this,Nt))==null?void 0:t.data}set altTextData(t){a(this,Nt)&&(a(this,Nt).data=t)}get guessedAltText(){var t;return(t=a(this,Nt))==null?void 0:t.guessedText}async setGuessedAltText(t){var e;await((e=a(this,Nt))==null?void 0:e.setGuessedText(t))}serializeAltText(t){var e;return(e=a(this,Nt))==null?void 0:e.serialize(t)}hasAltText(){return!!a(this,Nt)&&!a(this,Nt).isEmpty()}hasAltTextData(){var t,e;return(e=(t=a(this,Nt))==null?void 0:t.hasData())!=null?e:!1}addCommentButton(){return a(this,ve)?a(this,ve):p(this,ve,new wf(this))}get commentColor(){return null}get comment(){const t=a(this,ve);return{text:t.data.text,date:t.data.date,deleted:t.isDeleted(),color:this.commentColor}}set comment(t){a(this,ve)||p(this,ve,new wf(this)),a(this,ve).data=t}setCommentData(t){a(this,ve)||p(this,ve,new wf(this)),a(this,ve).setInitialText(t)}get hasEditedComment(){var t;return(t=a(this,ve))==null?void 0:t.hasBeenEdited()}async editComment(){a(this,ve)||p(this,ve,new wf(this)),a(this,ve).edit()}addComment(t){this.hasEditedComment&&(t.popup={contents:this.comment.text,deleted:this.comment.deleted})}render(){var r;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=a(this,Ml)?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),m(this,q,cm).call(this);const[e,i]=this.parentDimensions;this.parentRotation%180!==0&&(t.style.maxWidth="".concat((100*i/e).toFixed(2),"%"),t.style.maxHeight="".concat((100*e/i).toFixed(2),"%"));const[s,n]=this.getInitialTranslation();return this.translate(s,n),Sy(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(a(this,Va)||p(this,Va,new Ny({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:m(this,q,Hy).bind(this),onPinching:m(this,q,$y).bind(this),onPinchEnd:m(this,q,Uy).bind(this),signal:this._uiManager._signal}))),(r=this._uiManager._editorUndoBar)==null||r.hide(),t}pointerdown(t){const{isMac:e}=Te.platform;if(t.button!==0||t.ctrlKey&&e){t.preventDefault();return}if(p(this,Ba,!0),this._isDraggable){m(this,q,Wy).call(this,t);return}m(this,q,hm).call(this,t)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){a(this,Es)&&clearTimeout(a(this,Es)),p(this,Es,setTimeout(()=>{var t;p(this,Es,null),(t=this.parent)==null||t.moveEditorInDOM(this)},0))}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e,i=this.rotation){const s=this.parentScale,[n,r]=this.pageDimensions,[o,l]=this.pageTranslation,c=t/s,u=e/s,d=this.x*n,f=this.y*r,g=this.width*n,v=this.height*r;switch(i){case 0:return[d+c+o,r-f-u-v+l,d+c+g+o,r-f-u+l];case 90:return[d+u+o,r-f+c+l,d+u+v+o,r-f+c+g+l];case 180:return[d-c-g+o,r-f+u+l,d-c+o,r-f+u+v+l];case 270:return[d-u-v+o,r-f-c-g+l,d-u+o,r-f-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,s,n,r]=t,o=n-i,l=r-s;switch(this.rotation){case 0:return[i,e-r,o,l];case 90:return[i,e-s,l,o];case 180:return[n,e-s,o,l];case 270:return[n,e-r,l,o];default:throw new Error("Invalid rotation")}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),p(this,ja,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),p(this,ja,!1),!0):!1}isInEditMode(){return a(this,ja)}shouldGetKeyboardEvents(){return a(this,an)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:i,right:s}=this.getClientDimensions(),{innerHeight:n,innerWidth:r}=window;return e<r&&s>0&&t<n&&i>0}rebuild(){m(this,q,cm).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){Pt("An editor must be serializable")}static async deserialize(t,e,i){const s=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i,annotationElementId:t.annotationElementId});s.rotation=t.rotation,p(s,Na,t.accessibilityData),s._isCopy=t.isCopy||!1;const[n,r]=s.pageDimensions,[o,l,c,u]=s.getRectInCurrentCoords(t.rect,r);return s.x=o/n,s.y=l/r,s.width=c/n,s.height=u/r,s}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var t,e;if((t=a(this,fr))==null||t.abort(),p(this,fr,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),a(this,Es)&&(clearTimeout(a(this,Es)),p(this,Es,null)),m(this,q,dc).call(this),this.removeEditToolbar(),a(this,_i)){for(const i of a(this,_i).values())clearTimeout(i);p(this,_i,null)}this.parent=null,(e=a(this,Va))==null||e.destroy(),p(this,Va,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(m(this,q,jy).call(this),a(this,be).classList.remove("hidden"))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),p(this,rn,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=a(this,be).children;if(!a(this,zi)){p(this,zi,Array.from(e));const r=m(this,q,zy).bind(this),o=m(this,q,Gy).bind(this),l=this._uiManager._signal;for(const c of a(this,zi)){const u=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",r,{signal:l}),c.addEventListener("blur",o,{signal:l}),c.addEventListener("focus",m(this,q,Xy).bind(this,u),{signal:l}),c.setAttribute("data-l10n-id",lt._l10nResizer[u])}}const i=a(this,zi)[0];let s=0;for(const r of e){if(r===i)break;s++}const n=(360-this.rotation+this.parentRotation)%360/90*(a(this,zi).length/4);if(n!==s){if(n<s)for(let o=0;o<s-n;o++)a(this,be).append(a(this,be).firstChild);else if(n>s)for(let o=0;o<n-s;o++)a(this,be).firstChild.before(a(this,be).lastChild);let r=0;for(const o of e){const c=a(this,zi)[r++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",lt._l10nResizer[c])}}m(this,q,um).call(this,0),p(this,an,!0),a(this,be).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){a(this,an)&&m(this,q,lm).call(this,a(this,bu),{deltaX:t,deltaY:e,fromKeyboard:!0})}_stopResizingWithKeyboard(){m(this,q,dc).call(this),this.div.focus()}select(){var t,e,i;if(!(this.isSelected&&this._editToolbar)){if(this.isSelected=!0,this.makeResizable(),(t=this.div)==null||t.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var s,n;(s=this.div)!=null&&s.classList.contains("selectedEditor")&&((n=this._editToolbar)==null||n.show())});return}(e=this._editToolbar)==null||e.show(),(i=a(this,Nt))==null||i.toggleAltTextBadge(!1)}}unselect(){var t,e,i,s,n;this.isSelected&&(this.isSelected=!1,(t=a(this,be))==null||t.classList.add("hidden"),(e=this.div)==null||e.classList.remove("selectedEditor"),(i=this.div)!=null&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(s=this._editToolbar)==null||s.hide(),(n=a(this,Nt))==null||n.toggleAltTextBadge(!0))}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id})}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return a(this,yu)}set isEditing(t){p(this,yu,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){p(this,Oa,!0);const i=t/e,{style:s}=this.div;s.aspectRatio=i,s.height="auto"}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){a(this,_i)||p(this,_i,new Map);const{action:i}=t;let s=a(this,_i).get(i);s&&clearTimeout(s),s=setTimeout(()=>{this._reportTelemetry(t),a(this,_i).delete(i),a(this,_i).size===0&&p(this,_i,null)},lt._telemetryTimeout),a(this,_i).set(i,s);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,Ml,!1)}disable(){this.div&&(this.div.tabIndex=-1),p(this,Ml,!0)}renderAnnotationElement(t){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 i=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),i.before(e)}return e}resetAnnotationElement(t){const{firstChild:e}=t.container;(e==null?void 0:e.nodeName)==="DIV"&&e.classList.contains("annotationContent")&&e.remove()}};Na=new WeakMap,zi=new WeakMap,Nt=new WeakMap,ve=new WeakMap,Ml=new WeakMap,dr=new WeakMap,vu=new WeakMap,Oa=new WeakMap,be=new WeakMap,ka=new WeakMap,rn=new WeakMap,fr=new WeakMap,bu=new WeakMap,Ba=new WeakMap,ri=new WeakMap,yu=new WeakMap,ja=new WeakMap,an=new WeakMap,Es=new WeakMap,Nl=new WeakMap,Ol=new WeakMap,_i=new WeakMap,Va=new WeakMap,wu=new WeakMap,Gp=new WeakMap,q=new WeakSet,rm=function([t,e],i,s){[i,s]=this.screenToPageTranslation(i,s),this.x+=i/t,this.y+=s/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},Au=new WeakSet,am=function(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}},Vf=function(t){switch(t){case 90:{const[e,i]=this.pageDimensions;return[0,-e/i,i/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,i]=this.pageDimensions;return[0,e/i,-i/e,0]}default:return[1,0,0,1]}},jy=function(){if(a(this,be))return;p(this,be,document.createElement("div")),a(this,be).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 i of t){const s=document.createElement("div");a(this,be).append(s),s.classList.add("resizer",i),s.setAttribute("data-resizer-name",i),s.addEventListener("pointerdown",m(this,q,Vy).bind(this,i),{signal:e}),s.addEventListener("contextmenu",Vi,{signal:e}),s.tabIndex=-1}this.div.prepend(a(this,be))},Vy=function(t,e){var u;e.preventDefault();const{isMac:i}=Te.platform;if(e.button!==0||e.ctrlKey&&i)return;(u=a(this,Nt))==null||u.toggle(!1);const s=this._isDraggable;this._isDraggable=!1,p(this,ka,[e.screenX,e.screenY]);const n=new AbortController,r=this._uiManager.combinedSignal(n);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",m(this,q,lm).bind(this,t),{passive:!0,capture:!0,signal:r}),window.addEventListener("touchmove",Qt,{passive:!1,signal:r}),window.addEventListener("contextmenu",Vi,{signal:r}),p(this,rn,{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 c=()=>{var d;n.abort(),this.parent.togglePointerEvents(!0),(d=a(this,Nt))==null||d.toggle(!0),this._isDraggable=s,this.parent.div.style.cursor=o,this.div.style.cursor=l,m(this,q,Hf).call(this)};window.addEventListener("pointerup",c,{signal:r}),window.addEventListener("blur",c,{signal:r})},om=function(t,e,i,s){this.width=i,this.height=s,this.x=t,this.y=e;const[n,r]=this.parentDimensions;this.setDims(n*i,r*s),this.fixAndSetPosition(),this._onResized()},Hf=function(){if(!a(this,rn))return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:s}=a(this,rn);p(this,rn,null);const n=this.x,r=this.y,o=this.width,l=this.height;n===t&&r===e&&o===i&&l===s||this.addCommands({cmd:m(this,q,om).bind(this,n,r,o,l),undo:m(this,q,om).bind(this,t,e,i,s),mustExec:!0})},lm=function(t,e){const[i,s]=this.parentDimensions,n=this.x,r=this.y,o=this.width,l=this.height,c=lt.MIN_SIZE/i,u=lt.MIN_SIZE/s,d=m(this,q,Vf).call(this,this.rotation),f=(B,L)=>[d[0]*B+d[2]*L,d[1]*B+d[3]*L],g=m(this,q,Vf).call(this,360-this.rotation),v=(B,L)=>[g[0]*B+g[2]*L,g[1]*B+g[3]*L];let y,w,A=!1,S=!1;switch(t){case"topLeft":A=!0,y=(B,L)=>[0,0],w=(B,L)=>[B,L];break;case"topMiddle":y=(B,L)=>[B/2,0],w=(B,L)=>[B/2,L];break;case"topRight":A=!0,y=(B,L)=>[B,0],w=(B,L)=>[0,L];break;case"middleRight":S=!0,y=(B,L)=>[B,L/2],w=(B,L)=>[0,L/2];break;case"bottomRight":A=!0,y=(B,L)=>[B,L],w=(B,L)=>[0,0];break;case"bottomMiddle":y=(B,L)=>[B/2,L],w=(B,L)=>[B/2,0];break;case"bottomLeft":A=!0,y=(B,L)=>[0,L],w=(B,L)=>[B,0];break;case"middleLeft":S=!0,y=(B,L)=>[0,L/2],w=(B,L)=>[B,L/2];break}const E=y(o,l),x=w(o,l);let C=f(...x);const P=lt._round(n+C[0]),F=lt._round(r+C[1]);let I=1,T=1,R,_;if(e.fromKeyboard)({deltaX:R,deltaY:_}=e);else{const{screenX:B,screenY:L}=e,[et,rt]=a(this,ka);[R,_]=this.screenToPageTranslation(B-et,L-rt),a(this,ka)[0]=B,a(this,ka)[1]=L}if([R,_]=v(R/i,_/s),A){const B=Math.hypot(o,l);I=T=Math.max(Math.min(Math.hypot(x[0]-E[0]-R,x[1]-E[1]-_)/B,1/o,1/l),c/o,u/l)}else S?I=$e(Math.abs(x[0]-E[0]-R),c,1)/o:T=$e(Math.abs(x[1]-E[1]-_),u,1)/l;const j=lt._round(o*I),k=lt._round(l*T);C=f(...w(j,k));const U=P-C[0],ft=F-C[1];a(this,ri)||p(this,ri,[this.x,this.y,this.width,this.height]),this.width=j,this.height=k,this.x=U,this.y=ft,this.setDims(i*j,s*k),this.fixAndSetPosition(),this._onResizing()},Hy=function(){var t;p(this,rn,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(t=a(this,Nt))==null||t.toggle(!1),this.parent.togglePointerEvents(!1)},$y=function(t,e,i){let n=.7*(i/e)+1-.7;if(n===1)return;const r=m(this,q,Vf).call(this,this.rotation),o=(P,F)=>[r[0]*P+r[2]*F,r[1]*P+r[3]*F],[l,c]=this.parentDimensions,u=this.x,d=this.y,f=this.width,g=this.height,v=lt.MIN_SIZE/l,y=lt.MIN_SIZE/c;n=Math.max(Math.min(n,1/f,1/g),v/f,y/g);const w=lt._round(f*n),A=lt._round(g*n);if(w===f&&A===g)return;a(this,ri)||p(this,ri,[u,d,f,g]);const S=o(f/2,g/2),E=lt._round(u+S[0]),x=lt._round(d+S[1]),C=o(w/2,A/2);this.x=E-C[0],this.y=x-C[1],this.width=w,this.height=A,this.setDims(l*w,c*A),this.fixAndSetPosition(),this._onResizing()},Uy=function(){var t;(t=a(this,Nt))==null||t.toggle(!0),this.parent.togglePointerEvents(!0),m(this,q,Hf).call(this)},hm=function(t){const{isMac:e}=Te.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},Wy=function(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const s=new AbortController,n=this._uiManager.combinedSignal(s),r={capture:!0,passive:!1,signal:n},o=c=>{s.abort(),p(this,dr,null),p(this,Ba,!1),this._uiManager.endDragSession()||m(this,q,hm).call(this,c),i&&this._onStopDragging()};e&&(p(this,Nl,t.clientX),p(this,Ol,t.clientY),p(this,dr,t.pointerId),p(this,vu,t.pointerType),window.addEventListener("pointermove",c=>{i||(i=!0,this._onStartDragging());const{clientX:u,clientY:d,pointerId:f}=c;if(f!==a(this,dr)){Qt(c);return}const[g,v]=this.screenToPageTranslation(u-a(this,Nl),d-a(this,Ol));p(this,Nl,u),p(this,Ol,d),this._uiManager.dragSelectedEditors(g,v)},r),window.addEventListener("touchmove",Qt,r),window.addEventListener("pointerdown",c=>{c.pointerType===a(this,vu)&&(a(this,Va)||c.isPrimary)&&o(c),Qt(c)},r));const l=c=>{if(!a(this,dr)||a(this,dr)===c.pointerId){o(c);return}Qt(c)};window.addEventListener("pointerup",l,{signal:n}),window.addEventListener("blur",l,{signal:n})},cm=function(){if(a(this,fr)||!this.div)return;p(this,fr,new AbortController);const t=this._uiManager.combinedSignal(a(this,fr));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},zy=function(t){lt._resizerKeyboardManager.exec(this,t)},Gy=function(t){var e;a(this,an)&&((e=t.relatedTarget)==null?void 0:e.parentNode)!==a(this,be)&&m(this,q,dc).call(this)},Xy=function(t){p(this,bu,a(this,an)?t:"")},um=function(t){if(a(this,zi))for(const e of a(this,zi))e.tabIndex=t},dc=function(){p(this,an,!1),m(this,q,um).call(this,-1),m(this,q,Hf).call(this)},b(lt,Au),M(lt,"_l10n",null),M(lt,"_l10nResizer",null),M(lt,"_borderLineWidth",-1),M(lt,"_colorManager",new Jg),M(lt,"_zIndex",1),M(lt,"_telemetryTimeout",1e3);let Rt=lt;class FE extends Rt{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const D0=3285377520,Ti=4294901760,hs=65535;class Yy{constructor(t){this.h1=t?t&4294967295:D0,this.h2=t?t&4294967295:D0}update(t){let e,i;if(typeof t=="string"){e=new Uint8Array(t.length*2),i=0;for(let y=0,w=t.length;y<w;y++){const A=t.charCodeAt(y);A<=255?e[i++]=A:(e[i++]=A>>>8,e[i++]=A&255)}}else if(ArrayBuffer.isView(t))e=t.slice(),i=e.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const s=i>>2,n=i-s*4,r=new Uint32Array(e.buffer,0,s);let o=0,l=0,c=this.h1,u=this.h2;const d=3432918353,f=461845907,g=d&hs,v=f&hs;for(let y=0;y<s;y++)y&1?(o=r[y],o=o*d&Ti|o*g&hs,o=o<<15|o>>>17,o=o*f&Ti|o*v&hs,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(l=r[y],l=l*d&Ti|l*g&hs,l=l<<15|l>>>17,l=l*f&Ti|l*v&hs,u^=l,u=u<<13|u>>>19,u=u*5+3864292196);switch(o=0,n){case 3:o^=e[s*4+2]<<16;case 2:o^=e[s*4+1]<<8;case 1:o^=e[s*4],o=o*d&Ti|o*g&hs,o=o<<15|o>>>17,o=o*f&Ti|o*v&hs,s&1?c^=o:u^=o}this.h1=c,this.h2=u}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&Ti|t*36045&hs,e=e*4283543511&Ti|((e<<16|t>>>16)*2950163797&Ti)>>>16,t^=e>>>1,t=t*444984403&Ti|t*60499&hs,e=e*3301882366&Ti|((e<<16|t>>>16)*3120437893&Ti)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const dm=Object.freeze({map:null,hash:"",transfer:void 0});var Ha,$a,ye,Xp,Ky;class o0{constructor(){b(this,Xp);b(this,Ha,!1);b(this,$a,null);b(this,ye,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=a(this,ye).get(t);return i===void 0?e:Object.assign(e,i)}getRawValue(t){return a(this,ye).get(t)}remove(t){if(a(this,ye).delete(t),a(this,ye).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const e of a(this,ye).values())if(e instanceof Rt)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=a(this,ye).get(t);let s=!1;if(i!==void 0)for(const[n,r]of Object.entries(e))i[n]!==r&&(s=!0,i[n]=r);else s=!0,a(this,ye).set(t,e);s&&m(this,Xp,Ky).call(this),e instanceof Rt&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(e.constructor._type)}has(t){return a(this,ye).has(t)}get size(){return a(this,ye).size}resetModified(){a(this,Ha)&&(p(this,Ha,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new Zy(this)}get serializable(){if(a(this,ye).size===0)return dm;const t=new Map,e=new Yy,i=[],s=Object.create(null);let n=!1;for(const[r,o]of a(this,ye)){const l=o instanceof Rt?o.serialize(!1,s):o;l&&(t.set(r,l),e.update("".concat(r,":").concat(JSON.stringify(l))),n||(n=!!l.bitmap))}if(n)for(const r of t.values())r.bitmap&&i.push(r.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:dm}get editorStats(){var i;let t=null;const e=new Map;for(const s of a(this,ye).values()){if(!(s instanceof Rt))continue;const n=s.telemetryFinalData;if(!n)continue;const{type:r}=n;e.has(r)||e.set(r,Object.getPrototypeOf(s).constructor),t||(t=Object.create(null));const o=t[r]||(t[r]=new Map);for(const[l,c]of Object.entries(n)){if(l==="type")continue;let u=o.get(l);u||(u=new Map,o.set(l,u));const d=(i=u.get(c))!=null?i:0;u.set(c,d+1)}}for(const[s,n]of e)t[s]=n.computeTelemetryFinalData(t[s]);return t}resetModifiedIds(){p(this,$a,null)}get modifiedIds(){if(a(this,$a))return a(this,$a);const t=[];for(const e of a(this,ye).values())!(e instanceof Rt)||!e.annotationElementId||!e.serialize()||t.push(e.annotationElementId);return p(this,$a,{ids:new Set(t),hash:t.join(",")})}[Symbol.iterator](){return a(this,ye).entries()}}Ha=new WeakMap,$a=new WeakMap,ye=new WeakMap,Xp=new WeakSet,Ky=function(){a(this,Ha)||(p(this,Ha,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var Eu;class Zy extends o0{constructor(e){super();b(this,Eu);const{map:i,hash:s,transfer:n}=e.serializable,r=structuredClone(i,n?{transfer:n}:null);p(this,Eu,{map:r,hash:s,transfer:n})}get print(){Pt("Should not call PrintAnnotationStorage.print")}get serializable(){return a(this,Eu)}get modifiedIds(){return ct(this,"modifiedIds",{ids:new Set,hash:""})}}Eu=new WeakMap;var kl;class IE{constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){b(this,kl,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(),a(this,kl).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:i}){if(!(!t||a(this,kl).has(t.loadedName))){if(Jt(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:s,src:n,style:r}=t,o=new FontFace(s,n,r);this.addNativeFontFace(o);try{await o.load(),a(this,kl).add(s),i==null||i(t)}catch(l){it("Cannot load system font: ".concat(t.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(o)}return}Pt("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 i=t.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(s){throw it("Failed to load font '".concat(i.family,"': '").concat(s,"'.")),t.disableFontFace=!0,s}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(i=>{const s=this._queueLoadingCallback(i);this._prepareFontLoadEvent(t,s)})}}get isFontLoadingAPISupported(){var e;const t=!!((e=this._document)!=null&&e.fonts);return ct(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){return ct(this,"isSyncFontLoadingSupported",He||Te.platform.isFirefox)}_queueLoadingCallback(t){function e(){for(Jt(!s.done,"completeRequest() cannot be called twice."),s.done=!0;i.length>0&&i[0].done;){const n=i.shift();setTimeout(n.callback,0)}}const{loadingRequests:i}=this,s={done:!1,complete:e,callback:t};return i.push(s),s}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return ct(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function i(x,C){return x.charCodeAt(C)<<24|x.charCodeAt(C+1)<<16|x.charCodeAt(C+2)<<8|x.charCodeAt(C+3)&255}function s(x,C,P,F){const I=x.substring(0,C),T=x.substring(C+P);return I+F+T}let n,r;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;function u(x,C){if(++c>30){it("Load test font never loaded."),C();return}if(l.font="30px "+x,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){C();return}setTimeout(u.bind(null,x,C))}const d="lt".concat(Date.now()).concat(this.loadTestFontId++);let f=this._loadTestFont;f=s(f,976,d.length,d);const v=16,y=1482184792;let w=i(f,v);for(n=0,r=d.length-3;n<r;n+=4)w=w-y+i(d,n)|0;n<d.length&&(w=w-y+i(d+"XXX",n)|0),f=s(f,v,4,gE(w));const A="url(data:font/opentype;base64,".concat(btoa(f),");"),S='@font-face {font-family:"'.concat(d,'";src:').concat(A,"}");this.insertRule(S);const E=this._document.createElement("div");E.style.visibility="hidden",E.style.width=E.style.height="10px",E.style.position="absolute",E.style.top=E.style.left="0px";for(const x of[t.loadedName,d]){const C=this._document.createElement("span");C.textContent="Hi",C.style.fontFamily=x,E.append(C)}this._document.body.append(E),u(d,()=>{E.remove(),e.complete()})}}kl=new WeakMap;class RE{constructor(t,e=null){this.compiledGlyphs=Object.create(null);for(const i in t)this[i]=t[i];this._inspectFont=e}createNativeFontFace(){var e;if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const i={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(i.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),t=new FontFace(this.cssFontInfo.fontFamily,this.data,i)}return(e=this._inspectFont)==null||e.call(this,this),t}createFontFaceRule(){var i;if(!this.data||this.disableFontFace)return null;const t="url(data:".concat(this.mimetype,";base64,").concat(py(this.data),");");let e;if(!this.cssFontInfo)e='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(t,"}");else{let s="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(s+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),e='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(s,"src:").concat(t,"}")}return(i=this._inspectFont)==null||i.call(this,this,t),e}getPathGenerator(t,e){if(this.compiledGlyphs[e]!==void 0)return this.compiledGlyphs[e];const i=this.loadedName+"_path_"+e;let s;try{s=t.get(i)}catch(r){it('getPathGenerator - ignoring character: "'.concat(r,'".'))}const n=new Path2D(s||"");return this.fontExtraProperties||t.delete(i),this.compiledGlyphs[e]=n}}function _E(h){if(h instanceof URL)return h.href;if(typeof h=="string"){if(He)return h;const t=URL.parse(h,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 DE(h){if(He&&typeof Buffer<"u"&&h instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(h instanceof Uint8Array&&h.byteLength===h.buffer.byteLength)return h;if(typeof h=="string")return df(h);if(h instanceof ArrayBuffer||ArrayBuffer.isView(h)||typeof h=="object"&&!isNaN(h==null?void 0:h.length))return new Uint8Array(h);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function Af(h){if(typeof h!="string")return null;if(h.endsWith("/"))return h;throw new Error('Invalid factory url: "'.concat(h,'" must include trailing slash.'))}const fm=h=>typeof h=="object"&&Number.isInteger(h==null?void 0:h.num)&&h.num>=0&&Number.isInteger(h==null?void 0:h.gen)&&h.gen>=0,LE=h=>typeof h=="object"&&typeof(h==null?void 0:h.name)=="string",ME=wE.bind(null,fm,LE);var on,Yp;class NE{constructor(){b(this,on,new Map);b(this,Yp,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};a(this,Yp).then(()=>{for(const[s]of a(this,on))s.call(this,i)})}addEventListener(t,e,i=null){let s=null;if((i==null?void 0:i.signal)instanceof AbortSignal){const{signal:n}=i;if(n.aborted){it("LoopbackPort - cannot use an `aborted` signal.");return}const r=()=>this.removeEventListener(t,e);s=()=>n.removeEventListener("abort",r),n.addEventListener("abort",r)}a(this,on).set(e,s)}removeEventListener(t,e){const i=a(this,on).get(e);i==null||i(),a(this,on).delete(e)}terminate(){for(const[,t]of a(this,on))t==null||t();a(this,on).clear()}}on=new WeakMap,Yp=new WeakMap;const Ef={DATA:1,ERROR:2},Kt={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function L0(){}function Ge(h){if(h instanceof ra||h instanceof Gg||h instanceof I0||h instanceof Rp||h instanceof Sg)return h;switch(h instanceof Error||typeof h=="object"&&h!==null||Pt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),h.name){case"AbortException":return new ra(h.message);case"InvalidPDFException":return new Gg(h.message);case"PasswordException":return new I0(h.message,h.code);case"ResponseException":return new Rp(h.message,h.status,h.missing);case"UnknownErrorException":return new Sg(h.message,h.details)}return new Sg(h.message,h.toString())}var Bl,ji,Qy,Jy,qy,$f;class fc{constructor(t,e,i){b(this,ji);b(this,Bl,new AbortController);this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),i.addEventListener("message",m(this,ji,Qy).bind(this),{signal:a(this,Bl).signal})}on(t,e){const i=this.actionHandler;if(i[t])throw new Error('There is already an actionName called "'.concat(t,'"'));i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const s=this.callbackId++,n=Promise.withResolvers();this.callbackCapabilities[s]=n;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:s,data:e},i)}catch(r){n.reject(r)}return n.promise}sendWithStream(t,e,i,s){const n=this.streamId++,r=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const u=Promise.withResolvers();return this.streamControllers[n]={controller:c,startCall:u,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:r,targetName:o,action:t,streamId:n,data:e,desiredSize:c.desiredSize},s),u.promise},pull:c=>{const u=Promise.withResolvers();return this.streamControllers[n].pullCall=u,l.postMessage({sourceName:r,targetName:o,stream:Kt.PULL,streamId:n,desiredSize:c.desiredSize}),u.promise},cancel:c=>{Jt(c instanceof Error,"cancel must have a valid reason");const u=Promise.withResolvers();return this.streamControllers[n].cancelCall=u,this.streamControllers[n].isClosed=!0,l.postMessage({sourceName:r,targetName:o,stream:Kt.CANCEL,streamId:n,reason:Ge(c)}),u.promise}},i)}destroy(){var t;(t=a(this,Bl))==null||t.abort(),p(this,Bl,null)}}Bl=new WeakMap,ji=new WeakSet,Qy=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){m(this,ji,qy).call(this,t);return}if(t.callback){const i=t.callbackId,s=this.callbackCapabilities[i];if(!s)throw new Error("Cannot resolve callback ".concat(i));if(delete this.callbackCapabilities[i],t.callback===Ef.DATA)s.resolve(t.data);else if(t.callback===Ef.ERROR)s.reject(Ge(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: ".concat(t.action));if(t.callbackId){const i=this.sourceName,s=t.sourceName,n=this.comObj;Promise.try(e,t.data).then(function(r){n.postMessage({sourceName:i,targetName:s,callback:Ef.DATA,callbackId:t.callbackId,data:r})},function(r){n.postMessage({sourceName:i,targetName:s,callback:Ef.ERROR,callbackId:t.callbackId,reason:Ge(r)})});return}if(t.streamId){m(this,ji,Jy).call(this,t);return}e(t.data)},Jy=function(t){const e=t.streamId,i=this.sourceName,s=t.sourceName,n=this.comObj,r=this,o=this.actionHandler[t.action],l={enqueue(c,u=1,d){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=u,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),n.postMessage({sourceName:i,targetName:s,stream:Kt.ENQUEUE,streamId:e,chunk:c},d)},close(){this.isCancelled||(this.isCancelled=!0,n.postMessage({sourceName:i,targetName:s,stream:Kt.CLOSE,streamId:e}),delete r.streamSinks[e])},error(c){Jt(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,n.postMessage({sourceName:i,targetName:s,stream:Kt.ERROR,streamId:e,reason:Ge(c)}))},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(){n.postMessage({sourceName:i,targetName:s,stream:Kt.START_COMPLETE,streamId:e,success:!0})},function(c){n.postMessage({sourceName:i,targetName:s,stream:Kt.START_COMPLETE,streamId:e,reason:Ge(c)})})},qy=function(t){const e=t.streamId,i=this.sourceName,s=t.sourceName,n=this.comObj,r=this.streamControllers[e],o=this.streamSinks[e];switch(t.stream){case Kt.START_COMPLETE:t.success?r.startCall.resolve():r.startCall.reject(Ge(t.reason));break;case Kt.PULL_COMPLETE:t.success?r.pullCall.resolve():r.pullCall.reject(Ge(t.reason));break;case Kt.PULL:if(!o){n.postMessage({sourceName:i,targetName:s,stream:Kt.PULL_COMPLETE,streamId:e,success:!0});break}o.desiredSize<=0&&t.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=t.desiredSize,Promise.try(o.onPull||L0).then(function(){n.postMessage({sourceName:i,targetName:s,stream:Kt.PULL_COMPLETE,streamId:e,success:!0})},function(c){n.postMessage({sourceName:i,targetName:s,stream:Kt.PULL_COMPLETE,streamId:e,reason:Ge(c)})});break;case Kt.ENQUEUE:if(Jt(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case Kt.CLOSE:if(Jt(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),m(this,ji,$f).call(this,r,e);break;case Kt.ERROR:Jt(r,"error should have stream controller"),r.controller.error(Ge(t.reason)),m(this,ji,$f).call(this,r,e);break;case Kt.CANCEL_COMPLETE:t.success?r.cancelCall.resolve():r.cancelCall.reject(Ge(t.reason)),m(this,ji,$f).call(this,r,e);break;case Kt.CANCEL:if(!o)break;const l=Ge(t.reason);Promise.try(o.onCancel||L0,l).then(function(){n.postMessage({sourceName:i,targetName:s,stream:Kt.CANCEL_COMPLETE,streamId:e,success:!0})},function(c){n.postMessage({sourceName:i,targetName:s,stream:Kt.CANCEL_COMPLETE,streamId:e,reason:Ge(c)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},$f=async function(t,e){var i,s,n;await Promise.allSettled([(i=t.startCall)==null?void 0:i.promise,(s=t.pullCall)==null?void 0:s.promise,(n=t.cancelCall)==null?void 0:n.promise]),delete this.streamControllers[e]};var Su;class tw{constructor({enableHWA:t=!1}){b(this,Su,!1);p(this,Su,t)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!a(this,Su)})}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){Pt("Abstract method `_createCanvas` called.")}}Su=new WeakMap;class OE extends tw{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}}class ew{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(i=>({cMapData:i,isCompressed:this.isCompressed})).catch(i=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(e))})}async _fetch(t){Pt("Abstract method `_fetch` called.")}}class M0 extends ew{async _fetch(t){const e=await ff(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):df(e)}}class iw{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,s,n){return"none"}destroy(t=!1){}}var Ua,jl,ln,hn,_e,Wa,za,W,Ie,pc,Jo,Uf,qo,sw,pm,tl,gc,mc,gm,vc;class kE extends iw{constructor({docId:e,ownerDocument:i=globalThis.document}){super();b(this,W);b(this,Ua);b(this,jl);b(this,ln);b(this,hn);b(this,_e);b(this,Wa);b(this,za,0);p(this,hn,e),p(this,_e,i)}addFilter(e){if(!e)return"none";let i=a(this,W,Ie).get(e);if(i)return i;const[s,n,r]=m(this,W,Uf).call(this,e),o=e.length===1?s:"".concat(s).concat(n).concat(r);if(i=a(this,W,Ie).get(o),i)return a(this,W,Ie).set(e,i),i;const l="g_".concat(a(this,hn),"_transfer_map_").concat(ge(this,za)._++),c=m(this,W,qo).call(this,l);a(this,W,Ie).set(e,c),a(this,W,Ie).set(o,c);const u=m(this,W,tl).call(this,l);return m(this,W,mc).call(this,s,n,r,u),c}addHCMFilter(e,i){var v;const s="".concat(e,"-").concat(i),n="base";let r=a(this,W,pc).get(n);if((r==null?void 0:r.key)===s||(r?((v=r.filter)==null||v.remove(),r.key=s,r.url="none",r.filter=null):(r={key:s,url:"none",filter:null},a(this,W,pc).set(n,r)),!e||!i))return r.url;const o=m(this,W,vc).call(this,e);e=Q.makeHexColor(...o);const l=m(this,W,vc).call(this,i);if(i=Q.makeHexColor(...l),a(this,W,Jo).style.color="",e==="#000000"&&i==="#ffffff"||e===i)return r.url;const c=new Array(256);for(let y=0;y<=255;y++){const w=y/255;c[y]=w<=.03928?w/12.92:((w+.055)/1.055)**2.4}const u=c.join(","),d="g_".concat(a(this,hn),"_hcm_filter"),f=r.filter=m(this,W,tl).call(this,d);m(this,W,mc).call(this,u,u,u,f),m(this,W,pm).call(this,f);const g=(y,w)=>{const A=o[y]/255,S=l[y]/255,E=new Array(w+1);for(let x=0;x<=w;x++)E[x]=A+x/w*(S-A);return E.join(",")};return m(this,W,mc).call(this,g(0,5),g(1,5),g(2,5),f),r.url=m(this,W,qo).call(this,d),r.url}addAlphaFilter(e){let i=a(this,W,Ie).get(e);if(i)return i;const[s]=m(this,W,Uf).call(this,[e]),n="alpha_".concat(s);if(i=a(this,W,Ie).get(n),i)return a(this,W,Ie).set(e,i),i;const r="g_".concat(a(this,hn),"_alpha_map_").concat(ge(this,za)._++),o=m(this,W,qo).call(this,r);a(this,W,Ie).set(e,o),a(this,W,Ie).set(n,o);const l=m(this,W,tl).call(this,r);return m(this,W,gm).call(this,s,l),o}addLuminosityFilter(e){let i=a(this,W,Ie).get(e||"luminosity");if(i)return i;let s,n;if(e?([s]=m(this,W,Uf).call(this,[e]),n="luminosity_".concat(s)):n="luminosity",i=a(this,W,Ie).get(n),i)return a(this,W,Ie).set(e,i),i;const r="g_".concat(a(this,hn),"_luminosity_map_").concat(ge(this,za)._++),o=m(this,W,qo).call(this,r);a(this,W,Ie).set(e,o),a(this,W,Ie).set(n,o);const l=m(this,W,tl).call(this,r);return m(this,W,sw).call(this,l),e&&m(this,W,gm).call(this,s,l),o}addHighlightHCMFilter(e,i,s,n,r){var S;const o="".concat(i,"-").concat(s,"-").concat(n,"-").concat(r);let l=a(this,W,pc).get(e);if((l==null?void 0:l.key)===o||(l?((S=l.filter)==null||S.remove(),l.key=o,l.url="none",l.filter=null):(l={key:o,url:"none",filter:null},a(this,W,pc).set(e,l)),!i||!s))return l.url;const[c,u]=[i,s].map(m(this,W,vc).bind(this));let d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),f=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),[g,v]=[n,r].map(m(this,W,vc).bind(this));f<d&&([d,f,g,v]=[f,d,v,g]),a(this,W,Jo).style.color="";const y=(E,x,C)=>{const P=new Array(256),F=(f-d)/C,I=E/255,T=(x-E)/(255*C);let R=0;for(let _=0;_<=C;_++){const j=Math.round(d+_*F),k=I+_*T;for(let U=R;U<=j;U++)P[U]=k;R=j+1}for(let _=R;_<256;_++)P[_]=P[R-1];return P.join(",")},w="g_".concat(a(this,hn),"_hcm_").concat(e,"_filter"),A=l.filter=m(this,W,tl).call(this,w);return m(this,W,pm).call(this,A),m(this,W,mc).call(this,y(g[0],v[0],5),y(g[1],v[1],5),y(g[2],v[2],5),A),l.url=m(this,W,qo).call(this,w),l.url}destroy(e=!1){var i,s,n,r;e&&((i=a(this,Wa))!=null&&i.size)||((s=a(this,ln))==null||s.parentNode.parentNode.remove(),p(this,ln,null),(n=a(this,jl))==null||n.clear(),p(this,jl,null),(r=a(this,Wa))==null||r.clear(),p(this,Wa,null),p(this,za,0))}}Ua=new WeakMap,jl=new WeakMap,ln=new WeakMap,hn=new WeakMap,_e=new WeakMap,Wa=new WeakMap,za=new WeakMap,W=new WeakSet,Ie=function(){return a(this,jl)||p(this,jl,new Map)},pc=function(){return a(this,Wa)||p(this,Wa,new Map)},Jo=function(){if(!a(this,ln)){const e=a(this,_e).createElement("div"),{style:i}=e;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const s=a(this,_e).createElementNS($s,"svg");s.setAttribute("width",0),s.setAttribute("height",0),p(this,ln,a(this,_e).createElementNS($s,"defs")),e.append(s),s.append(a(this,ln)),a(this,_e).body.append(e)}return a(this,ln)},Uf=function(e){if(e.length===1){const c=e[0],u=new Array(256);for(let f=0;f<256;f++)u[f]=c[f]/255;const d=u.join(",");return[d,d,d]}const[i,s,n]=e,r=new Array(256),o=new Array(256),l=new Array(256);for(let c=0;c<256;c++)r[c]=i[c]/255,o[c]=s[c]/255,l[c]=n[c]/255;return[r.join(","),o.join(","),l.join(",")]},qo=function(e){if(a(this,Ua)===void 0){p(this,Ua,"");const i=a(this,_e).URL;i!==a(this,_e).baseURI&&(fg(i)?it('#createUrl: ignore "data:"-URL for performance reasons.'):p(this,Ua,uy(i,"")))}return"url(".concat(a(this,Ua),"#").concat(e,")")},sw=function(e){const i=a(this,_e).createElementNS($s,"feColorMatrix");i.setAttribute("type","matrix"),i.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(i)},pm=function(e){const i=a(this,_e).createElementNS($s,"feColorMatrix");i.setAttribute("type","matrix"),i.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(i)},tl=function(e){const i=a(this,_e).createElementNS($s,"filter");return i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("id",e),a(this,W,Jo).append(i),i},gc=function(e,i,s){const n=a(this,_e).createElementNS($s,i);n.setAttribute("type","discrete"),n.setAttribute("tableValues",s),e.append(n)},mc=function(e,i,s,n){const r=a(this,_e).createElementNS($s,"feComponentTransfer");n.append(r),m(this,W,gc).call(this,r,"feFuncR",e),m(this,W,gc).call(this,r,"feFuncG",i),m(this,W,gc).call(this,r,"feFuncB",s)},gm=function(e,i){const s=a(this,_e).createElementNS($s,"feComponentTransfer");i.append(s),m(this,W,gc).call(this,s,"feFuncA",e)},vc=function(e){return a(this,W,Jo).style.color=e,pg(getComputedStyle(a(this,W,Jo)).getPropertyValue("color"))};class nw{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="".concat(this.baseUrl).concat(t);return this._fetch(e).catch(i=>{throw new Error("Unable to load font data at: ".concat(e))})}async _fetch(t){Pt("Abstract method `_fetch` called.")}}class N0 extends nw{async _fetch(t){const e=await ff(t,"arraybuffer");return new Uint8Array(e)}}class rw{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="".concat(this.baseUrl).concat(t);return this._fetch(e).catch(i=>{throw new Error("Unable to load wasm data at: ".concat(e))})}async _fetch(t){Pt("Abstract method `_fetch` called.")}}class O0 extends rw{async _fetch(t){const e=await ff(t,"arraybuffer");return new Uint8Array(e)}}He&&it("Please use the `legacy` build in Node.js environments.");async function l0(h){const e=await process.getBuiltinModule("fs").promises.readFile(h);return new Uint8Array(e)}class BE extends iw{}class jE extends tw{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t,e)}}class VE extends ew{async _fetch(t){return l0(t)}}class HE extends nw{async _fetch(t){return l0(t)}}class $E extends rw{async _fetch(t){return l0(t)}}const xe={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function mm(h,t){if(!t)return;const e=t[2]-t[0],i=t[3]-t[1],s=new Path2D;s.rect(t[0],t[1],e,i),h.clip(s)}class h0{isModifyingCurrentTransform(){return!1}getPattern(){Pt("Abstract method `getPattern` called.")}}class UE extends h0{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 i of this._colorStops)e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,s){let n;if(s===xe.STROKE||s===xe.FILL){const r=e.current.getClippedPathBoundingBox(s,Vt(t))||[0,0,0,0],o=Math.ceil(r[2]-r[0])||1,l=Math.ceil(r[3]-r[1])||1,c=e.cachedCanvases.getCanvas("pattern",o,l),u=c.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-r[0],-r[1]),i=Q.transform(i,[1,0,0,1,r[0],r[1]]),u.transform(...e.baseTransform),this.matrix&&u.transform(...this.matrix),mm(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),n=t.createPattern(c.canvas,"no-repeat");const d=new DOMMatrix(i);n.setTransform(d)}else mm(t,this._bbox),n=this._createGradient(t);return n}}function Pg(h,t,e,i,s,n,r,o){const l=t.coords,c=t.colors,u=h.data,d=h.width*4;let f;l[e+1]>l[i+1]&&(f=e,e=i,i=f,f=n,n=r,r=f),l[i+1]>l[s+1]&&(f=i,i=s,s=f,f=r,r=o,o=f),l[e+1]>l[i+1]&&(f=e,e=i,i=f,f=n,n=r,r=f);const g=(l[e]+t.offsetX)*t.scaleX,v=(l[e+1]+t.offsetY)*t.scaleY,y=(l[i]+t.offsetX)*t.scaleX,w=(l[i+1]+t.offsetY)*t.scaleY,A=(l[s]+t.offsetX)*t.scaleX,S=(l[s+1]+t.offsetY)*t.scaleY;if(v>=S)return;const E=c[n],x=c[n+1],C=c[n+2],P=c[r],F=c[r+1],I=c[r+2],T=c[o],R=c[o+1],_=c[o+2],j=Math.round(v),k=Math.round(S);let U,ft,B,L,et,rt,_t,Xt;for(let yt=j;yt<=k;yt++){if(yt<w){const N=yt<v?0:(v-yt)/(v-w);U=g-(g-y)*N,ft=E-(E-P)*N,B=x-(x-F)*N,L=C-(C-I)*N}else{let N;yt>S?N=1:w===S?N=0:N=(w-yt)/(w-S),U=y-(y-A)*N,ft=P-(P-T)*N,B=F-(F-R)*N,L=I-(I-_)*N}let At;yt<v?At=0:yt>S?At=1:At=(v-yt)/(v-S),et=g-(g-A)*At,rt=E-(E-T)*At,_t=x-(x-R)*At,Xt=C-(C-_)*At;const os=Math.round(Math.min(U,et)),ti=Math.round(Math.max(U,et));let z=d*yt+os*4;for(let N=os;N<=ti;N++)At=(U-N)/(U-et),At<0?At=0:At>1&&(At=1),u[z++]=ft-(ft-rt)*At|0,u[z++]=B-(B-_t)*At|0,u[z++]=L-(L-Xt)*At|0,u[z++]=255}}function WE(h,t,e){const i=t.coords,s=t.colors;let n,r;switch(t.type){case"lattice":const o=t.verticesPerRow,l=Math.floor(i.length/o)-1,c=o-1;for(n=0;n<l;n++){let u=n*o;for(let d=0;d<c;d++,u++)Pg(h,e,i[u],i[u+1],i[u+o],s[u],s[u+1],s[u+o]),Pg(h,e,i[u+o+1],i[u+1],i[u+o],s[u+o+1],s[u+1],s[u+o])}break;case"triangles":for(n=0,r=i.length;n<r;n+=3)Pg(h,e,i[n],i[n+1],i[n+2],s[n],s[n+1],s[n+2]);break;default:throw new Error("illegal figure")}}class zE extends h0{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,i){const o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-o,u=Math.ceil(this._bounds[3])-l,d=Math.min(Math.ceil(Math.abs(c*t[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(u*t[1]*1.1)),3e3),g=c/d,v=u/f,y={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-l,scaleX:1/g,scaleY:1/v},w=d+2*2,A=f+2*2,S=i.getCanvas("mesh",w,A),E=S.context,x=E.createImageData(d,f);if(e){const P=x.data;for(let F=0,I=P.length;F<I;F+=4)P[F]=e[0],P[F+1]=e[1],P[F+2]=e[2],P[F+3]=255}for(const P of this._figures)WE(x,P,y);return E.putImageData(x,2,2),{canvas:S.canvas,offsetX:o-2*g,offsetY:l-2*v,scaleX:g,scaleY:v}}isModifyingCurrentTransform(){return!0}getPattern(t,e,i,s){mm(t,this._bbox);const n=new Float32Array(2);if(s===xe.SHADING)Q.singularValueDecompose2dScale(Vt(t),n);else if(this.matrix){Q.singularValueDecompose2dScale(this.matrix,n);const[o,l]=n;Q.singularValueDecompose2dScale(e.baseTransform,n),n[0]*=o,n[1]*=l}else Q.singularValueDecompose2dScale(e.baseTransform,n);const r=this._createMeshCanvas(n,s===xe.SHADING?null:this._background,e.cachedCanvases);return s!==xe.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(r.offsetX,r.offsetY),t.scale(r.scaleX,r.scaleY),t.createPattern(r.canvas,"no-repeat")}}class GE extends h0{getPattern(){return"hotpink"}}function XE(h){switch(h[0]){case"RadialAxial":return new UE(h);case"Mesh":return new zE(h);case"Dummy":return new GE}throw new Error("Unknown IR type: ".concat(h[0]))}const k0={COLORED:1,UNCOLORED:2},Kp=class Kp{constructor(t,e,i,s){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=i,this.baseTransform=s}createPatternCanvas(t){const{bbox:e,operatorList:i,paintType:s,tilingType:n,color:r,canvasGraphicsFactory:o}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),dg("TilingType: "+n);const u=e[0],d=e[1],f=e[2],g=e[3],v=f-u,y=g-d,w=new Float32Array(2);Q.singularValueDecompose2dScale(this.matrix,w);const[A,S]=w;Q.singularValueDecompose2dScale(this.baseTransform,w);const E=A*w[0],x=S*w[1];let C=v,P=y,F=!1,I=!1;const T=Math.ceil(l*E),R=Math.ceil(c*x),_=Math.ceil(v*E),j=Math.ceil(y*x);T>=_?C=l:F=!0,R>=j?P=c:I=!0;const k=this.getSizeAndScale(C,this.ctx.canvas.width,E),U=this.getSizeAndScale(P,this.ctx.canvas.height,x),ft=t.cachedCanvases.getCanvas("pattern",k.size,U.size),B=ft.context,L=o.createCanvasGraphics(B);if(L.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(L,s,r),B.translate(-k.scale*u,-U.scale*d),L.transform(k.scale,0,0,U.scale,0,0),B.save(),this.clipBbox(L,u,d,f,g),L.baseTransform=Vt(L.ctx),L.executeOperatorList(i),L.endDrawing(),B.restore(),F||I){const et=ft.canvas;F&&(C=l),I&&(P=c);const rt=this.getSizeAndScale(C,this.ctx.canvas.width,E),_t=this.getSizeAndScale(P,this.ctx.canvas.height,x),Xt=rt.size,yt=_t.size,At=t.cachedCanvases.getCanvas("pattern-workaround",Xt,yt),os=At.context,ti=F?Math.floor(v/l):0,z=I?Math.floor(y/c):0;for(let N=0;N<=ti;N++)for(let H=0;H<=z;H++)os.drawImage(et,Xt*N,yt*H,Xt,yt,0,0,Xt,yt);return{canvas:At.canvas,scaleX:rt.scale,scaleY:_t.scale,offsetX:u,offsetY:d}}return{canvas:ft.canvas,scaleX:k.scale,scaleY:U.scale,offsetX:u,offsetY:d}}getSizeAndScale(t,e,i){const s=Math.max(Kp.MAX_PATTERN_SIZE,e);let n=Math.ceil(t*i);return n>=s?n=s:i=n/t,{scale:i,size:n}}clipBbox(t,e,i,s,n){const r=s-e,o=n-i;t.ctx.rect(e,i,r,o),Q.axialAlignedBoundingBox([e,i,s,n],Vt(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const s=t.ctx,n=t.current;switch(e){case k0.COLORED:const{fillStyle:r,strokeStyle:o}=this.ctx;s.fillStyle=n.fillColor=r,s.strokeStyle=n.strokeColor=o;break;case k0.UNCOLORED:s.fillStyle=s.strokeStyle=i,n.fillColor=n.strokeColor=i;break;default:throw new pE("Unsupported paint type: ".concat(e))}}isModifyingCurrentTransform(){return!1}getPattern(t,e,i,s){let n=i;s!==xe.SHADING&&(n=Q.transform(n,e.baseTransform),this.matrix&&(n=Q.transform(n,this.matrix)));const r=this.createPatternCanvas(e);let o=new DOMMatrix(n);o=o.translate(r.offsetX,r.offsetY),o=o.scale(1/r.scaleX,1/r.scaleY);const l=t.createPattern(r.canvas,"repeat");return l.setTransform(o),l}};M(Kp,"MAX_PATTERN_SIZE",3e3);let vm=Kp;function YE({src:h,srcPos:t=0,dest:e,width:i,height:s,nonBlackColor:n=4294967295,inverseDecode:r=!1}){const o=Te.isLittleEndian?4278190080:255,[l,c]=r?[n,o]:[o,n],u=i>>3,d=i&7,f=h.length;e=new Uint32Array(e.buffer);let g=0;for(let v=0;v<s;v++){for(const w=t+u;t<w;t++){const A=t<f?h[t]:255;e[g++]=A&128?c:l,e[g++]=A&64?c:l,e[g++]=A&32?c:l,e[g++]=A&16?c:l,e[g++]=A&8?c:l,e[g++]=A&4?c:l,e[g++]=A&2?c:l,e[g++]=A&1?c:l}if(d===0)continue;const y=t<f?h[t++]:255;for(let w=0;w<d;w++)e[g++]=y&1<<7-w?c:l}return{srcPos:t,destPos:g}}const B0=16,j0=100,KE=15,V0=10,Je=16,Tg=new DOMMatrix,Ai=new Float32Array(2),ul=new Float32Array([1/0,1/0,-1/0,-1/0]);function ZE(h,t){if(h._removeMirroring)throw new Error("Context is already forwarding operations.");h.__originalSave=h.save,h.__originalRestore=h.restore,h.__originalRotate=h.rotate,h.__originalScale=h.scale,h.__originalTranslate=h.translate,h.__originalTransform=h.transform,h.__originalSetTransform=h.setTransform,h.__originalResetTransform=h.resetTransform,h.__originalClip=h.clip,h.__originalMoveTo=h.moveTo,h.__originalLineTo=h.lineTo,h.__originalBezierCurveTo=h.bezierCurveTo,h.__originalRect=h.rect,h.__originalClosePath=h.closePath,h.__originalBeginPath=h.beginPath,h._removeMirroring=()=>{h.save=h.__originalSave,h.restore=h.__originalRestore,h.rotate=h.__originalRotate,h.scale=h.__originalScale,h.translate=h.__originalTranslate,h.transform=h.__originalTransform,h.setTransform=h.__originalSetTransform,h.resetTransform=h.__originalResetTransform,h.clip=h.__originalClip,h.moveTo=h.__originalMoveTo,h.lineTo=h.__originalLineTo,h.bezierCurveTo=h.__originalBezierCurveTo,h.rect=h.__originalRect,h.closePath=h.__originalClosePath,h.beginPath=h.__originalBeginPath,delete h._removeMirroring},h.save=function(){t.save(),this.__originalSave()},h.restore=function(){t.restore(),this.__originalRestore()},h.translate=function(e,i){t.translate(e,i),this.__originalTranslate(e,i)},h.scale=function(e,i){t.scale(e,i),this.__originalScale(e,i)},h.transform=function(e,i,s,n,r,o){t.transform(e,i,s,n,r,o),this.__originalTransform(e,i,s,n,r,o)},h.setTransform=function(e,i,s,n,r,o){t.setTransform(e,i,s,n,r,o),this.__originalSetTransform(e,i,s,n,r,o)},h.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},h.rotate=function(e){t.rotate(e),this.__originalRotate(e)},h.clip=function(e){t.clip(e),this.__originalClip(e)},h.moveTo=function(e,i){t.moveTo(e,i),this.__originalMoveTo(e,i)},h.lineTo=function(e,i){t.lineTo(e,i),this.__originalLineTo(e,i)},h.bezierCurveTo=function(e,i,s,n,r,o){t.bezierCurveTo(e,i,s,n,r,o),this.__originalBezierCurveTo(e,i,s,n,r,o)},h.rect=function(e,i,s,n){t.rect(e,i,s,n),this.__originalRect(e,i,s,n)},h.closePath=function(){t.closePath(),this.__originalClosePath()},h.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class QE{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let s;return this.cache[t]!==void 0?(s=this.cache[t],this.canvasFactory.reset(s,e,i)):(s=this.canvasFactory.create(e,i),this.cache[t]=s),s}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function Sf(h,t,e,i,s,n,r,o,l,c){const[u,d,f,g,v,y]=Vt(h);if(d===0&&f===0){const S=r*u+v,E=Math.round(S),x=o*g+y,C=Math.round(x),P=(r+l)*u+v,F=Math.abs(Math.round(P)-E)||1,I=(o+c)*g+y,T=Math.abs(Math.round(I)-C)||1;return h.setTransform(Math.sign(u),0,0,Math.sign(g),E,C),h.drawImage(t,e,i,s,n,0,0,F,T),h.setTransform(u,d,f,g,v,y),[F,T]}if(u===0&&g===0){const S=o*f+v,E=Math.round(S),x=r*d+y,C=Math.round(x),P=(o+c)*f+v,F=Math.abs(Math.round(P)-E)||1,I=(r+l)*d+y,T=Math.abs(Math.round(I)-C)||1;return h.setTransform(0,Math.sign(d),Math.sign(f),0,E,C),h.drawImage(t,e,i,s,n,0,0,T,F),h.setTransform(u,d,f,g,v,y),[T,F]}h.drawImage(t,e,i,s,n,r,o,l,c);const w=Math.hypot(u,d),A=Math.hypot(f,g);return[w*l,A*c]}class H0{constructor(t,e){M(this,"alphaIsShape",!1);M(this,"fontSize",0);M(this,"fontSizeScale",1);M(this,"textMatrix",null);M(this,"textMatrixScale",1);M(this,"fontMatrix",zg);M(this,"leading",0);M(this,"x",0);M(this,"y",0);M(this,"lineX",0);M(this,"lineY",0);M(this,"charSpacing",0);M(this,"wordSpacing",0);M(this,"textHScale",1);M(this,"textRenderingMode",Fe.FILL);M(this,"textRise",0);M(this,"fillColor","#000000");M(this,"strokeColor","#000000");M(this,"patternFill",!1);M(this,"patternStroke",!1);M(this,"fillAlpha",1);M(this,"strokeAlpha",1);M(this,"lineWidth",1);M(this,"activeSMask",null);M(this,"transferMaps","none");this.clipBox=new Float32Array([0,0,t,e]),this.minMax=ul.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=xe.FILL,e=null){const i=this.minMax.slice();if(t===xe.STROKE){e||Pt("Stroke bounding box must include transform."),Q.singularValueDecompose2dScale(e,Ai);const s=Ai[0]*this.lineWidth/2,n=Ai[1]*this.lineWidth/2;i[0]-=s,i[1]-=n,i[2]+=s,i[3]+=n}return i}updateClipFromPath(){const t=Q.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(ul,0)}getClippedPathBoundingBox(t=xe.FILL,e=null){return Q.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function $0(h,t){if(t instanceof ImageData){h.putImageData(t,0,0);return}const e=t.height,i=t.width,s=e%Je,n=(e-s)/Je,r=s===0?n:n+1,o=h.createImageData(i,Je);let l=0,c;const u=t.data,d=o.data;let f,g,v,y;if(t.kind===Mf.GRAYSCALE_1BPP){const w=u.byteLength,A=new Uint32Array(d.buffer,0,d.byteLength>>2),S=A.length,E=i+7>>3,x=4294967295,C=Te.isLittleEndian?4278190080:255;for(f=0;f<r;f++){for(v=f<n?Je:s,c=0,g=0;g<v;g++){const P=w-l;let F=0;const I=P>E?i:P*8-7,T=I&-8;let R=0,_=0;for(;F<T;F+=8)_=u[l++],A[c++]=_&128?x:C,A[c++]=_&64?x:C,A[c++]=_&32?x:C,A[c++]=_&16?x:C,A[c++]=_&8?x:C,A[c++]=_&4?x:C,A[c++]=_&2?x:C,A[c++]=_&1?x:C;for(;F<I;F++)R===0&&(_=u[l++],R=128),A[c++]=_&R?x:C,R>>=1}for(;c<S;)A[c++]=0;h.putImageData(o,0,f*Je)}}else if(t.kind===Mf.RGBA_32BPP){for(g=0,y=i*Je*4,f=0;f<n;f++)d.set(u.subarray(l,l+y)),l+=y,h.putImageData(o,0,g),g+=Je;f<r&&(y=i*s*4,d.set(u.subarray(l,l+y)),h.putImageData(o,0,g))}else if(t.kind===Mf.RGB_24BPP)for(v=Je,y=i*v,f=0;f<r;f++){for(f>=n&&(v=s,y=i*v),c=0,g=y;g--;)d[c++]=u[l++],d[c++]=u[l++],d[c++]=u[l++],d[c++]=255;h.putImageData(o,0,f*Je)}else throw new Error("bad image kind: ".concat(t.kind))}function U0(h,t){if(t.bitmap){h.drawImage(t.bitmap,0,0);return}const e=t.height,i=t.width,s=e%Je,n=(e-s)/Je,r=s===0?n:n+1,o=h.createImageData(i,Je);let l=0;const c=t.data,u=o.data;for(let d=0;d<r;d++){const f=d<n?Je:s;({srcPos:l}=YE({src:c,srcPos:l,dest:u,width:i,height:f,nonBlackColor:0})),h.putImageData(o,0,d*Je)}}function ec(h,t){const e=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of e)h[i]!==void 0&&(t[i]=h[i]);h.setLineDash!==void 0&&(t.setLineDash(h.getLineDash()),t.lineDashOffset=h.lineDashOffset)}function xf(h){h.strokeStyle=h.fillStyle="#000000",h.fillRule="nonzero",h.globalAlpha=1,h.lineWidth=1,h.lineCap="butt",h.lineJoin="miter",h.miterLimit=10,h.globalCompositeOperation="source-over",h.font="10px sans-serif",h.setLineDash!==void 0&&(h.setLineDash([]),h.lineDashOffset=0);const{filter:t}=h;t!=="none"&&t!==""&&(h.filter="none")}function W0(h,t){if(t)return!0;Q.singularValueDecompose2dScale(h,Ai);const e=Math.fround(Wo.pixelRatio*aa.PDF_TO_CSS_UNITS);return Ai[0]<=e&&Ai[1]<=e}const JE=["butt","round","square"],qE=["miter","round","bevel"],tS={},z0={};var as,bm,ym,wm;const E0=class E0{constructor(t,e,i,s,n,{optionalContentConfig:r,markedContentStack:o=null},l,c){b(this,as);this.ctx=t,this.current=new H0(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=s,this.filterFactory=n,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=r,this.cachedCanvases=new QE(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,e=null){return typeof t=="string"?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing({transform:t,viewport:e,transparency:i=!1,background:s=null}){const n=this.ctx.canvas.width,r=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,n,r),this.ctx.fillStyle=o,i){const l=this.cachedCanvases.getCanvas("transparent",n,r);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...Vt(this.compositeCtx))}this.ctx.save(),xf(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=Vt(this.ctx)}executeOperatorList(t,e,i,s){const n=t.argsArray,r=t.fnArray;let o=e||0;const l=n.length;if(l===o)return o;const c=l-o>V0&&typeof i=="function",u=c?Date.now()+KE:0;let d=0;const f=this.commonObjs,g=this.objs;let v;for(;;){if(s!==void 0&&o===s.nextBreakPoint)return s.breakIt(o,i),o;if(v=r[o],v!==Ip.dependency)this[v].apply(this,n[o]);else for(const y of n[o]){const w=y.startsWith("g_")?f:g;if(!w.has(y))return w.get(y,i),o}if(o++,o===l)return o;if(c&&++d>V0){if(Date.now()>u)return i(),o;d=0}}}endDrawing(){m(this,as,bm).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(),m(this,as,ym).call(this)}_scaleImage(t,e){var f,g;const i=(f=t.width)!=null?f:t.displayWidth,s=(g=t.height)!=null?g:t.displayHeight;let n=Math.max(Math.hypot(e[0],e[1]),1),r=Math.max(Math.hypot(e[2],e[3]),1),o=i,l=s,c="prescale1",u,d;for(;n>2&&o>1||r>2&&l>1;){let v=o,y=l;n>2&&o>1&&(v=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),n/=o/v),r>2&&l>1&&(y=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,r/=l/y),u=this.cachedCanvases.getCanvas(c,v,y),d=u.context,d.clearRect(0,0,v,y),d.drawImage(t,0,0,o,l,0,0,v,y),t=u.canvas,o=v,l=y,c=c==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:o,paintHeight:l}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:s}=t,n=this.current.fillColor,r=this.current.patternFill,o=Vt(e);let l,c,u,d;if((t.bitmap||t.data)&&t.count>1){const T=t.bitmap||t.data.buffer;c=JSON.stringify(r?o:[o.slice(0,4),n]),l=this._cachedBitmapsMap.get(T),l||(l=new Map,this._cachedBitmapsMap.set(T,l));const R=l.get(c);if(R&&!r){const _=Math.round(Math.min(o[0],o[2])+o[4]),j=Math.round(Math.min(o[1],o[3])+o[5]);return{canvas:R,offsetX:_,offsetY:j}}u=R}u||(d=this.cachedCanvases.getCanvas("maskCanvas",i,s),U0(d.context,t));let f=Q.transform(o,[1/i,0,0,-1/s,0,0]);f=Q.transform(f,[1,0,0,1,0,-s]);const g=ul.slice();Q.axialAlignedBoundingBox([0,0,i,s],f,g);const[v,y,w,A]=g,S=Math.round(w-v)||1,E=Math.round(A-y)||1,x=this.cachedCanvases.getCanvas("fillCanvas",S,E),C=x.context,P=v,F=y;C.translate(-P,-F),C.transform(...f),u||(u=this._scaleImage(d.canvas,ls(C)),u=u.img,l&&r&&l.set(c,u)),C.imageSmoothingEnabled=W0(Vt(C),t.interpolate),Sf(C,u,0,0,u.width,u.height,0,0,i,s),C.globalCompositeOperation="source-in";const I=Q.transform(ls(C),[1,0,0,1,-P,-F]);return C.fillStyle=r?n.getPattern(e,this,I,xe.FILL):n,C.fillRect(0,0,i,s),l&&!r&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,x.canvas)),{canvas:x.canvas,offsetX:Math.round(P),offsetY:Math.round(F)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=JE[t]}setLineJoin(t){this.ctx.lineJoin=qE[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.ctx.globalAlpha=this.current.fillAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx;const n=this.ctx=s.context;n.setTransform(this.suspendedCtx.getTransform()),ec(this.suspendedCtx,n),ZE(n,this.suspendedCtx),this.setGState([["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),ec(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,i=this.suspendedCtx;this.composeSMask(i,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,i,s){const n=s[0],r=s[1],o=s[2]-n,l=s[3]-r;o===0||l===0||(this.genericComposeSMask(e.context,i,o,l,e.subtype,e.backdrop,e.transferMap,n,r,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,e,i,s,n,r,o,l,c,u,d){let f=t.canvas,g=l-u,v=c-d;if(r)if(g<0||v<0||g+i>f.width||v+s>f.height){const w=this.cachedCanvases.getCanvas("maskExtension",i,s),A=w.context;A.drawImage(f,-g,-v),A.globalCompositeOperation="destination-atop",A.fillStyle=r,A.fillRect(0,0,i,s),A.globalCompositeOperation="source-over",f=w.canvas,g=v=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const w=new Path2D;w.rect(g,v,i,s),t.clip(w),t.globalCompositeOperation="destination-atop",t.fillStyle=r,t.fillRect(g,v,i,s),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),n==="Alpha"&&o?e.filter=this.filterFactory.addAlphaFilter(o):n==="Luminosity"&&(e.filter=this.filterFactory.addLuminosityFilter(o));const y=new Path2D;y.rect(l,c,i,s),e.clip(y),e.globalCompositeOperation="destination-in",e.drawImage(f,g,v,i,s,l,c,i,s),e.restore()}save(){this.inSMaskMode&&ec(this.ctx,this.suspendedCtx),this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){if(this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&ec(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(t,e,i,s,n,r){this.ctx.transform(t,e,i,s,n,r),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){let[s]=e;if(!i){s||(s=e[0]=new Path2D),this[t](s);return}if(!(s instanceof Path2D)){const n=e[0]=new Path2D;for(let r=0,o=s.length;r<o;)switch(s[r++]){case yf.moveTo:n.moveTo(s[r++],s[r++]);break;case yf.lineTo:n.lineTo(s[r++],s[r++]);break;case yf.curveTo:n.bezierCurveTo(s[r++],s[r++],s[r++],s[r++],s[r++],s[r++]);break;case yf.closePath:n.closePath();break;default:it("Unrecognized drawing path operator: ".concat(s[r-1]));break}s=n}Q.axialAlignedBoundingBox(i,Vt(this.ctx),this.current.minMax),this[t](s)}closePath(){this.ctx.closePath()}stroke(t,e=!0){const i=this.ctx,s=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof s=="object"&&(s!=null&&s.getPattern)){const n=s.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=s.getPattern(i,this,ls(i),xe.STROKE),n){const r=new Path2D;r.addPath(t,i.getTransform().invertSelf().multiplySelf(n)),t=r}this.rescaleAndStroke(t,!1),i.restore()}else this.rescaleAndStroke(t,!0);e&&this.consumePath(t,this.current.getClippedPathBoundingBox(xe.STROKE,Vt(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(t){this.stroke(t)}fill(t,e=!0){const i=this.ctx,s=this.current.fillColor,n=this.current.patternFill;let r=!1;if(n){const l=s.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.fillStyle=s.getPattern(i,this,ls(i),xe.FILL),l){const c=new Path2D;c.addPath(t,i.getTransform().invertSelf().multiplySelf(l)),t=c}r=!0}const o=this.current.getClippedPathBoundingBox();this.contentVisible&&o!==null&&(this.pendingEOFill?(i.fill(t,"evenodd"),this.pendingEOFill=!1):i.fill(t)),r&&i.restore(),e&&this.consumePath(t,o)}eoFill(t){this.pendingEOFill=!0,this.fill(t)}fillStroke(t){this.fill(t,!1),this.stroke(t,!1),this.consumePath(t)}eoFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}closeFillStroke(t){this.fillStroke(t)}closeEOFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}endPath(t){this.consumePath(t)}rawFillPath(t){this.ctx.fill(t)}clip(){this.pendingClip=tS}eoClip(){this.pendingClip=z0}beginText(){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(t===void 0)return;const i=new Path2D,s=e.getTransform().invertSelf();for(const{transform:n,x:r,y:o,fontSize:l,path:c}of t)c&&i.addPath(c,new DOMMatrix(n).preMultiplySelf(s).translate(r,o).scale(l,-l));e.clip(i),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){var u;const i=this.commonObjs.get(t),s=this.current;if(!i)throw new Error("Can't find font for ".concat(t));if(s.fontMatrix=i.fontMatrix||zg,(s.fontMatrix[0]===0||s.fontMatrix[3]===0)&&it("Invalid font matrix for font "+t),e<0?(e=-e,s.fontDirection=-1):s.fontDirection=1,this.current.font=i,this.current.fontSize=e,i.isType3Font)return;const n=i.loadedName||"sans-serif",r=((u=i.systemFontInfo)==null?void 0:u.css)||'"'.concat(n,'", ').concat(i.fallbackName);let o="normal";i.black?o="900":i.bold&&(o="bold");const l=i.italic?"italic":"normal";let c=e;e<B0?c=B0:e>j0&&(c=j0),this.current.fontSizeScale=e/c,this.ctx.font="".concat(l," ").concat(o," ").concat(c,"px ").concat(r)}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t){const{current:e}=this;e.textMatrix=t,e.textMatrixScale=Math.hypot(t[0],t[1]),e.x=e.lineX=0,e.y=e.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,s,n){const r=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,u=o.fontSize/o.fontSizeScale,d=c&Fe.FILL_STROKE_MASK,f=!!(c&Fe.ADD_TO_PATH_FLAG),g=o.patternFill&&!l.missingFile,v=o.patternStroke&&!l.missingFile;let y;if((l.disableFontFace||f||g||v)&&!l.missingFile&&(y=l.getPathGenerator(this.commonObjs,t)),y&&(l.disableFontFace||g||v)){r.save(),r.translate(e,i),r.scale(u,-u);let w;if((d===Fe.FILL||d===Fe.FILL_STROKE)&&(s?(w=r.getTransform(),r.setTransform(...s),r.fill(m(this,as,wm).call(this,y,w,s))):r.fill(y)),d===Fe.STROKE||d===Fe.FILL_STROKE)if(n){w||(w=r.getTransform()),r.setTransform(...n);const{a:A,b:S,c:E,d:x}=w,C=Q.inverseTransform(n),P=Q.transform([A,S,E,x,0,0],C);Q.singularValueDecompose2dScale(P,Ai),r.lineWidth*=Math.max(Ai[0],Ai[1])/u,r.stroke(m(this,as,wm).call(this,y,w,n))}else r.lineWidth/=u,r.stroke(y);r.restore()}else(d===Fe.FILL||d===Fe.FILL_STROKE)&&r.fillText(t,e,i),(d===Fe.STROKE||d===Fe.FILL_STROKE)&&r.strokeText(t,e,i);f&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Vt(r),x:e,y:i,fontSize:u,path:y})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let s=3;s<e.length;s+=4)if(e[s]>0&&e[s]<255){i=!0;break}return ct(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const s=e.fontSize;if(s===0)return;const n=this.ctx,r=e.fontSizeScale,o=e.charSpacing,l=e.wordSpacing,c=e.fontDirection,u=e.textHScale*c,d=t.length,f=i.vertical,g=f?1:-1,v=i.defaultVMetrics,y=s*e.fontMatrix[0],w=e.textRenderingMode===Fe.FILL&&!i.disableFontFace&&!e.patternFill;n.save(),e.textMatrix&&n.transform(...e.textMatrix),n.translate(e.x,e.y+e.textRise),c>0?n.scale(u,-1):n.scale(u,1);let A,S;if(e.patternFill){n.save();const F=e.fillColor.getPattern(n,this,ls(n),xe.FILL);A=Vt(n),n.restore(),n.fillStyle=F}if(e.patternStroke){n.save();const F=e.strokeColor.getPattern(n,this,ls(n),xe.STROKE);S=Vt(n),n.restore(),n.strokeStyle=F}let E=e.lineWidth;const x=e.textMatrixScale;if(x===0||E===0){const F=e.textRenderingMode&Fe.FILL_STROKE_MASK;(F===Fe.STROKE||F===Fe.FILL_STROKE)&&(E=this.getSinglePixelWidth())}else E/=x;if(r!==1&&(n.scale(r,r),E/=r),n.lineWidth=E,i.isInvalidPDFjsFont){const F=[];let I=0;for(const T of t)F.push(T.unicode),I+=T.width;n.fillText(F.join(""),0,0),e.x+=I*y*u,n.restore(),this.compose();return}let C=0,P;for(P=0;P<d;++P){const F=t[P];if(typeof F=="number"){C+=g*F*s/1e3;continue}let I=!1;const T=(F.isSpace?l:0)+o,R=F.fontChar,_=F.accent;let j,k,U=F.width;if(f){const B=F.vmetric||v,L=-(F.vmetric?B[1]:U*.5)*y,et=B[2]*y;U=B?-B[0]:U,j=L/r,k=(C+et)/r}else j=C/r,k=0;if(i.remeasure&&U>0){const B=n.measureText(R).width*1e3/s*r;if(U<B&&this.isFontSubpixelAAEnabled){const L=U/B;I=!0,n.save(),n.scale(L,1),j/=L}else U!==B&&(j+=(U-B)/2e3*s/r)}if(this.contentVisible&&(F.isInFont||i.missingFile)){if(w&&!_)n.fillText(R,j,k);else if(this.paintChar(R,j,k,A,S),_){const B=j+s*_.offset.x/r,L=k-s*_.offset.y/r;this.paintChar(_.fontChar,B,L,A,S)}}const ft=f?U*y-T*c:U*y+T*c;C+=ft,I&&n.restore()}f?e.y-=C:e.x+=C*u,n.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,s=i.font,n=i.fontSize,r=i.fontDirection,o=s.vertical?1:-1,l=i.charSpacing,c=i.wordSpacing,u=i.textHScale*r,d=i.fontMatrix||zg,f=t.length,g=i.textRenderingMode===Fe.INVISIBLE;let v,y,w,A;if(!(g||n===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),i.textMatrix&&e.transform(...i.textMatrix),e.translate(i.x,i.y+i.textRise),e.scale(u,r),v=0;v<f;++v){if(y=t[v],typeof y=="number"){A=o*y*n/1e3,this.ctx.translate(A,0),i.x+=A*u;continue}const S=(y.isSpace?c:0)+l,E=s.charProcOperatorList[y.operatorListId];E?this.contentVisible&&(this.save(),e.scale(n,n),e.transform(...d),this.executeOperatorList(E),this.restore()):it('Type3 character "'.concat(y.operatorListId,'" is not available.'));const x=[y.width,0];Q.applyTransform(x,d),w=x[0]*n+S,e.translate(w,0),i.x+=w*u}e.restore()}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,s,n,r){const o=new Path2D;o.rect(i,s,n-i,r-s),this.ctx.clip(o),this.endPath()}getColorN_Pattern(t){let e;if(t[0]==="TilingPattern"){const i=this.baseTransform||Vt(this.ctx),s={createCanvasGraphics:n=>new E0(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new vm(t,this.ctx,s,i)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t){this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t){this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=XE(this.getObject(t)),this.cachedPatterns.set(t,i)),e&&(i.matrix=e),i}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,ls(e),xe.SHADING);const s=ls(e);if(s){const{width:n,height:r}=e.canvas,o=ul.slice();Q.axialAlignedBoundingBox([0,0,n,r],s,o);const[l,c,u,d]=o;this.ctx.fillRect(l,c,u-l,d-c)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Pt("Should not call beginInlineImage")}beginImageData(){Pt("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=Vt(this.ctx),e)){Q.axialAlignedBoundingBox(e,this.baseTransform,this.current.minMax);const[i,s,n,r]=e,o=new Path2D;o.rect(i,s,n-i,r-s),this.ctx.clip(o),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||dg("TODO: Support non-isolated groups."),t.knockout&&it("Knockout groups not supported.");const i=Vt(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let s=ul.slice();Q.axialAlignedBoundingBox(t.bbox,Vt(e),s);const n=[0,0,e.canvas.width,e.canvas.height];s=Q.intersect(s,n)||[0,0,0,0];const r=Math.floor(s[0]),o=Math.floor(s[1]),l=Math.max(Math.ceil(s[2])-r,1),c=Math.max(Math.ceil(s[3])-o,1);this.current.startNewPathAndClipBox([0,0,l,c]);let u="groupAt"+this.groupLevel;t.smask&&(u+="_smask_"+this.smaskCounter++%2);const d=this.cachedCanvases.getCanvas(u,l,c),f=d.context;f.translate(-r,-o),f.transform(...i);let g=new Path2D;const[v,y,w,A]=t.bbox;if(g.rect(v,y,w-v,A-y),t.matrix){const S=new Path2D;S.addPath(g,new DOMMatrix(t.matrix)),g=S}f.clip(g),t.smask?this.smaskStack.push({canvas:d.canvas,context:f,offsetX:r,offsetY:o,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(r,o),e.save()),ec(e,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const s=Vt(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...s);const n=ul.slice();Q.axialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],s,n),this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(t,e,i,s,n){if(m(this,as,bm).call(this),xf(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const r=e[2]-e[0],o=e[3]-e[1];if(n&&this.annotationCanvasMap){i=i.slice(),i[4]-=e[0],i[5]-=e[1],e=e.slice(),e[0]=e[1]=0,e[2]=r,e[3]=o,Q.singularValueDecompose2dScale(Vt(this.ctx),Ai);const{viewportScale:l}=this,c=Math.ceil(r*this.outputScaleX*l),u=Math.ceil(o*this.outputScaleY*l);this.annotationCanvas=this.canvasFactory.create(c,u);const{canvas:d,context:f}=this.annotationCanvas;this.annotationCanvasMap.set(t,d),this.annotationCanvas.savedCtx=this.ctx,this.ctx=f,this.ctx.save(),this.ctx.setTransform(Ai[0],0,0,-Ai[1],0,o*Ai[1]),xf(this.ctx)}else{xf(this.ctx),this.endPath();const l=new Path2D;l.rect(e[0],e[1],r,o),this.ctx.clip(l)}}this.current=new H0(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...s)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),m(this,as,ym).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;t=this.getObject(t.data,t),t.count=e;const i=this.ctx,s=this._createMaskCanvas(t),n=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(n,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i=0,s=0,n,r){if(!this.contentVisible)return;t=this.getObject(t.data,t);const o=this.ctx;o.save();const l=Vt(o);o.transform(e,i,s,n,0,0);const c=this._createMaskCanvas(t);o.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]);for(let u=0,d=r.length;u<d;u+=2){const f=Q.transform(l,[e,i,s,n,r[u],r[u+1]]);o.drawImage(c.canvas,f[4],f[5])}o.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,s=this.current.patternFill;for(const n of t){const{data:r,width:o,height:l,transform:c}=n,u=this.cachedCanvases.getCanvas("maskCanvas",o,l),d=u.context;d.save();const f=this.getObject(r,n);U0(d,f),d.globalCompositeOperation="source-in",d.fillStyle=s?i.getPattern(d,this,ls(e),xe.FILL):i,d.fillRect(0,0,o,l),d.restore(),e.save(),e.transform(...c),e.scale(1,-1),Sf(e,u.canvas,0,0,o,l,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);if(!e){it("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e)}paintImageXObjectRepeat(t,e,i,s){if(!this.contentVisible)return;const n=this.getObject(t);if(!n){it("Dependent image isn't ready yet");return}const r=n.width,o=n.height,l=[];for(let c=0,u=s.length;c<u;c+=2)l.push({transform:[e,0,0,i,s[c],s[c+1]],x:0,y:0,w:r,h:o});this.paintInlineImageXObjectGroup(n,l)}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:i,height:s}=t,n=this.cachedCanvases.getCanvas("inlineImage",i,s),r=n.context;return r.filter=this.current.transferMaps,r.drawImage(e,0,0),r.filter="none",n.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,s=this.ctx;this.save();const{filter:n}=s;n!=="none"&&n!==""&&(s.filter="none"),s.scale(1/e,-1/i);let r;if(t.bitmap)r=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)r=t;else{const c=this.cachedCanvases.getCanvas("inlineImage",e,i).context;$0(c,t),r=this.applyTransferMapsToCanvas(c)}const o=this._scaleImage(r,ls(s));s.imageSmoothingEnabled=W0(Vt(s),t.interpolate),Sf(s,o.img,0,0,o.paintWidth,o.paintHeight,0,-i,e,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx;let s;if(t.bitmap)s=t.bitmap;else{const n=t.width,r=t.height,l=this.cachedCanvases.getCanvas("inlineImage",n,r).context;$0(l,t),s=this.applyTransferMapsToCanvas(l)}for(const n of e)i.save(),i.transform(...n.transform),i.scale(1,-1),Sf(i,s,n.x,n.y,n.w,n.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t,e){const i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const s=this.ctx;this.pendingClip&&(i||(this.pendingClip===z0?s.clip(t,"evenodd"):s.clip(t)),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Vt(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]),i=Math.hypot(t[0],t[2]),s=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,s)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:e,b:i,c:s,d:n}=this.ctx.getTransform();let r,o;if(i===0&&s===0){const l=Math.abs(e),c=Math.abs(n);if(l===c)if(t===0)r=o=1/l;else{const u=l*t;r=o=u<1?1/u:1}else if(t===0)r=1/l,o=1/c;else{const u=l*t,d=c*t;r=u<1?1/u:1,o=d<1?1/d:1}}else{const l=Math.abs(e*n-i*s),c=Math.hypot(e,i),u=Math.hypot(s,n);if(t===0)r=u/l,o=c/l;else{const d=t*l;r=u>d?u/d:1,o=c>d?c/d:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:i,current:{lineWidth:s}}=this,[n,r]=this.getScaleForStroking();if(n===r){i.lineWidth=(s||1)*n,i.stroke(t);return}const o=i.getLineDash();e&&i.save(),i.scale(n,r),Tg.a=1/n,Tg.d=1/r;const l=new Path2D;if(l.addPath(t,Tg),o.length>0){const c=Math.max(n,r);i.setLineDash(o.map(u=>u/c)),i.lineDashOffset/=c}i.lineWidth=s||1,i.stroke(l),e&&i.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};as=new WeakSet,bm=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)},ym=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}}},wm=function(t,e,i){const s=new Path2D;return s.addPath(t,new DOMMatrix(i).invertSelf().multiplySelf(e)),s};let pl=E0;for(const h in Ip)pl.prototype[h]!==void 0&&(pl.prototype[Ip[h]]=pl.prototype[h]);var Lf,xu,Cu;let Zn=(Lf=class{static get workerPort(){return a(this,xu)}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");p(this,xu,t)}static get workerSrc(){return a(this,Cu)}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");p(this,Cu,t)}},xu=new WeakMap,Cu=new WeakMap,b(Lf,xu,null),b(Lf,Cu,""),Lf);var Vl,Pu;class eS{constructor({parsedData:t,rawData:e}){b(this,Vl);b(this,Pu);p(this,Vl,t),p(this,Pu,e)}getRaw(){return a(this,Pu)}get(t){var e;return(e=a(this,Vl).get(t))!=null?e:null}[Symbol.iterator](){return a(this,Vl).entries()}}Vl=new WeakMap,Pu=new WeakMap;const el=Symbol("INTERNAL");var Tu,Fu,Iu,Hl;class iS{constructor(t,{name:e,intent:i,usage:s,rbGroups:n}){b(this,Tu,!1);b(this,Fu,!1);b(this,Iu,!1);b(this,Hl,!0);p(this,Tu,!!(t&yi.DISPLAY)),p(this,Fu,!!(t&yi.PRINT)),this.name=e,this.intent=i,this.usage=s,this.rbGroups=n}get visible(){if(a(this,Iu))return a(this,Hl);if(!a(this,Hl))return!1;const{print:t,view:e}=this.usage;return a(this,Tu)?(e==null?void 0:e.viewState)!=="OFF":a(this,Fu)?(t==null?void 0:t.printState)!=="OFF":!0}_setVisible(t,e,i=!1){t!==el&&Pt("Internal method `_setVisible` called."),p(this,Iu,i),p(this,Hl,e)}}Tu=new WeakMap,Fu=new WeakMap,Iu=new WeakMap,Hl=new WeakMap;var pr,xt,$l,Ul,Ru,Am;class sS{constructor(t,e=yi.DISPLAY){b(this,Ru);b(this,pr,null);b(this,xt,new Map);b(this,$l,null);b(this,Ul,null);if(this.renderingIntent=e,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,p(this,Ul,t.order);for(const i of t.groups)a(this,xt).set(i.id,new iS(e,i));if(t.baseState==="OFF")for(const i of a(this,xt).values())i._setVisible(el,!1);for(const i of t.on)a(this,xt).get(i)._setVisible(el,!0);for(const i of t.off)a(this,xt).get(i)._setVisible(el,!1);p(this,$l,this.getHash())}}isVisible(t){if(a(this,xt).size===0)return!0;if(!t)return dg("Optional content group not defined."),!0;if(t.type==="OCG")return a(this,xt).has(t.id)?a(this,xt).get(t.id).visible:(it("Optional content group not found: ".concat(t.id)),!0);if(t.type==="OCMD"){if(t.expression)return m(this,Ru,Am).call(this,t.expression);if(!t.policy||t.policy==="AnyOn"){for(const e of t.ids){if(!a(this,xt).has(e))return it("Optional content group not found: ".concat(e)),!0;if(a(this,xt).get(e).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const e of t.ids){if(!a(this,xt).has(e))return it("Optional content group not found: ".concat(e)),!0;if(!a(this,xt).get(e).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const e of t.ids){if(!a(this,xt).has(e))return it("Optional content group not found: ".concat(e)),!0;if(!a(this,xt).get(e).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const e of t.ids){if(!a(this,xt).has(e))return it("Optional content group not found: ".concat(e)),!0;if(a(this,xt).get(e).visible)return!1}return!0}return it("Unknown optional content policy ".concat(t.policy,".")),!0}return it("Unknown group type ".concat(t.type,".")),!0}setVisibility(t,e=!0,i=!0){var n;const s=a(this,xt).get(t);if(!s){it("Optional content group not found: ".concat(t));return}if(i&&e&&s.rbGroups.length)for(const r of s.rbGroups)for(const o of r)o!==t&&((n=a(this,xt).get(o))==null||n._setVisible(el,!1,!0));s._setVisible(el,!!e,!0),p(this,pr,null)}setOCGState({state:t,preserveRB:e}){let i;for(const s of t){switch(s){case"ON":case"OFF":case"Toggle":i=s;continue}const n=a(this,xt).get(s);if(n)switch(i){case"ON":this.setVisibility(s,!0,e);break;case"OFF":this.setVisibility(s,!1,e);break;case"Toggle":this.setVisibility(s,!n.visible,e);break}}p(this,pr,null)}get hasInitialVisibility(){return a(this,$l)===null||this.getHash()===a(this,$l)}getOrder(){return a(this,xt).size?a(this,Ul)?a(this,Ul).slice():[...a(this,xt).keys()]:null}getGroup(t){return a(this,xt).get(t)||null}getHash(){if(a(this,pr)!==null)return a(this,pr);const t=new Yy;for(const[e,i]of a(this,xt))t.update("".concat(e,":").concat(i.visible));return p(this,pr,t.hexdigest())}[Symbol.iterator](){return a(this,xt).entries()}}pr=new WeakMap,xt=new WeakMap,$l=new WeakMap,Ul=new WeakMap,Ru=new WeakSet,Am=function(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let s=1;s<e;s++){const n=t[s];let r;if(Array.isArray(n))r=m(this,Ru,Am).call(this,n);else if(a(this,xt).has(n))r=a(this,xt).get(n).visible;else return it("Optional content group not found: ".concat(n)),!0;switch(i){case"And":if(!r)return!1;break;case"Or":if(r)return!0;break;case"Not":return!r;default:return!0}}return i==="And"};class nS{constructor(t,{disableRange:e=!1,disableStream:i=!1}){Jt(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:n,progressiveDone:r,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=r,this._contentDispositionFilename=o,(n==null?void 0:n.length)>0){const l=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!e,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),t.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),t.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:e}){const i=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{const s=this._rangeReaders.some(function(n){return n._begin!==t?!1:(n._enqueue(i),!0)});Jt(s,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t,e;return(e=(t=this._fullRequestReader)==null?void 0:t._loaded)!=null?e:0}_onProgress(t){var e,i,s,n;t.total===void 0?(i=(e=this._rangeReaders[0])==null?void 0:e.onProgress)==null||i.call(e,{loaded:t.loaded}):(n=(s=this._fullRequestReader)==null?void 0:s.onProgress)==null||n.call(s,{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(){Jt(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new rS(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new aS(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class rS{constructor(t,e,i=!1,s=null){this._stream=t,this._done=i||!1,this._filename=a0(s)?s:null,this._queuedChunks=e||[],this._loaded=0;for(const n of this._queuedChunks)this._loaded+=n.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 aS{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const i of this._requests)i.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 oS(h){let t=!0,e=i("filename\\*","i").exec(h);if(e){e=e[1];let u=o(e);return u=unescape(u),u=l(u),u=c(u),n(u)}if(e=r(h),e){const u=c(e);return n(u)}if(e=i("filename","i").exec(h),e){e=e[1];let u=o(e);return u=c(u),n(u)}function i(u,d){return new RegExp("(?:^|;)\\s*"+u+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function s(u,d){if(u){if(!/^[\x00-\xFF]+$/.test(d))return d;try{const f=new TextDecoder(u,{fatal:!0}),g=df(d);d=f.decode(g),t=!1}catch(f){}}return d}function n(u){return t&&/[\x80-\xff]/.test(u)&&(u=s("utf-8",u),t&&(u=s("iso-8859-1",u))),u}function r(u){const d=[];let f;const g=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=g.exec(u))!==null;){let[,y,w,A]=f;if(y=parseInt(y,10),y in d){if(y===0)break;continue}d[y]=[w,A]}const v=[];for(let y=0;y<d.length&&y in d;++y){let[w,A]=d[y];A=o(A),w&&(A=unescape(A),y===0&&(A=l(A))),v.push(A)}return v.join("")}function o(u){if(u.startsWith('"')){const d=u.slice(1).split('\\"');for(let f=0;f<d.length;++f){const g=d[f].indexOf('"');g!==-1&&(d[f]=d[f].slice(0,g),d.length=f+1),d[f]=d[f].replaceAll(/\\(.)/g,"$1")}u=d.join('"')}return u}function l(u){const d=u.indexOf("'");if(d===-1)return u;const f=u.slice(0,d),v=u.slice(d+1).replace(/^[^']*'/,"");return s(f,v)}function c(u){return!u.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(u)?u:u.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,f,g,v){if(g==="q"||g==="Q")return v=v.replaceAll("_"," "),v=v.replaceAll(/=([0-9a-fA-F]{2})/g,function(y,w){return String.fromCharCode(parseInt(w,16))}),s(f,v);try{v=atob(v)}catch(y){}return s(f,v)})}return""}function aw(h,t){const e=new Headers;if(!h||!t||typeof t!="object")return e;for(const i in t){const s=t[i];s!==void 0&&e.append(i,s)}return e}function gg(h){var t,e;return(e=(t=URL.parse(h))==null?void 0:t.origin)!=null?e:null}function ow({responseHeaders:h,isHttp:t,rangeChunkSize:e,disableRange:i}){const s={allowRangeRequests:!1,suggestedLength:void 0},n=parseInt(h.get("Content-Length"),10);return!Number.isInteger(n)||(s.suggestedLength=n,n<=2*e)||i||!t||h.get("Accept-Ranges")!=="bytes"||(h.get("Content-Encoding")||"identity")!=="identity"||(s.allowRangeRequests=!0),s}function lw(h){const t=h.get("Content-Disposition");if(t){let e=oS(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch(i){}if(a0(e))return e}return null}function mf(h,t){return new Rp("Unexpected server response (".concat(h,') while retrieving PDF "').concat(t,'".'),h,h===404||h===0&&t.startsWith("file:"))}function hw(h){return h===200||h===206}function cw(h,t,e){return{method:"GET",headers:h,signal:e.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function uw(h){return h instanceof Uint8Array?h.buffer:h instanceof ArrayBuffer?h:(it("getArrayBuffer - unexpected data format: ".concat(h)),new Uint8Array(h).buffer)}class lS{constructor(t){M(this,"_responseOrigin",null);this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=aw(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return(e=(t=this._fullRequestReader)==null?void 0:t._loaded)!=null?e:0}getFullReader(){return Jt(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new hS(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new cS(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class hS{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 i=new Headers(t.headers),s=e.url;fetch(s,cw(i,this._withCredentials,this._abortController)).then(n=>{if(t._responseOrigin=gg(n.url),!hw(n.status))throw mf(n.status,s);this._reader=n.body.getReader(),this._headersCapability.resolve();const r=n.headers,{allowRangeRequests:o,suggestedLength:l}=ow({responseHeaders:r,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=l||this._contentLength,this._filename=lw(r),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new ra("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 i;await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded,total:this._contentLength}),{value:uw(t),done:!1})}cancel(t){var e;(e=this._reader)==null||e.cancel(t),this._abortController.abort()}}class cS{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const s=t.source;this._withCredentials=s.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!s.disableStream,this._abortController=new AbortController;const n=new Headers(t.headers);n.append("Range","bytes=".concat(e,"-").concat(i-1));const r=s.url;fetch(r,cw(n,this._withCredentials,this._abortController)).then(o=>{const l=gg(o.url);if(l!==t._responseOrigin)throw new Error('Expected range response-origin "'.concat(l,'" to match "').concat(t._responseOrigin,'".'));if(!hw(o.status))throw mf(o.status,r);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded}),{value:uw(t),done:!1})}cancel(t){var e;(e=this._reader)==null||e.cancel(t),this._abortController.abort()}}const Fg=200,Ig=206;function uS(h){const t=h.response;return typeof t!="string"?t:df(t).buffer}class dS{constructor({url:t,httpHeaders:e,withCredentials:i}){M(this,"_responseOrigin",null);this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=aw(this.isHttp,e),this.withCredentials=i||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,s=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const[n,r]of this.headers)e.setRequestHeader(n,r);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1)),s.expectedStatus=Ig):s.expectedStatus=Fg,e.responseType="arraybuffer",Jt(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>{t.onError(e.status)},e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),s.onHeadersReceived=t.onHeadersReceived,s.onDone=t.onDone,s.onError=t.onError,s.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){var s;const i=this.pendingRequests[t];i&&((s=i.onProgress)==null||s.call(i,e))}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const s=i.xhr;if(s.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),s.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],s.status===0&&this.isHttp){i.onError(s.status);return}const n=s.status||Fg;if(!(n===Fg&&i.expectedStatus===Ig)&&n!==i.expectedStatus){i.onError(s.status);return}const o=uS(s);if(n===Ig){const l=s.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);c?i.onDone({begin:parseInt(c[1],10),chunk:o}):(it('Missing or invalid "Content-Range" header.'),i.onError(0))}else o?i.onDone({begin:0,chunk:o}):i.onError(s.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 fS{constructor(t){this._source=t,this._manager=new dS(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 Jt(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new pS(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new gS(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class pS{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=gg(e.responseURL);const i=e.getAllResponseHeaders(),s=new Headers(i?i.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(o=>{const[l,...c]=o.split(": ");return[l,c.join(": ")]}):[]),{allowRangeRequests:n,suggestedLength:r}=ow({responseHeaders:s,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=r||this._contentLength,this._filename=lw(s),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=mf(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 gS{constructor(t,e,i){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,end:i,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var e;const t=gg((e=this._manager.getRequestXhr(this._requestId))==null?void 0:e.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error('Expected range response-origin "'.concat(t,'" to match "').concat(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 i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){var e;(e=this._storedError)!=null||(this._storedError=mf(t,this._url));for(const i of this._requests)i.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 mS=/^[a-z][a-z0-9\-+.]+:/i;function vS(h){if(mS.test(h))return new URL(h);const t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(h))}class bS{constructor(t){this.source=t,this.url=vS(t.url),Jt(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return(e=(t=this._fullRequestReader)==null?void 0:t._loaded)!=null?e:0}getFullReader(){return Jt(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new yS(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new wS(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class yS{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 i=process.getBuiltinModule("fs");i.promises.lstat(this._url).then(s=>{this._contentLength=s.size,this._setReadableStream(i.createReadStream(this._url)),this._headersCapability.resolve()},s=>{s.code==="ENOENT"&&(s=mf(0,this._url.href)),this._storedError=s,this._headersCapability.reject(s)})}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 i;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,(i=this.onProgress)==null||i.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 ra("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class wS{constructor(t,e,i){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const s=t.source;this._isStreamingSupported=!s.disableStream;const n=process.getBuiltinModule("fs");this._setReadableStream(n.createReadStream(this._url,{start:e,end:i-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;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,(i=this.onProgress)==null||i.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 ic=Symbol("INITIAL_DATA");var ai,_u,Em;class dw{constructor(){b(this,_u);b(this,ai,Object.create(null))}get(t,e=null){if(e){const s=m(this,_u,Em).call(this,t);return s.promise.then(()=>e(s.data)),null}const i=a(this,ai)[t];if(!i||i.data===ic)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}has(t){const e=a(this,ai)[t];return!!e&&e.data!==ic}delete(t){const e=a(this,ai)[t];return!e||e.data===ic?!1:(delete a(this,ai)[t],!0)}resolve(t,e=null){const i=m(this,_u,Em).call(this,t);i.data=e,i.resolve()}clear(){var t;for(const e in a(this,ai)){const{data:i}=a(this,ai)[e];(t=i==null?void 0:i.bitmap)==null||t.close()}p(this,ai,Object.create(null))}*[Symbol.iterator](){for(const t in a(this,ai)){const{data:e}=a(this,ai)[t];e!==ic&&(yield[t,e])}}}ai=new WeakMap,_u=new WeakSet,Em=function(t){var e;return(e=a(this,ai))[t]||(e[t]={...Promise.withResolvers(),data:ic})};const AS=1e5,G0=30;var ey,gr,Ye,Du,Lu,Ga,cn,Mu,Nu,Xa,Wl,zl,mr,Gl,Ou,Xl,Ya,ku,Bu,Ut,Yl,Ka,ju,vr,Kl,Un,fw,pw,xm,Ci,Wf,Cm,gw,mw;let Sm=(Ut=class{constructor({textContentSource:t,container:e,viewport:i}){b(this,Un);b(this,gr,Promise.withResolvers());b(this,Ye,null);b(this,Du,!1);b(this,Lu,!!((ey=globalThis.FontInspector)!=null&&ey.enabled));b(this,Ga,null);b(this,cn,null);b(this,Mu,0);b(this,Nu,0);b(this,Xa,null);b(this,Wl,null);b(this,zl,0);b(this,mr,0);b(this,Gl,Object.create(null));b(this,Ou,[]);b(this,Xl,null);b(this,Ya,[]);b(this,ku,new WeakMap);b(this,Bu,null);var l;if(t instanceof ReadableStream)p(this,Xl,t);else if(typeof t=="object")p(this,Xl,new ReadableStream({start(c){c.enqueue(t),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');p(this,Ye,p(this,Wl,e)),p(this,mr,i.scale*Wo.pixelRatio),p(this,zl,i.rotation),p(this,cn,{div:null,properties:null,ctx:null});const{pageWidth:s,pageHeight:n,pageX:r,pageY:o}=i.rawDims;p(this,Bu,[1,0,0,-1,-r,o+n]),p(this,Nu,s),p(this,Mu,n),m(l=Ut,Ci,gw).call(l),Uo(e,i),a(this,gr).promise.finally(()=>{a(Ut,Kl).delete(this),p(this,cn,null),p(this,Gl,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=Te.platform;return ct(this,"fontFamilyMap",new Map([["sans-serif","".concat(t&&e?"Calibri, ":"","sans-serif")],["monospace","".concat(t&&e?"Lucida Console, ":"","monospace")]]))}render(){const t=()=>{a(this,Xa).read().then(({value:e,done:i})=>{var s;if(i){a(this,gr).resolve();return}(s=a(this,Ga))!=null||p(this,Ga,e.lang),Object.assign(a(this,Gl),e.styles),m(this,Un,fw).call(this,e.items),t()},a(this,gr).reject)};return p(this,Xa,a(this,Xl).getReader()),a(Ut,Kl).add(this),t(),a(this,gr).promise}update({viewport:t,onBefore:e=null}){var n;const i=t.scale*Wo.pixelRatio,s=t.rotation;if(s!==a(this,zl)&&(e==null||e(),p(this,zl,s),Uo(a(this,Wl),{rotation:s})),i!==a(this,mr)){e==null||e(),p(this,mr,i);const r={div:null,properties:null,ctx:m(n=Ut,Ci,Wf).call(n,a(this,Ga))};for(const o of a(this,Ya))r.properties=a(this,ku).get(o),r.div=o,m(this,Un,xm).call(this,r)}}cancel(){var e;const t=new ra("TextLayer task cancelled.");(e=a(this,Xa))==null||e.cancel(t).catch(()=>{}),p(this,Xa,null),a(this,gr).reject(t)}get textDivs(){return a(this,Ya)}get textContentItemsStr(){return a(this,Ou)}static cleanup(){if(!(a(this,Kl).size>0)){a(this,Yl).clear();for(const{canvas:t}of a(this,Ka).values())t.remove();a(this,Ka).clear()}}},gr=new WeakMap,Ye=new WeakMap,Du=new WeakMap,Lu=new WeakMap,Ga=new WeakMap,cn=new WeakMap,Mu=new WeakMap,Nu=new WeakMap,Xa=new WeakMap,Wl=new WeakMap,zl=new WeakMap,mr=new WeakMap,Gl=new WeakMap,Ou=new WeakMap,Xl=new WeakMap,Ya=new WeakMap,ku=new WeakMap,Bu=new WeakMap,Yl=new WeakMap,Ka=new WeakMap,ju=new WeakMap,vr=new WeakMap,Kl=new WeakMap,Un=new WeakSet,fw=function(t){var s,n,r;if(a(this,Du))return;(r=(n=a(this,cn)).ctx)!=null||(n.ctx=m(s=Ut,Ci,Wf).call(s,a(this,Ga)));const e=a(this,Ya),i=a(this,Ou);for(const o of t){if(e.length>AS){it("Ignoring additional textDivs for performance reasons."),p(this,Du,!0);return}if(o.str===void 0){if(o.type==="beginMarkedContentProps"||o.type==="beginMarkedContent"){const l=a(this,Ye);p(this,Ye,document.createElement("span")),a(this,Ye).classList.add("markedContent"),o.id&&a(this,Ye).setAttribute("id","".concat(o.id)),l.append(a(this,Ye))}else o.type==="endMarkedContent"&&p(this,Ye,a(this,Ye).parentNode);continue}i.push(o.str),m(this,Un,pw).call(this,o)}},pw=function(t){var y;const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};a(this,Ya).push(e);const s=Q.transform(a(this,Bu),t.transform);let n=Math.atan2(s[1],s[0]);const r=a(this,Gl)[t.fontName];r.vertical&&(n+=Math.PI/2);let o=a(this,Lu)&&r.fontSubstitution||r.fontFamily;o=Ut.fontFamilyMap.get(o)||o;const l=Math.hypot(s[2],s[3]),c=l*m(y=Ut,Ci,mw).call(y,o,r,a(this,Ga));let u,d;n===0?(u=s[4],d=s[5]-c):(u=s[4]+c*Math.sin(n),d=s[5]-c*Math.cos(n));const f="calc(var(--total-scale-factor) *",g=e.style;a(this,Ye)===a(this,Wl)?(g.left="".concat((100*u/a(this,Nu)).toFixed(2),"%"),g.top="".concat((100*d/a(this,Mu)).toFixed(2),"%")):(g.left="".concat(f).concat(u.toFixed(2),"px)"),g.top="".concat(f).concat(d.toFixed(2),"px)")),g.fontSize="".concat(f).concat((a(Ut,vr)*l).toFixed(2),"px)"),g.fontFamily=o,i.fontSize=l,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,a(this,Lu)&&(e.dataset.fontName=r.fontSubstitutionLoadedName||t.fontName),n!==0&&(i.angle=n*(180/Math.PI));let v=!1;if(t.str.length>1)v=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const w=Math.abs(t.transform[0]),A=Math.abs(t.transform[3]);w!==A&&Math.max(w,A)/Math.min(w,A)>1.5&&(v=!0)}if(v&&(i.canvasWidth=r.vertical?t.height:t.width),a(this,ku).set(e,i),a(this,cn).div=e,a(this,cn).properties=i,m(this,Un,xm).call(this,a(this,cn)),i.hasText&&a(this,Ye).append(e),i.hasEOL){const w=document.createElement("br");w.setAttribute("role","presentation"),a(this,Ye).append(w)}},xm=function(t){var o;const{div:e,properties:i,ctx:s}=t,{style:n}=e;let r="";if(a(Ut,vr)>1&&(r="scale(".concat(1/a(Ut,vr),")")),i.canvasWidth!==0&&i.hasText){const{fontFamily:l}=n,{canvasWidth:c,fontSize:u}=i;m(o=Ut,Ci,Cm).call(o,s,u*a(this,mr),l);const{width:d}=s.measureText(e.textContent);d>0&&(r="scaleX(".concat(c*a(this,mr)/d,") ").concat(r))}i.angle!==0&&(r="rotate(".concat(i.angle,"deg) ").concat(r)),r.length>0&&(n.transform=r)},Ci=new WeakSet,Wf=function(t=null){let e=a(this,Ka).get(t||(t=""));if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),a(this,Ka).set(t,e),a(this,ju).set(e,{size:0,family:""})}return e},Cm=function(t,e,i){const s=a(this,ju).get(t);e===s.size&&i===s.family||(t.font="".concat(e,"px ").concat(i),s.size=e,s.family=i)},gw=function(){if(a(this,vr)!==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,vr,t.getBoundingClientRect().height),t.remove()},mw=function(t,e,i){const s=a(this,Yl).get(t);if(s)return s;const n=m(this,Ci,Wf).call(this,i);n.canvas.width=n.canvas.height=G0,m(this,Ci,Cm).call(this,n,G0,t);const r=n.measureText(""),o=r.fontBoundingBoxAscent,l=Math.abs(r.fontBoundingBoxDescent);n.canvas.width=n.canvas.height=0;let c=.8;return o?c=o/(o+l):(Te.platform.isFirefox&&it("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?c=e.ascent:e.descent&&(c=1+e.descent)),a(this,Yl).set(t,c),c},b(Ut,Ci),b(Ut,Yl,new Map),b(Ut,Ka,new Map),b(Ut,ju,new WeakMap),b(Ut,vr,null),b(Ut,Kl,new Set),Ut);class Gc{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};function s(n){var l;if(!n)return;let r=null;const o=n.name;if(o==="#text")r=n.value;else if(Gc.shouldBuildText(o))(l=n==null?void 0:n.attributes)!=null&&l.textContent?r=n.attributes.textContent:n.value&&(r=n.value);else return;if(r!==null&&e.push({str:r}),!!n.children)for(const c of n.children)s(c)}return s(t),i}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const ES=100;function vw(h={}){var St,tt;typeof h=="string"||h instanceof URL?h={url:h}:(h instanceof ArrayBuffer||ArrayBuffer.isView(h))&&(h={data:h});const t=new Pm,{docId:e}=t,i=h.url?_E(h.url):null,s=h.data?DE(h.data):null,n=h.httpHeaders||null,r=h.withCredentials===!0,o=(St=h.password)!=null?St:null,l=h.range instanceof bw?h.range:null,c=Number.isInteger(h.rangeChunkSize)&&h.rangeChunkSize>0?h.rangeChunkSize:2**16;let u=h.worker instanceof Tm?h.worker:null;const d=h.verbosity,f=typeof h.docBaseUrl=="string"&&!fg(h.docBaseUrl)?h.docBaseUrl:null,g=Af(h.cMapUrl),v=h.cMapPacked!==!1,y=h.CMapReaderFactory||(He?VE:M0),w=Af(h.iccUrl),A=Af(h.standardFontDataUrl),S=h.StandardFontDataFactory||(He?HE:N0),E=Af(h.wasmUrl),x=h.WasmFactory||(He?$E:O0),C=h.stopAtErrors!==!0,P=Number.isInteger(h.maxImageSize)&&h.maxImageSize>-1?h.maxImageSize:-1,F=h.isEvalSupported!==!1,I=typeof h.isOffscreenCanvasSupported=="boolean"?h.isOffscreenCanvasSupported:!He,T=typeof h.isImageDecoderSupported=="boolean"?h.isImageDecoderSupported:!He&&(Te.platform.isFirefox||!globalThis.chrome),R=Number.isInteger(h.canvasMaxAreaInBytes)?h.canvasMaxAreaInBytes:-1,_=typeof h.disableFontFace=="boolean"?h.disableFontFace:He,j=h.fontExtraProperties===!0,k=h.enableXfa===!0,U=h.ownerDocument||globalThis.document,ft=h.disableRange===!0,B=h.disableStream===!0,L=h.disableAutoFetch===!0,et=h.pdfBug===!0,rt=h.CanvasFactory||(He?jE:OE),_t=h.FilterFactory||(He?BE:kE),Xt=h.enableHWA===!0,yt=h.useWasm!==!1,At=l?l.length:(tt=h.length)!=null?tt:NaN,os=typeof h.useSystemFonts=="boolean"?h.useSystemFonts:!He&&!_,ti=typeof h.useWorkerFetch=="boolean"?h.useWorkerFetch:!!(y===M0&&S===N0&&x===O0&&g&&A&&E&&lc(g,document.baseURI)&&lc(A,document.baseURI)&&lc(E,document.baseURI)),z=null;uE(d);const N={canvasFactory:new rt({ownerDocument:U,enableHWA:Xt}),filterFactory:new _t({docId:e,ownerDocument:U}),cMapReaderFactory:ti?null:new y({baseUrl:g,isCompressed:v}),standardFontDataFactory:ti?null:new S({baseUrl:A}),wasmFactory:ti?null:new x({baseUrl:E})};u||(u=Tm.create({verbosity:d,port:Zn.workerPort}),t._worker=u);const H={docId:e,apiVersion:"5.4.54",data:s,password:o,disableAutoFetch:L,rangeChunkSize:c,length:At,docBaseUrl:f,enableXfa:k,evaluatorOptions:{maxImageSize:P,disableFontFace:_,ignoreErrors:C,isEvalSupported:F,isOffscreenCanvasSupported:I,isImageDecoderSupported:T,canvasMaxAreaInBytes:R,fontExtraProperties:j,useSystemFonts:os,useWasm:yt,useWorkerFetch:ti,cMapUrl:g,iccUrl:w,standardFontDataUrl:A,wasmUrl:E}},at={ownerDocument:U,pdfBug:et,styleElement:z,loadingParams:{disableAutoFetch:L,enableXfa:k}};return u.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const Mt=u.messageHandler.sendWithPromise("GetDocRequest",H,s?[s.buffer]:null);let Ft;if(l)Ft=new nS(l,{disableRange:ft,disableStream:B});else if(!s){if(!i)throw new Error("getDocument - no `url` parameter provided.");const ze=lc(i)?lS:He?bS:fS;Ft=new ze({url:i,length:At,httpHeaders:n,withCredentials:r,rangeChunkSize:c,disableRange:ft,disableStream:B})}return Mt.then(ze=>{if(t.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const ae=new fc(e,ze,u.port),Yt=new CS(ae,t,Ft,at,N,Xt);t._transport=Yt,ae.send("Ready",null)})}).catch(t._capability.reject),t}var Zp;const Qp=class Qp{constructor(){M(this,"_capability",Promise.withResolvers());M(this,"_transport",null);M(this,"_worker",null);M(this,"docId","d".concat(ge(Qp,Zp)._++));M(this,"destroyed",!1);M(this,"onPassword",null);M(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var t,e,i,s;this.destroyed=!0;try{(t=this._worker)!=null&&t.port&&(this._worker._pendingDestroy=!0),await((e=this._transport)==null?void 0:e.destroy())}catch(n){throw(i=this._worker)!=null&&i.port&&delete this._worker._pendingDestroy,n}this._transport=null,(s=this._worker)==null||s.destroy(),this._worker=null}async getData(){return this._transport.getData()}};Zp=new WeakMap,b(Qp,Zp,0);let Pm=Qp;var Za,Vu,Hu,$u,Uu,iy;let bw=(iy=class{constructor(t,e,i=!1,s=null){b(this,Za,Promise.withResolvers());b(this,Vu,[]);b(this,Hu,[]);b(this,$u,[]);b(this,Uu,[]);this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=s}addRangeListener(t){a(this,Uu).push(t)}addProgressListener(t){a(this,$u).push(t)}addProgressiveReadListener(t){a(this,Hu).push(t)}addProgressiveDoneListener(t){a(this,Vu).push(t)}onDataRange(t,e){for(const i of a(this,Uu))i(t,e)}onDataProgress(t,e){a(this,Za).promise.then(()=>{for(const i of a(this,$u))i(t,e)})}onDataProgressiveRead(t){a(this,Za).promise.then(()=>{for(const e of a(this,Hu))e(t)})}onDataProgressiveDone(){a(this,Za).promise.then(()=>{for(const t of a(this,Vu))t()})}transportReady(){a(this,Za).resolve()}requestDataRange(t,e){Pt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}},Za=new WeakMap,Vu=new WeakMap,Hu=new WeakMap,$u=new WeakMap,Uu=new WeakMap,iy);class SS{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 ct(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({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 un,Qa,bc;class xS{constructor(t,e,i,s=!1){b(this,Qa);b(this,un,!1);this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=s?new _0:null,this._pdfBug=s,this.commonObjs=i.commonObjs,this.objs=new dw,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:s=0,dontFlip:n=!1}={}){return new pf({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:s,dontFlip:n})}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 ct(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:i,intent:s="display",annotationMode:n=Bs.ENABLE,transform:r=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:c=null,pageColors:u=null,printAnnotationStorage:d=null,isEditing:f=!1}){var C,P;(C=this._stats)==null||C.time("Overall");const g=this._transport.getRenderingIntent(s,n,d,f),{renderingIntent:v,cacheKey:y}=g;p(this,un,!1),l||(l=this._transport.getOptionalContentConfig(v));let w=this._intentStates.get(y);w||(w=Object.create(null),this._intentStates.set(y,w)),w.streamReaderCancelTimeout&&(clearTimeout(w.streamReaderCancelTimeout),w.streamReaderCancelTimeout=null);const A=!!(v&yi.PRINT);w.displayReadyCapability||(w.displayReadyCapability=Promise.withResolvers(),w.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(P=this._stats)==null||P.time("Page Request"),this._pumpOperatorList(g));const S=F=>{var I;w.renderTasks.delete(E),A&&p(this,un,!0),m(this,Qa,bc).call(this),F?(E.capability.reject(F),this._abortOperatorList({intentState:w,reason:F instanceof Error?F:new Error(F)})):E.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(I=globalThis.Stats)!=null&&I.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},E=new Fm({callback:S,params:{canvas:e,canvasContext:t,viewport:i,transform:r,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:w.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!A,pdfBug:this._pdfBug,pageColors:u,enableHWA:this._transport.enableHWA});(w.renderTasks||(w.renderTasks=new Set)).add(E);const x=E.task;return Promise.all([w.displayReadyCapability.promise,l]).then(([F,I])=>{var T;if(this.destroyed){S();return}if((T=this._stats)==null||T.time("Rendering"),!(I.renderingIntent&v))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");E.initializeGraphics({transparency:F,optionalContentConfig:I}),E.operatorListChanged()}).catch(S),x}getOperatorList({intent:t="display",annotationMode:e=Bs.ENABLE,printAnnotationStorage:i=null,isEditing:s=!1}={}){var c;function n(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}const r=this._transport.getRenderingIntent(t,e,i,s,!0);let o=this._intentStates.get(r.cacheKey);o||(o=Object.create(null),this._intentStates.set(r.cacheKey,o));let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=n,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||(o.renderTasks=new Set)).add(l),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(c=this._stats)==null||c.time("Page Request"),this._pumpOperatorList(r)),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(s){return s.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>Gc.textContent(i));const e=this.streamTextContent(t);return new Promise(function(i,s){function n(){r.read().then(function({value:l,done:c}){var u;if(c){i(o);return}(u=o.lang)!=null||(o.lang=l.lang),Object.assign(o.styles,l.styles),o.items.push(...l.items),n()},s)}const r=e.getReader(),o={items:[],styles:Object.create(null),lang:null};n()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),p(this,un,!1),Promise.all(t)}cleanup(t=!1){p(this,un,!0);const e=m(this,Qa,bc).call(this);return t&&e&&this._stats&&(this._stats=new _0),e}_startRenderPage(t,e){var s,n;const i=this._intentStates.get(e);i&&((s=this._stats)==null||s.timeEnd("Page Request"),(n=i.displayReadyCapability)==null||n.resolve(t))}_renderPageChunk(t,e){for(let i=0,s=t.length;i<s;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const i of e.renderTasks)i.operatorListChanged();t.lastChunk&&m(this,Qa,bc).call(this)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:i,modifiedIds:s}){const{map:n,transfer:r}=i,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:n,modifiedIds:s},r).getReader(),c=this._intentStates.get(e);c.streamReader=l;const u=()=>{l.read().then(({value:d,done:f})=>{if(f){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,c),u())},d=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const f of c.renderTasks)f.operatorListChanged();m(this,Qa,bc).call(this)}if(c.displayReadyCapability)c.displayReadyCapability.reject(d);else if(c.opListReadCapability)c.opListReadCapability.reject(d);else throw d}})};u()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(e instanceof tc){let s=ES;e.extraDelay>0&&e.extraDelay<1e3&&(s+=e.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},s);return}}if(t.streamReader.cancel(new ra(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[s,n]of this._intentStates)if(n===t){this._intentStates.delete(s);break}this.cleanup()}}}get stats(){return this._stats}}un=new WeakMap,Qa=new WeakSet,bc=function(){if(!a(this,un)||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,un,!1),!0};var br,Gi,dn,Ja,Tt,Jp,qa,to,Ue,zf,yw,ww,yc,Zl,Gf;let Tm=(Tt=class{constructor({name:t=null,port:e=null,verbosity:i=dE()}={}){b(this,Ue);b(this,br,Promise.withResolvers());b(this,Gi,null);b(this,dn,null);b(this,Ja,null);if(this.name=t,this.destroyed=!1,this.verbosity=i,e){if(a(Tt,to).has(e))throw new Error("Cannot use more than one PDFWorker per port.");a(Tt,to).set(e,this),m(this,Ue,yw).call(this,e)}else m(this,Ue,ww).call(this)}get promise(){return a(this,br).promise}get port(){return a(this,dn)}get messageHandler(){return a(this,Gi)}destroy(){var t,e;this.destroyed=!0,(t=a(this,Ja))==null||t.terminate(),p(this,Ja,null),a(Tt,to).delete(a(this,dn)),p(this,dn,null),(e=a(this,Gi))==null||e.destroy(),p(this,Gi,null)}static create(t){const e=a(this,to).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 Tt(t)}static get workerSrc(){if(Zn.workerSrc)return Zn.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return ct(this,"_setupFakeWorkerGlobal",(async()=>a(this,Zl,Gf)?a(this,Zl,Gf):(await import(this.workerSrc)).WorkerMessageHandler)())}},br=new WeakMap,Gi=new WeakMap,dn=new WeakMap,Ja=new WeakMap,Jp=new WeakMap,qa=new WeakMap,to=new WeakMap,Ue=new WeakSet,zf=function(){a(this,br).resolve(),a(this,Gi).send("configure",{verbosity:this.verbosity})},yw=function(t){p(this,dn,t),p(this,Gi,new fc("main","worker",t)),a(this,Gi).on("ready",()=>{}),m(this,Ue,zf).call(this)},ww=function(){if(a(Tt,qa)||a(Tt,Zl,Gf)){m(this,Ue,yc).call(this);return}let{workerSrc:t}=Tt;try{Tt._isSameOrigin(window.location,t)||(t=Tt._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new fc("main","worker",e),s=()=>{n.abort(),i.destroy(),e.terminate(),this.destroyed?a(this,br).reject(new Error("Worker was destroyed")):m(this,Ue,yc).call(this)},n=new AbortController;e.addEventListener("error",()=>{a(this,Ja)||s()},{signal:n.signal}),i.on("test",o=>{if(n.abort(),this.destroyed||!o){s();return}p(this,Gi,i),p(this,dn,e),p(this,Ja,e),m(this,Ue,zf).call(this)}),i.on("ready",o=>{if(n.abort(),this.destroyed){s();return}try{r()}catch(l){m(this,Ue,yc).call(this)}});const r=()=>{const o=new Uint8Array;i.send("test",o,[o.buffer])};r();return}catch(e){dg("The worker has been disabled.")}m(this,Ue,yc).call(this)},yc=function(){a(Tt,qa)||(it("Setting up fake worker."),p(Tt,qa,!0)),Tt._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){a(this,br).reject(new Error("Worker was destroyed"));return}const e=new NE;p(this,dn,e);const i="fake".concat(ge(Tt,Jp)._++),s=new fc(i+"_worker",i,e);t.setup(s,e),p(this,Gi,new fc(i,i+"_worker",e)),m(this,Ue,zf).call(this)}).catch(t=>{a(this,br).reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))})},Zl=new WeakSet,Gf=function(){var t;try{return((t=globalThis.pdfjsWorker)==null?void 0:t.WorkerMessageHandler)||null}catch(e){return null}},b(Tt,Zl),b(Tt,Jp,0),b(Tt,qa,!1),b(Tt,to,new WeakMap),He&&(p(Tt,qa,!0),Zn.workerSrc||(Zn.workerSrc="./pdf.worker.mjs")),Tt._isSameOrigin=(t,e)=>{const i=URL.parse(t);if(!(i!=null&&i.origin)||i.origin==="null")return!1;const s=new URL(e,i);return i.origin===s.origin},Tt._createCDNWrapper=t=>{const e='await import("'.concat(t,'");');return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},Tt.fromPort=t=>{if(SE("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!(t!=null&&t.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return Tt.create(t)},Tt);var fn,Ss,Ql,Jl,pn,eo,wc;class CS{constructor(t,e,i,s,n,r){b(this,eo);b(this,fn,new Map);b(this,Ss,new Map);b(this,Ql,new Map);b(this,Jl,new Map);b(this,pn,null);this.messageHandler=t,this.loadingTask=e,this.commonObjs=new dw,this.fontLoader=new IE({ownerDocument:s.ownerDocument,styleElement:s.styleElement}),this.loadingParams=s.loadingParams,this._params=s,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.cMapReaderFactory=n.cMapReaderFactory,this.standardFontDataFactory=n.standardFontDataFactory,this.wasmFactory=n.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=r,this.setupMessageHandler()}get annotationStorage(){return ct(this,"annotationStorage",new o0)}getRenderingIntent(t,e=Bs.ENABLE,i=null,s=!1,n=!1){let r=yi.DISPLAY,o=dm;switch(t){case"any":r=yi.ANY;break;case"display":break;case"print":r=yi.PRINT;break;default:it("getRenderingIntent - invalid intent: ".concat(t))}const l=r&yi.PRINT&&i instanceof Zy?i:this.annotationStorage;switch(e){case Bs.DISABLE:r+=yi.ANNOTATIONS_DISABLE;break;case Bs.ENABLE:break;case Bs.ENABLE_FORMS:r+=yi.ANNOTATIONS_FORMS;break;case Bs.ENABLE_STORAGE:r+=yi.ANNOTATIONS_STORAGE,o=l.serializable;break;default:it("getRenderingIntent - invalid annotationMode: ".concat(e))}s&&(r+=yi.IS_EDITING),n&&(r+=yi.OPLIST);const{ids:c,hash:u}=l.modifiedIds,d=[r,o.hash,u];return{renderingIntent:r,cacheKey:d.join("_"),annotationStorageSerializable:o,modifiedIds:c}}destroy(){var i;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(i=a(this,pn))==null||i.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const s of a(this,Ss).values())t.push(s._destroy());a(this,Ss).clear(),a(this,Ql).clear(),a(this,Jl).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{var s,n;this.commonObjs.clear(),this.fontLoader.clear(),a(this,fn).clear(),this.filterFactory.destroy(),Sm.cleanup(),(s=this._networkStream)==null||s.cancelAllRequests(new ra("Worker was terminated.")),(n=this.messageHandler)==null||n.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(i,s)=>{Jt(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=n=>{this._lastProgress={loaded:n.loaded,total:n.total}},s.onPull=()=>{this._fullReader.read().then(function({value:n,done:r}){if(r){s.close();return}Jt(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(n),1,[n])}).catch(n=>{s.error(n)})},s.onCancel=n=>{this._fullReader.cancel(n),s.ready.catch(r=>{if(!this.destroyed)throw r})}}),t.on("ReaderHeadersReady",async i=>{var o;await this._fullReader.headersReady;const{isStreamingSupported:s,isRangeSupported:n,contentLength:r}=this._fullReader;return(!s||!n)&&(this._lastProgress&&((o=e.onProgress)==null||o.call(e,this._lastProgress)),this._fullReader.onProgress=l=>{var c;(c=e.onProgress)==null||c.call(e,{loaded:l.loaded,total:l.total})}),{isStreamingSupported:s,isRangeSupported:n,contentLength:r}}),t.on("GetRangeReader",(i,s)=>{Jt(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(i.begin,i.end);if(!n){s.close();return}s.onPull=()=>{n.read().then(function({value:r,done:o}){if(o){s.close();return}Jt(r instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(r),1,[r])}).catch(r=>{s.error(r)})},s.onCancel=r=>{n.cancel(r),s.ready.catch(o=>{if(!this.destroyed)throw o})}}),t.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,e._capability.resolve(new SS(i,this))}),t.on("DocException",i=>{e._capability.reject(Ge(i))}),t.on("PasswordRequest",i=>{p(this,pn,Promise.withResolvers());try{if(!e.onPassword)throw Ge(i);const s=n=>{n instanceof Error?a(this,pn).reject(n):a(this,pn).resolve({password:n})};e.onPassword(s,i.code)}catch(s){a(this,pn).reject(s)}return a(this,pn).promise}),t.on("DataLoaded",i=>{var s;(s=e.onProgress)==null||s.call(e,{loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),t.on("StartRenderPage",i=>{if(this.destroyed)return;a(this,Ss).get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),t.on("commonobj",([i,s,n])=>{var r;if(this.destroyed||this.commonObjs.has(i))return null;switch(s){case"Font":if("error"in n){const u=n.error;it("Error during font loading: ".concat(u)),this.commonObjs.resolve(i,u);break}const o=this._params.pdfBug&&((r=globalThis.FontInspector)!=null&&r.enabled)?(u,d)=>globalThis.FontInspector.fontAdded(u,d):null,l=new RE(n,o);this.fontLoader.bind(l).catch(()=>t.sendWithPromise("FontFallback",{id:i})).finally(()=>{!l.fontExtraProperties&&l.data&&(l.data=null),this.commonObjs.resolve(i,l)});break;case"CopyLocalImage":const{imageRef:c}=n;Jt(c,"The imageRef must be defined.");for(const u of a(this,Ss).values())for(const[,d]of u.objs)if((d==null?void 0:d.ref)===c)return d.dataLen?(this.commonObjs.resolve(i,structuredClone(d)),d.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,n);break;default:throw new Error("Got unknown common object type ".concat(s))}return null}),t.on("obj",([i,s,n,r])=>{var l;if(this.destroyed)return;const o=a(this,Ss).get(s);if(!o.objs.has(i)){if(o._intentStates.size===0){(l=r==null?void 0:r.bitmap)==null||l.close();return}switch(n){case"Image":case"Pattern":o.objs.resolve(i,r);break;default:throw new Error("Got unknown object type ".concat(n))}}}),t.on("DocProgress",i=>{var s;this.destroyed||(s=e.onProgress)==null||s.call(e,{loaded:i.loaded,total:i.total})}),t.on("FetchBinaryData",async i=>{if(this.destroyed)throw new Error("Worker was destroyed.");const s=this[i.type];if(!s)throw new Error("".concat(i.type," not initialized, see the `useWorkerFetch` parameter."));return s.fetch(i)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var i,s;this.annotationStorage.size<=0&&it("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=(i=this._fullReader)==null?void 0:i.filename)!=null?s: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,i=a(this,Ql).get(e);if(i)return i;const s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(n=>{if(this.destroyed)throw new Error("Transport destroyed");n.refStr&&a(this,Jl).set(n.refStr,t);const r=new xS(e,n,this,this._params.pdfBug);return a(this,Ss).set(e,r),r});return a(this,Ql).set(e,s),s}getPageIndex(t){return fm(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 m(this,eo,wc).call(this,"GetFieldObjects")}hasJSActions(){return m(this,eo,wc).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)}getDocJSActions(){return m(this,eo,wc).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 m(this,eo,wc).call(this,"GetOptionalContentConfig").then(e=>new sS(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=a(this,fn).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(s=>{var n,r,o,l;return{info:s[0],metadata:s[1]?new eS(s[1]):null,contentDispositionFilename:(r=(n=this._fullReader)==null?void 0:n.filename)!=null?r:null,contentLength:(l=(o=this._fullReader)==null?void 0:o.contentLength)!=null?l:null}});return a(this,fn).set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of a(this,Ss).values())if(!e.cleanup())throw new Error("startCleanup: Page ".concat(e.pageNumber," is currently rendering."));this.commonObjs.clear(),t||this.fontLoader.clear(),a(this,fn).clear(),this.filterFactory.destroy(!0),Sm.cleanup()}}cachedPageNumber(t){var i;if(!fm(t))return null;const e=t.gen===0?"".concat(t.num,"R"):"".concat(t.num,"R").concat(t.gen);return(i=a(this,Jl).get(e))!=null?i:null}}fn=new WeakMap,Ss=new WeakMap,Ql=new WeakMap,Jl=new WeakMap,pn=new WeakMap,eo=new WeakSet,wc=function(t,e=null){const i=a(this,fn).get(t);if(i)return i;const s=this.messageHandler.sendWithPromise(t,e);return a(this,fn).set(t,s),s};var yr;class PS{constructor(t){b(this,yr,null);M(this,"onContinue",null);M(this,"onError",null);p(this,yr,t)}get promise(){return a(this,yr).capability.promise}cancel(t=0){a(this,yr).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=a(this,yr).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=a(this,yr);return t.form||t.canvas&&(e==null?void 0:e.size)>0}}yr=new WeakMap;var wr,io;const Aa=class Aa{constructor({callback:t,params:e,objs:i,commonObjs:s,annotationCanvasMap:n,operatorList:r,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:u=!1,pdfBug:d=!1,pageColors:f=null,enableHWA:g=!1}){b(this,wr,null);this.callback=t,this.params=e,this.objs=i,this.commonObjs=s,this.annotationCanvasMap=n,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=d,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=u===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new PS(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=g}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){var o,l;if(this.cancelled)return;if(this._canvas){if(a(Aa,io).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.");a(Aa,io).add(this._canvas)}this._pdfBug&&((o=globalThis.StepperManager)!=null&&o.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:i,transform:s,background:n}=this.params,r=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new pl(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:i,transparency:t,background:n}),this.operatorListIdx=0,this.graphicsReady=!0,(l=this.graphicsReadyCallback)==null||l.call(this)}cancel(t=null,e=0){var i,s,n;this.running=!1,this.cancelled=!0,(i=this.gfx)==null||i.endDrawing(),a(this,wr)&&(window.cancelAnimationFrame(a(this,wr)),p(this,wr,null)),a(Aa,io).delete(this._canvas),t||(t=new tc("Rendering cancelled, page ".concat(this._pageIndex+1),e)),this.callback(t),(n=(s=this.task).onError)==null||n.call(s,t)}operatorListChanged(){var t;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(t=this.stepper)==null||t.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,wr,window.requestAnimationFrame(()=>{p(this,wr,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.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),a(Aa,io).delete(this._canvas),this.callback())))}};wr=new WeakMap,io=new WeakMap,b(Aa,io,new WeakSet);let Fm=Aa;const TS="5.4.54",FS="295fb3ec4";var oi,so,ql,ie,Wu,th,gn,zu,Ar,Xi,Ee,Gu,Ct,Im,Rm,_m,da,Ew,zn;let Aw=(Ee=class{constructor({editor:t=null,uiManager:e=null}){b(this,Ct);b(this,oi,null);b(this,so,null);b(this,ql);b(this,ie,null);b(this,Wu,!1);b(this,th,!1);b(this,gn,null);b(this,zu);b(this,Ar,null);b(this,Xi,null);var i,s;t?(p(this,th,!1),p(this,gn,t)):p(this,th,!0),p(this,Xi,(t==null?void 0:t._uiManager)||e),p(this,zu,a(this,Xi)._eventBus),p(this,ql,((i=t==null?void 0:t.color)==null?void 0:i.toUpperCase())||((s=a(this,Xi))==null?void 0:s.highlightColors.values().next().value)||"#FFFF98"),a(Ee,Gu)||p(Ee,Gu,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 ct(this,"_keyboardManager",new gf([[["Escape","mac+Escape"],Ee.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Ee.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Ee.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Ee.prototype._moveToPrevious],[["Home","mac+Home"],Ee.prototype._moveToBeginning],[["End","mac+End"],Ee.prototype._moveToEnd]]))}renderButton(){const t=p(this,oi,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",a(this,gn)&&(t.ariaControls="".concat(a(this,gn).id,"_colorpicker_dropdown"));const e=a(this,Xi)._signal;t.addEventListener("click",m(this,Ct,da).bind(this),{signal:e}),t.addEventListener("keydown",m(this,Ct,_m).bind(this),{signal:e});const i=p(this,so,document.createElement("span"));return i.className="swatch",i.ariaHidden="true",i.style.backgroundColor=a(this,ql),t.append(i),t}renderMainDropdown(){const t=p(this,ie,m(this,Ct,Im).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===a(this,oi)){m(this,Ct,da).call(this,t);return}const e=t.target.getAttribute("data-color");e&&m(this,Ct,Rm).call(this,e,t)}_moveToNext(t){var e,i;if(!a(this,Ct,zn)){m(this,Ct,da).call(this,t);return}if(t.target===a(this,oi)){(e=a(this,ie).firstChild)==null||e.focus();return}(i=t.target.nextSibling)==null||i.focus()}_moveToPrevious(t){var e,i;if(t.target===((e=a(this,ie))==null?void 0:e.firstChild)||t.target===a(this,oi)){a(this,Ct,zn)&&this._hideDropdownFromKeyboard();return}a(this,Ct,zn)||m(this,Ct,da).call(this,t),(i=t.target.previousSibling)==null||i.focus()}_moveToBeginning(t){var e;if(!a(this,Ct,zn)){m(this,Ct,da).call(this,t);return}(e=a(this,ie).firstChild)==null||e.focus()}_moveToEnd(t){var e;if(!a(this,Ct,zn)){m(this,Ct,da).call(this,t);return}(e=a(this,ie).lastChild)==null||e.focus()}hideDropdown(){var t,e;(t=a(this,ie))==null||t.classList.add("hidden"),a(this,oi).ariaExpanded="false",(e=a(this,Ar))==null||e.abort(),p(this,Ar,null)}_hideDropdownFromKeyboard(){var t;if(!a(this,th)){if(!a(this,Ct,zn)){(t=a(this,gn))==null||t.unselect();return}this.hideDropdown(),a(this,oi).focus({preventScroll:!0,focusVisible:a(this,Wu)})}}updateColor(t){if(a(this,so)&&(a(this,so).style.backgroundColor=t),!a(this,ie))return;const e=a(this,Xi).highlightColors.values();for(const i of a(this,ie).children)i.ariaSelected=e.next().value===t.toUpperCase()}destroy(){var t,e;(t=a(this,oi))==null||t.remove(),p(this,oi,null),p(this,so,null),(e=a(this,ie))==null||e.remove(),p(this,ie,null)}},oi=new WeakMap,so=new WeakMap,ql=new WeakMap,ie=new WeakMap,Wu=new WeakMap,th=new WeakMap,gn=new WeakMap,zu=new WeakMap,Ar=new WeakMap,Xi=new WeakMap,Gu=new WeakMap,Ct=new WeakSet,Im=function(){const t=document.createElement("div"),e=a(this,Xi)._signal;t.addEventListener("contextmenu",Vi,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),a(this,gn)&&(t.id="".concat(a(this,gn).id,"_colorpicker_dropdown"));for(const[i,s]of a(this,Xi).highlightColors){const n=document.createElement("button");n.tabIndex="0",n.role="option",n.setAttribute("data-color",s),n.title=i,n.setAttribute("data-l10n-id",a(Ee,Gu)[i]);const r=document.createElement("span");n.append(r),r.className="swatch",r.style.backgroundColor=s,n.ariaSelected=s===a(this,ql),n.addEventListener("click",m(this,Ct,Rm).bind(this,s),{signal:e}),t.append(n)}return t.addEventListener("keydown",m(this,Ct,_m).bind(this),{signal:e}),t},Rm=function(t,e){e.stopPropagation(),a(this,zu).dispatch("switchannotationeditorparams",{source:this,type:ut.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)},_m=function(t){Ee._keyboardManager.exec(this,t)},da=function(t){if(a(this,Ct,zn)){this.hideDropdown();return}if(p(this,Wu,t.detail===0),a(this,Ar)||(p(this,Ar,new AbortController),window.addEventListener("pointerdown",m(this,Ct,Ew).bind(this),{signal:a(this,Xi).combinedSignal(a(this,Ar))})),a(this,oi).ariaExpanded="true",a(this,ie)){a(this,ie).classList.remove("hidden");return}const e=p(this,ie,m(this,Ct,Im).call(this));a(this,oi).append(e)},Ew=function(t){var e;(e=a(this,ie))!=null&&e.contains(t.target)||this.hideDropdown()},zn=function(){return a(this,ie)&&!a(this,ie).classList.contains("hidden")},b(Ee,Gu,null),Ee);var xs,Xu,eh,Yu;const Ea=class Ea{constructor(t){b(this,xs,null);b(this,Xu,null);b(this,eh,null);p(this,Xu,t),p(this,eh,t._uiManager),a(Ea,Yu)||p(Ea,Yu,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(a(this,xs))return a(this,xs);const{editorType:t,colorType:e,colorValue:i}=a(this,Xu),s=p(this,xs,document.createElement("input"));return s.type="color",s.value=i||"#000000",s.className="basicColorPicker",s.tabIndex=0,s.setAttribute("data-l10n-id",a(Ea,Yu)[t]),s.addEventListener("input",()=>{a(this,eh).updateParams(e,s.value)},{signal:a(this,eh)._signal}),s}update(t){a(this,xs)&&(a(this,xs).value=t)}destroy(){var t;(t=a(this,xs))==null||t.remove(),p(this,xs,null)}hideDropdown(){}};xs=new WeakMap,Xu=new WeakMap,eh=new WeakMap,Yu=new WeakMap,b(Ea,Yu,null);let Dp=Ea;function X0(h){return Math.floor(Math.max(0,Math.min(1,h))*255).toString(16).padStart(2,"0")}function sc(h){return Math.max(0,Math.min(255,255*h))}class Y0{static CMYK_G([t,e,i,s]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+s)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=sc(t),[t,t,t]}static G_HTML([t]){const e=X0(t);return"#".concat(e).concat(e).concat(e)}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_rgb(t){return t.map(sc)}static RGB_HTML(t){return"#".concat(t.map(X0).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,i,s]){return["RGB",1-Math.min(1,t+s),1-Math.min(1,i+s),1-Math.min(1,e+s)]}static CMYK_rgb([t,e,i,s]){return[sc(1-Math.min(1,t+s)),sc(1-Math.min(1,i+s)),sc(1-Math.min(1,e+s))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,i]){const s=1-t,n=1-e,r=1-i,o=Math.min(s,n,r);return["CMYK",s,n,r,o]}}class IS{create(t,e,i=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const s=this._createSVG("svg:svg");return s.setAttribute("version","1.1"),i||(s.setAttribute("width","".concat(t,"px")),s.setAttribute("height","".concat(e,"px"))),s.setAttribute("preserveAspectRatio","none"),s.setAttribute("viewBox","0 0 ".concat(t," ").concat(e)),s}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Pt("Abstract method `_createSVG` called.")}}let Lp=class extends IS{_createSVG(t){return document.createElementNS($s,t)}},Sw=class{static setupStorage(t,e,i,s,n){const r=s.getValue(e,{value:null});switch(i.name){case"textarea":if(r.value!==null&&(t.textContent=r.value),n==="print")break;t.addEventListener("input",o=>{s.setValue(e,{value:o.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(r.value===i.attributes.xfaOn?t.setAttribute("checked",!0):r.value===i.attributes.xfaOff&&t.removeAttribute("checked"),n==="print")break;t.addEventListener("change",o=>{s.setValue(e,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(r.value!==null&&t.setAttribute("value",r.value),n==="print")break;t.addEventListener("input",o=>{s.setValue(e,{value:o.target.value})})}break;case"select":if(r.value!==null){t.setAttribute("value",r.value);for(const o of i.children)o.attributes.value===r.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}t.addEventListener("input",o=>{const l=o.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;s.setValue(e,{value:c})});break}}static setAttributes({html:t,element:e,storage:i=null,intent:s,linkService:n}){const{attributes:r}=e,o=t instanceof HTMLAnchorElement;r.type==="radio"&&(r.name="".concat(r.name,"-").concat(s));for(const[l,c]of Object.entries(r))if(c!=null)switch(l){case"class":c.length&&t.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",c);break;case"style":Object.assign(t.style,c);break;case"textContent":t.textContent=c;break;default:(!o||l!=="href"&&l!=="newWindow")&&t.setAttribute(l,c)}o&&n.addLinkAttributes(t,r.href,r.newWindow),i&&r.dataId&&this.setupStorage(t,r.dataId,e,i)}static render(t){var d,f;const e=t.annotationStorage,i=t.linkService,s=t.xfaHtml,n=t.intent||"display",r=document.createElement(s.name);s.attributes&&this.setAttributes({html:r,element:s,intent:n,linkService:i});const o=n!=="richText",l=t.div;if(l.append(r),t.viewport){const g="matrix(".concat(t.viewport.transform.join(","),")");l.style.transform=g}o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(s.children.length===0){if(s.value){const g=document.createTextNode(s.value);r.append(g),o&&Gc.shouldBuildText(s.name)&&c.push(g)}return{textDivs:c}}const u=[[s,-1,r]];for(;u.length>0;){const[g,v,y]=u.at(-1);if(v+1===g.children.length){u.pop();continue}const w=g.children[++u.at(-1)[1]];if(w===null)continue;const{name:A}=w;if(A==="#text"){const E=document.createTextNode(w.value);c.push(E),y.append(E);continue}const S=(d=w==null?void 0:w.attributes)!=null&&d.xmlns?document.createElementNS(w.attributes.xmlns,A):document.createElement(A);if(y.append(S),w.attributes&&this.setAttributes({html:S,element:w,storage:e,intent:n,linkService:i}),((f=w.children)==null?void 0:f.length)>0)u.push([w,-1,S]);else if(w.value){const E=document.createTextNode(w.value);o&&Gc.shouldBuildText(A)&&c.push(E),S.append(E)}}for(const g of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))g.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e="matrix(".concat(t.viewport.transform.join(","),")");t.div.style.transform=e,t.div.hidden=!1}};const RS=9,zo=new WeakSet,_S=new Date().getTimezoneOffset()*60*1e3;class K0{static create(t){switch(t.data.annotationType){case Zt.LINK:return new c0(t);case Zt.TEXT:return new DS(t);case Zt.WIDGET:switch(t.data.fieldType){case"Tx":return new LS(t);case"Btn":return t.data.radioButton?new Pw(t):t.data.checkBox?new NS(t):new OS(t);case"Ch":return new kS(t);case"Sig":return new MS(t)}return new Yo(t);case Zt.POPUP:return new Lm(t);case Zt.FREETEXT:return new _w(t);case Zt.LINE:return new jS(t);case Zt.SQUARE:return new VS(t);case Zt.CIRCLE:return new HS(t);case Zt.POLYLINE:return new Dw(t);case Zt.CARET:return new US(t);case Zt.INK:return new u0(t);case Zt.POLYGON:return new $S(t);case Zt.HIGHLIGHT:return new Lw(t);case Zt.UNDERLINE:return new WS(t);case Zt.SQUIGGLY:return new zS(t);case Zt.STRIKEOUT:return new GS(t);case Zt.STAMP:return new Mw(t);case Zt.FILEATTACHMENT:return new XS(t);default:return new Gt(t)}}}var no,ih,mn,Ku,Dm;const S0=class S0{constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:s=!1}={}){b(this,Ku);b(this,no,null);b(this,ih,!1);b(this,mn,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.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),s&&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 S0._hasPopupData(this.data)}updateEdited(t){var n;if(!this.container)return;t.rect&&(a(this,no)||p(this,no,{rect:this.data.rect.slice(0)}));const{rect:e,popup:i}=t;e&&m(this,Ku,Dm).call(this,e);let s=((n=a(this,mn))==null?void 0:n.popup)||this.popup;!s&&(i!=null&&i.text)&&(this._createPopup(i),s=a(this,mn).popup),s&&(s.updateEdited(t),i!=null&&i.deleted&&(s.remove(),p(this,mn,null),this.popup=null))}resetEdited(){var t;a(this,no)&&(m(this,Ku,Dm).call(this,a(this,no).rect),(t=a(this,mn))==null||t.popup.resetEdited(),p(this,no,null))}_createContainer(t){const{data:e,parent:{page:i,viewport:s}}=this,n=document.createElement("section");n.setAttribute("data-annotation-id",e.id),!(this instanceof Yo)&&!(this instanceof c0)&&(n.tabIndex=0);const{style:r}=n;if(r.zIndex=this.parent.zIndex++,e.alternativeText&&(n.title=e.alternativeText),e.noRotate&&n.classList.add("norotate"),!e.rect||this instanceof Lm){const{rotation:y}=e;return!e.hasOwnCanvas&&y!==0&&this.setRotation(y,n),n}const{width:o,height:l}=this;if(!t&&e.borderStyle.width>0){r.borderWidth="".concat(e.borderStyle.width,"px");const y=e.borderStyle.horizontalCornerRadius,w=e.borderStyle.verticalCornerRadius;if(y>0||w>0){const S="calc(".concat(y,"px * var(--total-scale-factor)) / calc(").concat(w,"px * var(--total-scale-factor))");r.borderRadius=S}else if(this instanceof Pw){const S="calc(".concat(o,"px * var(--total-scale-factor)) / calc(").concat(l,"px * var(--total-scale-factor))");r.borderRadius=S}switch(e.borderStyle.style){case Zo.SOLID:r.borderStyle="solid";break;case Zo.DASHED:r.borderStyle="dashed";break;case Zo.BEVELED:it("Unimplemented border style: beveled");break;case Zo.INSET:it("Unimplemented border style: inset");break;case Zo.UNDERLINE:r.borderBottomStyle="solid";break}const A=e.borderColor||null;A?(p(this,ih,!0),r.borderColor=Q.makeHexColor(A[0]|0,A[1]|0,A[2]|0)):r.borderWidth=0}const c=Q.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:u,pageHeight:d,pageX:f,pageY:g}=s.rawDims;r.left="".concat(100*(c[0]-f)/u,"%"),r.top="".concat(100*(c[1]-g)/d,"%");const{rotation:v}=e;return e.hasOwnCanvas||v===0?(r.width="".concat(100*o/u,"%"),r.height="".concat(100*l/d,"%")):this.setRotation(v,n),n}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:s}=this.parent.viewport.rawDims;let{width:n,height:r}=this;t%180!==0&&([n,r]=[r,n]),e.style.width="".concat(100*n/i,"%"),e.style.height="".concat(100*r/s,"%"),e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(e,i,s)=>{const n=s.detail[e],r=n[0],o=n.slice(1);s.target.style[i]=Y0["".concat(r,"_HTML")](o),this.annotationStorage.setValue(this.data.id,{[i]:Y0["".concat(r,"_rgb")](o)})};return ct(this,"_commonActions",{display:e=>{const{display:i}=e.detail,s=i%2===1;this.container.style.visibility=s?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:s,noPrint:i===1||i===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:i}=e.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},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 i=e.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const s of Object.keys(e.detail)){const n=t[s]||i[s];n==null||n(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[s,n]of Object.entries(e)){const r=i[s];if(r){const o={detail:{[s]:n},target:t};r(o),delete e[s]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,s,n]=this.data.rect.map(y=>Math.fround(y));if(t.length===8){const[y,w,A,S]=t.subarray(2,6);if(s===y&&n===w&&e===A&&i===S)return}const{style:r}=this.container;let o;if(a(this,ih)){const{borderColor:y,borderWidth:w}=r;r.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="'.concat(y,'" stroke-width="').concat(w,'">')],this.container.classList.add("hasBorder")}const l=s-e,c=n-i,{svgFactory:u}=this,d=u.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0),d.role="none";const f=u.createElement("defs");d.append(f);const g=u.createElement("clipPath"),v="clippath_".concat(this.data.id);g.setAttribute("id",v),g.setAttribute("clipPathUnits","objectBoundingBox"),f.append(g);for(let y=2,w=t.length;y<w;y+=8){const A=t[y],S=t[y+1],E=t[y+2],x=t[y+3],C=u.createElement("rect"),P=(E-e)/l,F=(n-S)/c,I=(A-E)/l,T=(S-x)/c;C.setAttribute("x",P),C.setAttribute("y",F),C.setAttribute("width",I),C.setAttribute("height",T),g.append(C),o==null||o.push('<rect vector-effect="non-scaling-stroke" x="'.concat(P,'" y="').concat(F,'" width="').concat(I,'" height="').concat(T,'"/>'))}a(this,ih)&&(o.push("</g></svg>')"),r.backgroundImage=o.join("")),this.container.append(d),this.container.style.clipPath="url(#".concat(v,")")}_createPopup(t=null){const{data:e}=this;let i,s;t?(i={str:t.text},s=t.date):(i=e.contentsObj,s=e.modificationDate);const n=p(this,mn,new Lm({data:{color:e.color,titleObj:e.titleObj,modificationDate:s,contentsObj:i,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_".concat(e.id),rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}));this.parent.div.append(n.render())}get hasPopupElement(){return!!(a(this,mn)||this.popup||this.data.popupRef)}render(){Pt("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const i=[];if(this._fieldObjects){const s=this._fieldObjects[t];if(s)for(const{page:n,id:r,exportValues:o}of s){if(n===-1||r===e)continue;const l=typeof o=="string"?o:null,c=document.querySelector('[data-element-id="'.concat(r,'"]'));if(c&&!zo.has(c)){it("_getElementsByName - element not allowed: ".concat(r));continue}i.push({id:r,exportValue:l,domElement:c})}return i}for(const s of document.getElementsByName(t)){const{exportValue:n}=s,r=s.getAttribute("data-element-id");r!==e&&zo.has(s)&&i.push({id:r,exportValue:n,domElement:s})}return i}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 i;(i=this.linkService.eventBus)==null||i.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]}};no=new WeakMap,ih=new WeakMap,mn=new WeakMap,Ku=new WeakSet,Dm=function(t){const{container:{style:e},data:{rect:i,rotation:s},parent:{viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:o,pageY:l}}}}=this;i==null||i.splice(0,4,...t),e.left="".concat(100*(t[0]-o)/n,"%"),e.top="".concat(100*(r-t[3]+l)/r,"%"),s===0?(e.width="".concat(100*(t[2]-t[0])/n,"%"),e.height="".concat(100*(t[3]-t[1])/r,"%")):this.setRotation(s)};let Gt=S0;var Si,fa,xw,Cw;class c0 extends Gt{constructor(e,i=null){super(e,{isRenderable:!0,ignoreBorder:!!(i!=null&&i.ignoreBorder),createQuadrilaterals:!0});b(this,Si);this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:i}=this,s=document.createElement("a");s.setAttribute("data-element-id",e.id);let n=!1;return e.url?(i.addLinkAttributes(s,e.url,e.newWindow),n=!0):e.action?(this._bindNamedAction(s,e.action,e.overlaidText),n=!0):e.attachment?(m(this,Si,xw).call(this,s,e.attachment,e.overlaidText,e.attachmentDest),n=!0):e.setOCGState?(m(this,Si,Cw).call(this,s,e.setOCGState,e.overlaidText),n=!0):e.dest?(this._bindLink(s,e.dest,e.overlaidText),n=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(s,e),n=!0),e.resetForm?(this._bindResetFormAction(s,e.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(s,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(s),this.container}_bindLink(e,i,s=""){e.href=this.linkService.getDestinationHash(i),e.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||i==="")&&m(this,Si,fa).call(this),s&&(e.title=s)}_bindNamedAction(e,i,s=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(i),!1),s&&(e.title=s),m(this,Si,fa).call(this)}_bindJSAction(e,i){e.href=this.linkService.getAnchorUrl("");const s=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(i.actions)){const r=s.get(n);r&&(e[r]=()=>{var o;return(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:n}}),!1})}i.overlaidText&&(e.title=i.overlaidText),e.onclick||(e.onclick=()=>!1),m(this,Si,fa).call(this)}_bindResetFormAction(e,i){const s=e.onclick;if(s||(e.href=this.linkService.getAnchorUrl("")),m(this,Si,fa).call(this),!this._fieldObjects){it('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),s||(e.onclick=()=>!1);return}e.onclick=()=>{var d;s==null||s();const{fields:n,refs:r,include:o}=i,l=[];if(n.length!==0||r.length!==0){const f=new Set(r);for(const g of n){const v=this._fieldObjects[g]||[];for(const{id:y}of v)f.add(y)}for(const g of Object.values(this._fieldObjects))for(const v of g)f.has(v.id)===o&&l.push(v)}else for(const f of Object.values(this._fieldObjects))l.push(...f);const c=this.annotationStorage,u=[];for(const f of l){const{id:g}=f;switch(u.push(g),f.type){case"text":{const y=f.defaultValue||"";c.setValue(g,{value:y});break}case"checkbox":case"radiobutton":{const y=f.defaultValue===f.exportValues;c.setValue(g,{value:y});break}case"combobox":case"listbox":{const y=f.defaultValue||"";c.setValue(g,{value:y});break}default:continue}const v=document.querySelector('[data-element-id="'.concat(g,'"]'));if(v){if(!zo.has(v)){it("_bindResetFormAction - element not allowed: ".concat(g));continue}}else continue;v.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((d=this.linkService.eventBus)==null||d.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:u,name:"ResetForm"}})),!1}}}Si=new WeakSet,fa=function(){this.container.setAttribute("data-internal-link","")},xw=function(e,i,s="",n=null){e.href=this.linkService.getAnchorUrl(""),i.description?e.title=i.description:s&&(e.title=s),e.onclick=()=>{var r;return(r=this.downloadManager)==null||r.openOrDownloadData(i.content,i.filename,n),!1},m(this,Si,fa).call(this)},Cw=function(e,i,s=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(i),!1),s&&(e.title=s),m(this,Si,fa).call(this)};class DS extends Gt{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 Yo extends Gt{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 Te.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,s,n){i.includes("mouse")?t.addEventListener(i,r=>{var o;(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:n(r),shift:r.shiftKey,modifier:this._getKeyModifier(r)}})}):t.addEventListener(i,r=>{var o;if(i==="blur"){if(!e.focused||!r.relatedTarget)return;e.focused=!1}else if(i==="focus"){if(e.focused)return;e.focused=!0}n&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:n(r)}}))})}_setEventListeners(t,e,i,s){var n,r,o;for(const[l,c]of i)(c==="Action"||(n=this.data.actions)!=null&&n[c])&&((c==="Focus"||c==="Blur")&&(e||(e={focused:!1})),this._setEventListener(t,e,l,c,s),c==="Focus"&&!((r=this.data.actions)!=null&&r.Blur)?this._setEventListener(t,e,"blur","Blur",null):c==="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":Q.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||RS,n=t.style;let r;const o=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o),u=Math.round(c/(Eg*s))||1,d=c/u;r=Math.min(s,l(d/Eg))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o);r=Math.min(s,l(c/Eg))}n.fontSize="calc(".concat(r,"px * var(--total-scale-factor))"),n.color=Q.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(n.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class LS extends Yo{constructor(t){const e=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:e})}setPropertyOnSiblings(t,e,i,s){const n=this.annotationStorage;for(const r of this._getElementsByName(t.name,t.id))r.domElement&&(r.domElement[e]=i),n.setValue(r.id,{[s]:i})}render(){var s,n;const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const r=t.getValue(e,{value:this.data.fieldValue});let o=r.value||"";const l=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;l&&o.length>l&&(o=o.slice(0,l));let c=r.formattedValue||((s=this.data.textContent)==null?void 0:s.join("\n"))||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const u={userValue:o,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=c!=null?c:o,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type=this.data.password?"password":"text",i.setAttribute("value",c!=null?c:o),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),zo.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=0;const{datetimeFormat:d,datetimeType:f,timeStep:g}=this.data,v=!!f&&this.enableScripting;d&&(i.title=d),this._setRequired(i,this.data.required),l&&(i.maxLength=l),i.addEventListener("input",w=>{t.setValue(e,{value:w.target.value}),this.setPropertyOnSiblings(i,"value",w.target.value,"value"),u.formattedValue=null}),i.addEventListener("resetform",w=>{var S;const A=(S=this.data.defaultFieldValue)!=null?S:"";i.value=u.userValue=A,u.formattedValue=null});let y=w=>{const{formattedValue:A}=u;A!=null&&(w.target.value=A),w.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",A=>{var E;if(u.focused)return;const{target:S}=A;if(v&&(S.type=f,g&&(S.step=g)),u.userValue){const x=u.userValue;if(v)if(f==="time"){const C=new Date(x),P=[C.getHours(),C.getMinutes(),C.getSeconds()];S.value=P.map(F=>F.toString().padStart(2,"0")).join(":")}else S.value=new Date(x-_S).toISOString().split(f==="date"?"T":".",1)[0];else S.value=x}u.lastCommittedValue=S.value,u.commitKey=1,(E=this.data.actions)!=null&&E.Focus||(u.focused=!0)}),i.addEventListener("updatefromsandbox",A=>{this.showElementAndHideCanvas(A.target);const S={value(E){var x;u.userValue=(x=E.detail.value)!=null?x:"",v||t.setValue(e,{value:u.userValue.toString()}),E.target.value=u.userValue},formattedValue(E){const{formattedValue:x}=E.detail;u.formattedValue=x,x!=null&&E.target!==document.activeElement&&(E.target.value=x);const C={formattedValue:x};v&&(C.value=x),t.setValue(e,C)},selRange(E){E.target.setSelectionRange(...E.detail.selRange)},charLimit:E=>{var F;const{charLimit:x}=E.detail,{target:C}=E;if(x===0){C.removeAttribute("maxLength");return}C.setAttribute("maxLength",x);let P=u.userValue;!P||P.length<=x||(P=P.slice(0,x),C.value=u.userValue=P,t.setValue(e,{value:P}),(F=this.linkService.eventBus)==null||F.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:P,willCommit:!0,commitKey:1,selStart:C.selectionStart,selEnd:C.selectionEnd}}))}};this._dispatchEventFromSandbox(S,A)}),i.addEventListener("keydown",A=>{var x;u.commitKey=1;let S=-1;if(A.key==="Escape"?S=0:A.key==="Enter"&&!this.data.multiLine?S=2:A.key==="Tab"&&(u.commitKey=3),S===-1)return;const{value:E}=A.target;u.lastCommittedValue!==E&&(u.lastCommittedValue=E,u.userValue=E,(x=this.linkService.eventBus)==null||x.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:E,willCommit:!0,commitKey:S,selStart:A.target.selectionStart,selEnd:A.target.selectionEnd}}))});const w=y;y=null,i.addEventListener("blur",A=>{var x,C;if(!u.focused||!A.relatedTarget)return;(x=this.data.actions)!=null&&x.Blur||(u.focused=!1);const{target:S}=A;let{value:E}=S;if(v){if(E&&f==="time"){const P=E.split(":").map(F=>parseInt(F,10));E=new Date(2e3,0,1,P[0],P[1],P[2]||0).valueOf(),S.step=""}else E=new Date(E).valueOf();S.type="text"}u.userValue=E,u.lastCommittedValue!==E&&((C=this.linkService.eventBus)==null||C.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:E,willCommit:!0,commitKey:u.commitKey,selStart:A.target.selectionStart,selEnd:A.target.selectionEnd}})),w(A)}),(n=this.data.actions)!=null&&n.Keystroke&&i.addEventListener("beforeinput",A=>{var T;u.lastCommittedValue=null;const{data:S,target:E}=A,{value:x,selectionStart:C,selectionEnd:P}=E;let F=C,I=P;switch(A.inputType){case"deleteWordBackward":{const R=x.substring(0,C).match(/\w*[^\w]*$/);R&&(F-=R[0].length);break}case"deleteWordForward":{const R=x.substring(C).match(/^[^\w]*\w*/);R&&(I+=R[0].length);break}case"deleteContentBackward":C===P&&(F-=1);break;case"deleteContentForward":C===P&&(I+=1);break}A.preventDefault(),(T=this.linkService.eventBus)==null||T.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:x,change:S||"",willCommit:!1,selStart:F,selEnd:I}})}),this._setEventListeners(i,u,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],A=>A.target.value)}if(y&&i.addEventListener("blur",y),this.data.comb){const A=(this.data.rect[2]-this.data.rect[0])/l;i.classList.add("comb"),i.style.letterSpacing="calc(".concat(A,"px * var(--total-scale-factor) - 1ch)")}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class MS extends Yo{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class NS extends Yo{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let s=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;typeof s=="string"&&(s=s!=="Off",t.setValue(i,{value:s})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const n=document.createElement("input");return zo.add(n),n.setAttribute("data-element-id",i),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=e.fieldName,s&&n.setAttribute("checked",!0),n.setAttribute("exportValue",e.exportValue),n.tabIndex=0,n.addEventListener("change",r=>{const{name:o,checked:l}=r.target;for(const c of this._getElementsByName(o,i)){const u=l&&c.exportValue===e.exportValue;c.domElement&&(c.domElement.checked=u),t.setValue(c.id,{value:u})}t.setValue(i,{value:l})}),n.addEventListener("resetform",r=>{const o=e.defaultFieldValue||"Off";r.target.checked=o===e.exportValue}),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",r=>{const o={value(l){l.target.checked=l.detail.value!=="Off",t.setValue(i,{value:l.target.checked})}};this._dispatchEventFromSandbox(o,r)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],r=>r.target.checked)),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Pw extends Yo{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let s=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if(typeof s=="string"&&(s=s!==e.buttonValue,t.setValue(i,{value:s})),s)for(const r of this._getElementsByName(e.fieldName,i))t.setValue(r.id,{value:!1});const n=document.createElement("input");if(zo.add(n),n.setAttribute("data-element-id",i),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=e.fieldName,s&&n.setAttribute("checked",!0),n.tabIndex=0,n.addEventListener("change",r=>{const{name:o,checked:l}=r.target;for(const c of this._getElementsByName(o,i))t.setValue(c.id,{value:!1});t.setValue(i,{value:l})}),n.addEventListener("resetform",r=>{const o=e.defaultFieldValue;r.target.checked=o!=null&&o===e.buttonValue}),this.enableScripting&&this.hasJSActions){const r=e.buttonValue;n.addEventListener("updatefromsandbox",o=>{const l={value:c=>{const u=r===c.detail.value;for(const d of this._getElementsByName(c.target.name)){const f=u&&d.id===i;d.domElement&&(d.domElement.checked=f),t.setValue(d.id,{value:f})}}};this._dispatchEventFromSandbox(l,o)}),this._setEventListeners(n,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(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class OS extends c0{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",i=>{this._dispatchEventFromSandbox({},i)})),t}}class kS extends Yo{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),s=document.createElement("select");zo.add(s),s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,this._setRequired(s,this.data.required),s.name=this.data.fieldName,s.tabIndex=0;let n=this.data.combo&&this.data.options.length>0;this.data.combo||(s.size=this.data.options.length,this.data.multiSelect&&(s.multiple=!0)),s.addEventListener("resetform",u=>{const d=this.data.defaultFieldValue;for(const f of s.options)f.selected=f.value===d});for(const u of this.data.options){const d=document.createElement("option");d.textContent=u.displayValue,d.value=u.exportValue,i.value.includes(u.exportValue)&&(d.setAttribute("selected",!0),n=!1),s.append(d)}let r=null;if(n){const u=document.createElement("option");u.value=" ",u.setAttribute("hidden",!0),u.setAttribute("selected",!0),s.prepend(u),r=()=>{u.remove(),s.removeEventListener("input",r),r=null},s.addEventListener("input",r)}const o=u=>{const d=u?"value":"textContent",{options:f,multiple:g}=s;return g?Array.prototype.filter.call(f,v=>v.selected).map(v=>v[d]):f.selectedIndex===-1?null:f[f.selectedIndex][d]};let l=o(!1);const c=u=>{const d=u.target.options;return Array.prototype.map.call(d,f=>({displayValue:f.textContent,exportValue:f.value}))};return this.enableScripting&&this.hasJSActions?(s.addEventListener("updatefromsandbox",u=>{const d={value(f){r==null||r();const g=f.detail.value,v=new Set(Array.isArray(g)?g:[g]);for(const y of s.options)y.selected=v.has(y.value);t.setValue(e,{value:o(!0)}),l=o(!1)},multipleSelection(f){s.multiple=!0},remove(f){const g=s.options,v=f.detail.remove;g[v].selected=!1,s.remove(v),g.length>0&&Array.prototype.findIndex.call(g,w=>w.selected)===-1&&(g[0].selected=!0),t.setValue(e,{value:o(!0),items:c(f)}),l=o(!1)},clear(f){for(;s.length!==0;)s.remove(0);t.setValue(e,{value:null,items:[]}),l=o(!1)},insert(f){const{index:g,displayValue:v,exportValue:y}=f.detail.insert,w=s.children[g],A=document.createElement("option");A.textContent=v,A.value=y,w?w.before(A):s.append(A),t.setValue(e,{value:o(!0),items:c(f)}),l=o(!1)},items(f){const{items:g}=f.detail;for(;s.length!==0;)s.remove(0);for(const v of g){const{displayValue:y,exportValue:w}=v,A=document.createElement("option");A.textContent=y,A.value=w,s.append(A)}s.options.length>0&&(s.options[0].selected=!0),t.setValue(e,{value:o(!0),items:c(f)}),l=o(!1)},indices(f){const g=new Set(f.detail.indices);for(const v of f.target.options)v.selected=g.has(v.index);t.setValue(e,{value:o(!0)}),l=o(!1)},editable(f){f.target.disabled=!f.detail.editable}};this._dispatchEventFromSandbox(d,u)}),s.addEventListener("input",u=>{var g;const d=o(!0),f=o(!1);t.setValue(e,{value:d}),u.preventDefault(),(g=this.linkService.eventBus)==null||g.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:l,change:f,changeEx:d,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(s,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],u=>u.target.value)):s.addEventListener("input",function(u){t.setValue(e,{value:o(!0)})}),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Lm extends Gt{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:Gt._hasPopupData(e)}),this.elements=i,this.popup=null}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const e=this.popup=new BS({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}),i=[];for(const s of this.elements)s.popup=e,s.container.ariaHasPopup="dialog",i.push(s.data.id),s.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(s=>"".concat(r0).concat(s)).join(",")),this.container}}var sh,qp,tg,nh,rh,Ht,vn,Er,ah,Zu,oh,Cs,li,Sr,bn,Qu,yn,lh,ro,xr,mt,Xf,Yf,Mm,Tw,Fw,Iw,Rw,Kf,Zf,Nm;class BS{constructor({container:t,color:e,elements:i,titleObj:s,modificationDate:n,contentsObj:r,richText:o,parent:l,rect:c,parentRect:u,open:d}){b(this,mt);b(this,sh,m(this,mt,Iw).bind(this));b(this,qp,m(this,mt,Nm).bind(this));b(this,tg,m(this,mt,Zf).bind(this));b(this,nh,m(this,mt,Kf).bind(this));b(this,rh,null);b(this,Ht,null);b(this,vn,null);b(this,Er,null);b(this,ah,null);b(this,Zu,null);b(this,oh,null);b(this,Cs,!1);b(this,li,null);b(this,Sr,null);b(this,bn,null);b(this,Qu,null);b(this,yn,null);b(this,lh,null);b(this,ro,null);b(this,xr,!1);p(this,Ht,t),p(this,lh,s),p(this,vn,r),p(this,yn,o),p(this,Zu,l),p(this,rh,e),p(this,Qu,c),p(this,oh,u),p(this,ah,i),p(this,Er,Wc.toDateObject(n)),this.trigger=i.flatMap(f=>f.getElementsToTriggerPopup()),m(this,mt,Xf).call(this),a(this,Ht).hidden=!0,d&&m(this,mt,Kf).call(this)}render(){var s;if(a(this,li))return;const t=p(this,li,document.createElement("div"));if(t.className="popup",a(this,rh)){const n=t.style.outlineColor=Q.makeHexColor(...a(this,rh));t.style.backgroundColor="color-mix(in srgb, ".concat(n," 30%, white)")}const e=document.createElement("span");if(e.className="header",(s=a(this,lh))!=null&&s.str){const n=document.createElement("span");n.className="title",e.append(n),{dir:n.dir,str:n.textContent}=a(this,lh)}if(t.append(e),a(this,Er)){const n=document.createElement("time");n.className="popupDate",n.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),n.setAttribute("data-l10n-args",JSON.stringify({dateObj:a(this,Er).valueOf()})),n.dateTime=a(this,Er).toISOString(),e.append(n)}const i=a(this,mt,Yf);if(i)Sw.render({xfaHtml:i,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const n=this._formatContents(a(this,vn));t.append(n)}a(this,Ht).append(t)}_formatContents({str:t,dir:e}){const i=document.createElement("p");i.classList.add("popupContent"),i.dir=e;const s=t.split(/(?:\r\n?|\n)/);for(let n=0,r=s.length;n<r;++n){const o=s[n];i.append(document.createTextNode(o)),n<r-1&&i.append(document.createElement("br"))}return i}updateEdited({rect:t,popup:e,deleted:i}){var s;if(i||e!=null&&e.deleted){this.remove();return}m(this,mt,Xf).call(this),a(this,ro)||p(this,ro,{contentsObj:a(this,vn),richText:a(this,yn)}),t&&p(this,bn,null),e&&(p(this,yn,m(this,mt,Fw).call(this,e.text)),p(this,Er,Wc.toDateObject(e.date)),p(this,vn,null)),(s=a(this,li))==null||s.remove(),p(this,li,null)}resetEdited(){var t;a(this,ro)&&({contentsObj:ge(this,vn)._,richText:ge(this,yn)._}=a(this,ro),p(this,ro,null),(t=a(this,li))==null||t.remove(),p(this,li,null),p(this,bn,null))}remove(){var t,e;(t=a(this,Sr))==null||t.abort(),p(this,Sr,null),(e=a(this,li))==null||e.remove(),p(this,li,null),p(this,xr,!1),p(this,Cs,!1);for(const i of this.trigger)i.classList.remove("popupTriggerArea")}forceHide(){p(this,xr,this.isVisible),a(this,xr)&&(a(this,Ht).hidden=!0)}maybeShow(){m(this,mt,Xf).call(this),a(this,xr)&&(a(this,li)||m(this,mt,Zf).call(this),p(this,xr,!1),a(this,Ht).hidden=!1)}get isVisible(){return a(this,Ht).hidden===!1}}sh=new WeakMap,qp=new WeakMap,tg=new WeakMap,nh=new WeakMap,rh=new WeakMap,Ht=new WeakMap,vn=new WeakMap,Er=new WeakMap,ah=new WeakMap,Zu=new WeakMap,oh=new WeakMap,Cs=new WeakMap,li=new WeakMap,Sr=new WeakMap,bn=new WeakMap,Qu=new WeakMap,yn=new WeakMap,lh=new WeakMap,ro=new WeakMap,xr=new WeakMap,mt=new WeakSet,Xf=function(){var e;if(a(this,Sr))return;p(this,Sr,new AbortController);const{signal:t}=a(this,Sr);for(const i of this.trigger)i.addEventListener("click",a(this,nh),{signal:t}),i.addEventListener("mouseenter",a(this,tg),{signal:t}),i.addEventListener("mouseleave",a(this,qp),{signal:t}),i.classList.add("popupTriggerArea");for(const i of a(this,ah))(e=i.container)==null||e.addEventListener("keydown",a(this,sh),{signal:t})},Yf=function(){const t=a(this,yn),e=a(this,vn);return t!=null&&t.str&&(!(e!=null&&e.str)||e.str===t.str)&&a(this,yn).html||null},Mm=function(){var t,e,i;return((i=(e=(t=a(this,mt,Yf))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.fontSize)||0},Tw=function(){var t,e,i;return((i=(e=(t=a(this,mt,Yf))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.color)||null},Fw=function(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},s={style:{color:a(this,mt,Tw),fontSize:a(this,mt,Mm)?"calc(".concat(a(this,mt,Mm),"px * var(--total-scale-factor))"):""}};for(const n of t.split("\n"))e.push({name:"span",value:n,attributes:s});return i},Iw=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&a(this,Cs))&&m(this,mt,Kf).call(this)},Rw=function(){if(a(this,bn)!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:s,pageY:n}}}=a(this,Zu);let r=!!a(this,oh),o=r?a(this,oh):a(this,Qu);for(const v of a(this,ah))if(!o||Q.intersect(v.data.rect,o)!==null){o=v.data.rect,r=!0;break}const l=Q.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]),u=r?o[2]-o[0]+5:0,d=l[0]+u,f=l[1];p(this,bn,[100*(d-s)/e,100*(f-n)/i]);const{style:g}=a(this,Ht);g.left="".concat(a(this,bn)[0],"%"),g.top="".concat(a(this,bn)[1],"%")},Kf=function(){p(this,Cs,!a(this,Cs)),a(this,Cs)?(m(this,mt,Zf).call(this),a(this,Ht).addEventListener("click",a(this,nh)),a(this,Ht).addEventListener("keydown",a(this,sh))):(m(this,mt,Nm).call(this),a(this,Ht).removeEventListener("click",a(this,nh)),a(this,Ht).removeEventListener("keydown",a(this,sh)))},Zf=function(){a(this,li)||this.render(),this.isVisible?a(this,Cs)&&a(this,Ht).classList.add("focused"):(m(this,mt,Rw).call(this),a(this,Ht).hidden=!1,a(this,Ht).style.zIndex=parseInt(a(this,Ht).style.zIndex)+1e3)},Nm=function(){a(this,Ht).classList.remove("focused"),!(a(this,Cs)||!this.isVisible)&&(a(this,Ht).hidden=!0,a(this,Ht).style.zIndex=parseInt(a(this,Ht).style.zIndex)-1e3)};class _w extends Gt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=J.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 i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var Ju;class jS extends Gt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});b(this,Ju,null)}render(){this.container.classList.add("lineAnnotation");const{data:e,width:i,height:s}=this,n=this.svgFactory.create(i,s,!0),r=p(this,Ju,this.svgFactory.createElement("svg:line"));return r.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),r.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),r.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),r.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),r.setAttribute("stroke-width",e.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return a(this,Ju)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ju=new WeakMap;var qu;class VS extends Gt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});b(this,qu,null)}render(){this.container.classList.add("squareAnnotation");const{data:e,width:i,height:s}=this,n=this.svgFactory.create(i,s,!0),r=e.borderStyle.width,o=p(this,qu,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",r/2),o.setAttribute("y",r/2),o.setAttribute("width",i-r),o.setAttribute("height",s-r),o.setAttribute("stroke-width",r||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),n.append(o),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return a(this,qu)}addHighlightArea(){this.container.classList.add("highlightArea")}}qu=new WeakMap;var td;class HS extends Gt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});b(this,td,null)}render(){this.container.classList.add("circleAnnotation");const{data:e,width:i,height:s}=this,n=this.svgFactory.create(i,s,!0),r=e.borderStyle.width,o=p(this,td,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",i/2),o.setAttribute("cy",s/2),o.setAttribute("rx",i/2-r/2),o.setAttribute("ry",s/2-r/2),o.setAttribute("stroke-width",r||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),n.append(o),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return a(this,td)}addHighlightArea(){this.container.classList.add("highlightArea")}}td=new WeakMap;var ed;class Dw extends Gt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});b(this,ed,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,vertices:i,borderStyle:s,popupRef:n},width:r,height:o}=this;if(!i)return this.container;const l=this.svgFactory.create(r,o,!0);let c=[];for(let d=0,f=i.length;d<f;d+=2){const g=i[d]-e[0],v=e[3]-i[d+1];c.push("".concat(g,",").concat(v))}c=c.join(" ");const u=p(this,ed,this.svgFactory.createElement(this.svgElementName));return u.setAttribute("points",c),u.setAttribute("stroke-width",s.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),l.append(u),this.container.append(l),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return a(this,ed)}addHighlightArea(){this.container.classList.add("highlightArea")}}ed=new WeakMap;class $S extends Dw{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class US extends Gt{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 id,ao,sd,Om;class u0 extends Gt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});b(this,sd);b(this,id,null);b(this,ao,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?J.HIGHLIGHT:J.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,rotation:i,inkLists:s,borderStyle:n,popupRef:r}}=this,{transform:o,width:l,height:c}=m(this,sd,Om).call(this,i,e),u=this.svgFactory.create(l,c,!0),d=p(this,id,this.svgFactory.createElement("svg:g"));u.append(d),d.setAttribute("stroke-width",n.width||1),d.setAttribute("stroke-linecap","round"),d.setAttribute("stroke-linejoin","round"),d.setAttribute("stroke-miterlimit",10),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),d.setAttribute("transform",o);for(let f=0,g=s.length;f<g;f++){const v=this.svgFactory.createElement(this.svgElementName);a(this,ao).push(v),v.setAttribute("points",s[f].join(",")),d.append(v)}return!r&&this.hasPopupData&&this._createPopup(),this.container.append(u),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);const{thickness:i,points:s,rect:n}=e,r=a(this,id);if(i>=0&&r.setAttribute("stroke-width",i||1),s)for(let o=0,l=a(this,ao).length;o<l;o++)a(this,ao)[o].setAttribute("points",s[o].join(","));if(n){const{transform:o,width:l,height:c}=m(this,sd,Om).call(this,this.data.rotation,n);r.parentElement.setAttribute("viewBox","0 0 ".concat(l," ").concat(c)),r.setAttribute("transform",o)}}getElementsToTriggerPopup(){return a(this,ao)}addHighlightArea(){this.container.classList.add("highlightArea")}}id=new WeakMap,ao=new WeakMap,sd=new WeakSet,Om=function(e,i){switch(e){case 90:return{transform:"rotate(90) translate(".concat(-i[0],",").concat(i[1],") scale(1,-1)"),width:i[3]-i[1],height:i[2]-i[0]};case 180:return{transform:"rotate(180) translate(".concat(-i[2],",").concat(i[1],") scale(1,-1)"),width:i[2]-i[0],height:i[3]-i[1]};case 270:return{transform:"rotate(270) translate(".concat(-i[2],",").concat(i[3],") scale(1,-1)"),width:i[3]-i[1],height:i[2]-i[0]};default:return{transform:"translate(".concat(-i[0],",").concat(i[3],") scale(1,-1)"),width:i[2]-i[0],height:i[3]-i[1]}}};class Lw extends Gt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=J.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const i=document.createElement("mark");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class WS extends Gt{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 i=document.createElement("u");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class zS extends Gt{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 i=document.createElement("u");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class GS extends Gt{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 i=document.createElement("s");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class Mw extends Gt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=J.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 nd,rd,km;class XS extends Gt{constructor(e){var s;super(e,{isRenderable:!0});b(this,rd);b(this,nd,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,(s=this.linkService.eventBus)==null||s.dispatch("fileattachmentannotation",{source:this,...i})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:i}=this;let s;i.hasAppearance||i.fillAlpha===0?s=document.createElement("div"):(s=document.createElement("img"),s.src="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(i.name)?"paperclip":"pushpin",".svg"),i.fillAlpha&&i.fillAlpha<1&&(s.style="filter: opacity(".concat(Math.round(i.fillAlpha*100),"%);"))),s.addEventListener("dblclick",m(this,rd,km).bind(this)),p(this,nd,s);const{isMac:n}=Te.platform;return e.addEventListener("keydown",r=>{r.key==="Enter"&&(n?r.metaKey:r.ctrlKey)&&m(this,rd,km).call(this)}),!i.popupRef&&this.hasPopupData?this._createPopup():s.classList.add("popupTriggerArea"),e.append(s),e}getElementsToTriggerPopup(){return a(this,nd)}addHighlightArea(){this.container.classList.add("highlightArea")}}nd=new WeakMap,rd=new WeakSet,km=function(){var e;(e=this.downloadManager)==null||e.openOrDownloadData(this.content,this.filename)};var ad,oo,Cr,od,ca,Bm,jm,hh;let YS=(hh=class{constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:s,page:n,viewport:r,structTreeLayer:o}){b(this,ca);b(this,ad,null);b(this,oo,null);b(this,Cr,new Map);b(this,od,null);this.div=t,p(this,ad,e),p(this,oo,i),p(this,od,o||null),this.page=n,this.viewport=r,this.zIndex=0,this._annotationEditorUIManager=s}hasEditableAnnotations(){return a(this,Cr).size>0}async render(t){var r;const{annotations:e}=t,i=this.div;Uo(i,this.viewport);const s=new Map,n={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new Lp,annotationStorage:t.annotationStorage||new o0,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const o of e){if(o.noHTML)continue;const l=o.annotationType===Zt.POPUP;if(l){const d=s.get(o.id);if(!d)continue;n.elements=d}else if(o.rect[2]===o.rect[0]||o.rect[3]===o.rect[1])continue;n.data=o;const c=K0.create(n);if(!c.isRenderable)continue;if(!l&&o.popupRef){const d=s.get(o.popupRef);d?d.push(c):s.set(o.popupRef,[c])}const u=c.render();o.hidden&&(u.style.visibility="hidden"),await m(this,ca,Bm).call(this,u,o.id,n.elements),c._isEditable&&(a(this,Cr).set(c.data.id,c),(r=this._annotationEditorUIManager)==null||r.renderAnnotationElement(c))}m(this,ca,jm).call(this)}async addLinkAnnotations(t,e){const i={data:null,layer:this.div,linkService:e,svgFactory:new Lp,parent:this};for(const s of t){s.borderStyle||(s.borderStyle=hh._defaultBorderStyle),i.data=s;const n=K0.create(i);if(!n.isRenderable)continue;const r=n.render();await m(this,ca,Bm).call(this,r,s.id,null)}}update({viewport:t}){const e=this.div;this.viewport=t,Uo(e,{rotation:t.rotation}),m(this,ca,jm).call(this),e.hidden=!1}getEditableAnnotations(){return Array.from(a(this,Cr).values())}getEditableAnnotation(t){return a(this,Cr).get(t)}static get _defaultBorderStyle(){return ct(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:Zo.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},ad=new WeakMap,oo=new WeakMap,Cr=new WeakMap,od=new WeakMap,ca=new WeakSet,Bm=async function(t,e,i){var o,l;const s=t.firstChild||t,n=s.id="".concat(r0).concat(e),r=await((o=a(this,od))==null?void 0:o.getAriaAttributes(n));if(r)for(const[c,u]of r)s.setAttribute(c,u);i?i.at(-1).container.after(t):(this.div.append(t),(l=a(this,ad))==null||l.moveElementInDOM(this.div,t,s,!1))},jm=function(){var e;if(!a(this,oo))return;const t=this.div;for(const[i,s]of a(this,oo)){const n=t.querySelector('[data-annotation-id="'.concat(i,'"]'));if(!n)continue;s.className="annotationContent";const{firstChild:r}=n;r?r.nodeName==="CANVAS"?r.replaceWith(s):r.classList.contains("annotationContent")?r.after(s):r.before(s):n.append(s);const o=a(this,Cr).get(i);o&&(o._hasNoCanvas?((e=this._annotationEditorUIManager)==null||e.setMissingCanvas(i,n.id,s),o._hasNoCanvas=!1):o.canvas=s)}a(this,oo).clear()},hh);const Cf=/\r\n?|\n/g;var Di,hi,ld,lo,ci,te,Nw,Ow,kw,Qf,$n,Jf,qf,Bw,Hm,jw;const It=class It extends Rt{constructor(e){super({...e,name:"freeTextEditor"});b(this,te);b(this,Di);b(this,hi,"");b(this,ld,"".concat(this.id,"-editor"));b(this,lo,null);b(this,ci);M(this,"_colorPicker",null);p(this,Di,e.color||It._defaultColor||Rt._defaultLineColor),p(this,ci,e.fontSize||It._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static get _keyboardManager(){const e=It.prototype,i=r=>r.isEmpty(),s=zc.TRANSLATE_SMALL,n=zc.TRANSLATE_BIG;return ct(this,"_keyboardManager",new gf([[["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:[-s,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-n,0],checker:i}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[s,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[n,0],checker:i}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-s],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:i}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,s],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,n],checker:i}]]))}static initialize(e,i){Rt.initialize(e,i);const s=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(s.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,i){switch(e){case ut.FREETEXT_SIZE:It._defaultFontSize=i;break;case ut.FREETEXT_COLOR:It._defaultColor=i;break}}updateParams(e,i){switch(e){case ut.FREETEXT_SIZE:m(this,te,Nw).call(this,i);break;case ut.FREETEXT_COLOR:m(this,te,Ow).call(this,i);break}}static get defaultPropertiesToUpdate(){return[[ut.FREETEXT_SIZE,It._defaultFontSize],[ut.FREETEXT_COLOR,It._defaultColor||Rt._defaultLineColor]]}get propertiesToUpdate(){return[[ut.FREETEXT_SIZE,a(this,ci)],[ut.FREETEXT_COLOR,a(this,Di)]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new Dp(this)),[["colorPicker",this._colorPicker]]}get colorType(){return ut.FREETEXT_COLOR}get colorValue(){return a(this,Di)}_translateEmpty(e,i){this._uiManager.translateSelectedEditors(e,i,!0)}getInitialTranslation(){const e=this.parentScale;return[-It._internalPadding*e,-(It._internalPadding+a(this,ci))*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,lo,new AbortController);const e=this._uiManager.combinedSignal(a(this,lo));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",a(this,ld)),this._isDraggable=!0,(e=a(this,lo))==null||e.abort(),p(this,lo,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 i;this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),(i=this._initialOptions)!=null&&i.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=a(this,hi),i=p(this,hi,m(this,te,kw).call(this).trimEnd());if(e===i)return;const s=n=>{if(p(this,hi,n),!n){this.remove();return}m(this,te,qf).call(this),this._uiManager.rebuild(this),m(this,te,Qf).call(this)};this.addCommands({cmd:()=>{s(i)},undo:()=>{s(e)},mustExec:!1}),m(this,te,Qf).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){It._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,i;(this._isCopy||this.annotationElementId)&&(e=this.x,i=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",a(this,ld)),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:s}=this.editorDiv;if(s.fontSize="calc(".concat(a(this,ci),"px * var(--total-scale-factor))"),s.color=a(this,Di),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[n,r]=this.parentDimensions;if(this.annotationElementId){const{position:o}=this._initialData;let[l,c]=this.getInitialTranslation();[l,c]=this.pageTranslationToScreen(l,c);const[u,d]=this.pageDimensions,[f,g]=this.pageTranslation;let v,y;switch(this.rotation){case 0:v=e+(o[0]-f)/u,y=i+this.height-(o[1]-g)/d;break;case 90:v=e+(o[0]-f)/u,y=i-(o[1]-g)/d,[l,c]=[c,-l];break;case 180:v=e-this.width+(o[0]-f)/u,y=i-(o[1]-g)/d,[l,c]=[-l,-c];break;case 270:v=e+(o[0]-f-this.height*d)/u,y=i+(o[1]-g-this.width*u)/d,[l,c]=[-c,l];break}this.setAt(v*n,y*r,l,c)}else this._moveAfterPaste(e,i);m(this,te,qf).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(e){var v,y,w;const i=e.clipboardData||window.clipboardData,{types:s}=i;if(s.length===1&&s[0]==="text/plain")return;e.preventDefault();const n=m(v=It,$n,Hm).call(v,i.getData("text")||"").replaceAll(Cf,"\n");if(!n)return;const r=window.getSelection();if(!r.rangeCount)return;this.editorDiv.normalize(),r.deleteFromDocument();const o=r.getRangeAt(0);if(!n.includes("\n")){o.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),r.collapseToStart();return}const{startContainer:l,startOffset:c}=o,u=[],d=[];if(l.nodeType===Node.TEXT_NODE){const A=l.parentElement;if(d.push(l.nodeValue.slice(c).replaceAll(Cf,"")),A!==this.editorDiv){let S=u;for(const E of this.editorDiv.childNodes){if(E===A){S=d;continue}S.push(m(y=It,$n,Jf).call(y,E))}}u.push(l.nodeValue.slice(0,c).replaceAll(Cf,""))}else if(l===this.editorDiv){let A=u,S=0;for(const E of this.editorDiv.childNodes)S++===c&&(A=d),A.push(m(w=It,$n,Jf).call(w,E))}p(this,hi,"".concat(u.join("\n")).concat(n).concat(d.join("\n"))),m(this,te,qf).call(this);const f=new Range;let g=Math.sumPrecise(u.map(A=>A.length));for(const{firstChild:A}of this.editorDiv.childNodes)if(A.nodeType===Node.TEXT_NODE){const S=A.nodeValue.length;if(g<=S){f.setStart(A,g),f.setEnd(A,g);break}g-=S}r.removeAllRanges(),r.addRange(f)}get contentDiv(){return this.editorDiv}static async deserialize(e,i,s){var o;let n=null;if(e instanceof _w){const{data:{defaultAppearanceData:{fontSize:l,fontColor:c},rect:u,rotation:d,id:f,popupRef:g,contentsObj:v},textContent:y,textPosition:w,parent:{page:{pageNumber:A}}}=e;if(!y||y.length===0)return null;n=e={annotationType:J.FREETEXT,color:Array.from(c),fontSize:l,value:y.join("\n"),position:w,pageIndex:A-1,rect:u.slice(0),rotation:d,annotationElementId:f,id:f,deleted:!1,popupRef:g,comment:(v==null?void 0:v.str)||null}}const r=await super.deserialize(e,i,s);return p(r,ci,e.fontSize),p(r,Di,Q.makeHexColor(...e.color)),p(r,hi,m(o=It,$n,Hm).call(o,e.value)),r._initialData=n,e.comment&&r.setCommentData(e.comment),r}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=It._internalPadding*this.parentScale,s=this.getRect(i,i),n=Rt._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:a(this,Di)),r={annotationType:J.FREETEXT,color:n,fontSize:a(this,ci),value:m(this,te,Bw).call(this),pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(r),e?(r.isCopy=!0,r):this.annotationElementId&&!m(this,te,jw).call(this,r)?null:(r.id=this.annotationElementId,r)}renderAnnotationElement(e){const i=super.renderAnnotationElement(e),{style:s}=i;s.fontSize="calc(".concat(a(this,ci),"px * var(--total-scale-factor))"),s.color=a(this,Di),i.replaceChildren();for(const o of a(this,hi).split("\n")){const l=document.createElement("div");l.append(o?document.createTextNode(o):document.createElement("br")),i.append(l)}const n=It._internalPadding*this.parentScale,r={rect:this.getRect(n,n)};return r.popup=this.hasEditedComment?this.comment:{text:a(this,hi)},e.updateEdited(r),i}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}};Di=new WeakMap,hi=new WeakMap,ld=new WeakMap,lo=new WeakMap,ci=new WeakMap,te=new WeakSet,Nw=function(e){const i=n=>{this.editorDiv.style.fontSize="calc(".concat(n,"px * var(--total-scale-factor))"),this.translate(0,-(n-a(this,ci))*this.parentScale),p(this,ci,n),m(this,te,Qf).call(this)},s=a(this,ci);this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ut.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},Ow=function(e){const i=n=>{var r;p(this,Di,this.editorDiv.style.color=n),(r=this._colorPicker)==null||r.update(n)},s=a(this,Di);this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ut.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},kw=function(){var s;const e=[];this.editorDiv.normalize();let i=null;for(const n of this.editorDiv.childNodes)(i==null?void 0:i.nodeType)===Node.TEXT_NODE&&n.nodeName==="BR"||(e.push(m(s=It,$n,Jf).call(s,n)),i=n);return e.join("\n")},Qf=function(){const[e,i]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:n,div:r}=this,o=r.style.display,l=r.classList.contains("hidden");r.classList.remove("hidden"),r.style.display="hidden",n.div.append(this.div),s=r.getBoundingClientRect(),r.remove(),r.style.display=o,r.classList.toggle("hidden",l)}this.rotation%180===this.parentRotation%180?(this.width=s.width/e,this.height=s.height/i):(this.width=s.height/e,this.height=s.width/i),this.fixAndSetPosition()},$n=new WeakSet,Jf=function(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(Cf,"")},qf=function(){if(this.editorDiv.replaceChildren(),!!a(this,hi))for(const e of a(this,hi).split("\n")){const i=document.createElement("div");i.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(i)}},Bw=function(){return a(this,hi).replaceAll(" "," ")},Hm=function(e){return e.replaceAll(" "," ")},jw=function(e){const{value:i,fontSize:s,color:n,pageIndex:r}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==i||e.fontSize!==s||e.color.some((o,l)=>o!==n[l])||e.pageIndex!==r},b(It,$n),M(It,"_freeTextDefaultContent",""),M(It,"_internalPadding",0),M(It,"_defaultColor",null),M(It,"_defaultFontSize",10),M(It,"_type","freetext"),M(It,"_editorType",J.FREETEXT);let Vm=It;class G{toSVGPath(){Pt("Abstract method `toSVGPath` must be implemented.")}get box(){Pt("Abstract getter `box` must be implemented.")}serialize(t,e){Pt("Abstract method `serialize` must be implemented.")}static _rescale(t,e,i,s,n,r){r||(r=new Float32Array(t.length));for(let o=0,l=t.length;o<l;o+=2)r[o]=e+t[o]*s,r[o+1]=i+t[o+1]*n;return r}static _rescaleAndSwap(t,e,i,s,n,r){r||(r=new Float32Array(t.length));for(let o=0,l=t.length;o<l;o+=2)r[o]=e+t[o+1]*s,r[o+1]=i+t[o]*n;return r}static _translate(t,e,i,s){s||(s=new Float32Array(t.length));for(let n=0,r=t.length;n<r;n+=2)s[n]=e+t[n],s[n+1]=i+t[n+1];return s}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,e,i,s,n){switch(n){case 90:return[1-e/i,t/s];case 180:return[1-t/i,1-e/s];case 270:return[e/i,1-t/s];default:return[t/i,e/s]}}static _normalizePagePoint(t,e,i){switch(i){case 90:return[1-e,t];case 180:return[1-t,1-e];case 270:return[e,1-t];default:return[t,e]}}static createBezierPoints(t,e,i,s,n,r){return[(t+5*i)/6,(e+5*s)/6,(5*i+n)/6,(5*s+r)/6,(i+n)/2,(s+r)/2]}}M(G,"PRECISION",1e-4);var ui,Yi,ch,uh,Ps,ht,ho,co,hd,cd,dh,fh,Pr,ud,eg,ig,re,Ac,Vw,Hw,$w,Uw,Ww,zw;const Xs=class Xs{constructor({x:t,y:e},i,s,n,r,o=0){b(this,re);b(this,ui);b(this,Yi,[]);b(this,ch);b(this,uh);b(this,Ps,[]);b(this,ht,new Float32Array(18));b(this,ho);b(this,co);b(this,hd);b(this,cd);b(this,dh);b(this,fh);b(this,Pr,[]);p(this,ui,i),p(this,fh,n*s),p(this,uh,r),a(this,ht).set([NaN,NaN,NaN,NaN,t,e],6),p(this,ch,o),p(this,cd,a(Xs,ud)*s),p(this,hd,a(Xs,ig)*s),p(this,dh,s),a(this,Pr).push(t,e)}isEmpty(){return isNaN(a(this,ht)[8])}add({x:t,y:e}){var T;p(this,ho,t),p(this,co,e);const[i,s,n,r]=a(this,ui);let[o,l,c,u]=a(this,ht).subarray(8,12);const d=t-c,f=e-u,g=Math.hypot(d,f);if(g<a(this,hd))return!1;const v=g-a(this,cd),y=v/g,w=y*d,A=y*f;let S=o,E=l;o=c,l=u,c+=w,u+=A,(T=a(this,Pr))==null||T.push(t,e);const x=-A/v,C=w/v,P=x*a(this,fh),F=C*a(this,fh);return a(this,ht).set(a(this,ht).subarray(2,8),0),a(this,ht).set([c+P,u+F],4),a(this,ht).set(a(this,ht).subarray(14,18),12),a(this,ht).set([c-P,u-F],16),isNaN(a(this,ht)[6])?(a(this,Ps).length===0&&(a(this,ht).set([o+P,l+F],2),a(this,Ps).push(NaN,NaN,NaN,NaN,(o+P-i)/n,(l+F-s)/r),a(this,ht).set([o-P,l-F],14),a(this,Yi).push(NaN,NaN,NaN,NaN,(o-P-i)/n,(l-F-s)/r)),a(this,ht).set([S,E,o,l,c,u],6),!this.isEmpty()):(a(this,ht).set([S,E,o,l,c,u],6),Math.abs(Math.atan2(E-l,S-o)-Math.atan2(A,w))<Math.PI/2?([o,l,c,u]=a(this,ht).subarray(2,6),a(this,Ps).push(NaN,NaN,NaN,NaN,((o+c)/2-i)/n,((l+u)/2-s)/r),[o,l,S,E]=a(this,ht).subarray(14,18),a(this,Yi).push(NaN,NaN,NaN,NaN,((S+o)/2-i)/n,((E+l)/2-s)/r),!0):([S,E,o,l,c,u]=a(this,ht).subarray(0,6),a(this,Ps).push(((S+5*o)/6-i)/n,((E+5*l)/6-s)/r,((5*o+c)/6-i)/n,((5*l+u)/6-s)/r,((o+c)/2-i)/n,((l+u)/2-s)/r),[c,u,o,l,S,E]=a(this,ht).subarray(12,18),a(this,Yi).push(((S+5*o)/6-i)/n,((E+5*l)/6-s)/r,((5*o+c)/6-i)/n,((5*l+u)/6-s)/r,((o+c)/2-i)/n,((l+u)/2-s)/r),!0))}toSVGPath(){if(this.isEmpty())return"";const t=a(this,Ps),e=a(this,Yi);if(isNaN(a(this,ht)[6])&&!this.isEmpty())return m(this,re,Vw).call(this);const i=[];i.push("M".concat(t[4]," ").concat(t[5]));for(let s=6;s<t.length;s+=6)isNaN(t[s])?i.push("L".concat(t[s+4]," ").concat(t[s+5])):i.push("C".concat(t[s]," ").concat(t[s+1]," ").concat(t[s+2]," ").concat(t[s+3]," ").concat(t[s+4]," ").concat(t[s+5]));m(this,re,$w).call(this,i);for(let s=e.length-6;s>=6;s-=6)isNaN(e[s])?i.push("L".concat(e[s+4]," ").concat(e[s+5])):i.push("C".concat(e[s]," ").concat(e[s+1]," ").concat(e[s+2]," ").concat(e[s+3]," ").concat(e[s+4]," ").concat(e[s+5]));return m(this,re,Hw).call(this,i),i.join(" ")}newFreeDrawOutline(t,e,i,s,n,r){return new Gw(t,e,i,s,n,r)}getOutlines(){var d,f;const t=a(this,Ps),e=a(this,Yi),i=a(this,ht),[s,n,r,o]=a(this,ui),l=new Float32Array(((f=(d=a(this,Pr))==null?void 0:d.length)!=null?f:0)+2);for(let g=0,v=l.length-2;g<v;g+=2)l[g]=(a(this,Pr)[g]-s)/r,l[g+1]=(a(this,Pr)[g+1]-n)/o;if(l[l.length-2]=(a(this,ho)-s)/r,l[l.length-1]=(a(this,co)-n)/o,isNaN(i[6])&&!this.isEmpty())return m(this,re,Uw).call(this,l);const c=new Float32Array(a(this,Ps).length+24+a(this,Yi).length);let u=t.length;for(let g=0;g<u;g+=2){if(isNaN(t[g])){c[g]=c[g+1]=NaN;continue}c[g]=t[g],c[g+1]=t[g+1]}u=m(this,re,zw).call(this,c,u);for(let g=e.length-6;g>=6;g-=6)for(let v=0;v<6;v+=2){if(isNaN(e[g+v])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=e[g+v],c[u+1]=e[g+v+1],u+=2}return m(this,re,Ww).call(this,c,u),this.newFreeDrawOutline(c,l,a(this,ui),a(this,dh),a(this,ch),a(this,uh))}};ui=new WeakMap,Yi=new WeakMap,ch=new WeakMap,uh=new WeakMap,Ps=new WeakMap,ht=new WeakMap,ho=new WeakMap,co=new WeakMap,hd=new WeakMap,cd=new WeakMap,dh=new WeakMap,fh=new WeakMap,Pr=new WeakMap,ud=new WeakMap,eg=new WeakMap,ig=new WeakMap,re=new WeakSet,Ac=function(){const t=a(this,ht).subarray(4,6),e=a(this,ht).subarray(16,18),[i,s,n,r]=a(this,ui);return[(a(this,ho)+(t[0]-e[0])/2-i)/n,(a(this,co)+(t[1]-e[1])/2-s)/r,(a(this,ho)+(e[0]-t[0])/2-i)/n,(a(this,co)+(e[1]-t[1])/2-s)/r]},Vw=function(){const[t,e,i,s]=a(this,ui),[n,r,o,l]=m(this,re,Ac).call(this);return"M".concat((a(this,ht)[2]-t)/i," ").concat((a(this,ht)[3]-e)/s," L").concat((a(this,ht)[4]-t)/i," ").concat((a(this,ht)[5]-e)/s," L").concat(n," ").concat(r," L").concat(o," ").concat(l," L").concat((a(this,ht)[16]-t)/i," ").concat((a(this,ht)[17]-e)/s," L").concat((a(this,ht)[14]-t)/i," ").concat((a(this,ht)[15]-e)/s," Z")},Hw=function(t){const e=a(this,Yi);t.push("L".concat(e[4]," ").concat(e[5]," Z"))},$w=function(t){const[e,i,s,n]=a(this,ui),r=a(this,ht).subarray(4,6),o=a(this,ht).subarray(16,18),[l,c,u,d]=m(this,re,Ac).call(this);t.push("L".concat((r[0]-e)/s," ").concat((r[1]-i)/n," L").concat(l," ").concat(c," L").concat(u," ").concat(d," L").concat((o[0]-e)/s," ").concat((o[1]-i)/n))},Uw=function(t){const e=a(this,ht),[i,s,n,r]=a(this,ui),[o,l,c,u]=m(this,re,Ac).call(this),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(e[2]-i)/n,(e[3]-s)/r,NaN,NaN,NaN,NaN,(e[4]-i)/n,(e[5]-s)/r,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,(e[16]-i)/n,(e[17]-s)/r,NaN,NaN,NaN,NaN,(e[14]-i)/n,(e[15]-s)/r],0),this.newFreeDrawOutline(d,t,a(this,ui),a(this,dh),a(this,ch),a(this,uh))},Ww=function(t,e){const i=a(this,Yi);return t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e),e+=6},zw=function(t,e){const i=a(this,ht).subarray(4,6),s=a(this,ht).subarray(16,18),[n,r,o,l]=a(this,ui),[c,u,d,f]=m(this,re,Ac).call(this);return t.set([NaN,NaN,NaN,NaN,(i[0]-n)/o,(i[1]-r)/l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,d,f,NaN,NaN,NaN,NaN,(s[0]-n)/o,(s[1]-r)/l],e),e+=24},b(Xs,ud,8),b(Xs,eg,2),b(Xs,ig,a(Xs,ud)+a(Xs,eg));let Mp=Xs;var ph,uo,wn,dd,di,fd,zt,sg,Xw;class Gw extends G{constructor(e,i,s,n,r,o){super();b(this,sg);b(this,ph);b(this,uo,new Float32Array(4));b(this,wn);b(this,dd);b(this,di);b(this,fd);b(this,zt);p(this,zt,e),p(this,di,i),p(this,ph,s),p(this,fd,n),p(this,wn,r),p(this,dd,o),this.lastPoint=[NaN,NaN],m(this,sg,Xw).call(this,o);const[l,c,u,d]=a(this,uo);for(let f=0,g=e.length;f<g;f+=2)e[f]=(e[f]-l)/u,e[f+1]=(e[f+1]-c)/d;for(let f=0,g=i.length;f<g;f+=2)i[f]=(i[f]-l)/u,i[f+1]=(i[f+1]-c)/d}toSVGPath(){const e=["M".concat(a(this,zt)[4]," ").concat(a(this,zt)[5])];for(let i=6,s=a(this,zt).length;i<s;i+=6){if(isNaN(a(this,zt)[i])){e.push("L".concat(a(this,zt)[i+4]," ").concat(a(this,zt)[i+5]));continue}e.push("C".concat(a(this,zt)[i]," ").concat(a(this,zt)[i+1]," ").concat(a(this,zt)[i+2]," ").concat(a(this,zt)[i+3]," ").concat(a(this,zt)[i+4]," ").concat(a(this,zt)[i+5]))}return e.push("Z"),e.join(" ")}serialize([e,i,s,n],r){const o=s-e,l=n-i;let c,u;switch(r){case 0:c=G._rescale(a(this,zt),e,n,o,-l),u=G._rescale(a(this,di),e,n,o,-l);break;case 90:c=G._rescaleAndSwap(a(this,zt),e,i,o,l),u=G._rescaleAndSwap(a(this,di),e,i,o,l);break;case 180:c=G._rescale(a(this,zt),s,i,-o,l),u=G._rescale(a(this,di),s,i,-o,l);break;case 270:c=G._rescaleAndSwap(a(this,zt),s,n,-o,-l),u=G._rescaleAndSwap(a(this,di),s,n,-o,-l);break}return{outline:Array.from(c),points:[Array.from(u)]}}get box(){return a(this,uo)}newOutliner(e,i,s,n,r,o=0){return new Mp(e,i,s,n,r,o)}getNewOutline(e,i){const[s,n,r,o]=a(this,uo),[l,c,u,d]=a(this,ph),f=r*u,g=o*d,v=s*u+l,y=n*d+c,w=this.newOutliner({x:a(this,di)[0]*f+v,y:a(this,di)[1]*g+y},a(this,ph),a(this,fd),e,a(this,dd),i!=null?i:a(this,wn));for(let A=2;A<a(this,di).length;A+=2)w.add({x:a(this,di)[A]*f+v,y:a(this,di)[A+1]*g+y});return w.getOutlines()}}ph=new WeakMap,uo=new WeakMap,wn=new WeakMap,dd=new WeakMap,di=new WeakMap,fd=new WeakMap,zt=new WeakMap,sg=new WeakSet,Xw=function(e){const i=a(this,zt);let s=i[4],n=i[5];const r=[s,n,s,n];let o=s,l=n;const c=e?Math.max:Math.min;for(let d=6,f=i.length;d<f;d+=6){const g=i[d+4],v=i[d+5];if(isNaN(i[d]))Q.pointBoundingBox(g,v,r),l<v?(o=g,l=v):l===v&&(o=c(o,g));else{const y=[1/0,1/0,-1/0,-1/0];Q.bezierBoundingBox(s,n,...i.slice(d,d+6),y),Q.rectBoundingBox(...y,r),l<y[3]?(o=y[2],l=y[3]):l===y[3]&&(o=c(o,y[2]))}s=g,n=v}const u=a(this,uo);u[0]=r[0]-a(this,wn),u[1]=r[1]-a(this,wn),u[2]=r[2]-r[0]+2*a(this,wn),u[3]=r[3]-r[1]+2*a(this,wn),this.lastPoint=[o,l]};var pd,gd,Tr,Ki,We,Yw,tp,Kw,Zw,Um;class $m{constructor(t,e=0,i=0,s=!0){b(this,We);b(this,pd);b(this,gd);b(this,Tr,[]);b(this,Ki,[]);const n=[1/0,1/0,-1/0,-1/0],r=10**-4;for(const{x:g,y:v,width:y,height:w}of t){const A=Math.floor((g-e)/r)*r,S=Math.ceil((g+y+e)/r)*r,E=Math.floor((v-e)/r)*r,x=Math.ceil((v+w+e)/r)*r,C=[A,E,x,!0],P=[S,E,x,!1];a(this,Tr).push(C,P),Q.rectBoundingBox(A,E,S,x,n)}const o=n[2]-n[0]+2*i,l=n[3]-n[1]+2*i,c=n[0]-i,u=n[1]-i,d=a(this,Tr).at(s?-1:-2),f=[d[0],d[2]];for(const g of a(this,Tr)){const[v,y,w]=g;g[0]=(v-c)/o,g[1]=(y-u)/l,g[2]=(w-u)/l}p(this,pd,new Float32Array([c,u,o,l])),p(this,gd,f)}getOutlines(){a(this,Tr).sort((e,i)=>e[0]-i[0]||e[1]-i[1]||e[2]-i[2]);const t=[];for(const e of a(this,Tr))e[3]?(t.push(...m(this,We,Um).call(this,e)),m(this,We,Kw).call(this,e)):(m(this,We,Zw).call(this,e),t.push(...m(this,We,Um).call(this,e)));return m(this,We,Yw).call(this,t)}}pd=new WeakMap,gd=new WeakMap,Tr=new WeakMap,Ki=new WeakMap,We=new WeakSet,Yw=function(t){const e=[],i=new Set;for(const r of t){const[o,l,c]=r;e.push([o,l,r],[o,c,r])}e.sort((r,o)=>r[1]-o[1]||r[0]-o[0]);for(let r=0,o=e.length;r<o;r+=2){const l=e[r][2],c=e[r+1][2];l.push(c),c.push(l),i.add(l),i.add(c)}const s=[];let n;for(;i.size>0;){const r=i.values().next().value;let[o,l,c,u,d]=r;i.delete(r);let f=o,g=l;for(n=[o,c],s.push(n);;){let v;if(i.has(u))v=u;else if(i.has(d))v=d;else break;i.delete(v),[o,l,c,u,d]=v,f!==o&&(n.push(f,g,o,g===l?l:c),f=o),g=g===l?c:l}n.push(f,g)}return new KS(s,a(this,pd),a(this,gd))},tp=function(t){const e=a(this,Ki);let i=0,s=e.length-1;for(;i<=s;){const n=i+s>>1,r=e[n][0];if(r===t)return n;r<t?i=n+1:s=n-1}return s+1},Kw=function([,t,e]){const i=m(this,We,tp).call(this,t);a(this,Ki).splice(i,0,[t,e])},Zw=function([,t,e]){const i=m(this,We,tp).call(this,t);for(let s=i;s<a(this,Ki).length;s++){const[n,r]=a(this,Ki)[s];if(n!==t)break;if(n===t&&r===e){a(this,Ki).splice(s,1);return}}for(let s=i-1;s>=0;s--){const[n,r]=a(this,Ki)[s];if(n!==t)break;if(n===t&&r===e){a(this,Ki).splice(s,1);return}}},Um=function(t){const[e,i,s]=t,n=[[e,i,s]],r=m(this,We,tp).call(this,s);for(let o=0;o<r;o++){const[l,c]=a(this,Ki)[o];for(let u=0,d=n.length;u<d;u++){const[,f,g]=n[u];if(!(c<=f||g<=l)){if(f>=l){if(g>c)n[u][1]=c;else{if(d===1)return[];n.splice(u,1),u--,d--}continue}n[u][2]=l,g>c&&n.push([e,c,g])}}}return n};var md,gh;class KS extends G{constructor(e,i,s){super();b(this,md);b(this,gh);p(this,gh,e),p(this,md,i),this.lastPoint=s}toSVGPath(){const e=[];for(const i of a(this,gh)){let[s,n]=i;e.push("M".concat(s," ").concat(n));for(let r=2;r<i.length;r+=2){const o=i[r],l=i[r+1];o===s?(e.push("V".concat(l)),n=l):l===n&&(e.push("H".concat(o)),s=o)}e.push("Z")}return e.join(" ")}serialize([e,i,s,n],r){const o=[],l=s-e,c=n-i;for(const u of a(this,gh)){const d=new Array(u.length);for(let f=0;f<u.length;f+=2)d[f]=e+u[f]*l,d[f+1]=n-u[f+1]*c;o.push(d)}return o}get box(){return a(this,md)}get classNamesForOutlining(){return["highlightOutline"]}}md=new WeakMap,gh=new WeakMap;class Wm extends Mp{newFreeDrawOutline(t,e,i,s,n,r){return new ZS(t,e,i,s,n,r)}}class ZS extends Gw{newOutliner(t,e,i,s,n,r=0){return new Wm(t,e,i,s,n,r)}}var mh,vd,An,fo,bd,Ke,yd,wd,po,Li,fi,we,vh,En,De,bh,Mi,Ad,nt,zm,ep,Qw,Jw,qw,Gm,pa,Bi,il,tA,ip,Ec,eA,iA,sA,nA,rA;const vt=class vt extends Rt{constructor(e){super({...e,name:"highlightEditor"});b(this,nt);b(this,mh,null);b(this,vd,0);b(this,An);b(this,fo,null);b(this,bd,null);b(this,Ke,null);b(this,yd,null);b(this,wd,0);b(this,po,null);b(this,Li,null);b(this,fi,null);b(this,we,!1);b(this,vh,null);b(this,En);b(this,De,null);b(this,bh,"");b(this,Mi);b(this,Ad,"");this.color=e.color||vt._defaultColor,p(this,Mi,e.thickness||vt._defaultThickness),p(this,En,e.opacity||vt._defaultOpacity),p(this,An,e.boxes||null),p(this,Ad,e.methodOfCreation||""),p(this,bh,e.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",e.highlightId>-1?(p(this,we,!0),m(this,nt,ep).call(this,e),m(this,nt,pa).call(this)):a(this,An)&&(p(this,mh,e.anchorNode),p(this,vd,e.anchorOffset),p(this,yd,e.focusNode),p(this,wd,e.focusOffset),m(this,nt,zm).call(this),m(this,nt,pa).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){const e=vt.prototype;return ct(this,"_keyboardManager",new gf([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:a(this,we)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:a(this,Mi),methodOfCreation:a(this,Ad)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}get commentColor(){return this.color}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}static initialize(e,i){var s;Rt.initialize(e,i),vt._defaultColor||(vt._defaultColor=((s=i.highlightColors)==null?void 0:s.values().next().value)||"#fff066")}static updateDefaultParams(e,i){switch(e){case ut.HIGHLIGHT_COLOR:vt._defaultColor=i;break;case ut.HIGHLIGHT_THICKNESS:vt._defaultThickness=i;break}}translateInPage(e,i){}get toolbarPosition(){return a(this,vh)}updateParams(e,i){switch(e){case ut.HIGHLIGHT_COLOR:m(this,nt,Qw).call(this,i);break;case ut.HIGHLIGHT_THICKNESS:m(this,nt,Jw).call(this,i);break}}static get defaultPropertiesToUpdate(){return[[ut.HIGHLIGHT_COLOR,vt._defaultColor],[ut.HIGHLIGHT_THICKNESS,vt._defaultThickness]]}get propertiesToUpdate(){return[[ut.HIGHLIGHT_COLOR,this.color||vt._defaultColor],[ut.HIGHLIGHT_THICKNESS,a(this,Mi)||vt._defaultThickness],[ut.HIGHLIGHT_FREE,a(this,we)]]}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",p(this,bd,new Aw({editor:this}))]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(m(this,nt,Ec).call(this))}getBaseTranslation(){return[0,0]}getRect(e,i){return super.getRect(e,i,m(this,nt,Ec).call(this))}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){m(this,nt,Gm).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(m(this,nt,pa).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){var s;let i=!1;this.parent&&!e?m(this,nt,Gm).call(this):e&&(m(this,nt,pa).call(this,e),i=!this.parent&&((s=this.div)==null?void 0:s.classList.contains("selectedEditor"))),super.setParent(e),this.show(this._isVisible),i&&this.select()}rotate(e){var n,r,o;const{drawLayer:i}=this.parent;let s;a(this,we)?(e=(e-this.rotation+360)%360,s=m(n=vt,Bi,il).call(n,a(this,Li).box,e)):s=m(r=vt,Bi,il).call(r,[this.x,this.y,this.width,this.height],e),i.updateProperties(a(this,fi),{bbox:s,root:{"data-main-rotation":e}}),i.updateProperties(a(this,De),{bbox:m(o=vt,Bi,il).call(o,a(this,Ke).box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;const e=super.render();a(this,bh)&&(e.setAttribute("aria-label",a(this,bh)),e.setAttribute("role","mark")),a(this,we)?e.classList.add("free"):this.div.addEventListener("keydown",m(this,nt,tA).bind(this),{signal:this._uiManager._signal});const i=p(this,po,document.createElement("div"));e.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",i.style.clipPath=a(this,fo);const[s,n]=this.parentDimensions;return this.setDims(this.width*s,this.height*n),Sy(this,a(this,po),["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){var e;this.isSelected||(e=this.parent)==null||e.drawLayer.updateProperties(a(this,De),{rootClass:{hovered:!0}})}pointerleave(){var e;this.isSelected||(e=this.parent)==null||e.drawLayer.updateProperties(a(this,De),{rootClass:{hovered:!1}})}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:m(this,nt,ip).call(this,!0);break;case 1:case 3:m(this,nt,ip).call(this,!1);break}}select(){var e;super.select(),a(this,De)&&((e=this.parent)==null||e.drawLayer.updateProperties(a(this,De),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var e;super.unselect(),a(this,De)&&((e=this.parent)==null||e.drawLayer.updateProperties(a(this,De),{rootClass:{selected:!1}}),a(this,we)||m(this,nt,ip).call(this,!1))}get _mustFixPosition(){return!a(this,we)}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(a(this,fi),{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(a(this,De),{rootClass:{hidden:!e}}))}static startHighlighting(e,i,{target:s,x:n,y:r}){const{x:o,y:l,width:c,height:u}=s.getBoundingClientRect(),d=new AbortController,f=e.combinedSignal(d),g=v=>{d.abort(),m(this,Bi,nA).call(this,e,v)};window.addEventListener("blur",g,{signal:f}),window.addEventListener("pointerup",g,{signal:f}),window.addEventListener("pointerdown",Qt,{capture:!0,passive:!1,signal:f}),window.addEventListener("contextmenu",Vi,{signal:f}),s.addEventListener("pointermove",m(this,Bi,sA).bind(this,e),{signal:f}),this._freeHighlight=new Wm({x:n,y:r},[o,l,c,u],e.scale,this._defaultThickness/2,i,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static async deserialize(e,i,s){var y,w,A,S;let n=null;if(e instanceof Lw){const{data:{quadPoints:E,rect:x,rotation:C,id:P,color:F,opacity:I,popupRef:T,contentsObj:R},parent:{page:{pageNumber:_}}}=e;n=e={annotationType:J.HIGHLIGHT,color:Array.from(F),opacity:I,quadPoints:E,boxes:null,pageIndex:_-1,rect:x.slice(0),rotation:C,annotationElementId:P,id:P,deleted:!1,popupRef:T,comment:(R==null?void 0:R.str)||null}}else if(e instanceof u0){const{data:{inkLists:E,rect:x,rotation:C,id:P,color:F,borderStyle:{rawWidth:I},popupRef:T,contentsObj:R},parent:{page:{pageNumber:_}}}=e;n=e={annotationType:J.HIGHLIGHT,color:Array.from(F),thickness:I,inkLists:E,boxes:null,pageIndex:_-1,rect:x.slice(0),rotation:C,annotationElementId:P,id:P,deleted:!1,popupRef:T,comment:(R==null?void 0:R.str)||null}}const{color:r,quadPoints:o,inkLists:l,opacity:c}=e,u=await super.deserialize(e,i,s);u.color=Q.makeHexColor(...r),p(u,En,c||1),l&&p(u,Mi,e.thickness),u._initialData=n,e.comment&&u.setCommentData(e.comment);const[d,f]=u.pageDimensions,[g,v]=u.pageTranslation;if(o){const E=p(u,An,[]);for(let x=0;x<o.length;x+=8)E.push({x:(o[x]-g)/d,y:1-(o[x+1]-v)/f,width:(o[x+2]-o[x])/d,height:(o[x+1]-o[x+5])/f});m(y=u,nt,zm).call(y),m(w=u,nt,pa).call(w),u.rotate(u.rotation)}else if(l){p(u,we,!0);const E=l[0],x={x:E[0]-g,y:f-(E[1]-v)},C=new Wm(x,[0,0,d,f],1,a(u,Mi)/2,!0,.001);for(let I=0,T=E.length;I<T;I+=2)x.x=E[I]-g,x.y=f-(E[I+1]-v),C.add(x);const{id:P,clipPathId:F}=i.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:u.color,"fill-opacity":u._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:C.toSVGPath()}},!0,!0);m(A=u,nt,ep).call(A,{highlightOutlines:C.getOutlines(),highlightId:P,clipPathId:F}),m(S=u,nt,pa).call(S),u.rotate(u.parentRotation)}return u}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();const i=this.getRect(0,0),s=Rt._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),n={annotationType:J.HIGHLIGHT,color:s,opacity:a(this,En),thickness:a(this,Mi),quadPoints:m(this,nt,eA).call(this),outlines:m(this,nt,iA).call(this,i),pageIndex:this.pageIndex,rect:i,rotation:m(this,nt,Ec).call(this),structTreeParentId:this._structTreeParentId};return this.addComment(n),this.annotationElementId&&!m(this,nt,rA).call(this,n)?null:(n.id=this.annotationElementId,n)}renderAnnotationElement(e){const i={rect:this.getRect(0,0)};return this.hasEditedComment&&(i.popup=this.comment),e.updateEdited(i),null}static canCreateNewEmptyEditor(){return!1}};mh=new WeakMap,vd=new WeakMap,An=new WeakMap,fo=new WeakMap,bd=new WeakMap,Ke=new WeakMap,yd=new WeakMap,wd=new WeakMap,po=new WeakMap,Li=new WeakMap,fi=new WeakMap,we=new WeakMap,vh=new WeakMap,En=new WeakMap,De=new WeakMap,bh=new WeakMap,Mi=new WeakMap,Ad=new WeakMap,nt=new WeakSet,zm=function(){const e=new $m(a(this,An),.001);p(this,Li,e.getOutlines()),[this.x,this.y,this.width,this.height]=a(this,Li).box;const i=new $m(a(this,An),.0025,.001,this._uiManager.direction==="ltr");p(this,Ke,i.getOutlines());const{lastPoint:s}=a(this,Ke);p(this,vh,[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height])},ep=function({highlightOutlines:e,highlightId:i,clipPathId:s}){var d,f;if(p(this,Li,e),p(this,Ke,e.getNewOutline(a(this,Mi)/2+1.5,.0025)),i>=0)p(this,fi,i),p(this,fo,s),this.parent.drawLayer.finalizeDraw(i,{bbox:e.box,path:{d:e.toSVGPath()}}),p(this,De,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:a(this,Ke).box,path:{d:a(this,Ke).toSVGPath()}},!0));else if(this.parent){const g=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(a(this,fi),{bbox:m(d=vt,Bi,il).call(d,a(this,Li).box,(g-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(a(this,De),{bbox:m(f=vt,Bi,il).call(f,a(this,Ke).box,g),path:{d:a(this,Ke).toSVGPath()}})}const[r,o,l,c]=e.box;switch(this.rotation){case 0:this.x=r,this.y=o,this.width=l,this.height=c;break;case 90:{const[g,v]=this.parentDimensions;this.x=o,this.y=1-r,this.width=l*v/g,this.height=c*g/v;break}case 180:this.x=1-r,this.y=1-o,this.width=l,this.height=c;break;case 270:{const[g,v]=this.parentDimensions;this.x=1-o,this.y=r,this.width=l*v/g,this.height=c*g/v;break}}const{lastPoint:u}=a(this,Ke);p(this,vh,[(u[0]-r)/l,(u[1]-o)/c])},Qw=function(e){const i=(r,o)=>{var l,c;this.color=r,p(this,En,o),(l=this.parent)==null||l.drawLayer.updateProperties(a(this,fi),{root:{fill:r,"fill-opacity":o}}),(c=a(this,bd))==null||c.updateColor(r)},s=this.color,n=a(this,En);this.addCommands({cmd:i.bind(this,e,vt._defaultOpacity),undo:i.bind(this,s,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ut.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(e)},!0)},Jw=function(e){const i=a(this,Mi),s=n=>{p(this,Mi,n),m(this,nt,qw).call(this,n)};this.addCommands({cmd:s.bind(this,e),undo:s.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ut.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)},qw=function(e){if(!a(this,we))return;m(this,nt,ep).call(this,{highlightOutlines:a(this,Li).getNewOutline(e/2)}),this.fixAndSetPosition();const[i,s]=this.parentDimensions;this.setDims(this.width*i,this.height*s)},Gm=function(){a(this,fi)===null||!this.parent||(this.parent.drawLayer.remove(a(this,fi)),p(this,fi,null),this.parent.drawLayer.remove(a(this,De)),p(this,De,null))},pa=function(e=this.parent){a(this,fi)===null&&({id:ge(this,fi)._,clipPathId:ge(this,fo)._}=e.drawLayer.draw({bbox:a(this,Li).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":a(this,En)},rootClass:{highlight:!0,free:a(this,we)},path:{d:a(this,Li).toSVGPath()}},!1,!0),p(this,De,e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:a(this,we)},bbox:a(this,Ke).box,path:{d:a(this,Ke).toSVGPath()}},a(this,we))),a(this,po)&&(a(this,po).style.clipPath=a(this,fo)))},Bi=new WeakSet,il=function([e,i,s,n],r){switch(r){case 90:return[1-i-n,e,n,s];case 180:return[1-e-s,1-i-n,s,n];case 270:return[i,1-e-s,n,s]}return[e,i,s,n]},tA=function(e){vt._keyboardManager.exec(this,e)},ip=function(e){if(!a(this,mh))return;const i=window.getSelection();e?i.setPosition(a(this,mh),a(this,vd)):i.setPosition(a(this,yd),a(this,wd))},Ec=function(){return a(this,we)?this.rotation:0},eA=function(){if(a(this,we))return null;const[e,i]=this.pageDimensions,[s,n]=this.pageTranslation,r=a(this,An),o=new Float32Array(r.length*8);let l=0;for(const{x:c,y:u,width:d,height:f}of r){const g=c*e+s,v=(1-u)*i+n;o[l]=o[l+4]=g,o[l+1]=o[l+3]=v,o[l+2]=o[l+6]=g+d*e,o[l+5]=o[l+7]=v-f*i,l+=8}return o},iA=function(e){return a(this,Li).serialize(e,m(this,nt,Ec).call(this))},sA=function(e,i){this._freeHighlight.add(i)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},nA=function(e,i){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(i,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},rA=function(e){const{color:i}=this._initialData;return this.hasEditedComment||e.color.some((s,n)=>s!==i[n])},b(vt,Bi),M(vt,"_defaultColor",null),M(vt,"_defaultOpacity",1),M(vt,"_defaultThickness",12),M(vt,"_type","highlight"),M(vt,"_editorType",J.HIGHLIGHT),M(vt,"_freeHighlightId",-1),M(vt,"_freeHighlight",null),M(vt,"_freeHighlightClipId","");let Np=vt;var go;class aA{constructor(){b(this,go,Object.create(null))}updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(const[e,i]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,i)}updateSVGProperty(t,e){a(this,go)[t]=e}toSVGProperties(){const t=a(this,go);return p(this,go,Object.create(null)),{root:t}}reset(){p(this,go,Object.create(null))}updateAll(t=this){this.updateProperties(t)}clone(){Pt("Not implemented")}}go=new WeakMap;var pi,yh,he,mo,vo,Fr,Ir,Rr,bo,pt,Xm,Ym,Km,Sc,oA,sp,xc,sl;const X=class X extends Rt{constructor(e){super(e);b(this,pt);b(this,pi,null);b(this,yh);M(this,"_colorPicker",null);M(this,"_drawId",null);p(this,yh,e.mustBeCommitted||!1),this._addOutlines(e)}_addOutlines(e){e.drawOutlines&&(m(this,pt,Xm).call(this,e),m(this,pt,Sc).call(this))}static _mergeSVGProperties(e,i){const s=new Set(Object.keys(e));for(const[n,r]of Object.entries(i))s.has(n)?Object.assign(e[n],r):e[n]=r;return e}static getDefaultDrawingOptions(e){Pt("Not implemented")}static get typesMap(){Pt("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(e,i){const s=this.typesMap.get(e);s&&this._defaultDrawingOptions.updateProperty(s,i),this._currentParent&&(a(X,he).updateProperty(s,i),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,i){const s=this.constructor.typesMap.get(e);s&&this._updateProperty(e,s,i)}static get defaultPropertiesToUpdate(){const e=[],i=this._defaultDrawingOptions;for(const[s,n]of this.typesMap)e.push([s,i[n]]);return e}get propertiesToUpdate(){const e=[],{_drawingOptions:i}=this;for(const[s,n]of this.constructor.typesMap)e.push([s,i[n]]);return e}_updateProperty(e,i,s){const n=this._drawingOptions,r=n[i],o=l=>{var u,d;n.updateProperty(i,l);const c=a(this,pi).updateProperty(i,l);c&&m(this,pt,xc).call(this,c),(u=this.parent)==null||u.drawLayer.updateProperties(this._drawId,n.toSVGProperties()),e===this.colorType&&((d=this._colorPicker)==null||d.update(l))};this.addCommands({cmd:o.bind(this,s),undo:o.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,X._mergeSVGProperties(a(this,pi).getPathResizingSVGProperties(m(this,pt,sp).call(this)),{bbox:m(this,pt,sl).call(this)}))}_onResized(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,X._mergeSVGProperties(a(this,pi).getPathResizedSVGProperties(m(this,pt,sp).call(this)),{bbox:m(this,pt,sl).call(this)}))}_onTranslating(e,i){var s;(s=this.parent)==null||s.drawLayer.updateProperties(this._drawId,{bbox:m(this,pt,sl).call(this)})}_onTranslated(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,X._mergeSVGProperties(a(this,pi).getPathTranslatedSVGProperties(m(this,pt,sp).call(this),this.parentDimensions),{bbox:m(this,pt,sl).call(this)}))}_onStartDragging(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,a(this,yh)&&(p(this,yh,!1),this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){m(this,pt,Km).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(m(this,pt,Sc).call(this),m(this,pt,xc).call(this,a(this,pi).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){var s;let i=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),m(this,pt,Km).call(this)):e&&(this._uiManager.addShouldRescale(this),m(this,pt,Sc).call(this,e),i=!this.parent&&((s=this.div)==null?void 0:s.classList.contains("selectedEditor"))),super.setParent(e),i&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,X._mergeSVGProperties({bbox:m(this,pt,sl).call(this)},a(this,pi).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&m(this,pt,xc).call(this,a(this,pi).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e,i;this._isCopy&&(e=this.x,i=this.y);const s=super.render();s.classList.add("draw");const n=document.createElement("div");s.append(n),n.setAttribute("aria-hidden","true"),n.className="internal";const[r,o]=this.parentDimensions;return this.setDims(this.width*r,this.height*o),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,i),s}static createDrawerInstance(e,i,s,n,r){Pt("Not implemented")}static startDrawing(e,i,s,n){var w,A;const{target:r,offsetX:o,offsetY:l,pointerId:c,pointerType:u}=n;if(a(X,Ir)&&a(X,Ir)!==u)return;const{viewport:{rotation:d}}=e,{width:f,height:g}=r.getBoundingClientRect(),v=p(X,mo,new AbortController),y=e.combinedSignal(v);if(a(X,Fr)||p(X,Fr,c),(w=a(X,Ir))!=null||p(X,Ir,u),window.addEventListener("pointerup",S=>{var E;a(X,Fr)===S.pointerId?this._endDraw(S):(E=a(X,Rr))==null||E.delete(S.pointerId)},{signal:y}),window.addEventListener("pointercancel",S=>{var E;a(X,Fr)===S.pointerId?this._currentParent.endDrawingSession():(E=a(X,Rr))==null||E.delete(S.pointerId)},{signal:y}),window.addEventListener("pointerdown",S=>{a(X,Ir)===S.pointerType&&((a(X,Rr)||p(X,Rr,new Set)).add(S.pointerId),a(X,he).isCancellable()&&(a(X,he).removeLastElement(),a(X,he).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:y}),window.addEventListener("contextmenu",Vi,{signal:y}),r.addEventListener("pointermove",this._drawMove.bind(this),{signal:y}),r.addEventListener("touchmove",S=>{S.timeStamp===a(X,bo)&&Qt(S)},{signal:y}),e.toggleDrawing(),(A=i._editorUndoBar)==null||A.hide(),a(X,he)){e.drawLayer.updateProperties(this._currentDrawId,a(X,he).startNew(o,l,f,g,d));return}i.updateUIForDefaultProperties(this),p(X,he,this.createDrawerInstance(o,l,f,g,d)),p(X,vo,this.getDefaultDrawingOptions()),this._currentParent=e,{id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(a(X,vo).toSVGProperties(),a(X,he).defaultSVGProperties),!0,!1)}static _drawMove(e){var r;if(p(X,bo,-1),!a(X,he))return;const{offsetX:i,offsetY:s,pointerId:n}=e;if(a(X,Fr)===n){if(((r=a(X,Rr))==null?void 0:r.size)>=1){this._endDraw(e);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,a(X,he).add(i,s)),p(X,bo,e.timeStamp),Qt(e)}}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,p(X,he,null),p(X,vo,null),p(X,Ir,null),p(X,bo,NaN)),a(X,mo)&&(a(X,mo).abort(),p(X,mo,null),p(X,Fr,NaN),p(X,Rr,null))}static _endDraw(e){const i=this._currentParent;if(i){if(i.toggleDrawing(!0),this._cleanup(!1),(e==null?void 0:e.target)===i.div&&i.drawLayer.updateProperties(this._currentDrawId,a(X,he).end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){const s=a(X,he),n=this._currentDrawId,r=s.getLastElement();i.addCommands({cmd:()=>{i.drawLayer.updateProperties(n,s.setLastElement(r))},undo:()=>{i.drawLayer.updateProperties(n,s.removeLastElement())},mustExec:!1,type:ut.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(e){const i=this._currentParent;if(!i)return null;if(i.toggleDrawing(!0),i.cleanUndoStack(ut.DRAW_STEP),!a(X,he).isEmpty()){const{pageDimensions:[s,n],scale:r}=i,o=i.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:a(X,he).getOutlines(s*r,n*r,r,this._INNER_MARGIN),drawingOptions:a(X,vo),mustBeCommitted:!e});return this._cleanup(!0),o}return i.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,i,s,n,r,o){Pt("Not implemented")}static async deserialize(e,i,s){var d,f;const{rawDims:{pageWidth:n,pageHeight:r,pageX:o,pageY:l}}=i.viewport,c=this.deserializeDraw(o,l,n,r,this._INNER_MARGIN,e),u=await super.deserialize(e,i,s);return u.createDrawingOptions(e),m(d=u,pt,Xm).call(d,{drawOutlines:c}),m(f=u,pt,Sc).call(f),u.onScaleChanging(),u.rotate(),u}serializeDraw(e){const[i,s]=this.pageTranslation,[n,r]=this.pageDimensions;return a(this,pi).serialize([i,s,n,r],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}};pi=new WeakMap,yh=new WeakMap,he=new WeakMap,mo=new WeakMap,vo=new WeakMap,Fr=new WeakMap,Ir=new WeakMap,Rr=new WeakMap,bo=new WeakMap,pt=new WeakSet,Xm=function({drawOutlines:e,drawId:i,drawingOptions:s}){p(this,pi,e),this._drawingOptions||(this._drawingOptions=s),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-".concat(this.editorType,"-added-alert")),i>=0?(this._drawId=i,this.parent.drawLayer.finalizeDraw(i,e.defaultProperties)):this._drawId=m(this,pt,Ym).call(this,e,this.parent),m(this,pt,xc).call(this,e.box)},Ym=function(e,i){const{id:s}=i.drawLayer.draw(X._mergeSVGProperties(this._drawingOptions.toSVGProperties(),e.defaultSVGProperties),!1,!1);return s},Km=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},Sc=function(e=this.parent){if(!(this._drawId!==null&&this.parent===e)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,e.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=m(this,pt,Ym).call(this,a(this,pi),e)}},oA=function([e,i,s,n]){const{parentDimensions:[r,o],rotation:l}=this;switch(l){case 90:return[i,1-e,s*(o/r),n*(r/o)];case 180:return[1-e,1-i,s,n];case 270:return[1-i,e,s*(o/r),n*(r/o)];default:return[e,i,s,n]}},sp=function(){const{x:e,y:i,width:s,height:n,parentDimensions:[r,o],rotation:l}=this;switch(l){case 90:return[1-i,e,s*(r/o),n*(o/r)];case 180:return[1-e,1-i,s,n];case 270:return[i,1-e,s*(r/o),n*(o/r)];default:return[e,i,s,n]}},xc=function(e){if([this.x,this.y,this.width,this.height]=m(this,pt,oA).call(this,e),this.div){this.fixAndSetPosition();const[i,s]=this.parentDimensions;this.setDims(this.width*i,this.height*s)}this._onResized()},sl=function(){const{x:e,y:i,width:s,height:n,rotation:r,parentRotation:o,parentDimensions:[l,c]}=this;switch((r*4+o)/90){case 1:return[1-i-n,e,n,s];case 2:return[1-e-s,1-i-n,s,n];case 3:return[i,1-e-s,n,s];case 4:return[e,i-s*(l/c),n*(c/l),s*(l/c)];case 5:return[1-i,e,s*(l/c),n*(c/l)];case 6:return[1-e-n*(c/l),1-i,n*(c/l),s*(l/c)];case 7:return[i-s*(l/c),1-e-n*(c/l),s*(l/c),n*(c/l)];case 8:return[e-s,i-n,s,n];case 9:return[1-i,e-s,n,s];case 10:return[1-e,1-i,s,n];case 11:return[i-n,1-e,n,s];case 12:return[e-n*(c/l),i,n*(c/l),s*(l/c)];case 13:return[1-i-s*(l/c),e-n*(c/l),s*(l/c),n*(c/l)];case 14:return[1-e,1-i-s*(l/c),n*(c/l),s*(l/c)];case 15:return[i,1-e,s*(l/c),n*(c/l)];default:return[e,i,s,n]}},M(X,"_currentDrawId",-1),M(X,"_currentParent",null),b(X,he,null),b(X,mo,null),b(X,vo,null),b(X,Fr,NaN),b(X,Ir,null),b(X,Rr,null),b(X,bo,NaN),M(X,"_INNER_MARGIN",3);let Op=X;var Ts,ce,ue,yo,wh,Oe,Ae,Ni,wo,Ao,Eo,Ah,np;class QS{constructor(t,e,i,s,n,r){b(this,Ah);b(this,Ts,new Float64Array(6));b(this,ce);b(this,ue);b(this,yo);b(this,wh);b(this,Oe);b(this,Ae,"");b(this,Ni,0);b(this,wo,new vf);b(this,Ao);b(this,Eo);p(this,Ao,i),p(this,Eo,s),p(this,yo,n),p(this,wh,r),[t,e]=m(this,Ah,np).call(this,t,e);const o=p(this,ce,[NaN,NaN,NaN,NaN,t,e]);p(this,Oe,[t,e]),p(this,ue,[{line:o,points:a(this,Oe)}]),a(this,Ts).set(o,0)}updateProperty(t,e){t==="stroke-width"&&p(this,wh,e)}isEmpty(){return!a(this,ue)||a(this,ue).length===0}isCancellable(){return a(this,Oe).length<=10}add(t,e){[t,e]=m(this,Ah,np).call(this,t,e);const[i,s,n,r]=a(this,Ts).subarray(2,6),o=t-n,l=e-r;return Math.hypot(a(this,Ao)*o,a(this,Eo)*l)<=2?null:(a(this,Oe).push(t,e),isNaN(i)?(a(this,Ts).set([n,r,t,e],2),a(this,ce).push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(a(this,Ts)[0])&&a(this,ce).splice(6,6),a(this,Ts).set([i,s,n,r,t,e],0),a(this,ce).push(...G.createBezierPoints(i,s,n,r,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){const i=this.add(t,e);return i||(a(this,Oe).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,i,s,n){p(this,Ao,i),p(this,Eo,s),p(this,yo,n),[t,e]=m(this,Ah,np).call(this,t,e);const r=p(this,ce,[NaN,NaN,NaN,NaN,t,e]);p(this,Oe,[t,e]);const o=a(this,ue).at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),a(this,ue).push({line:r,points:a(this,Oe)}),a(this,Ts).set(r,0),p(this,Ni,0),this.toSVGPath(),null}getLastElement(){return a(this,ue).at(-1)}setLastElement(t){return a(this,ue)?(a(this,ue).push(t),p(this,ce,t.line),p(this,Oe,t.points),p(this,Ni,0),{path:{d:this.toSVGPath()}}):a(this,wo).setLastElement(t)}removeLastElement(){if(!a(this,ue))return a(this,wo).removeLastElement();a(this,ue).pop(),p(this,Ae,"");for(let t=0,e=a(this,ue).length;t<e;t++){const{line:i,points:s}=a(this,ue)[t];p(this,ce,i),p(this,Oe,s),p(this,Ni,0),this.toSVGPath()}return{path:{d:a(this,Ae)}}}toSVGPath(){const t=G.svgRound(a(this,ce)[4]),e=G.svgRound(a(this,ce)[5]);if(a(this,Oe).length===2)return p(this,Ae,"".concat(a(this,Ae)," M ").concat(t," ").concat(e," Z")),a(this,Ae);if(a(this,Oe).length<=6){const s=a(this,Ae).lastIndexOf("M");p(this,Ae,"".concat(a(this,Ae).slice(0,s)," M ").concat(t," ").concat(e)),p(this,Ni,6)}if(a(this,Oe).length===4){const s=G.svgRound(a(this,ce)[10]),n=G.svgRound(a(this,ce)[11]);return p(this,Ae,"".concat(a(this,Ae)," L ").concat(s," ").concat(n)),p(this,Ni,12),a(this,Ae)}const i=[];a(this,Ni)===0&&(i.push("M ".concat(t," ").concat(e)),p(this,Ni,6));for(let s=a(this,Ni),n=a(this,ce).length;s<n;s+=6){const[r,o,l,c,u,d]=a(this,ce).slice(s,s+6).map(G.svgRound);i.push("C".concat(r," ").concat(o," ").concat(l," ").concat(c," ").concat(u," ").concat(d))}return p(this,Ae,a(this,Ae)+i.join(" ")),p(this,Ni,a(this,ce).length),a(this,Ae)}getOutlines(t,e,i,s){const n=a(this,ue).at(-1);return n.line=new Float32Array(n.line),n.points=new Float32Array(n.points),a(this,wo).build(a(this,ue),t,e,i,a(this,yo),a(this,wh),s),p(this,Ts,null),p(this,ce,null),p(this,ue,null),p(this,Ae,null),a(this,wo)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}Ts=new WeakMap,ce=new WeakMap,ue=new WeakMap,yo=new WeakMap,wh=new WeakMap,Oe=new WeakMap,Ae=new WeakMap,Ni=new WeakMap,wo=new WeakMap,Ao=new WeakMap,Eo=new WeakMap,Ah=new WeakSet,np=function(t,e){return G._normalizePoint(t,e,a(this,Ao),a(this,Eo),a(this,yo))};var ke,Ed,Sd,gi,Fs,Is,Eh,Sh,So,Ce,Ws,lA,hA,cA;class vf extends G{constructor(){super(...arguments);b(this,Ce);b(this,ke);b(this,Ed,0);b(this,Sd);b(this,gi);b(this,Fs);b(this,Is);b(this,Eh);b(this,Sh);b(this,So)}build(e,i,s,n,r,o,l){p(this,Fs,i),p(this,Is,s),p(this,Eh,n),p(this,Sh,r),p(this,So,o),p(this,Sd,l!=null?l:0),p(this,gi,e),m(this,Ce,hA).call(this)}get thickness(){return a(this,So)}setLastElement(e){return a(this,gi).push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return a(this,gi).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const e=[];for(const{line:i}of a(this,gi)){if(e.push("M".concat(G.svgRound(i[4])," ").concat(G.svgRound(i[5]))),i.length===6){e.push("Z");continue}if(i.length===12&&isNaN(i[6])){e.push("L".concat(G.svgRound(i[10])," ").concat(G.svgRound(i[11])));continue}for(let s=6,n=i.length;s<n;s+=6){const[r,o,l,c,u,d]=i.subarray(s,s+6).map(G.svgRound);e.push("C".concat(r," ").concat(o," ").concat(l," ").concat(c," ").concat(u," ").concat(d))}}return e.join("")}serialize([e,i,s,n],r){const o=[],l=[],[c,u,d,f]=m(this,Ce,lA).call(this);let g,v,y,w,A,S,E,x,C;switch(a(this,Sh)){case 0:C=G._rescale,g=e,v=i+n,y=s,w=-n,A=e+c*s,S=i+(1-u-f)*n,E=e+(c+d)*s,x=i+(1-u)*n;break;case 90:C=G._rescaleAndSwap,g=e,v=i,y=s,w=n,A=e+u*s,S=i+c*n,E=e+(u+f)*s,x=i+(c+d)*n;break;case 180:C=G._rescale,g=e+s,v=i,y=-s,w=n,A=e+(1-c-d)*s,S=i+u*n,E=e+(1-c)*s,x=i+(u+f)*n;break;case 270:C=G._rescaleAndSwap,g=e+s,v=i+n,y=-s,w=-n,A=e+(1-u-f)*s,S=i+(1-c-d)*n,E=e+(1-u)*s,x=i+(1-c)*n;break}for(const{line:P,points:F}of a(this,gi))o.push(C(P,g,v,y,w,r?new Array(P.length):null)),l.push(C(F,g,v,y,w,r?new Array(F.length):null));return{lines:o,points:l,rect:[A,S,E,x]}}static deserialize(e,i,s,n,r,{paths:{lines:o,points:l},rotation:c,thickness:u}){const d=[];let f,g,v,y,w;switch(c){case 0:w=G._rescale,f=-e/s,g=i/n+1,v=1/s,y=-1/n;break;case 90:w=G._rescaleAndSwap,f=-i/n,g=-e/s,v=1/n,y=1/s;break;case 180:w=G._rescale,f=e/s+1,g=-i/n,v=-1/s,y=1/n;break;case 270:w=G._rescaleAndSwap,f=i/n+1,g=e/s+1,v=-1/n,y=-1/s;break}if(!o){o=[];for(const S of l){const E=S.length;if(E===2){o.push(new Float32Array([NaN,NaN,NaN,NaN,S[0],S[1]]));continue}if(E===4){o.push(new Float32Array([NaN,NaN,NaN,NaN,S[0],S[1],NaN,NaN,NaN,NaN,S[2],S[3]]));continue}const x=new Float32Array(3*(E-2));o.push(x);let[C,P,F,I]=S.subarray(0,4);x.set([NaN,NaN,NaN,NaN,C,P],0);for(let T=4;T<E;T+=2){const R=S[T],_=S[T+1];x.set(G.createBezierPoints(C,P,F,I,R,_),(T-2)*3),[C,P,F,I]=[F,I,R,_]}}}for(let S=0,E=o.length;S<E;S++)d.push({line:w(o[S].map(x=>x!=null?x:NaN),f,g,v,y),points:w(l[S].map(x=>x!=null?x:NaN),f,g,v,y)});const A=new this.prototype.constructor;return A.build(d,s,n,1,c,u,r),A}get box(){return a(this,ke)}updateProperty(e,i){return e==="stroke-width"?m(this,Ce,cA).call(this,i):null}updateParentDimensions([e,i],s){const[n,r]=m(this,Ce,Ws).call(this);p(this,Fs,e),p(this,Is,i),p(this,Eh,s);const[o,l]=m(this,Ce,Ws).call(this),c=o-n,u=l-r,d=a(this,ke);return d[0]-=c,d[1]-=u,d[2]+=2*c,d[3]+=2*u,d}updateRotation(e){return p(this,Ed,e),{path:{transform:this.rotationTransform}}}get viewBox(){return a(this,ke).map(G.svgRound).join(" ")}get defaultProperties(){const[e,i]=a(this,ke);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(G.svgRound(e)," ").concat(G.svgRound(i))}}}get rotationTransform(){const[,,e,i]=a(this,ke);let s=0,n=0,r=0,o=0,l=0,c=0;switch(a(this,Ed)){case 90:n=i/e,r=-e/i,l=e;break;case 180:s=-1,o=-1,l=e,c=i;break;case 270:n=-i/e,r=e/i,c=i;break;default:return""}return"matrix(".concat(s," ").concat(n," ").concat(r," ").concat(o," ").concat(G.svgRound(l)," ").concat(G.svgRound(c),")")}getPathResizingSVGProperties([e,i,s,n]){const[r,o]=m(this,Ce,Ws).call(this),[l,c,u,d]=a(this,ke);if(Math.abs(u-r)<=G.PRECISION||Math.abs(d-o)<=G.PRECISION){const w=e+s/2-(l+u/2),A=i+n/2-(c+d/2);return{path:{"transform-origin":"".concat(G.svgRound(e)," ").concat(G.svgRound(i)),transform:"".concat(this.rotationTransform," translate(").concat(w," ").concat(A,")")}}}const f=(s-2*r)/(u-2*r),g=(n-2*o)/(d-2*o),v=u/s,y=d/n;return{path:{"transform-origin":"".concat(G.svgRound(l)," ").concat(G.svgRound(c)),transform:"".concat(this.rotationTransform," scale(").concat(v," ").concat(y,") ")+"translate(".concat(G.svgRound(r)," ").concat(G.svgRound(o),") scale(").concat(f," ").concat(g,") ")+"translate(".concat(G.svgRound(-r)," ").concat(G.svgRound(-o),")")}}}getPathResizedSVGProperties([e,i,s,n]){const[r,o]=m(this,Ce,Ws).call(this),l=a(this,ke),[c,u,d,f]=l;if(l[0]=e,l[1]=i,l[2]=s,l[3]=n,Math.abs(d-r)<=G.PRECISION||Math.abs(f-o)<=G.PRECISION){const A=e+s/2-(c+d/2),S=i+n/2-(u+f/2);for(const{line:E,points:x}of a(this,gi))G._translate(E,A,S,E),G._translate(x,A,S,x);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(G.svgRound(e)," ").concat(G.svgRound(i)),transform:this.rotationTransform||null,d:this.toSVGPath()}}}const g=(s-2*r)/(d-2*r),v=(n-2*o)/(f-2*o),y=-g*(c+r)+e+r,w=-v*(u+o)+i+o;if(g!==1||v!==1||y!==0||w!==0)for(const{line:A,points:S}of a(this,gi))G._rescale(A,y,w,g,v,A),G._rescale(S,y,w,g,v,S);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(G.svgRound(e)," ").concat(G.svgRound(i)),transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,i],s){const[n,r]=s,o=a(this,ke),l=e-o[0],c=i-o[1];if(a(this,Fs)===n&&a(this,Is)===r)for(const{line:u,points:d}of a(this,gi))G._translate(u,l,c,u),G._translate(d,l,c,d);else{const u=a(this,Fs)/n,d=a(this,Is)/r;p(this,Fs,n),p(this,Is,r);for(const{line:f,points:g}of a(this,gi))G._rescale(f,l,c,u,d,f),G._rescale(g,l,c,u,d,g);o[2]*=u,o[3]*=d}return o[0]=e,o[1]=i,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":"".concat(G.svgRound(e)," ").concat(G.svgRound(i))}}}get defaultSVGProperties(){const e=a(this,ke);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":"".concat(G.svgRound(e[0])," ").concat(G.svgRound(e[1])),transform:this.rotationTransform||null},bbox:e}}}ke=new WeakMap,Ed=new WeakMap,Sd=new WeakMap,gi=new WeakMap,Fs=new WeakMap,Is=new WeakMap,Eh=new WeakMap,Sh=new WeakMap,So=new WeakMap,Ce=new WeakSet,Ws=function(e=a(this,So)){const i=a(this,Sd)+e/2*a(this,Eh);return a(this,Sh)%180===0?[i/a(this,Fs),i/a(this,Is)]:[i/a(this,Is),i/a(this,Fs)]},lA=function(){const[e,i,s,n]=a(this,ke),[r,o]=m(this,Ce,Ws).call(this,0);return[e+r,i+o,s-2*r,n-2*o]},hA=function(){const e=p(this,ke,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:n}of a(this,gi)){if(n.length<=12){for(let l=4,c=n.length;l<c;l+=6)Q.pointBoundingBox(n[l],n[l+1],e);continue}let r=n[4],o=n[5];for(let l=6,c=n.length;l<c;l+=6){const[u,d,f,g,v,y]=n.subarray(l,l+6);Q.bezierBoundingBox(r,o,u,d,f,g,v,y,e),r=v,o=y}}const[i,s]=m(this,Ce,Ws).call(this);e[0]=$e(e[0]-i,0,1),e[1]=$e(e[1]-s,0,1),e[2]=$e(e[2]+i,0,1),e[3]=$e(e[3]+s,0,1),e[2]-=e[0],e[3]-=e[1]},cA=function(e){const[i,s]=m(this,Ce,Ws).call(this);p(this,So,e);const[n,r]=m(this,Ce,Ws).call(this),[o,l]=[n-i,r-s],c=a(this,ke);return c[0]-=o,c[1]-=l,c[2]+=2*o,c[3]+=2*l,c};class mg extends aA{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:Rt._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,e){t==="stroke-width"&&(e!=null||(e=this["stroke-width"]),e*=this._viewParameters.realScale),super.updateSVGProperty(t,e)}clone(){const t=new mg(this._viewParameters);return t.updateAll(this),t}}var ng,uA;const dl=class dl extends Op{constructor(e){super({...e,name:"inkEditor"});b(this,ng);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(e,i){Rt.initialize(e,i),this._defaultDrawingOptions=new mg(i.viewParameters)}static getDefaultDrawingOptions(e){const i=this._defaultDrawingOptions.clone();return i.updateProperties(e),i}static get supportMultipleDrawings(){return!0}static get typesMap(){return ct(this,"typesMap",new Map([[ut.INK_THICKNESS,"stroke-width"],[ut.INK_COLOR,"stroke"],[ut.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,i,s,n,r){return new QS(e,i,s,n,r,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,i,s,n,r,o){return vf.deserialize(e,i,s,n,r,o)}static async deserialize(e,i,s){let n=null;if(e instanceof u0){const{data:{inkLists:o,rect:l,rotation:c,id:u,color:d,opacity:f,borderStyle:{rawWidth:g},popupRef:v,contentsObj:y},parent:{page:{pageNumber:w}}}=e;n=e={annotationType:J.INK,color:Array.from(d),thickness:g,opacity:f,paths:{points:o},boxes:null,pageIndex:w-1,rect:l.slice(0),rotation:c,annotationElementId:u,id:u,deleted:!1,popupRef:v,comment:(y==null?void 0:y.str)||null}}const r=await super.deserialize(e,i,s);return r._initialData=n,e.comment&&r.setCommentData(e.comment),r}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new Dp(this)),[["colorPicker",this._colorPicker]]}get colorType(){return ut.INK_COLOR}get colorValue(){return this._drawingOptions.stroke}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:e,_drawingOptions:i,parent:s}=this;i.updateSVGProperty("stroke-width"),s.drawLayer.updateProperties(e,i.toSVGProperties())}static onScaleChangingWhenDrawing(){const e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:i,opacity:s}){this._drawingOptions=dl.getDefaultDrawingOptions({stroke:Q.makeHexColor(...e),"stroke-width":i,"stroke-opacity":s})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:i,points:s,rect:n}=this.serializeDraw(e),{_drawingOptions:{stroke:r,"stroke-opacity":o,"stroke-width":l}}=this,c={annotationType:J.INK,color:Rt._colorManager.convert(r),opacity:o,thickness:l,paths:{lines:i,points:s},pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(c),e?(c.isCopy=!0,c):this.annotationElementId&&!m(this,ng,uA).call(this,c)?null:(c.id=this.annotationElementId,c)}renderAnnotationElement(e){const{points:i,rect:s}=this.serializeDraw(!1),n={rect:s,thickness:this._drawingOptions["stroke-width"],points:i};return this.hasEditedComment&&(n.popup=this.comment),e.updateEdited(n),null}};ng=new WeakSet,uA=function(e){const{color:i,thickness:s,opacity:n,pageIndex:r}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((o,l)=>o!==i[l])||e.thickness!==s||e.opacity!==n||e.pageIndex!==r},M(dl,"_type","ink"),M(dl,"_editorType",J.INK),M(dl,"_defaultDrawingOptions",null);let Zm=dl;class Qm extends vf{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}const Pf=8,nc=3;var oc,xo,wt,Jm,Zi,dA,fA,qm,rp,pA,gA,mA,tv,ev,vA;let nl=(oc=class{static extractContoursFromText(t,{fontFamily:e,fontStyle:i,fontWeight:s},n,r,o,l){let c=new OffscreenCanvas(1,1),u=c.getContext("2d",{alpha:!1});const d=200,f=u.font="".concat(i," ").concat(s," ").concat(d,"px ").concat(e),{actualBoundingBoxLeft:g,actualBoundingBoxRight:v,actualBoundingBoxAscent:y,actualBoundingBoxDescent:w,fontBoundingBoxAscent:A,fontBoundingBoxDescent:S,width:E}=u.measureText(t),x=1.5,C=Math.ceil(Math.max(Math.abs(g)+Math.abs(v)||0,E)*x),P=Math.ceil(Math.max(Math.abs(y)+Math.abs(w)||d,Math.abs(A)+Math.abs(S)||d)*x);c=new OffscreenCanvas(C,P),u=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),u.font=f,u.filter="grayscale(1)",u.fillStyle="white",u.fillRect(0,0,C,P),u.fillStyle="black",u.fillText(t,C*(x-1)/2,P*(3-x)/2);const F=m(this,wt,tv).call(this,u.getImageData(0,0,C,P).data),I=m(this,wt,mA).call(this,F),T=m(this,wt,ev).call(this,I),R=m(this,wt,qm).call(this,F,C,P,T);return this.processDrawnLines({lines:{curves:R,width:C,height:P},pageWidth:n,pageHeight:r,rotation:o,innerMargin:l,mustSmooth:!0,areContours:!0})}static process(t,e,i,s,n){const[r,o,l]=m(this,wt,vA).call(this,t),[c,u]=m(this,wt,gA).call(this,r,o,l,Math.hypot(o,l)*a(this,xo).sigmaSFactor,a(this,xo).sigmaR,a(this,xo).kernelSize),d=m(this,wt,ev).call(this,u),f=m(this,wt,qm).call(this,c,o,l,d);return this.processDrawnLines({lines:{curves:f,width:o,height:l},pageWidth:e,pageHeight:i,rotation:s,innerMargin:n,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:e,pageHeight:i,rotation:s,innerMargin:n,mustSmooth:r,areContours:o}){var S;s%180!==0&&([e,i]=[i,e]);const{curves:l,width:c,height:u}=t,d=(S=t.thickness)!=null?S:0,f=[],g=Math.min(e/c,i/u),v=g/e,y=g/i,w=[];for(const{points:E}of l){const x=r?m(this,wt,pA).call(this,E):E;if(!x)continue;w.push(x);const C=x.length,P=new Float32Array(C),F=new Float32Array(3*(C===2?2:C-2));if(f.push({line:F,points:P}),C===2){P[0]=x[0]*v,P[1]=x[1]*y,F.set([NaN,NaN,NaN,NaN,P[0],P[1]],0);continue}let[I,T,R,_]=x;I*=v,T*=y,R*=v,_*=y,P.set([I,T,R,_],0),F.set([NaN,NaN,NaN,NaN,I,T],0);for(let j=4;j<C;j+=2){const k=P[j]=x[j]*v,U=P[j+1]=x[j+1]*y;F.set(G.createBezierPoints(I,T,R,_,k,U),(j-2)*3),[I,T,R,_]=[R,_,k,U]}}if(f.length===0)return null;const A=o?new Qm:new vf;return A.build(f,e,i,1,s,o?0:d,n),{outline:A,newCurves:w,areContours:o,thickness:d,width:c,height:u}}static async compressSignature({outlines:t,areContours:e,thickness:i,width:s,height:n}){let r=1/0,o=-1/0,l=0;for(const E of t){l+=E.length;for(let x=2,C=E.length;x<C;x++){const P=E[x]-E[x-2];r=Math.min(r,P),o=Math.max(o,P)}}let c;r>=-128&&o<=127?c=Int8Array:r>=-32768&&o<=32767?c=Int16Array:c=Int32Array;const u=t.length,d=Pf+nc*u,f=new Uint32Array(d);let g=0;f[g++]=d*Uint32Array.BYTES_PER_ELEMENT+(l-2*u)*c.BYTES_PER_ELEMENT,f[g++]=0,f[g++]=s,f[g++]=n,f[g++]=e?0:1,f[g++]=Math.max(0,Math.floor(i!=null?i:0)),f[g++]=u,f[g++]=c.BYTES_PER_ELEMENT;for(const E of t)f[g++]=E.length-2,f[g++]=E[0],f[g++]=E[1];const v=new CompressionStream("deflate-raw"),y=v.writable.getWriter();await y.ready,y.write(f);const w=c.prototype.constructor;for(const E of t){const x=new w(E.length-2);for(let C=2,P=E.length;C<P;C++)x[C-2]=E[C]-E[C-2];y.write(x)}y.close();const A=await new Response(v.readable).arrayBuffer(),S=new Uint8Array(A);return py(S)}static async decompressSignature(t){try{const e=AE(t),{readable:i,writable:s}=new DecompressionStream("deflate-raw"),n=s.getWriter();await n.ready,n.write(e).then(async()=>{await n.ready,await n.close()}).catch(()=>{});let r=null,o=0;for await(const E of i)r||(r=new Uint8Array(new Uint32Array(E.buffer,0,4)[0])),r.set(E,o),o+=E.length;const l=new Uint32Array(r.buffer,0,r.length>>2),c=l[1];if(c!==0)throw new Error("Invalid version: ".concat(c));const u=l[2],d=l[3],f=l[4]===0,g=l[5],v=l[6],y=l[7],w=[],A=(Pf+nc*v)*Uint32Array.BYTES_PER_ELEMENT;let S;switch(y){case Int8Array.BYTES_PER_ELEMENT:S=new Int8Array(r.buffer,A);break;case Int16Array.BYTES_PER_ELEMENT:S=new Int16Array(r.buffer,A);break;case Int32Array.BYTES_PER_ELEMENT:S=new Int32Array(r.buffer,A);break}o=0;for(let E=0;E<v;E++){const x=l[nc*E+Pf],C=new Float32Array(x+2);w.push(C);for(let P=0;P<nc-1;P++)C[P]=l[nc*E+Pf+P+1];for(let P=0;P<x;P++)C[P+2]=C[P]+S[o++]}return{areContours:f,thickness:g,outlines:w,width:u,height:d}}catch(e){return it("decompressSignature: ".concat(e)),null}}},xo=new WeakMap,wt=new WeakSet,Jm=function(t,e,i,s){return i-=t,s-=e,i===0?s>0?0:4:i===1?s+6:2-s},Zi=new WeakMap,dA=function(t,e,i,s,n,r,o){const l=m(this,wt,Jm).call(this,i,s,n,r);for(let c=0;c<8;c++){const u=(-c+l-o+16)%8,d=a(this,Zi)[2*u],f=a(this,Zi)[2*u+1];if(t[(i+d)*e+(s+f)]!==0)return u}return-1},fA=function(t,e,i,s,n,r,o){const l=m(this,wt,Jm).call(this,i,s,n,r);for(let c=0;c<8;c++){const u=(c+l+o+16)%8,d=a(this,Zi)[2*u],f=a(this,Zi)[2*u+1];if(t[(i+d)*e+(s+f)]!==0)return u}return-1},qm=function(t,e,i,s){const n=t.length,r=new Int32Array(n);for(let u=0;u<n;u++)r[u]=t[u]<=s?1:0;for(let u=1;u<i-1;u++)r[u*e]=r[u*e+e-1]=0;for(let u=0;u<e;u++)r[u]=r[e*i-1-u]=0;let o=1,l;const c=[];for(let u=1;u<i-1;u++){l=1;for(let d=1;d<e-1;d++){const f=u*e+d,g=r[f];if(g===0)continue;let v=u,y=d;if(g===1&&r[f-1]===0)o+=1,y-=1;else if(g>=1&&r[f+1]===0)o+=1,y+=1,g>1&&(l=g);else{g!==1&&(l=Math.abs(g));continue}const w=[d,u],A=y===d+1,S={isHole:A,points:w,id:o,parent:0};c.push(S);let E;for(const _ of c)if(_.id===l){E=_;break}E?E.isHole?S.parent=A?E.parent:l:S.parent=A?l:E.parent:S.parent=A?l:0;const x=m(this,wt,dA).call(this,r,e,u,d,v,y,0);if(x===-1){r[f]=-o,r[f]!==1&&(l=Math.abs(r[f]));continue}let C=a(this,Zi)[2*x],P=a(this,Zi)[2*x+1];const F=u+C,I=d+P;v=F,y=I;let T=u,R=d;for(;;){const _=m(this,wt,fA).call(this,r,e,T,R,v,y,1);C=a(this,Zi)[2*_],P=a(this,Zi)[2*_+1];const j=T+C,k=R+P;w.push(k,j);const U=T*e+R;if(r[U+1]===0?r[U]=-o:r[U]===1&&(r[U]=o),j===u&&k===d&&T===F&&R===I){r[f]!==1&&(l=Math.abs(r[f]));break}else v=T,y=R,T=j,R=k}}}return c},rp=function(t,e,i,s){if(i-e<=4){for(let F=e;F<i-2;F+=2)s.push(t[F],t[F+1]);return}const n=t[e],r=t[e+1],o=t[i-4]-n,l=t[i-3]-r,c=Math.hypot(o,l),u=o/c,d=l/c,f=u*r-d*n,g=l/o,v=1/c,y=Math.atan(g),w=Math.cos(y),A=Math.sin(y),S=v*(Math.abs(w)+Math.abs(A)),E=v*(1-S+S**2),x=Math.max(Math.atan(Math.abs(A+w)*E),Math.atan(Math.abs(A-w)*E));let C=0,P=e;for(let F=e+2;F<i-2;F+=2){const I=Math.abs(f-u*t[F+1]+d*t[F]);I>C&&(P=F,C=I)}C>(c*x)**2?(m(this,wt,rp).call(this,t,e,P+2,s),m(this,wt,rp).call(this,t,P,i,s)):s.push(n,r)},pA=function(t){const e=[],i=t.length;return m(this,wt,rp).call(this,t,0,i,e),e.push(t[i-2],t[i-1]),e.length<=4?null:e},gA=function(t,e,i,s,n,r){const o=new Float32Array(r**2),l=-2*s**2,c=r>>1;for(let y=0;y<r;y++){const w=(y-c)**2;for(let A=0;A<r;A++)o[y*r+A]=Math.exp((w+(A-c)**2)/l)}const u=new Float32Array(256),d=-2*n**2;for(let y=0;y<256;y++)u[y]=Math.exp(y**2/d);const f=t.length,g=new Uint8Array(f),v=new Uint32Array(256);for(let y=0;y<i;y++)for(let w=0;w<e;w++){const A=y*e+w,S=t[A];let E=0,x=0;for(let P=0;P<r;P++){const F=y+P-c;if(!(F<0||F>=i))for(let I=0;I<r;I++){const T=w+I-c;if(T<0||T>=e)continue;const R=t[F*e+T],_=o[P*r+I]*u[Math.abs(R-S)];E+=R*_,x+=_}}const C=g[A]=Math.round(E/x);v[C]++}return[g,v]},mA=function(t){const e=new Uint32Array(256);for(const i of t)e[i]++;return e},tv=function(t){const e=t.length,i=new Uint8ClampedArray(e>>2);let s=-1/0,n=1/0;for(let o=0,l=i.length;o<l;o++){const c=i[o]=t[o<<2];s=Math.max(s,c),n=Math.min(n,c)}const r=255/(s-n);for(let o=0,l=i.length;o<l;o++)i[o]=(i[o]-n)*r;return i},ev=function(t){let e,i=-1/0,s=-1/0;const n=t.findIndex(l=>l!==0);let r=n,o=n;for(e=n;e<256;e++){const l=t[e];l>i&&(e-r>s&&(s=e-r,o=e-1),i=l,r=e)}for(e=o-1;e>=0&&!(t[e]>t[e+1]);e--);return e},vA=function(t){const e=t,{width:i,height:s}=t,{maxDim:n}=a(this,xo);let r=i,o=s;if(i>n||s>n){let f=i,g=s,v=Math.log2(Math.max(i,s)/n);const y=Math.floor(v);v=v===y?y-1:y;for(let A=0;A<v;A++){r=Math.ceil(f/2),o=Math.ceil(g/2);const S=new OffscreenCanvas(r,o);S.getContext("2d").drawImage(t,0,0,f,g,0,0,r,o),f=r,g=o,t!==e&&t.close(),t=S.transferToImageBitmap()}const w=Math.min(n/r,n/o);r=Math.round(r*w),o=Math.round(o*w)}const c=new OffscreenCanvas(r,o).getContext("2d",{willReadFrequently:!0});c.fillStyle="white",c.fillRect(0,0,r,o),c.filter="grayscale(1)",c.drawImage(t,0,0,t.width,t.height,0,0,r,o);const u=c.getImageData(0,0,r,o).data;return[m(this,wt,tv).call(this,u),r,o]},b(oc,wt),b(oc,xo,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),b(oc,Zi,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1])),oc);class d0 extends aA{constructor(){super(),super.updateProperties({fill:Rt._defaultLineColor,"stroke-width":0})}clone(){const t=new d0;return t.updateAll(this),t}}class f0 extends mg{constructor(t){super(t),super.updateProperties({stroke:Rt._defaultLineColor,"stroke-width":1})}clone(){const t=new f0(this._viewParameters);return t.updateAll(this),t}}var _r,Rs,Dr,Co;const ii=class ii extends Op{constructor(e){super({...e,mustBeCommitted:!0,name:"signatureEditor"});b(this,_r,!1);b(this,Rs,null);b(this,Dr,null);b(this,Co,null);this._willKeepAspectRatio=!0,p(this,Dr,e.signatureData||null),p(this,Rs,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(e,i){Rt.initialize(e,i),this._defaultDrawingOptions=new d0,this._defaultDrawnSignatureOptions=new f0(i.viewParameters)}static getDefaultDrawingOptions(e){const i=this._defaultDrawingOptions.clone();return i.updateProperties(e),i}static get supportMultipleDrawings(){return!1}static get typesMap(){return ct(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!a(this,Rs)}}static computeTelemetryFinalData(e){var s,n;const i=e.get("hasDescription");return{hasAltText:(s=i.get(!0))!=null?s:0,hasNoAltText:(n=i.get(!1))!=null?n:0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let e,i;const{_isCopy:s}=this;if(s&&(this._isCopy=!1,e=this.x,i=this.y),super.render(),this._drawId===null)if(a(this,Dr)){const{lines:n,mustSmooth:r,areContours:o,description:l,uuid:c,heightInPage:u}=a(this,Dr),{rawDims:{pageWidth:d,pageHeight:f},rotation:g}=this.parent.viewport,v=nl.processDrawnLines({lines:n,pageWidth:d,pageHeight:f,rotation:g,innerMargin:ii._INNER_MARGIN,mustSmooth:r,areContours:o});this.addSignature(v,u,l,c)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:a(this,Rs)||""}));return s&&(this._isCopy=!0,this._moveAfterPaste(e,i)),this.div}setUuid(e){p(this,Co,e),this.addEditToolbar()}getUuid(){return a(this,Co)}get description(){return a(this,Rs)}set description(e){p(this,Rs,e),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:e})),super.addEditToolbar().then(i=>{i==null||i.updateEditSignatureButton(e)}))}getSignaturePreview(){const{newCurves:e,areContours:i,thickness:s,width:n,height:r}=a(this,Dr),o=Math.max(n,r),l=nl.processDrawnLines({lines:{curves:e.map(c=>({points:c})),thickness:s,width:n,height:r},pageWidth:o,pageHeight:o,rotation:0,innerMargin:0,mustSmooth:!1,areContours:i});return{areContours:i,outline:l.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(e,i,s,n){const{x:r,y:o}=this,{outline:l}=p(this,Dr,e);p(this,_r,l instanceof Qm),this.description=s;let c;a(this,_r)?c=ii.getDefaultDrawingOptions():(c=ii._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":l.thickness})),this._addOutlines({drawOutlines:l,drawingOptions:c});const[u,d]=this.parentDimensions,[,f]=this.pageDimensions;let g=i/f;g=g>=1?.5:g,this.width*=g/this.height,this.width>=1&&(g*=.9/this.width,this.width=.9),this.height=g,this.setDims(u*this.width,d*this.height),this.x=r,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(n),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!n,hasDescription:!!s}}),this.div.hidden=!1}getFromImage(e){const{rawDims:{pageWidth:i,pageHeight:s},rotation:n}=this.parent.viewport;return nl.process(e,i,s,n,ii._INNER_MARGIN)}getFromText(e,i){const{rawDims:{pageWidth:s,pageHeight:n},rotation:r}=this.parent.viewport;return nl.extractContoursFromText(e,i,s,n,r,ii._INNER_MARGIN)}getDrawnSignature(e){const{rawDims:{pageWidth:i,pageHeight:s},rotation:n}=this.parent.viewport;return nl.processDrawnLines({lines:e,pageWidth:i,pageHeight:s,rotation:n,innerMargin:ii._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:e,thickness:i}){e?this._drawingOptions=ii.getDefaultDrawingOptions():(this._drawingOptions=ii._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":i}))}serialize(e=!1){if(this.isEmpty())return null;const{lines:i,points:s,rect:n}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":r}}=this,o={annotationType:J.SIGNATURE,isSignature:!0,areContours:a(this,_r),color:[0,0,0],thickness:a(this,_r)?0:r,pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(o),e?(o.paths={lines:i,points:s},o.uuid=a(this,Co),o.isCopy=!0):o.lines=i,a(this,Rs)&&(o.accessibilityData={type:"Figure",alt:a(this,Rs)}),o}static deserializeDraw(e,i,s,n,r,o){return o.areContours?Qm.deserialize(e,i,s,n,r,o):vf.deserialize(e,i,s,n,r,o)}static async deserialize(e,i,s){var r;const n=await super.deserialize(e,i,s);return p(n,_r,e.areContours),n.description=((r=e.accessibilityData)==null?void 0:r.alt)||"",p(n,Co,e.uuid),n}};_r=new WeakMap,Rs=new WeakMap,Dr=new WeakMap,Co=new WeakMap,M(ii,"_type","signature"),M(ii,"_editorType",J.SIGNATURE),M(ii,"_defaultDrawingOptions",null);let iv=ii;var Ot,de,Lr,Sn,Mr,xh,xn,Po,_s,mi,Ch,gt,Cc,Pc,ap,op,lp,nv,hp,bA;class sv extends Rt{constructor(e){super({...e,name:"stampEditor"});b(this,gt);b(this,Ot,null);b(this,de,null);b(this,Lr,null);b(this,Sn,null);b(this,Mr,null);b(this,xh,"");b(this,xn,null);b(this,Po,!1);b(this,_s,null);b(this,mi,!1);b(this,Ch,!1);p(this,Sn,e.bitmapUrl),p(this,Mr,e.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(e,i){Rt.initialize(e,i)}static isHandlingMimeForPasting(e){return Kg.includes(e)}static paste(e,i){i.pasteEditor({mode:J.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var e;return{type:"stamp",hasAltText:!!((e=this.altTextData)!=null&&e.altText)}}static computeTelemetryFinalData(e){var s,n;const i=e.get("hasAltText");return{hasAltText:(s=i.get(!0))!=null?s:0,hasNoAltText:(n=i.get(!1))!=null?n:0}}async mlGuessAltText(e=null,i=!0){if(this.hasAltTextData())return null;const{mlManager:s}=this._uiManager;if(!s)throw new Error("No ML.");if(!await s.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:n,width:r,height:o}=e||this.copyCanvas(null,null,!0).imageData,l=await s.guess({name:"altText",request:{data:n,width:r,height:o,channels:n.length/(r*o)}});if(!l)throw new Error("No response from the AI service.");if(l.error)throw new Error("Error from the AI service.");if(l.cancel)return null;if(!l.output)throw new Error("No valid response from the AI service.");const c=l.output;return await this.setGuessedAltText(c),i&&!this.hasAltTextData()&&(this.altTextData={alt:c,decorative:!1}),c}remove(){var e;a(this,de)&&(p(this,Ot,null),this._uiManager.imageManager.deleteId(a(this,de)),(e=a(this,xn))==null||e.remove(),p(this,xn,null),a(this,_s)&&(clearTimeout(a(this,_s)),p(this,_s,null))),super.remove()}rebuild(){if(!this.parent){a(this,de)&&m(this,gt,ap).call(this);return}super.rebuild(),this.div!==null&&(a(this,de)&&a(this,xn)===null&&m(this,gt,ap).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(a(this,Lr)||a(this,Ot)||a(this,Sn)||a(this,Mr)||a(this,de)||a(this,Po))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,i;return this._isCopy&&(e=this.x,i=this.y),super.render(),this.div.hidden=!0,this.createAltText(),a(this,Po)||(a(this,Ot)?m(this,gt,op).call(this):m(this,gt,ap).call(this)),this._isCopy&&this._moveAfterPaste(e,i),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,i){const{id:s,bitmap:n}=this._uiManager.imageManager.getFromCanvas(e,i);i.remove(),s&&this._uiManager.imageManager.isValidId(s)&&(p(this,de,s),n&&p(this,Ot,n),p(this,Po,!1),m(this,gt,op).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;a(this,_s)!==null&&clearTimeout(a(this,_s)),p(this,_s,setTimeout(()=>{p(this,_s,null),m(this,gt,nv).call(this)},200))}copyCanvas(e,i,s=!1){var g;e||(e=224);const{width:n,height:r}=a(this,Ot),o=new Wo;let l=a(this,Ot),c=n,u=r,d=null;if(i){if(n>i||r>i){const I=Math.min(i/n,i/r);c=Math.floor(n*I),u=Math.floor(r*I)}d=document.createElement("canvas");const v=d.width=Math.ceil(c*o.sx),y=d.height=Math.ceil(u*o.sy);a(this,mi)||(l=m(this,gt,lp).call(this,v,y));const w=d.getContext("2d");w.filter=this._uiManager.hcmFilter;let A="white",S="#cfcfd8";this._uiManager.hcmFilter!=="none"?S="black":(g=window.matchMedia)!=null&&g.call(window,"(prefers-color-scheme: dark)").matches&&(A="#8f8f9d",S="#42414d");const E=15,x=E*o.sx,C=E*o.sy,P=new OffscreenCanvas(x*2,C*2),F=P.getContext("2d");F.fillStyle=A,F.fillRect(0,0,x*2,C*2),F.fillStyle=S,F.fillRect(0,0,x,C),F.fillRect(x,C,x,C),w.fillStyle=w.createPattern(P,"repeat"),w.fillRect(0,0,v,y),w.drawImage(l,0,0,l.width,l.height,0,0,v,y)}let f=null;if(s){let v,y;if(o.symmetric&&l.width<e&&l.height<e)v=l.width,y=l.height;else if(l=a(this,Ot),n>e||r>e){const S=Math.min(e/n,e/r);v=Math.floor(n*S),y=Math.floor(r*S),a(this,mi)||(l=m(this,gt,lp).call(this,v,y))}const A=new OffscreenCanvas(v,y).getContext("2d",{willReadFrequently:!0});A.drawImage(l,0,0,l.width,l.height,0,0,v,y),f={width:v,height:y,data:A.getImageData(0,0,v,y).data}}return{canvas:d,width:c,height:u,imageData:f}}static async deserialize(e,i,s){var w;let n=null,r=!1;if(e instanceof Mw){const{data:{rect:A,rotation:S,id:E,structParent:x,popupRef:C,contentsObj:P},container:F,parent:{page:{pageNumber:I}},canvas:T}=e;let R,_;T?(delete e.canvas,{id:R,bitmap:_}=s.imageManager.getFromCanvas(F.id,T),T.remove()):(r=!0,e._hasNoCanvas=!0);const j=((w=await i._structTree.getAriaAttributes("".concat(r0).concat(E)))==null?void 0:w.get("aria-label"))||"";n=e={annotationType:J.STAMP,bitmapId:R,bitmap:_,pageIndex:I-1,rect:A.slice(0),rotation:S,annotationElementId:E,id:E,deleted:!1,accessibilityData:{decorative:!1,altText:j},isSvg:!1,structParent:x,popupRef:C,comment:(P==null?void 0:P.str)||null}}const o=await super.deserialize(e,i,s),{rect:l,bitmap:c,bitmapUrl:u,bitmapId:d,isSvg:f,accessibilityData:g}=e;r?(s.addMissingCanvas(e.id,o),p(o,Po,!0)):d&&s.imageManager.isValidId(d)?(p(o,de,d),c&&p(o,Ot,c)):p(o,Sn,u),p(o,mi,f);const[v,y]=o.pageDimensions;return o.width=(l[2]-l[0])/v,o.height=(l[3]-l[1])/y,g&&(o.altTextData=g),o._initialData=n,e.comment&&o.setCommentData(e.comment),p(o,Ch,!!n),o}serialize(e=!1,i=null){var l;if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s={annotationType:J.STAMP,bitmapId:a(this,de),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:a(this,mi),structTreeParentId:this._structTreeParentId};if(this.addComment(s),e)return s.bitmapUrl=m(this,gt,hp).call(this,!0),s.accessibilityData=this.serializeAltText(!0),s.isCopy=!0,s;const{decorative:n,altText:r}=this.serializeAltText(!1);if(!n&&r&&(s.accessibilityData={type:"Figure",alt:r}),this.annotationElementId){const c=m(this,gt,bA).call(this,s);if(c.isSame)return null;c.isSameAltText?delete s.accessibilityData:s.accessibilityData.structParent=(l=this._initialData.structParent)!=null?l:-1}if(s.id=this.annotationElementId,i===null)return s;i.stamps||(i.stamps=new Map);const o=a(this,mi)?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;if(!i.stamps.has(a(this,de)))i.stamps.set(a(this,de),{area:o,serialized:s}),s.bitmap=m(this,gt,hp).call(this,!1);else if(a(this,mi)){const c=i.stamps.get(a(this,de));o>c.area&&(c.area=o,c.serialized.bitmap.close(),c.serialized.bitmap=m(this,gt,hp).call(this,!1))}return s}renderAnnotationElement(e){const i={rect:this.getRect(0,0)};return this.hasEditedComment&&(i.popup=this.comment),e.updateEdited(i),null}}Ot=new WeakMap,de=new WeakMap,Lr=new WeakMap,Sn=new WeakMap,Mr=new WeakMap,xh=new WeakMap,xn=new WeakMap,Po=new WeakMap,_s=new WeakMap,mi=new WeakMap,Ch=new WeakMap,gt=new WeakSet,Cc=function(e,i=!1){if(!e){this.remove();return}p(this,Ot,e.bitmap),i||(p(this,de,e.id),p(this,mi,e.isSvg)),e.file&&p(this,xh,e.file.name),m(this,gt,op).call(this)},Pc=function(){if(p(this,Lr,null),this._uiManager.enableWaiting(!1),!!a(this,xn)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&a(this,Ot)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&a(this,Ot)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch(e){}}this.div.focus()}},ap=function(){if(a(this,de)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(a(this,de)).then(s=>m(this,gt,Cc).call(this,s,!0)).finally(()=>m(this,gt,Pc).call(this));return}if(a(this,Sn)){const s=a(this,Sn);p(this,Sn,null),this._uiManager.enableWaiting(!0),p(this,Lr,this._uiManager.imageManager.getFromUrl(s).then(n=>m(this,gt,Cc).call(this,n)).finally(()=>m(this,gt,Pc).call(this)));return}if(a(this,Mr)){const s=a(this,Mr);p(this,Mr,null),this._uiManager.enableWaiting(!0),p(this,Lr,this._uiManager.imageManager.getFromFile(s).then(n=>m(this,gt,Cc).call(this,n)).finally(()=>m(this,gt,Pc).call(this)));return}const e=document.createElement("input");e.type="file",e.accept=Kg.join(",");const i=this._uiManager._signal;p(this,Lr,new Promise(s=>{e.addEventListener("change",async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const n=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),m(this,gt,Cc).call(this,n)}s()},{signal:i}),e.addEventListener("cancel",()=>{this.remove(),s()},{signal:i})}).finally(()=>m(this,gt,Pc).call(this))),e.click()},op=function(){var d;const{div:e}=this;let{width:i,height:s}=a(this,Ot);const[n,r]=this.pageDimensions,o=.75;if(this.width)i=this.width*n,s=this.height*r;else if(i>o*n||s>o*r){const f=Math.min(o*n/i,o*r/s);i*=f,s*=f}const[l,c]=this.parentDimensions;this.setDims(i*l/n,s*c/r),this._uiManager.enableWaiting(!1);const u=p(this,xn,document.createElement("canvas"));u.setAttribute("role","img"),this.addContainer(u),this.width=i/n,this.height=s/r,(d=this._initialOptions)!=null&&d.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),m(this,gt,nv).call(this),a(this,Ch)||(this.parent.addUndoableEditor(this),p(this,Ch,!0)),this._reportTelemetry({action:"inserted_image"}),a(this,xh)&&this.div.setAttribute("aria-description",a(this,xh)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},lp=function(e,i){const{width:s,height:n}=a(this,Ot);let r=s,o=n,l=a(this,Ot);for(;r>2*e||o>2*i;){const c=r,u=o;r>2*e&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2)),o>2*i&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const d=new OffscreenCanvas(r,o);d.getContext("2d").drawImage(l,0,0,c,u,0,0,r,o),l=d.transferToImageBitmap()}return l},nv=function(){const[e,i]=this.parentDimensions,{width:s,height:n}=this,r=new Wo,o=Math.ceil(s*e*r.sx),l=Math.ceil(n*i*r.sy),c=a(this,xn);if(!c||c.width===o&&c.height===l)return;c.width=o,c.height=l;const u=a(this,mi)?a(this,Ot):m(this,gt,lp).call(this,o,l),d=c.getContext("2d");d.filter=this._uiManager.hcmFilter,d.drawImage(u,0,0,u.width,u.height,0,0,o,l)},hp=function(e){if(e){if(a(this,mi)){const n=this._uiManager.imageManager.getSvgUrl(a(this,de));if(n)return n}const i=document.createElement("canvas");return{width:i.width,height:i.height}=a(this,Ot),i.getContext("2d").drawImage(a(this,Ot),0,0),i.toDataURL()}if(a(this,mi)){const[i,s]=this.pageDimensions,n=Math.round(this.width*i*aa.PDF_TO_CSS_UNITS),r=Math.round(this.height*s*aa.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(n,r);return o.getContext("2d").drawImage(a(this,Ot),0,0,a(this,Ot).width,a(this,Ot).height,0,0,n,r),o.transferToImageBitmap()}return structuredClone(a(this,Ot))},bA=function(e){var o;const{pageIndex:i,accessibilityData:{altText:s}}=this._initialData,n=e.pageIndex===i,r=(((o=e.accessibilityData)==null?void 0:o.alt)||"")===s;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&n&&r,isSameAltText:r}},M(sv,"_type","stamp"),M(sv,"_editorType",J.STAMP);var To,Ph,Ds,Nr,Cn,vi,Or,Th,Fo,Qi,Pn,fe,Tn,kr,Fh,K,qe,Br,Bt,yA,cs,rv,av,cp;let JS=(qe=class{constructor({uiManager:t,pageIndex:e,div:i,structTreeLayer:s,accessibilityManager:n,annotationLayer:r,drawLayer:o,textLayer:l,viewport:c,l10n:u}){b(this,Bt);b(this,To);b(this,Ph,!1);b(this,Ds,null);b(this,Nr,null);b(this,Cn,null);b(this,vi,new Map);b(this,Or,!1);b(this,Th,!1);b(this,Fo,!1);b(this,Qi,null);b(this,Pn,null);b(this,fe,null);b(this,Tn,null);b(this,kr,null);b(this,Fh,-1);b(this,K);const d=[...a(qe,Br).values()];if(!qe._initialized){qe._initialized=!0;for(const f of d)f.initialize(u,t)}t.registerEditorTypes(d),p(this,K,t),this.pageIndex=e,this.div=i,p(this,To,n),p(this,Ds,r),this.viewport=c,p(this,fe,l),this.drawLayer=o,this._structTree=s,a(this,K).addLayer(this)}get isEmpty(){return a(this,vi).size===0}get isInvisible(){return this.isEmpty&&a(this,K).getMode()===J.NONE}updateToolbar(t){a(this,K).updateToolbar(t)}updateMode(t=a(this,K).getMode()){switch(m(this,Bt,cp).call(this),t){case J.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case J.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case J.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;for(const i of a(qe,Br).values())e.toggle("".concat(i._type,"Editing"),t===i._editorType);this.div.hidden=!1}hasTextLayer(t){var e;return t===((e=a(this,fe))==null?void 0:e.div)}setEditingState(t){a(this,K).setEditingState(t)}addCommands(t){a(this,K).addCommands(t)}cleanUndoStack(t){a(this,K).cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){var e;(e=a(this,Ds))==null||e.div.classList.toggle("disabled",!t)}async enable(){var i;p(this,Fo,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),(i=a(this,kr))==null||i.abort(),p(this,kr,null);const t=new Set;for(const s of a(this,vi).values())s.enableEditing(),s.show(!0),s.annotationElementId&&(a(this,K).removeChangedExistingAnnotation(s),t.add(s.annotationElementId));if(!a(this,Ds)){p(this,Fo,!1);return}const e=a(this,Ds).getEditableAnnotations();for(const s of e){if(s.hide(),a(this,K).isDeletedAnnotationElement(s.data.id)||t.has(s.data.id))continue;const n=await this.deserialize(s);n&&(this.addOrRebuild(n),n.enableEditing())}p(this,Fo,!1)}disable(){var s;if(p(this,Th,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),a(this,fe)&&!a(this,kr)){p(this,kr,new AbortController);const n=a(this,K).combinedSignal(a(this,kr));a(this,fe).div.addEventListener("pointerdown",r=>{const{clientX:l,clientY:c,timeStamp:u}=r,d=a(this,Fh);if(u-d>500){p(this,Fh,u);return}p(this,Fh,-1);const{classList:f}=this.div;f.toggle("getElements",!0);const g=document.elementsFromPoint(l,c);if(f.toggle("getElements",!1),!this.div.contains(g[0]))return;let v;const y=new RegExp("^".concat(hy,"[0-9]+$"));for(const A of g)if(y.test(A.id)){v=A.id;break}if(!v)return;const w=a(this,vi).get(v);(w==null?void 0:w.annotationElementId)===null&&(r.stopPropagation(),r.preventDefault(),w.dblclick())},{signal:n,capture:!0})}const t=new Map,e=new Map;for(const n of a(this,vi).values())if(n.disableEditing(),!!n.annotationElementId){if(n.serialize()!==null){t.set(n.annotationElementId,n);continue}else e.set(n.annotationElementId,n);(s=this.getEditableAnnotation(n.annotationElementId))==null||s.show(),n.remove()}if(a(this,Ds)){const n=a(this,Ds).getEditableAnnotations();for(const r of n){const{id:o}=r.data;if(a(this,K).isDeletedAnnotationElement(o)){r.updateEdited({deleted:!0});continue}let l=e.get(o);if(l){l.resetAnnotationElement(r),l.show(!1),r.show();continue}l=t.get(o),l&&(a(this,K).addChangedExistingAnnotation(l),l.renderAnnotationElement(r)&&l.show(!1)),r.show()}}m(this,Bt,cp).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const n of a(qe,Br).values())i.remove("".concat(n._type,"Editing"));this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),p(this,Th,!1)}getEditableAnnotation(t){var e;return((e=a(this,Ds))==null?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){a(this,K).getActive()!==t&&a(this,K).setActiveEditor(t)}enableTextSelection(){var t;if(this.div.tabIndex=-1,(t=a(this,fe))!=null&&t.div&&!a(this,Tn)){p(this,Tn,new AbortController);const e=a(this,K).combinedSignal(a(this,Tn));a(this,fe).div.addEventListener("pointerdown",m(this,Bt,yA).bind(this),{signal:e}),a(this,fe).div.classList.add("highlighting")}}disableTextSelection(){var t;this.div.tabIndex=0,(t=a(this,fe))!=null&&t.div&&a(this,Tn)&&(a(this,Tn).abort(),p(this,Tn,null),a(this,fe).div.classList.remove("highlighting"))}enableClick(){if(a(this,Nr))return;p(this,Nr,new AbortController);const t=a(this,K).combinedSignal(a(this,Nr));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){var t;(t=a(this,Nr))==null||t.abort(),p(this,Nr,null)}attach(t){a(this,vi).set(t.id,t);const{annotationElementId:e}=t;e&&a(this,K).isDeletedAnnotationElement(e)&&a(this,K).removeDeletedAnnotationElement(t)}detach(t){var e;a(this,vi).delete(t.id),(e=a(this,To))==null||e.removePointerInTextLayer(t.contentDiv),!a(this,Th)&&t.annotationElementId&&a(this,K).addDeletedAnnotationElement(t)}remove(t){this.detach(t),a(this,K).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(a(this,K).addDeletedAnnotationElement(t.annotationElementId),Rt.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),(e=t.parent)==null||e.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),a(this,K).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!a(this,Fo)),a(this,K).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var i;if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&!a(this,Cn)&&(t._focusEventsAllowed=!1,p(this,Cn,setTimeout(()=>{p(this,Cn,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:a(this,K)._signal}),e.focus())},0))),t._structTreeParentId=(i=a(this,To))==null?void 0:i.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){const e=()=>t._uiManager.rebuild(t),i=()=>{t.remove()};this.addCommands({cmd:e,undo:i,mustExec:!1})}getNextId(){return a(this,K).getId()}combinedSignal(t){return a(this,K).combinedSignal(t)}canCreateNewEmptyEditor(){var t;return(t=a(this,Bt,cs))==null?void 0:t.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await a(this,K).updateMode(t.mode);const{offsetX:i,offsetY:s}=m(this,Bt,av).call(this),n=this.getNextId(),r=m(this,Bt,rv).call(this,{parent:this,id:n,x:i,y:s,uiManager:a(this,K),isCentered:!0,...e});r&&this.add(r)}async deserialize(t){var e,i;return await((i=a(qe,Br).get((e=t.annotationType)!=null?e:t.annotationEditorType))==null?void 0:i.deserialize(t,this,a(this,K)))||null}createAndAddNewEditor(t,e,i={}){const s=this.getNextId(),n=m(this,Bt,rv).call(this,{parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:a(this,K),isCentered:e,...i});return n&&this.add(n),n}addNewEditor(t={}){this.createAndAddNewEditor(m(this,Bt,av).call(this),!0,t)}setSelected(t){a(this,K).setSelected(t)}toggleSelected(t){a(this,K).toggleSelected(t)}unselect(t){a(this,K).unselect(t)}pointerup(t){var s;const{isMac:e}=Te.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div||!a(this,Or)||(p(this,Or,!1),(s=a(this,Bt,cs))!=null&&s.isDrawer&&a(this,Bt,cs).supportMultipleDrawings))return;if(!a(this,Ph)){p(this,Ph,!0);return}const i=a(this,K).getMode();if(i===J.STAMP||i===J.SIGNATURE){a(this,K).unselectAll();return}this.createAndAddNewEditor(t,!1)}pointerdown(t){var s;if(a(this,K).getMode()===J.HIGHLIGHT&&this.enableTextSelection(),a(this,Or)){p(this,Or,!1);return}const{isMac:e}=Te.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div)return;if(p(this,Or,!0),(s=a(this,Bt,cs))!=null&&s.isDrawer){this.startDrawingSession(t);return}const i=a(this,K).getActive();p(this,Ph,!i||i.isEmpty())}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),a(this,Qi)){a(this,Bt,cs).startDrawing(this,a(this,K),!1,t);return}a(this,K).setCurrentDrawingSession(this),p(this,Qi,new AbortController);const e=a(this,K).combinedSignal(a(this,Qi));this.div.addEventListener("blur",({relatedTarget:i})=>{i&&!this.div.contains(i)&&(p(this,Pn,null),this.commitOrRemove())},{signal:e}),a(this,Bt,cs).startDrawing(this,a(this,K),!1,t)}pause(t){if(t){const{activeElement:e}=document;this.div.contains(e)&&p(this,Pn,e);return}a(this,Pn)&&setTimeout(()=>{var e;(e=a(this,Pn))==null||e.focus(),p(this,Pn,null)},0)}endDrawingSession(t=!1){return a(this,Qi)?(a(this,K).setCurrentDrawingSession(null),a(this,Qi).abort(),p(this,Qi,null),p(this,Pn,null),a(this,Bt,cs).endDrawing(t)):null}findNewParent(t,e,i){const s=a(this,K).findParent(e,i);return s===null||s===this?!1:(s.changeParent(t),!0)}commitOrRemove(){return a(this,Qi)?(this.endDrawingSession(),!0):!1}onScaleChanging(){a(this,Qi)&&a(this,Bt,cs).onScaleChangingWhenDrawing(this)}destroy(){var t,e;this.commitOrRemove(),((t=a(this,K).getActive())==null?void 0:t.parent)===this&&(a(this,K).commitOrRemove(),a(this,K).setActiveEditor(null)),a(this,Cn)&&(clearTimeout(a(this,Cn)),p(this,Cn,null));for(const i of a(this,vi).values())(e=a(this,To))==null||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove();this.div=null,a(this,vi).clear(),a(this,K).removeLayer(this)}render({viewport:t}){this.viewport=t,Uo(this.div,t);for(const e of a(this,K).getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:t}){a(this,K).commitOrRemove(),m(this,Bt,cp).call(this);const e=this.viewport.rotation,i=t.rotation;if(this.viewport=t,Uo(this.div,{rotation:i}),e!==i)for(const s of a(this,vi).values())s.rotate(i)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return a(this,K).viewParameters.realScale}},To=new WeakMap,Ph=new WeakMap,Ds=new WeakMap,Nr=new WeakMap,Cn=new WeakMap,vi=new WeakMap,Or=new WeakMap,Th=new WeakMap,Fo=new WeakMap,Qi=new WeakMap,Pn=new WeakMap,fe=new WeakMap,Tn=new WeakMap,kr=new WeakMap,Fh=new WeakMap,K=new WeakMap,Br=new WeakMap,Bt=new WeakSet,yA=function(t){a(this,K).unselectAll();const{target:e}=t;if(e===a(this,fe).div||(e.getAttribute("role")==="img"||e.classList.contains("endOfContent"))&&a(this,fe).div.contains(e)){const{isMac:i}=Te.platform;if(t.button!==0||t.ctrlKey&&i)return;a(this,K).showAllEditors("highlight",!0,!0),a(this,fe).div.classList.add("free"),this.toggleDrawing(),Np.startHighlighting(this,a(this,K).direction==="ltr",{target:a(this,fe).div,x:t.x,y:t.y}),a(this,fe).div.addEventListener("pointerup",()=>{a(this,fe).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:a(this,K)._signal}),t.preventDefault()}},cs=function(){return a(qe,Br).get(a(this,K).getMode())},rv=function(t){const e=a(this,Bt,cs);return e?new e.prototype.constructor(t):null},av=function(){const{x:t,y:e,width:i,height:s}=this.div.getBoundingClientRect(),n=Math.max(0,t),r=Math.max(0,e),o=Math.min(window.innerWidth,t+i),l=Math.min(window.innerHeight,e+s),c=(n+o)/2-t,u=(r+l)/2-e,[d,f]=this.viewport.rotation%180===0?[c,u]:[u,c];return{offsetX:d,offsetY:f}},cp=function(){for(const t of a(this,vi).values())t.isEmpty()&&t.remove()},M(qe,"_initialized",!1),b(qe,Br,new Map([Vm,Zm,sv,Np,iv].map(t=>[t._editorType,t]))),qe);var Ji,Be,Io,$t,xd,rg,wA,js,ov,AA,lv;let qS=($t=class{constructor({pageIndex:t}){b(this,js);b(this,Ji,null);b(this,Be,new Map);b(this,Io,new Map);this.pageIndex=t}setParent(t){if(!a(this,Ji)){p(this,Ji,t);return}if(a(this,Ji)!==t){if(a(this,Be).size>0)for(const e of a(this,Be).values())e.remove(),t.append(e);p(this,Ji,t)}}static get _svgFactory(){return ct(this,"_svgFactory",new Lp)}draw(t,e=!1,i=!1){const s=ge($t,xd)._++,n=m(this,js,ov).call(this),r=$t._svgFactory.createElement("defs");n.append(r);const o=$t._svgFactory.createElement("path");r.append(o);const l="path_p".concat(this.pageIndex,"_").concat(s);o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),e&&a(this,Io).set(s,o);const c=i?m(this,js,AA).call(this,r,l):null,u=$t._svgFactory.createElement("use");return n.append(u),u.setAttribute("href","#".concat(l)),this.updateProperties(n,t),a(this,Be).set(s,n),{id:s,clipPathId:"url(#".concat(c,")")}}drawOutline(t,e){const i=ge($t,xd)._++,s=m(this,js,ov).call(this),n=$t._svgFactory.createElement("defs");s.append(n);const r=$t._svgFactory.createElement("path");n.append(r);const o="path_p".concat(this.pageIndex,"_").concat(i);r.setAttribute("id",o),r.setAttribute("vector-effect","non-scaling-stroke");let l;if(e){const d=$t._svgFactory.createElement("mask");n.append(d),l="mask_p".concat(this.pageIndex,"_").concat(i),d.setAttribute("id",l),d.setAttribute("maskUnits","objectBoundingBox");const f=$t._svgFactory.createElement("rect");d.append(f),f.setAttribute("width","1"),f.setAttribute("height","1"),f.setAttribute("fill","white");const g=$t._svgFactory.createElement("use");d.append(g),g.setAttribute("href","#".concat(o)),g.setAttribute("stroke","none"),g.setAttribute("fill","black"),g.setAttribute("fill-rule","nonzero"),g.classList.add("mask")}const c=$t._svgFactory.createElement("use");s.append(c),c.setAttribute("href","#".concat(o)),l&&c.setAttribute("mask","url(#".concat(l,")"));const u=c.cloneNode();return s.append(u),c.classList.add("mainOutline"),u.classList.add("secondaryOutline"),this.updateProperties(s,t),a(this,Be).set(i,s),i}finalizeDraw(t,e){a(this,Io).delete(t),this.updateProperties(t,e)}updateProperties(t,e){var l;if(!e)return;const{root:i,bbox:s,rootClass:n,path:r}=e,o=typeof t=="number"?a(this,Be).get(t):t;if(o){if(i&&m(this,js,lv).call(this,o,i),s&&m(l=$t,rg,wA).call(l,o,s),n){const{classList:c}=o;for(const[u,d]of Object.entries(n))c.toggle(u,d)}if(r){const u=o.firstChild.firstChild;m(this,js,lv).call(this,u,r)}}}updateParent(t,e){if(e===this)return;const i=a(this,Be).get(t);i&&(a(e,Ji).append(i),a(this,Be).delete(t),a(e,Be).set(t,i))}remove(t){a(this,Io).delete(t),a(this,Ji)!==null&&(a(this,Be).get(t).remove(),a(this,Be).delete(t))}destroy(){p(this,Ji,null);for(const t of a(this,Be).values())t.remove();a(this,Be).clear(),a(this,Io).clear()}},Ji=new WeakMap,Be=new WeakMap,Io=new WeakMap,xd=new WeakMap,rg=new WeakSet,wA=function(t,[e,i,s,n]){const{style:r}=t;r.top="".concat(100*i,"%"),r.left="".concat(100*e,"%"),r.width="".concat(100*s,"%"),r.height="".concat(100*n,"%")},js=new WeakSet,ov=function(){const t=$t._svgFactory.create(1,1,!0);return a(this,Ji).append(t),t.setAttribute("aria-hidden",!0),t},AA=function(t,e){const i=$t._svgFactory.createElement("clipPath");t.append(i);const s="clip_".concat(e);i.setAttribute("id",s),i.setAttribute("clipPathUnits","objectBoundingBox");const n=$t._svgFactory.createElement("use");return i.append(n),n.setAttribute("href","#".concat(e)),n.classList.add("clip"),s},lv=function(t,e){for(const[i,s]of Object.entries(e))s===null?t.removeAttribute(i):t.setAttribute(i,s)},b($t,rg),b($t,xd,0),$t);globalThis._pdfjsTestingUtils={HighlightOutliner:$m};globalThis.pdfjsLib={AbortException:ra,AnnotationEditorLayer:JS,AnnotationEditorParamsType:ut,AnnotationEditorType:J,AnnotationEditorUIManager:zc,AnnotationLayer:YS,AnnotationMode:Bs,AnnotationType:Zt,build:FS,ColorPicker:Aw,createValidAbsoluteUrl:cy,DOMSVGFactory:Lp,DrawLayer:qS,FeatureTest:Te,fetchData:ff,getDocument:vw,getFilenameFromUrl:EE,getPdfFilenameFromUrl:gy,getRGB:pg,getUuid:fy,getXfaPageViewport:my,GlobalWorkerOptions:Zn,ImageKind:Mf,InvalidPDFException:Gg,isDataScheme:fg,isPdfFile:a0,isValidExplicitDest:ME,MathClamp:$e,noContextMenu:Vi,normalizeUnicode:yE,OPS:Ip,OutputScale:Wo,PasswordResponses:cE,PDFDataRangeTransport:bw,PDFDateString:Wc,PDFWorker:Tm,PermissionFlag:hE,PixelsPerInch:aa,RenderingCancelledException:tc,ResponseException:Rp,setLayerDimensions:Uo,shadow:ct,SignatureExtractor:nl,stopEvent:Qt,SupportedImageMimeTypes:Kg,TextLayer:Sm,TouchManager:Ny,updateUrlHash:uy,Util:Q,VerbosityLevel:cg,version:TS,XfaLayer:Sw};var tx={34:(h,t,e)=>{var i=e(4901);h.exports=function(s){return typeof s=="object"?s!==null:i(s)}},81:(h,t,e)=>{var i=e(9565),s=e(9306),n=e(8551),r=e(6823),o=e(851),l=TypeError;h.exports=function(c,u){var d=arguments.length<2?o(c):u;if(s(d))return n(i(d,c));throw new l(r(c)+" is not iterable")}},283:(h,t,e)=>{var i=e(9504),s=e(9039),n=e(4901),r=e(9297),o=e(3724),l=e(350).CONFIGURABLE,c=e(3706),u=e(1181),d=u.enforce,f=u.get,g=String,v=Object.defineProperty,y=i("".slice),w=i("".replace),A=i([].join),S=o&&!s(function(){return v(function(){},"length",{value:8}).length!==8}),E=String(String).split("String"),x=h.exports=function(C,P,F){y(g(P),0,7)==="Symbol("&&(P="["+w(g(P),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),F&&F.getter&&(P="get "+P),F&&F.setter&&(P="set "+P),(!r(C,"name")||l&&C.name!==P)&&(o?v(C,"name",{value:P,configurable:!0}):C.name=P),S&&F&&r(F,"arity")&&C.length!==F.arity&&v(C,"length",{value:F.arity});try{F&&r(F,"constructor")&&F.constructor?o&&v(C,"prototype",{writable:!1}):C.prototype&&(C.prototype=void 0)}catch(T){}var I=d(C);return r(I,"source")||(I.source=A(E,typeof P=="string"?P:"")),C};Function.prototype.toString=x(function(){return n(this)&&f(this).source||c(this)},"toString")},350:(h,t,e)=>{var i=e(3724),s=e(9297),n=Function.prototype,r=i&&Object.getOwnPropertyDescriptor,o=s(n,"name"),l=o&&(function(){}).name==="something",c=o&&(!i||i&&r(n,"name").configurable);h.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},397:(h,t,e)=>{var i=e(7751);h.exports=i("document","documentElement")},421:h=>{h.exports={}},507:(h,t,e)=>{var i=e(9565);h.exports=function(s,n,r){for(var o=r?s:s.iterator,l=s.next,c,u;!(c=i(l,o)).done;)if(u=n(c.value),u!==void 0)return u}},616:(h,t,e)=>{var i=e(9039);h.exports=!i(function(){var s=(function(){}).bind();return typeof s!="function"||s.hasOwnProperty("prototype")})},655:(h,t,e)=>{var i=e(6955),s=String;h.exports=function(n){if(i(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return s(n)}},679:(h,t,e)=>{var i=e(1625),s=TypeError;h.exports=function(n,r){if(i(r,n))return n;throw new s("Incorrect invocation")}},684:h=>{h.exports=function(t,e){var i=typeof Iterator=="function"&&Iterator.prototype[t];if(i)try{i.call({next:null},e).next()}catch(s){return!0}}},741:h=>{var t=Math.ceil,e=Math.floor;h.exports=Math.trunc||function(s){var n=+s;return(n>0?e:t)(n)}},757:(h,t,e)=>{var i=e(7751),s=e(4901),n=e(1625),r=e(7040),o=Object;h.exports=r?function(l){return typeof l=="symbol"}:function(l){var c=i("Symbol");return s(c)&&n(c.prototype,o(l))}},851:(h,t,e)=>{var i=e(6955),s=e(5966),n=e(4117),r=e(6269),o=e(8227),l=o("iterator");h.exports=function(c){if(!n(c))return s(c,l)||s(c,"@@iterator")||r[i(c)]}},1072:(h,t,e)=>{var i=e(1828),s=e(8727);h.exports=Object.keys||function(r){return i(r,s)}},1108:(h,t,e)=>{var i=e(6955);h.exports=function(s){var n=i(s);return n==="BigInt64Array"||n==="BigUint64Array"}},1148:(h,t,e)=>{var i=e(6518),s=e(9565),n=e(2652),r=e(9306),o=e(8551),l=e(1767),c=e(9539),u=e(4549),d=u("every",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:d},{every:function(g){o(this);try{r(g)}catch(w){c(this,"throw",w)}if(d)return s(d,this,g);var v=l(this),y=0;return!n(v,function(w,A){if(!g(w,y++))return A()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},1181:(h,t,e)=>{var i=e(8622),s=e(4576),n=e(34),r=e(6699),o=e(9297),l=e(7629),c=e(6119),u=e(421),d="Object already initialized",f=s.TypeError,g=s.WeakMap,v,y,w,A=function(C){return w(C)?y(C):v(C,{})},S=function(C){return function(P){var F;if(!n(P)||(F=y(P)).type!==C)throw new f("Incompatible receiver, "+C+" required");return F}};if(i||l.state){var E=l.state||(l.state=new g);E.get=E.get,E.has=E.has,E.set=E.set,v=function(C,P){if(E.has(C))throw new f(d);return P.facade=C,E.set(C,P),P},y=function(C){return E.get(C)||{}},w=function(C){return E.has(C)}}else{var x=c("state");u[x]=!0,v=function(C,P){if(o(C,x))throw new f(d);return P.facade=C,r(C,x,P),P},y=function(C){return o(C,x)?C[x]:{}},w=function(C){return o(C,x)}}h.exports={set:v,get:y,has:w,enforce:A,getterFor:S}},1291:(h,t,e)=>{var i=e(741);h.exports=function(s){var n=+s;return n!==n||n===0?0:i(n)}},1385:(h,t,e)=>{var i=e(9539);h.exports=function(s,n,r){for(var o=s.length-1;o>=0;o--)if(s[o]!==void 0)try{r=i(s[o].iterator,n,r)}catch(l){n="throw",r=l}if(n==="throw")throw r;return r}},1548:(h,t,e)=>{var i=e(4576),s=e(9039),n=e(9519),r=e(4215),o=i.structuredClone;h.exports=!!o&&!s(function(){if(r==="DENO"&&n>92||r==="NODE"&&n>94||r==="BROWSER"&&n>97)return!1;var l=new ArrayBuffer(8),c=o(l,{transfer:[l]});return l.byteLength!==0||c.byteLength!==8})},1625:(h,t,e)=>{var i=e(9504);h.exports=i({}.isPrototypeOf)},1698:(h,t,e)=>{var i=e(6518),s=e(4204),n=e(9835),r=e(4916),o=!r("union")||!n("union");i({target:"Set",proto:!0,real:!0,forced:o},{union:s})},1701:(h,t,e)=>{var i=e(6518),s=e(9565),n=e(9306),r=e(8551),o=e(1767),l=e(9462),c=e(6319),u=e(9539),d=e(684),f=e(4549),g=e(6395),v=!g&&!d("map",function(){}),y=!g&&!v&&f("map",TypeError),w=g||v||y,A=l(function(){var S=this.iterator,E=r(s(this.next,S)),x=this.done=!!E.done;if(!x)return c(S,this.mapper,[E.value,this.counter++],!0)});i({target:"Iterator",proto:!0,real:!0,forced:w},{map:function(E){r(this);try{n(E)}catch(x){u(this,"throw",x)}return y?s(y,this,E):new A(o(this),{mapper:E})}})},1767:h=>{h.exports=function(t){return{iterator:t,next:t.next,done:!1}}},1828:(h,t,e)=>{var i=e(9504),s=e(9297),n=e(5397),r=e(9617).indexOf,o=e(421),l=i([].push);h.exports=function(c,u){var d=n(c),f=0,g=[],v;for(v in d)!s(o,v)&&s(d,v)&&l(g,v);for(;u.length>f;)s(d,v=u[f++])&&(~r(g,v)||l(g,v));return g}},2106:(h,t,e)=>{var i=e(283),s=e(4913);h.exports=function(n,r,o){return o.get&&i(o.get,r,{getter:!0}),o.set&&i(o.set,r,{setter:!0}),s.f(n,r,o)}},2140:(h,t,e)=>{var i=e(8227),s=i("toStringTag"),n={};n[s]="z",h.exports=String(n)==="[object z]"},2195:(h,t,e)=>{var i=e(9504),s=i({}.toString),n=i("".slice);h.exports=function(r){return n(s(r),8,-1)}},2211:(h,t,e)=>{var i=e(9039);h.exports=!i(function(){function s(){}return s.prototype.constructor=null,Object.getPrototypeOf(new s)!==s.prototype})},2222:(h,t,e)=>{var i=e(6518),s=e(7751),n=e(9039),r=e(2812),o=e(655),l=e(7416),c=s("URL"),u=l&&n(function(){c.canParse()}),d=n(function(){return c.canParse.length!==1});i({target:"URL",stat:!0,forced:!u||d},{canParse:function(g){var v=r(arguments.length,1),y=o(g),w=v<2||arguments[1]===void 0?void 0:o(arguments[1]);try{return!!new c(y,w)}catch(A){return!1}}})},2360:(h,t,e)=>{var i=e(8551),s=e(6801),n=e(8727),r=e(421),o=e(397),l=e(4055),c=e(6119),u=">",d="<",f="prototype",g="script",v=c("IE_PROTO"),y=function(){},w=function(C){return d+g+u+C+d+"/"+g+u},A=function(C){C.write(w("")),C.close();var P=C.parentWindow.Object;return C=null,P},S=function(){var C=l("iframe"),P="java"+g+":",F;return C.style.display="none",o.appendChild(C),C.src=String(P),F=C.contentWindow.document,F.open(),F.write(w("document.F=Object")),F.close(),F.F},E,x=function(){try{E=new ActiveXObject("htmlfile")}catch(P){}x=typeof document<"u"?document.domain&&E?A(E):S():A(E);for(var C=n.length;C--;)delete x[f][n[C]];return x()};r[v]=!0,h.exports=Object.create||function(P,F){var I;return P!==null?(y[f]=i(P),I=new y,y[f]=null,I[v]=P):I=x(),F===void 0?I:s.f(I,F)}},2475:(h,t,e)=>{var i=e(6518),s=e(8527),n=e(4916),r=!n("isSupersetOf",function(o){return!o});i({target:"Set",proto:!0,real:!0,forced:r},{isSupersetOf:s})},2489:(h,t,e)=>{var i=e(6518),s=e(9565),n=e(9306),r=e(8551),o=e(1767),l=e(9462),c=e(6319),u=e(6395),d=e(9539),f=e(684),g=e(4549),v=!u&&!f("filter",function(){}),y=!u&&!v&&g("filter",TypeError),w=u||v||y,A=l(function(){for(var S=this.iterator,E=this.predicate,x=this.next,C,P,F;;){if(C=r(s(x,S)),P=this.done=!!C.done,P)return;if(F=C.value,c(S,E,[F,this.counter++],!0))return F}});i({target:"Iterator",proto:!0,real:!0,forced:w},{filter:function(E){r(this);try{n(E)}catch(x){d(this,"throw",x)}return y?s(y,this,E):new A(o(this),{predicate:E})}})},2529:h=>{h.exports=function(t,e){return{value:t,done:e}}},2652:(h,t,e)=>{var i=e(6080),s=e(9565),n=e(8551),r=e(6823),o=e(4209),l=e(6198),c=e(1625),u=e(81),d=e(851),f=e(9539),g=TypeError,v=function(w,A){this.stopped=w,this.result=A},y=v.prototype;h.exports=function(w,A,S){var E=S&&S.that,x=!!(S&&S.AS_ENTRIES),C=!!(S&&S.IS_RECORD),P=!!(S&&S.IS_ITERATOR),F=!!(S&&S.INTERRUPTED),I=i(A,E),T,R,_,j,k,U,ft,B=function(et){return T&&f(T,"normal"),new v(!0,et)},L=function(et){return x?(n(et),F?I(et[0],et[1],B):I(et[0],et[1])):F?I(et,B):I(et)};if(C)T=w.iterator;else if(P)T=w;else{if(R=d(w),!R)throw new g(r(w)+" is not iterable");if(o(R)){for(_=0,j=l(w);j>_;_++)if(k=L(w[_]),k&&c(y,k))return k;return new v(!1)}T=u(w,R)}for(U=C?w.next:T.next;!(ft=s(U,T)).done;){try{k=L(ft.value)}catch(et){f(T,"throw",et)}if(typeof k=="object"&&k&&c(y,k))return k}return new v(!1)}},2777:(h,t,e)=>{var i=e(9565),s=e(34),n=e(757),r=e(5966),o=e(4270),l=e(8227),c=TypeError,u=l("toPrimitive");h.exports=function(d,f){if(!s(d)||n(d))return d;var g=r(d,u),v;if(g){if(f===void 0&&(f="default"),v=i(g,d,f),!s(v)||n(v))return v;throw new c("Can't convert object to primitive value")}return f===void 0&&(f="number"),o(d,f)}},2787:(h,t,e)=>{var i=e(9297),s=e(4901),n=e(8981),r=e(6119),o=e(2211),l=r("IE_PROTO"),c=Object,u=c.prototype;h.exports=o?c.getPrototypeOf:function(d){var f=n(d);if(i(f,l))return f[l];var g=f.constructor;return s(g)&&f instanceof g?g.prototype:f instanceof c?u:null}},2796:(h,t,e)=>{var i=e(9039),s=e(4901),n=/#|\.prototype\./,r=function(d,f){var g=l[o(d)];return g===u?!0:g===c?!1:s(f)?i(f):!!f},o=r.normalize=function(d){return String(d).replace(n,".").toLowerCase()},l=r.data={},c=r.NATIVE="N",u=r.POLYFILL="P";h.exports=r},2812:h=>{var t=TypeError;h.exports=function(e,i){if(e<i)throw new t("Not enough arguments");return e}},2839:(h,t,e)=>{var i=e(4576),s=i.navigator,n=s&&s.userAgent;h.exports=n?String(n):""},2967:(h,t,e)=>{var i=e(6706),s=e(34),n=e(7750),r=e(3506);h.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var o=!1,l={},c;try{c=i(Object.prototype,"__proto__","set"),c(l,[]),o=l instanceof Array}catch(u){}return function(d,f){return n(d),r(f),s(d)&&(o?c(d,f):d.__proto__=f),d}}():void 0)},3238:(h,t,e)=>{var i=e(4576),s=e(7811),n=e(7394),r=i.DataView;h.exports=function(o){if(!s||n(o)!==0)return!1;try{return new r(o),!1}catch(l){return!0}}},3392:(h,t,e)=>{var i=e(9504),s=0,n=Math.random(),r=i(1.1.toString);h.exports=function(o){return"Symbol("+(o===void 0?"":o)+")_"+r(++s+n,36)}},3440:(h,t,e)=>{var i=e(7080),s=e(4402),n=e(9286),r=e(5170),o=e(3789),l=e(8469),c=e(507),u=s.has,d=s.remove;h.exports=function(g){var v=i(this),y=o(g),w=n(v);return r(v)<=y.size?l(v,function(A){y.includes(A)&&d(w,A)}):c(y.getIterator(),function(A){u(w,A)&&d(w,A)}),w}},3506:(h,t,e)=>{var i=e(3925),s=String,n=TypeError;h.exports=function(r){if(i(r))return r;throw new n("Can't set "+s(r)+" as a prototype")}},3579:(h,t,e)=>{var i=e(6518),s=e(9565),n=e(2652),r=e(9306),o=e(8551),l=e(1767),c=e(9539),u=e(4549),d=u("some",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:d},{some:function(g){o(this);try{r(g)}catch(w){c(this,"throw",w)}if(d)return s(d,this,g);var v=l(this),y=0;return n(v,function(w,A){if(g(w,y++))return A()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3650:(h,t,e)=>{var i=e(7080),s=e(4402),n=e(9286),r=e(3789),o=e(507),l=s.add,c=s.has,u=s.remove;h.exports=function(f){var g=i(this),v=r(f).getIterator(),y=n(g);return o(v,function(w){c(g,w)?u(y,w):l(y,w)}),y}},3706:(h,t,e)=>{var i=e(9504),s=e(4901),n=e(7629),r=i(Function.toString);s(n.inspectSource)||(n.inspectSource=function(o){return r(o)}),h.exports=n.inspectSource},3717:(h,t)=>{t.f=Object.getOwnPropertySymbols},3724:(h,t,e)=>{var i=e(9039);h.exports=!i(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},3789:(h,t,e)=>{var i=e(9306),s=e(8551),n=e(9565),r=e(1291),o=e(1767),l="Invalid size",c=RangeError,u=TypeError,d=Math.max,f=function(g,v){this.set=g,this.size=d(v,0),this.has=i(g.has),this.keys=i(g.keys)};f.prototype={getIterator:function(){return o(s(n(this.keys,this.set)))},includes:function(g){return n(this.has,this.set,g)}},h.exports=function(g){s(g);var v=+g.size;if(v!==v)throw new u(l);var y=r(v);if(y<0)throw new c(l);return new f(g,y)}},3838:(h,t,e)=>{var i=e(7080),s=e(5170),n=e(8469),r=e(3789);h.exports=function(l){var c=i(this),u=r(l);return s(c)>u.size?!1:n(c,function(d){if(!u.includes(d))return!1},!0)!==!1}},3853:(h,t,e)=>{var i=e(6518),s=e(4449),n=e(4916),r=!n("isDisjointFrom",function(o){return!o});i({target:"Set",proto:!0,real:!0,forced:r},{isDisjointFrom:s})},3925:(h,t,e)=>{var i=e(34);h.exports=function(s){return i(s)||s===null}},4055:(h,t,e)=>{var i=e(4576),s=e(34),n=i.document,r=s(n)&&s(n.createElement);h.exports=function(o){return r?n.createElement(o):{}}},4114:(h,t,e)=>{var i=e(6518),s=e(8981),n=e(6198),r=e(4527),o=e(6837),l=e(9039),c=l(function(){return[].push.call({length:4294967296},1)!==4294967297}),u=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(f){return f instanceof TypeError}},d=c||!u();i({target:"Array",proto:!0,arity:1,forced:d},{push:function(g){var v=s(this),y=n(v),w=arguments.length;o(y+w);for(var A=0;A<w;A++)v[y]=arguments[A],y++;return r(v,y),y}})},4117:h=>{h.exports=function(t){return t==null}},4204:(h,t,e)=>{var i=e(7080),s=e(4402).add,n=e(9286),r=e(3789),o=e(507);h.exports=function(c){var u=i(this),d=r(c).getIterator(),f=n(u);return o(d,function(g){s(f,g)}),f}},4209:(h,t,e)=>{var i=e(8227),s=e(6269),n=i("iterator"),r=Array.prototype;h.exports=function(o){return o!==void 0&&(s.Array===o||r[n]===o)}},4215:(h,t,e)=>{var i=e(4576),s=e(2839),n=e(2195),r=function(o){return s.slice(0,o.length)===o};h.exports=function(){return r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":i.Bun&&typeof Bun.version=="string"?"BUN":i.Deno&&typeof Deno.version=="object"?"DENO":n(i.process)==="process"?"NODE":i.window&&i.document?"BROWSER":"REST"}()},4270:(h,t,e)=>{var i=e(9565),s=e(4901),n=e(34),r=TypeError;h.exports=function(o,l){var c,u;if(l==="string"&&s(c=o.toString)&&!n(u=i(c,o))||s(c=o.valueOf)&&!n(u=i(c,o))||l!=="string"&&s(c=o.toString)&&!n(u=i(c,o)))return u;throw new r("Can't convert object to primitive value")}},4376:(h,t,e)=>{var i=e(2195);h.exports=Array.isArray||function(n){return i(n)==="Array"}},4402:(h,t,e)=>{var i=e(9504),s=Set.prototype;h.exports={Set,add:i(s.add),has:i(s.has),remove:i(s.delete),proto:s}},4449:(h,t,e)=>{var i=e(7080),s=e(4402).has,n=e(5170),r=e(3789),o=e(8469),l=e(507),c=e(9539);h.exports=function(d){var f=i(this),g=r(d);if(n(f)<=g.size)return o(f,function(y){if(g.includes(y))return!1},!0)!==!1;var v=g.getIterator();return l(v,function(y){if(s(f,y))return c(v,"normal",!1)})!==!1}},4483:(h,t,e)=>{var i=e(4576),s=e(9429),n=e(1548),r=i.structuredClone,o=i.ArrayBuffer,l=i.MessageChannel,c=!1,u,d,f,g;if(n)c=function(v){r(v,{transfer:[v]})};else if(o)try{l||(u=s("worker_threads"),u&&(l=u.MessageChannel)),l&&(d=new l,f=new o(2),g=function(v){d.port1.postMessage(null,[v])},f.byteLength===2&&(g(f),f.byteLength===0&&(c=g)))}catch(v){}h.exports=c},4495:(h,t,e)=>{var i=e(9519),s=e(9039),n=e(4576),r=n.String;h.exports=!!Object.getOwnPropertySymbols&&!s(function(){var o=Symbol("symbol detection");return!r(o)||!(Object(o)instanceof Symbol)||!Symbol.sham&&i&&i<41})},4527:(h,t,e)=>{var i=e(3724),s=e(4376),n=TypeError,r=Object.getOwnPropertyDescriptor,o=i&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(l){return l instanceof TypeError}}();h.exports=o?function(l,c){if(s(l)&&!r(l,"length").writable)throw new n("Cannot set read only .length");return l.length=c}:function(l,c){return l.length=c}},4549:(h,t,e)=>{var i=e(4576);h.exports=function(s,n){var r=i.Iterator,o=r&&r.prototype,l=o&&o[s],c=!1;if(l)try{l.call({next:function(){return{done:!0}},return:function(){c=!0}},-1)}catch(u){u instanceof n||(c=!1)}if(!c)return l}},4576:function(h){var t=function(e){return e&&e.Math===Math&&e};h.exports=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof global=="object"&&global)||t(typeof this=="object"&&this)||function(){return this}()||Function("return this")()},4603:(h,t,e)=>{var i=e(6840),s=e(9504),n=e(655),r=e(2812),o=URLSearchParams,l=o.prototype,c=s(l.append),u=s(l.delete),d=s(l.forEach),f=s([].push),g=new o("a=1&a=2&b=3");g.delete("a",1),g.delete("b",void 0),g+""!="a=2"&&i(l,"delete",function(v){var y=arguments.length,w=y<2?void 0:arguments[1];if(y&&w===void 0)return u(this,v);var A=[];d(this,function(T,R){f(A,{key:R,value:T})}),r(y,1);for(var S=n(v),E=n(w),x=0,C=0,P=!1,F=A.length,I;x<F;)I=A[x++],P||I.key===S?(P=!0,u(this,I.key)):C++;for(;C<F;)I=A[C++],I.key===S&&I.value===E||c(this,I.key,I.value)},{enumerable:!0,unsafe:!0})},4628:(h,t,e)=>{var i=e(6518),s=e(6043);i({target:"Promise",stat:!0},{withResolvers:function(){var r=s.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}})},4644:(h,t,e)=>{var i=e(7811),s=e(3724),n=e(4576),r=e(4901),o=e(34),l=e(9297),c=e(6955),u=e(6823),d=e(6699),f=e(6840),g=e(2106),v=e(1625),y=e(2787),w=e(2967),A=e(8227),S=e(3392),E=e(1181),x=E.enforce,C=E.get,P=n.Int8Array,F=P&&P.prototype,I=n.Uint8ClampedArray,T=I&&I.prototype,R=P&&y(P),_=F&&y(F),j=Object.prototype,k=n.TypeError,U=A("toStringTag"),ft=S("TYPED_ARRAY_TAG"),B="TypedArrayConstructor",L=i&&!!w&&c(n.opera)!=="Opera",et=!1,rt,_t,Xt,yt={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},At={BigInt64Array:8,BigUint64Array:8},os=function(Mt){if(!o(Mt))return!1;var Ft=c(Mt);return Ft==="DataView"||l(yt,Ft)||l(At,Ft)},ti=function(tt){var Mt=y(tt);if(o(Mt)){var Ft=C(Mt);return Ft&&l(Ft,B)?Ft[B]:ti(Mt)}},z=function(tt){if(!o(tt))return!1;var Mt=c(tt);return l(yt,Mt)||l(At,Mt)},N=function(tt){if(z(tt))return tt;throw new k("Target is not a typed array")},H=function(tt){if(r(tt)&&(!w||v(R,tt)))return tt;throw new k(u(tt)+" is not a typed array constructor")},at=function(tt,Mt,Ft,ze){if(s){if(Ft)for(var ae in yt){var Yt=n[ae];if(Yt&&l(Yt.prototype,tt))try{delete Yt.prototype[tt]}catch(Ko){try{Yt.prototype[tt]=Mt}catch(yg){}}}(!_[tt]||Ft)&&f(_,tt,Ft?Mt:L&&F[tt]||Mt,ze)}},St=function(tt,Mt,Ft){var ze,ae;if(s){if(w){if(Ft){for(ze in yt)if(ae=n[ze],ae&&l(ae,tt))try{delete ae[tt]}catch(Yt){}}if(!R[tt]||Ft)try{return f(R,tt,Ft?Mt:L&&R[tt]||Mt)}catch(Yt){}else return}for(ze in yt)ae=n[ze],ae&&(!ae[tt]||Ft)&&f(ae,tt,Mt)}};for(rt in yt)_t=n[rt],Xt=_t&&_t.prototype,Xt?x(Xt)[B]=_t:L=!1;for(rt in At)_t=n[rt],Xt=_t&&_t.prototype,Xt&&(x(Xt)[B]=_t);if((!L||!r(R)||R===Function.prototype)&&(R=function(){throw new k("Incorrect invocation")},L))for(rt in yt)n[rt]&&w(n[rt],R);if((!L||!_||_===j)&&(_=R.prototype,L))for(rt in yt)n[rt]&&w(n[rt].prototype,_);if(L&&y(T)!==_&&w(T,_),s&&!l(_,U)){et=!0,g(_,U,{configurable:!0,get:function(){return o(this)?this[ft]:void 0}});for(rt in yt)n[rt]&&d(n[rt],ft,rt)}h.exports={NATIVE_ARRAY_BUFFER_VIEWS:L,TYPED_ARRAY_TAG:et&&ft,aTypedArray:N,aTypedArrayConstructor:H,exportTypedArrayMethod:at,exportTypedArrayStaticMethod:St,getTypedArrayConstructor:ti,isView:os,isTypedArray:z,TypedArray:R,TypedArrayPrototype:_}},4659:(h,t,e)=>{var i=e(3724),s=e(4913),n=e(6980);h.exports=function(r,o,l){i?s.f(r,o,n(0,l)):r[o]=l}},4901:h=>{var t=typeof document=="object"&&document.all;h.exports=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"}},4913:(h,t,e)=>{var i=e(3724),s=e(5917),n=e(8686),r=e(8551),o=e(6969),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",f="configurable",g="writable";t.f=i?n?function(y,w,A){if(r(y),w=o(w),r(A),typeof y=="function"&&w==="prototype"&&"value"in A&&g in A&&!A[g]){var S=u(y,w);S&&S[g]&&(y[w]=A.value,A={configurable:f in A?A[f]:S[f],enumerable:d in A?A[d]:S[d],writable:!1})}return c(y,w,A)}:c:function(y,w,A){if(r(y),w=o(w),r(A),s)try{return c(y,w,A)}catch(S){}if("get"in A||"set"in A)throw new l("Accessors not supported");return"value"in A&&(y[w]=A.value),y}},4916:(h,t,e)=>{var i=e(7751),s=function(r){return{size:r,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},n=function(r){return{size:r,has:function(){return!0},keys:function(){throw new Error("e")}}};h.exports=function(r,o){var l=i("Set");try{new l()[r](s(0));try{return new l()[r](s(-1)),!1}catch(u){if(!o)return!0;try{return new l()[r](n(-1/0)),!1}catch(d){var c=new l;return c.add(1),c.add(2),o(c[r](n(1/0)))}}}catch(u){return!1}}},5024:(h,t,e)=>{var i=e(6518),s=e(3650),n=e(9835),r=e(4916),o=!r("symmetricDifference")||!n("symmetricDifference");i({target:"Set",proto:!0,real:!0,forced:o},{symmetricDifference:s})},5031:(h,t,e)=>{var i=e(7751),s=e(9504),n=e(8480),r=e(3717),o=e(8551),l=s([].concat);h.exports=i("Reflect","ownKeys")||function(u){var d=n.f(o(u)),f=r.f;return f?l(d,f(u)):d}},5169:(h,t,e)=>{var i=e(3238),s=TypeError;h.exports=function(n){if(i(n))throw new s("ArrayBuffer is detached");return n}},5170:(h,t,e)=>{var i=e(6706),s=e(4402);h.exports=i(s.proto,"size","get")||function(n){return n.size}},5397:(h,t,e)=>{var i=e(7055),s=e(7750);h.exports=function(n){return i(s(n))}},5610:(h,t,e)=>{var i=e(1291),s=Math.max,n=Math.min;h.exports=function(r,o){var l=i(r);return l<0?s(l+o,0):n(l,o)}},5636:(h,t,e)=>{var i=e(4576),s=e(9504),n=e(6706),r=e(7696),o=e(5169),l=e(7394),c=e(4483),u=e(1548),d=i.structuredClone,f=i.ArrayBuffer,g=i.DataView,v=Math.min,y=f.prototype,w=g.prototype,A=s(y.slice),S=n(y,"resizable","get"),E=n(y,"maxByteLength","get"),x=s(w.getInt8),C=s(w.setInt8);h.exports=(u||c)&&function(P,F,I){var T=l(P),R=F===void 0?T:r(F),_=!S||!S(P),j;if(o(P),u&&(P=d(P,{transfer:[P]}),T===R&&(I||_)))return P;if(T>=R&&(!I||_))j=A(P,0,R);else{var k=I&&!_&&E?{maxByteLength:E(P)}:void 0;j=new f(R,k);for(var U=new g(P),ft=new g(j),B=v(R,T),L=0;L<B;L++)C(ft,L,x(U,L))}return u||c(P),j}},5745:(h,t,e)=>{var i=e(7629);h.exports=function(s,n){return i[s]||(i[s]=n||{})}},5854:(h,t,e)=>{var i=e(2777),s=TypeError;h.exports=function(n){var r=i(n,"number");if(typeof r=="number")throw new s("Can't convert number to bigint");return BigInt(r)}},5876:(h,t,e)=>{var i=e(6518),s=e(3838),n=e(4916),r=!n("isSubsetOf",function(o){return o});i({target:"Set",proto:!0,real:!0,forced:r},{isSubsetOf:s})},5917:(h,t,e)=>{var i=e(3724),s=e(9039),n=e(4055);h.exports=!i&&!s(function(){return Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a!==7})},5966:(h,t,e)=>{var i=e(9306),s=e(4117);h.exports=function(n,r){var o=n[r];return s(o)?void 0:i(o)}},6043:(h,t,e)=>{var i=e(9306),s=TypeError,n=function(r){var o,l;this.promise=new r(function(c,u){if(o!==void 0||l!==void 0)throw new s("Bad Promise constructor");o=c,l=u}),this.resolve=i(o),this.reject=i(l)};h.exports.f=function(r){return new n(r)}},6080:(h,t,e)=>{var i=e(7476),s=e(9306),n=e(616),r=i(i.bind);h.exports=function(o,l){return s(o),l===void 0?o:n?r(o,l):function(){return o.apply(l,arguments)}}},6119:(h,t,e)=>{var i=e(5745),s=e(3392),n=i("keys");h.exports=function(r){return n[r]||(n[r]=s(r))}},6193:(h,t,e)=>{var i=e(4215);h.exports=i==="NODE"},6198:(h,t,e)=>{var i=e(8014);h.exports=function(s){return i(s.length)}},6269:h=>{h.exports={}},6279:(h,t,e)=>{var i=e(6840);h.exports=function(s,n,r){for(var o in n)i(s,o,n[o],r);return s}},6319:(h,t,e)=>{var i=e(8551),s=e(9539);h.exports=function(n,r,o,l){try{return l?r(i(o)[0],o[1]):r(o)}catch(c){s(n,"throw",c)}}},6395:h=>{h.exports=!1},6518:(h,t,e)=>{var i=e(4576),s=e(7347).f,n=e(6699),r=e(6840),o=e(9433),l=e(7740),c=e(2796);h.exports=function(u,d){var f=u.target,g=u.global,v=u.stat,y,w,A,S,E,x;if(g?w=i:v?w=i[f]||o(f,{}):w=i[f]&&i[f].prototype,w)for(A in d){if(E=d[A],u.dontCallGetSet?(x=s(w,A),S=x&&x.value):S=w[A],y=c(g?A:f+(v?".":"#")+A,u.forced),!y&&S!==void 0){if(typeof E==typeof S)continue;l(E,S)}(u.sham||S&&S.sham)&&n(E,"sham",!0),r(w,A,E,u)}}},6573:(h,t,e)=>{var i=e(3724),s=e(2106),n=e(3238),r=ArrayBuffer.prototype;i&&!("detached"in r)&&s(r,"detached",{configurable:!0,get:function(){return n(this)}})},6699:(h,t,e)=>{var i=e(3724),s=e(4913),n=e(6980);h.exports=i?function(r,o,l){return s.f(r,o,n(1,l))}:function(r,o,l){return r[o]=l,r}},6706:(h,t,e)=>{var i=e(9504),s=e(9306);h.exports=function(n,r,o){try{return i(s(Object.getOwnPropertyDescriptor(n,r)[o]))}catch(l){}}},6801:(h,t,e)=>{var i=e(3724),s=e(8686),n=e(4913),r=e(8551),o=e(5397),l=e(1072);t.f=i&&!s?Object.defineProperties:function(u,d){r(u);for(var f=o(d),g=l(d),v=g.length,y=0,w;v>y;)n.f(u,w=g[y++],f[w]);return u}},6823:h=>{var t=String;h.exports=function(e){try{return t(e)}catch(i){return"Object"}}},6837:h=>{var t=TypeError,e=9007199254740991;h.exports=function(i){if(i>e)throw t("Maximum allowed index exceeded");return i}},6840:(h,t,e)=>{var i=e(4901),s=e(4913),n=e(283),r=e(9433);h.exports=function(o,l,c,u){u||(u={});var d=u.enumerable,f=u.name!==void 0?u.name:l;if(i(c)&&n(c,f,u),u.global)d?o[l]=c:r(l,c);else{try{u.unsafe?o[l]&&(d=!0):delete o[l]}catch(g){}d?o[l]=c:s.f(o,l,{value:c,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return o}},6955:(h,t,e)=>{var i=e(2140),s=e(4901),n=e(2195),r=e(8227),o=r("toStringTag"),l=Object,c=n(function(){return arguments}())==="Arguments",u=function(d,f){try{return d[f]}catch(g){}};h.exports=i?n:function(d){var f,g,v;return d===void 0?"Undefined":d===null?"Null":typeof(g=u(f=l(d),o))=="string"?g:c?n(f):(v=n(f))==="Object"&&s(f.callee)?"Arguments":v}},6969:(h,t,e)=>{var i=e(2777),s=e(757);h.exports=function(n){var r=i(n,"string");return s(r)?r:r+""}},6980:h=>{h.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}},7040:(h,t,e)=>{var i=e(4495);h.exports=i&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},7055:(h,t,e)=>{var i=e(9504),s=e(9039),n=e(2195),r=Object,o=i("".split);h.exports=s(function(){return!r("z").propertyIsEnumerable(0)})?function(l){return n(l)==="String"?o(l,""):r(l)}:r},7080:(h,t,e)=>{var i=e(4402).has;h.exports=function(s){return i(s),s}},7347:(h,t,e)=>{var i=e(3724),s=e(9565),n=e(8773),r=e(6980),o=e(5397),l=e(6969),c=e(9297),u=e(5917),d=Object.getOwnPropertyDescriptor;t.f=i?d:function(g,v){if(g=o(g),v=l(v),u)try{return d(g,v)}catch(y){}if(c(g,v))return r(!s(n.f,g,v),g[v])}},7394:(h,t,e)=>{var i=e(4576),s=e(6706),n=e(2195),r=i.ArrayBuffer,o=i.TypeError;h.exports=r&&s(r.prototype,"byteLength","get")||function(l){if(n(l)!=="ArrayBuffer")throw new o("ArrayBuffer expected");return l.byteLength}},7416:(h,t,e)=>{var i=e(9039),s=e(8227),n=e(3724),r=e(6395),o=s("iterator");h.exports=!i(function(){var l=new URL("b?a=1&b=2&c=3","https://a"),c=l.searchParams,u=new URLSearchParams("a=1&a=2&b=3"),d="";return l.pathname="c%20d",c.forEach(function(f,g){c.delete("b"),d+=g+f}),u.delete("a",2),u.delete("b",void 0),r&&(!l.toJSON||!u.has("a",1)||u.has("a",2)||!u.has("a",void 0)||u.has("b"))||!c.size&&(r||!n)||!c.sort||l.href!=="https://a/c%20d?a=1&c=3"||c.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!c[o]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||d!=="a1c3"||new URL("https://x",void 0).host!=="x"})},7476:(h,t,e)=>{var i=e(2195),s=e(9504);h.exports=function(n){if(i(n)==="Function")return s(n)}},7566:(h,t,e)=>{var i=e(6840),s=e(9504),n=e(655),r=e(2812),o=URLSearchParams,l=o.prototype,c=s(l.getAll),u=s(l.has),d=new o("a=1");(d.has("a",2)||!d.has("a",void 0))&&i(l,"has",function(g){var v=arguments.length,y=v<2?void 0:arguments[1];if(v&&y===void 0)return u(this,g);var w=c(this,g);r(v,1);for(var A=n(y),S=0;S<w.length;)if(w[S++]===A)return!0;return!1},{enumerable:!0,unsafe:!0})},7588:(h,t,e)=>{var i=e(6518),s=e(9565),n=e(2652),r=e(9306),o=e(8551),l=e(1767),c=e(9539),u=e(4549),d=u("forEach",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:d},{forEach:function(g){o(this);try{r(g)}catch(w){c(this,"throw",w)}if(d)return s(d,this,g);var v=l(this),y=0;n(v,function(w){g(w,y++)},{IS_RECORD:!0})}})},7629:(h,t,e)=>{var i=e(6395),s=e(4576),n=e(9433),r="__core-js_shared__",o=h.exports=s[r]||n(r,{});(o.versions||(o.versions=[])).push({version:"3.44.0",mode:i?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7642:(h,t,e)=>{var i=e(6518),s=e(3440),n=e(9039),r=e(4916),o=!r("difference",function(c){return c.size===0}),l=o||n(function(){var c={size:1,has:function(){return!0},keys:function(){var d=0;return{next:function(){var f=d++>1;return u.has(1)&&u.clear(),{done:f,value:2}}}}},u=new Set([1,2,3,4]);return u.difference(c).size!==3});i({target:"Set",proto:!0,real:!0,forced:l},{difference:s})},7657:(h,t,e)=>{var i=e(9039),s=e(4901),n=e(34),r=e(2360),o=e(2787),l=e(6840),c=e(8227),u=e(6395),d=c("iterator"),f=!1,g,v,y;[].keys&&(y=[].keys(),"next"in y?(v=o(o(y)),v!==Object.prototype&&(g=v)):f=!0);var w=!n(g)||i(function(){var A={};return g[d].call(A)!==A});w?g={}:u&&(g=r(g)),s(g[d])||l(g,d,function(){return this}),h.exports={IteratorPrototype:g,BUGGY_SAFARI_ITERATORS:f}},7696:(h,t,e)=>{var i=e(1291),s=e(8014),n=RangeError;h.exports=function(r){if(r===void 0)return 0;var o=i(r),l=s(o);if(o!==l)throw new n("Wrong length or index");return l}},7740:(h,t,e)=>{var i=e(9297),s=e(5031),n=e(7347),r=e(4913);h.exports=function(o,l,c){for(var u=s(l),d=r.f,f=n.f,g=0;g<u.length;g++){var v=u[g];!i(o,v)&&!(c&&i(c,v))&&d(o,v,f(l,v))}}},7750:(h,t,e)=>{var i=e(4117),s=TypeError;h.exports=function(n){if(i(n))throw new s("Can't call method on "+n);return n}},7751:(h,t,e)=>{var i=e(4576),s=e(4901),n=function(r){return s(r)?r:void 0};h.exports=function(r,o){return arguments.length<2?n(i[r]):i[r]&&i[r][o]}},7811:h=>{h.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},7936:(h,t,e)=>{var i=e(6518),s=e(5636);s&&i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return s(this,arguments.length?arguments[0]:void 0,!1)}})},8004:(h,t,e)=>{var i=e(6518),s=e(9039),n=e(8750),r=e(4916),o=!r("intersection",function(l){return l.size===2&&l.has(1)&&l.has(2)})||s(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});i({target:"Set",proto:!0,real:!0,forced:o},{intersection:n})},8014:(h,t,e)=>{var i=e(1291),s=Math.min;h.exports=function(n){var r=i(n);return r>0?s(r,9007199254740991):0}},8100:(h,t,e)=>{var i=e(6518),s=e(5636);s&&i({target:"ArrayBuffer",proto:!0},{transfer:function(){return s(this,arguments.length?arguments[0]:void 0,!0)}})},8111:(h,t,e)=>{var i=e(6518),s=e(4576),n=e(679),r=e(8551),o=e(4901),l=e(2787),c=e(2106),u=e(4659),d=e(9039),f=e(9297),g=e(8227),v=e(7657).IteratorPrototype,y=e(3724),w=e(6395),A="constructor",S="Iterator",E=g("toStringTag"),x=TypeError,C=s[S],P=w||!o(C)||C.prototype!==v||!d(function(){C({})}),F=function(){if(n(this,v),l(this)===v)throw new x("Abstract class Iterator not directly constructable")},I=function(T,R){y?c(v,T,{configurable:!0,get:function(){return R},set:function(_){if(r(this),this===v)throw new x("You can't redefine this property");f(this,T)?this[T]=_:u(this,T,_)}}):v[T]=R};f(v,E)||I(E,S),(P||!f(v,A)||v[A]===Object)&&I(A,F),F.prototype=v,i({global:!0,constructor:!0,forced:P},{Iterator:F})},8227:(h,t,e)=>{var i=e(4576),s=e(5745),n=e(9297),r=e(3392),o=e(4495),l=e(7040),c=i.Symbol,u=s("wks"),d=l?c.for||c:c&&c.withoutSetter||r;h.exports=function(f){return n(u,f)||(u[f]=o&&n(c,f)?c[f]:d("Symbol."+f)),u[f]}},8235:(h,t,e)=>{var i=e(9504),s=e(9297),n=SyntaxError,r=parseInt,o=String.fromCharCode,l=i("".charAt),c=i("".slice),u=i(/./.exec),d={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":" "},f=/^[\da-f]{4}$/i,g=/^[\u0000-\u001F]$/;h.exports=function(v,y){for(var w=!0,A="";y<v.length;){var S=l(v,y);if(S==="\\"){var E=c(v,y,y+2);if(s(d,E))A+=d[E],y+=2;else if(E==="\\u"){y+=2;var x=c(v,y,y+4);if(!u(f,x))throw new n("Bad Unicode escape at: "+y);A+=o(r(x,16)),y+=4}else throw new n('Unknown escape sequence: "'+E+'"')}else if(S==='"'){w=!1,y++;break}else{if(u(g,S))throw new n("Bad control character in string literal at: "+y);A+=S,y++}}if(w)throw new n("Unterminated string at: "+y);return{value:A,end:y}}},8335:(h,t,e)=>{var i=e(6518),s=e(3724),n=e(4576),r=e(7751),o=e(9504),l=e(9565),c=e(4901),u=e(34),d=e(4376),f=e(9297),g=e(655),v=e(6198),y=e(4659),w=e(9039),A=e(8235),S=e(4495),E=n.JSON,x=n.Number,C=n.SyntaxError,P=E&&E.parse,F=r("Object","keys"),I=Object.getOwnPropertyDescriptor,T=o("".charAt),R=o("".slice),_=o(/./.exec),j=o([].push),k=/^\d$/,U=/^[1-9]$/,ft=/^[\d-]$/,B=/^[\t\n\r ]$/,L=0,et=1,rt=function(z,N){z=g(z);var H=new At(z,0),at=H.parse(),St=at.value,tt=H.skip(B,at.end);if(tt<z.length)throw new C('Unexpected extra character: "'+T(z,tt)+'" after the parsed data at: '+tt);return c(N)?_t({"":St},"",N,at):St},_t=function(z,N,H,at){var St=z[N],tt=at&&St===at.value,Mt=tt&&typeof at.source=="string"?{source:at.source}:{},Ft,ze,ae,Yt,Ko;if(u(St)){var yg=d(St),bf=tt?at.nodes:yg?[]:{};if(yg)for(Ft=bf.length,ae=v(St),Yt=0;Yt<ae;Yt++)Xt(St,Yt,_t(St,""+Yt,H,Yt<Ft?bf[Yt]:void 0));else for(ze=F(St),ae=v(ze),Yt=0;Yt<ae;Yt++)Ko=ze[Yt],Xt(St,Ko,_t(St,Ko,H,f(bf,Ko)?bf[Ko]:void 0))}return l(H,z,N,St,Mt)},Xt=function(z,N,H){if(s){var at=I(z,N);if(at&&!at.configurable)return}H===void 0?delete z[N]:y(z,N,H)},yt=function(z,N,H,at){this.value=z,this.end=N,this.source=H,this.nodes=at},At=function(z,N){this.source=z,this.index=N};At.prototype={fork:function(z){return new At(this.source,z)},parse:function(){var z=this.source,N=this.skip(B,this.index),H=this.fork(N),at=T(z,N);if(_(ft,at))return H.number();switch(at){case"{":return H.object();case"[":return H.array();case'"':return H.string();case"t":return H.keyword(!0);case"f":return H.keyword(!1);case"n":return H.keyword(null)}throw new C('Unexpected character: "'+at+'" at: '+N)},node:function(z,N,H,at,St){return new yt(N,at,z?null:R(this.source,H,at),St)},object:function(){for(var z=this.source,N=this.index+1,H=!1,at={},St={};N<z.length;){if(N=this.until(['"',"}"],N),T(z,N)==="}"&&!H){N++;break}var tt=this.fork(N).string(),Mt=tt.value;N=tt.end,N=this.until([":"],N)+1,N=this.skip(B,N),tt=this.fork(N).parse(),y(St,Mt,tt),y(at,Mt,tt.value),N=this.until([",","}"],tt.end);var Ft=T(z,N);if(Ft===",")H=!0,N++;else if(Ft==="}"){N++;break}}return this.node(et,at,this.index,N,St)},array:function(){for(var z=this.source,N=this.index+1,H=!1,at=[],St=[];N<z.length;){if(N=this.skip(B,N),T(z,N)==="]"&&!H){N++;break}var tt=this.fork(N).parse();if(j(St,tt),j(at,tt.value),N=this.until([",","]"],tt.end),T(z,N)===",")H=!0,N++;else if(T(z,N)==="]"){N++;break}}return this.node(et,at,this.index,N,St)},string:function(){var z=this.index,N=A(this.source,this.index+1);return this.node(L,N.value,z,N.end)},number:function(){var z=this.source,N=this.index,H=N;if(T(z,H)==="-"&&H++,T(z,H)==="0")H++;else if(_(U,T(z,H)))H=this.skip(k,H+1);else throw new C("Failed to parse number at: "+H);if(T(z,H)==="."&&(H=this.skip(k,H+1)),T(z,H)==="e"||T(z,H)==="E"){H++,(T(z,H)==="+"||T(z,H)==="-")&&H++;var at=H;if(H=this.skip(k,H),at===H)throw new C("Failed to parse number's exponent value at: "+H)}return this.node(L,x(R(z,N,H)),N,H)},keyword:function(z){var N=""+z,H=this.index,at=H+N.length;if(R(this.source,H,at)!==N)throw new C("Failed to parse value at: "+H);return this.node(L,z,H,at)},skip:function(z,N){for(var H=this.source;N<H.length&&_(z,T(H,N));N++);return N},until:function(z,N){N=this.skip(B,N);for(var H=T(this.source,N),at=0;at<z.length;at++)if(z[at]===H)return N;throw new C('Unexpected character: "'+H+'" at: '+N)}};var os=w(function(){var z="9007199254740993",N;return P(z,function(H,at,St){N=St.source}),N!==z}),ti=S&&!w(function(){return 1/P("-0 ")!==-1/0});i({target:"JSON",stat:!0,forced:os},{parse:function(N,H){return ti&&!c(H)?P(N):rt(N,H)}})},8469:(h,t,e)=>{var i=e(9504),s=e(507),n=e(4402),r=n.Set,o=n.proto,l=i(o.forEach),c=i(o.keys),u=c(new r).next;h.exports=function(d,f,g){return g?s({iterator:c(d),next:u},f):l(d,f)}},8480:(h,t,e)=>{var i=e(1828),s=e(8727),n=s.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(o){return i(o,n)}},8527:(h,t,e)=>{var i=e(7080),s=e(4402).has,n=e(5170),r=e(3789),o=e(507),l=e(9539);h.exports=function(u){var d=i(this),f=r(u);if(n(d)<f.size)return!1;var g=f.getIterator();return o(g,function(v){if(!s(d,v))return l(g,"normal",!1)})!==!1}},8551:(h,t,e)=>{var i=e(34),s=String,n=TypeError;h.exports=function(r){if(i(r))return r;throw new n(s(r)+" is not an object")}},8622:(h,t,e)=>{var i=e(4576),s=e(4901),n=i.WeakMap;h.exports=s(n)&&/native code/.test(String(n))},8686:(h,t,e)=>{var i=e(3724),s=e(9039);h.exports=i&&s(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},8721:(h,t,e)=>{var i=e(3724),s=e(9504),n=e(2106),r=URLSearchParams.prototype,o=s(r.forEach);i&&!("size"in r)&&n(r,"size",{get:function(){var c=0;return o(this,function(){c++}),c},configurable:!0,enumerable:!0})},8727:h=>{h.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8750:(h,t,e)=>{var i=e(7080),s=e(4402),n=e(5170),r=e(3789),o=e(8469),l=e(507),c=s.Set,u=s.add,d=s.has;h.exports=function(g){var v=i(this),y=r(g),w=new c;return n(v)>y.size?l(y.getIterator(),function(A){d(v,A)&&u(w,A)}):o(v,function(A){y.includes(A)&&u(w,A)}),w}},8773:(h,t)=>{var e={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,s=i&&!e.call({1:2},1);t.f=s?function(r){var o=i(this,r);return!!o&&o.enumerable}:e},8981:(h,t,e)=>{var i=e(7750),s=Object;h.exports=function(n){return s(i(n))}},9039:h=>{h.exports=function(t){try{return!!t()}catch(e){return!0}}},9286:(h,t,e)=>{var i=e(4402),s=e(8469),n=i.Set,r=i.add;h.exports=function(o){var l=new n;return s(o,function(c){r(l,c)}),l}},9297:(h,t,e)=>{var i=e(9504),s=e(8981),n=i({}.hasOwnProperty);h.exports=Object.hasOwn||function(o,l){return n(s(o),l)}},9306:(h,t,e)=>{var i=e(4901),s=e(6823),n=TypeError;h.exports=function(r){if(i(r))return r;throw new n(s(r)+" is not a function")}},9429:(h,t,e)=>{var i=e(4576),s=e(6193);h.exports=function(n){if(s){try{return i.process.getBuiltinModule(n)}catch(r){}try{return Function('return require("'+n+'")')()}catch(r){}}}},9433:(h,t,e)=>{var i=e(4576),s=Object.defineProperty;h.exports=function(n,r){try{s(i,n,{value:r,configurable:!0,writable:!0})}catch(o){i[n]=r}return r}},9462:(h,t,e)=>{var i=e(9565),s=e(2360),n=e(6699),r=e(6279),o=e(8227),l=e(1181),c=e(5966),u=e(7657).IteratorPrototype,d=e(2529),f=e(9539),g=e(1385),v=o("toStringTag"),y="IteratorHelper",w="WrapForValidIterator",A="normal",S="throw",E=l.set,x=function(F){var I=l.getterFor(F?w:y);return r(s(u),{next:function(){var R=I(this);if(F)return R.nextHandler();if(R.done)return d(void 0,!0);try{var _=R.nextHandler();return R.returnHandlerResult?_:d(_,R.done)}catch(j){throw R.done=!0,j}},return:function(){var T=I(this),R=T.iterator;if(T.done=!0,F){var _=c(R,"return");return _?i(_,R):d(void 0,!0)}if(T.inner)try{f(T.inner.iterator,A)}catch(j){return f(R,S,j)}if(T.openIters)try{g(T.openIters,A)}catch(j){return f(R,S,j)}return R&&f(R,A),d(void 0,!0)}})},C=x(!0),P=x(!1);n(P,v,"Iterator Helper"),h.exports=function(F,I,T){var R=function(j,k){k?(k.iterator=j.iterator,k.next=j.next):k=j,k.type=I?w:y,k.returnHandlerResult=!!T,k.nextHandler=F,k.counter=0,k.done=!1,E(this,k)};return R.prototype=I?C:P,R}},9504:(h,t,e)=>{var i=e(616),s=Function.prototype,n=s.call,r=i&&s.bind.bind(n,n);h.exports=i?r:function(o){return function(){return n.apply(o,arguments)}}},9519:(h,t,e)=>{var i=e(4576),s=e(2839),n=i.process,r=i.Deno,o=n&&n.versions||r&&r.version,l=o&&o.v8,c,u;l&&(c=l.split("."),u=c[0]>0&&c[0]<4?1:+(c[0]+c[1])),!u&&s&&(c=s.match(/Edge\/(\d+)/),(!c||c[1]>=74)&&(c=s.match(/Chrome\/(\d+)/),c&&(u=+c[1]))),h.exports=u},9539:(h,t,e)=>{var i=e(9565),s=e(8551),n=e(5966);h.exports=function(r,o,l){var c,u;s(r);try{if(c=n(r,"return"),!c){if(o==="throw")throw l;return l}c=i(c,r)}catch(d){u=!0,c=d}if(o==="throw")throw l;if(u)throw c;return s(c),l}},9565:(h,t,e)=>{var i=e(616),s=Function.prototype.call;h.exports=i?s.bind(s):function(){return s.apply(s,arguments)}},9577:(h,t,e)=>{var i=e(9928),s=e(4644),n=e(1108),r=e(1291),o=e(5854),l=s.aTypedArray,c=s.getTypedArrayConstructor,u=s.exportTypedArrayMethod,d=function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(g){return g===8}}(),f=d&&function(){try{new Int8Array(1).with(-.5,1)}catch(g){return!0}}();u("with",function(g,v){var y=l(this),w=r(g),A=n(y)?o(v):+v;return i(y,c(y),w,A)},!d||f)},9617:(h,t,e)=>{var i=e(5397),s=e(5610),n=e(6198),r=function(o){return function(l,c,u){var d=i(l),f=n(d);if(f===0)return!o&&-1;var g=s(u,f),v;if(o&&c!==c){for(;f>g;)if(v=d[g++],v!==v)return!0}else for(;f>g;g++)if((o||g in d)&&d[g]===c)return o||g||0;return!o&&-1}};h.exports={includes:r(!0),indexOf:r(!1)}},9835:h=>{h.exports=function(t){try{var e=new Set,i={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}},s=e[t](i);return s.size===1&&s.values().next().value===4}catch(n){return!1}}},9928:(h,t,e)=>{var i=e(6198),s=e(1291),n=RangeError;h.exports=function(r,o,l,c){var u=i(r),d=s(l),f=d<0?u+d:d;if(f>=u||f<0)throw new n("Incorrect index");for(var g=new o(u),v=0;v<u;v++)g[v]=v===f?c:r[v];return g}}},Z0={};function Lt(h){var t=Z0[h];if(t!==void 0)return t.exports;var e=Z0[h]={exports:{}};return tx[h].call(e.exports,e,e.exports,Lt),e.exports}Lt(4114);Lt(6573);Lt(8100);Lt(7936);Lt(8111);Lt(2489);Lt(7588);Lt(1701);Lt(4628);Lt(7642);Lt(8004);Lt(3853);Lt(5876);Lt(2475);Lt(5024);Lt(1698);Lt(9577);Lt(4603);Lt(7566);Lt(8721);const{AbortException:ex,AnnotationEditorLayer:ix,AnnotationEditorParamsType:yT,AnnotationEditorType:ei,AnnotationEditorUIManager:sx,AnnotationLayer:nx,AnnotationMode:kn,AnnotationType:EA,build:wT,ColorPicker:AT,createValidAbsoluteUrl:SA,DOMSVGFactory:ET,DrawLayer:rx,FeatureTest:ax,fetchData:Q0,getDocument:ST,getFilenameFromUrl:xT,getPdfFilenameFromUrl:ox,getRGB:CT,getUuid:PT,getXfaPageViewport:TT,GlobalWorkerOptions:FT,ImageKind:IT,InvalidPDFException:RT,isDataScheme:_T,isPdfFile:lx,isValidExplicitDest:hx,MathClamp:xA,noContextMenu:DT,normalizeUnicode:cx,OPS:LT,OutputScale:up,PasswordResponses:MT,PDFDataRangeTransport:NT,PDFDateString:OT,PDFWorker:kT,PermissionFlag:Tf,PixelsPerInch:Ys,RenderingCancelledException:hv,ResponseException:BT,setLayerDimensions:CA,shadow:kp,SignatureExtractor:jT,stopEvent:cv,SupportedImageMimeTypes:VT,TextLayer:ux,TouchManager:HT,updateUrlHash:dx,Util:p0,VerbosityLevel:$T,version:J0,XfaLayer:Rg}=globalThis.pdfjsLib,fx="auto",PA=1,q0=1.1,px=.1,gx=10,_g=0,mx=1.25,tb=40,eb=5,bt={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},gl={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},Os={DISABLE:0,ENABLE:1,ENABLE_PERMISSIONS:2},dt={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},Le={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};function TA(h,t,e=!1){let i=h.offsetParent;if(!i){console.error("offsetParent is not set -- cannot scroll");return}let s=h.offsetTop+h.clientTop,n=h.offsetLeft+h.clientLeft;for(;i.clientHeight===i.scrollHeight&&i.clientWidth===i.scrollWidth||e&&(i.classList.contains("markedContent")||getComputedStyle(i).overflow==="hidden");)if(s+=i.offsetTop,n+=i.offsetLeft,i=i.offsetParent,!i)return;t&&(t.top!==void 0&&(s+=t.top),t.left!==void 0&&(n+=t.left,i.scrollLeft=n)),i.scrollTop=s}function vx(h,t,e=void 0){const i=function(r){n||(n=window.requestAnimationFrame(function(){n=null;const l=h.scrollLeft,c=s.lastX;l!==c&&(s.right=l>c),s.lastX=l;const u=h.scrollTop,d=s.lastY;u!==d&&(s.down=u>d),s.lastY=u,t(s)}))},s={right:!0,down:!0,lastX:h.scrollLeft,lastY:h.scrollTop,_eventHandler:i};let n=null;return h.addEventListener("scroll",i,{useCapture:!0,signal:e}),e==null||e.addEventListener("abort",()=>window.cancelAnimationFrame(n),{once:!0}),s}function vg(h){const t=new Map;for(const[e,i]of new URLSearchParams(h))t.set(e.toLowerCase(),i);return t}const ib=/[\x00-\x1F]/g;function kc(h,t=!1){return ib.test(h)?t?h.replaceAll(ib,e=>e==="\0"?"":" "):h.replaceAll("\0",""):h}function Xc(h,t,e=0){let i=e,s=h.length-1;if(s<0||!t(h[s]))return h.length;if(t(h[i]))return i;for(;i<s;){const n=i+s>>1,r=h[n];t(r)?s=n:i=n+1}return i}function sb(h){if(Math.floor(h)===h)return[h,1];const t=1/h,e=8;if(t>e)return[1,e];if(Math.floor(t)===t)return[1,t];const i=h>1?t:h;let s=0,n=1,r=1,o=1;for(;;){const c=s+r,u=n+o;if(u>e)break;i<=c/u?(r=c,o=u):(s=c,n=u)}let l;return i-s/n<r/o-i?l=i===h?[s,n]:[n,s]:l=i===h?[r,o]:[o,r],l}function Ff(h,t){return h-h%t}function bx(h,t,e){if(h<2)return h;let i=t[h].div,s=i.offsetTop+i.clientTop;s>=e&&(i=t[h-1].div,s=i.offsetTop+i.clientTop);for(let n=h-2;n>=0&&(i=t[n].div,!(i.offsetTop+i.clientTop+i.clientHeight<=s));--n)h=n;return h}function yx({scrollEl:h,views:t,sortByVisibility:e=!1,horizontal:i=!1,rtl:s=!1}){const n=h.scrollTop,r=n+h.clientHeight,o=h.scrollLeft,l=o+h.clientWidth;function c(S){const E=S.div;return E.offsetTop+E.clientTop+E.clientHeight>n}function u(S){const E=S.div,x=E.offsetLeft+E.clientLeft,C=x+E.clientWidth;return s?x<l:C>o}const d=[],f=new Set,g=t.length;let v=Xc(t,i?u:c);v>0&&v<g&&!i&&(v=bx(v,t,n));let y=i?l:-1;for(let S=v;S<g;S++){const E=t[S],x=E.div,C=x.offsetLeft+x.clientLeft,P=x.offsetTop+x.clientTop,F=x.clientWidth,I=x.clientHeight,T=C+F,R=P+I;if(y===-1)R>=r&&(y=R);else if((i?C:P)>y)break;if(R<=n||P>=r||T<=o||C>=l)continue;const _=Math.max(0,n-P),j=Math.max(0,o-C),k=_+Math.max(0,R-r),U=j+Math.max(0,T-l),ft=(I-k)/I,B=(F-U)/F,L=ft*B*100|0;d.push({id:E.id,x:C,y:P,visibleArea:L===100?null:{minX:j,minY:_,maxX:Math.min(T,l)-C,maxY:Math.min(R,r)-P},view:E,percent:L,widthPercent:B*100|0}),f.add(E.id)}const w=d[0],A=d.at(-1);return e&&d.sort(function(S,E){const x=S.percent-E.percent;return Math.abs(x)>.001?-x:S.id-E.id}),{first:w,last:A,views:d,ids:f}}function FA(h){return Number.isInteger(h)&&h%90===0}function wx(h){return Number.isInteger(h)&&Object.values(dt).includes(h)&&h!==dt.UNKNOWN}function Ax(h){return Number.isInteger(h)&&Object.values(Le).includes(h)&&h!==Le.UNKNOWN}function nb(h){return h.width<=h.height}new Promise(function(h){window.requestAnimationFrame(h)});const Ex=document.documentElement.style;var jr,Ro,Vr,Ih,_o;class Sx{constructor(t){b(this,jr,null);b(this,Ro,null);b(this,Vr,0);b(this,Ih,null);b(this,_o,!0);p(this,jr,t.classList),p(this,Ih,t.style)}get percent(){return a(this,Vr)}set percent(t){if(p(this,Vr,xA(t,0,100)),isNaN(t)){a(this,jr).add("indeterminate");return}a(this,jr).remove("indeterminate"),a(this,Ih).setProperty("--progressBar-percent","".concat(a(this,Vr),"%"))}setWidth(t){if(!t)return;const i=t.parentNode.offsetWidth-t.offsetWidth;i>0&&a(this,Ih).setProperty("--progressBar-end-offset","".concat(i,"px"))}setDisableAutoFetch(t=5e3){a(this,Vr)===100||isNaN(a(this,Vr))||(a(this,Ro)&&clearTimeout(a(this,Ro)),this.show(),p(this,Ro,setTimeout(()=>{p(this,Ro,null),this.hide()},t)))}hide(){a(this,_o)&&(p(this,_o,!1),a(this,jr).add("hidden"))}show(){a(this,_o)||(p(this,_o,!0),a(this,jr).remove("hidden"))}}jr=new WeakMap,Ro=new WeakMap,Vr=new WeakMap,Ih=new WeakMap,_o=new WeakMap;function xx(h){let t=dt.VERTICAL,e=Le.NONE;switch(h){case"SinglePage":t=dt.PAGE;break;case"OneColumn":break;case"TwoPageLeft":t=dt.PAGE;case"TwoColumnLeft":e=Le.ODD;break;case"TwoPageRight":t=dt.PAGE;case"TwoColumnRight":e=Le.EVEN;break}return{scrollMode:t,spreadMode:e}}const If=function(){const h=document.createElement("div");return h.style.width="round(down, calc(1.6666666666666665 * 792px), 1px)",h.style.width==="calc(1320px)"?Math.fround:t=>t}(),Hi={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};function Cx(h){return h<11904}function Px(h){return(h&65408)===0}function Tx(h){return h>=97&&h<=122||h>=65&&h<=90}function Fx(h){return h>=48&&h<=57}function Ix(h){return h===32||h===9||h===13||h===10}function Rx(h){return h>=13312&&h<=40959||h>=63744&&h<=64255}function _x(h){return h>=12448&&h<=12543}function Dx(h){return h>=12352&&h<=12447}function Lx(h){return h>=65376&&h<=65439}function Mx(h){return(h&65408)===3584}function Rf(h){return Cx(h)?Px(h)?Ix(h)?Hi.SPACE:Tx(h)||Fx(h)||h===95?Hi.ALPHA_LETTER:Hi.PUNCT:Mx(h)?Hi.THAI_LETTER:h===160?Hi.SPACE:Hi.ALPHA_LETTER:Rx(h)?Hi.HAN_LETTER:_x(h)?Hi.KATAKANA_LETTER:Dx(h)?Hi.HIRAGANA_LETTER:Lx(h)?Hi.HALFWIDTH_KATAKANA_LETTER:Hi.ALPHA_LETTER}let rb;function Nx(){return rb||(rb=" ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩"),rb}const Gn={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3},Ox=250,kx=-50,Bx=-400,ab={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},ob=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]);let lb;const jx=new RegExp("\\p{M}+","gu"),Vx=new RegExp("([.*+?^${}()|[\\]\\\\])|(\\p{P})|(\\s+)|(\\p{M})|(\\p{L})","gu"),Hx=new RegExp("([^\\p{M}])\\p{M}*$","u"),$x=new RegExp("^\\p{M}*([^\\p{M}])","u"),Ux=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,hb=new Map,Wx="[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]",cb=new Map;let Dg=null,Lg=null;function dp(h,t={}){var S;const e=[];let i;for(;(i=Ux.exec(h))!==null;){let{index:E}=i;for(const x of i[0]){let C=hb.get(x);C||(C=x.normalize("NFD").length,hb.set(x,C)),e.push([C,E++])}}const s=e.length>0,n=(S=t.ignoreDashEOL)!=null?S:!1;let r;if(!s&&Dg)r=Dg;else if(s&&Lg)r=Lg;else{const E=Object.keys(ab).join(""),x=Nx(),I=["[".concat(E,"]"),"[".concat(x,"]"),"".concat("(?:゙|゚)","\\n"),"\\p{M}+(?:-\\n)?","".concat("\\p{Ll}-\\n(?=\\p{Ll})|\\p{Lu}-\\n(?=\\p{L})"),"\\S-\\n","".concat("(?:\\p{Ideographic}|[-ヿ])","\\n"),"\\n",s?Wx:"\\u0000"];r=new RegExp(I.map(T=>"(".concat(T,")")).join("|"),"gum"),s?Lg=r:Dg=r}const o=[];for(;(i=jx.exec(h))!==null;)o.push([i[0].length,i.index]);let l=h.normalize("NFD");const c=[0,0];let u=0,d=0,f=0,g=0,v=0,y=!1;l=l.replace(r,(E,x,C,P,F,I,T,R,_,j,k)=>{var U,ft,B;if(k-=g,x){const L=ab[x],et=L.length;for(let rt=1;rt<et;rt++)c.push(k-f+rt,f-rt);return f-=et-1,L}if(C){let L=cb.get(C);L||(L=C.normalize("NFKC"),cb.set(C,L));const et=L.length;for(let rt=1;rt<et;rt++)c.push(k-f+rt,f-rt);return f-=et-1,L}if(P)return y=!0,k+v===((U=o[u])==null?void 0:U[1])?++u:(c.push(k-1-f+1,f-1),f-=1,g+=1),c.push(k-f+1,f),g+=1,v+=1,P.charAt(0);if(F){const L=F.endsWith("\n"),et=L?F.length-2:F.length;y=!0;let rt=et;k+v===((ft=o[u])==null?void 0:ft[1])&&(rt-=o[u][0],++u);for(let _t=1;_t<=rt;_t++)c.push(k-1-f+_t,f-_t);return f-=rt,g+=rt,L?(k+=et-1,c.push(k-f+1,1+f),f+=1,g+=1,v+=1,F.slice(0,et)):F}if(I){if(n)return g+=1,v+=1,I.slice(0,-1);const L=I.length-2;return c.push(k-f+L,1+f),f+=1,g+=1,v+=1,I.slice(0,-2)}if(T)return g+=1,v+=1,T.slice(0,-1);if(R){const L=R.length-1;return c.push(k-f+L,f),g+=1,v+=1,R.slice(0,-1)}if(_)return c.push(k-f+1,f-1),f-=1,g+=1,v+=1," ";if(k+v===((B=e[d])==null?void 0:B[1])){const L=e[d][0]-1;++d;for(let et=1;et<=L;et++)c.push(k-(f-et),f-et);f-=L,g+=L}return j}),c.push(l.length,f);const w=new Uint32Array(c.length>>1),A=new Int32Array(c.length>>1);for(let E=0,x=c.length;E<x;E+=2)w[E>>1]=c[E],A[E>>1]=c[E+1];return[l,[w,A],y]}function IA(h,t,e){if(!h)return[t,e];const[i,s]=h,n=t,r=t+e-1;let o=Xc(i,f=>f>=n);i[o]>n&&--o;let l=Xc(i,f=>f>=r,o);i[l]>r&&--l;const c=n+s[o],d=r+s[l]+1-c;return[c,d]}var se,Rh,Do,Y,_A,uv,dv,DA,LA,fv,MA,NA,fp,Tc,rl,OA,pv,gv,pp,kA,mv,vv,Fc;class RA{constructor({linkService:t,eventBus:e,updateMatchesCountOnProgress:i=!0}){b(this,Y);b(this,se,null);b(this,Rh,!0);b(this,Do,0);this._linkService=t,this._eventBus=e,p(this,Rh,i),this.onIsPageVisible=null,m(this,Y,uv).call(this),e._on("find",m(this,Y,_A).bind(this)),e._on("findbarclose",m(this,Y,kA).bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return a(this,se)}setDocument(t){this._pdfDocument&&m(this,Y,uv).call(this),t&&(this._pdfDocument=t,this._firstPageCapability.resolve())}scrollMatchIntoView({element:t=null,selectedLeft:e=0,pageIndex:i=-1,matchIndex:s=-1}){if(!this._scrollMatches||!t)return;if(s===-1||s!==this._selected.matchIdx)return;if(i===-1||i!==this._selected.pageIdx)return;this._scrollMatches=!1;const n={top:kx,left:e+Bx};TA(t,n,!0)}match(t,e,i){const s=this._hasDiacritics[i];let n=!1;if(typeof t=="string"?[n,t]=m(this,Y,fv).call(this,t,s):t=t.sort().reverse().map(d=>{const[f,g]=m(this,Y,fv).call(this,d,s);return n||(n=f),"(".concat(g,")")}).join("|"),!t)return;const{caseSensitive:r,entireWord:o}=a(this,se),l="g".concat(n?"u":"").concat(r?"":"i");t=new RegExp(t,l);const c=[];let u;for(;(u=t.exec(e))!==null;)o&&!m(this,Y,LA).call(this,e,u.index,u[0].length)||c.push({index:u.index,length:u[0].length});return c}}se=new WeakMap,Rh=new WeakMap,Do=new WeakMap,Y=new WeakSet,_A=function(t){if(!t)return;const e=this._pdfDocument,{type:i}=t;(a(this,se)===null||m(this,Y,DA).call(this,t))&&(this._dirtyMatch=!0),p(this,se,t),i!=="highlightallchange"&&m(this,Y,Fc).call(this,Gn.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||e&&this._pdfDocument!==e)return;m(this,Y,NA).call(this);const s=!this._highlightMatches,n=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),i?this._dirtyMatch?m(this,Y,rl).call(this):i==="again"?(m(this,Y,rl).call(this),s&&a(this,se).highlightAll&&m(this,Y,Tc).call(this)):i==="highlightallchange"?(n?m(this,Y,rl).call(this):this._highlightMatches=!0,m(this,Y,Tc).call(this)):m(this,Y,rl).call(this):this._findTimeout=setTimeout(()=>{m(this,Y,rl).call(this),this._findTimeout=null},Ox)})},uv=function(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],p(this,Do,0),p(this,se,null),this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=Promise.withResolvers()},dv=function(){const{query:t}=a(this,se);return typeof t=="string"?(t!==this._rawQuery&&(this._rawQuery=t,[this._normalizedQuery]=dp(t)),this._normalizedQuery):(t||[]).filter(e=>!!e).map(e=>dp(e)[0])},DA=function(t){var r,o;const e=t.query,i=a(this,se).query,s=typeof e;if(s!==typeof i)return!0;if(s==="string"){if(e!==i)return!0}else if(JSON.stringify(e)!==JSON.stringify(i))return!0;switch(t.type){case"again":const l=this._selected.pageIdx+1,c=this._linkService;return l>=1&&l<=c.pagesCount&&l!==c.page&&!((o=(r=this.onIsPageVisible)==null?void 0:r.call(this,l))==null||o);case"highlightallchange":return!1}return!0},LA=function(t,e,i){let s=t.slice(0,e).match(Hx);if(s){const n=t.charCodeAt(e),r=s[1].charCodeAt(0);if(Rf(n)===Rf(r))return!1}if(s=t.slice(e+i).match($x),s){const n=t.charCodeAt(e+i-1),r=s[1].charCodeAt(0);if(Rf(n)===Rf(r))return!1}return!0},fv=function(t,e){const{matchDiacritics:i}=a(this,se);let s=!1;t=t.replaceAll(Vx,(r,o,l,c,u,d)=>o?"[ ]*\\".concat(o,"[ ]*"):l?"[ ]*".concat(l,"[ ]*"):c?"[ ]+":i?u||d:u?ob.has(u.charCodeAt(0))?u:"":e?(s=!0,"".concat(d,"\\p{M}*")):d);const n="[ ]*";return t.endsWith(n)&&(t=t.slice(0,t.length-n.length)),i&&e&&(lb||(lb=String.fromCharCode(...ob)),s=!0,t="".concat(t,"(?=[").concat(lb,"]|[^\\p{M}]|$)")),[s,t]},MA=function(t){if(!a(this,se))return;const e=a(this,Y,dv);if(e.length===0)return;const i=this._pageContents[t],s=this.match(e,i,t),n=this._pageMatches[t]=[],r=this._pageMatchesLength[t]=[],o=this._pageDiffs[t];s==null||s.forEach(({index:c,length:u})=>{const[d,f]=IA(o,c,u);f&&(n.push(d),r.push(f))}),a(this,se).highlightAll&&m(this,Y,fp).call(this,t),this._resumePageIdx===t&&(this._resumePageIdx=null,m(this,Y,pv).call(this));const l=n.length;this._matchesCountTotal+=l,a(this,Rh)?l>0&&m(this,Y,vv).call(this):++ge(this,Do)._===this._linkService.pagesCount&&m(this,Y,vv).call(this)},NA=function(){if(this._extractTextPromises.length>0)return;let t=Promise.resolve();const e={disableNormalization:!0},i=this._pdfDocument;for(let s=0,n=this._linkService.pagesCount;s<n;s++){const{promise:r,resolve:o}=Promise.withResolvers();this._extractTextPromises[s]=r,t=t.then(async()=>{if(i!==this._pdfDocument){o();return}await i.getPage(s+1).then(l=>l.getTextContent(e)).then(l=>{const c=[];for(const u of l.items)c.push(u.str),u.hasEOL&&c.push("\n");[this._pageContents[s],this._pageDiffs[s],this._hasDiacritics[s]]=dp(c.join("")),o()},l=>{console.error("Unable to get text content for page ".concat(s+1),l),this._pageContents[s]="",this._pageDiffs[s]=null,this._hasDiacritics[s]=!1,o()})})}},fp=function(t){this._scrollMatches&&this._selected.pageIdx===t&&(this._linkService.page=t+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:t})},Tc=function(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})},rl=function(){const t=a(this,se).findPrevious,e=this._linkService.page-1,i=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=e,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,p(this,Do,0),this._matchesCountTotal=0,m(this,Y,Tc).call(this);for(let r=0;r<i;r++)this._pendingFindMatches.has(r)||(this._pendingFindMatches.add(r),this._extractTextPromises[r].then(()=>{this._pendingFindMatches.delete(r),m(this,Y,MA).call(this,r)}))}if(a(this,Y,dv).length===0){m(this,Y,Fc).call(this,Gn.FOUND);return}if(this._resumePageIdx)return;const n=this._offset;if(this._pagesToSearch=i,n.matchIdx!==null){const r=this._pageMatches[n.pageIdx].length;if(!t&&n.matchIdx+1<r||t&&n.matchIdx>0){n.matchIdx=t?n.matchIdx-1:n.matchIdx+1,m(this,Y,pp).call(this,!0);return}m(this,Y,gv).call(this,t)}m(this,Y,pv).call(this)},OA=function(t){const e=this._offset,i=t.length,s=a(this,se).findPrevious;return i?(e.matchIdx=s?i-1:0,m(this,Y,pp).call(this,!0),!0):(m(this,Y,gv).call(this,s),e.wrapped&&(e.matchIdx=null,this._pagesToSearch<0)?(m(this,Y,pp).call(this,!1),!0):!1)},pv=function(){this._resumePageIdx!==null&&console.error("There can only be one pending page.");let t=null;do{const e=this._offset.pageIdx;if(t=this._pageMatches[e],!t){this._resumePageIdx=e;break}}while(!m(this,Y,OA).call(this,t))},gv=function(t){const e=this._offset,i=this._linkService.pagesCount;e.pageIdx=t?e.pageIdx-1:e.pageIdx+1,e.matchIdx=null,this._pagesToSearch--,(e.pageIdx>=i||e.pageIdx<0)&&(e.pageIdx=t?i-1:0,e.wrapped=!0)},pp=function(t=!1){let e=Gn.NOT_FOUND;const i=this._offset.wrapped;if(this._offset.wrapped=!1,t){const s=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,e=i?Gn.WRAPPED:Gn.FOUND,s!==-1&&s!==this._selected.pageIdx&&m(this,Y,fp).call(this,s)}m(this,Y,Fc).call(this,e,a(this,se).findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,m(this,Y,fp).call(this,this._selected.pageIdx))},kA=function(t){const e=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||e&&this._pdfDocument!==e||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),m(this,Y,Fc).call(this,Gn.FOUND),this._highlightMatches=!1,m(this,Y,Tc).call(this))})},mv=function(){var n;const{pageIdx:t,matchIdx:e}=this._selected;let i=0,s=this._matchesCountTotal;if(e!==-1){for(let r=0;r<t;r++)i+=((n=this._pageMatches[r])==null?void 0:n.length)||0;i+=e+1}return(i<1||i>s)&&(i=s=0),{current:i,total:s}},vv=function(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:m(this,Y,mv).call(this)})},Fc=function(t,e=!1){var i,s,n,r;!a(this,Rh)&&(a(this,Do)!==this._linkService.pagesCount||t===Gn.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:t,previous:e,entireWord:(s=(i=a(this,se))==null?void 0:i.entireWord)!=null?s:null,matchesCount:m(this,Y,mv).call(this),rawQuery:(r=(n=a(this,se))==null?void 0:n.query)!=null?r:null})};Lt(8335);const zx="noopener noreferrer nofollow",ga={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};class g0{constructor({eventBus:t,externalLinkTarget:e=null,externalLinkRel:i=null,ignoreDestinationZoom:s=!1}={}){M(this,"externalLinkEnabled",!0);this.eventBus=t,this.externalLinkTarget=e,this.externalLinkRel=i,this._ignoreDestinationZoom=s,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(t,e=null){this.baseUrl=e,this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setHistory(t){this.pdfHistory=t}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfDocument?this.pdfViewer.currentPageNumber:1}set page(t){this.pdfDocument&&(this.pdfViewer.currentPageNumber=t)}get rotation(){return this.pdfDocument?this.pdfViewer.pagesRotation:0}set rotation(t){this.pdfDocument&&(this.pdfViewer.pagesRotation=t)}get isInPresentationMode(){return this.pdfDocument?this.pdfViewer.isInPresentationMode:!1}async goToDestination(t){if(!this.pdfDocument)return;let e,i,s;if(typeof t=="string"?(e=t,i=await this.pdfDocument.getDestination(t)):(e=null,i=await t),!Array.isArray(i)){console.error('goToDestination: "'.concat(i,'" is not a valid destination array, for dest="').concat(t,'".'));return}const[n]=i;if(n&&typeof n=="object"){if(s=this.pdfDocument.cachedPageNumber(n),!s)try{s=await this.pdfDocument.getPageIndex(n)+1}catch(o){console.error('goToDestination: "'.concat(n,'" is not a valid page reference, for dest="').concat(t,'".'));return}}else Number.isInteger(n)&&(s=n+1);if(!s||s<1||s>this.pagesCount){console.error('goToDestination: "'.concat(s,'" is not a valid page number, for dest="').concat(t,'".'));return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:e,explicitDest:i,pageNumber:s})),this.pdfViewer.scrollPageIntoView({pageNumber:s,destArray:i,ignoreDestinationZoom:this._ignoreDestinationZoom});const r=new AbortController;this.eventBus._on("textlayerrendered",o=>{o.pageNumber===s&&(o.source.textLayer.div.focus(),r.abort())},{signal:r.signal})}goToPage(t){if(!this.pdfDocument)return;const e=typeof t=="string"&&this.pdfViewer.pageLabelToPageNumber(t)||t|0;if(!(Number.isInteger(e)&&e>0&&e<=this.pagesCount)){console.error('PDFLinkService.goToPage: "'.concat(t,'" is not a valid page.'));return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(e)),this.pdfViewer.scrollPageIntoView({pageNumber:e})}addLinkAttributes(t,e,i=!1){if(!e||typeof e!="string")throw new Error('A valid "url" parameter must provided.');const s=i?ga.BLANK:this.externalLinkTarget,n=this.externalLinkRel;this.externalLinkEnabled?t.href=t.title=e:(t.href="",t.title="Disabled: ".concat(e),t.onclick=()=>!1);let r="";switch(s){case ga.NONE:break;case ga.SELF:r="_self";break;case ga.BLANK:r="_blank";break;case ga.PARENT:r="_parent";break;case ga.TOP:r="_top";break}t.target=r,t.rel=typeof n=="string"?n:zx}getDestinationHash(t){if(typeof t=="string"){if(t.length>0)return this.getAnchorUrl("#"+escape(t))}else if(Array.isArray(t)){const e=JSON.stringify(t);if(e.length>0)return this.getAnchorUrl("#"+escape(e))}return this.getAnchorUrl("")}getAnchorUrl(t){return this.baseUrl?this.baseUrl+t:t}setHash(t){if(!this.pdfDocument)return;let e,i;if(t.includes("=")){const s=vg(t);if(s.has("search")){const n=s.get("search").replaceAll('"',""),r=s.get("phrase")==="true";this.eventBus.dispatch("findfromurlhash",{source:this,query:r?n:n.match(/\S+/g)})}if(s.has("page")&&(e=s.get("page")|0||1),s.has("zoom")){const n=s.get("zoom").split(","),r=n[0],o=parseFloat(r);r.includes("Fit")?r==="Fit"||r==="FitB"?i=[null,{name:r}]:r==="FitH"||r==="FitBH"||r==="FitV"||r==="FitBV"?i=[null,{name:r},n.length>1?n[1]|0:null]:r==="FitR"?n.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):i=[null,{name:r},n[1]|0,n[2]|0,n[3]|0,n[4]|0]:console.error('PDFLinkService.setHash: "'.concat(r,'" is not a valid zoom value.')):i=[null,{name:"XYZ"},n.length>1?n[1]|0:null,n.length>2?n[2]|0:null,o?o/100:r]}i?this.pdfViewer.scrollPageIntoView({pageNumber:e||this.page,destArray:i,allowNegativeOffset:!0}):e&&(this.page=e),s.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:s.get("pagemode")}),s.has("nameddest")&&this.goToDestination(s.get("nameddest"));return}i=unescape(t);try{i=JSON.parse(i),Array.isArray(i)||(i=i.toString())}catch(s){}if(typeof i=="string"||hx(i)){this.goToDestination(i);return}console.error('PDFLinkService.setHash: "'.concat(unescape(t),'" is not a valid destination.'))}executeNamedAction(t){var e,i;if(this.pdfDocument){switch(t){case"GoBack":(e=this.pdfHistory)==null||e.back();break;case"GoForward":(i=this.pdfHistory)==null||i.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break}this.eventBus.dispatch("namedaction",{source:this,action:t})}}async executeSetOCGState(t){if(!this.pdfDocument)return;const e=this.pdfDocument,i=await this.pdfViewer.optionalContentConfigPromise;e===this.pdfDocument&&(i.setOCGState(t),this.pdfViewer.optionalContentConfigPromise=Promise.resolve(i))}}class bg extends g0{setDocument(t,e=null){}}var Hr,Cd,Pd,$r,Td,Vs,bv,yv,jA;class BA{constructor({pdfPage:t,linkService:e,downloadManager:i,annotationStorage:s=null,imageResourcesPath:n="",renderForms:r=!0,enableScripting:o=!1,hasJSActionsPromise:l=null,fieldObjectsPromise:c=null,annotationCanvasMap:u=null,accessibilityManager:d=null,annotationEditorUIManager:f=null,onAppend:g=null}){b(this,Vs);b(this,Hr,null);b(this,Cd,!1);b(this,Pd,null);b(this,$r,null);b(this,Td,!1);this.pdfPage=t,this.linkService=e,this.downloadManager=i,this.imageResourcesPath=n,this.renderForms=r,this.annotationStorage=s,this.enableScripting=o,this._hasJSActionsPromise=l||Promise.resolve(!1),this._fieldObjectsPromise=c||Promise.resolve(null),this._annotationCanvasMap=u,this._accessibilityManager=d,this._annotationEditorUIManager=f,p(this,Pd,g),this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=e.eventBus}async render({viewport:t,intent:e="display",structTreeLayer:i=null}){var l,c;if(this.div){if(this._cancelled||!this.annotationLayer)return;this.annotationLayer.update({viewport:t.clone({dontFlip:!0})});return}const[s,n,r]=await Promise.all([this.pdfPage.getAnnotations({intent:e}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;const o=this.div=document.createElement("div");if(o.className="annotationLayer",(l=a(this,Pd))==null||l.call(this,o),s.length===0){p(this,Hr,s),this.hide(!0);return}m(this,Vs,bv).call(this,t,i),await this.annotationLayer.render({annotations:s,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:n,fieldObjects:r}),p(this,Hr,s),this.linkService.isInPresentationMode&&m(this,Vs,yv).call(this,gl.FULLSCREEN),a(this,$r)||(p(this,$r,new AbortController),(c=this._eventBus)==null||c._on("presentationmodechanged",u=>{m(this,Vs,yv).call(this,u.state)},{signal:a(this,$r).signal}))}cancel(){var t;this._cancelled=!0,(t=a(this,$r))==null||t.abort(),p(this,$r,null)}hide(t=!1){p(this,Cd,!t),this.div&&(this.div.hidden=!0)}hasEditableAnnotations(){var t;return!!((t=this.annotationLayer)!=null&&t.hasEditableAnnotations())}async injectLinkAnnotations({inferredLinks:t,viewport:e,structTreeLayer:i=null}){if(a(this,Hr)===null)throw new Error("`render` method must be called before `injectLinkAnnotations`.");if(this._cancelled||a(this,Td))return;p(this,Td,!0);const s=a(this,Hr).length?m(this,Vs,jA).call(this,t):t;s.length&&(this.annotationLayer||(m(this,Vs,bv).call(this,e,i),CA(this.div,e)),await this.annotationLayer.addLinkAnnotations(s,this.linkService),a(this,Cd)||(this.div.hidden=!1))}}Hr=new WeakMap,Cd=new WeakMap,Pd=new WeakMap,$r=new WeakMap,Td=new WeakMap,Vs=new WeakSet,bv=function(t,e){this.annotationLayer=new nx({div:this.div,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,annotationEditorUIManager:this._annotationEditorUIManager,page:this.pdfPage,viewport:t.clone({dontFlip:!0}),structTreeLayer:e})},yv=function(t){if(!this.div)return;let e=!1;switch(t){case gl.FULLSCREEN:e=!0;break;case gl.NORMAL:break;default:return}for(const i of this.div.childNodes)i.hasAttribute("data-internal-link")||(i.inert=e)},jA=function(t){function e(n){if(!n.quadPoints)return[n.rect];const r=[];for(let o=2,l=n.quadPoints.length;o<l;o+=8){const c=n.quadPoints[o],u=n.quadPoints[o+1],d=n.quadPoints[o+2],f=n.quadPoints[o+3];r.push([d,f,c,u])}return r}function i(n,r){const o=[],l=e(n),c=e(r);for(const u of l)for(const d of c){const f=p0.intersect(u,d);f&&o.push(f)}return o}function s(n){let r=0;for(const o of n)r+=Math.abs((o[2]-o[0])*(o[3]-o[1]));return r}return t.filter(n=>{let r;for(const o of a(this,Hr)){if(o.annotationType!==EA.LINK||!o.url)continue;const l=i(o,n);if(l.length!==0&&(r!=null||(r=s(e(n))),s(l)/r>.5))return!1}return!0})};function ub(h,t){const e=document.createElement("a");if(!e.click)throw new Error('DownloadManager: "a.click()" is not supported.');e.href=h,e.target="_parent","download"in e&&(e.download=t),(document.body||document.documentElement).append(e),e.click(),e.remove()}var s0;class VA{constructor(){b(this,s0,new WeakMap)}downloadData(t,e,i){const s=URL.createObjectURL(new Blob([t],{type:i}));ub(s,e)}openOrDownloadData(t,e,i=null){const n=lx(e)?"application/pdf":"";return this.downloadData(t,e,n),!1}download(t,e,i){let s;if(t)s=URL.createObjectURL(new Blob([t],{type:"application/pdf"}));else{if(!SA(e,"http://example.com")){console.error("download - not a valid URL: ".concat(e));return}s=e+"#pdfjs.action=download"}ub(s,i)}}s0=new WeakMap;const db={EVENT:"event",TIMEOUT:"timeout"};async function Gx({target:h,name:t,delay:e=0}){if(typeof h!="object"||!(Number.isInteger(e)&&e>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");const{promise:i,resolve:s}=Promise.withResolvers(),n=new AbortController;function r(c){n.abort(),clearTimeout(l),s(c)}const o=h instanceof m0?"_on":"addEventListener";h[o](t,r.bind(null,db.EVENT),{signal:n.signal});const l=setTimeout(r.bind(null,db.TIMEOUT),e);return i}var _h;class m0{constructor(){b(this,_h,Object.create(null))}on(t,e,i=null){this._on(t,e,{external:!0,once:i==null?void 0:i.once,signal:i==null?void 0:i.signal})}off(t,e,i=null){this._off(t,e)}dispatch(t,e){const i=a(this,_h)[t];if(!i||i.length===0)return;let s;for(const{listener:n,external:r,once:o}of i.slice(0)){if(o&&this._off(t,n),r){(s||(s=[])).push(n);continue}n(e)}if(s){for(const n of s)n(e);s=null}}_on(t,e,i=null){var r;let s=null;if((i==null?void 0:i.signal)instanceof AbortSignal){const{signal:o}=i;if(o.aborted){console.error("Cannot use an `aborted` signal.");return}const l=()=>this._off(t,e);s=()=>o.removeEventListener("abort",l),o.addEventListener("abort",l)}((r=a(this,_h))[t]||(r[t]=[])).push({listener:e,external:(i==null?void 0:i.external)===!0,once:(i==null?void 0:i.once)===!0,rmAbort:s})}_off(t,e,i=null){var n;const s=a(this,_h)[t];if(s)for(let r=0,o=s.length;r<o;r++){const l=s[r];if(l.listener===e){(n=l.rmAbort)==null||n.call(l),s.splice(r,1);return}}}}_h=new WeakMap;class ml{constructor(t){this.value=t}valueOf(){return this.value}}class qt extends ml{constructor(t="???"){super(t)}toString(t){return"{".concat(this.value,"}")}}class Vn extends ml{constructor(t,e={}){super(t),this.opts=e}toString(t){if(t)try{return t.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(e){t.reportError(e)}return this.value.toString(10)}}class oa extends ml{static supportsValue(t){if(typeof t=="number"||t instanceof Date)return!0;if(t instanceof ml)return oa.supportsValue(t.valueOf());if("Temporal"in globalThis){const e=globalThis.Temporal;if(t instanceof e.Instant||t instanceof e.PlainDateTime||t instanceof e.PlainDate||t instanceof e.PlainMonthDay||t instanceof e.PlainTime||t instanceof e.PlainYearMonth)return!0}return!1}constructor(t,e={}){t instanceof oa?(e={...t.opts,...e},t=t.value):t instanceof ml&&(t=t.valueOf()),typeof t=="object"&&"calendarId"in t&&e.calendar===void 0&&(e={...e,calendar:t.calendarId}),super(t),this.opts=e}[Symbol.toPrimitive](t){return t==="string"?this.toString():this.toNumber()}toNumber(){const t=this.value;if(typeof t=="number")return t;if(t instanceof Date)return t.getTime();if("epochMilliseconds"in t)return t.epochMilliseconds;if("toZonedDateTime"in t)return t.toZonedDateTime("UTC").epochMilliseconds;throw new TypeError("Unwrapping a non-number value as a number")}toString(t){if(t)try{return t.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(e){t.reportError(e)}return typeof this.value=="number"||this.value instanceof Date?new Date(this.value).toISOString():this.value.toString()}}const fb=100,Xx="",Yx="";function Kx(h,t,e){if(e===t||e instanceof Vn&&t instanceof Vn&&e.value===t.value)return!0;if(t instanceof Vn&&typeof e=="string"){let i=h.memoizeIntlObject(Intl.PluralRules,t.opts).select(t.value);if(e===i)return!0}return!1}function pb(h,t,e){return t[e]?Qh(h,t[e].value):(h.reportError(new RangeError("No default")),new qt)}function wv(h,t){const e=[],i=Object.create(null);for(const s of t)s.type==="narg"?i[s.name]=Yc(h,s.value):e.push(Yc(h,s));return{positional:e,named:i}}function Yc(h,t){switch(t.type){case"str":return t.value;case"num":return new Vn(t.value,{minimumFractionDigits:t.precision});case"var":return Zx(h,t);case"mesg":return Qx(h,t);case"term":return Jx(h,t);case"func":return qx(h,t);case"select":return tC(h,t);default:return new qt}}function Zx(h,{name:t}){let e;if(h.params)if(Object.prototype.hasOwnProperty.call(h.params,t))e=h.params[t];else return new qt("$".concat(t));else if(h.args&&Object.prototype.hasOwnProperty.call(h.args,t))e=h.args[t];else return h.reportError(new ReferenceError("Unknown variable: $".concat(t))),new qt("$".concat(t));if(e instanceof ml)return e;switch(typeof e){case"string":return e;case"number":return new Vn(e);case"object":if(oa.supportsValue(e))return new oa(e);default:return h.reportError(new TypeError("Variable type not supported: $".concat(t,", ").concat(typeof e))),new qt("$".concat(t))}}function Qx(h,{name:t,attr:e}){const i=h.bundle._messages.get(t);if(!i)return h.reportError(new ReferenceError("Unknown message: ".concat(t))),new qt(t);if(e){const s=i.attributes[e];return s?Qh(h,s):(h.reportError(new ReferenceError("Unknown attribute: ".concat(e))),new qt("".concat(t,".").concat(e)))}return i.value?Qh(h,i.value):(h.reportError(new ReferenceError("No value: ".concat(t))),new qt(t))}function Jx(h,{name:t,attr:e,args:i}){const s="-".concat(t),n=h.bundle._terms.get(s);if(!n)return h.reportError(new ReferenceError("Unknown term: ".concat(s))),new qt(s);if(e){const o=n.attributes[e];if(o){h.params=wv(h,i).named;const l=Qh(h,o);return h.params=null,l}return h.reportError(new ReferenceError("Unknown attribute: ".concat(e))),new qt("".concat(s,".").concat(e))}h.params=wv(h,i).named;const r=Qh(h,n.value);return h.params=null,r}function qx(h,{name:t,args:e}){let i=h.bundle._functions[t];if(!i)return h.reportError(new ReferenceError("Unknown function: ".concat(t,"()"))),new qt("".concat(t,"()"));if(typeof i!="function")return h.reportError(new TypeError("Function ".concat(t,"() is not callable"))),new qt("".concat(t,"()"));try{let s=wv(h,e);return i(s.positional,s.named)}catch(s){return h.reportError(s),new qt("".concat(t,"()"))}}function tC(h,{selector:t,variants:e,star:i}){let s=Yc(h,t);if(s instanceof qt)return pb(h,e,i);for(const n of e){const r=Yc(h,n.key);if(Kx(h,s,r))return Qh(h,n.value)}return pb(h,e,i)}function HA(h,t){if(h.dirty.has(t))return h.reportError(new RangeError("Cyclic reference")),new qt;h.dirty.add(t);const e=[],i=h.bundle._useIsolating&&t.length>1;for(const s of t){if(typeof s=="string"){e.push(h.bundle._transform(s));continue}if(h.placeables++,h.placeables>fb)throw h.dirty.delete(t),new RangeError("Too many placeables expanded: ".concat(h.placeables,", ")+"max allowed is ".concat(fb));i&&e.push(Xx),e.push(Yc(h,s).toString(h)),i&&e.push(Yx)}return h.dirty.delete(t),e.join("")}function Qh(h,t){return typeof t=="string"?h.bundle._transform(t):HA(h,t)}class eC{constructor(t,e,i){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=t,this.errors=e,this.args=i}reportError(t){if(!this.errors||!(t instanceof Error))throw t;this.errors.push(t)}memoizeIntlObject(t,e){let i=this.bundle._intls.get(t);i||(i={},this.bundle._intls.set(t,i));let s=JSON.stringify(e);return i[s]||(i[s]=new t(this.bundle.locales,e)),i[s]}}function Av(h,t){const e=Object.create(null);for(const[i,s]of Object.entries(h))t.includes(i)&&(e[i]=s.valueOf());return e}const gb=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function iC(h,t){let e=h[0];if(e instanceof qt)return new qt("NUMBER(".concat(e.valueOf(),")"));if(e instanceof Vn)return new Vn(e.valueOf(),{...e.opts,...Av(t,gb)});if(e instanceof oa)return new Vn(e.toNumber(),{...Av(t,gb)});throw new TypeError("Invalid argument to NUMBER")}const sC=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function nC(h,t){let e=h[0];if(e instanceof qt)return new qt("DATETIME(".concat(e.valueOf(),")"));if(e instanceof oa||e instanceof Vn)return new oa(e,Av(t,sC));throw new TypeError("Invalid argument to DATETIME")}const mb=new Map;function rC(h){const t=Array.isArray(h)?h.join(" "):h;let e=mb.get(t);return e===void 0&&(e=new Map,mb.set(t,e)),e}class aC{constructor(t,{functions:e,useIsolating:i=!0,transform:s=n=>n}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(t)?t:[t],this._functions={NUMBER:iC,DATETIME:nC,...e},this._useIsolating=i,this._transform=s,this._intls=rC(t)}hasMessage(t){return this._messages.has(t)}getMessage(t){return this._messages.get(t)}addResource(t,{allowOverrides:e=!1}={}){const i=[];for(let s=0;s<t.body.length;s++){let n=t.body[s];if(n.id.startsWith("-")){if(e===!1&&this._terms.has(n.id)){i.push(new Error('Attempt to override an existing term: "'.concat(n.id,'"')));continue}this._terms.set(n.id,n)}else{if(e===!1&&this._messages.has(n.id)){i.push(new Error('Attempt to override an existing message: "'.concat(n.id,'"')));continue}this._messages.set(n.id,n)}}return i}formatPattern(t,e=null,i=null){if(typeof t=="string")return this._transform(t);let s=new eC(this,i,e);try{return HA(s,t).toString(s)}catch(n){if(s.errors&&n instanceof Error)return s.errors.push(n),new qt().toString(s);throw n}}}const Mg=/^(-?[a-zA-Z][\w-]*) *= */gm,vb=/\.([a-zA-Z][\w-]*) *= */y,oC=/\*?\[/y,Ng=/(-?[0-9]+(?:\.([0-9]+))?)/y,lC=/([a-zA-Z][\w-]*)/y,bb=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,hC=/^[A-Z][A-Z0-9_-]*$/,_f=/([^{}\n\r]+)/y,cC=/([^\\"\n\r]*)/y,yb=/\\([\\"])/y,wb=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,uC=/^\n+/,Ab=/ +$/,dC=/ *\r?\n/g,fC=/( *)$/,pC=/{\s*/y,Eb=/\s*}/y,gC=/\[\s*/y,mC=/\s*] */y,vC=/\s*\(\s*/y,bC=/\s*->\s*/y,yC=/\s*:\s*/y,wC=/\s*,?\s*/y,AC=/\s+/y;class EC{constructor(t){this.body=[],Mg.lastIndex=0;let e=0;for(;;){let T=Mg.exec(t);if(T===null)break;e=Mg.lastIndex;try{this.body.push(l(T[1]))}catch(R){if(R instanceof SyntaxError)continue;throw R}}function i(T){return T.lastIndex=e,T.test(t)}function s(T,R){if(t[e]===T)return e++,!0;if(R)throw new R("Expected ".concat(T));return!1}function n(T,R){if(i(T))return e=T.lastIndex,!0;if(R)throw new R("Expected ".concat(T.toString()));return!1}function r(T){T.lastIndex=e;let R=T.exec(t);if(R===null)throw new SyntaxError("Expected ".concat(T.toString()));return e=T.lastIndex,R}function o(T){return r(T)[1]}function l(T){let R=u(),_=c();if(R===null&&Object.keys(_).length===0)throw new SyntaxError("Expected message value or attributes");return{id:T,value:R,attributes:_}}function c(){let T=Object.create(null);for(;i(vb);){let R=o(vb),_=u();if(_===null)throw new SyntaxError("Expected attribute value");T[R]=_}return T}function u(){let T;if(i(_f)&&(T=o(_f)),t[e]==="{"||t[e]==="}")return d(T?[T]:[],1/0);let R=P();return R?T?d([T,R],R.length):(R.value=F(R.value,uC),d([R],R.length)):T?F(T,Ab):null}function d(T=[],R){for(;;){if(i(_f)){T.push(o(_f));continue}if(t[e]==="{"){T.push(f());continue}if(t[e]==="}")throw new SyntaxError("Unbalanced closing brace");let U=P();if(U){T.push(U),R=Math.min(R,U.length);continue}break}let _=T.length-1,j=T[_];typeof j=="string"&&(T[_]=F(j,Ab));let k=[];for(let U of T)U instanceof Sb&&(U=U.value.slice(0,U.value.length-R)),U&&k.push(U);return k}function f(){n(pC,SyntaxError);let T=g();if(n(Eb))return T;if(n(bC)){let R=w();return n(Eb,SyntaxError),{type:"select",selector:T,...R}}throw new SyntaxError("Unclosed placeable")}function g(){if(t[e]==="{")return f();if(i(bb)){let[,T,R,_=null]=r(bb);if(T==="$")return{type:"var",name:R};if(n(vC)){let j=v();if(T==="-")return{type:"term",name:R,attr:_,args:j};if(hC.test(R))return{type:"func",name:R,args:j};throw new SyntaxError("Function names must be all upper-case")}return T==="-"?{type:"term",name:R,attr:_,args:[]}:{type:"mesg",name:R,attr:_}}return S()}function v(){let T=[];for(;;){switch(t[e]){case")":return e++,T;case void 0:throw new SyntaxError("Unclosed argument list")}T.push(y()),n(wC)}}function y(){let T=g();return T.type!=="mesg"?T:n(yC)?{type:"narg",name:T.name,value:S()}:T}function w(){let T=[],R=0,_;for(;i(oC);){s("*")&&(_=R);let j=A(),k=u();if(k===null)throw new SyntaxError("Expected variant value");T[R++]={key:j,value:k}}if(R===0)return null;if(_===void 0)throw new SyntaxError("Expected default variant");return{variants:T,star:_}}function A(){n(gC,SyntaxError);let T;return i(Ng)?T=E():T={type:"str",value:o(lC)},n(mC,SyntaxError),T}function S(){if(i(Ng))return E();if(t[e]==='"')return x();throw new SyntaxError("Invalid expression")}function E(){let[,T,R=""]=r(Ng),_=R.length;return{type:"num",value:parseFloat(T),precision:_}}function x(){s('"',SyntaxError);let T="";for(;;){if(T+=o(cC),t[e]==="\\"){T+=C();continue}if(s('"'))return{type:"str",value:T};throw new SyntaxError("Unclosed string literal")}}function C(){if(i(yb))return o(yb);if(i(wb)){let[,T,R]=r(wb),_=parseInt(T||R,16);return _<=55295||57344<=_?String.fromCodePoint(_):"�"}throw new SyntaxError("Unknown escape sequence")}function P(){let T=e;switch(n(AC),t[e]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return I(t.slice(T,e))}return t[e-1]===" "?I(t.slice(T,e)):!1}function F(T,R){return T.replace(R,"")}function I(T){let R=T.replace(dC,"\n"),_=fC.exec(T)[1].length;return new Sb(R,_)}}}class Sb{constructor(t,e){this.value=t,this.length=e}}const SC=/<|&#?\w+;/,xC={"http://www.w3.org/1999/xhtml":["em","strong","small","s","cite","q","dfn","abbr","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","bdi","bdo","span","br","wbr"]},CC={"http://www.w3.org/1999/xhtml":{global:["title","aria-description","aria-label","aria-valuetext"],a:["download"],area:["download","alt"],input:["alt","placeholder"],menuitem:["label"],menu:["label"],optgroup:["label"],option:["label"],track:["label"],img:["alt"],textarea:["placeholder"],th:["abbr"]},"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":{global:["accesskey","aria-label","aria-valuetext","label","title","tooltiptext"],description:["value"],key:["key","keycode"],label:["value"],textbox:["placeholder","value"]}};function PC(h,t){const{value:e}=t;if(typeof e=="string")if(h.localName==="title"&&h.namespaceURI==="http://www.w3.org/1999/xhtml")h.textContent=e;else if(!SC.test(e))h.textContent=e;else{const i=h.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","template");i.innerHTML=e,TC(i.content,h)}$A(t,h)}function TC(h,t){for(const e of h.childNodes)if(e.nodeType!==e.TEXT_NODE){if(e.hasAttribute("data-l10n-name")){const i=IC(t,e);h.replaceChild(i,e);continue}if(_C(e)){const i=RC(e);h.replaceChild(i,e);continue}console.warn('An element of forbidden type "'.concat(e.localName,'" was found in ')+"the translation. Only safe text-level elements and elements with data-l10n-name are allowed."),h.replaceChild(Ev(e),e)}t.textContent="",t.appendChild(h)}function FC(h,t){if(!h)return!1;for(let e of h)if(e.name===t)return!0;return!1}function $A(h,t){const e=t.hasAttribute("data-l10n-attrs")?t.getAttribute("data-l10n-attrs").split(",").map(i=>i.trim()):null;for(const i of Array.from(t.attributes))xb(i.name,t,e)&&!FC(h.attributes,i.name)&&t.removeAttribute(i.name);if(h.attributes)for(const i of Array.from(h.attributes))xb(i.name,t,e)&&t.getAttribute(i.name)!==i.value&&t.setAttribute(i.name,i.value)}function IC(h,t){const e=t.getAttribute("data-l10n-name"),i=h.querySelector('[data-l10n-name="'.concat(e,'"]'));if(!i)return console.warn('An element named "'.concat(e,"\" wasn't found in the source.")),Ev(t);if(i.localName!==t.localName)return console.warn('An element named "'.concat(e,'" was found in the translation ')+"but its type ".concat(t.localName," didn't match the ")+"element found in the source (".concat(i.localName,").")),Ev(t);h.removeChild(i);const s=i.cloneNode(!1);return UA(t,s)}function RC(h){const t=h.ownerDocument.createElement(h.localName);return UA(h,t)}function Ev(h){return h.ownerDocument.createTextNode(h.textContent)}function _C(h){const t=xC[h.namespaceURI];return t&&t.includes(h.localName)}function xb(h,t,e=null){if(e&&e.includes(h))return!0;const i=CC[t.namespaceURI];if(!i)return!1;const s=h.toLowerCase(),n=t.localName;if(i.global.includes(s))return!0;if(!i[n])return!1;if(i[n].includes(s))return!0;if(t.namespaceURI==="http://www.w3.org/1999/xhtml"&&n==="input"&&s==="value"){const r=t.type.toLowerCase();if(r==="submit"||r==="button"||r==="reset")return!0}return!1}function UA(h,t){return t.textContent=h.textContent,$A(h,t),t}class DC extends Array{static from(t){return t instanceof this?t:new this(t)}}class LC extends DC{constructor(t){if(super(),Symbol.asyncIterator in Object(t))this.iterator=t[Symbol.asyncIterator]();else if(Symbol.iterator in Object(t))this.iterator=t[Symbol.iterator]();else throw new TypeError("Argument must implement the iteration protocol.")}[Symbol.asyncIterator](){const t=this;let e=0;return{async next(){return t.length<=e&&t.push(t.iterator.next()),t[e++]}}}async touchNext(t=1){let e=0;for(;e++<t;){const i=this[this.length-1];if(i&&(await i).done)break;this.push(this.iterator.next())}return this[this.length-1]}}class MC{constructor(t=[],e){this.resourceIds=t,this.generateBundles=e,this.onChange(!0)}addResourceIds(t,e=!1){return this.resourceIds.push(...t),this.onChange(e),this.resourceIds.length}removeResourceIds(t){return this.resourceIds=this.resourceIds.filter(e=>!t.includes(e)),this.onChange(),this.resourceIds.length}async formatWithFallback(t,e){const i=[];let s=!1;for await(const n of this.bundles){s=!0;const r=kC(e,n,t,i);if(r.size===0)break;if(typeof console<"u"){const o=n.locales[0],l=Array.from(r).join(", ");console.warn("[fluent] Missing translations in ".concat(o,": ").concat(l))}}return!s&&typeof console<"u"&&console.warn("[fluent] Request for keys failed because no resource bundles got generated.\n keys: ".concat(JSON.stringify(t),".\n resourceIds: ").concat(JSON.stringify(this.resourceIds),".")),i}formatMessages(t){return this.formatWithFallback(t,OC)}formatValues(t){return this.formatWithFallback(t,NC)}async formatValue(t,e){const[i]=await this.formatValues([{id:t,args:e}]);return i}handleEvent(){this.onChange()}onChange(t=!1){this.bundles=LC.from(this.generateBundles(this.resourceIds)),t&&this.bundles.touchNext(2)}}function NC(h,t,e,i){return e.value?h.formatPattern(e.value,i,t):null}function OC(h,t,e,i){const s={value:null,attributes:null};e.value&&(s.value=h.formatPattern(e.value,i,t));let n=Object.keys(e.attributes);if(n.length>0){s.attributes=new Array(n.length);for(let[r,o]of n.entries()){let l=h.formatPattern(e.attributes[o],i,t);s.attributes[r]={name:o,value:l}}}return s}function kC(h,t,e,i){const s=[],n=new Set;return e.forEach(({id:r,args:o},l)=>{if(i[l]!==void 0)return;let c=t.getMessage(r);if(c){if(s.length=0,i[l]=h(t,s,c,o),s.length>0&&typeof console<"u"){const u=t.locales[0],d=s.join(", ");console.warn("[fluent][resolver] errors in ".concat(u,"/").concat(r,": ").concat(d,"."))}}else n.add(r)}),n}const ma="data-l10n-id",rc="data-l10n-args",BC="[".concat(ma,"]");class jC extends MC{constructor(t,e){super(t,e),this.roots=new Set,this.pendingrAF=null,this.pendingElements=new Set,this.windowElement=null,this.mutationObserver=null,this.observerConfig={attributes:!0,characterData:!1,childList:!0,subtree:!0,attributeFilter:[ma,rc]}}onChange(t=!1){super.onChange(t),this.roots&&this.translateRoots()}setAttributes(t,e,i){return t.setAttribute(ma,e),i?t.setAttribute(rc,JSON.stringify(i)):t.removeAttribute(rc),t}getAttributes(t){return{id:t.getAttribute(ma),args:JSON.parse(t.getAttribute(rc)||null)}}connectRoot(t){for(const e of this.roots)if(e===t||e.contains(t)||t.contains(e))throw new Error("Cannot add a root that overlaps with existing root.");if(this.windowElement){if(this.windowElement!==t.ownerDocument.defaultView)throw new Error("Cannot connect a root:\n DOMLocalization already has a root from a different window.")}else this.windowElement=t.ownerDocument.defaultView,this.mutationObserver=new this.windowElement.MutationObserver(e=>this.translateMutations(e));this.roots.add(t),this.mutationObserver.observe(t,this.observerConfig)}disconnectRoot(t){return this.roots.delete(t),this.pauseObserving(),this.roots.size===0?(this.mutationObserver=null,this.windowElement&&this.pendingrAF&&this.windowElement.cancelAnimationFrame(this.pendingrAF),this.windowElement=null,this.pendingrAF=null,this.pendingElements.clear(),!0):(this.resumeObserving(),!1)}translateRoots(){const t=Array.from(this.roots);return Promise.all(t.map(e=>this.translateFragment(e)))}pauseObserving(){this.mutationObserver&&(this.translateMutations(this.mutationObserver.takeRecords()),this.mutationObserver.disconnect())}resumeObserving(){if(this.mutationObserver)for(const t of this.roots)this.mutationObserver.observe(t,this.observerConfig)}translateMutations(t){for(const e of t)switch(e.type){case"attributes":e.target.hasAttribute("data-l10n-id")&&this.pendingElements.add(e.target);break;case"childList":for(const i of e.addedNodes)if(i.nodeType===i.ELEMENT_NODE)if(i.childElementCount)for(const s of this.getTranslatables(i))this.pendingElements.add(s);else i.hasAttribute(ma)&&this.pendingElements.add(i);break}this.pendingElements.size>0&&this.pendingrAF===null&&(this.pendingrAF=this.windowElement.requestAnimationFrame(()=>{this.translateElements(Array.from(this.pendingElements)),this.pendingElements.clear(),this.pendingrAF=null}))}translateFragment(t){return this.translateElements(this.getTranslatables(t))}async translateElements(t){if(!t.length)return;const e=t.map(this.getKeysForElement),i=await this.formatMessages(e);return this.applyTranslations(t,i)}applyTranslations(t,e){this.pauseObserving();for(let i=0;i<t.length;i++)e[i]!==void 0&&PC(t[i],e[i]);this.resumeObserving()}getTranslatables(t){const e=Array.from(t.querySelectorAll(BC));return typeof t.hasAttribute=="function"&&t.hasAttribute(ma)&&e.push(t),e}getKeysForElement(t){return{id:t.getAttribute(ma),args:JSON.parse(t.getAttribute(rc)||null)}}}var Fd,Ur,Dh,Ze,Jh,WA,zA;const $c=class $c{constructor({lang:t,isRTL:e},i=null){b(this,Fd);b(this,Ur);b(this,Dh);b(this,Ze);var s,n;p(this,Dh,m(s=$c,Jh,WA).call(s,t)),p(this,Ze,i),p(this,Fd,(e!=null?e:m(n=$c,Jh,zA).call(n,a(this,Dh)))?"rtl":"ltr")}_setL10n(t){p(this,Ze,t)}getLanguage(){return a(this,Dh)}getDirection(){return a(this,Fd)}async get(t,e=null,i){var n;return Array.isArray(t)?(t=t.map(o=>({id:o})),(await a(this,Ze).formatMessages(t)).map(o=>o.value)):((n=(await a(this,Ze).formatMessages([{id:t,args:e}]))[0])==null?void 0:n.value)||i}async translate(t){(a(this,Ur)||p(this,Ur,new Set)).add(t);try{a(this,Ze).connectRoot(t),await a(this,Ze).translateRoots()}catch(e){}}async translateOnce(t){try{await a(this,Ze).translateElements([t])}catch(e){console.error("translateOnce:",e)}}async destroy(){if(a(this,Ur)){for(const t of a(this,Ur))a(this,Ze).disconnectRoot(t);a(this,Ur).clear(),p(this,Ur,null)}a(this,Ze).pauseObserving()}pause(){a(this,Ze).pauseObserving()}resume(){a(this,Ze).resumeObserving()}};Fd=new WeakMap,Ur=new WeakMap,Dh=new WeakMap,Ze=new WeakMap,Jh=new WeakSet,WA=function(t){return t=(t==null?void 0:t.toLowerCase())||"en-us",{en:"en-us",es:"es-es",fy:"fy-nl",ga:"ga-ie",gu:"gu-in",hi:"hi-in",hy:"hy-am",nb:"nb-no",ne:"ne-np",nn:"nn-no",pa:"pa-in",pt:"pt-pt",sv:"sv-se",zh:"zh-cn"}[t]||t},zA=function(t){const e=t.split("-",1)[0];return["ar","he","fa","ps","ur"].includes(e)},b($c,Jh);let Sv=$c;function VC(){const{isAndroid:h,isLinux:t,isMac:e,isWindows:i}=ax.platform;return t?"linux":i?"windows":e?"macos":h?"android":"other"}function Cb(h,t){const e=new EC(t),i=new aC(h,{functions:{PLATFORM:VC}}),s=i.addResource(e);return s.length&&console.error("L10n errors",s),i}var Pi,GA,XA,YA,KA,xv;const Sa=class Sa extends Sv{constructor(t){super({lang:t});const e=t?m(Sa,Pi,GA).bind(Sa,"en-us",this.getLanguage()):m(Sa,Pi,KA).bind(Sa,this.getLanguage());this._setL10n(new jC([],e))}};Pi=new WeakSet,GA=async function*(t,e){const{baseURL:i,paths:s}=await m(this,Pi,YA).call(this),n=[e];if(t!==e){const o=e.split("-",1)[0];o!==e&&n.push(o),n.push(t)}const r=n.map(o=>[o,m(this,Pi,XA).call(this,o,i,s)]);for(const[o,l]of r){const c=await l;c?yield c:o==="en-us"&&(yield m(this,Pi,xv).call(this,o))}},XA=async function(t,e,i){const s=i[t];if(!s)return null;const n=new URL(s,e),r=await Q0(n,"text");return Cb(t,r)},YA=async function(){try{const{href:t}=document.querySelector('link[type="application/l10n"]'),e=await Q0(t,"json");return{baseURL:t.substring(0,t.lastIndexOf("/")+1)||"./",paths:e}}catch(t){}return{baseURL:"./",paths:Object.create(null)}},KA=async function*(t){yield m(this,Pi,xv).call(this,t)},xv=async function(t){return Cb(t,'pdfjs-previous-button =\n .title = Previous Page\npdfjs-previous-button-label = Previous\npdfjs-next-button =\n .title = Next Page\npdfjs-next-button-label = Next\npdfjs-page-input =\n .title = Page\npdfjs-of-pages = of { $pagesCount }\npdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })\npdfjs-zoom-out-button =\n .title = Zoom Out\npdfjs-zoom-out-button-label = Zoom Out\npdfjs-zoom-in-button =\n .title = Zoom In\npdfjs-zoom-in-button-label = Zoom In\npdfjs-zoom-select =\n .title = Zoom\npdfjs-presentation-mode-button =\n .title = Switch to Presentation Mode\npdfjs-presentation-mode-button-label = Presentation Mode\npdfjs-open-file-button =\n .title = Open File\npdfjs-open-file-button-label = Open\npdfjs-print-button =\n .title = Print\npdfjs-print-button-label = Print\npdfjs-save-button =\n .title = Save\npdfjs-save-button-label = Save\npdfjs-download-button =\n .title = Download\npdfjs-download-button-label = Download\npdfjs-bookmark-button =\n .title = Current Page (View URL from Current Page)\npdfjs-bookmark-button-label = Current Page\npdfjs-tools-button =\n .title = Tools\npdfjs-tools-button-label = Tools\npdfjs-first-page-button =\n .title = Go to First Page\npdfjs-first-page-button-label = Go to First Page\npdfjs-last-page-button =\n .title = Go to Last Page\npdfjs-last-page-button-label = Go to Last Page\npdfjs-page-rotate-cw-button =\n .title = Rotate Clockwise\npdfjs-page-rotate-cw-button-label = Rotate Clockwise\npdfjs-page-rotate-ccw-button =\n .title = Rotate Counterclockwise\npdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise\npdfjs-cursor-text-select-tool-button =\n .title = Enable Text Selection Tool\npdfjs-cursor-text-select-tool-button-label = Text Selection Tool\npdfjs-cursor-hand-tool-button =\n .title = Enable Hand Tool\npdfjs-cursor-hand-tool-button-label = Hand Tool\npdfjs-scroll-page-button =\n .title = Use Page Scrolling\npdfjs-scroll-page-button-label = Page Scrolling\npdfjs-scroll-vertical-button =\n .title = Use Vertical Scrolling\npdfjs-scroll-vertical-button-label = Vertical Scrolling\npdfjs-scroll-horizontal-button =\n .title = Use Horizontal Scrolling\npdfjs-scroll-horizontal-button-label = Horizontal Scrolling\npdfjs-scroll-wrapped-button =\n .title = Use Wrapped Scrolling\npdfjs-scroll-wrapped-button-label = Wrapped Scrolling\npdfjs-spread-none-button =\n .title = Do not join page spreads\npdfjs-spread-none-button-label = No Spreads\npdfjs-spread-odd-button =\n .title = Join page spreads starting with odd-numbered pages\npdfjs-spread-odd-button-label = Odd Spreads\npdfjs-spread-even-button =\n .title = Join page spreads starting with even-numbered pages\npdfjs-spread-even-button-label = Even Spreads\npdfjs-document-properties-button =\n .title = Document Properties…\npdfjs-document-properties-button-label = Document Properties…\npdfjs-document-properties-file-name = File name:\npdfjs-document-properties-file-size = File size:\npdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes)\npdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes)\npdfjs-document-properties-title = Title:\npdfjs-document-properties-author = Author:\npdfjs-document-properties-subject = Subject:\npdfjs-document-properties-keywords = Keywords:\npdfjs-document-properties-creation-date = Creation Date:\npdfjs-document-properties-modification-date = Modification Date:\npdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }\npdfjs-document-properties-creator = Creator:\npdfjs-document-properties-producer = PDF Producer:\npdfjs-document-properties-version = PDF Version:\npdfjs-document-properties-page-count = Page Count:\npdfjs-document-properties-page-size = Page Size:\npdfjs-document-properties-page-size-unit-inches = in\npdfjs-document-properties-page-size-unit-millimeters = mm\npdfjs-document-properties-page-size-orientation-portrait = portrait\npdfjs-document-properties-page-size-orientation-landscape = landscape\npdfjs-document-properties-page-size-name-a-three = A3\npdfjs-document-properties-page-size-name-a-four = A4\npdfjs-document-properties-page-size-name-letter = Letter\npdfjs-document-properties-page-size-name-legal = Legal\npdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation })\npdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation })\npdfjs-document-properties-linearized = Fast Web View:\npdfjs-document-properties-linearized-yes = Yes\npdfjs-document-properties-linearized-no = No\npdfjs-document-properties-close-button = Close\npdfjs-print-progress-message = Preparing document for printing…\npdfjs-print-progress-percent = { $progress }%\npdfjs-print-progress-close-button = Cancel\npdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.\npdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.\npdfjs-toggle-sidebar-button =\n .title = Toggle Sidebar\npdfjs-toggle-sidebar-notification-button =\n .title = Toggle Sidebar (document contains outline/attachments/layers)\npdfjs-toggle-sidebar-button-label = Toggle Sidebar\npdfjs-document-outline-button =\n .title = Show Document Outline (double-click to expand/collapse all items)\npdfjs-document-outline-button-label = Document Outline\npdfjs-attachments-button =\n .title = Show Attachments\npdfjs-attachments-button-label = Attachments\npdfjs-layers-button =\n .title = Show Layers (double-click to reset all layers to the default state)\npdfjs-layers-button-label = Layers\npdfjs-thumbs-button =\n .title = Show Thumbnails\npdfjs-thumbs-button-label = Thumbnails\npdfjs-current-outline-item-button =\n .title = Find Current Outline Item\npdfjs-current-outline-item-button-label = Current Outline Item\npdfjs-findbar-button =\n .title = Find in Document\npdfjs-findbar-button-label = Find\npdfjs-additional-layers = Additional Layers\npdfjs-thumb-page-title =\n .title = Page { $page }\npdfjs-thumb-page-canvas =\n .aria-label = Thumbnail of Page { $page }\npdfjs-find-input =\n .title = Find\n .placeholder = Find in document…\npdfjs-find-previous-button =\n .title = Find the previous occurrence of the phrase\npdfjs-find-previous-button-label = Previous\npdfjs-find-next-button =\n .title = Find the next occurrence of the phrase\npdfjs-find-next-button-label = Next\npdfjs-find-highlight-checkbox = Highlight All\npdfjs-find-match-case-checkbox-label = Match Case\npdfjs-find-match-diacritics-checkbox-label = Match Diacritics\npdfjs-find-entire-word-checkbox-label = Whole Words\npdfjs-find-reached-top = Reached top of document, continued from bottom\npdfjs-find-reached-bottom = Reached end of document, continued from top\npdfjs-find-match-count =\n { $total ->\n [one] { $current } of { $total } match\n *[other] { $current } of { $total } matches\n }\npdfjs-find-match-count-limit =\n { $limit ->\n [one] More than { $limit } match\n *[other] More than { $limit } matches\n }\npdfjs-find-not-found = Phrase not found\npdfjs-page-scale-width = Page Width\npdfjs-page-scale-fit = Page Fit\npdfjs-page-scale-auto = Automatic Zoom\npdfjs-page-scale-actual = Actual Size\npdfjs-page-scale-percent = { $scale }%\npdfjs-page-landmark =\n .aria-label = Page { $page }\npdfjs-loading-error = An error occurred while loading the PDF.\npdfjs-invalid-file-error = Invalid or corrupted PDF file.\npdfjs-missing-file-error = Missing PDF file.\npdfjs-unexpected-response-error = Unexpected server response.\npdfjs-rendering-error = An error occurred while rendering the page.\npdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }\npdfjs-text-annotation-type =\n .alt = [{ $type } Annotation]\npdfjs-password-label = Enter the password to open this PDF file.\npdfjs-password-invalid = Invalid password. Please try again.\npdfjs-password-ok-button = OK\npdfjs-password-cancel-button = Cancel\npdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.\npdfjs-editor-free-text-button =\n .title = Text\npdfjs-editor-color-picker-free-text-input =\n .title = Change text color\npdfjs-editor-free-text-button-label = Text\npdfjs-editor-ink-button =\n .title = Draw\npdfjs-editor-color-picker-ink-input =\n .title = Change drawing color\npdfjs-editor-ink-button-label = Draw\npdfjs-editor-stamp-button =\n .title = Add or edit images\npdfjs-editor-stamp-button-label = Add or edit images\npdfjs-editor-highlight-button =\n .title = Highlight\npdfjs-editor-highlight-button-label = Highlight\npdfjs-highlight-floating-button1 =\n .title = Highlight\n .aria-label = Highlight\npdfjs-highlight-floating-button-label = Highlight\npdfjs-editor-signature-button =\n .title = Add signature\npdfjs-editor-signature-button-label = Add signature\npdfjs-editor-highlight-editor =\n .aria-label = Highlight editor\npdfjs-editor-ink-editor =\n .aria-label = Drawing editor\npdfjs-editor-signature-editor1 =\n .aria-description = Signature editor: { $description }\npdfjs-editor-stamp-editor =\n .aria-label = Image editor\npdfjs-editor-remove-ink-button =\n .title = Remove drawing\npdfjs-editor-remove-freetext-button =\n .title = Remove text\npdfjs-editor-remove-stamp-button =\n .title = Remove image\npdfjs-editor-remove-highlight-button =\n .title = Remove highlight\npdfjs-editor-remove-signature-button =\n .title = Remove signature\npdfjs-editor-free-text-color-input = Color\npdfjs-editor-free-text-size-input = Size\npdfjs-editor-ink-color-input = Color\npdfjs-editor-ink-thickness-input = Thickness\npdfjs-editor-ink-opacity-input = Opacity\npdfjs-editor-stamp-add-image-button =\n .title = Add image\npdfjs-editor-stamp-add-image-button-label = Add image\npdfjs-editor-free-highlight-thickness-input = Thickness\npdfjs-editor-free-highlight-thickness-title =\n .title = Change thickness when highlighting items other than text\npdfjs-editor-add-signature-container =\n .aria-label = Signature controls and saved signatures\npdfjs-editor-signature-add-signature-button =\n .title = Add new signature\npdfjs-editor-signature-add-signature-button-label = Add new signature\npdfjs-editor-add-saved-signature-button =\n .title = Saved signature: { $description }\npdfjs-free-text2 =\n .aria-label = Text Editor\n .default-content = Start typing…\npdfjs-editor-alt-text-button =\n .aria-label = Alt text\npdfjs-editor-alt-text-button-label = Alt text\npdfjs-editor-alt-text-edit-button =\n .aria-label = Edit alt text\npdfjs-editor-alt-text-dialog-label = Choose an option\npdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can’t see the image or when it doesn’t load.\npdfjs-editor-alt-text-add-description-label = Add a description\npdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.\npdfjs-editor-alt-text-mark-decorative-label = Mark as decorative\npdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.\npdfjs-editor-alt-text-cancel-button = Cancel\npdfjs-editor-alt-text-save-button = Save\npdfjs-editor-alt-text-decorative-tooltip = Marked as decorative\npdfjs-editor-alt-text-textarea =\n .placeholder = For example, “A young man sits down at a table to eat a meal”\npdfjs-editor-resizer-top-left =\n .aria-label = Top left corner — resize\npdfjs-editor-resizer-top-middle =\n .aria-label = Top middle — resize\npdfjs-editor-resizer-top-right =\n .aria-label = Top right corner — resize\npdfjs-editor-resizer-middle-right =\n .aria-label = Middle right — resize\npdfjs-editor-resizer-bottom-right =\n .aria-label = Bottom right corner — resize\npdfjs-editor-resizer-bottom-middle =\n .aria-label = Bottom middle — resize\npdfjs-editor-resizer-bottom-left =\n .aria-label = Bottom left corner — resize\npdfjs-editor-resizer-middle-left =\n .aria-label = Middle left — resize\npdfjs-editor-highlight-colorpicker-label = Highlight color\npdfjs-editor-colorpicker-button =\n .title = Change color\npdfjs-editor-colorpicker-dropdown =\n .aria-label = Color choices\npdfjs-editor-colorpicker-yellow =\n .title = Yellow\npdfjs-editor-colorpicker-green =\n .title = Green\npdfjs-editor-colorpicker-blue =\n .title = Blue\npdfjs-editor-colorpicker-pink =\n .title = Pink\npdfjs-editor-colorpicker-red =\n .title = Red\npdfjs-editor-highlight-show-all-button-label = Show all\npdfjs-editor-highlight-show-all-button =\n .title = Show all\npdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description)\npdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description)\npdfjs-editor-new-alt-text-textarea =\n .placeholder = Write your description here…\npdfjs-editor-new-alt-text-description = Short description for people who can’t see the image or when the image doesn’t load.\npdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate.\npdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more\npdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically\npdfjs-editor-new-alt-text-not-now-button = Not now\npdfjs-editor-new-alt-text-error-title = Couldn’t create alt text automatically\npdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later.\npdfjs-editor-new-alt-text-error-close-button = Close\npdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)\n .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)\npdfjs-editor-new-alt-text-added-button =\n .aria-label = Alt text added\npdfjs-editor-new-alt-text-added-button-label = Alt text added\npdfjs-editor-new-alt-text-missing-button =\n .aria-label = Missing alt text\npdfjs-editor-new-alt-text-missing-button-label = Missing alt text\npdfjs-editor-new-alt-text-to-review-button =\n .aria-label = Review alt text\npdfjs-editor-new-alt-text-to-review-button-label = Review alt text\npdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText }\npdfjs-image-alt-text-settings-button =\n .title = Image alt text settings\npdfjs-image-alt-text-settings-button-label = Image alt text settings\npdfjs-editor-alt-text-settings-dialog-label = Image alt text settings\npdfjs-editor-alt-text-settings-automatic-title = Automatic alt text\npdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically\npdfjs-editor-alt-text-settings-create-model-description = Suggests descriptions to help people who can’t see the image or when the image doesn’t load.\npdfjs-editor-alt-text-settings-download-model-label = Alt text AI model ({ $totalSize } MB)\npdfjs-editor-alt-text-settings-ai-model-description = Runs locally on your device so your data stays private. Required for automatic alt text.\npdfjs-editor-alt-text-settings-delete-model-button = Delete\npdfjs-editor-alt-text-settings-download-model-button = Download\npdfjs-editor-alt-text-settings-downloading-model-button = Downloading…\npdfjs-editor-alt-text-settings-editor-title = Alt text editor\npdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image\npdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text.\npdfjs-editor-alt-text-settings-close-button = Close\npdfjs-editor-highlight-added-alert = Highlight added\npdfjs-editor-freetext-added-alert = Text added\npdfjs-editor-ink-added-alert = Drawing added\npdfjs-editor-stamp-added-alert = Image added\npdfjs-editor-signature-added-alert = Signature added\npdfjs-editor-undo-bar-message-highlight = Highlight removed\npdfjs-editor-undo-bar-message-freetext = Text removed\npdfjs-editor-undo-bar-message-ink = Drawing removed\npdfjs-editor-undo-bar-message-stamp = Image removed\npdfjs-editor-undo-bar-message-signature = Signature removed\npdfjs-editor-undo-bar-message-multiple =\n { $count ->\n [one] { $count } annotation removed\n *[other] { $count } annotations removed\n }\npdfjs-editor-undo-bar-undo-button =\n .title = Undo\npdfjs-editor-undo-bar-undo-button-label = Undo\npdfjs-editor-undo-bar-close-button =\n .title = Close\npdfjs-editor-undo-bar-close-button-label = Close\npdfjs-editor-add-signature-dialog-label = This modal allows the user to create a signature to add to a PDF document. The user can edit the name (which also serves as the alt text), and optionally save the signature for repeated use.\npdfjs-editor-add-signature-dialog-title = Add a signature\npdfjs-editor-add-signature-type-button = Type\n .title = Type\npdfjs-editor-add-signature-draw-button = Draw\n .title = Draw\npdfjs-editor-add-signature-image-button = Image\n .title = Image\npdfjs-editor-add-signature-type-input =\n .aria-label = Type your signature\n .placeholder = Type your signature\npdfjs-editor-add-signature-draw-placeholder = Draw your signature\npdfjs-editor-add-signature-draw-thickness-range-label = Thickness\npdfjs-editor-add-signature-draw-thickness-range =\n .title = Drawing thickness: { $thickness }\npdfjs-editor-add-signature-image-placeholder = Drag a file here to upload\npdfjs-editor-add-signature-image-browse-link =\n { PLATFORM() ->\n [macos] Or choose image files\n *[other] Or browse image files\n }\npdfjs-editor-add-signature-description-label = Description (alt text)\npdfjs-editor-add-signature-description-input =\n .title = Description (alt text)\npdfjs-editor-add-signature-description-default-when-drawing = Signature\npdfjs-editor-add-signature-clear-button-label = Clear signature\npdfjs-editor-add-signature-clear-button =\n .title = Clear signature\npdfjs-editor-add-signature-save-checkbox = Save signature\npdfjs-editor-add-signature-save-warning-message = You’ve reached the limit of 5 saved signatures. Remove one to save more.\npdfjs-editor-add-signature-image-upload-error-title = Couldn’t upload image\npdfjs-editor-add-signature-image-upload-error-description = Check your network connection or try another image.\npdfjs-editor-add-signature-image-no-data-error-title = Can’t convert this image into a signature\npdfjs-editor-add-signature-image-no-data-error-description = Please try uploading a different image.\npdfjs-editor-add-signature-error-close-button = Close\npdfjs-editor-add-signature-cancel-button = Cancel\npdfjs-editor-add-signature-add-button = Add\npdfjs-editor-delete-signature-button1 =\n .title = Remove saved signature\npdfjs-editor-delete-signature-button-label1 = Remove saved signature\npdfjs-editor-add-signature-edit-button-label = Edit description\npdfjs-editor-edit-signature-dialog-title = Edit description\npdfjs-editor-edit-signature-update-button = Update\npdfjs-editor-edit-comment-actions-button-label = Actions\npdfjs-editor-edit-comment-actions-button =\n .title = Actions\npdfjs-editor-edit-comment-close-button-label = Close\npdfjs-editor-edit-comment-close-button =\n .title = Close\npdfjs-editor-edit-comment-actions-edit-button-label = Edit\npdfjs-editor-edit-comment-actions-delete-button-label = Delete\npdfjs-editor-edit-comment-manager-text-input =\n .placeholder = Enter your comment\npdfjs-editor-edit-comment-manager-cancel-button = Cancel\npdfjs-editor-edit-comment-manager-save-button = Save\npdfjs-editor-edit-comment-button =\n .title = Edit comment')},b(Sa,Pi);let Go=Sa;const HC=1e3,$C=50,UC=1e3;function Og(){return document.location.hash}var Wr,st,zs,gp,mp,Ic,vp,Cv,ZA,QA,Pv,JA,qA;class WC{constructor({linkService:t,eventBus:e}){b(this,st);b(this,Wr,null);this.linkService=t,this.eventBus=e,this._initialized=!1,this._fingerprint="",this.reset(),this.eventBus._on("pagesinit",()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",i=>{this._isPagesLoaded=!!i.pagesCount},{once:!0})})}initialize({fingerprint:t,resetHistory:e=!1,updateUrl:i=!1}){if(!t||typeof t!="string"){console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}this._initialized&&this.reset();const s=this._fingerprint!==""&&this._fingerprint!==t;this._fingerprint=t,this._updateUrl=i===!0,this._initialized=!0,m(this,st,JA).call(this);const n=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=Og(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!m(this,st,Ic).call(this,n,!0)||e){const{hash:o,page:l,rotation:c}=m(this,st,Cv).call(this,!0);if(!o||s||e){m(this,st,zs).call(this,null,!0);return}m(this,st,zs).call(this,{hash:o,page:l,rotation:c},!0);return}const r=n.destination;m(this,st,vp).call(this,r,n.uid,!0),r.rotation!==void 0&&(this._initialRotation=r.rotation),r.dest?(this._initialBookmark=JSON.stringify(r.dest),this._destination.page=null):r.hash?this._initialBookmark=r.hash:r.page&&(this._initialBookmark="page=".concat(r.page))}reset(){this._initialized&&(m(this,st,Pv).call(this),this._initialized=!1,m(this,st,qA).call(this)),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:t=null,explicitDest:e,pageNumber:i}){if(!this._initialized)return;if(t&&typeof t!="string"){console.error("PDFHistory.push: "+'"'.concat(t,'" is not a valid namedDest parameter.'));return}else if(Array.isArray(e)){if(!m(this,st,mp).call(this,i)&&(i!==null||this._destination)){console.error("PDFHistory.push: "+'"'.concat(i,'" is not a valid pageNumber parameter.'));return}}else{console.error("PDFHistory.push: "+'"'.concat(e,'" is not a valid explicitDest parameter.'));return}const s=t||JSON.stringify(e);if(!s)return;let n=!1;if(this._destination&&(zC(this._destination.hash,s)||GC(this._destination.dest,e))){if(this._destination.page)return;n=!0}this._popStateInProgress&&!n||(m(this,st,zs).call(this,{dest:e,hash:s,page:i,rotation:this.linkService.rotation},n),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(t){var e;if(this._initialized){if(!m(this,st,mp).call(this,t)){console.error('PDFHistory.pushPage: "'.concat(t,'" is not a valid page number.'));return}((e=this._destination)==null?void 0:e.page)!==t&&(this._popStateInProgress||(m(this,st,zs).call(this,{dest:null,hash:"page=".concat(t),page:t,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1}))))}}pushCurrentPosition(){!this._initialized||this._popStateInProgress||m(this,st,gp).call(this)}back(){if(!this._initialized||this._popStateInProgress)return;const t=window.history.state;m(this,st,Ic).call(this,t)&&t.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const t=window.history.state;m(this,st,Ic).call(this,t)&&t.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}}Wr=new WeakMap,st=new WeakSet,zs=function(t,e=!1){const i=e||!this._destination,s={fingerprint:this._fingerprint,uid:i?this._uid:this._uid+1,destination:t};m(this,st,vp).call(this,t,s.uid);let n;if(this._updateUrl&&(t!=null&&t.hash)){const{href:r,protocol:o}=document.location;o!=="file:"&&(n=dx(r,t.hash))}i?window.history.replaceState(s,"",n):window.history.pushState(s,"",n)},gp=function(t=!1){if(!this._position)return;let e=this._position;if(t&&(e=Object.assign(Object.create(null),this._position),e.temporary=!0),!this._destination){m(this,st,zs).call(this,e);return}if(this._destination.temporary){m(this,st,zs).call(this,e,!0);return}if(this._destination.hash===e.hash||!this._destination.page&&this._numPositionUpdates<=$C)return;let i=!1;if(this._destination.page>=e.first&&this._destination.page<=e.page){if(this._destination.dest!==void 0||!this._destination.first)return;i=!0}m(this,st,zs).call(this,e,i)},mp=function(t){return Number.isInteger(t)&&t>0&&t<=this.linkService.pagesCount},Ic=function(t,e=!1){if(!t)return!1;if(t.fingerprint!==this._fingerprint)if(e){if(typeof t.fingerprint!="string"||t.fingerprint.length!==this._fingerprint.length)return!1;const[i]=performance.getEntriesByType("navigation");if((i==null?void 0:i.type)!=="reload")return!1}else return!1;return!(!Number.isInteger(t.uid)||t.uid<0||t.destination===null||typeof t.destination!="object")},vp=function(t,e,i=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),i&&(t!=null&&t.temporary)&&delete t.temporary,this._destination=t,this._uid=e,this._maxUid=Math.max(this._maxUid,e),this._numPositionUpdates=0},Cv=function(t=!1){const e=unescape(Og()).substring(1),i=vg(e),s=i.get("nameddest")||"";let n=i.get("page")|0;return(!m(this,st,mp).call(this,n)||t&&s.length>0)&&(n=null),{hash:e,page:n,rotation:this.linkService.rotation}},ZA=function({location:t}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:t.pdfOpenParams.substring(1),page:this.linkService.page,first:t.pageNumber,rotation:t.rotation},!this._popStateInProgress&&(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||m(this,st,gp).call(this,!0),this._updateViewareaTimeout=null},UC))},QA=function({state:t}){const e=Og(),i=this._currentHash!==e;if(this._currentHash=e,!t){this._uid++;const{hash:n,page:r,rotation:o}=m(this,st,Cv).call(this);m(this,st,zs).call(this,{hash:n,page:r,rotation:o},!0);return}if(!m(this,st,Ic).call(this,t))return;this._popStateInProgress=!0,i&&(this._blockHashChange++,Gx({target:window,name:"hashchange",delay:HC}).then(()=>{this._blockHashChange--}));const s=t.destination;m(this,st,vp).call(this,s,t.uid,!0),FA(s.rotation)&&(this.linkService.rotation=s.rotation),s.dest?this.linkService.goToDestination(s.dest):s.hash?this.linkService.setHash(s.hash):s.page&&(this.linkService.page=s.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})},Pv=function(){(!this._destination||this._destination.temporary)&&m(this,st,gp).call(this)},JA=function(){if(a(this,Wr))return;p(this,Wr,new AbortController);const{signal:t}=a(this,Wr);this.eventBus._on("updateviewarea",m(this,st,ZA).bind(this),{signal:t}),window.addEventListener("popstate",m(this,st,QA).bind(this),{signal:t}),window.addEventListener("pagehide",m(this,st,Pv).bind(this),{signal:t})},qA=function(){var t;(t=a(this,Wr))==null||t.abort(),p(this,Wr,null)};function zC(h,t){return typeof h!="string"||typeof t!="string"?!1:h===t||vg(h).get("nameddest")===t}function GC(h,t){function e(i,s){if(typeof i!=typeof s||Array.isArray(i)||Array.isArray(s))return!1;if(i!==null&&typeof i=="object"&&s!==null){if(Object.keys(i).length!==Object.keys(s).length)return!1;for(const n in i)if(!e(i[n],s[n]))return!1;return!0}return i===s||Number.isNaN(i)&&Number.isNaN(s)}if(!(Array.isArray(h)&&Array.isArray(t))||h.length!==t.length)return!1;for(let i=0,s=h.length;i<s;i++)if(!e(h[i],t[i]))return!1;return!0}var Id,Rd,_d,Dd,Ld,Lh;class XC{constructor(t){b(this,Id,null);b(this,Rd,null);b(this,_d,null);b(this,Dd,null);b(this,Ld,null);b(this,Lh);this.pdfPage=t.pdfPage,this.accessibilityManager=t.accessibilityManager,this.l10n=t.l10n,this.l10n||(this.l10n=new Go),this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,p(this,Lh,t.uiManager),p(this,Id,t.annotationLayer||null),p(this,Ld,t.textLayer||null),p(this,Rd,t.drawLayer||null),p(this,_d,t.onAppend||null),p(this,Dd,t.structTreeLayer||null)}async render({viewport:t,intent:e="display"}){var r;if(e!=="display"||this._cancelled)return;const i=t.clone({dontFlip:!0});if(this.div){this.annotationEditorLayer.update({viewport:i}),this.show();return}const s=this.div=document.createElement("div");s.className="annotationEditorLayer",s.hidden=!0,s.dir=a(this,Lh).direction,(r=a(this,_d))==null||r.call(this,s),this.annotationEditorLayer=new ix({uiManager:a(this,Lh),div:s,structTreeLayer:a(this,Dd),accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:i,annotationLayer:a(this,Id),textLayer:a(this,Ld),drawLayer:a(this,Rd)});const n={viewport:i,div:s,annotations:null,intent:e};this.annotationEditorLayer.render(n),this.show()}cancel(){this._cancelled=!0,this.div&&this.annotationEditorLayer.destroy()}hide(){this.div&&(this.annotationEditorLayer.pause(!0),this.div.hidden=!0)}show(){!this.div||this.annotationEditorLayer.isInvisible||(this.div.hidden=!1,this.annotationEditorLayer.pause(!1))}}Id=new WeakMap,Rd=new WeakMap,_d=new WeakMap,Dd=new WeakMap,Ld=new WeakMap,Lh=new WeakMap;{var Tv=new Map;const{maxTouchPoints:h,platform:t,userAgent:e}=navigator,i=/Android/.test(e),s=/\b(iPad|iPhone|iPod)(?=;)/.test(e)||t==="MacIntel"&&h>1;(function(){(s||i)&&Tv.set("maxCanvasPixels",5242880)})(),function(){i&&Tv.set("useSystemFonts",!1)}()}const D={BROWSER:1,VIEWER:2,API:4,WORKER:8,EVENT_DISPATCH:16,PREFERENCE:128},Fv={BOOLEAN:1,NUMBER:2,OBJECT:4,STRING:8,UNDEFINED:16},Bn={allowedGlobalEvents:{value:null,kind:D.BROWSER},canvasMaxAreaInBytes:{value:-1,kind:D.BROWSER+D.API},isInAutomation:{value:!1,kind:D.BROWSER},localeProperties:{value:{lang:navigator.language||"en-US"},kind:D.BROWSER},maxCanvasDim:{value:32767,kind:D.BROWSER+D.VIEWER},nimbusDataStr:{value:"",kind:D.BROWSER},supportsCaretBrowsingMode:{value:!1,kind:D.BROWSER},supportsDocumentFonts:{value:!0,kind:D.BROWSER},supportsIntegratedFind:{value:!1,kind:D.BROWSER},supportsMouseWheelZoomCtrlKey:{value:!0,kind:D.BROWSER},supportsMouseWheelZoomMetaKey:{value:!0,kind:D.BROWSER},supportsPinchToZoom:{value:!0,kind:D.BROWSER},supportsPrinting:{value:!0,kind:D.BROWSER},toolbarDensity:{value:0,kind:D.BROWSER+D.EVENT_DISPATCH},altTextLearnMoreUrl:{value:"",kind:D.VIEWER+D.PREFERENCE},annotationEditorMode:{value:0,kind:D.VIEWER+D.PREFERENCE},annotationMode:{value:2,kind:D.VIEWER+D.PREFERENCE},capCanvasAreaFactor:{value:200,kind:D.VIEWER+D.PREFERENCE},cursorToolOnLoad:{value:0,kind:D.VIEWER+D.PREFERENCE},debuggerSrc:{value:"./debugger.mjs",kind:D.VIEWER},defaultZoomDelay:{value:400,kind:D.VIEWER+D.PREFERENCE},defaultZoomValue:{value:"",kind:D.VIEWER+D.PREFERENCE},disableHistory:{value:!1,kind:D.VIEWER},disablePageLabels:{value:!1,kind:D.VIEWER+D.PREFERENCE},enableAltText:{value:!1,kind:D.VIEWER+D.PREFERENCE},enableAltTextModelDownload:{value:!0,kind:D.VIEWER+D.PREFERENCE+D.EVENT_DISPATCH},enableAutoLinking:{value:!0,kind:D.VIEWER+D.PREFERENCE},enableComment:{value:!1,kind:D.VIEWER+D.PREFERENCE},enableDetailCanvas:{value:!0,kind:D.VIEWER},enableGuessAltText:{value:!0,kind:D.VIEWER+D.PREFERENCE+D.EVENT_DISPATCH},enableHighlightFloatingButton:{value:!1,kind:D.VIEWER+D.PREFERENCE},enableNewAltTextWhenAddingImage:{value:!0,kind:D.VIEWER+D.PREFERENCE},enablePermissions:{value:!1,kind:D.VIEWER+D.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:D.VIEWER+D.PREFERENCE},enableScripting:{value:!0,kind:D.VIEWER+D.PREFERENCE},enableSignatureEditor:{value:!1,kind:D.VIEWER+D.PREFERENCE},enableUpdatedAddImage:{value:!1,kind:D.VIEWER+D.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:D.VIEWER},externalLinkTarget:{value:0,kind:D.VIEWER+D.PREFERENCE},highlightEditorColors:{value:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F,yellow_HCM=#FFFFCC,green_HCM=#53FFBC,blue_HCM=#80EBFF,pink_HCM=#F6B8FF,red_HCM=#C50043",kind:D.VIEWER+D.PREFERENCE},historyUpdateUrl:{value:!1,kind:D.VIEWER+D.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:D.VIEWER+D.PREFERENCE},imageResourcesPath:{value:"./images/",kind:D.VIEWER},maxCanvasPixels:{value:2**25,kind:D.VIEWER},minDurationToUpdateCanvas:{value:500,kind:D.VIEWER},forcePageColors:{value:!1,kind:D.VIEWER+D.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:D.VIEWER+D.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:D.VIEWER+D.PREFERENCE},pdfBugEnabled:{value:!1,kind:D.VIEWER+D.PREFERENCE},printResolution:{value:150,kind:D.VIEWER},sidebarViewOnLoad:{value:-1,kind:D.VIEWER+D.PREFERENCE},scrollModeOnLoad:{value:-1,kind:D.VIEWER+D.PREFERENCE},spreadModeOnLoad:{value:-1,kind:D.VIEWER+D.PREFERENCE},textLayerMode:{value:1,kind:D.VIEWER+D.PREFERENCE},viewerCssTheme:{value:0,kind:D.VIEWER+D.PREFERENCE},viewOnLoad:{value:0,kind:D.VIEWER+D.PREFERENCE},cMapPacked:{value:!0,kind:D.API},cMapUrl:{value:"../web/cmaps/",kind:D.API},disableAutoFetch:{value:!1,kind:D.API+D.PREFERENCE},disableFontFace:{value:!1,kind:D.API+D.PREFERENCE},disableRange:{value:!1,kind:D.API+D.PREFERENCE},disableStream:{value:!1,kind:D.API+D.PREFERENCE},docBaseUrl:{value:"",kind:D.API},enableHWA:{value:!0,kind:D.API+D.VIEWER+D.PREFERENCE},enableXfa:{value:!0,kind:D.API+D.PREFERENCE},fontExtraProperties:{value:!1,kind:D.API},iccUrl:{value:"../web/iccs/",kind:D.API},isEvalSupported:{value:!0,kind:D.API},isOffscreenCanvasSupported:{value:!0,kind:D.API},maxImageSize:{value:-1,kind:D.API},pdfBug:{value:!1,kind:D.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:D.API},useSystemFonts:{value:void 0,kind:D.API,type:Fv.BOOLEAN+Fv.UNDEFINED},verbosity:{value:1,kind:D.API},wasmUrl:{value:"../web/wasm/",kind:D.API},workerPort:{value:null,kind:D.WORKER},workerSrc:{value:"../build/pdf.worker.mjs",kind:D.WORKER}};Bn.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:D.VIEWER},Bn.sandboxBundleSrc={value:"../build/pdf.sandbox.mjs",kind:D.VIEWER},Bn.enableFakeMLManager={value:!0,kind:D.VIEWER};Bn.disablePreferences={value:!1,kind:D.VIEWER};var zr;const ds=class ds{static get(t){return a(this,zr).get(t)}static getAll(t=null,e=!1){const i=Object.create(null);for(const s in Bn){const n=Bn[s];t&&!(t&n.kind)||(i[s]=e?n.value:a(this,zr).get(s))}return i}static set(t,e){this.setAll({[t]:e})}static setAll(t,e=!1){this._hasInvokedSet||(this._hasInvokedSet=!0);let i;for(const s in t){const n=Bn[s],r=t[s];if(!n||!(typeof r==typeof n.value||Fv[(typeof r).toUpperCase()]&n.type))continue;const{kind:o}=n;e&&!(o&D.BROWSER||o&D.PREFERENCE)||(this.eventBus&&o&D.EVENT_DISPATCH&&(i||(i=new Map)).set(s,r),a(this,zr).set(s,r))}if(i)for(const[s,n]of i)this.eventBus.dispatch(s.toLowerCase(),{source:this,value:n})}};zr=new WeakMap,M(ds,"eventBus"),b(ds,zr,new Map),(()=>{for(const t in Bn)a(ds,zr).set(t,Bn[t].value);for(const[t,e]of Tv)a(ds,zr).set(t,e);ds._hasInvokedSet=!1,ds._checkDisablePreferences=()=>ds.get("disablePreferences")?!0:(ds._hasInvokedSet&&console.warn('The Preferences may override manually set AppOptions; please use the "disablePreferences"-option to prevent that.'),!1)})();let Bc=ds;Lt(2222);function Pb({width:h,height:t,left:e,top:i},s){if(h===0||t===0)return null;const n=s.textLayer.div.getBoundingClientRect(),r=s.getPagePoint(e-n.left,i-n.top),o=s.getPagePoint(e-n.left+h,i-n.top+t);return p0.normalizeRect([r[0],r[1],o[0],o[1]])}function YC(h,t){const e=h.getClientRects();if(e.length===1)return{rect:Pb(e[0],t)};const i=[1/0,1/0,-1/0,-1/0],s=[];let n=0;for(const r of e){const o=Pb(r,t);o!==null&&(s[n]=s[n+4]=o[0],s[n+1]=s[n+3]=o[3],s[n+2]=s[n+6]=o[2],s[n+5]=s[n+7]=o[1],p0.rectBoundingBox(...o,i),n+=8)}return{quadPoints:s,rect:i}}function Tb(h,t){let e=h;do{if(e.nodeType===Node.TEXT_NODE){const i=e.textContent.length;if(t<=i)return[e,t];t-=i}else if(e.firstChild){e=e.firstChild;continue}for(;!e.nextSibling&&e!==h;)e=e.parentNode;e!==h&&(e=e.nextSibling)}while(e!==h);throw new Error("Offset is bigger than container's contents length.")}function KC({url:h,index:t,length:e},i,s){const n=i._textHighlighter,[{begin:r,end:o}]=n._convertMatches([t],[e]),l=new Range;return l.setStart(...Tb(n.textDivs[r.divIdx],r.offset)),l.setEnd(...Tb(n.textDivs[o.divIdx],o.offset)),{id:"inferred_link_".concat(s),unsafeUrl:h,url:h,annotationType:EA.LINK,rotation:0,...YC(l,i),borderStyle:null}}var ag,Md;class Iv{static findLinks(t){var r;(r=a(this,Md))!=null||p(this,Md,/\b(?:https?:\/\/|mailto:|www\.)(?:[\0-\x08\x0E-\x1F\$\+0-9=A-Z\^`-z\|~-\x9F\xA2-\xA6\xA8-\xAA\xAC-\xB5\xB8-\xBA\xBC-\xBE\xC0-\u037D\u037F-\u0386\u0388-\u0559\u0560-\u0588\u058B-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0608\u060B\u060E-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06FF\u070E-\u07F6\u07FA-\u082F\u083F-\u085D\u085F-\u0963\u0966-\u096F\u0971-\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF1-\u0C76\u0C78-\u0C83\u0C85-\u0DF3\u0DF5-\u0E4E\u0E50-\u0E59\u0E5C-\u0F03\u0F13\u0F15-\u0F39\u0F3E-\u0F84\u0F86-\u0FCF\u0FD5-\u0FD8\u0FDB-\u1049\u1050-\u10FA\u10FC-\u135F\u1369-\u13FF\u1401-\u166D\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DB-\u17FF\u180B-\u1943\u1946-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B61-\u1B7C\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FFF\u200B-\u200F\u202A-\u202E\u2044\u2052\u2060-\u207C\u207F-\u208C\u208F-\u2307\u230C-\u2328\u232B-\u2767\u2776-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E50\u2E51\u2E5E-\u2FFF\u3004-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303C\u303E-\u309F\u30A1-\u30FA\u30FC-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAADD\uAAE0-\uAAEF\uAAF2-\uABEA\uABEC-\uFD3D\uFD40-\uFE0F\uFE1A-\uFE2F\uFE53\uFE62\uFE64-\uFE67\uFE69\uFE6C-\uFEFE\uFF00\uFF04\uFF0B\uFF10-\uFF19\uFF1C-\uFF1E\uFF21-\uFF3A\uFF3E\uFF40-\uFF5A\uFF5C\uFF5E\uFF66-\u{100FF}\u{10103}-\u{1039E}\u{103A0}-\u{103CF}\u{103D1}-\u{1056E}\u{10570}-\u{10856}\u{10858}-\u{1091E}\u{10920}-\u{1093E}\u{10940}-\u{10A4F}\u{10A59}-\u{10A7E}\u{10A80}-\u{10AEF}\u{10AF7}-\u{10B38}\u{10B40}-\u{10B98}\u{10B9D}-\u{10D6D}\u{10D6F}-\u{10EAC}\u{10EAE}-\u{10F54}\u{10F5A}-\u{10F85}\u{10F8A}-\u{11046}\u{1104E}-\u{110BA}\u{110BD}\u{110C2}-\u{1113F}\u{11144}-\u{11173}\u{11176}-\u{111C4}\u{111C9}-\u{111CC}\u{111CE}-\u{111DA}\u{111DC}\u{111E0}-\u{11237}\u{1123E}-\u{112A8}\u{112AA}-\u{113D3}\u{113D6}\u{113D9}-\u{1144A}\u{11450}-\u{11459}\u{1145C}\u{1145E}-\u{114C5}\u{114C7}-\u{115C0}\u{115D8}-\u{11640}\u{11644}-\u{1165F}\u{1166D}-\u{116B8}\u{116BA}-\u{1173B}\u{1173F}-\u{1183A}\u{1183C}-\u{11943}\u{11947}-\u{119E1}\u{119E3}-\u{11A3E}\u{11A47}-\u{11A99}\u{11A9D}\u{11AA3}-\u{11AFF}\u{11B0A}-\u{11BE0}\u{11BE2}-\u{11C40}\u{11C46}-\u{11C6F}\u{11C72}-\u{11EF6}\u{11EF9}-\u{11F42}\u{11F50}-\u{11FFE}\u{12000}-\u{1246F}\u{12475}-\u{12FF0}\u{12FF3}-\u{16A6D}\u{16A70}-\u{16AF4}\u{16AF6}-\u{16B36}\u{16B3C}-\u{16B43}\u{16B45}-\u{16D6C}\u{16D70}-\u{16E96}\u{16E9B}-\u{16FE1}\u{16FE3}-\u{1BC9E}\u{1BCA0}-\u{1DA86}\u{1DA8C}-\u{1E5FE}\u{1E600}-\u{1E95D}\u{1E960}-\u{10FFFF}]|\/|[\0-\x08\x0E-\x1F!-Z\\\^-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\u{10FFFF}]+[\0-\x08\x0E-\x1F\$\+0-9=A-Z\^`-z\|~-\x9F\xA2-\xA6\xA8-\xAA\xAC-\xB5\xB8-\xBA\xBC-\xBE\xC0-\u037D\u037F-\u0386\u0388-\u0559\u0560-\u0588\u058B-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0608\u060B\u060E-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06FF\u070E-\u07F6\u07FA-\u082F\u083F-\u085D\u085F-\u0963\u0966-\u096F\u0971-\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF1-\u0C76\u0C78-\u0C83\u0C85-\u0DF3\u0DF5-\u0E4E\u0E50-\u0E59\u0E5C-\u0F03\u0F13\u0F15-\u0F39\u0F3E-\u0F84\u0F86-\u0FCF\u0FD5-\u0FD8\u0FDB-\u1049\u1050-\u10FA\u10FC-\u135F\u1369-\u13FF\u1401-\u166D\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DB-\u17FF\u180B-\u1943\u1946-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B61-\u1B7C\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FFF\u200B-\u200F\u202A-\u202E\u2044\u2052\u2060-\u207C\u207F-\u208C\u208F-\u2307\u230C-\u2328\u232B-\u2767\u2776-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E50\u2E51\u2E5E-\u2FFF\u3004-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303C\u303E-\u309F\u30A1-\u30FA\u30FC-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAADD\uAAE0-\uAAEF\uAAF2-\uABEA\uABEC-\uFD3D\uFD40-\uFE0F\uFE1A-\uFE2F\uFE53\uFE62\uFE64-\uFE67\uFE69\uFE6C-\uFEFE\uFF00\uFF04\uFF0B\uFF10-\uFF19\uFF1C-\uFF1E\uFF21-\uFF3A\uFF3E\uFF40-\uFF5A\uFF5C\uFF5E\uFF66-\u{100FF}\u{10103}-\u{1039E}\u{103A0}-\u{103CF}\u{103D1}-\u{1056E}\u{10570}-\u{10856}\u{10858}-\u{1091E}\u{10920}-\u{1093E}\u{10940}-\u{10A4F}\u{10A59}-\u{10A7E}\u{10A80}-\u{10AEF}\u{10AF7}-\u{10B38}\u{10B40}-\u{10B98}\u{10B9D}-\u{10D6D}\u{10D6F}-\u{10EAC}\u{10EAE}-\u{10F54}\u{10F5A}-\u{10F85}\u{10F8A}-\u{11046}\u{1104E}-\u{110BA}\u{110BD}\u{110C2}-\u{1113F}\u{11144}-\u{11173}\u{11176}-\u{111C4}\u{111C9}-\u{111CC}\u{111CE}-\u{111DA}\u{111DC}\u{111E0}-\u{11237}\u{1123E}-\u{112A8}\u{112AA}-\u{113D3}\u{113D6}\u{113D9}-\u{1144A}\u{11450}-\u{11459}\u{1145C}\u{1145E}-\u{114C5}\u{114C7}-\u{115C0}\u{115D8}-\u{11640}\u{11644}-\u{1165F}\u{1166D}-\u{116B8}\u{116BA}-\u{1173B}\u{1173F}-\u{1183A}\u{1183C}-\u{11943}\u{11947}-\u{119E1}\u{119E3}-\u{11A3E}\u{11A47}-\u{11A99}\u{11A9D}\u{11AA3}-\u{11AFF}\u{11B0A}-\u{11BE0}\u{11BE2}-\u{11C40}\u{11C46}-\u{11C6F}\u{11C72}-\u{11EF6}\u{11EF9}-\u{11F42}\u{11F50}-\u{11FFE}\u{12000}-\u{1246F}\u{12475}-\u{12FF0}\u{12FF3}-\u{16A6D}\u{16A70}-\u{16AF4}\u{16AF6}-\u{16B36}\u{16B3C}-\u{16B43}\u{16B45}-\u{16D6C}\u{16D70}-\u{16E96}\u{16E9B}-\u{16FE1}\u{16FE3}-\u{1BC9E}\u{1BCA0}-\u{1DA86}\u{1DA8C}-\u{1E5FE}\u{1E600}-\u{1E95D}\u{1E960}-\u{10FFFF}])+|\b[\0-\x08\x0E-\x1F!-'\*-;=\?A-Z\\\^-z\|~-\x9F\xA1-\u0F39\u0F3E-\u167F\u1681-\u169A\u169D-\u1FFF\u200B-\u2019\u201B-\u201D\u201F-\u2027\u202A-\u202E\u2030-\u2044\u2047-\u205E\u2060-\u207C\u207F-\u208C\u208F-\u2307\u230C-\u2328\u232B-\u2767\u2776-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2E21\u2E2A-\u2E41\u2E43-\u2E54\u2E5D-\u2FFF\u3001-\u3007\u3012\u3013\u301C\u3020-\uFD3D\uFD40-\uFE16\uFE19-\uFE34\uFE45\uFE46\uFE49-\uFE58\uFE5F-\uFEFE\uFF00-\uFF07\uFF0A-\uFF3A\uFF3C\uFF3E-\uFF5A\uFF5C\uFF5E\uFF61\uFF64-\u{10FFFF}]+@([\0-\x08\x0E-\x1F\$\+0-9=A-Z\^`-z\|~-\x9F\xA2-\xA6\xA8-\xAA\xAC-\xB5\xB8-\xBA\xBC-\xBE\xC0-\u037D\u037F-\u0386\u0388-\u0559\u0560-\u0588\u058B-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0608\u060B\u060E-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06FF\u070E-\u07F6\u07FA-\u082F\u083F-\u085D\u085F-\u0963\u0966-\u096F\u0971-\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF1-\u0C76\u0C78-\u0C83\u0C85-\u0DF3\u0DF5-\u0E4E\u0E50-\u0E59\u0E5C-\u0F03\u0F13\u0F15-\u0F39\u0F3E-\u0F84\u0F86-\u0FCF\u0FD5-\u0FD8\u0FDB-\u1049\u1050-\u10FA\u10FC-\u135F\u1369-\u13FF\u1401-\u166D\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DB-\u17FF\u180B-\u1943\u1946-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B61-\u1B7C\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FFF\u200B-\u200F\u202A-\u202E\u2044\u2052\u2060-\u207C\u207F-\u208C\u208F-\u2307\u230C-\u2328\u232B-\u2767\u2776-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E50\u2E51\u2E5E-\u2FFF\u3004-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303C\u303E-\u309F\u30A1-\u30FA\u30FC-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAADD\uAAE0-\uAAEF\uAAF2-\uABEA\uABEC-\uFD3D\uFD40-\uFE0F\uFE1A-\uFE2F\uFE53\uFE62\uFE64-\uFE67\uFE69\uFE6C-\uFEFE\uFF00\uFF04\uFF0B\uFF10-\uFF19\uFF1C-\uFF1E\uFF21-\uFF3A\uFF3E\uFF40-\uFF5A\uFF5C\uFF5E\uFF66-\u{100FF}\u{10103}-\u{1039E}\u{103A0}-\u{103CF}\u{103D1}-\u{1056E}\u{10570}-\u{10856}\u{10858}-\u{1091E}\u{10920}-\u{1093E}\u{10940}-\u{10A4F}\u{10A59}-\u{10A7E}\u{10A80}-\u{10AEF}\u{10AF7}-\u{10B38}\u{10B40}-\u{10B98}\u{10B9D}-\u{10D6D}\u{10D6F}-\u{10EAC}\u{10EAE}-\u{10F54}\u{10F5A}-\u{10F85}\u{10F8A}-\u{11046}\u{1104E}-\u{110BA}\u{110BD}\u{110C2}-\u{1113F}\u{11144}-\u{11173}\u{11176}-\u{111C4}\u{111C9}-\u{111CC}\u{111CE}-\u{111DA}\u{111DC}\u{111E0}-\u{11237}\u{1123E}-\u{112A8}\u{112AA}-\u{113D3}\u{113D6}\u{113D9}-\u{1144A}\u{11450}-\u{11459}\u{1145C}\u{1145E}-\u{114C5}\u{114C7}-\u{115C0}\u{115D8}-\u{11640}\u{11644}-\u{1165F}\u{1166D}-\u{116B8}\u{116BA}-\u{1173B}\u{1173F}-\u{1183A}\u{1183C}-\u{11943}\u{11947}-\u{119E1}\u{119E3}-\u{11A3E}\u{11A47}-\u{11A99}\u{11A9D}\u{11AA3}-\u{11AFF}\u{11B0A}-\u{11BE0}\u{11BE2}-\u{11C40}\u{11C46}-\u{11C6F}\u{11C72}-\u{11EF6}\u{11EF9}-\u{11F42}\u{11F50}-\u{11FFE}\u{12000}-\u{1246F}\u{12475}-\u{12FF0}\u{12FF3}-\u{16A6D}\u{16A70}-\u{16AF4}\u{16AF6}-\u{16B36}\u{16B3C}-\u{16B43}\u{16B45}-\u{16D6C}\u{16D70}-\u{16E96}\u{16E9B}-\u{16FE1}\u{16FE3}-\u{1BC9E}\u{1BCA0}-\u{1DA86}\u{1DA8C}-\u{1E5FE}\u{1E600}-\u{1E95D}\u{1E960}-\u{10FFFF}]+(?:\.[\0-\x08\x0E-\x1F\$\+0-9=A-Z\^`-z\|~-\x9F\xA2-\xA6\xA8-\xAA\xAC-\xB5\xB8-\xBA\xBC-\xBE\xC0-\u037D\u037F-\u0386\u0388-\u0559\u0560-\u0588\u058B-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0608\u060B\u060E-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06FF\u070E-\u07F6\u07FA-\u082F\u083F-\u085D\u085F-\u0963\u0966-\u096F\u0971-\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF1-\u0C76\u0C78-\u0C83\u0C85-\u0DF3\u0DF5-\u0E4E\u0E50-\u0E59\u0E5C-\u0F03\u0F13\u0F15-\u0F39\u0F3E-\u0F84\u0F86-\u0FCF\u0FD5-\u0FD8\u0FDB-\u1049\u1050-\u10FA\u10FC-\u135F\u1369-\u13FF\u1401-\u166D\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DB-\u17FF\u180B-\u1943\u1946-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B61-\u1B7C\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FFF\u200B-\u200F\u202A-\u202E\u2044\u2052\u2060-\u207C\u207F-\u208C\u208F-\u2307\u230C-\u2328\u232B-\u2767\u2776-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E50\u2E51\u2E5E-\u2FFF\u3004-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303C\u303E-\u309F\u30A1-\u30FA\u30FC-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAADD\uAAE0-\uAAEF\uAAF2-\uABEA\uABEC-\uFD3D\uFD40-\uFE0F\uFE1A-\uFE2F\uFE53\uFE62\uFE64-\uFE67\uFE69\uFE6C-\uFEFE\uFF00\uFF04\uFF0B\uFF10-\uFF19\uFF1C-\uFF1E\uFF21-\uFF3A\uFF3E\uFF40-\uFF5A\uFF5C\uFF5E\uFF66-\u{100FF}\u{10103}-\u{1039E}\u{103A0}-\u{103CF}\u{103D1}-\u{1056E}\u{10570}-\u{10856}\u{10858}-\u{1091E}\u{10920}-\u{1093E}\u{10940}-\u{10A4F}\u{10A59}-\u{10A7E}\u{10A80}-\u{10AEF}\u{10AF7}-\u{10B38}\u{10B40}-\u{10B98}\u{10B9D}-\u{10D6D}\u{10D6F}-\u{10EAC}\u{10EAE}-\u{10F54}\u{10F5A}-\u{10F85}\u{10F8A}-\u{11046}\u{1104E}-\u{110BA}\u{110BD}\u{110C2}-\u{1113F}\u{11144}-\u{11173}\u{11176}-\u{111C4}\u{111C9}-\u{111CC}\u{111CE}-\u{111DA}\u{111DC}\u{111E0}-\u{11237}\u{1123E}-\u{112A8}\u{112AA}-\u{113D3}\u{113D6}\u{113D9}-\u{1144A}\u{11450}-\u{11459}\u{1145C}\u{1145E}-\u{114C5}\u{114C7}-\u{115C0}\u{115D8}-\u{11640}\u{11644}-\u{1165F}\u{1166D}-\u{116B8}\u{116BA}-\u{1173B}\u{1173F}-\u{1183A}\u{1183C}-\u{11943}\u{11947}-\u{119E1}\u{119E3}-\u{11A3E}\u{11A47}-\u{11A99}\u{11A9D}\u{11AA3}-\u{11AFF}\u{11B0A}-\u{11BE0}\u{11BE2}-\u{11C40}\u{11C46}-\u{11C6F}\u{11C72}-\u{11EF6}\u{11EF9}-\u{11F42}\u{11F50}-\u{11FFE}\u{12000}-\u{1246F}\u{12475}-\u{12FF0}\u{12FF3}-\u{16A6D}\u{16A70}-\u{16AF4}\u{16AF6}-\u{16B36}\u{16B3C}-\u{16B43}\u{16B45}-\u{16D6C}\u{16D70}-\u{16E96}\u{16E9B}-\u{16FE1}\u{16FE3}-\u{1BC9E}\u{1BCA0}-\u{1DA86}\u{1DA8C}-\u{1E5FE}\u{1E600}-\u{1E95D}\u{1E960}-\u{10FFFF}]+)+)/gmu);const[e,i]=dp(t,{ignoreDashEOL:!0}),s=e.matchAll(a(this,Md)),n=[];for(const o of s){const[l,c]=o;let u;if(l.startsWith("www.")||l.startsWith("http://")||l.startsWith("https://"))u=l;else if(URL.canParse("http://".concat(c)))u=l.startsWith("mailto:")?l:"mailto:".concat(l);else continue;const d=SA(u,null,{addDefaultProtocol:!0});if(d){const[f,g]=IA(i,o.index,l.length);n.push({url:d.href,index:f,length:g})}}return n}static processLinks(t){return this.findLinks(t._textHighlighter.textContentItemsStr.join("\n")).map(e=>KC(e,t,ge(this,ag)._++))}}ag=new WeakMap,Md=new WeakMap,b(Iv,ag,0),b(Iv,Md);var Gr,Mh,Nh,Oh,Fn,Xr,In,og,Nd,Rv;class t1{constructor(t){b(this,Nd);b(this,Gr,null);b(this,Mh,0);b(this,Nh,null);b(this,Oh,bt.INITIAL);b(this,Fn,null);b(this,Xr,0);b(this,In,null);M(this,"canvas",null);M(this,"div",null);M(this,"eventBus",null);M(this,"id",null);M(this,"pageColors",null);M(this,"renderingQueue",null);M(this,"renderTask",null);M(this,"resume",null);b(this,og,t=>{var e;if((e=a(this,Fn))==null||e.call(this,!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this)){this.renderingState=bt.PAUSED,this.resume=()=>{this.renderingState=bt.RUNNING,t()};return}t()});var e;this.eventBus=t.eventBus,this.id=t.id,this.pageColors=t.pageColors||null,this.renderingQueue=t.renderingQueue,p(this,Mh,(e=t.minDurationToUpdateCanvas)!=null?e:500)}get renderingState(){return a(this,Oh)}set renderingState(t){var e;if(t!==a(this,Oh))switch(p(this,Oh,t),a(this,Gr)&&(clearTimeout(a(this,Gr)),p(this,Gr,null)),t){case bt.PAUSED:this.div.classList.remove("loading"),p(this,Xr,0),(e=a(this,Fn))==null||e.call(this,!1);break;case bt.RUNNING:this.div.classList.add("loadingIcon"),p(this,Gr,setTimeout(()=>{this.div.classList.add("loading"),p(this,Gr,null)},0)),p(this,Xr,Date.now());break;case bt.INITIAL:case bt.FINISHED:this.div.classList.remove("loadingIcon","loading"),p(this,Xr,0);break}}_createCanvas(t,e=!1){const{pageColors:i}=this,s=!!(i!=null&&i.background&&(i!=null&&i.foreground)),n=this.canvas,r=!n&&!s&&!e;let o=this.canvas=document.createElement("canvas");return p(this,Fn,l=>{if(r){let c=a(this,In);if(!l&&a(this,Mh)>0){if(Date.now()-a(this,Xr)<a(this,Mh))return;c||(c=p(this,In,o),o=this.canvas=o.cloneNode(!1),t(o))}if(c){o.getContext("2d",{alpha:!1}).drawImage(c,0,0),l?m(this,Nd,Rv).call(this):p(this,Xr,Date.now());return}t(o),p(this,Fn,null);return}l&&(n?(n.replaceWith(o),n.width=n.height=0):t(o))}),{canvas:o,prevCanvas:n}}_resetCanvas(){const{canvas:t}=this;t&&(t.remove(),t.width=t.height=0,this.canvas=null,m(this,Nd,Rv).call(this))}async _drawCanvas(t,e,i){var r,o;const s=this.renderTask=this.pdfPage.render(t);s.onContinue=a(this,og),s.onError=l=>{l instanceof hv&&(e(),p(this,Nh,null))};let n=null;try{await s.promise,(r=a(this,Fn))==null||r.call(this,!0)}catch(l){if(l instanceof hv)return;n=l,(o=a(this,Fn))==null||o.call(this,!0)}finally{p(this,Nh,n),s===this.renderTask&&(this.renderTask=null)}if(this.renderingState=bt.FINISHED,i(s),n)throw n}cancelRendering({cancelExtraDelay:t=0}={}){this.renderTask&&(this.renderTask.cancel(t),this.renderTask=null),this.resume=null}dispatchPageRender(){this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id})}dispatchPageRendered(t,e){this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:t,isDetailView:e,timestamp:performance.now(),error:a(this,Nh)})}}Gr=new WeakMap,Mh=new WeakMap,Nh=new WeakMap,Oh=new WeakMap,Fn=new WeakMap,Xr=new WeakMap,In=new WeakMap,og=new WeakMap,Nd=new WeakSet,Rv=function(){a(this,In)&&(a(this,In).width=a(this,In).height=0,p(this,In,null))};var Ls;class ZC{constructor(t){b(this,Ls,null);this.pageIndex=t.pageIndex}async render({intent:t="display"}){t!=="display"||a(this,Ls)||this._cancelled||p(this,Ls,new rx({pageIndex:this.pageIndex}))}cancel(){this._cancelled=!0,a(this,Ls)&&(a(this,Ls).destroy(),p(this,Ls,null))}setParent(t){var e;(e=a(this,Ls))==null||e.setParent(t)}getDrawLayer(){return a(this,Ls)}}Ls=new WeakMap;var qi,lg,e1;class QC extends t1{constructor({pageView:e}){super(e);b(this,lg);b(this,qi,null);M(this,"renderingCancelled",!1);this.pageView=e,this.renderingId="detail"+this.id,this.div=e.div}setPdfPage(e){this.pageView.setPdfPage(e)}get pdfPage(){return this.pageView.pdfPage}get renderingState(){return super.renderingState}set renderingState(e){this.renderingCancelled=!1,super.renderingState=e}reset({keepCanvas:e=!1}={}){const i=this.renderingCancelled||this.renderingState===bt.RUNNING||this.renderingState===bt.PAUSED;this.cancelRendering(),this.renderingState=bt.INITIAL,this.renderingCancelled=i,e||this._resetCanvas()}update({visibleArea:e=null,underlyingViewUpdated:i=!1}={}){if(i){this.cancelRendering(),this.renderingState=bt.INITIAL;return}if(!m(this,lg,e1).call(this,e))return;const{viewport:s,maxCanvasPixels:n,capCanvasAreaFactor:r}=this.pageView,o=e.maxX-e.minX,l=e.maxY-e.minY,c=o*l*up.pixelRatio**2,d=(Math.sqrt(up.capPixels(n,r)/c)-1)/2;let f=Math.min(1,d);f<0&&(f=0);const g=o*f,v=l*f,y=Math.max(0,e.minX-g),w=Math.min(s.width,e.maxX+g),A=Math.max(0,e.minY-v),S=Math.min(s.height,e.maxY+v),E=w-y,x=S-A;p(this,qi,{minX:y,minY:A,width:E,height:x,scale:s.scale}),this.reset({keepCanvas:!0})}async draw(){if(this.pageView.detailView!==this)return;const e=this.pageView.renderingState===bt.FINISHED||this.renderingState===bt.FINISHED;this.renderingState!==bt.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:i,pdfPage:s,viewport:n}=this.pageView;if(!s)throw this.renderingState=bt.FINISHED,new Error("pdfPage is not loaded");this.renderingState=bt.RUNNING;const r=this.pageView._ensureCanvasWrapper(),{canvas:o,prevCanvas:l}=this._createCanvas(w=>{var A;((A=r.firstElementChild)==null?void 0:A.tagName)==="CANVAS"?r.firstElementChild.after(w):r.prepend(w)},e);o.setAttribute("aria-hidden","true");const{width:c,height:u}=n,d=a(this,qi),{pixelRatio:f}=up,g=[f,0,0,f,-d.minX*f,-d.minY*f];o.width=d.width*f,o.height=d.height*f;const{style:v}=o;v.width="".concat(d.width*100/c,"%"),v.height="".concat(d.height*100/u,"%"),v.top="".concat(d.minY*100/u,"%"),v.left="".concat(d.minX*100/c,"%");const y=this._drawCanvas(this.pageView._getRenderingContext(o,g),()=>{var w;(w=this.canvas)==null||w.remove(),this.canvas=l},()=>{this.dispatchPageRendered(!1,!0)});return i.setAttribute("data-loaded",!0),this.dispatchPageRender(),y}}qi=new WeakMap,lg=new WeakSet,e1=function(e){if(!a(this,qi))return!0;const i=a(this,qi).minX,s=a(this,qi).minY,n=a(this,qi).width+i,r=a(this,qi).height+s;if(e.minX<i||e.minY<s||e.maxX>n||e.maxY>r)return!0;const{width:o,height:l,scale:c}=this.pageView.viewport;if(a(this,qi).scale!==c)return!0;const u=e.minX-i,d=n-e.maxX,f=e.minY-s,g=r-e.maxY,v=.5,y=(1+v)/v;return i>0&&d/u>y||n<o&&u/d>y||s>0&&g/f>y||r<l&&f/g>y};const Fb={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},JC=/^H(\d+)$/;var kh,ts,Bh,jh,Vh,Yr,Hs,_v,s1,Dv;class i1{constructor(t,e){b(this,Hs);b(this,kh);b(this,ts,null);b(this,Bh);b(this,jh,new Map);b(this,Vh);b(this,Yr,null);p(this,kh,t.getStructTree()),p(this,Vh,e)}async render(){var s;if(a(this,Bh))return a(this,Bh);const{promise:t,resolve:e,reject:i}=Promise.withResolvers();p(this,Bh,t);try{p(this,ts,m(this,Hs,Dv).call(this,await a(this,kh)))}catch(n){i(n)}return p(this,kh,null),(s=a(this,ts))==null||s.classList.add("structTree"),e(a(this,ts)),t}async getAriaAttributes(t){try{return await this.render(),a(this,jh).get(t)}catch(e){}return null}hide(){a(this,ts)&&!a(this,ts).hidden&&(a(this,ts).hidden=!0)}show(){var t;(t=a(this,ts))!=null&&t.hidden&&(a(this,ts).hidden=!1)}addElementsToTextLayer(){var t;if(a(this,Yr)){for(const[e,i]of a(this,Yr))(t=document.getElementById(e))==null||t.append(i);a(this,Yr).clear(),p(this,Yr,null)}}}kh=new WeakMap,ts=new WeakMap,Bh=new WeakMap,jh=new WeakMap,Vh=new WeakMap,Yr=new WeakMap,Hs=new WeakSet,_v=function(t,e){const{alt:i,id:s,lang:n}=t;if(i!==void 0){let r=!1;const o=kc(i);for(const l of t.children)if(l.type==="annotation"){let c=a(this,jh).get(l.id);c||(c=new Map,a(this,jh).set(l.id,c)),c.set("aria-label",o),r=!0}r||e.setAttribute("aria-label",o)}s!==void 0&&e.setAttribute("aria-owns",s),n!==void 0&&e.setAttribute("lang",kc(n,!0))},s1=function(t,e){const{alt:i,bbox:s,children:n}=t,r=n==null?void 0:n[0];if(!a(this,Vh)||!i||!s||(r==null?void 0:r.type)!=="content")return!1;const{id:o}=r;if(!o)return!1;e.setAttribute("aria-owns",o);const l=document.createElement("span");(a(this,Yr)||p(this,Yr,new Map)).set(o,l),l.setAttribute("role","img"),l.setAttribute("aria-label",kc(i));const{pageHeight:c,pageX:u,pageY:d}=a(this,Vh),f="calc(var(--total-scale-factor) *",{style:g}=l;return g.width="".concat(f).concat(s[2]-s[0],"px)"),g.height="".concat(f).concat(s[3]-s[1],"px)"),g.left="".concat(f).concat(s[0]-u,"px)"),g.top="".concat(f).concat(c-s[3]+d,"px)"),!0},Dv=function(t){if(!t)return null;const e=document.createElement("span");if("role"in t){const{role:i}=t,s=i.match(JC);if(s?(e.setAttribute("role","heading"),e.setAttribute("aria-level",s[1])):Fb[i]&&e.setAttribute("role",Fb[i]),i==="Figure"&&m(this,Hs,s1).call(this,t,e))return e}if(m(this,Hs,_v).call(this,t,e),t.children)if(t.children.length===1&&"id"in t.children[0])m(this,Hs,_v).call(this,t.children[0],e);else for(const i of t.children)e.append(m(this,Hs,Dv).call(this,i));return e};var Rn,Oi,_n,Kr,Hh,bp,Od,Mv;const fl=class fl{constructor(){b(this,Od);b(this,Rn,!1);b(this,Oi,null);b(this,_n,new Map);b(this,Kr,new Map)}setTextMapping(t){p(this,Oi,t)}enable(){if(a(this,Rn))throw new Error("TextAccessibilityManager is already enabled.");if(!a(this,Oi))throw new Error("Text divs and strings have not been set.");if(p(this,Rn,!0),p(this,Oi,a(this,Oi).slice()),a(this,Oi).sort(m(fl,Hh,bp)),a(this,_n).size>0){const t=a(this,Oi);for(const[e,i]of a(this,_n)){if(!document.getElementById(e)){a(this,_n).delete(e);continue}m(this,Od,Mv).call(this,e,t[i])}}for(const[t,e]of a(this,Kr))this.addPointerInTextLayer(t,e);a(this,Kr).clear()}disable(){a(this,Rn)&&(a(this,Kr).clear(),p(this,Oi,null),p(this,Rn,!1))}removePointerInTextLayer(t){if(!a(this,Rn)){a(this,Kr).delete(t);return}const e=a(this,Oi);if(!e||e.length===0)return;const{id:i}=t,s=a(this,_n).get(i);if(s===void 0)return;const n=e[s];a(this,_n).delete(i);let r=n.getAttribute("aria-owns");r!=null&&r.includes(i)&&(r=r.split(" ").filter(o=>o!==i).join(" "),r?n.setAttribute("aria-owns",r):(n.removeAttribute("aria-owns"),n.setAttribute("role","presentation")))}addPointerInTextLayer(t,e){const{id:i}=t;if(!i)return null;if(!a(this,Rn))return a(this,Kr).set(t,e),null;e&&this.removePointerInTextLayer(t);const s=a(this,Oi);if(!s||s.length===0)return null;const n=Xc(s,c=>{var u;return m(u=fl,Hh,bp).call(u,t,c)<0}),r=Math.max(0,n-1),o=s[r];m(this,Od,Mv).call(this,i,o),a(this,_n).set(i,r);const l=o.parentNode;return l!=null&&l.classList.contains("markedContent")?l.id:null}moveElementInDOM(t,e,i,s){const n=this.addPointerInTextLayer(i,s);if(!t.hasChildNodes())return t.append(e),n;const r=Array.from(t.childNodes).filter(c=>c!==e);if(r.length===0)return n;const o=i||e,l=Xc(r,c=>{var u;return m(u=fl,Hh,bp).call(u,o,c)<0});return l===0?r[0].before(e):r[l-1].after(e),n}};Rn=new WeakMap,Oi=new WeakMap,_n=new WeakMap,Kr=new WeakMap,Hh=new WeakSet,bp=function(t,e){const i=t.getBoundingClientRect(),s=e.getBoundingClientRect();if(i.width===0&&i.height===0)return 1;if(s.width===0&&s.height===0)return-1;const n=i.y,r=i.y+i.height,o=i.y+i.height/2,l=s.y,c=s.y+s.height,u=s.y+s.height/2;if(o<=l&&u>=r)return-1;if(u<=n&&o>=c)return 1;const d=i.x+i.width/2,f=s.x+s.width/2;return d-f},Od=new WeakSet,Mv=function(t,e){const i=e.getAttribute("aria-owns");i!=null&&i.includes(t)||e.setAttribute("aria-owns",i?"".concat(i," ").concat(t):t),e.removeAttribute("role")},b(fl,Hh);let Lv=fl;var Zr;class qC{constructor({findController:t,eventBus:e,pageIndex:i}){b(this,Zr,null);this.findController=t,this.matches=[],this.eventBus=e,this.pageIdx=i,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(t,e){this.textDivs=t,this.textContentItemsStr=e}enable(){if(!this.textDivs||!this.textContentItemsStr)throw new Error("Text divs and strings have not been set.");if(this.enabled)throw new Error("TextHighlighter is already enabled.");this.enabled=!0,a(this,Zr)||(p(this,Zr,new AbortController),this.eventBus._on("updatetextlayermatches",t=>{(t.pageIndex===this.pageIdx||t.pageIndex===-1)&&this._updateMatches()},{signal:a(this,Zr).signal})),this._updateMatches()}disable(){var t;this.enabled&&(this.enabled=!1,(t=a(this,Zr))==null||t.abort(),p(this,Zr,null),this._updateMatches(!0))}_convertMatches(t,e){if(!t)return[];const{textContentItemsStr:i}=this;let s=0,n=0;const r=i.length-1,o=[];for(let l=0,c=t.length;l<c;l++){let u=t[l];for(;s!==r&&u>=n+i[s].length;)n+=i[s].length,s++;s===i.length&&console.error("Could not find a matching mapping");const d={begin:{divIdx:s,offset:u-n}};for(u+=e[l];s!==r&&u>n+i[s].length;)n+=i[s].length,s++;d.end={divIdx:s,offset:u-n},o.push(d)}return o}_renderMatches(t){if(t.length===0)return;const{findController:e,pageIdx:i}=this,{textContentItemsStr:s,textDivs:n}=this,r=i===e.selected.pageIdx,o=e.selected.matchIdx,l=e.state.highlightAll;let c=null;const u={offset:void 0};function d(A,S){const E=A.divIdx;return n[E].textContent="",f(E,0,A.offset,S)}function f(A,S,E,x){let C=n[A];if(C.nodeType===Node.TEXT_NODE){const I=document.createElement("span");C.before(I),I.append(C),n[A]=I,C=I}const P=s[A].substring(S,E),F=document.createTextNode(P);if(x){const I=document.createElement("span");if(I.className="".concat(x," appended"),I.append(F),C.append(I),x.includes("selected")){const{left:T}=I.getClientRects()[0],R=C.getBoundingClientRect().left;return T-R}return 0}return C.append(F),0}let g=o,v=g+1;if(l)g=0,v=t.length;else if(!r)return;let y=-1,w=-1;for(let A=g;A<v;A++){const S=t[A],E=S.begin;if(E.divIdx===y&&E.offset===w)continue;y=E.divIdx,w=E.offset;const x=S.end,C=r&&A===o,P=C?" selected":"";let F=0;if(!c||E.divIdx!==c.divIdx?(c!==null&&f(c.divIdx,c.offset,u.offset),d(E)):f(c.divIdx,c.offset,E.offset),E.divIdx===x.divIdx)F=f(E.divIdx,E.offset,x.offset,"highlight"+P);else{F=f(E.divIdx,E.offset,u.offset,"highlight begin"+P);for(let I=E.divIdx+1,T=x.divIdx;I<T;I++)n[I].className="highlight middle"+P;d(x,"highlight end"+P)}c=x,C&&e.scrollMatchIntoView({element:n[E.divIdx],selectedLeft:F,pageIndex:i,matchIndex:o})}c&&f(c.divIdx,c.offset,u.offset)}_updateMatches(t=!1){if(!this.enabled&&!t)return;const{findController:e,matches:i,pageIdx:s}=this,{textContentItemsStr:n,textDivs:r}=this;let o=-1;for(const u of i){const d=Math.max(o,u.begin.divIdx);for(let f=d,g=u.end.divIdx;f<=g;f++){const v=r[f];v.textContent=n[f],v.className=""}o=u.end.divIdx+1}if(!(e!=null&&e.highlightMatches)||t)return;const l=e.pageMatches[s]||null,c=e.pageMatchesLength[s]||null;this.matches=this._convertMatches(l,c),this._renderMatches(this.matches)}}Zr=new WeakMap;var kd,Bd,Lo,Ms,Qe,Qr,hg,n1,qh,r1,a1;const Kn=class Kn{constructor({pdfPage:t,highlighter:e=null,accessibilityManager:i=null,enablePermissions:s=!1,onAppend:n=null}){b(this,hg);b(this,kd,!1);b(this,Bd,null);b(this,Lo,!1);b(this,Ms,null);this.pdfPage=t,this.highlighter=e,this.accessibilityManager=i,p(this,kd,s===!0),p(this,Bd,n),this.div=document.createElement("div"),this.div.tabIndex=0,this.div.className="textLayer"}async render({viewport:t,textContentParams:e=null}){var r,o,l,c,u;if(a(this,Lo)&&a(this,Ms)){a(this,Ms).update({viewport:t,onBefore:this.hide.bind(this)}),this.show();return}this.cancel(),p(this,Ms,new ux({textContentSource:this.pdfPage.streamTextContent(e||{includeMarkedContent:!0,disableNormalization:!0}),container:this.div,viewport:t}));const{textDivs:i,textContentItemsStr:s}=a(this,Ms);(r=this.highlighter)==null||r.setTextMapping(i,s),(o=this.accessibilityManager)==null||o.setTextMapping(i),await a(this,Ms).render(),p(this,Lo,!0);const n=document.createElement("div");n.className="endOfContent",this.div.append(n),m(this,hg,n1).call(this,n),(l=a(this,Bd))==null||l.call(this,this.div),(c=this.highlighter)==null||c.enable(),(u=this.accessibilityManager)==null||u.enable()}hide(){var t;!this.div.hidden&&a(this,Lo)&&((t=this.highlighter)==null||t.disable(),this.div.hidden=!0)}show(){var t;this.div.hidden&&a(this,Lo)&&(this.div.hidden=!1,(t=this.highlighter)==null||t.enable())}cancel(){var t,e,i,s;(t=a(this,Ms))==null||t.cancel(),p(this,Ms,null),(e=this.highlighter)==null||e.disable(),(i=this.accessibilityManager)==null||i.disable(),m(s=Kn,qh,r1).call(s,this.div)}};kd=new WeakMap,Bd=new WeakMap,Lo=new WeakMap,Ms=new WeakMap,Qe=new WeakMap,Qr=new WeakMap,hg=new WeakSet,n1=function(t){var i;const{div:e}=this;e.addEventListener("mousedown",()=>{e.classList.add("selecting")}),e.addEventListener("copy",s=>{if(!a(this,kd)){const n=document.getSelection();s.clipboardData.setData("text/plain",kc(cx(n.toString())))}cv(s)}),a(Kn,Qe).set(e,t),m(i=Kn,qh,a1).call(i)},qh=new WeakSet,r1=function(t){var e;a(this,Qe).delete(t),a(this,Qe).size===0&&((e=a(this,Qr))==null||e.abort(),p(this,Qr,null))},a1=function(){if(a(this,Qr))return;p(this,Qr,new AbortController);const{signal:t}=a(this,Qr),e=(r,o)=>{o.append(r),r.style.width="",r.style.height="",o.classList.remove("selecting")};let i=!1;document.addEventListener("pointerdown",()=>{i=!0},{signal:t}),document.addEventListener("pointerup",()=>{i=!1,a(this,Qe).forEach(e)},{signal:t}),window.addEventListener("blur",()=>{i=!1,a(this,Qe).forEach(e)},{signal:t}),document.addEventListener("keyup",()=>{i||a(this,Qe).forEach(e)},{signal:t});var s,n;document.addEventListener("selectionchange",()=>{var g;const r=document.getSelection();if(r.rangeCount===0){a(this,Qe).forEach(e);return}const o=new Set;for(let v=0;v<r.rangeCount;v++){const y=r.getRangeAt(v);for(const w of a(this,Qe).keys())!o.has(w)&&y.intersectsNode(w)&&o.add(w)}for(const[v,y]of a(this,Qe))o.has(v)?v.classList.add("selecting"):e(y,v);if(s!=null||(s=getComputedStyle(a(this,Qe).values().next().value).getPropertyValue("-moz-user-select")==="none"),s)return;const l=r.getRangeAt(0),c=n&&(l.compareBoundaryPoints(Range.END_TO_END,n)===0||l.compareBoundaryPoints(Range.START_TO_END,n)===0);let u=c?l.startContainer:l.endContainer;if(u.nodeType===Node.TEXT_NODE&&(u=u.parentNode),!c&&l.endOffset===0)do{for(;!u.previousSibling;)u=u.parentNode;u=u.previousSibling}while(!u.childNodes.length);const d=(g=u.parentElement)==null?void 0:g.closest(".textLayer"),f=a(this,Qe).get(d);f&&(f.style.width=d.style.width,f.style.height=d.style.height,u.parentElement.insertBefore(f,c?u:u.nextSibling)),n=l.cloneRange()},{signal:t})},b(Kn,qh),b(Kn,Qe,new Map),b(Kn,Qr,null);let Bp=Kn;class v0{constructor({pdfPage:t,annotationStorage:e=null,linkService:i,xfaHtml:s=null}){this.pdfPage=t,this.annotationStorage=e,this.linkService=i,this.xfaHtml=s,this.div=null,this._cancelled=!1}async render({viewport:t,intent:e="display"}){if(e==="print"){const n={viewport:t.clone({dontFlip:!0}),div:this.div,xfaHtml:this.xfaHtml,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:e};return this.div=document.createElement("div"),n.div=this.div,Rg.render(n)}const i=await this.pdfPage.getXfa();if(this._cancelled||!i)return{textDivs:[]};const s={viewport:t.clone({dontFlip:!0}),div:this.div,xfaHtml:i,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:e};return this.div?Rg.update(s):(this.div=document.createElement("div"),s.div=this.div,Rg.render(s))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}const tP={annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new bg}},eP=new Map([["canvasWrapper",0],["textLayer",1],["annotationLayer",2],["annotationEditorLayer",3],["xfaLayer",3]]);var Mo,Jr,jd,Vd,Hd,qr,ta,$h,$d,Ud,Wd,Uh,zd,Dn,ea,ot,al,yp,Rc,Nv,Ov,kv,Bv,jv,l1,h1,c1,Vv;class o1 extends t1{constructor(e){var r,o,l,c,u,d,f;super(e);b(this,ot);b(this,Mo,kn.ENABLE_FORMS);b(this,Jr,null);b(this,jd,!0);b(this,Vd,!1);b(this,Hd,!1);b(this,qr,null);b(this,ta,!1);b(this,$h,null);b(this,$d,null);b(this,Ud,1);b(this,Wd,1);b(this,Uh,Os.ENABLE);b(this,zd,1);b(this,Dn,{directDrawing:!0,initialOptionalContent:!0,regularAnnotations:!0});b(this,ea,[null,null,null,null]);const i=e.container,s=e.defaultViewport;this.renderingId="page"+this.id,p(this,qr,e.layerProperties||tP),this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=e.scale||PA,this.viewport=s,this.pdfPageRotate=s.rotation,this._optionalContentConfigPromise=e.optionalContentConfigPromise||null,p(this,Uh,(r=e.textLayerMode)!=null?r:Os.ENABLE),p(this,Mo,(o=e.annotationMode)!=null?o:kn.ENABLE_FORMS),this.imageResourcesPath=e.imageResourcesPath||"",this.enableDetailCanvas=(l=e.enableDetailCanvas)!=null?l:!0,this.maxCanvasPixels=(c=e.maxCanvasPixels)!=null?c:Bc.get("maxCanvasPixels"),this.maxCanvasDim=e.maxCanvasDim||Bc.get("maxCanvasDim"),this.capCanvasAreaFactor=(u=e.capCanvasAreaFactor)!=null?u:Bc.get("capCanvasAreaFactor"),p(this,jd,e.enableAutoLinking!==!1),this.l10n=e.l10n,this.l10n||(this.l10n=new Go),this._isStandalone=!((d=this.renderingQueue)!=null&&d.hasViewer()),this._container=i,this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.xfaLayer=null,this.structTreeLayer=null,this.drawLayer=null,this.detailView=null;const n=document.createElement("div");if(n.className="page",n.setAttribute("data-page-number",this.id),n.setAttribute("role","region"),n.setAttribute("data-l10n-id","pdfjs-page-landmark"),n.setAttribute("data-l10n-args",JSON.stringify({page:this.id})),this.div=n,m(this,ot,yp).call(this),i==null||i.append(n),this._isStandalone){i==null||i.style.setProperty("--scale-factor",this.scale*Ys.PDF_TO_CSS_UNITS),(f=this.pageColors)!=null&&f.background&&(i==null||i.style.setProperty("--page-bg-color",this.pageColors.background));const{optionalContentConfigPromise:g}=e;g&&g.then(v=>{g===this._optionalContentConfigPromise&&(a(this,Dn).initialOptionalContent=v.hasInitialVisibility)}),e.l10n||this.l10n.translate(this.div)}}setPdfPage(e){var s,n,r,o;this._isStandalone&&(((s=this.pageColors)==null?void 0:s.foreground)==="CanvasText"||((n=this.pageColors)==null?void 0:n.background)==="Canvas")&&((r=this._container)==null||r.style.setProperty("--hcm-highlight-filter",e.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),(o=this._container)==null||o.style.setProperty("--hcm-highlight-selected-filter",e.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","Highlight"))),this.pdfPage=e,this.pdfPageRotate=e.rotate;const i=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:this.scale*Ys.PDF_TO_CSS_UNITS,rotation:i}),m(this,ot,yp).call(this),this.reset()}destroy(){var e;this.reset(),(e=this.pdfPage)==null||e.cleanup()}hasEditableAnnotations(){var e;return!!((e=this.annotationLayer)!=null&&e.hasEditableAnnotations())}get _textHighlighter(){return kp(this,"_textHighlighter",new qC({pageIndex:this.id-1,eventBus:this.eventBus,findController:a(this,qr).findController}))}_resetCanvas(){super._resetCanvas(),p(this,$h,null)}reset({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:i=!1,keepXfaLayer:s=!1,keepTextLayer:n=!1,keepCanvasWrapper:r=!1,preserveDetailViewState:o=!1}={}){var y,w,A,S,E,x;this.cancelRendering({keepAnnotationLayer:e,keepAnnotationEditorLayer:i,keepXfaLayer:s,keepTextLayer:n}),this.renderingState=bt.INITIAL;const l=this.div,c=l.childNodes,u=e&&((y=this.annotationLayer)==null?void 0:y.div)||null,d=i&&((w=this.annotationEditorLayer)==null?void 0:w.div)||null,f=s&&((A=this.xfaLayer)==null?void 0:A.div)||null,g=n&&((S=this.textLayer)==null?void 0:S.div)||null,v=r&&a(this,Jr)||null;for(let C=c.length-1;C>=0;C--){const P=c[C];switch(P){case u:case d:case f:case g:case v:continue}P.remove();const F=a(this,ea).indexOf(P);F>=0&&(a(this,ea)[F]=null)}l.removeAttribute("data-loaded"),u&&this.annotationLayer.hide(),d&&this.annotationEditorLayer.hide(),f&&this.xfaLayer.hide(),g&&this.textLayer.hide(),(E=this.structTreeLayer)==null||E.hide(),!r&&a(this,Jr)&&(p(this,Jr,null),this._resetCanvas()),o||((x=this.detailView)==null||x.reset({keepCanvas:r}),r||(this.detailView=null))}toggleEditingMode(e){p(this,Hd,e),this.hasEditableAnnotations()&&this.reset({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,keepCanvasWrapper:!0})}updateVisibleArea(e){var i;this.enableDetailCanvas&&(a(this,ta)&&this.maxCanvasPixels>0&&e?((i=this.detailView)!=null||(this.detailView=new QC({pageView:this})),this.detailView.update({visibleArea:e})):this.detailView&&(this.detailView.reset(),this.detailView=null))}update({scale:e=0,rotation:i=null,optionalContentConfigPromise:s=null,drawingDelay:n=-1}){var o,l,c;this.scale=e||this.scale,typeof i=="number"&&(this.rotation=i),s instanceof Promise&&(this._optionalContentConfigPromise=s,s.then(u=>{s===this._optionalContentConfigPromise&&(a(this,Dn).initialOptionalContent=u.hasInitialVisibility)})),a(this,Dn).directDrawing=!0;const r=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*Ys.PDF_TO_CSS_UNITS,rotation:r}),m(this,ot,yp).call(this),this._isStandalone&&((o=this._container)==null||o.style.setProperty("--scale-factor",this.viewport.scale)),m(this,ot,Vv).call(this),this.canvas){const u=a(this,Vd)&&a(this,ta),d=n>=0&&n<1e3;if(d||u){d&&!u&&this.renderingState!==bt.FINISHED&&(this.cancelRendering({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:n}),this.renderingState=bt.FINISHED,a(this,Dn).directDrawing=!1),this.cssTransform({redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!d,hideTextLayer:d}),d||((l=this.detailView)==null||l.update({underlyingViewUpdated:!0}),this.dispatchPageRendered(!0,!1));return}}this.cssTransform({}),this.reset({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,keepCanvasWrapper:!0,preserveDetailViewState:!0}),(c=this.detailView)==null||c.update({underlyingViewUpdated:!0})}cancelRendering({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:i=!1,keepXfaLayer:s=!1,keepTextLayer:n=!1,cancelExtraDelay:r=0}={}){var o;super.cancelRendering({cancelExtraDelay:r}),this.textLayer&&(!n||!this.textLayer.div)&&(this.textLayer.cancel(),this.textLayer=null),this.annotationLayer&&(!e||!this.annotationLayer.div)&&(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),this.annotationEditorLayer&&(!i||!this.annotationEditorLayer.div)&&(this.drawLayer&&(this.drawLayer.cancel(),this.drawLayer=null),this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),this.xfaLayer&&(!s||!this.xfaLayer.div)&&(this.xfaLayer.cancel(),this.xfaLayer=null,(o=this._textHighlighter)==null||o.disable())}cssTransform({redrawAnnotationLayer:e=!1,redrawAnnotationEditorLayer:i=!1,redrawXfaLayer:s=!1,redrawTextLayer:n=!1,hideTextLayer:r=!1}){var c;const{canvas:o}=this;if(!o)return;const l=a(this,$h);if(this.viewport!==l){const u=(360+this.viewport.rotation-l.rotation)%360;if(u===90||u===270){const{width:d,height:f}=this.viewport,g=f/d,v=d/f;o.style.transform="rotate(".concat(u,"deg) scale(").concat(g,",").concat(v,")")}else o.style.transform=u===0?"":"rotate(".concat(u,"deg)")}e&&this.annotationLayer&&m(this,ot,Nv).call(this),i&&this.annotationEditorLayer&&(this.drawLayer&&m(this,ot,kv).call(this),m(this,ot,Ov).call(this)),s&&this.xfaLayer&&m(this,ot,Bv).call(this),this.textLayer&&(r?(this.textLayer.hide(),(c=this.structTreeLayer)==null||c.hide()):n&&m(this,ot,jv).call(this))}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,i){return this.viewport.convertToPdfPoint(e,i)}_ensureCanvasWrapper(){let e=a(this,Jr);return e||(e=p(this,Jr,document.createElement("div")),e.classList.add("canvasWrapper"),m(this,ot,al).call(this,e,"canvasWrapper")),e}_getRenderingContext(e,i){return{canvas:e,transform:i,viewport:this.viewport,annotationMode:a(this,Mo),optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:this.pageColors,isEditing:a(this,Hd)}}async draw(){this.renderingState!==bt.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:e,l10n:i,pdfPage:s,viewport:n}=this;if(!s)throw this.renderingState=bt.FINISHED,new Error("pdfPage is not loaded");this.renderingState=bt.RUNNING;const r=this._ensureCanvasWrapper();if(!this.textLayer&&a(this,Uh)!==Os.DISABLE&&!s.isPureXfa&&(this._accessibilityManager||(this._accessibilityManager=new Lv),this.textLayer=new Bp({pdfPage:s,highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,enablePermissions:a(this,Uh)===Os.ENABLE_PERMISSIONS,onAppend:x=>{this.l10n.pause(),m(this,ot,al).call(this,x,"textLayer"),this.l10n.resume()}})),!this.annotationLayer&&a(this,Mo)!==kn.DISABLE){const{annotationStorage:x,annotationEditorUIManager:C,downloadManager:P,enableScripting:F,fieldObjectsPromise:I,hasJSActionsPromise:T,linkService:R}=a(this,qr);this._annotationCanvasMap||(this._annotationCanvasMap=new Map),this.annotationLayer=new BA({pdfPage:s,annotationStorage:x,imageResourcesPath:this.imageResourcesPath,renderForms:a(this,Mo)===kn.ENABLE_FORMS,linkService:R,downloadManager:P,enableScripting:F,hasJSActionsPromise:T,fieldObjectsPromise:I,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager,annotationEditorUIManager:C,onAppend:_=>{m(this,ot,al).call(this,_,"annotationLayer")}})}const{width:o,height:l}=n;p(this,$h,n);const{canvas:c,prevCanvas:u}=this._createCanvas(x=>{r.prepend(x)});c.setAttribute("role","presentation"),this.outputScale||m(this,ot,Vv).call(this);const{outputScale:d}=this;p(this,Vd,a(this,ta));const f=sb(d.sx),g=sb(d.sy),v=c.width=Ff(If(o*d.sx),f[0]),y=c.height=Ff(If(l*d.sy),g[0]),w=Ff(If(o),f[1]),A=Ff(If(l),g[1]);d.sx=v/w,d.sy=y/A,a(this,Ud)!==f[1]&&(e.style.setProperty("--scale-round-x","".concat(f[1],"px")),p(this,Ud,f[1])),a(this,Wd)!==g[1]&&(e.style.setProperty("--scale-round-y","".concat(g[1],"px")),p(this,Wd,g[1]));const S=d.scaled?[d.sx,0,0,d.sy,0,0]:null,E=this._drawCanvas(this._getRenderingContext(c,S),()=>{u==null||u.remove(),this._resetCanvas()},x=>{a(this,Dn).regularAnnotations=!x.separateAnnots,this.dispatchPageRendered(!1,!1)}).then(async()=>{var P;this.structTreeLayer||(this.structTreeLayer=new i1(s,n.rawDims));const x=m(this,ot,jv).call(this);this.annotationLayer&&(await m(this,ot,Nv).call(this),a(this,jd)&&this.annotationLayer&&this.textLayer&&await m(this,ot,c1).call(this,x));const{annotationEditorUIManager:C}=a(this,qr);C&&(this.drawLayer||(this.drawLayer=new ZC({pageIndex:this.id})),await m(this,ot,kv).call(this),this.drawLayer.setParent(r),this.annotationEditorLayer||(this.annotationEditorLayer=new XC({uiManager:C,pdfPage:s,l10n:i,structTreeLayer:this.structTreeLayer,accessibilityManager:this._accessibilityManager,annotationLayer:(P=this.annotationLayer)==null?void 0:P.annotationLayer,textLayer:this.textLayer,drawLayer:this.drawLayer.getDrawLayer(),onAppend:F=>{m(this,ot,al).call(this,F,"annotationEditorLayer")}})),m(this,ot,Ov).call(this))});if(s.isPureXfa){if(!this.xfaLayer){const{annotationStorage:x,linkService:C}=a(this,qr);this.xfaLayer=new v0({pdfPage:s,annotationStorage:x,linkService:C})}m(this,ot,Bv).call(this)}return e.setAttribute("data-loaded",!0),this.dispatchPageRender(),E}setPageLabel(e){var i;this.pageLabel=typeof e=="string"?e:null,this.div.setAttribute("data-l10n-args",JSON.stringify({page:(i=this.pageLabel)!=null?i:this.id})),this.pageLabel!==null?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){const{directDrawing:e,initialOptionalContent:i,regularAnnotations:s}=a(this,Dn);return e&&i&&s?this.canvas:null}}Mo=new WeakMap,Jr=new WeakMap,jd=new WeakMap,Vd=new WeakMap,Hd=new WeakMap,qr=new WeakMap,ta=new WeakMap,$h=new WeakMap,$d=new WeakMap,Ud=new WeakMap,Wd=new WeakMap,Uh=new WeakMap,zd=new WeakMap,Dn=new WeakMap,ea=new WeakMap,ot=new WeakSet,al=function(e,i){const s=eP.get(i),n=a(this,ea)[s];if(a(this,ea)[s]=e,n){n.replaceWith(e);return}for(let r=s-1;r>=0;r--){const o=a(this,ea)[r];if(o){o.after(e);return}}this.div.prepend(e)},yp=function(){const{div:e,viewport:i}=this;if(i.userUnit!==a(this,zd)&&(i.userUnit!==1?e.style.setProperty("--user-unit",i.userUnit):e.style.removeProperty("--user-unit"),p(this,zd,i.userUnit)),this.pdfPage){if(a(this,$d)===i.rotation)return;p(this,$d,i.rotation)}CA(e,i,!0,!1)},Rc=function(e,i){this.eventBus.dispatch(e,{source:this,pageNumber:this.id,error:i})},Nv=async function(){let e=null;try{await this.annotationLayer.render({viewport:this.viewport,intent:"display",structTreeLayer:this.structTreeLayer})}catch(i){console.error("#renderAnnotationLayer:",i),e=i}finally{m(this,ot,Rc).call(this,"annotationlayerrendered",e)}},Ov=async function(){let e=null;try{await this.annotationEditorLayer.render({viewport:this.viewport,intent:"display"})}catch(i){console.error("#renderAnnotationEditorLayer:",i),e=i}finally{m(this,ot,Rc).call(this,"annotationeditorlayerrendered",e)}},kv=async function(){try{await this.drawLayer.render({intent:"display"})}catch(e){console.error("#renderDrawLayer:",e)}},Bv=async function(){var i;let e=null;try{const s=await this.xfaLayer.render({viewport:this.viewport,intent:"display"});s!=null&&s.textDivs&&this._textHighlighter&&m(this,ot,h1).call(this,s.textDivs)}catch(s){console.error("#renderXfaLayer:",s),e=s}finally{(i=this.xfaLayer)!=null&&i.div&&(this.l10n.pause(),m(this,ot,al).call(this,this.xfaLayer.div,"xfaLayer"),this.l10n.resume()),m(this,ot,Rc).call(this,"xfalayerrendered",e)}},jv=async function(){if(!this.textLayer)return;let e=null;try{await this.textLayer.render({viewport:this.viewport})}catch(i){if(i instanceof ex)return;console.error("#renderTextLayer:",i),e=i}m(this,ot,Rc).call(this,"textlayerrendered",e),m(this,ot,l1).call(this)},l1=async function(){var i,s,n;if(!this.textLayer)return;const e=await((i=this.structTreeLayer)==null?void 0:i.render());e&&(this.l10n.pause(),(s=this.structTreeLayer)==null||s.addElementsToTextLayer(),this.canvas&&e.parentNode!==this.canvas&&this.canvas.append(e),this.l10n.resume()),(n=this.structTreeLayer)==null||n.show()},h1=async function(e){const i=await this.pdfPage.getTextContent(),s=[];for(const n of i.items)s.push(n.str);this._textHighlighter.setTextMapping(e,s),this._textHighlighter.enable()},c1=async function(e){try{if(await e,!this.annotationLayer)return;await this.annotationLayer.injectLinkAnnotations({inferredLinks:Iv.processLinks(this),viewport:this.viewport,structTreeLayer:this.structTreeLayer})}catch(i){console.error("#injectLinkAnnotations:",i)}},Vv=function(){const{width:e,height:i}=this.viewport,s=this.outputScale=new up;if(this.maxCanvasPixels===0){const n=1/this.scale;s.sx*=n,s.sy*=n,p(this,ta,!0)}else p(this,ta,s.limitCanvas(e,i,this.maxCanvasPixels,this.maxCanvasDim,this.capCanvasAreaFactor))};async function iP(h){const t="",e="",{info:i,metadata:s,contentDispositionFilename:n,contentLength:r}=await h.getMetadata();return{...i,baseURL:e,filesize:r||(await h.getDownloadInfo()).length,filename:n||ox(t),metadata:s==null?void 0:s.getRaw(),authors:s==null?void 0:s.get("dc:creator"),numPages:h.numPages,URL:t}}class sP{constructor(t){this._ready=new Promise((e,i)=>{import(t).then(n=>{e(n.QuickJSSandbox())}).catch(i)})}async createSandbox(t){(await this._ready).create(t)}async dispatchEventInSandbox(t){const e=await this._ready;setTimeout(()=>e.dispatchEvent(t),0)}async destroySandbox(){(await this._ready).nukeSandbox()}}var Ns,No,Gd,Oo,ko,Xd,je,Ln,Wh,ne,ki,pe,u1,wp,Hv,d1,_c;class nP{constructor({eventBus:t,externalServices:e=null,docProperties:i=null}){b(this,pe);b(this,Ns,null);b(this,No,null);b(this,Gd,null);b(this,Oo,null);b(this,ko,null);b(this,Xd,null);b(this,je,null);b(this,Ln,null);b(this,Wh,!1);b(this,ne,null);b(this,ki,null);p(this,ko,t),p(this,Xd,e),p(this,Gd,i)}setViewer(t){p(this,Ln,t)}async setDocument(t){var o;if(a(this,je)&&await m(this,pe,_c).call(this),p(this,je,t),!t)return;const[e,i,s]=await Promise.all([t.getFieldObjects(),t.getCalculationOrderIds(),t.getJSActions()]);if(!e&&!s){await m(this,pe,_c).call(this);return}if(t!==a(this,je))return;try{p(this,ne,m(this,pe,d1).call(this))}catch(l){console.error("setDocument:",l),await m(this,pe,_c).call(this);return}const n=a(this,ko);p(this,Oo,new AbortController);const{signal:r}=a(this,Oo);n._on("updatefromsandbox",l=>{(l==null?void 0:l.source)===window&&m(this,pe,u1).call(this,l.detail)},{signal:r}),n._on("dispatcheventinsandbox",l=>{var c;(c=a(this,ne))==null||c.dispatchEventInSandbox(l.detail)},{signal:r}),n._on("pagechanging",({pageNumber:l,previous:c})=>{l!==c&&(m(this,pe,Hv).call(this,c),m(this,pe,wp).call(this,l))},{signal:r}),n._on("pagerendered",({pageNumber:l})=>{this._pageOpenPending.has(l)&&l===a(this,Ln).currentPageNumber&&m(this,pe,wp).call(this,l)},{signal:r}),n._on("pagesdestroy",async()=>{var l,c;await m(this,pe,Hv).call(this,a(this,Ln).currentPageNumber),await((l=a(this,ne))==null?void 0:l.dispatchEventInSandbox({id:"doc",name:"WillClose"})),(c=a(this,Ns))==null||c.resolve()},{signal:r});try{const l=await a(this,Gd).call(this,t);if(t!==a(this,je))return;await a(this,ne).createSandbox({objects:e,calculationOrder:i,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...l,actions:s}}),n.dispatch("sandboxcreated",{source:this})}catch(l){console.error("setDocument:",l),await m(this,pe,_c).call(this);return}await((o=a(this,ne))==null?void 0:o.dispatchEventInSandbox({id:"doc",name:"Open"})),await m(this,pe,wp).call(this,a(this,Ln).currentPageNumber,!0),Promise.resolve().then(()=>{t===a(this,je)&&p(this,Wh,!0)})}async dispatchWillSave(){var t;return(t=a(this,ne))==null?void 0:t.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(){var t;return(t=a(this,ne))==null?void 0:t.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(){var t;if(a(this,ne)){await((t=a(this,ki))==null?void 0:t.promise),p(this,ki,Promise.withResolvers());try{await a(this,ne).dispatchEventInSandbox({id:"doc",name:"WillPrint"})}catch(e){throw a(this,ki).resolve(),p(this,ki,null),e}await a(this,ki).promise}}async dispatchDidPrint(){var t;return(t=a(this,ne))==null?void 0:t.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get destroyPromise(){var t;return((t=a(this,No))==null?void 0:t.promise)||null}get ready(){return a(this,Wh)}get _pageOpenPending(){return kp(this,"_pageOpenPending",new Set)}get _visitedPages(){return kp(this,"_visitedPages",new Map)}}Ns=new WeakMap,No=new WeakMap,Gd=new WeakMap,Oo=new WeakMap,ko=new WeakMap,Xd=new WeakMap,je=new WeakMap,Ln=new WeakMap,Wh=new WeakMap,ne=new WeakMap,ki=new WeakMap,pe=new WeakSet,u1=async function(t){var c,u;const e=a(this,Ln),i=e.isInPresentationMode||e.isChangingPresentationMode,{id:s,siblings:n,command:r,value:o}=t;if(!s){switch(r){case"clear":console.clear();break;case"error":console.error(o);break;case"layout":if(!i){const d=xx(o);e.spreadMode=d.spreadMode}break;case"page-num":e.currentPageNumber=o+1;break;case"print":await e.pagesPromise,a(this,ko).dispatch("print",{source:this});break;case"println":console.log(o);break;case"zoom":i||(e.currentScaleValue=o);break;case"SaveAs":a(this,ko).dispatch("download",{source:this});break;case"FirstPage":e.currentPageNumber=1;break;case"LastPage":e.currentPageNumber=e.pagesCount;break;case"NextPage":e.nextPage();break;case"PrevPage":e.previousPage();break;case"ZoomViewIn":i||e.increaseScale();break;case"ZoomViewOut":i||e.decreaseScale();break;case"WillPrintFinished":(c=a(this,ki))==null||c.resolve(),p(this,ki,null);break}return}if(i&&t.focus)return;delete t.id,delete t.siblings;const l=n?[s,...n]:[s];for(const d of l){const f=document.querySelector('[data-element-id="'.concat(d,'"]'));f?f.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:t})):(u=a(this,je))==null||u.annotationStorage.setValue(d,t)}},wp=async function(t,e=!1){const i=a(this,je),s=this._visitedPages;if(e&&p(this,Ns,Promise.withResolvers()),!a(this,Ns))return;const n=a(this,Ln).getPageView(t-1);if((n==null?void 0:n.renderingState)!==bt.FINISHED){this._pageOpenPending.add(t);return}this._pageOpenPending.delete(t);const r=(async()=>{var l,c;const o=await(s.has(t)?null:(l=n.pdfPage)==null?void 0:l.getJSActions());i===a(this,je)&&await((c=a(this,ne))==null?void 0:c.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:t,actions:o}))})();s.set(t,r)},Hv=async function(t){var n;const e=a(this,je),i=this._visitedPages;if(!a(this,Ns)||this._pageOpenPending.has(t))return;const s=i.get(t);s&&(i.set(t,null),await s,e===a(this,je)&&await((n=a(this,ne))==null?void 0:n.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:t})))},d1=function(){if(p(this,No,Promise.withResolvers()),a(this,ne))throw new Error("#initScripting: Scripting already exists.");return a(this,Xd).createScripting()},_c=async function(){var t,e,i,s;if(!a(this,ne)){p(this,je,null),(t=a(this,No))==null||t.resolve();return}a(this,Ns)&&(await Promise.race([a(this,Ns).promise,new Promise(n=>{setTimeout(n,1e3)})]).catch(()=>{}),p(this,Ns,null)),p(this,je,null);try{await a(this,ne).destroySandbox()}catch(n){}(e=a(this,ki))==null||e.reject(new Error("Scripting destroyed.")),p(this,ki,null),(i=a(this,Oo))==null||i.abort(),p(this,Oo,null),this._pageOpenPending.clear(),this._visitedPages.clear(),p(this,ne,null),p(this,Wh,!1),(s=a(this,No))==null||s.resolve()};class rP extends nP{constructor(t){t.externalServices||window.addEventListener("updatefromsandbox",e=>{t.eventBus.dispatch("updatefromsandbox",{source:window,detail:e.detail})}),t.externalServices||(t.externalServices={createScripting:()=>new sP(t.sandboxBundleSrc)}),t.docProperties||(t.docProperties=e=>iP(e)),super(t)}}Lt(1148);Lt(3579);const aP=3e4;let oP=class{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(t){this.pdfViewer=t}setThumbnailViewer(t){this.pdfThumbnailViewer=t}isHighestPriority(t){return this.highestPriorityPage===t.renderingId}renderHighestPriority(t){var e;this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),!this.pdfViewer.forceRendering(t)&&(this.isThumbnailViewEnabled&&((e=this.pdfThumbnailViewer)!=null&&e.forceRendering())||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),aP)))}getHighestPriority(t,e,i,s=!1,n=!1){const r=t.views,o=r.length;if(o===0)return null;for(let f=0;f<o;f++){const g=r[f].view;if(!this.isViewFinished(g))return g}if(!n)for(let f=0;f<o;f++){const{detailView:g}=r[f].view;if(g&&!this.isViewFinished(g))return g}const l=t.first.id,c=t.last.id;if(c-l+1>o){const f=t.ids;for(let g=1,v=c-l;g<v;g++){const y=i?l+g:c-g;if(f.has(y))continue;const w=e[y-1];if(!this.isViewFinished(w))return w}}let u=i?c:l-2,d=e[u];return d&&!this.isViewFinished(d)||s&&(u+=i?1:-1,d=e[u],d&&!this.isViewFinished(d))?d:null}isViewFinished(t){return t.renderingState===bt.FINISHED}renderView(t){switch(t.renderingState){case bt.FINISHED:return!1;case bt.PAUSED:this.highestPriorityPage=t.renderingId,t.resume();break;case bt.RUNNING:this.highestPriorityPage=t.renderingId;break;case bt.INITIAL:this.highestPriorityPage=t.renderingId,t.draw().finally(()=>{this.renderHighestPriority()}).catch(e=>{e instanceof hv||console.error("renderView:",e)});break}return!0}};const Ib=10,Df={FORCE_SCROLL_MODE_PAGE:1e4,FORCE_LAZY_PAGE_INIT:5e3,PAUSE_EAGER_PAGE_INIT:250};function Rb(h){return Object.values(ei).includes(h)&&h!==ei.DISABLE}var Mn,Bo,Yd,$v;class lP{constructor(t){b(this,Yd);b(this,Mn,new Set);b(this,Bo,0);p(this,Bo,t)}push(t){const e=a(this,Mn);e.has(t)&&e.delete(t),e.add(t),e.size>a(this,Bo)&&m(this,Yd,$v).call(this)}resize(t,e=null){p(this,Bo,t);const i=a(this,Mn);if(e){const s=i.size;let n=1;for(const r of i)if(e.has(r.id)&&(i.delete(r),i.add(r)),++n>s)break}for(;i.size>a(this,Bo);)m(this,Yd,$v).call(this)}has(t){return a(this,Mn).has(t)}[Symbol.iterator](){return a(this,Mn).keys()}}Mn=new WeakMap,Bo=new WeakMap,Yd=new WeakSet,$v=function(){const t=a(this,Mn).keys().next().value;t==null||t.destroy(),a(this,Mn).delete(t)};var Nn,Kd,Zd,es,bi,jo,Qd,Jd,qd,tf,ef,sf,nf,rf,af,ia,of,zh,is,Vo,Ho,Gh,sa,Xh,lf,Yh,$o,On,Kh,hf,Zh,cf,Z,f1,p1,g1,Dc,Ap,m1,Uv,v1,Xn,Wv,b1,y1,w1,zv,A1,Gv,Ep,Xv;class b0{constructor(t){b(this,Z);b(this,Nn,null);b(this,Kd,null);b(this,Zd,null);b(this,es,ei.NONE);b(this,bi,null);b(this,jo,kn.ENABLE_FORMS);b(this,Qd,null);b(this,Jd,null);b(this,qd,null);b(this,tf,!1);b(this,ef,!1);b(this,sf,!1);b(this,nf,!1);b(this,rf,!1);b(this,af,!0);b(this,ia,null);b(this,of,0);b(this,zh,null);b(this,is,null);b(this,Vo,null);b(this,Ho,null);b(this,Gh,!1);b(this,sa,null);b(this,Xh,!1);b(this,lf,0);b(this,Yh,new ResizeObserver(m(this,Z,A1).bind(this)));b(this,$o,null);b(this,On,null);b(this,Kh,null);b(this,hf,!0);b(this,Zh,Os.ENABLE);b(this,cf,null);var s,n,r,o,l,c,u;const e="5.4.54";if(J0!==e)throw new Error('The API version "'.concat(J0,'" does not match the Viewer version "').concat(e,'".'));if(this.container=t.container,this.viewer=t.viewer||t.container.firstElementChild,p(this,cf,t.viewerAlert||null),((s=this.container)==null?void 0:s.tagName)!=="DIV"||((n=this.viewer)==null?void 0:n.tagName)!=="DIV")throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&getComputedStyle(this.container).position!=="absolute")throw new Error("The `container` must be absolutely positioned.");a(this,Yh).observe(this.container),this.eventBus=t.eventBus,this.linkService=t.linkService||new bg,this.downloadManager=t.downloadManager||null,this.findController=t.findController||null,p(this,Kd,t.altTextManager||null),p(this,Qd,t.commentManager||null),p(this,Kh,t.signatureManager||null),p(this,qd,t.editorUndoBar||null),this.findController&&(this.findController.onIsPageVisible=d=>this._getVisiblePages().ids.has(d)),this._scriptingManager=t.scriptingManager||null,p(this,Zh,(r=t.textLayerMode)!=null?r:Os.ENABLE),p(this,jo,(o=t.annotationMode)!=null?o:kn.ENABLE_FORMS),p(this,es,(l=t.annotationEditorMode)!=null?l:ei.NONE),p(this,Zd,t.annotationEditorHighlightColors||null),p(this,ef,t.enableHighlightFloatingButton===!0),p(this,nf,t.enableUpdatedAddImage===!0),p(this,rf,t.enableNewAltTextWhenAddingImage===!0),this.imageResourcesPath=t.imageResourcesPath||"",this.enablePrintAutoRotate=t.enablePrintAutoRotate||!1,this.removePageBorders=t.removePageBorders||!1,this.maxCanvasPixels=t.maxCanvasPixels,this.maxCanvasDim=t.maxCanvasDim,this.capCanvasAreaFactor=t.capCanvasAreaFactor,this.enableDetailCanvas=(c=t.enableDetailCanvas)!=null?c:!0,this.l10n=t.l10n,this.l10n||(this.l10n=new Go),p(this,sf,t.enablePermissions||!1),this.pageColors=t.pageColors||null,p(this,zh,t.mlManager||null),p(this,tf,t.enableHWA||!1),p(this,hf,t.supportsPinchToZoom!==!1),p(this,af,t.enableAutoLinking!==!1),p(this,of,(u=t.minDurationToUpdateCanvas)!=null?u:500),this.defaultRenderingQueue=!t.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new oP,this.renderingQueue.setViewer(this)):this.renderingQueue=t.renderingQueue;const{abortSignal:i}=t;i==null||i.addEventListener("abort",()=>{a(this,Yh).disconnect(),p(this,Yh,null)},{once:!0}),this.scroll=vx(this.container,this._scrollUpdate.bind(this),i),this.presentationModeState=gl.UNKNOWN,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),m(this,Z,zv).call(this),this.eventBus._on("thumbnailrendered",({pageNumber:d,pdfPage:f})=>{const g=this._pages[d-1];a(this,Nn).has(g)||f==null||f.cleanup()}),t.l10n||this.l10n.translate(this.container)}get pagesCount(){return this._pages.length}getPageView(t){return this._pages[t]}getCachedPageViews(){return new Set(a(this,Nn))}get pageViewsReady(){return this._pages.every(t=>t==null?void 0:t.pdfPage)}get renderForms(){return a(this,jo)===kn.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(t){if(!Number.isInteger(t))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(t,!0)||console.error('currentPageNumber: "'.concat(t,'" is not a valid page.')))}_setCurrentPageNumber(t,e=!1){var s,n;if(this._currentPageNumber===t)return e&&m(this,Z,Wv).call(this),!0;if(!(0<t&&t<=this.pagesCount))return!1;const i=this._currentPageNumber;return this._currentPageNumber=t,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:t,pageLabel:(n=(s=this._pageLabels)==null?void 0:s[t-1])!=null?n:null,previous:i}),e&&m(this,Z,Wv).call(this),!0}get currentPageLabel(){var t,e;return(e=(t=this._pageLabels)==null?void 0:t[this._currentPageNumber-1])!=null?e:null}set currentPageLabel(t){if(!this.pdfDocument)return;let e=t|0;if(this._pageLabels){const i=this._pageLabels.indexOf(t);i>=0&&(e=i+1)}this._setCurrentPageNumber(e,!0)||console.error('currentPageLabel: "'.concat(t,'" is not a valid page.'))}get currentScale(){return this._currentScale!==_g?this._currentScale:PA}set currentScale(t){if(isNaN(t))throw new Error("Invalid numeric scale.");this.pdfDocument&&m(this,Z,Xn).call(this,t,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(t){this.pdfDocument&&m(this,Z,Xn).call(this,t,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(t){if(!FA(t))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument||(t%=360,t<0&&(t+=360),this._pagesRotation===t))return;this._pagesRotation=t;const e=this._currentPageNumber;this.refresh(!0,{rotation:t}),this._currentScaleValue&&m(this,Z,Xn).call(this,this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:t,pageNumber:e}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}get _layerProperties(){const t=this;return kp(this,"_layerProperties",{get annotationEditorUIManager(){return a(t,bi)},get annotationStorage(){var e;return(e=t.pdfDocument)==null?void 0:e.annotationStorage},get downloadManager(){return t.downloadManager},get enableScripting(){return!!t._scriptingManager},get fieldObjectsPromise(){var e;return(e=t.pdfDocument)==null?void 0:e.getFieldObjects()},get findController(){return t.findController},get hasJSActionsPromise(){var e;return(e=t.pdfDocument)==null?void 0:e.hasJSActions()},get linkService(){return t.linkService}})}async getAllText(){const t=[],e=[];for(let i=1,s=this.pdfDocument.numPages;i<=s;++i){if(a(this,Xh))return null;e.length=0;const n=await this.pdfDocument.getPage(i),{items:r}=await n.getTextContent();for(const o of r)o.str&&e.push(o.str),o.hasEOL&&e.push("\n");t.push(kc(e.join("")))}return t.join("\n")}setDocument(t){var f,g,v;if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),(f=this.findController)==null||f.setDocument(null),(g=this._scriptingManager)==null||g.setDocument(null),(v=a(this,bi))==null||v.destroy(),p(this,bi,null)),this.pdfDocument=t,!t)return;const e=t.numPages,i=t.getPage(1),s=t.getOptionalContentConfig({intent:"display"}),n=a(this,sf)?t.getPermissions():Promise.resolve(),{eventBus:r,pageColors:o,viewer:l}=this;p(this,ia,new AbortController);const{signal:c}=a(this,ia);if(e>Df.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const y=this._scrollMode=dt.PAGE;r.dispatch("scrollmodechanged",{source:this,mode:y})}this._pagesCapability.promise.then(()=>{r.dispatch("pagesloaded",{source:this,pagesCount:e})},()=>{});const u=y=>{const w=this._pages[y.pageNumber-1];w&&a(this,Nn).push(w)};r._on("pagerender",u,{signal:c});const d=y=>{y.cssTransform||y.isDetailView||(this._onePageRenderedCapability.resolve({timestamp:y.timestamp}),r._off("pagerendered",d))};r._on("pagerendered",d,{signal:c}),Promise.all([i,n]).then(([y,w])=>{var F;if(t!==this.pdfDocument)return;this._firstPageCapability.resolve(y),this._optionalContentConfigPromise=s;const{annotationEditorMode:A,annotationMode:S,textLayerMode:E}=m(this,Z,f1).call(this,w);if(E!==Os.DISABLE){const I=p(this,sa,document.createElement("div"));I.id="hiddenCopyElement",l.before(I)}if(A!==ei.DISABLE){const I=A;t.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):Rb(I)?(p(this,bi,new sx(this.container,l,a(this,cf),a(this,Kd),a(this,Qd),a(this,Kh),r,t,o,a(this,Zd),a(this,ef),a(this,nf),a(this,rf),a(this,zh),a(this,qd),a(this,hf))),r.dispatch("annotationeditoruimanager",{source:this,uiManager:a(this,bi)}),I!==ei.NONE&&(m(this,Z,Xv).call(this,I),a(this,bi).updateMode(I))):console.error("Invalid AnnotationEditor mode: ".concat(I))}const x=this._scrollMode===dt.PAGE?null:l,C=this.currentScale,P=y.getViewport({scale:C*Ys.PDF_TO_CSS_UNITS});l.style.setProperty("--scale-factor",P.scale),o!=null&&o.background&&l.style.setProperty("--page-bg-color",o.background),((o==null?void 0:o.foreground)==="CanvasText"||(o==null?void 0:o.background)==="Canvas")&&(l.style.setProperty("--hcm-highlight-filter",t.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),l.style.setProperty("--hcm-highlight-selected-filter",t.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","ButtonText")));for(let I=1;I<=e;++I){const T=new o1({container:x,eventBus:r,id:I,scale:C,defaultViewport:P.clone(),optionalContentConfigPromise:s,renderingQueue:this.renderingQueue,textLayerMode:E,annotationMode:S,imageResourcesPath:this.imageResourcesPath,maxCanvasPixels:this.maxCanvasPixels,maxCanvasDim:this.maxCanvasDim,capCanvasAreaFactor:this.capCanvasAreaFactor,enableDetailCanvas:this.enableDetailCanvas,pageColors:o,l10n:this.l10n,layerProperties:this._layerProperties,enableHWA:a(this,tf),enableAutoLinking:a(this,af),minDurationToUpdateCanvas:a(this,of)});this._pages.push(T)}(F=this._pages[0])==null||F.setPdfPage(y),this._scrollMode===dt.PAGE?m(this,Z,Dc).call(this):this._spreadMode!==Le.NONE&&this._updateSpreadMode(),m(this,Z,p1).call(this,c).then(async()=>{var T,R;if(t!==this.pdfDocument)return;if((T=this.findController)==null||T.setDocument(t),(R=this._scriptingManager)==null||R.setDocument(t),a(this,sa)&&document.addEventListener("copy",m(this,Z,g1).bind(this,E),{signal:c}),a(this,bi)&&r.dispatch("annotationeditormodechanged",{source:this,mode:a(this,es)}),t.loadingParams.disableAutoFetch||e>Df.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let I=e-1;if(I<=0){this._pagesCapability.resolve();return}for(let _=2;_<=e;++_){const j=t.getPage(_).then(k=>{const U=this._pages[_-1];U.pdfPage||U.setPdfPage(k),--I===0&&this._pagesCapability.resolve()},k=>{console.error("Unable to get page ".concat(_," to initialize viewer"),k),--I===0&&this._pagesCapability.resolve()});_%Df.PAUSE_EAGER_PAGE_INIT===0&&await j}}),r.dispatch("pagesinit",{source:this}),t.getMetadata().then(({info:I})=>{t===this.pdfDocument&&I.Language&&(l.lang=I.Language)}),this.defaultRenderingQueue&&this.update()}).catch(y=>{console.error("Unable to initialize viewer",y),this._pagesCapability.reject(y)})}setPageLabels(t){var e,i;if(this.pdfDocument){t?Array.isArray(t)&&this.pdfDocument.numPages===t.length?this._pageLabels=t:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let s=0,n=this._pages.length;s<n;s++)this._pages[s].setPageLabel((i=(e=this._pageLabels)==null?void 0:e[s])!=null?i:null)}}_resetView(){var t,e;this._pages=[],this._currentPageNumber=1,this._currentScale=_g,this._currentScaleValue=null,this._pageLabels=null,p(this,Nn,new lP(Ib)),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=Promise.withResolvers(),this._onePageRenderedCapability=Promise.withResolvers(),this._pagesCapability=Promise.withResolvers(),this._scrollMode=dt.VERTICAL,this._previousScrollMode=dt.UNKNOWN,this._spreadMode=Le.NONE,p(this,$o,{previousPageNumber:1,scrollDown:!0,pages:[]}),(t=a(this,ia))==null||t.abort(),p(this,ia,null),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),(e=a(this,sa))==null||e.remove(),p(this,sa,null),m(this,Z,Gv).call(this),m(this,Z,Ep).call(this)}_scrollUpdate(){this.pagesCount!==0&&(a(this,is)&&clearTimeout(a(this,is)),p(this,is,setTimeout(()=>{p(this,is,null),this.update()},100)),this.update())}pageLabelToPageNumber(t){if(!this._pageLabels)return null;const e=this._pageLabels.indexOf(t);return e<0?null:e+1}scrollPageIntoView({pageNumber:t,destArray:e=null,allowNegativeOffset:i=!1,ignoreDestinationZoom:s=!1}){if(!this.pdfDocument)return;const n=Number.isInteger(t)&&this._pages[t-1];if(!n){console.error('scrollPageIntoView: "'.concat(t,'" is not a valid pageNumber parameter.'));return}if(this.isInPresentationMode||!e){this._setCurrentPageNumber(t,!0);return}let r=0,o=0,l=0,c=0,u,d;const f=n.rotation%180!==0,g=(f?n.height:n.width)/n.scale/Ys.PDF_TO_CSS_UNITS,v=(f?n.width:n.height)/n.scale/Ys.PDF_TO_CSS_UNITS;let y=0;switch(e[1].name){case"XYZ":r=e[2],o=e[3],y=e[4],r=r!==null?r:0,o=o!==null?o:v;break;case"Fit":case"FitB":y="page-fit";break;case"FitH":case"FitBH":o=e[2],y="page-width",o===null&&this._location?(r=this._location.left,o=this._location.top):(typeof o!="number"||o<0)&&(o=v);break;case"FitV":case"FitBV":r=e[2],l=g,c=v,y="page-height";break;case"FitR":r=e[2],o=e[3],l=e[4]-r,c=e[5]-o;let E=tb,x=eb;this.removePageBorders&&(E=x=0),u=(this.container.clientWidth-E)/l/Ys.PDF_TO_CSS_UNITS,d=(this.container.clientHeight-x)/c/Ys.PDF_TO_CSS_UNITS,y=Math.min(Math.abs(u),Math.abs(d));break;default:console.error('scrollPageIntoView: "'.concat(e[1].name,'" is not a valid destination type.'));return}if(s||(y&&y!==this._currentScale?this.currentScaleValue=y:this._currentScale===_g&&(this.currentScaleValue=fx)),y==="page-fit"&&!e[4]){m(this,Z,Ap).call(this,n);return}const w=[n.viewport.convertToViewportPoint(r,o),n.viewport.convertToViewportPoint(r+l,o+c)];let A=Math.min(w[0][0],w[1][0]),S=Math.min(w[0][1],w[1][1]);i||(A=Math.max(A,0),S=Math.max(S,0)),m(this,Z,Ap).call(this,n,{left:A,top:S})}_updateLocation(t){const e=this._currentScale,i=this._currentScaleValue,s=parseFloat(i)===e?Math.round(e*1e4)/100:i,n=t.id,r=this._pages[n-1],o=this.container,l=r.getPagePoint(o.scrollLeft-t.x,o.scrollTop-t.y),c=Math.round(l[0]),u=Math.round(l[1]);let d="#page=".concat(n);this.isInPresentationMode||(d+="&zoom=".concat(s,",").concat(c,",").concat(u)),this._location={pageNumber:n,scale:s,top:u,left:c,rotation:this._pagesRotation,pdfOpenParams:d}}update(){const t=this._getVisiblePages(),e=t.views,i=e.length;if(i===0)return;const s=Math.max(Ib,2*i+1);a(this,Nn).resize(s,t.ids);for(const{view:l,visibleArea:c}of e)l.updateVisibleArea(c);for(const l of a(this,Nn))t.ids.has(l.id)||l.updateVisibleArea(null);this.renderingQueue.renderHighestPriority(t);const n=this._spreadMode===Le.NONE&&(this._scrollMode===dt.PAGE||this._scrollMode===dt.VERTICAL),r=this._currentPageNumber;let o=!1;for(const l of e){if(l.percent<100)break;if(l.id===r&&n){o=!0;break}}this._setCurrentPageNumber(o?r:e[0].id),this._updateLocation(t.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(t){return this.container.contains(t)}focus(){this.container.focus()}get _isContainerRtl(){return getComputedStyle(this.container).direction==="rtl"}get isInPresentationMode(){return this.presentationModeState===gl.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===gl.CHANGING}get isHorizontalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const t=this._scrollMode===dt.PAGE?a(this,$o).pages:this._pages,e=this._scrollMode===dt.HORIZONTAL,i=e&&this._isContainerRtl;return yx({scrollEl:this.container,views:t,sortByVisibility:!0,horizontal:e,rtl:i})}cleanup(){for(const t of this._pages)t.renderingState!==bt.FINISHED&&t.reset()}_cancelRendering(){for(const t of this._pages)t.cancelRendering()}forceRendering(t){const e=t||this._getVisiblePages(),i=m(this,Z,w1).call(this,e),s=this._spreadMode!==Le.NONE&&this._scrollMode!==dt.HORIZONTAL,n=a(this,On)!==null||a(this,is)!==null&&e.views.some(o=>{var l;return(l=o.detailView)==null?void 0:l.renderingCancelled}),r=this.renderingQueue.getHighestPriority(e,this._pages,i,s,n);return r?(m(this,Z,y1).call(this,r).then(()=>{this.renderingQueue.renderView(r)}),!0):!1}get hasEqualPageSizes(){const t=this._pages[0];for(let e=1,i=this._pages.length;e<i;++e){const s=this._pages[e];if(s.width!==t.width||s.height!==t.height)return!1}return!0}getPagesOverview(){let t;return this._pages.map(e=>{const i=e.pdfPage.getViewport({scale:1}),s=nb(i);if(t===void 0)t=s;else if(this.enablePrintAutoRotate&&s!==t)return{width:i.height,height:i.width,rotation:(i.rotation-90)%360};return{width:i.width,height:i.height,rotation:i.rotation}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig({intent:"display"})):Promise.resolve(null)}set optionalContentConfigPromise(t){if(!(t instanceof Promise))throw new Error("Invalid optionalContentConfigPromise: ".concat(t));this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=t,this.refresh(!1,{optionalContentConfigPromise:t}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:t}))}get scrollMode(){return this._scrollMode}set scrollMode(t){if(this._scrollMode!==t){if(!wx(t))throw new Error("Invalid scroll mode: ".concat(t));this.pagesCount>Df.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=t,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:t}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(t=null){const e=this._scrollMode,i=this.viewer;i.classList.toggle("scrollHorizontal",e===dt.HORIZONTAL),i.classList.toggle("scrollWrapped",e===dt.WRAPPED),!(!this.pdfDocument||!t)&&(e===dt.PAGE?m(this,Z,Dc).call(this):this._previousScrollMode===dt.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&m(this,Z,Xn).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(t,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(t){if(this._spreadMode!==t){if(!Ax(t))throw new Error("Invalid spread mode: ".concat(t));this._spreadMode=t,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:t}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(t=null){if(!this.pdfDocument)return;const e=this.viewer,i=this._pages;if(this._scrollMode===dt.PAGE)m(this,Z,Dc).call(this);else if(e.textContent="",this._spreadMode===Le.NONE)for(const s of this._pages)e.append(s.div);else{const s=this._spreadMode-1;let n=null;for(let r=0,o=i.length;r<o;++r)n===null?(n=document.createElement("div"),n.className="spread",e.append(n)):r%2===s&&(n=n.cloneNode(!1),e.append(n)),n.append(i[r].div)}t&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&m(this,Z,Xn).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(t,!0),this.update())}_getPageAdvance(t,e=!1){switch(this._scrollMode){case dt.WRAPPED:{const{views:i}=this._getVisiblePages(),s=new Map;for(const{id:n,y:r,percent:o,widthPercent:l}of i){if(o===0||l<100)continue;let c=s.get(r);c||s.set(r,c||(c=[])),c.push(n)}for(const n of s.values()){const r=n.indexOf(t);if(r===-1)continue;const o=n.length;if(o===1)break;if(e)for(let l=r-1,c=0;l>=c;l--){const u=n[l],d=n[l+1]-1;if(u<d)return t-d}else for(let l=r+1,c=o;l<c;l++){const u=n[l],d=n[l-1]+1;if(u>d)return d-t}if(e){const l=n[0];if(l<t)return t-l+1}else{const l=n[o-1];if(l>t)return l-t+1}break}break}case dt.HORIZONTAL:break;case dt.PAGE:case dt.VERTICAL:{if(this._spreadMode===Le.NONE)break;const i=this._spreadMode-1;if(e&&t%2!==i)break;if(!e&&t%2===i)break;const{views:s}=this._getVisiblePages(),n=e?t-1:t+1;for(const{id:r,percent:o,widthPercent:l}of s)if(r===n){if(o>0&&l===100)return 2;break}break}}return 1}nextPage(){const t=this._currentPageNumber,e=this.pagesCount;if(t>=e)return!1;const i=this._getPageAdvance(t,!1)||1;return this.currentPageNumber=Math.min(t+i,e),!0}previousPage(){const t=this._currentPageNumber;if(t<=1)return!1;const e=this._getPageAdvance(t,!0)||1;return this.currentPageNumber=Math.max(t-e,1),!0}updateScale({drawingDelay:t,scaleFactor:e=null,steps:i=null,origin:s}){if(i===null&&e===null)throw new Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided.");if(!this.pdfDocument)return;let n=this._currentScale;if(e>0&&e!==1)n=Math.round(n*e*100)/100;else if(i){const r=i>0?q0:1/q0,o=i>0?Math.ceil:Math.floor;i=Math.abs(i);do n=o((n*r).toFixed(2)*10)/10;while(--i>0)}n=xA(n,px,gx),m(this,Z,Xn).call(this,n,{noScroll:!1,drawingDelay:t,origin:s})}increaseScale(t={}){var e;this.updateScale({...t,steps:(e=t.steps)!=null?e:1})}decreaseScale(t={}){var e;this.updateScale({...t,steps:-((e=t.steps)!=null?e:1)})}get containerTopLeft(){return a(this,Jd)||p(this,Jd,[this.container.offsetTop,this.container.offsetLeft])}get annotationEditorMode(){return a(this,bi)?a(this,es):ei.DISABLE}set annotationEditorMode({mode:t,editId:e=null,isFromKeyboard:i=!1,mustEnterInEditMode:s=!1,editComment:n=!1}){if(!a(this,bi))throw new Error("The AnnotationEditor is not enabled.");if(a(this,es)===t)return;if(!Rb(t))throw new Error("Invalid AnnotationEditor mode: ".concat(t));if(!this.pdfDocument)return;m(this,Z,Xv).call(this,t);const{eventBus:r,pdfDocument:o}=this,l=async()=>{m(this,Z,Ep).call(this),p(this,es,t),await a(this,bi).updateMode(t,e,i,s,n),!(t!==a(this,es)||o!==this.pdfDocument)&&r.dispatch("annotationeditormodechanged",{source:this,mode:t})};if(t===ei.NONE||a(this,es)===ei.NONE){const c=t!==ei.NONE;c||this.pdfDocument.annotationStorage.resetModifiedIds();for(const d of this._pages)d.toggleEditingMode(c);const u=m(this,Z,b1).call(this);if(c&&u){m(this,Z,Ep).call(this),p(this,Vo,new AbortController);const d=AbortSignal.any([a(this,ia).signal,a(this,Vo).signal]);r._on("pagerendered",({pageNumber:f})=>{u.delete(f),u.size===0&&p(this,Ho,setTimeout(l,0))},{signal:d});return}}l()}refresh(t=!1,e=Object.create(null)){if(this.pdfDocument){for(const i of this._pages)i.update(e);m(this,Z,Gv).call(this),t||this.update()}}}Nn=new WeakMap,Kd=new WeakMap,Zd=new WeakMap,es=new WeakMap,bi=new WeakMap,jo=new WeakMap,Qd=new WeakMap,Jd=new WeakMap,qd=new WeakMap,tf=new WeakMap,ef=new WeakMap,sf=new WeakMap,nf=new WeakMap,rf=new WeakMap,af=new WeakMap,ia=new WeakMap,of=new WeakMap,zh=new WeakMap,is=new WeakMap,Vo=new WeakMap,Ho=new WeakMap,Gh=new WeakMap,sa=new WeakMap,Xh=new WeakMap,lf=new WeakMap,Yh=new WeakMap,$o=new WeakMap,On=new WeakMap,Kh=new WeakMap,hf=new WeakMap,Zh=new WeakMap,cf=new WeakMap,Z=new WeakSet,f1=function(t){const e={annotationEditorMode:a(this,es),annotationMode:a(this,jo),textLayerMode:a(this,Zh)};return t&&(!t.includes(Tf.COPY)&&a(this,Zh)===Os.ENABLE&&(e.textLayerMode=Os.ENABLE_PERMISSIONS),t.includes(Tf.MODIFY_CONTENTS)||(e.annotationEditorMode=ei.DISABLE),!t.includes(Tf.MODIFY_ANNOTATIONS)&&!t.includes(Tf.FILL_INTERACTIVE_FORMS)&&a(this,jo)===kn.ENABLE_FORMS&&(e.annotationMode=kn.ENABLE)),e},p1=async function(t){if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return;const e=Promise.withResolvers(),i=new AbortController;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e.resolve()},{signal:AbortSignal.any([t,i.signal])}),await Promise.race([this._onePageRenderedCapability.promise,e.promise]),i.abort()},g1=function(t,e){const i=document.getSelection(),{focusNode:s,anchorNode:n}=i;if(n&&s&&i.containsNode(a(this,sa))){if(a(this,Gh)||t===Os.ENABLE_PERMISSIONS){cv(e);return}p(this,Gh,!0);const{classList:r}=this.viewer;r.add("copyAll");const o=new AbortController;window.addEventListener("keydown",l=>p(this,Xh,l.key==="Escape"),{signal:o.signal}),this.getAllText().then(async l=>{l!==null&&await navigator.clipboard.writeText(l)}).catch(l=>{console.warn("Something goes wrong when extracting the text: ".concat(l.message))}).finally(()=>{p(this,Gh,!1),p(this,Xh,!1),o.abort(),r.remove("copyAll")}),cv(e)}},Dc=function(){if(this._scrollMode!==dt.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const t=this._currentPageNumber,e=a(this,$o),i=this.viewer;if(i.textContent="",e.pages.length=0,this._spreadMode===Le.NONE&&!this.isInPresentationMode){const s=this._pages[t-1];i.append(s.div),e.pages.push(s)}else{const s=new Set,n=this._spreadMode-1;n===-1?s.add(t-1):t%2!==n?(s.add(t-1),s.add(t)):(s.add(t-2),s.add(t-1));const r=document.createElement("div");if(r.className="spread",this.isInPresentationMode){const o=document.createElement("div");o.className="dummyPage",r.append(o)}for(const o of s){const l=this._pages[o];l&&(r.append(l.div),e.pages.push(l))}i.append(r)}e.scrollDown=t>=e.previousPageNumber,e.previousPageNumber=t},Ap=function(t,e=null){const{div:i,id:s}=t;if(this._currentPageNumber!==s&&this._setCurrentPageNumber(s),this._scrollMode===dt.PAGE&&(m(this,Z,Dc).call(this),this.update()),!e&&!this.isInPresentationMode){const n=i.offsetLeft+i.clientLeft,r=n+i.clientWidth,{scrollLeft:o,clientWidth:l}=this.container;(this._scrollMode===dt.HORIZONTAL||n<o||r>o+l)&&(e={left:0,top:0})}TA(i,e),!this._currentScaleValue&&this._location&&(this._location=null)},m1=function(t){return t===this._currentScale||Math.abs(t-this._currentScale)<1e-15},Uv=function(t,e,{noScroll:i=!1,preset:s=!1,drawingDelay:n=-1,origin:r=null}){if(this._currentScaleValue=e.toString(),m(this,Z,m1).call(this,t)){s&&this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:e});return}this.viewer.style.setProperty("--scale-factor",t*Ys.PDF_TO_CSS_UNITS);const o=n>=0&&n<1e3;this.refresh(!0,{scale:t,drawingDelay:o?n:-1}),o&&p(this,On,setTimeout(()=>{p(this,On,null),this.refresh()},n));const l=this._currentScale;if(this._currentScale=t,!i){let c=this._currentPageNumber,u;if(this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(c=this._location.pageNumber,u=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:c,destArray:u,allowNegativeOffset:!0}),Array.isArray(r)){const d=t/l-1,[f,g]=this.containerTopLeft;this.container.scrollLeft+=(r[0]-g)*d,this.container.scrollTop+=(r[1]-f)*d}}this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:s?e:void 0}),this.defaultRenderingQueue&&this.update()},v1=function(){return this._spreadMode!==Le.NONE&&this._scrollMode!==dt.HORIZONTAL?2:1},Xn=function(t,e){let i=parseFloat(t);if(i>0)e.preset=!1,m(this,Z,Uv).call(this,i,t,e);else{const s=this._pages[this._currentPageNumber-1];if(!s)return;let n=tb,r=eb;this.isInPresentationMode?(n=r=4,this._spreadMode!==Le.NONE&&(n*=2)):this.removePageBorders?n=r=0:this._scrollMode===dt.HORIZONTAL&&([n,r]=[r,n]);const o=(this.container.clientWidth-n)/s.width*s.scale/a(this,Z,v1),l=(this.container.clientHeight-r)/s.height*s.scale;switch(t){case"page-actual":i=1;break;case"page-width":i=o;break;case"page-height":i=l;break;case"page-fit":i=Math.min(o,l);break;case"auto":const c=nb(s)?o:Math.min(l,o);i=Math.min(mx,c);break;default:console.error('#setScale: "'.concat(t,'" is an unknown zoom value.'));return}e.preset=!0,m(this,Z,Uv).call(this,i,t,e)}},Wv=function(){const t=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&m(this,Z,Xn).call(this,this._currentScaleValue,{noScroll:!0}),m(this,Z,Ap).call(this,t)},b1=function(){const t=this._getVisiblePages(),e=[],{ids:i,views:s}=t;for(const n of s){const{view:r}=n;if(!r.hasEditableAnnotations()){i.delete(r.id);continue}e.push(n)}return e.length===0?null:(this.renderingQueue.renderHighestPriority({first:e[0],last:e.at(-1),views:e,ids:i}),i)},y1=async function(t){if(t.pdfPage)return t.pdfPage;try{const e=await this.pdfDocument.getPage(t.id);return t.pdfPage||t.setPdfPage(e),e}catch(e){return console.error("Unable to get page for page view",e),null}},w1=function(t){var e,i;if(((e=t.first)==null?void 0:e.id)===1)return!0;if(((i=t.last)==null?void 0:i.id)===this.pagesCount)return!1;switch(this._scrollMode){case dt.PAGE:return a(this,$o).scrollDown;case dt.HORIZONTAL:return this.scroll.right}return this.scroll.down},zv=function(t=this.container.clientHeight){t!==a(this,lf)&&(p(this,lf,t),Ex.setProperty("--viewer-container-height","".concat(t,"px")))},A1=function(t){for(const e of t)if(e.target===this.container){m(this,Z,zv).call(this,Math.floor(e.borderBoxSize[0].blockSize)),p(this,Jd,null);break}},Gv=function(){a(this,On)!==null&&(clearTimeout(a(this,On)),p(this,On,null)),a(this,is)!==null&&(clearTimeout(a(this,is)),p(this,is,null))},Ep=function(){var t;(t=a(this,Vo))==null||t.abort(),p(this,Vo,null),a(this,Ho)!==null&&(clearTimeout(a(this,Ho)),p(this,Ho,null))},Xv=function(t){var e,i;switch(t){case ei.STAMP:(e=a(this,zh))==null||e.loadModel("altText");break;case ei.SIGNATURE:(i=a(this,Kh))==null||i.loadSignatures();break}};class E1 extends b0{_resetView(){super._resetView(),this._scrollMode=dt.PAGE,this._spreadMode=Le.NONE}set scrollMode(t){}_updateScrollMode(){}set spreadMode(t){}_updateSpreadMode(){}}globalThis.pdfjsViewer={AnnotationLayerBuilder:BA,DownloadManager:VA,EventBus:m0,FindState:Gn,GenericL10n:Go,LinkTarget:ga,parseQueryString:vg,PDFFindController:RA,PDFHistory:WC,PDFLinkService:g0,PDFPageView:o1,PDFScriptingManager:rP,PDFSinglePageViewer:E1,PDFViewer:b0,ProgressBar:Sx,RenderingStates:bt,ScrollMode:dt,SimpleLinkService:bg,SpreadMode:Le,StructTreeLayerBuilder:i1,TextLayerBuilder:Bp,XfaLayerBuilder:v0};const _b=h=>{let t;const e=new Set,i=(c,u)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const f=t;t=(u!=null?u:typeof d!="object"||d===null)?d:Object.assign({},t,d),e.forEach(g=>g(t,f))}},s=()=>t,o={setState:i,getState:s,getInitialState:()=>l,subscribe:c=>(e.add(c),()=>e.delete(c))},l=t=h(i,s,o);return o},hP=h=>h?_b(h):_b;function xi(h,t,e,i){function s(n){return n instanceof e?n:new e(function(r){r(n)})}return new(e||(e=Promise))(function(n,r){function o(u){try{c(i.next(u))}catch(d){r(d)}}function l(u){try{c(i.throw(u))}catch(d){r(d)}}function c(u){u.done?n(u.value):s(u.value).then(o,l)}c((i=i.apply(h,t||[])).next())})}function O(h,t,e,i){if(e==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?h!==t||!i:!t.has(h))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(h):i?i.value:t.get(h)}function Dt(h,t,e,i,s){if(typeof t=="function"?h!==t||!s:!t.has(h))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s?s.value=e:t.set(h,e),e}const Se={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},wa={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},cP={ENABLE:1},jp={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},Kc={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};class uP{constructor(){const t=window.devicePixelRatio||1;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}}function dP(h,t,e=!1){let i=h.offsetParent;if(!i){console.error("offsetParent is not set -- cannot scroll");return}let s=h.offsetTop+h.clientTop,n=h.offsetLeft+h.clientLeft;for(;i.clientHeight===i.scrollHeight&&i.clientWidth===i.scrollWidth||e&&(i.classList.contains("markedContent")||getComputedStyle(i).overflow==="hidden");)if(s+=i.offsetTop,n+=i.offsetLeft,i=i.offsetParent,!i)return;t&&(t.top!==void 0&&(s+=t.top),t.left!==void 0&&(n+=t.left,i.scrollLeft=n)),i.scrollTop=s}function fP(h,t,e=void 0){const i=function(r){n||(n=window.requestAnimationFrame(function(){n=null;const l=h.scrollLeft,c=s.lastX;l!==c&&(s.right=l>c),s.lastX=l;const u=h.scrollTop,d=s.lastY;u!==d&&(s.down=u>d),s.lastY=u,t(s)}))},s={right:!0,down:!0,lastX:h.scrollLeft,lastY:h.scrollTop,_eventHandler:i};let n=null;return h.addEventListener("scroll",i,{useCapture:!0,signal:e}),e==null||e.addEventListener("abort",()=>window.cancelAnimationFrame(n),{once:!0}),s}function pP(h,t,e=0){let i=e,s=h.length-1;if(s<0||!t(h[s]))return h.length;if(t(h[i]))return i;for(;i<s;){const n=i+s>>1,r=h[n];t(r)?s=n:i=n+1}return i}function gP({view:h,userUnit:t,rotate:e}){const[i,s,n,r]=h,o=e%180!==0,l=(n-i)/72*t,c=(r-s)/72*t;return{width:o?c:l,height:o?l:c}}function mP(h,t,e){if(h<2)return h;let i=t[h].div,s=i.offsetTop+i.clientTop;s>=e&&(i=t[h-1].div,s=i.offsetTop+i.clientTop);for(let n=h-2;n>=0&&(i=t[n].div,!(i.offsetTop+i.clientTop+i.clientHeight<=s));--n)h=n;return h}function vP({scrollEl:h,views:t,sortByVisibility:e=!1,horizontal:i=!1,rtl:s=!1}){const n=h.scrollTop,r=n+h.clientHeight,o=h.scrollLeft,l=o+h.clientWidth;function c(S){const E=S.div;return E.offsetTop+E.clientTop+E.clientHeight>n}function u(S){const E=S.div,x=E.offsetLeft+E.clientLeft,C=x+E.clientWidth;return s?x<l:C>o}const d=[],f=new Set,g=t.length;let v=pP(t,i?u:c);v>0&&v<g&&!i&&(v=mP(v,t,n));let y=i?l:-1;for(let S=v;S<g;S++){const E=t[S],x=E.div,C=x.offsetLeft+x.clientLeft,P=x.offsetTop+x.clientTop,F=x.clientWidth,I=x.clientHeight,T=C+F,R=P+I;if(y===-1)R>=r&&(y=R);else if((i?C:P)>y)break;if(R<=n||P>=r||T<=o||C>=l)continue;const _=Math.max(0,n-P)+Math.max(0,R-r),j=Math.max(0,o-C)+Math.max(0,T-l),k=(I-_)/I,U=(F-j)/F,ft=k*U*100|0;d.push({id:E.id,x:C,y:P,view:E,percent:ft,widthPercent:U*100|0}),f.add(E.id)}const w=d[0],A=d.at(-1);return e&&d.sort(function(S,E){const x=S.percent-E.percent;return Math.abs(x)>.001?-x:S.id-E.id}),{first:w,last:A,views:d,ids:f}}function bP(h){let t=Math.hypot(h.deltaX,h.deltaY);const e=Math.atan2(h.deltaY,h.deltaX);return-.25*Math.PI<e&&e<.75*Math.PI&&(t=-t),t}function yP(h){const t=h.deltaMode;let e=bP(h);const i=30,s=30;return t===WheelEvent.DOM_DELTA_PIXEL?e/=i*s:t===WheelEvent.DOM_DELTA_LINE&&(e/=s),e}function S1(h){return Number.isInteger(h)&&h%90===0}function wP(h){return Number.isInteger(h)&&Object.values(jp).includes(h)&&h!==jp.UNKNOWN}function AP(h){return Number.isInteger(h)&&Object.values(Kc).includes(h)&&h!==Kc.UNKNOWN}function EP(h){return h.width<=h.height}new Promise(function(h){window.requestAnimationFrame(h)});document.documentElement.style;(function(){const h=document.createElement("div");return h.style.width="round(down, calc(1.6666666666666665 * 792px), 1px)",h.style.width==="calc(1320px)"?Math.fround:t=>t})();const SP=3e4;class xP{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(t){this.pdfViewer=t}setThumbnailViewer(t){this.pdfThumbnailViewer=t}isHighestPriority(t){return this.highestPriorityPage===t.renderingId}renderHighestPriority(t){var e;this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),!this.pdfViewer.forceRendering(t)&&(this.isThumbnailViewEnabled&&(!((e=this.pdfThumbnailViewer)===null||e===void 0)&&e.forceRendering())||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),SP)))}getHighestPriority(t,e,i,s=!1){const n=t.views,r=n.length;if(r===0)return null;for(let d=0;d<r;d++){const f=n[d].view;if(!this.isViewFinished(f))return f}const o=t.first.id,l=t.last.id;if(l-o+1>r){const d=t.ids;for(let f=1,g=l-o;f<g;f++){const v=i?o+f:l-f;if(d.has(v))continue;const y=e[v-1];if(!this.isViewFinished(y))return y}}let c=i?l:o-2,u=e[c];return u&&!this.isViewFinished(u)||s&&(c+=i?1:-1,u=e[c],u&&!this.isViewFinished(u))?u:null}isViewFinished(t){return t.renderingState===Se.FINISHED}renderView(t){switch(t.renderingState){case Se.FINISHED:return!1;case Se.PAUSED:this.highestPriorityPage=t.renderingId,t.resume();break;case Se.RUNNING:this.highestPriorityPage=t.renderingId;break;case Se.INITIAL:this.highestPriorityPage=t.renderingId,t.draw().finally(()=>{this.renderHighestPriority()}).catch(e=>{e instanceof tc||console.error("renderView:",e)});break}return!0}}var Lc,Mc,ss,Yv,Kv,Zv,Qv,Db;const Lb=2,Mb=3;class y0{static getCanvas(t,e){const i=Dt(this,Lc,O(this,Lc,"f",Mc)||document.createElement("canvas"),"f",Mc);i.width=t,i.height=e;const s=i.getContext("2d",{alpha:!1});return s.save(),s.fillStyle="rgb(255, 255, 255)",s.fillRect(0,0,t,e),s.restore(),[i,i.getContext("2d")]}static destroyCanvas(){const t=O(this,Lc,"f",Mc);t&&(t.width=0,t.height=0),Dt(this,Lc,null,"f",Mc)}}Lc=y0;Mc={value:null};class CP{constructor({container:t,eventBus:e,id:i,defaultViewport:s,optionalContentConfigPromise:n,linkService:r,renderingQueue:o,pageColors:l,enableHWA:c,store:u,thumbnailWidth:d}){ss.add(this),this.id=i,this.renderingId="thumbnail"+i,this.pageLabel=null,this.pdfPage=null,this.rotation=0,this.viewport=s,this.pdfPageRotate=s.rotation,this._optionalContentConfigPromise=n||null,this.pageColors=l||null,this.enableHWA=c||!1,this.eventBus=e,this.linkService=r,this.renderingQueue=o,this.renderTask=null,this.renderingState=Se.INITIAL,this.resume=null,this.store=u,this.thumbnailWidth=d,this.loaded=!1;const f=document.createElement("div");f.className="thumbnail pdfSlickThumbHolder",f.setAttribute("data-page-number",this.id.toString()),this.div=f,O(this,ss,"m",Yv).call(this),t.append(f)}setPdfPage(t){this.pdfPage=t,this.pdfPageRotate=t.rotate;const e=(this.rotation+this.pdfPageRotate)%360;this.viewport=t.getViewport({scale:1,rotation:e}),this.reset()}reset(){this.cancelRendering(),this.renderingState=Se.INITIAL,this.div.removeAttribute("data-loaded"),this.loaded=!1,O(this,ss,"m",Yv).call(this)}update({rotation:t=null}){typeof t=="number"&&(this.rotation=t);const e=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:1,rotation:e}),this.reset()}cancelRendering(){this.renderTask&&(this.renderTask.cancel(),this.renderTask=null),this.resume=null}draw(){return xi(this,void 0,void 0,function*(){if(this.renderingState!==Se.INITIAL){console.error("Must be in new state before drawing");return}const{pdfPage:t}=this;if(!t)throw this.renderingState=Se.FINISHED,new Error("pdfPage is not loaded");this.renderingState=Se.RUNNING;const{ctx:e,canvas:i,transform:s}=O(this,ss,"m",Kv).call(this,Lb),n=this.viewport.clone({scale:Lb*this.scale}),r=u=>{if(!this.renderingQueue.isHighestPriority(this)){this.renderingState=Se.PAUSED,this.resume=()=>{this.renderingState=Se.RUNNING,u()};return}u()},o={canvasContext:e,transform:s,viewport:n,optionalContentConfigPromise:this._optionalContentConfigPromise,pageColors:this.pageColors},l=this.renderTask=t.render(o);l.onContinue=r;const c=l.promise.then(()=>O(this,ss,"m",Qv).call(this,l,i),u=>O(this,ss,"m",Qv).call(this,l,i,u));return c.finally(()=>{i.width=0,i.height=0,this.eventBus.dispatch("thumbnailrendered",{source:this,pageNumber:this.id,pdfPage:this.pdfPage})}),c})}setImage(t){if(this.renderingState!==Se.INITIAL)return;const{thumbnailCanvas:e,pdfPage:i,scale:s}=t;e&&(this.pdfPage||this.setPdfPage(i),!(s<this.scale)&&(this.renderingState=Se.FINISHED,O(this,ss,"m",Zv).call(this,e)))}setPageLabel(t){this.pageLabel=typeof t=="string"?t:null}}ss=new WeakSet,Yv=function(){const{width:t,height:e}=this.viewport,i=t/e;this.canvasWidth=this.thumbnailWidth,this.canvasHeight=this.canvasWidth/i|0,this.scale=this.canvasWidth/t;const{style:s}=this.div;s.setProperty("--thumbnail-width","".concat(this.canvasWidth,"px")),s.setProperty("--thumbnail-height","".concat(this.canvasHeight,"px"))},Kv=function(t=1,e=this.enableHWA){const i=document.createElement("canvas"),s=i.getContext("2d",{alpha:!1,willReadFrequently:!e}),n=new uP;i.width=t*this.canvasWidth*n.sx|0,i.height=t*this.canvasHeight*n.sy|0;const r=n.scaled?[n.sx,0,0,n.sy,0,0]:null;return{ctx:s,canvas:i,transform:r}},Zv=function(t){if(this.renderingState!==Se.FINISHED)throw new Error("#convertCanvasToImage: Rendering has not finished.");const e=O(this,ss,"m",Db).call(this,t);this.src=e.toDataURL(),this.div.setAttribute("data-loaded","true"),this.loaded=!0,this.store.getState()._setThumbnailView(this.id,this),e.width=0,e.height=0},Qv=function(t,e){return xi(this,arguments,void 0,function*(i,s,n=null){if(i===this.renderTask&&(this.renderTask=null),!(n instanceof tc)&&(this.renderingState=Se.FINISHED,O(this,ss,"m",Zv).call(this,s),n))throw n})},Db=function(t){const{ctx:e,canvas:i}=O(this,ss,"m",Kv).call(this,1,!0);if(t.width<=2*i.width)return e.drawImage(t,0,0,t.width,t.height,0,0,i.width,i.height),i;let s=i.width<<Mb,n=i.height<<Mb;const[r,o]=y0.getCanvas(s,n);for(;s>t.width||n>t.height;)s>>=1,n>>=1;for(o.drawImage(t,0,0,t.width,t.height,0,0,s,n);s>2*i.width;)o.drawImage(r,0,0,s,n,0,0,s>>1,n>>1),s>>=1,n>>=1;return e.drawImage(r,0,0,s,n,0,0,i.width,i.height),i};var us,x1,Jv,qv,C1,P1,T1;const PP=-19,kg="selected";class TP{constructor({container:t,eventBus:e,linkService:i,renderingQueue:s,pageColors:n,abortSignal:r,enableHWA:o,store:l,thumbnailWidth:c}){us.add(this),this.container=t,this.eventBus=e,this.linkService=i,this.renderingQueue=s,this.pageColors=n||null,this.enableHWA=o||!1,this.store=l,this.thumbnailWidth=c,this.scroll=fP(this.container,O(this,us,"m",x1).bind(this),r),O(this,us,"m",qv).call(this)}getThumbnail(t){return this._thumbnails[t]}scrollThumbnailIntoView(t){if(!this.pdfDocument)return;const e=this._thumbnails[t-1];if(!e){console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.');return}t!==this._currentPageNumber&&(this._thumbnails[this._currentPageNumber-1].div.classList.remove(kg),e.div.classList.add(kg));const{first:i,last:s,views:n}=O(this,us,"m",Jv).call(this);if(n.length>0){let r=!1;if(t<=i.id||t>=s.id)r=!0;else for(const{id:o,percent:l}of n)if(o===t){r=l<100;break}r&&dP(e.div,{top:PP})}this._currentPageNumber=t}get pagesRotation(){return this._pagesRotation}set pagesRotation(t){if(!S1(t))throw new Error("Invalid thumbnails rotation angle.");if(!this.pdfDocument||this._pagesRotation===t)return;this._pagesRotation=t;const e={rotation:t};for(const i of this._thumbnails)i.update(e)}cleanup(){for(const t of this._thumbnails)t.renderingState!==Se.FINISHED&&t.reset();y0.destroyCanvas()}setDocument(t){if(this.pdfDocument&&(O(this,us,"m",C1).call(this),O(this,us,"m",qv).call(this)),this.pdfDocument=t,!t)return;const e=t.getPage(1),i=t.getOptionalContentConfig({intent:"display"});e.then(s=>{var n;const r=t.numPages,o=s.getViewport({scale:1});for(let c=1;c<=r;++c){const u=new CP({container:this.container,eventBus:this.eventBus,id:c,defaultViewport:o.clone(),optionalContentConfigPromise:i,linkService:this.linkService,renderingQueue:this.renderingQueue,pageColors:this.pageColors,enableHWA:this.enableHWA,store:this.store,thumbnailWidth:this.thumbnailWidth});this._thumbnails.push(u)}(n=this._thumbnails[0])===null||n===void 0||n.setPdfPage(s),this._thumbnails[this._currentPageNumber-1].div.classList.add(kg),this.store.getState()._setThumbnailsViews(this._thumbnails)}).catch(s=>{console.error("Unable to initialize thumbnail viewer",s)})}setPageLabels(t){var e,i;if(this.pdfDocument){t?Array.isArray(t)&&this.pdfDocument.numPages===t.length?this._pageLabels=t:(this._pageLabels=null,console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let s=0,n=this._thumbnails.length;s<n;s++)this._thumbnails[s].setPageLabel((i=(e=this._pageLabels)===null||e===void 0?void 0:e[s])!==null&&i!==void 0?i:null)}}forceRendering(){const t=O(this,us,"m",Jv).call(this),e=O(this,us,"m",T1).call(this,t),i=this.renderingQueue.getHighestPriority(t,this._thumbnails,e);return i?(O(this,us,"m",P1).call(this,i).then(()=>{this.renderingQueue.renderView(i)}),!0):!1}}us=new WeakSet,x1=function(){this.renderingQueue.renderHighestPriority()},Jv=function(){return vP({scrollEl:this.container,views:this._thumbnails})},qv=function(){this._thumbnails=[],this._currentPageNumber=1,this._pageLabels=null,this._pagesRotation=0,this.container.textContent=""},C1=function(){for(const t of this._thumbnails)t.cancelRendering()},P1=function(t){return xi(this,void 0,void 0,function*(){if(t.pdfPage)return t.pdfPage;try{const e=yield this.pdfDocument.getPage(t.id);return t.pdfPage||t.setPdfPage(e),e}catch(e){return console.error("Unable to get page for thumb view",e),null}})},T1=function(t){var e,i;return((e=t.first)===null||e===void 0?void 0:e.id)===1?!0:((i=t.last)===null||i===void 0?void 0:i.id)===this._thumbnails.length?!1:this.scroll.down};function FP(h,t){const e=t.allXfaHtml,i=new bg,s=Math.round(aa.PDF_TO_CSS_UNITS*100)/100;for(const n of e==null?void 0:e.children){const r=document.createElement("div");r.className="xfaPrintedPage",h.append(r);const o=new v0({pdfPage:null,annotationStorage:t.annotationStorage,linkService:i,xfaHtml:n}),l=my(n,{scale:s});o.render({viewport:l,intent:"print"}),r.append(o.div)}}let jc=null;function IP(h,t,e,i,s,n,r){const o=h.scratchCanvas,l=s/aa.PDF;o.width=Math.floor(i.width*l),o.height=Math.floor(i.height*l);const c=o.getContext("2d");return c.save(),c.fillStyle="rgb(255, 255, 255)",c.fillRect(0,0,o.width,o.height),c.restore(),Promise.all([t.getPage(e),r]).then(function([u,d]){const f={canvasContext:c,transform:[l,0,0,l,0,0],viewport:u.getViewport({scale:1,rotation:i.rotation}),intent:"print",annotationMode:Bs.ENABLE_STORAGE,optionalContentConfigPromise:n,printAnnotationStorage:d};return u.render(f).promise.catch(v=>{throw v instanceof tc||console.error(v),v})})}class RP{constructor({pdfDocument:t,pagesOverview:e,printContainer:i,printResolution:s,printAnnotationStoragePromise:n=null}){this.pdfDocument=t,this.pagesOverview=e,this.printContainer=i,this._printResolution=s||150,this._optionalContentConfigPromise=t.getOptionalContentConfig({intent:"print"}),this._printAnnotationStoragePromise=n||Promise.resolve(),this.currentPage=-1,this.scratchCanvas=document.createElement("canvas")}layout(){this.throwIfInactive();const t=document.querySelector("body");t.setAttribute("data-pdfjsprinting","true");const{width:e,height:i}=this.pagesOverview[0];this.pagesOverview.every(n=>n.width===e&&n.height===i)||console.warn("Not all pages have the same size. The printed result may be incorrect!"),this.pageStyleSheet=document.createElement("style"),this.pageStyleSheet.textContent="@page { size: ".concat(e,"pt ").concat(i,"pt;}"),t.append(this.pageStyleSheet)}destroy(){if(jc!==this)return;this.printContainer.textContent="",document.querySelector("body").removeAttribute("data-pdfjsprinting"),this.pageStyleSheet&&(this.pageStyleSheet.remove(),this.pageStyleSheet=null),this.scratchCanvas.width=this.scratchCanvas.height=0,this.scratchCanvas=null,jc=null}renderPages(t){if(this.pdfDocument.isPureXfa)return FP(this.printContainer,this.pdfDocument),Promise.resolve();const e=this.pagesOverview.length,i=(s,n)=>{if(this.throwIfInactive(),++this.currentPage>=e){t({index:e,total:e}),s();return}const r=this.currentPage;t({index:r,total:e}),IP(this,this.pdfDocument,r+1,this.pagesOverview[r],this._printResolution,this._optionalContentConfigPromise,this._printAnnotationStoragePromise).then(this.useRenderedPage.bind(this)).then(function(){i(s,n)},n)};return new Promise(i)}useRenderedPage(){this.throwIfInactive();const t=document.createElement("img");this.scratchCanvas.toBlob(r=>{t.src=URL.createObjectURL(r)});const e=document.createElement("div");e.className="printedPage",e.append(t),this.printContainer.append(e);const{promise:i,resolve:s,reject:n}=Promise.withResolvers();return t.onload=s,t.onerror=n,i.catch(()=>{}).then(()=>{URL.revokeObjectURL(t.src)}),i}performPrint(){return this.throwIfInactive(),new Promise(t=>{setTimeout(()=>{if(!this.active){t();return}window.print(),setTimeout(t,20)},0)})}get active(){return this===jc}throwIfInactive(){if(!this.active)throw new Error("This print request was cancelled or completed.")}}const F1={instance:{supportsPrinting:!0,createPrintService(h){if(jc)throw new Error("The print service is created and active.");return jc=new RP(h)}}};var kt,Vc,Ve,va,ba,Nb,Hc,Ob,kb,Bb,jb,Bg,Vb,ac,Hb,$b,Ub,I1,t0;const _P=3e3,Wb="pdfPresentationMode",jg="pdfPresentationModeControls",DP=50,LP=.1,zb=50,Vg=Math.PI/6;class MP{constructor({container:t,pdfViewer:e,eventBus:i}){kt.add(this),Vc.set(this,wa.UNKNOWN),Ve.set(this,null),va.set(this,null),ba.set(this,null),this.container=t,this.pdfViewer=e,this.eventBus=i,this.contextMenuOpen=!1,this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0,this.touchSwipeState=null}request(){return xi(this,void 0,void 0,function*(){const{container:t,pdfViewer:e}=this;if(this.active||!e.pagesCount||!t.requestFullscreen)return!1;O(this,kt,"m",I1).call(this),O(this,kt,"m",Hc).call(this,wa.CHANGING);const i=t.requestFullscreen();Dt(this,Ve,{pageNumber:e.currentPageNumber,scaleValue:e.currentScaleValue,scrollMode:e.scrollMode,spreadMode:null,annotationEditorMode:null}),e.spreadMode!==Kc.NONE&&!(e.pageViewsReady&&e.hasEqualPageSizes)&&(console.warn("Ignoring Spread modes when entering PresentationMode, since the document may contain varying page sizes."),O(this,Ve,"f").spreadMode=e.spreadMode),e.annotationEditorMode!==J.DISABLE&&(O(this,Ve,"f").annotationEditorMode=e.annotationEditorMode);try{return yield i,e.focus(),!0}catch(s){O(this,kt,"m",t0).call(this),O(this,kt,"m",Hc).call(this,wa.NORMAL)}return!1})}get active(){return O(this,Vc,"f")===wa.CHANGING||O(this,Vc,"f")===wa.FULLSCREEN}}Vc=new WeakMap,Ve=new WeakMap,va=new WeakMap,ba=new WeakMap,kt=new WeakSet,Nb=function(t){if(!this.active)return;t.preventDefault();const e=yP(t),i=Date.now(),s=this.mouseScrollTimeStamp;if(!(i>s&&i-s<DP)&&((this.mouseScrollDelta>0&&e<0||this.mouseScrollDelta<0&&e>0)&&O(this,kt,"m",ac).call(this),this.mouseScrollDelta+=e,Math.abs(this.mouseScrollDelta)>=LP)){const n=this.mouseScrollDelta;O(this,kt,"m",ac).call(this),(n>0?this.pdfViewer.previousPage():this.pdfViewer.nextPage())&&(this.mouseScrollTimeStamp=i)}},Hc=function(t){Dt(this,Vc,t),this.eventBus.dispatch("presentationmodechanged",{source:this,state:t})},Ob=function(){var t;O(this,kt,"m",Hc).call(this,wa.FULLSCREEN),this.container.classList.add(Wb),setTimeout(()=>{this.pdfViewer.scrollMode=jp.PAGE,O(this,Ve,"f").spreadMode!==null&&(this.pdfViewer.spreadMode=Kc.NONE),this.pdfViewer.currentPageNumber=O(this,Ve,"f").pageNumber,this.pdfViewer.currentScaleValue="page-fit",O(this,Ve,"f").annotationEditorMode!==null&&(this.pdfViewer.annotationEditorMode={mode:J.NONE})},0),O(this,kt,"m",$b).call(this),O(this,kt,"m",Bg).call(this),this.contextMenuOpen=!1,(t=document.getSelection())===null||t===void 0||t.empty()},kb=function(){const t=this.pdfViewer.currentPageNumber;this.container.classList.remove(Wb),setTimeout(()=>{O(this,kt,"m",t0).call(this),O(this,kt,"m",Hc).call(this,wa.NORMAL),this.pdfViewer.scrollMode=O(this,Ve,"f").scrollMode,O(this,Ve,"f").spreadMode!==null&&(this.pdfViewer.spreadMode=O(this,Ve,"f").spreadMode),this.pdfViewer.currentScaleValue=O(this,Ve,"f").scaleValue,this.pdfViewer.currentPageNumber=t,O(this,Ve,"f").annotationEditorMode!==null&&(this.pdfViewer.annotationEditorMode={mode:O(this,Ve,"f").annotationEditorMode}),Dt(this,Ve,null)},0),O(this,kt,"m",Ub).call(this),O(this,kt,"m",Vb).call(this),O(this,kt,"m",ac).call(this),this.contextMenuOpen=!1},Bb=function(t){var e;if(this.contextMenuOpen){this.contextMenuOpen=!1,t.preventDefault();return}t.button===0&&(t.target.href&&(!((e=t.target.parentNode)===null||e===void 0)&&e.hasAttribute("data-internal-link"))||(t.preventDefault(),t.shiftKey?this.pdfViewer.previousPage():this.pdfViewer.nextPage()))},jb=function(){this.contextMenuOpen=!0},Bg=function(){this.controlsTimeout?clearTimeout(this.controlsTimeout):this.container.classList.add(jg),this.controlsTimeout=setTimeout(()=>{this.container.classList.remove(jg),delete this.controlsTimeout},_P)},Vb=function(){this.controlsTimeout&&(clearTimeout(this.controlsTimeout),this.container.classList.remove(jg),delete this.controlsTimeout)},ac=function(){this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0},Hb=function(t){if(this.active){if(t.touches.length>1){this.touchSwipeState=null;return}switch(t.type){case"touchstart":this.touchSwipeState={startX:t.touches[0].pageX,startY:t.touches[0].pageY,endX:t.touches[0].pageX,endY:t.touches[0].pageY};break;case"touchmove":if(this.touchSwipeState===null)return;this.touchSwipeState.endX=t.touches[0].pageX,this.touchSwipeState.endY=t.touches[0].pageY,t.preventDefault();break;case"touchend":if(this.touchSwipeState===null)return;let e=0;const i=this.touchSwipeState.endX-this.touchSwipeState.startX,s=this.touchSwipeState.endY-this.touchSwipeState.startY,n=Math.abs(Math.atan2(s,i));Math.abs(i)>zb&&(n<=Vg||n>=Math.PI-Vg)?e=i:Math.abs(s)>zb&&Math.abs(n-Math.PI/2)<=Vg&&(e=s),e>0?this.pdfViewer.previousPage():e<0&&this.pdfViewer.nextPage();break}}},$b=function(){if(O(this,ba,"f"))return;Dt(this,ba,new AbortController);const{signal:t}=O(this,ba,"f"),e=O(this,kt,"m",Hb).bind(this);window.addEventListener("mousemove",O(this,kt,"m",Bg).bind(this),{signal:t}),window.addEventListener("mousedown",O(this,kt,"m",Bb).bind(this),{signal:t}),window.addEventListener("wheel",O(this,kt,"m",Nb).bind(this),{passive:!1,signal:t}),window.addEventListener("keydown",O(this,kt,"m",ac).bind(this),{signal:t}),window.addEventListener("contextmenu",O(this,kt,"m",jb).bind(this),{signal:t}),window.addEventListener("touchstart",e,{signal:t}),window.addEventListener("touchmove",e,{signal:t}),window.addEventListener("touchend",e,{signal:t})},Ub=function(){var t;(t=O(this,ba,"f"))===null||t===void 0||t.abort(),Dt(this,ba,null)},I1=function(){O(this,va,"f")||(Dt(this,va,new AbortController),window.addEventListener("fullscreenchange",()=>{document.fullscreenElement?O(this,kt,"m",Ob).call(this):O(this,kt,"m",kb).call(this)},{signal:O(this,va,"f").signal}))},t0=function(){var t;(t=O(this,va,"f"))===null||t===void 0||t.abort(),Dt(this,va,null)};const NP={isDocumentLoaded:!1,pagesReady:!1,url:null,numPages:0,pageNumber:0,scale:0,scaleValue:"auto",pagesRotation:0,spreadMode:Kc.UNKNOWN,scrollMode:jp.UNKNOWN,documentOutline:null,attachments:new Map,thumbnails:new Map,thumbnailViews:new Map,annotationEditorMode:J.NONE,pdfSlick:null},R1=()=>hP((h,t)=>Object.assign(Object.assign({},NP),{_setThumbnailView:(e,i)=>{const s=new Map(t().thumbnails),n=new Map(t().thumbnailViews),{canvasWidth:r,canvasHeight:o,scale:l,rotation:c,loaded:u,pageLabel:d,src:f=null}=i;n.set(e,i),s.set(e,{pageNumber:e,width:r,height:o,scale:l,rotation:c,loaded:u,pageLabel:d,src:f}),h({thumbnailViews:n,thumbnails:s})},_setThumbnailsViews:e=>{const i=new Map(e.map(n=>[n.id,n])),s=new Map(e.map(n=>{const{canvasWidth:r,canvasHeight:o,scale:l,rotation:c,loaded:u,pageLabel:d,src:f=null}=n;return[n.id,{pageNumber:n.id,width:r,height:o,scale:l,rotation:c,loaded:u,pageLabel:d,src:f}]}));h({thumbnailViews:i,thumbnails:s})}}));var Sp,Ei,ol,ll,_1,D1;class OP{constructor({eventBus:t,slick:e,printDialog:i}){Sp.add(this),Ei.set(this,null),ol.set(this,null),ll.set(this,null),this.eventBus=t,this.slick=e,this.printDialog=i!=null?i:null,this.bindEvents()}get supportsPrinting(){return F1.instance.supportsPrinting}get printing(){return!!O(this,Ei,"f")}print(){return xi(this,void 0,void 0,function*(){var t,e;if(this.supportsPrinting){if(this.printing){console.warn("Ignored pdf print because of a pending print job.");return}yield(t=this.printDialog)===null||t===void 0?void 0:t.open({close:()=>this.abort()});try{this.eventBus.dispatch("beforeprint",{source:this})}finally{if(!this.printing)console.error("Expected print service to be initialized."),(e=this.printDialog)===null||e===void 0||e.close();else{const i=O(this,Ei,"f");yield i.renderPages(s=>{var n;return(n=this.printDialog)===null||n===void 0?void 0:n.progress(s)}).then(()=>i.performPrint()).catch(()=>{}).then(()=>{i===O(this,Ei,"f")&&this.abort()})}}}})}abort(){var t;O(this,Ei,"f")&&(O(this,Ei,"f").destroy(),(t=this.printDialog)===null||t===void 0||t.close(),this.eventBus.dispatch("afterprint",{source:this}))}bindEvents(){Dt(this,ol,new AbortController);const{signal:t}=O(this,ol,"f"),e={signal:t};this.eventBus._on("beforeprint",O(this,Sp,"m",_1).bind(this),e),this.eventBus._on("afterprint",O(this,Sp,"m",D1).bind(this),e),window.addEventListener("beforeprint",()=>this.eventBus.dispatch("beforeprint",{source:window}),e),window.addEventListener("afterprint",()=>this.eventBus.dispatch("afterprint",{source:window}),e),window.addEventListener("keydown",i=>{i.keyCode===80&&(i.ctrlKey||i.metaKey)&&!i.altKey&&(!i.shiftKey||window.chrome||window.opera)&&(this.print(),i.preventDefault(),i.stopImmediatePropagation())},{signal:t,capture:!0})}unbindEvents(){var t;(t=O(this,ol,"f"))===null||t===void 0||t.abort(),Dt(this,ol,null)}}Ei=new WeakMap,ol=new WeakMap,ll=new WeakMap,Sp=new WeakSet,_1=function(){if(!O(this,Ei,"f")&&this.supportsPrinting){if(!this.slick.viewer.pageViewsReady){this.slick.l10n.get("printing_not_ready",null).then(t=>{window.alert(t)});return}Dt(this,ll,kP()),Dt(this,Ei,F1.instance.createPrintService({pdfDocument:this.slick.document,pagesOverview:this.slick.viewer.getPagesOverview(),printContainer:O(this,ll,"f").element,printResolution:this.slick.printResolution,optionalContentConfigPromise:null,printAnnotationStoragePromise:null})),this.slick.forceRendering(),O(this,Ei,"f").layout()}},D1=function(){var t,e,i;O(this,Ei,"f")&&(O(this,Ei,"f").destroy(),Dt(this,Ei,null),(t=this.printDialog)===null||t===void 0||t.close(),(e=O(this,ll,"f"))===null||e===void 0||e.remove(),Dt(this,ll,null),(i=this.slick.document)===null||i===void 0||i.annotationStorage.resetModified()),this.slick.forceRendering()};function kP(){const h=document.createElement("div");h.classList.add("pdfSlickPrintContainer"),document.body.append(h);const t=document.createElement("style");return t.textContent="\n@page {\n margin: 0;\n}\n\n.pdfSlickPrintContainer {\n display: none;\n}\n\n@media print {\n body {\n background: rgb(0 0 0 / 0) none;\n }\n\n body[data-pdfjsprinting] > *:not(.pdfSlickPrintContainer) {\n display: none;\n }\n\n body[data-pdfjsprinting] .pdfSlickPrintContainer {\n display: block;\n }\n\n .pdfSlickPrintContainer {\n height: 100%;\n }\n\n /* wrapper around (scaled) print canvas elements */\n .pdfSlickPrintContainer > .printedPage {\n page-break-after: always;\n page-break-inside: avoid;\n\n /* The wrapper always cover the whole page. */\n height: 100%;\n width: 100%;\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n }\n\n .pdfSlickPrintContainer > .xfaPrintedPage .xfaPage {\n position: absolute;\n }\n\n .pdfSlickPrintContainer > .xfaPrintedPage {\n page-break-after: always;\n page-break-inside: avoid;\n width: 100%;\n height: 100%;\n position: relative;\n }\n\n .pdfSlickPrintContainer > .printedPage :is(canvas, img) {\n /* The intrinsic canvas / image size will make sure that we fit the page. */\n max-width: 100%;\n max-height: 100%;\n\n direction: ltr;\n display: block;\n }\n}",document.body.append(t),{get element(){return h},remove:()=>{h.remove(),t.remove()}}}class w0{static create(){let t=document.querySelector("#printServiceDialog");if(!t){const e=(i,s,n)=>{const r=document.createElement(i);return Object.entries(s).forEach(([o,l])=>r.setAttribute(o,l)),r.append(...n),r};t=e("dialog",{id:"printServiceDialog",class:"pdfSlick-dialog",style:"min-width: 200px;"},[e("div",{class:"row"},[e("span",{"data-l10n-id":"pdfjs-print-progress-message"},["Preparing document for printing…"])]),e("div",{class:"row"},[e("progress",{value:"0",max:"100"},[]),e("span",{"data-l10n-id":"pdfjs-print-progress-percent","data-l10n-args":'{ "progress": 0 }',class:"relative-progress"},["0%"])]),e("div",{class:"buttonRow"},[e("button",{id:"printCancel",class:"dialogButton",type:"button"},[e("span",{"data-l10n-id":"pdfjs-print-progress-close-button"},["Cancel"])])])]),document.body.append(t)}return new w0(t)}constructor(t){this.dialog=t}open(t){return xi(this,void 0,void 0,function*(){const e=this.dialog.querySelector("#printCancel"),i=()=>{var s;this.dialog.removeEventListener("close",i),this.dialog.removeEventListener("cancel",i),e==null||e.removeEventListener("click",i),(s=t==null?void 0:t.close)===null||s===void 0||s.call(t),this.close()};this.dialog.addEventListener("close",i),this.dialog.addEventListener("cancel",i),e==null||e.addEventListener("click",i),this.dialog.showModal()})}close(){this.dialog.close()}progress({index:t,total:e}){const i=Math.round(100*t/e),s=this.dialog.querySelector("progress"),n=this.dialog.querySelector(".relative-progress");s.value=i,n.setAttribute("data-l10n-args",JSON.stringify({progress:i}))}}var wi,hl,e0,i0,Vp,ya,xp,Cp,Nc,vl,L1,M1,Gb,N1,Xb,Yb,Kb,Zb,Qb,Jb,qb;Zn.workerSrc=new URL( window.__dynamic_base__+"/assets/pdf.worker.min-DD3ZEtk4.js",import.meta.url).toString();const BP={"8.5x11":"Letter","8.5x14":"Legal"},ty={"297x420":"A3","210x297":"A4"};function Hg(h,t,e){const i=t?h.width:h.height,s=t?h.height:h.width;return e["".concat(i,"x").concat(s)]}class jP{constructor({container:t,viewer:e,thumbs:i,store:s=R1(),options:n,onError:r,printDialog:o}){var l,c,u,d,f,g,v,y,w,A,S,E,x,C,P;wi.add(this),hl.set(this,void 0),e0.set(this,void 0),i0.set(this,void 0),Vp.set(this,void 0),ya.set(this,void 0),this.downloadManager=null,this.findController=null,this.pdfPresentationMode=null,this.document=null,xp.set(this,void 0),Cp.set(this,void 0),Nc.set(this,void 0),vl.set(this,void 0),Dt(this,e0,t),Dt(this,i0,e),Dt(this,Vp,i),Dt(this,Nc,r),this.l10n=(l=n==null?void 0:n.l10n)!==null&&l!==void 0?l:new Go(navigator.language),this.downloadManager=new VA,this.textLayerMode=(c=n==null?void 0:n.textLayerMode)!==null&&c!==void 0?c:cP.ENABLE,Dt(this,xp,(u=n==null?void 0:n.annotationMode)!==null&&u!==void 0?u:Bs.ENABLE_FORMS),Dt(this,Cp,(d=n==null?void 0:n.annotationEditorMode)!==null&&d!==void 0?d:J.NONE),this.annotationEditorHighlightColors=(f=n==null?void 0:n.annotationEditorHighlightColors)!==null&&f!==void 0?f:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",this.removePageBorders=(g=n==null?void 0:n.removePageBorders)!==null&&g!==void 0?g:!1,this.singlePageViewer=(v=n==null?void 0:n.singlePageViewer)!==null&&v!==void 0?v:!1,this.enablePrintAutoRotate=(y=n==null?void 0:n.enablePrintAutoRotate)!==null&&y!==void 0?y:!1,this.useOnlyCssZoom=(w=n==null?void 0:n.useOnlyCssZoom)!==null&&w!==void 0?w:!1,this.pageColors=(A=n==null?void 0:n.pageColors)!==null&&A!==void 0?A:null,this.maxCanvasPixels=(S=n==null?void 0:n.maxCanvasPixels)!==null&&S!==void 0?S:16777216,this.printResolution=(E=n==null?void 0:n.printResolution)!==null&&E!==void 0?E:96,this.thumbnailWidth=(x=n==null?void 0:n.thumbnailWidth)!==null&&x!==void 0?x:125,this.getDocumentParams=(C=n==null?void 0:n.getDocumentParams)!==null&&C!==void 0?C:{},this.pageColors&&!(CSS.supports("color",this.pageColors.background)&&CSS.supports("color",this.pageColors.foreground))&&((this.pageColors.background||this.pageColors.foreground)&&console.warn("PDFViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."),this.pageColors=null),this.store=s;const F=new xP;F.onIdle=this._cleanup.bind(this),F.isThumbnailViewEnabled=!0,Dt(this,hl,F);const I=new m0,T=new g0({eventBus:I,externalLinkTarget:2,externalLinkRel:"noopener noreferrer nofollow",ignoreDestinationZoom:!1}),R=new RA({eventBus:I,linkService:T}),_=Object.assign(Object.assign({container:t},e&&{viewer:e}),{eventBus:I,linkService:T,findController:R,renderingQueue:F,textLayerMode:this.textLayerMode,annotationEditorHighlightColors:this.annotationEditorHighlightColors,l10n:this.l10n,annotationMode:O(this,xp,"f"),annotationEditorMode:O(this,Cp,"f"),removePageBorders:this.removePageBorders,imageResourcesPath:"/images/"}),j=this.singlePageViewer?new E1(_):new b0(_);F.setViewer(j),i&&(this.thumbnailViewer=new TP({container:i,eventBus:I,linkService:T,renderingQueue:F,pageColors:this.pageColors,enableHWA:void 0,store:s,thumbnailWidth:this.thumbnailWidth}),F.setThumbnailViewer(this.thumbnailViewer)),document.fullscreenEnabled&&(this.pdfPresentationMode=new MP({container:t,pdfViewer:j,eventBus:I})),this.eventBus=I,this.linkService=T,this.findController=R,this.viewer=j,this.linkService.setViewer(j),Dt(this,ya,new OP({eventBus:I,slick:this,printDialog:o!=null?o:w0.create()}));const k=(P=n==null?void 0:n.scaleValue)!==null&&P!==void 0?P:"auto";this.store.setState({scaleValue:k})}loadDocument(t,e){return xi(this,void 0,void 0,function*(){var i,s,n,r,o;if(this.url&&typeof this.url=="string")try{URL.revokeObjectURL(this.url)}catch(l){}try{(i=this.document)===null||i===void 0||i.destroy(),(s=this.viewer)===null||s===void 0||s.cleanup(),t instanceof URL?this.url=t.toString():t instanceof ArrayBuffer?this.url=URL.createObjectURL(new Blob([t],{type:"application/pdf"})):this.url=t;const l=(n=e==null?void 0:e.filename)!==null&&n!==void 0?n:gy((r=this.url)===null||r===void 0?void 0:r.toString());this.filename=l;const c=vw(Object.assign(Object.assign({},this.getDocumentParams),{url:this.url,isEvalSupported:!1}));e!=null&&e.onProgress&&(c.onProgress=e.onProgress);const u=yield c.promise;this.document=u,this.viewer.setDocument(this.document),this.linkService.setDocument(this.document),this.thumbnailViewer&&((o=this.thumbnailViewer)===null||o===void 0||o.setDocument(u)),O(this,wi,"m",N1).call(this),yield O(this,wi,"m",L1).call(this),this.store.setState({filename:l,numPages:u.numPages,pageNumber:1,isDocumentLoaded:!0,url:t.toString()});const d=yield u.getAttachments(),f=new Map(Object.keys(d!=null?d:{}).sort((g,v)=>g.toLowerCase().localeCompare(v.toLowerCase())).map(g=>[g,d[g]]));this.store.setState({attachments:f}),yield O(this,wi,"m",M1).call(this),this.forceRendering()}catch(l){O(this,Nc,"f")&&O(this,Nc,"f").call(this,l)}})}forceRendering(t=!0){O(this,hl,"f").printing=!!O(this,ya,"f").printing,O(this,hl,"f").isThumbnailViewEnabled=t,O(this,hl,"f").renderHighestPriority()}gotoPage(t){this.linkService.goToPage(t)}openOrDownloadData(t,e){var i;(i=this.downloadManager)===null||i===void 0||i.openOrDownloadData(t,e)}download(){return xi(this,void 0,void 0,function*(){var t,e;const i=this.url,{filename:s}=this;try{const n=yield this.document.getData(),r=new Blob([n],{type:"application/pdf"});yield(t=this.downloadManager)===null||t===void 0?void 0:t.download(r,i,s)}catch(n){yield(e=this.downloadManager)===null||e===void 0?void 0:e.download(null,i,s)}})}save(){return xi(this,void 0,void 0,function*(){var t;const e=this.url,{filename:i}=this;try{const s=yield this.document.saveDocument(),n=new Blob([s],{type:"application/pdf"});yield(t=this.downloadManager)===null||t===void 0?void 0:t.download(n,e,i)}catch(s){console.error("Error when saving the document: ".concat(s.message)),yield this.download()}finally{}})}downloadOrSave(){var t;const{annotationStorage:e}=(t=this.document)!==null&&t!==void 0?t:{};e&&e.size>0?this.save():this.download()}get supportsPrinting(){return O(this,ya,"f").supportsPrinting}requestPresentationMode(){var t;(t=this.pdfPresentationMode)===null||t===void 0||t.request()}triggerPrinting(){O(this,ya,"f").print()}unbindEvents(){var t;(t=O(this,vl,"f"))===null||t===void 0||t.abort(),Dt(this,vl,null),O(this,ya,"f").unbindEvents()}_cleanup(){var t;if(this.document)try{this.viewer.cleanup(),(t=this.thumbnailViewer)===null||t===void 0||t.cleanup(),this.document.cleanup()}catch(e){console.error("Unable to perform cleanup",e)}}setAnnotationEditorMode(t){this.viewer.annotationEditorMode={mode:t},this.dispatch("switchannotationeditormode",{source:this,mode:t}),this.store.setState({annotationEditorMode:t})}setAnnotationEditorParams(t){const e=Array.isArray(t)?t:[t];for(const i of e)this.dispatch("switchannotationeditorparams",{source:this,type:i.type,value:i.value})}setHighlightDefaultColor(t){this.setAnnotationEditorMode(J.HIGHLIGHT),this.setAnnotationEditorParams([{type:ut.HIGHLIGHT_DEFAULT_COLOR,value:t}]),this.store.setState({highlightDefaultColor:t})}setSpreadMode(t){AP(t)&&(this.viewer.spreadMode=t,this.dispatch("switchspreadmode",{mode:t}))}setScrollMode(t){wP(t)&&(this.viewer.scrollMode=t,this.dispatch("switchscrollmode",{mode:t}))}setRotation(t){S1(t)&&(this.viewer.pagesRotation=t)}getPagesOverview(){var t,e;try{return(e=(t=this.viewer)===null||t===void 0?void 0:t.getPagesOverview())!==null&&e!==void 0?e:[]}catch(i){return[]}}increaseScale(){this.viewer.increaseScale()}decreaseScale(){this.viewer.decreaseScale()}set currentScaleValue(t){this.viewer.currentScaleValue=t}set currentScale(t){this.viewer.currentScale=t}getPageView(t){return this.viewer.getPageView(t)}on(t,e,i){this.eventBus.on(t,e,i)}off(t,e,i){this.eventBus.off(t,e,i)}dispatch(t,e){this.eventBus.dispatch(t,e)}}hl=new WeakMap,e0=new WeakMap,i0=new WeakMap,Vp=new WeakMap,ya=new WeakMap,xp=new WeakMap,Cp=new WeakMap,Nc=new WeakMap,vl=new WeakMap,wi=new WeakSet,L1=function(){return xi(this,void 0,void 0,function*(){var t;const i=(t=yield this.document.getPageLabels())!==null&&t!==void 0?t:[],s=i.length;let n=0,r=0;for(let c=0;c<s;c++){const u=i[c];if(u===(c+1).toString())n++;else if(u==="")r++;else break}if(n>=s||r>=s)return;const{viewer:o,thumbnailViewer:l}=this;o.setPageLabels(i),l==null||l.setPageLabels(i)})},M1=function(){return xi(this,void 0,void 0,function*(){const{info:t,contentLength:e}=yield this.document.getMetadata(),i=yield this.document.getPage(this.store.getState().pageNumber).then(s=>O(this,wi,"m",Gb).call(this,gP(s),0));this.store.setState({filesize:e,title:t.Title,author:t.Author,subject:t.Subject,keywords:t.Keywords,creator:t.Creator,producer:t.Producer,version:t.PDFFormatVersion,creationDate:Wc.toDateObject(t.CreationDate),modificationDate:Wc.toDateObject(t.ModDate),isLinearized:t.IsLinearized,pageSize:i})})},Gb=function(t,e){return xi(this,void 0,void 0,function*(){if(!t)return;e%180!==0&&(t={width:t.height,height:t.width});const i=EP(t);let s={width:Math.round(t.width*100)/100,height:Math.round(t.height*100)/100},n={width:Math.round(t.width*25.4*10)/10,height:Math.round(t.height*25.4*10)/10},r=Hg(s,i,BP)||Hg(n,i,ty);if(!r&&!(Number.isInteger(n.width)&&Number.isInteger(n.height))){const f={width:t.width*25.4,height:t.height*25.4},g={width:Math.round(n.width),height:Math.round(n.height)};Math.abs(f.width-g.width)<.1&&Math.abs(f.height-g.height)<.1&&(r=Hg(g,i,ty),r&&(s={width:Math.round(g.width/25.4*100)/100,height:Math.round(g.height/25.4*100)/100},n=g))}const[{width:o,height:l},c,u,d]=yield Promise.all([s,this.l10n.get("document_properties_page_size_unit_inches",null),r&&this.l10n.get("document_properties_page_size_name_".concat(r.toLowerCase()),null),this.l10n.get("document_properties_page_size_orientation_".concat(i?"portrait":"landscape"),null)]);return{width:o.toLocaleString(),height:l.toLocaleString(),unit:c,name:u,orientation:d}})},N1=function(){Dt(this,vl,new AbortController);const{signal:t}=O(this,vl,"f"),e={signal:t};this.eventBus._on("pagesinit",O(this,wi,"m",Xb).bind(this),e),this.eventBus._on("scalechanging",O(this,wi,"m",Qb).bind(this),e),this.eventBus._on("pagechanging",O(this,wi,"m",Jb).bind(this),e),this.eventBus._on("pagerendered",O(this,wi,"m",qb).bind(this),e),this.eventBus._on("rotationchanging",O(this,wi,"m",Yb).bind(this),e),this.eventBus._on("switchspreadmode",O(this,wi,"m",Kb).bind(this),e),this.eventBus._on("switchscrollmode",O(this,wi,"m",Zb).bind(this),e)},Xb=function(t){return xi(this,arguments,void 0,function*({source:e}){var i;const s=yield(i=this.document)===null||i===void 0?void 0:i.getOutline(),n=this.store.getState().scaleValue;e.currentScale=1,e.currentScaleValue="auto",this.store.setState({documentOutline:s,pageNumber:1,scaleValue:n,pagesReady:!0})})},Yb=function({pagesRotation:t,pageNumber:e}){this.store.setState({pagesRotation:t}),this.thumbnailViewer&&(this.thumbnailViewer.pagesRotation=t),this.forceRendering(),this.viewer.currentPageNumber=e},Kb=function({mode:t}){this.store.setState({spreadMode:t})},Zb=function({mode:t}){this.store.setState({scrollMode:t})},Qb=function({scale:t,presetValue:e}){this.store.setState({scale:t,scaleValue:e}),this.viewer.update()},Jb=function({pageNumber:t}){var e;(e=this.thumbnailViewer)===null||e===void 0||e.scrollThumbnailIntoView(t),this.store.setState({pageNumber:t})},qb=function({pageNumber:t,error:e}){var i;if(O(this,Vp,"f")){const s=this.viewer.getPageView(t-1),n=(i=this.thumbnailViewer)===null||i===void 0?void 0:i.getThumbnail(t-1);s&&n&&n.setImage(s)}};function VP(h){const t={...h},e={...h},i={},s=r=>{let o=i[r];if(!o){if(!W1())return t[r];i[r]=o=ns(t[r],{internal:!0}),delete t[r]}return o[0]()};for(const r in h)Object.defineProperty(e,r,{get:()=>s(r),enumerable:!0});const n=(r,o)=>{const l=i[r];if(l)return l[1](o);r in t&&(t[r]=C0(o,t[r]))};return[e,(r,o)=>{if(H1(r)){const l=$1(()=>Object.entries(C0(r,e)));U1(()=>{for(const[c,u]of l)n(c,()=>u)})}else n(r,o);return e}]}const O1={width:null,height:null};function $g(h){if(!h)return{...O1};const{width:t,height:e}=h.getBoundingClientRect();return{width:t,height:e}}function k1(h){const t=typeof h=="function",[e,i]=VP(z1.context||t?O1:$g(h)),s=new ResizeObserver(([n])=>i($g(n.target)));return Oc(()=>s.disconnect()),t?uf(()=>{const n=h();n&&(i($g(n)),s.observe(n),Oc(()=>s.unobserve(n)))}):(s.observe(h),Oc(()=>s.unobserve(h))),e}var HP=n0('<div id=viewerContainer><div id=viewer class="pdfSlickViewer pdfViewer">');function $P(h){const[t,e]=ns(),i=k1(t);return uf(()=>{var s;i.width&&i.height&&(h.store.pdfSlick&&(h.store.scaleValue==="auto"||h.store.scaleValue==="page-fit"||h.store.scaleValue==="page-width")&&(h.store.pdfSlick.viewer.currentScaleValue=h.store.scaleValue),(s=h.store.pdfSlick)==null||s.viewer.update())}),(()=>{var s=HP();return sy(n=>{h.viewerRef(n),e(n)},s),s.style.setProperty("position","absolute"),s.style.setProperty("inset","0"),s.style.setProperty("overflow","auto"),ry(()=>{var n;return ay(s,"pdfSlickContainer ".concat((n=h.class)!=null?n:""))}),s})()}var UP=n0("<div>");function WP(h){const[t,e]=ns(),i=k1(t);return uf(()=>{var s;i.width&&i.height&&((s=h.store.pdfSlick)==null||s.forceRendering())}),(()=>{var s=UP();return sy(n=>{h.thumbsRef(n),e(n)},s),s.style.setProperty("position","absolute"),s.style.setProperty("overflow","auto"),s.style.setProperty("inset","0"),ny(s,$(Pp,{get each(){return Array.from(h.store.thumbnailViews)},children:([n,r])=>$(X1,{get mount(){return r.div},get children(){var o;return h.children({pageNumber:n,width:r.canvasWidth,height:r.canvasHeight,scale:r.scale,src:(o=r==null?void 0:r.src)!=null?o:null,rotation:r.rotation,pageLabel:r.pageLabel,loaded:r.loaded})}})})),ry(n=>{var l,c;var r=(l=h.class)!=null?l:"",o=(c=h.classList)!=null?c:{};return r!==n.e&&ay(s,n.e=r),n.t=Y1(s,o,n.t),n},{e:void 0,t:void 0}),s})()}function zP(h,t=h.getState,e){const i=t(h.getState()),[s,n]=G1(i),r=(l,c)=>{t(c);const u=t(l);n(K1(u))},o=h.subscribe(r);return Oc(()=>o()),s}const GP=(h,t)=>{const[e,i]=ns(!1),[s,n]=ns(!1),[r,o]=ns(null),[l,c]=ns(null),[u,d]=ns(null),[f,g]=ns(null),v=R1(),y=zP(v),w=S=>{o(S),n(!0)},A=S=>{c(S)};return uf(()=>{if(h&&s()){const S=new jP({container:r(),thumbs:l(),store:v,options:t,onError:E=>d(E)});g(S),v.setState({pdfSlick:S}),S.loadDocument(h,t).then(()=>{i(!0)})}}),{isDocumentLoaded:e,viewerRef:w,thumbsRef:A,pdfSlick:f,pdfSlickStore:y,PDFSlickViewer:$P,PDFSlickThumbnails:WP,error:u}};function XP(h){return Wn({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="m7.976 10.072 4.357-4.357.62.618L8.284 11h-.618L3 6.333l.619-.618 4.357 4.357z" clip-rule="evenodd"/>'},h)}function YP(h){return Wn({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="m8.024 5.928-4.357 4.357-.62-.618L7.716 5h.618L13 9.667l-.619.618-4.357-4.357z" clip-rule="evenodd"/>'},h)}function KP(h){return Wn({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="m8 8.707 3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z" clip-rule="evenodd"/>'},h)}function ZP(h){return Wn({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2 1 1 2v12l1 1h12l1-1V2l-1-1H2Zm0 13V2h4v12H2Zm5 0V2h7v12H7Z"/>'},h)}function QP(h){return Wn({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M2 1 1 2v12l1 1h12l1-1V2l-1-1H2Zm12 13H7V2h7v12Z" clip-rule="evenodd"/>'},h)}function JP(h){return Wn({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2 5.56 2.413 5h11.194l.393.54L8.373 11h-.827L2 5.56z"/>'},h)}function qP(h){return Wn({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.56 14 5 13.587V2.393L5.54 2 11 7.627v.827L5.56 14z"/>'},h)}function tT(h){return Wn({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.027 6.149a5.52 5.52 0 0 1-1.27 3.908l4.26 4.26-.7.71-4.26-4.27a5.52 5.52 0 1 1 1.97-4.608zm-5.45 4.888a4.51 4.51 0 0 0 3.18-1.32l-.04.02a4.51 4.51 0 0 0 1.36-3.2 4.5 4.5 0 1 0-4.5 4.5zm2.44-4v-1h-2v-2h-1v2h-2v1h2v2h1v-2h2z" clip-rule="evenodd"/>'},h)}function eT(h){return Wn({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.027 6.149a5.52 5.52 0 0 1-1.27 3.908l4.26 4.26-.7.71-4.26-4.27a5.52 5.52 0 1 1 1.97-4.608zm-5.45 4.888a4.51 4.51 0 0 0 3.18-1.32l-.04.02a4.51 4.51 0 0 0 1.36-3.2 4.5 4.5 0 1 0-4.5 4.5zm-2.54-4.98h5v1h-5v-1z" clip-rule="evenodd"/>'},h)}var iT=n0("<form>");const WT=()=>{const{viewerRef:h,pdfSlickStore:t,PDFSlickViewer:e}=GP(Z1.raw_url),[i,s]=ns(1),{isOpen:n,onToggle:r,onClose:o}=Q1(),l=u=>{var f;u.preventDefault();const d=parseInt(i()+"");Number.isInteger(d)&&d>0&&d<=t.numPages?(f=t.pdfSlick)==null||f.linkService.goToPage(d):s(t.pageNumber)},c=({pageNumber:u})=>s(u);return uf(()=>{t.pdfSlick&&t.pdfSlick.on("pagechanging",c)}),Oc(()=>{t.pdfSlick&&t.pdfSlick.off("pagechanging",c)}),$(na,{w:"$full",h:"70vh",pos:"relative",display:"flex",get children(){return[$(nT,{store:t,get isOpen(){return n()},onClose:o}),$(J1,{w:"$full",h:"$full",pos:"relative",flex:1,get children(){return[$(rT,{store:t,get isOpen(){return n()},onToggle:r,wantedPageNumber:i,onPageNumberChange:s,onPageNumberSubmit:l}),$(e,{store:t,viewerRef:h})]}})]}})},sT=h=>{const[t,e]=ns(!0),i=()=>h.item.items&&h.item.items.length>0,s=()=>{var n;h.item.dest&&((n=h.store.pdfSlick)!=null&&n.linkService)&&h.store.pdfSlick.linkService.goToDestination(h.item.dest)};return $(na,{mb:"$1",get children(){return[$(Tp,{spacing:"$1",alignItems:"center",get children(){return[$(Uc,{get when(){return i()},get fallback(){return $(na,{w:"16px"})},get children(){return $(Yn,{size:"xs",variant:"ghost","aria-label":"Toggle",get icon(){return cl(()=>!!t())()?$(JP,{}):$(qP,{})},minW:"16px",h:"16px",onClick:()=>e(!t())})}}),$(ly,{variant:"ghost",size:"sm",justifyContent:"flex-start",flex:1,fontSize:"$sm",fontWeight:"$normal",py:"$1",px:"$2",h:"auto",minH:"$6",textAlign:"left",overflow:"hidden",onClick:s,_hover:{backgroundColor:"$neutral3"},get title(){return h.item.title},color:"$neutral12",get children(){return h.item.title}})]}}),$(Uc,{get when(){return cl(()=>!!i())()&&t()},get children(){return $(na,{get pl(){return"".concat((h.level+1)*16,"px")},get children(){return $(B1,{get items(){return h.item.items},get level(){return h.level+1},get store(){return h.store}})}})}})]}})},B1=h=>!h.items||h.items.length===0?null:$(Pp,{get each(){return h.items},children:t=>$(sT,{item:t,get level(){return h.level||0},get store(){return h.store}})}),nT=h=>{const t=oy();return $(Uc,{get when(){return h.isOpen},get children(){return $(na,{w:"280px",h:"$full",bgColor:"$neutral1",borderRight:"1px solid $neutral6",display:"flex",flexDirection:"column",transition:"all 0.3s ease",zIndex:"10",get children(){return[$(Tp,{spacing:"$2",p:"$3",borderBottom:"1px solid $neutral6",bgColor:"$neutral2",get children(){return[$(Fp,{fontWeight:"$semibold",color:"$neutral12",get children(){return t("home.preview.pdf.document_outline")}}),$(na,{flex:1}),$(ua,{withArrow:!0,get label(){return t("home.preview.pdf.close_sidebar")},get children(){return $(Yn,{size:"sm",get"aria-label"(){return t("home.preview.pdf.close_sidebar")},get icon(){return $(KP,{})},get onClick(){return h.onClose}})}})]}}),$(na,{flex:1,overflow:"auto",p:"$3",get children(){return $(q1,{spacing:"$2",alignItems:"stretch",get children(){return $(Uc,{get when(){return h.store.documentOutline&&h.store.documentOutline.length>0},get fallback(){return $(Fp,{size:"sm",color:"$neutral11",textAlign:"center",mt:"$4",get children(){return t("home.preview.pdf.no_outline")}})},get children(){return $(B1,{get items(){return h.store.documentOutline},get store(){return h.store}})}})}})}})]}})}})},rT=h=>{const t=oy();let e;const i=[["auto",t("home.preview.pdf.zoom_auto")],["page-actual",t("home.preview.pdf.zoom_actual")],["page-fit",t("home.preview.pdf.zoom_fit")],["page-width",t("home.preview.pdf.zoom_width")]],s=[[.5,t("home.preview.pdf.zoom_50")],[.75,t("home.preview.pdf.zoom_75")],[1,t("home.preview.pdf.zoom_100")],[1.25,t("home.preview.pdf.zoom_125")],[1.5,t("home.preview.pdf.zoom_150")],[2,t("home.preview.pdf.zoom_200")]],n=tE(()=>{if(h.store.scaleValue){const c=i.find(([u])=>u===h.store.scaleValue);if(c)return c[1]}return"".concat(Math.floor(h.store.scale*100),"%")}),r=c=>{h.store.pdfSlick&&(h.store.pdfSlick.currentScaleValue=c)},o=c=>{h.store.pdfSlick&&(h.store.pdfSlick.currentScale=c)},l=()=>h.store.annotationEditorMode===J.INK;return $(na,{pos:"absolute",left:"50%",transform:"translateX(-50%)",display:"flex",zIndex:"1",css:{top:"$2",bottom:"auto","@sm":{top:"auto",bottom:"$2"}},get children(){return $(Tp,{spacing:"$4",w:"auto",p:"$2",rounded:"$lg",shadow:"$lg",bgColor:"$neutral1",opacity:"0.7",transition:"all 0.2s ease-in-out",_hover:{opacity:"1"},css:{scale:"0.7","@sm":{scale:"1"}},get children(){return[$(Uc,{get when(){return h.store.documentOutline&&h.store.documentOutline.length>0},get children(){return $(ua,{withArrow:!0,get label(){return t("home.preview.pdf.toggle_sidebar")},get children(){return $(Yn,{size:"sm",colorScheme:"neutral",get"aria-label"(){return t("home.preview.pdf.toggle_sidebar")},get icon(){return cl(()=>!!h.isOpen)()?$(ZP,{}):$(QP,{})},get onClick(){return h.onToggle}})}})}}),$(ua,{withArrow:!0,get label(){return t("home.preview.pdf.toggle_pen")},get children(){return $(Yn,{size:"sm",get"aria-label"(){return t("home.preview.pdf.toggle_pen")},get colorScheme(){return l()&&"primary"||"neutral"},onClick:()=>{var u,d;const c=l()?J.NONE:J.INK;(u=h.store.pdfSlick)==null||u.setAnnotationEditorMode(c),(d=h.store.pdfSlick)==null||d.setAnnotationEditorParams({type:ut.INK_COLOR,value:"#ff0000"})},get icon(){return cl(()=>!!l())()&&$(eE,{})||$(iE,{})}})}}),$(Ag,{orientation:"vertical",h:"24px"}),$(sE,{colorScheme:"neutral",attached:!0,get children(){return[$(ua,{withArrow:!0,get label(){return t("home.preview.pdf.zoom_out")},get children(){return $(Yn,{size:"sm",get"aria-label"(){return t("home.preview.pdf.zoom_out")},get disabled(){return!h.store.pdfSlick||h.store.scale<=.25},onClick:()=>{var c,u;return(u=(c=h.store.pdfSlick)==null?void 0:c.viewer)==null?void 0:u.decreaseScale()},get icon(){return $(eT,{})}})}}),$(nE,{motionPreset:"scale-bottom-left",get children(){return[$(rE,{as:ly,size:"sm",minW:"60px",get children(){return $(Fp,{size:"sm",get children(){return cl(()=>!!h.store.pdfSlick)()?n():t("home.preview.pdf.loading")}})}}),$(aE,{get children(){return[$(P0,{get children(){return[$(T0,{get children(){return t("home.preview.pdf.zoom_presets")}}),$(Pp,{each:i,children:c=>$(F0,{onSelect:()=>r(c[0]),get children(){return c[1]}})})]}}),$(Ag,{role:"presentation",my:"$1"}),$(P0,{get children(){return[$(T0,{get children(){return t("home.preview.pdf.zoom_levels")}}),$(Pp,{each:s,children:c=>$(F0,{onSelect:()=>o(c[0]),get children(){return c[1]}})})]}})]}})]}}),$(ua,{withArrow:!0,get label(){return t("home.preview.pdf.zoom_in")},get children(){return $(Yn,{size:"sm",get"aria-label"(){return t("home.preview.pdf.zoom_in")},get disabled(){return!h.store.pdfSlick||h.store.scale>=5},onClick:()=>{var c,u;return(u=(c=h.store.pdfSlick)==null?void 0:c.viewer)==null?void 0:u.increaseScale()},get icon(){return $(tT,{})}})}})]}}),$(Ag,{orientation:"vertical",h:"24px"}),$(Tp,{spacing:"$2",alignItems:"center",get children(){return[(()=>{var c=iT();return oE(c,"submit",h.onPageNumberSubmit),ny(c,$(lE,{size:"sm",ref(u){var d=e;typeof d=="function"?d(u):e=u},type:"text",get value(){return h.wantedPageNumber()},w:"50px",textAlign:"center",onFocus:()=>e.select(),onChange:u=>h.onPageNumberChange(u.currentTarget.value)})),c})(),$(Fp,{size:"sm",minW:"$full",get children(){return["/ ",cl(()=>h.store.numPages)]}})]}}),$(ua,{withArrow:!0,get label(){return t("home.preview.pdf.prev_page")},get children(){return $(Yn,{size:"sm",get"aria-label"(){return t("home.preview.pdf.prev_page")},colorScheme:"neutral",get disabled(){return h.store.pageNumber<=1},onClick:()=>{var c,u;return(u=(c=h.store.pdfSlick)==null?void 0:c.viewer)==null?void 0:u.previousPage()},get icon(){return $(YP,{})}})}}),$(ua,{withArrow:!0,get label(){return t("home.preview.pdf.next_page")},get children(){return $(Yn,{size:"sm",get"aria-label"(){return t("home.preview.pdf.next_page")},colorScheme:"neutral",get disabled(){return!h.store.pdfSlick||h.store.pageNumber>=h.store.numPages},onClick:()=>{var c,u;return(u=(c=h.store.pdfSlick)==null?void 0:c.viewer)==null?void 0:u.nextPage()},get icon(){return $(XP,{})}})}})]}})}})};export{WT as default};
|